vue-devui 1.0.0-rc.12 → 1.0.0-rc.13

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 (77) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +7 -0
  3. package/auto-complete/index.es.js +3 -2
  4. package/auto-complete/index.umd.js +7 -7
  5. package/auto-complete/style.css +1 -1
  6. package/button/index.es.js +2 -1
  7. package/button/index.umd.js +1 -1
  8. package/button/style.css +1 -1
  9. package/checkbox/index.es.js +1 -1
  10. package/checkbox/index.umd.js +4 -4
  11. package/checkbox/style.css +1 -1
  12. package/date-picker-pro/index.es.js +40 -29
  13. package/date-picker-pro/index.umd.js +6 -6
  14. package/date-picker-pro/style.css +1 -1
  15. package/dropdown/index.es.js +8 -1
  16. package/editable-select/index.es.js +7 -7
  17. package/editable-select/index.umd.js +1 -1
  18. package/form/index.es.js +1 -1
  19. package/form/index.umd.js +4 -4
  20. package/icon/index.es.js +2 -1
  21. package/icon/index.umd.js +1 -1
  22. package/icon/style.css +1 -1
  23. package/image-preview/style.css +1 -1
  24. package/input/index.es.js +3 -2
  25. package/input/index.umd.js +4 -4
  26. package/input/style.css +1 -1
  27. package/input-number/index.es.js +1 -4
  28. package/input-number/index.umd.js +1 -1
  29. package/modal/index.es.js +2 -1
  30. package/modal/index.umd.js +1 -1
  31. package/modal/style.css +1 -1
  32. package/notification/index.es.js +29 -32
  33. package/notification/index.umd.js +1 -1
  34. package/notification/style.css +1 -1
  35. package/package.json +1 -1
  36. package/radio/index.es.js +1 -1
  37. package/radio/index.umd.js +4 -4
  38. package/result/index.es.js +2 -1
  39. package/result/index.umd.js +1 -1
  40. package/result/style.css +1 -1
  41. package/search/index.es.js +4 -3
  42. package/search/index.umd.js +4 -4
  43. package/search/style.css +1 -1
  44. package/select/index.es.js +72 -35
  45. package/select/index.umd.js +14 -14
  46. package/select/style.css +1 -1
  47. package/steps/index.es.js +2 -1
  48. package/steps/index.umd.js +1 -1
  49. package/steps/style.css +1 -1
  50. package/style.css +1 -1
  51. package/switch/index.es.js +1 -1
  52. package/switch/index.umd.js +4 -4
  53. package/table/index.es.js +158 -36
  54. package/table/index.umd.js +14 -14
  55. package/table/style.css +1 -1
  56. package/tabs/index.es.js +21 -11
  57. package/tabs/index.umd.js +1 -1
  58. package/tabs/style.css +1 -1
  59. package/textarea/index.es.js +1 -1
  60. package/textarea/index.umd.js +4 -4
  61. package/time-picker/index.es.js +42 -28
  62. package/time-picker/index.umd.js +13 -13
  63. package/time-picker/style.css +1 -1
  64. package/time-select/index.es.js +72 -35
  65. package/time-select/index.umd.js +11 -11
  66. package/time-select/style.css +1 -1
  67. package/timeline/index.es.js +2 -1
  68. package/timeline/index.umd.js +1 -1
  69. package/timeline/style.css +1 -1
  70. package/tree/index.es.js +98 -39
  71. package/tree/index.umd.js +11 -11
  72. package/tree/style.css +1 -1
  73. package/upload/index.es.js +29 -32
  74. package/upload/index.umd.js +1 -1
  75. package/upload/style.css +1 -1
  76. package/vue-devui.es.js +406 -172
  77. package/vue-devui.umd.js +20 -20
package/vue-devui.es.js CHANGED
@@ -8147,7 +8147,7 @@ function useFormItemValidate(props, _rules) {
8147
8147
  return rule.trigger === triggerVal;
8148
8148
  }
8149
8149
  }).map((_a) => {
8150
- var _b = _a, { trigger } = _b, rule = __objRest(_b, ["trigger"]);
8150
+ var rule = __objRest(_a, []);
8151
8151
  return rule;
8152
8152
  });
8153
8153
  };
@@ -8849,7 +8849,8 @@ function useIconDom(props, ctx2) {
8849
8849
  "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
8850
8850
  "style": {
8851
8851
  width: iconSize.value || "",
8852
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
8852
+ transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
8853
+ verticalAlign: "middle"
8853
8854
  }
8854
8855
  }, ctx2.attrs), null);
8855
8856
  };
@@ -11692,7 +11693,6 @@ const usePopupLine = (hourListRef, minuteListRef, secondListRef, minTime, maxTim
11692
11693
  };
11693
11694
  const resetTimeValue = (time) => {
11694
11695
  const timeValueArr = time.split(":");
11695
- minTime.split(":");
11696
11696
  let hh = 0;
11697
11697
  let mm = 0;
11698
11698
  let ss = 0;
@@ -11782,11 +11782,15 @@ const usePopupLine = (hourListRef, minuteListRef, secondListRef, minTime, maxTim
11782
11782
  }
11783
11783
  };
11784
11784
  const activeTimeFun = (e, item, index2) => {
11785
+ var _a, _b;
11785
11786
  if (item.isDisabled) {
11786
11787
  return false;
11787
11788
  } else {
11788
11789
  setTimeActive(item, index2);
11789
- e.target.parentElement.parentElement.scrollTop = index2 * itemHeight;
11790
+ if ((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.parentElement) {
11791
+ const pdom = (_b = e == null ? void 0 : e.target) == null ? void 0 : _b.parentElement;
11792
+ pdom && pdom.parentElement && (pdom.parentElement.scrollTop = index2 * itemHeight);
11793
+ }
11790
11794
  }
11791
11795
  ctx2.emit("change", { activeHour, activeMinute, activeSecond });
11792
11796
  };
@@ -11856,33 +11860,38 @@ const timePickerProps = {
11856
11860
  }
11857
11861
  };
