@nuxt/ui 2.9.0 → 2.10.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 +270 -2
- package/dist/module.d.ts +270 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +21 -2
- package/dist/runtime/components/data/Table.vue +8 -6
- package/dist/runtime/components/data/Table.vue.d.ts +2 -1
- package/dist/runtime/components/elements/Accordion.vue +15 -13
- package/dist/runtime/components/elements/Accordion.vue.d.ts +5 -2
- package/dist/runtime/components/elements/Button.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Dropdown.vue +31 -25
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +2 -0
- package/dist/runtime/components/elements/Meter.vue +166 -0
- package/dist/runtime/components/elements/Meter.vue.d.ts +123 -0
- package/dist/runtime/components/elements/MeterGroup.d.ts +78 -0
- package/dist/runtime/components/elements/MeterGroup.mjs +172 -0
- package/dist/runtime/components/elements/Progress.vue +284 -0
- package/dist/runtime/components/elements/Progress.vue.d.ts +2 -0
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Form.vue +32 -7
- package/dist/runtime/components/forms/Form.vue.d.ts +2 -1
- package/dist/runtime/components/forms/Input.vue +5 -1
- package/dist/runtime/components/forms/Input.vue.d.ts +12 -3
- package/dist/runtime/components/forms/Radio.vue +10 -9
- package/dist/runtime/components/forms/Radio.vue.d.ts +3 -3
- package/dist/runtime/components/forms/RadioGroup.vue +136 -0
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +118 -0
- package/dist/runtime/components/forms/Range.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Select.vue.d.ts +2 -2
- package/dist/runtime/components/forms/SelectMenu.vue +62 -57
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +6 -5
- package/dist/runtime/components/forms/Textarea.vue +5 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +11 -2
- package/dist/runtime/components/forms/Toggle.vue.d.ts +2 -2
- package/dist/runtime/components/layout/Divider.vue +107 -0
- package/dist/runtime/components/layout/Divider.vue.d.ts +82 -0
- package/dist/runtime/components/navigation/CommandPalette.vue +10 -3
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Pagination.vue +65 -9
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +41 -3
- package/dist/runtime/components/navigation/Tabs.vue +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue +7 -2
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +2 -1
- package/dist/runtime/components/overlays/Modal.vue +1 -1
- package/dist/runtime/components/overlays/Modal.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Notification.vue +7 -1
- package/dist/runtime/components/overlays/Notifications.vue +1 -1
- package/dist/runtime/components/overlays/Popover.vue +22 -7
- package/dist/runtime/components/overlays/Popover.vue.d.ts +14 -0
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Tooltip.vue +16 -10
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +1 -0
- package/dist/runtime/composables/useFormGroup.d.ts +3 -3
- package/dist/runtime/composables/useFormGroup.mjs +17 -6
- package/dist/runtime/composables/usePopper.d.ts +3 -3
- package/dist/runtime/composables/usePopper.mjs +7 -1
- package/dist/runtime/composables/useUI.d.ts +2 -2
- package/dist/runtime/composables/useUI.mjs +2 -2
- package/dist/runtime/types/command-palette.d.ts +1 -0
- package/dist/runtime/types/form.d.ts +13 -6
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/meter.d.ts +5 -0
- package/dist/runtime/types/popper.d.ts +1 -0
- package/dist/runtime/types/progress.d.ts +4 -0
- package/dist/runtime/types/utils.d.ts +1 -1
- package/dist/runtime/ui.config.d.ts +263 -0
- package/dist/runtime/ui.config.mjs +263 -19
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +19 -19
- package/dist/runtime/utils/StateEmitter.d.ts +0 -17
- package/dist/runtime/utils/StateEmitter.mjs +0 -21
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="ui.wrapper" v-bind="attrs">
|
|
3
|
+
<slot name="first" :on-click="onClickFirst">
|
|
4
|
+
<UButton
|
|
5
|
+
v-if="firstButton && showFirst"
|
|
6
|
+
:size="size"
|
|
7
|
+
:disabled="!canGoFirstOrPrev"
|
|
8
|
+
:class="[ui.base, ui.rounded]"
|
|
9
|
+
v-bind="{ ...ui.default.firstButton, ...firstButton }"
|
|
10
|
+
:ui="{ rounded: '' }"
|
|
11
|
+
aria-label="First"
|
|
12
|
+
@click="onClickFirst"
|
|
13
|
+
/>
|
|
14
|
+
</slot>
|
|
15
|
+
|
|
3
16
|
<slot name="prev" :on-click="onClickPrev">
|
|
4
17
|
<UButton
|
|
5
18
|
v-if="prevButton"
|
|
6
19
|
:size="size"
|
|
7
|
-
:disabled="!
|
|
20
|
+
:disabled="!canGoFirstOrPrev"
|
|
8
21
|
:class="[ui.base, ui.rounded]"
|
|
9
22
|
v-bind="{ ...ui.default.prevButton, ...prevButton }"
|
|
10
23
|
:ui="{ rounded: '' }"
|
|
@@ -28,7 +41,7 @@
|
|
|
28
41
|
<UButton
|
|
29
42
|
v-if="nextButton"
|
|
30
43
|
:size="size"
|
|
31
|
-
:disabled="!
|
|
44
|
+
:disabled="!canGoLastOrNext"
|
|
32
45
|
:class="[ui.base, ui.rounded]"
|
|
33
46
|
v-bind="{ ...ui.default.nextButton, ...nextButton }"
|
|
34
47
|
:ui="{ rounded: '' }"
|
|
@@ -36,6 +49,19 @@
|
|
|
36
49
|
@click="onClickNext"
|
|
37
50
|
/>
|
|
38
51
|
</slot>
|
|
52
|
+
|
|
53
|
+
<slot name="last" :on-click="onClickLast">
|
|
54
|
+
<UButton
|
|
55
|
+
v-if="lastButton && showLast"
|
|
56
|
+
:size="size"
|
|
57
|
+
:disabled="!canGoLastOrNext"
|
|
58
|
+
:class="[ui.base, ui.rounded]"
|
|
59
|
+
v-bind="{ ...ui.default.lastButton, ...lastButton }"
|
|
60
|
+
:ui="{ rounded: '' }"
|
|
61
|
+
aria-label="Last"
|
|
62
|
+
@click="onClickLast"
|
|
63
|
+
/>
|
|
64
|
+
</slot>
|
|
39
65
|
</div>
|
|
40
66
|
</template>
|
|
41
67
|
|
|
@@ -88,6 +114,22 @@ export default defineComponent({
|
|
|
88
114
|
type: Object,
|
|
89
115
|
default: () => config.default.inactiveButton
|
|
90
116
|
},
|
|
117
|
+
showFirst: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: false
|
|
120
|
+
},
|
|
121
|
+
showLast: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: false
|
|
124
|
+
},
|
|
125
|
+
firstButton: {
|
|
126
|
+
type: Object,
|
|
127
|
+
default: () => config.default.firstButton
|
|
128
|
+
},
|
|
129
|
+
lastButton: {
|
|
130
|
+
type: Object,
|
|
131
|
+
default: () => config.default.lastButton
|
|
132
|
+
},
|
|
91
133
|
prevButton: {
|
|
92
134
|
type: Object,
|
|
93
135
|
default: () => config.default.prevButton
|
|
@@ -168,8 +210,20 @@ export default defineComponent({
|
|
|
168
210
|
}
|
|
169
211
|
return items;
|
|
170
212
|
});
|
|
171
|
-
const
|
|
172
|
-
const
|
|
213
|
+
const canGoFirstOrPrev = computed(() => currentPage.value > 1);
|
|
214
|
+
const canGoLastOrNext = computed(() => currentPage.value < pages.value.length);
|
|
215
|
+
function onClickFirst() {
|
|
216
|
+
if (!canGoFirstOrPrev.value) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
currentPage.value = 1;
|
|
220
|
+
}
|
|
221
|
+
function onClickLast() {
|
|
222
|
+
if (!canGoLastOrNext.value) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
currentPage.value = pages.value.length;
|
|
226
|
+
}
|
|
173
227
|
function onClickPage(page) {
|
|
174
228
|
if (typeof page === "string") {
|
|
175
229
|
return;
|
|
@@ -177,13 +231,13 @@ export default defineComponent({
|
|
|
177
231
|
currentPage.value = page;
|
|
178
232
|
}
|
|
179
233
|
function onClickPrev() {
|
|
180
|
-
if (!
|
|
234
|
+
if (!canGoFirstOrPrev.value) {
|
|
181
235
|
return;
|
|
182
236
|
}
|
|
183
237
|
currentPage.value--;
|
|
184
238
|
}
|
|
185
239
|
function onClickNext() {
|
|
186
|
-
if (!
|
|
240
|
+
if (!canGoLastOrNext.value) {
|
|
187
241
|
return;
|
|
188
242
|
}
|
|
189
243
|
currentPage.value++;
|
|
@@ -195,11 +249,13 @@ export default defineComponent({
|
|
|
195
249
|
currentPage,
|
|
196
250
|
pages,
|
|
197
251
|
displayedPages,
|
|
198
|
-
|
|
199
|
-
|
|
252
|
+
canGoLastOrNext,
|
|
253
|
+
canGoFirstOrPrev,
|
|
200
254
|
onClickPrev,
|
|
201
255
|
onClickNext,
|
|
202
|
-
onClickPage
|
|
256
|
+
onClickPage,
|
|
257
|
+
onClickFirst,
|
|
258
|
+
onClickLast
|
|
203
259
|
};
|
|
204
260
|
}
|
|
205
261
|
});
|
|
@@ -31,6 +31,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
31
|
type: PropType<Button>;
|
|
32
32
|
default: () => Button;
|
|
33
33
|
};
|
|
34
|
+
showFirst: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
showLast: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
firstButton: {
|
|
43
|
+
type: PropType<Button>;
|
|
44
|
+
default: () => Button;
|
|
45
|
+
};
|
|
46
|
+
lastButton: {
|
|
47
|
+
type: PropType<Button>;
|
|
48
|
+
default: () => Button;
|
|
49
|
+
};
|
|
34
50
|
prevButton: {
|
|
35
51
|
type: PropType<Button>;
|
|
36
52
|
default: () => Button;
|
|
@@ -59,11 +75,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
75
|
currentPage: import("vue").WritableComputedRef<number>;
|
|
60
76
|
pages: import("vue").ComputedRef<number[]>;
|
|
61
77
|
displayedPages: import("vue").ComputedRef<(string | number)[]>;
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
canGoLastOrNext: import("vue").ComputedRef<boolean>;
|
|
79
|
+
canGoFirstOrPrev: import("vue").ComputedRef<boolean>;
|
|
64
80
|
onClickPrev: () => void;
|
|
65
81
|
onClickNext: () => void;
|
|
66
82
|
onClickPage: (page: number | string) => void;
|
|
83
|
+
onClickFirst: () => void;
|
|
84
|
+
onClickLast: () => void;
|
|
67
85
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
86
|
modelValue: {
|
|
69
87
|
type: NumberConstructor;
|
|
@@ -95,6 +113,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
95
113
|
type: PropType<Button>;
|
|
96
114
|
default: () => Button;
|
|
97
115
|
};
|
|
116
|
+
showFirst: {
|
|
117
|
+
type: BooleanConstructor;
|
|
118
|
+
default: boolean;
|
|
119
|
+
};
|
|
120
|
+
showLast: {
|
|
121
|
+
type: BooleanConstructor;
|
|
122
|
+
default: boolean;
|
|
123
|
+
};
|
|
124
|
+
firstButton: {
|
|
125
|
+
type: PropType<Button>;
|
|
126
|
+
default: () => Button;
|
|
127
|
+
};
|
|
128
|
+
lastButton: {
|
|
129
|
+
type: PropType<Button>;
|
|
130
|
+
default: () => Button;
|
|
131
|
+
};
|
|
98
132
|
prevButton: {
|
|
99
133
|
type: PropType<Button>;
|
|
100
134
|
default: () => Button;
|
|
@@ -122,11 +156,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
122
156
|
class: any;
|
|
123
157
|
size: string | number | symbol;
|
|
124
158
|
max: number;
|
|
159
|
+
divider: string;
|
|
125
160
|
pageCount: number;
|
|
126
161
|
activeButton: Button;
|
|
127
162
|
inactiveButton: Button;
|
|
163
|
+
showFirst: boolean;
|
|
164
|
+
showLast: boolean;
|
|
165
|
+
firstButton: Button;
|
|
166
|
+
lastButton: Button;
|
|
128
167
|
prevButton: Button;
|
|
129
168
|
nextButton: Button;
|
|
130
|
-
divider: string;
|
|
131
169
|
}, {}>;
|
|
132
170
|
export default _default;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
>
|
|
27
27
|
<button :class="[ui.list.tab.base, ui.list.tab.background, ui.list.tab.height, ui.list.tab.padding, ui.list.tab.size, ui.list.tab.font, ui.list.tab.rounded, ui.list.tab.shadow, selected ? ui.list.tab.active : ui.list.tab.inactive]">
|
|
28
28
|
<slot :item="item" :index="index" :selected="selected" :disabled="disabled">
|
|
29
|
-
{{ item.label }}
|
|
29
|
+
<span class="truncate">{{ item.label }}</span>
|
|
30
30
|
</slot>
|
|
31
31
|
</button>
|
|
32
32
|
</HTab>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="isOpen" ref="container" :class="wrapperClass" v-bind="attrs">
|
|
3
3
|
<Transition appear v-bind="ui.transition">
|
|
4
|
-
<div
|
|
5
|
-
<
|
|
4
|
+
<div>
|
|
5
|
+
<div v-if="popper.arrow" data-popper-arrow :class="['invisible before:visible before:block before:rotate-45 before:z-[-1]', Object.values(ui.arrow)]" />
|
|
6
|
+
<div :class="[ui.base, ui.ring, ui.rounded, ui.shadow, ui.background]">
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
6
9
|
</div>
|
|
7
10
|
</Transition>
|
|
8
11
|
</div>
|
|
@@ -72,6 +75,8 @@ export default defineComponent({
|
|
|
72
75
|
attrs,
|
|
73
76
|
isOpen,
|
|
74
77
|
wrapperClass,
|
|
78
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
79
|
+
popper,
|
|
75
80
|
container
|
|
76
81
|
};
|
|
77
82
|
}
|
|
@@ -28,6 +28,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
28
|
}, string>>;
|
|
29
29
|
isOpen: import("vue").WritableComputedRef<boolean>;
|
|
30
30
|
wrapperClass: import("vue").ComputedRef<string>;
|
|
31
|
+
popper: import("vue").ComputedRef<PopperOptions>;
|
|
31
32
|
container: Ref<import("@vueuse/core").MaybeElement>;
|
|
32
33
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue")[], "close" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
34
|
modelValue: {
|
|
@@ -51,8 +52,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
52
|
default: undefined;
|
|
52
53
|
};
|
|
53
54
|
}>> & {
|
|
54
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
55
55
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
56
57
|
}, {
|
|
57
58
|
ui: Partial<any>;
|
|
58
59
|
popper: PopperOptions;
|
|
@@ -74,8 +74,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
74
74
|
default: undefined;
|
|
75
75
|
};
|
|
76
76
|
}>> & {
|
|
77
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
78
77
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
78
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
ui: Partial<any>;
|
|
81
81
|
class: any;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Transition appear v-bind="ui.transition">
|
|
3
|
-
<div
|
|
3
|
+
<div
|
|
4
|
+
:class="wrapperClass"
|
|
5
|
+
role="status"
|
|
6
|
+
v-bind="attrs"
|
|
7
|
+
@mouseover="onMouseover"
|
|
8
|
+
@mouseleave="onMouseleave"
|
|
9
|
+
>
|
|
4
10
|
<div :class="[ui.container, ui.rounded, ui.ring]">
|
|
5
11
|
<div :class="ui.padding">
|
|
6
12
|
<div class="flex gap-3" :class="{ 'items-start': description || $slots.description, 'items-center': !description && !$slots.description }">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<HPopover ref="popover" v-slot="{ open, close }" :class="ui.wrapper" v-bind="attrs" @mouseleave="onMouseLeave">
|
|
2
|
+
<HPopover ref="popover" v-slot="{ open: headlessOpen, close }" :class="ui.wrapper" v-bind="attrs" @mouseleave="onMouseLeave">
|
|
3
3
|
<HPopoverButton
|
|
4
4
|
ref="trigger"
|
|
5
5
|
as="div"
|
|
@@ -8,18 +8,21 @@
|
|
|
8
8
|
role="button"
|
|
9
9
|
@mouseover="onMouseOver"
|
|
10
10
|
>
|
|
11
|
-
<slot :open="open" :close="close">
|
|
11
|
+
<slot :open="(open !== undefined) ? open : headlessOpen" :close="close">
|
|
12
12
|
<button :disabled="disabled">
|
|
13
13
|
Open
|
|
14
14
|
</button>
|
|
15
15
|
</slot>
|
|
16
16
|
</HPopoverButton>
|
|
17
17
|
|
|
18
|
-
<div v-if="open" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
|
|
18
|
+
<div v-if="(open !== undefined) ? open : headlessOpen" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
|
|
19
19
|
<Transition appear v-bind="ui.transition">
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
20
|
+
<div>
|
|
21
|
+
<div v-if="popper.arrow" data-popper-arrow :class="['invisible before:visible before:block before:rotate-45 before:z-[-1]', Object.values(ui.arrow)]" />
|
|
22
|
+
<HPopoverPanel :class="[ui.base, ui.background, ui.ring, ui.rounded, ui.shadow]" static>
|
|
23
|
+
<slot name="panel" :open="(open !== undefined) ? open : headlessOpen" :close="close" />
|
|
24
|
+
</HPopoverPanel>
|
|
25
|
+
</div>
|
|
23
26
|
</Transition>
|
|
24
27
|
</div>
|
|
25
28
|
</HPopover>
|
|
@@ -48,6 +51,10 @@ export default defineComponent({
|
|
|
48
51
|
default: "click",
|
|
49
52
|
validator: (value) => ["click", "hover"].includes(value)
|
|
50
53
|
},
|
|
54
|
+
open: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: void 0
|
|
57
|
+
},
|
|
51
58
|
disabled: {
|
|
52
59
|
type: Boolean,
|
|
53
60
|
default: false
|
|
@@ -91,7 +98,13 @@ export default defineComponent({
|
|
|
91
98
|
});
|
|
92
99
|
const containerStyle = computed(() => {
|
|
93
100
|
const offsetDistance = props.popper?.offsetDistance || ui.value.popper?.offsetDistance || 8;
|
|
94
|
-
|
|
101
|
+
const padding = `${offsetDistance}px`;
|
|
102
|
+
return props.mode === "hover" ? {
|
|
103
|
+
paddingTop: padding,
|
|
104
|
+
paddingBottom: padding,
|
|
105
|
+
paddingLeft: padding,
|
|
106
|
+
paddingRight: padding
|
|
107
|
+
} : {};
|
|
95
108
|
});
|
|
96
109
|
function onMouseOver() {
|
|
97
110
|
if (props.mode !== "hover" || !popoverApi.value) {
|
|
@@ -130,6 +143,8 @@ export default defineComponent({
|
|
|
130
143
|
ui,
|
|
131
144
|
attrs,
|
|
132
145
|
popover: popover2,
|
|
146
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
147
|
+
popper,
|
|
133
148
|
trigger,
|
|
134
149
|
container,
|
|
135
150
|
containerStyle,
|
|
@@ -6,6 +6,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
default: string;
|
|
7
7
|
validator: (value: string) => boolean;
|
|
8
8
|
};
|
|
9
|
+
open: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
9
13
|
disabled: {
|
|
10
14
|
type: BooleanConstructor;
|
|
11
15
|
default: boolean;
|
|
@@ -36,14 +40,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
40
|
[x: string]: unknown;
|
|
37
41
|
}, string>>;
|
|
38
42
|
popover: any;
|
|
43
|
+
popper: import("vue").ComputedRef<PopperOptions>;
|
|
39
44
|
trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
40
45
|
container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
41
46
|
containerStyle: import("vue").ComputedRef<{
|
|
42
47
|
paddingTop: string;
|
|
43
48
|
paddingBottom: string;
|
|
49
|
+
paddingLeft: string;
|
|
50
|
+
paddingRight: string;
|
|
44
51
|
} | {
|
|
45
52
|
paddingTop?: undefined;
|
|
46
53
|
paddingBottom?: undefined;
|
|
54
|
+
paddingLeft?: undefined;
|
|
55
|
+
paddingRight?: undefined;
|
|
47
56
|
}>;
|
|
48
57
|
onMouseOver: () => void;
|
|
49
58
|
onMouseLeave: () => void;
|
|
@@ -53,6 +62,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
62
|
default: string;
|
|
54
63
|
validator: (value: string) => boolean;
|
|
55
64
|
};
|
|
65
|
+
open: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: undefined;
|
|
68
|
+
};
|
|
56
69
|
disabled: {
|
|
57
70
|
type: BooleanConstructor;
|
|
58
71
|
default: boolean;
|
|
@@ -82,6 +95,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
95
|
popper: PopperOptions;
|
|
83
96
|
class: any;
|
|
84
97
|
disabled: boolean;
|
|
98
|
+
open: boolean;
|
|
85
99
|
mode: "click" | "hover";
|
|
86
100
|
openDelay: number;
|
|
87
101
|
closeDelay: number;
|
|
@@ -76,8 +76,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
76
76
|
default: undefined;
|
|
77
77
|
};
|
|
78
78
|
}>> & {
|
|
79
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
80
79
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
80
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
81
81
|
}, {
|
|
82
82
|
ui: Partial<any>;
|
|
83
83
|
class: any;
|
|
@@ -6,17 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
<div v-if="open && !prevent" ref="container" :class="[ui.container, ui.width]">
|
|
8
8
|
<Transition appear v-bind="ui.transition">
|
|
9
|
-
<div
|
|
10
|
-
<
|
|
11
|
-
{{ text }}
|
|
12
|
-
</slot>
|
|
9
|
+
<div>
|
|
10
|
+
<div v-if="popper.arrow" data-popper-arrow :class="['invisible before:visible before:block before:rotate-45 before:z-[-1]', Object.values(ui.arrow)]" />
|
|
13
11
|
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
<div :class="[ui.base, ui.background, ui.color, ui.rounded, ui.shadow, ui.ring]">
|
|
13
|
+
<slot name="text">
|
|
14
|
+
{{ text }}
|
|
15
|
+
</slot>
|
|
16
|
+
|
|
17
|
+
<span v-if="shortcuts?.length" :class="ui.shortcuts">
|
|
18
|
+
<span class="mx-1 text-gray-700 dark:text-gray-200">·</span>
|
|
19
|
+
<UKbd v-for="shortcut of shortcuts" :key="shortcut" size="xs">
|
|
20
|
+
{{ shortcut }}
|
|
21
|
+
</Ukbd>
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
20
24
|
</div>
|
|
21
25
|
</Transition>
|
|
22
26
|
</div>
|
|
@@ -109,6 +113,8 @@ export default defineComponent({
|
|
|
109
113
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
110
114
|
ui,
|
|
111
115
|
attrs,
|
|
116
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
117
|
+
popper,
|
|
112
118
|
trigger,
|
|
113
119
|
container,
|
|
114
120
|
open,
|
|
@@ -38,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
38
38
|
attrs: import("vue").ComputedRef<Pick<{
|
|
39
39
|
[x: string]: unknown;
|
|
40
40
|
}, string>>;
|
|
41
|
+
popper: import("vue").ComputedRef<PopperOptions>;
|
|
41
42
|
trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
42
43
|
container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
43
44
|
open: import("vue").Ref<boolean>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
type InputProps = {
|
|
2
2
|
id?: string;
|
|
3
|
-
size?: string;
|
|
3
|
+
size?: string | number | symbol;
|
|
4
4
|
color?: string;
|
|
5
5
|
name?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
|
|
8
|
-
inputId: import("vue").
|
|
9
|
-
name: import("vue").ComputedRef<
|
|
8
|
+
inputId: import("vue").Ref<string | undefined>;
|
|
9
|
+
name: import("vue").ComputedRef<string | undefined>;
|
|
10
10
|
size: import("vue").ComputedRef<any>;
|
|
11
11
|
color: import("vue").ComputedRef<string | undefined>;
|
|
12
12
|
emitFormBlur: () => void;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { inject, ref, computed } from "vue";
|
|
1
|
+
import { inject, ref, computed, onMounted } from "vue";
|
|
2
2
|
import { useDebounceFn } from "@vueuse/core";
|
|
3
3
|
export const useFormGroup = (inputProps, config) => {
|
|
4
4
|
const formBus = inject("form-events", void 0);
|
|
5
5
|
const formGroup = inject("form-group", void 0);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const formInputs = inject("form-inputs", void 0);
|
|
7
|
+
const inputId = ref(inputProps?.id);
|
|
8
|
+
onMounted(() => {
|
|
9
|
+
inputId.value = inputProps?.id ?? formGroup?.inputId.value;
|
|
10
|
+
if (formGroup) {
|
|
11
|
+
formGroup.inputId.value = inputId.value;
|
|
12
|
+
if (formInputs) {
|
|
13
|
+
formInputs.value[formGroup.name.value] = inputId;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
9
17
|
const blurred = ref(false);
|
|
10
18
|
function emitFormEvent(type, path) {
|
|
11
19
|
if (formBus) {
|
|
@@ -25,9 +33,12 @@ export const useFormGroup = (inputProps, config) => {
|
|
|
25
33
|
}
|
|
26
34
|
}, 300);
|
|
27
35
|
return {
|
|
28
|
-
inputId
|
|
36
|
+
inputId,
|
|
29
37
|
name: computed(() => inputProps?.name ?? formGroup?.name.value),
|
|
30
|
-
size: computed(() =>
|
|
38
|
+
size: computed(() => {
|
|
39
|
+
const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null;
|
|
40
|
+
return inputProps?.size ?? formGroupSize ?? config?.default?.size;
|
|
41
|
+
}),
|
|
31
42
|
color: computed(() => formGroup?.error?.value ? "red" : inputProps?.color),
|
|
32
43
|
emitFormBlur,
|
|
33
44
|
emitFormInput,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
-
import { VirtualElement } from '@popperjs/core/lib/popper-lite';
|
|
2
|
+
import type { VirtualElement } from '@popperjs/core/lib/popper-lite';
|
|
3
3
|
import type { Instance } from '@popperjs/core';
|
|
4
|
-
import { MaybeElement } from '@vueuse/core';
|
|
4
|
+
import type { MaybeElement } from '@vueuse/core';
|
|
5
5
|
import type { PopperOptions } from '../types/popper';
|
|
6
6
|
export declare const createPopper: <TModifier extends Partial<import("@popperjs/core").Modifier<any, any>>>(reference: Element | VirtualElement, popper: HTMLElement, options?: Partial<import("@popperjs/core").OptionsGeneric<TModifier>> | undefined) => Instance;
|
|
7
|
-
export declare function usePopper({ locked, overflowPadding, offsetDistance, offsetSkid, gpuAcceleration, adaptive, scroll, resize, placement, strategy }: PopperOptions, virtualReference?: Ref<Element | VirtualElement>): readonly [Ref<MaybeElement>, Ref<MaybeElement>, Ref<{
|
|
7
|
+
export declare function usePopper({ locked, overflowPadding, offsetDistance, offsetSkid, gpuAcceleration, adaptive, scroll, resize, arrow, placement, strategy }: PopperOptions, virtualReference?: Ref<Element | VirtualElement>): readonly [Ref<MaybeElement>, Ref<MaybeElement>, Ref<{
|
|
8
8
|
state: {
|
|
9
9
|
elements: {
|
|
10
10
|
reference: Element | {
|
|
@@ -5,9 +5,10 @@ import offset from "@popperjs/core/lib/modifiers/offset";
|
|
|
5
5
|
import preventOverflow from "@popperjs/core/lib/modifiers/preventOverflow";
|
|
6
6
|
import computeStyles from "@popperjs/core/lib/modifiers/computeStyles";
|
|
7
7
|
import eventListeners from "@popperjs/core/lib/modifiers/eventListeners";
|
|
8
|
+
import arrowModifier from "@popperjs/core/lib/modifiers/arrow";
|
|
8
9
|
import { unrefElement } from "@vueuse/core";
|
|
9
10
|
export const createPopper = popperGenerator({
|
|
10
|
-
defaultModifiers: [...defaultModifiers, offset, flip, preventOverflow, computeStyles, eventListeners]
|
|
11
|
+
defaultModifiers: [...defaultModifiers, offset, flip, preventOverflow, computeStyles, eventListeners, arrowModifier]
|
|
11
12
|
});
|
|
12
13
|
export function usePopper({
|
|
13
14
|
locked = false,
|
|
@@ -18,6 +19,7 @@ export function usePopper({
|
|
|
18
19
|
adaptive = true,
|
|
19
20
|
scroll = true,
|
|
20
21
|
resize = true,
|
|
22
|
+
arrow = false,
|
|
21
23
|
placement,
|
|
22
24
|
strategy
|
|
23
25
|
}, virtualReference) {
|
|
@@ -71,6 +73,10 @@ export function usePopper({
|
|
|
71
73
|
scroll,
|
|
72
74
|
resize
|
|
73
75
|
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "arrow",
|
|
79
|
+
enabled: arrow
|
|
74
80
|
}
|
|
75
81
|
]
|
|
76
82
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
-
import { Strategy } from '../types';
|
|
2
|
+
import type { Strategy } from '../types';
|
|
3
3
|
export declare const useUI: <T>(key: any, $ui: Ref<Partial<T & {
|
|
4
4
|
strategy: Strategy;
|
|
5
|
-
}> | undefined>, $config?: T | Ref<T> | undefined, $wrapperClass?: Ref<string
|
|
5
|
+
}> | undefined>, $config?: T | Ref<T> | undefined, $wrapperClass?: Ref<string>, withAppConfig?: boolean) => {
|
|
6
6
|
ui: import("vue").ComputedRef<T>;
|
|
7
7
|
attrs: import("vue").ComputedRef<Pick<{
|
|
8
8
|
[x: string]: unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, toValue, useAttrs } from "vue";
|
|
2
2
|
import { useAppConfig } from "#imports";
|
|
3
3
|
import { mergeConfig, omit, get } from "../utils/index.mjs";
|
|
4
|
-
export const useUI = (key, $ui, $config, $wrapperClass) => {
|
|
4
|
+
export const useUI = (key, $ui, $config, $wrapperClass, withAppConfig = false) => {
|
|
5
5
|
const $attrs = useAttrs();
|
|
6
6
|
const appConfig = useAppConfig();
|
|
7
7
|
const ui = computed(() => {
|
|
@@ -12,7 +12,7 @@ export const useUI = (key, $ui, $config, $wrapperClass) => {
|
|
|
12
12
|
_ui?.strategy || appConfig.ui?.strategy,
|
|
13
13
|
_wrapperClass ? { wrapper: _wrapperClass } : {},
|
|
14
14
|
_ui || {},
|
|
15
|
-
process.dev ? get(appConfig.ui, key, {}) : {},
|
|
15
|
+
process.dev || withAppConfig ? get(appConfig.ui, key, {}) : {},
|
|
16
16
|
_config || {}
|
|
17
17
|
);
|
|
18
18
|
});
|