srcdev-nuxt-forms 2.2.1 → 2.4.0
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/components/forms/input-button/InputButtonCore.vue +1 -1
- package/components/forms/input-button/variants/InputButtonConfirm.vue +2 -14
- package/components/forms/input-button/variants/InputButtonSubmit.vue +2 -2
- package/components/forms/input-checkbox/MultipleCheckboxes.vue +3 -6
- package/components/forms/input-checkbox/SingleCheckbox.vue +7 -11
- package/components/forms/input-checkbox-radio/InputCheckboxRadioButton.vue +4 -4
- package/components/forms/input-checkbox-radio/InputCheckboxRadioCore.vue +6 -6
- package/components/forms/input-checkbox-radio/InputCheckboxRadioWithLabel.vue +3 -6
- package/components/forms/input-number/InputNumberCore.vue +4 -6
- package/components/forms/input-number/variants/InputNumberDefault.vue +4 -7
- package/components/forms/input-radio/MultipleRadiobuttons.vue +5 -8
- package/components/forms/input-range/InputRangeCore.vue +2 -2
- package/components/forms/input-range/variants/InputRangeDefault.vue +2 -5
- package/components/forms/input-range-fancy/InputRangeFancyCore.vue +3 -3
- package/components/forms/input-range-fancy/InputRangeFancyWithLabel.vue +3 -3
- package/components/forms/input-text/InputTextCore.vue +7 -8
- package/components/forms/input-text/variants/InputPasswordWithLabel.vue +5 -37
- package/components/forms/input-text/variants/InputTextAsNumberWithLabel.vue +8 -11
- package/components/forms/input-text/variants/InputTextWithLabel.vue +6 -9
- package/components/forms/input-textarea/InputTextareaCore.vue +3 -7
- package/components/forms/input-textarea/variants/InputTextareaWithLabel.vue +4 -7
- package/components/forms/toggle-switch/ToggleSwitchCore.vue +5 -5
- package/components/forms/toggle-switch/variants/ToggleSwitchWithLabel.vue +7 -10
- package/components/forms/toggle-switch/variants/ToggleSwitchWithLabelInline.vue +5 -7
- package/components/utils/dark-mode-switcher/DarkModeSwitcher.vue +2 -6
- package/nuxt.config.ts +1 -1
- package/package.json +4 -11
- package/components/forms/form-errors/stories/InputError.stories.ts +0 -36
- package/components/forms/input-button/stories/InputButtonCore.mdx +0 -8
- package/components/forms/input-button/stories/InputButtonCore.stories.ts +0 -65
- package/components/forms/input-radio/stories/MultipleRadioButtons.mdx +0 -8
- package/components/forms/input-radio/stories/MultipleRadiobuttons.stories.ts +0 -71
- package/components/forms/input-radio/stories/data/tags.json +0 -67
- package/components/forms/input-text/stories/InputTextCore.mdx +0 -8
- package/components/forms/input-text/stories/InputTextCore.stories.ts +0 -59
- package/components/forms/input-text/variants/stories/InputPasswordWithLabel.mdx +0 -8
- package/components/forms/input-text/variants/stories/InputPasswordWithLabel.stories.ts +0 -60
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
34
|
import propValidators from '../c12/prop-validators';
|
|
35
|
-
const
|
|
35
|
+
const props = defineProps({
|
|
36
36
|
maxlength: {
|
|
37
37
|
type: Number,
|
|
38
38
|
default: 255,
|
|
@@ -82,7 +82,7 @@ const hasLeftSlot = computed(() => slots.left !== undefined);
|
|
|
82
82
|
const hasRightSlot = computed(() => slots.right !== undefined);
|
|
83
83
|
|
|
84
84
|
const formTheme = computed(() => {
|
|
85
|
-
return fieldHasError ? 'error' : theme;
|
|
85
|
+
return props.fieldHasError ? 'error' : props.theme;
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
const modelValue = defineModel<string | number | readonly string[] | null | undefined>();
|
|
@@ -95,11 +95,7 @@ const updateFocus = (isFocused: boolean) => {
|
|
|
95
95
|
|
|
96
96
|
const inputField = ref<HTMLInputElement | null>(null);
|
|
97
97
|
|
|
98
|
-
const { elementClasses
|
|
99
|
-
|
|
100
|
-
onMounted(() => {
|
|
101
|
-
updateElementClasses(['deep-bristol', 'deep-london', 'deep-bath']);
|
|
102
|
-
});
|
|
98
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
103
99
|
</script>
|
|
104
100
|
|
|
105
101
|
<style lang="css">
|
|
@@ -16,15 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
<script setup lang="ts">
|
|
18
18
|
import propValidators from '../../c12/prop-validators';
|
|
19
|
-
const
|
|
19
|
+
const props = defineProps({
|
|
20
20
|
maxlength: {
|
|
21
21
|
type: Number,
|
|
22
22
|
default: 255,
|
|
23
23
|
},
|
|
24
|
-
id: {
|
|
25
|
-
type: String,
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
24
|
name: {
|
|
29
25
|
type: String,
|
|
30
26
|
required: true,
|
|
@@ -73,15 +69,16 @@ const slots = useSlots();
|
|
|
73
69
|
const hasLeftSlot = computed(() => slots.left !== undefined);
|
|
74
70
|
const hasRightSlot = computed(() => slots.right !== undefined);
|
|
75
71
|
|
|
72
|
+
const id = useId();
|
|
76
73
|
const formTheme = computed(() => {
|
|
77
|
-
return fieldHasError ? 'error' : theme;
|
|
74
|
+
return props.fieldHasError ? 'error' : props.theme;
|
|
78
75
|
});
|
|
79
76
|
|
|
80
77
|
const modelValue = defineModel<string | number | readonly string[] | null | undefined>();
|
|
81
78
|
const isActive = ref<boolean>(false);
|
|
82
79
|
const isDirty = ref<boolean>(false);
|
|
83
80
|
|
|
84
|
-
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(styleClassPassthrough);
|
|
81
|
+
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
85
82
|
|
|
86
83
|
const testDirty = () => {
|
|
87
84
|
const watchValue = modelValue.value ?? '';
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<script setup lang="ts">
|
|
21
21
|
import propValidators from '../c12/prop-validators';
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const props = defineProps({
|
|
24
24
|
id: {
|
|
25
25
|
type: String,
|
|
26
26
|
required: true,
|
|
@@ -78,16 +78,16 @@ const hasIconOnSlot = computed(() => slots.iconOn !== undefined);
|
|
|
78
78
|
const hasIconOffSlot = computed(() => slots.iconOff !== undefined);
|
|
79
79
|
|
|
80
80
|
const formTheme = computed(() => {
|
|
81
|
-
return fieldHasError ? 'error' : theme;
|
|
81
|
+
return props.fieldHasError ? 'error' : props.theme;
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
const modelValue = defineModel();
|
|
85
|
-
const { elementClasses
|
|
85
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
86
86
|
|
|
87
|
-
const inputId = computed(() => `toggle-sitch-${id}`);
|
|
87
|
+
const inputId = computed(() => `toggle-sitch-${props.id}`);
|
|
88
88
|
|
|
89
89
|
const toggleSwitchValue = () => {
|
|
90
|
-
modelValue.value = modelValue.value === trueValue ? falseValue : trueValue;
|
|
90
|
+
modelValue.value = modelValue.value === props.trueValue ? props.falseValue : props.trueValue;
|
|
91
91
|
};
|
|
92
92
|
</script>
|
|
93
93
|
|
|
@@ -13,18 +13,14 @@
|
|
|
13
13
|
<slot name="iconOff"></slot>
|
|
14
14
|
</template>
|
|
15
15
|
</ToggleSwitchCore>
|
|
16
|
-
<InputError :errorMessage
|
|
16
|
+
<InputError :errorMessage :showError="fieldHasError" :id="errorId" :isDetached="true" />
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script setup lang="ts">
|
|
21
21
|
import propValidators from '../../c12/prop-validators';
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
id: {
|
|
25
|
-
type: String,
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
23
|
+
const props = defineProps({
|
|
28
24
|
name: {
|
|
29
25
|
type: String,
|
|
30
26
|
required: true,
|
|
@@ -84,17 +80,18 @@ const hasIconOnSlot = computed(() => slots.iconOn !== undefined);
|
|
|
84
80
|
const hasIconOffSlot = computed(() => slots.iconOff !== undefined);
|
|
85
81
|
|
|
86
82
|
const formTheme = computed(() => {
|
|
87
|
-
return fieldHasError ? 'error' : theme;
|
|
83
|
+
return props.fieldHasError ? 'error' : props.theme;
|
|
88
84
|
});
|
|
89
85
|
|
|
86
|
+
const id = useId();
|
|
90
87
|
const errorId = `${id}-error-message`;
|
|
91
88
|
const ariaDescribedby = computed(() => {
|
|
92
|
-
const ariaDescribedbyId = hasDescriptionSlot.value ? `${id}-description` :
|
|
93
|
-
return fieldHasError ? errorId : ariaDescribedbyId;
|
|
89
|
+
const ariaDescribedbyId = hasDescriptionSlot.value ? `${id}-description` : undefined;
|
|
90
|
+
return props.fieldHasError ? errorId : ariaDescribedbyId;
|
|
94
91
|
});
|
|
95
92
|
|
|
96
93
|
const modelValue = defineModel();
|
|
97
|
-
const { elementClasses
|
|
94
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
98
95
|
</script>
|
|
99
96
|
|
|
100
97
|
<style lang="css">
|
|
@@ -16,11 +16,7 @@
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
17
|
import propValidators from '../../c12/prop-validators';
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
id: {
|
|
21
|
-
type: String,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
19
|
+
const props = defineProps({
|
|
24
20
|
name: {
|
|
25
21
|
type: String,
|
|
26
22
|
required: true,
|
|
@@ -72,8 +68,10 @@ const slots = useSlots();
|
|
|
72
68
|
const hasIconOnSlot = computed(() => slots.iconOn !== undefined);
|
|
73
69
|
const hasIconOffSlot = computed(() => slots.iconOff !== undefined);
|
|
74
70
|
|
|
71
|
+
const id = useId();
|
|
72
|
+
|
|
75
73
|
const labelWeightClass = computed(() => {
|
|
76
|
-
switch (labelWeight) {
|
|
74
|
+
switch (props.labelWeight) {
|
|
77
75
|
case 'bold':
|
|
78
76
|
return 'body-normal-bold';
|
|
79
77
|
case 'semi-bold':
|
|
@@ -86,7 +84,7 @@ const labelWeightClass = computed(() => {
|
|
|
86
84
|
});
|
|
87
85
|
|
|
88
86
|
const modelValue = defineModel();
|
|
89
|
-
const { elementClasses } = useStyleClassPassthrough(styleClassPassthrough);
|
|
87
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
90
88
|
</script>
|
|
91
89
|
|
|
92
90
|
<style lang="css">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ToggleSwitchWithLabelInline v-model="displayMode" :
|
|
2
|
+
<ToggleSwitchWithLabelInline v-model="displayMode" :name :label labelWeight="normal" :size trueValue="dark" falseValue="light" :style-class-passthrough>
|
|
3
3
|
<template #iconOn>
|
|
4
4
|
<Icon name="radix-icons:moon" class="icon" />
|
|
5
5
|
</template>
|
|
@@ -12,11 +12,7 @@
|
|
|
12
12
|
<script setup lang="ts">
|
|
13
13
|
import propValidators from '../../forms/c12/prop-validators';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
id: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
15
|
+
defineProps({
|
|
20
16
|
name: {
|
|
21
17
|
type: String,
|
|
22
18
|
required: true,
|
package/nuxt.config.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
export default defineNuxtConfig({
|
|
4
4
|
devtools: { enabled: true },
|
|
5
5
|
css: ['modern-normalize', './assets/styles/main.css'],
|
|
6
|
-
modules: ['@nuxt/icon', '@nuxt/test-utils/module'
|
|
6
|
+
modules: ['@nuxt/icon', '@nuxt/test-utils/module'],
|
|
7
7
|
typescript: {
|
|
8
8
|
tsConfig: {
|
|
9
9
|
compilerOptions: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-forms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.0",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"lint": "eslint .",
|
|
16
16
|
"postinstall": "nuxt prepare .playground",
|
|
17
17
|
"release": "release-it",
|
|
18
|
-
"storybook": "storybook dev --port 6006 --config-dir .storybook",
|
|
19
18
|
"test": "vitest"
|
|
20
19
|
},
|
|
21
20
|
"files": [
|
|
@@ -27,14 +26,14 @@
|
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"@nuxt/eslint-config": "0.7.5",
|
|
29
28
|
"@nuxt/icon": "1.10.3",
|
|
30
|
-
"@nuxt/test-utils": "3.15.
|
|
29
|
+
"@nuxt/test-utils": "3.15.4",
|
|
31
30
|
"@vue/test-utils": "2.4.6",
|
|
32
31
|
"eslint": "9.18.0",
|
|
33
|
-
"happy-dom": "
|
|
32
|
+
"happy-dom": "16.6.0",
|
|
34
33
|
"nuxt": "3.15.0",
|
|
35
34
|
"release-it": "18.1.1",
|
|
36
35
|
"typescript": "5.7.3",
|
|
37
|
-
"vitest": "
|
|
36
|
+
"vitest": "3.0.2",
|
|
38
37
|
"vue": "3.5.13"
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
@@ -45,12 +44,6 @@
|
|
|
45
44
|
"@iconify-json/ph": "1.2.2",
|
|
46
45
|
"@iconify-json/radix-icons": "1.2.2",
|
|
47
46
|
"@iconify-json/ri": "1.2.5",
|
|
48
|
-
"@nuxtjs/storybook": "8.3.2",
|
|
49
|
-
"@storybook/addon-essentials": "8.4.7",
|
|
50
|
-
"@storybook/addon-interactions": "8.4.7",
|
|
51
|
-
"@storybook/addon-links": "8.4.7",
|
|
52
|
-
"@storybook/vue3": "8.4.7",
|
|
53
|
-
"http-proxy-middleware": "3.0.3",
|
|
54
47
|
"modern-normalize": "3.0.1",
|
|
55
48
|
"zod": "3.24.1"
|
|
56
49
|
},
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
// import { Suspense } from 'vue';
|
|
3
|
-
import InputError from '../InputError.vue';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/UI/InputError',
|
|
7
|
-
component: InputError,
|
|
8
|
-
} as Meta<typeof InputError>;
|
|
9
|
-
|
|
10
|
-
const Template: StoryFn<typeof InputError> = (args) => ({
|
|
11
|
-
components: { InputError },
|
|
12
|
-
setup() {
|
|
13
|
-
return { args };
|
|
14
|
-
},
|
|
15
|
-
template: `
|
|
16
|
-
<Suspense>
|
|
17
|
-
<template #default>
|
|
18
|
-
<InputError v-bind="args" />
|
|
19
|
-
</template>
|
|
20
|
-
<template #fallback>
|
|
21
|
-
<div>Loading...</div>
|
|
22
|
-
</template>
|
|
23
|
-
</Suspense>
|
|
24
|
-
`,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const SingleErrorMessage = Template.bind({});
|
|
28
|
-
SingleErrorMessage.args = {
|
|
29
|
-
dataTestid: 'inputError',
|
|
30
|
-
errorMessage: 'Hello World',
|
|
31
|
-
showError: true,
|
|
32
|
-
id: 'testId',
|
|
33
|
-
styleClassPassthrough: ['testClass'],
|
|
34
|
-
compact: false,
|
|
35
|
-
isDetached: true,
|
|
36
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as InputButtonCoreStories from './InputButtonCore.stories'
|
|
3
|
-
|
|
4
|
-
<Meta of={InputButtonCoreStories} />
|
|
5
|
-
|
|
6
|
-
<Canvas of={InputButtonCoreStories.Primary} />
|
|
7
|
-
|
|
8
|
-
<Controls of={InputButtonCoreStories.Primary} />
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import InputButtonCore from '../InputButtonCore.vue';
|
|
3
|
-
import propValidators from '../../c12/prop-validators';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Forms/Buttons/Core',
|
|
7
|
-
component: InputButtonCore,
|
|
8
|
-
argTypes: {
|
|
9
|
-
size: {
|
|
10
|
-
options: propValidators.size,
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
},
|
|
13
|
-
weight: {
|
|
14
|
-
options: propValidators.weight,
|
|
15
|
-
control: { type: 'select' },
|
|
16
|
-
},
|
|
17
|
-
theme: {
|
|
18
|
-
options: propValidators.theme,
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
default: 'primary',
|
|
21
|
-
},
|
|
22
|
-
effect: {
|
|
23
|
-
options: ['fancy', 'pulse'],
|
|
24
|
-
control: { type: 'select' },
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
} as Meta<typeof InputButtonCore>;
|
|
28
|
-
|
|
29
|
-
const Template: StoryFn<typeof InputButtonCore> = (args) => ({
|
|
30
|
-
components: { InputButtonCore },
|
|
31
|
-
setup() {
|
|
32
|
-
return { args };
|
|
33
|
-
},
|
|
34
|
-
template: `
|
|
35
|
-
<Suspense>
|
|
36
|
-
<template #default>
|
|
37
|
-
<InputButtonCore v-bind="args">
|
|
38
|
-
<template v-if="${'left' in args}" v-slot:title>${args.left}</template>
|
|
39
|
-
<template v-if="${'right' in args}" v-slot:content>${args.right}</template>
|
|
40
|
-
<template v-if="${'iconOnly' in args}" v-slot:content>${args.iconOnly}</template>
|
|
41
|
-
</InputButtonCore>
|
|
42
|
-
</template>
|
|
43
|
-
<template #fallback>
|
|
44
|
-
<div>Loading...</div>
|
|
45
|
-
</template>
|
|
46
|
-
</Suspense>
|
|
47
|
-
`,
|
|
48
|
-
// template: '<InputButtonCore v-bind="args" />',
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const Primary = Template.bind({});
|
|
52
|
-
Primary.args = {
|
|
53
|
-
size: 'medium',
|
|
54
|
-
weight: 'wght-400',
|
|
55
|
-
theme: 'primary',
|
|
56
|
-
useEffect: false,
|
|
57
|
-
effect: 'pulse',
|
|
58
|
-
buttonText: 'Button text prop',
|
|
59
|
-
dataTestid: 'buttonTestId',
|
|
60
|
-
styleClassPassthrough: ['testClass', 'testClass2'],
|
|
61
|
-
isPending: false,
|
|
62
|
-
readonly: false,
|
|
63
|
-
left: 'Left',
|
|
64
|
-
right: 'Right',
|
|
65
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as MultipleRadiobuttonsStories from './MultipleRadiobuttons.stories'
|
|
3
|
-
|
|
4
|
-
<Meta of={MultipleRadiobuttonsStories} />
|
|
5
|
-
|
|
6
|
-
<Canvas of={MultipleRadiobuttonsStories.Primary} />
|
|
7
|
-
|
|
8
|
-
<Controls of={MultipleRadiobuttonsStories.Primary} />
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import MultipleRadiobuttons from '../MultipleRadiobuttons.vue';
|
|
3
|
-
import propValidators from '../../c12/prop-validators';
|
|
4
|
-
import modelData from './data/tags.json';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Forms/MultipleRadiobuttons',
|
|
8
|
-
component: MultipleRadiobuttons,
|
|
9
|
-
argTypes: {
|
|
10
|
-
size: {
|
|
11
|
-
options: propValidators.size,
|
|
12
|
-
control: { type: 'select' },
|
|
13
|
-
},
|
|
14
|
-
weight: {
|
|
15
|
-
options: propValidators.weight,
|
|
16
|
-
control: { type: 'select' },
|
|
17
|
-
},
|
|
18
|
-
theme: {
|
|
19
|
-
options: propValidators.theme,
|
|
20
|
-
control: { type: 'select' },
|
|
21
|
-
default: 'primary',
|
|
22
|
-
},
|
|
23
|
-
optionsLayout: {
|
|
24
|
-
options: ['inline', 'equal-widths'],
|
|
25
|
-
control: { type: 'select' },
|
|
26
|
-
},
|
|
27
|
-
direction: {
|
|
28
|
-
options: ['row', 'row-reverse'],
|
|
29
|
-
control: { type: 'select' },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
} as Meta<typeof MultipleRadiobuttons>;
|
|
33
|
-
|
|
34
|
-
const Template: StoryFn<typeof MultipleRadiobuttons> = (args) => ({
|
|
35
|
-
components: { MultipleRadiobuttons },
|
|
36
|
-
setup() {
|
|
37
|
-
return { args };
|
|
38
|
-
},
|
|
39
|
-
template: `
|
|
40
|
-
<Suspense>
|
|
41
|
-
<template #default>
|
|
42
|
-
<MultipleRadiobuttons v-bind="args">
|
|
43
|
-
<template v-if="${'description' in args}" v-slot:description>${args.description}</template>
|
|
44
|
-
</MultipleRadiobuttons>
|
|
45
|
-
</template>
|
|
46
|
-
<template #fallback>
|
|
47
|
-
<div>Loading...</div>
|
|
48
|
-
</template>
|
|
49
|
-
</Suspense>
|
|
50
|
-
`,
|
|
51
|
-
// template: '<MultipleRadiobuttons v-bind="args" />',
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export const Primary = Template.bind({});
|
|
55
|
-
Primary.args = {
|
|
56
|
-
id: 'tagsRadio',
|
|
57
|
-
name: 'tagsRadio',
|
|
58
|
-
legend: 'Choose tags (as radiobuttons)',
|
|
59
|
-
required: true,
|
|
60
|
-
label: 'Check between 3 and 8 tags',
|
|
61
|
-
placeholder: 'eg. Type something here',
|
|
62
|
-
isButton: true,
|
|
63
|
-
errorMessage: 'Please select between 3 and 8 tags',
|
|
64
|
-
fieldHasError: false,
|
|
65
|
-
modelValue: [],
|
|
66
|
-
fieldData: modelData,
|
|
67
|
-
size: 'x-small',
|
|
68
|
-
optionsLayout: 'inline',
|
|
69
|
-
theme: 'primary',
|
|
70
|
-
direction: 'row',
|
|
71
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"id": "pizza",
|
|
5
|
-
"name": "tags",
|
|
6
|
-
"value": "pizza",
|
|
7
|
-
"label": "Pizza"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "italian",
|
|
11
|
-
"name": "tags",
|
|
12
|
-
"value": "italian",
|
|
13
|
-
"label": "Italian"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "vegetarian",
|
|
17
|
-
"name": "tags",
|
|
18
|
-
"value": "vegetarian",
|
|
19
|
-
"label": "Vegetarian"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "stir-fry",
|
|
23
|
-
"name": "tags",
|
|
24
|
-
"value": "stir-fry",
|
|
25
|
-
"label": "Stir-fry"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "asian",
|
|
29
|
-
"name": "tags",
|
|
30
|
-
"value": "asian",
|
|
31
|
-
"label": "Asian"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "cookies",
|
|
35
|
-
"name": "tags",
|
|
36
|
-
"value": "cookies",
|
|
37
|
-
"label": "Cookies"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "dessert",
|
|
41
|
-
"name": "tags",
|
|
42
|
-
"value": "dessert",
|
|
43
|
-
"label": "Dessert"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "baking",
|
|
47
|
-
"name": "tags",
|
|
48
|
-
"value": "baking",
|
|
49
|
-
"label": "Baking"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"id": "pasta",
|
|
53
|
-
"name": "tags",
|
|
54
|
-
"value": "pasta",
|
|
55
|
-
"label": "Pasta"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "chicken",
|
|
59
|
-
"name": "tags",
|
|
60
|
-
"value": "chicken",
|
|
61
|
-
"label": "Chicken"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
"total": 5,
|
|
65
|
-
"skip": 0,
|
|
66
|
-
"limit": 10
|
|
67
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import InputTextCore from '../InputTextCore.vue';
|
|
3
|
-
import propValidators from '../../c12/prop-validators';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Forms/Input/Text/Core',
|
|
7
|
-
component: InputTextCore,
|
|
8
|
-
argTypes: {
|
|
9
|
-
type: {
|
|
10
|
-
options: propValidators.inputTypesText,
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
},
|
|
13
|
-
inputMode: {
|
|
14
|
-
options: propValidators.inputMode,
|
|
15
|
-
control: { type: 'select' },
|
|
16
|
-
},
|
|
17
|
-
theme: {
|
|
18
|
-
options: propValidators.theme,
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
default: 'primary',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
} as Meta<typeof InputTextCore>;
|
|
24
|
-
|
|
25
|
-
const Template: StoryFn<typeof InputTextCore> = (args) => ({
|
|
26
|
-
components: { InputTextCore },
|
|
27
|
-
setup() {
|
|
28
|
-
return { args };
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
<Suspense>
|
|
32
|
-
<template #default>
|
|
33
|
-
<InputTextCore v-bind="args">
|
|
34
|
-
<template v-if="${'left' in args}" v-slot:title>${args.left}</template>
|
|
35
|
-
<template v-if="${'right' in args}" v-slot:content>${args.right}</template>
|
|
36
|
-
</InputTextCore>
|
|
37
|
-
</template>
|
|
38
|
-
<template #fallback>
|
|
39
|
-
<div>Loading...</div>
|
|
40
|
-
</template>
|
|
41
|
-
</Suspense>
|
|
42
|
-
`,
|
|
43
|
-
// template: '<InputTextCore v-bind="args" />',
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const Primary = Template.bind({});
|
|
47
|
-
Primary.args = {
|
|
48
|
-
type: 'text',
|
|
49
|
-
inputmode: 'text',
|
|
50
|
-
maxlength: 255,
|
|
51
|
-
id: 'testId',
|
|
52
|
-
name: 'testName',
|
|
53
|
-
required: true,
|
|
54
|
-
placeholder: 'Input placeholder text',
|
|
55
|
-
fieldHasError: false,
|
|
56
|
-
styleClassPassthrough: ['testClass1', 'testClass2'],
|
|
57
|
-
theme: 'primary',
|
|
58
|
-
modelValue: 'This is the model value',
|
|
59
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as InputPasswordWithLabelStories from './InputPasswordWithLabel.stories'
|
|
3
|
-
|
|
4
|
-
<Meta of={InputPasswordWithLabelStories} />
|
|
5
|
-
|
|
6
|
-
<Canvas of={InputPasswordWithLabelStories.Primary} />
|
|
7
|
-
|
|
8
|
-
<Controls of={InputPasswordWithLabelStories.Primary} />
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import InputPasswordWithLabel from '../InputPasswordWithLabel.vue';
|
|
3
|
-
import propValidators from '../../../c12/prop-validators';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Forms/Input/Text/InputPasswordWithLabel',
|
|
7
|
-
component: InputPasswordWithLabel,
|
|
8
|
-
argTypes: {
|
|
9
|
-
type: {
|
|
10
|
-
options: propValidators.inputTypesText,
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
},
|
|
13
|
-
inputMode: {
|
|
14
|
-
options: propValidators.inputMode,
|
|
15
|
-
control: { type: 'select' },
|
|
16
|
-
},
|
|
17
|
-
theme: {
|
|
18
|
-
options: propValidators.theme,
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
default: 'primary',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
} as Meta<typeof InputPasswordWithLabel>;
|
|
24
|
-
|
|
25
|
-
const Template: StoryFn<typeof InputPasswordWithLabel> = (args) => ({
|
|
26
|
-
components: { InputPasswordWithLabel },
|
|
27
|
-
setup() {
|
|
28
|
-
return { args };
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
<Suspense>
|
|
32
|
-
<template #default>
|
|
33
|
-
<InputPasswordWithLabel v-bind="args">
|
|
34
|
-
<template v-if="${'iconOnly' in args}" v-slot:iconOnly>${args.iconOnly}</template>
|
|
35
|
-
</InputPasswordWithLabel>
|
|
36
|
-
</template>
|
|
37
|
-
<template #fallback>
|
|
38
|
-
<div>Loading...</div>
|
|
39
|
-
</template>
|
|
40
|
-
</Suspense>
|
|
41
|
-
`,
|
|
42
|
-
// template: '<InputPasswordWithLabel v-bind="args" />',
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export const Primary = Template.bind({});
|
|
46
|
-
Primary.args = {
|
|
47
|
-
type: 'password',
|
|
48
|
-
maxlength: 255,
|
|
49
|
-
id: 'testId',
|
|
50
|
-
name: 'testName',
|
|
51
|
-
placeholder: 'Input placeholder text',
|
|
52
|
-
label: 'Input label text',
|
|
53
|
-
errorMessage: 'This is an error message',
|
|
54
|
-
fieldHasError: false,
|
|
55
|
-
required: true,
|
|
56
|
-
styleClassPassthrough: ['testClass1', 'testClass2'],
|
|
57
|
-
theme: 'primary',
|
|
58
|
-
modelValue: 'This is the model value',
|
|
59
|
-
iconOnly: `<Icon name="radix-icons:eye-none" class="icon" />`,
|
|
60
|
-
};
|