@dolanske/vui 0.3.4 → 0.5.0
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/LICENSE +673 -673
- package/README.md +41 -40
- package/dist/components/Dropdown/DropdownItem.vue.d.ts +1 -0
- package/dist/components/Flex/Flex.vue.d.ts +3 -1
- package/dist/components/Grid/Grid.vue.d.ts +3 -1
- package/dist/components/Tabs/Tabs.vue.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/vui.js +1547 -1534
- package/package.json +68 -68
- package/src/App.vue +176 -175
- package/src/components/Accordion/Accordion.vue +91 -91
- package/src/components/Accordion/AccordionGroup.vue +43 -43
- package/src/components/Accordion/accordion.scss +81 -80
- package/src/components/Alert/Alert.vue +53 -53
- package/src/components/Alert/alert.scss +80 -80
- package/src/components/Avatar/Avatar.vue +50 -50
- package/src/components/Avatar/avatar.scss +52 -52
- package/src/components/Badge/Badge.vue +21 -21
- package/src/components/Badge/badge.scss +89 -89
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -26
- package/src/components/Breadcrumbs/Breadcrumbs.vue +33 -33
- package/src/components/Breadcrumbs/breadcrumbs.scss +30 -30
- package/src/components/Button/Button.vue +90 -90
- package/src/components/Button/button.scss +178 -176
- package/src/components/ButtonGroup/ButtonGroup.vue +25 -25
- package/src/components/ButtonGroup/button-group.scss +51 -51
- package/src/components/Calendar/Calendar.vue +63 -60
- package/src/components/Calendar/calendar.scss +60 -56
- package/src/components/Card/Card.vue +48 -48
- package/src/components/Card/card.scss +53 -53
- package/src/components/Checkbox/Checkbox.vue +51 -52
- package/src/components/Checkbox/checkbox.scss +75 -66
- package/src/components/CopyClipboard/CopyClipboard.vue +82 -82
- package/src/components/CopyClipboard/copy-clipboard.scss +17 -17
- package/src/components/Divider/Divider.vue +44 -44
- package/src/components/Divider/divider.scss +35 -35
- package/src/components/Drawer/Drawer.vue +97 -97
- package/src/components/Drawer/drawer.scss +36 -36
- package/src/components/Dropdown/Dropdown.vue +111 -111
- package/src/components/Dropdown/DropdownItem.vue +33 -29
- package/src/components/Dropdown/DropdownTitle.vue +8 -8
- package/src/components/Dropdown/dropdown-item.scss +77 -0
- package/src/components/Dropdown/dropdown.scss +39 -117
- package/src/components/Flex/Flex.vue +113 -106
- package/src/components/Grid/Grid.vue +60 -54
- package/src/components/Input/Counter.vue +70 -70
- package/src/components/Input/Dropzone.vue +65 -65
- package/src/components/Input/File.vue +15 -15
- package/src/components/Input/Input.vue +121 -121
- package/src/components/Input/Password.vue +47 -47
- package/src/components/Input/Textarea.vue +76 -76
- package/src/components/Input/input.scss +208 -208
- package/src/components/Kbd/Kbd.vue +48 -48
- package/src/components/Kbd/KbdGroup.vue +31 -31
- package/src/components/Kbd/kbd.scss +18 -18
- package/src/components/Modal/Confirm.vue +56 -56
- package/src/components/Modal/Modal.vue +91 -91
- package/src/components/Modal/modal.scss +49 -49
- package/src/components/OTP/OTP.vue +133 -133
- package/src/components/OTP/OTPItem.vue +37 -37
- package/src/components/OTP/otp.scss +83 -83
- package/src/components/Pagination/Pagination.vue +74 -74
- package/src/components/Pagination/pagination.ts +78 -78
- package/src/components/Popout/Popout.vue +42 -42
- package/src/components/Popout/popout.scss +8 -8
- package/src/components/Progress/Progress.vue +90 -90
- package/src/components/Progress/progress.scss +41 -41
- package/src/components/Radio/Radio.vue +36 -36
- package/src/components/Radio/RadioGroup.vue +40 -40
- package/src/components/Radio/radio.scss +68 -59
- package/src/components/Select/Select.vue +180 -180
- package/src/components/Select/select.scss +44 -44
- package/src/components/Sheet/Sheet.vue +92 -92
- package/src/components/Sheet/sheet.scss +60 -60
- package/src/components/Sidebar/Sidebar.vue +102 -0
- package/src/components/Sidebar/sidebar.scss +123 -0
- package/src/components/Skeleton/Skeleton.vue +43 -43
- package/src/components/Skeleton/skeleton.scss +14 -14
- package/src/components/Spinner/Spinner.vue +42 -42
- package/src/components/Spinner/spinner.scss +46 -46
- package/src/components/Switch/Switch.vue +30 -30
- package/src/components/Switch/switch.scss +60 -52
- package/src/components/Table/Cell.vue +23 -23
- package/src/components/Table/Header.vue +59 -59
- package/src/components/Table/Row.vue +9 -9
- package/src/components/Table/SelectAll.vue +23 -23
- package/src/components/Table/SelectRow.vue +29 -29
- package/src/components/Table/Table.vue +66 -66
- package/src/components/Table/table.scss +134 -134
- package/src/components/Table/table.ts +244 -244
- package/src/components/Tabs/Tab.vue +27 -27
- package/src/components/Tabs/Tabs.vue +89 -82
- package/src/components/Tabs/tabs.scss +80 -79
- package/src/components/Toast/Toasts.vue +47 -47
- package/src/components/Toast/toast.scss +41 -41
- package/src/components/Toast/toast.ts +68 -68
- package/src/components/Tooltip/Tooltip.vue +86 -86
- package/src/components/Tooltip/tooltip.scss +4 -4
- package/src/index.scss +1 -1
- package/src/index.ts +119 -119
- package/src/internal/Backdrop/Backdrop.vue +22 -22
- package/src/internal/Backdrop/backdrop.scss +28 -28
- package/src/main.ts +5 -5
- package/src/shared/helpers.ts +74 -74
- package/src/shared/types.ts +29 -29
- package/src/style/animation.scss +21 -21
- package/src/style/core.scss +150 -148
- package/src/style/layout.scss +168 -136
- package/src/style/media-query.scss +29 -29
- package/src/style/reset.scss +135 -135
- package/src/style/{fonts.scss → text.scss} +74 -53
- package/src/style/tooltip.scss +128 -128
- package/src/style/typography.scss +338 -338
- package/src/style/utils.scss +36 -36
|
@@ -1,117 +1,39 @@
|
|
|
1
|
-
.vui-dropdown-trigger-wrap {
|
|
2
|
-
// display: inline-block;
|
|
3
|
-
width: fit-content;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.vui-dropdown {
|
|
7
|
-
min-width: 156px;
|
|
8
|
-
border-radius: var(--border-radius-m);
|
|
9
|
-
border: 1px solid var(--color-border);
|
|
10
|
-
padding: 4px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.vui-dropdown-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
border-
|
|
22
|
-
font-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
.vui-dropdown-item-slot,
|
|
41
|
-
.vui-dropdown-item-icon svg path {
|
|
42
|
-
color: var(--color-text-lighter);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.vui-dropdown-item-hint {
|
|
46
|
-
visibility: hidden;
|
|
47
|
-
opacity: 0;
|
|
48
|
-
z-index: -1;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.vui-dropdown-item-icon {
|
|
53
|
-
width: 16px;
|
|
54
|
-
height: 16px;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
|
|
59
|
-
svg {
|
|
60
|
-
width: 16px;
|
|
61
|
-
height: 16px;
|
|
62
|
-
|
|
63
|
-
path {
|
|
64
|
-
color: var(--color-text-light);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.vui-dropdown-item-hint {
|
|
70
|
-
margin-left: 8px;
|
|
71
|
-
font-size: 0.9rem;
|
|
72
|
-
// white-space: nowrap;
|
|
73
|
-
color: var(--color-text-lighter);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.vui-dropdown-item-slot {
|
|
77
|
-
flex: 1;
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
justify-content: flex-start;
|
|
81
|
-
color: var(--color-text);
|
|
82
|
-
flex-wrap: nowrap;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&.selected,
|
|
86
|
-
&:hover {
|
|
87
|
-
background-color: var(--color-button-gray-hover);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.vui-dropdown-title {
|
|
92
|
-
position: relative;
|
|
93
|
-
display: flex;
|
|
94
|
-
align-items: center;
|
|
95
|
-
justify-content: flex-start;
|
|
96
|
-
padding-block: var(--space-s);
|
|
97
|
-
padding-inline: calc(var(--space-s) + 4px);
|
|
98
|
-
font-size: var(--font-size-ms);
|
|
99
|
-
border-bottom: 1px solid var(--color-border);
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
// margin-block: 4px;
|
|
102
|
-
margin-inline: -4px;
|
|
103
|
-
margin-top: -4px;
|
|
104
|
-
margin-bottom: 4px;
|
|
105
|
-
gap: var(--space-m);
|
|
106
|
-
justify-content: space-between;
|
|
107
|
-
|
|
108
|
-
&:not(:first-child) {
|
|
109
|
-
border-top: 1px solid var(--color-border);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.vui-dropdown-title-end {
|
|
113
|
-
font-size: var(--font-size-s);
|
|
114
|
-
font-weight: 400;
|
|
115
|
-
color: var(--color-text-lighter);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
1
|
+
.vui-dropdown-trigger-wrap {
|
|
2
|
+
// display: inline-block;
|
|
3
|
+
width: fit-content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.vui-dropdown {
|
|
7
|
+
min-width: 156px;
|
|
8
|
+
border-radius: var(--border-radius-m);
|
|
9
|
+
border: 1px solid var(--color-border);
|
|
10
|
+
padding: 4px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vui-dropdown-title {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
padding-block: var(--space-s);
|
|
19
|
+
padding-inline: calc(var(--space-s) + 4px);
|
|
20
|
+
font-size: var(--font-size-ms);
|
|
21
|
+
border-bottom: 1px solid var(--color-border);
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
// margin-block: 4px;
|
|
24
|
+
margin-inline: -4px;
|
|
25
|
+
margin-top: -4px;
|
|
26
|
+
margin-bottom: 4px;
|
|
27
|
+
gap: var(--space-m);
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
|
|
30
|
+
&:not(:first-child) {
|
|
31
|
+
border-top: 1px solid var(--color-border);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.vui-dropdown-title-end {
|
|
35
|
+
font-size: var(--font-size-s);
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
color: var(--color-text-lighter);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,106 +1,113 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Space } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (props.
|
|
55
|
-
return '
|
|
56
|
-
else
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (props.
|
|
72
|
-
return '
|
|
73
|
-
else
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Space } from '../../shared/types'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
+
|
|
6
|
+
export interface FlexProps {
|
|
7
|
+
inline?: boolean
|
|
8
|
+
wrap?: boolean
|
|
9
|
+
wrapReverse?: boolean
|
|
10
|
+
|
|
11
|
+
row?: boolean
|
|
12
|
+
column?: boolean
|
|
13
|
+
rowReverse?: boolean
|
|
14
|
+
columnReverse?: boolean
|
|
15
|
+
|
|
16
|
+
gap?: Space | number
|
|
17
|
+
|
|
18
|
+
// NOTE: Add more if needed
|
|
19
|
+
justifyStart?: boolean
|
|
20
|
+
justifyEnd?: boolean
|
|
21
|
+
justifyCenter?: boolean
|
|
22
|
+
spaceBetween?: boolean
|
|
23
|
+
spaceAround?: boolean
|
|
24
|
+
spaceEvenly?: boolean
|
|
25
|
+
|
|
26
|
+
// NOTE: Add more if needed
|
|
27
|
+
alignCenter?: boolean
|
|
28
|
+
alignStart?: boolean
|
|
29
|
+
alignEnd?: boolean
|
|
30
|
+
alignBaseline?: boolean
|
|
31
|
+
|
|
32
|
+
expand?: boolean
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const props = withDefaults(defineProps<FlexProps>(), {
|
|
36
|
+
// eslint-disable-next-line vue/require-valid-default-prop
|
|
37
|
+
gap: 's',
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Flex gap
|
|
41
|
+
const ag = computed(() => typeof props.gap === 'number'
|
|
42
|
+
? formatUnitValue(props.gap)
|
|
43
|
+
: `var(--space-${props.gap})`,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
// Flex direction
|
|
47
|
+
const ad = computed(() => {
|
|
48
|
+
if (props.row)
|
|
49
|
+
return 'row'
|
|
50
|
+
else if (props.column)
|
|
51
|
+
return 'column'
|
|
52
|
+
else if (props.rowReverse)
|
|
53
|
+
return 'row-reverse'
|
|
54
|
+
else if (props.columnReverse)
|
|
55
|
+
return 'column-reverse'
|
|
56
|
+
else return 'row'
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// Justify content
|
|
60
|
+
const aj = computed(() => {
|
|
61
|
+
if (props.justifyStart)
|
|
62
|
+
return 'flex-start'
|
|
63
|
+
else if (props.justifyEnd)
|
|
64
|
+
return 'flex-end'
|
|
65
|
+
else if (props.justifyCenter)
|
|
66
|
+
return 'center'
|
|
67
|
+
else if (props.spaceBetween)
|
|
68
|
+
return 'space-between'
|
|
69
|
+
else if (props.spaceEvenly)
|
|
70
|
+
return 'space-evenly'
|
|
71
|
+
else if (props.spaceAround)
|
|
72
|
+
return 'space-around'
|
|
73
|
+
else return 'flex-start'
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Align items
|
|
77
|
+
const aA = computed(() => {
|
|
78
|
+
if (props.alignStart)
|
|
79
|
+
return 'flex-start'
|
|
80
|
+
else if (props.alignEnd)
|
|
81
|
+
return 'flex-end'
|
|
82
|
+
else if (props.alignCenter)
|
|
83
|
+
return 'center'
|
|
84
|
+
else if (props.alignBaseline)
|
|
85
|
+
return 'baseline'
|
|
86
|
+
return 'flex-start'
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const aY = computed(() => props.inline ? 'inline-flex' : 'flex')
|
|
90
|
+
const aW = computed(() => props.wrap
|
|
91
|
+
? 'wrap'
|
|
92
|
+
: props.wrapReverse
|
|
93
|
+
? 'wrap-reverse'
|
|
94
|
+
: 'nowrap')
|
|
95
|
+
|
|
96
|
+
const aH = computed(() => props.expand ? '100%' : 'auto')
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<div
|
|
101
|
+
class="vui-flex" :style="{
|
|
102
|
+
display: aY,
|
|
103
|
+
flexWrap: aW,
|
|
104
|
+
flexDirection: ad,
|
|
105
|
+
justifyContent: aj,
|
|
106
|
+
gap: ag,
|
|
107
|
+
alignItems: aA,
|
|
108
|
+
width: aH,
|
|
109
|
+
}"
|
|
110
|
+
>
|
|
111
|
+
<slot />
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
@@ -1,54 +1,60 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Space } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { createArray } from '../../shared/helpers'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This component is not meant for complex grids
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
inline?: boolean
|
|
12
|
-
gap?: Space | number
|
|
13
|
-
rows?: number | string
|
|
14
|
-
columns?: number | string
|
|
15
|
-
areas?: string[]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const props = defineProps<Props>()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Space } from '../../shared/types'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { createArray, formatUnitValue } from '../../shared/helpers'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This component is not meant for complex grids
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
inline?: boolean
|
|
12
|
+
gap?: Space | number
|
|
13
|
+
rows?: number | string
|
|
14
|
+
columns?: number | string
|
|
15
|
+
areas?: string[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
// eslint-disable-next-line vue/require-valid-default-prop
|
|
20
|
+
gap: 's',
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const ag = computed(() => typeof props.gap === 'number'
|
|
24
|
+
? formatUnitValue(props.gap)
|
|
25
|
+
: `var(--space-${props.gap})`,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
const aTC = computed(() => {
|
|
29
|
+
if (typeof props.columns === 'number') {
|
|
30
|
+
return createArray(props.columns)
|
|
31
|
+
.map(() => '1fr')
|
|
32
|
+
.join(' ')
|
|
33
|
+
}
|
|
34
|
+
return props.columns ?? 'none'
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const aTR = computed(() => {
|
|
38
|
+
if (typeof props.rows === 'number') {
|
|
39
|
+
return createArray(props.rows || 1)
|
|
40
|
+
.map(() => '')
|
|
41
|
+
.join('1fr')
|
|
42
|
+
}
|
|
43
|
+
return props.rows ?? 'none'
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<div
|
|
51
|
+
class="vui-grid" :style="{
|
|
52
|
+
display: aD,
|
|
53
|
+
gap: ag,
|
|
54
|
+
gridTemplateColumns: aTC,
|
|
55
|
+
gridTemplateRows: aTR,
|
|
56
|
+
}"
|
|
57
|
+
>
|
|
58
|
+
<slot />
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import type { InputProps } from './Input.vue'
|
|
3
|
-
import { Icon } from '@iconify/vue'
|
|
4
|
-
import Button from '../Button/Button.vue'
|
|
5
|
-
import Input from './Input.vue'
|
|
6
|
-
|
|
7
|
-
type Props = Omit<InputProps, 'type'> & {
|
|
8
|
-
incrementBy?: number
|
|
9
|
-
incrementEnabled?: boolean
|
|
10
|
-
hideIncrement?: boolean
|
|
11
|
-
decrementBy?: number
|
|
12
|
-
decrementEnabled?: boolean
|
|
13
|
-
hideDecrement?: boolean
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
incrementBy = 1,
|
|
18
|
-
incrementEnabled = true,
|
|
19
|
-
hideIncrement = false,
|
|
20
|
-
decrementBy = 1,
|
|
21
|
-
decrementEnabled = true,
|
|
22
|
-
hideDecrement = false,
|
|
23
|
-
...inputProps
|
|
24
|
-
} = defineProps<Props>()
|
|
25
|
-
|
|
26
|
-
const count = defineModel<number>({
|
|
27
|
-
default: 0,
|
|
28
|
-
})
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<Input v-bind="inputProps" v-model.number="count" type="number">
|
|
33
|
-
<template v-if="!hideDecrement" #start>
|
|
34
|
-
<Button key="decrease" :disabled="!decrementEnabled" size="s" @click="count -= decrementBy">
|
|
35
|
-
<Icon icon="ph:minus" /> {{ decrementBy > 1 ? decrementBy : '' }}
|
|
36
|
-
</Button>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<template v-if="!hideIncrement" #end>
|
|
40
|
-
<Button key="increase" :disabled="!incrementEnabled" size="s" @click="count += incrementBy">
|
|
41
|
-
<Icon icon="ph:plus" /> {{ incrementBy > 1 ? incrementBy : '' }}
|
|
42
|
-
</Button>
|
|
43
|
-
</template>
|
|
44
|
-
</Input>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<style scoped lang="scss">
|
|
48
|
-
:deep(.vui-input-style) {
|
|
49
|
-
padding-inline: 4px !important;
|
|
50
|
-
gap: 8px !important;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:deep(.vui-button) {
|
|
54
|
-
padding-inline: 2px !important;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
:deep(input) {
|
|
58
|
-
text-align: center;
|
|
59
|
-
|
|
60
|
-
::-webkit-outer-spin-button,
|
|
61
|
-
::-webkit-inner-spin-button {
|
|
62
|
-
-webkit-appearance: none;
|
|
63
|
-
margin: 0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* Firefox */
|
|
67
|
-
-moz-appearance: textfield;
|
|
68
|
-
appearance: textfield;
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { InputProps } from './Input.vue'
|
|
3
|
+
import { Icon } from '@iconify/vue'
|
|
4
|
+
import Button from '../Button/Button.vue'
|
|
5
|
+
import Input from './Input.vue'
|
|
6
|
+
|
|
7
|
+
type Props = Omit<InputProps, 'type'> & {
|
|
8
|
+
incrementBy?: number
|
|
9
|
+
incrementEnabled?: boolean
|
|
10
|
+
hideIncrement?: boolean
|
|
11
|
+
decrementBy?: number
|
|
12
|
+
decrementEnabled?: boolean
|
|
13
|
+
hideDecrement?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
incrementBy = 1,
|
|
18
|
+
incrementEnabled = true,
|
|
19
|
+
hideIncrement = false,
|
|
20
|
+
decrementBy = 1,
|
|
21
|
+
decrementEnabled = true,
|
|
22
|
+
hideDecrement = false,
|
|
23
|
+
...inputProps
|
|
24
|
+
} = defineProps<Props>()
|
|
25
|
+
|
|
26
|
+
const count = defineModel<number>({
|
|
27
|
+
default: 0,
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<Input v-bind="inputProps" v-model.number="count" type="number">
|
|
33
|
+
<template v-if="!hideDecrement" #start>
|
|
34
|
+
<Button key="decrease" :disabled="!decrementEnabled" size="s" @click="count -= decrementBy">
|
|
35
|
+
<Icon icon="ph:minus" /> {{ decrementBy > 1 ? decrementBy : '' }}
|
|
36
|
+
</Button>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<template v-if="!hideIncrement" #end>
|
|
40
|
+
<Button key="increase" :disabled="!incrementEnabled" size="s" @click="count += incrementBy">
|
|
41
|
+
<Icon icon="ph:plus" /> {{ incrementBy > 1 ? incrementBy : '' }}
|
|
42
|
+
</Button>
|
|
43
|
+
</template>
|
|
44
|
+
</Input>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style scoped lang="scss">
|
|
48
|
+
:deep(.vui-input-style) {
|
|
49
|
+
padding-inline: 4px !important;
|
|
50
|
+
gap: 8px !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:deep(.vui-button) {
|
|
54
|
+
padding-inline: 2px !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:deep(input) {
|
|
58
|
+
text-align: center;
|
|
59
|
+
|
|
60
|
+
::-webkit-outer-spin-button,
|
|
61
|
+
::-webkit-inner-spin-button {
|
|
62
|
+
-webkit-appearance: none;
|
|
63
|
+
margin: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Firefox */
|
|
67
|
+
-moz-appearance: textfield;
|
|
68
|
+
appearance: textfield;
|
|
69
|
+
}
|
|
70
|
+
</style>
|