daisy-ui-kit 5.0.0-pre.10 → 5.0.0-pre.11
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/app/components/Accordion.vue +8 -5
- package/app/components/Alert.vue +2 -1
- package/app/components/Avatar.vue +10 -7
- package/app/components/AvatarGroup.vue +6 -2
- package/app/components/Badge.vue +14 -1
- package/app/components/Button.vue +60 -45
- package/app/components/Calendar.vue +24 -1
- package/app/components/CalendarInput.vue +2 -2
- package/app/components/CalendarSkeleton.vue +51 -10
- package/app/components/Card.vue +15 -2
- package/app/components/CardActions.vue +1 -1
- package/app/components/CardBody.vue +1 -1
- package/app/components/CardTitle.vue +1 -1
- package/app/components/Carousel.vue +2 -1
- package/app/components/Chat.vue +6 -1
- package/app/components/Checkbox.vue +1 -1
- package/app/components/Collapse.vue +37 -5
- package/app/components/CollapseTitle.vue +11 -1
- package/app/components/Countdown.vue +3 -3
- package/app/components/CountdownTimers.vue +4 -7
- package/app/components/Counter.vue +13 -2
- package/app/components/DaisyLink.vue +29 -15
- package/app/components/Dock.vue +1 -1
- package/app/components/DockItem.vue +1 -1
- package/app/components/Drawer.vue +15 -12
- package/app/components/DrawerContent.vue +9 -6
- package/app/components/DrawerSide.vue +9 -6
- package/app/components/Dropdown.vue +61 -50
- package/app/components/DropdownButton.vue +11 -4
- package/app/components/DropdownContent.vue +90 -19
- package/app/components/DropdownTarget.vue +9 -2
- package/app/components/Fab.vue +16 -0
- package/app/components/FabClose.vue +18 -0
- package/app/components/FabMainAction.vue +5 -0
- package/app/components/FabTrigger.vue +117 -0
- package/app/components/Fieldset.vue +1 -4
- package/app/components/FileInput.vue +1 -1
- package/app/components/Filter.vue +35 -32
- package/app/components/Flex.vue +3 -1
- package/app/components/FlexItem.vue +30 -27
- package/app/components/Footer.vue +16 -12
- package/app/components/FooterTitle.vue +8 -5
- package/app/components/Hero.vue +9 -6
- package/app/components/HeroContent.vue +9 -6
- package/app/components/Hover3D.vue +22 -0
- package/app/components/HoverGallery.vue +11 -0
- package/app/components/Indicator.vue +8 -5
- package/app/components/IndicatorItem.vue +16 -13
- package/app/components/Input.vue +47 -40
- package/app/components/Kbd.vue +2 -1
- package/app/components/Label.vue +32 -29
- package/app/components/MenuExpand.vue +1 -7
- package/app/components/MenuExpandToggle.vue +7 -1
- package/app/components/MenuItem.vue +6 -4
- package/app/components/Modal.vue +23 -17
- package/app/components/Progress.vue +13 -1
- package/app/components/Prose.vue +7 -2
- package/app/components/RadialProgress.vue +8 -8
- package/app/components/Radio.vue +1 -1
- package/app/components/RadioGroup.vue +2 -2
- package/app/components/Range.vue +2 -2
- package/app/components/RangeMeasure.vue +33 -30
- package/app/components/Rating.vue +70 -53
- package/app/components/Select.vue +44 -47
- package/app/components/SkeletonText.vue +11 -0
- package/app/components/Steps.vue +7 -2
- package/app/components/Swap.vue +4 -10
- package/app/components/Tab.vue +18 -5
- package/app/components/Text.vue +42 -22
- package/app/components/TextArea.vue +30 -27
- package/app/components/TextRotate.vue +24 -0
- package/app/components/ThemeController.vue +3 -4
- package/app/components/ThemeProvider.vue +47 -32
- package/app/components/TimelineLine.vue +1 -1
- package/app/components/TimelineStart.vue +2 -1
- package/app/components/Toast.vue +1 -6
- package/app/components/Toggle.vue +2 -2
- package/app/components/Tooltip.vue +2 -1
- package/app/utils/drawer-utils.ts +15 -13
- package/app/utils/position-area.ts +41 -0
- package/package.json +9 -7
package/app/components/Modal.vue
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
3
|
|
|
4
|
-
const props = withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
modelValue?: boolean
|
|
7
|
+
closeOnClickOutside?: boolean
|
|
8
|
+
placement?: 'top' | 'bottom' | 'start' | 'end'
|
|
9
|
+
top?: boolean
|
|
10
|
+
bottom?: boolean
|
|
11
|
+
start?: boolean
|
|
12
|
+
end?: boolean
|
|
13
|
+
}>(),
|
|
14
|
+
{
|
|
15
|
+
closeOnClickOutside: true,
|
|
16
|
+
},
|
|
17
|
+
)
|
|
15
18
|
const emit = defineEmits(['update:modelValue'])
|
|
16
19
|
|
|
17
20
|
const is = 'div'
|
|
18
21
|
|
|
19
22
|
// defineModel 'open'
|
|
20
23
|
const _isOpen = ref(props.modelValue)
|
|
21
|
-
watch(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
watch(
|
|
25
|
+
() => props.modelValue,
|
|
26
|
+
val => {
|
|
27
|
+
_isOpen.value = val
|
|
28
|
+
},
|
|
29
|
+
)
|
|
24
30
|
const isOpen = computed({
|
|
25
31
|
get: () => _isOpen.value,
|
|
26
|
-
set:
|
|
32
|
+
set: val => {
|
|
27
33
|
_isOpen.value = val
|
|
28
34
|
if (props.modelValue !== val) {
|
|
29
35
|
emit('update:modelValue', val)
|
|
@@ -39,7 +45,7 @@ function handleClick() {
|
|
|
39
45
|
</script>
|
|
40
46
|
|
|
41
47
|
<template>
|
|
42
|
-
<input v-model="isOpen" type="checkbox" class="modal-toggle"
|
|
48
|
+
<input v-model="isOpen" type="checkbox" class="modal-toggle" />
|
|
43
49
|
<Component
|
|
44
50
|
:is="is"
|
|
45
51
|
v-bind="{ ...$attrs, ...$props }"
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
value = 0,
|
|
4
|
+
max = 100,
|
|
5
|
+
color,
|
|
6
|
+
neutral,
|
|
7
|
+
primary,
|
|
8
|
+
secondary,
|
|
9
|
+
accent,
|
|
10
|
+
success,
|
|
11
|
+
info,
|
|
12
|
+
warning,
|
|
13
|
+
error,
|
|
14
|
+
} = defineProps<{
|
|
3
15
|
value?: string | number
|
|
4
16
|
max?: string | number
|
|
5
17
|
|
package/app/components/Prose.vue
CHANGED
|
@@ -25,8 +25,13 @@
|
|
|
25
25
|
@apply text-accent;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.prose h1 a,
|
|
28
|
+
.prose h1 a,
|
|
29
|
+
.prose h2 a,
|
|
30
|
+
.prose h3 a,
|
|
31
|
+
.prose h4 a,
|
|
32
|
+
.prose h5 a,
|
|
33
|
+
.prose h6 a {
|
|
29
34
|
text-decoration: none;
|
|
30
|
-
@apply font-bold
|
|
35
|
+
@apply font-bold;
|
|
31
36
|
}
|
|
32
37
|
</style>
|
|
@@ -20,14 +20,14 @@ defineProps<{
|
|
|
20
20
|
<div
|
|
21
21
|
class="radial-progress"
|
|
22
22
|
:class="{
|
|
23
|
-
'text-neutral':
|
|
24
|
-
'text-primary':
|
|
25
|
-
'text-secondary':
|
|
26
|
-
'text-accent':
|
|
27
|
-
'text-info':
|
|
28
|
-
'text-success':
|
|
29
|
-
'text-warning':
|
|
30
|
-
'text-error':
|
|
23
|
+
'text-neutral': neutral || color === 'neutral',
|
|
24
|
+
'text-primary': primary || color === 'primary',
|
|
25
|
+
'text-secondary': secondary || color === 'secondary',
|
|
26
|
+
'text-accent': accent || color === 'accent',
|
|
27
|
+
'text-info': info || color === 'info',
|
|
28
|
+
'text-success': success || color === 'success',
|
|
29
|
+
'text-warning': warning || color === 'warning',
|
|
30
|
+
'text-error': error || color === 'error',
|
|
31
31
|
}"
|
|
32
32
|
:style="`--value:${value}; --size:${size || '4rem'}; --thickness:${thickness || 'calc(var(--size) / 10)'};`"
|
|
33
33
|
>
|
package/app/components/Radio.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, provide, reactive } from 'vue'
|
|
2
|
+
import { computed, provide, reactive } from 'vue'
|
|
3
3
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
modelValue?: any
|
|
@@ -28,7 +28,7 @@ const currentValue = computed({
|
|
|
28
28
|
get: () => {
|
|
29
29
|
return props.modelValue
|
|
30
30
|
},
|
|
31
|
-
set:
|
|
31
|
+
set: val => {
|
|
32
32
|
emit('update:modelValue', val)
|
|
33
33
|
},
|
|
34
34
|
})
|
package/app/components/Range.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
modelValue?: number | string
|
|
@@ -57,5 +57,5 @@ const currentValue = computed({
|
|
|
57
57
|
:max="max"
|
|
58
58
|
:step="step"
|
|
59
59
|
:disabled="disabled"
|
|
60
|
-
|
|
60
|
+
/>
|
|
61
61
|
</template>
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
|
|
4
|
-
const props = withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
modelValue?: number | string
|
|
7
|
+
min?: number | string
|
|
8
|
+
max?: number | string
|
|
9
|
+
step?: number | string
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
numbered?: boolean
|
|
12
|
+
asButtons?: boolean
|
|
13
|
+
disabled?: boolean
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
color?: string
|
|
16
|
+
neutral?: boolean
|
|
17
|
+
primary?: boolean
|
|
18
|
+
secondary?: boolean
|
|
19
|
+
accent?: boolean
|
|
20
|
+
success?: boolean
|
|
21
|
+
warning?: boolean
|
|
22
|
+
info?: boolean
|
|
23
|
+
error?: boolean
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}>(),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
26
|
+
xl?: boolean
|
|
27
|
+
lg?: boolean
|
|
28
|
+
md?: boolean
|
|
29
|
+
sm?: boolean
|
|
30
|
+
xs?: boolean
|
|
31
|
+
}>(),
|
|
32
|
+
{
|
|
33
|
+
min: 0,
|
|
34
|
+
max: 100,
|
|
35
|
+
step: 1,
|
|
36
|
+
},
|
|
37
|
+
)
|
|
35
38
|
defineEmits(['update:modelValue'])
|
|
36
39
|
|
|
37
40
|
const values = computed(() => {
|
|
@@ -76,7 +79,7 @@ const values = computed(() => {
|
|
|
76
79
|
:as-button="asButtons"
|
|
77
80
|
:is-hidden="!tick.isVisible"
|
|
78
81
|
:disabled="disabled"
|
|
79
|
-
@update:model-value="
|
|
82
|
+
@update:model-value="val => !disabled && $emit('update:modelValue', val)"
|
|
80
83
|
>
|
|
81
84
|
{{ numbered ? tick : '|' }}
|
|
82
85
|
</RangeMeasureTick>
|
|
@@ -1,52 +1,55 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
|
|
4
|
-
const props = withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
modelValue?: number | string
|
|
7
|
+
count?: number | string
|
|
8
|
+
half?: boolean
|
|
9
|
+
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
|
|
12
|
+
color?: string
|
|
13
|
+
neutral?: boolean
|
|
14
|
+
primary?: boolean
|
|
15
|
+
secondary?: boolean
|
|
16
|
+
accent?: boolean
|
|
17
|
+
info?: boolean
|
|
18
|
+
success?: boolean
|
|
19
|
+
warning?: boolean
|
|
20
|
+
error?: boolean
|
|
21
|
+
|
|
22
|
+
bg?: string
|
|
23
|
+
|
|
24
|
+
shape?: string
|
|
25
|
+
squircle?: boolean
|
|
26
|
+
heart?: boolean
|
|
27
|
+
hexagon?: boolean
|
|
28
|
+
hexagon2?: boolean
|
|
29
|
+
decagon?: boolean
|
|
30
|
+
pentagon?: boolean
|
|
31
|
+
diamond?: boolean
|
|
32
|
+
square?: boolean
|
|
33
|
+
circle?: boolean
|
|
34
|
+
|
|
35
|
+
star?: boolean
|
|
36
|
+
star2?: boolean
|
|
37
|
+
triangle?: boolean
|
|
38
|
+
triangle2?: boolean
|
|
39
|
+
triangle3?: boolean
|
|
40
|
+
triangle4?: boolean
|
|
41
|
+
|
|
42
|
+
size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
|
|
43
|
+
xl?: boolean
|
|
44
|
+
lg?: boolean
|
|
45
|
+
md?: boolean
|
|
46
|
+
sm?: boolean
|
|
47
|
+
xs?: boolean
|
|
48
|
+
}>(),
|
|
49
|
+
{
|
|
50
|
+
count: 5,
|
|
51
|
+
},
|
|
52
|
+
)
|
|
50
53
|
const emit = defineEmits(['update:modelValue'])
|
|
51
54
|
|
|
52
55
|
const max = computed(() => Number.parseInt(props.count as string))
|
|
@@ -66,10 +69,24 @@ function handleValue(digit: number, half = false) {
|
|
|
66
69
|
|
|
67
70
|
// Check if any shape prop is set
|
|
68
71
|
const hasShape = computed(() => {
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
return (
|
|
73
|
+
props.shape ||
|
|
74
|
+
props.squircle ||
|
|
75
|
+
props.heart ||
|
|
76
|
+
props.hexagon ||
|
|
77
|
+
props.hexagon2 ||
|
|
78
|
+
props.decagon ||
|
|
79
|
+
props.pentagon ||
|
|
80
|
+
props.diamond ||
|
|
81
|
+
props.square ||
|
|
82
|
+
props.circle ||
|
|
83
|
+
props.star ||
|
|
84
|
+
props.star2 ||
|
|
85
|
+
props.triangle ||
|
|
86
|
+
props.triangle2 ||
|
|
87
|
+
props.triangle3 ||
|
|
88
|
+
props.triangle4
|
|
89
|
+
)
|
|
73
90
|
})
|
|
74
91
|
</script>
|
|
75
92
|
|
|
@@ -93,7 +110,7 @@ const hasShape = computed(() => {
|
|
|
93
110
|
class="rating-hidden"
|
|
94
111
|
:checked="modelValue === 0"
|
|
95
112
|
@change="$emit('update:modelValue', 0)"
|
|
96
|
-
|
|
113
|
+
/>
|
|
97
114
|
<template v-for="digit in max" :key="digit">
|
|
98
115
|
<input
|
|
99
116
|
type="radio"
|
|
@@ -134,7 +151,7 @@ const hasShape = computed(() => {
|
|
|
134
151
|
]"
|
|
135
152
|
:checked="half ? modelValue === digit - 0.5 : modelValue === digit"
|
|
136
153
|
@change="() => handleValue(digit, true)"
|
|
137
|
-
|
|
154
|
+
/>
|
|
138
155
|
<input
|
|
139
156
|
v-if="half"
|
|
140
157
|
type="radio"
|
|
@@ -174,7 +191,7 @@ const hasShape = computed(() => {
|
|
|
174
191
|
]"
|
|
175
192
|
:checked="modelValue === digit"
|
|
176
193
|
@change="() => handleValue(digit)"
|
|
177
|
-
|
|
194
|
+
/>
|
|
178
195
|
</template>
|
|
179
196
|
</div>
|
|
180
197
|
</template>
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
|
|
4
|
-
type Color = | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
|
|
4
|
+
type Color = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
|
|
5
5
|
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<{
|
|
8
|
+
modelValue: any
|
|
9
|
+
options: Record<string, any>[] | any[]
|
|
10
|
+
value?: (val: any) => any
|
|
11
|
+
label?: (val: any) => any
|
|
12
|
+
resultAsObject?: boolean
|
|
13
|
+
join?: boolean
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
ghost?: boolean
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
validator?: boolean
|
|
18
|
+
native?: boolean
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
color?: Color
|
|
21
|
+
neutral?: boolean
|
|
22
|
+
primary?: boolean
|
|
23
|
+
secondary?: boolean
|
|
24
|
+
accent?: boolean
|
|
25
|
+
info?: boolean
|
|
26
|
+
success?: boolean
|
|
27
|
+
warning?: boolean
|
|
28
|
+
error?: boolean
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}>(),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
31
|
+
xl?: boolean
|
|
32
|
+
lg?: boolean
|
|
33
|
+
md?: boolean
|
|
34
|
+
sm?: boolean
|
|
35
|
+
xs?: boolean
|
|
36
|
+
}>(),
|
|
37
|
+
{
|
|
38
|
+
value: (val: any) => {
|
|
39
|
+
if (!val) {
|
|
40
|
+
return null
|
|
41
|
+
}
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
return typeof val === 'string' ? (val as string) : val?.value || val?.id || val?._id || val
|
|
44
|
+
},
|
|
45
|
+
label: (val: any) => (typeof val === 'string' ? (val as string) : val.label || val.name || val.title),
|
|
46
|
+
resultAsObject: false,
|
|
42
47
|
},
|
|
43
|
-
|
|
44
|
-
typeof val === 'string'
|
|
45
|
-
? (val as string)
|
|
46
|
-
: (val.label || val.name || val.title),
|
|
47
|
-
resultAsObject: false,
|
|
48
|
-
})
|
|
48
|
+
)
|
|
49
49
|
const emit = defineEmits(['update:modelValue'])
|
|
50
50
|
|
|
51
51
|
const computedVModel = computed({
|
|
@@ -56,7 +56,7 @@ const computedVModel = computed({
|
|
|
56
56
|
|
|
57
57
|
return props.modelValue
|
|
58
58
|
},
|
|
59
|
-
set:
|
|
59
|
+
set: val => {
|
|
60
60
|
if (val === undefined) {
|
|
61
61
|
val = null
|
|
62
62
|
}
|
|
@@ -75,8 +75,10 @@ const computedVModel = computed({
|
|
|
75
75
|
class="select"
|
|
76
76
|
:class="{
|
|
77
77
|
'join-item': props.join,
|
|
78
|
-
|
|
78
|
+
validator: props.validator,
|
|
79
79
|
'select-ghost': props.ghost,
|
|
80
|
+
'appearance-none': props.native,
|
|
81
|
+
'select-neutral': props.neutral || props.color === 'neutral',
|
|
80
82
|
'select-primary': props.primary || props.color === 'primary',
|
|
81
83
|
'select-secondary': props.secondary || props.color === 'secondary',
|
|
82
84
|
'select-accent': props.accent || props.color === 'accent',
|
|
@@ -92,12 +94,7 @@ const computedVModel = computed({
|
|
|
92
94
|
}"
|
|
93
95
|
:disabled="disabled"
|
|
94
96
|
>
|
|
95
|
-
<option
|
|
96
|
-
v-for="option in options"
|
|
97
|
-
:key="value(option)"
|
|
98
|
-
:value="value(option)"
|
|
99
|
-
:disabled="option.disabled"
|
|
100
|
-
>
|
|
97
|
+
<option v-for="option in options" :key="value(option)" :value="value(option)" :disabled="option.disabled">
|
|
101
98
|
{{ label(option) }}
|
|
102
99
|
</option>
|
|
103
100
|
</select>
|
package/app/components/Steps.vue
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
orientation,
|
|
4
|
+
vertical = false,
|
|
5
|
+
horizontal = false,
|
|
6
|
+
} = defineProps<{
|
|
3
7
|
orientation?: 'vertical' | 'horizontal'
|
|
4
8
|
vertical?: boolean
|
|
5
9
|
horizontal?: boolean
|
|
@@ -8,7 +12,8 @@ const { orientation, vertical = false, horizontal = false } = defineProps<{
|
|
|
8
12
|
|
|
9
13
|
<template>
|
|
10
14
|
<ul
|
|
11
|
-
class="steps"
|
|
15
|
+
class="steps"
|
|
16
|
+
:class="{
|
|
12
17
|
'steps-vertical': orientation === 'vertical' || vertical,
|
|
13
18
|
'steps-horizontal': orientation === 'horizontal' || horizontal,
|
|
14
19
|
}"
|
package/app/components/Swap.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { nextTick, ref, watch } from 'vue'
|
|
2
|
+
import { nextTick, ref, watch } from 'vue'
|
|
3
3
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
modelValue?: boolean | null
|
|
@@ -13,7 +13,7 @@ const checkbox = ref<HTMLInputElement | null>(null)
|
|
|
13
13
|
// Keep the checkbox's indeterminate property in sync with modelValue
|
|
14
14
|
watch(
|
|
15
15
|
() => props.modelValue,
|
|
16
|
-
|
|
16
|
+
val => {
|
|
17
17
|
nextTick(() => {
|
|
18
18
|
if (checkbox.value) {
|
|
19
19
|
checkbox.value.indeterminate = val === null
|
|
@@ -28,8 +28,7 @@ function updateValue(event: Event) {
|
|
|
28
28
|
// If indeterminate, toggle to checked
|
|
29
29
|
if (props.modelValue === null) {
|
|
30
30
|
emit('update:modelValue', true)
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
31
|
+
} else {
|
|
33
32
|
emit('update:modelValue', input.checked)
|
|
34
33
|
}
|
|
35
34
|
}
|
|
@@ -43,12 +42,7 @@ function updateValue(event: Event) {
|
|
|
43
42
|
'swap-flip': flip,
|
|
44
43
|
}"
|
|
45
44
|
>
|
|
46
|
-
<input
|
|
47
|
-
ref="checkbox"
|
|
48
|
-
type="checkbox"
|
|
49
|
-
:checked="modelValue === true"
|
|
50
|
-
@change="updateValue"
|
|
51
|
-
>
|
|
45
|
+
<input ref="checkbox" type="checkbox" :checked="modelValue === true" @change="updateValue" />
|
|
52
46
|
<div class="swap-indeterminate">
|
|
53
47
|
<slot name="indeterminate" />
|
|
54
48
|
</div>
|
package/app/components/Tab.vue
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { inject } from 'vue'
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
is
|
|
4
|
+
const {
|
|
5
|
+
is = 'label',
|
|
6
|
+
name,
|
|
7
|
+
...props
|
|
8
|
+
} = defineProps<{
|
|
9
|
+
is?: string
|
|
6
10
|
name?: string
|
|
7
11
|
active?: boolean
|
|
8
12
|
disabled?: boolean
|
|
9
13
|
}>()
|
|
10
14
|
|
|
15
|
+
const NuxtLink = resolveComponent('NuxtLink')
|
|
16
|
+
const RouterLink = resolveComponent('RouterLink')
|
|
17
|
+
|
|
18
|
+
const resolvedComponent = computed(() => {
|
|
19
|
+
if (is === 'NuxtLink') return NuxtLink
|
|
20
|
+
if (is === 'RouterLink') return RouterLink
|
|
21
|
+
return is
|
|
22
|
+
})
|
|
23
|
+
|
|
11
24
|
const tabManager: any = inject('tabManager')
|
|
12
25
|
if (!tabManager.currentTab.value) {
|
|
13
26
|
tabManager.currentTab.value = name
|
|
@@ -16,7 +29,7 @@ if (!tabManager.currentTab.value) {
|
|
|
16
29
|
|
|
17
30
|
<template>
|
|
18
31
|
<component
|
|
19
|
-
:is="
|
|
32
|
+
:is="resolvedComponent"
|
|
20
33
|
class="tab"
|
|
21
34
|
:class="{
|
|
22
35
|
'tab-active': props.active || tabManager.currentTab.value === name,
|
|
@@ -30,7 +43,7 @@ if (!tabManager.currentTab.value) {
|
|
|
30
43
|
:value="name"
|
|
31
44
|
:checked="tabManager.currentTab.value === name"
|
|
32
45
|
@change="() => (tabManager.currentTab.value = name)"
|
|
33
|
-
|
|
46
|
+
/>
|
|
34
47
|
|
|
35
48
|
<slot v-if="$slots.default" />
|
|
36
49
|
<span v-else>{{ name }}</span>
|