@koi-design/uxd-ui 14.0.4 → 14.0.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 (146) hide show
  1. package/es/components/Calendar/Calendar.vue.d.ts +15 -0
  2. package/es/components/Calendar/Header.vue.d.ts +15 -0
  3. package/es/components/Calendar/index.d.ts +30 -0
  4. package/es/components/Radio/Radio.mjs +5 -4
  5. package/es/components/Radio/Radio.mjs.map +1 -1
  6. package/es/components/Radio/Radio.type.d.ts +4 -0
  7. package/es/components/Radio/Radio.type.mjs +4 -0
  8. package/es/components/Radio/Radio.type.mjs.map +1 -1
  9. package/es/components/Radio/Radio.vue.d.ts +9 -0
  10. package/es/components/Radio/index.d.ts +15 -0
  11. package/es/components/Table/BaseTable.mjs +20 -6
  12. package/es/components/Table/BaseTable.mjs.map +1 -1
  13. package/es/components/Table/BaseTable.vue.d.ts +44 -9
  14. package/es/components/Table/BodyTable.vue.d.ts +44 -9
  15. package/es/components/Table/HeadTable.vue.d.ts +44 -9
  16. package/es/components/Table/Table.mjs +8 -9
  17. package/es/components/Table/Table.mjs.map +1 -1
  18. package/es/components/Table/Table.type.d.ts +7 -5
  19. package/es/components/Table/Table.type.mjs.map +1 -1
  20. package/es/components/Table/Table.vue.d.ts +88 -18
  21. package/es/components/Table/TableBox.vue.d.ts +88 -18
  22. package/es/components/Table/hooks/useTableResize.d.ts +1 -1
  23. package/es/components/Table/hooks/useTableResize.mjs +13 -71
  24. package/es/components/Table/hooks/useTableResize.mjs.map +1 -1
  25. package/es/components/Table/tableUnits/ColGroup.mjs +8 -5
  26. package/es/components/Table/tableUnits/ColGroup.mjs.map +1 -1
  27. package/es/components/Table/tableUnits/ExpandIcon.mjs +2 -2
  28. package/es/components/Table/tableUnits/ExpandIcon.mjs.map +1 -1
  29. package/es/components/Table/tableUnits/ExpandIcon.vue.d.ts +3 -3
  30. package/es/components/Table/tableUnits/ExpandRows.mjs.map +1 -1
  31. package/es/components/Table/tableUnits/ExpandRows.vue.d.ts +21 -3
  32. package/es/components/Table/tableUnits/SelectionBox.vue.d.ts +15 -0
  33. package/es/components/Table/tableUnits/TableBody.vue.d.ts +42 -6
  34. package/es/components/Table/tableUnits/TableCell.mjs +108 -95
  35. package/es/components/Table/tableUnits/TableCell.mjs.map +1 -1
  36. package/es/components/Table/tableUnits/TableCell.vue.d.ts +21 -3
  37. package/es/components/Table/tableUnits/TableRow.vue.d.ts +21 -3
  38. package/es/components/Tabs/TabNav.mjs +4 -5
  39. package/es/components/Tabs/TabNav.mjs.map +1 -1
  40. package/es/components/Tabs/TabNav.vue.d.ts +1 -1
  41. package/es/components/Tabs/Tabs.d.ts +1 -1
  42. package/es/components/Tabs/index.d.ts +3 -3
  43. package/es/components/base/ResizeObserver.mjs +1 -1
  44. package/es/components/base/ResizeObserver.mjs.map +1 -1
  45. package/lib/components/Calendar/Calendar.vue.d.ts +15 -0
  46. package/lib/components/Calendar/Header.vue.d.ts +15 -0
  47. package/lib/components/Calendar/index.d.ts +30 -0
  48. package/lib/components/Radio/Radio.js +4 -3
  49. package/lib/components/Radio/Radio.js.map +1 -1
  50. package/lib/components/Radio/Radio.type.d.ts +4 -0
  51. package/lib/components/Radio/Radio.type.js +4 -0
  52. package/lib/components/Radio/Radio.type.js.map +1 -1
  53. package/lib/components/Radio/Radio.vue.d.ts +9 -0
  54. package/lib/components/Radio/index.d.ts +15 -0
  55. package/lib/components/Table/BaseTable.js +20 -6
  56. package/lib/components/Table/BaseTable.js.map +1 -1
  57. package/lib/components/Table/BaseTable.vue.d.ts +44 -9
  58. package/lib/components/Table/BodyTable.vue.d.ts +44 -9
  59. package/lib/components/Table/HeadTable.vue.d.ts +44 -9
  60. package/lib/components/Table/Table.js +7 -8
  61. package/lib/components/Table/Table.js.map +1 -1
  62. package/lib/components/Table/Table.type.d.ts +7 -5
  63. package/lib/components/Table/Table.type.js.map +1 -1
  64. package/lib/components/Table/Table.vue.d.ts +88 -18
  65. package/lib/components/Table/TableBox.vue.d.ts +88 -18
  66. package/lib/components/Table/hooks/useTableResize.d.ts +1 -1
  67. package/lib/components/Table/hooks/useTableResize.js +11 -69
  68. package/lib/components/Table/hooks/useTableResize.js.map +1 -1
  69. package/lib/components/Table/tableUnits/ColGroup.js +8 -5
  70. package/lib/components/Table/tableUnits/ColGroup.js.map +1 -1
  71. package/lib/components/Table/tableUnits/ExpandIcon.js +1 -1
  72. package/lib/components/Table/tableUnits/ExpandIcon.js.map +1 -1
  73. package/lib/components/Table/tableUnits/ExpandIcon.vue.d.ts +3 -3
  74. package/lib/components/Table/tableUnits/ExpandRows.js.map +1 -1
  75. package/lib/components/Table/tableUnits/ExpandRows.vue.d.ts +21 -3
  76. package/lib/components/Table/tableUnits/SelectionBox.vue.d.ts +15 -0
  77. package/lib/components/Table/tableUnits/TableBody.vue.d.ts +42 -6
  78. package/lib/components/Table/tableUnits/TableCell.js +107 -94
  79. package/lib/components/Table/tableUnits/TableCell.js.map +1 -1
  80. package/lib/components/Table/tableUnits/TableCell.vue.d.ts +21 -3
  81. package/lib/components/Table/tableUnits/TableRow.vue.d.ts +21 -3
  82. package/lib/components/Tabs/TabNav.js +3 -4
  83. package/lib/components/Tabs/TabNav.js.map +1 -1
  84. package/lib/components/Tabs/TabNav.vue.d.ts +1 -1
  85. package/lib/components/Tabs/Tabs.d.ts +1 -1
  86. package/lib/components/Tabs/index.d.ts +3 -3
  87. package/lib/components/base/ResizeObserver.js +1 -1
  88. package/lib/components/base/ResizeObserver.js.map +1 -1
  89. package/package.json +1 -1
  90. package/styles/components/alert/index.css +1 -1
  91. package/styles/components/autoComplete/index.css +1 -1
  92. package/styles/components/avatar/index.css +1 -1
  93. package/styles/components/button/index.css +1 -1
  94. package/styles/components/carousel/index.css +1 -1
  95. package/styles/components/cascader/index.css +1 -1
  96. package/styles/components/datePicker/index.css +1 -1
  97. package/styles/components/dropdown/index.css +1 -1
  98. package/styles/components/dropdown/index.less +2 -3
  99. package/styles/components/form/index.css +1 -1
  100. package/styles/components/icon/index.css +1 -1
  101. package/styles/components/input/index.css +1 -1
  102. package/styles/components/inputNumber/index.css +1 -1
  103. package/styles/components/link/index.css +1 -1
  104. package/styles/components/mentions/index.css +1 -1
  105. package/styles/components/modal/index.css +1 -1
  106. package/styles/components/select/index.css +1 -1
  107. package/styles/components/spin/index.css +1 -1
  108. package/styles/components/table/index.css +1 -1
  109. package/styles/components/table/index.less +106 -242
  110. package/styles/components/table/var.less +16 -31
  111. package/styles/components/tabs/borderCard.less +23 -27
  112. package/styles/components/tabs/card.less +18 -37
  113. package/styles/components/tabs/index.css +1 -1
  114. package/styles/components/tabs/index.less +103 -72
  115. package/styles/components/tabs/var.less +16 -71
  116. package/styles/components/timePicker/index.css +1 -1
  117. package/styles/cssVariable.css +1 -1
  118. package/styles/cssVariable.less +1 -1
  119. package/styles/index.css +1 -1
  120. package/types/components/Calendar/Calendar.vue.d.ts +15 -0
  121. package/types/components/Calendar/Header.vue.d.ts +15 -0
  122. package/types/components/Calendar/index.d.ts +30 -0
  123. package/types/components/Radio/Radio.type.d.ts +4 -0
  124. package/types/components/Radio/Radio.vue.d.ts +9 -0
  125. package/types/components/Radio/index.d.ts +15 -0
  126. package/types/components/Table/BaseTable.vue.d.ts +44 -9
  127. package/types/components/Table/BodyTable.vue.d.ts +44 -9
  128. package/types/components/Table/HeadTable.vue.d.ts +44 -9
  129. package/types/components/Table/Table.type.d.ts +7 -5
  130. package/types/components/Table/Table.vue.d.ts +88 -18
  131. package/types/components/Table/TableBox.vue.d.ts +88 -18
  132. package/types/components/Table/hooks/useTableResize.d.ts +1 -1
  133. package/types/components/Table/tableUnits/ExpandIcon.vue.d.ts +3 -3
  134. package/types/components/Table/tableUnits/ExpandRows.vue.d.ts +21 -3
  135. package/types/components/Table/tableUnits/SelectionBox.vue.d.ts +15 -0
  136. package/types/components/Table/tableUnits/TableBody.vue.d.ts +42 -6
  137. package/types/components/Table/tableUnits/TableCell.vue.d.ts +21 -3
  138. package/types/components/Table/tableUnits/TableRow.vue.d.ts +21 -3
  139. package/types/components/Tabs/TabNav.vue.d.ts +1 -1
  140. package/types/components/Tabs/Tabs.d.ts +1 -1
  141. package/types/components/Tabs/index.d.ts +3 -3
  142. package/uxd-ui.css +1 -1
  143. package/uxd-ui.esm.min.mjs +6 -6
  144. package/uxd-ui.esm.mjs +164 -191
  145. package/uxd-ui.umd.js +164 -191
  146. 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.4 */
