e-virt-table 1.2.16 → 1.2.18
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/dist/index.cjs.js +4 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2278 -2749
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.d.ts +4 -2
- package/dist/lib/Cell.js +7 -0
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +3 -2
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +126 -1
- package/dist/lib/Config.js +143 -14
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +2 -0
- package/dist/lib/Context.js +22 -3
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.d.ts +3 -3
- package/dist/lib/Database.js +55 -45
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/Validator.d.ts +26 -0
- package/dist/lib/Validator.js +72 -0
- package/dist/lib/Validator.js.map +1 -0
- package/dist/lib/types.d.ts +4 -10
- package/package.json +2 -3
package/dist/lib/Config.js
CHANGED
|
@@ -7,114 +7,133 @@ export default class Config {
|
|
|
7
7
|
writable: true,
|
|
8
8
|
value: {}
|
|
9
9
|
});
|
|
10
|
+
/** CSS 类名前缀 */
|
|
10
11
|
Object.defineProperty(this, "CSS_PREFIX", {
|
|
11
12
|
enumerable: true,
|
|
12
13
|
configurable: true,
|
|
13
14
|
writable: true,
|
|
14
15
|
value: 'e-virt-table'
|
|
15
16
|
});
|
|
17
|
+
/** 图标集合 */
|
|
16
18
|
Object.defineProperty(this, "ICONS", {
|
|
17
19
|
enumerable: true,
|
|
18
20
|
configurable: true,
|
|
19
21
|
writable: true,
|
|
20
22
|
value: []
|
|
21
23
|
});
|
|
24
|
+
/** 行的唯一标识键 */
|
|
22
25
|
Object.defineProperty(this, "ROW_KEY", {
|
|
23
26
|
enumerable: true,
|
|
24
27
|
configurable: true,
|
|
25
28
|
writable: true,
|
|
26
29
|
value: ''
|
|
27
30
|
});
|
|
31
|
+
/** 禁用编辑,优先等级最高 */
|
|
28
32
|
Object.defineProperty(this, "DISABLED", {
|
|
29
33
|
enumerable: true,
|
|
30
34
|
configurable: true,
|
|
31
35
|
writable: true,
|
|
32
36
|
value: false
|
|
33
|
-
});
|
|
37
|
+
});
|
|
38
|
+
/** 表头字体 */
|
|
34
39
|
Object.defineProperty(this, "HEADER_FONT", {
|
|
35
40
|
enumerable: true,
|
|
36
41
|
configurable: true,
|
|
37
42
|
writable: true,
|
|
38
43
|
value: '12px normal Arial'
|
|
39
44
|
});
|
|
45
|
+
/** 单元格字体 */
|
|
40
46
|
Object.defineProperty(this, "BODY_FONT", {
|
|
41
47
|
enumerable: true,
|
|
42
48
|
configurable: true,
|
|
43
49
|
writable: true,
|
|
44
50
|
value: '12px normal Arial'
|
|
45
51
|
});
|
|
52
|
+
/** 边框 */
|
|
46
53
|
Object.defineProperty(this, "BORDER", {
|
|
47
54
|
enumerable: true,
|
|
48
55
|
configurable: true,
|
|
49
56
|
writable: true,
|
|
50
57
|
value: true
|
|
51
58
|
});
|
|
59
|
+
/** 斑马纹 */
|
|
52
60
|
Object.defineProperty(this, "STRIPE", {
|
|
53
61
|
enumerable: true,
|
|
54
62
|
configurable: true,
|
|
55
63
|
writable: true,
|
|
56
64
|
value: false
|
|
57
|
-
});
|
|
65
|
+
});
|
|
66
|
+
/** 斑马纹颜色 */
|
|
58
67
|
Object.defineProperty(this, "STRIPE_COLOR", {
|
|
59
68
|
enumerable: true,
|
|
60
69
|
configurable: true,
|
|
61
70
|
writable: true,
|
|
62
71
|
value: '#fafafa'
|
|
63
|
-
});
|
|
72
|
+
});
|
|
73
|
+
/** 区域边框颜色 */
|
|
64
74
|
Object.defineProperty(this, "BORDER_COLOR", {
|
|
65
75
|
enumerable: true,
|
|
66
76
|
configurable: true,
|
|
67
77
|
writable: true,
|
|
68
78
|
value: '#e1e6eb'
|
|
69
79
|
});
|
|
80
|
+
/** 宽度为 0 表示自适应100% */
|
|
70
81
|
Object.defineProperty(this, "WIDTH", {
|
|
71
82
|
enumerable: true,
|
|
72
83
|
configurable: true,
|
|
73
84
|
writable: true,
|
|
74
85
|
value: 0
|
|
75
86
|
});
|
|
87
|
+
/** 最小可调整宽度 */
|
|
76
88
|
Object.defineProperty(this, "RESIZE_MIN_WIDTH", {
|
|
77
89
|
enumerable: true,
|
|
78
90
|
configurable: true,
|
|
79
91
|
writable: true,
|
|
80
92
|
value: 40
|
|
81
93
|
});
|
|
94
|
+
/** 高度,为 0 表示自适应 */
|
|
82
95
|
Object.defineProperty(this, "HEIGHT", {
|
|
83
96
|
enumerable: true,
|
|
84
97
|
configurable: true,
|
|
85
98
|
writable: true,
|
|
86
99
|
value: 0
|
|
87
100
|
});
|
|
101
|
+
/** 占位文本颜色 */
|
|
88
102
|
Object.defineProperty(this, "PLACEHOLDER_COLOR", {
|
|
89
103
|
enumerable: true,
|
|
90
104
|
configurable: true,
|
|
91
105
|
writable: true,
|
|
92
106
|
value: '#CDD0DC'
|
|
93
107
|
});
|
|
108
|
+
/** 空数据 body 高度 */
|
|
94
109
|
Object.defineProperty(this, "EMPTY_BODY_HEIGHT", {
|
|
95
110
|
enumerable: true,
|
|
96
111
|
configurable: true,
|
|
97
112
|
writable: true,
|
|
98
113
|
value: 120
|
|
99
114
|
});
|
|
115
|
+
/** 自定义空样式 */
|
|
100
116
|
Object.defineProperty(this, "EMPTY_CUSTOM_STYLE", {
|
|
101
117
|
enumerable: true,
|
|
102
118
|
configurable: true,
|
|
103
119
|
writable: true,
|
|
104
120
|
value: {}
|
|
105
121
|
});
|
|
122
|
+
/** 空数据文本 */
|
|
106
123
|
Object.defineProperty(this, "EMPTY_TEXT", {
|
|
107
124
|
enumerable: true,
|
|
108
125
|
configurable: true,
|
|
109
126
|
writable: true,
|
|
110
127
|
value: '暂无数据'
|
|
111
128
|
});
|
|
129
|
+
/** 最大高度,为 0 表示自适应高度根据 HEIGHT */
|
|
112
130
|
Object.defineProperty(this, "MAX_HEIGHT", {
|
|
113
131
|
enumerable: true,
|
|
114
132
|
configurable: true,
|
|
115
133
|
writable: true,
|
|
116
134
|
value: 1000
|
|
117
135
|
});
|
|
136
|
+
/** 区域边框圆角 */
|
|
118
137
|
Object.defineProperty(this, "BORDER_RADIUS", {
|
|
119
138
|
enumerable: true,
|
|
120
139
|
configurable: true,
|
|
@@ -139,66 +158,77 @@ export default class Config {
|
|
|
139
158
|
writable: true,
|
|
140
159
|
value: 36
|
|
141
160
|
});
|
|
161
|
+
/** 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素 */
|
|
142
162
|
Object.defineProperty(this, "ENABLE_HEADER_STICKY", {
|
|
143
163
|
enumerable: true,
|
|
144
164
|
configurable: true,
|
|
145
165
|
writable: true,
|
|
146
166
|
value: false
|
|
147
|
-
});
|
|
167
|
+
});
|
|
168
|
+
/** 表头背景色 */
|
|
148
169
|
Object.defineProperty(this, "HEADER_BG_COLOR", {
|
|
149
170
|
enumerable: true,
|
|
150
171
|
configurable: true,
|
|
151
172
|
writable: true,
|
|
152
173
|
value: '#F8FAFF'
|
|
153
174
|
});
|
|
175
|
+
/** body 背景色 */
|
|
154
176
|
Object.defineProperty(this, "BODY_BG_COLOR", {
|
|
155
177
|
enumerable: true,
|
|
156
178
|
configurable: true,
|
|
157
179
|
writable: true,
|
|
158
180
|
value: '#FFF'
|
|
159
181
|
});
|
|
182
|
+
/** 表头文本颜色 */
|
|
160
183
|
Object.defineProperty(this, "HEADER_TEXT_COLOR", {
|
|
161
184
|
enumerable: true,
|
|
162
185
|
configurable: true,
|
|
163
186
|
writable: true,
|
|
164
187
|
value: '#1D2129'
|
|
165
188
|
});
|
|
189
|
+
/** body文本颜色 */
|
|
166
190
|
Object.defineProperty(this, "BODY_TEXT_COLOR", {
|
|
167
191
|
enumerable: true,
|
|
168
192
|
configurable: true,
|
|
169
193
|
writable: true,
|
|
170
194
|
value: '#4E5969'
|
|
171
195
|
});
|
|
196
|
+
/** footer文本颜色 */
|
|
172
197
|
Object.defineProperty(this, "FOOTER_TEXT_COLOR", {
|
|
173
198
|
enumerable: true,
|
|
174
199
|
configurable: true,
|
|
175
200
|
writable: true,
|
|
176
201
|
value: '#4E5969'
|
|
177
202
|
});
|
|
203
|
+
/** 加载 svg 图标 */
|
|
178
204
|
Object.defineProperty(this, "LOADING_ICON_SVG", {
|
|
179
205
|
enumerable: true,
|
|
180
206
|
configurable: true,
|
|
181
207
|
writable: true,
|
|
182
208
|
value: ''
|
|
183
209
|
});
|
|
210
|
+
/** 加载 svg 图标颜色 */
|
|
184
211
|
Object.defineProperty(this, "LOADING_ICON_COLOR", {
|
|
185
212
|
enumerable: true,
|
|
186
213
|
configurable: true,
|
|
187
214
|
writable: true,
|
|
188
215
|
value: '#4E5969'
|
|
189
216
|
});
|
|
217
|
+
/** 树形展开svg 图标 */
|
|
190
218
|
Object.defineProperty(this, "EXPAND_ICON_SVG", {
|
|
191
219
|
enumerable: true,
|
|
192
220
|
configurable: true,
|
|
193
221
|
writable: true,
|
|
194
222
|
value: ''
|
|
195
223
|
});
|
|
224
|
+
/** 树形收缩svg 图标 */
|
|
196
225
|
Object.defineProperty(this, "SHRINK_ICON_SVG", {
|
|
197
226
|
enumerable: true,
|
|
198
227
|
configurable: true,
|
|
199
228
|
writable: true,
|
|
200
229
|
value: ''
|
|
201
230
|
});
|
|
231
|
+
/** 展开图标颜色 */
|
|
202
232
|
Object.defineProperty(this, "EXPAND_ICON_COLOR", {
|
|
203
233
|
enumerable: true,
|
|
204
234
|
configurable: true,
|
|
@@ -211,372 +241,441 @@ export default class Config {
|
|
|
211
241
|
writable: true,
|
|
212
242
|
value: '#4E5969'
|
|
213
243
|
});
|
|
244
|
+
/** 错误提示颜色 */
|
|
214
245
|
Object.defineProperty(this, "ERROR_TIP_ICON_COLOR", {
|
|
215
246
|
enumerable: true,
|
|
216
247
|
configurable: true,
|
|
217
248
|
writable: true,
|
|
218
249
|
value: 'red'
|
|
219
250
|
});
|
|
251
|
+
/** 错误提示图标大小 */
|
|
220
252
|
Object.defineProperty(this, "ERROR_TIP_ICON_SIZE", {
|
|
221
253
|
enumerable: true,
|
|
222
254
|
configurable: true,
|
|
223
255
|
writable: true,
|
|
224
256
|
value: 6
|
|
225
257
|
});
|
|
258
|
+
/** 是否开启懒加载 */
|
|
226
259
|
Object.defineProperty(this, "EXPAND_LAZY", {
|
|
227
260
|
enumerable: true,
|
|
228
261
|
configurable: true,
|
|
229
262
|
writable: true,
|
|
230
263
|
value: true
|
|
231
264
|
});
|
|
265
|
+
/** 默认展开全部 */
|
|
232
266
|
Object.defineProperty(this, "DEFAULT_EXPAND_ALL", {
|
|
233
267
|
enumerable: true,
|
|
234
268
|
configurable: true,
|
|
235
269
|
writable: true,
|
|
236
270
|
value: false
|
|
237
271
|
});
|
|
272
|
+
/** 表格 body 部分的宽度 */
|
|
238
273
|
Object.defineProperty(this, "CELL_WIDTH", {
|
|
239
274
|
enumerable: true,
|
|
240
275
|
configurable: true,
|
|
241
276
|
writable: true,
|
|
242
277
|
value: 100
|
|
243
278
|
});
|
|
279
|
+
/** body 单元格默认行高 */
|
|
244
280
|
Object.defineProperty(this, "CELL_HEIGHT", {
|
|
245
281
|
enumerable: true,
|
|
246
282
|
configurable: true,
|
|
247
283
|
writable: true,
|
|
248
284
|
value: 36
|
|
249
285
|
});
|
|
286
|
+
/** 表格 body 部分的 padding */
|
|
250
287
|
Object.defineProperty(this, "CELL_PADDING", {
|
|
251
288
|
enumerable: true,
|
|
252
289
|
configurable: true,
|
|
253
290
|
writable: true,
|
|
254
291
|
value: 8
|
|
255
292
|
});
|
|
293
|
+
/** hover编辑图标大小 */
|
|
256
294
|
Object.defineProperty(this, "CELL_HOVER_ICON_SIZE", {
|
|
257
295
|
enumerable: true,
|
|
258
296
|
configurable: true,
|
|
259
297
|
writable: true,
|
|
260
298
|
value: 14
|
|
261
299
|
});
|
|
300
|
+
/** hover编辑图标背景色 */
|
|
262
301
|
Object.defineProperty(this, "CELL_HOVER_ICON_BG_COLOR", {
|
|
263
302
|
enumerable: true,
|
|
264
303
|
configurable: true,
|
|
265
304
|
writable: true,
|
|
266
305
|
value: '#fff'
|
|
267
306
|
});
|
|
307
|
+
/** hover编辑图标边框颜色 */
|
|
268
308
|
Object.defineProperty(this, "CELL_HOVER_ICON_BORDER_COLOR", {
|
|
269
309
|
enumerable: true,
|
|
270
310
|
configurable: true,
|
|
271
311
|
writable: true,
|
|
272
312
|
value: '#DDE0EA'
|
|
273
313
|
});
|
|
314
|
+
/** 滚动条轨道尺寸 */
|
|
274
315
|
Object.defineProperty(this, "SCROLLER_TRACK_SIZE", {
|
|
275
316
|
enumerable: true,
|
|
276
317
|
configurable: true,
|
|
277
318
|
writable: true,
|
|
278
319
|
value: 14
|
|
279
320
|
});
|
|
321
|
+
/** 滚动条滑块尺寸 */
|
|
280
322
|
Object.defineProperty(this, "SCROLLER_SIZE", {
|
|
281
323
|
enumerable: true,
|
|
282
324
|
configurable: true,
|
|
283
325
|
writable: true,
|
|
284
326
|
value: 8
|
|
285
327
|
});
|
|
328
|
+
/** 滚动条滑块颜色 */
|
|
286
329
|
Object.defineProperty(this, "SCROLLER_COLOR", {
|
|
287
330
|
enumerable: true,
|
|
288
331
|
configurable: true,
|
|
289
332
|
writable: true,
|
|
290
333
|
value: '#dee0e3'
|
|
291
334
|
});
|
|
335
|
+
/** 轨道颜色 */
|
|
292
336
|
Object.defineProperty(this, "SCROLLER_TRACK_COLOR", {
|
|
293
337
|
enumerable: true,
|
|
294
338
|
configurable: true,
|
|
295
339
|
writable: true,
|
|
296
340
|
value: '#fff'
|
|
297
341
|
});
|
|
342
|
+
/** 滚动条滑块聚焦时的颜色 */
|
|
298
343
|
Object.defineProperty(this, "SCROLLER_FOCUS_COLOR", {
|
|
299
344
|
enumerable: true,
|
|
300
345
|
configurable: true,
|
|
301
346
|
writable: true,
|
|
302
347
|
value: '#bbbec4'
|
|
303
348
|
});
|
|
349
|
+
/** 选中区域边框颜色 */
|
|
304
350
|
Object.defineProperty(this, "SELECT_BORDER_COLOR", {
|
|
305
351
|
enumerable: true,
|
|
306
352
|
configurable: true,
|
|
307
353
|
writable: true,
|
|
308
354
|
value: 'rgb(82,146,247)'
|
|
309
355
|
});
|
|
356
|
+
/** 选中区域背景颜色 */
|
|
310
357
|
Object.defineProperty(this, "SELECT_AREA_COLOR", {
|
|
311
358
|
enumerable: true,
|
|
312
359
|
configurable: true,
|
|
313
360
|
writable: true,
|
|
314
361
|
value: 'rgba(82,146,247,0.1)'
|
|
315
362
|
});
|
|
363
|
+
/** 当前焦点单元格所在行、列的背景色 */
|
|
316
364
|
Object.defineProperty(this, "SELECT_ROW_COL_BG_COLOR", {
|
|
317
365
|
enumerable: true,
|
|
318
366
|
configurable: true,
|
|
319
367
|
writable: true,
|
|
320
368
|
value: 'transparent'
|
|
321
369
|
});
|
|
370
|
+
/** 填充点的边框颜色 */
|
|
322
371
|
Object.defineProperty(this, "AUTOFILL_POINT_BORDER_COLOR", {
|
|
323
372
|
enumerable: true,
|
|
324
373
|
configurable: true,
|
|
325
374
|
writable: true,
|
|
326
375
|
value: '#fff'
|
|
327
376
|
});
|
|
377
|
+
/** 可编辑背景色 */
|
|
328
378
|
Object.defineProperty(this, "EDIT_BG_COLOR", {
|
|
329
379
|
enumerable: true,
|
|
330
380
|
configurable: true,
|
|
331
381
|
writable: true,
|
|
332
382
|
value: '#fcf6ed'
|
|
333
383
|
});
|
|
384
|
+
/** 选择 key,合并时用 */
|
|
334
385
|
Object.defineProperty(this, "CHECKBOX_KEY", {
|
|
335
386
|
enumerable: true,
|
|
336
387
|
configurable: true,
|
|
337
388
|
writable: true,
|
|
338
389
|
value: ''
|
|
339
390
|
});
|
|
391
|
+
/** 选择框颜色 */
|
|
340
392
|
Object.defineProperty(this, "CHECKBOX_COLOR", {
|
|
341
393
|
enumerable: true,
|
|
342
394
|
configurable: true,
|
|
343
395
|
writable: true,
|
|
344
396
|
value: 'rgb(82,146,247)'
|
|
345
397
|
});
|
|
398
|
+
/** 选择框大小 */
|
|
346
399
|
Object.defineProperty(this, "CHECKBOX_SIZE", {
|
|
347
400
|
enumerable: true,
|
|
348
401
|
configurable: true,
|
|
349
402
|
writable: true,
|
|
350
403
|
value: 20
|
|
351
404
|
});
|
|
405
|
+
/** 选择框禁用图标 */
|
|
352
406
|
Object.defineProperty(this, "CHECKBOX_DISABLED_SVG", {
|
|
353
407
|
enumerable: true,
|
|
354
408
|
configurable: true,
|
|
355
409
|
writable: true,
|
|
356
410
|
value: ''
|
|
357
411
|
});
|
|
412
|
+
/** 选择框选中图标 */
|
|
358
413
|
Object.defineProperty(this, "CHECKBOX_CHECK_SVG", {
|
|
359
414
|
enumerable: true,
|
|
360
415
|
configurable: true,
|
|
361
416
|
writable: true,
|
|
362
417
|
value: ''
|
|
363
418
|
});
|
|
419
|
+
/** 选择框未中图标 */
|
|
364
420
|
Object.defineProperty(this, "CHECKBOX_UNCHECK_SVG", {
|
|
365
421
|
enumerable: true,
|
|
366
422
|
configurable: true,
|
|
367
423
|
writable: true,
|
|
368
424
|
value: ''
|
|
369
425
|
});
|
|
426
|
+
/** 选择框半选中图标 */
|
|
370
427
|
Object.defineProperty(this, "CHECKBOX_INDETERMINATE_SVG", {
|
|
371
428
|
enumerable: true,
|
|
372
429
|
configurable: true,
|
|
373
430
|
writable: true,
|
|
374
431
|
value: ''
|
|
375
432
|
});
|
|
433
|
+
/** 单元格只读背景色 */
|
|
376
434
|
Object.defineProperty(this, "READONLY_COLOR", {
|
|
377
435
|
enumerable: true,
|
|
378
436
|
configurable: true,
|
|
379
437
|
writable: true,
|
|
380
438
|
value: '#fff'
|
|
381
439
|
});
|
|
440
|
+
/** 单元格只读文本颜色 */
|
|
382
441
|
Object.defineProperty(this, "READONLY_TEXT_COLOR", {
|
|
383
442
|
enumerable: true,
|
|
384
443
|
configurable: true,
|
|
385
444
|
writable: true,
|
|
386
445
|
value: '#4E5969'
|
|
387
446
|
});
|
|
447
|
+
/** 单元格错误提示文本颜色 */
|
|
388
448
|
Object.defineProperty(this, "ERROR_TIP_COLOR", {
|
|
389
449
|
enumerable: true,
|
|
390
450
|
configurable: true,
|
|
391
451
|
writable: true,
|
|
392
452
|
value: '#ED3F14'
|
|
393
453
|
});
|
|
454
|
+
/** 合计底部背景色 */
|
|
394
455
|
Object.defineProperty(this, "FOOTER_BG_COLOR", {
|
|
395
456
|
enumerable: true,
|
|
396
457
|
configurable: true,
|
|
397
458
|
writable: true,
|
|
398
459
|
value: '#fafafa'
|
|
399
460
|
});
|
|
461
|
+
/** 合计底部固定 */
|
|
400
462
|
Object.defineProperty(this, "FOOTER_FIXED", {
|
|
401
463
|
enumerable: true,
|
|
402
464
|
configurable: true,
|
|
403
465
|
writable: true,
|
|
404
466
|
value: true
|
|
405
467
|
});
|
|
468
|
+
/** 合计底部位置 */
|
|
406
469
|
Object.defineProperty(this, "FOOTER_POSITION", {
|
|
407
470
|
enumerable: true,
|
|
408
471
|
configurable: true,
|
|
409
472
|
writable: true,
|
|
410
473
|
value: 'bottom'
|
|
411
474
|
});
|
|
475
|
+
/** 单元格底部高度 */
|
|
412
476
|
Object.defineProperty(this, "CELL_FOOTER_HEIGHT", {
|
|
413
477
|
enumerable: true,
|
|
414
478
|
configurable: true,
|
|
415
479
|
writable: true,
|
|
416
480
|
value: 36
|
|
417
481
|
});
|
|
482
|
+
/** 启用选择器 */
|
|
418
483
|
Object.defineProperty(this, "ENABLE_SELECTOR", {
|
|
419
484
|
enumerable: true,
|
|
420
485
|
configurable: true,
|
|
421
486
|
writable: true,
|
|
422
487
|
value: true
|
|
423
488
|
});
|
|
489
|
+
/** 启用单点击立马编辑 */
|
|
424
490
|
Object.defineProperty(this, "ENABLE_EDIT_SINGLE_CLICK", {
|
|
425
491
|
enumerable: true,
|
|
426
492
|
configurable: true,
|
|
427
493
|
writable: true,
|
|
428
494
|
value: false
|
|
429
|
-
});
|
|
495
|
+
});
|
|
496
|
+
/** 启用点击选择器编辑 */
|
|
430
497
|
Object.defineProperty(this, "ENABLE_EDIT_CLICK_SELECTOR", {
|
|
431
498
|
enumerable: true,
|
|
432
499
|
configurable: true,
|
|
433
500
|
writable: true,
|
|
434
501
|
value: true
|
|
435
|
-
});
|
|
502
|
+
});
|
|
503
|
+
/** 选择器X最小范围 */
|
|
436
504
|
Object.defineProperty(this, "SELECTOR_AREA_MIN_X", {
|
|
437
505
|
enumerable: true,
|
|
438
506
|
configurable: true,
|
|
439
507
|
writable: true,
|
|
440
508
|
value: 0
|
|
441
|
-
});
|
|
509
|
+
});
|
|
510
|
+
/** 选择器X最大范围colMax - offset */
|
|
442
511
|
Object.defineProperty(this, "SELECTOR_AREA_MAX_X_OFFSET", {
|
|
443
512
|
enumerable: true,
|
|
444
513
|
configurable: true,
|
|
445
514
|
writable: true,
|
|
446
515
|
value: 0
|
|
447
|
-
});
|
|
516
|
+
});
|
|
517
|
+
/** 选择器X最大范围,0默认最大colMax */
|
|
448
518
|
Object.defineProperty(this, "SELECTOR_AREA_MAX_X", {
|
|
449
519
|
enumerable: true,
|
|
450
520
|
configurable: true,
|
|
451
521
|
writable: true,
|
|
452
522
|
value: 0
|
|
453
|
-
});
|
|
523
|
+
});
|
|
524
|
+
/** 选择器Y最小范围 */
|
|
454
525
|
Object.defineProperty(this, "SELECTOR_AREA_MIN_Y", {
|
|
455
526
|
enumerable: true,
|
|
456
527
|
configurable: true,
|
|
457
528
|
writable: true,
|
|
458
529
|
value: 0
|
|
459
|
-
});
|
|
530
|
+
});
|
|
531
|
+
/** 选择器Y最大范围,0默认rowMax */
|
|
460
532
|
Object.defineProperty(this, "SELECTOR_AREA_MAX_Y", {
|
|
461
533
|
enumerable: true,
|
|
462
534
|
configurable: true,
|
|
463
535
|
writable: true,
|
|
464
536
|
value: 0
|
|
465
|
-
});
|
|
537
|
+
});
|
|
538
|
+
/** 选择器Y最大范围,0默认rowMax */
|
|
466
539
|
Object.defineProperty(this, "SELECTOR_AREA_MAX_Y_OFFSET", {
|
|
467
540
|
enumerable: true,
|
|
468
541
|
configurable: true,
|
|
469
542
|
writable: true,
|
|
470
543
|
value: 0
|
|
471
|
-
});
|
|
544
|
+
});
|
|
545
|
+
/** 选择器值类型,value,displayText,区别displayText受format影响 */
|
|
546
|
+
Object.defineProperty(this, "SELECTOR_CELL_VALUE_TYPE", {
|
|
547
|
+
enumerable: true,
|
|
548
|
+
configurable: true,
|
|
549
|
+
writable: true,
|
|
550
|
+
value: 'value'
|
|
551
|
+
}); // displayText | value
|
|
552
|
+
/** 启用自动主题 */
|
|
472
553
|
Object.defineProperty(this, "ENABLE_AUTO_THEME", {
|
|
473
554
|
enumerable: true,
|
|
474
555
|
configurable: true,
|
|
475
556
|
writable: true,
|
|
476
557
|
value: true
|
|
477
558
|
});
|
|
559
|
+
/** 启用选择器-选择器单选 */
|
|
478
560
|
Object.defineProperty(this, "ENABLE_SELECTOR_SINGLE", {
|
|
479
561
|
enumerable: true,
|
|
480
562
|
configurable: true,
|
|
481
563
|
writable: true,
|
|
482
564
|
value: false
|
|
483
565
|
});
|
|
566
|
+
/** 启用选择器-批量跨列选择 */
|
|
484
567
|
Object.defineProperty(this, "ENABLE_SELECTOR_SPAN_COL", {
|
|
485
568
|
enumerable: true,
|
|
486
569
|
configurable: true,
|
|
487
570
|
writable: true,
|
|
488
571
|
value: true
|
|
489
572
|
});
|
|
573
|
+
/** 启用选择器-批量跨行选择 */
|
|
490
574
|
Object.defineProperty(this, "ENABLE_SELECTOR_SPAN_ROW", {
|
|
491
575
|
enumerable: true,
|
|
492
576
|
configurable: true,
|
|
493
577
|
writable: true,
|
|
494
578
|
value: true
|
|
495
579
|
});
|
|
580
|
+
/** 启用选择器-批量选中列 */
|
|
496
581
|
Object.defineProperty(this, "ENABLE_SELECTOR_ALL_ROWS", {
|
|
497
582
|
enumerable: true,
|
|
498
583
|
configurable: true,
|
|
499
584
|
writable: true,
|
|
500
585
|
value: true
|
|
501
586
|
});
|
|
587
|
+
/** 启用选择器-批量选中行 */
|
|
502
588
|
Object.defineProperty(this, "ENABLE_SELECTOR_ALL_COLS", {
|
|
503
589
|
enumerable: true,
|
|
504
590
|
configurable: true,
|
|
505
591
|
writable: true,
|
|
506
592
|
value: true
|
|
507
593
|
});
|
|
594
|
+
/** 启用合并格子数据关联 */
|
|
508
595
|
Object.defineProperty(this, "ENABLE_MERGE_CELL_LINK", {
|
|
509
596
|
enumerable: true,
|
|
510
597
|
configurable: true,
|
|
511
598
|
writable: true,
|
|
512
599
|
value: false
|
|
513
|
-
});
|
|
600
|
+
});
|
|
601
|
+
/** 启用填充器 */
|
|
514
602
|
Object.defineProperty(this, "ENABLE_AUTOFILL", {
|
|
515
603
|
enumerable: true,
|
|
516
604
|
configurable: true,
|
|
517
605
|
writable: true,
|
|
518
606
|
value: false
|
|
519
607
|
});
|
|
608
|
+
/** 启用右键菜单 */
|
|
520
609
|
Object.defineProperty(this, "ENABLE_CONTEXT_MENU", {
|
|
521
610
|
enumerable: true,
|
|
522
611
|
configurable: true,
|
|
523
612
|
writable: true,
|
|
524
613
|
value: false
|
|
525
614
|
});
|
|
615
|
+
/** 启用复制 */
|
|
526
616
|
Object.defineProperty(this, "ENABLE_COPY", {
|
|
527
617
|
enumerable: true,
|
|
528
618
|
configurable: true,
|
|
529
619
|
writable: true,
|
|
530
620
|
value: true
|
|
531
621
|
});
|
|
622
|
+
/** 启用粘贴 */
|
|
532
623
|
Object.defineProperty(this, "ENABLE_PASTER", {
|
|
533
624
|
enumerable: true,
|
|
534
625
|
configurable: true,
|
|
535
626
|
writable: true,
|
|
536
627
|
value: true
|
|
537
628
|
});
|
|
629
|
+
/** 启用调整行高 */
|
|
538
630
|
Object.defineProperty(this, "ENABLE_RESIZE_ROW", {
|
|
539
631
|
enumerable: true,
|
|
540
632
|
configurable: true,
|
|
541
633
|
writable: true,
|
|
542
634
|
value: true
|
|
543
635
|
});
|
|
636
|
+
/** 启用列宽可调整 */
|
|
544
637
|
Object.defineProperty(this, "ENABLE_RESIZE_COLUMN", {
|
|
545
638
|
enumerable: true,
|
|
546
639
|
configurable: true,
|
|
547
640
|
writable: true,
|
|
548
641
|
value: true
|
|
549
642
|
});
|
|
643
|
+
/** 行调整线颜色 */
|
|
550
644
|
Object.defineProperty(this, "RESIZE_ROW_LINE_COLOR", {
|
|
551
645
|
enumerable: true,
|
|
552
646
|
configurable: true,
|
|
553
647
|
writable: true,
|
|
554
648
|
value: '#e1e6eb'
|
|
555
649
|
});
|
|
650
|
+
/** 列调整线颜色 */
|
|
556
651
|
Object.defineProperty(this, "RESIZE_COLUMN_LINE_COLOR", {
|
|
557
652
|
enumerable: true,
|
|
558
653
|
configurable: true,
|
|
559
654
|
writable: true,
|
|
560
655
|
value: '#e1e6eb'
|
|
561
656
|
});
|
|
657
|
+
/** 最小调整行高 */
|
|
562
658
|
Object.defineProperty(this, "RESIZE_ROW_MIN_HEIGHT", {
|
|
563
659
|
enumerable: true,
|
|
564
660
|
configurable: true,
|
|
565
661
|
writable: true,
|
|
566
662
|
value: 36
|
|
567
663
|
});
|
|
664
|
+
/** 列宽最小值 */
|
|
568
665
|
Object.defineProperty(this, "RESIZE_COLUMN_MIN_WIDTH", {
|
|
569
666
|
enumerable: true,
|
|
570
667
|
configurable: true,
|
|
571
668
|
writable: true,
|
|
572
669
|
value: 40
|
|
573
670
|
});
|
|
671
|
+
/** 启用键盘 */
|
|
574
672
|
Object.defineProperty(this, "ENABLE_KEYBOARD", {
|
|
575
673
|
enumerable: true,
|
|
576
674
|
configurable: true,
|
|
577
675
|
writable: true,
|
|
578
676
|
value: true
|
|
579
677
|
});
|
|
678
|
+
/** 启用历史 */
|
|
580
679
|
Object.defineProperty(this, "ENABLE_HISTORY", {
|
|
581
680
|
enumerable: true,
|
|
582
681
|
configurable: true,
|
|
@@ -589,60 +688,70 @@ export default class Config {
|
|
|
589
688
|
writable: true,
|
|
590
689
|
value: true
|
|
591
690
|
});
|
|
691
|
+
/** 历史栈数量 */
|
|
592
692
|
Object.defineProperty(this, "HISTORY_NUM", {
|
|
593
693
|
enumerable: true,
|
|
594
694
|
configurable: true,
|
|
595
695
|
writable: true,
|
|
596
696
|
value: 50
|
|
597
697
|
});
|
|
698
|
+
/** 启用悬浮高亮 */
|
|
598
699
|
Object.defineProperty(this, "HIGHLIGHT_HOVER_ROW", {
|
|
599
700
|
enumerable: true,
|
|
600
701
|
configurable: true,
|
|
601
702
|
writable: true,
|
|
602
703
|
value: false
|
|
603
704
|
});
|
|
705
|
+
/** 悬浮颜色 */
|
|
604
706
|
Object.defineProperty(this, "HIGHLIGHT_HOVER_ROW_COLOR", {
|
|
605
707
|
enumerable: true,
|
|
606
708
|
configurable: true,
|
|
607
709
|
writable: true,
|
|
608
710
|
value: 'rgba(186,203,231,0.1)'
|
|
609
711
|
});
|
|
712
|
+
/** 高亮选中当前行 */
|
|
610
713
|
Object.defineProperty(this, "HIGHLIGHT_SELECTED_ROW", {
|
|
611
714
|
enumerable: true,
|
|
612
715
|
configurable: true,
|
|
613
716
|
writable: true,
|
|
614
717
|
value: false
|
|
615
718
|
});
|
|
719
|
+
/** 高亮当前行颜色 */
|
|
616
720
|
Object.defineProperty(this, "HIGHLIGHT_SELECTED_ROW_COLOR", {
|
|
617
721
|
enumerable: true,
|
|
618
722
|
configurable: true,
|
|
619
723
|
writable: true,
|
|
620
724
|
value: 'rgba(82,146,247,0.1)'
|
|
621
725
|
});
|
|
726
|
+
/** 提示背景颜色 */
|
|
622
727
|
Object.defineProperty(this, "TOOLTIP_BG_COLOR", {
|
|
623
728
|
enumerable: true,
|
|
624
729
|
configurable: true,
|
|
625
730
|
writable: true,
|
|
626
731
|
value: '#303133'
|
|
627
732
|
});
|
|
733
|
+
/** 提示文本颜色 */
|
|
628
734
|
Object.defineProperty(this, "TOOLTIP_TEXT_COLOR", {
|
|
629
735
|
enumerable: true,
|
|
630
736
|
configurable: true,
|
|
631
737
|
writable: true,
|
|
632
738
|
value: '#fff'
|
|
633
739
|
});
|
|
740
|
+
/** 提示层级 */
|
|
634
741
|
Object.defineProperty(this, "TOOLTIP_ZINDEX", {
|
|
635
742
|
enumerable: true,
|
|
636
743
|
configurable: true,
|
|
637
744
|
writable: true,
|
|
638
745
|
value: 3000
|
|
639
746
|
});
|
|
747
|
+
/** 自定义提示样式 */
|
|
640
748
|
Object.defineProperty(this, "TOOLTIP_CUSTOM_STYLE", {
|
|
641
749
|
enumerable: true,
|
|
642
750
|
configurable: true,
|
|
643
751
|
writable: true,
|
|
644
752
|
value: {}
|
|
645
753
|
});
|
|
754
|
+
/** 自定义右键菜单 */
|
|
646
755
|
Object.defineProperty(this, "CONTEXT_MENU", {
|
|
647
756
|
enumerable: true,
|
|
648
757
|
configurable: true,
|
|
@@ -654,114 +763,133 @@ export default class Config {
|
|
|
654
763
|
{ label: '清空选中内容', value: 'clearSelected' },
|
|
655
764
|
]
|
|
656
765
|
});
|
|
766
|
+
/** header 格子样式 */
|
|
657
767
|
Object.defineProperty(this, "HEADER_CELL_STYLE_METHOD", {
|
|
658
768
|
enumerable: true,
|
|
659
769
|
configurable: true,
|
|
660
770
|
writable: true,
|
|
661
771
|
value: void 0
|
|
662
772
|
});
|
|
773
|
+
/** body 格子样式 */
|
|
663
774
|
Object.defineProperty(this, "BODY_CELL_STYLE_METHOD", {
|
|
664
775
|
enumerable: true,
|
|
665
776
|
configurable: true,
|
|
666
777
|
writable: true,
|
|
667
778
|
value: void 0
|
|
668
779
|
});
|
|
780
|
+
/** footer 格子样式 */
|
|
669
781
|
Object.defineProperty(this, "FOOTER_CELL_STYLE_METHOD", {
|
|
670
782
|
enumerable: true,
|
|
671
783
|
configurable: true,
|
|
672
784
|
writable: true,
|
|
673
785
|
value: void 0
|
|
674
786
|
});
|
|
787
|
+
/** 自定义只读 */
|
|
675
788
|
Object.defineProperty(this, "BODY_CELL_READONLY_METHOD", {
|
|
676
789
|
enumerable: true,
|
|
677
790
|
configurable: true,
|
|
678
791
|
writable: true,
|
|
679
792
|
value: void 0
|
|
680
793
|
});
|
|
794
|
+
/** 格式化方法更改(formatter优先等级比较高) */
|
|
681
795
|
Object.defineProperty(this, "BODY_CELL_FORMATTER_METHOD", {
|
|
682
796
|
enumerable: true,
|
|
683
797
|
configurable: true,
|
|
684
798
|
writable: true,
|
|
685
799
|
value: void 0
|
|
686
800
|
});
|
|
801
|
+
/** 自定义校验规则 */
|
|
687
802
|
Object.defineProperty(this, "BODY_CELL_RULES_METHOD", {
|
|
688
803
|
enumerable: true,
|
|
689
804
|
configurable: true,
|
|
690
805
|
writable: true,
|
|
691
806
|
value: void 0
|
|
692
807
|
});
|
|
808
|
+
/** 自定义只读 */
|
|
693
809
|
Object.defineProperty(this, "BODY_CELL_TYPE_METHOD", {
|
|
694
810
|
enumerable: true,
|
|
695
811
|
configurable: true,
|
|
696
812
|
writable: true,
|
|
697
813
|
value: void 0
|
|
698
814
|
});
|
|
815
|
+
/** 自定义编辑器类型 */
|
|
699
816
|
Object.defineProperty(this, "BODY_CELL_EDITOR_METHOD", {
|
|
700
817
|
enumerable: true,
|
|
701
818
|
configurable: true,
|
|
702
819
|
writable: true,
|
|
703
820
|
value: void 0
|
|
704
821
|
});
|
|
822
|
+
/** 自定义只读 */
|
|
705
823
|
Object.defineProperty(this, "BODY_CELL_RENDER_METHOD", {
|
|
706
824
|
enumerable: true,
|
|
707
825
|
configurable: true,
|
|
708
826
|
writable: true,
|
|
709
827
|
value: void 0
|
|
710
828
|
});
|
|
829
|
+
/** 自定义只读 */
|
|
711
830
|
Object.defineProperty(this, "BODY_CELL_HOVER_ICON_METHOD", {
|
|
712
831
|
enumerable: true,
|
|
713
832
|
configurable: true,
|
|
714
833
|
writable: true,
|
|
715
834
|
value: void 0
|
|
716
835
|
});
|
|
836
|
+
/** 自定义跨列/行渲染 */
|
|
717
837
|
Object.defineProperty(this, "SPAN_METHOD", {
|
|
718
838
|
enumerable: true,
|
|
719
839
|
configurable: true,
|
|
720
840
|
writable: true,
|
|
721
841
|
value: void 0
|
|
722
842
|
});
|
|
843
|
+
/** 自定义选择禁用 */
|
|
723
844
|
Object.defineProperty(this, "SELECTABLE_METHOD", {
|
|
724
845
|
enumerable: true,
|
|
725
846
|
configurable: true,
|
|
726
847
|
writable: true,
|
|
727
848
|
value: void 0
|
|
728
849
|
});
|
|
850
|
+
/** 自定义选择禁用 */
|
|
729
851
|
Object.defineProperty(this, "EXPAND_LAZY_METHOD", {
|
|
730
852
|
enumerable: true,
|
|
731
853
|
configurable: true,
|
|
732
854
|
writable: true,
|
|
733
855
|
value: void 0
|
|
734
856
|
});
|
|
857
|
+
/** 数值改变前回调 */
|
|
735
858
|
Object.defineProperty(this, "BEFORE_VALUE_CHANGE_METHOD", {
|
|
736
859
|
enumerable: true,
|
|
737
860
|
configurable: true,
|
|
738
861
|
writable: true,
|
|
739
862
|
value: void 0
|
|
740
863
|
});
|
|
864
|
+
/** 粘贴前回调 */
|
|
741
865
|
Object.defineProperty(this, "BEFORE_PASTE_DATA_METHOD", {
|
|
742
866
|
enumerable: true,
|
|
743
867
|
configurable: true,
|
|
744
868
|
writable: true,
|
|
745
869
|
value: void 0
|
|
746
870
|
});
|
|
871
|
+
/** 数值填充前回调 */
|
|
747
872
|
Object.defineProperty(this, "BEFORE_AUTOFILL_DATA_METHOD", {
|
|
748
873
|
enumerable: true,
|
|
749
874
|
configurable: true,
|
|
750
875
|
writable: true,
|
|
751
876
|
value: void 0
|
|
752
877
|
});
|
|
878
|
+
/** 设置选择器前回调 */
|
|
753
879
|
Object.defineProperty(this, "BEFORE_SET_SELECTOR_METHOD", {
|
|
754
880
|
enumerable: true,
|
|
755
881
|
configurable: true,
|
|
756
882
|
writable: true,
|
|
757
883
|
value: void 0
|
|
758
884
|
});
|
|
885
|
+
/** 设置填充器前回调 */
|
|
759
886
|
Object.defineProperty(this, "BEFORE_SET_AUTOFILL_METHOD", {
|
|
760
887
|
enumerable: true,
|
|
761
888
|
configurable: true,
|
|
762
889
|
writable: true,
|
|
763
890
|
value: void 0
|
|
764
891
|
});
|
|
892
|
+
/** 数据复制前回调 */
|
|
765
893
|
Object.defineProperty(this, "BEFORE_COPY_METHOD", {
|
|
766
894
|
enumerable: true,
|
|
767
895
|
configurable: true,
|
|
@@ -771,11 +899,12 @@ export default class Config {
|
|
|
771
899
|
this._config = config;
|
|
772
900
|
this.updateCssVar();
|
|
773
901
|
}
|
|
902
|
+
/** 初始化 */
|
|
774
903
|
init(config) {
|
|
775
904
|
this._config = config;
|
|
776
905
|
this.updateCssVar();
|
|
777
906
|
}
|
|
778
|
-
|
|
907
|
+
/** 同步css 样式变量 */
|
|
779
908
|
updateCssVar() {
|
|
780
909
|
let obj = {};
|
|
781
910
|
Object.keys(this).forEach((key) => {
|