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.
Files changed (76) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/custom/mixin.js +1 -1
  6. package/es/table/module/filter/mixin.js +71 -56
  7. package/es/table/module/keyboard/mixin.js +3 -5
  8. package/es/table/src/body.js +3 -3
  9. package/es/table/src/footer.js +3 -3
  10. package/es/table/src/header.js +6 -6
  11. package/es/table/src/methods.js +128 -68
  12. package/es/table/src/table.js +10 -2
  13. package/es/table/src/util.js +6 -5
  14. package/es/table/style.css +1 -1
  15. package/es/table/style.min.css +1 -1
  16. package/es/ui/index.js +1 -1
  17. package/es/ui/src/dom.js +162 -0
  18. package/es/ui/src/log.js +1 -1
  19. package/es/vxe-table/style.css +1 -1
  20. package/es/vxe-table/style.min.css +1 -1
  21. package/lib/index.css +1 -1
  22. package/lib/index.min.css +1 -1
  23. package/lib/index.umd.js +321 -134
  24. package/lib/index.umd.min.js +1 -1
  25. package/lib/style.css +1 -1
  26. package/lib/style.min.css +1 -1
  27. package/lib/table/module/custom/mixin.js +1 -1
  28. package/lib/table/module/custom/mixin.min.js +1 -1
  29. package/lib/table/module/filter/mixin.js +69 -58
  30. package/lib/table/module/filter/mixin.min.js +1 -1
  31. package/lib/table/module/keyboard/mixin.js +3 -6
  32. package/lib/table/module/keyboard/mixin.min.js +1 -1
  33. package/lib/table/src/body.js +5 -4
  34. package/lib/table/src/body.min.js +1 -1
  35. package/lib/table/src/footer.js +5 -4
  36. package/lib/table/src/footer.min.js +1 -1
  37. package/lib/table/src/header.js +10 -8
  38. package/lib/table/src/header.min.js +1 -1
  39. package/lib/table/src/methods.js +46 -44
  40. package/lib/table/src/methods.min.js +1 -1
  41. package/lib/table/src/table.js +10 -2
  42. package/lib/table/src/table.min.js +1 -1
  43. package/lib/table/src/util.js +6 -5
  44. package/lib/table/src/util.min.js +1 -1
  45. package/lib/table/style/style.css +1 -1
  46. package/lib/table/style/style.min.css +1 -1
  47. package/lib/ui/index.js +1 -1
  48. package/lib/ui/index.min.js +1 -1
  49. package/lib/ui/src/dom.js +167 -0
  50. package/lib/ui/src/dom.min.js +1 -1
  51. package/lib/ui/src/log.js +1 -1
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/vxe-table/style/style.css +1 -1
  54. package/lib/vxe-table/style/style.min.css +1 -1
  55. package/package.json +2 -2
  56. package/packages/table/module/custom/mixin.ts +1 -2
  57. package/packages/table/module/filter/mixin.ts +72 -53
  58. package/packages/table/module/keyboard/mixin.ts +3 -5
  59. package/packages/table/src/body.ts +3 -3
  60. package/packages/table/src/footer.ts +3 -3
  61. package/packages/table/src/header.ts +6 -6
  62. package/packages/table/src/methods.ts +166 -80
  63. package/packages/table/src/table.ts +10 -2
  64. package/packages/table/src/util.ts +9 -6
  65. package/packages/ui/src/dom.ts +176 -0
  66. package/styles/components/table-module/filter.scss +1 -1
  67. package/styles/theme/base.scss +2 -0
  68. package/styles/theme/dark.scss +4 -4
  69. package/styles/theme/light.scss +4 -4
  70. package/styles/variable.scss +4 -4
  71. /package/es/{iconfont.1788399048088.ttf → iconfont.1788695175944.ttf} +0 -0
  72. /package/es/{iconfont.1788399048088.woff → iconfont.1788695175944.woff} +0 -0
  73. /package/es/{iconfont.1788399048088.woff2 → iconfont.1788695175944.woff2} +0 -0
  74. /package/lib/{iconfont.1788399048088.ttf → iconfont.1788695175944.ttf} +0 -0
  75. /package/lib/{iconfont.1788399048088.woff → iconfont.1788695175944.woff} +0 -0
  76. /package/lib/{iconfont.1788399048088.woff2 → iconfont.1788695175944.woff2} +0 -0
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.23.4";
3
+ export const version = "3.23.6";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/dom.js CHANGED
@@ -174,6 +174,18 @@ export function hasEventInputTarget(target) {
174
174
  const tagName = target ? target.tagName : '';
175
175
  return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()));
