@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,6 +1,6 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-transition-group"), require("clsx"), require("hex-to-rgba"), require("react-jss"), require("react-input-mask"), require("react-datepicker"), require("react-overlays"), require("date-fns"), require("ts-debounce"), require("country-flag-icons"), require("react-remove-scroll"), require("scroll-into-view-if-needed")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-transition-group", "clsx", "hex-to-rgba", "react-jss", "react-input-mask", "react-datepicker", "react-overlays", "date-fns", "ts-debounce", "country-flag-icons", "react-remove-scroll", "scroll-into-view-if-needed"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.TrueReactKitUiKit = {}, global2.React, global2.reactTransitionGroup, global2.clsx, global2.hexToRgba, global2.reactJss, global2.InputMask, global2.ReactDatePicker, global2.reactOverlays, global2.dateFns, global2.tsDebounce, global2.countryFlagIcons, global2.reactRemoveScroll, global2.scrollIntoViewIfNeeded));
3
- })(this, function(exports2, React, reactTransitionGroup, clsx, hexToRgba, reactJss, InputMask, ReactDatePicker, reactOverlays, dateFns, tsDebounce, countryFlagIcons, reactRemoveScroll, scrollIntoViewIfNeeded) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-transition-group"), require("clsx"), require("@true-engineering/true-react-platform-helpers"), require("react-jss"), require("react-input-mask"), require("hex-to-rgba"), require("react-datepicker"), require("react-overlays"), require("date-fns"), require("ts-debounce"), require("country-flag-icons"), require("react-remove-scroll"), require("scroll-into-view-if-needed")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-transition-group", "clsx", "@true-engineering/true-react-platform-helpers", "react-jss", "react-input-mask", "hex-to-rgba", "react-datepicker", "react-overlays", "date-fns", "ts-debounce", "country-flag-icons", "react-remove-scroll", "scroll-into-view-if-needed"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.TrueReactKitUiKit = {}, global2.React, global2.reactTransitionGroup, global2.clsx, global2.trueReactPlatformHelpers, global2.reactJss, global2.InputMask, global2.hexToRgba, global2.ReactDatePicker, global2.reactOverlays, global2.dateFns, global2.tsDebounce, global2.countryFlagIcons, global2.reactRemoveScroll, global2.scrollIntoViewIfNeeded));
3
+ })(this, function(exports2, React, reactTransitionGroup, clsx, trueReactPlatformHelpers, reactJss, InputMask, hexToRgba, ReactDatePicker, reactOverlays, dateFns, tsDebounce, countryFlagIcons, reactRemoveScroll, scrollIntoViewIfNeeded) {
4
4
  "use strict";
5
5
  var colors = {
6
6
  FONT_MAIN: "#222a37",
@@ -1099,7 +1099,22 @@
1099
1099
  const Fragment = jsxRuntime.exports.Fragment;
1100
1100
  const jsx = jsxRuntime.exports.jsx;
1101
1101
  const jsxs = jsxRuntime.exports.jsxs;
1102
- var rgba = hexToRgba;
1102
+ var minWidthModifier = {
1103
+ name: "minWidth",
1104
+ enabled: true,
1105
+ phase: "beforeWrite",
1106
+ requires: [
1107
+ "computeStyles"
1108
+ ],
1109
+ fn: function(param) {
1110
+ var state = param.state;
1111
+ state.styles.popper.minWidth = "".concat(state.rects.reference.width, "px");
1112
+ },
1113
+ effect: function(param) {
1114
+ var state = param.state;
1115
+ state.elements.popper.style.minWidth = "".concat(state.elements.reference.offsetWidth, "px");
1116
+ }
1117
+ };
1103
1118
  function _array_like_to_array$q(arr, len) {
1104
1119
  if (len == null || len > arr.length)
1105
1120
  len = arr.length;
@@ -1107,18 +1122,125 @@
1107
1122
  arr2[i] = arr[i];
1108
1123
  return arr2;
1109
1124
  }
1110
- function _array_with_holes$o(arr) {
1111
- if (Array.isArray(arr))
1112
- return arr;
1113
- }
1114
- function _array_without_holes$7(arr) {
1125
+ function _array_without_holes$6(arr) {
1115
1126
  if (Array.isArray(arr))
1116
1127
  return _array_like_to_array$q(arr);
1117
1128
  }
1118
- function _iterable_to_array$7(iter) {
1129
+ function _iterable_to_array$6(iter) {
1119
1130
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1120
1131
  return Array.from(iter);
1121
1132
  }
1133
+ function _non_iterable_spread$6() {
1134
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1135
+ }
1136
+ function _to_consumable_array$6(arr) {
1137
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$6();
1138
+ }
1139
+ function _unsupported_iterable_to_array$q(o, minLen) {
1140
+ if (!o)
1141
+ return;
1142
+ if (typeof o === "string")
1143
+ return _array_like_to_array$q(o, minLen);
1144
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1145
+ if (n === "Object" && o.constructor)
1146
+ n = o.constructor.name;
1147
+ if (n === "Map" || n === "Set")
1148
+ return Array.from(n);
1149
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1150
+ return _array_like_to_array$q(o, minLen);
1151
+ }
1152
+ var findCountryByCode = function(countryCode) {
1153
+ var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1154
+ return trueReactPlatformHelpers.isNotEmpty(countryCode) ? countriesList.find(function(info) {
1155
+ return info.countryCode === countryCode;
1156
+ }) : void 0;
1157
+ };
1158
+ var findCountryIndexByCode = function(countryCode) {
1159
+ var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1160
+ return trueReactPlatformHelpers.isNotEmpty(countryCode) ? countriesList.findIndex(function(info) {
1161
+ return info.countryCode === countryCode;
1162
+ }) : -1;
1163
+ };
1164
+ var getCountryTextByLocale = function(country, locale2) {
1165
+ return locale2.toLowerCase() === "ru" ? country.countryRu : country.countryEn;
1166
+ };
1167
+ var sortCountriesByLocale = function(countriesList, locale2) {
1168
+ return countriesList.sort(function(countryA, countryB) {
1169
+ return getCountryTextByLocale(countryA, locale2).localeCompare(getCountryTextByLocale(countryB, locale2));
1170
+ });
1171
+ };
1172
+ var checkSearchStringInCountry = function(country, searchString) {
1173
+ var checkValue = searchString.toLowerCase().trim().replace("+", "");
1174
+ var possibleValues = [
1175
+ country.countryRu,
1176
+ country.countryEn
1177
+ ].concat(_to_consumable_array$6(country.countryRu.split(" ")), _to_consumable_array$6(country.countryEn.split(" ")), [
1178
+ country.dialCode
1179
+ ]).map(function(part) {
1180
+ return part.toLowerCase();
1181
+ });
1182
+ return possibleValues.some(function(v) {
1183
+ return v.startsWith(checkValue);
1184
+ });
1185
+ };
1186
+ var _phone_dialCode, _phone_phoneNumber;
1187
+ var getFullPhone = function(phone) {
1188
+ 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 : "");
1189
+ };
1190
+ var getCountryCodeFromPhone = function(phoneWithCode) {
1191
+ var _phoneInfo_find;
1192
+ var countryCode = (_phoneInfo_find = phoneInfo.find(function(info) {
1193
+ return info.fullCodes.some(function(code) {
1194
+ return phoneWithCode.startsWith(code);
1195
+ });
1196
+ })) === null || _phoneInfo_find === void 0 ? void 0 : _phoneInfo_find.countryCode;
1197
+ if (trueReactPlatformHelpers.isEmpty(countryCode) && trueReactPlatformHelpers.isNotEmpty(phoneWithCode)) {
1198
+ var _phoneInfo_filter_sort_;
1199
+ var _infoA_dialCodePriority, _infoB_dialCodePriority;
1200
+ countryCode = (_phoneInfo_filter_sort_ = phoneInfo.filter(function(info) {
1201
+ return phoneWithCode.startsWith(info.dialCode);
1202
+ }).sort(function(infoA, infoB) {
1203
+ 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);
1204
+ })[0]) === null || _phoneInfo_filter_sort_ === void 0 ? void 0 : _phoneInfo_filter_sort_.countryCode;
1205
+ }
1206
+ return countryCode;
1207
+ };
1208
+ var getPhoneObjFromString = function(fullPhone, countryCode) {
1209
+ var _findCountryByCode;
1210
+ var newCountryCode = countryCode !== null && countryCode !== void 0 ? countryCode : getCountryCodeFromPhone(fullPhone);
1211
+ var dialCode = (_findCountryByCode = findCountryByCode(newCountryCode)) === null || _findCountryByCode === void 0 ? void 0 : _findCountryByCode.dialCode;
1212
+ var phoneNumber = fullPhone.slice(dialCode === null || dialCode === void 0 ? void 0 : dialCode.length);
1213
+ return {
1214
+ dialCode,
1215
+ phoneNumber,
1216
+ countryCode: newCountryCode
1217
+ };
1218
+ };
1219
+ var DEFAULT_PHONE_MASK = "+ 9 999 999 999 999 99";
1220
+ var getPhoneMask = function(countryCode) {
1221
+ var mask = DEFAULT_PHONE_MASK;
1222
+ if (trueReactPlatformHelpers.isNotEmpty(countryCode)) {
1223
+ var countrySettings = findCountryByCode(countryCode);
1224
+ if (countrySettings !== void 0) {
1225
+ var dialCodeLength = countrySettings.dialCode.length;
1226
+ var _countrySettings_phoneMask;
1227
+ var areaAndPhoneMask = (_countrySettings_phoneMask = countrySettings.phoneMask) !== null && _countrySettings_phoneMask !== void 0 ? _countrySettings_phoneMask : mask.substring(2, mask.length - dialCodeLength);
1228
+ mask = "+ ".concat("9".repeat(dialCodeLength), " ").concat(areaAndPhoneMask);
1229
+ }
1230
+ }
1231
+ return mask;
1232
+ };
1233
+ function _array_like_to_array$p(arr, len) {
1234
+ if (len == null || len > arr.length)
1235
+ len = arr.length;
1236
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
1237
+ arr2[i] = arr[i];
1238
+ return arr2;
1239
+ }
1240
+ function _array_with_holes$o(arr) {
1241
+ if (Array.isArray(arr))
1242
+ return arr;
1243
+ }
1122
1244
  function _iterable_to_array_limit$o(arr, i) {
1123
1245
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1124
1246
  if (_i == null)
@@ -1150,28 +1272,23 @@
1150
1272
  function _non_iterable_rest$o() {
1151
1273
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1152
1274
  }
1153
- function _non_iterable_spread$7() {
1154
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1155
- }
1156
1275
  function _sliced_to_array$o(arr, i) {
1157
- return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$o();
1158
- }
1159
- function _to_consumable_array$7(arr) {
1160
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$7();
1276
+ return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$p(arr, i) || _non_iterable_rest$o();
1161
1277
  }
1162
- function _unsupported_iterable_to_array$q(o, minLen) {
1278
+ function _unsupported_iterable_to_array$p(o, minLen) {
1163
1279
  if (!o)
1164
1280
  return;
1165
1281
  if (typeof o === "string")
1166
- return _array_like_to_array$q(o, minLen);
1282
+ return _array_like_to_array$p(o, minLen);
1167
1283
  var n = Object.prototype.toString.call(o).slice(8, -1);
1168
1284
  if (n === "Object" && o.constructor)
1169
1285
  n = o.constructor.name;
1170
1286
  if (n === "Map" || n === "Set")
1171
1287
  return Array.from(n);
1172
1288
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1173
- return _array_like_to_array$q(o, minLen);
1289
+ return _array_like_to_array$p(o, minLen);
1174
1290
  }
1291
+ var rgba = hexToRgba;
1175
1292
  var transformToKebab = function(string) {
1176
1293
  var result = "";
1177
1294
  string.split("").forEach(function(char) {
@@ -1283,21 +1400,9 @@
1283
1400
  var isSpaceChar = function(char) {
1284
1401
  return char !== void 0 && char.match(/\s/) !== null;
1285
1402
  };
1286
- var isInt = function(n) {
1287
- return n % 1 === 0;
1288
- };
1289
1403
  var getNumberLength = function(n) {
1290
1404
  return n === void 0 || isNaN(n) ? 0 : n.toString().length;
1291
1405
  };
1292
- var isNotEmpty = function(val) {
1293
- return typeof val === "string" ? val.trim() !== "" : val !== null && val !== void 0;
1294
- };
1295
- var isEmpty = function(val) {
1296
- return val === null || val === void 0;
1297
- };
1298
- var isStringNotEmpty = function(value) {
1299
- return (value !== null && value !== void 0 ? value : "").trim() !== "";
1300
- };
1301
1406
  var trimStringToMaxLength = function(val, maxLength) {
1302
1407
  return val.length > maxLength ? val.slice(0, maxLength) : val;
1303
1408
  };
@@ -1305,191 +1410,22 @@
1305
1410
  var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1306
1411
  return Object.fromEntries(Object.entries(data).map(function(param) {
1307
1412
  var _param = _sliced_to_array$o(param, 2), key = _param[0], value = _param[1];
1308
- return isNotEmpty(value) ? [
1413
+ return trueReactPlatformHelpers.isString(value) && trueReactPlatformHelpers.isStringNotEmpty(value) || trueReactPlatformHelpers.isNotEmpty(value) ? [
1309
1414
  "data-".concat(transformToKebab(key)),
1310
1415
  value
1311
1416
  ] : [];
1312
1417
  }));
1313
1418
  };
1314
- var addDataTestId = function() {
1315
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1316
- args[_key] = arguments[_key];
1317
- }
1318
- var testId = getTestId.apply(void 0, _to_consumable_array$7(args));
1319
- return isNotEmpty(testId) ? {
1320
- "data-testid": testId
1321
- } : void 0;
1322
- };
1323
- var getTestId = function(testId, postfix) {
1324
- if (!isNotEmpty(testId)) {
1325
- return void 0;
1326
- }
1327
- return isNotEmpty(postfix) ? "".concat(testId, "-").concat(postfix) : testId;
1328
- };
1329
- var getSelectKeyHandler = function(cb) {
1330
- return function(e) {
1331
- if (e.code === "Enter" || e.code === "NumpadEnter") {
1332
- cb(e);
1333
- }
1334
- };
1335
- };
1336
- var addClickHandler = function(cb) {
1337
- var hasAction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
1338
- return hasAction && isNotEmpty(cb) ? {
1339
- tabIndex: 0,
1340
- onClick: cb,
1341
- onKeyDown: getSelectKeyHandler(cb)
1342
- } : {
1343
- tabIndex: -1
1344
- };
1345
- };
1346
- var createFilter = function(getter, compareFn) {
1347
- return function(items, query) {
1348
- return items.filter(function(item) {
1349
- var possibleValues = getter(item).reduce(function(acc, cur) {
1350
- return _to_consumable_array$7(acc).concat(_to_consumable_array$7(isStringNotEmpty(cur) ? [
1351
- cur.toLowerCase()
1352
- ] : []));
1353
- }, []);
1354
- var queryString = query.toLowerCase().trim();
1355
- return possibleValues.some(function(v) {
1356
- return (compareFn !== null && compareFn !== void 0 ? compareFn : function() {
1357
- return v === null || v === void 0 ? void 0 : v.includes(queryString);
1358
- })(v, queryString);
1359
- });
1360
- });
1361
- };
1362
- };
1363
- var minWidthModifier = {
1364
- name: "minWidth",
1365
- enabled: true,
1366
- phase: "beforeWrite",
1367
- requires: [
1368
- "computeStyles"
1369
- ],
1370
- fn: function(param) {
1371
- var state = param.state;
1372
- state.styles.popper.minWidth = "".concat(state.rects.reference.width, "px");
1373
- },
1374
- effect: function(param) {
1375
- var state = param.state;
1376
- state.elements.popper.style.minWidth = "".concat(state.elements.reference.offsetWidth, "px");
1377
- }
1378
- };
1379
- function _array_like_to_array$p(arr, len) {
1380
- if (len == null || len > arr.length)
1381
- len = arr.length;
1382
- for (var i = 0, arr2 = new Array(len); i < len; i++)
1383
- arr2[i] = arr[i];
1384
- return arr2;
1385
- }
1386
- function _array_without_holes$6(arr) {
1387
- if (Array.isArray(arr))
1388
- return _array_like_to_array$p(arr);
1389
- }
1390
- function _iterable_to_array$6(iter) {
1391
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1392
- return Array.from(iter);
1393
- }
1394
- function _non_iterable_spread$6() {
1395
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1396
- }
1397
- function _to_consumable_array$6(arr) {
1398
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$p(arr) || _non_iterable_spread$6();
1399
- }
1400
- function _unsupported_iterable_to_array$p(o, minLen) {
1401
- if (!o)
1402
- return;
1403
- if (typeof o === "string")
1404
- return _array_like_to_array$p(o, minLen);
1405
- var n = Object.prototype.toString.call(o).slice(8, -1);
1406
- if (n === "Object" && o.constructor)
1407
- n = o.constructor.name;
1408
- if (n === "Map" || n === "Set")
1409
- return Array.from(n);
1410
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1411
- return _array_like_to_array$p(o, minLen);
1412
- }
1413
- var findCountryByCode = function(countryCode) {
1414
- var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1415
- return countryCode !== void 0 ? countriesList.find(function(info) {
1416
- return info.countryCode === countryCode;
1417
- }) : void 0;
1418
- };
1419
- var findCountryIndexByCode = function(countryCode) {
1420
- var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
1421
- return countryCode !== void 0 ? countriesList.findIndex(function(info) {
1422
- return info.countryCode === countryCode;
1423
- }) : -1;
1424
- };
1425
- var getCountryTextByLocale = function(country, locale2) {
1426
- return locale2.toLowerCase() === "ru" ? country.countryRu : country.countryEn;
1427
- };
1428
- var sortCountriesByLocale = function(countriesList, locale2) {
1429
- return countriesList.sort(function(countryA, countryB) {
1430
- return getCountryTextByLocale(countryA, locale2).localeCompare(getCountryTextByLocale(countryB, locale2));
1431
- });
1432
- };
1433
- var checkSearchStringInCountry = function(country, searchString) {
1434
- var checkValue = searchString.toLowerCase().trim().replace("+", "");
1435
- var possibleValues = [
1436
- country.countryRu,
1437
- country.countryEn
1438
- ].concat(_to_consumable_array$6(country.countryRu.split(" ")), _to_consumable_array$6(country.countryEn.split(" ")), [
1439
- country.dialCode
1440
- ]).map(function(part) {
1441
- return part.toLowerCase();
1442
- });
1443
- return possibleValues.some(function(v) {
1444
- return v.startsWith(checkValue);
1445
- });
1446
- };
1447
- var _phone_dialCode, _phone_phoneNumber;
1448
- var getFullPhone = function(phone) {
1449
- 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 : "");
1450
- };
1451
- var getCountryCodeFromPhone = function(phoneWithCode) {
1452
- var _phoneInfo_find;
1453
- var countryCode = (_phoneInfo_find = phoneInfo.find(function(info) {
1454
- return info.fullCodes.some(function(code) {
1455
- return phoneWithCode.startsWith(code);
1456
- });
1457
- })) === null || _phoneInfo_find === void 0 ? void 0 : _phoneInfo_find.countryCode;
1458
- if (countryCode === void 0 && isNotEmpty(phoneWithCode)) {
1459
- var _phoneInfo_filter_sort_;
1460
- var _infoA_dialCodePriority, _infoB_dialCodePriority;
1461
- countryCode = (_phoneInfo_filter_sort_ = phoneInfo.filter(function(info) {
1462
- return phoneWithCode.startsWith(info.dialCode);
1463
- }).sort(function(infoA, infoB) {
1464
- 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);
1465
- })[0]) === null || _phoneInfo_filter_sort_ === void 0 ? void 0 : _phoneInfo_filter_sort_.countryCode;
1466
- }
1467
- return countryCode;
1468
- };
1469
- var getPhoneObjFromString = function(fullPhone, countryCode) {
1470
- var _findCountryByCode;
1471
- var newCountryCode = countryCode !== null && countryCode !== void 0 ? countryCode : getCountryCodeFromPhone(fullPhone);
1472
- var dialCode = (_findCountryByCode = findCountryByCode(newCountryCode)) === null || _findCountryByCode === void 0 ? void 0 : _findCountryByCode.dialCode;
1473
- var phoneNumber = fullPhone.slice(dialCode === null || dialCode === void 0 ? void 0 : dialCode.length);
1474
- return {
1475
- dialCode,
1476
- phoneNumber,
1477
- countryCode: newCountryCode
1478
- };
1479
- };
1480
- var DEFAULT_PHONE_MASK = "+ 9 999 999 999 999 99";
1481
- var getPhoneMask = function(countryCode) {
1482
- var mask = DEFAULT_PHONE_MASK;
1483
- if (countryCode !== void 0) {
1484
- var countrySettings = findCountryByCode(countryCode);
1485
- if (countrySettings !== void 0) {
1486
- var dialCodeLength = countrySettings.dialCode.length;
1487
- var _countrySettings_phoneMask;
1488
- var areaAndPhoneMask = (_countrySettings_phoneMask = countrySettings.phoneMask) !== null && _countrySettings_phoneMask !== void 0 ? _countrySettings_phoneMask : mask.substring(2, mask.length - dialCodeLength);
1489
- mask = "+ ".concat("9".repeat(dialCodeLength), " ").concat(areaAndPhoneMask);
1490
- }
1491
- }
1492
- return mask;
1419
+ var isInt = trueReactPlatformHelpers.isNumberInteger;
1420
+ var addClickHandler = trueReactPlatformHelpers.addClickHandler;
1421
+ var addDataTestId = trueReactPlatformHelpers.addDataTestId;
1422
+ var createFilter = trueReactPlatformHelpers.createFilter;
1423
+ var getSelectKeyHandler = trueReactPlatformHelpers.getSelectKeyHandler;
1424
+ var getTestId = trueReactPlatformHelpers.getTestId;
1425
+ var isStringNotEmpty = trueReactPlatformHelpers.isStringNotEmpty;
1426
+ var isEmpty = trueReactPlatformHelpers.isEmpty;
1427
+ var isNotEmpty = function(val) {
1428
+ return trueReactPlatformHelpers.isString(val) && isStringNotEmpty(val) || isNotEmpty(val);
1493
1429
  };
1494
1430
  var useIsMounted = function() {
1495
1431
  var isMounted = React.useRef(false);
@@ -5139,6 +5075,11 @@
5139
5075
  })
5140
5076
  }));
5141
5077
  };
5078
+ var renderIcon = function(icon) {
5079
+ return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
5080
+ type: icon
5081
+ }) : icon;
5082
+ };
5142
5083
  var ITEM_HORIZONTAL_PADDING = 16;
