vue-devui 1.6.32 → 1.6.34
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/auto-complete/index.es.js +131 -26
- package/auto-complete/index.umd.js +12 -12
- package/data-grid/index.es.js +131 -26
- package/data-grid/index.umd.js +18 -18
- package/date-picker-pro/index.es.js +131 -26
- package/date-picker-pro/index.umd.js +16 -16
- package/editable-select/index.es.js +131 -26
- package/editable-select/index.umd.js +16 -16
- package/editor-md/index.es.js +6 -2
- package/editor-md/index.umd.js +16 -15
- package/input/index.es.js +136 -31
- package/input/index.umd.js +22 -22
- package/locale/index.es.js +271 -0
- package/locale/index.umd.js +1 -0
- package/locale/package.json +8 -0
- package/nuxt/components/Locale.js +2 -0
- package/package.json +1 -1
- package/pagination/index.es.js +131 -26
- package/pagination/index.umd.js +11 -11
- package/search/index.es.js +136 -31
- package/search/index.umd.js +12 -12
- package/select/index.es.js +131 -26
- package/select/index.umd.js +21 -21
- package/splitter/index.es.js +136 -31
- package/splitter/index.umd.js +14 -14
- package/table/index.es.js +131 -26
- package/table/index.umd.js +10 -10
- package/time-picker/index.es.js +131 -26
- package/time-picker/index.umd.js +15 -15
- package/time-select/index.es.js +131 -26
- package/time-select/index.umd.js +18 -18
- package/tree/index.es.js +131 -26
- package/tree/index.umd.js +26 -26
- package/types/locale/index.d.ts +7 -4
- package/upload/index.es.js +131 -26
- package/upload/index.umd.js +3 -3
- package/vue-devui.es.js +138 -29
- package/vue-devui.umd.js +68 -67
package/time-select/index.es.js
CHANGED
|
@@ -2,23 +2,6 @@ import { ref, reactive, defineComponent, watch, provide, toRefs, createVNode, on
|
|
|
2
2
|
import { onClickOutside } from "@vueuse/core";
|
|
3
3
|
import "clipboard";
|
|
4
4
|
import { offset, flip, arrow, computePosition } from "@floating-ui/dom";
|
|
5
|
-
function deepAssign(...objects) {
|
|
6
|
-
const isObject2 = (obj) => obj && typeof obj === "object";
|
|
7
|
-
return objects.reduce((prev, from) => {
|
|
8
|
-
Object.keys(from).forEach((key) => {
|
|
9
|
-
const pVal = prev[key];
|
|
10
|
-
const oVal = from[key];
|
|
11
|
-
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
12
|
-
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
13
|
-
} else if (isObject2(pVal) && isObject2(oVal)) {
|
|
14
|
-
prev[key] = deepAssign(pVal, oVal);
|
|
15
|
-
} else {
|
|
16
|
-
prev[key] = oVal;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return prev;
|
|
20
|
-
}, {});
|
|
21
|
-
}
|
|
22
5
|
var zhCN = {
|
|
23
6
|
pagination: {
|
|
24
7
|
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
@@ -137,23 +120,146 @@ var zhCN = {
|
|
|
137
120
|
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
138
121
|
}
|
|
139
122
|
};
|
|
123
|
+
var enUS = {
|
|
124
|
+
pagination: {
|
|
125
|
+
totalItemText: "Total",
|
|
126
|
+
goToText: "Go to"
|
|
127
|
+
},
|
|
128
|
+
accordion: {
|
|
129
|
+
loading: "loading",
|
|
130
|
+
noData: "No Data"
|
|
131
|
+
},
|
|
132
|
+
autoCompleteDropdown: {
|
|
133
|
+
latestInput: "Latest input"
|
|
134
|
+
},
|
|
135
|
+
cascaderList: {
|
|
136
|
+
noData: "No data"
|
|
137
|
+
},
|
|
138
|
+
colorPicker: {
|
|
139
|
+
foundationPanel: "Foundation panel",
|
|
140
|
+
advancedPanel: "Advanced panel"
|
|
141
|
+
},
|
|
142
|
+
datePickerPro: {
|
|
143
|
+
ok: "OK",
|
|
144
|
+
placeholder: "select date",
|
|
145
|
+
month1: "Jan",
|
|
146
|
+
month2: "Feb",
|
|
147
|
+
month3: "Mar",
|
|
148
|
+
month4: "Apr",
|
|
149
|
+
month5: "May",
|
|
150
|
+
month6: "June",
|
|
151
|
+
month7: "July",
|
|
152
|
+
month8: "Aug",
|
|
153
|
+
month9: "Sep",
|
|
154
|
+
month10: "Oct",
|
|
155
|
+
month11: "Nov",
|
|
156
|
+
month12: "Dec",
|
|
157
|
+
year: "\u5E74",
|
|
158
|
+
startPlaceholder: "select start date",
|
|
159
|
+
endPlaceholder: "select end date",
|
|
160
|
+
getWeekDays() {
|
|
161
|
+
return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
|
|
162
|
+
},
|
|
163
|
+
getTimeArr() {
|
|
164
|
+
return ["Hr", "Min", "Sec"];
|
|
165
|
+
},
|
|
166
|
+
getYearMonthStr(year, month) {
|
|
167
|
+
return `${year} - ${month}`;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
editableSelect: {
|
|
171
|
+
noRelatedRecords: "No related records found",
|
|
172
|
+
noData: "No data"
|
|
173
|
+
},
|
|
174
|
+
input: {
|
|
175
|
+
placeholder: "Please enter"
|
|
176
|
+
},
|
|
177
|
+
splitterBar: {
|
|
178
|
+
collapse: "Collapse",
|
|
179
|
+
expand: "Expand"
|
|
180
|
+
},
|
|
181
|
+
stepsGuide: {
|
|
182
|
+
previous: "Previous",
|
|
183
|
+
continue: "Continue",
|
|
184
|
+
ok: "OK"
|
|
185
|
+
},
|
|
186
|
+
table: {
|
|
187
|
+
selectAll: "Select all",
|
|
188
|
+
ok: "OK"
|
|
189
|
+
},
|
|
190
|
+
dataGrid: {
|
|
191
|
+
selectAll: "Select all",
|
|
192
|
+
ok: "OK"
|
|
193
|
+
},
|
|
194
|
+
timePopup: {
|
|
195
|
+
ok: "OK"
|
|
196
|
+
},
|
|
197
|
+
transfer: {
|
|
198
|
+
unit: "",
|
|
199
|
+
panelUnit: "",
|
|
200
|
+
headerUnit: "",
|
|
201
|
+
noData: "No Data",
|
|
202
|
+
placeholder: "Please enter keywords"
|
|
203
|
+
},
|
|
204
|
+
tree: {
|
|
205
|
+
loading: "Loading",
|
|
206
|
+
newNode: "New node",
|
|
207
|
+
selectPlaceholder: "Please select"
|
|
208
|
+
},
|
|
209
|
+
upload: {
|
|
210
|
+
placeholder: "select file",
|
|
211
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
212
|
+
return `Duplicate files exist : "${sameNames}" `;
|
|
213
|
+
},
|
|
214
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
215
|
+
return `Maximum file size (MB): ${maximalSize}. The selected files exceed the maximum value`;
|
|
216
|
+
},
|
|
217
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
218
|
+
return `Maximum file size (MB): ${maximalSize}. Files whose size exceeds the maximum value: ${filename}`;
|
|
219
|
+
},
|
|
220
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
221
|
+
return `Files with unsupported types: ${filename}. Supported file types: ${scope}`;
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
search: {
|
|
225
|
+
placeholder: "Enter a keyword"
|
|
226
|
+
},
|
|
227
|
+
select: {
|
|
228
|
+
placeholder: "Please select",
|
|
229
|
+
noDataText: "No data",
|
|
230
|
+
noMatchText: "No related records found",
|
|
231
|
+
loadingText: "Loading..."
|
|
232
|
+
},
|
|
233
|
+
tagInput: {
|
|
234
|
+
maxTagsText: "Maximum number reached: "
|
|
235
|
+
},
|
|
236
|
+
timeSelect: {
|
|
237
|
+
placeholder: "Please select time"
|
|
238
|
+
}
|
|
239
|
+
};
|
|
140
240
|
const lang = ref("zh-CN");
|
|
241
|
+
const nowApp = ref();
|
|
141
242
|
let langMessages = reactive({
|
|
142
|
-
[
|
|
243
|
+
["zh-CN"]: zhCN,
|
|
244
|
+
["en-US"]: enUS
|
|
143
245
|
});
|
|
144
246
|
const Locale = {
|
|
145
|
-
messages() {
|
|
146
|
-
return langMessages[
|
|
247
|
+
messages(language = lang.value) {
|
|
248
|
+
return langMessages[language];
|
|
147
249
|
},
|
|
148
250
|
lang() {
|
|
149
251
|
return lang.value;
|
|
150
252
|
},
|
|
151
|
-
use(newLang
|
|
253
|
+
use(newLang) {
|
|
254
|
+
const app = nowApp.value;
|
|
152
255
|
lang.value = newLang;
|
|
153
|
-
|
|
256
|
+
app.config.globalProperties.langMessages = Locale.messages();
|
|
154
257
|
},
|
|
155
|
-
add(newMessages2
|
|
156
|
-
langMessages =
|
|
258
|
+
add(newMessages2) {
|
|
259
|
+
langMessages = {
|
|
260
|
+
...langMessages,
|
|
261
|
+
...newMessages2
|
|
262
|
+
};
|
|
157
263
|
}
|
|
158
264
|
};
|
|
159
265
|
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
@@ -169,8 +275,7 @@ function get(object4, path) {
|
|
|
169
275
|
function createI18nTranslate(name, app, newPrefix) {
|
|
170
276
|
const prefix = newPrefix || camelize(name) + ".";
|
|
171
277
|
return (path) => {
|
|
172
|
-
|
|
173
|
-
const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
278
|
+
const messages2 = (app == null ? void 0 : app.appContext.config.globalProperties.langMessages) || Locale.messages();
|
|
174
279
|
const message = get(messages2, prefix + path) || get(messages2, path);
|
|
175
280
|
return message;
|
|
176
281
|
};
|