vueless 0.0.216 → 0.0.218
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/package.json +2 -2
- package/ui.button/configs/default.config.js +19 -19
- package/ui.button-link/configs/default.config.js +6 -13
- package/ui.button-link/index.vue +1 -1
- package/ui.button-toggle/index.vue +1 -1
- package/ui.container-page/configs/default.config.js +1 -1
- package/ui.dropdown-button/index.vue +6 -3
- package/ui.dropdown-item/configs/default.config.js +3 -3
- package/ui.dropdown-link/index.vue +1 -1
- package/ui.dropdown-list/configs/default.config.js +10 -10
- package/ui.dropdown-list/index.vue +1 -1
- package/ui.form-calendar/components/MonthView.vue +13 -5
- package/ui.form-calendar/components/YearView.vue +13 -5
- package/ui.form-calendar/configs/default.config.js +2 -0
- package/ui.form-calendar/index.vue +1 -1
- package/ui.form-calendar/services/date.service.js +8 -0
- package/ui.form-checkbox/configs/default.config.js +8 -12
- package/ui.form-checkbox/index.vue +5 -7
- package/ui.form-checkbox-group/configs/default.config.js +10 -1
- package/ui.form-checkbox-group/index.stories.js +21 -28
- package/ui.form-checkbox-group/index.vue +3 -3
- package/ui.form-date-picker-range/configs/default.config.js +1 -1
- package/ui.form-date-picker-range/index.vue +28 -21
- package/ui.form-input/composables/attrs.composable.js +10 -10
- package/ui.form-input/configs/default.config.js +20 -15
- package/ui.form-input/index.vue +2 -1
- package/ui.form-input-file/configs/default.config.js +9 -18
- package/ui.form-input-file/index.vue +1 -1
- package/ui.form-input-money/index.vue +1 -1
- package/ui.form-input-rating/index.vue +1 -1
- package/ui.form-input-search/index.vue +1 -1
- package/ui.form-label/configs/default.config.js +40 -48
- package/ui.form-label/index.vue +10 -2
- package/ui.form-radio/configs/default.config.js +5 -10
- package/ui.form-radio/index.vue +3 -3
- package/ui.form-radio-group/configs/default.config.js +3 -4
- package/ui.form-radio-group/index.stories.js +7 -15
- package/ui.form-radio-group/index.vue +1 -1
- package/ui.form-select/configs/default.config.js +15 -21
- package/ui.form-select/index.vue +2 -2
- package/ui.form-switch/configs/default.config.js +14 -14
- package/ui.form-switch/index.vue +1 -1
- package/ui.form-textarea/configs/default.config.js +11 -16
- package/ui.form-textarea/index.vue +1 -1
- package/ui.image-icon/configs/default.config.js +11 -11
- package/ui.text-badge/configs/default.config.js +4 -4
- package/ui.text-block/configs/default.config.js +3 -4
- package/ui.text-block/index.vue +1 -1
- package/ui.text-empty/configs/default.config.js +12 -12
- package/ui.text-empty/index.vue +16 -9
- package/ui.text-file/configs/default.config.js +13 -4
- package/ui.text-file/index.vue +12 -2
- package/ui.text-files/configs/default.config.js +3 -10
- package/ui.text-files/index.vue +1 -1
- package/ui.text-money/configs/default.config.js +7 -8
- package/ui.text-money/index.stories.js +2 -9
- package/web-types.json +39 -30
|
@@ -82,21 +82,22 @@
|
|
|
82
82
|
<UButton
|
|
83
83
|
v-for="periodButton in periods"
|
|
84
84
|
:key="periodButton.name"
|
|
85
|
+
:label="periodButton.title"
|
|
85
86
|
variant="thirdary"
|
|
86
87
|
size="xs"
|
|
87
88
|
square
|
|
89
|
+
filled
|
|
88
90
|
color="brand"
|
|
89
91
|
v-bind="periodButtonAttrs(getPeriodButtonsClasses(periodButton.name))"
|
|
90
92
|
@click="onClickPeriodButton(periodButton.name)"
|
|
91
|
-
|
|
92
|
-
{{ periodButton.title }}
|
|
93
|
-
</UButton>
|
|
93
|
+
/>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
96
|
<div v-bind="periodsRowAttrs">
|
|
97
97
|
<UButton
|
|
98
98
|
v-if="customRangeButton.range.to && customRangeButton.range.from"
|
|
99
99
|
variant="thirdary"
|
|
100
|
+
filled
|
|
100
101
|
color="brand"
|
|
101
102
|
v-bind="periodButtonAttrs(getPeriodButtonsClasses(PERIOD.custom))"
|
|
102
103
|
@click="onClickCustomRangeButton"
|
|
@@ -107,6 +108,8 @@
|
|
|
107
108
|
|
|
108
109
|
<UButton
|
|
109
110
|
variant="thirdary"
|
|
111
|
+
size="xs"
|
|
112
|
+
filled
|
|
110
113
|
color="brand"
|
|
111
114
|
v-bind="periodButtonAttrs(getPeriodButtonsClasses(PERIOD.ownRange))"
|
|
112
115
|
@click="onClickOwnRange"
|
|
@@ -123,29 +126,33 @@
|
|
|
123
126
|
|
|
124
127
|
<template v-if="!isPeriod.ownRange && !isPeriod.custom">
|
|
125
128
|
<div v-bind="rangeSwitchWrapperAttrs">
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
<UButton size="sm" color="brand" variant="thirdary" square>
|
|
130
|
+
<UIcon
|
|
131
|
+
internal
|
|
132
|
+
interactive
|
|
133
|
+
size="sm"
|
|
134
|
+
color="gray"
|
|
135
|
+
:name="config.prevIconName"
|
|
136
|
+
v-bind="prevIconAttrs"
|
|
137
|
+
@click="onClickShiftDatesList('prev')"
|
|
138
|
+
/>
|
|
139
|
+
</UButton>
|
|
135
140
|
|
|
136
141
|
<div v-bind="rangeSwitchTitleAttrs">
|
|
137
142
|
{{ rangeSwitchTitle }}
|
|
138
143
|
</div>
|
|
139
144
|
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
<UButton size="sm" color="brand" variant="thirdary" square>
|
|
146
|
+
<UIcon
|
|
147
|
+
internal
|
|
148
|
+
interactive
|
|
149
|
+
size="sm"
|
|
150
|
+
color="gray"
|
|
151
|
+
:name="config.nextIconName"
|
|
152
|
+
v-bind="nextIconAttrs"
|
|
153
|
+
@click="onClickShiftDatesList('next')"
|
|
154
|
+
/>
|
|
155
|
+
</UButton>
|
|
149
156
|
</div>
|
|
150
157
|
|
|
151
158
|
<div v-bind="periodDateListAttrs(getPeriodDateListClasses())">
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import useUI from "../../composable.ui";
|
|
3
|
-
import { cva
|
|
3
|
+
import { cva } from "../../service.ui";
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
5
|
|
|
6
|
-
export default function useAttrs(props
|
|
6
|
+
export default function useAttrs(props) {
|
|
7
7
|
const { config, getAttrs, hasSlotContent, isSystemKey } = useUI(
|
|
8
8
|
defaultConfig,
|
|
9
9
|
() => props.config,
|
|
@@ -29,14 +29,14 @@ export default function useAttrs(props, { inputPasswordClasses }) {
|
|
|
29
29
|
|
|
30
30
|
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
31
31
|
|
|
32
|
-
if (key === "input") {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
32
|
+
// if (key === "input") {
|
|
33
|
+
// const inputAttrs = attrs[`${key}Attrs`];
|
|
34
|
+
//
|
|
35
|
+
// attrs[`${key}Attrs`] = computed(() => ({
|
|
36
|
+
// ...inputAttrs.value,
|
|
37
|
+
// class: cx([inputAttrs.value.class]),
|
|
38
|
+
// }));
|
|
39
|
+
// }
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
label: "{ULabel}
|
|
2
|
+
label: "{ULabel}",
|
|
3
3
|
inputWrapper: "flex relative w-full",
|
|
4
4
|
rightIconSlot: "flex items-center justify-end whitespace-nowrap pr-3 rounded-r-lg rounded-l-none",
|
|
5
5
|
leftIconSlot: "flex items-center justify-end whitespace-nowrap pl-3 rounded-l-lg rounded-r-none",
|
|
@@ -8,7 +8,8 @@ export default /*tw*/ {
|
|
|
8
8
|
passwordHiddenIconName: "visibility_off-fill",
|
|
9
9
|
block: {
|
|
10
10
|
base: `
|
|
11
|
-
|
|
11
|
+
w-full bg-white !opacity-100 relative flex transition
|
|
12
|
+
rounded-md border border-solid border-gray-300
|
|
12
13
|
hover:border-gray-400 hover:focus-within:border-brand-500
|
|
13
14
|
focus-within:border-brand-500 focus-within:ring-4 focus-within:ring-brand-600/[.15]
|
|
14
15
|
`,
|
|
@@ -21,46 +22,50 @@ export default /*tw*/ {
|
|
|
21
22
|
},
|
|
22
23
|
error: {
|
|
23
24
|
true: `
|
|
24
|
-
border-red-300
|
|
25
|
+
hover:bg-red-300 border-red-300
|
|
25
26
|
hover:border-red-400 hover:focus-within:border-red-500
|
|
26
27
|
focus-within:border-red-500 focus-within:ring-red-100
|
|
27
28
|
`,
|
|
28
29
|
},
|
|
29
30
|
},
|
|
31
|
+
compoundVariants: [{ labelAlign: "topInside", label: true, class: "rounded-lg" }],
|
|
30
32
|
},
|
|
31
33
|
input: {
|
|
32
34
|
base: `
|
|
33
|
-
block w-full
|
|
34
|
-
|
|
35
|
+
block w-full py-2 px-3 font-normal leading-none text-gray-900
|
|
36
|
+
placeholder:font-normal placeholder-gray-400
|
|
37
|
+
transition bg-white border-none border-gray-300 rounded-md shadow-none
|
|
35
38
|
focus:outline-none focus:ring-0 disabled:opacity-50
|
|
36
39
|
disabled:cursor-not-allowed disabled:text-gray-900 disabled:border-gray-100
|
|
37
40
|
read-only:border-gray-300 read-only:ring-0
|
|
38
41
|
`,
|
|
39
42
|
variants: {
|
|
40
43
|
size: {
|
|
41
|
-
sm: "
|
|
42
|
-
md: "
|
|
43
|
-
lg: "
|
|
44
|
+
sm: "text-xs placeholder:text-xs placeholder:font-normal",
|
|
45
|
+
md: "text-sm placeholder:text-sm placeholder:font-normal",
|
|
46
|
+
lg: "text-base placeholder:text-base placeholder:font-normal",
|
|
44
47
|
},
|
|
45
|
-
error:
|
|
46
|
-
|
|
48
|
+
error: {
|
|
49
|
+
true: `
|
|
50
|
+
bg-red-50 border-red-900 hover:border-red-400 focus:border-red-500 focus:ring-red-100
|
|
47
51
|
focus-within:border-red-500 focus-within:ring-red-100
|
|
48
52
|
`,
|
|
53
|
+
},
|
|
49
54
|
},
|
|
50
55
|
compoundVariants: [
|
|
51
|
-
{ labelAlign: "topInside", label: true,
|
|
52
|
-
{ labelAlign: "topInside", label: true, size: "
|
|
53
|
-
{ labelAlign: "topInside", label: true, size: "
|
|
56
|
+
{ labelAlign: "topInside", label: true, class: "rounded-lg" },
|
|
57
|
+
{ labelAlign: "topInside", label: true, size: "sm", class: "pt-5" },
|
|
58
|
+
{ labelAlign: "topInside", label: true, size: "md", class: "pt-6" },
|
|
59
|
+
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-7" },
|
|
54
60
|
],
|
|
55
61
|
},
|
|
56
62
|
defaultVariants: {
|
|
57
63
|
size: "md",
|
|
58
64
|
type: "text",
|
|
59
65
|
inputmode: "text",
|
|
60
|
-
|
|
66
|
+
labelAlign: "topInside",
|
|
61
67
|
readonly: false,
|
|
62
68
|
disabled: false,
|
|
63
|
-
labelAlign: "topInside",
|
|
64
69
|
noAutocomplete: false,
|
|
65
70
|
},
|
|
66
71
|
};
|
package/ui.form-input/index.vue
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:error="error"
|
|
9
9
|
:size="size"
|
|
10
10
|
:align="labelAlign"
|
|
11
|
+
centred
|
|
11
12
|
v-bind="labelAttrs"
|
|
12
13
|
>
|
|
13
14
|
<label :for="id" v-bind="blockAttrs">
|
|
@@ -168,7 +169,7 @@ const props = defineProps({
|
|
|
168
169
|
|
|
169
170
|
/**
|
|
170
171
|
* Set label placement related from the default slot.
|
|
171
|
-
* @values top, topInside, topWithDesc,
|
|
172
|
+
* @values top, topInside, topWithDesc, left, right
|
|
172
173
|
*/
|
|
173
174
|
labelAlign: {
|
|
174
175
|
type: String,
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
label: {
|
|
3
|
-
wrapper: "{ULabel} relative w-full",
|
|
4
|
-
label: {
|
|
5
|
-
compoundVariants: [
|
|
6
|
-
{ align: "topInside", size: "sm", class: "left-5 top-4" },
|
|
7
|
-
{ align: "topInside", size: "md", class: "left-5 top-5" },
|
|
8
|
-
{ align: "topInside", size: "lg", class: "left-5 top-6" },
|
|
9
|
-
],
|
|
10
|
-
},
|
|
11
|
-
},
|
|
2
|
+
label: "{ULabel} w-full",
|
|
12
3
|
dropzoneWrapper: {
|
|
13
4
|
base: `
|
|
14
5
|
size-auto w-full rounded-lg border border-solid border-gray-300 bg-white
|
|
15
|
-
p-
|
|
6
|
+
p-3 transition hover:border-gray-400
|
|
16
7
|
`,
|
|
17
8
|
variants: {
|
|
18
9
|
error: {
|
|
@@ -20,14 +11,14 @@ export default /*tw*/ {
|
|
|
20
11
|
},
|
|
21
12
|
},
|
|
22
13
|
compoundVariants: [
|
|
23
|
-
{ labelAlign: "topInside", label: true, size: "sm", class: "pt-
|
|
24
|
-
{ labelAlign: "topInside", label: true, size: "md", class: "pt-
|
|
25
|
-
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-
|
|
14
|
+
{ labelAlign: "topInside", label: true, size: "sm", class: "pt-7" },
|
|
15
|
+
{ labelAlign: "topInside", label: true, size: "md", class: "pt-8" },
|
|
16
|
+
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-9" },
|
|
26
17
|
],
|
|
27
18
|
},
|
|
28
19
|
description: "{UText} text-gray-700",
|
|
29
20
|
contentWrapper: {
|
|
30
|
-
base: "relative
|
|
21
|
+
base: "relative flex w-full gap-6 justify-between items-start rounded-lg bg-brand-50 p-3",
|
|
31
22
|
variants: {
|
|
32
23
|
multiple: {
|
|
33
24
|
false: "items-center",
|
|
@@ -38,9 +29,9 @@ export default /*tw*/ {
|
|
|
38
29
|
base: "pr-4 text-gray-700 flex-grow w-full self-center",
|
|
39
30
|
variants: {
|
|
40
31
|
size: {
|
|
41
|
-
sm: "text-
|
|
42
|
-
md: "text-
|
|
43
|
-
lg: "text-
|
|
32
|
+
sm: "text-xs",
|
|
33
|
+
md: "text-sm",
|
|
34
|
+
lg: "text-base",
|
|
44
35
|
},
|
|
45
36
|
},
|
|
46
37
|
},
|
|
@@ -116,7 +116,7 @@ const props = defineProps({
|
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* Set label placement related from the default slot.
|
|
119
|
-
* @values top, topInside, topWithDesc,
|
|
119
|
+
* @values top, topInside, topWithDesc, left, right
|
|
120
120
|
*/
|
|
121
121
|
labelAlign: {
|
|
122
122
|
type: String,
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: {
|
|
3
|
-
base: "flex",
|
|
3
|
+
base: "flex gap-2",
|
|
4
4
|
variants: {
|
|
5
|
-
size: {
|
|
6
|
-
xs: "gap-2",
|
|
7
|
-
sm: "gap-2",
|
|
8
|
-
md: "gap-2.5",
|
|
9
|
-
lg: "gap-3",
|
|
10
|
-
xl: "gap-3.5",
|
|
11
|
-
},
|
|
12
5
|
align: {
|
|
13
6
|
top: "flex-col",
|
|
14
|
-
topInside: "flex-col gap-0",
|
|
7
|
+
topInside: "flex-col gap-0 relative",
|
|
15
8
|
topWithDesc: "flex-col-reverse w-fit",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
bottom: "flex-col-reverse w-fit",
|
|
9
|
+
right: "flex-row w-fit",
|
|
10
|
+
left: "flex-row-reverse w-fit",
|
|
19
11
|
},
|
|
20
12
|
},
|
|
13
|
+
compoundVariants: [
|
|
14
|
+
{ align: "left", size: "sm", class: "gap-2" },
|
|
15
|
+
{ align: "left", size: "md", class: "gap-3" },
|
|
16
|
+
{ align: "left", size: "lg", class: "gap-4" },
|
|
17
|
+
{ align: "right", size: "sm", class: "gap-2.5" },
|
|
18
|
+
{ align: "right", size: "md", class: "gap-3" },
|
|
19
|
+
{ align: "right", size: "lg", class: "gap-3.5" },
|
|
20
|
+
{ align: "left", centred: true, class: "items-center" },
|
|
21
|
+
{ align: "right", centred: true, class: "items-center" },
|
|
22
|
+
],
|
|
21
23
|
},
|
|
22
24
|
labelWrapper: "",
|
|
23
25
|
label: {
|
|
24
|
-
base: "text-gray-
|
|
26
|
+
base: "text-gray-900 z-10 block !leading-none",
|
|
25
27
|
variants: {
|
|
26
28
|
size: {
|
|
27
|
-
xs: "text-2xs",
|
|
28
29
|
sm: "text-xs",
|
|
29
30
|
md: "text-sm",
|
|
30
31
|
lg: "text-base",
|
|
31
|
-
xl: "text-lg",
|
|
32
32
|
},
|
|
33
33
|
align: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
top: "font-medium",
|
|
35
|
+
topInside: "font-normal absolute left-3 text-gray-500",
|
|
36
|
+
topWithDesc: "font-medium",
|
|
37
|
+
left: "font-normal",
|
|
38
|
+
right: "font-normal",
|
|
38
39
|
},
|
|
39
40
|
error: {
|
|
40
41
|
true: "text-red-500",
|
|
@@ -44,61 +45,52 @@ export default /*tw*/ {
|
|
|
44
45
|
},
|
|
45
46
|
},
|
|
46
47
|
compoundVariants: [
|
|
47
|
-
{ align: "topInside", size: "
|
|
48
|
-
{ align: "topInside", size: "
|
|
49
|
-
{ align: "topInside", size: "
|
|
50
|
-
{ align: "
|
|
51
|
-
{ align: "
|
|
52
|
-
{ align: "topWithDesc", size: "
|
|
53
|
-
{ align: "
|
|
54
|
-
{ align: "
|
|
55
|
-
{ align: "
|
|
56
|
-
{ align: "
|
|
57
|
-
{ align: "
|
|
58
|
-
{ align: "
|
|
59
|
-
{ align: "left",
|
|
60
|
-
{ align: "
|
|
61
|
-
{ align: "left", size: "xl", class: "mt-1 text-xl" },
|
|
62
|
-
{ align: "right", size: "sm", class: "-mt-0.5 text-xs" },
|
|
63
|
-
{ align: "right", size: "sm", class: "text-sm" },
|
|
64
|
-
{ align: "right", size: "md", class: "mt-px text-base" },
|
|
65
|
-
{ align: "right", size: "lg", class: "mt-0.5 text-lg" },
|
|
66
|
-
{ align: "right", size: "xl", class: "mt-1 text-xl" },
|
|
48
|
+
{ align: "topInside", size: "sm", class: "top-2 text-2xs" },
|
|
49
|
+
{ align: "topInside", size: "md", class: "top-2.5 text-xs" },
|
|
50
|
+
{ align: "topInside", size: "lg", class: "top-2.5 text-sm" },
|
|
51
|
+
{ align: "topWithDesc", size: "sm", class: "-mt-px" },
|
|
52
|
+
{ align: "topWithDesc", size: "md", class: "" },
|
|
53
|
+
{ align: "topWithDesc", size: "lg", class: "mt-px" },
|
|
54
|
+
{ align: "left", size: "sm", class: "-mt-px text-sm" },
|
|
55
|
+
{ align: "left", size: "md", class: "text-sm" },
|
|
56
|
+
{ align: "left", size: "lg", class: "mt-px text-base" },
|
|
57
|
+
{ align: "right", size: "sm", class: "-mt-px text-xs" },
|
|
58
|
+
{ align: "right", size: "md", class: "text-sm" },
|
|
59
|
+
{ align: "right", size: "lg", class: "mt-px text-base" },
|
|
60
|
+
{ align: "left", centred: false, class: "pt-1" },
|
|
61
|
+
{ align: "right", centred: false, class: "pt-1" },
|
|
67
62
|
],
|
|
68
63
|
},
|
|
69
64
|
description: {
|
|
70
|
-
base: "font-normal text-gray-500
|
|
65
|
+
base: "font-normal text-gray-500 !leading-none",
|
|
71
66
|
variants: {
|
|
72
67
|
size: {
|
|
73
|
-
xs: "text-2xs",
|
|
74
68
|
sm: "text-2xs",
|
|
75
69
|
md: "text-xs",
|
|
76
70
|
lg: "text-sm",
|
|
77
|
-
xl: "text-base",
|
|
78
71
|
},
|
|
79
72
|
align: {
|
|
80
|
-
topInside: "pl-4",
|
|
81
73
|
top: "pl-0 -mt-0.5",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
74
|
+
topInside: "pl-3",
|
|
75
|
+
topWithDesc: "pt-1",
|
|
76
|
+
left: "pt-1 pl-0",
|
|
77
|
+
right: "pt-1 pl-0",
|
|
85
78
|
},
|
|
86
79
|
error: {
|
|
87
80
|
true: "text-red-500",
|
|
88
81
|
},
|
|
89
82
|
},
|
|
90
83
|
compoundVariants: [
|
|
91
|
-
{ align: "topInside", size: "xs", class: "mt-1" },
|
|
92
84
|
{ align: "topInside", size: "sm", class: "mt-1.5" },
|
|
93
85
|
{ align: "topInside", size: "md", class: "mt-2" },
|
|
94
86
|
{ align: "topInside", size: "lg", class: "mt-2.5" },
|
|
95
|
-
{ align: "topInside", size: "xl", class: "mt-3" },
|
|
96
87
|
],
|
|
97
88
|
},
|
|
98
89
|
defaultVariants: {
|
|
99
90
|
align: "top",
|
|
100
91
|
size: "md",
|
|
101
92
|
error: false,
|
|
93
|
+
centred: false,
|
|
102
94
|
disabled: false,
|
|
103
95
|
},
|
|
104
96
|
};
|
package/ui.form-label/index.vue
CHANGED
|
@@ -94,14 +94,22 @@ const props = defineProps({
|
|
|
94
94
|
},
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
* @values top, topInside, topWithDesc,
|
|
97
|
+
* Label placement.
|
|
98
|
+
* @values top, topInside, topWithDesc, left, right
|
|
99
99
|
*/
|
|
100
100
|
align: {
|
|
101
101
|
type: String,
|
|
102
102
|
default: UIService.get(defaultConfig, ULabel).default.align,
|
|
103
103
|
},
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Centre label.
|
|
107
|
+
*/
|
|
108
|
+
centred: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: UIService.get(defaultConfig, ULabel).default.centred,
|
|
111
|
+
},
|
|
112
|
+
|
|
105
113
|
/**
|
|
106
114
|
* Set error message.
|
|
107
115
|
*/
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
label: {
|
|
3
|
-
wrapper: "inline-flex",
|
|
4
|
-
label: "{ULabel} cursor-pointer",
|
|
5
|
-
},
|
|
2
|
+
label: "{ULabel}",
|
|
6
3
|
radio: {
|
|
7
4
|
base: `
|
|
8
5
|
cursor-pointer
|
|
@@ -15,11 +12,9 @@ export default /*tw*/ {
|
|
|
15
12
|
`,
|
|
16
13
|
variants: {
|
|
17
14
|
size: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
lg: "size-7",
|
|
22
|
-
xl: "size-8",
|
|
15
|
+
sm: "size-4",
|
|
16
|
+
md: "size-5",
|
|
17
|
+
lg: "size-6",
|
|
23
18
|
},
|
|
24
19
|
},
|
|
25
20
|
compoundVariants: [
|
|
@@ -38,7 +33,7 @@ export default /*tw*/ {
|
|
|
38
33
|
defaultVariants: {
|
|
39
34
|
size: "md",
|
|
40
35
|
color: "brand",
|
|
41
|
-
labelAlign: "
|
|
36
|
+
labelAlign: "right",
|
|
42
37
|
disabled: false,
|
|
43
38
|
checked: false,
|
|
44
39
|
},
|
package/ui.form-radio/index.vue
CHANGED
|
@@ -91,7 +91,7 @@ const props = defineProps({
|
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Radio size.
|
|
94
|
-
* @values
|
|
94
|
+
* @values sm, md, lg
|
|
95
95
|
*/
|
|
96
96
|
size: {
|
|
97
97
|
type: String,
|
|
@@ -108,8 +108,8 @@ const props = defineProps({
|
|
|
108
108
|
},
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
112
|
-
* @values
|
|
111
|
+
* Label placement.
|
|
112
|
+
* @values left, right
|
|
113
113
|
*/
|
|
114
114
|
labelAlign: {
|
|
115
115
|
type: String,
|
|
@@ -38,21 +38,13 @@ const DefaultTemplate = (args) => ({
|
|
|
38
38
|
};
|
|
39
39
|
},
|
|
40
40
|
template: `
|
|
41
|
-
<UGroup>
|
|
41
|
+
<UGroup gap="2xl">
|
|
42
42
|
<URadioGroup v-bind="args" v-model="value">
|
|
43
|
-
<
|
|
44
|
-
<URadio
|
|
45
|
-
v-bind="radio"
|
|
46
|
-
>
|
|
47
|
-
</URadio>
|
|
48
|
-
</template>
|
|
43
|
+
<URadio v-for="(radio, index) in args.radios" :key="index" v-bind="radio" />
|
|
49
44
|
</URadioGroup>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<p>Selected value: <b>{{ value }}</b></p>
|
|
54
|
-
</UAlert>
|
|
55
|
-
</URow>
|
|
45
|
+
<UAlert color="gray" size="xs">
|
|
46
|
+
<code>Selected value: <b>{{ value }}</b></code>
|
|
47
|
+
</UAlert>
|
|
56
48
|
</UGroup>
|
|
57
49
|
`,
|
|
58
50
|
});
|
|
@@ -100,7 +92,7 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
|
100
92
|
:label="color"
|
|
101
93
|
:color="color"
|
|
102
94
|
:options="args.radios"
|
|
103
|
-
name="color"
|
|
95
|
+
:name="color"
|
|
104
96
|
v-model="value"
|
|
105
97
|
/>
|
|
106
98
|
</URow>
|
|
@@ -127,7 +119,7 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
|
127
119
|
:label="size"
|
|
128
120
|
:size="size"
|
|
129
121
|
:options="args.radios"
|
|
130
|
-
name="size"
|
|
122
|
+
:name="size"
|
|
131
123
|
v-model="value"
|
|
132
124
|
/>
|
|
133
125
|
</URow>
|