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
|
@@ -44,34 +44,34 @@ export default {
|
|
|
44
44
|
},
|
|
45
45
|
} as Meta;
|
|
46
46
|
|
|
47
|
-
const defaultTemplate =
|
|
48
|
-
|
|
49
|
-
justify="between"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</
|
|
73
|
-
|
|
74
|
-
|
|
47
|
+
const defaultTemplate = (isInvertedExpr: string = "false") => {
|
|
48
|
+
return `
|
|
49
|
+
<UCol justify="between" block class="h-full">
|
|
50
|
+
<URow
|
|
51
|
+
v-for="(cookie, index) in cookieSettings"
|
|
52
|
+
:key="cookie.label"
|
|
53
|
+
align="center"
|
|
54
|
+
block
|
|
55
|
+
gap="sm"
|
|
56
|
+
>
|
|
57
|
+
<UCol gap="2xs" class="min-w-0 flex-1">
|
|
58
|
+
<UHeader
|
|
59
|
+
:label="cookie.label"
|
|
60
|
+
class="text-sm"
|
|
61
|
+
:class="{ 'text-inverted': ${isInvertedExpr} }"
|
|
62
|
+
/>
|
|
63
|
+
<UText
|
|
64
|
+
:label="cookie.description"
|
|
65
|
+
size="sm"
|
|
66
|
+
variant="lifted"
|
|
67
|
+
/>
|
|
68
|
+
</UCol>
|
|
69
|
+
|
|
70
|
+
<USwitch v-model="cookieValues[index]" class="shrink-0" />
|
|
71
|
+
</URow>
|
|
72
|
+
</UCol>
|
|
73
|
+
`;
|
|
74
|
+
};
|
|
75
75
|
|
|
76
76
|
const cookieSettings = ref([
|
|
77
77
|
{
|
|
@@ -95,7 +95,7 @@ const DefaultTemplate: StoryFn<UCardArgs> = (args: UCardArgs) => ({
|
|
|
95
95
|
setup: () => ({ args, slots: getSlotNames(UCard.__name), cookieSettings, cookieValues }),
|
|
96
96
|
template: `
|
|
97
97
|
<UCard v-bind="args" class="max-w-96">
|
|
98
|
-
${args.slotTemplate || getSlotsFragment(defaultTemplate)}
|
|
98
|
+
${args.slotTemplate || getSlotsFragment(defaultTemplate())}
|
|
99
99
|
</UCard>
|
|
100
100
|
`,
|
|
101
101
|
});
|
|
@@ -109,9 +109,10 @@ const EnumTemplate: StoryFn<UCardArgs> = (args: UCardArgs, { argTypes }) => ({
|
|
|
109
109
|
v-for="option in argTypes?.[args.enum]?.options"
|
|
110
110
|
v-bind="getArgs(args, option)"
|
|
111
111
|
:key="option"
|
|
112
|
+
:config="{ title: option === 'inverted' ? 'text-inverted' : 'text-default' }"
|
|
112
113
|
class="max-w-96"
|
|
113
114
|
>
|
|
114
|
-
${defaultTemplate}
|
|
115
|
+
${defaultTemplate("option === 'inverted'")}
|
|
115
116
|
</UCard>
|
|
116
117
|
</URow>
|
|
117
118
|
`,
|
|
@@ -135,7 +136,7 @@ NoDivided.args = {
|
|
|
135
136
|
<template #footer-left>
|
|
136
137
|
<UButton size="sm" label="Save" variant="subtle" />
|
|
137
138
|
</template>
|
|
138
|
-
${defaultTemplate}
|
|
139
|
+
${defaultTemplate()}
|
|
139
140
|
`,
|
|
140
141
|
};
|
|
141
142
|
|
|
@@ -145,7 +146,7 @@ BeforeTitleSlot.args = {
|
|
|
145
146
|
<template #before-title>
|
|
146
147
|
<UIcon name="cookie" color="success" size="sm" />
|
|
147
148
|
</template>
|
|
148
|
-
${defaultTemplate}
|
|
149
|
+
${defaultTemplate()}
|
|
149
150
|
`,
|
|
150
151
|
};
|
|
151
152
|
|
|
@@ -155,7 +156,7 @@ TitleSlot.args = {
|
|
|
155
156
|
<template #title="{ title }">
|
|
156
157
|
<UHeader :label="title" color="primary" />
|
|
157
158
|
</template>
|
|
158
|
-
${defaultTemplate}
|
|
159
|
+
${defaultTemplate()}
|
|
159
160
|
`,
|
|
160
161
|
};
|
|
161
162
|
|
|
@@ -165,7 +166,7 @@ AfterTitleSlot.args = {
|
|
|
165
166
|
<template #after-title>
|
|
166
167
|
<UIcon name="cookie" color="success" size="sm" />
|
|
167
168
|
</template>
|
|
168
|
-
${defaultTemplate}
|
|
169
|
+
${defaultTemplate()}
|
|
169
170
|
`,
|
|
170
171
|
};
|
|
171
172
|
|
|
@@ -175,18 +176,18 @@ ActionsSlot.args = {
|
|
|
175
176
|
slotTemplate: `
|
|
176
177
|
<template #actions>
|
|
177
178
|
<URow align="center" class="max-w-fit">
|
|
178
|
-
<ULink label="Learn more" />
|
|
179
|
-
<UButton
|
|
179
|
+
<ULink label="Learn more" size="sm" />
|
|
180
|
+
<UButton label="Manage" variant="subtle" size="xs" />
|
|
180
181
|
</URow>
|
|
181
182
|
</template>
|
|
182
|
-
${defaultTemplate}
|
|
183
|
+
${defaultTemplate()}
|
|
183
184
|
`,
|
|
184
185
|
};
|
|
185
186
|
|
|
186
187
|
export const FooterLeftSlot = DefaultTemplate.bind({});
|
|
187
188
|
FooterLeftSlot.args = {
|
|
188
189
|
slotTemplate: `
|
|
189
|
-
${defaultTemplate}
|
|
190
|
+
${defaultTemplate()}
|
|
190
191
|
<template #footer-left>
|
|
191
192
|
<UButton size="sm" label="Cancel" variant="outlined" />
|
|
192
193
|
</template>
|
|
@@ -196,7 +197,7 @@ FooterLeftSlot.args = {
|
|
|
196
197
|
export const FooterRightSlot = DefaultTemplate.bind({});
|
|
197
198
|
FooterRightSlot.args = {
|
|
198
199
|
slotTemplate: `
|
|
199
|
-
${defaultTemplate}
|
|
200
|
+
${defaultTemplate()}
|
|
200
201
|
<template #footer-right>
|
|
201
202
|
<UButton size="sm" label="Save" />
|
|
202
203
|
</template>
|
|
@@ -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", () => {
|
|
@@ -525,10 +525,10 @@ describe("UDrawer", () => {
|
|
|
525
525
|
expect(component.emitted("close")).toBeTruthy();
|
|
526
526
|
});
|
|
527
527
|
|
|
528
|
-
it("CloseOnOverlay – emits events when overlay is clicked based on prop", () => {
|
|
528
|
+
it("CloseOnOverlay – emits events when overlay is clicked based on prop", async () => {
|
|
529
529
|
const closeOnOverlay = [true, false];
|
|
530
530
|
|
|
531
|
-
|
|
531
|
+
for (const value of closeOnOverlay) {
|
|
532
532
|
const component = mount(UDrawer, {
|
|
533
533
|
props: {
|
|
534
534
|
modelValue,
|
|
@@ -541,15 +541,9 @@ describe("UDrawer", () => {
|
|
|
541
541
|
await innerWrapper.trigger("mousedown");
|
|
542
542
|
await innerWrapper.trigger("click");
|
|
543
543
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
expect(component.emitted("close")).toBeTruthy();
|
|
548
|
-
} else {
|
|
549
|
-
expect(component.emitted("update:modelValue")).toBeFalsy();
|
|
550
|
-
expect(component.emitted("close")).toBeFalsy();
|
|
551
|
-
}
|
|
552
|
-
});
|
|
544
|
+
expect(component.emitted("update:modelValue")).toEqual(value ? [[false]] : undefined);
|
|
545
|
+
expect(Boolean(component.emitted("close")?.length)).toBe(value);
|
|
546
|
+
}
|
|
553
547
|
});
|
|
554
548
|
|
|
555
549
|
it("CloseOnOverlay – does not close when mousedown on drawer and mouseup on overlay", async () => {
|
|
@@ -573,10 +567,10 @@ describe("UDrawer", () => {
|
|
|
573
567
|
expect(component.emitted("close")).toBeFalsy();
|
|
574
568
|
});
|
|
575
569
|
|
|
576
|
-
it("CloseOnEsc – emits events when escape key is pressed based on prop", () => {
|
|
570
|
+
it("CloseOnEsc – emits events when escape key is pressed based on prop", async () => {
|
|
577
571
|
const closeOnEsc = [true, false];
|
|
578
572
|
|
|
579
|
-
|
|
573
|
+
for (const value of closeOnEsc) {
|
|
580
574
|
const component = mount(UDrawer, {
|
|
581
575
|
props: {
|
|
582
576
|
modelValue,
|
|
@@ -588,15 +582,9 @@ describe("UDrawer", () => {
|
|
|
588
582
|
|
|
589
583
|
await wrapper.trigger("keydown", { key: "Escape" });
|
|
590
584
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
expect(component.emitted("close")).toBeTruthy();
|
|
595
|
-
} else {
|
|
596
|
-
expect(component.emitted("update:modelValue")).toBeFalsy();
|
|
597
|
-
expect(component.emitted("close")).toBeFalsy();
|
|
598
|
-
}
|
|
599
|
-
});
|
|
585
|
+
expect(component.emitted("update:modelValue")).toEqual(value ? [[false]] : undefined);
|
|
586
|
+
expect(Boolean(component.emitted("close")?.length)).toBe(value);
|
|
587
|
+
}
|
|
600
588
|
});
|
|
601
589
|
});
|
|
602
590
|
|
|
@@ -718,13 +706,7 @@ describe("UDrawer", () => {
|
|
|
718
706
|
const drawerElement = component.find("[vl-key='drawerWrapper']");
|
|
719
707
|
const style = drawerElement.attributes("style");
|
|
720
708
|
|
|
721
|
-
|
|
722
|
-
if (style) {
|
|
723
|
-
expect(style).toContain("transform");
|
|
724
|
-
} else {
|
|
725
|
-
// If no style attribute, that's also valid (transform might be applied via CSS classes)
|
|
726
|
-
expect(drawerElement.exists()).toBe(true);
|
|
727
|
-
}
|
|
709
|
+
expect(style ? style.includes("transform") : drawerElement.exists()).toBe(true);
|
|
728
710
|
});
|
|
729
711
|
});
|
|
730
712
|
|
|
@@ -264,7 +264,7 @@ WithoutDivider.args = {
|
|
|
264
264
|
slotTemplate: `
|
|
265
265
|
${defaultTemplate}
|
|
266
266
|
<template #footer-left>
|
|
267
|
-
<UButton label="Back" color="neutral" variant="subtle" />
|
|
267
|
+
<UButton label="Back" color="neutral" variant="subtle" block />
|
|
268
268
|
</template>`,
|
|
269
269
|
};
|
|
270
270
|
WithoutDivider.parameters = {
|
|
@@ -404,7 +404,7 @@ FooterRightSlot.args = {
|
|
|
404
404
|
</template>
|
|
405
405
|
|
|
406
406
|
<template #footer-right>
|
|
407
|
-
<UButton label="
|
|
407
|
+
<UButton label="Not now" variant="subtle" color="neutral" />
|
|
408
408
|
</template>
|
|
409
409
|
`,
|
|
410
410
|
};
|
|
@@ -578,10 +578,10 @@ describe("UModal", () => {
|
|
|
578
578
|
});
|
|
579
579
|
|
|
580
580
|
// CloseOnOverlay events
|
|
581
|
-
it("emits events when overlay is clicked based on closeOnOverlay prop", () => {
|
|
581
|
+
it("emits events when overlay is clicked based on closeOnOverlay prop", async () => {
|
|
582
582
|
const closeOnOverlay = [true, false];
|
|
583
583
|
|
|
584
|
-
|
|
584
|
+
for (const value of closeOnOverlay) {
|
|
585
585
|
const component = mount(UModal, {
|
|
586
586
|
props: {
|
|
587
587
|
modelValue,
|
|
@@ -594,15 +594,9 @@ describe("UModal", () => {
|
|
|
594
594
|
await innerWrapper.trigger("mousedown");
|
|
595
595
|
await innerWrapper.trigger("click");
|
|
596
596
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
expect(component.emitted("close")).toBeTruthy();
|
|
601
|
-
} else {
|
|
602
|
-
expect(component.emitted("update:modelValue")).toBeFalsy();
|
|
603
|
-
expect(component.emitted("close")).toBeFalsy();
|
|
604
|
-
}
|
|
605
|
-
});
|
|
597
|
+
expect(component.emitted("update:modelValue")).toEqual(value ? [[false]] : undefined);
|
|
598
|
+
expect(Boolean(component.emitted("close")?.length)).toBe(value);
|
|
599
|
+
}
|
|
606
600
|
});
|
|
607
601
|
|
|
608
602
|
it("does not close when mousedown on modal and mouseup on overlay", async () => {
|
|
@@ -627,10 +621,10 @@ describe("UModal", () => {
|
|
|
627
621
|
});
|
|
628
622
|
|
|
629
623
|
// CloseOnEsc events
|
|
630
|
-
it("emits events when escape key is pressed based on closeOnEsc prop", () => {
|
|
624
|
+
it("emits events when escape key is pressed based on closeOnEsc prop", async () => {
|
|
631
625
|
const closeOnEsc = [true, false];
|
|
632
626
|
|
|
633
|
-
|
|
627
|
+
for (const value of closeOnEsc) {
|
|
634
628
|
const component = mount(UModal, {
|
|
635
629
|
props: {
|
|
636
630
|
modelValue,
|
|
@@ -642,15 +636,9 @@ describe("UModal", () => {
|
|
|
642
636
|
|
|
643
637
|
await wrapper.trigger("keydown", { key: "Escape" });
|
|
644
638
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
expect(component.emitted("close")).toBeTruthy();
|
|
649
|
-
} else {
|
|
650
|
-
expect(component.emitted("update:modelValue")).toBeFalsy();
|
|
651
|
-
expect(component.emitted("close")).toBeFalsy();
|
|
652
|
-
}
|
|
653
|
-
});
|
|
639
|
+
expect(component.emitted("update:modelValue")).toEqual(value ? [[false]] : undefined);
|
|
640
|
+
expect(Boolean(component.emitted("close")?.length)).toBe(value);
|
|
641
|
+
}
|
|
654
642
|
});
|
|
655
643
|
});
|
|
656
644
|
|
|
@@ -27,6 +27,10 @@ interface UModalConfirmArgs extends Props {
|
|
|
27
27
|
modelValues?: UnknownObject;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
const confirmModalDocsLayout = {
|
|
31
|
+
innerWrapper: "w-full max-h-full",
|
|
32
|
+
};
|
|
33
|
+
|
|
30
34
|
export default {
|
|
31
35
|
id: "5080",
|
|
32
36
|
title: "Containers / Modal Confirm",
|
|
@@ -35,6 +39,9 @@ export default {
|
|
|
35
39
|
title: "Confirm Subscription Upgrade",
|
|
36
40
|
confirmLabel: "Confirm",
|
|
37
41
|
modelValue: true,
|
|
42
|
+
config: {
|
|
43
|
+
confirmModal: confirmModalDocsLayout,
|
|
44
|
+
},
|
|
38
45
|
},
|
|
39
46
|
argTypes: {
|
|
40
47
|
...getArgTypes(UModalConfirm.__name),
|
|
@@ -152,7 +159,14 @@ export const Inner: StoryFn<UModalConfirmArgs> = (args: UModalConfirmArgs) => ({
|
|
|
152
159
|
resetBodyOverflow();
|
|
153
160
|
}
|
|
154
161
|
|
|
155
|
-
return {
|
|
162
|
+
return {
|
|
163
|
+
args,
|
|
164
|
+
showMainModal,
|
|
165
|
+
showInnerModal,
|
|
166
|
+
openMainModal,
|
|
167
|
+
openInnerModal,
|
|
168
|
+
confirmModalDocsLayout,
|
|
169
|
+
};
|
|
156
170
|
},
|
|
157
171
|
template: `
|
|
158
172
|
<div>
|
|
@@ -181,6 +195,7 @@ export const Inner: StoryFn<UModalConfirmArgs> = (args: UModalConfirmArgs) => ({
|
|
|
181
195
|
"
|
|
182
196
|
confirm-label="Agree"
|
|
183
197
|
inner
|
|
198
|
+
:config="{ confirmModal: confirmModalDocsLayout }"
|
|
184
199
|
>
|
|
185
200
|
<UText label="Click Agree to proceed with subscription upgrade." />
|
|
186
201
|
</UModalConfirm>
|
|
@@ -291,7 +306,7 @@ AfterTitleSlot.args = {
|
|
|
291
306
|
|
|
292
307
|
export const ActionsSlot = DefaultTemplate.bind({});
|
|
293
308
|
ActionsSlot.args = {
|
|
294
|
-
config: { confirmModal: { closeButton: "p-0" } },
|
|
309
|
+
config: { confirmModal: { closeButton: "p-0", innerWrapper: "w-full max-h-full" } },
|
|
295
310
|
slotTemplate: `
|
|
296
311
|
<template #actions="{ close }">
|
|
297
312
|
<UButton
|
|
@@ -35,6 +35,7 @@ export default {
|
|
|
35
35
|
component: UPage,
|
|
36
36
|
args: {
|
|
37
37
|
title: "Join Our Community",
|
|
38
|
+
config: { wrapper: "min-h-max", page: "min-h-max" },
|
|
38
39
|
},
|
|
39
40
|
argTypes: {
|
|
40
41
|
...getArgTypes(UPage.__name),
|
|
@@ -142,7 +143,11 @@ const EnumTemplate: StoryFn<UPageArgs> = (args: UPageArgs, { argTypes }) => ({
|
|
|
142
143
|
v-for="option in argTypes?.[args.enum]?.options"
|
|
143
144
|
v-bind="getArgs(args, option)"
|
|
144
145
|
:key="option"
|
|
145
|
-
:config="{
|
|
146
|
+
:config="{
|
|
147
|
+
wrapper: 'min-h-max',
|
|
148
|
+
page: 'min-h-max mb-4',
|
|
149
|
+
title: option === 'inverted' ? 'text-inverted' : 'text-default'
|
|
150
|
+
}"
|
|
146
151
|
>
|
|
147
152
|
${defaultTemplate}
|
|
148
153
|
</UPage>
|
|
@@ -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", () => {
|
|
@@ -284,8 +284,8 @@ function resolveSlotContent(slot: Slot | undefined, slotParams: Record<string, u
|
|
|
284
284
|
function shouldRenderCellWrapper(row: Row, key: string): boolean {
|
|
285
285
|
return Boolean(
|
|
286
286
|
props.textEllipsis ||
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
(props.search && isCellSearchMatch(key)) ||
|
|
288
|
+
getCellContentClass(row, String(key)),
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
291
|
|
|
@@ -62,6 +62,15 @@ describe("UCalendar.vue", () => {
|
|
|
62
62
|
it("View – sets the correct view variant", () => {
|
|
63
63
|
const viewCases = [View.Day, View.Month, View.Year];
|
|
64
64
|
|
|
65
|
+
const viewExpectations: Record<
|
|
66
|
+
(typeof viewCases)[number],
|
|
67
|
+
{ day: boolean; month: boolean; year: boolean }
|
|
68
|
+
> = {
|
|
69
|
+
[View.Day]: { day: true, month: false, year: false },
|
|
70
|
+
[View.Month]: { day: false, month: true, year: false },
|
|
71
|
+
[View.Year]: { day: false, month: false, year: true },
|
|
72
|
+
};
|
|
73
|
+
|
|
65
74
|
viewCases.forEach((view) => {
|
|
66
75
|
const component = mount(UCalendar, {
|
|
67
76
|
props: {
|
|
@@ -70,19 +79,11 @@ describe("UCalendar.vue", () => {
|
|
|
70
79
|
},
|
|
71
80
|
});
|
|
72
81
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
expect(component.findComponent(DayView).exists()).toBe(false);
|
|
79
|
-
expect(component.findComponent(MonthView).exists()).toBe(true);
|
|
80
|
-
expect(component.findComponent(YearView).exists()).toBe(false);
|
|
81
|
-
} else if (view === View.Year) {
|
|
82
|
-
expect(component.findComponent(DayView).exists()).toBe(false);
|
|
83
|
-
expect(component.findComponent(MonthView).exists()).toBe(false);
|
|
84
|
-
expect(component.findComponent(YearView).exists()).toBe(true);
|
|
85
|
-
}
|
|
82
|
+
const expected = viewExpectations[view];
|
|
83
|
+
|
|
84
|
+
expect(component.findComponent(DayView).exists()).toBe(expected.day);
|
|
85
|
+
expect(component.findComponent(MonthView).exists()).toBe(expected.month);
|
|
86
|
+
expect(component.findComponent(YearView).exists()).toBe(expected.year);
|
|
86
87
|
});
|
|
87
88
|
});
|
|
88
89
|
|
|
@@ -332,13 +332,12 @@ describe("UCalendarDayView.vue", () => {
|
|
|
332
332
|
const dayButtons = component.findAll("button");
|
|
333
333
|
const targetDay = dayButtons.find((button) => button.text() === "15");
|
|
334
334
|
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
expect(targetDay, "day 15 should exist in the grid").toBeTruthy();
|
|
336
|
+
await targetDay!.trigger("mouseover");
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
const lastRangePreview = component.find('[vl-key="lastDayInRange"]');
|
|
339
339
|
|
|
340
|
-
|
|
341
|
-
}
|
|
340
|
+
expect(lastRangePreview.exists()).toBe(true);
|
|
342
341
|
});
|
|
343
342
|
|
|
344
343
|
it("applies another month range preview classes when hovering over another month day", async () => {
|
|
@@ -354,13 +353,14 @@ describe("UCalendarDayView.vue", () => {
|
|
|
354
353
|
|
|
355
354
|
const anotherMonthDays = component.findAll('[vl-key="anotherMonthDay"]');
|
|
356
355
|
|
|
357
|
-
|
|
358
|
-
|
|
356
|
+
expect(anotherMonthDays.length, "need another-month cells for hover preview").toBeGreaterThan(
|
|
357
|
+
0,
|
|
358
|
+
);
|
|
359
|
+
await anotherMonthDays[0].trigger("mouseover");
|
|
359
360
|
|
|
360
|
-
|
|
361
|
+
const anotherMonthPreview = component.findAll('[vl-key="anotherMonthDayInRange"]');
|
|
361
362
|
|
|
362
|
-
|
|
363
|
-
}
|
|
363
|
+
expect(anotherMonthPreview.length).toBeGreaterThanOrEqual(0);
|
|
364
364
|
});
|
|
365
365
|
|
|
366
366
|
it("clears range preview when mouse leaves day view", async () => {
|
|
@@ -376,14 +376,13 @@ describe("UCalendarDayView.vue", () => {
|
|
|
376
376
|
const dayButtons = component.findAll("button");
|
|
377
377
|
const targetDay = dayButtons.find((button) => button.text() === "15");
|
|
378
378
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
expect(targetDay, "day 15 should exist in the grid").toBeTruthy();
|
|
380
|
+
await targetDay!.trigger("mouseover");
|
|
381
|
+
await component.trigger("mouseleave");
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
const lastRangePreview = component.find('[vl-key="lastDayInRange"]');
|
|
384
384
|
|
|
385
|
-
|
|
386
|
-
}
|
|
385
|
+
expect(lastRangePreview.exists()).toBe(false);
|
|
387
386
|
});
|
|
388
387
|
});
|
|
389
388
|
|
|
@@ -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>
|