@visactor/vtable 0.12.3-alpha.1 → 0.13.0-alpha.3
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/cjs/ListTable.js +12 -12
- package/cjs/ListTable.js.map +1 -1
- package/cjs/body-helper/style.js +2 -2
- package/cjs/body-helper/style.js.map +1 -1
- package/cjs/components/axis/get-axis-attributes.d.ts +137 -0
- package/cjs/components/axis/get-axis-attributes.js +10 -5
- package/cjs/components/axis/get-axis-attributes.js.map +1 -1
- package/cjs/components/axis/get-axis-component-size.js +32 -32
- package/cjs/components/axis/get-axis-component-size.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +2 -2
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.js +10 -9
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.js +5 -5
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/EventTarget.js +2 -2
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/header-helper/style.js +2 -2
- package/cjs/header-helper/style.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -1
- package/cjs/layout/pivot-header-layout.js +23 -23
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +5 -5
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/render/layout/container.js +3 -3
- package/cjs/render/layout/container.js.map +1 -1
- package/cjs/render/layout/icon.js +2 -2
- package/cjs/render/layout/icon.js.map +1 -1
- package/cjs/render/layout/image.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +11 -11
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -2
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +4 -4
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +23 -24
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +5 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +7 -7
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +9 -7
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +9 -9
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-prop.js +4 -4
- package/cjs/scenegraph/utils/get-prop.js.map +1 -1
- package/cjs/state/select/update-position.js +4 -4
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +1 -0
- package/cjs/state/state.js +8 -6
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/NumberMap.js +2 -2
- package/cjs/tools/NumberMap.js.map +1 -1
- package/cjs/tools/diff-cell.d.ts +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -0
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/dist/vtable.js +1955 -1949
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/body-helper/style.js +1 -1
- package/es/body-helper/style.js.map +1 -1
- package/es/components/axis/get-axis-attributes.d.ts +137 -0
- package/es/components/axis/get-axis-attributes.js +8 -2
- package/es/components/axis/get-axis-attributes.js.map +1 -1
- package/es/components/axis/get-axis-component-size.js +33 -33
- package/es/components/axis/get-axis-component-size.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +1 -1
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.js +5 -6
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.js +3 -1
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/EventTarget.js +1 -1
- package/es/event/EventTarget.js.map +1 -1
- package/es/header-helper/style.js +1 -1
- package/es/header-helper/style.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -1
- package/es/layout/pivot-header-layout.js +2 -2
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +2 -2
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/render/layout/container.js +1 -1
- package/es/render/layout/container.js.map +1 -1
- package/es/render/layout/icon.js +1 -1
- package/es/render/layout/icon.js.map +1 -1
- package/es/render/layout/image.js.map +1 -1
- package/es/scenegraph/component/custom.js +1 -1
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +1 -3
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +20 -21
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +5 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +7 -7
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +9 -7
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/scenegraph.js +10 -9
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-prop.js +1 -1
- package/es/scenegraph/utils/get-prop.js.map +1 -1
- package/es/state/select/update-position.js +4 -4
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +1 -0
- package/es/state/state.js +5 -5
- package/es/state/state.js.map +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/NumberMap.js.map +1 -1
- package/es/tools/diff-cell.d.ts +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +1 -0
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/package.json +3 -3
package/dist/vtable.js
CHANGED
|
@@ -98,1621 +98,730 @@
|
|
|
98
98
|
get SortType () { return SortType; }
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
case '[object Object]':
|
|
104
|
-
return 'object';
|
|
105
|
-
case '[object Function]':
|
|
106
|
-
return 'function';
|
|
107
|
-
case '[object Array]':
|
|
108
|
-
return 'array';
|
|
109
|
-
case '[object String]':
|
|
110
|
-
return 'string';
|
|
111
|
-
case '[object Number]':
|
|
112
|
-
return 'number';
|
|
113
|
-
case '[object RegExp]':
|
|
114
|
-
return 'regExp';
|
|
115
|
-
case '[object Boolean]':
|
|
116
|
-
return 'boolean';
|
|
117
|
-
case '[object Symbol]':
|
|
118
|
-
return 'symbol';
|
|
119
|
-
case '[object Date]':
|
|
120
|
-
return 'date';
|
|
121
|
-
case '[object Undefined]':
|
|
122
|
-
return 'undefined';
|
|
123
|
-
case '[object Null]':
|
|
124
|
-
return 'null';
|
|
125
|
-
case '[object Error]':
|
|
126
|
-
return 'error';
|
|
127
|
-
case '[object HTMLDocument]':
|
|
128
|
-
return 'document';
|
|
129
|
-
case '[object global]':
|
|
130
|
-
return 'global';
|
|
131
|
-
default:
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const isIt$1 = (v, type) => judgeType$1(v) === type;
|
|
136
|
-
const isObject$4 = (v) => isIt$1(v, 'object');
|
|
137
|
-
const isFunction$2 = (v) => isIt$1(v, 'function');
|
|
138
|
-
const isString$4 = (v) => isIt$1(v, 'string');
|
|
139
|
-
const isNumber$7 = (v) => isIt$1(v, 'number');
|
|
140
|
-
const isUndefined$2 = (v) => isIt$1(v, 'undefined');
|
|
141
|
-
const isNull = (v) => isIt$1(v, 'null');
|
|
142
|
-
function ingoreNoneValueMerge(target, ...sources) {
|
|
143
|
-
if (!sources.length) {
|
|
144
|
-
return target || {};
|
|
145
|
-
}
|
|
146
|
-
const source = sources.shift();
|
|
147
|
-
if (isObject$4(target) && isObject$4(source)) {
|
|
148
|
-
for (const key in source) {
|
|
149
|
-
if (isObject$4(source[key])) {
|
|
150
|
-
if (!target[key]) {
|
|
151
|
-
Object.assign(target, { [key]: {} });
|
|
152
|
-
}
|
|
153
|
-
if (!isObject$4(target[key])) {
|
|
154
|
-
Object.assign(target, { [key]: source[key] });
|
|
155
|
-
}
|
|
156
|
-
ingoreNoneValueMerge(target[key], source[key]);
|
|
157
|
-
}
|
|
158
|
-
else if (source[key] !== null && source[key] !== undefined) {
|
|
159
|
-
Object.assign(target, { [key]: source[key] });
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return ingoreNoneValueMerge(target, ...sources);
|
|
164
|
-
}
|
|
165
|
-
function convertInternal(value) {
|
|
166
|
-
if (typeof value === 'function') {
|
|
167
|
-
value = value();
|
|
168
|
-
}
|
|
169
|
-
return isValid$6(value) ? `${value}` : '';
|
|
170
|
-
}
|
|
171
|
-
function transpose(matrix) {
|
|
172
|
-
if (matrix?.length <= 0) {
|
|
173
|
-
return matrix;
|
|
174
|
-
}
|
|
175
|
-
const m = matrix.length;
|
|
176
|
-
const n = matrix[0].length;
|
|
177
|
-
const transposed = new Array(n);
|
|
178
|
-
for (let i = 0; i < m; i++) {
|
|
179
|
-
for (let j = 0; j < n; j++) {
|
|
180
|
-
if (!transposed[j]) {
|
|
181
|
-
transposed[j] = new Array(m);
|
|
182
|
-
}
|
|
183
|
-
transposed[j][i] = matrix[i][j];
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return transposed;
|
|
187
|
-
}
|
|
188
|
-
function throttle(func, delay) {
|
|
189
|
-
let timer = null;
|
|
190
|
-
return function (...args) {
|
|
191
|
-
if (!timer) {
|
|
192
|
-
func.apply(this, args);
|
|
193
|
-
timer = setTimeout(() => {
|
|
194
|
-
timer = null;
|
|
195
|
-
}, delay);
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
function throttle2(func, delay) {
|
|
200
|
-
let timer = null;
|
|
201
|
-
return function (...args) {
|
|
202
|
-
if (!timer) {
|
|
203
|
-
timer = setTimeout(() => {
|
|
204
|
-
func.apply(this, args);
|
|
205
|
-
timer = null;
|
|
206
|
-
}, delay);
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
function pad(num, totalChars) {
|
|
211
|
-
const pad = '0';
|
|
212
|
-
num = `${num}`;
|
|
213
|
-
while (num.length < totalChars) {
|
|
214
|
-
num = pad + num;
|
|
215
|
-
}
|
|
216
|
-
return num;
|
|
217
|
-
}
|
|
218
|
-
function changeColor(color, ratio, isDarker) {
|
|
219
|
-
color = color.replace(/^\s*|\s*$/, '');
|
|
220
|
-
color = color.replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i, '#$1$1$2$2$3$3');
|
|
221
|
-
const difference = Math.round(ratio * 256) * (isDarker ? -1 : 1);
|
|
222
|
-
const rgb = color.match(new RegExp('^rgba?\\(\\s*' +
|
|
223
|
-
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
|
224
|
-
'\\s*,\\s*' +
|
|
225
|
-
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
|
226
|
-
'\\s*,\\s*' +
|
|
227
|
-
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
|
228
|
-
'(?:\\s*,\\s*' +
|
|
229
|
-
'(0|1|0?\\.\\d+))?' +
|
|
230
|
-
'\\s*\\)$', 'i'));
|
|
231
|
-
const alpha = !!rgb && isValid$6(rgb[4]) ? rgb[4] : null;
|
|
232
|
-
const decimal = rgb
|
|
233
|
-
? [rgb[1], rgb[2], rgb[3]]
|
|
234
|
-
: color
|
|
235
|
-
.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i, function () {
|
|
236
|
-
return `${parseInt(arguments[1], 16)},${parseInt(arguments[2], 16)},${parseInt(arguments[3], 16)}`;
|
|
237
|
-
})
|
|
238
|
-
.split(/,/);
|
|
239
|
-
return rgb
|
|
240
|
-
? `rgb${alpha !== null ? 'a' : ''}(${Math[isDarker ? 'max' : 'min'](parseInt(decimal[0], 10) + difference, isDarker ? 0 : 255)}, ${Math[isDarker ? 'max' : 'min'](parseInt(decimal[1], 10) + difference, isDarker ? 0 : 255)}, ${Math[isDarker ? 'max' : 'min'](parseInt(decimal[2], 10) + difference, isDarker ? 0 : 255)}${alpha !== null ? `, ${alpha}` : ''})`
|
|
241
|
-
:
|
|
242
|
-
[
|
|
243
|
-
'#',
|
|
244
|
-
pad(Math[isDarker ? 'max' : 'min'](parseInt(decimal[0], 10) + difference, isDarker ? 0 : 255).toString(16), 2),
|
|
245
|
-
pad(Math[isDarker ? 'max' : 'min'](parseInt(decimal[1], 10) + difference, isDarker ? 0 : 255).toString(16), 2),
|
|
246
|
-
pad(Math[isDarker ? 'max' : 'min'](parseInt(decimal[2], 10) + difference, isDarker ? 0 : 255).toString(16), 2)
|
|
247
|
-
].join('');
|
|
248
|
-
}
|
|
249
|
-
function isValid$6(v) {
|
|
250
|
-
if (isUndefined$2(v) || isNull(v)) {
|
|
251
|
-
return false;
|
|
252
|
-
}
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
function validToString(v) {
|
|
256
|
-
if (isUndefined$2(v) || isNull(v)) {
|
|
257
|
-
return '';
|
|
258
|
-
}
|
|
259
|
-
return v.toString();
|
|
260
|
-
}
|
|
261
|
-
function isMobile() {
|
|
262
|
-
return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
|
|
263
|
-
}
|
|
264
|
-
function defaultOrderFn(v1, v2, order) {
|
|
265
|
-
if (order !== 'desc') {
|
|
266
|
-
return v1 === v2 ? 0 : v1 > v2 ? 1 : -1;
|
|
267
|
-
}
|
|
268
|
-
return v1 === v2 ? 0 : v1 < v2 ? 1 : -1;
|
|
269
|
-
}
|
|
270
|
-
function getValueByPath(obj, paths) {
|
|
271
|
-
let res = obj;
|
|
272
|
-
let prop;
|
|
273
|
-
while ((prop = paths.shift())) {
|
|
274
|
-
res = res[prop];
|
|
275
|
-
}
|
|
276
|
-
return res;
|
|
101
|
+
function getDefaultExportFromCjs (x) {
|
|
102
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
277
103
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
104
|
+
|
|
105
|
+
var eventemitter3 = {exports: {}};
|
|
106
|
+
|
|
107
|
+
(function (module) {
|
|
108
|
+
|
|
109
|
+
var has = Object.prototype.hasOwnProperty,
|
|
110
|
+
prefix = '~';
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Constructor to create a storage for our `EE` objects.
|
|
114
|
+
* An `Events` instance is a plain object whose properties are event names.
|
|
115
|
+
*
|
|
116
|
+
* @constructor
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
function Events() {}
|
|
120
|
+
|
|
121
|
+
//
|
|
122
|
+
// We try to not inherit from `Object.prototype`. In some engines creating an
|
|
123
|
+
// instance in this way is faster than calling `Object.create(null)` directly.
|
|
124
|
+
// If `Object.create(null)` is not supported we prefix the event names with a
|
|
125
|
+
// character to make sure that the built-in object properties are not
|
|
126
|
+
// overridden or used as an attack vector.
|
|
127
|
+
//
|
|
128
|
+
if (Object.create) {
|
|
129
|
+
Events.prototype = Object.create(null);
|
|
130
|
+
|
|
131
|
+
//
|
|
132
|
+
// This hack is needed because the `__proto__` property is still inherited in
|
|
133
|
+
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
|
|
134
|
+
//
|
|
135
|
+
if (!new Events().__proto__) prefix = false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Representation of a single event listener.
|
|
140
|
+
*
|
|
141
|
+
* @param {Function} fn The listener function.
|
|
142
|
+
* @param {*} context The context to invoke the listener with.
|
|
143
|
+
* @param {Boolean} [once=false] Specify if the listener is a one-time listener.
|
|
144
|
+
* @constructor
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
function EE(fn, context, once) {
|
|
148
|
+
this.fn = fn;
|
|
149
|
+
this.context = context;
|
|
150
|
+
this.once = once || false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Add a listener for a given event.
|
|
155
|
+
*
|
|
156
|
+
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
157
|
+
* @param {(String|Symbol)} event The event name.
|
|
158
|
+
* @param {Function} fn The listener function.
|
|
159
|
+
* @param {*} context The context to invoke the listener with.
|
|
160
|
+
* @param {Boolean} once Specify if the listener is a one-time listener.
|
|
161
|
+
* @returns {EventEmitter}
|
|
162
|
+
* @private
|
|
163
|
+
*/
|
|
164
|
+
function addListener(emitter, event, fn, context, once) {
|
|
165
|
+
if (typeof fn !== 'function') {
|
|
166
|
+
throw new TypeError('The listener must be a function');
|
|
291
167
|
}
|
|
292
|
-
|
|
293
|
-
|
|
168
|
+
var listener = new EE(fn, context || emitter, once),
|
|
169
|
+
evt = prefix ? prefix + event : event;
|
|
170
|
+
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];
|
|
171
|
+
return emitter;
|
|
172
|
+
}
|
|
294
173
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Clear event by name.
|
|
176
|
+
*
|
|
177
|
+
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
178
|
+
* @param {(String|Symbol)} evt The Event name.
|
|
179
|
+
* @private
|
|
180
|
+
*/
|
|
181
|
+
function clearEvent(emitter, evt) {
|
|
182
|
+
if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Minimal `EventEmitter` interface that is molded against the Node.js
|
|
187
|
+
* `EventEmitter` interface.
|
|
188
|
+
*
|
|
189
|
+
* @constructor
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
function EventEmitter() {
|
|
193
|
+
this._events = new Events();
|
|
194
|
+
this._eventsCount = 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Return an array listing the events for which the emitter has registered
|
|
199
|
+
* listeners.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Array}
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
205
|
+
var names = [],
|
|
206
|
+
events,
|
|
207
|
+
name;
|
|
208
|
+
if (this._eventsCount === 0) return names;
|
|
209
|
+
for (name in events = this._events) {
|
|
210
|
+
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
318
211
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const type = idOrType;
|
|
322
|
-
this.removeEventListener(type, listener);
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
const id = idOrType;
|
|
326
|
-
if (!this.listenersData) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
this.listenersData.listenerData[id]?.remove();
|
|
330
|
-
}
|
|
212
|
+
if (Object.getOwnPropertySymbols) {
|
|
213
|
+
return names.concat(Object.getOwnPropertySymbols(events));
|
|
331
214
|
}
|
|
332
|
-
|
|
333
|
-
|
|
215
|
+
return names;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Return the listeners registered for a given event.
|
|
220
|
+
*
|
|
221
|
+
* @param {(String|Symbol)} event The event name.
|
|
222
|
+
* @returns {Array} The registered listeners.
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
EventEmitter.prototype.listeners = function listeners(event) {
|
|
226
|
+
var evt = prefix ? prefix + event : event,
|
|
227
|
+
handlers = this._events[evt];
|
|
228
|
+
if (!handlers) return [];
|
|
229
|
+
if (handlers.fn) return [handlers.fn];
|
|
230
|
+
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
|
231
|
+
ee[i] = handlers[i].fn;
|
|
334
232
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
233
|
+
return ee;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Return the number of listeners listening to a given event.
|
|
238
|
+
*
|
|
239
|
+
* @param {(String|Symbol)} event The event name.
|
|
240
|
+
* @returns {Number} The number of listeners.
|
|
241
|
+
* @public
|
|
242
|
+
*/
|
|
243
|
+
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
244
|
+
var evt = prefix ? prefix + event : event,
|
|
245
|
+
listeners = this._events[evt];
|
|
246
|
+
if (!listeners) return 0;
|
|
247
|
+
if (listeners.fn) return 1;
|
|
248
|
+
return listeners.length;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Calls each of the listeners registered for a given event.
|
|
253
|
+
*
|
|
254
|
+
* @param {(String|Symbol)} event The event name.
|
|
255
|
+
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
256
|
+
* @public
|
|
257
|
+
*/
|
|
258
|
+
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
259
|
+
var evt = prefix ? prefix + event : event;
|
|
260
|
+
if (!this._events[evt]) return false;
|
|
261
|
+
var listeners = this._events[evt],
|
|
262
|
+
len = arguments.length,
|
|
263
|
+
args,
|
|
264
|
+
i;
|
|
265
|
+
if (listeners.fn) {
|
|
266
|
+
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
|
267
|
+
switch (len) {
|
|
268
|
+
case 1:
|
|
269
|
+
return listeners.fn.call(listeners.context), true;
|
|
270
|
+
case 2:
|
|
271
|
+
return listeners.fn.call(listeners.context, a1), true;
|
|
272
|
+
case 3:
|
|
273
|
+
return listeners.fn.call(listeners.context, a1, a2), true;
|
|
274
|
+
case 4:
|
|
275
|
+
return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
276
|
+
case 5:
|
|
277
|
+
return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
278
|
+
case 6:
|
|
279
|
+
return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
280
|
+
}
|
|
281
|
+
for (i = 1, args = new Array(len - 1); i < len; i++) {
|
|
282
|
+
args[i - 1] = arguments[i];
|
|
283
|
+
}
|
|
284
|
+
listeners.fn.apply(listeners.context, args);
|
|
285
|
+
} else {
|
|
286
|
+
var length = listeners.length,
|
|
287
|
+
j;
|
|
288
|
+
for (i = 0; i < length; i++) {
|
|
289
|
+
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
|
290
|
+
switch (len) {
|
|
291
|
+
case 1:
|
|
292
|
+
listeners[i].fn.call(listeners[i].context);
|
|
293
|
+
break;
|
|
294
|
+
case 2:
|
|
295
|
+
listeners[i].fn.call(listeners[i].context, a1);
|
|
296
|
+
break;
|
|
297
|
+
case 3:
|
|
298
|
+
listeners[i].fn.call(listeners[i].context, a1, a2);
|
|
299
|
+
break;
|
|
300
|
+
case 4:
|
|
301
|
+
listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
|
302
|
+
break;
|
|
303
|
+
default:
|
|
304
|
+
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
|
305
|
+
args[j - 1] = arguments[j];
|
|
343
306
|
}
|
|
307
|
+
listeners[i].fn.apply(listeners[i].context, args);
|
|
344
308
|
}
|
|
309
|
+
}
|
|
345
310
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
311
|
+
return true;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Add a listener for a given event.
|
|
316
|
+
*
|
|
317
|
+
* @param {(String|Symbol)} event The event name.
|
|
318
|
+
* @param {Function} fn The listener function.
|
|
319
|
+
* @param {*} [context=this] The context to invoke the listener with.
|
|
320
|
+
* @returns {EventEmitter} `this`.
|
|
321
|
+
* @public
|
|
322
|
+
*/
|
|
323
|
+
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
324
|
+
return addListener(this, event, fn, context, false);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Add a one-time listener for a given event.
|
|
329
|
+
*
|
|
330
|
+
* @param {(String|Symbol)} event The event name.
|
|
331
|
+
* @param {Function} fn The listener function.
|
|
332
|
+
* @param {*} [context=this] The context to invoke the listener with.
|
|
333
|
+
* @returns {EventEmitter} `this`.
|
|
334
|
+
* @public
|
|
335
|
+
*/
|
|
336
|
+
EventEmitter.prototype.once = function once(event, fn, context) {
|
|
337
|
+
return addListener(this, event, fn, context, true);
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Remove the listeners of a given event.
|
|
342
|
+
*
|
|
343
|
+
* @param {(String|Symbol)} event The event name.
|
|
344
|
+
* @param {Function} fn Only remove the listeners that match this function.
|
|
345
|
+
* @param {*} context Only remove the listeners that have this context.
|
|
346
|
+
* @param {Boolean} once Only remove one-time listeners.
|
|
347
|
+
* @returns {EventEmitter} `this`.
|
|
348
|
+
* @public
|
|
349
|
+
*/
|
|
350
|
+
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
351
|
+
var evt = prefix ? prefix + event : event;
|
|
352
|
+
if (!this._events[evt]) return this;
|
|
353
|
+
if (!fn) {
|
|
354
|
+
clearEvent(this, evt);
|
|
355
|
+
return this;
|
|
351
356
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
var listeners = this._events[evt];
|
|
358
|
+
if (listeners.fn) {
|
|
359
|
+
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
|
360
|
+
clearEvent(this, evt);
|
|
361
|
+
}
|
|
362
|
+
} else {
|
|
363
|
+
for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
|
364
|
+
if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
|
365
|
+
events.push(listeners[i]);
|
|
359
366
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
//
|
|
370
|
+
// Reset the array, or remove it completely if we have no more listeners.
|
|
371
|
+
//
|
|
372
|
+
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);
|
|
364
373
|
}
|
|
365
|
-
|
|
374
|
+
return this;
|
|
375
|
+
};
|
|
366
376
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
_textAlign;
|
|
383
|
-
_textBaseline;
|
|
384
|
-
_bgColor;
|
|
385
|
-
_borderColor;
|
|
386
|
-
_lineHeight;
|
|
387
|
-
_underline;
|
|
388
|
-
_underlineColor;
|
|
389
|
-
_underlineDash;
|
|
390
|
-
_lineThrough;
|
|
391
|
-
_lineThroughColor;
|
|
392
|
-
_lineThroughDash;
|
|
393
|
-
_linkColor;
|
|
394
|
-
_cursor;
|
|
395
|
-
_borderLineWidth;
|
|
396
|
-
_borderLineDash;
|
|
397
|
-
_marked;
|
|
398
|
-
static get EVENT_TYPE() {
|
|
399
|
-
return STYLE_EVENT_TYPE;
|
|
400
|
-
}
|
|
401
|
-
static get DEFAULT() {
|
|
402
|
-
return defaultStyle$6 ? defaultStyle$6 : (defaultStyle$6 = new Style());
|
|
403
|
-
}
|
|
404
|
-
constructor(style = {}, bodyStyle = {}) {
|
|
405
|
-
super();
|
|
406
|
-
this._textAlign = style?.textAlign ?? bodyStyle?.textAlign;
|
|
407
|
-
this._textBaseline = style?.textBaseline ?? bodyStyle?.textBaseline;
|
|
408
|
-
this._color = style?.color ?? bodyStyle?.color;
|
|
409
|
-
this._fontSize = style.fontSize ?? bodyStyle?.fontSize;
|
|
410
|
-
this._fontFamily = style.fontFamily ?? bodyStyle?.fontFamily;
|
|
411
|
-
this._fontWeight = style.fontWeight ?? bodyStyle?.fontWeight;
|
|
412
|
-
this._fontVariant = style.fontVariant ?? bodyStyle?.fontVariant;
|
|
413
|
-
this._fontStyle = style.fontStyle ?? bodyStyle?.fontStyle;
|
|
414
|
-
this._padding = style?.padding ?? bodyStyle?.padding ?? this._defaultPadding;
|
|
415
|
-
this._borderColor = style?.borderColor ?? bodyStyle?.borderColor;
|
|
416
|
-
this._textOverflow = style?.textOverflow ?? bodyStyle?.textOverflow;
|
|
417
|
-
this._textStick = style.textStick ?? bodyStyle?.textStick ?? false;
|
|
418
|
-
this._bgColor = style?.bgColor ?? bodyStyle?.bgColor;
|
|
419
|
-
this._lineHeight = style?.lineHeight ?? bodyStyle?.lineHeight;
|
|
420
|
-
this._underline = style?.underline ?? bodyStyle?.underline;
|
|
421
|
-
this._underlineColor = style?.underlineColor ?? bodyStyle?.underlineColor;
|
|
422
|
-
this._underlineDash = style?.underlineDash ?? bodyStyle?.underlineDash;
|
|
423
|
-
this._lineThrough = style?.lineThrough ?? bodyStyle?.lineThrough;
|
|
424
|
-
this._lineThroughColor = style?.lineThroughColor ?? bodyStyle?.lineThroughColor;
|
|
425
|
-
this._lineThroughDash = style?.lineThroughDash ?? bodyStyle?.lineThroughDash;
|
|
426
|
-
this._linkColor = style?.linkColor ?? bodyStyle?.linkColor;
|
|
427
|
-
this._cursor = style.cursor ?? bodyStyle?.cursor;
|
|
428
|
-
this._borderLineWidth = style.borderLineWidth ?? bodyStyle?.borderLineWidth;
|
|
429
|
-
this._borderLineDash = style.borderLineDash ?? bodyStyle?.borderLineDash;
|
|
430
|
-
this._marked = style.marked ?? bodyStyle?.marked;
|
|
431
|
-
}
|
|
432
|
-
get color() {
|
|
433
|
-
return this._color;
|
|
434
|
-
}
|
|
435
|
-
set color(color) {
|
|
436
|
-
this._color = color;
|
|
437
|
-
}
|
|
438
|
-
get fontSize() {
|
|
439
|
-
return this._fontSize;
|
|
440
|
-
}
|
|
441
|
-
set fontSize(fontSize) {
|
|
442
|
-
this._fontSize = fontSize;
|
|
443
|
-
}
|
|
444
|
-
get fontFamily() {
|
|
445
|
-
return this._fontFamily;
|
|
446
|
-
}
|
|
447
|
-
set fontFamily(fontFamily) {
|
|
448
|
-
this._fontFamily = fontFamily;
|
|
449
|
-
}
|
|
450
|
-
get fontWeight() {
|
|
451
|
-
return this._fontWeight;
|
|
452
|
-
}
|
|
453
|
-
set fontWeight(fontWeight) {
|
|
454
|
-
this._fontWeight = fontWeight;
|
|
455
|
-
}
|
|
456
|
-
get fontVariant() {
|
|
457
|
-
return this._fontVariant;
|
|
458
|
-
}
|
|
459
|
-
set fontVariant(fontVariant) {
|
|
460
|
-
this._fontVariant = fontVariant;
|
|
461
|
-
}
|
|
462
|
-
get fontStyle() {
|
|
463
|
-
return this._fontStyle;
|
|
464
|
-
}
|
|
465
|
-
set fontStyle(fontStyle) {
|
|
466
|
-
this._fontStyle = fontStyle;
|
|
467
|
-
}
|
|
468
|
-
get padding() {
|
|
469
|
-
return this._padding;
|
|
470
|
-
}
|
|
471
|
-
set padding(padding) {
|
|
472
|
-
this._padding = padding;
|
|
473
|
-
}
|
|
474
|
-
get textOverflow() {
|
|
475
|
-
return this._textOverflow;
|
|
476
|
-
}
|
|
477
|
-
set textOverflow(textOverflow) {
|
|
478
|
-
this._textOverflow = textOverflow;
|
|
479
|
-
}
|
|
480
|
-
get bgColor() {
|
|
481
|
-
return this._bgColor;
|
|
482
|
-
}
|
|
483
|
-
set bgColor(bgColor) {
|
|
484
|
-
this._bgColor = bgColor;
|
|
485
|
-
}
|
|
486
|
-
get borderColor() {
|
|
487
|
-
return this._borderColor;
|
|
488
|
-
}
|
|
489
|
-
set borderColor(borderColor) {
|
|
490
|
-
this._borderColor = borderColor;
|
|
491
|
-
}
|
|
492
|
-
get textStick() {
|
|
493
|
-
return this._textStick;
|
|
494
|
-
}
|
|
495
|
-
set textStick(textStick) {
|
|
496
|
-
this._textStick = textStick;
|
|
497
|
-
}
|
|
498
|
-
get textAlign() {
|
|
499
|
-
return this._textAlign;
|
|
500
|
-
}
|
|
501
|
-
set textAlign(textAlign) {
|
|
502
|
-
this._textAlign = textAlign;
|
|
503
|
-
}
|
|
504
|
-
get textBaseline() {
|
|
505
|
-
return this._textBaseline;
|
|
506
|
-
}
|
|
507
|
-
set textBaseline(textBaseline) {
|
|
508
|
-
this._textBaseline = textBaseline;
|
|
509
|
-
}
|
|
510
|
-
get lineHeight() {
|
|
511
|
-
return this._lineHeight;
|
|
512
|
-
}
|
|
513
|
-
set lineHeight(lineHeight) {
|
|
514
|
-
this._lineHeight = lineHeight;
|
|
515
|
-
}
|
|
516
|
-
get underline() {
|
|
517
|
-
return this._underline;
|
|
518
|
-
}
|
|
519
|
-
set underline(underline) {
|
|
520
|
-
this._underline = underline;
|
|
521
|
-
}
|
|
522
|
-
get underlineColor() {
|
|
523
|
-
return this._underlineColor;
|
|
524
|
-
}
|
|
525
|
-
set underlineColor(underlineColor) {
|
|
526
|
-
this._underlineColor = underlineColor;
|
|
527
|
-
}
|
|
528
|
-
get underlineDash() {
|
|
529
|
-
return this._underlineDash;
|
|
530
|
-
}
|
|
531
|
-
set underlineDash(underlineDash) {
|
|
532
|
-
this._underlineDash = underlineDash;
|
|
533
|
-
}
|
|
534
|
-
get lineThrough() {
|
|
535
|
-
return this._lineThrough;
|
|
536
|
-
}
|
|
537
|
-
set lineThrough(lineThrough) {
|
|
538
|
-
this._lineThrough = lineThrough;
|
|
539
|
-
}
|
|
540
|
-
get lineThroughColor() {
|
|
541
|
-
return this._lineThroughColor;
|
|
542
|
-
}
|
|
543
|
-
set lineThroughColor(lineThroughColor) {
|
|
544
|
-
this._lineThroughColor = lineThroughColor;
|
|
545
|
-
}
|
|
546
|
-
get lineThroughDash() {
|
|
547
|
-
return this._lineThroughDash;
|
|
548
|
-
}
|
|
549
|
-
set lineThroughDash(lineThroughDash) {
|
|
550
|
-
this._lineThroughDash = lineThroughDash;
|
|
551
|
-
}
|
|
552
|
-
get linkColor() {
|
|
553
|
-
return this._linkColor;
|
|
554
|
-
}
|
|
555
|
-
set linkColor(linkColor) {
|
|
556
|
-
this._linkColor = linkColor;
|
|
557
|
-
}
|
|
558
|
-
get cursor() {
|
|
559
|
-
return this._cursor;
|
|
560
|
-
}
|
|
561
|
-
set cursor(cursor) {
|
|
562
|
-
this._cursor = cursor;
|
|
563
|
-
}
|
|
564
|
-
get borderLineWidth() {
|
|
565
|
-
return this._borderLineWidth;
|
|
566
|
-
}
|
|
567
|
-
set borderLineWidth(borderLineWidth) {
|
|
568
|
-
this._borderLineWidth = borderLineWidth;
|
|
569
|
-
}
|
|
570
|
-
get borderLineDash() {
|
|
571
|
-
return this._borderLineDash;
|
|
572
|
-
}
|
|
573
|
-
set borderLineDash(borderLineDash) {
|
|
574
|
-
this._borderLineDash = borderLineDash;
|
|
575
|
-
}
|
|
576
|
-
get marked() {
|
|
577
|
-
return this._marked;
|
|
578
|
-
}
|
|
579
|
-
set marked(marked) {
|
|
580
|
-
this._marked = marked;
|
|
581
|
-
}
|
|
582
|
-
clone() {
|
|
583
|
-
return new Style(this, null);
|
|
377
|
+
/**
|
|
378
|
+
* Remove all listeners, or those of the specified event.
|
|
379
|
+
*
|
|
380
|
+
* @param {(String|Symbol)} [event] The event name.
|
|
381
|
+
* @returns {EventEmitter} `this`.
|
|
382
|
+
* @public
|
|
383
|
+
*/
|
|
384
|
+
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
385
|
+
var evt;
|
|
386
|
+
if (event) {
|
|
387
|
+
evt = prefix ? prefix + event : event;
|
|
388
|
+
if (this._events[evt]) clearEvent(this, evt);
|
|
389
|
+
} else {
|
|
390
|
+
this._events = new Events();
|
|
391
|
+
this._eventsCount = 0;
|
|
584
392
|
}
|
|
393
|
+
return this;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
//
|
|
397
|
+
// Alias methods names because people roll like that.
|
|
398
|
+
//
|
|
399
|
+
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
400
|
+
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
401
|
+
|
|
402
|
+
//
|
|
403
|
+
// Expose the prefix.
|
|
404
|
+
//
|
|
405
|
+
EventEmitter.prefixed = prefix;
|
|
406
|
+
|
|
407
|
+
//
|
|
408
|
+
// Allow `EventEmitter` to be imported as module namespace.
|
|
409
|
+
//
|
|
410
|
+
EventEmitter.EventEmitter = EventEmitter;
|
|
411
|
+
|
|
412
|
+
//
|
|
413
|
+
// Expose the module.
|
|
414
|
+
//
|
|
415
|
+
{
|
|
416
|
+
module.exports = EventEmitter;
|
|
417
|
+
}
|
|
418
|
+
})(eventemitter3);
|
|
419
|
+
var eventemitter3Exports = eventemitter3.exports;
|
|
420
|
+
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
421
|
+
|
|
422
|
+
const isType$4 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
423
|
+
var isType$5 = isType$4;
|
|
424
|
+
|
|
425
|
+
const isBoolean$2 = function (value) {
|
|
426
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
427
|
+
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$5(value, "Boolean");
|
|
585
428
|
};
|
|
429
|
+
var isBoolean$3 = isBoolean$2;
|
|
586
430
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
431
|
+
const isFunction = value => "function" == typeof value;
|
|
432
|
+
var isFunction$1 = isFunction;
|
|
433
|
+
|
|
434
|
+
const isNil$4 = value => null == value;
|
|
435
|
+
var isNil$5 = isNil$4;
|
|
436
|
+
|
|
437
|
+
const isValid$5 = value => null != value;
|
|
438
|
+
var isValid$6 = isValid$5;
|
|
439
|
+
|
|
440
|
+
const isObject$3 = value => {
|
|
441
|
+
const type = typeof value;
|
|
442
|
+
return null !== value && "object" === type || "function" === type;
|
|
598
443
|
};
|
|
444
|
+
var isObject$4 = isObject$3;
|
|
599
445
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
446
|
+
const isObjectLike$2 = value => "object" == typeof value && null !== value;
|
|
447
|
+
var isObjectLike$3 = isObjectLike$2;
|
|
448
|
+
|
|
449
|
+
const isPlainObject$2 = function (value) {
|
|
450
|
+
if (!isObjectLike$3(value) || !isType$5(value, "Object")) return !1;
|
|
451
|
+
if (null === Object.getPrototypeOf(value)) return !0;
|
|
452
|
+
let proto = value;
|
|
453
|
+
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
454
|
+
return Object.getPrototypeOf(value) === proto;
|
|
455
|
+
};
|
|
456
|
+
var isPlainObject$3 = isPlainObject$2;
|
|
457
|
+
|
|
458
|
+
const isUndefined$1 = value => void 0 === value;
|
|
459
|
+
var isUndefined$2 = isUndefined$1;
|
|
460
|
+
|
|
461
|
+
const isString$2 = function (value) {
|
|
462
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
463
|
+
const type = typeof value;
|
|
464
|
+
return fuzzy ? "string" === type : "string" === type || isType$5(value, "String");
|
|
465
|
+
};
|
|
466
|
+
var isString$3 = isString$2;
|
|
467
|
+
|
|
468
|
+
const isArray$4 = value => Array.isArray ? Array.isArray(value) : isType$5(value, "Array");
|
|
469
|
+
var isArray$5 = isArray$4;
|
|
470
|
+
|
|
471
|
+
const isArrayLike$2 = function (value) {
|
|
472
|
+
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
473
|
+
};
|
|
474
|
+
var isArrayLike$3 = isArrayLike$2;
|
|
475
|
+
|
|
476
|
+
const isDate$2 = value => isType$5(value, "Date");
|
|
477
|
+
var isDate$3 = isDate$2;
|
|
478
|
+
|
|
479
|
+
const isNumber$5 = function (value) {
|
|
480
|
+
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
481
|
+
const type = typeof value;
|
|
482
|
+
return fuzzy ? "number" === type : "number" === type || isType$5(value, "Number");
|
|
483
|
+
};
|
|
484
|
+
var isNumber$6 = isNumber$5;
|
|
485
|
+
|
|
486
|
+
const isValidNumber = value => isNumber$6(value) && Number.isFinite(value);
|
|
487
|
+
var isValidNumber$1 = isValidNumber;
|
|
488
|
+
|
|
489
|
+
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
490
|
+
var isValidUrl$1 = isValidUrl;
|
|
491
|
+
|
|
492
|
+
const isRegExp = value => isType$5(value, "RegExp");
|
|
493
|
+
var isRegExp$1 = isRegExp;
|
|
494
|
+
|
|
495
|
+
const isBase64 = value => new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(value);
|
|
496
|
+
var isBase64$1 = isBase64;
|
|
497
|
+
|
|
498
|
+
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
499
|
+
var getType$1 = getType;
|
|
500
|
+
|
|
501
|
+
const objectProto = Object.prototype,
|
|
502
|
+
isPrototype = function (value) {
|
|
503
|
+
const Ctor = value && value.constructor;
|
|
504
|
+
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
|
|
505
|
+
};
|
|
506
|
+
var isPrototype$1 = isPrototype;
|
|
507
|
+
|
|
508
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
509
|
+
function isEmpty(value) {
|
|
510
|
+
if (isNil$5(value)) return !0;
|
|
511
|
+
if (isArrayLike$3(value)) return !value.length;
|
|
512
|
+
const type = getType$1(value);
|
|
513
|
+
if ("Map" === type || "Set" === type) return !value.size;
|
|
514
|
+
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
515
|
+
for (const key in value) if (hasOwnProperty$1.call(value, key)) return !1;
|
|
516
|
+
return !0;
|
|
627
517
|
}
|
|
628
518
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
519
|
+
const get$3 = (obj, path, defaultValue) => {
|
|
520
|
+
const paths = isString$3(path) ? path.split(".") : path;
|
|
521
|
+
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
522
|
+
return void 0 === obj ? defaultValue : obj;
|
|
523
|
+
};
|
|
524
|
+
var get$4 = get$3;
|
|
525
|
+
|
|
526
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
527
|
+
has = (object, key) => null != object && hasOwnProperty.call(object, key);
|
|
528
|
+
var has$1 = has;
|
|
529
|
+
|
|
530
|
+
function getRegExpFlags(re) {
|
|
531
|
+
let flags = "";
|
|
532
|
+
return re.global && (flags += "g"), re.ignoreCase && (flags += "i"), re.multiline && (flags += "m"), flags;
|
|
533
|
+
}
|
|
534
|
+
function clone(parent) {
|
|
535
|
+
let circular = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
536
|
+
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
537
|
+
let prototype = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : void 0;
|
|
538
|
+
const allParents = [],
|
|
539
|
+
allChildren = [];
|
|
540
|
+
return void 0 === circular && (circular = !0), void 0 === depth && (depth = 1 / 0), function _clone(parent, depth) {
|
|
541
|
+
if (null === parent) return null;
|
|
542
|
+
if (0 === depth) return parent;
|
|
543
|
+
let child;
|
|
544
|
+
if ("object" != typeof parent) return parent;
|
|
545
|
+
if (isArray$5(parent) ? child = [] : isRegExp$1(parent) ? (child = new RegExp(parent.source, getRegExpFlags(parent)), parent.lastIndex && (child.lastIndex = parent.lastIndex)) : child = isDate$3(parent) ? new Date(parent.getTime()) : void 0 === prototype ? Object.create(Object.getPrototypeOf(parent)) : Object.create(prototype), circular) {
|
|
546
|
+
const index = allParents.indexOf(parent);
|
|
547
|
+
if (-1 !== index) return allChildren[index];
|
|
548
|
+
allParents.push(parent), allChildren.push(child);
|
|
644
549
|
}
|
|
645
|
-
|
|
550
|
+
for (const i in parent) child[i] = _clone(parent[i], depth - 1);
|
|
551
|
+
return child;
|
|
552
|
+
}(parent, depth);
|
|
646
553
|
}
|
|
647
554
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return EVENT_TYPE$1;
|
|
555
|
+
function cloneDeep$1(value) {
|
|
556
|
+
let result;
|
|
557
|
+
if (!isValid$6(value) || "object" != typeof value) return value;
|
|
558
|
+
const isArr = isArray$5(value),
|
|
559
|
+
length = value.length;
|
|
560
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$3(value) || isNumber$6(value) || isString$3(value) ? value : isDate$3(value) ? new Date(+value) : void 0;
|
|
561
|
+
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
562
|
+
let index = -1;
|
|
563
|
+
if (result) for (; ++index < (props || value).length;) {
|
|
564
|
+
const key = props ? props[index] : index,
|
|
565
|
+
subValue = value[key];
|
|
566
|
+
result[key] = cloneDeep$1(subValue);
|
|
567
|
+
}
|
|
568
|
+
return result;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function baseMerge$1(target, source) {
|
|
572
|
+
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
573
|
+
if (source) {
|
|
574
|
+
if (target === source) return;
|
|
575
|
+
if (isValid$6(source) && "object" == typeof source) {
|
|
576
|
+
const iterable = Object(source),
|
|
577
|
+
props = [];
|
|
578
|
+
for (const key in iterable) props.push(key);
|
|
579
|
+
let {
|
|
580
|
+
length: length
|
|
581
|
+
} = props,
|
|
582
|
+
propIndex = -1;
|
|
583
|
+
for (; length--;) {
|
|
584
|
+
const key = props[++propIndex];
|
|
585
|
+
isValid$6(iterable[key]) && "object" == typeof iterable[key] ? baseMergeDeep$1(target, source, key, shallowArray) : assignMergeValue$1(target, key, iterable[key]);
|
|
586
|
+
}
|
|
681
587
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
this._textAlign = (style.textAlign ?? headerStyle?.textAlign) || 'left';
|
|
697
|
-
this._textBaseline = (style.textBaseline ?? headerStyle?.textBaseline) || 'middle';
|
|
698
|
-
this._bgColor = style.bgColor ?? headerStyle?.bgColor;
|
|
699
|
-
this._padding = style.padding ?? headerStyle?.padding ?? this._defaultPadding;
|
|
700
|
-
this._borderColor = style.borderColor ?? headerStyle?.borderColor;
|
|
701
|
-
this._lineHeight = style.lineHeight ?? headerStyle?.lineHeight;
|
|
702
|
-
this._underline = style.underline ?? headerStyle?.underline;
|
|
703
|
-
this._underlineColor = style.underlineColor ?? headerStyle?.underlineColor;
|
|
704
|
-
this._underlineDash = style.underlineDash ?? headerStyle?.underlineDash;
|
|
705
|
-
this._lineThrough = style.lineThrough ?? headerStyle?.lineThrough;
|
|
706
|
-
this._lineThroughColor = style.lineThroughColor ?? headerStyle?.lineThroughColor;
|
|
707
|
-
this._lineThroughDash = style.lineThroughDash ?? headerStyle?.lineThroughDash;
|
|
708
|
-
this._linkColor = style.linkColor ?? headerStyle?.linkColor;
|
|
709
|
-
this._cursor = style.cursor ?? headerStyle?.cursor;
|
|
710
|
-
this._borderLineWidth = style.borderLineWidth ?? headerStyle?.borderLineWidth;
|
|
711
|
-
this._borderLineDash = style.borderLineDash ?? headerStyle?.borderLineDash;
|
|
712
|
-
}
|
|
713
|
-
get bgColor() {
|
|
714
|
-
return this._bgColor;
|
|
715
|
-
}
|
|
716
|
-
set bgColor(bgColor) {
|
|
717
|
-
this._bgColor = bgColor;
|
|
718
|
-
}
|
|
719
|
-
get color() {
|
|
720
|
-
return this._color;
|
|
721
|
-
}
|
|
722
|
-
set color(color) {
|
|
723
|
-
this._color = color;
|
|
724
|
-
}
|
|
725
|
-
get fontSize() {
|
|
726
|
-
return this._fontSize;
|
|
727
|
-
}
|
|
728
|
-
set fontSize(fontSize) {
|
|
729
|
-
this._fontSize = fontSize;
|
|
730
|
-
}
|
|
731
|
-
get fontFamily() {
|
|
732
|
-
return this._fontFamily;
|
|
733
|
-
}
|
|
734
|
-
set fontFamily(fontFamily) {
|
|
735
|
-
this._fontFamily = fontFamily;
|
|
736
|
-
}
|
|
737
|
-
get fontWeight() {
|
|
738
|
-
return this._fontWeight;
|
|
739
|
-
}
|
|
740
|
-
set fontWeight(fontWeight) {
|
|
741
|
-
this._fontWeight = fontWeight;
|
|
742
|
-
}
|
|
743
|
-
get fontVariant() {
|
|
744
|
-
return this._fontVariant;
|
|
745
|
-
}
|
|
746
|
-
set fontVariant(fontVariant) {
|
|
747
|
-
this._fontVariant = fontVariant;
|
|
748
|
-
}
|
|
749
|
-
get fontStyle() {
|
|
750
|
-
return this._fontStyle;
|
|
751
|
-
}
|
|
752
|
-
set fontStyle(fontStyle) {
|
|
753
|
-
this._fontStyle = fontStyle;
|
|
754
|
-
}
|
|
755
|
-
get textOverflow() {
|
|
756
|
-
return this._textOverflow;
|
|
757
|
-
}
|
|
758
|
-
set textOverflow(textOverflow) {
|
|
759
|
-
this._textOverflow = textOverflow;
|
|
760
|
-
}
|
|
761
|
-
get padding() {
|
|
762
|
-
return this._padding ?? this._defaultPadding;
|
|
763
|
-
}
|
|
764
|
-
set padding(padding) {
|
|
765
|
-
this._padding = padding;
|
|
766
|
-
}
|
|
767
|
-
get borderColor() {
|
|
768
|
-
return this._borderColor;
|
|
769
|
-
}
|
|
770
|
-
set borderColor(borderColor) {
|
|
771
|
-
this._borderColor = borderColor;
|
|
772
|
-
}
|
|
773
|
-
get textStick() {
|
|
774
|
-
return this._textStick;
|
|
775
|
-
}
|
|
776
|
-
set textStick(textStick) {
|
|
777
|
-
this._textStick = textStick;
|
|
778
|
-
}
|
|
779
|
-
get marked() {
|
|
780
|
-
return this._marked;
|
|
781
|
-
}
|
|
782
|
-
set marked(marked) {
|
|
783
|
-
this._marked = marked;
|
|
784
|
-
}
|
|
785
|
-
get textAlign() {
|
|
786
|
-
return this._textAlign;
|
|
787
|
-
}
|
|
788
|
-
set textAlign(textAlign) {
|
|
789
|
-
this._textAlign = textAlign;
|
|
790
|
-
}
|
|
791
|
-
get textBaseline() {
|
|
792
|
-
return this._textBaseline;
|
|
793
|
-
}
|
|
794
|
-
set textBaseline(textBaseline) {
|
|
795
|
-
this._textBaseline = textBaseline;
|
|
796
|
-
}
|
|
797
|
-
get lineHeight() {
|
|
798
|
-
return this._lineHeight;
|
|
799
|
-
}
|
|
800
|
-
set lineHeight(lineHeight) {
|
|
801
|
-
this._lineHeight = lineHeight;
|
|
802
|
-
}
|
|
803
|
-
get underline() {
|
|
804
|
-
return this._underline;
|
|
805
|
-
}
|
|
806
|
-
set underline(underline) {
|
|
807
|
-
this._underline = underline;
|
|
808
|
-
}
|
|
809
|
-
get underlineColor() {
|
|
810
|
-
return this._underlineColor;
|
|
811
|
-
}
|
|
812
|
-
set underlineColor(underlineColor) {
|
|
813
|
-
this._underlineColor = underlineColor;
|
|
814
|
-
}
|
|
815
|
-
get underlineDash() {
|
|
816
|
-
return this._underlineDash;
|
|
817
|
-
}
|
|
818
|
-
set underlineDash(underlineDash) {
|
|
819
|
-
this._underlineDash = underlineDash;
|
|
820
|
-
}
|
|
821
|
-
get lineThrough() {
|
|
822
|
-
return this._lineThrough;
|
|
823
|
-
}
|
|
824
|
-
set lineThrough(lineThrough) {
|
|
825
|
-
this._lineThrough = lineThrough;
|
|
826
|
-
}
|
|
827
|
-
get lineThroughColor() {
|
|
828
|
-
return this._lineThroughColor;
|
|
829
|
-
}
|
|
830
|
-
set lineThroughColor(lineThroughColor) {
|
|
831
|
-
this._lineThroughColor = lineThroughColor;
|
|
832
|
-
}
|
|
833
|
-
get lineThroughDash() {
|
|
834
|
-
return this._lineThroughDash;
|
|
835
|
-
}
|
|
836
|
-
set lineThroughDash(lineThroughDash) {
|
|
837
|
-
this._lineThroughDash = lineThroughDash;
|
|
838
|
-
}
|
|
839
|
-
get linkColor() {
|
|
840
|
-
return this._linkColor;
|
|
841
|
-
}
|
|
842
|
-
set linkColor(linkColor) {
|
|
843
|
-
this._linkColor = linkColor;
|
|
844
|
-
}
|
|
845
|
-
get cursor() {
|
|
846
|
-
return this._cursor;
|
|
847
|
-
}
|
|
848
|
-
set cursor(cursor) {
|
|
849
|
-
this._cursor = cursor;
|
|
850
|
-
}
|
|
851
|
-
get borderLineWidth() {
|
|
852
|
-
return this._borderLineWidth;
|
|
853
|
-
}
|
|
854
|
-
set borderLineWidth(borderLineWidth) {
|
|
855
|
-
this._borderLineWidth = borderLineWidth;
|
|
856
|
-
}
|
|
857
|
-
get borderLineDash() {
|
|
858
|
-
return this._borderLineDash;
|
|
859
|
-
}
|
|
860
|
-
set borderLineDash(borderLineDash) {
|
|
861
|
-
this._borderLineDash = borderLineDash;
|
|
862
|
-
}
|
|
863
|
-
clone() {
|
|
864
|
-
return new Style(this);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
function baseMergeDeep$1(target, source, key) {
|
|
591
|
+
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
592
|
+
const objValue = target[key],
|
|
593
|
+
srcValue = source[key];
|
|
594
|
+
let newValue = source[key],
|
|
595
|
+
isCommon = !0;
|
|
596
|
+
if (isArray$5(srcValue)) {
|
|
597
|
+
if (shallowArray) newValue = [];else if (isArray$5(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
598
|
+
newValue = new Array(objValue.length);
|
|
599
|
+
let index = -1;
|
|
600
|
+
const length = objValue.length;
|
|
601
|
+
for (; ++index < length;) newValue[index] = objValue[index];
|
|
865
602
|
}
|
|
603
|
+
} else isPlainObject$3(srcValue) ? (newValue = objValue, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
604
|
+
isCommon && baseMerge$1(newValue, srcValue, shallowArray), assignMergeValue$1(target, key, newValue);
|
|
866
605
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
class TextHeaderStyle extends Style {
|
|
870
|
-
_autoWrapText;
|
|
871
|
-
_lineClamp;
|
|
872
|
-
static get DEFAULT() {
|
|
873
|
-
return defaultStyle$2 ? defaultStyle$2 : (defaultStyle$2 = new TextHeaderStyle());
|
|
874
|
-
}
|
|
875
|
-
constructor(style = {}, headerStyle = null) {
|
|
876
|
-
super(style, headerStyle);
|
|
877
|
-
this._autoWrapText = style?.autoWrapText ?? headerStyle?.autoWrapText;
|
|
878
|
-
this._lineClamp = style?.lineClamp ?? headerStyle?.lineClamp;
|
|
879
|
-
}
|
|
880
|
-
clone() {
|
|
881
|
-
return new TextHeaderStyle(this, null);
|
|
882
|
-
}
|
|
883
|
-
get lineClamp() {
|
|
884
|
-
return this._lineClamp;
|
|
885
|
-
}
|
|
886
|
-
set lineClamp(lineClamp) {
|
|
887
|
-
this._lineClamp = lineClamp;
|
|
888
|
-
}
|
|
889
|
-
get autoWrapText() {
|
|
890
|
-
return this._autoWrapText;
|
|
891
|
-
}
|
|
892
|
-
set autoWrapText(autoWrapText) {
|
|
893
|
-
this._autoWrapText = autoWrapText;
|
|
894
|
-
}
|
|
606
|
+
function assignMergeValue$1(target, key, value) {
|
|
607
|
+
(void 0 !== value && !eq$1(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
895
608
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
headerStyle = {};
|
|
907
|
-
}
|
|
908
|
-
if (globalAutoWrapText && !isValid$6(headerStyle.autoWrapText)) {
|
|
909
|
-
headerStyle.autoWrapText = true;
|
|
910
|
-
}
|
|
911
|
-
return new StyleClass(headerStyle ?? {}, (defaultHeaderStyle ?? {}));
|
|
912
|
-
}
|
|
913
|
-
return StyleClass.DEFAULT;
|
|
609
|
+
function eq$1(value, other) {
|
|
610
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
611
|
+
}
|
|
612
|
+
function merge$1(target) {
|
|
613
|
+
let sourceIndex = -1;
|
|
614
|
+
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
615
|
+
for (; ++sourceIndex < length;) {
|
|
616
|
+
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
617
|
+
}
|
|
618
|
+
return target;
|
|
914
619
|
}
|
|
915
620
|
|
|
916
|
-
function
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
}
|
|
928
|
-
.vtable .table-scrollable::-webkit-scrollbar-button{
|
|
929
|
-
background-color: transparent;
|
|
930
|
-
}
|
|
931
|
-
.vtable .table-scrollable::-webkit-scrollbar-track-piece{
|
|
932
|
-
background-color: transparent;
|
|
933
|
-
}
|
|
934
|
-
.vtable .table-scrollable::-webkit-scrollbar-corner {
|
|
935
|
-
background-color: transparent;
|
|
936
|
-
}
|
|
937
|
-
.vtable .table-scrollable::-webkit-scrollbar-thumb {
|
|
938
|
-
border-radius : 4px;
|
|
939
|
-
background-color : rgba(100, 100, 100, .5);
|
|
940
|
-
}
|
|
621
|
+
function pickWithout(obj, keys) {
|
|
622
|
+
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
623
|
+
const result = {};
|
|
624
|
+
return Object.keys(obj).forEach(k => {
|
|
625
|
+
const v = obj[k];
|
|
626
|
+
let match = !1;
|
|
627
|
+
keys.forEach(itKey => {
|
|
628
|
+
(isString$3(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
629
|
+
}), match || (result[k] = v);
|
|
630
|
+
}), result;
|
|
631
|
+
}
|
|
941
632
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
.
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
}
|
|
973
|
-
.vtable input.table-focus-control::-ms-clear {
|
|
974
|
-
visibility: hidden;
|
|
975
|
-
}
|
|
976
|
-
.vtable input.table-focus-control.composition {
|
|
977
|
-
opacity: 1;
|
|
978
|
-
max-width: none;
|
|
979
|
-
max-height: none;
|
|
980
|
-
}
|
|
981
|
-
`;
|
|
982
|
-
document.body.appendChild(styleElement);
|
|
633
|
+
function objToString(obj) {
|
|
634
|
+
return Object.prototype.toString.call(obj);
|
|
635
|
+
}
|
|
636
|
+
function objectKeys(obj) {
|
|
637
|
+
return Object.keys(obj);
|
|
638
|
+
}
|
|
639
|
+
function isEqual(a, b) {
|
|
640
|
+
if (a === b) return !0;
|
|
641
|
+
if (typeof a != typeof b) return !1;
|
|
642
|
+
if (null == a || null == b) return !1;
|
|
643
|
+
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
644
|
+
if (objToString(a) !== objToString(b)) return !1;
|
|
645
|
+
if (isFunction$1(a)) return !1;
|
|
646
|
+
if ("object" != typeof a) return !1;
|
|
647
|
+
if (isArray$5(a)) {
|
|
648
|
+
if (a.length !== b.length) return !1;
|
|
649
|
+
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i])) return !1;
|
|
650
|
+
return !0;
|
|
651
|
+
}
|
|
652
|
+
if (!isPlainObject$3(a)) return !1;
|
|
653
|
+
const ka = objectKeys(a),
|
|
654
|
+
kb = objectKeys(b);
|
|
655
|
+
if (ka.length !== kb.length) return !1;
|
|
656
|
+
ka.sort(), kb.sort();
|
|
657
|
+
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
658
|
+
for (let i = ka.length - 1; i >= 0; i--) {
|
|
659
|
+
const key = ka[i];
|
|
660
|
+
if (!isEqual(a[key], b[key])) return !1;
|
|
661
|
+
}
|
|
662
|
+
return !0;
|
|
983
663
|
}
|
|
984
664
|
|
|
985
|
-
function
|
|
986
|
-
|
|
987
|
-
|
|
665
|
+
function keys(obj) {
|
|
666
|
+
if (!obj) return [];
|
|
667
|
+
if (Object.keys) return Object.keys(obj);
|
|
668
|
+
const keyList = [];
|
|
669
|
+
for (const key in obj) obj.hasOwnProperty(key) && keyList.push(key);
|
|
670
|
+
return keyList;
|
|
671
|
+
}
|
|
672
|
+
function defaults(target, source, overlay) {
|
|
673
|
+
const keysArr = keys(source);
|
|
674
|
+
for (let i = 0; i < keysArr.length; i++) {
|
|
675
|
+
const key = keysArr[i];
|
|
676
|
+
(overlay ? null != source[key] : null == target[key]) && (target[key] = source[key]);
|
|
677
|
+
}
|
|
678
|
+
return target;
|
|
679
|
+
}
|
|
680
|
+
function mixin(target, source) {
|
|
681
|
+
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
682
|
+
if (target = "prototype" in target ? target.prototype : target, source = "prototype" in source ? source.prototype : source, Object.getOwnPropertyNames) {
|
|
683
|
+
const keyList = Object.getOwnPropertyNames(source);
|
|
684
|
+
for (let i = 0; i < keyList.length; i++) {
|
|
685
|
+
const key = keyList[i];
|
|
686
|
+
"constructor" !== key && (override ? null != source[key] : null == target[key]) && (target[key] = source[key]);
|
|
988
687
|
}
|
|
989
|
-
|
|
688
|
+
} else defaults(target, source, override);
|
|
990
689
|
}
|
|
991
690
|
|
|
992
|
-
function
|
|
993
|
-
|
|
691
|
+
function array$1(arr) {
|
|
692
|
+
return isValid$6(arr) ? isArray$5(arr) ? arr : [arr] : [];
|
|
693
|
+
}
|
|
694
|
+
function last(val) {
|
|
695
|
+
if (isArrayLike$3(val)) {
|
|
696
|
+
return val[val.length - 1];
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function maxInArray(arr) {
|
|
700
|
+
if (arr && isArray$5(arr)) return arr.reduce((prev, curr) => Math.max(prev, curr), -1 / 0);
|
|
701
|
+
}
|
|
702
|
+
function minInArray(arr) {
|
|
703
|
+
if (arr && isArray$5(arr)) return arr.reduce((prev, curr) => Math.min(prev, curr), 1 / 0);
|
|
704
|
+
}
|
|
705
|
+
function arrayEqual(a, b) {
|
|
706
|
+
if (!isArray$5(a) || !isArray$5(b)) return !1;
|
|
707
|
+
if (a.length !== b.length) return !1;
|
|
708
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
709
|
+
return !0;
|
|
710
|
+
}
|
|
711
|
+
function flattenArray(arr) {
|
|
712
|
+
if (!isArray$5(arr)) return [arr];
|
|
713
|
+
const result = [];
|
|
714
|
+
for (const value of arr) result.push(...flattenArray(value));
|
|
715
|
+
return result;
|
|
994
716
|
}
|
|
995
717
|
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
718
|
+
const DEFAULT_ABSOLUTE_TOLERATE$1 = 1e-10,
|
|
719
|
+
DEFAULT_RELATIVE_TOLERATE$1 = 1e-10;
|
|
720
|
+
function isNumberClose$1(a, b) {
|
|
721
|
+
let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_RELATIVE_TOLERATE$1;
|
|
722
|
+
let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_ABSOLUTE_TOLERATE$1;
|
|
723
|
+
const abs = absTol,
|
|
724
|
+
rel = relTol * Math.max(a, b);
|
|
725
|
+
return Math.abs(a - b) <= Math.max(abs, rel);
|
|
726
|
+
}
|
|
999
727
|
|
|
1000
|
-
|
|
1001
|
-
|
|
728
|
+
const clamp$2 = function (input, min, max) {
|
|
729
|
+
return input < min ? min : input > max ? max : input;
|
|
730
|
+
};
|
|
731
|
+
var clamp$3 = clamp$2;
|
|
1002
732
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
function Events() {}
|
|
733
|
+
const clampRange = (range, min, max) => {
|
|
734
|
+
let [lowValue, highValue] = range;
|
|
735
|
+
highValue < lowValue && (lowValue = range[1], highValue = range[0]);
|
|
736
|
+
const span = highValue - lowValue;
|
|
737
|
+
return span >= max - min ? [min, max] : (lowValue = Math.min(Math.max(lowValue, min), max - span), [lowValue, lowValue + span]);
|
|
738
|
+
};
|
|
739
|
+
var clampRange$1 = clampRange;
|
|
1011
740
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
741
|
+
const epsilon = 1e-12;
|
|
742
|
+
const pi = Math.PI;
|
|
743
|
+
const halfPi$1 = pi / 2;
|
|
744
|
+
const tau = 2 * pi;
|
|
745
|
+
const pi2 = 2 * Math.PI;
|
|
746
|
+
const abs = Math.abs;
|
|
747
|
+
const atan2 = Math.atan2;
|
|
748
|
+
const cos = Math.cos;
|
|
749
|
+
const max = Math.max;
|
|
750
|
+
const min = Math.min;
|
|
751
|
+
const sin = Math.sin;
|
|
752
|
+
const sqrt = Math.sqrt;
|
|
753
|
+
const pow = Math.pow;
|
|
754
|
+
function acos(x) {
|
|
755
|
+
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
756
|
+
}
|
|
757
|
+
function asin(x) {
|
|
758
|
+
return x >= 1 ? halfPi$1 : x <= -1 ? -halfPi$1 : Math.asin(x);
|
|
759
|
+
}
|
|
760
|
+
function pointAt(x1, y1, x2, y2, t) {
|
|
761
|
+
let x, y;
|
|
762
|
+
return "number" == typeof x1 && "number" == typeof x2 && (x = (1 - t) * x1 + t * x2), "number" == typeof y1 && "number" == typeof y2 && (y = (1 - t) * y1 + t * y2), {
|
|
763
|
+
x: x,
|
|
764
|
+
y: y
|
|
765
|
+
};
|
|
766
|
+
}
|
|
1021
767
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
768
|
+
class Point {
|
|
769
|
+
constructor() {
|
|
770
|
+
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
771
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
772
|
+
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
773
|
+
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
774
|
+
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
1027
775
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
* Representation of a single event listener.
|
|
1031
|
-
*
|
|
1032
|
-
* @param {Function} fn The listener function.
|
|
1033
|
-
* @param {*} context The context to invoke the listener with.
|
|
1034
|
-
* @param {Boolean} [once=false] Specify if the listener is a one-time listener.
|
|
1035
|
-
* @constructor
|
|
1036
|
-
* @private
|
|
1037
|
-
*/
|
|
1038
|
-
function EE(fn, context, once) {
|
|
1039
|
-
this.fn = fn;
|
|
1040
|
-
this.context = context;
|
|
1041
|
-
this.once = once || false;
|
|
776
|
+
clone() {
|
|
777
|
+
return new Point(this.x, this.y);
|
|
1042
778
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
* Add a listener for a given event.
|
|
1046
|
-
*
|
|
1047
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
1048
|
-
* @param {(String|Symbol)} event The event name.
|
|
1049
|
-
* @param {Function} fn The listener function.
|
|
1050
|
-
* @param {*} context The context to invoke the listener with.
|
|
1051
|
-
* @param {Boolean} once Specify if the listener is a one-time listener.
|
|
1052
|
-
* @returns {EventEmitter}
|
|
1053
|
-
* @private
|
|
1054
|
-
*/
|
|
1055
|
-
function addListener(emitter, event, fn, context, once) {
|
|
1056
|
-
if (typeof fn !== 'function') {
|
|
1057
|
-
throw new TypeError('The listener must be a function');
|
|
1058
|
-
}
|
|
1059
|
-
var listener = new EE(fn, context || emitter, once),
|
|
1060
|
-
evt = prefix ? prefix + event : event;
|
|
1061
|
-
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];
|
|
1062
|
-
return emitter;
|
|
779
|
+
copyFrom(p) {
|
|
780
|
+
return this.x = p.x, this.y = p.y, this.x1 = p.x1, this.y1 = p.y1, this.defined = p.defined, this.context = p.context, this;
|
|
1063
781
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
* Clear event by name.
|
|
1067
|
-
*
|
|
1068
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
1069
|
-
* @param {(String|Symbol)} evt The Event name.
|
|
1070
|
-
* @private
|
|
1071
|
-
*/
|
|
1072
|
-
function clearEvent(emitter, evt) {
|
|
1073
|
-
if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];
|
|
782
|
+
set(x, y) {
|
|
783
|
+
return this.x = x, this.y = y, this;
|
|
1074
784
|
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
* Minimal `EventEmitter` interface that is molded against the Node.js
|
|
1078
|
-
* `EventEmitter` interface.
|
|
1079
|
-
*
|
|
1080
|
-
* @constructor
|
|
1081
|
-
* @public
|
|
1082
|
-
*/
|
|
1083
|
-
function EventEmitter() {
|
|
1084
|
-
this._events = new Events();
|
|
1085
|
-
this._eventsCount = 0;
|
|
785
|
+
add(point) {
|
|
786
|
+
return isNumber$6(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1086
787
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
* Return an array listing the events for which the emitter has registered
|
|
1090
|
-
* listeners.
|
|
1091
|
-
*
|
|
1092
|
-
* @returns {Array}
|
|
1093
|
-
* @public
|
|
1094
|
-
*/
|
|
1095
|
-
EventEmitter.prototype.eventNames = function eventNames() {
|
|
1096
|
-
var names = [],
|
|
1097
|
-
events,
|
|
1098
|
-
name;
|
|
1099
|
-
if (this._eventsCount === 0) return names;
|
|
1100
|
-
for (name in events = this._events) {
|
|
1101
|
-
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
1102
|
-
}
|
|
1103
|
-
if (Object.getOwnPropertySymbols) {
|
|
1104
|
-
return names.concat(Object.getOwnPropertySymbols(events));
|
|
1105
|
-
}
|
|
1106
|
-
return names;
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
/**
|
|
1110
|
-
* Return the listeners registered for a given event.
|
|
1111
|
-
*
|
|
1112
|
-
* @param {(String|Symbol)} event The event name.
|
|
1113
|
-
* @returns {Array} The registered listeners.
|
|
1114
|
-
* @public
|
|
1115
|
-
*/
|
|
1116
|
-
EventEmitter.prototype.listeners = function listeners(event) {
|
|
1117
|
-
var evt = prefix ? prefix + event : event,
|
|
1118
|
-
handlers = this._events[evt];
|
|
1119
|
-
if (!handlers) return [];
|
|
1120
|
-
if (handlers.fn) return [handlers.fn];
|
|
1121
|
-
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
|
1122
|
-
ee[i] = handlers[i].fn;
|
|
1123
|
-
}
|
|
1124
|
-
return ee;
|
|
1125
|
-
};
|
|
1126
|
-
|
|
1127
|
-
/**
|
|
1128
|
-
* Return the number of listeners listening to a given event.
|
|
1129
|
-
*
|
|
1130
|
-
* @param {(String|Symbol)} event The event name.
|
|
1131
|
-
* @returns {Number} The number of listeners.
|
|
1132
|
-
* @public
|
|
1133
|
-
*/
|
|
1134
|
-
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
1135
|
-
var evt = prefix ? prefix + event : event,
|
|
1136
|
-
listeners = this._events[evt];
|
|
1137
|
-
if (!listeners) return 0;
|
|
1138
|
-
if (listeners.fn) return 1;
|
|
1139
|
-
return listeners.length;
|
|
1140
|
-
};
|
|
1141
|
-
|
|
1142
|
-
/**
|
|
1143
|
-
* Calls each of the listeners registered for a given event.
|
|
1144
|
-
*
|
|
1145
|
-
* @param {(String|Symbol)} event The event name.
|
|
1146
|
-
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
1147
|
-
* @public
|
|
1148
|
-
*/
|
|
1149
|
-
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
1150
|
-
var evt = prefix ? prefix + event : event;
|
|
1151
|
-
if (!this._events[evt]) return false;
|
|
1152
|
-
var listeners = this._events[evt],
|
|
1153
|
-
len = arguments.length,
|
|
1154
|
-
args,
|
|
1155
|
-
i;
|
|
1156
|
-
if (listeners.fn) {
|
|
1157
|
-
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
|
1158
|
-
switch (len) {
|
|
1159
|
-
case 1:
|
|
1160
|
-
return listeners.fn.call(listeners.context), true;
|
|
1161
|
-
case 2:
|
|
1162
|
-
return listeners.fn.call(listeners.context, a1), true;
|
|
1163
|
-
case 3:
|
|
1164
|
-
return listeners.fn.call(listeners.context, a1, a2), true;
|
|
1165
|
-
case 4:
|
|
1166
|
-
return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
1167
|
-
case 5:
|
|
1168
|
-
return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
1169
|
-
case 6:
|
|
1170
|
-
return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
1171
|
-
}
|
|
1172
|
-
for (i = 1, args = new Array(len - 1); i < len; i++) {
|
|
1173
|
-
args[i - 1] = arguments[i];
|
|
1174
|
-
}
|
|
1175
|
-
listeners.fn.apply(listeners.context, args);
|
|
1176
|
-
} else {
|
|
1177
|
-
var length = listeners.length,
|
|
1178
|
-
j;
|
|
1179
|
-
for (i = 0; i < length; i++) {
|
|
1180
|
-
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
|
1181
|
-
switch (len) {
|
|
1182
|
-
case 1:
|
|
1183
|
-
listeners[i].fn.call(listeners[i].context);
|
|
1184
|
-
break;
|
|
1185
|
-
case 2:
|
|
1186
|
-
listeners[i].fn.call(listeners[i].context, a1);
|
|
1187
|
-
break;
|
|
1188
|
-
case 3:
|
|
1189
|
-
listeners[i].fn.call(listeners[i].context, a1, a2);
|
|
1190
|
-
break;
|
|
1191
|
-
case 4:
|
|
1192
|
-
listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
|
1193
|
-
break;
|
|
1194
|
-
default:
|
|
1195
|
-
if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
|
1196
|
-
args[j - 1] = arguments[j];
|
|
1197
|
-
}
|
|
1198
|
-
listeners[i].fn.apply(listeners[i].context, args);
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
return true;
|
|
1203
|
-
};
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* Add a listener for a given event.
|
|
1207
|
-
*
|
|
1208
|
-
* @param {(String|Symbol)} event The event name.
|
|
1209
|
-
* @param {Function} fn The listener function.
|
|
1210
|
-
* @param {*} [context=this] The context to invoke the listener with.
|
|
1211
|
-
* @returns {EventEmitter} `this`.
|
|
1212
|
-
* @public
|
|
1213
|
-
*/
|
|
1214
|
-
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
1215
|
-
return addListener(this, event, fn, context, false);
|
|
1216
|
-
};
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* Add a one-time listener for a given event.
|
|
1220
|
-
*
|
|
1221
|
-
* @param {(String|Symbol)} event The event name.
|
|
1222
|
-
* @param {Function} fn The listener function.
|
|
1223
|
-
* @param {*} [context=this] The context to invoke the listener with.
|
|
1224
|
-
* @returns {EventEmitter} `this`.
|
|
1225
|
-
* @public
|
|
1226
|
-
*/
|
|
1227
|
-
EventEmitter.prototype.once = function once(event, fn, context) {
|
|
1228
|
-
return addListener(this, event, fn, context, true);
|
|
1229
|
-
};
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* Remove the listeners of a given event.
|
|
1233
|
-
*
|
|
1234
|
-
* @param {(String|Symbol)} event The event name.
|
|
1235
|
-
* @param {Function} fn Only remove the listeners that match this function.
|
|
1236
|
-
* @param {*} context Only remove the listeners that have this context.
|
|
1237
|
-
* @param {Boolean} once Only remove one-time listeners.
|
|
1238
|
-
* @returns {EventEmitter} `this`.
|
|
1239
|
-
* @public
|
|
1240
|
-
*/
|
|
1241
|
-
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
1242
|
-
var evt = prefix ? prefix + event : event;
|
|
1243
|
-
if (!this._events[evt]) return this;
|
|
1244
|
-
if (!fn) {
|
|
1245
|
-
clearEvent(this, evt);
|
|
1246
|
-
return this;
|
|
1247
|
-
}
|
|
1248
|
-
var listeners = this._events[evt];
|
|
1249
|
-
if (listeners.fn) {
|
|
1250
|
-
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
|
1251
|
-
clearEvent(this, evt);
|
|
1252
|
-
}
|
|
1253
|
-
} else {
|
|
1254
|
-
for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
|
1255
|
-
if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
|
1256
|
-
events.push(listeners[i]);
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
//
|
|
1261
|
-
// Reset the array, or remove it completely if we have no more listeners.
|
|
1262
|
-
//
|
|
1263
|
-
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);
|
|
1264
|
-
}
|
|
1265
|
-
return this;
|
|
1266
|
-
};
|
|
1267
|
-
|
|
1268
|
-
/**
|
|
1269
|
-
* Remove all listeners, or those of the specified event.
|
|
1270
|
-
*
|
|
1271
|
-
* @param {(String|Symbol)} [event] The event name.
|
|
1272
|
-
* @returns {EventEmitter} `this`.
|
|
1273
|
-
* @public
|
|
1274
|
-
*/
|
|
1275
|
-
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
1276
|
-
var evt;
|
|
1277
|
-
if (event) {
|
|
1278
|
-
evt = prefix ? prefix + event : event;
|
|
1279
|
-
if (this._events[evt]) clearEvent(this, evt);
|
|
1280
|
-
} else {
|
|
1281
|
-
this._events = new Events();
|
|
1282
|
-
this._eventsCount = 0;
|
|
1283
|
-
}
|
|
1284
|
-
return this;
|
|
1285
|
-
};
|
|
1286
|
-
|
|
1287
|
-
//
|
|
1288
|
-
// Alias methods names because people roll like that.
|
|
1289
|
-
//
|
|
1290
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
1291
|
-
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
1292
|
-
|
|
1293
|
-
//
|
|
1294
|
-
// Expose the prefix.
|
|
1295
|
-
//
|
|
1296
|
-
EventEmitter.prefixed = prefix;
|
|
1297
|
-
|
|
1298
|
-
//
|
|
1299
|
-
// Allow `EventEmitter` to be imported as module namespace.
|
|
1300
|
-
//
|
|
1301
|
-
EventEmitter.EventEmitter = EventEmitter;
|
|
1302
|
-
|
|
1303
|
-
//
|
|
1304
|
-
// Expose the module.
|
|
1305
|
-
//
|
|
1306
|
-
{
|
|
1307
|
-
module.exports = EventEmitter;
|
|
788
|
+
sub(point) {
|
|
789
|
+
return isNumber$6(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1308
790
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
1312
|
-
|
|
1313
|
-
const isType$4 = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
1314
|
-
var isType$5 = isType$4;
|
|
1315
|
-
|
|
1316
|
-
const isBoolean$2 = function (value) {
|
|
1317
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1318
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$5(value, "Boolean");
|
|
1319
|
-
};
|
|
1320
|
-
var isBoolean$3 = isBoolean$2;
|
|
1321
|
-
|
|
1322
|
-
const isFunction = value => "function" == typeof value;
|
|
1323
|
-
var isFunction$1 = isFunction;
|
|
1324
|
-
|
|
1325
|
-
const isNil$4 = value => null == value;
|
|
1326
|
-
var isNil$5 = isNil$4;
|
|
1327
|
-
|
|
1328
|
-
const isValid$4 = value => null != value;
|
|
1329
|
-
var isValid$5 = isValid$4;
|
|
1330
|
-
|
|
1331
|
-
const isObject$2 = value => {
|
|
1332
|
-
const type = typeof value;
|
|
1333
|
-
return null !== value && "object" === type || "function" === type;
|
|
1334
|
-
};
|
|
1335
|
-
var isObject$3 = isObject$2;
|
|
1336
|
-
|
|
1337
|
-
const isObjectLike$2 = value => "object" == typeof value && null !== value;
|
|
1338
|
-
var isObjectLike$3 = isObjectLike$2;
|
|
1339
|
-
|
|
1340
|
-
const isPlainObject$2 = function (value) {
|
|
1341
|
-
if (!isObjectLike$3(value) || !isType$5(value, "Object")) return !1;
|
|
1342
|
-
if (null === Object.getPrototypeOf(value)) return !0;
|
|
1343
|
-
let proto = value;
|
|
1344
|
-
for (; null !== Object.getPrototypeOf(proto);) proto = Object.getPrototypeOf(proto);
|
|
1345
|
-
return Object.getPrototypeOf(value) === proto;
|
|
1346
|
-
};
|
|
1347
|
-
var isPlainObject$3 = isPlainObject$2;
|
|
1348
|
-
|
|
1349
|
-
const isUndefined = value => void 0 === value;
|
|
1350
|
-
var isUndefined$1 = isUndefined;
|
|
1351
|
-
|
|
1352
|
-
const isString$2 = function (value) {
|
|
1353
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1354
|
-
const type = typeof value;
|
|
1355
|
-
return fuzzy ? "string" === type : "string" === type || isType$5(value, "String");
|
|
1356
|
-
};
|
|
1357
|
-
var isString$3 = isString$2;
|
|
1358
|
-
|
|
1359
|
-
const isArray$4 = value => Array.isArray ? Array.isArray(value) : isType$5(value, "Array");
|
|
1360
|
-
var isArray$5 = isArray$4;
|
|
1361
|
-
|
|
1362
|
-
const isArrayLike$2 = function (value) {
|
|
1363
|
-
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1364
|
-
};
|
|
1365
|
-
var isArrayLike$3 = isArrayLike$2;
|
|
1366
|
-
|
|
1367
|
-
const isDate$2 = value => isType$5(value, "Date");
|
|
1368
|
-
var isDate$3 = isDate$2;
|
|
1369
|
-
|
|
1370
|
-
const isNumber$5 = function (value) {
|
|
1371
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1372
|
-
const type = typeof value;
|
|
1373
|
-
return fuzzy ? "number" === type : "number" === type || isType$5(value, "Number");
|
|
1374
|
-
};
|
|
1375
|
-
var isNumber$6 = isNumber$5;
|
|
1376
|
-
|
|
1377
|
-
const isValidNumber = value => isNumber$6(value) && Number.isFinite(value);
|
|
1378
|
-
var isValidNumber$1 = isValidNumber;
|
|
1379
|
-
|
|
1380
|
-
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
1381
|
-
var isValidUrl$1 = isValidUrl;
|
|
1382
|
-
|
|
1383
|
-
const isRegExp = value => isType$5(value, "RegExp");
|
|
1384
|
-
var isRegExp$1 = isRegExp;
|
|
1385
|
-
|
|
1386
|
-
const isBase64 = value => new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(value);
|
|
1387
|
-
var isBase64$1 = isBase64;
|
|
1388
|
-
|
|
1389
|
-
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
1390
|
-
var getType$1 = getType;
|
|
1391
|
-
|
|
1392
|
-
const objectProto = Object.prototype,
|
|
1393
|
-
isPrototype = function (value) {
|
|
1394
|
-
const Ctor = value && value.constructor;
|
|
1395
|
-
return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
|
|
1396
|
-
};
|
|
1397
|
-
var isPrototype$1 = isPrototype;
|
|
1398
|
-
|
|
1399
|
-
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1400
|
-
function isEmpty(value) {
|
|
1401
|
-
if (isNil$5(value)) return !0;
|
|
1402
|
-
if (isArrayLike$3(value)) return !value.length;
|
|
1403
|
-
const type = getType$1(value);
|
|
1404
|
-
if ("Map" === type || "Set" === type) return !value.size;
|
|
1405
|
-
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
1406
|
-
for (const key in value) if (hasOwnProperty$1.call(value, key)) return !1;
|
|
1407
|
-
return !0;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
const get$3 = (obj, path, defaultValue) => {
|
|
1411
|
-
const paths = isString$3(path) ? path.split(".") : path;
|
|
1412
|
-
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
1413
|
-
return void 0 === obj ? defaultValue : obj;
|
|
1414
|
-
};
|
|
1415
|
-
var get$4 = get$3;
|
|
1416
|
-
|
|
1417
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
1418
|
-
has = (object, key) => null != object && hasOwnProperty.call(object, key);
|
|
1419
|
-
var has$1 = has;
|
|
1420
|
-
|
|
1421
|
-
function getRegExpFlags(re) {
|
|
1422
|
-
let flags = "";
|
|
1423
|
-
return re.global && (flags += "g"), re.ignoreCase && (flags += "i"), re.multiline && (flags += "m"), flags;
|
|
1424
|
-
}
|
|
1425
|
-
function clone(parent) {
|
|
1426
|
-
let circular = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1427
|
-
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1428
|
-
let prototype = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : void 0;
|
|
1429
|
-
const allParents = [],
|
|
1430
|
-
allChildren = [];
|
|
1431
|
-
return void 0 === circular && (circular = !0), void 0 === depth && (depth = 1 / 0), function _clone(parent, depth) {
|
|
1432
|
-
if (null === parent) return null;
|
|
1433
|
-
if (0 === depth) return parent;
|
|
1434
|
-
let child;
|
|
1435
|
-
if ("object" != typeof parent) return parent;
|
|
1436
|
-
if (isArray$5(parent) ? child = [] : isRegExp$1(parent) ? (child = new RegExp(parent.source, getRegExpFlags(parent)), parent.lastIndex && (child.lastIndex = parent.lastIndex)) : child = isDate$3(parent) ? new Date(parent.getTime()) : void 0 === prototype ? Object.create(Object.getPrototypeOf(parent)) : Object.create(prototype), circular) {
|
|
1437
|
-
const index = allParents.indexOf(parent);
|
|
1438
|
-
if (-1 !== index) return allChildren[index];
|
|
1439
|
-
allParents.push(parent), allChildren.push(child);
|
|
1440
|
-
}
|
|
1441
|
-
for (const i in parent) child[i] = _clone(parent[i], depth - 1);
|
|
1442
|
-
return child;
|
|
1443
|
-
}(parent, depth);
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
function cloneDeep$1(value) {
|
|
1447
|
-
let result;
|
|
1448
|
-
if (!isValid$5(value) || "object" != typeof value) return value;
|
|
1449
|
-
const isArr = isArray$5(value),
|
|
1450
|
-
length = value.length;
|
|
1451
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$3(value) || isNumber$6(value) || isString$3(value) ? value : isDate$3(value) ? new Date(+value) : void 0;
|
|
1452
|
-
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1453
|
-
let index = -1;
|
|
1454
|
-
if (result) for (; ++index < (props || value).length;) {
|
|
1455
|
-
const key = props ? props[index] : index,
|
|
1456
|
-
subValue = value[key];
|
|
1457
|
-
result[key] = cloneDeep$1(subValue);
|
|
791
|
+
multi(point) {
|
|
792
|
+
throw new Error("暂不支持");
|
|
1458
793
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
function baseMerge$1(target, source) {
|
|
1463
|
-
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1464
|
-
if (source) {
|
|
1465
|
-
if (target === source) return;
|
|
1466
|
-
if (isValid$5(source) && "object" == typeof source) {
|
|
1467
|
-
const iterable = Object(source),
|
|
1468
|
-
props = [];
|
|
1469
|
-
for (const key in iterable) props.push(key);
|
|
1470
|
-
let {
|
|
1471
|
-
length: length
|
|
1472
|
-
} = props,
|
|
1473
|
-
propIndex = -1;
|
|
1474
|
-
for (; length--;) {
|
|
1475
|
-
const key = props[++propIndex];
|
|
1476
|
-
isValid$5(iterable[key]) && "object" == typeof iterable[key] ? baseMergeDeep$1(target, source, key, shallowArray) : assignMergeValue$1(target, key, iterable[key]);
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
794
|
+
div(point) {
|
|
795
|
+
throw new Error("暂不支持");
|
|
1479
796
|
}
|
|
1480
797
|
}
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
srcValue = source[key];
|
|
1485
|
-
let newValue = source[key],
|
|
1486
|
-
isCommon = !0;
|
|
1487
|
-
if (isArray$5(srcValue)) {
|
|
1488
|
-
if (shallowArray) newValue = [];else if (isArray$5(objValue)) newValue = objValue;else if (isArrayLike$3(objValue)) {
|
|
1489
|
-
newValue = new Array(objValue.length);
|
|
1490
|
-
let index = -1;
|
|
1491
|
-
const length = objValue.length;
|
|
1492
|
-
for (; ++index < length;) newValue[index] = objValue[index];
|
|
1493
|
-
}
|
|
1494
|
-
} else isPlainObject$3(srcValue) ? (newValue = objValue, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
1495
|
-
isCommon && baseMerge$1(newValue, srcValue, shallowArray), assignMergeValue$1(target, key, newValue);
|
|
1496
|
-
}
|
|
1497
|
-
function assignMergeValue$1(target, key, value) {
|
|
1498
|
-
(void 0 !== value && !eq$1(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
1499
|
-
}
|
|
1500
|
-
function eq$1(value, other) {
|
|
1501
|
-
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1502
|
-
}
|
|
1503
|
-
function merge$1(target) {
|
|
1504
|
-
let sourceIndex = -1;
|
|
1505
|
-
const length = arguments.length <= 1 ? 0 : arguments.length - 1;
|
|
1506
|
-
for (; ++sourceIndex < length;) {
|
|
1507
|
-
baseMerge$1(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
|
|
798
|
+
class PointService {
|
|
799
|
+
static distancePP(p1, p2) {
|
|
800
|
+
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
|
|
1508
801
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
function pickWithout(obj, keys) {
|
|
1513
|
-
if (!obj || !isPlainObject$3(obj)) return obj;
|
|
1514
|
-
const result = {};
|
|
1515
|
-
return Object.keys(obj).forEach(k => {
|
|
1516
|
-
const v = obj[k];
|
|
1517
|
-
let match = !1;
|
|
1518
|
-
keys.forEach(itKey => {
|
|
1519
|
-
(isString$3(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
1520
|
-
}), match || (result[k] = v);
|
|
1521
|
-
}), result;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
function objToString(obj) {
|
|
1525
|
-
return Object.prototype.toString.call(obj);
|
|
1526
|
-
}
|
|
1527
|
-
function objectKeys(obj) {
|
|
1528
|
-
return Object.keys(obj);
|
|
1529
|
-
}
|
|
1530
|
-
function isEqual(a, b) {
|
|
1531
|
-
if (a === b) return !0;
|
|
1532
|
-
if (typeof a != typeof b) return !1;
|
|
1533
|
-
if (null == a || null == b) return !1;
|
|
1534
|
-
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
1535
|
-
if (objToString(a) !== objToString(b)) return !1;
|
|
1536
|
-
if (isFunction$1(a)) return !1;
|
|
1537
|
-
if ("object" != typeof a) return !1;
|
|
1538
|
-
if (isArray$5(a)) {
|
|
1539
|
-
if (a.length !== b.length) return !1;
|
|
1540
|
-
for (let i = a.length - 1; i >= 0; i--) if (!isEqual(a[i], b[i])) return !1;
|
|
1541
|
-
return !0;
|
|
802
|
+
static distanceNN(x, y, x1, y1) {
|
|
803
|
+
return sqrt(pow(x - x1, 2) + pow(y - y1, 2));
|
|
1542
804
|
}
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
for (let i = ka.length - 1; i >= 0; i--) if (ka[i] != kb[i]) return !1;
|
|
1549
|
-
for (let i = ka.length - 1; i >= 0; i--) {
|
|
1550
|
-
const key = ka[i];
|
|
1551
|
-
if (!isEqual(a[key], b[key])) return !1;
|
|
805
|
+
static distancePN(point, x, y) {
|
|
806
|
+
return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2));
|
|
807
|
+
}
|
|
808
|
+
static pointAtPP(p1, p2, t) {
|
|
809
|
+
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
1552
810
|
}
|
|
1553
|
-
return !0;
|
|
1554
811
|
}
|
|
1555
812
|
|
|
1556
|
-
function
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
813
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
814
|
+
const {
|
|
815
|
+
x1: x1,
|
|
816
|
+
y1: y1,
|
|
817
|
+
x2: x2,
|
|
818
|
+
y2: y2
|
|
819
|
+
} = bounds;
|
|
820
|
+
return matrix.onlyTranslate() ? (out !== bounds && out.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), out.translate(matrix.e, matrix.f), bounds) : (out.clear(), out.add(matrix.a * x1 + matrix.c * y1 + matrix.e, matrix.b * x1 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y1 + matrix.e, matrix.b * x2 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y2 + matrix.e, matrix.b * x2 + matrix.d * y2 + matrix.f), out.add(matrix.a * x1 + matrix.c * y2 + matrix.e, matrix.b * x1 + matrix.d * y2 + matrix.f), bounds);
|
|
1562
821
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
const key = keysArr[i];
|
|
1567
|
-
(overlay ? null != source[key] : null == target[key]) && (target[key] = source[key]);
|
|
1568
|
-
}
|
|
1569
|
-
return target;
|
|
1570
|
-
}
|
|
1571
|
-
function mixin(target, source) {
|
|
1572
|
-
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
1573
|
-
if (target = "prototype" in target ? target.prototype : target, source = "prototype" in source ? source.prototype : source, Object.getOwnPropertyNames) {
|
|
1574
|
-
const keyList = Object.getOwnPropertyNames(source);
|
|
1575
|
-
for (let i = 0; i < keyList.length; i++) {
|
|
1576
|
-
const key = keyList[i];
|
|
1577
|
-
"constructor" !== key && (override ? null != source[key] : null == target[key]) && (target[key] = source[key]);
|
|
1578
|
-
}
|
|
1579
|
-
} else defaults(target, source, override);
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
function array$1(arr) {
|
|
1583
|
-
return isValid$5(arr) ? isArray$5(arr) ? arr : [arr] : [];
|
|
1584
|
-
}
|
|
1585
|
-
function last(val) {
|
|
1586
|
-
if (isArrayLike$3(val)) {
|
|
1587
|
-
return val[val.length - 1];
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
function maxInArray(arr) {
|
|
1591
|
-
if (arr && isArray$5(arr)) return arr.reduce((prev, curr) => Math.max(prev, curr), -1 / 0);
|
|
1592
|
-
}
|
|
1593
|
-
function minInArray(arr) {
|
|
1594
|
-
if (arr && isArray$5(arr)) return arr.reduce((prev, curr) => Math.min(prev, curr), 1 / 0);
|
|
1595
|
-
}
|
|
1596
|
-
function arrayEqual(a, b) {
|
|
1597
|
-
if (!isArray$5(a) || !isArray$5(b)) return !1;
|
|
1598
|
-
if (a.length !== b.length) return !1;
|
|
1599
|
-
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1;
|
|
1600
|
-
return !0;
|
|
1601
|
-
}
|
|
1602
|
-
function flattenArray(arr) {
|
|
1603
|
-
if (!isArray$5(arr)) return [arr];
|
|
1604
|
-
const result = [];
|
|
1605
|
-
for (const value of arr) result.push(...flattenArray(value));
|
|
1606
|
-
return result;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
const DEFAULT_ABSOLUTE_TOLERATE$1 = 1e-10,
|
|
1610
|
-
DEFAULT_RELATIVE_TOLERATE$1 = 1e-10;
|
|
1611
|
-
function isNumberClose$1(a, b) {
|
|
1612
|
-
let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_RELATIVE_TOLERATE$1;
|
|
1613
|
-
let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_ABSOLUTE_TOLERATE$1;
|
|
1614
|
-
const abs = absTol,
|
|
1615
|
-
rel = relTol * Math.max(a, b);
|
|
1616
|
-
return Math.abs(a - b) <= Math.max(abs, rel);
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
|
-
const clamp$2 = function (input, min, max) {
|
|
1620
|
-
return input < min ? min : input > max ? max : input;
|
|
1621
|
-
};
|
|
1622
|
-
var clamp$3 = clamp$2;
|
|
1623
|
-
|
|
1624
|
-
const clampRange = (range, min, max) => {
|
|
1625
|
-
let [lowValue, highValue] = range;
|
|
1626
|
-
highValue < lowValue && (lowValue = range[1], highValue = range[0]);
|
|
1627
|
-
const span = highValue - lowValue;
|
|
1628
|
-
return span >= max - min ? [min, max] : (lowValue = Math.min(Math.max(lowValue, min), max - span), [lowValue, lowValue + span]);
|
|
1629
|
-
};
|
|
1630
|
-
var clampRange$1 = clampRange;
|
|
1631
|
-
|
|
1632
|
-
const epsilon = 1e-12;
|
|
1633
|
-
const pi = Math.PI;
|
|
1634
|
-
const halfPi$1 = pi / 2;
|
|
1635
|
-
const tau = 2 * pi;
|
|
1636
|
-
const pi2 = 2 * Math.PI;
|
|
1637
|
-
const abs = Math.abs;
|
|
1638
|
-
const atan2 = Math.atan2;
|
|
1639
|
-
const cos = Math.cos;
|
|
1640
|
-
const max = Math.max;
|
|
1641
|
-
const min = Math.min;
|
|
1642
|
-
const sin = Math.sin;
|
|
1643
|
-
const sqrt = Math.sqrt;
|
|
1644
|
-
const pow = Math.pow;
|
|
1645
|
-
function acos(x) {
|
|
1646
|
-
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
1647
|
-
}
|
|
1648
|
-
function asin(x) {
|
|
1649
|
-
return x >= 1 ? halfPi$1 : x <= -1 ? -halfPi$1 : Math.asin(x);
|
|
1650
|
-
}
|
|
1651
|
-
function pointAt(x1, y1, x2, y2, t) {
|
|
1652
|
-
let x, y;
|
|
1653
|
-
return "number" == typeof x1 && "number" == typeof x2 && (x = (1 - t) * x1 + t * x2), "number" == typeof y1 && "number" == typeof y2 && (y = (1 - t) * y1 + t * y2), {
|
|
1654
|
-
x: x,
|
|
1655
|
-
y: y
|
|
1656
|
-
};
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
class Point {
|
|
1660
|
-
constructor() {
|
|
1661
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1662
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1663
|
-
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
1664
|
-
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
1665
|
-
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
1666
|
-
}
|
|
1667
|
-
clone() {
|
|
1668
|
-
return new Point(this.x, this.y);
|
|
1669
|
-
}
|
|
1670
|
-
copyFrom(p) {
|
|
1671
|
-
return this.x = p.x, this.y = p.y, this.x1 = p.x1, this.y1 = p.y1, this.defined = p.defined, this.context = p.context, this;
|
|
1672
|
-
}
|
|
1673
|
-
set(x, y) {
|
|
1674
|
-
return this.x = x, this.y = y, this;
|
|
1675
|
-
}
|
|
1676
|
-
add(point) {
|
|
1677
|
-
return isNumber$6(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1678
|
-
}
|
|
1679
|
-
sub(point) {
|
|
1680
|
-
return isNumber$6(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1681
|
-
}
|
|
1682
|
-
multi(point) {
|
|
1683
|
-
throw new Error("暂不支持");
|
|
1684
|
-
}
|
|
1685
|
-
div(point) {
|
|
1686
|
-
throw new Error("暂不支持");
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
class PointService {
|
|
1690
|
-
static distancePP(p1, p2) {
|
|
1691
|
-
return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
|
|
1692
|
-
}
|
|
1693
|
-
static distanceNN(x, y, x1, y1) {
|
|
1694
|
-
return sqrt(pow(x - x1, 2) + pow(y - y1, 2));
|
|
1695
|
-
}
|
|
1696
|
-
static distancePN(point, x, y) {
|
|
1697
|
-
return sqrt(pow(x - point.x, 2) + pow(y - point.y, 2));
|
|
1698
|
-
}
|
|
1699
|
-
static pointAtPP(p1, p2, t) {
|
|
1700
|
-
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1705
|
-
const {
|
|
1706
|
-
x1: x1,
|
|
1707
|
-
y1: y1,
|
|
1708
|
-
x2: x2,
|
|
1709
|
-
y2: y2
|
|
1710
|
-
} = bounds;
|
|
1711
|
-
return matrix.onlyTranslate() ? (out !== bounds && out.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), out.translate(matrix.e, matrix.f), bounds) : (out.clear(), out.add(matrix.a * x1 + matrix.c * y1 + matrix.e, matrix.b * x1 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y1 + matrix.e, matrix.b * x2 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y2 + matrix.e, matrix.b * x2 + matrix.d * y2 + matrix.f), out.add(matrix.a * x1 + matrix.c * y2 + matrix.e, matrix.b * x1 + matrix.d * y2 + matrix.f), bounds);
|
|
1712
|
-
}
|
|
1713
|
-
class Bounds {
|
|
1714
|
-
constructor(bounds) {
|
|
1715
|
-
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
822
|
+
class Bounds {
|
|
823
|
+
constructor(bounds) {
|
|
824
|
+
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1716
825
|
}
|
|
1717
826
|
clone() {
|
|
1718
827
|
return new Bounds(this);
|
|
@@ -2254,8 +1363,8 @@
|
|
|
2254
1363
|
}
|
|
2255
1364
|
}
|
|
2256
1365
|
static parseColorString(value) {
|
|
2257
|
-
if (isValid$
|
|
2258
|
-
if (isValid$
|
|
1366
|
+
if (isValid$6(DEFAULT_COLORS_OPACITY$1[value])) return rgba$1(DEFAULT_COLORS_OPACITY$1[value]);
|
|
1367
|
+
if (isValid$6(DEFAULT_COLORS$1[value])) return rgb$1(DEFAULT_COLORS$1[value]);
|
|
2259
1368
|
const formatValue = `${value}`.trim().toLowerCase(),
|
|
2260
1369
|
isHex = REG_HEX$1.exec(formatValue);
|
|
2261
1370
|
if (isHex) {
|
|
@@ -2391,7 +1500,7 @@
|
|
|
2391
1500
|
};
|
|
2392
1501
|
let RGB$1 = class RGB {
|
|
2393
1502
|
constructor(r, g, b, opacity) {
|
|
2394
|
-
this.r = isNaN(+r) ? 255 : Math.max(0, Math.min(255, +r)), this.g = isNaN(+g) ? 255 : Math.max(0, Math.min(255, +g)), this.b = isNaN(+b) ? 255 : Math.max(0, Math.min(255, +b)), isValid$
|
|
1503
|
+
this.r = isNaN(+r) ? 255 : Math.max(0, Math.min(255, +r)), this.g = isNaN(+g) ? 255 : Math.max(0, Math.min(255, +g)), this.b = isNaN(+b) ? 255 : Math.max(0, Math.min(255, +b)), isValid$6(opacity) ? this.opacity = isNaN(+opacity) ? 1 : Math.max(0, Math.min(1, +opacity)) : this.opacity = 1;
|
|
2395
1504
|
}
|
|
2396
1505
|
formatHex() {
|
|
2397
1506
|
return `#${hex$1(this.r) + hex$1(this.g) + hex$1(this.b) + (1 === this.opacity ? "" : hex$1(255 * this.opacity))}`;
|
|
@@ -2554,248 +1663,1136 @@
|
|
|
2554
1663
|
return isCover((box1.x2 - box1.x1) / 2, deg11, A1B1, B1C1) && isCover((box1.y2 - box1.y1) / 2, deg12, A1B1, B1C1) && isCover((box2.x2 - box2.x1) / 2, deg21, AB, BC) && isCover((box2.y2 - box2.y1) / 2, deg22, AB, BC);
|
|
2555
1664
|
}
|
|
2556
1665
|
|
|
2557
|
-
const eastAsianCharacterInfo = character => {
|
|
2558
|
-
let x = character.charCodeAt(0),
|
|
2559
|
-
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
2560
|
-
codePoint = x;
|
|
2561
|
-
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
2562
|
-
};
|
|
1666
|
+
const eastAsianCharacterInfo = character => {
|
|
1667
|
+
let x = character.charCodeAt(0),
|
|
1668
|
+
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
1669
|
+
codePoint = x;
|
|
1670
|
+
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1673
|
+
function getContextFont$2(text) {
|
|
1674
|
+
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1675
|
+
const {
|
|
1676
|
+
fontStyle = defaultAttr.fontStyle,
|
|
1677
|
+
fontVariant = defaultAttr.fontVariant,
|
|
1678
|
+
fontWeight = defaultAttr.fontWeight,
|
|
1679
|
+
fontSize = defaultAttr.fontSize,
|
|
1680
|
+
fontFamily = defaultAttr.fontFamily
|
|
1681
|
+
} = text;
|
|
1682
|
+
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize + "px " + (fontFamily || "sans-serif");
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
class TextMeasure {
|
|
1686
|
+
constructor(option, textSpec) {
|
|
1687
|
+
this._numberCharSize = null, this._fullCharSize = null, this._letterCharSize = null, this._specialCharSizeMap = {}, this._canvas = null, this._context = null, this._contextSaved = !1, this._notSupportCanvas = !1, this._notSupportVRender = !1, this._userSpec = {}, this.specialCharSet = "-/: .,@%'\"~", this._option = option, this._userSpec = null != textSpec ? textSpec : {}, this.textSpec = this._initSpec(), isValid$6(option.specialCharSet) && (this.specialCharSet = option.specialCharSet), this._standardMethod = isValid$6(option.getTextBounds) ? this.fullMeasure.bind(this) : this.measureWithNaiveCanvas.bind(this);
|
|
1688
|
+
}
|
|
1689
|
+
initContext() {
|
|
1690
|
+
if (this._notSupportCanvas) return !1;
|
|
1691
|
+
if (isNil$5(this._canvas) && (isValid$6(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$5(this._canvas) && "undefined" != typeof window && void 0 !== window.document && isValid$6(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$5(this._context) && isValid$6(this._canvas)) {
|
|
1692
|
+
const context = this._canvas.getContext("2d");
|
|
1693
|
+
isValid$6(context) && (context.save(), context.font = getContextFont$2(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
1694
|
+
}
|
|
1695
|
+
return !isNil$5(this._context) || (this._notSupportCanvas = !0, !1);
|
|
1696
|
+
}
|
|
1697
|
+
_initSpec() {
|
|
1698
|
+
var _a, _b, _c;
|
|
1699
|
+
const {
|
|
1700
|
+
defaultFontParams = {}
|
|
1701
|
+
} = this._option,
|
|
1702
|
+
{
|
|
1703
|
+
fontStyle = defaultFontParams.fontStyle,
|
|
1704
|
+
fontVariant = defaultFontParams.fontVariant,
|
|
1705
|
+
fontWeight = null !== (_a = defaultFontParams.fontWeight) && void 0 !== _a ? _a : "normal",
|
|
1706
|
+
fontSize = null !== (_b = defaultFontParams.fontSize) && void 0 !== _b ? _b : 12,
|
|
1707
|
+
fontFamily = null !== (_c = defaultFontParams.fontFamily) && void 0 !== _c ? _c : "sans-serif",
|
|
1708
|
+
align: align,
|
|
1709
|
+
textAlign = null != align ? align : "center",
|
|
1710
|
+
baseline: baseline,
|
|
1711
|
+
textBaseline = null != baseline ? baseline : "middle",
|
|
1712
|
+
ellipsis: ellipsis,
|
|
1713
|
+
limit: limit,
|
|
1714
|
+
lineHeight = fontSize
|
|
1715
|
+
} = this._userSpec;
|
|
1716
|
+
return {
|
|
1717
|
+
fontStyle: fontStyle,
|
|
1718
|
+
fontVariant: fontVariant,
|
|
1719
|
+
fontFamily: fontFamily,
|
|
1720
|
+
fontSize: fontSize,
|
|
1721
|
+
fontWeight: fontWeight,
|
|
1722
|
+
textAlign: textAlign,
|
|
1723
|
+
textBaseline: textBaseline,
|
|
1724
|
+
ellipsis: ellipsis,
|
|
1725
|
+
limit: limit,
|
|
1726
|
+
lineHeight: lineHeight
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
measure(text, method) {
|
|
1730
|
+
switch (method) {
|
|
1731
|
+
case "vrender":
|
|
1732
|
+
case "canopus":
|
|
1733
|
+
return this.fullMeasure(text);
|
|
1734
|
+
case "canvas":
|
|
1735
|
+
return this.measureWithNaiveCanvas(text);
|
|
1736
|
+
case "simple":
|
|
1737
|
+
return this.quickMeasureWithoutCanvas(text);
|
|
1738
|
+
default:
|
|
1739
|
+
return this.quickMeasure(text);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
fullMeasure(text) {
|
|
1743
|
+
if (isNil$5(text)) return {
|
|
1744
|
+
width: 0,
|
|
1745
|
+
height: 0
|
|
1746
|
+
};
|
|
1747
|
+
if (isNil$5(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
1748
|
+
const {
|
|
1749
|
+
fontFamily: fontFamily,
|
|
1750
|
+
fontSize: fontSize,
|
|
1751
|
+
fontWeight: fontWeight,
|
|
1752
|
+
textAlign: textAlign,
|
|
1753
|
+
textBaseline: textBaseline,
|
|
1754
|
+
ellipsis: ellipsis,
|
|
1755
|
+
limit: limit,
|
|
1756
|
+
lineHeight: lineHeight
|
|
1757
|
+
} = this.textSpec;
|
|
1758
|
+
let size;
|
|
1759
|
+
try {
|
|
1760
|
+
const bounds = this._option.getTextBounds({
|
|
1761
|
+
text: text,
|
|
1762
|
+
fontFamily: fontFamily,
|
|
1763
|
+
fontSize: fontSize,
|
|
1764
|
+
fontWeight: fontWeight,
|
|
1765
|
+
textAlign: textAlign,
|
|
1766
|
+
textBaseline: textBaseline,
|
|
1767
|
+
ellipsis: !!ellipsis,
|
|
1768
|
+
maxLineWidth: limit || 1 / 0,
|
|
1769
|
+
lineHeight: lineHeight
|
|
1770
|
+
});
|
|
1771
|
+
size = {
|
|
1772
|
+
width: bounds.width(),
|
|
1773
|
+
height: bounds.height()
|
|
1774
|
+
};
|
|
1775
|
+
} catch (e) {
|
|
1776
|
+
this._notSupportVRender = !0, size = this.measureWithNaiveCanvas(text);
|
|
1777
|
+
}
|
|
1778
|
+
return size;
|
|
1779
|
+
}
|
|
1780
|
+
measureWithNaiveCanvas(text) {
|
|
1781
|
+
return this._measureReduce(text, this._measureWithNaiveCanvas.bind(this));
|
|
1782
|
+
}
|
|
1783
|
+
_measureWithNaiveCanvas(text) {
|
|
1784
|
+
if (!this.initContext()) return this._quickMeasureWithoutCanvas(text);
|
|
1785
|
+
const metrics = this._context.measureText(text),
|
|
1786
|
+
{
|
|
1787
|
+
fontSize: fontSize,
|
|
1788
|
+
lineHeight: lineHeight
|
|
1789
|
+
} = this.textSpec;
|
|
1790
|
+
return {
|
|
1791
|
+
width: metrics.width,
|
|
1792
|
+
height: null != lineHeight ? lineHeight : fontSize
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
quickMeasure(text) {
|
|
1796
|
+
return this._measureReduce(text, this._quickMeasure.bind(this));
|
|
1797
|
+
}
|
|
1798
|
+
_quickMeasure(text) {
|
|
1799
|
+
const totalSize = {
|
|
1800
|
+
width: 0,
|
|
1801
|
+
height: 0
|
|
1802
|
+
};
|
|
1803
|
+
for (let i = 0; i < text.length; i++) {
|
|
1804
|
+
const char = text[i];
|
|
1805
|
+
let size = this._measureSpecialChar(char);
|
|
1806
|
+
isNil$5(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$5(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$5(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
1807
|
+
}
|
|
1808
|
+
return totalSize;
|
|
1809
|
+
}
|
|
1810
|
+
quickMeasureWithoutCanvas(text) {
|
|
1811
|
+
return this._measureReduce(text, this._quickMeasureWithoutCanvas.bind(this));
|
|
1812
|
+
}
|
|
1813
|
+
_quickMeasureWithoutCanvas(text) {
|
|
1814
|
+
const totalSize = {
|
|
1815
|
+
width: 0,
|
|
1816
|
+
height: 0
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
fontSize: fontSize,
|
|
1820
|
+
lineHeight: lineHeight
|
|
1821
|
+
} = this.textSpec;
|
|
1822
|
+
for (let i = 0; i < text.length; i++) {
|
|
1823
|
+
const char = text[i],
|
|
1824
|
+
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
1825
|
+
totalSize.width += size * fontSize;
|
|
1826
|
+
}
|
|
1827
|
+
return totalSize.height = null != lineHeight ? lineHeight : fontSize, totalSize;
|
|
1828
|
+
}
|
|
1829
|
+
_measureReduce(text, processor) {
|
|
1830
|
+
const {
|
|
1831
|
+
fontSize: fontSize,
|
|
1832
|
+
lineHeight: lineHeight
|
|
1833
|
+
} = this.textSpec,
|
|
1834
|
+
defaultResult = {
|
|
1835
|
+
width: 0,
|
|
1836
|
+
height: 0
|
|
1837
|
+
};
|
|
1838
|
+
if (isNil$5(text)) return defaultResult;
|
|
1839
|
+
if (isArray$5(text)) {
|
|
1840
|
+
const textArr = text.filter(isValid$6).map(s => s.toString());
|
|
1841
|
+
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
1842
|
+
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
1843
|
+
height: textArr.length * ((null != lineHeight ? lineHeight : fontSize) + 1) + 1
|
|
1844
|
+
};
|
|
1845
|
+
}
|
|
1846
|
+
return processor(text.toString());
|
|
1847
|
+
}
|
|
1848
|
+
_measureNumberChar() {
|
|
1849
|
+
if (isNil$5(this._numberCharSize)) {
|
|
1850
|
+
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
1851
|
+
this._numberCharSize = {
|
|
1852
|
+
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
1853
|
+
height: numberBounds.height
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
return this._numberCharSize;
|
|
1857
|
+
}
|
|
1858
|
+
_measureFullSizeChar() {
|
|
1859
|
+
return isNil$5(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
1860
|
+
}
|
|
1861
|
+
_measureLetterChar() {
|
|
1862
|
+
if (isNil$5(this._letterCharSize)) {
|
|
1863
|
+
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
1864
|
+
this._letterCharSize = {
|
|
1865
|
+
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
1866
|
+
height: alphabetBounds.height
|
|
1867
|
+
};
|
|
1868
|
+
}
|
|
1869
|
+
return this._letterCharSize;
|
|
1870
|
+
}
|
|
1871
|
+
_measureSpecialChar(char) {
|
|
1872
|
+
return isValid$6(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
1873
|
+
}
|
|
1874
|
+
release() {
|
|
1875
|
+
isValid$6(this._canvas) && (this._canvas = null), isValid$6(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
1879
|
+
|
|
1880
|
+
function normalizePadding(padding) {
|
|
1881
|
+
if (isValidNumber$1(padding)) return [padding, padding, padding, padding];
|
|
1882
|
+
if (isArray$5(padding)) {
|
|
1883
|
+
const length = padding.length;
|
|
1884
|
+
if (1 === length) {
|
|
1885
|
+
const paddingValue = padding[0];
|
|
1886
|
+
return [paddingValue, paddingValue, paddingValue, paddingValue];
|
|
1887
|
+
}
|
|
1888
|
+
if (2 === length) {
|
|
1889
|
+
const [vertical, horizontal] = padding;
|
|
1890
|
+
return [vertical, horizontal, vertical, horizontal];
|
|
1891
|
+
}
|
|
1892
|
+
if (3 === length) {
|
|
1893
|
+
const [top, horizontal, bottom] = padding;
|
|
1894
|
+
return [top, horizontal, bottom, horizontal];
|
|
1895
|
+
}
|
|
1896
|
+
if (4 === length) return padding;
|
|
1897
|
+
}
|
|
1898
|
+
if (isObject$4(padding)) {
|
|
1899
|
+
const {
|
|
1900
|
+
top = 0,
|
|
1901
|
+
right = 0,
|
|
1902
|
+
bottom = 0,
|
|
1903
|
+
left = 0
|
|
1904
|
+
} = padding;
|
|
1905
|
+
return [top, right, bottom, left];
|
|
1906
|
+
}
|
|
1907
|
+
return [0, 0, 0, 0];
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
let idCount$1 = 1;
|
|
1911
|
+
let EventTarget$3 = class EventTarget {
|
|
1912
|
+
listenersData = {
|
|
1913
|
+
listeners: {},
|
|
1914
|
+
listenerData: {}
|
|
1915
|
+
};
|
|
1916
|
+
on(type, listener) {
|
|
1917
|
+
const list = this.listenersData.listeners[type] || (this.listenersData.listeners[type] = []);
|
|
1918
|
+
list.push(listener);
|
|
1919
|
+
const id = idCount$1++;
|
|
1920
|
+
this.listenersData.listenerData[id] = {
|
|
1921
|
+
type,
|
|
1922
|
+
listener,
|
|
1923
|
+
remove: () => {
|
|
1924
|
+
delete this.listenersData.listenerData[id];
|
|
1925
|
+
const index = list.indexOf(listener);
|
|
1926
|
+
list.splice(index, 1);
|
|
1927
|
+
if (!this.listenersData.listeners[type].length) {
|
|
1928
|
+
delete this.listenersData.listeners[type];
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
return id;
|
|
1933
|
+
}
|
|
1934
|
+
off(idOrType, listener) {
|
|
1935
|
+
if (listener) {
|
|
1936
|
+
const type = idOrType;
|
|
1937
|
+
this.removeEventListener(type, listener);
|
|
1938
|
+
}
|
|
1939
|
+
else {
|
|
1940
|
+
const id = idOrType;
|
|
1941
|
+
if (!this.listenersData) {
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
this.listenersData.listenerData[id]?.remove();
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
addEventListener(type, listener, option) {
|
|
1948
|
+
this.on(type, listener);
|
|
1949
|
+
}
|
|
1950
|
+
removeEventListener(type, listener) {
|
|
1951
|
+
if (!this.listenersData) {
|
|
1952
|
+
return;
|
|
1953
|
+
}
|
|
1954
|
+
for (const key in this.listenersData.listenerData) {
|
|
1955
|
+
const listenerData = this.listenersData.listenerData[key];
|
|
1956
|
+
if (listenerData.type === type && listenerData.listener === listener) {
|
|
1957
|
+
this.off(key);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
hasListeners(type) {
|
|
1962
|
+
if (!this.listenersData) {
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
return !!this.listenersData.listeners[type];
|
|
1966
|
+
}
|
|
1967
|
+
fireListeners(type, event) {
|
|
1968
|
+
if (!this.listenersData) {
|
|
1969
|
+
return [];
|
|
1970
|
+
}
|
|
1971
|
+
const list = this.listenersData.listeners[type];
|
|
1972
|
+
if (!list) {
|
|
1973
|
+
return [];
|
|
1974
|
+
}
|
|
1975
|
+
return list.map(listener => listener.call(this, event)).filter(r => isValid$6(r));
|
|
1976
|
+
}
|
|
1977
|
+
release() {
|
|
1978
|
+
delete this.listenersData;
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
let defaultStyle$6;
|
|
1983
|
+
const STYLE_EVENT_TYPE = {
|
|
1984
|
+
CHANGE_STYLE: 'change_style'
|
|
1985
|
+
};
|
|
1986
|
+
let Style$1 = class Style extends EventTarget$3 {
|
|
1987
|
+
_color;
|
|
1988
|
+
_fontSize;
|
|
1989
|
+
_fontFamily;
|
|
1990
|
+
_fontWeight;
|
|
1991
|
+
_fontVariant;
|
|
1992
|
+
_fontStyle;
|
|
1993
|
+
_padding;
|
|
1994
|
+
_defaultPadding = [10, 16, 10, 16];
|
|
1995
|
+
_textStick;
|
|
1996
|
+
_textOverflow;
|
|
1997
|
+
_textAlign;
|
|
1998
|
+
_textBaseline;
|
|
1999
|
+
_bgColor;
|
|
2000
|
+
_borderColor;
|
|
2001
|
+
_lineHeight;
|
|
2002
|
+
_underline;
|
|
2003
|
+
_underlineColor;
|
|
2004
|
+
_underlineDash;
|
|
2005
|
+
_lineThrough;
|
|
2006
|
+
_lineThroughColor;
|
|
2007
|
+
_lineThroughDash;
|
|
2008
|
+
_linkColor;
|
|
2009
|
+
_cursor;
|
|
2010
|
+
_borderLineWidth;
|
|
2011
|
+
_borderLineDash;
|
|
2012
|
+
_marked;
|
|
2013
|
+
static get EVENT_TYPE() {
|
|
2014
|
+
return STYLE_EVENT_TYPE;
|
|
2015
|
+
}
|
|
2016
|
+
static get DEFAULT() {
|
|
2017
|
+
return defaultStyle$6 ? defaultStyle$6 : (defaultStyle$6 = new Style());
|
|
2018
|
+
}
|
|
2019
|
+
constructor(style = {}, bodyStyle = {}) {
|
|
2020
|
+
super();
|
|
2021
|
+
this._textAlign = style?.textAlign ?? bodyStyle?.textAlign;
|
|
2022
|
+
this._textBaseline = style?.textBaseline ?? bodyStyle?.textBaseline;
|
|
2023
|
+
this._color = style?.color ?? bodyStyle?.color;
|
|
2024
|
+
this._fontSize = style.fontSize ?? bodyStyle?.fontSize;
|
|
2025
|
+
this._fontFamily = style.fontFamily ?? bodyStyle?.fontFamily;
|
|
2026
|
+
this._fontWeight = style.fontWeight ?? bodyStyle?.fontWeight;
|
|
2027
|
+
this._fontVariant = style.fontVariant ?? bodyStyle?.fontVariant;
|
|
2028
|
+
this._fontStyle = style.fontStyle ?? bodyStyle?.fontStyle;
|
|
2029
|
+
this._padding = style?.padding ?? bodyStyle?.padding ?? this._defaultPadding;
|
|
2030
|
+
this._borderColor = style?.borderColor ?? bodyStyle?.borderColor;
|
|
2031
|
+
this._textOverflow = style?.textOverflow ?? bodyStyle?.textOverflow;
|
|
2032
|
+
this._textStick = style.textStick ?? bodyStyle?.textStick ?? false;
|
|
2033
|
+
this._bgColor = style?.bgColor ?? bodyStyle?.bgColor;
|
|
2034
|
+
this._lineHeight = style?.lineHeight ?? bodyStyle?.lineHeight;
|
|
2035
|
+
this._underline = style?.underline ?? bodyStyle?.underline;
|
|
2036
|
+
this._underlineColor = style?.underlineColor ?? bodyStyle?.underlineColor;
|
|
2037
|
+
this._underlineDash = style?.underlineDash ?? bodyStyle?.underlineDash;
|
|
2038
|
+
this._lineThrough = style?.lineThrough ?? bodyStyle?.lineThrough;
|
|
2039
|
+
this._lineThroughColor = style?.lineThroughColor ?? bodyStyle?.lineThroughColor;
|
|
2040
|
+
this._lineThroughDash = style?.lineThroughDash ?? bodyStyle?.lineThroughDash;
|
|
2041
|
+
this._linkColor = style?.linkColor ?? bodyStyle?.linkColor;
|
|
2042
|
+
this._cursor = style.cursor ?? bodyStyle?.cursor;
|
|
2043
|
+
this._borderLineWidth = style.borderLineWidth ?? bodyStyle?.borderLineWidth;
|
|
2044
|
+
this._borderLineDash = style.borderLineDash ?? bodyStyle?.borderLineDash;
|
|
2045
|
+
this._marked = style.marked ?? bodyStyle?.marked;
|
|
2046
|
+
}
|
|
2047
|
+
get color() {
|
|
2048
|
+
return this._color;
|
|
2049
|
+
}
|
|
2050
|
+
set color(color) {
|
|
2051
|
+
this._color = color;
|
|
2052
|
+
}
|
|
2053
|
+
get fontSize() {
|
|
2054
|
+
return this._fontSize;
|
|
2055
|
+
}
|
|
2056
|
+
set fontSize(fontSize) {
|
|
2057
|
+
this._fontSize = fontSize;
|
|
2058
|
+
}
|
|
2059
|
+
get fontFamily() {
|
|
2060
|
+
return this._fontFamily;
|
|
2061
|
+
}
|
|
2062
|
+
set fontFamily(fontFamily) {
|
|
2063
|
+
this._fontFamily = fontFamily;
|
|
2064
|
+
}
|
|
2065
|
+
get fontWeight() {
|
|
2066
|
+
return this._fontWeight;
|
|
2067
|
+
}
|
|
2068
|
+
set fontWeight(fontWeight) {
|
|
2069
|
+
this._fontWeight = fontWeight;
|
|
2070
|
+
}
|
|
2071
|
+
get fontVariant() {
|
|
2072
|
+
return this._fontVariant;
|
|
2073
|
+
}
|
|
2074
|
+
set fontVariant(fontVariant) {
|
|
2075
|
+
this._fontVariant = fontVariant;
|
|
2076
|
+
}
|
|
2077
|
+
get fontStyle() {
|
|
2078
|
+
return this._fontStyle;
|
|
2079
|
+
}
|
|
2080
|
+
set fontStyle(fontStyle) {
|
|
2081
|
+
this._fontStyle = fontStyle;
|
|
2082
|
+
}
|
|
2083
|
+
get padding() {
|
|
2084
|
+
return this._padding;
|
|
2085
|
+
}
|
|
2086
|
+
set padding(padding) {
|
|
2087
|
+
this._padding = padding;
|
|
2088
|
+
}
|
|
2089
|
+
get textOverflow() {
|
|
2090
|
+
return this._textOverflow;
|
|
2091
|
+
}
|
|
2092
|
+
set textOverflow(textOverflow) {
|
|
2093
|
+
this._textOverflow = textOverflow;
|
|
2094
|
+
}
|
|
2095
|
+
get bgColor() {
|
|
2096
|
+
return this._bgColor;
|
|
2097
|
+
}
|
|
2098
|
+
set bgColor(bgColor) {
|
|
2099
|
+
this._bgColor = bgColor;
|
|
2100
|
+
}
|
|
2101
|
+
get borderColor() {
|
|
2102
|
+
return this._borderColor;
|
|
2103
|
+
}
|
|
2104
|
+
set borderColor(borderColor) {
|
|
2105
|
+
this._borderColor = borderColor;
|
|
2106
|
+
}
|
|
2107
|
+
get textStick() {
|
|
2108
|
+
return this._textStick;
|
|
2109
|
+
}
|
|
2110
|
+
set textStick(textStick) {
|
|
2111
|
+
this._textStick = textStick;
|
|
2112
|
+
}
|
|
2113
|
+
get textAlign() {
|
|
2114
|
+
return this._textAlign;
|
|
2115
|
+
}
|
|
2116
|
+
set textAlign(textAlign) {
|
|
2117
|
+
this._textAlign = textAlign;
|
|
2118
|
+
}
|
|
2119
|
+
get textBaseline() {
|
|
2120
|
+
return this._textBaseline;
|
|
2121
|
+
}
|
|
2122
|
+
set textBaseline(textBaseline) {
|
|
2123
|
+
this._textBaseline = textBaseline;
|
|
2124
|
+
}
|
|
2125
|
+
get lineHeight() {
|
|
2126
|
+
return this._lineHeight;
|
|
2127
|
+
}
|
|
2128
|
+
set lineHeight(lineHeight) {
|
|
2129
|
+
this._lineHeight = lineHeight;
|
|
2130
|
+
}
|
|
2131
|
+
get underline() {
|
|
2132
|
+
return this._underline;
|
|
2133
|
+
}
|
|
2134
|
+
set underline(underline) {
|
|
2135
|
+
this._underline = underline;
|
|
2136
|
+
}
|
|
2137
|
+
get underlineColor() {
|
|
2138
|
+
return this._underlineColor;
|
|
2139
|
+
}
|
|
2140
|
+
set underlineColor(underlineColor) {
|
|
2141
|
+
this._underlineColor = underlineColor;
|
|
2142
|
+
}
|
|
2143
|
+
get underlineDash() {
|
|
2144
|
+
return this._underlineDash;
|
|
2145
|
+
}
|
|
2146
|
+
set underlineDash(underlineDash) {
|
|
2147
|
+
this._underlineDash = underlineDash;
|
|
2148
|
+
}
|
|
2149
|
+
get lineThrough() {
|
|
2150
|
+
return this._lineThrough;
|
|
2151
|
+
}
|
|
2152
|
+
set lineThrough(lineThrough) {
|
|
2153
|
+
this._lineThrough = lineThrough;
|
|
2154
|
+
}
|
|
2155
|
+
get lineThroughColor() {
|
|
2156
|
+
return this._lineThroughColor;
|
|
2157
|
+
}
|
|
2158
|
+
set lineThroughColor(lineThroughColor) {
|
|
2159
|
+
this._lineThroughColor = lineThroughColor;
|
|
2160
|
+
}
|
|
2161
|
+
get lineThroughDash() {
|
|
2162
|
+
return this._lineThroughDash;
|
|
2163
|
+
}
|
|
2164
|
+
set lineThroughDash(lineThroughDash) {
|
|
2165
|
+
this._lineThroughDash = lineThroughDash;
|
|
2166
|
+
}
|
|
2167
|
+
get linkColor() {
|
|
2168
|
+
return this._linkColor;
|
|
2169
|
+
}
|
|
2170
|
+
set linkColor(linkColor) {
|
|
2171
|
+
this._linkColor = linkColor;
|
|
2172
|
+
}
|
|
2173
|
+
get cursor() {
|
|
2174
|
+
return this._cursor;
|
|
2175
|
+
}
|
|
2176
|
+
set cursor(cursor) {
|
|
2177
|
+
this._cursor = cursor;
|
|
2178
|
+
}
|
|
2179
|
+
get borderLineWidth() {
|
|
2180
|
+
return this._borderLineWidth;
|
|
2181
|
+
}
|
|
2182
|
+
set borderLineWidth(borderLineWidth) {
|
|
2183
|
+
this._borderLineWidth = borderLineWidth;
|
|
2184
|
+
}
|
|
2185
|
+
get borderLineDash() {
|
|
2186
|
+
return this._borderLineDash;
|
|
2187
|
+
}
|
|
2188
|
+
set borderLineDash(borderLineDash) {
|
|
2189
|
+
this._borderLineDash = borderLineDash;
|
|
2190
|
+
}
|
|
2191
|
+
get marked() {
|
|
2192
|
+
return this._marked;
|
|
2193
|
+
}
|
|
2194
|
+
set marked(marked) {
|
|
2195
|
+
this._marked = marked;
|
|
2196
|
+
}
|
|
2197
|
+
clone() {
|
|
2198
|
+
return new Style(this, null);
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
|
|
2202
|
+
let defaultStyle$5;
|
|
2203
|
+
let ImageStyle$1 = class ImageStyle extends Style$1 {
|
|
2204
|
+
static get DEFAULT() {
|
|
2205
|
+
return defaultStyle$5 ? defaultStyle$5 : (defaultStyle$5 = new ImageStyle());
|
|
2206
|
+
}
|
|
2207
|
+
constructor(style = {}, bodyStyle = {}) {
|
|
2208
|
+
super(style, bodyStyle);
|
|
2209
|
+
}
|
|
2210
|
+
clone() {
|
|
2211
|
+
return new ImageStyle(this, null);
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
let defaultStyle$4;
|
|
2216
|
+
class TextStyle extends Style$1 {
|
|
2217
|
+
_autoWrapText;
|
|
2218
|
+
_lineClamp;
|
|
2219
|
+
static get DEFAULT() {
|
|
2220
|
+
return defaultStyle$4 ? defaultStyle$4 : (defaultStyle$4 = new TextStyle());
|
|
2221
|
+
}
|
|
2222
|
+
constructor(style = {}, bodyStyle = {}) {
|
|
2223
|
+
super(style, bodyStyle);
|
|
2224
|
+
this._autoWrapText = style?.autoWrapText ?? bodyStyle?.autoWrapText;
|
|
2225
|
+
this._lineClamp = style?.lineClamp ?? bodyStyle?.lineClamp;
|
|
2226
|
+
}
|
|
2227
|
+
clone() {
|
|
2228
|
+
return new TextStyle(this, null);
|
|
2229
|
+
}
|
|
2230
|
+
get lineClamp() {
|
|
2231
|
+
return this._lineClamp;
|
|
2232
|
+
}
|
|
2233
|
+
set lineClamp(lineClamp) {
|
|
2234
|
+
this._lineClamp = lineClamp;
|
|
2235
|
+
}
|
|
2236
|
+
get autoWrapText() {
|
|
2237
|
+
return this._autoWrapText;
|
|
2238
|
+
}
|
|
2239
|
+
set autoWrapText(autoWrapText) {
|
|
2240
|
+
this._autoWrapText = autoWrapText;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
function of$2(columnStyle, bodyStyle, styleArg, StyleClassDef = Style$1, globalAutoWrapText) {
|
|
2245
|
+
if (columnStyle || bodyStyle) {
|
|
2246
|
+
if (columnStyle instanceof Style$1) {
|
|
2247
|
+
return columnStyle;
|
|
2248
|
+
}
|
|
2249
|
+
else if (typeof columnStyle === 'function') {
|
|
2250
|
+
return of$2(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText);
|
|
2251
|
+
}
|
|
2252
|
+
if (!columnStyle) {
|
|
2253
|
+
columnStyle = {};
|
|
2254
|
+
}
|
|
2255
|
+
if (globalAutoWrapText && !isValid$6(columnStyle.autoWrapText)) {
|
|
2256
|
+
columnStyle.autoWrapText = true;
|
|
2257
|
+
}
|
|
2258
|
+
return new StyleClassDef((columnStyle ?? {}), (bodyStyle ?? {}));
|
|
2259
|
+
}
|
|
2260
|
+
return StyleClassDef.DEFAULT;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
let defaultStyle$3;
|
|
2264
|
+
const EVENT_TYPE$1 = {
|
|
2265
|
+
CHANGE_STYLE: 'change_style'
|
|
2266
|
+
};
|
|
2267
|
+
class Style extends EventTarget$3 {
|
|
2268
|
+
_color;
|
|
2269
|
+
_fontSize;
|
|
2270
|
+
_fontFamily;
|
|
2271
|
+
_fontWeight;
|
|
2272
|
+
_fontVariant;
|
|
2273
|
+
_fontStyle;
|
|
2274
|
+
_textOverflow;
|
|
2275
|
+
_padding;
|
|
2276
|
+
_defaultPadding = [10, 16, 10, 16];
|
|
2277
|
+
_textStick;
|
|
2278
|
+
_marked;
|
|
2279
|
+
_textAlign;
|
|
2280
|
+
_textBaseline;
|
|
2281
|
+
_bgColor;
|
|
2282
|
+
_borderColor;
|
|
2283
|
+
_lineHeight;
|
|
2284
|
+
_underline;
|
|
2285
|
+
_underlineColor;
|
|
2286
|
+
_underlineDash;
|
|
2287
|
+
_lineThrough;
|
|
2288
|
+
_lineThroughColor;
|
|
2289
|
+
_lineThroughDash;
|
|
2290
|
+
_linkColor;
|
|
2291
|
+
_cursor;
|
|
2292
|
+
_borderLineWidth;
|
|
2293
|
+
_borderLineDash;
|
|
2294
|
+
static get EVENT_TYPE() {
|
|
2295
|
+
return EVENT_TYPE$1;
|
|
2296
|
+
}
|
|
2297
|
+
static get DEFAULT() {
|
|
2298
|
+
return defaultStyle$3 ? defaultStyle$3 : (defaultStyle$3 = new Style());
|
|
2299
|
+
}
|
|
2300
|
+
constructor(style = {}, headerStyle = {}) {
|
|
2301
|
+
super();
|
|
2302
|
+
this._color = style.color ?? headerStyle?.color;
|
|
2303
|
+
this._fontSize = style.fontSize ?? headerStyle?.fontSize;
|
|
2304
|
+
this._fontFamily = style.fontFamily ?? headerStyle?.fontFamily;
|
|
2305
|
+
this._fontWeight = style.fontWeight ?? headerStyle?.fontWeight;
|
|
2306
|
+
this._fontVariant = style.fontVariant ?? headerStyle?.fontVariant;
|
|
2307
|
+
this._fontStyle = style.fontStyle ?? headerStyle?.fontStyle;
|
|
2308
|
+
this._textOverflow = (style.textOverflow ?? headerStyle?.textOverflow) || 'ellipsis';
|
|
2309
|
+
this._textStick = style.textStick ?? headerStyle?.textStick ?? false;
|
|
2310
|
+
this._marked = style.marked ?? headerStyle?.marked ?? false;
|
|
2311
|
+
this._textAlign = (style.textAlign ?? headerStyle?.textAlign) || 'left';
|
|
2312
|
+
this._textBaseline = (style.textBaseline ?? headerStyle?.textBaseline) || 'middle';
|
|
2313
|
+
this._bgColor = style.bgColor ?? headerStyle?.bgColor;
|
|
2314
|
+
this._padding = style.padding ?? headerStyle?.padding ?? this._defaultPadding;
|
|
2315
|
+
this._borderColor = style.borderColor ?? headerStyle?.borderColor;
|
|
2316
|
+
this._lineHeight = style.lineHeight ?? headerStyle?.lineHeight;
|
|
2317
|
+
this._underline = style.underline ?? headerStyle?.underline;
|
|
2318
|
+
this._underlineColor = style.underlineColor ?? headerStyle?.underlineColor;
|
|
2319
|
+
this._underlineDash = style.underlineDash ?? headerStyle?.underlineDash;
|
|
2320
|
+
this._lineThrough = style.lineThrough ?? headerStyle?.lineThrough;
|
|
2321
|
+
this._lineThroughColor = style.lineThroughColor ?? headerStyle?.lineThroughColor;
|
|
2322
|
+
this._lineThroughDash = style.lineThroughDash ?? headerStyle?.lineThroughDash;
|
|
2323
|
+
this._linkColor = style.linkColor ?? headerStyle?.linkColor;
|
|
2324
|
+
this._cursor = style.cursor ?? headerStyle?.cursor;
|
|
2325
|
+
this._borderLineWidth = style.borderLineWidth ?? headerStyle?.borderLineWidth;
|
|
2326
|
+
this._borderLineDash = style.borderLineDash ?? headerStyle?.borderLineDash;
|
|
2327
|
+
}
|
|
2328
|
+
get bgColor() {
|
|
2329
|
+
return this._bgColor;
|
|
2330
|
+
}
|
|
2331
|
+
set bgColor(bgColor) {
|
|
2332
|
+
this._bgColor = bgColor;
|
|
2333
|
+
}
|
|
2334
|
+
get color() {
|
|
2335
|
+
return this._color;
|
|
2336
|
+
}
|
|
2337
|
+
set color(color) {
|
|
2338
|
+
this._color = color;
|
|
2339
|
+
}
|
|
2340
|
+
get fontSize() {
|
|
2341
|
+
return this._fontSize;
|
|
2342
|
+
}
|
|
2343
|
+
set fontSize(fontSize) {
|
|
2344
|
+
this._fontSize = fontSize;
|
|
2345
|
+
}
|
|
2346
|
+
get fontFamily() {
|
|
2347
|
+
return this._fontFamily;
|
|
2348
|
+
}
|
|
2349
|
+
set fontFamily(fontFamily) {
|
|
2350
|
+
this._fontFamily = fontFamily;
|
|
2351
|
+
}
|
|
2352
|
+
get fontWeight() {
|
|
2353
|
+
return this._fontWeight;
|
|
2354
|
+
}
|
|
2355
|
+
set fontWeight(fontWeight) {
|
|
2356
|
+
this._fontWeight = fontWeight;
|
|
2357
|
+
}
|
|
2358
|
+
get fontVariant() {
|
|
2359
|
+
return this._fontVariant;
|
|
2360
|
+
}
|
|
2361
|
+
set fontVariant(fontVariant) {
|
|
2362
|
+
this._fontVariant = fontVariant;
|
|
2363
|
+
}
|
|
2364
|
+
get fontStyle() {
|
|
2365
|
+
return this._fontStyle;
|
|
2366
|
+
}
|
|
2367
|
+
set fontStyle(fontStyle) {
|
|
2368
|
+
this._fontStyle = fontStyle;
|
|
2369
|
+
}
|
|
2370
|
+
get textOverflow() {
|
|
2371
|
+
return this._textOverflow;
|
|
2372
|
+
}
|
|
2373
|
+
set textOverflow(textOverflow) {
|
|
2374
|
+
this._textOverflow = textOverflow;
|
|
2375
|
+
}
|
|
2376
|
+
get padding() {
|
|
2377
|
+
return this._padding ?? this._defaultPadding;
|
|
2378
|
+
}
|
|
2379
|
+
set padding(padding) {
|
|
2380
|
+
this._padding = padding;
|
|
2381
|
+
}
|
|
2382
|
+
get borderColor() {
|
|
2383
|
+
return this._borderColor;
|
|
2384
|
+
}
|
|
2385
|
+
set borderColor(borderColor) {
|
|
2386
|
+
this._borderColor = borderColor;
|
|
2387
|
+
}
|
|
2388
|
+
get textStick() {
|
|
2389
|
+
return this._textStick;
|
|
2390
|
+
}
|
|
2391
|
+
set textStick(textStick) {
|
|
2392
|
+
this._textStick = textStick;
|
|
2393
|
+
}
|
|
2394
|
+
get marked() {
|
|
2395
|
+
return this._marked;
|
|
2396
|
+
}
|
|
2397
|
+
set marked(marked) {
|
|
2398
|
+
this._marked = marked;
|
|
2399
|
+
}
|
|
2400
|
+
get textAlign() {
|
|
2401
|
+
return this._textAlign;
|
|
2402
|
+
}
|
|
2403
|
+
set textAlign(textAlign) {
|
|
2404
|
+
this._textAlign = textAlign;
|
|
2405
|
+
}
|
|
2406
|
+
get textBaseline() {
|
|
2407
|
+
return this._textBaseline;
|
|
2408
|
+
}
|
|
2409
|
+
set textBaseline(textBaseline) {
|
|
2410
|
+
this._textBaseline = textBaseline;
|
|
2411
|
+
}
|
|
2412
|
+
get lineHeight() {
|
|
2413
|
+
return this._lineHeight;
|
|
2414
|
+
}
|
|
2415
|
+
set lineHeight(lineHeight) {
|
|
2416
|
+
this._lineHeight = lineHeight;
|
|
2417
|
+
}
|
|
2418
|
+
get underline() {
|
|
2419
|
+
return this._underline;
|
|
2420
|
+
}
|
|
2421
|
+
set underline(underline) {
|
|
2422
|
+
this._underline = underline;
|
|
2423
|
+
}
|
|
2424
|
+
get underlineColor() {
|
|
2425
|
+
return this._underlineColor;
|
|
2426
|
+
}
|
|
2427
|
+
set underlineColor(underlineColor) {
|
|
2428
|
+
this._underlineColor = underlineColor;
|
|
2429
|
+
}
|
|
2430
|
+
get underlineDash() {
|
|
2431
|
+
return this._underlineDash;
|
|
2432
|
+
}
|
|
2433
|
+
set underlineDash(underlineDash) {
|
|
2434
|
+
this._underlineDash = underlineDash;
|
|
2435
|
+
}
|
|
2436
|
+
get lineThrough() {
|
|
2437
|
+
return this._lineThrough;
|
|
2438
|
+
}
|
|
2439
|
+
set lineThrough(lineThrough) {
|
|
2440
|
+
this._lineThrough = lineThrough;
|
|
2441
|
+
}
|
|
2442
|
+
get lineThroughColor() {
|
|
2443
|
+
return this._lineThroughColor;
|
|
2444
|
+
}
|
|
2445
|
+
set lineThroughColor(lineThroughColor) {
|
|
2446
|
+
this._lineThroughColor = lineThroughColor;
|
|
2447
|
+
}
|
|
2448
|
+
get lineThroughDash() {
|
|
2449
|
+
return this._lineThroughDash;
|
|
2450
|
+
}
|
|
2451
|
+
set lineThroughDash(lineThroughDash) {
|
|
2452
|
+
this._lineThroughDash = lineThroughDash;
|
|
2453
|
+
}
|
|
2454
|
+
get linkColor() {
|
|
2455
|
+
return this._linkColor;
|
|
2456
|
+
}
|
|
2457
|
+
set linkColor(linkColor) {
|
|
2458
|
+
this._linkColor = linkColor;
|
|
2459
|
+
}
|
|
2460
|
+
get cursor() {
|
|
2461
|
+
return this._cursor;
|
|
2462
|
+
}
|
|
2463
|
+
set cursor(cursor) {
|
|
2464
|
+
this._cursor = cursor;
|
|
2465
|
+
}
|
|
2466
|
+
get borderLineWidth() {
|
|
2467
|
+
return this._borderLineWidth;
|
|
2468
|
+
}
|
|
2469
|
+
set borderLineWidth(borderLineWidth) {
|
|
2470
|
+
this._borderLineWidth = borderLineWidth;
|
|
2471
|
+
}
|
|
2472
|
+
get borderLineDash() {
|
|
2473
|
+
return this._borderLineDash;
|
|
2474
|
+
}
|
|
2475
|
+
set borderLineDash(borderLineDash) {
|
|
2476
|
+
this._borderLineDash = borderLineDash;
|
|
2477
|
+
}
|
|
2478
|
+
clone() {
|
|
2479
|
+
return new Style(this);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
let defaultStyle$2;
|
|
2484
|
+
class TextHeaderStyle extends Style {
|
|
2485
|
+
_autoWrapText;
|
|
2486
|
+
_lineClamp;
|
|
2487
|
+
static get DEFAULT() {
|
|
2488
|
+
return defaultStyle$2 ? defaultStyle$2 : (defaultStyle$2 = new TextHeaderStyle());
|
|
2489
|
+
}
|
|
2490
|
+
constructor(style = {}, headerStyle = null) {
|
|
2491
|
+
super(style, headerStyle);
|
|
2492
|
+
this._autoWrapText = style?.autoWrapText ?? headerStyle?.autoWrapText;
|
|
2493
|
+
this._lineClamp = style?.lineClamp ?? headerStyle?.lineClamp;
|
|
2494
|
+
}
|
|
2495
|
+
clone() {
|
|
2496
|
+
return new TextHeaderStyle(this, null);
|
|
2497
|
+
}
|
|
2498
|
+
get lineClamp() {
|
|
2499
|
+
return this._lineClamp;
|
|
2500
|
+
}
|
|
2501
|
+
set lineClamp(lineClamp) {
|
|
2502
|
+
this._lineClamp = lineClamp;
|
|
2503
|
+
}
|
|
2504
|
+
get autoWrapText() {
|
|
2505
|
+
return this._autoWrapText;
|
|
2506
|
+
}
|
|
2507
|
+
set autoWrapText(autoWrapText) {
|
|
2508
|
+
this._autoWrapText = autoWrapText;
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
function of$1(headerStyle, defaultHeaderStyle, styleArg, StyleClass, globalAutoWrapText) {
|
|
2513
|
+
if (headerStyle || defaultHeaderStyle) {
|
|
2514
|
+
if (headerStyle instanceof Style) {
|
|
2515
|
+
return headerStyle;
|
|
2516
|
+
}
|
|
2517
|
+
else if (typeof headerStyle === 'function') {
|
|
2518
|
+
return of$1(headerStyle(styleArg), defaultHeaderStyle, styleArg, StyleClass, globalAutoWrapText);
|
|
2519
|
+
}
|
|
2520
|
+
if (!headerStyle) {
|
|
2521
|
+
headerStyle = {};
|
|
2522
|
+
}
|
|
2523
|
+
if (globalAutoWrapText && !isValid$6(headerStyle.autoWrapText)) {
|
|
2524
|
+
headerStyle.autoWrapText = true;
|
|
2525
|
+
}
|
|
2526
|
+
return new StyleClass(headerStyle ?? {}, (defaultHeaderStyle ?? {}));
|
|
2527
|
+
}
|
|
2528
|
+
return StyleClass.DEFAULT;
|
|
2529
|
+
}
|
|
2563
2530
|
|
|
2564
|
-
function
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2531
|
+
function importStyle$2() {
|
|
2532
|
+
const styleElement = document.createElement('style');
|
|
2533
|
+
styleElement.id = 'vtable-style-styleSheet';
|
|
2534
|
+
styleElement.textContent = `
|
|
2535
|
+
.vtable .input-container {
|
|
2536
|
+
position: absolute;
|
|
2537
|
+
top:0px;
|
|
2538
|
+
}
|
|
2539
|
+
.vtable .table-scrollable {
|
|
2540
|
+
position: absolute;
|
|
2541
|
+
overflow: scroll;
|
|
2542
|
+
}
|
|
2543
|
+
.vtable .table-scrollable::-webkit-scrollbar-button{
|
|
2544
|
+
background-color: transparent;
|
|
2545
|
+
}
|
|
2546
|
+
.vtable .table-scrollable::-webkit-scrollbar-track-piece{
|
|
2547
|
+
background-color: transparent;
|
|
2548
|
+
}
|
|
2549
|
+
.vtable .table-scrollable::-webkit-scrollbar-corner {
|
|
2550
|
+
background-color: transparent;
|
|
2551
|
+
}
|
|
2552
|
+
.vtable .table-scrollable::-webkit-scrollbar-thumb {
|
|
2553
|
+
border-radius : 4px;
|
|
2554
|
+
background-color : rgba(100, 100, 100, .5);
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
.vtable .table-scroll-end-point {
|
|
2558
|
+
opacity: 0;
|
|
2559
|
+
position: relative;
|
|
2560
|
+
}
|
|
2561
|
+
.vtable {
|
|
2562
|
+
/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */
|
|
2563
|
+
/* overflow: auto; */
|
|
2564
|
+
position: relative;
|
|
2565
|
+
width: 100%;
|
|
2566
|
+
height: 100%;
|
|
2567
|
+
text-align: left;
|
|
2568
|
+
-webkit-font-smoothing:auto;
|
|
2569
|
+
}
|
|
2570
|
+
.vtable > canvas {
|
|
2571
|
+
position: absolute;
|
|
2572
|
+
width: 0;
|
|
2573
|
+
height: 0;
|
|
2574
|
+
}
|
|
2575
|
+
.vtable .table-focus-control {
|
|
2576
|
+
position: relative !important;
|
|
2577
|
+
width: 1px;
|
|
2578
|
+
height: 1px;
|
|
2579
|
+
opacity: 0;
|
|
2580
|
+
padding: 0;
|
|
2581
|
+
margin: 0;
|
|
2582
|
+
box-sizing: border-box;
|
|
2583
|
+
pointer-events: none;
|
|
2584
|
+
max-width: 500px;
|
|
2585
|
+
max-height: 500px;
|
|
2586
|
+
float: none !important;
|
|
2587
|
+
}
|
|
2588
|
+
.vtable input.table-focus-control::-ms-clear {
|
|
2589
|
+
visibility: hidden;
|
|
2590
|
+
}
|
|
2591
|
+
.vtable input.table-focus-control.composition {
|
|
2592
|
+
opacity: 1;
|
|
2593
|
+
max-width: none;
|
|
2594
|
+
max-height: none;
|
|
2595
|
+
}
|
|
2596
|
+
`;
|
|
2597
|
+
document.body.appendChild(styleElement);
|
|
2574
2598
|
}
|
|
2575
2599
|
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
}
|
|
2580
|
-
initContext() {
|
|
2581
|
-
if (this._notSupportCanvas) return !1;
|
|
2582
|
-
if (isNil$5(this._canvas) && (isValid$5(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$5(this._canvas) && "undefined" != typeof window && void 0 !== window.document && isValid$5(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$5(this._context) && isValid$5(this._canvas)) {
|
|
2583
|
-
const context = this._canvas.getContext("2d");
|
|
2584
|
-
isValid$5(context) && (context.save(), context.font = getContextFont$2(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
2600
|
+
function getScrollBarSize(scrollStyle) {
|
|
2601
|
+
if (scrollStyle?.hoverOn || scrollStyle?.visible === 'none') {
|
|
2602
|
+
return 0;
|
|
2585
2603
|
}
|
|
2586
|
-
return
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
switch (method) {
|
|
2622
|
-
case "vrender":
|
|
2623
|
-
case "canopus":
|
|
2624
|
-
return this.fullMeasure(text);
|
|
2625
|
-
case "canvas":
|
|
2626
|
-
return this.measureWithNaiveCanvas(text);
|
|
2627
|
-
case "simple":
|
|
2628
|
-
return this.quickMeasureWithoutCanvas(text);
|
|
2629
|
-
default:
|
|
2630
|
-
return this.quickMeasure(text);
|
|
2604
|
+
return scrollStyle?.width ?? 7;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
const judgeType$1 = (value) => {
|
|
2608
|
+
switch (Object.prototype.toString.call(value)) {
|
|
2609
|
+
case '[object Object]':
|
|
2610
|
+
return 'object';
|
|
2611
|
+
case '[object Function]':
|
|
2612
|
+
return 'function';
|
|
2613
|
+
case '[object Array]':
|
|
2614
|
+
return 'array';
|
|
2615
|
+
case '[object String]':
|
|
2616
|
+
return 'string';
|
|
2617
|
+
case '[object Number]':
|
|
2618
|
+
return 'number';
|
|
2619
|
+
case '[object RegExp]':
|
|
2620
|
+
return 'regExp';
|
|
2621
|
+
case '[object Boolean]':
|
|
2622
|
+
return 'boolean';
|
|
2623
|
+
case '[object Symbol]':
|
|
2624
|
+
return 'symbol';
|
|
2625
|
+
case '[object Date]':
|
|
2626
|
+
return 'date';
|
|
2627
|
+
case '[object Undefined]':
|
|
2628
|
+
return 'undefined';
|
|
2629
|
+
case '[object Null]':
|
|
2630
|
+
return 'null';
|
|
2631
|
+
case '[object Error]':
|
|
2632
|
+
return 'error';
|
|
2633
|
+
case '[object HTMLDocument]':
|
|
2634
|
+
return 'document';
|
|
2635
|
+
case '[object global]':
|
|
2636
|
+
return 'global';
|
|
2637
|
+
default:
|
|
2638
|
+
return null;
|
|
2631
2639
|
}
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
if (
|
|
2639
|
-
|
|
2640
|
-
fontFamily: fontFamily,
|
|
2641
|
-
fontSize: fontSize,
|
|
2642
|
-
fontWeight: fontWeight,
|
|
2643
|
-
textAlign: textAlign,
|
|
2644
|
-
textBaseline: textBaseline,
|
|
2645
|
-
ellipsis: ellipsis,
|
|
2646
|
-
limit: limit,
|
|
2647
|
-
lineHeight: lineHeight
|
|
2648
|
-
} = this.textSpec;
|
|
2649
|
-
let size;
|
|
2650
|
-
try {
|
|
2651
|
-
const bounds = this._option.getTextBounds({
|
|
2652
|
-
text: text,
|
|
2653
|
-
fontFamily: fontFamily,
|
|
2654
|
-
fontSize: fontSize,
|
|
2655
|
-
fontWeight: fontWeight,
|
|
2656
|
-
textAlign: textAlign,
|
|
2657
|
-
textBaseline: textBaseline,
|
|
2658
|
-
ellipsis: !!ellipsis,
|
|
2659
|
-
maxLineWidth: limit || 1 / 0,
|
|
2660
|
-
lineHeight: lineHeight
|
|
2661
|
-
});
|
|
2662
|
-
size = {
|
|
2663
|
-
width: bounds.width(),
|
|
2664
|
-
height: bounds.height()
|
|
2665
|
-
};
|
|
2666
|
-
} catch (e) {
|
|
2667
|
-
this._notSupportVRender = !0, size = this.measureWithNaiveCanvas(text);
|
|
2640
|
+
};
|
|
2641
|
+
const isIt$1 = (v, type) => judgeType$1(v) === type;
|
|
2642
|
+
const isObject$2 = (v) => isIt$1(v, 'object');
|
|
2643
|
+
const isUndefined = (v) => isIt$1(v, 'undefined');
|
|
2644
|
+
const isNull = (v) => isIt$1(v, 'null');
|
|
2645
|
+
function ingoreNoneValueMerge(target, ...sources) {
|
|
2646
|
+
if (!sources.length) {
|
|
2647
|
+
return target || {};
|
|
2668
2648
|
}
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
}
|
|
2686
|
-
quickMeasure(text) {
|
|
2687
|
-
return this._measureReduce(text, this._quickMeasure.bind(this));
|
|
2688
|
-
}
|
|
2689
|
-
_quickMeasure(text) {
|
|
2690
|
-
const totalSize = {
|
|
2691
|
-
width: 0,
|
|
2692
|
-
height: 0
|
|
2693
|
-
};
|
|
2694
|
-
for (let i = 0; i < text.length; i++) {
|
|
2695
|
-
const char = text[i];
|
|
2696
|
-
let size = this._measureSpecialChar(char);
|
|
2697
|
-
isNil$5(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$5(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$5(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
2649
|
+
const source = sources.shift();
|
|
2650
|
+
if (isObject$2(target) && isObject$2(source)) {
|
|
2651
|
+
for (const key in source) {
|
|
2652
|
+
if (isObject$2(source[key])) {
|
|
2653
|
+
if (!target[key]) {
|
|
2654
|
+
Object.assign(target, { [key]: {} });
|
|
2655
|
+
}
|
|
2656
|
+
if (!isObject$2(target[key])) {
|
|
2657
|
+
Object.assign(target, { [key]: source[key] });
|
|
2658
|
+
}
|
|
2659
|
+
ingoreNoneValueMerge(target[key], source[key]);
|
|
2660
|
+
}
|
|
2661
|
+
else if (source[key] !== null && source[key] !== undefined) {
|
|
2662
|
+
Object.assign(target, { [key]: source[key] });
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2698
2665
|
}
|
|
2699
|
-
return
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
_quickMeasureWithoutCanvas(text) {
|
|
2705
|
-
const totalSize = {
|
|
2706
|
-
width: 0,
|
|
2707
|
-
height: 0
|
|
2708
|
-
},
|
|
2709
|
-
{
|
|
2710
|
-
fontSize: fontSize,
|
|
2711
|
-
lineHeight: lineHeight
|
|
2712
|
-
} = this.textSpec;
|
|
2713
|
-
for (let i = 0; i < text.length; i++) {
|
|
2714
|
-
const char = text[i],
|
|
2715
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
2716
|
-
totalSize.width += size * fontSize;
|
|
2666
|
+
return ingoreNoneValueMerge(target, ...sources);
|
|
2667
|
+
}
|
|
2668
|
+
function convertInternal(value) {
|
|
2669
|
+
if (typeof value === 'function') {
|
|
2670
|
+
value = value();
|
|
2717
2671
|
}
|
|
2718
|
-
return
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
lineHeight: lineHeight
|
|
2724
|
-
} = this.textSpec,
|
|
2725
|
-
defaultResult = {
|
|
2726
|
-
width: 0,
|
|
2727
|
-
height: 0
|
|
2728
|
-
};
|
|
2729
|
-
if (isNil$5(text)) return defaultResult;
|
|
2730
|
-
if (isArray$5(text)) {
|
|
2731
|
-
const textArr = text.filter(isValid$5).map(s => s.toString());
|
|
2732
|
-
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
2733
|
-
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
2734
|
-
height: textArr.length * ((null != lineHeight ? lineHeight : fontSize) + 1) + 1
|
|
2735
|
-
};
|
|
2672
|
+
return isValid$4(value) ? `${value}` : '';
|
|
2673
|
+
}
|
|
2674
|
+
function transpose(matrix) {
|
|
2675
|
+
if (matrix?.length <= 0) {
|
|
2676
|
+
return matrix;
|
|
2736
2677
|
}
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2678
|
+
const m = matrix.length;
|
|
2679
|
+
const n = matrix[0].length;
|
|
2680
|
+
const transposed = new Array(n);
|
|
2681
|
+
for (let i = 0; i < m; i++) {
|
|
2682
|
+
for (let j = 0; j < n; j++) {
|
|
2683
|
+
if (!transposed[j]) {
|
|
2684
|
+
transposed[j] = new Array(m);
|
|
2685
|
+
}
|
|
2686
|
+
transposed[j][i] = matrix[i][j];
|
|
2687
|
+
}
|
|
2746
2688
|
}
|
|
2747
|
-
return
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2689
|
+
return transposed;
|
|
2690
|
+
}
|
|
2691
|
+
function throttle(func, delay) {
|
|
2692
|
+
let timer = null;
|
|
2693
|
+
return function (...args) {
|
|
2694
|
+
if (!timer) {
|
|
2695
|
+
func.apply(this, args);
|
|
2696
|
+
timer = setTimeout(() => {
|
|
2697
|
+
timer = null;
|
|
2698
|
+
}, delay);
|
|
2699
|
+
}
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
function throttle2(func, delay) {
|
|
2703
|
+
let timer = null;
|
|
2704
|
+
return function (...args) {
|
|
2705
|
+
if (!timer) {
|
|
2706
|
+
timer = setTimeout(() => {
|
|
2707
|
+
func.apply(this, args);
|
|
2708
|
+
timer = null;
|
|
2709
|
+
}, delay);
|
|
2710
|
+
}
|
|
2711
|
+
};
|
|
2712
|
+
}
|
|
2713
|
+
function pad(num, totalChars) {
|
|
2714
|
+
const pad = '0';
|
|
2715
|
+
num = `${num}`;
|
|
2716
|
+
while (num.length < totalChars) {
|
|
2717
|
+
num = pad + num;
|
|
2759
2718
|
}
|
|
2760
|
-
return
|
|
2761
|
-
}
|
|
2762
|
-
_measureSpecialChar(char) {
|
|
2763
|
-
return isValid$5(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
2764
|
-
}
|
|
2765
|
-
release() {
|
|
2766
|
-
isValid$5(this._canvas) && (this._canvas = null), isValid$5(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
2767
|
-
}
|
|
2719
|
+
return num;
|
|
2768
2720
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2721
|
+
function changeColor(color, ratio, isDarker) {
|
|
2722
|
+
color = color.replace(/^\s*|\s*$/, '');
|
|
2723
|
+
color = color.replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i, '#$1$1$2$2$3$3');
|
|
2724
|
+
const difference = Math.round(ratio * 256) * (isDarker ? -1 : 1);
|
|
2725
|
+
const rgb = color.match(new RegExp('^rgba?\\(\\s*' +
|
|
2726
|
+
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
|
2727
|
+
'\\s*,\\s*' +
|
|
2728
|
+
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
|
2729
|
+
'\\s*,\\s*' +
|
|
2730
|
+
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
|
2731
|
+
'(?:\\s*,\\s*' +
|
|
2732
|
+
'(0|1|0?\\.\\d+))?' +
|
|
2733
|
+
'\\s*\\)$', 'i'));
|
|
2734
|
+
const alpha = !!rgb && isValid$4(rgb[4]) ? rgb[4] : null;
|
|
2735
|
+
const decimal = rgb
|
|
2736
|
+
? [rgb[1], rgb[2], rgb[3]]
|
|
2737
|
+
: color
|
|
2738
|
+
.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i, function () {
|
|
2739
|
+
return `${parseInt(arguments[1], 16)},${parseInt(arguments[2], 16)},${parseInt(arguments[3], 16)}`;
|
|
2740
|
+
})
|
|
2741
|
+
.split(/,/);
|
|
2742
|
+
return rgb
|
|
2743
|
+
? `rgb${alpha !== null ? 'a' : ''}(${Math[isDarker ? 'max' : 'min'](parseInt(decimal[0], 10) + difference, isDarker ? 0 : 255)}, ${Math[isDarker ? 'max' : 'min'](parseInt(decimal[1], 10) + difference, isDarker ? 0 : 255)}, ${Math[isDarker ? 'max' : 'min'](parseInt(decimal[2], 10) + difference, isDarker ? 0 : 255)}${alpha !== null ? `, ${alpha}` : ''})`
|
|
2744
|
+
:
|
|
2745
|
+
[
|
|
2746
|
+
'#',
|
|
2747
|
+
pad(Math[isDarker ? 'max' : 'min'](parseInt(decimal[0], 10) + difference, isDarker ? 0 : 255).toString(16), 2),
|
|
2748
|
+
pad(Math[isDarker ? 'max' : 'min'](parseInt(decimal[1], 10) + difference, isDarker ? 0 : 255).toString(16), 2),
|
|
2749
|
+
pad(Math[isDarker ? 'max' : 'min'](parseInt(decimal[2], 10) + difference, isDarker ? 0 : 255).toString(16), 2)
|
|
2750
|
+
].join('');
|
|
2751
|
+
}
|
|
2752
|
+
function isValid$4(v) {
|
|
2753
|
+
if (isUndefined(v) || isNull(v)) {
|
|
2754
|
+
return false;
|
|
2778
2755
|
}
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2756
|
+
return true;
|
|
2757
|
+
}
|
|
2758
|
+
function validToString(v) {
|
|
2759
|
+
if (isUndefined(v) || isNull(v)) {
|
|
2760
|
+
return '';
|
|
2782
2761
|
}
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2762
|
+
return v.toString();
|
|
2763
|
+
}
|
|
2764
|
+
function isMobile() {
|
|
2765
|
+
return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
|
|
2766
|
+
}
|
|
2767
|
+
function defaultOrderFn(v1, v2, order) {
|
|
2768
|
+
if (order !== 'desc') {
|
|
2769
|
+
return v1 === v2 ? 0 : v1 > v2 ? 1 : -1;
|
|
2786
2770
|
}
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2771
|
+
return v1 === v2 ? 0 : v1 < v2 ? 1 : -1;
|
|
2772
|
+
}
|
|
2773
|
+
function getValueByPath(obj, paths) {
|
|
2774
|
+
let res = obj;
|
|
2775
|
+
let prop;
|
|
2776
|
+
while ((prop = paths.shift())) {
|
|
2777
|
+
res = res[prop];
|
|
2778
|
+
}
|
|
2779
|
+
return res;
|
|
2780
|
+
}
|
|
2781
|
+
function getValueFromDeepArray(array, index) {
|
|
2782
|
+
let result = array;
|
|
2783
|
+
for (let i = 0; i < index.length; i++) {
|
|
2784
|
+
const currentIdx = index[i];
|
|
2785
|
+
if (result[currentIdx]) {
|
|
2786
|
+
result = result[currentIdx];
|
|
2787
|
+
}
|
|
2788
|
+
else {
|
|
2789
|
+
return undefined;
|
|
2790
|
+
}
|
|
2791
|
+
if (result && result.children && i + 1 < index.length) {
|
|
2792
|
+
result = result.children;
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
return result;
|
|
2799
2796
|
}
|
|
2800
2797
|
|
|
2801
2798
|
const isNode = typeof window === 'undefined' || typeof window.window === 'undefined';
|
|
@@ -9016,8 +9013,8 @@
|
|
|
9016
9013
|
return this.removeChild(child);
|
|
9017
9014
|
}
|
|
9018
9015
|
addEventListener(type, listener, options) {
|
|
9019
|
-
const capture = isBoolean$3(options, !0) && options || isObject$
|
|
9020
|
-
once = isObject$
|
|
9016
|
+
const capture = isBoolean$3(options, !0) && options || isObject$4(options) && options.capture,
|
|
9017
|
+
once = isObject$4(options) && options.once,
|
|
9021
9018
|
context = isFunction$1(listener) ? void 0 : listener;
|
|
9022
9019
|
return type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent, once ? super.once(type, listener, context) : super.on(type, listener, context), this;
|
|
9023
9020
|
}
|
|
@@ -9025,17 +9022,17 @@
|
|
|
9025
9022
|
return this.addEventListener(type, listener, options);
|
|
9026
9023
|
}
|
|
9027
9024
|
removeEventListener(type, listener, options) {
|
|
9028
|
-
const capture = isBoolean$3(options, !0) && options || isObject$
|
|
9025
|
+
const capture = isBoolean$3(options, !0) && options || isObject$4(options) && options.capture,
|
|
9029
9026
|
context = isFunction$1(listener) ? void 0 : listener;
|
|
9030
9027
|
type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent;
|
|
9031
|
-
const once = isObject$
|
|
9028
|
+
const once = isObject$4(options) && options.once;
|
|
9032
9029
|
return super.off(type, listener, context, once), this;
|
|
9033
9030
|
}
|
|
9034
9031
|
off(type, listener, options) {
|
|
9035
9032
|
return this.removeEventListener(type, listener, options);
|
|
9036
9033
|
}
|
|
9037
9034
|
once(type, listener, options) {
|
|
9038
|
-
return isObject$
|
|
9035
|
+
return isObject$4(options) ? (options.once = !0, this.addEventListener(type, listener, options)) : this.addEventListener(type, listener, {
|
|
9039
9036
|
once: !0
|
|
9040
9037
|
});
|
|
9041
9038
|
}
|
|
@@ -9565,10 +9562,10 @@
|
|
|
9565
9562
|
const normalizedEvents = [];
|
|
9566
9563
|
if (this.supportsTouchEvents && event.changedTouches && event.changedTouches.length) for (let i = 0, li = event.changedTouches.length; i < li; i++) {
|
|
9567
9564
|
const touch = event.changedTouches[i];
|
|
9568
|
-
isUndefined$
|
|
9565
|
+
isUndefined$2(touch.button) && (touch.button = 0), isUndefined$2(touch.buttons) && (touch.buttons = 1), isUndefined$2(touch.isPrimary) && (touch.isPrimary = 1 === event.touches.length && "touchstart" === event.type), isUndefined$2(touch.width) && (touch.width = touch.radiusX || 1), isUndefined$2(touch.height) && (touch.height = touch.radiusY || 1), isUndefined$2(touch.tiltX) && (touch.tiltX = 0), isUndefined$2(touch.tiltY) && (touch.tiltY = 0), isUndefined$2(touch.pointerType) && (touch.pointerType = "touch"), isUndefined$2(touch.pointerId) && (touch.pointerId = touch.identifier || 0), isUndefined$2(touch.pressure) && (touch.pressure = touch.force || .5), isUndefined$2(touch.twist) && (touch.twist = 0), isUndefined$2(touch.tangentialPressure) && (touch.tangentialPressure = 0), isUndefined$2(touch.layerX) && (touch.layerX = touch.offsetX = touch.clientX), isUndefined$2(touch.layerY) && (touch.layerY = touch.offsetY = touch.clientY), touch.isNormalized = !0, touch.type = event.type, normalizedEvents.push(touch);
|
|
9569
9566
|
} else if (this.globalObj.supportsMouseEvents && (!(event instanceof MouseEvent) || this.supportsPointerEvents && event instanceof PointerEvent)) normalizedEvents.push(event);else {
|
|
9570
9567
|
const tempEvent = event;
|
|
9571
|
-
isUndefined$
|
|
9568
|
+
isUndefined$2(tempEvent.isPrimary) && (tempEvent.isPrimary = !0), isUndefined$2(tempEvent.width) && (tempEvent.width = 1), isUndefined$2(tempEvent.height) && (tempEvent.height = 1), isUndefined$2(tempEvent.tiltX) && (tempEvent.tiltX = 0), isUndefined$2(tempEvent.tiltY) && (tempEvent.tiltY = 0), isUndefined$2(tempEvent.pointerType) && (tempEvent.pointerType = "mouse"), isUndefined$2(tempEvent.pointerId) && (tempEvent.pointerId = 1), isUndefined$2(tempEvent.pressure) && (tempEvent.pressure = .5), isUndefined$2(tempEvent.twist) && (tempEvent.twist = 0), isUndefined$2(tempEvent.tangentialPressure) && (tempEvent.tangentialPressure = 0), tempEvent.isNormalized = !0, normalizedEvents.push(tempEvent);
|
|
9572
9569
|
}
|
|
9573
9570
|
return normalizedEvents;
|
|
9574
9571
|
}
|
|
@@ -17725,7 +17722,7 @@
|
|
|
17725
17722
|
}
|
|
17726
17723
|
const b = graphic.AABBBounds;
|
|
17727
17724
|
context.drawImage(res.data, b.x1, b.y1, b.width(), b.height()), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
17728
|
-
} else if (isObject$
|
|
17725
|
+
} else if (isObject$4(background)) {
|
|
17729
17726
|
const {
|
|
17730
17727
|
stroke: stroke,
|
|
17731
17728
|
fill: fill,
|
|
@@ -25845,7 +25842,7 @@
|
|
|
25845
25842
|
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
25846
25843
|
const textAttrs = Object.assign(Object.assign({
|
|
25847
25844
|
text: text,
|
|
25848
|
-
visible: isValid$
|
|
25845
|
+
visible: isValid$6(text) && !1 !== visible,
|
|
25849
25846
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
25850
25847
|
}, textStyle), {
|
|
25851
25848
|
x: textX,
|
|
@@ -25865,7 +25862,7 @@
|
|
|
25865
25862
|
textAlign: textAlign,
|
|
25866
25863
|
textBaseline: textBaseline
|
|
25867
25864
|
} = textStyle;
|
|
25868
|
-
(isValid$
|
|
25865
|
+
(isValid$6(minWidth) || isValid$6(maxWidth)) && (isValid$6(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$6(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
|
|
25869
25866
|
let x = 0,
|
|
25870
25867
|
y = 0;
|
|
25871
25868
|
"center" === textAlign ? (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)) : "right" === textAlign || "end" === textAlign ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : "left" !== textAlign && "start" !== textAlign || group.setAttribute("x", parsedPadding[3]), "middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
|
|
@@ -25943,7 +25940,7 @@
|
|
|
25943
25940
|
zIndex: 1
|
|
25944
25941
|
}, "group"),
|
|
25945
25942
|
maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3],
|
|
25946
|
-
titleVisible = isValid$
|
|
25943
|
+
titleVisible = isValid$6(title) && !1 !== visible,
|
|
25947
25944
|
titleAttrs = Object.assign(Object.assign({
|
|
25948
25945
|
text: isArray$5(title) ? title : [title],
|
|
25949
25946
|
visible: titleVisible
|
|
@@ -25961,7 +25958,7 @@
|
|
|
25961
25958
|
titleWidth = titleBounds.width();
|
|
25962
25959
|
let height = titleHeight + space;
|
|
25963
25960
|
titleVisible || (height = 0);
|
|
25964
|
-
const contentVisible = isValid$
|
|
25961
|
+
const contentVisible = isValid$6(content) && !1 !== visible,
|
|
25965
25962
|
contentAttrs = Object.assign(Object.assign({
|
|
25966
25963
|
text: isArray$5(content) ? content : [content],
|
|
25967
25964
|
visible: contentVisible
|
|
@@ -27394,7 +27391,7 @@
|
|
|
27394
27391
|
});
|
|
27395
27392
|
bgRect.name = AXIS_ELEMENT_NAME.axisLabelBackground, bgRect.id = this._getNodeId("axis-label-background"), labelContainer.insertBefore(bgRect, labelContainer.firstChild);
|
|
27396
27393
|
}
|
|
27397
|
-
if (isValid$
|
|
27394
|
+
if (isValid$6(this.attribute.label.containerAlign)) {
|
|
27398
27395
|
let start;
|
|
27399
27396
|
"left" === orient ? start = axisLabelContainerBounds.x2 : "right" === orient ? start = axisLabelContainerBounds.x1 : "top" === orient ? start = axisLabelContainerBounds.y2 : "bottom" === orient && (start = axisLabelContainerBounds.y1), alignAxisLabels(labelShapes, start, axisLabelContainerSize, orient, this.attribute.label.containerAlign);
|
|
27400
27397
|
}
|
|
@@ -27625,7 +27622,7 @@
|
|
|
27625
27622
|
};
|
|
27626
27623
|
shape && shape.visible && (tagAttrs.shape = Object.assign({
|
|
27627
27624
|
visible: !0
|
|
27628
|
-
}, shape.style), isValid$
|
|
27625
|
+
}, shape.style), isValid$6(shape.space) && (tagAttrs.space = shape.space)), background && background.visible && (tagAttrs.panel = Object.assign({
|
|
27629
27626
|
visible: !0
|
|
27630
27627
|
}, background.style));
|
|
27631
27628
|
const titleTag = new Tag(tagAttrs);
|
|
@@ -27752,7 +27749,7 @@
|
|
|
27752
27749
|
width: itemWidth,
|
|
27753
27750
|
height: itemHeight
|
|
27754
27751
|
} = item;
|
|
27755
|
-
isValid$
|
|
27752
|
+
isValid$6(maxItemWidth) ? isValid$6(itemWidth) ? this._itemWidthByUser = Math.min(maxItemWidth, itemWidth) : this._itemWidthByUser = maxItemWidth : isValid$6(itemWidth) && (this._itemWidthByUser = itemWidth), isValid$6(itemHeight) && (this._itemHeightByUser = itemHeight);
|
|
27756
27753
|
let doWrap = !1,
|
|
27757
27754
|
maxWidthInCol = 0,
|
|
27758
27755
|
startX = 0,
|
|
@@ -27764,10 +27761,10 @@
|
|
|
27764
27761
|
const itemGroup = this._renderEachItem(item, !!isEmpty(defaultSelected) || (null == defaultSelected ? void 0 : defaultSelected.includes(item.label)), index, legendItems),
|
|
27765
27762
|
itemWidth = itemGroup.attribute.width,
|
|
27766
27763
|
itemHeight = itemGroup.attribute.height;
|
|
27767
|
-
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (maxPages = maxRow, isValid$
|
|
27764
|
+
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (maxPages = maxRow, isValid$6(maxWidth) && (itemWidth >= maxWidth ? (doWrap = !0, index > 0 && (startX = 0, startY += itemHeight + spaceRow, pages += 1)) : maxWidth < startX + itemWidth && (doWrap = !0, startX = 0, startY += itemHeight + spaceRow, pages += 1)), index > 0 && itemGroup.setAttributes({
|
|
27768
27765
|
x: startX,
|
|
27769
27766
|
y: startY
|
|
27770
|
-
}), startX += spaceCol + itemWidth) : (maxPages = maxCol, isValid$
|
|
27767
|
+
}), startX += spaceCol + itemWidth) : (maxPages = maxCol, isValid$6(maxHeight) && maxHeight < startY + itemHeight && (doWrap = !0, startY = 0, startX += maxWidthInCol + spaceCol, maxWidthInCol = 0, pages += 1), index > 0 && itemGroup.setAttributes({
|
|
27771
27768
|
x: startX,
|
|
27772
27769
|
y: startY
|
|
27773
27770
|
}), startY += spaceRow + itemHeight), itemsContainer.add(itemGroup);
|
|
@@ -27857,7 +27854,7 @@
|
|
|
27857
27854
|
}));
|
|
27858
27855
|
this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, null == labelAttr ? void 0 : labelAttr.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
27859
27856
|
const labelSpace = get$4(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
27860
|
-
if (focusStartX += shapeSize / 2 + shapeSpace + labelShape.AABBBounds.width() + labelSpace, isValid$
|
|
27857
|
+
if (focusStartX += shapeSize / 2 + shapeSpace + labelShape.AABBBounds.width() + labelSpace, isValid$6(value)) {
|
|
27861
27858
|
const valueSpace = get$4(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
27862
27859
|
valueShape = createText$1(Object.assign(Object.assign({
|
|
27863
27860
|
x: focusStartX + labelSpace,
|
|
@@ -27885,7 +27882,7 @@
|
|
|
27885
27882
|
const innerGroupBounds = innerGroup.AABBBounds,
|
|
27886
27883
|
innerGroupWidth = innerGroupBounds.width(),
|
|
27887
27884
|
innerGroupHeight = innerGroupBounds.height(),
|
|
27888
|
-
itemGroupWidth = isValid$
|
|
27885
|
+
itemGroupWidth = isValid$6(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
|
|
27889
27886
|
itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
|
|
27890
27887
|
return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
|
|
27891
27888
|
}
|
|
@@ -29406,7 +29403,7 @@
|
|
|
29406
29403
|
let currentPos, startHandlerPos, endHandlerPos, railLen;
|
|
29407
29404
|
this._isHorizontal ? (currentPos = e.viewX - this._rail.globalAABBBounds.x1, startHandlerPos = null == startHandler ? void 0 : startHandler.attribute.x, endHandlerPos = null == endHandler ? void 0 : endHandler.attribute.x, railLen = railWidth) : (currentPos = e.viewY - this._rail.globalAABBBounds.y1, startHandlerPos = null == startHandler ? void 0 : startHandler.attribute.y, endHandlerPos = null == endHandler ? void 0 : endHandler.attribute.y, railLen = railHeight);
|
|
29408
29405
|
const currentValue = currentPos / railLen * (max - min) + min;
|
|
29409
|
-
if (isValid$
|
|
29406
|
+
if (isValid$6(endHandlerPos)) {
|
|
29410
29407
|
const updateHandler = Math.abs(currentPos - startHandlerPos) > Math.abs(currentPos - endHandlerPos) ? endHandler : startHandler;
|
|
29411
29408
|
this._updateHandler(updateHandler, currentPos, currentValue);
|
|
29412
29409
|
} else this._updateHandler(startHandler, currentPos, currentValue);
|
|
@@ -29473,7 +29470,7 @@
|
|
|
29473
29470
|
text: startText.text,
|
|
29474
29471
|
lineHeight: null === (_a = startText.style) || void 0 === _a ? void 0 : _a.fontSize
|
|
29475
29472
|
}, startText.style)), startTextShape.name = SLIDER_ELEMENT_NAME.startText, innerView.add(startTextShape);
|
|
29476
|
-
const space = isValid$
|
|
29473
|
+
const space = isValid$6(startText.space) ? startText.space : 0;
|
|
29477
29474
|
startLen += (isHorizontal ? startTextShape.AABBBounds.width() : startTextShape.AABBBounds.height()) + space;
|
|
29478
29475
|
}
|
|
29479
29476
|
const mainContainer = createGroup({
|
|
@@ -29487,7 +29484,7 @@
|
|
|
29487
29484
|
});
|
|
29488
29485
|
let endTextShape;
|
|
29489
29486
|
if (railContainer.name = SLIDER_ELEMENT_NAME.railContainer, this._railContainer = railContainer, mainContainer.add(railContainer), this._renderRail(railContainer), startLen += isHorizontal ? railWidth : railHeight, endText && endText.visible) {
|
|
29490
|
-
const space = isValid$
|
|
29487
|
+
const space = isValid$6(endText.space) ? endText.space : 0;
|
|
29491
29488
|
endTextShape = createText$1(Object.assign({
|
|
29492
29489
|
x: isHorizontal ? startLen + space : railWidth / 2,
|
|
29493
29490
|
y: isHorizontal ? railHeight / 2 : startLen + space,
|
|
@@ -29594,7 +29591,7 @@
|
|
|
29594
29591
|
pickable: !1
|
|
29595
29592
|
});
|
|
29596
29593
|
trackContainer.name = SLIDER_ELEMENT_NAME.trackContainer;
|
|
29597
|
-
const draggableTrack = isObject$
|
|
29594
|
+
const draggableTrack = isObject$4(range) && !0 === range.draggableTrack;
|
|
29598
29595
|
let cursor;
|
|
29599
29596
|
cursor = !1 === slidable ? "default" : !1 === range || !1 === draggableTrack ? "pointer" : getDefaultCursor(isHorizontal);
|
|
29600
29597
|
const trackWidth = max === min ? railLen : (endValue - startValue) / (max - min) * railLen,
|
|
@@ -29641,7 +29638,7 @@
|
|
|
29641
29638
|
slidable: slidable,
|
|
29642
29639
|
range: range
|
|
29643
29640
|
} = this.attribute;
|
|
29644
|
-
slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$
|
|
29641
|
+
slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$4(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown));
|
|
29645
29642
|
}
|
|
29646
29643
|
_updateTrack() {
|
|
29647
29644
|
const startHandler = this._startHandler,
|
|
@@ -30077,7 +30074,7 @@
|
|
|
30077
30074
|
y: parsedPadding[0],
|
|
30078
30075
|
zIndex: 1
|
|
30079
30076
|
}, "group");
|
|
30080
|
-
if (!1 !== (null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.visible) && !1 !== (null == textStyle ? void 0 : textStyle.visible)) if (textStyle && isValid$
|
|
30077
|
+
if (!1 !== (null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.visible) && !1 !== (null == textStyle ? void 0 : textStyle.visible)) if (textStyle && isValid$6(null == textStyle ? void 0 : textStyle.character)) {
|
|
30081
30078
|
const attr = {
|
|
30082
30079
|
x: null !== (_b = textStyle.x) && void 0 !== _b ? _b : 0,
|
|
30083
30080
|
y: null !== (_c = textStyle.y) && void 0 !== _c ? _c : 0,
|
|
@@ -30090,7 +30087,7 @@
|
|
|
30090
30087
|
textConfig: textStyle.character
|
|
30091
30088
|
};
|
|
30092
30089
|
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
30093
|
-
} else isValid$
|
|
30090
|
+
} else isValid$6(text) && (this._mainTitle = group.createOrUpdateChild("mainTitle", Object.assign(Object.assign({
|
|
30094
30091
|
text: [text]
|
|
30095
30092
|
}, textStyle), {
|
|
30096
30093
|
maxLineWidth: null !== (_k = null == textStyle ? void 0 : textStyle.maxLineWidth) && void 0 !== _k ? _k : width,
|
|
@@ -30102,7 +30099,7 @@
|
|
|
30102
30099
|
}), "wrapText"));
|
|
30103
30100
|
const maintextHeight = this._mainTitle ? null === (_m = this._mainTitle) || void 0 === _m ? void 0 : _m.AABBBounds.height() : 0,
|
|
30104
30101
|
maintextWidth = this._mainTitle ? null === (_o = this._mainTitle) || void 0 === _o ? void 0 : _o.AABBBounds.width() : 0;
|
|
30105
|
-
if (!1 !== (null === (_p = this.attribute) || void 0 === _p ? void 0 : _p.visible) && !1 !== (null == subtextStyle ? void 0 : subtextStyle.visible)) if (subtextStyle && isValid$
|
|
30102
|
+
if (!1 !== (null === (_p = this.attribute) || void 0 === _p ? void 0 : _p.visible) && !1 !== (null == subtextStyle ? void 0 : subtextStyle.visible)) if (subtextStyle && isValid$6(null == subtextStyle ? void 0 : subtextStyle.character)) {
|
|
30106
30103
|
const attr = {
|
|
30107
30104
|
x: null !== (_q = subtextStyle.x) && void 0 !== _q ? _q : 0,
|
|
30108
30105
|
y: null !== (_r = subtextStyle.y) && void 0 !== _r ? _r : maintextHeight,
|
|
@@ -30115,7 +30112,7 @@
|
|
|
30115
30112
|
textConfig: subtextStyle.character
|
|
30116
30113
|
};
|
|
30117
30114
|
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
30118
|
-
} else isValid$
|
|
30115
|
+
} else isValid$6(subtext) && (this._subTitle = group.createOrUpdateChild("subTitle", Object.assign(Object.assign({
|
|
30119
30116
|
text: [subtext]
|
|
30120
30117
|
}, subtextStyle), {
|
|
30121
30118
|
maxLineWidth: null !== (_y = null == subtextStyle ? void 0 : subtextStyle.maxLineWidth) && void 0 !== _y ? _y : width,
|
|
@@ -30129,22 +30126,22 @@
|
|
|
30129
30126
|
subtextWidth = this._subTitle ? null === (_1 = this._subTitle) || void 0 === _1 ? void 0 : _1.AABBBounds.width() : 0;
|
|
30130
30127
|
let titleWidth = Math.max(maintextWidth, subtextWidth),
|
|
30131
30128
|
titleHeight = maintextHeight + (null !== (_2 = null == subtextStyle ? void 0 : subtextStyle.height) && void 0 !== _2 ? _2 : subtextHeight);
|
|
30132
|
-
if (isValid$
|
|
30129
|
+
if (isValid$6(width) && (titleWidth = width, null === (_3 = this._mainTitle) || void 0 === _3 || _3.setAttribute("maxLineWidth", width), null === (_4 = this._subTitle) || void 0 === _4 || _4.setAttribute("maxLineWidth", width)), isValid$6(height) && (titleHeight = height), isValid$6(minWidth) && titleWidth < minWidth && (titleWidth = minWidth), isValid$6(maxWidth) && (null === (_5 = this._mainTitle) || void 0 === _5 || _5.setAttribute("maxLineWidth", maxWidth), null === (_6 = this._subTitle) || void 0 === _6 || _6.setAttribute("maxLineWidth", maxWidth), null === (_7 = this._mainTitle) || void 0 === _7 || _7.setAttribute("maxWidth", maxWidth), null === (_8 = this._subTitle) || void 0 === _8 || _8.setAttribute("maxWidth", maxWidth), titleWidth > maxWidth && (titleWidth = maxWidth)), isValid$6(minHeight) && titleHeight < minHeight && (titleHeight = minHeight), isValid$6(maxHeight) && (null === (_9 = this._mainTitle) || void 0 === _9 || _9.setAttribute("maxHeight", maxHeight), null === (_10 = this._subTitle) || void 0 === _10 || _10.setAttribute("maxHeight", maxHeight - maintextHeight), titleHeight > maxHeight && (titleHeight = maxHeight)), group.attribute.width = titleWidth + parsedPadding[1] + parsedPadding[3], group.attribute.height = titleHeight + parsedPadding[0] + parsedPadding[2], isValid$6(align) || isValid$6(null == textStyle ? void 0 : textStyle.align)) {
|
|
30133
30130
|
const mainTitleAlign = (null == textStyle ? void 0 : textStyle.align) ? null == textStyle ? void 0 : textStyle.align : align,
|
|
30134
30131
|
mainTitleWidth = null !== (_11 = null == textStyle ? void 0 : textStyle.width) && void 0 !== _11 ? _11 : maintextWidth;
|
|
30135
30132
|
"left" === mainTitleAlign ? (null === (_12 = this._mainTitle) || void 0 === _12 || _12.setAttribute("x", 0), null === (_13 = this._mainTitle) || void 0 === _13 || _13.setAttribute("textAlign", "left")) : "center" === mainTitleAlign ? (null === (_14 = this._mainTitle) || void 0 === _14 || _14.setAttribute("x", mainTitleWidth / 2), null === (_15 = this._mainTitle) || void 0 === _15 || _15.setAttribute("textAlign", "center")) : "right" === mainTitleAlign && (null === (_16 = this._mainTitle) || void 0 === _16 || _16.setAttribute("x", mainTitleWidth), null === (_17 = this._mainTitle) || void 0 === _17 || _17.setAttribute("textAlign", "right"));
|
|
30136
30133
|
}
|
|
30137
|
-
if (isValid$
|
|
30134
|
+
if (isValid$6(verticalAlign) || isValid$6(null == textStyle ? void 0 : textStyle.verticalAlign)) {
|
|
30138
30135
|
const mainTitleVerticalAlign = (null == textStyle ? void 0 : textStyle.verticalAlign) ? null == textStyle ? void 0 : textStyle.verticalAlign : verticalAlign,
|
|
30139
30136
|
mainTitleHeight = (null == textStyle ? void 0 : textStyle.height) ? null == textStyle ? void 0 : textStyle.height : titleWidth;
|
|
30140
30137
|
"top" === mainTitleVerticalAlign ? (null === (_18 = this._mainTitle) || void 0 === _18 || _18.setAttribute("y", 0), null === (_19 = this._mainTitle) || void 0 === _19 || _19.setAttribute("textBaseline", "top")) : "middle" === mainTitleVerticalAlign ? (null === (_20 = this._mainTitle) || void 0 === _20 || _20.setAttribute("y", mainTitleHeight / 2), null === (_21 = this._mainTitle) || void 0 === _21 || _21.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && (null === (_22 = this._mainTitle) || void 0 === _22 || _22.setAttribute("y", mainTitleHeight), null === (_23 = this._mainTitle) || void 0 === _23 || _23.setAttribute("textBaseline", "bottom"));
|
|
30141
30138
|
}
|
|
30142
|
-
if (isValid$
|
|
30139
|
+
if (isValid$6(align) || isValid$6(null == subtextStyle ? void 0 : subtextStyle.align)) {
|
|
30143
30140
|
const subTitleAlign = (null == subtextStyle ? void 0 : subtextStyle.align) ? null == subtextStyle ? void 0 : subtextStyle.align : align,
|
|
30144
30141
|
subTitleWidth = null !== (_24 = null == subtextStyle ? void 0 : subtextStyle.width) && void 0 !== _24 ? _24 : subtextWidth;
|
|
30145
30142
|
"left" === subTitleAlign ? (null === (_25 = this._subTitle) || void 0 === _25 || _25.setAttribute("x", 0), null === (_26 = this._subTitle) || void 0 === _26 || _26.setAttribute("textAlign", "left")) : "center" === subTitleAlign ? (null === (_27 = this._subTitle) || void 0 === _27 || _27.setAttribute("x", subTitleWidth / 2), null === (_28 = this._subTitle) || void 0 === _28 || _28.setAttribute("textAlign", "center")) : "right" === subTitleAlign && (null === (_29 = this._subTitle) || void 0 === _29 || _29.setAttribute("x", subTitleWidth), null === (_30 = this._subTitle) || void 0 === _30 || _30.setAttribute("textAlign", "right"));
|
|
30146
30143
|
}
|
|
30147
|
-
if (isValid$
|
|
30144
|
+
if (isValid$6(verticalAlign) || isValid$6(null == textStyle ? void 0 : textStyle.verticalAlign)) {
|
|
30148
30145
|
const subTitleVerticalAlign = (null == subtextStyle ? void 0 : subtextStyle.verticalAlign) ? null == subtextStyle ? void 0 : subtextStyle.verticalAlign : verticalAlign,
|
|
30149
30146
|
subTitleYStart = maintextHeight,
|
|
30150
30147
|
subTitleHeight = null !== (_31 = null == subtextStyle ? void 0 : subtextStyle.height) && void 0 !== _31 ? _31 : 0;
|
|
@@ -30316,7 +30313,7 @@
|
|
|
30316
30313
|
}
|
|
30317
30314
|
};
|
|
30318
30315
|
function getAxisAttributes(option) {
|
|
30319
|
-
const spec = option;
|
|
30316
|
+
const spec = merge$1({}, option);
|
|
30320
30317
|
let titleAngle = spec.title?.angle ?? 0;
|
|
30321
30318
|
let titleTextStyle;
|
|
30322
30319
|
if (spec.orient === 'left' || spec.orient === 'right') {
|
|
@@ -32710,8 +32707,8 @@
|
|
|
32710
32707
|
return this.removeChild(child);
|
|
32711
32708
|
}
|
|
32712
32709
|
addEventListener(type, listener, options) {
|
|
32713
|
-
const capture = isBoolean$3(options, !0) && options || isObject$
|
|
32714
|
-
once = isObject$
|
|
32710
|
+
const capture = isBoolean$3(options, !0) && options || isObject$4(options) && options.capture,
|
|
32711
|
+
once = isObject$4(options) && options.once,
|
|
32715
32712
|
context = isFunction$1(listener) ? void 0 : listener;
|
|
32716
32713
|
return type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent, once ? super.once(type, listener, context) : super.on(type, listener, context), this;
|
|
32717
32714
|
}
|
|
@@ -32719,17 +32716,17 @@
|
|
|
32719
32716
|
return this.addEventListener(type, listener, options);
|
|
32720
32717
|
}
|
|
32721
32718
|
removeEventListener(type, listener, options) {
|
|
32722
|
-
const capture = isBoolean$3(options, !0) && options || isObject$
|
|
32719
|
+
const capture = isBoolean$3(options, !0) && options || isObject$4(options) && options.capture,
|
|
32723
32720
|
context = isFunction$1(listener) ? void 0 : listener;
|
|
32724
32721
|
type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent;
|
|
32725
|
-
const once = isObject$
|
|
32722
|
+
const once = isObject$4(options) && options.once;
|
|
32726
32723
|
return super.off(type, listener, context, once), this;
|
|
32727
32724
|
}
|
|
32728
32725
|
off(type, listener, options) {
|
|
32729
32726
|
return this.removeEventListener(type, listener, options);
|
|
32730
32727
|
}
|
|
32731
32728
|
once(type, listener, options) {
|
|
32732
|
-
return isObject$
|
|
32729
|
+
return isObject$4(options) ? (options.once = !0, this.addEventListener(type, listener, options)) : this.addEventListener(type, listener, {
|
|
32733
32730
|
once: !0
|
|
32734
32731
|
});
|
|
32735
32732
|
}
|
|
@@ -35507,7 +35504,7 @@
|
|
|
35507
35504
|
labelStyle: labelStyle
|
|
35508
35505
|
} = op;
|
|
35509
35506
|
let scaleTicks;
|
|
35510
|
-
if (isValid$
|
|
35507
|
+
if (isValid$6(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$6(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if ("d3" === op.tickMode) {
|
|
35511
35508
|
const count = isFunction$1(tickCount) ? tickCount({
|
|
35512
35509
|
axisLength: rangeSize,
|
|
35513
35510
|
labelStyle: labelStyle
|
|
@@ -35582,7 +35579,7 @@
|
|
|
35582
35579
|
rangeSize = scale.calculateWholeRangeSize();
|
|
35583
35580
|
if (rangeSize < 2) return op.labelLastVisible ? convertDomainToTickData([domain[domain.length - 1]]) : convertDomainToTickData([domain[0]]);
|
|
35584
35581
|
let scaleTicks;
|
|
35585
|
-
if (isValid$
|
|
35582
|
+
if (isValid$6(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$6(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$6(tickCount)) {
|
|
35586
35583
|
const count = isFunction$1(tickCount) ? tickCount({
|
|
35587
35584
|
axisLength: rangeSize,
|
|
35588
35585
|
labelStyle: labelStyle
|
|
@@ -35686,7 +35683,7 @@
|
|
|
35686
35683
|
radius = null == getRadius ? void 0 : getRadius();
|
|
35687
35684
|
if (!radius) return convertDomainToTickData(scale.domain());
|
|
35688
35685
|
let scaleTicks;
|
|
35689
|
-
if (isValid$
|
|
35686
|
+
if (isValid$6(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$6(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$6(tickCount)) {
|
|
35690
35687
|
const range = scale.range(),
|
|
35691
35688
|
rangeSize = Math.abs(range[range.length - 1] - range[0]),
|
|
35692
35689
|
count = isFunction$1(tickCount) ? tickCount({
|
|
@@ -35779,10 +35776,10 @@
|
|
|
35779
35776
|
if (isNil$5(this.domain?.min) && isNil$5(this.domain?.max)) {
|
|
35780
35777
|
this.nice && this._scale.nice(tickCount);
|
|
35781
35778
|
}
|
|
35782
|
-
else if (isValid$
|
|
35779
|
+
else if (isValid$6(this.domain?.min) && isNil$5(this.domain?.max)) {
|
|
35783
35780
|
this.nice && this._scale.niceMax(tickCount);
|
|
35784
35781
|
}
|
|
35785
|
-
else if (isNil$5(this.domain?.min) && isValid$
|
|
35782
|
+
else if (isNil$5(this.domain?.min) && isValid$6(this.domain?.max)) {
|
|
35786
35783
|
this.nice && this._scale.niceMin(tickCount);
|
|
35787
35784
|
}
|
|
35788
35785
|
else {
|
|
@@ -35813,10 +35810,10 @@
|
|
|
35813
35810
|
}
|
|
35814
35811
|
const domainMin = domain[0];
|
|
35815
35812
|
const domainMax = domain[domain.length - 1];
|
|
35816
|
-
if (isValid$
|
|
35813
|
+
if (isValid$6(this.expand.min)) {
|
|
35817
35814
|
domain[0] = domainMin - (domainMax - domainMin) * this.expand.min;
|
|
35818
35815
|
}
|
|
35819
|
-
if (isValid$
|
|
35816
|
+
if (isValid$6(this.expand.max)) {
|
|
35820
35817
|
domain[domain.length - 1] = domainMax + (domainMax - domainMin) * this.expand.max;
|
|
35821
35818
|
}
|
|
35822
35819
|
}
|
|
@@ -35854,10 +35851,10 @@
|
|
|
35854
35851
|
if (isNil$5(this.domain?.min) && isNil$5(this.domain?.max)) {
|
|
35855
35852
|
this._scale.nice(tickCount);
|
|
35856
35853
|
}
|
|
35857
|
-
else if (isValid$
|
|
35854
|
+
else if (isValid$6(this.domain?.min) && isNil$5(this.domain?.max)) {
|
|
35858
35855
|
this._scale.niceMax(tickCount);
|
|
35859
35856
|
}
|
|
35860
|
-
else if (isNil$5(this.domain?.min) && isValid$
|
|
35857
|
+
else if (isNil$5(this.domain?.min) && isValid$6(this.domain?.max)) {
|
|
35861
35858
|
this._scale.niceMin(tickCount);
|
|
35862
35859
|
}
|
|
35863
35860
|
else {
|
|
@@ -35902,8 +35899,8 @@
|
|
|
35902
35899
|
return;
|
|
35903
35900
|
}
|
|
35904
35901
|
const { min, max } = this.domain;
|
|
35905
|
-
isValid$
|
|
35906
|
-
isValid$
|
|
35902
|
+
isValid$6(min) && (domain[0] = min);
|
|
35903
|
+
isValid$6(max) && (domain[1] = max);
|
|
35907
35904
|
}
|
|
35908
35905
|
setZero(zero) {
|
|
35909
35906
|
if (this.zero !== zero) {
|
|
@@ -37872,45 +37869,45 @@
|
|
|
37872
37869
|
const originalElement = originalElements[i];
|
|
37873
37870
|
const element = Object.assign({}, originalElement);
|
|
37874
37871
|
for (const name in element) {
|
|
37875
|
-
if (element.hasOwnProperty(name) && isFunction$
|
|
37872
|
+
if (element.hasOwnProperty(name) && isFunction$1(element[name])) {
|
|
37876
37873
|
element[name] = element[name](value);
|
|
37877
37874
|
}
|
|
37878
37875
|
}
|
|
37879
37876
|
const rect = element;
|
|
37880
37877
|
if (isValid$6(rect.x)) {
|
|
37881
|
-
rect.x = isString$
|
|
37878
|
+
rect.x = isString$3(rect.x)
|
|
37882
37879
|
? transformString(rect.x, width - borderLineWidths[1])
|
|
37883
37880
|
: Number(rect.x);
|
|
37884
|
-
rect.y = isString$
|
|
37881
|
+
rect.y = isString$3(rect.y)
|
|
37885
37882
|
? transformString(rect.y, height - borderLineWidths[2])
|
|
37886
37883
|
: Number(rect.y);
|
|
37887
37884
|
}
|
|
37888
37885
|
if ('width' in element) {
|
|
37889
|
-
element.width = isString$
|
|
37886
|
+
element.width = isString$3(element.width)
|
|
37890
37887
|
? transformString(element.width, width - borderLineWidths[1])
|
|
37891
37888
|
: Number(element.width);
|
|
37892
37889
|
}
|
|
37893
37890
|
if ('height' in element) {
|
|
37894
|
-
element.height = isString$
|
|
37891
|
+
element.height = isString$3(element.height)
|
|
37895
37892
|
? transformString(element.height, height - borderLineWidths[2])
|
|
37896
37893
|
: Number(element.height);
|
|
37897
37894
|
}
|
|
37898
37895
|
if ('radius' in element) {
|
|
37899
|
-
element.radius = isString$
|
|
37896
|
+
element.radius = isString$3(element.radius)
|
|
37900
37897
|
? transformString(element.radius, Math.min(width - borderLineWidths[1], height - borderLineWidths[2]))
|
|
37901
37898
|
: Number(element.radius);
|
|
37902
37899
|
}
|
|
37903
37900
|
if ('hover' in element) {
|
|
37904
|
-
element.hover.x = isString$
|
|
37901
|
+
element.hover.x = isString$3(element.hover.x)
|
|
37905
37902
|
? transformString(element.hover.x, width - borderLineWidths[1])
|
|
37906
37903
|
: Number(element.hover.x);
|
|
37907
|
-
element.hover.y = isString$
|
|
37904
|
+
element.hover.y = isString$3(element.hover.y)
|
|
37908
37905
|
? transformString(element.hover.y, height - borderLineWidths[2])
|
|
37909
37906
|
: Number(element.hover.y);
|
|
37910
|
-
element.hover.width = isString$
|
|
37907
|
+
element.hover.width = isString$3(element.hover.width)
|
|
37911
37908
|
? transformString(element.hover.width, width - borderLineWidths[1])
|
|
37912
37909
|
: Number(element.hover.width);
|
|
37913
|
-
element.hover.height = isString$
|
|
37910
|
+
element.hover.height = isString$3(element.hover.height)
|
|
37914
37911
|
? transformString(element.hover.height, height - borderLineWidths[2])
|
|
37915
37912
|
: Number(element.hover.height);
|
|
37916
37913
|
element.hover.x += left;
|
|
@@ -39293,7 +39290,7 @@
|
|
|
39293
39290
|
let absoluteLeftIconWidth = 0;
|
|
39294
39291
|
let absoluteRightIconWidth = 0;
|
|
39295
39292
|
if (!Array.isArray(icons) || icons.length === 0) {
|
|
39296
|
-
if (isValid$
|
|
39293
|
+
if (isValid$6(textStr)) {
|
|
39297
39294
|
const text = convertInternal(textStr).replace(/\r?\n/g, '\n').replace(/\r/g, '\n').split('\n');
|
|
39298
39295
|
const hierarchyOffset = getHierarchyOffset(cellGroup.col, cellGroup.row, table);
|
|
39299
39296
|
const attribute = {
|
|
@@ -39757,10 +39754,10 @@
|
|
|
39757
39754
|
if (isNil$5(axisOption.min) && isNil$5(axisOption.max)) {
|
|
39758
39755
|
scale.nice(tickCount);
|
|
39759
39756
|
}
|
|
39760
|
-
else if (isValid$
|
|
39757
|
+
else if (isValid$6(axisOption.min) && isNil$5(axisOption.max)) {
|
|
39761
39758
|
scale.niceMax(tickCount);
|
|
39762
39759
|
}
|
|
39763
|
-
else if (isNil$5(axisOption.min) && isValid$
|
|
39760
|
+
else if (isNil$5(axisOption.min) && isValid$6(axisOption.max)) {
|
|
39764
39761
|
scale.niceMin(tickCount);
|
|
39765
39762
|
}
|
|
39766
39763
|
}
|
|
@@ -40016,10 +40013,10 @@
|
|
|
40016
40013
|
if (axisOption) {
|
|
40017
40014
|
const { seriesIndex, seriesId } = axisOption;
|
|
40018
40015
|
let seriesIndice;
|
|
40019
|
-
if (isValid$
|
|
40016
|
+
if (isValid$6(seriesId) && isArray$5(spec.series)) {
|
|
40020
40017
|
seriesIndice = (isArray$5(seriesId) ? seriesId : [seriesId]).map(id => spec.series.findIndex((s) => s.id === id));
|
|
40021
40018
|
}
|
|
40022
|
-
else if (isValid$
|
|
40019
|
+
else if (isValid$6(seriesIndex) && isArray$5(spec.series)) {
|
|
40023
40020
|
seriesIndice = seriesIndex;
|
|
40024
40021
|
}
|
|
40025
40022
|
return {
|
|
@@ -40133,9 +40130,9 @@
|
|
|
40133
40130
|
text = attribute.label.formatMethod(text);
|
|
40134
40131
|
}
|
|
40135
40132
|
const { width, height } = table.measureText(text, {
|
|
40136
|
-
fontSize: attribute.label?.style?.fontSize,
|
|
40137
|
-
fontWeight: attribute.label?.style?.fontWeight,
|
|
40138
|
-
fontFamily: attribute.label?.style?.fontFamily
|
|
40133
|
+
fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
40134
|
+
fontWeight: attribute.label?.style?.fontWeight ?? 'normal',
|
|
40135
|
+
fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY
|
|
40139
40136
|
});
|
|
40140
40137
|
const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;
|
|
40141
40138
|
const angel = (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);
|
|
@@ -40160,9 +40157,9 @@
|
|
|
40160
40157
|
text = attribute.label.formatMethod(text);
|
|
40161
40158
|
}
|
|
40162
40159
|
const { width, height } = table.measureText(text, {
|
|
40163
|
-
fontSize: attribute.label?.style?.fontSize,
|
|
40164
|
-
fontWeight: attribute.label?.style?.fontWeight,
|
|
40165
|
-
fontFamily: attribute.label?.style?.fontFamily
|
|
40160
|
+
fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
40161
|
+
fontWeight: attribute.label?.style?.fontWeight ?? 'normal',
|
|
40162
|
+
fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY
|
|
40166
40163
|
});
|
|
40167
40164
|
const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;
|
|
40168
40165
|
const angle = (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);
|
|
@@ -40174,9 +40171,9 @@
|
|
|
40174
40171
|
let titleWidth = 0;
|
|
40175
40172
|
if (attribute.title.visible && attribute.title.text) {
|
|
40176
40173
|
const { width, height } = table.measureText(attribute.title.text, {
|
|
40177
|
-
fontSize: attribute.title?.style?.fontSize,
|
|
40178
|
-
fontWeight: attribute.title?.style?.fontWeight,
|
|
40179
|
-
fontFamily: attribute.title?.style?.fontFamily
|
|
40174
|
+
fontSize: attribute.title?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
40175
|
+
fontWeight: attribute.title?.style?.fontWeight ?? 'normal',
|
|
40176
|
+
fontFamily: attribute.title?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY
|
|
40180
40177
|
});
|
|
40181
40178
|
const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;
|
|
40182
40179
|
const size = getSizeAfterResize(Math.min(width, widthLimit), height, attribute.title?.style?.angle);
|
|
@@ -40205,9 +40202,9 @@
|
|
|
40205
40202
|
text = attribute.label.formatMethod(text);
|
|
40206
40203
|
}
|
|
40207
40204
|
const { width, height } = table.measureText(text, {
|
|
40208
|
-
fontSize: attribute.label?.style?.fontSize,
|
|
40209
|
-
fontWeight: attribute.label?.style?.fontWeight,
|
|
40210
|
-
fontFamily: attribute.label?.style?.fontFamily
|
|
40205
|
+
fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
40206
|
+
fontWeight: attribute.label?.style?.fontWeight ?? 'normal',
|
|
40207
|
+
fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY
|
|
40211
40208
|
});
|
|
40212
40209
|
const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;
|
|
40213
40210
|
const angle = (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);
|
|
@@ -40232,9 +40229,9 @@
|
|
|
40232
40229
|
text = attribute.label.formatMethod(text);
|
|
40233
40230
|
}
|
|
40234
40231
|
const { width, height } = table.measureText(text, {
|
|
40235
|
-
fontSize: attribute.label?.style?.fontSize,
|
|
40236
|
-
fontWeight: attribute.label?.style?.fontWeight,
|
|
40237
|
-
fontFamily: attribute.label?.style?.fontFamily
|
|
40232
|
+
fontSize: attribute.label?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
40233
|
+
fontWeight: attribute.label?.style?.fontWeight ?? 'normal',
|
|
40234
|
+
fontFamily: attribute.label?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY
|
|
40238
40235
|
});
|
|
40239
40236
|
const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;
|
|
40240
40237
|
const angle = (attribute.label?.style?.angle ?? 0) + (attribute.label?.style?.direction === 'vertical' ? 90 : 0);
|
|
@@ -40246,9 +40243,9 @@
|
|
|
40246
40243
|
let titleHeight = 0;
|
|
40247
40244
|
if (attribute.title.visible && attribute.title.text) {
|
|
40248
40245
|
const { width, height } = table.measureText(attribute.title.text, {
|
|
40249
|
-
fontSize: attribute.title?.style?.fontSize,
|
|
40250
|
-
fontWeight: attribute.title?.style?.fontWeight,
|
|
40251
|
-
fontFamily: attribute.title?.style?.fontFamily
|
|
40246
|
+
fontSize: attribute.title?.style?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
40247
|
+
fontWeight: attribute.title?.style?.fontWeight ?? 'normal',
|
|
40248
|
+
fontFamily: attribute.title?.style?.fontFamily ?? DEFAULT_TEXT_FONT_FAMILY
|
|
40252
40249
|
});
|
|
40253
40250
|
const widthLimit = attribute.label?.style?.maxLineWidth || Infinity;
|
|
40254
40251
|
const size = getSizeAfterResize(Math.min(width, widthLimit), height, attribute.title?.style?.angle);
|
|
@@ -43862,44 +43859,45 @@
|
|
|
43862
43859
|
}
|
|
43863
43860
|
|
|
43864
43861
|
async function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
|
|
43865
|
-
const {
|
|
43862
|
+
const { table } = proxy;
|
|
43863
|
+
const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = table.scenegraph;
|
|
43866
43864
|
proxy.setParamsForRow();
|
|
43867
43865
|
proxy.setParamsForColumn();
|
|
43868
|
-
computeColsWidth(
|
|
43869
|
-
computeRowsHeight(
|
|
43870
|
-
if (
|
|
43871
|
-
computeColsWidth(
|
|
43872
|
-
}
|
|
43873
|
-
if (
|
|
43874
|
-
computeColsWidth(
|
|
43875
|
-
}
|
|
43876
|
-
|
|
43877
|
-
|
|
43878
|
-
|
|
43879
|
-
|
|
43880
|
-
|
|
43881
|
-
x:
|
|
43882
|
-
y:
|
|
43883
|
-
});
|
|
43884
|
-
createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0,
|
|
43885
|
-
createColGroup(colHeaderGroup, xOrigin, yOrigin,
|
|
43886
|
-
createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0,
|
|
43887
|
-
if (
|
|
43888
|
-
if (!
|
|
43889
|
-
createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0,
|
|
43866
|
+
computeColsWidth(table, 0, Math.min(proxy.firstScreenColLimit, table.colCount - 1));
|
|
43867
|
+
computeRowsHeight(table, 0, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1));
|
|
43868
|
+
if (table.rightFrozenColCount > 0 && table.colCount - 1 > proxy.firstScreenColLimit) {
|
|
43869
|
+
computeColsWidth(table, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1);
|
|
43870
|
+
}
|
|
43871
|
+
if (table.bottomFrozenRowCount > 0 && table.rowCount - 1 > proxy.firstScreenRowLimit) {
|
|
43872
|
+
computeColsWidth(table, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1);
|
|
43873
|
+
}
|
|
43874
|
+
table.scenegraph.colHeaderGroup.setAttribute('x', table.getFrozenColsWidth());
|
|
43875
|
+
table.scenegraph.rowHeaderGroup.setAttribute('y', table.getFrozenRowsHeight());
|
|
43876
|
+
table.scenegraph.bottomFrozenGroup.setAttribute('x', table.getFrozenColsWidth());
|
|
43877
|
+
table.scenegraph.rightFrozenGroup.setAttribute('y', table.getFrozenRowsHeight());
|
|
43878
|
+
table.scenegraph.bodyGroup.setAttributes({
|
|
43879
|
+
x: table.getFrozenColsWidth(),
|
|
43880
|
+
y: table.getFrozenRowsHeight()
|
|
43881
|
+
});
|
|
43882
|
+
createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.columnHeaderLevelCount - 1, table.isListTable() ? 'columnHeader' : 'cornerHeader', table);
|
|
43883
|
+
createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
|
|
43884
|
+
createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', table);
|
|
43885
|
+
if (table.bottomFrozenRowCount > 0) {
|
|
43886
|
+
if (!table.isPivotChart()) {
|
|
43887
|
+
createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isListTable() ? 'body' : 'rowHeader', table);
|
|
43890
43888
|
}
|
|
43891
|
-
createColGroup(bottomFrozenGroup, xOrigin, yOrigin,
|
|
43889
|
+
createColGroup(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? 'rowHeader' : 'body', table);
|
|
43892
43890
|
}
|
|
43893
|
-
if (
|
|
43894
|
-
if (!
|
|
43895
|
-
createColGroup(rightTopCornerGroup, xOrigin, yOrigin,
|
|
43891
|
+
if (table.rightFrozenColCount > 0) {
|
|
43892
|
+
if (!table.isPivotChart()) {
|
|
43893
|
+
createColGroup(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
|
|
43896
43894
|
}
|
|
43897
|
-
createColGroup(rightFrozenGroup, xOrigin, yOrigin,
|
|
43895
|
+
createColGroup(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), table.isPivotChart() ? 'rowHeader' : 'body', table);
|
|
43898
43896
|
}
|
|
43899
|
-
if (
|
|
43900
|
-
createColGroup(rightBottomCornerGroup, xOrigin, yOrigin,
|
|
43897
|
+
if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && !table.isPivotChart()) {
|
|
43898
|
+
createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, 'body', table);
|
|
43901
43899
|
}
|
|
43902
|
-
createColGroup(bodyGroup, xOrigin, yOrigin,
|
|
43900
|
+
createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), 'body', table);
|
|
43903
43901
|
if (!bodyGroup.firstChild) {
|
|
43904
43902
|
proxy.currentRow = proxy.totalRow;
|
|
43905
43903
|
proxy.rowEnd = proxy.currentRow;
|
|
@@ -44333,9 +44331,9 @@
|
|
|
44333
44331
|
}
|
|
44334
44332
|
else {
|
|
44335
44333
|
const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
|
|
44336
|
-
const
|
|
44337
|
-
syncTopRow =
|
|
44338
|
-
syncBottomRow =
|
|
44334
|
+
const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
|
|
44335
|
+
syncTopRow = topRow;
|
|
44336
|
+
syncBottomRow = bottomRow;
|
|
44339
44337
|
}
|
|
44340
44338
|
computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
|
|
44341
44339
|
updatePartRowPosition(startRow, endRow, direction, proxy);
|
|
@@ -44352,7 +44350,7 @@
|
|
|
44352
44350
|
proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
|
|
44353
44351
|
proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;
|
|
44354
44352
|
proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
|
|
44355
|
-
proxy.rowUpdatePos = distStartRow;
|
|
44353
|
+
proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, distStartRow);
|
|
44356
44354
|
proxy.rowUpdateDirection = direction;
|
|
44357
44355
|
proxy.table.scenegraph.updateNextFrame();
|
|
44358
44356
|
if (proxy.table.heightMode !== 'autoHeight') {
|
|
@@ -44395,7 +44393,7 @@
|
|
|
44395
44393
|
}
|
|
44396
44394
|
}
|
|
44397
44395
|
function updatePartRowPosition(startRow, endRow, direction, proxy) {
|
|
44398
|
-
for (let col = 0; col < proxy.table.
|
|
44396
|
+
for (let col = 0; col < proxy.table.frozenColCount; col++) {
|
|
44399
44397
|
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
44400
44398
|
for (let row = startRow; row <= endRow; row++) {
|
|
44401
44399
|
updateCellGroupPosition(colGroup, direction, proxy);
|
|
@@ -44427,7 +44425,7 @@
|
|
|
44427
44425
|
}
|
|
44428
44426
|
}
|
|
44429
44427
|
function updateAllRowPosition(distStartRowY, count, direction, proxy) {
|
|
44430
|
-
for (let col = 0; col < proxy.table.
|
|
44428
|
+
for (let col = 0; col < proxy.table.frozenColCount; col++) {
|
|
44431
44429
|
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
44432
44430
|
colGroup?.forEachChildren((cellGroup, index) => {
|
|
44433
44431
|
proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
|
|
@@ -44453,7 +44451,7 @@
|
|
|
44453
44451
|
}
|
|
44454
44452
|
}
|
|
44455
44453
|
function updateRowContent(syncTopRow, syncBottomRow, proxy) {
|
|
44456
|
-
for (let col = 0; col < proxy.table.
|
|
44454
|
+
for (let col = 0; col < proxy.table.frozenColCount; col++) {
|
|
44457
44455
|
for (let row = syncTopRow; row <= syncBottomRow; row++) {
|
|
44458
44456
|
const cellGroup = proxy.highPerformanceGetCell(col, row, true);
|
|
44459
44457
|
proxy.updateCellGroupContent(cellGroup);
|
|
@@ -44544,7 +44542,6 @@
|
|
|
44544
44542
|
screenTopRow = 0;
|
|
44545
44543
|
deltaY = 0;
|
|
44546
44544
|
colLimit = 100;
|
|
44547
|
-
bodyLeftCol;
|
|
44548
44545
|
bodyRightCol;
|
|
44549
44546
|
totalCol;
|
|
44550
44547
|
colStart;
|
|
@@ -44583,8 +44580,10 @@
|
|
|
44583
44580
|
this.rowLimit = this.table.options.maintainedDataCount;
|
|
44584
44581
|
}
|
|
44585
44582
|
}
|
|
44583
|
+
get bodyLeftCol() {
|
|
44584
|
+
return this.table.frozenColCount;
|
|
44585
|
+
}
|
|
44586
44586
|
setParamsForColumn() {
|
|
44587
|
-
this.bodyLeftCol = this.table.frozenColCount;
|
|
44588
44587
|
this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;
|
|
44589
44588
|
const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
|
|
44590
44589
|
this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1;
|
|
@@ -44822,7 +44821,7 @@
|
|
|
44822
44821
|
(row < this.rowStart || row > this.rowEnd)) {
|
|
44823
44822
|
return emptyGroup;
|
|
44824
44823
|
}
|
|
44825
|
-
if (col >= this.table.
|
|
44824
|
+
if (col >= this.table.frozenColCount &&
|
|
44826
44825
|
col < this.table.colCount - this.table.rightFrozenColCount &&
|
|
44827
44826
|
(col < this.colStart || col > this.colEnd)) {
|
|
44828
44827
|
return emptyGroup;
|
|
@@ -45487,23 +45486,26 @@
|
|
|
45487
45486
|
scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
|
|
45488
45487
|
}
|
|
45489
45488
|
function resetFrozen(scene) {
|
|
45490
|
-
if (scene.frozenColCount > scene.table.
|
|
45491
|
-
for (let i = 0; i < scene.frozenColCount - scene.table.
|
|
45489
|
+
if (scene.frozenColCount > scene.table.frozenColCount) {
|
|
45490
|
+
for (let i = 0; i < scene.frozenColCount - scene.table.frozenColCount; i++) {
|
|
45492
45491
|
moveColumnFromRowHeaderToBody(scene);
|
|
45493
45492
|
moveColumnFromCornerHeaderToColHeader(scene);
|
|
45494
45493
|
moveColumnFromLeftBottomCornerToBottom(scene);
|
|
45495
45494
|
}
|
|
45496
45495
|
}
|
|
45497
|
-
else if (scene.frozenColCount < scene.table.
|
|
45496
|
+
else if (scene.frozenColCount < scene.table.frozenColCount) {
|
|
45498
45497
|
scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
|
|
45499
45498
|
scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
|
|
45500
45499
|
scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
|
|
45501
|
-
for (let i = 0; i < scene.table.
|
|
45500
|
+
for (let i = 0; i < scene.table.frozenColCount - scene.frozenColCount; i++) {
|
|
45502
45501
|
moveColumnFromBodyToRowHeader(scene);
|
|
45503
45502
|
moveColumnFromColHeaderToCornerHeader(scene);
|
|
45504
45503
|
moveColumnFromBottomToLeftBottomCorner(scene);
|
|
45505
45504
|
}
|
|
45506
45505
|
}
|
|
45506
|
+
scene.frozenColCount = scene.table.frozenColCount;
|
|
45507
|
+
scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
|
|
45508
|
+
scene.proxy.colStart = scene.table.frozenColCount;
|
|
45507
45509
|
scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
|
|
45508
45510
|
scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
|
|
45509
45511
|
scene.updateContainer();
|
|
@@ -45512,8 +45514,6 @@
|
|
|
45512
45514
|
scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
|
|
45513
45515
|
}
|
|
45514
45516
|
scene.hasFrozen = true;
|
|
45515
|
-
scene.frozenColCount = scene.table.rowHeaderLevelCount;
|
|
45516
|
-
scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
|
|
45517
45517
|
}
|
|
45518
45518
|
function moveColumnFromBodyToRowHeader(scene) {
|
|
45519
45519
|
const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
|
|
@@ -45638,14 +45638,14 @@
|
|
|
45638
45638
|
const { table, proxy, bottomFrozenGroup, leftBottomCornerGroup, rightBottomCornerGroup } = scene;
|
|
45639
45639
|
if (!bottomFrozenGroup.childrenCount) {
|
|
45640
45640
|
if (!proxy.table.isPivotChart()) {
|
|
45641
|
-
createColGroup(leftBottomCornerGroup, 0, 0, 0, table.
|
|
45641
|
+
createColGroup(leftBottomCornerGroup, 0, 0, 0, table.frozenColCount - 1, 0, -1, 'rowHeader', table);
|
|
45642
45642
|
createColGroup(rightBottomCornerGroup, 0, 0, table.colCount - table.rightFrozenColCount, table.colCount - 1, 0, -1, 'body', table);
|
|
45643
45643
|
}
|
|
45644
45644
|
createColGroup(bottomFrozenGroup, 0, 0, proxy.colStart, proxy.colEnd, 0, -1, 'body', table);
|
|
45645
45645
|
}
|
|
45646
45646
|
const currentBottomFrozenRow = scene.table.bottomFrozenRowCount;
|
|
45647
45647
|
if (distBottomFrozenRow > currentBottomFrozenRow) {
|
|
45648
|
-
for (let col = 0; col < table.
|
|
45648
|
+
for (let col = 0; col < table.frozenColCount; col++) {
|
|
45649
45649
|
const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);
|
|
45650
45650
|
for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
|
|
45651
45651
|
const cellGroup = scene.getCell(col, row, true);
|
|
@@ -46300,7 +46300,7 @@
|
|
|
46300
46300
|
}
|
|
46301
46301
|
createSceneGraph() {
|
|
46302
46302
|
this.clear = false;
|
|
46303
|
-
this.frozenColCount = this.table.
|
|
46303
|
+
this.frozenColCount = this.table.frozenColCount;
|
|
46304
46304
|
this.frozenRowCount = this.table.columnHeaderLevelCount;
|
|
46305
46305
|
this.proxy = new SceneProxy(this.table);
|
|
46306
46306
|
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, undefined, true);
|
|
@@ -46613,16 +46613,17 @@
|
|
|
46613
46613
|
computeRowsHeight(this.table, 0, this.table.rowCount - 1, true, true);
|
|
46614
46614
|
}
|
|
46615
46615
|
resize() {
|
|
46616
|
-
if (this.table.
|
|
46617
|
-
this.
|
|
46618
|
-
|
|
46619
|
-
|
|
46620
|
-
this.
|
|
46616
|
+
if (this.table.internalProps._widthResizedColMap.size === 0) {
|
|
46617
|
+
if (this.table.widthMode === 'adaptive' || this.table.autoFillWidth) {
|
|
46618
|
+
this.recalculateColWidths();
|
|
46619
|
+
}
|
|
46620
|
+
if (this.table.heightMode === 'adaptive' || this.table.autoFillHeight) {
|
|
46621
|
+
this.recalculateRowHeights();
|
|
46622
|
+
}
|
|
46621
46623
|
}
|
|
46622
46624
|
this.dealWidthMode();
|
|
46623
46625
|
this.dealHeightMode();
|
|
46624
46626
|
this.resetFrozen();
|
|
46625
|
-
this.dealFrozen();
|
|
46626
46627
|
this.updateTableSize();
|
|
46627
46628
|
this.updateBorderSizeAndPosition();
|
|
46628
46629
|
this.component.updateScrollBar();
|
|
@@ -46767,8 +46768,11 @@
|
|
|
46767
46768
|
this.updateNextFrame();
|
|
46768
46769
|
}
|
|
46769
46770
|
afterScenegraphCreated() {
|
|
46770
|
-
this.
|
|
46771
|
-
|
|
46771
|
+
if (!this.isPivot && !this.transpose) {
|
|
46772
|
+
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
46773
|
+
}
|
|
46774
|
+
this.table.stateManeger.checkFrozen();
|
|
46775
|
+
this.updateContainer();
|
|
46772
46776
|
this.createFrameBorder();
|
|
46773
46777
|
this.updateBorderSizeAndPosition();
|
|
46774
46778
|
this.component.updateScrollBar();
|
|
@@ -47018,7 +47022,6 @@
|
|
|
47018
47022
|
return;
|
|
47019
47023
|
}
|
|
47020
47024
|
this.resetFrozen();
|
|
47021
|
-
this.dealFrozen();
|
|
47022
47025
|
this.component.updateScrollBar();
|
|
47023
47026
|
}
|
|
47024
47027
|
dealWidthRightFrozen(rightFrozenColCount) {
|
|
@@ -47554,7 +47557,7 @@
|
|
|
47554
47557
|
else if (interactionState === InteractionState.default) {
|
|
47555
47558
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
47556
47559
|
if (isShift && currentRange) {
|
|
47557
|
-
if (table.isColumnHeader(col, row)) {
|
|
47560
|
+
if (state.select.headerSelectMode !== 'cell' && table.isColumnHeader(col, row)) {
|
|
47558
47561
|
const startCol = Math.min(currentRange.start.col, currentRange.end.col, col);
|
|
47559
47562
|
const endCol = Math.max(currentRange.start.col, currentRange.end.col, col);
|
|
47560
47563
|
const startRow = Math.min(currentRange.start.row, currentRange.end.row, row);
|
|
@@ -47562,7 +47565,7 @@
|
|
|
47562
47565
|
currentRange.start = { col: startCol, row: startRow };
|
|
47563
47566
|
currentRange.end = { col: endCol, row: endRow };
|
|
47564
47567
|
}
|
|
47565
|
-
else if (table.isRowHeader(col, row)) {
|
|
47568
|
+
else if (state.select.headerSelectMode !== 'cell' && table.isRowHeader(col, row)) {
|
|
47566
47569
|
const startCol = Math.min(currentRange.start.col, currentRange.end.col, col);
|
|
47567
47570
|
const endCol = table.colCount - 1;
|
|
47568
47571
|
const startRow = Math.min(currentRange.start.row, currentRange.end.row, row);
|
|
@@ -47581,13 +47584,13 @@
|
|
|
47581
47584
|
state.select.ranges = [];
|
|
47582
47585
|
scenegraph.deleteAllSelectBorder();
|
|
47583
47586
|
}
|
|
47584
|
-
if (table.isColumnHeader(col, row)) {
|
|
47587
|
+
if (state.select.headerSelectMode !== 'cell' && table.isColumnHeader(col, row)) {
|
|
47585
47588
|
state.select.ranges.push({
|
|
47586
47589
|
start: { col, row },
|
|
47587
47590
|
end: { col, row: table.rowCount - 1 }
|
|
47588
47591
|
});
|
|
47589
47592
|
}
|
|
47590
|
-
else if (table.isRowHeader(col, row)) {
|
|
47593
|
+
else if (state.select.headerSelectMode !== 'cell' && table.isRowHeader(col, row)) {
|
|
47591
47594
|
state.select.ranges.push({
|
|
47592
47595
|
start: { col, row },
|
|
47593
47596
|
end: { col: table.colCount - 1, row }
|
|
@@ -48199,7 +48202,8 @@
|
|
|
48199
48202
|
}
|
|
48200
48203
|
}
|
|
48201
48204
|
setSelectState() {
|
|
48202
|
-
const { disableSelect, disableHeaderSelect } = this.table.options?.select ?? {
|
|
48205
|
+
const { headerSelectMode, disableSelect, disableHeaderSelect } = this.table.options?.select ?? {
|
|
48206
|
+
headerSelectMode: 'inline',
|
|
48203
48207
|
disableSelect: false,
|
|
48204
48208
|
disableHeaderSelect: false
|
|
48205
48209
|
};
|
|
@@ -48211,6 +48215,7 @@
|
|
|
48211
48215
|
}
|
|
48212
48216
|
this.select.singleStyle = !disableSelect;
|
|
48213
48217
|
this.select.disableHeader = disableHeaderSelect;
|
|
48218
|
+
this.select.headerSelectMode = headerSelectMode;
|
|
48214
48219
|
}
|
|
48215
48220
|
isSelected(col, row) {
|
|
48216
48221
|
let seled = false;
|
|
@@ -48604,7 +48609,7 @@
|
|
|
48604
48609
|
if (isObject$4(item) && (item.menuKey || item.text) === (menuKey || '') && i === index) {
|
|
48605
48610
|
return true;
|
|
48606
48611
|
}
|
|
48607
|
-
else if (isString$
|
|
48612
|
+
else if (isString$3(item) && item === menuKey && i === index) {
|
|
48608
48613
|
return true;
|
|
48609
48614
|
}
|
|
48610
48615
|
}
|
|
@@ -48960,8 +48965,8 @@
|
|
|
48960
48965
|
}
|
|
48961
48966
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL)) {
|
|
48962
48967
|
if (cellGoup?.role === 'cell' &&
|
|
48963
|
-
isValid$
|
|
48964
|
-
isValid$
|
|
48968
|
+
isValid$6(cellGoup.col) &&
|
|
48969
|
+
isValid$6(cellGoup.row) &&
|
|
48965
48970
|
(cellGoup.col !== table.stateManeger.hover.cellPos.col || cellGoup.row !== table.stateManeger.hover.cellPos.row)) {
|
|
48966
48971
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {
|
|
48967
48972
|
col: cellGoup.col,
|
|
@@ -49502,7 +49507,7 @@
|
|
|
49502
49507
|
handler.on(table.getElement(), 'copy', (e) => {
|
|
49503
49508
|
if (table.keyboardOptions?.copySelected) {
|
|
49504
49509
|
const data = table.getCopyValue();
|
|
49505
|
-
if (isValid$
|
|
49510
|
+
if (isValid$6(data)) {
|
|
49506
49511
|
e.preventDefault();
|
|
49507
49512
|
if (browser.IE) {
|
|
49508
49513
|
window.clipboardData.setData('Text', data);
|
|
@@ -52222,7 +52227,7 @@
|
|
|
52222
52227
|
attrs.pager = pager;
|
|
52223
52228
|
if (background.visible && !isEmpty(background.style)) {
|
|
52224
52229
|
merge$1(attrs, background.style);
|
|
52225
|
-
if (isValid$
|
|
52230
|
+
if (isValid$6(background.padding)) {
|
|
52226
52231
|
attrs.padding = background.padding;
|
|
52227
52232
|
}
|
|
52228
52233
|
}
|
|
@@ -52501,10 +52506,10 @@
|
|
|
52501
52506
|
if (!isEmpty(handler.style)) {
|
|
52502
52507
|
attrs.handlerStyle = transformToGraphic(handler.style);
|
|
52503
52508
|
}
|
|
52504
|
-
if (isValid$
|
|
52509
|
+
if (isValid$6(rail.width)) {
|
|
52505
52510
|
attrs.railWidth = rail.width;
|
|
52506
52511
|
}
|
|
52507
|
-
if (isValid$
|
|
52512
|
+
if (isValid$6(rail.height)) {
|
|
52508
52513
|
attrs.railHeight = rail.height;
|
|
52509
52514
|
}
|
|
52510
52515
|
if (!isEmpty(rail.style)) {
|
|
@@ -52521,7 +52526,7 @@
|
|
|
52521
52526
|
}
|
|
52522
52527
|
if (background.visible && !isEmpty(background.style)) {
|
|
52523
52528
|
merge$1(attrs, background.style);
|
|
52524
|
-
if (isValid$
|
|
52529
|
+
if (isValid$6(background.padding)) {
|
|
52525
52530
|
attrs.padding = background.padding;
|
|
52526
52531
|
}
|
|
52527
52532
|
}
|
|
@@ -52729,7 +52734,7 @@
|
|
|
52729
52734
|
return TABLE_EVENT_TYPE;
|
|
52730
52735
|
}
|
|
52731
52736
|
options;
|
|
52732
|
-
version = "0.
|
|
52737
|
+
version = "0.13.0-alpha.3";
|
|
52733
52738
|
pagination;
|
|
52734
52739
|
id = `VTable${Date.now()}`;
|
|
52735
52740
|
headerStyleCache;
|
|
@@ -53249,7 +53254,7 @@
|
|
|
53249
53254
|
return this.defaultColWidth;
|
|
53250
53255
|
}
|
|
53251
53256
|
getColWidth(col) {
|
|
53252
|
-
const width = this.colWidthsMap.get(col) ??
|
|
53257
|
+
const width = this.colWidthsMap.get(col) ?? this.defaultColWidth;
|
|
53253
53258
|
if ((this.widthMode === 'adaptive' && typeof width === 'number') ||
|
|
53254
53259
|
(this.transpose && typeof width === 'number')) {
|
|
53255
53260
|
return this._colWidthDefineToPxWidth(width);
|
|
@@ -54182,6 +54187,7 @@
|
|
|
54182
54187
|
else {
|
|
54183
54188
|
_setRecords(this, records);
|
|
54184
54189
|
}
|
|
54190
|
+
this.internalProps.frozenColCount = this.options.frozenColCount || this.rowHeaderLevelCount;
|
|
54185
54191
|
this.scenegraph.createSceneGraph();
|
|
54186
54192
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
54187
54193
|
this._updateSize();
|
|
@@ -61829,14 +61835,14 @@
|
|
|
61829
61835
|
this.justifyContent = options.justifyContent || 'start';
|
|
61830
61836
|
this.alignItems = options.alignItems || 'start';
|
|
61831
61837
|
this.alignContent = options.alignContent || 'start';
|
|
61832
|
-
if (isNumber$
|
|
61838
|
+
if (isNumber$6(options.width)) {
|
|
61833
61839
|
this.width = options.width;
|
|
61834
61840
|
}
|
|
61835
61841
|
else {
|
|
61836
61842
|
this._widthObj = options.width;
|
|
61837
61843
|
this.needCalcSize = true;
|
|
61838
61844
|
}
|
|
61839
|
-
if (isNumber$
|
|
61845
|
+
if (isNumber$6(options.height)) {
|
|
61840
61846
|
this.height = options.height;
|
|
61841
61847
|
}
|
|
61842
61848
|
else {
|
|
@@ -62053,7 +62059,7 @@
|
|
|
62053
62059
|
constructor(options) {
|
|
62054
62060
|
super(options);
|
|
62055
62061
|
this.iconName = options.iconName;
|
|
62056
|
-
if (isString$
|
|
62062
|
+
if (isString$3(this.iconName)) {
|
|
62057
62063
|
const regedIcons = get$1();
|
|
62058
62064
|
const cache = regedIcons[this.iconName];
|
|
62059
62065
|
if (cache) {
|
|
@@ -62440,7 +62446,7 @@
|
|
|
62440
62446
|
return new Tag(params ? params.attribute : {});
|
|
62441
62447
|
}
|
|
62442
62448
|
|
|
62443
|
-
const version = "0.
|
|
62449
|
+
const version = "0.13.0-alpha.3";
|
|
62444
62450
|
function getIcons() {
|
|
62445
62451
|
return get$1();
|
|
62446
62452
|
}
|