@true-engineering/true-react-common-ui-kit 1.3.1 → 1.4.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.
@@ -1120,6 +1120,16 @@ var transformToKebab = function(string) {
1120
1120
  });
1121
1121
  return result;
1122
1122
  };
1123
+ var hasExactParent = function(element, parent) {
1124
+ if (element === parent) {
1125
+ return true;
1126
+ }
1127
+ var parentNode = getParentNode$1(element);
1128
+ if (parentNode === element) {
1129
+ return false;
1130
+ }
1131
+ return hasExactParent(parentNode, parent);
1132
+ };
1123
1133
  var _element_parentNode;
1124
1134
  var getParentNode$1 = function(element) {
1125
1135
  return element.nodeName === "HTML" ? element : (_element_parentNode = element.parentNode) !== null && _element_parentNode !== void 0 ? _element_parentNode : element.host;
@@ -6112,6 +6122,11 @@ var styles$y = {
6112
6122
  loading: {},
6113
6123
  tweakPreloader: {}
6114
6124
  };
6125
+ var renderIcon = function(icon) {
6126
+ return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
6127
+ type: icon
6128
+ }) : icon;
6129
+ };
6115
6130
  function _array_like_to_array$k(arr, len) {
6116
6131
  if (len == null || len > arr.length)
6117
6132
  len = arr.length;
@@ -6477,9 +6492,7 @@ var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
6477
6492
  iconType !== void 0 && /* @__PURE__ */ jsx("div", {
6478
6493
  className: clsx(classes.inputIcon, _define_property$B({}, classes.activeIcon, !isDisabled && onIconClick !== void 0)),
6479
6494
  onClick: !isDisabled ? onIconClick : void 0,
6480
- children: /* @__PURE__ */ jsx(Icon, {
6481
- type: iconType
6482
- })
6495
+ children: renderIcon(iconType)
6483
6496
  })
6484
6497
  ]
6485
6498
  })
@@ -6918,7 +6931,20 @@ var styles$v = {
6918
6931
  CONTAINER_PADDING,
6919
6932
  0
6920
6933
  ],
6921
- fontSize: 16
6934
+ fontSize: 16,
6935
+ overflow: "hidden"
6936
+ },
6937
+ withListHeader: {
6938
+ paddingTop: 0
6939
+ },
6940
+ listHeader: {
6941
+ "& + $list": {
6942
+ borderTop: [
6943
+ 1,
6944
+ "solid",
6945
+ colors.BORDER_LIGHT
6946
+ ]
6947
+ }
6922
6948
  },
6923
6949
  list: _object_spread$x({
6924
6950
  height: "100%",
@@ -7004,7 +7030,7 @@ function _object_spread_props$q(target, source) {
7004
7030
  }
7005
7031
  var DEFAULT_OPTION_INDEX = -1;
7006
7032
  function SelectList(param) {
7007
- var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, isOptionDisabled = param.isOptionDisabled, onOptionClick = param.onOptionClick, convertValueToString = param.convertValueToString, convertValueToReactNode = param.convertValueToReactNode, _param_convertValueToId = param.convertValueToId, convertValueToId = _param_convertValueToId === void 0 ? convertValueToString : _param_convertValueToId;
7033
+ var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, customListHeader = param.customListHeader, isOptionDisabled = param.isOptionDisabled, onOptionClick = param.onOptionClick, convertValueToString = param.convertValueToString, convertValueToReactNode = param.convertValueToReactNode, _param_convertValueToId = param.convertValueToId, convertValueToId = _param_convertValueToId === void 0 ? convertValueToString : _param_convertValueToId;
7008
7034
  var classes = useTheme("SelectList", styles$v, tweakStyles).classes;
7009
7035
  var activeValueId = isNotEmpty(activeValue) ? convertValueToId(activeValue) : void 0;
7010
7036
  var isActiveOption = function(item) {
@@ -7028,58 +7054,64 @@ function SelectList(param) {
7028
7054
  convertFunction,
7029
7055
  optionsDisableMap
7030
7056
  ]);
7031
- return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
7057
+ return /* @__PURE__ */ jsxs(ScrollIntoViewIfNeeded, {
7032
7058
  active: shouldScrollToList,
7033
- className: classes.root,
7034
- children: /* @__PURE__ */ jsx("div", {
7035
- className: classes.list,
7036
- "data-testid": testId,
7037
- children: isLoading ? /* @__PURE__ */ jsx("div", {
7038
- className: clsx(classes.cell, classes.loading),
7039
- children: loadingLabel
7040
- }) : /* @__PURE__ */ jsxs(Fragment, {
7041
- children: [
7042
- defaultOptionLabel !== void 0 && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
7043
- active: focusedIndex === DEFAULT_OPTION_INDEX,
7044
- options: {
7045
- block: "nearest"
7046
- },
7047
- className: clsx(classes.cell, classes.defaultCell, focusedIndex === DEFAULT_OPTION_INDEX && classes.focused),
7048
- onClick: function() {
7049
- return onOptionClick(DEFAULT_OPTION_INDEX);
7050
- },
7051
- children: defaultOptionLabel
7052
- }),
7053
- listOptions.map(function(opt, i) {
7054
- var optionValue = options[i];
7055
- var isFocused = i === focusedIndex;
7056
- var isActive = isActiveOption(optionValue);
7057
- var isDisabled = optionsDisableMap[i];
7058
- var _obj;
7059
- return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$q(_object_spread$w({
7060
- active: isFocused,
7059
+ className: clsx(classes.root, _define_property$x({}, classes.withListHeader, isNotEmpty(customListHeader))),
7060
+ children: [
7061
+ isNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
7062
+ className: classes.listHeader,
7063
+ children: customListHeader
7064
+ }),
7065
+ /* @__PURE__ */ jsx("div", {
7066
+ className: classes.list,
7067
+ "data-testid": testId,
7068
+ children: isLoading ? /* @__PURE__ */ jsx("div", {
7069
+ className: clsx(classes.cell, classes.loading),
7070
+ children: loadingLabel
7071
+ }) : /* @__PURE__ */ jsxs(Fragment, {
7072
+ children: [
7073
+ defaultOptionLabel !== void 0 && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
7074
+ active: focusedIndex === DEFAULT_OPTION_INDEX,
7061
7075
  options: {
7062
7076
  block: "nearest"
7063
7077
  },
7064
- className: clsx(classes.cell, (_obj = {}, _define_property$x(_obj, classes.focused, isFocused), _define_property$x(_obj, classes.active, isActive), _define_property$x(_obj, classes.disabled, isDisabled), _obj))
7065
- }, addDataAttributes({
7066
- disabled: isDisabled,
7067
- active: isActive,
7068
- focused: isFocused
7069
- })), {
7070
- onClick: !isDisabled ? function() {
7071
- return onOptionClick(i);
7072
- } : void 0,
7073
- children: opt
7074
- }), i);
7075
- }),
7076
- listOptions.length === 0 && /* @__PURE__ */ jsx("div", {
7077
- className: clsx(classes.cell, classes.noMatchesLabel),
7078
- children: noMatchesLabel
7079
- })
7080
- ]
7078
+ className: clsx(classes.cell, classes.defaultCell, focusedIndex === DEFAULT_OPTION_INDEX && classes.focused),
7079
+ onClick: function(event) {
7080
+ return onOptionClick(DEFAULT_OPTION_INDEX, event);
7081
+ },
7082
+ children: defaultOptionLabel
7083
+ }),
7084
+ listOptions.map(function(opt, i) {
7085
+ var optionValue = options[i];
7086
+ var isFocused = i === focusedIndex;
7087
+ var isActive = isActiveOption(optionValue);
7088
+ var isDisabled = optionsDisableMap[i];
7089
+ var _obj;
7090
+ return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$q(_object_spread$w({
7091
+ active: isFocused,
7092
+ options: {
7093
+ block: "nearest"
7094
+ },
7095
+ className: clsx(classes.cell, (_obj = {}, _define_property$x(_obj, classes.focused, isFocused), _define_property$x(_obj, classes.active, isActive), _define_property$x(_obj, classes.disabled, isDisabled), _obj))
7096
+ }, addDataAttributes({
7097
+ disabled: isDisabled,
7098
+ active: isActive,
7099
+ focused: isFocused
7100
+ })), {
7101
+ onClick: !isDisabled ? function(event) {
7102
+ return onOptionClick(i, event);
7103
+ } : void 0,
7104
+ children: opt
7105
+ }), i);
7106
+ }),
7107
+ listOptions.length === 0 && /* @__PURE__ */ jsx("div", {
7108
+ className: clsx(classes.cell, classes.noMatchesLabel),
7109
+ children: noMatchesLabel
7110
+ })
7111
+ ]
7112
+ })
7081
7113
  })
7082
- })
7114
+ ]
7083
7115
  });