5143
5084
  var ICON_SIZE = 20;
5144
5085
  var ICON_GAP = 12;
@@ -5247,7 +5188,7 @@
5247
5188
  var _item_testId;
5248
5189
  return /* @__PURE__ */ jsx("div", _object_spread_props$A(_object_spread$J({
5249
5190
  className: classes.root
5250
- }, addDataTestId(testId), addDataAttributes(data)), {
5191
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
5251
5192
  children: items.map(function(item, idx) {
5252
5193
  var _obj;
5253
5194
  return /* @__PURE__ */ jsxs(React.Fragment, {
@@ -5256,19 +5197,17 @@
5256
5197
  className: classes.spacer
5257
5198
  }),
5258
5199
  /* @__PURE__ */ jsxs("div", _object_spread_props$A(_object_spread$J({
5259
- className: clsx(classes.item, (_obj = {}, _define_property$L(_obj, classes.disabledItem, item.disabled), _define_property$L(_obj, classes.withIconGap, item.withIconGap), _obj))
5260
- }, addDataTestId((_item_testId = item.testId) !== null && _item_testId !== void 0 ? _item_testId : getTestId(testId, "item-".concat(idx))), item.disabled && addDataAttributes({
5261
- disabled: item.disabled
5262
- })), {
5200
+ className: clsx(classes.item, (_obj = {}, _define_property$L(_obj, classes.disabledItem, item.disabled), _define_property$L(_obj, classes.withIconGap, item.withIconGap), _obj)),
5263
5201
  onClick: item.disabled ? void 0 : function() {
5264
5202
  return handleItemClick(item);
5265
- },
5203
+ }
5204
+ }, trueReactPlatformHelpers.addDataTestId((_item_testId = item.testId) !== null && _item_testId !== void 0 ? _item_testId : trueReactPlatformHelpers.getTestId(testId, "item-".concat(idx))), item.disabled && addDataAttributes({
5205
+ disabled: item.disabled
5206
+ })), {
5266
5207
  children: [
5267
- isNotEmpty(item.icon) && /* @__PURE__ */ jsx("span", {
5208
+ trueReactPlatformHelpers.isReactNodeNotEmpty(item.icon) && /* @__PURE__ */ jsx("span", {
5268
5209
  className: classes.icon,
5269
- children: typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, {
5270
- type: item.icon
5271
- }) : item.icon
5210
+ children: renderIcon(item.icon)
5272
5211
  }),
5273
5212
  /* @__PURE__ */ jsx("span", {
5274
5213
  className: classes.content,
@@ -6110,8 +6049,8 @@
6110
6049
  tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakPreloader,
6111
6050
  size
6112
6051
  ]);
6113
- var hasIcon = isNotEmpty(icon);
6114
- var hasChildren = isNotEmpty(children);
6052
+ var hasIcon = trueReactPlatformHelpers.isReactNodeNotEmpty(icon);
6053
+ var hasChildren = trueReactPlatformHelpers.isReactNodeNotEmpty(children);
6115
6054
  var hasNoAction = isDisabled || isLoading;
6116
6055
  var _obj, _obj1;
6117
6056
  return /* @__PURE__ */ jsxs("button", _object_spread_props$v(_object_spread$E({
@@ -6122,16 +6061,14 @@
6122
6061
  disabled: hasNoAction,
6123
6062
  onClick: !hasNoAction ? onClick : void 0,
6124
6063
  onMouseDown: !hasNoAction ? onMouseDown : void 0
6125
- }, addDataTestId(testId), addDataAttributes(data)), {
6064
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
6126
6065
  children: [
6127
6066
  /* @__PURE__ */ jsxs("span", {
6128
6067
  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)),
6129
6068
  children: [
6130
6069
  hasIcon && /* @__PURE__ */ jsx("span", {
6131
6070
  className: classes.icon,
6132
- children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
6133
- type: icon
6134
- }) : icon
6071
+ children: trueReactPlatformHelpers.isReactNodeNotEmpty(icon) && renderIcon(icon)
6135
6072
  }),
6136
6073
  hasChildren && /* @__PURE__ */ jsx("span", {
6137
6074
  className: clsx(classes.children, hasIcon && classes.withIcon),
@@ -6341,7 +6278,7 @@
6341
6278
  var _obj;
6342
6279
  return /* @__PURE__ */ jsxs("label", _object_spread_props$u(_object_spread$D({
6343
6280
  className: clsx(classes.root, (_obj = {}, _define_property$F(_obj, classes.disabled, isDisabled), _define_property$F(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
6344
- }, addDataTestId(testId), addDataAttributes(data)), {
6281
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
6345
6282
  children: [
6346
6283
  /* @__PURE__ */ jsx("input", _object_spread$D({
6347
6284
  type: "checkbox",
@@ -6351,7 +6288,7 @@
6351
6288
  readOnly: isReadonly
6352
6289
  }, hasAction && {
6353
6290
  onChange: onToggle,
6354
- onKeyDown: getSelectKeyHandler(onToggle)
6291
+ onKeyDown: trueReactPlatformHelpers.getSelectKeyHandler(onToggle)
6355
6292
  })),
6356
6293
  /* @__PURE__ */ jsx("div", {
6357
6294
  className: clsx(classes.check, isSelected && classes.checked),
@@ -6359,7 +6296,7 @@
6359
6296
  type: isSemiChecked ? "minus" : "check"
6360
6297
  })
6361
6298
  }),
6362
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
6299
+ trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
6363
6300
  className: classes.children,
6364
6301
  children
6365
6302
  })
@@ -6624,11 +6561,6 @@
6624
6561
  className: classes.root
6625
6562
  }, addDataAttributes(data)));
6626
6563
  };
6627
- var renderIcon = function(icon) {
6628
- return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
6629
- type: icon
6630
- }) : icon;
6631
- };
6632
6564
  var PADDING_X$1 = 12;
6633
6565
  var AUTOSIZE_MAX_WIDTH = 480;
6634
6566
  var styles$x = {
@@ -7192,8 +7124,8 @@
7192
7124
  var hasControls = hasClearIcon || iconType !== void 0 || isLoading;
7193
7125
  var hasValue = value !== void 0 && value !== "";
7194
7126
  var hasUnits = units !== void 0 && units !== "";
7195
- var hasLabel = isNotEmpty(label);
7196
- var hasPlaceholder = (!hasLabel || hasFocus && !isReadonly) && isNotEmpty(placeholder);
7127
+ var hasLabel = trueReactPlatformHelpers.isStringNotEmpty(label);
7128
+ var hasPlaceholder = (!hasLabel || hasFocus && !isReadonly) && trueReactPlatformHelpers.isStringNotEmpty(placeholder);
7197
7129
  var shouldShowUnits = (hasValue || isFocused && !hasPlaceholder) && hasUnits;
7198
7130
  var _obj;
7199
7131
  var props = _object_spread$A({
@@ -7213,7 +7145,7 @@
7213
7145
  readOnly: isReadonly,
7214
7146
  size: isAutoSizeable ? defaultSize : void 0,
7215
7147
  tabIndex
7216
- }, addDataTestId(testId));
7148
+ }, trueReactPlatformHelpers.addDataTestId(testId));
7217
7149
  var tweakPreloaderStyles = useTweakStyles(componentStyles, tweakStyles, "tweakPreloader");
7218
7150
  var _obj1, _obj2;
7219
7151
  return /* @__PURE__ */ jsxs("div", {
@@ -7270,7 +7202,7 @@
7270
7202
  type: "close"
7271
7203
  })
7272
7204
  }),
7273
- iconType !== void 0 && /* @__PURE__ */ jsx("div", {
7205
+ trueReactPlatformHelpers.isReactNodeNotEmpty(iconType) && /* @__PURE__ */ jsx("div", {
7274
7206
  className: clsx(classes.inputIcon, _define_property$C({}, classes.activeIcon, !isDisabled && onIconClick !== void 0)),
7275
7207
  onClick: !isDisabled ? onIconClick : void 0,
7276
7208
  children: renderIcon(iconType)
@@ -7279,11 +7211,11 @@
7279
7211
  })
7280
7212
  ]
7281
7213
  })),
7282
- isNotEmpty(infoMessage) && /* @__PURE__ */ jsx("div", {
7214
+ trueReactPlatformHelpers.isStringNotEmpty(infoMessage) && /* @__PURE__ */ jsx("div", {
7283
7215
  className: classes.info,
7284
7216
  children: infoMessage
7285
7217
  }),
7286
- isNotEmpty(errorMessage) && /* @__PURE__ */ jsx("div", {
7218
+ trueReactPlatformHelpers.isStringNotEmpty(errorMessage) && /* @__PURE__ */ jsx("div", {
7287
7219
  className: clsx(classes.error, classes["error-".concat(errorPosition)]),
7288
7220
  children: errorMessage
7289
7221
  })
@@ -7601,7 +7533,7 @@
7601
7533
  var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
7602
7534
  return /* @__PURE__ */ jsxs("div", _object_spread_props$q(_object_spread$y({
7603
7535
  className: classes.root
7604
- }, addDataTestId(testId), addDataAttributes(data)), {
7536
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
7605
7537
  children: [
7606
7538
  /* @__PURE__ */ jsx("div", {
7607
7539
  className: classes.icon,
@@ -7612,7 +7544,7 @@
7612
7544
  /* @__PURE__ */ jsx(Input, _object_spread$y({
7613
7545
  isClearable,
7614
7546
  isActive: props.value !== "" && props.value !== void 0,
7615
- testId: getTestId(testId, "input"),
7547
+ testId: trueReactPlatformHelpers.getTestId(testId, "input"),
7616
7548
  tweakStyles: tweakInputStyles,
7617
7549
  hasFloatingLabel: false,
7618
7550
  label: props.placeholder
@@ -8074,7 +8006,7 @@
8074
8006
  }
8075
8007
  var SelectListItem = function(param) {
8076
8008
  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;
8077
- var isMultiSelect = isNotEmpty(onToggleCheckbox);
8009
+ var isMultiSelect = trueReactPlatformHelpers.isNotEmpty(onToggleCheckbox);
8078
8010
  var _obj;
8079
8011
  return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$p(_object_spread$v({
8080
8012
  active: isFocused,
@@ -8121,7 +8053,7 @@
8121
8053
  function SelectList(param) {
8122
8054
  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;
8123
8055
  var classes = useTheme("SelectList", styles$s, tweakStyles).classes;
8124
- var isMultiSelect = isNotEmpty(onToggleCheckbox);
8056
+ var isMultiSelect = trueReactPlatformHelpers.isNotEmpty(onToggleCheckbox);
8125
8057
  var multiSelectValue = activeValue;
8126
8058
  var _multiSelectValue_length;
8127
8059
  var selectedOptionsCount = (_multiSelectValue_length = multiSelectValue === null || multiSelectValue === void 0 ? void 0 : multiSelectValue.length) !== null && _multiSelectValue_length !== void 0 ? _multiSelectValue_length : 0;
@@ -8151,13 +8083,13 @@
8151
8083
  optionsDisableMap
8152
8084
  ]);
8153
8085
  var isActiveOption = function(item) {
8154
- return isMultiSelect ? activeOptionsIdMap.includes(convertValueToId(item)) : isNotEmpty(activeValue) && convertValueToId(activeValue) === convertValueToId(item);
8086
+ return isMultiSelect ? activeOptionsIdMap.includes(convertValueToId(item)) : trueReactPlatformHelpers.isNotEmpty(activeValue) && convertValueToId(activeValue) === convertValueToId(item);
8155
8087
  };
8156
8088
  return /* @__PURE__ */ jsxs(ScrollIntoViewIfNeeded, {
8157
8089
  active: shouldScrollToList && !isMultiSelect,
8158
- className: clsx(classes.root, _define_property$w({}, classes.withListHeader, isNotEmpty(customListHeader))),
8090
+ className: clsx(classes.root, _define_property$w({}, classes.withListHeader, trueReactPlatformHelpers.isReactNodeNotEmpty(customListHeader))),
8159
8091
  children: [
8160
- isNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
8092
+ trueReactPlatformHelpers.isReactNodeNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
8161
8093
  className: classes.listHeader,
8162
8094
  children: customListHeader
8163
8095
  }),
@@ -8169,7 +8101,7 @@
8169
8101
  children: loadingLabel
8170
8102
  }) : /* @__PURE__ */ jsxs(Fragment, {
8171
8103
  children: [
8172
- isNotEmpty(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
8104
+ trueReactPlatformHelpers.isStringNotEmpty(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
8173
8105
  active: focusedIndex === DEFAULT_OPTION_INDEX,
8174
8106
  options: {
8175
8107
  block: "nearest"
@@ -8180,7 +8112,7 @@
8180
8112
  },
8181
8113
  children: defaultOptionLabel
8182
8114
  }),
8183
- isNotEmpty(allOptionsLabel) && /* @__PURE__ */ jsx(SelectListItem, {
8115
+ trueReactPlatformHelpers.isStringNotEmpty(allOptionsLabel) && /* @__PURE__ */ jsx(SelectListItem, {
8184
8116
  classes,
8185
8117
  index: ALL_OPTION_INDEX,
8186
8118
  isSemiChecked: selectedOptionsCount > 0 && !areAllOptionsSelected,
@@ -8228,7 +8160,7 @@
8228
8160
  };
8229
8161
  var getDefaultConvertToIdFunction = function(convertValueToString) {
8230
8162
  return function(value) {
8231
- return isNotEmpty(value === null || value === void 0 ? void 0 : value.id) ? String(value.id) : convertValueToString(value);
8163
+ return trueReactPlatformHelpers.isNotEmpty(value === null || value === void 0 ? void 0 : value.id) ? String(value.id) : convertValueToString(value);
8232
8164
  };
8233
8165
  };
8234
8166
  var isMultiSelectValue = function(props, _value) {
@@ -8557,7 +8489,7 @@
8557
8489
  var isMounted = useIsMounted();
8558
8490
  var _useState = _sliced_to_array$j(React.useState(false), 2), isListOpen = _useState[0], setIsListOpen = _useState[1];
8559
8491
  var _useState1 = _sliced_to_array$j(React.useState(false), 2), areOptionsLoading = _useState1[0], setAreOptionsLoading = _useState1[1];
8560
- var hasDefaultOption = isStringNotEmpty(defaultOptionLabel);
8492
+ var hasDefaultOption = trueReactPlatformHelpers.isStringNotEmpty(defaultOptionLabel);
8561
8493
  var _useState2 = _sliced_to_array$j(React.useState(DEFAULT_OPTION_INDEX), 2), focusedListCellIndex = _useState2[0], setFocusedListCellIndex = _useState2[1];
8562
8494
  var _useState3 = _sliced_to_array$j(React.useState(""), 2), searchValue = _useState3[0], setSearchValue = _useState3[1];
8563
8495
  var _useState4 = _sliced_to_array$j(React.useState(true), 2), shouldShowDefaultOption = _useState4[0], setShouldShowDefaultOption = _useState4[1];
@@ -8568,13 +8500,13 @@
8568
8500
  var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
8569
8501
  var isMultiSelect = isMultiSelectValue(props);
8570
8502
  var strValue = isMultiSelect ? value === null || value === void 0 ? void 0 : value[0] : value;
8571
- var shouldShowAllOption = isMultiSelect && isNotEmpty(allOptionsLabel) && searchValue === "";
8503
+ var shouldShowAllOption = isMultiSelect && trueReactPlatformHelpers.isStringNotEmpty(allOptionsLabel) && searchValue === "";
8572
8504
  var filteredOptions = React.useMemo(function() {
8573
8505
  if (optionsMode !== "search") {
8574
8506
  return options;
8575
8507
  }
8576
8508
  var _convertValueToString;
8577
- var filter = optionsFilter !== null && optionsFilter !== void 0 ? optionsFilter : createFilter(function(option) {
8509
+ var filter = optionsFilter !== null && optionsFilter !== void 0 ? optionsFilter : trueReactPlatformHelpers.createFilter(function(option) {
8578
8510
  return [
8579
8511
  (_convertValueToString = convertValueToString(option)) !== null && _convertValueToString !== void 0 ? _convertValueToString : ""
8580
8512
  ];
@@ -8596,7 +8528,7 @@
8596
8528
  isOptionDisabled
8597
8529
  ]);
8598
8530
  var areAllOptionsSelected = isMultiSelect && (value === null || value === void 0 ? void 0 : value.length) === availableOptions.length;
8599
- var shouldShowMultiSelectCounter = isMultiSelect && isNotEmpty(value) && value.length > 1 && !areAllOptionsSelected;
8531
+ var shouldShowMultiSelectCounter = isMultiSelect && trueReactPlatformHelpers.isNotEmpty(value) && value.length > 1 && !areAllOptionsSelected;
8600
8532
  var optionsIndexesForNavigation = React.useMemo(function() {
8601
8533
  var result = [];
8602
8534
  if (shouldShowDefaultOption && hasDefaultOption) {
@@ -8614,8 +8546,8 @@
8614
8546
  }, [
8615
8547
  filteredOptions
8616
8548
  ]);
8617
- var stringValue = isNotEmpty(strValue) ? convertValueToString(strValue) : void 0;
8618
- var showedStringValue = areAllOptionsSelected && isNotEmpty(allOptionsLabel) ? allOptionsLabel : stringValue;
8549
+ var stringValue = trueReactPlatformHelpers.isNotEmpty(strValue) ? convertValueToString(strValue) : void 0;
8550
+ var showedStringValue = areAllOptionsSelected && trueReactPlatformHelpers.isNotEmpty(allOptionsLabel) ? allOptionsLabel : stringValue;
8619
8551
  var convertToId = React.useCallback(function(v) {
8620
8552
  return (convertValueToId !== null && convertValueToId !== void 0 ? convertValueToId : getDefaultConvertToIdFunction(convertValueToString))(v);
8621
8553
  }, [
@@ -8647,7 +8579,7 @@
8647
8579
  handleListClose(event);
8648
8580
  return;
8649
8581
  }
8650
- if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current) || !isNotEmpty(inputWrapper.current)) {
8582
+ if (!trueReactPlatformHelpers.isNotEmpty(event.relatedTarget) || !trueReactPlatformHelpers.isNotEmpty(list.current) || !trueReactPlatformHelpers.isNotEmpty(inputWrapper.current)) {
8651
8583
  return;
8652
8584
  }
8653
8585
  var isActionInsideSelect = hasExactParent(event.relatedTarget, list.current) || hasExactParent(event.relatedTarget, inputWrapper.current);
@@ -8857,7 +8789,7 @@
8857
8789
  React.useEffect(function() {
8858
8790
  var _optionsIndexesForNavigation_find;
8859
8791
  setFocusedListCellIndex((_optionsIndexesForNavigation_find = optionsIndexesForNavigation.find(function(index) {
8860
- return isNotEmpty(strValue) && isNotEmpty(filteredOptions[index]) && convertToId(filteredOptions[index]) === convertToId(strValue);
8792
+ return trueReactPlatformHelpers.isNotEmpty(strValue) && trueReactPlatformHelpers.isNotEmpty(filteredOptions[index]) && convertToId(filteredOptions[index]) === convertToId(strValue);
8861
8793
  })) !== null && _optionsIndexesForNavigation_find !== void 0 ? _optionsIndexesForNavigation_find : optionsIndexesForNavigation[0]);
8862
8794
  }, [
8863
8795
  strValue,
@@ -8896,7 +8828,7 @@
8896
8828
  isLoading: inputProps.isLoading,
8897
8829
  loadingLabel,
8898
8830
  tweakStyles: tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakSelectList,
8899
- testId: getTestId(testId, "list"),
8831
+ testId: trueReactPlatformHelpers.getTestId(testId, "list"),
8900
8832
  shouldScrollToList: shouldScrollToList && !shouldUsePopper && !shouldHideOnScroll,
8901
8833
  isOptionDisabled,
8902
8834
  convertValueToString,
@@ -8906,7 +8838,7 @@
8906
8838
  onToggleCheckbox: isMultiSelect ? handleToggleOptionCheckbox : void 0
8907
8839
  })
8908
8840
  }));
8909
- var multiSelectCounterWithIcon = shouldShowMultiSelectCounter || isNotEmpty(iconType) ? /* @__PURE__ */ jsxs(Fragment, {
8841
+ var multiSelectCounterWithIcon = shouldShowMultiSelectCounter || trueReactPlatformHelpers.isNotEmpty(iconType) ? /* @__PURE__ */ jsxs(Fragment, {
8910
8842
  children: [
8911
8843
  shouldShowMultiSelectCounter && /* @__PURE__ */ jsxs("div", {
8912
8844
  className: classes.counter,
@@ -8916,7 +8848,7 @@
8916
8848
  ")"
8917
8849
  ]
8918
8850
  }),
8919
- isNotEmpty(iconType) && /* @__PURE__ */ jsx("div", {
8851
+ trueReactPlatformHelpers.isNotEmpty(iconType) && /* @__PURE__ */ jsx("div", {
8920
8852
  className: classes.icon,
8921
8853
  children: renderIcon(iconType)
8922
8854
  })
@@ -8951,9 +8883,7 @@
8951
8883
  },
8952
8884
  onClick: onArrowClick,
8953
8885
  className: clsx(classes.arrow, isOpen && classes.activeArrow),
8954
- children: /* @__PURE__ */ jsx(Icon, {
8955
- type: dropdownIcon
8956
- })
8886
+ children: renderIcon(dropdownIcon)
8957
8887
  })
8958
8888
  ]
8959
8889
  }),
@@ -9119,17 +9049,17 @@
9119
9049
  var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
9120
9050
  var getDateFormatter = function(dateFormat) {
9121
9051
  return function(date) {
9122
- return isNotEmpty(date) ? dateFns.format(date, dateFormat) : "";
9052
+ return trueReactPlatformHelpers.isNotEmpty(date) ? dateFns.format(date, dateFormat) : "";
9123
9053
  };
9124
9054
  };
9125
9055
  var getDateValueParser = function(dateFormat) {
9126
9056
  return function(value) {
9127
9057
  var inputValue = value === EMPTY_DATE_INPUT_VALUE ? "" : value;
9128
- return isStringNotEmpty(inputValue) ? dateFns.parse(value, dateFormat, new Date()) : null;
9058
+ return trueReactPlatformHelpers.isStringNotEmpty(inputValue) ? dateFns.parse(value, dateFormat, new Date()) : null;
9129
9059
  };
9130
9060
  };
9131
9061
  var areDatesEquals = function(date1, date2) {
9132
- return isEmpty(date1) && isEmpty(date2) || isNotEmpty(date1) && isNotEmpty(date2) && dateFns.isSameDay(date1, date2);
9062
+ return trueReactPlatformHelpers.isEmpty(date1) && trueReactPlatformHelpers.isEmpty(date2) || trueReactPlatformHelpers.isNotEmpty(date1) && trueReactPlatformHelpers.isNotEmpty(date2) && dateFns.isSameDay(date1, date2);
9133
9063
  };
9134
9064
  function _array_like_to_array$i(arr, len) {
9135
9065
  if (len == null || len > arr.length)
@@ -9349,7 +9279,7 @@
9349
9279
  var _useState3 = _sliced_to_array$i(React.useState(formatDate(startDate)), 2), startDateValue = _useState3[0], setStartDateValue = _useState3[1];
9350
9280
  var _useState4 = _sliced_to_array$i(React.useState(endDate), 2), end2 = _useState4[0], setEnd = _useState4[1];
9351
9281
  var _useState5 = _sliced_to_array$i(React.useState(formatDate(endDate)), 2), endDateValue = _useState5[0], setEndDateValue = _useState5[1];
9352
- var hasDateInputValue = isRange ? isStringNotEmpty(startDateValue) || isStringNotEmpty(endDateValue) : isStringNotEmpty(dateValue);
9282
+ var hasDateInputValue = isRange ? trueReactPlatformHelpers.isStringNotEmpty(startDateValue) || trueReactPlatformHelpers.isStringNotEmpty(endDateValue) : trueReactPlatformHelpers.isStringNotEmpty(dateValue);
9353
9283
  var dateInputProps = _object_spread$t(_object_spread_props$n(_object_spread$t({}, inputProps), {
9354
9284
  isRange,
9355
9285
  isDisabled,
@@ -9367,7 +9297,7 @@
9367
9297
  onChangeDate === null || onChangeDate === void 0 ? void 0 : onChangeDate(value, event);
9368
9298
  };
9369
9299
  var isDateInRange = function(date) {
9370
- return (isEmpty(minDate) || dateFns.isAfter(date, minDate)) && (isEmpty(maxDate) || dateFns.isBefore(date, maxDate));
9300
+ return (trueReactPlatformHelpers.isEmpty(minDate) || dateFns.isAfter(date, minDate)) && (trueReactPlatformHelpers.isEmpty(maxDate) || dateFns.isBefore(date, maxDate));
9371
9301
  };
9372
9302
  var handleChangeRange = function(value, event) {
9373
9303
  if (allowSameDay || !areDatesEquals(value === null || value === void 0 ? void 0 : value[0], startDate) || !areDatesEquals(value === null || value === void 0 ? void 0 : value[1], endDate)) {
@@ -9383,13 +9313,13 @@
9383
9313
  var newStart = parseDateValue(newStartDateValue);
9384
9314
  var newEndDateValue = value.slice(13);
9385
9315
  var newEnd = parseDateValue(newEndDateValue);
9386
- if (isNotEmpty(newStart) && !dateFns.isValid(newStart) || isNotEmpty(newStart) && !isDateInRange(newStart)) {
9316
+ if (trueReactPlatformHelpers.isNotEmpty(newStart) && !dateFns.isValid(newStart) || trueReactPlatformHelpers.isNotEmpty(newStart) && !isDateInRange(newStart)) {
9387
9317
  newStart = start2;
9388
9318
  }
9389
- if (isNotEmpty(newEnd) && !dateFns.isValid(newEnd) || isNotEmpty(newEnd) && !isDateInRange(newEnd)) {
9319
+ if (trueReactPlatformHelpers.isNotEmpty(newEnd) && !dateFns.isValid(newEnd) || trueReactPlatformHelpers.isNotEmpty(newEnd) && !isDateInRange(newEnd)) {
9390
9320
  newEnd = end2;
9391
9321
  }
9392
- if (isEmpty(newStart) && dateFns.isValid(newEnd) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9322
+ if (trueReactPlatformHelpers.isEmpty(newStart) && dateFns.isValid(newEnd) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9393
9323
  dateFns.isValid(newStart) && dateFns.isValid(newEnd) && dateFns.isAfter(newStart, newEnd)) {
9394
9324
  newStart = newEnd;
9395
9325
  newEnd = null;
@@ -9721,7 +9651,7 @@
9721
9651
  };
9722
9652
  var formatNumberWithDefault = function(value, defaultValue) {
9723
9653
  var val = formatNumber(value);
9724
- return isNotEmpty(val) ? val : formatNumber(defaultValue);
9654
+ return trueReactPlatformHelpers.isStringNotEmpty(val) ? val : formatNumber(defaultValue);
9725
9655
  };
9726
9656
  var constructRegExp = function(param) {
9727
9657
  var canBeFloat = param.canBeFloat, canBeNegative = param.canBeNegative, intPartPrecision = param.intPartPrecision, precision = param.precision;
@@ -10000,7 +9930,7 @@
10000
9930
  setIsDeleteForwardAction(event.key === "Delete");
10001
9931
  };
10002
9932
  var setShowedValueWithDefault = function(v) {
10003
- setShowedValue(isNotEmpty(v) ? v : formatNumber(defaultValue));
9933
+ setShowedValue(trueReactPlatformHelpers.isStringNotEmpty(v) ? v : formatNumber(defaultValue));
10004
9934
  };
10005
9935
  var handleChange = function() {
10006
9936
  var _ref = _async_to_generator$3(function(inputValue, event) {
@@ -11780,7 +11710,7 @@
11780
11710
  var _useState4 = _sliced_to_array$e(React.useState(false), 2), isLoading = _useState4[0], setIsLoading = _useState4[1];
11781
11711
  var _useState5 = _sliced_to_array$e(React.useState(false), 2), isLoadingOptionsOnScroll = _useState5[0], setLoadingOptionsOnScroll = _useState5[1];
11782
11712
  var shouldShowPreloader = isLoading || isLoadingOptionsOnScroll;
11783
- var hasFooter = isNotEmpty(footer);
11713
+ var hasFooter = trueReactPlatformHelpers.isReactNodeNotEmpty(footer);
11784
11714
  var handleSearchInputChange = React.useCallback(function() {
11785
11715
  var _ref = _async_to_generator$1(function(inputValue) {
11786
11716
  var _inputValue_trim, response;
@@ -13652,7 +13582,7 @@
13652
13582
  leftPosition: -20,
13653
13583
  topPosition,
13654
13584
  border: "bottom",
13655
- testId: getTestId(testId, "from"),
13585
+ testId: trueReactPlatformHelpers.getTestId(testId, "from"),
13656
13586
  isClearable
13657
13587
  }, startPickerProps))
13658
13588
  }),
@@ -13668,7 +13598,7 @@
13668
13598
  topPosition,
13669
13599
  leftPosition: -170,
13670
13600
  border: "bottom",
13671
- testId: getTestId(testId, "to"),
13601
+ testId: trueReactPlatformHelpers.getTestId(testId, "to"),
13672
13602
  isClearable
13673
13603
  }, endPickerProps))
13674
13604
  })
@@ -13682,7 +13612,7 @@
13682
13612
  onClick: handleClear,
13683
13613
  size: "s",
13684
13614
  view: "text",
13685
- testId: getTestId(testId, "clear-button"),
13615
+ testId: trueReactPlatformHelpers.getTestId(testId, "clear-button"),
13686
13616
  isFullWidth: true,
13687
13617
  tweakStyles: tweakClearButtonStyles,
13688
13618
  children: translates.clear
@@ -21938,7 +21868,7 @@
21938
21868
  "data",
21939
21869
  "tweakStyles"
21940
21870
  ]);
21941
- if (!isInt(step)) {
21871
+ if (!trueReactPlatformHelpers.isNumberInteger(step)) {
21942
21872
  console.error("Параметр step должен быть целым числом");
21943
21873
  }
21944
21874
  var _useTheme = useTheme("IncrementInput", styles$e, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
@@ -22423,7 +22353,7 @@
22423
22353
  style: {
22424
22354
  zIndex
22425
22355
  }
22426
- }, addDataTestId(testId), addDataAttributes(data)), {
22356
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
22427
22357
  children: /* @__PURE__ */ jsx("div", {
22428
22358
  ref: overlay,
22429
22359
  className: clsx(classes.innerOverlay, classes["position-".concat(position)]),
@@ -22435,16 +22365,16 @@
22435
22365
  hasCloseButton && /* @__PURE__ */ jsx("div", {
22436
22366
  className: classes.close,
22437
22367
  children: /* @__PURE__ */ jsx(CloseButton, {
22438
- testId: getTestId(testId, "close-button"),
22368
+ testId: trueReactPlatformHelpers.getTestId(testId, "close-button"),
22439
22369
  tweakStyles: tweakCloseButtonStyles,
22440
22370
  onClose
22441
22371
  })
22442
22372
  }),
22443
- isNotEmpty(title) && /* @__PURE__ */ jsx("h3", {
22373
+ trueReactPlatformHelpers.isReactNodeNotEmpty(title) && /* @__PURE__ */ jsx("h3", {
22444
22374
  className: clsx(classes.title, _define_property$d({}, classes.titleWithCloseButton, hasCloseButton)),
22445
22375
  children: title
22446
22376
  }),
22447
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
22377
+ trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
22448
22378
  className: classes.content,
22449
22379
  children
22450
22380
  }),
@@ -22656,9 +22586,9 @@
22656
22586
  children: [
22657
22587
  /* @__PURE__ */ jsx("button", _object_spread_props$9(_object_spread$b({
22658
22588
  ref: button,
22659
- 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))
22660
- }, addDataTestId(testId), addDataAttributes(data)), {
22661
- onClick: !isButtonDisabled ? toggleMenu : void 0,
22589
+ 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)),
22590
+ onClick: !isButtonDisabled ? toggleMenu : void 0
22591
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
22662
22592
  children: /* @__PURE__ */ jsx("div", {
22663
22593
  className: classes.icon,
22664
22594
  children: /* @__PURE__ */ jsx(Icon, {
@@ -22671,7 +22601,7 @@
22671
22601
  ref: list,
22672
22602
  children: /* @__PURE__ */ jsx(List, {
22673
22603
  items,
22674
- testId: getTestId(testId, "list"),
22604
+ testId: trueReactPlatformHelpers.getTestId(testId, "list"),
22675
22605
  tweakStyles: tweakListStyles,
22676
22606
  onClick: handleCloseMenu
22677
22607
  })
@@ -23017,13 +22947,12 @@
23017
22947
  var classes = useTheme("Notification", styles$9, tweakStyles, {
23018
22948
  type
23019
22949
  }).classes;
23020
- var hasText = isNotEmpty(text);
23021
- var hasTitle = isNotEmpty(title);
23022
- var hasTestId = isNotEmpty(testId);
22950
+ var hasText = trueReactPlatformHelpers.isStringNotEmpty(text);
22951
+ var hasTitle = trueReactPlatformHelpers.isStringNotEmpty(title);
23023
22952
  var _obj;
23024
22953
  return /* @__PURE__ */ jsxs("div", _object_spread_props$8(_object_spread$a({
23025
22954
  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))
23026
- }, addDataTestId(testId), addDataAttributes(data)), {
22955
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
23027
22956
  children: [
23028
22957
  /* @__PURE__ */ jsx("div", {
23029
22958
  className: classes.icon,
@@ -23034,17 +22963,17 @@
23034
22963
  /* @__PURE__ */ jsxs("div", {
23035
22964
  className: classes.body,
23036
22965
  children: [
23037
- hasTitle && /* @__PURE__ */ jsx("span", {
23038
- className: classes.title,
23039
- "data-testid": hasTestId ? "".concat(testId, "-title") : void 0,
22966
+ hasTitle && /* @__PURE__ */ jsx("span", _object_spread_props$8(_object_spread$a({
22967
+ className: classes.title
22968
+ }, trueReactPlatformHelpers.addDataTestId(testId, "title")), {
23040
22969
  children: title
23041
- }),
23042
- hasText && /* @__PURE__ */ jsx("span", {
23043
- className: classes.text,
23044
- "data-testid": hasTestId ? "".concat(testId, "-text") : void 0,
22970
+ })),
22971
+ hasText && /* @__PURE__ */ jsx("span", _object_spread_props$8(_object_spread$a({
22972
+ className: classes.text
22973
+ }, trueReactPlatformHelpers.addDataTestId(testId, "text")), {
23045
22974
  children: text
23046
- }),
23047
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
22975
+ })),
22976
+ trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
23048
22977
  className: classes.content,
23049
22978
  children
23050
22979
  })
@@ -26735,7 +26664,7 @@
26735
26664
  },
26736
26665
  className: clsx(classes.input, (_obj = {}, _define_property$6(_obj, classes.isDisabled, isDisabled), _define_property$6(_obj, classes.isInvalid, isInvalid), _obj))
26737
26666
  }),
26738
- isNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26667
+ trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26739
26668
  className: classes.content,
26740
26669
  children
26741
26670
  })
@@ -26866,7 +26795,7 @@
26866
26795
  var _obj;
26867
26796
  return /* @__PURE__ */ jsxs("label", _object_spread_props$5(_object_spread$5({
26868
26797
  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))
26869
- }, addDataTestId(testId), addDataAttributes(data)), {
26798
+ }, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
26870
26799
  children: [
26871
26800
  /* @__PURE__ */ jsx("span", {
26872
26801
  className: classes.switch,
@@ -26877,9 +26806,9 @@
26877
26806
  onChange: isDisabled ? void 0 : handleChange,
26878
26807
  checked: isChecked,
26879
26808
  disabled: isDisabled
26880
- }, addDataTestId(testId, "input")))
26809
+ }, trueReactPlatformHelpers.addDataTestId(testId, "input")))
26881
26810
  }),
26882
- isNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26811
+ trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("span", {
26883
26812
  className: clsx(classes.label, classes[labelPosition === "left" ? "labelLeft" : "labelRight"]),
26884
26813
  children
26885
26814
  })
@@ -27973,21 +27902,21 @@
27973
27902
  }),
27974
27903
  /* @__PURE__ */ jsxs("div", {
27975
27904
  children: [
27976
- isNotEmpty(title) && /* @__PURE__ */ jsx("div", {
27905
+ trueReactPlatformHelpers.isStringNotEmpty(title) && /* @__PURE__ */ jsx("div", {
27977
27906
  className: classes.title,
27978
27907
  children: title
27979
27908
  }),
27980
- isNotEmpty(text) && /* @__PURE__ */ jsx("div", {
27909
+ trueReactPlatformHelpers.isStringNotEmpty(text) && /* @__PURE__ */ jsx("div", {
27981
27910
  className: classes.text,
27982
27911
  children: text
27983
27912
  }),
27984
- isNotEmpty(children) && /* @__PURE__ */ jsx("div", {
27913
+ trueReactPlatformHelpers.isReactNodeNotEmpty(children) && /* @__PURE__ */ jsx("div", {
27985
27914
  className: classes.content,
27986
27915
  children
27987
27916
  })
27988
27917
  ]
27989
27918
  }),
27990
- hasCloseButton && onClose !== void 0 && /* @__PURE__ */ jsx("div", {
27919
+ hasCloseButton && trueReactPlatformHelpers.isNotEmpty(onClose) && /* @__PURE__ */ jsx("div", {
27991
27920
  className: classes.close,
27992
27921
  children: /* @__PURE__ */ jsx(CloseButton, {
27993
27922
  onClose,