1
+ /*! @koi-design/uxd-ui@4.0.6 */
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, CheckCircle, ChevronsLeft, ChevronsRight, Calendar as Calendar$1, ZoomIn, ZoomOut, RotateCcw, RotateCw, PanelLeft, Image as Image$2, XCircle, Star as Star$1, CheckIcon, XIcon, FilterIcon, GripVertical, Plus, Clock, FileIcon, HelpCircle, CircleHelp, AlertCircle, SearchIcon } from 'lucide-vue-next';
@@ -7500,7 +7500,7 @@ var ResizeObserver$1 = defineComponent({
7500
7500
  if (stateWidth !== _width || stateHeight !== _height) {
7501
7501
  stateWidth = _width;
7502
7502
  stateHeight = _height;
7503
- emit("resize", { widht: _width, height: _height });
7503
+ emit("resize", { target, width: _width, height: _height });
7504
7504
  }
7505
7505
  };
7506
7506
  const destroyObserver = () => {
@@ -15477,6 +15477,10 @@ const radioProps = {
15477
15477
  type: [String, Number],
15478
15478
  default: ""
15479
15479
  },
15480
+ label: {
15481
+ type: String,
15482
+ default: ""
15483
+ },
15480
15484
  disabled: {
15481
15485
  type: Boolean,
15482
15486
  default: false
@@ -15681,13 +15685,14 @@ function _sfc_render$1L(_ctx, _cache, $props, $setup, $data, $options) {
15681
15685
  onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.handleOnBlur && _ctx.handleOnBlur(...args))
15682
15686
  }, null, 42, _hoisted_1$I)
15683
15687
  ], 2),
