vue-devui 1.6.33 → 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.
@@ -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
- [lang.value]: zhCN
243
+ ["zh-CN"]: zhCN,
244
+ ["en-US"]: enUS
143
245
  });
144
246
  const Locale = {
145
- messages() {
146
- return langMessages[lang.value];
247
+ messages(language = lang.value) {
248
+ return langMessages[language];
147
249
  },
148
250
  lang() {
149
251
  return lang.value;
150
252
  },
151
- use(newLang, newMessages2) {
253
+ use(newLang) {
254
+ const app = nowApp.value;
152
255
  lang.value = newLang;
153
- this.add({ [newLang]: newMessages2 });
256
+ app.config.globalProperties.langMessages = Locale.messages();
154
257
  },
155
- add(newMessages2 = {}) {
156
- langMessages = deepAssign(langMessages, newMessages2);
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
- var _a;
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
  };