@carbon/vue 2.33.0 → 2.34.1

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 (128) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/carbon-vue.common.js +1676 -1457
  3. package/dist/carbon-vue.common.js.map +1 -1
  4. package/dist/carbon-vue.umd.js +1676 -1457
  5. package/dist/carbon-vue.umd.js.map +1 -1
  6. package/dist/carbon-vue.umd.min.js +3 -3
  7. package/dist/carbon-vue.umd.min.js.map +1 -1
  8. package/package.json +4 -4
  9. package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +1 -1
  10. package/src/components/cv-accordion/cv-accordion-item.vue +1 -4
  11. package/src/components/cv-accordion/cv-accordion-skeleton.vue +1 -1
  12. package/src/components/cv-accordion/cv-accordion.vue +1 -1
  13. package/src/components/cv-breadcrumb/_cv-breadcrumb-item-skeleton.vue +1 -1
  14. package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +1 -1
  15. package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +1 -1
  16. package/src/components/cv-breadcrumb/cv-breadcrumb.vue +1 -1
  17. package/src/components/cv-button/cv-button-set.vue +1 -1
  18. package/src/components/cv-button/cv-button.vue +1 -1
  19. package/src/components/cv-button/cv-icon-button.vue +1 -1
  20. package/src/components/cv-checkbox/cv-checkbox-skeleton.vue +1 -1
  21. package/src/components/cv-checkbox/cv-checkbox.vue +1 -4
  22. package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +1 -2
  23. package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +1 -2
  24. package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +1 -2
  25. package/src/components/cv-code-snippet/cv-code-snippet-skeleton.vue +1 -1
  26. package/src/components/cv-combo-box/cv-combo-box.vue +3 -6
  27. package/src/components/cv-content-switcher/cv-content-switcher-button.vue +1 -2
  28. package/src/components/cv-content-switcher/cv-content-switcher.vue +1 -1
  29. package/src/components/cv-data-table/_cv-data-table-row-inner.vue +3 -3
  30. package/src/components/cv-data-table/cv-data-table-action.vue +1 -1
  31. package/src/components/cv-data-table/cv-data-table-heading.vue +1 -2
  32. package/src/components/cv-data-table/cv-data-table-row.vue +2 -3
  33. package/src/components/cv-data-table/cv-data-table-skeleton.vue +2 -2
  34. package/src/components/cv-data-table/cv-data-table.vue +3 -5
  35. package/src/components/cv-date-picker/cv-date-picker.vue +37 -15
  36. package/src/components/cv-date-picker/plugins/appendToPlugin.js +52 -0
  37. package/src/components/cv-date-picker/plugins/fixEventsPlugin.js +75 -0
  38. package/src/components/cv-date-picker/plugins/monthSelectPlugin.js +66 -0
  39. package/src/components/cv-date-picker/plugins/rangePlugin.js +45 -0
  40. package/src/components/cv-dropdown/cv-dropdown-item.vue +1 -1
  41. package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +1 -1
  42. package/src/components/cv-dropdown/cv-dropdown.vue +10 -8
  43. package/src/components/cv-feedback-button/_cv-feedback-button.vue +1 -1
  44. package/src/components/cv-file-uploader/cv-file-uploader-skeleton.vue +1 -1
  45. package/src/components/cv-file-uploader/cv-file-uploader.vue +1 -3
  46. package/src/components/cv-form/cv-form-group.vue +1 -1
  47. package/src/components/cv-form/cv-form-item.vue +1 -1
  48. package/src/components/cv-form/cv-form.vue +1 -1
  49. package/src/components/cv-grid/cv-column.vue +77 -0
  50. package/src/components/cv-grid/cv-grid.vue +32 -0
  51. package/src/components/cv-grid/cv-row.vue +30 -0
  52. package/src/components/cv-grid/index.js +5 -0
  53. package/src/components/cv-inline-loading/cv-inline-loading.vue +1 -1
  54. package/src/components/cv-inline-notification/cv-inline-notification.vue +2 -3
  55. package/src/components/cv-link/cv-link.vue +2 -3
  56. package/src/components/cv-list/cv-list-item.vue +1 -1
  57. package/src/components/cv-list/cv-list.vue +1 -1
  58. package/src/components/cv-loading/cv-loading.vue +1 -1
  59. package/src/components/cv-modal/cv-modal.vue +3 -4
  60. package/src/components/cv-multi-select/cv-multi-select.vue +3 -6
  61. package/src/components/cv-number-input/cv-number-input-skeleton.vue +1 -1
  62. package/src/components/cv-number-input/cv-number-input.vue +3 -6
  63. package/src/components/cv-overflow-menu/cv-overflow-menu-item.vue +1 -1
  64. package/src/components/cv-overflow-menu/cv-overflow-menu.vue +1 -3
  65. package/src/components/cv-pagination/cv-pagination.vue +1 -1
  66. package/src/components/cv-progress/cv-progress-step.vue +1 -1
  67. package/src/components/cv-progress/cv-progress.vue +1 -1
  68. package/src/components/cv-radio-button/cv-radio-button.vue +1 -4
  69. package/src/components/cv-radio-button/cv-radio-group.vue +1 -1
  70. package/src/components/cv-search/cv-search.vue +1 -4
  71. package/src/components/cv-select/cv-select-optgroup.vue +1 -1
  72. package/src/components/cv-select/cv-select-option.vue +1 -1
  73. package/src/components/cv-select/cv-select.vue +3 -6
  74. package/src/components/cv-skeleton-text/cv-skeleton-text.vue +1 -1
  75. package/src/components/cv-slider/cv-slider-skeleton.vue +1 -1
  76. package/src/components/cv-slider/cv-slider.vue +1 -4
  77. package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +1 -4
  78. package/src/components/cv-structured-list/_cv-structured-list-item-standard.vue +1 -1
  79. package/src/components/cv-structured-list/cv-structured-list-data.vue +1 -1
  80. package/src/components/cv-structured-list/cv-structured-list-heading.vue +1 -1
  81. package/src/components/cv-structured-list/cv-structured-list.vue +1 -1
  82. package/src/components/cv-tabs/cv-tab.vue +1 -1
  83. package/src/components/cv-tabs/cv-tabs-skeleton.vue +1 -1
  84. package/src/components/cv-tabs/cv-tabs.vue +1 -1
  85. package/src/components/cv-tag/cv-tag-skeleton.vue +1 -1
  86. package/src/components/cv-tag/cv-tag.vue +1 -2
  87. package/src/components/cv-text-area/cv-text-area.vue +3 -6
  88. package/src/components/cv-text-input/cv-text-input.vue +3 -6
  89. package/src/components/cv-tile/_cv-tile-clickable.vue +2 -4
  90. package/src/components/cv-tile/_cv-tile-expandable.vue +1 -2
  91. package/src/components/cv-tile/_cv-tile-selectable.vue +1 -4
  92. package/src/components/cv-tile/cv-tile.vue +1 -3
  93. package/src/components/cv-time-picker/cv-time-picker.vue +3 -6
  94. package/src/components/cv-toast-notification/cv-toast-notification.vue +3 -4
  95. package/src/components/cv-toggle/cv-toggle-skeleton.vue +1 -2
  96. package/src/components/cv-toggle/cv-toggle.vue +1 -4
  97. package/src/components/cv-toolbar/cv-toolbar-divider.vue +1 -1
  98. package/src/components/cv-toolbar/cv-toolbar-option.vue +1 -1
  99. package/src/components/cv-toolbar/cv-toolbar-search.vue +1 -1
  100. package/src/components/cv-toolbar/cv-toolbar-title.vue +1 -1
  101. package/src/components/cv-toolbar/cv-toolbar.vue +1 -1
  102. package/src/components/cv-tooltip/cv-definition-tooltip.vue +1 -2
  103. package/src/components/cv-tooltip/cv-interactive-tooltip.vue +1 -2
  104. package/src/components/cv-tooltip/cv-tooltip.vue +1 -1
  105. package/src/components/cv-ui-shell/_cv-side-nav-footer.vue +1 -1
  106. package/src/components/cv-ui-shell/_cv-side-nav-link-text.vue +1 -1
  107. package/src/components/cv-ui-shell/cv-content.vue +1 -1
  108. package/src/components/cv-ui-shell/cv-header-global-action.vue +1 -2
  109. package/src/components/cv-ui-shell/cv-header-menu-button.vue +1 -2
  110. package/src/components/cv-ui-shell/cv-header-menu-item.vue +2 -3
  111. package/src/components/cv-ui-shell/cv-header-menu.vue +1 -1
  112. package/src/components/cv-ui-shell/cv-header-name.vue +2 -3
  113. package/src/components/cv-ui-shell/cv-header-nav.vue +1 -1
  114. package/src/components/cv-ui-shell/cv-header-panel.vue +2 -2
  115. package/src/components/cv-ui-shell/cv-header-side-nav-items.vue +1 -1
  116. package/src/components/cv-ui-shell/cv-header.vue +3 -3
  117. package/src/components/cv-ui-shell/cv-side-nav-icon.vue +1 -1
  118. package/src/components/cv-ui-shell/cv-side-nav-items.vue +1 -1
  119. package/src/components/cv-ui-shell/cv-side-nav-link.vue +3 -4
  120. package/src/components/cv-ui-shell/cv-side-nav-menu-item.vue +2 -3
  121. package/src/components/cv-ui-shell/cv-side-nav-menu.vue +3 -3
  122. package/src/components/cv-ui-shell/cv-side-nav.vue +2 -2
  123. package/src/components/cv-ui-shell/cv-skip-to-content.vue +2 -3
  124. package/src/components/cv-ui-shell/cv-switcher-item-link.vue +2 -3
  125. package/src/components/cv-ui-shell/cv-switcher-item.vue +1 -1
  126. package/src/components/cv-ui-shell/cv-switcher.vue +1 -1
  127. package/src/index.js +2 -0
  128. package/src/mixins/index.js +12 -0
