UNPKG

@carbon/ibm-products

Version:
162 lines (160 loc) 4.81 kB
/** * Copyright IBM Corp. 2020, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ const require_runtime = require("../../_virtual/_rolldown/runtime.js"); const require_devtools = require("../../global/js/utils/devtools.js"); const require_AddSelect = require("../AddSelect/AddSelect.js"); let react = require("react"); react = require_runtime.__toESM(react); let prop_types = require("prop-types"); prop_types = require_runtime.__toESM(prop_types); //#region src/components/MultiAddSelect/MultiAddSelect.tsx const componentName = "MultiAddSelect"; /** * Used to add or select multiple or more items from larger lists or hierarchies. */ const MultiAddSelect = (0, react.forwardRef)((props, ref) => /* @__PURE__ */ react.default.createElement(require_AddSelect.AddSelect, { ...props, multi: true, ref, ...require_devtools.getDevtoolsProps(componentName) })); MultiAddSelect.propTypes = { /** * optional class name */ className: prop_types.default.string, /** * placeholder for column input filter */ columnInputPlaceholder: prop_types.default.string, /** * text description that appears under the title */ description: prop_types.default.string, /** * options to display in the global filter box. values are generated * from the id which should correlate with a specific property in an * item entry */ /**@ts-ignore */ globalFilters: prop_types.default.arrayOf(prop_types.default.shape({ id: prop_types.default.string, label: prop_types.default.string })), globalFiltersIconDescription: prop_types.default.string, /** * placeholder text for the global filter dropdown */ globalFiltersPlaceholderText: prop_types.default.string, /** * text for the global filter primary button */ globalFiltersPrimaryButtonText: prop_types.default.string, /** * text for the global filter secondary button */ globalFiltersSecondaryButtonText: prop_types.default.string, /** * label for global search input */ globalSearchLabel: prop_types.default.string, /** * placeholder for global search input */ globalSearchPlaceholder: prop_types.default.string, /** * the theme for the empty state illustration */ illustrationTheme: prop_types.default.oneOf(["light", "dark"]), /** * title that displays in the sidebar / influencer */ influencerTitle: prop_types.default.string, /** * object that contains the item data. for more information reference the * "Structuring items" section in the docs tab */ /**@ts-ignore */ items: prop_types.default.shape({ modifiers: prop_types.default.shape({ label: prop_types.default.string, options: prop_types.default.array, multiSelect: prop_types.default.bool }), sortBy: prop_types.default.array, filterBy: prop_types.default.array, entries: prop_types.default.arrayOf(prop_types.default.shape({ avatar: prop_types.default.shape({ alt: prop_types.default.string, icon: prop_types.default.func, src: prop_types.default.string, theme: prop_types.default.oneOf(["light", "dark"]) }), children: prop_types.default.object, icon: prop_types.default.func, id: prop_types.default.string.isRequired, subtitle: prop_types.default.string, title: prop_types.default.string.isRequired, value: prop_types.default.string.isRequired })) }), /** * label that display above the list of items */ itemsLabel: prop_types.default.string, /** * text to display when no results are found from the global search */ noResultsDescription: prop_types.default.string, /** * title to display when no results are found from the global search */ noResultsTitle: prop_types.default.string, /** * text body that displays in the sidebar when nothing is selected */ noSelectionDescription: prop_types.default.string, /** * title that displays in the sidebar when nothing is selected */ noSelectionTitle: prop_types.default.string, /** * Determines if the component should be rendered within a Tearsheet component */ noTearsheet: prop_types.default.bool, /** * function to call when the close button clicked */ onClose: prop_types.default.func, /** * text for close button */ onCloseButtonText: prop_types.default.string, /** * function to call when the submit button is clicked. returns a selection */ onSubmit: prop_types.default.func, /** * text for the submit button */ onSubmitButtonText: prop_types.default.string, /** * specifies if the component is open or not */ open: prop_types.default.bool, /** * text that displays when displaying filtered items */ searchResultsTitle: prop_types.default.string, /** * header text */ title: prop_types.default.string }; MultiAddSelect.displayName = componentName; //#endregion exports.MultiAddSelect = MultiAddSelect;