@skbkontur/react-ui 3.7.1 → 3.8.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.
Files changed (168) hide show
  1. package/CHANGELOG.md +62 -2
  2. package/README.md +1 -1
  3. package/cjs/components/Button/Button.d.ts +1 -0
  4. package/cjs/components/Button/Button.js +4 -1
  5. package/cjs/components/Button/Button.js.map +1 -1
  6. package/cjs/components/Button/Button.styles.js +2 -2
  7. package/cjs/components/Button/Button.styles.js.map +1 -1
  8. package/cjs/components/Checkbox/Checkbox.styles.js +1 -2
  9. package/cjs/components/Checkbox/Checkbox.styles.js.map +1 -1
  10. package/cjs/components/CurrencyLabel/CurrencyLabel.js +5 -14
  11. package/cjs/components/CurrencyLabel/CurrencyLabel.js.map +1 -1
  12. package/cjs/components/Dropdown/Dropdown.d.ts +1 -0
  13. package/cjs/components/Dropdown/Dropdown.js +1 -0
  14. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  15. package/cjs/components/Dropdown/Dropdown.md +0 -1
  16. package/cjs/components/DropdownMenu/DropdownMenu.d.ts +17 -3
  17. package/cjs/components/DropdownMenu/DropdownMenu.js +15 -1
  18. package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  19. package/cjs/components/DropdownMenu/DropdownMenu.md +87 -6
  20. package/cjs/components/Kebab/Kebab.d.ts +5 -2
  21. package/cjs/components/Kebab/Kebab.js +5 -1
  22. package/cjs/components/Kebab/Kebab.js.map +1 -1
  23. package/cjs/components/Kebab/Kebab.md +249 -3
  24. package/cjs/components/MenuHeader/MenuHeader.d.ts +5 -1
  25. package/cjs/components/MenuHeader/MenuHeader.js +5 -1
  26. package/cjs/components/MenuHeader/MenuHeader.js.map +1 -1
  27. package/cjs/components/MenuHeader/MenuHeader.md +23 -0
  28. package/cjs/components/MenuItem/MenuItem.d.ts +10 -1
  29. package/cjs/components/MenuItem/MenuItem.js +11 -1
  30. package/cjs/components/MenuItem/MenuItem.js.map +1 -1
  31. package/cjs/components/MenuItem/MenuItem.md +106 -4
  32. package/cjs/components/MenuSeparator/MenuSeparator.d.ts +3 -1
  33. package/cjs/components/MenuSeparator/MenuSeparator.js +3 -1
  34. package/cjs/components/MenuSeparator/MenuSeparator.js.map +1 -1
  35. package/cjs/components/MenuSeparator/MenuSeparator.md +14 -0
  36. package/cjs/components/Modal/Modal.styles.d.ts +1 -0
  37. package/cjs/components/Modal/Modal.styles.js +22 -20
  38. package/cjs/components/Modal/Modal.styles.js.map +1 -1
  39. package/cjs/components/Modal/ModalClose.js +23 -3
  40. package/cjs/components/Modal/ModalClose.js.map +1 -1
  41. package/cjs/components/Paging/Paging.styles.js +2 -1
  42. package/cjs/components/Paging/Paging.styles.js.map +1 -1
  43. package/cjs/components/Textarea/Textarea.d.ts +0 -2
  44. package/cjs/components/Textarea/Textarea.js +6 -3
  45. package/cjs/components/Textarea/Textarea.js.map +1 -1
  46. package/cjs/components/Toggle/Toggle.d.ts +47 -1
  47. package/cjs/components/Toggle/Toggle.js +52 -2
  48. package/cjs/components/Toggle/Toggle.js.map +1 -1
  49. package/cjs/components/Toggle/Toggle.md +83 -9
  50. package/cjs/components/Toggle/Toggle.styles.d.ts +3 -0
  51. package/cjs/components/Toggle/Toggle.styles.js +36 -23
  52. package/cjs/components/Toggle/Toggle.styles.js.map +1 -1
  53. package/cjs/components/TokenInput/TokenInput.d.ts +8 -0
  54. package/cjs/components/TokenInput/TokenInput.js +19 -1
  55. package/cjs/components/TokenInput/TokenInput.js.map +1 -1
  56. package/cjs/components/TooltipMenu/TooltipMenu.d.ts +26 -8
  57. package/cjs/components/TooltipMenu/TooltipMenu.js +24 -6
  58. package/cjs/components/TooltipMenu/TooltipMenu.js.map +1 -1
  59. package/cjs/components/TooltipMenu/TooltipMenu.md +76 -8
  60. package/cjs/internal/CustomComboBox/ComboBoxView.js +2 -1
  61. package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  62. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js +3 -2
  63. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js.map +1 -1
  64. package/cjs/internal/InputLikeText/InputLikeText.js +2 -1
  65. package/cjs/internal/InputLikeText/InputLikeText.js.map +1 -1
  66. package/cjs/internal/RenderContainer/RenderContainer.js +2 -1
  67. package/cjs/internal/RenderContainer/RenderContainer.js.map +1 -1
  68. package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  69. package/cjs/internal/themes/DefaultTheme.d.ts +4 -0
  70. package/cjs/internal/themes/DefaultTheme.js +13 -3
  71. package/cjs/internal/themes/DefaultTheme.js.map +1 -1
  72. package/cjs/lib/Upgrades.d.ts +2 -0
  73. package/cjs/lib/Upgrades.js +14 -0
  74. package/cjs/lib/Upgrades.js.map +1 -1
  75. package/cjs/lib/locale/LOCALECONTEXT.md +1 -1
  76. package/cjs/lib/theming/Emotion.js +1 -1
  77. package/cjs/lib/theming/Emotion.js.map +1 -1
  78. package/cjs/lib/theming/ThemeContext.md +1 -1
  79. package/cjs/lib/utils.d.ts +7 -0
  80. package/cjs/lib/utils.js +12 -2
  81. package/cjs/lib/utils.js.map +1 -1
  82. package/components/Button/Button/Button.js +2 -1
  83. package/components/Button/Button/Button.js.map +1 -1
  84. package/components/Button/Button.d.ts +1 -0
  85. package/components/Button/Button.styles/Button.styles.js +1 -1
  86. package/components/Button/Button.styles/Button.styles.js.map +1 -1
  87. package/components/Checkbox/Checkbox.styles/Checkbox.styles.js +1 -1
  88. package/components/Checkbox/Checkbox.styles/Checkbox.styles.js.map +1 -1
  89. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js +5 -11
  90. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js.map +1 -1
  91. package/components/Dropdown/Dropdown/Dropdown.js +1 -0
  92. package/components/Dropdown/Dropdown/Dropdown.js.map +1 -1
  93. package/components/Dropdown/Dropdown.d.ts +1 -0
  94. package/components/Dropdown/Dropdown.md +0 -1
  95. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js +1 -1
  96. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
  97. package/components/DropdownMenu/DropdownMenu.d.ts +17 -3
  98. package/components/DropdownMenu/DropdownMenu.md +87 -6
  99. package/components/Kebab/Kebab/Kebab.js +2 -1
  100. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  101. package/components/Kebab/Kebab.d.ts +5 -2
  102. package/components/Kebab/Kebab.md +249 -3
  103. package/components/MenuHeader/MenuHeader/MenuHeader.js +5 -1
  104. package/components/MenuHeader/MenuHeader/MenuHeader.js.map +1 -1
  105. package/components/MenuHeader/MenuHeader.d.ts +5 -1
  106. package/components/MenuHeader/MenuHeader.md +23 -0
  107. package/components/MenuItem/MenuItem/MenuItem.js +4 -1
  108. package/components/MenuItem/MenuItem/MenuItem.js.map +1 -1
  109. package/components/MenuItem/MenuItem.d.ts +10 -1
  110. package/components/MenuItem/MenuItem.md +106 -4
  111. package/components/MenuSeparator/MenuSeparator/MenuSeparator.js +3 -1
  112. package/components/MenuSeparator/MenuSeparator/MenuSeparator.js.map +1 -1
  113. package/components/MenuSeparator/MenuSeparator.d.ts +3 -1
  114. package/components/MenuSeparator/MenuSeparator.md +14 -0
  115. package/components/Modal/Modal.styles/Modal.styles.js +18 -15
  116. package/components/Modal/Modal.styles/Modal.styles.js.map +1 -1
  117. package/components/Modal/Modal.styles.d.ts +1 -0
  118. package/components/Modal/ModalClose/ModalClose.js +25 -2
  119. package/components/Modal/ModalClose/ModalClose.js.map +1 -1
  120. package/components/Paging/Paging.styles/Paging.styles.js +1 -1
  121. package/components/Paging/Paging.styles/Paging.styles.js.map +1 -1
  122. package/components/Textarea/Textarea/Textarea.js +1 -2
  123. package/components/Textarea/Textarea/Textarea.js.map +1 -1
  124. package/components/Textarea/Textarea.d.ts +0 -2
  125. package/components/Toggle/Toggle/Toggle.js +11 -5
  126. package/components/Toggle/Toggle/Toggle.js.map +1 -1
  127. package/components/Toggle/Toggle.d.ts +47 -1
  128. package/components/Toggle/Toggle.md +83 -9
  129. package/components/Toggle/Toggle.styles/Toggle.styles.js +21 -15
  130. package/components/Toggle/Toggle.styles/Toggle.styles.js.map +1 -1
  131. package/components/Toggle/Toggle.styles.d.ts +3 -0
  132. package/components/TokenInput/TokenInput/TokenInput.js +20 -0
  133. package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
  134. package/components/TokenInput/TokenInput.d.ts +8 -0
  135. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js +9 -6
  136. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js.map +1 -1
  137. package/components/TooltipMenu/TooltipMenu.d.ts +26 -8
  138. package/components/TooltipMenu/TooltipMenu.md +76 -8
  139. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +2 -1
  140. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
  141. package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js +3 -2
  142. package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js.map +1 -1
  143. package/internal/InputLikeText/InputLikeText/InputLikeText.js +2 -1
  144. package/internal/InputLikeText/InputLikeText/InputLikeText.js.map +1 -1
  145. package/internal/RenderContainer/RenderContainer/RenderContainer.js +2 -1
  146. package/internal/RenderContainer/RenderContainer/RenderContainer.js.map +1 -1
  147. package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  148. package/internal/themes/DefaultTheme/DefaultTheme.js +17 -1
  149. package/internal/themes/DefaultTheme/DefaultTheme.js.map +1 -1
  150. package/internal/themes/DefaultTheme.d.ts +4 -0
  151. package/lib/Upgrades/Upgrades.js +13 -0
  152. package/lib/Upgrades/Upgrades.js.map +1 -1
  153. package/lib/Upgrades.d.ts +2 -0
  154. package/lib/locale/LOCALECONTEXT.md +1 -1
  155. package/lib/theming/Emotion/Emotion.js +1 -1
  156. package/lib/theming/Emotion/Emotion.js.map +1 -1
  157. package/lib/theming/ThemeContext.md +1 -1
  158. package/lib/utils/utils.js +10 -0
  159. package/lib/utils/utils.js.map +1 -1
  160. package/lib/utils.d.ts +7 -0
  161. package/package.json +2 -2
  162. package/cjs/components/CurrencyLabel/CurrencyLabel.styles.d.ts +0 -4
  163. package/cjs/components/CurrencyLabel/CurrencyLabel.styles.js +0 -9
  164. package/cjs/components/CurrencyLabel/CurrencyLabel.styles.js.map +0 -1
  165. package/components/CurrencyLabel/CurrencyLabel.styles/CurrencyLabel.styles.js +0 -10
  166. package/components/CurrencyLabel/CurrencyLabel.styles/CurrencyLabel.styles.js.map +0 -1
  167. package/components/CurrencyLabel/CurrencyLabel.styles/package.json +0 -6
  168. package/components/CurrencyLabel/CurrencyLabel.styles.d.ts +0 -4
@@ -1,6 +1,7 @@
1
1
  "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.ComboBoxView = void 0;var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
  var _reactDom = require("react-dom");
3
3
 
4
+ var _utils = require("../../lib/utils");
4
5
  var _DropdownContainer = require("../DropdownContainer");
5
6
  var _Input = require("../../components/Input");
6
7
  var _InputLikeText = require("../InputLikeText");
@@ -286,4 +287,4 @@ ComboBoxView = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.def
286
287
  }
287
288
 
288
289
  return null;
