daisy-ui-kit 3.0.12 → 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/README.md +62 -14
- package/app/components/Accordion.vue +29 -0
- package/app/components/Alert.vue +36 -0
- package/app/components/Avatar.vue +131 -0
- package/app/components/AvatarGroup.vue +22 -0
- package/app/components/Badge.vue +67 -0
- package/app/components/Button.vue +135 -0
- package/app/components/Calendar.vue +89 -0
- package/app/components/CalendarInput.vue +174 -0
- package/app/components/CalendarSkeleton.vue +87 -0
- package/app/components/Card.vue +46 -0
- package/{components → app/components}/CardActions.vue +2 -5
- package/{components → app/components}/CardBody.vue +2 -5
- package/{components → app/components}/CardTitle.vue +1 -6
- package/app/components/Carousel.vue +24 -0
- package/app/components/Chat.vue +26 -0
- package/app/components/ChatBubble.vue +31 -0
- package/app/components/Checkbox.vue +51 -0
- package/app/components/Collapse.vue +75 -0
- package/app/components/CollapseTitle.vue +15 -0
- package/{components → app/components}/Countdown.vue +1 -1
- package/app/components/CountdownTimers.vue +69 -0
- package/app/components/Counter.vue +21 -0
- package/app/components/DaisyLink.vue +52 -0
- package/app/components/Diff.vue +11 -0
- package/app/components/Divider.vue +43 -0
- package/app/components/Dock.vue +60 -0
- package/app/components/DockItem.vue +26 -0
- package/app/components/DockLabel.vue +5 -0
- package/{components → app/components}/Drawer.vue +17 -12
- package/{components → app/components}/DrawerContent.vue +8 -5
- package/{components → app/components}/DrawerSide.vue +8 -5
- package/app/components/Dropdown.vue +106 -0
- package/app/components/DropdownButton.vue +23 -0
- package/app/components/DropdownContent.vue +127 -0
- package/{components → 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 +16 -0
- package/app/components/FileInput.vue +53 -0
- package/app/components/Filter.vue +125 -0
- package/app/components/Flex.vue +84 -0
- package/{components → app/components}/FlexItem.vue +30 -27
- package/app/components/Footer.vue +31 -0
- package/{components → app/components}/FooterTitle.vue +8 -5
- package/app/components/FormControl.vue +5 -0
- package/{components → app/components}/Hero.vue +8 -5
- package/{components → app/components}/HeroContent.vue +8 -5
- package/app/components/Hover3D.vue +22 -0
- package/app/components/HoverGallery.vue +11 -0
- package/{components → app/components}/Indicator.vue +8 -5
- package/{components → app/components}/IndicatorItem.vue +16 -13
- package/app/components/Input.vue +126 -0
- package/app/components/Kbd.vue +25 -0
- package/app/components/Label.vue +100 -0
- package/{components/CollapseTitle.vue → app/components/List.vue} +1 -1
- package/{components/FormControl.vue → app/components/ListColGrow.vue} +1 -1
- package/app/components/ListColWrap.vue +5 -0
- package/{components/Stat.vue → app/components/ListRow.vue} +1 -1
- package/app/components/LoadingBall.vue +42 -0
- package/app/components/LoadingBars.vue +42 -0
- package/app/components/LoadingDots.vue +42 -0
- package/app/components/LoadingInfinity.vue +42 -0
- package/app/components/LoadingRing.vue +42 -0
- package/app/components/LoadingSpinner.vue +42 -0
- package/app/components/Mask.vue +49 -0
- package/app/components/Menu.vue +30 -0
- package/app/components/MenuExpand.vue +94 -0
- package/app/components/MenuExpandToggle.vue +20 -0
- package/{components → app/components}/MenuItem.vue +7 -6
- package/app/components/MockupPhone.vue +14 -0
- package/{components → app/components}/Modal.vue +28 -13
- package/app/components/NavButton.vue +12 -0
- package/{components → app/components}/Navbar.vue +3 -5
- package/{components → app/components}/NavbarCenter.vue +3 -5
- package/{components → app/components}/NavbarEnd.vue +3 -5
- package/{components → app/components}/NavbarStart.vue +3 -5
- package/app/components/Progress.vue +46 -0
- package/{components → app/components}/Prose.vue +8 -3
- package/app/components/RadialProgress.vue +36 -0
- package/app/components/Radio.vue +69 -0
- package/{components → app/components}/RadioGroup.vue +2 -1
- package/app/components/Range.vue +61 -0
- package/app/components/RangeMeasure.vue +87 -0
- package/{components → app/components}/RangeMeasureTick.vue +9 -14
- package/app/components/Rating.vue +197 -0
- package/app/components/Select.vue +101 -0
- package/app/components/Skeleton.vue +5 -0
- package/app/components/SkeletonText.vue +11 -0
- package/app/components/Stack.vue +25 -0
- package/app/components/Stat.vue +19 -0
- package/app/components/Status.vue +43 -0
- package/app/components/Step.vue +34 -0
- package/app/components/StepIcon.vue +5 -0
- package/app/components/Steps.vue +23 -0
- package/app/components/Swap.vue +56 -0
- package/app/components/Tab.vue +51 -0
- package/{components → app/components}/TabContent.vue +10 -10
- package/app/components/Table.vue +32 -0
- package/app/components/Tabs.vue +53 -0
- package/app/components/Text.vue +162 -0
- package/app/components/TextArea.vue +64 -0
- package/app/components/TextRotate.vue +24 -0
- package/app/components/ThemeController.vue +45 -0
- package/app/components/ThemeProvider.vue +302 -0
- package/app/components/ThemeTile.vue +50 -0
- package/app/components/Timeline.vue +22 -0
- package/app/components/TimelineEnd.vue +14 -0
- package/app/components/TimelineItem.vue +5 -0
- package/app/components/TimelineLine.vue +29 -0
- package/app/components/TimelineMiddle.vue +5 -0
- package/app/components/TimelineStart.vue +14 -0
- package/app/components/Toast.vue +67 -0
- package/app/components/Toggle.vue +60 -0
- package/app/components/Tooltip.vue +48 -0
- package/app/components/TooltipContent.vue +5 -0
- package/app/components/ValidatorHint.vue +5 -0
- package/{utils → app/utils}/drawer-utils.ts +15 -13
- package/app/utils/position-area.ts +41 -0
- package/nuxt.js +7 -1
- package/package.json +60 -61
- package/components/Accordion.vue +0 -29
- package/components/Alert.vue +0 -25
- package/components/Artboard.vue +0 -33
- package/components/Avatar.vue +0 -70
- package/components/AvatarGroup.vue +0 -19
- package/components/Badge.vue +0 -50
- package/components/BottomNav.vue +0 -25
- package/components/Button.vue +0 -111
- package/components/Card.vue +0 -30
- package/components/Carousel.vue +0 -25
- package/components/Chat.vue +0 -27
- package/components/ChatBubble.vue +0 -34
- package/components/Checkbox.vue +0 -55
- package/components/Code.vue +0 -92
- package/components/Collapse.vue +0 -54
- package/components/CountdownTimers.vue +0 -70
- package/components/Counter.vue +0 -14
- package/components/Divider.vue +0 -24
- package/components/Dropdown.vue +0 -95
- package/components/DropdownButton.vue +0 -16
- package/components/DropdownContent.vue +0 -56
- package/components/FileInput.vue +0 -59
- package/components/Flex.vue +0 -59
- package/components/Footer.vue +0 -24
- package/components/Kbd.vue +0 -25
- package/components/Label.vue +0 -15
- package/components/LabelText.vue +0 -15
- package/components/LabelTextAlt.vue +0 -15
- package/components/Link.vue +0 -40
- package/components/LoadingBall.vue +0 -43
- package/components/LoadingBars.vue +0 -43
- package/components/LoadingDots.vue +0 -43
- package/components/LoadingInfinity.vue +0 -43
- package/components/LoadingRing.vue +0 -43
- package/components/LoadingSpinner.vue +0 -43
- package/components/Mask.config.ts +0 -77
- package/components/Mask.vue +0 -14
- package/components/Menu.vue +0 -35
- package/components/MenuExpand.vue +0 -79
- package/components/MenuExpandToggle.vue +0 -13
- package/components/MockupPhone.vue +0 -8
- package/components/NavButton.vue +0 -20
- package/components/Progress.vue +0 -42
- package/components/RadialProgress.vue +0 -41
- package/components/Radio.vue +0 -76
- package/components/Range.vue +0 -60
- package/components/RangeMeasure.vue +0 -83
- package/components/Rating.vue +0 -167
- package/components/Select.vue +0 -100
- package/components/Stack.vue +0 -13
- package/components/Step.vue +0 -36
- package/components/Steps.vue +0 -21
- package/components/Swap.vue +0 -58
- package/components/Tab.vue +0 -48
- package/components/Tabs.vue +0 -77
- package/components/TabsManager.vue +0 -38
- package/components/Text.vue +0 -142
- package/components/TextArea.vue +0 -64
- package/components/TextInput.vue +0 -66
- package/components/Toast.vue +0 -31
- package/components/Toggle.vue +0 -59
- package/components/Tooltip.vue +0 -47
- package/index.ts +0 -108
- package/utils/-utils.ts +0 -41
- package/utils/Button.config.ts +0 -26
- package/utils/fixtures.ts +0 -62
- package/utils/types.ts +0 -7
- /package/{components → app/components}/Breadcrumbs.vue +0 -0
- /package/{components → app/components}/CarouselItem.vue +0 -0
- /package/{components → app/components}/ChatFooter.vue +0 -0
- /package/{components → app/components}/ChatHeader.vue +0 -0
- /package/{components → app/components}/ChatImage.vue +0 -0
- /package/{components → app/components}/CollapseContent.vue +0 -0
- /package/{components → app/components}/Crumb.vue +0 -0
- /package/{components → app/components}/HeroOverlay.vue +0 -0
- /package/{components → app/components}/Join.vue +0 -0
- /package/{components → app/components}/MenuTitle.vue +0 -0
- /package/{components → app/components}/MockupBrowser.vue +0 -0
- /package/{components → app/components}/MockupBrowserToolbar.vue +0 -0
- /package/{components → app/components}/MockupCode.vue +0 -0
- /package/{components → app/components}/MockupWindow.vue +0 -0
- /package/{components → app/components}/ModalAction.vue +0 -0
- /package/{components → app/components}/ModalBox.vue +0 -0
- /package/{components → app/components}/StatActions.vue +0 -0
- /package/{components → app/components}/StatDesc.vue +0 -0
- /package/{components → app/components}/StatFigure.vue +0 -0
- /package/{components → app/components}/StatTitle.vue +0 -0
- /package/{components → app/components}/StatValue.vue +0 -0
- /package/{components → app/components}/Stats.vue +0 -0
- /package/{utils → app/utils}/random-string.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, watch } from 'vue'
|
|
3
2
|
import { useTimeoutFn } from '@vueuse/core'
|
|
3
|
+
import { computed, ref, watch } from 'vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
tick: number
|
|
@@ -18,12 +18,11 @@ const { isPending, start, stop } = useTimeoutFn(() => {
|
|
|
18
18
|
}, 1000)
|
|
19
19
|
watch(
|
|
20
20
|
() => props.modelValue,
|
|
21
|
-
|
|
21
|
+
val => {
|
|
22
22
|
if (val) {
|
|
23
23
|
start()
|
|
24
24
|
hasChanged.value = true
|
|
25
|
-
}
|
|
26
|
-
else if (!isPending.value) {
|
|
25
|
+
} else if (!isPending.value) {
|
|
27
26
|
stop()
|
|
28
27
|
}
|
|
29
28
|
},
|
|
@@ -31,15 +30,6 @@ watch(
|
|
|
31
30
|
|
|
32
31
|
// eslint-disable-next-line eqeqeq
|
|
33
32
|
const isCurrent = computed(() => props.modelValue == props.tick)
|
|
34
|
-
|
|
35
|
-
const classes = computed(() => {
|
|
36
|
-
return {
|
|
37
|
-
'font-bold': isCurrent.value,
|
|
38
|
-
'opacity-50': props.disabled,
|
|
39
|
-
'cursor-pointer': !props.disabled,
|
|
40
|
-
'cursor-not-allowed': props.disabled,
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
33
|
</script>
|
|
44
34
|
|
|
45
35
|
<template>
|
|
@@ -48,7 +38,12 @@ const classes = computed(() => {
|
|
|
48
38
|
xs
|
|
49
39
|
:ghost="!isCurrent"
|
|
50
40
|
circle
|
|
51
|
-
:class="
|
|
41
|
+
:class="{
|
|
42
|
+
'font-bold': isCurrent,
|
|
43
|
+
'opacity-50': props.disabled,
|
|
44
|
+
'cursor-pointer': !props.disabled,
|
|
45
|
+
'cursor-not-allowed': props.disabled,
|
|
46
|
+
}"
|
|
52
47
|
:disabled="disabled"
|
|
53
48
|
@click="$emit('update:modelValue', tick)"
|
|
54
49
|
>
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
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
|
+
)
|
|
53
|
+
const emit = defineEmits(['update:modelValue'])
|
|
54
|
+
|
|
55
|
+
const max = computed(() => Number.parseInt(props.count as string))
|
|
56
|
+
|
|
57
|
+
function handleValue(digit: number, half = false) {
|
|
58
|
+
if (props.disabled) {
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (props.half) {
|
|
63
|
+
emit('update:modelValue', half ? digit - 0.5 : digit)
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
emit('update:modelValue', digit)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Check if any shape prop is set
|
|
71
|
+
const hasShape = computed(() => {
|
|
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
|
+
)
|
|
90
|
+
})
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<div
|
|
95
|
+
class="rating"
|
|
96
|
+
:class="{
|
|
97
|
+
'rating-half': half,
|
|
98
|
+
'rating-xl': xl || size === 'xl',
|
|
99
|
+
'rating-lg': lg || size === 'lg',
|
|
100
|
+
'rating-md': md || size === 'md',
|
|
101
|
+
'rating-sm': sm || size === 'sm',
|
|
102
|
+
'rating-xs': xs || size === 'xs',
|
|
103
|
+
'opacity-60': disabled,
|
|
104
|
+
'cursor-not-allowed': disabled,
|
|
105
|
+
}"
|
|
106
|
+
>
|
|
107
|
+
<input
|
|
108
|
+
type="radio"
|
|
109
|
+
:value="0"
|
|
110
|
+
class="rating-hidden"
|
|
111
|
+
:checked="modelValue === 0"
|
|
112
|
+
@change="$emit('update:modelValue', 0)"
|
|
113
|
+
/>
|
|
114
|
+
<template v-for="digit in max" :key="digit">
|
|
115
|
+
<input
|
|
116
|
+
type="radio"
|
|
117
|
+
:value="half ? digit - 0.5 : digit"
|
|
118
|
+
:disabled="disabled"
|
|
119
|
+
class="mask"
|
|
120
|
+
:class="[
|
|
121
|
+
bg,
|
|
122
|
+
{ 'mask-half-1': half },
|
|
123
|
+
{ 'cursor-not-allowed opacity-50': disabled },
|
|
124
|
+
|
|
125
|
+
// Color classes
|
|
126
|
+
{ 'bg-neutral': neutral || color === 'neutral' },
|
|
127
|
+
{ 'bg-primary': primary || color === 'primary' },
|
|
128
|
+
{ 'bg-secondary': secondary || color === 'secondary' },
|
|
129
|
+
{ 'bg-accent': accent || color === 'accent' },
|
|
130
|
+
{ 'bg-info': info || color === 'info' },
|
|
131
|
+
{ 'bg-success': success || color === 'success' },
|
|
132
|
+
{ 'bg-warning': warning || color === 'warning' },
|
|
133
|
+
{ 'bg-error': error || color === 'error' },
|
|
134
|
+
|
|
135
|
+
// Shape classes
|
|
136
|
+
{ 'mask-squircle': squircle || shape === 'squircle' },
|
|
137
|
+
{ 'mask-heart': heart || shape === 'heart' },
|
|
138
|
+
{ 'mask-hexagon': hexagon || shape === 'hexagon' },
|
|
139
|
+
{ 'mask-hexagon-2': hexagon2 || shape === 'hexagon-2' },
|
|
140
|
+
{ 'mask-decagon': decagon || shape === 'decagon' },
|
|
141
|
+
{ 'mask-pentagon': pentagon || shape === 'pentagon' },
|
|
142
|
+
{ 'mask-diamond': diamond || shape === 'diamond' },
|
|
143
|
+
{ 'mask-square': square || shape === 'square' },
|
|
144
|
+
{ 'mask-circle': circle || shape === 'circle' },
|
|
145
|
+
{ 'mask-star': star || shape === 'star' },
|
|
146
|
+
{ 'mask-star-2': star2 || shape === 'star-2' || !hasShape },
|
|
147
|
+
{ 'mask-triangle': triangle || shape === 'triangle' },
|
|
148
|
+
{ 'mask-triangle-2': triangle2 || shape === 'triangle-2' },
|
|
149
|
+
{ 'mask-triangle-3': triangle3 || shape === 'triangle-3' },
|
|
150
|
+
{ 'mask-triangle-4': triangle4 || shape === 'triangle-4' },
|
|
151
|
+
]"
|
|
152
|
+
:checked="half ? modelValue === digit - 0.5 : modelValue === digit"
|
|
153
|
+
@change="() => handleValue(digit, true)"
|
|
154
|
+
/>
|
|
155
|
+
<input
|
|
156
|
+
v-if="half"
|
|
157
|
+
type="radio"
|
|
158
|
+
:value="digit"
|
|
159
|
+
class="mask mask-half-2"
|
|
160
|
+
:disabled="disabled"
|
|
161
|
+
:class="[
|
|
162
|
+
bg,
|
|
163
|
+
{ 'cursor-not-allowed opacity-50': disabled },
|
|
164
|
+
|
|
165
|
+
// Color classes
|
|
166
|
+
{ 'bg-neutral': neutral || color === 'neutral' },
|
|
167
|
+
{ 'bg-primary': primary || color === 'primary' },
|
|
168
|
+
{ 'bg-secondary': secondary || color === 'secondary' },
|
|
169
|
+
{ 'bg-accent': accent || color === 'accent' },
|
|
170
|
+
{ 'bg-info': info || color === 'info' },
|
|
171
|
+
{ 'bg-success': success || color === 'success' },
|
|
172
|
+
{ 'bg-warning': warning || color === 'warning' },
|
|
173
|
+
{ 'bg-error': error || color === 'error' },
|
|
174
|
+
|
|
175
|
+
// Shape classes
|
|
176
|
+
{ 'mask-squircle': squircle || shape === 'squircle' },
|
|
177
|
+
{ 'mask-heart': heart || shape === 'heart' },
|
|
178
|
+
{ 'mask-hexagon': hexagon || shape === 'hexagon' },
|
|
179
|
+
{ 'mask-hexagon-2': hexagon2 || shape === 'hexagon-2' },
|
|
180
|
+
{ 'mask-decagon': decagon || shape === 'decagon' },
|
|
181
|
+
{ 'mask-pentagon': pentagon || shape === 'pentagon' },
|
|
182
|
+
{ 'mask-diamond': diamond || shape === 'diamond' },
|
|
183
|
+
{ 'mask-square': square || shape === 'square' },
|
|
184
|
+
{ 'mask-circle': circle || shape === 'circle' },
|
|
185
|
+
{ 'mask-star': star || shape === 'star' },
|
|
186
|
+
{ 'mask-star-2': star2 || shape === 'star-2' || !hasShape },
|
|
187
|
+
{ 'mask-triangle': triangle || shape === 'triangle' },
|
|
188
|
+
{ 'mask-triangle-2': triangle2 || shape === 'triangle-2' },
|
|
189
|
+
{ 'mask-triangle-3': triangle3 || shape === 'triangle-3' },
|
|
190
|
+
{ 'mask-triangle-4': triangle4 || shape === 'triangle-4' },
|
|
191
|
+
]"
|
|
192
|
+
:checked="modelValue === digit"
|
|
193
|
+
@change="() => handleValue(digit)"
|
|
194
|
+
/>
|
|
195
|
+
</template>
|
|
196
|
+
</div>
|
|
197
|
+
</template>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
type Color = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
|
|
5
|
+
|
|
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
|
|
14
|
+
|
|
15
|
+
ghost?: boolean
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
validator?: boolean
|
|
18
|
+
native?: boolean
|
|
19
|
+
|
|
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
|
|
29
|
+
|
|
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
|
+
}
|
|
42
|
+
|
|
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,
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
const emit = defineEmits(['update:modelValue'])
|
|
50
|
+
|
|
51
|
+
const computedVModel = computed({
|
|
52
|
+
get: () => {
|
|
53
|
+
if (props.resultAsObject && props.modelValue != null) {
|
|
54
|
+
return props.value(props.modelValue)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return props.modelValue
|
|
58
|
+
},
|
|
59
|
+
set: val => {
|
|
60
|
+
if (val === undefined) {
|
|
61
|
+
val = null
|
|
62
|
+
}
|
|
63
|
+
if (props.resultAsObject && val != null) {
|
|
64
|
+
val = props.options.find(o => props.value(o) === val)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
emit('update:modelValue', val)
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<select
|
|
74
|
+
v-model="computedVModel"
|
|
75
|
+
class="select"
|
|
76
|
+
:class="{
|
|
77
|
+
'join-item': props.join,
|
|
78
|
+
validator: props.validator,
|
|
79
|
+
'select-ghost': props.ghost,
|
|
80
|
+
'appearance-none': props.native,
|
|
81
|
+
'select-neutral': props.neutral || props.color === 'neutral',
|
|
82
|
+
'select-primary': props.primary || props.color === 'primary',
|
|
83
|
+
'select-secondary': props.secondary || props.color === 'secondary',
|
|
84
|
+
'select-accent': props.accent || props.color === 'accent',
|
|
85
|
+
'select-info': props.info || props.color === 'info',
|
|
86
|
+
'select-success': props.success || props.color === 'success',
|
|
87
|
+
'select-warning': props.warning || props.color === 'warning',
|
|
88
|
+
'select-error': props.error || props.color === 'error',
|
|
89
|
+
'select-xl': props.xl || props.size === 'xl',
|
|
90
|
+
'select-lg': props.lg || props.size === 'lg',
|
|
91
|
+
'select-md': props.md || props.size === 'md',
|
|
92
|
+
'select-sm': props.sm || props.size === 'sm',
|
|
93
|
+
'select-xs': props.xs || props.size === 'xs',
|
|
94
|
+
}"
|
|
95
|
+
:disabled="disabled"
|
|
96
|
+
>
|
|
97
|
+
<option v-for="option in options" :key="value(option)" :value="value(option)" :disabled="option.disabled">
|
|
98
|
+
{{ label(option) }}
|
|
99
|
+
</option>
|
|
100
|
+
</select>
|
|
101
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { is = 'div' } = defineProps<{
|
|
3
|
+
is?: string
|
|
4
|
+
direction?: 'top' | 'end' | 'bottom' | 'start'
|
|
5
|
+
top?: boolean
|
|
6
|
+
end?: boolean
|
|
7
|
+
bottom?: boolean
|
|
8
|
+
start?: boolean
|
|
9
|
+
}>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<component
|
|
14
|
+
:is="is"
|
|
15
|
+
class="stack"
|
|
16
|
+
:class="{
|
|
17
|
+
'stack-top': top || direction === 'top',
|
|
18
|
+
'stack-end': end || direction === 'end',
|
|
19
|
+
'stack-bottom': bottom || direction === 'bottom',
|
|
20
|
+
'stack-start': start || direction === 'start',
|
|
21
|
+
}"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</component>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
orientation?: 'vertical' | 'horizontal'
|
|
4
|
+
vertical?: boolean
|
|
5
|
+
horizontal?: boolean
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div
|
|
11
|
+
class="stat"
|
|
12
|
+
:class="{
|
|
13
|
+
'stat-vertical': vertical || orientation === 'vertical',
|
|
14
|
+
'stat-horizontal': horizontal || orientation === 'horizontal',
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
|
|
4
|
+
neutral?: boolean
|
|
5
|
+
primary?: boolean
|
|
6
|
+
secondary?: boolean
|
|
7
|
+
accent?: boolean
|
|
8
|
+
info?: boolean
|
|
9
|
+
success?: boolean
|
|
10
|
+
warning?: boolean
|
|
11
|
+
error?: boolean
|
|
12
|
+
|
|
13
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
14
|
+
xs?: boolean
|
|
15
|
+
sm?: boolean
|
|
16
|
+
md?: boolean
|
|
17
|
+
lg?: boolean
|
|
18
|
+
xl?: boolean
|
|
19
|
+
}>()
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<span
|
|
24
|
+
class="status"
|
|
25
|
+
:class="[
|
|
26
|
+
neutral || color === 'neutral' ? 'status-neutral' : '',
|
|
27
|
+
primary || color === 'primary' ? 'status-primary' : '',
|
|
28
|
+
secondary || color === 'secondary' ? 'status-secondary' : '',
|
|
29
|
+
accent || color === 'accent' ? 'status-accent' : '',
|
|
30
|
+
info || color === 'info' ? 'status-info' : '',
|
|
31
|
+
success || color === 'success' ? 'status-success' : '',
|
|
32
|
+
warning || color === 'warning' ? 'status-warning' : '',
|
|
33
|
+
error || color === 'error' ? 'status-error' : '',
|
|
34
|
+
xs || size === 'xs' ? 'status-xs' : '',
|
|
35
|
+
sm || size === 'sm' ? 'status-sm' : '',
|
|
36
|
+
md || size === 'md' || (!xs && !sm && !lg && !xl && !size) ? 'status-md' : '',
|
|
37
|
+
lg || size === 'lg' ? 'status-lg' : '',
|
|
38
|
+
xl || size === 'xl' ? 'status-xl' : '',
|
|
39
|
+
]"
|
|
40
|
+
>
|
|
41
|
+
<slot />
|
|
42
|
+
</span>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
glyph?: string
|
|
4
|
+
|
|
5
|
+
color?: string
|
|
6
|
+
neutral?: boolean
|
|
7
|
+
primary?: boolean
|
|
8
|
+
secondary?: boolean
|
|
9
|
+
accent?: boolean
|
|
10
|
+
info?: boolean
|
|
11
|
+
success?: boolean
|
|
12
|
+
warning?: boolean
|
|
13
|
+
error?: boolean
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<li
|
|
19
|
+
class="step"
|
|
20
|
+
:class="{
|
|
21
|
+
'step-neutral': props.neutral || props.color === 'neutral',
|
|
22
|
+
'step-primary': props.primary || props.color === 'primary',
|
|
23
|
+
'step-secondary': props.secondary || props.color === 'secondary',
|
|
24
|
+
'step-accent': props.accent || props.color === 'accent',
|
|
25
|
+
'step-info': props.info || props.color === 'info',
|
|
26
|
+
'step-success': props.success || props.color === 'success',
|
|
27
|
+
'step-warning': props.warning || props.color === 'warning',
|
|
28
|
+
'step-error': props.error || props.color === 'error',
|
|
29
|
+
}"
|
|
30
|
+
:data-content="glyph"
|
|
31
|
+
>
|
|
32
|
+
<slot />
|
|
33
|
+
</li>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const {
|
|
3
|
+
orientation,
|
|
4
|
+
vertical = false,
|
|
5
|
+
horizontal = false,
|
|
6
|
+
} = defineProps<{
|
|
7
|
+
orientation?: 'vertical' | 'horizontal'
|
|
8
|
+
vertical?: boolean
|
|
9
|
+
horizontal?: boolean
|
|
10
|
+
}>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<ul
|
|
15
|
+
class="steps"
|
|
16
|
+
:class="{
|
|
17
|
+
'steps-vertical': orientation === 'vertical' || vertical,
|
|
18
|
+
'steps-horizontal': orientation === 'horizontal' || horizontal,
|
|
19
|
+
}"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</ul>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { nextTick, ref, watch } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
modelValue?: boolean | null
|
|
6
|
+
rotate?: boolean
|
|
7
|
+
flip?: boolean
|
|
8
|
+
}>()
|
|
9
|
+
const emit = defineEmits(['update:modelValue'])
|
|
10
|
+
|
|
11
|
+
const checkbox = ref<HTMLInputElement | null>(null)
|
|
12
|
+
|
|
13
|
+
// Keep the checkbox's indeterminate property in sync with modelValue
|
|
14
|
+
watch(
|
|
15
|
+
() => props.modelValue,
|
|
16
|
+
val => {
|
|
17
|
+
nextTick(() => {
|
|
18
|
+
if (checkbox.value) {
|
|
19
|
+
checkbox.value.indeterminate = val === null
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
{ immediate: true },
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
function updateValue(event: Event) {
|
|
27
|
+
const input = event.target as HTMLInputElement
|
|
28
|
+
// If indeterminate, toggle to checked
|
|
29
|
+
if (props.modelValue === null) {
|
|
30
|
+
emit('update:modelValue', true)
|
|
31
|
+
} else {
|
|
32
|
+
emit('update:modelValue', input.checked)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<label
|
|
39
|
+
class="swap"
|
|
40
|
+
:class="{
|
|
41
|
+
'swap-rotate': rotate,
|
|
42
|
+
'swap-flip': flip,
|
|
43
|
+
}"
|
|
44
|
+
>
|
|
45
|
+
<input ref="checkbox" type="checkbox" :checked="modelValue === true" @change="updateValue" />
|
|
46
|
+
<div class="swap-indeterminate">
|
|
47
|
+
<slot name="indeterminate" />
|
|
48
|
+
</div>
|
|
49
|
+
<div class="swap-on">
|
|
50
|
+
<slot name="swap" />
|
|
51
|
+
</div>
|
|
52
|
+
<div class="swap-off">
|
|
53
|
+
<slot />
|
|
54
|
+
</div>
|
|
55
|
+
</label>
|
|
56
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
is = 'label',
|
|
6
|
+
name,
|
|
7
|
+
...props
|
|
8
|
+
} = defineProps<{
|
|
9
|
+
is?: string
|
|
10
|
+
name?: string
|
|
11
|
+
active?: boolean
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
}>()
|
|
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
|
+
|
|
24
|
+
const tabManager: any = inject('tabManager')
|
|
25
|
+
if (!tabManager.currentTab.value) {
|
|
26
|
+
tabManager.currentTab.value = name
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<component
|
|
32
|
+
:is="resolvedComponent"
|
|
33
|
+
class="tab"
|
|
34
|
+
:class="{
|
|
35
|
+
'tab-active': props.active || tabManager.currentTab.value === name,
|
|
36
|
+
'tab-disabled': props.disabled,
|
|
37
|
+
}"
|
|
38
|
+
@keypress.enter="() => (tabManager.currentTab.value = name)"
|
|
39
|
+
>
|
|
40
|
+
<input
|
|
41
|
+
type="radio"
|
|
42
|
+
:name="tabManager.name"
|
|
43
|
+
:value="name"
|
|
44
|
+
:checked="tabManager.currentTab.value === name"
|
|
45
|
+
@change="() => (tabManager.currentTab.value = name)"
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<slot v-if="$slots.default" />
|
|
49
|
+
<span v-else>{{ name }}</span>
|
|
50
|
+
</component>
|
|
51
|
+
</template>
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject } from 'vue'
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const { is = 'div', name } = defineProps<{
|
|
5
5
|
is?: any
|
|
6
6
|
name: string
|
|
7
|
-
}>()
|
|
8
|
-
is: 'div',
|
|
9
|
-
})
|
|
7
|
+
}>()
|
|
10
8
|
|
|
11
9
|
const tabManager: any = inject('tabManager')
|
|
12
10
|
|
|
13
11
|
const isCurrentTab = computed(() => {
|
|
14
|
-
return tabManager.currentTab ===
|
|
12
|
+
return tabManager.currentTab.value === name
|
|
15
13
|
})
|
|
16
14
|
|
|
17
|
-
if (!tabManager.
|
|
18
|
-
tabManager.currentTab =
|
|
15
|
+
if (!tabManager?.currentTab.value) {
|
|
16
|
+
tabManager.currentTab.value = name
|
|
17
|
+
}
|
|
19
18
|
|
|
20
|
-
const existing = tabManager
|
|
21
|
-
if (!existing)
|
|
22
|
-
tabManager.tabs.push(
|
|
19
|
+
const existing = tabManager?.tabs?.find((t: string) => t === name)
|
|
20
|
+
if (!existing) {
|
|
21
|
+
tabManager.tabs.push(name)
|
|
22
|
+
}
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<template>
|