@carbon/vue 3.0.9-alpha.0 → 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 (94) hide show
  1. package/README.md +60 -21
  2. package/dist/carbon-vue-3.common.js +19707 -19319
  3. package/dist/carbon-vue-3.common.js.map +1 -1
  4. package/dist/carbon-vue-3.css +1 -1
  5. package/dist/carbon-vue-3.umd.js +19658 -19270
  6. package/dist/carbon-vue-3.umd.js.map +1 -1
  7. package/dist/carbon-vue-3.umd.min.js +4 -4
  8. package/dist/carbon-vue-3.umd.min.js.map +1 -1
  9. package/dist/web-types.json +5477 -0
  10. package/package.json +10 -42
  11. package/src/components/CvAccordion/CvAccordionItem.vue +1 -1
  12. package/src/components/CvButton/CvButton.stories.js +1 -1
  13. package/src/components/CvButton/CvButton.vue +2 -2
  14. package/src/components/CvButton/CvIconButton.stories.js +14 -17
  15. package/src/components/CvButton/CvIconButton.vue +8 -7
  16. package/src/components/CvCheckbox/CvCheckbox.vue +4 -3
  17. package/src/components/CvCodeSnippet/CvCodeSnippet.vue +5 -5
  18. package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +2 -2
  19. package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +6 -6
  20. package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +3 -3
  21. package/src/components/CvComboBox/CvComboBox.vue +8 -8
  22. package/src/components/CvContentSwitcher/CvContentSwitcher.vue +1 -1
  23. package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +1 -1
  24. package/src/components/CvCopyButton/CvCopyButton.vue +1 -1
  25. package/src/components/CvCopyButton/_CviCopyButton.vue +2 -2
  26. package/src/components/CvDataTable/CvDataTable.vue +29 -27
  27. package/src/components/CvDataTable/CvDataTableHeading.vue +9 -9
  28. package/src/components/CvDataTable/CvDataTableRow.vue +6 -6
  29. package/src/components/CvDataTable/CvDataTableSkeleton.vue +3 -3
  30. package/src/components/CvDataTable/_CvDataTableRowInner.vue +9 -9
  31. package/src/components/CvDatePicker/CvDatePicker.vue +10 -10
  32. package/src/components/CvDatePicker/CvDatePickerSkeleton.vue +3 -3
  33. package/src/components/CvDropdown/CvDropdown.vue +7 -9
  34. package/src/components/CvDropdown/CvDropdownItem.vue +1 -1
  35. package/src/components/CvFileUploader/CvFileUploader.stories.mdx +24 -6
  36. package/src/components/CvFileUploader/CvFileUploader.vue +65 -26
  37. package/src/components/CvFileUploader/CvFileUploaderItem.vue +1 -1
  38. package/src/components/CvForm/CvFormGroup.vue +2 -2
  39. package/src/components/CvGrid/CvColumn.vue +5 -0
  40. package/src/components/CvLink/CvLink.vue +1 -1
  41. package/src/components/CvLoading/CvLoading.stories.js +1 -1
  42. package/src/components/CvLoading/CvLoading.vue +1 -1
  43. package/src/components/CvModal/CvModal.vue +19 -19
  44. package/src/components/CvMultiSelect/CvMultiSelect.vue +4 -4
  45. package/src/components/CvNotification/CvToastNotification.stories.js +12 -15
  46. package/src/components/CvNotification/CvToastNotification.vue +1 -1
  47. package/src/components/CvNumberInput/CvNumberInput.vue +3 -6
  48. package/src/components/CvOverflowMenu/CvOverflowMenu.vue +11 -10
  49. package/src/components/CvOverflowMenu/CvOverflowMenuItem.vue +1 -1
  50. package/src/components/CvPagination/CvPagination.vue +11 -15
  51. package/src/components/CvProgress/CvProgress.vue +1 -1
  52. package/src/components/CvProgress/CvProgressStep.vue +5 -5
  53. package/src/components/CvRadioButton/CvRadioButton.vue +3 -3
  54. package/src/components/CvSearch/CvSearch.vue +11 -10
  55. package/src/components/CvSelect/CvSelect.vue +1 -1
  56. package/src/components/CvSlider/CvSlider.vue +7 -7
  57. package/src/components/CvSlider/__tests__/__snapshots__/CvSlider.spec.js.snap +1 -1
  58. package/src/components/CvStructuredList/CvStructuredListItem.vue +3 -3
  59. package/src/components/CvStructuredList/CvStructuredListItemSelectable.vue +1 -1
  60. package/src/components/CvStructuredList/__tests__/__snapshots__/CvStructuredListItem.spec.js.snap +3 -3
  61. package/src/components/CvSvg/__tests__/_TestIcon.vue +2 -2
  62. package/src/components/CvTabs/CvTab.vue +1 -1
  63. package/src/components/CvTabs/CvTabs.stories.mdx +84 -3
  64. package/src/components/CvTabs/CvTabs.vue +15 -13
  65. package/src/components/CvTabs/__tests__/__snapshots__/CvTabs.spec.js.snap +24 -0
  66. package/src/components/CvTag/CvTag.stories.js +3 -2
  67. package/src/components/CvTag/CvTag.vue +11 -6
  68. package/src/components/CvTag/CvTagSkeleton.stories.js +39 -0
  69. package/src/components/CvTag/CvTagSkeleton.vue +20 -0
  70. package/src/components/CvTag/index.js +2 -1
  71. package/src/components/CvTextArea/CvTextArea.vue +6 -6
  72. package/src/components/CvTextInput/CvTextInput.stories.js +28 -16
  73. package/src/components/CvTextInput/CvTextInput.vue +37 -7
  74. package/src/components/CvTextInput/CvTextInputSkeleton.vue +17 -0
  75. package/src/components/CvTextInput/index.js +2 -1
  76. package/src/components/CvTile/CvTile.vue +3 -3
  77. package/src/components/CvTile/CvTileExpandable.vue +7 -7
  78. package/src/components/CvTile/CvTileSelectable.vue +2 -2
  79. package/src/components/CvTimePicker/CvTimePicker.vue +1 -1
  80. package/src/components/CvTooltip/CvDefinitionTooltip.vue +2 -2
  81. package/src/components/CvTooltip/CvInteractiveTooltip.vue +6 -6
  82. package/src/components/CvTooltip/__tests__/__snapshots__/CvTooltip.spec.js.snap +14 -14
  83. package/src/components/CvUIShell/CvHeader.vue +1 -1
  84. package/src/components/CvUIShell/CvHeaderGlobalAction.vue +7 -7
  85. package/src/components/CvUIShell/CvHeaderMenu.vue +3 -3
  86. package/src/components/CvUIShell/CvHeaderMenuButton.vue +2 -2
  87. package/src/components/CvUIShell/CvHeaderMenuItem.vue +2 -2
  88. package/src/components/CvUIShell/CvHeaderName.vue +1 -1
  89. package/src/components/CvUIShell/CvHeaderNav.vue +1 -1
  90. package/src/components/CvUIShell/CvHeaderPanel.vue +3 -2
  91. package/src/components/CvUIShell/CvSideNav.vue +5 -4
  92. package/src/components/CvUIShell/CvSideNavItems.vue +1 -1
  93. package/src/components/CvUIShell/CvSideNavLink.vue +1 -1
  94. package/src/components/CvUIShell/_CvSideNavFooter.vue +2 -1
