vueless 1.4.7 → 1.4.8
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/internal/apps.svg +1 -1
- package/icons/internal/calendar_month-fill.svg +1 -1
- package/icons/internal/error.svg +1 -1
- package/icons/internal/info.svg +1 -1
- package/icons/internal/progress_activity.svg +1 -1
- package/icons/internal/search.svg +1 -1
- package/icons/internal/visibility-fill.svg +1 -1
- package/icons/internal/warning.svg +1 -1
- package/icons/storybook/account_circle.svg +1 -1
- package/icons/storybook/cloud_sync.svg +1 -0
- package/icons/storybook/contact_mail.svg +1 -1
- package/icons/storybook/delivery_truck_speed.svg +1 -1
- package/icons/storybook/directions_bike.svg +1 -1
- package/icons/storybook/error.svg +1 -1
- package/icons/storybook/folder.svg +1 -0
- package/icons/storybook/handyman.svg +1 -1
- package/icons/storybook/help.svg +1 -1
- package/icons/storybook/inbox.svg +1 -1
- package/icons/storybook/inbox_customize.svg +1 -1
- package/icons/storybook/info.svg +1 -1
- package/icons/storybook/key.svg +1 -1
- package/icons/storybook/local_shipping.svg +1 -0
- package/icons/storybook/lock.svg +1 -1
- package/icons/storybook/lock_open.svg +1 -1
- package/icons/storybook/notifications.svg +1 -0
- package/icons/storybook/palette.svg +1 -1
- package/icons/storybook/person.svg +1 -1
- package/icons/storybook/person_search.svg +1 -1
- package/icons/storybook/progress_activity.svg +1 -1
- package/icons/storybook/rocket_launch.svg +1 -1
- package/icons/storybook/sentiment_satisfied.svg +1 -1
- package/icons/storybook/timer.svg +1 -1
- package/icons/storybook/travel_explore.svg +1 -1
- package/package.json +33 -32
- package/plugin-vite.js +18 -7
- package/ui.container-accordion/storybook/stories.ts +1 -1
- package/ui.container-accordion-item/storybook/stories.ts +1 -1
- package/ui.container-accordion-item/tests/UAccordionItem.test.ts +4 -2
- package/ui.container-card/storybook/stories.ts +40 -39
- package/ui.container-col/config.ts +4 -2
- package/ui.container-col/tests/UCol.test.ts +24 -16
- package/ui.container-drawer/tests/UDrawer.test.ts +11 -29
- package/ui.container-modal/storybook/stories.ts +2 -2
- package/ui.container-modal/tests/UModal.test.ts +10 -22
- package/ui.container-modal-confirm/storybook/stories.ts +17 -2
- package/ui.container-page/storybook/stories.ts +6 -1
- package/ui.container-row/config.ts +4 -2
- package/ui.container-row/tests/URow.test.ts +24 -16
- package/ui.data-table/UTableRow.vue +2 -2
- package/ui.data-table/storybook/stories.ts +1 -1
- package/ui.form-calendar/tests/UCalendar.test.ts +14 -13
- package/ui.form-calendar/tests/UCalendarDayView.test.ts +15 -16
- package/ui.form-checkbox/UCheckbox.vue +0 -5
- package/ui.form-checkbox/storybook/stories.ts +50 -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 +87 -37
- package/ui.form-date-picker-range/storybook/stories.ts +91 -38
- package/ui.form-input/storybook/stories.ts +71 -37
- package/ui.form-input-file/storybook/stories.ts +38 -5
- package/ui.form-input-number/storybook/stories.ts +60 -28
- package/ui.form-input-password/storybook/stories.ts +88 -50
- package/ui.form-input-rating/UInputRating.vue +8 -3
- package/ui.form-input-search/storybook/stories.ts +34 -4
- package/ui.form-label/ULabel.vue +0 -6
- package/ui.form-label/storybook/stories.ts +40 -24
- package/ui.form-label/tests/ULabel.test.ts +0 -12
- package/ui.form-listbox/tests/UListbox.test.ts +39 -3
- package/ui.form-radio/URadio.vue +0 -5
- package/ui.form-radio/storybook/stories.ts +60 -25
- package/ui.form-radio/tests/URadio.test.ts +0 -17
- package/ui.form-radio-group/storybook/stories.ts +61 -0
- package/ui.form-select/config.ts +4 -1
- package/ui.form-select/storybook/stories.ts +109 -46
- package/ui.form-switch/storybook/stories.ts +35 -11
- package/ui.form-textarea/storybook/stories.ts +55 -20
- package/ui.loader/tests/ULoader.test.ts +3 -3
- package/ui.navigation-progress/tests/UProgress.test.ts +2 -3
- package/ui.text-block/tests/UText.test.ts +3 -3
- package/ui.text-files/storybook/stories.ts +30 -13
- package/ui.text-header/tests/UHeader.test.ts +3 -3
- package/ui.text-notify/tests/UNotify.test.ts +14 -18
- package/utils/node/helper.js +8 -9
|
@@ -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,54 @@ 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
|
+
<UText size="sm" variant="lifted">
|
|
172
|
+
Unsubscribe anytime, see our
|
|
173
|
+
<ULink label="privacy policy" underlined size="sm" />.
|
|
174
|
+
</UText>
|
|
175
|
+
</template>
|
|
176
|
+
</UCheckbox>
|
|
156
177
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
178
|
+
<UCheckbox
|
|
179
|
+
v-bind="args"
|
|
180
|
+
v-model="errorSlotValue"
|
|
181
|
+
label="Accept terms"
|
|
182
|
+
:error="true"
|
|
183
|
+
>
|
|
184
|
+
<template #error>
|
|
185
|
+
<UText size="sm" color="error">
|
|
186
|
+
<ul>
|
|
187
|
+
<li>You must accept the terms to continue</li>
|
|
188
|
+
<li>This checkbox is required for registration</li>
|
|
189
|
+
<li>Clear the error by checking the box above</li>
|
|
190
|
+
</ul>
|
|
191
|
+
</UText>
|
|
192
|
+
</template>
|
|
193
|
+
</UCheckbox>
|
|
194
|
+
</UCol>
|
|
163
195
|
`,
|
|
164
|
-
};
|
|
196
|
+
});
|
|
@@ -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" variant="lifted">
|
|
226
|
+
You can change this later in
|
|
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,91 @@ 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
|
+
<UText size="sm" variant="lifted">
|
|
422
|
+
Uses your local timezone, see our
|
|
423
|
+
<ULink label="date policy" underlined size="sm" />.
|
|
424
|
+
</UText>
|
|
425
|
+
</template>
|
|
426
|
+
</UDatePicker>
|
|
427
|
+
|
|
428
|
+
<UDatePicker
|
|
429
|
+
v-bind="args"
|
|
430
|
+
v-model="errorSlotValue"
|
|
431
|
+
label="Due date"
|
|
432
|
+
:error="true"
|
|
433
|
+
class="w-full"
|
|
434
|
+
>
|
|
435
|
+
<template #error>
|
|
436
|
+
<UText size="sm" color="error">
|
|
437
|
+
<ul>
|
|
438
|
+
<li>The selected date is not available</li>
|
|
439
|
+
<li>Pick a day within the allowed range</li>
|
|
440
|
+
<li>Weekends and holidays are excluded</li>
|
|
441
|
+
</ul>
|
|
442
|
+
</UText>
|
|
443
|
+
</template>
|
|
444
|
+
</UDatePicker>
|
|
445
|
+
</URow>
|
|
446
|
+
</UCol>
|
|
405
447
|
`,
|
|
406
448
|
});
|
|
449
|
+
|
|
450
|
+
Slots.parameters = {
|
|
451
|
+
docs: {
|
|
452
|
+
story: {
|
|
453
|
+
height: "550px",
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
};
|
|
@@ -15,6 +15,7 @@ import UCol from "../../ui.container-col/UCol.vue";
|
|
|
15
15
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
16
16
|
import UButton from "../../ui.button/UButton.vue";
|
|
17
17
|
import UText from "../../ui.text-block/UText.vue";
|
|
18
|
+
import ULink from "../../ui.button-link/ULink.vue";
|
|
18
19
|
|
|
19
20
|
import { addDays } from "../../ui.form-calendar/utilDate";
|
|
20
21
|
|
|
@@ -296,44 +297,96 @@ export const IconProps: StoryFn<DefaultUDatePickerRangeArgs> = (args) => ({
|
|
|
296
297
|
});
|
|
297
298
|
|
|
298
299
|
export const Slots: StoryFn<DefaultUDatePickerRangeArgs> = (args) => ({
|
|
299
|
-
components: { UDatePickerRange, URow, UButton },
|
|
300
|
-
setup: () => ({
|
|
300
|
+
components: { UDatePickerRange, URow, UCol, UButton, UText, ULink, UIcon },
|
|
301
|
+
setup: () => ({
|
|
302
|
+
args,
|
|
303
|
+
fromDate,
|
|
304
|
+
toDate,
|
|
305
|
+
leftModel: ref({ from: null, to: null }),
|
|
306
|
+
descriptionSlotValue: ref({ from: fromDate, to: toDate }),
|
|
307
|
+
errorSlotValue: ref({ from: null, to: null }),
|
|
308
|
+
}),
|
|
301
309
|
template: `
|
|
302
|
-
<
|
|
303
|
-
<
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
<
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
<
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
310
|
+
<UCol gap="3xl">
|
|
311
|
+
<URow block>
|
|
312
|
+
<UDatePickerRange
|
|
313
|
+
label="Select date range"
|
|
314
|
+
v-model="leftModel"
|
|
315
|
+
variant="input"
|
|
316
|
+
class="w-full"
|
|
317
|
+
:config="{ datepickerInput: { wrapper: 'pl-0' } }"
|
|
318
|
+
>
|
|
319
|
+
<template #left>
|
|
320
|
+
<UButton
|
|
321
|
+
label="2 weeks"
|
|
322
|
+
size="sm"
|
|
323
|
+
variant="soft"
|
|
324
|
+
class="h-full rounded-r-none"
|
|
325
|
+
@click="leftModel = { from: fromDate, to: toDate }"
|
|
326
|
+
/>
|
|
327
|
+
</template>
|
|
328
|
+
</UDatePickerRange>
|
|
329
|
+
<UDatePickerRange
|
|
330
|
+
label="Select date range"
|
|
331
|
+
v-model="args.modelValue"
|
|
332
|
+
variant="input"
|
|
333
|
+
class="w-full"
|
|
334
|
+
:config="{ datepickerInput: { wrapper: 'pr-0' } }"
|
|
335
|
+
>
|
|
336
|
+
<template #right>
|
|
337
|
+
<UButton
|
|
338
|
+
label="Clear"
|
|
339
|
+
size="sm"
|
|
340
|
+
variant="ghost"
|
|
341
|
+
class="h-full rounded-l-none"
|
|
342
|
+
@click="args.modelValue = { from: null, to: null }"
|
|
343
|
+
/>
|
|
344
|
+
</template>
|
|
345
|
+
</UDatePickerRange>
|
|
346
|
+
</URow>
|
|
347
|
+
|
|
348
|
+
<URow block>
|
|
349
|
+
<UDatePickerRange
|
|
350
|
+
v-bind="args"
|
|
351
|
+
v-model="descriptionSlotValue"
|
|
352
|
+
variant="input"
|
|
353
|
+
label="Report period"
|
|
354
|
+
class="w-full"
|
|
355
|
+
>
|
|
356
|
+
<template #description>
|
|
357
|
+
<UText size="sm" variant="lifted">
|
|
358
|
+
Inclusive of start and end, see the
|
|
359
|
+
<ULink label="fiscal calendar" underlined size="sm" />.
|
|
360
|
+
</UText>
|
|
361
|
+
</template>
|
|
362
|
+
</UDatePickerRange>
|
|
363
|
+
|
|
364
|
+
<UDatePickerRange
|
|
365
|
+
v-bind="args"
|
|
366
|
+
v-model="errorSlotValue"
|
|
367
|
+
variant="input"
|
|
368
|
+
label="Stay dates"
|
|
369
|
+
:error="true"
|
|
370
|
+
class="w-full"
|
|
371
|
+
>
|
|
372
|
+
<template #error>
|
|
373
|
+
<UText size="sm" color="error">
|
|
374
|
+
<ul>
|
|
375
|
+
<li>End date must be after the start date</li>
|
|
376
|
+
<li>Range cannot span more than 30 days</li>
|
|
377
|
+
<li>Select both dates from the calendar</li>
|
|
378
|
+
</ul>
|
|
379
|
+
</UText>
|
|
380
|
+
</template>
|
|
381
|
+
</UDatePickerRange>
|
|
382
|
+
</URow>
|
|
383
|
+
</UCol>
|
|
338
384
|
`,
|
|
339
385
|
});
|
|
386
|
+
Slots.parameters = {
|
|
387
|
+
docs: {
|
|
388
|
+
story: {
|
|
389
|
+
height: "700px",
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
};
|
|
@@ -13,6 +13,7 @@ import URow from "../../ui.container-row/URow.vue";
|
|
|
13
13
|
import UDropdownButton from "../../ui.dropdown-button/UDropdownButton.vue";
|
|
14
14
|
import UText from "../../ui.text-block/UText.vue";
|
|
15
15
|
import UChip from "../../ui.other-chip/UChip.vue";
|
|
16
|
+
import ULink from "../../ui.button-link/ULink.vue";
|
|
16
17
|
|
|
17
18
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
18
19
|
import type { Props } from "../types";
|
|
@@ -190,7 +191,7 @@ export const IconProps: StoryFn<UInputArgs> = (args) => ({
|
|
|
190
191
|
});
|
|
191
192
|
|
|
192
193
|
export const Slots: StoryFn<UInputArgs> = (args) => ({
|
|
193
|
-
components: { UInput, URow, UDropdownButton, UText, UChip },
|
|
194
|
+
components: { UInput, URow, UCol, UDropdownButton, UText, UChip, ULink, UIcon },
|
|
194
195
|
setup() {
|
|
195
196
|
const countryCodes = [
|
|
196
197
|
{ label: "+33", value: "+33" },
|
|
@@ -199,50 +200,83 @@ export const Slots: StoryFn<UInputArgs> = (args) => ({
|
|
|
199
200
|
];
|
|
200
201
|
|
|
201
202
|
const countryCode = ref("+33");
|
|
203
|
+
const descriptionSlotValue = ref("");
|
|
204
|
+
const errorSlotValue = ref("");
|
|
202
205
|
|
|
203
|
-
return { args, countryCode, countryCodes };
|
|
206
|
+
return { args, countryCode, countryCodes, descriptionSlotValue, errorSlotValue };
|
|
204
207
|
},
|
|
205
208
|
template: `
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
<
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
<
|
|
231
|
-
{
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
209
|
+
<UCol gap="3xl">
|
|
210
|
+
<URow block>
|
|
211
|
+
<UInput
|
|
212
|
+
label="Phone Number"
|
|
213
|
+
placeholder="Enter your phone number"
|
|
214
|
+
:config="{ wrapper: 'pl-0' }"
|
|
215
|
+
>
|
|
216
|
+
<template #label="{ label }">
|
|
217
|
+
{{ label }}
|
|
218
|
+
<span class="text-red-500">*</span>
|
|
219
|
+
</template>
|
|
220
|
+
|
|
221
|
+
<template #left>
|
|
222
|
+
<UDropdownButton
|
|
223
|
+
v-model="countryCode"
|
|
224
|
+
:options="countryCodes"
|
|
225
|
+
square
|
|
226
|
+
size="sm"
|
|
227
|
+
variant="soft"
|
|
228
|
+
class="rounded-r-none h-[49px]"
|
|
229
|
+
/>
|
|
230
|
+
</template>
|
|
231
|
+
</UInput>
|
|
232
|
+
|
|
233
|
+
<UInput label="Website" placeholder="Enter your website">
|
|
234
|
+
<template #label="{ label }">
|
|
235
|
+
{{ label }}
|
|
236
|
+
<span class="text-red-500">*</span>
|
|
237
|
+
</template>
|
|
238
|
+
|
|
239
|
+
<template #right>
|
|
240
|
+
<UText label=".com" variant="lifted" :wrap="false" />
|
|
241
|
+
</template>
|
|
242
|
+
</UInput>
|
|
243
|
+
</URow>
|
|
244
|
+
|
|
245
|
+
<URow block>
|
|
246
|
+
<UInput v-model="descriptionSlotValue" label="Display name">
|
|
247
|
+
<template #description>
|
|
248
|
+
<UText size="sm" variant="lifted">
|
|
249
|
+
Shown on your public profile, read the
|
|
250
|
+
<ULink label="naming policy" underlined size="sm" />.
|
|
251
|
+
</UText>
|
|
252
|
+
</template>
|
|
253
|
+
</UInput>
|
|
254
|
+
|
|
255
|
+
<UInput
|
|
256
|
+
v-model="errorSlotValue"
|
|
257
|
+
label="Name"
|
|
258
|
+
:error="true"
|
|
259
|
+
>
|
|
260
|
+
<template #error>
|
|
261
|
+
<URow align="center" gap="2xs">
|
|
262
|
+
<UText size="sm" color="error">
|
|
263
|
+
<ul>
|
|
264
|
+
<li>This field failed validation</li>
|
|
265
|
+
<li>Check minimum and maximum length rules</li>
|
|
266
|
+
<li>Only allowed characters may be used</li>
|
|
267
|
+
</ul>
|
|
268
|
+
</UText>
|
|
269
|
+
</URow>
|
|
270
|
+
</template>
|
|
271
|
+
</UInput>
|
|
272
|
+
</URow>
|
|
273
|
+
</UCol>
|
|
240
274
|
`,
|
|
241
275
|
});
|
|
242
276
|
Slots.parameters = {
|
|
243
277
|
docs: {
|
|
244
278
|
story: {
|
|
245
|
-
height: "
|
|
279
|
+
height: "300px",
|
|
246
280
|
},
|
|
247
281
|
},
|
|
248
282
|
};
|