vue-devui 1.0.0-rc.11 → 1.0.0-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +160 -149
  2. package/auto-complete/index.es.js +182 -10
  3. package/auto-complete/index.umd.js +18 -18
  4. package/auto-complete/style.css +1 -1
  5. package/badge/index.es.js +3 -1
  6. package/badge/index.umd.js +1 -1
  7. package/button/index.es.js +5 -3
  8. package/button/index.umd.js +6 -6
  9. package/button/style.css +1 -1
  10. package/checkbox/index.es.js +1 -1
  11. package/checkbox/index.umd.js +4 -4
  12. package/checkbox/style.css +1 -1
  13. package/collapse/index.es.js +20 -186
  14. package/collapse/index.umd.js +1 -1
  15. package/collapse/style.css +1 -1
  16. package/countdown/index.es.js +56 -13
  17. package/countdown/index.umd.js +1 -1
  18. package/{date-picker → date-picker-pro}/index.d.ts +0 -0
  19. package/date-picker-pro/index.es.js +12016 -0
  20. package/date-picker-pro/index.umd.js +27 -0
  21. package/date-picker-pro/package.json +7 -0
  22. package/date-picker-pro/style.css +1 -0
  23. package/dropdown/index.es.js +9 -2
  24. package/dropdown/index.umd.js +1 -1
  25. package/editable-select/index.es.js +248 -56
  26. package/editable-select/index.umd.js +1 -1
  27. package/editable-select/style.css +1 -1
  28. package/form/index.es.js +1 -1
  29. package/form/index.umd.js +4 -4
  30. package/icon/index.es.js +5 -3
  31. package/icon/index.umd.js +1 -1
  32. package/icon/style.css +1 -1
  33. package/image-preview/style.css +1 -1
  34. package/input/index.es.js +193 -15
  35. package/input/index.umd.js +14 -14
  36. package/input/style.css +1 -1
  37. package/input-number/index.es.js +1 -4
  38. package/input-number/index.umd.js +1 -1
  39. package/layout/index.es.js +1 -1
  40. package/layout/index.umd.js +1 -1
  41. package/modal/index.es.js +5 -3
  42. package/modal/index.umd.js +1 -1
  43. package/modal/style.css +1 -1
  44. package/notification/index.es.js +32 -34
  45. package/notification/index.umd.js +1 -1
  46. package/notification/style.css +1 -1
  47. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  48. package/nuxt/components/DatePickerPro.js +3 -0
  49. package/nuxt/components/OptionGroup.js +3 -0
  50. package/nuxt/components/Step.js +3 -0
  51. package/nuxt/components/Steps.js +3 -0
  52. package/nuxt/components/TimePicker.js +3 -0
  53. package/nuxt/components/datePickerProCommonProps.js +3 -0
  54. package/nuxt/components/datePickerProPanelProps.js +3 -0
  55. package/nuxt/components/datePickerProProps.js +3 -0
  56. package/nuxt/components/stepProps.js +3 -0
  57. package/nuxt/components/stepsProps.js +3 -0
  58. package/nuxt/components/timerPickerPanelProps.js +3 -0
  59. package/package.json +1 -1
  60. package/pagination/index.es.js +175 -7
  61. package/pagination/index.umd.js +1 -1
  62. package/radio/index.es.js +1 -1
  63. package/radio/index.umd.js +4 -4
  64. package/result/index.es.js +5 -3
  65. package/result/index.umd.js +1 -1
  66. package/result/style.css +1 -1
  67. package/search/index.es.js +198 -18
  68. package/search/index.umd.js +13 -13
  69. package/search/style.css +1 -1
  70. package/select/index.es.js +382 -258
  71. package/select/index.umd.js +15 -15
  72. package/select/style.css +1 -1
  73. package/splitter/index.es.js +182 -12
  74. package/splitter/index.umd.js +13 -13
  75. package/steps/index.d.ts +7 -0
  76. package/steps/index.es.js +386 -0
  77. package/steps/index.umd.js +1 -0
  78. package/{date-picker → steps}/package.json +1 -1
  79. package/steps/style.css +1 -0
  80. package/style.css +1 -1
  81. package/switch/index.es.js +1 -1
  82. package/switch/index.umd.js +4 -4
  83. package/table/index.es.js +851 -294
  84. package/table/index.umd.js +16 -16
  85. package/table/style.css +1 -1
  86. package/tabs/index.es.js +22 -12
  87. package/tabs/index.umd.js +1 -1
  88. package/tabs/style.css +1 -1
  89. package/textarea/index.es.js +3 -2
  90. package/textarea/index.umd.js +6 -6
  91. package/time-picker/index.d.ts +7 -0
  92. package/{date-picker → time-picker}/index.es.js +1537 -1040
  93. package/time-picker/index.umd.js +27 -0
  94. package/time-picker/package.json +7 -0
  95. package/time-picker/style.css +1 -0
  96. package/time-select/index.es.js +383 -258
  97. package/time-select/index.umd.js +16 -16
  98. package/time-select/style.css +1 -1
  99. package/timeline/index.es.js +5 -3
  100. package/timeline/index.umd.js +1 -1
  101. package/timeline/style.css +1 -1
  102. package/tooltip/index.es.js +1 -1
  103. package/tooltip/index.umd.js +1 -1
  104. package/tree/index.es.js +551 -88
  105. package/tree/index.umd.js +15 -15
  106. package/tree/style.css +1 -1
  107. package/upload/index.es.js +230 -57
  108. package/upload/index.umd.js +1 -1
  109. package/upload/style.css +1 -1
  110. package/vue-devui.es.js +14310 -11217
  111. package/vue-devui.umd.js +23 -23
  112. package/date-picker/index.umd.js +0 -27
  113. package/date-picker/style.css +0 -1
  114. package/nuxt/components/DatePicker.js +0 -3
  115. package/nuxt/components/StickSlider.js +0 -3
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, onBeforeMount, vShow, resolveDynamicComponent, resolveComponent } from "vue";
32
+ import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, onBeforeMount, vShow, resolveComponent, getCurrentInstance } from "vue";
33
33
  import { onClickOutside } from "@vueuse/core";
