@skbkontur/react-ui 6.0.7 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/components/Autocomplete/Autocomplete.js +15 -4
  3. package/components/Autocomplete/Autocomplete.js.map +1 -1
  4. package/components/Button/Button.d.ts +1 -1
  5. package/components/Button/Button.js +5 -4
  6. package/components/Button/Button.js.map +1 -1
  7. package/components/Calendar/CalendarDay.js +3 -0
  8. package/components/Calendar/CalendarDay.js.map +1 -1
  9. package/components/Calendar/DayCellView.styles.d.ts +1 -0
  10. package/components/Calendar/DayCellView.styles.js +6 -3
  11. package/components/Calendar/DayCellView.styles.js.map +1 -1
  12. package/components/DatePicker/MobilePicker.js +1 -1
  13. package/components/DatePicker/MobilePicker.js.map +1 -1
  14. package/components/DateRangePicker/DateRangePicker.js +1 -1
  15. package/components/DateRangePicker/DateRangePicker.js.map +1 -1
  16. package/components/FxInput/FxInputRestoreBtn.js +1 -1
  17. package/components/FxInput/FxInputRestoreBtn.js.map +1 -1
  18. package/components/Hint/Hint.js +10 -3
  19. package/components/Hint/Hint.js.map +1 -1
  20. package/components/Input/Input.d.ts +19 -1
  21. package/components/Input/Input.js +10 -3
  22. package/components/Input/Input.js.map +1 -1
  23. package/components/Input/InputLayout/InputLayout.d.ts +3 -1
  24. package/components/Input/InputLayout/InputLayout.js +5 -2
  25. package/components/Input/InputLayout/InputLayout.js.map +1 -1
  26. package/components/Input/InputLayout/InputLayout.styles.d.ts +6 -0
  27. package/components/Input/InputLayout/InputLayout.styles.js +19 -1
  28. package/components/Input/InputLayout/InputLayout.styles.js.map +1 -1
  29. package/components/Input/InputLayout/InputLayoutAside.d.ts +2 -0
  30. package/components/Input/InputLayout/InputLayoutAside.js +2 -2
  31. package/components/Input/InputLayout/InputLayoutAside.js.map +1 -1
  32. package/components/Input/InputLayout/InputLayoutAsideCounter.d.ts +11 -0
  33. package/components/Input/InputLayout/InputLayoutAsideCounter.js +74 -0
  34. package/components/Input/InputLayout/InputLayoutAsideCounter.js.map +1 -0
  35. package/components/Loader/Loader.d.ts +12 -4
  36. package/components/Loader/Loader.js +18 -7
  37. package/components/Loader/Loader.js.map +1 -1
  38. package/components/MenuItem/MenuItem.d.ts +2 -0
  39. package/components/MenuItem/MenuItem.js +32 -8
  40. package/components/MenuItem/MenuItem.js.map +1 -1
  41. package/components/MenuItem/MenuItem.styles.d.ts +3 -0
  42. package/components/MenuItem/MenuItem.styles.js +25 -16
  43. package/components/MenuItem/MenuItem.styles.js.map +1 -1
  44. package/components/Select/Select.js +11 -1
  45. package/components/Select/Select.js.map +1 -1
  46. package/components/SingleToast/SingleToast.d.ts +9 -6
  47. package/components/SingleToast/SingleToast.js +9 -6
  48. package/components/SingleToast/SingleToast.js.map +1 -1
  49. package/components/Spinner/Spinner.d.ts +23 -33
  50. package/components/Spinner/Spinner.js +23 -19
  51. package/components/Spinner/Spinner.js.map +1 -1
  52. package/components/Spinner/Spinner.styles.d.ts +0 -3
  53. package/components/Spinner/Spinner.styles.js +6 -15
  54. package/components/Spinner/Spinner.styles.js.map +1 -1
  55. package/components/Switcher/Switcher.js +1 -0
  56. package/components/Switcher/Switcher.js.map +1 -1
  57. package/components/Textarea/Textarea.js +1 -1
  58. package/components/Textarea/Textarea.js.map +1 -1
  59. package/components/Textarea/Textarea.styles.d.ts +1 -0
  60. package/components/Textarea/Textarea.styles.js +7 -4
  61. package/components/Textarea/Textarea.styles.js.map +1 -1
  62. package/components/Textarea/TextareaCounter.d.ts +2 -0
  63. package/components/Textarea/TextareaCounter.js +22 -4
  64. package/components/Textarea/TextareaCounter.js.map +1 -1
  65. package/components/Toast/Toast.d.ts +13 -14
  66. package/components/Toast/Toast.js +3 -3
  67. package/components/Toast/Toast.js.map +1 -1
  68. package/components/Toast/ToastView.d.ts +8 -5
  69. package/components/Toast/ToastView.js +28 -8
  70. package/components/Toast/ToastView.js.map +1 -1
  71. package/components/Toast/ToastView.styles.d.ts +7 -0
  72. package/components/Toast/ToastView.styles.js +30 -8
  73. package/components/Toast/ToastView.styles.js.map +1 -1
  74. package/components/TokenInput/TokenInput.d.ts +18 -2
  75. package/components/TokenInput/TokenInput.js +236 -79
  76. package/components/TokenInput/TokenInput.js.map +1 -1
  77. package/components/TokenInput/TokenInput.styles.d.ts +1 -0
  78. package/components/TokenInput/TokenInput.styles.js +12 -9
  79. package/components/TokenInput/TokenInput.styles.js.map +1 -1
  80. package/components/TokenInput/TokenInputMenu.d.ts +2 -1
  81. package/components/TokenInput/TokenInputMenu.js +1 -1
  82. package/components/TokenInput/TokenInputMenu.js.map +1 -1
  83. package/components/TokenInput/TokenInputMobileMenu.d.ts +25 -0
  84. package/components/TokenInput/TokenInputMobileMenu.js +40 -0
  85. package/components/TokenInput/TokenInputMobileMenu.js.map +1 -0
  86. package/components/TokenInput/TokenInputReducer.d.ts +2 -0
  87. package/components/TokenInput/TokenInputReducer.js +14 -0
  88. package/components/TokenInput/TokenInputReducer.js.map +1 -1
  89. package/components/Tooltip/Tooltip.d.ts +4 -0
  90. package/components/Tooltip/Tooltip.js +50 -11
  91. package/components/Tooltip/Tooltip.js.map +1 -1
  92. package/internal/CloseButtonIcon/CloseButtonIcon.js +1 -1
  93. package/internal/CloseButtonIcon/CloseButtonIcon.js.map +1 -1
  94. package/internal/CommonWrapper/CommonWrapper.js +5 -0
  95. package/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  96. package/internal/CustomComboBox/ComboBoxMenu.js +1 -1
  97. package/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
  98. package/internal/CustomComboBox/ComboBoxView.js +13 -2
  99. package/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  100. package/internal/InputLikeText/InputLikeText.d.ts +1 -1
  101. package/internal/InputLikeText/InputLikeText.js.map +1 -1
  102. package/internal/Menu/Menu.js +3 -0
  103. package/internal/Menu/Menu.js.map +1 -1
  104. package/internal/Menu/Menu.styles.d.ts +1 -0
  105. package/internal/Menu/Menu.styles.js +13 -10
  106. package/internal/Menu/Menu.styles.js.map +1 -1
  107. package/internal/MenuMessage/MenuMessage.js +17 -1
  108. package/internal/MenuMessage/MenuMessage.js.map +1 -1
  109. package/internal/MenuMessage/MenuMessage.styles.d.ts +3 -0
  110. package/internal/MenuMessage/MenuMessage.styles.js +13 -4
  111. package/internal/MenuMessage/MenuMessage.styles.js.map +1 -1
  112. package/internal/MobilePopup/MobilePopup.d.ts +8 -0
  113. package/internal/MobilePopup/MobilePopup.js +34 -11
  114. package/internal/MobilePopup/MobilePopup.js.map +1 -1
  115. package/internal/MobilePopup/MobilePopup.styles.d.ts +7 -0
  116. package/internal/MobilePopup/MobilePopup.styles.js +34 -10
  117. package/internal/MobilePopup/MobilePopup.styles.js.map +1 -1
  118. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.d.ts +8 -1
  119. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js +18 -1
  120. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js.map +1 -1
  121. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.d.ts +3 -0
  122. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.js +14 -4
  123. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.js.map +1 -1
  124. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.d.ts +4 -0
  125. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js +48 -11
  126. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js.map +1 -1
  127. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.d.ts +6 -0
  128. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.js +28 -8
  129. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.js.map +1 -1
  130. package/internal/Popup/Popup.d.ts +13 -9
  131. package/internal/Popup/Popup.js +130 -53
  132. package/internal/Popup/Popup.js.map +1 -1
  133. package/internal/Popup/Popup.styles.js +1 -1
  134. package/internal/Popup/Popup.styles.js.map +1 -1
  135. package/internal/Popup/PopupHelper.d.ts +8 -0
  136. package/internal/Popup/PopupHelper.js +39 -0
  137. package/internal/Popup/PopupHelper.js.map +1 -1
  138. package/internal/Popup/PopupPin.d.ts +19 -4
  139. package/internal/Popup/PopupPin.js +109 -8
  140. package/internal/Popup/PopupPin.js.map +1 -1
  141. package/internal/Popup/PopupPin.styles.d.ts +2 -0
  142. package/internal/Popup/PopupPin.styles.js +11 -5
  143. package/internal/Popup/PopupPin.styles.js.map +1 -1
  144. package/internal/PopupMenu/PopupMenu.d.ts +2 -1
  145. package/internal/PopupMenu/PopupMenu.js +21 -18
  146. package/internal/PopupMenu/PopupMenu.js.map +1 -1
  147. package/internal/SpinnerIcon/SpinnerIcon.d.ts +3 -3
  148. package/internal/SpinnerIcon/SpinnerIcon.js +4 -4
  149. package/internal/SpinnerIcon/SpinnerIcon.js.map +1 -1
  150. package/internal/icons2022/LoadingIcon.js +1 -1
  151. package/internal/icons2022/LoadingIcon.js.map +1 -1
  152. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Light.d.ts +2 -0
  153. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Light.js +21 -0
  154. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Light.js.map +1 -0
  155. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon20Regular.d.ts +2 -0
  156. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon20Regular.js +21 -0
  157. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon20Regular.js.map +1 -0
  158. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon24Regular.d.ts +2 -0
  159. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon24Regular.js +21 -0
  160. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon24Regular.js.map +1 -0
  161. package/internal/themes/BasicTheme.d.ts +83 -4
  162. package/internal/themes/BasicTheme.js +187 -6
  163. package/internal/themes/BasicTheme.js.map +1 -1
  164. package/internal/themes/DarkTheme6_1.d.ts +1 -0
  165. package/internal/themes/DarkTheme6_1.js +41 -0
  166. package/internal/themes/DarkTheme6_1.js.map +1 -0
  167. package/internal/themes/LightTheme6_1.d.ts +1 -0
  168. package/internal/themes/LightTheme6_1.js +39 -0
  169. package/internal/themes/LightTheme6_1.js.map +1 -0
  170. package/lib/getMenuPositions.js +11 -11
  171. package/lib/getMenuPositions.js.map +1 -1
  172. package/lib/theming/themes/DarkTheme.d.ts +1 -0
  173. package/lib/theming/themes/DarkTheme.js +3 -1
  174. package/lib/theming/themes/DarkTheme.js.map +1 -1
  175. package/lib/theming/themes/LightTheme.d.ts +1 -0
  176. package/lib/theming/themes/LightTheme.js +3 -1
  177. package/lib/theming/themes/LightTheme.js.map +1 -1
  178. package/package.json +1 -1
