@skbkontur/react-ui 5.4.0 → 5.4.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 +24 -0
- package/cjs/components/Autocomplete/Autocomplete.d.ts +10 -2
- package/cjs/components/Autocomplete/Autocomplete.js +18 -2
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Button/Button.d.ts +23 -13
- package/cjs/components/Button/Button.js +13 -3
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/CurrencyInput/CurrencyInput.d.ts +11 -22
- package/cjs/components/CurrencyInput/CurrencyInput.js +10 -17
- package/cjs/components/CurrencyInput/CurrencyInput.js.map +1 -1
- package/cjs/components/FxInput/FxInput.d.ts +23 -16
- package/cjs/components/FxInput/FxInput.js +142 -65
- package/cjs/components/FxInput/FxInput.js.map +1 -1
- package/cjs/components/Input/Input.d.ts +27 -37
- package/cjs/components/Input/Input.js +9 -19
- package/cjs/components/Input/Input.js.map +1 -1
- package/cjs/components/Link/Link.d.ts +10 -10
- package/cjs/components/Link/Link.js +1 -1
- package/cjs/components/Link/Link.js.map +1 -1
- package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.d.ts +1 -0
- package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.js +107 -78
- package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.js.map +1 -1
- package/cjs/components/MaskedInput/MaskedInput.js +5 -3
- package/cjs/components/MaskedInput/MaskedInput.js.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.d.ts +5 -6
- package/cjs/components/PasswordInput/PasswordInput.js +4 -5
- package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
- package/cjs/components/__stories__/Form.js +95 -0
- package/cjs/components/__stories__/Form.js.map +1 -0
- package/cjs/internal/CommonWrapper/types.d.ts +1 -1
- package/cjs/internal/CommonWrapper/types.js.map +1 -1
- package/cjs/lib/featureFlagsContext/FeatureFlagsHelpers.d.ts +1 -0
- package/cjs/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +1 -0
- package/cjs/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js +2 -0
- package/cjs/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
- package/cjs/lib/utils.d.ts +5 -1
- package/cjs/lib/utils.js +20 -4
- package/cjs/lib/utils.js.map +1 -1
- package/cjs/test-setup.d.ts +1 -0
- package/cjs/vitest.config.d.ts +2 -0
- package/components/Autocomplete/Autocomplete/Autocomplete.js +10 -2
- package/components/Autocomplete/Autocomplete/Autocomplete.js.map +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +10 -2
- package/components/Button/Button/Button.js +4 -2
- package/components/Button/Button/Button.js.map +1 -1
- package/components/Button/Button.d.ts +23 -13
- package/components/CurrencyInput/CurrencyInput/CurrencyInput.js +6 -17
- package/components/CurrencyInput/CurrencyInput/CurrencyInput.js.map +1 -1
- package/components/CurrencyInput/CurrencyInput.d.ts +11 -22
- package/components/FxInput/FxInput/FxInput.js +122 -71
- package/components/FxInput/FxInput/FxInput.js.map +1 -1
- package/components/FxInput/FxInput.d.ts +23 -16
- package/components/Input/Input/Input.js +8 -16
- package/components/Input/Input/Input.js.map +1 -1
- package/components/Input/Input.d.ts +27 -37
- package/components/Link/Link/Link.js +1 -1
- package/components/Link/Link/Link.js.map +1 -1
- package/components/Link/Link.d.ts +10 -10
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement/ColorableInputElement.js +81 -66
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement/ColorableInputElement.js.map +1 -1
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement.d.ts +1 -0
- package/components/MaskedInput/MaskedInput/MaskedInput.js +4 -2
- package/components/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
- package/components/PasswordInput/PasswordInput/PasswordInput.js +4 -5
- package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
- package/components/PasswordInput/PasswordInput.d.ts +5 -6
- package/components/__stories__/Form/Form.js +98 -0
- package/components/__stories__/Form/Form.js.map +1 -0
- package/components/__stories__/Form/package.json +6 -0
- package/internal/CommonWrapper/types/types.js.map +1 -1
- package/internal/CommonWrapper/types.d.ts +1 -1
- package/lib/featureFlagsContext/FeatureFlagsHelpers.d.ts +1 -0
- package/lib/featureFlagsContext/ReactUIFeatureFlagsContext/ReactUIFeatureFlagsContext.js +1 -0
- package/lib/featureFlagsContext/ReactUIFeatureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
- package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +1 -0
- package/lib/utils/utils.js +18 -2
- package/lib/utils/utils.js.map +1 -1
- package/lib/utils.d.ts +5 -1
- package/package.json +8 -14
- package/test-setup.d.ts +1 -0
- package/vitest.config.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
## [5.4.2](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.4.1...@skbkontur/react-ui@5.4.2) (2025-11-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ComboBox:** downgrade `react-focus-lock` to stable ([91eaf3b](https://github.com/skbkontur/retail-ui/commit/91eaf3b68156b6cda33e3049be5cb0d3ddddeb2a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [5.4.1](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.4.0...@skbkontur/react-ui@5.4.1) (2025-11-01)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **CurrencyInput:** do not warn about null value ([5a2f5bd](https://github.com/skbkontur/retail-ui/commit/5a2f5bd09598e11e4e69dd96eca55dd44c6f78e0))
|
|
23
|
+
* **CurrencyInput:** fix onPaste handler ([a50f7e0](https://github.com/skbkontur/retail-ui/commit/a50f7e0cf859381c0eb54a38fe5aca61a77f5f5d))
|
|
24
|
+
* **FxInput:** add support `mask` & feature flag `fxInputUseMaskedInput` ([f86d3bd](https://github.com/skbkontur/retail-ui/commit/f86d3bde8e205dbea77faee0fd079266af04980f))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [5.4.0](https://github.com/skbkontur/retail-ui/compare/@skbkontur/react-ui@5.3.11...@skbkontur/react-ui@5.4.0) (2025-10-23)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -80,11 +80,19 @@ export declare class Autocomplete extends React.Component<AutocompleteProps, Aut
|
|
|
80
80
|
getRootNode: TGetRootNode;
|
|
81
81
|
private setRootNode;
|
|
82
82
|
/**
|
|
83
|
-
* @public
|
|
83
|
+
* @public focus method
|
|
84
|
+
* @description Focuses the input.
|
|
85
|
+
* @example
|
|
86
|
+
* <Autocomplete ref={autocompleteRef} />
|
|
87
|
+
* <button onClick={() => autocompleteRef.current?.focus()}>Focus</button>
|
|
84
88
|
*/
|
|
85
89
|
focus(): void;
|
|
86
90
|
/**
|
|
87
|
-
* @public
|
|
91
|
+
* @public blur method
|
|
92
|
+
* @description Blurs the input.
|
|
93
|
+
* @example
|
|
94
|
+
* <Autocomplete ref={autocompleteRef} />
|
|
95
|
+
* <button onClick={() => autocompleteRef.current?.blur()}>Blur</button>
|
|
88
96
|
*/
|
|
89
97
|
blur(): void;
|
|
90
98
|
componentDidUpdate(prevProps: AutocompleteProps): void;
|
|
@@ -212,6 +212,14 @@ Autocomplete = exports.Autocomplete = (_dec = (0, _decorators.locale)('Autocompl
|
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
215
223
|
|
|
216
224
|
|
|
217
225
|
|
|
@@ -566,9 +574,17 @@ Autocomplete = exports.Autocomplete = (_dec = (0, _decorators.locale)('Autocompl
|
|
|
566
574
|
refMobilePopup = function (mobilePopup) {
|
|
567
575
|
_this.mobilePopup = mobilePopup;
|
|
568
576
|
};return _this;}(0, _inheritsLoose2.default)(Autocomplete, _React$Component);var _proto = Autocomplete.prototype; /**
|
|
569
|
-
* @public
|
|
577
|
+
* @public focus method
|
|
578
|
+
* @description Focuses the input.
|
|
579
|
+
* @example
|
|
580
|
+
* <Autocomplete ref={autocompleteRef} />
|
|
581
|
+
* <button onClick={() => autocompleteRef.current?.focus()}>Focus</button>
|
|
570
582
|
*/_proto.focus = function focus() {if (this.input) {this.input.focus();}} /**
|
|
571
|
-
* @public
|
|
583
|
+
* @public blur method
|
|
584
|
+
* @description Blurs the input.
|
|
585
|
+
* @example
|
|
586
|
+
* <Autocomplete ref={autocompleteRef} />
|
|
587
|
+
* <button onClick={() => autocompleteRef.current?.blur()}>Blur</button>
|
|
572
588
|
*/;_proto.blur = function blur() {this.handleBlur();};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {if (prevProps.value !== this.props.value) {this.updateItems(this.props.value || '');}};_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ReactUIFeatureFlagsContext.ReactUIFeatureFlagsContext.Consumer, null, function (flags) {_this2.featureFlags = (0, _FeatureFlagsHelpers.getFullReactUIFlagsContext)(flags);return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = (0, _getAutocompleteTheme.getAutocompleteTheme)(theme);return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Provider, { value: _this2.theme }, /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: _this2.setRootNode }, _this2.getProps()), _this2.renderMain));});});};_proto.renderHints = function renderHints() {var items = this.state.items;if (!this.props.value) {return /*#__PURE__*/_react.default.createElement(_MenuMessage.MenuMessage, null, this.locale.enterValue);}if ((items == null ? void 0 : items.length) === 0 && this.props.value) {return /*#__PURE__*/_react.default.createElement(_MenuMessage.MenuMessage, null, this.locale.notFound);}if ((0, _utils.isNullable)(items) && this.props.value) {return /*#__PURE__*/_react.default.createElement(_MenuMessage.MenuMessage, null, this.locale.updateValue);}return null;};_proto.renderMenu = function renderMenu() {var items = this.state.items;var _this$getProps = this.getProps(),menuPos = _this$getProps.menuPos,menuAlign = _this$getProps.menuAlign,menuMaxHeight = _this$getProps.menuMaxHeight,hasShadow = _this$getProps.hasShadow,menuWidth = _this$getProps.menuWidth,width = _this$getProps.width,preventWindowScroll = _this$getProps.preventWindowScroll,disablePortal = _this$getProps.disablePortal;var calculatedMenuWidth = menuWidth ? '100%' : width && (0, _getDOMRect.getDOMRect)(this.rootSpan).width;var menuProps = { ref: this.refMenu, maxHeight: menuMaxHeight, hasShadow: false, hasMargin: false, width: calculatedMenuWidth, preventWindowScroll: preventWindowScroll };if (!items || items.length === 0) {return null;}return /*#__PURE__*/_react.default.createElement(_Popup.Popup, { opened: true, hasShadow: hasShadow, id: this.menuId, priority: _ZIndex.ZIndex.priorities.PopupMenu, "data-tid": AutocompleteDataTids.menu, anchorElement: this.getAnchor(), disablePortal: disablePortal, width: menuWidth, minWidth: menuWidth === undefined ? '100%' : undefined, positions: (0, _getMenuPositions.getMenuPositions)(menuPos, menuAlign), margin: parseInt(this.theme.menuOffsetY) - 1 }, /*#__PURE__*/_react.default.createElement(_Menu.Menu, menuProps, this.getItems()));};_proto.handleMenuItemClick = function handleMenuItemClick(i) {var _this3 = this;return function (event) {return _this3.handleItemClick(event, i);};};_proto.handleItemClick = function handleItemClick(event, index) {if (event.button) {return;}event.preventDefault();this.choose(index);};_proto.choose = function choose(index) {var _this4 = this;if (!this.state.items) {return;}var value = this.state.items[index];this.opened = false;this.setState({ selected: -1, items: null });this.fireChange(value); // NOTE: этот таймаут - костыль. Проблема в старом ReactInputMask, он сеттит пустой value при потере фокуса.
|
|
573
589
|
// Можно будет убрать после полного перехода на MaskedInput
|
|
574
590
|
_globalObject.globalObject.setTimeout(function () {_this4.blur();}, 0);};_proto.updateItems = function updateItems(value) {var _this5 = this;if (!this.opened) {return;}var pattern = value.trim();var source = this.props.source;if (!source) {return;}var promise;this.requestId += 1;var expectingId = this.requestId;if (typeof source === 'function') {promise = source(pattern);} else {promise = match(pattern, source);}promise.then(function (items) {if (_this5.opened && expectingId === _this5.requestId) {_this5.setState({ items: items, selected: -1 });}});};_proto.fireChange = function fireChange(value) {if (this.props.onValueChange) {this.props.onValueChange(value);}};return Autocomplete;}(_react.default.Component), _Autocomplete.__KONTUR_REACT_UI__ = 'Autocomplete', _Autocomplete.displayName = 'Autocomplete', _Autocomplete.defaultProps = { renderItem: renderItem, disablePortal: false, hasShadow: true, menuMaxHeight: 300, preventWindowScroll: true }, _Autocomplete)) || _class) || _class) || _class) || _class);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_globalObject","_MenuMessage","_decorators","_utils","_ThemeContext","_Emotion","_identifiers","_Input","_Menu","_MenuItem","_RenderLayer","_createPropsGetter","_fixClickFocusIE","_CommonWrapper","_MobilePopup","_decorator","_rootNode","_getDOMRect","_Popup","_getMenuPositions","_ZIndex","_MaskedInput","_ReactUIFeatureFlagsContext","_FeatureFlagsHelpers","_SizeDecorator","_Autocomplete2","_locale","_getAutocompleteTheme","_excluded","_dec","_class","_Autocomplete","match","pattern","items","Promise","resolve","lowerCasedPattern","toLowerCase","itemsMatchingPattern","filter","item","includes","renderItem","AutocompleteDataTids","exports","root","menu","AutocompleteIds","Autocomplete","locale","AutocompleteLocaleHelper","responsiveLayout","rootNode","withSize","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","state","selected","focused","isMobileOpened","opened","input","menuId","getRandomID","requestId","getProps","createPropsGetter","defaultProps","renderMain","props","_cx","isMobile","isMobileLayout","onValueChange","onKeyDown","onFocus","onBlur","_renderItem","disablePortal","hasShadow","menuAlign","menuMaxHeight","preventWindowScroll","source","menuPos","_props$width","width","theme","inputWidth","mobileMenuHeaderText","type","rest","_objectWithoutPropertiesLoose2","default","inputProps","_extends2","autoComplete","handleValueChange","handleKeyDown","handleFocus","ref","refInput","createElement","RenderLayer","onFocusOutside","handleBlur","onClickOutside","handleClickOutside","active","className","cx","styles","noPortal","style","refRootSpan","getInput","renderMobileMenu","renderMenu","featureFlags","autocompleteUseMaskedInput","mask","MaskedInput","getSafeMaskInputType","maskChar","Input","_this$mobilePopup","autoFocus","onKeyPress","handleKeyPressMobile","value","placeholder","enterValue","inputMode","MobilePopup","id","headerChildComponent","caption","onCloseRequest","handleCloseMobile","refMobilePopup","Menu","refMenu","onItemClick","mobilePopup","close","disableScrollContainer","maxHeight","getItems","renderHints","map","i","MenuItem","onClick","handleMenuItemClick","key","size","fireChange","setState","e","_this$mobilePopup2","event","blur","fixClickFocusIE","isKeyEscape","preventDefault","isKeyArrowUp","up","isKeyArrowDown","down","isKeyEnter","enter","getAnchor","getRootNode","el","span","rootSpan","_inheritsLoose2","_proto","prototype","focus","componentDidUpdate","prevProps","updateItems","render","_this2","ReactUIFeatureFlagsContext","Consumer","flags","getFullReactUIFlagsContext","ThemeContext","getAutocompleteTheme","Provider","CommonWrapper","rootNodeRef","setRootNode","MenuMessage","notFound","isNullable","updateValue","_this$getProps","menuWidth","calculatedMenuWidth","getDOMRect","menuProps","hasMargin","Popup","priority","ZIndex","priorities","PopupMenu","anchorElement","minWidth","undefined","positions","getMenuPositions","margin","parseInt","menuOffsetY","_this3","handleItemClick","index","button","choose","_this4","globalObject","setTimeout","_this5","trim","promise","expectingId","then","React","Component","__KONTUR_REACT_UI__","displayName"],"sources":["Autocomplete.tsx"],"sourcesContent":["import type { AriaAttributes, KeyboardEvent } from 'react';\nimport React from 'react';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { MenuMessage } from '../../internal/MenuMessage';\nimport { locale } from '../../lib/locale/decorators';\nimport { getRandomID, isNullable } from '../../lib/utils';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { cx } from '../../lib/theming/Emotion';\nimport { isKeyArrowDown, isKeyArrowUp, isKeyEnter, isKeyEscape } from '../../lib/events/keyboard/identifiers';\nimport type { InputProps } from '../Input';\nimport { Input } from '../Input';\nimport { Menu } from '../../internal/Menu';\nimport { MenuItem } from '../MenuItem';\nimport { RenderLayer } from '../../internal/RenderLayer';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport type { Nullable, Override } from '../../typings/utility-types';\nimport { fixClickFocusIE } from '../../lib/events/fixClickFocusIE';\nimport type { CommonProps, CommonWrapperRestProps } from '../../internal/CommonWrapper';\nimport { CommonWrapper } from '../../internal/CommonWrapper';\nimport { MobilePopup } from '../../internal/MobilePopup';\nimport { responsiveLayout } from '../ResponsiveLayout/decorator';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getRootNode, rootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\nimport type { SizeProp } from '../../lib/types/props';\nimport { Popup } from '../../internal/Popup';\nimport { getMenuPositions } from '../../lib/getMenuPositions';\nimport { ZIndex } from '../../internal/ZIndex';\nimport { getSafeMaskInputType, MaskedInput, type MaskedProps } from '../MaskedInput';\nimport type { ReactUIFeatureFlags } from '../../lib/featureFlagsContext/ReactUIFeatureFlagsContext';\nimport { ReactUIFeatureFlagsContext } from '../../lib/featureFlagsContext/ReactUIFeatureFlagsContext';\nimport { getFullReactUIFlagsContext } from '../../lib/featureFlagsContext/FeatureFlagsHelpers';\nimport { withSize } from '../../lib/size/SizeDecorator';\n\nimport { styles } from './Autocomplete.styles';\nimport type { AutocompleteLocale } from './locale';\nimport { AutocompleteLocaleHelper } from './locale';\nimport { getAutocompleteTheme } from './getAutocompleteTheme';\n\nfunction match(pattern: string, items: string[]) {\n if (!pattern || !items) {\n return Promise.resolve([]);\n }\n\n const lowerCasedPattern = pattern.toLowerCase();\n const itemsMatchingPattern = items.filter((item) => {\n return item.toLowerCase().includes(lowerCasedPattern);\n });\n\n return Promise.resolve(itemsMatchingPattern);\n}\n\nfunction renderItem(item: any) {\n return item;\n}\n\nexport interface AutocompleteProps\n extends CommonProps,\n Pick<AriaAttributes, 'aria-label'>,\n Pick<Partial<MaskedProps>, 'alwaysShowMask' | 'mask' | 'maskChar'>,\n Override<\n Omit<InputProps, 'alwaysShowMask' | 'mask' | 'maskChar'>,\n {\n /** Задает функцию, которая отрисовывает элементы меню. */\n renderItem?: (item: string) => React.ReactNode;\n\n /** Задает промис, который резолвит элементы меню. */\n source?: string[] | ((patter: string) => Promise<string[]>);\n\n /** Отключает использование портала. */\n disablePortal?: boolean;\n\n /** Определяет, нужно ли показывать тень у выпадающего меню. */\n hasShadow?: boolean;\n\n /** Задает выравнивание выпадающего меню. */\n menuAlign?: 'left' | 'right';\n\n /** Задает максимальную высоту выпадающего меню. */\n menuMaxHeight?: number | string;\n\n /** Задает ширину выпадающего меню. */\n menuWidth?: number | string;\n\n /** Отключает скролл окна, когда меню открыто. */\n preventWindowScroll?: boolean;\n\n /** Задает функцию, которая вызывается при изменении value. */\n onValueChange: (value: string) => void;\n\n /** Задает функцию, которая вызывается при потере автокомплитом фокуса. */\n onBlur?: () => void;\n\n /** Задаёт размер инпута. */\n size?: SizeProp;\n\n /** Задает значение автокомплита. */\n value: string;\n\n /** Задает текст заголовка выпадающего меню в мобильной версии. */\n mobileMenuHeaderText?: string;\n }\n > {\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n}\n\nexport interface AutocompleteState {\n items: Nullable<string[]>;\n selected: number;\n focused: boolean;\n isMobileOpened: boolean;\n}\n\nexport const AutocompleteDataTids = {\n root: 'Autocomplete__root',\n menu: 'Autocomplete__menu',\n} as const;\n\nexport const AutocompleteIds = {\n menu: AutocompleteDataTids.menu,\n} as const;\n\ntype DefaultProps = Required<\n Pick<AutocompleteProps, 'renderItem' | 'disablePortal' | 'hasShadow' | 'menuMaxHeight' | 'preventWindowScroll'>\n>;\n\n/**\n * `Autocomplete` — стандартный инпут с подсказками.\n *\n * Подсказки определяются в пропе `source`.\n * Все свойства передаются во внутренний `Input`.\n */\n@responsiveLayout\n@rootNode\n@locale('Autocomplete', AutocompleteLocaleHelper)\n@withSize\nexport class Autocomplete extends React.Component<AutocompleteProps, AutocompleteState> {\n public static __KONTUR_REACT_UI__ = 'Autocomplete';\n public static displayName = 'Autocomplete';\n\n public static defaultProps: DefaultProps = {\n renderItem,\n disablePortal: false,\n hasShadow: true,\n menuMaxHeight: 300,\n preventWindowScroll: true,\n };\n\n public state: AutocompleteState = {\n items: null,\n selected: -1,\n focused: false,\n isMobileOpened: false,\n };\n\n private theme!: Theme;\n private size!: SizeProp;\n private readonly locale!: AutocompleteLocale;\n private isMobileLayout!: boolean;\n private opened = false;\n private input: Nullable<Input> = null;\n private menu: Nullable<Menu>;\n private menuId = AutocompleteIds.menu + getRandomID();\n private rootSpan: Nullable<HTMLSpanElement>;\n private mobilePopup: Nullable<MobilePopup>;\n private featureFlags!: ReactUIFeatureFlags;\n\n private requestId = 0;\n\n private getProps = createPropsGetter(Autocomplete.defaultProps);\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n /**\n * @public\n */\n public focus() {\n if (this.input) {\n this.input.focus();\n }\n }\n\n /**\n * @public\n */\n public blur() {\n this.handleBlur();\n }\n\n public componentDidUpdate(prevProps: AutocompleteProps) {\n if (prevProps.value !== this.props.value) {\n this.updateItems(this.props.value || '');\n }\n }\n\n public render() {\n return (\n <ReactUIFeatureFlagsContext.Consumer>\n {(flags) => {\n this.featureFlags = getFullReactUIFlagsContext(flags);\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = getAutocompleteTheme(theme);\n return (\n <ThemeContext.Provider value={this.theme}>\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.getProps()}>\n {this.renderMain}\n </CommonWrapper>\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }}\n </ReactUIFeatureFlagsContext.Consumer>\n );\n }\n public renderMain = (props: CommonWrapperRestProps<AutocompleteProps>) => {\n const { focused } = this.state;\n\n const isMobile = this.isMobileLayout;\n\n const {\n onValueChange,\n onKeyDown,\n onFocus,\n onBlur,\n renderItem: _renderItem,\n disablePortal,\n hasShadow,\n menuAlign,\n menuMaxHeight,\n preventWindowScroll,\n source,\n menuPos,\n width = this.theme.inputWidth,\n mobileMenuHeaderText,\n type,\n ...rest\n } = props;\n\n const inputProps = {\n ...rest,\n width: '100%',\n autoComplete: 'off',\n 'aria-controls': this.menuId,\n onValueChange: this.handleValueChange,\n onKeyDown: this.handleKeyDown,\n onFocus: this.handleFocus,\n ref: this.refInput,\n };\n\n return (\n <RenderLayer onFocusOutside={this.handleBlur} onClickOutside={this.handleClickOutside} active={focused}>\n <span\n data-tid={AutocompleteDataTids.root}\n className={cx(styles.root(this.theme), {\n [styles.noPortal()]: disablePortal,\n })}\n style={{ width }}\n ref={this.refRootSpan}\n >\n {this.getInput(inputProps)}\n\n {isMobile ? this.renderMobileMenu() : this.renderMenu()}\n </span>\n </RenderLayer>\n );\n };\n\n private renderHints(): React.ReactNode {\n const items = this.state.items;\n\n if (!this.props.value) {\n return <MenuMessage>{this.locale.enterValue}</MenuMessage>;\n }\n\n if (items?.length === 0 && this.props.value) {\n return <MenuMessage>{this.locale.notFound}</MenuMessage>;\n }\n\n if (isNullable(items) && this.props.value) {\n return <MenuMessage>{this.locale.updateValue}</MenuMessage>;\n }\n\n return null;\n }\n\n private renderMenu(): React.ReactNode {\n const items = this.state.items;\n const { menuPos, menuAlign, menuMaxHeight, hasShadow, menuWidth, width, preventWindowScroll, disablePortal } =\n this.getProps();\n const calculatedMenuWidth = menuWidth ? '100%' : width && getDOMRect(this.rootSpan).width;\n const menuProps = {\n ref: this.refMenu,\n maxHeight: menuMaxHeight,\n hasShadow: false,\n hasMargin: false,\n width: calculatedMenuWidth,\n preventWindowScroll,\n };\n if (!items || items.length === 0) {\n return null;\n }\n\n return (\n <Popup\n opened\n hasShadow={hasShadow}\n id={this.menuId}\n priority={ZIndex.priorities.PopupMenu}\n data-tid={AutocompleteDataTids.menu}\n anchorElement={this.getAnchor()}\n disablePortal={disablePortal}\n width={menuWidth}\n minWidth={menuWidth === undefined ? '100%' : undefined}\n positions={getMenuPositions(menuPos, menuAlign)}\n margin={parseInt(this.theme.menuOffsetY) - 1}\n >\n <Menu {...menuProps}>{this.getItems()}</Menu>\n </Popup>\n );\n }\n\n private getInput = (inputProps: InputProps) => {\n return this.featureFlags.autocompleteUseMaskedInput && this.props.mask ? (\n <MaskedInput\n {...inputProps}\n type={getSafeMaskInputType(this.props.type)}\n mask={this.props.mask}\n maskChar={this.props.maskChar}\n />\n ) : (\n <Input {...inputProps} mask={this.props.mask} maskChar={this.props.maskChar} />\n );\n };\n\n private renderMobileMenu = () => {\n const inputProps: InputProps = {\n autoComplete: 'off',\n autoFocus: true,\n width: '100%',\n onValueChange: this.handleValueChange,\n onKeyPress: this.handleKeyPressMobile,\n value: this.props.value,\n placeholder: this.locale.enterValue,\n type: this.props.type,\n inputMode: this.props.inputMode,\n 'aria-label': this.props['aria-label'],\n 'aria-controls': this.menuId,\n };\n\n const items = this.state.items;\n\n return (\n <MobilePopup\n id={this.menuId}\n headerChildComponent={this.getInput(inputProps)}\n caption={this.props.mobileMenuHeaderText}\n opened={this.state.isMobileOpened}\n onCloseRequest={this.handleCloseMobile}\n ref={this.refMobilePopup}\n >\n <Menu ref={this.refMenu} onItemClick={this.mobilePopup?.close} disableScrollContainer maxHeight={'auto'}>\n {items && items.length > 0 && this.getItems()}\n {this.renderHints()}\n </Menu>\n </MobilePopup>\n );\n };\n\n private getItems = () => {\n const items = this.state.items;\n const isMobile = this.isMobileLayout;\n\n return items\n ? items.map((item, i) => {\n return (\n <MenuItem onClick={this.handleMenuItemClick(i)} key={i} isMobile={isMobile} size={this.size}>\n {this.getProps().renderItem(item)}\n </MenuItem>\n );\n })\n : null;\n };\n\n private handleValueChange = (value: string) => {\n this.opened = true;\n\n this.fireChange(value);\n };\n\n private handleCloseMobile = () => {\n this.setState({\n isMobileOpened: false,\n });\n\n this.handleBlur();\n };\n\n private handleKeyPressMobile = (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n this.mobilePopup?.close();\n }\n };\n\n private handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n if (this.isMobileLayout) {\n this.setState({ isMobileOpened: true });\n }\n\n if (this.state.focused) {\n return;\n }\n\n this.setState({ focused: true });\n\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n private handleBlur = () => {\n if (!this.state.focused) {\n return;\n }\n\n this.opened = false;\n this.setState({ items: null, focused: false });\n\n if (this.input) {\n this.input.blur();\n }\n\n if (this.props.onBlur) {\n this.props.onBlur();\n }\n };\n\n private handleClickOutside = (e: Event) => {\n fixClickFocusIE(e);\n this.handleBlur();\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n switch (true) {\n case isKeyEscape(e):\n e.preventDefault();\n this.setState({ items: null });\n return;\n case isKeyArrowUp(e):\n e.preventDefault();\n if (this.menu) {\n this.menu.up();\n }\n return;\n case isKeyArrowDown(e):\n e.preventDefault();\n if (this.menu) {\n this.menu.down();\n }\n return;\n case isKeyEnter(e):\n e.preventDefault(); // To prevent form submission.\n if (this.menu) {\n this.menu.enter(e);\n }\n return;\n }\n };\n\n private handleMenuItemClick(i: number) {\n return (event: React.SyntheticEvent<HTMLElement>) => this.handleItemClick(event, i);\n }\n\n private getAnchor = () => {\n return getRootNode(this);\n };\n\n private handleItemClick(event: React.SyntheticEvent<HTMLElement> | React.MouseEvent<HTMLElement>, index: number) {\n if ((event as React.MouseEvent<HTMLElement>).button) {\n return;\n }\n\n event.preventDefault();\n this.choose(index);\n }\n\n private choose(index: number) {\n if (!this.state.items) {\n return;\n }\n\n const value = this.state.items[index];\n this.opened = false;\n this.setState({\n selected: -1,\n items: null,\n });\n\n this.fireChange(value);\n\n // NOTE: этот таймаут - костыль. Проблема в старом ReactInputMask, он сеттит пустой value при потере фокуса.\n // Можно будет убрать после полного перехода на MaskedInput\n globalObject.setTimeout(() => {\n this.blur();\n }, 0);\n }\n\n private updateItems(value: string) {\n if (!this.opened) {\n return;\n }\n const pattern = value.trim();\n const source = this.props.source;\n\n if (!source) {\n return;\n }\n\n let promise;\n this.requestId += 1;\n const expectingId = this.requestId;\n if (typeof source === 'function') {\n promise = source(pattern);\n } else {\n promise = match(pattern, source);\n }\n promise.then((items) => {\n if (this.opened && expectingId === this.requestId) {\n this.setState({\n items,\n selected: -1,\n });\n }\n });\n }\n\n private fireChange(value: string) {\n if (this.props.onValueChange) {\n this.props.onValueChange(value);\n }\n }\n\n private refInput = (el: Input | null) => {\n this.input = el;\n };\n\n private refMenu = (menu: Menu | null) => {\n this.menu = menu;\n };\n\n private refRootSpan = (span: HTMLSpanElement) => {\n this.rootSpan = span;\n };\n\n private refMobilePopup = (mobilePopup: MobilePopup | null) => {\n this.mobilePopup = mobilePopup;\n };\n}\n"],"mappings":";AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;;AAEA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;;AAEA,IAAAa,gB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J,OAAO,GAAGjJ,MAAM,CAAC5D,OAAO,CAAC,CAC3B,CAAC,MAAM,CACL6M,OAAO,GAAG9M,KAAK,CAACC,OAAO,EAAE4D,MAAM,CAAC,CAClC,CACAiJ,OAAO,CAACE,IAAI,CAAC,UAAC9M,KAAK,EAAK,CACtB,IAAI0M,MAAI,CAACtK,MAAM,IAAIyK,WAAW,KAAKH,MAAI,CAAClK,SAAS,EAAE,CACjDkK,MAAI,CAACrE,QAAQ,CAAC,EACZrI,KAAK,EAALA,KAAK,EACLiC,QAAQ,EAAE,CAAC,CAAC,CACd,CAAC,CAAC,CACJ,CACF,CAAC,CAAC,CACJ,CAAC,CAAAwH,MAAA,CAEOrB,UAAU,GAAlB,SAAAA,WAAmB3B,KAAa,EAAE,CAChC,IAAI,IAAI,CAAC5D,KAAK,CAACI,aAAa,EAAE,CAC5B,IAAI,CAACJ,KAAK,CAACI,aAAa,CAACwD,KAAK,CAAC,CACjC,CACF,CAAC,QAAA1F,YAAA,GA1Z+BgM,cAAK,CAACC,SAAS,GAAAnN,aAAA,CACjCoN,mBAAmB,GAAG,cAAc,EAAApN,aAAA,CACpCqN,WAAW,GAAG,cAAc,EAAArN,aAAA,CAE5B8C,YAAY,GAAiB,EACzClC,UAAU,EAAVA,UAAU,EACV6C,aAAa,EAAE,KAAK,EACpBC,SAAS,EAAE,IAAI,EACfE,aAAa,EAAE,GAAG,EAClBC,mBAAmB,EAAE,IAAI,CAC3B,CAAC,EAAA7D,aAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_globalObject","_MenuMessage","_decorators","_utils","_ThemeContext","_Emotion","_identifiers","_Input","_Menu","_MenuItem","_RenderLayer","_createPropsGetter","_fixClickFocusIE","_CommonWrapper","_MobilePopup","_decorator","_rootNode","_getDOMRect","_Popup","_getMenuPositions","_ZIndex","_MaskedInput","_ReactUIFeatureFlagsContext","_FeatureFlagsHelpers","_SizeDecorator","_Autocomplete2","_locale","_getAutocompleteTheme","_excluded","_dec","_class","_Autocomplete","match","pattern","items","Promise","resolve","lowerCasedPattern","toLowerCase","itemsMatchingPattern","filter","item","includes","renderItem","AutocompleteDataTids","exports","root","menu","AutocompleteIds","Autocomplete","locale","AutocompleteLocaleHelper","responsiveLayout","rootNode","withSize","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","state","selected","focused","isMobileOpened","opened","input","menuId","getRandomID","requestId","getProps","createPropsGetter","defaultProps","renderMain","props","_cx","isMobile","isMobileLayout","onValueChange","onKeyDown","onFocus","onBlur","_renderItem","disablePortal","hasShadow","menuAlign","menuMaxHeight","preventWindowScroll","source","menuPos","_props$width","width","theme","inputWidth","mobileMenuHeaderText","type","rest","_objectWithoutPropertiesLoose2","default","inputProps","_extends2","autoComplete","handleValueChange","handleKeyDown","handleFocus","ref","refInput","createElement","RenderLayer","onFocusOutside","handleBlur","onClickOutside","handleClickOutside","active","className","cx","styles","noPortal","style","refRootSpan","getInput","renderMobileMenu","renderMenu","featureFlags","autocompleteUseMaskedInput","mask","MaskedInput","getSafeMaskInputType","maskChar","Input","_this$mobilePopup","autoFocus","onKeyPress","handleKeyPressMobile","value","placeholder","enterValue","inputMode","MobilePopup","id","headerChildComponent","caption","onCloseRequest","handleCloseMobile","refMobilePopup","Menu","refMenu","onItemClick","mobilePopup","close","disableScrollContainer","maxHeight","getItems","renderHints","map","i","MenuItem","onClick","handleMenuItemClick","key","size","fireChange","setState","e","_this$mobilePopup2","event","blur","fixClickFocusIE","isKeyEscape","preventDefault","isKeyArrowUp","up","isKeyArrowDown","down","isKeyEnter","enter","getAnchor","getRootNode","el","span","rootSpan","_inheritsLoose2","_proto","prototype","focus","componentDidUpdate","prevProps","updateItems","render","_this2","ReactUIFeatureFlagsContext","Consumer","flags","getFullReactUIFlagsContext","ThemeContext","getAutocompleteTheme","Provider","CommonWrapper","rootNodeRef","setRootNode","MenuMessage","notFound","isNullable","updateValue","_this$getProps","menuWidth","calculatedMenuWidth","getDOMRect","menuProps","hasMargin","Popup","priority","ZIndex","priorities","PopupMenu","anchorElement","minWidth","undefined","positions","getMenuPositions","margin","parseInt","menuOffsetY","_this3","handleItemClick","index","button","choose","_this4","globalObject","setTimeout","_this5","trim","promise","expectingId","then","React","Component","__KONTUR_REACT_UI__","displayName"],"sources":["Autocomplete.tsx"],"sourcesContent":["import type { AriaAttributes, KeyboardEvent } from 'react';\nimport React from 'react';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { MenuMessage } from '../../internal/MenuMessage';\nimport { locale } from '../../lib/locale/decorators';\nimport { getRandomID, isNullable } from '../../lib/utils';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { cx } from '../../lib/theming/Emotion';\nimport { isKeyArrowDown, isKeyArrowUp, isKeyEnter, isKeyEscape } from '../../lib/events/keyboard/identifiers';\nimport type { InputProps } from '../Input';\nimport { Input } from '../Input';\nimport { Menu } from '../../internal/Menu';\nimport { MenuItem } from '../MenuItem';\nimport { RenderLayer } from '../../internal/RenderLayer';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport type { Nullable, Override } from '../../typings/utility-types';\nimport { fixClickFocusIE } from '../../lib/events/fixClickFocusIE';\nimport type { CommonProps, CommonWrapperRestProps } from '../../internal/CommonWrapper';\nimport { CommonWrapper } from '../../internal/CommonWrapper';\nimport { MobilePopup } from '../../internal/MobilePopup';\nimport { responsiveLayout } from '../ResponsiveLayout/decorator';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getRootNode, rootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\nimport type { SizeProp } from '../../lib/types/props';\nimport { Popup } from '../../internal/Popup';\nimport { getMenuPositions } from '../../lib/getMenuPositions';\nimport { ZIndex } from '../../internal/ZIndex';\nimport { getSafeMaskInputType, MaskedInput, type MaskedProps } from '../MaskedInput';\nimport type { ReactUIFeatureFlags } from '../../lib/featureFlagsContext/ReactUIFeatureFlagsContext';\nimport { ReactUIFeatureFlagsContext } from '../../lib/featureFlagsContext/ReactUIFeatureFlagsContext';\nimport { getFullReactUIFlagsContext } from '../../lib/featureFlagsContext/FeatureFlagsHelpers';\nimport { withSize } from '../../lib/size/SizeDecorator';\n\nimport { styles } from './Autocomplete.styles';\nimport type { AutocompleteLocale } from './locale';\nimport { AutocompleteLocaleHelper } from './locale';\nimport { getAutocompleteTheme } from './getAutocompleteTheme';\n\nfunction match(pattern: string, items: string[]) {\n if (!pattern || !items) {\n return Promise.resolve([]);\n }\n\n const lowerCasedPattern = pattern.toLowerCase();\n const itemsMatchingPattern = items.filter((item) => {\n return item.toLowerCase().includes(lowerCasedPattern);\n });\n\n return Promise.resolve(itemsMatchingPattern);\n}\n\nfunction renderItem(item: any) {\n return item;\n}\n\nexport interface AutocompleteProps\n extends CommonProps,\n Pick<AriaAttributes, 'aria-label'>,\n Pick<Partial<MaskedProps>, 'alwaysShowMask' | 'mask' | 'maskChar'>,\n Override<\n Omit<InputProps, 'alwaysShowMask' | 'mask' | 'maskChar'>,\n {\n /** Задает функцию, которая отрисовывает элементы меню. */\n renderItem?: (item: string) => React.ReactNode;\n\n /** Задает промис, который резолвит элементы меню. */\n source?: string[] | ((patter: string) => Promise<string[]>);\n\n /** Отключает использование портала. */\n disablePortal?: boolean;\n\n /** Определяет, нужно ли показывать тень у выпадающего меню. */\n hasShadow?: boolean;\n\n /** Задает выравнивание выпадающего меню. */\n menuAlign?: 'left' | 'right';\n\n /** Задает максимальную высоту выпадающего меню. */\n menuMaxHeight?: number | string;\n\n /** Задает ширину выпадающего меню. */\n menuWidth?: number | string;\n\n /** Отключает скролл окна, когда меню открыто. */\n preventWindowScroll?: boolean;\n\n /** Задает функцию, которая вызывается при изменении value. */\n onValueChange: (value: string) => void;\n\n /** Задает функцию, которая вызывается при потере автокомплитом фокуса. */\n onBlur?: () => void;\n\n /** Задаёт размер инпута. */\n size?: SizeProp;\n\n /** Задает значение автокомплита. */\n value: string;\n\n /** Задает текст заголовка выпадающего меню в мобильной версии. */\n mobileMenuHeaderText?: string;\n }\n > {\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n}\n\nexport interface AutocompleteState {\n items: Nullable<string[]>;\n selected: number;\n focused: boolean;\n isMobileOpened: boolean;\n}\n\nexport const AutocompleteDataTids = {\n root: 'Autocomplete__root',\n menu: 'Autocomplete__menu',\n} as const;\n\nexport const AutocompleteIds = {\n menu: AutocompleteDataTids.menu,\n} as const;\n\ntype DefaultProps = Required<\n Pick<AutocompleteProps, 'renderItem' | 'disablePortal' | 'hasShadow' | 'menuMaxHeight' | 'preventWindowScroll'>\n>;\n\n/**\n * `Autocomplete` — стандартный инпут с подсказками.\n *\n * Подсказки определяются в пропе `source`.\n * Все свойства передаются во внутренний `Input`.\n */\n@responsiveLayout\n@rootNode\n@locale('Autocomplete', AutocompleteLocaleHelper)\n@withSize\nexport class Autocomplete extends React.Component<AutocompleteProps, AutocompleteState> {\n public static __KONTUR_REACT_UI__ = 'Autocomplete';\n public static displayName = 'Autocomplete';\n\n public static defaultProps: DefaultProps = {\n renderItem,\n disablePortal: false,\n hasShadow: true,\n menuMaxHeight: 300,\n preventWindowScroll: true,\n };\n\n public state: AutocompleteState = {\n items: null,\n selected: -1,\n focused: false,\n isMobileOpened: false,\n };\n\n private theme!: Theme;\n private size!: SizeProp;\n private readonly locale!: AutocompleteLocale;\n private isMobileLayout!: boolean;\n private opened = false;\n private input: Nullable<Input> = null;\n private menu: Nullable<Menu>;\n private menuId = AutocompleteIds.menu + getRandomID();\n private rootSpan: Nullable<HTMLSpanElement>;\n private mobilePopup: Nullable<MobilePopup>;\n private featureFlags!: ReactUIFeatureFlags;\n\n private requestId = 0;\n\n private getProps = createPropsGetter(Autocomplete.defaultProps);\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n /**\n * @public focus method\n * @description Focuses the input.\n * @example\n * <Autocomplete ref={autocompleteRef} />\n * <button onClick={() => autocompleteRef.current?.focus()}>Focus</button>\n */\n public focus() {\n if (this.input) {\n this.input.focus();\n }\n }\n\n /**\n * @public blur method\n * @description Blurs the input.\n * @example\n * <Autocomplete ref={autocompleteRef} />\n * <button onClick={() => autocompleteRef.current?.blur()}>Blur</button>\n */\n public blur() {\n this.handleBlur();\n }\n\n public componentDidUpdate(prevProps: AutocompleteProps) {\n if (prevProps.value !== this.props.value) {\n this.updateItems(this.props.value || '');\n }\n }\n\n public render() {\n return (\n <ReactUIFeatureFlagsContext.Consumer>\n {(flags) => {\n this.featureFlags = getFullReactUIFlagsContext(flags);\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = getAutocompleteTheme(theme);\n return (\n <ThemeContext.Provider value={this.theme}>\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.getProps()}>\n {this.renderMain}\n </CommonWrapper>\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }}\n </ReactUIFeatureFlagsContext.Consumer>\n );\n }\n public renderMain = (props: CommonWrapperRestProps<AutocompleteProps>) => {\n const { focused } = this.state;\n\n const isMobile = this.isMobileLayout;\n\n const {\n onValueChange,\n onKeyDown,\n onFocus,\n onBlur,\n renderItem: _renderItem,\n disablePortal,\n hasShadow,\n menuAlign,\n menuMaxHeight,\n preventWindowScroll,\n source,\n menuPos,\n width = this.theme.inputWidth,\n mobileMenuHeaderText,\n type,\n ...rest\n } = props;\n\n const inputProps = {\n ...rest,\n width: '100%',\n autoComplete: 'off',\n 'aria-controls': this.menuId,\n onValueChange: this.handleValueChange,\n onKeyDown: this.handleKeyDown,\n onFocus: this.handleFocus,\n ref: this.refInput,\n };\n\n return (\n <RenderLayer onFocusOutside={this.handleBlur} onClickOutside={this.handleClickOutside} active={focused}>\n <span\n data-tid={AutocompleteDataTids.root}\n className={cx(styles.root(this.theme), {\n [styles.noPortal()]: disablePortal,\n })}\n style={{ width }}\n ref={this.refRootSpan}\n >\n {this.getInput(inputProps)}\n\n {isMobile ? this.renderMobileMenu() : this.renderMenu()}\n </span>\n </RenderLayer>\n );\n };\n\n private renderHints(): React.ReactNode {\n const items = this.state.items;\n\n if (!this.props.value) {\n return <MenuMessage>{this.locale.enterValue}</MenuMessage>;\n }\n\n if (items?.length === 0 && this.props.value) {\n return <MenuMessage>{this.locale.notFound}</MenuMessage>;\n }\n\n if (isNullable(items) && this.props.value) {\n return <MenuMessage>{this.locale.updateValue}</MenuMessage>;\n }\n\n return null;\n }\n\n private renderMenu(): React.ReactNode {\n const items = this.state.items;\n const { menuPos, menuAlign, menuMaxHeight, hasShadow, menuWidth, width, preventWindowScroll, disablePortal } =\n this.getProps();\n const calculatedMenuWidth = menuWidth ? '100%' : width && getDOMRect(this.rootSpan).width;\n const menuProps = {\n ref: this.refMenu,\n maxHeight: menuMaxHeight,\n hasShadow: false,\n hasMargin: false,\n width: calculatedMenuWidth,\n preventWindowScroll,\n };\n if (!items || items.length === 0) {\n return null;\n }\n\n return (\n <Popup\n opened\n hasShadow={hasShadow}\n id={this.menuId}\n priority={ZIndex.priorities.PopupMenu}\n data-tid={AutocompleteDataTids.menu}\n anchorElement={this.getAnchor()}\n disablePortal={disablePortal}\n width={menuWidth}\n minWidth={menuWidth === undefined ? '100%' : undefined}\n positions={getMenuPositions(menuPos, menuAlign)}\n margin={parseInt(this.theme.menuOffsetY) - 1}\n >\n <Menu {...menuProps}>{this.getItems()}</Menu>\n </Popup>\n );\n }\n\n private getInput = (inputProps: InputProps) => {\n return this.featureFlags.autocompleteUseMaskedInput && this.props.mask ? (\n <MaskedInput\n {...inputProps}\n type={getSafeMaskInputType(this.props.type)}\n mask={this.props.mask}\n maskChar={this.props.maskChar}\n />\n ) : (\n <Input {...inputProps} mask={this.props.mask} maskChar={this.props.maskChar} />\n );\n };\n\n private renderMobileMenu = () => {\n const inputProps: InputProps = {\n autoComplete: 'off',\n autoFocus: true,\n width: '100%',\n onValueChange: this.handleValueChange,\n onKeyPress: this.handleKeyPressMobile,\n value: this.props.value,\n placeholder: this.locale.enterValue,\n type: this.props.type,\n inputMode: this.props.inputMode,\n 'aria-label': this.props['aria-label'],\n 'aria-controls': this.menuId,\n };\n\n const items = this.state.items;\n\n return (\n <MobilePopup\n id={this.menuId}\n headerChildComponent={this.getInput(inputProps)}\n caption={this.props.mobileMenuHeaderText}\n opened={this.state.isMobileOpened}\n onCloseRequest={this.handleCloseMobile}\n ref={this.refMobilePopup}\n >\n <Menu ref={this.refMenu} onItemClick={this.mobilePopup?.close} disableScrollContainer maxHeight={'auto'}>\n {items && items.length > 0 && this.getItems()}\n {this.renderHints()}\n </Menu>\n </MobilePopup>\n );\n };\n\n private getItems = () => {\n const items = this.state.items;\n const isMobile = this.isMobileLayout;\n\n return items\n ? items.map((item, i) => {\n return (\n <MenuItem onClick={this.handleMenuItemClick(i)} key={i} isMobile={isMobile} size={this.size}>\n {this.getProps().renderItem(item)}\n </MenuItem>\n );\n })\n : null;\n };\n\n private handleValueChange = (value: string) => {\n this.opened = true;\n\n this.fireChange(value);\n };\n\n private handleCloseMobile = () => {\n this.setState({\n isMobileOpened: false,\n });\n\n this.handleBlur();\n };\n\n private handleKeyPressMobile = (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n this.mobilePopup?.close();\n }\n };\n\n private handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n if (this.isMobileLayout) {\n this.setState({ isMobileOpened: true });\n }\n\n if (this.state.focused) {\n return;\n }\n\n this.setState({ focused: true });\n\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n private handleBlur = () => {\n if (!this.state.focused) {\n return;\n }\n\n this.opened = false;\n this.setState({ items: null, focused: false });\n\n if (this.input) {\n this.input.blur();\n }\n\n if (this.props.onBlur) {\n this.props.onBlur();\n }\n };\n\n private handleClickOutside = (e: Event) => {\n fixClickFocusIE(e);\n this.handleBlur();\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n switch (true) {\n case isKeyEscape(e):\n e.preventDefault();\n this.setState({ items: null });\n return;\n case isKeyArrowUp(e):\n e.preventDefault();\n if (this.menu) {\n this.menu.up();\n }\n return;\n case isKeyArrowDown(e):\n e.preventDefault();\n if (this.menu) {\n this.menu.down();\n }\n return;\n case isKeyEnter(e):\n e.preventDefault(); // To prevent form submission.\n if (this.menu) {\n this.menu.enter(e);\n }\n return;\n }\n };\n\n private handleMenuItemClick(i: number) {\n return (event: React.SyntheticEvent<HTMLElement>) => this.handleItemClick(event, i);\n }\n\n private getAnchor = () => {\n return getRootNode(this);\n };\n\n private handleItemClick(event: React.SyntheticEvent<HTMLElement> | React.MouseEvent<HTMLElement>, index: number) {\n if ((event as React.MouseEvent<HTMLElement>).button) {\n return;\n }\n\n event.preventDefault();\n this.choose(index);\n }\n\n private choose(index: number) {\n if (!this.state.items) {\n return;\n }\n\n const value = this.state.items[index];\n this.opened = false;\n this.setState({\n selected: -1,\n items: null,\n });\n\n this.fireChange(value);\n\n // NOTE: этот таймаут - костыль. Проблема в старом ReactInputMask, он сеттит пустой value при потере фокуса.\n // Можно будет убрать после полного перехода на MaskedInput\n globalObject.setTimeout(() => {\n this.blur();\n }, 0);\n }\n\n private updateItems(value: string) {\n if (!this.opened) {\n return;\n }\n const pattern = value.trim();\n const source = this.props.source;\n\n if (!source) {\n return;\n }\n\n let promise;\n this.requestId += 1;\n const expectingId = this.requestId;\n if (typeof source === 'function') {\n promise = source(pattern);\n } else {\n promise = match(pattern, source);\n }\n promise.then((items) => {\n if (this.opened && expectingId === this.requestId) {\n this.setState({\n items,\n selected: -1,\n });\n }\n });\n }\n\n private fireChange(value: string) {\n if (this.props.onValueChange) {\n this.props.onValueChange(value);\n }\n }\n\n private refInput = (el: Input | null) => {\n this.input = el;\n };\n\n private refMenu = (menu: Menu | null) => {\n this.menu = menu;\n };\n\n private refRootSpan = (span: HTMLSpanElement) => {\n this.root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AnN,aAAA,CACjCoN,mBAAmB,GAAG,cAAc,EAAApN,aAAA,CACpCqN,WAAW,GAAG,cAAc,EAAArN,aAAA,CAE5B8C,YAAY,GAAiB,EACzClC,UAAU,EAAVA,UAAU,EACV6C,aAAa,EAAE,KAAK,EACpBC,SAAS,EAAE,IAAI,EACfE,aAAa,EAAE,GAAG,EAClBC,mBAAmB,EAAE,IAAI,CAC3B,CAAC,EAAA7D,aAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
|
|
@@ -14,13 +14,16 @@ export interface ButtonInnerProps extends CommonProps {
|
|
|
14
14
|
_noRightPadding?: boolean;
|
|
15
15
|
/** Применяет к кнопке стили псевдокласса `:active`. */
|
|
16
16
|
active?: boolean;
|
|
17
|
-
/** Задаёт выравнивание
|
|
17
|
+
/** Задаёт выравнивание текста в кнопке. */
|
|
18
18
|
align?: React.CSSProperties['textAlign'];
|
|
19
|
-
/**
|
|
19
|
+
/** Преобразует обычную кнопку в кнопку со стрелкой. */
|
|
20
20
|
arrow?: boolean | 'left';
|
|
21
|
-
/** Устанавливает фокус на
|
|
21
|
+
/** Устанавливает фокус на кнопке после окончания загрузки страницы.*/
|
|
22
22
|
autoFocus?: boolean;
|
|
23
|
-
/** Убирает обводку у кнопки.
|
|
23
|
+
/** Убирает обводку у кнопки.
|
|
24
|
+
*
|
|
25
|
+
* **Не рекомендуем использовать, противоречит дизайн-требованиям.**
|
|
26
|
+
*/
|
|
24
27
|
borderless?: boolean;
|
|
25
28
|
/** @ignore */
|
|
26
29
|
checked?: boolean;
|
|
@@ -28,11 +31,13 @@ export interface ButtonInnerProps extends CommonProps {
|
|
|
28
31
|
children?: React.ReactNode;
|
|
29
32
|
/** @ignore */
|
|
30
33
|
corners?: React.CSSProperties;
|
|
31
|
-
/**
|
|
34
|
+
/** Блокирует кнопку и перекрашивает в серый. */
|
|
32
35
|
disabled?: boolean;
|
|
33
36
|
/** @ignore */
|
|
34
37
|
disableFocus?: boolean;
|
|
35
|
-
/** Переводит
|
|
38
|
+
/** Переводит кнопку в состояние валидации "Ошибка".
|
|
39
|
+
*
|
|
40
|
+
* **Не рекомендуем использовать, противоречит дизайн-требованиям.** */
|
|
36
41
|
error?: boolean;
|
|
37
42
|
/** Добавляет иконку слева от текста кнопки. */
|
|
38
43
|
icon?: React.ReactElement;
|
|
@@ -40,7 +45,9 @@ export interface ButtonInnerProps extends CommonProps {
|
|
|
40
45
|
rightIcon?: React.ReactElement;
|
|
41
46
|
/** Переводит кнопку в состояние загрузки. */
|
|
42
47
|
loading?: boolean;
|
|
43
|
-
/** Сужает кнопку.
|
|
48
|
+
/** Сужает кнопку.
|
|
49
|
+
*
|
|
50
|
+
* **Не рекомендуем использовать, противоречит дизайн-требованиям.** */
|
|
44
51
|
narrow?: boolean;
|
|
45
52
|
/** Задаёт размер кнопки. */
|
|
46
53
|
size?: SizeProp;
|
|
@@ -49,17 +56,19 @@ export interface ButtonInnerProps extends CommonProps {
|
|
|
49
56
|
/** Задаёт HTML-атрибут `title`. */
|
|
50
57
|
title?: string;
|
|
51
58
|
/** Задаёт стиль кнопки.
|
|
52
|
-
* **Вариант `link` устарел.**
|
|
53
|
-
* Если нужна кнопка, выглядящая как ссылка, используйте `Link component=button`.
|
|
59
|
+
* **Вариант `link` устарел.** Если нужна кнопка, выглядящая как ссылка, используйте `Link component=button`.
|
|
54
60
|
*/
|
|
55
61
|
use?: ButtonUse;
|
|
56
62
|
/** @ignore */
|
|
57
63
|
visuallyFocused?: boolean;
|
|
58
|
-
/** Переводит
|
|
64
|
+
/** Переводит кнопку в состояние валидации "Предупреждение".
|
|
65
|
+
*
|
|
66
|
+
* **Не рекомендуем использовать, противоречит дизайн-требованиям.**
|
|
67
|
+
*/
|
|
59
68
|
warning?: boolean;
|
|
60
69
|
/** Задаёт ширину кнопки. */
|
|
61
70
|
width?: number | string;
|
|
62
|
-
/**
|
|
71
|
+
/** Задаёт объект с переменными темы. */
|
|
63
72
|
theme?: ThemeIn;
|
|
64
73
|
}
|
|
65
74
|
export declare const BUTTON_DEFAULT_COMPONENT = "button";
|
|
@@ -73,6 +82,7 @@ export declare const ButtonDataTids: {
|
|
|
73
82
|
readonly spinner: "Button__spinner";
|
|
74
83
|
};
|
|
75
84
|
type DefaultProps = Required<Pick<ButtonProps<ButtonLinkAllowedValues>, 'use' | 'type' | 'component'>>;
|
|
85
|
+
/** Кнопка запускает действие, сценарий или позволяет перейти на другую страницу. */
|
|
76
86
|
export declare class Button<C extends ButtonLinkAllowedValues = typeof BUTTON_DEFAULT_COMPONENT> extends React.Component<ButtonProps<C>, ButtonState> {
|
|
77
87
|
static __KONTUR_REACT_UI__: string;
|
|
78
88
|
static displayName: string;
|
|
@@ -91,11 +101,11 @@ export declare class Button<C extends ButtonLinkAllowedValues = typeof BUTTON_DE
|
|
|
91
101
|
static getDerivedStateFromProps(props: ButtonProps): {
|
|
92
102
|
focusedByTab: boolean;
|
|
93
103
|
} | null;
|
|
94
|
-
/**
|
|
104
|
+
/** Программно устанавливает фокус на кнопке. Появляется фокусная рамка, элемент получает клавиатурные события и воспринимается как текущий элемент для чтения скринридерами.
|
|
95
105
|
* @public
|
|
96
106
|
*/
|
|
97
107
|
focus(): void;
|
|
98
|
-
/**
|
|
108
|
+
/** Программно снимает фокус с кнопки.
|
|
99
109
|
* @public
|
|
100
110
|
*/
|
|
101
111
|
blur(): void;
|
|
@@ -101,6 +101,15 @@ var _LoadingButtonIcon = require("./LoadingButtonIcon");var _class, _Button;var
|
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
104
113
|
|
|
105
114
|
|
|
106
115
|
|
|
@@ -130,8 +139,9 @@ var ButtonDataTids = exports.ButtonDataTids = {
|
|
|
130
139
|
|
|
131
140
|
var SpanComponent = function SpanComponent(_ref) {var children = _ref.children,rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
132
141
|
return /*#__PURE__*/_react.default.createElement("span", rest, children);
|
|
133
|
-
};
|
|
142
|
+
};
|
|
134
143
|
|
|
144
|
+
/** Кнопка запускает действие, сценарий или позволяет перейти на другую страницу. */var
|
|
135
145
|
|
|
136
146
|
|
|
137
147
|
Button = exports.Button = (0, _SizeDecorator.withSize)(_class = (0, _rootNode.rootNode)(_class = (_Button = /*#__PURE__*/function (_React$Component) {function Button() {var _this;for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;_this.
|
|
@@ -512,9 +522,9 @@ Button = exports.Button = (0, _SizeDecorator.withSize)(_class = (0, _rootNode.ro
|
|
|
512
522
|
// this.props.use !== 'link',
|
|
513
523
|
// `[Button]: Use 'Link' has been deprecated. Please, use Link with 'component=button' prop instead.`,
|
|
514
524
|
// );
|
|
515
|
-
};Button.getDerivedStateFromProps = function getDerivedStateFromProps(props) {if (props.loading || props.disabled) {return { focusedByTab: false };}return null;} /**
|
|
525
|
+
};Button.getDerivedStateFromProps = function getDerivedStateFromProps(props) {if (props.loading || props.disabled) {return { focusedByTab: false };}return null;} /** Программно устанавливает фокус на кнопке. Появляется фокусная рамка, элемент получает клавиатурные события и воспринимается как текущий элемент для чтения скринридерами.
|
|
516
526
|
* @public
|
|
517
|
-
*/;_proto.focus = function focus() {var _this$node;(_this$node = this.node) == null || _this$node.focus();} /**
|
|
527
|
+
*/;_proto.focus = function focus() {var _this$node;(_this$node = this.node) == null || _this$node.focus();} /** Программно снимает фокус с кнопки.
|
|
518
528
|
* @public
|
|
519
529
|
*/;_proto.blur = function blur() {var _this$node2;(_this$node2 = this.node) == null || _this$node2.blur();};_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = _this2.props.theme ? _ThemeFactory.ThemeFactory.create(_this2.props.theme, theme) : theme;return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: _this2.setRootNode }, _this2.props), _this2.renderMain);});};_proto.getTabIndex = function getTabIndex(_ref2) {var disableFocus = _ref2.disableFocus,disabled = _ref2.disabled,_ref2$tabIndex = _ref2.tabIndex,tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;if (disableFocus || disabled) {return -1;}return tabIndex;};_proto.renderIcon2022 = function renderIcon2022(icon) {if (icon && (0, _utils.isKonturIcon)(icon)) {var _icon$props$size;var sizes = (0, _ButtonIcon.getButtonIconSizes)(this.theme);return /*#__PURE__*/_react.default.cloneElement(icon, { size: (_icon$props$size = icon.props.size) != null ? _icon$props$size : sizes[this.size] });}return icon;};_proto.getSizeClassName = function getSizeClassName() {var _this$getProps2 = this.getProps(),icon = _this$getProps2.icon,rightIcon = _this$getProps2.rightIcon,children = _this$getProps2.children;var isThemeGTE_5_3 = (0, _ThemeHelpers.isThemeGTE)(this.theme, '5.3');switch (this.size) {case 'large':{var _commonClasses, _themeSpecificClasses;var commonClasses = (_commonClasses = {}, _commonClasses[_Button2.styles.sizeLargeIE11(this.theme)] = _client.isIE11 || _client.isEdge, _commonClasses[_Button2.styles.sizeLargeWithIcon(this.theme)] = !!icon, _commonClasses[_Button2.styles.sizeLargeWithIconWithoutText(this.theme)] = !!icon && !children, _commonClasses);var themeSpecificClasses = (_themeSpecificClasses = {}, _themeSpecificClasses[_Button2.styles.sizeLargeWithRightIcon(this.theme)] = !!rightIcon, _themeSpecificClasses[_Button2.styles.sizeLargeWithIconWithoutText5_3(this.theme)] = (!!icon || !!rightIcon) && !children, _themeSpecificClasses);return (0, _Emotion.cx)(_Button2.styles.sizeLarge(this.theme), commonClasses, isThemeGTE_5_3 && themeSpecificClasses);}case 'medium':{var _commonClasses3, _themeSpecificClasses3;var _commonClasses2 = (_commonClasses3 = {}, _commonClasses3[_Button2.styles.sizeMediumIE11(this.theme)] = _client.isIE11 || _client.isEdge, _commonClasses3[_Button2.styles.sizeMediumWithIcon(this.theme)] = !!icon, _commonClasses3[_Button2.styles.sizeMediumWithIconWithoutText(this.theme)] = !!icon && !children, _commonClasses3);var _themeSpecificClasses2 = (_themeSpecificClasses3 = {}, _themeSpecificClasses3[_Button2.styles.sizeMediumWithRightIcon(this.theme)] = !!rightIcon, _themeSpecificClasses3[_Button2.styles.sizeMediumWithIconWithoutText5_3(this.theme)] = (!!icon || !!rightIcon) && !children, _themeSpecificClasses3);return (0, _Emotion.cx)(_Button2.styles.sizeMedium(this.theme), _commonClasses2, isThemeGTE_5_3 && _themeSpecificClasses2);}case 'small':default:{var _commonClasses5, _themeSpecificClasses5;var _commonClasses4 = (_commonClasses5 = {}, _commonClasses5[_Button2.styles.sizeSmallIE11(this.theme)] = _client.isIE11 || _client.isEdge, _commonClasses5[_Button2.styles.sizeSmallWithIcon(this.theme)] = !!icon, _commonClasses5[_Button2.styles.sizeSmallWithIconWithoutText(this.theme)] = !!icon && !children, _commonClasses5);var _themeSpecificClasses4 = (_themeSpecificClasses5 = {}, _themeSpecificClasses5[_Button2.styles.sizeSmallWithRightIcon(this.theme)] = !!rightIcon, _themeSpecificClasses5[_Button2.styles.sizeSmallWithIconWithoutText5_3(this.theme)] = (!!icon || !!rightIcon) && !children, _themeSpecificClasses5);return (0, _Emotion.cx)(_Button2.styles.sizeSmall(this.theme), _commonClasses4, isThemeGTE_5_3 && _themeSpecificClasses4);}}};_proto.getSizeWrapClassName = function getSizeWrapClassName() {switch (this.size) {case 'large':return _Button2.styles.wrapLarge(this.theme);case 'medium':return _Button2.styles.wrapMedium(this.theme);case 'small':default:return _Button2.styles.wrapSmall(this.theme);}};return Button;}(_react.default.Component), _Button.__KONTUR_REACT_UI__ = 'Button', _Button.displayName = 'Button', _Button.__BUTTON__ = true, _Button.defaultProps = { use: 'default', // By default, the type attribute is 'submit'. IE8 will fire a click event
|
|
520
530
|
// on this button if somewhere on the page user presses Enter while some
|