vueless 0.0.201 → 0.0.203
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/composable.ui/index.js +3 -2
- package/package.json +2 -2
- package/ui.button-link/composables/attrs.composable.js +64 -130
- package/ui.button-link/index.stories.js +2 -4
- package/ui.button-link/index.vue +29 -4
- package/ui.button-toggle/composables/attrs.composable.js +21 -33
- package/ui.button-toggle/configs/default.config.js +2 -2
- package/ui.button-toggle/index.vue +8 -2
- package/ui.button-toggle-item/composables/attrs.composable.js +50 -40
- package/ui.button-toggle-item/configs/default.config.js +1 -1
- package/ui.button-toggle-item/index.stories.js +2 -4
- package/ui.button-toggle-item/index.vue +11 -3
- package/ui.dropdown-badge/composables/attrs.composable.js +45 -45
- package/ui.dropdown-badge/configs/default.config.js +3 -3
- package/ui.dropdown-badge/index.stories.js +2 -4
- package/ui.dropdown-badge/index.vue +8 -2
- package/ui.dropdown-button/composables/attrs.composable.js +45 -45
- package/ui.dropdown-button/configs/default.config.js +3 -3
- package/ui.dropdown-button/index.stories.js +2 -4
- package/ui.dropdown-button/index.vue +8 -2
- package/ui.dropdown-item/index.vue +7 -1
- package/ui.dropdown-link/composables/attrs.composable.js +43 -45
- package/ui.dropdown-link/configs/default.config.js +3 -3
- package/ui.dropdown-link/index.stories.js +2 -4
- package/ui.dropdown-link/index.vue +8 -2
- package/ui.dropdown-list/composables/attrs.composable.js +43 -67
- package/ui.dropdown-list/configs/default.config.js +2 -2
- package/ui.dropdown-list/index.vue +19 -3
- package/ui.form-calendar/components/DayView.vue +4 -4
- package/ui.form-calendar/composables/attrs.composable.js +5 -4
- package/ui.navigation-progress/components/StepperProgress.vue +87 -0
- package/ui.navigation-progress/composables/attrs.composable.js +33 -56
- package/ui.navigation-progress/configs/default.config.js +34 -1
- package/ui.navigation-progress/constants/index.js +5 -0
- package/ui.navigation-progress/index.stories.js +3 -0
- package/ui.navigation-progress/index.vue +55 -9
- package/ui.text-alert/composables/attrs.composable.js +23 -39
- package/ui.text-alert/configs/default.config.js +3 -3
- package/ui.text-alert/index.vue +19 -8
- package/ui.text-badge/composables/attrs.composable.js +25 -36
- package/ui.text-badge/index.stories.js +2 -4
- package/ui.text-badge/index.vue +22 -2
- package/ui.text-block/composables/attrs.composable.js +24 -20
- package/ui.text-block/index.vue +1 -1
- package/ui.text-empty/composables/attrs.composable.js +17 -27
- package/ui.text-empty/configs/default.config.js +1 -1
- package/ui.text-empty/index.stories.js +2 -4
- package/ui.text-empty/index.vue +1 -1
- package/ui.text-file/composables/attrs.composable.js +23 -27
- package/ui.text-file/configs/default.config.js +2 -2
- package/ui.text-file/index.vue +1 -1
- package/ui.text-files/composables/attrs.composable.js +21 -15
- package/ui.text-files/configs/default.config.js +1 -1
- package/ui.text-files/index.vue +7 -3
- package/ui.text-header/composables/attrs.composable.js +28 -22
- package/ui.text-header/index.stories.js +1 -1
- package/ui.text-header/index.vue +1 -1
- package/ui.text-money/composables/attrs.composable.js +21 -48
- package/ui.text-money/index.stories.js +2 -4
- package/ui.text-notify/composables/attrs.composable.js +23 -21
- package/ui.text-notify/index.vue +1 -1
- package/web-types.json +183 -97
- package/ui.navigation-stepper/Docs.mdx +0 -16
- package/ui.navigation-stepper/composables/attrs.composable.js +0 -25
- package/ui.navigation-stepper/configs/default.config.js +0 -13
- package/ui.navigation-stepper/constants/index.js +0 -5
- package/ui.navigation-stepper/index.stories.js +0 -33
- package/ui.navigation-stepper/index.vue +0 -126
|
@@ -4,49 +4,38 @@ 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, hasSlotContent, getColor, setColor } = useUI(
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, hasSlotContent, getColor, setColor, isSystemKey } = useUI(
|
|
9
9
|
defaultConfig,
|
|
10
10
|
() => props.config,
|
|
11
11
|
);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const cvaWrapper = cva({
|
|
15
|
-
base: wrapper.base,
|
|
16
|
-
variants: wrapper.variants,
|
|
17
|
-
compoundVariants: wrapper.compoundVariants,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const cvaBody = cva({
|
|
21
|
-
base: body.base,
|
|
22
|
-
variants: body.variants,
|
|
23
|
-
compoundVariants: body.compoundVariants,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const wrapperClasses = computed(() =>
|
|
27
|
-
setColor(
|
|
28
|
-
cvaWrapper({
|
|
29
|
-
variant: props.variant,
|
|
30
|
-
size: props.size,
|
|
31
|
-
color: getColor(props.color),
|
|
32
|
-
weight: props.weight,
|
|
33
|
-
}),
|
|
34
|
-
props.color,
|
|
35
|
-
),
|
|
36
|
-
);
|
|
12
|
+
const attrs = {};
|
|
37
13
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
+
});
|
|
43
32
|
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
34
|
+
}
|
|
46
35
|
|
|
47
36
|
return {
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
...attrs,
|
|
38
|
+
config,
|
|
50
39
|
hasSlotContent,
|
|
51
40
|
};
|
|
52
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
1
|
+
import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
|
|
2
2
|
|
|
3
3
|
import UBadge from "../ui.text-badge";
|
|
4
4
|
import UIcon from "../ui.image-icon";
|
|
@@ -29,9 +29,7 @@ const DefaultTemplate = (args) => ({
|
|
|
29
29
|
},
|
|
30
30
|
template: `
|
|
31
31
|
<UBadge v-bind="args">
|
|
32
|
-
|
|
33
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
34
|
-
</template>
|
|
32
|
+
${allSlotsFragment}
|
|
35
33
|
</UBadge>
|
|
36
34
|
`,
|
|
37
35
|
});
|
package/ui.text-badge/index.vue
CHANGED
|
@@ -32,7 +32,7 @@ import { ref } from "vue";
|
|
|
32
32
|
import UIService from "../service.ui";
|
|
33
33
|
|
|
34
34
|
import { UBadge } from "./constants";
|
|
35
|
-
import
|
|
35
|
+
import useAttrs from "./composables/attrs.composable";
|
|
36
36
|
import defaultConfig from "./configs/default.config";
|
|
37
37
|
|
|
38
38
|
/* Should be a string for correct web-types gen */
|
|
@@ -101,7 +101,27 @@ const props = defineProps({
|
|
|
101
101
|
},
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
const emit = defineEmits([
|
|
104
|
+
const emit = defineEmits([
|
|
105
|
+
/**
|
|
106
|
+
* Triggers when the badge is focused.
|
|
107
|
+
*/
|
|
108
|
+
"focus",
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Triggers when the badge is pressed.
|
|
112
|
+
*/
|
|
113
|
+
"keydown",
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Triggers when the badge loses focus.
|
|
117
|
+
*/
|
|
118
|
+
"blur",
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Triggers when the badge is clicked.
|
|
122
|
+
*/
|
|
123
|
+
"click",
|
|
124
|
+
]);
|
|
105
125
|
|
|
106
126
|
const { bodyAttrs, wrapperAttrs, hasSlotContent } = useAttrs(props);
|
|
107
127
|
|
|
@@ -4,30 +4,34 @@ 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, hasSlotContent } = 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
|
-
cvaWrapper({
|
|
19
|
-
align: props.align,
|
|
20
|
-
size: props.size,
|
|
21
|
-
line: props.line,
|
|
22
|
-
}),
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, hasSlotContent, isSystemKey } = useUI(
|
|
9
|
+
defaultConfig,
|
|
10
|
+
() => props.config,
|
|
23
11
|
);
|
|
12
|
+
const attrs = {};
|
|
24
13
|
|
|
25
|
-
const
|
|
26
|
-
|
|
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 cva(value)({
|
|
22
|
+
...props,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return "";
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
30
|
+
}
|
|
27
31
|
|
|
28
32
|
return {
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
...attrs,
|
|
34
|
+
config,
|
|
31
35
|
hasSlotContent,
|
|
32
36
|
};
|
|
33
37
|
}
|
package/ui.text-block/index.vue
CHANGED
|
@@ -11,7 +11,7 @@ import UIService from "../service.ui";
|
|
|
11
11
|
|
|
12
12
|
import { UText } from "./constatns";
|
|
13
13
|
import defaultConfig from "./configs/default.config";
|
|
14
|
-
import
|
|
14
|
+
import useAttrs from "./composables/attrs.composable";
|
|
15
15
|
|
|
16
16
|
/* Should be a string for correct web-types gen */
|
|
17
17
|
defineOptions({ name: "UText" });
|
|
@@ -4,40 +4,30 @@ 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 } = useUI(defaultConfig, () => props.config);
|
|
9
|
-
const
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
|
|
9
|
+
const attrs = {};
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
variants: title.variants,
|
|
14
|
-
compoundVariants: title.compoundVariants,
|
|
15
|
-
});
|
|
11
|
+
for (const key in defaultConfig) {
|
|
12
|
+
if (isSystemKey(key)) continue;
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
variants: description.variants,
|
|
20
|
-
compoundVariants: description.compoundVariants,
|
|
21
|
-
});
|
|
14
|
+
const classes = computed(() => {
|
|
15
|
+
const value = config.value[key];
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
if (value.variants || value.compoundVariants) {
|
|
18
|
+
return cva(value)({
|
|
19
|
+
...props,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
return "";
|
|
24
|
+
});
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const iconAttrs = getAttrs("icon", { isComponent: true });
|
|
30
|
-
const footerAttrs = getAttrs("footer");
|
|
31
|
-
const titleAttrs = getAttrs("title", { classes: titleClasses });
|
|
32
|
-
const descriptionAttrs = getAttrs("description", { classes: descriptionClasses });
|
|
26
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
27
|
+
}
|
|
33
28
|
|
|
34
29
|
return {
|
|
30
|
+
...attrs,
|
|
35
31
|
config,
|
|
36
|
-
titleAttrs,
|
|
37
|
-
descriptionAttrs,
|
|
38
|
-
wrapperAttrs,
|
|
39
|
-
headerAttrs,
|
|
40
|
-
footerAttrs,
|
|
41
|
-
iconAttrs,
|
|
42
32
|
};
|
|
43
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
1
|
+
import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
|
|
2
2
|
|
|
3
3
|
import UEmpty from "../ui.text-empty";
|
|
4
4
|
import UButton from "../ui.button";
|
|
@@ -30,9 +30,7 @@ const DefaultTemplate = (args) => ({
|
|
|
30
30
|
},
|
|
31
31
|
template: `
|
|
32
32
|
<UEmpty v-bind="args">
|
|
33
|
-
|
|
34
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
35
|
-
</template>
|
|
33
|
+
${allSlotsFragment}
|
|
36
34
|
</UEmpty>
|
|
37
35
|
`,
|
|
38
36
|
});
|
package/ui.text-empty/index.vue
CHANGED
|
@@ -39,7 +39,7 @@ import UIService from "../service.ui";
|
|
|
39
39
|
|
|
40
40
|
import { UEmpty } from "./constants";
|
|
41
41
|
import defaultConfig from "./configs/default.config";
|
|
42
|
-
import
|
|
42
|
+
import useAttrs from "./composables/attrs.composable";
|
|
43
43
|
|
|
44
44
|
/* Should be a string for correct web-types gen */
|
|
45
45
|
defineOptions({ name: "UEmpty", inheritAttrs: false });
|
|
@@ -4,35 +4,31 @@ import { cva } from "../../service.ui";
|
|
|
4
4
|
|
|
5
5
|
import defaultConfig from "../configs/default.config";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props, { focus }) {
|
|
8
|
-
const { config, getAttrs } = useUI(defaultConfig, () => props.config);
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
7
|
+
export default function useAttrs(props, { focus }) {
|
|
8
|
+
const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
|
|
9
|
+
const attrs = {};
|
|
10
|
+
|
|
11
|
+
for (const key in defaultConfig) {
|
|
12
|
+
if (isSystemKey(key)) continue;
|
|
13
|
+
|
|
14
|
+
const classes = computed(() => {
|
|
15
|
+
const value = config.value[key];
|
|
16
|
+
|
|
17
|
+
if (value.variants || value.compoundVariants) {
|
|
18
|
+
return cva(value)({
|
|
19
|
+
...props,
|
|
20
|
+
focus: Boolean(focus.value),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return "";
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
28
|
+
}
|
|
29
29
|
|
|
30
30
|
return {
|
|
31
|
+
...attrs,
|
|
31
32
|
config,
|
|
32
|
-
fileAttrs,
|
|
33
|
-
infoAttrs,
|
|
34
|
-
iconAttrs,
|
|
35
|
-
labelAttrs,
|
|
36
|
-
imageAttrs,
|
|
37
33
|
};
|
|
38
34
|
}
|
package/ui.text-file/index.vue
CHANGED
|
@@ -31,7 +31,7 @@ import UIcon from "../ui.image-icon";
|
|
|
31
31
|
|
|
32
32
|
import UIService, { getRandomId } from "../service.ui";
|
|
33
33
|
|
|
34
|
-
import
|
|
34
|
+
import useAttrs from "./composables/attrs.composable";
|
|
35
35
|
import { UFile } from "./constants";
|
|
36
36
|
import defaultConfig from "./configs/default.config";
|
|
37
37
|
|
|
@@ -4,25 +4,31 @@ import { cva } from "../../service.ui";
|
|
|
4
4
|
|
|
5
5
|
import defaultConfig from "../configs/default.config";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props) {
|
|
8
|
-
const { getAttrs, config } = useUI(defaultConfig, () => props.config);
|
|
9
|
-
const
|
|
7
|
+
export default function useAttrs(props) {
|
|
8
|
+
const { getAttrs, config, isSystemKey } = useUI(defaultConfig, () => props.config);
|
|
9
|
+
const attrs = {};
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
variants: body.variants,
|
|
14
|
-
compoundVariants: body.compoundVariants,
|
|
15
|
-
});
|
|
11
|
+
for (const key in defaultConfig) {
|
|
12
|
+
if (isSystemKey(key)) continue;
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
const classes = computed(() => {
|
|
15
|
+
const value = config.value[key];
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
if (value.variants || value.compoundVariants) {
|
|
18
|
+
return cva(value)({
|
|
19
|
+
...props,
|
|
20
|
+
label: Boolean(props.label),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return "";
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
28
|
+
}
|
|
22
29
|
|
|
23
30
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fileAttrs,
|
|
31
|
+
...attrs,
|
|
32
|
+
config,
|
|
27
33
|
};
|
|
28
34
|
}
|
package/ui.text-files/index.vue
CHANGED
|
@@ -14,12 +14,16 @@
|
|
|
14
14
|
:data-cy="`${dataCy}-item`"
|
|
15
15
|
>
|
|
16
16
|
<template #left="{ file: currentFile }">
|
|
17
|
-
<!-- @slot Use it to add something left.
|
|
17
|
+
<!-- @slot Use it to add something left.
|
|
18
|
+
@binding {object} file
|
|
19
|
+
-->
|
|
18
20
|
<slot name="left" :file="currentFile" />
|
|
19
21
|
</template>
|
|
20
22
|
|
|
21
23
|
<template #right="{ file: currentFile }">
|
|
22
|
-
<!-- @slot Use it to add something right.
|
|
24
|
+
<!-- @slot Use it to add something right.
|
|
25
|
+
@binding {object} file
|
|
26
|
+
-->
|
|
23
27
|
<slot name="right" :file="currentFile" />
|
|
24
28
|
</template>
|
|
25
29
|
</UFile>
|
|
@@ -35,7 +39,7 @@ import UIService from "../service.ui";
|
|
|
35
39
|
|
|
36
40
|
import { UFiles } from "./constants";
|
|
37
41
|
import defaultConfig from "./configs/default.config";
|
|
38
|
-
import
|
|
42
|
+
import useAttrs from "./composables/attrs.composable";
|
|
39
43
|
import { computed } from "vue";
|
|
40
44
|
|
|
41
45
|
/* Should be a string for correct web-types gen */
|
|
@@ -4,31 +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
|
-
weight: props.weight,
|
|
22
|
-
underlined: props.underlined,
|
|
23
|
-
color: getColor(props.color),
|
|
24
|
-
}),
|
|
25
|
-
props.color,
|
|
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
|
|
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
|
+
}
|
|
30
35
|
|
|
31
36
|
return {
|
|
32
|
-
|
|
37
|
+
...attrs,
|
|
38
|
+
config,
|
|
33
39
|
};
|
|
34
40
|
}
|
|
@@ -105,7 +105,7 @@ Sizes.args = {};
|
|
|
105
105
|
export const Underlined = SizesTemplate.bind({});
|
|
106
106
|
Underlined.args = { underlined: true };
|
|
107
107
|
|
|
108
|
-
export const Multiline =
|
|
108
|
+
export const Multiline = DefaultTemplate.bind({});
|
|
109
109
|
Multiline.args = {
|
|
110
110
|
size: "2xl",
|
|
111
111
|
multiline: true,
|
package/ui.text-header/index.vue
CHANGED
|
@@ -13,7 +13,7 @@ import UIService from "../service.ui";
|
|
|
13
13
|
|
|
14
14
|
import { UHeader } 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: "UHeader", inheritAttrs: false });
|
|
@@ -5,64 +5,37 @@ import defaultConfig from "../configs/default.config";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, hasSlotContent, getAttrs, getColor, setColor } = useUI(
|
|
8
|
+
const { config, hasSlotContent, getAttrs, getColor, setColor, isSystemKey } = useUI(
|
|
9
9
|
defaultConfig,
|
|
10
10
|
() => props.config,
|
|
11
11
|
);
|
|
12
|
-
const
|
|
12
|
+
const attrs = {};
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
variants: money.variants,
|
|
17
|
-
compoundVariants: money.compoundVariants,
|
|
18
|
-
});
|
|
14
|
+
for (const key in defaultConfig) {
|
|
15
|
+
if (isSystemKey(key)) continue;
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
variants: sum.variants,
|
|
23
|
-
compoundVariants: sum.compoundVariants,
|
|
24
|
-
});
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
const value = config.value[key];
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
cvaMoney({
|
|
35
|
-
align: props.align,
|
|
36
|
-
color: getColor(props.color),
|
|
37
|
-
weight: props.weight,
|
|
38
|
-
}),
|
|
39
|
-
props.color,
|
|
40
|
-
),
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const sumClasses = computed(() =>
|
|
44
|
-
cvaSum({
|
|
45
|
-
planned: props.planned,
|
|
46
|
-
size: props.size,
|
|
47
|
-
}),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const pennyClasses = computed(() => cvaPenny({ size: props.size }));
|
|
30
|
+
return "";
|
|
31
|
+
});
|
|
51
32
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const slotRightAttrs = getAttrs("slotRight");
|
|
55
|
-
const sumAttrs = getAttrs("sum", { classes: sumClasses });
|
|
56
|
-
const pennyAttrs = getAttrs("penny", { classes: pennyClasses });
|
|
57
|
-
const symbolAttrs = getAttrs("symbol");
|
|
33
|
+
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
34
|
+
}
|
|
58
35
|
|
|
59
36
|
return {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
moneyAttrs,
|
|
63
|
-
slotLeftAttrs,
|
|
64
|
-
symbolAttrs,
|
|
65
|
-
slotRightAttrs,
|
|
37
|
+
...attrs,
|
|
38
|
+
config,
|
|
66
39
|
hasSlotContent,
|
|
67
40
|
};
|
|
68
41
|
}
|
|
@@ -4,7 +4,7 @@ import URow from "../ui.container-row";
|
|
|
4
4
|
import DebitIcon from "../ui.text-money/assets/debit.svg?component";
|
|
5
5
|
import CreditIcon from "../ui.text-money/assets/credit.svg?component";
|
|
6
6
|
|
|
7
|
-
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
7
|
+
import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
|
|
8
8
|
|
|
9
9
|
const COMPONENT_CLASSES = "flex justify-center w-1/6";
|
|
10
10
|
|
|
@@ -35,9 +35,7 @@ const DefaultTemplate = (args) => ({
|
|
|
35
35
|
template: `
|
|
36
36
|
<div class="${COMPONENT_CLASSES}">
|
|
37
37
|
<UMoney v-bind="args">
|
|
38
|
-
|
|
39
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
40
|
-
</template>
|
|
38
|
+
${allSlotsFragment}
|
|
41
39
|
</UMoney>
|
|
42
40
|
</div>
|
|
43
41
|
`,
|