eco-vue-js 0.5.8 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -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: Record<string, boolean>) => void;
14
+ "update:isActive": (value: [string, boolean]) => void;
13
15
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
14
- "onUpdate:isActive"?: ((value: Record<string, boolean>) => any) | undefined;
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":"AAmEA;AAOA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAI5C,UAAU,KAAM,SAAQ,SAAS;IAC/B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,C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AC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;;;;;;;;;AA4RD,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, onUnmounted, openBlock, createBlock, unref, normalizeClass, withCtx, createElementVNode, resolveDynamicComponent, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementBlock } from 'vue';
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 = { class: "[overflow:inherit]" };
8
- const _hoisted_2 = { class: "grid grid-cols-[2.5rem,1fr,3rem] items-center py-4 px-5" };
9
- const _hoisted_3 = { class: "flex items-center" };
10
- const _hoisted_4 = { class: "text-base font-normal tracking-wide whitespace-nowrap relative" };
11
- const _hoisted_5 = { class: "text-base font-normal tracking-wide text-center flex justify-center" };
12
- const _hoisted_6 = {
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 flex items-center"
14
+ };
15
+ const _hoisted_3 = /* @__PURE__ */ createElementVNode("div", { class: "bg-[var(--w-nav-item-dot-color)] square-1.5 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,60 @@ 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, ["ordering", "page"]);
53
+ return isEqualObj(route.query, routeTo.value.query, EXCLUDE_QUERY_FIELDS, props.queryFields);
39
54
  });
55
+ const isTextColor = computed(() => props.hasActive ? !props.indent : isActive.value);
40
56
  const isBigCount = computed(() => props.counter !== void 0 && props.counter >= 1e3);
