@koi-design/uxd-ui 14.0.13 → 14.0.14

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 (63) hide show
  1. package/es/components/Table/BaseTable.mjs +4 -1
  2. package/es/components/Table/BaseTable.mjs.map +1 -1
  3. package/es/components/Table/BaseTable.vue.d.ts +18 -2
  4. package/es/components/Table/BodyTable.vue.d.ts +18 -2
  5. package/es/components/Table/HeadTable.vue.d.ts +18 -2
  6. package/es/components/Table/Table.mjs +6 -2
  7. package/es/components/Table/Table.mjs.map +1 -1
  8. package/es/components/Table/Table.type.d.ts +2 -0
  9. package/es/components/Table/Table.type.mjs.map +1 -1
  10. package/es/components/Table/Table.vue.d.ts +36 -4
  11. package/es/components/Table/TableBox.vue.d.ts +36 -4
  12. package/es/components/Table/hooks/useTableResize.d.ts +2 -0
  13. package/es/components/Table/hooks/useTableResize.mjs +8 -1
  14. package/es/components/Table/hooks/useTableResize.mjs.map +1 -1
  15. package/es/components/Table/tableUnits/ColGroup.mjs +14 -3
  16. package/es/components/Table/tableUnits/ColGroup.mjs.map +1 -1
  17. package/es/components/Table/tableUnits/ColGroup.vue.d.ts +10 -0
  18. package/es/components/Table/tableUnits/ExpandRows.vue.d.ts +4 -1
  19. package/es/components/Table/tableUnits/TableBody.vue.d.ts +8 -2
  20. package/es/components/Table/tableUnits/TableCell.mjs +6 -4
  21. package/es/components/Table/tableUnits/TableCell.mjs.map +1 -1
  22. package/es/components/Table/tableUnits/TableCell.vue.d.ts +4 -1
  23. package/es/components/Table/tableUnits/TableRow.vue.d.ts +4 -1
  24. package/lib/components/Table/BaseTable.js +4 -1
  25. package/lib/components/Table/BaseTable.js.map +1 -1
  26. package/lib/components/Table/BaseTable.vue.d.ts +18 -2
  27. package/lib/components/Table/BodyTable.vue.d.ts +18 -2
  28. package/lib/components/Table/HeadTable.vue.d.ts +18 -2
  29. package/lib/components/Table/Table.js +6 -2
  30. package/lib/components/Table/Table.js.map +1 -1
  31. package/lib/components/Table/Table.type.d.ts +2 -0
  32. package/lib/components/Table/Table.type.js.map +1 -1
  33. package/lib/components/Table/Table.vue.d.ts +36 -4
  34. package/lib/components/Table/TableBox.vue.d.ts +36 -4
  35. package/lib/components/Table/hooks/useTableResize.d.ts +2 -0
  36. package/lib/components/Table/hooks/useTableResize.js +8 -1
  37. package/lib/components/Table/hooks/useTableResize.js.map +1 -1
  38. package/lib/components/Table/tableUnits/ColGroup.js +14 -3
  39. package/lib/components/Table/tableUnits/ColGroup.js.map +1 -1
  40. package/lib/components/Table/tableUnits/ColGroup.vue.d.ts +10 -0
  41. package/lib/components/Table/tableUnits/ExpandRows.vue.d.ts +4 -1
  42. package/lib/components/Table/tableUnits/TableBody.vue.d.ts +8 -2
  43. package/lib/components/Table/tableUnits/TableCell.js +6 -4
  44. package/lib/components/Table/tableUnits/TableCell.js.map +1 -1
  45. package/lib/components/Table/tableUnits/TableCell.vue.d.ts +4 -1
  46. package/lib/components/Table/tableUnits/TableRow.vue.d.ts +4 -1
  47. package/package.json +1 -1
  48. package/types/components/Table/BaseTable.vue.d.ts +18 -2
  49. package/types/components/Table/BodyTable.vue.d.ts +18 -2
  50. package/types/components/Table/HeadTable.vue.d.ts +18 -2
  51. package/types/components/Table/Table.type.d.ts +2 -0
  52. package/types/components/Table/Table.vue.d.ts +36 -4
  53. package/types/components/Table/TableBox.vue.d.ts +36 -4
  54. package/types/components/Table/hooks/useTableResize.d.ts +2 -0
  55. package/types/components/Table/tableUnits/ColGroup.vue.d.ts +10 -0
  56. package/types/components/Table/tableUnits/ExpandRows.vue.d.ts +4 -1
  57. package/types/components/Table/tableUnits/TableBody.vue.d.ts +8 -2
  58. package/types/components/Table/tableUnits/TableCell.vue.d.ts +4 -1
  59. package/types/components/Table/tableUnits/TableRow.vue.d.ts +4 -1
  60. package/uxd-ui.esm.min.mjs +6 -6
  61. package/uxd-ui.esm.mjs +39 -11
  62. package/uxd-ui.umd.js +39 -11
  63. package/uxd-ui.umd.min.js +6 -6
