@unizhen/ui 0.0.52 → 0.0.54

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.
Files changed (2) hide show
  1. package/lib/ui.js +35 -35
  2. package/package.json +1 -1
package/lib/ui.js CHANGED
@@ -2,7 +2,7 @@ var ed = Object.defineProperty;
2
2
  var td = (e, t, r) => t in e ? ed(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var zt = (e, t, r) => td(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { defineComponent as ue, createElementBlock as m, openBlock as c, createStaticVNode as L, createElementVNode as l, ref as N, watch as fe, nextTick as Le, h as Y, reactive as Aa, resolveComponent as M, createBlock as O, withCtx as v, toDisplayString as E, createVNode as I, computed as Ke, normalizeStyle as Te, inject as Ge, normalizeClass as de, createSlots as Re, createTextVNode as K, Fragment as ie, renderList as Ce, provide as $a, onMounted as Je, resolveDirective as El, withDirectives as yt, createCommentVNode as G, mergeProps as Ma, withModifiers as qt, watchEffect as Ll, onBeforeUnmount as Oa, withKeys as rd, renderSlot as Se, markRaw as nd, defineAsyncComponent as ad, onUnmounted as Hl, vShow as Sa, resolveDynamicComponent as ko } from "vue";
5
- import { createDiscreteApi as od, NPopover as ct, NFlex as Kl, NButton as _e, NPopconfirm as Ra, NTooltip as Gl, NIcon as be, NDropdown as sd, NCascader as Wl, NCheckboxGroup as Fa, NCheckbox as Ba, NColorPicker as ld, NSwitch as id, NTimePicker as ud, NDatePicker as cd, NInputNumber as dd, NSelect as fd, NInput as pd, NDivider as Va, NFormItem as Ua, NForm as Pa, NInputGroup as Ea, NUploadDragger as hd, NImage as Jl, NUpload as Ql, useNotification as Ft, NImageGroup as md, NModal as wd, NInputGroupLabel as Xl, NGridItem as Yl, NGrid as Zl, NButtonGroup as gd, NDrawerContent as La, NDrawer as Ha, NTag as vd, NEllipsis as yd, NSpin as Ka, NRadioGroup as ei, NSkeleton as ti, NDataTable as Ga, NPagination as kd, NRadio as bd, NTabPane as _d, NTabs as xd, darkTheme as ve, NConfigProvider as Cd, dateZhCN as $d, zhCN as Md } from "naive-ui";
5
+ import { createDiscreteApi as od, NPopover as ct, NFlex as Kl, NButton as _e, NPopconfirm as Ra, NTooltip as Gl, NIcon as be, NDropdown as sd, NCascader as Wl, NCheckboxGroup as Fa, NCheckbox as Ba, NColorPicker as ld, NSwitch as id, NTimePicker as ud, NDatePicker as cd, NInputNumber as dd, NSelect as fd, NInput as pd, NDivider as Va, NFormItem as Ua, NForm as Pa, NInputGroup as Ea, NUploadDragger as hd, NImage as Jl, NUpload as Ql, useNotification as Ft, NImageGroup as md, NModal as wd, NInputGroupLabel as Xl, NGridItem as Yl, NGrid as Zl, NButtonGroup as gd, NDrawerContent as La, NDrawer as Ha, NTag as vd, NEllipsis as yd, NSpin as Ka, NRadioGroup as ei, NSkeleton as ti, NDataTable as Ga, NPagination as kd, NRadio as bd, NTabPane as _d, NTabs as xd, darkTheme as ye, NConfigProvider as Cd, dateZhCN as $d, zhCN as Md } from "naive-ui";
6
6
  import Wa from "axios";
7
7
  import { createRouter as Sd, createWebHistory as Td, useRouter as Nd, useRoute as Bt } from "vue-router";
8
8
  import { createI18n as Id, useI18n as Vt } from "vue-i18n";
@@ -2568,7 +2568,7 @@ const Lw = { all: "全部", add: "新增", edit: "编辑", detail: "详情", app
2568
2568
  "zh-CN": { ...Gw },
2569
2569
  "fr-FR": {}
2570
2570
  }
2571
- }), He = Yw, ye = Aa({
2571
+ }), He = Yw, ve = Aa({
2572
2572
  needUpdate: !1,
2573
2573
  theme: !1,
2574
2574
  isMobile: !1,
@@ -2576,11 +2576,11 @@ const Lw = { all: "全部", add: "新增", edit: "编辑", detail: "详情", app
2576
2576
  lang: "zh-CN"
2577
2577
  });
2578
2578
  function Zw(e) {
2579
- ye.language = e;
2579
+ ve.language = e;
2580
2580
  }
2581
2581
  function cc(e) {
2582
2582
  let t;
2583
- e ? t = e : ye.lang === "zh-CN" ? t = "en-US" : t = "zh-CN", Ne("lang", t, 0), ye.lang = t;
2583
+ e ? t = e : ve.lang === "zh-CN" ? t = "en-US" : t = "zh-CN", Ne("lang", t, 0), ve.lang = t;
2584
2584
  const r = document.body;
2585
2585
  r.dataset.lang = t, He.global.locale.value = t;
2586
2586
  }
@@ -2588,15 +2588,15 @@ function dc(e) {
2588
2588
  const t = document.body;
2589
2589
  t.classList.add("remove-all-transition");
2590
2590
  const r = document.querySelector("meta[name=theme-color]");
2591
- e ? t.dataset.theme = "dark" : t.dataset.theme = "", r && (e ? r.setAttribute("content", "#2b2b2d") : r.setAttribute("content", "#ffffff")), ye.theme = e, setTimeout(() => {
2591
+ e ? t.dataset.theme = "dark" : t.dataset.theme = "", r && (e ? r.setAttribute("content", "#2b2b2d") : r.setAttribute("content", "#ffffff")), ve.theme = e, setTimeout(() => {
2592
2592
  t.classList.remove("remove-all-transition");
2593
2593
  }, 0);
2594
2594
  }
2595
2595
  function eg(e) {
2596
- ye.needUpdate = e;
2596
+ ve.needUpdate = e;
2597
2597
  }
2598
2598
  const fc = () => {
2599
- ye.isMobile = window.screen.availWidth < 769;
2599
+ ve.isMobile = window.screen.availWidth < 769;
2600
2600
  };
2601
2601
  window.addEventListener("resize", fc);
2602
2602
  fc();
@@ -2634,7 +2634,7 @@ let Na = Wa.CancelToken.source();
2634
2634
  Qe.interceptors.request.use(
2635
2635
  (e) => {
2636
2636
  var r, n;
2637
- e.cancelToken = Na.token, e.headers.Language = ye.lang;
2637
+ e.cancelToken = Na.token, e.headers.Language = ve.lang, e.headers.Platform = ve.isMobile ? "mobile" : "pc";
2638
2638
  const t = Be(
2639
2639
  "token",
2640
2640
  !1
@@ -4612,7 +4612,7 @@ const Q = /* @__PURE__ */ Gt(t2), r2 = ue({
4612
4612
  setup(e) {
4613
4613
  const t = Ge("mainFormValue"), r = N(!1), n = N([]);
4614
4614
  return {
4615
- isMobile: Ke(() => ye.isMobile),
4615
+ isMobile: Ke(() => ve.isMobile),
4616
4616
  showDropdown: r,
4617
4617
  dropdownOptions: n,
4618
4618
  dayjs: Fe,
@@ -4715,7 +4715,7 @@ const Q = /* @__PURE__ */ Gt(t2), r2 = ue({
4715
4715
  if (e.formValue && e.formValue[f]) {
4716
4716
  const T = e.formValue[f].toLocaleLowerCase();
4717
4717
  p.forEach((V) => {
4718
- V.label.toLocaleLowerCase().indexOf(T) > -1 ? V.show = !0 : V.show = !1;
4718
+ V.label && V.label.toLocaleLowerCase().indexOf(T) > -1 ? V.show = !0 : V.show = !1;
4719
4719
  });
4720
4720
  } else
4721
4721
  p.forEach((T) => {
@@ -5123,7 +5123,7 @@ const pt = /* @__PURE__ */ _(r2, [["render", a2]]), o2 = ue({
5123
5123
  }
5124
5124
  },
5125
5125
  setup(e, { expose: t }) {
5126
- const r = Ge("userStore"), n = Ke(() => ye.isMobile), a = N(), o = N({}), s = N([]), u = N([]), h = N([]), w = N(), b = N(!1), D = N(""), g = N("");
5126
+ const r = Ge("userStore"), n = Ke(() => ve.isMobile), a = N(), o = N({}), s = N([]), u = N([]), h = N([]), w = N(), b = N(!1), D = N(""), g = N("");
5127
5127
  $a("mainFormValue", {
5128
5128
  value: () => o.value,
5129
5129
  setValue: (z) => {
@@ -7287,7 +7287,7 @@ async function er(e, t = !1, r = 0, n = () => {
7287
7287
  width: Number(i.table.width || 140),
7288
7288
  ellipsis: i.table.ellipsis ? { tooltip: !0, "line-clamp": i.table.clamp ?? 0 } : !1,
7289
7289
  render: i.table.render ? await W2(i.key, i.table.render, a) : void 0,
7290
- show: ye.isMobile ? i.table.mobile ?? !1 : i.table.show ?? !0,
7290
+ show: ve.isMobile ? i.table.mobile ?? !1 : i.table.show ?? !0,
7291
7291
  pin: !!i.table.fixed,
7292
7292
  fixTemp: i.table.fixed
7293
7293
  };
@@ -7295,7 +7295,7 @@ async function er(e, t = !1, r = 0, n = () => {
7295
7295
  if (!k.form.edit.show)
7296
7296
  k = null;
7297
7297
  else {
7298
- if (k.ellipsis = !1, k.resizable = !1, ye.isMobile && (k.show = i.table.mobile), i.table.show && (r === 0 && (k.show = i.form.create.show), r === 1 && (k.show = i.form.edit.show), r === 2 && (k.show = i.form.show)), (y = i.form.rule) != null && y.required && typeof i.form.rule.validator == "string") {
7298
+ if (k.ellipsis = !1, k.resizable = !1, ve.isMobile && (k.show = i.table.mobile), i.table.show && (r === 0 && (k.show = i.form.create.show), r === 1 && (k.show = i.form.edit.show), r === 2 && (k.show = i.form.show)), (y = i.form.rule) != null && y.required && typeof i.form.rule.validator == "string") {
7299
7299
  delete i.form.rule.message;
7300
7300
  const f = i.form.rule.validator, p = new Function("rule", "value", "index", "formValues", f);
7301
7301
  i.form.rule.validator !== "" ? i.form.rule.validator = (x, T) => n()[x.index].delete ? !0 : p(x, T, x.index, () => n()) : i.form.rule.validator = (x, T) => n()[x.index].delete || T ? !0 : new Error(i.form.rule.message);
@@ -7729,7 +7729,7 @@ const Vc = /* @__PURE__ */ _(ey, [["render", ny], ["__scopeId", "data-v-ec746f00
7729
7729
  value: () => null,
7730
7730
  setValue: () => null
7731
7731
  });
7732
- const a = Bt(), { t: o } = Vt(), s = Ft(), u = Ke(() => ye.isMobile), h = N(), w = N(!!n.header), b = N(), D = N(!1), g = N(!1), d = N(!1), y = N(""), i = N(), k = N([]), f = N([]), p = N([]), x = N(void 0), T = N({
7732
+ const a = Bt(), { t: o } = Vt(), s = Ft(), u = Ke(() => ve.isMobile), h = N(), w = N(!!n.header), b = N(), D = N(!1), g = N(!1), d = N(!1), y = N(""), i = N(), k = N([]), f = N([]), p = N([]), x = N(void 0), T = N({
7733
7733
  params: [],
7734
7734
  query: {
7735
7735
  page: 1,
@@ -9303,7 +9303,7 @@ const Dy = /* @__PURE__ */ _(My, [["render", Iy]]), zy = ue({
9303
9303
  },
9304
9304
  emits: ["update:show", "on-submit"],
9305
9305
  setup(e, { emit: t }) {
9306
- const r = Ke(() => ye.isMobile), n = N(), a = N({}), o = N(!1), s = N({
9306
+ const r = Ke(() => ve.isMobile), n = N(), a = N({}), o = N(!1), s = N({
9307
9307
  index: 1,
9308
9308
  selection: 0,
9309
9309
  // 0:false | 1:multiple:true | 2:multiple:false
@@ -9920,21 +9920,21 @@ function Xy(e, t, r, n, a, o) {
9920
9920
  ]), 1032, ["value", "on-close", "on-update:value"]);
9921
9921
  }
9922
9922
  const Yy = /* @__PURE__ */ _(Qy, [["render", Xy]]), pa = "#007AFF", Lc = "#0A84FF", ha = "#FF9500", Hc = "#FF9F0A", ma = "#28CD41", Kc = "#32D74B", wa = "#FFCC00", Gc = "#FFD60A", ga = "#FF3B30", Wc = "#FF453A";
9923
- ve.common.cardColor = "#32323b";
9924
- ve.common.primaryColor = "#0A84FF";
9925
- ve.common.primaryColorHover = Lc;
9926
- ve.common.infoColor = "#FF9F0A";
9927
- ve.common.infoColorHover = Hc;
9928
- ve.common.successColor = "#32D74B";
9929
- ve.common.successColorHover = Kc;
9930
- ve.common.warningColor = "#FFD60A";
9931
- ve.common.successColorHover = Gc;
9932
- ve.common.errorColor = "#FF453A";
9933
- ve.common.errorColorHover = Wc;
9934
- ve.common.borderRadius = "var(--borderRadius)";
9935
- ve.common.inputColor = "rgba(var(--input))";
9936
- ve.common.borderColor = "rgba(var(--border), 0.7)";
9937
- ve.DataTable.tdColor = "#2d2d31";
9923
+ ye.common.cardColor = "#32323b";
9924
+ ye.common.primaryColor = "#0A84FF";
9925
+ ye.common.primaryColorHover = Lc;
9926
+ ye.common.infoColor = "#FF9F0A";
9927
+ ye.common.infoColorHover = Hc;
9928
+ ye.common.successColor = "#32D74B";
9929
+ ye.common.successColorHover = Kc;
9930
+ ye.common.warningColor = "#FFD60A";
9931
+ ye.common.successColorHover = Gc;
9932
+ ye.common.errorColor = "#FF453A";
9933
+ ye.common.errorColorHover = Wc;
9934
+ ye.common.borderRadius = "var(--borderRadius)";
9935
+ ye.common.inputColor = "rgba(var(--input))";
9936
+ ye.common.borderColor = "rgba(var(--border), 0.7)";
9937
+ ye.DataTable.tdColor = "#2d2d31";
9938
9938
  const Zy = {
9939
9939
  common: {
9940
9940
  inputColor: "rgba(var(--input))",
@@ -9977,7 +9977,7 @@ const Zy = {
9977
9977
  Radio: {
9978
9978
  boxShadow: "inset 0 0 0 1px rgb(var(--primary))"
9979
9979
  }
9980
- }, ek = ve, tk = ue({
9980
+ }, ek = ye, tk = ue({
9981
9981
  name: "UzWrap",
9982
9982
  components: {
9983
9983
  NConfigProvider: Cd
@@ -9986,7 +9986,7 @@ const Zy = {
9986
9986
  return {
9987
9987
  zhCN: Md,
9988
9988
  dateZhCN: $d,
9989
- commonStore: ye,
9989
+ commonStore: ve,
9990
9990
  lightTheme: Zy,
9991
9991
  darkTheme: ek
9992
9992
  };
@@ -10159,7 +10159,7 @@ const nk = /* @__PURE__ */ _(tk, [["render", rk]]), ql = /* @__PURE__ */ Object.
10159
10159
  UzThumbnail: Yy,
10160
10160
  UzWrap: nk,
10161
10161
  X: eo,
10162
- commonStore: ye,
10162
+ commonStore: ve,
10163
10163
  fnActionReduction: Rt,
10164
10164
  fnActionSimplify: cg,
10165
10165
  fnAddThumbnail: Jy,
@@ -10452,7 +10452,7 @@ function Qk(e, t, r) {
10452
10452
  refetch: p
10453
10453
  };
10454
10454
  }
10455
- const mk = "0.0.52";
10455
+ const mk = "0.0.54";
10456
10456
  let Xc;
10457
10457
  async function Yc() {
10458
10458
  const e = await fetch(
@@ -10778,7 +10778,7 @@ export {
10778
10778
  Yy as UzThumbnail,
10779
10779
  nk as UzWrap,
10780
10780
  eo as X,
10781
- ye as commonStore,
10781
+ ve as commonStore,
10782
10782
  _k as create,
10783
10783
  ek as darkTheme,
10784
10784
  xk as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizhen/ui",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "author": {
5
5
  "name": "Donovan"
6
6
  },