@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,173 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="[
|
|
4
|
-
`cv-text-input`,
|
|
5
|
-
`${carbonPrefix}--form-item`,
|
|
6
|
-
`${carbonPrefix}--text-input-wrapper`,
|
|
7
|
-
{ [`${carbonPrefix}--password-input-wrapper`]: isPassword },
|
|
8
|
-
]"
|
|
9
|
-
>
|
|
10
|
-
<label
|
|
11
|
-
:for="uid"
|
|
12
|
-
:class="[
|
|
13
|
-
`${carbonPrefix}--label`,
|
|
14
|
-
{
|
|
15
|
-
[`${carbonPrefix}--label--disabled`]: $attrs.disabled !== undefined && $attrs.disabled,
|
|
16
|
-
},
|
|
17
|
-
]"
|
|
18
|
-
>{{ label }}</label
|
|
19
|
-
>
|
|
20
|
-
<div
|
|
21
|
-
:class="[
|
|
22
|
-
`${carbonPrefix}--text-input__field-wrapper`,
|
|
23
|
-
{ [`${carbonPrefix}--text-input__field-wrapper--warning`]: !isInvalid && isWarn },
|
|
24
|
-
]"
|
|
25
|
-
:data-invalid="isInvalid"
|
|
26
|
-
>
|
|
27
|
-
<WarningFilled16 v-if="isInvalid" :class="`${carbonPrefix}--text-input__invalid-icon`" />
|
|
28
|
-
<WarningAltFilled16
|
|
29
|
-
v-if="isWarn"
|
|
30
|
-
:class="`${carbonPrefix}--text-input__invalid-icon ${carbonPrefix}--text-input__invalid-icon--warning`"
|
|
31
|
-
/>
|
|
32
|
-
|
|
33
|
-
<input
|
|
34
|
-
:id="uid"
|
|
35
|
-
:class="[
|
|
36
|
-
`${carbonPrefix}--text-input`,
|
|
37
|
-
{
|
|
38
|
-
[`${carbonPrefix}--text-input--light`]: isLight,
|
|
39
|
-
[`${carbonPrefix}--text-input--invalid`]: isInvalid,
|
|
40
|
-
[`${carbonPrefix}--text-input--warning`]: isWarn,
|
|
41
|
-
[`${carbonPrefix}--password-input`]: isPassword,
|
|
42
|
-
},
|
|
43
|
-
]"
|
|
44
|
-
v-bind="$attrs"
|
|
45
|
-
:value="value"
|
|
46
|
-
v-on="inputListeners"
|
|
47
|
-
:data-toggle-password-visibility="isPassword"
|
|
48
|
-
:type="dataType"
|
|
49
|
-
ref="input"
|
|
50
|
-
/>
|
|
51
|
-
<button
|
|
52
|
-
v-if="isPassword"
|
|
53
|
-
:class="[
|
|
54
|
-
`${carbonPrefix}--btn`,
|
|
55
|
-
`${carbonPrefix}--text-input--password__visibility__toggle`,
|
|
56
|
-
`${carbonPrefix}--tooltip__trigger`,
|
|
57
|
-
`${carbonPrefix}--tooltip--a11y`,
|
|
58
|
-
`${carbonPrefix}--tooltip--bottom`,
|
|
59
|
-
`${carbonPrefix}--tooltip--align-center`,
|
|
60
|
-
]"
|
|
61
|
-
@click="togglePasswordVisibility"
|
|
62
|
-
type="button"
|
|
63
|
-
>
|
|
64
|
-
<span :class="`${carbonPrefix}--assistive-text`">{{ passwordHideShowLabel }}</span>
|
|
65
|
-
<ViewOff16 v-if="isPasswordVisible" :class="`${carbonPrefix}--icon-visibility-off`" />
|
|
66
|
-
<View16 v-else :class="`${carbonPrefix}--icon-visibility-off`" />
|
|
67
|
-
</button>
|
|
68
|
-
</div>
|
|
69
|
-
<div :class="`${carbonPrefix}--form-requirement`" v-if="isInvalid">
|
|
70
|
-
<slot name="invalid-message">{{ invalidMessage }}</slot>
|
|
71
|
-
</div>
|
|
72
|
-
<div v-if="isWarn" :class="`${carbonPrefix}--form__requirement`">
|
|
73
|
-
<slot name="warn-text">{{ warnText }}</slot>
|
|
74
|
-
</div>
|
|
75
|
-
<div
|
|
76
|
-
v-if="isHelper"
|
|
77
|
-
:class="[
|
|
78
|
-
`${carbonPrefix}--form__helper-text`,
|
|
79
|
-
{ [`${carbonPrefix}--form__helper-text--disabled`]: $attrs.disabled },
|
|
80
|
-
]"
|
|
81
|
-
>
|
|
82
|
-
<slot name="helper-text">{{ helperText }}</slot>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</template>
|
|
86
|
-
|
|
87
|
-
<script>
|
|
88
|
-
import { uidMixin, themeMixin, methodsMixin, carbonPrefixMixin } from '../../mixins';
|
|
89
|
-
import { WarningFilled16, WarningAltFilled16, View16, ViewOff16 } from '@carbon/icons-vue';
|
|
90
|
-
|
|
91
|
-
export default {
|
|
92
|
-
name: 'CvTextInput',
|
|
93
|
-
components: { WarningFilled16, WarningAltFilled16, View16, ViewOff16 },
|
|
94
|
-
mixins: [uidMixin, themeMixin, carbonPrefixMixin, methodsMixin({ input: ['blur', 'focus'] })],
|
|
95
|
-
inheritAttrs: false,
|
|
96
|
-
props: {
|
|
97
|
-
helperText: { type: String, default: undefined },
|
|
98
|
-
invalidMessage: { type: String, default: undefined },
|
|
99
|
-
label: String,
|
|
100
|
-
passwordHideLabel: { type: String, default: 'Hide password' },
|
|
101
|
-
passwordShowLabel: { type: String, default: 'Show password' },
|
|
102
|
-
passwordVisible: Boolean,
|
|
103
|
-
type: String,
|
|
104
|
-
value: String,
|
|
105
|
-
warnText: { type: String, default: undefined },
|
|
106
|
-
},
|
|
107
|
-
data() {
|
|
108
|
-
return {
|
|
109
|
-
dataPasswordVisible: this.isPassword && this.passwordVisible,
|
|
110
|
-
dataType: this.type,
|
|
111
|
-
isHelper: false,
|
|
112
|
-
isInvalid: false,
|
|
113
|
-
isWarn: false,
|
|
114
|
-
};
|
|
115
|
-
},
|
|
116
|
-
mounted() {
|
|
117
|
-
this.checkSlots();
|
|
118
|
-
},
|
|
119
|
-
updated() {
|
|
120
|
-
this.checkSlots();
|
|
121
|
-
},
|
|
122
|
-
watch: {
|
|
123
|
-
passwordVisible() {
|
|
124
|
-
if (this.passwordVisible !== this.dataPasswordVisible) {
|
|
125
|
-
this.togglePasswordVisibility();
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
type() {
|
|
129
|
-
this.dataType = this.type;
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
computed: {
|
|
133
|
-
// Bind listeners at the component level to the embedded input element and
|
|
134
|
-
// add our own input listener to service the v-model. See:
|
|
135
|
-
// https://vuejs.org/v2/guide/components-custom-events.html#Customizing-Component-v-model
|
|
136
|
-
inputListeners() {
|
|
137
|
-
return {
|
|
138
|
-
...this.$listeners,
|
|
139
|
-
input: event => this.$emit('input', event.target.value),
|
|
140
|
-
};
|
|
141
|
-
},
|
|
142
|
-
isPassword() {
|
|
143
|
-
return this.type === 'password';
|
|
144
|
-
},
|
|
145
|
-
isPasswordVisible() {
|
|
146
|
-
return this.isPassword && this.dataPasswordVisible;
|
|
147
|
-
},
|
|
148
|
-
passwordHideShowLabel() {
|
|
149
|
-
return this.isPasswordVisible ? this.passwordHideLabel : this.passwordShowLabel;
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
methods: {
|
|
153
|
-
checkSlots() {
|
|
154
|
-
// NOTE: this.$slots is not reactive so needs to be managed on updated
|
|
155
|
-
this.isInvalid = !!(this.$slots['invalid-message'] || (this.invalidMessage && this.invalidMessage.length));
|
|
156
|
-
this.isWarn = !this.isInvalid && !!(this.$slots['warn-text'] || (this.warnText && this.warnText.length));
|
|
157
|
-
this.isHelper =
|
|
158
|
-
!this.isInvalid &&
|
|
159
|
-
!this.isWarn &&
|
|
160
|
-
!!(this.$slots['helper-text'] || (this.helperText && this.helperText.length));
|
|
161
|
-
},
|
|
162
|
-
togglePasswordVisibility() {
|
|
163
|
-
const currentValue = this.$refs.input.value;
|
|
164
|
-
this.dataPasswordVisible = !this.dataPasswordVisible;
|
|
165
|
-
this.dataType = this.dataPasswordVisible ? 'text' : 'password';
|
|
166
|
-
|
|
167
|
-
this.$nextTick(() => {
|
|
168
|
-
this.$refs.input.value = currentValue;
|
|
169
|
-
});
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="tagType"
|
|
4
|
-
v-on="$listeners"
|
|
5
|
-
v-bind="linkProps"
|
|
6
|
-
ref="target"
|
|
7
|
-
data-tile="clickable"
|
|
8
|
-
:class="`cv-tile-clickable ${carbonPrefix}--tile--clickable`"
|
|
9
|
-
tabindex="0"
|
|
10
|
-
>
|
|
11
|
-
<slot></slot>
|
|
12
|
-
</component>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
import { linkMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
name: 'CvTileClickable',
|
|
20
|
-
mixins: [linkMixin, carbonPrefixMixin, methodsMixin({ target: ['blur', 'focus'] })],
|
|
21
|
-
};
|
|
22
|
-
</script>
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button
|
|
3
|
-
type="button"
|
|
4
|
-
:style="styleObject"
|
|
5
|
-
@click="toggle"
|
|
6
|
-
:class="[
|
|
7
|
-
`cv-tile-expandable ${carbonPrefix}--tile--expandable`,
|
|
8
|
-
{ [`${carbonPrefix}--tile--is-expanded`]: internalExpanded },
|
|
9
|
-
]"
|
|
10
|
-
>
|
|
11
|
-
<div :class="`${carbonPrefix}--tile-content`">
|
|
12
|
-
<span data-tile-atf :class="`${carbonPrefix}--tile-content__above-the-fold`" ref="aboveFold">
|
|
13
|
-
<slot>
|
|
14
|
-
<!-- Above the fold content here -->
|
|
15
|
-
</slot>
|
|
16
|
-
</span>
|
|
17
|
-
<div :class="`${carbonPrefix}--tile__chevron`">
|
|
18
|
-
<span>{{ chevronLabel }}</span>
|
|
19
|
-
<ChevronDown16 />
|
|
20
|
-
</div>
|
|
21
|
-
<span
|
|
22
|
-
:class="`${carbonPrefix}--tile-content__below-the-fold`"
|
|
23
|
-
ref="belowFold"
|
|
24
|
-
v-show="internalExpanded || initialized"
|
|
25
|
-
>
|
|
26
|
-
<slot name="below">
|
|
27
|
-
<!-- Rest of the content here -->
|
|
28
|
-
</slot>
|
|
29
|
-
</span>
|
|
30
|
-
</div>
|
|
31
|
-
</button>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import ChevronDown16 from '@carbon/icons-vue/es/chevron--down/16';
|
|
36
|
-
import { carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: 'CvTileExpandable',
|
|
40
|
-
mixins: [carbonPrefixMixin, methodsMixin({ target: ['blur', 'focus'] })],
|
|
41
|
-
props: {
|
|
42
|
-
expanded: Boolean,
|
|
43
|
-
tileCollapsedLabel: String,
|
|
44
|
-
tileExpandedLabel: String,
|
|
45
|
-
},
|
|
46
|
-
components: { ChevronDown16 },
|
|
47
|
-
data() {
|
|
48
|
-
return {
|
|
49
|
-
styleObject: {
|
|
50
|
-
maxHeight: 'initial',
|
|
51
|
-
},
|
|
52
|
-
initialized: false,
|
|
53
|
-
internalExpanded: this.expanded,
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
watch: {
|
|
57
|
-
expanded(val) {
|
|
58
|
-
if (val !== this.internalExpanded) {
|
|
59
|
-
this.toggle(val);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
computed: {
|
|
64
|
-
chevronLabel() {
|
|
65
|
-
return this.internalExpanded ? this.tileExpandedLabel : this.tileCollapsedLabel;
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
toggle(force) {
|
|
70
|
-
let currentHeight = this.$el.getBoundingClientRect().height;
|
|
71
|
-
if (!this.initialized) {
|
|
72
|
-
this.styleObject.maxHeight = `${currentHeight}px`;
|
|
73
|
-
this.initialized = true;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this.$nextTick(() => {
|
|
77
|
-
const forceType = typeof force;
|
|
78
|
-
this.internalExpanded = forceType === 'boolean' ? force : !this.internalExpanded;
|
|
79
|
-
|
|
80
|
-
const belowFoldHeight = this.$refs.belowFold.getBoundingClientRect().height;
|
|
81
|
-
|
|
82
|
-
if (this.internalExpanded) {
|
|
83
|
-
currentHeight += belowFoldHeight;
|
|
84
|
-
} else {
|
|
85
|
-
currentHeight -= belowFoldHeight;
|
|
86
|
-
}
|
|
87
|
-
this.styleObject.maxHeight = `${currentHeight}px`;
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
</script>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label
|
|
3
|
-
:for="uid"
|
|
4
|
-
:aria-label="ariaLabel"
|
|
5
|
-
:class="[
|
|
6
|
-
`cv-tile-selectable ${carbonPrefix}--tile--selectable`,
|
|
7
|
-
{ [`${carbonPrefix}--tile--is-selected`]: isChecked },
|
|
8
|
-
]"
|
|
9
|
-
data-tile="selectable"
|
|
10
|
-
tabindex="0"
|
|
11
|
-
:data-contained-checkbox-state="isChecked"
|
|
12
|
-
ref="target"
|
|
13
|
-
>
|
|
14
|
-
<input
|
|
15
|
-
tabindex="-1"
|
|
16
|
-
data-tile-input
|
|
17
|
-
:id="uid"
|
|
18
|
-
type="checkbox"
|
|
19
|
-
:checked="isChecked"
|
|
20
|
-
:class="`${carbonPrefix}--tile-input`"
|
|
21
|
-
v-bind="$attrs"
|
|
22
|
-
v-on="inputListeners"
|
|
23
|
-
/>
|
|
24
|
-
<div :class="`${carbonPrefix}--tile__checkmark`">
|
|
25
|
-
<CheckmarkFilled16 />
|
|
26
|
-
</div>
|
|
27
|
-
<div :class="`${carbonPrefix}--tile-content`">
|
|
28
|
-
<slot>
|
|
29
|
-
<!-- Tile content here -->
|
|
30
|
-
</slot>
|
|
31
|
-
</div>
|
|
32
|
-
</label>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
import { uidMixin, checkMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
37
|
-
import CheckmarkFilled16 from '@carbon/icons-vue/es/checkmark--filled/16';
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
name: 'CvTileSelectable',
|
|
41
|
-
mixins: [uidMixin, checkMixin, carbonPrefixMixin, methodsMixin({ target: ['blur', 'focus'] })],
|
|
42
|
-
components: { CheckmarkFilled16 },
|
|
43
|
-
inheritAttrs: false,
|
|
44
|
-
props: {
|
|
45
|
-
ariaLabel: { type: String, default: 'tile' },
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
</script>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="tagType"
|
|
4
|
-
:class="[`cv-tile ${carbonPrefix}--tile`, { [`${carbonPrefix}--tile--light`]: isLight }]"
|
|
5
|
-
:checked="selected"
|
|
6
|
-
:expanded="expanded"
|
|
7
|
-
:tileCollapsedLabel="tileCollapsedLabel"
|
|
8
|
-
:tileExpandedLabel="tileExpandedLabel"
|
|
9
|
-
v-bind="$attrs"
|
|
10
|
-
v-on="$listeners"
|
|
11
|
-
ref="tile"
|
|
12
|
-
>
|
|
13
|
-
<!-- can i now click on this -->
|
|
14
|
-
<template>
|
|
15
|
-
<slot></slot>
|
|
16
|
-
</template>
|
|
17
|
-
<template slot="below">
|
|
18
|
-
<slot name="below"></slot>
|
|
19
|
-
</template>
|
|
20
|
-
</component>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import { themeMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
25
|
-
import CvTileClickable from './_cv-tile-clickable';
|
|
26
|
-
import CvTileExpandable from './_cv-tile-expandable';
|
|
27
|
-
import CvTileSelectable from './_cv-tile-selectable';
|
|
28
|
-
import CvTileStandard from './_cv-tile-standard';
|
|
29
|
-
|
|
30
|
-
export default {
|
|
31
|
-
name: 'CvTile',
|
|
32
|
-
inheritAttrs: false,
|
|
33
|
-
model: {
|
|
34
|
-
// required for selectable kind
|
|
35
|
-
prop: 'modelValue',
|
|
36
|
-
event: 'modelEvent',
|
|
37
|
-
},
|
|
38
|
-
mixins: [themeMixin, carbonPrefixMixin, methodsMixin({ tile: ['blur', 'focus'] })],
|
|
39
|
-
components: {
|
|
40
|
-
CvTileClickable,
|
|
41
|
-
CvTileExpandable,
|
|
42
|
-
CvTileSelectable,
|
|
43
|
-
CvTileStandard,
|
|
44
|
-
},
|
|
45
|
-
props: {
|
|
46
|
-
expanded: Boolean,
|
|
47
|
-
selected: Boolean,
|
|
48
|
-
tileCollapsedLabel: { type: String, default: 'Tile collapsed' },
|
|
49
|
-
tileExpandedLabel: { type: String, default: 'Tile expanded' },
|
|
50
|
-
kind: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: '',
|
|
53
|
-
validator: value => ['clickable', 'expandable', 'selectable', 'standard', ''].includes(value),
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
computed: {
|
|
57
|
-
tagType() {
|
|
58
|
-
switch (this.kind) {
|
|
59
|
-
case 'clickable':
|
|
60
|
-
return 'cv-tile-clickable';
|
|
61
|
-
case 'selectable':
|
|
62
|
-
return 'cv-tile-selectable';
|
|
63
|
-
case 'expandable':
|
|
64
|
-
return 'cv-tile-expandable';
|
|
65
|
-
default:
|
|
66
|
-
return 'cv-tile-standard';
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
// methods: {
|
|
71
|
-
// focus() {
|
|
72
|
-
// if (this.$children[0].focus) {
|
|
73
|
-
// this.$children[0].focus();
|
|
74
|
-
// }
|
|
75
|
-
// },
|
|
76
|
-
// blur() {
|
|
77
|
-
// if (this.$children[0].blur) {
|
|
78
|
-
// this.$children[0].blur();
|
|
79
|
-
// }
|
|
80
|
-
// },
|
|
81
|
-
// },
|
|
82
|
-
};
|
|
83
|
-
</script>
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="`cv-time-picker ${carbonPrefix}--form-item`">
|
|
3
|
-
<div
|
|
4
|
-
:class="[`${carbonPrefix}--time-picker`, { [`${carbonPrefix}--time-picker--light`]: isLight }]"
|
|
5
|
-
:data-invalid="isInvalid"
|
|
6
|
-
>
|
|
7
|
-
<div :class="`${carbonPrefix}--time-picker__input`">
|
|
8
|
-
<label :for="uid" :class="`${carbonPrefix}--label`">{{ label }}</label>
|
|
9
|
-
<input
|
|
10
|
-
ref="input"
|
|
11
|
-
:id="uid"
|
|
12
|
-
type="text"
|
|
13
|
-
:class="[
|
|
14
|
-
`${carbonPrefix}--time-picker__input-field ${carbonPrefix}--text-input`,
|
|
15
|
-
{ [`${carbonPrefix}--text-input--light`]: isLight },
|
|
16
|
-
]"
|
|
17
|
-
:pattern="pattern"
|
|
18
|
-
v-bind="$attrs"
|
|
19
|
-
:placeholder="placeholder"
|
|
20
|
-
:maxlength="placeholder.length"
|
|
21
|
-
:value="time"
|
|
22
|
-
:disabled="disabled"
|
|
23
|
-
@input="$emit('update:time', $event.target.value)"
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
<cv-select
|
|
27
|
-
v-if="ampm !== '24'"
|
|
28
|
-
:class="`${carbonPrefix}--time-picker__select`"
|
|
29
|
-
:form-item="false"
|
|
30
|
-
hide-label
|
|
31
|
-
:label="ampmSelectLabel"
|
|
32
|
-
@change="$emit('update:ampm', $event)"
|
|
33
|
-
:value="ampm"
|
|
34
|
-
:disabled="disabled"
|
|
35
|
-
>
|
|
36
|
-
<cv-select-option :class="`${carbonPrefix}--select-option`" value="AM">AM</cv-select-option>
|
|
37
|
-
<cv-select-option :class="`${carbonPrefix}--select-option`" value="PM">PM</cv-select-option>
|
|
38
|
-
</cv-select>
|
|
39
|
-
<div v-else v-html="` `"></div>
|
|
40
|
-
|
|
41
|
-
<cv-select
|
|
42
|
-
:class="`${carbonPrefix}--time-picker__select`"
|
|
43
|
-
:form-item="false"
|
|
44
|
-
hide-label
|
|
45
|
-
:label="timezonesSelectLabel"
|
|
46
|
-
v-if="timezones.length > 0"
|
|
47
|
-
:value="validTimezone"
|
|
48
|
-
@change="$emit('update:timezone', $event)"
|
|
49
|
-
:disabled="disabled"
|
|
50
|
-
>
|
|
51
|
-
<cv-select-option
|
|
52
|
-
:class="`${carbonPrefix}--select-option`"
|
|
53
|
-
v-for="item in timezones"
|
|
54
|
-
:key="item.value"
|
|
55
|
-
:value="item.value"
|
|
56
|
-
>{{ item.label }}</cv-select-option
|
|
57
|
-
>
|
|
58
|
-
</cv-select>
|
|
59
|
-
</div>
|
|
60
|
-
<div :class="`${carbonPrefix}--form-requirement`" v-if="isInvalid">
|
|
61
|
-
<slot name="invalid-message">{{ invalidMessage }}</slot>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<script>
|
|
67
|
-
import { uidMixin, themeMixin, carbonPrefixMixin, methodsMixin } from '../../mixins';
|
|
68
|
-
import CvSelect from '../cv-select/cv-select';
|
|
69
|
-
import CvSelectOption from '../cv-select/cv-select-option';
|
|
70
|
-
|
|
71
|
-
export default {
|
|
72
|
-
name: 'CvTimePicker',
|
|
73
|
-
components: {
|
|
74
|
-
CvSelect,
|
|
75
|
-
CvSelectOption,
|
|
76
|
-
},
|
|
77
|
-
mixins: [uidMixin, themeMixin, carbonPrefixMixin, methodsMixin({ input: ['blur', 'focus'] })],
|
|
78
|
-
inheritAttrs: false,
|
|
79
|
-
props: {
|
|
80
|
-
ampm: {
|
|
81
|
-
type: String,
|
|
82
|
-
default: 'AM',
|
|
83
|
-
},
|
|
84
|
-
ampmSelectLabel: { type: String, default: 'Select AM/PM' },
|
|
85
|
-
disabled: Boolean,
|
|
86
|
-
invalidMessage: { type: String, default: undefined },
|
|
87
|
-
label: { type: String, default: 'Select a time' },
|
|
88
|
-
pattern: { type: String, default: '([01][0-9]:[0-6][0-9])' },
|
|
89
|
-
placeholder: { type: String, default: 'hh:mm' },
|
|
90
|
-
time: String,
|
|
91
|
-
timezone: String,
|
|
92
|
-
timezones: { type: Array, default: () => [] },
|
|
93
|
-
timezonesSelectLabel: { type: String, default: 'Select time zone' },
|
|
94
|
-
},
|
|
95
|
-
data() {
|
|
96
|
-
return {
|
|
97
|
-
isInvalid: false,
|
|
98
|
-
};
|
|
99
|
-
},
|
|
100
|
-
mounted() {
|
|
101
|
-
this.checkSlots();
|
|
102
|
-
},
|
|
103
|
-
updated() {
|
|
104
|
-
this.checkSlots();
|
|
105
|
-
},
|
|
106
|
-
computed: {
|
|
107
|
-
validAmpm() {
|
|
108
|
-
let result = this.ampm;
|
|
109
|
-
if (!['AM', 'PM', '24'].includes(this.ampm)) {
|
|
110
|
-
console.error(`CvTimePicker: invalid value '${this.ampm}' supplied for prop ampm. Default applied.`);
|
|
111
|
-
// set to valid value
|
|
112
|
-
result = this.ampm[0].value;
|
|
113
|
-
this.$emit('update:ampm', result);
|
|
114
|
-
}
|
|
115
|
-
return result;
|
|
116
|
-
},
|
|
117
|
-
validTimezone() {
|
|
118
|
-
// Validate timezone setting
|
|
119
|
-
let result = this.timezone;
|
|
120
|
-
if (this.timezones && this.timezones.length) {
|
|
121
|
-
if (!this.timezones.find(item => item.value === this.timezone)) {
|
|
122
|
-
console.error(`CvTimePicker: invalid value '${this.timezone}' supplied for prop timezone. Default applied.`);
|
|
123
|
-
// set to first valid value
|
|
124
|
-
result = this.timezones[0].value;
|
|
125
|
-
this.$emit('update:timezone', result);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
methods: {
|
|
132
|
-
checkSlots() {
|
|
133
|
-
// NOTE: this.$slots is not reactive so needs to be managed on updated
|
|
134
|
-
this.isInvalid = !!(this.$slots['invalid-message'] || (this.invalidMessage && this.invalidMessage.length));
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
</script>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
data-notification
|
|
4
|
-
:class="[
|
|
5
|
-
`cv-notification ${carbonPrefix}--toast-notification`,
|
|
6
|
-
`${carbonPrefix}--toast-notification--${kind.toLowerCase()}`,
|
|
7
|
-
{ [`${carbonPrefix}--toast-notification--low-contrast`]: lowContrast },
|
|
8
|
-
]"
|
|
9
|
-
v-on="$listeners"
|
|
10
|
-
:role="isAlert ? 'alert' : undefined"
|
|
11
|
-
:aria-live="!isAlert ? 'polite' : false"
|
|
12
|
-
>
|
|
13
|
-
<component :is="icon" :class="`${carbonPrefix}--toast-notification__icon`" />
|
|
14
|
-
<div :class="`${carbonPrefix}--toast-notification__details`">
|
|
15
|
-
<h3 :class="`${carbonPrefix}--toast-notification__title`">{{ title }}</h3>
|
|
16
|
-
<p :class="`${carbonPrefix}--toast-notification__subtitle`" v-html="subTitle"></p>
|
|
17
|
-
<p :class="`${carbonPrefix}--toast-notification__caption`" v-html="caption"></p>
|
|
18
|
-
</div>
|
|
19
|
-
<button
|
|
20
|
-
v-if="!hideCloseButton"
|
|
21
|
-
:aria-label="closeAriaLabel"
|
|
22
|
-
type="button"
|
|
23
|
-
data-notification-btn
|
|
24
|
-
:class="`${carbonPrefix}--toast-notification__close-button`"
|
|
25
|
-
@click="$emit('close')"
|
|
26
|
-
>
|
|
27
|
-
<Close20 :class="`${carbonPrefix}--toast-notification__close-icon`" />
|
|
28
|
-
</button>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
import { notificationMixin, carbonPrefixMixin } from '../../mixins';
|
|
34
|
-
import ErrorFilled20 from '@carbon/icons-vue/es/error--filled/20';
|
|
35
|
-
import CheckmarkFilled20 from '@carbon/icons-vue/es/checkmark--filled/20';
|
|
36
|
-
import WarningFilled20 from '@carbon/icons-vue/es/warning--filled/20';
|
|
37
|
-
import Close20 from '@carbon/icons-vue/es/close/20';
|
|
38
|
-
import InformationFilled20 from '@carbon/icons-vue/es/information--filled/20';
|
|
39
|
-
|
|
40
|
-
export default {
|
|
41
|
-
name: 'CvToastNotification',
|
|
42
|
-
components: { Close20 },
|
|
43
|
-
mixins: [notificationMixin, carbonPrefixMixin],
|
|
44
|
-
props: {
|
|
45
|
-
caption: String,
|
|
46
|
-
closeAriaLabel: { type: String, default: 'Dismiss notification' },
|
|
47
|
-
hideCloseButton: Boolean,
|
|
48
|
-
kind: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: 'info',
|
|
51
|
-
validator: val => ['error', 'info', 'warning', 'success'].includes(val),
|
|
52
|
-
},
|
|
53
|
-
lowContrast: Boolean,
|
|
54
|
-
},
|
|
55
|
-
computed: {
|
|
56
|
-
icon() {
|
|
57
|
-
switch (this.kind) {
|
|
58
|
-
case 'error':
|
|
59
|
-
return ErrorFilled20;
|
|
60
|
-
case 'warning':
|
|
61
|
-
return WarningFilled20;
|
|
62
|
-
case 'success':
|
|
63
|
-
return CheckmarkFilled20;
|
|
64
|
-
case 'info':
|
|
65
|
-
return InformationFilled20;
|
|
66
|
-
default:
|
|
67
|
-
return '';
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="`cv-toggle ${carbonPrefix}--form-item`" :id="uid">
|
|
3
|
-
<label
|
|
4
|
-
:class="`${carbonPrefix}--toggle__label ${carbonPrefix}--skeleton`"
|
|
5
|
-
:for="uid"
|
|
6
|
-
:aria-label="label ? 'Toggle is loading' : label"
|
|
7
|
-
>
|
|
8
|
-
<span :class="`${carbonPrefix}--toggle__label-text`" />
|
|
9
|
-
<span :class="`${carbonPrefix}--toggle__text--left`" />
|
|
10
|
-
<span :class="`${carbonPrefix}--toggle__appearance`" />
|
|
11
|
-
<span :class="`${carbonPrefix}--toggle__text--right`" />
|
|
12
|
-
</label>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { uidMixin, carbonPrefixMixin } from '../../mixins';
|
|
18
|
-
export default {
|
|
19
|
-
name: 'CvToggleSkeleton',
|
|
20
|
-
mixins: [uidMixin, carbonPrefixMixin],
|
|
21
|
-
props: {
|
|
22
|
-
label: { type: String, default: 'Toggle is loading' },
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
</script>
|