vueless 0.0.774 → 0.0.776
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/package.json +1 -1
- package/ui.button/config.ts +3 -3
- package/ui.button-toggle/UToggle.vue +16 -16
- package/ui.data-table/config.ts +1 -1
- package/ui.data-table/storybook/stories.ts +2 -2
- package/ui.form-checkbox/storybook/docs.mdx +17 -1
- package/ui.form-checkbox/storybook/stories.ts +54 -12
- package/ui.form-checkbox-group/storybook/docs.mdx +3 -0
- package/ui.form-checkbox-group/storybook/stories.ts +42 -39
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +2 -1
- package/ui.form-checkbox-multi-state/config.ts +1 -1
- package/ui.form-checkbox-multi-state/storybook/stories.ts +32 -8
- package/ui.form-checkbox-multi-state/types.ts +1 -1
- package/ui.form-color-picker/config.ts +1 -1
- package/ui.form-input/storybook/stories.ts +1 -1
- package/ui.loader-progress/useLoaderProgress.ts +5 -3
- package/utils/storybook.ts +1 -1
package/package.json
CHANGED
package/ui.button/config.ts
CHANGED
|
@@ -79,8 +79,8 @@ export default /*tw*/ {
|
|
|
79
79
|
variant: "thirdary",
|
|
80
80
|
class: `
|
|
81
81
|
text-gray-900 dark:text-gray-100
|
|
82
|
-
hover:text-gray-800 hover:bg-gray-800/
|
|
83
|
-
active:text-gray-700 active:bg-gray-700/
|
|
82
|
+
hover:text-gray-800 hover:bg-gray-800/10 dark:hover:text-gray-200 dark:hover:bg-gray-200/10
|
|
83
|
+
active:text-gray-700 active:bg-gray-700/15 dark:active:text-gray-300 dark:active:bg-gray-300/15
|
|
84
84
|
`,
|
|
85
85
|
},
|
|
86
86
|
{
|
|
@@ -110,7 +110,7 @@ export default /*tw*/ {
|
|
|
110
110
|
variant: "thirdary",
|
|
111
111
|
class: "hover:bg-white/10 active:bg-white/15",
|
|
112
112
|
},
|
|
113
|
-
{ filled: true, variant: "thirdary", class: "bg-{color}-700/
|
|
113
|
+
{ filled: true, variant: "thirdary", class: "bg-{color}-700/5 dark:bg-{color}-500/5" },
|
|
114
114
|
{ filled: true, variant: "thirdary", color: ["grayscale", "white"], class: "bg-gray-800/5 dark:bg-gray-200/5" },
|
|
115
115
|
{ rightIcon: true, size: "2xs", class: "pr-1" },
|
|
116
116
|
{ rightIcon: true, size: "xs", class: "pr-2" },
|
|
@@ -97,32 +97,32 @@ const { getDataTest, optionsAttrs, toggleButtonInactiveAttrs, toggleButtonActive
|
|
|
97
97
|
>
|
|
98
98
|
<template #left="{ iconName }">
|
|
99
99
|
<!--
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
@slot Use it to add something before the label.
|
|
101
|
+
@binding {object} option
|
|
102
|
+
@binding {string} icon-name
|
|
103
|
+
@binding {number} index
|
|
104
|
+
-->
|
|
105
105
|
<slot name="left" :option="option" :icon-name="iconName" :index="index" />
|
|
106
106
|
</template>
|
|
107
107
|
|
|
108
108
|
<template #default="{ label, iconName }">
|
|
109
109
|
<!--
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
@slot Use it to add something instead of the toggle option label.
|
|
111
|
+
@binding {object} option
|
|
112
|
+
@binding {string} label
|
|
113
|
+
@binding {string} icon-name
|
|
114
|
+
@binding {number} index
|
|
115
|
+
-->
|
|
116
116
|
<slot name="option" :option="option" :label="label" :icon-name="iconName" :index="index" />
|
|
117
117
|
</template>
|
|
118
118
|
|
|
119
119
|
<template #right="{ iconName }">
|
|
120
120
|
<!--
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
@slot Use it to add something after the label.
|
|
122
|
+
@binding {object} option
|
|
123
|
+
@binding {string} icon-name
|
|
124
|
+
@binding {number} index
|
|
125
|
+
-->
|
|
126
126
|
<slot name="right" :option="option" :icon-name="iconName" :index="index" />
|
|
127
127
|
</template>
|
|
128
128
|
</UButton>
|
package/ui.data-table/config.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default /*tw*/ {
|
|
|
5
5
|
base: "fixed top-0 flex items-center z-30 overflow-hidden border rounded-none",
|
|
6
6
|
variants: {
|
|
7
7
|
actionsHeader: {
|
|
8
|
-
true: "rounded-t-dynamic border-
|
|
8
|
+
true: "rounded-t-dynamic border-brand-200 bg-brand-50",
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
11
|
compoundVariants: [
|
|
@@ -373,14 +373,14 @@ SlotHeaderActions.args = {
|
|
|
373
373
|
<UButton
|
|
374
374
|
label="Edit"
|
|
375
375
|
variant="thirdary"
|
|
376
|
-
color="
|
|
376
|
+
color="brand"
|
|
377
377
|
size="sm"
|
|
378
378
|
/>
|
|
379
379
|
|
|
380
380
|
<UButton
|
|
381
381
|
label="Delete"
|
|
382
382
|
variant="thirdary"
|
|
383
|
-
color="
|
|
383
|
+
color="brand"
|
|
384
384
|
size="sm"
|
|
385
385
|
/>
|
|
386
386
|
</URow>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
1
|
+
import { Markdown, Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
2
|
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.ts";
|
|
@@ -12,5 +12,21 @@ import defaultConfig from "../config.ts?raw"
|
|
|
12
12
|
<Controls of={stories.Default} />
|
|
13
13
|
<Stories of={stories} />
|
|
14
14
|
|
|
15
|
+
## Option meta keys
|
|
16
|
+
Keys you may/have to provide to component in an option object.
|
|
17
|
+
|
|
18
|
+
<Markdown>
|
|
19
|
+
{`
|
|
20
|
+
| Key name | Description | Type |
|
|
21
|
+
| ------------------| ---------------------------------------| ---------------------------------------|
|
|
22
|
+
| value | Native value attribute | Boolean, String, Number, Array, Object |
|
|
23
|
+
| trueValue | Own value for checkbox checked state | Boolean, String, Number, Array, Object |
|
|
24
|
+
| falseValue | Own value for checkbox unchecked state | Boolean, String, Number, Array, Object |
|
|
25
|
+
| label | Option label | String |
|
|
26
|
+
| icon | Option icon | String |
|
|
27
|
+
| description | Option description | Number |
|
|
28
|
+
`}
|
|
29
|
+
</Markdown>
|
|
30
|
+
|
|
15
31
|
## Default config
|
|
16
32
|
<Source code={getSource(defaultConfig)} language="jsx" dark />
|
|
@@ -12,10 +12,11 @@ import UCol from "../../ui.container-col/UCol.vue";
|
|
|
12
12
|
|
|
13
13
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
14
14
|
import type { Props } from "../types.ts";
|
|
15
|
+
import { computed } from "vue";
|
|
15
16
|
|
|
16
17
|
interface UCheckboxArgs extends Props {
|
|
17
18
|
slotTemplate?: string;
|
|
18
|
-
enum: "size";
|
|
19
|
+
enum: "size" | "labelAlign" | "color";
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export default {
|
|
@@ -23,7 +24,7 @@ export default {
|
|
|
23
24
|
title: "Form Inputs & Controls / Checkbox",
|
|
24
25
|
component: UCheckbox,
|
|
25
26
|
args: {
|
|
26
|
-
label: "
|
|
27
|
+
label: "Subscribe to the newsletter",
|
|
27
28
|
},
|
|
28
29
|
argTypes: {
|
|
29
30
|
...getArgTypes(UCheckbox.__name),
|
|
@@ -106,19 +107,23 @@ const ValueTypesTemplate: StoryFn<UCheckboxArgs> = (args: UCheckboxArgs) => ({
|
|
|
106
107
|
const EnumVariantTemplate: StoryFn<UCheckboxArgs> = (args: UCheckboxArgs, { argTypes }) => ({
|
|
107
108
|
components: { UCheckbox, UCol },
|
|
108
109
|
setup() {
|
|
110
|
+
const isColorStory = computed(() => args.enum === "color");
|
|
111
|
+
|
|
109
112
|
return {
|
|
110
113
|
args,
|
|
111
114
|
options: argTypes?.[args.enum]?.options,
|
|
115
|
+
isColorStory,
|
|
112
116
|
};
|
|
113
117
|
},
|
|
114
118
|
template: `
|
|
115
|
-
<UCol gap="xl">
|
|
119
|
+
<UCol gap="xl" :class="{ 'flex-row': isColorStory }">
|
|
116
120
|
<UCheckbox
|
|
117
121
|
v-for="(option, index) in options"
|
|
118
122
|
:key="index"
|
|
119
123
|
v-bind="args"
|
|
120
124
|
:[args.enum]="option"
|
|
121
|
-
:label="option"
|
|
125
|
+
:label="isColorStory ? option : args.label"
|
|
126
|
+
:description="isColorStory ? '' : option"
|
|
122
127
|
/>
|
|
123
128
|
</UCol>
|
|
124
129
|
`,
|
|
@@ -127,23 +132,60 @@ const EnumVariantTemplate: StoryFn<UCheckboxArgs> = (args: UCheckboxArgs, { argT
|
|
|
127
132
|
export const Default = DefaultTemplate.bind({});
|
|
128
133
|
Default.args = {};
|
|
129
134
|
|
|
135
|
+
export const Description = DefaultTemplate.bind({});
|
|
136
|
+
Description.args = { description: "Receive updates and exclusive offers directly to your inbox." };
|
|
137
|
+
|
|
138
|
+
export const Error = DefaultTemplate.bind({});
|
|
139
|
+
Error.args = { error: "Please agree to the Terms and Conditions before proceeding." };
|
|
140
|
+
|
|
141
|
+
export const Disabled = DefaultTemplate.bind({});
|
|
142
|
+
Disabled.args = { disabled: true };
|
|
143
|
+
|
|
130
144
|
export const CustomValues = ValueTypesTemplate.bind({});
|
|
131
145
|
CustomValues.args = {};
|
|
146
|
+
CustomValues.parameters = {
|
|
147
|
+
docs: {
|
|
148
|
+
description: {
|
|
149
|
+
story:
|
|
150
|
+
// eslint-disable-next-line vue/max-len
|
|
151
|
+
"You can pass custom `trueValue` and `falseValue` props, that can be of different types (see object meta keys table below).",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
};
|
|
132
155
|
|
|
133
156
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
134
157
|
Sizes.args = { enum: "size" };
|
|
135
158
|
|
|
136
|
-
export const
|
|
137
|
-
|
|
159
|
+
export const LabelPlacement = EnumVariantTemplate.bind({});
|
|
160
|
+
LabelPlacement.args = { enum: "labelAlign" };
|
|
138
161
|
|
|
139
|
-
export const
|
|
140
|
-
|
|
162
|
+
export const Color = EnumVariantTemplate.bind({});
|
|
163
|
+
Color.args = { enum: "color", modelValue: true };
|
|
164
|
+
|
|
165
|
+
export const Partial = DefaultTemplate.bind({});
|
|
166
|
+
Partial.args = { partial: true };
|
|
167
|
+
Partial.parameters = {
|
|
168
|
+
docs: {
|
|
169
|
+
description: {
|
|
170
|
+
story: "Make checkbox partially checked (change the checked tick to a minus).",
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const SlotLabel = DefaultTemplate.bind({});
|
|
176
|
+
SlotLabel.args = {
|
|
177
|
+
slotTemplate: `
|
|
178
|
+
<template #label>
|
|
179
|
+
<UBadge label="This option is required" color="red" size="sm" />
|
|
180
|
+
</template>
|
|
181
|
+
`,
|
|
182
|
+
};
|
|
141
183
|
|
|
142
|
-
export const
|
|
143
|
-
|
|
184
|
+
export const SlotBottom = DefaultTemplate.bind({});
|
|
185
|
+
SlotBottom.args = {
|
|
144
186
|
slotTemplate: `
|
|
145
|
-
<template #
|
|
146
|
-
<UBadge label="
|
|
187
|
+
<template #bottom>
|
|
188
|
+
<UBadge label="Subscription is optional" color="green" size="sm" />
|
|
147
189
|
</template>
|
|
148
190
|
`,
|
|
149
191
|
};
|
|
@@ -12,5 +12,8 @@ import defaultConfig from "../config.ts?raw"
|
|
|
12
12
|
<Controls of={stories.Default} />
|
|
13
13
|
<Stories of={stories} />
|
|
14
14
|
|
|
15
|
+
## Option meta keys
|
|
16
|
+
Full list of keys you may/have to provide to component in an option object can be found here: [UCheckbox docs](https://ui.vueless.com/?path=/docs/3100--docs).
|
|
17
|
+
|
|
15
18
|
## Default config
|
|
16
19
|
<Source code={getSource(defaultConfig)} language="jsx" dark />
|
|
@@ -10,6 +10,7 @@ import UCheckbox from "../../ui.form-checkbox/UCheckbox.vue";
|
|
|
10
10
|
import UAlert from "../../ui.text-alert/UAlert.vue";
|
|
11
11
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
12
12
|
import URow from "../../ui.container-row/URow.vue";
|
|
13
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
13
14
|
|
|
14
15
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
15
16
|
import type { Props } from "../types.ts";
|
|
@@ -26,13 +27,13 @@ export default {
|
|
|
26
27
|
title: "Form Inputs & Controls / Checkbox Group",
|
|
27
28
|
component: UCheckboxGroup,
|
|
28
29
|
args: {
|
|
29
|
-
label: "
|
|
30
|
+
label: "Select your preferred communication methods:",
|
|
30
31
|
options: [
|
|
31
|
-
{ label: "
|
|
32
|
-
{ label: "
|
|
33
|
-
{ label: "
|
|
32
|
+
{ label: "Email Notifications", value: "email" },
|
|
33
|
+
{ label: "SMS Alerts", value: "sms" },
|
|
34
|
+
{ label: "Push Notifications", value: "push" },
|
|
34
35
|
],
|
|
35
|
-
value: [
|
|
36
|
+
value: [],
|
|
36
37
|
},
|
|
37
38
|
argTypes: {
|
|
38
39
|
...getArgTypes(UCheckboxGroup.__name),
|
|
@@ -45,7 +46,7 @@ export default {
|
|
|
45
46
|
} as Meta;
|
|
46
47
|
|
|
47
48
|
const DefaultTemplate: StoryFn<UCheckboxGroupArgs> = (args: UCheckboxGroupArgs) => ({
|
|
48
|
-
components: { UCheckboxGroup, UCheckbox, UAlert, URow, UCol },
|
|
49
|
+
components: { UCheckboxGroup, UCheckbox, UAlert, URow, UCol, UBadge },
|
|
49
50
|
setup() {
|
|
50
51
|
const slots = getSlotNames(UCheckboxGroup.__name);
|
|
51
52
|
|
|
@@ -63,7 +64,7 @@ const DefaultTemplate: StoryFn<UCheckboxGroupArgs> = (args: UCheckboxGroupArgs)
|
|
|
63
64
|
</UCheckboxGroup>
|
|
64
65
|
|
|
65
66
|
<URow>
|
|
66
|
-
<UAlert size="sm" color="
|
|
67
|
+
<UAlert size="sm" variant="thirdary" color="green" bordered>
|
|
67
68
|
<p>Selected value: {{ value }}</p>
|
|
68
69
|
</UAlert>
|
|
69
70
|
</URow>
|
|
@@ -102,50 +103,52 @@ const EnumVariantTemplate: StoryFn<UCheckboxGroupArgs> = (
|
|
|
102
103
|
});
|
|
103
104
|
|
|
104
105
|
export const Default = DefaultTemplate.bind({});
|
|
105
|
-
Default.args = {
|
|
106
|
-
name: "Default",
|
|
107
|
-
slotTemplate: `
|
|
108
|
-
<template v-for="(radio, index) in args.options" :key="index">
|
|
109
|
-
<UCheckbox v-bind="radio"/>
|
|
110
|
-
</template>
|
|
111
|
-
`,
|
|
112
|
-
options: [
|
|
113
|
-
{ name: "Default", label: "String", value: "One" },
|
|
114
|
-
{ name: "Default", label: "Boolean", value: false },
|
|
115
|
-
{
|
|
116
|
-
name: "Default",
|
|
117
|
-
label: "Object",
|
|
106
|
+
Default.args = { name: "Default" };
|
|
118
107
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
label: "Array",
|
|
124
|
-
value: ["Array", 1],
|
|
125
|
-
},
|
|
126
|
-
],
|
|
108
|
+
export const Description = DefaultTemplate.bind({});
|
|
109
|
+
Description.args = {
|
|
110
|
+
name: "Description",
|
|
111
|
+
description: "You may select multiple options that best fit your preferences.",
|
|
127
112
|
};
|
|
128
113
|
|
|
114
|
+
export const Error = DefaultTemplate.bind({});
|
|
115
|
+
Error.args = { name: "Error", error: "some error" };
|
|
116
|
+
|
|
117
|
+
export const Disabled = DefaultTemplate.bind({});
|
|
118
|
+
Disabled.args = { name: "Disabled", disabled: true };
|
|
119
|
+
|
|
129
120
|
export const Options = DefaultTemplate.bind({});
|
|
130
121
|
Options.args = {
|
|
131
122
|
name: "Options",
|
|
132
123
|
options: [
|
|
133
|
-
{
|
|
134
|
-
{
|
|
135
|
-
{
|
|
136
|
-
{
|
|
137
|
-
{
|
|
124
|
+
{ label: "String", value: "Subscribed" },
|
|
125
|
+
{ label: "Number", value: 42 },
|
|
126
|
+
{ label: "Boolean", value: true },
|
|
127
|
+
{ label: "Object", value: { id: 101, status: "active" } },
|
|
128
|
+
{ label: "Array", value: ["Admin", "Editor"] },
|
|
138
129
|
],
|
|
139
130
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
131
|
+
Options.parameters = {
|
|
132
|
+
docs: {
|
|
133
|
+
description: {
|
|
134
|
+
story:
|
|
135
|
+
// eslint-disable-next-line vue/max-len
|
|
136
|
+
"Every option you pass via the `options` prop can be of different type (`Boolean` | `String` | `Number` | `Array` | `Object`).",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
146
140
|
|
|
147
141
|
export const Colors = EnumVariantTemplate.bind({});
|
|
148
142
|
Colors.args = { enum: "color", name: "Colors" };
|
|
149
143
|
|
|
150
144
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
151
145
|
Sizes.args = { enum: "size", name: "Sizes" };
|
|
146
|
+
|
|
147
|
+
export const SlotLabel = DefaultTemplate.bind({});
|
|
148
|
+
SlotLabel.args = {
|
|
149
|
+
slotTemplate: `
|
|
150
|
+
<template #label>
|
|
151
|
+
<UBadge label="At least one option is required" color="green" />
|
|
152
|
+
</template>
|
|
153
|
+
`,
|
|
154
|
+
};
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "../../utils/storybook.ts";
|
|
7
7
|
|
|
8
8
|
import UCheckboxMultiState from "../../ui.form-checkbox-multi-state/UCheckboxMultiState.vue";
|
|
9
|
-
import
|
|
9
|
+
import UCol from "../../ui.container-col/UCol.vue";
|
|
10
10
|
|
|
11
11
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
12
12
|
import type { Props } from "../types.ts";
|
|
13
13
|
|
|
14
14
|
interface UCheckboxMultiStateArgs extends Props {
|
|
15
15
|
slotTemplate?: string;
|
|
16
|
-
enum: "size";
|
|
16
|
+
enum: "size" | "color" | "labelAlign";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export default {
|
|
@@ -22,9 +22,24 @@ export default {
|
|
|
22
22
|
component: UCheckboxMultiState,
|
|
23
23
|
args: {
|
|
24
24
|
options: [
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
{
|
|
26
|
+
value: false,
|
|
27
|
+
label: "Not Selected",
|
|
28
|
+
icon: "",
|
|
29
|
+
description: "The checkbox is currently not selected.",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: true,
|
|
33
|
+
label: "Selected",
|
|
34
|
+
icon: "check",
|
|
35
|
+
description: "The checkbox has been selected.",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: null,
|
|
39
|
+
label: "Indeterminate",
|
|
40
|
+
icon: "remove",
|
|
41
|
+
description: "The checkbox is in an indeterminate state.",
|
|
42
|
+
},
|
|
28
43
|
],
|
|
29
44
|
},
|
|
30
45
|
argTypes: {
|
|
@@ -55,7 +70,7 @@ const EnumVariantTemplate: StoryFn<UCheckboxMultiStateArgs> = (
|
|
|
55
70
|
args: UCheckboxMultiStateArgs,
|
|
56
71
|
{ argTypes },
|
|
57
72
|
) => ({
|
|
58
|
-
components: { UCheckboxMultiState,
|
|
73
|
+
components: { UCheckboxMultiState, UCol },
|
|
59
74
|
setup() {
|
|
60
75
|
return {
|
|
61
76
|
args,
|
|
@@ -63,7 +78,7 @@ const EnumVariantTemplate: StoryFn<UCheckboxMultiStateArgs> = (
|
|
|
63
78
|
};
|
|
64
79
|
},
|
|
65
80
|
template: `
|
|
66
|
-
<
|
|
81
|
+
<UCol>
|
|
67
82
|
<UCheckboxMultiState
|
|
68
83
|
v-for="(option, index) in options"
|
|
69
84
|
:key="index"
|
|
@@ -72,12 +87,21 @@ const EnumVariantTemplate: StoryFn<UCheckboxMultiStateArgs> = (
|
|
|
72
87
|
:[args.enum]="option"
|
|
73
88
|
:label="option"
|
|
74
89
|
/>
|
|
75
|
-
</
|
|
90
|
+
</UCol>
|
|
76
91
|
`,
|
|
77
92
|
});
|
|
78
93
|
|
|
79
94
|
export const Default = DefaultTemplate.bind({});
|
|
80
95
|
Default.args = {};
|
|
81
96
|
|
|
97
|
+
export const Disabled = DefaultTemplate.bind({});
|
|
98
|
+
Disabled.args = { disabled: true };
|
|
99
|
+
|
|
100
|
+
export const LabelPlacement = EnumVariantTemplate.bind({});
|
|
101
|
+
LabelPlacement.args = { enum: "labelAlign" };
|
|
102
|
+
|
|
82
103
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
83
104
|
Sizes.args = { enum: "size" };
|
|
105
|
+
|
|
106
|
+
export const Color = EnumVariantTemplate.bind({});
|
|
107
|
+
Color.args = { enum: "color" };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, onBeforeUnmount, readonly, ref } from "vue";
|
|
1
|
+
import { inject, onBeforeMount, onBeforeUnmount, readonly, ref } from "vue";
|
|
2
2
|
|
|
3
3
|
import type { Ref } from "vue";
|
|
4
4
|
|
|
@@ -49,8 +49,10 @@ export function createLoaderProgress(): LoaderProgress {
|
|
|
49
49
|
export function useLoaderProgress(): LoaderProgress {
|
|
50
50
|
const loaderProgress = inject<LoaderProgress>(LoaderProgressSymbol);
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
onBeforeMount(() => {
|
|
53
|
+
window.addEventListener("loaderProgressOn", setLoaderOnHandler as EventListener);
|
|
54
|
+
window.addEventListener("loaderProgressOff", setLoaderOffHandler as EventListener);
|
|
55
|
+
});
|
|
54
56
|
|
|
55
57
|
onBeforeUnmount(() => {
|
|
56
58
|
window.removeEventListener("loaderProgressOn", setLoaderOnHandler as EventListener);
|
package/utils/storybook.ts
CHANGED
|
@@ -72,7 +72,7 @@ export function getDocsDescription(componentName: string | undefined) {
|
|
|
72
72
|
let viewOnGitHub = "";
|
|
73
73
|
|
|
74
74
|
if (COMPONENTS[componentName as ComponentNames]) {
|
|
75
|
-
viewOnGitHub = `|
|
|
75
|
+
viewOnGitHub = `| <a href="https://github.com/vuelessjs/vueless/tree/main/src/${COMPONENTS[componentName as ComponentNames]}" target="_blank">View on GitHub</a>`;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
return {
|