eco-vue-js 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Expansion/WExpansion.vue.js +1 -1
- package/dist/components/Nav/WNavItem.vue.d.ts +6 -3
- package/dist/components/Nav/WNavItem.vue.d.ts.map +1 -1
- package/dist/components/Nav/WNavItem.vue.js +66 -35
- package/dist/components/Nav/WNavItemExpand.vue.d.ts +16 -3
- package/dist/components/Nav/WNavItemExpand.vue.d.ts.map +1 -1
- package/dist/components/Nav/WNavItemExpand.vue.js +52 -20
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +3 -1
- package/package.json +1 -1
@@ -4,7 +4,7 @@ const _hoisted_1 = {
|
|
4
4
|
key: 0,
|
5
5
|
class: "duration-[var(--expansion-duration,200ms)]"
|
6
6
|
};
|
7
|
-
const _hoisted_2 = { class: "[overflow:inherit]" };
|
7
|
+
const _hoisted_2 = { class: "[overflow:inherit] grid grid-cols-1" };
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
9
|
__name: "WExpansion",
|
10
10
|
props: {
|
@@ -4,16 +4,19 @@ interface Props extends LinkProps {
|
|
4
4
|
title: string;
|
5
5
|
count?: number;
|
6
6
|
counter?: number;
|
7
|
-
noQuery?: boolean;
|
8
7
|
skeleton?: boolean;
|
9
8
|
hasActive?: boolean;
|
9
|
+
expand?: boolean;
|
10
|
+
indent?: boolean;
|
11
|
+
queryFields?: string[];
|
10
12
|
}
|
11
13
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
12
|
-
"update:isActive": (value:
|
14
|
+
"update:isActive": (value: [string, boolean]) => void;
|
13
15
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
|
14
|
-
"onUpdate:isActive"?: ((value:
|
16
|
+
"onUpdate:isActive"?: ((value: [string, boolean]) => any) | undefined;
|
15
17
|
}, {}, {}>, {
|
16
18
|
icon?(_: {}): any;
|
19
|
+
right?(_: {}): any;
|
17
20
|
}>;
|
18
21
|
export default _default;
|
19
22
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"AAwFA;AAOA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAM5C,UAAU,KAAM,SAAQ,SAAS;IAC/B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;;;;;;;;;AAyRD,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
@@ -1,15 +1,27 @@
|
|
1
|
-
import { defineComponent, computed, watch,
|
1
|
+
import { defineComponent, computed, watch, onBeforeUnmount, openBlock, createBlock, unref, normalizeClass, withCtx, createVNode, Transition, createElementBlock, createCommentVNode, createElementVNode, resolveDynamicComponent, renderSlot, toDisplayString, createTextVNode } from 'vue';
|
2
2
|
import { useRoute, useRouter, RouterLink } from 'vue-router';
|
3
3
|
import { isEqualObj, numberCompactFormatter } from '../../utils/utils.js';
|
4
4
|
import WSkeleton from '../Skeleton/WSkeleton.vue.js';
|
5
5
|
import _sfc_main$1 from '../Counter/WCounter.vue.js';
|
6
6
|
|
7
|
-
const _hoisted_1 = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
const
|
12
|
-
|
7
|
+
const _hoisted_1 = {
|
8
|
+
key: 0,
|
9
|
+
class: "bg-primary-default dark:bg-primary-dark w-1 h-full absolute left-0 top-0"
|
10
|
+
};
|
11
|
+
const _hoisted_2 = {
|
12
|
+
key: 0,
|
13
|
+
class: "h-full absolute left-7 top-0 w-1.5 grid items-center"
|
14
|
+
};
|
15
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("div", { class: "bg-primary-default dark:bg-primary-dark aspect-square rounded-full" }, null, -1);
|
16
|
+
const _hoisted_4 = [
|
17
|
+
_hoisted_3
|
18
|
+
];
|
19
|
+
const _hoisted_5 = { class: "[overflow:inherit]" };
|
20
|
+
const _hoisted_6 = { class: "grid grid-cols-[2rem,auto,1fr,1rem] items-center py-4 px-5" };
|
21
|
+
const _hoisted_7 = { class: "flex items-center" };
|
22
|
+
const _hoisted_8 = { class: "text-base font-normal tracking-wide whitespace-nowrap relative" };
|
23
|
+
const _hoisted_9 = { class: "text-base font-normal tracking-wide text-center flex justify-start relative" };
|
24
|
+
const _hoisted_10 = {
|
13
25
|
key: 0,
|
14
26
|
class: "relative"
|
15
27
|
};
|
@@ -20,13 +32,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
32
|
title: {},
|
21
33
|
count: {},
|
22
34
|
counter: {},
|
23
|
-
noQuery: { type: Boolean },
|
24
35
|
skeleton: { type: Boolean },
|
25
36
|
hasActive: { type: Boolean },
|
37
|
+
expand: { type: Boolean },
|
38
|
+
indent: { type: Boolean },
|
39
|
+
queryFields: {},
|
26
40
|
to: {}
|
27
41
|
},
|
28
42
|
emits: ["update:isActive"],
|
29
43
|
setup(__props, { emit: __emit }) {
|
44
|
+
const EXCLUDE_QUERY_FIELDS = ["ordering", "page"];
|
30
45
|
const props = __props;
|
31
46
|
const emit = __emit;
|
32
47
|
const route = useRoute();
|
@@ -35,47 +50,59 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
50
|
const isActive = computed(() => {
|
36
51
|
if (routeTo.value?.name !== route.name)
|
37
52
|
return false;
|
38
|
-
return isEqualObj(route.query, routeTo.value.query,
|
53
|
+
return isEqualObj(route.query, routeTo.value.query, EXCLUDE_QUERY_FIELDS, props.queryFields);
|
39
54
|
});
|
40
55
|
const isBigCount = computed(() => props.counter !== void 0 && props.counter >= 1e3);
|
41
|
-
watch(isActive, (value) => emit("update:isActive",
|
42
|
-
|
43
|
-
emit("update:isActive",
|
56
|
+
watch(isActive, (value) => emit("update:isActive", [props.title, value]), { immediate: true });
|
57
|
+
onBeforeUnmount(() => {
|
58
|
+
emit("update:isActive", [props.title, false]);
|
44
59
|
});
|
45
60
|
return (_ctx, _cache) => {
|
46
61
|
return openBlock(), createBlock(unref(RouterLink), {
|
47
62
|
to: _ctx.to,
|
48
63
|
class: normalizeClass(["relative no-underline block w-ripple w-ripple-hover", {
|
49
64
|
"text-primary-default dark:text-primary-dark": isActive.value || _ctx.hasActive,
|
50
|
-
"text-accent": !isActive.value && !_ctx.hasActive
|
65
|
+
"text-accent": !isActive.value && !_ctx.hasActive,
|
66
|
+
"pl-7": _ctx.indent
|
51
67
|
}])
|
52
68
|
}, {
|
53
69
|
default: withCtx(() => [
|
54
|
-
|
55
|
-
|
56
|
-
|
70
|
+
createVNode(Transition, {
|
71
|
+
"enter-active-class": "transition-transform duration-200",
|
72
|
+
"leave-active-class": "transition-transform duration-200",
|
73
|
+
"enter-from-class": "-translate-x-1",
|
74
|
+
"leave-to-class": "-translate-x-1"
|
75
|
+
}, {
|
76
|
+
default: withCtx(() => [
|
77
|
+
!_ctx.indent && (isActive.value || _ctx.hasActive) ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true)
|
78
|
+
]),
|
79
|
+
_: 1
|
80
|
+
}),
|
81
|
+
createVNode(Transition, {
|
82
|
+
"enter-active-class": "transition-opacity duration-200",
|
83
|
+
"leave-active-class": "transition-opacity duration-200",
|
84
|
+
"enter-from-class": "opacity-0",
|
85
|
+
"leave-to-class": "opacity-0"
|
86
|
+
}, {
|
87
|
+
default: withCtx(() => [
|
88
|
+
_ctx.indent && !_ctx.expand && isActive.value ? (openBlock(), createElementBlock("div", _hoisted_2, _hoisted_4)) : createCommentVNode("", true)
|
89
|
+
]),
|
90
|
+
_: 1
|
91
|
+
}),
|
92
|
+
createElementVNode("div", _hoisted_5, [
|
93
|
+
createElementVNode("div", _hoisted_6, [
|
94
|
+
createElementVNode("div", _hoisted_7, [
|
57
95
|
_ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
|
58
96
|
key: 0,
|
59
97
|
class: "square-6"
|
60
98
|
})) : renderSlot(_ctx.$slots, "icon", { key: 1 })
|
61
99
|
]),
|
62
|
-
createElementVNode("div",
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
count
|
67
|
-
|
68
|
-
small: "",
|
69
|
-
class: normalizeClass(["absolute -top-3", {
|
70
|
-
"left-[calc(100%-0.25rem)]": !isBigCount.value,
|
71
|
-
"left-[calc(100%-1rem)]": isBigCount.value
|
72
|
-
}])
|
73
|
-
}, null, 8, ["count", "class"])) : createCommentVNode("", true)
|
74
|
-
]),
|
75
|
-
createElementVNode("div", _hoisted_5, [
|
76
|
-
!_ctx.skeleton ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
77
|
-
createTextVNode(toDisplayString(typeof _ctx.count === "number" ? unref(numberCompactFormatter).format(_ctx.count) : "") + " ", 1),
|
78
|
-
_ctx.counter !== void 0 && _ctx.counter !== 0 && _ctx.count !== void 0 ? (openBlock(), createBlock(_sfc_main$1, {
|
100
|
+
createElementVNode("div", _hoisted_8, toDisplayString(_ctx.title), 1),
|
101
|
+
createElementVNode("div", _hoisted_9, [
|
102
|
+
createTextVNode(" "),
|
103
|
+
!_ctx.skeleton ? (openBlock(), createElementBlock("span", _hoisted_10, [
|
104
|
+
createTextVNode(toDisplayString(typeof _ctx.count === "number" ? `(${unref(numberCompactFormatter).format(_ctx.count)})` : "") + " ", 1),
|
105
|
+
_ctx.counter !== void 0 && _ctx.counter !== 0 ? (openBlock(), createBlock(_sfc_main$1, {
|
79
106
|
key: 0,
|
80
107
|
count: _ctx.counter,
|
81
108
|
trigger: 1,
|
@@ -85,8 +112,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
85
112
|
"left-[calc(100%-1rem)]": isBigCount.value
|
86
113
|
}])
|
87
114
|
}, null, 8, ["count", "class"])) : createCommentVNode("", true)
|
88
|
-
])) : (openBlock(), createBlock(WSkeleton, {
|
89
|
-
|
115
|
+
])) : (openBlock(), createBlock(WSkeleton, {
|
116
|
+
key: 1,
|
117
|
+
class: "max-w-10"
|
118
|
+
}))
|
119
|
+
]),
|
120
|
+
renderSlot(_ctx.$slots, "right")
|
90
121
|
])
|
91
122
|
])
|
92
123
|
]),
|
@@ -1,12 +1,20 @@
|
|
1
1
|
import type { LinkProps } from '../../types/types';
|
2
|
-
interface Props extends LinkProps {
|
2
|
+
interface Props extends Partial<LinkProps> {
|
3
3
|
icon?: SVGComponent;
|
4
4
|
title: string;
|
5
5
|
count?: number;
|
6
|
+
counter?: number;
|
6
7
|
skeleton?: boolean;
|
7
|
-
|
8
|
+
indent?: boolean;
|
9
|
+
queryFields?: string[];
|
8
10
|
}
|
9
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
12
|
+
"update:isActive": (value: [string, boolean]) => void;
|
13
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
|
14
|
+
"onUpdate:isActive"?: ((value: [string, boolean]) => any) | undefined;
|
15
|
+
}, {}, {}>, {
|
16
|
+
icon?(_: {}): any;
|
17
|
+
}>;
|
10
18
|
export default _default;
|
11
19
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
12
20
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
@@ -17,4 +25,9 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
25
|
required: true;
|
18
26
|
};
|
19
27
|
};
|
28
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
29
|
+
new (): {
|
30
|
+
$slots: S;
|
31
|
+
};
|
32
|
+
};
|
20
33
|
//# sourceMappingURL=WNavItemExpand.vue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WNavItemExpand.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Nav/WNavItemExpand.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WNavItemExpand.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Nav/WNavItemExpand.vue"],"names":[],"mappings":"AA6CA;AAOA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAK5C,UAAU,KAAM,SAAQ,OAAO,CAAC,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;;;;;;;;AA0MD,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
@@ -1,8 +1,17 @@
|
|
1
|
-
import { defineComponent,
|
1
|
+
import { defineComponent, useSlots, computed, ref, reactive, watch, onBeforeUnmount, openBlock, createElementBlock, createVNode, withCtx, renderSlot, unref, normalizeClass, Fragment, renderList, createBlock, resolveDynamicComponent } from 'vue';
|
2
2
|
import IconArrow from '../../assets/icons/default/IconArrow.svg.js';
|
3
3
|
import _sfc_main$1 from './WNavItem.vue.js';
|
4
4
|
import _sfc_main$2 from '../Expansion/WExpansion.vue.js';
|
5
5
|
import WNavItemTransition from './WNavItemTransition.vue.js';
|
6
|
+
import '../Button/WButtonAction.vue.js';
|
7
|
+
import '../Button/WButton.vue.js';
|
8
|
+
import { debounce } from '../../utils/utils.js';
|
9
|
+
import '../../utils/supportsPassive.js';
|
10
|
+
import '../Dropdown/utils/DropdownStyle.js';
|
11
|
+
import 'vue-router';
|
12
|
+
import '../../utils/Modal.js';
|
13
|
+
import '../Link/WLink.vue.js';
|
14
|
+
import '@tanstack/vue-query';
|
6
15
|
|
7
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
8
17
|
__name: "WNavItemExpand",
|
@@ -10,46 +19,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
19
|
icon: {},
|
11
20
|
title: {},
|
12
21
|
count: {},
|
22
|
+
counter: {},
|
13
23
|
skeleton: { type: Boolean },
|
14
|
-
|
24
|
+
indent: { type: Boolean },
|
25
|
+
queryFields: {},
|
15
26
|
to: {}
|
16
27
|
},
|
17
|
-
|
28
|
+
emits: ["update:isActive"],
|
29
|
+
setup(__props, { emit: __emit }) {
|
30
|
+
const props = __props;
|
31
|
+
const slots = useSlots();
|
32
|
+
const slotsDefault = computed(() => slots.default?.());
|
33
|
+
const emit = __emit;
|
18
34
|
const isOpen = ref(false);
|
19
|
-
const
|
20
|
-
const
|
21
|
-
const
|
22
|
-
|
23
|
-
|
35
|
+
const hasActiveCached = ref(false);
|
36
|
+
const isActiveChildrenMap = reactive({});
|
37
|
+
const hasActive = computed(() => isOpen.value || Object.values(isActiveChildrenMap).includes(true));
|
38
|
+
const updateHasActiveCache = debounce((value) => {
|
39
|
+
hasActiveCached.value = value;
|
40
|
+
emit("update:isActive", [props.title, value]);
|
41
|
+
}, 10);
|
42
|
+
watch(hasActive, updateHasActiveCache, { immediate: true });
|
43
|
+
onBeforeUnmount(() => {
|
44
|
+
emit("update:isActive", [props.title, false]);
|
45
|
+
});
|
24
46
|
return (_ctx, _cache) => {
|
25
47
|
return openBlock(), createElementBlock("div", null, [
|
26
48
|
createVNode(_sfc_main$1, {
|
27
|
-
to: _ctx.to,
|
49
|
+
to: _ctx.to ?? slotsDefault.value?.[0]?.props?.to,
|
28
50
|
title: _ctx.title,
|
29
51
|
icon: _ctx.icon,
|
30
|
-
"new-label": _ctx.newLabel,
|
31
52
|
skeleton: _ctx.skeleton,
|
32
53
|
count: _ctx.count,
|
33
|
-
|
34
|
-
"
|
54
|
+
counter: _ctx.counter,
|
55
|
+
"has-active": hasActiveCached.value,
|
56
|
+
indent: _ctx.indent,
|
57
|
+
expand: !_ctx.to,
|
58
|
+
"query-fields": _ctx.queryFields,
|
59
|
+
"onUpdate:isActive": _cache[0] || (_cache[0] = ($event) => {
|
60
|
+
isOpen.value = $event[1];
|
61
|
+
$event[1] && _ctx.$emit("update:isActive", [_ctx.title, $event[1]]);
|
62
|
+
})
|
35
63
|
}, {
|
36
64
|
icon: withCtx(() => [
|
65
|
+
renderSlot(_ctx.$slots, "icon")
|
66
|
+
]),
|
67
|
+
right: withCtx(() => [
|
37
68
|
createVNode(unref(IconArrow), {
|
38
|
-
class: normalizeClass(["square-
|
69
|
+
class: normalizeClass(["square-3 transition-transform", {
|
70
|
+
"-rotate-90": !hasActiveCached.value
|
71
|
+
}])
|
39
72
|
}, null, 8, ["class"])
|
40
73
|
]),
|
41
|
-
_:
|
42
|
-
}, 8, ["to", "title", "icon", "
|
43
|
-
createVNode(_sfc_main$2, {
|
44
|
-
"is-shown": isOpen.value || hasActive.value
|
45
|
-
}, {
|
74
|
+
_: 3
|
75
|
+
}, 8, ["to", "title", "icon", "skeleton", "count", "counter", "has-active", "indent", "expand", "query-fields"]),
|
76
|
+
createVNode(_sfc_main$2, { "is-shown": hasActiveCached.value }, {
|
46
77
|
default: withCtx(() => [
|
47
78
|
createVNode(WNavItemTransition, null, {
|
48
79
|
default: withCtx(() => [
|
49
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
80
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(slotsDefault.value, (slot, index) => {
|
50
81
|
return openBlock(), createBlock(resolveDynamicComponent(slot), {
|
51
82
|
key: index,
|
52
|
-
|
83
|
+
indent: "",
|
84
|
+
"onUpdate:isActive": _cache[1] || (_cache[1] = ($event) => isActiveChildrenMap[$event[0]] = $event[1])
|
53
85
|
}, null, 32);
|
54
86
|
}), 128))
|
55
87
|
]),
|
package/dist/utils/utils.d.ts
CHANGED
@@ -5,7 +5,7 @@ type DebounceCb = (...args: any[]) => void;
|
|
5
5
|
export declare function debounce<T extends DebounceCb>(cb: T, delay?: number): T;
|
6
6
|
export declare function throttle<T extends DebounceCb>(cb: T, delay?: number): T;
|
7
7
|
export declare const isEqualArr: (arr1: unknown[], arr2: unknown[]) => boolean;
|
8
|
-
export declare const isEqualObj: (obj1: Record<string, unknown>, obj2: Record<string, unknown>, exclude?: string[]) => boolean;
|
8
|
+
export declare const isEqualObj: (obj1: Record<string, unknown>, obj2: Record<string, unknown>, exclude?: string[], include?: string[]) => boolean;
|
9
9
|
export declare const percentCompactFormatter: Intl.NumberFormat;
|
10
10
|
export declare const numberCompactFormatter: Intl.NumberFormat;
|
11
11
|
export declare const numberFormatter: Intl.NumberFormat;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,SAAU,OAAO,KAAG,OAAO,GAAG,IAKhD,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAAW,OAAO,mBAAa,MAAM,OAAO,CAa3E,CAAA;AAED,eAAO,MAAM,SAAS,WAAY,OAAO,WAAW,OAAO,KAAG,OAI7D,CAAA;AAGD,KAAK,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;AAE1C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAWpE;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAYpE;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,EAAE,QAAQ,OAAO,EAAE,KAAG,OAE7D,CAAA;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,MAAM,EAAE,OAAO,CAAC,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,YAAY,MAAM,EAAE,KAAG,
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,SAAU,OAAO,KAAG,OAAO,GAAG,IAKhD,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAAW,OAAO,mBAAa,MAAM,OAAO,CAa3E,CAAA;AAED,eAAO,MAAM,SAAS,WAAY,OAAO,WAAW,OAAO,KAAG,OAI7D,CAAA;AAGD,KAAK,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;AAE1C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAWpE;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAYpE;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,EAAE,QAAQ,OAAO,EAAE,KAAG,OAE7D,CAAA;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,MAAM,EAAE,OAAO,CAAC,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,YAAY,MAAM,EAAE,YAAY,MAAM,EAAE,KAAG,OAWjI,CAAA;AAED,eAAO,MAAM,uBAAuB,mBAAmE,CAAA;AACvG,eAAO,MAAM,sBAAsB,mBAAiD,CAAA;AACpF,eAAO,MAAM,eAAe,mBAA0B,CAAA;AAEtD,eAAO,MAAM,YAAY,EAAE,OAAuC,CAAA;AAIlE,eAAO,MAAM,KAAK,cAEjB,CAAA"}
|
package/dist/utils/utils.js
CHANGED
@@ -49,8 +49,10 @@ function throttle(cb, delay = 200) {
|
|
49
49
|
const isEqualArr = (arr1, arr2) => {
|
50
50
|
return arr1.length === arr2.length && arr1.every((item) => arr2.includes(item));
|
51
51
|
};
|
52
|
-
const isEqualObj = (obj1, obj2, exclude) => {
|
52
|
+
const isEqualObj = (obj1, obj2, exclude, include) => {
|
53
53
|
return Object.keys({ ...obj1, ...obj2 }).every((key) => {
|
54
|
+
if (include && !include.includes(key))
|
55
|
+
return true;
|
54
56
|
if (exclude?.includes(key) || obj1[key] === obj2[key])
|
55
57
|
return true;
|
56
58
|
if (Array.isArray(obj1[key]) && Array.isArray(obj2[key]))
|