@@ -1,11 +1,28 @@
1
1
  <template>
2
2
  <cv-form-item class="cv-file-uploader">
3
- <p :class="`${carbonPrefix}--file--label`">{{ label }}</p>
4
- <p :class="`${carbonPrefix}--label-description`">{{ helperText }}</p>
3
+ <p
4
+ :class="[
5
+ `${carbonPrefix}--file--label`,
6
+ { [`${carbonPrefix}--file--label--disabled`]: disabled },
7
+ ]"
8
+ >
9
+ {{ label }}
10
+ </p>
11
+ <p
12
+ :class="[
13
+ `${carbonPrefix}--label-description`,
14
+ { [`${carbonPrefix}--label-description--disabled`]: disabled },
15
+ ]"
16
+ >
17
+ {{ helperText }}
18
+ </p>
5
19
  <div v-if="kind === 'button'" :class="`${carbonPrefix}--file`" data-file>
6
20
  <label
7
21
  :for="cvId"
8
- :class="buttonClasses"
22
+ :class="[
23
+ buttonClasses,
24
+ { [`${carbonPrefix}--btn--disabled`]: disabled },
25
+ ]"
9
26
  tabindex="0"
10
27
  @keydown.enter.prevent="onKeyHit"
11
28
  @keydown.space.prevent="onKeyHit"
