bmp-layout 0.0.25-beta.6 → 0.0.25-beta.8

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/bmp-layout.es.js CHANGED
@@ -933,7 +933,7 @@ const useAppStore = defineStore("layout-app", {
933
933
  // 折叠图标
934
934
  search: false,
935
935
  // 搜索图标
936
- locale: false,
936
+ locale: true,
937
937
  // 多语言图标
938
938
  setting: true,
939
939
  // 偏好设置
@@ -1214,18 +1214,29 @@ function buildChildPaths(router) {
1214
1214
  const parentPath = router.path ? router.path.startsWith("/") ? router.path : `/${router.path}` : "";
1215
1215
  return (router.children || []).map((child) => {
1216
1216
  const childPath = child.path ? parentPath.endsWith("/") ? child.path.startsWith("/") ? child.path.substring(1) : child.path : child.path.startsWith("/") ? child.path : `/${child.path}` : "";
1217
- return { ...child, path: `${parentPath}${childPath}` };
1217
+ let fullPath = `${parentPath}${childPath}`;
1218
+ if (fullPath.length > 1 && fullPath.endsWith("/")) {
1219
+ fullPath = fullPath.slice(0, -1);
1220
+ }
1221
+ return { ...child, path: fullPath };
1218
1222
  });
1219
1223
  }
1220
1224
  function prependPathToRoutes(routes, parentPath) {
1221
1225
  if (!parentPath || !routes)
1222
1226
  return routes;
1223
1227
  return routes.map((route) => {
1224
- const newPath = parentPath + (route.path.startsWith("/") ? route.path : `/${route.path}`);
1228
+ let newPath;
1229
+ if (!route.path) {
1230
+ newPath = parentPath;
1231
+ } else {
1232
+ newPath = parentPath + (route.path.startsWith("/") ? route.path : `/${route.path}`);
1233
+ }
1234
+ if (newPath.length > 1 && newPath.endsWith("/")) {
1235
+ newPath = newPath.slice(0, -1);
1236
+ }
1225
1237
  return {
1226
1238
  ...route,
1227
- path: newPath,
1228
- children: route.children ? prependPathToRoutes(route.children, newPath) : route.children
1239
+ path: newPath
1229
1240
  };
1230
1241
  });
1231
1242
  }
@@ -9818,10 +9829,189 @@ var English = {
9818
9829
  }
9819
9830
  }
9820
9831
  };
