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.
@@ -6202,23 +6202,6 @@ function InputClearIcon() {
6202
6202
  "fill-rule": "nonzero"
6203
6203
  }, null)])]);
6204
6204
  }
6205
- function deepAssign(...objects) {
6206
- const isObject = (obj) => obj && typeof obj === "object";
6207
- return objects.reduce((prev, from) => {
6208
- Object.keys(from).forEach((key) => {
6209
- const pVal = prev[key];
6210
- const oVal = from[key];
6211
- if (Array.isArray(pVal) && Array.isArray(oVal)) {
6212
- prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
6213
- } else if (isObject(pVal) && isObject(oVal)) {
6214
- prev[key] = deepAssign(pVal, oVal);
6215
- } else {
6216
- prev[key] = oVal;
6217
- }
6218
- });
6219
- return prev;
6220
- }, {});
6221
- }
6222
6205
  var zhCN = {
6223
6206
  pagination: {
6224
6207
  totalItemText: "\u6240\u6709\u6761\u76EE",
@@ -6337,23 +6320,146 @@ var zhCN = {
6337
6320
  placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
6338
6321
  }
6339
6322
  };
6323
+ var enUS = {
6324
+ pagination: {
6325
+ totalItemText: "Total",
6326
+ goToText: "Go to"
6327
+ },
6328
+ accordion: {
6329
+ loading: "loading",
6330
+ noData: "No Data"
6331
+ },
6332
+ autoCompleteDropdown: {
6333
+ latestInput: "Latest input"
6334
+ },
6335
+ cascaderList: {
6336
+ noData: "No data"
6337
+ },
6338
+ colorPicker: {
6339
+ foundationPanel: "Foundation panel",
6340
+ advancedPanel: "Advanced panel"
6341
+ },
6342
+ datePickerPro: {
6343
+ ok: "OK",
6344
+ placeholder: "select date",
6345
+ month1: "Jan",
6346
+ month2: "Feb",
6347
+ month3: "Mar",
6348
+ month4: "Apr",
6349
+ month5: "May",
6350
+ month6: "June",
6351
+ month7: "July",
6352
+ month8: "Aug",
6353
+ month9: "Sep",
6354
+ month10: "Oct",
6355
+ month11: "Nov",
6356
+ month12: "Dec",
6357
+ year: "\u5E74",
6358
+ startPlaceholder: "select start date",
6359
+ endPlaceholder: "select end date",
6360
+ getWeekDays() {
6361
+ return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
6362
+ },
6363
+ getTimeArr() {
6364
+ return ["Hr", "Min", "Sec"];
6365
+ },
6366
+ getYearMonthStr(year, month) {
6367
+ return `${year} - ${month}`;
6368
+ }
6369
+ },
6370
+ editableSelect: {
6371
+ noRelatedRecords: "No related records found",
6372
+ noData: "No data"
6373
+ },
6374
+ input: {
6375
+ placeholder: "Please enter"
6376
+ },
6377
+ splitterBar: {
6378
+ collapse: "Collapse",
6379
+ expand: "Expand"
6380
+ },
6381
+ stepsGuide: {
6382
+ previous: "Previous",
6383
+ continue: "Continue",
6384
+ ok: "OK"
6385
+ },
6386
+ table: {
6387
+ selectAll: "Select all",
6388
+ ok: "OK"
6389
+ },
6390
+ dataGrid: {
6391
+ selectAll: "Select all",
6392
+ ok: "OK"
6393
+ },
6394
+ timePopup: {
6395
+ ok: "OK"
6396
+ },
6397
+ transfer: {
6398
+ unit: "",
6399
+ panelUnit: "",
6400
+ headerUnit: "",
6401
+ noData: "No Data",
6402
+ placeholder: "Please enter keywords"
6403
+ },
6404
+ tree: {
6405
+ loading: "Loading",
6406
+ newNode: "New node",
6407
+ selectPlaceholder: "Please select"
6408
+ },
6409
+ upload: {
6410
+ placeholder: "select file",
6411
+ getExistSameNameFilesMsg(sameNames) {
6412
+ return `Duplicate files exist : "${sameNames}" `;
6413
+ },
6414
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
6415
+ return `Maximum file size (MB): ${maximalSize}. The selected files exceed the maximum value`;
6416
+ },
6417
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
6418
+ return `Maximum file size (MB): ${maximalSize}. Files whose size exceeds the maximum value: ${filename}`;
6419
+ },
6420
+ getNotAllowedFileTypeMsg(filename, scope) {
6421
+ return `Files with unsupported types: ${filename}. Supported file types: ${scope}`;
6422
+ }
6423
+ },
6424
+ search: {
6425
+ placeholder: "Enter a keyword"
6426
+ },
6427
+ select: {
6428
+ placeholder: "Please select",
6429
+ noDataText: "No data",
6430
+ noMatchText: "No related records found",
6431
+ loadingText: "Loading..."
6432
+ },
6433
+ tagInput: {
6434
+ maxTagsText: "Maximum number reached: "
6435
+ },
6436
+ timeSelect: {
6437
+ placeholder: "Please select time"
6438
+ }
6439
+ };
6340
6440
  const lang = ref("zh-CN");
6441
+ const nowApp = ref();
6341
6442
  let langMessages = reactive({
6342
- [lang.value]: zhCN
6443
+ ["zh-CN"]: zhCN,
6444
+ ["en-US"]: enUS
6343
6445
  });
6344
6446
  const Locale = {
6345
- messages() {
6346
- return langMessages[lang.value];
6447
+ messages(language = lang.value) {
6448
+ return langMessages[language];
6347
6449
  },
6348
6450
  lang() {
6349
6451
  return lang.value;
6350
6452
  },
6351
- use(newLang, newMessages) {
6453
+ use(newLang) {
6454
+ const app = nowApp.value;
6352
6455
  lang.value = newLang;
6353
- this.add({ [newLang]: newMessages });
6456
+ app.config.globalProperties.langMessages = Locale.messages();
6354
6457
  },
6355
- add(newMessages = {}) {
6356
- langMessages = deepAssign(langMessages, newMessages);
6458
+ add(newMessages) {
6459
+ langMessages = {
6460
+ ...langMessages,
6461
+ ...newMessages
6462
+ };
6357
6463
  }
6358
6464
  };
6359
6465
  const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
@@ -6369,8 +6475,7 @@ function get(object, path) {
6369
6475
  function createI18nTranslate(name, app, newPrefix) {
6370
6476
  const prefix = newPrefix || camelize(name) + ".";
6371
6477
  return (path) => {
6372
- var _a;
6373
- const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
6478
+ const messages = (app == null ? void 0 : app.appContext.config.globalProperties.langMessages) || Locale.messages();
6374
6479
  const message = get(messages, prefix + path) || get(messages, path);
6375
6480
  return message;
6376
6481
  };