package/uxd-ui.esm.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @koi-design/uxd-ui@4.0.13 */
1
+ /*! @koi-design/uxd-ui@4.0.14 */
2
2
 
3
3
  import { defineComponent, reactive, watch, provide, inject, computed, onMounted, ref, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, renderSlot, withDirectives, vShow, createBlock, resolveDynamicComponent, createCommentVNode, toRaw, resolveComponent, Transition, withCtx, createVNode, toDisplayString, isVNode, Comment as Comment$1, Fragment, Text as Text$1, h, shallowRef, toRef, nextTick, onUpdated, onUnmounted, cloneVNode, Teleport, toRefs, withModifiers, mergeProps, renderList, onBeforeUpdate, createTextVNode, createStaticVNode, watchEffect, onActivated, onDeactivated, normalizeProps, guardReactiveProps, withKeys, TransitionGroup, createApp, onBeforeMount, unref } from 'vue';
4
4
  import { X, Terminal, CircleAlert, Info, CircleCheck, LoaderCircle, CircleX, Search, Eye, EyeOff, Check, CornerDownLeft, ChevronUp, ChevronDown, ChevronRight, MenuIcon, Minus, ChevronLeft, CheckIcon, ChevronsLeft, ChevronsRight, Calendar as Calendar$1, ZoomIn, ZoomOut, RotateCcw, RotateCw, PanelLeft, PanelRight, Image as Image$2, CheckCircle, XCircle, Star as Star$1, XIcon, FilterIcon, GripVertical, Plus, Clock, FileIcon, HelpCircle, CircleHelp, AlertCircle, SearchIcon } from 'lucide-vue-next';
@@ -32101,11 +32101,15 @@ const _sfc_main$L = defineComponent({
32101
32101
  columns: {
32102
32102
  type: Array,
32103
32103
  default: () => []
32104
+ },
32105
+ isHeadTable: {
32106
+ type: Boolean,
32107
+ default: false
32104
32108
  }
32105
32109
  },
32106
32110
  setup(props) {
32107
32111
  const {
32108
- size: { resizeColumns }
32112
+ size: { resizeColumns, columnWidths }
32109
32113
  } = inject("tableContext", {});
32110
32114
  const cols = computed(() => {
32111
32115
  let rst = [];
@@ -32126,8 +32130,15 @@ const _sfc_main$L = defineComponent({
32126
32130
  );
32127
32131
  return rst;
32128
32132
  });
32133
+ const getWidth = (col) => {
32134
+ if (props.isHeadTable) {
32135
+ return `${columnWidths.value[col.key]}px`;
32136
+ }
32137
+ return col.resizeWidth ? col.resizeWidth : col.width;
32138
+ };
32129
32139
  return {
32130
- cols
32140
+ cols,
32141
+ getWidth
32131
32142
  };
32132
32143
  }
32133
32144
  });
@@ -32136,7 +32147,7 @@ function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
32136
32147
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.cols, (col) => {
32137
32148
  return openBlock(), createElementBlock("col", {
32138
32149
  key: col.key,
32139
- style: normalizeStyle({ width: col.resizeWidth ? col.resizeWidth : col.width, minWidth: col.minWidth, maxWidth: col.fixed ? col.width : "" })
32150
+ style: normalizeStyle({ width: _ctx.getWidth(col), minWidth: col.minWidth, maxWidth: col.fixed ? col.width : "" })
32140
32151
  }, null, 4);
32141
32152
  }), 128))
