carbon-addons-iot-react 2.70.0 → 2.72.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/css/carbon-addons-iot-react.css +43 -10
- package/css/carbon-addons-iot-react.css.map +1 -1
- package/es/node_modules/carbon-components-react/es/components/UIShell/Content.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/Header.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderMenuButton.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderName.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderNavigation.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/HeaderSideNavItems.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNav.js +3 -3
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavDetails.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavFooter.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavHeader.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavIcon.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavItem.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavItems.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavLink.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavLinkText.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavMenuItem.js +3 -3
- package/es/node_modules/carbon-components-react/es/components/UIShell/SideNavSwitcher.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SkipToContent.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/Switcher.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SwitcherDivider.js +2 -2
- package/es/node_modules/carbon-components-react/es/components/UIShell/SwitcherItem.js +3 -3
- package/es/node_modules/carbon-components-react/es/tools/wrapComponent.js +2 -2
- package/es/src/components/Accordion/AccordionItemDefer.jsx +52 -0
- package/es/src/components/AddCard/AddCard.jsx +2 -2
- package/es/src/components/BarChartCard/BarChartCard.jsx +2 -2
- package/es/src/components/Breadcrumb/Breadcrumb.jsx +5 -5
- package/es/src/components/Button/Button.jsx +2 -2
- package/es/src/components/Card/Card.jsx +5 -5
- package/es/src/components/Card/CardRangePicker.jsx +3 -3
- package/es/src/components/Card/CardToolbar.jsx +4 -4
- package/es/src/components/Card/DataStateRenderer.jsx +3 -3
- package/es/src/components/ComposedModal/ComposedModal.jsx +3 -3
- package/es/src/components/ComposedStructuredList/ComposedStructuredList.jsx +1 -1
- package/es/src/components/Dashboard/CardRenderer.jsx +1 -1
- package/es/src/components/Dashboard/Dashboard.jsx +1 -1
- package/es/src/components/Dashboard/DashboardGrid.jsx +1 -1
- package/es/src/components/DateTimePicker/DateTimePicker.jsx +5 -5
- package/es/src/components/GaugeCard/GaugeCard.jsx +17 -20
- package/es/src/components/Header/HeaderAction/HeaderAction.jsx +1 -1
- package/es/src/components/Header/HeaderAction/HeaderActionMenu.jsx +3 -3
- package/es/src/components/Header/HeaderAction/HeaderActionPanel.jsx +3 -3
- package/es/src/components/Hero/Hero.jsx +1 -1
- package/es/src/components/IconSwitch/IconSwitch.jsx +2 -2
- package/es/src/components/ImageCard/CardIcon.jsx +1 -1
- package/es/src/components/ImageCard/ImageHotspots.jsx +1 -1
- package/es/src/components/List/HierarchyList/HierarchyList.jsx +1 -1
- package/es/src/components/List/List.jsx +3 -3
- package/es/src/components/List/ListItem/ListItem.jsx +7 -7
- package/es/src/components/List/SimpleList/SimpleList.jsx +1 -1
- package/es/src/components/ListCard/ListCard.jsx +2 -2
- package/es/src/components/Page/EditPage.jsx +2 -2
- package/es/src/components/PageTitleBar/PageTitleBar.jsx +3 -3
- package/es/src/components/PageWizard/PageWizard.jsx +2 -2
- package/es/src/components/PageWizard/StatefulPageWizard.jsx +1 -1
- package/es/src/components/ProgressIndicator/ProgressIndicator.jsx +2 -2
- package/es/src/components/SideNav/SideNav.jsx +2 -2
- package/es/src/components/Table/Pagination.jsx +2 -2
- package/es/src/components/Table/StatefulTable.jsx +1 -1
- package/es/src/components/Table/Table.jsx +4 -4
- package/es/src/components/Table/TableBody/RowActionsCell/RowActionsCell.jsx +7 -14
- package/es/src/components/Table/TableBody/TableBodyRow/TableBodyRow.jsx +4 -4
- package/es/src/components/Table/TableCellRenderer/TableCellRenderer.jsx +2 -2
- package/es/src/components/Table/TableHead/ColumnHeaderRow/ColumnHeaderRow.jsx +1 -1
- package/es/src/components/Table/TableHead/ColumnHeaderSelect/ColumnHeaderSelect.jsx +2 -2
- package/es/src/components/Table/TableHead/ColumnResize.jsx +2 -2
- package/es/src/components/Table/TableHead/TableHead.jsx +6 -6
- package/es/src/components/Table/TableHead/TableHeader.js +3 -3
- package/es/src/components/Table/TableToolbar/TableToolbar.jsx +3 -3
- package/es/src/components/Table/TableToolbarSearch/TableToolbarSearch.jsx +3 -3
- package/es/src/components/Table/baseTableReducer.js +1 -1
- package/es/src/components/Table/tableReducer.js +1 -1
- package/es/src/components/TileCatalog/StatefulTileCatalog.jsx +1 -1
- package/es/src/components/TileCatalog/TileCatalog.jsx +2 -2
- package/es/src/components/TileCatalog/TileGroup.jsx +2 -2
- package/es/src/components/TileCatalogNew/TileCatalogNew.jsx +1 -1
- package/es/src/components/TileCatalogNew/TilePagination/TilePagination.jsx +5 -5
- package/es/src/components/TileGallery/StatefulTileGallery.jsx +1 -1
- package/es/src/components/TimePickerSpinner/TimePickerSpinner.jsx +4 -4
- package/es/src/components/ValueCard/Attribute.jsx +4 -4
- package/es/src/components/ValueCard/UnitRenderer.jsx +2 -2
- package/es/src/components/ValueCard/ValueRenderer.jsx +2 -2
- package/es/src/components/WizardInline/StatefulWizardInline.jsx +1 -1
- package/es/src/components/WizardInline/WizardHeader/WizardHeader.jsx +1 -1
- package/es/src/components/WizardModal/WizardModal.jsx +2 -2
- package/es/src/index.js +4 -5
- package/es/src/internal/deprecate.js +1 -1
- package/es/src/utils/cardUtilityFunctions.js +1 -1
- package/lib/css/carbon-addons-iot-react.css +43 -10
- package/lib/css/carbon-addons-iot-react.css.map +1 -1
- package/lib/node_modules/@carbon/charts-react/bar-chart-grouped.js +2 -2
- package/lib/node_modules/@carbon/charts-react/bar-chart-simple.js +2 -2
- package/lib/node_modules/@carbon/charts-react/bar-chart-stacked.js +2 -2
- package/lib/node_modules/@carbon/charts-react/line-chart.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/Content.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/Header.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderGlobalAction.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderMenu.js +8 -8
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderMenuButton.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderMenuItem.js +3 -3
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderName.js +5 -5
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderNavigation.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderPanel.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/HeaderSideNavItems.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNav.js +5 -5
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavDetails.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavFooter.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavHeader.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavIcon.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavItem.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavItems.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavLink.js +11 -11
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavLinkText.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavMenu.js +8 -8
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavMenuItem.js +7 -7
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SideNavSwitcher.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SkipToContent.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/Switcher.js +4 -4
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SwitcherDivider.js +2 -2
- package/lib/node_modules/carbon-components-react/es/components/UIShell/SwitcherItem.js +7 -7
- package/lib/node_modules/carbon-components-react/es/prop-types/AriaPropTypes.js +2 -2
- package/lib/node_modules/carbon-components-react/es/tools/wrapComponent.js +2 -2
- package/lib/scss/components/GaugeCard/_gauge-card.scss +33 -6
- package/lib/scss/components/Table/TableBody/RowActionsCell/_row-actions-cell.scss +25 -2
- package/lib/scss/components/TextInput/_text-input.scss +4 -0
- package/lib/src/components/Accordion/AccordionItemDefer.jsx +57 -0
- package/lib/src/components/AddCard/AddCard.jsx +2 -2
- package/lib/src/components/BarChartCard/BarChartCard.jsx +22 -22
- package/lib/src/components/Breadcrumb/Breadcrumb.jsx +7 -7
- package/lib/src/components/Button/Button.jsx +4 -4
- package/lib/src/components/Card/Card.jsx +32 -32
- package/lib/src/components/Card/CardRangePicker.jsx +5 -5
- package/lib/src/components/Card/CardToolbar.jsx +13 -13
- package/lib/src/components/Card/DataStateRenderer.jsx +14 -14
- package/lib/src/components/ComposedModal/ComposedModal.jsx +10 -10
- package/lib/src/components/ComposedStructuredList/ComposedStructuredList.jsx +5 -5
- package/lib/src/components/Dashboard/CardRenderer.jsx +23 -23
- package/lib/src/components/Dashboard/Dashboard.jsx +8 -8
- package/lib/src/components/Dashboard/DashboardGrid.jsx +22 -22
- package/lib/src/components/Dashboard/DashboardHeader.jsx +5 -5
- package/lib/src/components/DateTimePicker/DateTimePicker.jsx +9 -9
- package/lib/src/components/FileDrop/FileDrop.jsx +2 -2
- package/lib/src/components/GaugeCard/GaugeCard.jsx +26 -29
- package/lib/src/components/Header/Header.jsx +12 -12
- package/lib/src/components/Header/HeaderAction/HeaderAction.jsx +11 -11
- package/lib/src/components/Header/HeaderAction/HeaderActionMenu.jsx +9 -9
- package/lib/src/components/Header/HeaderAction/HeaderActionPanel.jsx +10 -10
- package/lib/src/components/Header/HeaderActionGroup.jsx +6 -6
- package/lib/src/components/Hero/Hero.jsx +3 -3
- package/lib/src/components/IconSwitch/IconSwitch.jsx +2 -2
- package/lib/src/components/ImageCard/CardIcon.jsx +5 -5
- package/lib/src/components/ImageCard/Hotspot.jsx +2 -2
- package/lib/src/components/ImageCard/ImageCard.jsx +12 -12
- package/lib/src/components/ImageCard/ImageControls.jsx +3 -3
- package/lib/src/components/ImageCard/ImageHotspots.jsx +6 -6
- package/lib/src/components/List/HierarchyList/HierarchyList.jsx +6 -6
- package/lib/src/components/List/HierarchyList/index.js +2 -2
- package/lib/src/components/List/List.jsx +10 -10
- package/lib/src/components/List/ListItem/ListItem.jsx +7 -7
- package/lib/src/components/List/SimpleList/SimpleList.jsx +3 -3
- package/lib/src/components/ListCard/ListCard.jsx +9 -9
- package/lib/src/components/NavigationBar/NavigationBar.jsx +5 -5
- package/lib/src/components/Page/EditPage.jsx +9 -9
- package/lib/src/components/Page/PageHero.jsx +9 -9
- package/lib/src/components/Page/PageTitle.jsx +2 -2
- package/lib/src/components/PageTitleBar/PageTitleBar.jsx +8 -8
- package/lib/src/components/PageWizard/PageWizard.jsx +2 -2
- package/lib/src/components/PageWizard/PageWizardStep/PageWizardStep.jsx +7 -7
- package/lib/src/components/PageWizard/PageWizardStep/PageWizardStepContent.jsx +2 -2
- package/lib/src/components/PageWizard/PageWizardStep/PageWizardStepDescription.jsx +2 -2
- package/lib/src/components/PageWizard/PageWizardStep/PageWizardStepExtraContent.jsx +2 -2
- package/lib/src/components/PageWizard/PageWizardStep/PageWizardStepTitle.jsx +2 -2
- package/lib/src/components/PageWizard/StatefulPageWizard.jsx +4 -4
- package/lib/src/components/ProgressIndicator/ProgressIndicator.jsx +2 -2
- package/lib/src/components/ResourceList/ResourceList.jsx +2 -2
- package/lib/src/components/SideNav/SideNav.jsx +12 -12
- package/lib/src/components/SimplePagination/SimplePagination.jsx +7 -7
- package/lib/src/components/Table/EmptyTable/EmptyTable.jsx +4 -4
- package/lib/src/components/Table/Pagination.jsx +2 -2
- package/lib/src/components/Table/StatefulTable.jsx +25 -25
- package/lib/src/components/Table/Table.jsx +38 -38
- package/lib/src/components/Table/TableBody/RowActionsCell/RowActionsCell.jsx +14 -21
- package/lib/src/components/Table/TableBody/RowActionsCell/RowActionsError.jsx +4 -4
- package/lib/src/components/Table/TableBody/TableBody.jsx +7 -7
- package/lib/src/components/Table/TableBody/TableBodyRow/TableBodyRow.jsx +24 -24
- package/lib/src/components/Table/TableCellRenderer/TableCellRenderer.jsx +2 -2
- package/lib/src/components/Table/TableHead/ColumnHeaderRow/ColumnHeaderRow.jsx +7 -7
- package/lib/src/components/Table/TableHead/ColumnHeaderSelect/ColumnHeaderSelect.jsx +4 -4
- package/lib/src/components/Table/TableHead/ColumnResize.jsx +6 -6
- package/lib/src/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.jsx +7 -7
- package/lib/src/components/Table/TableHead/TableHead.jsx +30 -30
- package/lib/src/components/Table/TableHead/TableHeader.js +3 -3
- package/lib/src/components/Table/TablePropTypes.js +2 -2
- package/lib/src/components/Table/TableSkeletonWithHeaders/TableSkeletonWithHeaders.jsx +2 -2
- package/lib/src/components/Table/TableToolbar/TableToolbar.jsx +17 -17
- package/lib/src/components/Table/TableToolbarSearch/TableToolbarSearch.jsx +3 -3
- package/lib/src/components/Table/baseTableReducer.js +18 -18
- package/lib/src/components/Table/tableReducer.js +34 -34
- package/lib/src/components/TableCard/TableCard.jsx +26 -26
- package/lib/src/components/TableCard/ThresholdIcon.jsx +2 -2
- package/lib/src/components/TileCatalog/StatefulTileCatalog.jsx +12 -12
- package/lib/src/components/TileCatalog/TileCatalog.jsx +8 -8
- package/lib/src/components/TileCatalog/TileGroup.jsx +2 -2
- package/lib/src/components/TileCatalog/tileCatalogReducer.js +3 -3
- package/lib/src/components/TileCatalogNew/TileCatalogNew.jsx +3 -3
- package/lib/src/components/TileCatalogNew/TilePagination/TilePagination.jsx +5 -5
- package/lib/src/components/TileGallery/StatefulTileGallery.jsx +17 -17
- package/lib/src/components/TileGallery/TileGallery.jsx +2 -2
- package/lib/src/components/TimePickerSpinner/TimePickerSpinner.jsx +12 -12
- package/lib/src/components/TimeSeriesCard/TimeSeriesCard.jsx +35 -35
- package/lib/src/components/ValueCard/Attribute.jsx +19 -19
- package/lib/src/components/ValueCard/UnitRenderer.jsx +4 -4
- package/lib/src/components/ValueCard/ValueCard.jsx +52 -52
- package/lib/src/components/ValueCard/ValueRenderer.jsx +12 -12
- package/lib/src/components/WizardInline/StatefulWizardInline.jsx +5 -5
- package/lib/src/components/WizardInline/WizardFooter/WizardFooter.jsx +5 -5
- package/lib/src/components/WizardInline/WizardHeader/WizardHeader.jsx +7 -7
- package/lib/src/components/WizardInline/WizardInline.jsx +14 -14
- package/lib/src/components/WizardModal/WizardModal.jsx +8 -8
- package/lib/src/constants/CardPropTypes.js +14 -14
- package/lib/src/index.js +144 -144
- package/lib/src/internal/deprecate.js +1 -1
- package/lib/src/utils/cardUtilityFunctions.js +10 -10
- package/lib/src/utils/componentUtilityFunctions.js +13 -13
- package/package.json +1 -1
- package/scss/components/GaugeCard/_gauge-card.scss +33 -6
- package/scss/components/Table/TableBody/RowActionsCell/_row-actions-cell.scss +25 -2
- package/scss/components/TextInput/_text-input.scss +4 -0
- package/umd/carbon-addons-iot-react.js +797 -1424
- package/es/node_modules/carbon-components-react/es/components/Accordion/Accordion.Skeleton.js +0 -96
- package/es/node_modules/carbon-components-react/es/components/Accordion/Accordion.js +0 -45
- package/es/node_modules/carbon-components-react/es/components/Accordion/AccordionItem.js +0 -163
- package/es/node_modules/carbon-components-react/es/components/SkeletonText/SkeletonText.js +0 -111
- package/es/node_modules/carbon-components-react/es/prop-types/deprecate.js +0 -30
- package/es/src/components/Accordion/AccordionItem.jsx +0 -180
- package/lib/node_modules/carbon-components-react/es/components/Accordion/Accordion.Skeleton.js +0 -101
- package/lib/node_modules/carbon-components-react/es/components/Accordion/Accordion.js +0 -50
- package/lib/node_modules/carbon-components-react/es/components/Accordion/AccordionItem.js +0 -168
- package/lib/node_modules/carbon-components-react/es/components/SkeletonText/SkeletonText.js +0 -116
- package/lib/node_modules/carbon-components-react/es/prop-types/deprecate.js +0 -34
- package/lib/src/components/Accordion/AccordionItem.jsx +0 -185
package/es/node_modules/carbon-components-react/es/components/Accordion/Accordion.Skeleton.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import { settings } from 'carbon-components';
|
|
5
|
-
import { ChevronRight16 } from '@carbon/icons-react';
|
|
6
|
-
import SkeletonText from '../SkeletonText/SkeletonText.js';
|
|
7
|
-
import deprecate from '../../prop-types/deprecate.js';
|
|
8
|
-
|
|
9
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
|
-
|
|
11
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
|
|
13
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
-
|
|
15
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
-
var prefix = settings.prefix;
|
|
17
|
-
|
|
18
|
-
function AccordionSkeleton(_ref) {
|
|
19
|
-
var align = _ref.align,
|
|
20
|
-
open = _ref.open,
|
|
21
|
-
count = _ref.count,
|
|
22
|
-
className = _ref.className,
|
|
23
|
-
rest = _objectWithoutProperties(_ref, ["align", "open", "count", "className"]);
|
|
24
|
-
|
|
25
|
-
var classes = cx("".concat(prefix, "--accordion"), "".concat(prefix, "--skeleton"), className, _defineProperty({}, "".concat(prefix, "--accordion--").concat(align), align));
|
|
26
|
-
var numSkeletonItems = open ? count - 1 : count;
|
|
27
|
-
return React.createElement("ul", _extends({
|
|
28
|
-
className: classes
|
|
29
|
-
}, rest), open && React.createElement("li", {
|
|
30
|
-
className: "".concat(prefix, "--accordion__item ").concat(prefix, "--accordion__item--active")
|
|
31
|
-
}, React.createElement("span", {
|
|
32
|
-
className: "".concat(prefix, "--accordion__heading")
|
|
33
|
-
}, React.createElement(ChevronRight16, {
|
|
34
|
-
className: "".concat(prefix, "--accordion__arrow")
|
|
35
|
-
}), React.createElement(SkeletonText, {
|
|
36
|
-
className: "".concat(prefix, "--accordion__title")
|
|
37
|
-
})), React.createElement("div", {
|
|
38
|
-
className: "".concat(prefix, "--accordion__content")
|
|
39
|
-
}, React.createElement(SkeletonText, {
|
|
40
|
-
width: "90%"
|
|
41
|
-
}), React.createElement(SkeletonText, {
|
|
42
|
-
width: "80%"
|
|
43
|
-
}), React.createElement(SkeletonText, {
|
|
44
|
-
width: "95%"
|
|
45
|
-
}))), Array.from({
|
|
46
|
-
length: numSkeletonItems
|
|
47
|
-
}).map(function (_, i) {
|
|
48
|
-
return React.createElement(AccordionSkeletonItem, {
|
|
49
|
-
key: i
|
|
50
|
-
});
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
AccordionSkeleton.propTypes = {
|
|
55
|
-
/**
|
|
56
|
-
* `false` to not display the first item opened
|
|
57
|
-
*/
|
|
58
|
-
open: PropTypes.bool,
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Set number of items to render
|
|
62
|
-
*/
|
|
63
|
-
count: PropTypes.number,
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Set unique identifier to generate unique item keys
|
|
67
|
-
*/
|
|
68
|
-
uid: deprecate(PropTypes.any),
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Specify an optional className to add.
|
|
72
|
-
*/
|
|
73
|
-
className: PropTypes.string,
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Specify the alignment of the accordion heading title and chevron.
|
|
77
|
-
*/
|
|
78
|
-
align: PropTypes.oneOf(['start', 'end'])
|
|
79
|
-
};
|
|
80
|
-
AccordionSkeleton.defaultProps = {
|
|
81
|
-
open: true,
|
|
82
|
-
count: 4,
|
|
83
|
-
align: 'end'
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
function AccordionSkeletonItem() {
|
|
87
|
-
return React.createElement("li", {
|
|
88
|
-
className: "".concat(prefix, "--accordion__item")
|
|
89
|
-
}, React.createElement("span", {
|
|
90
|
-
className: "".concat(prefix, "--accordion__heading")
|
|
91
|
-
}, React.createElement(ChevronRight16, {
|
|
92
|
-
className: "".concat(prefix, "--accordion__arrow")
|
|
93
|
-
}), React.createElement(SkeletonText, {
|
|
94
|
-
className: "".concat(prefix, "--accordion__title")
|
|
95
|
-
})));
|
|
96
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import { settings } from 'carbon-components';
|
|
5
|
-
|
|
6
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
|
-
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
|
|
10
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
-
|
|
12
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
|
-
var prefix = settings.prefix;
|
|
14
|
-
|
|
15
|
-
function Accordion(_ref) {
|
|
16
|
-
var align = _ref.align,
|
|
17
|
-
children = _ref.children,
|
|
18
|
-
customClassName = _ref.className,
|
|
19
|
-
rest = _objectWithoutProperties(_ref, ["align", "children", "className"]);
|
|
20
|
-
|
|
21
|
-
var className = cx("".concat(prefix, "--accordion"), customClassName, _defineProperty({}, "".concat(prefix, "--accordion--").concat(align), align));
|
|
22
|
-
return React.createElement("ul", _extends({
|
|
23
|
-
className: className
|
|
24
|
-
}, rest), children);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Accordion.defaultProps = {
|
|
28
|
-
align: 'end'
|
|
29
|
-
};
|
|
30
|
-
Accordion.propTypes = {
|
|
31
|
-
/**
|
|
32
|
-
* Pass in the children that will be rendered within the Accordion
|
|
33
|
-
*/
|
|
34
|
-
children: PropTypes.node,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Specify an optional className to be applied to the container node
|
|
38
|
-
*/
|
|
39
|
-
className: PropTypes.string,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Specify the alignment of the accordion heading title and chevron.
|
|
43
|
-
*/
|
|
44
|
-
align: PropTypes.oneOf(['start', 'end'])
|
|
45
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import { settings } from 'carbon-components';
|
|
5
|
-
import { ChevronRight16 } from '@carbon/icons-react';
|
|
6
|
-
import { Escape } from '../../internal/keyboard/keys.js';
|
|
7
|
-
import { match } from '../../internal/keyboard/match.js';
|
|
8
|
-
import '../../internal/keyboard/navigation.js';
|
|
9
|
-
|
|
10
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
-
|
|
12
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
15
|
-
|
|
16
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
17
|
-
|
|
18
|
-
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
19
|
-
|
|
20
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
|
|
22
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
-
|
|
24
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
-
var prefix = settings.prefix;
|
|
26
|
-
|
|
27
|
-
var defaultRenderExpando = function defaultRenderExpando(props) {
|
|
28
|
-
return React.createElement("button", props);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
function AccordionItem(_ref) {
|
|
32
|
-
var _cx;
|
|
33
|
-
|
|
34
|
-
var children = _ref.children,
|
|
35
|
-
customClassName = _ref.className,
|
|
36
|
-
_ref$iconDescription = _ref.iconDescription,
|
|
37
|
-
iconDescription = _ref$iconDescription === void 0 ? 'Expand/Collapse' : _ref$iconDescription,
|
|
38
|
-
_ref$open = _ref.open,
|
|
39
|
-
open = _ref$open === void 0 ? false : _ref$open,
|
|
40
|
-
onHeadingClick = _ref.onHeadingClick,
|
|
41
|
-
_ref$renderExpando = _ref.renderExpando,
|
|
42
|
-
Expando = _ref$renderExpando === void 0 ? defaultRenderExpando : _ref$renderExpando,
|
|
43
|
-
_ref$title = _ref.title,
|
|
44
|
-
title = _ref$title === void 0 ? 'title' : _ref$title,
|
|
45
|
-
rest = _objectWithoutProperties(_ref, ["children", "className", "iconDescription", "open", "onHeadingClick", "renderExpando", "title"]);
|
|
46
|
-
|
|
47
|
-
var _useState = useState(open),
|
|
48
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
-
isOpen = _useState2[0],
|
|
50
|
-
setIsOpen = _useState2[1];
|
|
51
|
-
|
|
52
|
-
var _useState3 = useState(open),
|
|
53
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
-
prevIsOpen = _useState4[0],
|
|
55
|
-
setPrevIsOpen = _useState4[1];
|
|
56
|
-
|
|
57
|
-
var _useState5 = useState(''),
|
|
58
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
-
animation = _useState6[0],
|
|
60
|
-
setAnimation = _useState6[1];
|
|
61
|
-
|
|
62
|
-
var className = cx((_cx = {}, _defineProperty(_cx, "".concat(prefix, "--accordion__item"), true), _defineProperty(_cx, "".concat(prefix, "--accordion__item--active"), isOpen), _defineProperty(_cx, "".concat(prefix, "--accordion__item--").concat(animation), animation), _defineProperty(_cx, customClassName, !!customClassName), _cx));
|
|
63
|
-
|
|
64
|
-
if (open !== prevIsOpen) {
|
|
65
|
-
setIsOpen(open);
|
|
66
|
-
setPrevIsOpen(open);
|
|
67
|
-
} // When the AccordionItem heading is clicked, toggle the open state of the
|
|
68
|
-
// panel
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
function onClick(event) {
|
|
72
|
-
var nextValue = !isOpen;
|
|
73
|
-
setAnimation(isOpen ? 'collapsing' : 'expanding');
|
|
74
|
-
setIsOpen(nextValue);
|
|
75
|
-
|
|
76
|
-
if (onHeadingClick) {
|
|
77
|
-
// TODO: normalize signature, potentially:
|
|
78
|
-
// onHeadingClick :: (event: Event, state: { isOpen: Boolean }) => any
|
|
79
|
-
onHeadingClick({
|
|
80
|
-
isOpen: nextValue,
|
|
81
|
-
event: event
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
} // If the AccordionItem is open, and the user hits the ESC key, then close it
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
function onKeyDown(event) {
|
|
88
|
-
if (isOpen && match(event, Escape)) {
|
|
89
|
-
setIsOpen(false);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function handleAnimationEnd(event) {
|
|
94
|
-
if (rest.handleAnimationEnd) {
|
|
95
|
-
rest.handleAnimationEnd(event);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
setAnimation('');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return React.createElement("li", _extends({
|
|
102
|
-
className: className
|
|
103
|
-
}, rest, {
|
|
104
|
-
onAnimationEnd: handleAnimationEnd
|
|
105
|
-
}), React.createElement(Expando, {
|
|
106
|
-
"aria-expanded": isOpen,
|
|
107
|
-
className: "".concat(prefix, "--accordion__heading"),
|
|
108
|
-
onClick: onClick,
|
|
109
|
-
onKeyDown: onKeyDown,
|
|
110
|
-
title: iconDescription,
|
|
111
|
-
type: "button"
|
|
112
|
-
}, React.createElement(ChevronRight16, {
|
|
113
|
-
"aria-label": iconDescription,
|
|
114
|
-
className: "".concat(prefix, "--accordion__arrow")
|
|
115
|
-
}), React.createElement("div", {
|
|
116
|
-
className: "".concat(prefix, "--accordion__title")
|
|
117
|
-
}, title)), React.createElement("div", {
|
|
118
|
-
className: "".concat(prefix, "--accordion__content")
|
|
119
|
-
}, children));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
AccordionItem.propTypes = {
|
|
123
|
-
/**
|
|
124
|
-
* Provide the contents of your AccordionItem
|
|
125
|
-
*/
|
|
126
|
-
children: PropTypes.node,
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Specify an optional className to be applied to the container node
|
|
130
|
-
*/
|
|
131
|
-
className: PropTypes.string,
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The accordion title.
|
|
135
|
-
*/
|
|
136
|
-
title: PropTypes.node,
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* The callback function to render the expando button.
|
|
140
|
-
* Can be a React component class.
|
|
141
|
-
*/
|
|
142
|
-
renderExpando: PropTypes.func,
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* The description of the expando icon.
|
|
146
|
-
*/
|
|
147
|
-
iconDescription: PropTypes.string,
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* `true` to open the expando.
|
|
151
|
-
*/
|
|
152
|
-
open: PropTypes.bool,
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* The handler of the massaged `click` event.
|
|
156
|
-
*/
|
|
157
|
-
onClick: PropTypes.func,
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* The handler of the massaged `click` event on the heading.
|
|
161
|
-
*/
|
|
162
|
-
onHeadingClick: PropTypes.func
|
|
163
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import { settings } from 'carbon-components';
|
|
5
|
-
|
|
6
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
|
-
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
|
|
10
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
-
|
|
12
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
|
-
var prefix = settings.prefix;
|
|
14
|
-
var randoms = [0.973051493507435, 0.15334737213558558, 0.5671034553053769];
|
|
15
|
-
|
|
16
|
-
function getRandomInt(min, max, n) {
|
|
17
|
-
return Math.floor(randoms[n % 3] * (max - min + 1)) + min;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var SkeletonText = function SkeletonText(_ref) {
|
|
21
|
-
var _classNames;
|
|
22
|
-
|
|
23
|
-
var paragraph = _ref.paragraph,
|
|
24
|
-
lineCount = _ref.lineCount,
|
|
25
|
-
width = _ref.width,
|
|
26
|
-
heading = _ref.heading,
|
|
27
|
-
className = _ref.className,
|
|
28
|
-
other = _objectWithoutProperties(_ref, ["paragraph", "lineCount", "width", "heading", "className"]);
|
|
29
|
-
|
|
30
|
-
var skeletonTextClasses = cx((_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--skeleton__text"), true), _defineProperty(_classNames, "".concat(prefix, "--skeleton__heading"), heading), _defineProperty(_classNames, className, className), _classNames));
|
|
31
|
-
var widthNum = parseInt(width, 10);
|
|
32
|
-
var widthPx = width.includes('px');
|
|
33
|
-
var widthPercent = width.includes('%');
|
|
34
|
-
|
|
35
|
-
if (widthPercent && paragraph) {
|
|
36
|
-
var lines = [];
|
|
37
|
-
|
|
38
|
-
for (var i = 0; i < lineCount; i++) {
|
|
39
|
-
var randomWidth = getRandomInt(0, 75, i) + 'px';
|
|
40
|
-
lines.push(React.createElement("p", _extends({
|
|
41
|
-
className: skeletonTextClasses,
|
|
42
|
-
style: {
|
|
43
|
-
width: "calc(".concat(width, " - ").concat(randomWidth, ")")
|
|
44
|
-
},
|
|
45
|
-
key: i
|
|
46
|
-
}, other)));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return React.createElement("div", null, lines);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (widthPx && paragraph) {
|
|
53
|
-
var _lines = [];
|
|
54
|
-
|
|
55
|
-
for (var j = 0; j < lineCount; j++) {
|
|
56
|
-
var _randomWidth = getRandomInt(widthNum - 75, widthNum, j) + 'px';
|
|
57
|
-
|
|
58
|
-
_lines.push(React.createElement("p", _extends({
|
|
59
|
-
className: skeletonTextClasses,
|
|
60
|
-
style: {
|
|
61
|
-
width: _randomWidth
|
|
62
|
-
},
|
|
63
|
-
key: j
|
|
64
|
-
}, other)));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return React.createElement("div", null, _lines);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return React.createElement("p", _extends({
|
|
71
|
-
className: skeletonTextClasses,
|
|
72
|
-
style: {
|
|
73
|
-
width: width
|
|
74
|
-
}
|
|
75
|
-
}, other));
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
SkeletonText.propTypes = {
|
|
79
|
-
/**
|
|
80
|
-
* will generate multiple lines of text
|
|
81
|
-
*/
|
|
82
|
-
paragraph: PropTypes.bool,
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* the number of lines in a paragraph
|
|
86
|
-
*/
|
|
87
|
-
lineCount: PropTypes.number,
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* width (in px or %) of single line of text or max-width of paragraph lines
|
|
91
|
-
*/
|
|
92
|
-
width: PropTypes.string,
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* generates skeleton text at a larger size
|
|
96
|
-
*/
|
|
97
|
-
heading: PropTypes.bool,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Specify an optional className to be applied to the container node
|
|
101
|
-
*/
|
|
102
|
-
className: PropTypes.string
|
|
103
|
-
};
|
|
104
|
-
SkeletonText.defaultProps = {
|
|
105
|
-
paragraph: false,
|
|
106
|
-
width: '100%',
|
|
107
|
-
heading: false,
|
|
108
|
-
lineCount: 3
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export default SkeletonText;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import warning from 'warning';
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
var didWarnAboutDeprecation = {};
|
|
9
|
-
function deprecate(propType, message) {
|
|
10
|
-
function checker(props, propName, componentName) {
|
|
11
|
-
if (props[propName] === undefined) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
|
|
16
|
-
didWarnAboutDeprecation[componentName] = _objectSpread({}, didWarnAboutDeprecation[componentName], _defineProperty({}, propName, true));
|
|
17
|
-
warning(false, message || "The prop `".concat(propName, "` has been deprecated for the ") + "".concat(componentName, " component. It will be removed in the next major ") + "release");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
21
|
-
rest[_key - 3] = arguments[_key];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return propType.apply(void 0, [props, propName, componentName].concat(rest));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return checker;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default deprecate;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { AccordionItem } from 'carbon-components-react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
5
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
6
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
7
|
-
|
|
8
|
-
var AccordionItem$1 = function AccordionItem$$1(_ref) {
|
|
9
|
-
var children = _ref.children,
|
|
10
|
-
props = _objectWithoutProperties(_ref, ["children"]);
|
|
11
|
-
|
|
12
|
-
var open = props.open;
|
|
13
|
-
|
|
14
|
-
var _useState = useState(open),
|
|
15
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
-
openState = _useState2[0],
|
|
17
|
-
setOpenState = _useState2[1];
|
|
18
|
-
|
|
19
|
-
useEffect(function () {
|
|
20
|
-
setOpenState(open);
|
|
21
|
-
}, [open]);
|
|
22
|
-
|
|
23
|
-
var handleToggle = function handleToggle(event) {
|
|
24
|
-
props.onHeadingClick(event);
|
|
25
|
-
setOpenState(!openState);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return /*#__PURE__*/React.createElement(AccordionItem, _extends({
|
|
29
|
-
"data-testid": "accordion-item"
|
|
30
|
-
}, props, {
|
|
31
|
-
onHeadingClick: handleToggle
|
|
32
|
-
}), openState && children);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
AccordionItem$1.propTypes = {
|
|
36
|
-
/**
|
|
37
|
-
* Provide the contents of your AccordionItem
|
|
38
|
-
*/
|
|
39
|
-
children: PropTypes.node,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Specify an optional className to be applied to the container node
|
|
43
|
-
*/
|
|
44
|
-
className: PropTypes.string,
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The accordion title.
|
|
48
|
-
*/
|
|
49
|
-
title: PropTypes.node,
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The callback function to render the expando button.
|
|
53
|
-
* Can be a React component class.
|
|
54
|
-
*/
|
|
55
|
-
// Carbon provides default
|
|
56
|
-
// eslint-disable-next-line react/require-default-props
|
|
57
|
-
renderExpando: PropTypes.func,
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* The description of the expando icon.
|
|
61
|
-
*/
|
|
62
|
-
iconDescription: PropTypes.string,
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* `true` to open the expando.
|
|
66
|
-
*/
|
|
67
|
-
open: PropTypes.bool,
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* The handler of the massaged `click` event.
|
|
71
|
-
*/
|
|
72
|
-
onClick: PropTypes.func,
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The handler of the massaged `click` event on the heading.
|
|
76
|
-
*/
|
|
77
|
-
onHeadingClick: PropTypes.func
|
|
78
|
-
};
|
|
79
|
-
AccordionItem$1.defaultProps = {
|
|
80
|
-
children: null,
|
|
81
|
-
className: null,
|
|
82
|
-
title: null,
|
|
83
|
-
iconDescription: 'Open/Close',
|
|
84
|
-
open: false,
|
|
85
|
-
onClick: function onClick() {},
|
|
86
|
-
onHeadingClick: function onHeadingClick() {}
|
|
87
|
-
};
|
|
88
|
-
AccordionItem$1.__docgenInfo = {
|
|
89
|
-
"description": "",
|
|
90
|
-
"methods": [],
|
|
91
|
-
"displayName": "AccordionItem",
|
|
92
|
-
"props": {
|
|
93
|
-
"children": {
|
|
94
|
-
"defaultValue": {
|
|
95
|
-
"value": "null",
|
|
96
|
-
"computed": false
|
|
97
|
-
},
|
|
98
|
-
"type": {
|
|
99
|
-
"name": "node"
|
|
100
|
-
},
|
|
101
|
-
"required": false,
|
|
102
|
-
"description": "Provide the contents of your AccordionItem"
|
|
103
|
-
},
|
|
104
|
-
"className": {
|
|
105
|
-
"defaultValue": {
|
|
106
|
-
"value": "null",
|
|
107
|
-
"computed": false
|
|
108
|
-
},
|
|
109
|
-
"type": {
|
|
110
|
-
"name": "string"
|
|
111
|
-
},
|
|
112
|
-
"required": false,
|
|
113
|
-
"description": "Specify an optional className to be applied to the container node"
|
|
114
|
-
},
|
|
115
|
-
"title": {
|
|
116
|
-
"defaultValue": {
|
|
117
|
-
"value": "null",
|
|
118
|
-
"computed": false
|
|
119
|
-
},
|
|
120
|
-
"type": {
|
|
121
|
-
"name": "node"
|
|
122
|
-
},
|
|
123
|
-
"required": false,
|
|
124
|
-
"description": "The accordion title."
|
|
125
|
-
},
|
|
126
|
-
"iconDescription": {
|
|
127
|
-
"defaultValue": {
|
|
128
|
-
"value": "'Open/Close'",
|
|
129
|
-
"computed": false
|
|
130
|
-
},
|
|
131
|
-
"type": {
|
|
132
|
-
"name": "string"
|
|
133
|
-
},
|
|
134
|
-
"required": false,
|
|
135
|
-
"description": "The description of the expando icon."
|
|
136
|
-
},
|
|
137
|
-
"open": {
|
|
138
|
-
"defaultValue": {
|
|
139
|
-
"value": "false",
|
|
140
|
-
"computed": false
|
|
141
|
-
},
|
|
142
|
-
"type": {
|
|
143
|
-
"name": "bool"
|
|
144
|
-
},
|
|
145
|
-
"required": false,
|
|
146
|
-
"description": "`true` to open the expando."
|
|
147
|
-
},
|
|
148
|
-
"onClick": {
|
|
149
|
-
"defaultValue": {
|
|
150
|
-
"value": "() => {}",
|
|
151
|
-
"computed": false
|
|
152
|
-
},
|
|
153
|
-
"type": {
|
|
154
|
-
"name": "func"
|
|
155
|
-
},
|
|
156
|
-
"required": false,
|
|
157
|
-
"description": "The handler of the massaged `click` event."
|
|
158
|
-
},
|
|
159
|
-
"onHeadingClick": {
|
|
160
|
-
"defaultValue": {
|
|
161
|
-
"value": "() => {}",
|
|
162
|
-
"computed": false
|
|
163
|
-
},
|
|
164
|
-
"type": {
|
|
165
|
-
"name": "func"
|
|
166
|
-
},
|
|
167
|
-
"required": false,
|
|
168
|
-
"description": "The handler of the massaged `click` event on the heading."
|
|
169
|
-
},
|
|
170
|
-
"renderExpando": {
|
|
171
|
-
"type": {
|
|
172
|
-
"name": "func"
|
|
173
|
-
},
|
|
174
|
-
"required": false,
|
|
175
|
-
"description": "The callback function to render the expando button.\nCan be a React component class."
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export default AccordionItem$1;
|