@hh.ru/magritte-ui-select 12.4.15 → 12.4.17

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.
@@ -24,7 +24,7 @@ import '@hh.ru/magritte-common-use-disabled';
24
24
  import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
25
25
  import '@hh.ru/magritte-ui-checkbox-radio';
26
26
 
27
- var styles = {"select-bottom-sheet":"magritte-select-bottom-sheet___1RZDJ_12-4-15","selectBottomSheet":"magritte-select-bottom-sheet___1RZDJ_12-4-15","select-bottom-sheet_checkbox":"magritte-select-bottom-sheet_checkbox___hwTgo_12-4-15","selectBottomSheetCheckbox":"magritte-select-bottom-sheet_checkbox___hwTgo_12-4-15","select-bottom-sheet_radio":"magritte-select-bottom-sheet_radio___qvFFV_12-4-15","selectBottomSheetRadio":"magritte-select-bottom-sheet_radio___qvFFV_12-4-15","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_12-4-15","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_12-4-15","full-screen-placeholder":"magritte-full-screen-placeholder___zPC8k_12-4-15","fullScreenPlaceholder":"magritte-full-screen-placeholder___zPC8k_12-4-15","error-wrapper":"magritte-error-wrapper___P7jYg_12-4-15","errorWrapper":"magritte-error-wrapper___P7jYg_12-4-15"};
27
+ var styles = {"select-bottom-sheet":"magritte-select-bottom-sheet___1RZDJ_12-4-17","selectBottomSheet":"magritte-select-bottom-sheet___1RZDJ_12-4-17","select-bottom-sheet_checkbox":"magritte-select-bottom-sheet_checkbox___hwTgo_12-4-17","selectBottomSheetCheckbox":"magritte-select-bottom-sheet_checkbox___hwTgo_12-4-17","select-bottom-sheet_radio":"magritte-select-bottom-sheet_radio___qvFFV_12-4-17","selectBottomSheetRadio":"magritte-select-bottom-sheet_radio___qvFFV_12-4-17","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_12-4-17","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_12-4-17","full-screen-placeholder":"magritte-full-screen-placeholder___zPC8k_12-4-17","fullScreenPlaceholder":"magritte-full-screen-placeholder___zPC8k_12-4-17","error-wrapper":"magritte-error-wrapper___P7jYg_12-4-17","errorWrapper":"magritte-error-wrapper___P7jYg_12-4-17"};
28
28
 