@@ -82,7 +82,7 @@ import { CommonWrapper } from '../../internal/CommonWrapper/index.js';
82
82
  import { PopupIds } from '../../internal/Popup/index.js';
83
83
  import { blink } from '../../lib/blink.js';
84
84
  import { createPropsGetter } from '../../lib/createPropsGetter.js';
85
- import { isKeyArrowHorizontal, isKeyArrowLeft, isKeyArrowRight, isKeyArrowUp, isKeyArrowVertical, isKeyBackspace, isKeyComma, isKeyDelete, isKeyEnter, isKeyEscape, isShortcutSelectAll, } from '../../lib/events/keyboard/identifiers.js';
85
+ import { isKeyArrowHorizontal, isKeyArrowLeft, isKeyArrowRight, isKeyArrowUp, isKeyArrowVertical, isKeyBackspace, isKeyComma, isCodeComma, isKeyDelete, isKeyEnter, isKeyEscape, isShortcutSelectAll, } from '../../lib/events/keyboard/identifiers.js';
86
86
  import * as LayoutEvents from '../../lib/LayoutEvents.js';
87
87
  import { locale } from '../../lib/locale/decorators.js';
88
88
  import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
@@ -92,6 +92,7 @@ import { ThemeContext } from '../../lib/theming/ThemeContext.js';
92
92
  import { getUid } from '../../lib/uidUtils.js';
