@hh.ru/magritte-ui-select 12.8.27 → 12.9.0
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.
- package/Select.js +1 -1
- package/SelectBottomSheet.js +8 -8
- package/SelectBottomSheet.js.map +1 -1
- package/SelectDrop.js +1 -1
- package/SelectEmptyHint.js +1 -1
- package/SelectError.js +1 -1
- package/SelectModal.js +1 -1
- package/SelectOption.js +1 -1
- package/UncontrolledSelect.js +1 -1
- package/index.css +33 -33
- package/index.js +1 -1
- package/package.json +17 -17
package/Select.js
CHANGED
|
@@ -22,7 +22,7 @@ import '@hh.ru/magritte-ui-cell';
|
|
|
22
22
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
23
23
|
import '@hh.ru/magritte-ui-input';
|
|
24
24
|
import '@hh.ru/magritte-ui-loader';
|
|
25
|
-
import '@hh.ru/magritte-ui-
|
|
25
|
+
import '@hh.ru/magritte-ui-nav-bar';
|
|
26
26
|
import './SelectError.js';
|
|
27
27
|
import '@hh.ru/magritte-ui-icon/variants/icon';
|
|
28
28
|
import '@hh.ru/magritte-ui-spacing';
|
package/SelectBottomSheet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, isValidElement, cloneElement, useCallback } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { keyboardMatch, keyboardKeys } from '@hh.ru/magritte-common-keyboard';
|
|
@@ -11,7 +11,7 @@ import { CellText, Cell } from '@hh.ru/magritte-ui-cell';
|
|
|
11
11
|
import { CrossOutlinedSize24, ArrowPathClockwiseOutlinedSize24, CheckOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
|
|
12
12
|
import { SearchInput } from '@hh.ru/magritte-ui-input';
|
|
13
13
|
import { Loader } from '@hh.ru/magritte-ui-loader';
|
|
14
|
-
import {
|
|
14
|
+
import { NavBar } from '@hh.ru/magritte-ui-nav-bar';
|
|
15
15
|
import { SelectError } from './SelectError.js';
|
|
16
16
|
import { SelectOption } from './SelectOption.js';
|
|
17
17
|
import { getChecked } from './getChecked.js';
|
|
@@ -25,7 +25,7 @@ import '@hh.ru/magritte-common-use-disabled';
|
|
|
25
25
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
26
26
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
27
27
|
|
|
28
|
-
var styles = {"select-bottom-sheet":"magritte-select-bottom-sheet___1RZDJ_12-
|
|
28
|
+
var styles = {"select-bottom-sheet":"magritte-select-bottom-sheet___1RZDJ_12-9-0","selectBottomSheet":"magritte-select-bottom-sheet___1RZDJ_12-9-0","select-bottom-sheet_checkbox":"magritte-select-bottom-sheet_checkbox___hwTgo_12-9-0","selectBottomSheetCheckbox":"magritte-select-bottom-sheet_checkbox___hwTgo_12-9-0","select-bottom-sheet_radio":"magritte-select-bottom-sheet_radio___qvFFV_12-9-0","selectBottomSheetRadio":"magritte-select-bottom-sheet_radio___qvFFV_12-9-0","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_12-9-0","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_12-9-0","full-screen-placeholder":"magritte-full-screen-placeholder___zPC8k_12-9-0","fullScreenPlaceholder":"magritte-full-screen-placeholder___zPC8k_12-9-0","error-wrapper":"magritte-error-wrapper___P7jYg_12-9-0","errorWrapper":"magritte-error-wrapper___P7jYg_12-9-0"};
|
|
29
29
|
|
|
30
30
|
const SelectOptionDefault = ({ data, input, type, checked, plain, }) => {
|
|
31
31
|
if (type === 'delimiter') {
|
|
@@ -44,11 +44,11 @@ const RenderButtonsContainerDefault = ({ clearButton, applyChangesButton, loadin
|
|
|
44
44
|
return jsx(ActionBar, { primaryActions: primaryActions });
|
|
45
45
|
};
|
|
46
46
|
const RenderHeaderDefault = ({ onCloseBottomSheet, searchValue, setSearchValue, searchable, headerTitle, onSearchSubmit, optionsCount, onCloseBottomSheetWithUpdateValues, searchTrl, closeTrl, }) => {
|
|
47
|
-
return (jsx(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
return (jsxs(NavBar, { children: [jsx(NavBar.Pane, { children: jsx(NavBar.Actions, { centered: true, right: jsx(CrossOutlinedSize24, { onClick: onCloseBottomSheet, "data-qa": "select-bottom-sheet-navigation-close", "aria-label": closeTrl }), children: jsx(NavBar.TitleContainer, { centered: true, title: headerTitle }) }) }), searchable && (jsx(NavBar.Pane, { children: jsx(SearchInput, { clearable: true, size: "medium", value: searchValue, onChange: setSearchValue, onKeyDown: (event) => {
|
|
48
|
+
if (onSearchSubmit && keyboardMatch(event.nativeEvent, keyboardKeys.Enter)) {
|
|
49
|
+
onSearchSubmit(event, onCloseBottomSheet, optionsCount, onCloseBottomSheetWithUpdateValues);
|
|
50
|
+
}
|
|
51
|
+
}, "data-qa": "bottom-sheet-navigation-input", autoComplete: "off", "aria-label": searchTrl, "data-magritte-select-seach-input": true }) }))] }));
|
|
52
52
|
};
|
|
53
53
|
const SelectBottomSheet = ({ id, type, name, multiple, clearButton: _clearButton, applyChangesButton: _applyChangesButton, useInitialValuesOnClearAction, loading, error, renderHeader = RenderHeaderDefault, renderItem = SelectOptionDefault, renderButtonsContainer = RenderButtonsContainerDefault, renderAlertOnExitWithoutSaving, headerTitle, onClose, visible, optionList, optionsListRef, searchValue, setSearchValue, searchable, value: values, onChange, clearSelectedValuesOrUseInitialValues, isLimitExceeded, initialValuesOnOpening, setSelectedValues, onBottomSheetOpen, onBottomSheetClose, onSearchSubmit, onApply, onClear, emptyOptionsHint, emptyOptionsSearchHint, searchInProgress, internalError, reload, innerErrorTrls, optionDataQa, hasChangesApplyButton, ...props }) => {
|
|
54
54
|
const valuesArr = Array.isArray(values) ? values : [values];
|
package/SelectBottomSheet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectBottomSheet.js","sources":["src/SelectBottomSheet.tsx"],"sourcesContent":["import {\n ComponentProps,\n ReactElement,\n ReactNode,\n cloneElement,\n useCallback,\n useRef,\n useState,\n isValidElement,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { keyboardKeys, keyboardMatch } from '@hh.ru/magritte-common-keyboard';\nimport { useTranslation } from '@hh.ru/magritte-common-use-translation';\nimport { ActionBar } from '@hh.ru/magritte-ui-action-bar';\nimport { BottomSheet, BottomSheetFooter } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { Button } from '@hh.ru/magritte-ui-button';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport {\n ArrowPathClockwiseOutlinedSize24,\n CrossOutlinedSize24,\n CheckOutlinedSize24,\n} from '@hh.ru/magritte-ui-icon/icon';\nimport { SearchInput } from '@hh.ru/magritte-ui-input';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { NavigationBar } from '@hh.ru/magritte-ui-navigation-bar';\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 { isArraysEquals } from '@hh.ru/magritte-ui-select/isArraysEquals';\nimport {\n OnChangeAction,\n SelectBottomSheetProps,\n RenderOptionTypeProps,\n RenderHeaderProps,\n RenderButtonsContainerProps,\n} from '@hh.ru/magritte-ui-select/types';\n\nimport styles from './select-bottom-sheet.less';\n\nconst SelectOptionDefault = <DataType extends StaticDataFetcherItem>({\n data,\n input,\n type,\n checked,\n plain,\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} vertPadding>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n }\n return (\n <Cell Element=\"div\" align=\"center\" right={input}>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n};\n\nconst RenderButtonsContainerDefault = ({\n clearButton,\n applyChangesButton,\n loading,\n}: RenderButtonsContainerProps): ReactNode => {\n if ((!clearButton && !applyChangesButton) || loading) {\n return null;\n }\n const primaryActions = [clearButton, applyChangesButton].filter(Boolean);\n return <ActionBar primaryActions={primaryActions} />;\n};\n\nexport const RenderHeaderDefault = ({\n onCloseBottomSheet,\n searchValue,\n setSearchValue,\n searchable,\n headerTitle,\n onSearchSubmit,\n optionsCount,\n onCloseBottomSheetWithUpdateValues,\n searchTrl,\n closeTrl,\n}: RenderHeaderProps): ReactNode => {\n return (\n <NavigationBar\n title={headerTitle}\n right={\n <CrossOutlinedSize24\n onClick={onCloseBottomSheet}\n data-qa=\"select-bottom-sheet-navigation-close\"\n aria-label={closeTrl}\n />\n }\n options={\n searchable && (\n <SearchInput\n clearable\n size=\"medium\"\n value={searchValue}\n onChange={setSearchValue}\n onKeyDown={(event) => {\n if (onSearchSubmit && keyboardMatch(event.nativeEvent, keyboardKeys.Enter)) {\n onSearchSubmit(\n event,\n onCloseBottomSheet,\n optionsCount,\n onCloseBottomSheetWithUpdateValues\n );\n }\n }}\n data-qa=\"bottom-sheet-navigation-input\"\n autoComplete=\"off\"\n aria-label={searchTrl}\n data-magritte-select-seach-input\n />\n )\n }\n />\n );\n};\n\nexport const SelectBottomSheet = <MultipleType extends boolean, DataType extends StaticDataFetcherItem>({\n id,\n type,\n name,\n multiple,\n clearButton: _clearButton,\n applyChangesButton: _applyChangesButton,\n useInitialValuesOnClearAction,\n loading,\n error,\n renderHeader = RenderHeaderDefault,\n renderItem = SelectOptionDefault,\n renderButtonsContainer = RenderButtonsContainerDefault,\n renderAlertOnExitWithoutSaving,\n headerTitle,\n onClose,\n visible,\n optionList,\n optionsListRef,\n searchValue,\n setSearchValue,\n searchable,\n value: values,\n onChange,\n clearSelectedValuesOrUseInitialValues,\n isLimitExceeded,\n initialValuesOnOpening,\n setSelectedValues,\n onBottomSheetOpen,\n onBottomSheetClose,\n onSearchSubmit,\n onApply,\n onClear,\n emptyOptionsHint,\n emptyOptionsSearchHint,\n searchInProgress,\n internalError,\n reload,\n innerErrorTrls,\n optionDataQa,\n hasChangesApplyButton,\n ...props\n}: SelectBottomSheetProps<MultipleType, DataType>): ReactElement => {\n const valuesArr = Array.isArray(values) ? values : [values];\n const [alertVisible, setAlertVisible] = useState(false);\n const showAlertOnExitWithoutSaving = Boolean(renderAlertOnExitWithoutSaving);\n const showErrorPlaceholder = Boolean(error);\n const cancelCloseFuncRef = useRef<VoidFunction | null>(null);\n\n const onCloseWithAlertCheck = (cancelCloseFunc: VoidFunction | null) => {\n if (showAlertOnExitWithoutSaving && multiple) {\n const haveUnsavingChanges = !isArraysEquals<string>(\n initialValuesOnOpening.current?.map((item) => item.value) ?? [],\n // eslint-disable-next-line no-nested-ternary\n Array.isArray(values) ? values.map((item) => item.value) : values ? [values.value] : []\n );\n if (haveUnsavingChanges) {\n cancelCloseFuncRef.current = cancelCloseFunc;\n setAlertVisible(true);\n } else {\n onClose();\n }\n } else {\n onClose();\n }\n };\n\n const applyTrl = useTranslation('Select', 'apply');\n const clearTrl = useTranslation('Select', 'clear');\n const clearButton =\n _clearButton &&\n isValidElement<ComponentProps<typeof Button>>(_clearButton) &&\n cloneElement(_clearButton, {\n key: 'clearButton',\n size: 'medium',\n 'data-qa': 'magritte-select-clear-action-on-xs',\n 'aria-label': _clearButton.props['aria-label'] || clearTrl,\n onClick: () => {\n clearSelectedValuesOrUseInitialValues();\n },\n } as Partial<ComponentProps<typeof Button>>);\n\n const applyChangesButton =\n hasChangesApplyButton &&\n isValidElement<ComponentProps<typeof Button>>(_applyChangesButton) &&\n cloneElement(_applyChangesButton, {\n key: 'applyChangesButton',\n size: 'medium',\n 'data-qa': 'magritte-select-apply-on-xs',\n 'aria-label': _applyChangesButton.props['aria-label'] || applyTrl,\n onClick: () => {\n setSelectedValues();\n onClose();\n onApply?.({\n isMobile: true,\n searchValue,\n optionsCount: optionList.length,\n selectedOptionsCount: valuesArr.length,\n });\n },\n } as Partial<ComponentProps<typeof Button>>);\n\n const handleChange: OnChangeAction<DataType> = useCallback(\n (...args) => {\n if (!multiple && !hasChangesApplyButton) {\n onClose();\n }\n onChange(...args);\n },\n [multiple, onChange, onClose, hasChangesApplyButton]\n );\n\n const emptyOptionsHintVisible =\n optionList.length === 0 &&\n !searchValue &&\n !!emptyOptionsHint &&\n !loading &&\n !showErrorPlaceholder &&\n !searchInProgress &&\n !internalError;\n\n const emptyOptionsSearchHintVisible =\n optionList.length === 0 &&\n searchValue &&\n !!emptyOptionsSearchHint &&\n !loading &&\n !showErrorPlaceholder &&\n !searchInProgress &&\n !internalError;\n\n const footer = !showErrorPlaceholder ? (\n renderButtonsContainer({\n clearButton,\n applyChangesButton,\n searchValue,\n optionsCount: optionList.length,\n loading,\n isError: Boolean(internalError && innerErrorTrls),\n emptyOptionsHintVisible: Boolean(emptyOptionsHintVisible || emptyOptionsSearchHintVisible),\n })\n ) : (\n <BottomSheetFooter>{error && error.resetButton}</BottomSheetFooter>\n );\n\n const onCloseBottomSheetWithUpdateValues = () => {\n setSelectedValues();\n onCloseWithAlertCheck(null);\n };\n\n const optionsVisible =\n !loading &&\n !emptyOptionsSearchHintVisible &&\n !emptyOptionsHintVisible &&\n !internalError &&\n !showErrorPlaceholder;\n\n const searchTrl = useTranslation('Select', 'search');\n const closeTrl = useTranslation('Select', 'close');\n const header = renderHeader({\n onCloseBottomSheet: () => onCloseWithAlertCheck(null),\n searchValue,\n setSearchValue,\n searchable,\n headerTitle,\n onSearchSubmit,\n optionsCount: optionList.length,\n onCloseBottomSheetWithUpdateValues,\n searchTrl,\n closeTrl,\n });\n const haveHeader = Boolean(header);\n\n return (\n <>\n <BottomSheet\n {...props}\n id={id}\n ref={optionsListRef}\n allowScrollWhileFocused\n keyboardOverlaysFooter={false}\n visible={visible}\n showDivider={'with-scroll'}\n withContentPaddings={showErrorPlaceholder}\n header={header}\n onClose={onCloseWithAlertCheck}\n footer={\n internalError && innerErrorTrls ? (\n <BottomSheetFooter>\n <Button\n mode=\"primary\"\n style=\"accent\"\n size=\"medium\"\n onClick={reload}\n stretched\n icon={<ArrowPathClockwiseOutlinedSize24 />}\n >\n {innerErrorTrls.reloadButton}\n </Button>\n </BottomSheetFooter>\n ) : (\n footer\n )\n }\n onAppear={onBottomSheetOpen}\n onAfterExit={onBottomSheetClose}\n >\n {internalError && innerErrorTrls && <SelectError innerErrorTrls={innerErrorTrls} reload={reload} />}\n {emptyOptionsSearchHintVisible && (\n <div className={styles.fullScreenPlaceholder}>{emptyOptionsSearchHint}</div>\n )}\n {emptyOptionsHintVisible && <div className={styles.fullScreenPlaceholder}>{emptyOptionsHint}</div>}\n {loading && !showErrorPlaceholder && (\n <div className={styles.fullScreenPlaceholder}>\n <Loader size={24} />\n </div>\n )}\n {showErrorPlaceholder && <div className={styles.errorWrapper}>{error && error.placeholder}</div>}\n {optionsVisible && (\n <div\n role={'listbox'}\n className={classnames(styles.selectBottomSheet, styles[`select-bottom-sheet_${type}`], {\n [styles.selectBottomSheetWithoutHeader]: !haveHeader,\n })}\n data-qa=\"magritte-select-option-list-on-xs\"\n >\n {optionList.map(({ disabled: _disabled, type: optionType, ...option }) => {\n const checked = Boolean(option.data && getChecked<DataType>(option.data, values ?? []));\n const disabled = !checked && (_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={optionType || type}\n plain={type === 'label'}\n multiple={multiple}\n data-qa={optionDataQa}\n isMobile\n {...option}\n />\n );\n })}\n </div>\n )}\n </BottomSheet>\n {renderAlertOnExitWithoutSaving?.({\n alertVisible,\n onCloseAlert: () => {\n cancelCloseFuncRef.current?.();\n cancelCloseFuncRef.current = null;\n setAlertVisible(false);\n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E,4BAAA,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,CAAW,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;4BACxF,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,eAAe,CAAC,CAAC;4BAC5D,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,UAAU,IAAI,IAAI,EACxB,KAAK,EAAE,IAAI,KAAK,OAAO,EACvB,QAAQ,EAAE,QAAQ,EAAA,SAAA,EACT,YAAY,EACrB,QAAQ,EACJ,IAAA,EAAA,GAAA,MAAM,EAXL,EAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAYxB,EACJ;AACN,yBAAC,CAAC,EACA,CAAA,CACT,IACS,EACb,8BAA8B,GAAG;gBAC9B,YAAY;gBACZ,YAAY,EAAE,MAAK;AACf,oBAAA,kBAAkB,CAAC,OAAO,IAAI,CAAC;AAC/B,oBAAA,kBAAkB,CAAC,OAAO,GAAG,IAAI,CAAC;oBAClC,eAAe,CAAC,KAAK,CAAC,CAAC;iBAC1B;gBACD,qBAAqB,EAAE,MAAK;AACxB,oBAAA,kBAAkB,CAAC,OAAO,GAAG,IAAI,CAAC;oBAClC,eAAe,CAAC,KAAK,CAAC,CAAC;AACvB,oBAAA,OAAO,EAAE,CAAC;iBACb;aACJ,CAAC,CAAA,EAAA,CACH,EACL;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectBottomSheet.js","sources":["src/SelectBottomSheet.tsx"],"sourcesContent":["import {\n ComponentProps,\n ReactElement,\n ReactNode,\n cloneElement,\n useCallback,\n useRef,\n useState,\n isValidElement,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { keyboardKeys, keyboardMatch } from '@hh.ru/magritte-common-keyboard';\nimport { useTranslation } from '@hh.ru/magritte-common-use-translation';\nimport { ActionBar } from '@hh.ru/magritte-ui-action-bar';\nimport { BottomSheet, BottomSheetFooter } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { Button } from '@hh.ru/magritte-ui-button';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport {\n ArrowPathClockwiseOutlinedSize24,\n CrossOutlinedSize24,\n CheckOutlinedSize24,\n} from '@hh.ru/magritte-ui-icon/icon';\nimport { SearchInput } from '@hh.ru/magritte-ui-input';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { NavBar } from '@hh.ru/magritte-ui-nav-bar';\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 { isArraysEquals } from '@hh.ru/magritte-ui-select/isArraysEquals';\nimport {\n OnChangeAction,\n SelectBottomSheetProps,\n RenderOptionTypeProps,\n RenderHeaderProps,\n RenderButtonsContainerProps,\n} from '@hh.ru/magritte-ui-select/types';\n\nimport styles from './select-bottom-sheet.less';\n\nconst SelectOptionDefault = <DataType extends StaticDataFetcherItem>({\n data,\n input,\n type,\n checked,\n plain,\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} vertPadding>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n }\n return (\n <Cell Element=\"div\" align=\"center\" right={input}>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n};\n\nconst RenderButtonsContainerDefault = ({\n clearButton,\n applyChangesButton,\n loading,\n}: RenderButtonsContainerProps): ReactNode => {\n if ((!clearButton && !applyChangesButton) || loading) {\n return null;\n }\n const primaryActions = [clearButton, applyChangesButton].filter(Boolean);\n return <ActionBar primaryActions={primaryActions} />;\n};\n\nexport const RenderHeaderDefault = ({\n onCloseBottomSheet,\n searchValue,\n setSearchValue,\n searchable,\n headerTitle,\n onSearchSubmit,\n optionsCount,\n onCloseBottomSheetWithUpdateValues,\n searchTrl,\n closeTrl,\n}: RenderHeaderProps): ReactNode => {\n return (\n <NavBar>\n <NavBar.Pane>\n <NavBar.Actions\n centered\n right={\n <CrossOutlinedSize24\n onClick={onCloseBottomSheet}\n data-qa=\"select-bottom-sheet-navigation-close\"\n aria-label={closeTrl}\n />\n }\n >\n <NavBar.TitleContainer centered title={headerTitle} />\n </NavBar.Actions>\n </NavBar.Pane>\n {searchable && (\n <NavBar.Pane>\n <SearchInput\n clearable\n size=\"medium\"\n value={searchValue}\n onChange={setSearchValue}\n onKeyDown={(event) => {\n if (onSearchSubmit && keyboardMatch(event.nativeEvent, keyboardKeys.Enter)) {\n onSearchSubmit(\n event,\n onCloseBottomSheet,\n optionsCount,\n onCloseBottomSheetWithUpdateValues\n );\n }\n }}\n data-qa=\"bottom-sheet-navigation-input\"\n autoComplete=\"off\"\n aria-label={searchTrl}\n data-magritte-select-seach-input\n />\n </NavBar.Pane>\n )}\n </NavBar>\n );\n};\n\nexport const SelectBottomSheet = <MultipleType extends boolean, DataType extends StaticDataFetcherItem>({\n id,\n type,\n name,\n multiple,\n clearButton: _clearButton,\n applyChangesButton: _applyChangesButton,\n useInitialValuesOnClearAction,\n loading,\n error,\n renderHeader = RenderHeaderDefault,\n renderItem = SelectOptionDefault,\n renderButtonsContainer = RenderButtonsContainerDefault,\n renderAlertOnExitWithoutSaving,\n headerTitle,\n onClose,\n visible,\n optionList,\n optionsListRef,\n searchValue,\n setSearchValue,\n searchable,\n value: values,\n onChange,\n clearSelectedValuesOrUseInitialValues,\n isLimitExceeded,\n initialValuesOnOpening,\n setSelectedValues,\n onBottomSheetOpen,\n onBottomSheetClose,\n onSearchSubmit,\n onApply,\n onClear,\n emptyOptionsHint,\n emptyOptionsSearchHint,\n searchInProgress,\n internalError,\n reload,\n innerErrorTrls,\n optionDataQa,\n hasChangesApplyButton,\n ...props\n}: SelectBottomSheetProps<MultipleType, DataType>): ReactElement => {\n const valuesArr = Array.isArray(values) ? values : [values];\n const [alertVisible, setAlertVisible] = useState(false);\n const showAlertOnExitWithoutSaving = Boolean(renderAlertOnExitWithoutSaving);\n const showErrorPlaceholder = Boolean(error);\n const cancelCloseFuncRef = useRef<VoidFunction | null>(null);\n\n const onCloseWithAlertCheck = (cancelCloseFunc: VoidFunction | null) => {\n if (showAlertOnExitWithoutSaving && multiple) {\n const haveUnsavingChanges = !isArraysEquals<string>(\n initialValuesOnOpening.current?.map((item) => item.value) ?? [],\n // eslint-disable-next-line no-nested-ternary\n Array.isArray(values) ? values.map((item) => item.value) : values ? [values.value] : []\n );\n if (haveUnsavingChanges) {\n cancelCloseFuncRef.current = cancelCloseFunc;\n setAlertVisible(true);\n } else {\n onClose();\n }\n } else {\n onClose();\n }\n };\n\n const applyTrl = useTranslation('Select', 'apply');\n const clearTrl = useTranslation('Select', 'clear');\n const clearButton =\n _clearButton &&\n isValidElement<ComponentProps<typeof Button>>(_clearButton) &&\n cloneElement(_clearButton, {\n key: 'clearButton',\n size: 'medium',\n 'data-qa': 'magritte-select-clear-action-on-xs',\n 'aria-label': _clearButton.props['aria-label'] || clearTrl,\n onClick: () => {\n clearSelectedValuesOrUseInitialValues();\n },\n } as Partial<ComponentProps<typeof Button>>);\n\n const applyChangesButton =\n hasChangesApplyButton &&\n isValidElement<ComponentProps<typeof Button>>(_applyChangesButton) &&\n cloneElement(_applyChangesButton, {\n key: 'applyChangesButton',\n size: 'medium',\n 'data-qa': 'magritte-select-apply-on-xs',\n 'aria-label': _applyChangesButton.props['aria-label'] || applyTrl,\n onClick: () => {\n setSelectedValues();\n onClose();\n onApply?.({\n isMobile: true,\n searchValue,\n optionsCount: optionList.length,\n selectedOptionsCount: valuesArr.length,\n });\n },\n } as Partial<ComponentProps<typeof Button>>);\n\n const handleChange: OnChangeAction<DataType> = useCallback(\n (...args) => {\n if (!multiple && !hasChangesApplyButton) {\n onClose();\n }\n onChange(...args);\n },\n [multiple, onChange, onClose, hasChangesApplyButton]\n );\n\n const emptyOptionsHintVisible =\n optionList.length === 0 &&\n !searchValue &&\n !!emptyOptionsHint &&\n !loading &&\n !showErrorPlaceholder &&\n !searchInProgress &&\n !internalError;\n\n const emptyOptionsSearchHintVisible =\n optionList.length === 0 &&\n searchValue &&\n !!emptyOptionsSearchHint &&\n !loading &&\n !showErrorPlaceholder &&\n !searchInProgress &&\n !internalError;\n\n const footer = !showErrorPlaceholder ? (\n renderButtonsContainer({\n clearButton,\n applyChangesButton,\n searchValue,\n optionsCount: optionList.length,\n loading,\n isError: Boolean(internalError && innerErrorTrls),\n emptyOptionsHintVisible: Boolean(emptyOptionsHintVisible || emptyOptionsSearchHintVisible),\n })\n ) : (\n <BottomSheetFooter>{error && error.resetButton}</BottomSheetFooter>\n );\n\n const onCloseBottomSheetWithUpdateValues = () => {\n setSelectedValues();\n onCloseWithAlertCheck(null);\n };\n\n const optionsVisible =\n !loading &&\n !emptyOptionsSearchHintVisible &&\n !emptyOptionsHintVisible &&\n !internalError &&\n !showErrorPlaceholder;\n\n const searchTrl = useTranslation('Select', 'search');\n const closeTrl = useTranslation('Select', 'close');\n const header = renderHeader({\n onCloseBottomSheet: () => onCloseWithAlertCheck(null),\n searchValue,\n setSearchValue,\n searchable,\n headerTitle,\n onSearchSubmit,\n optionsCount: optionList.length,\n onCloseBottomSheetWithUpdateValues,\n searchTrl,\n closeTrl,\n });\n const haveHeader = Boolean(header);\n\n return (\n <>\n <BottomSheet\n {...props}\n id={id}\n ref={optionsListRef}\n allowScrollWhileFocused\n keyboardOverlaysFooter={false}\n visible={visible}\n showDivider={'with-scroll'}\n withContentPaddings={showErrorPlaceholder}\n header={header}\n onClose={onCloseWithAlertCheck}\n footer={\n internalError && innerErrorTrls ? (\n <BottomSheetFooter>\n <Button\n mode=\"primary\"\n style=\"accent\"\n size=\"medium\"\n onClick={reload}\n stretched\n icon={<ArrowPathClockwiseOutlinedSize24 />}\n >\n {innerErrorTrls.reloadButton}\n </Button>\n </BottomSheetFooter>\n ) : (\n footer\n )\n }\n onAppear={onBottomSheetOpen}\n onAfterExit={onBottomSheetClose}\n >\n {internalError && innerErrorTrls && <SelectError innerErrorTrls={innerErrorTrls} reload={reload} />}\n {emptyOptionsSearchHintVisible && (\n <div className={styles.fullScreenPlaceholder}>{emptyOptionsSearchHint}</div>\n )}\n {emptyOptionsHintVisible && <div className={styles.fullScreenPlaceholder}>{emptyOptionsHint}</div>}\n {loading && !showErrorPlaceholder && (\n <div className={styles.fullScreenPlaceholder}>\n <Loader size={24} />\n </div>\n )}\n {showErrorPlaceholder && <div className={styles.errorWrapper}>{error && error.placeholder}</div>}\n {optionsVisible && (\n <div\n role={'listbox'}\n className={classnames(styles.selectBottomSheet, styles[`select-bottom-sheet_${type}`], {\n [styles.selectBottomSheetWithoutHeader]: !haveHeader,\n })}\n data-qa=\"magritte-select-option-list-on-xs\"\n >\n {optionList.map(({ disabled: _disabled, type: optionType, ...option }) => {\n const checked = Boolean(option.data && getChecked<DataType>(option.data, values ?? []));\n const disabled = !checked && (_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={optionType || type}\n plain={type === 'label'}\n multiple={multiple}\n data-qa={optionDataQa}\n isMobile\n {...option}\n />\n );\n })}\n </div>\n )}\n </BottomSheet>\n {renderAlertOnExitWithoutSaving?.({\n alertVisible,\n onCloseAlert: () => {\n cancelCloseFuncRef.current?.();\n cancelCloseFuncRef.current = null;\n setAlertVisible(false);\n },\n onClosePickerAndAlert: () => {\n cancelCloseFuncRef.current = null;\n setAlertVisible(false);\n onClose();\n },\n })}\n </>\n );\n};\n"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
package/SelectDrop.js
CHANGED
|
@@ -22,7 +22,7 @@ import '@hh.ru/magritte-common-use-disabled';
|
|
|
22
22
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
23
23
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
24
24
|
|
|
25
|
-
var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_12-
|
|
25
|
+
var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_12-9-0","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_12-9-0","select-drop-container":"magritte-select-drop-container___hee1p_12-9-0","selectDropContainer":"magritte-select-drop-container___hee1p_12-9-0","select-drop-container_plain":"magritte-select-drop-container_plain___766zl_12-9-0","selectDropContainerPlain":"magritte-select-drop-container_plain___766zl_12-9-0","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_12-9-0","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_12-9-0","select-drop":"magritte-select-drop___jn4O-_12-9-0","selectDrop":"magritte-select-drop___jn4O-_12-9-0","select-drop-header":"magritte-select-drop-header___fMmio_12-9-0","selectDropHeader":"magritte-select-drop-header___fMmio_12-9-0","select-drop_plain":"magritte-select-drop_plain___VL8Fz_12-9-0","selectDropPlain":"magritte-select-drop_plain___VL8Fz_12-9-0","label-option":"magritte-label-option___2N7t9_12-9-0","labelOption":"magritte-label-option___2N7t9_12-9-0","loading":"magritte-loading___AMiuq_12-9-0","hint":"magritte-hint___6qaFl_12-9-0"};
|
|
26
26
|
|
|
27
27
|
const SelectOptionDefault = ({ data, input, type, plain, checked, }) => {
|
|
28
28
|
if (type === 'delimiter') {
|
package/SelectEmptyHint.js
CHANGED
|
@@ -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-
|
|
9
|
+
var styles = {"select-empty-hint":"magritte-select-empty-hint___B39XJ_12-9-0","selectEmptyHint":"magritte-select-empty-hint___B39XJ_12-9-0","icon":"magritte-icon___F0GQx_12-9-0","icon-init":"magritte-icon-init___GWK-V_12-9-0","iconInit":"magritte-icon-init___GWK-V_12-9-0","icon-search":"magritte-icon-search___ZsqO-_12-9-0","iconSearch":"magritte-icon-search___ZsqO-_12-9-0"};
|
|
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-
|
|
10
|
+
var styles = {"error-container":"magritte-error-container___t9B5w_12-9-0","errorContainer":"magritte-error-container___t9B5w_12-9-0"};
|
|
11
11
|
|
|
12
12
|
const SelectError = ({ innerErrorTrls, reload, }) => {
|
|
13
13
|
const { isMobile } = useBreakpoint();
|
package/SelectModal.js
CHANGED
|
@@ -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-modal-wrapper":"magritte-select-modal-wrapper___5BhtC_12-
|
|
27
|
+
var styles = {"select-modal-wrapper":"magritte-select-modal-wrapper___5BhtC_12-9-0","selectModalWrapper":"magritte-select-modal-wrapper___5BhtC_12-9-0","select-modal":"magritte-select-modal___f9wc6_12-9-0","selectModal":"magritte-select-modal___f9wc6_12-9-0","select-modal_plain":"magritte-select-modal_plain___0rP39_12-9-0","selectModalPlain":"magritte-select-modal_plain___0rP39_12-9-0","label-option":"magritte-label-option___kFAuR_12-9-0","labelOption":"magritte-label-option___kFAuR_12-9-0","layer-full-height":"magritte-layer-full-height___cJX-K_12-9-0","layerFullHeight":"magritte-layer-full-height___cJX-K_12-9-0"};
|
|
28
28
|
|
|
29
29
|
const SelectOptionDefault = ({ data, input, type, plain, checked, }) => {
|
|
30
30
|
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-
|
|
11
|
+
var styles = {"select-option-plain":"magritte-select-option-plain___dfz4a_12-9-0","selectOptionPlain":"magritte-select-option-plain___dfz4a_12-9-0","select-option-plain_active":"magritte-select-option-plain_active___AQSQS_12-9-0","selectOptionPlainActive":"magritte-select-option-plain_active___AQSQS_12-9-0","select-delimiter":"magritte-select-delimiter___WyeR6_12-9-0","selectDelimiter":"magritte-select-delimiter___WyeR6_12-9-0"};
|
|
12
12
|
|
|
13
13
|
const CheckableComponent = ({ type, value, checked, name, onChange, 'data-qa': dataQa, }) => {
|
|
14
14
|
if (type === 'label') {
|
package/UncontrolledSelect.js
CHANGED
|
@@ -17,7 +17,7 @@ import '@hh.ru/magritte-ui-cell';
|
|
|
17
17
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
18
18
|
import '@hh.ru/magritte-ui-input';
|
|
19
19
|
import '@hh.ru/magritte-ui-loader';
|
|
20
|
-
import '@hh.ru/magritte-ui-
|
|
20
|
+
import '@hh.ru/magritte-ui-nav-bar';
|
|
21
21
|
import './SelectError.js';
|
|
22
22
|
import '@hh.ru/magritte-ui-icon/variants/icon';
|
|
23
23
|
import '@hh.ru/magritte-ui-spacing';
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.magritte-error-container___t9B5w_12-
|
|
1
|
+
.magritte-error-container___t9B5w_12-9-0{
|
|
2
2
|
display:flex;
|
|
3
3
|
flex-direction:column;
|
|
4
4
|
align-items:center;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
justify-content:center;
|
|
7
7
|
}
|
|
8
8
|
@media (min-width: 1020px){
|
|
9
|
-
body.magritte-old-layout .magritte-error-container___t9B5w_12-
|
|
9
|
+
body.magritte-old-layout .magritte-error-container___t9B5w_12-9-0{
|
|
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-
|
|
15
|
+
body:not(.magritte-old-layout) .magritte-error-container___t9B5w_12-9-0{
|
|
16
16
|
min-height:320px;
|
|
17
17
|
height:auto;
|
|
18
18
|
}
|
|
@@ -21,89 +21,89 @@
|
|
|
21
21
|
:root{
|
|
22
22
|
--magritte-color-component-input-stroke-state-accent-focused-accessible-v24-7-1:#0070ff7a;
|
|
23
23
|
}
|
|
24
|
-
.magritte-select-option-plain___dfz4a_12-
|
|
24
|
+
.magritte-select-option-plain___dfz4a_12-9-0{
|
|
25
25
|
border-radius:8px;
|
|
26
26
|
}
|
|
27
|
-
.magritte-select-option-plain___dfz4a_12-
|
|
27
|
+
.magritte-select-option-plain___dfz4a_12-9-0.focus-visible{
|
|
28
28
|
outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v24-7-1) solid 4px;
|
|
29
29
|
}
|
|
30
|
-
.magritte-select-option-plain___dfz4a_12-
|
|
30
|
+
.magritte-select-option-plain___dfz4a_12-9-0:hover{
|
|
31
31
|
cursor:default;
|
|
32
32
|
}
|
|
33
|
-
.magritte-select-option-plain_active___AQSQS_12-
|
|
33
|
+
.magritte-select-option-plain_active___AQSQS_12-9-0:hover{
|
|
34
34
|
cursor:pointer;
|
|
35
35
|
}
|
|
36
|
-
.magritte-select-delimiter___WyeR6_12-
|
|
36
|
+
.magritte-select-delimiter___WyeR6_12-9-0{
|
|
37
37
|
padding-left:16px;
|
|
38
38
|
padding-top:12px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.magritte-select-bottom-sheet___1RZDJ_12-
|
|
41
|
+
.magritte-select-bottom-sheet___1RZDJ_12-9-0{
|
|
42
42
|
display:flex;
|
|
43
43
|
flex-direction:column;
|
|
44
44
|
padding:0 16px;
|
|
45
45
|
padding-bottom:16px;
|
|
46
46
|
}
|
|
47
|
-
.magritte-select-bottom-sheet_checkbox___hwTgo_12-
|
|
48
|
-
.magritte-select-bottom-sheet_radio___qvFFV_12-
|
|
47
|
+
.magritte-select-bottom-sheet_checkbox___hwTgo_12-9-0,
|
|
48
|
+
.magritte-select-bottom-sheet_radio___qvFFV_12-9-0{
|
|
49
49
|
gap:12px;
|
|
50
50
|
}
|
|
51
|
-
.magritte-select-bottom-sheet_without-header___KOKVh_12-
|
|
51
|
+
.magritte-select-bottom-sheet_without-header___KOKVh_12-9-0{
|
|
52
52
|
padding-top:16px;
|
|
53
53
|
}
|
|
54
|
-
.magritte-full-screen-placeholder___zPC8k_12-
|
|
54
|
+
.magritte-full-screen-placeholder___zPC8k_12-9-0{
|
|
55
55
|
display:flex;
|
|
56
56
|
flex-direction:column;
|
|
57
57
|
align-items:center;
|
|
58
58
|
height:100%;
|
|
59
59
|
justify-content:center;
|
|
60
60
|
}
|
|
61
|
-
.magritte-error-wrapper___P7jYg_12-
|
|
61
|
+
.magritte-error-wrapper___P7jYg_12-9-0{
|
|
62
62
|
height:100%;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.magritte-select-drop-container-wrapper___OHM0q_12-
|
|
65
|
+
.magritte-select-drop-container-wrapper___OHM0q_12-9-0{
|
|
66
66
|
display:flex;
|
|
67
67
|
flex-direction:column;
|
|
68
68
|
}
|
|
69
|
-
.magritte-select-drop-container___hee1p_12-
|
|
69
|
+
.magritte-select-drop-container___hee1p_12-9-0{
|
|
70
70
|
display:flex;
|
|
71
71
|
flex-direction:column;
|
|
72
72
|
padding:12px;
|
|
73
73
|
margin:calc(-1 * 12px);
|
|
74
74
|
}
|
|
75
|
-
.magritte-select-drop-container_plain___766zl_12-
|
|
75
|
+
.magritte-select-drop-container_plain___766zl_12-9-0{
|
|
76
76
|
padding:24px;
|
|
77
77
|
margin:calc(-1 * 24px);
|
|
78
78
|
}
|
|
79
|
-
.magritte-select-drop-container_with-footer___6wp-L_12-
|
|
79
|
+
.magritte-select-drop-container_with-footer___6wp-L_12-9-0{
|
|
80
80
|
margin-bottom:0;
|
|
81
81
|
padding-bottom:0;
|
|
82
82
|
}
|
|
83
|
-
.magritte-select-drop___jn4O-_12-
|
|
83
|
+
.magritte-select-drop___jn4O-_12-9-0{
|
|
84
84
|
display:flex;
|
|
85
85
|
flex-direction:column;
|
|
86
86
|
gap:8px;
|
|
87
87
|
}
|
|
88
|
-
.magritte-select-drop-header___fMmio_12-
|
|
88
|
+
.magritte-select-drop-header___fMmio_12-9-0{
|
|
89
89
|
display:flex;
|
|
90
90
|
flex-direction:column;
|
|
91
91
|
margin-bottom:8px;
|
|
92
92
|
}
|
|
93
|
-
.magritte-select-drop_plain___VL8Fz_12-
|
|
93
|
+
.magritte-select-drop_plain___VL8Fz_12-9-0{
|
|
94
94
|
gap:16px;
|
|
95
95
|
}
|
|
96
|
-
.magritte-label-option___2N7t9_12-
|
|
96
|
+
.magritte-label-option___2N7t9_12-9-0{
|
|
97
97
|
display:flex;
|
|
98
98
|
justify-content:center;
|
|
99
99
|
}
|
|
100
|
-
.magritte-loading___AMiuq_12-
|
|
100
|
+
.magritte-loading___AMiuq_12-9-0{
|
|
101
101
|
display:flex;
|
|
102
102
|
align-items:center;
|
|
103
103
|
height:150px;
|
|
104
104
|
justify-content:center;
|
|
105
105
|
}
|
|
106
|
-
.magritte-hint___6qaFl_12-
|
|
106
|
+
.magritte-hint___6qaFl_12-9-0{
|
|
107
107
|
display:flex;
|
|
108
108
|
flex-direction:column;
|
|
109
109
|
align-items:center;
|
|
@@ -111,24 +111,24 @@
|
|
|
111
111
|
justify-content:center;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.magritte-select-modal-wrapper___5BhtC_12-
|
|
114
|
+
.magritte-select-modal-wrapper___5BhtC_12-9-0{
|
|
115
115
|
display:flex;
|
|
116
116
|
flex-direction:column;
|
|
117
117
|
flex-grow:1;
|
|
118
118
|
}
|
|
119
|
-
.magritte-select-modal___f9wc6_12-
|
|
119
|
+
.magritte-select-modal___f9wc6_12-9-0{
|
|
120
120
|
display:flex;
|
|
121
121
|
flex-direction:column;
|
|
122
122
|
gap:12px;
|
|
123
123
|
}
|
|
124
|
-
.magritte-select-modal_plain___0rP39_12-
|
|
124
|
+
.magritte-select-modal_plain___0rP39_12-9-0{
|
|
125
125
|
gap:0;
|
|
126
126
|
}
|
|
127
|
-
.magritte-label-option___kFAuR_12-
|
|
127
|
+
.magritte-label-option___kFAuR_12-9-0{
|
|
128
128
|
display:flex;
|
|
129
129
|
justify-content:center;
|
|
130
130
|
}
|
|
131
|
-
.magritte-layer-full-height___cJX-K_12-
|
|
131
|
+
.magritte-layer-full-height___cJX-K_12-9-0{
|
|
132
132
|
display:flex;
|
|
133
133
|
flex-direction:column;
|
|
134
134
|
align-items:center;
|
|
@@ -155,14 +155,14 @@
|
|
|
155
155
|
--magritte-color-background-accent-secondary-v24-7-1:#F1F4F7;
|
|
156
156
|
--magritte-color-icon-accent-v24-7-1:#7195AF;
|
|
157
157
|
}
|
|
158
|
-
.magritte-select-empty-hint___B39XJ_12-
|
|
158
|
+
.magritte-select-empty-hint___B39XJ_12-9-0{
|
|
159
159
|
display:flex;
|
|
160
160
|
flex-direction:column;
|
|
161
161
|
justify-content:center;
|
|
162
162
|
align-content:center;
|
|
163
163
|
align-items:center;
|
|
164
164
|
}
|
|
165
|
-
.magritte-icon___F0GQx_12-
|
|
165
|
+
.magritte-icon___F0GQx_12-9-0{
|
|
166
166
|
display:flex;
|
|
167
167
|
align-items:center;
|
|
168
168
|
justify-content:center;
|
|
@@ -170,11 +170,11 @@
|
|
|
170
170
|
height:48px;
|
|
171
171
|
border-radius:50%;
|
|
172
172
|
}
|
|
173
|
-
.magritte-icon-init___GWK-V_12-
|
|
173
|
+
.magritte-icon-init___GWK-V_12-9-0{
|
|
174
174
|
background-color:var(--magritte-color-background-accent-secondary-v24-7-1);
|
|
175
175
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-accent-v24-7-1);
|
|
176
176
|
}
|
|
177
|
-
.magritte-icon-search___ZsqO-_12-
|
|
177
|
+
.magritte-icon-search___ZsqO-_12-9-0{
|
|
178
178
|
background-color:var(--magritte-color-background-secondary-v24-7-1);
|
|
179
179
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-tertiary-v24-7-1);
|
|
180
180
|
}
|
package/index.js
CHANGED
|
@@ -39,5 +39,5 @@ import '@hh.ru/magritte-common-data-provider';
|
|
|
39
39
|
import './useSelectState.js';
|
|
40
40
|
import '@hh.ru/magritte-ui-trigger';
|
|
41
41
|
import '@hh.ru/magritte-ui-bottom-sheet';
|
|
42
|
-
import '@hh.ru/magritte-ui-
|
|
42
|
+
import '@hh.ru/magritte-ui-nav-bar';
|
|
43
43
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-select",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.9.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.11",
|
|
34
34
|
"@hh.ru/magritte-common-use-translation": "3.1.0",
|
|
35
35
|
"@hh.ru/magritte-design-tokens": "24.7.1",
|
|
36
|
-
"@hh.ru/magritte-ui-action-bar": "5.3.
|
|
37
|
-
"@hh.ru/magritte-ui-bottom-sheet": "9.
|
|
36
|
+
"@hh.ru/magritte-ui-action-bar": "5.3.31",
|
|
37
|
+
"@hh.ru/magritte-ui-bottom-sheet": "9.4.1",
|
|
38
38
|
"@hh.ru/magritte-ui-breakpoint": "6.1.1",
|
|
39
|
-
"@hh.ru/magritte-ui-button": "7.2.
|
|
40
|
-
"@hh.ru/magritte-ui-cell": "7.2.
|
|
41
|
-
"@hh.ru/magritte-ui-checkable-card": "5.0.
|
|
42
|
-
"@hh.ru/magritte-ui-checkbox-radio": "4.1.
|
|
43
|
-
"@hh.ru/magritte-ui-drop": "12.3.
|
|
44
|
-
"@hh.ru/magritte-ui-icon": "14.2.
|
|
45
|
-
"@hh.ru/magritte-ui-input": "9.4.
|
|
46
|
-
"@hh.ru/magritte-ui-loader": "3.0.
|
|
39
|
+
"@hh.ru/magritte-ui-button": "7.2.13",
|
|
40
|
+
"@hh.ru/magritte-ui-cell": "7.2.26",
|
|
41
|
+
"@hh.ru/magritte-ui-checkable-card": "5.0.33",
|
|
42
|
+
"@hh.ru/magritte-ui-checkbox-radio": "4.1.22",
|
|
43
|
+
"@hh.ru/magritte-ui-drop": "12.3.30",
|
|
44
|
+
"@hh.ru/magritte-ui-icon": "14.2.11",
|
|
45
|
+
"@hh.ru/magritte-ui-input": "9.4.28",
|
|
46
|
+
"@hh.ru/magritte-ui-loader": "3.0.13",
|
|
47
47
|
"@hh.ru/magritte-ui-mock-component": "1.1.7",
|
|
48
|
-
"@hh.ru/magritte-ui-modal": "10.1.
|
|
49
|
-
"@hh.ru/magritte-ui-
|
|
48
|
+
"@hh.ru/magritte-ui-modal": "10.1.34",
|
|
49
|
+
"@hh.ru/magritte-ui-nav-bar": "1.5.2",
|
|
50
50
|
"@hh.ru/magritte-ui-spacing": "2.1.20",
|
|
51
|
-
"@hh.ru/magritte-ui-title": "8.
|
|
52
|
-
"@hh.ru/magritte-ui-trigger": "4.3.
|
|
53
|
-
"@hh.ru/magritte-ui-typography": "5.3.
|
|
51
|
+
"@hh.ru/magritte-ui-title": "8.3.1",
|
|
52
|
+
"@hh.ru/magritte-ui-trigger": "4.3.22",
|
|
53
|
+
"@hh.ru/magritte-ui-typography": "5.3.5"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ea2589bd27da8dbff53530b0b803ba2b2116d3bd"
|
|
56
56
|
}
|