@ntbjs/react-components 2.0.2-rc.12 → 2.0.2-rc.13
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.
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React__default, { useState, useEffect, useMemo } from 'react';
|
|
2
|
-
import { useTheme } from 'styled-components';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import { nanoid } from 'nanoid';
|
|
5
4
|
import { components } from 'react-select';
|
|
5
|
+
import { colors } from '../../styles/utils/colors-export.js';
|
|
6
6
|
import { AsyncCreatableMultiSelect, AsyncMultiSelect, CreatableMultiSelect, MultiSelect as MultiSelect$1, MultiSelectWrapper, Label, InnerWrapper, ShowMoreWrapper, ShowMoreOverlay, ShowMoreText, ErrorMessage, DropdownOptionDeleteIcon, MultiValueWrapper } from './MultiSelect.styled.js';
|
|
7
7
|
|
|
8
8
|
const showMoreHeight = 114;
|
|
9
9
|
const MultiSelect = React__default.forwardRef((props, forwardedRef) => {
|
|
10
|
-
const theme = useTheme();
|
|
11
10
|
const {
|
|
12
11
|
label,
|
|
13
12
|
selectedOptions = [],
|
|
@@ -45,24 +44,17 @@ const MultiSelect = React__default.forwardRef((props, forwardedRef) => {
|
|
|
45
44
|
return () => observer.disconnect();
|
|
46
45
|
}, []);
|
|
47
46
|
const selectStyles = useMemo(() => {
|
|
48
|
-
const color = key => theme?.getColor?.(key) || '#888';
|
|
49
47
|
const getThemeColor = (darkKey, lightKey) => {
|
|
50
48
|
const prefersDark = !document.body.classList.contains('light-theme') && !document.body.classList.contains('dark-theme') && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
51
|
-
|
|
49
|
+
const key = isDarkMode || prefersDark ? darkKey : lightKey;
|
|
50
|
+
return colors[key] || colors['gray-500'];
|
|
52
51
|
};
|
|
53
|
-
const errorColor =
|
|
54
|
-
const warningColor =
|
|
52
|
+
const errorColor = colors['red-500'];
|
|
53
|
+
const warningColor = colors['orange-500'];
|
|
55
54
|
const menuBg = getThemeColor('gray-600', 'white');
|
|
56
55
|
const textColor = getThemeColor('gray-100', 'gray-900');
|
|
57
56
|
const placeholderColor = getThemeColor('gray-400', 'gray-500');
|
|
58
57
|
const multiValueBg = getThemeColor('gray-600', 'gray-800');
|
|
59
|
-
console.log('Theme in selectStyles:', {
|
|
60
|
-
menuBg,
|
|
61
|
-
textColor,
|
|
62
|
-
placeholderColor,
|
|
63
|
-
multiValueBg,
|
|
64
|
-
isDarkMode
|
|
65
|
-
});
|
|
66
58
|
return {
|
|
67
59
|
control: base => ({
|
|
68
60
|
...base,
|
|
@@ -72,7 +64,8 @@ const MultiSelect = React__default.forwardRef((props, forwardedRef) => {
|
|
|
72
64
|
borderRadius: '3px',
|
|
73
65
|
boxShadow: 'none',
|
|
74
66
|
minHeight: '38px',
|
|
75
|
-
|
|
67
|
+
opacity: disabled ? 0.5 : 1,
|
|
68
|
+
pointerEvents: 'auto',
|
|
76
69
|
'&:hover': {
|
|
77
70
|
border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none'
|
|
78
71
|
}
|
|
@@ -93,15 +86,17 @@ const MultiSelect = React__default.forwardRef((props, forwardedRef) => {
|
|
|
93
86
|
display: 'flex',
|
|
94
87
|
alignItems: 'stretch',
|
|
95
88
|
minHeight: '26px',
|
|
96
|
-
overflow: 'hidden'
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
opacity: disabled ? 0.7 : 1
|
|
97
91
|
}),
|
|
98
92
|
multiValueLabel: base => ({
|
|
99
93
|
...base,
|
|
100
|
-
color:
|
|
94
|
+
color: colors['white'],
|
|
101
95
|
fontSize: '12px',
|
|
102
96
|
padding: disabled || readOnly ? '0 8px' : '0 3px 0 8px',
|
|
103
97
|
display: 'flex',
|
|
104
|
-
alignItems: 'center'
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
cursor: disabled ? 'not-allowed' : readOnly ? 'default' : 'pointer'
|
|
105
100
|
}),
|
|
106
101
|
multiValueRemove: base => ({
|
|
107
102
|
...base,
|
|
@@ -173,7 +168,7 @@ const MultiSelect = React__default.forwardRef((props, forwardedRef) => {
|
|
|
173
168
|
display: 'none'
|
|
174
169
|
})
|
|
175
170
|
};
|
|
176
|
-
}, [
|
|
171
|
+
}, [error, warning, displayShowMore, disabled, readOnly, editText, focused, isDarkMode, onMultiValueClick]);
|
|
177
172
|
const innerComponents = {
|
|
178
173
|
Option: optProps => React__default.createElement(components.Option, optProps, React__default.createElement("div", {
|
|
179
174
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.js"],"sourcesContent":["import React, { useState, useEffect, useMemo } from 'react';\nimport { useTheme } from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { nanoid } from 'nanoid';\nimport { components } from 'react-select';\nimport * as S from './MultiSelect.styled';\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 showMoreHeight = 114;\n\nconst MultiSelect = React.forwardRef((props, forwardedRef) => {\n const theme = useTheme();\n const {\n label,\n selectedOptions = [],\n availableOptions,\n loadOptions,\n onUpdateCallback,\n editText,\n creatable,\n readOnly,\n disabled,\n error,\n warning,\n onMultiValueClick,\n showMore,\n showMoreText = 'Show more',\n displayTotalOnShowMore = true,\n hidden,\n ...rest\n } = props;\n\n const [uniqueId] = useState(nanoid());\n const [selected, setSelected] = useState(selectedOptions);\n const [cacheUnique, setCacheUnique] = useState(0);\n const [displayShowMore, setDisplayShowMore] = useState(showMore && !error && !warning);\n const [focused, setFocused] = useState(false);\n\n // Track theme changes by checking the DOM\n const [isDarkMode, setIsDarkMode] = useState(() =>\n document.body.classList.contains('dark-theme')\n );\n\n useEffect(() => setSelected(selectedOptions), [selectedOptions]);\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n setIsDarkMode(document.body.classList.contains('dark-theme'));\n });\n\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['class']\n });\n\n return () => observer.disconnect();\n }, []);\n\n const selectStyles = useMemo(() => {\n const color = key => theme?.getColor?.(key) || '#888';\n\n const getThemeColor = (darkKey, lightKey) => {\n const prefersDark =\n !document.body.classList.contains('light-theme') &&\n !document.body.classList.contains('dark-theme') &&\n window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n return isDarkMode || prefersDark ? color(darkKey) : color(lightKey);\n };\n\n const errorColor = color('red-500');\n const warningColor = color('orange-500');\n\n const menuBg = getThemeColor('gray-600', 'white');\n const textColor = getThemeColor('gray-100', 'gray-900');\n const placeholderColor = getThemeColor('gray-400', 'gray-500');\n const multiValueBg = getThemeColor('gray-600', 'gray-800');\n\n console.log('Theme in selectStyles:', {\n menuBg,\n textColor,\n placeholderColor,\n multiValueBg,\n isDarkMode\n });\n\n return {\n control: base => ({\n ...base,\n alignItems: 'center',\n background: 'transparent',\n border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none',\n borderRadius: '3px',\n boxShadow: 'none',\n minHeight: '38px',\n cursor: disabled || readOnly ? 'default' : 'pointer',\n '&:hover': {\n border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none'\n }\n }),\n valueContainer: base => ({\n ...base,\n alignItems: 'center',\n gap: '8px',\n padding: '0 8px',\n maxHeight: displayShowMore\n ? error || warning\n ? '100%'\n : `${showMoreHeight + 16}px`\n : '100%',\n overflow: 'hidden'\n }),\n multiValue: base => ({\n ...base,\n backgroundColor: multiValueBg,\n borderRadius: '3px',\n margin: '0',\n display: 'flex',\n alignItems: 'stretch',\n minHeight: '26px',\n overflow: 'hidden'\n }),\n multiValueLabel: base => ({\n ...base,\n color: color('white'),\n fontSize: '12px',\n padding: disabled || readOnly ? '0 8px' : '0 3px 0 8px',\n display: 'flex',\n alignItems: 'center'\n }),\n multiValueRemove: base => ({\n ...base,\n color: 'white',\n padding: '0 8px 0 5px',\n display: disabled || readOnly ? 'none' : 'flex',\n alignItems: 'center',\n alignSelf: 'stretch',\n borderRadius: '0',\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: errorColor,\n color: 'white'\n }\n }),\n menu: base => ({\n ...base,\n backgroundColor: menuBg,\n boxShadow: '0 4px 12px rgba(0,0,0,0.5)',\n zIndex: 999,\n marginTop: '4px',\n border: `1px solid ${getThemeColor('gray-500', 'gray-300')}`\n }),\n menuList: base => ({\n ...base,\n backgroundColor: 'transparent',\n padding: 0\n }),\n option: (base, state) => ({\n ...base,\n backgroundColor: state.isFocused ? getThemeColor('gray-500', 'gray-100') : 'transparent',\n color: textColor,\n cursor: 'pointer',\n fontSize: '14px',\n padding: '8px 12px',\n ':active': {\n backgroundColor: getThemeColor('gray-400', 'gray-200')\n }\n }),\n input: (base, state) => ({\n ...base,\n display: 'inline-grid',\n whiteSpace: 'nowrap',\n color: textColor,\n margin: 0,\n padding: 0,\n ':before':\n !focused && editText && !state.value\n ? {\n content: `\"${editText}\"`,\n color: placeholderColor,\n marginRight: '8px',\n lineHeight: '26px',\n gridArea: '1 / 1'\n }\n : {}\n }),\n noOptionsMessage: base => ({ ...base, color: textColor, backgroundColor: 'transparent' }),\n loadingMessage: base => ({ ...base, color: textColor, backgroundColor: 'transparent' }),\n placeholder: () => ({ display: 'none' }),\n indicatorsContainer: () => ({ display: 'none' })\n };\n }, [theme, error, warning, displayShowMore, disabled, readOnly, editText, focused, isDarkMode]);\n\n const innerComponents = {\n Option: optProps => (\n <components.Option {...optProps}>\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n alignItems: 'center'\n }}\n >\n <span>{optProps.label}</span>\n {optProps.isSelected && <S.DropdownOptionDeleteIcon />}\n </div>\n </components.Option>\n ),\n MultiValue: mvProps => (\n <S.MultiValueWrapper\n onMouseDown={e => {\n if (\n onMultiValueClick &&\n !readOnly &&\n !disabled &&\n !e.target.closest('.multi-select__multi-value__remove')\n ) {\n e.stopPropagation();\n onMultiValueClick(mvProps.data);\n }\n }}\n >\n <components.MultiValue {...mvProps} />\n </S.MultiValueWrapper>\n )\n };\n\n const sharedSelectProps = {\n ...rest,\n ref: forwardedRef,\n id: uniqueId,\n classNamePrefix: 'multi-select',\n styles: selectStyles,\n components: innerComponents,\n value: selected,\n options: loadOptions ? undefined : availableOptions,\n loadOptions,\n isMulti: true,\n isDisabled: disabled || readOnly,\n closeMenuOnSelect: false,\n hideSelectedOptions: false,\n openMenuOnClick: true,\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n onChange: (newValue, actionMeta) => {\n setSelected(newValue);\n if (onUpdateCallback) {\n const item = actionMeta.option || actionMeta.removedValue;\n onUpdateCallback(actionMeta.action, item);\n }\n if (actionMeta.action === 'create-option' && loadOptions) {\n setCacheUnique(c => c + 1);\n }\n },\n cacheUniqs: loadOptions ? [cacheUnique] : undefined\n };\n\n const SelectComponent = useMemo(() => {\n if (loadOptions) return creatable ? S.AsyncCreatableMultiSelect : S.AsyncMultiSelect;\n return creatable ? S.CreatableMultiSelect : S.MultiSelect;\n }, [loadOptions, creatable]);\n\n if (hidden) return null;\n\n return (\n <S.MultiSelectWrapper>\n {label && <S.Label htmlFor={uniqueId}>{label}</S.Label>}\n <S.InnerWrapper>\n <SelectComponent {...sharedSelectProps} />\n </S.InnerWrapper>\n {displayShowMore && (\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 {(error || warning) && (\n <S.ErrorMessage $error={!!error} $warning={!!warning}>\n {error || warning}\n </S.ErrorMessage>\n )}\n </S.MultiSelectWrapper>\n );\n});\n\nMultiSelect.displayName = 'MultiSelect';\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":["showMoreHeight","MultiSelect","React","forwardRef","props","forwardedRef","theme","useTheme","label","selectedOptions","availableOptions","loadOptions","onUpdateCallback","editText","creatable","readOnly","disabled","error","warning","onMultiValueClick","showMore","showMoreText","displayTotalOnShowMore","hidden","rest","uniqueId","useState","nanoid","selected","setSelected","cacheUnique","setCacheUnique","displayShowMore","setDisplayShowMore","focused","setFocused","isDarkMode","setIsDarkMode","document","body","classList","contains","useEffect","observer","MutationObserver","observe","attributes","attributeFilter","disconnect","selectStyles","useMemo","color","key","getColor","getThemeColor","darkKey","lightKey","prefersDark","window","matchMedia","matches","errorColor","warningColor","menuBg","textColor","placeholderColor","multiValueBg","console","log","control","base","alignItems","background","border","borderRadius","boxShadow","minHeight","cursor","valueContainer","gap","padding","maxHeight","overflow","multiValue","backgroundColor","margin","display","multiValueLabel","fontSize","multiValueRemove","alignSelf","menu","zIndex","marginTop","menuList","option","state","isFocused","input","whiteSpace","value","content","marginRight","lineHeight","gridArea","noOptionsMessage","loadingMessage","placeholder","indicatorsContainer","innerComponents","Option","optProps","createElement","components","style","justifyContent","width","isSelected","S","MultiValue","mvProps","onMouseDown","e","target","closest","stopPropagation","data","sharedSelectProps","ref","id","classNamePrefix","styles","options","undefined","isMulti","isDisabled","closeMenuOnSelect","hideSelectedOptions","openMenuOnClick","onFocus","onBlur","onChange","newValue","actionMeta","item","removedValue","action","c","cacheUniqs","SelectComponent","htmlFor","onClick","length","$error","$warning","displayName","propTypes","process","env","NODE_ENV","PropTypes","string","arrayOf","object","func","loadingMessageFunc","isRequired","bool","createNewOptionMessageFunc","noOptionsMessageFunc","oneOfType","defaultProps","inputValue"],"mappings":";;;;;;;AAkKA,MAAMA,cAAc,GAAG,GAAG,CAAA;AAEpBC,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,YAAY,KAAK;AAC5D,EAAA,MAAMC,KAAK,GAAGC,QAAQ,EAAE,CAAA;EACxB,MAAM;IACJC,KAAK;AACLC,IAAAA,eAAe,GAAG,EAAE;IACpBC,gBAAgB;IAChBC,WAAW;IACXC,gBAAgB;IAChBC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPC,iBAAiB;IACjBC,QAAQ;AACRC,IAAAA,YAAY,GAAG,WAAW;AAC1BC,IAAAA,sBAAsB,GAAG,IAAI;IAC7BC,MAAM;IACN,GAAGC,IAAAA;AACL,GAAC,GAAGpB,KAAK,CAAA;EAET,MAAM,CAACqB,QAAQ,CAAC,GAAGC,QAAQ,CAACC,MAAM,EAAE,CAAC,CAAA;EACrC,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGH,QAAQ,CAACjB,eAAe,CAAC,CAAA;EACzD,MAAM,CAACqB,WAAW,EAAEC,cAA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OAAO,sBAAsB,CAAA;AAC/B,KAAA;GACD;AACDxJ,EAAAA,QAAQ,EAAE,KAAK;AACfE,EAAAA,sBAAsB,EAAE,IAAI;AAC5BP,EAAAA,QAAQ,EAAE,KAAK;AACfC,EAAAA,QAAQ,EAAE,KAAK;AACfF,EAAAA,SAAS,EAAE,KAAK;AAChBG,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,OAAO,EAAE,KAAK;AACdG,EAAAA,YAAY,EAAE,WAAW;AACzBE,EAAAA,MAAM,EAAE,KAAA;AACV,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"MultiSelect.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.js"],"sourcesContent":["import React, { useState, useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { nanoid } from 'nanoid';\nimport { components } from 'react-select';\nimport { colors } from '../../../styles/utils/colors-export';\nimport * as S from './MultiSelect.styled';\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 showMoreHeight = 114;\n\nconst MultiSelect = React.forwardRef((props, forwardedRef) => {\n const {\n label,\n selectedOptions = [],\n availableOptions,\n loadOptions,\n onUpdateCallback,\n editText,\n creatable,\n readOnly,\n disabled,\n error,\n warning,\n onMultiValueClick,\n showMore,\n showMoreText = 'Show more',\n displayTotalOnShowMore = true,\n hidden,\n ...rest\n } = props;\n\n const [uniqueId] = useState(nanoid());\n const [selected, setSelected] = useState(selectedOptions);\n const [cacheUnique, setCacheUnique] = useState(0);\n const [displayShowMore, setDisplayShowMore] = useState(showMore && !error && !warning);\n const [focused, setFocused] = useState(false);\n\n // Track theme changes by checking the DOM\n const [isDarkMode, setIsDarkMode] = useState(() =>\n document.body.classList.contains('dark-theme')\n );\n\n useEffect(() => setSelected(selectedOptions), [selectedOptions]);\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n setIsDarkMode(document.body.classList.contains('dark-theme'));\n });\n\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['class']\n });\n\n return () => observer.disconnect();\n }, []);\n\n /**\n * Custom styles for react-select components using the Styles API.\n *\n * Note: We use inline styles via the `styles` prop instead of styled-components\n * because styled-components clash with the latest react-select version.\n * See: https://react-select.com/styles\n *\n * Theme handling:\n * - Colors are imported from colors-export.js (single source of truth)\n * - Theme detection uses MutationObserver to watch body class changes\n * - Supports both explicit themes (dark-theme/light-theme classes) and\n * system preference (prefers-color-scheme media query)\n *\n * The getThemeColor helper function returns actual hex color values based on\n * the current theme mode (dark/light), ensuring proper theme switching without\n * requiring a styled-components ThemeProvider context.\n */\n\n const selectStyles = useMemo(() => {\n const getThemeColor = (darkKey, lightKey) => {\n const prefersDark =\n !document.body.classList.contains('light-theme') &&\n !document.body.classList.contains('dark-theme') &&\n window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n const key = isDarkMode || prefersDark ? darkKey : lightKey;\n return colors[key] || colors['gray-500']; // Return actual hex color\n };\n\n const errorColor = colors['red-500'];\n const warningColor = colors['orange-500'];\n\n const menuBg = getThemeColor('gray-600', 'white');\n const textColor = getThemeColor('gray-100', 'gray-900');\n const placeholderColor = getThemeColor('gray-400', 'gray-500');\n const multiValueBg = getThemeColor('gray-600', 'gray-800');\n\n return {\n control: base => ({\n ...base,\n alignItems: 'center',\n background: 'transparent',\n border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none',\n borderRadius: '3px',\n boxShadow: 'none',\n minHeight: '38px',\n opacity: disabled ? 0.5 : 1,\n pointerEvents: 'auto',\n '&:hover': {\n border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none'\n }\n }),\n valueContainer: base => ({\n ...base,\n alignItems: 'center',\n gap: '8px',\n padding: '0 8px',\n maxHeight: displayShowMore\n ? error || warning\n ? '100%'\n : `${showMoreHeight + 16}px`\n : '100%',\n overflow: 'hidden'\n }),\n multiValue: base => ({\n ...base,\n backgroundColor: multiValueBg,\n borderRadius: '3px',\n margin: '0',\n display: 'flex',\n alignItems: 'stretch',\n minHeight: '26px',\n overflow: 'hidden',\n opacity: disabled ? 0.7 : 1\n }),\n multiValueLabel: base => ({\n ...base,\n color: colors['white'],\n fontSize: '12px',\n padding: disabled || readOnly ? '0 8px' : '0 3px 0 8px',\n display: 'flex',\n alignItems: 'center',\n cursor: disabled ? 'not-allowed' : readOnly ? 'default' : 'pointer'\n }),\n multiValueRemove: base => ({\n ...base,\n color: 'white',\n padding: '0 8px 0 5px',\n display: disabled || readOnly ? 'none' : 'flex',\n alignItems: 'center',\n alignSelf: 'stretch',\n borderRadius: '0',\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: errorColor,\n color: 'white'\n }\n }),\n menu: base => ({\n ...base,\n backgroundColor: menuBg,\n boxShadow: '0 4px 12px rgba(0,0,0,0.5)',\n zIndex: 999,\n marginTop: '4px',\n border: `1px solid ${getThemeColor('gray-500', 'gray-300')}`\n }),\n menuList: base => ({\n ...base,\n backgroundColor: 'transparent',\n padding: 0\n }),\n option: (base, state) => ({\n ...base,\n backgroundColor: state.isFocused ? getThemeColor('gray-500', 'gray-100') : 'transparent',\n color: textColor,\n cursor: 'pointer',\n fontSize: '14px',\n padding: '8px 12px',\n ':active': {\n backgroundColor: getThemeColor('gray-400', 'gray-200')\n }\n }),\n input: (base, state) => ({\n ...base,\n display: 'inline-grid',\n whiteSpace: 'nowrap',\n color: textColor,\n margin: 0,\n padding: 0,\n ':before':\n !focused && editText && !state.value\n ? {\n content: `\"${editText}\"`,\n color: placeholderColor,\n marginRight: '8px',\n lineHeight: '26px',\n gridArea: '1 / 1'\n }\n : {}\n }),\n noOptionsMessage: base => ({ ...base, color: textColor, backgroundColor: 'transparent' }),\n loadingMessage: base => ({ ...base, color: textColor, backgroundColor: 'transparent' }),\n placeholder: () => ({ display: 'none' }),\n indicatorsContainer: () => ({ display: 'none' })\n };\n }, [\n error,\n warning,\n displayShowMore,\n disabled,\n readOnly,\n editText,\n focused,\n isDarkMode,\n onMultiValueClick\n ]);\n\n const innerComponents = {\n Option: optProps => (\n <components.Option {...optProps}>\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n alignItems: 'center'\n }}\n >\n <span>{optProps.label}</span>\n {optProps.isSelected && <S.DropdownOptionDeleteIcon />}\n </div>\n </components.Option>\n ),\n MultiValue: mvProps => (\n <S.MultiValueWrapper\n onMouseDown={e => {\n if (\n onMultiValueClick &&\n !readOnly &&\n !disabled &&\n !e.target.closest('.multi-select__multi-value__remove')\n ) {\n e.stopPropagation();\n onMultiValueClick(mvProps.data);\n }\n }}\n >\n <components.MultiValue {...mvProps} />\n </S.MultiValueWrapper>\n )\n };\n\n const sharedSelectProps = {\n ...rest,\n ref: forwardedRef,\n id: uniqueId,\n classNamePrefix: 'multi-select',\n styles: selectStyles,\n components: innerComponents,\n value: selected,\n options: loadOptions ? undefined : availableOptions,\n loadOptions,\n isMulti: true,\n isDisabled: disabled || readOnly,\n closeMenuOnSelect: false,\n hideSelectedOptions: false,\n openMenuOnClick: true,\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n onChange: (newValue, actionMeta) => {\n setSelected(newValue);\n if (onUpdateCallback) {\n const item = actionMeta.option || actionMeta.removedValue;\n onUpdateCallback(actionMeta.action, item);\n }\n if (actionMeta.action === 'create-option' && loadOptions) {\n setCacheUnique(c => c + 1);\n }\n },\n cacheUniqs: loadOptions ? [cacheUnique] : undefined\n };\n\n const SelectComponent = useMemo(() => {\n if (loadOptions) return creatable ? S.AsyncCreatableMultiSelect : S.AsyncMultiSelect;\n return creatable ? S.CreatableMultiSelect : S.MultiSelect;\n }, [loadOptions, creatable]);\n\n if (hidden) return null;\n\n return (\n <S.MultiSelectWrapper>\n {label && <S.Label htmlFor={uniqueId}>{label}</S.Label>}\n <S.InnerWrapper>\n <SelectComponent {...sharedSelectProps} />\n </S.InnerWrapper>\n {displayShowMore && (\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 {(error || warning) && (\n <S.ErrorMessage $error={!!error} $warning={!!warning}>\n {error || warning}\n </S.ErrorMessage>\n )}\n </S.MultiSelectWrapper>\n );\n});\n\nMultiSelect.displayName = 'MultiSelect';\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":["showMoreHeight","MultiSelect","React","forwardRef","props","forwardedRef","label","selectedOptions","availableOptions","loadOptions","onUpdateCallback","editText","creatable","readOnly","disabled","error","warning","onMultiValueClick","showMore","showMoreText","displayTotalOnShowMore","hidden","rest","uniqueId","useState","nanoid","selected","setSelected","cacheUnique","setCacheUnique","displayShowMore","setDisplayShowMore","focused","setFocused","isDarkMode","setIsDarkMode","document","body","classList","contains","useEffect","observer","MutationObserver","observe","attributes","attributeFilter","disconnect","selectStyles","useMemo","getThemeColor","darkKey","lightKey","prefersDark","window","matchMedia","matches","key","colors","errorColor","warningColor","menuBg","textColor","placeholderColor","multiValueBg","control","base","alignItems","background","border","borderRadius","boxShadow","minHeight","opacity","pointerEvents","valueContainer","gap","padding","maxHeight","overflow","multiValue","backgroundColor","margin","display","multiValueLabel","color","fontSize","cursor","multiValueRemove","alignSelf","menu","zIndex","marginTop","menuList","option","state","isFocused","input","whiteSpace","value","content","marginRight","lineHeight","gridArea","noOptionsMessage","loadingMessage","placeholder","indicatorsContainer","innerComponents","Option","optProps","createElement","components","style","justifyContent","width","isSelected","S","MultiValue","mvProps","onMouseDown","e","target","closest","stopPropagation","data","sharedSelectProps","ref","id","classNamePrefix","styles","options","undefined","isMulti","isDisabled","closeMenuOnSelect","hideSelectedOptions","openMenuOnClick","onFocus","onBlur","onChange","newValue","actionMeta","item","removedValue","action","c","cacheUniqs","SelectComponent","htmlFor","onClick","length","$error","$warning","displayName","propTypes","process","env","NODE_ENV","PropTypes","string","arrayOf","object","func","loadingMessageFunc","isRequired","bool","createNewOptionMessageFunc","noOptionsMessageFunc","oneOfType","defaultProps","inputValue"],"mappings":";;;;;;;AAkKA,MAAMA,cAAc,GAAG,GAAG,CAAA;AAEpBC,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,YAAY,KAAK;EAC5D,MAAM;IACJC,KAAK;AACLC,IAAAA,eAAe,GAAG,EAAE;IACpBC,gBAAgB;IAChBC,WAAW;IACXC,gBAAgB;IAChBC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPC,iBAAiB;IACjBC,QAAQ;AACRC,IAAAA,YAAY,GA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