@hh.ru/magritte-ui-select 13.0.3 → 13.0.5

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.
@@ -35,7 +35,7 @@ import './internal/useDataProvider.js';
35
35
  import './useSearchState.js';
36
36
  import './internal/SearchStateContext.js';
37
37
 
38
- var styles = {"content-placeholder":"magritte-content-placeholder___rOCxd_13-0-3","contentPlaceholder":"magritte-content-placeholder___rOCxd_13-0-3","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_13-0-3","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_13-0-3"};
38
+ var styles = {"content-placeholder":"magritte-content-placeholder___rOCxd_13-0-5","contentPlaceholder":"magritte-content-placeholder___rOCxd_13-0-5","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_13-0-5","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_13-0-5"};
39
39
 
40
40
  const ACTION_BAR_DEFAULT_PROPS = { type: 'vertical', padding: 16, showDivider: false };
41
41
  const SelectBottomSheetComponentRenderFunc = ({ children, footer, header, ...props }, ref) => {
@@ -62,7 +62,10 @@ const SelectBottomSheetComponentRenderFunc = ({ children, footer, header, ...pro
62
62
  }, [onCloseRequestWithUnsavedChanges]);
63
63
  return (jsxs(BottomSheet, { ...props, height: props.height ?? 'full-screen', ref: bottomSheetRefCallback, allowScrollWhileFocused: true, keyboardOverlaysFooter: false, visible:
64
64
  // bottom-sheet хотим показывать, если был включен showOptions без учета contentState
65
- showOptions, withContentPaddings: contentState === 'external-error' || (contentState === 'provider-error' && Boolean(providerError)), header: header, footer: pickerFooter ? (jsx(ActionBarDefaultPropsContext, { props: ACTION_BAR_DEFAULT_PROPS, children: pickerFooter })) : undefined, onClose: onClose, children: [contentState === 'loading' && (jsx("div", { className: styles.contentPlaceholder, children: jsx(Loader, { size: 24 }) })), contentState === 'provider-error' && jsx(SelectError, {}), contentState === 'external-error' && errorExternal?.placeholder, contentState === 'empty-hint' && emptyHint, contentState === 'empty-search-hint' && emptySearchHint, contentState === 'options' && (jsx("div", { className: classnames({ [styles.selectBottomSheetWithoutHeader]: !header }), children: children }))] }));
65
+ showOptions, withContentPaddings: contentState === 'external-error' || (contentState === 'provider-error' && Boolean(providerError)), header: header, footer: pickerFooter ? (jsx(ActionBarDefaultPropsContext, { props: ACTION_BAR_DEFAULT_PROPS, children: pickerFooter })) : undefined, onClose: onClose, children: [contentState === 'loading' && (jsx("div", { className: styles.contentPlaceholder, children: jsx(Loader, { size: 24 }) })), contentState === 'provider-error' && jsx(SelectError, {}), contentState === 'external-error' && errorExternal?.placeholder, contentState === 'empty-hint' && emptyHint, contentState === 'empty-search-hint' && emptySearchHint, (contentState === 'options' ||
66
+ contentState === 'pending' ||
67
+ (contentState === 'empty-hint' && !emptyHint) ||
68
+ (contentState === 'empty-search-hint' && !emptySearchHint)) && (jsx("div", { className: classnames({ [styles.selectBottomSheetWithoutHeader]: !header }), children: children }))] }));
66
69
  };
67
70
  const SelectBottomSheetComponent = forwardRef(SelectBottomSheetComponentRenderFunc);
68
71
  SelectBottomSheetComponent.displayName = 'SelectBottomSheetComponent';
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBottomSheet.js","sources":["src/SelectBottomSheet.tsx"],"sourcesContent":["import { ReactElement, ComponentProps, forwardRef, ForwardedRef, useCallback } from 'react';\nimport classnames from 'classnames';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { ActionBarProps, ActionBarDefaultPropsContext } from '@hh.ru/magritte-ui-action-bar';\nimport { BottomSheet, BottomSheetFooter } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { SelectPickerProvider, useSelectPicker } from '@hh.ru/magritte-ui-select/SelectPickerContext';\nimport { SelectError } from '@hh.ru/magritte-ui-select/internal/SelectError';\nimport { SelectReloadButton } from '@hh.ru/magritte-ui-select/internal/SelectReloadButton';\nimport { useRegisterSelectElementsSlot } from '@hh.ru/magritte-ui-select/internal/slots';\nimport { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';\nimport { useSelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\nimport { useSelectError } from '@hh.ru/magritte-ui-select/useSelectError';\nimport { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';\nimport { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';\n\nimport styles from './select-bottom-sheet.less';\n\ntype SelectBottomSheetProps = Omit<\n ComponentProps<typeof BottomSheet>,\n 'allowScrollWhileFocused' | 'keyboardOverlaysFooter' | 'visible' | 'withContentPaddings' | 'onClose' | 'ref'\n>;\n\nconst ACTION_BAR_DEFAULT_PROPS: Partial<ActionBarProps> = { type: 'vertical', padding: 16, showDivider: false };\n\nconst SelectBottomSheetComponentRenderFunc = (\n { children, footer, header, ...props }: SelectBottomSheetProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement => {\n const { isMobile } = useBreakpoint();\n const pickerRef = usePickerRef(isMobile);\n const bottomSheetRefCallback = useMultipleRefs(pickerRef, ref);\n\n useRegisterSelectElementsSlot('keepPickerOpenOnBlur', isMobile || undefined);\n\n const { showOptions } = useVisibility();\n\n const { error: errorExternal, providerError } = useSelectError();\n\n const contentState = useSelectContentState();\n\n const { emptyHint, emptySearchHint } = useSelectHint();\n\n let pickerFooter = footer;\n if (contentState === 'external-error') {\n pickerFooter = <BottomSheetFooter>{errorExternal?.resetButton}</BottomSheetFooter>;\n } else if (contentState === 'provider-error' && providerError) {\n pickerFooter = (\n <BottomSheetFooter>\n <SelectReloadButton label={providerError.reloadButton} />\n </BottomSheetFooter>\n );\n }\n\n const { onCloseRequestWithUnsavedChanges } = useSelectPicker();\n\n const onClose = useCallback(\n (cancelCloseFunc: VoidFunction | null) => {\n if (!onCloseRequestWithUnsavedChanges()) {\n cancelCloseFunc?.();\n }\n },\n [onCloseRequestWithUnsavedChanges]\n );\n\n return (\n <BottomSheet\n {...props}\n height={props.height ?? 'full-screen'}\n ref={bottomSheetRefCallback}\n allowScrollWhileFocused\n keyboardOverlaysFooter={false}\n visible={\n // bottom-sheet хотим показывать, если был включен showOptions без учета contentState\n showOptions\n }\n withContentPaddings={\n contentState === 'external-error' || (contentState === 'provider-error' && Boolean(providerError))\n }\n header={header}\n footer={\n pickerFooter ? (\n <ActionBarDefaultPropsContext props={ACTION_BAR_DEFAULT_PROPS}>\n {pickerFooter}\n </ActionBarDefaultPropsContext>\n ) : undefined\n }\n onClose={onClose}\n >\n {contentState === 'loading' && (\n <div className={styles.contentPlaceholder}>\n <Loader size={24} />\n </div>\n )}\n {contentState === 'provider-error' && <SelectError />}\n {contentState === 'external-error' && errorExternal?.placeholder}\n {contentState === 'empty-hint' && emptyHint}\n {contentState === 'empty-search-hint' && emptySearchHint}\n {contentState === 'options' && (\n <div className={classnames({ [styles.selectBottomSheetWithoutHeader]: !header })}>{children}</div>\n )}\n </BottomSheet>\n );\n};\n\nconst SelectBottomSheetComponent = forwardRef<HTMLElement, SelectBottomSheetProps>(\n SelectBottomSheetComponentRenderFunc\n);\nSelectBottomSheetComponent.displayName = 'SelectBottomSheetComponent';\n\nconst SelectBottomSheetRenderFunc = (\n { children, ...props }: SelectBottomSheetProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement => {\n return (\n <SelectPickerProvider>\n <SelectBottomSheetComponent {...props} ref={ref}>\n {children}\n </SelectBottomSheetComponent>\n </SelectPickerProvider>\n );\n};\n\n/** Пикер Select в виде BottomSheet */\nconst SelectBottomSheet = forwardRef<HTMLElement, SelectBottomSheetProps>(SelectBottomSheetRenderFunc);\nSelectBottomSheet.displayName = 'SelectBottomSheet';\n\nexport { SelectBottomSheet };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,wBAAwB,GAA4B,EAA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EAChB;AACN,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,UAAU,CACzC,oCAAoC,CACvC,CAAC;AACF,0BAA0B,CAAC,WAAW,GAAG,4BAA4B,CAAC;AAEtE,MAAM,2BAA2B,GAAG,CAChC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA0B,EAC9C,GAA8B,KAChB;AACd,IAAA,QACIA,GAAC,CAAA,oBAAoB,EACjB,EAAA,QAAA,EAAAA,GAAA,CAAC,0BAA0B,EAAK,EAAA,GAAA,KAAK,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EAC1C,QAAQ,EACgB,CAAA,EAAA,CACV,EACzB;AACN,CAAC,CAAC;AAEF;AACA,MAAM,iBAAiB,GAAG,UAAU,CAAsC,2BAA2B,EAAE;AACvG,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
1
+ {"version":3,"file":"SelectBottomSheet.js","sources":["src/SelectBottomSheet.tsx"],"sourcesContent":["import { ReactElement, ComponentProps, forwardRef, ForwardedRef, useCallback } from 'react';\nimport classnames from 'classnames';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { ActionBarProps, ActionBarDefaultPropsContext } from '@hh.ru/magritte-ui-action-bar';\nimport { BottomSheet, BottomSheetFooter } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { SelectPickerProvider, useSelectPicker } from '@hh.ru/magritte-ui-select/SelectPickerContext';\nimport { SelectError } from '@hh.ru/magritte-ui-select/internal/SelectError';\nimport { SelectReloadButton } from '@hh.ru/magritte-ui-select/internal/SelectReloadButton';\nimport { useRegisterSelectElementsSlot } from '@hh.ru/magritte-ui-select/internal/slots';\nimport { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';\nimport { useSelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\nimport { useSelectError } from '@hh.ru/magritte-ui-select/useSelectError';\nimport { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';\nimport { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';\n\nimport styles from './select-bottom-sheet.less';\n\ntype SelectBottomSheetProps = Omit<\n ComponentProps<typeof BottomSheet>,\n 'allowScrollWhileFocused' | 'keyboardOverlaysFooter' | 'visible' | 'withContentPaddings' | 'onClose' | 'ref'\n>;\n\nconst ACTION_BAR_DEFAULT_PROPS: Partial<ActionBarProps> = { type: 'vertical', padding: 16, showDivider: false };\n\nconst SelectBottomSheetComponentRenderFunc = (\n { children, footer, header, ...props }: SelectBottomSheetProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement => {\n const { isMobile } = useBreakpoint();\n const pickerRef = usePickerRef(isMobile);\n const bottomSheetRefCallback = useMultipleRefs(pickerRef, ref);\n\n useRegisterSelectElementsSlot('keepPickerOpenOnBlur', isMobile || undefined);\n\n const { showOptions } = useVisibility();\n\n const { error: errorExternal, providerError } = useSelectError();\n\n const contentState = useSelectContentState();\n\n const { emptyHint, emptySearchHint } = useSelectHint();\n\n let pickerFooter = footer;\n if (contentState === 'external-error') {\n pickerFooter = <BottomSheetFooter>{errorExternal?.resetButton}</BottomSheetFooter>;\n } else if (contentState === 'provider-error' && providerError) {\n pickerFooter = (\n <BottomSheetFooter>\n <SelectReloadButton label={providerError.reloadButton} />\n </BottomSheetFooter>\n );\n }\n\n const { onCloseRequestWithUnsavedChanges } = useSelectPicker();\n\n const onClose = useCallback(\n (cancelCloseFunc: VoidFunction | null) => {\n if (!onCloseRequestWithUnsavedChanges()) {\n cancelCloseFunc?.();\n }\n },\n [onCloseRequestWithUnsavedChanges]\n );\n\n return (\n <BottomSheet\n {...props}\n height={props.height ?? 'full-screen'}\n ref={bottomSheetRefCallback}\n allowScrollWhileFocused\n keyboardOverlaysFooter={false}\n visible={\n // bottom-sheet хотим показывать, если был включен showOptions без учета contentState\n showOptions\n }\n withContentPaddings={\n contentState === 'external-error' || (contentState === 'provider-error' && Boolean(providerError))\n }\n header={header}\n footer={\n pickerFooter ? (\n <ActionBarDefaultPropsContext props={ACTION_BAR_DEFAULT_PROPS}>\n {pickerFooter}\n </ActionBarDefaultPropsContext>\n ) : undefined\n }\n onClose={onClose}\n >\n {contentState === 'loading' && (\n <div className={styles.contentPlaceholder}>\n <Loader size={24} />\n </div>\n )}\n {contentState === 'provider-error' && <SelectError />}\n {contentState === 'external-error' && errorExternal?.placeholder}\n {contentState === 'empty-hint' && emptyHint}\n {contentState === 'empty-search-hint' && emptySearchHint}\n {(contentState === 'options' ||\n contentState === 'pending' ||\n (contentState === 'empty-hint' && !emptyHint) ||\n (contentState === 'empty-search-hint' && !emptySearchHint)) && (\n <div className={classnames({ [styles.selectBottomSheetWithoutHeader]: !header })}>{children}</div>\n )}\n </BottomSheet>\n );\n};\n\nconst SelectBottomSheetComponent = forwardRef<HTMLElement, SelectBottomSheetProps>(\n SelectBottomSheetComponentRenderFunc\n);\nSelectBottomSheetComponent.displayName = 'SelectBottomSheetComponent';\n\nconst SelectBottomSheetRenderFunc = (\n { children, ...props }: SelectBottomSheetProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement => {\n return (\n <SelectPickerProvider>\n <SelectBottomSheetComponent {...props} ref={ref}>\n {children}\n </SelectBottomSheetComponent>\n </SelectPickerProvider>\n );\n};\n\n/** Пикер Select в виде BottomSheet */\nconst SelectBottomSheet = forwardRef<HTMLElement, SelectBottomSheetProps>(SelectBottomSheetRenderFunc);\nSelectBottomSheet.displayName = 'SelectBottomSheet';\n\nexport { SelectBottomSheet };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,wBAAwB,GAA4B,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAEhH,MAAM,oCAAoC,GAAG,CACzC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM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AAU,CACzC,oCAAoC,CACvC,CAAC;AACF,0BAA0B,CAAC,WAAW,GAAG,4BAA4B,CAAC;AAEtE,MAAM,2BAA2B,GAAG,CAChC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA0B,EAC9C,GAA8B,KAChB;AACd,IAAA,QACIA,GAAC,CAAA,oBAAoB,EACjB,EAAA,QAAA,EAAAA,GAAA,CAAC,0BAA0B,EAAK,EAAA,GAAA,KAAK,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EAC1C,QAAQ,EACgB,CAAA,EAAA,CACV,EACzB;AACN,CAAC,CAAC;AAEF;AACA,MAAM,iBAAiB,GAAG,UAAU,CAAsC,2BAA2B,EAAE;AACvG,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
package/SelectDrop.js CHANGED
@@ -35,7 +35,7 @@ import '@hh.ru/magritte-ui-spacing';
35
35
  import '@hh.ru/magritte-ui-title';
36
36
  import '@hh.ru/magritte-ui-typography';
37
37
 
38
- var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_13-0-3","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_13-0-3","select-drop-container":"magritte-select-drop-container___hee1p_13-0-3","selectDropContainer":"magritte-select-drop-container___hee1p_13-0-3","select-drop-container_plain":"magritte-select-drop-container_plain___766zl_13-0-3","selectDropContainerPlain":"magritte-select-drop-container_plain___766zl_13-0-3","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_13-0-3","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_13-0-3","select-drop-loading":"magritte-select-drop-loading___KsNuw_13-0-3","selectDropLoading":"magritte-select-drop-loading___KsNuw_13-0-3"};
38
+ var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_13-0-5","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_13-0-5","select-drop-container":"magritte-select-drop-container___hee1p_13-0-5","selectDropContainer":"magritte-select-drop-container___hee1p_13-0-5","select-drop-container_plain":"magritte-select-drop-container_plain___766zl_13-0-5","selectDropContainerPlain":"magritte-select-drop-container_plain___766zl_13-0-5","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_13-0-5","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_13-0-5","select-drop-loading":"magritte-select-drop-loading___KsNuw_13-0-5","selectDropLoading":"magritte-select-drop-loading___KsNuw_13-0-5"};
39
39
 
40
40
  const DROP_PLACEMENT = ['bottom-left', 'top-left', 'bottom-right', 'top-right'];
41
41
  const ACTION_BAR_DEFAULT_PROPS = { type: 'vertical', padding: 0, showDivider: false };
@@ -91,7 +91,11 @@ const SelectDropComponentRenderFunc = ({ onClose: onCloseExternal, widthEqualToA
91
91
  discardChanges();
92
92
  onCloseRequestWithUnsavedChanges();
93
93
  onClose?.();
94
- }, closeByClickOutside: false, widthEqualToActivator: widthEqualToActivator || (contentState === 'loading' && width === undefined), forcePlacement: true, returnFocusOnClose: false, footer: footer ? (jsx(ActionBarDefaultPropsContext, { props: ACTION_BAR_DEFAULT_PROPS, children: footer })) : undefined, id: pickerId, role: "dialog", children: jsx("div", { className: styles.selectDropContainerWrapper, style: { maxHeight: `${maxHeight}px` }, children: jsxs("div", { className: classnames(styles.selectDropContainer, { [styles.selectDropContainerPlain]: plain }, { [styles.selectDropContainerWithFooter]: Boolean(footer) }), children: [contentState === 'loading' && (jsx("div", { className: styles.selectDropLoading, children: jsx(Loader, { size: 24 }) })), contentState === 'provider-error' && jsx(SelectError, {}), contentState === 'empty-hint' && emptyHint, contentState === 'empty-search-hint' && emptySearchHint, contentState === 'options' && children] }) }) }));
94
+ }, closeByClickOutside: false, widthEqualToActivator: widthEqualToActivator || (contentState === 'loading' && width === undefined), forcePlacement: true, returnFocusOnClose: false, footer: footer ? (jsx(ActionBarDefaultPropsContext, { props: ACTION_BAR_DEFAULT_PROPS, children: footer })) : undefined, id: pickerId, role: "dialog", children: jsx("div", { className: styles.selectDropContainerWrapper, style: { maxHeight: `${maxHeight}px` }, children: jsxs("div", { className: classnames(styles.selectDropContainer, { [styles.selectDropContainerPlain]: plain }, { [styles.selectDropContainerWithFooter]: Boolean(footer) }), children: [contentState === 'loading' && (jsx("div", { className: styles.selectDropLoading, children: jsx(Loader, { size: 24 }) })), contentState === 'provider-error' && jsx(SelectError, {}), contentState === 'empty-hint' && emptyHint, contentState === 'empty-search-hint' && emptySearchHint, (contentState === 'options' ||
95
+ contentState === 'pending' ||
96
+ (contentState === 'empty-hint' && !emptyHint) ||
97
+ (contentState === 'empty-search-hint' && !emptySearchHint)) &&
98
+ children] }) }) }));
95
99
  };