34
34
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
35
35
  function className(classStr, classOpt) {
@@ -786,10 +786,10 @@ var lodash = { exports: {} };
786
786
  }();
787
787
  var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
788
788
  var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
789
- var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
789
+ var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
790
790
  var metaMap = WeakMap2 && new WeakMap2();
791
791
  var realNames = {};
792
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
792
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
793
793
  var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
794
794
  function lodash2(value) {
795
795
  if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
@@ -1145,7 +1145,7 @@ var lodash = { exports: {} };
1145
1145
  function baseAt(object4, paths) {
1146
1146
  var index2 = -1, length = paths.length, result2 = Array2(length), skip = object4 == null;
1147
1147
  while (++index2 < length) {
1148
- result2[index2] = skip ? undefined$1 : get(object4, paths[index2]);
1148
+ result2[index2] = skip ? undefined$1 : get2(object4, paths[index2]);
1149
1149
  }
1150
1150
  return result2;
1151
1151
  }
@@ -1590,7 +1590,7 @@ var lodash = { exports: {} };
1590
1590
  return matchesStrictComparable(toKey(path), srcValue);
1591
1591
  }
1592
1592
  return function(object4) {
1593
- var objValue = get(object4, path);
1593
+ var objValue = get2(object4, path);
1594
1594
  return objValue === undefined$1 && objValue === srcValue ? hasIn(object4, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
1595
1595
  };
1596
1596
  }
@@ -2481,8 +2481,8 @@ var lodash = { exports: {} };
2481
2481
  return func(number4);
2482
2482
  };
2483
2483
  }
2484
- var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function(values2) {
2485
- return new Set(values2);
2484
+ var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values2) {
2485
+ return new Set2(values2);
2486
2486
  };
2487
2487
  function createToPairs(keysFunc) {
2488
2488
  return function(object4) {
@@ -2781,7 +2781,7 @@ var lodash = { exports: {} };
2781
2781
  return result2;
2782
2782
  };
2783
2783
  var getTag = baseGetTag;
2784
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
2784
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
2785
2785
  getTag = function(value) {
2786
2786
  var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
2787
2787
  if (ctorString) {
@@ -4323,7 +4323,7 @@ var lodash = { exports: {} };
4323
4323
  function functionsIn(object4) {
4324
4324
  return object4 == null ? [] : baseFunctions(object4, keysIn(object4));
4325
4325
  }
4326
- function get(object4, path, defaultValue) {
4326
+ function get2(object4, path, defaultValue) {
4327
4327
  var result2 = object4 == null ? undefined$1 : baseGet(object4, path);
4328
4328
  return result2 === undefined$1 ? defaultValue : result2;
4329
4329
  }
@@ -5178,7 +5178,7 @@ var lodash = { exports: {} };
5178
5178
  lodash2.forInRight = forInRight;
5179
5179
  lodash2.forOwn = forOwn;
5180
5180
  lodash2.forOwnRight = forOwnRight;
5181
- lodash2.get = get;
5181
+ lodash2.get = get2;
5182
5182
  lodash2.gt = gt;
5183
5183
  lodash2.gte = gte;
5184
5184
  lodash2.has = has;
@@ -7558,7 +7558,7 @@ function useFormItemValidate(props, _rules) {
7558
7558
  return rule.trigger === triggerVal;
7559
7559
  }
7560
7560
  }).map((_a) => {
7561
- var _b = _a, { trigger } = _b, rule = __objRest(_b, ["trigger"]);
7561
+ var rule = __objRest(_a, []);
7562
7562
  return rule;
7563
7563
  });
7564
7564
  };
@@ -7734,7 +7734,7 @@ defineComponent({
7734
7734
  };
7735
7735
  }
7736
7736
  });
7737
- function useSelect(props, ctx, focus, blur, isSelectFocus) {
7737
+ function useSelect(props, ctx, focus, blur, isSelectFocus, t) {
7738
7738
  const formContext = inject(FORM_TOKEN, void 0);
7739
7739
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
7740
7740
  const ns2 = useNamespace("select");
@@ -7742,6 +7742,15 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7742
7742
  const dropdownRef = ref();
7743
7743
  const selectDisabled = computed(() => (formContext == null ? void 0 : formContext.disabled) || props.disabled);
7744
7744
  const selectSize = computed(() => (formContext == null ? void 0 : formContext.size) || props.size);
7745
+ const isObjectOption = ref(false);
7746
+ const originRef = ref();
7747
+ const dropdownWidth = computed(() => {
7748
+ var _a;
7749
+ if (!((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth)) {
7750
+ return "100%";
7751
+ }
7752
+ return originRef.value.clientWidth + "px";
7753
+ });
7745
7754
  const isOpen = ref(false);
7746
7755
  const toggleChange = (bool) => {
7747
7756
  if (selectDisabled.value) {
@@ -7765,6 +7774,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7765
7774
  [ns2.m("focus")]: isSelectFocus.value
7766
7775
  });
7767
7776
  });
7777
+ const cacheOptions = /* @__PURE__ */ new Map();
7768
7778
  const mergeOptions = computed(() => {
7769
7779
  const { multiple, modelValue } = props;
7770
7780
  return props.options.map((item) => {
@@ -7788,11 +7798,13 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7788
7798
  option._checked = false;
7789
7799
  }
7790
7800
  }
7801
+ cacheOptions.set(option.value, option);
7791
7802
  return option;
7792
7803
  });
7793
7804
  });
7805
+ const getValuesOption = (values) => values.map((value) => cacheOptions.get(value));
7794
7806
  const injectOptions = ref(/* @__PURE__ */ new Map());
