vueless 0.0.208 → 0.0.210
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 +1 -1
- package/ui.form-radio-group/index.stories.js +19 -28
- package/ui.form-radio-group/index.vue +2 -2
- package/ui.form-select/composables/attrs.composable.js +16 -16
- package/ui.form-select/configs/default.config.js +39 -39
- package/ui.form-select/index.vue +19 -19
- package/ui.loader/composables/attrs.composable.js +34 -37
- package/ui.loader/index.vue +1 -1
- package/ui.loader-rendering/composables/attrs.composable.js +27 -19
- package/ui.loader-rendering/configs/default.config.js +1 -0
- package/ui.loader-rendering/index.vue +8 -3
- package/ui.loader-top/composables/attrs.composable.js +28 -19
- package/ui.loader-top/index.vue +1 -1
- package/ui.other-dot/composables/attrs.composable.js +28 -20
- package/ui.other-dot/index.vue +1 -1
- package/web-types.json +4 -4
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import URadioGroup from "../ui.form-radio-group";
|
|
|
4
4
|
import URadio from "../ui.form-radio";
|
|
5
5
|
import UAlert from "../ui.text-alert";
|
|
6
6
|
import URow from "../ui.container-row";
|
|
7
|
+
import UGroup from "../ui.container-group";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* The `URadioGroup` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.form-radio-group)
|
|
@@ -12,13 +13,6 @@ export default {
|
|
|
12
13
|
id: "3160",
|
|
13
14
|
title: "Form Inputs & Controls / Radio Group",
|
|
14
15
|
component: URadioGroup,
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
story: "Another description on the story, overriding the comments",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
16
|
args: {
|
|
23
17
|
label: "Label",
|
|
24
18
|
value: "One",
|
|
@@ -34,7 +28,7 @@ export default {
|
|
|
34
28
|
};
|
|
35
29
|
|
|
36
30
|
const DefaultTemplate = (args) => ({
|
|
37
|
-
components: { URadioGroup, URadio, UAlert, URow },
|
|
31
|
+
components: { URadioGroup, URadio, UAlert, URow, UGroup },
|
|
38
32
|
setup() {
|
|
39
33
|
return { args };
|
|
40
34
|
},
|
|
@@ -44,7 +38,7 @@ const DefaultTemplate = (args) => ({
|
|
|
44
38
|
};
|
|
45
39
|
},
|
|
46
40
|
template: `
|
|
47
|
-
<
|
|
41
|
+
<UGroup>
|
|
48
42
|
<URadioGroup v-bind="args" v-model="value">
|
|
49
43
|
<template v-for="(radio,index) in args.radios" :key="index">
|
|
50
44
|
<URadio
|
|
@@ -55,14 +49,11 @@ const DefaultTemplate = (args) => ({
|
|
|
55
49
|
</URadioGroup>
|
|
56
50
|
|
|
57
51
|
<URow>
|
|
58
|
-
<UAlert color="
|
|
59
|
-
<
|
|
60
|
-
</UAlert>
|
|
61
|
-
<UAlert color="blue">
|
|
62
|
-
<p>Selected value: {{ value }}</p>
|
|
52
|
+
<UAlert color="green" size="sm">
|
|
53
|
+
<p>Selected value: <b>{{ value }}</b></p>
|
|
63
54
|
</UAlert>
|
|
64
55
|
</URow>
|
|
65
|
-
</
|
|
56
|
+
</UGroup>
|
|
66
57
|
`,
|
|
67
58
|
});
|
|
68
59
|
|
|
@@ -79,7 +70,7 @@ const OptionsTemplate = (args) => ({
|
|
|
79
70
|
template: `
|
|
80
71
|
<URow class="!flex-col">
|
|
81
72
|
<URadioGroup v-bind="args" v-model="value" :options="args.radios" />
|
|
82
|
-
|
|
73
|
+
|
|
83
74
|
<URow>
|
|
84
75
|
<UAlert color="blue">
|
|
85
76
|
<p>Selected value: {{ value }}</p>
|
|
@@ -102,15 +93,15 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
|
102
93
|
},
|
|
103
94
|
template: `
|
|
104
95
|
<URow class="!flex-col">
|
|
105
|
-
<URadioGroup
|
|
96
|
+
<URadioGroup
|
|
106
97
|
v-bind="args"
|
|
107
|
-
v-for="color in colors"
|
|
108
|
-
:key="color"
|
|
109
|
-
:label="color"
|
|
98
|
+
v-for="color in colors"
|
|
99
|
+
:key="color"
|
|
100
|
+
:label="color"
|
|
110
101
|
:color="color"
|
|
111
|
-
:options="args.radios"
|
|
102
|
+
:options="args.radios"
|
|
112
103
|
name="color"
|
|
113
|
-
v-model="value"
|
|
104
|
+
v-model="value"
|
|
114
105
|
/>
|
|
115
106
|
</URow>
|
|
116
107
|
`,
|
|
@@ -129,15 +120,15 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
|
129
120
|
},
|
|
130
121
|
template: `
|
|
131
122
|
<URow class="!flex-col">
|
|
132
|
-
<URadioGroup
|
|
123
|
+
<URadioGroup
|
|
133
124
|
v-bind="args"
|
|
134
|
-
v-for="size in sizes"
|
|
135
|
-
:key="size"
|
|
136
|
-
:label="size"
|
|
125
|
+
v-for="size in sizes"
|
|
126
|
+
:key="size"
|
|
127
|
+
:label="size"
|
|
137
128
|
:size="size"
|
|
138
|
-
:options="args.radios"
|
|
129
|
+
:options="args.radios"
|
|
139
130
|
name="size"
|
|
140
|
-
v-model="value"
|
|
131
|
+
v-model="value"
|
|
141
132
|
/>
|
|
142
133
|
</URow>
|
|
143
134
|
`,
|
|
@@ -101,11 +101,11 @@ const props = defineProps({
|
|
|
101
101
|
},
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
*
|
|
104
|
+
* Unique radio group name (sets for each radio).
|
|
105
105
|
*/
|
|
106
106
|
name: {
|
|
107
107
|
type: String,
|
|
108
|
-
|
|
108
|
+
required: true,
|
|
109
109
|
},
|
|
110
110
|
|
|
111
111
|
/**
|
|
@@ -59,39 +59,39 @@ export default function useAttrs(props, { isTop, isOpen, selectedLabel: selected
|
|
|
59
59
|
}));
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
if (key === "
|
|
63
|
-
const
|
|
62
|
+
if (key === "toggle") {
|
|
63
|
+
const toggleAttrs = attrs[`${key}Attrs`];
|
|
64
64
|
|
|
65
65
|
attrs[`${key}Attrs`] = computed(() => ({
|
|
66
|
-
...
|
|
67
|
-
class: cx([
|
|
66
|
+
...toggleAttrs.value,
|
|
67
|
+
class: cx([toggleAttrs.value.class, caretClasses.value]),
|
|
68
68
|
}));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
if (key === "
|
|
72
|
-
const
|
|
71
|
+
if (key === "clear") {
|
|
72
|
+
const clearAttrs = attrs[`${key}Attrs`];
|
|
73
73
|
|
|
74
74
|
attrs[`${key}Attrs`] = computed(() => ({
|
|
75
|
-
...
|
|
76
|
-
class: cx([
|
|
75
|
+
...clearAttrs.value,
|
|
76
|
+
class: cx([clearAttrs.value.class, caretClasses.value]),
|
|
77
77
|
}));
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
if (key === "
|
|
81
|
-
const
|
|
80
|
+
if (key === "beforeCaret") {
|
|
81
|
+
const beforeCaretAttrs = attrs[`${key}Attrs`];
|
|
82
82
|
|
|
83
83
|
attrs[`${key}Attrs`] = computed(() => ({
|
|
84
|
-
...
|
|
85
|
-
class: cx([
|
|
84
|
+
...beforeCaretAttrs.value,
|
|
85
|
+
class: cx([beforeCaretAttrs.value.class, caretClasses.value]),
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
if (key === "
|
|
90
|
-
const
|
|
89
|
+
if (key === "afterCaret") {
|
|
90
|
+
const afterCaretAttrs = attrs[`${key}Attrs`];
|
|
91
91
|
|
|
92
92
|
attrs[`${key}Attrs`] = computed(() => ({
|
|
93
|
-
...
|
|
94
|
-
class: cx([
|
|
93
|
+
...afterCaretAttrs.value,
|
|
94
|
+
class: cx([afterCaretAttrs.value.class, caretClasses.value]),
|
|
95
95
|
}));
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
label: "{ULabel} w-full relative",
|
|
3
|
+
labelWrapperTop: "group/top", // applies when an open direction is top
|
|
4
|
+
labelWrapperActive: "group/active",
|
|
3
5
|
wrapper: {
|
|
4
6
|
base: `
|
|
5
7
|
pb-2 pt-2 flex flex-row-reverse justify-between w-full min-h-full box-border relative
|
|
@@ -32,6 +34,7 @@ export default /*tw*/ {
|
|
|
32
34
|
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-7" },
|
|
33
35
|
],
|
|
34
36
|
},
|
|
37
|
+
wrapperActive: "z-[inherit]", // applies when select active
|
|
35
38
|
innerWrapper: {
|
|
36
39
|
base: "flex px-4 min-h-full w-full overflow-hidden justify-between",
|
|
37
40
|
variants: {
|
|
@@ -40,11 +43,35 @@ export default /*tw*/ {
|
|
|
40
43
|
},
|
|
41
44
|
},
|
|
42
45
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
selectedLabels: "flex flex-col col-span-2",
|
|
47
|
+
selectedLabel: {
|
|
48
|
+
base: `
|
|
49
|
+
font-normal leading-none text-gray-900 relative truncate
|
|
50
|
+
inline-flex items-center whitespace-nowrap mb-0 w-full
|
|
51
|
+
`,
|
|
52
|
+
variants: {
|
|
53
|
+
size: {
|
|
54
|
+
sm: "text-sm min-h-4",
|
|
55
|
+
md: "text-base min-h-5",
|
|
56
|
+
lg: "text-lg min-h-6",
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
true: "bg-gray-100",
|
|
60
|
+
},
|
|
61
|
+
multiple: {
|
|
62
|
+
true: "py-2 last:mb-2.5 flex justify-between border-b border-gray-100",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
compoundVariants: [
|
|
66
|
+
{ size: "sm", multiple: true, class: "text-sm" },
|
|
67
|
+
{ size: "md", multiple: true, class: "text-base" },
|
|
68
|
+
{ size: "lg", multiple: true, class: "text-lg" },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
leftIcon: "pr-3 flex items-center",
|
|
72
|
+
rightIcon: "pl-3 flex items-center",
|
|
73
|
+
beforeCaret: "",
|
|
74
|
+
afterCaret: "mr-3",
|
|
48
75
|
caret: {
|
|
49
76
|
base: "flex items-center mt-0",
|
|
50
77
|
compoundVariants: [
|
|
@@ -53,19 +80,17 @@ export default /*tw*/ {
|
|
|
53
80
|
{ labelAlign: "topInside", size: "lg", label: true, class: "-mt-4" },
|
|
54
81
|
],
|
|
55
82
|
},
|
|
56
|
-
|
|
57
|
-
afterCaretSlot: "mr-3",
|
|
58
|
-
caretToggle: "mr-3",
|
|
83
|
+
toggle: "mr-3",
|
|
59
84
|
toggleIcon: "{UIcon} transform transition duration-300 group-[]/active:rotate-180",
|
|
60
85
|
toggleIconName: "expand_more",
|
|
86
|
+
clear: "",
|
|
61
87
|
clearIcon: "{UIcon}",
|
|
62
88
|
clearIconName: "close_small",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// TODO: caretClearMultiple is better
|
|
89
|
+
clearMultiple: "flex items-center",
|
|
90
|
+
clearMultipleIcon: "{UIcon}",
|
|
91
|
+
clearMultipleIconName: "close_small",
|
|
92
|
+
clearMultipleTextAll: {
|
|
93
|
+
// TODO: clearMultiple is better
|
|
69
94
|
base: "cursor-pointer flex items-center text-sm font-normal text-gray-400 hover:text-gray-500 transition",
|
|
70
95
|
compoundVariants: [
|
|
71
96
|
{ size: "sm", class: "text-sm" },
|
|
@@ -88,31 +113,6 @@ export default /*tw*/ {
|
|
|
88
113
|
},
|
|
89
114
|
},
|
|
90
115
|
},
|
|
91
|
-
selectedLabels: "flex flex-col col-span-2",
|
|
92
|
-
selectedLabel: {
|
|
93
|
-
base: `
|
|
94
|
-
font-normal leading-none text-gray-900 relative truncate
|
|
95
|
-
inline-flex items-center whitespace-nowrap mb-0 w-full
|
|
96
|
-
`,
|
|
97
|
-
variants: {
|
|
98
|
-
size: {
|
|
99
|
-
sm: "text-sm min-h-4",
|
|
100
|
-
md: "text-base min-h-5",
|
|
101
|
-
lg: "text-lg min-h-6",
|
|
102
|
-
},
|
|
103
|
-
disabled: {
|
|
104
|
-
true: "bg-gray-100",
|
|
105
|
-
},
|
|
106
|
-
multiple: {
|
|
107
|
-
true: "py-2 last:mb-2.5 flex justify-between border-b border-gray-100",
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
compoundVariants: [
|
|
111
|
-
{ size: "sm", multiple: true, class: "text-sm" },
|
|
112
|
-
{ size: "md", multiple: true, class: "text-base" },
|
|
113
|
-
{ size: "lg", multiple: true, class: "text-lg" },
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
116
|
dropdownList: "{UDropdownList} group-[]/top:bottom-full group-[]/top:top-auto top-full",
|
|
117
117
|
i18n: {
|
|
118
118
|
listIsEmpty: "List is empty.",
|
package/ui.form-select/index.vue
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
>
|
|
27
27
|
<div
|
|
28
28
|
v-if="hasSlotContent($slots['after-caret']) && !(multiple && localValue.length)"
|
|
29
|
-
v-bind="
|
|
29
|
+
v-bind="afterCaretAttrs"
|
|
30
30
|
>
|
|
31
31
|
<!--
|
|
32
32
|
@slot Use it to add something after caret.
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
<div
|
|
39
39
|
v-show="!multiple || (!isLocalValue && multiple)"
|
|
40
|
-
v-bind="
|
|
40
|
+
v-bind="toggleAttrs"
|
|
41
41
|
@mousedown.prevent.stop="toggle"
|
|
42
42
|
>
|
|
43
43
|
<UIcon
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
<div
|
|
54
54
|
v-if="hasSlotContent($slots['before-caret']) && !(multiple && localValue.length)"
|
|
55
|
-
v-bind="
|
|
55
|
+
v-bind="beforeCaretAttrs"
|
|
56
56
|
>
|
|
57
57
|
<!--
|
|
58
58
|
@slot Use it to add something before caret.
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<slot :scope-props="props" name="before-caret" />
|
|
62
62
|
</div>
|
|
63
63
|
|
|
64
|
-
<div v-if="isLocalValue && !noClear && !disabled && !multiple" v-bind="
|
|
64
|
+
<div v-if="isLocalValue && !noClear && !disabled && !multiple" v-bind="clearAttrs">
|
|
65
65
|
<UIcon
|
|
66
66
|
internal
|
|
67
67
|
interactive
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<span
|
|
78
78
|
v-if="hasSlotContent($slots['icon-left']) || iconLeft"
|
|
79
79
|
ref="leftSlotWrapperRef"
|
|
80
|
-
v-bind="
|
|
80
|
+
v-bind="leftIconAttrs"
|
|
81
81
|
>
|
|
82
82
|
<!--
|
|
83
83
|
@slot Use it to add icon before option.
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
|
|
118
118
|
<div
|
|
119
119
|
v-if="!disabled"
|
|
120
|
-
v-bind="
|
|
120
|
+
v-bind="clearMultipleAttrs"
|
|
121
121
|
@mousedown.prevent.capture
|
|
122
122
|
@click.prevent.capture
|
|
123
123
|
>
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
interactive
|
|
127
127
|
color="gray"
|
|
128
128
|
:size="iconSize"
|
|
129
|
-
:name="config.
|
|
130
|
-
v-bind="
|
|
129
|
+
:name="config.clearMultipleIconName"
|
|
130
|
+
v-bind="clearMultipleIconAttrs"
|
|
131
131
|
@mousedown="removeElement(item)"
|
|
132
132
|
/>
|
|
133
133
|
</div>
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
|
|
181
181
|
<div
|
|
182
182
|
v-if="isLocalValue && !noClear && !disabled && multiple"
|
|
183
|
-
v-bind="
|
|
183
|
+
v-bind="clearMultipleTextAllAttrs"
|
|
184
184
|
@mousedown.prevent.capture="removeElement(localValue)"
|
|
185
185
|
@click.prevent.capture
|
|
186
186
|
v-text="currentLocale.clear"
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
<!-- @slot Use it to add something after input. -->
|
|
190
190
|
<slot name="right" />
|
|
191
191
|
|
|
192
|
-
<span v-if="hasSlotContent($slots['icon-right']) || iconRight" v-bind="
|
|
192
|
+
<span v-if="hasSlotContent($slots['icon-right']) || iconRight" v-bind="rightIconAttrs">
|
|
193
193
|
<!--
|
|
194
194
|
@slot Use it to add icon after option.
|
|
195
195
|
@binding {string} icon-name
|
|
@@ -564,14 +564,14 @@ const {
|
|
|
564
564
|
labelAttrs,
|
|
565
565
|
wrapperAttrs,
|
|
566
566
|
innerWrapperAttrs,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
567
|
+
leftIconAttrs,
|
|
568
|
+
rightIconAttrs,
|
|
569
|
+
beforeCaretAttrs,
|
|
570
|
+
afterCaretAttrs,
|
|
571
|
+
toggleAttrs,
|
|
572
|
+
clearAttrs,
|
|
573
|
+
clearMultipleTextAllAttrs,
|
|
574
|
+
clearMultipleAttrs,
|
|
575
575
|
searchAttrs,
|
|
576
576
|
searchInputAttrs,
|
|
577
577
|
selectedLabelsAttrs,
|
|
@@ -579,7 +579,7 @@ const {
|
|
|
579
579
|
dropdownListAttrs,
|
|
580
580
|
toggleIconAttrs,
|
|
581
581
|
clearIconAttrs,
|
|
582
|
-
|
|
582
|
+
clearMultipleIconAttrs,
|
|
583
583
|
} = useAttrs(props, { isTop, isOpen, selectedLabel });
|
|
584
584
|
|
|
585
585
|
const i18nGlobal = tm(USelect);
|
|
@@ -4,49 +4,46 @@ import { cva, cx } from "../../service.ui";
|
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, getColor, setColor } = useUI(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const cvaLoader = cva({
|
|
12
|
-
base: loader.base,
|
|
13
|
-
variants: loader.variants,
|
|
14
|
-
compoundVariants: loader.compoundVariants,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const cvaEllipse = cva({
|
|
18
|
-
base: ellipse.base,
|
|
19
|
-
variants: ellipse.variants,
|
|
20
|
-
compoundVariants: ellipse.compoundVariants,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const loaderClasses = computed(() =>
|
|
24
|
-
cvaLoader({
|
|
25
|
-
size: props.size,
|
|
26
|
-
}),
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
27
11
|
);
|
|
12
|
+
const attrs = {};
|
|
28
13
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
for (const key in defaultConfig) {
|
|
15
|
+
if (isSystemKey(key)) continue;
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
const value = config.value[key];
|
|
19
|
+
|
|
20
|
+
if (value.variants || value.compoundVariants) {
|
|
21
|
+
return setColor(
|
|
22
|
+
cva(value)({
|
|
23
|
+
...props,
|
|
24
|
+
color: getColor(props.color),
|
|
25
|
+
}),
|
|
26
|
+
props.color,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return "";
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
if (key === "ellipse") {
|
|
36
|
+
const ellipseAttrs = attrs[`${key}Attrs`];
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
attrs[`${key}Attrs`] = computed(() => (classes) => ({
|
|
39
|
+
...ellipseAttrs,
|
|
40
|
+
class: cx([ellipseAttrs.value.class, classes]),
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
46
44
|
|
|
47
45
|
return {
|
|
48
|
-
|
|
49
|
-
ellipseAttrs,
|
|
46
|
+
...attrs,
|
|
50
47
|
config,
|
|
51
48
|
};
|
|
52
49
|
}
|
package/ui.loader/index.vue
CHANGED
|
@@ -16,7 +16,7 @@ import UIService from "../service.ui";
|
|
|
16
16
|
|
|
17
17
|
import { ULoader } from "./constants";
|
|
18
18
|
import defaultConfig from "./configs/default.config";
|
|
19
|
-
import
|
|
19
|
+
import useAttrs from "./composables/attrs.composable";
|
|
20
20
|
|
|
21
21
|
/* Should be a string for correct web-types gen */
|
|
22
22
|
defineOptions({ name: "ULoader", inheritAttrs: false });
|
|
@@ -4,29 +4,37 @@ import { cva } from "../../service.ui";
|
|
|
4
4
|
|
|
5
5
|
import defaultConfig from "../configs/default.config";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, getColor, setColor } = useUI(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const cvaWrapper = cva({
|
|
12
|
-
base: wrapper.base,
|
|
13
|
-
variants: wrapper.variants,
|
|
14
|
-
compoundVariants: wrapper.compoundVariants,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const wrapperClasses = computed(() =>
|
|
18
|
-
setColor(
|
|
19
|
-
cvaWrapper({
|
|
20
|
-
color: getColor(props.color),
|
|
21
|
-
}),
|
|
22
|
-
props.color,
|
|
23
|
-
),
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
24
11
|
);
|
|
12
|
+
const attrs = {};
|
|
25
13
|
|
|
26
|
-
const
|
|
14
|
+
for (const key in defaultConfig) {
|
|
15
|
+
if (isSystemKey(key)) continue;
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
const value = config.value[key];
|
|
19
|
+
|
|
20
|
+
if (value.variants || value.compoundVariants) {
|
|
21
|
+
return setColor(
|
|
22
|
+
cva(value)({
|
|
23
|
+
...props,
|
|
24
|
+
color: getColor(props.color),
|
|
25
|
+
}),
|
|
26
|
+
props.color,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return "";
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
34
|
+
}
|
|
27
35
|
|
|
28
36
|
return {
|
|
29
|
-
|
|
37
|
+
...attrs,
|
|
30
38
|
config,
|
|
31
39
|
};
|
|
32
40
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Transition v-bind="config.transition">
|
|
3
3
|
<div v-if="showLoader" v-bind="wrapperAttrs">
|
|
4
|
-
<ULoader
|
|
4
|
+
<ULoader
|
|
5
|
+
:loading="showLoader"
|
|
6
|
+
size="lg"
|
|
7
|
+
:color="color === 'white' ? 'grayscale' : 'white'"
|
|
8
|
+
v-bind="loaderAttrs"
|
|
9
|
+
/>
|
|
5
10
|
</div>
|
|
6
11
|
</Transition>
|
|
7
12
|
</template>
|
|
@@ -14,7 +19,7 @@ import ULoader from "../ui.loader";
|
|
|
14
19
|
|
|
15
20
|
import { ULoaderRendering } from "./constants";
|
|
16
21
|
import defaultConfig from "./configs/default.config";
|
|
17
|
-
import
|
|
22
|
+
import useAttrs from "./composables/attrs.composable";
|
|
18
23
|
import { useLoaderRendering } from "./composables/useLoaderRendering";
|
|
19
24
|
|
|
20
25
|
/* Should be a string for correct web-types gen */
|
|
@@ -39,7 +44,7 @@ const props = defineProps({
|
|
|
39
44
|
},
|
|
40
45
|
});
|
|
41
46
|
|
|
42
|
-
const { wrapperAttrs, config } = useAttrs(props);
|
|
47
|
+
const { wrapperAttrs, loaderAttrs, config } = useAttrs(props);
|
|
43
48
|
const { isLoading, loaderRenderingOn, loaderRenderingOff } = useLoaderRendering();
|
|
44
49
|
|
|
45
50
|
onMounted(() => {
|
|
@@ -4,28 +4,37 @@ import { cva } from "../../service.ui";
|
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, getColor, setColor } = useUI(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const cvaProgress = cva({
|
|
12
|
-
base: progress.base,
|
|
13
|
-
variants: progress.variants,
|
|
14
|
-
compoundVariants: progress.compoundVariants,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const progressClasses = computed(() =>
|
|
18
|
-
setColor(
|
|
19
|
-
cvaProgress({
|
|
20
|
-
color: getColor(props.color),
|
|
21
|
-
}),
|
|
22
|
-
props.color,
|
|
23
|
-
),
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
24
11
|
);
|
|
12
|
+
const attrs = {};
|
|
25
13
|
|
|
26
|
-
const
|
|
14
|
+
for (const key in defaultConfig) {
|
|
15
|
+
if (isSystemKey(key)) continue;
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
const value = config.value[key];
|
|
19
|
+
|
|
20
|
+
if (value.variants || value.compoundVariants) {
|
|
21
|
+
return setColor(
|
|
22
|
+
cva(value)({
|
|
23
|
+
...props,
|
|
24
|
+
color: getColor(props.color),
|
|
25
|
+
}),
|
|
26
|
+
props.color,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return "";
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
34
|
+
}
|
|
27
35
|
|
|
28
36
|
return {
|
|
29
|
-
|
|
37
|
+
...attrs,
|
|
38
|
+
config,
|
|
30
39
|
};
|
|
31
40
|
}
|
package/ui.loader-top/index.vue
CHANGED
|
@@ -13,7 +13,7 @@ import { useLoaderTop } from "./composables/useLoaderTop";
|
|
|
13
13
|
|
|
14
14
|
import { ULoaderTop, MAXIMUM, SPEED } from "./constants";
|
|
15
15
|
import defaultConfig from "./configs/default.config";
|
|
16
|
-
import
|
|
16
|
+
import useAttrs from "./composables/attrs.composable";
|
|
17
17
|
|
|
18
18
|
/* Should be a string for correct web-types gen */
|
|
19
19
|
defineOptions({ name: "ULoaderTop", inheritAttrs: false });
|
|
@@ -4,29 +4,37 @@ import { cva } from "../../service.ui";
|
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, getColor, setColor } = useUI(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const cvaWrapper = cva({
|
|
12
|
-
base: wrapper.base,
|
|
13
|
-
variants: wrapper.variants,
|
|
14
|
-
compoundVariants: wrapper.compoundVariants,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const wrapperClasses = computed(() =>
|
|
18
|
-
setColor(
|
|
19
|
-
cvaWrapper({
|
|
20
|
-
size: props.size,
|
|
21
|
-
color: getColor(props.color),
|
|
22
|
-
}),
|
|
23
|
-
props.color,
|
|
24
|
-
),
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
25
11
|
);
|
|
12
|
+
const attrs = {};
|
|
26
13
|
|
|
27
|
-
const
|
|
14
|
+
for (const key in defaultConfig) {
|
|
15
|
+
if (isSystemKey(key)) continue;
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
const value = config.value[key];
|
|
19
|
+
|
|
20
|
+
if (value.variants || value.compoundVariants) {
|
|
21
|
+
return setColor(
|
|
22
|
+
cva(value)({
|
|
23
|
+
...props,
|
|
24
|
+
color: getColor(props.color),
|
|
25
|
+
}),
|
|
26
|
+
props.color,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return "";
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
34
|
+
}
|
|
28
35
|
|
|
29
36
|
return {
|
|
30
|
-
|
|
37
|
+
...attrs,
|
|
38
|
+
config,
|
|
31
39
|
};
|
|
32
40
|
}
|
package/ui.other-dot/index.vue
CHANGED
|
@@ -7,7 +7,7 @@ import UIService from "../service.ui";
|
|
|
7
7
|
|
|
8
8
|
import { UDot } from "./constants";
|
|
9
9
|
import defaultConfig from "./configs/default.config";
|
|
10
|
-
import
|
|
10
|
+
import useAttrs from "./composables/attrs.composable";
|
|
11
11
|
|
|
12
12
|
/* Should be a string for correct web-types gen */
|
|
13
13
|
defineOptions({ name: "UDot", inheritAttrs: false });
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.210",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -6332,12 +6332,12 @@
|
|
|
6332
6332
|
},
|
|
6333
6333
|
{
|
|
6334
6334
|
"name": "name",
|
|
6335
|
-
"
|
|
6335
|
+
"required": true,
|
|
6336
|
+
"description": "Unique radio group name (sets for each radio).",
|
|
6336
6337
|
"value": {
|
|
6337
6338
|
"kind": "expression",
|
|
6338
6339
|
"type": "string"
|
|
6339
|
-
}
|
|
6340
|
-
"default": "\"\""
|
|
6340
|
+
}
|
|
6341
6341
|
},
|
|
6342
6342
|
{
|
|
6343
6343
|
"name": "disabled",
|