vxe-table 3.23.4 → 3.23.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +1 -1
- package/es/table/module/filter/mixin.js +71 -56
- package/es/table/module/keyboard/mixin.js +3 -5
- package/es/table/src/body.js +3 -3
- package/es/table/src/footer.js +3 -3
- package/es/table/src/header.js +6 -6
- package/es/table/src/methods.js +128 -68
- package/es/table/src/table.js +10 -2
- package/es/table/src/util.js +6 -5
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +162 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +321 -134
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +1 -1
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +69 -58
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +3 -6
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +5 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +10 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +46 -44
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +10 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -5
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +167 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/mixin.ts +1 -2
- package/packages/table/module/filter/mixin.ts +72 -53
- package/packages/table/module/keyboard/mixin.ts +3 -5
- package/packages/table/src/body.ts +3 -3
- package/packages/table/src/footer.ts +3 -3
- package/packages/table/src/header.ts +6 -6
- package/packages/table/src/methods.ts +166 -80
- package/packages/table/src/table.ts +10 -2
- package/packages/table/src/util.ts +9 -6
- package/packages/ui/src/dom.ts +176 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/theme/base.scss +2 -0
- package/styles/theme/dark.scss +4 -4
- package/styles/theme/light.scss +4 -4
- package/styles/variable.scss +4 -4
- /package/es/{iconfont.1788399048088.ttf → iconfont.1788695175944.ttf} +0 -0
- /package/es/{iconfont.1788399048088.woff → iconfont.1788695175944.woff} +0 -0
- /package/es/{iconfont.1788399048088.woff2 → iconfont.1788695175944.woff2} +0 -0
- /package/lib/{iconfont.1788399048088.ttf → iconfont.1788695175944.ttf} +0 -0
- /package/lib/{iconfont.1788399048088.woff → iconfont.1788695175944.woff} +0 -0
- /package/lib/{iconfont.1788399048088.woff2 → iconfont.1788695175944.woff2} +0 -0
package/packages/ui/src/dom.ts
CHANGED
|
@@ -201,6 +201,20 @@ export function hasEventInputTarget (target: EventTarget | Element | null) {
|
|
|
201
201
|
return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()))
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
/**
|
|
205
|
+
* 判断是否由内部可复用控件触发,输入框带有 vxe-reusekeep-contro
|
|
206
|
+
*/
|
|
207
|
+
function hasReusekeepControl (elem: EventTarget | HTMLElement | null) {
|
|
208
|
+
if (elem) {
|
|
209
|
+
return hasClass(elem as HTMLElement, 'vxe-reusekeep-contro')
|
|
210
|
+
}
|
|
211
|
+
return false
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function hasAxternalInputTarget (target: EventTarget | Element | null) {
|
|
215
|
+
return hasEventInputTarget(target) ? !hasReusekeepControl(target) : false
|
|
216
|
+
}
|
|
217
|
+
|
|
204
218
|
const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded'
|
|
205
219
|
const scrollIntoView = 'scrollIntoView'
|
|
206
220
|
|
|
@@ -247,6 +261,168 @@ export function wheelScrollTopTo (diffNum: number, cb: (progress: number) => voi
|
|
|
247
261
|
})
|
|
248
262
|
}
|
|
249
263
|
|
|
264
|
+
interface PanelPlacementOptions {
|
|
265
|
+
defaultTop?: number
|
|
266
|
+
defaultLeft?: number
|
|
267
|
+
placement?: '' | 'top' | 'bottom' | null
|
|
268
|
+
defaultPlacement?: '' | 'top' | 'bottom' | null
|
|
269
|
+
teleportTo?: boolean
|
|
270
|
+
marginSize?: number
|
|
271
|
+
isMinWidth?: boolean
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* 通用定位计算
|
|
276
|
+
*/
|
|
277
|
+
export function updatePanelPlacement (targetElem: HTMLElement | null | undefined, panelElem: HTMLElement | null | undefined, options: PanelPlacementOptions) {
|
|
278
|
+
const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
279
|
+
teleportTo: false,
|
|
280
|
+
marginSize: 18,
|
|
281
|
+
isMinWidth: true
|
|
282
|
+
}, options)
|
|
283
|
+
let panelPlacement: 'top' | 'bottom' = 'bottom'
|
|
284
|
+
let top: number | '' = ''
|
|
285
|
+
let bottom: number | '' = ''
|
|
286
|
+
let left = 0
|
|
287
|
+
let minWidth: number | '' = ''
|
|
288
|
+
let arrowLeft: number | '' = ''
|
|
289
|
+
const stys: Record<string, string> = {}
|
|
290
|
+
if (panelElem && targetElem) {
|
|
291
|
+
const bodyEl = document.body
|
|
292
|
+
const parentWrapperEl = getPopupWrapperElement(panelElem)
|
|
293
|
+
if (parentWrapperEl) {
|
|
294
|
+
const targetWidth = targetElem.offsetWidth
|
|
295
|
+
const targetHeight = targetElem.offsetHeight
|
|
296
|
+
const panelWidth = panelElem.offsetWidth
|
|
297
|
+
const panelHeight = panelElem.offsetHeight
|
|
298
|
+
|
|
299
|
+
const parentWrapperRect = parentWrapperEl.getBoundingClientRect()
|
|
300
|
+
const panelRect = panelElem.getBoundingClientRect()
|
|
301
|
+
const targetRect = targetElem.getBoundingClientRect()
|
|
302
|
+
const visibleHeight = bodyEl.clientHeight
|
|
303
|
+
const visibleWidth = bodyEl.clientWidth
|
|
304
|
+
|
|
305
|
+
const offsetLeft = parentWrapperRect.left
|
|
306
|
+
const offsetTop = parentWrapperRect.top
|
|
307
|
+
const targetLeft = targetRect.left
|
|
308
|
+
const targetTop = targetRect.top
|
|
309
|
+
|
|
310
|
+
minWidth = targetElem.offsetWidth
|
|
311
|
+
|
|
312
|
+
if (teleportTo) {
|
|
313
|
+
left = defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2)
|
|
314
|
+
top = defaultTop || (targetTop + targetHeight)
|
|
315
|
+
if (placement === 'top') {
|
|
316
|
+
panelPlacement = 'top'
|
|
317
|
+
top = targetTop - panelHeight
|
|
318
|
+
} else if (!placement) {
|
|
319
|
+
if (defaultPlacement === 'top') {
|
|
320
|
+
panelPlacement = 'top'
|
|
321
|
+
if (!defaultTop) {
|
|
322
|
+
top = targetTop - panelHeight
|
|
323
|
+
}
|
|
324
|
+
// 如果上面不够放,则向下
|
|
325
|
+
if (top < marginSize) {
|
|
326
|
+
panelPlacement = 'bottom'
|
|
327
|
+
top = targetTop + targetHeight
|
|
328
|
+
}
|
|
329
|
+
// 如果下面不够放,则向上(优先)
|
|
330
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
331
|
+
panelPlacement = 'top'
|
|
332
|
+
top = targetTop - panelHeight
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
// 如果下面不够放,则向上
|
|
336
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
337
|
+
panelPlacement = 'top'
|
|
338
|
+
top = targetTop - panelHeight
|
|
339
|
+
}
|
|
340
|
+
// 如果上面不够放,则向下(优先)
|
|
341
|
+
if (top < marginSize) {
|
|
342
|
+
panelPlacement = 'bottom'
|
|
343
|
+
top = targetTop + targetHeight
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// 如果溢出右边
|
|
348
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
349
|
+
left -= left + panelWidth + marginSize - visibleWidth
|
|
350
|
+
}
|
|
351
|
+
// 如果溢出左边
|
|
352
|
+
if (left < marginSize) {
|
|
353
|
+
left = marginSize
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// 偏移
|
|
357
|
+
top -= offsetTop
|
|
358
|
+
left -= offsetLeft
|
|
359
|
+
} else {
|
|
360
|
+
if (placement === 'top') {
|
|
361
|
+
panelPlacement = 'top'
|
|
362
|
+
bottom = targetHeight
|
|
363
|
+
} else if (!placement) {
|
|
364
|
+
// 如果下面不够放,则向上
|
|
365
|
+
top = targetHeight
|
|
366
|
+
if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
367
|
+
// 如果上面不够放,则向下(优先)
|
|
368
|
+
if (targetTop - targetHeight - panelHeight > marginSize) {
|
|
369
|
+
panelPlacement = 'top'
|
|
370
|
+
top = ''
|
|
371
|
+
bottom = targetHeight
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
// 是否超出右侧
|
|
376
|
+
if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
|
|
377
|
+
left = -(panelRect.left + panelRect.width + marginSize - visibleWidth)
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (XEUtils.isNumber(top)) {
|
|
381
|
+
stys.top = toCssUnit(top)
|
|
382
|
+
}
|
|
383
|
+
if (XEUtils.isNumber(bottom)) {
|
|
384
|
+
stys.bottom = toCssUnit(bottom)
|
|
385
|
+
}
|
|
386
|
+
if (XEUtils.isNumber(left)) {
|
|
387
|
+
stys.left = toCssUnit(left)
|
|
388
|
+
}
|
|
389
|
+
if (isMinWidth && XEUtils.isNumber(minWidth)) {
|
|
390
|
+
stys.minWidth = toCssUnit(minWidth)
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// 箭头
|
|
394
|
+
if (left === targetLeft) {
|
|
395
|
+
if (targetWidth <= panelWidth) {
|
|
396
|
+
arrowLeft = targetWidth / 2
|
|
397
|
+
}
|
|
398
|
+
} else if (left < targetLeft) {
|
|
399
|
+
if (left + panelWidth > targetLeft + targetWidth) {
|
|
400
|
+
arrowLeft = (targetLeft - left) + targetWidth / 2
|
|
401
|
+
} else {
|
|
402
|
+
arrowLeft = (targetLeft - left) + (panelWidth - (targetLeft - left)) / 2
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return {
|
|
408
|
+
top: top || 0,
|
|
409
|
+
bottom: bottom || 0,
|
|
410
|
+
left: left || 0,
|
|
411
|
+
arrowLeft: arrowLeft || 0,
|
|
412
|
+
style: stys,
|
|
413
|
+
placement: panelPlacement
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export function getPopupWrapperElement (panelElem: HTMLElement | null | undefined) {
|
|
418
|
+
if (!panelElem) {
|
|
419
|
+
return null
|
|
420
|
+
}
|
|
421
|
+
const bodyEl = document.body
|
|
422
|
+
const parentEl = panelElem.parentElement
|
|
423
|
+
return (parentEl === bodyEl ? document.documentElement : parentEl) || null
|
|
424
|
+
}
|
|
425
|
+
|
|
250
426
|
export function getPopupContainer (appendTo: string | HTMLElement | ((params: any) => string | HTMLElement) | undefined) {
|
|
251
427
|
const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo
|
|
252
428
|
return selectElem || 'body'
|
package/styles/theme/base.scss
CHANGED
|
@@ -106,6 +106,8 @@
|
|
|
106
106
|
--vxe-ui-vxe-table-custom-column-header-align-width: var(--vxe-ui-vxe-table-custom-column-align-width);
|
|
107
107
|
--vxe-ui-vxe-table-custom-column-footer-align-width: var(--vxe-ui-vxe-table-custom-column-align-width);
|
|
108
108
|
|
|
109
|
+
--vxe-ui-vxe-table-filter-default-max-height: 260px;
|
|
110
|
+
|
|
109
111
|
/*toolbar*/
|
|
110
112
|
--vxe-ui-toolbar-custom-active-background-color: #D9DADB;
|
|
111
113
|
--vxe-ui-toolbar-height-xlarge: 54px;
|
package/styles/theme/dark.scss
CHANGED
|
@@ -30,10 +30,6 @@
|
|
|
30
30
|
|
|
31
31
|
/*table*/
|
|
32
32
|
--vxe-ui-table-header-background-color: #28282a;
|
|
33
|
-
--vxe-ui-table-column-to-row-background-color: #28282a;
|
|
34
|
-
--vxe-ui-table-column-hover-background-color: #242f3b;
|
|
35
|
-
--vxe-ui-table-column-current-background-color: #18222c;
|
|
36
|
-
--vxe-ui-table-column-hover-current-background-color: #242f3b;
|
|
37
33
|
--vxe-ui-table-border-color: #37373a;
|
|
38
34
|
--vxe-ui-table-row-hover-background-color: #262727;
|
|
39
35
|
--vxe-ui-table-row-striped-background-color: #1D1D1D;
|
|
@@ -44,6 +40,10 @@
|
|
|
44
40
|
--vxe-ui-table-row-hover-checkbox-checked-background-color: #6e5326;
|
|
45
41
|
--vxe-ui-table-row-current-background-color: #18222c;
|
|
46
42
|
--vxe-ui-table-row-hover-current-background-color: #242f3b;
|
|
43
|
+
--vxe-ui-table-column-to-row-background-color: #28282a;
|
|
44
|
+
--vxe-ui-table-column-hover-background-color: var(--vxe-ui-table-row-hover-background-color);
|
|
45
|
+
--vxe-ui-table-column-current-background-color: var(-vxe-ui-table-row-current-background-color);
|
|
46
|
+
--vxe-ui-table-column-hover-current-background-color: var(--vxe-ui-table-row-current-background-color);
|
|
47
47
|
--vxe-ui-table-fixed-scrolling-box-shadow-color: rgba(0, 0, 0, 0.8);
|
|
48
48
|
--vxe-ui-table-drag-over-background-color:rgba(48, 48, 0, 0.3);
|
|
49
49
|
}
|
package/styles/theme/light.scss
CHANGED
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
|
|
27
27
|
/*table*/
|
|
28
28
|
--vxe-ui-table-header-background-color: #{light_variable.$vxe-ui-table-header-background-color};
|
|
29
|
-
--vxe-ui-table-column-to-row-background-color: #{light_variable.$vxe-ui-table-column-to-row-background-color};
|
|
30
|
-
--vxe-ui-table-column-hover-background-color: #{light_variable.$vxe-ui-table-column-hover-background-color};
|
|
31
|
-
--vxe-ui-table-column-current-background-color: #{light_variable.$vxe-ui-table-column-current-background-color};
|
|
32
|
-
--vxe-ui-table-column-hover-current-background-color: #{light_variable.$vxe-ui-table-column-hover-current-background-color};
|
|
33
29
|
--vxe-ui-table-border-color: #{light_variable.$vxe-ui-table-border-color};
|
|
34
30
|
--vxe-ui-table-row-hover-background-color: #{light_variable.$vxe-ui-table-row-hover-background-color};
|
|
35
31
|
--vxe-ui-table-row-striped-background-color: #{light_variable.$vxe-ui-table-row-striped-background-color};
|
|
@@ -40,6 +36,10 @@
|
|
|
40
36
|
--vxe-ui-table-row-hover-checkbox-checked-background-color: #{light_variable.$vxe-ui-table-row-hover-checkbox-checked-background-color};
|
|
41
37
|
--vxe-ui-table-row-current-background-color: #{light_variable.$vxe-ui-table-row-current-background-color};
|
|
42
38
|
--vxe-ui-table-row-hover-current-background-color: #{light_variable.$vxe-ui-table-row-hover-current-background-color};
|
|
39
|
+
--vxe-ui-table-column-to-row-background-color: #{light_variable.$vxe-ui-table-column-to-row-background-color};
|
|
40
|
+
--vxe-ui-table-column-hover-background-color: #{light_variable.$vxe-ui-table-column-hover-background-color};
|
|
41
|
+
--vxe-ui-table-column-current-background-color: #{light_variable.$vxe-ui-table-column-current-background-color};
|
|
42
|
+
--vxe-ui-table-column-hover-current-background-color: #{light_variable.$vxe-ui-table-column-hover-current-background-color};
|
|
43
43
|
--vxe-ui-table-fixed-scrolling-box-shadow-color: #{light_variable.$vxe-ui-table-fixed-scrolling-box-shadow-color};
|
|
44
44
|
--vxe-ui-table-drag-over-background-color:#{light_variable.$vxe-ui-table-drag-over-background-color};
|
|
45
45
|
}
|
package/styles/variable.scss
CHANGED
|
@@ -25,10 +25,6 @@ $vxe-ui-loading-background-color: rgba(255, 255, 255, 0.5) !default;
|
|
|
25
25
|
|
|
26
26
|
/*table*/
|
|
27
27
|
$vxe-ui-table-header-background-color: #f8f8f9 !default;
|
|
28
|
-
$vxe-ui-table-column-to-row-background-color: #f8f8f9 !default;
|
|
29
|
-
$vxe-ui-table-column-hover-background-color: #d7effb !default;
|
|
30
|
-
$vxe-ui-table-column-current-background-color: #e6f7ff !default;
|
|
31
|
-
$vxe-ui-table-column-hover-current-background-color: #d7effb !default;
|
|
32
28
|
$vxe-ui-table-border-color: #e8eaec !default;
|
|
33
29
|
$vxe-ui-table-row-hover-background-color: #f5f7fa !default;
|
|
34
30
|
$vxe-ui-table-row-striped-background-color: #fafafa !default;
|
|
@@ -39,6 +35,10 @@ $vxe-ui-table-row-checkbox-checked-background-color: #fff3e0 !default;
|
|
|
39
35
|
$vxe-ui-table-row-hover-checkbox-checked-background-color: #ffebbc !default;
|
|
40
36
|
$vxe-ui-table-row-current-background-color: #e6f7ff !default;
|
|
41
37
|
$vxe-ui-table-row-hover-current-background-color: #d7effb !default;
|
|
38
|
+
$vxe-ui-table-column-to-row-background-color: #f8f8f9 !default;
|
|
39
|
+
$vxe-ui-table-column-hover-background-color: #eceef1 !default;
|
|
40
|
+
$vxe-ui-table-column-current-background-color: $vxe-ui-table-row-current-background-color !default;
|
|
41
|
+
$vxe-ui-table-column-hover-current-background-color: $vxe-ui-table-row-hover-current-background-color !default;
|
|
42
42
|
$vxe-ui-table-fixed-scrolling-box-shadow-color: rgba(0, 0, 0, 0.12) !default;
|
|
43
43
|
$vxe-ui-table-drag-over-background-color:rgba(255,255,200,0.3) !default;
|
|
44
44
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|