@carbon/vue 3.0.9 → 3.0.10

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.
Files changed (88) hide show
  1. package/dist/carbon-vue-3.common.js +19590 -19300
  2. package/dist/carbon-vue-3.common.js.map +1 -1
  3. package/dist/carbon-vue-3.css +1 -1
  4. package/dist/carbon-vue-3.umd.js +19541 -19251
  5. package/dist/carbon-vue-3.umd.js.map +1 -1
  6. package/dist/carbon-vue-3.umd.min.js +3 -3
  7. package/dist/carbon-vue-3.umd.min.js.map +1 -1
  8. package/dist/web-types.json +5477 -0
  9. package/package.json +10 -42
  10. package/src/components/CvAccordion/CvAccordionItem.vue +1 -1
  11. package/src/components/CvButton/CvButton.stories.js +1 -1
  12. package/src/components/CvButton/CvButton.vue +2 -2
  13. package/src/components/CvButton/CvIconButton.stories.js +14 -17
  14. package/src/components/CvButton/CvIconButton.vue +8 -7
  15. package/src/components/CvCheckbox/CvCheckbox.vue +4 -3
  16. package/src/components/CvCodeSnippet/CvCodeSnippet.vue +5 -5
  17. package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +2 -2
  18. package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +6 -6
  19. package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +3 -3
  20. package/src/components/CvComboBox/CvComboBox.vue +8 -8
  21. package/src/components/CvContentSwitcher/CvContentSwitcher.vue +1 -1
  22. package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +1 -1
  23. package/src/components/CvCopyButton/CvCopyButton.vue +1 -1
  24. package/src/components/CvCopyButton/_CviCopyButton.vue +2 -2
  25. package/src/components/CvDataTable/CvDataTable.vue +29 -27
  26. package/src/components/CvDataTable/CvDataTableHeading.vue +9 -9
  27. package/src/components/CvDataTable/CvDataTableRow.vue +6 -6
  28. package/src/components/CvDataTable/CvDataTableSkeleton.vue +3 -3
  29. package/src/components/CvDataTable/_CvDataTableRowInner.vue +9 -9
  30. package/src/components/CvDatePicker/CvDatePicker.vue +10 -10
  31. package/src/components/CvDatePicker/CvDatePickerSkeleton.vue +3 -3
  32. package/src/components/CvDropdown/CvDropdown.vue +7 -9
  33. package/src/components/CvDropdown/CvDropdownItem.vue +1 -1
  34. package/src/components/CvFileUploader/CvFileUploader.vue +7 -7
  35. package/src/components/CvFileUploader/CvFileUploaderItem.vue +1 -1
  36. package/src/components/CvForm/CvFormGroup.vue +2 -2
  37. package/src/components/CvGrid/CvColumn.vue +5 -0
  38. package/src/components/CvLink/CvLink.vue +1 -1
  39. package/src/components/CvLoading/CvLoading.stories.js +1 -1
  40. package/src/components/CvLoading/CvLoading.vue +1 -1
  41. package/src/components/CvModal/CvModal.vue +19 -19
  42. package/src/components/CvMultiSelect/CvMultiSelect.vue +4 -4
  43. package/src/components/CvNotification/CvToastNotification.stories.js +12 -15
  44. package/src/components/CvNotification/CvToastNotification.vue +1 -1
  45. package/src/components/CvNumberInput/CvNumberInput.vue +3 -6
  46. package/src/components/CvOverflowMenu/CvOverflowMenu.vue +11 -10
  47. package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +1 -1
  48. package/src/components/CvPagination/CvPagination.vue +11 -15
  49. package/src/components/CvProgress/CvProgress.vue +1 -1
  50. package/src/components/CvProgress/CvProgressStep.vue +5 -5
  51. package/src/components/CvRadioButton/CvRadioButton.vue +3 -3
  52. package/src/components/CvSearch/CvSearch.vue +11 -10
  53. package/src/components/CvSelect/CvSelect.vue +1 -1
  54. package/src/components/CvSlider/CvSlider.vue +7 -7
  55. package/src/components/CvSlider/__tests__/__snapshots__/CvSlider.spec.js.snap +1 -1
  56. package/src/components/CvStructuredList/CvStructuredListItem.vue +3 -3
  57. package/src/components/CvStructuredList/CvStructuredListItemSelectable.vue +1 -1
  58. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap +3 -3
  59. package/src/components/CvSvg/__tests__/_TestIcon.vue +2 -2
  60. package/src/components/CvTabs/CvTab.vue +1 -1
  61. package/src/components/CvTabs/CvTabs.vue +12 -12
  62. package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +6 -6
  63. package/src/components/CvTag/CvTag.stories.js +1 -1
  64. package/src/components/CvTag/CvTag.vue +1 -1
  65. package/src/components/CvTextArea/CvTextArea.vue +6 -6
  66. package/src/components/CvTextInput/CvTextInput.stories.js +28 -16
  67. package/src/components/CvTextInput/CvTextInput.vue +37 -7
  68. package/src/components/CvTextInput/CvTextInputSkeleton.vue +17 -0
  69. package/src/components/CvTextInput/index.js +2 -1
  70. package/src/components/CvTile/CvTile.vue +3 -3
  71. package/src/components/CvTile/CvTileExpandable.vue +7 -7
  72. package/src/components/CvTile/CvTileSelectable.vue +2 -2
  73. package/src/components/CvTimePicker/CvTimePicker.vue +1 -1
  74. package/src/components/CvTooltip/CvDefinitionTooltip.vue +2 -2
  75. package/src/components/CvTooltip/CvInteractiveTooltip.vue +6 -6
  76. package/src/components/CvTooltip/__tests__/__snapshots__/CvTooltip.spec.js.snap +14 -14
  77. package/src/components/CvUIShell/CvHeader.vue +1 -1
  78. package/src/components/CvUIShell/CvHeaderGlobalAction.vue +7 -7
  79. package/src/components/CvUIShell/CvHeaderMenu.vue +3 -3
  80. package/src/components/CvUIShell/CvHeaderMenuButton.vue +2 -2
  81. package/src/components/CvUIShell/CvHeaderMenuItem.vue +2 -2
  82. package/src/components/CvUIShell/CvHeaderName.vue +1 -1
  83. package/src/components/CvUIShell/CvHeaderNav.vue +1 -1
  84. package/src/components/CvUIShell/CvHeaderPanel.vue +3 -2
  85. package/src/components/CvUIShell/CvSideNav.vue +5 -4
  86. package/src/components/CvUIShell/CvSideNavItems.vue +1 -1
  87. package/src/components/CvUIShell/CvSideNavLink.vue +1 -1
  88. package/src/components/CvUIShell/_CvSideNavFooter.vue +2 -1
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :style="tableStyle" class="cv-data-table" :id="uid">
2
+ <div :id="uid" :style="tableStyle" class="cv-data-table">
3
3
  <div
