@touchvue/ui 1.0.0-beta.54 → 1.0.0-beta.56

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 (111) hide show
  1. package/es/components/input/src/input.vue.d.ts +2 -2
  2. package/es/components/pic/index.d.ts +9 -0
  3. package/es/components/pic/src/Pic.vue.d.ts +9 -0
  4. package/es/components/pic/src/pic.d.ts +7 -0
  5. package/es/components/rate/src/rate.vue.d.ts +46 -10
  6. package/es/components/scroll/index.d.ts +15 -0
  7. package/es/components/scroll/src/Scroll.vue.d.ts +9 -0
  8. package/es/components/scroll/src/scroll.d.ts +7 -0
  9. package/es/components/select/src/select.d.ts +18 -0
  10. package/es/components/select/src/select.vue.d.ts +18 -0
  11. package/es/components/table/src/table-head.vue.d.ts +2 -0
  12. package/es/components/tip/src/tip.vue.d.ts +2 -2
  13. package/es/components/upload/src/upload.vue.d.ts +6 -4
  14. package/es/index.d.mjs.map +1 -1
  15. package/es/index.mjs +2 -1
  16. package/es/index.mjs.map +1 -1
  17. package/es/packages/components/calendar/src/calendar.vue2.mjs +22 -0
  18. package/es/packages/components/calendar/src/calendar.vue2.mjs.map +1 -1
  19. package/es/packages/components/cascader/src/cascader-item.vue2.mjs +1 -0
  20. package/es/packages/components/cascader/src/cascader-item.vue2.mjs.map +1 -1
  21. package/es/packages/components/cascader/src/cascader.vue2.mjs +1 -0
  22. package/es/packages/components/cascader/src/cascader.vue2.mjs.map +1 -1
  23. package/es/packages/components/float/src/Float.vue2.mjs +4 -4
  24. package/es/packages/components/float/src/Float.vue2.mjs.map +1 -1
  25. package/es/packages/components/pic/src/Pic.vue2.mjs +18 -2
  26. package/es/packages/components/pic/src/Pic.vue2.mjs.map +1 -1
  27. package/es/packages/components/pic/src/pic.mjs +7 -0
  28. package/es/packages/components/pic/src/pic.mjs.map +1 -1
  29. package/es/packages/components/rate/src/rate.vue2.mjs +153 -85
  30. package/es/packages/components/rate/src/rate.vue2.mjs.map +1 -1
  31. package/es/packages/components/scroll/src/Scroll.vue2.mjs +3 -0
  32. package/es/packages/components/scroll/src/Scroll.vue2.mjs.map +1 -1
  33. package/es/packages/components/scroll/src/scroll.mjs +7 -0
  34. package/es/packages/components/scroll/src/scroll.mjs.map +1 -1
  35. package/es/packages/components/segment/src/segment.vue.mjs +10 -12
  36. package/es/packages/components/segment/src/segment.vue.mjs.map +1 -1
  37. package/es/packages/components/select/src/select.mjs +18 -0
  38. package/es/packages/components/select/src/select.mjs.map +1 -1
  39. package/es/packages/components/select/src/select.vue2.mjs +263 -87
  40. package/es/packages/components/select/src/select.vue2.mjs.map +1 -1
  41. package/es/packages/components/table/src/table-head.vue2.mjs +101 -45
  42. package/es/packages/components/table/src/table-head.vue2.mjs.map +1 -1
  43. package/es/packages/components/table/src/table.vue2.mjs +244 -62
  44. package/es/packages/components/table/src/table.vue2.mjs.map +1 -1
  45. package/es/packages/components/tree/src/tree-item.vue2.mjs +2 -1
  46. package/es/packages/components/tree/src/tree-item.vue2.mjs.map +1 -1
  47. package/es/packages/components/upload/src/upload.vue2.mjs +203 -153
  48. package/es/packages/components/upload/src/upload.vue2.mjs.map +1 -1
  49. package/es/packages/directives/tip/src/tip.mjs +42 -27
  50. package/es/packages/directives/tip/src/tip.mjs.map +1 -1
  51. package/es/packages/locale/format.mjs +1 -1
  52. package/es/packages/locale/format.mjs.map +1 -1
  53. package/es/ui/index.d.ts +6 -0
  54. package/lib/components/input/src/input.vue.d.ts +2 -2
  55. package/lib/components/pic/index.d.ts +9 -0
  56. package/lib/components/pic/src/Pic.vue.d.ts +9 -0
  57. package/lib/components/pic/src/pic.d.ts +7 -0
  58. package/lib/components/rate/src/rate.vue.d.ts +46 -10
  59. package/lib/components/scroll/index.d.ts +15 -0
  60. package/lib/components/scroll/src/Scroll.vue.d.ts +9 -0
  61. package/lib/components/scroll/src/scroll.d.ts +7 -0
  62. package/lib/components/select/src/select.d.ts +18 -0
  63. package/lib/components/select/src/select.vue.d.ts +18 -0
  64. package/lib/components/table/src/table-head.vue.d.ts +2 -0
  65. package/lib/components/tip/src/tip.vue.d.ts +2 -2
  66. package/lib/components/upload/src/upload.vue.d.ts +6 -4
  67. package/lib/index.d.js.map +1 -1
  68. package/lib/index.js +2 -1
  69. package/lib/index.js.map +1 -1
  70. package/lib/packages/components/calendar/src/calendar.vue2.js +22 -0
  71. package/lib/packages/components/calendar/src/calendar.vue2.js.map +1 -1
  72. package/lib/packages/components/cascader/src/cascader-item.vue2.js +1 -0
  73. package/lib/packages/components/cascader/src/cascader-item.vue2.js.map +1 -1
  74. package/lib/packages/components/cascader/src/cascader.vue2.js +1 -0
  75. package/lib/packages/components/cascader/src/cascader.vue2.js.map +1 -1
  76. package/lib/packages/components/float/src/Float.vue2.js +4 -4
  77. package/lib/packages/components/float/src/Float.vue2.js.map +1 -1
  78. package/lib/packages/components/pic/src/Pic.vue2.js +17 -1
  79. package/lib/packages/components/pic/src/Pic.vue2.js.map +1 -1
  80. package/lib/packages/components/pic/src/pic.js +7 -0
  81. package/lib/packages/components/pic/src/pic.js.map +1 -1
  82. package/lib/packages/components/rate/src/rate.vue2.js +152 -84
  83. package/lib/packages/components/rate/src/rate.vue2.js.map +1 -1
  84. package/lib/packages/components/scroll/src/Scroll.vue2.js +3 -0
  85. package/lib/packages/components/scroll/src/Scroll.vue2.js.map +1 -1
  86. package/lib/packages/components/scroll/src/scroll.js +7 -0
  87. package/lib/packages/components/scroll/src/scroll.js.map +1 -1
  88. package/lib/packages/components/segment/src/segment.vue.js +10 -12
  89. package/lib/packages/components/segment/src/segment.vue.js.map +1 -1
  90. package/lib/packages/components/select/src/select.js +18 -0
  91. package/lib/packages/components/select/src/select.js.map +1 -1
  92. package/lib/packages/components/select/src/select.vue2.js +262 -86
  93. package/lib/packages/components/select/src/select.vue2.js.map +1 -1
  94. package/lib/packages/components/table/src/table-head.vue2.js +100 -44
  95. package/lib/packages/components/table/src/table-head.vue2.js.map +1 -1
  96. package/lib/packages/components/table/src/table.vue2.js +243 -61
  97. package/lib/packages/components/table/src/table.vue2.js.map +1 -1
  98. package/lib/packages/components/tree/src/tree-item.vue2.js +2 -1
  99. package/lib/packages/components/tree/src/tree-item.vue2.js.map +1 -1
  100. package/lib/packages/components/upload/src/upload.vue2.js +202 -152
  101. package/lib/packages/components/upload/src/upload.vue2.js.map +1 -1
  102. package/lib/packages/directives/tip/src/tip.js +41 -26
  103. package/lib/packages/directives/tip/src/tip.js.map +1 -1
  104. package/lib/packages/locale/format.js +1 -1
  105. package/lib/packages/locale/format.js.map +1 -1
  106. package/lib/ui/index.d.ts +6 -0
  107. package/package.json +1 -1
  108. package/theme/base.css +0 -3
  109. package/theme/components/index.css +445 -255
  110. package/theme/index.css +445 -255
  111. package/theme/skin/default.css +445 -255
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, onMounted, onUnmounted, inject, computed, watch, nextTick, resolveDirective, openBlock, createElementBlock, Fragment, createCommentVNode, withDirectives, unref, normalizeClass, normalizeStyle, withKeys, createElementVNode, vShow, renderSlot, toDisplayString, createBlock, renderList, vModelSelect, createTextVNode, withCtx, createVNode, Teleport, withModifiers } from 'vue';
1
+ import { defineComponent, ref, onMounted, nextTick, onUnmounted, inject, getCurrentInstance, computed, watch, resolveDirective, openBlock, createElementBlock, Fragment, createCommentVNode, withDirectives, unref, normalizeClass, normalizeStyle, withKeys, createElementVNode, vShow, renderSlot, toDisplayString, createBlock, renderList, vModelSelect, createTextVNode, withCtx, withModifiers, createVNode, Teleport } from 'vue';
2
2
  import { langKey, t } from '../../../locale/index.mjs';
