@antv/l7-component 2.21.0 → 2.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/iconfont/iconfont.js +6 -6
- package/es/constants/index.js +2 -2
- package/es/control/baseControl/buttonControl.js +109 -144
- package/es/control/baseControl/control.js +212 -258
- package/es/control/baseControl/popperControl.js +67 -95
- package/es/control/baseControl/selectControl.js +132 -178
- package/es/control/exportImage.js +59 -142
- package/es/control/fullscreen.js +69 -100
- package/es/control/geoLocate.js +37 -84
- package/es/control/layerSwitch.js +111 -154
- package/es/control/logo.js +43 -69
- package/es/control/mapTheme.js +57 -98
- package/es/control/mouseLocation.js +37 -69
- package/es/control/scale.js +107 -135
- package/es/control/swipe.js +297 -393
- package/es/control/zoom.js +80 -112
- package/es/css/index.css +10 -7
- package/es/index.js +667 -1
- package/es/marker-layer.js +274 -326
- package/es/marker.d.ts +0 -2
- package/es/marker.js +394 -453
- package/es/popup/layerPopup.js +277 -321
- package/es/popup/popup.js +422 -482
- package/es/utils/anchor.js +6 -6
- package/es/utils/icon.js +4 -4
- package/es/utils/popper.js +180 -196
- package/es/utils/screenfull.js +29 -51
- package/lib/assets/iconfont/iconfont.js +6 -6
- package/lib/constants/index.d.ts +60 -0
- package/lib/constants/index.js +2 -2
- package/lib/control/baseControl/buttonControl.d.ts +60 -0
- package/lib/control/baseControl/buttonControl.js +110 -143
- package/lib/control/baseControl/control.d.ts +112 -0
- package/lib/control/baseControl/control.js +213 -257
- package/lib/control/baseControl/index.d.ts +4 -0
- package/lib/control/baseControl/index.js +5 -5
- package/lib/control/baseControl/popperControl.d.ts +28 -0
- package/lib/control/baseControl/popperControl.js +68 -94
- package/lib/control/baseControl/selectControl.d.ts +53 -0
- package/lib/control/baseControl/selectControl.js +133 -177
- package/lib/control/exportImage.d.ts +19 -0
- package/lib/control/exportImage.js +60 -141
- package/lib/control/fullscreen.d.ts +20 -0
- package/lib/control/fullscreen.js +70 -99
- package/lib/control/geoLocate.d.ts +17 -0
- package/lib/control/geoLocate.js +38 -83
- package/lib/control/layerSwitch.d.ts +27 -0
- package/lib/control/layerSwitch.js +112 -153
- package/lib/control/logo.d.ts +14 -0
- package/lib/control/logo.js +44 -69
- package/lib/control/mapTheme.d.ts +11 -0
- package/lib/control/mapTheme.js +58 -97
- package/lib/control/mouseLocation.d.ts +16 -0
- package/lib/control/mouseLocation.js +38 -68
- package/lib/control/scale.d.ts +35 -0
- package/lib/control/scale.js +108 -134
- package/lib/control/swipe.d.ts +66 -0
- package/lib/control/swipe.js +298 -392
- package/lib/control/zoom.d.ts +39 -0
- package/lib/control/zoom.js +81 -111
- package/lib/css/index.css +10 -7
- package/lib/index.d.ts +19 -0
- package/lib/index.js +683 -17
- package/lib/interface.d.ts +18 -0
- package/lib/marker-layer.d.ts +55 -0
- package/lib/marker-layer.js +276 -324
- package/lib/marker.d.ts +58 -0
- package/lib/marker.js +395 -452
- package/lib/popup/layerPopup.d.ts +99 -0
- package/lib/popup/layerPopup.js +278 -320
- package/lib/popup/popup.d.ts +142 -0
- package/lib/popup/popup.js +423 -481
- package/lib/utils/anchor.d.ts +22 -0
- package/lib/utils/anchor.js +6 -6
- package/lib/utils/icon.d.ts +1 -0
- package/lib/utils/icon.js +6 -5
- package/lib/utils/popper.d.ts +76 -0
- package/lib/utils/popper.js +184 -196
- package/lib/utils/screenfull.d.ts +2 -0
- package/lib/utils/screenfull.js +29 -52
- package/package.json +16 -20
- package/CHANGELOG.md +0 -325
- package/LICENSE.md +0 -21
|
@@ -1,302 +1,256 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
8
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
3
|
import { PositionType } from '@antv/l7-core';
|
|
12
4
|
import { DOM } from '@antv/l7-utils';
|
|
13
5
|
import EventEmitter from 'eventemitter3';
|
|
14
6
|
export { PositionType } from '@antv/l7-core';
|
|
15
7
|
export { Control };
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
export default class Control extends EventEmitter {
|
|
9
|
+
constructor(option) {
|
|
10
|
+
super();
|
|
11
|
+
/**
|
|
12
|
+
* 当前控件实例配置
|
|
13
|
+
*/
|
|
14
|
+
_defineProperty(this, "controlOption", void 0);
|
|
15
|
+
/**
|
|
16
|
+
* 控件的 DOM 容器
|
|
17
|
+
* @protected
|
|
18
|
+
*/
|
|
19
|
+
_defineProperty(this, "container", void 0);
|
|
20
|
+
/**
|
|
21
|
+
* 当前控件是否显示
|
|
22
|
+
* @protected
|
|
23
|
+
*/
|
|
24
|
+
_defineProperty(this, "isShow", void 0);
|
|
25
|
+
_defineProperty(this, "sceneContainer", void 0);
|
|
26
|
+
_defineProperty(this, "scene", void 0);
|
|
27
|
+
_defineProperty(this, "mapsService", void 0);
|
|
28
|
+
_defineProperty(this, "renderService", void 0);
|
|
29
|
+
_defineProperty(this, "layerService", void 0);
|
|
30
|
+
_defineProperty(this, "controlService", void 0);
|
|
31
|
+
_defineProperty(this, "configService", void 0);
|
|
32
|
+
Control.controlCount++;
|
|
33
|
+
this.controlOption = _objectSpread(_objectSpread({}, this.getDefault(option)), option || {});
|
|
34
|
+
}
|
|
35
|
+
getOptions() {
|
|
36
|
+
return this.controlOption;
|
|
37
|
+
}
|
|
22
38
|
|
|
23
39
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
40
|
+
* 更新配置的方法,子类如果有自己的配置,也需要重写该方法
|
|
41
|
+
* @param newOptions
|
|
26
42
|
*/
|
|
43
|
+
setOptions(newOptions) {
|
|
44
|
+
const defaultOptions = this.getDefault(newOptions);
|
|
45
|
+
Object.entries(newOptions).forEach(([key, value]) => {
|
|
46
|
+
if (value === undefined) {
|
|
47
|
+
newOptions[key] = defaultOptions[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if ('position' in newOptions) {
|
|
51
|
+
this.setPosition(newOptions.position);
|
|
52
|
+
}
|
|
53
|
+
if ('className' in newOptions) {
|
|
54
|
+
this.setClassName(newOptions.className);
|
|
55
|
+
}
|
|
56
|
+
if ('style' in newOptions) {
|
|
57
|
+
this.setStyle(newOptions.style);
|
|
58
|
+
}
|
|
59
|
+
this.controlOption = _objectSpread(_objectSpread({}, this.controlOption), newOptions);
|
|
60
|
+
}
|
|
27
61
|
|
|
28
62
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
63
|
+
* 当 Control 被添加至 Scene 中,被 controlService 调用的方法
|
|
64
|
+
* @param sceneContainer
|
|
31
65
|
*/
|
|
66
|
+
addTo(sceneContainer) {
|
|
67
|
+
// 初始化各个 Service 实例
|
|
68
|
+
this.mapsService = sceneContainer.mapService;
|
|
69
|
+
this.renderService = sceneContainer.rendererService;
|
|
70
|
+
this.layerService = sceneContainer.layerService;
|
|
71
|
+
this.controlService = sceneContainer.controlService;
|
|
72
|
+
this.configService = sceneContainer.globalConfigService;
|
|
73
|
+
this.scene = sceneContainer.sceneService;
|
|
74
|
+
this.sceneContainer = sceneContainer;
|
|
75
|
+
this.isShow = true;
|
|
32
76
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
key: "getOptions",
|
|
43
|
-
value: function getOptions() {
|
|
44
|
-
return this.controlOption;
|
|
77
|
+
// 初始化 container
|
|
78
|
+
this.container = this.onAdd();
|
|
79
|
+
DOM.addClass(this.container, 'l7-control');
|
|
80
|
+
const {
|
|
81
|
+
className,
|
|
82
|
+
style
|
|
83
|
+
} = this.controlOption;
|
|
84
|
+
if (className) {
|
|
85
|
+
this.setClassName(className);
|
|
45
86
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* 更新配置的方法,子类如果有自己的配置,也需要重写该方法
|
|
49
|
-
* @param newOptions
|
|
50
|
-
*/
|
|
51
|
-
}, {
|
|
52
|
-
key: "setOptions",
|
|
53
|
-
value: function setOptions(newOptions) {
|
|
54
|
-
var defaultOptions = this.getDefault(newOptions);
|
|
55
|
-
Object.entries(newOptions).forEach(function (_ref2) {
|
|
56
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
57
|
-
key = _ref3[0],
|
|
58
|
-
value = _ref3[1];
|
|
59
|
-
if (value === undefined) {
|
|
60
|
-
newOptions[key] = defaultOptions[key];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
if ('position' in newOptions) {
|
|
64
|
-
this.setPosition(newOptions.position);
|
|
65
|
-
}
|
|
66
|
-
if ('className' in newOptions) {
|
|
67
|
-
this.setClassName(newOptions.className);
|
|
68
|
-
}
|
|
69
|
-
if ('style' in newOptions) {
|
|
70
|
-
this.setStyle(newOptions.style);
|
|
71
|
-
}
|
|
72
|
-
this.controlOption = _objectSpread(_objectSpread({}, this.controlOption), newOptions);
|
|
87
|
+
if (style) {
|
|
88
|
+
this.setStyle(style);
|
|
73
89
|
}
|
|
90
|
+
// 将 container 插入容器中
|
|
91
|
+
this.insertContainer();
|
|
92
|
+
this.emit('add', this);
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
74
95
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
key: "addTo",
|
|
81
|
-
value: function addTo(sceneContainer) {
|
|
82
|
-
// 初始化各个 Service 实例
|
|
83
|
-
this.mapsService = sceneContainer.mapService;
|
|
84
|
-
this.renderService = sceneContainer.rendererService;
|
|
85
|
-
this.layerService = sceneContainer.layerService;
|
|
86
|
-
this.controlService = sceneContainer.controlService;
|
|
87
|
-
this.configService = sceneContainer.globalConfigService;
|
|
88
|
-
this.scene = sceneContainer.sceneService;
|
|
89
|
-
this.sceneContainer = sceneContainer;
|
|
90
|
-
this.isShow = true;
|
|
91
|
-
|
|
92
|
-
// 初始化 container
|
|
93
|
-
this.container = this.onAdd();
|
|
94
|
-
DOM.addClass(this.container, 'l7-control');
|
|
95
|
-
var _this$controlOption = this.controlOption,
|
|
96
|
-
className = _this$controlOption.className,
|
|
97
|
-
style = _this$controlOption.style;
|
|
98
|
-
if (className) {
|
|
99
|
-
this.setClassName(className);
|
|
100
|
-
}
|
|
101
|
-
if (style) {
|
|
102
|
-
this.setStyle(style);
|
|
103
|
-
}
|
|
104
|
-
// 将 container 插入容器中
|
|
105
|
-
this.insertContainer();
|
|
106
|
-
this.emit('add', this);
|
|
96
|
+
/**
|
|
97
|
+
* 将控件移除时触发
|
|
98
|
+
*/
|
|
99
|
+
remove() {
|
|
100
|
+
if (!this.mapsService) {
|
|
107
101
|
return this;
|
|
108
102
|
}
|
|
103
|
+
DOM.remove(this.container);
|
|
104
|
+
this.onRemove();
|
|
105
|
+
this.emit('remove', this);
|
|
106
|
+
}
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (!this.mapsService) {
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
DOM.remove(this.container);
|
|
120
|
-
this.onRemove();
|
|
121
|
-
this.emit('remove', this);
|
|
122
|
-
}
|
|
108
|
+
/**
|
|
109
|
+
* Control 被添加的时候被调用,返回 Control 对应的 DOM 容器
|
|
110
|
+
*/
|
|
111
|
+
onAdd() {
|
|
112
|
+
return DOM.create('div');
|
|
113
|
+
}
|
|
123
114
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
value: function onAdd() {
|
|
130
|
-
return DOM.create('div');
|
|
131
|
-
}
|
|
115
|
+
/**
|
|
116
|
+
* Control 被移除时调用
|
|
117
|
+
*/
|
|
118
|
+
// tslint:disable-next-line:no-empty
|
|
119
|
+
onRemove() {}
|
|
132
120
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
121
|
+
/**
|
|
122
|
+
* 显示控件时触发
|
|
123
|
+
*/
|
|
124
|
+
show() {
|
|
125
|
+
const container = this.container;
|
|
126
|
+
DOM.removeClass(container, 'l7-control--hide');
|
|
127
|
+
this.isShow = true;
|
|
128
|
+
this.emit('show', this);
|
|
129
|
+
}
|
|
140
130
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.emit('show', this);
|
|
151
|
-
}
|
|
131
|
+
/**
|
|
132
|
+
* 隐藏控件时触发
|
|
133
|
+
*/
|
|
134
|
+
hide() {
|
|
135
|
+
const container = this.container;
|
|
136
|
+
DOM.addClass(container, 'l7-control--hide');
|
|
137
|
+
this.isShow = false;
|
|
138
|
+
this.emit('hide', this);
|
|
139
|
+
}
|
|
152
140
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
141
|
+
/**
|
|
142
|
+
* 获取默认构造器参数
|
|
143
|
+
*/
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
145
|
+
getDefault(option) {
|
|
146
|
+
// tslint:disable-next-line:no-object-literal-type-assertion
|
|
147
|
+
return {
|
|
148
|
+
position: PositionType.TOPRIGHT,
|
|
149
|
+
name: `${Control.controlCount}`
|
|
150
|
+
};
|
|
151
|
+
}
|
|
164
152
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
value: function getDefault(option) {
|
|
172
|
-
// tslint:disable-next-line:no-object-literal-type-assertion
|
|
173
|
-
return {
|
|
174
|
-
position: PositionType.TOPRIGHT,
|
|
175
|
-
name: "".concat(Control.controlCount)
|
|
176
|
-
};
|
|
177
|
-
}
|
|
153
|
+
/**
|
|
154
|
+
* 获取当前控件对应的 DOM 容器
|
|
155
|
+
*/
|
|
156
|
+
getContainer() {
|
|
157
|
+
return this.container;
|
|
158
|
+
}
|
|
178
159
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
160
|
+
/**
|
|
161
|
+
* 获取当前 Control 是否展示
|
|
162
|
+
*/
|
|
163
|
+
getIsShow() {
|
|
164
|
+
return this.isShow;
|
|
165
|
+
}
|
|
166
|
+
_refocusOnMap(e) {
|
|
167
|
+
// if map exists and event is not a keyboard event
|
|
168
|
+
if (this.mapsService && e && e.screenX > 0 && e.screenY > 0) {
|
|
169
|
+
const container = this.mapsService.getContainer();
|
|
170
|
+
if (container !== null) {
|
|
171
|
+
container.focus();
|
|
172
|
+
}
|
|
186
173
|
}
|
|
174
|
+
}
|
|
187
175
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
176
|
+
/**
|
|
177
|
+
* 设置当前控件位置
|
|
178
|
+
* @param position
|
|
179
|
+
*/
|
|
180
|
+
setPosition(position = PositionType.TOPLEFT) {
|
|
181
|
+
// 考虑组件的自动布局,需要销毁重建
|
|
182
|
+
const controlService = this.controlService;
|
|
183
|
+
if (controlService) {
|
|
184
|
+
controlService.removeControl(this);
|
|
195
185
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
// if map exists and event is not a keyboard event
|
|
200
|
-
if (this.mapsService && e && e.screenX > 0 && e.screenY > 0) {
|
|
201
|
-
var container = this.mapsService.getContainer();
|
|
202
|
-
if (container !== null) {
|
|
203
|
-
container.focus();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
186
|
+
this.controlOption.position = position;
|
|
187
|
+
if (controlService) {
|
|
188
|
+
controlService.addControl(this, this.sceneContainer);
|
|
206
189
|
}
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
207
192
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
controlService.removeControl(this);
|
|
220
|
-
}
|
|
221
|
-
this.controlOption.position = position;
|
|
222
|
-
if (controlService) {
|
|
223
|
-
controlService.addControl(this, this.sceneContainer);
|
|
224
|
-
}
|
|
225
|
-
return this;
|
|
193
|
+
/**
|
|
194
|
+
* 设置容器 container 的样式相关位置,包含 className
|
|
195
|
+
* @param className
|
|
196
|
+
*/
|
|
197
|
+
setClassName(className) {
|
|
198
|
+
const container = this.container;
|
|
199
|
+
const {
|
|
200
|
+
className: oldClassName
|
|
201
|
+
} = this.controlOption;
|
|
202
|
+
if (oldClassName) {
|
|
203
|
+
DOM.removeClass(container, oldClassName);
|
|
226
204
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
* 设置容器 container 的样式相关位置,包含 className
|
|
230
|
-
* @param className
|
|
231
|
-
*/
|
|
232
|
-
}, {
|
|
233
|
-
key: "setClassName",
|
|
234
|
-
value: function setClassName(className) {
|
|
235
|
-
var container = this.container;
|
|
236
|
-
var oldClassName = this.controlOption.className;
|
|
237
|
-
if (oldClassName) {
|
|
238
|
-
DOM.removeClass(container, oldClassName);
|
|
239
|
-
}
|
|
240
|
-
if (className) {
|
|
241
|
-
DOM.addClass(container, className);
|
|
242
|
-
}
|
|
205
|
+
if (className) {
|
|
206
|
+
DOM.addClass(container, className);
|
|
243
207
|
}
|
|
208
|
+
}
|
|
244
209
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
} else {
|
|
256
|
-
container.removeAttribute('style');
|
|
257
|
-
}
|
|
210
|
+
/**
|
|
211
|
+
* 设置容器 container 的样式相关位置,包含 style
|
|
212
|
+
* @param style
|
|
213
|
+
*/
|
|
214
|
+
setStyle(style) {
|
|
215
|
+
const container = this.container;
|
|
216
|
+
if (style) {
|
|
217
|
+
container.setAttribute('style', style);
|
|
218
|
+
} else {
|
|
219
|
+
container.removeAttribute('style');
|
|
258
220
|
}
|
|
221
|
+
}
|
|
259
222
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
223
|
+
/**
|
|
224
|
+
* 将控件 DOM 插入到对应 position 的容器中
|
|
225
|
+
* @protected
|
|
226
|
+
*/
|
|
227
|
+
insertContainer() {
|
|
228
|
+
const position = this.controlOption.position;
|
|
229
|
+
const container = this.container;
|
|
230
|
+
if (position instanceof Element) {
|
|
231
|
+
position.appendChild(container);
|
|
232
|
+
} else {
|
|
233
|
+
const corner = this.controlService.controlCorners[position];
|
|
234
|
+
if (['bottomleft', 'bottomright', 'righttop', 'rightbottom'].includes(position)) {
|
|
235
|
+
corner.insertBefore(container, corner.firstChild);
|
|
271
236
|
} else {
|
|
272
|
-
|
|
273
|
-
if (['bottomleft', 'bottomright', 'righttop', 'rightbottom'].includes(position)) {
|
|
274
|
-
corner.insertBefore(container, corner.firstChild);
|
|
275
|
-
} else {
|
|
276
|
-
corner.appendChild(container);
|
|
277
|
-
}
|
|
237
|
+
corner.appendChild(container);
|
|
278
238
|
}
|
|
279
239
|
}
|
|
240
|
+
}
|
|
280
241
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
key
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return key in option;
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
}]);
|
|
295
|
-
return Control;
|
|
296
|
-
}(EventEmitter);
|
|
242
|
+
/**
|
|
243
|
+
* 检查当前传入 option 是否包含 keys 字段
|
|
244
|
+
* @param option
|
|
245
|
+
* @param keys
|
|
246
|
+
* @protected
|
|
247
|
+
*/
|
|
248
|
+
checkUpdateOption(option, keys) {
|
|
249
|
+
return keys.some(key => key in option);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
297
252
|
/**
|
|
298
253
|
* 当前类型控件实例个数
|
|
299
254
|
* @protected
|
|
300
255
|
*/
|
|
301
|
-
_defineProperty(Control, "controlCount", 0);
|
|
302
|
-
export { Control as default };
|
|
256
|
+
_defineProperty(Control, "controlCount", 0);
|