vueless 1.4.7-beta.0 → 1.4.7-beta.2
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/icons/storybook/cloud_sync.svg +1 -0
- package/icons/storybook/date_range.svg +1 -0
- package/icons/storybook/event.svg +1 -0
- package/icons/storybook/folder.svg +1 -0
- package/icons/storybook/format_quote.svg +1 -0
- package/icons/storybook/local_shipping.svg +1 -0
- package/icons/storybook/location_city.svg +1 -0
- package/icons/storybook/mark_email_unread.svg +1 -0
- package/icons/storybook/notifications.svg +1 -0
- package/icons/storybook/shield.svg +1 -0
- package/icons/storybook/workspace_premium.svg +1 -0
- package/package.json +1 -1
- package/ui.container-col/config.ts +4 -2
- package/ui.container-col/tests/UCol.test.ts +24 -16
- package/ui.container-row/config.ts +4 -2
- package/ui.container-row/tests/URow.test.ts +24 -16
- package/ui.form-checkbox/UCheckbox.vue +0 -5
- package/ui.form-checkbox/storybook/stories.ts +56 -18
- package/ui.form-checkbox/tests/UCheckbox.test.ts +0 -17
- package/ui.form-checkbox-group/storybook/stories.ts +61 -0
- package/ui.form-date-picker/storybook/stories.ts +85 -37
- package/ui.form-date-picker-range/storybook/stories.ts +97 -38
- package/ui.form-input/storybook/stories.ts +75 -37
- package/ui.form-input-file/storybook/stories.ts +44 -5
- package/ui.form-input-number/storybook/stories.ts +66 -28
- package/ui.form-input-password/storybook/stories.ts +94 -50
- package/ui.form-input-search/storybook/stories.ts +40 -4
- package/ui.form-label/ULabel.vue +0 -6
- package/ui.form-label/storybook/stories.ts +46 -24
- package/ui.form-label/tests/ULabel.test.ts +0 -12
- package/ui.form-radio/URadio.vue +0 -5
- package/ui.form-radio/storybook/stories.ts +65 -25
- package/ui.form-radio/tests/URadio.test.ts +0 -17
- package/ui.form-radio-group/storybook/stories.ts +67 -0
- package/ui.form-select/storybook/stories.ts +99 -44
- package/ui.form-switch/storybook/stories.ts +35 -11
- package/ui.form-textarea/storybook/stories.ts +61 -20
- package/ui.text-files/storybook/stories.ts +30 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M167.48-156.41v-62.63h124.26q-64-48.72-100.14-109.22t-36.14-148.5q0-102.98 61.63-191.22T391.54-789.5v70.13q-71 24.57-119.36 91.21-48.35 66.64-48.35 151.4 0 62.95 26.9 114.94 26.9 51.99 87.47 91.28V-390h62.63v233.59H167.48Zm436.59 5.98q-52.14 0-88.82-36.62-36.68-36.61-36.68-88.92 0-49.41 33.59-85.6 33.6-36.19 82.56-39.39 17.95-36.24 52.29-58.36 34.34-22.11 77.07-22.11 54.94 0 94.85 34.85 39.92 34.86 47.68 85.62h2q42.48 1.44 71.84 32.28 29.35 30.83 29.35 71.79 0 44-30.78 75.23-30.79 31.23-74.95 31.23h-260ZM732.18-520q-11.01-50.28-37.33-91.45-26.32-41.18-69.81-78.01V-570h-62.87v-233.59h233.59v62.63H670.5q49 41.96 85.99 101.46Q793.48-580 801.54-520h-69.36ZM604.07-215.93h260q17 0 28.5-11.5t11.5-28.5q0-16.77-11.5-28.39-11.5-11.61-28.5-11.61h-50v-30q0-37.77-26-63.89-26-26.11-64-26.11-37.77 0-63.89 24.5-26.11 24.5-26.11 55.5h-30q-25 0-42.5 17.5t-17.5 42.5q0 25 17.5 42.5t42.5 17.5Zm120-100Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M303.1-394.48q-17.93 0-30.02-12.2-12.1-12.2-12.1-30.05 0-17.86 12.13-30.07 12.12-12.22 30.05-12.22t30.02 12.25q12.1 12.25 12.1 30.16 0 17.73-12.12 29.93-12.13 12.2-30.06 12.2Zm179.87 0q-17.93 0-30.02-12.2-12.1-12.2-12.1-30.05 0-17.86 12.12-30.07 12.13-12.22 30.06-12.22t30.02 12.25q12.1 12.25 12.1 30.16 0 17.73-12.12 29.93-12.13 12.2-30.06 12.2Zm172.87 0q-17.93 0-30.02-12.2-12.1-12.2-12.1-30.05 0-17.86 12.12-30.07 12.13-12.22 30.06-12.22t30.02 12.25q12.1 12.25 12.1 30.16 0 17.73-12.13 29.93-12.12 12.2-30.05 12.2ZM182.15-74.02q-27.6 0-47.86-20.27-20.27-20.26-20.27-47.86v-615.7q0-27.7 20.27-48.03 20.26-20.34 47.86-20.34H245v-60h69.07v60h331.86v-60H715v60h62.85q27.7 0 48.03 20.34 20.34 20.33 20.34 48.03v615.7q0 27.6-20.34 47.86-20.33 20.27-48.03 20.27h-595.7Zm0-68.13h595.7V-570h-595.7v427.85Zm0-487.85h595.7v-127.85h-595.7V-630Zm0 0v-127.85V-630Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M596.82-220Q556-220 528-248.18q-28-28.19-28-69Q500-358 528.18-386q28.19-28 69-28Q638-414 666-385.82q28 28.19 28 69Q694-276 665.82-248q-28.19 28-69 28ZM182.15-74.02q-27.6 0-47.86-20.27-20.27-20.26-20.27-47.86v-615.7q0-27.7 20.27-48.03 20.26-20.34 47.86-20.34H245v-60h69.07v60h331.86v-60H715v60h62.85q27.7 0 48.03 20.34 20.34 20.33 20.34 48.03v615.7q0 27.6-20.34 47.86-20.33 20.27-48.03 20.27h-595.7Zm0-68.13h595.7V-570h-595.7v427.85Zm0-487.85h595.7v-127.85h-595.7V-630Zm0 0v-127.85V-630Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M142.15-154.02q-27.6 0-47.86-20.77-20.27-20.76-20.27-47.36v-515.7q0-26.7 20.27-47.53 20.26-20.84 47.86-20.84h276.22L481-743.35h336.85q26.7 0 47.53 20.77 20.84 20.76 20.84 47.36v453.07q0 26.6-20.84 47.36-20.83 20.77-47.53 20.77h-675.7Zm0-68.13h675.7v-453.07h-365.2l-62.63-62.63H142.15v515.7Zm0 0v-515.7 515.7Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="m238.67-234.5 95.92-164.87q-5 1-11 1.5t-11 .5q-66.48-1.43-112.88-49.03Q153.3-494 153.3-560q0-67.76 47.92-115.55 47.91-47.8 115.67-47.8 67.44 0 115.27 47.8Q480-627.76 480-560q0 21.09-5.44 41.35T458.48-480L317.37-234.5h-78.7Zm366.7 0 95.67-164.87q-5 1-11 1.5t-11 .5q-66.47-1.43-112.76-49.03Q520-494 520-560q0-67.76 47.8-115.55 47.79-47.8 115.55-47.8 67.43 0 115.39 47.8Q846.7-627.76 846.7-560q0 21.09-5.44 41.35T825.17-480L683.83-234.5h-78.46ZM316.54-482.15q32.39 0 55.18-22.63 22.78-22.62 22.78-54.94 0-32.32-22.57-55.23-22.56-22.9-54.8-22.9-32.52 0-55.3 22.63-22.79 22.62-22.79 54.94 0 32.32 22.55 55.23 22.55 22.9 54.95 22.9Zm366.46 0q32.39 0 55.29-22.63 22.91-22.62 22.91-54.94 0-32.32-22.64-55.23-22.64-22.9-54.98-22.9-32.43 0-55.26 22.63-22.82 22.62-22.82 54.94 0 32.32 22.6 55.23 22.61 22.9 54.9 22.9Zm.35-77.85Zm-366.46 0Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M225.55-155.5q-49.59 0-84.81-34.18-35.22-34.17-35.7-83.82H34.5v-463.87q0-27.6 20.27-47.86 20.26-20.27 47.86-20.27h579v164.13h103.33L925.5-454.02v180.52h-73.87q-.72 49.65-35.82 83.82-35.1 34.18-84.69 34.18-49.6 0-84.82-34.18-35.21-34.17-35.69-83.82H345.83q-.72 49.24-35.7 83.62-34.98 34.38-84.58 34.38Zm-.12-62.87q24 0 41-17t17-41q0-24-17-41t-41-17q-24 0-41 17t-17 41q0 24 17 41t41 17Zm-122.8-123.26h23.04q16.92-25.8 42.46-41.09Q193.66-398 224.45-398t56.81 15.63q26.01 15.64 42.78 40.74H613.5v-395.74H102.63v395.74ZM731-218.37q24 0 41-17t17-41q0-24-17-41t-41-17q-24 0-41 17t-17 41q0 24 17 41t41 17ZM681.63-425h180.26l-111-148h-69.26v148ZM358.57-529Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M111.87-111.87v-574.5h247v-86.26L480-891l121.37 118.37v252.26h247v408.5h-736.5ZM180-180h106v-106H180v106Zm0-166h106v-106H180v106Zm0-166h106v-106H180v106Zm247 332h106v-106H427v106Zm0-166h106v-106H427v106Zm0-166h106v-106H427v106Zm0-166h106v-106H427v106Zm247 498h106v-106H674v106Zm0-166h106v-106H674v106Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M142.15-154.02q-27.6 0-47.86-20.27-20.27-20.26-20.27-47.86v-515.7q0-27.7 20.27-48.03 20.26-20.34 47.86-20.34h429.46q-4.44 17.15-5.68 34.19-1.23 17.03 1.24 34.18H147.15l332.85 218 148.37-97.04q10.96 9.96 23.39 18.11 12.44 8.15 25.87 13.8L480-454.35l-337.85-223v455.2h675.7v-353.31q19.18-5.02 36.07-14.7 16.88-9.67 32.3-22.6v390.61q0 27.6-20.34 47.86-20.33 20.27-48.03 20.27h-675.7Zm0-583.83v515.7-515.7Zm617.73 91.92q-47.57 0-80.76-33.31-33.19-33.3-33.19-80.88 0-47.57 33.31-80.76 33.3-33.19 80.88-33.19 47.57 0 80.76 33.31 33.19 33.3 33.19 80.88 0 47.57-33.31 80.76-33.3 33.19-80.88 33.19Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M154.02-194.02v-68.13h77.85v-298.02q0-86.08 50.34-154.77 50.33-68.69 133.72-86.41v-20.56q0-26.8 18.69-45.55 18.69-18.76 45.38-18.76t45.38 18.76q18.69 18.75 18.69 45.55v20.56q83.39 17.48 133.84 86.25 50.46 68.77 50.46 154.93v298.02h77.85v68.13h-652.2ZM480-501.04Zm.12 429.17q-33.83 0-57.93-24.13t-24.1-58.02h164.06q0 33.95-24.15 58.05-24.15 24.1-57.88 24.1ZM300-262.15h360v-298.02q0-74.76-52.5-127.38Q555-740.17 480-740.17t-127.5 52.62Q300-634.93 300-560.17v298.02Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M479.98-74.78q-142.59-35.67-234.27-164.87-91.69-129.2-91.69-283.27v-242.26L480-887.22l326.22 122.05V-523q0 154.1-91.82 283.32-91.82 129.23-234.42 164.9Zm.02-70.13q113.8-39.2 185.83-143.62 72.02-104.43 72.02-234.4v-194.4L480-814.61l-257.85 97.4v194.17q0 130.08 72.02 234.51Q366.2-184.11 480-144.91Zm0-334.85Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="m381.89-408.89 36.96-119.31-98.59-75.43h120.36L480-728.37l38.38 124.74h121.36l-98.35 75.43 35.96 119.31L480-482.76l-98.11 73.87ZM241.37-34.5v-304.72q-46.44-47.95-66.89-105.66-20.46-57.7-20.46-116.32 0-138.39 93.8-232.18 93.79-93.79 232.12-93.79 138.33 0 232.31 93.79 93.97 93.79 93.97 232.18 0 58.62-20.58 116.32-20.57 57.71-67.01 105.66V-34.5L480-113.98 241.37-34.5Zm238.59-268.85q108.08 0 182.99-74.78 74.9-74.78 74.9-182.95 0-108.16-74.86-183.06t-182.95-74.9q-108.08 0-182.99 74.87-74.9 74.87-74.9 182.97 0 108.29 74.86 183.07 74.86 74.78 182.95 74.78ZM304-121.13l176-56.2 176 56.2V-289.5q-40.24 28.76-86.16 41.63-45.92 12.86-89.84 12.86t-89.84-12.86Q344.24-260.74 304-289.5v168.37Zm176-84.57Z"/></svg>
|
package/package.json
CHANGED
|
@@ -141,29 +141,37 @@ describe("UCol.vue", () => {
|
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
it("Grow – applies the correct grow class", () => {
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const growClasses = {
|
|
145
|
+
true: "grow",
|
|
146
|
+
false: "grow-0",
|
|
147
|
+
};
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
Object.entries(growClasses).forEach(([grow, classes]) => {
|
|
150
|
+
const component = mount(UCol, {
|
|
151
|
+
props: {
|
|
152
|
+
grow: grow === "true",
|
|
153
|
+
},
|
|
154
|
+
});
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
expect(component.attributes("class")).toContain(classes);
|
|
157
|
+
});
|
|
154
158
|
});
|
|
155
159
|
|
|
156
160
|
it("Shrink – applies the correct shrink class", () => {
|
|
157
|
-
const
|
|
158
|
-
|
|
161
|
+
const shrinkClasses = {
|
|
162
|
+
true: "shrink",
|
|
163
|
+
false: "shrink-0",
|
|
164
|
+
};
|
|
159
165
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
166
|
+
Object.entries(shrinkClasses).forEach(([shrink, classes]) => {
|
|
167
|
+
const component = mount(UCol, {
|
|
168
|
+
props: {
|
|
169
|
+
shrink: shrink === "true",
|
|
170
|
+
},
|
|
171
|
+
});
|
|
165
172
|
|
|
166
|
-
|
|
173
|
+
expect(component.attributes("class")).toContain(classes);
|
|
174
|
+
});
|
|
167
175
|
});
|
|
168
176
|
|
|
169
177
|
it("Tag – renders the correct HTML tag", () => {
|
|
@@ -141,29 +141,37 @@ describe("URow.vue", () => {
|
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
it("Grow – applies the correct grow class", () => {
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const growClasses = {
|
|
145
|
+
true: "grow",
|
|
146
|
+
false: "grow-0",
|
|
147
|
+
};
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
Object.entries(growClasses).forEach(([grow, classes]) => {
|
|
150
|
+
const component = mount(URow, {
|
|
151
|
+
props: {
|
|
152
|
+
grow: grow === "true",
|
|
153
|
+
},
|
|
154
|
+
});
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
expect(component.attributes("class")).toContain(classes);
|
|
157
|
+
});
|
|
154
158
|
});
|
|
155
159
|
|
|
156
160
|
it("Shrink – applies the correct shrink class", () => {
|
|
157
|
-
const
|
|
158
|
-
|
|
161
|
+
const shrinkClasses = {
|
|
162
|
+
true: "shrink",
|
|
163
|
+
false: "shrink-0",
|
|
164
|
+
};
|
|
159
165
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
166
|
+
Object.entries(shrinkClasses).forEach(([shrink, classes]) => {
|
|
167
|
+
const component = mount(URow, {
|
|
168
|
+
props: {
|
|
169
|
+
shrink: shrink === "true",
|
|
170
|
+
},
|
|
171
|
+
});
|
|
165
172
|
|
|
166
|
-
|
|
173
|
+
expect(component.attributes("class")).toContain(classes);
|
|
174
|
+
});
|
|
167
175
|
});
|
|
168
176
|
|
|
169
177
|
it("Tag – renders the correct HTML tag", () => {
|
|
@@ -211,10 +211,5 @@ const {
|
|
|
211
211
|
|
|
212
212
|
<UIcon v-else :name="config.defaults.checkedIcon" color="inherit" v-bind="checkedIconAttrs" />
|
|
213
213
|
</label>
|
|
214
|
-
|
|
215
|
-
<template #bottom>
|
|
216
|
-
<!-- @slot Use it to add something below the checkbox. -->
|
|
217
|
-
<slot name="bottom" />
|
|
218
|
-
</template>
|
|
219
214
|
</ULabel>
|
|
220
215
|
</template>
|
|
@@ -17,6 +17,7 @@ import UChip from "../../ui.other-chip/UChip.vue";
|
|
|
17
17
|
|
|
18
18
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
19
19
|
import type { Props } from "../types";
|
|
20
|
+
import { ref } from "vue";
|
|
20
21
|
|
|
21
22
|
interface UCheckboxArgs extends Props {
|
|
22
23
|
slotTemplate?: string;
|
|
@@ -142,23 +143,60 @@ Partial.parameters = {
|
|
|
142
143
|
},
|
|
143
144
|
};
|
|
144
145
|
|
|
145
|
-
export const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
export const Slots: StoryFn<UCheckboxArgs> = (args) => ({
|
|
147
|
+
components: { UCheckbox, UCol, UText, URow, ULink, UIcon },
|
|
148
|
+
setup: () => ({
|
|
149
|
+
args,
|
|
150
|
+
labelSlotValue: ref(false),
|
|
151
|
+
descriptionSlotValue: ref(false),
|
|
152
|
+
errorSlotValue: ref(false),
|
|
153
|
+
}),
|
|
154
|
+
template: `
|
|
155
|
+
<UCol gap="3xl">
|
|
156
|
+
<UCheckbox v-bind="args" v-model="labelSlotValue">
|
|
157
|
+
<template #label>
|
|
158
|
+
<URow gap="2xs" align="center">
|
|
159
|
+
<UText>I agree to the Privacy Policy</UText>
|
|
160
|
+
<UIcon name="contract" size="xs" />
|
|
161
|
+
</URow>
|
|
162
|
+
</template>
|
|
163
|
+
</UCheckbox>
|
|
164
|
+
|
|
165
|
+
<UCheckbox
|
|
166
|
+
v-bind="args"
|
|
167
|
+
v-model="descriptionSlotValue"
|
|
168
|
+
label="Email me product updates"
|
|
169
|
+
>
|
|
170
|
+
<template #description>
|
|
171
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
172
|
+
<UIcon name="mail" size="xs" class="mt-0.5" color="primary" />
|
|
173
|
+
<UText size="sm">
|
|
174
|
+
Unsubscribe anytime.
|
|
175
|
+
<ULink label="Privacy policy" underlined size="sm" />.
|
|
176
|
+
</UText>
|
|
177
|
+
</URow>
|
|
178
|
+
</template>
|
|
179
|
+
</UCheckbox>
|
|
156
180
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
181
|
+
<UCheckbox
|
|
182
|
+
v-bind="args"
|
|
183
|
+
v-model="errorSlotValue"
|
|
184
|
+
label="Accept terms"
|
|
185
|
+
:error="true"
|
|
186
|
+
>
|
|
187
|
+
<template #error>
|
|
188
|
+
<URow align="center" gap="2xs">
|
|
189
|
+
<UIcon name="error" size="xs" color="error" />
|
|
190
|
+
<UText size="sm" color="error">
|
|
191
|
+
<ul>
|
|
192
|
+
<li>You must accept the terms to continue</li>
|
|
193
|
+
<li>This checkbox is required for registration</li>
|
|
194
|
+
<li>Clear the error by checking the box above</li>
|
|
195
|
+
</ul>
|
|
196
|
+
</UText>
|
|
197
|
+
</URow>
|
|
198
|
+
</template>
|
|
199
|
+
</UCheckbox>
|
|
200
|
+
</UCol>
|
|
163
201
|
`,
|
|
164
|
-
};
|
|
202
|
+
});
|
|
@@ -319,23 +319,6 @@ describe("UCheckbox.vue", () => {
|
|
|
319
319
|
|
|
320
320
|
expect(errorElement.text()).toBe(customError);
|
|
321
321
|
});
|
|
322
|
-
|
|
323
|
-
it("Bottom – renders custom content from bottom slot", () => {
|
|
324
|
-
const customBottomContent = "Custom Bottom Content";
|
|
325
|
-
|
|
326
|
-
const component = mount(UCheckbox, {
|
|
327
|
-
props: {
|
|
328
|
-
label: "Test Label",
|
|
329
|
-
},
|
|
330
|
-
slots: {
|
|
331
|
-
bottom: customBottomContent,
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
const labelComponent = component.getComponent(ULabel);
|
|
336
|
-
|
|
337
|
-
expect(labelComponent.text()).toContain(customBottomContent);
|
|
338
|
-
});
|
|
339
322
|
});
|
|
340
323
|
|
|
341
324
|
describe("Events", () => {
|
|
@@ -189,3 +189,64 @@ CustomKeys.parameters = {
|
|
|
189
189
|
},
|
|
190
190
|
},
|
|
191
191
|
};
|
|
192
|
+
|
|
193
|
+
export const Slots: StoryFn<UCheckboxGroupArgs> = (args) => ({
|
|
194
|
+
components: { UCheckboxGroup, UCol, UText, URow, ULink, UIcon },
|
|
195
|
+
setup: () => ({
|
|
196
|
+
args,
|
|
197
|
+
modelValueLabel: ref(""),
|
|
198
|
+
modelValueDescription: ref(""),
|
|
199
|
+
modelValueError: ref(""),
|
|
200
|
+
}),
|
|
201
|
+
template: `
|
|
202
|
+
<UCol gap="3xl">
|
|
203
|
+
<UCheckboxGroup
|
|
204
|
+
v-bind="args"
|
|
205
|
+
v-model="modelValueLabel"
|
|
206
|
+
name="LabelSlot"
|
|
207
|
+
>
|
|
208
|
+
<template #label>
|
|
209
|
+
<URow align="center" gap="2xs">
|
|
210
|
+
<UText>Choose how we notify you</UText>
|
|
211
|
+
<UIcon name="notifications" size="xs" color="neutral" />
|
|
212
|
+
</URow>
|
|
213
|
+
</template>
|
|
214
|
+
</UCheckboxGroup>
|
|
215
|
+
|
|
216
|
+
<UCheckboxGroup
|
|
217
|
+
v-bind="args"
|
|
218
|
+
v-model="modelValueDescription"
|
|
219
|
+
name="SlotsDescription"
|
|
220
|
+
label="Notification channels"
|
|
221
|
+
>
|
|
222
|
+
<template #description>
|
|
223
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
224
|
+
<UIcon name="notifications" size="xs" color="primary" />
|
|
225
|
+
<UText size="sm">
|
|
226
|
+
You can change this later.
|
|
227
|
+
<ULink label="Notification settings" underlined size="sm" />.
|
|
228
|
+
</UText>
|
|
229
|
+
</URow>
|
|
230
|
+
</template>
|
|
231
|
+
</UCheckboxGroup>
|
|
232
|
+
|
|
233
|
+
<UCheckboxGroup
|
|
234
|
+
v-bind="args"
|
|
235
|
+
v-model="modelValueError"
|
|
236
|
+
name="SlotsError"
|
|
237
|
+
label="Select options"
|
|
238
|
+
:error="true"
|
|
239
|
+
>
|
|
240
|
+
<template #error>
|
|
241
|
+
<UText size="sm" color="error">
|
|
242
|
+
<ul>
|
|
243
|
+
<li>Invalid selection</li>
|
|
244
|
+
<li>At least one channel is required</li>
|
|
245
|
+
<li>Choose at least one option before submitting</li>
|
|
246
|
+
</ul>
|
|
247
|
+
</UText>
|
|
248
|
+
</template>
|
|
249
|
+
</UCheckboxGroup>
|
|
250
|
+
</UCol>
|
|
251
|
+
`,
|
|
252
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
2
|
+
import { ref } from "vue";
|
|
2
3
|
import {
|
|
3
4
|
getArgs,
|
|
4
5
|
getArgTypes,
|
|
@@ -13,6 +14,7 @@ import URow from "../../ui.container-row/URow.vue";
|
|
|
13
14
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
14
15
|
import UButton from "../../ui.button/UButton.vue";
|
|
15
16
|
import UText from "../../ui.text-block/UText.vue";
|
|
17
|
+
import ULink from "../../ui.button-link/ULink.vue";
|
|
16
18
|
|
|
17
19
|
import { COMPONENT_NAME } from "../constants";
|
|
18
20
|
|
|
@@ -364,43 +366,89 @@ export const IconProps: StoryFn<DefaultUDatePickerArgs> = (args) => ({
|
|
|
364
366
|
});
|
|
365
367
|
|
|
366
368
|
export const Slots: StoryFn<DefaultUDatePickerArgs> = (args) => ({
|
|
367
|
-
components: { UDatePicker, URow, UButton },
|
|
368
|
-
setup: () => ({
|
|
369
|
+
components: { UDatePicker, URow, UCol, UButton, UText, ULink, UIcon },
|
|
370
|
+
setup: () => ({
|
|
371
|
+
args,
|
|
372
|
+
descriptionSlotValue: ref(dateValue),
|
|
373
|
+
errorSlotValue: ref<Date | null>(null),
|
|
374
|
+
}),
|
|
369
375
|
template: `
|
|
370
|
-
<
|
|
371
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
<
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
376
|
+
<UCol gap="3xl">
|
|
377
|
+
<URow block>
|
|
378
|
+
<UDatePicker
|
|
379
|
+
v-bind="args"
|
|
380
|
+
v-model="args.leftModel"
|
|
381
|
+
class="w-full"
|
|
382
|
+
:config="{ datepickerInput: { wrapper: 'pl-0' } }"
|
|
383
|
+
>
|
|
384
|
+
<template #left>
|
|
385
|
+
<UButton
|
|
386
|
+
label="Today"
|
|
387
|
+
size="sm"
|
|
388
|
+
variant="soft"
|
|
389
|
+
class="h-full rounded-r-none"
|
|
390
|
+
@click="args.leftModel = new Date()"
|
|
391
|
+
/>
|
|
392
|
+
</template>
|
|
393
|
+
</UDatePicker>
|
|
394
|
+
|
|
395
|
+
<UDatePicker
|
|
396
|
+
v-bind="args"
|
|
397
|
+
v-model="args.modelValue"
|
|
398
|
+
class="w-full"
|
|
399
|
+
:config="{ datepickerInput: { wrapper: 'pr-0' } }"
|
|
400
|
+
>
|
|
401
|
+
<template #right>
|
|
402
|
+
<UButton
|
|
403
|
+
label="Clear"
|
|
404
|
+
size="sm"
|
|
405
|
+
variant="ghost"
|
|
406
|
+
class="h-full rounded-l-none"
|
|
407
|
+
@click="args.modelValue = null"
|
|
408
|
+
/>
|
|
409
|
+
</template>
|
|
410
|
+
</UDatePicker>
|
|
411
|
+
</URow>
|
|
412
|
+
|
|
413
|
+
<URow block>
|
|
414
|
+
<UDatePicker
|
|
415
|
+
v-bind="args"
|
|
416
|
+
v-model="descriptionSlotValue"
|
|
417
|
+
label="Event date"
|
|
418
|
+
class="w-full"
|
|
419
|
+
>
|
|
420
|
+
<template #description>
|
|
421
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
422
|
+
<UIcon name="event" size="xs" color="primary" />
|
|
423
|
+
<UText size="sm">
|
|
424
|
+
Uses your local timezone.
|
|
425
|
+
<ULink label="Date policy" underlined size="sm" />.
|
|
426
|
+
</UText>
|
|
427
|
+
</URow>
|
|
428
|
+
</template>
|
|
429
|
+
</UDatePicker>
|
|
430
|
+
|
|
431
|
+
<UDatePicker
|
|
432
|
+
v-bind="args"
|
|
433
|
+
v-model="errorSlotValue"
|
|
434
|
+
label="Due date"
|
|
435
|
+
:error="true"
|
|
436
|
+
class="w-full"
|
|
437
|
+
>
|
|
438
|
+
<template #error>
|
|
439
|
+
<URow align="center" gap="2xs">
|
|
440
|
+
<UIcon name="error" size="xs" color="error" />
|
|
441
|
+
<UText size="sm" color="error">
|
|
442
|
+
<ul>
|
|
443
|
+
<li>The selected date is not available</li>
|
|
444
|
+
<li>Pick a day within the allowed range</li>
|
|
445
|
+
<li>Weekends and holidays are excluded</li>
|
|
446
|
+
</ul>
|
|
447
|
+
</UText>
|
|
448
|
+
</URow>
|
|
449
|
+
</template>
|
|
450
|
+
</UDatePicker>
|
|
451
|
+
</URow>
|
|
452
|
+
</UCol>
|
|
405
453
|
`,
|
|
406
454
|
});
|