@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.
- package/es/components/input/src/input.vue.d.ts +2 -2
- package/es/components/pic/index.d.ts +9 -0
- package/es/components/pic/src/Pic.vue.d.ts +9 -0
- package/es/components/pic/src/pic.d.ts +7 -0
- package/es/components/rate/src/rate.vue.d.ts +46 -10
- package/es/components/scroll/index.d.ts +15 -0
- package/es/components/scroll/src/Scroll.vue.d.ts +9 -0
- package/es/components/scroll/src/scroll.d.ts +7 -0
- package/es/components/select/src/select.d.ts +18 -0
- package/es/components/select/src/select.vue.d.ts +18 -0
- package/es/components/table/src/table-head.vue.d.ts +2 -0
- package/es/components/tip/src/tip.vue.d.ts +2 -2
- package/es/components/upload/src/upload.vue.d.ts +6 -4
- package/es/index.d.mjs.map +1 -1
- package/es/index.mjs +2 -1
- package/es/index.mjs.map +1 -1
- package/es/packages/components/calendar/src/calendar.vue2.mjs +22 -0
- package/es/packages/components/calendar/src/calendar.vue2.mjs.map +1 -1
- package/es/packages/components/cascader/src/cascader-item.vue2.mjs +1 -0
- package/es/packages/components/cascader/src/cascader-item.vue2.mjs.map +1 -1
- package/es/packages/components/cascader/src/cascader.vue2.mjs +1 -0
- package/es/packages/components/cascader/src/cascader.vue2.mjs.map +1 -1
- package/es/packages/components/float/src/Float.vue2.mjs +4 -4
- package/es/packages/components/float/src/Float.vue2.mjs.map +1 -1
- package/es/packages/components/pic/src/Pic.vue2.mjs +18 -2
- package/es/packages/components/pic/src/Pic.vue2.mjs.map +1 -1
- package/es/packages/components/pic/src/pic.mjs +7 -0
- package/es/packages/components/pic/src/pic.mjs.map +1 -1
- package/es/packages/components/rate/src/rate.vue2.mjs +153 -85
- package/es/packages/components/rate/src/rate.vue2.mjs.map +1 -1
- package/es/packages/components/scroll/src/Scroll.vue2.mjs +3 -0
- package/es/packages/components/scroll/src/Scroll.vue2.mjs.map +1 -1
- package/es/packages/components/scroll/src/scroll.mjs +7 -0
- package/es/packages/components/scroll/src/scroll.mjs.map +1 -1
- package/es/packages/components/segment/src/segment.vue.mjs +10 -12
- package/es/packages/components/segment/src/segment.vue.mjs.map +1 -1
- package/es/packages/components/select/src/select.mjs +18 -0
- package/es/packages/components/select/src/select.mjs.map +1 -1
- package/es/packages/components/select/src/select.vue2.mjs +263 -87
- package/es/packages/components/select/src/select.vue2.mjs.map +1 -1
- package/es/packages/components/table/src/table-head.vue2.mjs +101 -45
- package/es/packages/components/table/src/table-head.vue2.mjs.map +1 -1
- package/es/packages/components/table/src/table.vue2.mjs +244 -62
- package/es/packages/components/table/src/table.vue2.mjs.map +1 -1
- package/es/packages/components/tree/src/tree-item.vue2.mjs +2 -1
- package/es/packages/components/tree/src/tree-item.vue2.mjs.map +1 -1
- package/es/packages/components/upload/src/upload.vue2.mjs +203 -153
- package/es/packages/components/upload/src/upload.vue2.mjs.map +1 -1
- package/es/packages/directives/tip/src/tip.mjs +42 -27
- package/es/packages/directives/tip/src/tip.mjs.map +1 -1
- package/es/packages/locale/format.mjs +1 -1
- package/es/packages/locale/format.mjs.map +1 -1
- package/es/ui/index.d.ts +6 -0
- package/lib/components/input/src/input.vue.d.ts +2 -2
- package/lib/components/pic/index.d.ts +9 -0
- package/lib/components/pic/src/Pic.vue.d.ts +9 -0
- package/lib/components/pic/src/pic.d.ts +7 -0
- package/lib/components/rate/src/rate.vue.d.ts +46 -10
- package/lib/components/scroll/index.d.ts +15 -0
- package/lib/components/scroll/src/Scroll.vue.d.ts +9 -0
- package/lib/components/scroll/src/scroll.d.ts +7 -0
- package/lib/components/select/src/select.d.ts +18 -0
- package/lib/components/select/src/select.vue.d.ts +18 -0
- package/lib/components/table/src/table-head.vue.d.ts +2 -0
- package/lib/components/tip/src/tip.vue.d.ts +2 -2
- package/lib/components/upload/src/upload.vue.d.ts +6 -4
- package/lib/index.d.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/packages/components/calendar/src/calendar.vue2.js +22 -0
- package/lib/packages/components/calendar/src/calendar.vue2.js.map +1 -1
- package/lib/packages/components/cascader/src/cascader-item.vue2.js +1 -0
- package/lib/packages/components/cascader/src/cascader-item.vue2.js.map +1 -1
- package/lib/packages/components/cascader/src/cascader.vue2.js +1 -0
- package/lib/packages/components/cascader/src/cascader.vue2.js.map +1 -1
- package/lib/packages/components/float/src/Float.vue2.js +4 -4
- package/lib/packages/components/float/src/Float.vue2.js.map +1 -1
- package/lib/packages/components/pic/src/Pic.vue2.js +17 -1
- package/lib/packages/components/pic/src/Pic.vue2.js.map +1 -1
- package/lib/packages/components/pic/src/pic.js +7 -0
- package/lib/packages/components/pic/src/pic.js.map +1 -1
- package/lib/packages/components/rate/src/rate.vue2.js +152 -84
- package/lib/packages/components/rate/src/rate.vue2.js.map +1 -1
- package/lib/packages/components/scroll/src/Scroll.vue2.js +3 -0
- package/lib/packages/components/scroll/src/Scroll.vue2.js.map +1 -1
- package/lib/packages/components/scroll/src/scroll.js +7 -0
- package/lib/packages/components/scroll/src/scroll.js.map +1 -1
- package/lib/packages/components/segment/src/segment.vue.js +10 -12
- package/lib/packages/components/segment/src/segment.vue.js.map +1 -1
- package/lib/packages/components/select/src/select.js +18 -0
- package/lib/packages/components/select/src/select.js.map +1 -1
- package/lib/packages/components/select/src/select.vue2.js +262 -86
- package/lib/packages/components/select/src/select.vue2.js.map +1 -1
- package/lib/packages/components/table/src/table-head.vue2.js +100 -44
- package/lib/packages/components/table/src/table-head.vue2.js.map +1 -1
- package/lib/packages/components/table/src/table.vue2.js +243 -61
- package/lib/packages/components/table/src/table.vue2.js.map +1 -1
- package/lib/packages/components/tree/src/tree-item.vue2.js +2 -1
- package/lib/packages/components/tree/src/tree-item.vue2.js.map +1 -1
- package/lib/packages/components/upload/src/upload.vue2.js +202 -152
- package/lib/packages/components/upload/src/upload.vue2.js.map +1 -1
- package/lib/packages/directives/tip/src/tip.js +41 -26
- package/lib/packages/directives/tip/src/tip.js.map +1 -1
- package/lib/packages/locale/format.js +1 -1
- package/lib/packages/locale/format.js.map +1 -1
- package/lib/ui/index.d.ts +6 -0
- package/package.json +1 -1
- package/theme/base.css +0 -3
- package/theme/components/index.css +445 -255
- package/theme/index.css +445 -255
- package/theme/skin/default.css +445 -255
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, onMounted, onUnmounted, inject, computed, watch,
|
|
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(
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
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
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
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",
|