eco-vue-js 0.9.2 → 0.9.4

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.
Files changed (42) hide show
  1. package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts +3 -139
  2. package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
  3. package/dist/components/Form/WForm.vue.d.ts +4 -0
  4. package/dist/components/Form/WForm.vue.d.ts.map +1 -1
  5. package/dist/components/Form/WForm.vue.js +7 -1
  6. package/dist/components/Form/WFormValidator.vue.d.ts +3 -1
  7. package/dist/components/Form/WFormValidator.vue.d.ts.map +1 -1
  8. package/dist/components/Form/WFormValidator.vue.js +15 -3
  9. package/dist/components/Form/models/injection.d.ts +1 -0
  10. package/dist/components/Form/models/injection.d.ts.map +1 -1
  11. package/dist/components/Form/models/injection.js +2 -1
  12. package/dist/components/Form/use/useFormHasValueMap.d.ts +6 -0
  13. package/dist/components/Form/use/useFormHasValueMap.d.ts.map +1 -0
  14. package/dist/components/Form/use/useFormHasValueMap.js +31 -0
  15. package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.d.ts +2 -2
  16. package/dist/components/HeaderBar/WHeaderBar.vue.d.ts +1 -4
  17. package/dist/components/HeaderBar/WHeaderBar.vue.d.ts.map +1 -1
  18. package/dist/components/Input/WInputDate.vue.d.ts +2 -12
  19. package/dist/components/Input/WInputDate.vue.d.ts.map +1 -1
  20. package/dist/components/Input/WInputOptions.vue.d.ts +1 -1
  21. package/dist/components/Modal/WModalStepper.vue.d.ts +3 -690
  22. package/dist/components/Modal/WModalStepper.vue.d.ts.map +1 -1
  23. package/dist/components/Modal/WModalStepper.vue.js +7 -5
  24. package/dist/components/Select/WSelectAsyncSingle.vue.d.ts +4 -4
  25. package/dist/components/Select/WSelectSingle.vue.d.ts +4 -4
  26. package/dist/components/Select/WSelectStringified.vue.d.ts +4 -4
  27. package/dist/components/Tabs/WTabs.vue.d.ts +3 -259
  28. package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
  29. package/dist/components/Tabs/WTabs.vue.js +87 -67
  30. package/dist/components/Tabs/WTabsItem.vue.d.ts +9 -6
  31. package/dist/components/Tabs/WTabsItem.vue.d.ts.map +1 -1
  32. package/dist/components/Tabs/WTabsItem.vue.js +2 -1
  33. package/dist/components/Tabs/WTabsStepper.vue.d.ts +18 -307
  34. package/dist/components/Tabs/WTabsStepper.vue.d.ts.map +1 -1
  35. package/dist/components/Tabs/WTabsStepper.vue.js +8 -8
  36. package/dist/components/Tabs/components/TabItem.vue.d.ts.map +1 -1
  37. package/dist/components/Tabs/components/TabItem.vue.js +8 -6
  38. package/dist/components/Tabs/components/TabTitleButton.vue.d.ts.map +1 -1
  39. package/dist/components/Tabs/components/TabTitleButton.vue.js +4 -4
  40. package/dist/components/Tabs/types.d.ts +5 -0
  41. package/dist/components/Tabs/types.d.ts.map +1 -1
  42. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WModalStepper.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/WModalStepper.vue"],"names":[],"mappings":"AAgLA,iBAAS,cAAc;;uBAyPI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAmEyiS,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAAtH,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAAtH,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,G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BAAS,cAAc;;uBA4PI,GAAG;yBACA,GAAG;;;;;WAUnB,OAAO,IAA6B;EAEjD;AAsBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cA7UT,OAAO;eACN,OAAO;mBACH,OAAO;;gBAqBP,IAAI;oBAJA,IAAI;;;;;;cAnBb,OAAO;eACN,OAAO;mBACH,OAAO;;;;;;;OAwVtB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, useSlots, useTemplateRef, computed, ref, openBlock, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createVNode, unref } from 'vue';
1
+ import { defineComponent, useTemplateRef, ref, openBlock, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createVNode, unref } from 'vue';
2
2
  import _sfc_main$3 from '../Button/WButton.vue.js';