15684
- createElementVNode("span", {
15688
+ _ctx.label || _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
15689
+ key: 0,
15685
15690
  class: normalizeClass([`${_ctx.prefixCls}-label`])
15686
15691
  }, [
15687
15692
  renderSlot(_ctx.$slots, "default", {}, () => [
15688
- createTextVNode(toDisplayString(_ctx.value), 1)
15693
+ createTextVNode(toDisplayString(_ctx.label), 1)
15689
15694
  ])
15690
- ], 2)
15695
+ ], 2)) : createCommentVNode("v-if", true)
15691
15696
  ], 2);
15692
15697
  }
15693
15698
  var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["render", _sfc_render$1L], ["__file", "Radio.vue"]]);
@@ -32056,19 +32061,22 @@ const _sfc_main$L = defineComponent({
32056
32061
  },
32057
32062
  setup(props) {
32058
32063
  const {
32059
- size: { sizesMap }
32064
+ size: { resizeColumns }
32060
32065
  } = inject("tableContext", {});
32061
32066
  const cols = computed(() => {
32062
32067
  let rst = [];
32063
32068
  rst = rst.concat(
32064
32069
  getLeafColumns(props.columns).map((col) => {
32070
+ var _a;
32065
32071
  const { fixed } = col;
32066
32072
  const colKey = getColumnKey(col);
32067
- const w = sizesMap[colKey] ? `${sizesMap[colKey]}px` : "";
32073
+ const resizeWidth = (_a = resizeColumns.value.find((x) => x.key === colKey)) == null ? void 0 : _a.width;
32068
32074
  return {
32069
- width: w,
32075
+ width: typeof col.width === "number" ? `${col.width}px` : col.width,
32076
+ minWidth: typeof col.minWidth === "number" ? `${col.minWidth}px` : col.minWidth,
32070
32077
  key: colKey,
32071
- fixed: !!fixed
32078
+ fixed: !!fixed,
32079
+ resizeWidth: resizeWidth ? `${resizeWidth}px` : void 0
32072
32080
  };
32073
32081
  })
32074
32082
  );
@@ -32084,7 +32092,7 @@ function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
32084
32092
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.cols, (col) => {
32085
32093
  return openBlock(), createElementBlock("col", {
32086
32094
  key: col.key,
32087
- style: normalizeStyle({ width: col.width, maxWidth: col.fixed ? col.width : "" })
32095
+ style: normalizeStyle({ width: col.resizeWidth ? col.resizeWidth : col.width, minWidth: col.minWidth, maxWidth: col.fixed ? col.width : "" })
32088
32096
  }, null, 4);
32089
32097
  }), 128))
32090
32098
  ]);
@@ -32307,8 +32315,8 @@ function getWidth(width, tableWidth) {
32307
32315
  return _width;
32308
32316
  }