176
176
  }
177
+ /**
178
+ * 判断是否由内部可复用控件触发,输入框带有 vxe-reusekeep-contro
179
+ */
180
+ function hasReusekeepControl(elem) {
181
+ if (elem) {
182
+ return hasClass(elem, 'vxe-reusekeep-contro');
183
+ }
184
+ return false;
185
+ }
186
+ export function hasAxternalInputTarget(target) {
187
+ return hasEventInputTarget(target) ? !hasReusekeepControl(target) : false;
188
+ }
177
189
  const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
178
190
  const scrollIntoView = 'scrollIntoView';
179
191
  export function scrollToView(elem) {
@@ -215,6 +227,156 @@ export function wheelScrollTopTo(diffNum, cb) {
215
227
  wtaFrame = null;
216
228
  });
217
229
  }
230
+ /**
231
+ * 通用定位计算
232
+ */
233
+ export function updatePanelPlacement(targetElem, panelElem, options) {
234
+ const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
235
+ teleportTo: false,
236
+ marginSize: 18,
237
+ isMinWidth: true
238
+ }, options);
239
+ let panelPlacement = 'bottom';
240
+ let top = '';
241
+ let bottom = '';
242
+ let left = 0;
243
+ let minWidth = '';
244
+ let arrowLeft = '';
245
+ const stys = {};
246
+ if (panelElem && targetElem) {
247
+ const bodyEl = document.body;
248
+ const parentWrapperEl = getPopupWrapperElement(panelElem);
249
+ if (parentWrapperEl) {
250
+ const targetWidth = targetElem.offsetWidth;
251
+ const targetHeight = targetElem.offsetHeight;
252
+ const panelWidth = panelElem.offsetWidth;
253
+ const panelHeight = panelElem.offsetHeight;
254
+ const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
255
+ const panelRect = panelElem.getBoundingClientRect();
256
+ const targetRect = targetElem.getBoundingClientRect();
257
+ const visibleHeight = bodyEl.clientHeight;
258
+ const visibleWidth = bodyEl.clientWidth;
259
+ const offsetLeft = parentWrapperRect.left;
260
+ const offsetTop = parentWrapperRect.top;
261
+ const targetLeft = targetRect.left;
262
+ const targetTop = targetRect.top;
263
+ minWidth = targetElem.offsetWidth;
264
+ if (teleportTo) {
265
+ left = defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2);
266
+ top = defaultTop || (targetTop + targetHeight);
267
+ if (placement === 'top') {
268
+ panelPlacement = 'top';
269
+ top = targetTop - panelHeight;
270
+ }
271
+ else if (!placement) {
272
+ if (defaultPlacement === 'top') {
273
+ panelPlacement = 'top';
274
+ if (!defaultTop) {
275
+ top = targetTop - panelHeight;
276
+ }
277
+ // 如果上面不够放,则向下
278
+ if (top < marginSize) {
279
+ panelPlacement = 'bottom';
280
+ top = targetTop + targetHeight;
281
+ }
282
+ // 如果下面不够放,则向上(优先)
283
+ if (top + panelHeight + marginSize > visibleHeight) {
284
+ panelPlacement = 'top';
285
+ top = targetTop - panelHeight;
286
+ }
287
+ }
288
+ else {
289
+ // 如果下面不够放,则向上
290
+ if (top + panelHeight + marginSize > visibleHeight) {
291
+ panelPlacement = 'top';
292
+ top = targetTop - panelHeight;
293
+ }
294
+ // 如果上面不够放,则向下(优先)
295
+ if (top < marginSize) {
296
+ panelPlacement = 'bottom';
297
+ top = targetTop + targetHeight;
298
+ }
299
+ }
300
+ }
301
+ // 如果溢出右边
302
+ if (left + panelWidth + marginSize > visibleWidth) {
303
+ left -= left + panelWidth + marginSize - visibleWidth;
304
+ }
305
+ // 如果溢出左边
306
+ if (left < marginSize) {
307
+ left = marginSize;
308
+ }
309
+ // 偏移
310
+ top -= offsetTop;
311
+ left -= offsetLeft;
312
+ }
313
+ else {
314
+ if (placement === 'top') {
315
+ panelPlacement = 'top';
316
+ bottom = targetHeight;
317
+ }
318
+ else if (!placement) {
319
+ // 如果下面不够放,则向上
320
+ top = targetHeight;
321
+ if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
322
+ // 如果上面不够放,则向下(优先)
323
+ if (targetTop - targetHeight - panelHeight > marginSize) {
324
+ panelPlacement = 'top';
325
+ top = '';
326
+ bottom = targetHeight;
327
+ }
328
+ }
329
+ }
330
+ // 是否超出右侧
331
+ if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
332
+ left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
333
+ }
334
+ }
335
+ if (XEUtils.isNumber(top)) {
336
+ stys.top = toCssUnit(top);
337
+ }
338
+ if (XEUtils.isNumber(bottom)) {
339
+ stys.bottom = toCssUnit(bottom);
340
+ }
341
+ if (XEUtils.isNumber(left)) {
342
+ stys.left = toCssUnit(left);
343
+ }
344
+ if (isMinWidth && XEUtils.isNumber(minWidth)) {
345
+ stys.minWidth = toCssUnit(minWidth);
346
+ }
347
+ // 箭头
348
+ if (left === targetLeft) {
349
+ if (targetWidth <= panelWidth) {
350
+ arrowLeft = targetWidth / 2;
351
+ }
352
+ }
353
+ else if (left < targetLeft) {
354
+ if (left + panelWidth > targetLeft + targetWidth) {
355
+ arrowLeft = (targetLeft - left) + targetWidth / 2;
356
+ }
357
+ else {
358
+ arrowLeft = (targetLeft - left) + (panelWidth - (targetLeft - left)) / 2;
359
+ }
360
+ }
361
+ }
362
+ }
363
+ return {
364
+ top: top || 0,
365
+ bottom: bottom || 0,
366
+ left: left || 0,
367
+ arrowLeft: arrowLeft || 0,
368
+ style: stys,
369
+ placement: panelPlacement
370
+ };
371
+ }
372
+ export function getPopupWrapperElement(panelElem) {
373
+ if (!panelElem) {
374
+ return null;
375
+ }
376
+ const bodyEl = document.body;
377
+ const parentEl = panelElem.parentElement;
378
+ return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
379
+ }
218
380
  export function getPopupContainer(appendTo) {
219
381
  const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
220
382
  return selectElem || 'body';
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"3.23.4"}`;
3
+ const tableVersion = `table v${"3.23.6"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -1644,7 +1644,7 @@
1644
1644
  padding-top: 0.2em;
1645
1645
  }
1646
1646
  .vxe-table--filter-wrapper .vxe-table--filter-body {
1647
- max-height: 200px;
1647
+ max-height: var(--vxe-ui-vxe-table-filter-default-max-height);
1648
1648
  padding-bottom: 0.2em;
1649
1649
  }
1650
1650
  .vxe-table--filter-wrapper > ul {