4
4
  :class="[
5
5
  `${carbonPrefix}--data-table-container`,
@@ -10,7 +10,7 @@
10
10
  ]"
11
11
  >
12
12
  <div v-if="hasTableHeader" :class="`${carbonPrefix}--data-table-header`">
13
- <h4 :class="`${carbonPrefix}--data-table-header__title`" v-if="title">
13
+ <h4 v-if="title" :class="`${carbonPrefix}--data-table-header__title`">
14
14
  {{ title }}
15
15
  </h4>
16
16
  <p
@@ -22,8 +22,8 @@
22
22
  </div>
23
23
  <section v-if="hasToolbar" :class="`${carbonPrefix}--table-toolbar`">
24
24
  <div
25
- :aria-hidden="!batchActive"
26
25
  v-show="hasBatchActions"
26
+ :aria-hidden="!batchActive"
27
27
  :class="[
28
28
  `${carbonPrefix}--batch-actions`,
29
29
  { [`${carbonPrefix}--batch-actions--active`]: batchActive },
@@ -44,7 +44,7 @@
44
44
  <span data-items-selected>
45
45
  <slot
46
46
  name="items-selected"
47
- v-bind:scope="{ count: dataRowsSelected.length }"
47
+ :scope="{ count: dataRowsSelected.length }"
48
48
  >{{ dataRowsSelected.length }} items selected</slot
49
49
  >
50
50
  </span>
@@ -54,6 +54,7 @@
54
54
  <div :class="`${carbonPrefix}--toolbar-content`">
