vueless 0.0.745 → 0.0.747
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.ts +2 -1
- package/package.json +1 -1
- package/ui.form-input/storybook/stories.ts +2 -5
- package/ui.form-input-money/storybook/stories.ts +1 -4
- package/ui.form-input-search/storybook/stories.ts +2 -5
- package/ui.form-select/storybook/stories.ts +2 -4
- package/ui.form-textarea/storybook/stories.ts +2 -4
package/composables/useUI.ts
CHANGED
|
@@ -130,8 +130,9 @@ export default function useUI<T>(
|
|
|
130
130
|
const attrs = useAttrs() as KeyAttrs;
|
|
131
131
|
|
|
132
132
|
const reactiveProps = computed(() => ({ ...props }));
|
|
133
|
+
const reactiveClass = computed(() => attrs.class);
|
|
133
134
|
|
|
134
|
-
watch([config, reactiveProps, classes], updateVuelessAttrs, { immediate: true });
|
|
135
|
+
watch([config, reactiveProps, classes, reactiveClass], updateVuelessAttrs, { immediate: true });
|
|
135
136
|
|
|
136
137
|
/**
|
|
137
138
|
* Updating Vueless attributes.
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import {
|
|
3
2
|
getArgTypes,
|
|
4
3
|
getSlotNames,
|
|
@@ -43,15 +42,13 @@ const DefaultTemplate: StoryFn<UInputArgs> = (args: UInputArgs) => ({
|
|
|
43
42
|
components: { UInput, UIcon },
|
|
44
43
|
setup() {
|
|
45
44
|
const slots = getSlotNames(UInput.__name);
|
|
46
|
-
const errorMessage = computed(() => (args.modelValue === "" ? args.error : ""));
|
|
47
45
|
|
|
48
|
-
return { args, slots
|
|
46
|
+
return { args, slots };
|
|
49
47
|
},
|
|
50
48
|
template: `
|
|
51
49
|
<UInput
|
|
52
50
|
v-bind="args"
|
|
53
51
|
v-model="args.modelValue"
|
|
54
|
-
:error="errorMessage"
|
|
55
52
|
class="max-w-96"
|
|
56
53
|
>
|
|
57
54
|
${args.slotTemplate || getSlotsFragment("")}
|
|
@@ -129,7 +126,7 @@ export const Description = DefaultTemplate.bind({});
|
|
|
129
126
|
Description.args = { description: "Provide additional details if necessary." };
|
|
130
127
|
|
|
131
128
|
export const Error = DefaultTemplate.bind({});
|
|
132
|
-
Error.args = { error: "This field is required. Please enter a value." };
|
|
129
|
+
Error.args = { error: "This field is required. Please enter a value.", modelValue: "" };
|
|
133
130
|
|
|
134
131
|
export const Readonly = DefaultTemplate.bind({});
|
|
135
132
|
Readonly.args = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import {
|
|
3
2
|
getArgTypes,
|
|
4
3
|
getSlotNames,
|
|
@@ -43,15 +42,13 @@ const DefaultTemplate: StoryFn<UInputMoneyArgs> = (args: UInputMoneyArgs) => ({
|
|
|
43
42
|
components: { UInputMoney, UIcon, UButton },
|
|
44
43
|
setup() {
|
|
45
44
|
const slots = getSlotNames(UInputMoney.__name);
|
|
46
|
-
const errorMessage = computed(() => (Number(args.modelValue) > 0 ? "" : args.error));
|
|
47
45
|
|
|
48
|
-
return { args, slots
|
|
46
|
+
return { args, slots };
|
|
49
47
|
},
|
|
50
48
|
template: `
|
|
51
49
|
<UInputMoney
|
|
52
50
|
v-bind="args"
|
|
53
51
|
v-model="args.modelValue"
|
|
54
|
-
:error="errorMessage"
|
|
55
52
|
class="max-w-96"
|
|
56
53
|
>
|
|
57
54
|
${args.slotTemplate || getSlotsFragment("")}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import {
|
|
3
2
|
getArgTypes,
|
|
4
3
|
getSlotNames,
|
|
@@ -43,15 +42,13 @@ const DefaultTemplate: StoryFn<UInputSearchArgs> = (args: UInputSearchArgs) => (
|
|
|
43
42
|
components: { UInputSearch, UButton, UIcon },
|
|
44
43
|
setup() {
|
|
45
44
|
const slots = getSlotNames(UInputSearch.__name);
|
|
46
|
-
const errorMessage = computed(() => (args.modelValue === "" ? args.error : ""));
|
|
47
45
|
|
|
48
|
-
return { args, slots
|
|
46
|
+
return { args, slots };
|
|
49
47
|
},
|
|
50
48
|
template: `
|
|
51
49
|
<UInputSearch
|
|
52
50
|
v-bind="args"
|
|
53
51
|
v-model="args.modelValue"
|
|
54
|
-
:error="errorMessage"
|
|
55
52
|
class="max-w-96"
|
|
56
53
|
>
|
|
57
54
|
${args.slotTemplate || getSlotsFragment("")}
|
|
@@ -104,7 +101,7 @@ export const Description = DefaultTemplate.bind({});
|
|
|
104
101
|
Description.args = { description: "Search for additional details." };
|
|
105
102
|
|
|
106
103
|
export const Error = DefaultTemplate.bind({});
|
|
107
|
-
Error.args = { error: "This field is required. Please enter a value." };
|
|
104
|
+
Error.args = { error: "This field is required. Please enter a value.", modelValue: "" };
|
|
108
105
|
|
|
109
106
|
export const Disabled = DefaultTemplate.bind({});
|
|
110
107
|
Disabled.args = { disabled: true };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref
|
|
1
|
+
import { ref } from "vue";
|
|
2
2
|
import {
|
|
3
3
|
getArgTypes,
|
|
4
4
|
getSlotNames,
|
|
@@ -64,16 +64,14 @@ const DefaultTemplate: StoryFn<USelectArgs> = (args: USelectArgs) => ({
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const slots = getSlotNames(USelect.__name);
|
|
67
|
-
const errorMessage = computed(() => (!args.modelValue ? args.error : ""));
|
|
68
67
|
const showAlert = (message: string) => alert(message);
|
|
69
68
|
|
|
70
|
-
return { args, slots, getSelectedBadge,
|
|
69
|
+
return { args, slots, getSelectedBadge, showAlert };
|
|
71
70
|
},
|
|
72
71
|
template: `
|
|
73
72
|
<USelect
|
|
74
73
|
v-bind="args"
|
|
75
74
|
v-model="args.modelValue"
|
|
76
|
-
:error="errorMessage"
|
|
77
75
|
class="max-w-96"
|
|
78
76
|
@add="showAlert('You triggered the add action!')"
|
|
79
77
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref
|
|
1
|
+
import { ref } from "vue";
|
|
2
2
|
import {
|
|
3
3
|
getArgTypes,
|
|
4
4
|
getSlotNames,
|
|
@@ -44,15 +44,13 @@ const DefaultTemplate: StoryFn<UTextareaArgs> = (args: UTextareaArgs) => ({
|
|
|
44
44
|
components: { UTextarea, UIcon },
|
|
45
45
|
setup() {
|
|
46
46
|
const slots = getSlotNames(UTextarea.__name);
|
|
47
|
-
const errorMessage = computed(() => (args.modelValue === "" ? args.error : ""));
|
|
48
47
|
|
|
49
|
-
return { args, slots
|
|
48
|
+
return { args, slots };
|
|
50
49
|
},
|
|
51
50
|
template: `
|
|
52
51
|
<UTextarea
|
|
53
52
|
v-bind="args"
|
|
54
53
|
v-model="args.modelValue"
|
|
55
|
-
:error="errorMessage"
|
|
56
54
|
class="max-w-96"
|
|
57
55
|
>
|
|
58
56
|
${args.slotTemplate || getSlotsFragment("")}
|