auto-vue-manual 0.2.29 → 0.2.30

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.
@@ -12308,7 +12308,7 @@ const _ce = "MENU", cD = DS(_ce, {
12308
12308
  }
12309
12309
  },
12310
12310
  persist: tL(_ce, "auth", ["authMenuList"], 60 * 24)
12311
- }), Cce = "DATA", hne = DS(Cce, {
12311
+ }), Cce = "CACHE", hne = DS(Cce, {
12312
12312
  state: () => ({
12313
12313
  cache: {}
12314
12314
  }),
@@ -12328,31 +12328,25 @@ const _ce = "MENU", cD = DS(_ce, {
12328
12328
  params: l = {},
12329
12329
  force: c = !1,
12330
12330
  isArray: d = !1,
12331
- labelKey: h = "",
12332
- valueKey: p = "",
12333
- formatOptions: v = void 0
12331
+ formatOptions: h = void 0
12334
12332
  } = n;
12335
12333
  if (!r || !a && !i)
12336
12334
  return e(d ? [] : {});
12337
- const y = d ? Array.isArray(this.cache[r]) && this.cache[r].length > 0 : this.cache[r] && Object.keys(this.cache[r]).length > 0;
12338
- if (!c && y)
12335
+ const p = d ? Array.isArray(this.cache[r]) && this.cache[r].length > 0 : this.cache[r] && Object.keys(this.cache[r]).length > 0;
12336
+ if (!c && p)
12339
12337
  return e(this.cache[r]);
12340
12338
  try {
12341
- const _ = i || (a == null ? void 0 : a.urls[Ote]);
12342
- if (!_)
12339
+ const v = i || (a == null ? void 0 : a.urls[Ote]);
12340
+ if (!v)
12343
12341
  throw new Error("store cache error: No request url provided");
12344
- const w = await oc(_, l);
12342
+ const y = await oc(v, l);
12345
12343
  if (d) {
12346
- let A = Array.isArray(w == null ? void 0 : w.data) ? w.data : [];
12347
- return typeof v == "function" ? A = v(A) : A = A.map((T) => ({
12348
- ...T,
12349
- label: h ? T[h] : (T == null ? void 0 : T.label) || (T == null ? void 0 : T.name),
12350
- value: p ? T[p] : a ? T[a == null ? void 0 : a.primaryKey] : T == null ? void 0 : T.value
12351
- })), this.SET_CACHE(r, A), e(A);
12344
+ let _ = Array.isArray(y == null ? void 0 : y.data) ? y.data : [];
12345
+ return typeof h == "function" && (_ = h(_)), this.SET_CACHE(r, _), e(_);
12352
12346
  }
12353
- return this.SET_CACHE(r, w), e(w);
12354
- } catch (_) {
12355
- return console.error("Cache GET_CACHE error:", _), e(d ? [] : {});
12347
+ return this.SET_CACHE(r, y), e(y);
12348
+ } catch (v) {
12349
+ return console.error("Cache GET_CACHE error:", v), e(d ? [] : {});
12356
12350
  }
12357
12351
  });
12358
12352
  }
@@ -49883,64 +49877,72 @@ const rue = 8, bNe = "undo redo cut copy paste indent2em | image | styleselect f
49883
49877
  return (l = n.value) == null ? void 0 : l.closed(i);
49884
49878
  }
49885
49879
  };