55
55
  <div
56
56
  v-if="onSearch"
57
+ ref="searchContainer"
57
58
  :aria-labelledby="`${uid}-search`"
58
59
  :class="[
59
60
  `${carbonPrefix}--search `,
@@ -67,9 +68,8 @@
67
68
  },
68
69
  ]"
69
70
  role="search"
70
- ref="searchContainer"
71
71
  >
72
- <div :class="`${carbonPrefix}--search-magnifier`" ref="magnifier">
72
+ <div ref="magnifier" :class="`${carbonPrefix}--search-magnifier`">
73
73
  <Search16 :class="`${carbonPrefix}--search-magnifier-icon`" />
74
74
  </div>
75
75
  <label
@@ -79,14 +79,14 @@
79
79
  >{{ searchLabel }}</label
80
80
  >
81
81
  <input
82
+ :id="`searchbox-${uid}`"
83
+ ref="search"
84
+ v-model="searchValue"
82
85
  :class="`${carbonPrefix}--search-input`"
83
86
  type="text"
84
- :id="`searchbox-${uid}`"
85
87
  role="searchbox"
86
88
  :placeholder="searchPlaceholder"
87
89
  :aria-labelledby="`searchbox-${uid}`"
88
- ref="search"
89
- v-model="searchValue"
90
90
  @input="onInternalSearch"
91
91
  @click="checkSearchExpand(true)"
92
92
  @keydown.esc.prevent="checkSearchExpand(false)"
@@ -103,8 +103,8 @@
103
103
  ]"
104
104
  :title="searchClearLabel"
105
105
  :aria-label="searchClearLabel"
106
- @click="onClearClick"
107
106
  type="button"
107
+ @click="onClearClick"
108
108
  >
109
109
  <Close16 />
110
110
  </button>
@@ -141,11 +141,11 @@
141
141
  <button
142
142
  v-if="hasExpandAll"
143
143
  :class="`${carbonPrefix}--table-expand__button`"
144
- @click="toggleExpandAll"
145
144
  type="button"
146
145
  :aria-label="
147
146
  dataExpandAll ? collapseAllAriaLabel : expandAllAriaLabel
148
147
  "
148
+ @click="toggleExpandAll"
149
149
  >
150
150
  <ChevronRight16
151
151
  :class="`${carbonPrefix}--table-expand__svg`"
@@ -158,12 +158,12 @@
158
158
  :class="`${carbonPrefix}--table-column-checkbox`"
159
159
  >
160
160
  <cv-checkbox
161
+ v-model="headingChecked"
161
162
  :form-item="false"
162
163
  value="headingCheck"
163
- v-model="headingChecked"
164
- @change="onHeadingCheckChange"
165
164
  :label="selectAllAriaLabel"
166
- hideLabel
165
+ hide-label
166
+ @change="onHeadingCheckChange"
167
167
  />
168
168
  </th>
169
169
  <slot name="headings">
@@ -186,8 +186,8 @@
186
186
  <cv-data-table-row
187
187
  v-for="(row, rowIndex) in data"
188
188
  :key="`row:${rowIndex}`"
189
- :value="`${rowIndex}`"
190
189
  ref="dataRows"
190
+ :value="`${rowIndex}`"
191
191
  :overflow-menu="overflowMenu"
192
192
  >
193
193
  <cv-data-table-cell
@@ -212,12 +212,12 @@
212
212
  :number-of-items="internalNumberOfItems"
213
213
  @change="$emit('pagination', $event)"
214
214
  >
215
- <template v-slot:range-text="{ scope }">
216
- <slot name="range-text" v-bind:scope="scope" />
215
+ <template #range-text="{ scope }">
216
+ <slot name="range-text" :scope="scope" />
217
217
  </template>
218
218
 
219
- <template v-slot:of-n-pages="{ scope }">
220
- <slot name="of-n-pages" v-bind:scope="scope"></slot>
219
+ <template #of-n-pages="{ scope }">
220
+ <slot name="of-n-pages" :scope="scope"></slot>
221
221
  </template>
222
222
  </cv-pagination>
223
223
  </div>