3
3
  import { selectProps } from './select.mjs';
4
4
  import { ToButton } from '../../button/index.mjs';
@@ -39,8 +39,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  onMounted(() => {
40
40
  calcScale();
41
41
  window.addEventListener("resize", calcScale);
42
+ nextTick(() => setupTagResizeObserver());
42
43
  onUnmounted(() => {
43
44
  window.removeEventListener("resize", calcScale);
45
+ if (tagResizeObserver) {
46
+ tagResizeObserver.disconnect();
47
+ tagResizeObserver = null;
48
+ }
44
49
  });
45
50
  });
46
51
  const props = __props;
@@ -50,6 +55,28 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
50
55
  const $TouchUI = inject("$TouchUI", {
51
56
  colors: ["primary", "success", "warning", "danger", "info", "default", "dark"]
52
57
  });
58
+ const ins = getCurrentInstance();
59
+ const iClearType = computed(() => {
60
+ var _a, _b, _c;
61
+ if (props.clearType) {
62
+ return props.clearType;
63
+ }
64
+ return (_c = (_b = (_a = ins == null ? void 0 : ins.appContext.config.globalProperties.$TouchUI) == null ? void 0 : _a.select) == null ? void 0 : _b.clearType) != null ? _c : "icon";
65
+ });
66
+ const showClearIcon = computed(() => {
67
+ var _a;
68
+ if (!props.clearable || disabled.value || props.native)
69
+ return false;
70
+ if (iClearType.value !== "icon")
71
+ return false;
72
+ if (props.inputable || props.filterable || props.setDataFn || props.remoteMethod)
73
+ return false;
74
+ if (props.multiple) {
75
+ return selected.value.filter((item) => !item.hide).length > 0;
76
+ } else {
77
+ return Boolean((_a = selected.value) == null ? void 0 : _a[iValueText.value]);
78
+ }
79
+ });
53
80
  const { isPhone } = useDevice();