289
- };return _this;}var _proto = ComboBoxView.prototype;_proto.componentDidMount = function componentDidMount() {if (this.props.autoFocus && this.props.onFocus) {this.props.onFocus();}};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {var input = this.input,props = this.props;if (props.editing && !prevProps.editing && input) {input.focus();}};_proto.render = function render() {var _this2 = this;var _this$props2 = this.props,items = _this$props2.items,loading = _this$props2.loading,menuAlign = _this$props2.menuAlign,onClickOutside = _this$props2.onClickOutside,onFocusOutside = _this$props2.onFocusOutside,onMouseEnter = _this$props2.onMouseEnter,onMouseLeave = _this$props2.onMouseLeave,onMouseOver = _this$props2.onMouseOver,opened = _this$props2.opened,refMenu = _this$props2.refMenu,maxMenuHeight = _this$props2.maxMenuHeight,renderTotalCount = _this$props2.renderTotalCount,renderItem = _this$props2.renderItem,renderNotFound = _this$props2.renderNotFound,repeatRequest = _this$props2.repeatRequest,requestStatus = _this$props2.requestStatus,totalCount = _this$props2.totalCount,size = _this$props2.size,width = _this$props2.width;var input = this.renderInput();var topOffsets = { spinner: 6, arrow: 15 };if (size === 'medium') {topOffsets.spinner += 4;topOffsets.arrow += 4;}if (size === 'large') {topOffsets.spinner += 6;topOffsets.arrow += 6;}return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, this.props, /*#__PURE__*/_react.default.createElement(_RenderLayer.RenderLayer, { onClickOutside: onClickOutside, onFocusOutside: onFocusOutside, active: opened }, /*#__PURE__*/_react.default.createElement("span", { style: { width: width }, className: _CustomComboBox.styles.root(), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseOver: onMouseOver }, input, opened && /*#__PURE__*/_react.default.createElement(_DropdownContainer.DropdownContainer, { align: menuAlign, getParent: function getParent() {return (0, _reactDom.findDOMNode)(_this2);}, offsetY: 1, disablePortal: this.props.disablePortal }, /*#__PURE__*/_react.default.createElement(_ComboBoxMenu.ComboBoxMenu, { items: items, loading: loading, maxMenuHeight: maxMenuHeight, onValueChange: this.handleItemSelect, opened: opened, refMenu: refMenu, renderTotalCount: renderTotalCount, renderItem: renderItem, renderNotFound: renderNotFound, renderAddButton: this.renderAddButton, repeatRequest: repeatRequest, requestStatus: requestStatus, totalCount: totalCount })))));};_proto.renderInput = function renderInput() {var _this$props3 = this.props,align = _this$props3.align,borderless = _this$props3.borderless,disabled = _this$props3.disabled,editing = _this$props3.editing,error = _this$props3.error,onFocus = _this$props3.onFocus,onInputBlur = _this$props3.onInputBlur,onInputValueChange = _this$props3.onInputValueChange,onInputFocus = _this$props3.onInputFocus,onInputClick = _this$props3.onInputClick,onInputKeyDown = _this$props3.onInputKeyDown,placeholder = _this$props3.placeholder,renderValue = _this$props3.renderValue,size = _this$props3.size,textValue = _this$props3.textValue,value = _this$props3.value,warning = _this$props3.warning,refInputLikeText = _this$props3.refInputLikeText,leftIcon = _this$props3.leftIcon,inputMode = _this$props3.inputMode;var rightIcon = this.getRightIcon();if (editing) {return /*#__PURE__*/_react.default.createElement(_Input.Input, { align: align, borderless: borderless, disabled: disabled, error: error, maxLength: this.props.maxLength, onBlur: onInputBlur, onValueChange: onInputValueChange, onFocus: onInputFocus, onClick: onInputClick, leftIcon: leftIcon, rightIcon: rightIcon, value: textValue || '', onKeyDown: onInputKeyDown, placeholder: placeholder, width: "100%", size: size, ref: this.refInput, warning: warning, inputMode: inputMode });}return /*#__PURE__*/_react.default.createElement(_InputLikeText.InputLikeText, { align: align, borderless: borderless, error: error, onFocus: onFocus, leftIcon: leftIcon, rightIcon: rightIcon, disabled: disabled, warning: warning, placeholder: placeholder, size: size, width: "100%", ref: refInputLikeText }, value ? renderValue(value) : null);};return ComboBoxView;}(_react.default.Component);exports.ComboBoxView = ComboBoxView;ComboBoxView.__KONTUR_REACT_UI__ = 'ComboBoxView';ComboBoxView.defaultProps = { renderItem: function renderItem(item) {return item;}, renderValue: function renderValue(item) {return item;}, renderAddButton: function renderAddButton() {return null;}, repeatRequest: function repeatRequest() {return undefined;}, requestStatus: _CustomComboBoxTypes.ComboBoxRequestStatus.Unknown, onClickOutside: function onClickOutside() {/**/}, onFocusOutside: function onFocusOutside() {/**/}, size: 'small', width: 250 };
290
+ };return _this;}var _proto = ComboBoxView.prototype;_proto.componentDidMount = function componentDidMount() {if (this.props.autoFocus && this.props.onFocus) {this.props.onFocus();}};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {var input = this.input,props = this.props;if (props.editing && !prevProps.editing && input) {input.focus();}};_proto.render = function render() {var _this2 = this;var _this$props2 = this.props,items = _this$props2.items,loading = _this$props2.loading,menuAlign = _this$props2.menuAlign,onClickOutside = _this$props2.onClickOutside,onFocusOutside = _this$props2.onFocusOutside,onMouseEnter = _this$props2.onMouseEnter,onMouseLeave = _this$props2.onMouseLeave,onMouseOver = _this$props2.onMouseOver,opened = _this$props2.opened,refMenu = _this$props2.refMenu,maxMenuHeight = _this$props2.maxMenuHeight,renderTotalCount = _this$props2.renderTotalCount,renderItem = _this$props2.renderItem,renderNotFound = _this$props2.renderNotFound,repeatRequest = _this$props2.repeatRequest,requestStatus = _this$props2.requestStatus,totalCount = _this$props2.totalCount,size = _this$props2.size,width = _this$props2.width;var input = this.renderInput();var topOffsets = { spinner: 6, arrow: 15 };if (size === 'medium') {topOffsets.spinner += 4;topOffsets.arrow += 4;}if (size === 'large') {topOffsets.spinner += 6;topOffsets.arrow += 6;}return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, this.props, /*#__PURE__*/_react.default.createElement(_RenderLayer.RenderLayer, { onClickOutside: onClickOutside, onFocusOutside: onFocusOutside, active: opened }, /*#__PURE__*/_react.default.createElement("span", { style: { width: width }, className: _CustomComboBox.styles.root(), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseOver: onMouseOver }, input, opened && /*#__PURE__*/_react.default.createElement(_DropdownContainer.DropdownContainer, { align: menuAlign, getParent: function getParent() {return (0, _reactDom.findDOMNode)(_this2);}, offsetY: 1, disablePortal: this.props.disablePortal }, /*#__PURE__*/_react.default.createElement(_ComboBoxMenu.ComboBoxMenu, { items: items, loading: loading, maxMenuHeight: maxMenuHeight, onValueChange: this.handleItemSelect, opened: opened, refMenu: refMenu, renderTotalCount: renderTotalCount, renderItem: renderItem, renderNotFound: renderNotFound, renderAddButton: this.renderAddButton, repeatRequest: repeatRequest, requestStatus: requestStatus, totalCount: totalCount })))));};_proto.renderInput = function renderInput() {var _this$props3 = this.props,align = _this$props3.align,borderless = _this$props3.borderless,disabled = _this$props3.disabled,editing = _this$props3.editing,error = _this$props3.error,onFocus = _this$props3.onFocus,onInputBlur = _this$props3.onInputBlur,onInputValueChange = _this$props3.onInputValueChange,onInputFocus = _this$props3.onInputFocus,onInputClick = _this$props3.onInputClick,onInputKeyDown = _this$props3.onInputKeyDown,placeholder = _this$props3.placeholder,renderValue = _this$props3.renderValue,size = _this$props3.size,textValue = _this$props3.textValue,value = _this$props3.value,warning = _this$props3.warning,refInputLikeText = _this$props3.refInputLikeText,leftIcon = _this$props3.leftIcon,inputMode = _this$props3.inputMode;var rightIcon = this.getRightIcon();if (editing) {return /*#__PURE__*/_react.default.createElement(_Input.Input, { align: align, borderless: borderless, disabled: disabled, error: error, maxLength: this.props.maxLength, onBlur: onInputBlur, onValueChange: onInputValueChange, onFocus: onInputFocus, onClick: onInputClick, leftIcon: leftIcon, rightIcon: rightIcon, value: textValue || '', onKeyDown: onInputKeyDown, placeholder: placeholder, width: "100%", size: size, ref: this.refInput, warning: warning, inputMode: inputMode });}return /*#__PURE__*/_react.default.createElement(_InputLikeText.InputLikeText, { align: align, borderless: borderless, error: error, onFocus: onFocus, leftIcon: leftIcon, rightIcon: rightIcon, disabled: disabled, warning: warning, placeholder: placeholder, size: size, width: "100%", ref: refInputLikeText }, (0, _utils.isNonNullable)(value) && renderValue ? renderValue(value) : null);};return ComboBoxView;}(_react.default.Component);exports.ComboBoxView = ComboBoxView;ComboBoxView.__KONTUR_REACT_UI__ = 'ComboBoxView';ComboBoxView.defaultProps = { renderItem: function renderItem(item) {return item;}, renderValue: function renderValue(item) {return item;}, renderAddButton: function renderAddButton() {return null;}, repeatRequest: function repeatRequest() {return undefined;}, requestStatus: _CustomComboBoxTypes.ComboBoxRequestStatus.Unknown, onClickOutside: function onClickOutside() {/**/}, onFocusOutside: function onFocusOutside() {/**/}, size: 'small', width: 250 };
@@ -1 +1 @@
1
- {"version":3,"sources":["ComboBoxView.tsx"],"names":["ComboBoxView","input","renderAddButton","props","textValue","handleItemSelect","item","onValueChange","refInput","renderSpinner","styles","spinnerWrapper","getRightIcon","loading","items","drawArrow","rightIcon","length","rightIconWrapper","componentDidMount","autoFocus","onFocus","componentDidUpdate","prevProps","editing","focus","render","menuAlign","onClickOutside","onFocusOutside","onMouseEnter","onMouseLeave","onMouseOver","opened","refMenu","maxMenuHeight","renderTotalCount","renderItem","renderNotFound","repeatRequest","requestStatus","totalCount","size","width","renderInput","topOffsets","spinner","arrow","root","disablePortal","align","borderless","disabled","error","onInputBlur","onInputValueChange","onInputFocus","onInputClick","onInputKeyDown","placeholder","renderValue","value","warning","refInputLikeText","leftIcon","inputMode","maxLength","React","Component","__KONTUR_REACT_UI__","defaultProps","undefined","ComboBoxRequestStatus","Unknown"],"mappings":"wPAAA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDaA,Y;;;;;;;;;;;;;;;;;;;AAmBHC,IAAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FAC,IAAAA,e,GAAkB,YAAuB;AAC/C,aAAO,MAAKC,KAAL,CAAWD,eAAX,CAA2B,MAAKC,KAAL,CAAWC,SAAtC,CAAP;AACD,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EOC,IAAAA,gB,GAAmB,UAACC,IAAD,EAAa;AACtC,UAAI,MAAKH,KAAL,CAAWI,aAAf,EAA8B;AAC5B,cAAKJ,KAAL,CAAWI,aAAX,CAAyBD,IAAzB;AACD;AACF,K;;AAEOE,IAAAA,Q,GAAW,UAACP,KAAD,EAA4B;AAC7C,UAAI,MAAKE,KAAL,CAAWK,QAAf,EAAyB;AACvB,cAAKL,KAAL,CAAWK,QAAX,CAAoBP,KAApB;AACD;AACD,YAAKA,KAAL,GAAaA,KAAb;AACD,K;;AAEOQ,IAAAA,a,GAAgB;AACtB,+CAAM,SAAS,EAAEC,uBAAOC,cAA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B/B,aAAa,EAAEgC,2CAAsBC,OALV,EAM3B7C,cAAc,EAAE,0BAAM,CACpB,IACD,CAR0B,EAS3BC,cAAc,EAAE,0BAAM,CACpB,IACD,CAX0B,EAY3Ba,IAAI,EAAE,OAZqB,EAa3BC,KAAK,EAAE,GAboB,E","sourcesContent":["import React from 'react';\nimport { findDOMNode } from 'react-dom';\n\nimport { DropdownContainer } from '../DropdownContainer';\nimport { Input, InputIconType } from '../../components/Input';\nimport { InputLikeText } from '../InputLikeText';\nimport { Menu } from '../Menu';\nimport { MenuItemState } from '../../components/MenuItem';\nimport { RenderLayer } from '../RenderLayer';\nimport { Spinner } from '../../components/Spinner';\nimport { Nullable } from '../../typings/utility-types';\nimport { ArrowChevronDownIcon } from '../icons/16px';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\n\nimport { ComboBoxMenu } from './ComboBoxMenu';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes';\nimport { styles } from './CustomComboBox.styles';\n\ninterface ComboBoxViewProps<T> extends CommonProps {\n align?: 'left' | 'center' | 'right';\n autoFocus?: boolean;\n borderless?: boolean;\n disablePortal?: boolean;\n disabled?: boolean;\n editing?: boolean;\n error?: boolean;\n items?: Nullable<T[]>;\n loading?: boolean;\n menuAlign?: 'left' | 'right';\n opened?: boolean;\n drawArrow?: boolean;\n placeholder?: string;\n size?: 'small' | 'medium' | 'large';\n textValue?: string;\n totalCount?: number;\n value?: Nullable<T>;\n warning?: boolean;\n width?: string | number;\n maxLength?: number;\n maxMenuHeight?: number | string;\n leftIcon?: InputIconType;\n rightIcon?: InputIconType;\n inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];\n\n onValueChange?: (value: T) => void;\n onClickOutside?: (e: Event) => void;\n onFocus?: () => void;\n onFocusOutside?: () => void;\n onInputBlur?: () => void;\n onInputValueChange?: (value: string) => void;\n onInputFocus?: () => void;\n onInputClick?: () => void;\n onInputKeyDown?: (e: React.KeyboardEvent) => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n renderItem?: (item: T, state: MenuItemState) => React.ReactNode;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderValue?: (item: T) => React.ReactNode;\n renderAddButton: (query?: string) => React.ReactNode;\n repeatRequest?: () => void;\n requestStatus?: ComboBoxRequestStatus;\n refInput?: (input: Nullable<Input>) => void;\n refMenu?: (menu: Nullable<Menu>) => void;\n refInputLikeText?: (inputLikeText: Nullable<InputLikeText>) => void;\n}\n\nexport class ComboBoxView<T> extends React.Component<ComboBoxViewProps<T>> {\n public static __KONTUR_REACT_UI__ = 'ComboBoxView';\n\n public static defaultProps = {\n renderItem: (item: any) => item,\n renderValue: (item: any) => item,\n renderAddButton: () => null,\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n onClickOutside: () => {\n /**/\n },\n onFocusOutside: () => {\n /**/\n },\n size: 'small',\n width: 250,\n };\n\n private input: Nullable<Input>;\n\n public componentDidMount() {\n if (this.props.autoFocus && this.props.onFocus) {\n this.props.onFocus();\n }\n }\n\n public componentDidUpdate(prevProps: ComboBoxViewProps<T>) {\n const { input, props } = this;\n if (props.editing && !prevProps.editing && input) {\n input.focus();\n }\n }\n\n public render() {\n const {\n items,\n loading,\n menuAlign,\n onClickOutside,\n onFocusOutside,\n onMouseEnter,\n onMouseLeave,\n onMouseOver,\n opened,\n refMenu,\n maxMenuHeight,\n renderTotalCount,\n renderItem,\n renderNotFound,\n repeatRequest,\n requestStatus,\n totalCount,\n size,\n width,\n } = this.props;\n\n const input = this.renderInput();\n\n const topOffsets = {\n spinner: 6,\n arrow: 15,\n };\n if (size === 'medium') {\n topOffsets.spinner += 4;\n topOffsets.arrow += 4;\n }\n if (size === 'large') {\n topOffsets.spinner += 6;\n topOffsets.arrow += 6;\n }\n\n return (\n <CommonWrapper {...this.props}>\n <RenderLayer onClickOutside={onClickOutside} onFocusOutside={onFocusOutside} active={opened}>\n <span\n style={{ width }}\n className={styles.root()}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n >\n {input}\n {opened && (\n <DropdownContainer\n align={menuAlign}\n getParent={() => findDOMNode(this)}\n offsetY={1}\n disablePortal={this.props.disablePortal}\n >\n <ComboBoxMenu\n items={items}\n loading={loading}\n maxMenuHeight={maxMenuHeight}\n onValueChange={this.handleItemSelect}\n opened={opened}\n refMenu={refMenu}\n renderTotalCount={renderTotalCount}\n renderItem={renderItem!}\n renderNotFound={renderNotFound}\n renderAddButton={this.renderAddButton}\n repeatRequest={repeatRequest}\n requestStatus={requestStatus}\n totalCount={totalCount}\n />\n </DropdownContainer>\n )}\n </span>\n </RenderLayer>\n </CommonWrapper>\n );\n }\n\n private renderAddButton = (): React.ReactNode => {\n return this.props.renderAddButton(this.props.textValue);\n };\n\n private renderInput(): React.ReactNode {\n const {\n align,\n borderless,\n disabled,\n editing,\n error,\n onFocus,\n onInputBlur,\n onInputValueChange,\n onInputFocus,\n onInputClick,\n onInputKeyDown,\n placeholder,\n renderValue,\n size,\n textValue,\n value,\n warning,\n refInputLikeText,\n leftIcon,\n inputMode,\n } = this.props;\n\n const rightIcon = this.getRightIcon();\n\n if (editing) {\n return (\n <Input\n align={align}\n borderless={borderless}\n disabled={disabled}\n error={error}\n maxLength={this.props.maxLength}\n onBlur={onInputBlur}\n onValueChange={onInputValueChange}\n onFocus={onInputFocus}\n onClick={onInputClick}\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n value={textValue || ''}\n onKeyDown={onInputKeyDown}\n placeholder={placeholder}\n width=\"100%\"\n size={size}\n ref={this.refInput}\n warning={warning}\n inputMode={inputMode}\n />\n );\n }\n\n return (\n <InputLikeText\n align={align}\n borderless={borderless}\n error={error}\n onFocus={onFocus}\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n disabled={disabled}\n warning={warning}\n placeholder={placeholder}\n size={size}\n width=\"100%\"\n ref={refInputLikeText}\n >\n {value ? renderValue!(value) : null}\n </InputLikeText>\n );\n }\n\n private handleItemSelect = (item: T) => {\n if (this.props.onValueChange) {\n this.props.onValueChange(item);\n }\n };\n\n private refInput = (input: Nullable<Input>) => {\n if (this.props.refInput) {\n this.props.refInput(input);\n }\n this.input = input;\n };\n\n private renderSpinner = () => (\n <span className={styles.spinnerWrapper()}>\n <Spinner type=\"mini\" caption=\"\" dimmed />\n </span>\n );\n\n private getRightIcon = () => {\n const { loading, items, drawArrow, rightIcon } = this.props;\n\n if (loading && items && !!items.length) {\n return this.renderSpinner();\n }\n\n if (rightIcon || drawArrow) {\n return <span className={styles.rightIconWrapper()}>{rightIcon ?? <ArrowChevronDownIcon />}</span>;\n }\n\n return null;\n };\n}\n"]}
1
+ {"version":3,"sources":["ComboBoxView.tsx"],"names":["ComboBoxView","input","renderAddButton","props","textValue","handleItemSelect","item","onValueChange","refInput","renderSpinner","styles","spinnerWrapper","getRightIcon","loading","items","drawArrow","rightIcon","length","rightIconWrapper","componentDidMount","autoFocus","onFocus","componentDidUpdate","prevProps","editing","focus","render","menuAlign","onClickOutside","onFocusOutside","onMouseEnter","onMouseLeave","onMouseOver","opened","refMenu","maxMenuHeight","renderTotalCount","renderItem","renderNotFound","repeatRequest","requestStatus","totalCount","size","width","renderInput","topOffsets","spinner","arrow","root","disablePortal","align","borderless","disabled","error","onInputBlur","onInputValueChange","onInputFocus","onInputClick","onInputKeyDown","placeholder","renderValue","value","warning","refInputLikeText","leftIcon","inputMode","maxLength","React","Component","__KONTUR_REACT_UI__","defaultProps","undefined","ComboBoxRequestStatus","Unknown"],"mappings":"wPAAA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDaA,Y;;;;;;;;;;;;;;;;;;;AAmBHC,IAAAA,K;;;;;;;;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,SAnBb,GADF,CAuBD,CAED,oBACE,6BAAC,4BAAD,IACE,KAAK,EAAEf,KADT,EAEE,UAAU,EAAEC,UAFd,EAGE,KAAK,EAAEE,KAHT,EAIE,OAAO,EAAEhC,OAJX,EAKE,QAAQ,EAAE2C,QALZ,EAME,SAAS,EAAEhD,SANb,EAOE,QAAQ,EAAEoC,QAPZ,EAQE,OAAO,EAAEU,OARX,EASE,WAAW,EAAEH,WATf,EAUE,IAAI,EAAEjB,IAVR,EAWE,KAAK,EAAC,MAXR,EAYE,GAAG,EAAEqB,gBAZP,IAcG,0BAAcF,KAAd,KAAwBD,WAAxB,GAAsCA,WAAW,CAACC,KAAD,CAAjD,GAA2D,IAd9D,CADF,CAkBD,C,uBA3LkCM,eAAMC,S,sCAA9BpE,Y,CACGqE,mB,GAAsB,c,CADzBrE,Y,CAGGsE,Y,GAAe,EAC3BjC,UAAU,EAAE,oBAAC/B,IAAD,UAAeA,IAAf,EADe,EAE3BsD,WAAW,EAAE,qBAACtD,IAAD,UAAeA,IAAf,EAFc,EAG3BJ,eAAe,EAAE,mCAAM,IAAN,EAHU,EAI3BqC,aAAa,EAAE,iCAAMgC,SAAN,EAJY,EAK3B/B,aAAa,EAAEgC,2CAAsBC,OALV,EAM3B7C,cAAc,EAAE,0BAAM,CACpB,IACD,CAR0B,EAS3BC,cAAc,EAAE,0BAAM,CACpB,IACD,CAX0B,EAY3Ba,IAAI,EAAE,OAZqB,EAa3BC,KAAK,EAAE,GAboB,E","sourcesContent":["import React from 'react';\nimport { findDOMNode } from 'react-dom';\n\nimport { isNonNullable } from '../../lib/utils';\nimport { DropdownContainer } from '../DropdownContainer';\nimport { Input, InputIconType } from '../../components/Input';\nimport { InputLikeText } from '../InputLikeText';\nimport { Menu } from '../Menu';\nimport { MenuItemState } from '../../components/MenuItem';\nimport { RenderLayer } from '../RenderLayer';\nimport { Spinner } from '../../components/Spinner';\nimport { Nullable } from '../../typings/utility-types';\nimport { ArrowChevronDownIcon } from '../icons/16px';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\n\nimport { ComboBoxMenu } from './ComboBoxMenu';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes';\nimport { styles } from './CustomComboBox.styles';\n\ninterface ComboBoxViewProps<T> extends CommonProps {\n align?: 'left' | 'center' | 'right';\n autoFocus?: boolean;\n borderless?: boolean;\n disablePortal?: boolean;\n disabled?: boolean;\n editing?: boolean;\n error?: boolean;\n items?: Nullable<T[]>;\n loading?: boolean;\n menuAlign?: 'left' | 'right';\n opened?: boolean;\n drawArrow?: boolean;\n placeholder?: string;\n size?: 'small' | 'medium' | 'large';\n textValue?: string;\n totalCount?: number;\n value?: Nullable<T>;\n warning?: boolean;\n width?: string | number;\n maxLength?: number;\n maxMenuHeight?: number | string;\n leftIcon?: InputIconType;\n rightIcon?: InputIconType;\n inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];\n\n onValueChange?: (value: T) => void;\n onClickOutside?: (e: Event) => void;\n onFocus?: () => void;\n onFocusOutside?: () => void;\n onInputBlur?: () => void;\n onInputValueChange?: (value: string) => void;\n onInputFocus?: () => void;\n onInputClick?: () => void;\n onInputKeyDown?: (e: React.KeyboardEvent) => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n renderItem?: (item: T, state: MenuItemState) => React.ReactNode;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderValue?: (item: T) => React.ReactNode;\n renderAddButton: (query?: string) => React.ReactNode;\n repeatRequest?: () => void;\n requestStatus?: ComboBoxRequestStatus;\n refInput?: (input: Nullable<Input>) => void;\n refMenu?: (menu: Nullable<Menu>) => void;\n refInputLikeText?: (inputLikeText: Nullable<InputLikeText>) => void;\n}\n\nexport class ComboBoxView<T> extends React.Component<ComboBoxViewProps<T>> {\n public static __KONTUR_REACT_UI__ = 'ComboBoxView';\n\n public static defaultProps = {\n renderItem: (item: any) => item,\n renderValue: (item: any) => item,\n renderAddButton: () => null,\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n onClickOutside: () => {\n /**/\n },\n onFocusOutside: () => {\n /**/\n },\n size: 'small',\n width: 250,\n };\n\n private input: Nullable<Input>;\n\n public componentDidMount() {\n if (this.props.autoFocus && this.props.onFocus) {\n this.props.onFocus();\n }\n }\n\n public componentDidUpdate(prevProps: ComboBoxViewProps<T>) {\n const { input, props } = this;\n if (props.editing && !prevProps.editing && input) {\n input.focus();\n }\n }\n\n public render() {\n const {\n items,\n loading,\n menuAlign,\n onClickOutside,\n onFocusOutside,\n onMouseEnter,\n onMouseLeave,\n onMouseOver,\n opened,\n refMenu,\n maxMenuHeight,\n renderTotalCount,\n renderItem,\n renderNotFound,\n repeatRequest,\n requestStatus,\n totalCount,\n size,\n width,\n } = this.props;\n\n const input = this.renderInput();\n\n const topOffsets = {\n spinner: 6,\n arrow: 15,\n };\n if (size === 'medium') {\n topOffsets.spinner += 4;\n topOffsets.arrow += 4;\n }\n if (size === 'large') {\n topOffsets.spinner += 6;\n topOffsets.arrow += 6;\n }\n\n return (\n <CommonWrapper {...this.props}>\n <RenderLayer onClickOutside={onClickOutside} onFocusOutside={onFocusOutside} active={opened}>\n <span\n style={{ width }}\n className={styles.root()}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n >\n {input}\n {opened && (\n <DropdownContainer\n align={menuAlign}\n getParent={() => findDOMNode(this)}\n offsetY={1}\n disablePortal={this.props.disablePortal}\n >\n <ComboBoxMenu\n items={items}\n loading={loading}\n maxMenuHeight={maxMenuHeight}\n onValueChange={this.handleItemSelect}\n opened={opened}\n refMenu={refMenu}\n renderTotalCount={renderTotalCount}\n renderItem={renderItem!}\n renderNotFound={renderNotFound}\n renderAddButton={this.renderAddButton}\n repeatRequest={repeatRequest}\n requestStatus={requestStatus}\n totalCount={totalCount}\n />\n </DropdownContainer>\n )}\n </span>\n </RenderLayer>\n </CommonWrapper>\n );\n }\n\n private renderAddButton = (): React.ReactNode => {\n return this.props.renderAddButton(this.props.textValue);\n };\n\n private renderInput(): React.ReactNode {\n const {\n align,\n borderless,\n disabled,\n editing,\n error,\n onFocus,\n onInputBlur,\n onInputValueChange,\n onInputFocus,\n onInputClick,\n onInputKeyDown,\n placeholder,\n renderValue,\n size,\n textValue,\n value,\n warning,\n refInputLikeText,\n leftIcon,\n inputMode,\n } = this.props;\n\n const rightIcon = this.getRightIcon();\n\n if (editing) {\n return (\n <Input\n align={align}\n borderless={borderless}\n disabled={disabled}\n error={error}\n maxLength={this.props.maxLength}\n onBlur={onInputBlur}\n onValueChange={onInputValueChange}\n onFocus={onInputFocus}\n onClick={onInputClick}\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n value={textValue || ''}\n onKeyDown={onInputKeyDown}\n placeholder={placeholder}\n width=\"100%\"\n size={size}\n ref={this.refInput}\n warning={warning}\n inputMode={inputMode}\n />\n );\n }\n\n return (\n <InputLikeText\n align={align}\n borderless={borderless}\n error={error}\n onFocus={onFocus}\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n disabled={disabled}\n warning={warning}\n placeholder={placeholder}\n size={size}\n width=\"100%\"\n ref={refInputLikeText}\n >\n {isNonNullable(value) && renderValue ? renderValue(value) : null}\n </InputLikeText>\n );\n }\n\n private handleItemSelect = (item: T) => {\n if (this.props.onValueChange) {\n this.props.onValueChange(item);\n }\n };\n\n private refInput = (input: Nullable<Input>) => {\n if (this.props.refInput) {\n this.props.refInput(input);\n }\n this.input = input;\n };\n\n private renderSpinner = () => (\n <span className={styles.spinnerWrapper()}>\n <Spinner type=\"mini\" caption=\"\" dimmed />\n </span>\n );\n\n private getRightIcon = () => {\n const { loading, items, drawArrow, rightIcon } = this.props;\n\n if (loading && items && !!items.length) {\n return this.renderSpinner();\n }\n\n if (rightIcon || drawArrow) {\n return <span className={styles.rightIconWrapper()}>{rightIcon ?? <ArrowChevronDownIcon />}</span>;\n }\n\n return null;\n };\n}\n"]}
@@ -2,6 +2,7 @@
2
2
  var _lodash = _interopRequireDefault(require("lodash.debounce"));