7795
- const updateInjectOptions = (item, operation) => {
7807
+ const updateInjectOptions = (item, operation, isObject2) => {
7796
7808
  if (operation === "add") {
7797
7809
  injectOptions.value.set(item.value, item);
7798
7810
  } else if (operation === "delete") {
@@ -7800,6 +7812,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7800
7812
  injectOptions.value.delete(item.value);
7801
7813
  }
7802
7814
  }
7815
+ isObjectOption.value = isObject2;
7803
7816
  };
7804
7817
  const getInjectOptions = (values) => {
7805
7818
  return values.map((value) => {
@@ -7824,10 +7837,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7824
7837
  const inputValue = computed(() => {
7825
7838
  var _a;
7826
7839
  if (props.multiple && Array.isArray(props.modelValue)) {
7827
- selectedOptions.value = getInjectOptions(props.modelValue).filter((item) => !!item);
7840
+ selectedOptions.value = getInjectOptions(props.modelValue).filter((item) => item ? true : false);
7828
7841
  return selectedOptions.value.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",");
7829
7842
  } else if (!Array.isArray(props.modelValue)) {
7830
- selectedOptions.value = getInjectOptions([props.modelValue]).filter((item) => !!item);
7843
+ selectedOptions.value = getInjectOptions([props.modelValue]).filter((item) => item ? true : false);
7831
7844
  return ((_a = selectedOptions.value[0]) == null ? void 0 : _a.name) || "";
7832
7845
  }
7833
7846
  return "";
@@ -7838,7 +7851,26 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7838
7851
  toggleChange(!isOpen.value);
7839
7852
  };
7840
7853
  const isSupportFilter = computed(() => lodash.exports.isFunction(props.filter) || typeof props.filter === "boolean" && props.filter);
7841
- const valueChange = (item, isObjectOption) => {
7854
+ const getMultipleSelected = (items) => {
7855
+ if (mergeOptions.value.length) {
7856
+ ctx.emit("value-change", getValuesOption(items).filter((item) => item ? true : false));
7857
+ } else if (isObjectOption.value) {
7858
+ const selectItems = getInjectOptions(items).filter((item) => item ? true : false);
7859
+ ctx.emit("value-change", selectItems);
7860
+ } else {
7861
+ ctx.emit("value-change", items);
7862
+ }
7863
+ };
7864
+ const getSingleSelected = (item) => {
7865
+ if (mergeOptions.value.length) {
7866
+ ctx.emit("value-change", getValuesOption([item.value])[0]);
7867
+ } else if (isObjectOption.value) {
7868
+ ctx.emit("value-change", item);
7869
+ } else {
7870
+ ctx.emit("value-change", item.value);
7871
+ }
7872
+ };
7873
+ const valueChange = (item) => {
7842
7874
  const { multiple } = props;
7843
7875
  let { modelValue } = props;
7844
7876
  if (multiple) {
@@ -7848,6 +7880,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7848
7880
  if (option) {
7849
7881
  option._checked = !option._checked;
7850
7882
  }
7883
+ const mergeOption = getValuesOption([item.value])[0];
7884
+ if (mergeOption) {
7885
+ mergeOption._checked = !mergeOption._checked;
7886
+ }
7851
7887
  if (index2 > -1) {
7852
7888
  checkedItems.splice(index2, 1);
7853
7889
  } else {
@@ -7861,11 +7897,12 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7861
7897
  if (isSupportFilter.value) {
7862
7898
  focus();
7863
7899
  }
7900
+ getMultipleSelected(checkedItems);
7864
7901
  } else {
7865
7902
  ctx.emit("update:modelValue", item.value);
7903
+ getSingleSelected(item);
7866
7904
  toggleChange(false);
7867
7905
  }
7868
- ctx.emit("value-change", isObjectOption ? item : item.value);
7869
7906
  };
7870
7907
  const handleClose = () => {
7871
7908
  isOpen.value = false;
@@ -7874,8 +7911,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7874
7911
  const handleClear = () => {
7875
7912
  if (props.multiple) {
7876
7913
  ctx.emit("update:modelValue", []);
7914
+ ctx.emit("value-change", []);
7877
7915
  } else {
7878
7916
  ctx.emit("update:modelValue", "");
7917
+ ctx.emit("value-change", "");
7879
7918
  }
7880
7919
  ctx.emit("clear");
7881
7920
  if (isOpen.value) {
@@ -7895,6 +7934,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7895
7934
  modelValue = checkedItems;
7896
7935
  ctx.emit("update:modelValue", modelValue);
7897
7936
  ctx.emit("remove-tag", data.value);
7937
+ getMultipleSelected(checkedItems);
7898
7938
  };
7899
7939
  const onFocus = (e) => {
7900
7940
  ctx.emit("focus", e);
@@ -7934,13 +7974,13 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7934
7974
  return label.toString().toLocaleLowerCase().includes(filterQuery.value.toLocaleLowerCase());
7935
7975
  }).length;
7936
7976
  if (isLoading.value) {
7937
- return props.loadingText;
7977
+ return props.loadingText || t("loadingText");
7938
7978
  }
7939
7979
  if (isSupportFilter.value && filterQuery.value && injectOptionsArray.value.length > 0 && visibleOptionsCount === 0) {
7940
- return props.noMatchText;
7980
+ return props.noMatchText || t("noMatchText");
7941
7981
  }
7942
7982
  if (injectOptionsArray.value.length === 0) {
7943
- return props.noDataText;
7983
+ return props.noDataText || t("noDataText");
7944
7984
  }
7945
7985
  return "";
7946
7986
  });
@@ -7964,6 +8004,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7964
8004
  selectDisabled,
7965
8005
  selectSize,
7966
8006
  containerRef,
8007
+ originRef,
7967
8008
  dropdownRef,
7968
8009
  isOpen,
7969
8010
  selectCls,
@@ -7974,6 +8015,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7974
8015
  emptyText,
7975
8016
  isLoading,
7976
8017
  isShowEmptyText,
8018
+ dropdownWidth,
7977
8019
  onClick,
7978
8020
  handleClear,
7979
8021
  valueChange,
@@ -8011,7 +8053,7 @@ const selectProps = {
8011
8053
  },
8012
8054
  placeholder: {
8013
8055
  type: String,
8014
- default: "\u8BF7\u9009\u62E9"
8056
+ default: ""
8015
8057
  },
8016
8058
  multiple: {
8017
8059
  type: Boolean,
@@ -8051,11 +8093,11 @@ const selectProps = {
8051
8093
  },
8052
8094
  noDataText: {
8053
8095
  type: String,
8054
- default: "\u65E0\u6570\u636E"
8096
+ default: ""
8055
8097
  },
8056
8098
  noMatchText: {
8057
8099
  type: String,
8058
- default: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55"
8100
+ default: ""
8059
8101
  },
8060
8102
  loading: {
8061
8103
  type: Boolean,
@@ -8063,7 +8105,7 @@ const selectProps = {
8063
8105
  },
8064
8106
  loadingText: {
8065
8107
  type: String,
8066
- default: "\u52A0\u8F7D\u4E2D"
8108
+ default: ""
8067
8109
  },
8068
8110
  onToggleChange: {
8069
8111
  type: Function,
@@ -8102,7 +8144,17 @@ const selectContentProps = {
8102
8144
  default: ""
8103
8145
  }
8104
8146
  };
8147
+ const optionGroupProps = {
8148
+ label: {
8149
+ type: String
8150
+ },
8151
+ disabled: {
8152
+ type: Boolean,
8153
+ default: false
8154
+ }
8155
+ };
8105
8156
  const SELECT_TOKEN = Symbol("dSelect");
8157
+ const OPTION_GROUP_TOKEN = Symbol("dOptionGroup");
8106
8158
  const commonProps = {
8107
8159
  name: {
8108
8160
  type: String,
@@ -8559,6 +8611,7 @@ defineComponent({
8559
8611
  function useOption(props) {
8560
8612
  const ns2 = useNamespace("select");
8561
8613
  const select2 = inject(SELECT_TOKEN, null);
8614
+ const optionGroup = inject(OPTION_GROUP_TOKEN, null);
8562
8615
  const currentName = computed(() => {
8563
8616
  return props.name || props.value;
8564
8617
  });
@@ -8580,16 +8633,17 @@ function useOption(props) {
8580
8633
  _checked: false
8581
8634
  };
8582
8635
  });
8636
+ const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
8583
8637
  const isObjectOption = ref(!!props.name);
8584
8638
  const selectOptionCls = computed(() => {
8585
8639
  return className(ns2.e("item"), {
8586
8640
  active: isOptionSelected.value,
8587
- disabled: props.disabled
8641
+ disabled: isDisabled.value
8588
8642
  });
8589
8643
  });
8590
8644
  const optionSelect = () => {
8591
- if (!props.disabled) {
8592
- select2 == null ? void 0 : select2.valueChange(optionItem.value, isObjectOption.value);
8645
+ if (!isDisabled.value) {
8646
+ select2 == null ? void 0 : select2.valueChange(optionItem.value);
8593
8647
  }
8594
8648
  };
8595
8649
  const isVisible = computed(() => {
@@ -8601,10 +8655,10 @@ function useOption(props) {
8601
8655
  }
8602
8656
  });
8603
8657
  onBeforeMount(() => {
8604
- select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "add");
8658
+ select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "add", isObjectOption.value);
8605
8659
  });
8606
8660
  onBeforeUnmount(() => {
8607
- select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "delete");
8661
+ select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "delete", isObjectOption.value);
8608
8662
  });
8609
8663
  return {
8610
8664
  currentName,
@@ -8636,188 +8690,38 @@ var Option = defineComponent({
8636
8690
  };
8637
8691
  }
8638
8692
  });
8639
- const DEFAULT_PREFIX = "icon";
8640
- const iconProps = {
8641
- name: {
8642
- type: String,
8643
- default: "",
8644
- required: true
8645
- },
8646
- size: {
8647
- type: [Number, String],
8648
- default: "inherit"
8649
- },
8650
- color: {
8651
- type: String,
8652
- default: "inherit"
8653
- },
8654
- component: {
8655
- type: Object,
8656
- default: null
8657
- },
8658
- classPrefix: {
8659
- type: String,
8660
- default: DEFAULT_PREFIX
8661
- },
8662
- operable: {
8663
- type: Boolean,
8664
- default: false
8665
- },
8666
- disabled: {
8667
- type: Boolean,
8668
- default: false
8669
- },
8670
- rotate: {
8671
- type: [Number, String]
8672
- }
8673
- };
8674
- const svgIconProps = {
8675
- name: {
8676
- type: String,
8677
- default: "",
8678
- required: true
8679
- },
8680
- color: {
8681
- type: String,
8682
- default: "inherit"
8683
- },
8684
- size: {
8685
- type: [Number, String],
8686
- default: "inherit"
8687
- }
8688
- };
8689
- var icon = "";
8690
- var svgIcon = defineComponent({
8691
- name: "DSvgIcon",
8692
- props: svgIconProps,
8693
- setup(props) {
8694
- const {
8695
- name,
8696
- color,
8697
- size
8698
- } = toRefs(props);
8699
- const ns2 = useNamespace("svg-icon");
8700
- const iconName = computed(() => `#icon-${name.value}`);
8701
- const iconSize = computed(() => {
8702
- return typeof size.value === "number" ? `${size.value}px` : size.value;
8703
- });
8704
- const styles = {
8705
- width: iconSize.value,
8706
- height: iconSize.value
8707
- };
8708
- return () => {
8709
- return createVNode("svg", {
8710
- "class": ns2.b(),
8711
- "style": styles
8712
- }, [createVNode("use", {
8713
- "xlink:href": iconName.value,
8714
- "fill": color.value
8715
- }, null)]);
8716
- };
8717
- }
8718
- });
8719
- function isUrl(value) {
8720
- return /^((http|https):)?\/\//.test(value);
8721
- }
8722
- function useIconDom(props, ctx) {
8723
- const {
8724
- component,
8725
- name,
8726
- size,
8727
- color,
8728
- classPrefix,
8729
- rotate
8730
- } = toRefs(props);
8731
- const ns2 = useNamespace("icon");
8732
- const iconSize = computed(() => {
8733
- return typeof size.value === "number" ? `${size.value}px` : size.value;
8734
- });
8735
- const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
8736
- const imgIconDom = () => {
8737
- return createVNode("img", mergeProps({
8738
- "src": name.value,
8739
- "alt": name.value.split("/")[name.value.split("/").length - 1],
8740
- "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
8741
- "style": {
8742
- width: iconSize.value || "",
8743
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
8744
- }
8745
- }, ctx.attrs), null);
8746
- };
8747
- const svgIconDom = () => {
8748
- return createVNode(IconComponent, mergeProps({
8749
- "name": name.value,
8750
- "color": color.value,
8751
- "size": iconSize.value,
8752
- "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
8753
- "style": {
8754
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
8755
- }
8756
- }, ctx.attrs), null);
8757
- };
8758
- const fontIconDom = () => {
8759
- const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
8760
- return createVNode("i", mergeProps({
8761
- "class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
8762
- "style": {
8763
- fontSize: iconSize.value,
8764
- color: color.value,
8765
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
8766
- }
8767
- }, ctx.attrs), null);
8768
- };
8769
- const iconDom = () => {
8770
- return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
8771
- };
8772
- return {
8773
- iconDom
8774
- };
8775
- }
8776
- var Icon = defineComponent({
8777
- name: "DIcon",
8778
- props: iconProps,
8779
- setup(props, ctx) {
8780
- const {
8781
- disabled,
8782
- operable
8783
- } = toRefs(props);
8784
- const {
8785
- iconDom
8786
- } = useIconDom(props, ctx);
8787
- const ns2 = useNamespace("icon");
8788
- const wrapClassed = computed(() => ({
8789
- [ns2.e("container")]: true,
8790
- [ns2.m("disabled")]: disabled.value,
8791
- [ns2.m("operable")]: operable.value
8792
- }));
8793
- const onClick = (e) => {
8794
- e.stopImmediatePropagation();
8795
- if (disabled.value) {
8796
- e.preventDefault();
8797
- }
8798
- };
8799
- return () => {
8800
- var _a, _b, _c, _d;
8801
- return createVNode("div", {
8802
- "class": wrapClassed.value,
8803
- "onClick": onClick
8804
- }, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
8805
- };
8806
- }
8807
- });
8808
- var iconGroup = "";
8809
- defineComponent({
8810
- name: "DIconGroup",
8811
- setup(_, ctx) {
8812
- const ns2 = useNamespace("icon-group");
8813
- return () => {
8814
- var _a, _b;
8815
- return createVNode("div", {
8816
- "class": ns2.b()
8817
- }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
8818
- };
8819
- }
8820
- });
8693
+ const AlertCloseIcon = () => createVNode("svg", {
8694
+ "width": "10px",
8695
+ "height": "10px",
8696
+ "viewBox": "0 0 10 10",
8697
+ "version": "1.1",
8698
+ "xmlns": "http://www.w3.org/2000/svg"
8699
+ }, [createVNode("g", {
8700
+ "stroke": "none",
8701
+ "stroke-width": "1",
8702
+ "fill": "none",
8703
+ "fill-rule": "evenodd"
8704
+ }, [createVNode("g", {
8705
+ "transform": "translate(-3.000000, -3.000000)",
8706
+ "fill-rule": "nonzero"
8707
+ }, [createVNode("path", {
8708
+ "d": "M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z"
8709
+ }, null)])])]);
8710
+ const SelectArrowIcon = () => createVNode("svg", {
8711
+ "width": "1em",
8712
+ "height": "1em",
8713
+ "viewBox": "0 0 16 16",
8714
+ "version": "1.1",
8715
+ "xmlns": "http://www.w3.org/2000/svg"
8716
+ }, [createVNode("g", {
8717
+ "stroke": "none",
8718
+ "stroke-width": "1",
8719
+ "fill": "none",
8720
+ "fill-rule": "evenodd"
8721
+ }, [createVNode("path", {
8722
+ "d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
8723
+ "fill-rule": "nonzero"
8724
+ }, null)])]);
8821
8725
  const tagProps = {
8822
8726
  type: {
8823
8727
  type: String,
@@ -8941,10 +8845,180 @@ var Tag = defineComponent({
8941
8845
  };
8942
8846
  }
8943
8847
  });
8848
+ function deepAssign(...objects) {
8849
+ const isObject2 = (obj) => obj && typeof obj === "object";
8850
+ return objects.reduce((prev, from) => {
8851
+ Object.keys(from).forEach((key) => {
8852
+ const pVal = prev[key];
8853
+ const oVal = from[key];
8854
+ if (Array.isArray(pVal) && Array.isArray(oVal)) {
8855
+ prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
8856
+ } else if (isObject2(pVal) && isObject2(oVal)) {
8857
+ prev[key] = deepAssign(pVal, oVal);
8858
+ } else {
8859
+ prev[key] = oVal;
8860
+ }
8861
+ });
8862
+ return prev;
8863
+ }, {});
8864
+ }
8865
+ var zhCN = {
8866
+ pagination: {
8867
+ totalItemText: "\u6240\u6709\u6761\u76EE",
8868
+ goToText: "\u8DF3\u81F3"
8869
+ },
8870
+ accordion: {
8871
+ loading: "\u52A0\u8F7D\u4E2D",
8872
+ noData: "\u6CA1\u6709\u6570\u636E"
8873
+ },
8874
+ autoCompleteDropdown: {
8875
+ latestInput: "\u6700\u8FD1\u8F93\u5165"
8876
+ },
8877
+ cascaderList: {
8878
+ noData: "\u6CA1\u6709\u6570\u636E"
8879
+ },
8880
+ colorPicker: {
8881
+ foundationPanel: "\u57FA\u7840\u9762\u677F",
8882
+ advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
8883
+ },
8884
+ datePickerPro: {
8885
+ ok: "\u786E\u5B9A",
8886
+ placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
8887
+ month1: "1\u6708",
8888
+ month2: "2\u6708",
8889
+ month3: "3\u6708",
8890
+ month4: "4\u6708",
8891
+ month5: "5\u6708",
8892
+ month6: "6\u6708",
8893
+ month7: "7\u6708",
8894
+ month8: "8\u6708",
8895
+ month9: "9\u6708",
8896
+ month10: "10\u6708",
8897
+ month11: "11\u6708",
8898
+ month12: "12\u6708",
8899
+ year: "\u5E74",
8900
+ startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
8901
+ endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
8902
+ getWeekDays() {
8903
+ return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
8904
+ },
8905
+ getTimeArr() {
8906
+ return ["\u65F6", "\u5206", "\u79D2"];
8907
+ },
8908
+ getYearMonthStr(year, month) {
8909
+ return `${year}\u5E74${month}\u6708`;
8910
+ }
8911
+ },
8912
+ editableSelect: {
8913
+ noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
8914
+ noData: "\u6CA1\u6709\u6570\u636E"
8915
+ },
8916
+ input: {
8917
+ placeholder: "\u8BF7\u8F93\u5165"
8918
+ },
8919
+ splitterBar: {
8920
+ collapse: "\u6536\u8D77",
8921
+ expand: "\u5C55\u5F00"
8922
+ },
8923
+ stepsGuide: {
8924
+ previous: "\u4E0A\u4E00\u6B65",
8925
+ continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
8926
+ ok: "\u6211\u77E5\u9053\u5566"
8927
+ },
8928
+ table: {
8929
+ selectAll: "\u5168\u9009",
8930
+ ok: "\u786E\u5B9A"
8931
+ },
8932
+ timePopup: {
8933
+ ok: "\u786E\u5B9A"
8934
+ },
8935
+ transfer: {
8936
+ unit: "\u9879",
8937
+ panelUnit: "\u9879",
8938
+ headerUnit: "\u9879",
8939
+ noData: "\u6682\u65E0\u6570\u636E",
8940
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
8941
+ },
8942
+ tree: {
8943
+ loading: "\u52A0\u8F7D\u4E2D",
8944
+ newNode: "\u65B0\u8282\u70B9",
8945
+ selectPlaceholder: "\u8BF7\u9009\u62E9"
8946
+ },
8947
+ upload: {
8948
+ placeholder: "\u9009\u62E9\u6587\u4EF6",
8949
+ getExistSameNameFilesMsg(sameNames) {
8950
+ return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
8951
+ },
8952
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
8953
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
8954
+ },
8955
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
8956
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
8957
+ },
8958
+ getNotAllowedFileTypeMsg(filename, scope) {
8959
+ return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
8960
+ }
8961
+ },
8962
+ search: {
8963
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
8964
+ },
8965
+ select: {
8966
+ placeholder: "\u8BF7\u9009\u62E9",
8967
+ noDataText: "\u65E0\u6570\u636E",
8968
+ noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
8969
+ loadingText: "\u52A0\u8F7D\u4E2D..."
8970
+ },
8971
+ tagInput: {
8972
+ maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
8973
+ },
8974
+ timeSelect: {
8975
+ placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
8976
+ }
8977
+ };
8978
+ const lang = ref("zh-CN");
8979
+ let langMessages = reactive({
8980
+ [lang.value]: zhCN
8981
+ });
8982
+ const Locale = {
8983
+ messages() {
8984
+ return langMessages[lang.value];
8985
+ },
8986
+ lang() {
8987
+ return lang.value;
8988
+ },
8989
+ use(newLang, newMessages2) {
8990
+ lang.value = newLang;
8991
+ this.add({ [newLang]: newMessages2 });
8992
+ },
8993
+ add(newMessages2 = {}) {
8994
+ langMessages = deepAssign(langMessages, newMessages2);
8995
+ }
8996
+ };
8997
+ const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
8998
+ function get(object4, path) {
8999
+ const keys = path.split(".");
9000
+ let result = object4;
9001
+ keys.forEach((key) => {
9002
+ var _a;
9003
+ result = (_a = result[key]) != null ? _a : "";
9004
+ });
9005
+ return result;
9006
+ }
9007
+ function createI18nTranslate(name, app, newPrefix) {
9008
+ const prefix = newPrefix || camelize(name) + ".";
9009
+ return (path) => {
9010
+ var _a;
9011
+ const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
9012
+ const message = get(messages2, prefix + path) || get(messages2, path);
9013
+ return message;
9014
+ };
9015
+ }
8944
9016
  function useSelectContent(props) {
8945
9017
  const ns2 = useNamespace("select");
8946
9018
  const select2 = inject(SELECT_TOKEN);
8947
9019
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
9020
+ const app = getCurrentInstance();
9021
+ const t = createI18nTranslate("DSelect", app);
8948
9022
  const searchQuery = ref("");
8949
9023
  const selectedData = computed(() => {
8950
9024
  return (select2 == null ? void 0 : select2.selectedOptions) || [];
@@ -8978,7 +9052,8 @@ function useSelectContent(props) {
8978
9052
  [ns2.em("input", "sm")]: (select2 == null ? void 0 : select2.selectSize) === "sm"
8979
9053
  });
8980
9054
  });
8981
- const placeholder = computed(() => props.value.length > 0 ? "" : (select2 == null ? void 0 : select2.placeholder) || "");
9055
+ const tagSize = computed(() => (select2 == null ? void 0 : select2.selectSize) || "sm");
9056
+ const placeholder = computed(() => props.value.length > 0 ? "" : (select2 == null ? void 0 : select2.placeholder) || t("placeholder"));
8982
9057
  const isMultiple = computed(() => !!(select2 == null ? void 0 : select2.multiple));
8983
9058
  const handleClear = (e) => {
8984
9059
  e.preventDefault();
@@ -8986,7 +9061,7 @@ function useSelectContent(props) {
8986
9061
  select2 == null ? void 0 : select2.handleClear();
8987
9062
  };
8988
9063
  const tagDelete = (data) => {
8989
- if (data && data.value) {
9064
+ if (data && (data.value || data.value === 0)) {
8990
9065
  select2 == null ? void 0 : select2.tagDelete(data);
8991
9066
  }
8992
9067
  };
@@ -9013,6 +9088,7 @@ function useSelectContent(props) {
9013
9088
  isReadOnly,
9014
9089
  selectionCls,
9015
9090
  inputCls,
9091
+ tagSize,
9016
9092
  placeholder,
9017
9093
  isMultiple,
9018
9094
  handleClear,
@@ -9047,6 +9123,7 @@ var SelectContent = defineComponent({
9047
9123
  isReadOnly,
9048
9124
  selectionCls,
9049
9125
  inputCls,
9126
+ tagSize,
9050
9127
  placeholder,
9051
9128
  isMultiple,
9052
9129
  handleClear,
@@ -9067,7 +9144,8 @@ var SelectContent = defineComponent({
9067
9144
  e.stopPropagation();
9068
9145
  tagDelete(item);
9069
9146
  },
9070
- "key": item.value
9147
+ "key": item.value,
9148
+ "size": tagSize.value
9071
9149
  }, {
9072
9150
  default: () => [item.name]
9073
9151
  })), isSupportCollapseTags.value && selectedData.value.length >= 1 && createVNode(Tag, {
@@ -9076,14 +9154,17 @@ var SelectContent = defineComponent({
9076
9154
  e.preventDefault();
9077
9155
  e.stopPropagation();
9078
9156
  tagDelete(selectedData.value[0]);
9079
- }
9157
+ },
9158
+ "size": tagSize.value
9080
9159
  }, {
9081
9160
  default: () => [selectedData.value[0].name]
9082
9161
  }), isSupportCollapseTags.value && selectedData.value.length > 1 && createVNode(Popover, {
9083
9162
  "trigger": "hover",
9084
9163
  "disabled": isDisabledTooltip.value
9085
9164
  }, {
9086
- default: () => createVNode(Tag, null, {
9165
+ default: () => createVNode(Tag, {
9166
+ "size": tagSize.value
9167
+ }, {
9087
9168
  default: () => [`+${selectedData.value.length - 1}`]
9088
9169
  }),
9089
9170
  content: () => createVNode("div", null, [selectedData.value.map((item) => createVNode(Tag, {
@@ -9093,7 +9174,8 @@ var SelectContent = defineComponent({
9093
9174
  e.stopPropagation();
9094
9175
  tagDelete(item);
9095
9176
  },
9096
- "key": item.value
9177
+ "key": item.value,
9178
+ "size": tagSize.value
9097
9179
  }, {
9098
9180
  default: () => [item.name]
9099
9181
  }))])
@@ -9124,13 +9206,9 @@ var SelectContent = defineComponent({
9124
9206
  }, null), createVNode("span", {
9125
9207
  "onClick": handleClear,
9126
9208
  "class": clearCls.value
9127
- }, [createVNode(Icon, {
9128
- "name": "close"
9129
- }, null)]), createVNode("span", {
9209
+ }, [createVNode(AlertCloseIcon, null, null)]), createVNode("span", {
9130
9210
  "class": arrowCls.value
9131
- }, [createVNode(Icon, {
9132
- "name": "select-arrow"
9133
- }, null)])]);
9211
+ }, [createVNode(SelectArrowIcon, null, null)])]);
9134
9212
  };
9135
9213
  }
9136
9214
  });
@@ -9163,6 +9241,8 @@ var Select = defineComponent({
9163
9241
  props: selectProps,
9164
9242
  emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear"],
9165
9243
  setup(props, ctx) {
9244
+ const app = getCurrentInstance();
9245
+ const t = createI18nTranslate("DSelect", app);
9166
9246
  const selectRef = ref();
9167
9247
  const {
9168
9248
  isSelectFocus,
@@ -9173,6 +9253,7 @@ var Select = defineComponent({
9173
9253
  selectDisabled,
9174
9254
  selectSize,
9175
9255
  containerRef,
9256
+ originRef,
9176
9257
  dropdownRef,
9177
9258
  isOpen,
9178
9259
  selectCls,
@@ -9183,6 +9264,7 @@ var Select = defineComponent({
9183
9264
  emptyText,
9184
9265
  isLoading,
9185
9266
  isShowEmptyText,
9267
+ dropdownWidth,
9186
9268
  onClick,
9187
9269
  valueChange,
9188
9270
  handleClear,
@@ -9194,7 +9276,7 @@ var Select = defineComponent({
9194
9276
  isDisabled,
9195
9277
  toggleChange,
9196
9278
  isShowCreateOption
9197
- } = useSelect(props, ctx, focus, blur, isSelectFocus);
9279
+ } = useSelect(props, ctx, focus, blur, isSelectFocus, t);
9198
9280
  const scrollbarNs = useNamespace("scrollbar");
9199
9281
  const ns2 = useNamespace("select");
9200
9282
  const dropdownCls = ns2.e("dropdown");
@@ -9208,6 +9290,11 @@ var Select = defineComponent({
9208
9290
  blur,
9209
9291
  toggleChange
9210
9292
  });
9293
+ const isRender = ref(false);
9294
+ const position = ref(["bottom-start", "top-start"]);
9295
+ onMounted(() => {
9296
+ isRender.value = true;
9297
+ });
9211
9298
  provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
9212
9299
  selectDisabled,
9213
9300
  selectSize,
@@ -9227,54 +9314,91 @@ var Select = defineComponent({
9227
9314
  "class": selectCls.value,
9228
9315
  "ref": containerRef,
9229
9316
  "onClick": onClick
9317
+ }, [createVNode("div", {
9318
+ "ref": originRef
9230
9319
  }, [createVNode(SelectContent, {
9231
9320
  "ref": selectRef,
9232
9321
  "value": inputValue.value
9233
- }, null), createVNode(Transition, {
9234
- "name": "fade",
9235
- "ref": dropdownRef
9322
+ }, null)]), createVNode(Transition, {
9323
+ "name": "fade"
9236
9324
  }, {
9237
- default: () => {
9238
- var _a, _b, _c, _d;
9239
- return [withDirectives(createVNode("div", {
9240
- "class": dropdownCls
9241
- }, [withDirectives(createVNode("ul", {
9242
- "class": listCls
9243
- }, [isShowCreateOption.value && createVNode(Option, {
9244
- "value": filterQuery.value,
9245
- "name": filterQuery.value,
9246
- "create": true
9247
- }, {
9248
- default: () => [props.multiple ? createVNode(Checkbox, {
9249
- "modelValue": false,
9250
- "label": filterQuery.value
9251
- }, null) : filterQuery.value]
9252
- }), ((_a = ctx.slots) == null ? void 0 : _a.default) && ctx.slots.default(), !((_b = ctx.slots) == null ? void 0 : _b.default) && mergeOptions.value.length >= 1 && mergeOptions.value.map((item, i) => createVNode(Option, {
9253
- "key": i,
9254
- "value": item.value,
9255
- "name": item.name,
9256
- "disabled": isDisabled(item)
9257
- }, {
9258
- default: () => [props.multiple ? createVNode(Checkbox, {
9259
- "modelValue": item._checked,
9260
- "label": item.name,
9325
+ default: () => [createVNode(FlexibleOverlay, {
9326
+ "modelValue": isRender.value,
9327
+ "onUpdate:modelValue": ($event) => isRender.value = $event,
9328
+ "ref": dropdownRef,
9329
+ "origin": originRef.value,
9330
+ "align": "start",
9331
+ "position": position.value,
9332
+ "style": {
9333
+ visibility: isOpen.value ? "visible" : "hidden",
9334
+ "z-index": isOpen.value ? 1e3 : -1
9335
+ }
9336
+ }, {
9337
+ default: () => {
9338
+ var _a, _b, _c, _d;
9339
+ return [createVNode("div", {
9340
+ "class": dropdownCls,
9341
+ "style": {
9342
+ width: `${dropdownWidth.value}`,
9343
+ visibility: isOpen.value ? "visible" : "hidden"
9344
+ }
9345
+ }, [withDirectives(createVNode("ul", {
9346
+ "class": listCls
9347
+ }, [isShowCreateOption.value && createVNode(Option, {
9348
+ "value": filterQuery.value,
9349
+ "name": filterQuery.value,
9350
+ "create": true
9351
+ }, {
9352
+ default: () => [props.multiple ? createVNode(Checkbox, {
9353
+ "modelValue": false,
9354
+ "label": filterQuery.value
9355
+ }, null) : filterQuery.value]
9356
+ }), ((_a = ctx.slots) == null ? void 0 : _a.default) && ctx.slots.default(), !((_b = ctx.slots) == null ? void 0 : _b.default) && mergeOptions.value.length >= 1 && mergeOptions.value.map((item, i) => createVNode(Option, {
9357
+ "key": i,
9358
+ "value": item.value,
9359
+ "name": item.name,
9261
9360
  "disabled": isDisabled(item)
9262
- }, null) : item.name || item.value]
9263
- }))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx.slots) == null ? void 0 : _c.empty) && ctx.slots.empty(), !((_d = ctx.slots) == null ? void 0 : _d.empty) && createVNode("p", {
9264
- "class": dropdownEmptyCls
9265
- }, [emptyText.value])])]), [[vShow, isOpen.value]])];
9266
- }
9361
+ }, {
9362
+ default: () => [props.multiple ? createVNode(Checkbox, {
9363
+ "modelValue": item._checked,
9364
+ "label": item.name,
9365
+ "disabled": isDisabled(item)
9366
+ }, null) : item.name || item.value]
9367
+ }))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx.slots) == null ? void 0 : _c.empty) && ctx.slots.empty(), !((_d = ctx.slots) == null ? void 0 : _d.empty) && createVNode("p", {
9368
+ "class": dropdownEmptyCls
9369
+ }, [emptyText.value])])])];
9370
+ }
9371
+ })]
9267
9372
  })]);
9268
9373
  };
9269
9374
  }
9270
9375
  });
9376
+ var OptionGroup = defineComponent({
9377
+ name: "DOptionGroup",
9378
+ props: optionGroupProps,
9379
+ setup(props, ctx) {
9380
+ const ns2 = useNamespace("select");
9381
+ provide(OPTION_GROUP_TOKEN, reactive(__spreadValues({}, toRefs(props))));
9382
+ return () => {
9383
+ var _a;
9384
+ return createVNode("ul", {
9385
+ "class": ns2.e("group")
9386
+ }, [createVNode("li", {
9387
+ "class": ns2.e("group-title")
9388
+ }, [props.label || ""]), createVNode("li", null, [createVNode("ul", {
9389
+ "class": ns2.e("group-content")
9390
+ }, [((_a = ctx.slots) == null ? void 0 : _a.default) && ctx.slots.default()])])]);
9391
+ };
9392
+ }
9393
+ });
9271
9394
  var index = {
9272
9395
  title: "Select \u4E0B\u62C9\u6846",
9273
9396
  category: "\u6570\u636E\u5F55\u5165",
9274
- status: "90%",
9397
+ status: "100%",
9275
9398
  install(app) {
9276
9399
  app.component(Select.name, Select);
9277
9400
  app.component(Option.name, Option);
9401
+ app.component(OptionGroup.name, OptionGroup);
9278
9402
  }
9279
9403
  };
9280
- export { Option, Select, index as default };
9404
+ export { Option, OptionGroup, Select, index as default };