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.
package/tree/index.es.js CHANGED
@@ -7484,23 +7484,6 @@ var DTreeNodeToggle = defineComponent({
7484
7484
  };
7485
7485
  }
7486
7486
  });
7487
- function deepAssign(...objects) {
7488
- const isObject2 = (obj) => obj && typeof obj === "object";
7489
- return objects.reduce((prev, from) => {
7490
- Object.keys(from).forEach((key) => {
7491
- const pVal = prev[key];
7492
- const oVal = from[key];
7493
- if (Array.isArray(pVal) && Array.isArray(oVal)) {
7494
- prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
7495
- } else if (isObject2(pVal) && isObject2(oVal)) {
7496
- prev[key] = deepAssign(pVal, oVal);
7497
- } else {
7498
- prev[key] = oVal;
7499
- }
7500
- });
7501
- return prev;
7502
- }, {});
7503
- }
7504
7487
  var zhCN = {
7505
7488
  pagination: {
7506
7489
  totalItemText: "\u6240\u6709\u6761\u76EE",
@@ -7619,23 +7602,146 @@ var zhCN = {
7619
7602
  placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
7620
7603
  }
7621
7604
  };
7605
+ var enUS = {
7606
+ pagination: {
7607
+ totalItemText: "Total",
7608
+ goToText: "Go to"
7609
+ },
7610
+ accordion: {
7611
+ loading: "loading",
7612
+ noData: "No Data"
7613
+ },
7614
+ autoCompleteDropdown: {
7615
+ latestInput: "Latest input"
7616
+ },
7617
+ cascaderList: {
7618
+ noData: "No data"
7619
+ },
7620
+ colorPicker: {
7621
+ foundationPanel: "Foundation panel",
7622
+ advancedPanel: "Advanced panel"
7623
+ },
7624
+ datePickerPro: {
7625
+ ok: "OK",
7626
+ placeholder: "select date",
7627
+ month1: "Jan",
7628
+ month2: "Feb",
7629
+ month3: "Mar",
7630
+ month4: "Apr",
7631
+ month5: "May",
7632
+ month6: "June",
7633
+ month7: "July",
7634
+ month8: "Aug",
7635
+ month9: "Sep",
7636
+ month10: "Oct",
7637
+ month11: "Nov",
7638
+ month12: "Dec",
7639
+ year: "\u5E74",
7640
+ startPlaceholder: "select start date",
7641
+ endPlaceholder: "select end date",
7642
+ getWeekDays() {
7643
+ return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
7644
+ },
7645
+ getTimeArr() {
7646
+ return ["Hr", "Min", "Sec"];
7647
+ },
7648
+ getYearMonthStr(year, month) {
7649
+ return `${year} - ${month}`;
7650
+ }
7651
+ },
7652
+ editableSelect: {
7653
+ noRelatedRecords: "No related records found",
7654
+ noData: "No data"
7655
+ },
7656
+ input: {
7657
+ placeholder: "Please enter"
7658
+ },
7659
+ splitterBar: {
7660
+ collapse: "Collapse",
7661
+ expand: "Expand"
7662
+ },
7663
+ stepsGuide: {
7664
+ previous: "Previous",
7665
+ continue: "Continue",
7666
+ ok: "OK"
7667
+ },
7668
+ table: {
7669
+ selectAll: "Select all",
7670
+ ok: "OK"
7671
+ },
7672
+ dataGrid: {
7673
+ selectAll: "Select all",
7674
+ ok: "OK"
7675
+ },
7676
+ timePopup: {
7677
+ ok: "OK"
7678
+ },
7679
+ transfer: {
7680
+ unit: "",
7681
+ panelUnit: "",
7682
+ headerUnit: "",
7683
+ noData: "No Data",
7684
+ placeholder: "Please enter keywords"
7685
+ },
7686
+ tree: {
7687
+ loading: "Loading",
7688
+ newNode: "New node",
7689
+ selectPlaceholder: "Please select"
7690
+ },
7691
+ upload: {
7692
+ placeholder: "select file",
7693
+ getExistSameNameFilesMsg(sameNames) {
7694
+ return `Duplicate files exist : "${sameNames}" `;
7695
+ },
7696
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
7697
+ return `Maximum file size (MB): ${maximalSize}. The selected files exceed the maximum value`;
7698
+ },
7699
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
7700
+ return `Maximum file size (MB): ${maximalSize}. Files whose size exceeds the maximum value: ${filename}`;
7701
+ },
7702
+ getNotAllowedFileTypeMsg(filename, scope) {
7703
+ return `Files with unsupported types: ${filename}. Supported file types: ${scope}`;
7704
+ }
7705
+ },
7706
+ search: {
7707
+ placeholder: "Enter a keyword"
7708
+ },
7709
+ select: {
7710
+ placeholder: "Please select",
7711
+ noDataText: "No data",
7712
+ noMatchText: "No related records found",
7713
+ loadingText: "Loading..."
7714
+ },
7715
+ tagInput: {
7716
+ maxTagsText: "Maximum number reached: "
7717
+ },
7718
+ timeSelect: {
7719
+ placeholder: "Please select time"
7720
+ }
7721
+ };
7622
7722
  const lang = ref("zh-CN");
7723
+ const nowApp = ref();
7623
7724
  let langMessages = reactive({
7624
- [lang.value]: zhCN
7725
+ ["zh-CN"]: zhCN,
7726
+ ["en-US"]: enUS
7625
7727
  });
7626
7728
  const Locale = {
7627
- messages() {
7628
- return langMessages[lang.value];
7729
+ messages(language = lang.value) {
7730
+ return langMessages[language];
7629
7731
  },
7630
7732
  lang() {
7631
7733
  return lang.value;
7632
7734
  },
7633
- use(newLang, newMessages2) {
7735
+ use(newLang) {
7736
+ const app = nowApp.value;
7634
7737
  lang.value = newLang;
7635
- this.add({ [newLang]: newMessages2 });
7738
+ app.config.globalProperties.langMessages = Locale.messages();
7636
7739
  },
7637
- add(newMessages2 = {}) {
7638
- langMessages = deepAssign(langMessages, newMessages2);
7740
+ add(newMessages2) {
7741
+ langMessages = {
7742
+ ...langMessages,
7743
+ ...newMessages2
7744
+ };
7639
7745
  }
7640
7746
  };
7641
7747
  const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
@@ -7651,8 +7757,7 @@ function get(object4, path) {
7651
7757
  function createI18nTranslate(name, app, newPrefix) {
7652
7758
  const prefix = newPrefix || camelize(name) + ".";
7653
7759
  return (path) => {
7654
- var _a;
7655
- const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
7760
+ const messages2 = (app == null ? void 0 : app.appContext.config.globalProperties.langMessages) || Locale.messages();
7656
7761
  const message = get(messages2, prefix + path) || get(messages2, path);
7657
7762
  return message;
7658
7763
  };