49886
- }, E1e = (n, e, t, r = !0) => {
49887
- const a = hne(), i = mr({
49880
+ }, E1e = (n, e, t, r) => {
49881
+ const a = hne(), { labelKey: i = "", valueKey: l = "", autoRefresh: c = !0 } = r || {}, d = mr({
49888
49882
  get: () => n.value,
49889
- set: (N) => R(N)
49890
- }), l = mr({
49883
+ set: (ne) => Z(ne)
49884
+ }), h = mr({
49891
49885
  get: () => n.value,
49892
- set: (N) => R(N)
49893
- }), c = mr({
49886
+ set: (ne) => Z(ne)
49887
+ }), p = mr({
49894
49888
  get: () => n.value,
49895
- set: (N) => R(N)
49896
- }), d = mr({
49889
+ set: (ne) => Z(ne)
49890
+ }), v = mr({
49897
49891
  get: () => n.value,
49898
- set: (N) => R(N)
49899
- }), h = mr({
49892
+ set: (ne) => Z(ne)
49893
+ }), y = mr({
49900
49894
  get: () => n.value,
49901
- set: (N) => R(N)
49902
- }), p = cr([]), v = cr([]);
49903
- function y(N, W) {
49904
- W ? W(N) : v.value = p.value.filter((G) => (G.label ?? "").toString().toLowerCase().includes(N.toLowerCase()));
49905
- }
49906
- async function _(N = !1) {
49907
- t && await a.GET_CACHE({ ...t, force: N }).then((W) => {
49908
- p.value = W, v.value = W;
49895
+ set: (ne) => Z(ne)
49896
+ }), _ = cr([]), w = cr([]);
49897
+ function A(ne, re) {
49898
+ re ? re(ne) : w.value = _.value.filter((Q) => (Q.label ?? "").toString().toLowerCase().includes(ne.toLowerCase()));
49899
+ }
49900
+ const T = (ne) => ne.map((re) => {
49901
+ var Q;
49902
+ return {
49903
+ ...re,
49904
+ label: i ? re[i] : (re == null ? void 0 : re.label) || (re == null ? void 0 : re.name),
49905
+ value: l ? re[l] : (re == null ? void 0 : re[(Q = t == null ? void 0 : t.api) == null ? void 0 : Q.primaryKey]) || (re == null ? void 0 : re.id)
49906
+ };
49907
+ });
49908
+ async function k(ne = !1) {
49909
+ t && await a.GET_CACHE({ ...t, force: ne, formatOptions: (t == null ? void 0 : t.formatOptions) || T }).then((re) => {
49910
+ _.value = re, w.value = re;
49909
49911
  });
49910
49912
  }
49911
- function w(N) {
49912
- e("select", N);
49913
+ function I(ne) {
49914
+ e("select", ne);
49913
49915
  }
49914
- function A(N) {
49915
- e("change", N);
49916
+ function R(ne) {
49917
+ e("change", ne);
49916
49918
  }
49917
- function T() {
49919
+ function N() {
49918
49920
  e("clear");
49919
49921
  }
49920
- function k(N) {
49921
- e("blur", N);
49922
- }
49923
- function I(N) {
49924
- e("focus", N);
49925
- }
49926
- function R(N) {
49927
- e("update:modelValue", N), e("update:value", N);
49928
- }
49929
- return r && _(!1), {
49930
- value: i,
49931
- id: l,
49932
- ids: c,
49933
- key: d,
49934
- keys: h,
49935
- options: v,
49936
- cacheData: p,
49937
- refresh: _,
49938
- select: w,
49939
- change: A,
49940
- clear: T,
49941
- blur: k,
49942
- focus: I,
49943
- filterOptions: y
49922
+ function W(ne) {
49923
+ e("blur", ne);
49924
+ }
49925
+ function G(ne) {
49926
+ e("focus", ne);
49927
+ }
49928
+ function Z(ne) {
49929
+ e("update:modelValue", ne), e("update:value", ne);
49930
+ }
49931
+ return c && k(!1), {
49932
+ value: d,
49933
+ id: h,
49934
+ ids: p,
49935
+ key: v,
49936
+ keys: y,
49937
+ options: w,
49938
+ cacheData: _,
49939
+ refresh: k,
49940
+ select: I,
49941
+ change: R,
49942
+ clear: N,
49943
+ blur: W,
49944
+ focus: G,
49945
+ filterOptions: A
49944
49946
  };
49945
49947
  }, A1e = () => {
49946
49948
  const n = L0();