3
3
  var _lodash2 = _interopRequireDefault(require("lodash.isequal"));
4
4
 
5
+ var _utils = require("../../lib/utils");
5
6
  var _identifiers = require("../../lib/events/keyboard/identifiers");
6
7
  var LayoutEvents = _interopRequireWildcard(require("../../lib/LayoutEvents"));
7
8
 
@@ -66,7 +67,7 @@ var _CustomComboBoxTypes = require("./CustomComboBoxTypes");
66
67
  var DEBOUNCE_DELAY = 300;
67
68
 
68
69
  var getValueString = function getValueString(value, valueToString) {
69
- return value ? valueToString(value) : '';
70
+ return (0, _utils.isNonNullable)(value) ? valueToString(value) : '';
70
71
  };
71
72
 
72
73
  var Effect = {
@@ -153,7 +154,7 @@ var Effect = {
153
154
  }
154
155
 
155
156
  var index = -1;
156
- if (items && items.length && value) {
157
+ if (items && items.length && (0, _utils.isNonNullable)(value)) {
157
158
  index = items.findIndex(function (x) {return itemToValue(x) === itemToValue(value);});
158
159
  }
159
160
  menu.highlightItem(index);
@@ -1 +1 @@
1
- {"version":3,"sources":["CustomComboBoxReducer.tsx"],"names":["DEBOUNCE_DELAY","getValueString","value","valueToString","Effect","Search","query","dispatch","getState","getProps","getInstance","search","DebouncedSearch","searchEffect","textValue","CancelRequest","cancel","cancelSearch","Blur","onBlur","Focus","onFocus","ValueChange","onValueChange","UnexpectedInput","items","onUnexpectedInput","Array","isArray","length","singleItem","valueContent","type","keepFocus","undefined","InputChange","onInputValueChange","returnedValue","InputFocus","input","focus","HighlightMenuItem","itemToValue","focused","requestStatus","menu","valueString","index","findIndex","x","highlightItem","requestAnimationFrame","scrollToSelected","ComboBoxRequestStatus","Failed","down","SelectMenuItem","event","enter","MoveMenuHighlight","direction","ResetHighlightedMenuItem","combobox","hasHighlightedItem","reset","Reflow","LayoutEvents","emit","SelectInputText","selectInputText","InputKeyDown","onInputKeyDown","never","_","reducer","state","props","action","opened","inputChanged","editing","newState","searchOnFocus","e","effects","nextState","preventDefault","push","prevProps","DefaultState","loading","Pending","shouldResetMenuHighlight","Success","repeatRequest","Unknown"],"mappings":";AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAMA,cAAc,GAAG,GAAvB;;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAAaC,aAAb,EAA0E;AAC/F,SAAOD,KAAK,GAAGC,aAAa,CAACD,KAAD,CAAhB,GAA0B,EAAtC;AACD,CAFD;;AAIO,IAAME,MAAqB,GAAG;AACnCC,EAAAA,MAAM,EAAE,gBAACC,KAAD,UAAW,UAACC,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EAA+BC,WAA/B,EAA+C;AAChEA,MAAAA,WAAW,GAAGC,MAAd,CAAqBL,KAArB;AACD,KAFO,EAD2B;AAInCM,EAAAA,eAAe,EAAE,qBAAS,UAACL,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EAA+BC,WAA/B,EAA+C;AACvE,QAAMG,YAAY,GAAGT,MAAM,CAACC,MAAP,CAAcG,QAAQ,GAAGM,SAAzB,CAArB;AACAD,IAAAA,YAAY,CAACN,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EAA+BC,WAA/B,CAAZ;AACD,GAHgB,EAGdV,cAHc,CAJkB;AAQnCe,EAAAA,aAAa,EAAE,uBAACR,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EAA+BC,WAA/B,EAA+C;AAC5DN,IAAAA,MAAM,CAACQ,eAAP,CAAuBI,MAAvB;AACAN,IAAAA,WAAW,GAAGO,YAAd;AACD,GAXkC;AAYnCC,EAAAA,IAAI,EAAE,cAACX,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EAAkC;AACnBA,IAAAA,QAAQ,EADW,CAC9BU,MAD8B,aAC9BA,MAD8B;AAEtC,QAAIA,MAAJ,EAAY;AACV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AAK,gBAAL,CAAuB;AACrB,eAAO;AACL;AACEyB,UAAAA,OAAO,EAAE,KADX;AAEEZ,UAAAA,MAAM,EAAE,IAFV;AAGErD,UAAAA,KAAK,EAAE,IAHT;AAIEmB,UAAAA,aAAa,EAAES,2CAAsBC,MAJvC;AAKEwC,UAAAA,aAAa,EAAEjB,MAAM,CAACiB,aALxB,EADK;;AAQL,SAAC1F,MAAM,CAACqC,iBAAR,CARK,CAAP;;AAUD;AACD,SAAK,eAAL,CAAsB;AACpB,eAAO;AACLiD,UAAAA,OAAO,EAAE,KADJ;AAEL9C,UAAAA,aAAa,EAAES,2CAAsB0C,OAFhC,EAAP;;AAID;AACD,YAAS;AACPvB,QAAAA,KAAK,CAACK,MAAD,CAAL;AACD,OAnLH;;AAqLA,SAAOF,KAAP;AACD","sourcesContent":["import React from 'react';\nimport debounce from 'lodash.debounce';\nimport isEqual from 'lodash.isequal';\n\nimport { isKeyArrowUp, isKeyArrowVertical, isKeyEnter, isKeyEscape } from '../../lib/events/keyboard/identifiers';\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { Nullable } from '../../typings/utility-types';\n\nimport { CustomComboBox, CustomComboBoxProps, CustomComboBoxState, DefaultState } from './CustomComboBox';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes';\n\nexport type CustomComboBoxAction<T> =\n | { type: 'ValueChange'; value: T; keepFocus: boolean }\n | { type: 'TextChange'; value: string }\n | { type: 'KeyPress'; event: React.KeyboardEvent }\n | {\n type: 'DidUpdate';\n prevProps: CustomComboBoxProps<T>;\n prevState: CustomComboBoxState<T>;\n }\n | { type: 'Mount' }\n | { type: 'Focus' }\n | { type: 'InputClick' }\n | { type: 'Blur' }\n | { type: 'Reset' }\n | { type: 'Open' }\n | { type: 'Close' }\n | { type: 'Search'; query: string }\n | { type: 'RequestItems' }\n | { type: 'ReceiveItems'; items: T[] }\n | { type: 'RequestFailure'; repeatRequest: () => void }\n | { type: 'CancelRequest' };\n\nexport type CustomComboBoxEffect<T> = (\n dispatch: (action: CustomComboBoxAction<T>) => void,\n getState: () => CustomComboBoxState<T>,\n getProps: () => CustomComboBoxProps<T>,\n getInstance: () => CustomComboBox<T>,\n) => void;\n\ntype Effect = CustomComboBoxEffect<any>;\n\ninterface EffectFactory {\n Search: (query: string) => Effect;\n DebouncedSearch: Effect & {\n cancel(): void;\n flush(): void;\n };\n CancelRequest: Effect;\n Blur: Effect;\n Focus: Effect;\n\n ValueChange: (value: any) => Effect;\n UnexpectedInput: (textValue: string, items: Nullable<any[]>) => Effect;\n InputChange: Effect;\n InputFocus: Effect;\n HighlightMenuItem: Effect;\n SelectMenuItem: (event: React.KeyboardEvent<HTMLElement>) => Effect;\n InputKeyDown: (event: React.KeyboardEvent<HTMLElement>) => Effect;\n MoveMenuHighlight: (direction: 'up' | 'down') => Effect;\n ResetHighlightedMenuItem: Effect;\n Reflow: Effect;\n SelectInputText: Effect;\n}\n\nconst DEBOUNCE_DELAY = 300;\n\nconst getValueString = (value: any, valueToString: CustomComboBoxProps<any>['valueToString']) => {\n return value ? valueToString(value) : '';\n};\n\nexport const Effect: EffectFactory = {\n Search: (query) => (dispatch, getState, getProps, getInstance) => {\n getInstance().search(query);\n },\n DebouncedSearch: debounce((dispatch, getState, getProps, getInstance) => {\n const searchEffect = Effect.Search(getState().textValue);\n searchEffect(dispatch, getState, getProps, getInstance);\n }, DEBOUNCE_DELAY),\n CancelRequest: (dispatch, getState, getProps, getInstance) => {\n Effect.DebouncedSearch.cancel();\n getInstance().cancelSearch();\n },\n Blur: (dispatch, getState, getProps) => {\n const { onBlur } = getProps();\n if (onBlur) {\n onBlur();\n }\n },\n Focus: (dispatch, getState, getProps) => {\n const { onFocus } = getProps();\n if (onFocus) {\n onFocus();\n }\n },\n ValueChange: (value) => (dispatch, getState, getProps) => {\n const { onValueChange } = getProps();\n if (onValueChange) {\n onValueChange(value);\n }\n },\n UnexpectedInput: (textValue, items) => (dispatch, getState, getProps) => {\n const { onUnexpectedInput, valueToString } = getProps();\n\n if (Array.isArray(items) && items.length === 1) {\n const singleItem = items[0];\n const valueContent = getValueString(singleItem, valueToString);\n\n if (valueContent === textValue) {\n dispatch({ type: 'ValueChange', value: singleItem, keepFocus: false });\n return;\n }\n }\n\n if (onUnexpectedInput) {\n const value = onUnexpectedInput(textValue);\n if (value !== undefined) {\n dispatch({ type: 'ValueChange', value, keepFocus: false });\n }\n }\n },\n InputChange: (dispatch, getState, getProps) => {\n const { onInputValueChange } = getProps();\n const { textValue } = getState();\n if (onInputValueChange) {\n const returnedValue = onInputValueChange(textValue);\n if (typeof returnedValue === 'string' && returnedValue !== textValue) {\n dispatch({ type: 'TextChange', value: returnedValue });\n }\n }\n },\n InputFocus: (dispatch, getState, getProps, getInstance) => {\n const { input } = getInstance();\n\n if (!input) {\n return;\n }\n\n input.focus();\n },\n HighlightMenuItem: (dispatch, getState, getProps, getInstance) => {\n const { value, itemToValue, valueToString } = getProps();\n const { items, focused, textValue, requestStatus } = getState();\n const { menu } = getInstance();\n const valueString = getValueString(value, valueToString);\n\n if (!menu) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n let index = -1;\n if (items && items.length && value) {\n index = items.findIndex((x) => itemToValue(x) === itemToValue(value));\n }\n menu.highlightItem(index);\n\n if (index >= 0) {\n // FIXME: accessing private props\n // @ts-ignore\n requestAnimationFrame(() => menu && menu.scrollToSelected());\n return;\n }\n\n if (textValue !== valueString || requestStatus === ComboBoxRequestStatus.Failed) {\n requestAnimationFrame(() => menu && menu.down());\n }\n },\n SelectMenuItem: (event) => (dispatch, getState, getProps, getInstance) => {\n const { menu } = getInstance();\n if (menu) {\n menu.enter(event);\n }\n },\n MoveMenuHighlight: (direction) => (dispatch, getState, getProps, getInstance) => {\n const { menu } = getInstance();\n if (menu) {\n menu[direction]();\n }\n },\n ResetHighlightedMenuItem: (dispatch, getState, getProps, getInstance) => {\n const combobox = getInstance();\n\n if (combobox.menu && combobox.menu.hasHighlightedItem()) {\n combobox.menu.reset();\n }\n },\n Reflow: () => {\n LayoutEvents.emit();\n },\n SelectInputText: (dispatch, getState, getProps, getInstance) => {\n const combobox = getInstance();\n combobox.selectInputText();\n },\n InputKeyDown: (event) => (dispatch, getState, getProps, getInstance) => {\n const { onInputKeyDown } = getProps();\n if (onInputKeyDown) {\n onInputKeyDown(event);\n }\n },\n};\n\nconst never = (_: never) => null;\n\nexport function reducer<T>(\n state: CustomComboBoxState<T>,\n props: CustomComboBoxProps<T>,\n action: CustomComboBoxAction<T>,\n): Pick<CustomComboBoxState<T>, never> | [Pick<CustomComboBoxState<T>, never>, Array<CustomComboBoxEffect<T>>] {\n switch (action.type) {\n case 'ValueChange': {\n const { value, keepFocus } = action;\n const textValue = getValueString(value, props.valueToString);\n if (keepFocus) {\n return [\n {\n opened: false,\n inputChanged: false,\n editing: true,\n items: null,\n textValue,\n },\n [Effect.ValueChange(value), Effect.CancelRequest, Effect.InputFocus],\n ];\n }\n return [\n {\n opened: false,\n inputChanged: false,\n editing: false,\n items: null,\n textValue,\n },\n [Effect.ValueChange(value), Effect.CancelRequest],\n ];\n }\n case 'TextChange': {\n const newState = {\n inputChanged: true,\n textValue: action.value,\n };\n if (!action.value && !props.searchOnFocus) {\n return [\n {\n ...newState,\n opened: false,\n items: null,\n },\n [Effect.InputChange],\n ];\n }\n return [newState, [Effect.DebouncedSearch, Effect.InputChange]];\n }\n case 'KeyPress': {\n const e = action.event as React.KeyboardEvent<HTMLElement>;\n const effects = [];\n let nextState = state;\n\n switch (true) {\n case isKeyEnter(e):\n e.preventDefault();\n effects.push(Effect.SelectMenuItem(e));\n break;\n case isKeyArrowVertical(e):\n e.preventDefault();\n effects.push(Effect.MoveMenuHighlight(isKeyArrowUp(e) ? 'up' : 'down'));\n if (!state.opened) {\n effects.push(Effect.Search(state.textValue));\n }\n break;\n case isKeyEscape(e):\n nextState = {\n ...state,\n items: null,\n opened: false,\n };\n break;\n }\n return [nextState, [...effects, Effect.InputKeyDown(e)]];\n }\n case 'DidUpdate': {\n if (isEqual(props.value, action.prevProps.value)) {\n return state;\n }\n\n return {\n opened: false,\n textValue: state.editing ? state.textValue : getValueString(props.value, props.valueToString),\n };\n }\n case 'Mount': {\n return {\n textValue: getValueString(props.value, props.valueToString),\n };\n }\n case 'Focus': {\n const newState = {\n focused: true,\n editing: true,\n };\n if (!props.searchOnFocus) {\n return [newState, [Effect.Focus]];\n }\n if (state.editing) {\n return [newState, [Effect.Search(state.textValue), Effect.Focus]];\n }\n return [newState, [Effect.Search(''), Effect.Focus, Effect.SelectInputText]];\n }\n case 'InputClick': {\n if (!state.opened && props.searchOnFocus) {\n return [state, [Effect.Search('')]];\n }\n return state;\n }\n case 'Blur': {\n const { inputChanged, items } = state;\n if (!inputChanged) {\n return [\n {\n focused: false,\n opened: false,\n items: null,\n editing: false,\n },\n [Effect.Blur, Effect.CancelRequest],\n ];\n }\n\n return [\n {\n focused: false,\n opened: false,\n items: null,\n },\n [Effect.Blur, Effect.CancelRequest, Effect.UnexpectedInput(state.textValue, items)],\n ];\n }\n case 'Reset': {\n return DefaultState;\n }\n case 'Open': {\n return { opened: true };\n }\n case 'Close': {\n return { opened: false, items: null };\n }\n case 'Search': {\n return [state, [Effect.Search(action.query)]];\n }\n case 'RequestItems': {\n return {\n loading: true,\n opened: true,\n requestStatus: ComboBoxRequestStatus.Pending,\n };\n }\n case 'ReceiveItems': {\n const shouldResetMenuHighlight = state.textValue === '';\n return [\n {\n loading: false,\n opened: true,\n items: action.items,\n requestStatus: ComboBoxRequestStatus.Success,\n },\n [shouldResetMenuHighlight ? Effect.ResetHighlightedMenuItem : Effect.HighlightMenuItem, Effect.Reflow],\n ];\n }\n case 'RequestFailure': {\n return [\n {\n loading: false,\n opened: true,\n items: null,\n requestStatus: ComboBoxRequestStatus.Failed,\n repeatRequest: action.repeatRequest,\n },\n [Effect.HighlightMenuItem],\n ];\n }\n case 'CancelRequest': {\n return {\n loading: false,\n requestStatus: ComboBoxRequestStatus.Unknown,\n };\n }\n default: {\n never(action);\n }\n }\n return state;\n}\n"]}
1
+ {"version":3,"sources":["CustomComboBoxReducer.tsx"],"names":["DEBOUNCE_DELAY","getValueString","value","valueToString","Effect","Search","query","dispatch","getState","getProps","getInstance","search","DebouncedSearch","searchEffect","textValue","CancelRequest","cancel","cancelSearch","Blur","onBlur","Focus","onFocus","ValueChange","onValueChange","UnexpectedInput","items","onUnexpectedInput","Array","isArray","length","singleItem","valueContent","type","keepFocus","undefined","InputChange","onInputValueChange","returnedValue","InputFocus","input","focus","HighlightMenuItem","itemToValue","focused","requestStatus","menu","valueString","index","findIndex","x","highlightItem","requestAnimationFrame","scrollToSelected","ComboBoxRequestStatus","Failed","down","SelectMenuItem","event","enter","MoveMenuHighlight","direction","ResetHighlightedMenuItem","combobox","hasHighlightedItem","reset","Reflow","LayoutEvents","emit","SelectInputText","selectInputText","InputKeyDown","onInputKeyDown","never","_","reducer","state","props","action","opened","inputChanged","editing","newState","searchOnFocus","e","effects","nextState","preventDefault","push","prevProps","DefaultState","loading","Pending","shouldResetMenuHighlight","Success","repeatRequest","Unknown"],"mappings":";AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAMA,cAAc,GAAG,GAAvB;;AAEA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAAaC,aAAb,EAA0E;AAC/F,SAAO,0BAAcD,KAAd,IAAuBC,aAAa,CAACD,KAAD,CAApC,GAA8C,EAArD;AACD,CAFD;;AAIO,IAAME,MAAqB,GAAG;AACnCC,EAAAA,MAAM,EAAE,gBAACC,KAAD,UAAW,UAACC,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EAA+BC,WAA/B,EAA+C;AAChEA,MAAAA,WAAW,GAAGC,MAAd,CAAqBL,KAArB;AACD,KAFO,EAD2B;AAInCM,EAAAA,eAAe,EAAE,qBAAS,UAACL,QAAD,EAAWC,QAAX,EAAqBC,QAArB,EA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R,CAAP;AACD;AACD,SAAK,cAAL,CAAqB;AACnB,eAAO;AACLoF,UAAAA,OAAO,EAAE,IADJ;AAELZ,UAAAA,MAAM,EAAE,IAFH;AAGLlC,UAAAA,aAAa,EAAES,2CAAsBsC,OAHhC,EAAP;;AAKD;AACD,SAAK,cAAL,CAAqB;AACnB,YAAMC,wBAAwB,GAAGjB,KAAK,CAAC7D,SAAN,KAAoB,EAArD;AACA,eAAO;AACL;AACE4E,UAAAA,OAAO,EAAE,KADX;AAEEZ,UAAAA,MAAM,EAAE,IAFV;AAGErD,UAAAA,KAAK,EAAEoD,MAAM,CAACpD,KAHhB;AAIEmB,UAAAA,aAAa,EAAES,2CAAsBwC,OAJvC,EADK;;AAOL,SAACD,wBAAwB,GAAGxF,MAAM,CAACyD,wBAAV,GAAqCzD,MAAM,CAACqC,iBAArE,EAAwFrC,MAAM,CAAC6D,MAA/F,CAPK,CAAP;;AASD;AACD,SAAK,gBAAL,CAAuB;AACrB,eAAO;AACL;AACEyB,UAAAA,OAAO,EAAE,KADX;AAEEZ,UAAAA,MAAM,EAAE,IAFV;AAGErD,UAAAA,KAAK,EAAE,IAHT;AAIEmB,UAAAA,aAAa,EAAES,2CAAsBC,MAJvC;AAKEwC,UAAAA,aAAa,EAAEjB,MAAM,CAACiB,aALxB,EADK;;AAQL,SAAC1F,MAAM,CAACqC,iBAAR,CARK,CAAP;;AAUD;AACD,SAAK,eAAL,CAAsB;AACpB,eAAO;AACLiD,UAAAA,OAAO,EAAE,KADJ;AAEL9C,UAAAA,aAAa,EAAES,2CAAsB0C,OAFhC,EAAP;;AAID;AACD,YAAS;AACPvB,QAAAA,KAAK,CAACK,MAAD,CAAL;AACD,OAnLH;;AAqLA,SAAOF,KAAP;AACD","sourcesContent":["import React from 'react';\nimport debounce from 'lodash.debounce';\nimport isEqual from 'lodash.isequal';\n\nimport { isNonNullable } from '../../lib/utils';\nimport { isKeyArrowUp, isKeyArrowVertical, isKeyEnter, isKeyEscape } from '../../lib/events/keyboard/identifiers';\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { Nullable } from '../../typings/utility-types';\n\nimport { CustomComboBox, CustomComboBoxProps, CustomComboBoxState, DefaultState } from './CustomComboBox';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes';\n\nexport type CustomComboBoxAction<T> =\n | { type: 'ValueChange'; value: T; keepFocus: boolean }\n | { type: 'TextChange'; value: string }\n | { type: 'KeyPress'; event: React.KeyboardEvent }\n | {\n type: 'DidUpdate';\n prevProps: CustomComboBoxProps<T>;\n prevState: CustomComboBoxState<T>;\n }\n | { type: 'Mount' }\n | { type: 'Focus' }\n | { type: 'InputClick' }\n | { type: 'Blur' }\n | { type: 'Reset' }\n | { type: 'Open' }\n | { type: 'Close' }\n | { type: 'Search'; query: string }\n | { type: 'RequestItems' }\n | { type: 'ReceiveItems'; items: T[] }\n | { type: 'RequestFailure'; repeatRequest: () => void }\n | { type: 'CancelRequest' };\n\nexport type CustomComboBoxEffect<T> = (\n dispatch: (action: CustomComboBoxAction<T>) => void,\n getState: () => CustomComboBoxState<T>,\n getProps: () => CustomComboBoxProps<T>,\n getInstance: () => CustomComboBox<T>,\n) => void;\n\ntype Effect = CustomComboBoxEffect<any>;\n\ninterface EffectFactory {\n Search: (query: string) => Effect;\n DebouncedSearch: Effect & {\n cancel(): void;\n flush(): void;\n };\n CancelRequest: Effect;\n Blur: Effect;\n Focus: Effect;\n\n ValueChange: (value: any) => Effect;\n UnexpectedInput: (textValue: string, items: Nullable<any[]>) => Effect;\n InputChange: Effect;\n InputFocus: Effect;\n HighlightMenuItem: Effect;\n SelectMenuItem: (event: React.KeyboardEvent<HTMLElement>) => Effect;\n InputKeyDown: (event: React.KeyboardEvent<HTMLElement>) => Effect;\n MoveMenuHighlight: (direction: 'up' | 'down') => Effect;\n ResetHighlightedMenuItem: Effect;\n Reflow: Effect;\n SelectInputText: Effect;\n}\n\nconst DEBOUNCE_DELAY = 300;\n\nconst getValueString = (value: any, valueToString: CustomComboBoxProps<any>['valueToString']) => {\n return isNonNullable(value) ? valueToString(value) : '';\n};\n\nexport const Effect: EffectFactory = {\n Search: (query) => (dispatch, getState, getProps, getInstance) => {\n getInstance().search(query);\n },\n DebouncedSearch: debounce((dispatch, getState, getProps, getInstance) => {\n const searchEffect = Effect.Search(getState().textValue);\n searchEffect(dispatch, getState, getProps, getInstance);\n }, DEBOUNCE_DELAY),\n CancelRequest: (dispatch, getState, getProps, getInstance) => {\n Effect.DebouncedSearch.cancel();\n getInstance().cancelSearch();\n },\n Blur: (dispatch, getState, getProps) => {\n const { onBlur } = getProps();\n if (onBlur) {\n onBlur();\n }\n },\n Focus: (dispatch, getState, getProps) => {\n const { onFocus } = getProps();\n if (onFocus) {\n onFocus();\n }\n },\n ValueChange: (value) => (dispatch, getState, getProps) => {\n const { onValueChange } = getProps();\n if (onValueChange) {\n onValueChange(value);\n }\n },\n UnexpectedInput: (textValue, items) => (dispatch, getState, getProps) => {\n const { onUnexpectedInput, valueToString } = getProps();\n\n if (Array.isArray(items) && items.length === 1) {\n const singleItem = items[0];\n const valueContent = getValueString(singleItem, valueToString);\n\n if (valueContent === textValue) {\n dispatch({ type: 'ValueChange', value: singleItem, keepFocus: false });\n return;\n }\n }\n\n if (onUnexpectedInput) {\n const value = onUnexpectedInput(textValue);\n if (value !== undefined) {\n dispatch({ type: 'ValueChange', value, keepFocus: false });\n }\n }\n },\n InputChange: (dispatch, getState, getProps) => {\n const { onInputValueChange } = getProps();\n const { textValue } = getState();\n if (onInputValueChange) {\n const returnedValue = onInputValueChange(textValue);\n if (typeof returnedValue === 'string' && returnedValue !== textValue) {\n dispatch({ type: 'TextChange', value: returnedValue });\n }\n }\n },\n InputFocus: (dispatch, getState, getProps, getInstance) => {\n const { input } = getInstance();\n\n if (!input) {\n return;\n }\n\n input.focus();\n },\n HighlightMenuItem: (dispatch, getState, getProps, getInstance) => {\n const { value, itemToValue, valueToString } = getProps();\n const { items, focused, textValue, requestStatus } = getState();\n const { menu } = getInstance();\n const valueString = getValueString(value, valueToString);\n\n if (!menu) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n let index = -1;\n if (items && items.length && isNonNullable(value)) {\n index = items.findIndex((x) => itemToValue(x) === itemToValue(value));\n }\n menu.highlightItem(index);\n\n if (index >= 0) {\n // FIXME: accessing private props\n // @ts-ignore\n requestAnimationFrame(() => menu && menu.scrollToSelected());\n return;\n }\n\n if (textValue !== valueString || requestStatus === ComboBoxRequestStatus.Failed) {\n requestAnimationFrame(() => menu && menu.down());\n }\n },\n SelectMenuItem: (event) => (dispatch, getState, getProps, getInstance) => {\n const { menu } = getInstance();\n if (menu) {\n menu.enter(event);\n }\n },\n MoveMenuHighlight: (direction) => (dispatch, getState, getProps, getInstance) => {\n const { menu } = getInstance();\n if (menu) {\n menu[direction]();\n }\n },\n ResetHighlightedMenuItem: (dispatch, getState, getProps, getInstance) => {\n const combobox = getInstance();\n\n if (combobox.menu && combobox.menu.hasHighlightedItem()) {\n combobox.menu.reset();\n }\n },\n Reflow: () => {\n LayoutEvents.emit();\n },\n SelectInputText: (dispatch, getState, getProps, getInstance) => {\n const combobox = getInstance();\n combobox.selectInputText();\n },\n InputKeyDown: (event) => (dispatch, getState, getProps, getInstance) => {\n const { onInputKeyDown } = getProps();\n if (onInputKeyDown) {\n onInputKeyDown(event);\n }\n },\n};\n\nconst never = (_: never) => null;\n\nexport function reducer<T>(\n state: CustomComboBoxState<T>,\n props: CustomComboBoxProps<T>,\n action: CustomComboBoxAction<T>,\n): Pick<CustomComboBoxState<T>, never> | [Pick<CustomComboBoxState<T>, never>, Array<CustomComboBoxEffect<T>>] {\n switch (action.type) {\n case 'ValueChange': {\n const { value, keepFocus } = action;\n const textValue = getValueString(value, props.valueToString);\n if (keepFocus) {\n return [\n {\n opened: false,\n inputChanged: false,\n editing: true,\n items: null,\n textValue,\n },\n [Effect.ValueChange(value), Effect.CancelRequest, Effect.InputFocus],\n ];\n }\n return [\n {\n opened: false,\n inputChanged: false,\n editing: false,\n items: null,\n textValue,\n },\n [Effect.ValueChange(value), Effect.CancelRequest],\n ];\n }\n case 'TextChange': {\n const newState = {\n inputChanged: true,\n textValue: action.value,\n };\n if (!action.value && !props.searchOnFocus) {\n return [\n {\n ...newState,\n opened: false,\n items: null,\n },\n [Effect.InputChange],\n ];\n }\n return [newState, [Effect.DebouncedSearch, Effect.InputChange]];\n }\n case 'KeyPress': {\n const e = action.event as React.KeyboardEvent<HTMLElement>;\n const effects = [];\n let nextState = state;\n\n switch (true) {\n case isKeyEnter(e):\n e.preventDefault();\n effects.push(Effect.SelectMenuItem(e));\n break;\n case isKeyArrowVertical(e):\n e.preventDefault();\n effects.push(Effect.MoveMenuHighlight(isKeyArrowUp(e) ? 'up' : 'down'));\n if (!state.opened) {\n effects.push(Effect.Search(state.textValue));\n }\n break;\n case isKeyEscape(e):\n nextState = {\n ...state,\n items: null,\n opened: false,\n };\n break;\n }\n return [nextState, [...effects, Effect.InputKeyDown(e)]];\n }\n case 'DidUpdate': {\n if (isEqual(props.value, action.prevProps.value)) {\n return state;\n }\n\n return {\n opened: false,\n textValue: state.editing ? state.textValue : getValueString(props.value, props.valueToString),\n };\n }\n case 'Mount': {\n return {\n textValue: getValueString(props.value, props.valueToString),\n };\n }\n case 'Focus': {\n const newState = {\n focused: true,\n editing: true,\n };\n if (!props.searchOnFocus) {\n return [newState, [Effect.Focus]];\n }\n if (state.editing) {\n return [newState, [Effect.Search(state.textValue), Effect.Focus]];\n }\n return [newState, [Effect.Search(''), Effect.Focus, Effect.SelectInputText]];\n }\n case 'InputClick': {\n if (!state.opened && props.searchOnFocus) {\n return [state, [Effect.Search('')]];\n }\n return state;\n }\n case 'Blur': {\n const { inputChanged, items } = state;\n if (!inputChanged) {\n return [\n {\n focused: false,\n opened: false,\n items: null,\n editing: false,\n },\n [Effect.Blur, Effect.CancelRequest],\n ];\n }\n\n return [\n {\n focused: false,\n opened: false,\n items: null,\n },\n [Effect.Blur, Effect.CancelRequest, Effect.UnexpectedInput(state.textValue, items)],\n ];\n }\n case 'Reset': {\n return DefaultState;\n }\n case 'Open': {\n return { opened: true };\n }\n case 'Close': {\n return { opened: false, items: null };\n }\n case 'Search': {\n return [state, [Effect.Search(action.query)]];\n }\n case 'RequestItems': {\n return {\n loading: true,\n opened: true,\n requestStatus: ComboBoxRequestStatus.Pending,\n };\n }\n case 'ReceiveItems': {\n const shouldResetMenuHighlight = state.textValue === '';\n return [\n {\n loading: false,\n opened: true,\n items: action.items,\n requestStatus: ComboBoxRequestStatus.Success,\n },\n [shouldResetMenuHighlight ? Effect.ResetHighlightedMenuItem : Effect.HighlightMenuItem, Effect.Reflow],\n ];\n }\n case 'RequestFailure': {\n return [\n {\n loading: false,\n opened: true,\n items: null,\n requestStatus: ComboBoxRequestStatus.Failed,\n repeatRequest: action.repeatRequest,\n },\n [Effect.HighlightMenuItem],\n ];\n }\n case 'CancelRequest': {\n return {\n loading: false,\n requestStatus: ComboBoxRequestStatus.Unknown,\n };\n }\n default: {\n never(action);\n }\n }\n return state;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.InputLikeText = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
 
3
+ var _utils = require("../../lib/utils");
3
4
  var _identifiers = require("../../lib/events/keyboard/identifiers");
4
5
  var _MouseDrag = require("../../lib/events/MouseDrag");
5
6
  var _client = require("../../lib/client");
@@ -305,7 +306,7 @@ InputLikeText = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.de
305
306
  _this.props,children = _this$props3.children,placeholder = _this$props3.placeholder,disabled = _this$props3.disabled;var
306
307
  focused = _this.state.focused;
307
308
 
308
- if (!children && placeholder) {var _cx7;
309
+ if (!(0, _utils.isNonNullable)(children) && placeholder) {var _cx7;
309
310
  return /*#__PURE__*/(
310
311
  _react.default.createElement("span", {
311
312
  className: (0, _Emotion.cx)(_Input.styles.placeholder(_this.theme), (_cx7 = {}, _cx7[
@@ -1 +1 @@
1
- {"version":3,"sources":["InputLikeText.tsx"],"names":["InputLikeText","state","blinking","focused","theme","node","hiddenInput","lastSelectedInnerNode","frozen","frozenBlur","dragging","focusTimeout","blinkTimeout","selectInnerNode","start","end","isIE11","document","body","setTimeout","clearInterval","window","isEdge","focus","renderMain","props","innerRef","tabIndex","placeholder","align","borderless","width","size","error","warning","onValueChange","disabled","prefix","suffix","leftIcon","rightIcon","value","onMouseDragStart","onMouseDragEnd","rest","leftSide","renderLeftSide","rightSide","renderRightSide","className","styles","root","jsInputStyles","getSizeClassName","blink","focusFallback","warningFallback","errorFallback","hideBlinkingCursor","isMobile","wrapperClass","wrapper","userSelectContain","textAlign","undefined","handleFocus","handleBlur","handleKeyDown","handleMouseDown","input","inputFocus","inputDisabled","children","renderPlaceholder","hiddenInputRef","renderLeftIcon","renderIcon","getIconClassname","renderRightIcon","icon","iconNode","Function","useDefaultColor","iconDisabled","renderPrefix","prefixDisabled","renderSuffix","suffixDisabled","sideContainer","rightContainer","placeholderDisabled","placeholderFocus","handleDocumentMouseDown","e","target","Node","contains","defrost","handleDocumentKeyDown","onKeyDown","handleMouseDragStart","documentElement","classList","add","userSelectNone","handleMouseDragEnd","remove","setAttribute","setState","onFocus","removeAttribute","stopPropagation","onBlur","el","sizeLarge","sizeLargeFallback","sizeMedium","sizeMediumFallback","sizeSmall","sizeSmallFallback","blur","getNode","componentDidMount","MouseDrag","listen","addEventListener","componentWillUnmount","clearTimeout","stop","removeEventListener","render","right","rightIconLarge","leftIconLarge","rightIconMedium","leftIconMedium","rightIconSmall","leftIconSmall","React","Component","__KONTUR_REACT_UI__","defaultProps"],"mappings":"ucAAA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;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A7B,EAA0C,KAAKrC,uBAA/C,EACA3E,QAAQ,CAACgH,mBAAT,CAA6B,SAA7B,EAAwC,KAAK/B,qBAA7C,EACD,C,QAEMgC,M,GAAP,kBAAgB,mBACd,oBACE,6BAAC,0BAAD,CAAc,QAAd,QACG,UAAC9H,KAAD,EAAW,CACV,MAAI,CAACA,KAAL,GAAaA,KAAb,CACA,oBAAO,6BAAC,4BAAD,EAAmB,MAAI,CAACqB,KAAxB,EAAgC,MAAI,CAACD,UAArC,CAAP,CACD,CAJH,CADF,CAQD,C,QA+EOqD,gB,GAAR,0BAAyBsD,KAAzB,EAAwC,KAAfA,KAAe,cAAfA,KAAe,GAAP,KAAO,EACtC,QAAQ,KAAK1G,KAAL,CAAWO,IAAnB,GACE,KAAK,OAAL,CACE,OAAOmG,KAAK,GAAG/E,cAAcgF,cAAd,CAA6B,KAAKhI,KAAlC,CAAH,GAA8CgD,cAAciF,aAAd,CAA4B,KAAKjI,KAAjC,CAA1D,CACF,KAAK,QAAL,CACE,OAAO+H,KAAK,GAAG/E,cAAckF,eAAd,CAA8B,KAAKlI,KAAnC,CAAH,GAA+CgD,cAAcmF,cAAd,CAA6B,KAAKnI,KAAlC,CAA3D,CACF,KAAK,OAAL,CACA,QACE,OAAO+H,KAAK,GAAG/E,cAAcoF,cAAd,CAA6B,KAAKpI,KAAlC,CAAH,GAA8CgD,cAAcqF,aAAd,CAA4B,KAAKrI,KAAjC,CAA1D,CAPJ,CASD,C,wBAzLgCsI,eAAMC,S,wCAA5B3I,a,CACG4I,mB,GAAsB,e,CADzB5I,a,CAGG6I,Y,GAAe,EAAE7G,IAAI,EAAE,OAAR,E","sourcesContent":["import React from 'react';\n\nimport { isKeyTab, isShortcutPaste } from '../../lib/events/keyboard/identifiers';\nimport { MouseDrag, MouseDragEventHandler } from '../../lib/events/MouseDrag';\nimport { isEdge, isIE11, isMobile } from '../../lib/client';\nimport { Nullable } from '../../typings/utility-types';\nimport { removeAllSelections, selectNodeContents } from '../../components/DateInput/helpers/SelectionHelpers';\nimport { InputProps, InputIconType, InputState } from '../../components/Input';\nimport { styles as jsInputStyles } from '../../components/Input/Input.styles';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { Theme } from '../../lib/theming/Theme';\nimport { CommonProps, CommonWrapper, CommonWrapperRestProps } from '../CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { findRenderContainer } from '../../lib/listenFocusOutside';\n\nimport { styles } from './InputLikeText.styles';\nimport { HiddenInput } from './HiddenInput';\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}\n\nexport type InputLikeTextState = Omit<InputState, 'polyfillPlaceholder'>;\n\nexport class InputLikeText extends React.Component<InputLikeTextProps, InputLikeTextState> {\n public static __KONTUR_REACT_UI__ = 'InputLikeText';\n\n public static defaultProps = { size: 'small' };\n\n public state = { blinking: false, focused: false };\n\n private theme!: Theme;\n private node: HTMLElement | null = null;\n private hiddenInput: HTMLInputElement | null = null;\n private lastSelectedInnerNode: [HTMLElement, number, number] | null = null;\n private frozen = false;\n private frozenBlur = false;\n private dragging = false;\n private focusTimeout: Nullable<number>;\n private blinkTimeout: Nullable<number>;\n\n /**\n * @public\n */\n public focus() {\n if (this.node) {\n this.node.focus();\n }\n }\n\n /**\n * @public\n */\n public blur() {\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 this.setState({ blinking: true }, () => {\n this.blinkTimeout = window.setTimeout(() => this.setState({ blinking: false }), 150);\n });\n }\n\n public getNode(): HTMLElement | null {\n return this.node;\n }\n\n public selectInnerNode = (node: HTMLElement | null, start = 0, end = 1) => {\n if (this.dragging || !node) {\n return;\n }\n if (isIE11 && findRenderContainer(node, document.body)) {\n // Code below causes Popup to close after triggering the focus event on the body in IE11\n return;\n }\n this.frozen = true;\n this.frozenBlur = true;\n\n this.lastSelectedInnerNode = [node, start, end];\n setTimeout(() => selectNodeContents(node, start, end), 0);\n if (this.focusTimeout) {\n clearInterval(this.focusTimeout);\n }\n this.focusTimeout = window.setTimeout(() => (isIE11 || isEdge) && this.node && this.node.focus(), 0);\n };\n\n public componentDidMount() {\n if (this.node) {\n MouseDrag.listen(this.node).onMouseDragStart(this.handleMouseDragStart).onMouseDragEnd(this.handleMouseDragEnd);\n }\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n public componentWillUnmount() {\n if (this.blinkTimeout) {\n clearTimeout(this.blinkTimeout);\n }\n MouseDrag.stop(this.node);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return <CommonWrapper {...this.props}>{this.renderMain}</CommonWrapper>;\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 size,\n error,\n warning,\n onValueChange,\n disabled,\n prefix,\n suffix,\n leftIcon,\n rightIcon,\n value,\n onMouseDragStart,\n onMouseDragEnd,\n ...rest\n } = props;\n\n const { focused, blinking } = this.state;\n\n const leftSide = this.renderLeftSide();\n const rightSide = this.renderRightSide();\n\n const className = cx(styles.root(), jsInputStyles.root(this.theme), this.getSizeClassName(), {\n [jsInputStyles.focus(this.theme)]: focused,\n [jsInputStyles.blink(this.theme)]: blinking,\n [jsInputStyles.warning(this.theme)]: !!warning,\n [jsInputStyles.error(this.theme)]: !!error,\n [jsInputStyles.focusFallback(this.theme)]: focused && (isIE11 || isEdge),\n [jsInputStyles.warningFallback(this.theme)]: !!warning && (isIE11 || isEdge),\n [jsInputStyles.errorFallback(this.theme)]: !!error && (isIE11 || isEdge),\n [jsInputStyles.disabled(this.theme)]: !!disabled,\n [jsInputStyles.borderless()]: !!borderless,\n [jsInputStyles.hideBlinkingCursor()]: isMobile,\n });\n\n const wrapperClass = cx(jsInputStyles.wrapper(), {\n [styles.userSelectContain()]: focused,\n });\n\n return (\n <span\n {...rest}\n className={className}\n style={{ width, textAlign: align }}\n tabIndex={disabled ? undefined : 0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n ref={this.innerRef}\n onKeyDown={this.handleKeyDown}\n onMouseDown={this.handleMouseDown}\n >\n <input type=\"hidden\" value={value} />\n {leftSide}\n <span className={wrapperClass}>\n <span\n data-tid=\"InputLikeText__input\"\n className={cx(styles.input(), jsInputStyles.input(this.theme), {\n [jsInputStyles.inputFocus(this.theme)]: focused,\n [jsInputStyles.inputDisabled(this.theme)]: disabled,\n })}\n >\n {this.props.children}\n </span>\n {this.renderPlaceholder()}\n </span>\n {rightSide}\n {isIE11 && focused && <HiddenInput nodeRef={this.hiddenInputRef} />}\n </span>\n );\n };\n\n private getIconClassname(right = false) {\n switch (this.props.size) {\n case 'large':\n return right ? jsInputStyles.rightIconLarge(this.theme) : jsInputStyles.leftIconLarge(this.theme);\n case 'medium':\n return right ? jsInputStyles.rightIconMedium(this.theme) : jsInputStyles.leftIconMedium(this.theme);\n case 'small':\n default:\n return right ? jsInputStyles.rightIconSmall(this.theme) : jsInputStyles.leftIconSmall(this.theme);\n }\n }\n\n private renderLeftIcon = () => {\n return this.renderIcon(this.props.leftIcon, this.getIconClassname());\n };\n\n private renderRightIcon = () => {\n return this.renderIcon(this.props.rightIcon, this.getIconClassname(true));\n };\n\n private renderIcon = (icon: InputIconType, className: string): JSX.Element | null => {\n if (!icon) {\n return null;\n }\n\n const { disabled } = this.props;\n const iconNode = icon instanceof Function ? icon() : icon;\n\n return (\n <span\n className={cx(jsInputStyles.icon(), className, jsInputStyles.useDefaultColor(this.theme), {\n [jsInputStyles.iconDisabled()]: disabled,\n })}\n >\n {iconNode}\n </span>\n );\n };\n\n private renderPrefix = (): JSX.Element | null => {\n const { prefix, disabled } = this.props;\n\n if (!prefix) {\n return null;\n }\n\n return (\n <span className={cx(jsInputStyles.prefix(this.theme), { [jsInputStyles.prefixDisabled(this.theme)]: disabled })}>\n {prefix}\n </span>\n );\n };\n\n private renderSuffix = (): JSX.Element | null => {\n const { suffix, disabled } = this.props;\n\n if (!suffix) {\n return null;\n }\n\n return (\n <span className={cx(jsInputStyles.suffix(this.theme), { [jsInputStyles.suffixDisabled(this.theme)]: disabled })}>\n {suffix}\n </span>\n );\n };\n\n private renderLeftSide = (): JSX.Element | null => {\n const leftIcon = this.renderLeftIcon();\n const prefix = this.renderPrefix();\n\n if (!leftIcon && !prefix) {\n return null;\n }\n\n return (\n <span className={jsInputStyles.sideContainer()}>\n {leftIcon}\n {prefix}\n </span>\n );\n };\n\n private renderRightSide = (): JSX.Element | null => {\n const rightIcon = this.renderRightIcon();\n const suffix = this.renderSuffix();\n\n if (!rightIcon && !suffix) {\n return null;\n }\n\n return (\n <span className={cx(jsInputStyles.sideContainer(), jsInputStyles.rightContainer())}>\n {rightIcon}\n {suffix}\n </span>\n );\n };\n\n private renderPlaceholder = (): JSX.Element | null => {\n const { children, placeholder, disabled } = this.props;\n const { focused } = this.state;\n\n if (!children && placeholder) {\n return (\n <span\n className={cx(jsInputStyles.placeholder(this.theme), {\n [jsInputStyles.placeholderDisabled(this.theme)]: disabled,\n [jsInputStyles.placeholderFocus(this.theme)]: focused,\n })}\n >\n {placeholder}\n </span>\n );\n }\n return null;\n };\n\n private handleDocumentMouseDown = (e: MouseEvent) => {\n if (this.state.focused && this.node && e.target instanceof Node && !this.node.contains(e.target)) {\n this.defrost();\n }\n };\n\n private handleDocumentKeyDown = (e: KeyboardEvent) => {\n if (this.state.focused && isKeyTab(e)) {\n this.defrost();\n }\n };\n\n private handleMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n this.frozen = true;\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (this.props.disabled) {\n return;\n }\n\n if (isIE11 && isShortcutPaste(e) && this.hiddenInput) {\n this.frozen = true;\n setTimeout(() => {\n if (this.lastSelectedInnerNode) {\n this.selectInnerNode(...this.lastSelectedInnerNode);\n }\n if (this.node) {\n this.node.focus();\n }\n }, 0);\n\n this.hiddenInput.focus();\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 document.documentElement.classList.add(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 document.documentElement.classList.remove(styles.userSelectNone());\n };\n\n private handleFocus = (e: React.FocusEvent<HTMLElement>) => {\n if (isMobile) {\n e.target.setAttribute('contenteditable', 'true');\n }\n\n if (this.props.disabled) {\n if (isIE11) {\n selectNodeContents(document.body, 0, 0);\n }\n return;\n }\n\n if ((isIE11 || isEdge) && this.frozen) {\n this.frozen = false;\n if (this.state.focused) {\n return;\n }\n }\n\n this.setState({ focused: true });\n\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n };\n\n private handleBlur = (e: React.FocusEvent<HTMLElement>) => {\n if (isMobile) {\n e.target.removeAttribute('contenteditable');\n }\n\n if (this.props.disabled) {\n e.stopPropagation();\n return;\n }\n\n if ((isIE11 || isEdge) && this.frozenBlur) {\n this.frozenBlur = false;\n return;\n }\n if ((isIE11 || isEdge) && this.frozen) {\n return;\n }\n\n removeAllSelections();\n\n this.setState({ focused: false });\n\n if (this.props.onBlur) {\n this.props.onBlur(e);\n }\n };\n\n private hiddenInputRef = (el: HTMLInputElement | null) => {\n this.hiddenInput = el;\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 defrost = (): void => {\n this.frozen = false;\n this.frozenBlur = false;\n };\n\n private getSizeClassName = () => {\n switch (this.props.size) {\n case 'large':\n return cx({\n [jsInputStyles.sizeLarge(this.theme)]: true,\n [jsInputStyles.sizeLargeFallback(this.theme)]: isIE11 || isEdge,\n });\n case 'medium':\n return cx({\n [jsInputStyles.sizeMedium(this.theme)]: true,\n [jsInputStyles.sizeMediumFallback(this.theme)]: isIE11 || isEdge,\n });\n case 'small':\n default:\n return cx({\n [jsInputStyles.sizeSmall(this.theme)]: true,\n [jsInputStyles.sizeSmallFallback(this.theme)]: isIE11 || isEdge,\n });\n }\n };\n}\n"]}
1
+ {"version":3,"sources":["InputLikeText.tsx"],"names":["InputLikeText","state","blinking","focused","theme","node","hiddenInput","lastSelectedInnerNode","frozen","frozenBlur","dragging","focusTimeout","blinkTimeout","selectInnerNode","start","end","isIE11","document","body","setTimeout","clearInterval","window","isEdge","focus","renderMain","props","innerRef","tabIndex","placeholder","align","borderless","width","size","error","warning","onValueChange","disabled","prefix","suffix","leftIcon","rightIcon","value","onMouseDragStart","onMouseDragEnd","rest","leftSide","renderLeftSide","rightSide","renderRightSide","className","styles","root","jsInputStyles","getSizeClassName","blink","focusFallback","warningFallback","errorFallback","hideBlinkingCursor","isMobile","wrapperClass","wrapper","userSelectContain","textAlign","undefined","handleFocus","handleBlur","handleKeyDown","handleMouseDown","input","inputFocus","inputDisabled","children","renderPlaceholder","hiddenInputRef","renderLeftIcon","renderIcon","getIconClassname","renderRightIcon","icon","iconNode","Function","useDefaultColor","iconDisabled","renderPrefix","prefixDisabled","renderSuffix","suffixDisabled","sideContainer","rightContainer","placeholderDisabled","placeholderFocus","handleDocumentMouseDown","e","target","Node","contains","defrost","handleDocumentKeyDown","onKeyDown","handleMouseDragStart","documentElement","classList","add","userSelectNone","handleMouseDragEnd","remove","setAttribute","setState","onFocus","removeAttribute","stopPropagation","onBlur","el","sizeLarge","sizeLargeFallback","sizeMedium","sizeMediumFallback","sizeSmall","sizeSmallFallback","blur","getNode","componentDidMount","MouseDrag","listen","addEventListener","componentWillUnmount","clearTimeout","stop","removeEventListener","render","right","rightIconLarge","leftIconLarge","rightIconMedium","leftIconMedium","rightIconSmall","leftIconSmall","React","Component","__KONTUR_REACT_UI__","defaultProps"],"mappings":"ucAAA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4C;;;;;;;;;;;;;AAaaA,a;;;;;AAKJC,IAAAA,K,GAAQ,EAAEC,QAAQ,EAAE,KAAZ,EAAmBC,OAAO,EAAE,KAA5B,E;;AAEPC,IAAAA,K;AACAC,IAAAA,I,GAA2B,I;AAC3BC,IAAAA,W,GAAuC,I;AACvCC,IAAAA,qB,GAA8D,I;AAC9DC,IAAAA,M,GAAS,K;AACTC,IAAAA,U,GAAa,K;AACbC,IAAAA,Q,GAAW,K;AACXC,IAAAA,Y;AACAC,IAAAA,Y;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCDC,IAAAA,e,GAAkB,UAACR,IAAD,EAA2BS,KAA3B,EAAsCC,GAAtC,EAAkD,KAAvBD,KAAuB,cAAvBA,KAAuB,GAAf,CAAe,MAAZC,GAAY,cAAZA,GAAY,GAAN,CAAM;AACzE,UAAI,MAAKL,QAAL,IAAiB,CAACL,IAAtB,EAA4B;AAC1B;AACD;AACD,UAAIW,kBAAU,6CAAoBX,IAApB,EAA0BY,QAAQ,CAACC,IAAnC,CAAd,EAAwD;AACtD;AACA;AACD;AACD,YAAKV,MAAL,GAAc,IAAd;AACA,YAAKC,UAAL,GAAkB,IAAlB;;AAEA,YAAKF,qBAAL,GAA6B,CAACF,IAAD,EAAOS,KAAP,EAAcC,GAAd,CAA7B;AACAI,MAAAA,UAAU,CAAC,oBAAM,0CA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B,KAAKrI,KAAjC,CAA1D,CAPJ,CASD,C,wBAzLgCsI,eAAMC,S,wCAA5B3I,a,CACG4I,mB,GAAsB,e,CADzB5I,a,CAGG6I,Y,GAAe,EAAE7G,IAAI,EAAE,OAAR,E","sourcesContent":["import React from 'react';\n\nimport { isNonNullable } from '../../lib/utils';\nimport { isKeyTab, isShortcutPaste } from '../../lib/events/keyboard/identifiers';\nimport { MouseDrag, MouseDragEventHandler } from '../../lib/events/MouseDrag';\nimport { isEdge, isIE11, isMobile } from '../../lib/client';\nimport { Nullable } from '../../typings/utility-types';\nimport { removeAllSelections, selectNodeContents } from '../../components/DateInput/helpers/SelectionHelpers';\nimport { InputProps, InputIconType, InputState } from '../../components/Input';\nimport { styles as jsInputStyles } from '../../components/Input/Input.styles';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { Theme } from '../../lib/theming/Theme';\nimport { CommonProps, CommonWrapper, CommonWrapperRestProps } from '../CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { findRenderContainer } from '../../lib/listenFocusOutside';\n\nimport { styles } from './InputLikeText.styles';\nimport { HiddenInput } from './HiddenInput';\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}\n\nexport type InputLikeTextState = Omit<InputState, 'polyfillPlaceholder'>;\n\nexport class InputLikeText extends React.Component<InputLikeTextProps, InputLikeTextState> {\n public static __KONTUR_REACT_UI__ = 'InputLikeText';\n\n public static defaultProps = { size: 'small' };\n\n public state = { blinking: false, focused: false };\n\n private theme!: Theme;\n private node: HTMLElement | null = null;\n private hiddenInput: HTMLInputElement | null = null;\n private lastSelectedInnerNode: [HTMLElement, number, number] | null = null;\n private frozen = false;\n private frozenBlur = false;\n private dragging = false;\n private focusTimeout: Nullable<number>;\n private blinkTimeout: Nullable<number>;\n\n /**\n * @public\n */\n public focus() {\n if (this.node) {\n this.node.focus();\n }\n }\n\n /**\n * @public\n */\n public blur() {\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 this.setState({ blinking: true }, () => {\n this.blinkTimeout = window.setTimeout(() => this.setState({ blinking: false }), 150);\n });\n }\n\n public getNode(): HTMLElement | null {\n return this.node;\n }\n\n public selectInnerNode = (node: HTMLElement | null, start = 0, end = 1) => {\n if (this.dragging || !node) {\n return;\n }\n if (isIE11 && findRenderContainer(node, document.body)) {\n // Code below causes Popup to close after triggering the focus event on the body in IE11\n return;\n }\n this.frozen = true;\n this.frozenBlur = true;\n\n this.lastSelectedInnerNode = [node, start, end];\n setTimeout(() => selectNodeContents(node, start, end), 0);\n if (this.focusTimeout) {\n clearInterval(this.focusTimeout);\n }\n this.focusTimeout = window.setTimeout(() => (isIE11 || isEdge) && this.node && this.node.focus(), 0);\n };\n\n public componentDidMount() {\n if (this.node) {\n MouseDrag.listen(this.node).onMouseDragStart(this.handleMouseDragStart).onMouseDragEnd(this.handleMouseDragEnd);\n }\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n public componentWillUnmount() {\n if (this.blinkTimeout) {\n clearTimeout(this.blinkTimeout);\n }\n MouseDrag.stop(this.node);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return <CommonWrapper {...this.props}>{this.renderMain}</CommonWrapper>;\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 size,\n error,\n warning,\n onValueChange,\n disabled,\n prefix,\n suffix,\n leftIcon,\n rightIcon,\n value,\n onMouseDragStart,\n onMouseDragEnd,\n ...rest\n } = props;\n\n const { focused, blinking } = this.state;\n\n const leftSide = this.renderLeftSide();\n const rightSide = this.renderRightSide();\n\n const className = cx(styles.root(), jsInputStyles.root(this.theme), this.getSizeClassName(), {\n [jsInputStyles.focus(this.theme)]: focused,\n [jsInputStyles.blink(this.theme)]: blinking,\n [jsInputStyles.warning(this.theme)]: !!warning,\n [jsInputStyles.error(this.theme)]: !!error,\n [jsInputStyles.focusFallback(this.theme)]: focused && (isIE11 || isEdge),\n [jsInputStyles.warningFallback(this.theme)]: !!warning && (isIE11 || isEdge),\n [jsInputStyles.errorFallback(this.theme)]: !!error && (isIE11 || isEdge),\n [jsInputStyles.disabled(this.theme)]: !!disabled,\n [jsInputStyles.borderless()]: !!borderless,\n [jsInputStyles.hideBlinkingCursor()]: isMobile,\n });\n\n const wrapperClass = cx(jsInputStyles.wrapper(), {\n [styles.userSelectContain()]: focused,\n });\n\n return (\n <span\n {...rest}\n className={className}\n style={{ width, textAlign: align }}\n tabIndex={disabled ? undefined : 0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n ref={this.innerRef}\n onKeyDown={this.handleKeyDown}\n onMouseDown={this.handleMouseDown}\n >\n <input type=\"hidden\" value={value} />\n {leftSide}\n <span className={wrapperClass}>\n <span\n data-tid=\"InputLikeText__input\"\n className={cx(styles.input(), jsInputStyles.input(this.theme), {\n [jsInputStyles.inputFocus(this.theme)]: focused,\n [jsInputStyles.inputDisabled(this.theme)]: disabled,\n })}\n >\n {this.props.children}\n </span>\n {this.renderPlaceholder()}\n </span>\n {rightSide}\n {isIE11 && focused && <HiddenInput nodeRef={this.hiddenInputRef} />}\n </span>\n );\n };\n\n private getIconClassname(right = false) {\n switch (this.props.size) {\n case 'large':\n return right ? jsInputStyles.rightIconLarge(this.theme) : jsInputStyles.leftIconLarge(this.theme);\n case 'medium':\n return right ? jsInputStyles.rightIconMedium(this.theme) : jsInputStyles.leftIconMedium(this.theme);\n case 'small':\n default:\n return right ? jsInputStyles.rightIconSmall(this.theme) : jsInputStyles.leftIconSmall(this.theme);\n }\n }\n\n private renderLeftIcon = () => {\n return this.renderIcon(this.props.leftIcon, this.getIconClassname());\n };\n\n private renderRightIcon = () => {\n return this.renderIcon(this.props.rightIcon, this.getIconClassname(true));\n };\n\n private renderIcon = (icon: InputIconType, className: string): JSX.Element | null => {\n if (!icon) {\n return null;\n }\n\n const { disabled } = this.props;\n const iconNode = icon instanceof Function ? icon() : icon;\n\n return (\n <span\n className={cx(jsInputStyles.icon(), className, jsInputStyles.useDefaultColor(this.theme), {\n [jsInputStyles.iconDisabled()]: disabled,\n })}\n >\n {iconNode}\n </span>\n );\n };\n\n private renderPrefix = (): JSX.Element | null => {\n const { prefix, disabled } = this.props;\n\n if (!prefix) {\n return null;\n }\n\n return (\n <span className={cx(jsInputStyles.prefix(this.theme), { [jsInputStyles.prefixDisabled(this.theme)]: disabled })}>\n {prefix}\n </span>\n );\n };\n\n private renderSuffix = (): JSX.Element | null => {\n const { suffix, disabled } = this.props;\n\n if (!suffix) {\n return null;\n }\n\n return (\n <span className={cx(jsInputStyles.suffix(this.theme), { [jsInputStyles.suffixDisabled(this.theme)]: disabled })}>\n {suffix}\n </span>\n );\n };\n\n private renderLeftSide = (): JSX.Element | null => {\n const leftIcon = this.renderLeftIcon();\n const prefix = this.renderPrefix();\n\n if (!leftIcon && !prefix) {\n return null;\n }\n\n return (\n <span className={jsInputStyles.sideContainer()}>\n {leftIcon}\n {prefix}\n </span>\n );\n };\n\n private renderRightSide = (): JSX.Element | null => {\n const rightIcon = this.renderRightIcon();\n const suffix = this.renderSuffix();\n\n if (!rightIcon && !suffix) {\n return null;\n }\n\n return (\n <span className={cx(jsInputStyles.sideContainer(), jsInputStyles.rightContainer())}>\n {rightIcon}\n {suffix}\n </span>\n );\n };\n\n private renderPlaceholder = (): JSX.Element | null => {\n const { children, placeholder, disabled } = this.props;\n const { focused } = this.state;\n\n if (!isNonNullable(children) && placeholder) {\n return (\n <span\n className={cx(jsInputStyles.placeholder(this.theme), {\n [jsInputStyles.placeholderDisabled(this.theme)]: disabled,\n [jsInputStyles.placeholderFocus(this.theme)]: focused,\n })}\n >\n {placeholder}\n </span>\n );\n }\n return null;\n };\n\n private handleDocumentMouseDown = (e: MouseEvent) => {\n if (this.state.focused && this.node && e.target instanceof Node && !this.node.contains(e.target)) {\n this.defrost();\n }\n };\n\n private handleDocumentKeyDown = (e: KeyboardEvent) => {\n if (this.state.focused && isKeyTab(e)) {\n this.defrost();\n }\n };\n\n private handleMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n this.frozen = true;\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (this.props.disabled) {\n return;\n }\n\n if (isIE11 && isShortcutPaste(e) && this.hiddenInput) {\n this.frozen = true;\n setTimeout(() => {\n if (this.lastSelectedInnerNode) {\n this.selectInnerNode(...this.lastSelectedInnerNode);\n }\n if (this.node) {\n this.node.focus();\n }\n }, 0);\n\n this.hiddenInput.focus();\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 document.documentElement.classList.add(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 document.documentElement.classList.remove(styles.userSelectNone());\n };\n\n private handleFocus = (e: React.FocusEvent<HTMLElement>) => {\n if (isMobile) {\n e.target.setAttribute('contenteditable', 'true');\n }\n\n if (this.props.disabled) {\n if (isIE11) {\n selectNodeContents(document.body, 0, 0);\n }\n return;\n }\n\n if ((isIE11 || isEdge) && this.frozen) {\n this.frozen = false;\n if (this.state.focused) {\n return;\n }\n }\n\n this.setState({ focused: true });\n\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n };\n\n private handleBlur = (e: React.FocusEvent<HTMLElement>) => {\n if (isMobile) {\n e.target.removeAttribute('contenteditable');\n }\n\n if (this.props.disabled) {\n e.stopPropagation();\n return;\n }\n\n if ((isIE11 || isEdge) && this.frozenBlur) {\n this.frozenBlur = false;\n return;\n }\n if ((isIE11 || isEdge) && this.frozen) {\n return;\n }\n\n removeAllSelections();\n\n this.setState({ focused: false });\n\n if (this.props.onBlur) {\n this.props.onBlur(e);\n }\n };\n\n private hiddenInputRef = (el: HTMLInputElement | null) => {\n this.hiddenInput = el;\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 defrost = (): void => {\n this.frozen = false;\n this.frozenBlur = false;\n };\n\n private getSizeClassName = () => {\n switch (this.props.size) {\n case 'large':\n return cx({\n [jsInputStyles.sizeLarge(this.theme)]: true,\n [jsInputStyles.sizeLargeFallback(this.theme)]: isIE11 || isEdge,\n });\n case 'medium':\n return cx({\n [jsInputStyles.sizeMedium(this.theme)]: true,\n [jsInputStyles.sizeMediumFallback(this.theme)]: isIE11 || isEdge,\n });\n case 'small':\n default:\n return cx({\n [jsInputStyles.sizeSmall(this.theme)]: true,\n [jsInputStyles.sizeSmallFallback(this.theme)]: isIE11 || isEdge,\n });\n }\n };\n}\n"]}
@@ -3,6 +3,7 @@
3
3
  var _client = require("../../lib/client");
4
4
 
5
5
  var _utils = require("../../lib/utils");
6
+ var _Upgrades = require("../../lib/Upgrades");
6
7
 
7
8
  var _RenderInnerContainer = require("./RenderInnerContainer");var
8
9
 
@@ -43,7 +44,7 @@ RenderContainer = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.
43
44
  createContainer = function createContainer() {
44
45
  if (_client.canUseDOM) {
45
46
  var domContainer = document.createElement('div');
46
- domContainer.setAttribute('class', 'react-ui');
47
+ domContainer.setAttribute('class', _Upgrades.Upgrade.getSpecificityClassName());
47
48
  domContainer.setAttribute('data-rendered-container-id', "" + this.rootId);
48
49
  this.domContainer = domContainer;
49
50
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["RenderContainer.tsx"],"names":["RenderContainer","props","domContainer","rootId","getRootId","isBrowser","children","mountContainer","UNSAFE_componentWillReceiveProps","nextProps","unmountContainer","componentWillUnmount","destroyContainer","render","createContainer","canUseDOM","document","createElement","setAttribute","parentNode","body","appendChild","window","ReactTesting","addRenderContainer","removeChild","removeRenderContainer","React","Component","__KONTUR_REACT_UI__"],"mappings":"6UAAA;;AAEA;;AAEA;;AAEA,8D;;;AAGaA,e;;;;;;;;AAQX,2BAAYC,KAAZ,EAAyC;AACvC,wCAAMA,KAAN,UADuC,MAJjCC,YAIiC,GAJK,IAIL,OAFxBC,MAEwB,GAFPH,eAAe,CAACI,SAAhB,EAEO;;AAGvC,QAAIC,qBAAaJ,KAAK,CAACK,QAAvB,EAAiC;AAC/B,YAAKC,cAAL;AACD,KALsC;AAMxC,G;;AAEMC,EAAAA,gC,GAAP,0CAAwCC,SAAxC,EAAyF;AACvF,QAAI,CAAC,KAAKR,KAAL,CAAWK,QAAZ,IAAwBG,SAAS,CAACH,QAAtC,EAAgD;AAC9C,WAAKC,cAAL;AACD;AACD,QAAI,KAAKN,KAAL,CAAWK,QAAX,IAAuB,CAACG,SAAS,CAACH,QAAtC,EAAgD;AAC9C,WAAKI,gBAAL;AACD;AACF,G;;AAEMC,EAAAA,oB,GAAP,gCAA8B;AAC5B,SAAKC,gBAAL;AACD,G;;AAEMC,EAAAA,M,GAAP,kBAAgB;AACd,wBAAO,6BAAC,0CAAD,6BAA0B,KAAKZ,KAA/B,IAAsC,YAAY,EAAE,KAAKC,YAAzD,EAAuE,MAAM,EAAE,KAAKC,MAApF,IAAP;AACD,G;;AAEOW,EAAAA,e,GAAR,2BAA0B;AACxB,QAAIC,iBAAJ,EAAe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lib/client';\nimport { Nullable } from '../../typings/utility-types';\nimport { getRandomID } from '../../lib/utils';\n\nimport { RenderInnerContainer } from './RenderInnerContainer';\nimport { RenderContainerProps } from './RenderContainerTypes';\n\nexport class RenderContainer extends React.Component<RenderContainerProps> {\n public static __KONTUR_REACT_UI__ = 'RenderContainer';\n\n private static getRootId = () => getRandomID();\n private domContainer: Nullable<HTMLElement> = null;\n\n private readonly rootId: string = RenderContainer.getRootId();\n\n constructor(props: RenderContainerProps) {\n super(props);\n\n if (isBrowser && props.children) {\n this.mountContainer();\n }\n }\n\n public UNSAFE_componentWillReceiveProps(nextProps: Readonly<RenderContainerProps>): void {\n if (!this.props.children && nextProps.children) {\n this.mountContainer();\n }\n if (this.props.children && !nextProps.children) {\n this.unmountContainer();\n }\n }\n\n public componentWillUnmount() {\n this.destroyContainer();\n }\n\n public render() {\n return <RenderInnerContainer {...this.props} domContainer={this.domContainer} rootId={this.rootId} />;\n }\n\n private createContainer() {\n if (canUseDOM) {\n const domContainer = document.createElement('div');\n domContainer.setAttribute('class', 'react-ui');\n domContainer.setAttribute('data-rendered-container-id', `${this.rootId}`);\n this.domContainer = domContainer;\n }\n }\n\n private mountContainer() {\n if (!this.domContainer) {\n this.createContainer();\n }\n if (this.domContainer && this.domContainer.parentNode !== document.body) {\n document.body.appendChild(this.domContainer);\n if (window.ReactTesting) {\n window.ReactTesting.addRenderContainer(this.rootId, this);\n }\n }\n }\n\n private destroyContainer() {\n if (this.domContainer) {\n this.unmountContainer();\n this.domContainer = null;\n }\n }\n\n private unmountContainer() {\n if (this.domContainer && this.domContainer.parentNode) {\n this.domContainer.parentNode.removeChild(this.domContainer);\n\n if (window.ReactTesting) {\n window.ReactTesting.removeRenderContainer(this.rootId);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["RenderContainer.tsx"],"names":["RenderContainer","props","domContainer","rootId","getRootId","isBrowser","children","mountContainer","UNSAFE_componentWillReceiveProps","nextProps","unmountContainer","componentWillUnmount","destroyContainer","render","createContainer","canUseDOM","document","createElement","setAttribute","Upgrade","getSpecificityClassName","parentNode","body","appendChild","window","ReactTesting","addRenderContainer","removeChild","removeRenderContainer","React","Component","__KONTUR_REACT_UI__"],"mappings":"6UAAA;;AAEA;;AAEA;AACA;;AAEA,8D;;;AAGaA,e;;;;;;;;AAQX,2BAAYC,KAAZ,EAAyC;AACvC,wCAAMA,KAAN,UADuC,MAJjCC,YAIiC,GAJK,IAIL,OAFxBC,MAEwB,GAFPH,eAAe,CAACI,SAAhB,EAEO;;AAGvC,QAAIC,qBAAaJ,KAAK,CAACK,QAAvB,EAAiC;AAC/B,YAAKC,cAAL;AACD,KALsC;AAMxC,G;;AAEMC,EAAAA,gC,GAAP,0CAAwCC,SAAxC,EAAyF;AACvF,QAAI,CAAC,KAAKR,KAAL,CAAWK,QAAZ,IAAwBG,SAAS,CAACH,QAAtC,EAAgD;AAC9C,WAAKC,cAAL;AACD;AACD,QAAI,KAAKN,KAAL,CAAWK,QAAX,IAAuB,CAACG,SAAS,CAACH,QAAtC,EAAgD;AAC9C,WAAKI,gBAAL;AACD;AACF,G;;AAEMC,EAAAA,oB,GAAP,gCAA8B;AAC5B,SAAKC,gBAAL;AACD,G;;AAEMC,EAAAA,M,GAAP,kBAAgB;AACd,wBAAO,6BAAC,0CAAD,6BAA0B,KAAKZ,KAA/B,IAAsC,YAAY,EAAE,KAAKC,YAAzD,EAAuE,MAAM,EAAE,KAAKC,MAApF,IAAP;AACD,G;;AAEOW,EAAAA,e,GAAR,2BAA0B;AACxB,QAAIC,iBAAJ,EAAe;AACb,UAAMb,YAAY,GAAGc,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAArB;AACAf,MAAAA,YAAY,CAACgB,YAAb,CAA0B,OAA1B,EAAmCC,kBAAQC,uBAAR,EAAnC;AACAlB,MAAAA,YAAY,CAACgB,YAAb,CAA0B,4BAA1B,OAA2D,KAAKf,MAAhE;AACA,WAAKD,YAAL,GAAoBA,YAApB;AACD;AACF,G;;AAEOK,EAAAA,c,GAAR,0BAAyB;AACvB,QAAI,CAAC,KAAKL,YAAV,EAAwB;AACtB,WAAKY,eAAL;AACD;AACD,QAAI,KAAKZ,YAAL,IAAqB,KAAKA,YAAL,CAAkBmB,UAAlB,KAAiCL,QAAQ,CAACM,IAAnE,EAAyE;AACvEN,MAAAA,QAAQ,CAACM,IAAT,CAAcC,WAAd,CAA0B,KAAKrB,YAA/B;AACA,UAAIsB,MAAM,CAACC,YAAX,EAAyB;AACvBD,QAAAA,MAAM,CAACC,YAAP,CAAoBC,kBAApB,CAAuC,KAAKvB,MAA5C,EAAoD,IAApD;AACD;AACF;AACF,G;;AAEOS,EAAAA,gB,GAAR,4BAA2B;AACzB,QAAI,KAAKV,YAAT,EAAuB;AACrB,WAAKQ,gBAAL;AACA,WAAKR,YAAL,GAAoB,IAApB;AACD;AACF,G;;AAEOQ,EAAAA,gB,GAAR,4BAA2B;AACzB,QAAI,KAAKR,YAAL,IAAqB,KAAKA,YAAL,CAAkBmB,UAA3C,EAAuD;AACrD,WAAKnB,YAAL,CAAkBmB,UAAlB,CAA6BM,WAA7B,CAAyC,KAAKzB,YAA9C;;AAEA,UAAIsB,MAAM,CAACC,YAAX,EAAyB;AACvBD,QAAAA,MAAM,CAACC,YAAP,CAAoBG,qBAApB,CAA0C,KAAKzB,MAA/C;AACD;AACF;AACF,G,0BArEkC0B,eAAMC,S,4CAA9B9B,e,CACG+B,mB,GAAsB,iB,CADzB/B,e,CAGII,S,GAAY,oBAAM,yBAAN,E","sourcesContent":["import React from 'react';\n\nimport { canUseDOM, isBrowser } from '../../lib/client';\nimport { Nullable } from '../../typings/utility-types';\nimport { getRandomID } from '../../lib/utils';\nimport { Upgrade } from '../../lib/Upgrades';\n\nimport { RenderInnerContainer } from './RenderInnerContainer';\nimport { RenderContainerProps } from './RenderContainerTypes';\n\nexport class RenderContainer extends React.Component<RenderContainerProps> {\n public static __KONTUR_REACT_UI__ = 'RenderContainer';\n\n private static getRootId = () => getRandomID();\n private domContainer: Nullable<HTMLElement> = null;\n\n private readonly rootId: string = RenderContainer.getRootId();\n\n constructor(props: RenderContainerProps) {\n super(props);\n\n if (isBrowser && props.children) {\n this.mountContainer();\n }\n }\n\n public UNSAFE_componentWillReceiveProps(nextProps: Readonly<RenderContainerProps>): void {\n if (!this.props.children && nextProps.children) {\n this.mountContainer();\n }\n if (this.props.children && !nextProps.children) {\n this.unmountContainer();\n }\n }\n\n public componentWillUnmount() {\n this.destroyContainer();\n }\n\n public render() {\n return <RenderInnerContainer {...this.props} domContainer={this.domContainer} rootId={this.rootId} />;\n }\n\n private createContainer() {\n if (canUseDOM) {\n const domContainer = document.createElement('div');\n domContainer.setAttribute('class', Upgrade.getSpecificityClassName());\n domContainer.setAttribute('data-rendered-container-id', `${this.rootId}`);\n this.domContainer = domContainer;\n }\n }\n\n private mountContainer() {\n if (!this.domContainer) {\n this.createContainer();\n }\n if (this.domContainer && this.domContainer.parentNode !== document.body) {\n document.body.appendChild(this.domContainer);\n if (window.ReactTesting) {\n window.ReactTesting.addRenderContainer(this.rootId, this);\n }\n }\n }\n\n private destroyContainer() {\n if (this.domContainer) {\n this.unmountContainer();\n this.domContainer = null;\n }\n }\n\n private unmountContainer() {\n if (this.domContainer && this.domContainer.parentNode) {\n this.domContainer.parentNode.removeChild(this.domContainer);\n\n if (window.ReactTesting) {\n window.ReactTesting.removeRenderContainer(this.rootId);\n }\n }\n }\n}\n"]}
@@ -17,6 +17,6 @@ export interface VariableDependencies {
17
17
  }
18
18
  export declare const COMPONENT_DESCRIPTIONS: DescriptionsType;
19
19
  export declare const COMPONENT_DESCRIPTIONS_BY_VARIABLE: VariableNameToComponentsMap;
20
- export declare const ALL_USED_VARIABLES: ("black" | "blue" | "gray" | "green" | "red" | "white" | "yellow" | "prototype" | "fontFamilyCompensationBaseline" | "brandXLight" | "brandLight" | "brand" | "brandDark" | "brandXDark" | "grayXxLight" | "grayXLight" | "grayLight" | "grayDark" | "blueXxLight" | "blueLight" | "blueDark" | "blueXDark" | "greenXxLight" | "greenDark" | "redXxLight" | "redDark" | "yellowXxLight" | "yellowDark" | "bgDefault" | "bgDisabled" | "errorMain" | "errorSecondary" | "errorText" | "warningMain" | "warningSecondary" | "warningText" | "borderColorFocusLight" | "borderColorGrayDark" | "borderColorGrayLight" | "borderColorDisabled" | "placeholderColor" | "outlineColorFocus" | "placeholderColorLight" | "blinkColor" | "controlBorderWidth" | "controlOutlineWidth" | "controlLineHeightSmall" | "controlLineHeightMedium" | "controlLineHeightLarge" | "controlPaddingYSmall" | "controlPaddingYMedium" | "controlPaddingYLarge" | "textColorDefault" | "textColorInvert" | "textColorDisabled" | "textColorDisabledContrast" | "fontSizeSmall" | "fontSizeMedium" | "fontSizeLarge" | "specificityLevel" | "bgActive" | "borderColorFocus" | "borderColorError" | "borderColorWarning" | "controlHeightSmall" | "controlHeightMedium" | "controlHeightLarge" | "linkColor" | "linkActiveColor" | "linkHoverTextDecoration" | "linkSuccessColor" | "linkSuccessHoverColor" | "linkSuccessActiveColor" | "linkDangerColor" | "linkDangerHoverColor" | "linkDangerActiveColor" | "linkIconMarginRight" | "linkHoverColor" | "linkDisabledColor" | "linkButtonLineHeight" | "linkButtonPaddingX" | "tokenDisabledBg" | "tokenTextColorDisabled" | "tokenFontSize" | "tokenMarginY" | "tokenMarginX" | "tokenLineHeight" | "tokenPaddingY" | "tokenPaddingX" | "tokenMarginBeforeIcon" | "tokenRemoveIconSize" | "tokenRemoveIconPaddingY" | "tokenRemoveIconPaddingX" | "tokenRemoveIconGap" | "tokenRemoveIconBoxSizing" | "tokenBorderRadius" | "tokenBorderWidth" | "tokenBorderColorDisabled" | "tokenDefaultIdle" | "tokenDefaultActive" | "tokenGrayIdle" | "tokenGrayActive" | "tokenBlueIdle" | "tokenBlueActive" | "tokenGreenIdle" | "tokenGreenActive" | "tokenYellowIdle" | "tokenYellowActive" | "tokenRedIdle" | "tokenRedActive" | "tokenWhite" | "tokenBlack" | "tokenBorderColorWarning" | "tokenBorderColorError" | "tokenOutlineWidth" | "tokenLegacyTextShift" | "tokenPaddingYDisabled" | "tokenPaddingXDisabled" | "tokenMarginYDisabled" | "tokenMarginXDisabled" | "tokenShadowDisabled" | "tokenInputBorderColor" | "tokenInputBorderColorFocus" | "tokenInputBorderColorError" | "tokenInputBorderColorWarning" | "tokenInputBorderTopColor" | "tokenInputPlaceholderColor" | "tokenInputPlaceholderColorLight" | "tokenInputDisabledBg" | "tokenInputDisabledBorderColor" | "tokenInputBorderWidth" | "tokenInputOutlineWidth" | "tokenInputBg" | "tokenInputShadow" | "tokenInputTextColor" | "tokenInputTextColorDisabled" | "tokenInputPlaceholderColorDisabled" | "tokenInputPaddingY" | "tokenInputPaddingX" | "tokenInputFontSize" | "tokenInputLineHeight" | "tokenInputInputPaddingLeft" | "tokenInputInputPaddingRight" | "loaderBg" | "loaderOpacity" | "btnArrowBgImageActive" | "btnArrowBgImageChecked" | "btnLinkBorderRadius" | "btnFocusShadowWidth" | "btnDisabledBorderColor" | "btnCheckedBg" | "btnCheckedDisabledBg" | "btnCheckedDisabledColor" | "btnCheckedTextColor" | "btnCheckedDisabledBorderColor" | "btnCheckedShadow" | "btnCheckedDisabledShadow" | "btnBorderRadiusSmall" | "btnBorderRadiusMedium" | "btnBorderRadiusLarge" | "btnBorderWidth" | "btnInsetWidth" | "btnOutlineWidth" | "btnPaddingXSmall" | "btnPaddingXMedium" | "btnPaddingXLarge" | "btnIconGapSmall" | "btnIconGapMedium" | "btnIconGapLarge" | "btnIconSizeSmall" | "btnIconSizeMedium" | "btnIconSizeLarge" | "btnDefaultBg" | "btnDefaultBgStart" | "btnDefaultBgEnd" | "btnDefaultCheckedBorderColor" | "btnDefaultTextColor" | "btnDefaultHoverBg" | "btnDefaultHoverBgStart" | "btnDefaultHoverBgEnd" | "btnDefaultActiveBg" | "btnDefaultHoverBorderColor" | "btnDefaultHoverBorderBottomColor" | "btnDefaultActiveBorderColor" | "btnDefaultActiveBorderTopColor" | "btnDefaultBorderColor" | "btnDefaultBorderBottomColor" | "btnDefaultActiveShadow" | "btnSuccessBg" | "btnSuccessHoverBg" | "btnSuccessHoverBorderColor" | "btnSuccessHoverBorderBottomColor" | "btnSuccessBorderColor" | "btnSuccessBorderBottomColor" | "btnSuccessBgStart" | "btnSuccessBgEnd" | "btnSuccessTextColor" | "btnSuccessHoverBgStart" | "btnSuccessHoverBgEnd" | "btnSuccessActiveBg" | "btnSuccessActiveBorderColor" | "btnSuccessActiveBorderTopColor" | "btnSuccessActiveShadow" | "btnPrimaryBg" | "btnPrimaryHoverBg" | "btnPrimaryHoverBorderColor" | "btnPrimaryHoverBorderBottomColor" | "btnPrimaryBorderColor" | "btnPrimaryBorderBottomColor" | "btnPrimaryBgStart" | "btnPrimaryBgEnd" | "btnPrimaryTextColor" | "btnPrimaryHoverBgStart" | "btnPrimaryHoverBgEnd" | "btnPrimaryActiveBg" | "btnPrimaryActiveBorderColor" | "btnPrimaryActiveBorderTopColor" | "btnPrimaryActiveShadow" | "btnDangerBg" | "btnDangerHoverBg" | "btnDangerHoverBorderColor" | "btnDangerHoverBorderBottomColor" | "btnDangerBorderColor" | "btnDangerBorderBottomColor" | "btnDangerBgStart" | "btnDangerBgEnd" | "btnDangerTextColor" | "btnDangerHoverBgStart" | "btnDangerHoverBgEnd" | "btnDangerActiveBg" | "btnDangerActiveBorderColor" | "btnDangerActiveBorderTopColor" | "btnDangerActiveShadow" | "btnPayBg" | "btnPayHoverBg" | "btnPayHoverBorderColor" | "btnPayHoverBorderBottomColor" | "btnPayBorderColor" | "btnPayBorderBottomColor" | "btnPayBgStart" | "btnPayBgEnd" | "btnPayTextColor" | "btnPayHoverBgStart" | "btnPayHoverBgEnd" | "btnPayActiveBg" | "btnPayActiveBorderColor" | "btnPayActiveBorderTopColor" | "btnPayActiveShadow" | "btnMenuArrowColor" | "btnFontSizeSmall" | "btnFontSizeMedium" | "btnFontSizeLarge" | "btnLineHeightSmall" | "btnLineHeightMedium" | "btnLineHeightLarge" | "btnPaddingYSmall" | "btnPaddingYMedium" | "btnPaddingYLarge" | "btnDisabledBg" | "btnBorderColorWarning" | "btnBorderColorError" | "btnHeightSmall" | "btnHeightMedium" | "btnHeightLarge" | "btnLinkColor" | "btnLinkHoverColor" | "btnLinkHoverTextDecoration" | "btnLinkIconMarginRight" | "btnErrorSecondary" | "btnWarningSecondary" | "btnOutlineColorFocus" | "btnInsetColor" | "btnBorderColorFocus" | "btnLinkDisabledColor" | "btnDisabledTextColor" | "selectPlaceholderColor" | "selectBorderWidth" | "selectPlaceholderColorDisabled" | "selectOutlineWidth" | "selectLineHeightSmall" | "selectFontSizeSmall" | "selectPaddingXSmall" | "selectPaddingYSmall" | "selectBorderRadiusSmall" | "selectIconGapSmall" | "selectLineHeightMedium" | "selectFontSizeMedium" | "selectPaddingXMedium" | "selectPaddingYMedium" | "selectBorderRadiusMedium" | "selectIconGapMedium" | "selectLineHeightLarge" | "selectFontSizeLarge" | "selectPaddingXLarge" | "selectPaddingYLarge" | "selectBorderRadiusLarge" | "selectIconGapLarge" | "selectMenuArrowColor" | "selectIconSizeSmall" | "selectIconSizeMedium" | "selectIconSizeLarge" | "tooltipPaddingY" | "tooltipPaddingX" | "tooltipCloseBtnPadding" | "tooltipCloseBtnColor" | "tooltipCloseBtnHoverColor" | "tooltipTextColor" | "tooltipBorder" | "tooltipBorderRadius" | "tooltipPinOffset" | "tooltipPinOffsetX" | "tooltipPinOffsetY" | "tooltipMargin" | "tooltipPinSize" | "tooltipMenuPinOffset" | "tooltipMenuMargin" | "tooltipMenuPinSize" | "kebabPinOffset" | "kebabPinSize" | "kebabMargin" | "kebabBackground" | "kebabBackgroundHover" | "kebabBorderRadius" | "kebabBorder" | "modalBackBg" | "modalBackOpacity" | "modalCloseButtonColor" | "modalCloseButtonDisabledColor" | "modalCloseButtonHoverColor" | "modalCloseButtonPadding" | "modalCloseButtonLegacyShift" | "modalCloseButtonBottomPadding" | "modalCloseButtonClickArea" | "modalCloseIconSize" | "modalCloseLegacyGap" | "modalCloseWrapperLegacyGap" | "modalFixedHeaderBg" | "modalFixedHeaderShadow" | "modalFixedFooterShadow" | "modalFooterBg" | "modalAdaptiveThreshold" | "modalPaddingTop" | "modalPaddingLeft" | "modalPaddingRight" | "modalHeaderFontSize" | "modalHeaderTextColor" | "modalHeaderLineHeight" | "modalHeaderPaddingBottom" | "modalHeaderPaddingTop" | "modalFixedHeaderPaddingBottom" | "modalBodyPaddingBottom" | "modalFooterPaddingTop" | "modalFooterPaddingBottom" | "modalPaddingBottom" | "modalFooterPanelPaddingTop" | "modalFooterPanelPaddingBottom" | "sidePageFooterPanelBg" | "sidePageBackingBg" | "sidePageBackingBgOpacity" | "sidePageCloseButtonColor" | "sidePageCloseButtonHoverColor" | "sidePageContainerShadow" | "sidePagePaddingLeft" | "sidePagePaddingRight" | "sidePagePaddingTop" | "sidePagePaddingBottom" | "sidePageFooterPaddingTop" | "sidePageFooterPaddingBottom" | "sidePageBgDefault" | "sidePageHeaderTextColor" | "sidePageHeaderFontSize" | "sidePageHeaderLineHeight" | "sidePageHeaderPaddingBottom" | "sidePageHeaderPaddingTop" | "sidePageHeaderFixedFontSize" | "sidePageHeaderFixedLineHeight" | "sidePageHeaderFixedPaddingY" | "sidePageHeaderStickyOffset" | "sidePageCloseButtonPadding" | "sidePageCloseButtonLegacyPaddingLeft" | "sidePageFooterPanelPaddingTop" | "sidePageFooterPanelPaddingBottom" | "sidePageCloseIconSize" | "sidePageCloseButtonClickArea" | "sidePageFixedHeaderShadow" | "sidePageFixedFooterShadow" | "dateInputIconColor" | "dateInputMaskColor" | "dateInputComponentSelectedBgColor" | "calendarCellBg" | "calendarCellHoverColor" | "calendarCellActiveHoverColor" | "calendarCellWeekendColor" | "calendarCellTodayBorder" | "calendarCellSelectedBgColor" | "calendarCellSelectedFontColor" | "calendarCellSize" | "calendarMonthHeaderStickedBgColor" | "calendarMonthTitleBorderBottomColor" | "calendarCellHoverBgColor" | "calendarPaddingX" | "calendarMonthTitleLineHeight" | "calendarMonthTitlePaddingTop" | "calendarMonthTitlePaddingBottom" | "calendarMonthTitleMarginX" | "calendarMonthTitleMarginBottom" | "calendarWrapperHeight" | "calendarMonthMarginBottom" | "calendarMaxMonthsToAppendOnScroll" | "dateSelectLineHeight" | "dateSelectFontSize" | "dateSelectFontWeight" | "dateSelectMenuItemBgSelected" | "dateSelectTextColorDisabled" | "dateSelectTextColorDefault" | "dateSelectLinkColor" | "dateSelectPopupBoxShadow" | "dateSelectTextColorInvert" | "datePickerOpenBtnColor" | "pickerBg" | "pickerShadow" | "pickerTodayWrapperBgColor" | "pickerTodayWrapperBorderTop" | "pickerTodayWrapperHoverBgColor" | "pickerTodayWrapperFontSize" | "pickerTodayWrapperLineHeight" | "pickerTodayWrapperPaddingTop" | "pickerTodayWrapperPaddingBottom" | "dateSelectMenuBg" | "dateSelectMenuItemBgActive" | "dateSelectMenuItemBgDisabled" | "dateSelectMenuItemFontActive" | "dateSelectMenuItemFontSelected" | "dateSelectMenuItemFontDisabled" | "pagingFontSize" | "pagingForwardIconSize" | "pagingForwardIconMarginTop" | "pagingPageLinkPaddingX" | "pagingPageLinkPaddingY" | "pagingPageLinkLegacyPaddingY" | "pagingPageLinkMinWidth" | "pagingPageForwardLinkMarginTop" | "pagingPageForwardLinkMarginLeft" | "pagingPageForwardLinkPaddingRight" | "pagingLineHeight" | "pagingDotsColor" | "pagingDotsPadding" | "pagingPageLinkActiveBg" | "pagingPageLinkActiveColor" | "pagingPageLinkHoverBg" | "pagingPageLinkHintColor" | "pagingPageLinkHintFontSize" | "pagingPageLinkHintLineHeight" | "pagingPageLinkBorderRadius" | "pagingPageLinkMargin" | "pagingForwardLinkColor" | "pagingForwardLinkDisabledColor" | "hintColor" | "hintFontSize" | "hintLineHeight" | "hintMaxWidth" | "hintPaddingY" | "hintPaddingX" | "hintTextAlign" | "hintBgColor" | "hintBorder" | "hintBorderRadius" | "hintPinOffset" | "hintMargin" | "toastFontSize" | "toastLineHeight" | "toastPaddingY" | "toastPaddingX" | "toastBorderRadius" | "toastBorder" | "toastTop" | "toastBg" | "toastColor" | "toastLinkColor" | "toastClosePadding" | "toastCloseColor" | "toastCloseHoverColor" | "toastCloseSize" | "dropdownMenuSelectedBg" | "dropdownMenuHoverBg" | "menuBgDefault" | "menuBorder" | "menuShadow" | "menuPaddingY" | "menuItemTextColor" | "menuItemSelectedBg" | "menuItemHoverBg" | "menuItemIconWidth" | "menuItemIconGap" | "menuItemIconLegacyMargin" | "menuItemIconLegacyShift" | "menuItemPaddingForIcon" | "menuItemLineHeight" | "menuItemFontSize" | "menuItemPaddingX" | "menuItemPaddingY" | "menuItemLegacyPaddingX" | "menuItemLegacyPaddingY" | "menuItemHoverColor" | "menuItemDisabledColor" | "menuItemLinkColor" | "menuItemCommentColor" | "menuItemCommentColorHover" | "menuHeaderColor" | "menuHeaderLineHeight" | "menuHeaderFontSize" | "menuHeaderPaddingX" | "menuHeaderPaddingTop" | "menuHeaderPaddingBottom" | "menuHeaderLegacyPaddingRight" | "menuSeparatorBorderColor" | "menuSeparatorMarginY" | "menuSeparatorBorderWidth" | "toggleTextColor" | "toggleHandleActiveWidthIncrement" | "toggleHandleBorderRadius" | "toggleHeight" | "toggleWidth" | "toggleBorderRadius" | "toggleBg" | "toggleDisabledHandleBg" | "toggleBaseBg" | "toggleBgDisabled" | "toggleBgHover" | "toggleBgChecked" | "toggleBorderWidth" | "toggleOutlineWidth" | "toggleBorderColor" | "toggleBgFocus" | "toggleBgActive" | "toggleShadowColorError" | "toggleShadowColorWarning" | "toggleFocusShadowColor" | "toggleCaptionGap" | "popupBorder" | "popupBorderRadius" | "popupBorderColor" | "popupDropShadow" | "popupBoxShadow" | "popupTextColor" | "popupBackground" | "popupPinOffset" | "popupPinOffsetX" | "popupPinOffsetY" | "popupMargin" | "popupPinSize" | "inputTextColor" | "inputShadow" | "inputBg" | "inputIconColor" | "inputColor" | "inputWidth" | "inputTextColorDisabled" | "inputFontSizeSmall" | "inputFontSizeMedium" | "inputFontSizeLarge" | "inputLineHeightSmall" | "inputLineHeightMedium" | "inputLineHeightLarge" | "inputHeightSmall" | "inputHeightMedium" | "inputHeightLarge" | "inputPaddingYSmall" | "inputPaddingYMedium" | "inputPaddingYLarge" | "inputPaddingXSmall" | "inputPaddingXMedium" | "inputPaddingXLarge" | "inputIconGapSmall" | "inputIconGapMedium" | "inputIconGapLarge" | "inputIconSizeSmall" | "inputIconSizeMedium" | "inputIconSizeLarge" | "inputFocusShadow" | "inputDisabledBg" | "inputDisabledBorderColor" | "inputFocusOutline" | "inputBorderWidth" | "inputOutlineWidth" | "inputBorderRadiusSmall" | "inputBorderRadiusMedium" | "inputBorderRadiusLarge" | "inputBorderColor" | "inputBorderColorFocus" | "inputBorderColorError" | "inputBorderColorWarning" | "inputBorderTopColor" | "inputPlaceholderColor" | "inputPlaceholderColorDisabled" | "inputPlaceholderColorLight" | "inputBlinkColor" | "checkboxBorderWidthCompensation" | "checkboxFontSize" | "checkboxLineHeight" | "checkboxBoxSize" | "checkboxLabelGap" | "checkboxPaddingY" | "checkboxBgStart" | "checkboxBgEnd" | "checkboxTextColorDefault" | "checkboxTextColorDisabled" | "checkboxShadowDisabled" | "checkboxBorder" | "checkboxBorderWidth" | "checkboxShadow" | "checkboxShadowHover" | "checkboxCheckedColor" | "checkboxOutlineColorFocus" | "checkboxBorderColorWarning" | "checkboxBorderColorError" | "checkboxCheckedHoverShadow" | "checkboxBorderRadius" | "checkboxOutlineWidth" | "checkboxCheckedShadow" | "checkboxCheckedActiveShadow" | "checkboxBorderColorFocus" | "checkboxBg" | "checkboxHoverBg" | "checkboxActiveBg" | "checkboxCheckedBg" | "checkboxBgDisabled" | "checkboxCheckedHoverBg" | "checkboxCheckedActiveBg" | "checkboxShadowActive" | "textareaBg" | "textareaColor" | "textareaTextColorDisabled" | "textareaPlaceholderColorLight" | "textareaPlaceholderColor" | "textareaPlaceholderColorDisabled" | "textareaShadow" | "textareaFontSize" | "textareaLineHeight" | "textareaBorderRadius" | "textareaBorderWidth" | "textareaOutlineWidth" | "textareaMinHeight" | "textareaWidth" | "textareaPaddingX" | "textareaPaddingY" | "textareaBorderColor" | "textareaBorderTopColor" | "textareaBorderColorFocus" | "textareaBorderColorWarning" | "textareaBorderColorError" | "textareaDisabledBg" | "textareaDisabledBorderColor" | "textareaCounterColor" | "textareaCounterBg" | "textareaCounterErrorColor" | "textareaCounterHelpIconColor" | "radioBulletSize" | "radioOutlineWidth" | "radioTextColor" | "radioSize" | "radioSizeAfter" | "radioFontSize" | "radioLineHeight" | "radioLabelGap" | "radioPaddingY" | "radioVerticalAlign" | "radioBgImage" | "radioBgColor" | "radioHoverBg" | "radioActiveBg" | "radioBorderWidth" | "radioBorderColor" | "radioBoxShadow" | "radioBorder" | "radioBorderColorFocus" | "radioBorderColorWarning" | "radioBorderColorError" | "radioHoverShadow" | "radioActiveShadow" | "radioFocusShadow" | "radioCheckedBgColor" | "radioCheckedBorderColor" | "radioCheckedBulletColor" | "radioCheckedHoverBgColor" | "radioDisabledBg" | "radioDisabledShadow" | "radioLabelDisplay" | "radioBorderWidthCompensation" | "radioMarginY" | "radioGroupLegacyItemGap" | "tabFontSize" | "tabPaddingX" | "tabsMarginX" | "tabPaddingY" | "tabLineHeight" | "tabBorderWidth" | "tabOutlineWidth" | "tabTextColorDefault" | "tabColorFocus" | "tabColorError" | "tabColorWarning" | "tabColorSuccess" | "tabColorPrimary" | "tabColorHover" | "tabColorHoverError" | "tabColorHoverWarning" | "tabColorHoverSuccess" | "tabColorHoverPrimary" | "spinnerBgColor" | "spinnerColor" | "spinnerDimmedColor" | "spinnerCaptionColor" | "spinnerFontSizeSmall" | "spinnerFontSizeMedium" | "spinnerFontSizeLarge" | "spinnerLineHeightSmall" | "spinnerLineHeightMedium" | "spinnerLineHeightLarge" | "spinnerCaptionGapSmall" | "spinnerCaptionGapMedium" | "spinnerCaptionGapLarge" | "switcherTextColor" | "switcherOutlineWidth" | "switcherLabelFontSizeSmall" | "switcherLabelFontSizeMedium" | "switcherLabelFontSizeLarge" | "switcherLabelLineHeightSmall" | "switcherLabelLineHeightMedium" | "switcherLabelLineHeightLarge" | "switcherLabelGapSmall" | "switcherLabelGapMedium" | "switcherLabelGapLarge" | "switcherButtonPaddingXSmall" | "switcherButtonPaddingXMedium" | "switcherButtonPaddingXLarge" | "switcherButtonPaddingYSmall" | "switcherButtonPaddingYMedium" | "switcherButtonPaddingYLarge" | "switcherButtonLineHeightSmall" | "switcherButtonLineHeightMedium" | "switcherButtonLineHeightLarge" | "switcherButtonFontSizeSmall" | "switcherButtonFontSizeMedium" | "switcherButtonFontSizeLarge" | "switcherButtonBorderRadiusSmall" | "switcherButtonBorderRadiusMedium" | "switcherButtonBorderRadiusLarge" | "switcherButtonBorderWidth" | "switcherButtonDisabledBorderColor" | "switcherButtonCheckedDisabledShadow" | "scrollContainerScrollBarSize" | "scrollContainerScrollBarHoverSize" | "scrollContainerScrollBarColor" | "scrollContainerScrollBarInvertColor")[];
20
+ export declare const ALL_USED_VARIABLES: ("black" | "blue" | "gray" | "green" | "red" | "white" | "yellow" | "prototype" | "fontFamilyCompensationBaseline" | "brandXLight" | "brandLight" | "brand" | "brandDark" | "brandXDark" | "grayXxLight" | "grayXLight" | "grayLight" | "grayDark" | "blueXxLight" | "blueLight" | "blueDark" | "blueXDark" | "greenXxLight" | "greenDark" | "redXxLight" | "redDark" | "yellowXxLight" | "yellowDark" | "bgDefault" | "bgDisabled" | "errorMain" | "errorSecondary" | "errorText" | "warningMain" | "warningSecondary" | "warningText" | "borderColorFocusLight" | "borderColorGrayDark" | "borderColorGrayLight" | "borderColorDisabled" | "placeholderColor" | "outlineColorFocus" | "placeholderColorLight" | "blinkColor" | "controlBorderWidth" | "controlOutlineWidth" | "controlLineHeightSmall" | "controlLineHeightMedium" | "controlLineHeightLarge" | "controlPaddingYSmall" | "controlPaddingYMedium" | "controlPaddingYLarge" | "textColorDefault" | "textColorInvert" | "textColorDisabled" | "textColorDisabledContrast" | "fontSizeSmall" | "fontSizeMedium" | "fontSizeLarge" | "specificityLevel" | "bgActive" | "borderColorFocus" | "borderColorError" | "borderColorWarning" | "controlHeightSmall" | "controlHeightMedium" | "controlHeightLarge" | "linkColor" | "linkActiveColor" | "linkHoverTextDecoration" | "linkSuccessColor" | "linkSuccessHoverColor" | "linkSuccessActiveColor" | "linkDangerColor" | "linkDangerHoverColor" | "linkDangerActiveColor" | "linkIconMarginRight" | "linkHoverColor" | "linkDisabledColor" | "linkButtonLineHeight" | "linkButtonPaddingX" | "tokenDisabledBg" | "tokenTextColorDisabled" | "tokenFontSize" | "tokenMarginY" | "tokenMarginX" | "tokenLineHeight" | "tokenPaddingY" | "tokenPaddingX" | "tokenMarginBeforeIcon" | "tokenRemoveIconSize" | "tokenRemoveIconPaddingY" | "tokenRemoveIconPaddingX" | "tokenRemoveIconGap" | "tokenRemoveIconBoxSizing" | "tokenBorderRadius" | "tokenBorderWidth" | "tokenBorderColorDisabled" | "tokenDefaultIdle" | "tokenDefaultActive" | "tokenGrayIdle" | "tokenGrayActive" | "tokenBlueIdle" | "tokenBlueActive" | "tokenGreenIdle" | "tokenGreenActive" | "tokenYellowIdle" | "tokenYellowActive" | "tokenRedIdle" | "tokenRedActive" | "tokenWhite" | "tokenBlack" | "tokenBorderColorWarning" | "tokenBorderColorError" | "tokenOutlineWidth" | "tokenLegacyTextShift" | "tokenPaddingYDisabled" | "tokenPaddingXDisabled" | "tokenMarginYDisabled" | "tokenMarginXDisabled" | "tokenShadowDisabled" | "tokenInputBorderColor" | "tokenInputBorderColorFocus" | "tokenInputBorderColorError" | "tokenInputBorderColorWarning" | "tokenInputBorderTopColor" | "tokenInputPlaceholderColor" | "tokenInputPlaceholderColorLight" | "tokenInputDisabledBg" | "tokenInputDisabledBorderColor" | "tokenInputBorderWidth" | "tokenInputOutlineWidth" | "tokenInputBg" | "tokenInputShadow" | "tokenInputTextColor" | "tokenInputTextColorDisabled" | "tokenInputPlaceholderColorDisabled" | "tokenInputPaddingY" | "tokenInputPaddingX" | "tokenInputFontSize" | "tokenInputLineHeight" | "tokenInputInputPaddingLeft" | "tokenInputInputPaddingRight" | "loaderBg" | "loaderOpacity" | "btnBackgroundClip" | "btnArrowBgImageActive" | "btnArrowBgImageChecked" | "btnLinkBorderRadius" | "btnFocusShadowWidth" | "btnDisabledBorderColor" | "btnCheckedBg" | "btnCheckedDisabledBg" | "btnCheckedDisabledColor" | "btnCheckedTextColor" | "btnCheckedDisabledBorderColor" | "btnCheckedShadow" | "btnCheckedDisabledShadow" | "btnBorderRadiusSmall" | "btnBorderRadiusMedium" | "btnBorderRadiusLarge" | "btnBorderWidth" | "btnInsetWidth" | "btnOutlineWidth" | "btnPaddingXSmall" | "btnPaddingXMedium" | "btnPaddingXLarge" | "btnIconGapSmall" | "btnIconGapMedium" | "btnIconGapLarge" | "btnIconSizeSmall" | "btnIconSizeMedium" | "btnIconSizeLarge" | "btnDefaultBg" | "btnDefaultBgStart" | "btnDefaultBgEnd" | "btnDefaultCheckedBorderColor" | "btnDefaultTextColor" | "btnDefaultHoverBg" | "btnDefaultHoverBgStart" | "btnDefaultHoverBgEnd" | "btnDefaultActiveBg" | "btnDefaultHoverBorderColor" | "btnDefaultHoverBorderBottomColor" | "btnDefaultActiveBorderColor" | "btnDefaultActiveBorderTopColor" | "btnDefaultBorderColor" | "btnDefaultBorderBottomColor" | "btnDefaultActiveShadow" | "btnSuccessBg" | "btnSuccessHoverBg" | "btnSuccessHoverBorderColor" | "btnSuccessHoverBorderBottomColor" | "btnSuccessBorderColor" | "btnSuccessBorderBottomColor" | "btnSuccessBgStart" | "btnSuccessBgEnd" | "btnSuccessTextColor" | "btnSuccessHoverBgStart" | "btnSuccessHoverBgEnd" | "btnSuccessActiveBg" | "btnSuccessActiveBorderColor" | "btnSuccessActiveBorderTopColor" | "btnSuccessActiveShadow" | "btnPrimaryBg" | "btnPrimaryHoverBg" | "btnPrimaryHoverBorderColor" | "btnPrimaryHoverBorderBottomColor" | "btnPrimaryBorderColor" | "btnPrimaryBorderBottomColor" | "btnPrimaryBgStart" | "btnPrimaryBgEnd" | "btnPrimaryTextColor" | "btnPrimaryHoverBgStart" | "btnPrimaryHoverBgEnd" | "btnPrimaryActiveBg" | "btnPrimaryActiveBorderColor" | "btnPrimaryActiveBorderTopColor" | "btnPrimaryActiveShadow" | "btnDangerBg" | "btnDangerHoverBg" | "btnDangerHoverBorderColor" | "btnDangerHoverBorderBottomColor" | "btnDangerBorderColor" | "btnDangerBorderBottomColor" | "btnDangerBgStart" | "btnDangerBgEnd" | "btnDangerTextColor" | "btnDangerHoverBgStart" | "btnDangerHoverBgEnd" | "btnDangerActiveBg" | "btnDangerActiveBorderColor" | "btnDangerActiveBorderTopColor" | "btnDangerActiveShadow" | "btnPayBg" | "btnPayHoverBg" | "btnPayHoverBorderColor" | "btnPayHoverBorderBottomColor" | "btnPayBorderColor" | "btnPayBorderBottomColor" | "btnPayBgStart" | "btnPayBgEnd" | "btnPayTextColor" | "btnPayHoverBgStart" | "btnPayHoverBgEnd" | "btnPayActiveBg" | "btnPayActiveBorderColor" | "btnPayActiveBorderTopColor" | "btnPayActiveShadow" | "btnMenuArrowColor" | "btnFontSizeSmall" | "btnFontSizeMedium" | "btnFontSizeLarge" | "btnLineHeightSmall" | "btnLineHeightMedium" | "btnLineHeightLarge" | "btnPaddingYSmall" | "btnPaddingYMedium" | "btnPaddingYLarge" | "btnDisabledBg" | "btnBorderColorWarning" | "btnBorderColorError" | "btnHeightSmall" | "btnHeightMedium" | "btnHeightLarge" | "btnLinkColor" | "btnLinkHoverColor" | "btnLinkHoverTextDecoration" | "btnLinkIconMarginRight" | "btnErrorSecondary" | "btnWarningSecondary" | "btnOutlineColorFocus" | "btnInsetColor" | "btnBorderColorFocus" | "btnLinkDisabledColor" | "btnDisabledTextColor" | "selectPlaceholderColor" | "selectBorderWidth" | "selectPlaceholderColorDisabled" | "selectOutlineWidth" | "selectLineHeightSmall" | "selectFontSizeSmall" | "selectPaddingXSmall" | "selectPaddingYSmall" | "selectBorderRadiusSmall" | "selectIconGapSmall" | "selectLineHeightMedium" | "selectFontSizeMedium" | "selectPaddingXMedium" | "selectPaddingYMedium" | "selectBorderRadiusMedium" | "selectIconGapMedium" | "selectLineHeightLarge" | "selectFontSizeLarge" | "selectPaddingXLarge" | "selectPaddingYLarge" | "selectBorderRadiusLarge" | "selectIconGapLarge" | "selectMenuArrowColor" | "selectIconSizeSmall" | "selectIconSizeMedium" | "selectIconSizeLarge" | "tooltipPaddingY" | "tooltipPaddingX" | "tooltipCloseBtnPadding" | "tooltipCloseBtnColor" | "tooltipCloseBtnHoverColor" | "tooltipTextColor" | "tooltipBorder" | "tooltipBorderRadius" | "tooltipPinOffset" | "tooltipPinOffsetX" | "tooltipPinOffsetY" | "tooltipMargin" | "tooltipPinSize" | "tooltipMenuPinOffset" | "tooltipMenuMargin" | "tooltipMenuPinSize" | "kebabPinOffset" | "kebabPinSize" | "kebabMargin" | "kebabBackground" | "kebabBackgroundHover" | "kebabBorderRadius" | "kebabBorder" | "modalBackBg" | "modalBackOpacity" | "modalCloseButtonColor" | "modalCloseButtonDisabledColor" | "modalCloseButtonHoverColor" | "modalCloseButtonPadding" | "modalCloseButtonLegacyShift" | "modalCloseButtonBottomPadding" | "modalCloseButtonClickArea" | "modalCloseIconSize" | "modalCloseLegacyGap" | "modalCloseWrapperLegacyGap" | "modalFixedHeaderBg" | "modalFixedHeaderShadow" | "modalFixedFooterShadow" | "modalFooterBg" | "modalAdaptiveThreshold" | "modalPaddingTop" | "modalPaddingLeft" | "modalPaddingRight" | "modalHeaderFontSize" | "modalHeaderTextColor" | "modalHeaderLineHeight" | "modalHeaderPaddingBottom" | "modalHeaderPaddingTop" | "modalFixedHeaderPaddingBottom" | "modalBodyPaddingBottom" | "modalFooterPaddingTop" | "modalFooterPaddingBottom" | "modalPaddingBottom" | "modalFooterPanelPaddingTop" | "modalFooterPanelPaddingBottom" | "sidePageFooterPanelBg" | "sidePageBackingBg" | "sidePageBackingBgOpacity" | "sidePageCloseButtonColor" | "sidePageCloseButtonHoverColor" | "sidePageContainerShadow" | "sidePagePaddingLeft" | "sidePagePaddingRight" | "sidePagePaddingTop" | "sidePagePaddingBottom" | "sidePageFooterPaddingTop" | "sidePageFooterPaddingBottom" | "sidePageBgDefault" | "sidePageHeaderTextColor" | "sidePageHeaderFontSize" | "sidePageHeaderLineHeight" | "sidePageHeaderPaddingBottom" | "sidePageHeaderPaddingTop" | "sidePageHeaderFixedFontSize" | "sidePageHeaderFixedLineHeight" | "sidePageHeaderFixedPaddingY" | "sidePageHeaderStickyOffset" | "sidePageCloseButtonPadding" | "sidePageCloseButtonLegacyPaddingLeft" | "sidePageFooterPanelPaddingTop" | "sidePageFooterPanelPaddingBottom" | "sidePageCloseIconSize" | "sidePageCloseButtonClickArea" | "sidePageFixedHeaderShadow" | "sidePageFixedFooterShadow" | "dateInputIconColor" | "dateInputMaskColor" | "dateInputComponentSelectedBgColor" | "calendarCellBg" | "calendarCellHoverColor" | "calendarCellActiveHoverColor" | "calendarCellWeekendColor" | "calendarCellTodayBorder" | "calendarCellSelectedBgColor" | "calendarCellSelectedFontColor" | "calendarCellSize" | "calendarMonthHeaderStickedBgColor" | "calendarMonthTitleBorderBottomColor" | "calendarCellHoverBgColor" | "calendarPaddingX" | "calendarMonthTitleLineHeight" | "calendarMonthTitlePaddingTop" | "calendarMonthTitlePaddingBottom" | "calendarMonthTitleMarginX" | "calendarMonthTitleMarginBottom" | "calendarWrapperHeight" | "calendarMonthMarginBottom" | "calendarMaxMonthsToAppendOnScroll" | "dateSelectLineHeight" | "dateSelectFontSize" | "dateSelectFontWeight" | "dateSelectMenuItemBgSelected" | "dateSelectTextColorDisabled" | "dateSelectTextColorDefault" | "dateSelectLinkColor" | "dateSelectPopupBoxShadow" | "dateSelectTextColorInvert" | "datePickerOpenBtnColor" | "pickerBg" | "pickerShadow" | "pickerTodayWrapperBgColor" | "pickerTodayWrapperBorderTop" | "pickerTodayWrapperHoverBgColor" | "pickerTodayWrapperFontSize" | "pickerTodayWrapperLineHeight" | "pickerTodayWrapperPaddingTop" | "pickerTodayWrapperPaddingBottom" | "dateSelectMenuBg" | "dateSelectMenuItemBgActive" | "dateSelectMenuItemBgDisabled" | "dateSelectMenuItemFontActive" | "dateSelectMenuItemFontSelected" | "dateSelectMenuItemFontDisabled" | "pagingFontSize" | "pagingForwardIconSize" | "pagingForwardIconMarginTop" | "pagingPageLinkPaddingX" | "pagingPageLinkPaddingY" | "pagingPageLinkLegacyPaddingY" | "pagingPageLinkMinWidth" | "pagingPageForwardLinkMarginTop" | "pagingPageForwardLinkMarginLeft" | "pagingPageForwardLinkPaddingRight" | "pagingLineHeight" | "pagingDotsColor" | "pagingDotsPadding" | "pagingPageLinkActiveBg" | "pagingPageLinkActiveColor" | "pagingPageLinkHoverBg" | "pagingPageLinkHintColor" | "pagingPageLinkHintFontSize" | "pagingPageLinkHintLineHeight" | "pagingPageLinkBorderRadius" | "pagingPageLinkMargin" | "pagingForwardLinkColor" | "pagingForwardLinkDisabledColor" | "hintColor" | "hintFontSize" | "hintLineHeight" | "hintMaxWidth" | "hintPaddingY" | "hintPaddingX" | "hintTextAlign" | "hintBgColor" | "hintBorder" | "hintBorderRadius" | "hintPinOffset" | "hintMargin" | "toastFontSize" | "toastLineHeight" | "toastPaddingY" | "toastPaddingX" | "toastBorderRadius" | "toastBorder" | "toastTop" | "toastBg" | "toastColor" | "toastLinkColor" | "toastClosePadding" | "toastCloseColor" | "toastCloseHoverColor" | "toastCloseSize" | "dropdownMenuSelectedBg" | "dropdownMenuHoverBg" | "menuBgDefault" | "menuBorder" | "menuShadow" | "menuPaddingY" | "menuItemTextColor" | "menuItemSelectedBg" | "menuItemHoverBg" | "menuItemIconWidth" | "menuItemIconGap" | "menuItemIconLegacyMargin" | "menuItemIconLegacyShift" | "menuItemPaddingForIcon" | "menuItemLineHeight" | "menuItemFontSize" | "menuItemPaddingX" | "menuItemPaddingY" | "menuItemLegacyPaddingX" | "menuItemLegacyPaddingY" | "menuItemHoverColor" | "menuItemDisabledColor" | "menuItemLinkColor" | "menuItemCommentColor" | "menuItemCommentColorHover" | "menuHeaderColor" | "menuHeaderLineHeight" | "menuHeaderFontSize" | "menuHeaderPaddingX" | "menuHeaderPaddingTop" | "menuHeaderPaddingBottom" | "menuHeaderLegacyPaddingRight" | "menuSeparatorBorderColor" | "menuSeparatorMarginY" | "menuSeparatorBorderWidth" | "toggleTextColor" | "toggleHandleActiveWidthIncrement" | "toggleHandleBorderRadius" | "toggleHeight" | "toggleWidth" | "toggleBorderRadius" | "toggleBg" | "toggleDisabledHandleBg" | "toggleBaseBg" | "toggleBgDisabled" | "toggleBgDisabledChecked" | "toggleBgHover" | "toggleBgChecked" | "toggleBorderWidth" | "toggleOutlineWidth" | "toggleBorderColor" | "toggleBorderColorDisabled" | "toggleBorderColorDisabledChecked" | "toggleBgFocus" | "toggleBgActive" | "toggleShadowColorError" | "toggleShadowColorWarning" | "toggleFocusShadowColor" | "toggleCaptionGap" | "popupBorder" | "popupBorderRadius" | "popupBorderColor" | "popupDropShadow" | "popupBoxShadow" | "popupTextColor" | "popupBackground" | "popupPinOffset" | "popupPinOffsetX" | "popupPinOffsetY" | "popupMargin" | "popupPinSize" | "inputTextColor" | "inputShadow" | "inputBg" | "inputIconColor" | "inputColor" | "inputWidth" | "inputTextColorDisabled" | "inputFontSizeSmall" | "inputFontSizeMedium" | "inputFontSizeLarge" | "inputLineHeightSmall" | "inputLineHeightMedium" | "inputLineHeightLarge" | "inputHeightSmall" | "inputHeightMedium" | "inputHeightLarge" | "inputPaddingYSmall" | "inputPaddingYMedium" | "inputPaddingYLarge" | "inputPaddingXSmall" | "inputPaddingXMedium" | "inputPaddingXLarge" | "inputIconGapSmall" | "inputIconGapMedium" | "inputIconGapLarge" | "inputIconSizeSmall" | "inputIconSizeMedium" | "inputIconSizeLarge" | "inputFocusShadow" | "inputDisabledBg" | "inputDisabledBorderColor" | "inputFocusOutline" | "inputBorderWidth" | "inputOutlineWidth" | "inputBorderRadiusSmall" | "inputBorderRadiusMedium" | "inputBorderRadiusLarge" | "inputBorderColor" | "inputBorderColorFocus" | "inputBorderColorError" | "inputBorderColorWarning" | "inputBorderTopColor" | "inputPlaceholderColor" | "inputPlaceholderColorDisabled" | "inputPlaceholderColorLight" | "inputBlinkColor" | "checkboxBorderWidthCompensation" | "checkboxFontSize" | "checkboxLineHeight" | "checkboxBoxSize" | "checkboxLabelGap" | "checkboxPaddingY" | "checkboxBgStart" | "checkboxBgEnd" | "checkboxTextColorDefault" | "checkboxTextColorDisabled" | "checkboxShadowDisabled" | "checkboxBorder" | "checkboxBorderWidth" | "checkboxShadow" | "checkboxShadowHover" | "checkboxCheckedColor" | "checkboxOutlineColorFocus" | "checkboxBorderColorWarning" | "checkboxBorderColorError" | "checkboxCheckedHoverShadow" | "checkboxBorderRadius" | "checkboxOutlineWidth" | "checkboxCheckedShadow" | "checkboxCheckedActiveShadow" | "checkboxBorderColorFocus" | "checkboxBg" | "checkboxHoverBg" | "checkboxActiveBg" | "checkboxCheckedBg" | "checkboxBgDisabled" | "checkboxCheckedHoverBg" | "checkboxCheckedActiveBg" | "checkboxShadowActive" | "textareaBg" | "textareaColor" | "textareaTextColorDisabled" | "textareaPlaceholderColorLight" | "textareaPlaceholderColor" | "textareaPlaceholderColorDisabled" | "textareaShadow" | "textareaFontSize" | "textareaLineHeight" | "textareaBorderRadius" | "textareaBorderWidth" | "textareaOutlineWidth" | "textareaMinHeight" | "textareaWidth" | "textareaPaddingX" | "textareaPaddingY" | "textareaBorderColor" | "textareaBorderTopColor" | "textareaBorderColorFocus" | "textareaBorderColorWarning" | "textareaBorderColorError" | "textareaDisabledBg" | "textareaDisabledBorderColor" | "textareaCounterColor" | "textareaCounterBg" | "textareaCounterErrorColor" | "textareaCounterHelpIconColor" | "radioBulletSize" | "radioOutlineWidth" | "radioTextColor" | "radioSize" | "radioSizeAfter" | "radioFontSize" | "radioLineHeight" | "radioLabelGap" | "radioPaddingY" | "radioVerticalAlign" | "radioBgImage" | "radioBgColor" | "radioHoverBg" | "radioActiveBg" | "radioBorderWidth" | "radioBorderColor" | "radioBoxShadow" | "radioBorder" | "radioBorderColorFocus" | "radioBorderColorWarning" | "radioBorderColorError" | "radioHoverShadow" | "radioActiveShadow" | "radioFocusShadow" | "radioCheckedBgColor" | "radioCheckedBorderColor" | "radioCheckedBulletColor" | "radioCheckedHoverBgColor" | "radioDisabledBg" | "radioDisabledShadow" | "radioLabelDisplay" | "radioBorderWidthCompensation" | "radioMarginY" | "radioGroupLegacyItemGap" | "tabFontSize" | "tabPaddingX" | "tabsMarginX" | "tabPaddingY" | "tabLineHeight" | "tabBorderWidth" | "tabOutlineWidth" | "tabTextColorDefault" | "tabColorFocus" | "tabColorError" | "tabColorWarning" | "tabColorSuccess" | "tabColorPrimary" | "tabColorHover" | "tabColorHoverError" | "tabColorHoverWarning" | "tabColorHoverSuccess" | "tabColorHoverPrimary" | "spinnerBgColor" | "spinnerColor" | "spinnerDimmedColor" | "spinnerCaptionColor" | "spinnerFontSizeSmall" | "spinnerFontSizeMedium" | "spinnerFontSizeLarge" | "spinnerLineHeightSmall" | "spinnerLineHeightMedium" | "spinnerLineHeightLarge" | "spinnerCaptionGapSmall" | "spinnerCaptionGapMedium" | "spinnerCaptionGapLarge" | "switcherTextColor" | "switcherOutlineWidth" | "switcherLabelFontSizeSmall" | "switcherLabelFontSizeMedium" | "switcherLabelFontSizeLarge" | "switcherLabelLineHeightSmall" | "switcherLabelLineHeightMedium" | "switcherLabelLineHeightLarge" | "switcherLabelGapSmall" | "switcherLabelGapMedium" | "switcherLabelGapLarge" | "switcherButtonPaddingXSmall" | "switcherButtonPaddingXMedium" | "switcherButtonPaddingXLarge" | "switcherButtonPaddingYSmall" | "switcherButtonPaddingYMedium" | "switcherButtonPaddingYLarge" | "switcherButtonLineHeightSmall" | "switcherButtonLineHeightMedium" | "switcherButtonLineHeightLarge" | "switcherButtonFontSizeSmall" | "switcherButtonFontSizeMedium" | "switcherButtonFontSizeLarge" | "switcherButtonBorderRadiusSmall" | "switcherButtonBorderRadiusMedium" | "switcherButtonBorderRadiusLarge" | "switcherButtonBorderWidth" | "switcherButtonDisabledBorderColor" | "switcherButtonCheckedDisabledShadow" | "scrollContainerScrollBarSize" | "scrollContainerScrollBarHoverSize" | "scrollContainerScrollBarColor" | "scrollContainerScrollBarInvertColor")[];
21
21
  export declare const CALLS_COUNT: number;
22
22
  export declare const EXECUTION_TIME: number;