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

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 (94) hide show
  1. package/README.md +2 -2
  2. package/auto-complete/index.es.js +29 -8
  3. package/auto-complete/index.umd.js +16 -16
  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 +3 -2
  8. package/button/index.umd.js +6 -6
  9. package/collapse/index.es.js +20 -186
  10. package/collapse/index.umd.js +1 -1
  11. package/collapse/style.css +1 -1
  12. package/countdown/index.es.js +56 -13
  13. package/countdown/index.umd.js +1 -1
  14. package/{date-picker → date-picker-pro}/index.d.ts +0 -0
  15. package/date-picker-pro/index.es.js +10856 -0
  16. package/date-picker-pro/index.umd.js +27 -0
  17. package/date-picker-pro/package.json +7 -0
  18. package/date-picker-pro/style.css +1 -0
  19. package/dropdown/index.es.js +1 -1
  20. package/dropdown/index.umd.js +1 -1
  21. package/editable-select/index.es.js +98 -56
  22. package/editable-select/index.umd.js +1 -1
  23. package/editable-select/style.css +1 -1
  24. package/icon/index.es.js +3 -2
  25. package/icon/index.umd.js +1 -1
  26. package/input/index.es.js +35 -8
  27. package/input/index.umd.js +7 -7
  28. package/input/style.css +1 -1
  29. package/modal/index.es.js +3 -2
  30. package/modal/index.umd.js +1 -1
  31. package/modal/style.css +1 -1
  32. package/notification/index.es.js +3 -2
  33. package/notification/index.umd.js +1 -1
  34. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  35. package/nuxt/components/DatePickerPro.js +3 -0
  36. package/nuxt/components/OptionGroup.js +3 -0
  37. package/nuxt/components/Step.js +3 -0
  38. package/nuxt/components/Steps.js +3 -0
  39. package/nuxt/components/TimePicker.js +3 -0
  40. package/nuxt/components/datePickerProCommonProps.js +3 -0
  41. package/nuxt/components/datePickerProPanelProps.js +3 -0
  42. package/nuxt/components/datePickerProProps.js +3 -0
  43. package/nuxt/components/stepProps.js +3 -0
  44. package/nuxt/components/stepsProps.js +3 -0
  45. package/nuxt/components/timerPickerPanelProps.js +3 -0
  46. package/package.json +1 -1
  47. package/pagination/index.es.js +25 -7
  48. package/pagination/index.umd.js +1 -1
  49. package/result/index.es.js +3 -2
  50. package/result/index.umd.js +1 -1
  51. package/search/index.es.js +39 -10
  52. package/search/index.umd.js +7 -7
  53. package/search/style.css +1 -1
  54. package/select/index.es.js +156 -219
  55. package/select/index.umd.js +13 -13
  56. package/select/style.css +1 -1
  57. package/splitter/index.es.js +27 -7
  58. package/splitter/index.umd.js +10 -10
  59. package/steps/index.d.ts +7 -0
  60. package/steps/index.es.js +385 -0
  61. package/steps/index.umd.js +1 -0
  62. package/{date-picker → steps}/package.json +1 -1
  63. package/steps/style.css +1 -0
  64. package/style.css +1 -1
  65. package/table/index.es.js +542 -267
  66. package/table/index.umd.js +15 -15
  67. package/table/style.css +1 -1
  68. package/tabs/index.es.js +1 -1
  69. package/tabs/index.umd.js +1 -1
  70. package/tabs/style.css +1 -1
  71. package/time-picker/index.d.ts +7 -0
  72. package/{date-picker → time-picker}/index.es.js +1371 -1038
  73. package/time-picker/index.umd.js +27 -0
  74. package/time-picker/package.json +7 -0
  75. package/time-picker/style.css +1 -0
  76. package/time-select/index.es.js +157 -219
  77. package/time-select/index.umd.js +14 -14
  78. package/time-select/style.css +1 -1
  79. package/timeline/index.es.js +3 -2
  80. package/timeline/index.umd.js +1 -1
  81. package/tooltip/index.es.js +1 -1
  82. package/tooltip/index.umd.js +1 -1
  83. package/tree/index.es.js +186 -59
  84. package/tree/index.umd.js +16 -16
  85. package/tree/style.css +1 -1
  86. package/upload/index.es.js +51 -25
  87. package/upload/index.umd.js +1 -1
  88. package/upload/style.css +1 -1
  89. package/vue-devui.es.js +3963 -1421
  90. package/vue-devui.umd.js +23 -23
  91. package/date-picker/index.umd.js +0 -27
  92. package/date-picker/style.css +0 -1
  93. package/nuxt/components/DatePicker.js +0 -3
  94. package/nuxt/components/StickSlider.js +0 -3
