vueless 1.2.10-beta.1 → 1.2.10-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/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/icons/storybook/arrow_forward_ios.svg +1 -0
- package/index.d.ts +1 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/types.ts +2 -0
- package/ui.container-drawer/UDrawer.vue +365 -0
- package/ui.container-drawer/config.ts +128 -0
- package/ui.container-drawer/constants.ts +5 -0
- package/ui.container-drawer/storybook/docs.mdx +16 -0
- package/ui.container-drawer/storybook/stories.ts +255 -0
- package/ui.container-drawer/tests/UDrawer.test.ts +680 -0
- package/ui.container-drawer/types.ts +67 -0
- package/ui.container-modal/storybook/stories.ts +4 -1
- package/ui.container-modal-confirm/storybook/stories.ts +29 -24
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import defaultConfig from "./config";
|
|
2
|
+
|
|
3
|
+
import type { ComponentConfig } from "../types";
|
|
4
|
+
|
|
5
|
+
export type Config = typeof defaultConfig;
|
|
6
|
+
|
|
7
|
+
export interface Props {
|
|
8
|
+
/**
|
|
9
|
+
* Drawer state (shown / hidden).
|
|
10
|
+
*/
|
|
11
|
+
modelValue?: boolean;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Drawer title.
|
|
15
|
+
*/
|
|
16
|
+
title?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Drawer description.
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Drawer position.
|
|
25
|
+
*/
|
|
26
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Drawer variant.
|
|
30
|
+
*/
|
|
31
|
+
variant?: "solid" | "outlined" | "subtle" | "soft";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Control whether the Drawer has a handle or not.
|
|
35
|
+
*/
|
|
36
|
+
handle?: boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Inset the drawer from the edges.
|
|
40
|
+
*/
|
|
41
|
+
inset?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Allow closing drawer by clicking on overlay.
|
|
45
|
+
*/
|
|
46
|
+
closeOnOverlay?: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Allow closing drawer by pressing escape (esc) on the keyboard.
|
|
50
|
+
*/
|
|
51
|
+
closeOnEsc?: boolean;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Unique element id.
|
|
55
|
+
*/
|
|
56
|
+
id?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Component config object.
|
|
60
|
+
*/
|
|
61
|
+
config?: ComponentConfig<Config>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Data-test attribute for automated testing.
|
|
65
|
+
*/
|
|
66
|
+
dataTest?: string | null;
|
|
67
|
+
}
|
|
@@ -25,7 +25,7 @@ import type { UnknownObject } from "../../types";
|
|
|
25
25
|
|
|
26
26
|
interface UModalArgs extends Props {
|
|
27
27
|
slotTemplate?: string;
|
|
28
|
-
enum: "size";
|
|
28
|
+
enum: "size" | "variant";
|
|
29
29
|
modelValues?: UnknownObject;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -280,6 +280,9 @@ WithoutDivider.parameters = {
|
|
|
280
280
|
export const Sizes = EnumTemplate.bind({});
|
|
281
281
|
Sizes.args = { enum: "size", modelValues: {} };
|
|
282
282
|
|
|
283
|
+
export const Variant = EnumTemplate.bind({});
|
|
284
|
+
Variant.args = { enum: "variant", modelValues: {} };
|
|
285
|
+
|
|
283
286
|
export const BackLink: StoryFn<UModalArgs> = (args: UModalArgs) => ({
|
|
284
287
|
components: { UModal, UButton, UCheckbox, UCol, URow, UDivider, UInput, UInputPassword },
|
|
285
288
|
setup() {
|
|
@@ -23,7 +23,7 @@ import type { UnknownObject } from "../../types";
|
|
|
23
23
|
interface UModalConfirmArgs extends Props {
|
|
24
24
|
width: string;
|
|
25
25
|
slotTemplate?: string;
|
|
26
|
-
enum: "size" | "confirmColor";
|
|
26
|
+
enum: "size" | "variant" | "confirmColor";
|
|
27
27
|
modelValues?: UnknownObject;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -83,6 +83,30 @@ const DefaultTemplate: StoryFn<UModalConfirmArgs> = (args: UModalConfirmArgs) =>
|
|
|
83
83
|
`,
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
+
const EnumTemplate: StoryFn<UModalConfirmArgs> = (args: UModalConfirmArgs, { argTypes }) => ({
|
|
87
|
+
components: { UModalConfirm, UButton, URow },
|
|
88
|
+
setup: () => ({ args, argTypes, getArgs }),
|
|
89
|
+
template: `
|
|
90
|
+
<URow>
|
|
91
|
+
<UButton
|
|
92
|
+
v-for="option in argTypes?.[args.enum]?.options"
|
|
93
|
+
:key="option"
|
|
94
|
+
:label="option"
|
|
95
|
+
@click="args.modelValues[option] = !args.modelValues[option]"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<UModalConfirm
|
|
99
|
+
v-for="option in argTypes?.[args.enum]?.options"
|
|
100
|
+
:key="option"
|
|
101
|
+
v-bind="getArgs(args, option)"
|
|
102
|
+
v-model="args.modelValues[option]"
|
|
103
|
+
>
|
|
104
|
+
${defaultTemplate}
|
|
105
|
+
</UModalConfirm>
|
|
106
|
+
</URow>
|
|
107
|
+
`,
|
|
108
|
+
});
|
|
109
|
+
|
|
86
110
|
export const Default = DefaultTemplate.bind({});
|
|
87
111
|
Default.args = {};
|
|
88
112
|
|
|
@@ -194,31 +218,12 @@ WithoutCancelButton.args = { cancelHidden: true };
|
|
|
194
218
|
export const DisableConfirmButton = DefaultTemplate.bind({});
|
|
195
219
|
DisableConfirmButton.args = { confirmDisabled: true };
|
|
196
220
|
|
|
197
|
-
export const Sizes
|
|
198
|
-
components: { UModalConfirm, UButton, URow },
|
|
199
|
-
setup: () => ({ args, argTypes, getArgs }),
|
|
200
|
-
template: `
|
|
201
|
-
<URow>
|
|
202
|
-
<UButton
|
|
203
|
-
v-for="option in argTypes?.[args.enum]?.options"
|
|
204
|
-
:key="option"
|
|
205
|
-
:label="option"
|
|
206
|
-
@click="args.modelValues[option] = !args.modelValues[option]"
|
|
207
|
-
/>
|
|
208
|
-
|
|
209
|
-
<UModalConfirm
|
|
210
|
-
v-for="option in argTypes?.[args.enum]?.options"
|
|
211
|
-
:key="option"
|
|
212
|
-
v-bind="getArgs(args, option)"
|
|
213
|
-
v-model="args.modelValues[option]"
|
|
214
|
-
>
|
|
215
|
-
${defaultTemplate}
|
|
216
|
-
</UModalConfirm>
|
|
217
|
-
</URow>
|
|
218
|
-
`,
|
|
219
|
-
});
|
|
221
|
+
export const Sizes = EnumTemplate.bind({});
|
|
220
222
|
Sizes.args = { enum: "size", modelValues: {} };
|
|
221
223
|
|
|
224
|
+
export const Variant = EnumTemplate.bind({});
|
|
225
|
+
Variant.args = { enum: "variant", modelValues: {} };
|
|
226
|
+
|
|
222
227
|
export const Colors: StoryFn<UModalConfirmArgs> = (args: UModalConfirmArgs, { argTypes }) => ({
|
|
223
228
|
components: { UModalConfirm, UButton, URow },
|
|
224
229
|
setup: () => ({ args, argTypes, getArgs }),
|