nuxt-unified-ui 0.2.0 → 0.2.2
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.
|
@@ -24,7 +24,7 @@ const props = defineProps({
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
<template>
|
|
27
|
-
<u-card :ui="{ body: 'p-0' }">
|
|
27
|
+
<u-card :ui="{ body: 'p-0 sm:p-0 divide-y divide-default' }">
|
|
28
28
|
|
|
29
29
|
<un-typography
|
|
30
30
|
:icon="props.icon"
|
|
@@ -33,7 +33,7 @@ const props = defineProps({
|
|
|
33
33
|
:icon-classes="props.iconClasses"
|
|
34
34
|
:title-classes="props.titleClasses"
|
|
35
35
|
:subtitle-classes="props.subtitleClasses"
|
|
36
|
-
class="p-3
|
|
36
|
+
class="p-3">
|
|
37
37
|
<template v-if="$slots.append" #append>
|
|
38
38
|
<slot name="append" />
|
|
39
39
|
</template>
|
|
@@ -62,7 +62,7 @@ const props = defineProps({
|
|
|
62
62
|
|
|
63
63
|
<div
|
|
64
64
|
v-if="props.actions?.length"
|
|
65
|
-
class="flex items-end gap-1 p-2
|
|
65
|
+
class="flex items-end gap-1 p-2"
|
|
66
66
|
:class="{
|
|
67
67
|
'flex-col': props.verticalActions,
|
|
68
68
|
}">
|
|
@@ -44,13 +44,8 @@ const emit = defineEmits([
|
|
|
44
44
|
/* actions */
|
|
45
45
|
|
|
46
46
|
async function handleButtonClick(button) {
|
|
47
|
-
|
|
48
|
-
if (button.onClick) {
|
|
49
|
-
await button.onClick(button.value);
|
|
50
|
-
}
|
|
51
|
-
|
|
47
|
+
await button.onClick?.(button.value);
|
|
52
48
|
emit('close', button.value);
|
|
53
|
-
|
|
54
49
|
}
|
|
55
50
|
|
|
56
51
|
</script>
|
|
@@ -59,36 +54,25 @@ async function handleButtonClick(button) {
|
|
|
59
54
|
<template>
|
|
60
55
|
<u-modal @update:open="!$event && emit('close')">
|
|
61
56
|
<template #content>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<u-button
|
|
83
|
-
v-for="button of props.endButtons" :key="button.value || button.label || button.icon"
|
|
84
|
-
v-bind="radOmit(button, [ 'value', 'onClick' ])"
|
|
85
|
-
loading-auto
|
|
86
|
-
@click="handleButtonClick(button)"
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
</u-card>
|
|
57
|
+
<un-card
|
|
58
|
+
:icon="props.icon"
|
|
59
|
+
:title="props.title"
|
|
60
|
+
:subtitle="props.subtitle"
|
|
61
|
+
:text="props.text"
|
|
62
|
+
:actions="[
|
|
63
|
+
...(props.startButtons || []).map(button => ({
|
|
64
|
+
...button,
|
|
65
|
+
onClick: () => handleButtonClick(button),
|
|
66
|
+
})),
|
|
67
|
+
{
|
|
68
|
+
actionType: 'spacer',
|
|
69
|
+
},
|
|
70
|
+
...(props.endButtons || []).map(button => ({
|
|
71
|
+
...button,
|
|
72
|
+
onClick: () => handleButtonClick(button),
|
|
73
|
+
})),
|
|
74
|
+
]"
|
|
75
|
+
/>
|
|
92
76
|
</template>
|
|
93
77
|
</u-modal>
|
|
94
78
|
</template>
|
|
@@ -46,13 +46,8 @@ const { form, formTag } = useForm({
|
|
|
46
46
|
/* actions */
|
|
47
47
|
|
|
48
48
|
async function handleSubmit() {
|
|
49
|
-
|
|
50
|
-
if (props.submitButton?.onClick) {
|
|
51
|
-
await props.submitButton?.onClick(form.value);
|
|
52
|
-
}
|
|
53
|
-
|
|
49
|
+
await props.submitButton?.onClick?.(form.value);
|
|
54
50
|
emit('close', form.value);
|
|
55
|
-
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
</script>
|
|
@@ -61,41 +56,31 @@ async function handleSubmit() {
|
|
|
61
56
|
<template>
|
|
62
57
|
<u-modal @update:open="!$event && emit('close')">
|
|
63
58
|
<template #content>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
variant="ghost"
|
|
90
|
-
label="Cancel"
|
|
91
|
-
v-bind="radOmit(props.cancelButton, [ 'onClick' ])"
|
|
92
|
-
loading-auto
|
|
93
|
-
@click="emit('close')"
|
|
94
|
-
/>
|
|
95
|
-
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
</u-card>
|
|
59
|
+
<un-card
|
|
60
|
+
:icon="props.icon"
|
|
61
|
+
:title="props.title"
|
|
62
|
+
:subtitle="props.subtitle"
|
|
63
|
+
:text="props.text"
|
|
64
|
+
:actions="[
|
|
65
|
+
{
|
|
66
|
+
label: 'Submit',
|
|
67
|
+
...props.submitButton,
|
|
68
|
+
loadingAuto: true,
|
|
69
|
+
onClick: handleSubmit,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
actionType: 'spacer',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
variant: 'ghost',
|
|
76
|
+
label: 'Cancel',
|
|
77
|
+
...props.cancelButton,
|
|
78
|
+
loadingAuto: true,
|
|
79
|
+
onClick: () => emit('close'),
|
|
80
|
+
},
|
|
81
|
+
]">
|
|
82
|
+
<form-tag />
|
|
83
|
+
</un-card>
|
|
99
84
|
</template>
|
|
100
85
|
</u-modal>
|
|
101
86
|
</template>
|