@carbon/ibm-products 2.33.0 → 2.35.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +31990 -32061
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +38 -17
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +636 -24096
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +2342 -17830
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +38 -2
- package/es/components/ActionSet/ActionSet.js +3 -5
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
- package/es/components/ConditionBuilder/ConditionBuilder.js +125 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +88 -0
- package/es/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
- package/es/components/ConditionBuilder/index.d.ts +1 -0
- package/es/components/CreateFullPage/CreateFullPage.js +3 -19
- package/es/components/CreateFullPage/CreateFullPageStep.js +22 -7
- package/es/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
- package/es/components/CreateSidePanel/CreateSidePanel.js +5 -2
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +304 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
- package/es/components/Datagrid/useEditableCell.js +15 -0
- package/es/components/DelimitedList/DelimitedList.d.ts +27 -2
- package/es/components/DelimitedList/DelimitedList.js +0 -1
- package/es/components/EditInPlace/EditInPlace.d.ts +97 -5
- package/es/components/EditInPlace/EditInPlace.js +10 -6
- package/es/components/EditSidePanel/EditSidePanel.d.ts +92 -2
- package/es/components/EditSidePanel/EditSidePanel.js +8 -10
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
- package/es/components/ExportModal/ExportModal.d.ts +110 -2
- package/es/components/ExportModal/ExportModal.js +10 -4
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +83 -0
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +94 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
- package/es/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +157 -0
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +72 -0
- package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +92 -0
- package/es/components/FilterPanel/index.d.ts +5 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
- package/es/components/ImportModal/ImportModal.d.ts +136 -2
- package/es/components/ImportModal/ImportModal.js +3 -2
- package/es/components/InlineTip/InlineTip.d.ts +90 -2
- package/es/components/InlineTip/InlineTip.js +3 -2
- package/es/components/Nav/Nav.js +1 -1
- package/es/components/Nav/NavList.js +7 -7
- package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/es/components/OptionsTile/OptionsTile.d.ts +77 -3
- package/es/components/OptionsTile/OptionsTile.js +9 -20
- package/es/components/PageHeader/PageHeader.js +3 -3
- package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/es/components/PageHeader/PageHeaderUtils.js +4 -3
- package/es/components/RemoveModal/RemoveModal.d.ts +81 -7
- package/es/components/RemoveModal/RemoveModal.js +1 -0
- package/es/components/ScrollGradient/ScrollGradient.d.ts +5 -0
- package/es/components/ScrollGradient/ScrollGradient.js +156 -0
- package/es/components/ScrollGradient/constants.d.ts +15 -0
- package/es/components/ScrollGradient/constants.js +121 -0
- package/es/components/ScrollGradient/index.d.ts +1 -0
- package/es/components/SidePanel/SidePanel.d.ts +144 -2
- package/es/components/SidePanel/SidePanel.js +100 -75
- package/es/components/StatusIcon/StatusIcon.d.ts +34 -2
- package/es/components/StatusIcon/StatusIcon.js +97 -95
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
- package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/es/components/TagOverflow/TagOverflow.js +209 -0
- package/es/components/TagOverflow/constants.d.ts +14 -0
- package/es/components/TagOverflow/constants.js +30 -0
- package/es/components/TagOverflow/index.d.ts +1 -0
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
- package/es/components/Tearsheet/TearsheetNarrow.js +6 -1
- package/es/components/Toolbar/Toolbar.d.ts +23 -5
- package/es/components/Toolbar/Toolbar.js +30 -26
- package/es/components/TruncatedList/TruncatedList.js +5 -3
- package/es/components/UserAvatar/UserAvatar.js +7 -4
- package/es/components/index.d.ts +5 -2
- package/es/global/js/package-settings.d.ts +8 -0
- package/es/global/js/package-settings.js +8 -0
- package/es/index.js +9 -0
- package/es/settings.d.ts +8 -0
- package/lib/components/ActionSet/ActionSet.d.ts +38 -2
- package/lib/components/ActionSet/ActionSet.js +3 -5
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
- package/lib/components/ConditionBuilder/ConditionBuilder.js +132 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +100 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +98 -0
- package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
- package/lib/components/ConditionBuilder/index.d.ts +1 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -18
- package/lib/components/CreateFullPage/CreateFullPageStep.js +20 -5
- package/lib/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
- package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -2
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +311 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
- package/lib/components/Datagrid/useEditableCell.js +19 -0
- package/lib/components/DelimitedList/DelimitedList.d.ts +27 -2
- package/lib/components/DelimitedList/DelimitedList.js +0 -1
- package/lib/components/EditInPlace/EditInPlace.d.ts +97 -5
- package/lib/components/EditInPlace/EditInPlace.js +10 -6
- package/lib/components/EditSidePanel/EditSidePanel.d.ts +92 -2
- package/lib/components/EditSidePanel/EditSidePanel.js +8 -10
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
- package/lib/components/ExportModal/ExportModal.d.ts +110 -2
- package/lib/components/ExportModal/ExportModal.js +10 -4
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +90 -0
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +101 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
- package/lib/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +164 -0
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +79 -0
- package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +99 -0
- package/lib/components/FilterPanel/index.d.ts +5 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
- package/lib/components/ImportModal/ImportModal.d.ts +136 -2
- package/lib/components/ImportModal/ImportModal.js +3 -2
- package/lib/components/InlineTip/InlineTip.d.ts +90 -2
- package/lib/components/InlineTip/InlineTip.js +3 -2
- package/lib/components/Nav/Nav.js +1 -1
- package/lib/components/Nav/NavList.js +7 -7
- package/lib/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/lib/components/OptionsTile/OptionsTile.d.ts +77 -3
- package/lib/components/OptionsTile/OptionsTile.js +9 -20
- package/lib/components/PageHeader/PageHeader.js +3 -3
- package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +4 -3
- package/lib/components/RemoveModal/RemoveModal.d.ts +81 -7
- package/lib/components/RemoveModal/RemoveModal.js +1 -0
- package/lib/components/ScrollGradient/ScrollGradient.d.ts +5 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +163 -0
- package/lib/components/ScrollGradient/constants.d.ts +15 -0
- package/lib/components/ScrollGradient/constants.js +128 -0
- package/lib/components/ScrollGradient/index.d.ts +1 -0
- package/lib/components/SidePanel/SidePanel.d.ts +144 -2
- package/lib/components/SidePanel/SidePanel.js +100 -75
- package/lib/components/StatusIcon/StatusIcon.d.ts +34 -2
- package/lib/components/StatusIcon/StatusIcon.js +97 -95
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
- package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/lib/components/TagOverflow/TagOverflow.js +216 -0
- package/lib/components/TagOverflow/constants.d.ts +14 -0
- package/lib/components/TagOverflow/constants.js +34 -0
- package/lib/components/TagOverflow/index.d.ts +1 -0
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
- package/lib/components/Tearsheet/TearsheetNarrow.js +6 -1
- package/lib/components/Toolbar/Toolbar.d.ts +23 -5
- package/lib/components/Toolbar/Toolbar.js +30 -26
- package/lib/components/TruncatedList/TruncatedList.js +5 -3
- package/lib/components/UserAvatar/UserAvatar.js +7 -4
- package/lib/components/index.d.ts +5 -2
- package/lib/global/js/package-settings.d.ts +8 -0
- package/lib/global/js/package-settings.js +8 -0
- package/lib/index.js +42 -0
- package/lib/settings.d.ts +8 -0
- package/package.json +3 -3
- package/scss/components/Coachmark/_coachmark-dragbar.scss +0 -1
- package/scss/components/Coachmark/_coachmark-tagline.scss +2 -2
- package/scss/components/ConditionBuilder/_carbon-imports.scss +9 -0
- package/scss/components/ConditionBuilder/_condition-builder.scss +25 -0
- package/scss/components/ConditionBuilder/_index-with-carbon.scss +9 -0
- package/scss/components/ConditionBuilder/_index.scss +8 -0
- package/scss/components/CreateFullPage/_create-full-page.scss +10 -10
- package/scss/components/Datagrid/styles/_useNestedRows.scss +5 -1
- package/scss/components/FilterPanel/_carbon-imports.scss +5 -0
- package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +54 -0
- package/scss/components/FilterPanel/_filter-panel-accordion.scss +6 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +60 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox.scss +24 -3
- package/scss/components/FilterPanel/_filter-panel-group.scss +39 -0
- package/scss/components/FilterPanel/_filter-panel-label.scss +0 -8
- package/scss/components/FilterPanel/_filter-panel-search.scss +38 -0
- package/scss/components/FilterPanel/_filter-panel.scss +2 -0
- package/scss/components/FilterPanel/_index-with-carbon.scss +5 -0
- package/scss/components/FilterPanel/_index.scss +5 -0
- package/scss/components/Guidebanner/_guidebanner.scss +1 -1
- package/scss/components/InlineTip/_inline-tip.scss +1 -1
- package/scss/components/ProductiveCard/_productive-card.scss +13 -0
- package/scss/components/ScrollGradient/_carbon-imports.scss +9 -0
- package/scss/components/ScrollGradient/_index-with-carbon.scss +9 -0
- package/scss/components/ScrollGradient/_index.scss +8 -0
- package/scss/components/ScrollGradient/_scroll-gradient.scss +102 -0
- package/scss/components/SidePanel/_side-panel.scss +9 -9
- package/scss/components/TagOverflow/_carbon-imports.scss +9 -0
- package/scss/components/TagOverflow/_index-with-carbon.scss +9 -0
- package/scss/components/TagOverflow/_index.scss +8 -0
- package/scss/components/TagOverflow/_tag-overflow.scss +55 -0
- package/scss/components/Tearsheet/_tearsheet.scss +10 -0
- package/scss/components/UserAvatar/_user-avatar.scss +38 -4
- package/scss/components/_index-with-carbon.scss +3 -0
- package/scss/components/_index.scss +3 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default from 'react';
|
10
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { Accordion } from '@carbon/react';
|
13
|
+
import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
|
14
|
+
import { pkg } from '../../../settings.js';
|
15
|
+
import { FilterPanelGroup } from '../FilterPanelGroup/FilterPanelGroup.js';
|
16
|
+
|
17
|
+
var _excluded = ["accordionProps", "children", "className", "count", "labelText", "title"],
|
18
|
+
_excluded2 = ["align"];
|
19
|
+
|
20
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
21
|
+
var blockClass = "".concat(pkg.prefix, "--filter-panel-accordion");
|
22
|
+
var componentName = 'FilterPanelAccordion';
|
23
|
+
var defaults = {
|
24
|
+
accordionProps: {}
|
25
|
+
};
|
26
|
+
|
27
|
+
/**
|
28
|
+
* A container with a label and optional count.
|
29
|
+
*/
|
30
|
+
var FilterPanelAccordion = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
31
|
+
var _ref$accordionProps = _ref.accordionProps,
|
32
|
+
accordionProps = _ref$accordionProps === void 0 ? defaults.accordionProps : _ref$accordionProps,
|
33
|
+
children = _ref.children,
|
34
|
+
className = _ref.className,
|
35
|
+
count = _ref.count,
|
36
|
+
labelText = _ref.labelText,
|
37
|
+
title = _ref.title,
|
38
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
39
|
+
var align = accordionProps.align,
|
40
|
+
otherAccordionProps = _objectWithoutProperties(accordionProps, _excluded2);
|
41
|
+
return /*#__PURE__*/React__default.createElement(FilterPanelGroup, _extends({}, rest, {
|
42
|
+
className: cx(blockClass, className),
|
43
|
+
count: count,
|
44
|
+
labelText: labelText,
|
45
|
+
ref: ref,
|
46
|
+
title: title
|
47
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(Accordion, _extends({}, otherAccordionProps, {
|
48
|
+
align: align || 'start',
|
49
|
+
className: "".concat(blockClass, "__list")
|
50
|
+
}), children));
|
51
|
+
});
|
52
|
+
|
53
|
+
// Return a placeholder if not released and not enabled by feature flag
|
54
|
+
FilterPanelAccordion = pkg.checkComponentEnabled(FilterPanelAccordion, componentName);
|
55
|
+
FilterPanelAccordion.displayName = componentName;
|
56
|
+
FilterPanelAccordion.propTypes = {
|
57
|
+
/**
|
58
|
+
* Props specific to the internal `Accordion` component.
|
59
|
+
*/
|
60
|
+
accordionProps: PropTypes.shape({}),
|
61
|
+
/**
|
62
|
+
* Provide the contents of the FilterPanelAccordion.
|
63
|
+
*/
|
64
|
+
children: PropTypes.node.isRequired,
|
65
|
+
/**
|
66
|
+
* Optional class to be applied to the containing node.
|
67
|
+
*/
|
68
|
+
className: PropTypes.string,
|
69
|
+
/**
|
70
|
+
* Number to be displayed with the label.
|
71
|
+
*/
|
72
|
+
count: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
73
|
+
/**
|
74
|
+
* The label for the component.
|
75
|
+
*/
|
76
|
+
labelText: PropTypes.node.isRequired,
|
77
|
+
/**
|
78
|
+
* Optional title attribute for the label.
|
79
|
+
*/
|
80
|
+
title: PropTypes.string
|
81
|
+
};
|
82
|
+
|
83
|
+
export { FilterPanelAccordion };
|
@@ -0,0 +1,94 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { Children } from 'react';
|
10
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { AccordionItem, ListItem } from '@carbon/react';
|
13
|
+
import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
|
14
|
+
import { pkg } from '../../../settings.js';
|
15
|
+
import { FilterPanelLabel } from '../FilterPanelLabel/FilterPanelLabel.js';
|
16
|
+
import { TruncatedList } from '../../TruncatedList/TruncatedList.js';
|
17
|
+
|
18
|
+
var _excluded = ["accordionItemProps", "truncatedListProps", "children", "className", "count", "labelText", "title"];
|
19
|
+
|
20
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
21
|
+
var blockClass = "".concat(pkg.prefix, "--filter-panel-accordion-item");
|
22
|
+
var componentName = 'FilterPanelAccordionItem';
|
23
|
+
var defaults = {
|
24
|
+
accordionItemProps: {},
|
25
|
+
truncatedListProps: {}
|
26
|
+
};
|
27
|
+
|
28
|
+
/**
|
29
|
+
* A container with a label and optional count.
|
30
|
+
*/
|
31
|
+
var FilterPanelAccordionItem = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
32
|
+
var _ref$accordionItemPro = _ref.accordionItemProps,
|
33
|
+
accordionItemProps = _ref$accordionItemPro === void 0 ? defaults.accordionItemProps : _ref$accordionItemPro,
|
34
|
+
_ref$truncatedListPro = _ref.truncatedListProps,
|
35
|
+
truncatedListProps = _ref$truncatedListPro === void 0 ? defaults.truncatedListProps : _ref$truncatedListPro,
|
36
|
+
children = _ref.children,
|
37
|
+
className = _ref.className,
|
38
|
+
count = _ref.count,
|
39
|
+
labelText = _ref.labelText,
|
40
|
+
title = _ref.title,
|
41
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
42
|
+
return /*#__PURE__*/React__default.createElement(AccordionItem, _extends({}, accordionItemProps, {
|
43
|
+
className: cx(blockClass, className),
|
44
|
+
ref: ref,
|
45
|
+
title: /*#__PURE__*/React__default.createElement(FilterPanelLabel, _extends({}, rest, {
|
46
|
+
count: count,
|
47
|
+
labelText: labelText,
|
48
|
+
title: title
|
49
|
+
}))
|
50
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(TruncatedList, _extends({}, truncatedListProps, {
|
51
|
+
className: "".concat(blockClass, "__list")
|
52
|
+
}), Children.map(children, function (child) {
|
53
|
+
return /*#__PURE__*/React__default.createElement(ListItem, {
|
54
|
+
className: "".concat(blockClass, "__list-item"),
|
55
|
+
key: child.key
|
56
|
+
}, child);
|
57
|
+
})));
|
58
|
+
});
|
59
|
+
|
60
|
+
// Return a placeholder if not released and not enabled by feature flag
|
61
|
+
FilterPanelAccordionItem = pkg.checkComponentEnabled(FilterPanelAccordionItem, componentName);
|
62
|
+
FilterPanelAccordionItem.displayName = componentName;
|
63
|
+
FilterPanelAccordionItem.propTypes = {
|
64
|
+
/**
|
65
|
+
* Props specific to the internal `AccordionItem` component.
|
66
|
+
*/
|
67
|
+
accordionItemProps: PropTypes.shape({}),
|
68
|
+
/**
|
69
|
+
* Provide the contents of the FilterPanelAccordionItem.
|
70
|
+
*/
|
71
|
+
children: PropTypes.node.isRequired,
|
72
|
+
/**
|
73
|
+
* Optional class to be applied to the containing node.
|
74
|
+
*/
|
75
|
+
className: PropTypes.string,
|
76
|
+
/**
|
77
|
+
* Number to be displayed with the label.
|
78
|
+
*/
|
79
|
+
count: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
80
|
+
/**
|
81
|
+
* The label for the component.
|
82
|
+
*/
|
83
|
+
labelText: PropTypes.node.isRequired,
|
84
|
+
/**
|
85
|
+
* Optional title attribute for the label.
|
86
|
+
*/
|
87
|
+
title: PropTypes.string,
|
88
|
+
/**
|
89
|
+
* Props specific to the internal `TruncatedList` component.
|
90
|
+
*/
|
91
|
+
truncatedListProps: PropTypes.shape({})
|
92
|
+
};
|
93
|
+
|
94
|
+
export { FilterPanelAccordionItem };
|
@@ -1,5 +1,10 @@
|
|
1
1
|
/**
|
2
2
|
* Provides a checkbox, label, and count.
|
3
|
+
*
|
4
|
+
* This component is returning Carbon's Checkbox.
|
5
|
+
*
|
6
|
+
* All of Carbon Checkbox's props are directly available
|
7
|
+
* through "...rest", including id, onClick, etc.
|
3
8
|
*/
|
4
9
|
export let FilterPanelCheckbox: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
5
10
|
import React from 'react';
|
@@ -14,7 +14,7 @@ import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
|
|
14
14
|
import { pkg } from '../../../settings.js';
|
15
15
|
import { FilterPanelLabel } from '../FilterPanelLabel/FilterPanelLabel.js';
|
16
16
|
|
17
|
-
var _excluded = ["className", "count", "labelText", "title"];
|
17
|
+
var _excluded = ["className", "count", "id", "labelText", "title"];
|
18
18
|
|
19
19
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
20
|
var blockClass = "".concat(pkg.prefix, "--filter-panel-checkbox");
|
@@ -22,15 +22,22 @@ var componentName = 'FilterPanelCheckbox';
|
|
22
22
|
|
23
23
|
/**
|
24
24
|
* Provides a checkbox, label, and count.
|
25
|
+
*
|
26
|
+
* This component is returning Carbon's Checkbox.
|
27
|
+
*
|
28
|
+
* All of Carbon Checkbox's props are directly available
|
29
|
+
* through "...rest", including id, onClick, etc.
|
25
30
|
*/
|
26
31
|
var FilterPanelCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
27
32
|
var className = _ref.className,
|
28
33
|
count = _ref.count,
|
34
|
+
id = _ref.id,
|
29
35
|
labelText = _ref.labelText,
|
30
36
|
title = _ref.title,
|
31
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
32
38
|
return /*#__PURE__*/React__default.createElement(Checkbox, _extends({}, rest, {
|
33
39
|
className: cx(blockClass, className),
|
40
|
+
id: id,
|
34
41
|
labelText: /*#__PURE__*/React__default.createElement(FilterPanelLabel, {
|
35
42
|
count: count,
|
36
43
|
labelText: labelText,
|
@@ -44,15 +51,6 @@ var FilterPanelCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref,
|
|
44
51
|
FilterPanelCheckbox = pkg.checkComponentEnabled(FilterPanelCheckbox, componentName);
|
45
52
|
FilterPanelCheckbox.displayName = componentName;
|
46
53
|
FilterPanelCheckbox.propTypes = {
|
47
|
-
/**
|
48
|
-
* IMPORTANT NOTE
|
49
|
-
*
|
50
|
-
* This component is returning Carbon's Checkbox.
|
51
|
-
*
|
52
|
-
* All of Carbon Checkbox's props are directly available
|
53
|
-
* through "...rest", including id, onClick, etc.
|
54
|
-
*/
|
55
|
-
|
56
54
|
/**
|
57
55
|
* Optional class to be applied to the containing node.
|
58
56
|
*/
|
@@ -0,0 +1 @@
|
|
1
|
+
export { FilterPanelCheckbox } from "./FilterPanelCheckbox";
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Provides a filter panel checkbox with an overflow menu.
|
3
|
+
*
|
4
|
+
* This component's props refer to the Carbon Checkbox,
|
5
|
+
* just like FilterPanelCheckbox.
|
6
|
+
*
|
7
|
+
* Use `overflowMenuProps` for properties specific to the OverflowMenu.
|
8
|
+
*/
|
9
|
+
export let FilterPanelCheckboxWithOverflow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
10
|
+
import React from 'react';
|
package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
10
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { OverflowMenu } from '@carbon/react';
|
13
|
+
import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
|
14
|
+
import { pkg } from '../../../settings.js';
|
15
|
+
import { FilterPanelCheckbox } from '../FilterPanelCheckbox/FilterPanelCheckbox.js';
|
16
|
+
|
17
|
+
var _excluded = ["children", "className", "count", "id", "labelText", "overflowMenuProps", "title"];
|
18
|
+
|
19
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
|
+
var blockClass = "".concat(pkg.prefix, "--filter-panel-checkbox-with-overflow");
|
21
|
+
var componentName = 'FilterPanelCheckboxWithOverflow';
|
22
|
+
var defaults = {
|
23
|
+
overflowMenuProps: {}
|
24
|
+
};
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Provides a filter panel checkbox with an overflow menu.
|
28
|
+
*
|
29
|
+
* This component's props refer to the Carbon Checkbox,
|
30
|
+
* just like FilterPanelCheckbox.
|
31
|
+
*
|
32
|
+
* Use `overflowMenuProps` for properties specific to the OverflowMenu.
|
33
|
+
*/
|
34
|
+
var FilterPanelCheckboxWithOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
35
|
+
var children = _ref.children,
|
36
|
+
className = _ref.className,
|
37
|
+
count = _ref.count,
|
38
|
+
id = _ref.id,
|
39
|
+
labelText = _ref.labelText,
|
40
|
+
_ref$overflowMenuProp = _ref.overflowMenuProps,
|
41
|
+
overflowMenuProps = _ref$overflowMenuProp === void 0 ? defaults.overflowMenuProps : _ref$overflowMenuProp,
|
42
|
+
title = _ref.title,
|
43
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
44
|
+
var _useState = useState(false),
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
46
|
+
menuIsOpen = _useState2[0],
|
47
|
+
setMenuIsOpen = _useState2[1];
|
48
|
+
var _useState3 = useState(false),
|
49
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
50
|
+
showMenuButton = _useState4[0],
|
51
|
+
setShowMenuButton = _useState4[1];
|
52
|
+
// Destructure overflow menu properties.
|
53
|
+
var other = _extends({}, (_objectDestructuringEmpty(overflowMenuProps), overflowMenuProps));
|
54
|
+
var backupRef = useRef();
|
55
|
+
var localRef = ref || backupRef;
|
56
|
+
var setHideButton = function setHideButton(activeElement) {
|
57
|
+
if (!menuIsOpen && !localRef.current.contains(activeElement)) {
|
58
|
+
setShowMenuButton(false);
|
59
|
+
}
|
60
|
+
};
|
61
|
+
useEffect(function () {
|
62
|
+
setShowMenuButton(menuIsOpen);
|
63
|
+
}, [menuIsOpen]);
|
64
|
+
return (
|
65
|
+
/*#__PURE__*/
|
66
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
67
|
+
React__default.createElement("div", _extends({
|
68
|
+
className: cx(blockClass, className, _defineProperty({}, "".concat(blockClass, "--open"), menuIsOpen)),
|
69
|
+
onBlur: function onBlur(_ref2) {
|
70
|
+
var relatedTarget = _ref2.relatedTarget;
|
71
|
+
return setHideButton(relatedTarget);
|
72
|
+
},
|
73
|
+
onFocus: function onFocus() {
|
74
|
+
return setShowMenuButton(true);
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* Desired behavior: onMouseEnter shows the menu, even when the user mouse-presses and -releases the checkbox/label.
|
78
|
+
* Issue: onMouseDown > checkbox/label triggers an onBlur event and hides the menu button.
|
79
|
+
* Releasing the mouse button then shows the button again.
|
80
|
+
* This behavior "flickers" the menu button.
|
81
|
+
* Solution: onMouseDown > preventDefault prevents onBlur from being called.
|
82
|
+
* The menu button remains visible at all times.
|
83
|
+
* This applies only when using the mouse; it is not an issue using the keyboard.
|
84
|
+
*/,
|
85
|
+
onMouseDown: function onMouseDown(event) {
|
86
|
+
return event.preventDefault();
|
87
|
+
},
|
88
|
+
onMouseEnter: function onMouseEnter() {
|
89
|
+
return setShowMenuButton(true);
|
90
|
+
},
|
91
|
+
onMouseLeave: function onMouseLeave() {
|
92
|
+
return setHideButton(document.activeElement);
|
93
|
+
},
|
94
|
+
ref: localRef
|
95
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(FilterPanelCheckbox, _extends({}, rest, {
|
96
|
+
className: cx("".concat(blockClass, "__checkbox")),
|
97
|
+
count: count,
|
98
|
+
id: id,
|
99
|
+
labelText: labelText,
|
100
|
+
title: title
|
101
|
+
})), showMenuButton && /*#__PURE__*/React__default.createElement(OverflowMenu, _extends({
|
102
|
+
open: overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps.open,
|
103
|
+
className: cx("".concat(blockClass, "__overflow-button"), overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps.menuClass),
|
104
|
+
menuOptionsClass: cx("".concat(blockClass, "__overflow-options"), overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps.menuOptionsClass),
|
105
|
+
"aria-label": overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps['aria-label'],
|
106
|
+
iconDescription: overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps['aria-label'],
|
107
|
+
onOpen: function onOpen() {
|
108
|
+
return setMenuIsOpen(true);
|
109
|
+
},
|
110
|
+
onClose: function onClose() {
|
111
|
+
return setMenuIsOpen(false);
|
112
|
+
},
|
113
|
+
flipped: (overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps.flipped) || true,
|
114
|
+
selectorPrimaryFocus: overflowMenuProps === null || overflowMenuProps === void 0 ? void 0 : overflowMenuProps.selectorPrimaryFocus
|
115
|
+
}, other), children))
|
116
|
+
);
|
117
|
+
});
|
118
|
+
|
119
|
+
// Return a placeholder if not released and not enabled by feature flag
|
120
|
+
FilterPanelCheckboxWithOverflow = pkg.checkComponentEnabled(FilterPanelCheckboxWithOverflow, componentName);
|
121
|
+
FilterPanelCheckboxWithOverflow.displayName = componentName;
|
122
|
+
FilterPanelCheckboxWithOverflow.propTypes = {
|
123
|
+
/**
|
124
|
+
* Children containing `OverflowMenuItems`.
|
125
|
+
*/
|
126
|
+
children: PropTypes.node.isRequired,
|
127
|
+
/**
|
128
|
+
* Optional class to be applied to the containing node.
|
129
|
+
*/
|
130
|
+
className: PropTypes.string,
|
131
|
+
/**
|
132
|
+
* Number to be displayed with the checkbox.
|
133
|
+
*/
|
134
|
+
count: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
135
|
+
/**
|
136
|
+
* Unique identifier.
|
137
|
+
*/
|
138
|
+
id: PropTypes.string.isRequired,
|
139
|
+
/**
|
140
|
+
* Label to be displayed with the checkbox.
|
141
|
+
*/
|
142
|
+
labelText: PropTypes.node.isRequired,
|
143
|
+
/**
|
144
|
+
* Checkbox event handler.
|
145
|
+
*/
|
146
|
+
onChange: PropTypes.func,
|
147
|
+
/**
|
148
|
+
* Props specific to the internal `OverflowMenu` component.
|
149
|
+
*/
|
150
|
+
overflowMenuProps: PropTypes.shape(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 'aria-label', PropTypes.string), "flipped", PropTypes.bool), "menuClass", PropTypes.string), "menuOptionsClass", PropTypes.string), "open", PropTypes.bool), "selectorPrimaryFocus", PropTypes.string)),
|
151
|
+
/**
|
152
|
+
* Optional title attribute for the label.
|
153
|
+
*/
|
154
|
+
title: PropTypes.string
|
155
|
+
};
|
156
|
+
|
157
|
+
export { FilterPanelCheckboxWithOverflow };
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default from 'react';
|
10
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
|
13
|
+
import { pkg } from '../../../settings.js';
|
14
|
+
import { FilterPanelLabel } from '../FilterPanelLabel/FilterPanelLabel.js';
|
15
|
+
|
16
|
+
var _excluded = ["children", "className", "count", "labelText", "title"];
|
17
|
+
|
18
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
19
|
+
var blockClass = "".concat(pkg.prefix, "--filter-panel-group");
|
20
|
+
var componentName = 'FilterPanelGroup';
|
21
|
+
|
22
|
+
/**
|
23
|
+
* A container with a label and optional count.
|
24
|
+
*/
|
25
|
+
var FilterPanelGroup = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
26
|
+
var children = _ref.children,
|
27
|
+
className = _ref.className,
|
28
|
+
count = _ref.count,
|
29
|
+
labelText = _ref.labelText,
|
30
|
+
title = _ref.title,
|
31
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
32
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
33
|
+
className: cx(blockClass, className),
|
34
|
+
ref: ref
|
35
|
+
}, getDevtoolsProps(componentName)), labelText && /*#__PURE__*/React__default.createElement("h2", {
|
36
|
+
className: "".concat(blockClass, "__title")
|
37
|
+
}, /*#__PURE__*/React__default.createElement(FilterPanelLabel, {
|
38
|
+
count: count,
|
39
|
+
labelText: labelText,
|
40
|
+
title: title
|
41
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
42
|
+
className: "".concat(blockClass, "__content")
|
43
|
+
}, children));
|
44
|
+
});
|
45
|
+
|
46
|
+
// Return a placeholder if not released and not enabled by feature flag
|
47
|
+
FilterPanelGroup = pkg.checkComponentEnabled(FilterPanelGroup, componentName);
|
48
|
+
FilterPanelGroup.displayName = componentName;
|
49
|
+
FilterPanelGroup.propTypes = {
|
50
|
+
/**
|
51
|
+
* Provide the contents of the FilterPanelGroup.
|
52
|
+
*/
|
53
|
+
children: PropTypes.node.isRequired,
|
54
|
+
/**
|
55
|
+
* Optional class to be applied to the containing node.
|
56
|
+
*/
|
57
|
+
className: PropTypes.string,
|
58
|
+
/**
|
59
|
+
* Number to be displayed with the label.
|
60
|
+
*/
|
61
|
+
count: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
62
|
+
/**
|
63
|
+
* The label for the component.
|
64
|
+
*/
|
65
|
+
labelText: PropTypes.node.isRequired,
|
66
|
+
/**
|
67
|
+
* Optional title attribute for the label.
|
68
|
+
*/
|
69
|
+
title: PropTypes.string
|
70
|
+
};
|
71
|
+
|
72
|
+
export { FilterPanelGroup };
|
@@ -33,9 +33,9 @@ var FilterPanelLabel = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
33
33
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("span", {
|
34
34
|
className: "".concat(blockClass, "__text"),
|
35
35
|
title: title
|
36
|
-
}, labelText), /*#__PURE__*/React__default.createElement("span", {
|
36
|
+
}, labelText), count && /*#__PURE__*/React__default.createElement("span", {
|
37
37
|
className: "".concat(blockClass, "__count")
|
38
|
-
}, count));
|
38
|
+
}, count), ' ');
|
39
39
|
});
|
40
40
|
|
41
41
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { useState, useEffect } from 'react';
|
10
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { Search } from '@carbon/react';
|
13
|
+
import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
|
14
|
+
import { pkg } from '../../../settings.js';
|
15
|
+
|
16
|
+
var _excluded = ["children", "className", "searchProps"];
|
17
|
+
|
18
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
19
|
+
var blockClass = "".concat(pkg.prefix, "--filter-panel-search");
|
20
|
+
var componentName = 'FilterPanelSearch';
|
21
|
+
var defaults = {
|
22
|
+
searchProps: {}
|
23
|
+
};
|
24
|
+
|
25
|
+
/**
|
26
|
+
* An input field and container to show search results.
|
27
|
+
*/
|
28
|
+
var FilterPanelSearch = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
29
|
+
var children = _ref.children,
|
30
|
+
className = _ref.className,
|
31
|
+
_ref$searchProps = _ref.searchProps,
|
32
|
+
searchProps = _ref$searchProps === void 0 ? defaults.searchProps : _ref$searchProps,
|
33
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
34
|
+
var _useState = useState(false),
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
36
|
+
resultsVisible = _useState2[0],
|
37
|
+
setResultsVisible = _useState2[1];
|
38
|
+
var timer;
|
39
|
+
|
40
|
+
// Hide results with a delay.
|
41
|
+
// Gives enough time for "show" to trigger earlier.
|
42
|
+
var hideResults = function hideResults() {
|
43
|
+
clearTimeout(timer);
|
44
|
+
timer = setTimeout(function () {
|
45
|
+
setResultsVisible(false);
|
46
|
+
}, 300);
|
47
|
+
};
|
48
|
+
|
49
|
+
// Show results immediately.
|
50
|
+
var showResults = function showResults() {
|
51
|
+
clearTimeout(timer);
|
52
|
+
setResultsVisible(true);
|
53
|
+
};
|
54
|
+
|
55
|
+
// On unmount, clear the timer.
|
56
|
+
useEffect(function () {
|
57
|
+
return clearTimeout(timer);
|
58
|
+
}, [timer]);
|
59
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
60
|
+
className: cx(blockClass, "".concat(blockClass, "__container"), className),
|
61
|
+
onBlur: hideResults,
|
62
|
+
onFocus: showResults,
|
63
|
+
ref: ref
|
64
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(Search, _extends({
|
65
|
+
className: "".concat(blockClass, "__input")
|
66
|
+
}, searchProps)), resultsVisible && !!children && /*#__PURE__*/React__default.createElement("div", {
|
67
|
+
className: "".concat(blockClass, "__results")
|
68
|
+
}, children));
|
69
|
+
});
|
70
|
+
|
71
|
+
// Return a placeholder if not released and not enabled by feature flag
|
72
|
+
FilterPanelSearch = pkg.checkComponentEnabled(FilterPanelSearch, componentName);
|
73
|
+
FilterPanelSearch.displayName = componentName;
|
74
|
+
FilterPanelSearch.propTypes = {
|
75
|
+
/**
|
76
|
+
* Provide the contents of the FilterPanelSearch.
|
77
|
+
*/
|
78
|
+
children: PropTypes.node,
|
79
|
+
/**
|
80
|
+
* Optional class to be applied to the containing node.
|
81
|
+
*/
|
82
|
+
className: PropTypes.string,
|
83
|
+
/**
|
84
|
+
* Props specific to the internal `Search` component.
|
85
|
+
*/
|
86
|
+
searchProps: PropTypes.shape({
|
87
|
+
/** The label text for the Search icon. */
|
88
|
+
labelText: PropTypes.string.isRequired
|
89
|
+
}).isRequired
|
90
|
+
};
|
91
|
+
|
92
|
+
export { FilterPanelSearch };
|
@@ -1,3 +1,8 @@
|
|
1
1
|
export { FilterPanel } from "./FilterPanel";
|
2
|
+
export { FilterPanelAccordion } from "./FilterPanelAccordion/FilterPanelAccordion";
|
3
|
+
export { FilterPanelAccordionItem } from "./FilterPanelAccordionItem/FilterPanelAccordionItem";
|
2
4
|
export { FilterPanelCheckbox } from "./FilterPanelCheckbox/FilterPanelCheckbox";
|
5
|
+
export { FilterPanelCheckboxWithOverflow } from "./FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow";
|
6
|
+
export { FilterPanelGroup } from "./FilterPanelGroup/FilterPanelGroup";
|
3
7
|
export { FilterPanelLabel } from "./FilterPanelLabel/FilterPanelLabel";
|
8
|
+
export { FilterPanelSearch } from "./FilterPanelSearch/FilterPanelSearch";
|
@@ -1,7 +1,45 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2021
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import React, { PropsWithChildren } from 'react';
|
8
|
+
interface HTTPError403Props extends PropsWithChildren {
|
9
|
+
/**
|
10
|
+
* Provide an optional class to be applied to the containing node
|
11
|
+
*/
|
12
|
+
className?: string;
|
13
|
+
/**
|
14
|
+
* String that will provide the description for the HTTP error code
|
15
|
+
*/
|
16
|
+
description: string;
|
17
|
+
/**
|
18
|
+
* String that will describe the error that occurred
|
19
|
+
*/
|
20
|
+
errorCodeLabel: string;
|
21
|
+
/**
|
22
|
+
* Links that will display for extra context when receiving particular errors
|
23
|
+
*/
|
24
|
+
links: Array<{
|
25
|
+
/**
|
26
|
+
* The text to display for the link
|
27
|
+
*/
|
28
|
+
text: string;
|
29
|
+
/**
|
30
|
+
* The link's destination
|
31
|
+
*/
|
32
|
+
href: string;
|
33
|
+
}>;
|
34
|
+
/**
|
35
|
+
* This will be for the main title of the HTTP error component
|
36
|
+
*/
|
37
|
+
title: string;
|
38
|
+
}
|
1
39
|
/**
|
2
40
|
* HTTP errors are used in an attempt to access something that isn’t available or
|
3
41
|
the user doesn’t have permission for. This HTTPError component is generic so you
|
4
42
|
can use it when you receive an error code that isn't provided.
|
5
43
|
*/
|
6
|
-
export let HTTPError403: React.ForwardRefExoticComponent<React.RefAttributes<
|
7
|
-
|
44
|
+
export declare let HTTPError403: React.ForwardRefExoticComponent<HTTPError403Props & React.RefAttributes<HTMLDivElement>>;
|
45
|
+
export {};
|