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.
@@ -8546,23 +8546,6 @@ const LoadingDirective = {
8546
8546
  toggleLoading(el, binding);
8547
8547
  }
8548
8548
  };
8549
- function deepAssign(...objects) {
8550
- const isObject2 = (obj) => obj && typeof obj === "object";
8551
- return objects.reduce((prev, from) => {
8552
- Object.keys(from).forEach((key) => {
8553
- const pVal = prev[key];
8554
- const oVal = from[key];
8555
- if (Array.isArray(pVal) && Array.isArray(oVal)) {
8556
- prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
8557
- } else if (isObject2(pVal) && isObject2(oVal)) {
8558
- prev[key] = deepAssign(pVal, oVal);
8559
- } else {
8560
- prev[key] = oVal;
8561
- }
8562
- });
8563
- return prev;
8564
- }, {});
8565
- }
8566
8549
  var zhCN = {
8567
8550
  pagination: {
8568
8551
  totalItemText: "\u6240\u6709\u6761\u76EE",
@@ -8681,23 +8664,146 @@ var zhCN = {
8681
8664
  placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
8682
8665
  }
8683
8666
  };
8667
+ var enUS = {
8668
+ pagination: {
8669
+ totalItemText: "Total",
8670
+ goToText: "Go to"
8671
+ },
8672
+ accordion: {
8673
+ loading: "loading",
8674
+ noData: "No Data"
8675
+ },
8676
+ autoCompleteDropdown: {
8677
+ latestInput: "Latest input"
8678
+ },
8679
+ cascaderList: {
8680
+ noData: "No data"
8681
+ },
8682
+ colorPicker: {
8683
+ foundationPanel: "Foundation panel",
8684
+ advancedPanel: "Advanced panel"
8685
+ },
8686
+ datePickerPro: {
8687
+ ok: "OK",
8688
+ placeholder: "select date",
8689
+ month1: "Jan",
8690
+ month2: "Feb",
8691
+ month3: "Mar",
8692
+ month4: "Apr",
8693
+ month5: "May",
8694
+ month6: "June",
8695
+ month7: "July",
8696
+ month8: "Aug",
8697
+ month9: "Sep",
8698
+ month10: "Oct",
8699
+ month11: "Nov",
8700
+ month12: "Dec",
8701
+ year: "\u5E74",
8702
+ startPlaceholder: "select start date",
8703
+ endPlaceholder: "select end date",
8704
+ getWeekDays() {
8705
+ return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
8706
+ },
8707
+ getTimeArr() {
8708
+ return ["Hr", "Min", "Sec"];
8709
+ },
8710
+ getYearMonthStr(year, month) {
8711
+ return `${year} - ${month}`;
8712
+ }
8713
+ },
8714
+ editableSelect: {
8715
+ noRelatedRecords: "No related records found",
8716
+ noData: "No data"
8717
+ },
8718
+ input: {
8719
+ placeholder: "Please enter"
8720
+ },
8721
+ splitterBar: {
8722
+ collapse: "Collapse",
8723
+ expand: "Expand"
8724
+ },
8725
+ stepsGuide: {
8726
+ previous: "Previous",
8727
+ continue: "Continue",
8728
+ ok: "OK"
8729
+ },
8730
+ table: {
8731
+ selectAll: "Select all",
8732
+ ok: "OK"
8733
+ },
8734
+ dataGrid: {
8735
+ selectAll: "Select all",
8736
+ ok: "OK"
8737
+ },
8738
+ timePopup: {
8739
+ ok: "OK"
8740
+ },
8741
+ transfer: {
8742
+ unit: "",
8743
+ panelUnit: "",
8744
+ headerUnit: "",
8745
+ noData: "No Data",
8746
+ placeholder: "Please enter keywords"
8747
+ },
8748
+ tree: {
8749
+ loading: "Loading",
8750
+ newNode: "New node",
8751
+ selectPlaceholder: "Please select"
8752
+ },
8753
+ upload: {
8754
+ placeholder: "select file",
8755
+ getExistSameNameFilesMsg(sameNames) {
8756
+ return `Duplicate files exist : "${sameNames}" `;
8757
+ },
8758
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
8759
+ return `Maximum file size (MB): ${maximalSize}. The selected files exceed the maximum value`;
8760
+ },
8761
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
8762
+ return `Maximum file size (MB): ${maximalSize}. Files whose size exceeds the maximum value: ${filename}`;
8763
+ },
8764
+ getNotAllowedFileTypeMsg(filename, scope) {
8765
+ return `Files with unsupported types: ${filename}. Supported file types: ${scope}`;
8766
+ }
8767
+ },
8768
+ search: {
8769
+ placeholder: "Enter a keyword"
8770
+ },
8771
+ select: {
8772
+ placeholder: "Please select",
8773
+ noDataText: "No data",
8774
+ noMatchText: "No related records found",
8775
+ loadingText: "Loading..."
8776
+ },
8777
+ tagInput: {
8778
+ maxTagsText: "Maximum number reached: "
8779
+ },
8780
+ timeSelect: {
8781
+ placeholder: "Please select time"
8782
+ }
8783
+ };
8684
8784
  const lang = ref("zh-CN");
8785
+ const nowApp = ref();
8685
8786
  let langMessages = reactive({
8686
- [lang.value]: zhCN
8787
+ ["zh-CN"]: zhCN,
8788
+ ["en-US"]: enUS
8687
8789
  });
8688
8790
  const Locale = {
8689
- messages() {
8690
- return langMessages[lang.value];
8791
+ messages(language = lang.value) {
8792
+ return langMessages[language];
8691
8793
  },
8692
8794
  lang() {
8693
8795
  return lang.value;
8694
8796
  },
8695
- use(newLang, newMessages2) {
8797
+ use(newLang) {
8798
+ const app = nowApp.value;
8696
8799
  lang.value = newLang;
8697
- this.add({ [newLang]: newMessages2 });
8800
+ app.config.globalProperties.langMessages = Locale.messages();
8698
8801
  },
8699
- add(newMessages2 = {}) {
8700
- langMessages = deepAssign(langMessages, newMessages2);
8802
+ add(newMessages2) {
8803
+ langMessages = {
8804
+ ...langMessages,
8805
+ ...newMessages2
8806
+ };
8701
8807
  }
8702
8808
  };
8703
8809
  const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
@@ -8713,8 +8819,7 @@ function get(object4, path) {
8713
8819
  function createI18nTranslate(name, app, newPrefix) {
8714
8820
  const prefix = newPrefix || camelize(name) + ".";
8715
8821
  return (path) => {
8716
- var _a;
8717
- const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
8822
+ const messages2 = (app == null ? void 0 : app.appContext.config.globalProperties.langMessages) || Locale.messages();
8718
8823
  const message = get(messages2, prefix + path) || get(messages2, path);
8719
8824
  return message;
8720
8825
  };