vueless 0.0.179 → 0.0.180
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.data-table/configs/default.config.js +2 -2
- package/ui.form-calendar/components/DayView.vue +6 -6
- package/ui.form-calendar/components/MonthView.vue +9 -5
- package/ui.form-calendar/components/YearView.vue +8 -4
- package/ui.form-calendar/composables/attrs.composable.js +23 -18
- package/ui.form-calendar/configs/default.config.js +12 -17
- package/ui.form-calendar/index.vue +4 -4
- package/ui.form-checkbox-group/configs/default.config.js +2 -0
- package/ui.form-checkbox-group/index.vue +39 -22
- package/ui.form-color-picker/composables/attrs.composable.js +19 -14
- package/ui.form-color-picker/configs/default.config.js +21 -15
- package/ui.form-color-picker/index.stories.js +1 -1
- package/ui.form-color-picker/index.vue +78 -59
- package/ui.form-date-picker/index.vue +4 -3
- package/ui.form-input/index.stories.js +15 -5
- package/ui.form-input/index.vue +56 -28
- package/ui.form-radio/index.stories.js +4 -4
- package/ui.form-radio/index.vue +8 -4
- package/ui.form-radio-group/composables/attrs.composable.js +2 -0
- package/ui.form-radio-group/configs/default.config.js +3 -3
- package/ui.form-radio-group/index.stories.js +3 -3
- package/ui.form-radio-group/index.vue +29 -8
- package/ui.navigation-progress/composables/attrs.composable.js +38 -2
- package/ui.navigation-progress/configs/default.config.js +32 -0
- package/ui.navigation-progress/index.stories.js +127 -2
- package/ui.navigation-progress/index.vue +53 -5
- package/ui.text-alert/configs/default.config.js +7 -7
- package/ui.text-block/composables/attrs.composable.js +2 -0
- package/ui.text-block/configs/default.config.js +7 -7
- package/ui.text-block/index.stories.js +16 -16
- package/ui.text-block/index.vue +4 -4
- package/web-types.json +111 -45
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
+
wrapper: "h-auto flex flex-col gap-1.5 w-full",
|
|
2
3
|
progress: {
|
|
3
4
|
base: `
|
|
4
5
|
block appearance-none border-none overflow-hidden w-full
|
|
@@ -26,6 +27,37 @@ export default /*tw*/ {
|
|
|
26
27
|
},
|
|
27
28
|
},
|
|
28
29
|
},
|
|
30
|
+
indicator: {
|
|
31
|
+
base: "w-full flex justify-end font-medium text-brand-500 min-w-fit",
|
|
32
|
+
variants: {
|
|
33
|
+
color: {
|
|
34
|
+
white: "text-white",
|
|
35
|
+
grayscale: "text-gray-900",
|
|
36
|
+
},
|
|
37
|
+
size: {
|
|
38
|
+
xs: "text-xs",
|
|
39
|
+
sm: "text-sm",
|
|
40
|
+
md: "text-md",
|
|
41
|
+
lg: "text-lg",
|
|
42
|
+
xl: "text-xl",
|
|
43
|
+
"2xl": "text-2xl",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
firstStep: "text-gray-500",
|
|
48
|
+
step: {
|
|
49
|
+
base: "flex w-full justify-end text-brand-500",
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
xs: "text-xs",
|
|
53
|
+
sm: "text-sm",
|
|
54
|
+
md: "text-md",
|
|
55
|
+
lg: "text-lg",
|
|
56
|
+
xl: "text-xl",
|
|
57
|
+
"2xl": "text-2xl",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
29
61
|
defaultVariants: {
|
|
30
62
|
color: "brand",
|
|
31
63
|
size: "md",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import UProgress from "./index.vue";
|
|
2
2
|
import UButton from "../ui.button/index.vue";
|
|
3
|
+
import UIcon from "../ui.image-icon";
|
|
4
|
+
import URow from "../ui.container-row";
|
|
3
5
|
|
|
4
6
|
import { getArgTypes } from "../service.storybook";
|
|
5
7
|
|
|
@@ -16,7 +18,7 @@ export default {
|
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const DefaultTemplate = (args) => ({
|
|
19
|
-
components: { UProgress, UButton },
|
|
21
|
+
components: { UProgress, UButton, UIcon },
|
|
20
22
|
setup() {
|
|
21
23
|
return { args };
|
|
22
24
|
},
|
|
@@ -35,11 +37,134 @@ const DefaultTemplate = (args) => ({
|
|
|
35
37
|
},
|
|
36
38
|
},
|
|
37
39
|
template: `
|
|
38
|
-
<UProgress :value="progress"
|
|
40
|
+
<UProgress v-bind="args" :value="progress">
|
|
41
|
+
${args.slotTemplate}
|
|
42
|
+
</UProgress>
|
|
39
43
|
|
|
40
44
|
<UButton class="mt-4" @click="updateProgress">Update Progress</UButton>
|
|
41
45
|
`,
|
|
42
46
|
});
|
|
43
47
|
|
|
48
|
+
const StepsTemplate = (args) => ({
|
|
49
|
+
components: { UProgress, UButton, UIcon },
|
|
50
|
+
setup() {
|
|
51
|
+
return { args };
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
progress: 1,
|
|
56
|
+
max: ["Step 1", "Step 2", "Step 3"],
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
updateProgress() {
|
|
61
|
+
this.progress += 1;
|
|
62
|
+
|
|
63
|
+
if (this.progress > 3) {
|
|
64
|
+
this.progress = 0;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
template: `
|
|
69
|
+
<UProgress v-bind="args" :max="max" :value="progress">
|
|
70
|
+
${args.slotTemplate}
|
|
71
|
+
</UProgress>
|
|
72
|
+
|
|
73
|
+
<UButton class="mt-4" @click="updateProgress">Update Progress</UButton>
|
|
74
|
+
`,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
78
|
+
components: { UProgress, URow },
|
|
79
|
+
setup() {
|
|
80
|
+
return {
|
|
81
|
+
args,
|
|
82
|
+
colors: argTypes.color.options,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
data() {
|
|
86
|
+
return {
|
|
87
|
+
progress: 10,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
template: `
|
|
91
|
+
<URow class="!flex-col">
|
|
92
|
+
<UProgress
|
|
93
|
+
v-for="(color, index) in colors"
|
|
94
|
+
:key="index"
|
|
95
|
+
:color="color"
|
|
96
|
+
v-bind="args"
|
|
97
|
+
:value="progress"
|
|
98
|
+
/>
|
|
99
|
+
</URow>
|
|
100
|
+
`,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
104
|
+
components: { UProgress, URow },
|
|
105
|
+
setup() {
|
|
106
|
+
return {
|
|
107
|
+
args,
|
|
108
|
+
sizes: argTypes.size.options,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
data() {
|
|
112
|
+
return {
|
|
113
|
+
progress: 10,
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
template: `
|
|
117
|
+
<URow class="!flex-col">
|
|
118
|
+
<UProgress
|
|
119
|
+
v-for="(size, index) in sizes"
|
|
120
|
+
:key="index"
|
|
121
|
+
:size="size"
|
|
122
|
+
v-bind="args"
|
|
123
|
+
:value="progress"
|
|
124
|
+
/>
|
|
125
|
+
</URow>
|
|
126
|
+
`,
|
|
127
|
+
});
|
|
128
|
+
|
|
44
129
|
export const Default = DefaultTemplate.bind({});
|
|
45
130
|
Default.args = {};
|
|
131
|
+
|
|
132
|
+
export const Indicator = DefaultTemplate.bind({});
|
|
133
|
+
Indicator.args = { indicator: true };
|
|
134
|
+
|
|
135
|
+
export const Steps = StepsTemplate.bind({});
|
|
136
|
+
Steps.args = {};
|
|
137
|
+
|
|
138
|
+
export const Colors = ColorsTemplate.bind({});
|
|
139
|
+
Colors.args = {};
|
|
140
|
+
|
|
141
|
+
export const Sizes = SizesTemplate.bind({});
|
|
142
|
+
Sizes.args = {};
|
|
143
|
+
|
|
144
|
+
export const IndicatorSlot = DefaultTemplate.bind({});
|
|
145
|
+
IndicatorSlot.args = {
|
|
146
|
+
indicator: true,
|
|
147
|
+
slotTemplate: `
|
|
148
|
+
<template #indicator>
|
|
149
|
+
<UIcon
|
|
150
|
+
name="star"
|
|
151
|
+
color="black"
|
|
152
|
+
/>
|
|
153
|
+
</template>
|
|
154
|
+
`,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const stepSlot = StepsTemplate.bind({});
|
|
158
|
+
stepSlot.args = {
|
|
159
|
+
slotTemplate: `
|
|
160
|
+
<template #step-0>
|
|
161
|
+
💻
|
|
162
|
+
</template>
|
|
163
|
+
<template #step-1>
|
|
164
|
+
🧇
|
|
165
|
+
</template>
|
|
166
|
+
<template #step-2>
|
|
167
|
+
😴
|
|
168
|
+
</template>
|
|
169
|
+
`,
|
|
170
|
+
};
|
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div v-bind="wrapperAttrs">
|
|
3
|
+
<div v-if="indicator" v-bind="indicatorAttrs" :style="{ width: progressPercent }">
|
|
4
|
+
<slot name="indicator" :percent="progressPercent" :value="value" :max="realMax">
|
|
5
|
+
{{ progressPercent }}
|
|
6
|
+
</slot>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<progress v-bind="progressAttrs" :max="realMax" :value="value" />
|
|
10
|
+
|
|
11
|
+
<div v-if="isSteps" v-bind="stepAttrs(!value && config.firstStep)">
|
|
12
|
+
<template v-for="(step, index) in max" :key="index">
|
|
13
|
+
<slot
|
|
14
|
+
v-if="isActiveStep(index)"
|
|
15
|
+
:name="`step-${index}`"
|
|
16
|
+
:step="step"
|
|
17
|
+
:value="value"
|
|
18
|
+
:max="max"
|
|
19
|
+
>
|
|
20
|
+
{{ step }}
|
|
21
|
+
</slot>
|
|
22
|
+
</template>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
3
25
|
</template>
|
|
4
26
|
|
|
5
27
|
<script setup>
|
|
28
|
+
import { computed } from "vue";
|
|
29
|
+
|
|
6
30
|
import UIService from "../service.ui";
|
|
31
|
+
import { useAttrs } from "./composables/attrs.composable";
|
|
7
32
|
|
|
8
|
-
import { UProgress } from "./constants";
|
|
9
33
|
import defaultConfig from "./configs/default.config";
|
|
10
|
-
import {
|
|
34
|
+
import { UProgress } from "./constants";
|
|
11
35
|
|
|
12
36
|
/* Should be a string for correct web-types gen */
|
|
13
37
|
defineOptions({ name: "UProgress", inheritAttrs: false });
|
|
@@ -26,7 +50,7 @@ const props = defineProps({
|
|
|
26
50
|
* Progress max amount of steps.
|
|
27
51
|
*/
|
|
28
52
|
max: {
|
|
29
|
-
type: Number,
|
|
53
|
+
type: [Number, Array],
|
|
30
54
|
default: 100,
|
|
31
55
|
},
|
|
32
56
|
|
|
@@ -47,7 +71,31 @@ const props = defineProps({
|
|
|
47
71
|
type: String,
|
|
48
72
|
default: UIService.get(defaultConfig, UProgress).default.color,
|
|
49
73
|
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Progress indicator visibility.
|
|
77
|
+
*/
|
|
78
|
+
indicator: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: UIService.get(defaultConfig, UProgress).default.indicator,
|
|
81
|
+
},
|
|
50
82
|
});
|
|
51
83
|
|
|
52
|
-
const { progressAttrs } = useAttrs(props);
|
|
84
|
+
const { progressAttrs, wrapperAttrs, indicatorAttrs, stepAttrs, config } = useAttrs(props);
|
|
85
|
+
|
|
86
|
+
const isSteps = computed(() => Array.isArray(props.max));
|
|
87
|
+
|
|
88
|
+
const realMax = computed(() => {
|
|
89
|
+
if (isSteps.value) {
|
|
90
|
+
return props.max.length;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return Number(props.max);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const progressPercent = computed(() => `${(props.value / realMax.value) * 100}%`);
|
|
97
|
+
|
|
98
|
+
function isActiveStep(index) {
|
|
99
|
+
return index + 1 == props.value;
|
|
100
|
+
}
|
|
53
101
|
</script>
|
|
@@ -15,22 +15,22 @@ export default /*tw*/ {
|
|
|
15
15
|
},
|
|
16
16
|
body: {
|
|
17
17
|
base: `
|
|
18
|
-
flex gap-2 items-baseline
|
|
18
|
+
flex gap-2 items-baseline
|
|
19
|
+
font-normal leading-normal
|
|
19
20
|
[&_b]:font-bold [&_i]:italic [&_p]:font-normal
|
|
20
21
|
[&_a:not([class])]:underline [&_a:not([class])]:underline-offset-4
|
|
21
22
|
[&_a:not([class]):hover]:no-underline [&_a:not([class])]:font-bold
|
|
22
23
|
[&_ul]:font-normal [&_ol]:font-normal
|
|
23
|
-
[&_ul]:leading-
|
|
24
|
-
[&_ul]:list-inside [&_ol]:list-inside
|
|
24
|
+
[&_ul]:leading-normal [&_ol]:leading-normal
|
|
25
25
|
[&_ul]:list-disc [&_ol]:list-decimal
|
|
26
26
|
[&_ul]:ml-2 [&_ol]:ml-2
|
|
27
27
|
`,
|
|
28
28
|
variants: {
|
|
29
29
|
size: {
|
|
30
|
-
xs: "text-xs",
|
|
31
|
-
sm: "text-sm",
|
|
32
|
-
md: "text-base",
|
|
33
|
-
lg: "text-lg",
|
|
30
|
+
xs: "text-xs space-y-2",
|
|
31
|
+
sm: "text-sm space-y-3",
|
|
32
|
+
md: "text-base space-y-4",
|
|
33
|
+
lg: "text-lg space-y-5",
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
},
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: {
|
|
3
3
|
base: `
|
|
4
|
-
|
|
4
|
+
font-normal leading-normal
|
|
5
5
|
[&_b]:font-bold [&_i]:italic [&_p]:font-normal
|
|
6
6
|
[&_a:not([class])]:underline [&_a:not([class])]:underline-offset-4
|
|
7
7
|
[&_a:not([class]):hover]:no-underline [&_a:not([class])]:font-bold
|
|
8
8
|
[&_ul]:font-normal [&_ol]:font-normal
|
|
9
|
-
[&_ul]:leading-
|
|
10
|
-
[&_ul]:list-inside [&_ol]:list-inside
|
|
9
|
+
[&_ul]:leading-normal [&_ol]:leading-normal
|
|
11
10
|
[&_ul]:list-disc [&_ol]:list-decimal
|
|
12
11
|
[&_ul]:ml-2 [&_ol]:ml-2
|
|
13
12
|
`,
|
|
14
13
|
variants: {
|
|
15
14
|
size: {
|
|
16
|
-
xs: "text-xs",
|
|
17
|
-
sm: "text-sm",
|
|
18
|
-
md: "text-base",
|
|
19
|
-
lg: "text-lg",
|
|
15
|
+
xs: "text-xs space-y-2",
|
|
16
|
+
sm: "text-sm space-y-3",
|
|
17
|
+
md: "text-base space-y-4",
|
|
18
|
+
lg: "text-lg space-y-5",
|
|
20
19
|
},
|
|
21
20
|
align: {
|
|
22
21
|
left: "text-left",
|
|
@@ -28,6 +27,7 @@ export default /*tw*/ {
|
|
|
28
27
|
},
|
|
29
28
|
},
|
|
30
29
|
},
|
|
30
|
+
html: "",
|
|
31
31
|
defaultVariants: {
|
|
32
32
|
size: "md",
|
|
33
33
|
align: "left",
|
|
@@ -13,29 +13,29 @@ export default {
|
|
|
13
13
|
argTypes: {
|
|
14
14
|
...getArgTypes(UText.name),
|
|
15
15
|
},
|
|
16
|
-
args: {
|
|
17
|
-
slotTemplate: `
|
|
18
|
-
<template #default>
|
|
19
|
-
<p>
|
|
20
|
-
<b>Lorem ipsum dolor sit amet</b><u>, consectetur adipiscing elit,
|
|
21
|
-
</u><em> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</em>
|
|
22
|
-
<a href="https://uk.wikipedia.org/wiki/Lorem_ipsum" target="_blank">Wikipedia</a>
|
|
23
|
-
</p>
|
|
24
|
-
</template>
|
|
25
|
-
`,
|
|
26
|
-
},
|
|
16
|
+
args: {},
|
|
27
17
|
};
|
|
28
18
|
|
|
19
|
+
const defaultTemplate = `
|
|
20
|
+
<template #default>
|
|
21
|
+
<p>
|
|
22
|
+
<b>Lorem ipsum dolor sit amet</b>, consectetur adipiscing elit,
|
|
23
|
+
sed do <u>eiusmod</u> tempor incididunt ut <i>labore</i> et dolore magna aliqua.
|
|
24
|
+
<a href="https://uk.wikipedia.org/wiki/Lorem_ipsum" target="_blank">Wikipedia</a>
|
|
25
|
+
</p>
|
|
26
|
+
</template>
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
29
|
const DefaultTemplate = (args) => ({
|
|
30
|
-
components: { UText },
|
|
30
|
+
components: { UText, URow },
|
|
31
31
|
setup() {
|
|
32
32
|
const slots = getSlotNames(UText.name);
|
|
33
33
|
|
|
34
34
|
return { args, slots };
|
|
35
35
|
},
|
|
36
36
|
template: `
|
|
37
|
-
<UText v-bind="args"
|
|
38
|
-
${args.slotTemplate}
|
|
37
|
+
<UText v-bind="args">
|
|
38
|
+
${args.slotTemplate || defaultTemplate}
|
|
39
39
|
</UText>
|
|
40
40
|
`,
|
|
41
41
|
});
|
|
@@ -56,7 +56,7 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
|
56
56
|
v-bind="args"
|
|
57
57
|
:key="index"
|
|
58
58
|
>
|
|
59
|
-
${args.slotTemplate}
|
|
59
|
+
${args.slotTemplate || defaultTemplate}
|
|
60
60
|
</UText>
|
|
61
61
|
</URow>
|
|
62
62
|
`,
|
|
@@ -97,7 +97,7 @@ export const list = DefaultTemplate.bind({});
|
|
|
97
97
|
list.args = {
|
|
98
98
|
slotTemplate: `
|
|
99
99
|
<template #default>
|
|
100
|
-
<URow>
|
|
100
|
+
<URow gap="2xl">
|
|
101
101
|
<ul>
|
|
102
102
|
<li> Lorem ipsum dolor </li>
|
|
103
103
|
<li> Lorem ipsum dolor </li>
|
package/ui.text-block/index.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-bind="wrapperAttrs" :data-cy="dataCy">
|
|
3
|
-
<!-- @slot Use it to add something. -->
|
|
4
|
-
<div v-if="!hasSlotContent($slots['default'])" v-html="html" />
|
|
3
|
+
<!-- @slot Use it to add something inside. -->
|
|
4
|
+
<div v-if="!hasSlotContent($slots['default'])" v-bind="htmlAttrs" v-html="html" />
|
|
5
5
|
<slot />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
@@ -44,7 +44,7 @@ const props = defineProps({
|
|
|
44
44
|
},
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Remove line height.
|
|
47
|
+
* Remove line height (useful for 1-line text).
|
|
48
48
|
*/
|
|
49
49
|
line: {
|
|
50
50
|
type: Boolean,
|
|
@@ -68,5 +68,5 @@ const props = defineProps({
|
|
|
68
68
|
},
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
const { wrapperAttrs, hasSlotContent } = useAttrs(props);
|
|
71
|
+
const { wrapperAttrs, htmlAttrs, hasSlotContent } = useAttrs(props);
|
|
72
72
|
</script>
|