@carbon/vue 2.27.0-canary.0 → 2.28.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 +34 -2
- package/dist/carbon-vue.common.js +533 -297
- package/dist/carbon-vue.common.js.map +1 -1
- package/dist/carbon-vue.umd.js +533 -297
- package/dist/carbon-vue.umd.js.map +1 -1
- package/dist/carbon-vue.umd.min.js +4 -4
- package/dist/carbon-vue.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/assets/images/example-icon-svg.js +10 -0
- package/src/assets/images/example-icon.svg +6 -0
- package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +16 -5
- package/src/components/cv-accordion/cv-accordion-item.vue +12 -15
- package/src/components/cv-accordion/cv-accordion-skeleton.vue +3 -1
- package/src/components/cv-accordion/cv-accordion.vue +4 -1
- package/src/components/cv-breadcrumb/_cv-breadcrumb-item-skeleton.vue +4 -2
- package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +10 -5
- package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +3 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb.vue +12 -5
- package/src/components/cv-button/cv-button.vue +3 -4
- package/src/components/cv-button/cv-icon-button.vue +3 -4
- package/src/components/cv-checkbox/cv-checkbox-skeleton.vue +4 -2
- package/src/components/cv-checkbox/cv-checkbox.vue +32 -11
- package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +1 -1
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +1 -1
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +1 -1
- package/src/components/cv-combo-box/cv-combo-box.vue +18 -7
- package/src/components/cv-content-switcher/cv-content-switcher-button.vue +4 -5
- package/src/components/cv-data-table/_cv-data-table-row-inner.vue +10 -2
- package/src/components/cv-data-table/cv-data-table.vue +1 -1
- package/src/components/cv-dropdown/cv-dropdown.vue +23 -8
- package/src/components/{cv-code-snippet → cv-feedback-button}/_cv-feedback-button.vue +2 -0
- package/src/components/cv-form/cv-form.vue +1 -1
- package/src/components/cv-inline-loading/cv-inline-loading.vue +20 -14
- package/src/components/cv-link/cv-link.vue +12 -8
- package/src/components/cv-multi-select/cv-multi-select.vue +2 -2
- package/src/components/cv-number-input/cv-number-input-skeleton.vue +5 -3
- package/src/components/cv-number-input/cv-number-input.vue +32 -23
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +1 -1
- package/src/components/cv-svg/_cv-svg.vue +41 -0
- package/src/components/cv-tabs/cv-tab.vue +1 -1
- package/src/components/cv-tabs/cv-tabs.vue +1 -1
- package/src/components/cv-tag/cv-tag.vue +7 -1
- package/src/components/cv-text-area/cv-text-area.vue +6 -0
- package/src/components/cv-text-input/cv-text-input.vue +5 -0
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-global-action.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-menu-button.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-panel.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav.vue +1 -1
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.28.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"clean": "rimraf dist node_modules/.cache"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
62
|
+
"node": ">=10.x"
|
|
63
63
|
},
|
|
64
64
|
"sideEffects": true,
|
|
65
65
|
"dependencies": {
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"eslint-plugin-prettier": "^3.1.1",
|
|
74
74
|
"vue-template-compiler": "^2.6.10"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "e0141cdee45e0c910fbb10ac5c665b736712d99f"
|
|
77
77
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
exampleSvgString: `
|
|
3
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="root">
|
|
5
|
+
<g fill-rule="evenodd" id="g">
|
|
6
|
+
<path id="path" d="M7 7H4v2h3v3h2V9h3V7H9V4H7v3zm1 9A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
9
|
+
`,
|
|
10
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<li
|
|
3
|
-
<button disabled type="button" class="
|
|
4
|
-
<ChevronRight16 class="
|
|
5
|
-
<cv-skeleton-text class="
|
|
2
|
+
<li :class="itemClasses">
|
|
3
|
+
<button disabled type="button" :class="`${carbonPrefix}--accordion__heading`">
|
|
4
|
+
<ChevronRight16 :class="`${carbonPrefix}--accordion__arrow`" />
|
|
5
|
+
<cv-skeleton-text :class="`${carbonPrefix}--accordion__title`"></cv-skeleton-text>
|
|
6
6
|
</button>
|
|
7
|
-
<div class="
|
|
7
|
+
<div :class="`${carbonPrefix}--accordion__content`">
|
|
8
8
|
<slot></slot>
|
|
9
9
|
</div>
|
|
10
10
|
</li>
|
|
@@ -13,9 +13,11 @@
|
|
|
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/carbon-prefix-mixin';
|
|
16
17
|
|
|
17
18
|
export default {
|
|
18
19
|
name: 'CvAccordionItemSkeleton',
|
|
20
|
+
mixins: [carbonPrefixMixin],
|
|
19
21
|
components: {
|
|
20
22
|
ChevronRight16,
|
|
21
23
|
CvSkeletonText,
|
|
@@ -23,5 +25,14 @@ export default {
|
|
|
23
25
|
props: {
|
|
24
26
|
open: { type: Boolean, default: false },
|
|
25
27
|
},
|
|
28
|
+
computed: {
|
|
29
|
+
itemClasses() {
|
|
30
|
+
const classes = [`${this.carbonPrefix}--accordion__item`];
|
|
31
|
+
if (this.open) {
|
|
32
|
+
classes.push(`${this.carbonPrefix}--accordion__item--active`);
|
|
33
|
+
}
|
|
34
|
+
return classes.join(' ');
|
|
35
|
+
},
|
|
36
|
+
},
|
|
26
37
|
};
|
|
27
38
|
</script>
|
|
@@ -6,25 +6,20 @@
|
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
|
-
<li
|
|
10
|
-
data-accordion-item
|
|
11
|
-
class="cv-accordion-item bx--accordion__item"
|
|
12
|
-
:class="itemClasses"
|
|
13
|
-
@animationend="onAnimationEnd"
|
|
14
|
-
>
|
|
9
|
+
<li data-accordion-item class="cv-accordion-item" :class="itemClasses" @animationend="onAnimationEnd">
|
|
15
10
|
<button
|
|
16
11
|
type="button"
|
|
17
|
-
class="
|
|
18
|
-
:aria-expanded="
|
|
12
|
+
:class="`${carbonPrefix}--accordion__heading`"
|
|
13
|
+
:aria-expanded="dataOpen ? 'true' : 'false'"
|
|
19
14
|
:aria-controls="uid"
|
|
20
15
|
@click="toggle"
|
|
21
16
|
>
|
|
22
|
-
<ChevronRight16 class="
|
|
23
|
-
<p class="
|
|
17
|
+
<ChevronRight16 :class="`${carbonPrefix}--accordion__arrow`" />
|
|
18
|
+
<p :class="`${carbonPrefix}--accordion__title`">
|
|
24
19
|
<slot name="title"></slot>
|
|
25
20
|
</p>
|
|
26
21
|
</button>
|
|
27
|
-
<div :id="uid" class="
|
|
22
|
+
<div :id="uid" :class="`${carbonPrefix}--accordion__content`">
|
|
28
23
|
<slot name="content"></slot>
|
|
29
24
|
</div>
|
|
30
25
|
</li>
|
|
@@ -33,10 +28,11 @@
|
|
|
33
28
|
<script>
|
|
34
29
|
import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
|
|
35
30
|
import uidMixin from '../../mixins/uid-mixin';
|
|
31
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
36
32
|
|
|
37
33
|
export default {
|
|
38
34
|
name: 'CvAccordionItem',
|
|
39
|
-
mixins: [uidMixin],
|
|
35
|
+
mixins: [uidMixin, carbonPrefixMixin],
|
|
40
36
|
components: { ChevronRight16 },
|
|
41
37
|
props: {
|
|
42
38
|
open: { type: Boolean, default: false },
|
|
@@ -75,12 +71,13 @@ export default {
|
|
|
75
71
|
},
|
|
76
72
|
computed: {
|
|
77
73
|
itemClasses() {
|
|
78
|
-
const classes = [];
|
|
74
|
+
const classes = [`${this.carbonPrefix}--accordion__item`];
|
|
75
|
+
|
|
79
76
|
if (this.dataOpen) {
|
|
80
|
-
classes.push(
|
|
77
|
+
classes.push(`${this.carbonPrefix}--accordion__item--active`);
|
|
81
78
|
}
|
|
82
79
|
if (this.animation) {
|
|
83
|
-
classes.push(
|
|
80
|
+
classes.push(`${this.carbonPrefix}--accordion__item--${this.animation}`);
|
|
84
81
|
}
|
|
85
82
|
return classes.join(' ');
|
|
86
83
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ul class="
|
|
2
|
+
<ul :class="`${carbonPrefix}--accordion ${carbonPrefix}--skeleton`">
|
|
3
3
|
<cv-accordion-item-skeleton :open="true">
|
|
4
4
|
<cv-skeleton-text width="90%"></cv-skeleton-text>
|
|
5
5
|
<cv-skeleton-text width="80%"></cv-skeleton-text>
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
<script>
|
|
15
15
|
import CvSkeletonText from '../cv-skeleton-text/cv-skeleton-text';
|
|
16
16
|
import CvAccordionItemSkeleton from './_cv-accordion-item-skeleton';
|
|
17
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
17
18
|
|
|
18
19
|
export default {
|
|
19
20
|
name: 'CvAccordionSkeleton',
|
|
21
|
+
mixins: [carbonPrefixMixin],
|
|
20
22
|
components: {
|
|
21
23
|
CvSkeletonText,
|
|
22
24
|
CvAccordionItemSkeleton,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ul data-accordion class="cv-accordion
|
|
2
|
+
<ul data-accordion :class="`cv-accordion ${carbonPrefix}--accordion`">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</ul>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
9
|
+
|
|
8
10
|
export default {
|
|
9
11
|
name: 'CvAccordion',
|
|
12
|
+
mixins: [carbonPrefixMixin],
|
|
10
13
|
created() {
|
|
11
14
|
this.$on('cv:change', srcComponent => this.onCvChange(srcComponent));
|
|
12
15
|
},
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<a class="
|
|
2
|
+
<div :class="`${carbonPrefix}--breadcrumb-item`">
|
|
3
|
+
<a :class="`${carbonPrefix}--link`"> </a>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
8
9
|
export default {
|
|
9
10
|
name: 'CvBreadcrumbItemSkeleton',
|
|
11
|
+
mixins: [carbonPrefixMixin],
|
|
10
12
|
};
|
|
11
13
|
</script>
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="cv-breadcrumb-item bx--breadcrumb-item"
|
|
4
|
-
:class="{ 'bx--breadcrumb-item--current': activePage }"
|
|
5
|
-
:aria-current="ariaCurrent"
|
|
6
|
-
>
|
|
2
|
+
<div :class="breadcrumbItemClasses" :aria-current="ariaCurrent">
|
|
7
3
|
<slot></slot>
|
|
8
4
|
</div>
|
|
9
5
|
</template>
|
|
10
6
|
|
|
11
7
|
<script>
|
|
8
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
12
9
|
export default {
|
|
13
10
|
name: 'CvBreadcrumbItem',
|
|
11
|
+
mixins: [carbonPrefixMixin],
|
|
14
12
|
props: {
|
|
15
13
|
active: Boolean,
|
|
16
14
|
ariaCurrent: String,
|
|
@@ -19,6 +17,13 @@ export default {
|
|
|
19
17
|
activePage() {
|
|
20
18
|
return this.active && this.ariaCurrent !== 'page';
|
|
21
19
|
},
|
|
20
|
+
breadcrumbItemClasses() {
|
|
21
|
+
const classes = [`cv-breadcrumb-item ${this.carbonPrefix}--breadcrumb-item`];
|
|
22
|
+
if (this.activePage) {
|
|
23
|
+
classes.push(`${this.carbonPrefix}--breadcrumb-item--current`);
|
|
24
|
+
}
|
|
25
|
+
return classes.join(' ');
|
|
26
|
+
},
|
|
22
27
|
},
|
|
23
28
|
};
|
|
24
29
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<nav class="
|
|
2
|
+
<nav :class="`${carbonPrefix}--breadcrumb ${carbonPrefix}--skeleton`" :aria-label="ariaLabel">
|
|
3
3
|
<cv-breadcrumb-item-skeleton></cv-breadcrumb-item-skeleton>
|
|
4
4
|
<cv-breadcrumb-item-skeleton></cv-breadcrumb-item-skeleton>
|
|
5
5
|
<cv-breadcrumb-item-skeleton></cv-breadcrumb-item-skeleton>
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
10
|
import CvBreadcrumbItemSkeleton from './_cv-breadcrumb-item-skeleton';
|
|
11
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
name: 'CvBreadcrumbSkeleton',
|
|
15
|
+
mixins: [carbonPrefixMixin],
|
|
14
16
|
components: {
|
|
15
17
|
CvBreadcrumbItemSkeleton,
|
|
16
18
|
},
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<nav
|
|
3
|
-
class="cv-breadcrumb bx--breadcrumb"
|
|
4
|
-
:class="{ 'bx--breadcrumb--no-trailing-slash': noTrailingSlash }"
|
|
5
|
-
:aria-label="ariaLabel"
|
|
6
|
-
>
|
|
2
|
+
<nav class="cv-breadcrumb" :class="breadcrumbClasses" :aria-label="ariaLabel">
|
|
7
3
|
<slot></slot>
|
|
8
4
|
</nav>
|
|
9
5
|
</template>
|
|
10
6
|
|
|
11
7
|
<script>
|
|
8
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
12
9
|
export default {
|
|
13
10
|
name: 'CvBreadcrumb',
|
|
11
|
+
mixins: [carbonPrefixMixin],
|
|
14
12
|
props: {
|
|
15
13
|
ariaLabel: { type: String, default: 'breadcrumb' },
|
|
16
14
|
noTrailingSlash: Boolean,
|
|
17
15
|
},
|
|
16
|
+
computed: {
|
|
17
|
+
breadcrumbClasses() {
|
|
18
|
+
let classes = [`${this.carbonPrefix}--breadcrumb`];
|
|
19
|
+
if (this.noTrailingSlash) {
|
|
20
|
+
classes.push(`${this.carbonPrefix}--breadcrumb--no-trailing-slash`);
|
|
21
|
+
}
|
|
22
|
+
return classes;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
18
25
|
};
|
|
19
26
|
</script>
|
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
<button class="cv-button" :class="buttonClasses" v-on="inputListeners" role="button">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<svg v-if="typeof icon === 'string' || iconHref" :class="`${carbonPrefix}--btn__icon`">
|
|
7
|
-
<use :href="icon || iconHref" />
|
|
8
|
-
</svg>
|
|
5
|
+
<CvSvg v-if="icon || iconHref" :svg="icon || iconHref" :class="`${carbonPrefix}--btn__icon`" />
|
|
9
6
|
</button>
|
|
10
7
|
</template>
|
|
11
8
|
|
|
12
9
|
<script>
|
|
13
10
|
import buttonMixin from './button-mixin';
|
|
14
11
|
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
12
|
+
import CvSvg from '../cv-svg/_cv-svg';
|
|
15
13
|
|
|
16
14
|
export default {
|
|
17
15
|
name: 'CvButton',
|
|
18
16
|
mixins: [buttonMixin, carbonPrefixMixin],
|
|
17
|
+
components: { CvSvg },
|
|
19
18
|
computed: {
|
|
20
19
|
buttonClasses() {
|
|
21
20
|
return this.buttonClassOpts();
|
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
<button class="cv-button" :class="buttonClasses" v-on="inputListeners" type="button">
|
|
3
3
|
<span :class="`${carbonPrefix}--assistive-text`">{{ label }}</span>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<svg v-if="typeof icon === 'string' || iconHref" :class="`${carbonPrefix}--btn__icon`">
|
|
7
|
-
<use :href="icon || iconHref" />
|
|
8
|
-
</svg>
|
|
5
|
+
<CvSvg v-if="icon || iconHref" :svg="icon || iconHref" :class="`${carbonPrefix}--btn__icon`" />
|
|
9
6
|
</button>
|
|
10
7
|
</template>
|
|
11
8
|
|
|
12
9
|
<script>
|
|
13
10
|
import buttonMixin from './button-mixin';
|
|
14
11
|
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
12
|
+
import CvSvg from '../cv-svg/_cv-svg';
|
|
15
13
|
|
|
16
14
|
export default {
|
|
17
15
|
name: 'CvIconButton',
|
|
18
16
|
mixins: [buttonMixin, carbonPrefixMixin],
|
|
17
|
+
components: { CvSvg },
|
|
19
18
|
props: {
|
|
20
19
|
label: { type: String, default: undefined },
|
|
21
20
|
tipPosition: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="cv-checkbox
|
|
3
|
-
<label class="
|
|
2
|
+
<div class="cv-checkbox" :class="`${carbonPrefix}--form-item ${carbonPrefix}--checkbox-wrapper`">
|
|
3
|
+
<label :class="`${carbonPrefix}--checkbox-label ${carbonPrefix}--skeleton`"></label>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
8
9
|
export default {
|
|
9
10
|
name: 'CvCheckboxSkeleton',
|
|
11
|
+
mixins: [carbonPrefixMixin],
|
|
10
12
|
};
|
|
11
13
|
</script>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="cv-checkbox
|
|
2
|
+
<div class="cv-checkbox" :class="formItemClasses">
|
|
3
3
|
<input
|
|
4
4
|
ref="input"
|
|
5
5
|
v-bind="$attrs"
|
|
6
6
|
v-on="inputListeners"
|
|
7
|
-
class="
|
|
7
|
+
:class="`${carbonPrefix}--checkbox`"
|
|
8
8
|
type="checkbox"
|
|
9
9
|
:checked="isChecked === true"
|
|
10
10
|
:aria-checked="`${isChecked}`"
|
|
@@ -14,18 +14,12 @@
|
|
|
14
14
|
:id="uid"
|
|
15
15
|
/>
|
|
16
16
|
<label
|
|
17
|
-
:class="
|
|
18
|
-
'bx--checkbox-label',
|
|
19
|
-
{
|
|
20
|
-
'bx--label--disabled': $attrs.disabled !== undefined && $attrs.disabled,
|
|
21
|
-
'bx--checkbox-label__focus': hasFocus,
|
|
22
|
-
},
|
|
23
|
-
]"
|
|
17
|
+
:class="labelClasses"
|
|
24
18
|
:data-contained-checkbox-state="isChecked"
|
|
25
19
|
:data-contained-checkbox-disabled="$attrs.disabled"
|
|
26
20
|
:for="uid"
|
|
27
21
|
>
|
|
28
|
-
<span
|
|
22
|
+
<span :class="labelContentClasses">
|
|
29
23
|
{{ label }}
|
|
30
24
|
</span>
|
|
31
25
|
</label>
|
|
@@ -35,10 +29,11 @@
|
|
|
35
29
|
<script>
|
|
36
30
|
import checkMixin from '../../mixins/check-mixin';
|
|
37
31
|
import uidMixin from '../../mixins/uid-mixin';
|
|
32
|
+
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
38
33
|
|
|
39
34
|
export default {
|
|
40
35
|
name: 'CvCheckbox',
|
|
41
|
-
mixins: [checkMixin, uidMixin],
|
|
36
|
+
mixins: [checkMixin, uidMixin, carbonPrefixMixin],
|
|
42
37
|
inheritAttrs: false,
|
|
43
38
|
props: {
|
|
44
39
|
hideLabel: Boolean,
|
|
@@ -60,6 +55,32 @@ export default {
|
|
|
60
55
|
dataMixed: this.mixed,
|
|
61
56
|
};
|
|
62
57
|
},
|
|
58
|
+
computed: {
|
|
59
|
+
formItemClasses() {
|
|
60
|
+
const classes = [`${this.carbonPrefix}--checkbox-wrapper`];
|
|
61
|
+
if (this.formItem) {
|
|
62
|
+
classes.push(`${this.carbonPrefix}--form-item`);
|
|
63
|
+
}
|
|
64
|
+
return classes;
|
|
65
|
+
},
|
|
66
|
+
labelClasses() {
|
|
67
|
+
const classes = [`${this.carbonPrefix}--checkbox-label`];
|
|
68
|
+
if (this.$attrs.disabled !== undefined && this.$attrs.disabled) {
|
|
69
|
+
classes.push(`${this.carbonPrefix}--label--disabled`);
|
|
70
|
+
}
|
|
71
|
+
if (this.hasFocus) {
|
|
72
|
+
classes.push(`${this.carbonPrefix}--checkbox-label__focus`);
|
|
73
|
+
}
|
|
74
|
+
return classes;
|
|
75
|
+
},
|
|
76
|
+
labelContentClasses() {
|
|
77
|
+
const classes = [`${this.carbonPrefix}--checkbox-label-text`];
|
|
78
|
+
if (this.hideLabel) {
|
|
79
|
+
classes.push(`${this.carbonPrefix}--visually-hidden`);
|
|
80
|
+
}
|
|
81
|
+
return classes;
|
|
82
|
+
},
|
|
83
|
+
},
|
|
63
84
|
methods: {
|
|
64
85
|
onFocus() {
|
|
65
86
|
this.hasFocus = true;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
|
-
import CvFeedbackButton from '
|
|
24
|
+
import CvFeedbackButton from '../cv-feedback-button/_cv-feedback-button';
|
|
25
25
|
import CvButton from '../cv-button/cv-button';
|
|
26
26
|
|
|
27
27
|
import Copy16 from '@carbon/icons-vue/es/copy/16';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cv-combo-box bx--list-box__wrapper" @focusout="onFocusOut">
|
|
3
|
-
<label v-if="title" :for="uid" class="bx--label" :class="{ 'bx--label--disabled':
|
|
4
|
-
{{ title }}
|
|
5
|
-
</label>
|
|
3
|
+
<label v-if="title" :for="uid" class="bx--label" :class="{ 'bx--label--disabled': disabled }">{{ title }}</label>
|
|
6
4
|
|
|
7
|
-
<div v-if="isHelper" class="bx--form__helper-text" :class="{ 'bx--form__helper-text--disabled':
|
|
5
|
+
<div v-if="isHelper" class="bx--form__helper-text" :class="{ 'bx--form__helper-text--disabled': disabled }">
|
|
8
6
|
<slot name="helper-text">{{ helperText }}</slot>
|
|
9
7
|
</div>
|
|
10
8
|
|
|
@@ -16,7 +14,7 @@
|
|
|
16
14
|
'bx--list-box--light': theme === 'light',
|
|
17
15
|
'bx--combo-box--expanded': open,
|
|
18
16
|
'bx--list-box--expanded': open,
|
|
19
|
-
'bx--combo-box--disabled bx--list-box--disabled':
|
|
17
|
+
'bx--combo-box--disabled bx--list-box--disabled': disabled,
|
|
20
18
|
}"
|
|
21
19
|
:data-invalid="isInvalid"
|
|
22
20
|
v-bind="$attrs"
|
|
@@ -30,7 +28,7 @@
|
|
|
30
28
|
<div
|
|
31
29
|
role="button"
|
|
32
30
|
aria-haspopup="true"
|
|
33
|
-
:aria-expanded="open"
|
|
31
|
+
:aria-expanded="open ? 'true' : 'false'"
|
|
34
32
|
:aria-owns="uid"
|
|
35
33
|
:aria-controls="uid"
|
|
36
34
|
class="bx--list-box__field"
|
|
@@ -46,8 +44,10 @@
|
|
|
46
44
|
:aria-controls="uid"
|
|
47
45
|
aria-autocomplete="list"
|
|
48
46
|
role="combobox"
|
|
49
|
-
:aria-
|
|
47
|
+
:aria-disabled="disabled"
|
|
48
|
+
:aria-expanded="open ? 'true' : 'false'"
|
|
50
49
|
autocomplete="off"
|
|
50
|
+
:disabled="disabled"
|
|
51
51
|
:placeholder="label"
|
|
52
52
|
v-model="filter"
|
|
53
53
|
@input="onInput"
|
|
@@ -109,6 +109,7 @@ export default {
|
|
|
109
109
|
props: {
|
|
110
110
|
autoFilter: Boolean,
|
|
111
111
|
autoHighlight: Boolean,
|
|
112
|
+
disabled: Boolean,
|
|
112
113
|
invalidMessage: { type: String, default: undefined },
|
|
113
114
|
helperText: { type: String, default: undefined },
|
|
114
115
|
title: String,
|
|
@@ -209,6 +210,7 @@ export default {
|
|
|
209
210
|
this.isHelper = !!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
|
|
210
211
|
},
|
|
211
212
|
clearFilter() {
|
|
213
|
+
if (this.disabled) return;
|
|
212
214
|
this.internalUpdateValue('');
|
|
213
215
|
this.filter = '';
|
|
214
216
|
this.$refs.input.focus();
|
|
@@ -280,6 +282,7 @@ export default {
|
|
|
280
282
|
}
|
|
281
283
|
},
|
|
282
284
|
onInput() {
|
|
285
|
+
if (this.disabled) return;
|
|
283
286
|
this.doOpen(true);
|
|
284
287
|
|
|
285
288
|
this.updateOptions();
|
|
@@ -289,6 +292,7 @@ export default {
|
|
|
289
292
|
this.open = newVal;
|
|
290
293
|
},
|
|
291
294
|
onDown() {
|
|
295
|
+
if (this.disabled) return;
|
|
292
296
|
if (!this.open) {
|
|
293
297
|
this.doOpen(true);
|
|
294
298
|
} else {
|
|
@@ -296,15 +300,18 @@ export default {
|
|
|
296
300
|
}
|
|
297
301
|
},
|
|
298
302
|
onUp() {
|
|
303
|
+
if (this.disabled) return;
|
|
299
304
|
if (this.open) {
|
|
300
305
|
this.doMove(true);
|
|
301
306
|
}
|
|
302
307
|
},
|
|
303
308
|
onEsc() {
|
|
309
|
+
if (this.disabled) return;
|
|
304
310
|
this.doOpen(false);
|
|
305
311
|
this.$el.focus();
|
|
306
312
|
},
|
|
307
313
|
onEnter() {
|
|
314
|
+
if (this.disabled) return;
|
|
308
315
|
this.doOpen(!this.open);
|
|
309
316
|
if (!this.open) {
|
|
310
317
|
this.onItemClick(this.highlighted);
|
|
@@ -312,6 +319,7 @@ export default {
|
|
|
312
319
|
}
|
|
313
320
|
},
|
|
314
321
|
onClick() {
|
|
322
|
+
if (this.disabled) return;
|
|
315
323
|
this.doOpen(!this.open);
|
|
316
324
|
if (this.open) {
|
|
317
325
|
this.$refs.input.focus();
|
|
@@ -340,17 +348,20 @@ export default {
|
|
|
340
348
|
}
|
|
341
349
|
},
|
|
342
350
|
onItemClick(val) {
|
|
351
|
+
if (this.disabled) return;
|
|
343
352
|
this.internalUpdateValue(val);
|
|
344
353
|
this.$refs.input.focus();
|
|
345
354
|
this.open = false; // close after user makes a selection
|
|
346
355
|
this.$emit('change', this.dataValue);
|
|
347
356
|
},
|
|
348
357
|
inputClick() {
|
|
358
|
+
if (this.disabled) return;
|
|
349
359
|
if (!this.open) {
|
|
350
360
|
this.doOpen(true);
|
|
351
361
|
}
|
|
352
362
|
},
|
|
353
363
|
inputFocus() {
|
|
364
|
+
if (this.disabled) return;
|
|
354
365
|
this.doOpen(true);
|
|
355
366
|
},
|
|
356
367
|
},
|
|
@@ -22,13 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
]"
|
|
24
24
|
:data-target="contentSelector"
|
|
25
|
-
:aria-selected="
|
|
25
|
+
:aria-selected="dataSelected ? 'true' : 'false'"
|
|
26
26
|
@click="open"
|
|
27
27
|
>
|
|
28
|
-
<
|
|
29
|
-
<svg v-if="typeof icon === 'string'" class="bx--content-switcher__icon" height="16" width="16">
|
|
30
|
-
<use :href="icon" />
|
|
31
|
-
</svg>
|
|
28
|
+
<CvSvg v-if="icon" :svg="icon" class="bx--content-switcher__icon" height="16" width="16" />
|
|
32
29
|
<span class="bx--content-switcher__label">
|
|
33
30
|
<slot></slot>
|
|
34
31
|
</span>
|
|
@@ -37,10 +34,12 @@
|
|
|
37
34
|
|
|
38
35
|
<script>
|
|
39
36
|
import uidMixin from '../../mixins/uid-mixin';
|
|
37
|
+
import CvSvg from '../cv-svg/_cv-svg';
|
|
40
38
|
|
|
41
39
|
export default {
|
|
42
40
|
name: 'CvContentSwitcherButton',
|
|
43
41
|
mixins: [uidMixin],
|
|
42
|
+
components: { CvSvg },
|
|
44
43
|
props: {
|
|
45
44
|
contentSelector: { type: String, default: undefined },
|
|
46
45
|
icon: {
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
</td>
|
|
23
23
|
<slot />
|
|
24
24
|
<td v-if="hasOverflowMenu" class="bx--table-column-menu">
|
|
25
|
-
<cv-overflow-menu
|
|
25
|
+
<cv-overflow-menu v-bind="overflowMenuOptions">
|
|
26
26
|
<cv-overflow-menu-item
|
|
27
|
-
v-for="(item, index) in
|
|
27
|
+
v-for="(item, index) in overflowMenuButtons"
|
|
28
28
|
:key="`${index}`"
|
|
29
29
|
@click="
|
|
30
30
|
onMenuItemClick({
|
|
@@ -97,6 +97,14 @@ export default {
|
|
|
97
97
|
isChecked() {
|
|
98
98
|
return this.dataChecked;
|
|
99
99
|
},
|
|
100
|
+
overflowMenuButtons() {
|
|
101
|
+
return this.overflowMenu.filter(item => typeof item === 'string');
|
|
102
|
+
},
|
|
103
|
+
overflowMenuOptions() {
|
|
104
|
+
const incomingOptions = this.overflowMenu.find(item => typeof item === 'object') || {};
|
|
105
|
+
const defaultOptions = { flipMenu: true, label: 'Row overflow menu', tipPosition: 'left' };
|
|
106
|
+
return { ...defaultOptions, ...incomingOptions };
|
|
107
|
+
},
|
|
100
108
|
},
|
|
101
109
|
methods: {
|
|
102
110
|
checkSlots() {
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
:key="`cell:${colIndex}:${rowIndex}`"
|
|
143
143
|
:style="dataStyle(colIndex)"
|
|
144
144
|
>
|
|
145
|
-
<cv-wrapper :tag-type="skeleton
|
|
145
|
+
<cv-wrapper :tag-type="skeleton ? 'span' : ''">{{ cell }}</cv-wrapper>
|
|
146
146
|
</cv-data-table-cell>
|
|
147
147
|
</cv-data-table-row>
|
|
148
148
|
</slot>
|