@carbon/vue 1.0.2 → 1.1.3
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 +192 -0
- package/README.md +156 -211
- package/dist/carbon-vue.common.js +10567 -12509
- package/dist/carbon-vue.common.js.map +1 -1
- package/dist/carbon-vue.umd.js +10567 -12509
- package/dist/carbon-vue.umd.js.map +1 -1
- package/dist/carbon-vue.umd.min.js +31 -7
- package/dist/carbon-vue.umd.min.js.map +1 -1
- package/dist/demo.html +2 -2
- package/package.json +17 -157
- package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +3 -13
- package/src/components/cv-accordion/cv-accordion-item.vue +2 -9
- package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +3 -1
- package/src/components/cv-button/cv-button-skeleton.vue +1 -6
- package/src/components/cv-button/cv-button.vue +15 -37
- package/src/components/cv-checkbox/cv-checkbox.vue +42 -26
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +13 -23
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +11 -5
- package/src/components/cv-code-snippet/_cv-feedback-button.vue +1 -3
- package/src/components/cv-code-snippet/cv-code-snippet.vue +2 -7
- package/src/components/cv-content-switcher/cv-content-switcher-button.vue +20 -4
- package/src/components/cv-content-switcher/cv-content-switcher.vue +3 -10
- package/src/components/cv-data-table/cv-data-table-row.vue +15 -11
- package/src/components/cv-data-table/cv-data-table.vue +30 -28
- package/src/components/cv-date-picker/cv-date-picker.vue +53 -47
- package/src/components/cv-dropdown/_cv-dropdown-inner-c10.vue +226 -0
- package/src/components/cv-dropdown/_cv-dropdown-inner.vue +201 -0
- package/src/components/cv-dropdown/cv-dropdown-item.vue +6 -8
- package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +1 -5
- package/src/components/cv-dropdown/cv-dropdown.vue +22 -169
- package/src/components/cv-file-uploader/cv-file-uploader.vue +44 -22
- package/src/components/cv-inline-loading/cv-inline-loading.vue +37 -0
- package/src/components/cv-inline-notification/cv-inline-notification.vue +22 -19
- package/src/components/cv-link/cv-link.vue +1 -6
- package/src/components/cv-loading/cv-loading.vue +13 -4
- package/src/components/cv-modal/cv-modal.vue +17 -15
- package/src/components/cv-number-input/cv-number-input.vue +20 -32
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +13 -19
- package/src/components/cv-pagination/cv-pagination.vue +61 -42
- package/src/components/cv-progress/_cv-progress-step-complete.vue +3 -12
- package/src/components/cv-progress/cv-progress-step.vue +97 -0
- package/src/components/cv-progress/cv-progress.vue +68 -13
- package/src/components/cv-radio-button/cv-radio-button.vue +1 -0
- package/src/components/cv-search/cv-search.vue +144 -15
- package/src/components/cv-select/cv-select-option.vue +3 -1
- package/src/components/cv-select/cv-select.vue +147 -15
- package/src/components/cv-slider/cv-slider.vue +14 -43
- package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +18 -6
- package/src/components/cv-structured-list/cv-structured-list-item.vue +1 -3
- package/src/components/cv-structured-list/cv-structured-list.vue +10 -2
- package/src/components/cv-tabs/cv-tabs.vue +31 -15
- package/src/components/cv-tag/cv-tag.vue +23 -13
- package/src/components/cv-text-area/cv-text-area.vue +23 -10
- package/src/components/cv-text-input/cv-text-input.vue +80 -10
- package/src/components/cv-tile/_cv-tile-clickable.vue +1 -5
- package/src/components/cv-tile/_cv-tile-expandable.vue +11 -15
- package/src/components/cv-tile/_cv-tile-selectable.vue +14 -3
- package/src/components/cv-tile/cv-tile.vue +1 -4
- package/src/components/cv-time-picker/cv-time-picker.vue +27 -29
- package/src/components/cv-toast-notification/cv-toast-notification.vue +32 -6
- package/src/components/cv-toggle/cv-toggle.vue +3 -7
- package/src/components/cv-toolbar/cv-toolbar-option.vue +1 -4
- package/src/components/cv-toolbar/cv-toolbar-search.vue +5 -0
- package/src/components/cv-tooltip/cv-definition-tooltip.vue +1 -3
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +13 -28
- package/src/components/cv-tooltip/cv-tooltip.vue +11 -15
- package/src/components/cv-wrapper/_cv-wrapper.js +33 -0
- package/src/index-components-vue.js +1 -3
- package/src/index.js +1 -5
- package/src/{_internal/_feature-flags.js → internal/feature-flags.js} +30 -2
- package/dist/carbon-data-viz-vue.common.js +0 -23907
- package/dist/carbon-data-viz-vue.common.js.map +0 -1
- package/dist/carbon-data-viz-vue.css +0 -1
- package/dist/carbon-data-viz-vue.umd.js +0 -23917
- package/dist/carbon-data-viz-vue.umd.js.map +0 -1
- package/dist/carbon-data-viz-vue.umd.min.js +0 -2
- package/dist/carbon-data-viz-vue.umd.min.js.map +0 -1
- package/src/assets/styles/_carbon-helpers.scss +0 -8
- package/src/components/cv-checkbox/_cv-checkbox-inner-form-item.vue +0 -19
- package/src/components/cv-checkbox/_cv-checkbox-inner.vue +0 -59
- package/src/components/cv-progress/_cv-progress-step.vue +0 -51
- package/src/components/cv-search/_cv-search-inner-form-item.vue +0 -22
- package/src/components/cv-search/_cv-search-inner.vue +0 -162
- package/src/components/cv-select/_cv-select-inner-form-item.vue +0 -22
- package/src/components/cv-select/_cv-select-inner.vue +0 -78
- package/src/data-viz/cv-bar-graph/cv-bar-graph.vue +0 -495
- package/src/data-viz/cv-gauge/cv-gauge.vue +0 -196
- package/src/data-viz/cv-pie-chart/cv-pie-chart.vue +0 -194
- package/src/index-data-viz.js +0 -29
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<label
|
|
3
|
+
:data-wibble="`${isChecked}`"
|
|
3
4
|
:for="uid"
|
|
4
5
|
aria-label="tile"
|
|
5
6
|
class="cv-tile-selectable bx--tile--selectable"
|
|
7
|
+
:class="{ 'bx--tile--is-selected': isChecked }"
|
|
6
8
|
data-tile="selectable"
|
|
7
9
|
tabindex="0"
|
|
8
|
-
:class="[{ 'bx--tile--is-selected': isChecked }]"
|
|
9
10
|
:data-contained-checkbox-state="isChecked"
|
|
10
11
|
>
|
|
11
12
|
<input
|
|
@@ -16,16 +17,20 @@
|
|
|
16
17
|
:checked="isChecked"
|
|
17
18
|
class="bx--tile-input"
|
|
18
19
|
v-bind="$attrs"
|
|
20
|
+
v-on="inputListeners"
|
|
19
21
|
/>
|
|
20
22
|
<div class="bx--tile__checkmark">
|
|
21
|
-
<
|
|
23
|
+
<CheckmarkFilled16 v-if="componentsX" />
|
|
24
|
+
<svg v-else width="16" height="16" viewBox="0 0 16 16" fill-rule="evenodd">
|
|
22
25
|
<path
|
|
23
26
|
d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zM6.7 11.5L3.4 8.1l1.4-1.4 1.9 1.9 4.1-4.1 1.4 1.4-5.5 5.6z"
|
|
24
27
|
></path>
|
|
25
28
|
</svg>
|
|
26
29
|
</div>
|
|
27
30
|
<div class="bx--tile-content">
|
|
28
|
-
<slot>
|
|
31
|
+
<slot>
|
|
32
|
+
<!-- Tile content here -->
|
|
33
|
+
</slot>
|
|
29
34
|
</div>
|
|
30
35
|
</label>
|
|
31
36
|
</template>
|
|
@@ -33,11 +38,17 @@
|
|
|
33
38
|
<script>
|
|
34
39
|
import uidMixin from '../../mixins/uid-mixin';
|
|
35
40
|
import checkMixin from '../../mixins/check-mixin';
|
|
41
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
42
|
+
import CheckmarkFilled16 from '@carbon/icons-vue/lib/checkmark--filled/16';
|
|
36
43
|
|
|
37
44
|
export default {
|
|
38
45
|
name: 'CvTileSelectable',
|
|
39
46
|
mixins: [uidMixin, checkMixin],
|
|
47
|
+
components: { CheckmarkFilled16 },
|
|
40
48
|
inheritAttrs: false,
|
|
49
|
+
data() {
|
|
50
|
+
return { componentsX };
|
|
51
|
+
},
|
|
41
52
|
};
|
|
42
53
|
</script>
|
|
43
54
|
|
|
@@ -38,10 +38,7 @@ export default {
|
|
|
38
38
|
kind: {
|
|
39
39
|
type: String,
|
|
40
40
|
default: '',
|
|
41
|
-
validator: value =>
|
|
42
|
-
['clickable', 'expandable', 'selectable', 'standard', ''].includes(
|
|
43
|
-
value
|
|
44
|
-
),
|
|
41
|
+
validator: value => ['clickable', 'expandable', 'selectable', 'standard', ''].includes(value),
|
|
45
42
|
},
|
|
46
43
|
},
|
|
47
44
|
computed: {
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
<div
|
|
4
4
|
class="bx--time-picker"
|
|
5
5
|
:class="{ 'bx--time-picker--light': theme === 'light' }"
|
|
6
|
+
:data-invalid="isInvalid && componentsX"
|
|
6
7
|
>
|
|
7
8
|
<div class="bx--time-picker__input">
|
|
9
|
+
<label :for="uid" class="bx--label">{{ label }}</label>
|
|
8
10
|
<input
|
|
9
11
|
:id="uid"
|
|
10
12
|
type="text"
|
|
@@ -13,19 +15,18 @@
|
|
|
13
15
|
v-bind="$attrs"
|
|
14
16
|
:placeholder="placeholder"
|
|
15
17
|
:maxlength="placeholder.length"
|
|
16
|
-
:data-invalid="isInvalid"
|
|
18
|
+
:data-invalid="isInvalid && !componentsX"
|
|
17
19
|
:value="time"
|
|
18
20
|
:disabled="disabled"
|
|
19
21
|
@input="$emit('update:time', $event.target.value)"
|
|
20
22
|
/>
|
|
21
|
-
<div class="bx--form-requirement" v-if="isInvalid">
|
|
23
|
+
<div class="bx--form-requirement" v-if="isInvalid && !componentsX">
|
|
22
24
|
<slot name="invalid-message">{{ invalidMessage }}</slot>
|
|
23
25
|
</div>
|
|
24
|
-
<label :for="uid" class="bx--label">{{ label }}</label>
|
|
25
26
|
</div>
|
|
26
27
|
<cv-select
|
|
27
28
|
class="bx--time-picker__select"
|
|
28
|
-
inline
|
|
29
|
+
:inline="!componentsX"
|
|
29
30
|
:form-item="false"
|
|
30
31
|
hide-label
|
|
31
32
|
:label="ampmSelectLabel"
|
|
@@ -33,17 +34,13 @@
|
|
|
33
34
|
:value="ampm"
|
|
34
35
|
:disabled="disabled"
|
|
35
36
|
>
|
|
36
|
-
<cv-select-option class="bx--select-option" value="AM"
|
|
37
|
-
|
|
38
|
-
>
|
|
39
|
-
<cv-select-option class="bx--select-option" value="PM"
|
|
40
|
-
>PM</cv-select-option
|
|
41
|
-
>
|
|
37
|
+
<cv-select-option class="bx--select-option" value="AM">AM</cv-select-option>
|
|
38
|
+
<cv-select-option class="bx--select-option" value="PM">PM</cv-select-option>
|
|
42
39
|
</cv-select>
|
|
43
40
|
|
|
44
41
|
<cv-select
|
|
45
42
|
class="bx--time-picker__select"
|
|
46
|
-
inline
|
|
43
|
+
:inline="!componentsX"
|
|
47
44
|
:form-item="false"
|
|
48
45
|
hide-label
|
|
49
46
|
:label="timezonesSelectLabel"
|
|
@@ -52,24 +49,30 @@
|
|
|
52
49
|
@input="$emit('update:timezone', $event)"
|
|
53
50
|
:disabled="disabled"
|
|
54
51
|
>
|
|
55
|
-
<cv-select-option
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
:key="item.value"
|
|
59
|
-
:value="item.value"
|
|
60
|
-
>{{ item.label }}</cv-select-option
|
|
61
|
-
>
|
|
52
|
+
<cv-select-option class="bx--select-option" v-for="item in timezones" :key="item.value" :value="item.value">
|
|
53
|
+
{{ item.label }}
|
|
54
|
+
</cv-select-option>
|
|
62
55
|
</cv-select>
|
|
63
56
|
</div>
|
|
57
|
+
<div class="bx--form-requirement" v-if="isInvalid && componentsX">
|
|
58
|
+
<slot name="invalid-message">{{ invalidMessage }}</slot>
|
|
59
|
+
</div>
|
|
64
60
|
</div>
|
|
65
61
|
</template>
|
|
66
62
|
|
|
67
63
|
<script>
|
|
68
64
|
import uidMixin from '../../mixins/uid-mixin';
|
|
69
65
|
import themeMixin from '../../mixins/theme-mixin';
|
|
66
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
67
|
+
import CvSelect from '../cv-select/cv-select';
|
|
68
|
+
import CvSelectOption from '../cv-select/cv-select-option';
|
|
70
69
|
|
|
71
70
|
export default {
|
|
72
71
|
name: 'CvTimePicker',
|
|
72
|
+
components: {
|
|
73
|
+
CvSelect,
|
|
74
|
+
CvSelectOption,
|
|
75
|
+
},
|
|
73
76
|
mixins: [uidMixin, themeMixin],
|
|
74
77
|
inheritAttrs: false,
|
|
75
78
|
props: {
|
|
@@ -88,21 +91,20 @@ export default {
|
|
|
88
91
|
timezones: { type: Array, default: () => [] },
|
|
89
92
|
timezonesSelectLabel: { type: String, default: 'Select time zone' },
|
|
90
93
|
},
|
|
94
|
+
data() {
|
|
95
|
+
return { componentsX };
|
|
96
|
+
},
|
|
91
97
|
computed: {
|
|
92
98
|
isInvalid() {
|
|
93
99
|
return (
|
|
94
|
-
this.$slots['invalid-message'] ||
|
|
100
|
+
(this.$slots['invalid-message'] && this.$slots['invalid-message'].length) ||
|
|
95
101
|
(this.invalidMessage && this.invalidMessage.length > 0)
|
|
96
102
|
);
|
|
97
103
|
},
|
|
98
104
|
validAmpm() {
|
|
99
105
|
let result = this.ampm;
|
|
100
106
|
if (!['AM', 'PM'].includes(this.ampm)) {
|
|
101
|
-
console.error(
|
|
102
|
-
`CvTimePicker: invalid value '${
|
|
103
|
-
this.ampm
|
|
104
|
-
}' supplied for prop ampm. Default applied.`
|
|
105
|
-
);
|
|
107
|
+
console.error(`CvTimePicker: invalid value '${this.ampm}' supplied for prop ampm. Default applied.`);
|
|
106
108
|
// set to valid value
|
|
107
109
|
result = this.ampm[0].value;
|
|
108
110
|
this.$emit('update:ampm', result);
|
|
@@ -114,11 +116,7 @@ export default {
|
|
|
114
116
|
let result = this.timezone;
|
|
115
117
|
if (this.timezones && this.timezones.length) {
|
|
116
118
|
if (!this.timezones.find(item => item.value === this.timezone)) {
|
|
117
|
-
console.error(
|
|
118
|
-
`CvTimePicker: invalid value '${
|
|
119
|
-
this.timezone
|
|
120
|
-
}' supplied for prop timezone. Default applied.`
|
|
121
|
-
);
|
|
119
|
+
console.error(`CvTimePicker: invalid value '${this.timezone}' supplied for prop timezone. Default applied.`);
|
|
122
120
|
// set to first valid value
|
|
123
121
|
result = this.timezones[0].value;
|
|
124
122
|
this.$emit('update:timezone', result);
|
|
@@ -7,18 +7,16 @@
|
|
|
7
7
|
:aria-role="isAlert ? 'alert' : false"
|
|
8
8
|
:aria-live="!isAlert ? 'polite' : false"
|
|
9
9
|
>
|
|
10
|
+
<component v-if="componentsX" :is="icon" class="bx--toast-notification__icon" />
|
|
10
11
|
<div class="bx--toast-notification__details">
|
|
11
12
|
<h3 class="bx--toast-notification__title">{{ title }}</h3>
|
|
12
13
|
<p class="bx--toast-notification__subtitle">{{ subTitle }}</p>
|
|
13
14
|
<p class="bx--toast-notification__caption">{{ caption }}</p>
|
|
14
15
|
</div>
|
|
15
|
-
<button
|
|
16
|
-
|
|
17
|
-
data-notification-btn
|
|
18
|
-
class="bx--toast-notification__close-button"
|
|
19
|
-
@click="$emit('close')"
|
|
20
|
-
>
|
|
16
|
+
<button type="button" data-notification-btn class="bx--toast-notification__close-button" @click="$emit('close')">
|
|
17
|
+
<Close16 v-if="componentsX" class="bx--toast-notification__close-icon" />
|
|
21
18
|
<svg
|
|
19
|
+
v-else
|
|
22
20
|
class="bx--toast-notification-icon"
|
|
23
21
|
aria-label="close"
|
|
24
22
|
width="10"
|
|
@@ -37,9 +35,20 @@
|
|
|
37
35
|
|
|
38
36
|
<script>
|
|
39
37
|
import notificationMixin from '../../mixins/notification-mixin';
|
|
38
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
39
|
+
import ErrorFilled16 from '@carbon/icons-vue/lib/error--filled/16';
|
|
40
|
+
import CheckmarkFilled16 from '@carbon/icons-vue/lib/checkmark--filled/16';
|
|
41
|
+
import WarningAltFilled16 from '@carbon/icons-vue/lib/warning--alt--filled/16';
|
|
42
|
+
import Close16 from '@carbon/icons-vue/lib/close/16';
|
|
40
43
|
|
|
41
44
|
export default {
|
|
42
45
|
name: 'CvToastNotification',
|
|
46
|
+
components: { Close16 },
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
componentsX,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
43
52
|
mixins: [notificationMixin],
|
|
44
53
|
props: {
|
|
45
54
|
caption: String,
|
|
@@ -49,6 +58,23 @@ export default {
|
|
|
49
58
|
validator: val => ['error', 'info', 'warning', 'success'].includes(val),
|
|
50
59
|
},
|
|
51
60
|
},
|
|
61
|
+
computed: {
|
|
62
|
+
icon() {
|
|
63
|
+
if (this.componentsX) {
|
|
64
|
+
switch (this.kind) {
|
|
65
|
+
case 'error':
|
|
66
|
+
return ErrorFilled16;
|
|
67
|
+
case 'warning':
|
|
68
|
+
return WarningAltFilled16;
|
|
69
|
+
case 'success':
|
|
70
|
+
return CheckmarkFilled16;
|
|
71
|
+
default:
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
},
|
|
77
|
+
},
|
|
52
78
|
};
|
|
53
79
|
</script>
|
|
54
80
|
|
|
@@ -11,16 +11,12 @@
|
|
|
11
11
|
:aria-checked="`${isChecked}`"
|
|
12
12
|
:value="value"
|
|
13
13
|
/>
|
|
14
|
-
<label
|
|
15
|
-
class="bx--
|
|
16
|
-
:for="uid"
|
|
17
|
-
:data-contained-checkbox-state="isChecked"
|
|
18
|
-
>
|
|
19
|
-
<div class="bx--toggle__text--left" v-if="!small">
|
|
14
|
+
<label class="bx--toggle__label" :for="uid" :data-contained-checkbox-state="isChecked">
|
|
15
|
+
<div class="bx--toggle__text--left">
|
|
20
16
|
<slot name="text-left">Off</slot>
|
|
21
17
|
</div>
|
|
22
18
|
<span class="bx--toggle__appearance"></span>
|
|
23
|
-
<div class="bx--toggle__text--right"
|
|
19
|
+
<div class="bx--toggle__text--right">
|
|
24
20
|
<slot name="text-right">On</slot>
|
|
25
21
|
</div>
|
|
26
22
|
</label>
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<li
|
|
3
|
-
class="cv-toolbar-option bx--toolbar-menu__option"
|
|
4
|
-
@keydown.esc.prevent="$parent.$emit('cv:close')"
|
|
5
|
-
>
|
|
2
|
+
<li class="cv-toolbar-option bx--toolbar-menu__option" @keydown.esc.prevent="$parent.$emit('cv:close')">
|
|
6
3
|
<slot></slot>
|
|
7
4
|
</li>
|
|
8
5
|
</template>
|
|
@@ -20,9 +20,7 @@ export default {
|
|
|
20
20
|
const validValues = ['top', 'bottom'];
|
|
21
21
|
const valid = validValues.includes(val);
|
|
22
22
|
if (!valid) {
|
|
23
|
-
console.warn(
|
|
24
|
-
`CVDefinitionTooltip.direction must be one of the following: ${validValues}`
|
|
25
|
-
);
|
|
23
|
+
console.warn(`CVDefinitionTooltip.direction must be one of the following: ${validValues}`);
|
|
26
24
|
}
|
|
27
25
|
return valid;
|
|
28
26
|
},
|
|
@@ -18,12 +18,8 @@
|
|
|
18
18
|
@focusout="checkFocusOut"
|
|
19
19
|
>
|
|
20
20
|
<slot name="trigger">
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
height="16"
|
|
24
|
-
viewBox="0 0 16 16"
|
|
25
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
-
>
|
|
21
|
+
<Information16 v-if="componentsX" class="banana" />
|
|
22
|
+
<svg v-else width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
27
23
|
<g fill-rule="evenodd">
|
|
28
24
|
<path
|
|
29
25
|
d="M8 14.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13zM8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"
|
|
@@ -51,7 +47,7 @@
|
|
|
51
47
|
class="cv-interactive-tooltip__before-content"
|
|
52
48
|
ref="beforeContent"
|
|
53
49
|
tabindex="0"
|
|
54
|
-
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
50
|
+
style="position: absolute; height: 1px; width: 1px; left: -9999px;"
|
|
55
51
|
@focus="focusBeforeContent"
|
|
56
52
|
/>
|
|
57
53
|
<span class="bx--tooltip__caret"></span>
|
|
@@ -60,7 +56,7 @@
|
|
|
60
56
|
class="cv-interactive-tooltip__after-content"
|
|
61
57
|
ref="afterContent"
|
|
62
58
|
tabindex="0"
|
|
63
|
-
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
59
|
+
style="position: absolute; height: 1px; width: 1px; left: -9999px;"
|
|
64
60
|
@focus="focusAfterContent"
|
|
65
61
|
/>
|
|
66
62
|
</div>
|
|
@@ -69,10 +65,13 @@
|
|
|
69
65
|
|
|
70
66
|
<script>
|
|
71
67
|
import uidMixin from '../../mixins/uid-mixin';
|
|
68
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
69
|
+
import Information16 from '@carbon/icons-vue/lib/information/16';
|
|
72
70
|
|
|
73
71
|
export default {
|
|
74
72
|
name: 'CvInteractiveTooltip',
|
|
75
73
|
mixins: [uidMixin],
|
|
74
|
+
components: { Information16 },
|
|
76
75
|
props: {
|
|
77
76
|
direction: {
|
|
78
77
|
type: String,
|
|
@@ -81,9 +80,7 @@ export default {
|
|
|
81
80
|
const validValues = ['top', 'bottom', 'right', 'left'];
|
|
82
81
|
const valid = validValues.includes(val);
|
|
83
82
|
if (!valid) {
|
|
84
|
-
console.warn(
|
|
85
|
-
`CVInteractiveTooltip.direction must be one of the following: ${validValues}`
|
|
86
|
-
);
|
|
83
|
+
console.warn(`CVInteractiveTooltip.direction must be one of the following: ${validValues}`);
|
|
87
84
|
}
|
|
88
85
|
return valid;
|
|
89
86
|
},
|
|
@@ -92,6 +89,7 @@ export default {
|
|
|
92
89
|
},
|
|
93
90
|
data() {
|
|
94
91
|
return {
|
|
92
|
+
componentsX,
|
|
95
93
|
dataVisible: false,
|
|
96
94
|
left: -9999, // offscreen
|
|
97
95
|
top: 0,
|
|
@@ -139,26 +137,15 @@ export default {
|
|
|
139
137
|
if (this.direction === 'bottom') {
|
|
140
138
|
this.top = menuPosition.bottom + 10 + window.scrollY;
|
|
141
139
|
} else {
|
|
142
|
-
this.top =
|
|
143
|
-
menuPosition.top -
|
|
144
|
-
15 -
|
|
145
|
-
this.$refs.popup.offsetHeight +
|
|
146
|
-
window.scrollY;
|
|
140
|
+
this.top = menuPosition.top - 15 - this.$refs.popup.offsetHeight + window.scrollY;
|
|
147
141
|
}
|
|
148
142
|
} else {
|
|
149
143
|
this.top =
|
|
150
144
|
menuPosition.top +
|
|
151
|
-
(this.$refs.trigger.offsetHeight -
|
|
152
|
-
0.5 -
|
|
153
|
-
this.$refs.popup.offsetHeight) /
|
|
154
|
-
2 +
|
|
145
|
+
(this.$refs.trigger.offsetHeight - 0.5 - this.$refs.popup.offsetHeight) / 2 +
|
|
155
146
|
window.scrollY;
|
|
156
147
|
if (this.direction === 'left') {
|
|
157
|
-
this.left =
|
|
158
|
-
menuPosition.left -
|
|
159
|
-
10 -
|
|
160
|
-
this.$refs.popup.offsetWidth +
|
|
161
|
-
window.scrollX;
|
|
148
|
+
this.left = menuPosition.left - 10 - this.$refs.popup.offsetWidth + window.scrollX;
|
|
162
149
|
} else {
|
|
163
150
|
this.left = menuPosition.right + 15 + window.scrollX;
|
|
164
151
|
}
|
|
@@ -198,9 +185,7 @@ export default {
|
|
|
198
185
|
}
|
|
199
186
|
},
|
|
200
187
|
checkFocusOut(ev) {
|
|
201
|
-
this.dataVisible =
|
|
202
|
-
ev.relatedTarget === this.$refs.trigger ||
|
|
203
|
-
this.$refs.popup.contains(ev.relatedTarget);
|
|
188
|
+
this.dataVisible = ev.relatedTarget === this.$refs.trigger || this.$refs.popup.contains(ev.relatedTarget);
|
|
204
189
|
},
|
|
205
190
|
focusBeforeContent(ev) {
|
|
206
191
|
if (this.contentAfter) {
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cv-tooltip bx--tooltip--icon">
|
|
3
|
-
<div
|
|
4
|
-
tabindex="0"
|
|
5
|
-
class="bx--tooltip__trigger"
|
|
6
|
-
:class="`bx--tooltip--icon__${direction}`"
|
|
7
|
-
:aria-label="tip"
|
|
8
|
-
>
|
|
3
|
+
<div tabindex="0" class="bx--tooltip__trigger" :class="`bx--tooltip--icon__${direction}`" :aria-label="tip">
|
|
9
4
|
<slot>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
height="16"
|
|
13
|
-
viewBox="0 0 16 16"
|
|
14
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
-
>
|
|
5
|
+
<Information16 v-if="componentsX" />
|
|
6
|
+
<svg v-else width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
16
7
|
<g fill-rule="evenodd">
|
|
17
8
|
<path
|
|
18
9
|
d="M8 14.5a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13zM8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"
|
|
@@ -28,8 +19,15 @@
|
|
|
28
19
|
</template>
|
|
29
20
|
|
|
30
21
|
<script>
|
|
22
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
23
|
+
import Information16 from '@carbon/icons-vue/lib/information/16';
|
|
24
|
+
|
|
31
25
|
export default {
|
|
32
26
|
name: 'CvTooltip',
|
|
27
|
+
components: { Information16 },
|
|
28
|
+
data() {
|
|
29
|
+
return { componentsX };
|
|
30
|
+
},
|
|
33
31
|
props: {
|
|
34
32
|
direction: {
|
|
35
33
|
type: String,
|
|
@@ -38,9 +36,7 @@ export default {
|
|
|
38
36
|
const validValues = ['top', 'bottom'];
|
|
39
37
|
const valid = validValues.includes(val);
|
|
40
38
|
if (!valid) {
|
|
41
|
-
console.warn(
|
|
42
|
-
`CVTooltip.direction must be one of the following: ${validValues}`
|
|
43
|
-
);
|
|
39
|
+
console.warn(`CVTooltip.direction must be one of the following: ${validValues}`);
|
|
44
40
|
}
|
|
45
41
|
return valid;
|
|
46
42
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This component optionally wraps slotted content with the specified tag-type.
|
|
3
|
+
*
|
|
4
|
+
* If no tag-type is supplied then the slotted content is unwrapped.
|
|
5
|
+
*
|
|
6
|
+
* Unwrapped slots do not recieve class, style or attributes attached to the wrapper
|
|
7
|
+
*
|
|
8
|
+
* NOTE: If used at the top level of a component in the unwrapped case your component still needs to have a single root node.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export default {
|
|
12
|
+
name: 'CvWrapper',
|
|
13
|
+
functional: true,
|
|
14
|
+
props: {
|
|
15
|
+
tagType: { type: String, default: null },
|
|
16
|
+
},
|
|
17
|
+
render(createElement, context) {
|
|
18
|
+
if (context.props.tagType) {
|
|
19
|
+
return createElement(
|
|
20
|
+
context.props.tagType,
|
|
21
|
+
{
|
|
22
|
+
attrs: context.data.attrs,
|
|
23
|
+
class: `${context.data.class || ''} ${context.data.staticClass || ''}`.trim(),
|
|
24
|
+
style: { ...context.data.staticStyle, ...context.data.style },
|
|
25
|
+
on: context.listeners,
|
|
26
|
+
},
|
|
27
|
+
context.slots().default
|
|
28
|
+
);
|
|
29
|
+
} else {
|
|
30
|
+
return context.slots().default;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -2,6 +2,4 @@ console.error(
|
|
|
2
2
|
'The built und and commonjs modules have been renamed from "carbon-components-vue..." to "carbon-vue..."'
|
|
3
3
|
);
|
|
4
4
|
|
|
5
|
-
alert(
|
|
6
|
-
`The built und and mommonjs modules have been renamed from "carbon-components-vue..." to "carbon-vue..."`
|
|
7
|
-
);
|
|
5
|
+
alert(`The built und and mommonjs modules have been renamed from "carbon-components-vue..." to "carbon-vue..."`);
|
package/src/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
const ctx = require.context(
|
|
2
|
-
'./components/',
|
|
3
|
-
true,
|
|
4
|
-
/^(?!.*(?:\/_|-story\.vue|-test\.vue)).*\.vue$/
|
|
5
|
-
);
|
|
1
|
+
const ctx = require.context('./components/', true, /^(?!.*(?:\/_|-story\.vue|-test\.vue)).*\.vue$/);
|
|
6
2
|
const components = ctx.keys().map(ctx);
|
|
7
3
|
|
|
8
4
|
export default {
|
|
@@ -20,9 +20,37 @@
|
|
|
20
20
|
/**
|
|
21
21
|
* Breaking changes for next release.
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export let breakingChangesX;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Next gen of Carbon component design.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export let componentsX;
|
|
29
|
+
|
|
30
|
+
const defaults = {
|
|
31
|
+
componentsX: false,
|
|
32
|
+
breakingChangesX: false,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const versions = (experimental = true) => {
|
|
36
|
+
const vers = [];
|
|
37
|
+
if (!defaults.componentsX) {
|
|
38
|
+
vers.push({ default: true });
|
|
39
|
+
}
|
|
40
|
+
if (experimental) {
|
|
41
|
+
vers.push({ experimental: true, default: defaults.componentsX });
|
|
42
|
+
}
|
|
43
|
+
return vers;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const setVersion = val => {
|
|
47
|
+
if (val && val.experimental) {
|
|
48
|
+
breakingChangesX = true;
|
|
49
|
+
componentsX = true;
|
|
50
|
+
} else {
|
|
51
|
+
componentsX = defaults.componentsX;
|
|
52
|
+
breakingChangesX = defaults.breakingChangesX;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
setVersion();
|