@carbon/vue 3.0.9 → 3.0.11
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 +1 -1
- package/dist/carbon-vue-3.common.js +19642 -19310
- package/dist/carbon-vue-3.common.js.map +1 -1
- package/dist/carbon-vue-3.css +1 -1
- package/dist/carbon-vue-3.umd.js +19721 -19389
- package/dist/carbon-vue-3.umd.js.map +1 -1
- package/dist/carbon-vue-3.umd.min.js +3 -3
- package/dist/carbon-vue-3.umd.min.js.map +1 -1
- package/package.json +11 -43
- package/src/components/CvAccordion/CvAccordionItem.vue +1 -1
- package/src/components/CvButton/CvButton.stories.js +1 -1
- package/src/components/CvButton/CvButton.vue +2 -2
- package/src/components/CvButton/CvIconButton.stories.js +14 -17
- package/src/components/CvButton/CvIconButton.vue +8 -7
- package/src/components/CvCheckbox/CvCheckbox.vue +4 -3
- package/src/components/CvCodeSnippet/CvCodeSnippet.vue +5 -5
- package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +2 -2
- package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +6 -6
- package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +3 -3
- package/src/components/CvComboBox/CvComboBox.vue +9 -9
- package/src/components/CvContentSwitcher/CvContentSwitcher.vue +1 -1
- package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +1 -1
- package/src/components/CvCopyButton/CvCopyButton.vue +1 -1
- package/src/components/CvCopyButton/_CviCopyButton.vue +2 -2
- package/src/components/CvDataTable/CvDataTable.vue +29 -27
- package/src/components/CvDataTable/CvDataTableHeading.vue +9 -9
- package/src/components/CvDataTable/CvDataTableRow.vue +6 -6
- package/src/components/CvDataTable/CvDataTableSkeleton.vue +3 -3
- package/src/components/CvDataTable/_CvDataTableRowInner.vue +9 -9
- package/src/components/CvDatePicker/CvDatePicker.vue +10 -10
- package/src/components/CvDatePicker/CvDatePickerSkeleton.vue +3 -3
- package/src/components/CvDropdown/CvDropdown.stories.mdx +7 -66
- package/src/components/CvDropdown/CvDropdown.vue +13 -26
- package/src/components/CvDropdown/CvDropdownItem.vue +2 -2
- package/src/components/CvFileUploader/CvFileUploader.stories.mdx +79 -14
- package/src/components/CvFileUploader/CvFileUploader.vue +7 -7
- package/src/components/CvFileUploader/CvFileUploaderItem.vue +9 -8
- package/src/components/CvForm/CvFormGroup.vue +2 -2
- package/src/components/CvGrid/CvColumn.vue +5 -0
- package/src/components/CvLink/CvLink.vue +7 -2
- package/src/components/CvLoading/CvLoading.stories.js +1 -1
- package/src/components/CvLoading/CvLoading.vue +2 -2
- package/src/components/CvModal/CvModal.vue +19 -19
- package/src/components/CvMultiSelect/CvMultiSelect.stories.mdx +8 -18
- package/src/components/CvMultiSelect/CvMultiSelect.vue +17 -22
- package/src/components/CvNotification/CvToastNotification.stories.js +12 -15
- package/src/components/CvNotification/CvToastNotification.vue +1 -1
- package/src/components/CvNumberInput/CvNumberInput.vue +3 -6
- package/src/components/CvOverflowMenu/CvOverflowMenu.vue +11 -10
- package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +1 -1
- package/src/components/CvPagination/CvPagination.vue +11 -15
- package/src/components/CvProgress/CvProgress.stories.mdx +23 -1
- package/src/components/CvProgress/CvProgress.vue +1 -1
- package/src/components/CvProgress/CvProgressSkeleton.vue +37 -0
- package/src/components/CvProgress/CvProgressStep.vue +6 -6
- package/src/components/CvProgress/index.js +3 -1
- package/src/components/CvRadioButton/CvRadioButton.vue +3 -3
- package/src/components/CvSearch/CvSearch.stories.mdx +4 -13
- package/src/components/CvSearch/CvSearch.vue +17 -28
- package/src/components/CvSelect/CvSelect.vue +1 -1
- package/src/components/CvSlider/CvSlider.vue +7 -7
- package/src/components/CvSlider/__tests__/__snapshots__/CvSlider.spec.js.snap +1 -1
- package/src/components/CvStructuredList/CvStructuredListItem.vue +3 -3
- package/src/components/CvStructuredList/CvStructuredListItemSelectable.vue +1 -1
- package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap +3 -3
- package/src/components/CvSvg/__tests__/_TestIcon.vue +2 -2
- package/src/components/CvTabs/CvTab.vue +1 -1
- package/src/components/CvTabs/CvTabs.vue +13 -13
- package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +6 -6
- package/src/components/CvTag/CvTag.stories.js +1 -1
- package/src/components/CvTag/CvTag.vue +1 -1
- package/src/components/CvTextArea/CvTextArea.vue +6 -6
- package/src/components/CvTextInput/CvTextInput.stories.js +28 -16
- package/src/components/CvTextInput/CvTextInput.vue +37 -7
- package/src/components/CvTextInput/CvTextInputSkeleton.vue +17 -0
- package/src/components/CvTextInput/index.js +2 -1
- package/src/components/CvTile/CvTile.vue +3 -3
- package/src/components/CvTile/CvTileExpandable.vue +7 -7
- package/src/components/CvTile/CvTileSelectable.vue +2 -2
- package/src/components/CvTimePicker/CvTimePicker.vue +1 -1
- package/src/components/CvTooltip/CvDefinitionTooltip.vue +2 -2
- package/src/components/CvTooltip/CvInteractiveTooltip.vue +7 -7
- package/src/components/CvTooltip/__tests__/__snapshots__/CvTooltip.spec.js.snap +14 -14
- package/src/components/CvUIShell/CvHeader.vue +1 -1
- package/src/components/CvUIShell/CvHeaderGlobalAction.vue +7 -7
- package/src/components/CvUIShell/CvHeaderMenu.vue +3 -3
- package/src/components/CvUIShell/CvHeaderMenuButton.vue +2 -2
- package/src/components/CvUIShell/CvHeaderMenuItem.vue +2 -2
- package/src/components/CvUIShell/CvHeaderName.vue +1 -1
- package/src/components/CvUIShell/CvHeaderNav.vue +1 -1
- package/src/components/CvUIShell/CvHeaderPanel.vue +3 -2
- package/src/components/CvUIShell/CvSideNav.vue +5 -4
- package/src/components/CvUIShell/CvSideNavItems.vue +1 -1
- package/src/components/CvUIShell/CvSideNavLink.vue +1 -1
- package/src/components/CvUIShell/_CvSideNavFooter.vue +2 -1
|
@@ -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',
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:class="`cv-search ${carbonPrefix}--form-item`"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
|
+
ref="elSearch"
|
|
7
8
|
:aria-label="internalAriaLabel"
|
|
8
9
|
:aria-labelledby="internalAriaLabelBy"
|
|
9
10
|
:class="[
|
|
@@ -18,7 +19,6 @@
|
|
|
18
19
|
},
|
|
19
20
|
]"
|
|
20
21
|
role="search"
|
|
21
|
-
ref="elSearch"
|
|
22
22
|
>
|
|
23
23
|
<div
|
|
24
24
|
:class="`${carbonPrefix}--search-magnifier`"
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
}}</label>
|
|
34
34
|
|
|
35
35
|
<input
|
|
36
|
-
role="searchbox"
|
|
37
36
|
:id="uid"
|
|
38
|
-
:class="`${carbonPrefix}--search-input`"
|
|
39
37
|
v-bind="$attrs"
|
|
38
|
+
ref="elInput"
|
|
40
39
|
v-model="internalSearchText"
|
|
41
|
-
|
|
40
|
+
role="searchbox"
|
|
41
|
+
:class="`${carbonPrefix}--search-input`"
|
|
42
42
|
type="text"
|
|
43
|
-
ref="elInput"
|
|
44
43
|
:placeholder="placeholder"
|
|
45
44
|
:aria-labelledby="uid"
|
|
45
|
+
:disabled="disabled ? 'true' : undefined"
|
|
46
|
+
@input="onInput"
|
|
46
47
|
@blur="checkFocus"
|
|
47
48
|
@click="toggleActive"
|
|
48
49
|
@keydown.esc="onClearClick"
|
|
49
|
-
:disabled="disabled ? 'true' : undefined"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
52
|
<button
|
|
@@ -111,7 +111,7 @@ const props = defineProps({
|
|
|
111
111
|
/**
|
|
112
112
|
* Provide the label text for the Search icon
|
|
113
113
|
*/
|
|
114
|
-
label: String,
|
|
114
|
+
label: { type: String, default: undefined },
|
|
115
115
|
/**
|
|
116
116
|
* Specify the search size ('sm', 'md', 'lg', 'xl')
|
|
117
117
|
*/
|
|
@@ -151,17 +151,9 @@ const props = defineProps({
|
|
|
151
151
|
/**
|
|
152
152
|
* Optionally provide the default value of the `<input>`
|
|
153
153
|
*/
|
|
154
|
-
value: String,
|
|
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
|
|
@@ -172,10 +164,11 @@ const props = defineProps({
|
|
|
172
164
|
*/
|
|
173
165
|
toolbarAriaLabel: {
|
|
174
166
|
type: String,
|
|
175
|
-
validator:
|
|
176
|
-
console.warn('Deprecated: probably you want expandable=true');
|
|
167
|
+
validator: s => {
|
|
168
|
+
if (s) console.warn('Deprecated: probably you want expandable=true');
|
|
177
169
|
return true;
|
|
178
170
|
},
|
|
171
|
+
default: undefined,
|
|
179
172
|
},
|
|
180
173
|
...propsTheme,
|
|
181
174
|
...propsCvId,
|
|
@@ -183,14 +176,14 @@ const props = defineProps({
|
|
|
183
176
|
const uid = useCvId(props, true);
|
|
184
177
|
const isLight = useIsLight(props);
|
|
185
178
|
|
|
186
|
-
const clearVisible = ref(props.
|
|
187
|
-
const internalSearchText = ref(props.
|
|
179
|
+
const clearVisible = ref(props.modelValue ? props.modelValue.length : false);
|
|
180
|
+
const internalSearchText = ref(props.modelValue);
|
|
188
181
|
const searchActive = ref(false);
|
|
189
182
|
watch(
|
|
190
|
-
() => props.
|
|
183
|
+
() => props.modelValue,
|
|
191
184
|
() => {
|
|
192
|
-
clearVisible.value = props.
|
|
193
|
-
internalSearchText.value = props.
|
|
185
|
+
clearVisible.value = props.modelValue ? props.modelValue.length : false;
|
|
186
|
+
internalSearchText.value = props.modelValue;
|
|
194
187
|
}
|
|
195
188
|
);
|
|
196
189
|
|
|
@@ -203,14 +196,10 @@ const internalAriaLabelBy = computed(() => {
|
|
|
203
196
|
else return undefined;
|
|
204
197
|
});
|
|
205
198
|
|
|
206
|
-
const emit = defineEmits(['input', 'update:
|
|
199
|
+
const emit = defineEmits(['input', 'update:modelValue']);
|
|
207
200
|
watch(internalSearchText, () => {
|
|
208
201
|
emit('input', internalSearchText.value);
|
|
209
|
-
emit('update:
|
|
210
|
-
if (props.modelValue) {
|
|
211
|
-
console.warn('Deprecated: use v-model:value instead');
|
|
212
|
-
emit('update:modelValue', internalSearchText.value);
|
|
213
|
-
}
|
|
202
|
+
emit('update:modelValue', internalSearchText.value);
|
|
214
203
|
});
|
|
215
204
|
function onClearClick() {
|
|
216
205
|
internalSearchText.value = '';
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<div :class="`cv-slider ${carbonPrefix}--form-item`">
|
|
3
3
|
<label
|
|
4
4
|
v-show="label"
|
|
5
|
+
:id="labelId"
|
|
5
6
|
:for="cvId"
|
|
6
7
|
:class="[
|
|
7
8
|
`${carbonPrefix}--label`,
|
|
8
9
|
{ [`${carbonPrefix}--label--disabled`]: disabled },
|
|
9
10
|
]"
|
|
10
|
-
:id="labelId"
|
|
11
11
|
>
|
|
12
12
|
{{ label }}
|
|
13
13
|
</label>
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
data-slider-input-box="#slider-input-box"
|
|
27
27
|
>
|
|
28
28
|
<div
|
|
29
|
+
ref="track"
|
|
29
30
|
:class="`${carbonPrefix}--slider__track`"
|
|
30
31
|
@click="onTrackClick"
|
|
31
|
-
ref="track"
|
|
32
32
|
></div>
|
|
33
33
|
|
|
34
34
|
<div
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
></div>
|
|
38
38
|
|
|
39
39
|
<div
|
|
40
|
+
ref="thumb"
|
|
40
41
|
:class="[
|
|
41
42
|
`${carbonPrefix}--slider__thumb`,
|
|
42
43
|
{
|
|
@@ -46,7 +47,6 @@
|
|
|
46
47
|
tabindex="0"
|
|
47
48
|
:aria-labelledby="labelId"
|
|
48
49
|
:style="`left: ${percentage};`"
|
|
49
|
-
ref="thumb"
|
|
50
50
|
@keydown.up.right.prevent="onUp"
|
|
51
51
|
@keydown.down.left.prevent="onDown"
|
|
52
52
|
@mousedown="onStartDrag"
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
|
|
55
55
|
<input
|
|
56
56
|
:id="cvId"
|
|
57
|
+
ref="range"
|
|
57
58
|
:class="`${carbonPrefix}--slider__input`"
|
|
58
59
|
type="range"
|
|
59
60
|
:step="step"
|
|
60
61
|
:min="min"
|
|
61
62
|
:max="max"
|
|
62
|
-
ref="range"
|
|
63
63
|
/>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
@@ -68,18 +68,18 @@
|
|
|
68
68
|
</span>
|
|
69
69
|
|
|
70
70
|
<input
|
|
71
|
+
ref="inputBox"
|
|
72
|
+
v-model="internalValue"
|
|
71
73
|
type="string"
|
|
72
74
|
:class="[
|
|
73
75
|
`${carbonPrefix}--text-input ${carbonPrefix}--slider-text-input`,
|
|
74
76
|
{ [`${carbonPrefix}--text-input--light`]: isLight },
|
|
75
77
|
]"
|
|
76
78
|
:placeholder="min"
|
|
77
|
-
|
|
79
|
+
:disabled="disabled"
|
|
78
80
|
@change="onChange"
|
|
79
|
-
ref="inputBox"
|
|
80
81
|
@keydown.up.prevent="onUp"
|
|
81
82
|
@keydown.down.prevent="onDown"
|
|
82
|
-
:disabled="disabled"
|
|
83
83
|
/>
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`CvSlider should match snapshot 1`] = `
|
|
4
|
-
<div class="cv-slider bx--form-item"><label for="abc" class="bx--label"
|
|
4
|
+
<div class="cv-slider bx--form-item"><label id="abc-label" for="abc" class="bx--label" style="display: none;"></label>
|
|
5
5
|
<div class="bx--slider-container"><span class="bx--slider__range-label">0</span>
|
|
6
6
|
<div class="bx--slider" data-slider="" data-slider-input-box="#slider-input-box">
|
|
7
7
|
<div class="bx--slider__track"></div>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
v-bind="$attrs"
|
|
5
5
|
class="cv-structured-list-item"
|
|
6
6
|
:value="value"
|
|
7
|
-
:
|
|
7
|
+
:model-value="modelValue"
|
|
8
8
|
>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</component>
|
|
@@ -30,8 +30,8 @@ defineProps({
|
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const selectable = inject('selectable');
|
|
34
|
-
const change = inject('change');
|
|
33
|
+
const selectable = inject('selectable', false);
|
|
34
|
+
const change = inject('change', () => {});
|
|
35
35
|
const emit = defineEmits(['change']);
|
|
36
36
|
|
|
37
37
|
provide('onRadioItemChange', clickedItemCvId => {
|
package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`CvStructuredListItem should render correctly when \`value\` is default 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item"
|
|
3
|
+
exports[`CvStructuredListItem should render correctly when \`value\` is default 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" model-value="test"></cv-structured-list-item-standard-stub>`;
|
|
4
4
|
|
|
5
|
-
exports[`CvStructuredListItem should render correctly when \`value\` is set 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item"
|
|
5
|
+
exports[`CvStructuredListItem should render correctly when \`value\` is set 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" model-value="test" value="strictured list item value test"></cv-structured-list-item-standard-stub>`;
|
|
6
6
|
|
|
7
|
-
exports[`CvStructuredListItem should render correctly when slot is specified 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item"
|
|
7
|
+
exports[`CvStructuredListItem should render correctly when slot is specified 1`] = `<cv-structured-list-item-standard-stub id="test-2" class="cv-structured-list-item" model-value="test"></cv-structured-list-item-standard-stub>`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"
|
|
3
|
-
<g fill-rule="evenodd"
|
|
2
|
+
<svg id="root" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
|
3
|
+
<g id="g" fill-rule="evenodd">
|
|
4
4
|
<path
|
|
5
5
|
id="path"
|
|
6
6
|
d="M7 7H4v2h3v3h2V9h3V7H9V4H7v3zm1 9A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
@keydown.left.prevent.stop="onLeft"
|
|
17
17
|
>
|
|
18
18
|
<button
|
|
19
|
+
ref="elLeftOverflow"
|
|
19
20
|
aria-hidden="true"
|
|
20
21
|
aria-label="scroll left"
|
|
21
22
|
:class="[
|
|
@@ -25,12 +26,11 @@
|
|
|
25
26
|
leftOverflowNavButtonHidden,
|
|
26
27
|
},
|
|
27
28
|
]"
|
|
29
|
+
tabIndex="-1"
|
|
30
|
+
type="button"
|
|
28
31
|
@click.stop.prevent="e => onOverflowClick(e, { direction: -1 })"
|
|
29
32
|
@mousedown.stop.prevent="e => onOverflowMouseDown(e, { direction: -1 })"
|
|
30
33
|
@mouseup.stop.prevent="onOverflowMouseUp"
|
|
31
|
-
tabIndex="-1"
|
|
32
|
-
type="button"
|
|
33
|
-
ref="elLeftOverflow"
|
|
34
34
|
>
|
|
35
35
|
<ChevronLeft16 />
|
|
36
36
|
</button>
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
/>
|
|
41
41
|
|
|
42
42
|
<ul
|
|
43
|
+
ref="elTabList"
|
|
43
44
|
:class="`${carbonPrefix}--tabs--scrollable__nav`"
|
|
44
45
|
role="tablist"
|
|
45
|
-
ref="elTabList"
|
|
46
46
|
>
|
|
47
47
|
<li
|
|
48
48
|
v-for="tab in tabs"
|
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
role="presentation"
|
|
66
66
|
>
|
|
67
67
|
<button
|
|
68
|
+
:id="`${tab.uid}-link`"
|
|
69
|
+
ref="elLink"
|
|
68
70
|
:class="`${carbonPrefix}--tabs--scrollable__nav-link`"
|
|
69
71
|
role="tab"
|
|
70
72
|
:aria-controls="tab.uid"
|
|
71
|
-
:aria-disabled="disabledTabs.has(tab.uid)"
|
|
73
|
+
:aria-disabled="disabledTabs.has(tab.uid) || null"
|
|
72
74
|
:aria-selected="selectedId === tab.uid"
|
|
73
|
-
:id="`${tab.uid}-link`"
|
|
74
|
-
@click="onTabClick(tab.uid)"
|
|
75
|
-
ref="elLink"
|
|
76
75
|
:tabindex="selectedId === tab.uid ? 0 : -1"
|
|
77
76
|
type="button"
|
|
77
|
+
@click="onTabClick(tab.uid)"
|
|
78
78
|
>
|
|
79
79
|
<slot :name="tab.uid" v-bind="tab">
|
|
80
80
|
{{ tab.label }}
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
:class="`${carbonPrefix}--tabs__overflow-indicator--right`"
|
|
89
89
|
/>
|
|
90
90
|
<button
|
|
91
|
+
ref="elRightOverflow"
|
|
91
92
|
aria-hidden="true"
|
|
92
93
|
aria-label="scroll right"
|
|
93
94
|
:class="[
|
|
@@ -97,12 +98,11 @@
|
|
|
97
98
|
rightOverflowNavButtonHidden,
|
|
98
99
|
},
|
|
99
100
|
]"
|
|
101
|
+
tabIndex="-1"
|
|
102
|
+
type="button"
|
|
100
103
|
@click="e => onOverflowClick(e, { direction: 1 })"
|
|
101
104
|
@mousedown="e => onOverflowMouseDown(e, { direction: 1 })"
|
|
102
105
|
@mouseup="onOverflowMouseUp"
|
|
103
|
-
tabIndex="-1"
|
|
104
|
-
type="button"
|
|
105
|
-
ref="elRightOverflow"
|
|
106
106
|
>
|
|
107
107
|
<ChevronRight16 />
|
|
108
108
|
</button>
|
|
@@ -136,7 +136,7 @@ const props = defineProps({
|
|
|
136
136
|
/**
|
|
137
137
|
* @deprecated not used in component
|
|
138
138
|
*/
|
|
139
|
-
leftOverflowIconButtonProps: Object,
|
|
139
|
+
leftOverflowIconButtonProps: { type: Object, default: undefined },
|
|
140
140
|
/**
|
|
141
141
|
* This is an edge use case. By default, if no tab is explicitly selected, the first non-disabled tab is selected.
|
|
142
142
|
*/
|
|
@@ -144,7 +144,7 @@ const props = defineProps({
|
|
|
144
144
|
/**
|
|
145
145
|
* @deprecated not used in component
|
|
146
146
|
*/
|
|
147
|
-
rightOverflowIconButtonProps: Object,
|
|
147
|
+
rightOverflowIconButtonProps: { type: Object, default: undefined },
|
|
148
148
|
/**
|
|
149
149
|
* @deprecated not used in component
|
|
150
150
|
*/
|
|
@@ -7,18 +7,18 @@ 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 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 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 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>
|
|
16
16
|
</svg></button>
|
|
17
17
|
</div>
|
|
18
18
|
<div class="cv-tabs__panels">
|
|
19
|
-
<div class="cv-tab bx--tab-content"
|
|
20
|
-
<div class="cv-tab bx--tab-content"
|
|
21
|
-
<div class="cv-tab bx--tab-content"
|
|
19
|
+
<div id="tab-1" class="cv-tab bx--tab-content" role="tabpanel" aria-labelledby="tab-1-link" aria-hidden="false">Tab 1 content</div>
|
|
20
|
+
<div id="tab-2" class="cv-tab bx--tab-content" role="tabpanel" aria-labelledby="tab-2-link" aria-hidden="true" hidden="">Tab 2 content</div>
|
|
21
|
+
<div id="tab-3" class="cv-tab bx--tab-content" role="tabpanel" aria-labelledby="tab-3-link" aria-hidden="true" hidden="">Tab 3 content</div>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
24
|
`;
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
</label>
|
|
15
15
|
<div
|
|
16
16
|
:class="`${carbonPrefix}--text-area__wrapper`"
|
|
17
|
-
:data-invalid="isInvalid"
|
|
17
|
+
:data-invalid="isInvalid || null"
|
|
18
18
|
>
|
|
19
19
|
<WarningFilled16
|
|
20
20
|
v-if="isInvalid"
|
|
21
21
|
:class="`${carbonPrefix}--text-area__invalid-icon`"
|
|
22
22
|
/>
|
|
23
23
|
<textarea
|
|
24
|
-
:aria-invalid="isInvalid"
|
|
25
|
-
:aria-describedby="isInvalid ? errorId : undefined"
|
|
26
24
|
:id="cvId"
|
|
25
|
+
:aria-invalid="isInvalid || null"
|
|
26
|
+
:aria-describedby="isInvalid ? errorId : undefined"
|
|
27
27
|
:class="[
|
|
28
28
|
`${carbonPrefix}--text-area`,
|
|
29
29
|
{
|
|
@@ -66,12 +66,12 @@ const props = defineProps({
|
|
|
66
66
|
helperText: { type: String, default: undefined },
|
|
67
67
|
hideLabel: { type: Boolean, default: false },
|
|
68
68
|
invalidMessage: { type: String, default: undefined },
|
|
69
|
-
label: String,
|
|
70
|
-
modelValue: String,
|
|
69
|
+
label: { type: String, default: undefined },
|
|
70
|
+
modelValue: { type: String, default: undefined },
|
|
71
71
|
...propsCvId,
|
|
72
72
|
...propsTheme,
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
defineEmits(['update:modelValue']);
|
|
75
75
|
const cvId = useCvId(props);
|
|
76
76
|
|
|
77
77
|
// DOM
|