@salutejs/plasma-new-hope 0.88.0-canary.1233.9452624028.0 → 0.88.0-canary.1233.9486423566.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Select/Select.js +4 -2
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/elements/Inner/elements/Item/Item.js +3 -2
- package/cjs/components/Select/elements/Inner/elements/Item/Item.js.map +1 -1
- package/cjs/components/Select/elements/Inner/elements/Item/Item.styles.js +10 -10
- package/cjs/components/Select/elements/Inner/elements/Item/Item.styles.js.map +1 -1
- package/cjs/components/Select/elements/Target/elements/Textfield/Textfield.styles.js.map +1 -1
- package/es/components/Select/Select.js +4 -2
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/elements/Inner/elements/Item/Item.js +3 -2
- package/es/components/Select/elements/Inner/elements/Item/Item.js.map +1 -1
- package/es/components/Select/elements/Inner/elements/Item/Item.styles.js +10 -10
- package/es/components/Select/elements/Inner/elements/Item/Item.styles.js.map +1 -1
- package/es/components/Select/elements/Target/elements/Textfield/Textfield.styles.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Select/Select.js +4 -2
- package/styled-components/cjs/components/Select/elements/Inner/elements/Item/Item.js +3 -2
- package/styled-components/cjs/components/Select/elements/Inner/elements/Item/Item.styles.js +1 -1
- package/styled-components/cjs/components/Select/elements/Target/elements/Textfield/Textfield.styles.js +1 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +29 -4
- package/styled-components/cjs/examples/plasma_web/components/Select/Select.stories.tsx +29 -4
- package/styled-components/es/components/Select/Select.js +4 -2
- package/styled-components/es/components/Select/elements/Inner/elements/Item/Item.js +3 -2
- package/styled-components/es/components/Select/elements/Inner/elements/Item/Item.styles.js +2 -2
- package/styled-components/es/components/Select/elements/Target/elements/Textfield/Textfield.styles.js +0 -3
- package/styled-components/es/examples/plasma_b2c/components/Select/Select.stories.tsx +29 -4
- package/styled-components/es/examples/plasma_web/components/Select/Select.stories.tsx +29 -4
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +5 -0
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/elements/Inner/elements/Item/Item.d.ts.map +1 -1
- package/types/components/Select/elements/Target/elements/Textfield/Textfield.styles.d.ts +0 -3
- package/types/components/Select/elements/Target/elements/Textfield/Textfield.styles.d.ts.map +1 -1
@@ -24,7 +24,7 @@ var Select_styles = require('./Select.styles.js');
|
|
24
24
|
var base = require('./variations/_view/base.js');
|
25
25
|
var base$1 = require('./variations/_size/base.js');
|
26
26
|
|
27
|
-
var _excluded = ["value", "onChange", "target", "separator", "items", "placement", "label", "labelPlacement", "placeholder", "helperText", "isTargetAmount", "disabled", "view", "size", "isOpen", "listOverflow", "listHeight", "listWidth", "status", "contentLeft", "onScrollBottom", "isInfiniteLoading", "notFoundContent", "chipView", "variant", "portal", "renderValue"];
|
27
|
+
var _excluded = ["value", "onChange", "target", "separator", "items", "placement", "label", "labelPlacement", "placeholder", "helperText", "isTargetAmount", "disabled", "view", "size", "isOpen", "listOverflow", "listHeight", "listWidth", "status", "contentLeft", "onScrollBottom", "isInfiniteLoading", "notFoundContent", "chipView", "variant", "portal", "renderValue", "renderItem"];
|
28
28
|
var Context = /*#__PURE__*/React.createContext({});
|
29
29
|
|
30
30
|
/**
|
@@ -62,6 +62,7 @@ var selectRoot = function selectRoot(Root) {
|
|
62
62
|
variant = _props$variant === void 0 ? 'normal' : _props$variant,
|
63
63
|
portal = props.portal,
|
64
64
|
renderValue = props.renderValue,
|
65
|
+
renderItem = props.renderItem,
|
65
66
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
66
67
|
var multiselect = Array.isArray(value);
|
67
68
|
var transformedItems = React.useMemo(function () {
|
@@ -222,7 +223,8 @@ var selectRoot = function selectRoot(Root) {
|
|
222
223
|
size: size,
|
223
224
|
handleCheckboxChange: handleCheckboxChange,
|
224
225
|
handleItemClick: handleItemClick,
|
225
|
-
variant: variant
|
226
|
+
variant: variant,
|
227
|
+
renderItem: renderItem
|
226
228
|
}
|
227
229
|
}, /*#__PURE__*/React.createElement(Select_styles.StyledPopover, {
|
228
230
|
ref: targetRef,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { isEmpty } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\nimport { getPlacements } from '../Dropdown/utils';\n\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, getView } from './utils';\nimport { Inner } from './elements/Inner/Inner';\nimport { Target } from './elements/Target/Target';\nimport { pathReducer, focusedPathReducer, focusedChipIndexReducer } from './reducers';\nimport { usePathMaps } from './hooks/usePathMaps';\nimport { StyledPopover, Ul, base, OuterLabel, HelperText } from './Select.styles';\nimport type { SelectProps, ItemContext } from './Select.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { ItemOptionTransformed } from './elements/Inner/elements/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список. Поддерживает выбор одного или нескольких значений.\n */\nexport const selectRoot = (Root: RootProps<HTMLButtonElement, SelectProps>) =>\n forwardRef<HTMLButtonElement, SelectProps>((props, ref) => {\n const {\n value,\n onChange,\n target = 'textfield',\n separator,\n items,\n placement = 'bottom',\n label,\n labelPlacement = 'outer',\n placeholder,\n helperText,\n isTargetAmount = false,\n disabled = false,\n view,\n size,\n isOpen,\n listOverflow,\n listHeight,\n listWidth,\n status,\n contentLeft,\n onScrollBottom,\n isInfiniteLoading,\n notFoundContent,\n chipView,\n variant = 'normal',\n portal,\n renderValue,\n ...rest\n } = props;\n\n const multiselect = Array.isArray(value);\n\n const transformedItems = useMemo(() => initialItemsTransform(items), [items]);\n\n const [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] = usePathMaps(transformedItems);\n\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [focusedChipIndex, dispatchFocusedChipIndex] = useReducer(focusedChipIndexReducer, null);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const targetRef = useOutsideClick(() => {\n if (focusedChipIndex != null) {\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n });\n\n const handleToggle = (opened: boolean) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n };\n\n const handleCheckboxChange = (item: ItemOptionTransformed) => {\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value.toString())) {\n checkedCopy.set(item.value.toString(), true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value.toString(), false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value.toString());\n }\n });\n\n onChange(newValues as any);\n };\n\n const handleItemClick = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item?.items)) {\n if (multiselect) {\n handleCheckboxChange(item);\n } else {\n if (e) {\n e.stopPropagation();\n }\n\n const checkedCopy = new Map(checked);\n\n const isCurrentChecked = checkedCopy.get(item.value);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isCurrentChecked) {\n checkedCopy.set(item.value, 'done');\n updateSingleAncestors(item, checkedCopy, 'dot');\n }\n\n onChange((isCurrentChecked ? '' : item.value) as any);\n }\n }\n };\n\n const handleChipClick = (currentValue: string) => {\n handleCheckboxChange(valueToItemMap.get(currentValue)!);\n };\n\n const handlePressDown = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (multiselect) {\n handleCheckboxChange(item);\n }\n };\n\n const handleScroll = (e: React.UIEvent<HTMLUListElement>) => {\n if (!onScrollBottom) return;\n\n const { target } = e;\n\n if (\n (target as HTMLElement).scrollHeight - (target as HTMLElement).scrollTop ===\n (target as HTMLElement).clientHeight\n ) {\n onScrollBottom(e);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleToggle,\n handlePressDown,\n focusedChipIndex,\n dispatchFocusedChipIndex,\n value,\n valueToItemMap,\n multiselect,\n isTargetAmount,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n // В данном эффекте мы следим за изменениями value и вносим коррективы в дерево чекбоксов.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value)) {\n if (multiselect && Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value as string, 'done');\n updateSingleAncestors(valueToItemMap.get(value as string)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n }, [value]);\n\n return (\n <Root\n ref={ref}\n size={size}\n view={getView(view, status)}\n chipView={chipView}\n items={items}\n {...(rest as any)}\n >\n {label && labelPlacement === 'outer' && target !== 'button' && <OuterLabel>{label}</OuterLabel>}\n\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n }}\n >\n <StyledPopover\n ref={targetRef}\n isOpen={isCurrentListOpen}\n placement={getPlacements(placement)}\n usePortal={Boolean(portal)}\n frame={portal}\n onToggle={handleToggle}\n trigger=\"click\"\n target={\n <Target\n opened={isCurrentListOpen}\n target={target}\n value={value}\n isTargetAmount={isTargetAmount}\n multiselect={multiselect}\n valueToItemMap={valueToItemMap}\n focusedPath={focusedPath}\n focusedToValueMap={focusedToValueMap}\n onChipClick={handleChipClick}\n label={label}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n focusedChipIndex={focusedChipIndex}\n labelPlacement={labelPlacement}\n size={size}\n contentLeft={contentLeft}\n disabled={disabled}\n renderValue={renderValue}\n />\n }\n preventOverflow={false}\n closeOnOverlayClick\n >\n {notFoundContent || (\n <Ul\n role=\"tree\"\n id=\"tree_level_1\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n onScroll={handleScroll}\n listWidth={listWidth}\n >\n {transformedItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n )}\n </StyledPopover>\n </Context.Provider>\n\n {helperText && target === 'textfield' && <HelperText>{helperText}</HelperText>}\n </Root>\n );\n });\n\nexport const selectConfig = {\n name: 'Select',\n tag: 'div',\n layout: selectRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n chipView: 'default',\n size: 'm',\n },\n};\n"],"names":["Context","createContext","selectRoot","Root","forwardRef","props","ref","value","onChange","_props$target","target","items","_props$placement","placement","label","_props$labelPlacement","labelPlacement","placeholder","helperText","_props$isTargetAmount","isTargetAmount","_props$disabled","disabled","view","size","listOverflow","listHeight","listWidth","status","contentLeft","onScrollBottom","notFoundContent","chipView","_props$variant","variant","portal","renderValue","rest","_objectWithoutProperties","_excluded","multiselect","Array","isArray","transformedItems","useMemo","initialItemsTransform","_usePathMaps","usePathMaps","_usePathMaps2","_slicedToArray","pathMap","focusedToValueMap","valueToCheckedMap","valueToItemMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useReducer5","focusedChipIndexReducer","_useReducer6","focusedChipIndex","dispatchFocusedChipIndex","_useState","useState","_useState2","checked","setChecked","targetRef","useOutsideClick","type","handleToggle","opened","handleCheckboxChange","item","checkedCopy","Map","get","toString","set","updateDescendants","updateAncestors","newValues","forEach","key","push","handleItemClick","e","isEmpty","stopPropagation","isCurrentChecked","_","updateSingleAncestors","handleChipClick","currentValue","handlePressDown","handleScroll","scrollHeight","scrollTop","clientHeight","_useKeyNavigation","useKeyNavigation","onKeyDown","isCurrentListOpen","Boolean","useLayoutEffect","val","React","createElement","_extends","getView","OuterLabel","Provider","StyledPopover","isOpen","getPlacements","usePortal","frame","onToggle","trigger","Target","onChipClick","preventOverflow","closeOnOverlayClick","Ul","role","id","onScroll","map","index","Inner","concat","currentLevel","HelperText","selectConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACtEC,gBAAU,CAAiC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACvD,IAAA,IACIC,KAAK,GA4BLF,KAAK,CA5BLE,KAAK,CAAA;MACLC,QAAQ,GA2BRH,KAAK,CA3BLG,QAAQ,CAAA;MAAAC,aAAA,GA2BRJ,KAAK,CA1BLK,MAAM,CAAA;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,WAAW,GAAAA,aAAA,CAAA;MAEpBE,KAAK,GAwBLN,KAAK,CAxBLM,KAAK,CAAA;MAAAC,gBAAA,GAwBLP,KAAK,CAvBLQ,SAAS,CAAA;AAATA,MAAAA,SAAS,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GA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A,MAAM,EAAE9I,UAAU;AAClB+I,EAAAA,IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACR3H,IAAAA,IAAI,EAAE;AACF4H,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD5H,IAAAA,IAAI,EAAE;AACF2H,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN/H,IAAAA,IAAI,EAAE,SAAS;AACfS,IAAAA,QAAQ,EAAE,SAAS;AACnBR,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;;"}
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { isEmpty } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\nimport { getPlacements } from '../Dropdown/utils';\n\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, getView } from './utils';\nimport { Inner } from './elements/Inner/Inner';\nimport { Target } from './elements/Target/Target';\nimport { pathReducer, focusedPathReducer, focusedChipIndexReducer } from './reducers';\nimport { usePathMaps } from './hooks/usePathMaps';\nimport { StyledPopover, Ul, base, OuterLabel, HelperText } from './Select.styles';\nimport type { SelectProps, ItemContext } from './Select.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { ItemOptionTransformed } from './elements/Inner/elements/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список. Поддерживает выбор одного или нескольких значений.\n */\nexport const selectRoot = (Root: RootProps<HTMLButtonElement, SelectProps>) =>\n forwardRef<HTMLButtonElement, SelectProps>((props, ref) => {\n const {\n value,\n onChange,\n target = 'textfield',\n separator,\n items,\n placement = 'bottom',\n label,\n labelPlacement = 'outer',\n placeholder,\n helperText,\n isTargetAmount = false,\n disabled = false,\n view,\n size,\n isOpen,\n listOverflow,\n listHeight,\n listWidth,\n status,\n contentLeft,\n onScrollBottom,\n isInfiniteLoading,\n notFoundContent,\n chipView,\n variant = 'normal',\n portal,\n renderValue,\n renderItem,\n ...rest\n } = props;\n\n const multiselect = Array.isArray(value);\n\n const transformedItems = useMemo(() => initialItemsTransform(items), [items]);\n\n const [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] = usePathMaps(transformedItems);\n\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [focusedChipIndex, dispatchFocusedChipIndex] = useReducer(focusedChipIndexReducer, null);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const targetRef = useOutsideClick(() => {\n if (focusedChipIndex != null) {\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n });\n\n const handleToggle = (opened: boolean) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n };\n\n const handleCheckboxChange = (item: ItemOptionTransformed) => {\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value.toString())) {\n checkedCopy.set(item.value.toString(), true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value.toString(), false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value.toString());\n }\n });\n\n onChange(newValues as any);\n };\n\n const handleItemClick = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item?.items)) {\n if (multiselect) {\n handleCheckboxChange(item);\n } else {\n if (e) {\n e.stopPropagation();\n }\n\n const checkedCopy = new Map(checked);\n\n const isCurrentChecked = checkedCopy.get(item.value);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isCurrentChecked) {\n checkedCopy.set(item.value, 'done');\n updateSingleAncestors(item, checkedCopy, 'dot');\n }\n\n onChange((isCurrentChecked ? '' : item.value) as any);\n }\n }\n };\n\n const handleChipClick = (currentValue: string) => {\n handleCheckboxChange(valueToItemMap.get(currentValue)!);\n };\n\n const handlePressDown = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (multiselect) {\n handleCheckboxChange(item);\n }\n };\n\n const handleScroll = (e: React.UIEvent<HTMLUListElement>) => {\n if (!onScrollBottom) return;\n\n const { target } = e;\n\n if (\n (target as HTMLElement).scrollHeight - (target as HTMLElement).scrollTop ===\n (target as HTMLElement).clientHeight\n ) {\n onScrollBottom(e);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleToggle,\n handlePressDown,\n focusedChipIndex,\n dispatchFocusedChipIndex,\n value,\n valueToItemMap,\n multiselect,\n isTargetAmount,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n // В данном эффекте мы следим за изменениями value и вносим коррективы в дерево чекбоксов.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value)) {\n if (multiselect && Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value as string, 'done');\n updateSingleAncestors(valueToItemMap.get(value as string)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n }, [value]);\n\n return (\n <Root\n ref={ref}\n size={size}\n view={getView(view, status)}\n chipView={chipView}\n items={items}\n {...(rest as any)}\n >\n {label && labelPlacement === 'outer' && target !== 'button' && <OuterLabel>{label}</OuterLabel>}\n\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n }}\n >\n <StyledPopover\n ref={targetRef}\n isOpen={isCurrentListOpen}\n placement={getPlacements(placement)}\n usePortal={Boolean(portal)}\n frame={portal}\n onToggle={handleToggle}\n trigger=\"click\"\n target={\n <Target\n opened={isCurrentListOpen}\n target={target}\n value={value}\n isTargetAmount={isTargetAmount}\n multiselect={multiselect}\n valueToItemMap={valueToItemMap}\n focusedPath={focusedPath}\n focusedToValueMap={focusedToValueMap}\n onChipClick={handleChipClick}\n label={label}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n focusedChipIndex={focusedChipIndex}\n labelPlacement={labelPlacement}\n size={size}\n contentLeft={contentLeft}\n disabled={disabled}\n renderValue={renderValue}\n />\n }\n preventOverflow={false}\n closeOnOverlayClick\n >\n {notFoundContent || (\n <Ul\n role=\"tree\"\n id=\"tree_level_1\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n onScroll={handleScroll}\n listWidth={listWidth}\n >\n {transformedItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n )}\n </StyledPopover>\n </Context.Provider>\n\n {helperText && target === 'textfield' && <HelperText>{helperText}</HelperText>}\n </Root>\n );\n });\n\nexport const selectConfig = {\n name: 'Select',\n tag: 'div',\n layout: selectRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n chipView: 'default',\n size: 'm',\n },\n};\n"],"names":["Context","createContext","selectRoot","Root","forwardRef","props","ref","value","onChange","_props$target","target","items","_props$placement","placement","label","_props$labelPlacement","labelPlacement","placeholder","helperText","_props$isTargetAmount","isTargetAmount","_props$disabled","disabled","view","size","listOverflow","listHeight","listWidth","status","contentLeft","onScrollBottom","notFoundContent","chipView","_props$variant","variant","portal","renderValue","renderItem","rest","_objectWithoutProperties","_excluded","multiselect","Array","isArray","transformedItems","useMemo","initialItemsTransform","_usePathMaps","usePathMaps","_usePathMaps2","_slicedToArray","pathMap","focusedToValueMap","valueToCheckedMap","valueToItemMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useReducer5","focusedChipIndexReducer","_useReducer6","focusedChipIndex","dispatchFocusedChipIndex","_useState","useState","_useState2","checked","setChecked","targetRef","useOutsideClick","type","handleToggle","opened","handleCheckboxChange","item","checkedCopy","Map","get","toString","set","updateDescendants","updateAncestors","newValues","forEach","key","push","handleItemClick","e","isEmpty","stopPropagation","isCurrentChecked","_","updateSingleAncestors","handleChipClick","currentValue","handlePressDown","handleScroll","scrollHeight","scrollTop","clientHeight","_useKeyNavigation","useKeyNavigation","onKeyDown","isCurrentListOpen","Boolean","useLayoutEffect","val","React","createElement","_extends","getView","OuterLabel","Provider","StyledPopover","isOpen","getPlacements","usePortal","frame","onToggle","trigger","Target","onChipClick","preventOverflow","closeOnOverlayClick","Ul","role","id","onScroll","map","index","Inner","concat","currentLevel","HelperText","selectConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACtEC,gBAAU,CAAiC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACvD,IAAA,IACIC,KAAK,GA6BLF,KAAK,CA7BLE,KAAK,CAAA;MACLC,QAAQ,GA4BRH,KAAK,CA5BLG,QAAQ,CAAA;MAAAC,aAAA,GA4BRJ,KAAK,CA3BLK,M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S,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;AAAA,KACL,CACD,CAEG,CACD,CAAC,EAElBT,UAAU,IAAIR,MAAM,KAAK,WAAW,iBAAIyG,KAAA,CAAAC,aAAA,CAACyB,wBAAU,EAAE3H,IAAAA,EAAAA,UAAuB,CAC3E,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAM4H,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE/I,UAAU;AAClBgJ,EAAAA,IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACR5H,IAAAA,IAAI,EAAE;AACF6H,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD7H,IAAAA,IAAI,EAAE;AACF4H,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNhI,IAAAA,IAAI,EAAE,SAAS;AACfS,IAAAA,QAAQ,EAAE,SAAS;AACnBR,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;;"}
|
@@ -38,7 +38,8 @@ var Item = function Item(_ref) {
|
|
38
38
|
size = _useContext.size,
|
39
39
|
handleCheckboxChange = _useContext.handleCheckboxChange,
|
40
40
|
handleItemClick = _useContext.handleItemClick,
|
41
|
-
variant = _useContext.variant
|
41
|
+
variant = _useContext.variant,
|
42
|
+
renderItem = _useContext.renderItem;
|
42
43
|
var isDisabledClassName = disabled || isDisabled ? Select_tokens.classes.dropdownItemIsDisabled : undefined;
|
43
44
|
var focusedClass = currentLevel === focusedPath.length - 1 && index$1 === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? Select_tokens.classes.dropdownItemIsFocused : undefined;
|
44
45
|
var activeClass = value === (path === null || path === void 0 ? void 0 : path[currentLevel + 1]) ? Select_tokens.classes.dropdownItemIsActive : undefined;
|
@@ -88,7 +89,7 @@ var Item = function Item(_ref) {
|
|
88
89
|
}))), !multiselect && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone.IconDone, {
|
89
90
|
size: sizeToIconSize.sizeToIconSize(size, variant),
|
90
91
|
color: "inherit"
|
91
|
-
})), contentLeft && /*#__PURE__*/React.createElement(Item_styles.StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(Item_styles.StyledText, null, label), contentRight && /*#__PURE__*/React.createElement(Item_styles.StyledContentRight, null, contentRight), !isEmpty.isEmpty(item.items) && /*#__PURE__*/React.createElement(Item_styles.DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRightCentered.IconDisclosureRightCentered, {
|
92
|
+
})), contentLeft && /*#__PURE__*/React.createElement(Item_styles.StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(Item_styles.StyledText, null, renderItem && renderItem(value, label) || label), contentRight && /*#__PURE__*/React.createElement(Item_styles.StyledContentRight, null, contentRight), !isEmpty.isEmpty(item.items) && /*#__PURE__*/React.createElement(Item_styles.DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRightCentered.IconDisclosureRightCentered, {
|
92
93
|
size: sizeToIconSize.sizeToIconSize(size, variant),
|
93
94
|
color: "inherit"
|
94
95
|
})));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Item.js","sources":["../../../../../../../src/components/Select/elements/Inner/elements/Item/Item.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC, useContext } from 'react';\n\nimport { sizeToIconSize } from '../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { IconDisclosureRightCentered, IconDone } from '../../../../../_Icon';\nimport { Context } from '../../../../Select';\n\nimport { ItemProps } from './Item.types';\nimport {\n StyledContentLeft,\n StyledContentRight,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n StyledCheckbox,\n IconWrapper,\n StyledIndicator,\n} from './Item.styles';\n\nexport const Item: FC<ItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n itemRole,\n}) => {\n const { value, label, disabled, isDisabled, contentLeft, contentRight } = item;\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {
|
1
|
+
{"version":3,"file":"Item.js","sources":["../../../../../../../src/components/Select/elements/Inner/elements/Item/Item.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC, useContext } from 'react';\n\nimport { sizeToIconSize } from '../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { IconDisclosureRightCentered, IconDone } from '../../../../../_Icon';\nimport { Context } from '../../../../Select';\n\nimport { ItemProps } from './Item.types';\nimport {\n StyledContentLeft,\n StyledContentRight,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n StyledCheckbox,\n IconWrapper,\n StyledIndicator,\n} from './Item.styles';\n\nexport const Item: FC<ItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n itemRole,\n}) => {\n const { value, label, disabled, isDisabled, contentLeft, contentRight } = item;\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n } = useContext(Context);\n\n const isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled || isDisabled) return;\n\n e.stopPropagation();\n\n handleCheckboxChange(item);\n };\n\n const handleClick = (e: React.MouseEvent<HTMLElement>) => {\n if (disabled || isDisabled) return;\n\n handleItemClick(item, e);\n };\n\n return (\n <Wrapper\n className={cx(isDisabledClassName, focusedClass, activeClass)}\n id={value.toString()}\n ref={ref}\n onClick={handleClick}\n variant={variant}\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n role={itemRole}\n >\n <IconWrapper variant={variant}>\n {multiselect && (\n <span onClick={(e) => e.stopPropagation()}>\n <StyledCheckbox\n checked={Boolean(checked.get(item.value))}\n indeterminate={checked.get(item.value) === 'indeterminate'}\n onChange={handleChange}\n className={classes.selectItemCheckbox}\n />\n </span>\n )}\n\n {!multiselect && checked.get(item.value) === 'dot' && <StyledIndicator size=\"s\" view=\"default\" />}\n\n {!multiselect && checked.get(item.value) === 'done' && (\n <IconDone size={sizeToIconSize(size, variant)} color=\"inherit\" />\n )}\n </IconWrapper>\n\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n\n <StyledText>{(renderItem && renderItem(value, label)) || label}</StyledText>\n\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n\n {!isEmpty(item.items) && (\n <DisclosureIconWrapper>\n <IconDisclosureRightCentered size={sizeToIconSize(size, variant)} color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n );\n};\n"],"names":["Item","_ref","item","path","currentLevel","index","ariaControls","ariaExpanded","ariaLevel","ariaLabel","itemRole","value","label","disabled","isDisabled","contentLeft","contentRight","ref","useRef","_useContext","useContext","Context","focusedPath","checked","multiselect","size","handleCheckboxChange","handleItemClick","variant","renderItem","isDisabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useEffect","current","scrollIntoView","behavior","block","inline","handleChange","e","stopPropagation","handleClick","React","createElement","Wrapper","className","cx","id","toString","onClick","role","IconWrapper","StyledCheckbox","Boolean","get","indeterminate","onChange","selectItemCheckbox","_StyledIndicator","StyledIndicator","view","IconDone","sizeToIconSize","color","StyledContentLeft","StyledText","StyledContentRight","isEmpty","items","DisclosureIconWrapper","IconDisclosureRightCentered"],"mappings":";;;;;;;;;;;;;;;;IAoBaA,IAAmB,GAAG,SAAtBA,IAAmBA,CAAAC,IAAA,EAU1B;AAAA,EAAA,IATFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,OAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,SAAS,GAAAR,IAAA,CAATQ,SAAS;IACTC,QAAQ,GAAAT,IAAA,CAARS,QAAQ,CAAA;AAER,EAAA,IAAQC,KAAK,GAA6DT,IAAI,CAAtES,KAAK;IAAEC,KAAK,GAAsDV,IAAI,CAA/DU,KAAK;IAAEC,QAAQ,GAA4CX,IAAI,CAAxDW,QAAQ;IAAEC,UAAU,GAAgCZ,IAAI,CAA9CY,UAAU;IAAEC,WAAW,GAAmBb,IAAI,CAAlCa,WAAW;IAAEC,YAAY,GAAKd,IAAI,CAArBc,YAAY,CAAA;AACrE,EAAA,IAAMC,GAAG,GAAGC,YAAM,CAAuB,IAAI,CAAC,CAAA;AAE9C,EAAA,IAAAC,WAAA,GASIC,gBAAU,CAACC,cAAO,CAAC;IARnBC,WAAW,GAAAH,WAAA,CAAXG,WAAW;IACXC,OAAO,GAAAJ,WAAA,CAAPI,OAAO;IACPC,WAAW,GAAAL,WAAA,CAAXK,WAAW;IACXC,IAAI,GAAAN,WAAA,CAAJM,IAAI;IACJC,oBAAoB,GAAAP,WAAA,CAApBO,oBAAoB;IACpBC,eAAe,GAAAR,WAAA,CAAfQ,eAAe;IACfC,OAAO,GAAAT,WAAA,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PURE__*/react.styled(_exp())({
|
|
22
22
|
});
|
23
23
|
var mergedIndicatorConfig = /*#__PURE__*/common.mergeConfig(Indicator$1.indicatorConfig);
|
24
24
|
var Indicator = /*#__PURE__*/common.component(mergedIndicatorConfig);
|
25
|
-
var
|
25
|
+
var _exp12 = function _exp12() {
|
26
26
|
return Indicator;
|
27
27
|
};
|
28
|
-
var StyledIndicator = /*#__PURE__*/react.styled(
|
28
|
+
var StyledIndicator = /*#__PURE__*/react.styled(_exp12())({
|
29
29
|
name: "StyledIndicator",
|
30
30
|
"class": "sywiq3e",
|
31
31
|
propsAsIs: true
|
@@ -45,19 +45,19 @@ var DisclosureIconWrapper = /*#__PURE__*/react.styled('div')({
|
|
45
45
|
"class": "dbxrye",
|
46
46
|
propsAsIs: false
|
47
47
|
});
|
48
|
-
var
|
48
|
+
var _exp20 = function _exp20() {
|
49
49
|
return function (_ref) {
|
50
50
|
var variant = _ref.variant;
|
51
51
|
return "var(".concat(variant === 'tight' ? Select_tokens.tokens.itemIconSizeTight : Select_tokens.tokens.itemIconSize, ")");
|
52
52
|
};
|
53
53
|
};
|
54
|
-
var
|
54
|
+
var _exp24 = function _exp24() {
|
55
55
|
return function (_ref2) {
|
56
56
|
var variant = _ref2.variant;
|
57
57
|
return "var(".concat(variant === 'tight' ? Select_tokens.tokens.checkboxTriggerSizeTight : Select_tokens.tokens.checkboxTriggerSize, ")");
|
58
58
|
};
|
59
59
|
};
|
60
|
-
var
|
60
|
+
var _exp25 = function _exp25() {
|
61
61
|
return function (_ref3) {
|
62
62
|
var variant = _ref3.variant;
|
63
63
|
return "var(".concat(variant === 'tight' ? Select_tokens.tokens.checkboxTriggerBorderRadiusTight : Select_tokens.tokens.checkboxTriggerBorderRadius, ")");
|
@@ -68,9 +68,9 @@ var IconWrapper = /*#__PURE__*/react.styled('div')({
|
|
68
68
|
"class": "ijzon79",
|
69
69
|
propsAsIs: false,
|
70
70
|
vars: {
|
71
|
-
"ijzon79-0": [/*#__PURE__*/
|
72
|
-
"ijzon79-1": [/*#__PURE__*/
|
73
|
-
"ijzon79-2": [/*#__PURE__*/
|
71
|
+
"ijzon79-0": [/*#__PURE__*/_exp20()],
|
72
|
+
"ijzon79-1": [/*#__PURE__*/_exp24()],
|
73
|
+
"ijzon79-2": [/*#__PURE__*/_exp25()]
|
74
74
|
}
|
75
75
|
});
|
76
76
|
var StyledText = /*#__PURE__*/react.styled('div')({
|
@@ -78,7 +78,7 @@ var StyledText = /*#__PURE__*/react.styled('div')({
|
|
78
78
|
"class": "s1vkcneb",
|
79
79
|
propsAsIs: false
|
80
80
|
});
|
81
|
-
var
|
81
|
+
var _exp28 = function _exp28() {
|
82
82
|
return function (_ref4) {
|
83
83
|
var variant = _ref4.variant;
|
84
84
|
return "var(".concat(variant === 'tight' ? Select_tokens.tokens.itemPaddingTight : Select_tokens.tokens.itemPadding, ")");
|
@@ -89,7 +89,7 @@ var Wrapper = /*#__PURE__*/react.styled('li')({
|
|
89
89
|
"class": "w1nwrhpk",
|
90
90
|
propsAsIs: false,
|
91
91
|
vars: {
|
92
|
-
"w1nwrhpk-0": [/*#__PURE__*/
|
92
|
+
"w1nwrhpk-0": [/*#__PURE__*/_exp28()]
|
93
93
|
}
|
94
94
|
});
|
95
95
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Item.styles.js","sources":["../../../../../../../src/components/Select/elements/Inner/elements/Item/Item.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens, constants } from '../../../../Select.tokens';\nimport { addFocus, applyEllipsis } from '../../../../../../mixins';\nimport { component, mergeConfig } from '../../../../../../engines';\nimport { checkboxConfig } from '../../../../../Checkbox';\nimport { indicatorConfig, indicatorTokens } from '../../../../../Indicator';\nimport type { SelectProps } from '../../../../Select.types';\n\nconst mergedCheckboxConfig = mergeConfig(checkboxConfig);\nconst Checkbox = component(mergedCheckboxConfig);\n\nexport const StyledCheckbox = styled(Checkbox)`\n
|
1
|
+
{"version":3,"file":"Item.styles.js","sources":["../../../../../../../src/components/Select/elements/Inner/elements/Item/Item.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens, constants } from '../../../../Select.tokens';\nimport { addFocus, applyEllipsis } from '../../../../../../mixins';\nimport { component, mergeConfig } from '../../../../../../engines';\nimport { checkboxConfig, checkboxTokens } from '../../../../../Checkbox';\nimport { indicatorConfig, indicatorTokens } from '../../../../../Indicator';\nimport type { SelectProps } from '../../../../Select.types';\n\nconst mergedCheckboxConfig = mergeConfig(checkboxConfig);\nconst Checkbox = component(mergedCheckboxConfig);\n\nexport const StyledCheckbox = styled(Checkbox)`\n ${checkboxTokens.triggerSize}: var(${tokens.checkboxTriggerSize});\n ${checkboxTokens.triggerBorderRadius}: var(${tokens.checkboxTriggerBorderRadius});\n ${checkboxTokens.fillColor}: var(${tokens.checkboxFillColor});\n ${checkboxTokens.iconColor}: var(${tokens.checkboxIconColor});\n ${checkboxTokens.triggerBorderColor}: var(${tokens.checkboxTriggerBorderColor});\n`;\n\nconst mergedIndicatorConfig = mergeConfig(indicatorConfig);\nconst Indicator = component(mergedIndicatorConfig);\n\nexport const StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.indicatorSize});\n ${indicatorTokens.color}: var(${tokens.checkboxFillColor});\n`;\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n`;\n\nexport const DisclosureIconWrapper = styled.div`\n line-height: 0;\n color: var(${constants.disclosureIconColor});\n\n &:hover {\n color: var(${constants.disclosureIconColorHover});\n }\n`;\n\nexport const IconWrapper = styled.div<{ variant: SelectProps['variant'] }>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`};\n height: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`};\n margin: var(${tokens.itemIconMargin});\n line-height: 0;\n color: var(${tokens.checkboxFillColor});\n\n & .${classes.selectItemCheckbox} {\n --plasma-checkbox-trigger-size: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.checkboxTriggerSizeTight : tokens.checkboxTriggerSize})`};\n --plasma-checkbox-trigger-border-radius: ${({ variant }) =>\n `var(${\n variant === 'tight' ? tokens.checkboxTriggerBorderRadiusTight : tokens.checkboxTriggerBorderRadius\n })`};\n }\n`;\n\nexport const StyledText = styled.div`\n ${applyEllipsis()};\n flex: 1;\n`;\n\nexport const Wrapper = styled.li<{ variant: SelectProps['variant'] }>`\n display: flex;\n align-items: center;\n min-height: var(${tokens.itemHeight});\n margin: 0;\n box-sizing: content-box;\n padding: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding})`};\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n background: var(${constants.itemBackground});\n color: var(--text-primary);\n border-radius: var(${tokens.itemBorderRadius});\n user-select: none;\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsActive} {\n background: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${constants.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n customFocusRules: `\n &.${classes.dropdownItemIsFocused}:before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(${constants.focusColor});\n }\n `,\n })};\n`;\n"],"names":["mergedCheckboxConfig","mergeConfig","checkboxConfig","Checkbox","component","_exp","StyledCheckbox","styled","name","class","propsAsIs","mergedIndicatorConfig","indicatorConfig","Indicator","_exp12","StyledIndicator","StyledContentLeft","StyledContentRight","DisclosureIconWrapper","_exp20","_ref","variant","tokens","itemIconSizeTight","itemIconSize","_exp24","_ref2","checkboxTriggerSizeTight","checkboxTriggerSize","_exp25","_ref3","checkboxTriggerBorderRadiusTight","checkboxTriggerBorderRadius","IconWrapper","vars","StyledText","_exp28","_ref4","itemPaddingTight","itemPadding","Wrapper"],"mappings":";;;;;;;;;;;AASA,IAAMA,oBAAoB,gBAAGC,kBAAW,CAACC,yBAAc,CAAC,CAAA;AACxD,IAAMC,QAAQ,gBAAGC,gBAAS,CAACJ,oBAAoB,CAAC,CAAA;AAAC,IAAAK,IAAA,GAT/BA,SAS+BA,IAAAA,GAAA;AAAA,EAAA,OAEZF,QAAQ,CAAA;AAAA,CAAA,CAAA;AAAtC,IAAMG,cAAc,gBAAGC,YAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,gBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CAMnC,EAAA;AAED,IAAMC,qBAAqB,gBAAGV,kBAAW,CAACW,2BAAe,CAAC,CAAA;AAC1D,IAAMC,SAAS,gBAAGT,gBAAS,CAACO,qBAAqB,CAAC,CAAA;AAAC,IAAAG,MAAA,GApBjCA,SAoBiCA,MAAAA,GAAA;AAAA,EAAA,OAEbD,SAAS,CAAA;AAAA,CAAA,CAAA;AAAxC,IAAME,eAAe,gBAAGR,YAAM,CAAAO,MAAA,EAAA,CAAA,CAAA;AAAAN,EAAAA,IAAA,EAAA,iBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CAGpC,EAAA;AAEM,IAAMM,iBAAiB,gBAAGT,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,E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AAwB,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAMdE,MAA6F,EAAA,CAAA;AAAA,GAAA;AAAA,CA2C3G;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textfield.styles.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.styles.tsx"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { isEmpty } from '../../../../../../utils';\nimport { applyEllipsis, addFocus } from '../../../../../../mixins';\nimport { IconDisclosureDownCentered } from '../../../../../_Icon';\nimport { component, mergeConfig } from '../../../../../../engines';\nimport { buttonConfig, buttonTokens } from '../../../../../Button';\nimport { tokens, classes, constants } from '../../../../Select.tokens';\nimport type { SelectProps } from '../../../../Select.types';\n\nconst mergedButtonConfig = mergeConfig(buttonConfig);\nconst Button = component(mergedButtonConfig);\n\nexport const TextfieldWrapper = styled.div<{ opened: boolean; value: SelectProps['value'] }>`\n display: inline;\n\n .${classes.textfieldTarget} {\n background: ${({ opened }) =>\n opened\n ? `var(${tokens.targetTextfieldBackgroundColorOpened})`\n : `var(${tokens.targetTextfieldBackgroundColor})`};\n padding: ${({ value }) =>\n Array.isArray(value) && !isEmpty(value)\n ? `0 var(${tokens.targetTextfieldChipPadding})`\n : `0 var(${tokens.targetTextfieldPadding})`};\n }\n\n .${classes.selectWithoutBoxShadow}::before {\n box-shadow: none !important;\n }\n`;\n\nexport const
|
1
|
+
{"version":3,"file":"Textfield.styles.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.styles.tsx"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { isEmpty } from '../../../../../../utils';\nimport { applyEllipsis, addFocus } from '../../../../../../mixins';\nimport { IconDisclosureDownCentered } from '../../../../../_Icon';\nimport { component, mergeConfig } from '../../../../../../engines';\nimport { buttonConfig, buttonTokens } from '../../../../../Button';\nimport { tokens, classes, constants } from '../../../../Select.tokens';\nimport type { SelectProps } from '../../../../Select.types';\n\nconst mergedButtonConfig = mergeConfig(buttonConfig);\nconst Button = component(mergedButtonConfig);\n\nexport const TextfieldWrapper = styled.div<{ opened: boolean; value: SelectProps['value'] }>`\n display: inline;\n\n .${classes.textfieldTarget} {\n background: ${({ opened }) =>\n opened\n ? `var(${tokens.targetTextfieldBackgroundColorOpened})`\n : `var(${tokens.targetTextfieldBackgroundColor})`};\n padding: ${({ value }) =>\n Array.isArray(value) && !isEmpty(value)\n ? `0 var(${tokens.targetTextfieldChipPadding})`\n : `0 var(${tokens.targetTextfieldPadding})`};\n }\n\n .${classes.selectWithoutBoxShadow}::before {\n box-shadow: none !important;\n }\n`;\n\nexport const StyledButton = styled(Button)`\n ${buttonTokens.buttonColor}: var(${constants.textfieldTargetColor});\n ${buttonTokens.buttonColorHover}: var(${constants.textfieldTargetColor});\n ${buttonTokens.buttonColorActive}: var(${constants.textfieldTargetColor});\n ${buttonTokens.buttonBackgroundColor}: var(${tokens.targetTextfieldBackgroundColor});\n ${buttonTokens.buttonHeight}: var(${tokens.targetHeight});\n ${buttonTokens.buttonWidth}: 100%;\n ${buttonTokens.buttonPadding}: var(${tokens.targetTextfieldPadding});\n ${buttonTokens.buttonRadius}: var(${tokens.borderRadius});\n ${buttonTokens.buttonFontFamily}: var(${tokens.fontFamily});\n ${buttonTokens.buttonFontSize}: var(${tokens.fontSize});\n ${buttonTokens.buttonFontStyle}: var(${tokens.fontStyle});\n ${buttonTokens.buttonFontWeight}:var(${tokens.fontWeight});\n ${buttonTokens.buttonLetterSpacing}: var(${tokens.fontLetterSpacing});\n ${buttonTokens.buttonLineHeight}: var(${tokens.fontLineHeight});\n ${buttonTokens.buttonDisabledOpacity}: 0.4;\n ${buttonTokens.buttonFocusColor}: var(${constants.focusColor});\n\n ${addFocus({\n outlineOffset: `calc(var(${tokens.focusOffset}) * -1)`,\n outlineSize: constants.focusSize,\n outlineRadius: `calc(var(${tokens.borderRadius}) + var(${tokens.focusOffset}))`,\n outlineColor: constants.focusColor,\n })}\n`;\n\nexport const StyledArrow = styled(IconDisclosureDownCentered)``;\n\nexport const IconArrowWrapper = styled.div`\n line-height: 0;\n margin: var(${tokens.targetTextfieldArrowMargin});\n color: var(${tokens.targetTextfieldArrowColor});\n\n &:hover {\n color: var(${tokens.targetTextfieldArrowColorHover});\n }\n\n &:active {\n color: var(${tokens.targetTextfieldArrowColorActive});\n }\n`;\n\nexport const Wrapper = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n .${classes.arrowInverse} {\n transform: rotate(-180deg);\n }\n`;\n\nexport const ChipWrapper = styled.div`\n width: 100%;\n display: flex;\n min-width: 0;\n padding: calc(${constants.focusSize} + var(${tokens.focusOffset}));\n gap: 0.25rem;\n overflow-x: scroll;\n border-top-right-radius: var(${tokens.chipBorderRadius});\n border-bottom-right-radius: var(${tokens.chipBorderRadius});\n\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nexport const Label = styled.label`\n color: var(${constants.textfieldInnerLabelColor});\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n\nexport const Placeholder = styled.div`\n color: var(${constants.textfieldPlaceholderColor});\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n\nexport const InnerLabelWrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: start;\n row-gap: var(${tokens.innerLabelGap});\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n\nexport const InnerLabel = styled.label`\n color: var(${constants.textfieldInnerLabelColor});\n font-family: var(--plasma-typo-body-xs-font-family);\n font-size: var(--plasma-typo-body-xs-font-size);\n font-style: var(--plasma-typo-body-xs-font-style);\n font-weight: var(--plasma-typo-body-xs-font-weight);\n letter-spacing: var(--plasma-typo-body-xs-letter-spacing);\n line-height: var(--plasma-typo-body-xs-line-height);\n text-align: left;\n`;\n\nexport const ContentLeftWrapper = styled.div`\n flex: none;\n margin-left: -2px;\n margin-right: 6px;\n`;\n\nexport const Value = styled.span`\n ${applyEllipsis()}\n`;\n"],"names":["mergedButtonConfig","mergeConfig","buttonConfig","Button","component","_exp2","_ref","opened","concat","tokens","targetTextfieldBackgroundColorOpened","targetTextfieldBackgroundColor","_exp3","_ref2","value","Array","isArray","isEmpty","targetTextfieldChipPadding","targetTextfieldPadding","TextfieldWrapper","styled","name","class","propsAsIs","vars","_exp5","StyledButton","_exp37","IconDisclosureDownCentered","StyledArrow","IconArrowWrapper","Wrapper","ChipWrapper","Label","Placeholder","InnerLabelWrapper","InnerLabel","ContentLeftWrapper","Value"],"mappings":";;;;;;;;;;;;;;AAUA,IAAMA,kBAAkB,gBAAGC,kBAAW,CAACC,qBAAY,CAAC,CAAA;AACpD,IAAMC,MAAM,gBAAGC,gBAAS,CAACJ,kBAAkB,CAAC,CAAA;AAAC,IAAAK,KAAA,GAV3BA,SAU2BA,KAAAA,GAAA;AAAA,EAAA,OAMvB,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,MAAAA,GAAAA,IAAAA,CAAAA,MAAAA,CAAAA;AAAAA,IAAAA,OACbA,MAAM,GAAA,MAAA,CAAAC,MAAA,CACOC,oBAAM,CAACC,oCAAqC,EAAA,GAAA,CAAA,GAAA,MAAA,CAAAF,MAAA,CAC5CC,oBAAM,CAACE,8BAA+B,EAAE,GAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,KAAA,GAnB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AAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAS/B,EAAA;AAEM,IAAMc,kBAAkB,gBAAGjB,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,oBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAIvC,EAAA;AAEM,IAAMe,KAAK,gBAAGlB,YAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,OAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE1B;;;;;;;;;;;;;;;"}
|
@@ -20,7 +20,7 @@ import { OuterLabel, StyledPopover, Ul, HelperText, base } from './Select.styles
|
|
20
20
|
import { base as base$1 } from './variations/_view/base.js';
|
21
21
|
import { base as base$2 } from './variations/_size/base.js';
|
22
22
|
|
23
|
-
var _excluded = ["value", "onChange", "target", "separator", "items", "placement", "label", "labelPlacement", "placeholder", "helperText", "isTargetAmount", "disabled", "view", "size", "isOpen", "listOverflow", "listHeight", "listWidth", "status", "contentLeft", "onScrollBottom", "isInfiniteLoading", "notFoundContent", "chipView", "variant", "portal", "renderValue"];
|
23
|
+
var _excluded = ["value", "onChange", "target", "separator", "items", "placement", "label", "labelPlacement", "placeholder", "helperText", "isTargetAmount", "disabled", "view", "size", "isOpen", "listOverflow", "listHeight", "listWidth", "status", "contentLeft", "onScrollBottom", "isInfiniteLoading", "notFoundContent", "chipView", "variant", "portal", "renderValue", "renderItem"];
|
24
24
|
var Context = /*#__PURE__*/createContext({});
|
25
25
|
|
26
26
|
/**
|
@@ -58,6 +58,7 @@ var selectRoot = function selectRoot(Root) {
|
|
58
58
|
variant = _props$variant === void 0 ? 'normal' : _props$variant,
|
59
59
|
portal = props.portal,
|
60
60
|
renderValue = props.renderValue,
|
61
|
+
renderItem = props.renderItem,
|
61
62
|
rest = _objectWithoutProperties(props, _excluded);
|
62
63
|
var multiselect = Array.isArray(value);
|
63
64
|
var transformedItems = useMemo(function () {
|
@@ -218,7 +219,8 @@ var selectRoot = function selectRoot(Root) {
|
|
218
219
|
size: size,
|
219
220
|
handleCheckboxChange: handleCheckboxChange,
|
220
221
|
handleItemClick: handleItemClick,
|
221
|
-
variant: variant
|
222
|
+
variant: variant,
|
223
|
+
renderItem: renderItem
|
222
224
|
}
|
223
225
|
}, /*#__PURE__*/React.createElement(StyledPopover, {
|
224
226
|
ref: targetRef,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { isEmpty } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\nimport { getPlacements } from '../Dropdown/utils';\n\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, getView } from './utils';\nimport { Inner } from './elements/Inner/Inner';\nimport { Target } from './elements/Target/Target';\nimport { pathReducer, focusedPathReducer, focusedChipIndexReducer } from './reducers';\nimport { usePathMaps } from './hooks/usePathMaps';\nimport { StyledPopover, Ul, base, OuterLabel, HelperText } from './Select.styles';\nimport type { SelectProps, ItemContext } from './Select.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { ItemOptionTransformed } from './elements/Inner/elements/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список. Поддерживает выбор одного или нескольких значений.\n */\nexport const selectRoot = (Root: RootProps<HTMLButtonElement, SelectProps>) =>\n forwardRef<HTMLButtonElement, SelectProps>((props, ref) => {\n const {\n value,\n onChange,\n target = 'textfield',\n separator,\n items,\n placement = 'bottom',\n label,\n labelPlacement = 'outer',\n placeholder,\n helperText,\n isTargetAmount = false,\n disabled = false,\n view,\n size,\n isOpen,\n listOverflow,\n listHeight,\n listWidth,\n status,\n contentLeft,\n onScrollBottom,\n isInfiniteLoading,\n notFoundContent,\n chipView,\n variant = 'normal',\n portal,\n renderValue,\n ...rest\n } = props;\n\n const multiselect = Array.isArray(value);\n\n const transformedItems = useMemo(() => initialItemsTransform(items), [items]);\n\n const [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] = usePathMaps(transformedItems);\n\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [focusedChipIndex, dispatchFocusedChipIndex] = useReducer(focusedChipIndexReducer, null);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const targetRef = useOutsideClick(() => {\n if (focusedChipIndex != null) {\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n });\n\n const handleToggle = (opened: boolean) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n };\n\n const handleCheckboxChange = (item: ItemOptionTransformed) => {\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value.toString())) {\n checkedCopy.set(item.value.toString(), true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value.toString(), false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value.toString());\n }\n });\n\n onChange(newValues as any);\n };\n\n const handleItemClick = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item?.items)) {\n if (multiselect) {\n handleCheckboxChange(item);\n } else {\n if (e) {\n e.stopPropagation();\n }\n\n const checkedCopy = new Map(checked);\n\n const isCurrentChecked = checkedCopy.get(item.value);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isCurrentChecked) {\n checkedCopy.set(item.value, 'done');\n updateSingleAncestors(item, checkedCopy, 'dot');\n }\n\n onChange((isCurrentChecked ? '' : item.value) as any);\n }\n }\n };\n\n const handleChipClick = (currentValue: string) => {\n handleCheckboxChange(valueToItemMap.get(currentValue)!);\n };\n\n const handlePressDown = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (multiselect) {\n handleCheckboxChange(item);\n }\n };\n\n const handleScroll = (e: React.UIEvent<HTMLUListElement>) => {\n if (!onScrollBottom) return;\n\n const { target } = e;\n\n if (\n (target as HTMLElement).scrollHeight - (target as HTMLElement).scrollTop ===\n (target as HTMLElement).clientHeight\n ) {\n onScrollBottom(e);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleToggle,\n handlePressDown,\n focusedChipIndex,\n dispatchFocusedChipIndex,\n value,\n valueToItemMap,\n multiselect,\n isTargetAmount,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n // В данном эффекте мы следим за изменениями value и вносим коррективы в дерево чекбоксов.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value)) {\n if (multiselect && Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value as string, 'done');\n updateSingleAncestors(valueToItemMap.get(value as string)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n }, [value]);\n\n return (\n <Root\n ref={ref}\n size={size}\n view={getView(view, status)}\n chipView={chipView}\n items={items}\n {...(rest as any)}\n >\n {label && labelPlacement === 'outer' && target !== 'button' && <OuterLabel>{label}</OuterLabel>}\n\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n }}\n >\n <StyledPopover\n ref={targetRef}\n isOpen={isCurrentListOpen}\n placement={getPlacements(placement)}\n usePortal={Boolean(portal)}\n frame={portal}\n onToggle={handleToggle}\n trigger=\"click\"\n target={\n <Target\n opened={isCurrentListOpen}\n target={target}\n value={value}\n isTargetAmount={isTargetAmount}\n multiselect={multiselect}\n valueToItemMap={valueToItemMap}\n focusedPath={focusedPath}\n focusedToValueMap={focusedToValueMap}\n onChipClick={handleChipClick}\n label={label}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n focusedChipIndex={focusedChipIndex}\n labelPlacement={labelPlacement}\n size={size}\n contentLeft={contentLeft}\n disabled={disabled}\n renderValue={renderValue}\n />\n }\n preventOverflow={false}\n closeOnOverlayClick\n >\n {notFoundContent || (\n <Ul\n role=\"tree\"\n id=\"tree_level_1\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n onScroll={handleScroll}\n listWidth={listWidth}\n >\n {transformedItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n )}\n </StyledPopover>\n </Context.Provider>\n\n {helperText && target === 'textfield' && <HelperText>{helperText}</HelperText>}\n </Root>\n );\n });\n\nexport const selectConfig = {\n name: 'Select',\n tag: 'div',\n layout: selectRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n chipView: 'default',\n size: 'm',\n },\n};\n"],"names":["Context","createContext","selectRoot","Root","forwardRef","props","ref","value","onChange","_props$target","target","items","_props$placement","placement","label","_props$labelPlacement","labelPlacement","placeholder","helperText","_props$isTargetAmount","isTargetAmount","_props$disabled","disabled","view","size","listOverflow","listHeight","listWidth","status","contentLeft","onScrollBottom","notFoundContent","chipView","_props$variant","variant","portal","renderValue","rest","_objectWithoutProperties","_excluded","multiselect","Array","isArray","transformedItems","useMemo","initialItemsTransform","_usePathMaps","usePathMaps","_usePathMaps2","_slicedToArray","pathMap","focusedToValueMap","valueToCheckedMap","valueToItemMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useReducer5","focusedChipIndexReducer","_useReducer6","focusedChipIndex","dispatchFocusedChipIndex","_useState","useState","_useState2","checked","setChecked","targetRef","useOutsideClick","type","handleToggle","opened","handleCheckboxChange","item","checkedCopy","Map","get","toString","set","updateDescendants","updateAncestors","newValues","forEach","key","push","handleItemClick","e","isEmpty","stopPropagation","isCurrentChecked","_","updateSingleAncestors","handleChipClick","currentValue","handlePressDown","handleScroll","scrollHeight","scrollTop","clientHeight","_useKeyNavigation","useKeyNavigation","onKeyDown","isCurrentListOpen","Boolean","useLayoutEffect","val","React","createElement","_extends","getView","OuterLabel","Provider","StyledPopover","isOpen","getPlacements","usePortal","frame","onToggle","trigger","Target","onChipClick","preventOverflow","closeOnOverlayClick","Ul","role","id","onScroll","map","index","Inner","concat","currentLevel","HelperText","selectConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;IAmBaA,OAAO,gBAAGC,aAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACtEC,UAAU,CAAiC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACvD,IAAA,IACIC,KAAK,GA4BLF,KAAK,CA5BLE,KAAK,CAAA;MACLC,QAAQ,GA2BRH,KAAK,CA3BLG,QAAQ,CAAA;MAAAC,aAAA,GA2BRJ,KAAK,CA1BLK,MAAM,CAAA;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GA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EAAAA,UAAuB,CAC3E,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAM2H,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE9I,UAAU;AAClB+I,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACR3H,IAAAA,IAAI,EAAE;AACF4H,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACD5H,IAAAA,IAAI,EAAE;AACF2H,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN/H,IAAAA,IAAI,EAAE,SAAS;AACfS,IAAAA,QAAQ,EAAE,SAAS;AACnBR,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer, useMemo, createContext, useLayoutEffect } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { isEmpty } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\nimport { getPlacements } from '../Dropdown/utils';\n\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, getView } from './utils';\nimport { Inner } from './elements/Inner/Inner';\nimport { Target } from './elements/Target/Target';\nimport { pathReducer, focusedPathReducer, focusedChipIndexReducer } from './reducers';\nimport { usePathMaps } from './hooks/usePathMaps';\nimport { StyledPopover, Ul, base, OuterLabel, HelperText } from './Select.styles';\nimport type { SelectProps, ItemContext } from './Select.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { ItemOptionTransformed } from './elements/Inner/elements/Item/Item.types';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список. Поддерживает выбор одного или нескольких значений.\n */\nexport const selectRoot = (Root: RootProps<HTMLButtonElement, SelectProps>) =>\n forwardRef<HTMLButtonElement, SelectProps>((props, ref) => {\n const {\n value,\n onChange,\n target = 'textfield',\n separator,\n items,\n placement = 'bottom',\n label,\n labelPlacement = 'outer',\n placeholder,\n helperText,\n isTargetAmount = false,\n disabled = false,\n view,\n size,\n isOpen,\n listOverflow,\n listHeight,\n listWidth,\n status,\n contentLeft,\n onScrollBottom,\n isInfiniteLoading,\n notFoundContent,\n chipView,\n variant = 'normal',\n portal,\n renderValue,\n renderItem,\n ...rest\n } = props;\n\n const multiselect = Array.isArray(value);\n\n const transformedItems = useMemo(() => initialItemsTransform(items), [items]);\n\n const [pathMap, focusedToValueMap, valueToCheckedMap, valueToItemMap] = usePathMaps(transformedItems);\n\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n const [focusedChipIndex, dispatchFocusedChipIndex] = useReducer(focusedChipIndexReducer, null);\n const [checked, setChecked] = useState(valueToCheckedMap);\n\n const targetRef = useOutsideClick(() => {\n if (focusedChipIndex != null) {\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n });\n\n const handleToggle = (opened: boolean) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n dispatchFocusedChipIndex({ type: 'reset' });\n }\n };\n\n const handleCheckboxChange = (item: ItemOptionTransformed) => {\n const checkedCopy = new Map(checked);\n\n if (!checkedCopy.get(item.value.toString())) {\n checkedCopy.set(item.value.toString(), true);\n updateDescendants(item, checkedCopy, true);\n } else {\n checkedCopy.set(item.value.toString(), false);\n updateDescendants(item, checkedCopy, false);\n }\n\n updateAncestors(item, checkedCopy);\n\n const newValues: Array<string> = [];\n\n valueToItemMap.forEach((item, key) => {\n if (checkedCopy.get(key)) {\n newValues.push(item.value.toString());\n }\n });\n\n onChange(newValues as any);\n };\n\n const handleItemClick = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item?.items)) {\n if (multiselect) {\n handleCheckboxChange(item);\n } else {\n if (e) {\n e.stopPropagation();\n }\n\n const checkedCopy = new Map(checked);\n\n const isCurrentChecked = checkedCopy.get(item.value);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isCurrentChecked) {\n checkedCopy.set(item.value, 'done');\n updateSingleAncestors(item, checkedCopy, 'dot');\n }\n\n onChange((isCurrentChecked ? '' : item.value) as any);\n }\n }\n };\n\n const handleChipClick = (currentValue: string) => {\n handleCheckboxChange(valueToItemMap.get(currentValue)!);\n };\n\n const handlePressDown = (item: ItemOptionTransformed, e?: React.MouseEvent<HTMLElement>) => {\n if (isEmpty(item.items)) {\n handleItemClick(item, e);\n } else if (multiselect) {\n handleCheckboxChange(item);\n }\n };\n\n const handleScroll = (e: React.UIEvent<HTMLUListElement>) => {\n if (!onScrollBottom) return;\n\n const { target } = e;\n\n if (\n (target as HTMLElement).scrollHeight - (target as HTMLElement).scrollTop ===\n (target as HTMLElement).clientHeight\n ) {\n onScrollBottom(e);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleToggle,\n handlePressDown,\n focusedChipIndex,\n dispatchFocusedChipIndex,\n value,\n valueToItemMap,\n multiselect,\n isTargetAmount,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n // В данном эффекте мы следим за изменениями value и вносим коррективы в дерево чекбоксов.\n useLayoutEffect(() => {\n const checkedCopy = new Map(checked);\n\n checkedCopy.forEach((_, key) => {\n checkedCopy.set(key, false);\n });\n\n if (!isEmpty(value)) {\n if (multiselect && Array.isArray(value)) {\n value.forEach((val) => {\n checkedCopy.set(val, true);\n updateDescendants(valueToItemMap.get(val)!, checkedCopy, true);\n updateAncestors(valueToItemMap.get(val)!, checkedCopy);\n });\n } else {\n checkedCopy.set(value as string, 'done');\n updateSingleAncestors(valueToItemMap.get(value as string)!, checkedCopy, 'dot');\n }\n }\n\n setChecked(checkedCopy);\n }, [value]);\n\n return (\n <Root\n ref={ref}\n size={size}\n view={getView(view, status)}\n chipView={chipView}\n items={items}\n {...(rest as any)}\n >\n {label && labelPlacement === 'outer' && target !== 'button' && <OuterLabel>{label}</OuterLabel>}\n\n <Context.Provider\n value={{\n focusedPath,\n checked,\n multiselect,\n size,\n handleCheckboxChange,\n handleItemClick,\n variant,\n renderItem,\n }}\n >\n <StyledPopover\n ref={targetRef}\n isOpen={isCurrentListOpen}\n placement={getPlacements(placement)}\n usePortal={Boolean(portal)}\n frame={portal}\n onToggle={handleToggle}\n trigger=\"click\"\n target={\n <Target\n opened={isCurrentListOpen}\n target={target}\n value={value}\n isTargetAmount={isTargetAmount}\n multiselect={multiselect}\n valueToItemMap={valueToItemMap}\n focusedPath={focusedPath}\n focusedToValueMap={focusedToValueMap}\n onChipClick={handleChipClick}\n label={label}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n focusedChipIndex={focusedChipIndex}\n labelPlacement={labelPlacement}\n size={size}\n contentLeft={contentLeft}\n disabled={disabled}\n renderValue={renderValue}\n />\n }\n preventOverflow={false}\n closeOnOverlayClick\n >\n {notFoundContent || (\n <Ul\n role=\"tree\"\n id=\"tree_level_1\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n onScroll={handleScroll}\n listWidth={listWidth}\n >\n {transformedItems.map((item, index) => (\n <Inner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n )}\n </StyledPopover>\n </Context.Provider>\n\n {helperText && target === 'textfield' && <HelperText>{helperText}</HelperText>}\n </Root>\n );\n });\n\nexport const selectConfig = {\n name: 'Select',\n tag: 'div',\n layout: selectRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n chipView: 'default',\n size: 'm',\n },\n};\n"],"names":["Context","createContext","selectRoot","Root","forwardRef","props","ref","value","onChange","_props$target","target","items","_props$placement","placement","label","_props$labelPlacement","labelPlacement","placeholder","helperText","_props$isTargetAmount","isTargetAmount","_props$disabled","disabled","view","size","listOverflow","listHeight","listWidth","status","contentLeft","onScrollBottom","notFoundContent","chipView","_props$variant","variant","portal","renderValue","renderItem","rest","_objectWithoutProperties","_excluded","multiselect","Array","isArray","transformedItems","useMemo","initialItemsTransform","_usePathMaps","usePathMaps","_usePathMaps2","_slicedToArray","pathMap","focusedToValueMap","valueToCheckedMap","valueToItemMap","_useReducer","useReducer","pathReducer","_useReducer2","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useReducer5","focusedChipIndexReducer","_useReducer6","focusedChipIndex","dispatchFocusedChipIndex","_useState","useState","_useState2","checked","setChecked","targetRef","useOutsideClick","type","handleToggle","opened","handleCheckboxChange","item","checkedCopy","Map","get","toString","set","updateDescendants","updateAncestors","newValues","forEach","key","push","handleItemClick","e","isEmpty","stopPropagation","isCurrentChecked","_","updateSingleAncestors","handleChipClick","currentValue","handlePressDown","handleScroll","scrollHeight","scrollTop","clientHeight","_useKeyNavigation","useKeyNavigation","onKeyDown","isCurrentListOpen","Boolean","useLayoutEffect","val","React","createElement","_extends","getView","OuterLabel","Provider","StyledPopover","isOpen","getPlacements","usePortal","frame","onToggle","trigger","Target","onChipClick","preventOverflow","closeOnOverlayClick","Ul","role","id","onScroll","map","index","Inner","concat","currentLevel","HelperText","selectConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;IAmBaA,OAAO,gBAAGC,aAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA+C,EAAA;AAAA,EAAA,oBACtEC,UAAU,CAAiC,UAACC,KAAK,EAAE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AAY,EAAE,CAAE;AAChBjF,QAAAA,IAAI,EAAEA,IAAK;AACXC,QAAAA,YAAY,EAAEA,YAAa;AAC3B6E,QAAAA,KAAK,EAAEA,KAAM;AACb9G,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;AAAA,KACL,CACD,CAEG,CACD,CAAC,EAElBT,UAAU,IAAIR,MAAM,KAAK,WAAW,iBAAIyG,KAAA,CAAAC,aAAA,CAACyB,UAAU,EAAE3H,IAAAA,EAAAA,UAAuB,CAC3E,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAM4H,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE/I,UAAU;AAClBgJ,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACR5H,IAAAA,IAAI,EAAE;AACF6H,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACD7H,IAAAA,IAAI,EAAE;AACF4H,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNhI,IAAAA,IAAI,EAAE,SAAS;AACfS,IAAAA,QAAQ,EAAE,SAAS;AACnBR,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -34,7 +34,8 @@ var Item = function Item(_ref) {
|
|
34
34
|
size = _useContext.size,
|
35
35
|
handleCheckboxChange = _useContext.handleCheckboxChange,
|
36
36
|
handleItemClick = _useContext.handleItemClick,
|
37
|
-
variant = _useContext.variant
|
37
|
+
variant = _useContext.variant,
|
38
|
+
renderItem = _useContext.renderItem;
|
38
39
|
var isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;
|
39
40
|
var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? classes.dropdownItemIsFocused : undefined;
|
40
41
|
var activeClass = value === (path === null || path === void 0 ? void 0 : path[currentLevel + 1]) ? classes.dropdownItemIsActive : undefined;
|
@@ -84,7 +85,7 @@ var Item = function Item(_ref) {
|
|
84
85
|
}))), !multiselect && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone, {
|
85
86
|
size: sizeToIconSize(size, variant),
|
86
87
|
color: "inherit"
|
87
|
-
})), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(StyledText, null, label), contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), !isEmpty(item.items) && /*#__PURE__*/React.createElement(DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRightCentered, {
|
88
|
+
})), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(StyledText, null, renderItem && renderItem(value, label) || label), contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), !isEmpty(item.items) && /*#__PURE__*/React.createElement(DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRightCentered, {
|
88
89
|
size: sizeToIconSize(size, variant),
|
89
90
|
color: "inherit"
|
90
91
|
})));
|