@carbon/vue 2.34.1 → 2.35.0

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 (37) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +25 -18
  3. package/dist/carbon-vue.common.js +1312 -995
  4. package/dist/carbon-vue.common.js.map +1 -1
  5. package/dist/carbon-vue.umd.js +1312 -995
  6. package/dist/carbon-vue.umd.js.map +1 -1
  7. package/dist/carbon-vue.umd.min.js +3 -3
  8. package/dist/carbon-vue.umd.min.js.map +1 -1
  9. package/package.json +4 -4
  10. package/src/components/cv-accordion/cv-accordion-item.vue +4 -0
  11. package/src/components/cv-accordion/cv-accordion-skeleton.vue +17 -1
  12. package/src/components/cv-accordion/cv-accordion.vue +18 -1
  13. package/src/components/cv-button/button-mixin.js +12 -7
  14. package/src/components/cv-button/cv-button-set.vue +4 -1
  15. package/src/components/cv-button/cv-icon-button.vue +1 -1
  16. package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +13 -7
  17. package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +13 -7
  18. package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +10 -11
  19. package/src/components/cv-code-snippet/cv-code-snippet.vue +17 -1
  20. package/src/components/cv-combo-box/cv-combo-box.vue +1 -1
  21. package/src/components/cv-content-switcher/cv-content-switcher.vue +20 -3
  22. package/src/components/cv-data-table/cv-data-table.vue +1 -1
  23. package/src/components/cv-date-picker/cv-date-picker.vue +1 -1
  24. package/src/components/cv-dropdown/cv-dropdown.vue +1 -1
  25. package/src/components/cv-loading/cv-loading.vue +5 -1
  26. package/src/components/cv-modal/cv-modal.vue +28 -0
  27. package/src/components/cv-multi-select/cv-multi-select.vue +7 -8
  28. package/src/components/cv-number-input/cv-number-input.vue +1 -1
  29. package/src/components/cv-search/cv-search.vue +1 -1
  30. package/src/components/cv-select/cv-select.vue +1 -1
  31. package/src/components/cv-slider/cv-slider.vue +1 -1
  32. package/src/components/cv-text-area/cv-text-area.vue +1 -1
  33. package/src/components/cv-text-input/cv-text-input.vue +1 -2
  34. package/src/components/cv-tile/cv-tile.vue +1 -1
  35. package/src/components/cv-time-picker/cv-time-picker.vue +2 -2
  36. package/src/directives/clickout.js +21 -9
  37. package/src/mixins/theme-mixin.js +14 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/vue",
3
3
  "description": "A collection of components for the Carbon Design System built using Vue.js",
4
- "version": "2.34.1",
4
+ "version": "2.35.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -63,8 +63,8 @@
63
63
  },
64
64
  "sideEffects": true,
65
65
  "dependencies": {
66
- "@carbon/icons-vue": "10.10.2",
67
- "carbon-components": "10.16.0",
66
+ "@carbon/icons-vue": "10.20.0",
67
+ "carbon-components": "10.23.1",
68
68
  "flatpickr": "4.6.3",
69
69
  "vue": "^2.6.12"
70
70
  },
@@ -73,5 +73,5 @@
73
73
  "eslint-plugin-prettier": "^3.1.1",
74
74
  "vue-template-compiler": "^2.6.12"
75
75
  },
76
- "gitHead": "5dda51139702bbd900e288e818c948a8bc530729"
76
+ "gitHead": "08825d15ce4b9a73e30bc8809b0e2185e80fd2b8"
77
77
  }
@@ -11,7 +11,9 @@
11
11
  class="cv-accordion-item"
12
12
  :class="[
13
13
  `${carbonPrefix}--accordion__item`,
14
+
14
15
  {
16
+ [`${carbonPrefix}--accordion__item--disabled`]: disabled,
15
17
  [`${carbonPrefix}--accordion__item--active`]: dataOpen,
16
18
  [`${carbonPrefix}--accordion__item--${this.animation}`]: animation,
17
19
  },
