@carbon/vue 2.40.0 → 2.43.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.
- package/README.md +24 -2
- package/dist/carbon-vue.common.js +922 -817
- package/dist/carbon-vue.common.js.map +1 -1
- package/dist/carbon-vue.umd.js +922 -817
- 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 +7 -7
- package/src/components/cv-accordion/cv-accordion-skeleton.vue +1 -1
- package/src/components/cv-accordion/cv-accordion.vue +1 -1
- package/src/components/cv-aspect-ratio/cv-aspect-ratio.vue +3 -2
- package/src/components/cv-aspect-ratio/index.js +2 -2
- package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +8 -1
- package/src/components/cv-button/button-mixin.js +7 -4
- package/src/components/cv-button/consts.js +14 -0
- package/src/components/cv-button/cv-icon-button.vue +1 -1
- package/src/components/cv-code-snippet/cv-code-snippet-skeleton.vue +1 -1
- package/src/components/cv-code-snippet/cv-code-snippet.vue +1 -1
- package/src/components/cv-data-table/cv-data-table-heading.vue +1 -1
- package/src/components/cv-data-table/cv-data-table-skeleton.vue +1 -2
- package/src/components/cv-data-table/cv-data-table.vue +47 -44
- package/src/components/cv-date-picker/cv-date-picker.vue +11 -10
- package/src/components/cv-feedback-button/_cv-feedback-button.vue +1 -1
- package/src/components/cv-file-uploader/cv-file-uploader.vue +22 -12
- package/src/components/cv-inline-loading/cv-inline-loading.vue +1 -0
- package/src/components/cv-link/cv-link.vue +8 -1
- package/src/components/cv-loading/cv-loading.vue +4 -1
- package/src/components/cv-multi-select/cv-multi-select.vue +17 -11
- package/src/components/cv-number-input/cv-number-input.vue +38 -30
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +3 -3
- package/src/components/cv-search/cv-search.vue +17 -13
- package/src/components/cv-tabs/cv-tabs-skeleton.vue +7 -19
- package/src/components/cv-tabs/cv-tabs.vue +1 -1
- package/src/components/cv-tag/cv-tag-skeleton.vue +1 -3
- package/src/components/cv-tag/cv-tag.vue +6 -7
- package/src/components/cv-tag/index.js +3 -2
- package/src/components/cv-tile/_cv-tile-selectable.vue +0 -1
- package/src/components/cv-toast-notification/cv-toast-notification.vue +1 -1
- package/src/components/cv-tooltip/consts.js +2 -0
- package/src/components/cv-tooltip/cv-definition-tooltip.vue +5 -5
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +7 -7
- package/src/components/cv-tooltip/cv-tooltip.vue +5 -5
- package/src/components/cv-tooltip/index.js +1 -0
- package/src/components/cv-ui-shell/cv-header-global-action.vue +1 -1
- package/CHANGELOG.md +0 -1197
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.43.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
},
|
|
65
65
|
"sideEffects": true,
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@carbon/icons-vue": "10.
|
|
68
|
-
"@carbon/telemetry": "^0.
|
|
69
|
-
"carbon-components": "10.
|
|
67
|
+
"@carbon/icons-vue": "10.49.1",
|
|
68
|
+
"@carbon/telemetry": "^0.1.0",
|
|
69
|
+
"carbon-components": "10.56.0",
|
|
70
70
|
"flatpickr": "4.6.9",
|
|
71
|
-
"vue": "^2.6.
|
|
71
|
+
"vue": "^2.6.14"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@vue/cli-service": "^3.11.0",
|
|
75
75
|
"eslint-plugin-prettier": "^3.3.1",
|
|
76
|
-
"vue-template-compiler": "^2.6.
|
|
76
|
+
"vue-template-compiler": "^2.6.14"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "0edbc217d724b03f012f3cd4df3aa3754821bf06"
|
|
79
79
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
6
|
import { carbonPrefixMixin } from '../../mixins';
|
|
7
|
+
|
|
8
|
+
export const ratios = ['16x9', '9x16', '2x1', '1x2', '4x3', '3x4', '1x1'];
|
|
7
9
|
export default {
|
|
8
10
|
name: 'CvAspectRatio',
|
|
9
11
|
mixins: [carbonPrefixMixin],
|
|
@@ -11,8 +13,7 @@ export default {
|
|
|
11
13
|
ratio: {
|
|
12
14
|
type: String,
|
|
13
15
|
validator: val => {
|
|
14
|
-
const
|
|
15
|
-
const result = options.includes(val);
|
|
16
|
+
const result = ratios.includes(val);
|
|
16
17
|
if (!result) {
|
|
17
18
|
console.warn(`Invalid options supplied to "CvAspectRation"-"${val}".`);
|
|
18
19
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import CvAspectRatio from './cv-aspect-ratio';
|
|
2
|
-
export { CvAspectRatio };
|
|
1
|
+
import CvAspectRatio, { ratios } from './cv-aspect-ratio';
|
|
2
|
+
export { CvAspectRatio, ratios };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<nav
|
|
2
|
+
<nav
|
|
3
|
+
:class="[
|
|
4
|
+
`${carbonPrefix}--breadcrumb ${carbonPrefix}--skeleton`,
|
|
5
|
+
{ [`${carbonPrefix}--breadcrumb--no-trailing-slash`]: noTrailingSlash },
|
|
6
|
+
]"
|
|
7
|
+
:aria-label="ariaLabel"
|
|
8
|
+
>
|
|
3
9
|
<cv-breadcrumb-item-skeleton></cv-breadcrumb-item-skeleton>
|
|
4
10
|
<cv-breadcrumb-item-skeleton></cv-breadcrumb-item-skeleton>
|
|
5
11
|
<cv-breadcrumb-item-skeleton></cv-breadcrumb-item-skeleton>
|
|
@@ -18,6 +24,7 @@ export default {
|
|
|
18
24
|
},
|
|
19
25
|
props: {
|
|
20
26
|
ariaLabel: { type: String, default: 'breadcrumb' },
|
|
27
|
+
noTrailingSlash: Boolean,
|
|
21
28
|
},
|
|
22
29
|
};
|
|
23
30
|
</script>
|
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
iconHref: {
|
|
16
|
+
deprecated: true,
|
|
16
17
|
type: String,
|
|
17
18
|
default: undefined,
|
|
18
19
|
validator(val) {
|
|
@@ -29,6 +30,7 @@ export default {
|
|
|
29
30
|
['', 'primary', 'secondary', 'tertiary', 'ghost', 'danger', 'danger--ghost', 'danger--tertiary'].includes(val),
|
|
30
31
|
},
|
|
31
32
|
small: {
|
|
33
|
+
deprecated: true,
|
|
32
34
|
type: Boolean,
|
|
33
35
|
default: undefined,
|
|
34
36
|
validator(val) {
|
|
@@ -56,7 +58,8 @@ export default {
|
|
|
56
58
|
buttonClassOpts() {
|
|
57
59
|
return (opts = {}) => {
|
|
58
60
|
const classes = [`${carbonSettings.prefix}--btn`];
|
|
59
|
-
|
|
61
|
+
// ensure lower case and default to primary
|
|
62
|
+
const _kind = this.kind ? this.kind.toLowerCase() : 'primary';
|
|
60
63
|
|
|
61
64
|
if (opts.skeleton) {
|
|
62
65
|
classes.push(`${carbonSettings.prefix}--skeleton`);
|
|
@@ -64,13 +67,13 @@ export default {
|
|
|
64
67
|
|
|
65
68
|
if (opts.iconOnly) {
|
|
66
69
|
classes.push(`${carbonSettings.prefix}--btn--icon-only`);
|
|
67
|
-
if (this.selected &&
|
|
70
|
+
if (this.selected && _kind === 'ghost') {
|
|
68
71
|
classes.push(`${carbonSettings.prefix}--btn--selected`);
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
|
72
|
-
if (
|
|
73
|
-
classes.push(`${carbonSettings.prefix}--btn--${
|
|
75
|
+
if (_kind && !opts.skeleton) {
|
|
76
|
+
classes.push(`${carbonSettings.prefix}--btn--${_kind}`);
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
let size = this.size ? this.size : this.small && 'sm';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const buttonKinds = [
|
|
2
|
+
'',
|
|
3
|
+
'primary',
|
|
4
|
+
'secondary',
|
|
5
|
+
'tertiary',
|
|
6
|
+
'ghost',
|
|
7
|
+
'danger',
|
|
8
|
+
'danger--ghost',
|
|
9
|
+
'danger--tertiary',
|
|
10
|
+
];
|
|
11
|
+
export const buttonSizes = ['', 'default', 'field', 'small', 'sm', 'lg', 'xl'];
|
|
12
|
+
|
|
13
|
+
const CvButtonConsts = { buttonKinds, buttonSizes };
|
|
14
|
+
export default CvButtonConsts;
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
tipPosition: {
|
|
35
35
|
type: String,
|
|
36
36
|
default: 'bottom',
|
|
37
|
-
validator: val => ['top', 'left', 'bottom', 'right'.includes(val)
|
|
37
|
+
validator: val => ['top', 'left', 'bottom', 'right'].includes(val),
|
|
38
38
|
},
|
|
39
39
|
tipAlignment: { type: String, default: 'center', validator: val => ['start', 'center', 'end'].includes(val) },
|
|
40
40
|
},
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
name: 'CvCodeSnippetSkeleton',
|
|
20
20
|
mixins: [carbonPrefixMixin],
|
|
21
21
|
props: {
|
|
22
|
-
kind: { type: String, default: 'oneline' },
|
|
22
|
+
kind: { type: String, default: 'oneline', validator: val => ['multiline', 'oneline'].includes(val) },
|
|
23
23
|
},
|
|
24
24
|
computed: {
|
|
25
25
|
multi() {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<!-- textarea cannot be fully hidden for clipboard to work -->
|
|
15
15
|
<textarea
|
|
16
16
|
class="cv-code-snippet__clippy"
|
|
17
|
-
style="position: absolute; left: -9999px; max-width: 0; opacity: 0; overflow: hidden
|
|
17
|
+
style="position: absolute; left: -9999px; max-width: 0; opacity: 0; overflow: hidden"
|
|
18
18
|
aria-hidden="true"
|
|
19
19
|
ref="clippy"
|
|
20
20
|
></textarea>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
<script>
|
|
30
30
|
import ArrowDown16 from '@carbon/icons-vue/es/arrow--down/16';
|
|
31
|
-
import Arrows16 from '@carbon/icons-vue/es/arrows/16';
|
|
31
|
+
import Arrows16 from '@carbon/icons-vue/es/arrows--vertical/16';
|
|
32
32
|
import CvWrapper from '../cv-wrapper/_cv-wrapper';
|
|
33
33
|
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
34
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<cv-data-table skeleton :data="data" :columns="cols" v-on="$listeners" v-bind="$attrs">
|
|
3
|
-
<template v-if="
|
|
3
|
+
<template v-if="hasHelperText" slot="helper-text">
|
|
4
4
|
<slot name="helper-text" />
|
|
5
5
|
</template>
|
|
6
6
|
|
|
@@ -29,7 +29,6 @@ export default {
|
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
columns: { type: [Array, Number], default: DEFAULTS.COLS },
|
|
32
|
-
hasExpandables: Boolean,
|
|
33
32
|
rows: { type: Number, default: DEFAULTS.ROWS },
|
|
34
33
|
},
|
|
35
34
|
data() {
|
|
@@ -31,55 +31,52 @@
|
|
|
31
31
|
</p>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
|
-
|
|
35
34
|
<div :class="`${carbonPrefix}--toolbar-content`">
|
|
36
35
|
<div
|
|
37
36
|
v-if="$listeners.search"
|
|
38
|
-
:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
:aria-labelledby="`${uid}-search`"
|
|
38
|
+
:class="[
|
|
39
|
+
`${carbonPrefix}--search ${carbonPrefix}--search--xl`,
|
|
40
|
+
{
|
|
41
|
+
[`${carbonPrefix}--toolbar-search-container-active`]: searchActive || searchValue.length > 0,
|
|
42
|
+
[`${carbonPrefix}--toolbar-search-container-persistent`]: !expandingSearch,
|
|
43
|
+
[`${carbonPrefix}--toolbar-search-container-expandable`]: expandingSearch,
|
|
44
|
+
},
|
|
45
|
+
]"
|
|
46
|
+
role="search"
|
|
43
47
|
ref="searchContainer"
|
|
44
48
|
>
|
|
45
|
-
<div
|
|
46
|
-
<
|
|
47
|
-
:class="`${carbonPrefix}--search-magnifier`"
|
|
48
|
-
tabindex="0"
|
|
49
|
-
@click="checkSearchExpand(true)"
|
|
50
|
-
@keydown.enter.prevent="checkSearchExpand(true)"
|
|
51
|
-
@keydown.space.prevent
|
|
52
|
-
@keyup.space.prevent="checkSearchExpand(true)"
|
|
53
|
-
ref="magnifier"
|
|
54
|
-
>
|
|
55
|
-
<Search16 :class="`${carbonPrefix}--toolbar-action__icon`" />
|
|
56
|
-
</div>
|
|
57
|
-
<label :for="uid" :class="`${carbonPrefix}--label`">{{ searchLabel }}</label>
|
|
58
|
-
<input
|
|
59
|
-
:class="`${carbonPrefix}--search-input`"
|
|
60
|
-
type="text"
|
|
61
|
-
:id="uid"
|
|
62
|
-
role="search"
|
|
63
|
-
:placeholder="searchPlaceholder"
|
|
64
|
-
:aria-labelledby="uid"
|
|
65
|
-
ref="search"
|
|
66
|
-
v-model="searchValue"
|
|
67
|
-
@input="onSearch"
|
|
68
|
-
@keydown.esc.prevent="checkSearchExpand(false)"
|
|
69
|
-
/>
|
|
70
|
-
<button
|
|
71
|
-
:class="[
|
|
72
|
-
`${carbonPrefix}--search-close`,
|
|
73
|
-
{ [`${carbonPrefix}--search-close--hidden`]: !clearSearchVisible },
|
|
74
|
-
]"
|
|
75
|
-
:title="searchClearLabel"
|
|
76
|
-
:aria-label="searchClearLabel"
|
|
77
|
-
@click="onClearClick"
|
|
78
|
-
type="button"
|
|
79
|
-
>
|
|
80
|
-
<Close16 />
|
|
81
|
-
</button>
|
|
49
|
+
<div :class="`${carbonPrefix}--search-magnifier`" ref="magnifier">
|
|
50
|
+
<Search16 :class="`${carbonPrefix}--search-magnifier-icon`" />
|
|
82
51
|
</div>
|
|
52
|
+
<label :id="`${uid}-search`" :for="uid" :class="`${carbonPrefix}--label`">{{ searchLabel }}</label>
|
|
53
|
+
<input
|
|
54
|
+
:class="`${carbonPrefix}--search-input`"
|
|
55
|
+
type="text"
|
|
56
|
+
:id="uid"
|
|
57
|
+
role="search"
|
|
58
|
+
:placeholder="searchPlaceholder"
|
|
59
|
+
:aria-labelledby="uid"
|
|
60
|
+
ref="search"
|
|
61
|
+
v-model="searchValue"
|
|
62
|
+
@input="onSearch"
|
|
63
|
+
@click="checkSearchExpand(true)"
|
|
64
|
+
@keydown.esc.prevent="checkSearchExpand(false)"
|
|
65
|
+
@focus="checkSearchExpand(true)"
|
|
66
|
+
@blur="checkSearchExpand(false)"
|
|
67
|
+
/>
|
|
68
|
+
<button
|
|
69
|
+
:class="[
|
|
70
|
+
`${carbonPrefix}--search-close`,
|
|
71
|
+
{ [`${carbonPrefix}--search-close--hidden`]: !clearSearchVisible },
|
|
72
|
+
]"
|
|
73
|
+
:title="searchClearLabel"
|
|
74
|
+
:aria-label="searchClearLabel"
|
|
75
|
+
@click="onClearClick"
|
|
76
|
+
type="button"
|
|
77
|
+
>
|
|
78
|
+
<Close16 />
|
|
79
|
+
</button>
|
|
83
80
|
</div>
|
|
84
81
|
<slot name="actions" />
|
|
85
82
|
</div>
|
|
@@ -196,6 +193,7 @@ import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
|
196
193
|
import Search16 from '@carbon/icons-vue/es/search/16';
|
|
197
194
|
import Close16 from '@carbon/icons-vue/es/close/16';
|
|
198
195
|
import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
|
|
196
|
+
import clickout from '../../directives/clickout';
|
|
199
197
|
export default {
|
|
200
198
|
name: 'CvDataTable',
|
|
201
199
|
components: {
|
|
@@ -210,6 +208,7 @@ export default {
|
|
|
210
208
|
Close16,
|
|
211
209
|
ChevronRight16,
|
|
212
210
|
},
|
|
211
|
+
directives: { clickout },
|
|
213
212
|
mixins: [uidMixin, carbonPrefixMixin],
|
|
214
213
|
props: {
|
|
215
214
|
actionBarAriaLabel: { type: String, default: 'Table Action Bar' },
|
|
@@ -232,6 +231,7 @@ export default {
|
|
|
232
231
|
searchLabel: { type: String, default: 'Search' },
|
|
233
232
|
searchPlaceholder: { type: String, default: 'Search' },
|
|
234
233
|
searchClearLabel: { type: String, default: 'Clear search' },
|
|
234
|
+
initialSearchValue: { type: String, default: '' },
|
|
235
235
|
sortable: Boolean,
|
|
236
236
|
title: String,
|
|
237
237
|
columns: Array,
|
|
@@ -258,7 +258,7 @@ export default {
|
|
|
258
258
|
batchActive: false,
|
|
259
259
|
headingChecked: false,
|
|
260
260
|
dataRowsSelected: this.rowsSelected,
|
|
261
|
-
searchValue:
|
|
261
|
+
searchValue: this.initialSearchValue,
|
|
262
262
|
clearSearchVisible: false,
|
|
263
263
|
searchActive: false,
|
|
264
264
|
registeredRows: [],
|
|
@@ -362,6 +362,9 @@ export default {
|
|
|
362
362
|
this.hasToolbar = !!(this.$slots.actions || this.$listeners.search || this.$slots['batch-actions']);
|
|
363
363
|
this.isHelper = !!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
|
|
364
364
|
},
|
|
365
|
+
onClickout(ev) {
|
|
366
|
+
this.checkSearchExpand(false);
|
|
367
|
+
},
|
|
365
368
|
onCvMount(thing) {
|
|
366
369
|
if (thing.$_CvDataTableHeading) {
|
|
367
370
|
this.registeredHeadings = this.$children.filter(item => item.$_CvDataTableHeading);
|
|
@@ -81,16 +81,6 @@ import { uidMixin, themeMixin, carbonPrefixMixin } from '../../mixins';
|
|
|
81
81
|
import Calendar16 from '@carbon/icons-vue/es/calendar/16';
|
|
82
82
|
import CvWrapper from '../cv-wrapper/_cv-wrapper';
|
|
83
83
|
|
|
84
|
-
// Weekdays shorthand for english locale
|
|
85
|
-
l10n.en.weekdays.shorthand.forEach((day, index) => {
|
|
86
|
-
const currentDay = l10n.en.weekdays.shorthand;
|
|
87
|
-
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
|
|
88
|
-
currentDay[index] = 'Th';
|
|
89
|
-
} else {
|
|
90
|
-
currentDay[index] = currentDay[index].charAt(0);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
|
|
94
84
|
export default {
|
|
95
85
|
name: 'CvDatePicker',
|
|
96
86
|
mixins: [uidMixin, themeMixin, carbonPrefixMixin],
|
|
@@ -338,6 +328,17 @@ export default {
|
|
|
338
328
|
this.$refs.todate.click();
|
|
339
329
|
},
|
|
340
330
|
},
|
|
331
|
+
created() {
|
|
332
|
+
// Weekdays shorthand for english locale
|
|
333
|
+
l10n.en.weekdays.shorthand.forEach((day, index) => {
|
|
334
|
+
const currentDay = l10n.en.weekdays.shorthand;
|
|
335
|
+
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
|
|
336
|
+
currentDay[index] = 'Th';
|
|
337
|
+
} else {
|
|
338
|
+
currentDay[index] = currentDay[index].charAt(0);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
},
|
|
341
342
|
mounted() {
|
|
342
343
|
this.initFlatpickr();
|
|
343
344
|
this.checkSlots();
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
[`${carbonPrefix}--btn--primary`]: kind === 'button',
|
|
13
13
|
},
|
|
14
14
|
]"
|
|
15
|
-
role="button"
|
|
16
15
|
tabindex="0"
|
|
17
16
|
ref="focusTarget"
|
|
18
17
|
@keydown.enter.prevent="onShow()"
|
|
@@ -148,6 +147,7 @@ export default {
|
|
|
148
147
|
buttonLabel: {
|
|
149
148
|
type: String,
|
|
150
149
|
default: undefined,
|
|
150
|
+
deprecated: true,
|
|
151
151
|
validator: val => {
|
|
152
152
|
if (val !== undefined && process.env.NODE_ENV === 'development') {
|
|
153
153
|
console.warn('CvFileUploader: button-label prop deprecated in favour of drop-target-label');
|
|
@@ -213,20 +213,30 @@ export default {
|
|
|
213
213
|
},
|
|
214
214
|
addFiles(files) {
|
|
215
215
|
for (const file of files) {
|
|
216
|
-
const internalFile =
|
|
217
|
-
state: this.initialStateUploading ? STATES.UPLOADING : STATES.NONE,
|
|
218
|
-
file,
|
|
219
|
-
invalidMessageTitle: '',
|
|
220
|
-
invalidMessage: '',
|
|
221
|
-
};
|
|
216
|
+
const internalFile = this.internalFiles.find(item => item.file.name === file.name);
|
|
222
217
|
|
|
223
|
-
if (
|
|
224
|
-
internalFile.
|
|
225
|
-
internalFile.
|
|
226
|
-
|
|
218
|
+
if (internalFile) {
|
|
219
|
+
internalFile.state = this.initialStateUploading ? STATES.UPLOADING : STATES.NONE;
|
|
220
|
+
internalFile.invalidMessageTitle = '';
|
|
221
|
+
internalFile.invalidMessage = '';
|
|
222
|
+
} else {
|
|
223
|
+
const internalFile = {
|
|
224
|
+
state: this.initialStateUploading ? STATES.UPLOADING : STATES.NONE,
|
|
225
|
+
file,
|
|
226
|
+
invalidMessageTitle: '',
|
|
227
|
+
invalidMessage: '',
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
if (file.messageBundle) {
|
|
231
|
+
internalFile.invalidMessageTitle = file.messageBundle.invalidMessageTitle;
|
|
232
|
+
internalFile.invalidMessage = file.messageBundle.invalidMessage;
|
|
233
|
+
delete file.messageBundle;
|
|
234
|
+
}
|
|
235
|
+
this.internalFiles.push(internalFile);
|
|
227
236
|
}
|
|
228
|
-
this.internalFiles.push(internalFile);
|
|
229
237
|
}
|
|
238
|
+
// clear input we do not need to maintain it
|
|
239
|
+
this.$refs['file-input'].value = '';
|
|
230
240
|
this.$emit('change', this.internalFiles);
|
|
231
241
|
},
|
|
232
242
|
onChange(ev) {
|
|
@@ -40,6 +40,7 @@ export default {
|
|
|
40
40
|
active: {
|
|
41
41
|
type: Boolean,
|
|
42
42
|
default: undefined,
|
|
43
|
+
deprecated: true,
|
|
43
44
|
validator: val => {
|
|
44
45
|
if (val !== undefined && process.env.NODE_ENV === 'development') {
|
|
45
46
|
console.warn('CvInlineLoading: active prop deprecated in favour of state prop');
|
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
v-on="$listeners"
|
|
5
5
|
v-bind="linkProps"
|
|
6
6
|
class="cv-link"
|
|
7
|
-
:class="[
|
|
7
|
+
:class="[
|
|
8
|
+
`${carbonPrefix}--link`,
|
|
9
|
+
{
|
|
10
|
+
[`${carbonPrefix}--link--disabled`]: disabled,
|
|
11
|
+
[`${carbonPrefix}--link--inline`]: inline,
|
|
12
|
+
},
|
|
13
|
+
]"
|
|
8
14
|
>
|
|
9
15
|
<slot></slot>
|
|
10
16
|
</component>
|
|
@@ -17,6 +23,7 @@ export default {
|
|
|
17
23
|
name: 'CvLink',
|
|
18
24
|
mixins: [linkMixin, carbonPrefixMixin],
|
|
19
25
|
props: {
|
|
26
|
+
disabled: Boolean,
|
|
20
27
|
inline: Boolean,
|
|
21
28
|
},
|
|
22
29
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="{
|
|
6
6
|
'cv-loading': !overlay,
|
|
7
7
|
[`${carbonPrefix}--loading`]: active || stopping,
|
|
8
|
-
[`${carbonPrefix}--loading--stop`]: !active && stopping,
|
|
8
|
+
[`${carbonPrefix}--loading--stop`]: (!active && stopping) || stopped,
|
|
9
9
|
[`${carbonPrefix}--loading--small`]: small,
|
|
10
10
|
}"
|
|
11
11
|
ref="loading"
|
|
@@ -55,6 +55,7 @@ export default {
|
|
|
55
55
|
},
|
|
56
56
|
data() {
|
|
57
57
|
return {
|
|
58
|
+
stopped: false,
|
|
58
59
|
stopping: false,
|
|
59
60
|
};
|
|
60
61
|
},
|
|
@@ -69,10 +70,12 @@ export default {
|
|
|
69
70
|
this.$refs.loading.removeEventListener('animationend', this.onEnd);
|
|
70
71
|
|
|
71
72
|
this.stopping = false;
|
|
73
|
+
this.stopped = true;
|
|
72
74
|
this.$emit('loading-end');
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
77
|
onActiveUpdate(newValue) {
|
|
78
|
+
this.stopped = false;
|
|
76
79
|
this.stopping = !newValue;
|
|
77
80
|
if (!newValue) {
|
|
78
81
|
this.$refs.loading.addEventListener('animationend', this.onEnd);
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
:name="item.name"
|
|
132
132
|
:data-test="item.name"
|
|
133
133
|
:label="item.label"
|
|
134
|
+
:disabled="item.disabled"
|
|
134
135
|
style="pointer-events: none;"
|
|
135
136
|
/>
|
|
136
137
|
</div>
|
|
@@ -407,7 +408,9 @@ export default {
|
|
|
407
408
|
onEnter() {
|
|
408
409
|
if (this.open) {
|
|
409
410
|
this.onItemClick(this.highlighted);
|
|
410
|
-
this.$refs.input
|
|
411
|
+
if (this.$refs.input) {
|
|
412
|
+
this.$refs.input.focus();
|
|
413
|
+
}
|
|
411
414
|
this.filter = '';
|
|
412
415
|
|
|
413
416
|
this.doOpen(false);
|
|
@@ -446,17 +449,20 @@ export default {
|
|
|
446
449
|
this.highlighted = val;
|
|
447
450
|
},
|
|
448
451
|
onItemClick(val) {
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
451
|
-
this.dataValue.
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
452
|
+
const option = this.options.find(item => item.value === val);
|
|
453
|
+
if (option && !option.disabled) {
|
|
454
|
+
const index = this.dataValue.findIndex(item => val === item);
|
|
455
|
+
if (index > -1) {
|
|
456
|
+
this.dataValue.splice(index, 1);
|
|
457
|
+
} else {
|
|
458
|
+
this.dataValue.push(val);
|
|
459
|
+
}
|
|
460
|
+
if (this.selectionFeedback === selectionFeedbackOptions[TOP]) {
|
|
461
|
+
this.updateOptions();
|
|
462
|
+
}
|
|
463
|
+
this.$refs.button.focus();
|
|
464
|
+
this.$emit('change', this.dataValue);
|
|
457
465
|
}
|
|
458
|
-
this.$refs.button.focus();
|
|
459
|
-
this.$emit('change', this.dataValue);
|
|
460
466
|
},
|
|
461
467
|
inputClick() {
|
|
462
468
|
if (!this.open) {
|