@@ -17,6 +34,7 @@
17
34
  ref="fileInput"
18
35
  :class="`${carbonPrefix}--file-input`"
19
36
  :accept="accept"
37
+ :disabled="disabled"
20
38
  type="file"
21
39
  v-bind="$attrs"
22
40
  data-file-uploader
@@ -34,8 +52,10 @@
34
52
  `${carbonPrefix}--file-browse-btn`,
35
53
  `${carbonPrefix}--file__drop-container`,
36
54
  {
37
- [`${carbonPrefix}--file__drop-container--drag-over`]: allowDrop,
55
+ [`${carbonPrefix}--file__drop-container--drag-over`]:
56
+ allowDrop && !disabled,
38
57
  },
58
+ { [`${carbonPrefix}--file-browse-btn--disabled`]: disabled },
39
59
  ]"
40
60
  @dragover="onDragEvent"
41
61
  @dragleave="onDragEvent"
@@ -50,6 +70,7 @@
50
70
  ref="fileInput"
51
71
  :class="`${carbonPrefix}--file-input`"
52
72
  :accept="accept"
73
+ :disabled="disabled"
53
74
  type="file"
54
75
  v-bind="$attrs"
55
76
  tabindex="-1"
@@ -68,7 +89,7 @@
68
89
  :key="item.file.name"
69
90
  :item="item"
70
91
  :removable="removable"
71
- :removeAriaLabel="removeAriaLabel"
92
+ :remove-aria-label="removeAriaLabel"
72
93
  @remove="onItemRemove(index)"
73
94
  />
74
95
  </div>
