@carbon/vue 2.34.1 → 2.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +25 -18
- package/dist/carbon-vue.common.js +1312 -995
- package/dist/carbon-vue.common.js.map +1 -1
- package/dist/carbon-vue.umd.js +1312 -995
- 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 +4 -4
- package/src/components/cv-accordion/cv-accordion-item.vue +4 -0
- package/src/components/cv-accordion/cv-accordion-skeleton.vue +17 -1
- package/src/components/cv-accordion/cv-accordion.vue +18 -1
- package/src/components/cv-button/button-mixin.js +12 -7
- package/src/components/cv-button/cv-button-set.vue +4 -1
- package/src/components/cv-button/cv-icon-button.vue +1 -1
- package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +13 -7
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +13 -7
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +10 -11
- package/src/components/cv-code-snippet/cv-code-snippet.vue +17 -1
- package/src/components/cv-combo-box/cv-combo-box.vue +1 -1
- package/src/components/cv-content-switcher/cv-content-switcher.vue +20 -3
- package/src/components/cv-data-table/cv-data-table.vue +1 -1
- package/src/components/cv-date-picker/cv-date-picker.vue +1 -1
- package/src/components/cv-dropdown/cv-dropdown.vue +1 -1
- package/src/components/cv-loading/cv-loading.vue +5 -1
- package/src/components/cv-modal/cv-modal.vue +28 -0
- package/src/components/cv-multi-select/cv-multi-select.vue +7 -8
- package/src/components/cv-number-input/cv-number-input.vue +1 -1
- package/src/components/cv-search/cv-search.vue +1 -1
- package/src/components/cv-select/cv-select.vue +1 -1
- package/src/components/cv-slider/cv-slider.vue +1 -1
- package/src/components/cv-text-area/cv-text-area.vue +1 -1
- package/src/components/cv-text-input/cv-text-input.vue +1 -2
- package/src/components/cv-tile/cv-tile.vue +1 -1
- package/src/components/cv-time-picker/cv-time-picker.vue +2 -2
- package/src/directives/clickout.js +21 -9
- package/src/mixins/theme-mixin.js +14 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="tagType"
|
|
4
|
-
:class="[`cv-tile ${carbonPrefix}--tile`, { [`${carbonPrefix}--tile--light`]:
|
|
4
|
+
:class="[`cv-tile ${carbonPrefix}--tile`, { [`${carbonPrefix}--tile--light`]: isLight }]"
|
|
5
5
|
:checked="selected"
|
|
6
6
|
:expanded="expanded"
|
|
7
7
|
v-bind="$attrs"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="`cv-time-picker ${carbonPrefix}--form-item`">
|
|
3
3
|
<div
|
|
4
|
-
:class="[`${carbonPrefix}--time-picker`, { [`${carbonPrefix}--time-picker--light`]:
|
|
4
|
+
:class="[`${carbonPrefix}--time-picker`, { [`${carbonPrefix}--time-picker--light`]: isLight }]"
|
|
5
5
|
:data-invalid="isInvalid"
|
|
6
6
|
>
|
|
7
7
|
<div :class="`${carbonPrefix}--time-picker__input`">
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
type="text"
|
|
13
13
|
:class="[
|
|
14
14
|
`${carbonPrefix}--time-picker__input-field ${carbonPrefix}--text-input`,
|
|
15
|
-
{ [`${carbonPrefix}--text-input--light`]:
|
|
15
|
+
{ [`${carbonPrefix}--text-input--light`]: isLight },
|
|
16
16
|
]"
|
|
17
17
|
:pattern="pattern"
|
|
18
18
|
v-bind="$attrs"
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
// This directive determines calls the associated method if a click happens outside of el
|
|
2
2
|
|
|
3
|
+
const handlerMap = new WeakMap();
|
|
4
|
+
|
|
3
5
|
export default {
|
|
4
6
|
bind(el, binding, vnode) {
|
|
5
|
-
el.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (!el.clickOutsideBlur) {
|
|
8
|
+
el.clickOutsideBlur = function(blurEv) {
|
|
9
|
+
// neither element or child of
|
|
10
|
+
if (!handlerMap.has(el)) {
|
|
11
|
+
handlerMap.set(el, clickoutEv => {
|
|
12
|
+
// neither element or child of
|
|
13
|
+
if (!(el == clickoutEv.target || el.contains(clickoutEv.target))) {
|
|
14
|
+
// call method
|
|
15
|
+
vnode.context[binding.expression](clickoutEv);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
document.body.addEventListener('click', handlerMap.get(el));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
el.addEventListener('focusout', el.clickOutsideBlur);
|
|
23
|
+
}
|
|
13
24
|
},
|
|
14
25
|
unbind(el) {
|
|
15
|
-
|
|
26
|
+
handlerMap.delete(el);
|
|
27
|
+
el.removeEventListener('focusout', el.clickOutsideBlur);
|
|
16
28
|
},
|
|
17
29
|
};
|
|
@@ -2,10 +2,22 @@ const options = ['light'];
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
props: {
|
|
5
|
+
light: Boolean,
|
|
5
6
|
theme: {
|
|
6
7
|
type: String,
|
|
7
|
-
default:
|
|
8
|
-
validator: value =>
|
|
8
|
+
default: undefined,
|
|
9
|
+
validator: value => {
|
|
10
|
+
if (value !== undefined && process.env.NODE_ENV === 'development') {
|
|
11
|
+
console.warn(`theme='light' deprecated in favour of boolean light property.`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return value.length === 0 || options.includes(value);
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
isLight() {
|
|
20
|
+
return this.light || this.theme === 'light';
|
|
9
21
|
},
|
|
10
22
|
},
|
|
11
23
|
};
|