@true-engineering/true-react-common-ui-kit 2.1.1 → 2.2.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 (50) hide show
  1. package/dist/components/Button/Button.d.ts +3 -4
  2. package/dist/components/Input/Input.d.ts +3 -4
  3. package/dist/components/List/List.d.ts +3 -4
  4. package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +4 -4
  5. package/dist/components/Select/Select.d.ts +2 -3
  6. package/dist/helpers/deprecated.d.ts +12 -0
  7. package/dist/helpers/index.d.ts +2 -2
  8. package/dist/helpers/misc.d.ts +19 -0
  9. package/dist/helpers/snippets.d.ts +3 -3
  10. package/dist/true-react-common-ui-kit.js +238 -308
  11. package/dist/true-react-common-ui-kit.js.map +1 -1
  12. package/dist/true-react-common-ui-kit.umd.cjs +238 -309
  13. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  14. package/dist/types.d.ts +3 -1
  15. package/package.json +2 -1
  16. package/src/components/Button/Button.tsx +9 -29
  17. package/src/components/Checkbox/Checkbox.tsx +7 -2
  18. package/src/components/DatePicker/DatePicker.tsx +6 -1
  19. package/src/components/DatePicker/helpers.ts +5 -1
  20. package/src/components/FiltersPane/FilterSelect/FilterSelect.tsx +3 -2
  21. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.tsx +2 -1
  22. package/src/components/IncrementInput/IncrementInput.tsx +3 -2
  23. package/src/components/Input/Input.tsx +15 -10
  24. package/src/components/List/List.tsx +13 -10
  25. package/src/components/Modal/Modal.tsx +8 -3
  26. package/src/components/MoreMenu/MoreMenu.tsx +3 -2
  27. package/src/components/Notification/Notification.tsx +11 -7
  28. package/src/components/NumberInput/NumberInput.tsx +2 -2
  29. package/src/components/NumberInput/helpers.ts +3 -2
  30. package/src/components/RadioButton/RadioButton.tsx +3 -2
  31. package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +4 -4
  32. package/src/components/SearchInput/SearchInput.tsx +2 -1
  33. package/src/components/Select/MultiSelect.stories.tsx +2 -2
  34. package/src/components/Select/Select.stories.tsx +2 -2
  35. package/src/components/Select/Select.tsx +8 -8
  36. package/src/components/Select/SelectList/SelectList.tsx +11 -5
  37. package/src/components/Select/SelectListItem/SelectListItem.tsx +2 -1
  38. package/src/components/Select/helpers.ts +1 -1
  39. package/src/components/Switch/Switch.tsx +3 -2
  40. package/src/components/Toaster/Toaster.tsx +10 -5
  41. package/src/helpers/deprecated.ts +22 -0
  42. package/src/helpers/index.ts +2 -2
  43. package/src/helpers/{utils.ts → misc.ts} +11 -84
  44. package/src/helpers/phone.ts +5 -5
  45. package/src/helpers/snippets.tsx +4 -3
  46. package/src/types.ts +10 -1
  47. package/dist/helpers/colors.d.ts +0 -2
  48. package/dist/helpers/utils.d.ts +0 -43
  49. package/src/helpers/colors.ts +0 -3
  50. package/src/helpers/dateHelpers/date-helpers.ts +0 -9
@@ -1,9 +1,10 @@
1
1
  import React, { useRef, useEffect, useCallback, createContext, useContext, useMemo, useState, createElement, Fragment as Fragment$1, forwardRef, createRef, PureComponent, useLayoutEffect } from "react";
2
2
  import { CSSTransition } from "react-transition-group";
3
3
  import clsx from "clsx";
4
- import hexToRgba from "hex-to-rgba";
4
+ import { isNotEmpty as isNotEmpty$1, isEmpty as isEmpty$1, isString, isStringNotEmpty as isStringNotEmpty$1, isNumberInteger, addClickHandler as addClickHandler$1, addDataTestId as addDataTestId$1, createFilter as createFilter$1, getSelectKeyHandler as getSelectKeyHandler$1, getTestId as getTestId$1, isReactNodeNotEmpty } from "@true-engineering/true-react-platform-helpers";
5
5
  import { createUseStyles } from "react-jss";
6
6
  import InputMask from "react-input-mask";
7
+ import hexToRgba from "hex-to-rgba";
7
8
  import ReactDatePicker from "react-datepicker";
8
9
  import { Portal } from "react-overlays";
9
10
  import { getYear, getMonth, format as format$1, parse, isSameDay, isValid, isAfter, isBefore, startOfMonth, endOfMonth, sub, startOfYear, endOfYear } from "date-fns";
