@ntbjs/react-components 2.0.2-rc.7 → 2.0.2-rc.9
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.
|
@@ -39,6 +39,7 @@ const MultiSelect = React__default.forwardRef(function MultiSelect({
|
|
|
39
39
|
const [selected, setSelected] = useState(selectedOptions);
|
|
40
40
|
const [focused, setFocused] = useState(false);
|
|
41
41
|
const [displayShowMore, setDisplayShowMore] = useState(error || warning ? false : showMore);
|
|
42
|
+
const [cacheUnique, setCacheUnique] = useState(0);
|
|
42
43
|
const [controlledMenuIsOpen, setControlledMenuIsOpen] = useState(undefined);
|
|
43
44
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
44
45
|
const wrapperRef = React__default.useRef(null);
|
|
@@ -172,6 +173,7 @@ const MultiSelect = React__default.forwardRef(function MultiSelect({
|
|
|
172
173
|
openMenuOnFocus: false,
|
|
173
174
|
blurInputOnSelect: false,
|
|
174
175
|
menuIsOpen: controlledMenuIsOpen,
|
|
176
|
+
cacheUniqs: loadOptions ? [cacheUnique] : undefined,
|
|
175
177
|
onMenuOpen: () => {
|
|
176
178
|
setIsMenuOpen(true);
|
|
177
179
|
setControlledMenuIsOpen(true);
|
|
@@ -185,11 +187,18 @@ const MultiSelect = React__default.forwardRef(function MultiSelect({
|
|
|
185
187
|
noOptionsMessage: ({
|
|
186
188
|
inputValue
|
|
187
189
|
}) => getNoOptionsMessage(inputValue),
|
|
188
|
-
onChange: (
|
|
190
|
+
onChange: (selectedOptions, actionMeta) => {
|
|
191
|
+
if (props.onChange) {
|
|
192
|
+
props.onChange(selectedOptions, actionMeta);
|
|
193
|
+
}
|
|
189
194
|
if (onUpdateCallback) {
|
|
190
|
-
|
|
195
|
+
const updatedItem = actionMeta.option || actionMeta.removedValue;
|
|
196
|
+
onUpdateCallback(actionMeta.action, updatedItem);
|
|
197
|
+
}
|
|
198
|
+
setSelected(selectedOptions);
|
|
199
|
+
if (actionMeta.action === 'create-option' && loadOptions) {
|
|
200
|
+
setCacheUnique(cacheUnique + 1);
|
|
191
201
|
}
|
|
192
|
-
setSelected(newValue);
|
|
193
202
|
}
|
|
194
203
|
};
|
|
195
204
|
if (hidden) return null;
|
|
@@ -226,7 +235,8 @@ MultiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
226
235
|
hidden: PropTypes.bool,
|
|
227
236
|
disabled: PropTypes.bool,
|
|
228
237
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
229
|
-
warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
|
|
238
|
+
warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
239
|
+
onChange: PropTypes.func
|
|
230
240
|
} : {};
|
|
231
241
|
MultiSelect.defaultProps = {
|
|
232
242
|
noOptionsMessageFunc: inputValue => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.js"],"sourcesContent":["import React, { useState, useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { nanoid } from 'nanoid';\nimport { components } from 'react-select';\nimport * as S from './MultiSelect.styled';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\n\n/**\n * Multi-select with autocomplete and support for asynchronous fetching/filtering of\n * available options with pagination, update handling with callback,\n * and the ability for the end-user to create new options.\n *\n * The component uses [react-select](https://react-select.com/) for the main select functionality,\n * with [react-select-async-paginate](https://www.npmjs.com/package/react-select-async-paginate) for pagination.\n *\n *\n * <br />### Import\n *\n * ``` js\n * import { MultiSelect } from '@ntbjs/react-components/inputs'\n * // or\n * import MultiSelect from '@ntbjs/react-components/inputs/MultiSelect'\n * ```\n *\n * <br />## Option `object` format\n * Options are represented by an `Array` of `objects` with the following format:\n *\n * ``` js\n * {\n * value: \"Example\",\n * label: \"Example\"\n * }\n * ```\n *\n * The `label` is what will visible to the end-user. Whether `value` and `label`\n * should be different will depend on your use-case, but they are not required to.\n *\n *\n * <br />## Update handling\n * Changes from the end-user to the selected/available options can be handled with a callback function\n * passed through the `onUpdateCallback` prop, which is triggered any time the selected values change.\n *\n * The callback function will be passed two arguments:\n * * `action: string`\n * * `updatedOption: object`\n *\n * <br />#### `action`\n * A `string` indicating what kind of update was made.\n *\n * The possible values of `action` are:\n * * `create-option`: an option that didn't exist in the original list of available options were added\n * * `select-option`: an option was selected\n * * `deselect-option`: an option was de-selected by clicking the X in the dropdown menu\n * * `remove-value`: an option was de-selected by clicking the X on the option label/box\n * * `pop-value`: an option was de-selected with backspace\n * * `clear`: all options were de-selected by clicking the clear indicator (not currently in use)\n *\n * <br />#### `updatedOption`\n * Option `object`of the updated option:\n *\n * In addition to the default `value` and `label` keys, an `__isNew__` flag will be present if the option was\n * not part of the original list of available options, i.e. created by the user in the current \"session\".\n * This is the case regardless of whether the list is provided through `availableOptions` or\n * asynchronously through `loadOptions`.\n *\n *\n * <br />## Asynchronous fetching/filtering with pagination\n * The list of available options can be fetched and filtered asynchronously with a `Promise`\n * passed through the `loadOptions` prop.\n *\n * It will be passed two arguments:\n *\n * * `inputValue: string`: current input value/search\n * * `prevOptions: Array`: previously loaded options for the current search\n *\n * The function is triggered and the first page is fetched when the dropdown menu opens.\n * Whenever the user scrolls down to the bottom of the list, `loadOptions` will\n * be triggered again to fetch the next page.\n *\n * The `Promise` should return an `object` with the following keys:\n *\n * ``` js\n * {\n * options: Array,\n * hasMore: boolean\n * }\n * ```\n *\n * `options` should contain the current page of options. It will be concatenated to the previous\n * set of options automatically. The `hasMore` flag indicates whether there is another page to be fetched.\n *\n * **Example:**\n *\n * ``` js\n *\n * const availableOptions = [\n * { value: \"Example 1\", label: \"Example 1\" },\n * ...\n * { value: \"Example N\", label: \"Example N\" }\n * ];\n *\n * const filterOptions = inputValue => {\n * return availableOptions.filter(option => {\n * return option.label.toLowerCase().includes(inputValue.toLowerCase());\n * });\n * };\n *\n * const loadOptionsFunc = (inputValue, prevOptions) => {\n * const currentLength = prevOptions.length;\n * const pageLength = 10;\n *\n * let filteredOptions;\n *\n * if (inputValue) {\n * filteredOptions = filterOptions(inputValue);\n * } else {\n * filteredOptions = availableOptions;\n * }\n *\n * const hasMore = filteredOptions.length > currentLength + pageLength;\n * const slicedOptions = filteredOptions.slice(currentLength, currentLength + pageLength);\n *\n * return {\n * options: slicedOptions,\n * hasMore\n * };\n * };\n *\n * const loadOptions = (inputValue, prevOptions) => {\n * return new Promise(resolve => {\n * resolve(loadOptionsFunc(inputValue, prevOptions));\n * });\n * };\n * ```\n *\n * While waiting for the `Promise` to resolve, the component will be in a loading state.\n * The loading state is showcased in the \"Primary With Fetching Timeout\" Story.\n *\n * <br />#### Without asynchronous fetching/filtering\n * If you wish to not use asynchronous fetching/filtering, leave the `loadOptions` prop undefined\n * and pass the `Array` of all available options to the `availableOptions` prop instead.\n * The component will use the built-in filtering on `label` from `react-select`, and the options\n * will not be paginated.\n *\n *\n * <br />## \"Show more\" overlay\n * The \"Show more\" overlay must be set manually with the `showMore` prop.\n *\n * By default, the total number\n * of selected options will be displayed in parenthesis after the \"Show more\" text. This can be\n * disabled with the `displayTotalOnShowMore` prop.\n *\n * **Note:**\n * <br />The component has been given a max-width in these Stories.\n * This is because the \"Show more\" overlay does not work well visually when there are\n * fewer than three rows of selected options. The component itself does not have\n * a max-width, so keep this in mind when using it.\n *\n * <br />\n */\n\nconst reactSelectTheme = theme => ({\n ...theme,\n spacing: {\n baseUnit: 4,\n controlHeight: 38,\n menuGutter: 8\n }\n});\n\nconst MultiSelect = React.forwardRef(function MultiSelect(\n {\n label,\n selectedOptions = [],\n availableOptions,\n loadOptions,\n loadingMessageFunc,\n onUpdateCallback,\n editText,\n creatable,\n readOnly,\n hidden,\n disabled,\n error,\n warning,\n onMultiValueClick,\n showMore,\n showMoreText = 'Show more',\n displayTotalOnShowMore = true,\n noOptionsMessageFunc,\n ...props\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n const [selected, setSelected] = useState(selectedOptions);\n const [focused, setFocused] = useState(false);\n const [displayShowMore, setDisplayShowMore] = useState(error || warning ? false : showMore);\n const [controlledMenuIsOpen, setControlledMenuIsOpen] = useState(undefined);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const wrapperRef = React.useRef(null);\n\n useEffect(() => {\n setSelected(selectedOptions);\n }, [selectedOptions]);\n\n // Handle clicks inside and outside the component\n useEffect(() => {\n function handleClick(event) {\n if (wrapperRef.current) {\n const isClickInside = wrapperRef.current.contains(event.target);\n\n if (!isClickInside) {\n // Clicked outside - close menu by setting to false\n setControlledMenuIsOpen(false);\n setIsMenuOpen(false);\n } else {\n // Clicked inside - check if it's NOT a remove button\n const isRemoveButton =\n event.target.closest('.multi-select__multi-value__remove') ||\n event.target.closest('[role=\"button\"]') ||\n event.target instanceof SVGElement ||\n event.target.closest('svg');\n\n if (!isRemoveButton && !readOnly && !disabled) {\n // Clicked on input area or multi-value labels - open the menu immediately\n setControlledMenuIsOpen(true);\n setIsMenuOpen(true);\n }\n }\n }\n }\n\n // Use mousedown to catch events before react-select processes them\n document.addEventListener('mousedown', handleClick);\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [readOnly, disabled]);\n\n const getNoOptionsMessage = inputValue => {\n if (typeof noOptionsMessageFunc === 'function') {\n return noOptionsMessageFunc(inputValue);\n }\n return inputValue ? `No matches for \"${inputValue}\"` : 'No available options';\n };\n\n const innerComponents = {\n DropdownIndicator: null,\n /* eslint-disable react/prop-types */\n MultiValue: ({ data, ...props }) => {\n return (\n <div\n className=\"multi-value-wrapper\"\n onMouseDown={e => {\n if (\n onMultiValueClick &&\n data &&\n !(e.target.role === 'button' || e.target instanceof SVGElement)\n ) {\n e.stopPropagation();\n onMultiValueClick(data);\n }\n }}\n >\n <S.MultiValue data={data} $isDisabled={disabled} $isReadOnly={readOnly} {...props} />\n </div>\n );\n },\n /* eslint-enable react/prop-types */\n MultiValueRemove: props => {\n if (readOnly || disabled) return null;\n return (\n <components.MultiValueRemove {...props}>\n <CloseIcon />\n </components.MultiValueRemove>\n );\n },\n Input: inputProps => (\n <S.InputWrapper\n $focused={focused}\n $editText={!readOnly && !disabled ? editText : ''}\n $isDisabled={readOnly || disabled}\n $isMenuOpen={isMenuOpen}\n >\n <components.Input {...inputProps} />\n </S.InputWrapper>\n ),\n Menu: menuProps => <S.DropdownMenu {...menuProps} />,\n Option: optProps =>\n optProps.isSelected ? (\n <S.SelectedOption {...optProps}>\n <span>{optProps.label}</span>\n <S.DropdownOptionDeleteIcon />\n </S.SelectedOption>\n ) : (\n <S.Option {...optProps} />\n )\n };\n\n const selectStyles = useMemo(\n () => ({\n control: base => ({\n ...base,\n alignItems: 'flex-start',\n background: 'transparent',\n border: 'none',\n boxShadow: 'none',\n minHeight: 'unset'\n }),\n valueContainer: base => ({\n ...base,\n padding: 0,\n gap: '8px',\n maxHeight: displayShowMore && !(error || warning) ? '130px' : '100%'\n }),\n menu: base => ({\n ...base,\n backgroundColor: 'transparent',\n boxShadow: 'none'\n }),\n menuList: base => ({\n ...base,\n backgroundColor: 'transparent'\n }),\n option: base => ({\n ...base,\n backgroundColor: 'transparent',\n color: 'inherit'\n }),\n multiValue: base => ({ ...base, margin: 0, border: 'none', background: 'none' }),\n multiValueLabel: base => ({ ...base, padding: 0 }),\n multiValueRemove: base => ({ ...base, padding: 0, cursor: 'pointer' })\n }),\n [error, warning, displayShowMore]\n );\n\n const sharedProps = {\n ...props,\n ref: forwardedRef,\n classNamePrefix: 'multi-select',\n value: selected,\n options: loadOptions ? undefined : availableOptions,\n loadOptions,\n loadingMessage: loadingMessageFunc,\n theme: reactSelectTheme,\n styles: selectStyles,\n components: innerComponents,\n isMulti: true,\n isClearable: false,\n placeholder: null,\n isDisabled: disabled,\n readOnly: readOnly,\n closeMenuOnSelect: false,\n hideSelectedOptions: false,\n openMenuOnClick: false,\n openMenuOnFocus: false,\n blurInputOnSelect: false,\n menuIsOpen: controlledMenuIsOpen,\n onMenuOpen: () => {\n setIsMenuOpen(true);\n setControlledMenuIsOpen(true);\n },\n onMenuClose: () => {\n setIsMenuOpen(false);\n setControlledMenuIsOpen(false);\n },\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n noOptionsMessage: ({ inputValue }) => getNoOptionsMessage(inputValue),\n onChange: (newValue, actionMeta) => {\n if (onUpdateCallback) {\n onUpdateCallback(actionMeta.action, actionMeta.option || actionMeta.removedValue);\n }\n setSelected(newValue);\n }\n };\n\n if (hidden) return null;\n\n return (\n <S.MultiSelectWrapper ref={wrapperRef}>\n {label && <S.Label htmlFor={uniqueId}>{label}</S.Label>}\n <S.InnerWrapper $error={error} $warning={warning}>\n {loadOptions ? (\n creatable ? (\n <S.AsyncCreatableMultiSelect {...sharedProps} />\n ) : (\n <S.AsyncMultiSelect {...sharedProps} />\n )\n ) : creatable ? (\n <S.CreatableMultiSelect {...sharedProps} />\n ) : (\n <S.MultiSelect {...sharedProps} />\n )}\n </S.InnerWrapper>\n {displayShowMore && !(error || warning) && (\n <S.ShowMoreWrapper onClick={() => setDisplayShowMore(false)}>\n <S.ShowMoreOverlay />\n <S.ShowMoreText>\n {showMoreText} {displayTotalOnShowMore && `(${selected.length})`}\n </S.ShowMoreText>\n </S.ShowMoreWrapper>\n )}\n {(typeof error === 'string' || typeof warning === 'string') && (\n <S.ErrorMessage $error={error} $warning={warning}>\n {error ? error : warning}\n </S.ErrorMessage>\n )}\n </S.MultiSelectWrapper>\n );\n});\n\nMultiSelect.propTypes = {\n /**\n *\n * The label of the input field — leave `undefined` to hide the label\n */\n label: PropTypes.string,\n /**\n * `Array` of `objects` containing the default options. This is only needed\n * when asynchronous option fetching with the `loadOptions` prop is not used.\n *\n * **Note:**\n * <br />This will be overridden by the `loadOptions` prop if both props are set.\n */\n availableOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * `Array` of `objects` containing the selected options.\n */\n selectedOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * Function with a `Promise` returning filtered options.\n *\n * See [Asynchronous fetching/filtering with pagination](#asynchronous-fetchingfiltering-with-pagination)\n * for details.\n *\n * **Note:**\n * <br />This will override the `availableOptions` prop if both props are set.\n */\n loadOptions: PropTypes.func,\n\n /**\n * Function for custom \"Loading...\" message while waiting for the first page\n * from `loadOptions` to resolve. Defaults to \"Loading...\" if no function is provided.\n */\n loadingMessageFunc: PropTypes.func,\n\n /**\n * Callback function for sending updates to the backend whenever the selected values are updated.\n * See [Update handling](#update-handling) for details.\n */\n onUpdateCallback: PropTypes.func,\n\n /**\n * Text to be displayed on the input element when the component\n * is enabled and not focused — e.g. \"Add a keyword...\"\n */\n editText: PropTypes.string.isRequired,\n\n /**\n * Whether the user can create new options.\n */\n creatable: PropTypes.bool,\n\n /**\n * Callback function for formatting the message displayed in the dropdown when there\n * are no matching options, and the user has permission to create new options.\n * The callback function will be given the current input value as an argument.\n */\n createNewOptionMessageFunc: PropTypes.func,\n\n /**\n * If the list of options is empty, or if the current input value doesn't match\n * any of the available options and the user doesn't have permission to add options,\n * this function will be called and passed the current input value as an argument.\n */\n noOptionsMessageFunc: PropTypes.func,\n\n /**\n * Optional callback function to be trigger when clicking a selected option's label — e.g. opening\n * a search filtered on the given multi-value's `label`.\n *\n * The callback function will be passed the option `object` as an argument.\n */\n onMultiValueClick: PropTypes.func,\n\n /**\n * Display an overlay which the user needs to click in order to\n * show the selected options list in its entirety and edit it.\n */\n showMore: PropTypes.bool,\n\n /**\n * Text displayed on the \"Show more\" overlay.\n */\n showMoreText: PropTypes.string,\n\n /**\n * Whether to display the total number of selected options after the show more text.\n */\n displayTotalOnShowMore: PropTypes.bool,\n\n /**\n * Whether the multi-select should be displayed in read-only mode.\n * The user can still click the selected options to trigger their on-click effect.\n */\n readOnly: PropTypes.bool,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n\n /**\n * Whether the multi-select should be disabled.\n * The user will not be able to trigger the on-click effect of the selected options.\n */\n disabled: PropTypes.bool,\n\n /**\n * Set to `true` to display a red border indicating an error.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Set to `true` to display an orange border.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n};\n\nMultiSelect.defaultProps = {\n noOptionsMessageFunc: inputValue => {\n if (inputValue) {\n return `No matches for \"${inputValue}\"`;\n } else {\n return 'No available options';\n }\n },\n showMore: false,\n displayTotalOnShowMore: true,\n readOnly: false,\n disabled: false,\n creatable: false,\n error: false,\n warning: false,\n showMoreText: 'Show more',\n hidden: false\n};\n\nexport default MultiSelect;\n"],"names":["reactSelectTheme","theme","spacing","baseUnit","controlHeight","menuGutter","MultiSelect","React","forwardRef","label","selectedOptions","availableOptions","loadOptions","loadingMessageFunc","onUpdateCallback","editText","creatable","readOnly","hidden","disabled","error","warning","onMultiValueClick","showMore","showMoreText","displayTotalOnShowMore","noOptionsMessageFunc","props","forwardedRef","uniqueId","useState","nanoid","selected","setSelected","focused","setFocused","displayShowMore","setDisplayShowMore","controlledMenuIsOpen","setControlledMenuIsOpen","undefined","isMenuOpen","setIsMenuOpen","wrapperRef","useRef","useEffect","handleClick","event","current","isClickInside","contains","target","isRemoveButton","closest","SVGElement","document","addEventListener","removeEventListener","getNoOptionsMessage","inputValue","innerComponents","DropdownIndicator","MultiValue","data","createElement","className","onMouseDown","e","role","stopPropagation","S","_extends","$isDisabled","$isReadOnly","MultiValueRemove","components","CloseIcon","Input","inputProps","$focused","$editText","$isMenuOpen","Menu","menuProps","Option","optProps","isSelected","selectStyles","useMemo","control","base","alignItems","background","border","boxShadow","minHeight","valueContainer","padding","gap","maxHeight","menu","backgroundColor","menuList","option","color","multiValue","margin","multiValueLabel","multiValueRemove","cursor","sharedProps","ref","classNamePrefix","value","options","loadingMessage","styles","isMulti","isClearable","placeholder","isDisabled","closeMenuOnSelect","hideSelectedOptions","openMenuOnClick","openMenuOnFocus","blurInputOnSelect","menuIsOpen","onMenuOpen","onMenuClose","onFocus","onBlur","noOptionsMessage","onChange","newValue","actionMeta","action","removedValue","htmlFor","$error","$warning","onClick","length","propTypes","process","env","NODE_ENV","PropTypes","string","arrayOf","object","func","isRequired","bool","createNewOptionMessageFunc","oneOfType","defaultProps"],"mappings":";;;;;;;;AAkKA,MAAMA,gBAAgB,GAAGC,KAAK,KAAK;AACjC,EAAA,GAAGA,KAAK;AACRC,EAAAA,OAAO,EAAE;AACPC,IAAAA,QAAQ,EAAE,CAAC;AACXC,IAAAA,aAAa,EAAE,EAAE;AACjBC,IAAAA,UAAU,EAAE,CAAA;AACd,GAAA;AACF,CAAC,CAAC,CAAA;AAEIC,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,WAAWA,CACvD;EACEG,KAAK;AACLC,EAAAA,eAAe,GAAG,EAAE;EACpBC,gBAAgB;EAChBC,WAAW;EACXC,kBAAkB;EAClBC,gBAAgB;EAChBC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC,iBAAiB;EACjBC,QAAQ;AACRC,EAAAA,YAAY,GAAG,WAAW;AAC1BC,EAAAA,sBAAsB,GAAG,IAAI;EAC7BC,oBAAoB;EACpB,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;EACA,MAAM,CAACC,QAAQ,CAAC,GAAGC,QAAQ,CAACC,MAAM,EAAE,CAAC,CAAA;EACrC,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGH,QAAQ,CAACpB,eAAe,CAAC,CAAA;EACzD,MAAM,CAACwB,OAAO,EAAEC,UAAU,CAAC,GAAGL,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC7C,EAAA,MAAM,CAACM,eAAe,EAAEC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,CAACM,IAAI;EAMtBrI,QAAQ,EAAE+H,SAAS,CAACM,IAAI;AASxBpI,EAAAA,KAAK,EAAE8H,SAAS,CAACQ,SAAS,CAAC,CAACR,SAAS,CAACM,IAAI,EAAEN,SAAS,CAACC,MAAM,CAAC,CAAC;AAS9D9H,EAAAA,OAAO,EAAE6H,SAAS,CAACQ,SAAS,CAAC,CAACR,SAAS,CAACM,IAAI,EAAEN,SAAS,CAACC,MAAM,CAAC,CAAA;AACjE,CAAC,GAAA,EAAA,CAAA;AAED7I,WAAW,CAACqJ,YAAY,GAAG;EACzBjI,oBAAoB,EAAEiC,UAAU,IAAI;AAClC,IAAA,IAAIA,UAAU,EAAE;MACd,OAAO,CAAA,gBAAA,EAAmBA,UAAU,CAAG,CAAA,CAAA,CAAA;AACzC,KAAC,MAAM;AACL,MAAA,OAAO,sBAAsB,CAAA;AAC/B,KAAA;GACD;AACDpC,EAAAA,QAAQ,EAAE,KAAK;AACfE,EAAAA,sBAAsB,EAAE,IAAI;AAC5BR,EAAAA,QAAQ,EAAE,KAAK;AACfE,EAAAA,QAAQ,EAAE,KAAK;AACfH,EAAAA,SAAS,EAAE,KAAK;AAChBI,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,OAAO,EAAE,KAAK;AACdG,EAAAA,YAAY,EAAE,WAAW;AACzBN,EAAAA,MAAM,EAAE,KAAA;AACV,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"MultiSelect.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.js"],"sourcesContent":["import React, { useState, useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { nanoid } from 'nanoid';\nimport { components } from 'react-select';\nimport * as S from './MultiSelect.styled';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\n\n/**\n * Multi-select with autocomplete and support for asynchronous fetching/filtering of\n * available options with pagination, update handling with callback,\n * and the ability for the end-user to create new options.\n *\n * The component uses [react-select](https://react-select.com/) for the main select functionality,\n * with [react-select-async-paginate](https://www.npmjs.com/package/react-select-async-paginate) for pagination.\n *\n *\n * <br />### Import\n *\n * ``` js\n * import { MultiSelect } from '@ntbjs/react-components/inputs'\n * // or\n * import MultiSelect from '@ntbjs/react-components/inputs/MultiSelect'\n * ```\n *\n * <br />## Option `object` format\n * Options are represented by an `Array` of `objects` with the following format:\n *\n * ``` js\n * {\n * value: \"Example\",\n * label: \"Example\"\n * }\n * ```\n *\n * The `label` is what will visible to the end-user. Whether `value` and `label`\n * should be different will depend on your use-case, but they are not required to.\n *\n *\n * <br />## Update handling\n * Changes from the end-user to the selected/available options can be handled with a callback function\n * passed through the `onUpdateCallback` prop, which is triggered any time the selected values change.\n *\n * The callback function will be passed two arguments:\n * * `action: string`\n * * `updatedOption: object`\n *\n * <br />#### `action`\n * A `string` indicating what kind of update was made.\n *\n * The possible values of `action` are:\n * * `create-option`: an option that didn't exist in the original list of available options were added\n * * `select-option`: an option was selected\n * * `deselect-option`: an option was de-selected by clicking the X in the dropdown menu\n * * `remove-value`: an option was de-selected by clicking the X on the option label/box\n * * `pop-value`: an option was de-selected with backspace\n * * `clear`: all options were de-selected by clicking the clear indicator (not currently in use)\n *\n * <br />#### `updatedOption`\n * Option `object`of the updated option:\n *\n * In addition to the default `value` and `label` keys, an `__isNew__` flag will be present if the option was\n * not part of the original list of available options, i.e. created by the user in the current \"session\".\n * This is the case regardless of whether the list is provided through `availableOptions` or\n * asynchronously through `loadOptions`.\n *\n *\n * <br />## Asynchronous fetching/filtering with pagination\n * The list of available options can be fetched and filtered asynchronously with a `Promise`\n * passed through the `loadOptions` prop.\n *\n * It will be passed two arguments:\n *\n * * `inputValue: string`: current input value/search\n * * `prevOptions: Array`: previously loaded options for the current search\n *\n * The function is triggered and the first page is fetched when the dropdown menu opens.\n * Whenever the user scrolls down to the bottom of the list, `loadOptions` will\n * be triggered again to fetch the next page.\n *\n * The `Promise` should return an `object` with the following keys:\n *\n * ``` js\n * {\n * options: Array,\n * hasMore: boolean\n * }\n * ```\n *\n * `options` should contain the current page of options. It will be concatenated to the previous\n * set of options automatically. The `hasMore` flag indicates whether there is another page to be fetched.\n *\n * **Example:**\n *\n * ``` js\n *\n * const availableOptions = [\n * { value: \"Example 1\", label: \"Example 1\" },\n * ...\n * { value: \"Example N\", label: \"Example N\" }\n * ];\n *\n * const filterOptions = inputValue => {\n * return availableOptions.filter(option => {\n * return option.label.toLowerCase().includes(inputValue.toLowerCase());\n * });\n * };\n *\n * const loadOptionsFunc = (inputValue, prevOptions) => {\n * const currentLength = prevOptions.length;\n * const pageLength = 10;\n *\n * let filteredOptions;\n *\n * if (inputValue) {\n * filteredOptions = filterOptions(inputValue);\n * } else {\n * filteredOptions = availableOptions;\n * }\n *\n * const hasMore = filteredOptions.length > currentLength + pageLength;\n * const slicedOptions = filteredOptions.slice(currentLength, currentLength + pageLength);\n *\n * return {\n * options: slicedOptions,\n * hasMore\n * };\n * };\n *\n * const loadOptions = (inputValue, prevOptions) => {\n * return new Promise(resolve => {\n * resolve(loadOptionsFunc(inputValue, prevOptions));\n * });\n * };\n * ```\n *\n * While waiting for the `Promise` to resolve, the component will be in a loading state.\n * The loading state is showcased in the \"Primary With Fetching Timeout\" Story.\n *\n * <br />#### Without asynchronous fetching/filtering\n * If you wish to not use asynchronous fetching/filtering, leave the `loadOptions` prop undefined\n * and pass the `Array` of all available options to the `availableOptions` prop instead.\n * The component will use the built-in filtering on `label` from `react-select`, and the options\n * will not be paginated.\n *\n *\n * <br />## \"Show more\" overlay\n * The \"Show more\" overlay must be set manually with the `showMore` prop.\n *\n * By default, the total number\n * of selected options will be displayed in parenthesis after the \"Show more\" text. This can be\n * disabled with the `displayTotalOnShowMore` prop.\n *\n * **Note:**\n * <br />The component has been given a max-width in these Stories.\n * This is because the \"Show more\" overlay does not work well visually when there are\n * fewer than three rows of selected options. The component itself does not have\n * a max-width, so keep this in mind when using it.\n *\n * <br />\n */\n\nconst reactSelectTheme = theme => ({\n ...theme,\n spacing: {\n baseUnit: 4,\n controlHeight: 38,\n menuGutter: 8\n }\n});\n\nconst MultiSelect = React.forwardRef(function MultiSelect(\n {\n label,\n selectedOptions = [],\n availableOptions,\n loadOptions,\n loadingMessageFunc,\n onUpdateCallback,\n editText,\n creatable,\n readOnly,\n hidden,\n disabled,\n error,\n warning,\n onMultiValueClick,\n showMore,\n showMoreText = 'Show more',\n displayTotalOnShowMore = true,\n noOptionsMessageFunc,\n ...props\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n const [selected, setSelected] = useState(selectedOptions);\n const [focused, setFocused] = useState(false);\n const [displayShowMore, setDisplayShowMore] = useState(error || warning ? false : showMore);\n const [cacheUnique, setCacheUnique] = useState(0);\n const [controlledMenuIsOpen, setControlledMenuIsOpen] = useState(undefined);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const wrapperRef = React.useRef(null);\n\n useEffect(() => {\n setSelected(selectedOptions);\n }, [selectedOptions]);\n\n // Handle clicks inside and outside the component\n useEffect(() => {\n function handleClick(event) {\n if (wrapperRef.current) {\n const isClickInside = wrapperRef.current.contains(event.target);\n\n if (!isClickInside) {\n // Clicked outside - close menu by setting to false\n setControlledMenuIsOpen(false);\n setIsMenuOpen(false);\n } else {\n // Clicked inside - check if it's NOT a remove button\n const isRemoveButton =\n event.target.closest('.multi-select__multi-value__remove') ||\n event.target.closest('[role=\"button\"]') ||\n event.target instanceof SVGElement ||\n event.target.closest('svg');\n\n if (!isRemoveButton && !readOnly && !disabled) {\n // Clicked on input area or multi-value labels - open the menu immediately\n setControlledMenuIsOpen(true);\n setIsMenuOpen(true);\n }\n }\n }\n }\n\n // Use mousedown to catch events before react-select processes them\n document.addEventListener('mousedown', handleClick);\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [readOnly, disabled]);\n\n const getNoOptionsMessage = inputValue => {\n if (typeof noOptionsMessageFunc === 'function') {\n return noOptionsMessageFunc(inputValue);\n }\n return inputValue ? `No matches for \"${inputValue}\"` : 'No available options';\n };\n\n const innerComponents = {\n DropdownIndicator: null,\n /* eslint-disable react/prop-types */\n MultiValue: ({ data, ...props }) => {\n return (\n <div\n className=\"multi-value-wrapper\"\n onMouseDown={e => {\n if (\n onMultiValueClick &&\n data &&\n !(e.target.role === 'button' || e.target instanceof SVGElement)\n ) {\n e.stopPropagation();\n onMultiValueClick(data);\n }\n }}\n >\n <S.MultiValue data={data} $isDisabled={disabled} $isReadOnly={readOnly} {...props} />\n </div>\n );\n },\n /* eslint-enable react/prop-types */\n MultiValueRemove: props => {\n if (readOnly || disabled) return null;\n return (\n <components.MultiValueRemove {...props}>\n <CloseIcon />\n </components.MultiValueRemove>\n );\n },\n Input: inputProps => (\n <S.InputWrapper\n $focused={focused}\n $editText={!readOnly && !disabled ? editText : ''}\n $isDisabled={readOnly || disabled}\n $isMenuOpen={isMenuOpen}\n >\n <components.Input {...inputProps} />\n </S.InputWrapper>\n ),\n Menu: menuProps => <S.DropdownMenu {...menuProps} />,\n Option: optProps =>\n optProps.isSelected ? (\n <S.SelectedOption {...optProps}>\n <span>{optProps.label}</span>\n <S.DropdownOptionDeleteIcon />\n </S.SelectedOption>\n ) : (\n <S.Option {...optProps} />\n )\n };\n\n const selectStyles = useMemo(\n () => ({\n control: base => ({\n ...base,\n alignItems: 'flex-start',\n background: 'transparent',\n border: 'none',\n boxShadow: 'none',\n minHeight: 'unset'\n }),\n valueContainer: base => ({\n ...base,\n padding: 0,\n gap: '8px',\n maxHeight: displayShowMore && !(error || warning) ? '130px' : '100%'\n }),\n menu: base => ({\n ...base,\n backgroundColor: 'transparent',\n boxShadow: 'none'\n }),\n menuList: base => ({\n ...base,\n backgroundColor: 'transparent'\n }),\n option: base => ({\n ...base,\n backgroundColor: 'transparent',\n color: 'inherit'\n }),\n multiValue: base => ({ ...base, margin: 0, border: 'none', background: 'none' }),\n multiValueLabel: base => ({ ...base, padding: 0 }),\n multiValueRemove: base => ({ ...base, padding: 0, cursor: 'pointer' })\n }),\n [error, warning, displayShowMore]\n );\n\n const sharedProps = {\n ...props,\n ref: forwardedRef,\n classNamePrefix: 'multi-select',\n value: selected,\n options: loadOptions ? undefined : availableOptions,\n loadOptions,\n loadingMessage: loadingMessageFunc,\n theme: reactSelectTheme,\n styles: selectStyles,\n components: innerComponents,\n isMulti: true,\n isClearable: false,\n placeholder: null,\n isDisabled: disabled,\n readOnly: readOnly,\n closeMenuOnSelect: false,\n hideSelectedOptions: false,\n openMenuOnClick: false,\n openMenuOnFocus: false,\n blurInputOnSelect: false,\n menuIsOpen: controlledMenuIsOpen,\n cacheUniqs: loadOptions ? [cacheUnique] : undefined,\n onMenuOpen: () => {\n setIsMenuOpen(true);\n setControlledMenuIsOpen(true);\n },\n onMenuClose: () => {\n setIsMenuOpen(false);\n setControlledMenuIsOpen(false);\n },\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n noOptionsMessage: ({ inputValue }) => getNoOptionsMessage(inputValue),\n onChange: (selectedOptions, actionMeta) => {\n if (props.onChange) {\n props.onChange(selectedOptions, actionMeta);\n }\n\n if (onUpdateCallback) {\n const updatedItem = actionMeta.option || actionMeta.removedValue;\n onUpdateCallback(actionMeta.action, updatedItem);\n }\n\n setSelected(selectedOptions);\n\n if (actionMeta.action === 'create-option' && loadOptions) {\n setCacheUnique(cacheUnique + 1);\n }\n }\n };\n\n if (hidden) return null;\n\n return (\n <S.MultiSelectWrapper ref={wrapperRef}>\n {label && <S.Label htmlFor={uniqueId}>{label}</S.Label>}\n <S.InnerWrapper $error={error} $warning={warning}>\n {loadOptions ? (\n creatable ? (\n <S.AsyncCreatableMultiSelect {...sharedProps} />\n ) : (\n <S.AsyncMultiSelect {...sharedProps} />\n )\n ) : creatable ? (\n <S.CreatableMultiSelect {...sharedProps} />\n ) : (\n <S.MultiSelect {...sharedProps} />\n )}\n </S.InnerWrapper>\n {displayShowMore && !(error || warning) && (\n <S.ShowMoreWrapper onClick={() => setDisplayShowMore(false)}>\n <S.ShowMoreOverlay />\n <S.ShowMoreText>\n {showMoreText} {displayTotalOnShowMore && `(${selected.length})`}\n </S.ShowMoreText>\n </S.ShowMoreWrapper>\n )}\n {(typeof error === 'string' || typeof warning === 'string') && (\n <S.ErrorMessage $error={error} $warning={warning}>\n {error ? error : warning}\n </S.ErrorMessage>\n )}\n </S.MultiSelectWrapper>\n );\n});\n\nMultiSelect.propTypes = {\n /**\n *\n * The label of the input field — leave `undefined` to hide the label\n */\n label: PropTypes.string,\n /**\n * `Array` of `objects` containing the default options. This is only needed\n * when asynchronous option fetching with the `loadOptions` prop is not used.\n *\n * **Note:**\n * <br />This will be overridden by the `loadOptions` prop if both props are set.\n */\n availableOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * `Array` of `objects` containing the selected options.\n */\n selectedOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * Function with a `Promise` returning filtered options.\n *\n * See [Asynchronous fetching/filtering with pagination](#asynchronous-fetchingfiltering-with-pagination)\n * for details.\n *\n * **Note:**\n * <br />This will override the `availableOptions` prop if both props are set.\n */\n loadOptions: PropTypes.func,\n\n /**\n * Function for custom \"Loading...\" message while waiting for the first page\n * from `loadOptions` to resolve. Defaults to \"Loading...\" if no function is provided.\n */\n loadingMessageFunc: PropTypes.func,\n\n /**\n * Callback function for sending updates to the backend whenever the selected values are updated.\n * See [Update handling](#update-handling) for details.\n */\n onUpdateCallback: PropTypes.func,\n\n /**\n * Text to be displayed on the input element when the component\n * is enabled and not focused — e.g. \"Add a keyword...\"\n */\n editText: PropTypes.string.isRequired,\n\n /**\n * Whether the user can create new options.\n */\n creatable: PropTypes.bool,\n\n /**\n * Callback function for formatting the message displayed in the dropdown when there\n * are no matching options, and the user has permission to create new options.\n * The callback function will be given the current input value as an argument.\n */\n createNewOptionMessageFunc: PropTypes.func,\n\n /**\n * If the list of options is empty, or if the current input value doesn't match\n * any of the available options and the user doesn't have permission to add options,\n * this function will be called and passed the current input value as an argument.\n */\n noOptionsMessageFunc: PropTypes.func,\n\n /**\n * Optional callback function to be trigger when clicking a selected option's label — e.g. opening\n * a search filtered on the given multi-value's `label`.\n *\n * The callback function will be passed the option `object` as an argument.\n */\n onMultiValueClick: PropTypes.func,\n\n /**\n * Display an overlay which the user needs to click in order to\n * show the selected options list in its entirety and edit it.\n */\n showMore: PropTypes.bool,\n\n /**\n * Text displayed on the \"Show more\" overlay.\n */\n showMoreText: PropTypes.string,\n\n /**\n * Whether to display the total number of selected options after the show more text.\n */\n displayTotalOnShowMore: PropTypes.bool,\n\n /**\n * Whether the multi-select should be displayed in read-only mode.\n * The user can still click the selected options to trigger their on-click effect.\n */\n readOnly: PropTypes.bool,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n\n /**\n * Whether the multi-select should be disabled.\n * The user will not be able to trigger the on-click effect of the selected options.\n */\n disabled: PropTypes.bool,\n\n /**\n * Set to `true` to display a red border indicating an error.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Set to `true` to display an orange border.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Optional onChange handler that receives the selected options and action metadata.\n */\n onChange: PropTypes.func\n};\n\nMultiSelect.defaultProps = {\n noOptionsMessageFunc: inputValue => {\n if (inputValue) {\n return `No matches for \"${inputValue}\"`;\n } else {\n return 'No available options';\n }\n },\n showMore: false,\n displayTotalOnShowMore: true,\n readOnly: false,\n disabled: false,\n creatable: false,\n error: false,\n warning: false,\n showMoreText: 'Show more',\n hidden: false\n};\n\nexport default MultiSelect;\n"],"names":["reactSelectTheme","theme","spacing","baseUnit","controlHeight","menuGutter","MultiSelect","React","forwardRef","label","selectedOptions","availableOptions","loadOptions","loadingMessageFunc","onUpdateCallback","editText","creatable","readOnly","hidden","disabled","error","warning","onMultiValueClick","showMore","showMoreText","displayTotalOnShowMore","noOptionsMessageFunc","props","forwardedRef","uniqueId","useState","nanoid","selected","setSelected","focused","setFocused","displayShowMore","setDisplayShowMore","cacheUnique","setCacheUnique","controlledMenuIsOpen","setControlledMenuIsOpen","undefined","isMenuOpen","setIsMenuOpen","wrapperRef","useRef","useEffect","handleClick","event","current","isClickInside","contains","target","isRemoveButton","closest","SVGElement","document","addEventListener","removeEventListener","getNoOptionsMessage","inputValue","innerComponents","DropdownIndicator","MultiValue","data","createElement","className","onMouseDown","e","role","stopPropagation","S","_extends","$isDisabled","$isReadOnly","MultiValueRemove","components","CloseIcon","Input","inputProps","$focused","$editText","$isMenuOpen","Menu","menuProps","Option","optProps","isSelected","selectStyles","useMemo","control","base","alignItems","background","border","boxShadow","minHeight","valueContainer","padding","gap","maxHeight","menu","backgroundColor","menuList","option","color","multiValue","margin","multiValueLabel","multiValueRemove","cursor","sharedProps","ref","classNamePrefix","value","options","loadingMessage","styles","isMulti","isClearable","placeholder","isDisabled","closeMenuOnSelect","hideSelectedOptions","openMenuOnClick","openMenuOnFocus","blurInputOnSelect","menuIsOpen","cacheUniqs","onMenuOpen","onMenuClose","onFocus","onBlur","noOptionsMessage","onChange","actionMeta","updatedItem","removedValue","action","htmlFor","$error","$warning","onClick","length","propTypes","process","env","NODE_ENV","PropTypes","string","arrayOf","object","func","isRequired","bool","createNewOptionMessageFunc","oneOfType","defaultProps"],"mappings":";;;;;;;;AAkKA,MAAMA,gBAAgB,GAAGC,KAAK,KAAK;AACjC,EAAA,GAAGA,KAAK;AACRC,EAAAA,OAAO,EAAE;AACPC,IAAAA,QAAQ,EAAE,CAAC;AACXC,IAAAA,aAAa,EAAE,EAAE;AACjBC,IAAAA,UAAU,EAAE,CAAA;AACd,GAAA;AACF,CAAC,CAAC,CAAA;AAEIC,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,WAAWA,CACvD;EACEG,KAAK;AACLC,EAAAA,eAAe,GA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