3
3
  import _sfc_main$1 from './WModalWrapper.vue.js';
4
4
  import _sfc_main$2 from '../Progress/WProgress.vue.js';
@@ -14,9 +14,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  },
15
15
  emits: ["close:modal", "submit", "update:has-changes"],
16
16
  setup(__props, { expose: __expose }) {
17
- const slots = useSlots();
18
17
  const tabsStepperRef = useTemplateRef("tabsStepper");
19
- const defaultSlots = computed(() => slots.default?.() ?? []);
20
18
  const first = ref(true);
21
19
  const last = ref(false);
22
20
  const currentTitle = ref();
@@ -94,13 +92,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
92
  default: withCtx(() => [
95
93
  createVNode(_sfc_main$4, {
96
94
  ref: "tabsStepper",
97
- "custom-slots": defaultSlots.value,
98
95
  "onUpdate:first": _cache[0] || (_cache[0] = ($event) => first.value = $event),
99
96
  "onUpdate:last": _cache[1] || (_cache[1] = ($event) => last.value = $event),
100
97
  "onUpdate:currentTitle": _cache[2] || (_cache[2] = ($event) => currentTitle.value = $event),
101
98
  "onUpdate:hasChanges": _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:has-changes", $event)),
102
99
  "onUpdate:progress": _cache[4] || (_cache[4] = ($event) => progress.value = $event)
103
- }, null, 8, ["custom-slots"])
100
+ }, {
101
+ default: withCtx(() => [
102
+ renderSlot(_ctx.$slots, "default")
103
+ ]),
104
+ _: 3
105
+ }, 512)
104
106
  ]),
105
107
  _: 3
106
108
  });
@@ -12,10 +12,10 @@ declare const _default: <Model extends number | string, Data extends DefaultData
12
12
  title?(_: {}): any;
13
13
  subtitle?(_: {}): any;
14
14
  option?(_: {
15
- option: Data | null;
16
- selected: boolean;
17
- model: boolean;
18
- search: string | undefined;
15
+ option: any;
16
+ selected: any;
17
+ model: any;
18
+ search: any;
19
19
  }): any;
20
20
  right?(_: {}): any;
21
21
  };
@@ -13,10 +13,10 @@ declare const _default: <Model extends number | string, Data extends DefaultData
13
13
  title?(_: {}): any;
14
14
  subtitle?(_: {}): any;
15
15
  option?(_: {
16
- option: Data | null;
17
- selected: boolean;
18
- model: boolean;
19
- search: string | undefined;
16
+ option: any;
17
+ selected: any;
18
+ model: any;
19
+ search: any;
20
20
  }): any;
21
21
  right?(_: {}): any;
22
22
  };
@@ -13,10 +13,10 @@ declare const _default: <Model extends string, Data extends DefaultData, QueryPa
13
13
  title?(_: {}): any;
14
14
  subtitle?(_: {}): any;
15
15
  option?(_: {
16
- option: Data | null;
17
- selected: boolean;
18
- model: boolean;
19
- search: string | undefined;
16
+ option: any;
17
+ selected: any;
18
+ model: any;
19
+ search: any;
20
20
  }): any;
21
21
  right?(_: {}): any;
22
22
  };
@@ -1,5 +1,4 @@
1
1
  import { TabsProps } from './types';
2
- import { CSSProperties, nextTick } from 'vue';
3
2
  import { default as WForm } from '../Form/WForm.vue';