9832
+ var zhTw = {
9833
+ name: "zh-tw",
9834
+ el: {
9835
+ breadcrumb: {
9836
+ label: "面包屑"
9837
+ },
9838
+ colorpicker: {
9839
+ confirm: "確認",
9840
+ clear: "清空",
9841
+ defaultLabel: "色彩選擇器",
9842
+ description: "目前色彩為 {color}。按一下 Enter 以選擇新色彩。",
9843
+ alphaLabel: "選擇透明度的值"
9844
+ },
9845
+ datepicker: {
9846
+ now: "現在",
9847
+ today: "今天",
9848
+ cancel: "取消",
9849
+ clear: "清空",
9850
+ confirm: "確認",
9851
+ dateTablePrompt: "使用方向鍵與 Enter 鍵以選擇日期",
9852
+ monthTablePrompt: "使用方向鍵與 Enter 鍵以選擇月份",
9853
+ yearTablePrompt: "使用方向鍵與 Enter 鍵以選擇年份",
9854
+ selectedDate: "已選日期",
9855
+ selectDate: "選擇日期",
9856
+ selectTime: "選擇時間",
9857
+ startDate: "開始日期",
9858
+ startTime: "開始時間",
9859
+ endDate: "結束日期",
9860
+ endTime: "結束時間",
9861
+ prevYear: "前一年",
9862
+ nextYear: "後一年",
9863
+ prevMonth: "上個月",
9864
+ nextMonth: "下個月",
9865
+ year: "年",
9866
+ month1: "1 月",
9867
+ month2: "2 月",
9868
+ month3: "3 月",
9869
+ month4: "4 月",
9870
+ month5: "5 月",
9871
+ month6: "6 月",
9872
+ month7: "7 月",
9873
+ month8: "8 月",
9874
+ month9: "9 月",
9875
+ month10: "10 月",
9876
+ month11: "11 月",
9877
+ month12: "12 月",
9878
+ weeks: {
9879
+ sun: "日",
9880
+ mon: "一",
9881
+ tue: "二",
9882
+ wed: "三",
9883
+ thu: "四",
9884
+ fri: "五",
9885
+ sat: "六"
9886
+ },
9887
+ weeksFull: {
9888
+ sun: "星期日",
9889
+ mon: "星期一",
9890
+ tue: "星期二",
9891
+ wed: "星期三",
9892
+ thu: "星期四",
9893
+ fri: "星期五",
9894
+ sat: "星期六"
9895
+ },
9896
+ months: {
9897
+ jan: "一月",
9898
+ feb: "二月",
9899
+ mar: "三月",
9900
+ apr: "四月",
9901
+ may: "五月",
9902
+ jun: "六月",
9903
+ jul: "七月",
9904
+ aug: "八月",
9905
+ sep: "九月",
9906
+ oct: "十月",
9907
+ nov: "十一月",
9908
+ dec: "十二月"
9909
+ }
9910
+ },
9911
+ inputNumber: {
9912
+ decrease: "減少數值",
9913
+ increase: "增加數值"
9914
+ },
9915
+ select: {
9916
+ loading: "載入中",
9917
+ noMatch: "無相符資料",
9918
+ noData: "無資料",
9919
+ placeholder: "請選擇"
9920
+ },
9921
+ mention: {
9922
+ loading: "載入中"
9923
+ },
9924
+ dropdown: {
9925
+ toggleDropdown: "切換下拉選單"
9926
+ },
9927
+ cascader: {
9928
+ noMatch: "無相符資料",
9929
+ loading: "載入中",
9930
+ placeholder: "請選擇",
9931
+ noData: "無資料"
9932
+ },
9933
+ pagination: {
9934
+ goto: "前往",
9935
+ pagesize: "項/頁",
9936
+ total: "共 {total} 項",
9937
+ pageClassifier: "頁",
9938
+ page: "頁",
9939
+ prev: "上一頁",
9940
+ next: "下一頁",
9941
+ currentPage: "第 {pager} 頁",
9942
+ prevPages: "向前 {pager} 頁",
9943
+ nextPages: "向後 {pager} 頁",
9944
+ deprecationWarning: "偵測到已過時的使用方式,請參閱 el-pagination 說明文件以了解更多資訊"
9945
+ },
9946
+ dialog: {
9947
+ close: "關閉此對話框"
9948
+ },
9949
+ drawer: {
9950
+ close: "關閉此對話框"
9951
+ },
9952
+ messagebox: {
9953
+ title: "提示",
9954
+ confirm: "確定",
9955
+ cancel: "取消",
9956
+ error: "輸入的資料不符合規定!",
9957
+ close: "關閉此對話框"
9958
+ },
9959
+ upload: {
9960
+ deleteTip: "按 Delete 鍵以刪除",
9961
+ delete: "刪除",
9962
+ preview: "查看圖片",
9963
+ continue: "繼續上傳"
9964
+ },
9965
+ slider: {
9966
+ defaultLabel: "滑桿介於 {min} 至 {max}",
9967
+ defaultRangeStartLabel: "選擇起始值",
9968
+ defaultRangeEndLabel: "選擇結束值"
9969
+ },
9970
+ table: {
9971
+ emptyText: "暫無資料",
9972
+ confirmFilter: "篩選",
9973
+ resetFilter: "重置",
9974
+ clearFilter: "全部",
9975
+ sumText: "合計"
9976
+ },
9977
+ tour: {
9978
+ next: "下一步",
9979
+ previous: "上一步",
9980
+ finish: "結束導覽"
9981
+ },
9982
+ tree: {
9983
+ emptyText: "暫無資料"
9984
+ },
9985
+ transfer: {
9986
+ noMatch: "無相符資料",
9987
+ noData: "無資料",
9988
+ titles: ["列表 1", "列表 2"],
9989
+ filterPlaceholder: "請輸入搜尋內容",
9990
+ noCheckedFormat: "共 {total} 項",
9991
+ hasCheckedFormat: "已選 {checked}/{total} 項"
9992
+ },
9993
+ image: {
9994
+ error: "載入失敗"
9995
+ },
9996
+ pageHeader: {
9997
+ title: "返回"
9998
+ },
9999
+ popconfirm: {
10000
+ confirmButtonText: "確認",
10001
+ cancelButtonText: "取消"
10002
+ },
10003
+ carousel: {
10004
+ leftArrow: "上一張投影片",
10005
+ rightArrow: "下一張投影片",
10006
+ indicator: "投影片切換至索引 {index}"
10007
+ }
10008
+ }
10009
+ };
9821
10010
  const { wsCache } = useCache();
