eco-vue-js 0.11.24 → 0.11.25
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/dist/components/Auth/WRouteAuth.vue.d.ts.map +1 -1
- package/dist/components/Auth/WRouteAuth.vue.js +4 -3
- package/dist/components/Auth/WRouteAuthNo.vue.d.ts.map +1 -1
- package/dist/components/Auth/WRouteAuthNo.vue.js +3 -3
- package/dist/components/FilterWrapper/WFilterWrapper.vue.js +3 -3
- package/dist/components/InfiniteList/components/InfiniteListPageTitle.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPageTitle.vue.js +4 -3
- package/dist/components/Nav/WNavItem.vue.d.ts.map +1 -1
- package/dist/components/Nav/WNavItem.vue.js +2 -3
- package/dist/composables/useOptionalRouter.d.ts +8 -2
- package/dist/composables/useOptionalRouter.d.ts.map +1 -1
- package/dist/composables/useOptionalRouter.js +39 -11
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +2 -2
- package/dist/utils/useSelected.js +3 -3
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WRouteAuth.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/WRouteAuth.vue"],"names":[],"mappings":"AAGA;
|
1
|
+
{"version":3,"file":"WRouteAuth.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/WRouteAuth.vue"],"names":[],"mappings":"AAGA;AAkDA,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,mBAAmB,CAAA;AAExD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,iBAAiB,CAAA;CACrC,CAAC;;AA2EF,wBAOG"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { defineComponent, watch, onBeforeUnmount, createBlock, openBlock, unref } from 'vue';
|
2
|
-
import {
|
2
|
+
import { RouterView } from 'vue-router';
|
3
|
+
import { useOptionalRouter, useOptionalRoute } from '../../composables/useOptionalRouter.js';
|
3
4
|
import '@tanstack/vue-query';
|
4
5
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -9,8 +10,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
10
|
},
|
10
11
|
setup(__props) {
|
11
12
|
const props = __props;
|
12
|
-
const router =
|
13
|
-
const route =
|
13
|
+
const router = useOptionalRouter();
|
14
|
+
const route = useOptionalRoute();
|
14
15
|
const redirect = () => {
|
15
16
|
router.push({ name: props.apiClientInstance.routeNameAuthNo, query: route.fullPath !== "/" ? { hash: route.fullPath } : void 0 });
|
16
17
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WRouteAuthNo.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/WRouteAuthNo.vue"],"names":[],"mappings":"AAGA;
|
1
|
+
{"version":3,"file":"WRouteAuthNo.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/WRouteAuthNo.vue"],"names":[],"mappings":"AAGA;AA8DA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAA;AAOxD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,iBAAiB,CAAA;CACrC,CAAC;;AAyFF,wBAOG"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, ref, watch, onBeforeMount, onBeforeUnmount, resolveComponent, createBlock, openBlock } from 'vue';
|
2
2
|
import { useQueryClient } from '@tanstack/vue-query';
|
3
|
-
import {
|
3
|
+
import { useOptionalRouter, useOptionalRoute } from '../../composables/useOptionalRouter.js';
|
4
4
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
6
|
__name: "WRouteAuthNo",
|
@@ -9,8 +9,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
9
|
},
|
10
10
|
setup(__props) {
|
11
11
|
const props = __props;
|
12
|
-
const router =
|
13
|
-
const route =
|
12
|
+
const router = useOptionalRouter();
|
13
|
+
const route = useOptionalRoute();
|
14
14
|
const queryClient = useQueryClient();
|
15
15
|
const queryEnabled = ref(false);
|
16
16
|
const redirect = async () => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineComponent, ref, computed, watch, onUnmounted, createElementBlock, openBlock, createElementVNode, Fragment, renderList, createBlock, resolveDynamicComponent, unref, renderSlot, createVNode, withCtx, createTextVNode } from 'vue';
|
2
|
-
import { useRoute, useRouter } from 'vue-router';
|
3
2
|
import _sfc_main$1 from '../Button/WButton.vue.js';
|
4
3
|
import IconFilterRemove from '../../assets/icons/IconFilterRemove.svg.js';
|
4
|
+
import { useOptionalRoute, useOptionalRouter } from '../../composables/useOptionalRouter.js';
|
5
5
|
import { Modal } from '../../utils/Modal.js';
|
6
6
|
import { SemanticType } from '../../utils/SemanticType.js';
|
7
7
|
import { throttle } from '../../utils/utils.js';
|
@@ -17,8 +17,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
17
|
setup(__props, { emit: __emit }) {
|
18
18
|
const props = __props;
|
19
19
|
const emit = __emit;
|
20
|
-
const route =
|
21
|
-
const router =
|
20
|
+
const route = useOptionalRoute();
|
21
|
+
const router = useOptionalRouter();
|
22
22
|
const selectedIndex = ref(null);
|
23
23
|
const hasChangesMap = ref({});
|
24
24
|
const changesCount = computed(() => Object.values(hasChangesMap.value).filter((item) => item).length);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InfiniteListPageTitle.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/InfiniteList/components/InfiniteListPageTitle.vue"],"names":[],"mappings":"AAUA;
|
1
|
+
{"version":3,"file":"InfiniteListPageTitle.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/InfiniteList/components/InfiniteListPageTitle.vue"],"names":[],"mappings":"AAUA;yBAyCiB,WAAW,EAC3B,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAsFO,mBAAmB,CAAC;;;qBApFb,WAAW;mBAoFoE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cAjFL,iBAAiB,SAAS,OAAO,KAAG,IAAI;EAqF1C,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAjGzE,wBAiG4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createTextVNode, toDisplayString } from 'vue';
|
2
|
-
import
|
2
|
+
import 'vue-router';
|
3
|
+
import { useOptionalRoute, useOptionalRouter } from '../../../composables/useOptionalRouter.js';
|
3
4
|
import { Notify } from '../../../utils/Notify.js';
|
4
5
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -10,8 +11,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
11
|
emits: ["update:selected"],
|
11
12
|
setup(__props) {
|
12
13
|
const props = __props;
|
13
|
-
const route =
|
14
|
-
const router =
|
14
|
+
const route = useOptionalRoute();
|
15
|
+
const router = useOptionalRouter();
|
15
16
|
const copyRoute = () => {
|
16
17
|
navigator.clipboard.writeText(location.origin + router.resolve({ query: props.queryParams, hash: route.hash }).href).then(() => Notify.success({ title: "Page url copied" }));
|
17
18
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"AAyFA;
|
1
|
+
{"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"AAyFA;AAgIA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAyCzC,iBAAS,cAAc;WAuKT,OAAO,IAA6B;;sBAXvB,GAAG;uBACF,GAAG;;;;EAe9B;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;qPAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { defineComponent, computed, createBlock, openBlock, normalizeClass, withCtx, createVNode, createElementVNode, Transition, createElementBlock, createCommentVNode, renderSlot, resolveDynamicComponent, createTextVNode, toDisplayString, unref } from 'vue';
|
2
|
-
import { useRoute } from 'vue-router';
|
3
2
|
import _sfc_main$3 from '../Counter/WCounter.vue.js';
|
4
3
|
import _sfc_main$1 from '../RouterLink/WRouterLink.vue.js';
|
5
4
|
import _sfc_main$2 from '../Skeleton/WSkeleton.vue.js';
|
6
|
-
import { useOptionalRouter } from '../../composables/useOptionalRouter.js';
|
5
|
+
import { useOptionalRoute, useOptionalRouter } from '../../composables/useOptionalRouter.js';
|
7
6
|
import { isEqualObj, numberCompactFormatter } from '../../utils/utils.js';
|
8
7
|
|
9
8
|
const _hoisted_1 = {
|
@@ -40,7 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
40
39
|
setup(__props, { expose: __expose }) {
|
41
40
|
const EXCLUDE_QUERY_FIELDS = ["ordering", "page"];
|
42
41
|
const props = __props;
|
43
|
-
const route =
|
42
|
+
const route = useOptionalRoute();
|
44
43
|
const router = useOptionalRouter();
|
45
44
|
const routeTo = computed(() => router.resolve(props.to));
|
46
45
|
const isActive = computed(() => {
|
@@ -1,17 +1,23 @@
|
|
1
|
-
import { LocationQuery, RouteLocationRaw, useRouter } from 'vue-router';
|
1
|
+
import { LocationQuery, RouteLocationRaw, useRoute, useRouter } from 'vue-router';
|
2
2
|
type Router = ReturnType<typeof useRouter>;
|
3
3
|
export type FallbackRouter = {
|
4
4
|
push: Router['push'];
|
5
|
-
resolve(to: RouteLocationRaw): Pick<ReturnType<Router['resolve']>, 'name' | 'query'> & {
|
5
|
+
resolve(to: RouteLocationRaw): Pick<ReturnType<Router['resolve']>, 'name' | 'query' | 'href' | 'matched'> & {
|
6
6
|
meta: Record<string, string> | undefined;
|
7
|
+
name: string;
|
7
8
|
};
|
9
|
+
replace: Router['replace'];
|
8
10
|
noRouter?: true | undefined;
|
9
11
|
};
|
10
12
|
export declare const useOptionalRouter: () => FallbackRouter;
|
13
|
+
type Route = ReturnType<typeof useRoute>;
|
11
14
|
export type FallbackRoute = {
|
12
15
|
name: string;
|
13
16
|
query: LocationQuery;
|
17
|
+
hash: Route['hash'];
|
18
|
+
fullPath: Route['fullPath'];
|
14
19
|
noRouter?: true | undefined;
|
15
20
|
};
|
21
|
+
export declare const useOptionalRoute: () => FallbackRoute;
|
16
22
|
export {};
|
17
23
|
//# sourceMappingURL=useOptionalRouter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useOptionalRouter.d.ts","sourceRoot":"","sources":["../../../src/composables/useOptionalRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAC,MAAM,YAAY,CAAA;
|
1
|
+
{"version":3,"file":"useOptionalRouter.d.ts","sourceRoot":"","sources":["../../../src/composables/useOptionalRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAyB,QAAQ,EAAE,SAAS,EAAC,MAAM,YAAY,CAAA;AAoB3G,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAE1C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACpB,OAAO,CAAC,EAAE,EAAE,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAA;IACpK,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IAC1B,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,CAAA;AAkCD,eAAO,MAAM,iBAAiB,QAAO,cAcpC,CAAA;AAED,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,CAAA;IACpB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,CAAA;AAID,eAAO,MAAM,gBAAgB,QAAO,aAsBnC,CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getCurrentInstance } from 'vue';
|
1
|
+
import { getCurrentInstance, inject } from 'vue';
|
2
2
|
|
3
3
|
let cachedRouterAvailable = null;
|
4
4
|
function isRouterAvailable() {
|
@@ -20,11 +20,23 @@ const fallbackRouter = {
|
|
20
20
|
}
|
21
21
|
return Promise.resolve();
|
22
22
|
},
|
23
|
-
resolve: (to) =>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
resolve: (to) => {
|
24
|
+
const result = {
|
25
|
+
name: typeof to === "string" ? to : "name" in to ? to.name : to.path ?? "",
|
26
|
+
href: typeof to === "string" ? to : "href" in to && typeof to.href === "string" ? to.href : to.path ?? "",
|
27
|
+
query: typeof to === "string" ? {} : to.query ?? {},
|
28
|
+
meta: void 0
|
29
|
+
};
|
30
|
+
return { ...result, matched: [result] };
|
31
|
+
},
|
32
|
+
replace: (to) => {
|
33
|
+
if (typeof to === "string") {
|
34
|
+
window.location.href = to;
|
35
|
+
} else if (to && typeof to === "object" && "path" in to) {
|
36
|
+
window.location.href = to.path || "/";
|
37
|
+
}
|
38
|
+
return Promise.resolve();
|
39
|
+
},
|
28
40
|
noRouter: true
|
29
41
|
};
|
30
42
|
const useOptionalRouter = () => {
|
@@ -34,13 +46,29 @@ const useOptionalRouter = () => {
|
|
34
46
|
if (instance) {
|
35
47
|
const router = instance.appContext.app.config.globalProperties.$router;
|
36
48
|
if (router) {
|
37
|
-
return
|
38
|
-
push: router.push.bind(router),
|
39
|
-
resolve: router.resolve.bind(router)
|
40
|
-
};
|
49
|
+
return router;
|
41
50
|
}
|
42
51
|
}
|
43
52
|
return fallbackRouter;
|
44
53
|
};
|
54
|
+
const SYMBOL_ROUTE = "Symbol(route location)";
|
55
|
+
const useOptionalRoute = () => {
|
56
|
+
const hasRouter = isRouterAvailable();
|
57
|
+
if (hasRouter) {
|
58
|
+
const instance = getCurrentInstance();
|
59
|
+
if (instance) {
|
60
|
+
const injectionKey = Object.getOwnPropertySymbols(instance.appContext.provides).find((item) => item.toString() === SYMBOL_ROUTE);
|
61
|
+
if (injectionKey) return inject(injectionKey);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
const url = new URL(window.location.href);
|
65
|
+
return {
|
66
|
+
query: Object.fromEntries(url.searchParams.entries()),
|
67
|
+
name: url.pathname,
|
68
|
+
hash: url.hash,
|
69
|
+
fullPath: url.pathname,
|
70
|
+
noRouter: true
|
71
|
+
};
|
72
|
+
};
|
45
73
|
|
46
|
-
export { useOptionalRouter };
|
74
|
+
export { useOptionalRoute, useOptionalRouter };
|
package/dist/utils/api.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAkB,MAAM,KAAK,CAAA;
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAkB,MAAM,KAAK,CAAA;AAE5D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAA;AACpD,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAA;AAOtE,KAAK,aAAa,CAAC,QAAQ,IAAI;KAC5B,GAAG,IAAI,QAAQ,GAAG,kBAAkB,GAAG,MAAM,QAAQ,CAAC,CAAC,EAAE,GAAG,SAAS,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE;CACnG,CAAA;AAED,qBAAa,QAAQ,CAAC,IAAI,SAAS,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAE,SAAQ,KAAK;aACvF,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;gBAA1C,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;CAGvE;AAED,qBAAa,cAAc,CAAC,IAAI,SAAS,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,CAAE,SAAQ,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;gBAChG,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;CAGvD;AAED,eAAO,MAAM,cAAc,GAAI,KAAK,EAClC,OAAO,KAAK,EACZ,OAAO;IAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,CAAA;CAAC,GAAG,IAAI,EACzE,QAAQ,MAAM,EACd,gBAAgB;IAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,cAAc,CAAC,CAAC,YAAY,CAAC,CAAA;CAAC,GAAG,IAAI,KAC1F,OAAO,CAAC,KAAK,CAgBf,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAYpE,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,QAAQ,CAAC,KAAG,iBAAiB,CAAC,CAAC,CAYnE,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,QAAQ,CAAC,KAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAc5E,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAE,GAAG,IAAI,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAC,KAwDlI;YAhCM;QAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,YAAY,GAAG,CAAC,OAAO,CAAC;;mCAGtE,OAAO,CAAC,WAAW,CAAC;;eA3BkC,GAAG;yBAGjE,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,SAAS,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAqDxG;IAAC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC5D,CAAA"}
|
package/dist/utils/api.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { reactive, watch } from 'vue';
|
2
|
-
import {
|
2
|
+
import { useOptionalRouter } from '../composables/useOptionalRouter.js';
|
3
3
|
import { Notify } from './Notify.js';
|
4
4
|
import { get } from './utils.js';
|
5
5
|
|
@@ -74,7 +74,7 @@ const createUseQueryParams = (config) => {
|
|
74
74
|
const queryParams = reactive({});
|
75
75
|
let lastQuery = null;
|
76
76
|
const fn = (route, enabled) => {
|
77
|
-
const router =
|
77
|
+
const router = useOptionalRouter();
|
78
78
|
const updateQueryParams = (value) => {
|
79
79
|
router.replace({
|
80
80
|
query: { ...route.query, ...encodeRouteParams(value) },
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { computed, ref, unref, watch, onBeforeUnmount } from 'vue';
|
2
|
-
import {
|
2
|
+
import { useOptionalRoute, useOptionalRouter } from '../composables/useOptionalRouter.js';
|
3
3
|
import { isIdArray, isIndex } from './utils.js';
|
4
4
|
|
5
5
|
const isSelectedRange = (value) => {
|
@@ -21,8 +21,8 @@ const getPosition = (page, index, pageLength) => {
|
|
21
21
|
};
|
22
22
|
const isEmpty = (value) => !value.id__in?.length && !value.id__not_in && !value.range;
|
23
23
|
const useSelected = (count, disabled) => {
|
24
|
-
const route =
|
25
|
-
const router =
|
24
|
+
const route = useOptionalRoute();
|
25
|
+
const router = useOptionalRouter();
|
26
26
|
const selection = computed(() => {
|
27
27
|
if (!route.hash) return {};
|
28
28
|
try {
|