54
81
  const $phone = isPhone.value;
55
82
  const iValue = ref(props.modelValue);
@@ -66,6 +93,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
66
93
  const multipleInputValue = ref("");
67
94
  const multipleFilterValue = ref("");
68
95
  const setDataInputValue = ref("");
96
+ const isFiltering = ref(false);
69
97
  const dataLoading = ref(false);
70
98
  const errorTip = ref("");
71
99
  const errorType = ref("rule");
@@ -86,6 +114,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
86
114
  const popupFilter = ref(null);
87
115
  const popupInput = ref(null);
88
116
  const trigger = ref(null);
117
+ const tagContainerRef = ref(null);
89
118
  const options = ref([]);
90
119
  const anotherOptions = ref([]);
91
120
  const { selected } = useSelectOptionData({
@@ -96,6 +125,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
96
125
  return true;
97
126
  if (props.remoteMethod)
98
127
  return true;
128
+ if (!isFiltering.value)
129
+ return true;
99
130
  const value = filterValue.value;
100
131
  if (value === "")
101
132
  return true;
@@ -106,12 +137,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
106
137
  return true;
107
138
  if (props.remoteMethod)
108
139
  return true;
140
+ if (!isFiltering.value)
141
+ return true;
109
142
  const value = multipleFilterValue.value;
110
143
  if (value === "")
111
144
  return true;
112
145
  return item[iLabelText.value].includes(value);
113
146
  };
114
147
  const nomatch = computed(() => {
148
+ if (!isFiltering.value)
149
+ return false;
115
150
  let nomatch2 = true;
116
151
  let value = props.multiple ? multipleFilterValue.value : filterValue.value;
117
152
  if (value === "") {
@@ -281,7 +316,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
281
316
  if (props.native) {
282
317
  return;
283
318
  }
284
- if (!props.multiple && props.clearable && !props.inputable && !props.setDataFn && !props.filterable && !props.remoteMethod && (!props.optionDisplay || props.optionDisplay === "float")) {
319
+ if (!props.multiple && props.clearable && iClearType.value === "default" && !props.inputable && !props.setDataFn && !props.filterable && !props.remoteMethod && (!props.optionDisplay || props.optionDisplay === "float")) {
285
320
  options.value.unshift({
286
321
  [iLabelText.value]: "",
287
322
  [iValueText.value]: ""
@@ -524,6 +559,82 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
524
559
  }
525
560
  return arr;
526
561
  });
562
+ const visibleCount = ref(Infinity);
563
+ let isRecalculating = false;
564
+ let tagResizeObserver = null;
565
+ const displaySelected = computed(() => {
566
+ return selected.value.filter((item) => !item.hide);
567
+ });
568
+ const overflowCount = computed(() => {
569
+ if (!props.isCount)
570
+ return 0;
571
+ const max = visibleCount.value;
572
+ if (max >= displaySelected.value.length)
573
+ return 0;
574
+ return displaySelected.value.length - max;
575
+ });
576
+ const recalcVisibleCount = () => {
577
+ if (!props.isCount || isRecalculating || !tagContainerRef.value)
578
+ return;
579
+ isRecalculating = true;
580
+ visibleCount.value = Infinity;
581
+ nextTick(() => {
582
+ const container = tagContainerRef.value;
583
+ if (!container) {
584
+ isRecalculating = false;
585
+ return;
586
+ }
587
+ const containerWidth = container.clientWidth;
588
+ const tags = container.querySelectorAll(".to-select-item");
589
+ if (tags.length === 0) {
590
+ isRecalculating = false;
591
+ return;
592
+ }
593
+ const style = getComputedStyle(container);
594
+ const fontSize = parseFloat(style.fontSize) || 16;
595
+ const gap = parseFloat(style.gap || style.rowGap) || 0;
596
+ const firstTagStyle = getComputedStyle(tags[0]);
597
+ const tagMarginLeft = parseFloat(firstTagStyle.marginLeft) || 0;
598
+ const tagMarginRight = parseFloat(firstTagStyle.marginRight) || 0;
599
+ const tagMargin = tagMarginLeft + tagMarginRight;
600
+ const overflowEstimate = 3 * fontSize + tagMargin + gap;
601
+ let reserved = overflowEstimate;
602
+ const inputEl = container.querySelector(".to-select-input");
603
+ if (inputEl) {
604
+ const inputStyle = getComputedStyle(inputEl);
605
+ const inputMargin = (parseFloat(inputStyle.marginLeft) || 0) + (parseFloat(inputStyle.marginRight) || 0);
606
+ reserved += inputEl.offsetWidth + inputMargin + gap;
607
+ }
608
+ let totalWidth = reserved;
609
+ let count = 0;
610
+ for (let i = 0; i < tags.length; i++) {
611
+ const w = tags[i].offsetWidth + tagMargin + gap;
612
+ if (totalWidth + w > containerWidth)
613
+ break;
614
+ totalWidth += w;
615
+ count++;
616
+ }
617
+ visibleCount.value = count > 0 ? count : 1;
618
+ nextTick(() => {
619
+ isRecalculating = false;
620
+ });
621
+ });
622
+ };
623
+ const setupTagResizeObserver = () => {
624
+ if (props.isCount && props.multiple && tagContainerRef.value) {
625
+ if (!tagResizeObserver) {
626
+ tagResizeObserver = new ResizeObserver(() => recalcVisibleCount());
627
+ }
628
+ tagResizeObserver.observe(tagContainerRef.value);
629
+ recalcVisibleCount();
630
+ } else {
631
+ if (tagResizeObserver) {
632
+ tagResizeObserver.disconnect();
633
+ tagResizeObserver = null;
634
+ }
635
+ visibleCount.value = Infinity;
636
+ }
637
+ };
527
638
  const change = (value, option) => {
528
639
  if (props.beforeChange) {
529
640
  let result = props.beforeChange(value, option);
@@ -629,6 +740,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
629
740
  }
630
741
  };
631
742
  const filterInput = () => {
743
+ isFiltering.value = true;
632
744
  if (props.remoteMethod) {
633
745
  const keyword = props.multiple ? multipleFilterValue.value : filterValue.value;
634
746
  clearTimeout(remoteSearchTimer);
@@ -638,6 +750,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
638
750
  }
639
751
  };
640
752
  const filterClear = () => {
753
+ isFiltering.value = false;
641
754
  iValue.value = "";
642
755
  };
643
756
  const setDataLoading = (loading) => {
@@ -698,6 +811,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
698
811
  const clear = () => {
699
812
  clearChange();
700
813
  };
814
+ const clearClick = () => {
815
+ clear();
816
+ closeLayer();
817
+ };
701
818
  const clearChange = () => {
702
819
  if (props.multiple) {
703
820
  change("", []);
@@ -842,6 +959,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
842
959
  disabled.value = newVal;
843
960
  }
844
961
  );
962
+ watch(
963
+ () => props.isCount,
964
+ () => {
965
+ nextTick(() => setupTagResizeObserver());
966
+ }
967
+ );
968
+ watch(
969
+ selected,
970
+ () => {
971
+ if (props.isCount) {
972
+ nextTick(() => recalcVisibleCount());
973
+ }
974
+ },
975
+ { deep: true }
976
+ );
845
977
  const getLabel = (val) => {
846
978
  const obj = options.value.find((item) => String(item[iValueText.value]) === String(val));
847
979
  if (obj && obj[iLabelText.value]) {
@@ -926,6 +1058,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
926
1058
  }
927
1059
  };
928
1060
  const layerClose = () => {
1061
+ isFiltering.value = false;
929
1062
  if (!props.multiple) {
930
1063
  if ((props.filterable || props.remoteMethod) && !props.inputable) {
931
1064
  if (iValue.value) {
@@ -956,6 +1089,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
956
1089
  openOptionLayer();
957
1090
  };
958
1091
  const layerOpen = () => {
1092
+ isFiltering.value = false;
959
1093
  calcScale();
960
1094
  };
961
1095
  const compare = () => {
@@ -993,6 +1127,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
993
1127
  key: unref(langKey),
994
1128
  ref_key: "$el",
995
1129
  ref: $el,
1130
+ role: "button",
996
1131
  flex: _ctx.flex ? _ctx.flex : null,
997
1132
  class: normalizeClass(["to-select", unref(setClass)]),
998
1133
  style: normalizeStyle(unref(setStyle)),
@@ -1072,7 +1207,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1072
1207
  ref: selector,
1073
1208
  "onUpdate:modelValue": ($event) => iValue.value = $event
1074
1209
  }, [
1075
- _ctx.clearable ? (openBlock(), createElementBlock(
1210
+ _ctx.clearable && iClearType.value === "default" ? (openBlock(), createElementBlock(
1076
1211
  "option",
1077
1212
  {
1078
1213
  key: 0,
@@ -1257,91 +1392,124 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1257
1392
  { key: 2 },
1258
1393
  [
1259
1394
  createCommentVNode(" \u591A\u9009\u6807\u7B7E\u5BB9\u5668 "),
1260
- createElementVNode("span", { class: "to-select-tag" }, [
1261
- createCommentVNode(" \u5DF2\u9009\u4E2D\u9879\u7684\u6807\u7B7E\u663E\u793A "),
1262
- unref(selected).length > 0 && !(isAll.value && _ctx.useAllText) ? (openBlock(true), createElementBlock(
1263
- Fragment,
1264
- { key: 0 },
1265
- renderList(unref(selected), (item, index) => {
1266
- return openBlock(), createElementBlock(
1267
- Fragment,
1268
- null,
1269
- [
1270
- !item.hide ? (openBlock(), createBlock(unref(ToTag), {
1271
- key: index,
1272
- class: "to-select-item",
1273
- removable: _ctx.removable && !disabled.value,
1274
- onRemove: ($event) => removeTag(item)
1275
- }, {
1276
- default: withCtx(() => [
1277
- createTextVNode(
1278
- toDisplayString(item[iLabelText.value]),
1279
- 1
1280
- /* TEXT */
1281
- )
1282
- ]),
1283
- _: 2
1284
- /* DYNAMIC */
1285
- }, 1032, ["removable", "onRemove"])) : createCommentVNode("v-if", true)
1286
- ],
1287
- 64
1288
- /* STABLE_FRAGMENT */
1289
- );
1290
- }),
1291
- 256
1292
- /* UNKEYED_FRAGMENT */
1293
- )) : createCommentVNode("v-if", true),
1294
- createCommentVNode(" \u591A\u9009\u8F93\u5165\u6846\u533A\u57DF\uFF08\u975E\u624B\u673A\u7AEF\u6216\u624B\u673A\u7AEF\u65E0\u9009\u4E2D\u9879\u65F6\u663E\u793A\uFF09 "),
1295
- !unref($phone) || unref($phone) && unref(selected).length === 0 ? (openBlock(), createElementBlock("span", {
1296
- key: 1,
1297
- class: "to-select-input"
1298
- }, [
1299
- createCommentVNode(" \u591A\u9009\u53EF\u8F93\u5165\u6A21\u5F0F\u7684\u8F93\u5165\u6846 "),
1300
- _ctx.inputable && !_ctx.filterable && !_ctx.remoteMethod ? (openBlock(), createBlock(unref(ToInput), {
1301
- key: 0,
1302
- ref_key: "input",
1303
- ref: input,
1304
- modelValue: multipleInputValue.value,
1305
- "onUpdate:modelValue": ($event) => multipleInputValue.value = $event,
1306
- "sp-chars": _ctx.spChars,
1307
- disabled: unref($phone),
1308
- "prevent-focus": "",
1309
- mode: "none",
1310
- placeholder: unref(selected).filter((item) => !item.hide).length > 0 ? "" : _ctx.placeholder || unref(t)("to.common.placeholder.select"),
1311
- onFocus: multipleInputFocus,
1312
- onBlur: multipleInputBlur
1313
- }, null, 8, ["modelValue", "onUpdate:modelValue", "sp-chars", "disabled", "placeholder"])) : createCommentVNode("v-if", true),
1314
- createCommentVNode(" \u591A\u9009\u53EF\u8FC7\u6EE4\u6A21\u5F0F filterable = true \u6216 \u8FDC\u7A0B\u641C\u7D22\u6A21\u5F0F remoteMethod \u5B58\u5728\u7684\u8F93\u5165\u6846 "),
1315
- _ctx.filterable || _ctx.remoteMethod ? (openBlock(), createBlock(unref(ToInput), {
1395
+ createElementVNode(
1396
+ "span",
1397
+ {
1398
+ ref_key: "tagContainerRef",
1399
+ ref: tagContainerRef,
1400
+ class: normalizeClass(["to-select-tag", { "is-collapse": _ctx.isCount }])
1401
+ },
1402
+ [
1403
+ createCommentVNode(" \u5DF2\u9009\u4E2D\u9879\u7684\u6807\u7B7E\u663E\u793A "),
1404
+ unref(selected).length > 0 && !(isAll.value && _ctx.useAllText) ? (openBlock(), createElementBlock(
1405
+ Fragment,
1406
+ { key: 0 },
1407
+ [
1408
+ (openBlock(true), createElementBlock(
1409
+ Fragment,
1410
+ null,
1411
+ renderList(_ctx.isCount ? displaySelected.value : unref(selected), (item, index) => {
1412
+ return openBlock(), createElementBlock(
1413
+ Fragment,
1414
+ { key: index },
1415
+ [
1416
+ (_ctx.isCount ? index < visibleCount.value : !item.hide) ? (openBlock(), createBlock(unref(ToTag), {
1417
+ key: 0,
1418
+ class: "to-select-item",
1419
+ removable: _ctx.removable && !disabled.value,
1420
+ onRemove: ($event) => removeTag(item)
1421
+ }, {
1422
+ default: withCtx(() => [
1423
+ createTextVNode(
1424
+ toDisplayString(item[iLabelText.value]),
1425
+ 1
1426
+ /* TEXT */
1427
+ )
1428
+ ]),
1429
+ _: 2
1430
+ /* DYNAMIC */
1431
+ }, 1032, ["removable", "onRemove"])) : createCommentVNode("v-if", true)
1432
+ ],
1433
+ 64
1434
+ /* STABLE_FRAGMENT */
1435
+ );
1436
+ }),
1437
+ 128
1438
+ /* KEYED_FRAGMENT */
1439
+ )),
1440
+ createCommentVNode(" \u6298\u53E0\u6A21\u5F0F\u4E0B\u663E\u793A +N "),
1441
+ _ctx.isCount && overflowCount.value > 0 ? (openBlock(), createBlock(unref(ToTag), {
1442
+ key: 0,
1443
+ class: "to-select-overflow"
1444
+ }, {
1445
+ default: withCtx(() => [
1446
+ createTextVNode(
1447
+ " +" + toDisplayString(overflowCount.value),
1448
+ 1
1449
+ /* TEXT */
1450
+ )
1451
+ ]),
1452
+ _: 1
1453
+ /* STABLE */
1454
+ })) : createCommentVNode("v-if", true)
1455
+ ],
1456
+ 64
1457
+ /* STABLE_FRAGMENT */
1458
+ )) : createCommentVNode("v-if", true),
1459
+ createCommentVNode(" \u591A\u9009\u8F93\u5165\u6846\u533A\u57DF\uFF08\u975E\u624B\u673A\u7AEF\u6216\u624B\u673A\u7AEF\u65E0\u9009\u4E2D\u9879\u65F6\u663E\u793A\uFF09 "),
1460
+ !unref($phone) || unref($phone) && unref(selected).length === 0 ? (openBlock(), createElementBlock("span", {
1316
1461
  key: 1,
1317
- ref_key: "filter",
1318
- ref: filter,
1319
- modelValue: multipleFilterValue.value,
1320
- "onUpdate:modelValue": ($event) => multipleFilterValue.value = $event,
1321
- "sp-chars": _ctx.inputable ? _ctx.spChars : false,
1322
- disabled: unref($phone),
1323
- "prevent-focus": "",
1324
- mode: "none",
1325
- placeholder: unref(selected).filter((item) => !item.hide).length > 0 ? "" : _ctx.placeholder || unref(t)("to.common.placeholder.select"),
1326
- onFocus: multipleFilterFocus,
1327
- onBlur: multipleFilterBlur
1328
- }, null, 8, ["modelValue", "onUpdate:modelValue", "sp-chars", "disabled", "placeholder"])) : createCommentVNode("v-if", true),
1329
- createCommentVNode(" \u591A\u9009\u81EA\u5B9A\u4E49\u6570\u636E\u8BBE\u7F6E\u6A21\u5F0F\u7684\u8F93\u5165\u6846 "),
1330
- _ctx.setDataFn ? (openBlock(), createBlock(unref(ToInput), {
1331
- key: 2,
1332
- ref_key: "filter",
1333
- ref: filter,
1334
- modelValue: setDataInputValue.value,
1335
- "onUpdate:modelValue": ($event) => setDataInputValue.value = $event,
1336
- "sp-chars": _ctx.inputable ? _ctx.spChars : false,
1337
- "prevent-focus": "",
1338
- mode: "none",
1339
- placeholder: unref(selected).filter((item) => !item.hide).length > 0 ? "" : _ctx.placeholder || unref(t)("to.common.placeholder.select"),
1340
- onFocus: multipleFilterFocus,
1341
- onBlur: multipleFilterBlur
1342
- }, null, 8, ["modelValue", "onUpdate:modelValue", "sp-chars", "placeholder"])) : createCommentVNode("v-if", true)
1343
- ])) : createCommentVNode("v-if", true)
1344
- ])
1462
+ class: "to-select-input"
1463
+ }, [
1464
+ createCommentVNode(" \u591A\u9009\u53EF\u8F93\u5165\u6A21\u5F0F\u7684\u8F93\u5165\u6846 "),
1465
+ _ctx.inputable && !_ctx.filterable && !_ctx.remoteMethod ? (openBlock(), createBlock(unref(ToInput), {
1466
+ key: 0,
1467
+ ref_key: "input",
1468
+ ref: input,
1469
+ modelValue: multipleInputValue.value,
1470
+ "onUpdate:modelValue": ($event) => multipleInputValue.value = $event,
1471
+ "sp-chars": _ctx.spChars,
1472
+ disabled: unref($phone),
1473
+ "prevent-focus": "",
1474
+ mode: "none",
1475
+ placeholder: unref(selected).filter((item) => !item.hide).length > 0 ? "" : _ctx.placeholder || unref(t)("to.common.placeholder.select"),
1476
+ onFocus: multipleInputFocus,
1477
+ onBlur: multipleInputBlur
1478
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "sp-chars", "disabled", "placeholder"])) : createCommentVNode("v-if", true),
1479
+ createCommentVNode(" \u591A\u9009\u53EF\u8FC7\u6EE4\u6A21\u5F0F filterable = true \u6216 \u8FDC\u7A0B\u641C\u7D22\u6A21\u5F0F remoteMethod \u5B58\u5728\u7684\u8F93\u5165\u6846 "),
1480
+ _ctx.filterable || _ctx.remoteMethod ? (openBlock(), createBlock(unref(ToInput), {
1481
+ key: 1,
1482
+ ref_key: "filter",
1483
+ ref: filter,
1484
+ modelValue: multipleFilterValue.value,
1485
+ "onUpdate:modelValue": ($event) => multipleFilterValue.value = $event,
1486
+ "sp-chars": _ctx.inputable ? _ctx.spChars : false,
1487
+ disabled: unref($phone),
1488
+ "prevent-focus": "",
1489
+ mode: "none",
1490
+ placeholder: unref(selected).filter((item) => !item.hide).length > 0 ? "" : _ctx.placeholder || unref(t)("to.common.placeholder.select"),
1491
+ onFocus: multipleFilterFocus,
1492
+ onBlur: multipleFilterBlur
1493
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "sp-chars", "disabled", "placeholder"])) : createCommentVNode("v-if", true),
1494
+ createCommentVNode(" \u591A\u9009\u81EA\u5B9A\u4E49\u6570\u636E\u8BBE\u7F6E\u6A21\u5F0F\u7684\u8F93\u5165\u6846 "),
1495
+ _ctx.setDataFn ? (openBlock(), createBlock(unref(ToInput), {
1496
+ key: 2,
1497
+ ref_key: "filter",
1498
+ ref: filter,
1499
+ modelValue: setDataInputValue.value,
1500
+ "onUpdate:modelValue": ($event) => setDataInputValue.value = $event,
1501
+ "sp-chars": _ctx.inputable ? _ctx.spChars : false,
1502
+ "prevent-focus": "",
1503
+ mode: "none",
1504
+ placeholder: unref(selected).filter((item) => !item.hide).length > 0 ? "" : _ctx.placeholder || unref(t)("to.common.placeholder.select"),
1505
+ onFocus: multipleFilterFocus,
1506
+ onBlur: multipleFilterBlur
1507
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "sp-chars", "placeholder"])) : createCommentVNode("v-if", true)
1508
+ ])) : createCommentVNode("v-if", true)
1509
+ ],
1510
+ 2
1511
+ /* CLASS */
1512
+ )
1345
1513
  ],
1346
1514
  2112
1347
1515
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -1354,6 +1522,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1354
1522
  64
1355
1523
  /* STABLE_FRAGMENT */
1356
1524
  )),
1525
+ createCommentVNode(" \u6E05\u9664\u56FE\u6807 "),
1526
+ showClearIcon.value ? (openBlock(), createBlock(unref(ToIcon), {
1527
+ key: 3,
1528
+ class: "to-select-clear",
1529
+ link: "",
1530
+ value: "close",
1531
+ onClick: withModifiers(clearClick, ["stop"])
1532
+ })) : createCommentVNode("v-if", true),
1357
1533
  createCommentVNode(" \u4E0B\u62C9\u7BAD\u5934\u56FE\u6807 "),
1358
1534
  createElementVNode(
1359
1535
  "span",