@leaflink/stash 48.10.0 → 48.10.1

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 (130) hide show
  1. package/dist/Accordion.js +1 -1
  2. package/dist/ActionsDropdown.js +1 -1
  3. package/dist/AddressSelect.js +1 -1
  4. package/dist/AddressSelect.js.map +1 -1
  5. package/dist/Alert.js +1 -1
  6. package/dist/Alert.js.map +1 -1
  7. package/dist/AppNavigationItem.js +1 -1
  8. package/dist/AppTopbar.js +1 -1
  9. package/dist/Avatar.vue.d.ts +1 -1
  10. package/dist/Badge.js.map +1 -1
  11. package/dist/Button.vue.d.ts +3 -1
  12. package/dist/CardMedia.js +1 -1
  13. package/dist/Carousel.js.map +1 -1
  14. package/dist/ChevronToggle.js +1 -1
  15. package/dist/ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js.map +1 -1
  16. package/dist/Chip.js +1 -1
  17. package/dist/Chip.js.map +1 -1
  18. package/dist/Chip.vue.d.ts +1 -1
  19. package/dist/ConfirmationCodeInput.js.map +1 -1
  20. package/dist/ContextSwitcher.js.map +1 -1
  21. package/dist/Copy.js +1 -1
  22. package/dist/CurrencyInput.js +39 -34
  23. package/dist/CurrencyInput.js.map +1 -1
  24. package/dist/DataView.js +1 -1
  25. package/dist/DataView.js.map +1 -1
  26. package/dist/DataViewFilters.js +1 -1
  27. package/dist/DataViewFilters.js.map +1 -1
  28. package/dist/DataViewSortButton.js +1 -1
  29. package/dist/DataViewToolbar.js +1 -1
  30. package/dist/DatePicker.js +3355 -3368
  31. package/dist/DatePicker.js.map +1 -1
  32. package/dist/Dialog.js +75 -69
  33. package/dist/Dialog.js.map +1 -1
  34. package/dist/Dropdown.js +1 -1
  35. package/dist/Dropdown.js.map +1 -1
  36. package/dist/EmptyState.js +2 -2
  37. package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +1 -1
  38. package/dist/FileUpload.js +1 -1
  39. package/dist/FileUpload.js.map +1 -1
  40. package/dist/FilterChip.js +1 -1
  41. package/dist/FilterDrawerItem.js +1 -1
  42. package/dist/FilterDropdown.js +1 -1
  43. package/dist/FilterSelect.js +1 -1
  44. package/dist/FilterSelect.js.map +1 -1
  45. package/dist/Filters.js +1 -1
  46. package/dist/Filters.js.map +1 -1
  47. package/dist/HttpError.js +2 -2
  48. package/dist/Icon.js +1 -1
  49. package/dist/Icon.js.map +1 -1
  50. package/dist/IconLabel.js +1 -1
  51. package/dist/IconLabel.vue.d.ts +1 -1
  52. package/dist/Illustration.js +3 -3
  53. package/dist/{Illustration.vue_vue_type_script_setup_true_lang-4b8944da.js → Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js} +2 -2
  54. package/dist/{Illustration.vue_vue_type_script_setup_true_lang-4b8944da.js.map → Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js.map} +1 -1
  55. package/dist/Image.js.map +1 -1
  56. package/dist/InlineEdit.js +1 -1
  57. package/dist/Input.js +1 -1
  58. package/dist/Input.js.map +1 -1
  59. package/dist/InputOptions.js +1 -1
  60. package/dist/LicenseChip.js +1 -1
  61. package/dist/ListView.js +2 -2
  62. package/dist/ListView.js.map +1 -1
  63. package/dist/Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js.map +1 -1
  64. package/dist/Metric.vue.d.ts +1 -1
  65. package/dist/Modal.js +1 -1
  66. package/dist/Modals.js +6 -6
  67. package/dist/Modals.js.map +1 -1
  68. package/dist/ObfuscateText.js +1 -1
  69. package/dist/PageNavigation.js +1 -1
  70. package/dist/PageNavigation.js.map +1 -1
  71. package/dist/Paginate.js +1 -1
  72. package/dist/PlaidLink.js.map +1 -1
  73. package/dist/QuickAction.js +1 -1
  74. package/dist/RadioNew.js.map +1 -1
  75. package/dist/RangeInput.js +1 -1
  76. package/dist/SearchBar.js +1 -1
  77. package/dist/Select.js +709 -653
  78. package/dist/Select.js.map +1 -1
  79. package/dist/SelectStatus.js +1 -1
  80. package/dist/SelectStatus.js.map +1 -1
  81. package/dist/SelectStatus.vue.d.ts +1 -1
  82. package/dist/Skeleton.js.map +1 -1
  83. package/dist/Step.js +1 -1
  84. package/dist/Stepper.js +1 -1
  85. package/dist/Tab.js +1 -1
  86. package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +1 -1
  87. package/dist/Table.js +2 -2
  88. package/dist/TableCell.js +2 -2
  89. package/dist/TableHeaderCell.js +2 -2
  90. package/dist/TableHeaderRow.js +2 -2
  91. package/dist/TableRow.js +2 -2
  92. package/dist/TableRow.vue.d.ts +1 -1
  93. package/dist/Tabs.js +1 -1
  94. package/dist/TextEditor.js +991 -991
  95. package/dist/TextEditor.js.map +1 -1
  96. package/dist/Textarea.js.map +1 -1
  97. package/dist/Toast.js +274 -252
  98. package/dist/Toast.js.map +1 -1
  99. package/dist/Toasts.js +1 -1
  100. package/dist/ToastsPlugin.js +1 -1
  101. package/dist/components.css +2 -2
  102. package/dist/index-5e5945a9.js.map +1 -1
  103. package/dist/{index-79ce320f.js → index-9e1095ef.js} +6 -4
  104. package/dist/index-9e1095ef.js.map +1 -0
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +1 -1
  107. package/dist/index.js.map +1 -1
  108. package/dist/isDefined-2ce6cde4.js.map +1 -1
  109. package/dist/observe.js.map +1 -1
  110. package/dist/searchFuzzy-74a7de1c.js.map +1 -1
  111. package/dist/sticky.js.map +1 -1
  112. package/dist/tailwind-base.js.map +1 -1
  113. package/dist/toTimeZone-e6e9ab75.js.map +1 -1
  114. package/dist/tooltip.js.map +1 -1
  115. package/dist/useGoogleMaps.js +109 -119
  116. package/dist/useGoogleMaps.js.map +1 -1
  117. package/dist/useModals.d.ts +6 -363
  118. package/dist/useModals.js.map +1 -1
  119. package/dist/useScriptTag.js.map +1 -1
  120. package/dist/useStepper.js.map +1 -1
  121. package/dist/useValidation.js.map +1 -1
  122. package/dist/utils/colorScheme.js.map +1 -1
  123. package/dist/utils/createQueryString.js.map +1 -1
  124. package/dist/utils/formatDateTime.js.map +1 -1
  125. package/dist/utils/helpers.js.map +1 -1
  126. package/dist/utils/i18n.js.map +1 -1
  127. package/dist/utils/storage.js.map +1 -1
  128. package/dist/viewable.js.map +1 -1
  129. package/package.json +30 -46
  130. package/dist/index-79ce320f.js.map +0 -1
@@ -1,23 +1,4 @@
1
1
  import { Component } from 'vue';
2
- import { ComponentOptionsBase } from 'vue';
3
- import { ComponentPublicInstance } from 'vue';
4
- import { ComputedGetter } from 'vue';
5
- import { ComputedOptions } from 'vue';
6
- import { ComputedSetter } from 'vue';
7
- import { DebuggerEvent } from 'vue';
8
- import { DirectiveBinding } from 'vue';
9
- import { DirectiveHook } from 'vue';
10
- import { FunctionalComponent } from 'vue';
11
- import { FunctionDirective } from 'vue';
12
- import { LooseRequired } from '@vue/shared';
13
- import { MethodOptions } from 'vue';
14
- import { NavigationGuard } from 'vue-router';
15
- import { NavigationGuardWithThis } from 'vue-router';
16
- import { RendererElement } from 'vue';
17
- import { RendererNode } from 'vue';
18
- import { Slot } from 'vue';
19
- import { VNode } from 'vue';
20
- import { WatchCallback } from 'vue';
21
2
 