41
- watch(isActive, (value) => emit("update:isActive", { [props.title]: value }), { immediate: true });
42
- onUnmounted(() => {
43
- emit("update:isActive", { [props.title]: false });
57
+ watch(isActive, (value) => emit("update:isActive", [props.title, value]), { immediate: true });
58
+ onBeforeUnmount(() => {
59
+ emit("update:isActive", [props.title, false]);
44
60
  });
45
61
  return (_ctx, _cache) => {
46
62
  return openBlock(), createBlock(unref(RouterLink), {
47
63
  to: _ctx.to,
48
64
  class: normalizeClass(["relative no-underline block w-ripple w-ripple-hover", {
49
- "text-primary-default dark:text-primary-dark": isActive.value || _ctx.hasActive,
50
- "text-accent": !isActive.value && !_ctx.hasActive
65
+ "text-primary-default dark:text-primary-dark": isTextColor.value,
66
+ "text-accent": !isTextColor.value,
67
+ "pl-7": _ctx.indent
51
68
  }])
52
69
  }, {
53
70
  default: withCtx(() => [
54
- createElementVNode("div", _hoisted_1, [
55
- createElementVNode("div", _hoisted_2, [
56
- createElementVNode("div", _hoisted_3, [
71
+ createVNode(Transition, {
72
+ "enter-active-class": "transition-transform duration-200",
73
+ "leave-active-class": "transition-transform duration-200",
74
+ "enter-from-class": "-translate-x-1",
75
+ "leave-to-class": "-translate-x-1"
76
+ }, {
77
+ default: withCtx(() => [
78
+ !_ctx.indent && (isActive.value || _ctx.hasActive) ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true)
79
+ ]),
80
+ _: 1
81
+ }),
82
+ createVNode(Transition, {
83
+ "enter-active-class": "transition-opacity duration-200",
84
+ "leave-active-class": "transition-opacity duration-200",
85
+ "enter-from-class": "opacity-0",
86
+ "leave-to-class": "opacity-0"
87
+ }, {
88
+ default: withCtx(() => [
89
+ _ctx.indent && !_ctx.expand && isActive.value ? (openBlock(), createElementBlock("div", _hoisted_2, _hoisted_4)) : createCommentVNode("", true)
90
+ ]),
91
+ _: 1
92
+ }),
93
+ createElementVNode("div", _hoisted_5, [
94
+ createElementVNode("div", _hoisted_6, [
95
+ createElementVNode("div", _hoisted_7, [
57
96
  _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
58
97
  key: 0,
59
98
  class: "square-6"
60
99
  })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
61
100
  ]),
62
- createElementVNode("div", _hoisted_4, [
63
- createTextVNode(toDisplayString(_ctx.title) + " ", 1),
64
- _ctx.counter !== void 0 && _ctx.counter !== 0 && _ctx.count === void 0 ? (openBlock(), createBlock(_sfc_main$1, {
65
- key: 0,
66
- count: _ctx.counter,
67
- trigger: 1,
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, {
101
+ createElementVNode("div", _hoisted_8, toDisplayString(_ctx.title), 1),
102
+ createElementVNode("div", _hoisted_9, [
103
+ createTextVNode("   "),
104
+ !_ctx.skeleton ? (openBlock(), createElementBlock("span", _hoisted_10, [
105
+ createTextVNode(toDisplayString(typeof _ctx.count === "number" ? `(${unref(numberCompactFormatter).format(_ctx.count)})` : "") + " ", 1),
106
+ _ctx.counter !== void 0 && _ctx.counter !== 0 ? (openBlock(), createBlock(_sfc_main$1, {
79
107
  key: 0,
80
108
  count: _ctx.counter,
81
109
  trigger: 1,
@@ -85,8 +113,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
85
113
  "left-[calc(100%-1rem)]": isBigCount.value
86
114
  }])
87
115
  }, null, 8, ["count", "class"])) : createCommentVNode("", true)
88
- ])) : (openBlock(), createBlock(WSkeleton, { key: 1 }))
89
- ])
116
+ ])) : (openBlock(), createBlock(WSkeleton, {
117
+ key: 1,
118
+ class: "max-w-10"
119
+ }))
120
+ ]),
121
+ renderSlot(_ctx.$slots, "right")
90
122
  ])
91
123
  ])
92
124
  ]),
@@ -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
- newLabel?: boolean;
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, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
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":"AAmCA;AAOA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAI5C,UAAU,KAAM,SAAQ,SAAS;IAC/B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;;AAyJD,wBAMG;AACH,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"}
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, ref, computed, openBlock, createElementBlock, createVNode, withCtx, unref, normalizeClass, Fragment, renderList, createBlock, resolveDynamicComponent } from 'vue';
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
- newLabel: { type: Boolean },
24
+ indent: { type: Boolean },
25
+ queryFields: {},
15
26
  to: {}
16
27
  },
17
- setup(__props) {
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 isActiveChildrenMap = ref({});
20
- const hasActive = computed(() => Object.values(isActiveChildrenMap.value).includes(true));
21
- const updateIsActive = (value) => {
22
- isActiveChildrenMap.value = { ...isActiveChildrenMap.value, ...value };
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
- "has-active": hasActive.value || isOpen.value,
34
- "onUpdate:isActive": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event[_ctx.title])
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-4 mx-1 transition-transform", { "rotate-180": hasActive.value || isOpen.value }])
69
+ class: normalizeClass(["square-3 transition-transform", {
70
+ "-rotate-90": !hasActiveCached.value
71
+ }])
39
72
  }, null, 8, ["class"])
40
73
  ]),
41
- _: 1
42
- }, 8, ["to", "title", "icon", "new-label", "skeleton", "count", "has-active"]),
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(_ctx.$slots.default?.(), (slot, index) => {
80
+ (openBlock(true), createElementBlock(Fragment, null, renderList(slotsDefault.value, (slot, index) => {
50
81
  return openBlock(), createBlock(resolveDynamicComponent(slot), {
51
82
  key: index,
52
- "onUpdate:isActive": updateIsActive
83
+ indent: "",
84
+ "onUpdate:isActive": _cache[1] || (_cache[1] = ($event) => isActiveChildrenMap[$event[0]] = $event[1])
53
85
  }, null, 32);
54
86
  }), 128))
55
87
  ]),
@@ -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,C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O,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"}
@@ -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]))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.5.8",
7
+ "version": "0.5.10",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "run-p type-check build-only",