@@ -29,9 +29,27 @@ 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
+ const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
36
+ function get(object4, path) {
37
+ const keys = path.split(".");
38
+ let result = object4;
39
+ keys.forEach((key) => {
40
+ var _a;
41
+ result = (_a = result[key]) != null ? _a : "";
42
+ });
43
+ return result;
44
+ }
45
+ function createI18nTranslate(name, app, newPrefix) {
46
+ const prefix = newPrefix || camelize(name) + ".";
47
+ return (path) => {
48
+ const messages2 = app == null ? void 0 : app.appContext.config.globalProperties.langMessages.value;
49
+ const message = get(messages2, prefix + path) || get(messages2, path);
50
+ return message;
51
+ };
52
+ }
35
53
  function className(classStr, classOpt) {
36
54
  let classname = classStr;
37
55
  if (typeof classOpt === "object") {
@@ -1145,7 +1163,7 @@ var lodash = { exports: {} };
1145
1163
  function baseAt(object4, paths) {
1146
1164
  var index2 = -1, length = paths.length, result2 = Array2(length), skip = object4 == null;
1147
1165
  while (++index2 < length) {
1148
- result2[index2] = skip ? undefined$1 : get(object4, paths[index2]);
1166
+ result2[index2] = skip ? undefined$1 : get2(object4, paths[index2]);
1149
1167
  }
1150
1168
  return result2;
1151
1169
  }
@@ -1590,7 +1608,7 @@ var lodash = { exports: {} };
1590
1608
  return matchesStrictComparable(toKey(path), srcValue);
1591
1609
  }
1592
1610
  return function(object4) {
1593
- var objValue = get(object4, path);
1611
+ var objValue = get2(object4, path);
1594
1612
  return objValue === undefined$1 && objValue === srcValue ? hasIn(object4, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
1595
1613
  };
1596
1614
  }
@@ -4323,7 +4341,7 @@ var lodash = { exports: {} };
4323
4341
  function functionsIn(object4) {
4324
4342
  return object4 == null ? [] : baseFunctions(object4, keysIn(object4));
4325
4343
  }
4326
- function get(object4, path, defaultValue) {
4344
+ function get2(object4, path, defaultValue) {
4327
4345
  var result2 = object4 == null ? undefined$1 : baseGet(object4, path);
4328
4346
  return result2 === undefined$1 ? defaultValue : result2;
4329
4347
  }
@@ -5178,7 +5196,7 @@ var lodash = { exports: {} };
5178
5196
  lodash2.forInRight = forInRight;
5179
5197
  lodash2.forOwn = forOwn;
5180
5198
  lodash2.forOwnRight = forOwnRight;
5181
- lodash2.get = get;
5199
+ lodash2.get = get2;
5182
5200
  lodash2.gt = gt;
5183
5201
  lodash2.gte = gte;
5184
5202
  lodash2.has = has;
@@ -7734,7 +7752,7 @@ defineComponent({
7734
7752
  };
7735
7753
  }
7736
7754
  });
