vueless 0.0.478-beta.1 → 0.0.478-beta.3
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/composablesTs/useUI.ts +9 -14
- package/package.json +2 -3
- package/ui.button/storybook/stories.js +2 -2
- package/ui.button-link/storybook/stories.js +1 -1
- package/ui.button-toggle/storybook/stories.js +1 -1
- package/ui.container-divider/storybook/stories.js +1 -1
- package/ui.container-modal/storybook/stories.js +1 -1
- package/ui.container-modal-confirm/storybook/stories.js +1 -1
- package/ui.container-row/storybook/stories.js +1 -1
- package/ui.data-table/UTable.vue +1 -1
- package/ui.dropdown-badge/storybook/stories.js +1 -1
- package/ui.dropdown-button/storybook/stories.js +2 -2
- package/ui.dropdown-link/storybook/stories.js +1 -1
- package/ui.dropdown-list/storybook/stories.js +1 -1
- package/ui.form-checkbox/storybook/stories.js +1 -1
- package/ui.form-checkbox-group/storybook/stories.js +1 -1
- package/ui.form-checkbox-multi-state/storybook/stories.js +1 -1
- package/ui.form-color-picker/storybook/stories.js +1 -1
- package/ui.form-date-picker/storybook/stories.js +2 -2
- package/ui.form-date-picker-range/storybook/stories.js +1 -1
- package/ui.form-input/storybook/stories.js +1 -1
- package/ui.form-input-file/storybook/stories.js +1 -1
- package/ui.form-input-money/storybook/stories.js +1 -1
- package/ui.form-input-number/storybook/stories.js +1 -1
- package/ui.form-input-rating/storybook/stories.js +1 -1
- package/ui.form-input-search/storybook/stories.js +1 -1
- package/ui.form-label/storybook/stories.js +1 -1
- package/ui.form-radio-group/storybook/stories.js +1 -1
- package/ui.form-select/storybook/stories.js +1 -1
- package/ui.form-switch/storybook/stories.js +1 -1
- package/ui.form-textarea/storybook/stories.js +1 -1
- package/ui.image-avatar/storybook/stories.js +1 -1
- package/ui.image-icon/UIcon.vue +2 -2
- package/ui.image-icon/storybook/stories.js +1 -1
- package/ui.loader/storybook/stories.js +1 -1
- package/ui.loader-progress/storybook/stories.js +1 -1
- package/ui.navigation-progress/storybook/stories.js +1 -1
- package/ui.navigation-tabs/storybook/stories.js +1 -1
- package/ui.other-dot/storybook/stories.js +1 -1
- package/ui.text-alert/storybook/stories.js +1 -1
- package/ui.text-badge/storybook/stories.js +10 -2
- package/ui.text-block/storybook/stories.ts +2 -2
- package/ui.text-empty/storybook/stories.js +1 -1
- package/ui.text-file/UFile.vue +0 -1
- package/ui.text-header/storybook/stories.js +1 -1
- package/ui.text-money/storybook/stories.js +1 -1
- package/utils/utilUI.js +1 -1
- package/web-types.json +0 -9580
package/composablesTs/useUI.ts
CHANGED
|
@@ -94,26 +94,26 @@ export default function useUI<T>(
|
|
|
94
94
|
/**
|
|
95
95
|
* Get classes by given key (including CVA if config set).
|
|
96
96
|
*/
|
|
97
|
-
function getClasses(key: string, mutatedProps: UnknownObject) {
|
|
97
|
+
function getClasses(key: string, mutatedProps: UnknownObject): ComputedRef<string> {
|
|
98
98
|
return computed(() => {
|
|
99
99
|
const color = (toValue(mutatedProps)?.color as BrandColors) || props?.color;
|
|
100
|
-
const value = config.value[key] as CVA & NestedComponent;
|
|
100
|
+
const value = config.value[key] as (CVA & NestedComponent) | string;
|
|
101
101
|
|
|
102
102
|
let classes = "";
|
|
103
103
|
|
|
104
|
-
if (isCVA(value)) {
|
|
104
|
+
if (typeof value === "object" && isCVA(value)) {
|
|
105
105
|
classes = cva(value)({
|
|
106
106
|
...props,
|
|
107
107
|
...toValue(mutatedProps),
|
|
108
108
|
...(color ? { color: getColor(color) } : {}),
|
|
109
109
|
});
|
|
110
|
-
} else if (value.component) {
|
|
111
|
-
// If the value of the key contains keys related to the nested component, it should be skipped.
|
|
112
|
-
// Probably this should be fixed later to be possible to extend key with nested component keys.
|
|
113
|
-
return "";
|
|
114
110
|
}
|
|
115
111
|
|
|
116
|
-
|
|
112
|
+
if (typeof value === "string") {
|
|
113
|
+
classes = value;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return color ? setColor(classes, color) : classes;
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -224,11 +224,8 @@ export default function useUI<T>(
|
|
|
224
224
|
config,
|
|
225
225
|
setColor,
|
|
226
226
|
getColor,
|
|
227
|
-
getAttrs,
|
|
228
227
|
getKeysAttrs,
|
|
229
228
|
getExtendingKeysClasses,
|
|
230
|
-
isCVA,
|
|
231
|
-
isSystemKey,
|
|
232
229
|
hasSlotContent,
|
|
233
230
|
};
|
|
234
231
|
}
|
|
@@ -528,9 +525,7 @@ function isSystemKey(key: string): boolean {
|
|
|
528
525
|
/**
|
|
529
526
|
* Check is config contains default CVA keys.
|
|
530
527
|
*/
|
|
531
|
-
function isCVA(config:
|
|
532
|
-
if (typeof config !== "object") return false;
|
|
533
|
-
|
|
528
|
+
function isCVA(config: UnknownObject): boolean {
|
|
534
529
|
return Object.values(CVA_CONFIG_KEY).some((value) =>
|
|
535
530
|
Object.keys(config).some((key) => key === value),
|
|
536
531
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.478-beta.
|
|
3
|
+
"version": "0.0.478-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
6
6
|
"keywords": [
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"build": "npx @vueless/web-types && node prepare.icons && storybook build --docs",
|
|
33
33
|
"preview": "vite preview --host --outDir=storybook-static",
|
|
34
34
|
"ts:check": "vue-tsc --build --force",
|
|
35
|
-
"
|
|
36
|
-
"release:prepare": "npx @vueless/web-types && node prepare.icons && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE web-types.json README.md dist/ && node prepare.package && npm run ts:build",
|
|
35
|
+
"release:prepare": "node prepare.icons && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE README.md dist/ && node prepare.package",
|
|
37
36
|
"release:beta": "release-it --ci --npm.publish --preRelease=beta --increment=prerelease",
|
|
38
37
|
"release:patch": "release-it patch --ci --npm.publish",
|
|
39
38
|
"release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
|
|
@@ -34,7 +34,7 @@ const DefaultTemplate = (args) => ({
|
|
|
34
34
|
`,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
37
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
38
38
|
components: { UButton, URow, UCol },
|
|
39
39
|
setup() {
|
|
40
40
|
return { args, options: argTypes[args.enum].options };
|
|
@@ -54,7 +54,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
54
54
|
`,
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
const ColorTemplate = (args, { argTypes }
|
|
57
|
+
const ColorTemplate = (args, { argTypes }) => ({
|
|
58
58
|
components: { UButton, URow, UCol },
|
|
59
59
|
setup() {
|
|
60
60
|
return {
|
|
@@ -62,7 +62,7 @@ const DefaultTemplate = (args) => ({
|
|
|
62
62
|
`,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
65
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
66
66
|
components: { UModal, UButton, URow, UInput, UTextarea },
|
|
67
67
|
setup() {
|
|
68
68
|
function onClick(value) {
|
|
@@ -57,7 +57,7 @@ const DefaultTemplate = (args) => ({
|
|
|
57
57
|
`,
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
60
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
61
61
|
components: { UModalConfirm, UButton, URow },
|
|
62
62
|
setup() {
|
|
63
63
|
function onClick(value) {
|
|
@@ -36,7 +36,7 @@ const DefaultTemplate = (args) => ({
|
|
|
36
36
|
`,
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
39
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
40
40
|
components: { UCol, URow, UInput, UButton },
|
|
41
41
|
setup() {
|
|
42
42
|
const isGapEnum = argTypes[args.enum].name === "gap";
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -703,7 +703,7 @@ function onChangeSelectedRows(selectedRows) {
|
|
|
703
703
|
if (selectedRows.length) {
|
|
704
704
|
canSelectAll.value = false;
|
|
705
705
|
|
|
706
|
-
isCheckedMoreOneTableItems.value
|
|
706
|
+
isCheckedMoreOneTableItems.value && setFooterCellWidth();
|
|
707
707
|
} else {
|
|
708
708
|
nextTick(setHeaderCellWidth);
|
|
709
709
|
}
|
|
@@ -42,7 +42,7 @@ const DefaultTemplate = (args) => ({
|
|
|
42
42
|
`,
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
45
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
46
46
|
components: { UDropdownButton, URow },
|
|
47
47
|
setup() {
|
|
48
48
|
return {
|
|
@@ -63,7 +63,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
63
63
|
`,
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
const VariantColorsTemplate = (args, { argTypes }
|
|
66
|
+
const VariantColorsTemplate = (args, { argTypes }) => ({
|
|
67
67
|
components: { UDropdownButton, URow, UCol },
|
|
68
68
|
setup() {
|
|
69
69
|
return {
|
|
@@ -45,7 +45,7 @@ const DefaultTemplate = (args) => ({
|
|
|
45
45
|
`,
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
48
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
49
49
|
components: { UDatePicker, URow },
|
|
50
50
|
setup() {
|
|
51
51
|
return {
|
|
@@ -57,7 +57,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
57
57
|
<URow>
|
|
58
58
|
<UDatePicker
|
|
59
59
|
v-for="(option, index) in options"
|
|
60
|
-
open-direction-y="bottom"
|
|
60
|
+
open-direction-y="bottom"
|
|
61
61
|
:key="index"
|
|
62
62
|
v-bind="args"
|
|
63
63
|
:[args.enum]="option"
|
|
@@ -38,7 +38,7 @@ const DefaultTemplate = (args) => ({
|
|
|
38
38
|
`,
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
41
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
42
42
|
components: { ULabel, UCol, UText },
|
|
43
43
|
setup() {
|
|
44
44
|
function getText(value, name) {
|
package/ui.image-icon/UIcon.vue
CHANGED
|
@@ -164,7 +164,7 @@ const dynamicComponent = computed(() => {
|
|
|
164
164
|
return component;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
/* eslint-disable
|
|
167
|
+
/* eslint-disable prettier/prettier */
|
|
168
168
|
const libraries = {
|
|
169
169
|
"vueless": async () => {
|
|
170
170
|
return import.meta.env.PROD
|
|
@@ -197,7 +197,7 @@ const dynamicComponent = computed(() => {
|
|
|
197
197
|
: import(/* @vite-ignore */ `/node_modules/${library}/24/${fillType}/${name}.svg?component`);
|
|
198
198
|
},
|
|
199
199
|
};
|
|
200
|
-
/* eslint-enable
|
|
200
|
+
/* eslint-enable prettier/prettier */
|
|
201
201
|
|
|
202
202
|
return defineAsyncComponent(libraries[library]);
|
|
203
203
|
});
|
|
@@ -40,7 +40,7 @@ const DefaultTemplate = (args) => ({
|
|
|
40
40
|
`,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
43
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
44
44
|
components: { ULoaderProgress, UButton, UCol, URow, UBadge },
|
|
45
45
|
setup() {
|
|
46
46
|
return {
|
|
@@ -34,7 +34,7 @@ const DefaultTemplate = (args) => ({
|
|
|
34
34
|
`,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const ColorsTemplate = (args, { argTypes }
|
|
37
|
+
const ColorsTemplate = (args, { argTypes }) => ({
|
|
38
38
|
components: { UBadge, URow, UCol },
|
|
39
39
|
setup() {
|
|
40
40
|
return {
|
|
@@ -59,7 +59,7 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
|
59
59
|
`,
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
62
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
63
63
|
components: { UBadge, URow },
|
|
64
64
|
setup() {
|
|
65
65
|
function getText(value) {
|
|
@@ -70,6 +70,14 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
70
70
|
},
|
|
71
71
|
template: `
|
|
72
72
|
<URow>
|
|
73
|
+
<UDropdownButton
|
|
74
|
+
label="Dropdown"
|
|
75
|
+
:options='[{"label":"option 1"},{"label":"option 2"},{"label":"option 3"}]'
|
|
76
|
+
variant="thirdary"
|
|
77
|
+
filled
|
|
78
|
+
>
|
|
79
|
+
fff
|
|
80
|
+
</UDropdownButton>
|
|
73
81
|
<UBadge
|
|
74
82
|
v-for="(option, index) in options"
|
|
75
83
|
:key="index"
|
|
@@ -32,7 +32,7 @@ const defaultTemplate = `
|
|
|
32
32
|
</p>
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
|
-
const DefaultTemplate: StoryFn<UTextArgs> = (args) => ({
|
|
35
|
+
const DefaultTemplate: StoryFn<UTextArgs> = (args: UTextArgs) => ({
|
|
36
36
|
components: { UText, URow },
|
|
37
37
|
setup() {
|
|
38
38
|
const slots = getSlotNames(UText.__name);
|
|
@@ -46,7 +46,7 @@ const DefaultTemplate: StoryFn<UTextArgs> = (args) => ({
|
|
|
46
46
|
`,
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
const EnumVariantTemplate: StoryFn<UTextArgs> = (args, { argTypes }) => ({
|
|
49
|
+
const EnumVariantTemplate: StoryFn<UTextArgs> = (args: UTextArgs, { argTypes }) => ({
|
|
50
50
|
components: { UText, URow },
|
|
51
51
|
setup() {
|
|
52
52
|
return {
|
package/ui.text-file/UFile.vue
CHANGED
|
@@ -46,7 +46,7 @@ const DefaultTemplate = (args) => ({
|
|
|
46
46
|
`,
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
49
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
50
50
|
components: { UMoney, URow },
|
|
51
51
|
setup() {
|
|
52
52
|
const slots = getSlotNames(UMoney.__name);
|