93
93
  import { emptyHandler, getRandomID, isFunction } from '../../lib/utils.js';
94
94
  import { MenuItem } from '../MenuItem/index.js';
95
+ import { responsiveLayout } from '../ResponsiveLayout/decorator.js';
95
96
  import { ScrollContainer } from '../ScrollContainer/index.js';
96
97
  import { Token } from '../Token/index.js';
97
98
  import { TokenView } from '../Token/TokenView.js';
@@ -99,6 +100,7 @@ import { TokenInputLocaleHelper } from './locale/index.js';
99
100
  import { TextWidthHelper } from './TextWidthHelper.js';
100
101
  import { getStyles } from './TokenInput.styles.js';
101
102
  import { TokenInputMenu } from './TokenInputMenu.js';
103
+ import { TokenInputMobileMenu } from './TokenInputMobileMenu.js';
102
104
  import { tokenInputReducer } from './TokenInputReducer.js';
103
105
  var TEMP_FAKE_FLAG = 'TEMP_FAKE_FLAG';
104
106
  export var TokenInputType;
@@ -118,6 +120,7 @@ export var DefaultState = {
118
120
  preventBlur: false,
119
121
  inputValueWidth: 2,
120
122
  inputValueHeight: 22,
123
+ showMobilePopup: false,
121
124
  };
