
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/


/**
 * AUTO-GENERATED FILE. DO NOT MODIFY.
 */

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { __extends } from "tslib";
import { each, map } from 'tvrender/lib/core/util.js';
import ComponentModel from '../../model/Component.js';
var TableModel = /** @class */function (_super) {
  __extends(TableModel, _super);
  function TableModel() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.type = TableModel.type;
    _this.ableDataZoomUpdate = false;
    return _this;
  }
  TableModel.prototype.mergeTables = function (tables) {
    var newTableById = {};
    each(tables, function (table) {
      newTableById[table.id] = table;
    });
    this.option.tables = map(this.option.tables, function (table) {
      var newTable = newTableById[table.id] || table;
      if (newTableById[table.id]) {
        newTableById[table.id] = void 0;
      }
      return newTable;
    }).filter(function (item) {
      return !item.isDelete;
    });
    each(newTableById, function (table) {
      if (table && !table.isDelete) {
        this.option.tables.push(table);
      }
    }, this);
  };
  TableModel.prototype.setAbleDataZoomUpdate = function (ableDataZoomUpdate) {
    this.ableDataZoomUpdate = ableDataZoomUpdate;
  };
  ;
  TableModel.type = 'table';
  // preventAutoZ = true;
  // readonly layoutMode = {type: 'box', ignoreSize: true} as const;
  TableModel.defaultOption = {
    z: 6,
    tables: [],
    paddings: 10,
    emphasis: {
      emphasisState: {
        // hoverLayer: true,
        zlevel: 1
      }
    }
  };
  return TableModel;
}(ComponentModel);
export default TableModel;