7084
7116
  }
7085
7117
  var _option_isDisabled;
@@ -7154,7 +7186,169 @@ var styles$u = {
7154
7186
  paddingRight: 32
7155
7187
  }
7156
7188
  },
7157
- tweakSelectList: {}
7189
+ tweakSelectList: {},
7190
+ tweakSearchInput: {
7191
+ tweakInput: {
7192
+ inputWrapper: {
7193
+ height: 48,
7194
+ borderRadius: 0,
7195
+ border: "none",
7196
+ backgroundColor: "transparent"
7197
+ }
7198
+ }
7199
+ }
7200
+ };
7201
+ var LEFT_PADDING = 44;
7202
+ var styles$t = {
7203
+ root: {
7204
+ position: "relative"
7205
+ },
7206
+ icon: {
7207
+ display: "flex",
7208
+ alignItems: "center",
7209
+ position: "absolute",
7210
+ left: 12,
7211
+ height: "100%",
7212
+ width: 20,
7213
+ zIndex: 2,
7214
+ color: colors.GREY_ACTIVE
7215
+ },
7216
+ tweakInput: {
7217
+ inputWrapper: {
7218
+ height: 35,
7219
+ borderColor: "transparent",
7220
+ backgroundColor: rgba(colors.BORDER_MAIN, 0.3),
7221
+ borderRadius: 18,
7222
+ paddingLeft: LEFT_PADDING,
7223
+ transitionProperty: "background-color, border-color"
7224
+ },
7225
+ focused: {
7226
+ backgroundColor: colors.CLASSIC_WHITE,
7227
+ borderColor: colors.BORDER_MAIN
7228
+ },
7229
+ input: {
7230
+ fontSize: 14,
7231
+ paddingLeft: 0
7232
+ },
7233
+ label: {
7234
+ left: LEFT_PADDING,
7235
+ fontSize: 14
7236
+ }
7237
+ }
7238
+ };
7239
+ function _define_property$w(obj, key, value) {
7240
+ if (key in obj) {
7241
+ Object.defineProperty(obj, key, {
7242
+ value,
7243
+ enumerable: true,
7244
+ configurable: true,
7245
+ writable: true
7246
+ });
7247
+ } else {
7248
+ obj[key] = value;
7249
+ }
7250
+ return obj;
7251
+ }
7252
+ function _object_spread$v(target) {
7253
+ for (var i = 1; i < arguments.length; i++) {
7254
+ var source = arguments[i] != null ? arguments[i] : {};
7255
+ var ownKeys2 = Object.keys(source);
7256
+ if (typeof Object.getOwnPropertySymbols === "function") {
7257
+ ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
7258
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
7259
+ }));
7260
+ }
7261
+ ownKeys2.forEach(function(key) {
7262
+ _define_property$w(target, key, source[key]);
7263
+ });
7264
+ }
7265
+ return target;
7266
+ }
7267
+ function ownKeys$p(object, enumerableOnly) {
7268
+ var keys = Object.keys(object);
7269
+ if (Object.getOwnPropertySymbols) {
7270
+ var symbols = Object.getOwnPropertySymbols(object);
7271
+ if (enumerableOnly) {
7272
+ symbols = symbols.filter(function(sym) {
7273
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
7274
+ });
7275
+ }
7276
+ keys.push.apply(keys, symbols);
7277
+ }
7278
+ return keys;
7279
+ }
7280
+ function _object_spread_props$p(target, source) {
7281
+ source = source != null ? source : {};
7282
+ if (Object.getOwnPropertyDescriptors) {
7283
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7284
+ } else {
7285
+ ownKeys$p(Object(source)).forEach(function(key) {
7286
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7287
+ });
7288
+ }
7289
+ return target;
7290
+ }
7291
+ function _object_without_properties$6(source, excluded) {
7292
+ if (source == null)
7293
+ return {};
7294
+ var target = _object_without_properties_loose$6(source, excluded);
7295
+ var key, i;
7296
+ if (Object.getOwnPropertySymbols) {
7297
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
7298
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
7299
+ key = sourceSymbolKeys[i];
7300
+ if (excluded.indexOf(key) >= 0)
7301
+ continue;
7302
+ if (!Object.prototype.propertyIsEnumerable.call(source, key))
7303
+ continue;
7304
+ target[key] = source[key];
7305
+ }
7306
+ }
7307
+ return target;
7308
+ }
7309
+ function _object_without_properties_loose$6(source, excluded) {
7310
+ if (source == null)
7311
+ return {};
7312
+ var target = {};
7313
+ var sourceKeys = Object.keys(source);
7314
+ var key, i;
7315
+ for (i = 0; i < sourceKeys.length; i++) {
7316
+ key = sourceKeys[i];
7317
+ if (excluded.indexOf(key) >= 0)
7318
+ continue;
7319
+ target[key] = source[key];
7320
+ }
7321
+ return target;
7322
+ }
7323
+ var SearchInput = function(_param) {
7324
+ var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, props = _object_without_properties$6(_param, [
7325
+ "isClearable",
7326
+ "tweakStyles",
7327
+ "testId",
7328
+ "data"
7329
+ ]);
7330
+ var _useTheme = useTheme("SearchInput", styles$t, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7331
+ var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
7332
+ return /* @__PURE__ */ jsxs("div", _object_spread_props$p(_object_spread$v({
7333
+ className: classes.root
7334
+ }, addDataTestId(testId), addDataAttributes(data)), {
7335
+ children: [
7336
+ /* @__PURE__ */ jsx("div", {
7337
+ className: classes.icon,
7338
+ children: /* @__PURE__ */ jsx(Icon, {
7339
+ type: "search"
7340
+ })
7341
+ }),
7342
+ /* @__PURE__ */ jsx(Input, _object_spread$v({
7343
+ isClearable,
7344
+ isActive: props.value !== "" && props.value !== void 0,
7345
+ testId: getTestId(testId, "input"),
7346
+ tweakStyles: tweakInputStyles,
7347
+ hasFloatingLabel: false,
7348
+ label: props.placeholder
7349
+ }, props))
7350
+ ]
7351
+ }));
7158
7352
  };
7159
7353
  function _array_like_to_array$j(arr, len) {
7160
7354
  if (len == null || len > arr.length)
@@ -7196,7 +7390,7 @@ function _async_to_generator$4(fn3) {
7196
7390
  });
7197
7391
  };
