vueless 0.0.374 → 0.0.375
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/composables/useUI.js +4 -2
- package/package.json +1 -1
- package/ui.form-input/useAttrs.js +8 -25
- package/ui.form-input-file/useAttrs.js +7 -25
- package/ui.form-input-money/useAttrs.js +4 -25
- package/ui.form-input-number/useAttrs.js +3 -25
- package/ui.form-input-rating/useAttrs.js +3 -25
- package/ui.form-input-search/useAttrs.js +4 -25
- package/ui.form-label/useAttrs.js +7 -25
- package/ui.form-radio/useAttrs.js +9 -27
- package/ui.form-radio-group/useAttrs.js +3 -26
- package/web-types.json +1 -1
package/composables/useUI.js
CHANGED
|
@@ -62,17 +62,19 @@ export default function useUI(defaultConfig = {}, propsConfigGetter = null, topL
|
|
|
62
62
|
*/
|
|
63
63
|
function getClasses(key, mutatedProps = {}) {
|
|
64
64
|
return computed(() => {
|
|
65
|
+
const color = toValue(mutatedProps)?.color || props.color;
|
|
66
|
+
|
|
65
67
|
let value = config.value[key];
|
|
66
68
|
|
|
67
69
|
if (isCVA(value)) {
|
|
68
70
|
value = cva(value)({
|
|
69
71
|
...props,
|
|
70
72
|
...toValue(mutatedProps),
|
|
71
|
-
color:
|
|
73
|
+
color: color ? getColor(color) : null,
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
return
|
|
77
|
+
return color ? setColor(value, color) : value;
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
|
package/package.json
CHANGED
|
@@ -1,38 +1,21 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import useUI from "../composables/useUI.js";
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import defaultConfig from "./config.js";
|
|
5
5
|
|
|
6
6
|
export default function useAttrs(props) {
|
|
7
|
-
const { config,
|
|
8
|
-
defaultConfig,
|
|
9
|
-
() => props.config,
|
|
10
|
-
);
|
|
11
|
-
const attrs = {};
|
|
12
|
-
|
|
13
|
-
for (const key in defaultConfig) {
|
|
14
|
-
if (isSystemKey(key)) continue;
|
|
15
|
-
|
|
16
|
-
const classes = computed(() => {
|
|
17
|
-
let value = config.value[key];
|
|
18
|
-
|
|
19
|
-
if (isCVA(value)) {
|
|
20
|
-
value = cva(value)({
|
|
21
|
-
...props,
|
|
22
|
-
error: Boolean(props.error),
|
|
23
|
-
label: Boolean(props.label),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
7
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
26
8
|
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
const mutatedProps = computed(() => ({
|
|
10
|
+
error: Boolean(props.error),
|
|
11
|
+
label: Boolean(props.label),
|
|
12
|
+
}));
|
|
29
13
|
|
|
30
|
-
|
|
31
|
-
}
|
|
14
|
+
const keysAttrs = getKeysAttrs(mutatedProps);
|
|
32
15
|
|
|
33
16
|
return {
|
|
34
|
-
...attrs,
|
|
35
17
|
config,
|
|
18
|
+
...keysAttrs,
|
|
36
19
|
hasSlotContent,
|
|
37
20
|
};
|
|
38
21
|
}
|
|
@@ -1,39 +1,21 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import useUI from "../composables/useUI.js";
|
|
3
|
-
import { cva } from "../utils/utilUI.js";
|
|
4
3
|
|
|
5
4
|
import defaultConfig from "./config.js";
|
|
6
5
|
|
|
7
6
|
export default function useAttrs(props) {
|
|
8
|
-
const { config,
|
|
9
|
-
defaultConfig,
|
|
10
|
-
() => props.config,
|
|
11
|
-
);
|
|
12
|
-
const attrs = {};
|
|
7
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const mutatedProps = computed(() => ({
|
|
10
|
+
error: Boolean(props.error),
|
|
11
|
+
label: Boolean(props.label),
|
|
12
|
+
}));
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
let value = config.value[key];
|
|
19
|
-
|
|
20
|
-
if (isCVA(value)) {
|
|
21
|
-
value = cva(value)({
|
|
22
|
-
...props,
|
|
23
|
-
error: Boolean(props.error),
|
|
24
|
-
label: Boolean(props.label),
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return value;
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
32
|
-
}
|
|
14
|
+
const keysAttrs = getKeysAttrs(mutatedProps);
|
|
33
15
|
|
|
34
16
|
return {
|
|
35
|
-
...attrs,
|
|
36
17
|
config,
|
|
18
|
+
...keysAttrs,
|
|
37
19
|
hasSlotContent,
|
|
38
20
|
};
|
|
39
21
|
}
|
|
@@ -1,36 +1,15 @@
|
|
|
1
1
|
import useUI from "../composables/useUI.js";
|
|
2
|
-
|
|
3
|
-
import { cva } from "../utils/utilUI.js";
|
|
2
|
+
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
5
4
|
|
|
6
5
|
export default function useAttrs(props) {
|
|
7
|
-
const { config,
|
|
8
|
-
defaultConfig,
|
|
9
|
-
() => props.config,
|
|
10
|
-
);
|
|
11
|
-
const attrs = {};
|
|
12
|
-
|
|
13
|
-
for (const key in defaultConfig) {
|
|
14
|
-
if (isSystemKey(key)) continue;
|
|
15
|
-
|
|
16
|
-
const classes = computed(() => {
|
|
17
|
-
let value = config.value[key];
|
|
18
|
-
|
|
19
|
-
if (isCVA(value)) {
|
|
20
|
-
value = cva(value)({
|
|
21
|
-
...props,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return value;
|
|
26
|
-
});
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
27
7
|
|
|
28
|
-
|
|
29
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
30
9
|
|
|
31
10
|
return {
|
|
32
|
-
...attrs,
|
|
33
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
34
13
|
hasSlotContent,
|
|
35
14
|
};
|
|
36
15
|
}
|
|
@@ -1,37 +1,15 @@
|
|
|
1
1
|
import useUI from "../composables/useUI.js";
|
|
2
|
-
import { cva } from "../utils/utilUI.js";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
5
|
-
import { computed } from "vue";
|
|
6
4
|
|
|
7
5
|
export default function useAttrs(props) {
|
|
8
|
-
const { config,
|
|
9
|
-
defaultConfig,
|
|
10
|
-
() => props.config,
|
|
11
|
-
);
|
|
12
|
-
const attrs = {};
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
if (isSystemKey(key)) continue;
|
|
16
|
-
|
|
17
|
-
const classes = computed(() => {
|
|
18
|
-
let value = config.value[key];
|
|
19
|
-
|
|
20
|
-
if (isCVA(value)) {
|
|
21
|
-
value = cva(value)({
|
|
22
|
-
...props,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return value;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
30
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
31
9
|
|
|
32
10
|
return {
|
|
33
|
-
...attrs,
|
|
34
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
35
13
|
hasSlotContent,
|
|
36
14
|
};
|
|
37
15
|
}
|
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.js";
|
|
3
|
-
import { cva } from "../utils/utilUI.js";
|
|
4
2
|
import defaultConfig from "./config.js";
|
|
5
3
|
|
|
6
4
|
export default function useAttrs(props) {
|
|
7
|
-
const { config,
|
|
8
|
-
defaultConfig,
|
|
9
|
-
() => props.config,
|
|
10
|
-
);
|
|
11
|
-
const attrs = {};
|
|
5
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
if (isSystemKey(key)) continue;
|
|
15
|
-
|
|
16
|
-
const classes = computed(() => {
|
|
17
|
-
let value = config.value[key];
|
|
18
|
-
|
|
19
|
-
if (isCVA(value)) {
|
|
20
|
-
value = cva(value)({
|
|
21
|
-
...props,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return value;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
29
|
-
}
|
|
7
|
+
const keysAttrs = getKeysAttrs();
|
|
30
8
|
|
|
31
9
|
return {
|
|
32
|
-
...attrs,
|
|
33
10
|
config,
|
|
11
|
+
...keysAttrs,
|
|
34
12
|
hasSlotContent,
|
|
35
13
|
};
|
|
36
14
|
}
|
|
@@ -1,36 +1,15 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.js";
|
|
3
|
-
|
|
2
|
+
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
5
4
|
|
|
6
5
|
export default function useAttrs(props) {
|
|
7
|
-
const { config,
|
|
8
|
-
defaultConfig,
|
|
9
|
-
() => props.config,
|
|
10
|
-
);
|
|
11
|
-
const attrs = {};
|
|
12
|
-
|
|
13
|
-
for (const key in defaultConfig) {
|
|
14
|
-
if (isSystemKey(key)) continue;
|
|
15
|
-
|
|
16
|
-
const classes = computed(() => {
|
|
17
|
-
let value = config.value[key];
|
|
18
|
-
|
|
19
|
-
if (isCVA(value)) {
|
|
20
|
-
value = cva(value)({
|
|
21
|
-
...props,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return value;
|
|
26
|
-
});
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
27
7
|
|
|
28
|
-
|
|
29
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
30
9
|
|
|
31
10
|
return {
|
|
32
|
-
...attrs,
|
|
33
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
34
13
|
hasSlotContent,
|
|
35
14
|
};
|
|
36
15
|
}
|
|
@@ -1,38 +1,20 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
1
2
|
import useUI from "../composables/useUI.js";
|
|
2
|
-
import { cva } from "../utils/utilUI.js";
|
|
3
3
|
|
|
4
4
|
import defaultConfig from "./config.js";
|
|
5
|
-
import { computed } from "vue";
|
|
6
5
|
|
|
7
6
|
export default function useAttrs(props) {
|
|
8
|
-
const { config,
|
|
9
|
-
defaultConfig,
|
|
10
|
-
() => props.config,
|
|
11
|
-
);
|
|
12
|
-
const attrs = {};
|
|
13
|
-
|
|
14
|
-
for (const key in defaultConfig) {
|
|
15
|
-
if (isSystemKey(key)) continue;
|
|
16
|
-
|
|
17
|
-
const classes = computed(() => {
|
|
18
|
-
let value = config.value[key];
|
|
19
|
-
|
|
20
|
-
if (isCVA(value)) {
|
|
21
|
-
value = cva(value)({
|
|
22
|
-
...props,
|
|
23
|
-
error: Boolean(props.error),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
7
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
26
8
|
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
const mutatedProps = computed(() => ({
|
|
10
|
+
error: Boolean(props.error),
|
|
11
|
+
}));
|
|
29
12
|
|
|
30
|
-
|
|
31
|
-
}
|
|
13
|
+
const keysAttrs = getKeysAttrs(mutatedProps);
|
|
32
14
|
|
|
33
15
|
return {
|
|
34
|
-
...attrs,
|
|
35
16
|
config,
|
|
17
|
+
...keysAttrs,
|
|
36
18
|
hasSlotContent,
|
|
37
19
|
};
|
|
38
20
|
}
|
|
@@ -1,41 +1,23 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import useUI from "../composables/useUI.js";
|
|
3
|
-
import { cva } from "../utils/utilUI.js";
|
|
4
3
|
|
|
5
4
|
import defaultConfig from "./config.js";
|
|
6
5
|
|
|
7
6
|
export default function useAttrs(props, { radioColor, radioSize }) {
|
|
8
|
-
const { config,
|
|
9
|
-
defaultConfig,
|
|
10
|
-
() => props.config,
|
|
11
|
-
);
|
|
12
|
-
const attrs = {};
|
|
7
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const mutatedProps = computed(() => ({
|
|
10
|
+
color: radioColor.value,
|
|
11
|
+
size: radioSize.value,
|
|
12
|
+
label: Boolean(props.label),
|
|
13
|
+
error: Boolean(props.error),
|
|
14
|
+
}));
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
let value = config.value[key];
|
|
19
|
-
|
|
20
|
-
if (isCVA(value)) {
|
|
21
|
-
value = cva(value)({
|
|
22
|
-
...props,
|
|
23
|
-
size: radioSize.value,
|
|
24
|
-
label: Boolean(props.label),
|
|
25
|
-
error: Boolean(props.error),
|
|
26
|
-
color: getColor(radioColor.value),
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return setColor(value, radioColor.value);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
34
|
-
}
|
|
16
|
+
const keysAttrs = getKeysAttrs(mutatedProps);
|
|
35
17
|
|
|
36
18
|
return {
|
|
37
|
-
...attrs,
|
|
38
19
|
config,
|
|
20
|
+
...keysAttrs,
|
|
39
21
|
hasSlotContent,
|
|
40
22
|
};
|
|
41
23
|
}
|
|
@@ -1,38 +1,15 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
|
|
3
|
-
import { cva } from "../utils/utilUI.js";
|
|
4
1
|
import useUI from "../composables/useUI.js";
|
|
5
2
|
|
|
6
3
|
import defaultConfig from "./config.js";
|
|
7
4
|
|
|
8
5
|
export default function useAttrs(props) {
|
|
9
|
-
const { config,
|
|
10
|
-
defaultConfig,
|
|
11
|
-
() => props.config,
|
|
12
|
-
);
|
|
13
|
-
const attrs = {};
|
|
14
|
-
|
|
15
|
-
for (const key in defaultConfig) {
|
|
16
|
-
if (isSystemKey(key)) continue;
|
|
17
|
-
|
|
18
|
-
const classes = computed(() => {
|
|
19
|
-
let value = config.value[key];
|
|
20
|
-
|
|
21
|
-
if (isCVA(value)) {
|
|
22
|
-
value = cva(value)({
|
|
23
|
-
...props,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return value;
|
|
28
|
-
});
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
29
7
|
|
|
30
|
-
|
|
31
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
32
9
|
|
|
33
10
|
return {
|
|
34
|
-
...attrs,
|
|
35
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
36
13
|
hasSlotContent,
|
|
37
14
|
};
|
|
38
15
|
}
|