@@ -0,0 +1,66 @@
1
+ /*
2
+ * COPIED FROM carbon-components-react
3
+ */
4
+
5
+ /**
6
+ * @param {number} monthNumber The month number.
7
+ * @param {boolean} shorthand `true` to use shorthand month.
8
+ * @param {Locale} locale The Flatpickr locale data.
9
+ * @returns {string} The month string.
10
+ */
11
+ const monthToStr = (monthNumber, shorthand, locale) => locale.months[shorthand ? 'shorthand' : 'longhand'][monthNumber];
12
+
13
+ /**
14
+ * @param {object} config Plugin configuration.
15
+ * @param {boolean} [config.shorthand] `true` to use shorthand month.
16
+ * @param {string} config.selectorFlatpickrMonthYearContainer The CSS selector for the container of month/year selection UI.
17
+ * @param {string} config.selectorFlatpickrYearContainer The CSS selector for the container of year selection UI.
18
+ * @param {string} config.selectorFlatpickrCurrentMonth The CSS selector for the text-based month selection UI.
19
+ * @param {string} config.classFlatpickrCurrentMonth The CSS class for the text-based month selection UI.
20
+ * @returns {Plugin} A Flatpickr plugin to use text instead of `<select>` for month picker.
21
+ */
22
+ export default config => fp => {
23
+ const setupElements = () => {
24
+ if (!fp.monthElements) {
25
+ return;
26
+ }
27
+ fp.monthElements.forEach(elem => {
28
+ if (!elem.parentNode) return;
29
+ elem.parentNode.removeChild(elem);
30
+ });
31
+ fp.monthElements.splice(
32
+ 0,
33
+ fp.monthElements.length,
34
+ ...fp.monthElements.map(() => {
35
+ // eslint-disable-next-line no-underscore-dangle
36
+ const monthElement = fp._createElement('span', config.classFlatpickrCurrentMonth);
37
+ monthElement.textContent = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
38
+ fp.yearElements[0]
39
+ .closest(config.selectorFlatpickrMonthYearContainer)
40
+ .insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
41
+ return monthElement;
42
+ })
43
+ );
44
+ };
45
+
46
+ const updateCurrentMonth = () => {
47
+ const monthStr = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
48
+ fp.yearElements.forEach(elem => {
49
+ const currentMonthContainer = elem.closest(config.selectorFlatpickrMonthYearContainer);
50
+ Array.prototype.forEach.call(currentMonthContainer.querySelectorAll('.cur-month'), monthElement => {
51
+ monthElement.textContent = monthStr;
52
+ });
53
+ });
54
+ };
55
+
56
+ const register = () => {
57
+ fp.loadedPlugins.push('carbonFlatpickrMonthSelectPlugin');
58
+ };
59
+
60
+ return {
61
+ onMonthChange: updateCurrentMonth,
62
+ onValueUpdate: updateCurrentMonth,
63
+ onOpen: updateCurrentMonth,
64
+ onReady: [setupElements, updateCurrentMonth, register],
65
+ };
66
+ };
@@ -0,0 +1,45 @@
1
+ import rangePlugin from 'flatpickr/dist/plugins/rangePlugin';
2
+
3
+ /*
4
+ * COPIED FROM carbon-components-react
5
+ */
6
+
7
+ /**
8
+ * @param {object} config Plugin configuration.
9
+ * @returns {Plugin} An extension of Flatpickr `rangePlugin` that does the following:
10
+ * * Better ensures the calendar dropdown is always aligned to the `<input>` for the starting date.
11
+ * Workaround for: https://github.com/flatpickr/flatpickr/issues/1944
12
+ * * A logic to ensure `fp.setDate()` call won't end up with "startDate to endDate" set to the first `<input>`
13
+ */
14
+ export default config => {
15
+ const factory = rangePlugin(Object.assign({ position: 'left' }, config));
16
+
17
+ return fp => {
18
+ const origSetDate = fp.setDate;
19
+
20
+ const init = () => {
21
+ fp.setDate = function setDate(dates, triggerChange, format) {
22
+ origSetDate.call(this, dates, triggerChange, format);
23
+ // If `triggerChange` is `true`, `onValueUpdate` Flatpickr event is fired
24
+ // where Flatpickr's range plugin takes care of fixing the first `<input>`
25
+ if (!triggerChange) {
26
+ const { _input: inputFrom } = fp;
27
+ const { input: inputTo } = config;
28
+ [inputFrom, inputTo].forEach((input, i) => {
29
+ if (input) {
30
+ input.value = !dates[i] ? '' : fp.formatDate(new Date(dates[i]), fp.config.dateFormat);
31
+ }
32
+ });
33
+ }
34
+ };
35
+ };
36
+
37
+ const origRangePlugin = factory(fp);
38
+ const { onReady: origOnReady } = origRangePlugin;
39
+
40
+ return Object.assign(origRangePlugin, {
41
+ onReady: [init, origOnReady],
42
+ onPreCalendarPosition() {},
43
+ });
44
+ };
45
+ };
@@ -32,7 +32,7 @@
32
32
  </template>
