@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
|
@@ -58,7 +58,7 @@ export const Template = args => ({
|
|
|
58
58
|
title: args.title,
|
|
59
59
|
label: args.label,
|
|
60
60
|
highlight: args.highlight,
|
|
61
|
-
|
|
61
|
+
modelValue: args.modelValue,
|
|
62
62
|
selectionFeedback: args.selectionFeedback,
|
|
63
63
|
filterable: args.filterable,
|
|
64
64
|
light: args.light,
|
|
@@ -70,7 +70,7 @@ export const Template = args => ({
|
|
|
70
70
|
myValue: myValue,
|
|
71
71
|
onChange: action('change'),
|
|
72
72
|
onFilter: action('filter'),
|
|
73
|
-
onVmodel: action('update:
|
|
73
|
+
onVmodel: action('update:modelValue'),
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
template: args.template,
|
|
@@ -93,7 +93,7 @@ const defaultTemplate = `
|
|
|
93
93
|
:options="options"
|
|
94
94
|
:selectionFeedback="selectionFeedback"
|
|
95
95
|
:title="title"
|
|
96
|
-
:
|
|
96
|
+
:modelValue="modelValue"
|
|
97
97
|
:warningMessage="warningMessage"
|
|
98
98
|
@change="onChange"
|
|
99
99
|
@filter="onFilter"
|
|
@@ -123,13 +123,13 @@ const vModelTemplate = `
|
|
|
123
123
|
:label="label"
|
|
124
124
|
:options="options"
|
|
125
125
|
:title="title"
|
|
126
|
-
v-model
|
|
126
|
+
v-model="myValue"
|
|
127
127
|
@change="onChange"
|
|
128
128
|
@filter="onFilter"
|
|
129
129
|
>
|
|
130
130
|
</cv-multi-select>
|
|
131
131
|
<div style="margin-top:2rem">
|
|
132
|
-
<div>v-model
|
|
132
|
+
<div>v-model</div>
|
|
133
133
|
<select name="cars" id="cars" v-model="myValue" multiple>
|
|
134
134
|
<option v-for="opt in options" :key="opt.value" :value="opt.value">{{opt.value}}</option>
|
|
135
135
|
</select>
|
|
@@ -147,8 +147,6 @@ Migration notes:
|
|
|
147
147
|
- Added the `warningMessage` option to match Carbon React
|
|
148
148
|
- Setting `autoFilter` to true now implies `filterable`. Previous versions required `filterable` to
|
|
149
149
|
be explicitly set to `true` for `autoFilter` to work properly.
|
|
150
|
-
- The `v-model` is different in Vue 3 than Vue 2.If you specify it you will see a error deprecation message in the log.
|
|
151
|
-
Please use `v-model:value=something` instead.
|
|
152
150
|
|
|
153
151
|
<Canvas>
|
|
154
152
|
<Story
|
|
@@ -160,10 +158,8 @@ Migration notes:
|
|
|
160
158
|
'filter',
|
|
161
159
|
'helper-text',
|
|
162
160
|
'invalid-message',
|
|
163
|
-
'modelValue',
|
|
164
161
|
'template',
|
|
165
162
|
'update:modelValue',
|
|
166
|
-
'update:value',
|
|
167
163
|
'warning-message',
|
|
168
164
|
],
|
|
169
165
|
},
|
|
@@ -210,7 +206,7 @@ Migration notes:
|
|
|
210
206
|
control: 'inline-radio',
|
|
211
207
|
options: [],
|
|
212
208
|
},
|
|
213
|
-
|
|
209
|
+
modelValue: {
|
|
214
210
|
control: 'multi-select',
|
|
215
211
|
options: pkdValues,
|
|
216
212
|
},
|
|
@@ -242,15 +238,13 @@ Migration notes:
|
|
|
242
238
|
'invalid-message',
|
|
243
239
|
'invalidMessage',
|
|
244
240
|
'light',
|
|
245
|
-
'modelValue',
|
|
246
241
|
'options',
|
|
247
242
|
'selectionFeedback',
|
|
248
243
|
'template',
|
|
249
244
|
'update:modelValue',
|
|
250
|
-
'update:value',
|
|
251
|
-
'value',
|
|
252
245
|
'warning-message',
|
|
253
246
|
'warningMessage',
|
|
247
|
+
'modelValue'
|
|
254
248
|
],
|
|
255
249
|
},
|
|
256
250
|
docs: { source: { code: slotsTemplate } },
|
|
@@ -272,8 +266,6 @@ Migration notes:
|
|
|
272
266
|
|
|
273
267
|
# v-model
|
|
274
268
|
|
|
275
|
-
Note: Specifying `v-model="something"` will not work. Use `v-model:value=something` instead.
|
|
276
|
-
|
|
277
269
|
<Canvas>
|
|
278
270
|
<Story
|
|
279
271
|
name="v-model"
|
|
@@ -300,8 +292,6 @@ Note: Specifying `v-model="something"` will not work. Use `v-model:value=somethi
|
|
|
300
292
|
'selectionFeedback',
|
|
301
293
|
'template',
|
|
302
294
|
'update:modelValue',
|
|
303
|
-
'update:value',
|
|
304
|
-
'value',
|
|
305
295
|
'warning-message',
|
|
306
296
|
'warningMessage',
|
|
307
297
|
],
|
|
@@ -322,7 +312,7 @@ Note: Specifying `v-model="something"` will not work. Use `v-model:value=somethi
|
|
|
322
312
|
control: 'inline-radio',
|
|
323
313
|
options: [],
|
|
324
314
|
},
|
|
325
|
-
|
|
315
|
+
modelValue: {
|
|
326
316
|
control: 'multi-select',
|
|
327
317
|
options: pkdValues,
|
|
328
318
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
[`${carbonPrefix}--combo-box`]: isFilterable,
|
|
46
46
|
},
|
|
47
47
|
]"
|
|
48
|
-
:data-invalid="data.isInvalid
|
|
48
|
+
:data-invalid="data.isInvalid || null"
|
|
49
49
|
v-bind="$attrs"
|
|
50
50
|
@keydown.down.prevent="onDown"
|
|
51
51
|
@keydown.up.prevent="onUp"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
ref="elButton"
|
|
66
66
|
type="button"
|
|
67
67
|
:class="`${carbonPrefix}--list-box__field`"
|
|
68
|
-
:aria-disabled="disabled"
|
|
68
|
+
:aria-disabled="disabled || null"
|
|
69
69
|
aria-haspopup="listbox"
|
|
70
70
|
:aria-expanded="data.open ? 'true' : 'false'"
|
|
71
71
|
:aria-owns="uid"
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
<div
|
|
151
151
|
v-for="(item, index) in data.options"
|
|
152
152
|
ref="elOption"
|
|
153
|
-
role="menuitem"
|
|
154
153
|
:key="`multi-select-${index}`"
|
|
154
|
+
role="menuitem"
|
|
155
155
|
:class="[
|
|
156
156
|
`${carbonPrefix}--list-box__menu-item`,
|
|
157
157
|
{
|
|
@@ -281,7 +281,7 @@ const props = defineProps({
|
|
|
281
281
|
/**
|
|
282
282
|
* The value of an option to initially highlight
|
|
283
283
|
*/
|
|
284
|
-
highlight: String,
|
|
284
|
+
highlight: { type: String, default: undefined },
|
|
285
285
|
/**
|
|
286
286
|
* Specify 'true' to create an inline multi-select.
|
|
287
287
|
*/
|
|
@@ -341,24 +341,17 @@ const props = defineProps({
|
|
|
341
341
|
/**
|
|
342
342
|
* Provide text to be used in a <label> element that is tied to the multiselect via ARIA attributes.
|
|
343
343
|
*/
|
|
344
|
-
title: String,
|
|
345
|
-
/***
|
|
346
|
-
* Allow users to pass in arbitrary items from their collection that are pre-selected
|
|
347
|
-
*/
|
|
348
|
-
value: { type: Array, default: () => [] },
|
|
344
|
+
title: { type: String, default: undefined },
|
|
349
345
|
/**
|
|
350
346
|
* Provide the text that is displayed and put the control in warning state
|
|
351
347
|
*/
|
|
352
348
|
warningMessage: { type: String, default: undefined },
|
|
349
|
+
/***
|
|
350
|
+
* Allow users to pass in arbitrary items from their collection that are pre-selected
|
|
351
|
+
*/
|
|
353
352
|
modelValue: {
|
|
354
353
|
type: Array,
|
|
355
|
-
|
|
356
|
-
console.error(
|
|
357
|
-
`v-model for cv-multi-select is deprecated. Specify "v-model:value" instead [${val}]`
|
|
358
|
-
);
|
|
359
|
-
return true;
|
|
360
|
-
},
|
|
361
|
-
default: undefined,
|
|
354
|
+
default: () => [],
|
|
362
355
|
},
|
|
363
356
|
...propsCvId,
|
|
364
357
|
...propsTheme,
|
|
@@ -379,13 +372,15 @@ const data = reactive({
|
|
|
379
372
|
isWarning: false,
|
|
380
373
|
isInvalid: false,
|
|
381
374
|
});
|
|
382
|
-
const emit = defineEmits(['update:
|
|
375
|
+
const emit = defineEmits(['update:modelValue', 'change', 'filter']);
|
|
383
376
|
watch(
|
|
384
377
|
() => data.selectedItems,
|
|
385
378
|
() => {
|
|
386
|
-
if (
|
|
379
|
+
if (
|
|
380
|
+
JSON.stringify(data.selectedItems) !== JSON.stringify(props.modelValue)
|
|
381
|
+
) {
|
|
387
382
|
emit('change', data.selectedItems);
|
|
388
|
-
emit('update:
|
|
383
|
+
emit('update:modelValue', data.selectedItems);
|
|
389
384
|
}
|
|
390
385
|
},
|
|
391
386
|
{
|
|
@@ -409,7 +404,7 @@ const isFilterable = computed(() => {
|
|
|
409
404
|
});
|
|
410
405
|
|
|
411
406
|
function updateSelectedItems() {
|
|
412
|
-
data.selectedItems = props.
|
|
407
|
+
data.selectedItems = props.modelValue.filter(
|
|
413
408
|
/***
|
|
414
409
|
* @param {string} item
|
|
415
410
|
* @returns {boolean}
|
|
@@ -431,7 +426,7 @@ onUpdated(checkSlots);
|
|
|
431
426
|
onMounted(updateOptions);
|
|
432
427
|
onMounted(updateSelectedItems);
|
|
433
428
|
|
|
434
|
-
watch(() => props.
|
|
429
|
+
watch(() => props.modelValue, updateSelectedItems);
|
|
435
430
|
watch(() => props.options, updateOptions);
|
|
436
431
|
watch(() => props.selectionFeedback, updateOptions);
|
|
437
432
|
|
|
@@ -462,7 +457,7 @@ const highlighted = computed({
|
|
|
462
457
|
},
|
|
463
458
|
});
|
|
464
459
|
onMounted(() => {
|
|
465
|
-
highlighted.value = props.
|
|
460
|
+
highlighted.value = props.modelValue ? props.modelValue : props.highlight; // override highlight with modelValue if provided
|
|
466
461
|
});
|
|
467
462
|
|
|
468
463
|
const internalFilter = computed({
|
|
@@ -8,20 +8,17 @@ export default {
|
|
|
8
8
|
component: CvToastNotification,
|
|
9
9
|
argTypes: {
|
|
10
10
|
kind: {
|
|
11
|
-
control:
|
|
12
|
-
|
|
13
|
-
options: CvNotificationConsts.notificationKinds,
|
|
14
|
-
},
|
|
15
|
-
defaultValue: CvNotificationConsts.notificationKinds[0],
|
|
11
|
+
control: 'select',
|
|
12
|
+
options: CvNotificationConsts.notificationKinds,
|
|
16
13
|
table: {
|
|
17
14
|
defaultValue: {
|
|
18
|
-
summary: `"${
|
|
15
|
+
summary: `"${CvToastNotification.props.kind.default}"`,
|
|
19
16
|
},
|
|
20
17
|
},
|
|
21
18
|
},
|
|
22
19
|
title: {
|
|
23
|
-
control:
|
|
24
|
-
|
|
20
|
+
control: 'text',
|
|
21
|
+
default: 'Notification title',
|
|
25
22
|
table: {
|
|
26
23
|
defaultValue: {
|
|
27
24
|
summary: `"${CvToastNotification.props.title.default}"`,
|
|
@@ -29,8 +26,8 @@ export default {
|
|
|
29
26
|
},
|
|
30
27
|
},
|
|
31
28
|
subTitle: {
|
|
32
|
-
control:
|
|
33
|
-
|
|
29
|
+
control: 'text',
|
|
30
|
+
default: 'Subtitle text goes here.',
|
|
34
31
|
table: {
|
|
35
32
|
defaultValue: {
|
|
36
33
|
summary: `"${CvToastNotification.props.subTitle.default}"`,
|
|
@@ -38,8 +35,8 @@ export default {
|
|
|
38
35
|
},
|
|
39
36
|
},
|
|
40
37
|
caption: {
|
|
41
|
-
control:
|
|
42
|
-
|
|
38
|
+
control: 'text',
|
|
39
|
+
default: '00:00:00 AM',
|
|
43
40
|
table: {
|
|
44
41
|
defaultValue: {
|
|
45
42
|
summary: `"${CvToastNotification.props.caption.default}"`,
|
|
@@ -47,8 +44,8 @@ export default {
|
|
|
47
44
|
},
|
|
48
45
|
},
|
|
49
46
|
closeAriaLabel: {
|
|
50
|
-
control:
|
|
51
|
-
|
|
47
|
+
control: 'text',
|
|
48
|
+
default: CvToastNotification.props.closeAriaLabel.default,
|
|
52
49
|
table: {
|
|
53
50
|
defaultValue: {
|
|
54
51
|
summary: `"${CvToastNotification.props.closeAriaLabel.default}"`,
|
|
@@ -56,7 +53,7 @@ export default {
|
|
|
56
53
|
},
|
|
57
54
|
},
|
|
58
55
|
lowContrast: {
|
|
59
|
-
control:
|
|
56
|
+
control: 'boolean',
|
|
60
57
|
},
|
|
61
58
|
// slots
|
|
62
59
|
default: {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[`cv-number-input`]: !formItem,
|
|
14
14
|
},
|
|
15
15
|
]"
|
|
16
|
-
:data-invalid="
|
|
16
|
+
:data-invalid="isInvalid || null"
|
|
17
17
|
>
|
|
18
18
|
<label
|
|
19
19
|
v-show="label || slots['label']"
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
]"
|
|
33
33
|
>
|
|
34
34
|
<input
|
|
35
|
+
:id="cvId"
|
|
35
36
|
ref="input"
|
|
36
37
|
v-model="internalValue"
|
|
37
|
-
:
|
|
38
|
-
:data-invalid="dataInvalidAttributeValue"
|
|
38
|
+
:data-invalid="isInvalid || null"
|
|
39
39
|
type="number"
|
|
40
40
|
v-bind="$attrs"
|
|
41
41
|
:disabled="disabled"
|
|
@@ -159,9 +159,6 @@ const props = defineProps({
|
|
|
159
159
|
const emit = defineEmits(['update:modelValue']);
|
|
160
160
|
const cvId = useCvId(props);
|
|
161
161
|
const { isInvalid, isWarn, isHelper, isLight } = useCvInputHelpers(props);
|
|
162
|
-
const dataInvalidAttributeValue = computed(() =>
|
|
163
|
-
isInvalid.value ? true : undefined
|
|
164
|
-
);
|
|
165
162
|
|
|
166
163
|
const iconClasses = computed(() => {
|
|
167
164
|
const classes = [];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
data-overflow-menu
|
|
4
|
-
:class="`cv-overflow-menu ${carbonPrefix}--overflow-menu`"
|
|
5
3
|
:id="uid"
|
|
6
4
|
ref="el"
|
|
5
|
+
data-overflow-menu
|
|
6
|
+
:class="`cv-overflow-menu ${carbonPrefix}--overflow-menu`"
|
|
7
7
|
>
|
|
8
8
|
<button
|
|
9
|
+
:id="`${uid}-trigger`"
|
|
10
|
+
ref="trigger"
|
|
9
11
|
:class="[
|
|
10
12
|
`${carbonPrefix}--overflow-menu__trigger ${carbonPrefix}--tooltip__trigger`,
|
|
11
13
|
`${carbonPrefix}--tooltip--a11y`,
|
|
@@ -20,15 +22,13 @@
|
|
|
20
22
|
:aria-expanded="open ? 'true' : 'false'"
|
|
21
23
|
:aria-controls="`${uid}-menu`"
|
|
22
24
|
:aria-labelledby="`${uid}`"
|
|
23
|
-
:id="`${uid}-trigger`"
|
|
24
|
-
ref="trigger"
|
|
25
25
|
@click="doToggle"
|
|
26
26
|
@keydown.space.prevent
|
|
27
27
|
@keyup.space.prevent="doToggle"
|
|
28
28
|
@keydown.enter.prevent="doToggle"
|
|
29
29
|
@keydown.tab="onOverflowMenuTab"
|
|
30
30
|
>
|
|
31
|
-
<span :class="`${carbonPrefix}--assistive-text`"
|
|
31
|
+
<span v-if="label" :class="`${carbonPrefix}--assistive-text`">{{
|
|
32
32
|
label
|
|
33
33
|
}}</span>
|
|
34
34
|
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
</button>
|
|
41
41
|
<Teleport to="body">
|
|
42
42
|
<div
|
|
43
|
+
:id="`${uid}-menu`"
|
|
44
|
+
ref="popup"
|
|
43
45
|
:class="[
|
|
44
46
|
`${carbonPrefix}--overflow-menu-options`,
|
|
45
47
|
{
|
|
@@ -48,16 +50,14 @@
|
|
|
48
50
|
},
|
|
49
51
|
]"
|
|
50
52
|
tabindex="-1"
|
|
51
|
-
ref="popup"
|
|
52
53
|
:aria-labelledby="`${uid}-trigger`"
|
|
53
|
-
:id="`${uid}-menu`"
|
|
54
54
|
:style="{ left: left + 'px', top: top + 'px' }"
|
|
55
55
|
@focusout="checkFocusOut"
|
|
56
56
|
@mousedown.prevent="preventFocusOut"
|
|
57
57
|
>
|
|
58
58
|
<div
|
|
59
|
-
class="cv-overflow-menu__before-content"
|
|
60
59
|
ref="beforeContent"
|
|
60
|
+
class="cv-overflow-menu__before-content"
|
|
61
61
|
tabindex="0"
|
|
62
62
|
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
63
63
|
@focus="focusBeforeContent"
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
<slot></slot>
|
|
67
67
|
</ul>
|
|
68
68
|
<div
|
|
69
|
-
class="cv-overflow-menu__after-content"
|
|
70
69
|
ref="afterContent"
|
|
70
|
+
class="cv-overflow-menu__after-content"
|
|
71
71
|
tabindex="0"
|
|
72
72
|
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
73
73
|
@focus="focusAfterContent"
|
|
@@ -86,7 +86,7 @@ const props = defineProps({
|
|
|
86
86
|
/**
|
|
87
87
|
* assistive text shown as a tooltip
|
|
88
88
|
*/
|
|
89
|
-
label: String,
|
|
89
|
+
label: { type: String, default: undefined },
|
|
90
90
|
/**
|
|
91
91
|
* moves caret from right to left of popup menu
|
|
92
92
|
*/
|
|
@@ -105,6 +105,7 @@ const props = defineProps({
|
|
|
105
105
|
return value && value.left !== undefined && value.top !== undefined;
|
|
106
106
|
// value.hasOwnProperty('left') && value.hasOwnProperty('top');
|
|
107
107
|
},
|
|
108
|
+
default: undefined,
|
|
108
109
|
},
|
|
109
110
|
/**
|
|
110
111
|
* top, left, right(default) or bottom
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<div :class="`cv-pagination ${carbonPrefix}--pagination`" data-pagination>
|
|
3
3
|
<div :class="`${carbonPrefix}--pagination__left`">
|
|
4
4
|
<cv-select
|
|
5
|
+
ref="pageSizeSelect"
|
|
5
6
|
:class="`${carbonPrefix}--select__item-count`"
|
|
6
7
|
:label="pageSizesLabel"
|
|
7
8
|
inline
|
|
8
|
-
ref="pageSizeSelect"
|
|
9
|
-
@change="onPageSizeChange"
|
|
10
9
|
:value="`${pageSizeValue}`"
|
|
10
|
+
@change="onPageSizeChange"
|
|
11
11
|
>
|
|
12
12
|
<cv-select-option
|
|
13
13
|
v-for="(size, index) in pageSizes"
|
|
@@ -21,23 +21,21 @@
|
|
|
21
21
|
|
|
22
22
|
<span :class="`${carbonPrefix}--pagination__text`">
|
|
23
23
|
<span data-displayed-item-range>
|
|
24
|
-
<slot name="range-text"
|
|
25
|
-
rangeText
|
|
26
|
-
}}</slot>
|
|
24
|
+
<slot name="range-text" :scope="rangeProps">{{ rangeText }}</slot>
|
|
27
25
|
</span>
|
|
28
26
|
</span>
|
|
29
27
|
</div>
|
|
30
28
|
|
|
31
29
|
<div :class="`${carbonPrefix}--pagination__right`">
|
|
32
30
|
<cv-select
|
|
31
|
+
v-if="numberOfItems !== Infinity"
|
|
32
|
+
ref="pageSelect"
|
|
33
33
|
:class="`${carbonPrefix}--select__page-number`"
|
|
34
34
|
:label="pageNumberLabel"
|
|
35
35
|
inline
|
|
36
|
-
|
|
37
|
-
ref="pageSelect"
|
|
38
|
-
@change="onPageChange"
|
|
36
|
+
hide-label
|
|
39
37
|
:value="`${pageValue}`"
|
|
40
|
-
|
|
38
|
+
@change="onPageChange"
|
|
41
39
|
>
|
|
42
40
|
<cv-select-option
|
|
43
41
|
v-for="pageNumber in pages"
|
|
@@ -48,9 +46,7 @@
|
|
|
48
46
|
>
|
|
49
47
|
</cv-select>
|
|
50
48
|
<span :class="`${carbonPrefix}--pagination__text`">
|
|
51
|
-
<slot name="of-n-pages"
|
|
52
|
-
pageOfPages
|
|
53
|
-
}}</slot>
|
|
49
|
+
<slot name="of-n-pages" :scope="ofNPagesProps">{{ pageOfPages }}</slot>
|
|
54
50
|
</span>
|
|
55
51
|
|
|
56
52
|
<button
|
|
@@ -61,8 +57,8 @@
|
|
|
61
57
|
]"
|
|
62
58
|
data-page-backward
|
|
63
59
|
:aria-label="backwardText"
|
|
64
|
-
@click="onPrevPage"
|
|
65
60
|
:disabled="noWayBack"
|
|
61
|
+
@click="onPrevPage"
|
|
66
62
|
>
|
|
67
63
|
<CaretLeft16 :class="`${carbonPrefix}--pagination__button-icon`" />
|
|
68
64
|
</button>
|
|
@@ -75,8 +71,8 @@
|
|
|
75
71
|
]"
|
|
76
72
|
data-page-forward
|
|
77
73
|
:aria-label="forwardText"
|
|
78
|
-
@click="onNextPage"
|
|
79
74
|
:disabled="noWayForward"
|
|
75
|
+
@click="onNextPage"
|
|
80
76
|
>
|
|
81
77
|
<CaretRight16 :class="`${carbonPrefix}--pagination__button-icon`" />
|
|
82
78
|
</button>
|
|
@@ -102,7 +98,7 @@ const props = defineProps({
|
|
|
102
98
|
pageSizesLabel: { type: String, default: 'Items per page:' },
|
|
103
99
|
numberOfItems: { type: Number, default: Infinity },
|
|
104
100
|
actualItemsOnPage: { type: Number, default: Infinity },
|
|
105
|
-
page: Number,
|
|
101
|
+
page: { type: Number, default: undefined },
|
|
106
102
|
pageSizes: { type: Array, default: () => [10, 20, 30, 40, 50] },
|
|
107
103
|
});
|
|
108
104
|
|
|
@@ -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>
|
|
@@ -34,7 +34,7 @@ const props = defineProps({
|
|
|
34
34
|
/**
|
|
35
35
|
* An array of labels for the steps. Use `cv-progress-step` components for more control over the step logic.
|
|
36
36
|
*/
|
|
37
|
-
steps: Array,
|
|
37
|
+
steps: { type: Array, default: () => [] },
|
|
38
38
|
/**
|
|
39
39
|
* Determines whether the ProgressIndicator should be rendered vertically.
|
|
40
40
|
*/
|
|
@@ -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>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!--suppress HtmlUnknownTag -->
|
|
2
2
|
<template>
|
|
3
3
|
<li
|
|
4
|
+
:id="uid"
|
|
4
5
|
:class="[
|
|
5
6
|
`cv-progress-step ${carbonPrefix}--progress-step`,
|
|
6
7
|
`${carbonPrefix}--progress-step--${internalState}`,
|
|
7
8
|
]"
|
|
8
|
-
:
|
|
9
|
-
:aria-disabled="disabled"
|
|
9
|
+
:aria-disabled="disabled || null"
|
|
10
10
|
>
|
|
11
11
|
<button
|
|
12
12
|
type="button"
|
|
@@ -62,12 +62,12 @@ const STEP_INCOMPLETE = 'incomplete';
|
|
|
62
62
|
const STEP_DISABLED = 'disabled';
|
|
63
63
|
|
|
64
64
|
const props = defineProps({
|
|
65
|
-
additionalInfo: String,
|
|
66
|
-
description: String,
|
|
65
|
+
additionalInfo: { type: String, default: undefined },
|
|
66
|
+
description: { type: String, default: undefined },
|
|
67
67
|
disabled: Boolean,
|
|
68
68
|
invalid: Boolean,
|
|
69
|
-
label: String,
|
|
70
|
-
tipText: String,
|
|
69
|
+
label: { type: String, default: undefined },
|
|
70
|
+
tipText: { type: String, default: undefined },
|
|
71
71
|
complete: Boolean,
|
|
72
72
|
...propsCvId,
|
|
73
73
|
});
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<input
|
|
9
9
|
v-bind="$attrs"
|
|
10
10
|
:id="cvId"
|
|
11
|
+
ref="input"
|
|
11
12
|
:checked="isChecked"
|
|
12
13
|
:class="`${carbonPrefix}--radio-button`"
|
|
13
|
-
ref="input"
|
|
14
14
|
type="radio"
|
|
15
15
|
:value="value"
|
|
16
16
|
@change="onChange"
|
|
@@ -33,9 +33,9 @@ import { carbonPrefix } from '../../global/settings';
|
|
|
33
33
|
import { useCvId, propsCvId, useMethods, useRadio } from '../../use';
|
|
34
34
|
|
|
35
35
|
const props = defineProps({
|
|
36
|
-
modelValue: String,
|
|
36
|
+
modelValue: { type: String, default: undefined },
|
|
37
37
|
checked: Boolean,
|
|
38
|
-
label: String,
|
|
38
|
+
label: { type: String, default: undefined },
|
|
39
39
|
value: { type: String, required: true },
|
|
40
40
|
hideLabel: Boolean,
|
|
41
41
|
labelLeft: Boolean,
|