32142
32153
  ]);
@@ -32361,6 +32372,7 @@ function getWidth(width, tableWidth) {
32361
32372
  function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, props) {
32362
32373
  const tableWidth = ref(void 0);
32363
32374
  const resizeColumns = shallowRef([]);
32375
+ const columnWidths = ref({});
32364
32376
  const syncColumnsWidth = () => {
32365
32377
  const { bodyTable } = tableRefs;
32366
32378
  if (!bodyTable || bodyTable.getWidth() === void 0) {
@@ -32378,6 +32390,9 @@ function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, pro
32378
32390
  tableWidth.value = void 0;
32379
32391
  }
32380
32392
  };
32393
+ const syncColumnWidth = (width, column) => {
32394
+ columnWidths.value[getColumnKey(column)] = width;
32395
+ };
32381
32396
  let syncHeightTimer = null;
32382
32397
  const scrollPosition = ref("left");
32383
32398
  const setScrollPositionClass = () => {
@@ -32416,6 +32431,7 @@ function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, pro
32416
32431
  _column.width = width;
32417
32432
  }
32418
32433
  resizeColumns.value = columns;
32434
+ syncColumnWidth(width, _column);
32419
32435
  };
32420
32436
  const isScrollX = computed(() => {
32421
32437
  const { table } = tableRefs;
@@ -32449,7 +32465,9 @@ function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, pro
32449
32465
  setScrollPositionClass,
32450
32466
  resetScrollX,
32451
32467
  clearResizeTimer,
32452
- setResizeWidth
32468
+ setResizeWidth,
32469
+ syncColumnWidth,
32470
+ columnWidths
32453
32471
  };
32454
32472
  }
32455
32473
 
@@ -32968,6 +32986,7 @@ const _sfc_main$G = defineComponent({
32968
32986
  props: { indentSize },
32969
32987
  expand: { handleExpandChange, isRowExpanded },
32970
32988
  filterAndSorter: { hasAction, hasSorters, hasFilters, isSortColumn },
32989
+ size: { syncColumnWidth },
32971
32990
  pagination
32972
32991
  } = inject("tableContext", {});
32973
32992
  const cellRef = ref();
@@ -33055,8 +33074,10 @@ const _sfc_main$G = defineComponent({
33055
33074
  }
33056
33075
  }
33057
33076
  });
33077
+ if (props.index === 0) {
33078
+ syncColumnWidth(width, props.column);
33079
+ }
33058
33080
  };
33059
- const debouncedHandleResize = debounce$2((args) => checkWidth(args), 100);
33060
33081
  return {
33061
33082
  tablePrefixCls,
33062
33083
  isRender,
@@ -33077,7 +33098,7 @@ const _sfc_main$G = defineComponent({
33077
33098
  cellRef,
33078
33099
  ellipsisSpanRef,
33079
33100
  isOverflow,
33080
- debouncedHandleResize
33101
+ checkWidth
33081
33102
  };
33082
33103
  }
33083
33104
  });
@@ -33088,7 +33109,7 @@ function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
33088
33109
  const _component_Render = resolveComponent("Render");
33089
33110
  const _component_UTooltip = resolveComponent("UTooltip");
33090
33111
  const _component_ResizeObserver = resolveComponent("ResizeObserver");