@@ -90,7 +111,7 @@ import {
90
111
  const emit = defineEmits(['update:modelValue']);
91
112
 
92
113
  const props = defineProps({
93
- accept: String,
114
+ accept: { type: String, default: undefined },
94
115
  buttonKind: commonCvButtonProps.kind,
95
116
  buttonLabel: {
96
117
  type: String,
@@ -107,8 +128,10 @@ const props = defineProps({
107
128
  },
108
129
  buttonSize: commonCvButtonProps.size,
109
130
  clearOnReselect: Boolean,
110
- dropTargetLabel: String,
111
- helperText: String,
131
+ disabled: Boolean,
132
+ dropTargetLabel: { type: String, default: undefined },
133
+ helperText: { type: String, default: undefined },
134
+ initialStateUploading: Boolean,
112
135
  kind: {
113
136
  type: String,
114
137
  default: KINDS.DRAG_TARGET,
@@ -122,10 +145,10 @@ const props = defineProps({
122
145
  return true;
123
146
  },
124
147
  },
125
- label: String,
126
- modelValue: Array,
148
+ label: { type: String, default: undefined },
149
+ modelValue: { type: Array, default: () => [] },
127
150
  removable: Boolean,
128
- removeAriaLabel: String,
151
+ removeAriaLabel: { type: String, default: undefined },
129
152
  ...cvIdProps,
130
153
  });
131
154
 
@@ -178,7 +201,7 @@ function addFiles(files) {
178
201
  const newFile = createInternalFile(internalFile?.file || file);
179
202
 
180
203
  if (internalFile) {
181
- internalFile.state = newFile.initialState;
204
+ internalFile.state = newFile.state;
182
205
  internalFile.invalidMessageTitle = newFile.invalidMessageTitle;
183
206
  internalFile.invalidMessage = newFile.invalidMessage;
184
207
  } else {
@@ -216,6 +239,11 @@ function onChange(ev) {
216
239
  }
217
240
 
218
241
  function onDragEvent(evt) {
242
+ if (props.disabled) {
243
+ evt.preventDefault();
244
+ return;
245
+ }
246
+
219
247
  if (Array.prototype.indexOf.call(evt.dataTransfer.types, 'Files') === -1) {
220
248
  return;
221
249
  }
@@ -249,7 +277,7 @@ function onDragEvent(evt) {
249
277
 
250
278
  function onItemRemove(index) {
251
279
  internalFiles.value.splice(index, 1);
252
- emit('update:modelValue', this.internalFiles);
280
+ emit('update:modelValue', internalFiles.value);
253
281
  }
254
282
 
255
283
  function onKeyHit() {
@@ -262,20 +290,31 @@ onMounted(() => {
262
290
  });
263
291
 
264
292
  // exposed methods
293
+ function clear() {
294
+ internalFiles.value = [];
295
+ emit('update:modelValue', internalFiles.value);
296
+ }
297
+
298
+ function remove(index) {
299
+ onItemRemove(index);
300
+ }
301
+
302
+ function setInvalidMessage(index, message) {
303
+ internalFiles.value[index].invalidMessage = message;
304
+ }
305
+
306
+ function setState(index, state) {
307
+ if ([STATES.COMPLETE, STATES.UPLOADING, STATES.NONE].includes(state)) {
308
+ internalFiles.value[index].state = state;
309
+ }
310
+ }
311
+
312
+ // exposing methods
265
313
  defineExpose({
266
- setState(index, state) {
267
- if ([STATES.COMPLETE, STATES.UPLOADING, STATES.NONE].includes(state)) {
268
- internalFiles.value[index].state = state;
269
- }
270
- },
271
- clear() {
272
- internalFiles.value = [];
273
- emit('update:modelValue', internalFiles);
274
- },
275
- setInvalidMessage(index, message) {
276
- internalFiles.value[index].invalidMessage = message;
277
- },
278
- remove: onItemRemove,
314
+ clear,
315
+ remove,
316
+ setInvalidMessage,
317
+ setState,
279
318
  });
280
319
  </script>
281
320
 
@@ -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"
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <Teleport to="body" :disabled="disableTeleport">
3
3
  <div
4
+ :id="uid"
4
5
  ref="el"
5
6
  data-modal
6
- :id="uid"
7
7
  :class="[
8
8
  `cv-modal ${carbonPrefix}--modal`,
9
9
  {
@@ -12,24 +12,24 @@
12
12
  },
13
13
  ]"
14
14
  tabindex="-1"
15
+ v-bind="$attrs"
15
16
  @keydown.esc.prevent="onEsc"
16
17
  @click.self="onExternalClick"
17
- v-bind="$attrs"
18
18
  >
19
19
  <div
20
+ v-bind="dialogAttrs"
21
+ ref="modalDialog"
20
22
  :class="[
21
23
  `${carbonPrefix}--modal-container`,
22
24
  {
23
25
  [`${carbonPrefix}--modal-container--${internalSize}`]: internalSize,
24
26
  },
25
27
  ]"
26
- v-bind="dialogAttrs"
27
28
  :aria-label="ariaLabel"
28
- ref="modalDialog"
29
29
  >
30
30
  <div
31
- class="cv-modal__before-content"
32
31
  ref="beforeContent"
32
+ class="cv-modal__before-content"
33
33
  tabindex="0"
34
34
  style="position: absolute; height: 1px; width: 1px; left: -9999px"
35
35
  role="separator"
@@ -44,28 +44,29 @@
44
44
  <slot name="title">Modal Title</slot>
45
45
  </p>
46
46
  <button
47
+ ref="closeBtn"
47
48
  :class="`${carbonPrefix}--modal-close`"
48
49
  type="button"
49
- @click="onClose"
50
- ref="closeBtn"
51
50
  :aria-label="closeAriaLabel"
51
+ @click="onClose"
52
52
  >
53
53
  <Close16 :class="`${carbonPrefix}--modal-close__icon`" />
54
54
  </button>
55
55
  </div>
56
56
 
57
57
  <div
58
+ ref="content"
58
59
  :class="[
59
60
  `${carbonPrefix}--modal-content`,
60
61
  { [`${carbonPrefix}--modal-content--with-form`]: hasFormContent },
61
62
  ]"
62
- ref="content"
63
63
  :tabindex="data.scrollable ? 0 : undefined"
64
64
  >
65
65
  <slot name="content"></slot>
66
66
  </div>
67
67
 
68
68
  <cv-button-set
69
+ v-if="data.hasFooter"
69
70
  :class="[
70
71
  `${carbonPrefix}--modal-footer`,
71
72
  {
@@ -73,40 +74,39 @@
73
74
  data.hasPrimary && data.hasSecondary && data.hasOtherBtn,
74
75
  },
75
76
  ]"
76
- v-if="data.hasFooter"
77
77
  >
78
78
  <cv-button
79
+ v-if="data.hasOtherBtn"
80
+ ref="otherBtn"
79
81
  type="button"
80
82
  kind="secondary"
81
83
  @click="onOtherBtnClick"
82
- v-if="data.hasOtherBtn"
83
- ref="otherBtn"
84
84
  >
85
85
  <slot name="other-button">Other button</slot>
86
86
  </cv-button>
87
87
  <cv-button
88
+ v-if="data.hasSecondary"
89
+ ref="secondaryBtn"
88
90
  type="button"
89
91
  kind="secondary"
90
92
  @click="onSecondaryClick"
91
- v-if="data.hasSecondary"
92
- ref="secondaryBtn"
93
93
  >
94
94
  <slot name="secondary-button">Secondary button</slot>
95
95
  </cv-button>
96
96
  <cv-button
97
+ v-if="data.hasPrimary"
98
+ ref="primary"
97
99
  :disabled="primaryButtonDisabled"
98
100
  type="button"
99
101
  :kind="primaryKind"
100
102
  @click="onPrimaryClick"
101
- v-if="data.hasPrimary"
102
- ref="primary"
103
103
  >
104
104
  <slot name="primary-button">Primary button</slot>
105
105
  </cv-button>
106
106
  </cv-button-set>
107
107
  <div
108
- class="cv-modal__after-content"
109
108
  ref="afterContent"
109
+ class="cv-modal__after-content"
110
110
  tabindex="0"
111
111
  style="position: absolute; height: 1px; width: 1px; left: -9999px"
112
112
  role="separator"
@@ -201,9 +201,9 @@ const props = defineProps({
201
201
  disableTeleport: { type: Boolean, default: false },
202
202
 
203
203
  // Listeners
204
- onPrimaryClick: { type: Function },
205
- onSecondaryClick: { type: Function },
206
- onOtherBtnClick: { type: Function },
204
+ onPrimaryClick: { type: Function, default: undefined },
205
+ onSecondaryClick: { type: Function, default: undefined },
206
+ onOtherBtnClick: { type: Function, default: undefined },
207
207
 
208
208
  ...propsCvId,
209
209
  });
@@ -45,7 +45,7 @@
45
45
  [`${carbonPrefix}--combo-box`]: isFilterable,
46
46
  },
47
47
  ]"
48
- :data-invalid="data.isInvalid ? true : undefined"
48
+ :data-invalid="data.isInvalid || null"
49
49
  v-bind="$attrs"
50
50
  @keydown.down.prevent="onDown"
51
51
  @keydown.up.prevent="onUp"
@@ -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,7 +341,7 @@ 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,
344
+ title: { type: String, default: undefined },
345
345
  /***
346
346
  * Allow users to pass in arbitrary items from their collection that are pre-selected
347
347
  */
@@ -8,20 +8,17 @@ export default {
8
8
  component: CvToastNotification,
9
9
  argTypes: {
10
10
  kind: {
11
- control: {
12
- type: 'select',
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: `"${CvNotificationConsts.notificationKinds[0]}"`,
15
+ summary: `"${CvToastNotification.props.kind.default}"`,
19
16
  },
20
17
  },
21
18
  },
22
19
  title: {
23
- control: { type: 'text' },
24
- defaultValue: 'Notification title',
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: { type: 'text' },
33
- defaultValue: 'Subtitle text goes here.',
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: { type: 'text' },
42
- defaultValue: '00:00:00 AM',
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: { type: 'text' },
51
- defaultValue: CvToastNotification.props.closeAriaLabel.default,
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: { type: 'boolean' },
56
+ control: 'boolean',
60
57
  },
61
58
  // slots
62
59
  default: {
@@ -56,7 +56,7 @@ export default {
56
56
  type: String,
57
57
  default: '',
58
58
  },
59
- /** Notification sub title (supports HTML) */
59
+ /** Notification subtitle (supports HTML) */
60
60
  subTitle: {
61
61
  type: String,
62
62
  default: '',
@@ -13,7 +13,7 @@
13
13
  [`cv-number-input`]: !formItem,
14
14
  },
15
15
  ]"
16
- :data-invalid="dataInvalidAttributeValue"
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
- :id="cvId"
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`" v-if="label">{{
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
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <li
3
+ ref="el"
3
4
  :class="[
4
5
  `cv-overflow-menu-item ${carbonPrefix}--overflow-menu-options__option`,
5
6
  {
@@ -8,7 +9,6 @@
8
9
  },
9
10
  ]"
10
11
  @keydown.esc.prevent="onEsc"
11
- ref="el"
12
12
  >
13
13
  <button
14
14
  type="button"