daisy-ui-kit 5.0.0-pre.9 → 5.0.1
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 +277 -48
- 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 +19 -1
- package/app/components/Button.vue +66 -46
- package/app/components/Calendar.vue +151 -42
- package/app/components/CalendarInput.vue +229 -130
- package/app/components/CalendarSkeleton.vue +51 -10
- package/app/components/Card.vue +20 -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 +38 -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 +14 -3
- package/app/components/DaisyLink.vue +33 -15
- package/app/components/Dock.vue +5 -6
- package/app/components/DockItem.vue +5 -3
- 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 -20
- package/app/components/DropdownTarget.vue +10 -3
- 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 +5 -4
- package/app/components/FileInput.vue +1 -1
- package/app/components/Filter.vue +45 -38
- package/app/components/Flex.vue +8 -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 +12 -5
- package/app/components/IndicatorItem.vue +21 -14
- package/app/components/Input.vue +44 -47
- package/app/components/Kbd.vue +2 -1
- package/app/components/Label.vue +32 -29
- package/app/components/MenuExpand.vue +5 -13
- 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 +186 -46
- package/app/components/RangeMeasure.vue +33 -30
- package/app/components/RangeMeasureTick.vue +4 -5
- package/app/components/Rating.vue +70 -53
- package/app/components/Select.vue +44 -47
- package/app/components/SkeletonText.vue +11 -0
- package/app/components/Stack.vue +5 -0
- package/app/components/Steps.vue +7 -2
- package/app/components/Swap.vue +4 -10
- package/app/components/Tab.vue +23 -5
- package/app/components/Text.vue +47 -23
- package/app/components/TextArea.vue +75 -30
- 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 +3 -8
- package/app/components/Toggle.vue +2 -2
- package/app/components/Tooltip.vue +111 -21
- package/app/components/TooltipContent.vue +279 -1
- package/app/components/TooltipTarget.vue +20 -0
- package/app/composables/__tests__/use-calendar.test.ts +239 -0
- package/app/composables/use-calendar.ts +288 -0
- package/app/composables/use-daisy-theme.ts +140 -0
- package/app/composables/use-toast.ts +345 -0
- package/app/composables/useSearch.ts +22 -0
- package/app/utils/drawer-utils.ts +15 -13
- package/app/utils/position-area.ts +40 -0
- package/nuxt.d.ts +13 -0
- package/nuxt.js +12 -9
- package/package.json +34 -17
- package/app/utils/random-string.ts +0 -19
|
@@ -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 == null) {
|
|
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/Stack.vue
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
defineOptions({
|
|
3
|
+
inheritAttrs: false,
|
|
4
|
+
})
|
|
5
|
+
|
|
2
6
|
const { is = 'div' } = defineProps<{
|
|
3
7
|
is?: string
|
|
4
8
|
direction?: 'top' | 'end' | 'bottom' | 'start'
|
|
@@ -12,6 +16,7 @@ const { is = 'div' } = defineProps<{
|
|
|
12
16
|
<template>
|
|
13
17
|
<component
|
|
14
18
|
:is="is"
|
|
19
|
+
v-bind="$attrs"
|
|
15
20
|
class="stack"
|
|
16
21
|
:class="{
|
|
17
22
|
'stack-top': top || direction === 'top',
|
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,30 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { inject } from 'vue'
|
|
2
|
+
import { computed, inject, resolveComponent } from 'vue'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
defineOptions({
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
is = 'label',
|
|
10
|
+
name,
|
|
11
|
+
...props
|
|
12
|
+
} = defineProps<{
|
|
13
|
+
is?: string
|
|
6
14
|
name?: string
|
|
7
15
|
active?: boolean
|
|
8
16
|
disabled?: boolean
|
|
9
17
|
}>()
|
|
10
18
|
|
|
19
|
+
const NuxtLink = resolveComponent('NuxtLink')
|
|
20
|
+
const RouterLink = resolveComponent('RouterLink')
|
|
21
|
+
|
|
22
|
+
const resolvedComponent = computed(() => {
|
|
23
|
+
if (is === 'NuxtLink') return NuxtLink
|
|
24
|
+
if (is === 'RouterLink') return RouterLink
|
|
25
|
+
return is
|
|
26
|
+
})
|
|
27
|
+
|
|
11
28
|
const tabManager: any = inject('tabManager')
|
|
12
29
|
if (!tabManager.currentTab.value) {
|
|
13
30
|
tabManager.currentTab.value = name
|
|
@@ -16,7 +33,8 @@ if (!tabManager.currentTab.value) {
|
|
|
16
33
|
|
|
17
34
|
<template>
|
|
18
35
|
<component
|
|
19
|
-
:is="
|
|
36
|
+
:is="resolvedComponent"
|
|
37
|
+
v-bind="$attrs"
|
|
20
38
|
class="tab"
|
|
21
39
|
:class="{
|
|
22
40
|
'tab-active': props.active || tabManager.currentTab.value === name,
|
|
@@ -30,7 +48,7 @@ if (!tabManager.currentTab.value) {
|
|
|
30
48
|
:value="name"
|
|
31
49
|
:checked="tabManager.currentTab.value === name"
|
|
32
50
|
@change="() => (tabManager.currentTab.value = name)"
|
|
33
|
-
|
|
51
|
+
/>
|
|
34
52
|
|
|
35
53
|
<slot v-if="$slots.default" />
|
|
36
54
|
<span v-else>{{ name }}</span>
|
package/app/components/Text.vue
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, resolveComponent } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
})
|
|
7
|
+
|
|
2
8
|
const props = defineProps<{
|
|
3
9
|
is?: string
|
|
4
10
|
join?: boolean
|
|
@@ -8,7 +14,23 @@ const props = defineProps<{
|
|
|
8
14
|
inlineBlock?: boolean
|
|
9
15
|
label?: boolean
|
|
10
16
|
|
|
11
|
-
color?:
|
|
17
|
+
color?:
|
|
18
|
+
| 'neutral'
|
|
19
|
+
| 'primary'
|
|
20
|
+
| 'secondary'
|
|
21
|
+
| 'accent'
|
|
22
|
+
| 'info'
|
|
23
|
+
| 'success'
|
|
24
|
+
| 'warning'
|
|
25
|
+
| 'error'
|
|
26
|
+
| 'primary-content'
|
|
27
|
+
| 'secondary-content'
|
|
28
|
+
| 'neutral-content'
|
|
29
|
+
| 'accent-content'
|
|
30
|
+
| 'info-content'
|
|
31
|
+
| 'success-content'
|
|
32
|
+
| 'warning-content'
|
|
33
|
+
| 'error-content'
|
|
12
34
|
neutral?: boolean
|
|
13
35
|
primary?: boolean
|
|
14
36
|
secondary?: boolean
|
|
@@ -26,7 +48,7 @@ const props = defineProps<{
|
|
|
26
48
|
warningContent?: boolean
|
|
27
49
|
errorContent?: boolean
|
|
28
50
|
|
|
29
|
-
size?:
|
|
51
|
+
size?: '9xl' | '8xl' | '7xl' | '6xl' | '5xl' | '4xl' | '3xl' | '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
30
52
|
xl?: boolean
|
|
31
53
|
lg?: boolean
|
|
32
54
|
md?: boolean
|
|
@@ -50,7 +72,7 @@ const props = defineProps<{
|
|
|
50
72
|
serif?: boolean
|
|
51
73
|
mono?: boolean
|
|
52
74
|
|
|
53
|
-
weight?:
|
|
75
|
+
weight?: 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black'
|
|
54
76
|
thin?: boolean
|
|
55
77
|
extralight?: boolean
|
|
56
78
|
light?: boolean
|
|
@@ -61,40 +83,42 @@ const props = defineProps<{
|
|
|
61
83
|
extrabold?: boolean
|
|
62
84
|
black?: boolean
|
|
63
85
|
}>()
|
|
86
|
+
const NuxtLink = resolveComponent('NuxtLink')
|
|
87
|
+
const RouterLink = resolveComponent('RouterLink')
|
|
88
|
+
|
|
89
|
+
const resolvedComponent = computed(() => {
|
|
90
|
+
if (props.is === 'NuxtLink') return NuxtLink
|
|
91
|
+
if (props.is === 'RouterLink') return RouterLink
|
|
92
|
+
return props.is || 'span'
|
|
93
|
+
})
|
|
64
94
|
</script>
|
|
65
95
|
|
|
66
96
|
<template>
|
|
67
97
|
<component
|
|
68
|
-
:is="
|
|
69
|
-
v-bind="label ? { 'data-role': 'label' } : {}"
|
|
98
|
+
:is="resolvedComponent"
|
|
99
|
+
v-bind="{ ...$attrs, ...(label ? { 'data-role': 'label' } : {}) }"
|
|
70
100
|
:class="{
|
|
71
101
|
'join-item': join,
|
|
72
102
|
|
|
73
|
-
|
|
74
|
-
|
|
103
|
+
block,
|
|
104
|
+
inline,
|
|
75
105
|
'inline-block': inlineBlock,
|
|
76
|
-
|
|
106
|
+
label,
|
|
77
107
|
|
|
78
108
|
'text-primary': primary || color === 'primary',
|
|
79
|
-
'text-primary-content':
|
|
80
|
-
primaryContent || color === 'primary-content',
|
|
109
|
+
'text-primary-content': primaryContent || color === 'primary-content',
|
|
81
110
|
'text-secondary': secondary || color === 'secondary',
|
|
82
|
-
'text-secondary-content':
|
|
83
|
-
secondaryContent || color === 'secondary-content',
|
|
111
|
+
'text-secondary-content': secondaryContent || color === 'secondary-content',
|
|
84
112
|
'text-neutral': neutral || color === 'neutral',
|
|
85
|
-
'text-neutral-content':
|
|
86
|
-
neutralContent || color === 'neutral-content',
|
|
113
|
+
'text-neutral-content': neutralContent || color === 'neutral-content',
|
|
87
114
|
'text-accent': accent || color === 'accent',
|
|
88
|
-
'text-accent-content':
|
|
89
|
-
accentContent || color === 'accent-content',
|
|
115
|
+
'text-accent-content': accentContent || color === 'accent-content',
|
|
90
116
|
'text-info': info || color === 'info',
|
|
91
117
|
'text-info-content': infoContent || color === 'info-content',
|
|
92
118
|
'text-success': success || color === 'success',
|
|
93
|
-
'text-success-content':
|
|
94
|
-
successContent || color === 'success-content',
|
|
119
|
+
'text-success-content': successContent || color === 'success-content',
|
|
95
120
|
'text-warning': warning || color === 'warning',
|
|
96
|
-
'text-warning-content':
|
|
97
|
-
warningContent || color === 'warning-content',
|
|
121
|
+
'text-warning-content': warningContent || color === 'warning-content',
|
|
98
122
|
'text-error': error || color === 'error',
|
|
99
123
|
'text-error-content': errorContent || color === 'error-content',
|
|
100
124
|
|
|
@@ -117,9 +141,9 @@ const props = defineProps<{
|
|
|
117
141
|
'text-right': right || align === 'right',
|
|
118
142
|
'text-justify': justify || align === 'justify',
|
|
119
143
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
uppercase: uppercase || props.case === 'upper',
|
|
145
|
+
lowercase: lowercase || props.case === 'lower',
|
|
146
|
+
capitalize: capitalize || props.case === 'capitalize',
|
|
123
147
|
'normal-case': normalCase || props.case === 'normal',
|
|
124
148
|
|
|
125
149
|
'font-sans': sans || font === 'sans',
|
|
@@ -1,39 +1,79 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
2
|
+
import { nextTick, onMounted, ref, watch } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
modelValue?: string
|
|
7
|
+
placeholder?: string
|
|
8
|
+
type?: 'text' | 'phone' | 'email' | 'search'
|
|
9
|
+
rows?: number
|
|
10
|
+
autoExpand?: 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
|
+
ghost?: boolean
|
|
23
|
+
disabled?: boolean
|
|
24
|
+
validator?: boolean
|
|
25
|
+
|
|
26
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
27
|
+
xl?: boolean
|
|
28
|
+
lg?: boolean
|
|
29
|
+
md?: boolean
|
|
30
|
+
sm?: boolean
|
|
31
|
+
xs?: boolean
|
|
32
|
+
}>(),
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
rows: 2,
|
|
36
|
+
},
|
|
37
|
+
)
|
|
30
38
|
defineEmits(['update:modelValue'])
|
|
39
|
+
|
|
40
|
+
const textareaRef = ref<HTMLTextAreaElement | null>(null)
|
|
41
|
+
|
|
42
|
+
let minHeight = 0
|
|
43
|
+
|
|
44
|
+
function adjustHeight() {
|
|
45
|
+
if (!props.autoExpand || !textareaRef.value) return
|
|
46
|
+
const el = textareaRef.value
|
|
47
|
+
|
|
48
|
+
// Capture the initial rendered height as minimum (respects rows attribute)
|
|
49
|
+
if (minHeight === 0) {
|
|
50
|
+
minHeight = el.offsetHeight
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
el.style.height = 'auto'
|
|
54
|
+
el.style.height = `${Math.max(el.scrollHeight, minHeight)}px`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
watch(
|
|
58
|
+
() => props.modelValue,
|
|
59
|
+
() => {
|
|
60
|
+
nextTick(adjustHeight)
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
if (props.autoExpand) {
|
|
66
|
+
nextTick(adjustHeight)
|
|
67
|
+
}
|
|
68
|
+
})
|
|
31
69
|
</script>
|
|
32
70
|
|
|
33
71
|
<template>
|
|
34
72
|
<textarea
|
|
73
|
+
ref="textareaRef"
|
|
35
74
|
:value="modelValue"
|
|
36
75
|
:type="type"
|
|
76
|
+
:rows="rows"
|
|
37
77
|
:placeholder="placeholder"
|
|
38
78
|
:disabled="disabled"
|
|
39
79
|
class="textarea"
|
|
@@ -48,7 +88,7 @@ defineEmits(['update:modelValue'])
|
|
|
48
88
|
'textarea-error': props.error || props.color === 'error',
|
|
49
89
|
|
|
50
90
|
'textarea-ghost': props.ghost,
|
|
51
|
-
|
|
91
|
+
validator: props.validator,
|
|
52
92
|
|
|
53
93
|
'textarea-xl': props.xl || props.size === 'xl',
|
|
54
94
|
'textarea-lg': props.lg || props.size === 'lg',
|
|
@@ -56,6 +96,11 @@ defineEmits(['update:modelValue'])
|
|
|
56
96
|
'textarea-sm': props.sm || props.size === 'sm',
|
|
57
97
|
'textarea-xs': props.xs || props.size === 'xs',
|
|
58
98
|
}"
|
|
59
|
-
@input="
|
|
99
|
+
@input="
|
|
100
|
+
event => {
|
|
101
|
+
$emit('update:modelValue', (event.target as HTMLTextAreaElement).value)
|
|
102
|
+
adjustHeight()
|
|
103
|
+
}
|
|
104
|
+
"
|
|
60
105
|
/>
|
|
61
106
|
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
is?: any
|
|
6
|
+
center?: boolean
|
|
7
|
+
duration?: number
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
const style = computed(() => {
|
|
11
|
+
if (props.duration) {
|
|
12
|
+
return { animationDuration: `${props.duration}ms` }
|
|
13
|
+
}
|
|
14
|
+
return undefined
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<component :is="props.is || 'span'" class="text-rotate" :style="style">
|
|
20
|
+
<span :class="{ 'justify-items-center': props.center }">
|
|
21
|
+
<slot />
|
|
22
|
+
</span>
|
|
23
|
+
</component>
|
|
24
|
+
</template>
|
|
@@ -18,16 +18,15 @@ const props = defineProps<{
|
|
|
18
18
|
storage?: <T>(key: string, initial: T) => import('vue').Ref<T>
|
|
19
19
|
}>()
|
|
20
20
|
|
|
21
|
-
const themeOptions =
|
|
22
|
-
? { themes: props.themes || [], defaultTheme: props.defaultTheme }
|
|
23
|
-
: undefined
|
|
21
|
+
const themeOptions =
|
|
22
|
+
props.themes || props.defaultTheme ? { themes: props.themes || [], defaultTheme: props.defaultTheme } : undefined
|
|
24
23
|
|
|
25
24
|
const { theme, effectiveTheme, themes, setTheme, cycleTheme, registerTheme, removeTheme } = useDaisyTheme(
|
|
26
25
|
props.storage,
|
|
27
26
|
themeOptions,
|
|
28
27
|
)
|
|
29
28
|
|
|
30
|
-
const availableThemes = computed(() => themes.value.map(t => typeof t === 'string' ? t : t.theme))
|
|
29
|
+
const availableThemes = computed(() => themes.value.map(t => (typeof t === 'string' ? t : t.theme)))
|
|
31
30
|
</script>
|
|
32
31
|
|
|
33
32
|
<template>
|