@@ -1108,7 +1109,22 @@ function requireReactJsxRuntime_development() {
1108
1109
  const Fragment = jsxRuntime.exports.Fragment;
1109
1110
  const jsx = jsxRuntime.exports.jsx;
1110
1111
  const jsxs = jsxRuntime.exports.jsxs;
1111
- var rgba = hexToRgba;
1112
+ var minWidthModifier = {
1113
+ name: "minWidth",
1114
+ enabled: true,
1115
+ phase: "beforeWrite",
1116
+ requires: [
1117
+ "computeStyles"
1118
+ ],
1119
+ fn: function(param) {
1120
+ var state = param.state;
1121
+ state.styles.popper.minWidth = "".concat(state.rects.reference.width, "px");
1122
+ },
1123
+ effect: function(param) {
1124
+ var state = param.state;
1125
+ state.elements.popper.style.minWidth = "".concat(state.elements.reference.offsetWidth, "px");
1126
+ }
1127
+ };
1112
1128
  function _array_like_to_array$q(arr, len) {
1113
1129
  if (len == null || len > arr.length)
1114
1130
  len = arr.length;
@@ -1116,18 +1132,125 @@ function _array_like_to_array$q(arr, len) {
1116
1132
  arr2[i] = arr[i];
1117
1133
  return arr2;
1118
1134
  }
1119
- function _array_with_holes$o(arr) {
1120
- if (Array.isArray(arr))
1121
- return arr;
1122
- }
1123
- function _array_without_holes$7(arr) {
1135
+ function _array_without_holes$6(arr) {
1124
1136
  if (Array.isArray(arr))
1125
1137
  return _array_like_to_array$q(arr);
1126
1138
  }
1127
- function _iterable_to_array$7(iter) {
1139
+ function _iterable_to_array$6(iter) {
1128
1140
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1129
1141
  return Array.from(iter);
1130
1142
  }
1143
+ function _non_iterable_spread$6() {
1144
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1145
+ }
1146
+ function _to_consumable_array$6(arr) {
1147
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$6();
1148
+ }
1149
+ function _unsupported_iterable_to_array$q(o, minLen) {
1150
+ if (!o)
1151
+ return;
1152
+ if (typeof o === "string")
1153
+ return _array_like_to_array$q(o, minLen);
1154
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1155
+ if (n === "Object" && o.constructor)
1156
+ n = o.constructor.name;
1157
+ if (n === "Map" || n === "Set")
1158
+ return Array.from(n);
1159
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1160
+ return _array_like_to_array$q(o, minLen);
1161
+ }
1162
+ var findCountryByCode = function(countryCode) {
1163
+ var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1164
+ return isNotEmpty$1(countryCode) ? countriesList.find(function(info) {
1165
+ return info.countryCode === countryCode;
1166
+ }) : void 0;
1167
+ };
1168
+ var findCountryIndexByCode = function(countryCode) {
1169
+ var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1170
+ return isNotEmpty$1(countryCode) ? countriesList.findIndex(function(info) {
1171
+ return info.countryCode === countryCode;
1172
+ }) : -1;
1173
+ };
1174
+ var getCountryTextByLocale = function(country, locale2) {
1175
+ return locale2.toLowerCase() === "ru" ? country.countryRu : country.countryEn;
1176
+ };
1177
+ var sortCountriesByLocale = function(countriesList, locale2) {
1178
+ return countriesList.sort(function(countryA, countryB) {
1179
+ return getCountryTextByLocale(countryA, locale2).localeCompare(getCountryTextByLocale(countryB, locale2));
1180
+ });
1181
+ };
1182
+ var checkSearchStringInCountry = function(country, searchString) {
1183
+ var checkValue = searchString.toLowerCase().trim().replace("+", "");
1184
+ var possibleValues = [
1185
+ country.countryRu,
1186
+ country.countryEn
1187
+ ].concat(_to_consumable_array$6(country.countryRu.split(" ")), _to_consumable_array$6(country.countryEn.split(" ")), [
1188
+ country.dialCode
1189
+ ]).map(function(part) {
1190
+ return part.toLowerCase();
1191
+ });
1192
+ return possibleValues.some(function(v) {
1193
+ return v.startsWith(checkValue);
1194
+ });
1195
+ };
1196
+ var _phone_dialCode, _phone_phoneNumber;
1197
+ var getFullPhone = function(phone) {
1198
+ return ((_phone_dialCode = phone === null || phone === void 0 ? void 0 : phone.dialCode) !== null && _phone_dialCode !== void 0 ? _phone_dialCode : "") + ((_phone_phoneNumber = phone === null || phone === void 0 ? void 0 : phone.phoneNumber) !== null && _phone_phoneNumber !== void 0 ? _phone_phoneNumber : "");
1199
+ };
1200
+ var getCountryCodeFromPhone = function(phoneWithCode) {
1201
+ var _phoneInfo_find;
1202
+ var countryCode = (_phoneInfo_find = phoneInfo.find(function(info) {
1203
+ return info.fullCodes.some(function(code) {
1204
+ return phoneWithCode.startsWith(code);
1205
+ });
1206
+ })) === null || _phoneInfo_find === void 0 ? void 0 : _phoneInfo_find.countryCode;
1207
+ if (isEmpty$1(countryCode) && isNotEmpty$1(phoneWithCode)) {
1208
+ var _phoneInfo_filter_sort_;
1209
+ var _infoA_dialCodePriority, _infoB_dialCodePriority;
1210
+ countryCode = (_phoneInfo_filter_sort_ = phoneInfo.filter(function(info) {
1211
+ return phoneWithCode.startsWith(info.dialCode);
1212
+ }).sort(function(infoA, infoB) {
1213
+ return ((_infoA_dialCodePriority = infoA.dialCodePriority) !== null && _infoA_dialCodePriority !== void 0 ? _infoA_dialCodePriority : 1e3) - ((_infoB_dialCodePriority = infoB.dialCodePriority) !== null && _infoB_dialCodePriority !== void 0 ? _infoB_dialCodePriority : 1e3);
1214
+ })[0]) === null || _phoneInfo_filter_sort_ === void 0 ? void 0 : _phoneInfo_filter_sort_.countryCode;
1215
+ }
1216
+ return countryCode;
1217
+ };
1218
+ var getPhoneObjFromString = function(fullPhone, countryCode) {
1219
+ var _findCountryByCode;
1220
+ var newCountryCode = countryCode !== null && countryCode !== void 0 ? countryCode : getCountryCodeFromPhone(fullPhone);
1221
+ var dialCode = (_findCountryByCode = findCountryByCode(newCountryCode)) === null || _findCountryByCode === void 0 ? void 0 : _findCountryByCode.dialCode;
1222
+ var phoneNumber = fullPhone.slice(dialCode === null || dialCode === void 0 ? void 0 : dialCode.length);
1223
+ return {
1224
+ dialCode,
1225
+ phoneNumber,
1226
+ countryCode: newCountryCode
1227
+ };
1228
+ };
1229
+ var DEFAULT_PHONE_MASK = "+ 9 999 999 999 999 99";
1230
+ var getPhoneMask = function(countryCode) {
1231
+ var mask = DEFAULT_PHONE_MASK;
1232
+ if (isNotEmpty$1(countryCode)) {
1233
+ var countrySettings = findCountryByCode(countryCode);
1234
+ if (countrySettings !== void 0) {
1235
+ var dialCodeLength = countrySettings.dialCode.length;
1236
+ var _countrySettings_phoneMask;
1237
+ var areaAndPhoneMask = (_countrySettings_phoneMask = countrySettings.phoneMask) !== null && _countrySettings_phoneMask !== void 0 ? _countrySettings_phoneMask : mask.substring(2, mask.length - dialCodeLength);
1238
+ mask = "+ ".concat("9".repeat(dialCodeLength), " ").concat(areaAndPhoneMask);
1239
+ }
1240
+ }
1241
+ return mask;
1242
+ };
1243
+ function _array_like_to_array$p(arr, len) {
1244
+ if (len == null || len > arr.length)
1245
+ len = arr.length;
1246
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
1247
+ arr2[i] = arr[i];
1248
+ return arr2;
1249
+ }
1250
+ function _array_with_holes$o(arr) {
1251
+ if (Array.isArray(arr))
1252
+ return arr;
1253
+ }
1131
1254
  function _iterable_to_array_limit$o(arr, i) {
1132
1255
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1133
1256
  if (_i == null)
@@ -1159,28 +1282,23 @@ function _iterable_to_array_limit$o(arr, i) {
1159
1282
  function _non_iterable_rest$o() {
1160
1283
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1161
1284
  }
1162
- function _non_iterable_spread$7() {
1163
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1164
- }
1165
1285
  function _sliced_to_array$o(arr, i) {
1166
- return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$o();
1286
+ return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$p(arr, i) || _non_iterable_rest$o();
1167
1287
  }
1168
- function _to_consumable_array$7(arr) {
1169
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$7();
1170
- }
1171
- function _unsupported_iterable_to_array$q(o, minLen) {
1288
+ function _unsupported_iterable_to_array$p(o, minLen) {
1172
1289
  if (!o)
1173
1290
  return;
1174
1291
  if (typeof o === "string")
1175
- return _array_like_to_array$q(o, minLen);
1292
+ return _array_like_to_array$p(o, minLen);
1176
1293
  var n = Object.prototype.toString.call(o).slice(8, -1);
1177
1294
  if (n === "Object" && o.constructor)
1178
1295
  n = o.constructor.name;
1179
1296
  if (n === "Map" || n === "Set")
1180
1297
  return Array.from(n);
1181
1298
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1182
- return _array_like_to_array$q(o, minLen);
1299
+ return _array_like_to_array$p(o, minLen);
1183
1300
  }
1301
+ var rgba = hexToRgba;
1184
1302
  var transformToKebab = function(string) {
1185
1303
  var result = "";
1186
1304
  string.split("").forEach(function(char) {
@@ -1292,21 +1410,9 @@ var setCaretPosition = function(elem, caretPos) {
1292
1410
  var isSpaceChar = function(char) {
1293
1411
  return char !== void 0 && char.match(/\s/) !== null;
1294
1412
  };
1295
- var isInt = function(n) {
1296
- return n % 1 === 0;
1297
- };
1298
1413
  var getNumberLength = function(n) {
1299
1414
  return n === void 0 || isNaN(n) ? 0 : n.toString().length;
1300
1415
  };
1301
- var isNotEmpty = function(val) {
1302
- return typeof val === "string" ? val.trim() !== "" : val !== null && val !== void 0;
1303
- };
1304
- var isEmpty = function(val) {
1305
- return val === null || val === void 0;
1306
- };
1307
- var isStringNotEmpty = function(value) {
1308
- return (value !== null && value !== void 0 ? value : "").trim() !== "";
1309
- };
1310
1416
  var trimStringToMaxLength = function(val, maxLength) {
1311
1417
  return val.length > maxLength ? val.slice(0, maxLength) : val;
1312
1418
  };
@@ -1314,191 +1420,22 @@ var addDataAttributes = function() {
1314
1420
  var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1315
1421
  return Object.fromEntries(Object.entries(data).map(function(param) {
1316
1422
  var _param = _sliced_to_array$o(param, 2), key = _param[0], value = _param[1];
1317
- return isNotEmpty(value) ? [
1423
+ return isString(value) && isStringNotEmpty$1(value) || isNotEmpty$1(value) ? [
1318
1424
  "data-".concat(transformToKebab(key)),
1319
1425
  value
1320
1426
  ] : [];
1321
1427
  }));
1322
1428
  };
1323
- var addDataTestId = function() {
1324
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1325
- args[_key] = arguments[_key];
1326
- }
1327
- var testId = getTestId.apply(void 0, _to_consumable_array$7(args));
1328
- return isNotEmpty(testId) ? {
1329
- "data-testid": testId
1330
- } : void 0;
1331
- };
1332
- var getTestId = function(testId, postfix) {
1333
- if (!isNotEmpty(testId)) {
1334
- return void 0;
1335
- }
1336
- return isNotEmpty(postfix) ? "".concat(testId, "-").concat(postfix) : testId;
1337
- };
1338
- var getSelectKeyHandler = function(cb) {
1339
- return function(e) {
1340
- if (e.code === "Enter" || e.code === "NumpadEnter") {
1341
- cb(e);
1342
- }
1343
- };
1344
- };
1345
- var addClickHandler = function(cb) {
1346
- var hasAction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
1347
- return hasAction && isNotEmpty(cb) ? {
1348
- tabIndex: 0,
1349
- onClick: cb,
1350
- onKeyDown: getSelectKeyHandler(cb)
1351
- } : {
1352
- tabIndex: -1
1353
- };
1354
- };
1355
- var createFilter = function(getter, compareFn) {
1356
- return function(items, query) {
1357
- return items.filter(function(item) {
1358
- var possibleValues = getter(item).reduce(function(acc, cur) {
1359
- return _to_consumable_array$7(acc).concat(_to_consumable_array$7(isStringNotEmpty(cur) ? [
1360
- cur.toLowerCase()
1361
- ] : []));
1362
- }, []);
1363
- var queryString = query.toLowerCase().trim();
1364
- return possibleValues.some(function(v) {
1365
- return (compareFn !== null && compareFn !== void 0 ? compareFn : function() {
1366
- return v === null || v === void 0 ? void 0 : v.includes(queryString);
1367
- })(v, queryString);
1368
- });
1369
- });
1370
- };
1371
- };
1372
- var minWidthModifier = {
1373
- name: "minWidth",
1374
- enabled: true,
1375
- phase: "beforeWrite",
1376
- requires: [
1377
- "computeStyles"
1378
- ],
1379
- fn: function(param) {
1380
- var state = param.state;
1381
- state.styles.popper.minWidth = "".concat(state.rects.reference.width, "px");
1382
- },
1383
- effect: function(param) {
1384
- var state = param.state;
1385
- state.elements.popper.style.minWidth = "".concat(state.elements.reference.offsetWidth, "px");
1386
- }
1387
- };
1388
- function _array_like_to_array$p(arr, len) {
1389
- if (len == null || len > arr.length)
1390
- len = arr.length;
1391
- for (var i = 0, arr2 = new Array(len); i < len; i++)
1392
- arr2[i] = arr[i];
1393
- return arr2;
1394
- }
1395
- function _array_without_holes$6(arr) {
1396
- if (Array.isArray(arr))
1397
- return _array_like_to_array$p(arr);
1398
- }
1399
- function _iterable_to_array$6(iter) {
1400
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1401
- return Array.from(iter);
1402
- }
1403
- function _non_iterable_spread$6() {
1404
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1405
- }
1406
- function _to_consumable_array$6(arr) {
1407
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$p(arr) || _non_iterable_spread$6();
1408
- }
1409
- function _unsupported_iterable_to_array$p(o, minLen) {
1410
- if (!o)
1411
- return;
1412
- if (typeof o === "string")
1413
- return _array_like_to_array$p(o, minLen);
1414
- var n = Object.prototype.toString.call(o).slice(8, -1);
1415
- if (n === "Object" && o.constructor)
1416
- n = o.constructor.name;
1417
- if (n === "Map" || n === "Set")
1418
- return Array.from(n);
1419
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1420
- return _array_like_to_array$p(o, minLen);
1421
- }
1422
- var findCountryByCode = function(countryCode) {
1423
- var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1424
- return countryCode !== void 0 ? countriesList.find(function(info) {
1425
- return info.countryCode === countryCode;
1426
- }) : void 0;
1427
- };
1428
- var findCountryIndexByCode = function(countryCode) {
1429
- var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1430
- return countryCode !== void 0 ? countriesList.findIndex(function(info) {
1431
- return info.countryCode === countryCode;
1432
- }) : -1;
1433
- };
1434
- var getCountryTextByLocale = function(country, locale2) {
1435
- return locale2.toLowerCase() === "ru" ? country.countryRu : country.countryEn;
1436
- };
1437
- var sortCountriesByLocale = function(countriesList, locale2) {
1438
- return countriesList.sort(function(countryA, countryB) {
1439
- return getCountryTextByLocale(countryA, locale2).localeCompare(getCountryTextByLocale(countryB, locale2));
1440
- });
1441
- };
1442
- var checkSearchStringInCountry = function(country, searchString) {
1443
- var checkValue = searchString.toLowerCase().trim().replace("+", "");
1444
- var possibleValues = [
1445
- country.countryRu,
1446
- country.countryEn
1447
- ].concat(_to_consumable_array$6(country.countryRu.split(" ")), _to_consumable_array$6(country.countryEn.split(" ")), [
1448
- country.dialCode
1449
- ]).map(function(part) {
1450
- return part.toLowerCase();
1451
- });
1452
- return possibleValues.some(function(v) {
1453
- return v.startsWith(checkValue);
1454
- });
1455
- };
1456
- var _phone_dialCode, _phone_phoneNumber;
1457
- var getFullPhone = function(phone) {
1458
- return ((_phone_dialCode = phone === null || phone === void 0 ? void 0 : phone.dialCode) !== null && _phone_dialCode !== void 0 ? _phone_dialCode : "") + ((_phone_phoneNumber = phone === null || phone === void 0 ? void 0 : phone.phoneNumber) !== null && _phone_phoneNumber !== void 0 ? _phone_phoneNumber : "");
1459
- };
1460
- var getCountryCodeFromPhone = function(phoneWithCode) {
1461
- var _phoneInfo_find;
1462
- var countryCode = (_phoneInfo_find = phoneInfo.find(function(info) {
1463
- return info.fullCodes.some(function(code) {
1464
- return phoneWithCode.startsWith(code);
1465
- });
1466
- })) === null || _phoneInfo_find === void 0 ? void 0 : _phoneInfo_find.countryCode;
1467
- if (countryCode === void 0 && isNotEmpty(phoneWithCode)) {
1468
- var _phoneInfo_filter_sort_;
1469
- var _infoA_dialCodePriority, _infoB_dialCodePriority;
1470
- countryCode = (_phoneInfo_filter_sort_ = phoneInfo.filter(function(info) {
1471
- return phoneWithCode.startsWith(info.dialCode);
1472
- }).sort(function(infoA, infoB) {
1473
- return ((_infoA_dialCodePriority = infoA.dialCodePriority) !== null && _infoA_dialCodePriority !== void 0 ? _infoA_dialCodePriority : 1e3) - ((_infoB_dialCodePriority = infoB.dialCodePriority) !== null && _infoB_dialCodePriority !== void 0 ? _infoB_dialCodePriority : 1e3);
1474
- })[0]) === null || _phoneInfo_filter_sort_ === void 0 ? void 0 : _phoneInfo_filter_sort_.countryCode;
1475
- }
1476
- return countryCode;
1477
- };
1478
- var getPhoneObjFromString = function(fullPhone, countryCode) {
1479
- var _findCountryByCode;
1480
- var newCountryCode = countryCode !== null && countryCode !== void 0 ? countryCode : getCountryCodeFromPhone(fullPhone);
1481
- var dialCode = (_findCountryByCode = findCountryByCode(newCountryCode)) === null || _findCountryByCode === void 0 ? void 0 : _findCountryByCode.dialCode;
1482
- var phoneNumber = fullPhone.slice(dialCode === null || dialCode === void 0 ? void 0 : dialCode.length);
1483
- return {
1484
- dialCode,
1485
- phoneNumber,
1486
- countryCode: newCountryCode
1487
- };
1488
- };
1489
- var DEFAULT_PHONE_MASK = "+ 9 999 999 999 999 99";
1490
- var getPhoneMask = function(countryCode) {
1491
- var mask = DEFAULT_PHONE_MASK;
1492
- if (countryCode !== void 0) {
1493
- var countrySettings = findCountryByCode(countryCode);
1494
- if (countrySettings !== void 0) {
1495
- var dialCodeLength = countrySettings.dialCode.length;
1496
- var _countrySettings_phoneMask;
1497
- var areaAndPhoneMask = (_countrySettings_phoneMask = countrySettings.phoneMask) !== null && _countrySettings_phoneMask !== void 0 ? _countrySettings_phoneMask : mask.substring(2, mask.length - dialCodeLength);
1498
- mask = "+ ".concat("9".repeat(dialCodeLength), " ").concat(areaAndPhoneMask);
1499
- }
1500
- }
1501
- return mask;
1429
+ var isInt = isNumberInteger;
1430
+ var addClickHandler = addClickHandler$1;
1431
+ var addDataTestId = addDataTestId$1;
1432
+ var createFilter = createFilter$1;
1433
+ var getSelectKeyHandler = getSelectKeyHandler$1;
1434
+ var getTestId = getTestId$1;
1435
+ var isStringNotEmpty = isStringNotEmpty$1;
1436
+ var isEmpty = isEmpty$1;
1437
+ var isNotEmpty = function(val) {
1438
+ return isString(val) && isStringNotEmpty(val) || isNotEmpty(val);
1502
1439
  };
1503
1440
  var useIsMounted = function() {
1504
1441
  var isMounted = useRef(false);
@@ -5148,6 +5085,11 @@ var Icon = function(param) {
5148
5085
  })
5149
5086
  }));
5150
5087
  };
5088
+ var renderIcon = function(icon) {
5089
+ return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
5090
+ type: icon
5091
+ }) : icon;
5092
+ };
5151
5093
  var ITEM_HORIZONTAL_PADDING = 16;
5152
5094
  var ICON_SIZE = 20;
5153
5095
  var ICON_GAP = 12;
@@ -5256,7 +5198,7 @@ var List = function(param) {
5256
5198
  var _item_testId;
5257
5199
  return /* @__PURE__ */ jsx("div", _object_spread_props$A(_object_spread$J({
5258
5200
  className: classes.root
5259
- }, addDataTestId(testId), addDataAttributes(data)), {
5201
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
5260
5202
  children: items.map(function(item, idx) {
5261
5203
  var _obj;
5262
5204
  return /* @__PURE__ */ jsxs(Fragment$1, {
@@ -5265,19 +5207,17 @@ var List = function(param) {
5265
5207
  className: classes.spacer
5266
5208
  }),
5267
5209
  /* @__PURE__ */ jsxs("div", _object_spread_props$A(_object_spread$J({
5268
- className: clsx(classes.item, (_obj = {}, _define_property$L(_obj, classes.disabledItem, item.disabled), _define_property$L(_obj, classes.withIconGap, item.withIconGap), _obj))
5269
- }, addDataTestId((_item_testId = item.testId) !== null && _item_testId !== void 0 ? _item_testId : getTestId(testId, "item-".concat(idx))), item.disabled && addDataAttributes({
5270
- disabled: item.disabled
5271
- })), {
5210
+ className: clsx(classes.item, (_obj = {}, _define_property$L(_obj, classes.disabledItem, item.disabled), _define_property$L(_obj, classes.withIconGap, item.withIconGap), _obj)),
5272
5211
  onClick: item.disabled ? void 0 : function() {
5273
5212
  return handleItemClick(item);
5274
- },
5213
+ }
5214
+ }, addDataTestId$1((_item_testId = item.testId) !== null && _item_testId !== void 0 ? _item_testId : getTestId$1(testId, "item-".concat(idx))), item.disabled && addDataAttributes({
5215
+ disabled: item.disabled
5216
+ })), {
5275
5217
  children: [
5276
- isNotEmpty(item.icon) && /* @__PURE__ */ jsx("span", {
5218
+ isReactNodeNotEmpty(item.icon) && /* @__PURE__ */ jsx("span", {
5277
5219
  className: classes.icon,
5278
- children: typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, {
5279
- type: item.icon
5280
- }) : item.icon
5220
+ children: renderIcon(item.icon)
5281
5221
  }),
5282
5222
  /* @__PURE__ */ jsx("span", {
5283
5223
  className: classes.content,
@@ -6119,8 +6059,8 @@ var Button = /* @__PURE__ */ forwardRef(function(param, ref) {
6119
6059
  tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader,
6120
6060
  size
6121
6061
  ]);
6122
- var hasIcon = isNotEmpty(icon);
6123
- var hasChildren = isNotEmpty(children);
6062
+ var hasIcon = isReactNodeNotEmpty(icon);
6063
+ var hasChildren = isReactNodeNotEmpty(children);
6124
6064
  var hasNoAction = isDisabled || isLoading;
6125
6065
  var _obj, _obj1;
6126
6066
  return /* @__PURE__ */ jsxs("button", _object_spread_props$v(_object_spread$E({
@@ -6131,16 +6071,14 @@ var Button = /* @__PURE__ */ forwardRef(function(param, ref) {
6131
6071
  disabled: hasNoAction,
6132
6072
  onClick: !hasNoAction ? onClick : void 0,
6133
6073
  onMouseDown: !hasNoAction ? onMouseDown : void 0
6134
- }, addDataTestId(testId), addDataAttributes(data)), {
6074
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
6135
6075
  children: [
6136
6076
  /* @__PURE__ */ jsxs("span", {
6137
6077
  className: clsx(classes.content, (_obj1 = {}, _define_property$G(_obj1, classes.iconFromRight, hasChildren && hasIcon && iconPosition === "right"), _define_property$G(_obj1, classes.iconFromLeft, hasChildren && hasIcon && iconPosition === "left"), _obj1)),
6138
6078
  children: [
6139
6079
  hasIcon && /* @__PURE__ */ jsx("span", {
6140
6080
  className: classes.icon,
6141
- children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
6142
- type: icon
6143
- }) : icon
6081
+ children: isReactNodeNotEmpty(icon) && renderIcon(icon)
6144
6082
  }),
6145
6083
  hasChildren && /* @__PURE__ */ jsx("span", {
6146
6084
  className: clsx(classes.children, hasIcon && classes.withIcon),
@@ -6350,7 +6288,7 @@ function Checkbox(param) {
6350
6288
  var _obj;
6351
6289
  return /* @__PURE__ */ jsxs("label", _object_spread_props$u(_object_spread$D({
6352
6290
  className: clsx(classes.root, (_obj = {}, _define_property$F(_obj, classes.disabled, isDisabled), _define_property$F(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
6353
- }, addDataTestId(testId), addDataAttributes(data)), {
6291
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
6354
6292
  children: [
6355
6293
  /* @__PURE__ */ jsx("input", _object_spread$D({
6356
6294
  type: "checkbox",
@@ -6360,7 +6298,7 @@ function Checkbox(param) {
6360
6298
  readOnly: isReadonly
6361
6299
  }, hasAction && {
6362
6300
  onChange: onToggle,
6363
- onKeyDown: getSelectKeyHandler(onToggle)
6301
+ onKeyDown: getSelectKeyHandler$1(onToggle)
6364
6302
  })),
6365
6303
  /* @__PURE__ */ jsx("div", {
6366
6304
  className: clsx(classes.check, isSelected && classes.checked),
@@ -6368,7 +6306,7 @@ function Checkbox(param) {
6368
6306
  type: isSemiChecked ? "minus" : "check"
6369
6307
  })
6370
6308
  }),
6371
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
6309
+ isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
6372
6310
  className: classes.children,
6373
6311
  children
6374
6312
  })
@@ -6633,11 +6571,6 @@ var CssBaseline = function(param) {
6633
6571
  className: classes.root
6634
6572
  }, addDataAttributes(data)));
6635
6573
  };
6636
- var renderIcon = function(icon) {
6637
- return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
6638
- type: icon
6639
- }) : icon;
6640
- };
6641
6574
  var PADDING_X$1 = 12;
6642
6575
  var AUTOSIZE_MAX_WIDTH = 480;
6643
6576
  var styles$x = {
@@ -7201,8 +7134,8 @@ var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
7201
7134
  var hasControls = hasClearIcon || iconType !== void 0 || isLoading;
7202
7135
  var hasValue = value !== void 0 && value !== "";
7203
7136
  var hasUnits = units !== void 0 && units !== "";
7204
- var hasLabel = isNotEmpty(label);
7205
- var hasPlaceholder = (!hasLabel || hasFocus && !isReadonly) && isNotEmpty(placeholder);
7137
+ var hasLabel = isStringNotEmpty$1(label);
7138
+ var hasPlaceholder = (!hasLabel || hasFocus && !isReadonly) && isStringNotEmpty$1(placeholder);
7206
7139
  var shouldShowUnits = (hasValue || isFocused && !hasPlaceholder) && hasUnits;
7207
7140
  var _obj;
7208
7141
  var props = _object_spread$A({
@@ -7222,7 +7155,7 @@ var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
7222
7155
  readOnly: isReadonly,
7223
7156
  size: isAutoSizeable ? defaultSize : void 0,
7224
7157
  tabIndex
7225
- }, addDataTestId(testId));
7158
+ }, addDataTestId$1(testId));
7226
7159
  var tweakPreloaderStyles = useTweakStyles(componentStyles, tweakStyles, "tweakPreloader");
7227
7160
  var _obj1, _obj2;
7228
7161
  return /* @__PURE__ */ jsxs("div", {
@@ -7279,7 +7212,7 @@ var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
7279
7212
  type: "close"
7280
7213
  })
7281
7214
  }),
7282
- iconType !== void 0 && /* @__PURE__ */ jsx("div", {
7215
+ isReactNodeNotEmpty(iconType) && /* @__PURE__ */ jsx("div", {
7283
7216
  className: clsx(classes.inputIcon, _define_property$C({}, classes.activeIcon, !isDisabled && onIconClick !== void 0)),
7284
7217
  onClick: !isDisabled ? onIconClick : void 0,
7285
7218
  children: renderIcon(iconType)
@@ -7288,11 +7221,11 @@ var Input = /* @__PURE__ */ forwardRef(function(param, ref) {
7288
7221
  })
7289
7222
  ]
7290
7223
  })),
7291
- isNotEmpty(infoMessage) && /* @__PURE__ */ jsx("div", {
7224
+ isStringNotEmpty$1(infoMessage) && /* @__PURE__ */ jsx("div", {
7292
7225
  className: classes.info,
7293
7226
  children: infoMessage
7294
7227
  }),
7295
- isNotEmpty(errorMessage) && /* @__PURE__ */ jsx("div", {
7228
+ isStringNotEmpty$1(errorMessage) && /* @__PURE__ */ jsx("div", {
7296
7229
  className: clsx(classes.error, classes["error-".concat(errorPosition)]),
7297
7230
  children: errorMessage
7298
7231
  })
@@ -7610,7 +7543,7 @@ var SearchInput = function(_param) {
7610
7543
  var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
7611
7544
  return /* @__PURE__ */ jsxs("div", _object_spread_props$q(_object_spread$y({
7612
7545
  className: classes.root
7613
- }, addDataTestId(testId), addDataAttributes(data)), {
7546
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
7614
7547
  children: [
7615
7548
  /* @__PURE__ */ jsx("div", {
7616
7549
  className: classes.icon,
@@ -7621,7 +7554,7 @@ var SearchInput = function(_param) {
7621
7554
  /* @__PURE__ */ jsx(Input, _object_spread$y({
7622
7555
  isClearable,
7623
7556
  isActive: props.value !== "" && props.value !== void 0,
7624
- testId: getTestId(testId, "input"),
7557
+ testId: getTestId$1(testId, "input"),
7625
7558
  tweakStyles: tweakInputStyles,
7626
7559
  hasFloatingLabel: false,
7627
7560
  label: props.placeholder
@@ -8083,7 +8016,7 @@ function _object_spread_props$p(target, source) {
8083
8016
  }
8084
8017
  var SelectListItem = function(param) {
8085
8018
  var classes = param.classes, index = param.index, isSemiChecked = param.isSemiChecked, isDisabled = param.isDisabled, isActive = param.isActive, children = param.children, isFocused = param.isFocused, onOptionSelect = param.onOptionSelect, onToggleCheckbox = param.onToggleCheckbox;
8086
- var isMultiSelect = isNotEmpty(onToggleCheckbox);
8019
+ var isMultiSelect = isNotEmpty$1(onToggleCheckbox);
8087
8020
  var _obj;
8088
8021
  return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$p(_object_spread$v({
8089
8022
  active: isFocused,
@@ -8130,7 +8063,7 @@ function _define_property$w(obj, key, value) {
8130
8063
  function SelectList(param) {
8131
8064
  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, areAllOptionsSelected = param.areAllOptionsSelected, customListHeader = param.customListHeader, isOptionDisabled = param.isOptionDisabled, allOptionsLabel = param.allOptionsLabel, onOptionSelect = param.onOptionSelect, onToggleCheckbox = param.onToggleCheckbox, convertValueToString = param.convertValueToString, _param_convertValueToReactNode = param.convertValueToReactNode, convertValueToReactNode = _param_convertValueToReactNode === void 0 ? convertValueToString : _param_convertValueToReactNode, convertValueToId = param.convertValueToId;
8132
8065
  var classes = useTheme("SelectList", styles$s, tweakStyles).classes;
8133
- var isMultiSelect = isNotEmpty(onToggleCheckbox);
8066
+ var isMultiSelect = isNotEmpty$1(onToggleCheckbox);
8134
8067
  var multiSelectValue = activeValue;
8135
8068
  var _multiSelectValue_length;
8136
8069
  var selectedOptionsCount = (_multiSelectValue_length = multiSelectValue === null || multiSelectValue === void 0 ? void 0 : multiSelectValue.length) !== null && _multiSelectValue_length !== void 0 ? _multiSelectValue_length : 0;
@@ -8160,13 +8093,13 @@ function SelectList(param) {
8160
8093
  optionsDisableMap
8161
8094
  ]);
8162
8095
  var isActiveOption = function(item) {
8163
- return isMultiSelect ? activeOptionsIdMap.includes(convertValueToId(item)) : isNotEmpty(activeValue) && convertValueToId(activeValue) === convertValueToId(item);
8096
+ return isMultiSelect ? activeOptionsIdMap.includes(convertValueToId(item)) : isNotEmpty$1(activeValue) && convertValueToId(activeValue) === convertValueToId(item);
8164
8097
  };
8165
8098
  return /* @__PURE__ */ jsxs(ScrollIntoViewIfNeeded, {
8166
8099
  active: shouldScrollToList && !isMultiSelect,
8167
- className: clsx(classes.root, _define_property$w({}, classes.withListHeader, isNotEmpty(customListHeader))),
8100
+ className: clsx(classes.root, _define_property$w({}, classes.withListHeader, isReactNodeNotEmpty(customListHeader))),
8168
8101
  children: [
8169
- isNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
8102
+ isReactNodeNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
8170
8103
  className: classes.listHeader,
8171
8104
  children: customListHeader
8172
8105
  }),
@@ -8178,7 +8111,7 @@ function SelectList(param) {
8178
8111
  children: loadingLabel
8179
8112
  }) : /* @__PURE__ */ jsxs(Fragment, {
8180
8113
  children: [
8181
- isNotEmpty(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
8114
+ isStringNotEmpty$1(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
8182
8115
  active: focusedIndex === DEFAULT_OPTION_INDEX,
8183
8116
  options: {
8184
8117
  block: "nearest"
@@ -8189,7 +8122,7 @@ function SelectList(param) {
8189
8122
  },
8190
8123
  children: defaultOptionLabel
8191
8124
  }),
8192
- isNotEmpty(allOptionsLabel) && /* @__PURE__ */ jsx(SelectListItem, {
8125
+ isStringNotEmpty$1(allOptionsLabel) && /* @__PURE__ */ jsx(SelectListItem, {
8193
8126
  classes,
8194
8127
  index: ALL_OPTION_INDEX,
8195
8128
  isSemiChecked: selectedOptionsCount > 0 && !areAllOptionsSelected,
@@ -8237,7 +8170,7 @@ var defaultCompareFunction = function(v1, v2) {
8237
8170
  };
8238
8171
  var getDefaultConvertToIdFunction = function(convertValueToString) {
8239
8172
  return function(value) {
8240
- return isNotEmpty(value === null || value === void 0 ? void 0 : value.id) ? String(value.id) : convertValueToString(value);
8173
+ return isNotEmpty$1(value === null || value === void 0 ? void 0 : value.id) ? String(value.id) : convertValueToString(value);
8241
8174
  };
8242
8175
  };
8243
8176
  var isMultiSelectValue = function(props, _value) {
@@ -8566,7 +8499,7 @@ function Select(props) {
8566
8499
  var isMounted = useIsMounted();
8567
8500
  var _useState = _sliced_to_array$j(useState(false), 2), isListOpen = _useState[0], setIsListOpen = _useState[1];
8568
8501
  var _useState1 = _sliced_to_array$j(useState(false), 2), areOptionsLoading = _useState1[0], setAreOptionsLoading = _useState1[1];
8569
- var hasDefaultOption = isStringNotEmpty(defaultOptionLabel);
8502
+ var hasDefaultOption = isStringNotEmpty$1(defaultOptionLabel);
8570
8503
  var _useState2 = _sliced_to_array$j(useState(DEFAULT_OPTION_INDEX), 2), focusedListCellIndex = _useState2[0], setFocusedListCellIndex = _useState2[1];
8571
8504
  var _useState3 = _sliced_to_array$j(useState(""), 2), searchValue = _useState3[0], setSearchValue = _useState3[1];
8572
8505
  var _useState4 = _sliced_to_array$j(useState(true), 2), shouldShowDefaultOption = _useState4[0], setShouldShowDefaultOption = _useState4[1];
@@ -8577,13 +8510,13 @@ function Select(props) {
8577
8510
  var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
8578
8511
  var isMultiSelect = isMultiSelectValue(props);
8579
8512
  var strValue = isMultiSelect ? value === null || value === void 0 ? void 0 : value[0] : value;
8580
- var shouldShowAllOption = isMultiSelect && isNotEmpty(allOptionsLabel) && searchValue === "";
8513
+ var shouldShowAllOption = isMultiSelect && isStringNotEmpty$1(allOptionsLabel) && searchValue === "";
8581
8514
  var filteredOptions = useMemo(function() {
8582
8515
  if (optionsMode !== "search") {
8583
8516
  return options;
8584
8517
  }
8585
8518
  var _convertValueToString;
8586
- var filter = optionsFilter !== null && optionsFilter !== void 0 ? optionsFilter : createFilter(function(option) {
8519
+ var filter = optionsFilter !== null && optionsFilter !== void 0 ? optionsFilter : createFilter$1(function(option) {
8587
8520
  return [
8588
8521
  (_convertValueToString = convertValueToString(option)) !== null && _convertValueToString !== void 0 ? _convertValueToString : ""
8589
8522
  ];
@@ -8605,7 +8538,7 @@ function Select(props) {
8605
8538
  isOptionDisabled
8606
8539
  ]);
8607
8540
  var areAllOptionsSelected = isMultiSelect && (value === null || value === void 0 ? void 0 : value.length) === availableOptions.length;
8608
- var shouldShowMultiSelectCounter = isMultiSelect && isNotEmpty(value) && value.length > 1 && !areAllOptionsSelected;
8541
+ var shouldShowMultiSelectCounter = isMultiSelect && isNotEmpty$1(value) && value.length > 1 && !areAllOptionsSelected;
8609
8542
  var optionsIndexesForNavigation = useMemo(function() {
8610
8543
  var result = [];
8611
8544
  if (shouldShowDefaultOption && hasDefaultOption) {
@@ -8623,8 +8556,8 @@ function Select(props) {
8623
8556
  }, [
8624
8557
  filteredOptions
8625
8558
  ]);
8626
- var stringValue = isNotEmpty(strValue) ? convertValueToString(strValue) : void 0;
8627
- var showedStringValue = areAllOptionsSelected && isNotEmpty(allOptionsLabel) ? allOptionsLabel : stringValue;
8559
+ var stringValue = isNotEmpty$1(strValue) ? convertValueToString(strValue) : void 0;
8560
+ var showedStringValue = areAllOptionsSelected && isNotEmpty$1(allOptionsLabel) ? allOptionsLabel : stringValue;
8628
8561
  var convertToId = useCallback(function(v) {
8629
8562
  return (convertValueToId !== null && convertValueToId !== void 0 ? convertValueToId : getDefaultConvertToIdFunction(convertValueToString))(v);
8630
8563
  }, [
@@ -8656,7 +8589,7 @@ function Select(props) {
8656
8589
  handleListClose(event);
8657
8590
  return;
8658
8591
  }
8659
- if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current) || !isNotEmpty(inputWrapper.current)) {
8592
+ if (!isNotEmpty$1(event.relatedTarget) || !isNotEmpty$1(list.current) || !isNotEmpty$1(inputWrapper.current)) {
8660
8593
  return;
8661
8594
  }
8662
8595
  var isActionInsideSelect = hasExactParent(event.relatedTarget, list.current) || hasExactParent(event.relatedTarget, inputWrapper.current);
@@ -8866,7 +8799,7 @@ function Select(props) {
8866
8799
  useEffect(function() {
8867
8800
  var _optionsIndexesForNavigation_find;
8868
8801
  setFocusedListCellIndex((_optionsIndexesForNavigation_find = optionsIndexesForNavigation.find(function(index) {
8869
- return isNotEmpty(strValue) && isNotEmpty(filteredOptions[index]) && convertToId(filteredOptions[index]) === convertToId(strValue);
8802
+ return isNotEmpty$1(strValue) && isNotEmpty$1(filteredOptions[index]) && convertToId(filteredOptions[index]) === convertToId(strValue);
8870
8803
  })) !== null && _optionsIndexesForNavigation_find !== void 0 ? _optionsIndexesForNavigation_find : optionsIndexesForNavigation[0]);
8871
8804
  }, [
8872
8805
  strValue,
@@ -8905,7 +8838,7 @@ function Select(props) {
8905
8838
  isLoading: inputProps.isLoading,
8906
8839
  loadingLabel,
8907
8840
  tweakStyles: tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakSelectList,
8908
- testId: getTestId(testId, "list"),
8841
+ testId: getTestId$1(testId, "list"),
8909
8842
  shouldScrollToList: shouldScrollToList && !shouldUsePopper && !shouldHideOnScroll,
8910
8843
  isOptionDisabled,
8911
8844
  convertValueToString,
@@ -8915,7 +8848,7 @@ function Select(props) {
8915
8848
  onToggleCheckbox: isMultiSelect ? handleToggleOptionCheckbox : void 0
8916
8849
  })
8917
8850
  }));
8918
- var multiSelectCounterWithIcon = shouldShowMultiSelectCounter || isNotEmpty(iconType) ? /* @__PURE__ */ jsxs(Fragment, {
8851
+ var multiSelectCounterWithIcon = shouldShowMultiSelectCounter || isNotEmpty$1(iconType) ? /* @__PURE__ */ jsxs(Fragment, {
8919
8852
  children: [
8920
8853
  shouldShowMultiSelectCounter && /* @__PURE__ */ jsxs("div", {
8921
8854
  className: classes.counter,
@@ -8925,7 +8858,7 @@ function Select(props) {
8925
8858
  ")"
8926
8859
  ]
8927
8860
  }),
8928
- isNotEmpty(iconType) && /* @__PURE__ */ jsx("div", {
8861
+ isNotEmpty$1(iconType) && /* @__PURE__ */ jsx("div", {
8929
8862
  className: classes.icon,
8930
8863
  children: renderIcon(iconType)
8931
8864
  })
@@ -8960,9 +8893,7 @@ function Select(props) {
8960
8893
  },
8961
8894
  onClick: onArrowClick,
8962
8895
  className: clsx(classes.arrow, isOpen && classes.activeArrow),
8963
- children: /* @__PURE__ */ jsx(Icon, {
8964
- type: dropdownIcon
8965
- })
8896
+ children: renderIcon(dropdownIcon)
8966
8897
  })
8967
8898
  ]
8968
8899
  }),
@@ -9128,17 +9059,17 @@ var DatePickerHeader = function(param) {
9128
9059
  var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9129
9060
  var getDateFormatter = function(dateFormat) {
9130
9061
  return function(date) {
9131
- return isNotEmpty(date) ? format$1(date, dateFormat) : "";
9062
+ return isNotEmpty$1(date) ? format$1(date, dateFormat) : "";
9132
9063
  };
9133
9064
  };
9134
9065
  var getDateValueParser = function(dateFormat) {
9135
9066
  return function(value) {
9136
9067
  var inputValue = value === EMPTY_DATE_INPUT_VALUE ? "" : value;
9137
- return isStringNotEmpty(inputValue) ? parse(value, dateFormat, new Date()) : null;
9068
+ return isStringNotEmpty$1(inputValue) ? parse(value, dateFormat, new Date()) : null;
9138
9069
  };
9139
9070
  };
9140
9071
  var areDatesEquals = function(date1, date2) {
9141
- return isEmpty(date1) && isEmpty(date2) || isNotEmpty(date1) && isNotEmpty(date2) && isSameDay(date1, date2);
9072
+ return isEmpty$1(date1) && isEmpty$1(date2) || isNotEmpty$1(date1) && isNotEmpty$1(date2) && isSameDay(date1, date2);
9142
9073
  };
9143
9074
  function _array_like_to_array$i(arr, len) {
9144
9075
  if (len == null || len > arr.length)
@@ -9358,7 +9289,7 @@ var DatePicker = /* @__PURE__ */ forwardRef(function(_param, ref) {
9358
9289
  var _useState3 = _sliced_to_array$i(useState(formatDate(startDate)), 2), startDateValue = _useState3[0], setStartDateValue = _useState3[1];
9359
9290
  var _useState4 = _sliced_to_array$i(useState(endDate), 2), end2 = _useState4[0], setEnd = _useState4[1];
9360
9291
  var _useState5 = _sliced_to_array$i(useState(formatDate(endDate)), 2), endDateValue = _useState5[0], setEndDateValue = _useState5[1];
9361
- var hasDateInputValue = isRange ? isStringNotEmpty(startDateValue) || isStringNotEmpty(endDateValue) : isStringNotEmpty(dateValue);
9292
+ var hasDateInputValue = isRange ? isStringNotEmpty$1(startDateValue) || isStringNotEmpty$1(endDateValue) : isStringNotEmpty$1(dateValue);
9362
9293
  var dateInputProps = _object_spread$t(_object_spread_props$n(_object_spread$t({}, inputProps), {
9363
9294
  isRange,
9364
9295
  isDisabled,
@@ -9376,7 +9307,7 @@ var DatePicker = /* @__PURE__ */ forwardRef(function(_param, ref) {
9376
9307
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(value, event);
9377
9308
  };
9378
9309
  var isDateInRange = function(date) {
9379
- return (isEmpty(minDate) || isAfter(date, minDate)) && (isEmpty(maxDate) || isBefore(date, maxDate));
9310
+ return (isEmpty$1(minDate) || isAfter(date, minDate)) && (isEmpty$1(maxDate) || isBefore(date, maxDate));
9380
9311
  };
9381
9312
  var handleChangeRange = function(value, event) {
9382
9313
  if (allowSameDay || !areDatesEquals(value === null || value === void 0 ? void 0 : value[0], startDate) || !areDatesEquals(value === null || value === void 0 ? void 0 : value[1], endDate)) {
@@ -9392,13 +9323,13 @@ var DatePicker = /* @__PURE__ */ forwardRef(function(_param, ref) {
9392
9323
  var newStart = parseDateValue(newStartDateValue);
9393
9324
  var newEndDateValue = value.slice(13);
9394
9325
  var newEnd = parseDateValue(newEndDateValue);
9395
- if (isNotEmpty(newStart) && !isValid(newStart) || isNotEmpty(newStart) && !isDateInRange(newStart)) {
9326
+ if (isNotEmpty$1(newStart) && !isValid(newStart) || isNotEmpty$1(newStart) && !isDateInRange(newStart)) {
9396
9327
  newStart = start2;
9397
9328
  }
9398
- if (isNotEmpty(newEnd) && !isValid(newEnd) || isNotEmpty(newEnd) && !isDateInRange(newEnd)) {
9329
+ if (isNotEmpty$1(newEnd) && !isValid(newEnd) || isNotEmpty$1(newEnd) && !isDateInRange(newEnd)) {
9399
9330
  newEnd = end2;
9400
9331
  }
9401
- if (isEmpty(newStart) && isValid(newEnd) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9332
+ if (isEmpty$1(newStart) && isValid(newEnd) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9402
9333
  isValid(newStart) && isValid(newEnd) && isAfter(newStart, newEnd)) {
9403
9334
  newStart = newEnd;
9404
9335
  newEnd = null;
@@ -9730,7 +9661,7 @@ var getNewCaretPosition = function(defaultPosition, oldValue, newValue, isDelete
9730
9661
  };
9731
9662
  var formatNumberWithDefault = function(value, defaultValue) {
9732
9663
  var val = formatNumber(value);
9733
- return isNotEmpty(val) ? val : formatNumber(defaultValue);
9664
+ return isStringNotEmpty$1(val) ? val : formatNumber(defaultValue);
9734
9665
  };
9735
9666
  var constructRegExp = function(param) {
9736
9667
  var canBeFloat = param.canBeFloat, canBeNegative = param.canBeNegative, intPartPrecision = param.intPartPrecision, precision = param.precision;
@@ -10009,7 +9940,7 @@ var NumberInput = /* @__PURE__ */ forwardRef(function(_param, ref) {
10009
9940
  setIsDeleteForwardAction(event.key === "Delete");
10010
9941
  };
10011
9942
  var setShowedValueWithDefault = function(v) {
10012
- setShowedValue(isNotEmpty(v) ? v : formatNumber(defaultValue));
9943
+ setShowedValue(isStringNotEmpty$1(v) ? v : formatNumber(defaultValue));
10013
9944
  };
10014
9945
  var handleChange = function() {
10015
9946
  var _ref = _async_to_generator$3(function(inputValue, event) {
@@ -11789,7 +11720,7 @@ function FilterSelect(param) {
11789
11720
  var _useState4 = _sliced_to_array$e(useState(false), 2), isLoading = _useState4[0], setIsLoading = _useState4[1];
11790
11721
  var _useState5 = _sliced_to_array$e(useState(false), 2), isLoadingOptionsOnScroll = _useState5[0], setLoadingOptionsOnScroll = _useState5[1];
11791
11722
  var shouldShowPreloader = isLoading || isLoadingOptionsOnScroll;
11792
- var hasFooter = isNotEmpty(footer);
11723
+ var hasFooter = isReactNodeNotEmpty(footer);
11793
11724
  var handleSearchInputChange = useCallback(function() {
11794
11725
  var _ref = _async_to_generator$1(function(inputValue) {
11795
11726
  var _inputValue_trim, response;
@@ -13661,7 +13592,7 @@ var FilterWithDates = function(param) {
13661
13592
  leftPosition: -20,
13662
13593
  topPosition,
13663
13594
  border: "bottom",
13664
- testId: getTestId(testId, "from"),
13595
+ testId: getTestId$1(testId, "from"),
13665
13596
  isClearable
13666
13597
  }, startPickerProps))
13667
13598
  }),
@@ -13677,7 +13608,7 @@ var FilterWithDates = function(param) {
13677
13608
  topPosition,
13678
13609
  leftPosition: -170,
13679
13610
  border: "bottom",
13680
- testId: getTestId(testId, "to"),
13611
+ testId: getTestId$1(testId, "to"),
13681
13612
  isClearable
13682
13613
  }, endPickerProps))
13683
13614
  })
@@ -13691,7 +13622,7 @@ var FilterWithDates = function(param) {
13691
13622
  onClick: handleClear,
13692
13623
  size: "s",
13693
13624
  view: "text",
13694
- testId: getTestId(testId, "clear-button"),
13625
+ testId: getTestId$1(testId, "clear-button"),
13695
13626
  isFullWidth: true,
13696
13627
  tweakStyles: tweakClearButtonStyles,
13697
13628
  children: translates.clear
@@ -21947,7 +21878,7 @@ var IncrementInput = function(_param) {
21947
21878
  "data",
21948
21879
  "tweakStyles"
21949
21880
  ]);
21950
- if (!isInt(step)) {
21881
+ if (!isNumberInteger(step)) {
21951
21882
  console.error("Параметр step должен быть целым числом");
21952
21883
  }
21953
21884
  var _useTheme = useTheme("IncrementInput", styles$e, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
@@ -22432,7 +22363,7 @@ var Modal = function(param) {
22432
22363
  style: {
22433
22364
  zIndex
22434
22365
  }
22435
- }, addDataTestId(testId), addDataAttributes(data)), {
22366
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
22436
22367
  children: /* @__PURE__ */ jsx("div", {
22437
22368
  ref: overlay,
22438
22369
  className: clsx(classes.innerOverlay, classes["position-".concat(position)]),
@@ -22444,16 +22375,16 @@ var Modal = function(param) {
22444
22375
  hasCloseButton && /* @__PURE__ */ jsx("div", {
22445
22376
  className: classes.close,
22446
22377
  children: /* @__PURE__ */ jsx(CloseButton, {
22447
- testId: getTestId(testId, "close-button"),
22378
+ testId: getTestId$1(testId, "close-button"),
22448
22379
  tweakStyles: tweakCloseButtonStyles,
22449
22380
  onClose
22450
22381
  })
22451
22382
  }),
22452
- isNotEmpty(title) && /* @__PURE__ */ jsx("h3", {
22383
+ isReactNodeNotEmpty(title) && /* @__PURE__ */ jsx("h3", {
22453
22384
  className: clsx(classes.title, _define_property$d({}, classes.titleWithCloseButton, hasCloseButton)),
22454
22385
  children: title
22455
22386
  }),
22456
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
22387
+ isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
22457
22388
  className: classes.content,
22458
22389
  children
22459
22390
  }),
@@ -22665,9 +22596,9 @@ var MoreMenu = function(param) {
22665
22596
  children: [
22666
22597
  /* @__PURE__ */ jsx("button", _object_spread_props$9(_object_spread$b({
22667
22598
  ref: button,
22668
- className: clsx(classes.button, (_obj = {}, _define_property$c(_obj, classes.hasCircle, hasDefaultStateBackground), _define_property$c(_obj, classes.disabled, isButtonDisabled), _define_property$c(_obj, classes.active, isMenuShown), _obj))
22669
- }, addDataTestId(testId), addDataAttributes(data)), {
22670
- onClick: !isButtonDisabled ? toggleMenu : void 0,
22599
+ className: clsx(classes.button, (_obj = {}, _define_property$c(_obj, classes.hasCircle, hasDefaultStateBackground), _define_property$c(_obj, classes.disabled, isButtonDisabled), _define_property$c(_obj, classes.active, isMenuShown), _obj)),
22600
+ onClick: !isButtonDisabled ? toggleMenu : void 0
22601
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
22671
22602
  children: /* @__PURE__ */ jsx("div", {
22672
22603
  className: classes.icon,
22673
22604
  children: /* @__PURE__ */ jsx(Icon, {
@@ -22680,7 +22611,7 @@ var MoreMenu = function(param) {
22680
22611
  ref: list,
22681
22612
  children: /* @__PURE__ */ jsx(List, {
22682
22613
  items,
22683
- testId: getTestId(testId, "list"),
22614
+ testId: getTestId$1(testId, "list"),
22684
22615
  tweakStyles: tweakListStyles,
22685
22616
  onClick: handleCloseMenu
22686
22617
  })
@@ -23026,13 +22957,12 @@ var Notification = function(param) {
23026
22957
  var classes = useTheme("Notification", styles$9, tweakStyles, {
23027
22958
  type
23028
22959
  }).classes;
23029
- var hasText = isNotEmpty(text);
23030
- var hasTitle = isNotEmpty(title);
23031
- var hasTestId = isNotEmpty(testId);
22960
+ var hasText = isStringNotEmpty$1(text);
22961
+ var hasTitle = isStringNotEmpty$1(title);
23032
22962
  var _obj;
23033
22963
  return /* @__PURE__ */ jsxs("div", _object_spread_props$8(_object_spread$a({
23034
22964
  className: clsx(classes.root, classes[size], (_obj = {}, _define_property$b(_obj, classes.inline, !isFullWidth), _define_property$b(_obj, classes.withTitle, hasTitle), _define_property$b(_obj, classes.withText, hasText), _obj))
23035
- }, addDataTestId(testId), addDataAttributes(data)), {
22965
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
23036
22966
  children: [
23037
22967
  /* @__PURE__ */ jsx("div", {
23038
22968
  className: classes.icon,
@@ -23043,17 +22973,17 @@ var Notification = function(param) {
23043
22973
  /* @__PURE__ */ jsxs("div", {
23044
22974
  className: classes.body,
23045
22975
  children: [
23046
- hasTitle && /* @__PURE__ */ jsx("span", {
23047
- className: classes.title,
23048
- "data-testid": hasTestId ? "".concat(testId, "-title") : void 0,
22976
+ hasTitle && /* @__PURE__ */ jsx("span", _object_spread_props$8(_object_spread$a({
22977
+ className: classes.title
22978
+ }, addDataTestId$1(testId, "title")), {
23049
22979
  children: title
23050
- }),
23051
- hasText && /* @__PURE__ */ jsx("span", {
23052
- className: classes.text,
23053
- "data-testid": hasTestId ? "".concat(testId, "-text") : void 0,
22980
+ })),
22981
+ hasText && /* @__PURE__ */ jsx("span", _object_spread_props$8(_object_spread$a({
22982
+ className: classes.text
22983
+ }, addDataTestId$1(testId, "text")), {
23054
22984
  children: text
23055
- }),
23056
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
22985
+ })),
22986
+ isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
23057
22987
  className: classes.content,
23058
22988
  children
23059
22989
  })
@@ -26744,7 +26674,7 @@ function RadioButton(param) {
26744
26674
  },
26745
26675
  className: clsx(classes.input, (_obj = {}, _define_property$6(_obj, classes.isDisabled, isDisabled), _define_property$6(_obj, classes.isInvalid, isInvalid), _obj))
26746
26676
  }),
26747
- isNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26677
+ isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26748
26678
  className: classes.content,
26749
26679
  children
26750
26680
  })
@@ -26875,7 +26805,7 @@ var Switch = function(param) {
26875
26805
  var _obj;
26876
26806
  return /* @__PURE__ */ jsxs("label", _object_spread_props$5(_object_spread$5({
26877
26807
  className: clsx(classes.root, classes[color], (_obj = {}, _define_property$5(_obj, classes.disabled, isDisabled), _define_property$5(_obj, classes.checked, isChecked), _define_property$5(_obj, classes.invalid, isInvalid), _obj))
26878
- }, addDataTestId(testId), addDataAttributes(data)), {
26808
+ }, addDataTestId$1(testId), addDataAttributes(data)), {
26879
26809
  children: [
26880
26810
  /* @__PURE__ */ jsx("span", {
26881
26811
  className: classes.switch,
@@ -26886,9 +26816,9 @@ var Switch = function(param) {
26886
26816
  onChange: isDisabled ? void 0 : handleChange,
26887
26817
  checked: isChecked,
26888
26818
  disabled: isDisabled
26889
- }, addDataTestId(testId, "input")))
26819
+ }, addDataTestId$1(testId, "input")))
26890
26820
  }),
26891
- isNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26821
+ isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26892
26822
  className: clsx(classes.label, classes[labelPosition === "left" ? "labelLeft" : "labelRight"]),
26893
26823
  children
26894
26824
  })
@@ -27982,21 +27912,21 @@ var Toaster = function(param) {
27982
27912
  }),
27983
27913
  /* @__PURE__ */ jsxs("div", {
27984
27914
  children: [
27985
- isNotEmpty(title) && /* @__PURE__ */ jsx("div", {
27915
+ isStringNotEmpty$1(title) && /* @__PURE__ */ jsx("div", {
27986
27916
  className: classes.title,
27987
27917
  children: title
27988
27918
  }),
27989
- isNotEmpty(text) && /* @__PURE__ */ jsx("div", {
27919
+ isStringNotEmpty$1(text) && /* @__PURE__ */ jsx("div", {
27990
27920
  className: classes.text,
27991
27921
  children: text
27992
27922
  }),
27993
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
27923
+ isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
27994
27924
  className: classes.content,
27995
27925
  children
27996
27926
  })
27997
27927
  ]
27998
27928
  }),
27999
- hasCloseButton && onClose !== void 0 && /* @__PURE__ */ jsx("div", {
27929
+ hasCloseButton && isNotEmpty$1(onClose) && /* @__PURE__ */ jsx("div", {
28000
27930
  className: classes.close,
28001
27931
  children: /* @__PURE__ */ jsx(CloseButton, {
28002
27932
  onClose,