9822
10011
  const elLocaleMap = {
9823
10012
  "zh-CN": zhCn,
9824
- en: English
10013
+ en: English,
10014
+ "zh-TW": zhTw
9825
10015
  };
9826
10016
  const useLocaleStore = defineStore("layout-locales", {
9827
10017
  state: () => {
@@ -9836,6 +10026,10 @@ const useLocaleStore = defineStore("layout-locales", {
9836
10026
  lang: "zh-CN",
9837
10027
  name: "简体中文"
9838
10028
  },
10029
+ {
10030
+ lang: "zh-TW",
10031
+ name: "繁體中文"
10032
+ },
9839
10033
  {
9840
10034
  lang: "en",
9841
10035
  name: "English"
@@ -9891,7 +10085,7 @@ const setI18nLanguage = (locale) => {
9891
10085
  const useLocale = () => {
9892
10086
  const changeLocale = async (locale) => {
9893
10087
  const globalI18n = i18n.global;
9894
- const langModule = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../locales/en.js": () => import("./en-BLMsUBCM.mjs"), "../../locales/zh-CN.js": () => import("./zh-CN-i4M-o5m6.mjs") }), `../../locales/${locale}.js`);
10088
+ const langModule = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../locales/en.js": () => import("./en-BLMsUBCM.mjs"), "../../locales/zh-CN.js": () => import("./zh-CN-i4M-o5m6.mjs"), "../../locales/zh-TW.js": () => import("./zh-TW-DYC8NCr4.mjs") }), `../../locales/${locale}.js`);
9895
10089
  globalI18n.setLocaleMessage(locale, langModule.default);
9896
10090
  setI18nLanguage(locale);
9897
10091
  };
@@ -9899,7 +10093,7 @@ const useLocale = () => {
9899
10093
  changeLocale
9900
10094
  };
9901
10095
  };
9902
- const _sfc_main$l = /* @__PURE__ */ Object.assign({ name: "LocaleDropdown" }, {
10096
+ const _sfc_main$l = /* @__PURE__ */ Object.assign({ name: "LocaleDropdown", inheritAttrs: false }, {
9903
10097
  __name: "LocaleDropdown",
9904
10098
  props: {
9905
10099
  color: {
@@ -9949,12 +10143,16 @@ const _sfc_main$l = /* @__PURE__ */ Object.assign({ name: "LocaleDropdown" }, {
9949
10143
  })
9950
10144
  ]),
9951
10145
  default: withCtx(() => [
9952
- createVNode(_component_Icon, {
9953
- class: normalizeClass([_ctx.$attrs.class, "cursor-pointer !p-0"]),
9954
- color: __props.color,
9955
- size: 18,
9956
- icon: "ion:language-sharp"
9957
- }, null, 8, ["class", "color"])
10146
+ createElementVNode("div", {
10147
+ class: normalizeClass(_ctx.$attrs.class)
10148
+ }, [
10149
+ createVNode(_component_Icon, {
10150
+ color: __props.color,
10151
+ size: 18,
10152
+ class: "!p-0",
10153
+ icon: "svg-icon:language"
10154
+ }, null, 8, ["color"])
10155
+ ], 2)
9958
10156
  ]),
9959
10157
  _: 1
9960
10158
  }, 8, ["class"]);
@@ -10472,7 +10670,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10472
10670
  "color": iconColor.value,
10473
10671
  "onClearCacheLogoutClick": props.onClearCacheLogoutClick
10474
10672
  }, null) : void 0, locale.value ? createVNode(_sfc_main$l, {
10475
- "class": "custom-hover",
10673
+ "class": "custom-hover cursor-pointer",
10476
10674
  "color": "var(--top-header-text-color)"
10477
10675
  }, null) : void 0, createVNode("div", {
10478
10676
  "class": `h-12px mx-10px`,
@@ -10490,7 +10688,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10490
10688
  };
10491
10689
  }
10492
10690
  });
10493
- const ToolHeader = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-c654093f"]]);
10691
+ const ToolHeader = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-caca6e2e"]]);
10494
10692
  const {
10495
10693
  getPrefixCls: getPrefixCls$1
10496
10694
  } = useDesign();