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.
@@ -8747,23 +8747,6 @@ function useInputFunction(input2) {
8747
8747
  return { select, focus, blur };
8748
8748
  }
8749
8749
  var input = "";
8750
- function deepAssign(...objects) {
8751
- const isObject2 = (obj) => obj && typeof obj === "object";
8752
- return objects.reduce((prev, from) => {
8753
- Object.keys(from).forEach((key) => {
8754
- const pVal = prev[key];
8755
- const oVal = from[key];
8756
- if (Array.isArray(pVal) && Array.isArray(oVal)) {
8757
- prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
8758
- } else if (isObject2(pVal) && isObject2(oVal)) {
8759
- prev[key] = deepAssign(pVal, oVal);
8760
- } else {
8761
- prev[key] = oVal;
8762
- }
8763
- });
8764
- return prev;
8765
- }, {});
8766
- }
8767
8750
  var zhCN = {
8768
8751
  pagination: {
8769
8752
  totalItemText: "\u6240\u6709\u6761\u76EE",
@@ -8882,23 +8865,146 @@ var zhCN = {
8882
8865
  placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
8883
8866
  }
8884
8867
  };
8868
+ var enUS = {
8869
+ pagination: {
8870
+ totalItemText: "Total",
8871
+ goToText: "Go to"
8872
+ },
8873
+ accordion: {
8874
+ loading: "loading",
8875
+ noData: "No Data"
8876
+ },
8877
+ autoCompleteDropdown: {
8878
+ latestInput: "Latest input"
8879
+ },
8880
+ cascaderList: {
8881
+ noData: "No data"
8882
+ },
8883
+ colorPicker: {
8884
+ foundationPanel: "Foundation panel",
8885
+ advancedPanel: "Advanced panel"
8886
+ },
8887
+ datePickerPro: {
8888
+ ok: "OK",
8889
+ placeholder: "select date",
8890
+ month1: "Jan",
8891
+ month2: "Feb",
8892
+ month3: "Mar",
8893
+ month4: "Apr",
8894
+ month5: "May",
8895
+ month6: "June",
8896
+ month7: "July",
8897
+ month8: "Aug",
8898
+ month9: "Sep",
8899
+ month10: "Oct",
8900
+ month11: "Nov",
8901
+ month12: "Dec",
8902
+ year: "\u5E74",
8903
+ startPlaceholder: "select start date",
8904
+ endPlaceholder: "select end date",
8905
+ getWeekDays() {
8906
+ return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
8907
+ },
8908
+ getTimeArr() {
8909
+ return ["Hr", "Min", "Sec"];
8910
+ },
8911
+ getYearMonthStr(year, month) {
8912
+ return `${year} - ${month}`;
8913
+ }
8914
+ },
8915
+ editableSelect: {
8916
+ noRelatedRecords: "No related records found",
8917
+ noData: "No data"
8918
+ },
8919
+ input: {
8920
+ placeholder: "Please enter"
8921
+ },
8922
+ splitterBar: {
8923
+ collapse: "Collapse",
8924
+ expand: "Expand"
8925
+ },
8926
+ stepsGuide: {
8927
+ previous: "Previous",
8928
+ continue: "Continue",
8929
+ ok: "OK"
8930
+ },
8931
+ table: {
8932
+ selectAll: "Select all",
8933
+ ok: "OK"
8934
+ },
8935
+ dataGrid: {
8936
+ selectAll: "Select all",
8937
+ ok: "OK"
8938
+ },
8939
+ timePopup: {
8940
+ ok: "OK"
8941
+ },
8942
+ transfer: {
8943
+ unit: "",
8944
+ panelUnit: "",
8945
+ headerUnit: "",
8946
+ noData: "No Data",
8947
+ placeholder: "Please enter keywords"
8948
+ },
8949
+ tree: {
8950
+ loading: "Loading",
8951
+ newNode: "New node",
8952
+ selectPlaceholder: "Please select"
8953
+ },
8954
+ upload: {
8955
+ placeholder: "select file",
8956
+ getExistSameNameFilesMsg(sameNames) {
8957
+ return `Duplicate files exist : "${sameNames}" `;
8958
+ },
8959
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
8960
+ return `Maximum file size (MB): ${maximalSize}. The selected files exceed the maximum value`;
8961
+ },
8962
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
8963
+ return `Maximum file size (MB): ${maximalSize}. Files whose size exceeds the maximum value: ${filename}`;
8964
+ },
8965
+ getNotAllowedFileTypeMsg(filename, scope) {
8966
+ return `Files with unsupported types: ${filename}. Supported file types: ${scope}`;
8967
+ }
8968
+ },
8969
+ search: {
8970
+ placeholder: "Enter a keyword"
8971
+ },
8972
+ select: {
8973
+ placeholder: "Please select",
8974
+ noDataText: "No data",
8975
+ noMatchText: "No related records found",
8976
+ loadingText: "Loading..."
8977
+ },
8978
+ tagInput: {
8979
+ maxTagsText: "Maximum number reached: "
8980
+ },
8981
+ timeSelect: {
8982
+ placeholder: "Please select time"
8983
+ }
8984
+ };
8885
8985
  const lang = ref("zh-CN");
8986
+ const nowApp = ref();
8886
8987
  let langMessages = reactive({
8887
- [lang.value]: zhCN
8988
+ ["zh-CN"]: zhCN,
8989
+ ["en-US"]: enUS
8888
8990
  });
8889
8991
  const Locale = {
8890
- messages() {
8891
- return langMessages[lang.value];
8992
+ messages(language = lang.value) {
8993
+ return langMessages[language];
8892
8994
  },
8893
8995
  lang() {
8894
8996
  return lang.value;
8895
8997
  },
8896
- use(newLang, newMessages2) {
8998
+ use(newLang) {
8999
+ const app = nowApp.value;
8897
9000
  lang.value = newLang;
8898
- this.add({ [newLang]: newMessages2 });
9001
+ app.config.globalProperties.langMessages = Locale.messages();
8899
9002
  },
8900
- add(newMessages2 = {}) {
8901
- langMessages = deepAssign(langMessages, newMessages2);
9003
+ add(newMessages2) {
9004
+ langMessages = {
9005
+ ...langMessages,
9006
+ ...newMessages2
9007
+ };
8902
9008
  }
8903
9009
  };
8904
9010
  const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
@@ -8914,8 +9020,7 @@ function get(object4, path) {
8914
9020
  function createI18nTranslate(name, app, newPrefix) {
8915
9021
  const prefix = newPrefix || camelize(name) + ".";
8916
9022
  return (path) => {
8917
- var _a;
8918
- const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
9023
+ const messages2 = (app == null ? void 0 : app.appContext.config.globalProperties.langMessages) || Locale.messages();
8919
9024
  const message = get(messages2, prefix + path) || get(messages2, path);
8920
9025
  return message;
8921
9026
  };