@aplus-frontend/ui 7.19.0-beta.0 → 7.19.0-beta.1

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.
@@ -1,38 +1,37 @@
1
- import { isObjectWithContent as c } from "@aplus-frontend/utils";
2
- import { ref as d, onMounted as m, onUnmounted as f, computed as n } from "vue";
1
+ import { isObjectWithContent as d } from "@aplus-frontend/utils";
2
+ import { ref as i, onMounted as m, onUnmounted as f, computed as l } from "vue";
3
3
  import { getUrlQuery as v, setUrlQuery as p } from "../utils/query.mjs";
4
- const U = (u) => {
5
- const { saveDataSource: s, sendToUrl: i, tableKey: o } = u;
6
- let a, e, r = !1;
7
- const t = d({});
4
+ const S = (u) => {
5
+ const { saveDataSource: s, sendToUrl: c, tableKey: n } = u;
6
+ let o, t, r = !1;
7
+ const a = i({});
8
8
  return m(() => {
9
- if (i?.value) {
9
+ if (c?.value) {
10
10
  try {
11
- t.value = JSON.parse(
12
- atob(v()[o.value] ?? "")
13
- );
11
+ const e = v()[n.value] ?? "";
12
+ a.value = e ? JSON.parse(decodeURIComponent(e)) : {};
14
13
  } catch {
15
- t.value = {};
14
+ a.value = {};
16
15
  }
17
- a = setInterval(() => {
16
+ o = setInterval(() => {
18
17
  try {
19
- const l = btoa(
18
+ const e = encodeURIComponent(
20
19
  JSON.stringify(s?.getSearchFormValues?.() ?? {})
21
20
  );
22
- l !== e && (e = l, r = !0);
21
+ e !== t && (t = e, r = !0);
23
22
  } catch {
24
- e = "";
23
+ t = "";
25
24
  }
26
- r && (p({ [o.value]: e }), r = !1);
25
+ r && (p({ [n.value]: t }), r = !1);
27
26
  }, 500);
28
27
  }
29
28
  }), f(() => {
30
- a && clearInterval(a);
29
+ o && clearInterval(o);
31
30
  }), {
32
- mountedData: n(() => t.value),
33
- isValidMountedData: n(() => c(t.value))
31
+ mountedData: l(() => a.value),
32
+ isValidMountedData: l(() => d(a.value))
34
33
  };
35
34
  };
36
35
  export {
37
- U as useSendToUrl
36
+ S as useSendToUrl
38
37
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "7.19.0-beta.0";
1
+ declare const _default: "7.19.0-beta.1";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.19.0-beta.0";
1
+ const e = "7.19.0-beta.1";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@aplus-frontend/utils"),e=require("vue"),l=require("../utils/query.js"),v=s=>{const{saveDataSource:c,sendToUrl:i,tableKey:n}=s;let r,t,u=!1;const a=e.ref({});return e.onMounted(()=>{if(i?.value){try{a.value=JSON.parse(atob(l.getUrlQuery()[n.value]??""))}catch{a.value={}}r=setInterval(()=>{try{const o=btoa(JSON.stringify(c?.getSearchFormValues?.()??{}));o!==t&&(t=o,u=!0)}catch{t=""}u&&(l.setUrlQuery({[n.value]:t}),u=!1)},500)}}),e.onUnmounted(()=>{r&&clearInterval(r)}),{mountedData:e.computed(()=>a.value),isValidMountedData:e.computed(()=>d.isObjectWithContent(a.value))}};exports.useSendToUrl=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@aplus-frontend/utils"),t=require("vue"),l=require("../utils/query.js"),v=s=>{const{saveDataSource:c,sendToUrl:d,tableKey:u}=s;let n,a,o=!1;const r=t.ref({});return t.onMounted(()=>{if(d?.value){try{const e=l.getUrlQuery()[u.value]??"";r.value=e?JSON.parse(decodeURIComponent(e)):{}}catch{r.value={}}n=setInterval(()=>{try{const e=encodeURIComponent(JSON.stringify(c?.getSearchFormValues?.()??{}));e!==a&&(a=e,o=!0)}catch{a=""}o&&(l.setUrlQuery({[u.value]:a}),o=!1)},500)}}),t.onUnmounted(()=>{n&&clearInterval(n)}),{mountedData:t.computed(()=>r.value),isValidMountedData:t.computed(()=>i.isObjectWithContent(r.value))}};exports.useSendToUrl=v;
@@ -1,2 +1,2 @@
1
- declare const _default: "7.19.0-beta.0";
1
+ declare const _default: "7.19.0-beta.1";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.0-beta.0";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.0-beta.1";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "7.19.0-beta.0",
3
+ "version": "7.19.0-beta.1",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "typings": "./lib/index.d.ts",