32309
32317
  function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, props) {
32310
- const sizesMap = reactive({});
32311
32318
  const tableWidth = ref(void 0);
32319
+ const resizeColumns = shallowRef([]);
32312
32320
  const syncColumnsWidth = () => {
32313
32321
  const { bodyTable } = tableRefs;
32314
32322
  if (!bodyTable || bodyTable.getWidth() === void 0) {
@@ -32316,73 +32324,15 @@ function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, pro
32316
32324
  }
32317
32325
  const wrapWidth = bodyTable.getWidth();
32318
32326
  const columns = getLeafColumns(updatedColumns.value);
32319
- let usedWidth = 0;
32320
- Object.keys(sizesMap).forEach((key) => {
32321
- delete sizesMap[key];
32322
- });
32323
- const minWidthColumns = [];
32324
- const maxWidthColumns = [];
32325
- const nothingColumns = [];
32326
- columns.forEach((c) => {
32327
- const colKey = getColumnKey(c);
32328
- if (c.width) {
32329
- const _width = getWidth(c.width, wrapWidth);
32330
- usedWidth += _width;
32331
- sizesMap[colKey] = _width;
32332
- } else if (c.minWidth) {
32333
- const _width = getWidth(c.minWidth, wrapWidth);
32334
- usedWidth += _width;
32335
- sizesMap[colKey] = _width;
32336
- minWidthColumns.push(c);
32337
- } else {
32338
- const minWidth = getMinWidth(c);
32339
- sizesMap[colKey] = minWidth;
32340
- usedWidth += minWidth;
32341
- if (c.maxWidth) {
32342
- maxWidthColumns.push(c);
32343
- } else {
32344
- nothingColumns.push(c);
32345
- }
32346
- }
32347
- });
32348
- let unUsedWidth = wrapWidth - usedWidth;
32349
- let length = minWidthColumns.length + maxWidthColumns.length + nothingColumns.length;
32350
- if (unUsedWidth > 0 && length > 0) {
32351
- let avgWidth;
32352
- maxWidthColumns.forEach((mc) => {
32353
- avgWidth = Math.floor(unUsedWidth / length);
32354
- if (getWidth(mc.maxWidth, wrapWidth) < avgWidth) {
32355
- sizesMap[mc.key] = getWidth(mc.maxWidth, wrapWidth);
32356
- unUsedWidth -= getWidth(mc.maxWidth, wrapWidth) - getMinWidth(mc);
32357
- } else {
32358
- sizesMap[mc.key] += avgWidth;
32359
- unUsedWidth -= avgWidth;
32360
- }
32361
- length -= 1;
32362
- });
32363
- avgWidth = Math.floor(unUsedWidth / length);
32364
- if (avgWidth > 50 || nothingColumns.length === 0) {
32365
- [...minWidthColumns, ...nothingColumns].forEach((c, i) => {
32366
- if (i < length - 1) {
32367
- sizesMap[c.key] += avgWidth;
32368
- unUsedWidth -= avgWidth;
32369
- } else {
32370
- sizesMap[c.key] += unUsedWidth;
32371
- }
32372
- });
32373
- } else {
32374
- avgWidth = Math.floor(unUsedWidth / nothingColumns.length);
32375
- nothingColumns.forEach((c, i) => {
32376
- if (i < nothingColumns.length - 1) {
32377
- sizesMap[c.key] += avgWidth;
32378
- unUsedWidth -= avgWidth;
32379
- } else {
32380
- sizesMap[c.key] += unUsedWidth;
32381
- }
32382
- });
32383
- }
32327
+ const totalWidth = columns.reduce((sum, col) => {
32328
+ var _a;
32329
+ return sum + getWidth((_a = col.width) != null ? _a : col.minWidth, wrapWidth);
32330
+ }, 0);
32331
+ if (totalWidth > wrapWidth) {
32332
+ tableWidth.value = totalWidth;
32333
+ } else {
32334
+ tableWidth.value = void 0;
32384
32335
  }
32385
- tableWidth.value = Object.keys(sizesMap).reduce((sum, key) => sum + sizesMap[key], 0);
32386
32336
  };
32387
32337
  let syncHeightTimer = null;
32388
32338
  const scrollPosition = ref("left");
@@ -32420,8 +32370,8 @@ function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, pro
32420
32370
  const _column = columns.find((c) => c === column || getColumnKey(c) === getColumnKey(column));
32421
32371
  if (_column) {
32422
32372
  _column.width = width;
32423
- handleResize();
32424
32373
  }
32374
+ resizeColumns.value = columns;
32425
32375
  };
32426
32376
  const isScrollX = computed(() => {
32427
32377
  const { table } = tableRefs;
@@ -32447,10 +32397,10 @@ function useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, pro
32447
32397
  }
32448
32398
  };
32449
32399
  return {
32450
- sizesMap,
32451
32400
  tableWidth,
32452
32401
  isScrollX,
32453
32402
  scrollPosition,
32403
+ resizeColumns,
32454
32404
  handleResize,
32455
32405
  setScrollPositionClass,
32456
32406
  resetScrollX,
@@ -32851,7 +32801,7 @@ const _sfc_main$H = defineComponent({
32851
32801
  },
32852
32802
  expandIcon: {
32853
32803
  type: [String, Object, Function],
32854
- default: () => ChevronRight
32804
+ default: void 0
32855
32805
  },
32856
32806
  needIndentSpaced: {
32857
32807
  type: Boolean,
@@ -32932,7 +32882,8 @@ const _sfc_main$G = defineComponent({
32932
32882
  ExpandIcon,
32933
32883
  UTooltip,
32934
32884
  USkeleton,
32935
- USkeletonItem
32885
+ USkeletonItem,
32886
+ ResizeObserver: ResizeObserver$1
32936
32887
  },
32937
32888
  props: {
32938
32889
  prefixCls: {
@@ -32973,12 +32924,12 @@ const _sfc_main$G = defineComponent({
32973
32924
  props: { indentSize },
32974
32925
  expand: { handleExpandChange, isRowExpanded },
32975
32926
  filterAndSorter: { hasAction, hasSorters, hasFilters, isSortColumn },
32976
- size: { sizesMap },
32977
32927
  pagination
32978
32928
  } = inject("tableContext", {});
32979
32929
  const cellRef = ref();
32980
32930
  const ellipsisSpanRef = ref();
32981
32931
  const isOverflow = ref(false);
32932
+ const isMinWidth = ref(false);
32982
32933
  const renderFn = computed(() => {
32983
32934
  const { render } = props.column;
32984
32935
  return render || null;
@@ -33023,6 +32974,9 @@ const _sfc_main$G = defineComponent({
33023
32974
  if (right !== void 0) {
33024
32975
  style.right = `${right}px`;
33025
32976
  }
32977
+ if (isMinWidth.value) {
32978
+ style.width = `${props.column.minWidth}px`;
32979
+ }
33026
32980
  return style;
33027
32981
  });
33028
32982
  const handleExpand = (e) => {
@@ -33040,26 +32994,25 @@ const _sfc_main$G = defineComponent({
33040
32994
  e
33041
32995
  );
33042
32996
  };
33043
- watch(
33044
- () => sizesMap,
33045
- () => {
32997
+ const checkWidth = ({ target, width }) => {
32998
+ nextTick(() => {
33046
32999
  if (ellipsisSpanRef.value) {
33047
- const cell = cellRef.value;
33000
+ const cell = target;
33048
33001
  const padding = (Number.parseInt(getStyle$1(cell, "paddingLeft")) || 0) + (Number.parseInt(getStyle$1(cell, "paddingRight")) || 0);
33049
33002
  const span = ellipsisSpanRef.value;
33050
33003
  const range = document.createRange();
33051
33004
  range.setStart(span, 0);
33052
33005
  range.setEnd(span, span.childNodes.length);
33053
33006
  const rangeWidth = range.getBoundingClientRect().width;
33054
- const colKey = getColumnKey(props.column);
33055
- const cellWidth = sizesMap[colKey];
33056
- if (rangeWidth + padding > cellWidth) {
33007
+ if (rangeWidth + padding > width) {
33057
33008
  isOverflow.value = true;
33009
+ } else {
33010
+ isOverflow.value = false;
33058
33011
  }
33059
33012
  }
33060
- },
33061
- { deep: true }
33062
- );
33013
+ });
33014
+ };
33015
+ const debouncedHandleResize = debounce$2((args) => checkWidth(args), 100);
33063
33016
  return {
33064
33017
  tablePrefixCls,
33065
33018
  isRender,
@@ -33079,97 +33032,106 @@ const _sfc_main$G = defineComponent({
33079
33032
  pagination,
33080
33033
  cellRef,
33081
33034
  ellipsisSpanRef,
33082
- isOverflow
33035
+ isOverflow,
33036
+ debouncedHandleResize
33083
33037
  };
33084
33038
  }
33085
33039
  });
33086
33040
  function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
33087
- var _a;
33088
33041
  const _component_USkeletonItem = resolveComponent("USkeletonItem");
33089
33042
  const _component_USkeleton = resolveComponent("USkeleton");
33090
33043
  const _component_ExpandIcon = resolveComponent("ExpandIcon");
33091
33044
  const _component_Render = resolveComponent("Render");
33092
33045
  const _component_UTooltip = resolveComponent("UTooltip");
33093
- return _ctx.showCell ? (openBlock(), createElementBlock("td", mergeProps({
33094
- key: 0,
33095
- ref: "cellRef"
33096
- }, _ctx.tdProps, {
33097
- class: {
33098
- [`${_ctx.prefixCls}-cell-custom`]: !!((_a = _ctx.tdProps) == null ? void 0 : _a.class),
33099
- [`${_ctx.column.className}`]: !!_ctx.column.className,
33100
- [`${_ctx.prefixCls}-cell-ellipsis`]: !!_ctx.column.ellipsis,
33101
- [`${_ctx.prefixCls}-cell-break-word`]: !!_ctx.column.width,
33102
- [`${_ctx.tablePrefixCls}-column-has-actions`]: _ctx.hasAction(_ctx.column),
33103
- [`${_ctx.tablePrefixCls}-column-has-sorters`]: _ctx.hasSorters(_ctx.column),
33104
- [`${_ctx.tablePrefixCls}-column-has-filters`]: _ctx.hasFilters(_ctx.column),
33105
- [`${_ctx.tablePrefixCls}-column-sort`]: _ctx.isSortColumn(_ctx.column)
33106
- },
33107
- style: _ctx.tdStyle
33108
- }), [
33109
- _ctx.skeleton ? (openBlock(), createBlock(_component_USkeleton, {
33110
- key: 0,
33111
- class: normalizeClass(`${_ctx.prefixCls}-skeleton-wrap`),
33112
- active: ""
33113
- }, {
33114
- default: withCtx(() => [
33115
- _ctx.column.skeleton ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(Array(_ctx.column.skeleton.length), (_, ski) => {
33116
- return openBlock(), createBlock(_component_USkeletonItem, {
33117
- key: ski,
33118
- type: _ctx.column.skeleton[ski].type,
33119
- style: normalizeStyle(_ctx.column.skeleton[ski].style)
33120
- }, null, 8, ["type", "style"]);
33121
- }), 128)) : (openBlock(), createBlock(_component_USkeletonItem, {
33122
- key: 1,
33123
- type: "text",
33124
- style: { "width": "50%" }
33125
- }))
33126
- ]),
33127
- _: 1
33128
- }, 8, ["class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
33129
- _ctx.expandIcon ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
33130
- createElementVNode("span", {
33131
- class: normalizeClass(`${_ctx.prefixCls}-indent indent-level-${_ctx.indent}`),
33132
- style: normalizeStyle({ paddingLeft: `${_ctx.indentSize * _ctx.indent}px` })
33133
- }, null, 6),
33134
- createVNode(_component_ExpandIcon, {
33135
- "need-indent-spaced": "",
33136
- expandable: !!_ctx.data.children,
33137
- "need-loading": _ctx.data.children === true,
33138
- "row-key": _ctx.rowKey,
33139
- expanded: _ctx.isRowExpanded(_ctx.rowKey, true),
33140
- onExpand: _ctx.handleExpand,
33141
- onAsyncExpand: _ctx.handleAsyncExpand
33142
- }, null, 8, ["expandable", "need-loading", "row-key", "expanded", "onExpand", "onAsyncExpand"])
33143
- ], 64)) : createCommentVNode("v-if", true),
33144
- _ctx.isRender ? (openBlock(), createBlock(_component_Render, {
33145
- key: 1,
33146
- render: () => {
33147
- var _a2;
33148
- return (_a2 = _ctx.renderFn) == null ? void 0 : _a2.call(_ctx, {
33149
- row: _ctx.data,
33150
- index: _ctx.index,
33151
- rowKey: _ctx.rowKey,
33152
- pagination: _ctx.pagination,
33153
- column: _ctx.column
33154
- });
33155
- }
33156
- }, null, 8, ["render"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
33157
- _ctx.column.ellipsis && _ctx.displayCell ? (openBlock(), createBlock(_component_UTooltip, {
33046
+ const _component_ResizeObserver = resolveComponent("ResizeObserver");
33047
+ return openBlock(), createBlock(_component_ResizeObserver, { onResize: _ctx.debouncedHandleResize }, {
33048
+ default: withCtx(() => {
33049
+ var _a;
33050
+ return [
33051
+ _ctx.showCell ? (openBlock(), createElementBlock("td", mergeProps({
33158
33052
  key: 0,
33159
- title: _ctx.displayCell.toString(),
33160
- disabled: !_ctx.isOverflow,
33161
- "mouse-enter-delay": 0.5
33162
- }, {
33163
- default: withCtx(() => [
33164
- createElementVNode("span", { ref: "ellipsisSpanRef" }, toDisplayString(_ctx.displayCell), 513)
33165
- ]),
33166
- _: 1
33167
- }, 8, ["title", "disabled"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
33168
- createTextVNode(toDisplayString(_ctx.displayCell), 1)
33169
- ], 64))
33170
- ], 64))
33171
- ], 64))
33172
- ], 16)) : createCommentVNode("v-if", true);
33053
+ ref: "cellRef"
33054
+ }, _ctx.tdProps, {
33055
+ class: {
33056
+ [`${_ctx.prefixCls}-cell-custom`]: !!((_a = _ctx.tdProps) == null ? void 0 : _a.class),
33057
+ [`${_ctx.column.className}`]: !!_ctx.column.className,
33058
+ [`${_ctx.prefixCls}-cell-ellipsis`]: !!_ctx.column.ellipsis,
33059
+ [`${_ctx.prefixCls}-cell-break-word`]: !!_ctx.column.width,
33060
+ [`${_ctx.tablePrefixCls}-column-has-actions`]: _ctx.hasAction(_ctx.column),
33061
+ [`${_ctx.tablePrefixCls}-column-has-sorters`]: _ctx.hasSorters(_ctx.column),
33062
+ [`${_ctx.tablePrefixCls}-column-has-filters`]: _ctx.hasFilters(_ctx.column),
33063
+ [`${_ctx.tablePrefixCls}-column-sort`]: _ctx.isSortColumn(_ctx.column)
33064
+ },
33065
+ style: _ctx.tdStyle
33066
+ }), [
33067
+ _ctx.skeleton ? (openBlock(), createBlock(_component_USkeleton, {
33068
+ key: 0,
33069
+ class: normalizeClass(`${_ctx.prefixCls}-skeleton-wrap`),
33070
+ active: ""
33071
+ }, {
33072
+ default: withCtx(() => [
33073
+ _ctx.column.skeleton ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(Array(_ctx.column.skeleton.length), (_, ski) => {
33074
+ return openBlock(), createBlock(_component_USkeletonItem, {
33075
+ key: ski,
33076
+ type: _ctx.column.skeleton[ski].type,
33077
+ style: normalizeStyle(_ctx.column.skeleton[ski].style)
33078
+ }, null, 8, ["type", "style"]);
33079
+ }), 128)) : (openBlock(), createBlock(_component_USkeletonItem, {
33080
+ key: 1,
33081
+ type: "text",
33082
+ style: { "width": "50%" }
33083
+ }))
33084
+ ]),
33085
+ _: 1
33086
+ }, 8, ["class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
33087
+ _ctx.expandIcon ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
33088
+ createElementVNode("span", {
33089
+ class: normalizeClass(`${_ctx.prefixCls}-indent indent-level-${_ctx.indent}`),
33090
+ style: normalizeStyle({ paddingLeft: `${_ctx.indentSize * _ctx.indent}px` })
33091
+ }, null, 6),
33092
+ createVNode(_component_ExpandIcon, {
33093
+ "need-indent-spaced": "",
33094
+ expandable: !!_ctx.data.children,
33095
+ "need-loading": _ctx.data.children === true,
33096
+ "row-key": _ctx.rowKey,
33097
+ expanded: _ctx.isRowExpanded(_ctx.rowKey, true),
33098
+ onExpand: _ctx.handleExpand,
33099
+ onAsyncExpand: _ctx.handleAsyncExpand
33100
+ }, null, 8, ["expandable", "need-loading", "row-key", "expanded", "onExpand", "onAsyncExpand"])
33101
+ ], 64)) : createCommentVNode("v-if", true),
33102
+ _ctx.isRender ? (openBlock(), createBlock(_component_Render, {
33103
+ key: 1,
33104
+ render: () => {
33105
+ var _a2;
33106
+ return (_a2 = _ctx.renderFn) == null ? void 0 : _a2.call(_ctx, {
33107
+ row: _ctx.data,
33108
+ index: _ctx.index,
33109
+ rowKey: _ctx.rowKey,
33110
+ pagination: _ctx.pagination,
33111
+ column: _ctx.column
33112
+ });
33113
+ }
33114
+ }, null, 8, ["render"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
33115
+ _ctx.column.ellipsis && _ctx.displayCell ? (openBlock(), createBlock(_component_UTooltip, {
33116
+ key: 0,
33117
+ title: _ctx.displayCell.toString(),
33118
+ disabled: !_ctx.isOverflow,
33119
+ "mouse-enter-delay": 0.5
33120
+ }, {
33121
+ default: withCtx(() => [
33122
+ createElementVNode("span", { ref: "ellipsisSpanRef" }, toDisplayString(_ctx.displayCell), 513)
33123
+ ]),
33124
+ _: 1
33125
+ }, 8, ["title", "disabled"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
33126
+ createTextVNode(toDisplayString(_ctx.displayCell), 1)
33127
+ ], 64))
33128
+ ], 64))
33129
+ ], 64))
33130
+ ], 16)) : createCommentVNode("v-if", true)
33131
+ ];
33132
+ }),
33133
+ _: 1
33134
+ }, 8, ["onResize"]);
33173
33135
  }