4
3
  declare const _default: import('vue').DefineComponent<TabsProps, {
5
4
  updateCurrent: (value: string) => void;
@@ -25,264 +24,9 @@ declare const _default: import('vue').DefineComponent<TabsProps, {
25
24
  "onUpdate:tabs-length"?: ((value: number) => any) | undefined;
26
25
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
27
26
  buttonContainer: HTMLDivElement;
28
- button: (({
29
- $: import('vue').ComponentInternalInstance;
30
- $data: {};
31
- $props: {
32
- readonly active: boolean;
33
- readonly index: number;
34
- readonly hasError: boolean;
35
- readonly hasChanges: boolean;
36
- readonly title: string;
37
- readonly icon: SVGComponent | undefined;
38
- readonly side?: boolean | undefined;
39
- readonly onClick?: ((value: MouseEvent) => any) | undefined;
40
- readonly "onUpdate:indicator-style"?: ((value: CSSProperties) => any) | undefined;
41
- readonly "onUpdate:scroll-position"?: ((value: {
42
- left: number;
43
- } | {
44
- top: number;
45
- }) => any) | undefined;
46
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
47
- $attrs: {
48
- [x: string]: unknown;
49
- };
50
- $refs: {
51
- [x: string]: unknown;
52
- } & {
53
- button: HTMLButtonElement;
54
- };
55
- $slots: Readonly<{
56
- [name: string]: import('vue').Slot<any> | undefined;
57
- }>;
58
- $root: import('vue').ComponentPublicInstance | null;
59
- $parent: import('vue').ComponentPublicInstance | null;
60
- $host: Element | null;
61
- $emit: ((event: "click", value: MouseEvent) => void) & ((event: "update:indicator-style", value: CSSProperties) => void) & ((event: "update:scroll-position", value: {
62
- left: number;
63
- } | {
64
- top: number;
65
- }) => void);
66
- $el: any;
67
- $options: import('vue').ComponentOptionsBase<Readonly<{
68
- active: boolean;
69
- index: number;
70
- hasError: boolean;
71
- hasChanges: boolean;
72
- title: string;
73
- icon: SVGComponent | undefined;
74
- side?: boolean;
75
- }> & Readonly<{
76
- onClick?: ((value: MouseEvent) => any) | undefined;
77
- "onUpdate:indicator-style"?: ((value: CSSProperties) => any) | undefined;
78
- "onUpdate:scroll-position"?: ((value: {
79
- left: number;
80
- } | {
81
- top: number;
82
- }) => any) | undefined;
83
- }>, {
84
- update: () => void;
85
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
86
- click: (value: MouseEvent) => any;
87
- "update:indicator-style": (value: CSSProperties) => any;
88
- "update:scroll-position": (value: {
89
- left: number;
90
- } | {
91
- top: number;
92
- }) => any;
93
- }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
94
- beforeCreate?: (() => void) | (() => void)[];
95
- created?: (() => void) | (() => void)[];
96
- beforeMount?: (() => void) | (() => void)[];
97
- mounted?: (() => void) | (() => void)[];
98
- beforeUpdate?: (() => void) | (() => void)[];
99
- updated?: (() => void) | (() => void)[];
100
- activated?: (() => void) | (() => void)[];
101
- deactivated?: (() => void) | (() => void)[];
102
- beforeDestroy?: (() => void) | (() => void)[];
103
- beforeUnmount?: (() => void) | (() => void)[];
104
- destroyed?: (() => void) | (() => void)[];
105
- unmounted?: (() => void) | (() => void)[];
106
- renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
107
- renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
108
- errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
109
- };
110
- $forceUpdate: () => void;
111
- $nextTick: typeof nextTick;
112
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
113
- } & Readonly<{}> & Omit<Readonly<{
114
- active: boolean;
115
- index: number;
116
- hasError: boolean;
117
- hasChanges: boolean;
118
- title: string;
119
- icon: SVGComponent | undefined;
120
- side?: boolean;
121
- }> & Readonly<{
122
- onClick?: ((value: MouseEvent) => any) | undefined;
123
- "onUpdate:indicator-style"?: ((value: CSSProperties) => any) | undefined;
124
- "onUpdate:scroll-position"?: ((value: {
125
- left: number;
126
- } | {
127
- top: number;
128
- }) => any) | undefined;
129
- }>, "update"> & import('vue').ShallowUnwrapRef<{
130
- update: () => void;
131
- }> & {} & import('vue').ComponentCustomProperties & {} & {
132
- $slots: {
133
- title?(_: {}): any;
134
- suffix?(_: {}): any;
135
- right?(_: {}): any;
136
- };
137
- }) | null)[];
138
- tabItem: (({
139
- $: import('vue').ComponentInternalInstance;
140
- $data: {};
141
- $props: {
142
- readonly active: boolean;
143
- readonly removable: boolean;
144
- readonly "onUpdate:height"?: ((value: number) => any) | undefined;
145
- readonly "onUpdate:active"?: (() => any) | undefined;
146
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
147
- $attrs: {
148
- [x: string]: unknown;
149
- };
150
- $refs: {
151
- [x: string]: unknown;
152
- } & {
153
- element: HTMLDivElement;
154
- };
155
- $slots: Readonly<{
156
- [name: string]: import('vue').Slot<any> | undefined;
157
- }>;
158
- $root: import('vue').ComponentPublicInstance | null;
159
- $parent: import('vue').ComponentPublicInstance | null;
160
- $host: Element | null;
161
- $emit: ((event: "update:height", value: number) => void) & ((event: "update:active") => void);
162
- $el: any;
163
- $options: import('vue').ComponentOptionsBase<Readonly<{
164
- active: boolean;
165
- removable: boolean;
166
- }> & Readonly<{
167
- "onUpdate:height"?: ((value: number) => any) | undefined;
168
- "onUpdate:active"?: (() => any) | undefined;
169
- }>, {
170
- emitHeight: () => void;
171
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
172
- "update:height": (value: number) => any;
173
- "update:active": () => any;
174
- }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
175
- beforeCreate?: (() => void) | (() => void)[];
176
- created?: (() => void) | (() => void)[];
177
- beforeMount?: (() => void) | (() => void)[];
178
- mounted?: (() => void) | (() => void)[];
179
- beforeUpdate?: (() => void) | (() => void)[];
180
- updated?: (() => void) | (() => void)[];
181
- activated?: (() => void) | (() => void)[];
182
- deactivated?: (() => void) | (() => void)[];
183
- beforeDestroy?: (() => void) | (() => void)[];
184
- beforeUnmount?: (() => void) | (() => void)[];
185
- destroyed?: (() => void) | (() => void)[];
186
- unmounted?: (() => void) | (() => void)[];
187
- renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
188
- renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
189
- errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
190
- };
191
- $forceUpdate: () => void;
192
- $nextTick: typeof nextTick;
193
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
194
- } & Readonly<{}> & Omit<Readonly<{
195
- active: boolean;
196
- removable: boolean;
197
- }> & Readonly<{
198
- "onUpdate:height"?: ((value: number) => any) | undefined;
199
- "onUpdate:active"?: (() => any) | undefined;
200
- }>, "emitHeight"> & import('vue').ShallowUnwrapRef<{
201
- emitHeight: () => void;
202
- }> & {} & import('vue').ComponentCustomProperties & {} & {
203
- $slots: {
204
- default?(_: {}): any;
205
- };
206
- }) | null)[];
207
- form: (({
208
- $: import('vue').ComponentInternalInstance;
209
- $data: {};
210
- $props: {
211
- readonly name?: string | undefined;
212
- readonly title?: string | undefined;
213
- readonly "onUpdate:has-changes"?: ((value: boolean) => any) | undefined;
214
- readonly "onUpdate:is-valid"?: ((value: boolean | undefined) => any) | undefined;
215
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
216
- $attrs: {
217
- [x: string]: unknown;
218
- };
219
- $refs: {
220
- [x: string]: unknown;
221
- };
222
- $slots: Readonly<{
223
- [name: string]: import('vue').Slot<any> | undefined;
224
- }>;
225
- $root: import('vue').ComponentPublicInstance | null;
226
- $parent: import('vue').ComponentPublicInstance | null;
227
- $host: Element | null;
228
- $emit: ((event: "update:has-changes", value: boolean) => void) & ((event: "update:is-valid", value: boolean | undefined) => void);
229
- $el: any;
230
- $options: import('vue').ComponentOptionsBase<Readonly<{
231
- name?: string;
232
- title?: string;
233
- }> & Readonly<{
234
- "onUpdate:has-changes"?: ((value: boolean) => any) | undefined;
235
- "onUpdate:is-valid"?: ((value: boolean | undefined) => any) | undefined;
236
- }>, {
237
- isValid: import('vue').ComputedRef<boolean>;
238
- validate: (silent?: boolean, path?: import('../Form/use/useFormValidateMap').ValidatePath) => string | undefined;
239
- invalidate: (payload: {
240
- [x: string]: string | string[] | undefined;
241
- }) => void;
242
- initModel: () => void;
243
- errorMessage: import('vue').ComputedRef<string>;
244
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
245
- "update:has-changes": (value: boolean) => any;
246
- "update:is-valid": (value: boolean | undefined) => any;
247
- }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
248
- beforeCreate?: (() => void) | (() => void)[];
249
- created?: (() => void) | (() => void)[];
250
- beforeMount?: (() => void) | (() => void)[];
251
- mounted?: (() => void) | (() => void)[];
252
- beforeUpdate?: (() => void) | (() => void)[];
253
- updated?: (() => void) | (() => void)[];
254
- activated?: (() => void) | (() => void)[];
255
- deactivated?: (() => void) | (() => void)[];
256
- beforeDestroy?: (() => void) | (() => void)[];
257
- beforeUnmount?: (() => void) | (() => void)[];
258
- destroyed?: (() => void) | (() => void)[];
259
- unmounted?: (() => void) | (() => void)[];
260
- renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
261
- renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
262
- errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
263
- };
264
- $forceUpdate: () => void;
265
- $nextTick: typeof nextTick;
266
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
267
- } & Readonly<{}> & Omit<Readonly<{
268
- name?: string;
269
- title?: string;
270
- }> & Readonly<{
271
- "onUpdate:has-changes"?: ((value: boolean) => any) | undefined;
272
- "onUpdate:is-valid"?: ((value: boolean | undefined) => any) | undefined;
273
- }>, "errorMessage" | "isValid" | "validate" | "invalidate" | "initModel"> & import('vue').ShallowUnwrapRef<{
274
- isValid: import('vue').ComputedRef<boolean>;
275
- validate: (silent?: boolean, path?: import('../Form/use/useFormValidateMap').ValidatePath) => string | undefined;
276
- invalidate: (payload: {
277
- [x: string]: string | string[] | undefined;
278
- }) => void;
279
- initModel: () => void;
280
- errorMessage: import('vue').ComputedRef<string>;
281
- }> & {} & import('vue').ComponentCustomProperties & {} & {
282
- $slots: {
283
- default?(_: {}): any;
284
- };
285
- }) | null)[];
27
+ button: any[];
28
+ tabItem: any[];
29
+ form: any[];
286
30
  }, any>;
287
31
  export default _default;
288
32
  //# sourceMappingURL=WTabs.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WTabs.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/WTabs.vue"],"names":[],"mappings":"AAiSA,OAAO,KAAK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,MAAM,6GAAqE,UAAU,CAAC,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;wBAIhI,MAAM;;UAAuE,UAAU,CAAC,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;uBAIvI,MAAM,KAAsE,UAAU,CAAC,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC;;;;;;;;;;;;;;;;;;;AAob9J,wBAeG"}
@@ -1,6 +1,6 @@
1
- import { defineComponent, useSlots, useTemplateRef, computed, ref, reactive, inject, watch, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createBlock, unref, createSlots, withCtx, resolveDynamicComponent, createElementVNode, normalizeStyle, createCommentVNode, createVNode, TransitionGroup, nextTick } from 'vue';
1
+ import { defineComponent, useSlots, useTemplateRef, computed, ref, inject, watch, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createBlock, unref, createSlots, withCtx, resolveDynamicComponent, mergeProps, createElementVNode, normalizeStyle, createCommentVNode, createVNode, TransitionGroup } from 'vue';
2
2
  import _sfc_main$3 from '../Form/WForm.vue.js';
3
- import { throttle, debounce } from '../../utils/utils.js';
3
+ import { debounce, throttle } from '../../utils/utils.js';
4
4
  import _sfc_main$2 from './components/TabItem.vue.js';
5
5
  import _sfc_main$1 from './components/TabTitleButton.vue.js';
6
6
  import { wTabItemListener, wTabItemUnlistener } from './models/injection.js';
@@ -22,14 +22,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
22
  const emit = __emit;
23
23
  const slots = useSlots();
24
24
  const buttonContainerRef = useTemplateRef("buttonContainer");
25
- const defaultSlots = computed(() => {
26
- const result = [];
27
- (props.customSlots ?? slots.default?.() ?? []).forEach((item) => {
28
- if (Array.isArray(item.children)) result.push(...item.children);
29
- if (typeof item.type === "symbol") return;
30
- result.push(item);
25
+ const defaultSlotsRaw = computed(() => props.customSlots ?? slots.default?.() ?? []);
26
+ const unwrapSlots = (slots2) => {
27
+ return slots2.flatMap((slot) => {
28
+ if (Array.isArray(slot?.children)) return unwrapSlots(slot.children);
29
+ else if (typeof slot.type !== "symbol") return slot;
30
+ else return [];
31
31
  });
32
- return result;
32
+ };
33
+ const isTabItem = (slot) => {
34
+ return slot.type instanceof Object && "__name" in slot.type && slot.type.__name === "WTabsItem";
35
+ };
36
+ const defaultSlotsAll = computed(() => {
37
+ return unwrapSlots(defaultSlotsRaw.value);
38
+ });
39
+ const defaultSlots = computed(() => {
40
+ return defaultSlotsAll.value.filter(isTabItem);
33
41
  });
34
42
  const defaultSlotsKeys = computed(() => defaultSlots.value.map((item) => item.props?.name));
35
43
  const current = ref(defaultSlotsKeys.value[props.initTab ?? 0]);
@@ -40,15 +48,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
40
48
  const minHeight = ref(0);
41
49
  const tabItemRef = useTemplateRef("tabItem");
42
50
  const formRef = useTemplateRef("form");
43
- const isValidMap = reactive({});
44
- const hasChangesMap = reactive({});
45
- const hasChanges = computed(() => Object.values(hasChangesMap).includes(true));
46
- const updateIsValidMap = (key, value) => {
47
- isValidMap[key] = value;
48
- nextTick().then(() => {
49
- if (value === false && isValidMap[current.value] !== false) switchTab(key);
50
- });
51
- };
51
+ const currentIsValud = computed(() => formRef.value?.[defaultSlotsKeys.value.indexOf(current.value)]?.isValid);
52
+ const switchOnInvalid = debounce((key) => {
53
+ if (currentIsValud.value !== false) switchTab(key);
54
+ }, 50);
52
55
  const switchTab = throttle((key) => {
53
56
  if (current.value === key) return;
54
57
  updateCurrent(key);
@@ -107,9 +110,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
107
110
  watch(currentIndex, (value) => {
108
111
  emit("update:current-index", value);
109
112
  }, { immediate: true });
110
- watch(hasChanges, (value) => {
111
- emit("update:has-changes", value);
112
- }, { immediate: true });
113
113
  watch(defaultSlotsKeys, (newValue, oldValue) => {
114
114
  const newIndex = newValue.findIndex((item) => !oldValue.includes(item));
115
115
  if (props.switchToNew && newIndex !== -1) {
@@ -149,53 +149,74 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
149
149
  !_ctx.noHeader ? (openBlock(), createElementBlock("div", {
150
150
  key: 0,
151
151
  ref: "buttonContainer",
152
- class: normalizeClass(["no-scrollbar relative flex snap-x snap-mandatory snap-always overflow-x-auto overscroll-x-contain", {
153
- "flex-col": _ctx.side
152
+ class: normalizeClass(["no-scrollbar relative snap-x snap-mandatory snap-always overflow-x-auto overscroll-x-contain", {
153
+ "grid grid-cols-[1fr,auto]": _ctx.side,
154
+ "flex": !_ctx.side
154
155
  }])
155
156
  }, [
156
- (openBlock(true), createElementBlock(Fragment, null, renderList(defaultSlots.value, (slot, index) => {
157
- return openBlock(), createBlock(_sfc_main$1, {
158
- key: slot.props?.name,
159
- ref_for: true,
160
- ref: "button",
161
- active: current.value === slot.props?.name,
162
- index,
163
- title: slot.props?.title,
164
- icon: slot.props?.icon,
165
- "has-changes": hasChangesMap[slot.props?.name] === true,
166
- "has-error": isValidMap[slot.props?.name] === false,
167
- side: _ctx.side,
168
- "onUpdate:indicatorStyle": _cache[0] || (_cache[0] = ($event) => indicatorStyle.value = $event),
169
- "onUpdate:scrollPosition": updateScrollPosition,
170
- onClick: ($event) => unref(switchTab)(slot.props?.name)
171
- }, createSlots({ _: 2 }, [
172
- slot.children?.title ? {
173
- name: "title",
174
- fn: withCtx(() => [
175
- (openBlock(), createBlock(resolveDynamicComponent(slot.children?.title)))
176
- ]),
177
- key: "0"
178
- } : void 0,
179
- slot.children?.suffix ? {
180
- name: "suffix",
181
- fn: withCtx(() => [
182
- (openBlock(), createBlock(resolveDynamicComponent(slot.children?.suffix)))
183
- ]),
184
- key: "1"
185
- } : void 0,
186
- slot.children?.right ? {
187
- name: "right",
188
- fn: withCtx(() => [
189
- (openBlock(), createBlock(resolveDynamicComponent(slot.children?.right)))
190
- ]),
191
- key: "2"
192
- } : void 0
193
- ]), 1032, ["active", "index", "title", "icon", "has-changes", "has-error", "side", "onClick"]);
157
+ (openBlock(true), createElementBlock(Fragment, null, renderList(defaultSlotsAll.value, (slot, index) => {
158
+ return openBlock(), createElementBlock(Fragment, {
159
+ key: slot.props?.name
160
+ }, [
161
+ isTabItem(slot) ? (openBlock(), createBlock(_sfc_main$1, {
162
+ key: 0,
163
+ ref_for: true,
164
+ ref: "button",
165
+ active: current.value === slot.props?.name,
166
+ index,
167
+ title: slot.props?.title,
168
+ icon: slot.props?.icon,
169
+ "has-changes": unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasChanges === true,
170
+ "has-error": unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.isValid === false,
171
+ side: _ctx.side,
172
+ class: normalizeClass({
173
+ "col-span-2 grid grid-cols-subgrid": _ctx.side,
174
+ "grid-cols-[1fr,auto]": !_ctx.side
175
+ }),
176
+ "onUpdate:indicatorStyle": _cache[0] || (_cache[0] = ($event) => indicatorStyle.value = $event),
177
+ "onUpdate:scrollPosition": updateScrollPosition,
178
+ onClick: ($event) => unref(switchTab)(slot.props?.name)
179
+ }, createSlots({ _: 2 }, [
180
+ slot.children?.title ? {
181
+ name: "title",
182
+ fn: withCtx(() => [
183
+ (openBlock(), createBlock(resolveDynamicComponent(slot.children?.title), mergeProps({ ref_for: true }, {
184
+ hasError: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.isValid === false,
185
+ hasChanges: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasChanges === true,
186
+ hasValue: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasValue === true
187
+ }), null, 16))
188
+ ]),
189
+ key: "0"
190
+ } : void 0,
191
+ slot.children?.suffix ? {
192
+ name: "suffix",
193
+ fn: withCtx(() => [
194
+ (openBlock(), createBlock(resolveDynamicComponent(slot.children?.suffix), mergeProps({ ref_for: true }, {
195
+ hasError: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.isValid === false,
196
+ hasChanges: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasChanges === true,
197
+ hasValue: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasValue === true
198
+ }), null, 16))
199
+ ]),
200
+ key: "1"
201
+ } : void 0,
202
+ slot.children?.right ? {
203
+ name: "right",
204
+ fn: withCtx(() => [
205
+ (openBlock(), createBlock(resolveDynamicComponent(slot.children?.right), mergeProps({ ref_for: true }, {
206
+ hasError: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.isValid === false,
207
+ hasChanges: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasChanges === true,
208
+ hasValue: unref(formRef)?.[defaultSlots.value.indexOf(slot)]?.hasValue === true
209
+ }), null, 16))
210
+ ]),
211
+ key: "2"
212
+ } : void 0
213
+ ]), 1032, ["active", "index", "title", "icon", "has-changes", "has-error", "side", "class", "onClick"])) : (openBlock(), createBlock(resolveDynamicComponent(slot), { key: 1 }))
214
+ ], 64);
194
215
  }), 128)),
195
216
  createElementVNode("div", {
196
217
  class: normalizeClass(["absolute rounded-sm duration-500", {
197
- "bg-primary-default dark:bg-primary-dark": isValidMap[current.value] !== false,
198
- "bg-negative dark:bg-negative-dark": isValidMap[current.value] === false,
218
+ "bg-primary-default dark:bg-primary-dark": currentIsValud.value !== false,
219
+ "bg-negative dark:bg-negative-dark": currentIsValud.value === false,
199
220
  "transition-[left,width,background-color]": !_ctx.side && indicatorStyle.value !== void 0,
200
221
  "transition-[top,height,background-color]": _ctx.side && indicatorStyle.value !== void 0
201
222
  }]),
@@ -230,14 +251,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
230
251
  ref: "form",
231
252
  name: slot.props?.name,
232
253
  title: slot.props?.title,
233
- "onUpdate:isValid": ($event) => updateIsValidMap(slot.props?.name, $event),
234
- "onUpdate:hasChanges": ($event) => hasChangesMap[slot.props?.name] = $event
254
+ "onUpdate:isValid": ($event) => $event === false && unref(switchOnInvalid)(slot.props?.name)
235
255
  }, {
236
256
  default: withCtx(() => [
237
- (openBlock(), createBlock(resolveDynamicComponent(slot.children?.default)))
257
+ (openBlock(), createBlock(resolveDynamicComponent(slot)))
238
258
  ]),
239
259
  _: 2
240
- }, 1032, ["name", "title", "onUpdate:isValid", "onUpdate:hasChanges"])
260
+ }, 1032, ["name", "title", "onUpdate:isValid"])
241
261
  ]),
242
262
  _: 2
243
263
  }, 1032, ["active", "removable", "onUpdate:active"]);
@@ -1,14 +1,15 @@
1
+ import { TabsItemScopedProps } from './types';
1
2
  declare function __VLS_template(): {
2
3
  slots: Readonly<{
3
4
  default?: () => void;
4
- title?: () => void;
5
- suffix?: () => void;
6
- right?: () => void;
5
+ title?: (props: TabsItemScopedProps) => void;
6
+ suffix?: (props: TabsItemScopedProps) => void;
7
+ right?: (props: TabsItemScopedProps) => void;
7
8
  }> & {
8
9
  default?: () => void;
9
- title?: () => void;
10
- suffix?: () => void;
11
- right?: () => void;
10
+ title?: (props: TabsItemScopedProps) => void;
11
+ suffix?: (props: TabsItemScopedProps) => void;
12
+ right?: (props: TabsItemScopedProps) => void;
12
13
  };
13
14
  refs: {};
14
15
  attrs: Partial<{}>;
@@ -20,12 +21,14 @@ declare const __VLS_component: import('vue').DefineComponent<{
20
21
  icon?: SVGComponent;
21
22
  disabled?: boolean;
22
23
  removable?: boolean;
24
+ divided?: boolean;
23
25
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
24
26
  title: string;
25
27
  name: string;
26
28
  icon?: SVGComponent;
27
29
  disabled?: boolean;
28
30
  removable?: boolean;
31
+ divided?: boolean;
29
32
  }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
30
33
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
34
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"WTabsItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/WTabsItem.vue"],"names":[],"mappings":"AA2CA,iB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AAe;WA9DZ,MAAM;UACP,MAAM;WACL,YAAY;eACR,OAAO;gBACN,OAAO;cACT,OAAO;;WALV,MAAM;UACP,MAAM;WACL,YAAY;eACR,OAAO;gBACN,OAAO;cACT,OAAO;iGA+DjB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -7,7 +7,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  name: {},
8
8
  icon: {},
9
9
  disabled: { type: Boolean },
10
- removable: { type: Boolean }
10
+ removable: { type: Boolean },
11
+ divided: { type: Boolean }
11
12
  },
12
13
  setup(__props) {
13
14
  return (_ctx, _cache) => {