daisy-ui-kit 3.0.12 → 5.0.0-pre.10
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/{components → app/components}/Accordion.vue +7 -10
- package/app/components/Alert.vue +35 -0
- package/app/components/Avatar.vue +128 -0
- package/app/components/AvatarGroup.vue +18 -0
- package/app/components/Badge.vue +54 -0
- package/app/components/Button.vue +120 -0
- package/app/components/Calendar.vue +66 -0
- package/app/components/CalendarInput.vue +174 -0
- package/app/components/CalendarSkeleton.vue +46 -0
- package/app/components/Card.vue +33 -0
- package/{components → app/components}/CardActions.vue +3 -6
- package/{components → app/components}/CardBody.vue +3 -6
- package/{components → app/components}/CardTitle.vue +2 -7
- package/app/components/Carousel.vue +23 -0
- package/app/components/Chat.vue +21 -0
- package/app/components/ChatBubble.vue +31 -0
- package/app/components/Checkbox.vue +51 -0
- package/app/components/Collapse.vue +43 -0
- package/app/components/Countdown.vue +15 -0
- package/app/components/CountdownTimers.vue +72 -0
- package/app/components/Counter.vue +10 -0
- package/app/components/DaisyLink.vue +38 -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 +6 -4
- package/{components → app/components}/DrawerContent.vue +1 -1
- package/{components → app/components}/DrawerSide.vue +1 -1
- package/{components → app/components}/Dropdown.vue +2 -2
- package/{components → app/components}/DropdownContent.vue +3 -3
- package/app/components/Fieldset.vue +19 -0
- package/app/components/FileInput.vue +53 -0
- package/app/components/Filter.vue +122 -0
- package/app/components/Flex.vue +82 -0
- package/{components → app/components}/FlexItem.vue +1 -1
- package/app/components/Footer.vue +27 -0
- package/app/components/FormControl.vue +5 -0
- package/{components → app/components}/Hero.vue +1 -1
- package/{components → app/components}/HeroContent.vue +1 -1
- package/app/components/Input.vue +119 -0
- package/app/components/Kbd.vue +24 -0
- package/app/components/Label.vue +97 -0
- package/app/components/List.vue +5 -0
- 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 +100 -0
- package/{components → app/components}/MenuExpandToggle.vue +5 -4
- package/{components → app/components}/MenuItem.vue +3 -4
- package/app/components/MockupPhone.vue +14 -0
- package/{components → app/components}/Modal.vue +14 -5
- 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 +34 -0
- package/{components → app/components}/Prose.vue +1 -1
- 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/{components → app/components}/RangeMeasure.vue +22 -21
- package/{components → app/components}/RangeMeasureTick.vue +9 -14
- package/app/components/Rating.vue +180 -0
- package/{components → app/components}/Select.vue +33 -29
- package/app/components/Skeleton.vue +5 -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 +18 -0
- package/app/components/Swap.vue +62 -0
- package/app/components/Tab.vue +38 -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 +142 -0
- package/app/components/TextArea.vue +61 -0
- package/app/components/ThemeController.vue +46 -0
- package/app/components/ThemeProvider.vue +287 -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 +13 -0
- package/app/components/Toast.vue +72 -0
- package/app/components/Toggle.vue +60 -0
- package/app/components/Tooltip.vue +47 -0
- package/app/components/TooltipContent.vue +5 -0
- package/app/components/ValidatorHint.vue +5 -0
- package/nuxt.js +7 -1
- package/package.json +58 -61
- 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/Countdown.vue +0 -15
- package/components/CountdownTimers.vue +0 -70
- package/components/Counter.vue +0 -14
- package/components/Divider.vue +0 -24
- 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/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/Rating.vue +0 -167
- 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}/CollapseTitle.vue +0 -0
- /package/{components → app/components}/Crumb.vue +0 -0
- /package/{components → app/components}/DropdownButton.vue +0 -0
- /package/{components → app/components}/DropdownTarget.vue +0 -0
- /package/{components → app/components}/FooterTitle.vue +0 -0
- /package/{components → app/components}/HeroOverlay.vue +0 -0
- /package/{components → app/components}/Indicator.vue +0 -0
- /package/{components → app/components}/IndicatorItem.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}/drawer-utils.ts +0 -0
- /package/{utils → app/utils}/random-string.ts +0 -0
|
@@ -11,9 +11,9 @@ const props = withDefaults(defineProps<{
|
|
|
11
11
|
resultAsObject?: boolean
|
|
12
12
|
join?: boolean
|
|
13
13
|
|
|
14
|
-
bordered?: boolean
|
|
15
14
|
ghost?: boolean
|
|
16
15
|
disabled?: boolean
|
|
16
|
+
validator?: boolean
|
|
17
17
|
|
|
18
18
|
color?: Color
|
|
19
19
|
primary?: boolean
|
|
@@ -24,15 +24,17 @@ const props = withDefaults(defineProps<{
|
|
|
24
24
|
warning?: boolean
|
|
25
25
|
error?: boolean
|
|
26
26
|
|
|
27
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
27
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
28
|
+
xl?: boolean
|
|
28
29
|
lg?: boolean
|
|
29
30
|
md?: boolean
|
|
30
31
|
sm?: boolean
|
|
31
32
|
xs?: boolean
|
|
32
33
|
}>(), {
|
|
33
34
|
value: (val: any) => {
|
|
34
|
-
if (!val)
|
|
35
|
+
if (!val) {
|
|
35
36
|
return null
|
|
37
|
+
}
|
|
36
38
|
|
|
37
39
|
return typeof val === 'string'
|
|
38
40
|
? (val as string)
|
|
@@ -48,46 +50,48 @@ const emit = defineEmits(['update:modelValue'])
|
|
|
48
50
|
|
|
49
51
|
const computedVModel = computed({
|
|
50
52
|
get: () => {
|
|
51
|
-
if (props.resultAsObject && props.modelValue != null)
|
|
53
|
+
if (props.resultAsObject && props.modelValue != null) {
|
|
52
54
|
return props.value(props.modelValue)
|
|
55
|
+
}
|
|
53
56
|
|
|
54
57
|
return props.modelValue
|
|
55
58
|
},
|
|
56
59
|
set: (val) => {
|
|
57
|
-
if (val === undefined)
|
|
60
|
+
if (val === undefined) {
|
|
58
61
|
val = null
|
|
59
|
-
|
|
62
|
+
}
|
|
63
|
+
if (props.resultAsObject && val != null) {
|
|
60
64
|
val = props.options.find(o => props.value(o) === val)
|
|
65
|
+
}
|
|
61
66
|
|
|
62
67
|
emit('update:modelValue', val)
|
|
63
68
|
},
|
|
64
69
|
})
|
|
65
|
-
|
|
66
|
-
const classes = computed(() => {
|
|
67
|
-
return {
|
|
68
|
-
'join-item': props.join,
|
|
69
|
-
|
|
70
|
-
'select-primary': props.primary || props.color === 'primary',
|
|
71
|
-
'select-secondary': props.secondary || props.color === 'secondary',
|
|
72
|
-
'select-accent': props.accent || props.color === 'accent',
|
|
73
|
-
'select-info': props.info || props.color === 'info',
|
|
74
|
-
'select-success': props.success || props.color === 'success',
|
|
75
|
-
'select-warning': props.warning || props.color === 'warning',
|
|
76
|
-
'select-error': props.error || props.color === 'error',
|
|
77
|
-
|
|
78
|
-
'select-lg': props.lg || props.size === 'lg',
|
|
79
|
-
'select-md': props.md || props.size === 'md',
|
|
80
|
-
'select-sm': props.sm || props.size === 'sm',
|
|
81
|
-
'select-xs': props.xs || props.size === 'xs',
|
|
82
|
-
|
|
83
|
-
'select-bordered': props.bordered,
|
|
84
|
-
'select-ghost': props.ghost,
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
70
|
</script>
|
|
88
71
|
|
|
89
72
|
<template>
|
|
90
|
-
<select
|
|
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
|
+
'select-primary': props.primary || props.color === 'primary',
|
|
81
|
+
'select-secondary': props.secondary || props.color === 'secondary',
|
|
82
|
+
'select-accent': props.accent || props.color === 'accent',
|
|
83
|
+
'select-info': props.info || props.color === 'info',
|
|
84
|
+
'select-success': props.success || props.color === 'success',
|
|
85
|
+
'select-warning': props.warning || props.color === 'warning',
|
|
86
|
+
'select-error': props.error || props.color === 'error',
|
|
87
|
+
'select-xl': props.xl || props.size === 'xl',
|
|
88
|
+
'select-lg': props.lg || props.size === 'lg',
|
|
89
|
+
'select-md': props.md || props.size === 'md',
|
|
90
|
+
'select-sm': props.sm || props.size === 'sm',
|
|
91
|
+
'select-xs': props.xs || props.size === 'xs',
|
|
92
|
+
}"
|
|
93
|
+
:disabled="disabled"
|
|
94
|
+
>
|
|
91
95
|
<option
|
|
92
96
|
v-for="option in options"
|
|
93
97
|
:key="value(option)"
|
|
@@ -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,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { orientation, vertical = false, horizontal = false } = defineProps<{
|
|
3
|
+
orientation?: 'vertical' | 'horizontal'
|
|
4
|
+
vertical?: boolean
|
|
5
|
+
horizontal?: boolean
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<ul
|
|
11
|
+
class="steps" :class="{
|
|
12
|
+
'steps-vertical': orientation === 'vertical' || vertical,
|
|
13
|
+
'steps-horizontal': orientation === 'horizontal' || horizontal,
|
|
14
|
+
}"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</ul>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
emit('update:modelValue', input.checked)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<label
|
|
40
|
+
class="swap"
|
|
41
|
+
:class="{
|
|
42
|
+
'swap-rotate': rotate,
|
|
43
|
+
'swap-flip': flip,
|
|
44
|
+
}"
|
|
45
|
+
>
|
|
46
|
+
<input
|
|
47
|
+
ref="checkbox"
|
|
48
|
+
type="checkbox"
|
|
49
|
+
:checked="modelValue === true"
|
|
50
|
+
@change="updateValue"
|
|
51
|
+
>
|
|
52
|
+
<div class="swap-indeterminate">
|
|
53
|
+
<slot name="indeterminate" />
|
|
54
|
+
</div>
|
|
55
|
+
<div class="swap-on">
|
|
56
|
+
<slot name="swap" />
|
|
57
|
+
</div>
|
|
58
|
+
<div class="swap-off">
|
|
59
|
+
<slot />
|
|
60
|
+
</div>
|
|
61
|
+
</label>
|
|
62
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const { is = 'label', name, ...props } = defineProps<{
|
|
5
|
+
is?: any
|
|
6
|
+
name?: string
|
|
7
|
+
active?: boolean
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const tabManager: any = inject('tabManager')
|
|
12
|
+
if (!tabManager.currentTab.value) {
|
|
13
|
+
tabManager.currentTab.value = name
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<component
|
|
19
|
+
:is="is"
|
|
20
|
+
class="tab"
|
|
21
|
+
:class="{
|
|
22
|
+
'tab-active': props.active || tabManager.currentTab.value === name,
|
|
23
|
+
'tab-disabled': props.disabled,
|
|
24
|
+
}"
|
|
25
|
+
@keypress.enter="() => (tabManager.currentTab.value = name)"
|
|
26
|
+
>
|
|
27
|
+
<input
|
|
28
|
+
type="radio"
|
|
29
|
+
:name="tabManager.name"
|
|
30
|
+
:value="name"
|
|
31
|
+
:checked="tabManager.currentTab.value === name"
|
|
32
|
+
@change="() => (tabManager.currentTab.value = name)"
|
|
33
|
+
>
|
|
34
|
+
|
|
35
|
+
<slot v-if="$slots.default" />
|
|
36
|
+
<span v-else>{{ name }}</span>
|
|
37
|
+
</component>
|
|
38
|
+
</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>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
zebra?: boolean
|
|
4
|
+
pinRows?: boolean
|
|
5
|
+
pinCols?: boolean
|
|
6
|
+
|
|
7
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
8
|
+
xs?: boolean
|
|
9
|
+
sm?: boolean
|
|
10
|
+
md?: boolean
|
|
11
|
+
lg?: boolean
|
|
12
|
+
xl?: boolean
|
|
13
|
+
}>()
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<table
|
|
18
|
+
class="table"
|
|
19
|
+
:class="[
|
|
20
|
+
zebra ? 'table-zebra' : '',
|
|
21
|
+
pinRows ? 'table-pin-rows' : '',
|
|
22
|
+
pinCols ? 'table-pin-cols' : '',
|
|
23
|
+
xs || size === 'xs' ? 'table-xs' : '',
|
|
24
|
+
sm || size === 'sm' ? 'table-sm' : '',
|
|
25
|
+
md || size === 'md' || (!xs && !sm && !lg && !xl && !size) ? 'table-md' : '',
|
|
26
|
+
lg || size === 'lg' ? 'table-lg' : '',
|
|
27
|
+
xl || size === 'xl' ? 'table-xl' : '',
|
|
28
|
+
]"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</table>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { provide } from 'vue'
|
|
3
|
+
|
|
4
|
+
const { name } = defineProps<{
|
|
5
|
+
is?: any
|
|
6
|
+
name: string
|
|
7
|
+
|
|
8
|
+
variant?: 'box' | 'border' | 'lift'
|
|
9
|
+
box?: boolean
|
|
10
|
+
border?: boolean
|
|
11
|
+
lift?: boolean
|
|
12
|
+
|
|
13
|
+
placement?: 'top' | 'bottom'
|
|
14
|
+
top?: boolean
|
|
15
|
+
bottom?: boolean
|
|
16
|
+
|
|
17
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
18
|
+
xl?: boolean
|
|
19
|
+
lg?: boolean
|
|
20
|
+
md?: boolean
|
|
21
|
+
sm?: boolean
|
|
22
|
+
xs?: boolean
|
|
23
|
+
}>()
|
|
24
|
+
|
|
25
|
+
const currentTab = defineModel<string>('currentTab')
|
|
26
|
+
|
|
27
|
+
const tabManager = {
|
|
28
|
+
name,
|
|
29
|
+
currentTab,
|
|
30
|
+
tabs: [],
|
|
31
|
+
}
|
|
32
|
+
provide('tabManager', tabManager)
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div
|
|
37
|
+
class="tabs"
|
|
38
|
+
:class="{
|
|
39
|
+
'tabs-box': variant === 'box' || box,
|
|
40
|
+
'tabs-border': variant === 'border' || border,
|
|
41
|
+
'tabs-lift': variant === 'lift' || lift,
|
|
42
|
+
'tabs-top': placement === 'top' || top,
|
|
43
|
+
'tabs-bottom': placement === 'bottom' || bottom,
|
|
44
|
+
'tabs-xl': size === 'xl' || xl,
|
|
45
|
+
'tabs-lg': size === 'lg' || lg,
|
|
46
|
+
'tabs-md': size === 'md' || md,
|
|
47
|
+
'tabs-sm': size === 'sm' || sm,
|
|
48
|
+
'tabs-xs': size === 'xs' || xs,
|
|
49
|
+
}"
|
|
50
|
+
>
|
|
51
|
+
<slot />
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
is?: string
|
|
4
|
+
join?: boolean
|
|
5
|
+
|
|
6
|
+
block?: boolean
|
|
7
|
+
inline?: boolean
|
|
8
|
+
inlineBlock?: boolean
|
|
9
|
+
label?: boolean
|
|
10
|
+
|
|
11
|
+
color?: | 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'primary-content' | 'secondary-content' | 'neutral-content' | 'accent-content' | 'info-content' | 'success-content' | 'warning-content' | 'error-content'
|
|
12
|
+
neutral?: boolean
|
|
13
|
+
primary?: boolean
|
|
14
|
+
secondary?: boolean
|
|
15
|
+
accent?: boolean
|
|
16
|
+
info?: boolean
|
|
17
|
+
success?: boolean
|
|
18
|
+
warning?: boolean
|
|
19
|
+
error?: boolean
|
|
20
|
+
neutralContent?: boolean
|
|
21
|
+
primaryContent?: boolean
|
|
22
|
+
secondaryContent?: boolean
|
|
23
|
+
accentContent?: boolean
|
|
24
|
+
infoContent?: boolean
|
|
25
|
+
successContent?: boolean
|
|
26
|
+
warningContent?: boolean
|
|
27
|
+
errorContent?: boolean
|
|
28
|
+
|
|
29
|
+
size?: | '9xl' | '8xl' | '7xl' | '6xl' | '5xl' | '4xl' | '3xl' | '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
30
|
+
xl?: boolean
|
|
31
|
+
lg?: boolean
|
|
32
|
+
md?: boolean
|
|
33
|
+
sm?: boolean
|
|
34
|
+
xs?: boolean
|
|
35
|
+
|
|
36
|
+
align?: 'left' | 'center' | 'right' | 'justify'
|
|
37
|
+
left?: boolean
|
|
38
|
+
center?: boolean
|
|
39
|
+
right?: boolean
|
|
40
|
+
justify?: boolean
|
|
41
|
+
|
|
42
|
+
case?: 'upper' | 'lower' | 'capitalize' | 'normal'
|
|
43
|
+
uppercase?: boolean
|
|
44
|
+
lowercase?: boolean
|
|
45
|
+
capitalize?: boolean
|
|
46
|
+
normalCase?: boolean
|
|
47
|
+
|
|
48
|
+
font?: 'sans' | 'serif' | 'mono'
|
|
49
|
+
sans?: boolean
|
|
50
|
+
serif?: boolean
|
|
51
|
+
mono?: boolean
|
|
52
|
+
|
|
53
|
+
weight?: | 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black'
|
|
54
|
+
thin?: boolean
|
|
55
|
+
extralight?: boolean
|
|
56
|
+
light?: boolean
|
|
57
|
+
normal?: boolean
|
|
58
|
+
medium?: boolean
|
|
59
|
+
semibold?: boolean
|
|
60
|
+
bold?: boolean
|
|
61
|
+
extrabold?: boolean
|
|
62
|
+
black?: boolean
|
|
63
|
+
}>()
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<component
|
|
68
|
+
:is="is || 'span'"
|
|
69
|
+
v-bind="label ? { 'data-role': 'label' } : {}"
|
|
70
|
+
:class="{
|
|
71
|
+
'join-item': join,
|
|
72
|
+
|
|
73
|
+
'block': block,
|
|
74
|
+
'inline': inline,
|
|
75
|
+
'inline-block': inlineBlock,
|
|
76
|
+
'label': label,
|
|
77
|
+
|
|
78
|
+
'text-primary': primary || color === 'primary',
|
|
79
|
+
'text-primary-content':
|
|
80
|
+
primaryContent || color === 'primary-content',
|
|
81
|
+
'text-secondary': secondary || color === 'secondary',
|
|
82
|
+
'text-secondary-content':
|
|
83
|
+
secondaryContent || color === 'secondary-content',
|
|
84
|
+
'text-neutral': neutral || color === 'neutral',
|
|
85
|
+
'text-neutral-content':
|
|
86
|
+
neutralContent || color === 'neutral-content',
|
|
87
|
+
'text-accent': accent || color === 'accent',
|
|
88
|
+
'text-accent-content':
|
|
89
|
+
accentContent || color === 'accent-content',
|
|
90
|
+
'text-info': info || color === 'info',
|
|
91
|
+
'text-info-content': infoContent || color === 'info-content',
|
|
92
|
+
'text-success': success || color === 'success',
|
|
93
|
+
'text-success-content':
|
|
94
|
+
successContent || color === 'success-content',
|
|
95
|
+
'text-warning': warning || color === 'warning',
|
|
96
|
+
'text-warning-content':
|
|
97
|
+
warningContent || color === 'warning-content',
|
|
98
|
+
'text-error': error || color === 'error',
|
|
99
|
+
'text-error-content': errorContent || color === 'error-content',
|
|
100
|
+
|
|
101
|
+
'text-9xl': size === '9xl',
|
|
102
|
+
'text-8xl': size === '8xl',
|
|
103
|
+
'text-7xl': size === '7xl',
|
|
104
|
+
'text-6xl': size === '6xl',
|
|
105
|
+
'text-5xl': size === '5xl',
|
|
106
|
+
'text-4xl': size === '4xl',
|
|
107
|
+
'text-3xl': size === '3xl',
|
|
108
|
+
'text-2xl': size === '2xl',
|
|
109
|
+
'text-xl': xl || size === 'xl',
|
|
110
|
+
'text-lg': lg || size === 'lg',
|
|
111
|
+
'text-md': md || size === 'md',
|
|
112
|
+
'text-sm': sm || size === 'sm',
|
|
113
|
+
'text-xs': xs || size === 'xs',
|
|
114
|
+
|
|
115
|
+
'text-left': left || align === 'left',
|
|
116
|
+
'text-center': center || align === 'center',
|
|
117
|
+
'text-right': right || align === 'right',
|
|
118
|
+
'text-justify': justify || align === 'justify',
|
|
119
|
+
|
|
120
|
+
'uppercase': uppercase || props.case === 'upper',
|
|
121
|
+
'lowercase': lowercase || props.case === 'lower',
|
|
122
|
+
'capitalize': capitalize || props.case === 'capitalize',
|
|
123
|
+
'normal-case': normalCase || props.case === 'normal',
|
|
124
|
+
|
|
125
|
+
'font-sans': sans || font === 'sans',
|
|
126
|
+
'font-serif': serif || font === 'serif',
|
|
127
|
+
'font-mono': mono || font === 'mono',
|
|
128
|
+
|
|
129
|
+
'font-thin': thin || weight === 'thin',
|
|
130
|
+
'font-extralight': extralight || weight === 'extralight',
|
|
131
|
+
'font-light': light || weight === 'light',
|
|
132
|
+
'font-normal': normal || weight === 'normal',
|
|
133
|
+
'font-medium': medium || weight === 'medium',
|
|
134
|
+
'font-semibold': semibold || weight === 'semibold',
|
|
135
|
+
'font-bold': bold || weight === 'bold',
|
|
136
|
+
'font-extrabold': extrabold || weight === 'extrabold',
|
|
137
|
+
'font-black': black || weight === 'black',
|
|
138
|
+
}"
|
|
139
|
+
>
|
|
140
|
+
<slot />
|
|
141
|
+
</component>
|
|
142
|
+
</template>
|