96
100
  const SelectDropComponent = forwardRef(SelectDropComponentRenderFunc);
97
101
  SelectDropComponent.displayName = 'SelectDropComponent';
package/SelectDrop.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDrop.js","sources":["src/SelectDrop.tsx"],"sourcesContent":["import { type ReactElement, useId, ComponentProps, useEffect, forwardRef, ForwardedRef } from 'react';\nimport classnames from 'classnames';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { ActionBarProps, ActionBarDefaultPropsContext } from '@hh.ru/magritte-ui-action-bar';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Drop } from '@hh.ru/magritte-ui-drop';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { SelectPickerProvider, useSelectPicker } from '@hh.ru/magritte-ui-select/SelectPickerContext';\nimport { SelectError } from '@hh.ru/magritte-ui-select/internal/SelectError';\nimport { useSelectElementsValue, useRegisterSelectElementsSlot } from '@hh.ru/magritte-ui-select/internal/slots';\nimport { useEventCallback, isElementInsideActivatorOrPicker } from '@hh.ru/magritte-ui-select/internal/utils';\nimport { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';\nimport { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';\nimport { useSelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\nimport { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';\nimport { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';\n\nimport styles from './select-drop.less';\n\ntype SelectDropProps = Omit<\n ComponentProps<typeof Drop>,\n | 'id'\n | 'placement'\n | 'autoFocusWhenOpened'\n | 'role'\n | 'keyboardNavigationMode'\n | 'closeByClickOutside'\n | 'padding'\n | 'forcePlacement'\n | 'visible'\n | 'activatorRef'\n | 'returnFocusOnClose'\n | 'ref'\n>;\n\ninterface SelectDropHelper {\n /**\n * По умолчанию, drop закрывается, если список опций пуст\n * Свойство позволяет держать drop открытым, даже если опций нет\n * Подходит для реализации поиска внутри drop\n */\n forceDropVisibleWithEmptyOptions?: boolean;\n /** Максимальная высота выпадающего блока для desktop */\n maxHeight?: number;\n}\n\nconst DROP_PLACEMENT = ['bottom-left', 'top-left', 'bottom-right', 'top-right'];\n\nconst ACTION_BAR_DEFAULT_PROPS: Partial<ActionBarProps> = { type: 'vertical', padding: 0, showDivider: false };\n\nconst SelectDropComponentRenderFunc = (\n {\n onClose: onCloseExternal,\n widthEqualToActivator = true,\n forceDropVisibleWithEmptyOptions,\n maxHeight = 460,\n width,\n children,\n footer,\n ...props\n }: SelectDropProps & SelectDropHelper,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const pickerId = useId();\n const { isMobile } = useBreakpoint();\n const pickerRef = usePickerRef(!isMobile);\n const dropRefCallback = useMultipleRefs(pickerRef, ref);\n\n const onClose = useEventCallback(onCloseExternal);\n\n const activatorRef = useSelectElementsValue('activatorRef');\n const plain = useSelectElementsValue('plain');\n\n const { showOptions } = useVisibility();\n const { hasProviderError, hasEmptyHint, hasEmptySearchHint } = useSelectConfig();\n const { emptyHint, emptySearchHint } = useSelectHint();\n\n const contentState = useSelectContentState();\n\n useRegisterSelectElementsSlot('pickerId', !isMobile ? pickerId : undefined);\n\n const { discardChanges, onCloseRequestWithUnsavedChanges } = useSelectPicker();\n\n // не переоткрываем select при клике на тригер\n useEffect(() => {\n if (!showOptions || isMobile || !activatorRef) {\n return void 0;\n }\n const controller = new AbortController();\n const closeOnOutsideInteraction = (event: Event) => {\n if (isElementInsideActivatorOrPicker(activatorRef, pickerRef, event.target as Node)) {\n return;\n }\n controller.abort();\n discardChanges();\n onCloseRequestWithUnsavedChanges();\n };\n document.addEventListener('focus', closeOnOutsideInteraction, { capture: true, signal: controller.signal });\n document.addEventListener('click', closeOnOutsideInteraction, { capture: true, signal: controller.signal });\n return () => controller.abort();\n }, [isMobile, activatorRef, showOptions, discardChanges, onCloseRequestWithUnsavedChanges, pickerRef]);\n\n if (!activatorRef) {\n return null;\n }\n\n return (\n <Drop\n {...props}\n ref={dropRefCallback}\n width={width}\n autoFocusWhenOpened={false}\n visible={\n /**\n * пикер в виде дропа хотим показывать, если был включен showOptions и при этом\n * - есть что показать: опции, лоадер, ошибка провайдера или подсказка\n * - либо потребитель держит дроп открытым сам\n * внешняя ошибка (external-error) в дроп не попадает — её показывает тригер\n */\n showOptions &&\n (contentState === 'options' ||\n (contentState === 'empty-hint' && hasEmptyHint) ||\n (contentState === 'empty-search-hint' && hasEmptySearchHint) ||\n (contentState === 'provider-error' && hasProviderError) ||\n contentState === 'loading' ||\n forceDropVisibleWithEmptyOptions)\n }\n placement={DROP_PLACEMENT}\n activatorRef={activatorRef}\n padding={plain ? 24 : 12}\n keyboardNavigationMode=\"list\"\n onClose={() => {\n discardChanges();\n onCloseRequestWithUnsavedChanges();\n onClose?.();\n }}\n closeByClickOutside={false}\n widthEqualToActivator={widthEqualToActivator || (contentState === 'loading' && width === undefined)}\n forcePlacement\n returnFocusOnClose={false}\n footer={\n footer ? (\n <ActionBarDefaultPropsContext props={ACTION_BAR_DEFAULT_PROPS}>\n {footer}\n </ActionBarDefaultPropsContext>\n ) : undefined\n }\n id={pickerId}\n role=\"dialog\"\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]: Boolean(footer) }\n )}\n >\n {contentState === 'loading' && (\n <div className={styles.selectDropLoading}>\n <Loader size={24} />\n </div>\n )}\n {contentState === 'provider-error' && <SelectError />}\n {contentState === 'empty-hint' && emptyHint}\n {contentState === 'empty-search-hint' && emptySearchHint}\n {contentState === 'options' && children}\n </div>\n </div>\n </Drop>\n );\n};\n\nconst SelectDropComponent = forwardRef<HTMLElement, SelectDropProps & SelectDropHelper>(SelectDropComponentRenderFunc);\nSelectDropComponent.displayName = 'SelectDropComponent';\n\nconst SelectDropRenderFunc = (\n { children, ...props }: SelectDropProps & SelectDropHelper,\n ref: ForwardedRef<HTMLElement>\n): ReactElement => {\n return (\n <SelectPickerProvider>\n <SelectDropComponent {...props} ref={ref}>\n {children}\n </SelectDropComponent>\n </SelectPickerProvider>\n );\n};\n\n/** Пикер Select в виде Drop */\nconst SelectDrop = forwardRef<HTMLElement, SelectDropProps & SelectDropHelper>(SelectDropRenderFunc);\nSelectDrop.displayName = 'SelectDrop';\n\nexport { SelectDrop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAEhF,MAAM,wBAAwB,GAA4B,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAE/G,MAAM,6BAA6B,GAAG,CAClC,EACI,OAAO,EAAE,eAAe,EACxB,qBAAqB,GAAG,IAAI,EAC5B,gCAAgC,EAChC,SAAS,GAAG,GAAG,EACf,KAAK,EACL,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACyB,EACrC,GAA8B,KACT;AACrB,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC;AACzB,IAAA,MAAM,EAAE,QAAQ,EAAE,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,KAChB;AACd,IAAA,QACIA,GAAC,CAAA,oBAAoB,EACjB,EAAA,QAAA,EAAAA,GAAA,CAAC,mBAAmB,EAAK,EAAA,GAAA,KAAK,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EACnC,QAAQ,EACS,CAAA,EAAA,CACH,EACzB;AACN,CAAC,CAAC;AAEF;AACA,MAAM,UAAU,GAAG,UAAU,CAAkD,oBAAoB,EAAE;AACrG,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"SelectDrop.js","sources":["src/SelectDrop.tsx"],"sourcesContent":["import { type ReactElement, useId, ComponentProps, useEffect, forwardRef, ForwardedRef } from 'react';\nimport classnames from 'classnames';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { ActionBarProps, ActionBarDefaultPropsContext } from '@hh.ru/magritte-ui-action-bar';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Drop } from '@hh.ru/magritte-ui-drop';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { SelectPickerProvider, useSelectPicker } from '@hh.ru/magritte-ui-select/SelectPickerContext';\nimport { SelectError } from '@hh.ru/magritte-ui-select/internal/SelectError';\nimport { useSelectElementsValue, useRegisterSelectElementsSlot } from '@hh.ru/magritte-ui-select/internal/slots';\nimport { useEventCallback, isElementInsideActivatorOrPicker } from '@hh.ru/magritte-ui-select/internal/utils';\nimport { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';\nimport { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';\nimport { useSelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\nimport { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';\nimport { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';\n\nimport styles from './select-drop.less';\n\ntype SelectDropProps = Omit<\n ComponentProps<typeof Drop>,\n | 'id'\n | 'placement'\n | 'autoFocusWhenOpened'\n | 'role'\n | 'keyboardNavigationMode'\n | 'closeByClickOutside'\n | 'padding'\n | 'forcePlacement'\n | 'visible'\n | 'activatorRef'\n | 'returnFocusOnClose'\n | 'ref'\n>;\n\ninterface SelectDropHelper {\n /**\n * По умолчанию, drop закрывается, если список опций пуст\n * Свойство позволяет держать drop открытым, даже если опций нет\n * Подходит для реализации поиска внутри drop\n */\n forceDropVisibleWithEmptyOptions?: boolean;\n /** Максимальная высота выпадающего блока для desktop */\n maxHeight?: number;\n}\n\nconst DROP_PLACEMENT = ['bottom-left', 'top-left', 'bottom-right', 'top-right'];\n\nconst ACTION_BAR_DEFAULT_PROPS: Partial<ActionBarProps> = { type: 'vertical', padding: 0, showDivider: false };\n\nconst SelectDropComponentRenderFunc = (\n {\n onClose: onCloseExternal,\n widthEqualToActivator = true,\n forceDropVisibleWithEmptyOptions,\n maxHeight = 460,\n width,\n children,\n footer,\n ...props\n }: SelectDropProps & SelectDropHelper,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const pickerId = useId();\n const { isMobile } = useBreakpoint();\n const pickerRef = usePickerRef(!isMobile);\n const dropRefCallback = useMultipleRefs(pickerRef, ref);\n\n const onClose = useEventCallback(onCloseExternal);\n\n const activatorRef = useSelectElementsValue('activatorRef');\n const plain = useSelectElementsValue('plain');\n\n const { showOptions } = useVisibility();\n const { hasProviderError, hasEmptyHint, hasEmptySearchHint } = useSelectConfig();\n const { emptyHint, emptySearchHint } = useSelectHint();\n\n const contentState = useSelectContentState();\n\n useRegisterSelectElementsSlot('pickerId', !isMobile ? pickerId : undefined);\n\n const { discardChanges, onCloseRequestWithUnsavedChanges } = useSelectPicker();\n\n // не переоткрываем select при клике на тригер\n useEffect(() => {\n if (!showOptions || isMobile || !activatorRef) {\n return void 0;\n }\n const controller = new AbortController();\n const closeOnOutsideInteraction = (event: Event) => {\n if (isElementInsideActivatorOrPicker(activatorRef, pickerRef, event.target as Node)) {\n return;\n }\n controller.abort();\n discardChanges();\n onCloseRequestWithUnsavedChanges();\n };\n document.addEventListener('focus', closeOnOutsideInteraction, { capture: true, signal: controller.signal });\n document.addEventListener('click', closeOnOutsideInteraction, { capture: true, signal: controller.signal });\n return () => controller.abort();\n }, [isMobile, activatorRef, showOptions, discardChanges, onCloseRequestWithUnsavedChanges, pickerRef]);\n\n if (!activatorRef) {\n return null;\n }\n\n return (\n <Drop\n {...props}\n ref={dropRefCallback}\n width={width}\n autoFocusWhenOpened={false}\n visible={\n /**\n * пикер в виде дропа хотим показывать, если был включен showOptions и при этом\n * - есть что показать: опции, лоадер, ошибка провайдера или подсказка\n * - либо потребитель держит дроп открытым сам\n * внешняя ошибка (external-error) в дроп не попадает — её показывает тригер\n */\n showOptions &&\n (contentState === 'options' ||\n (contentState === 'empty-hint' && hasEmptyHint) ||\n (contentState === 'empty-search-hint' && hasEmptySearchHint) ||\n (contentState === 'provider-error' && hasProviderError) ||\n contentState === 'loading' ||\n forceDropVisibleWithEmptyOptions)\n }\n placement={DROP_PLACEMENT}\n activatorRef={activatorRef}\n padding={plain ? 24 : 12}\n keyboardNavigationMode=\"list\"\n onClose={() => {\n discardChanges();\n onCloseRequestWithUnsavedChanges();\n onClose?.();\n }}\n closeByClickOutside={false}\n widthEqualToActivator={widthEqualToActivator || (contentState === 'loading' && width === undefined)}\n forcePlacement\n returnFocusOnClose={false}\n footer={\n footer ? (\n <ActionBarDefaultPropsContext props={ACTION_BAR_DEFAULT_PROPS}>\n {footer}\n </ActionBarDefaultPropsContext>\n ) : undefined\n }\n id={pickerId}\n role=\"dialog\"\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]: Boolean(footer) }\n )}\n >\n {contentState === 'loading' && (\n <div className={styles.selectDropLoading}>\n <Loader size={24} />\n </div>\n )}\n {contentState === 'provider-error' && <SelectError />}\n {contentState === 'empty-hint' && emptyHint}\n {contentState === 'empty-search-hint' && emptySearchHint}\n {(contentState === 'options' ||\n contentState === 'pending' ||\n (contentState === 'empty-hint' && !emptyHint) ||\n (contentState === 'empty-search-hint' && !emptySearchHint)) &&\n children}\n </div>\n </div>\n </Drop>\n );\n};\n\nconst SelectDropComponent = forwardRef<HTMLElement, SelectDropProps & SelectDropHelper>(SelectDropComponentRenderFunc);\nSelectDropComponent.displayName = 'SelectDropComponent';\n\nconst SelectDropRenderFunc = (\n { children, ...props }: SelectDropProps & SelectDropHelper,\n ref: ForwardedRef<HTMLElement>\n): ReactElement => {\n return (\n <SelectPickerProvider>\n <SelectDropComponent {...props} ref={ref}>\n {children}\n </SelectDropComponent>\n </SelectPickerProvider>\n );\n};\n\n/** Пикер Select в виде Drop */\nconst SelectDrop = forwardRef<HTMLElement, SelectDropProps & SelectDropHelper>(SelectDropRenderFunc);\nSelectDrop.displayName = 'SelectDrop';\n\nexport { SelectDrop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAEhF,MAAM,wBAAwB,GAA4B,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAE/G,MAAM,6BAA6B,GAAG,CAClC,EACI,OAAO,EAAE,eAAe,EACxB,qBAAqB,GAAG,IAAI,EAC5B,gCAAgC,EAChC,SAAS,GAAG,GAAG,EACf,KAAK,EACL,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACyB,EACrC,GAA8B,KACT;AACrB,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC;AACzB,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;AACrC,IAAA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,eA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,EAAE,GAAG,KAAK,EAAsC,EAC1D,GAA8B,KAChB;AACd,IAAA,QACIA,GAAC,CAAA,oBAAoB,EACjB,EAAA,QAAA,EAAAA,GAAA,CAAC,mBAAmB,EAAK,EAAA,GAAA,KAAK,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EACnC,QAAQ,EACS,CAAA,EAAA,CACH,EACzB;AACN,CAAC,CAAC;AAEF;AACA,MAAM,UAAU,GAAG,UAAU,CAAkD,oBAAoB,EAAE;AACrG,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
@@ -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_13-0-3","selectEmptyHint":"magritte-select-empty-hint___B39XJ_13-0-3","icon":"magritte-icon___F0GQx_13-0-3","icon-empty":"magritte-icon-empty___sAFRT_13-0-3","iconEmpty":"magritte-icon-empty___sAFRT_13-0-3","icon-empty-search":"magritte-icon-empty-search___O0pus_13-0-3","iconEmptySearch":"magritte-icon-empty-search___O0pus_13-0-3"};
9
+ var styles = {"select-empty-hint":"magritte-select-empty-hint___B39XJ_13-0-5","selectEmptyHint":"magritte-select-empty-hint___B39XJ_13-0-5","icon":"magritte-icon___F0GQx_13-0-5","icon-empty":"magritte-icon-empty___sAFRT_13-0-5","iconEmpty":"magritte-icon-empty___sAFRT_13-0-5","icon-empty-search":"magritte-icon-empty-search___O0pus_13-0-5","iconEmptySearch":"magritte-icon-empty-search___O0pus_13-0-5"};
10
10
 
11
11
  /** Дефолтное вью подсказки о пустом списке, передаётся в свойства emptyHint/emptySearchHint */
12
12
  const SelectEmptyHint = (props) => {
package/SelectOptions.js CHANGED
@@ -30,7 +30,7 @@ import '@hh.ru/magritte-common-data-provider';
30
30
  import './internal/useDataProvider.js';
31
31
  import './internal/SearchStateContext.js';
32
32
 
33
- var styles = {"options":"magritte-options___E0JN-_13-0-3","options_plain":"magritte-options_plain___-ihU5_13-0-3","optionsPlain":"magritte-options_plain___-ihU5_13-0-3","options_desktop":"magritte-options_desktop___gz7kx_13-0-3","optionsDesktop":"magritte-options_desktop___gz7kx_13-0-3","options_desktop-plain":"magritte-options_desktop-plain___L0WIC_13-0-3","optionsDesktopPlain":"magritte-options_desktop-plain___L0WIC_13-0-3"};
33
+ var styles = {"options":"magritte-options___E0JN-_13-0-5","options_plain":"magritte-options_plain___-ihU5_13-0-5","optionsPlain":"magritte-options_plain___-ihU5_13-0-5","options_desktop":"magritte-options_desktop___gz7kx_13-0-5","optionsDesktop":"magritte-options_desktop___gz7kx_13-0-5","options_desktop-plain":"magritte-options_desktop-plain___L0WIC_13-0-5","optionsDesktopPlain":"magritte-options_desktop-plain___L0WIC_13-0-5"};
34
34
 
35
35
  /** Используется для отображения списка опций */
36
36
  const SelectOptions = ({ type = 'checkbox', plain: plainExternal, className, inlineStyle, optionLayoutComponent: OptionLayoutComponentExternal, onOptionSelect: onOptionSelectExternal, 'data-qa': dataQa, }) => {
@@ -28,7 +28,7 @@ import './internal/SelectDataProvider.js';
28
28
  import '@hh.ru/magritte-common-data-provider';
29
29
  import './internal/useDataProvider.js';
30
30
 
31
- var styles = {"anchor":"magritte-anchor___0KOBD_13-0-3","anchor-stretched":"magritte-anchor-stretched___h7y6m_13-0-3","anchorStretched":"magritte-anchor-stretched___h7y6m_13-0-3","default-view":"magritte-default-view___3ptpo_13-0-3","defaultView":"magritte-default-view___3ptpo_13-0-3","input-view":"magritte-input-view___ZeEKh_13-0-3","inputView":"magritte-input-view___ZeEKh_13-0-3","hidden-view":"magritte-hidden-view___stvzX_13-0-3","hiddenView":"magritte-hidden-view___stvzX_13-0-3"};
31
+ var styles = {"anchor":"magritte-anchor___0KOBD_13-0-5","anchor-stretched":"magritte-anchor-stretched___h7y6m_13-0-5","anchorStretched":"magritte-anchor-stretched___h7y6m_13-0-5","default-view":"magritte-default-view___3ptpo_13-0-5","defaultView":"magritte-default-view___3ptpo_13-0-5","input-view":"magritte-input-view___ZeEKh_13-0-5","inputView":"magritte-input-view___ZeEKh_13-0-5","hidden-view":"magritte-hidden-view___stvzX_13-0-5","hiddenView":"magritte-hidden-view___stvzX_13-0-5"};
32
32
 
33
33
  const SelectSearchTriggerComponent = ({ 'aria-label': ariaLabel, 'data-qa': dataQa = 'magritte-select-activator', disabled, maxWidth, stretched, ...triggerProps }, ref) => {
34
34
  const { hasExternalError } = useSelectConfig();
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- .magritte-error-container___ICGpQ_13-0-3{
1
+ .magritte-error-container___ICGpQ_13-0-5{
2
2
  display:flex;
3
3
  flex-direction:column;
4
4
  align-items:center;
@@ -7,19 +7,19 @@
7
7
  text-align:center;
8
8
  }
9
9
  @media (min-width: 1020px){
10
- body.magritte-old-layout .magritte-error-container___ICGpQ_13-0-3{
10
+ body.magritte-old-layout .magritte-error-container___ICGpQ_13-0-5{
11
11
  min-height:320px;
12
12
  height:auto;
13
13
  }
14
14
  }
15
15
  @media (min-width: 1024px){
16
- body:not(.magritte-old-layout) .magritte-error-container___ICGpQ_13-0-3{
16
+ body:not(.magritte-old-layout) .magritte-error-container___ICGpQ_13-0-5{
17
17
  min-height:320px;
18
18
  height:auto;
19
19
  }
20
20
  }
21
21
 
22
- .magritte-content-placeholder___rOCxd_13-0-3{
22
+ .magritte-content-placeholder___rOCxd_13-0-5{
23
23
  display:flex;
24
24
  flex-direction:column;
25
25
  align-items:center;
@@ -27,29 +27,29 @@
27
27
  height:100%;
28
28
  text-align:center;
29
29
  }
30
- .magritte-select-bottom-sheet_without-header___KOKVh_13-0-3{
30
+ .magritte-select-bottom-sheet_without-header___KOKVh_13-0-5{
31
31
  padding-top:16px;
32
32
  }
33
33
 
34
- .magritte-select-drop-container-wrapper___OHM0q_13-0-3{
34
+ .magritte-select-drop-container-wrapper___OHM0q_13-0-5{
35
35
  display:flex;
36
36
  flex-direction:column;
37
37
  }
38
- .magritte-select-drop-container___hee1p_13-0-3{
38
+ .magritte-select-drop-container___hee1p_13-0-5{
39
39
  display:flex;
40
40
  flex-direction:column;
41
41
  padding:12px;
42
42
  margin:calc(-1 * 12px);
43
43
  }
44
- .magritte-select-drop-container_plain___766zl_13-0-3{
44
+ .magritte-select-drop-container_plain___766zl_13-0-5{
45
45
  padding:24px;
46
46
  margin:calc(-1 * 24px);
47
47
  }
48
- .magritte-select-drop-container_with-footer___6wp-L_13-0-3{
48
+ .magritte-select-drop-container_with-footer___6wp-L_13-0-5{
49
49
  margin-bottom:0;
50
50
  padding-bottom:0;
51
51
  }
52
- .magritte-select-drop-loading___KsNuw_13-0-3{
52
+ .magritte-select-drop-loading___KsNuw_13-0-5{
53
53
  display:flex;
54
54
  align-items:center;
55
55
  height:150px;
@@ -74,7 +74,7 @@
74
74
  --magritte-color-background-accent-secondary-v25-0-1:#F1F4F7;
75
75
  --magritte-color-icon-accent-v25-0-1:#7195AF;
76
76
  }
77
- .magritte-select-empty-hint___B39XJ_13-0-3{
77
+ .magritte-select-empty-hint___B39XJ_13-0-5{
78
78
  display:flex;
79
79
  flex-direction:column;
80
80
  align-items:center;
@@ -83,18 +83,18 @@
83
83
  text-align:center;
84
84
  }
85
85
  @media (min-width: 1020px){
86
- body.magritte-old-layout .magritte-select-empty-hint___B39XJ_13-0-3{
86
+ body.magritte-old-layout .magritte-select-empty-hint___B39XJ_13-0-5{
87
87
  min-height:320px;
88
88
  height:auto;
89
89
  }
90
90
  }
91
91
  @media (min-width: 1024px){
92
- body:not(.magritte-old-layout) .magritte-select-empty-hint___B39XJ_13-0-3{
92
+ body:not(.magritte-old-layout) .magritte-select-empty-hint___B39XJ_13-0-5{
93
93
  min-height:320px;
94
94
  height:auto;
95
95
  }
96
96
  }
97
- .magritte-icon___F0GQx_13-0-3{
97
+ .magritte-icon___F0GQx_13-0-5{
98
98
  display:flex;
99
99
  align-items:center;
100
100
  justify-content:center;
@@ -102,11 +102,11 @@
102
102
  height:48px;
103
103
  border-radius:50%;
104
104
  }
105
- .magritte-icon-empty___sAFRT_13-0-3{
105
+ .magritte-icon-empty___sAFRT_13-0-5{
106
106
  background-color:var(--magritte-color-background-accent-secondary-v25-0-1);
107
107
  --magritte-ui-icon-color-override:var(--magritte-color-icon-accent-v25-0-1);
108
108
  }
109
- .magritte-icon-empty-search___O0pus_13-0-3{
109
+ .magritte-icon-empty-search___O0pus_13-0-5{
110
110
  background-color:var(--magritte-color-background-secondary-v25-0-1);
111
111
  --magritte-ui-icon-color-override:var(--magritte-color-icon-tertiary-v25-0-1);
112
112
  }
@@ -114,74 +114,74 @@
114
114
  :root{
115
115
  --magritte-color-component-input-stroke-state-accent-focused-accessible-v25-0-1:#0070ff7a;
116
116
  }
117
- .magritte-select-option-plain___u9kSx_13-0-3{
117
+ .magritte-select-option-plain___u9kSx_13-0-5{
118
118
  border-radius:8px;
119
119
  }
120
- .magritte-select-option-plain___u9kSx_13-0-3.focus-visible{
120
+ .magritte-select-option-plain___u9kSx_13-0-5.focus-visible{
121
121
  outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v25-0-1) solid 4px;
122
122
  }
123
123
  @media (min-width: 1020px){
124
- body.magritte-old-layout .magritte-select-option-plain___u9kSx_13-0-3:hover{
124
+ body.magritte-old-layout .magritte-select-option-plain___u9kSx_13-0-5:hover{
125
125
  cursor:default;
126
126
  }
127
127
  }
128
128
  @media (min-width: 1024px){
129
- body:not(.magritte-old-layout) .magritte-select-option-plain___u9kSx_13-0-3:hover{
129
+ body:not(.magritte-old-layout) .magritte-select-option-plain___u9kSx_13-0-5:hover{
130
130
  cursor:default;
131
131
  }
132
132
  }
133
133
  @media (min-width: 1020px){
134
- body.magritte-old-layout .magritte-select-option-plain_active___ynHQP_13-0-3:hover{
134
+ body.magritte-old-layout .magritte-select-option-plain_active___ynHQP_13-0-5:hover{
135
135
  cursor:pointer;
136
136
  }
137
137
  }
138
138
  @media (min-width: 1024px){
139
- body:not(.magritte-old-layout) .magritte-select-option-plain_active___ynHQP_13-0-3:hover{
139
+ body:not(.magritte-old-layout) .magritte-select-option-plain_active___ynHQP_13-0-5:hover{
140
140
  cursor:pointer;
141
141
  }
142
142
  }
143
- .magritte-select-label-option___wyUhk_13-0-3{
143
+ .magritte-select-label-option___wyUhk_13-0-5{
144
144
  display:flex;
145
145
  justify-content:center;
146
146
  }
147
- .magritte-select-delimiter___SsBtb_13-0-3{
147
+ .magritte-select-delimiter___SsBtb_13-0-5{
148
148
  padding-left:16px;
149
149
  padding-top:12px;
150
150
  }
151
151
 
152
- .magritte-options___E0JN-_13-0-3{
152
+ .magritte-options___E0JN-_13-0-5{
153
153
  display:flex;
154
154
  flex-direction:column;
155
155
  padding:0 16px;
156
156
  padding-bottom:16px;
157
157
  gap:12px;
158
158
  }
159
- .magritte-options_plain___-ihU5_13-0-3{
159
+ .magritte-options_plain___-ihU5_13-0-5{
160
160
  gap:0;
161
161
  }
162
- .magritte-options_desktop___gz7kx_13-0-3{
162
+ .magritte-options_desktop___gz7kx_13-0-5{
163
163
  gap:8px;
164
164
  padding:0;
165
165
  }
166
- .magritte-options_desktop-plain___L0WIC_13-0-3{
166
+ .magritte-options_desktop-plain___L0WIC_13-0-5{
167
167
  gap:16px;
168
168
  }
169
169
 
170
- .magritte-select-layout___3THUn_13-0-3{
170
+ .magritte-select-layout___3THUn_13-0-5{
171
171
  display:contents;
172
172
  }
173
173
 
174
- .magritte-anchor___0KOBD_13-0-3{
174
+ .magritte-anchor___0KOBD_13-0-5{
175
175
  position:relative;
176
176
  width:fit-content;
177
177
  }
178
- .magritte-anchor-stretched___h7y6m_13-0-3{
178
+ .magritte-anchor-stretched___h7y6m_13-0-5{
179
179
  width:100%;
180
180
  }
181
- .magritte-default-view___3ptpo_13-0-3{
181
+ .magritte-default-view___3ptpo_13-0-5{
182
182
  min-width:0;
183
183
  }
184
- .magritte-input-view___ZeEKh_13-0-3{
184
+ .magritte-input-view___ZeEKh_13-0-5{
185
185
  position:absolute;
186
186
  top:0;
187
187
  left:0;
@@ -189,6 +189,6 @@
189
189
  display:flex;
190
190
  min-width:0;
191
191
  }
192
- .magritte-hidden-view___stvzX_13-0-3{
192
+ .magritte-hidden-view___stvzX_13-0-5{
193
193
  visibility:hidden;
194
194
  }
@@ -10,7 +10,7 @@ import { useVisibility } from '../useVisibility.js';
10
10
  import '@hh.ru/magritte-internal-slot-registry';
11
11
  import './VisibilityContext.js';
12
12
 
13
- var styles = {"select-layout":"magritte-select-layout___3THUn_13-0-3","selectLayout":"magritte-select-layout___3THUn_13-0-3"};
13
+ var styles = {"select-layout":"magritte-select-layout___3THUn_13-0-5","selectLayout":"magritte-select-layout___3THUn_13-0-5"};
14
14
 
15
15
  const CLOSED_BY_USER_KEYS = [keyboardKeys.Escape, keyboardKeys.Enter, keyboardKeys.Space];
16
16
  const FocusWithinContext = createContext(false);
@@ -11,7 +11,7 @@ import { OptionControl } from './OptionControl.js';
11
11
  import { Text } from '@hh.ru/magritte-ui-typography';
12
12
  import '@hh.ru/magritte-ui-checkbox-radio';
13
13
 
14
- var styles = {"select-option-plain":"magritte-select-option-plain___u9kSx_13-0-3","selectOptionPlain":"magritte-select-option-plain___u9kSx_13-0-3","select-option-plain_active":"magritte-select-option-plain_active___ynHQP_13-0-3","selectOptionPlainActive":"magritte-select-option-plain_active___ynHQP_13-0-3","select-label-option":"magritte-select-label-option___wyUhk_13-0-3","selectLabelOption":"magritte-select-label-option___wyUhk_13-0-3","select-delimiter":"magritte-select-delimiter___SsBtb_13-0-3","selectDelimiter":"magritte-select-delimiter___SsBtb_13-0-3"};
14
+ var styles = {"select-option-plain":"magritte-select-option-plain___u9kSx_13-0-5","selectOptionPlain":"magritte-select-option-plain___u9kSx_13-0-5","select-option-plain_active":"magritte-select-option-plain_active___ynHQP_13-0-5","selectOptionPlainActive":"magritte-select-option-plain_active___ynHQP_13-0-5","select-label-option":"magritte-select-label-option___wyUhk_13-0-5","selectLabelOption":"magritte-select-label-option___wyUhk_13-0-5","select-delimiter":"magritte-select-delimiter___SsBtb_13-0-5","selectDelimiter":"magritte-select-delimiter___SsBtb_13-0-5"};
15
15
 
16
16
  const OptionLayoutComponentDefault = ({ data, type, plain, checked, isMobile, input, }) => {
17
17
  if (type === 'delimiter') {
@@ -20,7 +20,7 @@ import '../useVisibility.js';
20
20
  import './VisibilityContext.js';
21
21
  import './ConfigContext.js';
22
22
 
23
- var styles = {"error-container":"magritte-error-container___ICGpQ_13-0-3","errorContainer":"magritte-error-container___ICGpQ_13-0-3"};
23
+ var styles = {"error-container":"magritte-error-container___ICGpQ_13-0-5","errorContainer":"magritte-error-container___ICGpQ_13-0-5"};
24
24
 
25
25
  /** Ошибка дата-провайдера, показывать решает пикер */
26
26
  const SelectError = () => {
@@ -1,7 +1,8 @@
1
1
  import './../index.css';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import { forwardRef, useMemo } from 'react';
3
+ import { forwardRef, useMemo, useRef } from 'react';
4
4
  import { Select } from '../Select.js';
5
+ import { useEventCallback, isArraysEquals, extractValues } from '../internal/utils.js';
5
6
  import { BottomSheetHeaderLegacy } from './internal/BottomSheetHeaderLegacy.js';
6
7
  import { ContentBeforeLegacy } from './internal/ContentBeforeLegacy.js';
7
8
  import { FooterLegacy } from './internal/FooterLegacy.js';
@@ -15,7 +16,6 @@ import '@hh.ru/magritte-ui-breakpoint';
15
16
  import '../SelectPickerContext.js';
16
17
  import '../internal/SelectStateContext.js';
17
18
  import '../internal/SelectStore.js';
18
- import '../internal/utils.js';
19
19
  import '../useSelectConfig.js';
20
20
  import '../internal/ConfigContext.js';
21
21
  import '../internal/slots.js';
@@ -89,8 +89,27 @@ const SelectLegacyComponent = ({ type, multiple, value, maxSelectedOptions, load
89
89
  const newTriggerProps = restTriggerProps;
90
90
  const dataQa = triggerProps['data-qa'] ?? DEFAULT_DATA_QA;
91
91
  const trigger = renderTrigger ? (jsx(TriggerLegacy, { renderTrigger: renderTrigger, triggerProps: triggerProps, dataQa: dataQa, activatorRef: activatorRef, searchable: searchable })) : (jsx(Fragment, { children: searchable ? (jsx(Select.SearchTrigger, { ...newTriggerProps, ref: activatorRef, "data-qa": dataQa })) : (jsx(Select.Trigger, { ...newTriggerProps, ref: activatorRef, "data-qa": dataQa })) }));
92
+ // старый селект сравнивал применяемое с последним отданным, а не с текущим стором (кот. мог быть обновлен извне)
93
+ // как следствие, клиент опирался на onChange, который эмитился при совпадающих значениях в сторе
94
+ const lastEmittedValuesRef = useRef(value);
95
+ const handleChange = useEventCallback((next) => {
96
+ lastEmittedValuesRef.current = next;
97
+ onChange?.(next);
98
+ });
99
+ const onPickerOpen = useEventCallback(() => {
100
+ lastEmittedValuesRef.current = value;
101
+ });
102
+ const onChangeWithLastEmittedCheck = useEventCallback((values) => {
103
+ const lastEmittedValues = Array.isArray(lastEmittedValuesRef.current)
104
+ ? lastEmittedValuesRef.current
105
+ : [lastEmittedValuesRef.current];
106
+ if (isArraysEquals(extractValues(values), extractValues(lastEmittedValues.filter(Boolean)))) {
107
+ return;
108
+ }
109
+ handleChange((multiple ? [...values] : values[0]));
110
+ });
92
111
  const hasFooterContent = (buttons) => Boolean(renderButtonsContainer) || (!loading && buttons.some(Boolean));
93
- const renderFooter = (withClearButton) => (jsx(FooterLegacy, { applyChangesButton: applyChangesButton, clearButton: clearButton, withClearButton: withClearButton, applyOnClear: applyOnClear, onApply: onApply, onClear: onClear, renderButtonsContainer: renderButtonsContainer }));
112
+ const renderFooter = (withClearButton) => (jsx(FooterLegacy, { applyChangesButton: applyChangesButton, clearButton: clearButton, withClearButton: withClearButton, applyOnClear: applyOnClear, onApply: onApply, onChangeWithLastEmittedCheck: onChangeWithLastEmittedCheck, onPickerOpen: onPickerOpen, onClear: onClear, renderButtonsContainer: renderButtonsContainer }));
94
113
  const dropFooter = hasFooterContent([applyChangesButton])
95
114
  ? renderFooter(Boolean(renderButtonsContainer))
96
115
  : undefined;
@@ -110,9 +129,9 @@ const SelectLegacyComponent = ({ type, multiple, value, maxSelectedOptions, load
110
129
  emptySearchHint: emptyOptionsSearchHint,
111
130
  };
112
131
  if (multiple) {
113
- return (jsx(Select, { ...commonProps, multiple: true, value: value, onChange: onChange, children: content }));
132
+ return (jsx(Select, { ...commonProps, multiple: true, value: value, onChange: handleChange, children: content }));
114
133
  }
115
- return (jsx(Select, { ...commonProps, value: value, onChange: onChange, children: content }));
134
+ return (jsx(Select, { ...commonProps, value: value, onChange: handleChange, children: content }));
116
135
  };
117
136
  /** @deprecated Компонент SelectLegacy deprecated, используйте Select */
118
137
  const SelectLegacy = forwardRef(SelectLegacyComponent);
@@ -1 +1 @@
1
- {"version":3,"file":"SelectLegacy.js","sources":["src/legacy/SelectLegacy.tsx"],"sourcesContent":["import { ReactElement, ReactNode, forwardRef, ForwardedRef, useMemo } from 'react';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { Select } from '@hh.ru/magritte-ui-select/Select';\nimport { BottomSheetHeaderLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/BottomSheetHeaderLegacy';\nimport { ContentBeforeLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/ContentBeforeLegacy';\nimport { FooterLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/FooterLegacy';\nimport { makeLegacyOptionLayout } from '@hh.ru/magritte-ui-select/legacy/internal/OptionLayoutLegacy';\nimport { TriggerLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/TriggerLegacy';\nimport { UnsavedChangesAlertLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/UnsavedChangesAlertLegacy';\nimport type { SelectProps, TriggerExternalProps } from '@hh.ru/magritte-ui-select/legacy/types';\nimport type { SelectUncontrolledTriggerProps } from '@hh.ru/magritte-ui-select/types';\nimport { VSpacing } from '@hh.ru/magritte-ui-spacing';\n\nconst DEFAULT_DATA_QA = 'magritte-select-activator';\nconst DEFAULT_TRIGGER_PROPS = { size: 'medium' } as TriggerExternalProps;\n\nconst SelectLegacyComponent = <MultipleType extends boolean, DataType extends StaticDataFetcherItem>(\n {\n type,\n multiple,\n value,\n maxSelectedOptions,\n loading,\n error,\n searchable,\n bottomSheetHeight = 'full-screen',\n onChange,\n renderTrigger,\n triggerProps = DEFAULT_TRIGGER_PROPS,\n renderMobileItem,\n renderDesktopItem,\n name,\n maxWidth,\n maxHeight = 460,\n renderAlertOnExitWithoutSaving,\n renderButtonsContainer,\n renderHeader,\n headerTitle,\n clearButton,\n applyChangesButton,\n forceDropVisibleWithEmptyOptions,\n plain = false,\n widthEqualToActivator = true,\n renderContentBefore,\n onBlur,\n onFocus,\n onDropOpen,\n onDropClose,\n onBottomSheetClose,\n onBottomSheetOpen,\n onSearchSubmit,\n onApply,\n onClear,\n onSelectOption,\n pickerRef,\n dataProvider,\n emptyOptionsHint,\n emptyOptionsSearchHint,\n onOptionsChange,\n innerErrorTrls,\n optionDataQa,\n dropWidth,\n applyOnClear = true,\n }: SelectProps<MultipleType, DataType>,\n activatorRef: ForwardedRef<HTMLElement>\n): ReactElement => {\n const optionLayoutComponent = useMemo(\n () =>\n renderDesktopItem || renderMobileItem\n ? makeLegacyOptionLayout<DataType>({\n renderDesktopItem,\n renderMobileItem,\n name,\n dataQa: optionDataQa,\n })\n : undefined,\n [renderDesktopItem, renderMobileItem, name, optionDataQa]\n );\n const options = (\n <Select.Options<DataType>\n type={type}\n plain={plain}\n optionLayoutComponent={optionLayoutComponent}\n data-qa={optionDataQa}\n onOptionSelect={onSelectOption ? (values) => onSelectOption([...values]) : undefined}\n />\n );\n\n // aria-атрибуты связи с пикером новый селект считает сам\n const { 'aria-haspopup': _, 'aria-controls': __, ...restTriggerProps } = triggerProps;\n const newTriggerProps = restTriggerProps as SelectUncontrolledTriggerProps;\n const dataQa = triggerProps['data-qa'] ?? DEFAULT_DATA_QA;\n const trigger = renderTrigger ? (\n <TriggerLegacy\n renderTrigger={renderTrigger}\n triggerProps={triggerProps}\n dataQa={dataQa}\n activatorRef={activatorRef}\n searchable={searchable}\n />\n ) : (\n <>\n {searchable ? (\n <Select.SearchTrigger {...newTriggerProps} ref={activatorRef} data-qa={dataQa} />\n ) : (\n <Select.Trigger {...newTriggerProps} ref={activatorRef} data-qa={dataQa} />\n )}\n </>\n );\n\n const hasFooterContent = (buttons: ReactNode[]) =>\n Boolean(renderButtonsContainer) || (!loading && buttons.some(Boolean));\n\n const renderFooter = (withClearButton: boolean) => (\n <FooterLegacy\n applyChangesButton={applyChangesButton}\n clearButton={clearButton}\n withClearButton={withClearButton}\n applyOnClear={applyOnClear}\n onApply={onApply}\n onClear={onClear}\n renderButtonsContainer={renderButtonsContainer}\n />\n );\n\n const dropFooter = hasFooterContent([applyChangesButton])\n ? renderFooter(Boolean(renderButtonsContainer))\n : undefined;\n const bottomSheetFooter = hasFooterContent([applyChangesButton, clearButton]) ? renderFooter(true) : undefined;\n\n const content = (\n <>\n {trigger}\n <Select.Drop\n ref={pickerRef}\n footer={dropFooter}\n forceDropVisibleWithEmptyOptions={forceDropVisibleWithEmptyOptions}\n maxWidth={maxWidth}\n width={dropWidth}\n maxHeight={maxHeight}\n widthEqualToActivator={widthEqualToActivator}\n onAppear={onDropOpen}\n onAfterExit={onDropClose}\n >\n {renderContentBefore && (\n <>\n <ContentBeforeLegacy\n renderContentBefore={renderContentBefore}\n applyOnClear={applyOnClear}\n onClear={onClear}\n />\n <VSpacing default={8} />\n </>\n )}\n {options}\n </Select.Drop>\n <Select.BottomSheet\n ref={pickerRef}\n height={searchable || Boolean(error) || loading ? 'full-screen' : bottomSheetHeight}\n header={\n <BottomSheetHeaderLegacy\n headerTitle={headerTitle || triggerProps.label}\n searchable={searchable}\n renderHeader={renderHeader}\n onSearchSubmit={onSearchSubmit}\n />\n }\n footer={bottomSheetFooter}\n onAppear={onBottomSheetOpen}\n onAfterExit={onBottomSheetClose}\n >\n {options}\n {renderAlertOnExitWithoutSaving && (\n <UnsavedChangesAlertLegacy renderAlertOnExitWithoutSaving={renderAlertOnExitWithoutSaving} />\n )}\n </Select.BottomSheet>\n </>\n );\n\n const commonProps = {\n dataProvider,\n name,\n loading,\n error,\n maxSelectedOptions,\n onBlur,\n onFocus,\n onOptionsChange,\n providerError: innerErrorTrls,\n emptyHint: emptyOptionsHint,\n emptySearchHint: emptyOptionsSearchHint,\n };\n\n if (multiple) {\n return (\n <Select<true, DataType>\n {...commonProps}\n multiple\n value={value as DataType[] | undefined}\n onChange={onChange as (value: DataType[]) => void}\n >\n {content}\n </Select>\n );\n }\n\n return (\n <Select<false, DataType>\n {...commonProps}\n value={value as DataType | undefined}\n onChange={onChange as (value: DataType) => void}\n >\n {content}\n </Select>\n );\n};\n\n/** @deprecated Компонент SelectLegacy deprecated, используйте Select */\nconst SelectLegacy = forwardRef(SelectLegacyComponent) as (<\n MultipleType extends boolean,\n DataType extends StaticDataFetcherItem,\n>(\n props: SelectProps<MultipleType, DataType> & { ref?: ForwardedRef<HTMLElement> }\n) => ReactElement | null) & { displayName: string };\n\nSelectLegacy.displayName = 'SelectLegacy';\n\nexport { SelectLegacy };\n"],"names":["_jsx","_Fragment","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,eAAe,GAAG,2BAA2B,CAAC;AACpD,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAA0B,CAAC;AAEzE,MAAM,qBAAqB,GAAG,CAC1B,EACI,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,OAAO,EACP,KAAK,EACL,UAAU,EACV,iBAAiB,GAAG,aAAa,EACjC,QAAQ,EACR,aAAa,EACb,YAAY,GAAG,qBAAqB,EACpC,gBAAgB,EAChB,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,SAAS,GAAG,GAAG,EACf,8BAA8B,EAC9B,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,gCAAgC,EAChC,KAAK,GAAG,KAAK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C;IAEF,IAAI,QAAQ,EAAE;AACV,QAAA,QACIA,GAAC,CAAA,MAAM,OACC,WAAW,EACf,QAAQ,EACR,IAAA,EAAA,KAAK,EAAE,KAA+B,EACtC,QAAQ,EAAE,QAAuC,YAEhD,OAAO,EAAA,CACH,EACX;KACL;AAED,IAAA,QACIA,GAAC,CAAA,MAAM,EACC,EAAA,GAAA,WAAW,EACf,KAAK,EAAE,KAA6B,EACpC,QAAQ,EAAE,QAAqC,YAE9C,OAAO,EAAA,CACH,EACX;AACN,CAAC,CAAC;AAEF;AACA,MAAM,YAAY,GAAG,UAAU,CAAC,qBAAqB,EAKD;AAEpD,YAAY,CAAC,WAAW,GAAG,cAAc;;;;"}
1
+ {"version":3,"file":"SelectLegacy.js","sources":["src/legacy/SelectLegacy.tsx"],"sourcesContent":["import { ReactElement, ReactNode, forwardRef, ForwardedRef, useMemo, useRef } from 'react';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { Select } from '@hh.ru/magritte-ui-select/Select';\nimport { extractValues, isArraysEquals, useEventCallback } from '@hh.ru/magritte-ui-select/internal/utils';\nimport { BottomSheetHeaderLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/BottomSheetHeaderLegacy';\nimport { ContentBeforeLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/ContentBeforeLegacy';\nimport { FooterLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/FooterLegacy';\nimport { makeLegacyOptionLayout } from '@hh.ru/magritte-ui-select/legacy/internal/OptionLayoutLegacy';\nimport { TriggerLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/TriggerLegacy';\nimport { UnsavedChangesAlertLegacy } from '@hh.ru/magritte-ui-select/legacy/internal/UnsavedChangesAlertLegacy';\nimport type { SelectProps, TriggerExternalProps } from '@hh.ru/magritte-ui-select/legacy/types';\nimport type { SelectUncontrolledTriggerProps } from '@hh.ru/magritte-ui-select/types';\nimport { VSpacing } from '@hh.ru/magritte-ui-spacing';\n\nconst DEFAULT_DATA_QA = 'magritte-select-activator';\nconst DEFAULT_TRIGGER_PROPS = { size: 'medium' } as TriggerExternalProps;\n\nconst SelectLegacyComponent = <MultipleType extends boolean, DataType extends StaticDataFetcherItem>(\n {\n type,\n multiple,\n value,\n maxSelectedOptions,\n loading,\n error,\n searchable,\n bottomSheetHeight = 'full-screen',\n onChange,\n renderTrigger,\n triggerProps = DEFAULT_TRIGGER_PROPS,\n renderMobileItem,\n renderDesktopItem,\n name,\n maxWidth,\n maxHeight = 460,\n renderAlertOnExitWithoutSaving,\n renderButtonsContainer,\n renderHeader,\n headerTitle,\n clearButton,\n applyChangesButton,\n forceDropVisibleWithEmptyOptions,\n plain = false,\n widthEqualToActivator = true,\n renderContentBefore,\n onBlur,\n onFocus,\n onDropOpen,\n onDropClose,\n onBottomSheetClose,\n onBottomSheetOpen,\n onSearchSubmit,\n onApply,\n onClear,\n onSelectOption,\n pickerRef,\n dataProvider,\n emptyOptionsHint,\n emptyOptionsSearchHint,\n onOptionsChange,\n innerErrorTrls,\n optionDataQa,\n dropWidth,\n applyOnClear = true,\n }: SelectProps<MultipleType, DataType>,\n activatorRef: ForwardedRef<HTMLElement>\n): ReactElement => {\n const optionLayoutComponent = useMemo(\n () =>\n renderDesktopItem || renderMobileItem\n ? makeLegacyOptionLayout<DataType>({\n renderDesktopItem,\n renderMobileItem,\n name,\n dataQa: optionDataQa,\n })\n : undefined,\n [renderDesktopItem, renderMobileItem, name, optionDataQa]\n );\n const options = (\n <Select.Options<DataType>\n type={type}\n plain={plain}\n optionLayoutComponent={optionLayoutComponent}\n data-qa={optionDataQa}\n onOptionSelect={onSelectOption ? (values) => onSelectOption([...values]) : undefined}\n />\n );\n\n // aria-атрибуты связи с пикером новый селект считает сам\n const { 'aria-haspopup': _, 'aria-controls': __, ...restTriggerProps } = triggerProps;\n const newTriggerProps = restTriggerProps as SelectUncontrolledTriggerProps;\n const dataQa = triggerProps['data-qa'] ?? DEFAULT_DATA_QA;\n const trigger = renderTrigger ? (\n <TriggerLegacy\n renderTrigger={renderTrigger}\n triggerProps={triggerProps}\n dataQa={dataQa}\n activatorRef={activatorRef}\n searchable={searchable}\n />\n ) : (\n <>\n {searchable ? (\n <Select.SearchTrigger {...newTriggerProps} ref={activatorRef} data-qa={dataQa} />\n ) : (\n <Select.Trigger {...newTriggerProps} ref={activatorRef} data-qa={dataQa} />\n )}\n </>\n );\n\n // старый селект сравнивал применяемое с последним отданным, а не с текущим стором (кот. мог быть обновлен извне)\n // как следствие, клиент опирался на onChange, который эмитился при совпадающих значениях в сторе\n const lastEmittedValuesRef = useRef(value);\n const handleChange = useEventCallback((next: typeof value) => {\n lastEmittedValuesRef.current = next;\n (onChange as ((value: typeof next) => void) | undefined)?.(next);\n });\n\n const onPickerOpen = useEventCallback(() => {\n lastEmittedValuesRef.current = value;\n });\n\n const onChangeWithLastEmittedCheck = useEventCallback((values: readonly DataType[]) => {\n const lastEmittedValues = Array.isArray(lastEmittedValuesRef.current)\n ? lastEmittedValuesRef.current\n : ([lastEmittedValuesRef.current] as DataType[]);\n if (isArraysEquals(extractValues<DataType>(values), extractValues(lastEmittedValues.filter(Boolean)))) {\n return;\n }\n handleChange((multiple ? [...values] : values[0]) as typeof value);\n });\n\n const hasFooterContent = (buttons: ReactNode[]) =>\n Boolean(renderButtonsContainer) || (!loading && buttons.some(Boolean));\n\n const renderFooter = (withClearButton: boolean) => (\n <FooterLegacy\n applyChangesButton={applyChangesButton}\n clearButton={clearButton}\n withClearButton={withClearButton}\n applyOnClear={applyOnClear}\n onApply={onApply}\n onChangeWithLastEmittedCheck={onChangeWithLastEmittedCheck}\n onPickerOpen={onPickerOpen}\n onClear={onClear}\n renderButtonsContainer={renderButtonsContainer}\n />\n );\n\n const dropFooter = hasFooterContent([applyChangesButton])\n ? renderFooter(Boolean(renderButtonsContainer))\n : undefined;\n const bottomSheetFooter = hasFooterContent([applyChangesButton, clearButton]) ? renderFooter(true) : undefined;\n\n const content = (\n <>\n {trigger}\n <Select.Drop\n ref={pickerRef}\n footer={dropFooter}\n forceDropVisibleWithEmptyOptions={forceDropVisibleWithEmptyOptions}\n maxWidth={maxWidth}\n width={dropWidth}\n maxHeight={maxHeight}\n widthEqualToActivator={widthEqualToActivator}\n onAppear={onDropOpen}\n onAfterExit={onDropClose}\n >\n {renderContentBefore && (\n <>\n <ContentBeforeLegacy\n renderContentBefore={renderContentBefore}\n applyOnClear={applyOnClear}\n onClear={onClear}\n />\n <VSpacing default={8} />\n </>\n )}\n {options}\n </Select.Drop>\n <Select.BottomSheet\n ref={pickerRef}\n height={searchable || Boolean(error) || loading ? 'full-screen' : bottomSheetHeight}\n header={\n <BottomSheetHeaderLegacy\n headerTitle={headerTitle || triggerProps.label}\n searchable={searchable}\n renderHeader={renderHeader}\n onSearchSubmit={onSearchSubmit}\n />\n }\n footer={bottomSheetFooter}\n onAppear={onBottomSheetOpen}\n onAfterExit={onBottomSheetClose}\n >\n {options}\n {renderAlertOnExitWithoutSaving && (\n <UnsavedChangesAlertLegacy renderAlertOnExitWithoutSaving={renderAlertOnExitWithoutSaving} />\n )}\n </Select.BottomSheet>\n </>\n );\n\n const commonProps = {\n dataProvider,\n name,\n loading,\n error,\n maxSelectedOptions,\n onBlur,\n onFocus,\n onOptionsChange,\n providerError: innerErrorTrls,\n emptyHint: emptyOptionsHint,\n emptySearchHint: emptyOptionsSearchHint,\n };\n\n if (multiple) {\n return (\n <Select<true, DataType>\n {...commonProps}\n multiple\n value={value as DataType[] | undefined}\n onChange={handleChange as (value: DataType[]) => void}\n >\n {content}\n </Select>\n );\n }\n\n return (\n <Select<false, DataType>\n {...commonProps}\n value={value as DataType | undefined}\n onChange={handleChange as (value: DataType) => void}\n >\n {content}\n </Select>\n );\n};\n\n/** @deprecated Компонент SelectLegacy deprecated, используйте Select */\nconst SelectLegacy = forwardRef(SelectLegacyComponent) as (<\n MultipleType extends boolean,\n DataType extends StaticDataFetcherItem,\n>(\n props: SelectProps<MultipleType, DataType> & { ref?: ForwardedRef<HTMLElement> }\n) => ReactElement | null) & { displayName: string };\n\nSelectLegacy.displayName = 'SelectLegacy';\n\nexport { SelectLegacy };\n"],"names":["_jsx","_Fragment","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,eAAe,GAAG,2BAA2B,CAAC;AACpD,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAA0B,CAAC;AAEzE,MAAM,qBAAqB,GAAG,CAC1B,EACI,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,OAAO,EACP,KAAK,EACL,UAAU,EACV,iBAAiB,GAAG,aAAa,EACjC,QAAQ,EACR,aAAa,EACb,YAAY,GAAG,qBAAqB,EACpC,gBAAgB,EAChB,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,SAAS,GAAG,GAAG,EACf,8BAA8B,EAC9B,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,gCAAgC,EAChC,KAAK,GAAG,KAAK,EACb,qBAAqB,GAAG,IAAI,EAC5B,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,OAAO,EACP,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,SAAS,EACT,YAAY,GAAG,IAAI,GACe,EACtC,YAAuC,KACzB;IACd,MAAM,qBAAqB,GAAG,OAAO,CACjC,MACI,iBAAiB,IAAI,gBAAgB;UAC/B,sBAAsB,CAAW;YAC7B,iBAAiB;YACjB,gBAAgB;YAChB,IAAI;AACJ,YAAA,MAAM,EAAE,YAAY;SACvB,CAAC;AACJ,UAAE,SAAS,EACnB,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,IAAI,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B,OAAO,EACP,8BAA8B,KAC3BA,GAAC,CAAA,yBAAyB,EAAC,EAAA,8BAA8B,EAAE,8BAA8B,EAAA,CAAI,CAChG,CACgB,EAAA,CAAA,CAAA,EAAA,CACtB,CACN,CAAC;AAEF,IAAA,MAAM,WAAW,GAAG;QAChB,YAAY;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,kBAAkB;QAClB,MAAM;QACN,OAAO;QACP,eAAe;AACf,QAAA,aAAa,EAAE,cAAc;AAC7B,QAAA,SAAS,EAAE,gBAAgB;AAC3B,QAAA,eAAe,EAAE,sBAAsB;KAC1C,CAAC;IAEF,IAAI,QAAQ,EAAE;AACV,QAAA,QACIA,GAAC,CAAA,MAAM,OACC,WAAW,EACf,QAAQ,EACR,IAAA,EAAA,KAAK,EAAE,KAA+B,EACtC,QAAQ,EAAE,YAA2C,YAEpD,OAAO,EAAA,CACH,EACX;KACL;AAED,IAAA,QACIA,GAAC,CAAA,MAAM,EACC,EAAA,GAAA,WAAW,EACf,KAAK,EAAE,KAA6B,EACpC,QAAQ,EAAE,YAAyC,YAElD,OAAO,EAAA,CACH,EACX;AACN,CAAC,CAAC;AAEF;AACA,MAAM,YAAY,GAAG,UAAU,CAAC,qBAAqB,EAKD;AAEpD,YAAY,CAAC,WAAW,GAAG,cAAc;;;;"}
@@ -1,14 +1,17 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
+ import { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';
2
3
  import type { OnApplyCallback, RenderButtonsContainer } from '@hh.ru/magritte-ui-select/legacy/types';
3
- interface FooterLegacyProps {
4
+ interface FooterLegacyProps<DataType extends StaticDataFetcherItem> {
4
5
  clearButton?: ReactNode;
5
6
  applyChangesButton?: ReactNode;
6
7
  withClearButton: boolean;
7
8
  applyOnClear: boolean;
8
9
  onApply?: OnApplyCallback;
9
10
  onClear?: VoidFunction;
11
+ onChangeWithLastEmittedCheck?: (values: readonly DataType[]) => void;
12
+ onPickerOpen?: VoidFunction;
10
13
  renderButtonsContainer?: RenderButtonsContainer;
11
14
  }
12
15
  /** @deprecated Компонент FooterLegacy deprecated, используйте Select.ApplyChangesButton/Select.ClearButton/ActionBar */
13
- export declare const FooterLegacy: ({ clearButton, applyChangesButton, withClearButton, applyOnClear, onApply, onClear, renderButtonsContainer, }: FooterLegacyProps) => ReactElement | null;
16
+ export declare const FooterLegacy: <DataType extends StaticDataFetcherItem>({ clearButton, applyChangesButton, withClearButton, applyOnClear, onApply: onApplyExternal, onChangeWithLastEmittedCheck, onPickerOpen, onClear, renderButtonsContainer, }: FooterLegacyProps<DataType>) => ReactElement | null;
14
17
  export {};
@@ -1,41 +1,51 @@
1
1
  import './../../index.css';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { isValidElement } from 'react';
3
+ import { useEffect, isValidElement } from 'react';
4
4
  import { ActionBar } from '@hh.ru/magritte-ui-action-bar';
5
5
  import { ApplyChangesButton } from '../../ApplyChangesButton.js';
6
6
  import { ClearButton } from '../../ClearButton.js';
7
+ import { useSelectStore } from '../../internal/SelectStateContext.js';
7
8
  import { useDataProvider } from '../../useDataProvider.js';
8
9
  import { useSearchState } from '../../useSearchState.js';
9
10
  import { useSelectConfig } from '../../useSelectConfig.js';
10
11
  import { useSelectContentState } from '../../useSelectContentState.js';
12
+ import { useVisibility } from '../../useVisibility.js';
11
13
  import '@hh.ru/magritte-common-use-translation';
12
14
  import '@hh.ru/magritte-ui-breakpoint';
13
15
  import '../../SelectPickerContext.js';
14
- import '../../internal/SelectStateContext.js';
15
16
  import '../../internal/SelectStore.js';
16
17
  import '../../internal/utils.js';
17
18
  import '../../internal/slots.js';
18
19
  import '@hh.ru/magritte-internal-slot-registry';
19
- import '../../useVisibility.js';
20
- import '../../internal/VisibilityContext.js';
21
20
  import '../../internal/SelectDataProvider.js';
22
21
  import '@hh.ru/magritte-common-data-provider';
23
22
  import '../../internal/useDataProvider.js';
24
23
  import '../../internal/SearchStateContext.js';
25
24
  import '../../internal/ConfigContext.js';
25
+ import '../../internal/VisibilityContext.js';
26
26
 
27
27
  /** @deprecated Компонент FooterLegacy deprecated, используйте Select.ApplyChangesButton/Select.ClearButton/ActionBar */
28
- const FooterLegacy = ({ clearButton, applyChangesButton, withClearButton, applyOnClear, onApply, onClear, renderButtonsContainer, }) => {
28
+ const FooterLegacy = ({ clearButton, applyChangesButton, withClearButton, applyOnClear, onApply: onApplyExternal, onChangeWithLastEmittedCheck, onPickerOpen, onClear, renderButtonsContainer, }) => {
29
+ const selectDraftStore = useSelectStore();
30
+ const { showOptions } = useVisibility();
29
31
  const { optionList, isError } = useDataProvider();
30
32
  const { searchValue } = useSearchState();
31
33
  const { loading } = useSelectConfig();
32
34
  const contentState = useSelectContentState();
35
+ useEffect(() => {
36
+ if (showOptions) {
37
+ onPickerOpen?.();
38
+ }
39
+ }, [showOptions, onPickerOpen]);
33
40
  const actions = [];
34
41
  if (withClearButton && isValidElement(clearButton)) {
35
42
  actions.push(jsx(ClearButton, { applyOnClear: applyOnClear, onClear: onClear, children: clearButton }, "clearButton"));
36
43
  }
37
44
  if (isValidElement(applyChangesButton)) {
38
- actions.push(jsx(ApplyChangesButton, { onApply: onApply, children: applyChangesButton }, "applyChangesButton"));
45
+ actions.push(jsx(ApplyChangesButton, { onApply: (props) => {
46
+ onChangeWithLastEmittedCheck?.(selectDraftStore.getSnapshot());
47
+ onApplyExternal?.(props);
48
+ }, children: applyChangesButton }, "applyChangesButton"));
39
49
  }
40
50
  if (renderButtonsContainer) {
41
51
  const footer = renderButtonsContainer({
@@ -1 +1 @@
1
- {"version":3,"file":"FooterLegacy.js","sources":["src/legacy/internal/FooterLegacy.tsx"],"sourcesContent":["import { ComponentProps, ReactElement, ReactNode, isValidElement } from 'react';\n\nimport { ActionBar } from '@hh.ru/magritte-ui-action-bar';\nimport { Button } from '@hh.ru/magritte-ui-button';\nimport { ApplyChangesButton } from '@hh.ru/magritte-ui-select/ApplyChangesButton';\nimport { ClearButton } from '@hh.ru/magritte-ui-select/ClearButton';\nimport type { OnApplyCallback, RenderButtonsContainer } from '@hh.ru/magritte-ui-select/legacy/types';\nimport { useDataProvider } from '@hh.ru/magritte-ui-select/useDataProvider';\nimport { useSearchState } from '@hh.ru/magritte-ui-select/useSearchState';\nimport { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';\nimport { useSelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\n\ninterface FooterLegacyProps {\n clearButton?: ReactNode;\n applyChangesButton?: ReactNode;\n withClearButton: boolean;\n applyOnClear: boolean;\n onApply?: OnApplyCallback;\n onClear?: VoidFunction;\n renderButtonsContainer?: RenderButtonsContainer;\n}\n\n/** @deprecated Компонент FooterLegacy deprecated, используйте Select.ApplyChangesButton/Select.ClearButton/ActionBar */\nexport const FooterLegacy = ({\n clearButton,\n applyChangesButton,\n withClearButton,\n applyOnClear,\n onApply,\n onClear,\n renderButtonsContainer,\n}: FooterLegacyProps): ReactElement | null => {\n const { optionList, isError } = useDataProvider();\n const { searchValue } = useSearchState();\n const { loading } = useSelectConfig();\n const contentState = useSelectContentState();\n\n const actions: ReactNode[] = [];\n if (withClearButton && isValidElement<ComponentProps<typeof Button>>(clearButton)) {\n actions.push(\n <ClearButton key=\"clearButton\" applyOnClear={applyOnClear} onClear={onClear}>\n {clearButton}\n </ClearButton>\n );\n }\n if (isValidElement(applyChangesButton)) {\n actions.push(\n <ApplyChangesButton key=\"applyChangesButton\" onApply={onApply}>\n {applyChangesButton}\n </ApplyChangesButton>\n );\n }\n\n if (renderButtonsContainer) {\n const footer = renderButtonsContainer({\n clearButton: actions.find((action) => isValidElement(action) && action.key === 'clearButton'),\n applyChangesButton: actions.find((action) => isValidElement(action) && action.key === 'applyChangesButton'),\n optionsCount: optionList.length,\n searchValue,\n loading,\n isError,\n emptyOptionsHintVisible: contentState === 'empty-hint' || contentState === 'empty-search-hint',\n });\n return isValidElement(footer) ? footer : null;\n }\n\n if (actions.length === 0 || loading) {\n return null;\n }\n\n return <ActionBar primaryAct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U,CAAC,MAAM;YAC/B,WAAW;YACX,OAAO;YACP,OAAO;AACP,YAAA,uBAAuB,EAAE,YAAY,KAAK,YAAY,IAAI,YAAY,KAAK,mBAAmB;AACjG,SAAA,CAAC,CAAC;AACH,QAAA,OAAO,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;KACjD;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,EAAE;AACjC,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,OAAOA,IAAC,SAAS,EAAA,EAAC,cAAc,EAAE,OAAO,GAAI,CAAC;AAClD;;;;"}
1
+ {"version":3,"file":"FooterLegacy.js","sources":["src/legacy/internal/FooterLegacy.tsx"],"sourcesContent":["import { ComponentProps, ReactElement, ReactNode, isValidElement, useEffect } from 'react';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { ActionBar } from '@hh.ru/magritte-ui-action-bar';\nimport { Button } from '@hh.ru/magritte-ui-button';\nimport { ApplyChangesButton } from '@hh.ru/magritte-ui-select/ApplyChangesButton';\nimport { ClearButton } from '@hh.ru/magritte-ui-select/ClearButton';\nimport { useSelectStore } from '@hh.ru/magritte-ui-select/internal/SelectStateContext';\nimport type { OnApplyCallback, RenderButtonsContainer } from '@hh.ru/magritte-ui-select/legacy/types';\nimport { useDataProvider } from '@hh.ru/magritte-ui-select/useDataProvider';\nimport { useSearchState } from '@hh.ru/magritte-ui-select/useSearchState';\nimport { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';\nimport { useSelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\nimport { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';\n\ninterface FooterLegacyProps<DataType extends StaticDataFetcherItem> {\n clearButton?: ReactNode;\n applyChangesButton?: ReactNode;\n withClearButton: boolean;\n applyOnClear: boolean;\n onApply?: OnApplyCallback;\n onClear?: VoidFunction;\n onChangeWithLastEmittedCheck?: (values: readonly DataType[]) => void;\n onPickerOpen?: VoidFunction;\n renderButtonsContainer?: RenderButtonsContainer;\n}\n\n/** @deprecated Компонент FooterLegacy deprecated, используйте Select.ApplyChangesButton/Select.ClearButton/ActionBar */\nexport const FooterLegacy = <DataType extends StaticDataFetcherItem>({\n clearButton,\n applyChangesButton,\n withClearButton,\n applyOnClear,\n onApply: onApplyExternal,\n onChangeWithLastEmittedCheck,\n onPickerOpen,\n onClear,\n renderButtonsContainer,\n}: FooterLegacyProps<DataType>): ReactElement | null => {\n const selectDraftStore = useSelectStore<DataType>();\n const { showOptions } = useVisibility();\n const { optionList, isError } = useDataProvider();\n const { searchValue } = useSearchState();\n const { loading } = useSelectConfig();\n const contentState = useSelectContentState();\n\n useEffect(() => {\n if (showOptions) {\n onPickerOpen?.();\n }\n }, [showOptions, onPickerOpen]);\n\n const actions: ReactNode[] = [];\n if (withClearButton && isValidElement<ComponentProps<typeof Button>>(clearButton)) {\n actions.push(\n <ClearButton key=\"clearButton\" applyOnClear={applyOnClear} onClear={onClear}>\n {clearButton}\n </ClearButton>\n );\n }\n if (isValidElement(applyChangesButton)) {\n actions.push(\n <ApplyChangesButton\n key=\"applyChangesButton\"\n onApply={(props) => {\n onChangeWithLastEmittedCheck?.(selectDraftStore.getSnapshot());\n onApplyExternal?.(props);\n }}\n >\n {applyChangesButton}\n </ApplyChangesButton>\n );\n }\n\n if (renderButtonsContainer) {\n const footer = renderButtonsContainer({\n clearButton: actions.find((action) => isValidElement(action) && action.key === 'clearButton'),\n applyChangesButton: actions.find((action) => isValidElement(action) && action.key === 'applyChangesButton'),\n optionsCount: optionList.length,\n searchValue,\n loading,\n isError,\n emptyOptionsHintVisible: contentState === 'empty-hint' || contentState === 'empty-search-hint',\n });\n return isValidElement(footer) ? footer : null;\n }\n\n if (actions.length === 0 || loading) {\n return null;\n }\n\n return <ActionBar primaryActions={actions} />;\n};\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACa,MAA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IAAI,sBAAsB,EAAE;QACxB,MAAM,MAAM,GAAG,sBAAsB,CAAC;YAClC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,aAAa,CAAC;YAC7F,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,oBAAoB,CAAC;YAC3G,YAAY,EAAE,UAAU,CAAC,MAAM;YAC/B,WAAW;YACX,OAAO;YACP,OAAO;AACP,YAAA,uBAAuB,EAAE,YAAY,KAAK,YAAY,IAAI,YAAY,KAAK,mBAAmB;AACjG,SAAA,CAAC,CAAC;AACH,QAAA,OAAO,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;KACjD;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,EAAE;AACjC,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,OAAOA,IAAC,SAAS,EAAA,EAAC,cAAc,EAAE,OAAO,GAAI,CAAC;AAClD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-select",
3
- "version": "13.0.3",
3
+ "version": "13.0.5",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -28,21 +28,21 @@
28
28
  "dependencies": {
29
29
  "@hh.ru/magritte-common-data-provider": "1.3.7",
30
30
  "@hh.ru/magritte-common-fuzzy-search": "1.0.9",
31
- "@hh.ru/magritte-common-keyboard": "4.3.4",
31
+ "@hh.ru/magritte-common-keyboard": "4.3.5",
32
32
  "@hh.ru/magritte-common-use-disabled": "1.0.15",
33
33
  "@hh.ru/magritte-common-use-multiple-refs": "1.1.11",
34
34
  "@hh.ru/magritte-common-use-translation": "3.2.0",
35
35
  "@hh.ru/magritte-design-tokens": "25.0.1",
36
36
  "@hh.ru/magritte-internal-slot-registry": "1.1.0",
37
37
  "@hh.ru/magritte-ui-action-bar": "5.4.16",
38
- "@hh.ru/magritte-ui-bottom-sheet": "9.4.29",
38
+ "@hh.ru/magritte-ui-bottom-sheet": "9.4.30",
39
39
  "@hh.ru/magritte-ui-breakpoint": "6.1.1",
40
40
  "@hh.ru/magritte-ui-button": "7.2.27",
41
- "@hh.ru/magritte-ui-card": "8.6.7",
41
+ "@hh.ru/magritte-ui-card": "8.6.8",
42
42
  "@hh.ru/magritte-ui-cell": "7.2.38",
43
- "@hh.ru/magritte-ui-checkable-card": "5.0.46",
43
+ "@hh.ru/magritte-ui-checkable-card": "5.0.47",
44
44
  "@hh.ru/magritte-ui-checkbox-radio": "4.1.34",
45
- "@hh.ru/magritte-ui-drop": "12.3.51",
45
+ "@hh.ru/magritte-ui-drop": "12.3.52",
46
46
  "@hh.ru/magritte-ui-icon": "15.0.3",
47
47
  "@hh.ru/magritte-ui-input": "9.4.41",
48
48
  "@hh.ru/magritte-ui-loader": "4.0.11",
@@ -50,8 +50,8 @@
50
50
  "@hh.ru/magritte-ui-nav-bar": "2.0.13",
51
51
  "@hh.ru/magritte-ui-spacing": "2.1.27",
52
52
  "@hh.ru/magritte-ui-title": "8.3.10",
53
- "@hh.ru/magritte-ui-trigger": "4.3.36",
53
+ "@hh.ru/magritte-ui-trigger": "4.3.37",
54
54
  "@hh.ru/magritte-ui-typography": "5.3.12"
55
55
  },
56
- "gitHead": "415ee07be8bac509b80f46aea4369cf674fb0b50"
56
+ "gitHead": "e658aeedfe7e60ec83de2b515c1459f47d5e91ee"
57
57
  }