33174
33136
  var TableCell = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$E], ["__file", "TableCell.vue"]]);
33175
33137
 
@@ -33667,35 +33629,48 @@ const _sfc_main$B = defineComponent({
33667
33629
  setup(props) {
33668
33630
  const {
33669
33631
  prefixCls,
33670
- size: { tableWidth, sizesMap }
33632
+ props: { width },
33633
+ size: { tableWidth }
33671
33634
  } = inject("tableContext", {});
33672
33635
  const tableRef = ref(null);
33673
33636
  const tableStyle = computed(() => {
33674
33637
  const style = {};
33675
- style.width = `${tableWidth.value}px`;
33638
+ if (width.value) {
33639
+ style.width = typeof width.value === "number" ? `${width.value}px` : width.value;
33640
+ } else if (props.columns.some((x) => x.fixed)) {
33641
+ style.width = "max-content";
33642
+ style.minWidth = "100%";
33643
+ }
33644
+ if (props.columns.some((x) => x.ellipsis) || props.columns.some((x) => x.resizable)) {
33645
+ style.tableLayout = "fixed";
33646
+ } else {
33647
+ style.tableLayout = "auto";
33648
+ }
33676
33649
  return style;
33677
33650
  });
33678
33651
  const getColumns = () => {
33679
33652
  let left = 0;
33680
- let right = props.columns.filter((x) => x.fixed === "right").reduce((sum, { key }) => {
33681
- const w = sizesMap[key];
33653
+ let right = props.columns.filter((x) => x.fixed === "right").reduce((sum, column) => {
33654
+ var _a;
33655
+ const w = getWidth((_a = column.width) != null ? _a : column.minWidth, tableWidth.value);
33682
33656
  return sum + w;
33683
33657
  }, 0);
33684
33658
  return props.columns.map((column) => {
33659
+ var _a, _b;
33685
33660
  const rst = {
33686
33661
  ...column,
33687
33662
  className: column.fixed ? `${column.className || ""} ${prefixCls.value}-fixed-column ${prefixCls.value}-fixed-column-${column.fixed}` : column.className
33688
33663
  };
33689
33664
  if (column.fixed === "left") {
33690
33665
  rst.left = left;
33691
- const w = sizesMap[column.key];
33666
+ const w = getWidth((_a = column.width) != null ? _a : column.minWidth, tableWidth.value);
33692
33667
  left += w;
33693
33668
  if (column.lastLeft) {
33694
33669
  rst.className = `${rst.className || ""} ${prefixCls.value}-fixed-column-${column.fixed}-last`;
33695
33670
  }
33696
33671
  }
33697
33672
  if (column.fixed === "right") {
33698
- const w = sizesMap[column.key];
33673
+ const w = getWidth((_b = column.width) != null ? _b : column.minWidth, tableWidth.value);
33699
33674
  right -= w;
33700
33675
  rst.right = right;
33701
33676
  if (column.firstRight) {
@@ -35315,13 +35290,13 @@ const _sfc_main$u = defineComponent({
35315
35290
  selectionColumn
35316
35291
  });
35317
35292
  const {
35318
- sizesMap,
35319
35293
  handleResize,
35320
35294
  isScrollX,
35321
35295
  scrollPosition,
35322
35296
  setScrollPositionClass,
35323
35297
  resetScrollX,
35324
35298
  tableWidth,
35299
+ resizeColumns,
35325
35300
  clearResizeTimer,
35326
35301
  setResizeWidth
35327
35302
  } = useTableResize(updatedColumns, tableRefs, prefixCls, isColumnFixed, props);
@@ -35403,7 +35378,7 @@ const _sfc_main$u = defineComponent({
35403
35378
  const handleColumnResize = (columnWidth, changeWidth, column, event) => {
35404
35379
  emit("column-resize", columnWidth, changeWidth, column, event);
35405
35380
  };
35406
- const { showHeader, maxHeight, expandIcon, rowClassName, indentSize, showSummary, disabledHover, expandIndent, headerSticky, loading } = toRefs(props);
35381
+ const { showHeader, maxHeight, expandIcon, rowClassName, indentSize, showSummary, disabledHover, expandIndent, headerSticky, loading, width } = toRefs(props);
35407
35382
  provide("tableContext", {
35408
35383
  prefixCls,
35409
35384
  locale,
@@ -35422,7 +35397,8 @@ const _sfc_main$u = defineComponent({
35422
35397
  disabledHover,
35423
35398
  expandIndent,
35424
35399
  headerSticky,
35425
- loading
35400
+ loading,
35401
+ width
35426
35402
  },
35427
35403
  slots,
35428
35404
  expand: {
@@ -35436,7 +35412,7 @@ const _sfc_main$u = defineComponent({
35436
35412
  },
35437
35413
  size: {
35438
35414
  tableWidth,
35439
- sizesMap,
35415
+ resizeColumns,
35440
35416
  isScrollX,
35441
35417
  setResizeWidth,
35442
35418
  handleColumnResize,
@@ -35505,8 +35481,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
35505
35481
  return openBlock(), createBlock(_component_ResizeObserver, { onResize: _ctx.debouncedHandleResize }, {
35506
35482
  default: withCtx(() => [
35507
35483
  createElementVNode("div", {
35508
- class: normalizeClass([`${_ctx.prefixCls}-wrapper`]),
35509
- style: normalizeStyle({ width: typeof _ctx.width === "number" ? `${_ctx.width}px` : _ctx.width })
35484
+ class: normalizeClass([`${_ctx.prefixCls}-wrapper`])
35510
35485
  }, [
35511
35486
  _ctx.showPagination && _ctx.pagination && (_ctx.pagination.position === "top" || _ctx.pagination.position === "both") ? (openBlock(), createElementBlock("div", {
35512
35487
  key: 0,
@@ -35534,7 +35509,6 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
35534
35509
  [`${_ctx.prefixCls}-empty`]: !_ctx.data.length,
35535
35510
  [`${_ctx.prefixCls}-without-column-header`]: !_ctx.showHeader,
35536
35511
  [`${_ctx.prefixCls}-fixed-header`]: !!_ctx.maxHeight,
35537
- [`${_ctx.prefixCls}-layout-fixed`]: true,
35538
35512
  [`${_ctx.prefixCls}-scroll-position-left`]: _ctx.scrollPosition === "left" || _ctx.scrollPosition === "both",
35539
35513
  [`${_ctx.prefixCls}-scroll-position-right`]: _ctx.scrollPosition === "right" || _ctx.scrollPosition === "both",
35540
35514
  [`${_ctx.prefixCls}-dragging`]: _ctx.showResizeLine,
@@ -35597,7 +35571,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
35597
35571
  onPageSizeChange: _ctx.handlePageSizeChange
35598
35572
  }), null, 16, ["total", "onChange", "onPageSizeChange"])
35599
35573
  ], 2)) : createCommentVNode("v-if", true)
35600
- ], 6)
35574
+ ], 2)
35601
35575
  ]),
35602
35576
  _: 3
35603
35577
  }, 8, ["onResize"]);
@@ -35867,7 +35841,7 @@ const _sfc_main$s = defineComponent({
35867
35841
  components: {
35868
35842
  TabBar,
35869
35843
  UIcon,
35870
- CircleX,
35844
+ X,
35871
35845
  ChevronLeft,
35872
35846
  ChevronRight,
35873
35847
  Plus,
@@ -36194,7 +36168,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
36194
36168
  const _component_UIcon = resolveComponent("UIcon");
36195
36169
  const _component_TabBar = resolveComponent("TabBar");
36196
36170
  const _component_URender = resolveComponent("URender");
36197
- const _component_CircleX = resolveComponent("CircleX");
36171
+ const _component_X = resolveComponent("X");
36198
36172
  const _component_ChevronRight = resolveComponent("ChevronRight");
36199
36173
  const _component_Plus = resolveComponent("Plus");
36200
36174
  return openBlock(), createElementBlock("div", {
@@ -36302,7 +36276,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
36302
36276
  }, [
36303
36277
  createVNode(_component_UIcon, null, {
36304
36278
  default: withCtx(() => [
36305
- createVNode(_component_CircleX)
36279
+ createVNode(_component_X)
36306
36280
  ]),
36307
36281
  _: 1
36308
36282
  })
@@ -36333,7 +36307,6 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
36333
36307
  _ctx.addable || _ctx.editable ? (openBlock(), createElementBlock("div", {
36334
36308
  key: 2,
36335
36309
  class: normalizeClass({
36336
- [`${_ctx.prefixCls}-item`]: true,
36337
36310
  [`${_ctx.prefixCls}-item-add-btn`]: true
36338
36311
  }),
36339
36312
  onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleTabAdd && _ctx.handleTabAdd(...args), ["stop"]))