@carbon/vue 2.34.0-canary.0 → 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 +29 -0
- package/README.md +25 -18
- package/dist/carbon-vue.common.js +2649 -2113
- package/dist/carbon-vue.common.js.map +1 -1
- package/dist/carbon-vue.umd.js +2649 -2113
- 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 +6 -6
- package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +1 -1
- package/src/components/cv-accordion/cv-accordion-item.vue +5 -4
- package/src/components/cv-accordion/cv-accordion-skeleton.vue +18 -2
- package/src/components/cv-accordion/cv-accordion.vue +19 -2
- package/src/components/cv-breadcrumb/_cv-breadcrumb-item-skeleton.vue +1 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +1 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +1 -1
- package/src/components/cv-breadcrumb/cv-breadcrumb.vue +1 -1
- package/src/components/cv-button/button-mixin.js +12 -7
- package/src/components/cv-button/cv-button-set.vue +5 -2
- package/src/components/cv-button/cv-button.vue +1 -1
- package/src/components/cv-button/cv-icon-button.vue +2 -2
- package/src/components/cv-checkbox/cv-checkbox-skeleton.vue +1 -1
- package/src/components/cv-checkbox/cv-checkbox.vue +1 -4
- package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +13 -8
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +13 -8
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +10 -12
- package/src/components/cv-code-snippet/cv-code-snippet-skeleton.vue +1 -1
- package/src/components/cv-code-snippet/cv-code-snippet.vue +17 -1
- package/src/components/cv-combo-box/cv-combo-box.vue +2 -5
- package/src/components/cv-content-switcher/cv-content-switcher-button.vue +1 -2
- package/src/components/cv-content-switcher/cv-content-switcher.vue +20 -3
- package/src/components/cv-data-table/_cv-data-table-row-inner.vue +1 -1
- package/src/components/cv-data-table/cv-data-table-action.vue +1 -1
- package/src/components/cv-data-table/cv-data-table-heading.vue +1 -2
- package/src/components/cv-data-table/cv-data-table-row.vue +1 -2
- package/src/components/cv-data-table/cv-data-table.vue +2 -4
- package/src/components/cv-date-picker/cv-date-picker.vue +36 -14
- package/src/components/cv-date-picker/plugins/appendToPlugin.js +52 -0
- package/src/components/cv-date-picker/plugins/fixEventsPlugin.js +75 -0
- package/src/components/cv-date-picker/plugins/monthSelectPlugin.js +66 -0
- package/src/components/cv-date-picker/plugins/rangePlugin.js +45 -0
- package/src/components/cv-dropdown/cv-dropdown-item.vue +1 -1
- package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +1 -1
- package/src/components/cv-dropdown/cv-dropdown.vue +9 -7
- package/src/components/cv-feedback-button/_cv-feedback-button.vue +1 -1
- package/src/components/cv-file-uploader/cv-file-uploader-skeleton.vue +1 -1
- package/src/components/cv-file-uploader/cv-file-uploader.vue +1 -3
- package/src/components/cv-form/cv-form-group.vue +1 -1
- package/src/components/cv-form/cv-form-item.vue +1 -1
- package/src/components/cv-form/cv-form.vue +1 -1
- package/src/components/cv-grid/cv-column.vue +77 -0
- package/src/components/cv-grid/cv-grid.vue +32 -0
- package/src/components/cv-grid/cv-row.vue +30 -0
- package/src/components/cv-grid/index.js +5 -0
- package/src/components/cv-inline-loading/cv-inline-loading.vue +1 -1
- package/src/components/cv-inline-notification/cv-inline-notification.vue +2 -3
- package/src/components/cv-link/cv-link.vue +2 -3
- package/src/components/cv-list/cv-list-item.vue +1 -1
- package/src/components/cv-list/cv-list.vue +1 -1
- package/src/components/cv-loading/cv-loading.vue +6 -2
- package/src/components/cv-modal/cv-modal.vue +29 -2
- package/src/components/cv-multi-select/cv-multi-select.vue +8 -12
- package/src/components/cv-number-input/cv-number-input-skeleton.vue +1 -1
- package/src/components/cv-number-input/cv-number-input.vue +2 -5
- package/src/components/cv-overflow-menu/cv-overflow-menu-item.vue +1 -1
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +1 -3
- package/src/components/cv-pagination/cv-pagination.vue +1 -1
- package/src/components/cv-progress/cv-progress-step.vue +1 -1
- package/src/components/cv-progress/cv-progress.vue +1 -1
- package/src/components/cv-radio-button/cv-radio-button.vue +1 -4
- package/src/components/cv-radio-button/cv-radio-group.vue +1 -1
- package/src/components/cv-search/cv-search.vue +2 -5
- package/src/components/cv-select/cv-select-optgroup.vue +1 -1
- package/src/components/cv-select/cv-select-option.vue +1 -1
- package/src/components/cv-select/cv-select.vue +2 -5
- package/src/components/cv-skeleton-text/cv-skeleton-text.vue +1 -1
- package/src/components/cv-slider/cv-slider-skeleton.vue +1 -1
- package/src/components/cv-slider/cv-slider.vue +2 -5
- package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +1 -4
- package/src/components/cv-structured-list/_cv-structured-list-item-standard.vue +1 -1
- package/src/components/cv-structured-list/cv-structured-list-data.vue +1 -1
- package/src/components/cv-structured-list/cv-structured-list-heading.vue +1 -1
- package/src/components/cv-structured-list/cv-structured-list.vue +1 -1
- package/src/components/cv-tabs/cv-tab.vue +1 -1
- package/src/components/cv-tabs/cv-tabs-skeleton.vue +1 -1
- package/src/components/cv-tabs/cv-tabs.vue +1 -1
- package/src/components/cv-tag/cv-tag-skeleton.vue +1 -1
- package/src/components/cv-tag/cv-tag.vue +1 -2
- package/src/components/cv-text-area/cv-text-area.vue +2 -5
- package/src/components/cv-text-input/cv-text-input.vue +2 -6
- package/src/components/cv-tile/_cv-tile-clickable.vue +2 -4
- package/src/components/cv-tile/_cv-tile-expandable.vue +1 -2
- package/src/components/cv-tile/_cv-tile-selectable.vue +1 -4
- package/src/components/cv-tile/cv-tile.vue +2 -4
- package/src/components/cv-time-picker/cv-time-picker.vue +3 -6
- package/src/components/cv-toast-notification/cv-toast-notification.vue +3 -4
- package/src/components/cv-toggle/cv-toggle-skeleton.vue +1 -2
- package/src/components/cv-toggle/cv-toggle.vue +1 -4
- package/src/components/cv-toolbar/cv-toolbar-divider.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar-option.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar-search.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar-title.vue +1 -1
- package/src/components/cv-toolbar/cv-toolbar.vue +1 -1
- package/src/components/cv-tooltip/cv-definition-tooltip.vue +1 -2
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +1 -2
- package/src/components/cv-tooltip/cv-tooltip.vue +1 -1
- package/src/components/cv-ui-shell/_cv-side-nav-footer.vue +1 -1
- package/src/components/cv-ui-shell/_cv-side-nav-link-text.vue +1 -1
- package/src/components/cv-ui-shell/cv-content.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-global-action.vue +1 -2
- package/src/components/cv-ui-shell/cv-header-menu-button.vue +1 -2
- package/src/components/cv-ui-shell/cv-header-menu-item.vue +2 -3
- package/src/components/cv-ui-shell/cv-header-menu.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-name.vue +2 -3
- package/src/components/cv-ui-shell/cv-header-nav.vue +1 -1
- package/src/components/cv-ui-shell/cv-header-panel.vue +2 -2
- package/src/components/cv-ui-shell/cv-header-side-nav-items.vue +1 -1
- package/src/components/cv-ui-shell/cv-header.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav-icon.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav-items.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav-link.vue +2 -3
- package/src/components/cv-ui-shell/cv-side-nav-menu-item.vue +2 -3
- package/src/components/cv-ui-shell/cv-side-nav-menu.vue +1 -1
- package/src/components/cv-ui-shell/cv-side-nav.vue +2 -2
- package/src/components/cv-ui-shell/cv-skip-to-content.vue +2 -3
- package/src/components/cv-ui-shell/cv-switcher-item-link.vue +2 -3
- package/src/components/cv-ui-shell/cv-switcher-item.vue +1 -1
- package/src/components/cv-ui-shell/cv-switcher.vue +1 -1
- package/src/directives/clickout.js +21 -9
- package/src/index.js +2 -0
- package/src/mixins/index.js +12 -0
- package/src/mixins/theme-mixin.js +14 -2
|
@@ -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"
|
|
@@ -64,12 +64,9 @@
|
|
|
64
64
|
</template>
|
|
65
65
|
|
|
66
66
|
<script>
|
|
67
|
-
import uidMixin from '../../mixins
|
|
68
|
-
import themeMixin from '../../mixins/theme-mixin';
|
|
67
|
+
import { uidMixin, themeMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
69
68
|
import CvSelect from '../cv-select/cv-select';
|
|
70
69
|
import CvSelectOption from '../cv-select/cv-select-option';
|
|
71
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
72
|
-
import methodsMixin from '../../mixins/methods-mixin';
|
|
73
70
|
|
|
74
71
|
export default {
|
|
75
72
|
name: 'CvTimePicker',
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<component :is="icon" :class="`${carbonPrefix}--toast-notification__icon`" />
|
|
14
14
|
<div :class="`${carbonPrefix}--toast-notification__details`">
|
|
15
15
|
<h3 :class="`${carbonPrefix}--toast-notification__title`">{{ title }}</h3>
|
|
16
|
-
<p :class="`${carbonPrefix}--toast-notification__subtitle`"
|
|
17
|
-
<p :class="`${carbonPrefix}--toast-notification__caption`"
|
|
16
|
+
<p :class="`${carbonPrefix}--toast-notification__subtitle`" v-html="subTitle"></p>
|
|
17
|
+
<p :class="`${carbonPrefix}--toast-notification__caption`" v-html="caption"></p>
|
|
18
18
|
</div>
|
|
19
19
|
<button
|
|
20
20
|
:aria-label="closeAriaLabel"
|
|
@@ -29,13 +29,12 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
-
import notificationMixin from '../../mixins
|
|
32
|
+
import { notificationMixin, carbonPrefixMixin } from '../../mixins';
|
|
33
33
|
import ErrorFilled20 from '@carbon/icons-vue/es/error--filled/20';
|
|
34
34
|
import CheckmarkFilled20 from '@carbon/icons-vue/es/checkmark--filled/20';
|
|
35
35
|
import WarningFilled20 from '@carbon/icons-vue/es/warning--filled/20';
|
|
36
36
|
import Close20 from '@carbon/icons-vue/es/close/20';
|
|
37
37
|
import InformationFilled20 from '@carbon/icons-vue/es/information--filled/20';
|
|
38
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
39
38
|
|
|
40
39
|
export default {
|
|
41
40
|
name: 'CvToastNotification',
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
-
import uidMixin from '../../mixins
|
|
18
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
17
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
19
18
|
export default {
|
|
20
19
|
name: 'CvToggleSkeleton',
|
|
21
20
|
mixins: [uidMixin, carbonPrefixMixin],
|
|
@@ -29,10 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
-
import uidMixin from '../../mixins
|
|
33
|
-
import checkMixin from '../../mixins/check-mixin';
|
|
34
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
35
|
-
import methodsMixin from '../../mixins/methods-mixin';
|
|
32
|
+
import { uidMixin, checkMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
36
33
|
|
|
37
34
|
export default {
|
|
38
35
|
name: 'CvToggle',
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
|
-
import uidMixin from '../../mixins
|
|
22
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
21
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
23
22
|
|
|
24
23
|
export default {
|
|
25
24
|
name: 'CvDefinitionTooltip',
|
|
@@ -58,9 +58,8 @@
|
|
|
58
58
|
</template>
|
|
59
59
|
|
|
60
60
|
<script>
|
|
61
|
-
import uidMixin from '../../mixins
|
|
61
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
62
62
|
import Information16 from '@carbon/icons-vue/es/information/16';
|
|
63
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
64
63
|
|
|
65
64
|
export default {
|
|
66
65
|
name: 'CvInteractiveTooltip',
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<script>
|
|
26
26
|
import Close20 from '@carbon/icons-vue/es/close/20';
|
|
27
27
|
import ChevronRight20 from '@carbon/icons-vue/es/chevron--right/20';
|
|
28
|
-
import carbonPrefixMixin from '../../mixins
|
|
28
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
29
29
|
|
|
30
30
|
export default {
|
|
31
31
|
name: 'CvSideNavFooter',
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
22
|
-
import uidMixin from '../../mixins
|
|
23
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
22
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
24
23
|
|
|
25
24
|
export default {
|
|
26
25
|
name: 'CvHeaderGlobalAction',
|
|
@@ -25,10 +25,9 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script>
|
|
28
|
-
import uidMixin from '../../mixins
|
|
28
|
+
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
29
29
|
import Close20 from '@carbon/icons-vue/es/close/20';
|
|
30
30
|
import Menu20 from '@carbon/icons-vue/es/menu/20';
|
|
31
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
32
31
|
|
|
33
32
|
export default {
|
|
34
33
|
name: 'CvHeaderMenuButton',
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script>
|
|
19
|
-
import
|
|
20
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
19
|
+
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
21
20
|
|
|
22
21
|
export default {
|
|
23
22
|
name: 'CvHeaderMenuItem',
|
|
24
|
-
mixins: [
|
|
23
|
+
mixins: [linkMixin, carbonPrefixMixin],
|
|
25
24
|
inheritAttrs: false,
|
|
26
25
|
props: {
|
|
27
26
|
active: Boolean,
|
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
9
|
+
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
11
10
|
|
|
12
11
|
export default {
|
|
13
12
|
name: 'CvHeaderName',
|
|
14
|
-
mixins: [
|
|
13
|
+
mixins: [linkMixin, carbonPrefixMixin],
|
|
15
14
|
props: {
|
|
16
15
|
prefix: String,
|
|
17
16
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
-
import carbonPrefixMixin from '../../mixins
|
|
18
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
19
19
|
export default {
|
|
20
20
|
name: 'CvHeaderPanel',
|
|
21
21
|
mixins: [carbonPrefixMixin],
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
this.$parent.$emit('cv:panel-focusout', this, ev);
|
|
63
63
|
},
|
|
64
64
|
onMouseDown(ev) {
|
|
65
|
-
if (this.$el
|
|
65
|
+
if (this.$el == ev.target || this.$el.contains(ev.target)) {
|
|
66
66
|
// ignore mousedown on panel can cause focus event
|
|
67
67
|
ev.preventDefault();
|
|
68
68
|
}
|
|
@@ -21,15 +21,14 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
|
-
import
|
|
24
|
+
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
25
25
|
import CvSideNavIcon from './cv-side-nav-icon';
|
|
26
26
|
import CvSideNavLinkText from './_cv-side-nav-link-text';
|
|
27
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
28
27
|
|
|
29
28
|
export default {
|
|
30
29
|
name: 'CvSideNavLink',
|
|
31
30
|
inheritAttrs: false,
|
|
32
|
-
mixins: [
|
|
31
|
+
mixins: [linkMixin, carbonPrefixMixin],
|
|
33
32
|
components: { CvSideNavIcon, CvSideNavLinkText },
|
|
34
33
|
props: {
|
|
35
34
|
active: Boolean,
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
-
import
|
|
18
|
+
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
19
19
|
import CvSideNavLinkText from './_cv-side-nav-link-text';
|
|
20
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
21
20
|
|
|
22
21
|
export default {
|
|
23
22
|
name: 'CvSideNavMenuItem',
|
|
24
23
|
inheritAttrs: false,
|
|
25
|
-
mixins: [
|
|
24
|
+
mixins: [linkMixin, carbonPrefixMixin],
|
|
26
25
|
components: { CvSideNavLinkText },
|
|
27
26
|
props: {
|
|
28
27
|
active: Boolean,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<script>
|
|
39
39
|
import ChevronDown20 from '@carbon/icons-vue/es/chevron--down/20';
|
|
40
40
|
import CvSideNavIcon from './cv-side-nav-icon';
|
|
41
|
-
import carbonPrefixMixin from '../../mixins
|
|
41
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
42
42
|
|
|
43
43
|
export default {
|
|
44
44
|
name: 'CvSideNavMenu',
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
<script>
|
|
30
30
|
import CvSideNavFooter from './_cv-side-nav-footer';
|
|
31
|
-
import carbonPrefixMixin from '../../mixins
|
|
31
|
+
import { carbonPrefixMixin } from '../../mixins';
|
|
32
32
|
|
|
33
33
|
export default {
|
|
34
34
|
name: 'CvSideNav',
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
this.$parent.$emit('cv:panel-focusout', this, ev);
|
|
81
81
|
},
|
|
82
82
|
onMouseDown(ev) {
|
|
83
|
-
if (this.$el
|
|
83
|
+
if (this.$el == ev.target || this.$el.contains(ev.target)) {
|
|
84
84
|
// ignore mousedown on panel can cause focus event
|
|
85
85
|
ev.preventDefault();
|
|
86
86
|
}
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script>
|
|
13
|
-
import
|
|
14
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
13
|
+
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
16
|
name: 'CvSkipToContent',
|
|
18
|
-
mixins: [
|
|
17
|
+
mixins: [linkMixin, carbonPrefixMixin],
|
|
19
18
|
};
|
|
20
19
|
</script>
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
-
import
|
|
18
|
-
import carbonPrefixMixin from '../../mixins/carbon-prefix-mixin';
|
|
17
|
+
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
19
18
|
|
|
20
19
|
export default {
|
|
21
20
|
name: 'CvSwitcherItemLink',
|
|
22
|
-
mixins: [
|
|
21
|
+
mixins: [linkMixin, carbonPrefixMixin],
|
|
23
22
|
props: {
|
|
24
23
|
selected: Boolean,
|
|
25
24
|
},
|
|
@@ -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
|
};
|
package/src/index.js
CHANGED
|
@@ -45,6 +45,7 @@ import { CvDatePicker } from './components/cv-date-picker';
|
|
|
45
45
|
import { CvDropdown, CvDropdownItem, CvDropdownSkeleton } from './components/cv-dropdown';
|
|
46
46
|
import { CvFileUploader, CvFileUploaderSkeleton } from './components/cv-file-uploader';
|
|
47
47
|
import { CvForm, CvFormItem, CvFormGroup } from './components/cv-form';
|
|
48
|
+
import { CvGrid, CvRow, CvColumn } from './components/cv-grid';
|
|
48
49
|
import { CvInlineLoading } from './components/cv-inline-loading';
|
|
49
50
|
import { CvInlineNotification } from './components/cv-inline-notification';
|
|
50
51
|
import { CvLink } from './components/cv-link';
|
|
@@ -113,6 +114,7 @@ export { CvDatePicker };
|
|
|
113
114
|
export { CvDropdown, CvDropdownItem, CvDropdownSkeleton };
|
|
114
115
|
export { CvFileUploader, CvFileUploaderSkeleton };
|
|
115
116
|
export { CvForm, CvFormItem, CvFormGroup };
|
|
117
|
+
export { CvGrid, CvRow, CvColumn };
|
|
116
118
|
export { CvInlineLoading };
|
|
117
119
|
export { CvInlineNotification };
|
|
118
120
|
export { CvLink };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// import mixins
|
|
2
|
+
import carbonPrefixMixin from './carbon-prefix-mixin';
|
|
3
|
+
import checkMixin from './check-mixin';
|
|
4
|
+
import linkMixin from './link-mixin';
|
|
5
|
+
import methodsMixin from './methods-mixin';
|
|
6
|
+
import notificationMixin from './notification-mixin';
|
|
7
|
+
import radioMixin from './radio-mixin';
|
|
8
|
+
import themeMixin from './theme-mixin';
|
|
9
|
+
import uidMixin from './uid-mixin';
|
|
10
|
+
|
|
11
|
+
// export all the mixins
|
|
12
|
+
export { carbonPrefixMixin, checkMixin, linkMixin, methodsMixin, notificationMixin, radioMixin, themeMixin, uidMixin };
|
|
@@ -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
|
};
|