22
3
  declare interface CloseArgs {
23
4
  index?: number;
@@ -66,352 +47,14 @@ declare type ToRecord<T> = {
66
47
  [P in keyof T]: T[P];
67
48
  };
68
49
 
69
- declare function useModals(): {
70
- active: readonly {
71
- readonly component: FunctionalComponent<any, any, any> | {
72
- new (...args: any[]): any;
73
- __isFragment?: undefined;
74
- __isTeleport?: undefined;
75
- __isSuspense?: undefined;
76
- } | {
77
- readonly [x: string]: any;
78
- readonly setup?: ((this: void, props: LooseRequired<any>, ctx: {
79
- attrs: {
80
- [x: string]: unknown;
81
- };
82
- slots: Readonly<{
83
- [name: string]: Slot<any> | undefined;
84
- }>;
85
- emit: ((event: unknown, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
86
- expose: (exposed?: Record<string, any> | undefined) => void;
87
- }) => any) | undefined;
88
- readonly name?: string | undefined;
89
- readonly template?: string | object | undefined;
90
- readonly render?: Function | undefined;
91
- readonly components?: {
92
- readonly [x: string]: FunctionalComponent<any, any, any> | {
93
- new (...args: any[]): any;
94
- __isFragment?: undefined;
95
- __isTeleport?: undefined;
96
- __isSuspense?: undefined;
97
- } | {
98
- readonly [x: string]: any;
99
- readonly setup?: ((this: void, props: LooseRequired<any>, ctx: {
100
- attrs: {
101
- [x: string]: unknown;
102
- };
103
- slots: Readonly<{
104
- [name: string]: Slot<any> | undefined;
105
- }>;
106
- emit: ((event: unknown, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
107
- expose: (exposed?: Record<string, any> | undefined) => void;
108
- }) => any) | undefined;
109
- readonly name?: string | undefined;
110
- readonly template?: string | object | undefined;
111
- readonly render?: Function | undefined;
112
- readonly components?: any | undefined;
113
- readonly directives?: {
114
- readonly [x: string]: FunctionDirective<any, any> | {
115
- readonly created?: DirectiveHook<any, null, any> | undefined;
116
- readonly beforeMount?: DirectiveHook<any, null, any> | undefined;
117
- readonly mounted?: DirectiveHook<any, null, any> | undefined;
118
- readonly beforeUpdate?: DirectiveHook<any, VNode<any, any, {
119
- [key: string]: any;
120
- }>, any> | undefined;
121
- readonly updated?: DirectiveHook<any, VNode<any, any, {
122
- [key: string]: any;
123
- }>, any> | undefined;
124
- readonly beforeUnmount?: DirectiveHook<any, null, any> | undefined;
125
- readonly unmounted?: DirectiveHook<any, null, any> | undefined;
126
- readonly getSSRProps?: ((binding: DirectiveBinding<any>, vnode: VNode<RendererNode, RendererElement, {
127
- [key: string]: any;
128
- }>) => {
129
- [x: string]: unknown;
130
- } | undefined) | undefined;
131
- readonly deep?: boolean | undefined;
132
- };
133
- } | undefined;
134
- readonly inheritAttrs?: boolean | undefined;
135
- readonly emits?: any;
136
- readonly slots?: {} | undefined;
137
- readonly expose?: readonly string[] | undefined;
138
- readonly serverPrefetch?: (() => void | Promise<any>) | undefined;
139
- readonly compilerOptions?: {
140
- readonly isCustomElement?: ((tag: string) => boolean) | undefined;
141
- readonly whitespace?: "preserve" | "condense" | undefined;
142
- readonly comments?: boolean | undefined;
143
- readonly delimiters?: readonly [string, string] | undefined;
144
- } | undefined;
145
- readonly call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
146
- readonly __isFragment?: undefined;
147
- readonly __isTeleport?: undefined;
148
- readonly __isSuspense?: undefined;
149
- readonly __defaults?: any;
150
- readonly compatConfig?: {
151
- readonly GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
152
- readonly GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
153
- readonly GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
154
- readonly GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
155
- readonly GLOBAL_SET?: boolean | "suppress-warning" | undefined;
156
- readonly GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
157
- readonly GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
158
- readonly GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
159
- readonly CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
160
- readonly CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
161
- readonly CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
162
- readonly CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
163
- readonly CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
164
- readonly CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
165
- readonly CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
166
- readonly INSTANCE_SET?: boolean | "suppress-warning" | undefined;
167
- readonly INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
168
- readonly INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
169
- readonly INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
170
- readonly INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
171
- readonly INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
172
- readonly INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
173
- readonly INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
174
- readonly INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
175
- readonly OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
176
- readonly OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
177
- readonly OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
178
- readonly OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
179
- readonly WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
180
- readonly PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
181
- readonly V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
182
- readonly CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
183
- readonly ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
184
- readonly ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
185
- readonly TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
186
- readonly TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
187
- readonly COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
188
- readonly COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
189
- readonly COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
190
- readonly RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
191
- readonly FILTERS?: boolean | "suppress-warning" | undefined;
192
- readonly PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
193
- readonly MODE?: 2 | 3 | ((comp: Component<any, any, any, ComputedOptions, MethodOptions> | null) => 2 | 3) | undefined;
194
- } | undefined;
195
- readonly data?: ((this: any, vm: any) => any) | undefined;
196
- readonly computed?: {
197
- readonly [x: string]: ComputedGetter<any> | {
198
- readonly get: ComputedGetter<any>;
199
- readonly set: ComputedSetter<any>;
200
- };
201
- } | undefined;
202
- readonly methods?: {
203
- readonly [x: string]: Function;
204
- } | undefined;
205
- readonly watch?: {
206
- readonly [x: string]: string | WatchCallback<any, any> | {
207
- readonly handler: string | WatchCallback<any, any>;
208
- readonly immediate?: boolean | undefined;
209
- readonly deep?: boolean | undefined;
210
- readonly flush?: "pre" | "post" | "sync" | undefined;
211
- readonly onTrack?: ((event: DebuggerEvent) => void) | undefined;
212
- readonly onTrigger?: ((event: DebuggerEvent) => void) | undefined;
213
- } | readonly (string | WatchCallback<any, any> | {
214
- readonly handler: string | WatchCallback<any, any>;
215
- readonly immediate?: boolean | undefined;
216
- readonly deep?: boolean | undefined;
217
- readonly flush?: "pre" | "post" | "sync" | undefined;
218
- readonly onTrack?: ((event: DebuggerEvent) => void) | undefined;
219
- readonly onTrigger?: ((event: DebuggerEvent) => void) | undefined;
220
- })[];
221
- } | undefined;
222
- readonly provide?: Function | {
223
- readonly [x: string]: Readonly<unknown>;
224
- readonly [x: symbol]: Readonly<unknown>;
225
- } | undefined;
226
- readonly inject?: readonly string[] | {} | undefined;
227
- readonly filters?: {
228
- readonly [x: string]: Function;
229
- } | undefined;
230
- readonly mixins?: readonly any[] | undefined;
231
- readonly extends?: any;
232
- readonly beforeCreate?: (() => void) | undefined;
233
- readonly created?: (() => void) | undefined;
234
- readonly beforeMount?: (() => void) | undefined;
235
- readonly mounted?: (() => void) | undefined;
236
- readonly beforeUpdate?: (() => void) | undefined;
237
- readonly updated?: (() => void) | undefined;
238
- readonly activated?: (() => void) | undefined;
239
- readonly deactivated?: (() => void) | undefined;
240
- readonly beforeDestroy?: (() => void) | undefined;
241
- readonly beforeUnmount?: (() => void) | undefined;
242
- readonly destroyed?: (() => void) | undefined;
243
- readonly unmounted?: (() => void) | undefined;
244
- readonly renderTracked?: ((e: DebuggerEvent) => void) | undefined;
245
- readonly renderTriggered?: ((e: DebuggerEvent) => void) | undefined;
246
- readonly errorCaptured?: ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => boolean | void) | undefined;
247
- readonly delimiters?: readonly [string, string] | undefined;
248
- readonly __differentiator?: string | number | symbol | undefined;
249
- readonly __isBuiltIn?: boolean | undefined;
250
- readonly __file?: string | undefined;
251
- readonly __name?: string | undefined;
252
- readonly beforeRouteEnter?: NavigationGuardWithThis<undefined> | undefined;
253
- readonly beforeRouteUpdate?: NavigationGuard | undefined;
254
- readonly beforeRouteLeave?: NavigationGuard | undefined;
255
- };
256
- } | undefined;
257
- readonly directives?: {
258
- readonly [x: string]: FunctionDirective<any, any> | {
259
- readonly created?: DirectiveHook<any, null, any> | undefined;
260
- readonly beforeMount?: DirectiveHook<any, null, any> | undefined;
261
- readonly mounted?: DirectiveHook<any, null, any> | undefined;
262
- readonly beforeUpdate?: DirectiveHook<any, VNode<any, any, {
263
- [key: string]: any;
264
- }>, any> | undefined;
265
- readonly updated?: DirectiveHook<any, VNode<any, any, {
266
- [key: string]: any;
267
- }>, any> | undefined;
268
- readonly beforeUnmount?: DirectiveHook<any, null, any> | undefined;
269
- readonly unmounted?: DirectiveHook<any, null, any> | undefined;
270
- readonly getSSRProps?: ((binding: DirectiveBinding<any>, vnode: VNode<RendererNode, RendererElement, {
271
- [key: string]: any;
272
- }>) => {
273
- [x: string]: unknown;
274
- } | undefined) | undefined;
275
- readonly deep?: boolean | undefined;
276
- };
277
- } | undefined;
278
- readonly inheritAttrs?: boolean | undefined;
279
- readonly emits?: any;
280
- readonly slots?: {} | undefined;
281
- readonly expose?: readonly string[] | undefined;
282
- readonly serverPrefetch?: (() => void | Promise<any>) | undefined;
283
- readonly compilerOptions?: {
284
- readonly isCustomElement?: ((tag: string) => boolean) | undefined;
285
- readonly whitespace?: "preserve" | "condense" | undefined;
286
- readonly comments?: boolean | undefined;
287
- readonly delimiters?: readonly [string, string] | undefined;
288
- } | undefined;
289
- readonly call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
290
- readonly __isFragment?: undefined;
291
- readonly __isTeleport?: undefined;
292
- readonly __isSuspense?: undefined;
293
- readonly __defaults?: any;
294
- readonly compatConfig?: {
295
- readonly GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
296
- readonly GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
297
- readonly GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
298
- readonly GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
299
- readonly GLOBAL_SET?: boolean | "suppress-warning" | undefined;
300
- readonly GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
301
- readonly GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
302
- readonly GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
303
- readonly CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
304
- readonly CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
305
- readonly CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
306
- readonly CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
307
- readonly CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
308
- readonly CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
309
- readonly CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
310
- readonly INSTANCE_SET?: boolean | "suppress-warning" | undefined;
311
- readonly INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
312
- readonly INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
313
- readonly INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
314
- readonly INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
315
- readonly INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
316
- readonly INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
317
- readonly INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
318
- readonly INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
319
- readonly OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
320
- readonly OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
321
- readonly OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
322
- readonly OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
323
- readonly WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
324
- readonly PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
325
- readonly V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
326
- readonly CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
327
- readonly ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
328
- readonly ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
329
- readonly TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
330
- readonly TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
331
- readonly COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
332
- readonly COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
333
- readonly COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
334
- readonly RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
335
- readonly FILTERS?: boolean | "suppress-warning" | undefined;
336
- readonly PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
337
- readonly MODE?: 2 | 3 | ((comp: Component<any, any, any, ComputedOptions, MethodOptions> | null) => 2 | 3) | undefined;
338
- } | undefined;
339
- readonly data?: ((this: any, vm: any) => any) | undefined;
340
- readonly computed?: {
341
- readonly [x: string]: ComputedGetter<any> | {
342
- readonly get: ComputedGetter<any>;
343
- readonly set: ComputedSetter<any>;
344
- };
345
- } | undefined;
346
- readonly methods?: {
347
- readonly [x: string]: Function;
348
- } | undefined;
349
- readonly watch?: {
350
- readonly [x: string]: string | WatchCallback<any, any> | {
351
- readonly handler: string | WatchCallback<any, any>;
352
- readonly immediate?: boolean | undefined;
353
- readonly deep?: boolean | undefined;
354
- readonly flush?: "pre" | "post" | "sync" | undefined;
355
- readonly onTrack?: ((event: DebuggerEvent) => void) | undefined;
356
- readonly onTrigger?: ((event: DebuggerEvent) => void) | undefined;
357
- } | readonly (string | WatchCallback<any, any> | {
358
- readonly handler: string | WatchCallback<any, any>;
359
- readonly immediate?: boolean | undefined;
360
- readonly deep?: boolean | undefined;
361
- readonly flush?: "pre" | "post" | "sync" | undefined;
362
- readonly onTrack?: ((event: DebuggerEvent) => void) | undefined;
363
- readonly onTrigger?: ((event: DebuggerEvent) => void) | undefined;
364
- })[];
365
- } | undefined;
366
- readonly provide?: Function | {
367
- readonly [x: string]: Readonly<unknown>;
368
- readonly [x: symbol]: Readonly<unknown>;
369
- } | undefined;
370
- readonly inject?: readonly string[] | {} | undefined;
371
- readonly filters?: {
372
- readonly [x: string]: Function;
373
- } | undefined;
374
- readonly mixins?: readonly any[] | undefined;
375
- readonly extends?: any;
376
- readonly beforeCreate?: (() => void) | undefined;
377
- readonly created?: (() => void) | undefined;
378
- readonly beforeMount?: (() => void) | undefined;
379
- readonly mounted?: (() => void) | undefined;
380
- readonly beforeUpdate?: (() => void) | undefined;
381
- readonly updated?: (() => void) | undefined;
382
- readonly activated?: (() => void) | undefined;
383
- readonly deactivated?: (() => void) | undefined;
384
- readonly beforeDestroy?: (() => void) | undefined;
385
- readonly beforeUnmount?: (() => void) | undefined;
386
- readonly destroyed?: (() => void) | undefined;
387
- readonly unmounted?: (() => void) | undefined;
388
- readonly renderTracked?: ((e: DebuggerEvent) => void) | undefined;
389
- readonly renderTriggered?: ((e: DebuggerEvent) => void) | undefined;
390
- readonly errorCaptured?: ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => boolean | void) | undefined;
391
- readonly delimiters?: readonly [string, string] | undefined;
392
- readonly __differentiator?: string | number | symbol | undefined;
393
- readonly __isBuiltIn?: boolean | undefined;
394
- readonly __file?: string | undefined;
395
- readonly __name?: string | undefined;
396
- readonly beforeRouteEnter?: NavigationGuardWithThis<undefined> | undefined;
397
- readonly beforeRouteUpdate?: NavigationGuard | undefined;
398
- readonly beforeRouteLeave?: NavigationGuard | undefined;
399
- };
400
- readonly name?: string | undefined;
401
- readonly attributes?: {
402
- readonly [x: string]: Readonly<unknown>;
403
- } | undefined;
404
- readonly slots?: {
405
- readonly [x: string]: string;
406
- } | undefined;
407
- readonly options?: {
408
- readonly disableDefaultListeners?: boolean | undefined;
409
- } | undefined;
410
- }[];
50
+ declare interface UseModals {
51
+ active: Readonly<Modal[]>;
411
52
  open: <T>(modal: Modal<T>) => void;
412
- close: ({ index, name }?: CloseArgs) => void;
53
+ close: (args?: CloseArgs) => void;
413
54
  closeAll: () => void;
414
- };
55
+ }
56
+
57
+ declare function useModals(): UseModals;
415
58
  export default useModals;
416
59
 
417
60
  export { }
@@ -1 +1 @@
1
- {"version":3,"file":"useModals.js","sources":["../src/composables/useModals/useModals.ts"],"sourcesContent":["import merge from 'lodash-es/merge';\nimport { Component, markRaw, reactive, readonly, ref } from 'vue';\n\n// Utility type that maps each property of T to unknown, making it compatible with Record<string, unknown>\n// this ensures that the attributes property of the Modal interface can be used with custom types defined downstream\n// while still being compatible with the Record<string, unknown> type\ntype ToRecord<T> = {\n [P in keyof T]: T[P];\n};\n\n// #region modal-interface\nexport interface Modal<TAttributes = Record<string, unknown>> {\n /**\n * Import the modal that you want to use in your component,\n * then pass that to the composable\n */\n component: Component;\n\n /**\n * Optional identifier used to close a modal. The default value is `component.name` (if defined).\n */\n name?: string;\n\n /**\n * Props and listeners to passed through.\n *\n * Listeners need to be formatted as `onEventName`\n */\n attributes?: ToRecord<TAttributes>;\n\n /**\n * Dyanmic slots that you want rendered in the format of\n * { default: 'my slot content' }\n *\n * The Modals component which renders this list passes the value for slots through\n * a html sanitizer to avoid XSS attacks\n */\n slots?: Record<string, string>;\n\n /**\n * Custom options to use for the given modal.\n *\n * If options are not passed in, then useModals will set the following values as defaults\n *\n * {\n * disableDefaultListeners: false\n * }\n */\n options?: {\n disableDefaultListeners?: boolean;\n };\n}\n// #endregion modal-interface\n\ninterface CloseArgs {\n index?: number;\n name?: string;\n}\n\nconst active = ref<Modal[]>([]);\n\nexport default function useModals() {\n // T is the custom interface of the attributes that are passed to the modal\n function open<T>(modal: Modal<T>) {\n if (!modal.name && modal.component.name) {\n modal.name = modal.component.name;\n }\n\n //Prevent vue from making the entire component passed in reactive to avoid unnecessary performance overhead\n modal.component = markRaw(modal.component);\n\n const optionsDefaults: Modal['options'] = {\n disableDefaultListeners: false,\n };\n\n modal.options = merge({}, optionsDefaults, modal.options);\n\n active.value.push(modal);\n }\n\n function close({ index, name }: CloseArgs = {}) {\n if (index === undefined && !name) {\n active.value.pop();\n return;\n }\n\n if (index !== undefined) {\n active.value.splice(index, 1);\n return;\n }\n\n if (name) {\n const index = active.value.findIndex((modal) => modal.name === name);\n\n if (index === -1) return;\n\n active.value.splice(index, 1);\n return;\n }\n }\n\n function closeAll() {\n active.value = [];\n }\n\n return reactive({\n /**\n * The list of modals that are currently open.\n */\n active: readonly(active),\n\n /**\n * Opens the given modal.\n */\n open,\n\n /**\n * Closes a modal.\n * If no arguments are passed, then the top-most modal is closed.\n * If an index is passed, then the modal at that index is closed.\n * If a name is passed, then the modal with that name is closed.\n */\n close,\n\n /**\n * Closes all active/open modals.\n */\n closeAll,\n });\n}\n"],"names":["active","ref","useModals","open","modal","markRaw","optionsDefaults","merge","close","index","name","closeAll","reactive","readonly"],"mappings":";;AA2DA,MAAMA,IAASC,EAAa,CAAA,CAAE;AAE9B,SAAwBC,IAAY;AAElC,WAASC,EAAQC,GAAiB;AAChC,IAAI,CAACA,EAAM,QAAQA,EAAM,UAAU,SAC3BA,EAAA,OAAOA,EAAM,UAAU,OAIzBA,EAAA,YAAYC,EAAQD,EAAM,SAAS;AAEzC,UAAME,IAAoC;AAAA,MACxC,yBAAyB;AAAA,IAAA;AAG3B,IAAAF,EAAM,UAAUG,EAAM,CAAA,GAAID,GAAiBF,EAAM,OAAO,GAEjDJ,EAAA,MAAM,KAAKI,CAAK;AAAA,EACzB;AAEA,WAASI,EAAM,EAAE,OAAAC,GAAO,MAAAC,EAAK,IAAe,CAAA,GAAI;AAC1C,QAAAD,MAAU,UAAa,CAACC,GAAM;AAChC,MAAAV,EAAO,MAAM;AACb;AAAA,IACF;AAEA,QAAIS,MAAU,QAAW;AAChB,MAAAT,EAAA,MAAM,OAAOS,GAAO,CAAC;AAC5B;AAAA,IACF;AAEA,QAAIC,GAAM;AACFD,YAAAA,IAAQT,EAAO,MAAM,UAAU,CAACI,MAAUA,EAAM,SAASM,CAAI;AAEnE,UAAID,MAAU;AAAI;AAEX,MAAAT,EAAA,MAAM,OAAOS,GAAO,CAAC;AAC5B;AAAA,IACF;AAAA,EACF;AAEA,WAASE,IAAW;AAClB,IAAAX,EAAO,QAAQ;EACjB;AAEA,SAAOY,EAAS;AAAA;AAAA;AAAA;AAAA,IAId,QAAQC,EAASb,CAAM;AAAA;AAAA;AAAA;AAAA,IAKvB,MAAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,OAAAK;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAG;AAAA,EAAA,CACD;AACH;"}
1
+ {"version":3,"file":"useModals.js","sources":["../src/composables/useModals/useModals.ts"],"sourcesContent":["import merge from 'lodash-es/merge';\nimport { Component, markRaw, reactive, readonly, ref } from 'vue';\n\n// Utility type that maps each property of T to unknown, making it compatible with Record<string, unknown>\n// this ensures that the attributes property of the Modal interface can be used with custom types defined downstream\n// while still being compatible with the Record<string, unknown> type\ntype ToRecord<T> = {\n [P in keyof T]: T[P];\n};\n\n// #region modal-interface\nexport interface Modal<TAttributes = Record<string, unknown>> {\n /**\n * Import the modal that you want to use in your component,\n * then pass that to the composable\n */\n component: Component;\n\n /**\n * Optional identifier used to close a modal. The default value is `component.name` (if defined).\n */\n name?: string;\n\n /**\n * Props and listeners to passed through.\n *\n * Listeners need to be formatted as `onEventName`\n */\n attributes?: ToRecord<TAttributes>;\n\n /**\n * Dyanmic slots that you want rendered in the format of\n * { default: 'my slot content' }\n *\n * The Modals component which renders this list passes the value for slots through\n * a html sanitizer to avoid XSS attacks\n */\n slots?: Record<string, string>;\n\n /**\n * Custom options to use for the given modal.\n *\n * If options are not passed in, then useModals will set the following values as defaults\n *\n * {\n * disableDefaultListeners: false\n * }\n */\n options?: {\n disableDefaultListeners?: boolean;\n };\n}\n// #endregion modal-interface\n\ninterface CloseArgs {\n index?: number;\n name?: string;\n}\n\nconst active = ref<Modal[]>([]);\n\ninterface UseModals {\n active: Readonly<Modal[]>;\n open: <T>(modal: Modal<T>) => void;\n close: (args?: CloseArgs) => void;\n closeAll: () => void;\n}\n\nexport default function useModals(): UseModals {\n // T is the custom interface of the attributes that are passed to the modal\n function open<T>(modal: Modal<T>) {\n if (!modal.name && modal.component.name) {\n modal.name = modal.component.name;\n }\n\n //Prevent vue from making the entire component passed in reactive to avoid unnecessary performance overhead\n modal.component = markRaw(modal.component);\n\n const optionsDefaults: Modal['options'] = {\n disableDefaultListeners: false,\n };\n\n modal.options = merge({}, optionsDefaults, modal.options);\n\n active.value.push(modal);\n }\n\n function close({ index, name }: CloseArgs = {}) {\n if (index === undefined && !name) {\n active.value.pop();\n return;\n }\n\n if (index !== undefined) {\n active.value.splice(index, 1);\n return;\n }\n\n if (name) {\n const index = active.value.findIndex((modal) => modal.name === name);\n\n if (index === -1) return;\n\n active.value.splice(index, 1);\n return;\n }\n }\n\n function closeAll() {\n active.value = [];\n }\n\n // @ts-ignore - Stupid TS version issues. Todo: remove comment, fix ts issues.\n return reactive({\n /**\n * The list of modals that are currently open.\n */\n active: readonly(active),\n\n /**\n * Opens the given modal.\n */\n open,\n\n /**\n * Closes a modal.\n * If no arguments are passed, then the top-most modal is closed.\n * If an index is passed, then the modal at that index is closed.\n * If a name is passed, then the modal with that name is closed.\n */\n close,\n\n /**\n * Closes all active/open modals.\n */\n closeAll,\n });\n}\n"],"names":["active","ref","useModals","open","modal","markRaw","optionsDefaults","merge","close","index","name","closeAll","reactive","readonly"],"mappings":";;AA2DA,MAAMA,IAASC,EAAa,CAAA,CAAE;AAS9B,SAAwBC,IAAuB;AAE7C,WAASC,EAAQC,GAAiB;AAChC,IAAI,CAACA,EAAM,QAAQA,EAAM,UAAU,SAC3BA,EAAA,OAAOA,EAAM,UAAU,OAIzBA,EAAA,YAAYC,EAAQD,EAAM,SAAS;AAEzC,UAAME,IAAoC;AAAA,MACxC,yBAAyB;AAAA,IAAA;AAG3B,IAAAF,EAAM,UAAUG,EAAM,CAAA,GAAID,GAAiBF,EAAM,OAAO,GAEjDJ,EAAA,MAAM,KAAKI,CAAK;AAAA,EACzB;AAEA,WAASI,EAAM,EAAE,OAAAC,GAAO,MAAAC,EAAK,IAAe,CAAA,GAAI;AAC1C,QAAAD,MAAU,UAAa,CAACC,GAAM;AAChC,MAAAV,EAAO,MAAM;AACb;AAAA;AAGF,QAAIS,MAAU,QAAW;AAChB,MAAAT,EAAA,MAAM,OAAOS,GAAO,CAAC;AAC5B;AAAA;AAGF,QAAIC,GAAM;AACFD,YAAAA,IAAQT,EAAO,MAAM,UAAU,CAACI,MAAUA,EAAM,SAASM,CAAI;AAEnE,UAAID,MAAU;AAAI;AAEX,MAAAT,EAAA,MAAM,OAAOS,GAAO,CAAC;AAC5B;AAAA;AAAA,EAEJ;AAEA,WAASE,IAAW;AAClB,IAAAX,EAAO,QAAQ;EACjB;AAGA,SAAOY,EAAS;AAAA;AAAA;AAAA;AAAA,IAId,QAAQC,EAASb,CAAM;AAAA;AAAA;AAAA;AAAA,IAKvB,MAAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,OAAAK;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAG;AAAA,EAAA,CACD;AACH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useScriptTag.js","sources":["../src/composables/useScriptTag/useScriptTag.ts"],"sourcesContent":["import { onMounted, onUnmounted, ref } from 'vue';\n\ntype UseScriptOptions = {\n manual: boolean;\n};\n\nexport default function useScriptTag(url: string, options: UseScriptOptions = { manual: false }) {\n const scriptTag = ref<HTMLScriptElement | null>(null);\n const isLoaded = ref(false);\n const error = ref<Error | null>(null);\n\n const setIsLoaded = () => (isLoaded.value = true);\n const setError = (e: ErrorEvent) => (error.value = e.error);\n\n function loadScript() {\n let el = document.querySelector<HTMLScriptElement>(`script[src=\"${url}\"]`);\n\n if (!el) {\n isLoaded.value = false;\n error.value = null;\n\n el = document.createElement('script');\n\n el.type = 'text/javascript';\n el.async = true;\n el.src = url;\n el.addEventListener('load', setIsLoaded);\n el.addEventListener('error', setError);\n document.head.appendChild(el);\n } else {\n isLoaded.value = true;\n }\n\n scriptTag.value = el;\n }\n\n function unloadScript() {\n if (!document) {\n return;\n }\n\n const elToBeRemoved = document.querySelector<HTMLScriptElement>(`script[src=\"${url}\"]`);\n\n if (elToBeRemoved) {\n elToBeRemoved.removeEventListener('load', setIsLoaded);\n elToBeRemoved.removeEventListener('error', setError);\n\n document.head.removeChild(elToBeRemoved);\n\n scriptTag.value = null;\n isLoaded.value = false;\n }\n }\n\n if (!options.manual) {\n onMounted(loadScript);\n onUnmounted(unloadScript);\n }\n\n return { scriptTag, load: loadScript, unload: unloadScript, isLoaded, error };\n}\n"],"names":["useScriptTag","url","options","scriptTag","ref","isLoaded","error","setIsLoaded","setError","loadScript","el","unloadScript","elToBeRemoved","onMounted","onUnmounted"],"mappings":";AAMA,SAAwBA,EAAaC,GAAaC,IAA4B,EAAE,QAAQ,MAAS;AACzF,QAAAC,IAAYC,EAA8B,IAAI,GAC9CC,IAAWD,EAAI,EAAK,GACpBE,IAAQF,EAAkB,IAAI,GAE9BG,IAAc,MAAOF,EAAS,QAAQ,IACtCG,IAAW,CAAC,MAAmBF,EAAM,QAAQ,EAAE;AAErD,WAASG,IAAa;AACpB,QAAIC,IAAK,SAAS,cAAiC,eAAeT,CAAG,IAAI;AAEzE,IAAKS,IAaHL,EAAS,QAAQ,MAZjBA,EAAS,QAAQ,IACjBC,EAAM,QAAQ,MAETI,IAAA,SAAS,cAAc,QAAQ,GAEpCA,EAAG,OAAO,mBACVA,EAAG,QAAQ,IACXA,EAAG,MAAMT,GACNS,EAAA,iBAAiB,QAAQH,CAAW,GACpCG,EAAA,iBAAiB,SAASF,CAAQ,GAC5B,SAAA,KAAK,YAAYE,CAAE,IAK9BP,EAAU,QAAQO;AAAA,EACpB;AAEA,WAASC,IAAe;AACtB,QAAI,CAAC;AACH;AAGF,UAAMC,IAAgB,SAAS,cAAiC,eAAeX,CAAG,IAAI;AAEtF,IAAIW,MACYA,EAAA,oBAAoB,QAAQL,CAAW,GACvCK,EAAA,oBAAoB,SAASJ,CAAQ,GAE1C,SAAA,KAAK,YAAYI,CAAa,GAEvCT,EAAU,QAAQ,MAClBE,EAAS,QAAQ;AAAA,EAErB;AAEI,SAACH,EAAQ,WACXW,EAAUJ,CAAU,GACpBK,EAAYH,CAAY,IAGnB,EAAE,WAAAR,GAAW,MAAMM,GAAY,QAAQE,GAAc,UAAAN,GAAU,OAAAC;AACxE;"}
1
+ {"version":3,"file":"useScriptTag.js","sources":["../src/composables/useScriptTag/useScriptTag.ts"],"sourcesContent":["import { onMounted, onUnmounted, ref } from 'vue';\n\ntype UseScriptOptions = {\n manual: boolean;\n};\n\nexport default function useScriptTag(url: string, options: UseScriptOptions = { manual: false }) {\n const scriptTag = ref<HTMLScriptElement | null>(null);\n const isLoaded = ref(false);\n const error = ref<Error | null>(null);\n\n const setIsLoaded = () => (isLoaded.value = true);\n const setError = (e: ErrorEvent) => (error.value = e.error);\n\n function loadScript() {\n let el = document.querySelector<HTMLScriptElement>(`script[src=\"${url}\"]`);\n\n if (!el) {\n isLoaded.value = false;\n error.value = null;\n\n el = document.createElement('script');\n\n el.type = 'text/javascript';\n el.async = true;\n el.src = url;\n el.addEventListener('load', setIsLoaded);\n el.addEventListener('error', setError);\n document.head.appendChild(el);\n } else {\n isLoaded.value = true;\n }\n\n scriptTag.value = el;\n }\n\n function unloadScript() {\n if (!document) {\n return;\n }\n\n const elToBeRemoved = document.querySelector<HTMLScriptElement>(`script[src=\"${url}\"]`);\n\n if (elToBeRemoved) {\n elToBeRemoved.removeEventListener('load', setIsLoaded);\n elToBeRemoved.removeEventListener('error', setError);\n\n document.head.removeChild(elToBeRemoved);\n\n scriptTag.value = null;\n isLoaded.value = false;\n }\n }\n\n if (!options.manual) {\n onMounted(loadScript);\n onUnmounted(unloadScript);\n }\n\n return { scriptTag, load: loadScript, unload: unloadScript, isLoaded, error };\n}\n"],"names":["useScriptTag","url","options","scriptTag","ref","isLoaded","error","setIsLoaded","setError","loadScript","el","unloadScript","elToBeRemoved","onMounted","onUnmounted"],"mappings":";AAMA,SAAwBA,EAAaC,GAAaC,IAA4B,EAAE,QAAQ,MAAS;AACzF,QAAAC,IAAYC,EAA8B,IAAI,GAC9CC,IAAWD,EAAI,EAAK,GACpBE,IAAQF,EAAkB,IAAI,GAE9BG,IAAc,MAAOF,EAAS,QAAQ,IACtCG,IAAW,CAAC,MAAmBF,EAAM,QAAQ,EAAE;AAErD,WAASG,IAAa;AACpB,QAAIC,IAAK,SAAS,cAAiC,eAAeT,KAAO;AAEzE,IAAKS,IAaHL,EAAS,QAAQ,MAZjBA,EAAS,QAAQ,IACjBC,EAAM,QAAQ,MAETI,IAAA,SAAS,cAAc,QAAQ,GAEpCA,EAAG,OAAO,mBACVA,EAAG,QAAQ,IACXA,EAAG,MAAMT,GACNS,EAAA,iBAAiB,QAAQH,CAAW,GACpCG,EAAA,iBAAiB,SAASF,CAAQ,GAC5B,SAAA,KAAK,YAAYE,CAAE,IAK9BP,EAAU,QAAQO;AAAA,EACpB;AAEA,WAASC,IAAe;AACtB,QAAI,CAAC;AACH;AAGF,UAAMC,IAAgB,SAAS,cAAiC,eAAeX,KAAO;AAEtF,IAAIW,MACYA,EAAA,oBAAoB,QAAQL,CAAW,GACvCK,EAAA,oBAAoB,SAASJ,CAAQ,GAE1C,SAAA,KAAK,YAAYI,CAAa,GAEvCT,EAAU,QAAQ,MAClBE,EAAS,QAAQ;AAAA,EAErB;AAEI,SAACH,EAAQ,WACXW,EAAUJ,CAAU,GACpBK,EAAYH,CAAY,IAGnB,EAAE,WAAAR,GAAW,MAAMM,GAAY,QAAQE,GAAc,UAAAN,GAAU,OAAAC;AACxE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useStepper.js","sources":["../src/composables/useStepper/useStepper.ts"],"sourcesContent":["import { computed, readonly, Ref, ref } from 'vue';\n\nexport interface StepDefinition {\n completed: boolean;\n substeps: Array<Omit<StepDefinition, 'substeps'>>;\n}\n\nexport interface StepperOptions {\n /**\n * If true, the stepper will prevent skipping steps\n */\n linear?: boolean;\n /**\n * The index of the active step\n */\n activeStep?: number;\n /**\n * The index of the active substep\n */\n activeSubstep?: number;\n /**\n * The stepper representation as an array of steps and substeps\n */\n steps?: Array<StepDefinition>;\n /**\n * A ref to the stepper element\n */\n ref?: Ref<HTMLUListElement | null>;\n}\n\nexport default function useStepper(\n options: StepperOptions = {\n linear: false,\n activeStep: -1,\n activeSubstep: -1,\n steps: [],\n },\n) {\n /**\n * The steps and substeps of the stepper, so we can keep track of their state.\n * Can be populated with the `steps` option, or via the `registerStep` function.\n */\n const steps = ref<Array<StepDefinition>>(options.steps ? options.steps : []);\n\n const stepCount = computed(() => steps.value.length);\n\n const activeStepIndex = ref(\n options.activeStep !== null && options.activeStep !== undefined ? options.activeStep : -1,\n );\n const activeSubstepIndex = ref(\n options.activeSubstep !== null && options.activeSubstep !== undefined ? options.activeSubstep : -1,\n );\n\n const stepElements = computed(() => {\n return Array.from((options.ref?.value?.children || []) as HTMLCollectionOf<HTMLLIElement>);\n });\n\n const activeStepElement = computed(() => stepElements.value[activeStepIndex.value]);\n\n /**\n * Returns true if the step at the given index has substeps\n * @param stepIndex The index of the step to check\n */\n function stepHasSubsteps(stepIndex: number): boolean {\n return !!steps.value[stepIndex].substeps.length;\n }\n\n /**\n * Goes to the next step or substep, while flagging the current one as completed.\n * If the current step has substeps, it will go to the next substep if there are any, or to the next substep.\n * And if the next step has substeps, automatically goes to the first substep\n */\n function next(): void {\n const hasNoActiveStep = activeStepIndex.value === -1;\n const isLastStep = activeStepIndex.value === steps.value.length - 1;\n\n // If there is no active step, we want to activate the first step\n if (hasNoActiveStep) {\n activeStepIndex.value++;\n\n // If the step we just navigated to has substeps, we want to activate the first substep\n if (stepHasSubsteps(activeStepIndex.value)) {\n activeSubstepIndex.value++;\n }\n } else if (isLastStep) {\n if (stepHasSubsteps(activeStepIndex.value)) {\n const hasNoActiveSubstep = activeSubstepIndex.value === -1;\n const isLastSubstep = activeSubstepIndex.value === steps.value[activeStepIndex.value].substeps.length - 1;\n\n // if there are no active substeps, we want to activate the first substep\n if (hasNoActiveSubstep) {\n activeSubstepIndex.value++;\n // if the active substep is the last one, we want to reset the step and substep to -1\n } else if (isLastSubstep) {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value = -1;\n\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value = -1;\n // if there are more substeps, we want to complete the current one and proceed to the next substep\n } else {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value++;\n }\n // If there are no substeps, we want to complete the current step and reset the step to -1\n } else {\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value = -1;\n }\n } else {\n if (stepHasSubsteps(activeStepIndex.value)) {\n const hasNoActiveSubstep = activeSubstepIndex.value === -1;\n const isLastSubstep = activeSubstepIndex.value === steps.value[activeStepIndex.value].substeps.length - 1;\n\n // if there are no active substeps, we want to activate the first substep\n if (hasNoActiveSubstep) {\n activeSubstepIndex.value++;\n // if the active substep is the last one, we want to go to the next step\n } else if (isLastSubstep) {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value = -1;\n\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value++;\n\n // If the step we just navigated to has substeps, we want to activate the first substep right away\n if (stepHasSubsteps(activeStepIndex.value) && activeSubstepIndex.value === -1) {\n activeSubstepIndex.value++;\n }\n // if there are more substeps, we want to complete the current one and proceed to the next substep\n } else {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value++;\n }\n } else {\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value++;\n\n // If the step we just navigated to has substeps, we want to activate the first substep right away\n if (stepHasSubsteps(activeStepIndex.value) && activeSubstepIndex.value === -1) {\n activeSubstepIndex.value++;\n }\n }\n }\n }\n\n function back(): void {\n // We don't want to go back if there is no active step\n if (activeStepIndex.value === -1) {\n return;\n }\n\n if (stepHasSubsteps(activeStepIndex.value)) {\n // If the active substep is the first one, we want to go back to the previous step\n if (activeSubstepIndex.value === 0) {\n activeStepIndex.value--;\n activeSubstepIndex.value--;\n\n // If the step that we just navigated to has substeps, we want to navigate to the last substep\n if (activeStepIndex.value >= 0 && stepHasSubsteps(activeStepIndex.value)) {\n activeSubstepIndex.value = steps.value[activeStepIndex.value].substeps.length - 1;\n }\n } else {\n activeSubstepIndex.value--;\n }\n } else {\n activeStepIndex.value--;\n\n // If the step that we just navigated to has substeps, we want to navigate to the last substep\n if (activeStepIndex.value >= 0 && stepHasSubsteps(activeStepIndex.value)) {\n activeSubstepIndex.value = steps.value[activeStepIndex.value].substeps.length - 1;\n }\n }\n }\n\n /**\n * Navigates to a specific step and substep.\n */\n function goTo(stepIndex: number, substepIndex = -1): void {\n // A linear stepper prevents navigation to incomplete steps\n if (options.linear) {\n if (isStepCompleted(stepIndex - 1) || stepIndex === 0) {\n if (stepHasSubsteps(stepIndex)) {\n if (substepIndex <= 0) {\n activeSubstepIndex.value = 0;\n } else if (isStepCompleted(stepIndex, substepIndex - 1)) {\n activeSubstepIndex.value = substepIndex;\n }\n }\n activeStepIndex.value = stepIndex;\n }\n } else {\n activeStepIndex.value = stepIndex;\n\n if (stepHasSubsteps(stepIndex)) {\n if (substepIndex < 0) {\n activeSubstepIndex.value = 0;\n } else {\n activeSubstepIndex.value = substepIndex;\n }\n }\n }\n }\n\n /**\n * Returns true if the step is completed.\n * if the substep index is provided, check if the substep is completed.\n */\n function isStepCompleted(stepIndex: number, substepIndex = -1): boolean {\n if (substepIndex >= 0) {\n return steps.value[stepIndex]?.substeps[substepIndex]?.completed;\n } else {\n return steps.value[stepIndex]?.completed;\n }\n }\n\n /**\n * Returns true if the step is active.\n * if the substep index is provided, check both if the step and the substep are active.\n */\n function isStepActive(stepIndex: number, substepIndex = -1): boolean {\n if (substepIndex >= 0) {\n return activeStepIndex.value === stepIndex && activeSubstepIndex.value === substepIndex;\n } else {\n return activeStepIndex.value === stepIndex;\n }\n }\n\n /**\n * Registers a new step or substep into the steps array\n */\n function registerStep(nested = false): void {\n if (nested && !steps.value.length) {\n throw new Error('Cannot register a substep without a parent step.');\n }\n\n if (nested) {\n steps.value[steps.value.length - 1].substeps.push({ completed: false });\n } else {\n steps.value.push({ completed: false, substeps: [] });\n }\n }\n\n return {\n steps: readonly(steps),\n stepCount,\n activeStepElement,\n activeStepIndex,\n activeSubstepIndex,\n registerStep,\n next,\n back,\n goTo,\n isStepActive,\n isStepCompleted,\n };\n}\n"],"names":["useStepper","options","steps","ref","stepCount","computed","activeStepIndex","activeSubstepIndex","stepElements","_b","_a","activeStepElement","stepHasSubsteps","stepIndex","next","hasNoActiveStep","isLastStep","hasNoActiveSubstep","isLastSubstep","back","goTo","substepIndex","isStepCompleted","_c","isStepActive","registerStep","nested","readonly"],"mappings":";AA8BA,SAAwBA,EACtBC,IAA0B;AAAA,EACxB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,OAAO,CAAC;AACV,GACA;AAKA,QAAMC,IAAQC,EAA2BF,EAAQ,QAAQ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,MACvBQ,KAAgB,IAClBd,EAAmB,QAAQ,IAClBe,EAAgBT,GAAWQ,IAAe,CAAC,MACpDd,EAAmB,QAAQc,KAG/Bf,EAAgB,QAAQO,MAG1BP,EAAgB,QAAQO,GAEpBD,EAAgBC,CAAS,MACvBQ,IAAe,IACjBd,EAAmB,QAAQ,IAE3BA,EAAmB,QAAQc;AAAA,EAInC;AAMS,WAAAC,EAAgBT,GAAmBQ,IAAe,IAAa;;AACtE,WAAIA,KAAgB,KACXZ,KAAAC,IAAAR,EAAM,MAAMW,CAAS,MAArB,gBAAAH,EAAwB,SAASW,OAAjC,gBAAAZ,EAAgD,aAEhDc,IAAArB,EAAM,MAAMW,CAAS,MAArB,gBAAAU,EAAwB;AAAA,EAEnC;AAMS,WAAAC,EAAaX,GAAmBQ,IAAe,IAAa;AACnE,WAAIA,KAAgB,IACXf,EAAgB,UAAUO,KAAaN,EAAmB,UAAUc,IAEpEf,EAAgB,UAAUO;AAAA,EAErC;AAKS,WAAAY,EAAaC,IAAS,IAAa;AAC1C,QAAIA,KAAU,CAACxB,EAAM,MAAM;AACnB,YAAA,IAAI,MAAM,kDAAkD;AAGpE,IAAIwB,IACIxB,EAAA,MAAMA,EAAM,MAAM,SAAS,CAAC,EAAE,SAAS,KAAK,EAAE,WAAW,GAAO,CAAA,IAEhEA,EAAA,MAAM,KAAK,EAAE,WAAW,IAAO,UAAU,IAAI;AAAA,EAEvD;AAEO,SAAA;AAAA,IACL,OAAOyB,EAASzB,CAAK;AAAA,IACrB,WAAAE;AAAA,IACA,mBAAAO;AAAA,IACA,iBAAAL;AAAA,IACA,oBAAAC;AAAA,IACA,cAAAkB;AAAA,IACA,MAAAX;AAAA,IACA,MAAAK;AAAA,IACA,MAAAC;AAAA,IACA,cAAAI;AAAA,IACA,iBAAAF;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useStepper.js","sources":["../src/composables/useStepper/useStepper.ts"],"sourcesContent":["import { computed, readonly, Ref, ref } from 'vue';\n\nexport interface StepDefinition {\n completed: boolean;\n substeps: Array<Omit<StepDefinition, 'substeps'>>;\n}\n\nexport interface StepperOptions {\n /**\n * If true, the stepper will prevent skipping steps\n */\n linear?: boolean;\n /**\n * The index of the active step\n */\n activeStep?: number;\n /**\n * The index of the active substep\n */\n activeSubstep?: number;\n /**\n * The stepper representation as an array of steps and substeps\n */\n steps?: Array<StepDefinition>;\n /**\n * A ref to the stepper element\n */\n ref?: Ref<HTMLUListElement | null>;\n}\n\nexport default function useStepper(\n options: StepperOptions = {\n linear: false,\n activeStep: -1,\n activeSubstep: -1,\n steps: [],\n },\n) {\n /**\n * The steps and substeps of the stepper, so we can keep track of their state.\n * Can be populated with the `steps` option, or via the `registerStep` function.\n */\n const steps = ref<Array<StepDefinition>>(options.steps ? options.steps : []);\n\n const stepCount = computed(() => steps.value.length);\n\n const activeStepIndex = ref(\n options.activeStep !== null && options.activeStep !== undefined ? options.activeStep : -1,\n );\n const activeSubstepIndex = ref(\n options.activeSubstep !== null && options.activeSubstep !== undefined ? options.activeSubstep : -1,\n );\n\n const stepElements = computed(() => {\n return Array.from((options.ref?.value?.children || []) as HTMLCollectionOf<HTMLLIElement>);\n });\n\n const activeStepElement = computed(() => stepElements.value[activeStepIndex.value]);\n\n /**\n * Returns true if the step at the given index has substeps\n * @param stepIndex The index of the step to check\n */\n function stepHasSubsteps(stepIndex: number): boolean {\n return !!steps.value[stepIndex].substeps.length;\n }\n\n /**\n * Goes to the next step or substep, while flagging the current one as completed.\n * If the current step has substeps, it will go to the next substep if there are any, or to the next substep.\n * And if the next step has substeps, automatically goes to the first substep\n */\n function next(): void {\n const hasNoActiveStep = activeStepIndex.value === -1;\n const isLastStep = activeStepIndex.value === steps.value.length - 1;\n\n // If there is no active step, we want to activate the first step\n if (hasNoActiveStep) {\n activeStepIndex.value++;\n\n // If the step we just navigated to has substeps, we want to activate the first substep\n if (stepHasSubsteps(activeStepIndex.value)) {\n activeSubstepIndex.value++;\n }\n } else if (isLastStep) {\n if (stepHasSubsteps(activeStepIndex.value)) {\n const hasNoActiveSubstep = activeSubstepIndex.value === -1;\n const isLastSubstep = activeSubstepIndex.value === steps.value[activeStepIndex.value].substeps.length - 1;\n\n // if there are no active substeps, we want to activate the first substep\n if (hasNoActiveSubstep) {\n activeSubstepIndex.value++;\n // if the active substep is the last one, we want to reset the step and substep to -1\n } else if (isLastSubstep) {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value = -1;\n\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value = -1;\n // if there are more substeps, we want to complete the current one and proceed to the next substep\n } else {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value++;\n }\n // If there are no substeps, we want to complete the current step and reset the step to -1\n } else {\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value = -1;\n }\n } else {\n if (stepHasSubsteps(activeStepIndex.value)) {\n const hasNoActiveSubstep = activeSubstepIndex.value === -1;\n const isLastSubstep = activeSubstepIndex.value === steps.value[activeStepIndex.value].substeps.length - 1;\n\n // if there are no active substeps, we want to activate the first substep\n if (hasNoActiveSubstep) {\n activeSubstepIndex.value++;\n // if the active substep is the last one, we want to go to the next step\n } else if (isLastSubstep) {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value = -1;\n\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value++;\n\n // If the step we just navigated to has substeps, we want to activate the first substep right away\n if (stepHasSubsteps(activeStepIndex.value) && activeSubstepIndex.value === -1) {\n activeSubstepIndex.value++;\n }\n // if there are more substeps, we want to complete the current one and proceed to the next substep\n } else {\n steps.value[activeStepIndex.value].substeps[activeSubstepIndex.value].completed = true;\n activeSubstepIndex.value++;\n }\n } else {\n steps.value[activeStepIndex.value].completed = true;\n activeStepIndex.value++;\n\n // If the step we just navigated to has substeps, we want to activate the first substep right away\n if (stepHasSubsteps(activeStepIndex.value) && activeSubstepIndex.value === -1) {\n activeSubstepIndex.value++;\n }\n }\n }\n }\n\n function back(): void {\n // We don't want to go back if there is no active step\n if (activeStepIndex.value === -1) {\n return;\n }\n\n if (stepHasSubsteps(activeStepIndex.value)) {\n // If the active substep is the first one, we want to go back to the previous step\n if (activeSubstepIndex.value === 0) {\n activeStepIndex.value--;\n activeSubstepIndex.value--;\n\n // If the step that we just navigated to has substeps, we want to navigate to the last substep\n if (activeStepIndex.value >= 0 && stepHasSubsteps(activeStepIndex.value)) {\n activeSubstepIndex.value = steps.value[activeStepIndex.value].substeps.length - 1;\n }\n } else {\n activeSubstepIndex.value--;\n }\n } else {\n activeStepIndex.value--;\n\n // If the step that we just navigated to has substeps, we want to navigate to the last substep\n if (activeStepIndex.value >= 0 && stepHasSubsteps(activeStepIndex.value)) {\n activeSubstepIndex.value = steps.value[activeStepIndex.value].substeps.length - 1;\n }\n }\n }\n\n /**\n * Navigates to a specific step and substep.\n */\n function goTo(stepIndex: number, substepIndex = -1): void {\n // A linear stepper prevents navigation to incomplete steps\n if (options.linear) {\n if (isStepCompleted(stepIndex - 1) || stepIndex === 0) {\n if (stepHasSubsteps(stepIndex)) {\n if (substepIndex <= 0) {\n activeSubstepIndex.value = 0;\n } else if (isStepCompleted(stepIndex, substepIndex - 1)) {\n activeSubstepIndex.value = substepIndex;\n }\n }\n activeStepIndex.value = stepIndex;\n }\n } else {\n activeStepIndex.value = stepIndex;\n\n if (stepHasSubsteps(stepIndex)) {\n if (substepIndex < 0) {\n activeSubstepIndex.value = 0;\n } else {\n activeSubstepIndex.value = substepIndex;\n }\n }\n }\n }\n\n /**\n * Returns true if the step is completed.\n * if the substep index is provided, check if the substep is completed.\n */\n function isStepCompleted(stepIndex: number, substepIndex = -1): boolean {\n if (substepIndex >= 0) {\n return steps.value[stepIndex]?.substeps[substepIndex]?.completed;\n } else {\n return steps.value[stepIndex]?.completed;\n }\n }\n\n /**\n * Returns true if the step is active.\n * if the substep index is provided, check both if the step and the substep are active.\n */\n function isStepActive(stepIndex: number, substepIndex = -1): boolean {\n if (substepIndex >= 0) {\n return activeStepIndex.value === stepIndex && activeSubstepIndex.value === substepIndex;\n } else {\n return activeStepIndex.value === stepIndex;\n }\n }\n\n /**\n * Registers a new step or substep into the steps array\n */\n function registerStep(nested = false): void {\n if (nested && !steps.value.length) {\n throw new Error('Cannot register a substep without a parent step.');\n }\n\n if (nested) {\n steps.value[steps.value.length - 1].substeps.push({ completed: false });\n } else {\n steps.value.push({ completed: false, substeps: [] });\n }\n }\n\n return {\n steps: readonly(steps),\n stepCount,\n activeStepElement,\n activeStepIndex,\n activeSubstepIndex,\n registerStep,\n next,\n back,\n goTo,\n isStepActive,\n isStepCompleted,\n };\n}\n"],"names":["useStepper","options","steps","ref","stepCount","computed","activeStepIndex","activeSubstepIndex","stepElements","_b","_a","activeStepElement","stepHasSubsteps","stepIndex","next","hasNoActiveStep","isLastStep","hasNoActiveSubstep","isLastSubstep","back","goTo","substepIndex","isStepCompleted","_c","isStepActive","registerStep","nested","readonly"],"mappings":";AA8BA,SAAwBA,EACtBC,IAA0B;AAAA,EACxB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,OAAO,CAAC;AACV,GACA;AAKA,QAAMC,IAAQC,EAA2BF,EAAQ,QAAQA,EAAQ,QAAQ,CAAA,CAAE,GAErEG,IAAYC,EAAS,MAAMH,EAAM,MAAM,MAAM,GAE7CI,IAAkBH;AAAA,IACtBF,EAAQ,eAAe,QAAQA,EAAQ,eAAe,SAAYA,EAAQ,aAAa;AAAA,EAAA,GAEnFM,IAAqBJ;AAAA,IACzBF,EAAQ,kBAAkB,QAAQA,EAAQ,kBAAkB,SAAYA,EAAQ,gBAAgB;AAAA,EAAA,GAG5FO,IAAeH,EAAS,MAAM;;AAClC,WAAO,MAAM,OAAMI,KAAAC,IAAAT,EAAQ,QAAR,gBAAAS,EAAa,UAAb,gBAAAD,EAAoB,aAAY,CAAA,CAAsC;AAAA,EAAA,CAC1F,GAEKE,IA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