vueless 0.0.176 → 0.0.178
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/index.stories.js +20 -10
- package/ui.button/index.vue +27 -6
- package/ui.data-table/index.vue +2 -2
- package/ui.dropdown-list/configs/default.config.js +2 -2
- package/ui.form-checkbox/configs/default.config.js +3 -2
- package/ui.form-checkbox/index.vue +3 -1
- package/ui.form-input/configs/default.config.js +3 -3
- package/ui.form-label/configs/default.config.js +31 -25
- package/ui.form-label/index.vue +3 -13
- package/ui.form-radio/configs/default.config.js +3 -0
- package/ui.form-radio/index.vue +1 -1
- package/ui.form-select/configs/default.config.js +8 -8
- package/ui.form-select/index.vue +13 -3
- package/ui.form-textarea/configs/default.config.js +10 -13
- package/ui.loader-rendering/Docs.mdx +2 -1
- package/ui.loader-rendering/index.stories.js +20 -15
- package/ui.loader-top/Docs.mdx +40 -8
- package/ui.loader-top/composables/useLoaderTop.js +10 -23
- package/ui.loader-top/index.stories.js +28 -23
- package/ui.loader-top/index.vue +21 -21
- package/web-types.json +32 -125
- package/ui.form-radio-card/Docs.mdx +0 -16
- package/ui.form-radio-card/composables/attrs.composable.js +0 -37
- package/ui.form-radio-card/configs/default.config.js +0 -31
- package/ui.form-radio-card/constants/index.js +0 -5
- package/ui.form-radio-card/index.stories.js +0 -152
- package/ui.form-radio-card/index.vue +0 -142
- package/ui.form-radio-card/services/variant.service.js +0 -15
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
2
|
-
|
|
3
|
-
import URadioCard from "../ui.form-radio-card";
|
|
4
|
-
import UIcon from "../ui.image-icon";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The `URadioCard` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.form-radio-card)
|
|
8
|
-
*/
|
|
9
|
-
export default {
|
|
10
|
-
id: "3150",
|
|
11
|
-
title: "Form Inputs & Controls / Radio Card",
|
|
12
|
-
component: URadioCard,
|
|
13
|
-
args: {
|
|
14
|
-
value: "radio card 1",
|
|
15
|
-
name: "radio",
|
|
16
|
-
options: [
|
|
17
|
-
{
|
|
18
|
-
iconName: "star",
|
|
19
|
-
iconFill: true,
|
|
20
|
-
value: "radio card 1",
|
|
21
|
-
description: "some description 1",
|
|
22
|
-
label: "title 1",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
iconName: "star",
|
|
26
|
-
iconFill: true,
|
|
27
|
-
value: "radio card 2",
|
|
28
|
-
description: "some description 2",
|
|
29
|
-
label: "title 2",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
iconName: "star",
|
|
33
|
-
iconFill: true,
|
|
34
|
-
value: "radio card 3",
|
|
35
|
-
description: "some description 3",
|
|
36
|
-
label: "title 3",
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
argTypes: {
|
|
41
|
-
...getArgTypes(URadioCard.name),
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const DefaultTemplate = (args) => ({
|
|
46
|
-
components: { URadioCard },
|
|
47
|
-
setup() {
|
|
48
|
-
const slots = getSlotNames(URadioCard.name);
|
|
49
|
-
|
|
50
|
-
return { args, slots };
|
|
51
|
-
},
|
|
52
|
-
template: `
|
|
53
|
-
<URadioCard v-bind="args">
|
|
54
|
-
<template v-for="(slot, index) of slots" :key="index" v-slot:[slot]>
|
|
55
|
-
<template v-if="args[slot]">{{ args[slot] }}</template>
|
|
56
|
-
</template>
|
|
57
|
-
</URadioCard>
|
|
58
|
-
`,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const SlotTemplate = (args) => ({
|
|
62
|
-
components: { URadioCard, UIcon },
|
|
63
|
-
setup() {
|
|
64
|
-
return { args };
|
|
65
|
-
},
|
|
66
|
-
template: `
|
|
67
|
-
<URadioCard v-bind="args">
|
|
68
|
-
${args.slotTemplate}
|
|
69
|
-
</URadioCard>
|
|
70
|
-
`,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export const Default = DefaultTemplate.bind({});
|
|
74
|
-
Default.args = {};
|
|
75
|
-
|
|
76
|
-
export const gridCols3 = DefaultTemplate.bind({});
|
|
77
|
-
gridCols3.args = {
|
|
78
|
-
gridCols: 3,
|
|
79
|
-
value: "radio card 4",
|
|
80
|
-
name: "radio 2",
|
|
81
|
-
options: [
|
|
82
|
-
{
|
|
83
|
-
value: "radio card 4",
|
|
84
|
-
description: "some description 1",
|
|
85
|
-
iconName: "star",
|
|
86
|
-
iconFill: true,
|
|
87
|
-
label: "title 1",
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
value: "radio card 5",
|
|
91
|
-
description: "some description 2",
|
|
92
|
-
iconName: "star",
|
|
93
|
-
iconFill: true,
|
|
94
|
-
label: "title 2",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
value: "radio card 6",
|
|
98
|
-
description: "some description 3",
|
|
99
|
-
iconName: "star",
|
|
100
|
-
iconFill: true,
|
|
101
|
-
label: "title 3",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export const withoutIcon = DefaultTemplate.bind({});
|
|
107
|
-
withoutIcon.args = {
|
|
108
|
-
withIcon: false,
|
|
109
|
-
value: "radio card 7",
|
|
110
|
-
name: "radio 3",
|
|
111
|
-
options: [
|
|
112
|
-
{
|
|
113
|
-
value: "radio card 7",
|
|
114
|
-
description: "some description 1",
|
|
115
|
-
iconName: "star",
|
|
116
|
-
iconFill: true,
|
|
117
|
-
label: "title 1",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
value: "radio card 8",
|
|
121
|
-
description: "some description 2",
|
|
122
|
-
iconName: "star",
|
|
123
|
-
iconFill: true,
|
|
124
|
-
label: "title 2",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
value: "radio card 9",
|
|
128
|
-
description: "some description 3",
|
|
129
|
-
iconName: "star",
|
|
130
|
-
iconFill: true,
|
|
131
|
-
label: "title 3",
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const iconSlot = SlotTemplate.bind({});
|
|
137
|
-
iconSlot.args = {
|
|
138
|
-
value: "radio card 10",
|
|
139
|
-
name: "radio 4",
|
|
140
|
-
options: [
|
|
141
|
-
{ value: "radio card 10", description: "some description 1", title: "title 1" },
|
|
142
|
-
{ value: "radio card 11", description: "some description 2", title: "title 2" },
|
|
143
|
-
],
|
|
144
|
-
slotTemplate: `
|
|
145
|
-
<template #icon>
|
|
146
|
-
<UIcon
|
|
147
|
-
name="star"
|
|
148
|
-
size="lg"
|
|
149
|
-
/>
|
|
150
|
-
</template>
|
|
151
|
-
`,
|
|
152
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-bind="wrapperAttrs(gridColsClass)">
|
|
3
|
-
<div v-for="(item, index) in options" :key="id + index" v-bind="itemsAttrs">
|
|
4
|
-
<label :for="id + index" v-bind="labelAttrs">
|
|
5
|
-
<URadio
|
|
6
|
-
:id="id + index"
|
|
7
|
-
v-model="selectedItem"
|
|
8
|
-
:value="item.value"
|
|
9
|
-
:name="name"
|
|
10
|
-
:label="item.label"
|
|
11
|
-
:checked="item.value === selectedItem"
|
|
12
|
-
:description="item.description"
|
|
13
|
-
:label-align="labelAlign"
|
|
14
|
-
v-bind="radioAttrs"
|
|
15
|
-
>
|
|
16
|
-
<!-- @slot Use it to add icon. -->
|
|
17
|
-
<slot v-if="withIcon" name="icon" :item="item">
|
|
18
|
-
<UIcon internal :name="item.iconName" size="xl" :color="color" v-bind="iconAttrs" />
|
|
19
|
-
</slot>
|
|
20
|
-
</URadio>
|
|
21
|
-
</label>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup>
|
|
27
|
-
import { computed } from "vue";
|
|
28
|
-
|
|
29
|
-
import UIcon from "../ui.image-icon";
|
|
30
|
-
import URadio from "../ui.form-radio";
|
|
31
|
-
import UIService, { getRandomId } from "../service.ui";
|
|
32
|
-
|
|
33
|
-
import defaultConfig from "./configs/default.config";
|
|
34
|
-
import { URadioCard } from "./constants";
|
|
35
|
-
import { useAttrs } from "./composables/attrs.composable";
|
|
36
|
-
import useBreakpoint from "../composable.breakpoint";
|
|
37
|
-
|
|
38
|
-
/* Should be a string for correct web-types gen */
|
|
39
|
-
defineOptions({ name: "URadioCard", inheritAttrs: false });
|
|
40
|
-
|
|
41
|
-
const props = defineProps({
|
|
42
|
-
/**
|
|
43
|
-
* Set radio card name.
|
|
44
|
-
*/
|
|
45
|
-
name: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: true,
|
|
48
|
-
default: "",
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Set options for component.
|
|
53
|
-
*/
|
|
54
|
-
options: {
|
|
55
|
-
type: Array,
|
|
56
|
-
default: () => [],
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Set component value.
|
|
61
|
-
*/
|
|
62
|
-
modelValue: {
|
|
63
|
-
type: [String, Number, Boolean],
|
|
64
|
-
default: "",
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Set grid cols number.
|
|
69
|
-
*/
|
|
70
|
-
gridCols: {
|
|
71
|
-
type: Number,
|
|
72
|
-
default: UIService.get(defaultConfig, URadioCard).default.gridCols,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Show / hide component icon.
|
|
77
|
-
*/
|
|
78
|
-
withIcon: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: UIService.get(defaultConfig, URadioCard).default.withIcon,
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* The color of the icon.
|
|
85
|
-
* @values brand, grayscale, black, white, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose
|
|
86
|
-
*/
|
|
87
|
-
color: {
|
|
88
|
-
type: String,
|
|
89
|
-
default: UIService.get(defaultConfig, URadioCard).default.color,
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Generates unique element id.
|
|
94
|
-
* @ignore
|
|
95
|
-
*/
|
|
96
|
-
id: {
|
|
97
|
-
type: String,
|
|
98
|
-
default: () => getRandomId(),
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
labelAlign: {
|
|
102
|
-
type: String,
|
|
103
|
-
default: UIService.get(defaultConfig, URadioCard).default.labelAlign,
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Sets component ui config object.
|
|
108
|
-
*/
|
|
109
|
-
config: {
|
|
110
|
-
type: Object,
|
|
111
|
-
default: () => ({}),
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Sets data-cy attribute for automated testing.
|
|
116
|
-
*/
|
|
117
|
-
dataCy: {
|
|
118
|
-
type: String,
|
|
119
|
-
default: "",
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
124
|
-
|
|
125
|
-
const { radioAttrs, iconAttrs, wrapperAttrs, labelAttrs, itemsAttrs } = useAttrs(props);
|
|
126
|
-
|
|
127
|
-
const { isMobileBreakpoint } = useBreakpoint();
|
|
128
|
-
|
|
129
|
-
const selectedItem = computed({
|
|
130
|
-
get: () => props.modelValue,
|
|
131
|
-
set: (value) => emit("update:modelValue", value),
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const gridColsClass = computed(() => {
|
|
135
|
-
return {
|
|
136
|
-
"grid-cols-1": isMobileBreakpoint.value,
|
|
137
|
-
"grid-cols-2": props.gridCols === 2 && isMobileBreakpoint.value,
|
|
138
|
-
"grid-cols-3": props.gridCols === 3 && isMobileBreakpoint.value,
|
|
139
|
-
"grid-cols-4": props.gridCols === 4 && isMobileBreakpoint.value,
|
|
140
|
-
};
|
|
141
|
-
});
|
|
142
|
-
</script>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { cva } from "../service.ui";
|
|
2
|
-
|
|
3
|
-
export default class VariantService {
|
|
4
|
-
static get(config) {
|
|
5
|
-
const { radio } = config;
|
|
6
|
-
|
|
7
|
-
const radioVariants = cva({
|
|
8
|
-
base: radio.base,
|
|
9
|
-
variants: radio.variants,
|
|
10
|
-
compoundVariants: radio.compoundVariants,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
return { radioVariants };
|
|
14
|
-
}
|
|
15
|
-
}
|