vue-router-query-sync 0.0.3 → 0.0.6
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuerySync.d.ts","sourceRoot":"","sources":["../../src/composables/useQuerySync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useQuerySync.d.ts","sourceRoot":"","sources":["../../src/composables/useQuerySync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGjC;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACpD,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,CAAC,GAAG,IAAI,EACnB,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,EACrB,OAAO,GAAE,OAAY,QAyDtB"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],u):(n=typeof globalThis<"u"?globalThis:n||self,u(n.VueRouterQuerySync={},n.Vue,n.VueRouter))})(this,(function(n,u,S){"use strict";let c={};const l=new Set;let q=!1;function f(o,r){const d=S.useRouter();r===null?o in c||l.add(o):(c[o]=r,l.delete(o)),q||(q=!0,queueMicrotask(()=>{const y={...d.currentRoute.value.query};l.forEach(a=>{delete y[a]});const s={...y,...c};d.replace({query:s}),c={},l.clear(),q=!1}))}function R(o,r,d,y={}){const s=S.useRoute(),{deps:a=[],context:m}=y,t=m?`${m}_${o}`:o,h=(e,p=!1)=>{if(typeof e=="string"){const i=isNaN(Number(e))?e:Number(e);if(p||i!==r()){d(i);const Q=r();Q!==i&&Q!==null&&f(t,Q)}}else{const i=r();i!==null&&f(t,i)}};u.onBeforeMount(()=>{a.length>0?u.watch(a,()=>h(s.query[t])):h(s.query[t])}),u.watch(r,e=>{const p=s.query[t];e===null?p!==void 0&&f(t,null):p!==String(e)&&f(t,e)}),u.watch(()=>s.query[t],e=>{h(e)}),u.onBeforeUnmount(()=>{f(t,null)})}n.useQuerySync=R,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(n,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],u):(n=typeof globalThis<"u"?globalThis:n||self,u(n.VueRouterQuerySync={},n.Vue,n.VueRouter))})(this,(function(n,u,S){"use strict";let c={};const l=new Set;let q=!1;function f(o,r){const d=S.useRouter();r===null?o in c||l.add(o):(c[o]=r,l.delete(o)),q||(q=!0,queueMicrotask(()=>{const y={...d.currentRoute.value.query};l.forEach(a=>{delete y[a]});const s={...y,...c};d.replace({query:s}),c={},l.clear(),q=!1}))}function R(o,r,d,y={}){const s=S.useRoute();console.log("!!!!",s);const{deps:a=[],context:m}=y,t=m?`${m}_${o}`:o,h=(e,p=!1)=>{if(typeof e=="string"){const i=isNaN(Number(e))?e:Number(e);if(p||i!==r()){d(i);const Q=r();Q!==i&&Q!==null&&f(t,Q)}}else{const i=r();i!==null&&f(t,i)}};u.onBeforeMount(()=>{a.length>0?u.watch(a,()=>h(s.query[t])):h(s.query[t])}),u.watch(r,e=>{const p=s.query[t];e===null?p!==void 0&&f(t,null):p!==String(e)&&f(t,e)}),u.watch(()=>s.query[t],e=>{h(e)}),u.onBeforeUnmount(()=>{f(t,null)})}n.useQuerySync=R,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,9 @@ function l(u, o) {
|
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
20
|
function x(u, o, s, c = {}) {
|
|
21
|
-
const n = S()
|
|
21
|
+
const n = S();
|
|
22
|
+
console.log("!!!!", n);
|
|
23
|
+
const { deps: f = [], context: Q } = c, t = Q ? `${Q}_${u}` : u, p = (e, i = !1) => {
|
|
22
24
|
if (typeof e == "string") {
|
|
23
25
|
const r = isNaN(Number(e)) ? e : Number(e);
|
|
24
26
|
if (i || r !== o()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-router-query-sync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Vue composable for syncing router query params with store",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/Ivan-Chikachev/vue-router-query-sync"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"vue": "^3.
|
|
37
|
+
"vue": "^3.3.13",
|
|
38
38
|
"vue-router": "^4.0.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|