7737
- function useSelect(props, ctx, focus, blur, isSelectFocus) {
7755
+ function useSelect(props, ctx, focus, blur, isSelectFocus, t) {
7738
7756
  const formContext = inject(FORM_TOKEN, void 0);
7739
7757
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
7740
7758
  const ns2 = useNamespace("select");
@@ -7742,6 +7760,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7742
7760
  const dropdownRef = ref();
7743
7761
  const selectDisabled = computed(() => (formContext == null ? void 0 : formContext.disabled) || props.disabled);
7744
7762
  const selectSize = computed(() => (formContext == null ? void 0 : formContext.size) || props.size);
7763
+ const isObjectOption = ref(false);
7745
7764
  const isOpen = ref(false);
7746
7765
  const toggleChange = (bool) => {
7747
7766
  if (selectDisabled.value) {
@@ -7765,6 +7784,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7765
7784
  [ns2.m("focus")]: isSelectFocus.value
7766
7785
  });
7767
7786
  });
7787
+ const cacheOptions = /* @__PURE__ */ new Map();
7768
7788
  const mergeOptions = computed(() => {
7769
7789
  const { multiple, modelValue } = props;
7770
7790
  return props.options.map((item) => {
@@ -7788,11 +7808,13 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7788
7808
  option._checked = false;
7789
7809
  }
7790
7810
  }
7811
+ cacheOptions.set(option.value, option);
7791
7812
  return option;
7792
7813
  });
7793
7814
  });
7815
+ const getValuesOption = (values) => values.map((value) => cacheOptions.get(value));
7794
7816
  const injectOptions = ref(/* @__PURE__ */ new Map());
7795
- const updateInjectOptions = (item, operation) => {
7817
+ const updateInjectOptions = (item, operation, isObject2) => {
7796
7818
  if (operation === "add") {
7797
7819
  injectOptions.value.set(item.value, item);
7798
7820
  } else if (operation === "delete") {
@@ -7800,6 +7822,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7800
7822
  injectOptions.value.delete(item.value);
7801
7823
  }
7802
7824
  }
7825
+ isObjectOption.value = isObject2;
7803
7826
  };