@@ -316,7 +316,7 @@ const props = defineProps({
316
316
  * can be sorted
317
317
  */
318
318
  sortable: { type: Boolean, default: false },
319
- title: String,
319
+ title: { type: String, default: undefined },
320
320
  /**
321
321
  * An array containing a list of columns
322
322
  * - Columns can be string labels or objects
@@ -326,11 +326,11 @@ const props = defineProps({
326
326
  * - Optionally a dataStyle object to be applied to the data in the column.
327
327
  * - Optionally a sortable property - if any column sets this to true then only columns with sortable set to true are sortable. NOTE: table sortable property not required.
328
328
  */
329
- columns: Array,
329
+ columns: { type: Array, default: () => [] },
330
330
  /**
331
331
  * Two-dimensional array of strings.
332
332
  */
333
- data: Array,
333
+ data: { type: Array, default: () => [] },
334
334
  /**
335
335
  * the table striped
336
336
  */
@@ -351,7 +351,7 @@ const props = defineProps({
351
351
  * Use a width of 'auto' instead of 100%
352
352
  */
353
353
  staticWidth: { type: Boolean, default: false },
354
- onSearch: { type: Function },
354
+ onSearch: { type: Function, default: undefined },
355
355
  ...propsCvId,
356
356
  });
357
357
  const uid = useCvId(props, true);
@@ -554,7 +554,8 @@ const clearSearchVisible = ref(false);
554
554
  function onClearClick() {
555
555
  searchValue.value = '';
556
556
  clearSearchVisible.value = false;
557
- emit('search', searchValue.value);
557
+ // eslint-disable-next-line vue/require-explicit-emits
558
+ emit('search', searchValue.value); // see comment above in defineEmits
558
559
  nextTick(() => {
559
560
  search.value?.focus();
560
561
  });
@@ -608,22 +609,23 @@ function onMenuItemClick(val) {
608
609
  }
609
610
  function onInternalSearch() {
610
611
  clearSearchVisible.value = searchValue.value.length > 0;
612
+ // eslint-disable-next-line vue/require-explicit-emits
611
613
  emit('search', searchValue.value);
612
614
  }
613
615
  function onSort(payload) {
614
- const { heading, val } = payload;
616
+ const { heading, value } = payload;
615
617
  const headings = store.headings(uid);
616
618
  let index;
617
619
  for (let colIndex in headings) {
618
620
  const column = headings[colIndex];
619
621
  if (column.id === heading.id) {
620
- store.updateHeading(uid, { ...column, order: val });
622
+ store.updateHeading(uid, { ...column, order: value });
621
623
  index = colIndex;
622
624
  } else {
623
625
  store.updateHeading(uid, { ...column, order: 'none' });
624
626
  }
625
627
  }
626
- emit('sort', { index, order: val, name: heading.name });
628
+ emit('sort', { index, order: value, name: heading.name });
627
629
  }
628
630
 
629
631
  // are all rows expanded
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <th
3
- :aria-sort="internalOrder"
4
- :style="skeleton && headingStyle"
5
3
  :id="cvId"
6
4
  ref="el"
5
+ :aria-sort="internalOrder"
6
+ :style="skeleton && headingStyle"
7
7
  >
8
8
  <button
9
- type="button"
10
9
  v-if="sortable"
10
+ type="button"
11
11
  :class="[
12
12
  `${carbonPrefix}--table-sort`,
13
13
  {
@@ -17,8 +17,8 @@
17
17
  internalOrder === 'ascending',
18
18
  },
19
19
  ]"
20
- @click="onSortClick"
21
20
  :style="headingStyle"
21
+ @click="onSortClick"
22
22
  >
23
23
  <component
24
24
  :is="headingLabelTag"
@@ -30,8 +30,8 @@
30
30
  <Arrows16 :class="`${carbonPrefix}--table-sort__icon-unsorted`" />
31
31
  </button>
32
32
  <component
33
- v-else
34
33
  :is="headingLabelTag"
34
+ v-else
35
35
  :class="`${carbonPrefix}--table-header-label`"
36
36
  :style="headingStyle"
37
37
  >
@@ -56,13 +56,13 @@ const nextOrder = {
56
56
  none: 'ascending',
57
57
  };
58
58
  const props = defineProps({
59
- dataStyle: Object,
60
- heading: String,
61
- name: String,
59
+ dataStyle: { type: Object, default: undefined },
60
+ heading: { type: String, default: undefined },
61
+ name: { type: String, default: undefined },
62
62
  sortable: Boolean,
63
63
  order: { type: String, default: 'none' },
64
64
  skeleton: Boolean,
65
- headingStyle: Object,
65
+ headingStyle: { type: Object, default: undefined },
66
66
  ...propsCvId,
67
67
  });
68
68
  const cvId = useCvId(props, true);
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
  <tbody
3
3
  v-if="dataSomeExpandingRows"
4
- class="cv-data-table-row cv-data-table-row--expandable"
5
4
  :id="cvId"
5
+ class="cv-data-table-row cv-data-table-row--expandable"
6
6
  >
7
7
  <cv-data-table-row-inner
8
8
  ref="row"
9
- :rowId="cvId"
9
+ :row-id="cvId"
10
10
  v-bind="$attrs"
11
11
  :expanding-row="dataExpandable"
12
+ :expanded="dataExpanded"
12
13
  @expanded-change="onExpandedChange"
13
14
  @checked-change="onCheckedChange"
14
- :expanded="dataExpanded"
15
15
  >
16
16
  <slot />
17
17
  </cv-data-table-row-inner>
@@ -29,11 +29,11 @@
29
29
  </tbody>
30
30
  <cv-data-table-row-inner
31
31
  v-else
32
- ref="row"
33
32
  v-bind="$attrs"
34
- class="cv-data-table-row"
35
33
  :id="cvId"
36
- :rowId="cvId"
34
+ ref="row"
35
+ class="cv-data-table-row"
36
+ :row-id="cvId"
37
37
  @checked-change="onCheckedChange"
38
38
  >
39
39
  <slot />
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <cv-data-table skeleton :data="data" :columns="cols" v-bind="$attrs">
3
- <template v-if="hasHelperText" v-slot:helper-text>
3
+ <template v-if="hasHelperText" #helper-text>
4
4
  <slot name="helper-text" />
5
5
  </template>
6
6
 
7
- <template v-if="hasBatchActions" v-slot:batch-actions>
7
+ <template v-if="hasBatchActions" #batch-actions>
8
8
  <slot name="batch-actions" />
9
9
  </template>
10
10
 
11
- <template v-if="hasActions" v-slot:actions>
11
+ <template v-if="hasActions" #actions>
12
12
  <slot name="actions" />
13
13
  </template>
14
14
  </cv-data-table>
@@ -15,9 +15,9 @@
15
15
  <button
16
16
  v-if="expandingRow"
17
17
  :class="`${carbonPrefix}--table-expand__button`"
18
- @click="toggleExpand"
19
18
  type="button"
20
19
  :aria-label="dataExpanded ? ariaLabelCollapseRow : ariaLabelExpandRow"
20
+ @click="toggleExpand"
21
21
  >
22
22
  <ChevronRight16 :class="`${carbonPrefix}--table-expand__svg`" />
23
23
  </button>
@@ -28,16 +28,16 @@
28
28
  :class="`${carbonPrefix}--table-column-checkbox`"
29
29
  >
30
30
  <cv-checkbox
31
+ ref="rowChecked"
32
+ v-model="dataChecked"
31
33
  :form-item="false"
32
34
  :value="value"
33
35
  :inline="true"
34
- v-model="dataChecked"
35
- @change="onChange"
36
- ref="rowChecked"
37
36
  :label="
38
37
  ariaLabelForBatchCheckbox || `Select row ${value} for batch action`
39
38
  "
40
- hideLabel
39
+ hide-label
40
+ @change="onChange"
41
41
  />
42
42
  </td>
43
43
  <slot />
@@ -71,15 +71,15 @@ import store from './cvDataTableStore';
71
71
  import { getBus } from '../../global/component-utils/event-bus';
72
72
 
73
73
  const props = defineProps({
74
- ariaLabelForBatchCheckbox: String,
74
+ ariaLabelForBatchCheckbox: { type: String, default: undefined },
75
75
  checked: Boolean,
76
76
  expanded: Boolean,
77
77
  expandingRow: Boolean,
78
78
  ariaLabelExpandRow: { type: String, default: 'Expand current row' },
79
79
  ariaLabelCollapseRow: { type: String, default: 'Collapse current row' },
80
- overflowMenu: Array,
81
- value: String,
82
- rowId: String,
80
+ overflowMenu: { type: Array, default: () => [] },
81
+ value: { type: String, default: undefined },
82
+ rowId: { type: String, default: undefined },
83
83
  });
84
84
 
85
85
  const dataSomeExpandingRows = computed(() => {
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <cv-wrapper
3
+ :id="cvId"
3
4
  :tag-type="formItem ? 'div' : ''"
4
5
  :class="`cv-date-picker ${carbonPrefix}--form-item`"
5
- :id="cvId"
6
6
  >
7
7
  <div
8
+ :id="formItem ? undefined : cvId"
9
+ ref="dateWrapper"
8
10
  :data-date-picker="['single', 'range'].includes(getKind)"
9
11
  :data-date-picker-type="getKind"
10
12
  :class="[
@@ -15,8 +17,6 @@
15
17
  'cv-date-picker': !formItem,
16
18
  },
17
19
  ]"
18
- ref="dateWrapper"
19
- :id="formItem ? undefined : cvId"
20
20
  >
21
21
  <div
22
22
  :class="{
@@ -36,6 +36,7 @@
36
36
  </label>
37
37
  <div :class="`${carbonPrefix}--date-picker-input__wrapper`">
38
38
  <input
39
+ :id="`${cvId}-input-1`"
39
40
  ref="date"
40
41
  type="text"
41
42
  data-date-picker-input
@@ -43,7 +44,6 @@
43
44
  :data-invalid="isInvalid || null"
44
45
  :disabled="disabled"
45
46
  :data-date-picker-input-from="getKind === 'range'"
46
- :id="`${cvId}-input-1`"
47
47
  :class="`${carbonPrefix}--date-picker__input`"
48
48
  :pattern="pattern"
49
49
  :placeholder="placeholder"
@@ -57,7 +57,7 @@
57
57
  />
58
58
  </div>
59
59
 
60
- <div :class="`${carbonPrefix}--form-requirement`" v-if="isInvalid">
60
+ <div v-if="isInvalid" :class="`${carbonPrefix}--form-requirement`">
61
61
  <slot name="invalid-message">{{ invalidMessage }}</slot>
62
62
  </div>
63
63
  </div>
@@ -82,6 +82,7 @@
82
82
  @click="calendar.open()"
83
83
  >
84
84
  <input
85
+ :id="`${cvId}-input-2`"
85
86
  ref="todate"
86
87
  type="text"
87
88
  data-date-picker-input
@@ -89,7 +90,6 @@
89
90
  :data-date-picker-input-to="kind === 'range'"
90
91
  :data-invalid="isInvalid || null"
91
92
  :disabled="disabled"
92
- :id="`${cvId}-input-2`"
93
93
  :class="`${carbonPrefix}--date-picker__input`"
94
94
  :pattern="pattern"
95
95
  :placeholder="placeholder"
@@ -100,7 +100,7 @@
100
100
  data-date-picker-icon
101
101
  />
102
102
  </div>
103
- <div :class="`${carbonPrefix}--form-requirement`" v-if="isInvalid">
103
+ <div v-if="isInvalid" :class="`${carbonPrefix}--form-requirement`">
104
104
  <span id="invalid-message-placeholder"></span>
105
105
  </div>
106
106
  </div>
@@ -142,12 +142,12 @@ const isLight = useIsLight(props);
142
142
  let calendar;
143
143
 
144
144
  const props = defineProps({
145
- modelValue: [String, Object, Array, Date],
145
+ modelValue: { type: [String, Object, Array, Date], default: undefined },
146
146
  dateLabel: { type: String, default: undefined },
147
147
  dateEndLabel: { type: String, default: 'End date' },
148
148
  invalid: { type: Boolean, default: false },
149
149
  disabled: { type: Boolean, default: false },
150
- invalidMessage: { type: String },
150
+ invalidMessage: { type: String, default: undefined },
151
151
  pattern: { type: String, default: '\\d{1,2}/\\d{1,2}/\\d{4}' },
152
152
  placeholder: { type: String, default: 'mm/dd/yyyy' },
153
153
  calOptions: {
@@ -164,7 +164,7 @@ const props = defineProps({
164
164
  default: 'simple',
165
165
  validator: val => ['short', 'simple', 'single', 'range'].includes(val),
166
166
  },
167
- value: [String, Object, Array, Date],
167
+ value: { type: [String, Object, Array, Date], default: undefined },
168
168
  ...propsCvId,
169
169
  ...propsCvTheme,
170
170
  });
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <cv-wrapper
3
+ :id="cvId"
3
4
  :tag-type="formItem ? 'div' : ''"
4
5
  :class="`cv-date-picker ${carbonPrefix}--form-item`"
5
- :id="cvId"
6
6
  >
7
7
  <div
8
+ :id="formItem ? undefined : cvId"
9
+ ref="dateWrapper"
8
10
  :data-date-picker="['single', 'range'].includes(getKind)"
9
11
  :data-date-picker-type="getKind"
10
12
  :class="[
@@ -14,8 +16,6 @@
14
16
  'cv-date-picker': !formItem,
15
17
  },
16
18
  ]"
17
- ref="dateWrapper"
18
- :id="formItem ? undefined : cvId"
19
19
  >
20
20
  <div
21
21
  class="inputWrapper"
@@ -59,7 +59,7 @@
59
59
  [`${carbonPrefix}--dropdown--inline`]: inline,
60
60
  },
61
61
  ]"
