@nuxt/ui 2.14.1 → 2.15.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/dist/module.d.mts +3 -0
- package/dist/module.d.ts +3 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -1
- package/dist/runtime/components/data/Table.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Accordion.vue +13 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +4 -2
- package/dist/runtime/components/elements/Alert.vue +7 -3
- package/dist/runtime/components/elements/Carousel.vue +4 -1
- package/dist/runtime/components/elements/Dropdown.vue +19 -7
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +3 -2
- package/dist/runtime/components/forms/Checkbox.vue +5 -3
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Form.vue.d.ts +9 -3
- package/dist/runtime/components/forms/Input.vue +2 -1
- package/dist/runtime/components/forms/Input.vue.d.ts +3 -2
- package/dist/runtime/components/forms/InputMenu.vue +6 -6
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Radio.vue +8 -3
- package/dist/runtime/components/forms/Radio.vue.d.ts +2 -1
- package/dist/runtime/components/forms/RadioGroup.vue +1 -1
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +1 -1
- package/dist/runtime/components/forms/Range.vue +1 -1
- package/dist/runtime/components/forms/Select.vue +1 -1
- package/dist/runtime/components/forms/Select.vue.d.ts +1 -1
- package/dist/runtime/components/forms/SelectMenu.vue +8 -7
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Textarea.vue +2 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +3 -2
- package/dist/runtime/components/forms/Toggle.vue +31 -4
- package/dist/runtime/components/forms/Toggle.vue.d.ts +19 -0
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +2 -2
- package/dist/runtime/components/overlays/Notification.vue +1 -1
- package/dist/runtime/components/overlays/Popover.vue +16 -4
- package/dist/runtime/components/overlays/Popover.vue.d.ts +2 -1
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Slideovers.client.vue +17 -0
- package/dist/runtime/components/overlays/Tooltip.vue +3 -3
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.mjs +8 -0
- package/dist/runtime/composables/useModal.d.ts +1 -1
- package/dist/runtime/composables/useShortcuts.d.ts +2 -2
- package/dist/runtime/composables/useShortcuts.mjs +1 -1
- package/dist/runtime/composables/useSlideover.d.ts +12 -0
- package/dist/runtime/composables/useSlideover.mjs +40 -0
- package/dist/runtime/composables/useUI.d.ts +2 -2
- package/dist/runtime/plugins/colors.mjs +1 -1
- package/dist/runtime/plugins/slideovers.d.ts +2 -0
- package/dist/runtime/plugins/slideovers.mjs +10 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/slideover.d.ts +17 -0
- package/dist/runtime/ui.config/forms/inputMenu.mjs +1 -1
- package/dist/runtime/ui.config/forms/radioGroup.d.ts +1 -0
- package/dist/runtime/ui.config/forms/radioGroup.mjs +1 -0
- package/dist/runtime/ui.config/forms/toggle.d.ts +2 -0
- package/dist/runtime/ui.config/forms/toggle.mjs +3 -1
- package/dist/runtime/ui.config/navigation/horizontalNavigation.mjs +1 -1
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +1 -1
- package/dist/runtime/ui.config/overlays/modal.mjs +1 -1
- package/dist/runtime/ui.config/overlays/tooltip.mjs +4 -1
- package/package.json +21 -21
|
@@ -2,7 +2,7 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
import type { SelectSize, SelectVariant, PopperOptions } from '../../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
|
-
type: (ObjectConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
|
|
5
|
+
type: (ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
query: {
|
|
@@ -181,7 +181,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
181
181
|
onChange: (event: any) => void;
|
|
182
182
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "update:modelValue" | "open" | "update:query")[], "change" | "close" | "update:modelValue" | "open" | "update:query", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
183
183
|
modelValue: {
|
|
184
|
-
type: (ObjectConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
|
|
184
|
+
type: (ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
|
|
185
185
|
default: string;
|
|
186
186
|
};
|
|
187
187
|
query: {
|
|
@@ -349,9 +349,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
349
349
|
}[];
|
|
350
350
|
popper: PopperOptions;
|
|
351
351
|
name: string;
|
|
352
|
+
modelValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
352
353
|
leading: boolean;
|
|
353
354
|
variant: SelectVariant;
|
|
354
|
-
modelValue: string | number | unknown[] | Record<string, any>;
|
|
355
355
|
by: string;
|
|
356
356
|
loading: boolean;
|
|
357
357
|
disabled: boolean;
|
|
@@ -126,7 +126,7 @@ export default defineComponent({
|
|
|
126
126
|
default: () => ({})
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
-
emits: ["update:modelValue", "blur"],
|
|
129
|
+
emits: ["update:modelValue", "blur", "change"],
|
|
130
130
|
setup(props, { emit }) {
|
|
131
131
|
const { ui, attrs } = useUI("textarea", toRef(props, "ui"), config, toRef(props, "class"));
|
|
132
132
|
const { emitFormBlur, emitFormInput, inputId, color, size, name } = useFormGroup(props, config);
|
|
@@ -173,6 +173,7 @@ export default defineComponent({
|
|
|
173
173
|
};
|
|
174
174
|
const onChange = (event) => {
|
|
175
175
|
const value = event.target.value;
|
|
176
|
+
emit("change", value);
|
|
176
177
|
if (modelModifiers.value.lazy) {
|
|
177
178
|
updateInput(value);
|
|
178
179
|
}
|
|
@@ -100,7 +100,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
100
|
onInput: (event: Event) => void;
|
|
101
101
|
onChange: (event: Event) => void;
|
|
102
102
|
onBlur: (event: FocusEvent) => void;
|
|
103
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "update:modelValue")[], "blur" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
103
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "change" | "update:modelValue")[], "blur" | "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
104
104
|
modelValue: {
|
|
105
105
|
type: (NumberConstructor | StringConstructor)[];
|
|
106
106
|
default: string;
|
|
@@ -190,6 +190,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
190
190
|
};
|
|
191
191
|
}>> & {
|
|
192
192
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
193
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
193
194
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
194
195
|
}, {
|
|
195
196
|
resize: boolean;
|
|
@@ -199,8 +200,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
199
200
|
color: any;
|
|
200
201
|
class: any;
|
|
201
202
|
name: string;
|
|
202
|
-
variant: TextareaVariant;
|
|
203
203
|
modelValue: string | number;
|
|
204
|
+
variant: TextareaVariant;
|
|
204
205
|
rows: number;
|
|
205
206
|
disabled: boolean;
|
|
206
207
|
placeholder: string;
|
|
@@ -3,15 +3,26 @@
|
|
|
3
3
|
:id="inputId"
|
|
4
4
|
v-model="active"
|
|
5
5
|
:name="name"
|
|
6
|
-
:disabled="disabled"
|
|
6
|
+
:disabled="disabled || loading"
|
|
7
7
|
:class="switchClass"
|
|
8
8
|
v-bind="attrs"
|
|
9
9
|
>
|
|
10
10
|
<span :class="containerClass">
|
|
11
|
-
<span v-if="
|
|
11
|
+
<span v-if="loading" :class="[ui.icon.active, ui.icon.base]" aria-hidden="true">
|
|
12
|
+
<UIcon :name="loadingIcon" :class="loadingIconClass" />
|
|
13
|
+
</span>
|
|
14
|
+
<span
|
|
15
|
+
v-if="!loading && onIcon"
|
|
16
|
+
:class="[active ? ui.icon.active : ui.icon.inactive, ui.icon.base]"
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
>
|
|
12
19
|
<UIcon :name="onIcon" :class="onIconClass" />
|
|
13
20
|
</span>
|
|
14
|
-
<span
|
|
21
|
+
<span
|
|
22
|
+
v-if="!loading && offIcon"
|
|
23
|
+
:class="[active ? ui.icon.inactive : ui.icon.active, ui.icon.base]"
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
>
|
|
15
26
|
<UIcon :name="offIcon" :class="offIconClass" />
|
|
16
27
|
</span>
|
|
17
28
|
</span>
|
|
@@ -53,6 +64,10 @@ export default defineComponent({
|
|
|
53
64
|
type: Boolean,
|
|
54
65
|
default: false
|
|
55
66
|
},
|
|
67
|
+
loading: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
56
71
|
onIcon: {
|
|
57
72
|
type: String,
|
|
58
73
|
default: () => config.default.onIcon
|
|
@@ -61,6 +76,10 @@ export default defineComponent({
|
|
|
61
76
|
type: String,
|
|
62
77
|
default: () => config.default.offIcon
|
|
63
78
|
},
|
|
79
|
+
loadingIcon: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: () => config.default.loadingIcon
|
|
82
|
+
},
|
|
64
83
|
color: {
|
|
65
84
|
type: String,
|
|
66
85
|
default: () => config.default.color,
|
|
@@ -94,6 +113,7 @@ export default defineComponent({
|
|
|
94
113
|
},
|
|
95
114
|
set(value) {
|
|
96
115
|
emit("update:modelValue", value);
|
|
116
|
+
emit("change", value);
|
|
97
117
|
emitFormChange();
|
|
98
118
|
}
|
|
99
119
|
});
|
|
@@ -125,6 +145,12 @@ export default defineComponent({
|
|
|
125
145
|
color.value && ui.value.icon.off.replaceAll("{color}", color.value)
|
|
126
146
|
);
|
|
127
147
|
});
|
|
148
|
+
const loadingIconClass = computed(() => {
|
|
149
|
+
return twJoin(
|
|
150
|
+
ui.value.icon.size[props.size],
|
|
151
|
+
color.value && ui.value.icon.loading.replaceAll("{color}", color.value)
|
|
152
|
+
);
|
|
153
|
+
});
|
|
128
154
|
provideUseId(() => useId());
|
|
129
155
|
return {
|
|
130
156
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
@@ -137,7 +163,8 @@ export default defineComponent({
|
|
|
137
163
|
switchClass,
|
|
138
164
|
containerClass,
|
|
139
165
|
onIconClass,
|
|
140
|
-
offIconClass
|
|
166
|
+
offIconClass,
|
|
167
|
+
loadingIconClass
|
|
141
168
|
};
|
|
142
169
|
}
|
|
143
170
|
});
|
|
@@ -17,6 +17,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
17
|
type: BooleanConstructor;
|
|
18
18
|
default: boolean;
|
|
19
19
|
};
|
|
20
|
+
loading: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
20
24
|
onIcon: {
|
|
21
25
|
type: StringConstructor;
|
|
22
26
|
default: () => any;
|
|
@@ -25,6 +29,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
29
|
type: StringConstructor;
|
|
26
30
|
default: () => any;
|
|
27
31
|
};
|
|
32
|
+
loadingIcon: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: () => any;
|
|
35
|
+
};
|
|
28
36
|
color: {
|
|
29
37
|
type: PropType<any>;
|
|
30
38
|
default: () => any;
|
|
@@ -55,6 +63,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
55
63
|
containerClass: import("vue").ComputedRef<string>;
|
|
56
64
|
onIconClass: import("vue").ComputedRef<string>;
|
|
57
65
|
offIconClass: import("vue").ComputedRef<string>;
|
|
66
|
+
loadingIconClass: import("vue").ComputedRef<string>;
|
|
58
67
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
59
68
|
id: {
|
|
60
69
|
type: StringConstructor;
|
|
@@ -72,6 +81,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
72
81
|
type: BooleanConstructor;
|
|
73
82
|
default: boolean;
|
|
74
83
|
};
|
|
84
|
+
loading: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
75
88
|
onIcon: {
|
|
76
89
|
type: StringConstructor;
|
|
77
90
|
default: () => any;
|
|
@@ -80,6 +93,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
93
|
type: StringConstructor;
|
|
81
94
|
default: () => any;
|
|
82
95
|
};
|
|
96
|
+
loadingIcon: {
|
|
97
|
+
type: StringConstructor;
|
|
98
|
+
default: () => any;
|
|
99
|
+
};
|
|
83
100
|
color: {
|
|
84
101
|
type: PropType<any>;
|
|
85
102
|
default: () => any;
|
|
@@ -109,7 +126,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
109
126
|
class: any;
|
|
110
127
|
name: string;
|
|
111
128
|
modelValue: boolean;
|
|
129
|
+
loading: boolean;
|
|
112
130
|
disabled: boolean;
|
|
131
|
+
loadingIcon: string;
|
|
113
132
|
onIcon: string;
|
|
114
133
|
offIcon: string;
|
|
115
134
|
}, {}>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="ui.group.wrapper"
|
|
2
|
+
<div :class="ui.group.wrapper">
|
|
3
3
|
<h2 v-if="label" :class="ui.group.label">
|
|
4
4
|
{{ label }}
|
|
5
5
|
</h2>
|
|
6
6
|
|
|
7
|
-
<div :class="ui.group.container"
|
|
7
|
+
<div :class="ui.group.container" :aria-label="group[groupAttribute]">
|
|
8
8
|
<HComboboxOption
|
|
9
9
|
v-for="(command, index) of group.commands"
|
|
10
10
|
:key="`${group.key}-${index}`"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
{{ title }}
|
|
19
19
|
</slot>
|
|
20
20
|
</p>
|
|
21
|
-
<p v-if="(description || $slots.description)" :class="ui.description">
|
|
21
|
+
<p v-if="(description || $slots.description)" :class="twMerge(ui.description, !(title && $slots.title) && 'mt-0 leading-5')">
|
|
22
22
|
<slot name="description" :description="description">
|
|
23
23
|
{{ description }}
|
|
24
24
|
</slot>
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
:disabled="disabled"
|
|
8
8
|
:class="ui.trigger"
|
|
9
9
|
role="button"
|
|
10
|
-
@
|
|
10
|
+
@mouseenter="onMouseEnter"
|
|
11
|
+
@touchstart.passive="onTouchStart"
|
|
11
12
|
>
|
|
12
13
|
<slot :open="open" :close="close">
|
|
13
14
|
<button :disabled="disabled">
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
<div v-if="open" :class="[ui.overlay.base, ui.overlay.background]" />
|
|
21
22
|
</Transition>
|
|
22
23
|
|
|
23
|
-
<div v-if="open" ref="container" :class="[ui.container, ui.width]" :style="containerStyle"
|
|
24
|
+
<div v-if="open" ref="container" :class="[ui.container, ui.width]" :style="containerStyle">
|
|
24
25
|
<Transition appear v-bind="ui.transition">
|
|
25
26
|
<div>
|
|
26
27
|
<div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
|
|
@@ -137,7 +138,17 @@ export default defineComponent({
|
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
140
|
});
|
|
140
|
-
function
|
|
141
|
+
function onTouchStart() {
|
|
142
|
+
if (!popoverApi.value) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (popoverApi.value.popoverState === 0) {
|
|
146
|
+
popoverApi.value.closePopover();
|
|
147
|
+
} else {
|
|
148
|
+
popoverApi.value.togglePopover();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function onMouseEnter() {
|
|
141
152
|
if (props.mode !== "hover" || !popoverApi.value) {
|
|
142
153
|
return;
|
|
143
154
|
}
|
|
@@ -196,7 +207,8 @@ export default defineComponent({
|
|
|
196
207
|
trigger,
|
|
197
208
|
container,
|
|
198
209
|
containerStyle,
|
|
199
|
-
|
|
210
|
+
onTouchStart,
|
|
211
|
+
onMouseEnter,
|
|
200
212
|
onMouseLeave
|
|
201
213
|
};
|
|
202
214
|
}
|
|
@@ -68,7 +68,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
68
|
paddingLeft: string;
|
|
69
69
|
paddingRight: string;
|
|
70
70
|
}>;
|
|
71
|
-
|
|
71
|
+
onTouchStart: () => void;
|
|
72
|
+
onMouseEnter: () => void;
|
|
72
73
|
onMouseLeave: () => void;
|
|
73
74
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
74
75
|
mode: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="slideoverState.component"
|
|
4
|
+
v-if="slideoverState"
|
|
5
|
+
v-bind="slideoverState.props"
|
|
6
|
+
v-model="isOpen"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
import { inject } from 'vue'
|
|
12
|
+
import { useSlideover, slidOverInjectionKey } from '../../composables/useSlideover'
|
|
13
|
+
|
|
14
|
+
const slideoverState = inject(slidOverInjectionKey)
|
|
15
|
+
|
|
16
|
+
const { isOpen } = useSlideover()
|
|
17
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="trigger" :class="ui.wrapper" v-bind="attrs" @
|
|
2
|
+
<div ref="trigger" :class="ui.wrapper" v-bind="attrs" @mouseenter="onMouseEnter" @mouseleave="onMouseLeave">
|
|
3
3
|
<slot :open="open">
|
|
4
4
|
Hover
|
|
5
5
|
</slot>
|
|
@@ -84,7 +84,7 @@ export default defineComponent({
|
|
|
84
84
|
const open = ref(false);
|
|
85
85
|
let openTimeout = null;
|
|
86
86
|
let closeTimeout = null;
|
|
87
|
-
function
|
|
87
|
+
function onMouseEnter() {
|
|
88
88
|
if (closeTimeout) {
|
|
89
89
|
clearTimeout(closeTimeout);
|
|
90
90
|
closeTimeout = null;
|
|
@@ -119,7 +119,7 @@ export default defineComponent({
|
|
|
119
119
|
trigger,
|
|
120
120
|
container,
|
|
121
121
|
open,
|
|
122
|
-
|
|
122
|
+
onMouseEnter,
|
|
123
123
|
onMouseLeave
|
|
124
124
|
};
|
|
125
125
|
}
|
|
@@ -42,7 +42,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
42
|
trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
43
43
|
container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
44
44
|
open: import("vue").Ref<boolean>;
|
|
45
|
-
|
|
45
|
+
onMouseEnter: () => void;
|
|
46
46
|
onMouseLeave: () => void;
|
|
47
47
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
48
|
text: {
|
|
@@ -19,6 +19,14 @@ export function useProvideButtonGroup(buttonGroupProps) {
|
|
|
19
19
|
}
|
|
20
20
|
export function useInjectButtonGroup({ ui, props }) {
|
|
21
21
|
const instance = getCurrentInstance();
|
|
22
|
+
provide("ButtonGroupContextConsumer", true);
|
|
23
|
+
const isParentPartOfGroup = inject("ButtonGroupContextConsumer", false);
|
|
24
|
+
if (isParentPartOfGroup) {
|
|
25
|
+
return {
|
|
26
|
+
size: computed(() => props.size),
|
|
27
|
+
rounded: computed(() => ui.value.rounded)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
22
30
|
let parent = instance.parent;
|
|
23
31
|
let groupContext;
|
|
24
32
|
while (parent && !groupContext) {
|
|
@@ -4,7 +4,7 @@ import type { Modal, ModalState } from '../types/modal';
|
|
|
4
4
|
export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
|
|
5
5
|
declare function _useModal(): {
|
|
6
6
|
isOpen: import("vue").Ref<boolean>;
|
|
7
|
-
open: <T extends Component>(component: T, props?:
|
|
7
|
+
open: <T extends Component>(component: T, props?: Modal & ComponentProps<T>) => void;
|
|
8
8
|
close: () => void;
|
|
9
9
|
patch: <T_1 extends Component = {}>(props: Partial<Modal & ComponentProps<T_1>>) => void;
|
|
10
10
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const _useShortcuts: () => {
|
|
2
2
|
macOS: import("vue").ComputedRef<false | "" | RegExpMatchArray | null | undefined>;
|
|
3
3
|
metaSymbol: import("vue").Ref<string>;
|
|
4
|
-
activeElement: import("
|
|
4
|
+
activeElement: import("vue").Ref<HTMLElement | null | undefined>;
|
|
5
5
|
usingInput: import("vue").ComputedRef<string | boolean>;
|
|
6
6
|
};
|
|
7
7
|
export declare const useShortcuts: () => {
|
|
8
8
|
macOS: import("vue").ComputedRef<false | "" | RegExpMatchArray | null | undefined>;
|
|
9
9
|
metaSymbol: import("vue").Ref<string>;
|
|
10
|
-
activeElement: import("
|
|
10
|
+
activeElement: import("vue").Ref<HTMLElement | null | undefined>;
|
|
11
11
|
usingInput: import("vue").ComputedRef<string | boolean>;
|
|
12
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSharedComposable, useActiveElement } from "@vueuse/core";
|
|
2
2
|
import { ref, computed, onMounted } from "vue";
|
|
3
3
|
export const _useShortcuts = () => {
|
|
4
|
-
const macOS = computed(() =>
|
|
4
|
+
const macOS = computed(() => import.meta.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/));
|
|
5
5
|
const metaSymbol = ref(" ");
|
|
6
6
|
const activeElement = useActiveElement();
|
|
7
7
|
const usingInput = computed(() => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
+
import type { ComponentProps } from '../types/component';
|
|
3
|
+
import type { Slideover, SlideoverState } from '../types/slideover';
|
|
4
|
+
export declare const slidOverInjectionKey: InjectionKey<ShallowRef<SlideoverState>>;
|
|
5
|
+
declare function _useSlideover(): {
|
|
6
|
+
open: <T extends Component>(component: T, props?: Slideover & ComponentProps<T>) => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
patch: <T_1 extends Component = {}>(props: Partial<Slideover & ComponentProps<T_1>>) => void;
|
|
9
|
+
isOpen: import("vue").Ref<boolean>;
|
|
10
|
+
};
|
|
11
|
+
export declare const useSlideover: typeof _useSlideover;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ref, inject } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
export const slidOverInjectionKey = Symbol("nuxt-ui.slideover");
|
|
4
|
+
function _useSlideover() {
|
|
5
|
+
const slideoverState = inject(slidOverInjectionKey);
|
|
6
|
+
const isOpen = ref(false);
|
|
7
|
+
function open(component, props) {
|
|
8
|
+
if (!slideoverState) {
|
|
9
|
+
throw new Error("useSlideover() is called without provider");
|
|
10
|
+
}
|
|
11
|
+
slideoverState.value = {
|
|
12
|
+
component,
|
|
13
|
+
props: props ?? {}
|
|
14
|
+
};
|
|
15
|
+
isOpen.value = true;
|
|
16
|
+
}
|
|
17
|
+
function close() {
|
|
18
|
+
if (!slideoverState)
|
|
19
|
+
return;
|
|
20
|
+
isOpen.value = false;
|
|
21
|
+
}
|
|
22
|
+
function patch(props) {
|
|
23
|
+
if (!slideoverState)
|
|
24
|
+
return;
|
|
25
|
+
slideoverState.value = {
|
|
26
|
+
...slideoverState.value,
|
|
27
|
+
props: {
|
|
28
|
+
...slideoverState.value.props,
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
open,
|
|
35
|
+
close,
|
|
36
|
+
patch,
|
|
37
|
+
isOpen
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export const useSlideover = createSharedComposable(_useSlideover);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { Strategy } from '../types';
|
|
3
3
|
export declare const useUI: <T>(key: any, $ui?: Ref<(Partial<T> & {
|
|
4
|
-
strategy?: Strategy
|
|
5
|
-
}) | undefined
|
|
4
|
+
strategy?: Strategy;
|
|
5
|
+
}) | undefined>, $config?: Ref<T> | T, $wrapperClass?: Ref<string>, withAppConfig?: boolean) => {
|
|
6
6
|
ui: import("vue").ComputedRef<T>;
|
|
7
7
|
attrs: import("vue").ComputedRef<Pick<{
|
|
8
8
|
[x: string]: unknown;
|
|
@@ -33,7 +33,7 @@ ${Object.entries(gray || colors.cool).map(([key, value]) => `--color-gray-${key}
|
|
|
33
33
|
id: "nuxt-ui-colors"
|
|
34
34
|
}]
|
|
35
35
|
};
|
|
36
|
-
if (
|
|
36
|
+
if (import.meta.client && nuxtApp.isHydrating && !nuxtApp.payload.serverRendered) {
|
|
37
37
|
const style = document.createElement("style");
|
|
38
38
|
style.innerHTML = root.value;
|
|
39
39
|
style.setAttribute("data-nuxt-ui-colors", "");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#imports";
|
|
2
|
+
import { shallowRef } from "vue";
|
|
3
|
+
import { slidOverInjectionKey } from "../composables/useSlideover.mjs";
|
|
4
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
+
const slideoverState = shallowRef({
|
|
6
|
+
component: "div",
|
|
7
|
+
props: {}
|
|
8
|
+
});
|
|
9
|
+
nuxtApp.vueApp.provide(slidOverInjectionKey, slideoverState);
|
|
10
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
2
|
+
|
|
3
|
+
interface Slideover {
|
|
4
|
+
ui?: any;
|
|
5
|
+
side?: 'right' | 'left';
|
|
6
|
+
transition?: boolean;
|
|
7
|
+
appear?: boolean;
|
|
8
|
+
overlay?: boolean;
|
|
9
|
+
preventClose?: boolean;
|
|
10
|
+
modelValue?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface SlideoverState {
|
|
14
|
+
component: Component | string;
|
|
15
|
+
props: Slideover;
|
|
16
|
+
}
|
|
17
|
+
|
|
@@ -49,11 +49,13 @@ export default {
|
|
|
49
49
|
"2xl": "h-6 w-6"
|
|
50
50
|
},
|
|
51
51
|
on: "text-{color}-500 dark:text-{color}-400",
|
|
52
|
-
off: "text-gray-400 dark:text-gray-500"
|
|
52
|
+
off: "text-gray-400 dark:text-gray-500",
|
|
53
|
+
loading: "animate-spin text-{color}-500 dark:text-{color}-400"
|
|
53
54
|
},
|
|
54
55
|
default: {
|
|
55
56
|
onIcon: null,
|
|
56
57
|
offIcon: null,
|
|
58
|
+
loadingIcon: "i-heroicons-arrow-path-20-solid",
|
|
57
59
|
color: "primary",
|
|
58
60
|
size: "md"
|
|
59
61
|
}
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
inactive: "text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",
|
|
10
10
|
label: "truncate relative",
|
|
11
11
|
icon: {
|
|
12
|
-
base: "flex-shrink-0 w-5 h-5",
|
|
12
|
+
base: "flex-shrink-0 w-5 h-5 relative",
|
|
13
13
|
active: "text-gray-700 dark:text-gray-200",
|
|
14
14
|
inactive: "text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200"
|
|
15
15
|
},
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
inactive: "text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50",
|
|
12
12
|
label: "truncate relative",
|
|
13
13
|
icon: {
|
|
14
|
-
base: "flex-shrink-0 w-5 h-5",
|
|
14
|
+
base: "flex-shrink-0 w-5 h-5 relative",
|
|
15
15
|
active: "text-gray-700 dark:text-gray-200",
|
|
16
16
|
inactive: "text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200"
|
|
17
17
|
},
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
container: "flex min-h-full items-end sm:items-center justify-center text-center",
|
|
5
5
|
padding: "p-4 sm:p-0",
|
|
6
6
|
margin: "sm:my-8",
|
|
7
|
-
base: "relative text-left rtl:text-right
|
|
7
|
+
base: "relative text-left rtl:text-right flex flex-col",
|
|
8
8
|
overlay: {
|
|
9
9
|
base: "fixed inset-0 transition-opacity",
|
|
10
10
|
background: "bg-gray-200/75 dark:bg-gray-800/75",
|