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.
- package/README.md +160 -149
- package/auto-complete/index.es.js +182 -10
- package/auto-complete/index.umd.js +18 -18
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +3 -1
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +5 -3
- package/button/index.umd.js +6 -6
- package/button/style.css +1 -1
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +4 -4
- package/checkbox/style.css +1 -1
- package/collapse/index.es.js +20 -186
- package/collapse/index.umd.js +1 -1
- package/collapse/style.css +1 -1
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/{date-picker → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +12016 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/dropdown/index.es.js +9 -2
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +248 -56
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1 -1
- package/form/index.umd.js +4 -4
- package/icon/index.es.js +5 -3
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +193 -15
- package/input/index.umd.js +14 -14
- package/input/style.css +1 -1
- package/input-number/index.es.js +1 -4
- package/input-number/index.umd.js +1 -1
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/modal/index.es.js +5 -3
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +32 -34
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/package.json +1 -1
- package/pagination/index.es.js +175 -7
- package/pagination/index.umd.js +1 -1
- package/radio/index.es.js +1 -1
- package/radio/index.umd.js +4 -4
- package/result/index.es.js +5 -3
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +198 -18
- package/search/index.umd.js +13 -13
- package/search/style.css +1 -1
- package/select/index.es.js +382 -258
- package/select/index.umd.js +15 -15
- package/select/style.css +1 -1
- package/splitter/index.es.js +182 -12
- package/splitter/index.umd.js +13 -13
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/{date-picker → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +4 -4
- package/table/index.es.js +851 -294
- package/table/index.umd.js +16 -16
- package/table/style.css +1 -1
- package/tabs/index.es.js +22 -12
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/textarea/index.es.js +3 -2
- package/textarea/index.umd.js +6 -6
- package/time-picker/index.d.ts +7 -0
- package/{date-picker → time-picker}/index.es.js +1537 -1040
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.es.js +383 -258
- package/time-select/index.umd.js +16 -16
- package/time-select/style.css +1 -1
- package/timeline/index.es.js +5 -3
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +1 -1
- package/tooltip/index.umd.js +1 -1
- package/tree/index.es.js +551 -88
- package/tree/index.umd.js +15 -15
- package/tree/style.css +1 -1
- package/upload/index.es.js +230 -57
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14310 -11217
- package/vue-devui.umd.js +23 -23
- package/date-picker/index.umd.js +0 -27
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
package/time-select/index.es.js
CHANGED
|
@@ -29,9 +29,177 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { defineComponent, watch, provide,
|
|
32
|
+
import { ref, reactive, defineComponent, watch, provide, toRefs, createVNode, onUnmounted, Transition, mergeProps, 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
|
+
function deepAssign(...objects) {
|
|
36
|
+
const isObject2 = (obj) => obj && typeof obj === "object";
|
|
37
|
+
return objects.reduce((prev, from) => {
|
|
38
|
+
Object.keys(from).forEach((key) => {
|
|
39
|
+
const pVal = prev[key];
|
|
40
|
+
const oVal = from[key];
|
|
41
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
42
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
43
|
+
} else if (isObject2(pVal) && isObject2(oVal)) {
|
|
44
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
45
|
+
} else {
|
|
46
|
+
prev[key] = oVal;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return prev;
|
|
50
|
+
}, {});
|
|
51
|
+
}
|
|
52
|
+
var zhCN = {
|
|
53
|
+
pagination: {
|
|
54
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
55
|
+
goToText: "\u8DF3\u81F3"
|
|
56
|
+
},
|
|
57
|
+
accordion: {
|
|
58
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
59
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
60
|
+
},
|
|
61
|
+
autoCompleteDropdown: {
|
|
62
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
63
|
+
},
|
|
64
|
+
cascaderList: {
|
|
65
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
66
|
+
},
|
|
67
|
+
colorPicker: {
|
|
68
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
69
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
70
|
+
},
|
|
71
|
+
datePickerPro: {
|
|
72
|
+
ok: "\u786E\u5B9A",
|
|
73
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
74
|
+
month1: "1\u6708",
|
|
75
|
+
month2: "2\u6708",
|
|
76
|
+
month3: "3\u6708",
|
|
77
|
+
month4: "4\u6708",
|
|
78
|
+
month5: "5\u6708",
|
|
79
|
+
month6: "6\u6708",
|
|
80
|
+
month7: "7\u6708",
|
|
81
|
+
month8: "8\u6708",
|
|
82
|
+
month9: "9\u6708",
|
|
83
|
+
month10: "10\u6708",
|
|
84
|
+
month11: "11\u6708",
|
|
85
|
+
month12: "12\u6708",
|
|
86
|
+
year: "\u5E74",
|
|
87
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
88
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
89
|
+
getWeekDays() {
|
|
90
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
91
|
+
},
|
|
92
|
+
getTimeArr() {
|
|
93
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
94
|
+
},
|
|
95
|
+
getYearMonthStr(year, month) {
|
|
96
|
+
return `${year}\u5E74${month}\u6708`;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
editableSelect: {
|
|
100
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
101
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
102
|
+
},
|
|
103
|
+
input: {
|
|
104
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
105
|
+
},
|
|
106
|
+
splitterBar: {
|
|
107
|
+
collapse: "\u6536\u8D77",
|
|
108
|
+
expand: "\u5C55\u5F00"
|
|
109
|
+
},
|
|
110
|
+
stepsGuide: {
|
|
111
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
112
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
113
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
114
|
+
},
|
|
115
|
+
table: {
|
|
116
|
+
selectAll: "\u5168\u9009",
|
|
117
|
+
ok: "\u786E\u5B9A"
|
|
118
|
+
},
|
|
119
|
+
timePopup: {
|
|
120
|
+
ok: "\u786E\u5B9A"
|
|
121
|
+
},
|
|
122
|
+
transfer: {
|
|
123
|
+
unit: "\u9879",
|
|
124
|
+
panelUnit: "\u9879",
|
|
125
|
+
headerUnit: "\u9879",
|
|
126
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
127
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
128
|
+
},
|
|
129
|
+
tree: {
|
|
130
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
131
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
132
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
133
|
+
},
|
|
134
|
+
upload: {
|
|
135
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
136
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
137
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
138
|
+
},
|
|
139
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
140
|
+
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`;
|
|
141
|
+
},
|
|
142
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
143
|
+
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`;
|
|
144
|
+
},
|
|
145
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
146
|
+
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`;
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
search: {
|
|
150
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
151
|
+
},
|
|
152
|
+
select: {
|
|
153
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
154
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
155
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
156
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
157
|
+
},
|
|
158
|
+
tagInput: {
|
|
159
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
160
|
+
},
|
|
161
|
+
timeSelect: {
|
|
162
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const lang = ref("zh-CN");
|
|
166
|
+
let langMessages = reactive({
|
|
167
|
+
[lang.value]: zhCN
|
|
168
|
+
});
|
|
169
|
+
const Locale = {
|
|
170
|
+
messages() {
|
|
171
|
+
return langMessages[lang.value];
|
|
172
|
+
},
|
|
173
|
+
lang() {
|
|
174
|
+
return lang.value;
|
|
175
|
+
},
|
|
176
|
+
use(newLang, newMessages2) {
|
|
177
|
+
lang.value = newLang;
|
|
178
|
+
this.add({ [newLang]: newMessages2 });
|
|
179
|
+
},
|
|
180
|
+
add(newMessages2 = {}) {
|
|
181
|
+
langMessages = deepAssign(langMessages, newMessages2);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
185
|
+
function get(object4, path) {
|
|
186
|
+
const keys = path.split(".");
|
|
187
|
+
let result = object4;
|
|
188
|
+
keys.forEach((key) => {
|
|
189
|
+
var _a;
|
|
190
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
191
|
+
});
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
195
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
196
|
+
return (path) => {
|
|
197
|
+
var _a;
|
|
198
|
+
const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
199
|
+
const message = get(messages2, prefix + path) || get(messages2, path);
|
|
200
|
+
return message;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
35
203
|
function className(classStr, classOpt) {
|
|
36
204
|
let classname = classStr;
|
|
37
205
|
if (typeof classOpt === "object") {
|
|
@@ -786,10 +954,10 @@ var lodash = { exports: {} };
|
|
|
786
954
|
}();
|
|
787
955
|
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
956
|
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"),
|
|
957
|
+
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
958
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
791
959
|
var realNames = {};
|
|
792
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(
|
|
960
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
|
|
793
961
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
794
962
|
function lodash2(value) {
|
|
795
963
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
@@ -1145,7 +1313,7 @@ var lodash = { exports: {} };
|
|
|
1145
1313
|
function baseAt(object4, paths) {
|
|
1146
1314
|
var index2 = -1, length = paths.length, result2 = Array2(length), skip = object4 == null;
|
|
1147
1315
|
while (++index2 < length) {
|
|
1148
|
-
result2[index2] = skip ? undefined$1 :
|
|
1316
|
+
result2[index2] = skip ? undefined$1 : get2(object4, paths[index2]);
|
|
1149
1317
|
}
|
|
1150
1318
|
return result2;
|
|
1151
1319
|
}
|
|
@@ -1590,7 +1758,7 @@ var lodash = { exports: {} };
|
|
|
1590
1758
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
1591
1759
|
}
|
|
1592
1760
|
return function(object4) {
|
|
1593
|
-
var objValue =
|
|
1761
|
+
var objValue = get2(object4, path);
|
|
1594
1762
|
return objValue === undefined$1 && objValue === srcValue ? hasIn(object4, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
1595
1763
|
};
|
|
1596
1764
|
}
|
|
@@ -2481,8 +2649,8 @@ var lodash = { exports: {} };
|
|
|
2481
2649
|
return func(number4);
|
|
2482
2650
|
};
|
|
2483
2651
|
}
|
|
2484
|
-
var createSet = !(
|
|
2485
|
-
return new
|
|
2652
|
+
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values2) {
|
|
2653
|
+
return new Set2(values2);
|
|
2486
2654
|
};
|
|
2487
2655
|
function createToPairs(keysFunc) {
|
|
2488
2656
|
return function(object4) {
|
|
@@ -2781,7 +2949,7 @@ var lodash = { exports: {} };
|
|
|
2781
2949
|
return result2;
|
|
2782
2950
|
};
|
|
2783
2951
|
var getTag = baseGetTag;
|
|
2784
|
-
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag ||
|
|
2952
|
+
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
2953
|
getTag = function(value) {
|
|
2786
2954
|
var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
|
|
2787
2955
|
if (ctorString) {
|
|
@@ -4323,7 +4491,7 @@ var lodash = { exports: {} };
|
|
|
4323
4491
|
function functionsIn(object4) {
|
|
4324
4492
|
return object4 == null ? [] : baseFunctions(object4, keysIn(object4));
|
|
4325
4493
|
}
|
|
4326
|
-
function
|
|
4494
|
+
function get2(object4, path, defaultValue) {
|
|
4327
4495
|
var result2 = object4 == null ? undefined$1 : baseGet(object4, path);
|
|
4328
4496
|
return result2 === undefined$1 ? defaultValue : result2;
|
|
4329
4497
|
}
|
|
@@ -5178,7 +5346,7 @@ var lodash = { exports: {} };
|
|
|
5178
5346
|
lodash2.forInRight = forInRight;
|
|
5179
5347
|
lodash2.forOwn = forOwn;
|
|
5180
5348
|
lodash2.forOwnRight = forOwnRight;
|
|
5181
|
-
lodash2.get =
|
|
5349
|
+
lodash2.get = get2;
|
|
5182
5350
|
lodash2.gt = gt;
|
|
5183
5351
|
lodash2.gte = gte;
|
|
5184
5352
|
lodash2.has = has;
|
|
@@ -7558,7 +7726,7 @@ function useFormItemValidate(props, _rules) {
|
|
|
7558
7726
|
return rule.trigger === triggerVal;
|
|
7559
7727
|
}
|
|
7560
7728
|
}).map((_a) => {
|
|
7561
|
-
var
|
|
7729
|
+
var rule = __objRest(_a, []);
|
|
7562
7730
|
return rule;
|
|
7563
7731
|
});
|
|
7564
7732
|
};
|
|
@@ -7734,7 +7902,7 @@ defineComponent({
|
|
|
7734
7902
|
};
|
|
7735
7903
|
}
|
|
7736
7904
|
});
|
|
7737
|
-
function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
7905
|
+
function useSelect(props, ctx, focus, blur, isSelectFocus, t) {
|
|
7738
7906
|
const formContext = inject(FORM_TOKEN, void 0);
|
|
7739
7907
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
7740
7908
|
const ns2 = useNamespace("select");
|
|
@@ -7742,6 +7910,15 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7742
7910
|
const dropdownRef = ref();
|
|
7743
7911
|
const selectDisabled = computed(() => (formContext == null ? void 0 : formContext.disabled) || props.disabled);
|
|
7744
7912
|
const selectSize = computed(() => (formContext == null ? void 0 : formContext.size) || props.size);
|
|
7913
|
+
const isObjectOption = ref(false);
|
|
7914
|
+
const originRef = ref();
|
|
7915
|
+
const dropdownWidth = computed(() => {
|
|
7916
|
+
var _a;
|
|
7917
|
+
if (!((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth)) {
|
|
7918
|
+
return "100%";
|
|
7919
|
+
}
|
|
7920
|
+
return originRef.value.clientWidth + "px";
|
|
7921
|
+
});
|
|
7745
7922
|
const isOpen = ref(false);
|
|
7746
7923
|
const toggleChange = (bool) => {
|
|
7747
7924
|
if (selectDisabled.value) {
|
|
@@ -7765,6 +7942,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7765
7942
|
[ns2.m("focus")]: isSelectFocus.value
|
|
7766
7943
|
});
|
|
7767
7944
|
});
|
|
7945
|
+
const cacheOptions = /* @__PURE__ */ new Map();
|
|
7768
7946
|
const mergeOptions = computed(() => {
|
|
7769
7947
|
const { multiple, modelValue } = props;
|
|
7770
7948
|
return props.options.map((item) => {
|
|
@@ -7788,11 +7966,13 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7788
7966
|
option._checked = false;
|
|
7789
7967
|
}
|
|
7790
7968
|
}
|
|
7969
|
+
cacheOptions.set(option.value, option);
|
|
7791
7970
|
return option;
|
|
7792
7971
|
});
|
|
7793
7972
|
});
|
|
7973
|
+
const getValuesOption = (values) => values.map((value) => cacheOptions.get(value));
|
|
7794
7974
|
const injectOptions = ref(/* @__PURE__ */ new Map());
|
|
7795
|
-
const updateInjectOptions = (item, operation) => {
|
|
7975
|
+
const updateInjectOptions = (item, operation, isObject2) => {
|
|
7796
7976
|
if (operation === "add") {
|
|
7797
7977
|
injectOptions.value.set(item.value, item);
|
|
7798
7978
|
} else if (operation === "delete") {
|
|
@@ -7800,6 +7980,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7800
7980
|
injectOptions.value.delete(item.value);
|
|
7801
7981
|
}
|
|
7802
7982
|
}
|
|
7983
|
+
isObjectOption.value = isObject2;
|
|
7803
7984
|
};
|
|
7804
7985
|
const getInjectOptions = (values) => {
|
|
7805
7986
|
return values.map((value) => {
|
|
@@ -7824,10 +8005,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7824
8005
|
const inputValue = computed(() => {
|
|
7825
8006
|
var _a;
|
|
7826
8007
|
if (props.multiple && Array.isArray(props.modelValue)) {
|
|
7827
|
-
selectedOptions.value = getInjectOptions(props.modelValue).filter((item) =>
|
|
8008
|
+
selectedOptions.value = getInjectOptions(props.modelValue).filter((item) => item ? true : false);
|
|
7828
8009
|
return selectedOptions.value.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",");
|
|
7829
8010
|
} else if (!Array.isArray(props.modelValue)) {
|
|
7830
|
-
selectedOptions.value = getInjectOptions([props.modelValue]).filter((item) =>
|
|
8011
|
+
selectedOptions.value = getInjectOptions([props.modelValue]).filter((item) => item ? true : false);
|
|
7831
8012
|
return ((_a = selectedOptions.value[0]) == null ? void 0 : _a.name) || "";
|
|
7832
8013
|
}
|
|
7833
8014
|
return "";
|
|
@@ -7838,7 +8019,26 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7838
8019
|
toggleChange(!isOpen.value);
|
|
7839
8020
|
};
|
|
7840
8021
|
const isSupportFilter = computed(() => lodash.exports.isFunction(props.filter) || typeof props.filter === "boolean" && props.filter);
|
|
7841
|
-
const
|
|
8022
|
+
const getMultipleSelected = (items) => {
|
|
8023
|
+
if (mergeOptions.value.length) {
|
|
8024
|
+
ctx.emit("value-change", getValuesOption(items).filter((item) => item ? true : false));
|
|
8025
|
+
} else if (isObjectOption.value) {
|
|
8026
|
+
const selectItems = getInjectOptions(items).filter((item) => item ? true : false);
|
|
8027
|
+
ctx.emit("value-change", selectItems);
|
|
8028
|
+
} else {
|
|
8029
|
+
ctx.emit("value-change", items);
|
|
8030
|
+
}
|
|
8031
|
+
};
|
|
8032
|
+
const getSingleSelected = (item) => {
|
|
8033
|
+
if (mergeOptions.value.length) {
|
|
8034
|
+
ctx.emit("value-change", getValuesOption([item.value])[0]);
|
|
8035
|
+
} else if (isObjectOption.value) {
|
|
8036
|
+
ctx.emit("value-change", item);
|
|
8037
|
+
} else {
|
|
8038
|
+
ctx.emit("value-change", item.value);
|
|
8039
|
+
}
|
|
8040
|
+
};
|
|
8041
|
+
const valueChange = (item) => {
|
|
7842
8042
|
const { multiple } = props;
|
|
7843
8043
|
let { modelValue } = props;
|
|
7844
8044
|
if (multiple) {
|
|
@@ -7848,6 +8048,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7848
8048
|
if (option) {
|
|
7849
8049
|
option._checked = !option._checked;
|
|
7850
8050
|
}
|
|
8051
|
+
const mergeOption = getValuesOption([item.value])[0];
|
|
8052
|
+
if (mergeOption) {
|
|
8053
|
+
mergeOption._checked = !mergeOption._checked;
|
|
8054
|
+
}
|
|
7851
8055
|
if (index2 > -1) {
|
|
7852
8056
|
checkedItems.splice(index2, 1);
|
|
7853
8057
|
} else {
|
|
@@ -7861,11 +8065,12 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7861
8065
|
if (isSupportFilter.value) {
|
|
7862
8066
|
focus();
|
|
7863
8067
|
}
|
|
8068
|
+
getMultipleSelected(checkedItems);
|
|
7864
8069
|
} else {
|
|
7865
8070
|
ctx.emit("update:modelValue", item.value);
|
|
8071
|
+
getSingleSelected(item);
|
|
7866
8072
|
toggleChange(false);
|
|
7867
8073
|
}
|
|
7868
|
-
ctx.emit("value-change", isObjectOption ? item : item.value);
|
|
7869
8074
|
};
|
|
7870
8075
|
const handleClose = () => {
|
|
7871
8076
|
isOpen.value = false;
|
|
@@ -7874,8 +8079,10 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7874
8079
|
const handleClear = () => {
|
|
7875
8080
|
if (props.multiple) {
|
|
7876
8081
|
ctx.emit("update:modelValue", []);
|
|
8082
|
+
ctx.emit("value-change", []);
|
|
7877
8083
|
} else {
|
|
7878
8084
|
ctx.emit("update:modelValue", "");
|
|
8085
|
+
ctx.emit("value-change", "");
|
|
7879
8086
|
}
|
|
7880
8087
|
ctx.emit("clear");
|
|
7881
8088
|
if (isOpen.value) {
|
|
@@ -7895,6 +8102,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7895
8102
|
modelValue = checkedItems;
|
|
7896
8103
|
ctx.emit("update:modelValue", modelValue);
|
|
7897
8104
|
ctx.emit("remove-tag", data.value);
|
|
8105
|
+
getMultipleSelected(checkedItems);
|
|
7898
8106
|
};
|
|
7899
8107
|
const onFocus = (e) => {
|
|
7900
8108
|
ctx.emit("focus", e);
|
|
@@ -7934,13 +8142,13 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7934
8142
|
return label.toString().toLocaleLowerCase().includes(filterQuery.value.toLocaleLowerCase());
|
|
7935
8143
|
}).length;
|
|
7936
8144
|
if (isLoading.value) {
|
|
7937
|
-
return props.loadingText;
|
|
8145
|
+
return props.loadingText || t("loadingText");
|
|
7938
8146
|
}
|
|
7939
8147
|
if (isSupportFilter.value && filterQuery.value && injectOptionsArray.value.length > 0 && visibleOptionsCount === 0) {
|
|
7940
|
-
return props.noMatchText;
|
|
8148
|
+
return props.noMatchText || t("noMatchText");
|
|
7941
8149
|
}
|
|
7942
8150
|
if (injectOptionsArray.value.length === 0) {
|
|
7943
|
-
return props.noDataText;
|
|
8151
|
+
return props.noDataText || t("noDataText");
|
|
7944
8152
|
}
|
|
7945
8153
|
return "";
|
|
7946
8154
|
});
|
|
@@ -7964,6 +8172,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7964
8172
|
selectDisabled,
|
|
7965
8173
|
selectSize,
|
|
7966
8174
|
containerRef,
|
|
8175
|
+
originRef,
|
|
7967
8176
|
dropdownRef,
|
|
7968
8177
|
isOpen,
|
|
7969
8178
|
selectCls,
|
|
@@ -7974,6 +8183,7 @@ function useSelect(props, ctx, focus, blur, isSelectFocus) {
|
|
|
7974
8183
|
emptyText,
|
|
7975
8184
|
isLoading,
|
|
7976
8185
|
isShowEmptyText,
|
|
8186
|
+
dropdownWidth,
|
|
7977
8187
|
onClick,
|
|
7978
8188
|
handleClear,
|
|
7979
8189
|
valueChange,
|
|
@@ -8011,7 +8221,7 @@ const selectProps = {
|
|
|
8011
8221
|
},
|
|
8012
8222
|
placeholder: {
|
|
8013
8223
|
type: String,
|
|
8014
|
-
default: "
|
|
8224
|
+
default: ""
|
|
8015
8225
|
},
|
|
8016
8226
|
multiple: {
|
|
8017
8227
|
type: Boolean,
|
|
@@ -8051,11 +8261,11 @@ const selectProps = {
|
|
|
8051
8261
|
},
|
|
8052
8262
|
noDataText: {
|
|
8053
8263
|
type: String,
|
|
8054
|
-
default: "
|
|
8264
|
+
default: ""
|
|
8055
8265
|
},
|
|
8056
8266
|
noMatchText: {
|
|
8057
8267
|
type: String,
|
|
8058
|
-
default: "
|
|
8268
|
+
default: ""
|
|
8059
8269
|
},
|
|
8060
8270
|
loading: {
|
|
8061
8271
|
type: Boolean,
|
|
@@ -8063,7 +8273,7 @@ const selectProps = {
|
|
|
8063
8273
|
},
|
|
8064
8274
|
loadingText: {
|
|
8065
8275
|
type: String,
|
|
8066
|
-
default: "
|
|
8276
|
+
default: ""
|
|
8067
8277
|
},
|
|
8068
8278
|
onToggleChange: {
|
|
8069
8279
|
type: Function,
|
|
@@ -8102,7 +8312,17 @@ const selectContentProps = {
|
|
|
8102
8312
|
default: ""
|
|
8103
8313
|
}
|
|
8104
8314
|
};
|
|
8315
|
+
const optionGroupProps = {
|
|
8316
|
+
label: {
|
|
8317
|
+
type: String
|
|
8318
|
+
},
|
|
8319
|
+
disabled: {
|
|
8320
|
+
type: Boolean,
|
|
8321
|
+
default: false
|
|
8322
|
+
}
|
|
8323
|
+
};
|
|
8105
8324
|
const SELECT_TOKEN = Symbol("dSelect");
|
|
8325
|
+
const OPTION_GROUP_TOKEN = Symbol("dOptionGroup");
|
|
8106
8326
|
const commonProps = {
|
|
8107
8327
|
name: {
|
|
8108
8328
|
type: String,
|
|
@@ -8559,6 +8779,7 @@ defineComponent({
|
|
|
8559
8779
|
function useOption(props) {
|
|
8560
8780
|
const ns2 = useNamespace("select");
|
|
8561
8781
|
const select2 = inject(SELECT_TOKEN, null);
|
|
8782
|
+
const optionGroup = inject(OPTION_GROUP_TOKEN, null);
|
|
8562
8783
|
const currentName = computed(() => {
|
|
8563
8784
|
return props.name || props.value;
|
|
8564
8785
|
});
|
|
@@ -8580,16 +8801,17 @@ function useOption(props) {
|
|
|
8580
8801
|
_checked: false
|
|
8581
8802
|
};
|
|
8582
8803
|
});
|
|
8804
|
+
const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
|
|
8583
8805
|
const isObjectOption = ref(!!props.name);
|
|
8584
8806
|
const selectOptionCls = computed(() => {
|
|
8585
8807
|
return className(ns2.e("item"), {
|
|
8586
8808
|
active: isOptionSelected.value,
|
|
8587
|
-
disabled:
|
|
8809
|
+
disabled: isDisabled.value
|
|
8588
8810
|
});
|
|
8589
8811
|
});
|
|
8590
8812
|
const optionSelect = () => {
|
|
8591
|
-
if (!
|
|
8592
|
-
select2 == null ? void 0 : select2.valueChange(optionItem.value
|
|
8813
|
+
if (!isDisabled.value) {
|
|
8814
|
+
select2 == null ? void 0 : select2.valueChange(optionItem.value);
|
|
8593
8815
|
}
|
|
8594
8816
|
};
|
|
8595
8817
|
const isVisible = computed(() => {
|
|
@@ -8601,10 +8823,10 @@ function useOption(props) {
|
|
|
8601
8823
|
}
|
|
8602
8824
|
});
|
|
8603
8825
|
onBeforeMount(() => {
|
|
8604
|
-
select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "add");
|
|
8826
|
+
select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "add", isObjectOption.value);
|
|
8605
8827
|
});
|
|
8606
8828
|
onBeforeUnmount(() => {
|
|
8607
|
-
select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "delete");
|
|
8829
|
+
select2 == null ? void 0 : select2.updateInjectOptions(optionItem.value, "delete", isObjectOption.value);
|
|
8608
8830
|
});
|
|
8609
8831
|
return {
|
|
8610
8832
|
currentName,
|
|
@@ -8636,188 +8858,38 @@ var Option = defineComponent({
|
|
|
8636
8858
|
};
|
|
8637
8859
|
}
|
|
8638
8860
|
});
|
|
8639
|
-
const
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
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
|
-
});
|
|
8861
|
+
const AlertCloseIcon = () => createVNode("svg", {
|
|
8862
|
+
"width": "10px",
|
|
8863
|
+
"height": "10px",
|
|
8864
|
+
"viewBox": "0 0 10 10",
|
|
8865
|
+
"version": "1.1",
|
|
8866
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
8867
|
+
}, [createVNode("g", {
|
|
8868
|
+
"stroke": "none",
|
|
8869
|
+
"stroke-width": "1",
|
|
8870
|
+
"fill": "none",
|
|
8871
|
+
"fill-rule": "evenodd"
|
|
8872
|
+
}, [createVNode("g", {
|
|
8873
|
+
"transform": "translate(-3.000000, -3.000000)",
|
|
8874
|
+
"fill-rule": "nonzero"
|
|
8875
|
+
}, [createVNode("path", {
|
|
8876
|
+
"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"
|
|
8877
|
+
}, null)])])]);
|
|
8878
|
+
const SelectArrowIcon = () => createVNode("svg", {
|
|
8879
|
+
"width": "1em",
|
|
8880
|
+
"height": "1em",
|
|
8881
|
+
"viewBox": "0 0 16 16",
|
|
8882
|
+
"version": "1.1",
|
|
8883
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
8884
|
+
}, [createVNode("g", {
|
|
8885
|
+
"stroke": "none",
|
|
8886
|
+
"stroke-width": "1",
|
|
8887
|
+
"fill": "none",
|
|
8888
|
+
"fill-rule": "evenodd"
|
|
8889
|
+
}, [createVNode("path", {
|
|
8890
|
+
"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",
|
|
8891
|
+
"fill-rule": "nonzero"
|
|
8892
|
+
}, null)])]);
|
|
8821
8893
|
const tagProps = {
|
|
8822
8894
|
type: {
|
|
8823
8895
|
type: String,
|
|
@@ -8945,6 +9017,8 @@ 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
|
|
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,
|
|
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(
|
|
9128
|
-
"name": "close"
|
|
9129
|
-
}, null)]), createVNode("span", {
|
|
9209
|
+
}, [createVNode(AlertCloseIcon, null, null)]), createVNode("span", {
|
|
9130
9210
|
"class": arrowCls.value
|
|
9131
|
-
}, [createVNode(
|
|
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,47 +9314,83 @@ 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
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
"
|
|
9246
|
-
"
|
|
9247
|
-
}
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
"
|
|
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
|
-
},
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
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
|
+
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
|
const timeSelectProps = {
|
|
9272
9395
|
modelValue: {
|
|
9273
9396
|
type: String,
|
|
@@ -9299,7 +9422,7 @@ const timeSelectProps = {
|
|
|
9299
9422
|
},
|
|
9300
9423
|
placeholder: {
|
|
9301
9424
|
type: String,
|
|
9302
|
-
default: "
|
|
9425
|
+
default: ""
|
|
9303
9426
|
},
|
|
9304
9427
|
size: {
|
|
9305
9428
|
type: String,
|
|
@@ -9423,6 +9546,8 @@ var TimeSelect = defineComponent({
|
|
|
9423
9546
|
props: timeSelectProps,
|
|
9424
9547
|
emits: ["change", "blur", "focus", "update:modelValue"],
|
|
9425
9548
|
setup(props, ctx) {
|
|
9549
|
+
const app = getCurrentInstance();
|
|
9550
|
+
const t = createI18nTranslate("DTimeSelect", app);
|
|
9426
9551
|
const {
|
|
9427
9552
|
options,
|
|
9428
9553
|
changeData,
|
|
@@ -9437,7 +9562,7 @@ var TimeSelect = defineComponent({
|
|
|
9437
9562
|
"modelValue": props.modelValue,
|
|
9438
9563
|
"options": options.value,
|
|
9439
9564
|
"onValueChange": changeData,
|
|
9440
|
-
"placeholder": props.placeholder,
|
|
9565
|
+
"placeholder": props.placeholder || t("placeholder"),
|
|
9441
9566
|
"option-disabled-key": "disabled",
|
|
9442
9567
|
"disabled": props.disabled,
|
|
9443
9568
|
"allow-clear": props.clearable,
|