62
- :data-invalid="data.isInvalid"
62
+ :data-invalid="data.isInvalid || null"
63
63
  :data-value="dataValue"
64
64
  data-dropdown
65
65
  v-bind="$attrs"
@@ -115,12 +115,9 @@
115
115
  tabindex="-1"
116
116
  >
117
117
  <slot>
118
- <cv-dropdown-item
119
- v-for="item in items"
120
- v-bind:key="item"
121
- :value="item"
122
- >{{ item }}</cv-dropdown-item
123
- >
118
+ <cv-dropdown-item v-for="item in items" :key="item" :value="item">{{
119
+ item
120
+ }}</cv-dropdown-item>
124
121
  </slot>
125
122
  </ul>
126
123
  </div>
@@ -205,11 +202,12 @@ const props = defineProps({
205
202
  }
206
203
  return arr;
207
204
  },
205
+ default: () => [],
208
206
  },
209
207
  /**
210
208
  * Generic label that will be used as the textual representation of what this field is for
211
209
  */
212
- label: String,
210
+ label: { type: String, default: undefined },
213
211
  /**
214
212
  * Value shown when nothing has been selected
215
213
  */
@@ -233,7 +231,7 @@ const props = defineProps({
233
231
  /**
234
232
  * Render with a value already selected. Available as `v-model:value`.
235
233
  */
236
- value: String,
234
+ value: { type: String, default: undefined },
237
235
  /**
238
236
  * Provide the text that is displayed and put the control in warning state
239
237
  */
@@ -20,10 +20,10 @@
20
20
  role="menuitem"
21
21
  >
22
22
  <a
23
+ ref="link"
23
24
  :aria-checked="dataSelected"
24
25
  :class="`${carbonPrefix}--dropdown-link`"
25
26
  href="javascript:void(0)"
26
- ref="link"
27
27
  role="menuitemradio"
28
28
  tabindex="-1"
29
29
  >
@@ -89,7 +89,7 @@
89
89
  :key="item.file.name"
90
90
  :item="item"
91
91
  :removable="removable"
92
- :removeAriaLabel="removeAriaLabel"
92
+ :remove-aria-label="removeAriaLabel"
93
93
  @remove="onItemRemove(index)"
94
94
  />
95
95
  </div>
@@ -111,7 +111,7 @@ import {
111
111
  const emit = defineEmits(['update:modelValue']);
112
112
 
113
113
  const props = defineProps({
114
- accept: String,
114
+ accept: { type: String, default: undefined },
115
115
  buttonKind: commonCvButtonProps.kind,
116
116
  buttonLabel: {
117
117
  type: String,
@@ -129,8 +129,8 @@ const props = defineProps({
129
129
  buttonSize: commonCvButtonProps.size,
130
130
  clearOnReselect: Boolean,
131
131
  disabled: Boolean,
132
- dropTargetLabel: String,
133
- helperText: String,
132
+ dropTargetLabel: { type: String, default: undefined },
133
+ helperText: { type: String, default: undefined },
134
134
  initialStateUploading: Boolean,
135
135
  kind: {
136
136
  type: String,
@@ -145,10 +145,10 @@ const props = defineProps({
145
145
  return true;
146
146
  },
147
147
  },
148
- label: String,
149
- modelValue: Array,
148
+ label: { type: String, default: undefined },
149
+ modelValue: { type: Array, default: () => [] },
150
150
  removable: Boolean,
151
- removeAriaLabel: String,
151
+ removeAriaLabel: { type: String, default: undefined },
152
152
  ...cvIdProps,
153
153
  });
154
154
 
@@ -80,7 +80,7 @@ import Close16 from '@carbon/icons-vue/es/close/16';
80
80
  const emit = defineEmits(['remove']);
81
81
 
82
82
  const props = defineProps({
83
- item: Object,
83
+ item: { type: Object, default: () => Object() },
84
84
  removable: Boolean,
85
85
  removeAriaLabel: { type: String, default: 'Remove selected file' },
86
86
  });
@@ -4,7 +4,7 @@
4
4
  `cv-form-group ${carbonPrefix}--fieldset`,
5
5
  { [`${carbonPrefix}--fieldset--no-margin`]: noMargin },
6
6
  ]"
7
- :data-invalid="invalid"
7
+ :data-invalid="invalid || null"
8
8
  >
9
9
  <legend :class="`${carbonPrefix}--label`">
10
10
  <slot name="label"></slot>
@@ -21,7 +21,7 @@ import { carbonPrefix } from '../../global/settings';
21
21
 
22
22
  defineProps({
23
23
  invalid: Boolean,
24
- message: String,
24
+ message: { type: String, default: undefined },
25
25
  noMargin: Boolean,
26
26
  });
27
27
  </script>
@@ -13,22 +13,27 @@ const props = defineProps({
13
13
  sm: {
14
14
  type: [Boolean, Number, Object],
15
15
  validator: value => columnValidator('sm', value),
16
+ default: false,
16
17
  },
17
18
  md: {
18
19
  type: [Boolean, Number, Object],
19
20
  validator: value => columnValidator('md', value),
21
+ default: false,
20
22
  },
21
23
  lg: {
22
24
  type: [Boolean, Number, Object],
23
25
  validator: value => columnValidator('lg', value),
26
+ default: false,
24
27
  },
25
28
  xlg: {
26
29
  type: [Boolean, Number, Object],
27
30
  validator: value => columnValidator('xlg', value),
31
+ default: false,
28
32
  },
29
33
  max: {
30
34
  type: [Boolean, Number, Object],
31
35
  validator: value => columnValidator('max', value),
36
+ default: false,
32
37
  },
33
38
  });
34
39
  const classes = computed(() => {
@@ -28,7 +28,7 @@ import {
28
28
  } from '../../use/cvLink';
29
29
 
30
30
  const props = defineProps({
31
- icon: { type: [String, Object] },
31
+ icon: { type: [String, Object], default: undefined },
32
32
  inline: Boolean,
33
33
  visited: Boolean,
34
34
  ...linkPropsDefinition,
@@ -26,7 +26,7 @@ export default {
26
26
  const template = `<div>
27
27
  <div class="loading-story">
28
28
  <cv-loading @loading-end="onLoadingEnd" v-bind="args" :active="isActive"/>
29
- </divclass>
29
+ </div>
30
30
  <button @click="makeActive" :disabled="isActive" style="margin-top: 2rem;">{{buttonLabel}}</button>
31
31
  </div>`;
32
32
  let hidden = ref(true);
@@ -6,6 +6,7 @@
6
6
  >
7
7
  <div
8
8
  v-bind="$attrs"
9
+ ref="loading"
9
10
  data-loading
10
11
  :class="{
11
12
  'cv-loading': !overlay,
@@ -13,7 +14,6 @@
13
14
  [`${carbonPrefix}--loading--stop`]: (!active && stopping) || stopped,
14
15
  [`${carbonPrefix}--loading--small`]: small,
15
16
  }"
16
- ref="loading"
17
17
  aria-atomic="true"
18
18
  :aria-labelledby="cvId"
19
19
  aria-live="assertive"