@carbon/vue 2.45.1 → 3.0.4-alpha.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/README.md +34 -264
- package/dist/carbon-vue-3.common.js +27392 -0
- package/dist/carbon-vue-3.common.js.map +1 -0
- package/dist/carbon-vue-3.umd.js +27403 -0
- package/dist/carbon-vue-3.umd.js.map +1 -0
- package/dist/carbon-vue-3.umd.min.js +17 -0
- package/dist/carbon-vue-3.umd.min.js.map +1 -0
- package/dist/demo.html +1 -34
- package/package.json +185 -62
- package/src/components/CvAccordion/CvAccordion.stories.js +54 -0
- package/src/components/CvAccordion/CvAccordion.vue +95 -0
- package/src/components/CvAccordion/CvAccordionItem.vue +101 -0
- package/src/components/{cv-accordion/cv-accordion-skeleton.vue → CvAccordion/CvAccordionSkeleton.vue} +14 -18
- package/src/components/CvAccordion/_CvAccordionItemSkeleton.vue +30 -0
- package/src/components/CvAccordion/consts.js +17 -0
- package/src/components/CvAccordion/index.js +6 -0
- package/src/components/CvAspectRatio/CvAspectRatio.stories.js +56 -0
- package/src/components/CvAspectRatio/CvAspectRatio.stories.scss +4 -0
- package/src/components/CvAspectRatio/CvAspectRatio.vue +33 -0
- package/src/components/CvAspectRatio/consts.js +2 -0
- package/src/components/CvAspectRatio/index.js +4 -0
- package/src/components/CvBreadcrumb/CvBreadcrumb.stories.js +75 -0
- package/src/components/CvBreadcrumb/CvBreadcrumb.vue +37 -0
- package/src/components/CvBreadcrumb/CvBreadcrumbItem.vue +28 -0
- package/src/components/CvBreadcrumb/CvBreadcrumbSkeleton.vue +29 -0
- package/src/components/CvBreadcrumb/CvBreadcrumbSkeletonItem.vue +14 -0
- package/src/components/CvBreadcrumb/index.js +11 -0
- package/src/components/CvButton/CvButton.stories.js +119 -0
- package/src/components/CvButton/CvButton.vue +68 -0
- package/src/components/CvButton/CvButtonCommon.js +75 -0
- package/src/components/CvButton/CvButtonSet.stories.js +36 -0
- package/src/components/CvButton/CvButtonSet.vue +30 -0
- package/src/components/CvButton/CvIconButton.stories.js +139 -0
- package/src/components/CvButton/CvIconButton.vue +88 -0
- package/src/components/CvButton/index.js +7 -0
- package/src/components/CvButton/sbBtnPrefix.js +2 -0
- package/src/components/CvCheckbox/CvCheckbox.stories.js +111 -0
- package/src/components/CvCheckbox/CvCheckbox.vue +73 -0
- package/src/components/CvCheckbox/index.js +3 -0
- package/src/components/CvCodeSnippet/CvCodeSnippet.stories.js +181 -0
- package/src/components/CvCodeSnippet/CvCodeSnippet.stories.scss +4 -0
- package/src/components/CvCodeSnippet/CvCodeSnippet.vue +125 -0
- package/src/components/CvCodeSnippet/CvCodeSnippetSkeleton.vue +43 -0
- package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +72 -0
- package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +199 -0
- package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +106 -0
- package/src/components/CvCodeSnippet/consts.js +2 -0
- package/src/components/CvCodeSnippet/index.js +4 -0
- package/src/components/CvComboBox/CvComboBox.stories.js +174 -0
- package/src/components/CvComboBox/CvComboBox.vue +460 -0
- package/src/components/CvComboBox/index.js +3 -0
- package/src/components/CvContentSwitcher/CvContentSwitcher.stories.mdx +196 -0
- package/src/components/CvContentSwitcher/CvContentSwitcher.vue +64 -0
- package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +117 -0
- package/src/components/CvContentSwitcher/CvContentSwitcherContent.vue +21 -0
- package/src/components/CvContentSwitcher/cvContentSwitcherStore.js +30 -0
- package/src/components/CvContentSwitcher/index.js +3 -0
- package/src/components/CvCopyButton/CvCopyButton.stories.js +28 -0
- package/src/components/CvCopyButton/CvCopyButton.vue +45 -0
- package/src/components/CvCopyButton/_CviCopyButton.vue +71 -0
- package/src/components/CvCopyButton/index.js +3 -0
- package/src/components/CvDataTable/CvDataTable.stories.mdx +304 -0
- package/src/components/CvDataTable/CvDataTable.vue +648 -0
- package/src/components/CvDataTable/CvDataTableAction.vue +22 -0
- package/src/components/CvDataTable/CvDataTableCell.vue +11 -0
- package/src/components/CvDataTable/CvDataTableHeading.vue +143 -0
- package/src/components/CvDataTable/CvDataTableRow.vue +139 -0
- package/src/components/CvDataTable/CvDataTableSkeleton.vue +48 -0
- package/src/components/CvDataTable/_CvDataTableRowInner.vue +169 -0
- package/src/components/CvDataTable/cvDataTableStore.js +340 -0
- package/src/components/CvDataTable/index.js +3 -0
- package/src/components/CvEmpty/_CvEmpty.vue +22 -0
- package/src/components/CvGrid/CvColumn.vue +85 -0
- package/src/components/CvGrid/CvGrid.vue +42 -0
- package/src/components/{cv-grid/cv-row.vue → CvGrid/CvRow.vue} +8 -12
- package/src/components/CvGrid/GvGrid.stories.mdx +217 -0
- package/src/components/CvGrid/_SbContainer.vue +22 -0
- package/src/components/CvGrid/_cvColumnValidation.js +48 -0
- package/src/components/CvLink/CvLink.stories.js +169 -0
- package/src/components/CvLink/CvLink.vue +38 -0
- package/src/components/CvLink/index.js +4 -0
- package/src/components/CvList/CvList.stories.js +88 -0
- package/src/components/CvList/CvList.vue +50 -0
- package/src/components/CvList/CvListItem.vue +12 -0
- package/src/components/CvList/index.js +4 -0
- package/src/components/CvLoading/CvLoading.stories.js +78 -0
- package/src/components/CvLoading/CvLoading.stories.scss +4 -0
- package/src/components/CvLoading/CvLoading.vue +106 -0
- package/src/components/CvLoading/index.js +4 -0
- package/src/components/CvNotification/CvInlineNotification.stories.js +109 -0
- package/src/components/CvNotification/CvInlineNotification.vue +102 -0
- package/src/components/CvNotification/CvToastNotification.stories.js +108 -0
- package/src/components/CvNotification/CvToastNotification.vue +88 -0
- package/src/components/CvNotification/consts.js +31 -0
- package/src/components/CvNotification/index.js +5 -0
- package/src/components/CvOverflowMenu/CvOverflowMenu.stories.mdx +119 -0
- package/src/components/CvOverflowMenu/CvOverflowMenu.vue +283 -0
- package/src/components/{cv-overflow-menu/cv-overflow-menu-item.vue → CvOverflowMenu/CvOverflowMenuItem.vue} +26 -20
- package/src/components/CvOverflowMenu/index.js +3 -0
- package/src/components/CvPagination/CvPagination.stories.mdx +160 -0
- package/src/components/CvPagination/CvPagination.vue +246 -0
- package/src/components/CvPagination/index.js +3 -0
- package/src/components/CvSelect/CvSelect.stories.mdx +227 -0
- package/src/components/CvSelect/CvSelect.vue +224 -0
- package/src/components/CvSelect/CvSelectOptgroup.vue +9 -0
- package/src/components/CvSelect/CvSelectOption.vue +22 -0
- package/src/components/CvSelect/index.js +3 -0
- package/src/components/CvSkeletonText/CvSkeletonText.stories.js +56 -0
- package/src/components/CvSkeletonText/CvSkeletonText.vue +63 -0
- package/src/components/CvSkeletonText/index.js +3 -0
- package/src/components/CvSvg/_CvSvg.vue +48 -0
- package/src/components/CvSvg/__tests__/_TestIcon.vue +19 -0
- package/src/components/CvSvg/__tests__/test-svg.svg +5 -0
- package/src/components/CvTag/CvTag.stories.js +64 -0
- package/src/components/CvTag/CvTag.vue +105 -0
- package/src/components/CvTag/consts.js +15 -0
- package/src/components/CvTag/index.js +5 -0
- package/src/components/CvUIShell/CvHeader.vue +203 -0
- package/src/components/CvUIShell/CvHeaderGlobalAction.vue +105 -0
- package/src/components/{cv-ui-shell/cv-header-menu.vue → CvUIShell/CvHeaderMenu.vue} +41 -37
- package/src/components/CvUIShell/CvHeaderMenuButton.vue +103 -0
- package/src/components/CvUIShell/CvHeaderMenuItem.vue +38 -0
- package/src/components/CvUIShell/CvHeaderName.vue +25 -0
- package/src/components/CvUIShell/CvHeaderNav.vue +18 -0
- package/src/components/CvUIShell/CvHeaderPanel.vue +106 -0
- package/src/components/CvUIShell/CvSideNav.vue +131 -0
- package/src/components/CvUIShell/CvSideNavIcon.vue +17 -0
- package/src/components/CvUIShell/CvSideNavItems.vue +22 -0
- package/src/components/CvUIShell/CvSideNavLink.vue +47 -0
- package/src/components/CvUIShell/CvSideNavMenu.vue +85 -0
- package/src/components/CvUIShell/CvSideNavMenuDivider.vue +7 -0
- package/src/components/CvUIShell/CvSideNavMenuItem.vue +31 -0
- package/src/components/CvUIShell/CvSkipToContent.vue +20 -0
- package/src/components/CvUIShell/CvSwitcher.vue +9 -0
- package/src/components/CvUIShell/CvSwitcherItem.vue +9 -0
- package/src/components/CvUIShell/CvSwitcherItemLink.vue +26 -0
- package/src/components/CvUIShell/CvUIShell.stories.mdx +454 -0
- package/src/components/{cv-ui-shell/_cv-side-nav-footer.vue → CvUIShell/_CvSideNavFooter.vue} +11 -15
- package/src/components/CvUIShell/_CvSideNavLinkText.vue +9 -0
- package/src/components/CvWrapper/CvWrapper.js +23 -0
- package/src/global/component-utils/event-bus.js +23 -0
- package/src/global/component-utils/validators.js +14 -0
- package/src/global/settings.js +5 -0
- package/src/global/storybook-utils/__tests__/story-source-code.js +162 -0
- package/src/global/storybook-utils/controls-from-props.js +72 -0
- package/src/global/storybook-utils/index.js +5 -0
- package/src/global/storybook-utils/sbCompPrefix.js +1 -0
- package/src/global/storybook-utils/split-slot-args.js +14 -0
- package/src/global/storybook-utils/story-source-code.js +52 -0
- package/src/index.js +13 -83
- package/src/use/components.js +24 -0
- package/src/use/cvCheck.js +94 -0
- package/src/use/cvId.js +57 -0
- package/src/use/cvLink.js +42 -0
- package/src/use/cvTheme.js +30 -0
- package/src/use/index.js +1 -0
- package/src/use/overflow.js +37 -0
- package/dist/carbon-vue.common.js +0 -23411
- package/dist/carbon-vue.common.js.map +0 -1
- package/dist/carbon-vue.umd.js +0 -23421
- package/dist/carbon-vue.umd.js.map +0 -1
- package/dist/carbon-vue.umd.min.js +0 -30
- package/dist/carbon-vue.umd.min.js.map +0 -1
- package/src/assets/images/component-icons.svg +0 -57
- package/src/assets/images/example-icon-svg.js +0 -10
- package/src/assets/images/example-icon.svg +0 -6
- package/src/assets/images/example-icons.svg +0 -6
- package/src/carbon.yml +0 -442
- package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +0 -29
- package/src/components/cv-accordion/cv-accordion-item.vue +0 -87
- package/src/components/cv-accordion/cv-accordion.vue +0 -59
- package/src/components/cv-accordion/index.js +0 -5
- package/src/components/cv-aspect-ratio/cv-aspect-ratio.vue +0 -28
- package/src/components/cv-aspect-ratio/index.js +0 -2
- package/src/components/cv-breadcrumb/_cv-breadcrumb-item-skeleton.vue +0 -13
- package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +0 -28
- package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +0 -30
- package/src/components/cv-breadcrumb/cv-breadcrumb.vue +0 -21
- package/src/components/cv-breadcrumb/index.js +0 -5
- package/src/components/cv-button/button-mixin.js +0 -91
- package/src/components/cv-button/cv-button-set.vue +0 -17
- package/src/components/cv-button/cv-button-skeleton.vue +0 -12
- package/src/components/cv-button/cv-button.vue +0 -19
- package/src/components/cv-button/cv-icon-button.vue +0 -42
- package/src/components/cv-button/index.js +0 -6
- package/src/components/cv-checkbox/cv-checkbox-skeleton.vue +0 -15
- package/src/components/cv-checkbox/cv-checkbox.vue +0 -70
- package/src/components/cv-checkbox/index.js +0 -3
- package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +0 -39
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +0 -79
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +0 -47
- package/src/components/cv-code-snippet/cv-code-snippet-skeleton.vue +0 -30
- package/src/components/cv-code-snippet/cv-code-snippet.vue +0 -83
- package/src/components/cv-code-snippet/index.js +0 -3
- package/src/components/cv-combo-box/cv-combo-box.vue +0 -386
- package/src/components/cv-combo-box/index.js +0 -3
- package/src/components/cv-content-switcher/cv-content-switcher-button.vue +0 -104
- package/src/components/cv-content-switcher/cv-content-switcher-content.vue +0 -26
- package/src/components/cv-content-switcher/cv-content-switcher-store.js +0 -22
- package/src/components/cv-content-switcher/cv-content-switcher.vue +0 -117
- package/src/components/cv-content-switcher/index.js +0 -4
- package/src/components/cv-data-table/_cv-data-table-row-inner.vue +0 -139
- package/src/components/cv-data-table/cv-data-table-action.vue +0 -25
- package/src/components/cv-data-table/cv-data-table-cell.vue +0 -14
- package/src/components/cv-data-table/cv-data-table-heading.vue +0 -109
- package/src/components/cv-data-table/cv-data-table-row.vue +0 -113
- package/src/components/cv-data-table/cv-data-table-skeleton.vue +0 -64
- package/src/components/cv-data-table/cv-data-table.vue +0 -525
- package/src/components/cv-data-table/index.js +0 -8
- package/src/components/cv-date-picker/cv-date-picker.vue +0 -362
- package/src/components/cv-date-picker/index.js +0 -3
- package/src/components/cv-date-picker/plugins/appendToPlugin.js +0 -52
- package/src/components/cv-date-picker/plugins/fixEventsPlugin.js +0 -75
- package/src/components/cv-date-picker/plugins/monthSelectPlugin.js +0 -66
- package/src/components/cv-date-picker/plugins/rangePlugin.js +0 -45
- package/src/components/cv-dropdown/cv-dropdown-item.vue +0 -84
- package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +0 -20
- package/src/components/cv-dropdown/cv-dropdown.vue +0 -373
- package/src/components/cv-dropdown/index.js +0 -5
- package/src/components/cv-feedback-button/_cv-feedback-button.vue +0 -74
- package/src/components/cv-file-uploader/consts.js +0 -12
- package/src/components/cv-file-uploader/cv-file-uploader-skeleton.vue +0 -22
- package/src/components/cv-file-uploader/cv-file-uploader.vue +0 -348
- package/src/components/cv-file-uploader/index.js +0 -5
- package/src/components/cv-form/cv-form-group.vue +0 -32
- package/src/components/cv-form/cv-form-item.vue +0 -13
- package/src/components/cv-form/cv-form.vue +0 -13
- package/src/components/cv-form/index.js +0 -5
- package/src/components/cv-grid/cv-column.vue +0 -77
- package/src/components/cv-grid/cv-grid.vue +0 -32
- package/src/components/cv-grid/index.js +0 -5
- package/src/components/cv-icon/_cv-icon.vue +0 -30
- package/src/components/cv-inline-loading/consts.js +0 -8
- package/src/components/cv-inline-loading/cv-inline-loading.vue +0 -91
- package/src/components/cv-inline-loading/index.js +0 -4
- package/src/components/cv-inline-notification/cv-inline-notification.vue +0 -89
- package/src/components/cv-inline-notification/index.js +0 -3
- package/src/components/cv-link/cv-link.vue +0 -30
- package/src/components/cv-link/index.js +0 -3
- package/src/components/cv-list/cv-list-item.vue +0 -13
- package/src/components/cv-list/cv-list.vue +0 -42
- package/src/components/cv-list/index.js +0 -4
- package/src/components/cv-loading/cv-loading.vue +0 -86
- package/src/components/cv-loading/index.js +0 -3
- package/src/components/cv-modal/cv-modal.vue +0 -299
- package/src/components/cv-modal/index.js +0 -2
- package/src/components/cv-multi-select/cv-multi-select.vue +0 -484
- package/src/components/cv-multi-select/index.js +0 -3
- package/src/components/cv-number-input/cv-number-input-skeleton.vue +0 -14
- package/src/components/cv-number-input/cv-number-input.vue +0 -215
- package/src/components/cv-number-input/index.js +0 -3
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +0 -253
- package/src/components/cv-overflow-menu/index.js +0 -4
- package/src/components/cv-pagination/cv-pagination.vue +0 -268
- package/src/components/cv-pagination/index.js +0 -2
- package/src/components/cv-progress/cv-progress-step.vue +0 -135
- package/src/components/cv-progress/cv-progress.vue +0 -82
- package/src/components/cv-progress/index.js +0 -4
- package/src/components/cv-radio-button/cv-radio-button.vue +0 -40
- package/src/components/cv-radio-button/cv-radio-group.vue +0 -24
- package/src/components/cv-radio-button/index.js +0 -4
- package/src/components/cv-search/cv-search.vue +0 -194
- package/src/components/cv-search/index.js +0 -2
- package/src/components/cv-select/cv-select-optgroup.vue +0 -14
- package/src/components/cv-select/cv-select-option.vue +0 -14
- package/src/components/cv-select/cv-select.vue +0 -158
- package/src/components/cv-select/index.js +0 -4
- package/src/components/cv-skeleton-text/cv-skeleton-text.vue +0 -64
- package/src/components/cv-skeleton-text/index.js +0 -2
- package/src/components/cv-slider/cv-slider-skeleton.vue +0 -22
- package/src/components/cv-slider/cv-slider.vue +0 -247
- package/src/components/cv-slider/index.js +0 -4
- package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +0 -37
- package/src/components/cv-structured-list/_cv-structured-list-item-standard.vue +0 -13
- package/src/components/cv-structured-list/cv-structured-list-data.vue +0 -23
- package/src/components/cv-structured-list/cv-structured-list-heading.vue +0 -13
- package/src/components/cv-structured-list/cv-structured-list-item.vue +0 -46
- package/src/components/cv-structured-list/cv-structured-list.vue +0 -38
- package/src/components/cv-structured-list/index.js +0 -5
- package/src/components/cv-svg/_cv-svg.vue +0 -38
- package/src/components/cv-tabs/cv-tab.vue +0 -68
- package/src/components/cv-tabs/cv-tabs-skeleton.vue +0 -20
- package/src/components/cv-tabs/cv-tabs.vue +0 -410
- package/src/components/cv-tabs/index.js +0 -5
- package/src/components/cv-tag/cv-tag-skeleton.vue +0 -19
- package/src/components/cv-tag/cv-tag.vue +0 -121
- package/src/components/cv-tag/index.js +0 -4
- package/src/components/cv-text-area/cv-text-area.vue +0 -98
- package/src/components/cv-text-area/index.js +0 -2
- package/src/components/cv-text-input/cv-text-input.vue +0 -173
- package/src/components/cv-text-input/index.js +0 -2
- package/src/components/cv-tile/_cv-tile-clickable.vue +0 -22
- package/src/components/cv-tile/_cv-tile-expandable.vue +0 -92
- package/src/components/cv-tile/_cv-tile-selectable.vue +0 -48
- package/src/components/cv-tile/_cv-tile-standard.vue +0 -11
- package/src/components/cv-tile/cv-tile.vue +0 -83
- package/src/components/cv-tile/index.js +0 -2
- package/src/components/cv-time-picker/cv-time-picker.vue +0 -138
- package/src/components/cv-time-picker/index.js +0 -2
- package/src/components/cv-toast-notification/cv-toast-notification.vue +0 -72
- package/src/components/cv-toast-notification/index.js +0 -2
- package/src/components/cv-toggle/cv-toggle-skeleton.vue +0 -25
- package/src/components/cv-toggle/cv-toggle.vue +0 -52
- package/src/components/cv-toggle/index.js +0 -3
- package/src/components/cv-toolbar/cv-toolbar-divider.vue +0 -11
- package/src/components/cv-toolbar/cv-toolbar-option.vue +0 -16
- package/src/components/cv-toolbar/cv-toolbar-search.vue +0 -40
- package/src/components/cv-toolbar/cv-toolbar-title.vue +0 -14
- package/src/components/cv-toolbar/cv-toolbar.vue +0 -13
- package/src/components/cv-toolbar/index.js +0 -6
- package/src/components/cv-tooltip/consts.js +0 -2
- package/src/components/cv-tooltip/cv-definition-tooltip.vue +0 -44
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +0 -241
- package/src/components/cv-tooltip/cv-tooltip.vue +0 -44
- package/src/components/cv-tooltip/index.js +0 -6
- package/src/components/cv-ui-shell/_cv-side-nav-link-text.vue +0 -13
- package/src/components/cv-ui-shell/cv-content.vue +0 -16
- package/src/components/cv-ui-shell/cv-header-global-action.vue +0 -84
- package/src/components/cv-ui-shell/cv-header-menu-button.vue +0 -80
- package/src/components/cv-ui-shell/cv-header-menu-item.vue +0 -36
- package/src/components/cv-ui-shell/cv-header-name.vue +0 -18
- package/src/components/cv-ui-shell/cv-header-nav.vue +0 -18
- package/src/components/cv-ui-shell/cv-header-panel.vue +0 -72
- package/src/components/cv-ui-shell/cv-header-side-nav-items.vue +0 -21
- package/src/components/cv-ui-shell/cv-header.vue +0 -119
- package/src/components/cv-ui-shell/cv-side-nav-divider.vue +0 -12
- package/src/components/cv-ui-shell/cv-side-nav-icon.vue +0 -16
- package/src/components/cv-ui-shell/cv-side-nav-items.vue +0 -21
- package/src/components/cv-ui-shell/cv-side-nav-link.vue +0 -54
- package/src/components/cv-ui-shell/cv-side-nav-menu-item.vue +0 -30
- package/src/components/cv-ui-shell/cv-side-nav-menu.vue +0 -84
- package/src/components/cv-ui-shell/cv-side-nav.vue +0 -97
- package/src/components/cv-ui-shell/cv-skip-to-content.vue +0 -19
- package/src/components/cv-ui-shell/cv-switcher-item-link.vue +0 -26
- package/src/components/cv-ui-shell/cv-switcher-item.vue +0 -13
- package/src/components/cv-ui-shell/cv-switcher.vue +0 -13
- package/src/components/cv-ui-shell/index.js +0 -45
- package/src/components/cv-wrapper/_cv-wrapper.js +0 -33
- package/src/directives/clickout.js +0 -29
- package/src/index-components-vue.js +0 -5
- package/src/internal/feature-flags.js +0 -22
- package/src/mixins/carbon-prefix-mixin.js +0 -7
- package/src/mixins/check-mixin.js +0 -106
- package/src/mixins/index.js +0 -12
- package/src/mixins/link-mixin.js +0 -23
- package/src/mixins/methods-mixin.js +0 -18
- package/src/mixins/notification-mixin.js +0 -18
- package/src/mixins/radio-mixin.js +0 -36
- package/src/mixins/theme-mixin.js +0 -23
- package/src/mixins/uid-mixin.js +0 -23
- package/src/thumbnails/inline-notification.svg +0 -23
- package/src/thumbnails/skeleton-text.svg +0 -15
- package/src/thumbnails/toast-notification.svg +0 -34
- /package/src/components/{cv-button → CvButton}/consts.js +0 -0
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
data-notification
|
|
4
|
-
:class="[
|
|
5
|
-
'cv-inline-notification',
|
|
6
|
-
`${carbonPrefix}--inline-notification`,
|
|
7
|
-
`${carbonPrefix}--inline-notification--${kind.toLowerCase()}`,
|
|
8
|
-
{
|
|
9
|
-
[`${carbonPrefix}--inline-notification--low-contrast`]: lowContrast,
|
|
10
|
-
},
|
|
11
|
-
]"
|
|
12
|
-
v-on="$listeners"
|
|
13
|
-
:role="isAlert ? 'alert' : false"
|
|
14
|
-
:aria-live="!isAlert ? 'polite' : false"
|
|
15
|
-
>
|
|
16
|
-
<div :class="`${carbonPrefix}--inline-notification__details`">
|
|
17
|
-
<component :is="icon" :class="`${carbonPrefix}--inline-notification__icon`" />
|
|
18
|
-
<div :class="`${carbonPrefix}--inline-notification__text-wrapper`">
|
|
19
|
-
<p :class="`${carbonPrefix}--inline-notification__title`">{{ title }}</p>
|
|
20
|
-
<p :class="`${carbonPrefix}--inline-notification__subtitle`" v-html="subTitle"></p>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
<button
|
|
24
|
-
v-if="actionLabel"
|
|
25
|
-
@click="$emit('action')"
|
|
26
|
-
:class="[
|
|
27
|
-
`${carbonPrefix}--inline-notification__action-button`,
|
|
28
|
-
`${carbonPrefix}--btn`,
|
|
29
|
-
`${carbonPrefix}--btn--sm`,
|
|
30
|
-
`${carbonPrefix}--btn--ghost`,
|
|
31
|
-
]"
|
|
32
|
-
type="button"
|
|
33
|
-
>
|
|
34
|
-
{{ actionLabel }}
|
|
35
|
-
</button>
|
|
36
|
-
<button
|
|
37
|
-
v-if="!hideCloseButton"
|
|
38
|
-
type="button"
|
|
39
|
-
:aria-label="closeAriaLabel"
|
|
40
|
-
data-notification-btn
|
|
41
|
-
:class="`${carbonPrefix}--inline-notification__close-button`"
|
|
42
|
-
@click="$emit('close')"
|
|
43
|
-
>
|
|
44
|
-
<Close20 :class="`${carbonPrefix}--inline-notification__close-icon`" />
|
|
45
|
-
</button>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<script>
|
|
50
|
-
import { notificationMixin, carbonPrefixMixin } from '../../mixins';
|
|
51
|
-
import ErrorFilled20 from '@carbon/icons-vue/es/error--filled/20';
|
|
52
|
-
import CheckmarkFilled20 from '@carbon/icons-vue/es/checkmark--filled/20';
|
|
53
|
-
import WarningFilled20 from '@carbon/icons-vue/es/warning--filled/20';
|
|
54
|
-
import Close20 from '@carbon/icons-vue/es/close/20';
|
|
55
|
-
import InformationFilled20 from '@carbon/icons-vue/es/information--filled/20';
|
|
56
|
-
|
|
57
|
-
export default {
|
|
58
|
-
name: 'CvInlineNotification',
|
|
59
|
-
components: { Close20 },
|
|
60
|
-
mixins: [notificationMixin, carbonPrefixMixin],
|
|
61
|
-
props: {
|
|
62
|
-
actionLabel: { type: String, default: '' },
|
|
63
|
-
closeAriaLabel: { type: String, default: 'Dismiss notification' },
|
|
64
|
-
kind: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: 'info',
|
|
67
|
-
validator: val => ['error', 'info', 'warning', 'success'].includes(val),
|
|
68
|
-
},
|
|
69
|
-
lowContrast: Boolean,
|
|
70
|
-
hideCloseButton: Boolean,
|
|
71
|
-
},
|
|
72
|
-
computed: {
|
|
73
|
-
icon() {
|
|
74
|
-
switch (this.kind) {
|
|
75
|
-
case 'error':
|
|
76
|
-
return ErrorFilled20;
|
|
77
|
-
case 'warning':
|
|
78
|
-
return WarningFilled20;
|
|
79
|
-
case 'success':
|
|
80
|
-
return CheckmarkFilled20;
|
|
81
|
-
case 'info':
|
|
82
|
-
return InformationFilled20;
|
|
83
|
-
default:
|
|
84
|
-
return '';
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
</script>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="tagType"
|
|
4
|
-
v-on="$listeners"
|
|
5
|
-
v-bind="linkProps"
|
|
6
|
-
class="cv-link"
|
|
7
|
-
:class="[
|
|
8
|
-
`${carbonPrefix}--link`,
|
|
9
|
-
{
|
|
10
|
-
[`${carbonPrefix}--link--disabled`]: disabled,
|
|
11
|
-
[`${carbonPrefix}--link--inline`]: inline,
|
|
12
|
-
},
|
|
13
|
-
]"
|
|
14
|
-
>
|
|
15
|
-
<slot></slot>
|
|
16
|
-
</component>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
import { linkMixin, carbonPrefixMixin } from '../../mixins';
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
name: 'CvLink',
|
|
24
|
-
mixins: [linkMixin, carbonPrefixMixin],
|
|
25
|
-
props: {
|
|
26
|
-
disabled: Boolean,
|
|
27
|
-
inline: Boolean,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
</script>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li :class="`cv-list-item ${carbonPrefix}--list__item`">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</li>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { carbonPrefixMixin } from '../../mixins';
|
|
9
|
-
export default {
|
|
10
|
-
name: 'CvListItem',
|
|
11
|
-
mixins: [carbonPrefixMixin],
|
|
12
|
-
};
|
|
13
|
-
</script>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="tagType"
|
|
4
|
-
class="cv-list"
|
|
5
|
-
:class="{
|
|
6
|
-
[`${carbonPrefix}--list--nested`]: nested,
|
|
7
|
-
[`${carbonPrefix}--list--ordered`]: internalOrdered,
|
|
8
|
-
[`${carbonPrefix}--list--unordered`]: !internalOrdered,
|
|
9
|
-
}"
|
|
10
|
-
:data-nested="nested"
|
|
11
|
-
>
|
|
12
|
-
<slot></slot>
|
|
13
|
-
</component>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { carbonPrefixMixin } from '../../mixins';
|
|
18
|
-
export default {
|
|
19
|
-
name: 'CvList',
|
|
20
|
-
mixins: [carbonPrefixMixin],
|
|
21
|
-
props: {
|
|
22
|
-
ordered: { type: Boolean, default: undefined },
|
|
23
|
-
nested: Boolean,
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
internalOrdered() {
|
|
27
|
-
if (this.nested && this.ordered === undefined) {
|
|
28
|
-
if (this.$parent && this.$parent.$parent && this.$parent.$parent.$_CvList) {
|
|
29
|
-
return this.$parent.$parent.internalOrdered;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return this.ordered;
|
|
33
|
-
},
|
|
34
|
-
tagType() {
|
|
35
|
-
return this.internalOrdered ? 'ol' : 'ul';
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
created() {
|
|
39
|
-
this.$_CvList = true;
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
</script>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<cv-wrapper :tag-type="overlay ? 'div' : ''" class="cv-loading" :class="overlayClasses">
|
|
3
|
-
<div
|
|
4
|
-
data-loading
|
|
5
|
-
:class="{
|
|
6
|
-
'cv-loading': !overlay,
|
|
7
|
-
[`${carbonPrefix}--loading`]: active || stopping,
|
|
8
|
-
[`${carbonPrefix}--loading--stop`]: (!active && stopping) || stopped,
|
|
9
|
-
[`${carbonPrefix}--loading--small`]: small,
|
|
10
|
-
}"
|
|
11
|
-
ref="loading"
|
|
12
|
-
>
|
|
13
|
-
<label :class="`${carbonPrefix}--visually-hidden`">
|
|
14
|
-
{{ description }}
|
|
15
|
-
</label>
|
|
16
|
-
<svg :class="`${carbonPrefix}--loading__svg`" viewBox="0 0 100 100">
|
|
17
|
-
<title>{{ description }}</title>
|
|
18
|
-
<circle v-if="small" :class="`${carbonPrefix}--loading__background`" cx="50%" cy="50%" :r="loadingRadius" />
|
|
19
|
-
<circle :class="`${carbonPrefix}--loading__stroke`" cx="50%" cy="50%" :r="loadingRadius" />
|
|
20
|
-
</svg>
|
|
21
|
-
</div>
|
|
22
|
-
</cv-wrapper>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script>
|
|
26
|
-
import CvWrapper from '../cv-wrapper/_cv-wrapper';
|
|
27
|
-
import { carbonPrefixMixin } from '../../mixins';
|
|
28
|
-
|
|
29
|
-
export default {
|
|
30
|
-
name: 'CvLoading',
|
|
31
|
-
mixins: [carbonPrefixMixin],
|
|
32
|
-
components: { CvWrapper },
|
|
33
|
-
props: {
|
|
34
|
-
active: { type: Boolean, default: true },
|
|
35
|
-
description: { type: String, default: 'Loading' },
|
|
36
|
-
overlay: Boolean,
|
|
37
|
-
small: Boolean,
|
|
38
|
-
},
|
|
39
|
-
computed: {
|
|
40
|
-
overlayClasses() {
|
|
41
|
-
const classes = [];
|
|
42
|
-
if (this.overlay) {
|
|
43
|
-
if (this.active || this.stopping) {
|
|
44
|
-
classes.push(`${this.carbonPrefix}--loading-overlay`);
|
|
45
|
-
} else {
|
|
46
|
-
classes.push(`${this.carbonPrefix}--loading-overlay--stop`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return classes;
|
|
51
|
-
},
|
|
52
|
-
loadingRadius() {
|
|
53
|
-
return this.small ? '42' : '44';
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
data() {
|
|
57
|
-
return {
|
|
58
|
-
stopped: false,
|
|
59
|
-
stopping: false,
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
watch: {
|
|
63
|
-
active(val) {
|
|
64
|
-
this.onActiveUpdate(val);
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
methods: {
|
|
68
|
-
onEnd(ev) {
|
|
69
|
-
if (ev.animationName === 'rotate-end-p2') {
|
|
70
|
-
this.$refs.loading.removeEventListener('animationend', this.onEnd);
|
|
71
|
-
|
|
72
|
-
this.stopping = false;
|
|
73
|
-
this.stopped = true;
|
|
74
|
-
this.$emit('loading-end');
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
onActiveUpdate(newValue) {
|
|
78
|
-
this.stopped = false;
|
|
79
|
-
this.stopping = !newValue;
|
|
80
|
-
if (!newValue) {
|
|
81
|
-
this.$refs.loading.addEventListener('animationend', this.onEnd);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
</script>
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
data-modal
|
|
4
|
-
:id="uid"
|
|
5
|
-
:class="[
|
|
6
|
-
`cv-modal ${carbonPrefix}--modal`,
|
|
7
|
-
{
|
|
8
|
-
'is-visible': dataVisible,
|
|
9
|
-
[`${carbonPrefix}--modal--danger`]: kind === 'danger',
|
|
10
|
-
},
|
|
11
|
-
]"
|
|
12
|
-
tabindex="-1"
|
|
13
|
-
@keydown.esc.prevent="onEsc"
|
|
14
|
-
@click.self="onExternalClick"
|
|
15
|
-
>
|
|
16
|
-
<div
|
|
17
|
-
:class="[
|
|
18
|
-
`${carbonPrefix}--modal-container`,
|
|
19
|
-
{ [`${carbonPrefix}--modal-container--${internalSize}`]: internalSize },
|
|
20
|
-
]"
|
|
21
|
-
v-bind="dialogAttrs"
|
|
22
|
-
ref="modalDialog"
|
|
23
|
-
>
|
|
24
|
-
<div
|
|
25
|
-
class="cv-modal__before-content"
|
|
26
|
-
ref="beforeContent"
|
|
27
|
-
tabindex="0"
|
|
28
|
-
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
29
|
-
role="separator"
|
|
30
|
-
aria-valuenow="0"
|
|
31
|
-
@focus="focusBeforeContent"
|
|
32
|
-
/>
|
|
33
|
-
<div :class="`${carbonPrefix}--modal-header`">
|
|
34
|
-
<p :class="`${carbonPrefix}--modal-header__label`">
|
|
35
|
-
<slot name="label"></slot>
|
|
36
|
-
</p>
|
|
37
|
-
<p :class="`${carbonPrefix}--modal-header__heading`">
|
|
38
|
-
<slot name="title">Modal Title</slot>
|
|
39
|
-
</p>
|
|
40
|
-
<button
|
|
41
|
-
:class="`${carbonPrefix}--modal-close`"
|
|
42
|
-
type="button"
|
|
43
|
-
@click="onClose"
|
|
44
|
-
ref="close"
|
|
45
|
-
:aria-label="closeAriaLabel"
|
|
46
|
-
>
|
|
47
|
-
<Close16 :class="`${carbonPrefix}--modal-close__icon`" />
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<div
|
|
52
|
-
:class="[`${carbonPrefix}--modal-content`, { [`${carbonPrefix}--modal-content--with-form`]: hasFormContent }]"
|
|
53
|
-
ref="content"
|
|
54
|
-
:tabindex="scrollable ? 0 : undefined"
|
|
55
|
-
>
|
|
56
|
-
<slot name="content"></slot>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<cv-button-set
|
|
60
|
-
:class="[
|
|
61
|
-
`${carbonPrefix}--modal-footer`,
|
|
62
|
-
{ [`${carbonPrefix}--modal-footer--three-button`]: hasPrimary && hasSecondary && hasOtherBtn },
|
|
63
|
-
]"
|
|
64
|
-
v-if="hasFooter"
|
|
65
|
-
>
|
|
66
|
-
<cv-button type="button" kind="secondary" @click="onOtherBtnClick" v-if="hasOtherBtn" ref="otherBtn">
|
|
67
|
-
<slot name="other-button">Other button</slot>
|
|
68
|
-
</cv-button>
|
|
69
|
-
<cv-button type="button" kind="secondary" @click="onSecondaryClick" v-if="hasSecondary" ref="secondary">
|
|
70
|
-
<slot name="secondary-button">Secondary button</slot>
|
|
71
|
-
</cv-button>
|
|
72
|
-
<cv-button
|
|
73
|
-
:disabled="primaryButtonDisabled"
|
|
74
|
-
type="button"
|
|
75
|
-
:kind="primaryKind"
|
|
76
|
-
@click="onPrimaryClick"
|
|
77
|
-
v-if="hasPrimary"
|
|
78
|
-
ref="primary"
|
|
79
|
-
>
|
|
80
|
-
<slot name="primary-button">Primary button</slot>
|
|
81
|
-
</cv-button>
|
|
82
|
-
</cv-button-set>
|
|
83
|
-
<div
|
|
84
|
-
class="cv-modal__after-content"
|
|
85
|
-
ref="afterContent"
|
|
86
|
-
tabindex="0"
|
|
87
|
-
style="position: absolute; height: 1px; width: 1px; left: -9999px"
|
|
88
|
-
role="separator"
|
|
89
|
-
aria-valuenow="1"
|
|
90
|
-
@focus="focusAfterContent"
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</template>
|
|
95
|
-
|
|
96
|
-
<script>
|
|
97
|
-
import CvButton from '../cv-button/cv-button';
|
|
98
|
-
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
99
|
-
import Close16 from '@carbon/icons-vue/es/close/16';
|
|
100
|
-
import CvButtonSet from '../cv-button/cv-button-set.vue';
|
|
101
|
-
|
|
102
|
-
export default {
|
|
103
|
-
name: 'CvModal',
|
|
104
|
-
mixins: [uidMixin, carbonPrefixMixin],
|
|
105
|
-
components: {
|
|
106
|
-
CvButton,
|
|
107
|
-
Close16,
|
|
108
|
-
CvButtonSet,
|
|
109
|
-
},
|
|
110
|
-
props: {
|
|
111
|
-
alert: Boolean,
|
|
112
|
-
closeAriaLabel: { type: String, default: 'Close modal' },
|
|
113
|
-
kind: {
|
|
114
|
-
type: String,
|
|
115
|
-
default: '',
|
|
116
|
-
validator: val => ['', 'danger'].includes(val),
|
|
117
|
-
},
|
|
118
|
-
autoHideOff: Boolean,
|
|
119
|
-
visible: Boolean,
|
|
120
|
-
primaryButtonDisabled: Boolean,
|
|
121
|
-
size: String,
|
|
122
|
-
hasFormContent: Boolean,
|
|
123
|
-
},
|
|
124
|
-
data() {
|
|
125
|
-
return {
|
|
126
|
-
dataVisible: false,
|
|
127
|
-
scrollable: false,
|
|
128
|
-
hasFooter: false,
|
|
129
|
-
hasHeaderLabel: false,
|
|
130
|
-
hasPrimary: false,
|
|
131
|
-
hasSecondary: false,
|
|
132
|
-
hasOtherBtn: false,
|
|
133
|
-
};
|
|
134
|
-
},
|
|
135
|
-
mounted() {
|
|
136
|
-
if (this.visible) {
|
|
137
|
-
this.show();
|
|
138
|
-
}
|
|
139
|
-
this.checkSlots();
|
|
140
|
-
},
|
|
141
|
-
updated() {
|
|
142
|
-
this.checkSlots();
|
|
143
|
-
},
|
|
144
|
-
watch: {
|
|
145
|
-
visible(val) {
|
|
146
|
-
if (val) {
|
|
147
|
-
this.show();
|
|
148
|
-
} else {
|
|
149
|
-
this.hide();
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
computed: {
|
|
154
|
-
dialogAttrs() {
|
|
155
|
-
const passive = !this.hasFooter;
|
|
156
|
-
const attrs = {};
|
|
157
|
-
attrs['aria-label'] = this.$slots.title[0].text;
|
|
158
|
-
if (this.alert) {
|
|
159
|
-
if (passive) {
|
|
160
|
-
attrs.role = 'alert';
|
|
161
|
-
} else {
|
|
162
|
-
attrs.role = 'alertdialog';
|
|
163
|
-
}
|
|
164
|
-
} else {
|
|
165
|
-
attrs.role = 'dialog';
|
|
166
|
-
}
|
|
167
|
-
return attrs;
|
|
168
|
-
},
|
|
169
|
-
primaryKind() {
|
|
170
|
-
if (this.kind === 'danger') {
|
|
171
|
-
return 'danger';
|
|
172
|
-
} else {
|
|
173
|
-
return 'primary';
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
internalSize() {
|
|
177
|
-
switch (this.size) {
|
|
178
|
-
case 'xs':
|
|
179
|
-
return 'xs';
|
|
180
|
-
case 'small':
|
|
181
|
-
return 'sm';
|
|
182
|
-
case 'large':
|
|
183
|
-
return 'lg';
|
|
184
|
-
default:
|
|
185
|
-
return '';
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
model: {
|
|
190
|
-
event: 'modelEvent',
|
|
191
|
-
prop: 'visible',
|
|
192
|
-
},
|
|
193
|
-
methods: {
|
|
194
|
-
checkSlots() {
|
|
195
|
-
// NOTE: this.$slots is not reactive so needs to be managed on updated
|
|
196
|
-
this.hasFooter = !!(
|
|
197
|
-
this.$slots['primary-button'] ||
|
|
198
|
-
this.$slots['secondary-button'] ||
|
|
199
|
-
this.$slots['other-button']
|
|
200
|
-
);
|
|
201
|
-
this.hasHeaderLabel = !!this.$slots.label;
|
|
202
|
-
this.hasPrimary = !!this.$slots['primary-button'];
|
|
203
|
-
this.hasSecondary = !!this.$slots['secondary-button'];
|
|
204
|
-
this.hasOtherBtn = !!this.$slots['other-button'];
|
|
205
|
-
},
|
|
206
|
-
focusBeforeContent() {
|
|
207
|
-
if (this.$slots['primary-button']) {
|
|
208
|
-
this.$refs.primary.$el.focus();
|
|
209
|
-
} else if (this.$slots['secondary-button']) {
|
|
210
|
-
this.$refs.secondary.$el.focus();
|
|
211
|
-
} else if (this.$slots['other-button']) {
|
|
212
|
-
this.$refs.otherBtn.$el.focus();
|
|
213
|
-
} else {
|
|
214
|
-
this.$refs.close.focus();
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
focusAfterContent() {
|
|
218
|
-
this.$refs.close.focus();
|
|
219
|
-
},
|
|
220
|
-
onShown() {
|
|
221
|
-
const focusEl = this.$refs.content.querySelector('[data-modal-primary-focus]');
|
|
222
|
-
if (focusEl) {
|
|
223
|
-
focusEl.focus();
|
|
224
|
-
} else {
|
|
225
|
-
this.focusBeforeContent();
|
|
226
|
-
}
|
|
227
|
-
this.$emit('modal-shown');
|
|
228
|
-
|
|
229
|
-
// check to see if content scrollable
|
|
230
|
-
this.scrollable = this.$refs.content.scrollHeight > this.$refs.content.clientHeight;
|
|
231
|
-
|
|
232
|
-
this.$el.removeEventListener('transitionend', this.onShown);
|
|
233
|
-
},
|
|
234
|
-
onExternalClick(ev) {
|
|
235
|
-
if (ev.target === this.$el) {
|
|
236
|
-
this._maybeHide(ev, 'external-click');
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
onEsc(ev) {
|
|
240
|
-
this._maybeHide(ev, 'escape-press');
|
|
241
|
-
},
|
|
242
|
-
onClose(ev) {
|
|
243
|
-
this._maybeHide(ev, 'close-click');
|
|
244
|
-
},
|
|
245
|
-
show() {
|
|
246
|
-
// prevent body scrolling
|
|
247
|
-
document.body.classList.add(`${this.carbonPrefix}--body--with-modal-open`);
|
|
248
|
-
|
|
249
|
-
this.$el.addEventListener('transitionend', this.onShown);
|
|
250
|
-
this.dataVisible = true;
|
|
251
|
-
},
|
|
252
|
-
_maybeHide(event, reason) {
|
|
253
|
-
if (!this.autoHideOff) {
|
|
254
|
-
this.hide();
|
|
255
|
-
} else {
|
|
256
|
-
event['cv:reason'] = reason;
|
|
257
|
-
this.$emit('modal-hide-request', event);
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
hide() {
|
|
261
|
-
//restore any previous scrollability
|
|
262
|
-
document.body.classList.remove(`${this.carbonPrefix}--body--with-modal-open`);
|
|
263
|
-
|
|
264
|
-
if (this.dataVisible) {
|
|
265
|
-
this.$el.addEventListener('transitionend', this.afterHide);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
this.dataVisible = false;
|
|
269
|
-
this.$emit('modal-hidden');
|
|
270
|
-
},
|
|
271
|
-
afterHide(event) {
|
|
272
|
-
if (event.propertyName === 'opacity') {
|
|
273
|
-
this.$emit('after-modal-hidden');
|
|
274
|
-
this.$el.removeEventListener('transitionend', this.afterHide);
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
onFooterButtonClick(buttonId, ev) {
|
|
278
|
-
this.$emit(buttonId);
|
|
279
|
-
if (!this.$listeners[buttonId]) {
|
|
280
|
-
this._maybeHide(ev, buttonId);
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
onPrimaryClick(ev) {
|
|
284
|
-
this.onFooterButtonClick('primary-click', ev);
|
|
285
|
-
},
|
|
286
|
-
onSecondaryClick(ev) {
|
|
287
|
-
this.onFooterButtonClick('secondary-click', ev);
|
|
288
|
-
},
|
|
289
|
-
onOtherBtnClick(ev) {
|
|
290
|
-
this.onFooterButtonClick('other-btn-click', ev);
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
beforeDestroy() {
|
|
294
|
-
if (this.dataVisible) {
|
|
295
|
-
this.$emit('after-modal-hidden');
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
};
|
|
299
|
-
</script>
|