@carbon/vue 2.34.0-canary.0 → 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.
- package/CHANGELOG.md +29 -0
- package/README.md +25 -18
- package/dist/carbon-vue.common.js +2649 -2113
- package/dist/carbon-vue.common.js.map +1 -1
- package/dist/carbon-vue.umd.js +2649 -2113
- package/dist/carbon-vue.umd.js.map +1 -1
- package/dist/carbon-vue.umd.min.js +3 -3
- package/dist/carbon-vue.umd.min.js.map +1 -1
- package/package.json +6 -6
- package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +1 -1
- package/src/components/cv-accordion/cv-accordion-item.vue +5 -4
- package/src/components/cv-accordion/cv-accordion-skeleton.vue +18 -2
- package/src/components/cv-accordion/cv-accordion.vue +19 -2
- package/src/components/cv-breadcrumb/_cv-breadcrumb-item-skeleton.vue +1 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +1 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +1 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb.vue +1 -1
- package/src/components/cv-button/button-mixin.js +12 -7
- package/src/components/cv-button/cv-button-set.vue +5 -2
- package/src/components/cv-button/cv-button.vue +1 -1
- package/src/components/cv-button/cv-icon-button.vue +2 -2
- package/src/components/cv-checkbox/cv-checkbox-skeleton.vue +1 -1
- package/src/components/cv-checkbox/cv-checkbox.vue +1 -4
- package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +13 -8
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +13 -8
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +10 -12
- package/src/components/cv-code-snippet/cv-code-snippet-skeleton.vue +1 -1
- package/src/components/cv-code-snippet/cv-code-snippet.vue +17 -1
- package/src/components/cv-combo-box/cv-combo-box.vue +2 -5
- package/src/components/cv-content-switcher/cv-content-switcher-button.vue +1 -2
- package/src/components/cv-content-switcher/cv-content-switcher.vue +20 -3
- package/src/components/cv-data-table/_cv-data-table-row-inner.vue +1 -1
- package/src/components/cv-data-table/cv-data-table-action.vue +1 -1
- package/src/components/cv-data-table/cv-data-table-heading.vue +1 -2
- package/src/components/cv-data-table/cv-data-table-row.vue +1 -2
- package/src/components/cv-data-table/cv-data-table.vue +2 -4
- package/src/components/cv-date-picker/cv-date-picker.vue +36 -14
- package/src/components/cv-date-picker/plugins/appendToPlugin.js +52 -0
- package/src/components/cv-date-picker/plugins/fixEventsPlugin.js +75 -0
- package/src/components/cv-date-picker/plugins/monthSelectPlugin.js +66 -0
- package/src/components/cv-date-picker/plugins/rangePlugin.js +45 -0
- package/src/components/cv-dropdown/cv-dropdown-item.vue +1 -1
- package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +1 -1
- package/src/components/cv-dropdown/cv-dropdown.vue +9 -7
- package/src/components/cv-feedback-button/_cv-feedback-button.vue +1 -1
- package/src/components/cv-file-uploader/cv-file-uploader-skeleton.vue +1 -1
- package/src/components/cv-file-uploader/cv-file-uploader.vue +1 -3
- package/src/components/cv-form/cv-form-group.vue +1 -1
- package/src/components/cv-form/cv-form-item.vue +1 -1
- package/src/components/cv-form/cv-form.vue +1 -1
- package/src/components/cv-grid/cv-column.vue +77 -0
- package/src/components/cv-grid/cv-grid.vue +32 -0
- package/src/components/cv-grid/cv-row.vue +30 -0
- package/src/components/cv-grid/index.js +5 -0
- package/src/components/cv-inline-loading/cv-inline-loading.vue +1 -1
- package/src/components/cv-inline-notification/cv-inline-notification.vue +2 -3
- package/src/components/cv-link/cv-link.vue +2 -3
- package/src/components/cv-list/cv-list-item.vue +1 -1
- package/src/components/cv-list/cv-list.vue +1 -1
- package/src/components/cv-loading/cv-loading.vue +6 -2
- package/src/components/cv-modal/cv-modal.vue +29 -2
- package/src/components/cv-multi-select/cv-multi-select.vue +8 -12
- package/src/components/cv-number-input/cv-number-input-skeleton.vue +1 -1
- package/src/components/cv-number-input/cv-number-input.vue +2 -5
- package/src/components/cv-overflow-menu/cv-overflow-menu-item.vue +1 -1
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +1 -3
- package/src/components/cv-pagination/cv-pagination.vue +1 -1
- package/src/components/cv-progress/cv-progress-step.vue +1 -1
- package/src/components/cv-progress/cv-progress.vue +1 -1
- package/src/components/cv-radio-button/cv-radio-button.vue +1 -4
- package/src/components/cv-radio-button/cv-radio-group.vue +1 -1
- package/src/components/cv-search/cv-search.vue +2 -5
- package/src/components/cv-select/cv-select-optgroup.vue +1 -1
- package/src/components/cv-select/cv-select-option.vue +1 -1
- package/src/components/cv-select/cv-select.vue +2 -5
- package/src/components/cv-skeleton-text/cv-skeleton-text.vue +1 -1
- package/src/components/cv-slider/cv-slider-skeleton.vue +1 -1
- package/src/components/cv-slider/cv-slider.vue +2 -5
- package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +1 -4
- package/src/components/cv-structured-list/_cv-structured-list-item-standard.vue +1 -1
- package/src/components/cv-structured-list/cv-structured-list-data.vue +1 -1
- package/src/components/cv-structured-list/cv-structured-list-heading.vue +1 -1
- package/src/components/cv-structured-list/cv-structured-list.vue +1 -1
- package/src/components/cv-tabs/cv-tab.vue +1 -1
- package/src/components/cv-tabs/cv-tabs-skeleton.vue +1 -1
- package/src/components/cv-tabs/cv-tabs.vue +1 -1
- package/src/components/cv-tag/cv-tag-skeleton.vue +1 -1
- package/src/components/cv-tag/cv-tag.vue +1 -2
- package/src/components/cv-text-area/cv-text-area.vue +2 -5
- package/src/components/cv-text-input/cv-text-input.vue +2 -6
- package/src/components/cv-tile/_cv-tile-clickable.vue +2 -4
- package/src/components/cv-tile/_cv-tile-expandable.vue +1 -2
- package/src/components/cv-tile/_cv-tile-selectable.vue +1 -4
- package/src/components/cv-tile/cv-tile.vue +2 -4
- package/src/components/cv-time-picker/cv-time-picker.vue +3 -6
- package/src/components/cv-toast-notification/cv-toast-notification.vue +3 -4
- package/src/components/cv-toggle/cv-toggle-skeleton.vue +1 -2
- package/src/components/cv-toggle/cv-toggle.vue +1 -4
- package/src/components/cv-toolbar/cv-toolbar-divider.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar-option.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar-search.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar-title.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar.vue +1 -1
- package/src/components/cv-tooltip/cv-definition-tooltip.vue +1 -2
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +1 -2
- package/src/components/cv-tooltip/cv-tooltip.vue +1 -1
- package/src/components/cv-ui-shell/_cv-side-nav-footer.vue +1 -1
- package/src/components/cv-ui-shell/_cv-side-nav-link-text.vue +1 -1
- package/src/components/cv-ui-shell/cv-content.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-global-action.vue +1 -2
- package/src/components/cv-ui-shell/cv-header-menu-button.vue +1 -2
- package/src/components/cv-ui-shell/cv-header-menu-item.vue +2 -3
- package/src/components/cv-ui-shell/cv-header-menu.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-name.vue +2 -3
- package/src/components/cv-ui-shell/cv-header-nav.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-panel.vue +2 -2
- package/src/components/cv-ui-shell/cv-header-side-nav-items.vue +1 -1
- package/src/components/cv-ui-shell/cv-header.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav-icon.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav-items.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav-link.vue +2 -3
- package/src/components/cv-ui-shell/cv-side-nav-menu-item.vue +2 -3
- package/src/components/cv-ui-shell/cv-side-nav-menu.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav.vue +2 -2
- package/src/components/cv-ui-shell/cv-skip-to-content.vue +2 -3
- package/src/components/cv-ui-shell/cv-switcher-item-link.vue +2 -3
- package/src/components/cv-ui-shell/cv-switcher-item.vue +1 -1
- package/src/components/cv-ui-shell/cv-switcher.vue +1 -1
- package/src/directives/clickout.js +21 -9
- package/src/index.js +2 -0
- package/src/mixins/index.js +12 -0
- 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.
|
|
4
|
+
"version": "2.35.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
},
|
|
64
64
|
"sideEffects": true,
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@carbon/icons-vue": "10.
|
|
67
|
-
"carbon-components": "10.
|
|
66
|
+
"@carbon/icons-vue": "10.20.0",
|
|
67
|
+
"carbon-components": "10.23.1",
|
|
68
68
|
"flatpickr": "4.6.3",
|
|
69
|
-
"vue": "^2.6.
|
|
69
|
+
"vue": "^2.6.12"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@vue/cli-service": "^3.11.0",
|
|
73
73
|
"eslint-plugin-prettier": "^3.1.1",
|
|
74
|
-
"vue-template-compiler": "^2.6.
|
|
74
|
+
"vue-template-compiler": "^2.6.12"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "08825d15ce4b9a73e30bc8809b0e2185e80fd2b8"
|
|
77
77
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<script>
|
|
14
14
|
import CvSkeletonText from '../cv-skeleton-text/cv-skeleton-text';
|
|
15
15
|
import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
|
|
16
|
-
import carbonPrefixMixin from '../../mixins
|
|
16
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
name: 'CvAccordionItemSkeleton',
|
|
@@ -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`"
|
|
@@ -39,15 +42,13 @@
|
|
|
39
42
|
|
|
40
43
|
<script>
|
|
41
44
|
import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
|
|
42
|
-
import uidMixin from '../../mixins
|
|
43
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
44
|
-
import methodsMixin from '../../mixins/methods-mixin';
|
|
45
|
-
|
|
45
|
+
import { uidMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
46
46
|
export default {
|
|
47
47
|
name: 'CvAccordionItem',
|
|
48
48
|
mixins: [uidMixin, carbonPrefixMixin, methodsMixin({ button: ['blur', 'focus'] })],
|
|
49
49
|
components: { ChevronRight16 },
|
|
50
50
|
props: {
|
|
51
|
+
disabled: Boolean,
|
|
51
52
|
open: { type: Boolean, default: false },
|
|
52
53
|
},
|
|
53
54
|
watch: {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ul
|
|
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>
|
|
@@ -14,10 +22,18 @@
|
|
|
14
22
|
<script>
|
|
15
23
|
import CvSkeletonText from '../cv-skeleton-text/cv-skeleton-text';
|
|
16
24
|
import CvAccordionItemSkeleton from './_cv-accordion-item-skeleton';
|
|
17
|
-
import carbonPrefixMixin from '../../mixins
|
|
25
|
+
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,14 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ul
|
|
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>
|
|
6
15
|
|
|
7
16
|
<script>
|
|
8
|
-
import carbonPrefixMixin from '../../mixins
|
|
17
|
+
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));
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
10
|
import CvBreadcrumbItemSkeleton from './_cv-breadcrumb-item-skeleton';
|
|
11
|
-
import carbonPrefixMixin from '../../mixins
|
|
11
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
name: 'CvBreadcrumbSkeleton',
|
|
@@ -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: {
|
|
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
|
-
|
|
68
|
-
|
|
71
|
+
let size = this.size ? this.size : this.small && 'sm';
|
|
72
|
+
if (size === 'small') {
|
|
73
|
+
size = 'sm';
|
|
69
74
|
}
|
|
70
|
-
if (
|
|
71
|
-
classes.push(`${carbonSettings.prefix}--btn
|
|
75
|
+
if (size && !(size === '' || size === 'default')) {
|
|
76
|
+
classes.push(`${carbonSettings.prefix}--btn--${size}`);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
return classes
|
|
79
|
+
return classes;
|
|
75
80
|
};
|
|
76
81
|
},
|
|
77
82
|
},
|
|
@@ -1,14 +1,17 @@
|
|
|
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>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
import carbonPrefixMixin from '../../mixins
|
|
8
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
9
9
|
|
|
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'}`,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
21
|
import buttonMixin from './button-mixin';
|
|
22
|
-
import carbonPrefixMixin from '../../mixins
|
|
22
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
23
23
|
import CvSvg from '../cv-svg/_cv-svg';
|
|
24
24
|
|
|
25
25
|
export default {
|
|
@@ -33,10 +33,7 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script>
|
|
36
|
-
import checkMixin from '../../mixins
|
|
37
|
-
import uidMixin from '../../mixins/uid-mixin';
|
|
38
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
39
|
-
import methodsMixin from '../../mixins/methods-mixin';
|
|
36
|
+
import { checkMixin, uidMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
40
37
|
|
|
41
38
|
export default {
|
|
42
39
|
name: 'CvCheckbox',
|
|
@@ -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,22 +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
|
|
21
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
20
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
22
21
|
|
|
23
22
|
export default {
|
|
24
23
|
name: 'CvCodeSnippetInline',
|
|
25
|
-
mixins: [
|
|
24
|
+
mixins: [carbonPrefixMixin],
|
|
26
25
|
components: {
|
|
27
26
|
CvFeedbackButton,
|
|
28
27
|
},
|
|
29
28
|
props: {
|
|
30
29
|
copyFeedback: String,
|
|
31
30
|
feedbackAriaLabel: String,
|
|
31
|
+
hideCopyButton: Boolean,
|
|
32
|
+
},
|
|
33
|
+
computed: {
|
|
34
|
+
classes() {
|
|
35
|
+
return [`${this.carbonPrefix}--snippet`, `${this.carbonPrefix}--snippet--inline`];
|
|
36
|
+
},
|
|
32
37
|
},
|
|
33
38
|
};
|
|
34
39
|
</script>
|
|
@@ -4,16 +4,21 @@
|
|
|
4
4
|
:class="[
|
|
5
5
|
`${carbonPrefix}--snippet`,
|
|
6
6
|
`${carbonPrefix}--snippet--multi`,
|
|
7
|
-
{ [`${carbonPrefix}--snippet--expand`]: expanded
|
|
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
|
|
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,12 +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 from '../../mixins
|
|
40
|
-
import themeMixin from '../../mixins/theme-mixin';
|
|
44
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
41
45
|
|
|
42
46
|
export default {
|
|
43
47
|
name: 'CvCodeSnippetMultiline',
|
|
44
|
-
mixins: [
|
|
48
|
+
mixins: [carbonPrefixMixin],
|
|
45
49
|
components: {
|
|
46
50
|
CvButton,
|
|
47
51
|
CvFeedbackButton,
|
|
@@ -49,10 +53,11 @@ export default {
|
|
|
49
53
|
ChevronDown16,
|
|
50
54
|
},
|
|
51
55
|
props: {
|
|
56
|
+
copyFeedback: String,
|
|
57
|
+
feedbackAriaLabel: String,
|
|
58
|
+
hideCopyButton: Boolean,
|
|
52
59
|
lessText: { type: String, default: 'Show less' },
|
|
53
60
|
moreText: { type: String, default: 'Show more' },
|
|
54
|
-
feedbackAriaLabel: String,
|
|
55
|
-
copyFeedback: String,
|
|
56
61
|
},
|
|
57
62
|
data() {
|
|
58
63
|
return {
|
|
@@ -1,32 +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
|
|
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
|
|
23
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
20
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
24
21
|
import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
|
|
25
22
|
import Copy16 from '@carbon/icons-vue/es/copy/16';
|
|
26
23
|
|
|
27
24
|
export default {
|
|
28
25
|
name: 'CvCodeSnippetOneline',
|
|
29
|
-
mixins: [
|
|
26
|
+
mixins: [carbonPrefixMixin],
|
|
30
27
|
components: {
|
|
31
28
|
CvFeedbackButton,
|
|
32
29
|
Copy16,
|
|
@@ -34,6 +31,7 @@ export default {
|
|
|
34
31
|
props: {
|
|
35
32
|
copyFeedback: String,
|
|
36
33
|
feedbackAriaLabel: String,
|
|
34
|
+
hideCopyButton: Boolean,
|
|
37
35
|
},
|
|
38
36
|
};
|
|
39
37
|
</script>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
class="
|
|
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`]:
|
|
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,
|
|
@@ -113,13 +113,10 @@
|
|
|
113
113
|
</template>
|
|
114
114
|
|
|
115
115
|
<script>
|
|
116
|
-
import themeMixin from '../../mixins
|
|
116
|
+
import { themeMixin, uidMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
117
117
|
import WarningFilled16 from '@carbon/icons-vue/es/warning--filled/16';
|
|
118
118
|
import ChevronDown16 from '@carbon/icons-vue/es/chevron--down/16';
|
|
119
119
|
import Close16 from '@carbon/icons-vue/es/close/16';
|
|
120
|
-
import uidMixin from '../../mixins/uid-mixin';
|
|
121
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
122
|
-
import methodsMixin from '../../mixins/methods-mixin';
|
|
123
120
|
|
|
124
121
|
export default {
|
|
125
122
|
name: 'CvComboBox',
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script>
|
|
37
|
-
import uidMixin from '../../mixins
|
|
37
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
38
38
|
import CvSvg from '../cv-svg/_cv-svg';
|
|
39
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
40
39
|
|
|
41
40
|
export default {
|
|
42
41
|
name: 'CvContentSwitcherButton',
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
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,
|
|
@@ -54,7 +54,7 @@ import CvCheckbox from '../cv-checkbox/cv-checkbox';
|
|
|
54
54
|
import CvOverflowMenu from '../cv-overflow-menu/cv-overflow-menu';
|
|
55
55
|
import CvOverflowMenuItem from '../cv-overflow-menu/cv-overflow-menu-item';
|
|
56
56
|
import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
|
|
57
|
-
import carbonPrefixMixin from '../../mixins
|
|
57
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
58
58
|
|
|
59
59
|
export default {
|
|
60
60
|
name: 'CvDataTableRowInner',
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
import ArrowDown16 from '@carbon/icons-vue/es/arrow--down/16';
|
|
31
31
|
import Arrows16 from '@carbon/icons-vue/es/arrows/16';
|
|
32
32
|
import CvWrapper from '../cv-wrapper/_cv-wrapper';
|
|
33
|
-
import uidMixin from '../../mixins
|
|
34
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
33
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
35
34
|
|
|
36
35
|
const nextOrder = {
|
|
37
36
|
ascending: 'descending',
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
32
|
import CvDataTableRowInner from './_cv-data-table-row-inner';
|
|
33
|
-
import uidMixin from '../../mixins
|
|
34
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
33
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
35
34
|
|
|
36
35
|
export default {
|
|
37
36
|
name: 'CvDataTableRow',
|