@@ -19,6 +21,7 @@
19
21
  @animationend="onAnimationEnd"
20
22
  >
21
23
  <button
24
+ :disabled="disabled"
22
25
  ref="button"
23
26
  type="button"
24
27
  :class="`${carbonPrefix}--accordion__heading`"
@@ -45,6 +48,7 @@ export default {
45
48
  mixins: [uidMixin, carbonPrefixMixin, methodsMixin({ button: ['blur', 'focus'] })],
46
49
  components: { ChevronRight16 },
47
50
  props: {
51
+ disabled: Boolean,
48
52
  open: { type: Boolean, default: false },
49
53
  },
50
54
  watch: {
@@ -1,5 +1,13 @@
1
1
  <template>
2
- <ul :class="`${carbonPrefix}--accordion ${carbonPrefix}--skeleton`">
2
+ <ul
3
+ :class="[
4
+ `${carbonPrefix}--accordion ${carbonPrefix}--skeleton`,
5
+ {
6
+ [`${carbonPrefix}--accordion--${align}`]: align,
7
+ [`${carbonPrefix}--accordion--${size}`]: size,
8
+ },
9
+ ]"
10
+ >
3
11
  <cv-accordion-item-skeleton :open="true">
4
12
  <cv-skeleton-text width="90%"></cv-skeleton-text>
5
13
  <cv-skeleton-text width="80%"></cv-skeleton-text>
@@ -18,6 +26,14 @@ import { carbonPrefixMixin } from '../../mixins';
18
26
 
19
27
  export default {
20
28
  name: 'CvAccordionSkeleton',
29
+ props: {
30
+ align: { type: String, default: 'start', validator: val => ['start', 'end', ''].includes(val) },
31
+ size: {
32
+ type: String,
33
+ default: '',
34
+ validator: val => ['sm', 'xl', ''].includes(val),
35
+ },
36
+ },
21
37
  mixins: [carbonPrefixMixin],
22
38
  components: {
23
39
  CvSkeletonText,
@@ -1,5 +1,14 @@
1
1
  <template>
2
- <ul data-accordion :class="`cv-accordion ${carbonPrefix}--accordion`">
2
+ <ul
3
+ data-accordion
4
+ :class="[
5
+ `cv-accordion ${carbonPrefix}--accordion`,
6
+ {
7
+ [`${carbonPrefix}--accordion--${align}`]: align,
8
+ [`${carbonPrefix}--accordion--${size}`]: size,
9
+ },
10
+ ]"
11
+ >
3
12
  <slot></slot>
4
13
  </ul>
5
14
  </template>
@@ -9,6 +18,14 @@ import { carbonPrefixMixin } from '../../mixins';
9
18
 
10
19
  export default {
11
20
  name: 'CvAccordion',
21
+ props: {
22
+ align: { type: String, default: 'start', validator: val => ['start', 'end', ''].includes(val) },
23
+ size: {
24
+ type: String,
25
+ default: '',
26
+ validator: val => ['sm', 'xl', ''].includes(val),
27
+ },
28
+ },
12
29
  mixins: [carbonPrefixMixin],
13
30
  created() {
14
31
  this.$on('cv:change', srcComponent => this.onCvChange(srcComponent));
@@ -25,7 +25,7 @@ export default {
25
25
  kind: {
26
26
  type: String,
27
27
  default: 'primary',
28
- validator: val => ['primary', 'secondary', 'tertiary', 'ghost', 'danger', 'danger--primary'].includes(val),
28
+ validator: val => ['', 'primary', 'secondary', 'tertiary', 'ghost', 'danger', 'danger--primary'].includes(val),
29
29
  },
30
30
  small: {
31
31
  type: Boolean,
@@ -37,7 +37,11 @@ export default {
37
37
  return true;
38
38
  },
39
39
  },
40
- size: { type: String, default: undefined, validator: val => ['', 'field', 'small'].includes(val) },
40
+ size: {
41
+ type: String,
42
+ default: undefined,
43
+ validator: val => ['', 'default', 'field', 'small', 'sm', 'lg', 'xl'].includes(val),
44
+ },
41
45
  },
42
46
  computed: {
43
47
  // Bind listeners at the component level to the embedded input element and
@@ -64,14 +68,15 @@ export default {
64
68
  classes.push(`${carbonSettings.prefix}--btn--${this.kind.toLowerCase()}`);
65
69
  }
66
70
 
67
- if (this.size === 'small' || (this.size === undefined && this.small)) {
68
- classes.push(`${carbonSettings.prefix}--btn--sm`);
71
+ let size = this.size ? this.size : this.small && 'sm';
72
+ if (size === 'small') {
73
+ size = 'sm';
69
74
  }
70
- if (this.size === 'field') {
71
- classes.push(`${carbonSettings.prefix}--btn--field`);
75
+ if (size && !(size === '' || size === 'default')) {
76
+ classes.push(`${carbonSettings.prefix}--btn--${size}`);
72
77
  }
73
78
 
74
- return classes.join(' ');
79
+ return classes;
75
80
  };
76
81
  },
77
82
  },
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="cv-button-set" :class="`${carbonPrefix}--btn-set`">
2
+ <div class="cv-button-set" :class="[`${carbonPrefix}--btn-set`, { [`${carbonPrefix}--btn-set--stacked`]: stacked }]">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -10,5 +10,8 @@ import { carbonPrefixMixin } from '../../mixins';
10
10
  export default {
11
11
  name: 'CvButtonSet',
12
12
  mixins: [carbonPrefixMixin],
13
+ props: {
14
+ stacked: Boolean,
15
+ },
13
16
  };
14
17
  </script>
@@ -2,7 +2,7 @@
2
2
  <button
3
3
  class="cv-button"
4
4
  :class="[
5
- buttonClassOpts({ iconOnly: true }),
5
+ ...buttonClassOpts({ iconOnly: true }),
6
6
  `${carbonPrefix}--tooltip__trigger`,
7
7
  `${carbonPrefix}--tooltip--a11y`,
8
8
  `${carbonPrefix}--tooltip--${tipPosition || 'bottom'}`,
@@ -1,11 +1,8 @@
1
1
  <template>
2
2
  <cv-feedback-button
3
+ v-if="!hideCopyButton"
3
4
  class="cv-code-snippet-inline"
4
- :class="[
5
- `${carbonPrefix}--snippet`,
6
- `${carbonPrefix}--snippet--inline`,
7
- { [`${carbonPrefix}--snippet--light`]: theme === 'light' },
8
- ]"
5
+ :class="classes"
9
6
  :feedback="copyFeedback"
10
7
  inline
11
8
  :aria-label="feedbackAriaLabel"
@@ -13,21 +10,30 @@
13
10
  >
14
11
  <slot></slot>
15
12
  </cv-feedback-button>
13
+ <span v-else :class="classes">
14
+ <slot></slot>
15
+ </span>
16
16
  </template>
17
17
 
18
18
  <script>
19
19
  import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
20
- import { themeMixin, carbonPrefixMixin } from '../../mixins';
20
+ import { carbonPrefixMixin } from '../../mixins';
21
21
 
22
22
  export default {
23
23
  name: 'CvCodeSnippetInline',
24
- mixins: [themeMixin, carbonPrefixMixin],
24
+ mixins: [carbonPrefixMixin],
25
25
  components: {
26
26
  CvFeedbackButton,
27
27
  },
28
28
  props: {
29
29
  copyFeedback: String,
30
30
  feedbackAriaLabel: String,
31
+ hideCopyButton: Boolean,
32
+ },
33
+ computed: {
34
+ classes() {
35
+ return [`${this.carbonPrefix}--snippet`, `${this.carbonPrefix}--snippet--inline`];
36
+ },
31
37
  },
32
38
  };
33
39
  </script>
@@ -4,16 +4,21 @@
4
4
  :class="[
5
5
  `${carbonPrefix}--snippet`,
6
6
  `${carbonPrefix}--snippet--multi`,
7
- { [`${carbonPrefix}--snippet--expand`]: expanded, [`${carbonPrefix}--snippet--light`]: theme === 'light' },
7
+ { [`${carbonPrefix}--snippet--expand`]: expanded },
8
8
  ]"
9
9
  data-code-snippet
10
10
  >
11
- <div :class="`${carbonPrefix}--snippet-container`">
11
+ <div :class="[`${carbonPrefix}--snippet-container`]">
12
12
  <pre>
13
13
  <slot></slot>
14
14
  </pre>
15
15
  </div>
16
- <cv-feedback-button :feedback="copyFeedback" :aria-label="feedbackAriaLabel" @click="$emit('copy-code')">
16
+ <cv-feedback-button
17
+ v-if="!hideCopyButton"
18
+ :feedback="copyFeedback"
19
+ :aria-label="feedbackAriaLabel"
20
+ @click="$emit('copy-code')"
21
+ >
17
22
  <Copy16 :class="`${carbonPrefix}--snippet__icon`" />
18
23
  </cv-feedback-button>
19
24
 
@@ -36,11 +41,11 @@ import CvButton from '../cv-button/cv-button';
36
41
 
37
42
  import Copy16 from '@carbon/icons-vue/es/copy/16';
38
43
  import ChevronDown16 from '@carbon/icons-vue/es/chevron--down/16';
39
- import { carbonPrefixMixin, themeMixin } from '../../mixins';
44
+ import { carbonPrefixMixin } from '../../mixins';
40
45
 
41
46
  export default {
42
47
  name: 'CvCodeSnippetMultiline',
43
- mixins: [themeMixin, carbonPrefixMixin],
48
+ mixins: [carbonPrefixMixin],
44
49
  components: {
45
50
  CvButton,
46
51
  CvFeedbackButton,
@@ -48,10 +53,11 @@ export default {
48
53
  ChevronDown16,
49
54
  },
50
55
  props: {
56
+ copyFeedback: String,
57
+ feedbackAriaLabel: String,
58
+ hideCopyButton: Boolean,
51
59
  lessText: { type: String, default: 'Show less' },
52
60
  moreText: { type: String, default: 'Show more' },
53
- feedbackAriaLabel: String,
54
- copyFeedback: String,
55
61
  },
56
62
  data() {
57
63
  return {
@@ -1,31 +1,29 @@
1
1
  <template>
2
- <div
3
- class="cv-code-snippet-oneline"
4
- :class="[
5
- `${carbonPrefix}--snippet`,
6
- `${carbonPrefix}--snippet--single`,
7
- { [`${carbonPrefix}--snippet--light`]: theme === 'light' },
8
- ]"
9
- >
2
+ <div class="cv-code-snippet-oneline" :class="[`${carbonPrefix}--snippet`, `${carbonPrefix}--snippet--single`]">
10
3
  <div :class="`${carbonPrefix}--snippet-container`">
11
4
  <pre>
12
5
  <slot></slot>
13
6
  </pre>
14
7
  </div>
15
- <cv-feedback-button :feedback="copyFeedback" :aria-label="feedbackAriaLabel" @click="$emit('copy-code')">
8
+ <cv-feedback-button
9
+ v-if="!hideCopyButton"
10
+ :feedback="copyFeedback"
11
+ :aria-label="feedbackAriaLabel"
12
+ @click="$emit('copy-code')"
13
+ >
16
14
  <Copy16 :class="`${carbonPrefix}--snippet__icon`" />
17
15
  </cv-feedback-button>
18
16
  </div>
19
17
  </template>
20
18
 
21
19
  <script>
22
- import { themeMixin, carbonPrefixMixin } from '../../mixins';
20
+ import { carbonPrefixMixin } from '../../mixins';
23
21
  import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
24
22
  import Copy16 from '@carbon/icons-vue/es/copy/16';
25
23
 
26
24
  export default {
27
25
  name: 'CvCodeSnippetOneline',
28
- mixins: [themeMixin, carbonPrefixMixin],
26
+ mixins: [carbonPrefixMixin],
29
27
  components: {
30
28
  CvFeedbackButton,
31
29
  Copy16,
@@ -33,6 +31,7 @@ export default {
33
31
  props: {
34
32
  copyFeedback: String,
35
33
  feedbackAriaLabel: String,
34
+ hideCopyButton: Boolean,
36
35
  },
37
36
  };
38
37
  </script>
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <component
3
- class="cv-code-snippet"
3
+ :class="classes"
4
4
  :is="theComponent"
5
5
  v-bind="$attrs"
6
6
  @copy-code="onCopyCode"
7
7
  :copy-feedback="copyFeedback"
8
8
  :feedback-aria-label="feedbackAriaLabel"
9
+ :hideCopyButton="hideCopyButton"
10
+ :wrap-text="wrapText"
9
11
  >
10
12
  <code ref="code">
11
13
  <slot></slot>
@@ -24,10 +26,12 @@
24
26
  import CvCodeSnippetInline from './_cv-code-snippet-inline';
25
27
  import CvCodeSnippetMultiline from './_cv-code-snippet-multiline';
26
28
  import CvCodeSnippetOneline from './_cv-code-snippet-oneline';
29
+ import { carbonPrefixMixin, themeMixin } from '../../mixins';
27
30
 
28
31
  export default {
29
32
  name: 'CvCodeSnippet',
30
33
  inheritAttrs: false,
34
+ mixins: [carbonPrefixMixin, themeMixin],
31
35
  components: {
32
36
  CvCodeSnippetInline,
33
37
  CvCodeSnippetMultiline,
@@ -36,13 +40,25 @@ export default {
36
40
  props: {
37
41
  feedbackAriaLabel: { type: String, default: 'Copy code' },
38
42
  copyFeedback: { type: String, default: 'Copied!' },
43
+ hideCopyButton: Boolean,
39
44
  kind: {
40
45
  type: String,
41
46
  default: 'oneline',
42
47
  validator: value => ['inline', 'multiline', 'oneline'].includes(value),
43
48
  },
49
+ wrapText: Boolean,
44
50
  },
45
51
  computed: {
52
+ classes() {
53
+ return [
54
+ `cv-code-snippet`,
55
+ {
56
+ [`${this.carbonPrefix}--snippet--light`]: this.isLight,
57
+ [`${this.carbonPrefix}--snippet--no-copy`]: this.hideCopyButton,
58
+ [`${this.carbonPrefix}--snippet--wraptext`]: this.wrapText,
59
+ },
60
+ ];
61
+ },
46
62
  theComponent() {
47
63
  switch (this.kind) {
48
64
  case 'inline':
@@ -14,7 +14,7 @@
14
14
  :class="[
15
15
  `${carbonPrefix}--combo-box ${carbonPrefix}--list-box`,
16
16
  {
17
- [`${carbonPrefix}--list-box--light`]: theme === 'light',
17
+ [`${carbonPrefix}--list-box--light`]: isLight,
18
18
  [`${carbonPrefix}--combo-box--expanded`]: open,
19
19
  [`${carbonPrefix}--list-box--expanded`]: open,
20
20
  [`${carbonPrefix}--combo-box--disabled ${carbonPrefix}--list-box--disabled`]: disabled,
@@ -1,12 +1,22 @@
1
1
  <template>
2
- <div data-content-switcher :class="`cv-content-switcher ${carbonPrefix}--content-switcher`" role="tablist">
2
+ <div
3
+ data-content-switcher
4
+ :class="[
5
+ `cv-content-switcher ${carbonPrefix}--content-switcher`,
6
+ {
7
+ [`${carbonPrefix}--content-switcher--light`]: isLight,
8
+ [`${carbonPrefix}--content-switcher--${size}`]: size,
9
+ },
10
+ ]"
11
+ role="tablist"
12
+ >
3
13
  <slot></slot>
4
14
  </div>
5
15
  </template>
6
16
 
7
17
  <script>
8
18
  import store from './cv-content-switcher-store';
9
- import { carbonPrefixMixin } from '../../mixins';
19
+ import { carbonPrefixMixin, themeMixin } from '../../mixins';
10
20
 
11
21
  const toggleContent = (selector, on) => {
12
22
  // hide content
@@ -24,13 +34,20 @@ const toggleContent = (selector, on) => {
24
34
 
25
35
  export default {
26
36
  name: 'CvContentSwitcher',
27
- mixins: [carbonPrefixMixin],
37
+ mixins: [carbonPrefixMixin, themeMixin],
28
38
  created() {
29
39
  // add these on created otherwise cv:mounted is too late.
30
40
  this.$on('cv:open', srcComponent => this.onCvOpen(srcComponent));
31
41
  this.$on('cv:mounted', srcComponent => this.onCvMount(srcComponent));
32
42
  this.$on('cv:beforeDestroy', srcComponent => this.onCvBeforeDestroy(srcComponent));
33
43
  },
44
+ props: {
45
+ size: {
46
+ type: String,
47
+ default: undefined,
48
+ validator: val => ['', 'sm', 'xl'].includes(val),
49
+ },
50
+ },
34
51
  data() {
35
52
  return {
36
53
  store: store,
@@ -308,7 +308,7 @@ export default {
308
308
  return this.overflowMenu === true || (this.overflowMenu && this.overflowMenu.length > 0);
309
309
  },
310
310
  tableStyle() {
311
- return this.autoWidth ? { width: 'initial' } : { width: '100%' };
311
+ return this.autoWidth ? { width: 'initial', display: 'inline-block' } : { width: '100%' };
312
312
  },
313
313
  internalPagination() {
314
314
  if (typeof this.pagination === 'object') {
@@ -7,7 +7,7 @@
7
7
  `${this.carbonPrefix}--date-picker ${this.carbonPrefix}--date-picker--${this.kind}`,
8
8
  {
9
9
  [`${carbonPrefix}--date-picker--simple`]: this.kind === 'short',
10
- [`${carbonPrefix}--date-picker--light`]: theme === 'light',
10
+ [`${carbonPrefix}--date-picker--light`]: isLight,
11
11
  'cv-date-pciker': !formItem,
12
12
  },
13
13
  ]"
@@ -43,7 +43,7 @@
43
43
  :class="[
44
44
  `${carbonPrefix}--dropdown ${carbonPrefix}--list-box`,
45
45
  {
46
- [`${carbonPrefix}--dropdown--light`]: theme === 'light',
46
+ [`${carbonPrefix}--dropdown--light`]: isLight,
47
47
  [`${carbonPrefix}--dropdown--up`]: up,
48
48
  [`${carbonPrefix}--dropdown--open`]: open,
49
49
  [`${carbonPrefix}--list-box--expanded`]: open,
@@ -10,8 +10,11 @@
10
10
  }"
11
11
  ref="loading"
12
12
  >
13
+ <label :class="`${carbonPrefix}--visually-hidden`">
14
+ {{ description }}
15
+ </label>
13
16
  <svg :class="`${carbonPrefix}--loading__svg`" viewBox="-75 -75 150 150">
14
- <title>Loading</title>
17
+ <title>{{ description }}</title>
15
18
  <circle v-if="small" :class="`${carbonPrefix}--loading__background`" cx="0" cy="0" :r="loadingRadius" />
16
19
  <circle :class="`${carbonPrefix}--loading__stroke`" cx="0" cy="0" :r="loadingRadius" />
17
20
  </svg>
@@ -29,6 +32,7 @@ export default {
29
32
  components: { CvWrapper },
30
33
  props: {
31
34
  active: { type: Boolean, default: true },
35
+ description: { type: String, default: 'Loading' },
32
36
  overlay: Boolean,
33
37
  small: Boolean,
34
38
  },
@@ -18,6 +18,7 @@
18
18
  `${carbonPrefix}--modal-container`,
19
19
  { [`${carbonPrefix}--modal-container--${internalSize}`]: internalSize },
20
20
  ]"
21
+ v-bind="dialogAttrs"
21
22
  ref="modalDialog"
22
23
  >
23
24
  <div
@@ -92,6 +93,7 @@ export default {
92
93
  Close16,
93
94
  },
94
95
  props: {
96
+ alert: Boolean,
95
97
  closeAriaLabel: { type: String, default: 'Close modal' },
96
98
  kind: {
97
99
  type: String,
@@ -133,6 +135,20 @@ export default {
133
135
  },
134
136
  },
135
137
  computed: {
138
+ dialogAttrs() {
139
+ const passive = !(this.hasPrimary || this.hasSecondary);
140
+ const attrs = { role: 'dialog' };
141
+
142
+ if (this.alert) {
143
+ if (passive) {
144
+ attrs.role = 'alert';
145
+ } else {
146
+ attrs.role = 'alertdialog';
147
+ attrs['aria-describedBy'] = this.uid;
148
+ }
149
+ }
150
+ return attrs;
151
+ },
136
152
  primaryKind() {
137
153
  if (this.kind === 'danger') {
138
154
  return 'danger';
@@ -228,9 +244,16 @@ export default {
228
244
  //restore any previous scrollability
229
245
  document.body.classList.remove(`${this.carbonPrefix}--body--with-modal-open`);
230
246
 
247
+ if (this.dataVisible) {
248
+ this.$el.addEventListener('transitionend', this.afterHide, { once: true });
249
+ }
250
+
231
251
  this.dataVisible = false;
232
252
  this.$emit('modal-hidden');
233
253
  },
254
+ afterHide() {
255
+ this.$emit('after-modal-hidden');
256
+ },
234
257
  onPrimaryClick(ev) {
235
258
  this.$emit('primary-click');
236
259
  if (!this.$listeners['primary-click']) {
@@ -244,5 +267,10 @@ export default {
244
267
  }
245
268
  },
246
269
  },
270
+ beforeDestroy() {
271
+ if (this.dataVisible) {
272
+ this.$emit('after-modal-hidden');
273
+ }
274
+ },
247
275
  };
248
276
  </script>
@@ -18,20 +18,13 @@
18
18
  >{{ title }}</label
19
19
  >
20
20
 
21
- <div
22
- v-if="!inline && isHelper"
23
- :class="[`${carbonPrefix}--form__helper-text`, { [`${carbonPrefix}--form__helper-text--disabled`]: disabled }]"
24
- >
25
- <slot name="helper-text">{{ helperText }}</slot>
26
- </div>
27
-
28
21
  <div
29
22
  role="listbox"
30
23
  tabindex="-1"
31
24
  :class="[
32
25
  `${carbonPrefix}--multi-select ${carbonPrefix}--list-box`,
33
26
  {
34
- [`${carbonPrefix}--list-box--light`]: theme === 'light',
27
+ [`${carbonPrefix}--list-box--light`]: isLight,
35
28
  [`${carbonPrefix}--list-box--expanded`]: open,
36
29
  [`${carbonPrefix}--multi-select--invalid`]: isInvalid,
37
30
  [`${carbonPrefix}--multi-select--disabled`]: disabled,
@@ -147,6 +140,12 @@
147
140
  <div v-if="isInvalid && !inline" :class="`${carbonPrefix}--form-requirement`">
148
141
  <slot name="invalid-message">{{ invalidMessage }}</slot>
149
142
  </div>
143
+ <div
144
+ v-if="!inline && !isInvalid && isHelper"
145
+ :class="[`${carbonPrefix}--form__helper-text`, { [`${carbonPrefix}--form__helper-text--disabled`]: disabled }]"
146
+ >
147
+ <slot name="helper-text">{{ helperText }}</slot>
148
+ </div>
150
149
  </div>
151
150
  </template>
152
151
 
@@ -5,7 +5,7 @@
5
5
  :class="[
6
6
  `${carbonPrefix}--number`,
7
7
  {
8
- [`${carbonPrefix}--number--light`]: theme === 'light',
8
+ [`${carbonPrefix}--number--light`]: isLight,
9
9
  [`${carbonPrefix}--number--helpertext`]: isHelper,
10
10
  [`cv-number-input`]: !formItem,
11
11
  [`${carbonPrefix}--number--mobile`]: mobile,
@@ -4,7 +4,7 @@
4
4
  :class="[
5
5
  `${carbonPrefix}--search`,
6
6
  {
7
- [`${carbonPrefix}--search--${theme}`]: theme.length,
7
+ [`${carbonPrefix}--search--light`]: isLight,
8
8
  [`${carbonPrefix}--search--${internalSize}`]: internalSize,
9
9
  [`${carbonPrefix}--toolbar-search`]: isToolbarKind,
10
10
  [`${carbonPrefix}--toolbar-search--active`]: toolbarActive,
@@ -7,7 +7,7 @@
7
7
  {
8
8
  'cv-select': !formItem,
9
9
  [`${carbonPrefix}--select--inline`]: inline,
10
- [`${carbonPrefix}--select--light`]: theme === 'light',
10
+ [`${carbonPrefix}--select--light`]: isLight,
11
11
  [`${carbonPrefix}--select--invalid`]: isInvalid,
12
12
  [`${carbonPrefix}--select--disabled`]: $attrs.disabled,
13
13
  },
@@ -41,7 +41,7 @@
41
41
  type="number"
42
42
  :class="[
43
43
  `${carbonPrefix}--text-input ${carbonPrefix}--slider-text-input`,
44
- { [`${carbonPrefix}--text-input--light`]: theme === 'light' },
44
+ { [`${carbonPrefix}--text-input--light`]: isLight },
45
45
  ]"
46
46
  :placeholder="min"
47
47
  v-model="internalValue"
@@ -17,7 +17,7 @@
17
17
  :class="[
18
18
  `${carbonPrefix}--text-area`,
19
19
  {
20
- [`${carbonPrefix}--text-area--light`]: theme === 'light',
20
+ [`${carbonPrefix}--text-area--light`]: isLight,
21
21
  [`${carbonPrefix}--text-area--invalid`]: isInvalid,
22
22
  },
23
23
  ]"
@@ -17,7 +17,7 @@
17
17
  :class="[
18
18
  `${carbonPrefix}--text-input`,
19
19
  {
20
- [`${carbonPrefix}--text-input--light`]: theme === 'light',
20
+ [`${carbonPrefix}--text-input--light`]: isLight,
21
21
  [`${carbonPrefix}--text-input--invalid`]: isInvalid,
22
22
  },
23
23
  ]"
@@ -78,7 +78,6 @@ export default {
78
78
  passwordHideLabel: { type: String, default: 'Hide password' },
79
79
  passwordShowLabel: { type: String, default: 'Show password' },
80
80
  passwordVisible: Boolean,
81
- theme: String,
82
81
  type: String,
83
82
  value: String,
84
83
  },