33091
- return openBlock(), createBlock(_component_ResizeObserver, { onResize: _ctx.debouncedHandleResize }, {
33112
+ return openBlock(), createBlock(_component_ResizeObserver, { onResize: _ctx.checkWidth }, {
33092
33113
  default: withCtx(() => {
33093
33114
  var _a;
33094
33115
  return [
@@ -33740,7 +33761,10 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
33740
33761
  ref: "tableRef",
33741
33762
  style: normalizeStyle(_ctx.tableStyle)
33742
33763
  }, [
33743
- createVNode(_component_ColGroup, { columns: _ctx.columns }, null, 8, ["columns"]),
33764
+ createVNode(_component_ColGroup, {
33765
+ columns: _ctx.columns,
33766
+ "is-head-table": !_ctx.showBody
33767
+ }, null, 8, ["columns", "is-head-table"]),
33744
33768
  _ctx.showHeader ? (openBlock(), createBlock(_component_TableHeader, {
33745
33769
  key: 0,
33746
33770
  columns: _ctx.getColumns()
@@ -35342,7 +35366,9 @@ const _sfc_main$u = defineComponent({
35342
35366
  tableWidth,
35343
35367
  resizeColumns,
35344
35368
  clearResizeTimer,
35345
- setResizeWidth
35369
+ setResizeWidth,
35370
+ syncColumnWidth,
35371
+ columnWidths
35346
35372
  } = useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, props);
35347
35373
  const debouncedHandleResize = debounce$2(handleResize, 150);
35348
35374
  onMounted(() => {
@@ -35460,7 +35486,9 @@ const _sfc_main$u = defineComponent({
35460
35486
  isScrollX,
35461
35487
  setResizeWidth,
35462
35488
  handleColumnResize,
35463
- debouncedHandleResize
35489
+ debouncedHandleResize,
35490
+ syncColumnWidth,
35491
+ columnWidths
35464
35492
  },
35465
35493
  fixed: {
35466
35494
  isColumnFixed,
package/uxd-ui.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @koi-design/uxd-ui@4.0.13 */
1
+ /*! @koi-design/uxd-ui@4.0.14 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lucide-vue-next')) :
@@ -32104,11 +32104,15 @@
32104
32104
  columns: {
32105
32105
  type: Array,
32106
32106
  default: () => []
32107
+ },
32108
+ isHeadTable: {
32109
+ type: Boolean,
32110
+ default: false
32107
32111
  }
32108
32112
  },
32109
32113
  setup(props) {
32110
32114
  const {
32111
- size: { resizeColumns }
32115
+ size: { resizeColumns, columnWidths }
32112
32116
  } = vue.inject("tableContext", {});
32113
32117
  const cols = vue.computed(() => {
32114
32118
  let rst = [];
@@ -32129,8 +32133,15 @@
32129
32133
  );
32130
32134
  return rst;
32131
32135
  });
32136
+ const getWidth = (col) => {
32137
+ if (props.isHeadTable) {
32138
+ return `${columnWidths.value[col.key]}px`;
32139
+ }
32140
+ return col.resizeWidth ? col.resizeWidth : col.width;
32141
+ };
32132
32142
  return {
32133
- cols
32143
+ cols,
32144
+ getWidth
32134
32145
  };
32135
32146
  }
32136
32147
  });
@@ -32139,7 +32150,7 @@
32139
32150
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.cols, (col) => {
32140
32151
  return vue.openBlock(), vue.createElementBlock("col", {
32141
32152
  key: col.key,
32142
- style: vue.normalizeStyle({ width: col.resizeWidth ? col.resizeWidth : col.width, minWidth: col.minWidth, maxWidth: col.fixed ? col.width : "" })
32153
+ style: vue.normalizeStyle({ width: _ctx.getWidth(col), minWidth: col.minWidth, maxWidth: col.fixed ? col.width : "" })
32143
32154
  }, null, 4);
32144
32155
  }), 128))
32145
32156
  ]);
@@ -32364,6 +32375,7 @@
32364
32375
  function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, props) {
32365
32376
  const tableWidth = vue.ref(void 0);
32366
32377
  const resizeColumns = vue.shallowRef([]);
32378
+ const columnWidths = vue.ref({});
32367
32379
  const syncColumnsWidth = () => {
32368
32380
  const { bodyTable } = tableRefs;
32369
32381
  if (!bodyTable || bodyTable.getWidth() === void 0) {
@@ -32381,6 +32393,9 @@
32381
32393
  tableWidth.value = void 0;
32382
32394
  }
32383
32395
  };
32396
+ const syncColumnWidth = (width, column) => {
32397
+ columnWidths.value[getColumnKey(column)] = width;
32398
+ };
32384
32399
  let syncHeightTimer = null;
32385
32400
  const scrollPosition = vue.ref("left");
32386
32401
  const setScrollPositionClass = () => {
@@ -32419,6 +32434,7 @@
32419
32434
  _column.width = width;
32420
32435
  }
32421
32436
  resizeColumns.value = columns;
32437
+ syncColumnWidth(width, _column);
32422
32438
  };
32423
32439
  const isScrollX = vue.computed(() => {
32424
32440
  const { table } = tableRefs;
@@ -32452,7 +32468,9 @@
32452
32468
  setScrollPositionClass,
32453
32469
  resetScrollX,
32454
32470
  clearResizeTimer,
32455
- setResizeWidth
32471
+ setResizeWidth,
32472
+ syncColumnWidth,
32473
+ columnWidths
32456
32474
  };
32457
32475
  }
32458
32476
 
@@ -32971,6 +32989,7 @@
32971
32989
  props: { indentSize },
32972
32990
  expand: { handleExpandChange, isRowExpanded },
32973
32991
  filterAndSorter: { hasAction, hasSorters, hasFilters, isSortColumn },
32992
+ size: { syncColumnWidth },
32974
32993
  pagination
32975
32994
  } = vue.inject("tableContext", {});
32976
32995
  const cellRef = vue.ref();
@@ -33058,8 +33077,10 @@
33058
33077
  }
33059
33078
  }
33060
33079
  });
33080
+ if (props.index === 0) {
33081
+ syncColumnWidth(width, props.column);
33082
+ }
33061
33083
  };
33062
- const debouncedHandleResize = debounce$2((args) => checkWidth(args), 100);
33063
33084
  return {
33064
33085
  tablePrefixCls,
33065
33086
  isRender,
@@ -33080,7 +33101,7 @@
33080
33101
  cellRef,
33081
33102
  ellipsisSpanRef,
33082
33103
  isOverflow,
33083
- debouncedHandleResize
33104
+ checkWidth
33084
33105
  };
33085
33106
  }
33086
33107
  });
@@ -33091,7 +33112,7 @@
33091
33112
  const _component_Render = vue.resolveComponent("Render");
33092
33113
  const _component_UTooltip = vue.resolveComponent("UTooltip");
33093
33114
  const _component_ResizeObserver = vue.resolveComponent("ResizeObserver");
33094
- return vue.openBlock(), vue.createBlock(_component_ResizeObserver, { onResize: _ctx.debouncedHandleResize }, {
33115
+ return vue.openBlock(), vue.createBlock(_component_ResizeObserver, { onResize: _ctx.checkWidth }, {
33095
33116
  default: vue.withCtx(() => {
33096
33117
  var _a;
33097
33118
  return [
@@ -33743,7 +33764,10 @@
33743
33764
  ref: "tableRef",
33744
33765
  style: vue.normalizeStyle(_ctx.tableStyle)
33745
33766
  }, [
33746
- vue.createVNode(_component_ColGroup, { columns: _ctx.columns }, null, 8, ["columns"]),
33767
+ vue.createVNode(_component_ColGroup, {
33768
+ columns: _ctx.columns,
33769
+ "is-head-table": !_ctx.showBody
33770
+ }, null, 8, ["columns", "is-head-table"]),
33747
33771
  _ctx.showHeader ? (vue.openBlock(), vue.createBlock(_component_TableHeader, {
33748
33772
  key: 0,
33749
33773
  columns: _ctx.getColumns()
@@ -35345,7 +35369,9 @@
35345
35369
  tableWidth,
35346
35370
  resizeColumns,
35347
35371
  clearResizeTimer,
35348
- setResizeWidth
35372
+ setResizeWidth,
35373
+ syncColumnWidth,
35374
+ columnWidths
35349
35375
  } = useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, props);
35350
35376
  const debouncedHandleResize = debounce$2(handleResize, 150);
35351
35377
  vue.onMounted(() => {
@@ -35463,7 +35489,9 @@
35463
35489
  isScrollX,
35464
35490
  setResizeWidth,
35465
35491
  handleColumnResize,
35466
- debouncedHandleResize
35492
+ debouncedHandleResize,
35493
+ syncColumnWidth,
35494
+ columnWidths
35467
35495
  },
35468
35496
  fixed: {
35469
35497
  isColumnFixed,