@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,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cv-slider bx--form-item">
|
|
3
|
-
<label :for="uid" class="bx--label">{{ label }}</label>
|
|
3
|
+
<label :for="uid" class="bx--label" :class="{ 'bx--label--disabled': componentsX && disabled }">{{ label }}</label>
|
|
4
4
|
<div class="bx--slider-container">
|
|
5
5
|
<span class="bx--slider__range-label">{{ internalMinLabel }}</span>
|
|
6
6
|
<div
|
|
@@ -10,10 +10,7 @@
|
|
|
10
10
|
data-slider-input-box="#slider-input-box"
|
|
11
11
|
>
|
|
12
12
|
<div class="bx--slider__track" @click="onTrackClick" ref="track"></div>
|
|
13
|
-
<div
|
|
14
|
-
class="bx--slider__filled-track"
|
|
15
|
-
:style="`width: ${percentage};`"
|
|
16
|
-
></div>
|
|
13
|
+
<div class="bx--slider__filled-track" :style="`width: ${percentage};`"></div>
|
|
17
14
|
<div
|
|
18
15
|
class="bx--slider__thumb"
|
|
19
16
|
:class="{
|
|
@@ -26,15 +23,7 @@
|
|
|
26
23
|
@keydown.down.left.prevent="onDown"
|
|
27
24
|
@mousedown="onStartDrag"
|
|
28
25
|
></div>
|
|
29
|
-
<input
|
|
30
|
-
:id="uid"
|
|
31
|
-
class="bx--slider__input"
|
|
32
|
-
type="range"
|
|
33
|
-
:step="step"
|
|
34
|
-
:min="min"
|
|
35
|
-
:max="max"
|
|
36
|
-
ref="range"
|
|
37
|
-
/>
|
|
26
|
+
<input :id="uid" class="bx--slider__input" type="range" :step="step" :min="min" :max="max" ref="range" />
|
|
38
27
|
</div>
|
|
39
28
|
<span class="bx--slider__range-label">{{ internalMaxLabel }}</span>
|
|
40
29
|
<input
|
|
@@ -56,6 +45,7 @@
|
|
|
56
45
|
<script>
|
|
57
46
|
import uidMixin from '../../mixins/uid-mixin';
|
|
58
47
|
import themeMixin from '../../mixins/theme-mixin';
|
|
48
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
59
49
|
|
|
60
50
|
export default {
|
|
61
51
|
name: 'CvSlider',
|
|
@@ -91,6 +81,7 @@ export default {
|
|
|
91
81
|
},
|
|
92
82
|
data() {
|
|
93
83
|
return {
|
|
84
|
+
componentsX,
|
|
94
85
|
internalValue: '',
|
|
95
86
|
animateClick: false,
|
|
96
87
|
isDragging: false,
|
|
@@ -115,8 +106,7 @@ export default {
|
|
|
115
106
|
mounted() {
|
|
116
107
|
this.$refs.range.value = this.value;
|
|
117
108
|
this.internalValue = this.$refs.range.value;
|
|
118
|
-
this.percentage = `${((this.internalValue - this.getMin()) * 100) /
|
|
119
|
-
(this.getMax() - this.getMin())}%`;
|
|
109
|
+
this.percentage = `${((this.internalValue - this.getMin()) * 100) / (this.getMax() - this.getMin())}%`;
|
|
120
110
|
},
|
|
121
111
|
watch: {
|
|
122
112
|
value(val) {
|
|
@@ -176,16 +166,13 @@ export default {
|
|
|
176
166
|
this.$refs.range.value = newValue;
|
|
177
167
|
this.internalValue = this.$refs.range.value;
|
|
178
168
|
|
|
179
|
-
this.percentage = `${((this.internalValue - this.getMin()) * 100) /
|
|
180
|
-
(this.getMax() - this.getMin())}%`;
|
|
169
|
+
this.percentage = `${((this.internalValue - this.getMin()) * 100) / (this.getMax() - this.getMin())}%`;
|
|
181
170
|
|
|
182
171
|
this.$emit('modelEvent', this.$refs.range.value);
|
|
183
172
|
this.$emit('change', this.$refs.range.value);
|
|
184
173
|
},
|
|
185
174
|
onChange() {
|
|
186
|
-
let newValue = this.internalValue.length
|
|
187
|
-
? parseFloat(this.internalValue)
|
|
188
|
-
: this.getMin();
|
|
175
|
+
let newValue = this.internalValue.length ? parseFloat(this.internalValue) : this.getMin();
|
|
189
176
|
this.setValue(newValue);
|
|
190
177
|
},
|
|
191
178
|
onStartDrag(ev) {
|
|
@@ -199,11 +186,9 @@ export default {
|
|
|
199
186
|
onDrag(ev) {
|
|
200
187
|
if (this.isDragging) {
|
|
201
188
|
// percentage change
|
|
202
|
-
let newValue =
|
|
203
|
-
(ev.clientX - this.dragStartX) / this.$refs.track.offsetWidth;
|
|
189
|
+
let newValue = (ev.clientX - this.dragStartX) / this.$refs.track.offsetWidth;
|
|
204
190
|
// uncapped new value
|
|
205
|
-
newValue =
|
|
206
|
-
this.dragStartValue + (this.getMax() - this.getMin()) * newValue;
|
|
191
|
+
newValue = this.dragStartValue + (this.getMax() - this.getMin()) * newValue;
|
|
207
192
|
|
|
208
193
|
this.setValue(newValue, ev);
|
|
209
194
|
}
|
|
@@ -229,27 +214,13 @@ export default {
|
|
|
229
214
|
this.setValue(newValue, ev);
|
|
230
215
|
},
|
|
231
216
|
onUp(ev) {
|
|
232
|
-
let curValue =
|
|
233
|
-
|
|
234
|
-
? parseFloat(ev.target.value)
|
|
235
|
-
: this.getValue();
|
|
236
|
-
let newValue =
|
|
237
|
-
curValue +
|
|
238
|
-
(ev.shiftKey
|
|
239
|
-
? this.internalMultiplier * this.getStep()
|
|
240
|
-
: this.getStep());
|
|
217
|
+
let curValue = ev.target.type === 'number' ? parseFloat(ev.target.value) : this.getValue();
|
|
218
|
+
let newValue = curValue + (ev.shiftKey ? this.internalMultiplier * this.getStep() : this.getStep());
|
|
241
219
|
this.setValue(newValue, ev);
|
|
242
220
|
},
|
|
243
221
|
onDown(ev) {
|
|
244
|
-
let curValue =
|
|
245
|
-
|
|
246
|
-
? parseFloat(ev.target.value)
|
|
247
|
-
: this.getValue();
|
|
248
|
-
let newValue =
|
|
249
|
-
curValue -
|
|
250
|
-
(ev.shiftKey
|
|
251
|
-
? this.internalMultiplier * this.getStep()
|
|
252
|
-
: this.getStep());
|
|
222
|
+
let curValue = ev.target.type === 'number' ? parseFloat(ev.target.value) : this.getValue();
|
|
223
|
+
let newValue = curValue - (ev.shiftKey ? this.internalMultiplier * this.getStep() : this.getStep());
|
|
253
224
|
this.setValue(newValue, ev);
|
|
254
225
|
},
|
|
255
226
|
},
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
tabindex="0"
|
|
8
8
|
>
|
|
9
9
|
<input
|
|
10
|
+
v-if="!componentsX"
|
|
10
11
|
v-bind="$attrs"
|
|
11
12
|
v-on="inputListeners"
|
|
12
13
|
tabindex="-1"
|
|
@@ -17,12 +18,8 @@
|
|
|
17
18
|
type="radio"
|
|
18
19
|
/>
|
|
19
20
|
<div class="bx--structured-list-td">
|
|
20
|
-
<svg
|
|
21
|
-
|
|
22
|
-
width="16"
|
|
23
|
-
height="16"
|
|
24
|
-
viewBox="0 0 16 16"
|
|
25
|
-
>
|
|
21
|
+
<CheckmarkFilled16 v-if="componentsX" class="bx--structured-list-svg" />
|
|
22
|
+
<svg v-else class="bx--structured-list-svg" width="16" height="16" viewBox="0 0 16 16">
|
|
26
23
|
<path
|
|
27
24
|
d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm3.646-10.854L6.75 10.043 4.354 7.646l-.708.708 3.104 3.103 5.604-5.603-.708-.708z"
|
|
28
25
|
fill-rule="evenodd"
|
|
@@ -30,16 +27,31 @@
|
|
|
30
27
|
</svg>
|
|
31
28
|
</div>
|
|
32
29
|
<slot></slot>
|
|
30
|
+
<input
|
|
31
|
+
v-if="componentsX"
|
|
32
|
+
v-bind="$attrs"
|
|
33
|
+
v-on="inputListeners"
|
|
34
|
+
tabindex="-1"
|
|
35
|
+
:id="uid"
|
|
36
|
+
class="bx--structured-list-input"
|
|
37
|
+
:checked="isChecked"
|
|
38
|
+
:value="value"
|
|
39
|
+
type="radio"
|
|
40
|
+
/>
|
|
33
41
|
</label>
|
|
34
42
|
</template>
|
|
35
43
|
|
|
36
44
|
<script>
|
|
37
45
|
import uidMixin from '../../mixins/uid-mixin';
|
|
38
46
|
import radioMixin from '../../mixins/radio-mixin';
|
|
47
|
+
import componentsX from '../../internal/feature-flags';
|
|
48
|
+
import CheckmarkFilled16 from '@carbon/icons-vue/lib/checkmark--filled/16';
|
|
39
49
|
|
|
40
50
|
export default {
|
|
41
51
|
name: 'CvStructuredListItemSelectable',
|
|
52
|
+
inheritAttrs: false,
|
|
42
53
|
mixins: [uidMixin, radioMixin],
|
|
54
|
+
data: () => ({ componentsX }),
|
|
43
55
|
};
|
|
44
56
|
</script>
|
|
45
57
|
|
|
@@ -32,9 +32,7 @@ export default {
|
|
|
32
32
|
},
|
|
33
33
|
computed: {
|
|
34
34
|
tagType() {
|
|
35
|
-
return this.selectable
|
|
36
|
-
? 'cv-structured-list-item-selectable'
|
|
37
|
-
: 'cv-structured-list-item-standard';
|
|
35
|
+
return this.selectable ? 'cv-structured-list-item-selectable' : 'cv-structured-list-item-standard';
|
|
38
36
|
},
|
|
39
37
|
selectable() {
|
|
40
38
|
return this.$parent.selectable;
|
|
@@ -10,15 +10,20 @@
|
|
|
10
10
|
>
|
|
11
11
|
<div class="bx--structured-list-thead">
|
|
12
12
|
<div class="bx--structured-list-row bx--structured-list-row--header-row">
|
|
13
|
-
<div v-if="selectable" class="bx--structured-list-th"></div>
|
|
13
|
+
<div v-if="selectable && !componentsX" class="bx--structured-list-th"></div>
|
|
14
14
|
<slot name="headings"></slot>
|
|
15
|
+
<div v-if="selectable && componentsX" class="bx--structured-list-th"></div>
|
|
15
16
|
</div>
|
|
16
17
|
</div>
|
|
17
|
-
<div class="bx--structured-list-tbody"
|
|
18
|
+
<div class="bx--structured-list-tbody">
|
|
19
|
+
<slot name="items"></slot>
|
|
20
|
+
</div>
|
|
18
21
|
</div>
|
|
19
22
|
</template>
|
|
20
23
|
|
|
21
24
|
<script>
|
|
25
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
26
|
+
|
|
22
27
|
export default {
|
|
23
28
|
name: 'CvStructuredList',
|
|
24
29
|
props: {
|
|
@@ -26,6 +31,9 @@ export default {
|
|
|
26
31
|
border: Boolean,
|
|
27
32
|
condensed: Boolean,
|
|
28
33
|
},
|
|
34
|
+
data() {
|
|
35
|
+
return { componentsX };
|
|
36
|
+
},
|
|
29
37
|
mounted() {
|
|
30
38
|
// pass on cv-structured-list-item change events
|
|
31
39
|
this.$on('cv:change', val => this.$emit('change', val));
|
|
@@ -8,16 +8,11 @@
|
|
|
8
8
|
@keydown.right.prevent="moveRight"
|
|
9
9
|
@keydown.left.prevent="moveLeft"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
></a>
|
|
17
|
-
<svg width="10" height="5" viewBox="0 0 10 5">
|
|
18
|
-
<path d="M0 0l5 4.998L10 0z" fill-rule="evenodd"></path>
|
|
19
|
-
</svg>
|
|
20
|
-
</div>
|
|
11
|
+
<cv-dropdown class="bx--tabs-trigger" :value="`${selectedIndex}`" @change="onDropChange" :form-item="false">
|
|
12
|
+
<cv-dropdown-item v-for="(tab, index) in tabs" :key="`drop-${index}`" :value="`${index}`">
|
|
13
|
+
{{ tab.label }}
|
|
14
|
+
</cv-dropdown-item>
|
|
15
|
+
</cv-dropdown>
|
|
21
16
|
<ul class="bx--tabs__nav bx--tabs__nav--hidden" role="tablist">
|
|
22
17
|
<li
|
|
23
18
|
v-for="(tab, index) in tabs"
|
|
@@ -42,13 +37,19 @@
|
|
|
42
37
|
</li>
|
|
43
38
|
</ul>
|
|
44
39
|
</nav>
|
|
45
|
-
<div class="cv-tabs__panels"
|
|
40
|
+
<div class="cv-tabs__panels">
|
|
41
|
+
<slot></slot>
|
|
42
|
+
</div>
|
|
46
43
|
</div>
|
|
47
44
|
</template>
|
|
48
45
|
|
|
49
46
|
<script>
|
|
47
|
+
import CvDropdown from '../cv-dropdown/cv-dropdown';
|
|
48
|
+
import CvDropdownItem from '../cv-dropdown/cv-dropdown-item';
|
|
49
|
+
|
|
50
50
|
export default {
|
|
51
51
|
name: 'CvTabs',
|
|
52
|
+
components: { CvDropdown, CvDropdownItem },
|
|
52
53
|
data() {
|
|
53
54
|
return {
|
|
54
55
|
tabs: [],
|
|
@@ -58,12 +59,13 @@ export default {
|
|
|
58
59
|
created() {
|
|
59
60
|
// add these on created otherwise cv:mounted is too early.
|
|
60
61
|
this.$on('cv:mounted', srcComponent => this.onCvMount(srcComponent));
|
|
61
|
-
this.$on('cv:beforeDestory', srcComponent =>
|
|
62
|
-
this.onCvBeforeDestroy(srcComponent)
|
|
63
|
-
);
|
|
62
|
+
this.$on('cv:beforeDestory', srcComponent => this.onCvBeforeDestroy(srcComponent));
|
|
64
63
|
this.$on('cv:selected', srcComponent => this.onCvSelected(srcComponent));
|
|
65
64
|
},
|
|
66
65
|
methods: {
|
|
66
|
+
onDropChange(val) {
|
|
67
|
+
this.onTabClick(parseInt(val));
|
|
68
|
+
},
|
|
67
69
|
onCvMount(srcComponent) {
|
|
68
70
|
this.tabs.push(srcComponent);
|
|
69
71
|
this.checkSelected();
|
|
@@ -126,4 +128,18 @@ export default {
|
|
|
126
128
|
};
|
|
127
129
|
</script>
|
|
128
130
|
|
|
129
|
-
<style lang="scss"
|
|
131
|
+
<style lang="scss">
|
|
132
|
+
@media screen and (max-width: 767px) {
|
|
133
|
+
.carbon .bx--dropdown.bx--tabs-trigger {
|
|
134
|
+
display: block;
|
|
135
|
+
padding: 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media screen and (max-width: 41.95rem) {
|
|
140
|
+
.experimental .bx--dropdown.bx--tabs-trigger {
|
|
141
|
+
display: block;
|
|
142
|
+
padding: 0;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
@@ -3,26 +3,36 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
7
|
+
|
|
8
|
+
const components9Tags = [
|
|
9
|
+
'ibm',
|
|
10
|
+
'beta',
|
|
11
|
+
'third-party',
|
|
12
|
+
'local',
|
|
13
|
+
'dedicated',
|
|
14
|
+
'custom',
|
|
15
|
+
'experimental',
|
|
16
|
+
'community',
|
|
17
|
+
'private',
|
|
18
|
+
'deprecated',
|
|
19
|
+
];
|
|
20
|
+
const componentsXTags = ['red', 'magenta', 'purple', 'blue', 'cyan', 'teal', 'green', 'gray', 'cool-gray', 'warm-gray'];
|
|
21
|
+
|
|
6
22
|
export default {
|
|
7
23
|
name: 'CvTag',
|
|
24
|
+
data: () => ({ componentsX }),
|
|
8
25
|
props: {
|
|
9
26
|
label: { type: String, required: true },
|
|
10
27
|
kind: {
|
|
11
28
|
type: String,
|
|
12
|
-
default:
|
|
29
|
+
default: componentsX ? componentsXTags[0] : components9Tags[0],
|
|
13
30
|
validator(val) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'dedicated',
|
|
20
|
-
'custom',
|
|
21
|
-
'experimental',
|
|
22
|
-
'community',
|
|
23
|
-
'private',
|
|
24
|
-
'deprecated',
|
|
25
|
-
].includes(val);
|
|
31
|
+
if (componentsX) {
|
|
32
|
+
return componentsXTags.includes(val);
|
|
33
|
+
} else {
|
|
34
|
+
return components9Tags.includes(val);
|
|
35
|
+
}
|
|
26
36
|
},
|
|
27
37
|
},
|
|
28
38
|
},
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
:class="[
|
|
6
6
|
'bx--label',
|
|
7
7
|
{
|
|
8
|
-
'bx--label--disabled':
|
|
9
|
-
$attrs.disabled !== undefined && $attrs.disabled,
|
|
8
|
+
'bx--label--disabled': $attrs.disabled !== undefined && $attrs.disabled,
|
|
10
9
|
},
|
|
11
10
|
]"
|
|
12
11
|
>{{ label }}</label
|
|
@@ -14,7 +13,19 @@
|
|
|
14
13
|
<div class="bx--form__helper-text" v-if="isHelper">
|
|
15
14
|
<slot name="helper-text">{{ helperText }}</slot>
|
|
16
15
|
</div>
|
|
16
|
+
<div v-if="componentsX" class="bx--text-area__wrapper" :data-invalid="isInvalid">
|
|
17
|
+
<WarningFilled16 v-if="isInvalid" class="bx--text-area__invalid-icon" />
|
|
18
|
+
<textarea
|
|
19
|
+
:id="uid"
|
|
20
|
+
class="bx--text-area"
|
|
21
|
+
:class="{ 'bx--text-area--light': theme === 'light' }"
|
|
22
|
+
v-bind="$attrs"
|
|
23
|
+
:value="value"
|
|
24
|
+
v-on="inputListeners"
|
|
25
|
+
></textarea>
|
|
26
|
+
</div>
|
|
17
27
|
<textarea
|
|
28
|
+
v-else
|
|
18
29
|
:id="uid"
|
|
19
30
|
class="bx--text-area"
|
|
20
31
|
:class="{ 'bx--text-area--light': theme === 'light' }"
|
|
@@ -32,11 +43,19 @@
|
|
|
32
43
|
<script>
|
|
33
44
|
import uidMixin from '../../mixins/uid-mixin';
|
|
34
45
|
import themeMixin from '../../mixins/theme-mixin';
|
|
46
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
47
|
+
import WarningFilled16 from '@carbon/icons-vue/lib/warning--filled/16';
|
|
35
48
|
|
|
36
49
|
export default {
|
|
37
50
|
name: 'CvTextArea',
|
|
38
51
|
mixins: [uidMixin, themeMixin],
|
|
39
52
|
inheritAttrs: false,
|
|
53
|
+
components: { WarningFilled16 },
|
|
54
|
+
data() {
|
|
55
|
+
return {
|
|
56
|
+
componentsX,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
40
59
|
props: {
|
|
41
60
|
helperText: { type: String, default: null },
|
|
42
61
|
invalidMessage: { type: String, default: null },
|
|
@@ -54,16 +73,10 @@ export default {
|
|
|
54
73
|
};
|
|
55
74
|
},
|
|
56
75
|
isInvalid() {
|
|
57
|
-
return (
|
|
58
|
-
this.$slots['invalid-message'] ||
|
|
59
|
-
(this.invalidMessage && this.invalidMessage.length)
|
|
60
|
-
);
|
|
76
|
+
return this.$slots['invalid-message'] !== undefined || (this.invalidMessage && this.invalidMessage.length);
|
|
61
77
|
},
|
|
62
78
|
isHelper() {
|
|
63
|
-
return (
|
|
64
|
-
this.$slots['helper-text'] ||
|
|
65
|
-
(this.helperText && this.helperText.length)
|
|
66
|
-
);
|
|
79
|
+
return this.$slots['helper-text'] || (this.helperText && this.helperText.length);
|
|
67
80
|
},
|
|
68
81
|
},
|
|
69
82
|
};
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
:class="[
|
|
6
6
|
'bx--label',
|
|
7
7
|
{
|
|
8
|
-
'bx--label--disabled':
|
|
9
|
-
$attrs.disabled !== undefined && $attrs.disabled,
|
|
8
|
+
'bx--label--disabled': $attrs.disabled !== undefined && $attrs.disabled,
|
|
10
9
|
},
|
|
11
10
|
]"
|
|
12
11
|
>{{ label }}</label
|
|
@@ -14,7 +13,22 @@
|
|
|
14
13
|
<div class="bx--form__helper-text" v-if="isHelper">
|
|
15
14
|
<slot name="helper-text">{{ helperText }}</slot>
|
|
16
15
|
</div>
|
|
16
|
+
<div v-if="componentsX" class="bx--text-input__field-wrapper" :data-invalid="isInvalid">
|
|
17
|
+
<WarningFilled16 v-if="isInvalid" class="bx--text-input__invalid-icon" />
|
|
18
|
+
<input
|
|
19
|
+
:id="uid"
|
|
20
|
+
class="bx--text-input"
|
|
21
|
+
:class="{ 'bx--text-input--light': theme === 'light' }"
|
|
22
|
+
v-bind="$attrs"
|
|
23
|
+
:value="value"
|
|
24
|
+
v-on="inputListeners"
|
|
25
|
+
:data-toggle-password-visibility="isPassword"
|
|
26
|
+
:type="dataType"
|
|
27
|
+
ref="input"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
17
30
|
<input
|
|
31
|
+
v-else
|
|
18
32
|
:id="uid"
|
|
19
33
|
class="bx--text-input"
|
|
20
34
|
:class="{ 'bx--text-input--light': theme === 'light' }"
|
|
@@ -22,7 +36,30 @@
|
|
|
22
36
|
:value="value"
|
|
23
37
|
v-on="inputListeners"
|
|
24
38
|
:data-invalid="isInvalid"
|
|
39
|
+
:data-toggle-password-visibility="isPassword"
|
|
40
|
+
:type="dataType"
|
|
41
|
+
ref="input"
|
|
25
42
|
/>
|
|
43
|
+
<button
|
|
44
|
+
v-if="isPassword"
|
|
45
|
+
class="bx--text-input--password__visibility bx--tooltip__trigger bx--tooltip--icon__bottom"
|
|
46
|
+
:aria-label="isPasswordVisible ? 'Hide password' : 'Show password'"
|
|
47
|
+
@click="togglePasswordVisibility"
|
|
48
|
+
>
|
|
49
|
+
<svg v-if="isPasswordVisible" class="icon--visibility-off" width="16" height="16" viewBox="0 0 16 16">
|
|
50
|
+
<path
|
|
51
|
+
d="M11.846 3.45L15.293.007 16 .714l-3.284 3.281c1.261.902 2.377 2.212 3.347 3.93C14.02 11.642 11.333 13.5 8 13.5c-1.392 0-2.667-.324-3.822-.973L.703 16l-.706-.708 3.323-3.32C2.071 11.042.976 9.694.035 7.924 2.012 4.308 4.667 2.5 8 2.5c1.395 0 2.677.317 3.846.95zm-6.928 8.338c.944.477 1.97.712 3.082.712 2.795 0 5.076-1.483 6.907-4.568-.866-1.417-1.833-2.486-2.91-3.219l-1.55 1.55a3 3 0 0 1-4.185 4.182l-1.344 1.343zm-.882-.533l1.518-1.517A3 3 0 0 1 9.74 5.556l1.364-1.363A7.02 7.02 0 0 0 8 3.5c-2.798 0-5.047 1.439-6.819 4.432.842 1.465 1.792 2.568 2.855 3.323zm2.948-1.532a2 2 0 0 0 2.74-2.738l-2.74 2.738zm-.707-.707l2.74-2.738a2 2 0 0 0-2.74 2.738z"
|
|
52
|
+
></path>
|
|
53
|
+
</svg>
|
|
54
|
+
<svg v-else class="icon--visibility-on" width="16" height="16" viewBox="0 0 16 11">
|
|
55
|
+
<path
|
|
56
|
+
d="M8 7.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 1c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z"
|
|
57
|
+
></path>
|
|
58
|
+
<path
|
|
59
|
+
d="M8 10c2.8 0 5.1-1.5 6.9-4.6C13.1 2.5 10.8 1 8 1 5.2 1 3 2.4 1.2 5.4 2.9 8.6 5.2 10 8 10zM8 0c3.3 0 6 1.8 8.1 5.4C14 9.2 11.3 11 8 11S2 9.2 0 5.5C2 1.9 4.6 0 8 0z"
|
|
60
|
+
></path>
|
|
61
|
+
</svg>
|
|
62
|
+
</button>
|
|
26
63
|
<div class="bx--form-requirement" v-if="isInvalid">
|
|
27
64
|
<slot name="invalid-message">{{ invalidMessage }}</slot>
|
|
28
65
|
</div>
|
|
@@ -32,18 +69,40 @@
|
|
|
32
69
|
<script>
|
|
33
70
|
import uidMixin from '../../mixins/uid-mixin';
|
|
34
71
|
import themeMixin from '../../mixins/theme-mixin';
|
|
72
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
73
|
+
import WarningFilled16 from '@carbon/icons-vue/lib/warning--filled/16';
|
|
35
74
|
|
|
36
75
|
export default {
|
|
37
76
|
name: 'CvTextInput',
|
|
77
|
+
components: { WarningFilled16 },
|
|
38
78
|
mixins: [uidMixin, themeMixin],
|
|
39
79
|
inheritAttrs: false,
|
|
40
80
|
props: {
|
|
41
81
|
helperText: { type: String, default: null },
|
|
42
82
|
invalidMessage: { type: String, default: null },
|
|
43
83
|
label: String,
|
|
84
|
+
passwordVisible: Boolean,
|
|
44
85
|
theme: String,
|
|
86
|
+
type: String,
|
|
45
87
|
value: String,
|
|
46
88
|
},
|
|
89
|
+
data() {
|
|
90
|
+
return {
|
|
91
|
+
componentsX,
|
|
92
|
+
dataPasswordVisible: this.isPassword && this.passwordVisible,
|
|
93
|
+
dataType: this.type,
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
watch: {
|
|
97
|
+
passwordVisible() {
|
|
98
|
+
if (this.passwordVisible !== this.dataPasswordVisible) {
|
|
99
|
+
this.togglePasswordVisibility();
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
type() {
|
|
103
|
+
this.dataType = this.type;
|
|
104
|
+
},
|
|
105
|
+
},
|
|
47
106
|
computed: {
|
|
48
107
|
// Bind listeners at the component level to the embedded input element and
|
|
49
108
|
// add our own input listener to service the v-model. See:
|
|
@@ -55,16 +114,27 @@ export default {
|
|
|
55
114
|
};
|
|
56
115
|
},
|
|
57
116
|
isInvalid() {
|
|
58
|
-
return (
|
|
59
|
-
this.$slots['invalid-message'] ||
|
|
60
|
-
(this.invalidMessage && this.invalidMessage.length)
|
|
61
|
-
);
|
|
117
|
+
return this.$slots['invalid-message'] !== undefined || (this.invalidMessage && this.invalidMessage.length);
|
|
62
118
|
},
|
|
63
119
|
isHelper() {
|
|
64
|
-
return (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
120
|
+
return this.$slots['helper-text'] || (this.helperText && this.helperText.length);
|
|
121
|
+
},
|
|
122
|
+
isPassword() {
|
|
123
|
+
return this.type === 'password';
|
|
124
|
+
},
|
|
125
|
+
isPasswordVisible() {
|
|
126
|
+
return this.isPassword && this.dataPasswordVisible;
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
methods: {
|
|
130
|
+
togglePasswordVisibility() {
|
|
131
|
+
const currentValue = this.$refs.input.value;
|
|
132
|
+
this.dataPasswordVisible = !this.dataPasswordVisible;
|
|
133
|
+
this.dataType = this.dataPasswordVisible ? 'text' : 'password';
|
|
134
|
+
|
|
135
|
+
this.$nextTick(() => {
|
|
136
|
+
this.$refs.input.value = currentValue;
|
|
137
|
+
});
|
|
68
138
|
},
|
|
69
139
|
},
|
|
70
140
|
};
|
|
@@ -7,25 +7,18 @@
|
|
|
7
7
|
:style="styleObject"
|
|
8
8
|
>
|
|
9
9
|
<button type="button" class="bx--tile__chevron" @click="toggle">
|
|
10
|
-
<
|
|
10
|
+
<ChevronDown16 v-if="componentsX" />
|
|
11
|
+
<svg v-else width="12" height="8" viewBox="0 0 12 8" fill-rule="evenodd">
|
|
11
12
|
<path d="M10.6 0L6 4.7 1.4 0 0 1.4l6 6.1 6-6.1z"></path>
|
|
12
13
|
</svg>
|
|
13
14
|
</button>
|
|
14
15
|
<div class="bx--tile-content">
|
|
15
|
-
<span
|
|
16
|
-
data-tile-atf
|
|
17
|
-
class="bx--tile-content__above-the-fold"
|
|
18
|
-
ref="aboveFold"
|
|
19
|
-
>
|
|
16
|
+
<span data-tile-atf class="bx--tile-content__above-the-fold" ref="aboveFold">
|
|
20
17
|
<slot>
|
|
21
18
|
<!-- Above the fold content here -->
|
|
22
19
|
</slot>
|
|
23
20
|
</span>
|
|
24
|
-
<span
|
|
25
|
-
class="bx--tile-content__below-the-fold"
|
|
26
|
-
ref="belowFold"
|
|
27
|
-
v-show="internalExpanded || initialized"
|
|
28
|
-
>
|
|
21
|
+
<span class="bx--tile-content__below-the-fold" ref="belowFold" v-show="internalExpanded || initialized">
|
|
29
22
|
<slot name="below">
|
|
30
23
|
<!-- Rest of the content here -->
|
|
31
24
|
</slot>
|
|
@@ -35,13 +28,18 @@
|
|
|
35
28
|
</template>
|
|
36
29
|
|
|
37
30
|
<script>
|
|
31
|
+
import { componentsX } from '../../internal/feature-flags';
|
|
32
|
+
import ChevronDown16 from '@carbon/icons-vue/lib/chevron--down/16';
|
|
33
|
+
|
|
38
34
|
export default {
|
|
39
35
|
name: 'CvTileExpandable',
|
|
40
36
|
props: {
|
|
41
37
|
expanded: Boolean,
|
|
42
38
|
},
|
|
39
|
+
components: { ChevronDown16 },
|
|
43
40
|
data() {
|
|
44
41
|
return {
|
|
42
|
+
componentsX,
|
|
45
43
|
styleObject: {
|
|
46
44
|
maxHeight: 'initial',
|
|
47
45
|
},
|
|
@@ -66,11 +64,9 @@ export default {
|
|
|
66
64
|
|
|
67
65
|
this.$nextTick(() => {
|
|
68
66
|
const forceType = typeof force;
|
|
69
|
-
this.internalExpanded =
|
|
70
|
-
forceType === 'boolean' ? force : !this.internalExpanded;
|
|
67
|
+
this.internalExpanded = forceType === 'boolean' ? force : !this.internalExpanded;
|
|
71
68
|
|
|
72
|
-
const belowFoldHeight = this.$refs.belowFold.getBoundingClientRect()
|
|
73
|
-
.height;
|
|
69
|
+
const belowFoldHeight = this.$refs.belowFold.getBoundingClientRect().height;
|
|
74
70
|
|
|
75
71
|
if (this.internalExpanded) {
|
|
76
72
|
currentHeight += belowFoldHeight;
|