@carbon/vue 3.0.6-alpha.0 → 3.0.7-alpha.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/dist/carbon-vue-3.common.js +11880 -8135
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.umd.js +11880 -8135
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +4 -4
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/package.json +4 -4
- package/src/components/CvAccordion/CvAccordion.stories.js +1 -0
- package/src/components/CvButton/CvButton.stories.js +3 -3
- package/src/components/CvButton/CvButtonSkeleton.stories.js +79 -0
- package/src/components/CvButton/CvButtonSkeleton.vue +19 -0
- package/src/components/CvButton/index.js +8 -1
- package/src/components/CvDatePicker/CvDatePicker.vue +1 -1
- package/src/components/CvDropdown/CvDropdown.stories.mdx +407 -0
- package/src/components/CvDropdown/CvDropdown.vue +418 -0
- package/src/components/CvDropdown/CvDropdownItem.vue +86 -0
- package/src/components/CvDropdown/CvDropdownSkeleton.vue +17 -0
- package/src/components/CvDropdown/index.js +5 -0
- package/src/components/CvForm/CvFormGroup.vue +1 -1
- package/src/components/CvInlineLoading/CvInlineLoading.stories.mdx +87 -0
- package/src/components/CvInlineLoading/CvInlineLoading.vue +144 -0
- package/src/components/CvInlineLoading/consts.js +9 -0
- package/src/components/CvInlineLoading/index.js +4 -0
- package/src/components/CvModal/CvModal.stories.mdx +4 -2
- package/src/components/CvModal/CvModal.vue +3 -5
- package/src/components/CvMultiSelect/CvMultiSelect.stories.mdx +333 -0
- package/src/components/CvMultiSelect/CvMultiSelect.vue +705 -0
- package/src/components/CvMultiSelect/consts.js +16 -0
- package/src/components/CvMultiSelect/index.js +3 -0
- package/src/components/CvNumberInput/CvNumberInput.stories.js +265 -0
- package/src/components/CvNumberInput/CvNumberInput.vue +227 -0
- package/src/components/CvNumberInput/CvNumberInputSkeleton.stories.js +30 -0
- package/src/components/CvNumberInput/CvNumberInputSkeleton.vue +10 -0
- package/src/components/CvNumberInput/StorybookGroupConst.js +1 -0
- package/src/components/CvNumberInput/__tests__/__snapshots__/CvNumberInput.spec.js.snap +21 -0
- package/src/components/CvNumberInput/index.js +5 -0
- package/src/components/CvTabs/CvTab.vue +77 -0
- package/src/components/CvTabs/CvTabs.stories.mdx +175 -0
- package/src/components/CvTabs/CvTabs.vue +406 -0
- package/src/components/CvTabs/CvTabsSkeleton.vue +24 -0
- package/src/components/CvTabs/_SbContainer.vue +22 -0
- package/src/components/CvTabs/index.js +5 -0
- package/src/components/CvToggle/CvToggle-Skeleton.vue +29 -0
- package/src/components/CvToggle/CvToggle.stories.js +232 -0
- package/src/components/CvToggle/CvToggle.vue +70 -0
- package/src/components/CvToggle/__tests__/__snapshots__/CvToggle.spec.js.snap +7 -0
- package/src/components/CvToggle/index.js +4 -0
- package/src/global/storybook-utils/story-source-code.js +1 -0
- package/src/use/cvInput.js +34 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/vue",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.7-alpha.0",
|
|
5
5
|
"description": "A collection of components for the Carbon Design System built using Vue.js",
|
|
6
6
|
"packageManager": "yarn@3.2.0",
|
|
7
7
|
"main": "dist/carbon-vue-3.umd.min.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
44
44
|
"@vue/cli-plugin-unit-jest": "^5.0.8",
|
|
45
45
|
"@vue/cli-service": "^5.0.8",
|
|
46
|
-
"@vue/compiler-sfc": "^3.
|
|
46
|
+
"@vue/compiler-sfc": "^3.3.4",
|
|
47
47
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
48
48
|
"@vue/test-utils": "^2.2.4",
|
|
49
49
|
"@vue/vue3-jest": "^27.0.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"stylelint": "^14.15.0",
|
|
71
71
|
"stylelint-config-property-sort-order-smacss": "^9.0.0",
|
|
72
72
|
"stylelint-config-sass-guidelines": "^9.0.1",
|
|
73
|
-
"vue": "^3.
|
|
73
|
+
"vue": "^3.3.4",
|
|
74
74
|
"vue-loader": "^17.0.1",
|
|
75
75
|
"webpack": "^5.75.0"
|
|
76
76
|
},
|
|
@@ -203,5 +203,5 @@
|
|
|
203
203
|
"url": "git+https://github.com/carbon-design-system/carbon-components-vue.git"
|
|
204
204
|
},
|
|
205
205
|
"sideEffects": true,
|
|
206
|
-
"gitHead": "
|
|
206
|
+
"gitHead": "39152672459e58bef32b4eba92078c4ebdbe7ec9"
|
|
207
207
|
}
|
|
@@ -30,6 +30,7 @@ const template = `<cv-accordion @change="onChange" v-bind="args">
|
|
|
30
30
|
</cv-accordion-item>
|
|
31
31
|
</cv-accordion>`;
|
|
32
32
|
const Template = (args, { argTypes }) => {
|
|
33
|
+
// eslint-disable-next-line no-param-reassign
|
|
33
34
|
args = {
|
|
34
35
|
...args,
|
|
35
36
|
align: alignConsts[alignConsts.$labels[args.align]],
|
|
@@ -87,7 +87,7 @@ Secondary.parameters = storyParametersObject(
|
|
|
87
87
|
|
|
88
88
|
export const Field = Template.bind({});
|
|
89
89
|
Field.args = {
|
|
90
|
-
|
|
90
|
+
default: 'Field size',
|
|
91
91
|
size: 'field',
|
|
92
92
|
};
|
|
93
93
|
Field.parameters = storyParametersObject(
|
|
@@ -98,7 +98,7 @@ Field.parameters = storyParametersObject(
|
|
|
98
98
|
|
|
99
99
|
export const Small = Template.bind({});
|
|
100
100
|
Small.args = {
|
|
101
|
-
|
|
101
|
+
default: 'sm',
|
|
102
102
|
size: 'sm',
|
|
103
103
|
};
|
|
104
104
|
Small.parameters = storyParametersObject(
|
|
@@ -109,7 +109,7 @@ Small.parameters = storyParametersObject(
|
|
|
109
109
|
|
|
110
110
|
export const Large = Template.bind({});
|
|
111
111
|
Large.args = {
|
|
112
|
-
|
|
112
|
+
default: 'Large size',
|
|
113
113
|
size: 'lg',
|
|
114
114
|
};
|
|
115
115
|
Large.parameters = storyParametersObject(
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CvButtonSkeleton } from '.';
|
|
2
|
+
import { buttonSizes } from './consts.js';
|
|
3
|
+
import {
|
|
4
|
+
sbCompPrefix,
|
|
5
|
+
storybookControlsFromProps,
|
|
6
|
+
storyParametersObject,
|
|
7
|
+
} from '../../global/storybook-utils';
|
|
8
|
+
import { sbBtnPrefix } from './sbBtnPrefix';
|
|
9
|
+
|
|
10
|
+
import { props as commonCvButtonProps } from './CvButtonCommon';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: `${sbCompPrefix}/${sbBtnPrefix}/CvButtonSkeleton`,
|
|
14
|
+
component: CvButtonSkeleton,
|
|
15
|
+
argTypes: {
|
|
16
|
+
...storybookControlsFromProps({ size: commonCvButtonProps.size }),
|
|
17
|
+
size: {
|
|
18
|
+
control: { type: 'select', options: buttonSizes },
|
|
19
|
+
defaultValue: 'default',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const template = `<cv-button-skeleton v-bind="buttonProps" />`;
|
|
25
|
+
const Template = (args, { argTypes }) => {
|
|
26
|
+
const buttonProps = { ...args };
|
|
27
|
+
return {
|
|
28
|
+
props: Object.keys(argTypes),
|
|
29
|
+
components: { CvButtonSkeleton },
|
|
30
|
+
template,
|
|
31
|
+
setup() {
|
|
32
|
+
return { buttonProps };
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Default = Template.bind({});
|
|
38
|
+
Default.args = {
|
|
39
|
+
size: 'default',
|
|
40
|
+
};
|
|
41
|
+
Default.parameters = storyParametersObject(
|
|
42
|
+
Default.parameters,
|
|
43
|
+
template,
|
|
44
|
+
Default.args,
|
|
45
|
+
'v-bind="buttonProps"'
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export const Field = Template.bind({});
|
|
49
|
+
Field.args = {
|
|
50
|
+
size: 'field',
|
|
51
|
+
};
|
|
52
|
+
Field.parameters = storyParametersObject(
|
|
53
|
+
Field.parameters,
|
|
54
|
+
template,
|
|
55
|
+
Field.args,
|
|
56
|
+
'v-bind="buttonProps"'
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const Small = Template.bind({});
|
|
60
|
+
Small.args = {
|
|
61
|
+
size: 'sm',
|
|
62
|
+
};
|
|
63
|
+
Small.parameters = storyParametersObject(
|
|
64
|
+
Small.parameters,
|
|
65
|
+
template,
|
|
66
|
+
Small.args,
|
|
67
|
+
'v-bind="buttonProps"'
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export const Large = Template.bind({});
|
|
71
|
+
Large.args = {
|
|
72
|
+
size: 'lg',
|
|
73
|
+
};
|
|
74
|
+
Large.parameters = storyParametersObject(
|
|
75
|
+
Large.parameters,
|
|
76
|
+
template,
|
|
77
|
+
Large.args,
|
|
78
|
+
'v-bind="buttonProps"'
|
|
79
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button disabled :class="buttonClasses" type="button"></button>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import {
|
|
7
|
+
props as commonCvButtonProps,
|
|
8
|
+
useCvButtonCommon,
|
|
9
|
+
} from './CvButtonCommon';
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
/**
|
|
13
|
+
* Size of the button
|
|
14
|
+
*/
|
|
15
|
+
size: commonCvButtonProps.size,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const { buttonClasses } = useCvButtonCommon(undefined, props.size, true);
|
|
19
|
+
</script>
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import CvButton from './CvButton.vue';
|
|
2
2
|
import CvIconButton from './CvIconButton.vue';
|
|
3
3
|
import CvButtonSet from './CvButtonSet.vue';
|
|
4
|
+
import CvButtonSkeleton from './CvButtonSkeleton.vue';
|
|
4
5
|
import CvButtonConsts from './consts';
|
|
5
6
|
|
|
6
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
CvButton,
|
|
9
|
+
CvButtonConsts,
|
|
10
|
+
CvButtonSet,
|
|
11
|
+
CvIconButton,
|
|
12
|
+
CvButtonSkeleton,
|
|
13
|
+
};
|
|
7
14
|
export default CvButton;
|
|
@@ -113,7 +113,6 @@ import {
|
|
|
113
113
|
ref,
|
|
114
114
|
computed,
|
|
115
115
|
onMounted,
|
|
116
|
-
onUpdated,
|
|
117
116
|
onBeforeMount,
|
|
118
117
|
onUnmounted,
|
|
119
118
|
watch,
|
|
@@ -305,6 +304,7 @@ let dateToString = val => {
|
|
|
305
304
|
return calendar.formatDate(val, props.calOptions.dateFormat);
|
|
306
305
|
};
|
|
307
306
|
|
|
307
|
+
// eslint-disable-next-line no-unused-vars
|
|
308
308
|
const handleDatePick = (selectedDates, dateStr, instance) => {
|
|
309
309
|
if (isSingle.value) {
|
|
310
310
|
const temp = dateToString(selectedDates[0]);
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import { sbCompPrefix } from '../../global/storybook-utils';
|
|
3
|
+
import CvDropdown from './CvDropdown.vue';
|
|
4
|
+
import CvDropdownItem from './CvDropdownItem.vue';
|
|
5
|
+
import CvDropdownSkeleton from './CvDropdownSkeleton.vue';
|
|
6
|
+
import { action } from '@storybook/addon-actions';
|
|
7
|
+
import { ref } from 'vue';
|
|
8
|
+
const myValue = ref('baby-yoda');
|
|
9
|
+
|
|
10
|
+
<Meta title={`${sbCompPrefix}/CvDropdown`} component={CvDropdown} />
|
|
11
|
+
|
|
12
|
+
export const Template = args => ({
|
|
13
|
+
// Components used in your story `template` are defined in the `components` object
|
|
14
|
+
components: {
|
|
15
|
+
CvDropdown,
|
|
16
|
+
CvDropdownItem,
|
|
17
|
+
CvDropdownSkeleton,
|
|
18
|
+
},
|
|
19
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
20
|
+
setup() {
|
|
21
|
+
return {
|
|
22
|
+
...args,
|
|
23
|
+
props: args.props,
|
|
24
|
+
light: args.light,
|
|
25
|
+
placeholder: args.placeholder,
|
|
26
|
+
value: args.value,
|
|
27
|
+
label: args.label,
|
|
28
|
+
up: args.up,
|
|
29
|
+
inline: args.inline,
|
|
30
|
+
helperText: args.helperText,
|
|
31
|
+
hideSelected: args.hideSelected,
|
|
32
|
+
warningMessage: args.warningMessage,
|
|
33
|
+
invalidMessage: args.invalidMessage,
|
|
34
|
+
disabled: args.disabled,
|
|
35
|
+
size: args.size,
|
|
36
|
+
items: args.items,
|
|
37
|
+
onChange: action('change'),
|
|
38
|
+
myValue: myValue,
|
|
39
|
+
slotInvalidText: args.slotInvalidText,
|
|
40
|
+
slotWarningText: args.slotWarningText,
|
|
41
|
+
slotHelperText: args.slotHelperText,
|
|
42
|
+
slotInternalCaption: args.slotInternalCaption,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
template: args.template,
|
|
46
|
+
});
|
|
47
|
+
const defaultTemplate = `
|
|
48
|
+
<div :style="{width: '300px', paddingTop: up ? '90px' : undefined}">
|
|
49
|
+
<cv-dropdown
|
|
50
|
+
:light="light"
|
|
51
|
+
:placeholder="placeholder"
|
|
52
|
+
:value="value"
|
|
53
|
+
:up="up"
|
|
54
|
+
:inline="inline"
|
|
55
|
+
:helper-text="helperText"
|
|
56
|
+
:warning-message="warningMessage"
|
|
57
|
+
:hide-selected="hideSelected"
|
|
58
|
+
:invalid-message="invalidMessage"
|
|
59
|
+
:label="label"
|
|
60
|
+
:disabled="disabled"
|
|
61
|
+
:size="size"
|
|
62
|
+
@change="onChange">
|
|
63
|
+
<cv-dropdown-item value="mando"><span style="color: darkred">Din Djarin</span></cv-dropdown-item>
|
|
64
|
+
<cv-dropdown-item value="nite-owl">Bo-Katan Kryze</cv-dropdown-item>
|
|
65
|
+
<cv-dropdown-item value="baby-yoda">Din Grogu</cv-dropdown-item>
|
|
66
|
+
<cv-dropdown-item value="mysterious">The Armorer</cv-dropdown-item>
|
|
67
|
+
<cv-dropdown-item value="bounty-hunter">Greef Karga</cv-dropdown-item>
|
|
68
|
+
</cv-dropdown>
|
|
69
|
+
</div>
|
|
70
|
+
`;
|
|
71
|
+
const slotsTemplate = `
|
|
72
|
+
<div :style="{width: '300px'}">
|
|
73
|
+
<cv-dropdown
|
|
74
|
+
v-model:value="myValue"
|
|
75
|
+
:light="light"
|
|
76
|
+
:placeholder="placeholder"
|
|
77
|
+
:up="up"
|
|
78
|
+
:inline="inline"
|
|
79
|
+
:helper-text="helperText"
|
|
80
|
+
:warning-message="warningMessage"
|
|
81
|
+
:hide-selected="hideSelected"
|
|
82
|
+
:invalid-message="invalidMessage"
|
|
83
|
+
:label="label"
|
|
84
|
+
:disabled="disabled"
|
|
85
|
+
:size="size"
|
|
86
|
+
@change="onChange">
|
|
87
|
+
<template v-if="slotInternalCaption" v-slot:internal-caption><h5>Edge case: {{ myValue }}</h5></template>
|
|
88
|
+
<template v-if="slotInvalidText" v-slot:invalid-message>Do not go to the dark side</template>
|
|
89
|
+
<template v-if="slotWarningText" v-slot:warning-message>Can this ally be trusted?</template>
|
|
90
|
+
<template v-if="slotHelperText" v-slot:helper-text>Choose ally strong with the force</template>
|
|
91
|
+
<cv-dropdown-item value="mando"><span>Din Djarin</span></cv-dropdown-item>
|
|
92
|
+
<cv-dropdown-item value="nite-owl">Bo-Katan Kryze</cv-dropdown-item>
|
|
93
|
+
<cv-dropdown-item value="baby-yoda">Din Grogu</cv-dropdown-item>
|
|
94
|
+
<cv-dropdown-item value="mysterious">The Armorer</cv-dropdown-item>
|
|
95
|
+
<cv-dropdown-item value="bounty-hunter">Greef Karga</cv-dropdown-item>
|
|
96
|
+
</cv-dropdown>
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
const itemsTemplate = `
|
|
100
|
+
<div :style="{width: '300px'}">
|
|
101
|
+
<cv-dropdown
|
|
102
|
+
:light="light"
|
|
103
|
+
:placeholder="placeholder"
|
|
104
|
+
:value="value"
|
|
105
|
+
:up="up"
|
|
106
|
+
:inline="inline"
|
|
107
|
+
:helper-text="helperText"
|
|
108
|
+
:warning-message="warningMessage"
|
|
109
|
+
:hide-selected="hideSelected"
|
|
110
|
+
:invalid-message="invalidMessage"
|
|
111
|
+
:label="label"
|
|
112
|
+
:disabled="disabled"
|
|
113
|
+
:size="size"
|
|
114
|
+
:items="items"
|
|
115
|
+
@change="onChange">
|
|
116
|
+
</cv-dropdown>
|
|
117
|
+
</div>
|
|
118
|
+
`;
|
|
119
|
+
const vmodelTemplate = `
|
|
120
|
+
<div :style="{width: '300px'}">
|
|
121
|
+
<cv-dropdown
|
|
122
|
+
v-model:value="myValue"
|
|
123
|
+
:label="label"
|
|
124
|
+
:placeholder="placeholder"
|
|
125
|
+
@change="onChange">
|
|
126
|
+
<cv-dropdown-item value="mando"><span>Din Djarin</span></cv-dropdown-item>
|
|
127
|
+
<cv-dropdown-item value="nite-owl">Bo-Katan Kryze</cv-dropdown-item>
|
|
128
|
+
<cv-dropdown-item value="baby-yoda">Din Grogu</cv-dropdown-item>
|
|
129
|
+
<cv-dropdown-item value="mysterious">The Armorer</cv-dropdown-item>
|
|
130
|
+
<cv-dropdown-item value="bounty-hunter">Greef Karga</cv-dropdown-item>
|
|
131
|
+
</cv-dropdown>
|
|
132
|
+
<div>V-Model value: {{ myValue }}</div>
|
|
133
|
+
<select v-model="myValue">
|
|
134
|
+
<option value="mando">Mandalorian</option>
|
|
135
|
+
<option value="nite-owl">Bo-Katan</option>
|
|
136
|
+
<option value="baby-yoda">Grogu</option>
|
|
137
|
+
<option value="mysterious">Armorer</option>
|
|
138
|
+
<option value="bounty-hunter">Karga</option>
|
|
139
|
+
</select>
|
|
140
|
+
</div>
|
|
141
|
+
`;
|
|
142
|
+
const skeletonTemplate = `
|
|
143
|
+
<div :style="{width: '300px'}">
|
|
144
|
+
<cv-dropdown-skeleton :inline="inline"></cv-dropdown-skeleton>
|
|
145
|
+
</div>
|
|
146
|
+
`;
|
|
147
|
+
|
|
148
|
+
# CvDropdown
|
|
149
|
+
|
|
150
|
+
Notes:
|
|
151
|
+
|
|
152
|
+
- You can place a Dropdown inline with other content by using the inline variant
|
|
153
|
+
Migration notes:
|
|
154
|
+
|
|
155
|
+
- The `v-model` is different in Vue 3 than Vue 2. You can still specify the `v-model=something` to control the visibility but
|
|
156
|
+
if you specify it like this you will see a deprecation message in the log. Please use `v-model:value=something` instead.
|
|
157
|
+
- Add the `size` option to match Carbon React
|
|
158
|
+
- Added the `warningMessage` option to match Carbon React
|
|
159
|
+
|
|
160
|
+
<Canvas>
|
|
161
|
+
<Story
|
|
162
|
+
name="Default"
|
|
163
|
+
parameters={{
|
|
164
|
+
controls: {
|
|
165
|
+
exclude: [
|
|
166
|
+
'props',
|
|
167
|
+
'default',
|
|
168
|
+
'template',
|
|
169
|
+
'change',
|
|
170
|
+
'update:modelValue',
|
|
171
|
+
'update:value',
|
|
172
|
+
'helper-text',
|
|
173
|
+
'invalid-message',
|
|
174
|
+
'warning-message',
|
|
175
|
+
'internal-caption',
|
|
176
|
+
'modelValue',
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
docs: { source: { code: defaultTemplate } },
|
|
180
|
+
}}
|
|
181
|
+
args={{
|
|
182
|
+
template: defaultTemplate,
|
|
183
|
+
props: {
|
|
184
|
+
modelValue: undefined,
|
|
185
|
+
},
|
|
186
|
+
label: 'Characters',
|
|
187
|
+
placeholder: 'Choose an ally',
|
|
188
|
+
helperText: 'May the force be with you',
|
|
189
|
+
light: false,
|
|
190
|
+
}}
|
|
191
|
+
argTypes={{
|
|
192
|
+
light: {
|
|
193
|
+
type: String,
|
|
194
|
+
description: '`true` to use the light version',
|
|
195
|
+
table: { category: 'props' },
|
|
196
|
+
},
|
|
197
|
+
size: {
|
|
198
|
+
control: 'select',
|
|
199
|
+
default: 'md',
|
|
200
|
+
options: ['sm', 'md', 'lg'],
|
|
201
|
+
},
|
|
202
|
+
}}
|
|
203
|
+
>
|
|
204
|
+
{Template.bind({})}
|
|
205
|
+
</Story>
|
|
206
|
+
</Canvas>
|
|
207
|
+
|
|
208
|
+
# Use slots with helper, invalid, warning text, and the internal caption
|
|
209
|
+
|
|
210
|
+
<Canvas>
|
|
211
|
+
<Story
|
|
212
|
+
name="Slots"
|
|
213
|
+
parameters={{
|
|
214
|
+
controls: {
|
|
215
|
+
exclude: [
|
|
216
|
+
'props',
|
|
217
|
+
'default',
|
|
218
|
+
'template',
|
|
219
|
+
'change',
|
|
220
|
+
'update:modelValue',
|
|
221
|
+
'update:value',
|
|
222
|
+
'helper-text',
|
|
223
|
+
'invalid-message',
|
|
224
|
+
'warning-message',
|
|
225
|
+
'internal-caption',
|
|
226
|
+
'modelValue',
|
|
227
|
+
'ariaLabel',
|
|
228
|
+
'disabled',
|
|
229
|
+
'formItem',
|
|
230
|
+
'helperText',
|
|
231
|
+
'hideSelected',
|
|
232
|
+
'inline',
|
|
233
|
+
'invalidMessage',
|
|
234
|
+
'items',
|
|
235
|
+
'label',
|
|
236
|
+
'placeholder',
|
|
237
|
+
'size',
|
|
238
|
+
'up',
|
|
239
|
+
'value',
|
|
240
|
+
'warningMessage',
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
docs: { source: { code: slotsTemplate } },
|
|
244
|
+
}}
|
|
245
|
+
args={{
|
|
246
|
+
template: slotsTemplate,
|
|
247
|
+
label: 'Characters',
|
|
248
|
+
placeholder: 'Choose an ally',
|
|
249
|
+
slotInvalidText: false,
|
|
250
|
+
slotWarningText: false,
|
|
251
|
+
slotHelperText: true,
|
|
252
|
+
slotInternalCaption: false,
|
|
253
|
+
}}
|
|
254
|
+
argTypes={{}}
|
|
255
|
+
>
|
|
256
|
+
{Template.bind({})}
|
|
257
|
+
</Story>
|
|
258
|
+
</Canvas>
|
|
259
|
+
|
|
260
|
+
# Use an array of strings as the dropdown options
|
|
261
|
+
|
|
262
|
+
- Notes: this version does not seem very useful. Please comment in the Slack channel if you are using this.
|
|
263
|
+
Curious to know how it might be currently used.
|
|
264
|
+
|
|
265
|
+
<Canvas>
|
|
266
|
+
<Story
|
|
267
|
+
name="Items"
|
|
268
|
+
parameters={{
|
|
269
|
+
controls: {
|
|
270
|
+
exclude: [
|
|
271
|
+
'props',
|
|
272
|
+
'default',
|
|
273
|
+
'template',
|
|
274
|
+
'change',
|
|
275
|
+
'update:modelValue',
|
|
276
|
+
'update:value',
|
|
277
|
+
'helper-text',
|
|
278
|
+
'invalid-message',
|
|
279
|
+
'warning-message',
|
|
280
|
+
'internal-caption',
|
|
281
|
+
'modelValue',
|
|
282
|
+
'ariaLabel',
|
|
283
|
+
'disabled',
|
|
284
|
+
'formItem',
|
|
285
|
+
'helperText',
|
|
286
|
+
'hideSelected',
|
|
287
|
+
'inline',
|
|
288
|
+
'invalidMessage',
|
|
289
|
+
'items',
|
|
290
|
+
'label',
|
|
291
|
+
'placeholder',
|
|
292
|
+
'size',
|
|
293
|
+
'up',
|
|
294
|
+
'value',
|
|
295
|
+
'warningMessage',
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
docs: { source: { code: itemsTemplate } },
|
|
299
|
+
}}
|
|
300
|
+
args={{
|
|
301
|
+
template: itemsTemplate,
|
|
302
|
+
label: 'Planets',
|
|
303
|
+
placeholder: 'Where will you visit',
|
|
304
|
+
items: ['Coruscant', 'Tatooine', 'Naboo', 'Hoth', 'Kamino', 'Mandalore'],
|
|
305
|
+
}}
|
|
306
|
+
argTypes={{}}
|
|
307
|
+
>
|
|
308
|
+
{Template.bind({})}
|
|
309
|
+
</Story>
|
|
310
|
+
</Canvas>
|
|
311
|
+
|
|
312
|
+
# Use with v-model
|
|
313
|
+
|
|
314
|
+
<Canvas>
|
|
315
|
+
<Story
|
|
316
|
+
name="v-model"
|
|
317
|
+
parameters={{
|
|
318
|
+
controls: {
|
|
319
|
+
exclude: [
|
|
320
|
+
'props',
|
|
321
|
+
'default',
|
|
322
|
+
'template',
|
|
323
|
+
'change',
|
|
324
|
+
'update:modelValue',
|
|
325
|
+
'update:value',
|
|
326
|
+
'helper-text',
|
|
327
|
+
'invalid-message',
|
|
328
|
+
'warning-message',
|
|
329
|
+
'internal-caption',
|
|
330
|
+
'modelValue',
|
|
331
|
+
'ariaLabel',
|
|
332
|
+
'disabled',
|
|
333
|
+
'formItem',
|
|
334
|
+
'helperText',
|
|
335
|
+
'hideSelected',
|
|
336
|
+
'inline',
|
|
337
|
+
'invalidMessage',
|
|
338
|
+
'items',
|
|
339
|
+
'label',
|
|
340
|
+
'placeholder',
|
|
341
|
+
'size',
|
|
342
|
+
'up',
|
|
343
|
+
'value',
|
|
344
|
+
'warningMessage',
|
|
345
|
+
],
|
|
346
|
+
},
|
|
347
|
+
docs: { source: { code: vmodelTemplate } },
|
|
348
|
+
}}
|
|
349
|
+
args={{
|
|
350
|
+
template: vmodelTemplate,
|
|
351
|
+
label: 'Characters',
|
|
352
|
+
placeholder: 'Choose an ally',
|
|
353
|
+
}}
|
|
354
|
+
argTypes={{}}
|
|
355
|
+
>
|
|
356
|
+
{Template.bind({})}
|
|
357
|
+
</Story>
|
|
358
|
+
</Canvas>
|
|
359
|
+
|
|
360
|
+
# Skeleton - loading mode
|
|
361
|
+
|
|
362
|
+
- Notes: The Vue 2 story shows the `inline` attribute for the skeleton mode but this seems to have no effect on the display.
|
|
363
|
+
It is still supported but do not expect a change in display.
|
|
364
|
+
|
|
365
|
+
<Canvas>
|
|
366
|
+
<Story
|
|
367
|
+
name="skeleton"
|
|
368
|
+
parameters={{
|
|
369
|
+
controls: {
|
|
370
|
+
exclude: [
|
|
371
|
+
'props',
|
|
372
|
+
'default',
|
|
373
|
+
'template',
|
|
374
|
+
'change',
|
|
375
|
+
'update:modelValue',
|
|
376
|
+
'update:value',
|
|
377
|
+
'helper-text',
|
|
378
|
+
'invalid-message',
|
|
379
|
+
'warning-message',
|
|
380
|
+
'internal-caption',
|
|
381
|
+
'modelValue',
|
|
382
|
+
'ariaLabel',
|
|
383
|
+
'disabled',
|
|
384
|
+
'formItem',
|
|
385
|
+
'helperText',
|
|
386
|
+
'hideSelected',
|
|
387
|
+
'invalidMessage',
|
|
388
|
+
'items',
|
|
389
|
+
'label',
|
|
390
|
+
'placeholder',
|
|
391
|
+
'size',
|
|
392
|
+
'up',
|
|
393
|
+
'value',
|
|
394
|
+
'warningMessage',
|
|
395
|
+
'inline',
|
|
396
|
+
],
|
|
397
|
+
},
|
|
398
|
+
docs: { source: { code: skeletonTemplate } },
|
|
399
|
+
}}
|
|
400
|
+
args={{
|
|
401
|
+
template: skeletonTemplate,
|
|
402
|
+
}}
|
|
403
|
+
argTypes={{}}
|
|
404
|
+
>
|
|
405
|
+
{Template.bind({})}
|
|
406
|
+
</Story>
|
|
407
|
+
</Canvas>
|