@carbon/vue 3.0.10 → 3.0.12
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/README.md +4 -4
- package/dist/carbon-vue-3.common.js +247 -166
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.umd.js +247 -166
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +2 -2
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/dist/web-types.json +41 -36
- package/package.json +3 -3
- package/src/components/CvComboBox/CvComboBox.vue +1 -1
- package/src/components/CvDataTable/CvDataTable.stories.mdx +39 -14
- package/src/components/CvDataTable/CvDataTable.vue +1 -1
- package/src/components/CvDataTable/CvDataTableHeading.vue +3 -5
- package/src/components/CvDatePicker/CvDatePicker.vue +7 -8
- package/src/components/CvDropdown/CvDropdown.stories.mdx +7 -66
- package/src/components/CvDropdown/CvDropdown.vue +7 -18
- package/src/components/CvDropdown/CvDropdownItem.vue +1 -1
- package/src/components/CvFileUploader/CvFileUploader.stories.mdx +79 -14
- package/src/components/CvFileUploader/CvFileUploaderItem.vue +8 -7
- package/src/components/CvLink/CvLink.vue +6 -1
- package/src/components/CvLoading/CvLoading.vue +1 -1
- package/src/components/CvModal/CvModal.vue +35 -13
- package/src/components/CvModal/index.js +29 -1
- package/src/components/CvMultiSelect/CvMultiSelect.stories.mdx +8 -18
- package/src/components/CvMultiSelect/CvMultiSelect.vue +14 -19
- package/src/components/CvNotification/CvInlineNotification.stories.js +58 -1
- package/src/components/CvNotification/CvInlineNotification.vue +13 -3
- package/src/components/CvNotification/CvInlineNotificationTemplate.mdx +16 -0
- package/src/components/CvProgress/CvProgress.stories.mdx +23 -1
- package/src/components/CvProgress/CvProgressSkeleton.vue +37 -0
- package/src/components/CvProgress/CvProgressStep.vue +1 -1
- package/src/components/CvProgress/index.js +3 -1
- package/src/components/CvSearch/CvSearch.stories.mdx +4 -13
- package/src/components/CvSearch/CvSearch.vue +8 -20
- package/src/components/CvTabs/CvTabs.vue +3 -3
- package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +3 -3
- package/src/components/CvTooltip/CvInteractiveTooltip.vue +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, Title, Primary, Stories } from '@storybook/addon-docs';
|
|
2
|
+
|
|
3
|
+
<Meta isTemplate />
|
|
4
|
+
|
|
5
|
+
<Title />
|
|
6
|
+
|
|
7
|
+
Migration notes:
|
|
8
|
+
|
|
9
|
+
- **Breaking**. The `subTitle` property no longer renders html. Please use the `subtitle` slot instead.
|
|
10
|
+
- The `title` content can now be provided in the `title` slot.
|
|
11
|
+
|
|
12
|
+
<Primary />
|
|
13
|
+
|
|
14
|
+
<Controls />
|
|
15
|
+
|
|
16
|
+
<Stories />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
-
import { CvProgress, CvProgressStep } from '.';
|
|
2
|
+
import { CvProgress, CvProgressStep, CvProgressSkeleton } from '.';
|
|
3
3
|
import { Time20 as TimeIcon } from '@carbon/icons-vue';
|
|
4
4
|
// noinspection ES6PreferShortImport
|
|
5
5
|
import { sbCompPrefix } from '../../global/storybook-utils';
|
|
@@ -13,6 +13,7 @@ export const Template = args => ({
|
|
|
13
13
|
CvProgress,
|
|
14
14
|
CvProgressStep,
|
|
15
15
|
TimeIcon,
|
|
16
|
+
CvProgressSkeleton
|
|
16
17
|
},
|
|
17
18
|
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
18
19
|
setup() {
|
|
@@ -106,6 +107,7 @@ const slotTemplate = `
|
|
|
106
107
|
</cv-progress-step>
|
|
107
108
|
</cv-progress>
|
|
108
109
|
`;
|
|
110
|
+
const skeletonTemplate = `<cv-progress-skeleton :vertical="vertical" />`;
|
|
109
111
|
|
|
110
112
|
# CvProgress
|
|
111
113
|
|
|
@@ -200,3 +202,23 @@ Use `cv-progress-step` for more control over the display.
|
|
|
200
202
|
{Template.bind({})}
|
|
201
203
|
</Story>
|
|
202
204
|
</Canvas>
|
|
205
|
+
|
|
206
|
+
# Skeleton
|
|
207
|
+
|
|
208
|
+
<Canvas>
|
|
209
|
+
<Story
|
|
210
|
+
name="skeleton"
|
|
211
|
+
parameters={{
|
|
212
|
+
controls: {
|
|
213
|
+
include: ['vertical']
|
|
214
|
+
},
|
|
215
|
+
docs: { source: { code: skeletonTemplate } },
|
|
216
|
+
}}
|
|
217
|
+
args={{
|
|
218
|
+
template: skeletonTemplate,
|
|
219
|
+
vertical: false,
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
{Template.bind({})}
|
|
223
|
+
</Story>
|
|
224
|
+
</Canvas>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul
|
|
3
|
+
:class="[
|
|
4
|
+
`${carbonPrefix}--progress`,
|
|
5
|
+
`${carbonPrefix}--skeleton`,
|
|
6
|
+
{ [`${carbonPrefix}--progress--vertical`]: vertical },
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<li
|
|
10
|
+
v-for="n in 4"
|
|
11
|
+
:key="n"
|
|
12
|
+
:class="[
|
|
13
|
+
`${carbonPrefix}--progress-step`,
|
|
14
|
+
`${carbonPrefix}--progress-step--incomplete`,
|
|
15
|
+
]"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
:class="[
|
|
19
|
+
`${carbonPrefix}--progress-step-button`,
|
|
20
|
+
`${carbonPrefix}--progress-step-button--unclickable`,
|
|
21
|
+
]"
|
|
22
|
+
>
|
|
23
|
+
<CircleDash16 />
|
|
24
|
+
<p :class="[`${carbonPrefix}--progress-label`]" />
|
|
25
|
+
<span :class="[`${carbonPrefix}--progress-line`]" />
|
|
26
|
+
</div>
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
</template>
|
|
30
|
+
<script setup>
|
|
31
|
+
import { carbonPrefix } from '../../global/settings';
|
|
32
|
+
import { CircleDash16 } from '@carbon/icons-vue';
|
|
33
|
+
|
|
34
|
+
defineProps({
|
|
35
|
+
vertical: { type: Boolean, default: false },
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
@@ -25,7 +25,7 @@ export const Template = args => ({
|
|
|
25
25
|
clearAriaLabel: args.clearAriaLabel,
|
|
26
26
|
formItem: args.formItem,
|
|
27
27
|
expandable: args.expandable,
|
|
28
|
-
|
|
28
|
+
modelValue: args.modelValue,
|
|
29
29
|
myValue: myValue,
|
|
30
30
|
onInput: action('input'),
|
|
31
31
|
};
|
|
@@ -40,7 +40,7 @@ const defaultTemplate = `
|
|
|
40
40
|
:disabled="disabled"
|
|
41
41
|
:size="size"
|
|
42
42
|
:expandable="expandable"
|
|
43
|
-
:
|
|
43
|
+
:modelValue="modelValue"
|
|
44
44
|
:form-item="formItem"
|
|
45
45
|
:aria-label="ariaLabel"
|
|
46
46
|
:clear-aria-label="clearAriaLabel"
|
|
@@ -51,7 +51,7 @@ const defaultTemplate = `
|
|
|
51
51
|
const vModelTemplate = `
|
|
52
52
|
<div>
|
|
53
53
|
<cv-search
|
|
54
|
-
v-model
|
|
54
|
+
v-model="myValue"
|
|
55
55
|
:light="light"
|
|
56
56
|
:label="label"
|
|
57
57
|
:placeholder="placeholder"
|
|
@@ -64,7 +64,7 @@ const vModelTemplate = `
|
|
|
64
64
|
>
|
|
65
65
|
</cv-search>
|
|
66
66
|
<div style="margin-top:1rem; background-color: #888888; padding:1rem">
|
|
67
|
-
<div style="padding:1rem">v-model
|
|
67
|
+
<div style="padding:1rem">v-model: {{ myValue }}</div>
|
|
68
68
|
<input type="search" v-model="myValue"/>
|
|
69
69
|
</div>
|
|
70
70
|
</div>
|
|
@@ -74,8 +74,6 @@ const vModelTemplate = `
|
|
|
74
74
|
|
|
75
75
|
Migration notes:
|
|
76
76
|
|
|
77
|
-
- The `v-model` is different in Vue 3 than Vue 2. If you specify it you will see an error deprecation message in the log.
|
|
78
|
-
Please use `v-model:value=something` instead.
|
|
79
77
|
- The "toolbar" mode is removed in this version. Please use the `expandable` mode instead.
|
|
80
78
|
|
|
81
79
|
<Canvas>
|
|
@@ -85,10 +83,8 @@ Migration notes:
|
|
|
85
83
|
controls: {
|
|
86
84
|
exclude: [
|
|
87
85
|
'input',
|
|
88
|
-
'modelValue',
|
|
89
86
|
'template',
|
|
90
87
|
'update:modelValue',
|
|
91
|
-
'update:value',
|
|
92
88
|
'large',
|
|
93
89
|
'small',
|
|
94
90
|
'toolbarAriaLabel',
|
|
@@ -122,9 +118,6 @@ Migration notes:
|
|
|
122
118
|
|
|
123
119
|
# v-model
|
|
124
120
|
|
|
125
|
-
- The `v-model` is different in Vue 3 than Vue 2.If you specify it you will see an error deprecation message in the log.
|
|
126
|
-
Please use `v-model:value=something` instead.
|
|
127
|
-
|
|
128
121
|
<Canvas>
|
|
129
122
|
<Story
|
|
130
123
|
name="v-model"
|
|
@@ -132,10 +125,8 @@ Migration notes:
|
|
|
132
125
|
controls: {
|
|
133
126
|
exclude: [
|
|
134
127
|
'input',
|
|
135
|
-
'modelValue',
|
|
136
128
|
'template',
|
|
137
129
|
'update:modelValue',
|
|
138
|
-
'update:value',
|
|
139
130
|
'large',
|
|
140
131
|
'small',
|
|
141
132
|
'toolbarAriaLabel',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="formItem ? 'div' : CvEmpty"
|
|
4
|
-
:class="`cv-search
|
|
4
|
+
:class="[`cv-search`, `${carbonPrefix}--form-item`, $attrs.class]"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
7
|
ref="elSearch"
|
|
@@ -151,17 +151,9 @@ const props = defineProps({
|
|
|
151
151
|
/**
|
|
152
152
|
* Optionally provide the default value of the `<input>`
|
|
153
153
|
*/
|
|
154
|
-
value: { type: String, default: undefined },
|
|
155
|
-
/**
|
|
156
|
-
* @deprecated use value
|
|
157
|
-
*/
|
|
158
154
|
modelValue: {
|
|
159
155
|
type: String,
|
|
160
156
|
default: undefined,
|
|
161
|
-
validator: () => {
|
|
162
|
-
console.warn('Deprecated: use v-model:value instead');
|
|
163
|
-
return true;
|
|
164
|
-
},
|
|
165
157
|
},
|
|
166
158
|
/**
|
|
167
159
|
* Provide an optional placeholder text for the Search. Note: if the label and placeholder differ, VoiceOver on Mac will read both
|
|
@@ -184,14 +176,14 @@ const props = defineProps({
|
|
|
184
176
|
const uid = useCvId(props, true);
|
|
185
177
|
const isLight = useIsLight(props);
|
|
186
178
|
|
|
187
|
-
const clearVisible = ref(props.
|
|
188
|
-
const internalSearchText = ref(props.
|
|
179
|
+
const clearVisible = ref(props.modelValue ? props.modelValue.length : false);
|
|
180
|
+
const internalSearchText = ref(props.modelValue);
|
|
189
181
|
const searchActive = ref(false);
|
|
190
182
|
watch(
|
|
191
|
-
() => props.
|
|
183
|
+
() => props.modelValue,
|
|
192
184
|
() => {
|
|
193
|
-
clearVisible.value = props.
|
|
194
|
-
internalSearchText.value = props.
|
|
185
|
+
clearVisible.value = props.modelValue ? props.modelValue.length : false;
|
|
186
|
+
internalSearchText.value = props.modelValue;
|
|
195
187
|
}
|
|
196
188
|
);
|
|
197
189
|
|
|
@@ -204,14 +196,10 @@ const internalAriaLabelBy = computed(() => {
|
|
|
204
196
|
else return undefined;
|
|
205
197
|
});
|
|
206
198
|
|
|
207
|
-
const emit = defineEmits(['input', 'update:
|
|
199
|
+
const emit = defineEmits(['input', 'update:modelValue']);
|
|
208
200
|
watch(internalSearchText, () => {
|
|
209
201
|
emit('input', internalSearchText.value);
|
|
210
|
-
emit('update:
|
|
211
|
-
if (props.modelValue) {
|
|
212
|
-
console.warn('Deprecated: use v-model:value instead');
|
|
213
|
-
emit('update:modelValue', internalSearchText.value);
|
|
214
|
-
}
|
|
202
|
+
emit('update:modelValue', internalSearchText.value);
|
|
215
203
|
});
|
|
216
204
|
function onClearClick() {
|
|
217
205
|
internalSearchText.value = '';
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
:class="`${carbonPrefix}--tabs--scrollable__nav-link`"
|
|
71
71
|
role="tab"
|
|
72
72
|
:aria-controls="tab.uid"
|
|
73
|
-
:aria-disabled="disabledTabs.has(tab.uid)"
|
|
74
|
-
:aria-selected="selectedId === tab.uid"
|
|
73
|
+
:aria-disabled="disabledTabs.has(tab.uid) || null"
|
|
74
|
+
:aria-selected="`${selectedId === tab.uid}`"
|
|
75
75
|
:tabindex="selectedId === tab.uid ? 0 : -1"
|
|
76
76
|
type="button"
|
|
77
77
|
@click="onTabClick(tab.uid)"
|
|
@@ -187,7 +187,7 @@ function maybeSelectFirstTab() {
|
|
|
187
187
|
if (index > -1) selectedId.value = tabs.value[index].uid;
|
|
188
188
|
}
|
|
189
189
|
onMounted(maybeSelectFirstTab);
|
|
190
|
-
watch(tabs, maybeSelectFirstTab);
|
|
190
|
+
watch(tabs, maybeSelectFirstTab, { deep: true });
|
|
191
191
|
watch(selectedId, () => {
|
|
192
192
|
nextTick(() => {
|
|
193
193
|
doTabClick(selectedId.value);
|
|
@@ -7,9 +7,9 @@ exports[`CvTabs CvTabs - test slotted tab buttons to match snapshot 1`] = `
|
|
|
7
7
|
</svg></button>
|
|
8
8
|
<!--v-if-->
|
|
9
9
|
<ul class="bx--tabs--scrollable__nav" role="tablist">
|
|
10
|
-
<li class="cv-tabs-button bx--tabs--scrollable__nav-item bx--tabs__nav-item--selected bx--tabs--scrollable__nav-item--selected" role="presentation"><button id="tab-1-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-1" aria-
|
|
11
|
-
<li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-2-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-2" aria-
|
|
12
|
-
<li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-3-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-3" aria-
|
|
10
|
+
<li class="cv-tabs-button bx--tabs--scrollable__nav-item bx--tabs__nav-item--selected bx--tabs--scrollable__nav-item--selected" role="presentation"><button id="tab-1-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-1" aria-selected="true" tabindex="0" type="button">Hello <strong style="color: red;">(*)</strong></button></li>
|
|
11
|
+
<li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-2-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-2" aria-selected="false" tabindex="-1" type="button">Origin<strong style="color: orange;">(!)</strong></button></li>
|
|
12
|
+
<li class="cv-tabs-button bx--tabs--scrollable__nav-item" role="presentation"><button id="tab-3-link" class="bx--tabs--scrollable__nav-link" role="tab" aria-controls="tab-3" aria-selected="false" tabindex="-1" type="button">Tab 3 label</button></li>
|
|
13
13
|
</ul>
|
|
14
14
|
<!--v-if--><button aria-hidden="true" aria-label="scroll right" class="bx--tab--overflow-nav-button--hidden" tabindex="-1" type="button"><svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
|
|
15
15
|
<path d="M11 8L6 13 5.3 12.3 9.6 8 5.3 3.7 6 3z"></path>
|