ToolboxModel.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * AUTO-GENERATED FILE. DO NOT MODIFY.
  21. */
  22. /*
  23. * Licensed to the Apache Software Foundation (ASF) under one
  24. * or more contributor license agreements. See the NOTICE file
  25. * distributed with this work for additional information
  26. * regarding copyright ownership. The ASF licenses this file
  27. * to you under the Apache License, Version 2.0 (the
  28. * "License"); you may not use this file except in compliance
  29. * with the License. You may obtain a copy of the License at
  30. *
  31. * http://www.apache.org/licenses/LICENSE-2.0
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  36. * KIND, either express or implied. See the License for the
  37. * specific language governing permissions and limitations
  38. * under the License.
  39. */
  40. import { __extends } from "tslib";
  41. import * as zrUtil from 'zrender/lib/core/util.js';
  42. import * as featureManager from './featureManager.js';
  43. import ComponentModel from '../../model/Component.js';
  44. var ToolboxModel = /** @class */function (_super) {
  45. __extends(ToolboxModel, _super);
  46. function ToolboxModel() {
  47. var _this = _super !== null && _super.apply(this, arguments) || this;
  48. _this.type = ToolboxModel.type;
  49. return _this;
  50. }
  51. ToolboxModel.prototype.optionUpdated = function () {
  52. _super.prototype.optionUpdated.apply(this, arguments);
  53. var ecModel = this.ecModel;
  54. zrUtil.each(this.option.feature, function (featureOpt, featureName) {
  55. var Feature = featureManager.getFeature(featureName);
  56. if (Feature) {
  57. if (Feature.getDefaultOption) {
  58. Feature.defaultOption = Feature.getDefaultOption(ecModel);
  59. }
  60. zrUtil.merge(featureOpt, Feature.defaultOption);
  61. }
  62. });
  63. };
  64. ToolboxModel.type = 'toolbox';
  65. ToolboxModel.layoutMode = {
  66. type: 'box',
  67. ignoreSize: true
  68. };
  69. ToolboxModel.defaultOption = {
  70. show: true,
  71. z: 6,
  72. // zlevel: 0,
  73. orient: 'horizontal',
  74. left: 'right',
  75. top: 'top',
  76. // right
  77. // bottom
  78. backgroundColor: 'transparent',
  79. borderColor: '#ccc',
  80. borderRadius: 0,
  81. borderWidth: 0,
  82. padding: 5,
  83. itemSize: 15,
  84. itemGap: 8,
  85. showTitle: true,
  86. iconStyle: {
  87. borderColor: '#666',
  88. color: 'none'
  89. },
  90. emphasis: {
  91. iconStyle: {
  92. borderColor: '#3E98C5'
  93. }
  94. },
  95. // textStyle: {},
  96. // feature
  97. tooltip: {
  98. show: false,
  99. position: 'bottom'
  100. }
  101. };
  102. return ToolboxModel;
  103. }(ComponentModel);
  104. export default ToolboxModel;