vueless 0.0.217 → 0.0.219
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 +21 -21
- package/ui.button/index.vue +14 -2
- 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/index.vue +1 -1
- 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 +19 -25
- package/ui.form-date-picker-range/index.vue +46 -55
- package/ui.form-input/composables/attrs.composable.js +10 -10
- package/ui.form-input/configs/default.config.js +19 -14
- package/ui.form-input/index.vue +4 -3
- 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 +4 -4
- 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 +40 -31
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
:id="id"
|
|
6
6
|
ref="inputRef"
|
|
7
7
|
v-model="userFormatDate"
|
|
8
|
+
:size="size"
|
|
8
9
|
:label="label"
|
|
10
|
+
:disabled="disabled"
|
|
9
11
|
:placeholder="placeholder"
|
|
10
|
-
:error="error"
|
|
11
12
|
:description="description"
|
|
13
|
+
:error="error"
|
|
12
14
|
readonly
|
|
13
|
-
:disabled="disabled"
|
|
14
|
-
:size="size"
|
|
15
15
|
v-bind="inputAttrs"
|
|
16
16
|
@focus="activate"
|
|
17
17
|
>
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<slot name="left" />
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
|
-
<template #right
|
|
23
|
-
<slot name="right
|
|
22
|
+
<template #icon-right>
|
|
23
|
+
<slot name="icon-right" />
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<template #right>
|
|
@@ -36,21 +36,20 @@
|
|
|
36
36
|
:disabled="disabled"
|
|
37
37
|
variant="thirdary"
|
|
38
38
|
filled
|
|
39
|
+
:icon-left="config.prevIconName"
|
|
39
40
|
v-bind="shiftRangeButtonAttrs"
|
|
40
41
|
@click="onClickShiftRange('prev')"
|
|
41
|
-
|
|
42
|
-
<UIcon internal interactive size="sm" :name="config.prevIconName" v-bind="prevIconAttrs" />
|
|
43
|
-
</UButton>
|
|
42
|
+
/>
|
|
44
43
|
|
|
45
44
|
<UButton
|
|
46
45
|
:id="id"
|
|
47
46
|
ref="buttonRef"
|
|
48
47
|
square
|
|
48
|
+
filled
|
|
49
49
|
:size="size"
|
|
50
50
|
:disabled="disabled"
|
|
51
51
|
:label="userFormatDate"
|
|
52
52
|
variant="thirdary"
|
|
53
|
-
filled
|
|
54
53
|
v-bind="buttonAttrs"
|
|
55
54
|
@click="activate"
|
|
56
55
|
/>
|
|
@@ -58,15 +57,14 @@
|
|
|
58
57
|
<UButton
|
|
59
58
|
ref="buttonNextRef"
|
|
60
59
|
square
|
|
60
|
+
filled
|
|
61
61
|
:size="size"
|
|
62
62
|
:disabled="disabled"
|
|
63
63
|
variant="thirdary"
|
|
64
|
-
|
|
64
|
+
:icon-left="config.nextIconName"
|
|
65
65
|
v-bind="shiftRangeButtonAttrs"
|
|
66
66
|
@click="onClickShiftRange('next')"
|
|
67
|
-
|
|
68
|
-
<UIcon internal interactive size="sm" :name="config.nextIconName" v-bind="nextIconAttrs" />
|
|
69
|
-
</UButton>
|
|
67
|
+
/>
|
|
70
68
|
</div>
|
|
71
69
|
|
|
72
70
|
<Transition v-bind="config.menuTransition">
|
|
@@ -82,22 +80,23 @@
|
|
|
82
80
|
<UButton
|
|
83
81
|
v-for="periodButton in periods"
|
|
84
82
|
:key="periodButton.name"
|
|
85
|
-
variant="thirdary"
|
|
86
|
-
size="xs"
|
|
87
83
|
square
|
|
88
|
-
|
|
84
|
+
filled
|
|
85
|
+
size="xs"
|
|
86
|
+
variant="thirdary"
|
|
87
|
+
:label="periodButton.title"
|
|
89
88
|
v-bind="periodButtonAttrs(getPeriodButtonsClasses(periodButton.name))"
|
|
90
89
|
@click="onClickPeriodButton(periodButton.name)"
|
|
91
|
-
|
|
92
|
-
{{ periodButton.title }}
|
|
93
|
-
</UButton>
|
|
90
|
+
/>
|
|
94
91
|
</div>
|
|
95
92
|
|
|
96
93
|
<div v-bind="periodsRowAttrs">
|
|
97
94
|
<UButton
|
|
98
95
|
v-if="customRangeButton.range.to && customRangeButton.range.from"
|
|
96
|
+
square
|
|
97
|
+
filled
|
|
98
|
+
size="xs"
|
|
99
99
|
variant="thirdary"
|
|
100
|
-
color="brand"
|
|
101
100
|
v-bind="periodButtonAttrs(getPeriodButtonsClasses(PERIOD.custom))"
|
|
102
101
|
@click="onClickCustomRangeButton"
|
|
103
102
|
>
|
|
@@ -106,30 +105,26 @@
|
|
|
106
105
|
</UButton>
|
|
107
106
|
|
|
108
107
|
<UButton
|
|
108
|
+
square
|
|
109
|
+
filled
|
|
110
|
+
size="xs"
|
|
109
111
|
variant="thirdary"
|
|
110
|
-
|
|
112
|
+
:label="locale.ownRange"
|
|
113
|
+
:icon-left="config.periodButtonIconName"
|
|
111
114
|
v-bind="periodButtonAttrs(getPeriodButtonsClasses(PERIOD.ownRange))"
|
|
112
115
|
@click="onClickOwnRange"
|
|
113
|
-
|
|
114
|
-
<UIcon
|
|
115
|
-
internal
|
|
116
|
-
:name="config.periodButtonIconName"
|
|
117
|
-
size="xs"
|
|
118
|
-
v-bind="periodButtonIconAttrs"
|
|
119
|
-
/>
|
|
120
|
-
{{ locale.ownRange }}
|
|
121
|
-
</UButton>
|
|
116
|
+
/>
|
|
122
117
|
</div>
|
|
123
118
|
|
|
124
119
|
<template v-if="!isPeriod.ownRange && !isPeriod.custom">
|
|
125
120
|
<div v-bind="rangeSwitchWrapperAttrs">
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
color="
|
|
130
|
-
|
|
131
|
-
:
|
|
132
|
-
v-bind="
|
|
121
|
+
<UButton
|
|
122
|
+
square
|
|
123
|
+
size="xs"
|
|
124
|
+
color="gray"
|
|
125
|
+
variant="thirdary"
|
|
126
|
+
:icon-left="config.prevIconName"
|
|
127
|
+
v-bind="rangeSwitchButtonAttrs"
|
|
133
128
|
@click="onClickShiftDatesList('prev')"
|
|
134
129
|
/>
|
|
135
130
|
|
|
@@ -137,13 +132,13 @@
|
|
|
137
132
|
{{ rangeSwitchTitle }}
|
|
138
133
|
</div>
|
|
139
134
|
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
:
|
|
146
|
-
v-bind="
|
|
135
|
+
<UButton
|
|
136
|
+
square
|
|
137
|
+
size="xs"
|
|
138
|
+
color="gray"
|
|
139
|
+
variant="thirdary"
|
|
140
|
+
:icon-left="config.nextIconName"
|
|
141
|
+
v-bind="rangeSwitchButtonAttrs"
|
|
147
142
|
@click="onClickShiftDatesList('next')"
|
|
148
143
|
/>
|
|
149
144
|
</div>
|
|
@@ -152,10 +147,9 @@
|
|
|
152
147
|
<UButton
|
|
153
148
|
v-for="date in periodDateList"
|
|
154
149
|
:key="date.title"
|
|
155
|
-
:disabled="isDatePeriodOutOfRange(date)"
|
|
156
|
-
variant="thirdary"
|
|
157
|
-
color="brand"
|
|
158
150
|
size="sm"
|
|
151
|
+
variant="thirdary"
|
|
152
|
+
:disabled="isDatePeriodOutOfRange(date)"
|
|
159
153
|
v-bind="periodDateAttrs(getPeriodDateClasses(date))"
|
|
160
154
|
:label="String(date.title)"
|
|
161
155
|
@click="selectDate(date), toggleMenu()"
|
|
@@ -168,7 +162,7 @@
|
|
|
168
162
|
ref="rangeInputStartRef"
|
|
169
163
|
v-model="rangeStart"
|
|
170
164
|
:error="inputRangeFromError"
|
|
171
|
-
size="
|
|
165
|
+
size="md"
|
|
172
166
|
v-bind="rangeInputAttrs"
|
|
173
167
|
:name="rangeInputName"
|
|
174
168
|
@input="onInputRangeInput($event, INPUT_RANGE_TYPE.start)"
|
|
@@ -178,14 +172,14 @@
|
|
|
178
172
|
ref="rangeInputEndRef"
|
|
179
173
|
v-model="rangeEnd"
|
|
180
174
|
:error="inputRangeToError"
|
|
181
|
-
size="
|
|
175
|
+
size="md"
|
|
182
176
|
v-bind="rangeInputAttrs"
|
|
183
177
|
:name="rangeInputName"
|
|
184
178
|
@input="onInputRangeInput($event, INPUT_RANGE_TYPE.end)"
|
|
185
179
|
/>
|
|
186
180
|
</div>
|
|
187
181
|
|
|
188
|
-
<div v-bind="inputRangeErrorAttrs">
|
|
182
|
+
<div v-if="inputRangeToError || inputRangeFromError" v-bind="inputRangeErrorAttrs">
|
|
189
183
|
{{ inputRangeToError || inputRangeFromError }}
|
|
190
184
|
</div>
|
|
191
185
|
|
|
@@ -209,7 +203,6 @@
|
|
|
209
203
|
import { computed, watch, ref, nextTick } from "vue";
|
|
210
204
|
import { merge } from "lodash-es";
|
|
211
205
|
|
|
212
|
-
import UIcon from "../ui.image-icon";
|
|
213
206
|
import UInput from "../ui.form-input";
|
|
214
207
|
import UButton from "../ui.button";
|
|
215
208
|
import UCalendar from "../ui.form-calendar";
|
|
@@ -462,12 +455,10 @@ const {
|
|
|
462
455
|
menuAttrs,
|
|
463
456
|
periodsRowAttrs,
|
|
464
457
|
periodButtonAttrs,
|
|
465
|
-
periodButtonIconAttrs,
|
|
466
|
-
rangeSwitchWrapperAttrs,
|
|
467
|
-
nextIconAttrs,
|
|
468
|
-
prevIconAttrs,
|
|
469
458
|
periodDateAttrs,
|
|
470
459
|
periodDateListAttrs,
|
|
460
|
+
rangeSwitchWrapperAttrs,
|
|
461
|
+
rangeSwitchButtonAttrs,
|
|
471
462
|
rangeSwitchTitleAttrs,
|
|
472
463
|
buttonWrapperAttrs,
|
|
473
464
|
buttonAttrs,
|
|
@@ -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
|
`,
|
|
@@ -27,40 +28,44 @@ export default /*tw*/ {
|
|
|
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 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">
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
@binding {string} icon-size
|
|
23
24
|
-->
|
|
24
25
|
<slot name="icon-left" :icon-name="iconLeft" :icon-size="iconSize">
|
|
25
|
-
<UIcon v-if="iconLeft" :name="iconLeft" :size="iconSize" />
|
|
26
|
+
<UIcon v-if="iconLeft" :name="iconLeft" :size="iconSize" internal />
|
|
26
27
|
</slot>
|
|
27
28
|
</span>
|
|
28
29
|
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
@binding {string} icon-size
|
|
77
78
|
-->
|
|
78
79
|
<slot name="icon-right" :icon-name="iconLeft" :icon-size="iconSize">
|
|
79
|
-
<UIcon v-if="iconRight" :name="iconRight" :size="iconSize" />
|
|
80
|
+
<UIcon v-if="iconRight" :name="iconRight" :size="iconSize" internal />
|
|
80
81
|
</slot>
|
|
81
82
|
</span>
|
|
82
83
|
</label>
|
|
@@ -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
|
},
|