29
29
  const SelectOptionDefault = ({ data, input, type, checked, plain, }) => {
30
30
  if (type === 'delimiter') {
package/SelectDrop.js CHANGED
@@ -21,7 +21,7 @@ import '@hh.ru/magritte-common-use-disabled';
21
21
  import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
22
22
  import '@hh.ru/magritte-ui-checkbox-radio';
23
23
 
24
- var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_12-4-15","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_12-4-15","select-drop-container":"magritte-select-drop-container___hee1p_12-4-15","selectDropContainer":"magritte-select-drop-container___hee1p_12-4-15","select-drop-container_plain":"magritte-select-drop-container_plain___766zl_12-4-15","selectDropContainerPlain":"magritte-select-drop-container_plain___766zl_12-4-15","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_12-4-15","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_12-4-15","select-drop":"magritte-select-drop___jn4O-_12-4-15","selectDrop":"magritte-select-drop___jn4O-_12-4-15","select-drop-header":"magritte-select-drop-header___fMmio_12-4-15","selectDropHeader":"magritte-select-drop-header___fMmio_12-4-15","select-drop_plain":"magritte-select-drop_plain___VL8Fz_12-4-15","selectDropPlain":"magritte-select-drop_plain___VL8Fz_12-4-15","label-option":"magritte-label-option___2N7t9_12-4-15","labelOption":"magritte-label-option___2N7t9_12-4-15","loading":"magritte-loading___AMiuq_12-4-15","hint":"magritte-hint___6qaFl_12-4-15"};
24
+ var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_12-4-17","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_12-4-17","select-drop-container":"magritte-select-drop-container___hee1p_12-4-17","selectDropContainer":"magritte-select-drop-container___hee1p_12-4-17","select-drop-container_plain":"magritte-select-drop-container_plain___766zl_12-4-17","selectDropContainerPlain":"magritte-select-drop-container_plain___766zl_12-4-17","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_12-4-17","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_12-4-17","select-drop":"magritte-select-drop___jn4O-_12-4-17","selectDrop":"magritte-select-drop___jn4O-_12-4-17","select-drop-header":"magritte-select-drop-header___fMmio_12-4-17","selectDropHeader":"magritte-select-drop-header___fMmio_12-4-17","select-drop_plain":"magritte-select-drop_plain___VL8Fz_12-4-17","selectDropPlain":"magritte-select-drop_plain___VL8Fz_12-4-17","label-option":"magritte-label-option___2N7t9_12-4-17","labelOption":"magritte-label-option___2N7t9_12-4-17","loading":"magritte-loading___AMiuq_12-4-17","hint":"magritte-hint___6qaFl_12-4-17"};
25
25
 
26
26
  const SelectOptionDefault = ({ data, input, type, plain, checked, }) => {
27
27
  if (type === 'delimiter') {
@@ -116,7 +116,7 @@ const SelectDrop = ({ activatorRef, type, name, multiple, applyChangesButton: _a
116
116
  emptyOptionsHintVisible ||
117
117
  emptySearchOptionsHintVisible ||
118
118
  internalError) &&
119
- visible, placement: ['bottom-left', 'top-left'], activatorRef: activatorRef, role: searchable ? 'status' : 'listbox', padding: plain ? 24 : 12, keyboardNavigationMode: "list", onClose: () => {
119
+ visible, placement: ['bottom-left', 'top-left', 'bottom-right', 'top-right'], activatorRef: activatorRef, role: searchable ? 'status' : 'listbox', padding: plain ? 24 : 12, keyboardNavigationMode: "list", onClose: () => {
120
120
  setForcedState('focus');
121
121
  onClose?.();
122
122
  }, closeByClickOutside: false, onKeyDownCapture: (event) => {
package/SelectDrop.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDrop.js","sources":["../src/SelectDrop.tsx"],"sourcesContent":["import { useCallback, ReactElement, cloneElement, ComponentProps, ReactNode, useRef, KeyboardEvent } from 'react';\nimport classnames from 'classnames';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { keyboardKeys, keyboardMatches } from '@hh.ru/magritte-common-keyboard';\nimport { ActionBar } from '@hh.ru/magritte-ui-action-bar/ActionBar';\nimport { Button } from '@hh.ru/magritte-ui-button';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { Drop } from '@hh.ru/magritte-ui-drop';\nimport { CheckOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { SelectError } from '@hh.ru/magritte-ui-select/SelectError';\nimport { SelectOption } from '@hh.ru/magritte-ui-select/SelectOption';\nimport { getChecked } from '@hh.ru/magritte-ui-select/getChecked';\nimport {\n OnChangeAction,\n SelectDropProps,\n RenderOptionTypeProps,\n RenderButtonsContainerProps,\n} from '@hh.ru/magritte-ui-select/types';\n\nimport styles from './select-drop.less';\n\nconst SelectOptionDefault = <DataType extends StaticDataFetcherItem>({\n data,\n input,\n type,\n plain,\n checked,\n}: RenderOptionTypeProps<DataType>): ReactElement => {\n if (type === 'delimiter') {\n return (\n <CellText maxLines={1} style=\"secondary\">\n {data.text}\n </CellText>\n );\n }\n if (type === 'label') {\n return (\n <Cell Element=\"div\" right={checked && plain ? <CheckOutlinedSize24 /> : undefined}>\n <div className={classnames({ [styles.labelOption]: !plain })}>\n <CellText maxLines={1}>{data.text}</CellText>\n </div>\n </Cell>\n );\n }\n return (\n <Cell Element=\"div\" align=\"center\" left={input}>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n};\n\nconst RenderButtonsContainerDefault = ({ applyChangesButton, loading }: RenderButtonsContainerProps): ReactNode => {\n if (loading || !applyChangesButton) {\n return null;\n }\n return <ActionBar primaryActions={applyChangesButton} />;\n};\n\nexport const SelectDrop = <MultipleType extends boolean, DataType extends StaticDataFetcherItem>({\n activatorRef,\n type,\n name,\n multiple,\n applyChangesButton: _applyChangesButton,\n clearButton: _clearButton,\n useInitialValuesOnClearAction,\n loading,\n renderItem = SelectOptionDefault,\n renderButtonsContainer = RenderButtonsContainerDefault,\n visible,\n optionList,\n optionsListRef,\n searchValue,\n setSearchValue,\n maxWidth,\n value: values,\n onChange,\n onClose,\n clearSelectedValues,\n setInitialValues,\n isLimitExceeded,\n plain,\n searchable,\n widthEqualToActivator,\n forceDropVisibleWithEmptyOptions,\n renderContentBefore,\n setForcedState,\n setSelectedValues,\n maxHeight,\n onDropClose,\n onDropOpen,\n emptyOptionsHint,\n emptyOptionsSearchHint,\n onApply,\n onClear,\n searchInProgress,\n internalError,\n reload,\n innerErrorTrls,\n optionDataQa,\n dropWidth,\n ...props\n}: SelectDropProps<MultipleType, DataType>): ReactElement => {\n const closedByKeyboardRef = useRef(false);\n const handleChange: OnChangeAction<DataType> = useCallback(\n (newValue, needToPut) => {\n onChange(newValue, needToPut);\n\n if (!multiple) {\n onClose?.();\n }\n\n if (!multiple && closedByKeyboardRef.current) {\n closedByKeyboardRef.current = false;\n setForcedState('focus');\n return;\n }\n\n if (multiple && searchValue) {\n setForcedState('focusAndSelect');\n return;\n }\n closedByKeyboardRef.current = false;\n setForcedState(null);\n },\n [multiple, onChange, onClose, searchValue, setForcedState]\n );\n\n const clearSelectedValuesAndClose = () => {\n if (useInitialValuesOnClearAction) {\n setInitialValues();\n } else {\n clearSelectedValues();\n }\n onClose?.();\n };\n const clearButton =\n _clearButton &&\n cloneElement(_clearButton, {\n key: 'clearButton',\n size: 'medium',\n 'data-qa': 'magritte-select-clear-action',\n onClick: () => {\n clearSelectedValuesAndClose();\n onClear?.();\n },\n } as Partial<ComponentProps<typeof Button>>);\n const needAddChangesButton = multiple && _applyChangesButton;\n const applyChangesButton =\n needAddChangesButton &&\n cloneElement(_applyChangesButton, {\n key: 'applyChangesButton',\n size: 'medium',\n 'data-qa': 'magritte-select-apply',\n onClick: () => {\n setSelectedValues();\n onClose?.();\n onApply?.({ isMobile: false, searchValue });\n },\n } as Partial<ComponentProps<typeof Button>>);\n\n const emptyOptionsHintVisible =\n optionList.length === 0 &&\n !searchValue &&\n !!emptyOptionsHint &&\n !loading &&\n !searchInProgress &&\n !internalError;\n const emptySearchOptionsHintVisible = !!(\n optionList.length === 0 &&\n searchValue &&\n !!emptyOptionsSearchHint &&\n !loading &&\n !searchInProgress &&\n !internalError\n );\n\n const optionsVisible = !loading && !emptySearchOptionsHintVisible && !emptyOptionsHintVisible && !internalError;\n const footer = renderButtonsContainer({\n applyChangesButton,\n clearButton,\n searchValue,\n optionsCount: optionList.length,\n loading,\n isError: Boolean(internalError && innerErrorTrls),\n emptyOptionsHintVisible: emptyOptionsHintVisible || emptySearchOptionsHintVisible,\n });\n const haveFooter = Boolean(footer);\n\n return (\n <Drop\n {...props}\n ref={optionsListRef}\n autoFocusWhenOpened={false}\n maxWidth={maxWidth}\n width={dropWidth}\n visible={\n (optionList.length > 0 ||\n forceDropVisibleWithEmptyOptions ||\n emptyOptionsHintVisible ||\n emptySearchOptionsHintVisible ||\n internalError) &&\n visible\n }\n placement={['bottom-left', 'top-left']}\n activatorRef={activatorRef}\n role={searchable ? 'status' : 'listbox'}\n padding={plain ? 24 : 12}\n keyboardNavigationMode=\"list\"\n onClose={() => {\n setForcedState('focus');\n onClose?.();\n }}\n closeByClickOutside={false}\n onKeyDownCapture={(event: KeyboardEvent) => {\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n closedByKeyboardRef.current = true;\n }\n }}\n widthEqualToActivator={widthEqualToActivator || loading}\n forcePlacement\n footer={footer}\n onAfterExit={onDropClose}\n onAppear={onDropOpen}\n returnFocusOnClose={false}\n >\n <div className={styles.selectDropContainerWrapper} style={{ maxHeight: `${maxHeight}px` }}>\n <div\n className={classnames(\n styles.selectDropContainer,\n { [styles.selectDropContainerPlain]: plain },\n { [styles.selectDropContainerWithFooter]: haveFooter }\n )}\n >\n {internalError && innerErrorTrls && <SelectError innerErrorTrls={innerErrorTrls} reload={reload} />}\n {emptyOptionsHintVisible && <div className={styles.hint}>{emptyOptionsHint}</div>}\n {emptySearchOptionsHintVisible && <div className={styles.hint}>{emptyOptionsSearchHint}</div>}\n {loading && (\n <div className={styles.loading}>\n <Loader size={24} />\n </div>\n )}\n {optionsVisible && (\n <>\n {renderContentBefore && (\n <div data-qa=\"magritte-select-header\" className={styles.selectDropHeader}>\n {renderContentBefore({\n clearSelectedValuesAndClose,\n searchValue,\n setSearchValue,\n optionsCount: optionList.length,\n })}\n </div>\n )}\n <div\n className={classnames(styles.selectDrop, { [styles.selectDropPlain]: plain })}\n data-qa=\"magritte-select-option-list\"\n >\n {optionList.map((option) => {\n const checked = Boolean(option.data && getChecked(option.data, values ?? []));\n const disabled = !checked && (option.disabled || isLimitExceeded);\n return (\n <SelectOption\n key={option.data.value}\n name={name}\n checked={checked}\n onChange={handleChange}\n render={renderItem}\n disabled={disabled}\n type={option.type || type}\n plain={!!plain}\n multiple={multiple}\n data-qa={optionDataQa}\n data={option.data}\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </div>\n </Drop>\n );\n};\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,mBAAmB,GAAG,CAAyC,EACjE,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,GACuB,KAAkB;AAChD,IAAA,IAAI,IAAI,KAAK,WAAW,EAAE;AACtB,QAAA,QACIA,GAAC,CAAA,QAAQ,EAAC,EAAA,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAC,WAAW,EACnC,QAAA,EAAA,IAAI,CAAC,IAAI,EAAA,CACH,EACb;KACL;AACD,IAAA,IAAI,IAAI,KAAK,OAAO,EAAE;QAClB,QACIA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,KAAK,EAAC,KAAK,EAAE,OAAO,IAAI,KAAK,GAAGA,GAAA,CAA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EAAA,QAAA,EAEpC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,KAAI;AACvB,oCAAA,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9E,oCAAA,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC,QAAQ,IAAI,eAAe,CAAC,CAAC;oCAClE,QACIA,GAAC,CAAA,YAAY,EAET,EAAA,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,IAAI,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,QAAQ,EAAE,QAAQ,EACT,SAAA,EAAA,YAAY,EACrB,IAAI,EAAE,MAAM,CAAC,IAAI,EAVZ,EAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAWxB,EACJ;iCACL,CAAC,GACA,CACP,EAAA,CAAA,CACN,IACC,EACJ,CAAA,EAAA,CACH,EACT;AACN;;;;"}
1
+ {"version":3,"file":"SelectDrop.js","sources":["../src/SelectDrop.tsx"],"sourcesContent":["import { useCallback, ReactElement, cloneElement, ComponentProps, ReactNode, useRef, KeyboardEvent } from 'react';\nimport classnames from 'classnames';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { keyboardKeys, keyboardMatches } from '@hh.ru/magritte-common-keyboard';\nimport { ActionBar } from '@hh.ru/magritte-ui-action-bar/ActionBar';\nimport { Button } from '@hh.ru/magritte-ui-button';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { Drop } from '@hh.ru/magritte-ui-drop';\nimport { CheckOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { SelectError } from '@hh.ru/magritte-ui-select/SelectError';\nimport { SelectOption } from '@hh.ru/magritte-ui-select/SelectOption';\nimport { getChecked } from '@hh.ru/magritte-ui-select/getChecked';\nimport {\n OnChangeAction,\n SelectDropProps,\n RenderOptionTypeProps,\n RenderButtonsContainerProps,\n} from '@hh.ru/magritte-ui-select/types';\n\nimport styles from './select-drop.less';\n\nconst SelectOptionDefault = <DataType extends StaticDataFetcherItem>({\n data,\n input,\n type,\n plain,\n checked,\n}: RenderOptionTypeProps<DataType>): ReactElement => {\n if (type === 'delimiter') {\n return (\n <CellText maxLines={1} style=\"secondary\">\n {data.text}\n </CellText>\n );\n }\n if (type === 'label') {\n return (\n <Cell Element=\"div\" right={checked && plain ? <CheckOutlinedSize24 /> : undefined}>\n <div className={classnames({ [styles.labelOption]: !plain })}>\n <CellText maxLines={1}>{data.text}</CellText>\n </div>\n </Cell>\n );\n }\n return (\n <Cell Element=\"div\" align=\"center\" left={input}>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n};\n\nconst RenderButtonsContainerDefault = ({ applyChangesButton, loading }: RenderButtonsContainerProps): ReactNode => {\n if (loading || !applyChangesButton) {\n return null;\n }\n return <ActionBar primaryActions={applyChangesButton} />;\n};\n\nexport const SelectDrop = <MultipleType extends boolean, DataType extends StaticDataFetcherItem>({\n activatorRef,\n type,\n name,\n multiple,\n applyChangesButton: _applyChangesButton,\n clearButton: _clearButton,\n useInitialValuesOnClearAction,\n loading,\n renderItem = SelectOptionDefault,\n renderButtonsContainer = RenderButtonsContainerDefault,\n visible,\n optionList,\n optionsListRef,\n searchValue,\n setSearchValue,\n maxWidth,\n value: values,\n onChange,\n onClose,\n clearSelectedValues,\n setInitialValues,\n isLimitExceeded,\n plain,\n searchable,\n widthEqualToActivator,\n forceDropVisibleWithEmptyOptions,\n renderContentBefore,\n setForcedState,\n setSelectedValues,\n maxHeight,\n onDropClose,\n onDropOpen,\n emptyOptionsHint,\n emptyOptionsSearchHint,\n onApply,\n onClear,\n searchInProgress,\n internalError,\n reload,\n innerErrorTrls,\n optionDataQa,\n dropWidth,\n ...props\n}: SelectDropProps<MultipleType, DataType>): ReactElement => {\n const closedByKeyboardRef = useRef(false);\n const handleChange: OnChangeAction<DataType> = useCallback(\n (newValue, needToPut) => {\n onChange(newValue, needToPut);\n\n if (!multiple) {\n onClose?.();\n }\n\n if (!multiple && closedByKeyboardRef.current) {\n closedByKeyboardRef.current = false;\n setForcedState('focus');\n return;\n }\n\n if (multiple && searchValue) {\n setForcedState('focusAndSelect');\n return;\n }\n closedByKeyboardRef.current = false;\n setForcedState(null);\n },\n [multiple, onChange, onClose, searchValue, setForcedState]\n );\n\n const clearSelectedValuesAndClose = () => {\n if (useInitialValuesOnClearAction) {\n setInitialValues();\n } else {\n clearSelectedValues();\n }\n onClose?.();\n };\n const clearButton =\n _clearButton &&\n cloneElement(_clearButton, {\n key: 'clearButton',\n size: 'medium',\n 'data-qa': 'magritte-select-clear-action',\n onClick: () => {\n clearSelectedValuesAndClose();\n onClear?.();\n },\n } as Partial<ComponentProps<typeof Button>>);\n const needAddChangesButton = multiple && _applyChangesButton;\n const applyChangesButton =\n needAddChangesButton &&\n cloneElement(_applyChangesButton, {\n key: 'applyChangesButton',\n size: 'medium',\n 'data-qa': 'magritte-select-apply',\n onClick: () => {\n setSelectedValues();\n onClose?.();\n onApply?.({ isMobile: false, searchValue });\n },\n } as Partial<ComponentProps<typeof Button>>);\n\n const emptyOptionsHintVisible =\n optionList.length === 0 &&\n !searchValue &&\n !!emptyOptionsHint &&\n !loading &&\n !searchInProgress &&\n !internalError;\n const emptySearchOptionsHintVisible = !!(\n optionList.length === 0 &&\n searchValue &&\n !!emptyOptionsSearchHint &&\n !loading &&\n !searchInProgress &&\n !internalError\n );\n\n const optionsVisible = !loading && !emptySearchOptionsHintVisible && !emptyOptionsHintVisible && !internalError;\n const footer = renderButtonsContainer({\n applyChangesButton,\n clearButton,\n searchValue,\n optionsCount: optionList.length,\n loading,\n isError: Boolean(internalError && innerErrorTrls),\n emptyOptionsHintVisible: emptyOptionsHintVisible || emptySearchOptionsHintVisible,\n });\n const haveFooter = Boolean(footer);\n\n return (\n <Drop\n {...props}\n ref={optionsListRef}\n autoFocusWhenOpened={false}\n maxWidth={maxWidth}\n width={dropWidth}\n visible={\n (optionList.length > 0 ||\n forceDropVisibleWithEmptyOptions ||\n emptyOptionsHintVisible ||\n emptySearchOptionsHintVisible ||\n internalError) &&\n visible\n }\n placement={['bottom-left', 'top-left', 'bottom-right', 'top-right']}\n activatorRef={activatorRef}\n role={searchable ? 'status' : 'listbox'}\n padding={plain ? 24 : 12}\n keyboardNavigationMode=\"list\"\n onClose={() => {\n setForcedState('focus');\n onClose?.();\n }}\n closeByClickOutside={false}\n onKeyDownCapture={(event: KeyboardEvent) => {\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n closedByKeyboardRef.current = true;\n }\n }}\n widthEqualToActivator={widthEqualToActivator || loading}\n forcePlacement\n footer={footer}\n onAfterExit={onDropClose}\n onAppear={onDropOpen}\n returnFocusOnClose={false}\n >\n <div className={styles.selectDropContainerWrapper} style={{ maxHeight: `${maxHeight}px` }}>\n <div\n className={classnames(\n styles.selectDropContainer,\n { [styles.selectDropContainerPlain]: plain },\n { [styles.selectDropContainerWithFooter]: haveFooter }\n )}\n >\n {internalError && innerErrorTrls && <SelectError innerErrorTrls={innerErrorTrls} reload={reload} />}\n {emptyOptionsHintVisible && <div className={styles.hint}>{emptyOptionsHint}</div>}\n {emptySearchOptionsHintVisible && <div className={styles.hint}>{emptyOptionsSearchHint}</div>}\n {loading && (\n <div className={styles.loading}>\n <Loader size={24} />\n </div>\n )}\n {optionsVisible && (\n <>\n {renderContentBefore && (\n <div data-qa=\"magritte-select-header\" className={styles.selectDropHeader}>\n {renderContentBefore({\n clearSelectedValuesAndClose,\n searchValue,\n setSearchValue,\n optionsCount: optionList.length,\n })}\n </div>\n )}\n <div\n className={classnames(styles.selectDrop, { [styles.selectDropPlain]: plain })}\n data-qa=\"magritte-select-option-list\"\n >\n {optionList.map((option) => {\n const checked = Boolean(option.data && getChecked(option.data, values ?? []));\n const disabled = !checked && (option.disabled || isLimitExceeded);\n return (\n <SelectOption\n key={option.data.value}\n name={name}\n checked={checked}\n onChange={handleChange}\n render={renderItem}\n disabled={disabled}\n type={option.type || type}\n plain={!!plain}\n multiple={multiple}\n data-qa={optionDataQa}\n data={option.data}\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </div>\n </Drop>\n );\n};\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,mBAAmB,GAAG,CAAyC,EACjE,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,GACuB,KAAkB;AAChD,IAAA,IAAI,IAAI,KAAK,WAAW,EAAE;AACtB,QAAA,QACIA,GAAC,CAAA,QAAQ,EAAC,EAAA,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAC,WAAW,EACnC,QAAA,EAAA,IAAI,CAAC,IAAI,EAAA,CACH,EACb;KACL;AACD,IAAA,IAAI,IAAI,KAAK,OAAO,EAAE;QAClB,QACIA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,KAAK,EAAC,KAAK,EAAE,OAAO,IAAI,KAAK,GAAGA,GAAA,CAAC,mBAAmB,EAAA,EAAA,CAAG,GAAG,SAAS,EAC7E,QAAA,EAAAA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,KAAK,EAAE,CAAC,EACxD,QAAA,EAAAA,GAAA,CAAC,QAAQ,EAAC,EAAA,QAAQ,EAAE,CAAC,EAAG,QAAA,EAAA,IAAI,CAAC,IAAI,EAAY,CAAA,EAAA,CAC3C,EACH,CAAA,EACT;KACL;AACD,IAAA,QACIA,GAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC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OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,IAAI,EACzB,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,QAAQ,EAAE,QAAQ,EACT,SAAA,EAAA,YAAY,EACrB,IAAI,EAAE,MAAM,CAAC,IAAI,EAVZ,EAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAWxB,EACJ;iCACL,CAAC,GACA,CACP,EAAA,CAAA,CACN,IACC,EACJ,CAAA,EAAA,CACH,EACT;AACN;;;;"}
@@ -6,7 +6,7 @@ import { VSpacing } from '@hh.ru/magritte-ui-spacing';
6
6
  import { Title } from '@hh.ru/magritte-ui-title';
7
7
  import { Text } from '@hh.ru/magritte-ui-typography';
8
8
 
9
- var styles = {"select-empty-hint":"magritte-select-empty-hint___B39XJ_12-4-15","selectEmptyHint":"magritte-select-empty-hint___B39XJ_12-4-15","icon":"magritte-icon___F0GQx_12-4-15","icon-init":"magritte-icon-init___GWK-V_12-4-15","iconInit":"magritte-icon-init___GWK-V_12-4-15","icon-search":"magritte-icon-search___ZsqO-_12-4-15","iconSearch":"magritte-icon-search___ZsqO-_12-4-15"};
9
+ var styles = {"select-empty-hint":"magritte-select-empty-hint___B39XJ_12-4-17","selectEmptyHint":"magritte-select-empty-hint___B39XJ_12-4-17","icon":"magritte-icon___F0GQx_12-4-17","icon-init":"magritte-icon-init___GWK-V_12-4-17","iconInit":"magritte-icon-init___GWK-V_12-4-17","icon-search":"magritte-icon-search___ZsqO-_12-4-17","iconSearch":"magritte-icon-search___ZsqO-_12-4-17"};
10
10
 
11
11
  const SelectEmptyHint = ({ title, titleElement, description, type }) => {
12
12
  return (jsxs("div", { className: styles.selectEmptyHint, children: [type === 'init' && (jsx("div", { className: classnames(styles.icon, styles.iconInit), children: jsx(MagnifierOutlinedSize24, {}) })), type === 'emptySearch' && (jsx("div", { className: classnames(styles.icon, styles.iconSearch), children: jsx(EmojiHalfsadOutlinedSize24, {}) })), jsx(VSpacing, { default: 32 }), jsx(Title, { Element: titleElement, size: "small", children: title }), jsx(VSpacing, { default: 8 }), Boolean(description) && (jsx(Text, { typography: "paragraph-2-regular", style: "secondary", children: description }))] }));
package/SelectError.js CHANGED
@@ -7,7 +7,7 @@ import { VSpacing } from '@hh.ru/magritte-ui-spacing';
7
7
  import { Title } from '@hh.ru/magritte-ui-title';
8
8
  import { Text } from '@hh.ru/magritte-ui-typography';
9
9
 
10
- var styles = {"error-container":"magritte-error-container___t9B5w_12-4-15","errorContainer":"magritte-error-container___t9B5w_12-4-15"};
10
+ var styles = {"error-container":"magritte-error-container___t9B5w_12-4-17","errorContainer":"magritte-error-container___t9B5w_12-4-17"};
11
11
 
12
12
  const SelectError = ({ innerErrorTrls, reload, }) => {
13
13
  const { isMobile } = useBreakpoint();
package/SelectModal.js CHANGED
@@ -23,7 +23,7 @@ import '@hh.ru/magritte-common-use-disabled';
23
23
  import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
24
24
  import '@hh.ru/magritte-ui-checkbox-radio';
25
25
 
26
- var styles = {"select-modal-wrapper":"magritte-select-modal-wrapper___5BhtC_12-4-15","selectModalWrapper":"magritte-select-modal-wrapper___5BhtC_12-4-15","select-modal":"magritte-select-modal___f9wc6_12-4-15","selectModal":"magritte-select-modal___f9wc6_12-4-15","select-modal_plain":"magritte-select-modal_plain___0rP39_12-4-15","selectModalPlain":"magritte-select-modal_plain___0rP39_12-4-15","label-option":"magritte-label-option___kFAuR_12-4-15","labelOption":"magritte-label-option___kFAuR_12-4-15","layer-full-height":"magritte-layer-full-height___cJX-K_12-4-15","layerFullHeight":"magritte-layer-full-height___cJX-K_12-4-15"};
26
+ var styles = {"select-modal-wrapper":"magritte-select-modal-wrapper___5BhtC_12-4-17","selectModalWrapper":"magritte-select-modal-wrapper___5BhtC_12-4-17","select-modal":"magritte-select-modal___f9wc6_12-4-17","selectModal":"magritte-select-modal___f9wc6_12-4-17","select-modal_plain":"magritte-select-modal_plain___0rP39_12-4-17","selectModalPlain":"magritte-select-modal_plain___0rP39_12-4-17","label-option":"magritte-label-option___kFAuR_12-4-17","labelOption":"magritte-label-option___kFAuR_12-4-17","layer-full-height":"magritte-layer-full-height___cJX-K_12-4-17","layerFullHeight":"magritte-layer-full-height___cJX-K_12-4-17"};
27
27
 
28
28
  const SelectOptionDefault = ({ data, input, type, plain, checked, }) => {
29
29
  if (type === 'delimiter') {
package/SelectOption.js CHANGED
@@ -8,7 +8,7 @@ import { CheckableCardElement } from '@hh.ru/magritte-ui-checkable-card/Checkabl
8
8
  import { Radio, Checkbox } from '@hh.ru/magritte-ui-checkbox-radio';
9
9
  import { Text } from '@hh.ru/magritte-ui-typography';
10
10
 
11
- var styles = {"select-option-plain":"magritte-select-option-plain___dfz4a_12-4-15","selectOptionPlain":"magritte-select-option-plain___dfz4a_12-4-15","select-option-plain_active":"magritte-select-option-plain_active___AQSQS_12-4-15","selectOptionPlainActive":"magritte-select-option-plain_active___AQSQS_12-4-15","select-delimiter":"magritte-select-delimiter___WyeR6_12-4-15","selectDelimiter":"magritte-select-delimiter___WyeR6_12-4-15"};
11
+ var styles = {"select-option-plain":"magritte-select-option-plain___dfz4a_12-4-17","selectOptionPlain":"magritte-select-option-plain___dfz4a_12-4-17","select-option-plain_active":"magritte-select-option-plain_active___AQSQS_12-4-17","selectOptionPlainActive":"magritte-select-option-plain_active___AQSQS_12-4-17","select-delimiter":"magritte-select-delimiter___WyeR6_12-4-17","selectDelimiter":"magritte-select-delimiter___WyeR6_12-4-17"};
12
12
 
13
13
  const CheckableComponent = ({ type, value, checked, name, onChange, 'data-qa': dataQa, }) => {
14
14
  if (type === 'label') {
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- .magritte-error-container___t9B5w_12-4-15{
1
+ .magritte-error-container___t9B5w_12-4-17{
2
2
  display:flex;
3
3
  flex-direction:column;
4
4
  align-items:center;
@@ -6,95 +6,95 @@
6
6
  justify-content:center;
7
7
  }
8
8
  @media (min-width: 1020px){
9
- body.magritte-old-layout .magritte-error-container___t9B5w_12-4-15{
9
+ body.magritte-old-layout .magritte-error-container___t9B5w_12-4-17{
10
10
  min-height:320px;
11
11
  height:auto;
12
12
  }
13
13
  }
14
14
  @media (min-width: 1024px){
15
- body:not(.magritte-old-layout) .magritte-error-container___t9B5w_12-4-15{
15
+ body:not(.magritte-old-layout) .magritte-error-container___t9B5w_12-4-17{
16
16
  min-height:320px;
17
17
  height:auto;
18
18
  }
19
19
  }
20
20
 
21
- .magritte-select-option-plain___dfz4a_12-4-15:hover{
21
+ .magritte-select-option-plain___dfz4a_12-4-17:hover{
22
22
  cursor:default;
23
23
  }
24
- .magritte-select-option-plain_active___AQSQS_12-4-15:hover{
24
+ .magritte-select-option-plain_active___AQSQS_12-4-17:hover{
25
25
  cursor:pointer;
26
26
  }
27
- .magritte-select-delimiter___WyeR6_12-4-15{
27
+ .magritte-select-delimiter___WyeR6_12-4-17{
28
28
  padding-left:16px;
29
29
  padding-top:12px;
30
30
  }
31
31
 
32
- .magritte-select-bottom-sheet___1RZDJ_12-4-15{
32
+ .magritte-select-bottom-sheet___1RZDJ_12-4-17{
33
33
  display:flex;
34
34
  flex-direction:column;
35
35
  padding:0 16px;
36
36
  padding-bottom:16px;
37
37
  }
38
- .magritte-select-bottom-sheet_checkbox___hwTgo_12-4-15,
39
- .magritte-select-bottom-sheet_radio___qvFFV_12-4-15{
38
+ .magritte-select-bottom-sheet_checkbox___hwTgo_12-4-17,
39
+ .magritte-select-bottom-sheet_radio___qvFFV_12-4-17{
40
40
  gap:12px;
41
41
  }
42
- .magritte-select-bottom-sheet_without-header___KOKVh_12-4-15{
42
+ .magritte-select-bottom-sheet_without-header___KOKVh_12-4-17{
43
43
  padding-top:16px;
44
44
  }
45
- .magritte-full-screen-placeholder___zPC8k_12-4-15{
45
+ .magritte-full-screen-placeholder___zPC8k_12-4-17{
46
46
  display:flex;
47
47
  flex-direction:column;
48
48
  align-items:center;
49
49
  height:100%;
50
50
  justify-content:center;
51
51
  }
52
- .magritte-error-wrapper___P7jYg_12-4-15{
52
+ .magritte-error-wrapper___P7jYg_12-4-17{
53
53
  height:100%;
54
54
  }
55
55
 
56
- .magritte-select-drop-container-wrapper___OHM0q_12-4-15{
56
+ .magritte-select-drop-container-wrapper___OHM0q_12-4-17{
57
57
  display:flex;
58
58
  flex-direction:column;
59
59
  }
60
- .magritte-select-drop-container___hee1p_12-4-15{
60
+ .magritte-select-drop-container___hee1p_12-4-17{
61
61
  display:flex;
62
62
  flex-direction:column;
63
63
  padding:12px;
64
64
  margin:calc(-1 * 12px);
65
65
  }
66
- .magritte-select-drop-container_plain___766zl_12-4-15{
66
+ .magritte-select-drop-container_plain___766zl_12-4-17{
67
67
  padding:24px;
68
68
  margin:calc(-1 * 24px);
69
69
  }
70
- .magritte-select-drop-container_with-footer___6wp-L_12-4-15{
70
+ .magritte-select-drop-container_with-footer___6wp-L_12-4-17{
71
71
  margin-bottom:0;
72
72
  padding-bottom:0;
73
73
  }
74
- .magritte-select-drop___jn4O-_12-4-15{
74
+ .magritte-select-drop___jn4O-_12-4-17{
75
75
  display:flex;
76
76
  flex-direction:column;
77
77
  gap:8px;
78
78
  }
79
- .magritte-select-drop-header___fMmio_12-4-15{
79
+ .magritte-select-drop-header___fMmio_12-4-17{
80
80
  display:flex;
81
81
  flex-direction:column;
82
82
  margin-bottom:8px;
83
83
  }
84
- .magritte-select-drop_plain___VL8Fz_12-4-15{
84
+ .magritte-select-drop_plain___VL8Fz_12-4-17{
85
85
  gap:16px;
86
86
  }
87
- .magritte-label-option___2N7t9_12-4-15{
87
+ .magritte-label-option___2N7t9_12-4-17{
88
88
  display:flex;
89
89
  justify-content:center;
90
90
  }
91
- .magritte-loading___AMiuq_12-4-15{
91
+ .magritte-loading___AMiuq_12-4-17{
92
92
  display:flex;
93
93
  align-items:center;
94
94
  height:150px;
95
95
  justify-content:center;
96
96
  }
97
- .magritte-hint___6qaFl_12-4-15{
97
+ .magritte-hint___6qaFl_12-4-17{
98
98
  display:flex;
99
99
  flex-direction:column;
100
100
  align-items:center;
@@ -102,24 +102,24 @@
102
102
  justify-content:center;
103
103
  }
104
104
 
105
- .magritte-select-modal-wrapper___5BhtC_12-4-15{
105
+ .magritte-select-modal-wrapper___5BhtC_12-4-17{
106
106
  display:flex;
107
107
  flex-direction:column;
108
108
  flex-grow:1;
109
109
  }
110
- .magritte-select-modal___f9wc6_12-4-15{
110
+ .magritte-select-modal___f9wc6_12-4-17{
111
111
  display:flex;
112
112
  flex-direction:column;
113
113
  gap:12px;
114
114
  }
115
- .magritte-select-modal_plain___0rP39_12-4-15{
115
+ .magritte-select-modal_plain___0rP39_12-4-17{
116
116
  gap:0;
117
117
  }
118
- .magritte-label-option___kFAuR_12-4-15{
118
+ .magritte-label-option___kFAuR_12-4-17{
119
119
  display:flex;
120
120
  justify-content:center;
121
121
  }
122
- .magritte-layer-full-height___cJX-K_12-4-15{
122
+ .magritte-layer-full-height___cJX-K_12-4-17{
123
123
  display:flex;
124
124
  flex-direction:column;
125
125
  align-items:center;
@@ -146,14 +146,14 @@
146
146
  --magritte-color-background-accent-secondary-v24-4-0:#F1F4F7;
147
147
  --magritte-color-icon-accent-v24-4-0:#7195AF;
148
148
  }
149
- .magritte-select-empty-hint___B39XJ_12-4-15{
149
+ .magritte-select-empty-hint___B39XJ_12-4-17{
150
150
  display:flex;
151
151
  flex-direction:column;
152
152
  justify-content:center;
153
153
  align-content:center;
154
154
  align-items:center;
155
155
  }
156
- .magritte-icon___F0GQx_12-4-15{
156
+ .magritte-icon___F0GQx_12-4-17{
157
157
  display:flex;
158
158
  align-items:center;
159
159
  justify-content:center;
@@ -161,11 +161,11 @@
161
161
  height:48px;
162
162
  border-radius:50%;
163
163
  }
164
- .magritte-icon-init___GWK-V_12-4-15{
164
+ .magritte-icon-init___GWK-V_12-4-17{
165
165
  background-color:var(--magritte-color-background-accent-secondary-v24-4-0);
166
166
  --magritte-ui-icon-color-override:var(--magritte-color-icon-accent-v24-4-0);
167
167
  }
168
- .magritte-icon-search___ZsqO-_12-4-15{
168
+ .magritte-icon-search___ZsqO-_12-4-17{
169
169
  background-color:var(--magritte-color-background-secondary-v24-4-0);
170
170
  --magritte-ui-icon-color-override:var(--magritte-color-icon-tertiary-v24-4-0);
171
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-select",
3
- "version": "12.4.15",
3
+ "version": "12.4.17",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -36,7 +36,7 @@
36
36
  "@hh.ru/magritte-ui-bottom-sheet": "9.2.10",
37
37
  "@hh.ru/magritte-ui-breakpoint": "6.0.6",
38
38
  "@hh.ru/magritte-ui-button": "7.1.3",
39
- "@hh.ru/magritte-ui-button-stack": "2.2.3",
39
+ "@hh.ru/magritte-ui-button-stack": "3.0.0",
40
40
  "@hh.ru/magritte-ui-cell": "7.2.4",
41
41
  "@hh.ru/magritte-ui-checkable-card": "5.0.6",
42
42
  "@hh.ru/magritte-ui-checkbox-radio": "4.1.3",
@@ -52,5 +52,5 @@
52
52
  "@hh.ru/magritte-ui-trigger": "4.2.2",
53
53
  "@hh.ru/magritte-ui-typography": "4.5.1"
54
54
  },
55
- "gitHead": "dbdbcad65f9d7dc14f074ed3e1e83a48d1ef832c"
55
+ "gitHead": "fb1fdaa17e234634cee828845a128abc6d15fea4"
56
56
  }