33
33
 
34
34
  <script>
35
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
35
+ import { carbonPrefixMixin } from '../../mixins';
36
36
  export default {
37
37
  name: 'CvDropdownItem',
38
38
  mixins: [carbonPrefixMixin],
@@ -9,7 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
12
+ import { carbonPrefixMixin } from '../../mixins';
13
13
  export default {
14
14
  name: 'CvDropdownSkeleton',
15
15
  mixins: [carbonPrefixMixin],
@@ -20,7 +20,12 @@
20
20
  <div
21
21
  :class="[
22
22
  `${carbonPrefix}--dropdown__wrapper`,
23
- { [`${carbonPrefix}--dropdown__wrapper--inline`]: inline, 'cv-dropdown': !formItem },
23
+ `${carbonPrefix}--list-box__wrapper`,
24
+ {
25
+ [`${carbonPrefix}--dropdown__wrapper--inline`]: inline,
26
+ [`${carbonPrefix}--list-box__wrapper--inline`]: inline,
27
+ 'cv-dropdown': !formItem,
28
+ },
24
29
  ]"
25
30
  :style="wrapperStyleOverride"
26
31
  >
@@ -41,6 +46,7 @@
41
46
  [`${carbonPrefix}--dropdown--light`]: theme === 'light',
42
47
  [`${carbonPrefix}--dropdown--up`]: up,
43
48
  [`${carbonPrefix}--dropdown--open`]: open,
49
+ [`${carbonPrefix}--list-box--expanded`]: open,
44
50
  [`${carbonPrefix}--dropdown--invalid`]: isInvalid,
45
51
  [`${carbonPrefix}--dropdown--disabled`]: disabled,
46
52
  [`${carbonPrefix}--dropdown--inline`]: inline,
@@ -77,7 +83,6 @@
77
83
  />
78
84
  <div
79
85
  :class="[`${carbonPrefix}--list-box__menu-icon`, { [`${carbonPrefix}--list-box__menu-icon--open`]: open }]"
80
- role="button"
81
86
  >
82
87
  <chevron-down-16 :aria-label="open ? 'Close menu' : 'Open menu'" />
83
88
  </div>
@@ -114,13 +119,10 @@
114
119
  </template>
115
120
 
116
121
  <script>
117
- import themeMixin from '../../mixins/theme-mixin';
118
- import uidMixin from '../../mixins/uid-mixin';
119
- import methodsMixin from '../../mixins/methods-mixin';
122
+ import { themeMixin, uidMixin, methodsMixin, carbonPrefixMixin } from '../../mixins';
120
123
  import CvDropdownItem from './cv-dropdown-item';
121
124
  import WarningFilled16 from '@carbon/icons-vue/es/warning--filled/16';
122
125
  import ChevronDown16 from '@carbon/icons-vue/es/chevron--down/16';
123
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
124
126
  import clickout from '../../directives/clickout';
125
127
 
126
128
  export default {
@@ -171,7 +173,7 @@ export default {
171
173
  this.updateChildren(this.internalValue);
172
174
  this.checkSlots();
173
175
  },
174
- beforeUpdate() {
176
+ updated() {
175
177
  document.body.removeEventListener('click', this.checkSlots);
176
178
  this.checkSlots();
177
179
  },
@@ -252,7 +254,7 @@ export default {
252
254
  }
253
255
  },
254
256
  checkSlots() {
255
- // NOTE: this.$slots is not reactive so needs to be managed on beforeUpdate
257
+ // NOTE: this.$slots is not reactive so needs to be managed on updated
256
258
  this.isInvalid = !!(this.$slots['invalid-message'] || (this.invalidMessage && this.invalidMessage.length));
257
259
  this.isHelper = !!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
258
260
  },
@@ -20,7 +20,7 @@
20
20
  </template>
21
21
 
22
22
  <script>
23
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
23
+ import { carbonPrefixMixin } from '../../mixins';
24
24
  const feedbackPhases = {
25
25
  DEFAULT: 0,
26
26
  FADE_IN: 1,
@@ -9,7 +9,7 @@
9
9
  <script>
10
10
  import CvSkeletonText from '../cv-skeleton-text/cv-skeleton-text';
11
11
  import CvButtonSkeleton from '../cv-button/cv-button-skeleton';
12
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
12
+ import { carbonPrefixMixin } from '../../mixins';
13
13
 
14
14
  export default {
15
15
  name: 'CvFileUploaderSkeleton',
@@ -110,15 +110,13 @@
110
110
  </template>
111
111
 
112
112
  <script>
113
- import uidMixin from '../../mixins/uid-mixin';
113
+ import { uidMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
114
114
  import CvFormItem from '../cv-form/cv-form-item';
115
115
  import CheckmarkFilled16 from '@carbon/icons-vue/es/checkmark--filled/16';
116
116
  import WarningFilled16 from '@carbon/icons-vue/es/warning--filled/16';
117
117
  import Close16 from '@carbon/icons-vue/es/close/16';
118
118
  import CvWrapper from '../cv-wrapper/_cv-wrapper';
119
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
120
119
  import { STATES, KINDS } from './consts.js';
121
- import methodsMixin from '../../mixins/methods-mixin';
122
120
 
123
121
  export default {
124
122
  name: 'CvFileUploader',
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script>
11
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
11
+ import { carbonPrefixMixin } from '../../mixins';
12
12
  export default {
13
13
  name: 'CvFormGroup',
14
14
  mixins: [carbonPrefixMixin],
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
8
+ import { carbonPrefixMixin } from '../../mixins';
9
9
  export default {
10
10
  name: 'CvFormItem',
11
11
  mixins: [carbonPrefixMixin],
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
8
+ import { carbonPrefixMixin } from '../../mixins';
9
9
  export default {
10
10
  name: 'CvForm',
11
11
  mixins: [carbonPrefixMixin],
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <div class="cv-column" :class="classes">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
9
+
10
+ const breakpointProp = {
11
+ type: [Boolean, Number, Object],
12
+ validator: value => {
13
+ if (typeof value === 'number' || typeof value === 'boolean') {
14
+ return true;
15
+ } else if (typeof value === 'object') {
16
+ return 'span' in value && typeof value.span === 'number' && 'offset' in value && typeof value.offset === 'number';
17
+ }
18
+
19
+ return false;
20
+ },
21
+ };
22
+
23
+ export default {
24
+ name: 'CvColumn',
25
+ mixins: [carbonPrefixMixin],
26
+ props: {
27
+ sm: breakpointProp,
28
+ md: breakpointProp,
29
+ lg: breakpointProp,
30
+ xlg: breakpointProp,
31
+ max: breakpointProp,
32
+ },
33
+ computed: {
34
+ classes() {
35
+ const classnames = [];
36
+
37
+ const breakpoints = [
38
+ { name: 'sm', value: this.sm },
39
+ { name: 'md', value: this.md },
40
+ { name: 'lg', value: this.lg },
41
+ { name: 'xlg', value: this.xlg },
42
+ { name: 'max', value: this.max },
43
+ ].filter(breakpoint => breakpoint.value !== false);
44
+
45
+ for (let i = 0; i < breakpoints.length; i += 1) {
46
+ const { name, value } = breakpoints[i];
47
+
48
+ if (typeof value === 'boolean') {
49
+ // auto-column
50
+ classnames.push(`${this.carbonPrefix}--col-${name}`);
51
+ } else if (typeof value === 'number') {
52
+ classnames.push(`${this.carbonPrefix}--col-${name}-${value}`);
53
+ } else {
54
+ const { span, offset } = value;
55
+
56
+ if (typeof span === 'boolean') {
57
+ classnames.push(`${this.carbonPrefix}--col-${name}`);
58
+ } else if (typeof span === 'number') {
59
+ classnames.push(`${this.carbonPrefix}--col-${name}-${span}`);
60
+ }
61
+
62
+ if (typeof offset === 'number') {
63
+ classnames.push(`${this.carbonPrefix}--offset-${name}-${offset}`);
64
+ }
65
+ }
66
+ }
67
+
68
+ if (classnames.length === 0) {
69
+ // no breakpoints were defined. use auto-column
70
+ classnames.push(`${this.carbonPrefix}--col`);
71
+ }
72
+
73
+ return classnames;
74
+ },
75
+ },
76
+ };
77
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div
3
+ class="cv-grid"
4
+ :class="[
5
+ `${carbonPrefix}--grid`,
6
+ {
7
+ [`${carbonPrefix}--grid--full-width`]: fullWidth,
8
+ [`${carbonPrefix}--grid--condensed`]: kind === 'condensed',
9
+ [`${carbonPrefix}--grid--narrow`]: kind === 'narrow',
10
+ },
11
+ ]"
12
+ >
13
+ <slot></slot>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
19
+
20
+ export default {
21
+ name: 'CvGrid',
22
+ mixins: [carbonPrefixMixin],
23
+ props: {
24
+ fullWidth: Boolean,
25
+ kind: {
26
+ type: String,
27
+ default: 'wide',
28
+ validator: val => ['wide', 'narrow', 'condensed'].includes(val),
29
+ },
30
+ },
31
+ };
32
+ </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div
3
+ class="cv-row"
4
+ :class="[
5
+ `${carbonPrefix}--row`,
6
+ {
7
+ [`${carbonPrefix}--row--condensed`]: kind === 'condensed',
8
+ [`${carbonPrefix}--row--narrow`]: kind === 'narrow',
9
+ },
10
+ ]"
11
+ >
12
+ <slot></slot>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
18
+
19
+ export default {
20
+ name: 'CvRow',
21
+ mixins: [carbonPrefixMixin],
22
+ props: {
23
+ kind: {
24
+ type: String,
25
+ default: 'wide',
26
+ validator: val => ['wide', 'narrow', 'condensed'].includes(val),
27
+ },
28
+ },
29
+ };
30
+ </script>
@@ -0,0 +1,5 @@
1
+ import CvGrid from './cv-grid';
2
+ import CvRow from './cv-row';
3
+ import CvColumn from './cv-column';
4
+
5
+ export { CvGrid, CvRow, CvColumn };
@@ -29,7 +29,7 @@
29
29
  import { STATES } from './consts';
30
30
  import ErrorFilled16 from '@carbon/icons-vue/lib/error--filled/16';
31
31
  import CheckmarkFilled16 from '@carbon/icons-vue/lib/checkmark--filled/16';
32
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
32
+ import { carbonPrefixMixin } from '../../mixins';
33
33
 
34
34
  export default {
35
35
  name: 'CvInlineLoading',
@@ -17,7 +17,7 @@
17
17
  <component :is="icon" :class="`${carbonPrefix}--inline-notification__icon`" />
18
18
  <div :class="`${carbonPrefix}--inline-notification__text-wrapper`">
19
19
  <p :class="`${carbonPrefix}--inline-notification__title`">{{ title }}</p>
20
- <p :class="`${carbonPrefix}--inline-notification__subtitle`">{{ subTitle }}</p>
20
+ <p :class="`${carbonPrefix}--inline-notification__subtitle`" v-html="subTitle"></p>
21
21
  </div>
22
22
  </div>
23
23
  <button
@@ -46,13 +46,12 @@
46
46
  </template>
47
47
 
48
48
  <script>
49
- import notificationMixin from '../../mixins/notification-mixin';
49
+ import { notificationMixin, carbonPrefixMixin } from '../../mixins';
50
50
  import ErrorFilled20 from '@carbon/icons-vue/es/error--filled/20';
51
51
  import CheckmarkFilled20 from '@carbon/icons-vue/es/checkmark--filled/20';
52
52
  import WarningFilled20 from '@carbon/icons-vue/es/warning--filled/20';
53
53
  import Close20 from '@carbon/icons-vue/es/close/20';
54
54
  import InformationFilled20 from '@carbon/icons-vue/es/information--filled/20';
55
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
56
55
 
57
56
  export default {
58
57
  name: 'CvInlineNotification',
@@ -11,12 +11,11 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import LinkMixin from '../../mixins/link-mixin';
15
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
14
+ import { linkMixin, carbonPrefixMixin } from '../../mixins';
16
15
 
17
16
  export default {
18
17
  name: 'CvLink',
19
- mixins: [LinkMixin, carbonPrefixMixin],
18
+ mixins: [linkMixin, carbonPrefixMixin],
20
19
  props: {
21
20
  inline: Boolean,
22
21
  },
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
8
+ import { carbonPrefixMixin } from '../../mixins';
9
9
  export default {
10
10
  name: 'CvListItem',
11
11
  mixins: [carbonPrefixMixin],
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
17
+ import { carbonPrefixMixin } from '../../mixins';
18
18
  export default {
19
19
  name: 'CvList',
20
20
  mixins: [carbonPrefixMixin],
@@ -21,7 +21,7 @@
21
21
 
22
22
  <script>
23
23
  import CvWrapper from '../cv-wrapper/_cv-wrapper';
24
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
24
+ import { carbonPrefixMixin } from '../../mixins';
25
25
 
26
26
  export default {
27
27
  name: 'CvLoading',
@@ -81,9 +81,8 @@
81
81
 
82
82
  <script>
83
83
  import CvButton from '../cv-button/cv-button';
84
- import uidMixin from '../../mixins/uid-mixin';
84
+ import { uidMixin, carbonPrefixMixin } from '../../mixins';
85
85
  import Close16 from '@carbon/icons-vue/es/close/16';
86
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
87
86
 
88
87
  export default {
89
88
  name: 'CvModal',
@@ -121,7 +120,7 @@ export default {
121
120
  }
122
121
  this.checkSlots();
123
122
  },
124
- beforeUpdate() {
123
+ updated() {
125
124
  this.checkSlots();
126
125
  },
127
126
  watch: {
@@ -163,7 +162,7 @@ export default {
163
162
  },
164
163
  methods: {
165
164
  checkSlots() {
166
- // NOTE: this.$slots is not reactive so needs to be managed on beforeUpdate
165
+ // NOTE: this.$slots is not reactive so needs to be managed on updated
167
166
  this.hasFooter = !!(this.$slots['primary-button'] || this.$slots['secondary-button']);
168
167
  this.hasHeaderLabel = !!this.$slots.label;
169
168
  this.hasSecondary = !!this.$slots['secondary-button'];
@@ -151,15 +151,12 @@
151
151
  </template>
152
152
 
153
153
  <script>
154
- import themeMixin from '../../mixins/theme-mixin';
154
+ import { themeMixin, uidMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
155
155
  import WarningFilled16 from '@carbon/icons-vue/es/warning--filled/16';
156
156
  import ChevronDown16 from '@carbon/icons-vue/es/chevron--down/16';
157
157
  import Close16 from '@carbon/icons-vue/es/close/16';
158
- import uidMixin from '../../mixins/uid-mixin';
159
158
  import CvCheckbox from '../cv-checkbox/cv-checkbox';
160
159
  import CvTag from '../cv-tag/cv-tag';
161
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
162
- import methodsMixin from '../../mixins/methods-mixin';
163
160
 
164
161
  const TOP_AFTER_REOPEN = 0;
165
162
  const TOP = 1;
@@ -252,7 +249,7 @@ export default {
252
249
  this.highlighted = this.value ? this.value : this.highlight; // override highlight with value if provided
253
250
  this.checkSlots();
254
251
  },
255
- beforeUpdate() {
252
+ updated() {
256
253
  this.checkSlots();
257
254
  },
258
255
  computed: {
@@ -292,7 +289,7 @@ export default {
292
289
  },
293
290
  methods: {
294
291
  checkSlots() {
295
- // NOTE: this.$slots is not reactive so needs to be managed on beforeUpdate
292
+ // NOTE: this.$slots is not reactive so needs to be managed on updated
296
293
  this.isInvalid = !!(this.$slots['invalid-message'] || (this.invalidMessage && this.invalidMessage.length));
297
294
  this.isHelper = !!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
298
295
  },
@@ -6,7 +6,7 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
9
+ import { carbonPrefixMixin } from '../../mixins';
10
10
  export default {
11
11
  name: 'CvNumberInputSkeleton',
12
12
  mixins: [carbonPrefixMixin],
@@ -83,14 +83,11 @@
83
83
  </template>
84
84
 
85
85
  <script>
86
- import uidMixin from '../../mixins/uid-mixin';
87
- import themeMixin from '../../mixins/theme-mixin';
86
+ import { uidMixin, themeMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
88
87
  import CaretDownGlyph from '@carbon/icons-vue/es/caret--down/index';
89
88
  import CaretUpGlyph from '@carbon/icons-vue/es/caret--up/index';
90
89
  import WarningFilled16 from '@carbon/icons-vue/es/warning--filled/16';
91
90
  import CvWrapper from '../cv-wrapper/_cv-wrapper';
92
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
93
- import methodsMixin from '../../mixins/methods-mixin';
94
91
 
95
92
  export default {
96
93
  name: 'CvNumberInput',
@@ -132,7 +129,7 @@ export default {
132
129
  this.internalValue = this.valueAsString(this.value);
133
130
  this.checkSlots();
134
131
  },
135
- beforeUpdate() {
132
+ updated() {
136
133
  this.checkSlots();
137
134
  },
138
135
  watch: {
@@ -162,7 +159,7 @@ export default {
162
159
  this.emitValue();
163
160
  },
164
161
  checkSlots() {
165
- // NOTE: this.$slots is not reactive so needs to be managed on beforeUpdate
162
+ // NOTE: this.$slots is not reactive so needs to be managed on updated
166
163
  this.isInvalid = !!(this.$slots['invalid-message'] || (this.invalidMessage && this.invalidMessage.length));
167
164
  this.isHelper = !!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
168
165
  },
@@ -25,7 +25,7 @@
25
25
  </template>
26
26
 
27
27
  <script>
28
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
28
+ import { carbonPrefixMixin } from '../../mixins';
29
29
  export default {
30
30
  name: 'CvOverflowMenuItem',
31
31
  mixins: [carbonPrefixMixin],
@@ -67,9 +67,7 @@
67
67
 
68
68
  <script>
69
69
  import OverflowMenuVertical16 from '@carbon/icons-vue/es/overflow-menu--vertical/16';
70
- import uidMixin from '../../mixins/uid-mixin';
71
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
72
- import methodsMixin from '../../mixins/methods-mixin';
70
+ import { uidMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
73
71
 
74
72
  export default {
75
73
  name: 'CvOverflowMenu',
@@ -83,7 +83,7 @@ import CvSelect from '../cv-select/cv-select';
83
83
  import CvSelectOption from '../cv-select/cv-select-option';
84
84
  import CaretLeft16 from '@carbon/icons-vue/es/caret--left/16';
85
85
  import CaretRight16 from '@carbon/icons-vue/es/caret--right/16';
86
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
86
+ import { carbonPrefixMixin } from '../../mixins';
87
87
 
88
88
  const newPageValue = (page, lastPage) => {
89
89
  let result = 1;
@@ -43,7 +43,7 @@
43
43
  <script>
44
44
  import CheckmarkOutline16 from '@carbon/icons-vue/es/checkmark--outline/16';
45
45
  import Warning16 from '@carbon/icons-vue/es/warning/16';
46
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
46
+ import { carbonPrefixMixin } from '../../mixins';
47
47
 
48
48
  const states = ['incomplete', 'current', 'complete'];
49
49
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  <script>
20
20
  import CvProgressStep from './cv-progress-step';
21
- import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
21
+ import { carbonPrefixMixin } from '../../mixins';
22
22
 
23
23
  export default {
24
24
  name: 'CvProgress',