7804
7827
  const getInjectOptions = (values) => {
7805
7828
  return values.map((value) => {
@@ -7824,10 +7847,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7824
7847
  const inputValue = computed(() => {
7825
7848
  var _a;
7826
7849
  if (props.multiple && Array.isArray(props.modelValue)) {
7827
- selectedOptions.value = getInjectOptions(props.modelValue).filter((item) => !!item);
7850
+ selectedOptions.value = getInjectOptions(props.modelValue).filter((item) => item ? true : false);
7828
7851
  return selectedOptions.value.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",");
7829
7852
  } else if (!Array.isArray(props.modelValue)) {
7830
- selectedOptions.value = getInjectOptions([props.modelValue]).filter((item) => !!item);
7853
+ selectedOptions.value = getInjectOptions([props.modelValue]).filter((item) => item ? true : false);
7831
7854
  return ((_a = selectedOptions.value[0]) == null ? void 0 : _a.name) || "";
7832
7855
  }
7833
7856
  return "";
@@ -7838,7 +7861,26 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7838
7861
  toggleChange(!isOpen.value);
7839
7862
  };
7840
7863
  const isSupportFilter = computed(() => lodash.exports.isFunction(props.filter) || typeof props.filter === "boolean" && props.filter);
7841
- const valueChange = (item, isObjectOption) => {
7864
+ const getMultipleSelected = (items) => {
7865
+ if (mergeOptions.value.length) {
7866
+ ctx.emit("value-change", getValuesOption(items).filter((item) => item ? true : false));
7867
+ } else if (isObjectOption.value) {
7868
+ const selectItems = getInjectOptions(items).filter((item) => item ? true : false);
7869
+ ctx.emit("value-change", selectItems);
7870
+ } else {
7871
+ ctx.emit("value-change", items);
7872
+ }
7873
+ };
7874
+ const getSingleSelected = (item) => {
7875
+ if (mergeOptions.value.length) {
7876
+ ctx.emit("value-change", getValuesOption([item.value])[0]);
7877
+ } else if (isObjectOption.value) {
7878
+ ctx.emit("value-change", item);
7879
+ } else {
7880
+ ctx.emit("value-change", item.value);
7881
+ }
7882
+ };
7883
+ const valueChange = (item) => {
7842
7884
  const { multiple } = props;
7843
7885
  let { modelValue } = props;
7844
7886
  if (multiple) {
@@ -7848,6 +7890,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7848
7890
  if (option) {
7849
7891
  option._checked = !option._checked;
7850
7892
  }
7893
+ const mergeOption = getValuesOption([item.value])[0];
7894
+ if (mergeOption) {
7895
+ mergeOption._checked = !mergeOption._checked;
7896
+ }
7851
7897
  if (index2 > -1) {
7852
7898
  checkedItems.splice(index2, 1);
7853
7899
  } else {
@@ -7861,11 +7907,12 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7861
7907
  if (isSupportFilter.value) {
7862
7908
  focus();
7863
7909
  }
7910
+ getMultipleSelected(checkedItems);
7864
7911
  } else {
7865
7912
  ctx.emit("update:modelValue", item.value);
7866
7913
  toggleChange(false);
7914
+ getSingleSelected(item);
7867
7915
  }
7868
- ctx.emit("value-change", isObjectOption ? item : item.value);
7869
7916
  };
7870
7917
  const handleClose = () => {
7871
7918
  isOpen.value = false;
@@ -7874,8 +7921,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7874
7921
  const handleClear = () => {
7875
7922
  if (props.multiple) {
7876
7923
  ctx.emit("update:modelValue", []);
7924
+ ctx.emit("value-change", []);
7877
7925
  } else {
7878
7926
  ctx.emit("update:modelValue", "");
7927
+ ctx.emit("value-change", "");
7879
7928
  }
7880
7929
  ctx.emit("clear");
7881
7930
  if (isOpen.value) {
@@ -7895,6 +7944,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7895
7944
  modelValue = checkedItems;
7896
7945
  ctx.emit("update:modelValue", modelValue);
7897
7946
  ctx.emit("remove-tag", data.value);
7947
+ getMultipleSelected(checkedItems);
7898
7948
  };
7899
7949
  const onFocus = (e) => {
7900
7950
  ctx.emit("focus", e);
@@ -7934,13 +7984,13 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
7934
7984
  return label.toString().toLocaleLowerCase().includes(filterQuery.value.toLocaleLowerCase());
7935
7985
  }).length;
7936
7986
  if (isLoading.value) {
7937
- return props.loadingText;
7987
+ return props.loadingText || t("loadingText");
7938
7988
  }
7939
7989
  if (isSupportFilter.value && filterQuery.value && injectOptionsArray.value.length > 0 && visibleOptionsCount === 0) {
7940
- return props.noMatchText;
7990
+ return props.noMatchText || t("noMatchText");
7941
7991
  }
7942
7992
  if (injectOptionsArray.value.length === 0) {
7943
- return props.noDataText;
7993
+ return props.noDataText || t("noDataText");
7944
7994
  }
7945
7995
  return "";
7946
7996
  });
@@ -8011,7 +8061,7 @@ const selectProps = {
8011
8061
  },
8012
8062
  placeholder: {
8013
8063
  type: String,
8014
- default: "\u8BF7\u9009\u62E9"
8064
+ default: ""
8015
8065
  },
8016
8066
  multiple: {
8017
8067
  type: Boolean,
@@ -8051,11 +8101,11 @@ const selectProps = {
8051
8101
  },
8052
8102
  noDataText: {
8053
8103
  type: String,
8054
- default: "\u65E0\u6570\u636E"
8104
+ default: ""
8055
8105
  },
8056
8106
  noMatchText: {
8057
8107
  type: String,
8058
- default: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55"
8108
+ default: ""
8059
8109
  },
8060
8110
  loading: {
8061
8111
  type: Boolean,
@@ -8063,7 +8113,7 @@ const selectProps = {
8063
8113
  },
8064
8114
  loadingText: {
8065
8115
  type: String,
8066
- default: "\u52A0\u8F7D\u4E2D"
8116
+ default: ""
8067
8117
  },
8068
8118
  onToggleChange: {
8069
8119
  type: Function,
@@ -8102,7 +8152,17 @@ const selectContentProps = {
8102
8152
  default: ""
8103
8153
  }
8104
8154
  };
8155
+ const optionGroupProps = {
8156
+ label: {
8157
+ type: String
8158
+ },
8159
+ disabled: {
8160
+ type: Boolean,
8161
+ default: false
8162
+ }
8163
+ };
8105
8164
  const SELECT_TOKEN = Symbol("dSelect");
8165
+ const OPTION_GROUP_TOKEN = Symbol("dOptionGroup");
8106
8166
  const commonProps = {
8107
8167
  name: {
8108
8168
  type: String,
@@ -8559,6 +8619,7 @@ defineComponent({
8559
8619
  function useOption(props) {
8560
8620
  const ns2 = useNamespace("select");
8561
8621
  const select2 = inject(SELECT_TOKEN, null);
8622
+ const optionGroup = inject(OPTION_GROUP_TOKEN, null);
8562
8623
  const currentName = computed(() => {
8563
8624
  return props.name || props.value;
8564
8625
  });
@@ -8580,16 +8641,17 @@ function useOption(props) {
8580
8641
  _checked: false
8581
8642
  };
8582
8643
  });
8644
+ const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
8583
8645
  const isObjectOption = ref(!!props.name);
8584
8646
  const selectOptionCls = computed(() => {
8585
8647
  return className(ns2.e("item"), {
8586
8648
  active: isOptionSelected.value,
8587
- disabled: props.disabled
8649
+ disabled: isDisabled.value
8588
8650
  });
8589
8651
  });
8590
8652
  const optionSelect = () => {
8591
- if (!props.disabled) {
8592
- select2 == null ? void 0 : select2.valueChange(optionItem.value, isObjectOption.value);
8653
+ if (!isDisabled.value) {
8654
+ select2 == null ? void 0 : select2.valueChange(optionItem.value);
8593
8655
  }
8594
8656
  };
8595
8657
  const isVisible = computed(() => {
@@ -8601,10 +8663,10 @@ function useOption(props) {
8601
8663
  }
8602
8664
  });
8603
8665
  onBeforeMount(() => {
8604
- select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "add");
8666
+ select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "add", isObjectOption.value);
8605
8667
  });
8606
8668
  onBeforeUnmount(() => {
8607
- select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "delete");
8669
+ select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "delete", isObjectOption.value);
8608
8670
  });
8609
8671
  return {
8610
8672
  currentName,
@@ -8636,188 +8698,38 @@ var Option = defineComponent({
8636
8698
  };
8637
8699
  }
8638
8700
  });
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
- });
8701
+ const AlertCloseIcon = () => createVNode("svg", {
8702
+ "width": "10px",
8703
+ "height": "10px",
8704
+ "viewBox": "0 0 10 10",
8705
+ "version": "1.1",
8706
+ "xmlns": "http://www.w3.org/2000/svg"
8707
+ }, [createVNode("g", {
8708
+ "stroke": "none",
8709
+ "stroke-width": "1",
8710
+ "fill": "none",
8711
+ "fill-rule": "evenodd"
8712
+ }, [createVNode("g", {
8713
+ "transform": "translate(-3.000000, -3.000000)",
8714
+ "fill-rule": "nonzero"
8715
+ }, [createVNode("path", {
8716
+ "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"
8717
+ }, null)])])]);
8718
+ const SelectArrowIcon = () => createVNode("svg", {
8719
+ "width": "1em",
8720
+ "height": "1em",
8721
+ "viewBox": "0 0 16 16",
8722
+ "version": "1.1",
8723
+ "xmlns": "http://www.w3.org/2000/svg"
8724
+ }, [createVNode("g", {
8725
+ "stroke": "none",
8726
+ "stroke-width": "1",
8727
+ "fill": "none",
8728
+ "fill-rule": "evenodd"
8729
+ }, [createVNode("path", {
8730
+ "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",
8731
+ "fill-rule": "nonzero"
8732
+ }, null)])]);
8821
8733
  const tagProps = {
8822
8734
  type: {
8823
8735
  type: String,
@@ -8945,6 +8857,8 @@ function useSelectContent(props) {
8945
8857
  const ns2 = useNamespace("select");
8946
8858
  const select2 = inject(SELECT_TOKEN);
8947
8859
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
8860
+ const app = getCurrentInstance();
8861
+ const t = createI18nTranslate("DSelect", app);
8948
8862
  const searchQuery = ref("");
8949
8863
  const selectedData = computed(() => {
8950
8864
  return (select2 == null ? void 0 : select2.selectedOptions) || [];
@@ -8978,7 +8892,8 @@ function useSelectContent(props) {
8978
8892
  [ns2.em("input", "sm")]: (select2 == null ? void 0 : select2.selectSize) === "sm"
8979
8893
  });
8980
8894
  });
8981
- const placeholder = computed(() => props.value.length > 0 ? "" : (select2 == null ? void 0 : select2.placeholder) || "");
8895
+ const tagSize = computed(() => (select2 == null ? void 0 : select2.selectSize) || "sm");
8896
+ const placeholder = computed(() => props.value.length > 0 ? "" : (select2 == null ? void 0 : select2.placeholder) || t("placeholder"));
8982
8897
  const isMultiple = computed(() => !!(select2 == null ? void 0 : select2.multiple));
8983
8898
  const handleClear = (e) => {
8984
8899
  e.preventDefault();
@@ -8986,7 +8901,7 @@ function useSelectContent(props) {
8986
8901
  select2 == null ? void 0 : select2.handleClear();
8987
8902
  };
8988
8903
  const tagDelete = (data) => {
8989
- if (data && data.value) {
8904
+ if (data && (data.value || data.value === 0)) {
8990
8905
  select2 == null ? void 0 : select2.tagDelete(data);
8991
8906
  }
8992
8907
  };
@@ -9013,6 +8928,7 @@ function useSelectContent(props) {
9013
8928
  isReadOnly,
9014
8929
  selectionCls,
9015
8930
  inputCls,
8931
+ tagSize,
9016
8932
  placeholder,
9017
8933
  isMultiple,
9018
8934
  handleClear,
@@ -9047,6 +8963,7 @@ var SelectContent = defineComponent({
9047
8963
  isReadOnly,
9048
8964
  selectionCls,
9049
8965
  inputCls,
8966
+ tagSize,
9050
8967
  placeholder,
9051
8968
  isMultiple,
9052
8969
  handleClear,
@@ -9067,7 +8984,8 @@ var SelectContent = defineComponent({
9067
8984
  e.stopPropagation();
9068
8985
  tagDelete(item);
9069
8986
  },
9070
- "key": item.value
8987
+ "key": item.value,
8988
+ "size": tagSize.value
9071
8989
  }, {
9072
8990
  default: () => [item.name]
9073
8991
  })), isSupportCollapseTags.value && selectedData.value.length >= 1 && createVNode(Tag, {
@@ -9076,7 +8994,8 @@ var SelectContent = defineComponent({
9076
8994
  e.preventDefault();
9077
8995
  e.stopPropagation();
9078
8996
  tagDelete(selectedData.value[0]);
9079
- }
8997
+ },
8998
+ "size": tagSize.value
9080
8999
  }, {
9081
9000
  default: () => [selectedData.value[0].name]
9082
9001
  }), isSupportCollapseTags.value && selectedData.value.length > 1 && createVNode(Popover, {
@@ -9093,7 +9012,8 @@ var SelectContent = defineComponent({
9093
9012
  e.stopPropagation();
9094
9013
  tagDelete(item);
9095
9014
  },
9096
- "key": item.value
9015
+ "key": item.value,
9016
+ "size": tagSize.value
9097
9017
  }, {
9098
9018
  default: () => [item.name]
9099
9019
  }))])
@@ -9124,13 +9044,9 @@ var SelectContent = defineComponent({
9124
9044
  }, null), createVNode("span", {
9125
9045
  "onClick": handleClear,
9126
9046
  "class": clearCls.value
9127
- }, [createVNode(Icon, {
9128
- "name": "close"
9129
- }, null)]), createVNode("span", {
9047
+ }, [createVNode(AlertCloseIcon, null, null)]), createVNode("span", {
9130
9048
  "class": arrowCls.value
9131
- }, [createVNode(Icon, {
9132
- "name": "select-arrow"
9133
- }, null)])]);
9049
+ }, [createVNode(SelectArrowIcon, null, null)])]);
9134
9050
  };
