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.
@@ -6772,23 +6772,6 @@ const timePopupProps = {
6772
6772
  default: "00:00:00"
6773
6773
  }
6774
6774
  };
6775
- function deepAssign(...objects) {
6776
- const isObject2 = (obj) => obj && typeof obj === "object";
6777
- return objects.reduce((prev, from) => {
6778
- Object.keys(from).forEach((key) => {
6779
- const pVal = prev[key];
6780
- const oVal = from[key];
6781
- if (Array.isArray(pVal) && Array.isArray(oVal)) {
6782
- prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
6783
- } else if (isObject2(pVal) && isObject2(oVal)) {
6784
- prev[key] = deepAssign(pVal, oVal);
6785
- } else {
6786
- prev[key] = oVal;
6787
- }
6788
- });
6789
- return prev;
6790
- }, {});
6791
- }
6792
6775
  var zhCN = {
6793
6776
  pagination: {
6794
6777
  totalItemText: "\u6240\u6709\u6761\u76EE",
@@ -6907,23 +6890,146 @@ var zhCN = {
6907
6890
  placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
6908
6891
  }
6909
6892
  };
6893
+ var enUS = {
6894
+ pagination: {
6895
+ totalItemText: "Total",
6896
+ goToText: "Go to"
6897
+ },
6898
+ accordion: {
6899
+ loading: "loading",
6900
+ noData: "No Data"
6901
+ },
6902
+ autoCompleteDropdown: {
6903
+ latestInput: "Latest input"
6904
+ },
6905
+ cascaderList: {
6906
+ noData: "No data"
6907
+ },
6908
+ colorPicker: {
6909
+ foundationPanel: "Foundation panel",
6910
+ advancedPanel: "Advanced panel"
6911
+ },
6912
+ datePickerPro: {
6913
+ ok: "OK",
6914
+ placeholder: "select date",
6915
+ month1: "Jan",
6916
+ month2: "Feb",
6917
+ month3: "Mar",
6918
+ month4: "Apr",
6919
+ month5: "May",
6920
+ month6: "June",
6921
+ month7: "July",
6922
+ month8: "Aug",
6923
+ month9: "Sep",
6924
+ month10: "Oct",
6925
+ month11: "Nov",
6926
+ month12: "Dec",
6927
+ year: "\u5E74",
6928
+ startPlaceholder: "select start date",
6929
+ endPlaceholder: "select end date",
6930
+ getWeekDays() {
6931
+ return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
6932
+ },
6933
+ getTimeArr() {
6934
+ return ["Hr", "Min", "Sec"];
6935
+ },
6936
+ getYearMonthStr(year, month) {
6937
+ return `${year} - ${month}`;
6938
+ }
6939
+ },
6940
+ editableSelect: {
6941
+ noRelatedRecords: "No related records found",
6942
+ noData: "No data"
6943
+ },
6944
+ input: {
6945
+ placeholder: "Please enter"
6946
+ },
6947
+ splitterBar: {
6948
+ collapse: "Collapse",
6949
+ expand: "Expand"
6950
+ },
6951
+ stepsGuide: {
6952
+ previous: "Previous",
6953
+ continue: "Continue",
6954
+ ok: "OK"
6955
+ },
6956
+ table: {
6957
+ selectAll: "Select all",
6958
+ ok: "OK"
6959
+ },
6960
+ dataGrid: {
6961
+ selectAll: "Select all",
6962
+ ok: "OK"
6963
+ },
6964
+ timePopup: {
6965
+ ok: "OK"
6966
+ },
6967
+ transfer: {
6968
+ unit: "",
6969
+ panelUnit: "",
6970
+ headerUnit: "",
6971
+ noData: "No Data",
6972
+ placeholder: "Please enter keywords"
6973
+ },
6974
+ tree: {
6975
+ loading: "Loading",
6976
+ newNode: "New node",
6977
+ selectPlaceholder: "Please select"
6978
+ },
6979
+ upload: {
6980
+ placeholder: "select file",
6981
+ getExistSameNameFilesMsg(sameNames) {
6982
+ return `Duplicate files exist : "${sameNames}" `;
6983
+ },
6984
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
6985
+ return `Maximum file size (MB): ${maximalSize}. The selected files exceed the maximum value`;
6986
+ },
6987
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
6988
+ return `Maximum file size (MB): ${maximalSize}. Files whose size exceeds the maximum value: ${filename}`;
6989
+ },
6990
+ getNotAllowedFileTypeMsg(filename, scope) {
6991
+ return `Files with unsupported types: ${filename}. Supported file types: ${scope}`;
6992
+ }
6993
+ },
6994
+ search: {
6995
+ placeholder: "Enter a keyword"
6996
+ },
6997
+ select: {
6998
+ placeholder: "Please select",
6999
+ noDataText: "No data",
7000
+ noMatchText: "No related records found",
7001
+ loadingText: "Loading..."
7002
+ },
7003
+ tagInput: {
7004
+ maxTagsText: "Maximum number reached: "
7005
+ },
7006
+ timeSelect: {
7007
+ placeholder: "Please select time"
7008
+ }
7009
+ };
6910
7010
  const lang = ref("zh-CN");
7011
+ const nowApp = ref();
6911
7012
  let langMessages = reactive({
6912
- [lang.value]: zhCN
7013
+ ["zh-CN"]: zhCN,
7014
+ ["en-US"]: enUS
6913
7015
  });
6914
7016
  const Locale = {
6915
- messages() {
6916
- return langMessages[lang.value];
7017
+ messages(language = lang.value) {
7018
+ return langMessages[language];
6917
7019
  },
6918
7020
  lang() {
6919
7021
  return lang.value;
6920
7022
  },
6921
- use(newLang, newMessages2) {
7023
+ use(newLang) {
7024
+ const app = nowApp.value;
6922
7025
  lang.value = newLang;
6923
- this.add({ [newLang]: newMessages2 });
7026
+ app.config.globalProperties.langMessages = Locale.messages();
6924
7027
  },
6925
- add(newMessages2 = {}) {
6926
- langMessages = deepAssign(langMessages, newMessages2);
7028
+ add(newMessages2) {
7029
+ langMessages = {
7030
+ ...langMessages,
7031
+ ...newMessages2
7032
+ };
6927
7033
  }
6928
7034
  };
6929
7035
  const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
@@ -6939,8 +7045,7 @@ function get(object4, path) {
6939
7045
  function createI18nTranslate(name, app, newPrefix) {
6940
7046
  const prefix = newPrefix || camelize(name) + ".";
6941
7047
  return (path) => {
6942
- var _a;
6943
- const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
7048
+ const messages2 = (app == null ? void 0 : app.appContext.config.globalProperties.langMessages) || Locale.messages();
6944
7049
  const message = get(messages2, prefix + path) || get(messages2, path);
6945
7050
  return message;
6946
7051
  };