7198
7392
  }
7199
- function _define_property$w(obj, key, value) {
7393
+ function _define_property$v(obj, key, value) {
7200
7394
  if (key in obj) {
7201
7395
  Object.defineProperty(obj, key, {
7202
7396
  value,
@@ -7240,7 +7434,7 @@ function _iterable_to_array_limit$j(arr, i) {
7240
7434
  function _non_iterable_rest$j() {
7241
7435
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7242
7436
  }
7243
- function _object_spread$v(target) {
7437
+ function _object_spread$u(target) {
7244
7438
  for (var i = 1; i < arguments.length; i++) {
7245
7439
  var source = arguments[i] != null ? arguments[i] : {};
7246
7440
  var ownKeys2 = Object.keys(source);
@@ -7250,12 +7444,12 @@ function _object_spread$v(target) {
7250
7444
  }));
7251
7445
  }
7252
7446
  ownKeys2.forEach(function(key) {
7253
- _define_property$w(target, key, source[key]);
7447
+ _define_property$v(target, key, source[key]);
7254
7448
  });
7255
7449
  }
7256
7450
  return target;
7257
7451
  }
7258
- function ownKeys$p(object, enumerableOnly) {
7452
+ function ownKeys$o(object, enumerableOnly) {
7259
7453
  var keys = Object.keys(object);
7260
7454
  if (Object.getOwnPropertySymbols) {
7261
7455
  var symbols = Object.getOwnPropertySymbols(object);
@@ -7268,21 +7462,21 @@ function ownKeys$p(object, enumerableOnly) {
7268
7462
  }
7269
7463
  return keys;
7270
7464
  }
7271
- function _object_spread_props$p(target, source) {
7465
+ function _object_spread_props$o(target, source) {
7272
7466
  source = source != null ? source : {};
7273
7467
  if (Object.getOwnPropertyDescriptors) {
7274
7468
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7275
7469
  } else {
7276
- ownKeys$p(Object(source)).forEach(function(key) {
7470
+ ownKeys$o(Object(source)).forEach(function(key) {
7277
7471
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7278
7472
  });
7279
7473
  }
7280
7474
  return target;
7281
7475
  }
7282
- function _object_without_properties$6(source, excluded) {
7476
+ function _object_without_properties$5(source, excluded) {
7283
7477
  if (source == null)
7284
7478
  return {};
7285
- var target = _object_without_properties_loose$6(source, excluded);
7479
+ var target = _object_without_properties_loose$5(source, excluded);
7286
7480
  var key, i;
7287
7481
  if (Object.getOwnPropertySymbols) {
7288
7482
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
@@ -7297,7 +7491,7 @@ function _object_without_properties$6(source, excluded) {
7297
7491
  }
7298
7492
  return target;
7299
7493
  }
7300
- function _object_without_properties_loose$6(source, excluded) {
7494
+ function _object_without_properties_loose$5(source, excluded) {
7301
7495
  if (source == null)
7302
7496
  return {};
7303
7497
  var target = {};
@@ -7430,7 +7624,7 @@ var __generator$4 = globalThis && globalThis.__generator || function(thisArg, bo
7430
7624
  }
7431
7625
  };
7432
7626
  function Select(_param) {
7433
- var options = _param.options, value = _param.value, defaultOptionLabel = _param.defaultOptionLabel, _param_debounceTime = _param.debounceTime, debounceTime = _param_debounceTime === void 0 ? 400 : _param_debounceTime, _param_optionsMode = _param.optionsMode, optionsMode = _param_optionsMode === void 0 ? "normal" : _param_optionsMode, noMatchesLabel = _param.noMatchesLabel, loadingLabel = _param.loadingLabel, tweakStyles = _param.tweakStyles, testId = _param.testId, isDisabled = _param.isDisabled, dropdownOptions = _param.dropdownOptions, _param_minSymbolsCountToOpenList = _param.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _param_minSymbolsCountToOpenList === void 0 ? 0 : _param_minSymbolsCountToOpenList, _param_dropdownIcon = _param.dropdownIcon, dropdownIcon = _param_dropdownIcon === void 0 ? "chevron-down" : _param_dropdownIcon, _param_shouldScrollToList = _param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, onChange = _param.onChange, onFocus = _param.onFocus, onBlur = _param.onBlur, onType = _param.onType, onOpen = _param.onOpen, _param_isOptionDisabled = _param.isOptionDisabled, isOptionDisabled = _param_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _param_isOptionDisabled, _param_compareValuesOnChange = _param.compareValuesOnChange, compareValuesOnChange = _param_compareValuesOnChange === void 0 ? defaultCompareFunction : _param_compareValuesOnChange, _param_convertValueToString = _param.convertValueToString, convertValueToString = _param_convertValueToString === void 0 ? defaultConvertFunction$2 : _param_convertValueToString, convertValueToId = _param.convertValueToId, convertValueToReactNode = _param.convertValueToReactNode, optionsFilter = _param.optionsFilter, inputProps = _object_without_properties$6(_param, [
7627
+ var options = _param.options, value = _param.value, defaultOptionLabel = _param.defaultOptionLabel, _param_debounceTime = _param.debounceTime, debounceTime = _param_debounceTime === void 0 ? 400 : _param_debounceTime, _param_optionsMode = _param.optionsMode, optionsMode = _param_optionsMode === void 0 ? "normal" : _param_optionsMode, noMatchesLabel = _param.noMatchesLabel, loadingLabel = _param.loadingLabel, tweakStyles = _param.tweakStyles, testId = _param.testId, isDisabled = _param.isDisabled, dropdownOptions = _param.dropdownOptions, _param_minSymbolsCountToOpenList = _param.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _param_minSymbolsCountToOpenList === void 0 ? 0 : _param_minSymbolsCountToOpenList, _param_dropdownIcon = _param.dropdownIcon, dropdownIcon = _param_dropdownIcon === void 0 ? "chevron-down" : _param_dropdownIcon, _param_shouldScrollToList = _param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, searchInput = _param.searchInput, onChange = _param.onChange, onFocus = _param.onFocus, onBlur = _param.onBlur, onType = _param.onType, onOpen = _param.onOpen, _param_isOptionDisabled = _param.isOptionDisabled, isOptionDisabled = _param_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _param_isOptionDisabled, _param_compareValuesOnChange = _param.compareValuesOnChange, compareValuesOnChange = _param_compareValuesOnChange === void 0 ? defaultCompareFunction : _param_compareValuesOnChange, _param_convertValueToString = _param.convertValueToString, convertValueToString = _param_convertValueToString === void 0 ? defaultConvertFunction$2 : _param_convertValueToString, convertValueToId = _param.convertValueToId, convertValueToReactNode = _param.convertValueToReactNode, optionsFilter = _param.optionsFilter, inputProps = _object_without_properties$5(_param, [
7434
7628
  "options",
7435
7629
  "value",
7436
7630
  "defaultOptionLabel",
@@ -7445,6 +7639,7 @@ function Select(_param) {
7445
7639
  "minSymbolsCountToOpenList",
7446
7640
  "dropdownIcon",
7447
7641
  "shouldScrollToList",
7642
+ "searchInput",
7448
7643
  "onChange",
7449
7644
  "onFocus",
7450
7645
  "onBlur",
@@ -7468,6 +7663,8 @@ function Select(_param) {
7468
7663
  var inputWrapper = useRef(null);
7469
7664
  var list = useRef(null);
7470
7665
  var input = useRef(null);
7666
+ var shouldRenderSearchInputInList = (searchInput === null || searchInput === void 0 ? void 0 : searchInput.shouldRenderInList) === true;
7667
+ var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
7471
7668
  var stringValue = isNotEmpty(value) ? convertValueToString(value) : void 0;
7472
7669
  var filteredOptions = useMemo(function() {
7473
7670
  if (optionsMode !== "search") {
@@ -7495,43 +7692,32 @@ function Select(_param) {
7495
7692
  value,
7496
7693
  convertValueToString
7497
7694
  ]);
7498
- var handleListClose = function() {
7695
+ var handleListClose = function(event) {
7499
7696
  setIsListOpen(false);
7500
7697
  setSearchValue("");
7501
7698
  setShouldShowDefaultOption(true);
7699
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
7502
7700
  };
7503
7701
  var handleListOpen = function() {
7504
- var _ref2 = _async_to_generator$4(function() {
7505
- return __generator$4(this, function(_state) {
7506
- if (isListOpen) {
7507
- return [
7508
- 2
7509
- ];
7510
- }
7511
- setIsListOpen(true);
7512
- return [
7513
- 2
7514
- ];
7515
- });
7516
- });
7517
- return function handleListOpen2() {
7518
- return _ref2.apply(this, arguments);
7519
- };
7520
- }();
7521
- var handleFocus = function(event) {
7522
- if (onFocus !== void 0) {
7523
- onFocus(event);
7702
+ if (!isListOpen) {
7703
+ setIsListOpen(true);
7524
7704
  }
7705
+ };
7706
+ var handleFocus = function(event) {
7707
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
7525
7708
  handleListOpen();
7526
7709
  };
7527
7710
  var handleOnClick = function() {
7528
7711
  handleListOpen();
7529
7712
  };
7530
7713
  var handleBlur = function(event) {
7531
- if (onBlur !== void 0) {
7532
- onBlur(event);
7714
+ if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current)) {
7715
+ return;
7716
+ }
7717
+ var isActionInsideList = hasExactParent(event.relatedTarget, list.current);
7718
+ if (!isActionInsideList) {
7719
+ handleListClose(event);
7533
7720
  }
7534
- handleListClose();
7535
7721
  };
7536
7722
  var handleOnChange = useCallback(function(newValue) {
7537
7723
  var areValuesEqual = compareValuesOnChange(value, newValue);
@@ -7543,10 +7729,10 @@ function Select(_param) {
7543
7729
  value,
7544
7730
  onChange
7545
7731
  ]);
7546
- var handleOptionClick = useCallback(function(index) {
7732
+ var handleOptionSelect = useCallback(function(index, event) {
7547
7733
  var _input_current;
7548
7734
  handleOnChange(index === -1 ? void 0 : filteredOptions[index]);
7549
- handleListClose();
7735
+ handleListClose(event);
7550
7736
  (_input_current = input.current) === null || _input_current === void 0 ? void 0 : _input_current.blur();
7551
7737
  }, [
7552
7738
  handleOnChange,
@@ -7601,7 +7787,7 @@ function Select(_param) {
7601
7787
  if (optionsMode !== "dynamic") {
7602
7788
  setShouldShowDefaultOption(v === "");
7603
7789
  }
7604
- if (v === "") {
7790
+ if (v === "" && !hasSearchInputInList) {
7605
7791
  handleOnChange(void 0);
7606
7792
  }
7607
7793
  setSearchValue(v);
@@ -7618,7 +7804,7 @@ function Select(_param) {
7618
7804
  if (indexToClick === -1 && filteredOptions.length === 1) {
7619
7805
  indexToClick = 0;
7620
7806
  }
7621
- handleOptionClick(indexToClick);
7807
+ handleOptionSelect(indexToClick, event);
7622
7808
  break;
7623
7809
  }
7624
7810
  case "ArrowDown": {
@@ -7665,14 +7851,23 @@ function Select(_param) {
7665
7851
  (_input_current1 = input.current) === null || _input_current1 === void 0 ? void 0 : _input_current1.focus();
7666
7852
  }
7667
7853
  };
7668
- useOnClickOutsideWithRef(list, function() {
7669
- handleListClose();
7670
- }, inputWrapper);
7671
- var isOpen = isListOpen && (inputProps.isLoading || filteredOptions.length > 0 || defaultOptionLabel !== void 0 && searchValue === "" || noMatchesLabel !== void 0) && searchValue.trim().length >= minSymbolsCountToOpenList;
7854
+ useOnClickOutsideWithRef(list, handleListClose, inputWrapper);
7855
+ var hasEnoughSymbolsToSearch = searchValue.trim().length >= minSymbolsCountToOpenList;
7856
+ var isOpen = (
7857
+ // Пользователь пытается открыть лист
7858
+ isListOpen && // Нам есть что показать:
7859
+ // Есть опции
7860
+ (filteredOptions.length > 0 || // Дефолтная опция
7861
+ defaultOptionLabel !== void 0 && !hasEnoughSymbolsToSearch || // Текст "Загрузка..."
7862
+ inputProps.isLoading || // Текст "Совпадений не найдено"
7863
+ noMatchesLabel !== void 0 || // У нас есть инпут с поиском внутри листа
7864
+ hasSearchInputInList) && // Последняя проверка на случай, если мы че то ищем в опциях
7865
+ (optionsMode === "normal" || hasEnoughSymbolsToSearch)
7866
+ );
7672
7867
  var _inputProps_isReadonly = inputProps.isReadonly, isReadonly = _inputProps_isReadonly === void 0 ? true : _inputProps_isReadonly;
7673
- var shouldUsePointerCursor = optionsMode === "normal" && isReadonly;
7868
+ var shouldUsePointerCursor = (optionsMode === "normal" || shouldRenderSearchInputInList) && isReadonly;
7674
7869
  var tweakInputStyles = useMemo(function() {
7675
- return merge({}, componentStyles.tweakInput, _object_spread$v({}, shouldUsePointerCursor ? {
7870
+ return merge({}, componentStyles.tweakInput, _object_spread$u({}, shouldUsePointerCursor ? {
7676
7871
  input: {
7677
7872
  cursor: "pointer"
7678
7873
  }
@@ -7681,6 +7876,7 @@ function Select(_param) {
7681
7876
  tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakInput,
7682
7877
  shouldUsePointerCursor
7683
7878
  ]);
7879
+ var tweakSearchInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakSearchInput");
7684
7880
  var _ref = dropdownOptions !== null && dropdownOptions !== void 0 ? dropdownOptions : {}, _ref_shouldUsePopper = _ref.shouldUsePopper, shouldUsePopper = _ref_shouldUsePopper === void 0 ? false : _ref_shouldUsePopper, _ref_shouldRenderInBody = _ref.shouldRenderInBody, shouldRenderInBody = _ref_shouldRenderInBody === void 0 ? false : _ref_shouldRenderInBody, _ref_shouldHideOnScroll = _ref.shouldHideOnScroll, shouldHideOnScroll = _ref_shouldHideOnScroll === void 0 ? false : _ref_shouldHideOnScroll;
7685
7881
  var popperData = useDropdown({
7686
7882
  isOpen,
@@ -7702,30 +7898,34 @@ function Select(_param) {
7702
7898
  onOpen
7703
7899
  ]);
7704
7900
  var _obj;
7705
- var listEl = /* @__PURE__ */ jsx("div", _object_spread_props$p(_object_spread$v({
7706
- className: clsx(classes.listWrapper, (_obj = {}, _define_property$w(_obj, classes.withoutPopper, !shouldUsePopper), _define_property$w(_obj, classes.listWrapperInBody, shouldRenderInBody), _obj)),
7901
+ var listEl = /* @__PURE__ */ jsx("div", _object_spread_props$o(_object_spread$u({
7902
+ className: clsx(classes.listWrapper, (_obj = {}, _define_property$v(_obj, classes.withoutPopper, !shouldUsePopper), _define_property$v(_obj, classes.listWrapperInBody, shouldRenderInBody), _obj)),
7707
7903
  ref: list,
7708
- onMouseDown: function(event) {
7709
- return event.preventDefault();
7710
- },
7711
- style: popperData === null || popperData === void 0 ? void 0 : popperData.styles.popper
7904
+ style: popperData === null || popperData === void 0 ? void 0 : popperData.styles.popper,
7905
+ onBlur: handleBlur
7712
7906
  }, popperData === null || popperData === void 0 ? void 0 : popperData.attributes.popper), {
7713
7907
  children: isOpen && /* @__PURE__ */ jsx(SelectList, {
7714
7908
  options: filteredOptions,
7715
7909
  defaultOptionLabel: hasDefaultOption && shouldShowDefaultOption ? defaultOptionLabel : void 0,
7910
+ customListHeader: hasSearchInputInList ? /* @__PURE__ */ jsx(SearchInput, _object_spread$u({
7911
+ value: searchValue,
7912
+ onChange: handleInputChange,
7913
+ tweakStyles: tweakSearchInputStyles,
7914
+ placeholder: "Поиск"
7915
+ }, searchInput)) : void 0,
7716
7916
  noMatchesLabel,
7717
7917
  focusedIndex: focusedListCellIndex,
7718
7918
  activeValue: value,
7719
7919
  isLoading: inputProps.isLoading,
7720
7920
  loadingLabel,
7721
7921
  tweakStyles: tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakSelectList,
7722
- testId: testId !== void 0 ? "".concat(testId, "-list") : void 0,
7922
+ testId: getTestId(testId, "list"),
7723
7923
  shouldScrollToList: shouldScrollToList && !shouldUsePopper && !shouldHideOnScroll,
7724
7924
  isOptionDisabled,
7725
7925
  convertValueToString,
7726
7926
  convertValueToReactNode,
7727
7927
  convertValueToId,
7728
- onOptionClick: handleOptionClick
7928
+ onOptionClick: handleOptionSelect
7729
7929
  })
7730
7930
  }));
7731
7931
  return /* @__PURE__ */ jsxs("div", {
@@ -7737,11 +7937,11 @@ function Select(_param) {
7737
7937
  onClick: isDisabled ? void 0 : handleOnClick,
7738
7938
  ref: inputWrapper,
7739
7939
  children: [
7740
- /* @__PURE__ */ jsx(Input, _object_spread$v({
7741
- value: searchValue !== "" ? searchValue : stringValue,
7940
+ /* @__PURE__ */ jsx(Input, _object_spread$u({
7941
+ value: searchValue !== "" && !shouldRenderSearchInputInList ? searchValue : stringValue,
7742
7942
  onChange: handleInputChange,
7743
7943
  isActive: isListOpen,
7744
- isReadonly: optionsMode === "normal",
7944
+ isReadonly: optionsMode === "normal" || shouldRenderSearchInputInList,
7745
7945
  onFocus: handleFocus,
7746
7946
  onBlur: handleBlur,
7747
7947
  isDisabled,
@@ -7775,7 +7975,7 @@ function Select(_param) {
7775
7975
  }
7776
7976
  var SELECT_PADDING_LEFT = 12;
7777
7977
  var SELECT_PADDING_RIGHT = 24;
7778
- var styles$t = {
7978
+ var styles$s = {
7779
7979
  btn: {
7780
7980
  width: 36,
7781
7981
  height: 36,
@@ -7844,7 +8044,7 @@ var styles$t = {
7844
8044
  };
7845
8045
  var DatePickerHeader = function(param) {
7846
8046
  var date = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, isPrevMonthButtonDisabled = param.isPrevMonthButtonDisabled, isNextMonthButtonDisabled = param.isNextMonthButtonDisabled, months = param.months;
7847
- var _useTheme = useTheme("DatePickerHeader", styles$t), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
8047
+ var _useTheme = useTheme("DatePickerHeader", styles$s), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
7848
8048
  var years = useMemo(function() {
7849
8049
  return Array.from(Array(41)).map(function(_, i) {
7850
8050
  return getYear(new Date()) - 30 + i;
@@ -7928,7 +8128,7 @@ var DatePickerHeader = function(param) {
7928
8128
  ]
7929
8129
  });
7930
8130
  };
7931
- var styles$s = {
8131
+ var styles$r = {
7932
8132
  root: {
7933
8133
  width: "100%",
7934
8134
  height: "100%"
@@ -7990,7 +8190,7 @@ function _array_with_holes$i(arr) {
7990
8190
  if (Array.isArray(arr))
7991
8191
  return arr;
7992
8192
  }
7993
- function _define_property$v(obj, key, value) {
8193
+ function _define_property$u(obj, key, value) {
7994
8194
  if (key in obj) {
7995
8195
  Object.defineProperty(obj, key, {
7996
8196
  value,
@@ -8034,7 +8234,7 @@ function _iterable_to_array_limit$i(arr, i) {
8034
8234
  function _non_iterable_rest$i() {
8035
8235
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8036
8236
  }
8037
- function _object_spread$u(target) {
8237
+ function _object_spread$t(target) {
8038
8238
  for (var i = 1; i < arguments.length; i++) {
8039
8239
  var source = arguments[i] != null ? arguments[i] : {};
8040
8240
  var ownKeys2 = Object.keys(source);
@@ -8044,12 +8244,12 @@ function _object_spread$u(target) {
8044
8244
  }));
8045
8245
  }
8046
8246
  ownKeys2.forEach(function(key) {
8047
- _define_property$v(target, key, source[key]);
8247
+ _define_property$u(target, key, source[key]);
8048
8248
  });
8049
8249
  }
8050
8250
  return target;
8051
8251
  }
8052
- function ownKeys$o(object, enumerableOnly) {
8252
+ function ownKeys$n(object, enumerableOnly) {
8053
8253
  var keys = Object.keys(object);
8054
8254
  if (Object.getOwnPropertySymbols) {
8055
8255
  var symbols = Object.getOwnPropertySymbols(object);
@@ -8062,21 +8262,21 @@ function ownKeys$o(object, enumerableOnly) {
8062
8262
  }
8063
8263
  return keys;
8064
8264
  }
8065
- function _object_spread_props$o(target, source) {
8265
+ function _object_spread_props$n(target, source) {
8066
8266
  source = source != null ? source : {};
8067
8267
  if (Object.getOwnPropertyDescriptors) {
8068
8268
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8069
8269
  } else {
8070
- ownKeys$o(Object(source)).forEach(function(key) {
8270
+ ownKeys$n(Object(source)).forEach(function(key) {
8071
8271
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8072
8272
  });
8073
8273
  }
8074
8274
  return target;
8075
8275
  }
8076
- function _object_without_properties$5(source, excluded) {
8276
+ function _object_without_properties$4(source, excluded) {
8077
8277
  if (source == null)
8078
8278
  return {};
8079
- var target = _object_without_properties_loose$5(source, excluded);
8279
+ var target = _object_without_properties_loose$4(source, excluded);
8080
8280
  var key, i;
8081
8281
  if (Object.getOwnPropertySymbols) {
8082
8282
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
@@ -8091,7 +8291,7 @@ function _object_without_properties$5(source, excluded) {
8091
8291
  }
8092
8292
  return target;
8093
8293
  }
8094
- function _object_without_properties_loose$5(source, excluded) {
8294
+ function _object_without_properties_loose$4(source, excluded) {
8095
8295
  if (source == null)
8096
8296
  return {};
8097
8297
  var target = {};
@@ -8132,7 +8332,7 @@ var PopperContainer = function(param) {
8132
8332
  };
8133
8333
  var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
8134
8334
  var DatePicker = function(_param) {
8135
- var data = _param.data, tweakStyles = _param.tweakStyles, selectedDate = _param.selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, endDate = _param.endDate, startDate = _param.startDate, size = _param.size, isRange = _param.isRange, locale2 = _param.locale, months = _param.months, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, isInline = _param.isInline, isNeedClearSelectedDate = _param.isNeedClearSelectedDate, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "__.__.____" : _param_placeholder, shouldGiveValueOnType = _param.shouldGiveValueOnType, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, popperModifiers = _param.popperModifiers, showPreviousMonths = _param.showPreviousMonths, popperPlacement = _param.popperPlacement, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, customHeader = _param.customHeader, filterDate = _param.filterDate, inputProps = _object_without_properties$5(_param, [
8335
+ var data = _param.data, tweakStyles = _param.tweakStyles, selectedDate = _param.selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, endDate = _param.endDate, startDate = _param.startDate, size = _param.size, isRange = _param.isRange, locale2 = _param.locale, months = _param.months, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, isInline = _param.isInline, isNeedClearSelectedDate = _param.isNeedClearSelectedDate, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "__.__.____" : _param_placeholder, shouldGiveValueOnType = _param.shouldGiveValueOnType, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, popperModifiers = _param.popperModifiers, showPreviousMonths = _param.showPreviousMonths, popperPlacement = _param.popperPlacement, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, customHeader = _param.customHeader, filterDate = _param.filterDate, inputProps = _object_without_properties$4(_param, [
8136
8336
  "data",
8137
8337
  "tweakStyles",
8138
8338
  "selectedDate",
@@ -8163,7 +8363,7 @@ var DatePicker = function(_param) {
8163
8363
  "customHeader",
8164
8364
  "filterDate"
8165
8365
  ]);
8166
- var classes = useTheme("DatePicker", styles$s, tweakStyles, {
8366
+ var classes = useTheme("DatePicker", styles$r, tweakStyles, {
8167
8367
  leftPosition,
8168
8368
  topPosition
8169
8369
  }).classes;
@@ -8312,7 +8512,7 @@ var DatePicker = function(_param) {
8312
8512
  },
8313
8513
  filterDate
8314
8514
  };
8315
- var dateInputProps = _object_spread_props$o(_object_spread$u({}, inputProps), {
8515
+ var dateInputProps = _object_spread_props$n(_object_spread$t({}, inputProps), {
8316
8516
  tweakStyles,
8317
8517
  iconType: inputProps.isClearable && dateValue !== "" ? void 0 : "calendar",
8318
8518
  isRange,
@@ -8321,14 +8521,14 @@ var DatePicker = function(_param) {
8321
8521
  }
8322
8522
  });
8323
8523
  if (onChangeRange) {
8324
- datePickerProps = _object_spread_props$o(_object_spread$u({}, datePickerProps), {
8524
+ datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
8325
8525
  startDate: start2,
8326
8526
  endDate: end2,
8327
8527
  selectsRange: true,
8328
8528
  selected: startDate,
8329
8529
  onChange: onChangeRange
8330
8530
  });
8331
- dateInputProps = _object_spread_props$o(_object_spread$u({}, dateInputProps), {
8531
+ dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
8332
8532
  startDate: startDateValue,
8333
8533
  endDate: endDateValue,
8334
8534
  onBlur: handleRangeBlur,
@@ -8336,7 +8536,7 @@ var DatePicker = function(_param) {
8336
8536
  });
8337
8537
  }
8338
8538
  if (onChangeDate) {
8339
- datePickerProps = _object_spread_props$o(_object_spread$u({}, datePickerProps), {
8539
+ datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
8340
8540
  selected: date,
8341
8541
  onChange: function(newDate) {
8342
8542
  return onChangeDate(newDate);
@@ -8350,20 +8550,20 @@ var DatePicker = function(_param) {
8350
8550
  minDate,
8351
8551
  maxDate
8352
8552
  });
8353
- dateInputProps = _object_spread_props$o(_object_spread$u({}, dateInputProps), {
8553
+ dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
8354
8554
  date: dateValue,
8355
8555
  isActive: isOpen,
8356
8556
  onBlur: handleBlur,
8357
8557
  onChange: handleDateChange
8358
8558
  });
8359
8559
  }
8360
- return /* @__PURE__ */ jsx("div", _object_spread_props$o(_object_spread$u({
8560
+ return /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$t({
8361
8561
  className: classes.root
8362
8562
  }, addDataAttributes(data)), {
8363
- children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$o(_object_spread$u({}, datePickerProps), {
8563
+ children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$n(_object_spread$t({}, datePickerProps), {
8364
8564
  customInput: /* @__PURE__ */ jsx(DatePickerInput, {
8365
8565
  size,
8366
- children: /* @__PURE__ */ jsx(DateInput, _object_spread$u({}, dateInputProps))
8566
+ children: /* @__PURE__ */ jsx(DateInput, _object_spread$t({}, dateInputProps))
8367
8567
  }),
8368
8568
  renderCustomHeader: customHeader !== void 0 ? customHeader : function(param) {
8369
8569
  var renderDate = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, prevMonthButtonDisabled = param.prevMonthButtonDisabled, nextMonthButtonDisabled = param.nextMonthButtonDisabled;
@@ -8381,7 +8581,7 @@ var DatePicker = function(_param) {
8381
8581
  }))
8382
8582
  }));
8383
8583
  };
8384
- var styles$r = {
8584
+ var styles$q = {
8385
8585
  root: {},
8386
8586
  button: {
8387
8587
  cursor: "pointer",
@@ -8422,7 +8622,7 @@ function _array_with_holes$h(arr) {
8422
8622
  if (Array.isArray(arr))
8423
8623
  return arr;
8424
8624
  }
8425
- function _define_property$u(obj, key, value) {
8625
+ function _define_property$t(obj, key, value) {
8426
8626
  if (key in obj) {
8427
8627
  Object.defineProperty(obj, key, {
8428
8628
  value,
@@ -8466,7 +8666,7 @@ function _iterable_to_array_limit$h(arr, i) {
8466
8666
  function _non_iterable_rest$h() {
8467
8667
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8468
8668
  }
8469
- function _object_spread$t(target) {
8669
+ function _object_spread$s(target) {
8470
8670
  for (var i = 1; i < arguments.length; i++) {
8471
8671
  var source = arguments[i] != null ? arguments[i] : {};
8472
8672
  var ownKeys2 = Object.keys(source);
@@ -8476,12 +8676,12 @@ function _object_spread$t(target) {
8476
8676
  }));
8477
8677
  }
8478
8678
  ownKeys2.forEach(function(key) {
8479
- _define_property$u(target, key, source[key]);
8679
+ _define_property$t(target, key, source[key]);
8480
8680
  });
8481
8681
  }
8482
8682
  return target;
8483
8683
  }
8484
- function ownKeys$n(object, enumerableOnly) {
8684
+ function ownKeys$m(object, enumerableOnly) {
8485
8685
  var keys = Object.keys(object);
8486
8686
  if (Object.getOwnPropertySymbols) {
8487
8687
  var symbols = Object.getOwnPropertySymbols(object);
@@ -8494,12 +8694,12 @@ function ownKeys$n(object, enumerableOnly) {
8494
8694
  }
8495
8695
  return keys;
8496
8696
  }
8497
- function _object_spread_props$n(target, source) {
8697
+ function _object_spread_props$m(target, source) {
8498
8698
  source = source != null ? source : {};
8499
8699
  if (Object.getOwnPropertyDescriptors) {
8500
8700
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8501
8701
  } else {
8502
- ownKeys$n(Object(source)).forEach(function(key) {
8702
+ ownKeys$m(Object(source)).forEach(function(key) {
8503
8703
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8504
8704
  });
8505
8705
  }
@@ -8524,14 +8724,14 @@ function _unsupported_iterable_to_array$h(o, minLen) {
8524
8724
  var LINK_REGEXP = /(http(s?):\/\/(.*))(\s?)/;
8525
8725
  var Description = function(param) {
8526
8726
  var text = param.text, moreTitle = param.moreTitle, lessTitle = param.lessTitle, _param_truncateIndex = param.truncateIndex, truncateIndex = _param_truncateIndex === void 0 ? 150 : _param_truncateIndex, _param_isAlwaysOpen = param.isAlwaysOpen, isAlwaysOpen = _param_isAlwaysOpen === void 0 ? true : _param_isAlwaysOpen, data = param.data, tweakStyles = param.tweakStyles;
8527
- var classes = useTheme("Description", styles$r, tweakStyles).classes;
8727
+ var classes = useTheme("Description", styles$q, tweakStyles).classes;
8528
8728
  var isTooShort = text.length < truncateIndex;
8529
8729
  var _useState = _sliced_to_array$h(useState(isAlwaysOpen), 2), isOpen = _useState[0], setIsOpen = _useState[1];
8530
8730
  var link = text.match(LINK_REGEXP);
8531
8731
  var linkText = link && link[0];
8532
8732
  var textWithNoLink = text.replace(LINK_REGEXP, "");
8533
8733
  var shortText = text.slice(0, text.slice(0, truncateIndex).lastIndexOf(" "));
8534
- return /* @__PURE__ */ jsxs("div", _object_spread_props$n(_object_spread$t({
8734
+ return /* @__PURE__ */ jsxs("div", _object_spread_props$m(_object_spread$s({
8535
8735
  className: classes.root
8536
8736
  }, addDataAttributes(data)), {
8537
8737
  children: [
@@ -8566,158 +8766,6 @@ var Description = function(param) {
8566
8766
  ]
8567
8767
  }));
8568
8768
  };
8569
- var LEFT_PADDING = 44;
8570
- var styles$q = {
8571
- root: {
8572
- position: "relative"
8573
- },
8574
- icon: {
8575
- display: "flex",
8576
- alignItems: "center",
8577
- position: "absolute",
8578
- left: 12,
8579
- height: "100%",
8580
- width: 20,
8581
- zIndex: 2,
8582
- color: colors.GREY_ACTIVE
8583
- },
8584
- tweakInput: {
8585
- inputWrapper: {
8586
- height: 35,
8587
- borderColor: "transparent",
8588
- backgroundColor: rgba(colors.BORDER_MAIN, 0.3),
8589
- borderRadius: 18,
8590
- paddingLeft: LEFT_PADDING,
8591
- transitionProperty: "background-color, border-color"
8592
- },
8593
- focused: {
8594
- backgroundColor: colors.CLASSIC_WHITE,
8595
- borderColor: colors.BORDER_MAIN
8596
- },
8597
- input: {
8598
- fontSize: 14,
8599
- paddingLeft: 0
8600
- },
8601
- label: {
8602
- left: LEFT_PADDING,
8603
- fontSize: 14
8604
- }
8605
- }
8606
- };
8607
- function _define_property$t(obj, key, value) {
8608
- if (key in obj) {
8609
- Object.defineProperty(obj, key, {
8610
- value,
8611
- enumerable: true,
8612
- configurable: true,
8613
- writable: true
8614
- });
8615
- } else {
8616
- obj[key] = value;
8617
- }
8618
- return obj;
8619
- }
8620
- function _object_spread$s(target) {
8621
- for (var i = 1; i < arguments.length; i++) {
8622
- var source = arguments[i] != null ? arguments[i] : {};
8623
- var ownKeys2 = Object.keys(source);
8624
- if (typeof Object.getOwnPropertySymbols === "function") {
8625
- ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
8626
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
8627
- }));
8628
- }
8629
- ownKeys2.forEach(function(key) {
8630
- _define_property$t(target, key, source[key]);
8631
- });
8632
- }
8633
- return target;
8634
- }
8635
- function ownKeys$m(object, enumerableOnly) {
8636
- var keys = Object.keys(object);
8637
- if (Object.getOwnPropertySymbols) {
8638
- var symbols = Object.getOwnPropertySymbols(object);
8639
- if (enumerableOnly) {
8640
- symbols = symbols.filter(function(sym) {
8641
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
8642
- });
8643
- }
8644
- keys.push.apply(keys, symbols);
8645
- }
8646
- return keys;
8647
- }
8648
- function _object_spread_props$m(target, source) {
8649
- source = source != null ? source : {};
8650
- if (Object.getOwnPropertyDescriptors) {
8651
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8652
- } else {
8653
- ownKeys$m(Object(source)).forEach(function(key) {
8654
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8655
- });
8656
- }
8657
- return target;
8658
- }
8659
- function _object_without_properties$4(source, excluded) {
8660
- if (source == null)
8661
- return {};
8662
- var target = _object_without_properties_loose$4(source, excluded);
8663
- var key, i;
8664
- if (Object.getOwnPropertySymbols) {
8665
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
8666
- for (i = 0; i < sourceSymbolKeys.length; i++) {
8667
- key = sourceSymbolKeys[i];
8668
- if (excluded.indexOf(key) >= 0)
8669
- continue;
8670
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
8671
- continue;
8672
- target[key] = source[key];
8673
- }
8674
- }
8675
- return target;
8676
- }
8677
- function _object_without_properties_loose$4(source, excluded) {
8678
- if (source == null)
8679
- return {};
8680
- var target = {};
8681
- var sourceKeys = Object.keys(source);
8682
- var key, i;
8683
- for (i = 0; i < sourceKeys.length; i++) {
8684
- key = sourceKeys[i];
8685
- if (excluded.indexOf(key) >= 0)
8686
- continue;
8687
- target[key] = source[key];
8688
- }
8689
- return target;
8690
- }
8691
- var SearchInput = function(_param) {
8692
- var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, props = _object_without_properties$4(_param, [
8693
- "isClearable",
8694
- "tweakStyles",
8695
- "testId",
8696
- "data"
8697
- ]);
8698
- var _useTheme = useTheme("SearchInput", styles$q, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
8699
- var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
8700
- return /* @__PURE__ */ jsxs("div", _object_spread_props$m(_object_spread$s({
8701
- className: classes.root
8702
- }, addDataTestId(testId), addDataAttributes(data)), {
8703
- children: [
8704
- /* @__PURE__ */ jsx("div", {
8705
- className: classes.icon,
8706
- children: /* @__PURE__ */ jsx(Icon, {
8707
- type: "search"
8708
- })
8709
- }),
8710
- /* @__PURE__ */ jsx(Input, _object_spread$s({
8711
- isClearable,
8712
- isActive: props.value !== "" && props.value !== void 0,
8713
- testId: getTestId(testId, "input"),
8714
- tweakStyles: tweakInputStyles,
8715
- hasFloatingLabel: false,
8716
- label: props.placeholder
8717
- }, props))
8718
- ]
8719
- }));
8720
- };
8721
8769
  var SelectLocales = {
8722
8770
  ru: {
8723
8771
  clear: "Очистить",
@@ -27084,6 +27132,7 @@ export {
27084
27132
  getScrollParent$1 as getScrollParent,
27085
27133
  getStyleComputedProperty,
27086
27134
  getTestId,
27135
+ hasExactParent,
27087
27136
  isElementOffScreen,
27088
27137
  isElementOneOfParents,
27089
27138
  isInt,