@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,340 @@
|
|
|
1
|
+
import { reactive, unref } from 'vue';
|
|
2
|
+
let loggerEnabled = false;
|
|
3
|
+
try {
|
|
4
|
+
loggerEnabled = localStorage
|
|
5
|
+
?.getItem('debug')
|
|
6
|
+
?.split(' ')
|
|
7
|
+
.includes('cv:data-table-store');
|
|
8
|
+
} catch (e) {
|
|
9
|
+
// ignore
|
|
10
|
+
}
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
const logger = loggerEnabled ? console.debug : () => {};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {string|ComputedRef<string>|Ref<string>} CvTableDataString
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Row Data
|
|
20
|
+
* @typedef {Object} CvRowData
|
|
21
|
+
* @property {CvTableDataString} id - row id
|
|
22
|
+
* @property {string} value? - used to determine which rows are selected
|
|
23
|
+
* @property {boolean} expandable - True if the row can be expended via a click
|
|
24
|
+
* @property {boolean} isExpanded - True if the row is currently expanded
|
|
25
|
+
* @property {boolean} isChecked - True is the row is currently selected via the checkbox in the row
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Row update data
|
|
30
|
+
* @typedef {Object} CvRowDataChecked
|
|
31
|
+
* @property {CvTableDataString} id - heading id
|
|
32
|
+
* @property {boolean} isChecked - True is the row is currently selected via the checkbox in the row
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Row update data
|
|
37
|
+
* @typedef {Object} CvRowDataExpanded
|
|
38
|
+
* @property {CvTableDataString} id - heading id
|
|
39
|
+
* @property {boolean} isExpanded - True if the row is currently expanded
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Row update data
|
|
44
|
+
* @typedef {Object} CvRowDataExpandable
|
|
45
|
+
* @property {CvTableDataString} id - heading id
|
|
46
|
+
* @property {boolean} expandable - True if the row can be expended via a click
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {CvRowData|CvRowDataChecked|CvRowDataExpanded|CvRowDataExpandable} CvRowDataUpdate
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Heading data
|
|
55
|
+
* @typedef {Object} CvHeadingData
|
|
56
|
+
* @property {CvTableDataString} id - heading id
|
|
57
|
+
* @property {string} name? - name of the heading which can be used by sort
|
|
58
|
+
* @property {CvTableDataString} order - sort order for this heading
|
|
59
|
+
* @property {boolean} sortable - Is the heading sortable?
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Heading update data
|
|
64
|
+
* @typedef {Object} CvHeadingDataSortable
|
|
65
|
+
* @property {CvTableDataString} id - heading id
|
|
66
|
+
* @property {boolean} sortable - Is the heading sortable?
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Heading update data
|
|
71
|
+
* @typedef {Object} CvHeadingDataOrder
|
|
72
|
+
* @property {CvTableDataString} id - heading id
|
|
73
|
+
* @property {CvTableDataString} order - sort order for this heading
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @typedef {CvHeadingData|CvHeadingDataSortable|CvHeadingDataOrder} CvHeadingDataUpdate
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Table data
|
|
82
|
+
* @typedef {Object} CvTableData
|
|
83
|
+
* @property {Array<CvRowData>} rows - table row data
|
|
84
|
+
* @property {Array<CvHeadingData>} headings - table heading data
|
|
85
|
+
* @property {boolean} hasBatchActions - Batch actions are available
|
|
86
|
+
* @property {boolean} hasExpandable - At least some rows are expandable
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
export default reactive({
|
|
90
|
+
state: { global: { rows: [], headings: [] } },
|
|
91
|
+
/**
|
|
92
|
+
* Add a new table using the table's id
|
|
93
|
+
* @param {CvTableDataString} tableId
|
|
94
|
+
*/
|
|
95
|
+
addTable(tableId) {
|
|
96
|
+
const table = unref(tableId);
|
|
97
|
+
this.state[table] = {
|
|
98
|
+
rows: [],
|
|
99
|
+
headings: [],
|
|
100
|
+
hasBatchActions: false,
|
|
101
|
+
hasExpandable: false,
|
|
102
|
+
};
|
|
103
|
+
logger(`added table:${table}`);
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Remove a table using the table's id
|
|
107
|
+
* @param {CvTableDataString} tableId
|
|
108
|
+
*/
|
|
109
|
+
removeTable(tableId) {
|
|
110
|
+
const table = unref(tableId);
|
|
111
|
+
delete this.state[table];
|
|
112
|
+
logger(`added table:${table}`);
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Get data for a table
|
|
116
|
+
* @param {CvTableDataString} tableId
|
|
117
|
+
* @returns {CvTableData}
|
|
118
|
+
*/
|
|
119
|
+
getTable(tableId) {
|
|
120
|
+
const table = unref(tableId);
|
|
121
|
+
if (!this.state[table]) this.addTable(table);
|
|
122
|
+
return this.state[table];
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Does the table have batch actions
|
|
126
|
+
* @param {CvTableDataString} tableId
|
|
127
|
+
* @returns {boolean|undefined}
|
|
128
|
+
*/
|
|
129
|
+
hasBatchActions(tableId) {
|
|
130
|
+
const table = unref(tableId);
|
|
131
|
+
if (!this.state[table]) return;
|
|
132
|
+
const hasBatchActions = this.state[table]?.hasBatchActions;
|
|
133
|
+
logger(`get hasBatchActions:${table} result:${hasBatchActions}`);
|
|
134
|
+
return hasBatchActions;
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Set if the table has batch actions or not
|
|
138
|
+
* @param {CvTableDataString} tableId
|
|
139
|
+
* @param {boolean} val
|
|
140
|
+
*/
|
|
141
|
+
setBatchActions(tableId, val) {
|
|
142
|
+
const table = unref(tableId);
|
|
143
|
+
if (!this.state[table]) return;
|
|
144
|
+
if (this.state[table].hasBatchActions !== val) {
|
|
145
|
+
this.state[table].hasBatchActions = val;
|
|
146
|
+
logger(`setBatchActions:${table} payload:${val}`);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* Find a heading by table + heading id
|
|
151
|
+
* @param {CvTableDataString} tableId
|
|
152
|
+
* @param {CvTableDataString} headingId
|
|
153
|
+
* @returns {CvHeadingData|undefined}
|
|
154
|
+
*/
|
|
155
|
+
findHeading(tableId, headingId) {
|
|
156
|
+
const table = unref(tableId);
|
|
157
|
+
const id = unref(headingId);
|
|
158
|
+
|
|
159
|
+
const headings = this.headings(table);
|
|
160
|
+
return headings.find(heading => heading.id === id);
|
|
161
|
+
},
|
|
162
|
+
/**
|
|
163
|
+
* Get all headings for a table
|
|
164
|
+
* @param {CvTableDataString} tableId
|
|
165
|
+
* @returns {Array<CvHeadingData>}
|
|
166
|
+
*/
|
|
167
|
+
headings(tableId) {
|
|
168
|
+
const table = unref(tableId);
|
|
169
|
+
return this.state[table]?.headings || [];
|
|
170
|
+
},
|
|
171
|
+
/**
|
|
172
|
+
* Get all rows for a table
|
|
173
|
+
* @param {CvTableDataString} tableId
|
|
174
|
+
* @returns {Array<CvRowData>}
|
|
175
|
+
*/
|
|
176
|
+
rows(tableId) {
|
|
177
|
+
const table = unref(tableId);
|
|
178
|
+
return this.state[table]?.rows || [];
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Are any header sortable
|
|
182
|
+
* @param {CvTableDataString} tableId
|
|
183
|
+
* @returns {boolean}
|
|
184
|
+
*/
|
|
185
|
+
someSortableHeadings(tableId) {
|
|
186
|
+
const table = unref(tableId);
|
|
187
|
+
const headings = this.state[table]?.headings;
|
|
188
|
+
const some = headings?.some(column => column.sortable);
|
|
189
|
+
logger(`get someSortableHeadings:${table} result:${some}`);
|
|
190
|
+
return some;
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Update a heading
|
|
194
|
+
* @param {CvTableDataString} tableId
|
|
195
|
+
* @param {CvHeadingDataUpdate} update
|
|
196
|
+
*/
|
|
197
|
+
updateHeading(tableId, update) {
|
|
198
|
+
const table = unref(tableId);
|
|
199
|
+
|
|
200
|
+
if (!this.state[table]) return;
|
|
201
|
+
const headings = this.state[table].headings;
|
|
202
|
+
const index = headings.findIndex(heading => heading.id === update.id);
|
|
203
|
+
if (index === -1) {
|
|
204
|
+
headings.push(update);
|
|
205
|
+
logger(`update heading:${table} payload:${JSON.stringify(update)}`);
|
|
206
|
+
} else {
|
|
207
|
+
const current = headings[index];
|
|
208
|
+
const changes = { ...current, ...update };
|
|
209
|
+
const changed =
|
|
210
|
+
current.name !== changes.name ||
|
|
211
|
+
current.order !== changes.order ||
|
|
212
|
+
current.sortable !== changes.sortable;
|
|
213
|
+
if (changed) {
|
|
214
|
+
headings.splice(index, 1, changes);
|
|
215
|
+
logger(`update heading:${table} payload:${JSON.stringify(update)}`);
|
|
216
|
+
logger(
|
|
217
|
+
`update heading:${table} result:${JSON.stringify(headings[index])}`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* Remove a heading data object from the table
|
|
224
|
+
* @param {CvTableDataString} tableId
|
|
225
|
+
* @param {CvTableDataString} headingId
|
|
226
|
+
*/
|
|
227
|
+
removeHeading(tableId, headingId) {
|
|
228
|
+
const table = unref(tableId);
|
|
229
|
+
const id = unref(headingId);
|
|
230
|
+
logger(`remove heading:${table} payload:${id}`);
|
|
231
|
+
if (!this.state[table]) return;
|
|
232
|
+
const headings = this.state[table].headings;
|
|
233
|
+
const index = headings.findIndex(heading => heading.id === id);
|
|
234
|
+
if (index > -1) headings.splice(index, 1);
|
|
235
|
+
else logger(`remove heading:${table} payload:${id} - heading not found`);
|
|
236
|
+
},
|
|
237
|
+
/**
|
|
238
|
+
* Find a row for using the table & row ids
|
|
239
|
+
* @param {CvTableDataString} tableId
|
|
240
|
+
* @param {CvTableDataString} rowId
|
|
241
|
+
* @returns {CvRowData|undefined}
|
|
242
|
+
*/
|
|
243
|
+
findRow(tableId, rowId) {
|
|
244
|
+
const table = unref(tableId);
|
|
245
|
+
const id = unref(rowId);
|
|
246
|
+
if (!this.state[table]) return undefined;
|
|
247
|
+
return this.state[table].rows.find(row => row.id === id);
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* Is the given row expanded
|
|
251
|
+
* @param {CvTableDataString} tableId
|
|
252
|
+
* @param {CvTableDataString} rowId
|
|
253
|
+
* @returns {boolean}
|
|
254
|
+
*/
|
|
255
|
+
isRowExpanded(tableId, rowId) {
|
|
256
|
+
const row = this.findRow(tableId, rowId);
|
|
257
|
+
return row?.isExpanded;
|
|
258
|
+
},
|
|
259
|
+
/**
|
|
260
|
+
* Set if any rows are expandable
|
|
261
|
+
* @param {CvTableDataString} tableId
|
|
262
|
+
*/
|
|
263
|
+
setSomeExpandingRows(tableId) {
|
|
264
|
+
const table = unref(tableId);
|
|
265
|
+
if (!this.state[table]) return;
|
|
266
|
+
const rows = this.state[table].rows;
|
|
267
|
+
const some = rows?.some(item => item.expandable);
|
|
268
|
+
logger(`set someExpandingRows:${table} result:${some}`);
|
|
269
|
+
this.state[table].hasExpandable = some;
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* Are any rows expandable in the given table
|
|
273
|
+
* @param {CvTableDataString} tableId
|
|
274
|
+
* @returns {boolean}
|
|
275
|
+
*/
|
|
276
|
+
someExpandingRows(tableId) {
|
|
277
|
+
const table = unref(tableId);
|
|
278
|
+
if (!table) return false;
|
|
279
|
+
const some = this.state[table]?.hasExpandable;
|
|
280
|
+
logger(`get someExpandingRows:${table} result:${some}`);
|
|
281
|
+
return some;
|
|
282
|
+
},
|
|
283
|
+
/**
|
|
284
|
+
* Are all the table rows expanded
|
|
285
|
+
* @param {CvTableDataString} tableId
|
|
286
|
+
* @returns {boolean}
|
|
287
|
+
*/
|
|
288
|
+
allExpandedRows(tableId) {
|
|
289
|
+
const table = unref(tableId);
|
|
290
|
+
if (!table) return false;
|
|
291
|
+
const rows = this.state[table].rows;
|
|
292
|
+
const every = rows?.every(item => item.isExpanded);
|
|
293
|
+
logger(`get allExpandedRows:${table} result:${every}`);
|
|
294
|
+
return every;
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* Add or update a row in the table
|
|
298
|
+
* @param {CvTableDataString} tableId
|
|
299
|
+
* @param {CvRowDataUpdate} update
|
|
300
|
+
*/
|
|
301
|
+
updateRow(tableId, update) {
|
|
302
|
+
const table = unref(tableId);
|
|
303
|
+
|
|
304
|
+
if (!this.state[table]) return;
|
|
305
|
+
const rows = this.state[table].rows;
|
|
306
|
+
const index = rows.findIndex(row => row.id === update.id);
|
|
307
|
+
if (index === -1) {
|
|
308
|
+
rows.push(update);
|
|
309
|
+
logger(`update row:${table} payload:${JSON.stringify(update)}`);
|
|
310
|
+
} else {
|
|
311
|
+
const current = rows[index];
|
|
312
|
+
const changes = { ...current, ...update };
|
|
313
|
+
const changed =
|
|
314
|
+
current.value !== changes.value ||
|
|
315
|
+
current.expandable !== changes.expandable ||
|
|
316
|
+
current.isExpanded !== changes.isExpanded ||
|
|
317
|
+
current.isChecked !== changes.isChecked;
|
|
318
|
+
if (changed) {
|
|
319
|
+
rows.splice(index, 1, changes);
|
|
320
|
+
logger(`update row:${table} payload:${JSON.stringify(update)}`);
|
|
321
|
+
logger(`update row:${table} result:${JSON.stringify(rows[index])}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
/**
|
|
326
|
+
* Remove a row from the table
|
|
327
|
+
* @param {CvTableDataString} tableId
|
|
328
|
+
* @param {CvTableDataString} rowId
|
|
329
|
+
*/
|
|
330
|
+
removeRow(tableId, rowId) {
|
|
331
|
+
const table = unref(tableId);
|
|
332
|
+
const id = unref(rowId);
|
|
333
|
+
logger(`remove row:${table} payload:${id}`);
|
|
334
|
+
if (!this.state[table]) return;
|
|
335
|
+
const rows = this.state[table].rows;
|
|
336
|
+
const index = rows.findIndex(row => row.id === id);
|
|
337
|
+
if (index > -1) rows.splice(index, 1);
|
|
338
|
+
else logger(`remove row:${table} payload:${id} - row not found`);
|
|
339
|
+
},
|
|
340
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- Use this as the "nothing" instead of CvWrapper when you need a a dom/component or nothing
|
|
2
|
+
Example:
|
|
3
|
+
Instead of
|
|
4
|
+
<cv-wrapper :tag-type="something ? 'span' : ''">
|
|
5
|
+
<h1>Hello</h1>
|
|
6
|
+
</cv-wrapper>
|
|
7
|
+
|
|
8
|
+
Which will produce either the h1 element wrapped in a span or unwrapped.
|
|
9
|
+
<span>
|
|
10
|
+
<h1>Hello</h1>
|
|
11
|
+
</span>
|
|
12
|
+
or just
|
|
13
|
+
<h1>Hello</h1>
|
|
14
|
+
|
|
15
|
+
Instead of that use the built-in component tag like this:
|
|
16
|
+
<component :is="something ? 'span' : CvEmpty">
|
|
17
|
+
<h1>Hello</h1>
|
|
18
|
+
</component>
|
|
19
|
+
-->
|
|
20
|
+
<template>
|
|
21
|
+
<slot v-bind="$attrs"></slot>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cv-column" :class="classes">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { carbonPrefix } from '../../global/settings';
|
|
9
|
+
import { computed } from 'vue';
|
|
10
|
+
import { columnValidator } from './_cvColumnValidation';
|
|
11
|
+
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
sm: {
|
|
14
|
+
type: [Boolean, Number, Object],
|
|
15
|
+
validator: value => columnValidator('sm', value),
|
|
16
|
+
},
|
|
17
|
+
md: {
|
|
18
|
+
type: [Boolean, Number, Object],
|
|
19
|
+
validator: value => columnValidator('md', value),
|
|
20
|
+
},
|
|
21
|
+
lg: {
|
|
22
|
+
type: [Boolean, Number, Object],
|
|
23
|
+
validator: value => columnValidator('lg', value),
|
|
24
|
+
},
|
|
25
|
+
xlg: {
|
|
26
|
+
type: [Boolean, Number, Object],
|
|
27
|
+
validator: value => columnValidator('xlg', value),
|
|
28
|
+
},
|
|
29
|
+
max: {
|
|
30
|
+
type: [Boolean, Number, Object],
|
|
31
|
+
validator: value => columnValidator('max', value),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const classes = computed(() => {
|
|
35
|
+
const classnames = [];
|
|
36
|
+
|
|
37
|
+
const breakpoints = [
|
|
38
|
+
{ name: 'sm', value: props.sm },
|
|
39
|
+
{ name: 'md', value: props.md },
|
|
40
|
+
{ name: 'lg', value: props.lg },
|
|
41
|
+
{ name: 'xlg', value: props.xlg },
|
|
42
|
+
{ name: 'max', value: props.max },
|
|
43
|
+
].filter(breakpoint => breakpoint.value !== false);
|
|
44
|
+
|
|
45
|
+
for (let i = 0; i < breakpoints.length; i += 1) {
|
|
46
|
+
const { name, value } = breakpoints[i];
|
|
47
|
+
|
|
48
|
+
if (typeof value === 'boolean') {
|
|
49
|
+
// auto-column
|
|
50
|
+
classnames.push(`${carbonPrefix}--col-${name}`);
|
|
51
|
+
} else if (typeof value === 'number') {
|
|
52
|
+
classnames.push(`${carbonPrefix}--col-${name}-${value}`);
|
|
53
|
+
} else {
|
|
54
|
+
const { span, offset, start, end } = value;
|
|
55
|
+
|
|
56
|
+
if (typeof span === 'boolean') {
|
|
57
|
+
classnames.push(`${carbonPrefix}--col-${name}`);
|
|
58
|
+
} else if (typeof span === 'number') {
|
|
59
|
+
classnames.push(`${carbonPrefix}--col-${name}-${span}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (typeof offset === 'number') {
|
|
63
|
+
classnames.push(`${carbonPrefix}--offset-${name}-${offset}`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Carbon 11
|
|
67
|
+
if (typeof start === 'number') {
|
|
68
|
+
classnames.push(`${carbonPrefix}--${name}:col-start-${start}`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Carbon 11
|
|
72
|
+
if (typeof end === 'number') {
|
|
73
|
+
classnames.push(`${carbonPrefix}--${name}:col-end-${end}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (classnames.length === 0) {
|
|
79
|
+
// no breakpoints were defined. use auto-column
|
|
80
|
+
classnames.push(`${carbonPrefix}--col`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return classnames;
|
|
84
|
+
});
|
|
85
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="cv-grid"
|
|
4
|
+
:class="[
|
|
5
|
+
`${carbonPrefix}--grid`,
|
|
6
|
+
{
|
|
7
|
+
[`${carbonPrefix}--grid--full-width`]: fullWidth,
|
|
8
|
+
[`${carbonPrefix}--grid--condensed`]: kind === 'condensed',
|
|
9
|
+
[`${carbonPrefix}--grid--narrow`]: kind === 'narrow',
|
|
10
|
+
[`${carbonPrefix}--subgrid`]: subgrid,
|
|
11
|
+
},
|
|
12
|
+
]"
|
|
13
|
+
>
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { carbonPrefix } from '../../global/settings';
|
|
20
|
+
import { inject, provide } from 'vue';
|
|
21
|
+
|
|
22
|
+
defineProps({
|
|
23
|
+
/**
|
|
24
|
+
* Remove the default max width that the grid has set
|
|
25
|
+
*/
|
|
26
|
+
fullWidth: Boolean,
|
|
27
|
+
/**
|
|
28
|
+
* - wide - default
|
|
29
|
+
* - condensed - Collapse the gutter to 1px. Useful for fluid layouts. Rows have 1px of margin between them to match gutter.
|
|
30
|
+
* - narrow - Container hangs 16px into the gutter. Useful for typographic alignment with and without containers.
|
|
31
|
+
*/
|
|
32
|
+
kind: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'wide',
|
|
35
|
+
validator: val => ['wide', 'narrow', 'condensed'].includes(val),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Carbon 11 - a bit of a head start on Carbon 11 support
|
|
40
|
+
const subgrid = inject('cv-parent-grid', false);
|
|
41
|
+
if (!subgrid) provide('cv-parent-grid', true);
|
|
42
|
+
</script>
|
|
@@ -13,18 +13,14 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
-
<script>
|
|
17
|
-
import
|
|
16
|
+
<script setup>
|
|
17
|
+
import { carbonPrefix } from '../../global/settings';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type: String,
|
|
25
|
-
default: 'wide',
|
|
26
|
-
validator: val => ['wide', 'narrow', 'condensed'].includes(val),
|
|
27
|
-
},
|
|
19
|
+
defineProps({
|
|
20
|
+
kind: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'wide',
|
|
23
|
+
validator: val => ['wide', 'narrow', 'condensed'].includes(val),
|
|
28
24
|
},
|
|
29
|
-
};
|
|
25
|
+
});
|
|
30
26
|
</script>
|