@skbkontur/react-ui 6.0.2-19ca1.0 → 6.0.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.0.2](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@6.0.1...@skbkontur/react-ui@6.0.2) (2026-04-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * correct react version calculation + react 19 ref usage ([f857dee](https://github.com/skbkontur/retail-ui/commit/f857dee9552412cd5b3947ea92f93a536e3df70f))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [6.0.1](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@6.0.0...@skbkontur/react-ui@6.0.1) (2026-04-08)
7
18
 
8
19
 
package/README.md CHANGED
@@ -115,11 +115,13 @@ React позволяет создавать root внутри root, но кон
115
115
  Однако, при удалении HTML-элемента, который был root, его необходимо предварительно явно размонтировать:
116
116
 
117
117
  ```tsx static
118
+ const REACT_MAJOR_VERSION = parseInt(React.version.split('.')[0] ?? '', 10) || 0;
119
+
118
120
  React.useLayoutEffect(
119
121
  () => () => {
120
- if (Number(React.version) === 17) {
122
+ if (REACT_MAJOR_VERSION === 17) {
121
123
  rootRef.current && ReactDOM.unmountComponentAtNode(rootRef.current);
122
- } else if (Number(React.version) >= 18) {
124
+ } else if (REACT_MAJOR_VERSION >= 18) {
123
125
  setTimeout(() => reactRoot.current?.unmount());
124
126
  }
125
127
  },
@@ -45,6 +45,7 @@ import { createPropsGetter } from '../../lib/createPropsGetter.js';
45
45
  import { FocusControlWrapper } from '../../internal/FocusControlWrapper/index.js';
46
46
  import { withSize } from '../../lib/size/SizeDecorator.js';
47
47
  import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
48
+ import { REACT_MAJOR_VERSION } from '../../lib/react-is.js';
48
49
  import { CalendarIcon } from './CalendarIcon.js';
49
50
  import { DateFragmentsView } from './DateFragmentsView.js';
50
51
  import { getStyles } from './DateInput.styles.js';
@@ -198,7 +199,7 @@ var DateInput = /** @class */ (function (_super) {
198
199
  if (sync === void 0) { sync = true; }
199
200
  var valueFormatted = _this.iDateMediator.getString();
200
201
  var update = function () { return _this.setState(__assign(__assign({}, state), { valueFormatted: valueFormatted }), _this.emitChange); };
201
- if (sync && Number(React.version) >= 18) {
202
+ if (sync && REACT_MAJOR_VERSION >= 18) {
202
203
  ReactDOM.flushSync(update);
203
204
  }
204
205
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.js","sourceRoot":"","sources":["../../../components/DateInput/DateInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,i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React from 'react';\nimport ReactDOM from 'react-dom';\nimport type { Emotion } from '@emotion/css/create-instance';\n\nimport type { GlobalObject } from '../../lib/globalObject.js';\nimport { ConditionalHandler } from '../../lib/ConditionalHandler.js';\nimport { LENGTH_FULLDATE, MAX_FULLDATE, MIN_FULLDATE } from '../../lib/date/constants.js';\nimport { InternalDateComponentType } from '../../lib/date/types.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport type { DatePickerLocale } from '../DatePicker/locale/index.js';\nimport { DatePickerLocaleHelper } from '../DatePicker/locale/index.js';\nimport { InputLikeText } from '../../internal/InputLikeText/index.js';\nimport { locale } from '../../lib/locale/decorators.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { CommonProps } from '../../internal/CommonWrapper/index.js';\nimport { CommonWrapper } from '../../internal/CommonWrapper/index.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { FocusControlWrapper } from '../../internal/FocusControlWrapper/index.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\n\nimport { CalendarIcon } from './CalendarIcon.js';\nimport { DateFragmentsView } from './DateFragmentsView.js';\nimport { getStyles } from './DateInput.styles.js';\nimport { Actions, extractAction } from './helpers/DateInputKeyboardActions.js';\nimport { InternalDateMediator } from './helpers/InternalDateMediator.js';\n\nexport interface DateInputState {\n selected: InternalDateComponentType | null;\n valueFormatted: string;\n inputMode: boolean;\n focused: boolean;\n dragged: boolean;\n}\n\nexport const DateInputDataTids = {\n root: 'DateInput__root',\n icon: 'DateInput__icon',\n} as const;\n\nexport interface DateInputProps\n extends CommonProps,\n Pick<AriaAttributes, 'aria-describedby' | 'aria-label' | 'aria-labelledby'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'> {\n /** Устанавливает фокус на контроле после окончания загрузки страницы. */\n autoFocus?: boolean;\n\n /** Устанавливает значение датаинпута. */\n value?: string;\n\n /** Переводит контрол в состояние валидации \"ошибка\". */\n error?: boolean;\n\n /** Переводит контрол в состояние валидации \"предупреждение\". */\n warning?: boolean;\n\n /** Делает компонент недоступным. */\n disabled?: boolean;\n\n /** Задает минимальную возможную дату в формате `dd.mm.yyyy`. */\n minDate?: string;\n\n /** Задает максимальную возможную дату в формате `dd.mm.yyyy` */\n maxDate?: string;\n\n /** Задает ширину поля. */\n width?: string | number;\n\n /** Добавляет иконку календаря. */\n withIcon?: boolean;\n\n /** Задает размер поля. */\n size?: SizeProp;\n\n /** Задает функцию, которая вызывается при потере датаинпутом фокуса. */\n onBlur?: (x0: React.FocusEvent<HTMLElement>) => void;\n\n /** Задает функцию, которая вызывается при клике на датаинпут. */\n onClick?: (x0: React.MouseEvent<HTMLElement>) => void;\n\n /** Задает функцию, которая вызывается при получении датаинпутом фокуса. */\n onFocus?: (x0: React.FocusEvent<HTMLElement>) => void;\n\n /** Задает функцию, которая вызывается при изменении value.\n * @param value - строка в формате `dd.mm.yyyy`. */\n onValueChange?: (value: string) => void;\n\n /** Задает функцию, которая вызывается при нажатии кнопки на клавиатуре. */\n onKeyDown?: (x0: React.KeyboardEvent<HTMLElement>) => void;\n}\n\ntype DefaultProps = Required<Pick<DateInputProps, 'value' | 'minDate' | 'maxDate' | 'width'>>;\n\n/**\n * Компонент поля `DateInput` из DatePicker'а помогает выбирать дату с клавиатуры.\n */\n@withRenderEnvironment\n@rootNode\n@locale('DatePicker', DatePickerLocaleHelper)\n@withSize\nexport class DateInput extends React.Component<DateInputProps, DateInputState> {\n public static __KONTUR_REACT_UI__ = 'DateInput';\n public static displayName = 'DateInput';\n\n public static defaultProps: DefaultProps = {\n value: '',\n minDate: MIN_FULLDATE,\n maxDate: MAX_FULLDATE,\n width: 125,\n };\n private size!: SizeProp;\n\n private getProps = createPropsGetter(DateInput.defaultProps);\n\n private iDateMediator: InternalDateMediator = new InternalDateMediator();\n private inputLikeText: InputLikeText | null = null;\n private dateFragmentsView: DateFragmentsView | null = null;\n private isMouseDown = false;\n private isMouseFocus = false;\n private ignoringDelimiter = false;\n private locale!: DatePickerLocale;\n private blurEvent: React.FocusEvent<HTMLElement> | null = null;\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private conditionalHandler = new ConditionalHandler<Actions, [React.KeyboardEvent<HTMLElement>]>()\n .add(Actions.MoveSelectionLeft, () => this.shiftSelection(-1))\n .add(Actions.MoveSelectionRight, () => this.shiftSelection(1))\n .add(Actions.Separator, () => this.pressDelimiter())\n .add(Actions.MoveSelectionFirst, () => this.selectDateComponent(this.iDateMediator.getLeftmostType()))\n .add(Actions.MoveSelectionLast, () => this.selectDateComponent(this.iDateMediator.getRightmostType()))\n .add(Actions.Increment, () => this.shiftDateComponent(1))\n .add(Actions.Decrement, () => this.shiftDateComponent(-1))\n .add(Actions.Digit, (e) => this.inputValue(e))\n .add(Actions.ClearSelection, () => this.clearSelected())\n .add(Actions.ClearOneChar, () => this.clearOneChar())\n .add(Actions.FullSelection, () => this.fullSelection())\n .add(Actions.WrongInput, () => this.blink())\n .build();\n\n constructor(props: DateInputProps) {\n super(props);\n\n this.state = {\n valueFormatted: '',\n selected: null,\n inputMode: false,\n focused: false,\n dragged: false,\n };\n }\n\n public componentDidUpdate(prevProps: DateInputProps) {\n const { value, minDate, maxDate } = this.getProps();\n if (\n prevProps.value !== value ||\n prevProps.minDate !== minDate ||\n prevProps.maxDate !== maxDate ||\n this.iDateMediator.isChangedLocale(this.locale)\n ) {\n this.updateFromProps(false);\n }\n !this.props.disabled && this.selectNode();\n }\n\n public selectNode = (): void => {\n const type = this.state.selected;\n const dateFragmentsView = this.dateFragmentsView && this.dateFragmentsView.getRootNode();\n if (type === null || !this.inputLikeText || !dateFragmentsView) {\n return;\n }\n if (type === InternalDateComponentType.All) {\n this.inputLikeText.selectInnerNode(dateFragmentsView, 0, 5);\n return;\n }\n const index = this.iDateMediator.getTypesOrder().indexOf(type);\n if (index > -1) {\n this.inputLikeText.selectInnerNode(dateFragmentsView, index * 2, index * 2 + 1);\n }\n };\n\n public componentDidMount(): void {\n this.updateFromProps(false);\n if (this.props.autoFocus) {\n this.focus();\n }\n }\n\n public blur(): void {\n if (this.inputLikeText) {\n this.inputLikeText.blur();\n }\n }\n\n public focus(): void {\n if (this.inputLikeText) {\n this.inputLikeText.focus();\n }\n }\n\n public blink(): void {\n if (this.inputLikeText) {\n this.inputLikeText.blink();\n }\n }\n\n public render(): React.JSX.Element {\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n const { focused, selected, inputMode, valueFormatted } = this.state;\n const showValue = Boolean(focused || valueFormatted);\n const { width } = this.getProps();\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <FocusControlWrapper onBlurWhenDisabled={this.resetFocus}>\n <InputLikeText\n data-tid={DateInputDataTids.root}\n id={this.props.id}\n width={width}\n ref={this.inputLikeTextRef}\n size={this.size}\n disabled={this.props.disabled}\n error={this.props.error}\n warning={this.props.warning}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onClick={this.props.onClick}\n onKeyDown={this.handleKeyDown}\n onMouseDownCapture={this.handleMouseDownCapture}\n onPaste={this.handlePaste}\n rightIcon={this.renderIcon()}\n onDoubleClickCapture={this.handleDoubleClick}\n onMouseDragStart={this.handleMouseDragStart}\n onMouseDragEnd={this.handleMouseDragEnd}\n value={this.iDateMediator.getInternalString()}\n inputMode={'numeric'}\n takeContentWidth\n aria-describedby={this.props['aria-describedby']}\n aria-label={this.props['aria-label']}\n aria-labelledby={this.props['aria-labelledby']}\n >\n <span className={this.cx(this.styles.value(), { [this.styles.valueVisible()]: showValue })}>\n <DateFragmentsView\n ref={this.dateFragmentsViewRef}\n fragments={this.iDateMediator.getFragments()}\n onSelectDateComponent={this.handleSelectDateComponent}\n selected={selected}\n inputMode={inputMode}\n />\n </span>\n </InputLikeText>\n </FocusControlWrapper>\n </CommonWrapper>\n );\n }\n\n private renderIcon = () => {\n const { withIcon, disabled = false } = this.props;\n const size = this.size;\n\n if (withIcon) {\n const theme = this.theme;\n const icon = <CalendarIcon size={size} />;\n const iconStyles = this.cx({\n [this.styles.icon(theme)]: true,\n [this.styles.iconSmall(theme)]: size === 'small',\n [this.styles.iconMedium(theme)]: size === 'medium',\n [this.styles.iconLarge(theme)]: size === 'large',\n [this.styles.iconDisabled(theme)]: disabled,\n });\n return (\n <span className={iconStyles} data-tid={DateInputDataTids.icon}>\n {icon}\n </span>\n );\n }\n return null;\n };\n\n private handleFocus = (e: React.FocusEvent<HTMLElement>) => {\n this.setState((prevState) => ({\n focused: true,\n selected: this.isMouseDown && !prevState.focused ? prevState.selected : this.iDateMediator.getLeftmostType(),\n }));\n\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n };\n\n private resetFocus = () => this.updateValue({ focused: false, selected: null, inputMode: false }, false);\n\n private handleBlur = (e: React.FocusEvent<HTMLElement>) => {\n this.resetFocus();\n\n if (this.props.onBlur) {\n const restored = this.iDateMediator.restore();\n if (restored) {\n e.persist();\n this.blurEvent = e;\n } else {\n this.props.onBlur(e);\n }\n }\n };\n\n private handleMouseDownCapture = (e: React.MouseEvent<HTMLSpanElement>) => {\n const isFragment = this.dateFragmentsView ? this.dateFragmentsView.isFragment(e.target) : false;\n if (this.state.focused && !isFragment) {\n e.preventDefault();\n }\n this.isMouseFocus = !this.state.focused;\n this.isMouseDown = isFragment;\n };\n\n private handleSelectDateComponent = (type: InternalDateComponentType) => {\n if (!(this.isMouseFocus && this.iDateMediator.isEmpty())) {\n this.selectDateComponent(type);\n }\n this.isMouseFocus = false;\n this.isMouseDown = false;\n };\n\n private handleMouseDragStart = () => {\n this.setState({ dragged: true, selected: null });\n };\n\n private handleMouseDragEnd = () => {\n const selection = this.globalObject.getSelection?.();\n if (\n selection &&\n selection.toString().length === LENGTH_FULLDATE &&\n this.state.selected !== InternalDateComponentType.All\n ) {\n this.selectDateComponent(InternalDateComponentType.All);\n }\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (this.conditionalHandler(extractAction(e), e)) {\n e.preventDefault();\n }\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n };\n\n private handlePaste = (e: React.ClipboardEvent<HTMLElement>) => {\n const pasted = e && e.clipboardData.getData('text').trim();\n if (pasted && this.iDateMediator.validateString(pasted)) {\n this.iDateMediator.paste(pasted);\n this.updateValue();\n }\n };\n\n private handleDoubleClick = () => {\n this.selectDateComponent(InternalDateComponentType.All);\n };\n\n private inputLikeTextRef = (el: InputLikeText | null) => {\n this.inputLikeText = el;\n };\n\n private dateFragmentsViewRef = (el: DateFragmentsView | null) => {\n this.dateFragmentsView = el;\n };\n\n private selectDateComponent = (selected: InternalDateComponentType | null): void => {\n this.setState({ selected, inputMode: false });\n };\n\n private updateValue = (state: Partial<DateInputState> = {}, sync = true): void => {\n const valueFormatted = this.iDateMediator.getString();\n\n const update = () => this.setState({ ...state, valueFormatted } as DateInputState, this.emitChange);\n\n if (sync && Number(React.version) >= 18) {\n ReactDOM.flushSync(update);\n } else {\n update();\n }\n };\n\n private updateFromProps = (sync: boolean): void => {\n this.iDateMediator.update(this.props, this.locale);\n\n this.updateValue({}, sync);\n };\n\n private fullSelection = (): void => {\n this.selectDateComponent(InternalDateComponentType.All);\n };\n\n private pressDelimiter = (): void => {\n const value = this.iDateMediator.get(this.state.selected);\n if (value !== null && value !== '') {\n if (!this.ignoringDelimiter) {\n this.shiftSelection(1);\n }\n this.ignoringDelimiter = false;\n }\n };\n\n private emitChange = (): void => {\n if (this.props.onValueChange) {\n const value = this.iDateMediator.getInternalString();\n if (this.props.value !== value) {\n this.props.onValueChange(value);\n }\n }\n\n // `this.blurEvent` is always null in `flushSync` without `setTimeout` due to sync update\n setTimeout(() => {\n if (this.blurEvent && this.props.onBlur) {\n this.props.onBlur(this.blurEvent);\n this.blurEvent = null;\n }\n });\n };\n\n private clearSelected = (): void => {\n const selected = this.state.selected === null ? this.iDateMediator.getLeftmostType() : this.state.selected;\n this.iDateMediator.clear(selected);\n this.updateValue({\n inputMode: false,\n selected: selected === InternalDateComponentType.All ? this.iDateMediator.getLeftmostType() : selected,\n });\n };\n\n private clearOneChar = (): void => {\n const { selected, inputMode } = this.state;\n const nextType = selected === null ? this.iDateMediator.getRightmostType() : selected;\n if (this.iDateMediator.isNull(nextType)) {\n this.shiftSelection(-1);\n return;\n }\n if (selected === InternalDateComponentType.All) {\n this.iDateMediator.clear(InternalDateComponentType.All);\n this.updateValue({ selected: this.iDateMediator.getLeftmostType() });\n return;\n }\n this.iDateMediator.deleteOneCharRight(nextType, inputMode);\n this.updateValue({\n inputMode: this.iDateMediator.get(nextType) !== null,\n selected: nextType,\n });\n };\n\n private shiftDateComponent = (step: number): void => {\n const { selected } = this.state;\n const changed = this.iDateMediator.shiftDateComponent(selected, step);\n if (!changed) {\n this.blink();\n return;\n }\n this.updateValue({\n inputMode: false,\n selected: selected === InternalDateComponentType.All ? this.iDateMediator.getLeftmostType() : selected,\n });\n };\n\n private shiftSelection = (step: number): void => {\n const selected = this.iDateMediator.getShiftedType(this.state.selected, step);\n if (selected !== this.state.selected) {\n this.setState({ selected, inputMode: false });\n }\n };\n\n private inputValue = (event: React.KeyboardEvent<HTMLElement>): void => {\n let selected = this.state.selected;\n if (selected === InternalDateComponentType.All) {\n selected = this.iDateMediator.getLeftmostType();\n this.iDateMediator.clear(InternalDateComponentType.All);\n this.setState({ selected });\n }\n\n const { inputMode } = this.iDateMediator.inputKey(event.key, selected, this.state.inputMode);\n\n if (!inputMode) {\n this.ignoringDelimiter = true;\n this.shiftSelection(1);\n }\n this.updateValue({ in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AAiB,CAAC;oBAE9C,8BAAM,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,YAAI,GAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,IAAG,SAAS,MAAG;wBACxF,oBAAC,iBAAiB,IAChB,GAAG,EAAE,IAAI,CAAC,oBAAoB,EAC9B,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,EAC5C,qBAAqB,EAAE,IAAI,CAAC,yBAAyB,EACrD,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,GACpB,CACG,CACO,CACI,CACR,CACjB,CAAC;IACJ,CAAC;;IAzKa,6BAAmB,GAAG,WAAW,AAAd,CAAe;IAClC,qBAAW,GAAG,WAAW,AAAd,CAAe;IAE1B,sBAAY,GAAiB;QACzC,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,GAAG;KACX,AALyB,CAKxB;IATS,SAAS;QAJrB,qBAAqB;QACrB,QAAQ;QACR,MAAM,CAAC,YAAY,EAAE,sBAAsB,CAAC;QAC5C,QAAQ;OACI,SAAS,CAgZrB;IAAD,gBAAC;CAAA,AAhZD,CAA+B,KAAK,CAAC,SAAS,GAgZ7C;SAhZY,SAAS","sourcesContent":["import type { AriaAttributes, HTMLAttributes } from 'react';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport type { Emotion } from '@emotion/css/create-instance';\n\nimport type { GlobalObject } from '../../lib/globalObject.js';\nimport { ConditionalHandler } from '../../lib/ConditionalHandler.js';\nimport { LENGTH_FULLDATE, MAX_FULLDATE, MIN_FULLDATE } from '../../lib/date/constants.js';\nimport { InternalDateComponentType } from '../../lib/date/types.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport type { DatePickerLocale } from '../DatePicker/locale/index.js';\nimport { DatePickerLocaleHelper } from '../DatePicker/locale/index.js';\nimport { InputLikeText } from '../../internal/InputLikeText/index.js';\nimport { locale } from '../../lib/locale/decorators.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { CommonProps } from '../../internal/CommonWrapper/index.js';\nimport { CommonWrapper } from '../../internal/CommonWrapper/index.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { FocusControlWrapper } from '../../internal/FocusControlWrapper/index.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport { REACT_MAJOR_VERSION } from '../../lib/react-is.js';\n\nimport { CalendarIcon } from './CalendarIcon.js';\nimport { DateFragmentsView } from './DateFragmentsView.js';\nimport { getStyles } from './DateInput.styles.js';\nimport { Actions, extractAction } from './helpers/DateInputKeyboardActions.js';\nimport { InternalDateMediator } from './helpers/InternalDateMediator.js';\n\nexport interface DateInputState {\n selected: InternalDateComponentType | null;\n valueFormatted: string;\n inputMode: boolean;\n focused: boolean;\n dragged: boolean;\n}\n\nexport const DateInputDataTids = {\n root: 'DateInput__root',\n icon: 'DateInput__icon',\n} as const;\n\nexport interface DateInputProps\n extends CommonProps,\n Pick<AriaAttributes, 'aria-describedby' | 'aria-label' | 'aria-labelledby'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'> {\n /** Устанавливает фокус на контроле после окончания загрузки страницы. */\n autoFocus?: boolean;\n\n /** Устанавливает значение датаинпута. */\n value?: string;\n\n /** Переводит контрол в состояние валидации \"ошибка\". */\n error?: boolean;\n\n /** Переводит контрол в состояние валидации \"предупреждение\". */\n warning?: boolean;\n\n /** Делает компонент недоступным. */\n disabled?: boolean;\n\n /** Задает минимальную возможную дату в формате `dd.mm.yyyy`. */\n minDate?: string;\n\n /** Задает максимальную возможную дату в формате `dd.mm.yyyy` */\n maxDate?: string;\n\n /** Задает ширину поля. */\n width?: string | number;\n\n /** Добавляет иконку календаря. */\n withIcon?: boolean;\n\n /** Задает размер поля. */\n size?: SizeProp;\n\n /** Задает функцию, которая вызывается при потере датаинпутом фокуса. */\n onBlur?: (x0: React.FocusEvent<HTMLElement>) => void;\n\n /** Задает функцию, которая вызывается при клике на датаинпут. */\n onClick?: (x0: React.MouseEvent<HTMLElement>) => void;\n\n /** Задает функцию, которая вызывается при получении датаинпутом фокуса. */\n onFocus?: (x0: React.FocusEvent<HTMLElement>) => void;\n\n /** Задает функцию, которая вызывается при изменении value.\n * @param value - строка в формате `dd.mm.yyyy`. */\n onValueChange?: (value: string) => void;\n\n /** Задает функцию, которая вызывается при нажатии кнопки на клавиатуре. */\n onKeyDown?: (x0: React.KeyboardEvent<HTMLElement>) => void;\n}\n\ntype DefaultProps = Required<Pick<DateInputProps, 'value' | 'minDate' | 'maxDate' | 'width'>>;\n\n/**\n * Компонент поля `DateInput` из DatePicker'а помогает выбирать дату с клавиатуры.\n */\n@withRenderEnvironment\n@rootNode\n@locale('DatePicker', DatePickerLocaleHelper)\n@withSize\nexport class DateInput extends React.Component<DateInputProps, DateInputState> {\n public static __KONTUR_REACT_UI__ = 'DateInput';\n public static displayName = 'DateInput';\n\n public static defaultProps: DefaultProps = {\n value: '',\n minDate: MIN_FULLDATE,\n maxDate: MAX_FULLDATE,\n width: 125,\n };\n private size!: SizeProp;\n\n private getProps = createPropsGetter(DateInput.defaultProps);\n\n private iDateMediator: InternalDateMediator = new InternalDateMediator();\n private inputLikeText: InputLikeText | null = null;\n private dateFragmentsView: DateFragmentsView | null = null;\n private isMouseDown = false;\n private isMouseFocus = false;\n private ignoringDelimiter = false;\n private locale!: DatePickerLocale;\n private blurEvent: React.FocusEvent<HTMLElement> | null = null;\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private conditionalHandler = new ConditionalHandler<Actions, [React.KeyboardEvent<HTMLElement>]>()\n .add(Actions.MoveSelectionLeft, () => this.shiftSelection(-1))\n .add(Actions.MoveSelectionRight, () => this.shiftSelection(1))\n .add(Actions.Separator, () => this.pressDelimiter())\n .add(Actions.MoveSelectionFirst, () => this.selectDateComponent(this.iDateMediator.getLeftmostType()))\n .add(Actions.MoveSelectionLast, () => this.selectDateComponent(this.iDateMediator.getRightmostType()))\n .add(Actions.Increment, () => this.shiftDateComponent(1))\n .add(Actions.Decrement, () => this.shiftDateComponent(-1))\n .add(Actions.Digit, (e) => this.inputValue(e))\n .add(Actions.ClearSelection, () => this.clearSelected())\n .add(Actions.ClearOneChar, () => this.clearOneChar())\n .add(Actions.FullSelection, () => this.fullSelection())\n .add(Actions.WrongInput, () => this.blink())\n .build();\n\n constructor(props: DateInputProps) {\n super(props);\n\n this.state = {\n valueFormatted: '',\n selected: null,\n inputMode: false,\n focused: false,\n dragged: false,\n };\n }\n\n public componentDidUpdate(prevProps: DateInputProps) {\n const { value, minDate, maxDate } = this.getProps();\n if (\n prevProps.value !== value ||\n prevProps.minDate !== minDate ||\n prevProps.maxDate !== maxDate ||\n this.iDateMediator.isChangedLocale(this.locale)\n ) {\n this.updateFromProps(false);\n }\n !this.props.disabled && this.selectNode();\n }\n\n public selectNode = (): void => {\n const type = this.state.selected;\n const dateFragmentsView = this.dateFragmentsView && this.dateFragmentsView.getRootNode();\n if (type === null || !this.inputLikeText || !dateFragmentsView) {\n return;\n }\n if (type === InternalDateComponentType.All) {\n this.inputLikeText.selectInnerNode(dateFragmentsView, 0, 5);\n return;\n }\n const index = this.iDateMediator.getTypesOrder().indexOf(type);\n if (index > -1) {\n this.inputLikeText.selectInnerNode(dateFragmentsView, index * 2, index * 2 + 1);\n }\n };\n\n public componentDidMount(): void {\n this.updateFromProps(false);\n if (this.props.autoFocus) {\n this.focus();\n }\n }\n\n public blur(): void {\n if (this.inputLikeText) {\n this.inputLikeText.blur();\n }\n }\n\n public focus(): void {\n if (this.inputLikeText) {\n this.inputLikeText.focus();\n }\n }\n\n public blink(): void {\n if (this.inputLikeText) {\n this.inputLikeText.blink();\n }\n }\n\n public render(): React.JSX.Element {\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n const { focused, selected, inputMode, valueFormatted } = this.state;\n const showValue = Boolean(focused || valueFormatted);\n const { width } = this.getProps();\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <FocusControlWrapper onBlurWhenDisabled={this.resetFocus}>\n <InputLikeText\n data-tid={DateInputDataTids.root}\n id={this.props.id}\n width={width}\n ref={this.inputLikeTextRef}\n size={this.size}\n disabled={this.props.disabled}\n error={this.props.error}\n warning={this.props.warning}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onClick={this.props.onClick}\n onKeyDown={this.handleKeyDown}\n onMouseDownCapture={this.handleMouseDownCapture}\n onPaste={this.handlePaste}\n rightIcon={this.renderIcon()}\n onDoubleClickCapture={this.handleDoubleClick}\n onMouseDragStart={this.handleMouseDragStart}\n onMouseDragEnd={this.handleMouseDragEnd}\n value={this.iDateMediator.getInternalString()}\n inputMode={'numeric'}\n takeContentWidth\n aria-describedby={this.props['aria-describedby']}\n aria-label={this.props['aria-label']}\n aria-labelledby={this.props['aria-labelledby']}\n >\n <span className={this.cx(this.styles.value(), { [this.styles.valueVisible()]: showValue })}>\n <DateFragmentsView\n ref={this.dateFragmentsViewRef}\n fragments={this.iDateMediator.getFragments()}\n onSelectDateComponent={this.handleSelectDateComponent}\n selected={selected}\n inputMode={inputMode}\n />\n </span>\n </InputLikeText>\n </FocusControlWrapper>\n </CommonWrapper>\n );\n }\n\n private renderIcon = () => {\n const { withIcon, disabled = false } = this.props;\n const size = this.size;\n\n if (withIcon) {\n const theme = this.theme;\n const icon = <CalendarIcon size={size} />;\n const iconStyles = this.cx({\n [this.styles.icon(theme)]: true,\n [this.styles.iconSmall(theme)]: size === 'small',\n [this.styles.iconMedium(theme)]: size === 'medium',\n [this.styles.iconLarge(theme)]: size === 'large',\n [this.styles.iconDisabled(theme)]: disabled,\n });\n return (\n <span className={iconStyles} data-tid={DateInputDataTids.icon}>\n {icon}\n </span>\n );\n }\n return null;\n };\n\n private handleFocus = (e: React.FocusEvent<HTMLElement>) => {\n this.setState((prevState) => ({\n focused: true,\n selected: this.isMouseDown && !prevState.focused ? prevState.selected : this.iDateMediator.getLeftmostType(),\n }));\n\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n };\n\n private resetFocus = () => this.updateValue({ focused: false, selected: null, inputMode: false }, false);\n\n private handleBlur = (e: React.FocusEvent<HTMLElement>) => {\n this.resetFocus();\n\n if (this.props.onBlur) {\n const restored = this.iDateMediator.restore();\n if (restored) {\n e.persist();\n this.blurEvent = e;\n } else {\n this.props.onBlur(e);\n }\n }\n };\n\n private handleMouseDownCapture = (e: React.MouseEvent<HTMLSpanElement>) => {\n const isFragment = this.dateFragmentsView ? this.dateFragmentsView.isFragment(e.target) : false;\n if (this.state.focused && !isFragment) {\n e.preventDefault();\n }\n this.isMouseFocus = !this.state.focused;\n this.isMouseDown = isFragment;\n };\n\n private handleSelectDateComponent = (type: InternalDateComponentType) => {\n if (!(this.isMouseFocus && this.iDateMediator.isEmpty())) {\n this.selectDateComponent(type);\n }\n this.isMouseFocus = false;\n this.isMouseDown = false;\n };\n\n private handleMouseDragStart = () => {\n this.setState({ dragged: true, selected: null });\n };\n\n private handleMouseDragEnd = () => {\n const selection = this.globalObject.getSelection?.();\n if (\n selection &&\n selection.toString().length === LENGTH_FULLDATE &&\n this.state.selected !== InternalDateComponentType.All\n ) {\n this.selectDateComponent(InternalDateComponentType.All);\n }\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (this.conditionalHandler(extractAction(e), e)) {\n e.preventDefault();\n }\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n };\n\n private handlePaste = (e: React.ClipboardEvent<HTMLElement>) => {\n const pasted = e && e.clipboardData.getData('text').trim();\n if (pasted && this.iDateMediator.validateString(pasted)) {\n this.iDateMediator.paste(pasted);\n this.updateValue();\n }\n };\n\n private handleDoubleClick = () => {\n this.selectDateComponent(InternalDateComponentType.All);\n };\n\n private inputLikeTextRef = (el: InputLikeText | null) => {\n this.inputLikeText = el;\n };\n\n private dateFragmentsViewRef = (el: DateFragmentsView | null) => {\n this.dateFragmentsView = el;\n };\n\n private selectDateComponent = (selected: InternalDateComponentType | null): void => {\n this.setState({ selected, inputMode: false });\n };\n\n private updateValue = (state: Partial<DateInputState> = {}, sync = true): void => {\n const valueFormatted = this.iDateMediator.getString();\n\n const update = () => this.setState({ ...state, valueFormatted } as DateInputState, this.emitChange);\n\n if (sync && REACT_MAJOR_VERSION >= 18) {\n ReactDOM.flushSync(update);\n } else {\n update();\n }\n };\n\n private updateFromProps = (sync: boolean): void => {\n this.iDateMediator.update(this.props, this.locale);\n\n this.updateValue({}, sync);\n };\n\n private fullSelection = (): void => {\n this.selectDateComponent(InternalDateComponentType.All);\n };\n\n private pressDelimiter = (): void => {\n const value = this.iDateMediator.get(this.state.selected);\n if (value !== null && value !== '') {\n if (!this.ignoringDelimiter) {\n this.shiftSelection(1);\n }\n this.ignoringDelimiter = false;\n }\n };\n\n private emitChange = (): void => {\n if (this.props.onValueChange) {\n const value = this.iDateMediator.getInternalString();\n if (this.props.value !== value) {\n this.props.onValueChange(value);\n }\n }\n\n // `this.blurEvent` is always null in `flushSync` without `setTimeout` due to sync update\n setTimeout(() => {\n if (this.blurEvent && this.props.onBlur) {\n this.props.onBlur(this.blurEvent);\n this.blurEvent = null;\n }\n });\n };\n\n private clearSelected = (): void => {\n const selected = this.state.selected === null ? this.iDateMediator.getLeftmostType() : this.state.selected;\n this.iDateMediator.clear(selected);\n this.updateValue({\n inputMode: false,\n selected: selected === InternalDateComponentType.All ? this.iDateMediator.getLeftmostType() : selected,\n });\n };\n\n private clearOneChar = (): void => {\n const { selected, inputMode } = this.state;\n const nextType = selected === null ? this.iDateMediator.getRightmostType() : selected;\n if (this.iDateMediator.isNull(nextType)) {\n this.shiftSelection(-1);\n return;\n }\n if (selected === InternalDateComponentType.All) {\n this.iDateMediator.clear(InternalDateComponentType.All);\n this.updateValue({ selected: this.iDateMediator.getLeftmostType() });\n return;\n }\n this.iDateMediator.deleteOneCharRight(nextType, inputMode);\n this.updateValue({\n inputMode: this.iDateMediator.get(nextType) !== null,\n selected: nextType,\n });\n };\n\n private shiftDateComponent = (step: number): void => {\n const { selected } = this.state;\n const changed = this.iDateMediator.shiftDateComponent(selected, step);\n if (!changed) {\n this.blink();\n return;\n }\n this.updateValue({\n inputMode: false,\n selected: selected === InternalDateComponentType.All ? this.iDateMediator.getLeftmostType() : selected,\n });\n };\n\n private shiftSelection = (step: number): void => {\n const selected = this.iDateMediator.getShiftedType(this.state.selected, step);\n if (selected !== this.state.selected) {\n this.setState({ selected, inputMode: false });\n }\n };\n\n private inputValue = (event: React.KeyboardEvent<HTMLElement>): void => {\n let selected = this.state.selected;\n if (selected === InternalDateComponentType.All) {\n selected = this.iDateMediator.getLeftmostType();\n this.iDateMediator.clear(InternalDateComponentType.All);\n this.setState({ selected });\n }\n\n const { inputMode } = this.iDateMediator.inputKey(event.key, selected, this.state.inputMode);\n\n if (!inputMode) {\n this.ignoringDelimiter = true;\n this.shiftSelection(1);\n }\n this.updateValue({ inputMode });\n };\n}\n"]}
@@ -42,8 +42,8 @@ export interface DateRangePickerRef extends InstanceWithRootNode {
42
42
  export type DateRangePicker = DateRangePickerRef;
43
43
  export declare const DateRangePicker: {
44
44
  Start: import("../../lib/forwardRefAndName.js").ReactUIComponentWithRef<DateInput, {
45
- className?: string | undefined;
46
45
  style?: React.CSSProperties | undefined;
46
+ className?: string | undefined;
47
47
  'data-tid'?: string | undefined;
48
48
  children?: React.ReactNode;
49
49
  error?: boolean | undefined;
@@ -68,8 +68,8 @@ export declare const DateRangePicker: {
68
68
  optional?: boolean | undefined;
69
69
  }> & Record<never, never>;
70
70
  End: import("../../lib/forwardRefAndName.js").ReactUIComponentWithRef<DateInput, {
71
- className?: string | undefined;
72
71
  style?: React.CSSProperties | undefined;
72
+ className?: string | undefined;
73
73
  'data-tid'?: string | undefined;
74
74
  children?: React.ReactNode;
75
75
  error?: boolean | undefined;
@@ -27,6 +27,7 @@ var __assign = (this && this.__assign) || function () {
27
27
  import React from 'react';
28
28
  import ReactDOM from 'react-dom';
29
29
  import { Toast } from '../Toast/index.js';
30
+ import { REACT_MAJOR_VERSION } from '../../lib/react-is.js';
30
31
  /**
31
32
  * `SingleToast` — это короткое немодальное уведомление, которое сообщает пользователю о результате выполнения его команды.
32
33
  * Результат может быть положительным, отрицательным или нейтральным.
@@ -48,7 +49,7 @@ var SingleToast = /** @class */ (function (_super) {
48
49
  SingleToast.ref = React.createRef();
49
50
  SingleToast.close = function () {
50
51
  var _a;
51
- if (Number(React.version) >= 18) {
52
+ if (REACT_MAJOR_VERSION >= 18) {
52
53
  ReactDOM.flushSync(function () { var _a; return (_a = SingleToast.ref.current) === null || _a === void 0 ? void 0 : _a.close(); });
53
54
  }
54
55
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"SingleToast.js","sourceRoot":"","sources":["../../../components/SingleToast/SingleToast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;;;;;;GAQG;AACH;IAAiC,+BAA2B;IAA5D;;QA6BE,YAAM,GAAG,cAAyB,OAAA,oBAAC,KAAK,aAAC,GAAG,EAAE,WAAW,CAAC,GAAG,IAAM,KAAI,CAAC,KAAK,EAAI,EAA/C,CAA+C,CAAC;;IACpF,CAAC;IA7Be,+BAAmB,GAAG,aAAa,AAAhB,CAAiB;IACpC,uBAAW,GAAG,aAAa,AAAhB,CAAiB;IAC5B,eAAG,GAAG,KAAK,CAAC,SAAS,EAAS,AAA3B,CAA4B;IAE/B,iBAAK,GAAe;;QAChC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YAChC,QAAQ,CAAC,SAAS,CAAC,sBAAM,OAAA,MAAA,WAAW,CAAC,GAAG,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAA,EAAA,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,MAAA,WAAW,CAAC,GAAG,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;QACnC,CAAC;IACH,CAAC,AANkB,CAMjB;IAEF;;;;;;;;;;OAUG;IACW,gBAAI,GAAiB,UAAC,YAA6B,EAAE,MAAwB;;QACzF,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,MAAA,WAAW,CAAC,GAAG,CAAC,OAAO,0CAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC,AAHiB,CAGhB;IAGJ,kBAAC;CAAA,AA9BD,CAAiC,KAAK,CAAC,SAAS,GA8B/C;SA9BY,WAAW","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ToastClose, ToastProps, ToastPushApi, ToastPushConfig } from '../Toast/index.js';\nimport { Toast } from '../Toast/index.js';\n\n/**\n * `SingleToast` — это короткое немодальное уведомление, которое сообщает пользователю о результате выполнения его команды.\n * Результат может быть положительным, отрицательным или нейтральным.\n *\n * Позволяет вызывать тосты с помощью статических методов.\n *\n * ##### Особенности компонента SingleToast\n * Для корректной работы `<SingleToast />` должен быть отрисован только **один раз** на странице. После чего его можно вызывать из любого места приложения методом `SingleToast.push()`. Однако, переданные в компонент пропсы, такие как `theme`, `onPush` и остальные, будут применяться ко всем вызовам.\n */\nexport class SingleToast extends React.Component<ToastProps> {\n public static __KONTUR_REACT_UI__ = 'SingleToast';\n public static displayName = 'SingleToast';\n public static ref = React.createRef<Toast>();\n\n public static close: ToastClose = () => {\n if (Number(React.version) >= 18) {\n ReactDOM.flushSync(() => SingleToast.ref.current?.close());\n } else {\n SingleToast.ref.current?.close();\n }\n };\n\n /**\n * Показывает тост с `notification` в качестве сообщения.\n * Тост автоматически скрывается через 3 или 7 секунд,\n * в зависимости от наличия у него кнопки `action` внутри config-а.\n * Время показа можно задать вручную, передав `showTime` внутри config-а.\n *\n * @public\n * @param {React.ReactNode} notification\n * @param {ToastPushConfig} config объект с конфигурацией отображения компонента Toast\n *\n */\n public static push: ToastPushApi = (notification: React.ReactNode, config?: ToastPushConfig): void => {\n SingleToast.close();\n SingleToast.ref.current?.push(notification, config);\n };\n\n render = (): React.JSX.Element => <Toast ref={SingleToast.ref} {...this.props} />;\n}\n"]}
1
+ {"version":3,"file":"SingleToast.js","sourceRoot":"","sources":["../../../components/SingleToast/SingleToast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;GAQG;AACH;IAAiC,+BAA2B;IAA5D;;QA6BE,YAAM,GAAG,cAAyB,OAAA,oBAAC,KAAK,aAAC,GAAG,EAAE,WAAW,CAAC,GAAG,IAAM,KAAI,CAAC,KAAK,EAAI,EAA/C,CAA+C,CAAC;;IACpF,CAAC;IA7Be,+BAAmB,GAAG,aAAa,AAAhB,CAAiB;IACpC,uBAAW,GAAG,aAAa,AAAhB,CAAiB;IAC5B,eAAG,GAAG,KAAK,CAAC,SAAS,EAAS,AAA3B,CAA4B;IAE/B,iBAAK,GAAe;;QAChC,IAAI,mBAAmB,IAAI,EAAE,EAAE,CAAC;YAC9B,QAAQ,CAAC,SAAS,CAAC,sBAAM,OAAA,MAAA,WAAW,CAAC,GAAG,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAA,EAAA,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,MAAA,WAAW,CAAC,GAAG,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;QACnC,CAAC;IACH,CAAC,AANkB,CAMjB;IAEF;;;;;;;;;;OAUG;IACW,gBAAI,GAAiB,UAAC,YAA6B,EAAE,MAAwB;;QACzF,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,MAAA,WAAW,CAAC,GAAG,CAAC,OAAO,0CAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC,AAHiB,CAGhB;IAGJ,kBAAC;CAAA,AA9BD,CAAiC,KAAK,CAAC,SAAS,GA8B/C;SA9BY,WAAW","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ToastClose, ToastProps, ToastPushApi, ToastPushConfig } from '../Toast/index.js';\nimport { Toast } from '../Toast/index.js';\nimport { REACT_MAJOR_VERSION } from '../../lib/react-is.js';\n\n/**\n * `SingleToast` — это короткое немодальное уведомление, которое сообщает пользователю о результате выполнения его команды.\n * Результат может быть положительным, отрицательным или нейтральным.\n *\n * Позволяет вызывать тосты с помощью статических методов.\n *\n * ##### Особенности компонента SingleToast\n * Для корректной работы `<SingleToast />` должен быть отрисован только **один раз** на странице. После чего его можно вызывать из любого места приложения методом `SingleToast.push()`. Однако, переданные в компонент пропсы, такие как `theme`, `onPush` и остальные, будут применяться ко всем вызовам.\n */\nexport class SingleToast extends React.Component<ToastProps> {\n public static __KONTUR_REACT_UI__ = 'SingleToast';\n public static displayName = 'SingleToast';\n public static ref = React.createRef<Toast>();\n\n public static close: ToastClose = () => {\n if (REACT_MAJOR_VERSION >= 18) {\n ReactDOM.flushSync(() => SingleToast.ref.current?.close());\n } else {\n SingleToast.ref.current?.close();\n }\n };\n\n /**\n * Показывает тост с `notification` в качестве сообщения.\n * Тост автоматически скрывается через 3 или 7 секунд,\n * в зависимости от наличия у него кнопки `action` внутри config-а.\n * Время показа можно задать вручную, передав `showTime` внутри config-а.\n *\n * @public\n * @param {React.ReactNode} notification\n * @param {ToastPushConfig} config объект с конфигурацией отображения компонента Toast\n *\n */\n public static push: ToastPushApi = (notification: React.ReactNode, config?: ToastPushConfig): void => {\n SingleToast.close();\n SingleToast.ref.current?.push(notification, config);\n };\n\n render = (): React.JSX.Element => <Toast ref={SingleToast.ref} {...this.props} />;\n}\n"]}
@@ -74,6 +74,7 @@ import { responsiveLayout } from '../../components/ResponsiveLayout/decorator.js
74
74
  import { rootNode } from '../../lib/rootNode/index.js';
75
75
  import { withSize } from '../../lib/size/SizeDecorator.js';
76
76
  import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
77
+ import { REACT_MAJOR_VERSION } from '../../lib/react-is.js';
77
78
  import { ComboBoxRequestStatus } from './CustomComboBoxTypes.js';
78
79
  import { reducer } from './CustomComboBoxReducer.js';
79
80
  import { ComboBoxView } from './ComboBoxView.js';
@@ -155,7 +156,7 @@ var CustomComboBox = /** @class */ (function (_super) {
155
156
  };
156
157
  // Auto-batching React@18 creates problems that are fixed with flushSync
157
158
  // https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366
158
- if (sync && Number(React.version) >= 18) {
159
+ if (sync && REACT_MAJOR_VERSION >= 18) {
159
160
  ReactDOM.flushSync(function () { return updateState(action); });
160
161
  }
161
162
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"CustomComboBox.js","sourceRoot":"","sources":["../../../internal/CustomComboBox/CustomComboBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAQjC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAo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QACf,CAAC;IACH,CAAC;IAEM,2CAAkB,GAAzB,UAA0B,SAAiC,EAAE,SAAiC;QAC5F,IAAI,SAAS,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;QACD,IAAI,CAAC,QAAQ,CACX;YACE,IAAI,EAAE,WAAW;YACjB,SAAS,WAAA;YACT,SAAS,WAAA;SACV,EACD,KAAK,CACN,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,8BAAK,GAAZ;QACE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnC,CAAC;IA/Pa,kCAAmB,GAAG,gBAAgB,AAAnB,CAAoB;IACvC,0BAAW,GAAG,gBAAgB,AAAnB,CAAoB;IAFlC,cAAc;QAJ1B,qBAAqB;QACrB,gBAAgB;QAChB,QAAQ;QACR,QAAQ;OACI,cAAc,CAkW1B;IAAD,qBAAC;CAAA,AAlWD,CAAuC,KAAK,CAAC,aAAa,GAkWzD;SAlWY,cAAc","sourcesContent":["import type { AriaAttributes, HTMLAttributes } from 'react';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { GlobalObject } from '../../lib/globalObject.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport type { Input, InputIconType, ShowClearIcon } from '../../components/Input/index.js';\nimport type { Menu } from '../Menu/index.js';\nimport type { InputLikeText } from '../InputLikeText/index.js';\nimport type { MenuItemState } from '../../components/MenuItem/index.js';\nimport { CancelationError, taskWithDelay } from '../../lib/utils.js';\nimport type { CommonProps } from '../CommonWrapper/index.js';\nimport { CommonWrapper } from '../CommonWrapper/index.js';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport type { ComboBoxExtendedItem, ComboBoxViewMode } from '../../components/ComboBox/index.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport type { MaskedInputOnBeforePasteValue, MaskedInputProps } from '../../components/MaskedInput/index.js';\nimport type { InternalTextareaWithLayout } from '../InternalTextareaWithLayout/InternalTextareaWithLayout.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\n\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes.js';\nimport type { CustomComboBoxAction, CustomComboBoxEffect } from './CustomComboBoxReducer.js';\nimport { reducer } from './CustomComboBoxReducer.js';\nimport { ComboBoxView } from './ComboBoxView.js';\n\nexport * from './tids.js';\n\nexport interface CustomComboBoxProps<T>\n extends Pick<AriaAttributes, 'aria-describedby' | 'aria-label'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'>,\n CommonProps,\n Partial<Pick<MaskedInputProps, 'mask' | 'maskChar' | 'formatChars'>> {\n align?: 'left' | 'center' | 'right';\n autoFocus?: boolean;\n borderless?: boolean;\n disablePortal?: boolean;\n disabled?: boolean;\n /**\n * Cостояние валидации при ошибке.\n */\n error?: boolean;\n maxLength?: number;\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n menuAlign?: 'left' | 'right';\n drawArrow?: boolean;\n leftIcon?: InputIconType;\n rightIcon?: InputIconType;\n searchOnFocus?: boolean;\n onValueChange?: (value: T) => void;\n onInputValueChange?: (value: string) => Nullable<string> | void;\n onUnexpectedInput?: (value: string) => void | null | T;\n onFocus?: () => void;\n onBlur?: () => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n onInputKeyDown?: (e: React.KeyboardEvent<HTMLElement>) => void;\n placeholder?: string;\n size?: SizeProp;\n totalCount?: number;\n value?: Nullable<T>;\n showClearIcon?: ShowClearIcon;\n /**\n * Cостояние валидации при предупреждении.\n */\n warning?: boolean;\n width?: string | number;\n maxMenuHeight?: number | string;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderItem: (item: T, state?: MenuItemState) => React.ReactNode;\n itemWrapper?: (item: T) => React.ComponentType;\n renderValue: (value: T) => React.ReactNode;\n renderAddButton?: (query?: string) => React.ReactNode;\n valueToString: (value: T) => string;\n itemToId: (item: T) => string | number;\n getItems: (query: string) => Promise<Array<ComboBoxExtendedItem<T>>>;\n inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];\n onBeforePasteInMask?: MaskedInputOnBeforePasteValue;\n viewMode?: ComboBoxViewMode;\n maxRows?: number;\n}\n\nexport interface CustomComboBoxState<T> {\n editing: boolean;\n loading: boolean;\n opened: boolean;\n textValue: string;\n items: Nullable<Array<ComboBoxExtendedItem<T>>>;\n inputChanged: boolean;\n focused: boolean;\n repeatRequest: () => void;\n requestStatus: ComboBoxRequestStatus;\n}\n\nexport const DELAY_BEFORE_SHOW_LOADER = 300;\nexport const LOADER_SHOW_TIME = 1000;\n\nexport const DefaultState = {\n inputChanged: false,\n editing: false,\n items: null,\n loading: false,\n opened: false,\n focused: false,\n textValue: '',\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n};\n\n@withRenderEnvironment\n@responsiveLayout\n@rootNode\n@withSize\nexport class CustomComboBox<T> extends React.PureComponent<CustomComboBoxProps<T>, CustomComboBoxState<T>> {\n public static __KONTUR_REACT_UI__ = 'CustomComboBox';\n public static displayName = 'CustomComboBox';\n\n public state: CustomComboBoxState<T> = DefaultState;\n public input: Nullable<Input | InternalTextareaWithLayout>;\n public menu: Nullable<Menu>;\n public inputLikeText: Nullable<InputLikeText>;\n public requestId = 0;\n public loaderShowDelay: Nullable<Promise<void>>;\n private globalObject!: GlobalObject;\n private focused = false;\n private cancelationToken: Nullable<(reason?: Error) => void> = null;\n private isMobileLayout!: boolean;\n private canOpenPopup = true;\n\n private reducer = reducer;\n public cancelLoaderDelay: () => void = () => null;\n\n /**\n * @public\n */\n public focus = (opts?: { withoutOpenDropdown?: boolean }) => {\n if (this.props.disabled) {\n return;\n }\n\n if (opts?.withoutOpenDropdown) {\n this.canOpenPopup = false;\n }\n\n if (this.input) {\n this.input.focus();\n } else if (this.inputLikeText) {\n this.inputLikeText.focus();\n }\n };\n\n /**\n * @public\n */\n public selectInputText = () => {\n if (this.props.disabled) {\n return;\n }\n if (this.input) {\n this.input.selectAll();\n }\n };\n\n /**\n * @public\n */\n public blur = (): void => {\n if (this.props.disabled) {\n return;\n }\n\n this.handleBlur();\n };\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private size!: SizeProp;\n\n /**\n * @public\n */\n public async search(query: string = this.state.textValue) {\n const { getItems } = this.props;\n\n const cancelPromise: Promise<never> = new Promise((_, reject) => (this.cancelationToken = reject));\n this.requestId += 1;\n const expectingId = this.requestId;\n\n if (!this.loaderShowDelay) {\n this.loaderShowDelay = new Promise<void>((resolve) => {\n const cancelLoader = taskWithDelay(() => {\n this.dispatch({ type: 'RequestItems' });\n setTimeout(resolve, LOADER_SHOW_TIME);\n }, DELAY_BEFORE_SHOW_LOADER);\n\n cancelPromise.catch(() => cancelLoader());\n\n this.cancelLoaderDelay = () => {\n cancelLoader();\n resolve();\n };\n });\n }\n\n try {\n const items = await Promise.race([getItems(query), cancelPromise]);\n if (this.state.loading) {\n await Promise.race([this.loaderShowDelay, cancelPromise]);\n }\n if (expectingId === this.requestId) {\n this.dispatch({\n type: 'ReceiveItems',\n items,\n });\n }\n } catch (error) {\n if (error && error.code === 'CancelationError') {\n this.dispatch({ type: 'CancelRequest' });\n } else if (expectingId === this.requestId) {\n this.dispatch({\n type: 'RequestFailure',\n repeatRequest: () => {\n this.search(query);\n if (this.input) {\n this.input.focus();\n }\n },\n });\n }\n } finally {\n if (expectingId === this.requestId) {\n if (!this.state.loading) {\n this.cancelLoaderDelay();\n }\n this.cancelationToken = null;\n this.loaderShowDelay = null;\n }\n }\n }\n\n /**\n * @public\n */\n public cancelSearch() {\n if (this.cancelationToken) {\n this.cancelationToken(new CancelationError());\n }\n }\n\n /**\n * @public\n */\n public open(): void {\n this.dispatch({ type: 'Open' });\n }\n\n /**\n * @public\n */\n public close(): void {\n this.dispatch({ type: 'Close' });\n }\n\n public render() {\n const viewProps = {\n align: this.props.align,\n borderless: this.props.borderless,\n disabled: this.props.disabled,\n disablePortal: this.props.disablePortal,\n editing: this.state.editing,\n error: this.props.error,\n items: this.state.items,\n loading: this.state.loading,\n opened: this.state.opened,\n drawArrow: this.props.drawArrow,\n menuPos: this.props.menuPos,\n menuAlign: this.props.menuAlign,\n placeholder: this.props.placeholder,\n size: this.size,\n textValue: this.state.textValue,\n totalCount: this.props.totalCount,\n value: this.props.value,\n showClearIcon: this.props.showClearIcon,\n warning: this.props.warning,\n 'aria-describedby': this.props['aria-describedby'],\n 'aria-label': this.props['aria-label'],\n id: this.props.id,\n width: this.props.width,\n maxLength: this.props.maxLength,\n maxMenuHeight: this.props.maxMenuHeight,\n leftIcon: this.props.leftIcon,\n rightIcon: this.props.rightIcon,\n inputMode: this.props.inputMode,\n mask: this.props.mask,\n maskChar: this.props.maskChar,\n formatChars: this.props.formatChars,\n onBeforePasteInMask: this.props.onBeforePasteInMask,\n\n onValueChange: this.handleValueChange,\n onClickOutside: this.handleClickOutside,\n onFocus: this.handleFocus,\n onMobileClose: this.handleMobileClose,\n onFocusOutside: this.handleBlur,\n onInputBlur: this.handleInputBlur,\n onInputValueChange: (value: string) => this.dispatch({ type: 'TextChange', value }),\n onInputFocus: this.handleFocus,\n onInputClick: this.handleInputClick,\n onClearCrossClick: () => this.dispatch({ type: 'ClearCrossClick' }),\n onInputKeyDown: (event: React.KeyboardEvent) => {\n event.persist();\n this.dispatch({ type: 'KeyPress', event });\n },\n onMouseEnter: this.props.onMouseEnter,\n onMouseOver: this.props.onMouseOver,\n onMouseLeave: this.props.onMouseLeave,\n renderItem: this.props.renderItem,\n renderNotFound: this.props.renderNotFound,\n itemWrapper: this.props.itemWrapper,\n renderValue: this.props.renderValue,\n renderTotalCount: this.props.renderTotalCount,\n renderAddButton: this.props.renderAddButton,\n repeatRequest: this.state.repeatRequest,\n requestStatus: this.state.requestStatus,\n\n refInput: (input: Nullable<Input | InternalTextareaWithLayout>) => {\n this.input = input;\n },\n refMenu: (menu: Nullable<Menu>) => {\n this.menu = menu;\n },\n refInputLikeText: (inputLikeText: Nullable<InputLikeText>) => {\n this.inputLikeText = inputLikeText;\n },\n viewMode: this.props.viewMode,\n maxRows: this.props.maxRows,\n };\n\n return (\n <CommonWrapper {...this.props}>\n <ComboBoxView {...viewProps} size={this.props.size} ref={this.setRootNode} />\n </CommonWrapper>\n );\n }\n\n public componentDidMount() {\n this.dispatch({ type: 'Mount' }, false);\n if (this.props.autoFocus) {\n this.focus();\n }\n }\n\n public componentDidUpdate(prevProps: CustomComboBoxProps<T>, prevState: CustomComboBoxState<T>) {\n if (prevState.editing && !this.state.editing) {\n this.handleBlur();\n }\n this.dispatch(\n {\n type: 'DidUpdate',\n prevProps,\n prevState,\n },\n false,\n );\n }\n\n /**\n * @public\n */\n public reset(): void {\n this.dispatch({ type: 'Reset' });\n }\n\n private dispatch = (action: CustomComboBoxAction<T>, sync = true) => {\n const updateState = (action: CustomComboBoxAction<T>) => {\n let effects: Array<CustomComboBoxEffect<T>>;\n let nextState: Pick<CustomComboBoxState<T>, never>;\n\n this.setState(\n (state) => {\n const stateAndEffect = this.reducer(state, this.props, action);\n [nextState, effects] = stateAndEffect instanceof Array ? stateAndEffect : [stateAndEffect, []];\n return nextState;\n },\n () => {\n effects.forEach(this.handleEffect);\n },\n );\n };\n\n // Auto-batching React@18 creates problems that are fixed with flushSync\n // https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366\n if (sync && Number(React.version) >= 18) {\n ReactDOM.flushSync(() => updateState(action));\n } else {\n updateState(action);\n }\n };\n\n private handleEffect = (effect: CustomComboBoxEffect<T>) => {\n effect(this.dispatch, this.getState, this.getProps, () => this, this.globalObject);\n };\n\n private getProps = () => this.props;\n\n private getState = () => this.state;\n\n private handleValueChange = (value: T) => {\n this.dispatch({\n type: 'ValueChange',\n value,\n keepFocus: !this.isMobileLayout,\n });\n };\n\n private handleFocus = () => {\n if (this.focused) {\n return;\n }\n\n this.focused = true;\n this.dispatch({ type: 'Focus', searchOnFocus: this.canOpenPopup && this.props.searchOnFocus });\n\n if (!this.canOpenPopup) {\n this.canOpenPopup = true;\n }\n };\n\n private handleMobileClose = () => {\n this.handleInputBlur();\n };\n\n private handleClickOutside = () => {\n this.handleBlur();\n };\n\n private handleBlur = () => {\n if (!this.focused) {\n if (this.state.opened) {\n this.close();\n }\n return;\n }\n\n this.focused = false;\n // workaround for the similar bug with focusout\n // in Firefox, Chrome and IE\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1363964\n setTimeout(() => {\n this.dispatch({ type: 'Blur' });\n }, 0);\n };\n\n private handleInputBlur = () => {\n // If menu opened, RenderLayer is active and\n // it would call handleFocusOutside\n // In that way handleBlur would be called\n\n if (this.state.opened && !this.isMobileLayout) {\n return;\n }\n this.handleBlur();\n };\n\n private handleInputClick = () => {\n if (!this.cancelationToken) {\n this.dispatch({ type: 'InputClick' });\n }\n };\n}\n"]}
1
+ {"version":3,"file":"CustomComboBox.js","sourceRoot":"","sources":["../../../internal/CustomComboBox/CustomComboBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAQjC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BA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AAK,CAAC,OAAO,EAAE,CAAC;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;QACD,IAAI,CAAC,QAAQ,CACX;YACE,IAAI,EAAE,WAAW;YACjB,SAAS,WAAA;YACT,SAAS,WAAA;SACV,EACD,KAAK,CACN,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,8BAAK,GAAZ;QACE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnC,CAAC;IA/Pa,kCAAmB,GAAG,gBAAgB,AAAnB,CAAoB;IACvC,0BAAW,GAAG,gBAAgB,AAAnB,CAAoB;IAFlC,cAAc;QAJ1B,qBAAqB;QACrB,gBAAgB;QAChB,QAAQ;QACR,QAAQ;OACI,cAAc,CAkW1B;IAAD,qBAAC;CAAA,AAlWD,CAAuC,KAAK,CAAC,aAAa,GAkWzD;SAlWY,cAAc","sourcesContent":["import type { AriaAttributes, HTMLAttributes } from 'react';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { GlobalObject } from '../../lib/globalObject.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport type { Input, InputIconType, ShowClearIcon } from '../../components/Input/index.js';\nimport type { Menu } from '../Menu/index.js';\nimport type { InputLikeText } from '../InputLikeText/index.js';\nimport type { MenuItemState } from '../../components/MenuItem/index.js';\nimport { CancelationError, taskWithDelay } from '../../lib/utils.js';\nimport type { CommonProps } from '../CommonWrapper/index.js';\nimport { CommonWrapper } from '../CommonWrapper/index.js';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport type { ComboBoxExtendedItem, ComboBoxViewMode } from '../../components/ComboBox/index.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport type { MaskedInputOnBeforePasteValue, MaskedInputProps } from '../../components/MaskedInput/index.js';\nimport type { InternalTextareaWithLayout } from '../InternalTextareaWithLayout/InternalTextareaWithLayout.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport { REACT_MAJOR_VERSION } from '../../lib/react-is.js';\n\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes.js';\nimport type { CustomComboBoxAction, CustomComboBoxEffect } from './CustomComboBoxReducer.js';\nimport { reducer } from './CustomComboBoxReducer.js';\nimport { ComboBoxView } from './ComboBoxView.js';\n\nexport * from './tids.js';\n\nexport interface CustomComboBoxProps<T>\n extends Pick<AriaAttributes, 'aria-describedby' | 'aria-label'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'>,\n CommonProps,\n Partial<Pick<MaskedInputProps, 'mask' | 'maskChar' | 'formatChars'>> {\n align?: 'left' | 'center' | 'right';\n autoFocus?: boolean;\n borderless?: boolean;\n disablePortal?: boolean;\n disabled?: boolean;\n /**\n * Cостояние валидации при ошибке.\n */\n error?: boolean;\n maxLength?: number;\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n menuAlign?: 'left' | 'right';\n drawArrow?: boolean;\n leftIcon?: InputIconType;\n rightIcon?: InputIconType;\n searchOnFocus?: boolean;\n onValueChange?: (value: T) => void;\n onInputValueChange?: (value: string) => Nullable<string> | void;\n onUnexpectedInput?: (value: string) => void | null | T;\n onFocus?: () => void;\n onBlur?: () => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n onInputKeyDown?: (e: React.KeyboardEvent<HTMLElement>) => void;\n placeholder?: string;\n size?: SizeProp;\n totalCount?: number;\n value?: Nullable<T>;\n showClearIcon?: ShowClearIcon;\n /**\n * Cостояние валидации при предупреждении.\n */\n warning?: boolean;\n width?: string | number;\n maxMenuHeight?: number | string;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderItem: (item: T, state?: MenuItemState) => React.ReactNode;\n itemWrapper?: (item: T) => React.ComponentType;\n renderValue: (value: T) => React.ReactNode;\n renderAddButton?: (query?: string) => React.ReactNode;\n valueToString: (value: T) => string;\n itemToId: (item: T) => string | number;\n getItems: (query: string) => Promise<Array<ComboBoxExtendedItem<T>>>;\n inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];\n onBeforePasteInMask?: MaskedInputOnBeforePasteValue;\n viewMode?: ComboBoxViewMode;\n maxRows?: number;\n}\n\nexport interface CustomComboBoxState<T> {\n editing: boolean;\n loading: boolean;\n opened: boolean;\n textValue: string;\n items: Nullable<Array<ComboBoxExtendedItem<T>>>;\n inputChanged: boolean;\n focused: boolean;\n repeatRequest: () => void;\n requestStatus: ComboBoxRequestStatus;\n}\n\nexport const DELAY_BEFORE_SHOW_LOADER = 300;\nexport const LOADER_SHOW_TIME = 1000;\n\nexport const DefaultState = {\n inputChanged: false,\n editing: false,\n items: null,\n loading: false,\n opened: false,\n focused: false,\n textValue: '',\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n};\n\n@withRenderEnvironment\n@responsiveLayout\n@rootNode\n@withSize\nexport class CustomComboBox<T> extends React.PureComponent<CustomComboBoxProps<T>, CustomComboBoxState<T>> {\n public static __KONTUR_REACT_UI__ = 'CustomComboBox';\n public static displayName = 'CustomComboBox';\n\n public state: CustomComboBoxState<T> = DefaultState;\n public input: Nullable<Input | InternalTextareaWithLayout>;\n public menu: Nullable<Menu>;\n public inputLikeText: Nullable<InputLikeText>;\n public requestId = 0;\n public loaderShowDelay: Nullable<Promise<void>>;\n private globalObject!: GlobalObject;\n private focused = false;\n private cancelationToken: Nullable<(reason?: Error) => void> = null;\n private isMobileLayout!: boolean;\n private canOpenPopup = true;\n\n private reducer = reducer;\n public cancelLoaderDelay: () => void = () => null;\n\n /**\n * @public\n */\n public focus = (opts?: { withoutOpenDropdown?: boolean }) => {\n if (this.props.disabled) {\n return;\n }\n\n if (opts?.withoutOpenDropdown) {\n this.canOpenPopup = false;\n }\n\n if (this.input) {\n this.input.focus();\n } else if (this.inputLikeText) {\n this.inputLikeText.focus();\n }\n };\n\n /**\n * @public\n */\n public selectInputText = () => {\n if (this.props.disabled) {\n return;\n }\n if (this.input) {\n this.input.selectAll();\n }\n };\n\n /**\n * @public\n */\n public blur = (): void => {\n if (this.props.disabled) {\n return;\n }\n\n this.handleBlur();\n };\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private size!: SizeProp;\n\n /**\n * @public\n */\n public async search(query: string = this.state.textValue) {\n const { getItems } = this.props;\n\n const cancelPromise: Promise<never> = new Promise((_, reject) => (this.cancelationToken = reject));\n this.requestId += 1;\n const expectingId = this.requestId;\n\n if (!this.loaderShowDelay) {\n this.loaderShowDelay = new Promise<void>((resolve) => {\n const cancelLoader = taskWithDelay(() => {\n this.dispatch({ type: 'RequestItems' });\n setTimeout(resolve, LOADER_SHOW_TIME);\n }, DELAY_BEFORE_SHOW_LOADER);\n\n cancelPromise.catch(() => cancelLoader());\n\n this.cancelLoaderDelay = () => {\n cancelLoader();\n resolve();\n };\n });\n }\n\n try {\n const items = await Promise.race([getItems(query), cancelPromise]);\n if (this.state.loading) {\n await Promise.race([this.loaderShowDelay, cancelPromise]);\n }\n if (expectingId === this.requestId) {\n this.dispatch({\n type: 'ReceiveItems',\n items,\n });\n }\n } catch (error) {\n if (error && error.code === 'CancelationError') {\n this.dispatch({ type: 'CancelRequest' });\n } else if (expectingId === this.requestId) {\n this.dispatch({\n type: 'RequestFailure',\n repeatRequest: () => {\n this.search(query);\n if (this.input) {\n this.input.focus();\n }\n },\n });\n }\n } finally {\n if (expectingId === this.requestId) {\n if (!this.state.loading) {\n this.cancelLoaderDelay();\n }\n this.cancelationToken = null;\n this.loaderShowDelay = null;\n }\n }\n }\n\n /**\n * @public\n */\n public cancelSearch() {\n if (this.cancelationToken) {\n this.cancelationToken(new CancelationError());\n }\n }\n\n /**\n * @public\n */\n public open(): void {\n this.dispatch({ type: 'Open' });\n }\n\n /**\n * @public\n */\n public close(): void {\n this.dispatch({ type: 'Close' });\n }\n\n public render() {\n const viewProps = {\n align: this.props.align,\n borderless: this.props.borderless,\n disabled: this.props.disabled,\n disablePortal: this.props.disablePortal,\n editing: this.state.editing,\n error: this.props.error,\n items: this.state.items,\n loading: this.state.loading,\n opened: this.state.opened,\n drawArrow: this.props.drawArrow,\n menuPos: this.props.menuPos,\n menuAlign: this.props.menuAlign,\n placeholder: this.props.placeholder,\n size: this.size,\n textValue: this.state.textValue,\n totalCount: this.props.totalCount,\n value: this.props.value,\n showClearIcon: this.props.showClearIcon,\n warning: this.props.warning,\n 'aria-describedby': this.props['aria-describedby'],\n 'aria-label': this.props['aria-label'],\n id: this.props.id,\n width: this.props.width,\n maxLength: this.props.maxLength,\n maxMenuHeight: this.props.maxMenuHeight,\n leftIcon: this.props.leftIcon,\n rightIcon: this.props.rightIcon,\n inputMode: this.props.inputMode,\n mask: this.props.mask,\n maskChar: this.props.maskChar,\n formatChars: this.props.formatChars,\n onBeforePasteInMask: this.props.onBeforePasteInMask,\n\n onValueChange: this.handleValueChange,\n onClickOutside: this.handleClickOutside,\n onFocus: this.handleFocus,\n onMobileClose: this.handleMobileClose,\n onFocusOutside: this.handleBlur,\n onInputBlur: this.handleInputBlur,\n onInputValueChange: (value: string) => this.dispatch({ type: 'TextChange', value }),\n onInputFocus: this.handleFocus,\n onInputClick: this.handleInputClick,\n onClearCrossClick: () => this.dispatch({ type: 'ClearCrossClick' }),\n onInputKeyDown: (event: React.KeyboardEvent) => {\n event.persist();\n this.dispatch({ type: 'KeyPress', event });\n },\n onMouseEnter: this.props.onMouseEnter,\n onMouseOver: this.props.onMouseOver,\n onMouseLeave: this.props.onMouseLeave,\n renderItem: this.props.renderItem,\n renderNotFound: this.props.renderNotFound,\n itemWrapper: this.props.itemWrapper,\n renderValue: this.props.renderValue,\n renderTotalCount: this.props.renderTotalCount,\n renderAddButton: this.props.renderAddButton,\n repeatRequest: this.state.repeatRequest,\n requestStatus: this.state.requestStatus,\n\n refInput: (input: Nullable<Input | InternalTextareaWithLayout>) => {\n this.input = input;\n },\n refMenu: (menu: Nullable<Menu>) => {\n this.menu = menu;\n },\n refInputLikeText: (inputLikeText: Nullable<InputLikeText>) => {\n this.inputLikeText = inputLikeText;\n },\n viewMode: this.props.viewMode,\n maxRows: this.props.maxRows,\n };\n\n return (\n <CommonWrapper {...this.props}>\n <ComboBoxView {...viewProps} size={this.props.size} ref={this.setRootNode} />\n </CommonWrapper>\n );\n }\n\n public componentDidMount() {\n this.dispatch({ type: 'Mount' }, false);\n if (this.props.autoFocus) {\n this.focus();\n }\n }\n\n public componentDidUpdate(prevProps: CustomComboBoxProps<T>, prevState: CustomComboBoxState<T>) {\n if (prevState.editing && !this.state.editing) {\n this.handleBlur();\n }\n this.dispatch(\n {\n type: 'DidUpdate',\n prevProps,\n prevState,\n },\n false,\n );\n }\n\n /**\n * @public\n */\n public reset(): void {\n this.dispatch({ type: 'Reset' });\n }\n\n private dispatch = (action: CustomComboBoxAction<T>, sync = true) => {\n const updateState = (action: CustomComboBoxAction<T>) => {\n let effects: Array<CustomComboBoxEffect<T>>;\n let nextState: Pick<CustomComboBoxState<T>, never>;\n\n this.setState(\n (state) => {\n const stateAndEffect = this.reducer(state, this.props, action);\n [nextState, effects] = stateAndEffect instanceof Array ? stateAndEffect : [stateAndEffect, []];\n return nextState;\n },\n () => {\n effects.forEach(this.handleEffect);\n },\n );\n };\n\n // Auto-batching React@18 creates problems that are fixed with flushSync\n // https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366\n if (sync && REACT_MAJOR_VERSION >= 18) {\n ReactDOM.flushSync(() => updateState(action));\n } else {\n updateState(action);\n }\n };\n\n private handleEffect = (effect: CustomComboBoxEffect<T>) => {\n effect(this.dispatch, this.getState, this.getProps, () => this, this.globalObject);\n };\n\n private getProps = () => this.props;\n\n private getState = () => this.state;\n\n private handleValueChange = (value: T) => {\n this.dispatch({\n type: 'ValueChange',\n value,\n keepFocus: !this.isMobileLayout,\n });\n };\n\n private handleFocus = () => {\n if (this.focused) {\n return;\n }\n\n this.focused = true;\n this.dispatch({ type: 'Focus', searchOnFocus: this.canOpenPopup && this.props.searchOnFocus });\n\n if (!this.canOpenPopup) {\n this.canOpenPopup = true;\n }\n };\n\n private handleMobileClose = () => {\n this.handleInputBlur();\n };\n\n private handleClickOutside = () => {\n this.handleBlur();\n };\n\n private handleBlur = () => {\n if (!this.focused) {\n if (this.state.opened) {\n this.close();\n }\n return;\n }\n\n this.focused = false;\n // workaround for the similar bug with focusout\n // in Firefox, Chrome and IE\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1363964\n setTimeout(() => {\n this.dispatch({ type: 'Blur' });\n }, 0);\n };\n\n private handleInputBlur = () => {\n // If menu opened, RenderLayer is active and\n // it would call handleFocusOutside\n // In that way handleBlur would be called\n\n if (this.state.opened && !this.isMobileLayout) {\n return;\n }\n this.handleBlur();\n };\n\n private handleInputClick = () => {\n if (!this.cancelationToken) {\n this.dispatch({ type: 'InputClick' });\n }\n };\n}\n"]}
@@ -61,6 +61,7 @@ import { ClearCrossIcon } from '../ClearCrossIcon/ClearCrossIcon.js';
61
61
  import { blink } from '../../lib/blink.js';
62
62
  import { withSize } from '../../lib/size/SizeDecorator.js';
63
63
  import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
64
+ import { REACT_MAJOR_VERSION } from '../../lib/react-is.js';
64
65
  import { getStyles } from './InputLikeText.styles.js';
65
66
  export var InputLikeTextDataTids = {
66
67
  root: 'InputLikeText__root',
@@ -190,7 +191,7 @@ var InputLikeText = /** @class */ (function (_super) {
190
191
  }
191
192
  // Auto-batching React@18 creates problems that are fixed with flushSync
192
193
  // https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366
193
- if (Number(React.version) >= 18) {
194
+ if (REACT_MAJOR_VERSION >= 18) {
194
195
  ReactDOM.flushSync(function () { return _this.setState({ focused: true }); });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CACL,oBAAC,aAAa,aAAC,WAAW,EAAE,KAAI,CAAC,WAAW,IAAM,KAAI,CAAC,QAAQ,EAAE,GAC9D,KAAI,CAAC,UAAU,CACF,CACjB,CAAC;QACJ,CAAC,CACqB,CACzB,CAAC;IACJ,CAAC;;IAjHa,iCAAmB,GAAG,eAAe,AAAlB,CAAmB;IACtC,yBAAW,GAAG,eAAe,AAAlB,CAAmB;IAE9B,0BAAY,GAAiB;QACzC,aAAa,EAAE,OAAO;KACvB,AAFyB,CAExB;IANS,aAAa;QAHzB,qBAAqB;QACrB,QAAQ;QACR,QAAQ;OACI,aAAa,CAgWzB;IAAD,oBAAC;CAAA,AAhWD,CAAmC,KAAK,CAAC,SAAS,GAgWjD;SAhWY,aAAa","sourcesContent":["import React, { type JSX } from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash.debounce';\nimport type { Emotion } from '@emotion/css/create-instance';\n\nimport type { GlobalObject } from '../../lib/globalObject.js';\nimport { isNonNullable } from '../../lib/utils.js';\nimport type { MouseDragEventHandler } from '../../lib/events/MouseDrag.js';\nimport { MouseDrag } from '../../lib/events/MouseDrag.js';\nimport { isMobile } from '../../lib/client.js';\nimport { removeAllSelections, selectNodeContents } from '../../lib/dom/selectionHelpers.js';\nimport type { InputProps, InputState } from '../../components/Input/index.js';\nimport { calculateClearCrossShowedState, InputDataTids } from '../../components/Input/index.js';\nimport { getStyles as getJsInputStyles } from '../../components/Input/Input.styles.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport type { CommonProps, CommonWrapperRestProps } from '../CommonWrapper/index.js';\nimport { CommonWrapper } from '../CommonWrapper/index.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport { InputLayoutAside } from '../../components/Input/InputLayout/InputLayoutAside.js';\nimport {\n InputLayoutContext,\n InputLayoutContextDefault,\n} from '../../components/Input/InputLayout/InputLayoutContext.js';\nimport { FocusControlWrapper } from '../FocusControlWrapper/index.js';\nimport { ClearCrossIcon } from '../ClearCrossIcon/ClearCrossIcon.js';\nimport { blink } from '../../lib/blink.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\n\nimport { getStyles } from './InputLikeText.styles.js';\n\nexport interface InputLikeTextProps extends CommonProps, InputProps {\n children?: React.ReactNode;\n innerRef?: (el: HTMLElement | null) => void;\n onFocus?: React.FocusEventHandler<HTMLElement>;\n onBlur?: React.FocusEventHandler<HTMLElement>;\n onMouseDragStart?: MouseDragEventHandler;\n onMouseDragEnd?: MouseDragEventHandler;\n takeContentWidth?: boolean;\n onClearCrossClick?: () => void;\n}\n\nexport type InputLikeTextState = Omit<InputState, 'needsPolyfillPlaceholder' | 'hovered'>;\n\nexport const InputLikeTextDataTids = {\n root: 'InputLikeText__root',\n input: 'InputLikeText__input',\n nativeInput: 'InputLikeText__nativeInput',\n} as const;\n\ntype DefaultProps = Required<Pick<InputLikeTextProps, 'showClearIcon'>>;\n\n@withRenderEnvironment\n@withSize\n@rootNode\nexport class InputLikeText extends React.Component<InputLikeTextProps, InputLikeTextState> {\n public static __KONTUR_REACT_UI__ = 'InputLikeText';\n public static displayName = 'InputLikeText';\n\n public static defaultProps: DefaultProps = {\n showClearIcon: 'never',\n };\n\n private getProps = createPropsGetter(InputLikeText.defaultProps);\n\n private getClearCrossShowed = ({ focused, hovered }: { focused?: boolean; hovered?: boolean }): boolean => {\n if (this.props.disabled) {\n return false;\n }\n return calculateClearCrossShowedState({\n showClearIcon: this.getProps().showClearIcon,\n notEmptyValue: Boolean(this.props.children),\n focused,\n hovered,\n });\n };\n\n public state = {\n focused: false,\n clearCrossShowed: this.getClearCrossShowed({\n focused: false,\n }),\n };\n\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private jsInputStyles!: ReturnType<typeof getJsInputStyles>;\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n private size!: SizeProp;\n private node: HTMLElement | null = null;\n private dragging = false;\n\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n /**\n * @public\n */\n public focus(): void {\n if (this.node) {\n this.node.focus();\n }\n }\n\n /**\n * @public\n */\n public blur(): void {\n if (this.node) {\n this.node.blur();\n }\n }\n\n /**\n * @public\n */\n public blink() {\n if (this.props.disabled) {\n return;\n }\n blink({\n el: this.node,\n blinkColor: this.theme.inputBlinkColor,\n });\n }\n\n public getNode(): HTMLElement | null {\n return this.node;\n }\n\n // Async call required for Firefox\n private selectNodeContentsDebounced = debounce(selectNodeContents, 0);\n\n public selectInnerNode = (node: HTMLElement | null, start = 0, end = 1) => {\n if (this.dragging || !node) {\n return;\n }\n\n this.selectNodeContentsDebounced(node, start, end);\n };\n\n public componentDidMount() {\n if (this.node) {\n MouseDrag.listen(this.node).onMouseDragStart(this.handleMouseDragStart).onMouseDragEnd(this.handleMouseDragEnd);\n }\n }\n\n public componentWillUnmount() {\n MouseDrag.stop(this.node);\n }\n\n public render() {\n this.jsInputStyles = getJsInputStyles(this.emotion);\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.getProps()}>\n {this.renderMain}\n </CommonWrapper>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain = (props: CommonWrapperRestProps<InputLikeTextProps>) => {\n const {\n innerRef,\n tabIndex,\n placeholder,\n align,\n borderless,\n width,\n error,\n warning,\n onValueChange,\n disabled,\n prefix,\n suffix,\n leftIcon,\n rightIcon,\n value,\n onMouseDragStart,\n onMouseDragEnd,\n takeContentWidth,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n showClearIcon,\n onClearCrossClick,\n ...rest\n } = props;\n\n const { focused } = this.state;\n const getRightIcon = () => {\n return this.state.clearCrossShowed ? (\n <ClearCrossIcon\n data-tid={InputDataTids.clearCross}\n size={this.size}\n onFocus={(event) => event.stopPropagation()}\n onClick={onClearCrossClick}\n />\n ) : (\n rightIcon\n );\n };\n const leftSide = <InputLayoutAside icon={leftIcon} text={prefix} side=\"left\" />;\n const rightSide = <InputLayoutAside icon={getRightIcon()} text={suffix} side=\"right\" />;\n\n const className = this.cx(this.styles.root(), this.jsInputStyles.root(this.theme), this.getSizeClassName(), {\n [this.jsInputStyles.disabled(this.theme)]: !!disabled,\n [this.jsInputStyles.borderless()]: !!borderless,\n [this.jsInputStyles.focus(this.theme)]: focused,\n [this.jsInputStyles.hovering(this.theme)]: !focused && !disabled && !warning && !error && !borderless,\n [this.jsInputStyles.warning(this.theme)]: !!warning,\n [this.jsInputStyles.error(this.theme)]: !!error,\n [this.jsInputStyles.hideBlinkingCursor()]: isMobile,\n });\n\n const wrapperClass = this.cx(this.jsInputStyles.wrapper(), {\n [this.styles.userSelectContain()]: focused,\n });\n const size = this.size;\n const context = InputLayoutContextDefault;\n Object.assign(context, { disabled, focused, size });\n\n return (\n <FocusControlWrapper disabled={disabled} onBlurWhenDisabled={this.resetFocus}>\n <span\n data-tid={InputLikeTextDataTids.root}\n {...rest}\n className={className}\n style={{ width, textAlign: align }}\n tabIndex={disabled ? -1 : 0}\n onFocus={this.handleFocus}\n onMouseEnter={this.handleHover}\n onMouseLeave={this.handleUnhover}\n onBlur={this.handleBlur}\n ref={this.innerRef}\n onKeyDown={this.handleKeyDown}\n role=\"textbox\"\n aria-disabled={disabled}\n aria-describedby={ariaDescribedby}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n <InputLayoutContext.Provider value={context}>\n <input type=\"hidden\" data-tid={InputLikeTextDataTids.nativeInput} value={value} disabled={disabled} />\n {leftSide}\n <span className={wrapperClass}>\n <span\n data-tid={InputLikeTextDataTids.input}\n className={this.cx(this.jsInputStyles.input(this.theme), {\n [this.styles.absolute()]: !takeContentWidth,\n [this.jsInputStyles.inputFocus(this.theme)]: focused,\n [this.jsInputStyles.inputDisabled(this.theme)]: disabled,\n })}\n >\n {this.props.children}\n </span>\n {this.renderPlaceholder()}\n </span>\n {rightSide}\n </InputLayoutContext.Provider>\n </span>\n </FocusControlWrapper>\n );\n };\n\n private renderPlaceholder = (): JSX.Element | null => {\n const { children, placeholder, disabled } = this.props;\n const { focused } = this.state;\n const hasValue = isNonNullable(children) && children !== '';\n\n if (!hasValue && placeholder) {\n return (\n <span\n className={this.cx(this.jsInputStyles.placeholder(this.theme), {\n [this.jsInputStyles.placeholderDisabled(this.theme)]: disabled,\n [this.jsInputStyles.placeholderFocus(this.theme)]: focused,\n })}\n >\n {placeholder}\n </span>\n );\n }\n return null;\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (this.props.disabled) {\n return;\n }\n\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e as React.KeyboardEvent<HTMLInputElement>);\n }\n };\n\n private handleMouseDragStart: MouseDragEventHandler = (e) => {\n this.dragging = true;\n this.globalObject.document?.documentElement.classList.add(this.styles.userSelectNone());\n\n if (this.props.onMouseDragStart) {\n this.props.onMouseDragStart(e);\n }\n };\n\n private handleMouseDragEnd: MouseDragEventHandler = (e) => {\n // Дожидаемся onMouseUp\n setTimeout(() => {\n this.dragging = false;\n\n if (this.props.onMouseDragEnd) {\n this.props.onMouseDragEnd(e);\n }\n }, 0);\n\n this.globalObject.document?.documentElement.classList.remove(this.styles.userSelectNone());\n };\n\n private handleFocus = (e: React.FocusEvent<HTMLElement>) => {\n if (isMobile) {\n this.node?.setAttribute('contenteditable', 'true');\n }\n\n if (this.props.disabled) {\n return;\n }\n\n // Auto-batching React@18 creates problems that are fixed with flushSync\n // https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366\n if (Number(React.version) >= 18) {\n ReactDOM.flushSync(() => this.setState({ focused: true }));\n } else {\n this.setState({ focused: true });\n }\n\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n };\n\n private resetFocus = () => {\n this.selectNodeContentsDebounced.cancel();\n if (isMobile) {\n this.node?.removeAttribute('contenteditable');\n }\n removeAllSelections(this.globalObject);\n this.setState({ focused: false });\n };\n\n private handleBlur = (e: React.FocusEvent<HTMLElement>) => {\n this.selectNodeContentsDebounced.cancel();\n if (isMobile) {\n this.node?.removeAttribute('contenteditable');\n }\n\n if (this.props.disabled) {\n e.stopPropagation();\n return;\n }\n\n removeAllSelections(this.globalObject);\n this.setState({ focused: false });\n\n this.props.onBlur?.(e);\n };\n\n private handleHover = () => {\n this.setState({ clearCrossShowed: this.getClearCrossShowed({ focused: this.state.focused, hovered: true }) });\n };\n\n private handleUnhover = () => {\n this.setState({ clearCrossShowed: this.getClearCrossShowed({ focused: this.state.focused, hovered: false }) });\n };\n\n private innerRef = (el: HTMLElement | null) => {\n if (this.props.innerRef) {\n this.props.innerRef(el);\n }\n this.node = el;\n };\n\n private getSizeClassName = () => {\n switch (this.size) {\n case 'large':\n return this.cx({\n [this.jsInputStyles.sizeLarge(this.theme)]: true,\n });\n case 'medium':\n return this.cx({\n [this.jsInputStyles.sizeMedium(this.theme)]: true,\n });\n case 'small':\n default:\n return this.cx({\n [this.jsInputStyles.sizeSmall(this.theme)]: true,\n });\n }\n };\n}\n"]}
1
+ {"version":3,"file":"InputLikeText.js","sourceRoot":"","sources":["../../../internal/InputLikeText/InputLikeText.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAIvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,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;OACI,aAAa,CAgWzB;IAAD,oBAAC;CAAA,AAhWD,CAAmC,KAAK,CAAC,SAAS,GAgWjD;SAhWY,aAAa","sourcesContent":["import React, { type JSX } from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash.debounce';\nimport type { Emotion } from '@emotion/css/create-instance';\n\nimport type { GlobalObject } from '../../lib/globalObject.js';\nimport { isNonNullable } from '../../lib/utils.js';\nimport type { MouseDragEventHandler } from '../../lib/events/MouseDrag.js';\nimport { MouseDrag } from '../../lib/events/MouseDrag.js';\nimport { isMobile } from '../../lib/client.js';\nimport { removeAllSelections, selectNodeContents } from '../../lib/dom/selectionHelpers.js';\nimport type { InputProps, InputState } from '../../components/Input/index.js';\nimport { calculateClearCrossShowedState, InputDataTids } from '../../components/Input/index.js';\nimport { getStyles as getJsInputStyles } from '../../components/Input/Input.styles.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport type { CommonProps, CommonWrapperRestProps } from '../CommonWrapper/index.js';\nimport { CommonWrapper } from '../CommonWrapper/index.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport { InputLayoutAside } from '../../components/Input/InputLayout/InputLayoutAside.js';\nimport {\n InputLayoutContext,\n InputLayoutContextDefault,\n} from '../../components/Input/InputLayout/InputLayoutContext.js';\nimport { FocusControlWrapper } from '../FocusControlWrapper/index.js';\nimport { ClearCrossIcon } from '../ClearCrossIcon/ClearCrossIcon.js';\nimport { blink } from '../../lib/blink.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport { REACT_MAJOR_VERSION } from '../../lib/react-is.js';\n\nimport { getStyles } from './InputLikeText.styles.js';\n\nexport interface InputLikeTextProps extends CommonProps, InputProps {\n children?: React.ReactNode;\n innerRef?: (el: HTMLElement | null) => void;\n onFocus?: React.FocusEventHandler<HTMLElement>;\n onBlur?: React.FocusEventHandler<HTMLElement>;\n onMouseDragStart?: MouseDragEventHandler;\n onMouseDragEnd?: MouseDragEventHandler;\n takeContentWidth?: boolean;\n onClearCrossClick?: () => void;\n}\n\nexport type InputLikeTextState = Omit<InputState, 'needsPolyfillPlaceholder' | 'hovered'>;\n\nexport const InputLikeTextDataTids = {\n root: 'InputLikeText__root',\n input: 'InputLikeText__input',\n nativeInput: 'InputLikeText__nativeInput',\n} as const;\n\ntype DefaultProps = Required<Pick<InputLikeTextProps, 'showClearIcon'>>;\n\n@withRenderEnvironment\n@withSize\n@rootNode\nexport class InputLikeText extends React.Component<InputLikeTextProps, InputLikeTextState> {\n public static __KONTUR_REACT_UI__ = 'InputLikeText';\n public static displayName = 'InputLikeText';\n\n public static defaultProps: DefaultProps = {\n showClearIcon: 'never',\n };\n\n private getProps = createPropsGetter(InputLikeText.defaultProps);\n\n private getClearCrossShowed = ({ focused, hovered }: { focused?: boolean; hovered?: boolean }): boolean => {\n if (this.props.disabled) {\n return false;\n }\n return calculateClearCrossShowedState({\n showClearIcon: this.getProps().showClearIcon,\n notEmptyValue: Boolean(this.props.children),\n focused,\n hovered,\n });\n };\n\n public state = {\n focused: false,\n clearCrossShowed: this.getClearCrossShowed({\n focused: false,\n }),\n };\n\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private jsInputStyles!: ReturnType<typeof getJsInputStyles>;\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n private size!: SizeProp;\n private node: HTMLElement | null = null;\n private dragging = false;\n\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n /**\n * @public\n */\n public focus(): void {\n if (this.node) {\n this.node.focus();\n }\n }\n\n /**\n * @public\n */\n public blur(): void {\n if (this.node) {\n this.node.blur();\n }\n }\n\n /**\n * @public\n */\n public blink() {\n if (this.props.disabled) {\n return;\n }\n blink({\n el: this.node,\n blinkColor: this.theme.inputBlinkColor,\n });\n }\n\n public getNode(): HTMLElement | null {\n return this.node;\n }\n\n // Async call required for Firefox\n private selectNodeContentsDebounced = debounce(selectNodeContents, 0);\n\n public selectInnerNode = (node: HTMLElement | null, start = 0, end = 1) => {\n if (this.dragging || !node) {\n return;\n }\n\n this.selectNodeContentsDebounced(node, start, end);\n };\n\n public componentDidMount() {\n if (this.node) {\n MouseDrag.listen(this.node).onMouseDragStart(this.handleMouseDragStart).onMouseDragEnd(this.handleMouseDragEnd);\n }\n }\n\n public componentWillUnmount() {\n MouseDrag.stop(this.node);\n }\n\n public render() {\n this.jsInputStyles = getJsInputStyles(this.emotion);\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.getProps()}>\n {this.renderMain}\n </CommonWrapper>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain = (props: CommonWrapperRestProps<InputLikeTextProps>) => {\n const {\n innerRef,\n tabIndex,\n placeholder,\n align,\n borderless,\n width,\n error,\n warning,\n onValueChange,\n disabled,\n prefix,\n suffix,\n leftIcon,\n rightIcon,\n value,\n onMouseDragStart,\n onMouseDragEnd,\n takeContentWidth,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n showClearIcon,\n onClearCrossClick,\n ...rest\n } = props;\n\n const { focused } = this.state;\n const getRightIcon = () => {\n return this.state.clearCrossShowed ? (\n <ClearCrossIcon\n data-tid={InputDataTids.clearCross}\n size={this.size}\n onFocus={(event) => event.stopPropagation()}\n onClick={onClearCrossClick}\n />\n ) : (\n rightIcon\n );\n };\n const leftSide = <InputLayoutAside icon={leftIcon} text={prefix} side=\"left\" />;\n const rightSide = <InputLayoutAside icon={getRightIcon()} text={suffix} side=\"right\" />;\n\n const className = this.cx(this.styles.root(), this.jsInputStyles.root(this.theme), this.getSizeClassName(), {\n [this.jsInputStyles.disabled(this.theme)]: !!disabled,\n [this.jsInputStyles.borderless()]: !!borderless,\n [this.jsInputStyles.focus(this.theme)]: focused,\n [this.jsInputStyles.hovering(this.theme)]: !focused && !disabled && !warning && !error && !borderless,\n [this.jsInputStyles.warning(this.theme)]: !!warning,\n [this.jsInputStyles.error(this.theme)]: !!error,\n [this.jsInputStyles.hideBlinkingCursor()]: isMobile,\n });\n\n const wrapperClass = this.cx(this.jsInputStyles.wrapper(), {\n [this.styles.userSelectContain()]: focused,\n });\n const size = this.size;\n const context = InputLayoutContextDefault;\n Object.assign(context, { disabled, focused, size });\n\n return (\n <FocusControlWrapper disabled={disabled} onBlurWhenDisabled={this.resetFocus}>\n <span\n data-tid={InputLikeTextDataTids.root}\n {...rest}\n className={className}\n style={{ width, textAlign: align }}\n tabIndex={disabled ? -1 : 0}\n onFocus={this.handleFocus}\n onMouseEnter={this.handleHover}\n onMouseLeave={this.handleUnhover}\n onBlur={this.handleBlur}\n ref={this.innerRef}\n onKeyDown={this.handleKeyDown}\n role=\"textbox\"\n aria-disabled={disabled}\n aria-describedby={ariaDescribedby}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n <InputLayoutContext.Provider value={context}>\n <input type=\"hidden\" data-tid={InputLikeTextDataTids.nativeInput} value={value} disabled={disabled} />\n {leftSide}\n <span className={wrapperClass}>\n <span\n data-tid={InputLikeTextDataTids.input}\n className={this.cx(this.jsInputStyles.input(this.theme), {\n [this.styles.absolute()]: !takeContentWidth,\n [this.jsInputStyles.inputFocus(this.theme)]: focused,\n [this.jsInputStyles.inputDisabled(this.theme)]: disabled,\n })}\n >\n {this.props.children}\n </span>\n {this.renderPlaceholder()}\n </span>\n {rightSide}\n </InputLayoutContext.Provider>\n </span>\n </FocusControlWrapper>\n );\n };\n\n private renderPlaceholder = (): JSX.Element | null => {\n const { children, placeholder, disabled } = this.props;\n const { focused } = this.state;\n const hasValue = isNonNullable(children) && children !== '';\n\n if (!hasValue && placeholder) {\n return (\n <span\n className={this.cx(this.jsInputStyles.placeholder(this.theme), {\n [this.jsInputStyles.placeholderDisabled(this.theme)]: disabled,\n [this.jsInputStyles.placeholderFocus(this.theme)]: focused,\n })}\n >\n {placeholder}\n </span>\n );\n }\n return null;\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (this.props.disabled) {\n return;\n }\n\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e as React.KeyboardEvent<HTMLInputElement>);\n }\n };\n\n private handleMouseDragStart: MouseDragEventHandler = (e) => {\n this.dragging = true;\n this.globalObject.document?.documentElement.classList.add(this.styles.userSelectNone());\n\n if (this.props.onMouseDragStart) {\n this.props.onMouseDragStart(e);\n }\n };\n\n private handleMouseDragEnd: MouseDragEventHandler = (e) => {\n // Дожидаемся onMouseUp\n setTimeout(() => {\n this.dragging = false;\n\n if (this.props.onMouseDragEnd) {\n this.props.onMouseDragEnd(e);\n }\n }, 0);\n\n this.globalObject.document?.documentElement.classList.remove(this.styles.userSelectNone());\n };\n\n private handleFocus = (e: React.FocusEvent<HTMLElement>) => {\n if (isMobile) {\n this.node?.setAttribute('contenteditable', 'true');\n }\n\n if (this.props.disabled) {\n return;\n }\n\n // Auto-batching React@18 creates problems that are fixed with flushSync\n // https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366\n if (REACT_MAJOR_VERSION >= 18) {\n ReactDOM.flushSync(() => this.setState({ focused: true }));\n } else {\n this.setState({ focused: true });\n }\n\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n };\n\n private resetFocus = () => {\n this.selectNodeContentsDebounced.cancel();\n if (isMobile) {\n this.node?.removeAttribute('contenteditable');\n }\n removeAllSelections(this.globalObject);\n this.setState({ focused: false });\n };\n\n private handleBlur = (e: React.FocusEvent<HTMLElement>) => {\n this.selectNodeContentsDebounced.cancel();\n if (isMobile) {\n this.node?.removeAttribute('contenteditable');\n }\n\n if (this.props.disabled) {\n e.stopPropagation();\n return;\n }\n\n removeAllSelections(this.globalObject);\n this.setState({ focused: false });\n\n this.props.onBlur?.(e);\n };\n\n private handleHover = () => {\n this.setState({ clearCrossShowed: this.getClearCrossShowed({ focused: this.state.focused, hovered: true }) });\n };\n\n private handleUnhover = () => {\n this.setState({ clearCrossShowed: this.getClearCrossShowed({ focused: this.state.focused, hovered: false }) });\n };\n\n private innerRef = (el: HTMLElement | null) => {\n if (this.props.innerRef) {\n this.props.innerRef(el);\n }\n this.node = el;\n };\n\n private getSizeClassName = () => {\n switch (this.size) {\n case 'large':\n return this.cx({\n [this.jsInputStyles.sizeLarge(this.theme)]: true,\n });\n case 'medium':\n return this.cx({\n [this.jsInputStyles.sizeMedium(this.theme)]: true,\n });\n case 'small':\n default:\n return this.cx({\n [this.jsInputStyles.sizeSmall(this.theme)]: true,\n });\n }\n };\n}\n"]}
@@ -1,6 +1,5 @@
1
- import type { Ref } from 'react';
2
- import React from 'react';
1
+ import type { ReactElement, Ref } from 'react';
3
2
  /**
4
3
  * Получает ссылку на элемент, учитывая разные версии React
5
4
  */
6
- export declare function getElementRef(element: React.ReactElement): Ref<unknown>;
5
+ export declare function getElementRef(element: ReactElement): Ref<unknown>;
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import { REACT_MAJOR_VERSION } from './react-is.js';
2
2
  /**
3
3
  * Получает ссылку на элемент, учитывая разные версии React
4
4
  */
5
5
  export function getElementRef(element) {
6
- if (Number(React.version) >= 19 && element.props && typeof element.props === 'object' && 'ref' in element.props) {
6
+ if (REACT_MAJOR_VERSION >= 19 && element.props && typeof element.props === 'object' && 'ref' in element.props) {
7
7
  return element.props.ref;
8
8
  }
9
9
  return element.ref;
@@ -1 +1 @@
1
- {"version":3,"file":"getElementRef.js","sourceRoot":"","sources":["../../lib/getElementRef.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAA2B;IACvD,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAChH,OAAO,OAAO,CAAC,KAAK,CAAC,GAAmB,CAAC;IAC3C,CAAC;IACD,OAAQ,OAAe,CAAC,GAAG,CAAC;AAC9B,CAAC","sourcesContent":["import type { Ref } from 'react';\nimport React from 'react';\n\n/**\n * Получает ссылку на элемент, учитывая разные версии React\n */\nexport function getElementRef(element: React.ReactElement): Ref<unknown> {\n if (Number(React.version) >= 19 && element.props && typeof element.props === 'object' && 'ref' in element.props) {\n return element.props.ref as Ref<unknown>;\n }\n return (element as any).ref;\n}\n"]}
1
+ {"version":3,"file":"getElementRef.js","sourceRoot":"","sources":["../../lib/getElementRef.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAqB;IACjD,IAAI,mBAAmB,IAAI,EAAE,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAC9G,OAAO,OAAO,CAAC,KAAK,CAAC,GAAmB,CAAC;IAC3C,CAAC;IACD,OAAQ,OAAe,CAAC,GAAG,CAAC;AAC9B,CAAC","sourcesContent":["import type { ReactElement, Ref } from 'react';\n\nimport { REACT_MAJOR_VERSION } from './react-is.js';\n\n/**\n * Получает ссылку на элемент, учитывая разные версии React\n */\nexport function getElementRef(element: ReactElement): Ref<unknown> {\n if (REACT_MAJOR_VERSION >= 19 && element.props && typeof element.props === 'object' && 'ref' in element.props) {\n return element.props.ref as Ref<unknown>;\n }\n return (element as any).ref;\n}\n"]}
package/lib/react-is.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { ComponentType, ElementType, ForwardRefExoticComponent, MemoExoticComponent, ReactElement } from 'react';
2
+ export declare const REACT_MAJOR_VERSION: number;
2
3
  export declare const IS_REACT_19: boolean;
3
4
  export declare const IS_REACT_20: boolean;
4
5
  export declare const ForwardRef: symbol;
package/lib/react-is.js CHANGED
@@ -1,10 +1,12 @@
1
+ var _a;
1
2
  import React from 'react';
2
3
  import warning from 'warning';
3
4
  // This code supports React <= 18 and React 19. Ported from production builds:
4
5
  // - https://app.unpkg.com/react-is@19.0.0/files/cjs/react-is.production.js
5
6
  // - https://app.unpkg.com/react-is@18.3.1/files/cjs/react-is.production.min.js
6
- export var IS_REACT_19 = /* @__PURE__ */ React.version.startsWith('19');
7
- export var IS_REACT_20 = /* @__PURE__ */ React.version.startsWith('20');
7
+ export var REACT_MAJOR_VERSION = /* @__PURE__ */ parseInt((_a = React.version.split('.')[0]) !== null && _a !== void 0 ? _a : '', 10) || 0;
8
+ export var IS_REACT_19 = REACT_MAJOR_VERSION === 19;
9
+ export var IS_REACT_20 = REACT_MAJOR_VERSION === 20;
8
10
  if (IS_REACT_20) {
9
11
  warning(false, 'React 20 detected. You must check and update this code for React 20 support. ' +
10
12
  'Check changes and add new warning for future React 21 here: ' +
@@ -1 +1 @@
1
- {"version":3,"file":"react-is.js","sourceRoot":"","sources":["../../lib/react-is.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,8EAA8E;AAC9E,2EAA2E;AAC3E,+EAA+E;AAE/E,MAAM,CAAC,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1E,MAAM,CAAC,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAE1E,IAAI,WAAW,EAAE,CAAC;IAChB,OAAO,CACL,KAAK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ticComponent, ReactElement } from 'react';\nimport React from 'react';\nimport warning from 'warning';\n\n// This code supports React <= 18 and React 19. Ported from production builds:\n// - https://app.unpkg.com/react-is@19.0.0/files/cjs/react-is.production.js\n// - https://app.unpkg.com/react-is@18.3.1/files/cjs/react-is.production.min.js\n\nexport const IS_REACT_19 = /* @__PURE__ */ React.version.startsWith('19');\nexport const IS_REACT_20 = /* @__PURE__ */ React.version.startsWith('20');\n\nif (IS_REACT_20) {\n warning(\n false,\n 'React 20 detected. You must check and update this code for React 20 support. ' +\n 'Check changes and add new warning for future React 21 here: ' +\n 'https://github.com/facebook/react/commits/main/packages/react-is',\n );\n}\n\nconst REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(IS_REACT_19 ? 'react.transitional.element' : 'react.element');\nconst REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal');\nconst REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment');\nconst REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode');\nconst REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler');\nconst REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for('react.consumer');\nconst REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context');\nconst REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref');\nconst REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense');\nconst REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for('react.suspense_list');\nconst REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for('react.memo');\nconst REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for('react.lazy');\nconst REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for('react.offscreen');\nconst REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for('react.client.reference');\n\nexport const ForwardRef = REACT_FORWARD_REF_TYPE;\nexport const Memo = REACT_MEMO_TYPE;\n\nexport function isValidElementType(type: unknown): type is ElementType {\n return typeof type === 'string' ||\n typeof type === 'function' ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_OFFSCREEN_TYPE ||\n (typeof type === 'object' &&\n type !== null &&\n '$$typeof' in type &&\n type !== null &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE ||\n (typeof type === 'object' && type !== null && 'getModuleId' in type && type.getModuleId !== undefined)))\n ? !0\n : !1;\n}\n\nfunction typeOf(object: unknown): symbol | undefined {\n if (typeof object === 'object' && object !== null && '$$typeof' in object) {\n const $$typeof = object.$$typeof;\n\n if ($$typeof === REACT_ELEMENT_TYPE) {\n if ('type' in object) {\n const type = object.type;\n\n if (\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE\n ) {\n return type;\n }\n\n if (type !== null && typeof type === 'object' && '$$typeof' in type) {\n const inner$$typeof = type.$$typeof;\n if (\n inner$$typeof === REACT_CONTEXT_TYPE ||\n inner$$typeof === REACT_FORWARD_REF_TYPE ||\n inner$$typeof === REACT_LAZY_TYPE ||\n inner$$typeof === REACT_MEMO_TYPE ||\n inner$$typeof === REACT_CONSUMER_TYPE\n ) {\n return inner$$typeof;\n }\n }\n }\n\n return $$typeof;\n }\n\n if ($$typeof === REACT_PORTAL_TYPE) {\n return $$typeof;\n }\n }\n\n return undefined;\n}\n\nexport function isMemo(object: unknown): object is MemoExoticComponent<ComponentType<typeof object>> {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\n\nexport function isForwardRef(object: unknown): object is ForwardRefExoticComponent<ComponentType<typeof object>> {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\n\nexport function isElement(object: unknown): object is ReactElement {\n return (\n typeof object === 'object' && object !== null && '$$typeof' in object && object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\n"]}
1
+ {"version":3,"file":"react-is.js","sourceRoot":"","sources":["../../lib/react-is.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,8EAA8E;AAC9E,2EAA2E;AAC3E,+EAA+E;AAE/E,MAAM,CAAC,IAAM,mBAAmB,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AACxG,MAAM,CAAC,IAAM,WAAW,GAAG,mBAAmB,KAAK,EAAE,CAAC;AACtD,MAAM,CAAC,IAAM,WAAW,GAAG,mBAAmB,KAAK,EAAE,CAAC;AAEtD,IAAI,WAAW,EAAE,CAAC;IAChB,OAAO,CACL,KAAK,EACL,+EAA+E;QAC7E,8DAA8D;QAC9D,kEAAkE,CACrE,CAAC;AACJ,CAAC;AAED,IAAM,kBAAkB,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;AACpH,IAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACrE,IAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AACzE,IAAM,sBAAsB,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG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C,IACE,aAAa,KAAK,kBAAkB;wBACpC,aAAa,KAAK,sBAAsB;wBACxC,aAAa,KAAK,eAAe;wBACjC,aAAa,KAAK,eAAe;wBACjC,aAAa,KAAK,mBAAmB,EACrC,CAAC;wBACD,OAAO,aAAa,CAAC;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,IAAI,QAAQ,KAAK,iBAAiB,EAAE,CAAC;YACnC,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,eAAe,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAe;IAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,sBAAsB,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,UAAU,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,kBAAkB,CAChH,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentType, ElementType, ForwardRefExoticComponent, MemoExoticComponent, ReactElement } from 'react';\nimport React from 'react';\nimport warning from 'warning';\n\n// This code supports React <= 18 and React 19. Ported from production builds:\n// - https://app.unpkg.com/react-is@19.0.0/files/cjs/react-is.production.js\n// - https://app.unpkg.com/react-is@18.3.1/files/cjs/react-is.production.min.js\n\nexport const REACT_MAJOR_VERSION = /* @__PURE__ */ parseInt(React.version.split('.')[0] ?? '', 10) || 0;\nexport const IS_REACT_19 = REACT_MAJOR_VERSION === 19;\nexport const IS_REACT_20 = REACT_MAJOR_VERSION === 20;\n\nif (IS_REACT_20) {\n warning(\n false,\n 'React 20 detected. You must check and update this code for React 20 support. ' +\n 'Check changes and add new warning for future React 21 here: ' +\n 'https://github.com/facebook/react/commits/main/packages/react-is',\n );\n}\n\nconst REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(IS_REACT_19 ? 'react.transitional.element' : 'react.element');\nconst REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal');\nconst REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment');\nconst REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode');\nconst REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler');\nconst REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for('react.consumer');\nconst REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context');\nconst REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref');\nconst REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense');\nconst REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for('react.suspense_list');\nconst REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for('react.memo');\nconst REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for('react.lazy');\nconst REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for('react.offscreen');\nconst REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for('react.client.reference');\n\nexport const ForwardRef = REACT_FORWARD_REF_TYPE;\nexport const Memo = REACT_MEMO_TYPE;\n\nexport function isValidElementType(type: unknown): type is ElementType {\n return typeof type === 'string' ||\n typeof type === 'function' ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_OFFSCREEN_TYPE ||\n (typeof type === 'object' &&\n type !== null &&\n '$$typeof' in type &&\n type !== null &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE ||\n (typeof type === 'object' && type !== null && 'getModuleId' in type && type.getModuleId !== undefined)))\n ? !0\n : !1;\n}\n\nfunction typeOf(object: unknown): symbol | undefined {\n if (typeof object === 'object' && object !== null && '$$typeof' in object) {\n const $$typeof = object.$$typeof;\n\n if ($$typeof === REACT_ELEMENT_TYPE) {\n if ('type' in object) {\n const type = object.type;\n\n if (\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE\n ) {\n return type;\n }\n\n if (type !== null && typeof type === 'object' && '$$typeof' in type) {\n const inner$$typeof = type.$$typeof;\n if (\n inner$$typeof === REACT_CONTEXT_TYPE ||\n inner$$typeof === REACT_FORWARD_REF_TYPE ||\n inner$$typeof === REACT_LAZY_TYPE ||\n inner$$typeof === REACT_MEMO_TYPE ||\n inner$$typeof === REACT_CONSUMER_TYPE\n ) {\n return inner$$typeof;\n }\n }\n }\n\n return $$typeof;\n }\n\n if ($$typeof === REACT_PORTAL_TYPE) {\n return $$typeof;\n }\n }\n\n return undefined;\n}\n\nexport function isMemo(object: unknown): object is MemoExoticComponent<ComponentType<typeof object>> {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\n\nexport function isForwardRef(object: unknown): object is ForwardRefExoticComponent<ComponentType<typeof object>> {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\n\nexport function isElement(object: unknown): object is ReactElement {\n return (\n typeof object === 'object' && object !== null && '$$typeof' in object && object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/react-ui",
3
- "version": "6.0.2-19ca1.0",
3
+ "version": "6.0.2",
4
4
  "description": "UI Components",
5
5
  "sideEffects": false,
6
6
  "homepage": "https://tech.skbkontur.ru/kontur-ui",