ToolboxModel.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. import tokens from '../../visual/tokens.js';
  45. var ToolboxModel = /** @class */function (_super) {
  46. __extends(ToolboxModel, _super);
  47. function ToolboxModel() {
  48. var _this = _super !== null && _super.apply(this, arguments) || this;
  49. _this.type = ToolboxModel.type;
  50. return _this;
  51. }
  52. ToolboxModel.prototype.optionUpdated = function () {
  53. _super.prototype.optionUpdated.apply(this, arguments);
  54. var ecModel = this.ecModel;
  55. zrUtil.each(this.option.feature, function (featureOpt, featureName) {
  56. var Feature = featureManager.getFeature(featureName);
  57. if (Feature) {
  58. if (Feature.getDefaultOption) {
  59. Feature.defaultOption = Feature.getDefaultOption(ecModel);
  60. }
  61. zrUtil.merge(featureOpt, Feature.defaultOption);
  62. }
  63. });
  64. };
  65. ToolboxModel.type = 'toolbox';
  66. ToolboxModel.layoutMode = {
  67. type: 'box',
  68. ignoreSize: true
  69. };
  70. ToolboxModel.defaultOption = {
  71. show: true,
  72. z: 6,
  73. // zlevel: 0,
  74. orient: 'horizontal',
  75. left: 'right',
  76. top: 'top',
  77. // right
  78. // bottom
  79. backgroundColor: 'transparent',
  80. borderColor: tokens.color.border,
  81. borderRadius: 0,
  82. borderWidth: 0,
  83. padding: tokens.size.m,
  84. itemSize: 15,
  85. itemGap: tokens.size.s,
  86. showTitle: true,
  87. iconStyle: {
  88. borderColor: tokens.color.accent50,
  89. color: 'none'
  90. },
  91. emphasis: {
  92. iconStyle: {
  93. borderColor: tokens.color.accent50
  94. }
  95. },
  96. // textStyle: {},
  97. // feature
  98. tooltip: {
  99. show: false,
  100. position: 'bottom'
  101. }
  102. };
  103. return ToolboxModel;
  104. }(ComponentModel);
  105. export default ToolboxModel;