@nuxt/ui 2.12.3 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/module.d.mts +170 -40
- package/dist/module.d.ts +170 -40
- package/dist/module.json +2 -2
- package/dist/module.mjs +136 -146
- package/dist/runtime/components/data/Table.vue +16 -4
- package/dist/runtime/components/data/Table.vue.d.ts +21 -3
- package/dist/runtime/components/elements/Accordion.vue +11 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Alert.vue +2 -2
- package/dist/runtime/components/elements/Alert.vue.d.ts +4 -3
- package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Badge.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Button.vue.d.ts +63 -37
- package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Carousel.vue +156 -0
- package/dist/runtime/components/elements/Carousel.vue.d.ts +104 -0
- package/dist/runtime/components/elements/Chip.vue.d.ts +5 -5
- package/dist/runtime/components/elements/Dropdown.vue +5 -3
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Link.vue +3 -3
- package/dist/runtime/components/elements/Link.vue.d.ts +62 -36
- package/dist/runtime/components/elements/Meter.vue +4 -0
- package/dist/runtime/components/elements/Meter.vue.d.ts +4 -4
- package/dist/runtime/components/elements/MeterGroup.d.ts +4 -4
- package/dist/runtime/components/elements/Progress.vue +4 -1
- package/dist/runtime/components/elements/Progress.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Checkbox.vue +1 -6
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +6 -15
- package/dist/runtime/components/forms/Form.vue +13 -6
- package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +20 -17
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Input.vue +1 -0
- package/dist/runtime/components/forms/Input.vue.d.ts +6 -6
- package/dist/runtime/components/forms/InputMenu.vue +12 -1
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +16 -7
- package/dist/runtime/components/forms/Radio.vue +5 -11
- package/dist/runtime/components/forms/Radio.vue.d.ts +6 -6
- package/dist/runtime/components/forms/RadioGroup.vue +1 -0
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +4 -4
- package/dist/runtime/components/forms/Range.vue.d.ts +4 -4
- package/dist/runtime/components/forms/Select.vue +5 -1
- package/dist/runtime/components/forms/Select.vue.d.ts +6 -6
- package/dist/runtime/components/forms/SelectMenu.vue +5 -2
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +7 -7
- package/dist/runtime/components/forms/Textarea.vue +5 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +15 -6
- package/dist/runtime/components/forms/Toggle.vue +4 -2
- package/dist/runtime/components/forms/Toggle.vue.d.ts +6 -6
- package/dist/runtime/components/layout/Card.vue +1 -1
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue +8 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/HorizontalNavigation.vue +102 -0
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +44 -0
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +3 -3
- package/dist/runtime/components/navigation/Tabs.vue +8 -8
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
- package/dist/runtime/components/navigation/VerticalNavigation.vue +12 -3
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Modal.vue +9 -3
- package/dist/runtime/components/overlays/Modal.vue.d.ts +6 -5
- package/dist/runtime/components/overlays/Modals.client.vue +12 -0
- package/dist/runtime/components/overlays/Notification.vue +2 -2
- package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Popover.vue +5 -3
- package/dist/runtime/components/overlays/Popover.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Slideover.vue +9 -3
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +6 -5
- package/dist/runtime/components/overlays/Tooltip.vue +2 -2
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +6 -6
- package/dist/runtime/composables/useCarouselScroll.d.ts +2 -0
- package/dist/runtime/composables/useCarouselScroll.mjs +35 -0
- package/dist/runtime/composables/useFormGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormGroup.mjs +9 -12
- package/dist/runtime/composables/useModal.d.ts +12 -0
- package/dist/runtime/composables/useModal.mjs +37 -0
- package/dist/runtime/composables/usePopper.d.ts +3 -3
- package/dist/runtime/plugins/modals.d.ts +2 -0
- package/dist/runtime/plugins/modals.mjs +10 -0
- package/dist/runtime/types/component.d.ts +14 -0
- package/dist/runtime/types/divider.d.ts +3 -0
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/horizontal-navigation.d.ts +13 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/modal.d.ts +18 -0
- package/dist/runtime/types/progress.d.ts +2 -0
- package/dist/runtime/types/range.d.ts +2 -0
- package/dist/runtime/types/toggle.d.ts +2 -0
- package/dist/runtime/types/vertical-navigation.d.ts +2 -1
- package/dist/runtime/ui.config/data/table.d.ts +7 -0
- package/dist/runtime/ui.config/data/table.mjs +10 -3
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
- package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
- package/dist/runtime/ui.config/elements/carousel.d.ts +27 -0
- package/dist/runtime/ui.config/elements/carousel.mjs +26 -0
- package/dist/runtime/ui.config/elements/dropdown.d.ts +5 -1
- package/dist/runtime/ui.config/elements/dropdown.mjs +8 -4
- package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
- package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
- package/dist/runtime/ui.config/forms/input.d.ts +11 -0
- package/dist/runtime/ui.config/forms/input.mjs +11 -0
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +1 -1
- package/dist/runtime/ui.config/forms/inputMenu.mjs +5 -5
- package/dist/runtime/ui.config/forms/select.d.ts +11 -0
- package/dist/runtime/ui.config/forms/select.mjs +1 -1
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +1 -1
- package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
- package/dist/runtime/ui.config/index.d.ts +2 -0
- package/dist/runtime/ui.config/index.mjs +2 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
- package/dist/runtime/ui.config/layout/divider.mjs +20 -3
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +4 -4
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +1 -1
- package/dist/runtime/ui.config/navigation/commandPalette.mjs +8 -8
- package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +27 -0
- package/dist/runtime/ui.config/navigation/horizontalNavigation.mjs +26 -0
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +4 -3
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +8 -7
- package/dist/runtime/ui.config/overlays/popover.d.ts +4 -0
- package/dist/runtime/ui.config/overlays/popover.mjs +4 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +2 -2
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +4 -0
- package/dist/runtime/ui.config/overlays/tooltip.mjs +4 -0
- package/dist/runtime/ui.css +1 -1
- package/dist/runtime/utils/colors.d.ts +3 -0
- package/dist/runtime/utils/colors.mjs +261 -0
- package/dist/runtime/utils/index.mjs +9 -0
- package/dist/runtime/utils/link.d.ts +24 -11
- package/dist/runtime/utils/link.mjs +26 -13
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +24 -22
- package/dist/runtime/utils/uid.d.ts +0 -1
- package/dist/runtime/utils/uid.mjs +0 -5
|
@@ -83,54 +83,67 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
83
|
to: {
|
|
84
84
|
readonly type: PropType<RouteLocationRaw>;
|
|
85
85
|
readonly default: undefined;
|
|
86
|
+
readonly required: false;
|
|
86
87
|
};
|
|
87
88
|
href: {
|
|
88
89
|
readonly type: PropType<RouteLocationRaw>;
|
|
89
90
|
readonly default: undefined;
|
|
91
|
+
readonly required: false;
|
|
90
92
|
};
|
|
91
93
|
target: {
|
|
92
|
-
readonly type: PropType<
|
|
94
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
93
95
|
readonly default: undefined;
|
|
96
|
+
readonly required: false;
|
|
94
97
|
};
|
|
95
98
|
rel: {
|
|
96
|
-
readonly type: PropType<
|
|
99
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
97
100
|
readonly default: undefined;
|
|
101
|
+
readonly required: false;
|
|
98
102
|
};
|
|
99
103
|
noRel: {
|
|
100
|
-
readonly type:
|
|
104
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
101
105
|
readonly default: undefined;
|
|
106
|
+
readonly required: false;
|
|
102
107
|
};
|
|
103
108
|
prefetch: {
|
|
104
|
-
readonly type:
|
|
109
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
105
110
|
readonly default: undefined;
|
|
111
|
+
readonly required: false;
|
|
106
112
|
};
|
|
107
113
|
noPrefetch: {
|
|
108
|
-
readonly type:
|
|
114
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
109
115
|
readonly default: undefined;
|
|
116
|
+
readonly required: false;
|
|
110
117
|
};
|
|
111
118
|
activeClass: {
|
|
112
|
-
readonly type:
|
|
119
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
113
120
|
readonly default: undefined;
|
|
121
|
+
readonly required: false;
|
|
114
122
|
};
|
|
115
123
|
exactActiveClass: {
|
|
116
|
-
readonly type:
|
|
124
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
117
125
|
readonly default: undefined;
|
|
126
|
+
readonly required: false;
|
|
118
127
|
};
|
|
119
128
|
prefetchedClass: {
|
|
120
|
-
readonly type:
|
|
129
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
121
130
|
readonly default: undefined;
|
|
131
|
+
readonly required: false;
|
|
122
132
|
};
|
|
123
133
|
replace: {
|
|
124
|
-
readonly type:
|
|
134
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
125
135
|
readonly default: undefined;
|
|
136
|
+
readonly required: false;
|
|
126
137
|
};
|
|
127
138
|
ariaCurrentValue: {
|
|
128
|
-
readonly type:
|
|
139
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
129
140
|
readonly default: undefined;
|
|
141
|
+
readonly required: false;
|
|
130
142
|
};
|
|
131
143
|
external: {
|
|
132
|
-
readonly type:
|
|
144
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
133
145
|
readonly default: undefined;
|
|
146
|
+
readonly required: false;
|
|
134
147
|
};
|
|
135
148
|
}, {
|
|
136
149
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -146,7 +159,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
146
159
|
leadingIconClass: import("vue").ComputedRef<string>;
|
|
147
160
|
trailingIconClass: import("vue").ComputedRef<string>;
|
|
148
161
|
linkProps: import("vue").ComputedRef<{}>;
|
|
149
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
162
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
150
163
|
type: {
|
|
151
164
|
type: StringConstructor;
|
|
152
165
|
default: string;
|
|
@@ -229,54 +242,67 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
229
242
|
to: {
|
|
230
243
|
readonly type: PropType<RouteLocationRaw>;
|
|
231
244
|
readonly default: undefined;
|
|
245
|
+
readonly required: false;
|
|
232
246
|
};
|
|
233
247
|
href: {
|
|
234
248
|
readonly type: PropType<RouteLocationRaw>;
|
|
235
249
|
readonly default: undefined;
|
|
250
|
+
readonly required: false;
|
|
236
251
|
};
|
|
237
252
|
target: {
|
|
238
|
-
readonly type: PropType<
|
|
253
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
239
254
|
readonly default: undefined;
|
|
255
|
+
readonly required: false;
|
|
240
256
|
};
|
|
241
257
|
rel: {
|
|
242
|
-
readonly type: PropType<
|
|
258
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
243
259
|
readonly default: undefined;
|
|
260
|
+
readonly required: false;
|
|
244
261
|
};
|
|
245
262
|
noRel: {
|
|
246
|
-
readonly type:
|
|
263
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
247
264
|
readonly default: undefined;
|
|
265
|
+
readonly required: false;
|
|
248
266
|
};
|
|
249
267
|
prefetch: {
|
|
250
|
-
readonly type:
|
|
268
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
251
269
|
readonly default: undefined;
|
|
270
|
+
readonly required: false;
|
|
252
271
|
};
|
|
253
272
|
noPrefetch: {
|
|
254
|
-
readonly type:
|
|
273
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
255
274
|
readonly default: undefined;
|
|
275
|
+
readonly required: false;
|
|
256
276
|
};
|
|
257
277
|
activeClass: {
|
|
258
|
-
readonly type:
|
|
278
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
259
279
|
readonly default: undefined;
|
|
280
|
+
readonly required: false;
|
|
260
281
|
};
|
|
261
282
|
exactActiveClass: {
|
|
262
|
-
readonly type:
|
|
283
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
263
284
|
readonly default: undefined;
|
|
285
|
+
readonly required: false;
|
|
264
286
|
};
|
|
265
287
|
prefetchedClass: {
|
|
266
|
-
readonly type:
|
|
288
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
267
289
|
readonly default: undefined;
|
|
290
|
+
readonly required: false;
|
|
268
291
|
};
|
|
269
292
|
replace: {
|
|
270
|
-
readonly type:
|
|
293
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
271
294
|
readonly default: undefined;
|
|
295
|
+
readonly required: false;
|
|
272
296
|
};
|
|
273
297
|
ariaCurrentValue: {
|
|
274
|
-
readonly type:
|
|
298
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
275
299
|
readonly default: undefined;
|
|
300
|
+
readonly required: false;
|
|
276
301
|
};
|
|
277
302
|
external: {
|
|
278
|
-
readonly type:
|
|
303
|
+
readonly type: PropType<NuxtLinkProps>;
|
|
279
304
|
readonly default: undefined;
|
|
305
|
+
readonly required: false;
|
|
280
306
|
};
|
|
281
307
|
}>>, {
|
|
282
308
|
size: ButtonSize;
|
|
@@ -285,13 +311,23 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
285
311
|
icon: string;
|
|
286
312
|
color: any;
|
|
287
313
|
type: string;
|
|
288
|
-
leading: boolean;
|
|
289
|
-
replace: boolean;
|
|
290
314
|
class: any;
|
|
315
|
+
target: NuxtLinkProps;
|
|
316
|
+
rel: NuxtLinkProps;
|
|
317
|
+
noRel: NuxtLinkProps;
|
|
318
|
+
prefetch: NuxtLinkProps;
|
|
319
|
+
noPrefetch: NuxtLinkProps;
|
|
320
|
+
activeClass: NuxtLinkProps;
|
|
321
|
+
exactActiveClass: NuxtLinkProps;
|
|
322
|
+
prefetchedClass: NuxtLinkProps;
|
|
323
|
+
replace: NuxtLinkProps;
|
|
324
|
+
ariaCurrentValue: NuxtLinkProps;
|
|
325
|
+
external: NuxtLinkProps;
|
|
326
|
+
leading: boolean;
|
|
327
|
+
variant: ButtonVariant;
|
|
291
328
|
label: string;
|
|
292
|
-
loading: boolean;
|
|
293
329
|
disabled: boolean;
|
|
294
|
-
|
|
330
|
+
loading: boolean;
|
|
295
331
|
block: boolean;
|
|
296
332
|
padded: boolean;
|
|
297
333
|
loadingIcon: string;
|
|
@@ -301,15 +337,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
301
337
|
square: boolean;
|
|
302
338
|
to: RouteLocationRaw;
|
|
303
339
|
href: RouteLocationRaw;
|
|
304
|
-
target: (string & {}) | "_blank" | "_parent" | "_self" | "_top" | null;
|
|
305
|
-
rel: string | null;
|
|
306
|
-
noRel: boolean;
|
|
307
|
-
prefetch: boolean;
|
|
308
|
-
noPrefetch: boolean;
|
|
309
|
-
activeClass: string;
|
|
310
|
-
exactActiveClass: string;
|
|
311
|
-
prefetchedClass: string;
|
|
312
|
-
ariaCurrentValue: string;
|
|
313
|
-
external: boolean;
|
|
314
340
|
}, {}>;
|
|
315
341
|
export default _default;
|
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
21
|
};
|
|
22
22
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
23
23
|
[key: string]: any;
|
|
24
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
24
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
25
|
size: {
|
|
26
26
|
type: PropType<ButtonSize>;
|
|
27
27
|
default: null;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ui.wrapper" v-bind="attrs">
|
|
3
|
+
<div ref="carouselRef" :class="ui.container" class="no-scrollbar">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(item, index) in items"
|
|
6
|
+
:key="index"
|
|
7
|
+
:class="ui.item"
|
|
8
|
+
>
|
|
9
|
+
<slot :item="item" :index="index" />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div v-if="arrows" :class="ui.arrows.wrapper">
|
|
14
|
+
<slot name="prev" :on-click="onClickPrev" :disabled="isFirst">
|
|
15
|
+
<UButton
|
|
16
|
+
v-if="prevButton"
|
|
17
|
+
:disabled="isFirst"
|
|
18
|
+
v-bind="{ ...ui.default.prevButton, ...prevButton }"
|
|
19
|
+
:class="twMerge(ui.default.prevButton.class, prevButton?.class)"
|
|
20
|
+
aria-label="Prev"
|
|
21
|
+
@click="onClickPrev"
|
|
22
|
+
/>
|
|
23
|
+
</slot>
|
|
24
|
+
|
|
25
|
+
<slot name="next" :on-click="onClickNext" :disabled="isLast">
|
|
26
|
+
<UButton
|
|
27
|
+
v-if="nextButton"
|
|
28
|
+
:disabled="isLast"
|
|
29
|
+
v-bind="{ ...ui.default.nextButton, ...nextButton }"
|
|
30
|
+
:class="twMerge(ui.default.nextButton.class, nextButton?.class)"
|
|
31
|
+
aria-label="Next"
|
|
32
|
+
@click="onClickNext"
|
|
33
|
+
/>
|
|
34
|
+
</slot>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div v-if="indicators" :class="ui.indicators.wrapper">
|
|
38
|
+
<template v-for="page in pages" :key="page">
|
|
39
|
+
<slot name="indicator" :on-click="onClick" :active="page === currentPage" :page="page">
|
|
40
|
+
<button
|
|
41
|
+
type="button"
|
|
42
|
+
:class="[
|
|
43
|
+
ui.indicators.base,
|
|
44
|
+
page === currentPage ? ui.indicators.active : ui.indicators.inactive
|
|
45
|
+
]"
|
|
46
|
+
:aria-label="`set slide ${page}`"
|
|
47
|
+
@click="onClick(page)"
|
|
48
|
+
/>
|
|
49
|
+
</slot>
|
|
50
|
+
</template>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import { ref, toRef, toRefs, computed, defineComponent } from "vue";
|
|
57
|
+
import { twMerge } from "tailwind-merge";
|
|
58
|
+
import { mergeConfig } from "../../utils";
|
|
59
|
+
import UButton from "../elements/Button.vue";
|
|
60
|
+
import { useUI } from "../../composables/useUI";
|
|
61
|
+
import { useCarouselScroll } from "../../composables/useCarouselScroll";
|
|
62
|
+
import { useScroll, useResizeObserver, useElementSize } from "@vueuse/core";
|
|
63
|
+
import appConfig from "#build/app.config";
|
|
64
|
+
import { carousel } from "#ui/ui.config";
|
|
65
|
+
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.carousel, carousel);
|
|
66
|
+
export default defineComponent({
|
|
67
|
+
components: {
|
|
68
|
+
UButton
|
|
69
|
+
},
|
|
70
|
+
inheritAttrs: false,
|
|
71
|
+
props: {
|
|
72
|
+
items: {
|
|
73
|
+
type: Array,
|
|
74
|
+
default: () => []
|
|
75
|
+
},
|
|
76
|
+
arrows: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
indicators: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
prevButton: {
|
|
85
|
+
type: Object,
|
|
86
|
+
default: () => config.default.prevButton
|
|
87
|
+
},
|
|
88
|
+
nextButton: {
|
|
89
|
+
type: Object,
|
|
90
|
+
default: () => config.default.nextButton
|
|
91
|
+
},
|
|
92
|
+
class: {
|
|
93
|
+
type: [String, Object, Array],
|
|
94
|
+
default: () => ""
|
|
95
|
+
},
|
|
96
|
+
ui: {
|
|
97
|
+
type: Object,
|
|
98
|
+
default: void 0
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
setup(props, { expose }) {
|
|
102
|
+
const { ui, attrs } = useUI("carousel", toRef(props, "ui"), config, toRef(props, "class"));
|
|
103
|
+
const carouselRef = ref();
|
|
104
|
+
const itemWidth = ref(0);
|
|
105
|
+
const { x, arrivedState } = useScroll(carouselRef, { behavior: "smooth" });
|
|
106
|
+
const { width: carouselWidth } = useElementSize(carouselRef);
|
|
107
|
+
const { left: isFirst, right: isLast } = toRefs(arrivedState);
|
|
108
|
+
useCarouselScroll(carouselRef);
|
|
109
|
+
useResizeObserver(carouselRef, (entries) => {
|
|
110
|
+
const [entry] = entries;
|
|
111
|
+
itemWidth.value = entry?.target?.firstElementChild?.clientWidth || 0;
|
|
112
|
+
});
|
|
113
|
+
const currentPage = computed(() => Math.round(x.value / itemWidth.value) + 1);
|
|
114
|
+
const pages = computed(() => {
|
|
115
|
+
if (!itemWidth.value) {
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
return props.items.length - Math.round(carouselWidth.value / itemWidth.value) + 1;
|
|
119
|
+
});
|
|
120
|
+
function onClickNext() {
|
|
121
|
+
x.value += itemWidth.value;
|
|
122
|
+
}
|
|
123
|
+
function onClickPrev() {
|
|
124
|
+
x.value -= itemWidth.value;
|
|
125
|
+
}
|
|
126
|
+
function onClick(page) {
|
|
127
|
+
x.value = (page - 1) * itemWidth.value;
|
|
128
|
+
}
|
|
129
|
+
expose({
|
|
130
|
+
pages,
|
|
131
|
+
page: currentPage,
|
|
132
|
+
prev: onClickPrev,
|
|
133
|
+
next: onClickNext,
|
|
134
|
+
select: onClick
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
138
|
+
ui,
|
|
139
|
+
attrs,
|
|
140
|
+
isFirst,
|
|
141
|
+
isLast,
|
|
142
|
+
carouselRef,
|
|
143
|
+
pages,
|
|
144
|
+
currentPage,
|
|
145
|
+
onClickNext,
|
|
146
|
+
onClickPrev,
|
|
147
|
+
onClick,
|
|
148
|
+
twMerge
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<style scoped>
|
|
155
|
+
.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}
|
|
156
|
+
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { Button } from '../../types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
items: {
|
|
5
|
+
type: PropType<any[]>;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
arrows: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
indicators: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
prevButton: {
|
|
17
|
+
type: PropType<Button & {
|
|
18
|
+
class?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
default: () => Button & {
|
|
21
|
+
class?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
nextButton: {
|
|
25
|
+
type: PropType<Button & {
|
|
26
|
+
class?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
default: () => Button & {
|
|
29
|
+
class?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
class: {
|
|
33
|
+
type: PropType<any>;
|
|
34
|
+
default: () => string;
|
|
35
|
+
};
|
|
36
|
+
ui: {
|
|
37
|
+
type: PropType<Partial<any>>;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
ui: import("vue").ComputedRef<any>;
|
|
42
|
+
attrs: import("vue").ComputedRef<Pick<{
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
}, string>>;
|
|
45
|
+
isFirst: import("vue").Ref<boolean>;
|
|
46
|
+
isLast: import("vue").Ref<boolean>;
|
|
47
|
+
carouselRef: import("vue").Ref<HTMLElement | undefined>;
|
|
48
|
+
pages: import("vue").ComputedRef<number>;
|
|
49
|
+
currentPage: import("vue").ComputedRef<number>;
|
|
50
|
+
onClickNext: () => void;
|
|
51
|
+
onClickPrev: () => void;
|
|
52
|
+
onClick: (page: number) => void;
|
|
53
|
+
twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
54
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
|
+
items: {
|
|
56
|
+
type: PropType<any[]>;
|
|
57
|
+
default: () => never[];
|
|
58
|
+
};
|
|
59
|
+
arrows: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
indicators: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
prevButton: {
|
|
68
|
+
type: PropType<Button & {
|
|
69
|
+
class?: string | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
default: () => Button & {
|
|
72
|
+
class?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
nextButton: {
|
|
76
|
+
type: PropType<Button & {
|
|
77
|
+
class?: string | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
default: () => Button & {
|
|
80
|
+
class?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
class: {
|
|
84
|
+
type: PropType<any>;
|
|
85
|
+
default: () => string;
|
|
86
|
+
};
|
|
87
|
+
ui: {
|
|
88
|
+
type: PropType<Partial<any>>;
|
|
89
|
+
default: undefined;
|
|
90
|
+
};
|
|
91
|
+
}>>, {
|
|
92
|
+
ui: Partial<any>;
|
|
93
|
+
class: any;
|
|
94
|
+
items: any[];
|
|
95
|
+
arrows: boolean;
|
|
96
|
+
indicators: boolean;
|
|
97
|
+
prevButton: Button & {
|
|
98
|
+
class?: string | undefined;
|
|
99
|
+
};
|
|
100
|
+
nextButton: Button & {
|
|
101
|
+
class?: string | undefined;
|
|
102
|
+
};
|
|
103
|
+
}, {}>;
|
|
104
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
size: {
|
|
4
|
-
type: PropType<"sm" | "
|
|
4
|
+
type: PropType<"sm" | "2xs" | "md" | "xs" | "3xs" | "lg" | "xl" | "2xl" | "3xl">;
|
|
5
5
|
default: () => any;
|
|
6
6
|
validator(value: string): boolean;
|
|
7
7
|
};
|
|
@@ -41,9 +41,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
[x: string]: unknown;
|
|
42
42
|
}, string>>;
|
|
43
43
|
chipClass: import("vue").ComputedRef<string>;
|
|
44
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
44
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
45
|
size: {
|
|
46
|
-
type: PropType<"sm" | "
|
|
46
|
+
type: PropType<"sm" | "2xs" | "md" | "xs" | "3xs" | "lg" | "xl" | "2xl" | "3xl">;
|
|
47
47
|
default: () => any;
|
|
48
48
|
validator(value: string): boolean;
|
|
49
49
|
};
|
|
@@ -78,12 +78,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
78
78
|
default: () => {};
|
|
79
79
|
};
|
|
80
80
|
}>>, {
|
|
81
|
-
size: "sm" | "
|
|
81
|
+
size: "sm" | "2xs" | "md" | "xs" | "3xs" | "lg" | "xl" | "2xl" | "3xl";
|
|
82
82
|
ui: any;
|
|
83
83
|
color: any;
|
|
84
|
+
class: any;
|
|
84
85
|
inset: boolean;
|
|
85
86
|
position: "top-right" | "bottom-right" | "top-left" | "bottom-left";
|
|
86
|
-
class: any;
|
|
87
87
|
text: string | number;
|
|
88
88
|
show: boolean;
|
|
89
89
|
}, {}>;
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
|
|
57
57
|
<script>
|
|
58
58
|
import { defineComponent, ref, computed, watch, toRef, onMounted, resolveComponent } from "vue";
|
|
59
|
-
import { Menu as HMenu, MenuButton as HMenuButton, MenuItems as HMenuItems, MenuItem as HMenuItem } from "@headlessui/vue";
|
|
59
|
+
import { Menu as HMenu, MenuButton as HMenuButton, MenuItems as HMenuItems, MenuItem as HMenuItem, provideUseId } from "@headlessui/vue";
|
|
60
60
|
import { defu } from "defu";
|
|
61
61
|
import { twMerge, twJoin } from "tailwind-merge";
|
|
62
62
|
import UIcon from "../elements/Icon.vue";
|
|
@@ -67,6 +67,7 @@ import { usePopper } from "../../composables/usePopper";
|
|
|
67
67
|
import { mergeConfig, getNuxtLinkProps } from "../../utils";
|
|
68
68
|
import appConfig from "#build/app.config";
|
|
69
69
|
import { dropdown } from "#ui/ui.config";
|
|
70
|
+
import { useId } from "#imports";
|
|
70
71
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.dropdown, dropdown);
|
|
71
72
|
export default defineComponent({
|
|
72
73
|
components: {
|
|
@@ -103,11 +104,11 @@ export default defineComponent({
|
|
|
103
104
|
},
|
|
104
105
|
openDelay: {
|
|
105
106
|
type: Number,
|
|
106
|
-
default:
|
|
107
|
+
default: () => config.default.openDelay
|
|
107
108
|
},
|
|
108
109
|
closeDelay: {
|
|
109
110
|
type: Number,
|
|
110
|
-
default:
|
|
111
|
+
default: () => config.default.closeDelay
|
|
111
112
|
},
|
|
112
113
|
class: {
|
|
113
114
|
type: [String, Object, Array],
|
|
@@ -221,6 +222,7 @@ export default defineComponent({
|
|
|
221
222
|
emit("update:open", newValue === 0);
|
|
222
223
|
});
|
|
223
224
|
const NuxtLink = resolveComponent("NuxtLink");
|
|
225
|
+
provideUseId(() => useId());
|
|
224
226
|
return {
|
|
225
227
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
226
228
|
ui,
|
|
@@ -25,11 +25,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
};
|
|
26
26
|
openDelay: {
|
|
27
27
|
type: NumberConstructor;
|
|
28
|
-
default:
|
|
28
|
+
default: () => any;
|
|
29
29
|
};
|
|
30
30
|
closeDelay: {
|
|
31
31
|
type: NumberConstructor;
|
|
32
|
-
default:
|
|
32
|
+
default: () => any;
|
|
33
33
|
};
|
|
34
34
|
class: {
|
|
35
35
|
type: PropType<any>;
|
|
@@ -79,8 +79,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
79
|
getNuxtLinkProps: (props: any) => {};
|
|
80
80
|
twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
81
81
|
twJoin: typeof twJoin;
|
|
82
|
-
NuxtLink: string | import("vue").ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
83
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").
|
|
82
|
+
NuxtLink: string | import("vue").ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>;
|
|
83
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
84
84
|
items: {
|
|
85
85
|
type: PropType<DropdownItem[][]>;
|
|
86
86
|
default: () => never[];
|
|
@@ -104,11 +104,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
104
104
|
};
|
|
105
105
|
openDelay: {
|
|
106
106
|
type: NumberConstructor;
|
|
107
|
-
default:
|
|
107
|
+
default: () => any;
|
|
108
108
|
};
|
|
109
109
|
closeDelay: {
|
|
110
110
|
type: NumberConstructor;
|
|
111
|
-
default:
|
|
111
|
+
default: () => any;
|
|
112
112
|
};
|
|
113
113
|
class: {
|
|
114
114
|
type: PropType<any>;
|
|
@@ -122,8 +122,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
122
122
|
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
123
123
|
}, {
|
|
124
124
|
ui: any;
|
|
125
|
-
popper: PopperOptions;
|
|
126
125
|
class: any;
|
|
126
|
+
popper: PopperOptions;
|
|
127
127
|
disabled: boolean;
|
|
128
128
|
items: DropdownItem[][];
|
|
129
129
|
open: boolean;
|
|
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
};
|
|
10
10
|
}, {
|
|
11
11
|
dynamic: import("vue").ComputedRef<any>;
|
|
12
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
12
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
13
|
name: {
|
|
14
14
|
type: StringConstructor;
|
|
15
15
|
required: true;
|
|
@@ -24,7 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
[x: string]: unknown;
|
|
25
25
|
}, string>>;
|
|
26
26
|
kbdClass: import("vue").ComputedRef<string>;
|
|
27
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
27
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
28
|
value: {
|
|
29
29
|
type: StringConstructor;
|
|
30
30
|
default: null;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
v-bind="$attrs"
|
|
8
8
|
:class="active ? activeClass : inactiveClass"
|
|
9
9
|
>
|
|
10
|
-
<slot />
|
|
10
|
+
<slot v-bind="{ isActive: active }" />
|
|
11
11
|
</component>
|
|
12
12
|
<NuxtLink
|
|
13
13
|
v-else
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
:rel="rel"
|
|
24
24
|
:target="target"
|
|
25
25
|
:class="active !== undefined ? (active ? activeClass : inactiveClass) : resolveLinkClass(route, $route, { isActive, isExactActive })"
|
|
26
|
-
@click="(e) => !isExternal && navigate(e)"
|
|
26
|
+
@click="(e) => (!isExternal && !disabled) && navigate(e)"
|
|
27
27
|
>
|
|
28
|
-
<slot v-bind="{ isActive: exact ? isExactActive : isActive }" />
|
|
28
|
+
<slot v-bind="{ isActive: active !== undefined ? active : (exact ? isExactActive : isActive) }" />
|
|
29
29
|
</a>
|
|
30
30
|
</NuxtLink>
|
|
31
31
|
</template>
|