@carbon/vue 2.45.0 → 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 -295
- 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
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import { CvDataTable } from '.';
|
|
3
|
+
import CvDataTableHeading from './CvDataTableHeading.vue';
|
|
4
|
+
import CvDataTableRow from "./CvDataTableRow.vue";
|
|
5
|
+
import CvDataTableCell from "./CvDataTableCell.vue";
|
|
6
|
+
import CvDataTableAction from "./CvDataTableAction.vue";
|
|
7
|
+
import CvDataTableSkeleton from "./CvDataTableSkeleton.vue";
|
|
8
|
+
import CvButton from '../CvButton/CvButton.vue'
|
|
9
|
+
import { sbCompPrefix } from '../../global/storybook-utils';
|
|
10
|
+
import { action } from '@storybook/addon-actions';
|
|
11
|
+
import { Terminal16 as CompileIcon, Debug16 as DebugIcon, Chip16 as EmbedIcon,
|
|
12
|
+
TrashCan16 as TrashCanIcon} from '@carbon/icons-vue'
|
|
13
|
+
const testData = [
|
|
14
|
+
{ name:"Java", year:1995, oo:"Yes", purpose:"Applications", standard:"Java Language Specification", desc: "As of September 2022, Java 19 is the latest version, while Java 17, 11 and 8 are the current long-term support (LTS) versions."},
|
|
15
|
+
{ name:"COBOL", year:1959, oo:"Yes", purpose:"Business applications", standard:"COBOL 2014", desc: "COBOL statements have an English-like syntax, which was designed to be self-documenting and highly readable."},
|
|
16
|
+
{ name:"Pascal", year:1970, oo:"No", purpose:"Applications", standard:"None", desc: "Pascal was developed on the pattern of the ALGOL 60 language."},
|
|
17
|
+
{ name:"Ada", year:1980, oo:"Yes", purpose:"US DoD projects", standard:"Ada 2012 TC1", desc: "Ada was named after Ada Lovelace (1815–1852), who has been credited as the first computer programmer."},
|
|
18
|
+
{ name:"BASIC", year:1964, oo:"No", purpose:"Education", standard:"ANSI", desc: "BASIC declined in popularity in the 1990s"},
|
|
19
|
+
{ name:"C++", year:1985, oo:"Yes", purpose:"Systems programming", standard:"ISO/IEC 2017", desc: "C++ is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2020 as ISO/IEC 14882:2020 (informally known as C++20)."},
|
|
20
|
+
{ name:"Fortran", year:1957, oo:"No", purpose:"Engineering applications", standard:"ANSI", desc: "Fortran was originally developed by IBM in the 1950s for scientific and engineering applications, and subsequently came to dominate scientific computing."},
|
|
21
|
+
{ name:"Go", year:2009, oo:"Maybe", purpose:"Networked applications", standard:"Go Spec", desc: "Go's designers were primarily motivated by their shared dislike of C++."},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
<Meta title={`${sbCompPrefix}/CvDataTable`} component={CvDataTable} />
|
|
25
|
+
|
|
26
|
+
export const Template = args => ({
|
|
27
|
+
// Components used in your story `template` are defined in the `components` object
|
|
28
|
+
components: {
|
|
29
|
+
CvDataTable,
|
|
30
|
+
CvDataTableHeading,
|
|
31
|
+
CvDataTableRow,
|
|
32
|
+
CvDataTableCell,
|
|
33
|
+
CvDataTableAction,
|
|
34
|
+
CompileIcon,
|
|
35
|
+
DebugIcon,
|
|
36
|
+
EmbedIcon,
|
|
37
|
+
CvButton,
|
|
38
|
+
CvDataTableSkeleton,
|
|
39
|
+
},
|
|
40
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
41
|
+
setup() {
|
|
42
|
+
return {
|
|
43
|
+
args: {...args,
|
|
44
|
+
useActions: undefined,
|
|
45
|
+
useBatchActions: undefined,
|
|
46
|
+
useHelperTextSlot: undefined,
|
|
47
|
+
template: undefined},
|
|
48
|
+
trashIcon: TrashCanIcon,
|
|
49
|
+
onSort: action('sort'),
|
|
50
|
+
onSearch: action('search'),
|
|
51
|
+
onRowSelectChange: action('row-select-change'),
|
|
52
|
+
onRowSelectChanges: action('row-select-changes'),
|
|
53
|
+
onOverflowMenuClick: action('overflow-menu-click'),
|
|
54
|
+
onRowExpanded: action('row-expanded'),
|
|
55
|
+
onPagination: action('pagination'),
|
|
56
|
+
onAction1: action('compile'),
|
|
57
|
+
onAction2: action('debug'),
|
|
58
|
+
onAction3: action('firmware'),
|
|
59
|
+
onDelete: action('delete'),
|
|
60
|
+
useActions: args.useActions,
|
|
61
|
+
useBatchActions: args.useBatchActions,
|
|
62
|
+
useHelperTextSlot: args.useHelperTextSlot,
|
|
63
|
+
skeletonRows: args.skeletonRows,
|
|
64
|
+
skeletonCols: args.skeletonCols,
|
|
65
|
+
skeletonTitle: args.title,
|
|
66
|
+
skeletonHelper: args.helperText,
|
|
67
|
+
testData
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
// And then the `args` are bound to your component with `v-bind="args"`
|
|
71
|
+
template: args.template,
|
|
72
|
+
});
|
|
73
|
+
const defaultTemplate = `
|
|
74
|
+
<cv-data-table
|
|
75
|
+
@search="onSearch"
|
|
76
|
+
@sort="onSort"
|
|
77
|
+
@row-select-change="onRowSelectChange"
|
|
78
|
+
@row-select-changes="onRowSelectChanges"
|
|
79
|
+
@overflow-menu-click="onOverflowMenuClick"
|
|
80
|
+
@row-expanded="onRowExpanded"
|
|
81
|
+
@pagination="onPagination"
|
|
82
|
+
v-bind="args"
|
|
83
|
+
>
|
|
84
|
+
<template v-if="useBatchActions" v-slot:batch-actions>
|
|
85
|
+
<cv-button :icon="trashIcon" @click="onDelete">Delete</cv-button>
|
|
86
|
+
</template>
|
|
87
|
+
<template v-if="useActions" v-slot:actions>
|
|
88
|
+
<cv-data-table-action @click="onAction1" aria-label="compile" alt="compile">
|
|
89
|
+
<compile-icon>
|
|
90
|
+
<title>Compile</title>
|
|
91
|
+
</compile-icon>
|
|
92
|
+
</cv-data-table-action>
|
|
93
|
+
<cv-data-table-action @click="onAction2" aria-label="debug" alt="debug">
|
|
94
|
+
<debug-icon>
|
|
95
|
+
<title>Debug</title>
|
|
96
|
+
</debug-icon>
|
|
97
|
+
</cv-data-table-action>
|
|
98
|
+
<cv-data-table-action @click="onAction3" aria-label="firmware" alt="firmware">
|
|
99
|
+
<embed-icon>
|
|
100
|
+
<title>Install Firmware</title>
|
|
101
|
+
</embed-icon>
|
|
102
|
+
</cv-data-table-action>
|
|
103
|
+
</template>
|
|
104
|
+
<template v-slot:headings>
|
|
105
|
+
<cv-data-table-heading heading="Name" name="name" sortable/>
|
|
106
|
+
<cv-data-table-heading heading="Year" name="year" sortable/>
|
|
107
|
+
<cv-data-table-heading heading="Object Oriented"/>
|
|
108
|
+
<cv-data-table-heading heading="Purpose" />
|
|
109
|
+
<cv-data-table-heading heading="Standard" />
|
|
110
|
+
</template>
|
|
111
|
+
<template v-slot:data>
|
|
112
|
+
<cv-data-table-row v-for="row in testData" :key="row.name" :value="row.name">
|
|
113
|
+
<cv-data-table-cell>{{row.name}}</cv-data-table-cell>
|
|
114
|
+
<cv-data-table-cell>{{row.year}}</cv-data-table-cell>
|
|
115
|
+
<cv-data-table-cell>{{row.oo}}</cv-data-table-cell>
|
|
116
|
+
<cv-data-table-cell>{{row.purpose}}</cv-data-table-cell>
|
|
117
|
+
<cv-data-table-cell>{{row.standard}}</cv-data-table-cell>
|
|
118
|
+
<!-- Add optional expanding data here -->
|
|
119
|
+
</cv-data-table-row>
|
|
120
|
+
</template>
|
|
121
|
+
</cv-data-table>
|
|
122
|
+
`;
|
|
123
|
+
const expandingRowsTemplate = defaultTemplate.replace(
|
|
124
|
+
"<!-- Add optional expanding data here -->",
|
|
125
|
+
`<template v-slot:expandedContent>{{row.desc}}</template>`)
|
|
126
|
+
.replace('@search="onSearch"', '')
|
|
127
|
+
const skeletonTemplate = `
|
|
128
|
+
<cv-data-table-skeleton
|
|
129
|
+
:columns="skeletonCols"
|
|
130
|
+
:rows="skeletonRows"
|
|
131
|
+
:title="skeletonTitle"
|
|
132
|
+
:helperText="skeletonHelper">
|
|
133
|
+
</cv-data-table-skeleton>
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
# CvDataTable
|
|
137
|
+
|
|
138
|
+
**Usage:**
|
|
139
|
+
- Sorting, filtering and pagination are the responsibility of the component user. This component raises events to facilitate this.
|
|
140
|
+
- The search bar appears only if the search event is listened for.
|
|
141
|
+
|
|
142
|
+
**Row attributes:**
|
|
143
|
+
- aria-label-for-batch-checkbox: Aria label for batch checkbox. default 'Select row N for batch action'.
|
|
144
|
+
- aria-label-expand-row: Aria label for expanding row expansion button. default: 'Expand current row'
|
|
145
|
+
- aria-label-collapse-row: Aria label for expanding row collapse button. default: 'Collapse current row'
|
|
146
|
+
- expanded: initial state of the expanded row
|
|
147
|
+
|
|
148
|
+
**Migration notes:**
|
|
149
|
+
|
|
150
|
+
- Default batch cancel label changed from "cancel" to "Cancel"
|
|
151
|
+
- The sort event now returns an additional value "name" for example
|
|
152
|
+
`{index: "1", order: "ascending", name: "year"}`. You can set the name value as a property on the
|
|
153
|
+
`cv-data-table-heading` element
|
|
154
|
+
- The `search` emit is not defined on the component and so your IDE likely will not suggest a type-ahead
|
|
155
|
+
completion for it. See [discussion](https://github.com/vuejs/core/issues/3432) for the reason for this. The
|
|
156
|
+
`search` emit is still emitted it is just not defined directly on the component.
|
|
157
|
+
- The React does not seem to have an "autoWidth" property. It is still supported here but likely the better choice is `staticWidth`.
|
|
158
|
+
- Row sizes in the React component are 'xs', 'sm', 'md', 'lg', & 'xl'. The rowSizes from Vue2 are still supported.
|
|
159
|
+
- The Vue 3 implementation uses an internal store to manage the state of the table. You can see updates
|
|
160
|
+
to the state by setting the debug variable in the local storage. `localStorage.debug="cv:data-table-store"`
|
|
161
|
+
and then reloading the page.
|
|
162
|
+
|
|
163
|
+
<Canvas>
|
|
164
|
+
<Story
|
|
165
|
+
name="Default"
|
|
166
|
+
parameters={{
|
|
167
|
+
controls: { exclude: ['default',
|
|
168
|
+
'template',
|
|
169
|
+
'overflow-menu-click',
|
|
170
|
+
'pagination',
|
|
171
|
+
'row-expanded',
|
|
172
|
+
'row-select-change',
|
|
173
|
+
'row-select-changes',
|
|
174
|
+
'search',
|
|
175
|
+
'sort',
|
|
176
|
+
'actions',
|
|
177
|
+
'batch-actions',
|
|
178
|
+
'data',
|
|
179
|
+
'headings',
|
|
180
|
+
'helper-text',
|
|
181
|
+
'items-selected',
|
|
182
|
+
'of-n-pages',
|
|
183
|
+
'range-text',
|
|
184
|
+
'skeleton'
|
|
185
|
+
] },
|
|
186
|
+
docs: { source: { code: defaultTemplate.replace('v-bind="args"', '') } },
|
|
187
|
+
}}
|
|
188
|
+
args={{
|
|
189
|
+
template: defaultTemplate,
|
|
190
|
+
title: 'Table title: Programming Languages',
|
|
191
|
+
helperText: 'Table helper text',
|
|
192
|
+
useActions: false,
|
|
193
|
+
useBatchActions: false,
|
|
194
|
+
}}
|
|
195
|
+
argTypes={{
|
|
196
|
+
rowSize: { control: 'select', default: 'lg', options: ['xs', 'sm', 'md', 'lg', 'xl'] },
|
|
197
|
+
rowsSelected: { control: 'multi-select', options: ['Java', 'COBOL', 'C++'] },
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
{Template.bind({})}
|
|
201
|
+
</Story>
|
|
202
|
+
</Canvas>
|
|
203
|
+
|
|
204
|
+
<Canvas>
|
|
205
|
+
<Story
|
|
206
|
+
name="Expanding rows"
|
|
207
|
+
parameters={{
|
|
208
|
+
controls: { exclude: ['default',
|
|
209
|
+
'template',
|
|
210
|
+
'overflow-menu-click',
|
|
211
|
+
'pagination',
|
|
212
|
+
'row-expanded',
|
|
213
|
+
'row-select-change',
|
|
214
|
+
'row-select-changes',
|
|
215
|
+
'search',
|
|
216
|
+
'sort',
|
|
217
|
+
'actions',
|
|
218
|
+
'batch-actions',
|
|
219
|
+
'data',
|
|
220
|
+
'headings',
|
|
221
|
+
'helper-text',
|
|
222
|
+
'items-selected',
|
|
223
|
+
'of-n-pages',
|
|
224
|
+
'range-text',
|
|
225
|
+
'skeleton',
|
|
226
|
+
] },
|
|
227
|
+
docs: { source: { code: expandingRowsTemplate.replace('v-bind="args"', '') } },
|
|
228
|
+
}}
|
|
229
|
+
args={{
|
|
230
|
+
template: expandingRowsTemplate,
|
|
231
|
+
title: 'Table with expanding rows',
|
|
232
|
+
helperText: 'Click row to expand',
|
|
233
|
+
useActions: false,
|
|
234
|
+
useBatchActions: false,
|
|
235
|
+
}}
|
|
236
|
+
argTypes={{
|
|
237
|
+
rowSize: { control: 'select', default: 'standard', options: ['compact', 'short', 'standard', 'tall'] },
|
|
238
|
+
rowsSelected: { control: 'multi-select', options: ['Java', 'COBOL', 'C++'] },
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
{Template.bind({})}
|
|
242
|
+
</Story>
|
|
243
|
+
</Canvas>
|
|
244
|
+
|
|
245
|
+
# CvDataTableSkeleton
|
|
246
|
+
|
|
247
|
+
<Canvas>
|
|
248
|
+
<Story
|
|
249
|
+
name="Skeleton"
|
|
250
|
+
parameters={{
|
|
251
|
+
controls: { exclude: [
|
|
252
|
+
'template',
|
|
253
|
+
'actionBarAriaLabel',
|
|
254
|
+
'autoWidth',
|
|
255
|
+
'batchCancelLabel',
|
|
256
|
+
'borderless',
|
|
257
|
+
'collapseAllAriaLabel',
|
|
258
|
+
'expandAllAriaLabel',
|
|
259
|
+
'expandingSearch',
|
|
260
|
+
'hasExpandAll',
|
|
261
|
+
'initialSearchValue',
|
|
262
|
+
'overflowMenu',
|
|
263
|
+
'rowSize',
|
|
264
|
+
'rowsSelected',
|
|
265
|
+
'searchClearLabel',
|
|
266
|
+
'searchLabel',
|
|
267
|
+
'searchPlaceholder',
|
|
268
|
+
'selectAllAriaLabel',
|
|
269
|
+
'skeleton',
|
|
270
|
+
'sortable',
|
|
271
|
+
'staticWidth',
|
|
272
|
+
'stickyHeader',
|
|
273
|
+
'zebra',
|
|
274
|
+
'overflow-menu-click',
|
|
275
|
+
'pagination',
|
|
276
|
+
'row-expanded',
|
|
277
|
+
'actions',
|
|
278
|
+
'batch-actions',
|
|
279
|
+
'data',
|
|
280
|
+
'headings',
|
|
281
|
+
'row-select-change',
|
|
282
|
+
'row-select-changes',
|
|
283
|
+
'sort',
|
|
284
|
+
'helper-text',
|
|
285
|
+
'items-selected',
|
|
286
|
+
'of-n-pages',
|
|
287
|
+
'range-text',
|
|
288
|
+
'columns'
|
|
289
|
+
] },
|
|
290
|
+
docs: { source: { code: skeletonTemplate.replace('v-bind="args"', '') } },
|
|
291
|
+
}}
|
|
292
|
+
args={{
|
|
293
|
+
template: skeletonTemplate,
|
|
294
|
+
title: 'Table title',
|
|
295
|
+
helperText: 'Data has been requested...',
|
|
296
|
+
skeletonRows: 5,
|
|
297
|
+
skeletonCols: 5,
|
|
298
|
+
}}
|
|
299
|
+
argTypes={{
|
|
300
|
+
}}
|
|
301
|
+
>
|
|
302
|
+
{Template.bind({})}
|
|
303
|
+
</Story>
|
|
304
|
+
</Canvas>
|