9135
9051
  }
9136
9052
  });
@@ -9163,6 +9079,8 @@ var Select = defineComponent({
9163
9079
  props: selectProps,
9164
9080
  emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear"],
9165
9081
  setup(props, ctx) {
9082
+ const app = getCurrentInstance();
9083
+ const t = createI18nTranslate("DSelect", app);
9166
9084
  const selectRef = ref();
9167
9085
  const {
9168
9086
  isSelectFocus,
@@ -9194,7 +9112,7 @@ var Select = defineComponent({
9194
9112
  isDisabled,
9195
9113
  toggleChange,
9196
9114
  isShowCreateOption
9197
- } = useSelect(props, ctx, focus, blur, isSelectFocus);
9115
+ } = useSelect(props, ctx, focus, blur, isSelectFocus, t);
9198
9116
  const scrollbarNs = useNamespace("scrollbar");
9199
9117
  const ns2 = useNamespace("select");
9200
9118
  const dropdownCls = ns2.e("dropdown");
@@ -9268,6 +9186,24 @@ var Select = defineComponent({
9268
9186
  };
9269
9187
  }
9270
9188
  });
9189
+ defineComponent({
9190
+ name: "DOptionGroup",
9191
+ props: optionGroupProps,
9192
+ setup(props, ctx) {
9193
+ const ns2 = useNamespace("select");
9194
+ provide(OPTION_GROUP_TOKEN, reactive(__spreadValues({}, toRefs(props))));
9195
+ return () => {
9196
+ var _a;
9197
+ return createVNode("ul", {
9198
+ "class": ns2.e("group")
9199
+ }, [createVNode("li", {
9200
+ "class": ns2.e("group-title")
9201
+ }, [props.label || ""]), createVNode("li", null, [createVNode("ul", {
9202
+ "class": ns2.e("group-content")
9203
+ }, [((_a = ctx.slots) == null ? void 0 : _a.default) && ctx.slots.default()])])]);
9204
+ };
9205
+ }
9206
+ });
9271
9207
  const timeSelectProps = {
9272
9208
  modelValue: {
9273
9209
  type: String,
@@ -9299,7 +9235,7 @@ const timeSelectProps = {
9299
9235
  },
9300
9236
  placeholder: {
9301
9237
  type: String,
9302
- default: "\u8BF7\u9009\u62E9\u65F6\u95F4"
9238
+ default: ""
9303
9239
  },
9304
9240
  size: {
9305
9241
  type: String,
@@ -9423,6 +9359,8 @@ var TimeSelect = defineComponent({
9423
9359
  props: timeSelectProps,
9424
9360
  emits: ["change", "blur", "focus", "update:modelValue"],
9425
9361
  setup(props, ctx) {
9362
+ const app = getCurrentInstance();
9363
+ const t = createI18nTranslate("DTimeSelect", app);
9426
9364
  const {
9427
9365
  options,
9428
9366
  changeData,
@@ -9437,7 +9375,7 @@ var TimeSelect = defineComponent({
9437
9375
  "modelValue": props.modelValue,
9438
9376
  "options": options.value,
9439
9377
  "onValueChange": changeData,
9440
- "placeholder": props.placeholder,
9378
+ "placeholder": props.placeholder || t("placeholder"),
9441
9379
  "option-disabled-key": "disabled",
9442
9380
  "disabled": props.disabled,
9443
9381
  "allow-clear": props.clearable,