daisy-ui-kit 3.0.12 → 5.0.0-pre.3
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/package.json +41 -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/Breadcrumbs.vue +0 -7
- package/components/Button.vue +0 -111
- package/components/Card.vue +0 -30
- package/components/CardActions.vue +0 -16
- package/components/CardBody.vue +0 -16
- package/components/CardTitle.vue +0 -16
- package/components/Carousel.vue +0 -25
- package/components/CarouselItem.vue +0 -5
- package/components/Chat.vue +0 -27
- package/components/ChatBubble.vue +0 -34
- package/components/ChatFooter.vue +0 -5
- package/components/ChatHeader.vue +0 -5
- package/components/ChatImage.vue +0 -5
- package/components/Checkbox.vue +0 -55
- package/components/Code.vue +0 -92
- package/components/Collapse.vue +0 -54
- package/components/CollapseContent.vue +0 -5
- package/components/CollapseTitle.vue +0 -5
- package/components/Countdown.vue +0 -15
- package/components/CountdownTimers.vue +0 -70
- package/components/Counter.vue +0 -14
- package/components/Crumb.vue +0 -5
- package/components/Divider.vue +0 -24
- package/components/Drawer.vue +0 -45
- package/components/DrawerContent.vue +0 -17
- package/components/DrawerSide.vue +0 -18
- package/components/Dropdown.vue +0 -95
- package/components/DropdownButton.vue +0 -16
- package/components/DropdownContent.vue +0 -56
- package/components/DropdownTarget.vue +0 -14
- package/components/FileInput.vue +0 -59
- package/components/Flex.vue +0 -59
- package/components/FlexItem.vue +0 -59
- package/components/Footer.vue +0 -24
- package/components/FooterTitle.vue +0 -15
- package/components/FormControl.vue +0 -5
- package/components/Hero.vue +0 -15
- package/components/HeroContent.vue +0 -15
- package/components/HeroOverlay.vue +0 -5
- package/components/Indicator.vue +0 -13
- package/components/IndicatorItem.vue +0 -36
- package/components/Join.vue +0 -5
- 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/MenuItem.vue +0 -38
- package/components/MenuTitle.vue +0 -5
- package/components/MockupBrowser.vue +0 -5
- package/components/MockupBrowserToolbar.vue +0 -5
- package/components/MockupCode.vue +0 -4
- package/components/MockupPhone.vue +0 -8
- package/components/MockupWindow.vue +0 -5
- package/components/Modal.vue +0 -48
- package/components/ModalAction.vue +0 -5
- package/components/ModalBox.vue +0 -5
- package/components/NavButton.vue +0 -20
- package/components/Navbar.vue +0 -14
- package/components/NavbarCenter.vue +0 -13
- package/components/NavbarEnd.vue +0 -13
- package/components/NavbarStart.vue +0 -13
- package/components/Progress.vue +0 -42
- package/components/Prose.vue +0 -32
- package/components/RadialProgress.vue +0 -41
- package/components/Radio.vue +0 -76
- package/components/RadioGroup.vue +0 -46
- package/components/Range.vue +0 -60
- package/components/RangeMeasure.vue +0 -83
- package/components/RangeMeasureTick.vue +0 -74
- package/components/Rating.vue +0 -167
- package/components/Select.vue +0 -100
- package/components/Stack.vue +0 -13
- package/components/Stat.vue +0 -5
- package/components/StatActions.vue +0 -5
- package/components/StatDesc.vue +0 -5
- package/components/StatFigure.vue +0 -5
- package/components/StatTitle.vue +0 -5
- package/components/StatValue.vue +0 -5
- package/components/Stats.vue +0 -5
- 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/TabContent.vue +0 -29
- 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/nuxt.js +0 -22
- package/utils/-utils.ts +0 -41
- package/utils/Button.config.ts +0 -26
- package/utils/drawer-utils.ts +0 -32
- package/utils/fixtures.ts +0 -62
- package/utils/random-string.ts +0 -19
- package/utils/types.ts +0 -7
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
value: number | string
|
|
6
|
-
size?: string
|
|
7
|
-
thickness?: string
|
|
8
|
-
|
|
9
|
-
color?: string
|
|
10
|
-
neutral?: boolean
|
|
11
|
-
primary?: boolean
|
|
12
|
-
secondary?: boolean
|
|
13
|
-
accent?: boolean
|
|
14
|
-
info?: boolean
|
|
15
|
-
success?: boolean
|
|
16
|
-
warning?: boolean
|
|
17
|
-
error?: boolean
|
|
18
|
-
}>()
|
|
19
|
-
|
|
20
|
-
const calculatedSize = computed(() => props.size || '4rem')
|
|
21
|
-
const calculatedThickness = computed(() => props.thickness || 'calc(var(--size) / 10)')
|
|
22
|
-
|
|
23
|
-
const classes = computed(() => {
|
|
24
|
-
return {
|
|
25
|
-
'text-primary': (props.primary || props.color === 'primary'),
|
|
26
|
-
'text-secondary': (props.secondary || props.color === 'secondary'),
|
|
27
|
-
'text-neutral': (props.neutral || props.color === 'neutral'),
|
|
28
|
-
'text-accent': (props.accent || props.color === 'accent'),
|
|
29
|
-
'text-info': (props.info || props.color === 'info'),
|
|
30
|
-
'text-success': (props.success || props.color === 'success'),
|
|
31
|
-
'text-warning': (props.warning || props.color === 'warning'),
|
|
32
|
-
'text-error': (props.error || props.color === 'error'),
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<template>
|
|
38
|
-
<div class="radial-progress" :class="classes" :style="`--value:${value}; --size:${calculatedSize}; --thickness:${calculatedThickness};`">
|
|
39
|
-
<slot />
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
package/components/Radio.vue
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, inject } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
modelValue?: any
|
|
6
|
-
value: any
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
|
|
9
|
-
color?: string
|
|
10
|
-
neutral?: boolean
|
|
11
|
-
primary?: boolean
|
|
12
|
-
secondary?: boolean
|
|
13
|
-
accent?: boolean
|
|
14
|
-
success?: boolean
|
|
15
|
-
warning?: boolean
|
|
16
|
-
info?: boolean
|
|
17
|
-
error?: boolean
|
|
18
|
-
|
|
19
|
-
size?: string
|
|
20
|
-
xs?: boolean
|
|
21
|
-
sm?: boolean
|
|
22
|
-
md?: boolean
|
|
23
|
-
lg?: boolean
|
|
24
|
-
}>()
|
|
25
|
-
const emit = defineEmits(['update:modelValue'])
|
|
26
|
-
|
|
27
|
-
const radioGroup: any = inject('radio-group', null)
|
|
28
|
-
|
|
29
|
-
const _props = computed(() => {
|
|
30
|
-
if (radioGroup)
|
|
31
|
-
return Object.assign({}, radioGroup.props, props)
|
|
32
|
-
else return props
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const classes = computed(() => {
|
|
36
|
-
const { color, neutral, primary, secondary, accent, success, warning, info, error, size, xs, sm, md, lg } = _props.value
|
|
37
|
-
return {
|
|
38
|
-
'radio-neutral': neutral || color === 'neutral',
|
|
39
|
-
'radio-primary': primary || color === 'primary',
|
|
40
|
-
'radio-secondary': secondary || color === 'secondary',
|
|
41
|
-
'radio-accent': accent || color === 'accent',
|
|
42
|
-
'radio-success': success || color === 'success',
|
|
43
|
-
'radio-warning': warning || color === 'warning',
|
|
44
|
-
'radio-info': info || color === 'info',
|
|
45
|
-
'radio-error': error || color === 'error',
|
|
46
|
-
'radio-xs': xs || size === 'xs',
|
|
47
|
-
'radio-sm': sm || size === 'sm',
|
|
48
|
-
'radio-md': md || size === 'md',
|
|
49
|
-
'radio-lg': lg || size === 'lg',
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const currentValue = computed({
|
|
54
|
-
get() {
|
|
55
|
-
if (radioGroup)
|
|
56
|
-
return radioGroup.currentValue
|
|
57
|
-
return props.modelValue
|
|
58
|
-
},
|
|
59
|
-
set(val: string) {
|
|
60
|
-
radioGroup && (radioGroup.currentValue = val)
|
|
61
|
-
emit('update:modelValue', val)
|
|
62
|
-
},
|
|
63
|
-
})
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<template>
|
|
67
|
-
<input
|
|
68
|
-
v-model="currentValue"
|
|
69
|
-
type="radio"
|
|
70
|
-
v-bind="{ ..._props, ...$attrs }"
|
|
71
|
-
class="radio"
|
|
72
|
-
:class="classes"
|
|
73
|
-
:disabled="disabled"
|
|
74
|
-
:value="props.value"
|
|
75
|
-
>
|
|
76
|
-
</template>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, provide, reactive } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
modelValue?: any
|
|
6
|
-
name: string
|
|
7
|
-
|
|
8
|
-
color?: string
|
|
9
|
-
neutral?: boolean
|
|
10
|
-
primary?: boolean
|
|
11
|
-
secondary?: boolean
|
|
12
|
-
accent?: boolean
|
|
13
|
-
success?: boolean
|
|
14
|
-
warning?: boolean
|
|
15
|
-
info?: boolean
|
|
16
|
-
error?: boolean
|
|
17
|
-
|
|
18
|
-
size?: string
|
|
19
|
-
xs?: boolean
|
|
20
|
-
sm?: boolean
|
|
21
|
-
md?: boolean
|
|
22
|
-
lg?: boolean
|
|
23
|
-
}>()
|
|
24
|
-
const emit = defineEmits(['update:modelValue'])
|
|
25
|
-
|
|
26
|
-
const currentValue = computed({
|
|
27
|
-
get: () => {
|
|
28
|
-
return props.modelValue
|
|
29
|
-
},
|
|
30
|
-
set: (val) => {
|
|
31
|
-
emit('update:modelValue', val)
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const state = reactive({
|
|
36
|
-
currentValue,
|
|
37
|
-
props,
|
|
38
|
-
})
|
|
39
|
-
provide('radio-group', state)
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<template>
|
|
43
|
-
<div class="radio-group">
|
|
44
|
-
<slot />
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
package/components/Range.vue
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
modelValue?: number | string
|
|
6
|
-
min?: number | string
|
|
7
|
-
max?: number | string
|
|
8
|
-
step?: number | string
|
|
9
|
-
disabled?: boolean
|
|
10
|
-
|
|
11
|
-
color?: string
|
|
12
|
-
neutral?: boolean
|
|
13
|
-
primary?: boolean
|
|
14
|
-
secondary?: boolean
|
|
15
|
-
accent?: boolean
|
|
16
|
-
success?: boolean
|
|
17
|
-
warning?: boolean
|
|
18
|
-
info?: boolean
|
|
19
|
-
error?: boolean
|
|
20
|
-
|
|
21
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
22
|
-
lg?: boolean
|
|
23
|
-
md?: boolean
|
|
24
|
-
sm?: boolean
|
|
25
|
-
xs?: boolean
|
|
26
|
-
}>()
|
|
27
|
-
defineEmits(['update:modelValue'])
|
|
28
|
-
|
|
29
|
-
const classes = computed(() => {
|
|
30
|
-
const { color, neutral, primary, secondary, accent, success, info, warning, error, size, lg, md, sm, xs } = props
|
|
31
|
-
return {
|
|
32
|
-
'range-neutral': neutral || color === 'neutral',
|
|
33
|
-
'range-primary': primary || color === 'primary',
|
|
34
|
-
'range-secondary': secondary || color === 'secondary',
|
|
35
|
-
'range-accent': accent || color === 'accent',
|
|
36
|
-
'range-success': success || color === 'success',
|
|
37
|
-
'range-info': info || color === 'info',
|
|
38
|
-
'range-warning': warning || color === 'warning',
|
|
39
|
-
'range-error': error || color === 'error',
|
|
40
|
-
'range-lg': lg || size === 'lg',
|
|
41
|
-
'range-md': md || size === 'md',
|
|
42
|
-
'range-sm': sm || size === 'sm',
|
|
43
|
-
'range-xs': xs || size === 'xs',
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<input
|
|
50
|
-
type="range"
|
|
51
|
-
class="range"
|
|
52
|
-
:class="classes"
|
|
53
|
-
:min="min"
|
|
54
|
-
:max="max"
|
|
55
|
-
:step="step"
|
|
56
|
-
:disabled="disabled"
|
|
57
|
-
:value="modelValue"
|
|
58
|
-
@input="$emit('update:modelValue', ($event.target as any).value)"
|
|
59
|
-
>
|
|
60
|
-
</template>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
modelValue?: number | string
|
|
6
|
-
min?: number | string
|
|
7
|
-
max?: number | string
|
|
8
|
-
step?: number | string
|
|
9
|
-
|
|
10
|
-
numbered?: boolean
|
|
11
|
-
asButtons?: boolean
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
|
|
14
|
-
color?: string
|
|
15
|
-
neutral?: boolean
|
|
16
|
-
primary?: boolean
|
|
17
|
-
secondary?: boolean
|
|
18
|
-
accent?: boolean
|
|
19
|
-
success?: boolean
|
|
20
|
-
warning?: boolean
|
|
21
|
-
info?: boolean
|
|
22
|
-
error?: boolean
|
|
23
|
-
|
|
24
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
25
|
-
lg?: boolean
|
|
26
|
-
md?: boolean
|
|
27
|
-
sm?: boolean
|
|
28
|
-
xs?: boolean
|
|
29
|
-
}>(), {
|
|
30
|
-
min: 0,
|
|
31
|
-
max: 100,
|
|
32
|
-
step: 1,
|
|
33
|
-
})
|
|
34
|
-
defineEmits(['update:modelValue'])
|
|
35
|
-
|
|
36
|
-
const classes = computed(() => {
|
|
37
|
-
const { color, neutral, primary, secondary, accent, success, info, warning, error, size, lg, md, sm, xs, disabled } = props
|
|
38
|
-
return {
|
|
39
|
-
'text-neutral': neutral || color === 'neutral',
|
|
40
|
-
'text-primary': primary || color === 'primary',
|
|
41
|
-
'text-secondary': secondary || color === 'secondary',
|
|
42
|
-
'text-accent': accent || color === 'accent',
|
|
43
|
-
'text-success': success || color === 'success',
|
|
44
|
-
'text-info': info || color === 'info',
|
|
45
|
-
'text-warning': warning || color === 'warning',
|
|
46
|
-
'text-error': error || color === 'error',
|
|
47
|
-
'text-lg': lg || size === 'lg',
|
|
48
|
-
'text-md': md || size === 'md',
|
|
49
|
-
'text-sm': sm || size === 'sm',
|
|
50
|
-
'text-xs': xs || size === 'xs',
|
|
51
|
-
'opacity-50': disabled,
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
const values = computed(() => {
|
|
55
|
-
const vals = []
|
|
56
|
-
for (let index = Number.parseInt(props.min as string); index < Number.parseInt(props.max as string) + 1; index++) {
|
|
57
|
-
vals.push({
|
|
58
|
-
value: index,
|
|
59
|
-
isVisible: index % Number.parseInt(props.step as string) === 0,
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
return vals
|
|
63
|
-
})
|
|
64
|
-
// const count = computed(() => Number.parseInt(props.max as string) - Number.parseInt(props.min as string))
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<div class="flex justify-between select-none" :class="classes">
|
|
69
|
-
<RangeMeasureTick
|
|
70
|
-
v-for="tick in values"
|
|
71
|
-
:key="tick.value"
|
|
72
|
-
:tick="tick.value"
|
|
73
|
-
:model-value="modelValue"
|
|
74
|
-
:numbered="numbered"
|
|
75
|
-
:as-button="asButtons"
|
|
76
|
-
:is-hidden="!tick.isVisible"
|
|
77
|
-
:disabled="disabled"
|
|
78
|
-
@update:model-value="(val) => !disabled && $emit('update:modelValue', val)"
|
|
79
|
-
>
|
|
80
|
-
{{ numbered ? tick : '|' }}
|
|
81
|
-
</RangeMeasureTick>
|
|
82
|
-
</div>
|
|
83
|
-
</template>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, watch } from 'vue'
|
|
3
|
-
import { useTimeoutFn } from '@vueuse/core'
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
tick: number
|
|
7
|
-
modelValue?: number | string
|
|
8
|
-
numbered?: boolean
|
|
9
|
-
asButton?: boolean
|
|
10
|
-
isHidden?: boolean
|
|
11
|
-
disabled?: boolean
|
|
12
|
-
}>()
|
|
13
|
-
defineEmits(['update:modelValue'])
|
|
14
|
-
|
|
15
|
-
const hasChanged = ref(false)
|
|
16
|
-
const { isPending, start, stop } = useTimeoutFn(() => {
|
|
17
|
-
hasChanged.value = false
|
|
18
|
-
}, 1000)
|
|
19
|
-
watch(
|
|
20
|
-
() => props.modelValue,
|
|
21
|
-
(val) => {
|
|
22
|
-
if (val) {
|
|
23
|
-
start()
|
|
24
|
-
hasChanged.value = true
|
|
25
|
-
}
|
|
26
|
-
else if (!isPending.value) {
|
|
27
|
-
stop()
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line eqeqeq
|
|
33
|
-
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
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<template>
|
|
46
|
-
<Button
|
|
47
|
-
v-if="asButton && !isHidden"
|
|
48
|
-
xs
|
|
49
|
-
:ghost="!isCurrent"
|
|
50
|
-
circle
|
|
51
|
-
:class="classes"
|
|
52
|
-
:disabled="disabled"
|
|
53
|
-
@click="$emit('update:modelValue', tick)"
|
|
54
|
-
>
|
|
55
|
-
{{ numbered ? tick : '|' }}
|
|
56
|
-
</Button>
|
|
57
|
-
<Tooltip
|
|
58
|
-
v-else
|
|
59
|
-
:tip="tick"
|
|
60
|
-
:open="hasChanged && isCurrent && !disabled"
|
|
61
|
-
position="bottom"
|
|
62
|
-
:class="{
|
|
63
|
-
'px-[2px]': !asButton,
|
|
64
|
-
'opacity-50': disabled,
|
|
65
|
-
'cursor-pointer': !disabled,
|
|
66
|
-
'cursor-not-allowed': disabled,
|
|
67
|
-
}"
|
|
68
|
-
@click="$emit('update:modelValue', tick)"
|
|
69
|
-
>
|
|
70
|
-
<Text v-if="!isHidden" :black="isCurrent">
|
|
71
|
-
{{ numbered ? tick : '|' }}
|
|
72
|
-
</Text>
|
|
73
|
-
</Tooltip>
|
|
74
|
-
</template>
|
package/components/Rating.vue
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
modelValue?: number | string
|
|
6
|
-
count?: number | string
|
|
7
|
-
half?: boolean
|
|
8
|
-
|
|
9
|
-
disabled?: boolean
|
|
10
|
-
|
|
11
|
-
color?: string
|
|
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
|
-
|
|
21
|
-
bg?: string
|
|
22
|
-
|
|
23
|
-
shape?: string
|
|
24
|
-
squircle?: boolean
|
|
25
|
-
heart?: boolean
|
|
26
|
-
hexagon?: boolean
|
|
27
|
-
hexagon2?: boolean
|
|
28
|
-
decagon?: boolean
|
|
29
|
-
pentagon?: boolean
|
|
30
|
-
diamond?: boolean
|
|
31
|
-
square?: boolean
|
|
32
|
-
circle?: boolean
|
|
33
|
-
parallelogram?: boolean
|
|
34
|
-
parallelogram2?: boolean
|
|
35
|
-
parallelogram3?: boolean
|
|
36
|
-
parallelogram4?: boolean
|
|
37
|
-
star?: boolean
|
|
38
|
-
star2?: boolean
|
|
39
|
-
triangle?: boolean
|
|
40
|
-
triangle2?: boolean
|
|
41
|
-
triangle3?: boolean
|
|
42
|
-
triangle4?: boolean
|
|
43
|
-
|
|
44
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
45
|
-
lg?: boolean
|
|
46
|
-
md?: boolean
|
|
47
|
-
sm?: boolean
|
|
48
|
-
xs?: boolean
|
|
49
|
-
}>(), {
|
|
50
|
-
count: 5,
|
|
51
|
-
})
|
|
52
|
-
const emit = defineEmits(['update:modelValue'])
|
|
53
|
-
|
|
54
|
-
const shapes = [
|
|
55
|
-
'squircle',
|
|
56
|
-
'heart',
|
|
57
|
-
'hexagon',
|
|
58
|
-
'hexagon2',
|
|
59
|
-
'decagon',
|
|
60
|
-
'pentagon',
|
|
61
|
-
'diamond',
|
|
62
|
-
'square',
|
|
63
|
-
'circle',
|
|
64
|
-
'parallelogram',
|
|
65
|
-
'parallelogram2',
|
|
66
|
-
'parallelogram3',
|
|
67
|
-
'parallelogram4',
|
|
68
|
-
'star',
|
|
69
|
-
'star2',
|
|
70
|
-
'triangle',
|
|
71
|
-
'triangle2',
|
|
72
|
-
'triangle3',
|
|
73
|
-
'triangle4',
|
|
74
|
-
]
|
|
75
|
-
|
|
76
|
-
const ratingClasses = computed(() => {
|
|
77
|
-
return {
|
|
78
|
-
'rating-half': props.half,
|
|
79
|
-
'rating-lg': props.lg || props.size === 'lg',
|
|
80
|
-
'rating-md': props.md || props.size === 'md',
|
|
81
|
-
'rating-sm': props.sm || props.size === 'sm',
|
|
82
|
-
'rating-xs': props.xs || props.size === 'xs',
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
const maskClasses = computed(() => {
|
|
87
|
-
const hasShape = shapes.reduce((acc, current) => {
|
|
88
|
-
return acc || props.shape || (props as any)[current]
|
|
89
|
-
}, false)
|
|
90
|
-
const { color, shape, disabled } = props
|
|
91
|
-
return {
|
|
92
|
-
'bg-neutral': props.neutral || color === 'neutral',
|
|
93
|
-
'bg-primary': props.primary || color === 'primary',
|
|
94
|
-
'bg-secondary': props.secondary || color === 'secondary',
|
|
95
|
-
'bg-accent': props.accent || color === 'accent',
|
|
96
|
-
'bg-info': props.info || color === 'info',
|
|
97
|
-
'bg-success': props.success || color === 'success',
|
|
98
|
-
'bg-warning': props.warning || color === 'warning',
|
|
99
|
-
'bg-error': props.error || color === 'error',
|
|
100
|
-
|
|
101
|
-
'cursor-not-allowed': disabled,
|
|
102
|
-
'opacity-50': disabled,
|
|
103
|
-
|
|
104
|
-
'mask-squircle': props.squircle || shape === 'squircle',
|
|
105
|
-
'mask-heart': props.heart || shape === 'heart',
|
|
106
|
-
'mask-hexagon': props.hexagon || shape === 'hexagon',
|
|
107
|
-
'mask-hexagon-2': props.hexagon2 || shape === 'hexagon-2',
|
|
108
|
-
'mask-decagon': props.decagon || shape === 'decagon',
|
|
109
|
-
'mask-pentagon': props.pentagon || shape === 'pentagon',
|
|
110
|
-
'mask-diamond': props.diamond || shape === 'diamond',
|
|
111
|
-
'mask-square': props.square || shape === 'square',
|
|
112
|
-
'mask-circle': props.circle || shape === 'circle',
|
|
113
|
-
'mask-parallelogram': props.parallelogram || shape === 'parallelogram',
|
|
114
|
-
'mask-parallelogram-2': props.parallelogram2 || shape === 'parallelogram-2',
|
|
115
|
-
'mask-parallelogram-3': props.parallelogram3 || shape === 'parallelogram-3',
|
|
116
|
-
'mask-parallelogram-4': props.parallelogram4 || shape === 'parallelogram-4',
|
|
117
|
-
'mask-star': props.star || shape === 'star',
|
|
118
|
-
'mask-star-2': props.star2 || shape === 'star-2' || !hasShape,
|
|
119
|
-
'mask-triangle': props.triangle || shape === 'triangle',
|
|
120
|
-
'mask-triangle-2': props.triangle2 || shape === 'triangle-2',
|
|
121
|
-
'mask-triangle-3': props.triangle3 || shape === 'triangle-3',
|
|
122
|
-
'mask-triangle-4': props.triangle4 || shape === 'triangle-4',
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
const max = computed(() => Number.parseInt(props.count as string))
|
|
126
|
-
|
|
127
|
-
function handleValue(digit: number, half = false) {
|
|
128
|
-
if (props.disabled)
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
if (props.half)
|
|
132
|
-
return emit('update:modelValue', half ? digit - 0.5 : digit)
|
|
133
|
-
|
|
134
|
-
return emit('update:modelValue', digit)
|
|
135
|
-
}
|
|
136
|
-
</script>
|
|
137
|
-
|
|
138
|
-
<template>
|
|
139
|
-
<div class="rating" :class="ratingClasses">
|
|
140
|
-
<input
|
|
141
|
-
type="radio"
|
|
142
|
-
:value="0"
|
|
143
|
-
class="rating-hidden"
|
|
144
|
-
:checked="modelValue === 0"
|
|
145
|
-
@change="$emit('update:modelValue', 0)"
|
|
146
|
-
>
|
|
147
|
-
<template v-for="digit in max" :key="digit">
|
|
148
|
-
<input
|
|
149
|
-
type="radio"
|
|
150
|
-
:value="half ? digit - 0.5 : digit"
|
|
151
|
-
class="mask"
|
|
152
|
-
:class="[maskClasses, bg, { 'mask-half-1': half }]"
|
|
153
|
-
:checked="half ? modelValue === digit - 0.5 : modelValue === digit"
|
|
154
|
-
@change="() => handleValue(digit, true)"
|
|
155
|
-
>
|
|
156
|
-
<input
|
|
157
|
-
v-if="half"
|
|
158
|
-
type="radio"
|
|
159
|
-
:value="digit"
|
|
160
|
-
class="mask mask-half-2"
|
|
161
|
-
:class="[maskClasses, bg]"
|
|
162
|
-
:checked="modelValue === digit"
|
|
163
|
-
@change="() => handleValue(digit)"
|
|
164
|
-
>
|
|
165
|
-
</template>
|
|
166
|
-
</div>
|
|
167
|
-
</template>
|
package/components/Select.vue
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
type Color = | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
modelValue: any
|
|
8
|
-
options: Record<string, any>[] | any[]
|
|
9
|
-
value?: (val: any) => any
|
|
10
|
-
label?: (val: any) => any
|
|
11
|
-
resultAsObject?: boolean
|
|
12
|
-
join?: boolean
|
|
13
|
-
|
|
14
|
-
bordered?: boolean
|
|
15
|
-
ghost?: boolean
|
|
16
|
-
disabled?: boolean
|
|
17
|
-
|
|
18
|
-
color?: Color
|
|
19
|
-
primary?: boolean
|
|
20
|
-
secondary?: boolean
|
|
21
|
-
accent?: boolean
|
|
22
|
-
info?: boolean
|
|
23
|
-
success?: boolean
|
|
24
|
-
warning?: boolean
|
|
25
|
-
error?: boolean
|
|
26
|
-
|
|
27
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
28
|
-
lg?: boolean
|
|
29
|
-
md?: boolean
|
|
30
|
-
sm?: boolean
|
|
31
|
-
xs?: boolean
|
|
32
|
-
}>(), {
|
|
33
|
-
value: (val: any) => {
|
|
34
|
-
if (!val)
|
|
35
|
-
return null
|
|
36
|
-
|
|
37
|
-
return typeof val === 'string'
|
|
38
|
-
? (val as string)
|
|
39
|
-
: (val?.value || val?.id || val?._id || val)
|
|
40
|
-
},
|
|
41
|
-
label: (val: any) =>
|
|
42
|
-
typeof val === 'string'
|
|
43
|
-
? (val as string)
|
|
44
|
-
: (val.label || val.name || val.title),
|
|
45
|
-
resultAsObject: false,
|
|
46
|
-
})
|
|
47
|
-
const emit = defineEmits(['update:modelValue'])
|
|
48
|
-
|
|
49
|
-
const computedVModel = computed({
|
|
50
|
-
get: () => {
|
|
51
|
-
if (props.resultAsObject && props.modelValue != null)
|
|
52
|
-
return props.value(props.modelValue)
|
|
53
|
-
|
|
54
|
-
return props.modelValue
|
|
55
|
-
},
|
|
56
|
-
set: (val) => {
|
|
57
|
-
if (val === undefined)
|
|
58
|
-
val = null
|
|
59
|
-
if (props.resultAsObject && val != null)
|
|
60
|
-
val = props.options.find(o => props.value(o) === val)
|
|
61
|
-
|
|
62
|
-
emit('update:modelValue', val)
|
|
63
|
-
},
|
|
64
|
-
})
|
|
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
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<template>
|
|
90
|
-
<select v-model="computedVModel" class="select" :class="classes" :disabled="disabled">
|
|
91
|
-
<option
|
|
92
|
-
v-for="option in options"
|
|
93
|
-
:key="value(option)"
|
|
94
|
-
:value="value(option)"
|
|
95
|
-
:disabled="option.disabled"
|
|
96
|
-
>
|
|
97
|
-
{{ label(option) }}
|
|
98
|
-
</option>
|
|
99
|
-
</select>
|
|
100
|
-
</template>
|
package/components/Stack.vue
DELETED
package/components/Stat.vue
DELETED
package/components/StatDesc.vue
DELETED