11858
11862
  function useTimeScroll() {
11859
- const scrollBoxDom = ref();
11860
- const scrollContentDom = ref();
11861
- const scrollThumbDom = ref();
11862
- const scrollTrackDom = ref();
11863
+ const scrollBoxDom = ref(null);
11864
+ const scrollContentDom = ref(null);
11865
+ const scrollThumbDom = ref(null);
11866
+ const scrollTrackDom = ref(null);
11863
11867
  const isDown = ref(false);
11864
11868
  const getScrollHeight = () => {
11865
- const thumbHeight = scrollContentDom.value.clientHeight / scrollContentDom.value.scrollHeight * 100;
11866
- scrollThumbDom.value.style.height = thumbHeight + "%";
11869
+ var _a, _b;
11870
+ const thumbHeight = (((_a = scrollContentDom.value) == null ? void 0 : _a.clientHeight) || 0) / (((_b = scrollContentDom.value) == null ? void 0 : _b.scrollHeight) || 0) * 100;
11871
+ scrollThumbDom.value && (scrollThumbDom.value.style.height = thumbHeight + "%");
11867
11872
  };
11868
11873
  const setVirtualScroll = () => {
11869
- const thumbMoveY = scrollContentDom.value.scrollTop * 100 / scrollContentDom.value.clientHeight;
11870
- scrollThumbDom.value.style.transform = `translateY(${thumbMoveY}%)`;
11874
+ var _a, _b;
11875
+ const thumbMoveY = (((_a = scrollContentDom.value) == null ? void 0 : _a.scrollTop) || 0) * 100 / (((_b = scrollContentDom.value) == null ? void 0 : _b.clientHeight) || 0);
11876
+ scrollThumbDom.value && (scrollThumbDom.value.style.transform = `translateY(${thumbMoveY}%)`);
11871
11877
  };
11872
11878
  const clickTrackFun = (e) => {
11873
- const offsetNum = scrollTrackDom.value.getBoundingClientRect().top - e.clientY;
11879
+ var _a, _b, _c, _d, _e;
11880
+ const offsetNum = (((_c = (_b = (_a = scrollTrackDom.value) == null ? void 0 : _a.getBoundingClientRect) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.top) || 0) - e.clientY;
11874
11881
  const offset2 = Math.abs(offsetNum > 0 ? 0 : offsetNum);
11875
- const thumbCenter = scrollThumbDom.value.offsetHeight / 2;
11876
- const thumbPosition = (offset2 - thumbCenter) * 100 / scrollContentDom.value.offsetHeight;
11877
- scrollContentDom.value.scrollTop = thumbPosition * scrollContentDom.value.scrollHeight / 100;
11878
- scrollContentDom.value.style.top = scrollContentDom.value.scrollTop + "px";
11882
+ const thumbCenter = (((_d = scrollThumbDom.value) == null ? void 0 : _d.offsetHeight) || 0) / 2;
11883
+ const thumbPosition = (offset2 - thumbCenter) * 100 / (((_e = scrollContentDom.value) == null ? void 0 : _e.offsetHeight) || 0);
11884
+ if (scrollContentDom.value) {
11885
+ scrollContentDom.value.scrollTop = thumbPosition * scrollContentDom.value.scrollHeight / 100;
11886
+ scrollContentDom.value.style.top = scrollContentDom.value.scrollTop + "px";
11887
+ }
11879
11888
  };
11880
11889
  const thumbMouseMove = (e) => {
11881
11890
  const path = e.composedPath && e.composedPath() || e.path;
11882
- if (path.includes(scrollBoxDom.value) || isDown.value) {
11883
- scrollTrackDom.value.style.opacity = 1;
11891
+ if (scrollBoxDom.value && path.includes(scrollBoxDom.value) || isDown.value) {
11892
+ scrollTrackDom.value && (scrollTrackDom.value.style.opacity = "1");
11884
11893
  } else {
11885
- scrollTrackDom.value.style.opacity = 0;
11894
+ scrollTrackDom.value && (scrollTrackDom.value.style.opacity = "0");
11886
11895
  }
11887
11896
  if (!isDown.value) {
11888
11897
  return;
@@ -11891,7 +11900,7 @@ function useTimeScroll() {
11891
11900
  };
11892
11901
  const mouseDownThum = () => {
11893
11902
  isDown.value = true;
11894
- scrollTrackDom.value.style.opacity = 1;
11903
+ scrollTrackDom.value && (scrollTrackDom.value.style.opacity = "1");
11895
11904
  };
11896
11905
  const mouseOutThum = (e) => {
11897
11906
  isDown.value = false;
@@ -11959,18 +11968,20 @@ var TimeScroll = defineComponent({
11959
11968
  } = useTimeScroll();
11960
11969
  const marginRight = getScrollWidth();
11961
11970
  onMounted(() => {
11971
+ var _a, _b, _c;
11962
11972
  getScrollWidth();
11963
11973
  getScrollHeight();
11964
- scrollBoxDom.value.addEventListener("click", setVirtualScroll);
11965
- scrollContentDom.value.addEventListener("scroll", setVirtualScroll);
11966
- scrollThumbDom.value.addEventListener("mousedown", mouseDownThum);
11974
+ (_a = scrollBoxDom.value) == null ? void 0 : _a.addEventListener("click", setVirtualScroll);
11975
+ (_b = scrollContentDom.value) == null ? void 0 : _b.addEventListener("scroll", setVirtualScroll);
11976
+ (_c = scrollThumbDom.value) == null ? void 0 : _c.addEventListener("mousedown", mouseDownThum);
11967
11977
  document.addEventListener("mouseup", mouseOutThum);
11968
11978
  document.addEventListener("mousemove", thumbMouseMove);
11969
11979
  });
11970
11980
  onBeforeUnmount(() => {
11971
- scrollBoxDom.value.removeEventListener("click", setVirtualScroll);
11972
- scrollContentDom.value.removeEventListener("scroll", setVirtualScroll);
11973
- scrollThumbDom.value.removeEventListener("mousedown", mouseDownThum);
11981
+ var _a, _b, _c;
11982
+ (_a = scrollBoxDom.value) == null ? void 0 : _a.removeEventListener("click", setVirtualScroll);
11983
+ (_b = scrollContentDom.value) == null ? void 0 : _b.removeEventListener("scroll", setVirtualScroll);
11984
+ (_c = scrollThumbDom.value) == null ? void 0 : _c.removeEventListener("mousedown", mouseDownThum);
11974
11985
  });
11975
11986
  onUnmounted(() => {
11976
11987
  document.removeEventListener("mouseup", mouseOutThum);
@@ -12865,7 +12876,7 @@ var DatePickerPro = defineComponent({
12865
12876
  onSelectedDate,
12866
12877
  handlerClearTime
12867
12878
  } = usePickerPro(props, ctx2, t);
12868
- const position = ref(["bottom-start"]);
12879
+ const position = ref(["bottom-start", "top-start"]);
12869
12880
  return () => {
12870
12881
  var _a, _b;
12871
12882
  const vSlots = {
@@ -13092,7 +13103,7 @@ var DRangeDatePickerPro = defineComponent({
13092
13103
  handlerClearTime,
13093
13104
  onChangeRangeFocusType
13094
13105
  } = useRangePickerPro(props, ctx2);
13095
- const position = ref(["bottom-start"]);
13106
+ const position = ref(["bottom-start", "top-start"]);
13096
13107
  return () => {
13097
13108
  var _a, _b;
13098
13109
  const vSlots = {
@@ -13439,7 +13450,14 @@ function subscribeEvent(dom, type4, callback) {
13439
13450
  dom == null ? void 0 : dom.removeEventListener(type4, callback);
13440
13451
  };
13441
13452
  }
13442
- const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
13453
+ const useDropdownEvent = ({
13454
+ id,
13455
+ isOpen,
13456
+ origin,
13457
+ dropdownRef,
13458
+ props,
13459
+ emit
13460
+ }) => {
13443
13461
  let overlayEnter = false;
13444
13462
  let originEnter = false;
13445
13463
  const { trigger, closeScope, closeOnMouseLeaveMenu } = toRefs(props);
@@ -13852,7 +13870,7 @@ const useInput = (inputValue, ctx2) => {
13852
13870
  handleInput
13853
13871
  };
13854
13872
  };
13855
- const useLazyLoad = (dropdownRef, inputValue, filterOtion, ctx2) => {
13873
+ const useLazyLoad$1 = (dropdownRef, inputValue, filterOtion, ctx2) => {
13856
13874
  const loadMore = () => {
13857
13875
  const dropdownVal = dropdownRef.value;
13858
13876
  if (filterOtion !== false) {
@@ -13948,11 +13966,11 @@ const useCacheFilteredOptions = (filteredOptions) => {
13948
13966
  const cacheFilteredOptions = computed(() => {
13949
13967
  const map = /* @__PURE__ */ new Map();
13950
13968
  filteredOptions.value.forEach((item) => {
13951
- map.set(item.label, item.value);
13969
+ map.set(item, item.value);
13952
13970
  });
13953
13971
  return map;
13954
13972
  });
13955
- const getOptionValue = (label) => cacheFilteredOptions.value.get(label);
13973
+ const getOptionValue = (option2) => cacheFilteredOptions.value.get(option2);
13956
13974
  return {
13957
13975
  getOptionValue
13958
13976
  };
@@ -14015,11 +14033,11 @@ var EditableSelect = defineComponent({
14015
14033
  };
14016
14034
  const {
14017
14035
  loadMore
14018
- } = useLazyLoad(dropdownRef, inputValue, props.filterOption, ctx2);
14036
+ } = useLazyLoad$1(dropdownRef, inputValue, props.filterOption, ctx2);
14019
14037
  const {
14020
14038
  handleInput
14021
14039
  } = useInput(inputValue, ctx2);
14022
- const handleClick = (option2, index2) => {
14040
+ const handleClick = (option2, index2, curSelectedIndex) => {
14023
14041
  const {
14024
14042
  optionDisabledKey: disabledKey
14025
14043
  } = props;
@@ -14028,8 +14046,8 @@ var EditableSelect = defineComponent({
14028
14046
  }
14029
14047
  inputValue.value = option2.label;
14030
14048
  cacheInput.value = option2.label;
14031
- selectedIndex.value = index2;
14032
- const value = getOptionValue(option2.label);
14049
+ curSelectedIndex.value = index2;
14050
+ const value = getOptionValue(option2);
14033
14051
  ctx2.emit("update:modelValue", value + "");
14034
14052
  closeMenu();
14035
14053
  };
@@ -14037,7 +14055,7 @@ var EditableSelect = defineComponent({
14037
14055
  handleKeydown,
14038
14056
  hoverIndex,
14039
14057
  selectedIndex
14040
- } = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.optionDisabledKey, props.filterOption, loading2, handleClick, closeMenu, toggleMenu);
14058
+ } = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.optionDisabledKey, props.filterOption, loading2, (option2, index2) => handleClick(option2, index2, selectedIndex), closeMenu, toggleMenu);
14041
14059
  const getItemCls = (option2, index2) => {
14042
14060
  const {
14043
14061
  optionDisabledKey: disabledKey
@@ -14107,7 +14125,7 @@ var EditableSelect = defineComponent({
14107
14125
  "class": getItemCls(option2, index2),
14108
14126
  "onClick": (e) => {
14109
14127
  e.stopPropagation();
14110
- handleClick(option2, index2);
14128
+ handleClick(option2, index2, selectedIndex);
14111
14129
  }
14112
14130
  }, [ctx2.slots.item ? ctx2.slots.item(option2) : option2.label]);
14113
14131
  }), withDirectives(createVNode("li", {
@@ -15333,15 +15351,12 @@ var InputNumber = defineComponent({
15333
15351
  }), null)])]);
15334
15352
  }
15335
15353
  });
15336
- InputNumber.install = function(app) {
15337
- app.component(InputNumber.name, InputNumber);
15338
- };
15339
15354
  var InputNumberInstall = {
15340
15355
  title: "InputNumber \u6570\u5B57\u8F93\u5165\u6846",
15341
15356
  category: "\u6570\u636E\u5F55\u5165",
15342
15357
  status: "50%",
15343
15358
  install(app) {
15344
- app.use(InputNumber);
15359
+ app.component(InputNumber.name, InputNumber);
15345
15360
  }
15346
15361
  };
15347
15362
  var layout = "";
@@ -15792,15 +15807,20 @@ var Close = defineComponent({
15792
15807
  }
15793
15808
  });
15794
15809
  const ns$6 = useNamespace("notification");
15810
+ const XLINK = {
15811
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
15812
+ };
15813
+ const XLINK_HREF$1 = {
15814
+ "xlink:href": "#path-s"
15815
+ };
15795
15816
  function SuccessIcon() {
15796
- return createVNode("svg", {
15817
+ return createVNode("svg", mergeProps({
15797
15818
  "width": "16px",
15798
15819
  "height": "16px",
15799
15820
  "viewBox": "0 0 16 16",
15800
15821
  "version": "1.1",
15801
- "xmlns": "http://www.w3.org/2000/svg",
15802
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
15803
- }, [createVNode("defs", null, [createVNode("polygon", {
15822
+ "xmlns": "http://www.w3.org/2000/svg"
15823
+ }, XLINK), [createVNode("defs", null, [createVNode("polygon", {
15804
15824
  "id": "path-s",
15805
15825
  "points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
15806
15826
  }, null)]), createVNode("g", {
@@ -15812,30 +15832,26 @@ function SuccessIcon() {
15812
15832
  }, [createVNode("mask", {
15813
15833
  "id": "mask-2",
15814
15834
  "fill": "white"
15815
- }, [createVNode("use", {
15816
- "xlink:href": "#path-s"
15817
- }, null)]), createVNode("use", {
15835
+ }, [createVNode("use", XLINK_HREF$1, null)]), createVNode("use", mergeProps({
15818
15836
  "id": "Mask",
15819
- "class": ns$6.e("image-success-path"),
15820
- "xlink:href": "#path-s"
15821
- }, null)])]);
15837
+ "class": ns$6.e("image-success-path")
15838
+ }, XLINK_HREF$1), null)])]);
15822
15839
  }
15823
15840
  function WarningIcon() {
15824
- return createVNode("svg", {
15841
+ return createVNode("svg", mergeProps({
15825
15842
  "width": "16px",
15826
15843
  "height": "16px",
15827
15844
  "viewBox": "0 0 16 16",
15828
15845
  "version": "1.1",
15829
- "xmlns": "http://www.w3.org/2000/svg",
15830
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
15831
- }, [createVNode("g", {
15846
+ "xmlns": "http://www.w3.org/2000/svg"
15847
+ }, XLINK), [createVNode("g", {
15832
15848
  "stroke": "none",
15833
15849
  "stroke-width": "1",
15834
15850
  "fill": "none",
15835
15851
  "fill-rule": "evenodd"
15836
15852
  }, [createVNode("path", {
15837
15853
  "class": ns$6.e("warning-outer"),
15838
- "d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
15854
+ "d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506, 15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049, 0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071, 0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
15839
15855
  }, null), createVNode("path", {
15840
15856
  "class": ns$6.e("warning-inner"),
15841
15857
  "stroke-width": "0.3",
@@ -15844,14 +15860,13 @@ function WarningIcon() {
15844
15860
  }, null)])]);
15845
15861
  }
15846
15862
  function InfoIcon() {
15847
- return createVNode("svg", {
15863
+ return createVNode("svg", mergeProps({
15848
15864
  "width": "16px",
15849
15865
  "height": "16px",
15850
15866
  "viewBox": "0 0 16 16",
15851
15867
  "version": "1.1",
15852
- "xmlns": "http://www.w3.org/2000/svg",
15853
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
15854
- }, [createVNode("g", {
15868
+ "xmlns": "http://www.w3.org/2000/svg"
15869
+ }, XLINK), [createVNode("g", {
15855
15870
  "id": "info",
15856
15871
  "stroke": "none",
15857
15872
  "stroke-width": "1",
@@ -15864,14 +15879,13 @@ function InfoIcon() {
15864
15879
  }, null)])]);
15865
15880
  }
15866
15881
  function ErrorIcon() {
15867
- return createVNode("svg", {
15882
+ return createVNode("svg", mergeProps({
15868
15883
  "width": "16px",
15869
15884
  "height": "16px",
15870
15885
  "viewBox": "0 0 16 16",
15871
15886
  "version": "1.1",
15872
- "xmlns": "http://www.w3.org/2000/svg",
15873
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
15874
- }, [createVNode("defs", null, [createVNode("polygon", {
15887
+ "xmlns": "http://www.w3.org/2000/svg"
15888
+ }, XLINK), [createVNode("defs", null, [createVNode("polygon", {
15875
15889
  "id": "path-e",
15876
15890
  "points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
15877
15891
  }, null)]), createVNode("g", {
@@ -15883,13 +15897,10 @@ function ErrorIcon() {
15883
15897
  }, [createVNode("mask", {
15884
15898
  "id": "mask-2",
15885
15899
  "fill": "white"
15886
- }, [createVNode("use", {
15887
- "xlink:href": "#path-e"
15888
- }, null)]), createVNode("use", {
15900
+ }, [createVNode("use", XLINK_HREF$1, null)]), createVNode("use", mergeProps({
15889
15901
  "id": "Mask",
15890
- "class": ns$6.e("image-error-path"),
15891
- "xlink:href": "#path-e"
15892
- }, null)])]);
15902
+ "class": ns$6.e("image-error-path")
15903
+ }, XLINK_HREF$1), null)])]);
15893
15904
  }
15894
15905
  var TypeIcon = defineComponent({
15895
15906
  props: {
@@ -15924,7 +15935,7 @@ function useEvent(props, emit) {
15924
15935
  let timestamp;
15925
15936
  const close2 = () => {
15926
15937
  var _a;
15927
- clearTimeout(timer);
15938
+ timer && clearTimeout(timer);
15928
15939
  timer = null;
15929
15940
  (_a = props.onClose) == null ? void 0 : _a.call(props);
15930
15941
  emit("update:modelValue", false);
@@ -16051,7 +16062,7 @@ class NotificationService {
16051
16062
  initInstance(props, content2);
16052
16063
  props.modelValue = true;
16053
16064
  clearTimeout(timer);
16054
- if (options.duration) {
16065
+ if (options.duration && props.onClose) {
16055
16066
  timer = setTimeout(props.onClose, options.duration);
16056
16067
  }
16057
16068
  }
@@ -17930,7 +17941,7 @@ var Search = defineComponent({
17930
17941
  onFocus,
17931
17942
  onBlur
17932
17943
  };
17933
- return createVNode("div", {
17944
+ return createVNode("label", {
17934
17945
  "class": rootClasses.value
17935
17946
  }, [props.iconPosition === "left" && createVNode("div", {
17936
17947
  "class": ns2.e("icon"),
@@ -17983,6 +17994,14 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus, t) {
17983
17994
  const selectDisabled = computed(() => (formContext == null ? void 0 : formContext.disabled) || props.disabled);
17984
17995
  const selectSize = computed(() => (formContext == null ? void 0 : formContext.size) || props.size);
17985
17996
  const isObjectOption = ref(false);
17997
+ const originRef = ref();
17998
+ const dropdownWidth = computed(() => {
17999
+ var _a;
18000
+ if (!((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth)) {
18001
+ return "100%";
18002
+ }
18003
+ return originRef.value.clientWidth + "px";
18004
+ });
17986
18005
  const isOpen = ref(false);
17987
18006
  const toggleChange = (bool) => {
17988
18007
  if (selectDisabled.value) {
@@ -18132,8 +18151,8 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus, t) {
18132
18151
  getMultipleSelected(checkedItems);
18133
18152
  } else {
18134
18153
  ctx2.emit("update:modelValue", item.value);
18135
- toggleChange(false);
18136
18154
  getSingleSelected(item);
18155
+ toggleChange(false);
18137
18156
  }
18138
18157
  };
18139
18158
  const handleClose = () => {
@@ -18236,6 +18255,7 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus, t) {
18236
18255
  selectDisabled,
18237
18256
  selectSize,
18238
18257
  containerRef,
18258
+ originRef,
18239
18259
  dropdownRef,
18240
18260
  isOpen,
18241
18261
  selectCls,
@@ -18246,6 +18266,7 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus, t) {
18246
18266
  emptyText,
18247
18267
  isLoading,
18248
18268
  isShowEmptyText,
18269
+ dropdownWidth,
18249
18270
  onClick,
18250
18271
  handleClear,
18251
18272
  valueChange,
@@ -18762,7 +18783,9 @@ var SelectContent = defineComponent({
18762
18783
  "trigger": "hover",
18763
18784
  "disabled": isDisabledTooltip.value
18764
18785
  }, {
18765
- default: () => createVNode(Tag, null, {
18786
+ default: () => createVNode(Tag, {
18787
+ "size": tagSize.value
18788
+ }, {
18766
18789
  default: () => [`+${selectedData.value.length - 1}`]
18767
18790
  }),
18768
18791
  content: () => createVNode("div", null, [selectedData.value.map((item) => createVNode(Tag, {
@@ -18851,6 +18874,7 @@ var Select = defineComponent({
18851
18874
  selectDisabled,
18852
18875
  selectSize,
18853
18876
  containerRef,
18877
+ originRef,
18854
18878
  dropdownRef,
18855
18879
  isOpen,
18856
18880
  selectCls,
@@ -18861,6 +18885,7 @@ var Select = defineComponent({
18861
18885
  emptyText,
18862
18886
  isLoading,
18863
18887
  isShowEmptyText,
18888
+ dropdownWidth,
18864
18889
  onClick,
18865
18890
  valueChange,
18866
18891
  handleClear,
@@ -18886,6 +18911,11 @@ var Select = defineComponent({
18886
18911
  blur,
18887
18912
  toggleChange
18888
18913
  });
18914
+ const isRender = ref(false);
18915
+ const position = ref(["bottom-start", "top-start"]);
18916
+ onMounted(() => {
18917
+ isRender.value = true;
18918
+ });
18889
18919
  provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
18890
18920
  selectDisabled,
18891
18921
  selectSize,
@@ -18905,43 +18935,61 @@ var Select = defineComponent({
18905
18935
  "class": selectCls.value,
18906
18936
  "ref": containerRef,
18907
18937
  "onClick": onClick
18938
+ }, [createVNode("div", {
18939
+ "ref": originRef
18908
18940
  }, [createVNode(SelectContent, {
18909
18941
  "ref": selectRef,
18910
18942
  "value": inputValue.value
18911
- }, null), createVNode(Transition, {
18912
- "name": "fade",
18913
- "ref": dropdownRef
18943
+ }, null)]), createVNode(Transition, {
18944
+ "name": "fade"
18914
18945
  }, {
18915
- default: () => {
18916
- var _a, _b, _c, _d;
18917
- return [withDirectives(createVNode("div", {
18918
- "class": dropdownCls
18919
- }, [withDirectives(createVNode("ul", {
18920
- "class": listCls
18921
- }, [isShowCreateOption.value && createVNode(Option, {
18922
- "value": filterQuery.value,
18923
- "name": filterQuery.value,
18924
- "create": true
18925
- }, {
18926
- default: () => [props.multiple ? createVNode(Checkbox, {
18927
- "modelValue": false,
18928
- "label": filterQuery.value
18929
- }, null) : filterQuery.value]
18930
- }), ((_a = ctx2.slots) == null ? void 0 : _a.default) && ctx2.slots.default(), !((_b = ctx2.slots) == null ? void 0 : _b.default) && mergeOptions.value.length >= 1 && mergeOptions.value.map((item, i) => createVNode(Option, {
18931
- "key": i,
18932
- "value": item.value,
18933
- "name": item.name,
18934
- "disabled": isDisabled(item)
18935
- }, {
18936
- default: () => [props.multiple ? createVNode(Checkbox, {
18937
- "modelValue": item._checked,
18938
- "label": item.name,
18946
+ default: () => [createVNode(FlexibleOverlay, {
18947
+ "modelValue": isRender.value,
18948
+ "onUpdate:modelValue": ($event) => isRender.value = $event,
18949
+ "ref": dropdownRef,
18950
+ "origin": originRef.value,
18951
+ "align": "start",
18952
+ "position": position.value,
18953
+ "style": {
18954
+ visibility: isOpen.value ? "visible" : "hidden",
18955
+ "z-index": isOpen.value ? 1e3 : -1
18956
+ }
18957
+ }, {
18958
+ default: () => {
18959
+ var _a, _b, _c, _d;
18960
+ return [createVNode("div", {
18961
+ "class": dropdownCls,
18962
+ "style": {
18963
+ width: `${dropdownWidth.value}`,
18964
+ visibility: isOpen.value ? "visible" : "hidden"
18965
+ }
18966
+ }, [withDirectives(createVNode("ul", {
18967
+ "class": listCls
18968
+ }, [isShowCreateOption.value && createVNode(Option, {
18969
+ "value": filterQuery.value,
18970
+ "name": filterQuery.value,
18971
+ "create": true
18972
+ }, {
18973
+ default: () => [props.multiple ? createVNode(Checkbox, {
18974
+ "modelValue": false,
18975
+ "label": filterQuery.value
18976
+ }, null) : filterQuery.value]
18977
+ }), ((_a = ctx2.slots) == null ? void 0 : _a.default) && ctx2.slots.default(), !((_b = ctx2.slots) == null ? void 0 : _b.default) && mergeOptions.value.length >= 1 && mergeOptions.value.map((item, i) => createVNode(Option, {
18978
+ "key": i,
18979
+ "value": item.value,
18980
+ "name": item.name,
18939
18981
  "disabled": isDisabled(item)
18940
- }, null) : item.name || item.value]
18941
- }))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx2.slots) == null ? void 0 : _c.empty) && ctx2.slots.empty(), !((_d = ctx2.slots) == null ? void 0 : _d.empty) && createVNode("p", {
18942
- "class": dropdownEmptyCls
18943
- }, [emptyText.value])])]), [[vShow, isOpen.value]])];
18944
- }
18982
+ }, {
18983
+ default: () => [props.multiple ? createVNode(Checkbox, {
18984
+ "modelValue": item._checked,
18985
+ "label": item.name,
18986
+ "disabled": isDisabled(item)
18987
+ }, null) : item.name || item.value]
18988
+ }))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx2.slots) == null ? void 0 : _c.empty) && ctx2.slots.empty(), !((_d = ctx2.slots) == null ? void 0 : _d.empty) && createVNode("p", {
18989
+ "class": dropdownEmptyCls
18990
+ }, [emptyText.value])])])];
18991
+ }
18992
+ })]
18945
18993
  })]);
18946
18994
  };
18947
18995
  }
@@ -21160,6 +21208,32 @@ function useExpand(dataSource, table2) {
21160
21208
  toggleRowExpansion
21161
21209
  };
21162
21210
  }
21211
+ function useEditTableCell() {
21212
+ const tableInstance = getCurrentInstance();
21213
+ const rowKey = tableInstance.props.rowKey || "";
21214
+ const tableCellModeMap = ref(/* @__PURE__ */ new Map());
21215
+ const setCellMode = (row2, rowIndex, fields, cellMode) => {
21216
+ if (Array.isArray(fields)) {
21217
+ fields.forEach((item) => {
21218
+ const cellKey = `${getRowIdentity(row2, rowKey, rowIndex)}-${item}-cell`;
21219
+ tableCellModeMap.value.set(cellKey, cellMode);
21220
+ });
21221
+ } else {
21222
+ const cellKey = `${getRowIdentity(row2, rowKey, rowIndex)}-${fields}-cell`;
21223
+ tableCellModeMap.value.set(cellKey, cellMode);
21224
+ }
21225
+ };
21226
+ const resetCellMode = () => {
21227
+ for (const item of tableCellModeMap.value.keys()) {
21228
+ tableCellModeMap.value.set(item, "readonly");
21229
+ }
21230
+ };
21231
+ return {
21232
+ tableCellModeMap,
21233
+ setCellMode,
21234
+ resetCellMode
21235
+ };
21236
+ }
21163
21237
  function replaceColumn(array4, column2) {
21164
21238
  return array4.map((item) => {
21165
21239
  var _a;
@@ -21192,6 +21266,7 @@ function createColumnGenerator() {
21192
21266
  });
21193
21267
  };
21194
21268
  const insertColumn = (column2, parent) => {
21269
+ var _a;
21195
21270
  const array4 = unref(_columns);
21196
21271
  let newColumns = [];
21197
21272
  if (!parent) {
@@ -21201,7 +21276,7 @@ function createColumnGenerator() {
21201
21276
  if (parent && !parent.children) {
21202
21277
  parent.children = [];
21203
21278
  }
21204
- parent.children.push(column2);
21279
+ (_a = parent == null ? void 0 : parent.children) == null ? void 0 : _a.push(column2);
21205
21280
  newColumns = replaceColumn(array4, parent);
21206
21281
  }
21207
21282
  sortColumn();
@@ -21370,6 +21445,7 @@ function createStore(dataSource, table2) {
21370
21445
  const { sortData, thList } = createSorter(dataSource, flatRows);
21371
21446
  const { isFixedLeft } = createFixedLogic(_columns);
21372
21447
  const { isRowExpanded, updateExpandRows, setExpandRows, toggleRowExpansion } = useExpand(_data, table2);
21448
+ const { tableCellModeMap, setCellMode, resetCellMode } = useEditTableCell();
21373
21449
  watch(dataSource, (value) => {
21374
21450
  _data.value = [...value];
21375
21451
  updateExpandRows();
@@ -21388,7 +21464,8 @@ function createStore(dataSource, table2) {
21388
21464
  _halfChecked,
21389
21465
  isFixedLeft,
21390
21466
  thList,
21391
- firstDefaultColumn
21467
+ firstDefaultColumn,
21468
+ tableCellModeMap
21392
21469
  },
21393
21470
  insertColumn,
21394
21471
  sortColumn,
@@ -21403,7 +21480,9 @@ function createStore(dataSource, table2) {
21403
21480
  setExpandRows,
21404
21481
  toggleRowExpansion,
21405
21482
  toggleRowSelection,
21406
- updateFirstDefaultColumn
21483
+ updateFirstDefaultColumn,
21484
+ setCellMode,
21485
+ resetCellMode
21407
21486
  };
21408
21487
  }
21409
21488
  var ColGroup = defineComponent({
@@ -21428,6 +21507,9 @@ const sortProps = {
21428
21507
  }
21429
21508
  };
21430
21509
  var sort = "";
21510
+ const XLINK_HREF = {
21511
+ "xlink:href": "#sort-svg-path-1"
21512
+ };
21431
21513
  var Sort = defineComponent({
21432
21514
  props: sortProps,
21433
21515
  emits: ["sort"],
@@ -21486,10 +21568,9 @@ var Sort = defineComponent({
21486
21568
  "stroke-width": "1",
21487
21569
  "fill": "none",
21488
21570
  "fill-rule": "evenodd"
21489
- }, [createVNode("use", {
21490
- "fill-rule": "evenodd",
21491
- "xlink:href": "#sort-svg-path-1"
21492
- }, null), createVNode("polygon", {
21571
+ }, [createVNode("use", mergeProps({
21572
+ "fill-rule": "evenodd"
21573
+ }, XLINK_HREF), null), createVNode("polygon", {
21493
21574
  "points": "8 4 11 7 5 7"
21494
21575
  }, null), createVNode("polygon", {
21495
21576
  "points": "8 12 5 9 11 9"
@@ -21879,14 +21960,21 @@ function useDragColumnWidth(elementRef, column2) {
21879
21960
  };
21880
21961
  return { resizing, dragClass, onMousedown: onMousedown2 };
21881
21962
  }
21963
+ const headerThProps = {
21964
+ column: {
21965
+ type: Object,
21966
+ required: true
21967
+ },
21968
+ colspan: {
21969
+ type: Number
21970
+ },
21971
+ rowspan: {
21972
+ type: Number
21973
+ }
21974
+ };
21882
21975
  var TH = defineComponent({
21883
21976
  name: "DTableHeaderTh",
21884
- props: {
21885
- column: {
21886
- type: Object,
21887
- required: true
21888
- }
21889
- },
21977
+ props: headerThProps,
21890
21978
  setup(props, {
21891
21979
  expose
21892
21980
  }) {
@@ -21972,7 +22060,7 @@ function convertToRows(originColumns) {
21972
22060
  let colSpan = 0;
21973
22061
  column2.children.forEach((subColumn) => {
21974
22062
  traverse(subColumn, column2);
21975
- colSpan += subColumn.colSpan;
22063
+ colSpan += subColumn.colSpan || 0;
21976
22064
  });
21977
22065
  column2.colSpan = colSpan;
21978
22066
  } else {
@@ -21990,7 +22078,7 @@ function convertToRows(originColumns) {
21990
22078
  const allColumns = getAllColumns(originColumns);
21991
22079
  allColumns.forEach((column2) => {
21992
22080
  if (!column2.children) {
21993
- column2.rowSpan = maxLevel - column2.level + 1;
22081
+ column2.rowSpan = maxLevel - (column2.level || 0) + 1;
21994
22082
  } else {
21995
22083
  column2.rowSpan = 1;
21996
22084
  column2.children.forEach((col2) => col2.isSubColumn = true);
@@ -22034,6 +22122,12 @@ const bodyTdProps = {
22034
22122
  type: Object,
22035
22123
  default: () => ({})
22036
22124
  },
22125
+ rowspan: {
22126
+ type: Number
22127
+ },
22128
+ colspan: {
22129
+ type: Number
22130
+ },
22037
22131
  index: {
22038
22132
  type: Number,
22039
22133
  default: 0
@@ -22047,11 +22141,12 @@ var TooltipInstall = {
22047
22141
  app.component(Tooltip.name, Tooltip);
22048
22142
  }
22049
22143
  };
22050
- function useBodyTd(props) {
22144
+ function useBodyTd(props, ctx2) {
22051
22145
  const tooltipContent = ref();
22052
22146
  const isShowTooltip = ref(false);
22053
22147
  const tdRef = ref();
22054
22148
  let observer;
22149
+ const table2 = inject(TABLE_TOKEN);
22055
22150
  function getTooltipContent() {
22056
22151
  var _a, _b;
22057
22152
  return ((_a = tdRef.value) == null ? void 0 : _a.innerText) || ((_b = tdRef.value) == null ? void 0 : _b.textContent);
@@ -22065,24 +22160,50 @@ function useBodyTd(props) {
22065
22160
  range3.setEnd(tdRef.value, tdRef.value.childNodes.length);
22066
22161
  const rangeWidth = range3.getBoundingClientRect().width;
22067
22162
  const padding = parseInt(window.getComputedStyle(tdRef.value)["paddingLeft"], 10) + parseInt(window.getComputedStyle(tdRef.value)["paddingRight"], 10);
22068
- isShowTooltip.value = props.column.showOverflowTooltip && rangeWidth + padding > tdRef.value.offsetWidth;
22163
+ isShowTooltip.value = !!(props.column.showOverflowTooltip && rangeWidth + padding > tdRef.value.offsetWidth);
22069
22164
  }
22070
22165
  onMounted(() => {
22071
22166
  if (inBrowser && window.ResizeObserver && props.column.showOverflowTooltip) {
22072
- const observer2 = new window.ResizeObserver(shouldShowTooltip);
22073
- tdRef.value && observer2.observe(tdRef.value);
22167
+ const innerObserver = new window.ResizeObserver(shouldShowTooltip);
22168
+ tdRef.value && innerObserver.observe(tdRef.value);
22074
22169
  }
22075
22170
  tooltipContent.value = getTooltipContent();
22076
22171
  });
22077
22172
  onBeforeMount(() => {
22078
22173
  tdRef.value && observer.unobserve(tdRef.value);
22079
22174
  });
22080
- return { tdRef, isShowTooltip, tooltipContent };
22175
+ onUpdated(() => {
22176
+ const modeMap = table2.store.states.tableCellModeMap.value;
22177
+ for (const child of modeMap.keys()) {
22178
+ modeMap.set(child, "readonly");
22179
+ }
22180
+ });
22181
+ const getCellKsy = () => {
22182
+ return `${getRowIdentity(props.row, table2.props.rowKey, props.index)}-${props.column.field}-cell`;
22183
+ };
22184
+ const cellMode = computed(() => {
22185
+ const cellKey = getCellKsy();
22186
+ const mode = table2.store.states.tableCellModeMap.value.get(cellKey);
22187
+ return mode || "readonly";
22188
+ });
22189
+ const onCellClick = () => {
22190
+ const modeMap = table2.store.states.tableCellModeMap.value;
22191
+ const cellKey = getCellKsy();
22192
+ for (const child of modeMap.keys()) {
22193
+ modeMap.set(child, "readonly");
22194
+ }
22195
+ if (props.column.type === "editable" && modeMap.get(cellKey) === "edit") {
22196
+ return;
22197
+ }
22198
+ ctx2.emit("cellClick");
22199
+ };
22200
+ return { tdRef, isShowTooltip, tooltipContent, cellMode, onCellClick };
22081
22201
  }
22082
22202
  var TD = defineComponent({
22083
22203
  name: "DTableBodyTd",
22084
22204
  inheritAttrs: false,
22085
22205
  props: bodyTdProps,
22206
+ emits: ["cellClick"],
22086
22207
  setup(props, ctx2) {
22087
22208
  const column2 = toRef(props, "column");
22088
22209
  const table2 = inject(TABLE_TOKEN);
@@ -22093,8 +22214,10 @@ var TD = defineComponent({
22093
22214
  const {
22094
22215
  tdRef,
22095
22216
  isShowTooltip,
22096
- tooltipContent
22097
- } = useBodyTd(props);
22217
+ tooltipContent,
22218
+ cellMode,
22219
+ onCellClick
22220
+ } = useBodyTd(props, ctx2);
22098
22221
  return () => {
22099
22222
  return createVNode(Tooltip, {
22100
22223
  "content": tooltipContent.value,
@@ -22106,7 +22229,9 @@ var TD = defineComponent({
22106
22229
  "ref": tdRef,
22107
22230
  "class": stickyClass.value,
22108
22231
  "style": stickyStyle.value
22109
- }, ctx2.attrs), [(_b = (_a = props.column).renderCell) == null ? void 0 : _b.call(_a, props.row, props.column, table2.store, props.index, table2.props)])];
22232
+ }, ctx2.attrs, {
22233
+ "onClick": onCellClick
22234
+ }), [(_b = (_a = props.column).renderCell) == null ? void 0 : _b.call(_a, props.row, props.column, table2.store, props.index, table2.props, cellMode)])];
22110
22235
  }
22111
22236
  });
22112
22237
  };
@@ -22227,7 +22352,7 @@ var TableBody = defineComponent({
22227
22352
  "row": row2,
22228
22353
  "rowspan": rowspan,
22229
22354
  "colspan": colspan,
22230
- "onClick": () => onCellClick({
22355
+ "onCellClick": () => onCellClick({
22231
22356
  rowIndex,
22232
22357
  columnIndex,
22233
22358
  column: column2,
@@ -22527,7 +22652,7 @@ const cellMap = {
22527
22652
  renderHeader() {
22528
22653
  return createVNode("span", null, null);
22529
22654
  },
22530
- renderCell(rowData, column2, store, rowIndex) {
22655
+ renderCell(rowData, column2, store) {
22531
22656
  return createVNode(DIcon, {
22532
22657
  "name": "chevron-right",
22533
22658
  "class": "icon-expand-row",
@@ -22537,6 +22662,44 @@ const cellMap = {
22537
22662
  }, null);
22538
22663
  }
22539
22664
  },
22665
+ editable: {
22666
+ renderHeader(column2) {
22667
+ var _a;
22668
+ return h("span", {
22669
+ class: "title"
22670
+ }, (_a = column2.header) != null ? _a : "");
22671
+ },
22672
+ renderCell(rowData, column2, store, rowIndex, props, cellMode, ctx2) {
22673
+ var _a, _b;
22674
+ let columnValue;
22675
+ if (cellMode.value === "edit") {
22676
+ columnValue = ctx2.slots.cellEdit ? ctx2.slots.cellEdit({
22677
+ row: rowData,
22678
+ rowIndex
22679
+ }) : "";
22680
+ } else {
22681
+ if (ctx2.slots.cell) {
22682
+ columnValue = createVNode("div", {
22683
+ "class": "cell-text"
22684
+ }, [ctx2.slots.cell({
22685
+ row: rowData,
22686
+ rowIndex
22687
+ })]);
22688
+ } else {
22689
+ const value = column2.field ? rowData[column2.field] : "";
22690
+ if (column2.formatter) {
22691
+ columnValue = column2.formatter(rowData, column2, value, rowIndex);
22692
+ }
22693
+ columnValue = createVNode("div", {
22694
+ "class": "cell-text"
22695
+ }, [(_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : ""]);
22696
+ }
22697
+ }
22698
+ return h("div", {
22699
+ class: [ns$3.e("cell"), column2.type === "editable" && (cellMode == null ? void 0 : cellMode.value) === "readonly" && "editable-cell"]
22700
+ }, columnValue);
22701
+ }
22702
+ },
22540
22703
  default: {
22541
22704
  renderHeader(column2) {
22542
22705
  var _a;
@@ -22544,7 +22707,7 @@ const cellMap = {
22544
22707
  class: "title"
22545
22708
  }, (_a = column2.header) != null ? _a : "");
22546
22709
  },
22547
- renderCell(rowData, column2, store, rowIndex, props, ctx2) {
22710
+ renderCell(rowData, column2, store, rowIndex, props, cellMode, ctx2) {
22548
22711
  var _a, _b, _c;
22549
22712
  let columnValue;
22550
22713
  if (ctx2.slots.default) {
@@ -22625,11 +22788,11 @@ function createColumn(id, props, ctx2) {
22625
22788
  }
22626
22789
  return cellMap[type4.value || "default"].renderHeader(columnItem, store);
22627
22790
  }
22628
- function renderCell(rowData, columnItem, store, rowIndex, tableProps2) {
22791
+ function renderCell(rowData, columnItem, store, rowIndex, tableProps2, cellMode) {
22629
22792
  if (ctx2.slots.default && columnItem.type === "index") {
22630
22793
  return ctx2.slots.default({ row: rowData, rowIndex });
22631
22794
  }
22632
- return cellMap[type4.value || "default"].renderCell(rowData, columnItem, store, rowIndex, tableProps2, ctx2);
22795
+ return cellMap[type4.value || "default"].renderCell(rowData, columnItem, store, rowIndex, tableProps2, cellMode, ctx2);
22633
22796
  }
22634
22797
  watch([field, header2, order], ([fieldVal, headerVal, orderVal]) => {
22635
22798
  column2.field = fieldVal;
@@ -22697,7 +22860,6 @@ var Column = defineComponent({
22697
22860
  props: tableColumnProps,
22698
22861
  emits: ["filter-change", "resize-start", "resizing", "resize-end"],
22699
22862
  setup(props, ctx2) {
22700
- toRefs(props);
22701
22863
  const owner = inject(TABLE_TOKEN);
22702
22864
  const isSubColumn = ref(false);
22703
22865
  const {
@@ -22713,8 +22875,8 @@ var Column = defineComponent({
22713
22875
  isSubColumn.value = owner !== parent;
22714
22876
  });
22715
22877
  onMounted(() => {
22716
- var _a;
22717
- const children = isSubColumn.value ? parent.vnode.el.children : (_a = owner == null ? void 0 : owner.hiddenColumns.value) == null ? void 0 : _a.children;
22878
+ var _a, _b, _c;
22879
+ const children = isSubColumn.value ? (_b = (_a = parent == null ? void 0 : parent.vnode) == null ? void 0 : _a.el) == null ? void 0 : _b.children : (_c = owner == null ? void 0 : owner.hiddenColumns.value) == null ? void 0 : _c.children;
22718
22880
  const columnIndex = getColumnIndex(children || [], instance.vnode.el);
22719
22881
  columnIndex > -1 && (owner == null ? void 0 : owner.store.insertColumn(column2, isSubColumn.value ? parent.columnConfig : null));
22720
22882
  if (typeof props.checkable === "function") {
@@ -22738,7 +22900,7 @@ var Column = defineComponent({
22738
22900
  column: {},
22739
22901
  $index: -1
22740
22902
  });
22741
- return createVNode("div", null, [Array.isArray(defaultSlot) ? defaultSlot.filter((child) => child.type.name === "DColumn").map((child) => createVNode(Fragment, null, [child])) : createVNode("div", null, null)]);
22903
+ return createVNode("div", null, [defaultSlot && Array.isArray(defaultSlot) ? defaultSlot.filter((child) => child.type.name === "DColumn").map((child) => createVNode(Fragment, null, [child])) : createVNode("div", null, null)]);
22742
22904
  };
22743
22905
  }
22744
22906
  });
@@ -22832,8 +22994,9 @@ function useTabNavFunction(props, tabs2, data, ctx2, tabsEle) {
22832
22994
  const update = () => {
22833
22995
  if (props.type === "slider") {
22834
22996
  setTimeout(() => {
22835
- const tabEle = tabsEle.value.querySelector("#" + props.modelValue + ".active");
22836
- if (tabEle) {
22997
+ var _a;
22998
+ const tabEle = (_a = tabsEle.value) == null ? void 0 : _a.querySelector("#" + props.modelValue + ".active");
22999
+ if (tabEle && tabsEle.value) {
22837
23000
  if (["top", "bottom"].includes(props.tabPosition)) {
22838
23001
  data.offsetLeft = tabEle.getBoundingClientRect().left - tabsEle.value.getBoundingClientRect().left;
22839
23002
  } else {
@@ -22864,13 +23027,14 @@ function useTabNavFunction(props, tabs2, data, ctx2, tabsEle) {
22864
23027
  return;
22865
23028
  }
22866
23029
  canChange(item.id).then((change) => {
23030
+ var _a, _b;
22867
23031
  if (!change) {
22868
23032
  return;
22869
23033
  }
22870
- const tab2 = tabs2.state.data.find((itemOption) => itemOption.id === item.id);
22871
- if (tab2 && !tab2.disabled) {
23034
+ const tab2 = (_b = (_a = tabs2 == null ? void 0 : tabs2.state) == null ? void 0 : _a.data) == null ? void 0 : _b.find((itemOption) => itemOption.id === item.id);
23035
+ if (tabs2 && tab2 && !tab2.disabled) {
22872
23036
  tabs2.state.active = item.id;
22873
- if (props.type === "slider" && tabEl && tabsEle) {
23037
+ if (props.type === "slider" && tabEl && tabsEle && tabsEle.value) {
22874
23038
  if (["left", "right"].includes(props.tabPosition)) {
22875
23039
  data.offsetLeft = tabEl.getBoundingClientRect().left - tabsEle.value.nativeElement.getBoundingClientRect().left;
22876
23040
  } else {
@@ -22884,13 +23048,17 @@ function useTabNavFunction(props, tabs2, data, ctx2, tabsEle) {
22884
23048
  });
22885
23049
  };
22886
23050
  const beforeMount = () => {
22887
- if (props.type !== "slider" && props.modelValue === void 0 && tabs2.state.data.length > 0) {
23051
+ if (props.type !== "slider" && props.modelValue === void 0 && (tabs2 == null ? void 0 : tabs2.state.data) && tabs2.state.data.length > 0) {
22888
23052
  activeClick(tabs2.state.data[0]);
22889
23053
  }
22890
23054
  };
22891
23055
  const mounted = () => {
22892
- if (props.type === "slider" && props.modelValue === void 0 && tabs2.state.data.length > 0 && tabs2.state.data[0]) {
22893
- activeClick(tabs2.state.data[0].tabsEle.value.getElementById(tabs2.state.data[0].tabId));
23056
+ var _a;
23057
+ if (props.type === "slider" && props.modelValue === void 0 && (tabs2 == null ? void 0 : tabs2.state.data) && tabs2.state.data.length > 0 && tabs2.state.data[0]) {
23058
+ const tabsStateData = tabs2.state.data[0];
23059
+ const dom = (_a = tabsStateData.tabsEle) == null ? void 0 : _a.value;
23060
+ const ele = dom == null ? void 0 : dom.getElementById(tabsStateData.tabId);
23061
+ activeClick(ele);
22894
23062
  }
22895
23063
  };
22896
23064
  const tabCanClose = (item) => {
@@ -22974,6 +23142,7 @@ var TabNav = defineComponent({
22974
23142
  "role": "tablist",
22975
23143
  "class": ulClasses.value
22976
23144
  }, [((tabs2 == null ? void 0 : tabs2.state.data) || []).map((item, i) => {
23145
+ var _a, _b;
22977
23146
  return createVNode("li", {
22978
23147
  "role": "presentation",
22979
23148
  "onClick": () => {
@@ -22989,7 +23158,7 @@ var TabNav = defineComponent({
22989
23158
  "aria-expanded": props.modelValue === (item.id || item.tabId),
22990
23159
  "class": aClasses.value,
22991
23160
  "style": customStyle
22992
- }, [(tabs2 == null ? void 0 : tabs2.state.slots[i]) ? tabs2.state.slots[i]() : createVNode("span", null, [item.title])]), closeIconEl(item)])]);
23161
+ }, [(tabs2 == null ? void 0 : tabs2.state.slots[i]) ? (_b = (_a = tabs2.state.slots)[i]) == null ? void 0 : _b.call(_a) : createVNode("span", null, [item.title])]), closeIconEl(item)])]);
22993
23162
  }), newButton, createVNode("div", {
22994
23163
  "class": ns2.e(`nav-${props.type}-animation`),
22995
23164
  "style": sliderAnimationStyle.value
@@ -23098,14 +23267,17 @@ var Tab = defineComponent({
23098
23267
  (_a = tabs2 == null ? void 0 : tabs2.state.data) == null ? void 0 : _a.push(props);
23099
23268
  const ns2 = useNamespace("tab");
23100
23269
  onUnmounted(() => {
23101
- tabs2.state.data = tabs2.state.data.filter((tab2) => tab2.id !== props.id);
23270
+ var _a2;
23271
+ if (tabs2) {
23272
+ tabs2.state.data = (_a2 = tabs2.state.data) == null ? void 0 : _a2.filter((tab2) => tab2.id !== props.id);
23273
+ }
23102
23274
  });
23103
23275
  return () => {
23104
23276
  var _a2;
23105
23277
  const {
23106
23278
  id
23107
23279
  } = props;
23108
- const content2 = tabs2.state.showContent && tabs2.state.active === id ? createVNode("div", {
23280
+ const content2 = (tabs2 == null ? void 0 : tabs2.state.showContent) && tabs2.state.active === id ? createVNode("div", {
23109
23281
  "class": ns2.e("content")
23110
23282
  }, [createVNode("div", {
23111
23283
  "role": "tabpanel"
@@ -23634,6 +23806,7 @@ var TimePicker = defineComponent({
23634
23806
  const activeMinute = ref("00");
23635
23807
  const activeSecond = ref("00");
23636
23808
  const format2 = props.format.toLowerCase();
23809
+ const position = ref(["bottom-start", "top-start"]);
23637
23810
  const {
23638
23811
  showPopup,
23639
23812
  trueTimeValue,
@@ -23702,7 +23875,9 @@ var TimePicker = defineComponent({
23702
23875
  "modelValue": showPopup.value,
23703
23876
  "onUpdate:modelValue": ($event) => showPopup.value = $event,
23704
23877
  "ref": overlayRef,
23705
- "origin": inputDom.value
23878
+ "origin": inputDom.value,
23879
+ "position": position.value,
23880
+ "align": "start"
23706
23881
  }, {
23707
23882
  default: () => [createVNode(TimePopup, {
23708
23883
  "ref": timePopupDom,
@@ -24195,6 +24370,19 @@ var DTreeNodeToggle = defineComponent({
24195
24370
  };
24196
24371
  }
24197
24372
  });
24373
+ var DTreeNodeLoading = defineComponent({
24374
+ name: "DTreeNodeLoading",
24375
+ setup() {
24376
+ const app = getCurrentInstance();
24377
+ const t = createI18nTranslate("DTree", app);
24378
+ const ns2 = useNamespace("loading-children ");
24379
+ return () => {
24380
+ return createVNode("span", {
24381
+ "class": ns2.b()
24382
+ }, [`${t("loading") || "Loading"}...`]);
24383
+ };
24384
+ }
24385
+ });
24198
24386
  const ns = useNamespace("tree");
24199
24387
  function useTreeNode(data) {
24200
24388
  const nodeClass = computed(() => {
@@ -24213,9 +24401,9 @@ function useTreeNode(data) {
24213
24401
  if (!data.value || data.value.level === 1) {
24214
24402
  return [];
24215
24403
  }
24216
- const { currentIndex = 0, parentChildNode = 0, level, expanded, isLeaf } = data.value;
24404
+ const { currentIndex = 0, parentChildNodeCount = 0, level, expanded, isLeaf } = data.value;
24217
24405
  return Array.from({ length: data.value.level - 1 }).map((_, index2) => ({
24218
- height: `${currentIndex + 1 === parentChildNode && index2 === 0 ? isLeaf || !expanded ? NODE_HEIGHT / 2 : NODE_HEIGHT : NODE_HEIGHT}px`,
24406
+ height: `${currentIndex + 1 === parentChildNodeCount && index2 === 0 ? isLeaf || !expanded ? NODE_HEIGHT / 2 : NODE_HEIGHT : NODE_HEIGHT}px`,
24219
24407
  left: `${NODE_INDENT * (level - index2 - 2) + 9}px`,
24220
24408
  top: `0px`
24221
24409
  }));
@@ -24302,7 +24490,8 @@ var DTreeNode = defineComponent({
24302
24490
  toggleNode,
24303
24491
  getChildren,
24304
24492
  insertBefore,
24305
- removeNode
24493
+ removeNode,
24494
+ getNode
24306
24495
  } = inject(USE_TREE_TOKEN);
24307
24496
  const treeInstance = inject(TREE_INSTANCE);
24308
24497
  const ns2 = useNamespace("tree");
@@ -24352,6 +24541,7 @@ var DTreeNode = defineComponent({
24352
24541
  isShowOperationArea.value = false;
24353
24542
  };
24354
24543
  return () => {
24544
+ var _a;
24355
24545
  return createVNode("div", {
24356
24546
  "class": nodeClass.value,
24357
24547
  "style": nodeStyle.value,
@@ -24382,7 +24572,7 @@ var DTreeNode = defineComponent({
24382
24572
  nodeData: data
24383
24573
  }) : createVNode(DTreeNodeContent, {
24384
24574
  "data": data.value
24385
- }, null)]), operate.value && isShowOperationArea.value && createVNode("div", {
24575
+ }, null), ((_a = getNode == null ? void 0 : getNode(data.value)) == null ? void 0 : _a.loading) ? slots.loading ? renderSlot(useSlots(), "loading") : createVNode(DTreeNodeLoading, null, null) : ""]), operate.value && isShowOperationArea.value && createVNode("div", {
24386
24576
  "class": nodeOperationAreaClass.value
24387
24577
  }, [createVNode(resolveComponent("d-icon"), {
24388
24578
  "name": "add",
@@ -25371,24 +25561,25 @@ var VirtualList = defineComponent({
25371
25561
  }
25372
25562
  });
25373
25563
  function useToggle() {
25374
- return function useToggle2(data, core, context) {
25564
+ return function useToggle2(data, core, context, lazyLode) {
25375
25565
  const { getNode, setNodeValue } = core;
25566
+ const { lazyLoadNodes } = lazyLode;
25376
25567
  const expandNode = (node) => {
25377
- if (node.disableToggle) {
25568
+ if (node.disableToggle || node.loading) {
25378
25569
  return;
25379
25570
  }
25380
25571
  setNodeValue(node, "expanded", true);
25381
25572
  context.emit("toggle-change", node);
25382
25573
  };
25383
25574
  const collapseNode = (node) => {
25384
- if (node.disableToggle) {
25575
+ if (node.disableToggle || node.loading) {
25385
25576
  return;
25386
25577
  }
25387
25578
  setNodeValue(node, "expanded", false);
25388
25579
  context.emit("toggle-change", node);
25389
25580
  };
25390
25581
  const toggleNode = (node) => {
25391
- if (node.disableToggle) {
25582
+ if (node.disableToggle || node.loading) {
25392
25583
  return;
25393
25584
  }
25394
25585
  if (getNode(node).expanded) {
@@ -25396,6 +25587,7 @@ function useToggle() {
25396
25587
  } else {
25397
25588
  expandNode(node);
25398
25589
  }
25590
+ lazyLoadNodes(node);
25399
25591
  };
25400
25592
  const expandAllNodes = () => {
25401
25593
  data.value.forEach((node) => {
@@ -25416,17 +25608,18 @@ function omit(obj, ...keys) {
25416
25608
  function generateInnerTree(tree2, key = "children", level = 0, path = []) {
25417
25609
  level++;
25418
25610
  return tree2.reduce((acc, item, currentIndex) => {
25419
- var _a, _b;
25611
+ var _a, _b, _c;
25420
25612
  const newItem = Object.assign({}, item);
25421
25613
  if (newItem.id === void 0) {
25422
25614
  newItem.id = randomId();
25423
25615
  newItem.idType = "random";
25424
25616
  }
25425
25617
  newItem.level = level;
25426
- newItem.parentChildNode = tree2.length;
25618
+ newItem.parentChildNodeCount = tree2.length;
25427
25619
  newItem.currentIndex = currentIndex;
25428
- if (path.length > 0 && ((_a = path[path.length - 1]) == null ? void 0 : _a.level) >= level) {
25429
- while (((_b = path[path.length - 1]) == null ? void 0 : _b.level) >= level) {
25620
+ newItem.childNodeCount = ((_a = newItem.children) == null ? void 0 : _a.length) || 0;
25621
+ if (path.length > 0 && ((_b = path[path.length - 1]) == null ? void 0 : _b.level) >= level) {
25622
+ while (((_c = path[path.length - 1]) == null ? void 0 : _c.level) >= level) {
25430
25623
  path.pop();
25431
25624
  }
25432
25625
  }
@@ -25436,7 +25629,7 @@ function generateInnerTree(tree2, key = "children", level = 0, path = []) {
25436
25629
  newItem.parentId = parentNode.id;
25437
25630
  }
25438
25631
  if (!newItem[key]) {
25439
- return acc.concat(__spreadProps(__spreadValues({}, newItem), { isLeaf: true }));
25632
+ return acc.concat(__spreadProps(__spreadValues({}, newItem), { isLeaf: newItem.isLeaf === false ? false : true }));
25440
25633
  } else {
25441
25634
  return acc.concat(omit(newItem, "children"), generateInnerTree(newItem[key], key, level, path));
25442
25635
  }
@@ -25554,12 +25747,50 @@ function useCore() {
25554
25747
  };
25555
25748
  };
25556
25749
  }
25750
+ function useLazyLoad() {
25751
+ return function useLazyLoad2(data, core, context) {
25752
+ const { getNode, setNodeValue, getIndex, getChildren } = core;
25753
+ const setCommonParent = (node, nodes) => {
25754
+ nodes.value.forEach((item) => {
25755
+ if (item.level - 1 === node.level && !item.parentId) {
25756
+ item.parentId = node.id;
25757
+ }
25758
+ });
25759
+ };
25760
+ const insertChildrenNodes = (parent, nodes) => {
25761
+ const parentIndex = getIndex(parent);
25762
+ if (parentIndex !== -1) {
25763
+ data.value.splice(parentIndex + 1, 0, ...nodes.value);
25764
+ }
25765
+ };
25766
+ const dealChildNodes = (result2) => {
25767
+ const node = getNode(result2.node);
25768
+ setNodeValue(node, "loading", false);
25769
+ const childNodes = ref(generateInnerTree(result2.treeItems, "children", node.level));
25770
+ setCommonParent(node, childNodes);
25771
+ insertChildrenNodes(node, childNodes);
25772
+ const childrenNodes = getChildren(node);
25773
+ setNodeValue(node, "childNodeCount", childrenNodes.length);
25774
+ };
25775
+ const lazyLoadNodes = (node) => {
25776
+ const innerNode = getNode(node);
25777
+ if (!innerNode.isLeaf && !innerNode.childNodeCount) {
25778
+ setNodeValue(node, "loading", true);
25779
+ context.emit("lazy-load", node, dealChildNodes);
25780
+ }
25781
+ };
25782
+ return {
25783
+ lazyLoadNodes
25784
+ };
25785
+ };
25786
+ }
25557
25787
  const DEFAULT_TREE_PLUGINS = [useCore(), useToggle()];
25558
25788
  function useTree(tree2, plugins = [], context) {
25559
25789
  const treeData = ref(generateInnerTree(tree2));
25560
25790
  const core = useCore()(treeData);
25791
+ const lazyLode = useLazyLoad()(treeData, core, context);
25561
25792
  const pluginMethods = DEFAULT_TREE_PLUGINS.concat(plugins).reduce((acc, plugin) => {
25562
- return __spreadValues(__spreadValues({}, acc), plugin(treeData, core, context));
25793
+ return __spreadValues(__spreadValues({}, acc), plugin(treeData, core, context, lazyLode));
25563
25794
  }, {});
25564
25795
  return __spreadValues({
25565
25796
  treeData
@@ -25688,13 +25919,13 @@ function useOperate() {
25688
25919
  setNodeValue(parentNode, "expanded", true);
25689
25920
  setNodeValue(parentNode, "isLeaf", false);
25690
25921
  if (lastChild) {
25691
- setNodeValue(lastChild, "parentChildNode", children.length + 1);
25922
+ setNodeValue(lastChild, "parentChildNodeCount", children.length + 1);
25692
25923
  }
25693
25924
  const currentNode = ref(__spreadProps(__spreadValues({}, node), {
25694
25925
  level: getLevel(parentNode) + 1,
25695
25926
  parentId: parentNode.id,
25696
25927
  isLeaf: true,
25697
- parentChildNode: children.length + 1,
25928
+ parentChildNodeCount: children.length + 1,
25698
25929
  currentIndex: (lastChild == null ? void 0 : lastChild.currentIndex) + 1
25699
25930
  }));
25700
25931
  if (currentNode.value.id === void 0) {
@@ -25782,7 +26013,7 @@ var tree = "";
25782
26013
  var Tree = defineComponent({
25783
26014
  name: "DTree",
25784
26015
  props: treeProps,
25785
- emits: ["toggle-change", "check-change", "select-change", "node-click"],
26016
+ emits: ["toggle-change", "check-change", "select-change", "node-click", "lazy-load"],
25786
26017
  setup(props, context) {
25787
26018
  const {
25788
26019
  slots,
@@ -25835,13 +26066,16 @@ var Tree = defineComponent({
25835
26066
  toggleNode
25836
26067
  }) : createVNode(DTreeNodeToggle, {
25837
26068
  "data": treeNode
25838
- }, null)
26069
+ }, null),
26070
+ loading: () => slots.loading ? renderSlot(useSlots(), "loading", {
26071
+ nodeData: treeNode
26072
+ }) : createVNode(DTreeNodeLoading, null, null)
25839
26073
  });
25840
26074
  return () => {
25841
26075
  const Component = props.height ? VirtualList : "div";
25842
26076
  const treeData = getExpendedTree == null ? void 0 : getExpendedTree().value;
25843
26077
  const vSlotsProps = {
25844
- default: props.height || (() => treeData == null ? void 0 : treeData.map(renderDTreeNode)),
26078
+ default: () => treeData == null ? void 0 : treeData.map(renderDTreeNode),
25845
26079
  item: props.height && ((treeNode) => renderDTreeNode(treeNode))
25846
26080
  };
25847
26081
  let virtualListProps2 = {};