122
125
  export var TokenInputDataTids = {
123
126
  root: 'TokenInput__root',
@@ -145,6 +148,87 @@ var TokenInput = /** @class */ (function (_super) {
145
148
  _this.wrapper = null;
146
149
  _this.scrollContainerRef = React.createRef();
147
150
  _this.memoizedTokens = new Map();
151
+ _this.renderInlineField = function () {
152
+ return _this.renderTokenInputField({
153
+ variant: 'inline',
154
+ interactive: _this.isInlineInteractive(),
155
+ fieldWidth: _this.getProps().width,
156
+ showMenu: Boolean(!_this.isMobileLayout &&
157
+ _this.type !== TokenInputType.WithoutReference &&
158
+ _this.isCursorVisible &&
159
+ _this.state.activeTokens.length === 0 &&
160
+ (_this.isInputValueChanged || !_this.props.hideMenuIfEmptyInputValue)),
161
+ });
162
+ };
163
+ _this.renderMobilePopupFooter = function () {
164
+ return _this.renderTokenInputField({
165
+ variant: 'mobileFooter',
166
+ interactive: true,
167
+ fieldWidth: '100%',
168
+ showMenu: false,
169
+ });
170
+ };
171
+ _this.renderTokenInputField = function (_a) {
172
+ var _b, _c, _d;
173
+ var variant = _a.variant, interactive = _a.interactive, fieldWidth = _a.fieldWidth, showMenu = _a.showMenu;
174
+ var _e = _this.props, maxMenuHeight = _e.maxMenuHeight, error = _e.error, warning = _e.warning, disabled = _e.disabled, renderNotFound = _e.renderNotFound, inputMode = _e.inputMode, renderTotalCount = _e.renderTotalCount, totalCount = _e.totalCount, ariaDescribedby = _e["aria-describedby"], ariaLabel = _e["aria-label"], maxHeight = _e.maxHeight;
175
+ var _f = _this.getProps(), selectedItems = _f.selectedItems, menuWidth = _f.menuWidth, menuAlign = _f.menuAlign, renderItem = _f.renderItem;
176
+ var isMobileFooter = variant === 'mobileFooter';
177
+ var _g = _this.state, inFocus = _g.inFocus, inputValueWidth = _g.inputValueWidth, inputValueHeight = _g.inputValueHeight, inputValue = _g.inputValue, reservedInputValue = _g.reservedInputValue, autocompleteItems = _g.autocompleteItems, loading = _g.loading;
178
+ var theme = _this.theme;
179
+ var inputInlineStyles = {
180
+ // вычисляем ширину чтобы input автоматически перенёсся на следующую строку при необходимости
181
+ width: inputValueWidth,
182
+ height: inputValueHeight,
183
+ // в ie не работает, но альтернативный способ --- дать tabindex для label --- предположительно ещё сложнее
184
+ caretColor: _this.isCursorVisible && interactive ? undefined : 'transparent',
185
+ };
186
+ var labelClassName = _this.cx(_this.styles.label(theme), _this.getLabelSizeClassName(), (_b = {},
187
+ _b[_this.styles.labelNonInteractive()] = !interactive,
188
+ _b[_this.styles.hovering(_this.theme)] = interactive && !inFocus && !disabled && !warning && !error,
189
+ _b[_this.styles.labelDisabled(theme)] = !!disabled,
190
+ _b[_this.styles.labelFocused(theme)] = interactive && !!inFocus,
191
+ _b[_this.styles.error(theme)] = !!error,
192
+ _b[_this.styles.warning(theme)] = !!warning,
193
+ _b));
194
+ var inputClassName = _this.cx(_this.styles.input(theme), _this.getInputSizeClassName(), (_c = {},
195
+ _c[_this.styles.inputDisabled(theme)] = !!disabled,
196
+ _c));
197
+ var placeholder = selectedItems.length === 0 && !inputValue ? _this.props.placeholder : '';
198
+ var inputNode = (React.createElement(TokenView, { size: _this.size, className: _this.cx((_d = {},
199
+ // input растягивается на всю ширину чтобы placeholder не обрезался
200
+ _d[_this.styles.inputPlaceholderWrapper()] = Boolean(placeholder),
201
+ _d)), hideCloseButton: Boolean(placeholder) },
202
+ React.createElement("textarea", { id: isMobileFooter || interactive ? _this.textareaId : undefined, ref: isMobileFooter ? _this.mobileInputRef : _this.inlineInputRef, value: inputValue, style: inputInlineStyles, spellCheck: false, disabled: disabled, readOnly: !interactive, tabIndex: !interactive ? -1 : undefined, className: inputClassName, placeholder: placeholder, onFocus: interactive ? _this.handleInputFocus : undefined, onBlur: interactive ? _this.handleInputBlur : undefined, onChange: interactive ? _this.handleChangeInputValue : undefined, onKeyDown: interactive ? _this.handleKeyDown : undefined, onPaste: interactive ? _this.handleInputPaste : undefined, inputMode: inputMode, "aria-label": isMobileFooter || interactive ? ariaLabel : undefined, "aria-describedby": isMobileFooter || interactive ? ariaDescribedby : undefined, "aria-hidden": !interactive ? true : undefined, autoFocus: isMobileFooter })));
203
+ var inner = (React.createElement(React.Fragment, null,
204
+ isMobileFooter ? null : (React.createElement(TextWidthHelper, { ref: _this.textHelperRef, text: inputValue, theme: _this.theme, size: _this.size })),
205
+ _this.renderTokensStart(interactive),
206
+ inputNode,
207
+ showMenu && (React.createElement(TokenInputMenu, { popupMenuId: _this.rootId, ref: _this.tokensInputMenuRef, items: autocompleteItems, loading: loading, opened: showMenu, maxMenuHeight: maxMenuHeight, anchorElementForCursor: _this.input, anchorElementRoot: _this.wrapper, renderNotFound: renderNotFound, renderItem: renderItem, onValueChange: _this.selectItem, renderAddButton: _this.renderAddButton, menuWidth: menuWidth, menuAlign: menuAlign, renderTotalCount: renderTotalCount, totalCount: totalCount, size: _this.size })),
208
+ _this.renderTokensEnd(interactive),
209
+ _this.isEditingMode ? (React.createElement(TokenView, { size: _this.size },
210
+ React.createElement("span", { className: _this.styles.reservedInput(theme) }, reservedInputValue))) : null));
211
+ var container = maxHeight && !isMobileFooter ? (React.createElement(ScrollContainer, { className: _this.styles.inputPlaceholderScrollWrapper(), scrollRef: _this.scrollContainerRef, maxHeight: maxHeight, showScrollBar: "always", style: { width: '100%' } }, inner)) : (inner);
212
+ var labelStyle = {
213
+ width: fieldWidth,
214
+ };
215
+ return (React.createElement("label", { ref: isMobileFooter ? _this.mobileWrapperRef : _this.inlineWrapperRef, style: labelStyle, className: labelClassName, onMouseDown: interactive ? _this.handleWrapperMouseDown : undefined, onMouseUp: interactive ? _this.handleWrapperMouseUp : undefined,
216
+ // Для корректной работы скролла приходится ломать связь label с полем ввода
217
+ // Иначе любой клик внутри label вызывает фокус и автоскроллинг к полю ввода
218
+ htmlFor: !interactive || maxHeight ? 'fake-id' : _this.textareaId, "aria-controls": interactive ? _this.rootId : undefined, "aria-hidden": !interactive ? true : undefined, "data-tid": isMobileFooter || interactive ? TokenInputDataTids.label : undefined }, container));
219
+ };
220
+ _this.renderMobileMenu = function () {
221
+ var _a = _this.props, maxMenuHeight = _a.maxMenuHeight, renderNotFound = _a.renderNotFound, renderTotalCount = _a.renderTotalCount, totalCount = _a.totalCount;
222
+ var renderItem = _this.getProps().renderItem;
223
+ var _b = _this.state, autocompleteItems = _b.autocompleteItems, loading = _b.loading;
224
+ return (React.createElement(TokenInputMobileMenu, { popupMenuId: _this.rootId, ref: function (node) {
225
+ _this.tokensInputMenuRef(node);
226
+ }, items: autocompleteItems, loading: loading, opened: true, maxMenuHeight: maxMenuHeight, renderNotFound: renderNotFound, renderItem: renderItem, onValueChange: _this.selectItem, renderAddButton: _this.renderAddButton, renderTotalCount: renderTotalCount, totalCount: totalCount, size: _this.size, mobileFooterComponent: _this.renderMobilePopupFooter(), onCloseRequest: function () {
227
+ return _this.dispatch({
228
+ type: 'SET_CLOSE_MOBILE_POPUP',
229
+ });
230
+ } }));
231
+ };
148
232
  _this.isEqual = function (itemA, itemB) {
149
233
  var itemToId = _this.getProps().itemToId;
150
234
  return lodashIsEqual(itemToId(itemA), itemToId(itemB));
@@ -156,8 +240,15 @@ var TokenInput = /** @class */ (function (_super) {
156
240
  }
157
241
  return items.some(function (item) { return _this.isEqual(item, value); });
158
242
  };
159
- _this.inputRef = function (node) {
160
- _this.input = node;
243
+ _this.inlineInputRef = function (node) {
244
+ if (!_this.usesMobilePopup || !_this.state.showMobilePopup) {
245
+ _this.input = node;
246
+ }
247
+ };
248
+ _this.mobileInputRef = function (node) {
249
+ if (_this.usesMobilePopup && !!_this.state.showMobilePopup) {
250
+ _this.input = node;
251
+ }
161
252
  };
162
253
  _this.tokensInputMenuRef = function (node) {
163
254
  _this.tokensInputMenu = node;
@@ -165,19 +256,37 @@ var TokenInput = /** @class */ (function (_super) {
165
256
  _this.textHelperRef = function (node) {
166
257
  _this.textHelper = node;
167
258
  };
168
- _this.wrapperRef = function (node) {
169
- _this.wrapper = node;
259
+ _this.inlineWrapperRef = function (node) {
260
+ if (!_this.usesMobilePopup || !_this.state.showMobilePopup) {
261
+ _this.wrapper = node;
262
+ }
263
+ };
264
+ _this.mobileWrapperRef = function (node) {
265
+ if (_this.usesMobilePopup && !!_this.state.showMobilePopup) {
266
+ _this.wrapper = node;
267
+ }
170
268
  };
171
269
  _this.dispatch = function (action, cb) {
172
270
  _this.setState(function (prevState) { return tokenInputReducer(prevState, action); }, cb);
173
271
  };
174
272
  _this.handleInputFocus = function (event) {
175
- _this.dispatch({ type: 'SET_FOCUS_IN' });
176
- _this.getProps().onFocus(event);
273
+ if (_this.usesMobilePopup) {
274
+ if (!_this.state.showMobilePopup) {
275
+ _this.dispatch({ type: 'SET_SHOW_MOBILE_POPUP' });
276
+ return;
277
+ }
278
+ }
279
+ if (!_this.state.inFocus) {
280
+ _this.dispatch({ type: 'SET_FOCUS_IN' });
281
+ _this.getProps().onFocus(event);
282
+ }
177
283
  };
178
284
  _this.handleInputBlur = function (event) {
179
285
  var _a, _b, _c;
180
286
  var isBlurToMenu = _this.isBlurToMenu(event);
287
+ if (_this.usesMobilePopup) {
288
+ return;
289
+ }
181
290
  if (!isBlurToMenu) {
182
291
  _this.handleOutsideBlur();
183
292
  }
@@ -277,7 +386,7 @@ var TokenInput = /** @class */ (function (_super) {
277
386
  if (delimiters.some(function (delimiter) { return paste.includes(delimiter); })) {
278
387
  event.preventDefault();
279
388
  event.stopPropagation();
280
- var tokens = paste.trim().split(new RegExp("[".concat(delimiters.join(''), "]+")));
389
+ var tokens = _this.splitValueByDelimiters(paste.trim());
281
390
  var items = tokens
282
391
  .filter(Boolean)
283
392
  .map(function (token) { return valueToItem(token); })
@@ -294,17 +403,18 @@ var TokenInput = /** @class */ (function (_super) {
294
403
  args_1[_i] = arguments[_i];
295
404
  }
296
405
  return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (query) {
297
- var autocompleteItems, _a, selectedItems_1, valueToItem, valueToString_1, isSelectedItem_1, isEditingItem_1, autocompleteItemsUnique, autocompleteItemsUniqueSimple, editingItem, selectItemIndex_1;
406
+ var autocompleteItems, _a, selectedItems_1, valueToItem, valueToString_1, isSelectedItem_1, isEditingItem_1, autocompleteItemsUnique, autocompleteItemsUniqueSimple, editingItem, selectItemIndex, highlightIndex_1, applyMenuHighlight;
298
407
  var _this = this;
408
+ var _b, _c;
299
409
  if (query === void 0) { query = ''; }
300
- return __generator(this, function (_b) {
301
- switch (_b.label) {
410
+ return __generator(this, function (_d) {
411
+ switch (_d.label) {
302
412
  case 0:
303
413
  if (!(this.props.getItems && (this.isInputValueChanged || !this.props.hideMenuIfEmptyInputValue))) return [3 /*break*/, 2];
304
414
  this.dispatch({ type: 'SET_LOADING', payload: true });
305
415
  return [4 /*yield*/, this.props.getItems(query)];
306
416
  case 1:
307
- autocompleteItems = _b.sent();
417
+ autocompleteItems = _d.sent();
308
418
  this.dispatch({ type: 'SET_LOADING', payload: false });
309
419
  _a = this.getProps(), selectedItems_1 = _a.selectedItems, valueToItem = _a.valueToItem, valueToString_1 = _a.valueToString;
310
420
  isSelectedItem_1 = function (item) { return _this.hasValueInItems(selectedItems_1, item); };
@@ -329,9 +439,11 @@ var TokenInput = /** @class */ (function (_super) {
329
439
  _this.highlightMenuItem();
330
440
  });
331
441
  }
332
- selectItemIndex_1 = autocompleteItemsUniqueSimple.findIndex(function (item) { return valueToString_1(item).toLowerCase() === _this.state.inputValue.toLowerCase(); });
333
- setTimeout(function () { var _a; return (_a = _this.menuRef) === null || _a === void 0 ? void 0 : _a.highlightItem(selectItemIndex_1 < 0 ? 0 : selectItemIndex_1); }, 0);
334
- _b.label = 2;
442
+ selectItemIndex = autocompleteItemsUniqueSimple.findIndex(function (item) { return valueToString_1(item).toLowerCase() === _this.state.inputValue.toLowerCase(); });
443
+ highlightIndex_1 = selectItemIndex < 0 ? 0 : selectItemIndex;
444
+ applyMenuHighlight = function () { var _a; return (_a = _this.menuRef) === null || _a === void 0 ? void 0 : _a.highlightItem(highlightIndex_1); };
445
+ (_c = (_b = this.globalObject).requestAnimationFrame) === null || _c === void 0 ? void 0 : _c.call(_b, applyMenuHighlight);
446
+ _d.label = 2;
335
447
  case 2: return [2 /*return*/];
336
448
  }
337
449
  });
@@ -353,8 +465,7 @@ var TokenInput = /** @class */ (function (_super) {
353
465
  _this.handleInputKeyDown = function (e) {
354
466
  var _a, _b, _c, _d;
355
467
  e.stopPropagation();
356
- if ((_this.type !== TokenInputType.WithReference &&
357
- _this.getProps().delimiters.some(function (key) { return key === e.key || (key === ',' && isKeyComma(e)); })) ||
468
+ if ((_this.isDelimiterInputEnabled && _this.getProps().delimiters.some(function (key) { return _this.isDelimiterKeyEvent(e, key); })) ||
358
469
  (isKeyEnter(e) && _this.type === TokenInputType.WithoutReference)) {
359
470
  e.preventDefault();
360
471
  var newValue = _this.state.inputValue;
@@ -411,6 +522,9 @@ var TokenInput = /** @class */ (function (_super) {
411
522
  _this.focusInput = function (options) {
412
523
  var _a, _b;
413
524
  (_b = (_a = _this.globalObject).requestAnimationFrame) === null || _b === void 0 ? void 0 : _b.call(_a, function () { var _a; return (_a = _this.input) === null || _a === void 0 ? void 0 : _a.focus(options); });
525
+ if (_this.usesMobilePopup && !_this.state.showMobilePopup) {
526
+ _this.dispatch({ type: 'SET_SHOW_MOBILE_POPUP' });
527
+ }
414
528
  };
415
529
  _this.selectInputText = function () {
416
530
  if (_this.input) {
@@ -515,7 +629,7 @@ var TokenInput = /** @class */ (function (_super) {
515
629
  (_b = (_a = _this.props).onValueChange) === null || _b === void 0 ? void 0 : _b.call(_a, _this.getProps().selectedItems.filter(function (_) { return !_this.isEqual(_, item); }));
516
630
  var filteredActiveTokens = _this.state.activeTokens.filter(function (_) { return !_this.isEqual(_, item); });
517
631
  _this.dispatch({ type: 'SET_ACTIVE_TOKENS', payload: filteredActiveTokens });
518
- if (filteredActiveTokens.length === 0) {
632
+ if (filteredActiveTokens.length === 0 && !(_this.usesMobilePopup && _this.state.showMobilePopup)) {
519
633
  _this.focusInput({ preventScroll: true });
520
634
  }
521
635
  _this.tryGetItems();
@@ -535,7 +649,7 @@ var TokenInput = /** @class */ (function (_super) {
535
649
  };
536
650
  _this.handleTokenEdit = function (itemNew) {
537
651
  var _a = _this.getProps(), selectedItems = _a.selectedItems, valueToString = _a.valueToString;
538
- var editingTokenIndex = selectedItems.findIndex(function (item) { return item === itemNew; });
652
+ var editingTokenIndex = selectedItems.findIndex(function (item) { return _this.isEqual(item, itemNew); });
539
653
  _this.dispatch({ type: 'SET_EDITING_TOKEN_INDEX', payload: editingTokenIndex });
540
654
  if (_this.isInputValueChanged) {
541
655
  if (_this.state.reservedInputValue === undefined) {
@@ -600,6 +714,11 @@ var TokenInput = /** @class */ (function (_super) {
600
714
  if (_this.isInputValueChanged && query === '') {
601
715
  _this.dispatch({ type: 'SET_AUTOCOMPLETE_ITEMS', payload: undefined });
602
716
  }
717
+ if (_this.isDelimiterInputEnabled && _this.inputValueEndsWithDelimiter(query)) {
718
+ if (_this.tryApplyDelimiterFromInputValue(query)) {
719
+ return;
720
+ }
721
+ }
603
722
  _this.dispatch({ type: 'UPDATE_QUERY', payload: query }, function () {
604
723
  _this.tryGetItems(query);
605
724
  });
@@ -608,28 +727,29 @@ var TokenInput = /** @class */ (function (_super) {
608
727
  }
609
728
  };
610
729
  _this.highlightMenuItem = function () {
611
- if (_this.menuRef &&
612
- _this.state.autocompleteItems &&
613
- _this.state.autocompleteItems.length > 0 &&
614
- _this.type !== TokenInputType.Combined) {
730
+ if (_this.menuRef && _this.state.autocompleteItems && _this.state.autocompleteItems.length > 0) {
615
731
  _this.menuRef.highlightItem(0);
616
732
  }
617
733
  };
618
- _this.renderTokensStart = function () {
734
+ _this.renderTokensStart = function (interactive) {
735
+ if (interactive === void 0) { interactive = true; }
619
736
  var editingTokenIndex = _this.state.editingTokenIndex;
620
737
  var selectedItems = _this.getProps().selectedItems;
621
738
  var delimiter = editingTokenIndex >= 0 ? editingTokenIndex : selectedItems.length;
622
- return selectedItems.slice(0, delimiter).map(_this.renderToken);
739
+ return selectedItems.slice(0, delimiter).map(function (x, index) { return _this.renderToken(x, index, interactive); });
623
740
  };
624
- _this.renderTokensEnd = function () {
741
+ _this.renderTokensEnd = function (interactive) {
742
+ if (interactive === void 0) { interactive = true; }
625
743
  if (_this.state.editingTokenIndex >= 0) {
744
+ var startIndex_1 = _this.state.editingTokenIndex + 1;
626
745
  return _this.getProps()
627
- .selectedItems.slice(_this.state.editingTokenIndex + 1)
628
- .map(_this.renderToken);
746
+ .selectedItems.slice(startIndex_1)
747
+ .map(function (x, index) { return _this.renderToken(x, startIndex_1 + index, interactive); });
629
748
  }
630
749
  };
631
- _this.renderToken = function (item, index) {
750
+ _this.renderToken = function (item, index, interactive) {
632
751
  var _a;
752
+ if (interactive === void 0) { interactive = true; }
633
753
  var _b = _this.props, _c = _b.renderToken, renderToken = _c === void 0 ? defaultRenderToken : _c, disabled = _b.disabled;
634
754
  var isActive = _this.state.activeTokens.includes(item);
635
755
  // TODO useCallback
@@ -648,19 +768,21 @@ var TokenInput = /** @class */ (function (_super) {
648
768
  };
649
769
  var handleTokenDoubleClick = function (event) {
650
770
  event.stopPropagation();
651
- if (!_this.isEditingMode && !disabled) {
771
+ if (!_this.isEditingMode && !disabled && interactive) {
652
772
  _this.handleTokenEdit(item);
653
773
  }
654
774
  };
655
775
  var renderedToken = renderToken(item, {
656
776
  size: _this.size,
657
777
  isActive: isActive,
658
- onClick: handleTokenClick,
659
- onDoubleClick: handleTokenDoubleClick,
660
- onRemove: handleIconClick,
778
+ onClick: interactive ? handleTokenClick : undefined,
779
+ onDoubleClick: interactive ? handleTokenDoubleClick : undefined,
780
+ onRemove: interactive ? handleIconClick : undefined,
661
781
  disabled: disabled,
662
782
  }, index);
663
- _this.memoizedTokens.set((_a = _this.props.selectedItems) === null || _a === void 0 ? void 0 : _a.indexOf(item), renderedToken);
783
+ if (interactive) {
784
+ _this.memoizedTokens.set((_a = _this.props.selectedItems) === null || _a === void 0 ? void 0 : _a.indexOf(item), renderedToken);
785
+ }
664
786
  return renderedToken;
665
787
  };
666
788
  _this.renderAddButton = function (value) {
@@ -739,6 +861,8 @@ var TokenInput = /** @class */ (function (_super) {
739
861
  }
740
862
  };
741
863
  TokenInput.prototype.componentDidUpdate = function (prevProps, prevState) {
864
+ var _this = this;
865
+ var _a, _b;
742
866
  if (prevState.inputValue !== this.state.inputValue) {
743
867
  this.updateInputTextWidth();
744
868
  }
@@ -755,6 +879,23 @@ var TokenInput = /** @class */ (function (_super) {
755
879
  if (!this.isCursorVisibleForState(prevState) && this.isCursorVisible) {
756
880
  this.tryGetItems(this.isEditingMode ? '' : this.state.inputValue);
757
881
  }
882
+ if (!prevState.showMobilePopup && this.state.showMobilePopup && this.usesMobilePopup) {
883
+ (_b = (_a = this.globalObject).requestAnimationFrame) === null || _b === void 0 ? void 0 : _b.call(_a, function () {
884
+ var _a;
885
+ (_a = _this.input) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
886
+ _this.tryGetItems(_this.state.inputValue);
887
+ });
888
+ }
889
+ };
890
+ Object.defineProperty(TokenInput.prototype, "usesMobilePopup", {
891
+ get: function () {
892
+ return this.isMobileLayout && this.type !== TokenInputType.WithoutReference;
893
+ },
894
+ enumerable: false,
895
+ configurable: true
896
+ });
897
+ TokenInput.prototype.isInlineInteractive = function () {
898
+ return !(this.usesMobilePopup && !!this.state.showMobilePopup);
758
899
  };
759
900
  TokenInput.prototype.componentWillUnmount = function () {
760
901
  var _a;
@@ -812,56 +953,15 @@ var TokenInput = /** @class */ (function (_super) {
812
953
  }
813
954
  };
814
955
  TokenInput.prototype.renderMain = function () {
815
- var _a, _b, _c;
816
956
  if (this.type !== TokenInputType.WithoutReference && !this.props.getItems) {
817
957
  logWarning(false, "getItems is required for \"Combined\" and \"WithReference\" modes.");
818
958
  }
819
- var _d = this.props, maxMenuHeight = _d.maxMenuHeight, error = _d.error, warning = _d.warning, disabled = _d.disabled, renderNotFound = _d.renderNotFound, hideMenuIfEmptyInputValue = _d.hideMenuIfEmptyInputValue, inputMode = _d.inputMode, renderTotalCount = _d.renderTotalCount, totalCount = _d.totalCount, ariaDescribedby = _d["aria-describedby"], ariaLabel = _d["aria-label"], maxHeight = _d.maxHeight;
820
- var _e = this.getProps(), selectedItems = _e.selectedItems, width = _e.width, onMouseEnter = _e.onMouseEnter, onMouseLeave = _e.onMouseLeave, menuWidth = _e.menuWidth, menuAlign = _e.menuAlign, renderItem = _e.renderItem;
821
- var _f = this.state, activeTokens = _f.activeTokens, inFocus = _f.inFocus, inputValueWidth = _f.inputValueWidth, inputValueHeight = _f.inputValueHeight, inputValue = _f.inputValue, reservedInputValue = _f.reservedInputValue, autocompleteItems = _f.autocompleteItems, loading = _f.loading;
822
- var showMenu = this.type !== TokenInputType.WithoutReference &&
823
- this.isCursorVisible &&
824
- activeTokens.length === 0 &&
825
- (this.isInputValueChanged || !hideMenuIfEmptyInputValue);
826
- var theme = this.theme;
827
- var inputInlineStyles = {
828
- // вычисляем ширину чтобы input автоматически перенёсся на следующую строку при необходимости
829
- width: inputValueWidth,
830
- height: inputValueHeight,
831
- // в ie не работает, но альтернативный способ --- дать tabindex для label --- предположительно ещё сложнее
832
- caretColor: this.isCursorVisible ? undefined : 'transparent',
833
- };
834
- var labelClassName = this.cx(this.styles.label(theme), this.getLabelSizeClassName(), (_a = {},
835
- _a[this.styles.hovering(this.theme)] = !inFocus && !disabled && !warning && !error,
836
- _a[this.styles.labelDisabled(theme)] = !!disabled,
837
- _a[this.styles.labelFocused(theme)] = !!inFocus,
838
- _a[this.styles.error(theme)] = !!error,
839
- _a[this.styles.warning(theme)] = !!warning,
840
- _a));
841
- var inputClassName = this.cx(this.styles.input(theme), this.getInputSizeClassName(), (_b = {},
842
- _b[this.styles.inputDisabled(theme)] = !!disabled,
843
- _b));
844
- var placeholder = selectedItems.length === 0 && !inputValue ? this.props.placeholder : '';
845
- var inputNode = (React.createElement(TokenView, { size: this.size, className: this.cx((_c = {},
846
- // input растягивается на всю ширину чтобы placeholder не обрезался
847
- _c[this.styles.inputPlaceholderWrapper()] = Boolean(placeholder),
848
- _c)), hideCloseButton: Boolean(placeholder) },
849
- React.createElement("textarea", { id: this.textareaId, ref: this.inputRef, value: inputValue, style: inputInlineStyles, spellCheck: false, disabled: disabled, className: inputClassName, placeholder: placeholder, onFocus: this.handleInputFocus, onBlur: this.handleInputBlur, onChange: this.handleChangeInputValue, onKeyDown: this.handleKeyDown, onPaste: this.handleInputPaste, inputMode: inputMode, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby })));
850
- var inner = (React.createElement(React.Fragment, null,
851
- React.createElement(TextWidthHelper, { ref: this.textHelperRef, text: inputValue, theme: this.theme, size: this.size }),
852
- this.renderTokensStart(),
853
- inputNode,
854
- showMenu && (React.createElement(TokenInputMenu, { popupMenuId: this.rootId, ref: this.tokensInputMenuRef, items: autocompleteItems, loading: loading, opened: showMenu, maxMenuHeight: maxMenuHeight, anchorElementForCursor: this.input, anchorElementRoot: this.wrapper, renderNotFound: renderNotFound, renderItem: renderItem, onValueChange: this.selectItem, renderAddButton: this.renderAddButton, menuWidth: menuWidth, menuAlign: menuAlign, renderTotalCount: renderTotalCount, totalCount: totalCount, size: this.size })),
855
- this.renderTokensEnd(),
856
- this.isEditingMode ? (React.createElement(TokenView, { size: this.size },
857
- React.createElement("span", { className: this.styles.reservedInput(theme) }, reservedInputValue))) : null));
858
- var container = maxHeight ? (React.createElement(ScrollContainer, { className: this.styles.inputPlaceholderScrollWrapper(), scrollRef: this.scrollContainerRef, maxHeight: maxHeight, showScrollBar: "always", style: { width: '100%' } }, inner)) : (inner);
959
+ var _a = this.getProps(), onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
960
+ var showMobilePopup = this.state.showMobilePopup;
859
961
  return (React.createElement(CommonWrapper, __assign({ rootNodeRef: this.setRootNode }, this.props),
860
962
  React.createElement("div", { "data-tid": TokenInputDataTids.root, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave },
861
- React.createElement("label", { ref: this.wrapperRef, style: { width: width }, className: labelClassName, onMouseDown: this.handleWrapperMouseDown, onMouseUp: this.handleWrapperMouseUp,
862
- // Для корректной работы скролла приходится ломать связь label с полем ввода
863
- // Иначе любой клик внутри label вызывает фокус и автоскроллинг к полю ввода
864
- htmlFor: maxHeight ? 'fake-id' : this.textareaId, "aria-controls": this.rootId, "data-tid": TokenInputDataTids.label }, container))));
963
+ this.renderInlineField(),
964
+ this.usesMobilePopup && showMobilePopup && this.renderMobileMenu())));
865
965
  };
866
966
  /**
867
967
  * Сбрасывает введённое пользователем значение.
@@ -960,6 +1060,62 @@ var TokenInput = /** @class */ (function (_super) {
960
1060
  enumerable: false,
961
1061
  configurable: true
962
1062
  });
1063
+ Object.defineProperty(TokenInput.prototype, "isDelimiterInputEnabled", {
1064
+ get: function () {
1065
+ return this.type !== TokenInputType.WithReference;
1066
+ },
1067
+ enumerable: false,
1068
+ configurable: true
1069
+ });
1070
+ TokenInput.prototype.inputValueEndsWithDelimiter = function (value) {
1071
+ return this.getProps().delimiters.some(function (delimiter) { return value.endsWith(delimiter); });
1072
+ };
1073
+ TokenInput.prototype.splitValueByDelimiters = function (value) {
1074
+ var pattern = this.getProps()
1075
+ .delimiters.map(function (delimiter) { return delimiter.replace(/[\\^\-[\]]/g, '\\$&'); })
1076
+ .join('');
1077
+ return value.split(new RegExp("[".concat(pattern, "]+")));
1078
+ };
1079
+ TokenInput.prototype.isDelimiterKeyEvent = function (e, delimiter) {
1080
+ if (delimiter === ',') {
1081
+ return e.key === delimiter || isKeyComma(e) || isCodeComma(e);
1082
+ }
1083
+ return e.key === delimiter;
1084
+ };
1085
+ TokenInput.prototype.tryApplyDelimiterFromInputValue = function (rawValue) {
1086
+ var _this = this;
1087
+ var _a = this.getProps(), delimiters = _a.delimiters, selectedItems = _a.selectedItems, valueToItem = _a.valueToItem, onValueChange = _a.onValueChange;
1088
+ var trailingDelimiter = delimiters.find(function (delimiter) { return rawValue.endsWith(delimiter); });
1089
+ if (!trailingDelimiter) {
1090
+ return false;
1091
+ }
1092
+ var valueWithoutTrailingDelimiter = rawValue.slice(0, rawValue.length - trailingDelimiter.length);
1093
+ if (this.isEditingMode) {
1094
+ if (valueWithoutTrailingDelimiter !== '') {
1095
+ this.dispatch({ type: 'UPDATE_QUERY', payload: valueWithoutTrailingDelimiter }, function () {
1096
+ _this.finishTokenEdit();
1097
+ });
1098
+ }
1099
+ return true;
1100
+ }
1101
+ if (valueWithoutTrailingDelimiter === '') {
1102
+ this.dispatch({ type: 'CLEAR_INPUT' });
1103
+ this.tryGetItems();
1104
+ return true;
1105
+ }
1106
+ var tokens = this.splitValueByDelimiters(valueWithoutTrailingDelimiter);
1107
+ var items = tokens
1108
+ .filter(Boolean)
1109
+ .map(function (token) { return valueToItem(token); })
1110
+ .filter(function (item) { return item && !_this.hasValueInItems(selectedItems, item); });
1111
+ if (items.length > 0) {
1112
+ onValueChange(selectedItems.concat(items));
1113
+ }
1114
+ this.dispatch({ type: 'CLEAR_INPUT' });
1115
+ this.dispatch({ type: 'SET_AUTOCOMPLETE_ITEMS', payload: undefined });
1116
+ this.tryGetItems();
1117
+ return true;
1118
+ };
963
1119
  TokenInput.prototype.moveFocusToLastToken = function () {
964
1120
  var items = this.getProps().selectedItems;
965
1121
  if (this.state.inputValue === '' && items && items.length > 0) {
@@ -988,6 +1144,7 @@ var TokenInput = /** @class */ (function (_super) {
988
1144
  menuAlign: 'cursor',
989
1145
  };
990
1146
  TokenInput = TokenInput_1 = __decorate([
1147
+ responsiveLayout,
991
1148
  withRenderEnvironment,
992
1149
  rootNode,
993
1150
  locale('TokenInput', TokenInputLocaleHelper),