@true-engineering/true-react-common-ui-kit 1.0.2 → 1.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.
- package/dist/components/AccountInfo/AccountInfo.d.ts +4 -4
- package/dist/components/AccountInfo/AccountInfo.styles.d.ts +60 -56
- package/dist/components/AddButton/AddButton.d.ts +6 -6
- package/dist/components/AddButton/AddButton.styles.d.ts +23 -23
- package/dist/components/Button/Button.d.ts +19 -33
- package/dist/components/Button/Button.styles.d.ts +144 -144
- package/dist/components/Checkbox/Checkbox.d.ts +16 -27
- package/dist/components/Checkbox/Checkbox.styles.d.ts +39 -42
- package/dist/components/CloseButton/CloseButton.d.ts +4 -4
- package/dist/components/CloseButton/CloseButton.styles.d.ts +22 -22
- package/dist/components/Colors/Colors.styles.d.ts +28 -28
- package/dist/components/CssBaseline/CssBaseline.d.ts +1 -1
- package/dist/components/CssBaseline/CssBaseline.styles.d.ts +7 -7
- package/dist/components/DateInput/DateInput.d.ts +8 -9
- package/dist/components/DateInput/DateInput.styles.d.ts +7 -7
- package/dist/components/DatePicker/DatePicker.d.ts +29 -36
- package/dist/components/DatePicker/DatePicker.styles.d.ts +38 -34
- package/dist/components/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +9 -9
- package/dist/components/DatePicker/DatePickerHeader/DatePickerHeader.styles.d.ts +59 -59
- package/dist/components/DatePicker/DatePickerInput/DatePickerInput.d.ts +7 -9
- package/dist/components/DatePicker/DatePickerInput/DatePickerInput.styles.d.ts +16 -16
- package/dist/components/Description/Description.d.ts +6 -6
- package/dist/components/Description/Description.styles.d.ts +18 -18
- package/dist/components/FiltersPane/FilterInterval/FilterInterval.d.ts +19 -19
- package/dist/components/FiltersPane/FilterInterval/FilterInterval.styles.d.ts +44 -44
- package/dist/components/FiltersPane/FilterMultiSelect/FilterMultiSelect.d.ts +2 -8
- package/dist/components/FiltersPane/FilterSelect/FilterSelect.d.ts +17 -35
- package/dist/components/FiltersPane/FilterSelect/FilterSelect.styles.d.ts +111 -111
- package/dist/components/FiltersPane/FilterSelect/locales.d.ts +6 -10
- package/dist/components/FiltersPane/FilterValueView/FilterValueView.d.ts +1 -9
- package/dist/components/FiltersPane/FilterValueView/FilterValueView.styles.d.ts +8 -8
- package/dist/components/FiltersPane/FilterWithDates/FilterWithDates.d.ts +13 -21
- package/dist/components/FiltersPane/FilterWithDates/FilterWithDates.styles.d.ts +41 -41
- package/dist/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.d.ts +8 -8
- package/dist/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.styles.d.ts +7 -7
- package/dist/components/FiltersPane/FilterWrapper/FilterWrapper.d.ts +18 -41
- package/dist/components/FiltersPane/FilterWrapper/FilterWrapper.styles.d.ts +92 -92
- package/dist/components/FiltersPane/FiltersPane.d.ts +15 -34
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +50 -50
- package/dist/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.d.ts +18 -37
- package/dist/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +82 -82
- package/dist/components/FiltersPane/locales.d.ts +22 -28
- package/dist/components/FiltersPane/types.d.ts +38 -65
- package/dist/components/Flag/Flag.d.ts +2 -2
- package/dist/components/Flag/Flag.styles.d.ts +8 -8
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +20 -45
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +93 -93
- package/dist/components/FlexibleTable/TableRow.d.ts +21 -38
- package/dist/components/FlexibleTable/TableValue.d.ts +16 -28
- package/dist/components/FlexibleTable/types.d.ts +31 -37
- package/dist/components/Icon/ComplexIconBoilerplate.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts +2 -2
- package/dist/components/Icon/Icon.styles.d.ts +4 -4
- package/dist/components/Icon/IconBoilerplate.d.ts +1 -1
- package/dist/components/Icon/complexIcons/icons.d.ts +1 -1
- package/dist/components/Icon/icons/icons.d.ts +5 -97
- package/dist/components/IncrementInput/ChangeButton.d.ts +5 -5
- package/dist/components/IncrementInput/IncrementInput.d.ts +3 -4
- package/dist/components/IncrementInput/IncrementInput.styles.d.ts +52 -52
- package/dist/components/Input/Input.d.ts +37 -48
- package/dist/components/Input/Input.styles.d.ts +242 -242
- package/dist/components/List/List.d.ts +12 -12
- package/dist/components/List/List.styles.d.ts +35 -35
- package/dist/components/Modal/Modal.d.ts +19 -19
- package/dist/components/Modal/Modal.styles.d.ts +235 -235
- package/dist/components/MoreMenu/MoreMenu.d.ts +7 -7
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +45 -45
- package/dist/components/MultiSelect/MultiSelect.d.ts +13 -28
- package/dist/components/MultiSelect/MultiSelect.styles.d.ts +38 -38
- package/dist/components/MultiSelect/MultiSelectInput/MultiSelectInput.d.ts +6 -12
- package/dist/components/MultiSelect/MultiSelectInput/MultiSelectInput.styles.d.ts +58 -58
- package/dist/components/MultiSelectList/MultiSelectList.d.ts +20 -43
- package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +90 -90
- package/dist/components/MultiSelectList/locales.d.ts +6 -10
- package/dist/components/Notification/Notification.d.ts +9 -14
- package/dist/components/Notification/Notification.styles.d.ts +30 -33
- package/dist/components/NumberInput/NumberInput.d.ts +10 -16
- package/dist/components/NumberInput/helpers.d.ts +2 -10
- package/dist/components/PhoneInput/PhoneInput.d.ts +7 -14
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +60 -60
- package/dist/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.d.ts +7 -7
- package/dist/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +74 -78
- package/dist/components/PhoneInput/types.d.ts +11 -11
- package/dist/components/RadioButton/RadioButton.d.ts +8 -18
- package/dist/components/RadioButton/RadioButton.styles.d.ts +25 -25
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +374 -634
- package/dist/components/SearchInput/SearchInput.d.ts +2 -12
- package/dist/components/SearchInput/SearchInput.styles.d.ts +32 -32
- package/dist/components/Select/Select.d.ts +24 -51
- package/dist/components/Select/Select.styles.d.ts +53 -53
- package/dist/components/Select/SelectList/SelectList.d.ts +17 -32
- package/dist/components/Select/SelectList/SelectList.styles.d.ts +35 -37
- package/dist/components/Select/helpers.d.ts +3 -9
- package/dist/components/SmartInput/SmartInput.d.ts +16 -28
- package/dist/components/SmartInput/helpers.d.ts +4 -8
- package/dist/components/Switch/Switch.d.ts +13 -26
- package/dist/components/Switch/Switch.styles.d.ts +58 -58
- package/dist/components/TextArea/TextArea.d.ts +23 -26
- package/dist/components/TextArea/TextArea.styles.d.ts +124 -124
- package/dist/components/TextWithInfo/TextWithInfo.d.ts +9 -9
- package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +40 -40
- package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +12 -12
- package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +10 -10
- package/dist/components/ThemedPreloader/ThemedPreloader.d.ts +4 -4
- package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +10 -10
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +35 -35
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +5 -5
- package/dist/components/Toaster/Toaster.d.ts +11 -16
- package/dist/components/Toaster/Toaster.styles.d.ts +41 -41
- package/dist/components/Tooltip/Tooltip.d.ts +4 -4
- package/dist/components/Tooltip/Tooltip.styles.d.ts +27 -25
- package/dist/helpers/data-attributes.d.ts +4 -11
- package/dist/helpers/phone.d.ts +8 -28
- package/dist/helpers/utils.d.ts +7 -28
- package/dist/hooks/use-did-mount-effect.d.ts +1 -4
- package/dist/hooks/use-dropdown.d.ts +7 -14
- package/dist/hooks/use-is-mounted.d.ts +1 -1
- package/dist/hooks/use-on-click-outside.d.ts +4 -25
- package/dist/hooks/use-theme.d.ts +5 -10
- package/dist/hooks/use-tweak-styles.d.ts +1 -5
- package/dist/style.css +90 -205
- package/dist/theme.d.ts +55 -51
- package/dist/true-react-common-ui-kit.js +16711 -24314
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +39 -35
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +23 -77
- package/package.json +1 -1
- package/src/components/Select/Select.stories.tsx +16 -12
- package/src/components/Select/Select.tsx +51 -41
- package/src/components/Select/SelectList/SelectList.tsx +17 -22
- package/src/components/Select/helpers.ts +14 -6
- package/src/components/SmartInput/SmartInput.tsx +130 -127
|
@@ -6953,15 +6953,11 @@
|
|
|
6953
6953
|
}
|
|
6954
6954
|
return obj;
|
|
6955
6955
|
}
|
|
6956
|
-
function isOptionDisabled(option) {
|
|
6957
|
-
var _option_isDisabled;
|
|
6958
|
-
return typeof option === "object" && option !== null && ((_option_isDisabled = option === null || option === void 0 ? void 0 : option.isDisabled) !== null && _option_isDisabled !== void 0 ? _option_isDisabled : false);
|
|
6959
|
-
}
|
|
6960
6956
|
var DEFAULT_OPTION_INDEX = -1;
|
|
6961
6957
|
function SelectList(param) {
|
|
6962
|
-
var options = param.options,
|
|
6958
|
+
var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, isOptionDisabled = param.isOptionDisabled, onOptionClick = param.onOptionClick, convertValueToString = param.convertValueToString, convertValueToReactNode = param.convertValueToReactNode, _param_convertValueToId = param.convertValueToId, convertValueToId = _param_convertValueToId === void 0 ? convertValueToString : _param_convertValueToId;
|
|
6963
6959
|
var classes = useTheme("SelectList", styles$v, tweakStyles).classes;
|
|
6964
|
-
var activeValueId = convertValueToId(activeValue);
|
|
6960
|
+
var activeValueId = isNotEmpty(activeValue) ? convertValueToId(activeValue) : void 0;
|
|
6965
6961
|
var convertedToStringOptions = React.useMemo(function() {
|
|
6966
6962
|
return options.map(convertValueToString);
|
|
6967
6963
|
}, [
|
|
@@ -7026,6 +7022,21 @@
|
|
|
7026
7022
|
})
|
|
7027
7023
|
});
|
|
7028
7024
|
}
|
|
7025
|
+
var _option_isDisabled;
|
|
7026
|
+
var defaultIsOptionDisabled = function(option) {
|
|
7027
|
+
return typeof option === "object" && option !== null && ((_option_isDisabled = option === null || option === void 0 ? void 0 : option.isDisabled) !== null && _option_isDisabled !== void 0 ? _option_isDisabled : false);
|
|
7028
|
+
};
|
|
7029
|
+
var defaultConvertFunction$2 = function(v) {
|
|
7030
|
+
return v === void 0 ? void 0 : String(v);
|
|
7031
|
+
};
|
|
7032
|
+
var defaultCompareFunction = function(v1, v2) {
|
|
7033
|
+
return v1 === v2;
|
|
7034
|
+
};
|
|
7035
|
+
var getActiveValueIndex = function(options, value, convertFunc) {
|
|
7036
|
+
return isNotEmpty(value) ? options.findIndex(function(o) {
|
|
7037
|
+
return convertFunc(o) === convertFunc(value);
|
|
7038
|
+
}) : -1;
|
|
7039
|
+
};
|
|
7029
7040
|
var styles$u = {
|
|
7030
7041
|
root: {
|
|
7031
7042
|
width: "100%",
|
|
@@ -7085,17 +7096,6 @@
|
|
|
7085
7096
|
},
|
|
7086
7097
|
tweakSelectList: {}
|
|
7087
7098
|
};
|
|
7088
|
-
var defaultConvertFunction$2 = function(v) {
|
|
7089
|
-
return v === void 0 ? void 0 : String(v);
|
|
7090
|
-
};
|
|
7091
|
-
var defaultCompareFunction = function(v1, v2) {
|
|
7092
|
-
return v1 === v2;
|
|
7093
|
-
};
|
|
7094
|
-
var getActiveValueIndex = function(options, value, convertFunc) {
|
|
7095
|
-
return options.findIndex(function(o) {
|
|
7096
|
-
return convertFunc(o) === convertFunc(value);
|
|
7097
|
-
});
|
|
7098
|
-
};
|
|
7099
7099
|
function _array_like_to_array$j(arr, len) {
|
|
7100
7100
|
if (len == null || len > arr.length)
|
|
7101
7101
|
len = arr.length;
|
|
@@ -7370,22 +7370,12 @@
|
|
|
7370
7370
|
}
|
|
7371
7371
|
};
|
|
7372
7372
|
function Select(_param) {
|
|
7373
|
-
var options = _param.options, value = _param.value,
|
|
7373
|
+
var options = _param.options, value = _param.value, defaultOptionLabel = _param.defaultOptionLabel, _param_debounceTime = _param.debounceTime, debounceTime = _param_debounceTime === void 0 ? 400 : _param_debounceTime, _param_optionsMode = _param.optionsMode, optionsMode = _param_optionsMode === void 0 ? "normal" : _param_optionsMode, noMatchesLabel = _param.noMatchesLabel, loadingLabel = _param.loadingLabel, tweakStyles = _param.tweakStyles, testId = _param.testId, isDisabled = _param.isDisabled, dropdownOptions = _param.dropdownOptions, _param_minSymbolsCountToOpenList = _param.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _param_minSymbolsCountToOpenList === void 0 ? 0 : _param_minSymbolsCountToOpenList, _param_dropdownIcon = _param.dropdownIcon, dropdownIcon = _param_dropdownIcon === void 0 ? "chevron-down" : _param_dropdownIcon, _param_shouldScrollToList = _param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, onChange = _param.onChange, onFocus = _param.onFocus, onBlur = _param.onBlur, onType = _param.onType, onOpen = _param.onOpen, _param_isOptionDisabled = _param.isOptionDisabled, isOptionDisabled = _param_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _param_isOptionDisabled, _param_compareValuesOnChange = _param.compareValuesOnChange, compareValuesOnChange = _param_compareValuesOnChange === void 0 ? defaultCompareFunction : _param_compareValuesOnChange, _param_convertValueToString = _param.convertValueToString, convertValueToString = _param_convertValueToString === void 0 ? defaultConvertFunction$2 : _param_convertValueToString, convertValueToId = _param.convertValueToId, convertValueToReactNode = _param.convertValueToReactNode, optionsFilter = _param.optionsFilter, inputProps = _object_without_properties$6(_param, [
|
|
7374
7374
|
"options",
|
|
7375
7375
|
"value",
|
|
7376
|
-
"onChange",
|
|
7377
|
-
"compareValuesOnChange",
|
|
7378
|
-
"convertValueToString",
|
|
7379
|
-
"convertValueToId",
|
|
7380
|
-
"convertValueToReactNode",
|
|
7381
7376
|
"defaultOptionLabel",
|
|
7382
|
-
"onFocus",
|
|
7383
|
-
"onBlur",
|
|
7384
|
-
"onType",
|
|
7385
|
-
"onOpen",
|
|
7386
7377
|
"debounceTime",
|
|
7387
7378
|
"optionsMode",
|
|
7388
|
-
"optionsFilter",
|
|
7389
7379
|
"noMatchesLabel",
|
|
7390
7380
|
"loadingLabel",
|
|
7391
7381
|
"tweakStyles",
|
|
@@ -7393,7 +7383,19 @@
|
|
|
7393
7383
|
"isDisabled",
|
|
7394
7384
|
"dropdownOptions",
|
|
7395
7385
|
"minSymbolsCountToOpenList",
|
|
7396
|
-
"dropdownIcon"
|
|
7386
|
+
"dropdownIcon",
|
|
7387
|
+
"shouldScrollToList",
|
|
7388
|
+
"onChange",
|
|
7389
|
+
"onFocus",
|
|
7390
|
+
"onBlur",
|
|
7391
|
+
"onType",
|
|
7392
|
+
"onOpen",
|
|
7393
|
+
"isOptionDisabled",
|
|
7394
|
+
"compareValuesOnChange",
|
|
7395
|
+
"convertValueToString",
|
|
7396
|
+
"convertValueToId",
|
|
7397
|
+
"convertValueToReactNode",
|
|
7398
|
+
"optionsFilter"
|
|
7397
7399
|
]);
|
|
7398
7400
|
var _useTheme = useTheme("Select", styles$u, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
|
|
7399
7401
|
var isMounted = useIsMounted();
|
|
@@ -7406,6 +7408,7 @@
|
|
|
7406
7408
|
var inputWrapper = React.useRef(null);
|
|
7407
7409
|
var list = React.useRef(null);
|
|
7408
7410
|
var input = React.useRef(null);
|
|
7411
|
+
var stringValue = isNotEmpty(value) ? convertValueToString(value) : void 0;
|
|
7409
7412
|
var filteredOptions = React.useMemo(function() {
|
|
7410
7413
|
if (optionsMode !== "search") {
|
|
7411
7414
|
return options;
|
|
@@ -7649,7 +7652,7 @@
|
|
|
7649
7652
|
ref: inputWrapper,
|
|
7650
7653
|
children: [
|
|
7651
7654
|
/* @__PURE__ */ jsx(Input, _object_spread$v({
|
|
7652
|
-
value: searchValue !== "" ? searchValue :
|
|
7655
|
+
value: searchValue !== "" ? searchValue : stringValue,
|
|
7653
7656
|
onChange: handleInputChange,
|
|
7654
7657
|
isActive: isListOpen,
|
|
7655
7658
|
isReadonly: optionsMode === "normal",
|
|
@@ -7686,10 +7689,6 @@
|
|
|
7686
7689
|
}, popperData === null || popperData === void 0 ? void 0 : popperData.attributes.popper), {
|
|
7687
7690
|
children: isOpen && /* @__PURE__ */ jsx(SelectList, {
|
|
7688
7691
|
options: filteredOptions,
|
|
7689
|
-
convertValueToString,
|
|
7690
|
-
convertValueToReactNode,
|
|
7691
|
-
convertValueToId,
|
|
7692
|
-
onOptionClick: handleOptionClick,
|
|
7693
7692
|
defaultOptionLabel: hasDefaultOption && shouldShowDefaultOption ? defaultOptionLabel : void 0,
|
|
7694
7693
|
noMatchesLabel,
|
|
7695
7694
|
focusedIndex: focusedListCellIndex,
|
|
@@ -7698,7 +7697,12 @@
|
|
|
7698
7697
|
loadingLabel,
|
|
7699
7698
|
tweakStyles: tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakSelectList,
|
|
7700
7699
|
testId: testId !== void 0 ? "".concat(testId, "-list") : void 0,
|
|
7701
|
-
shouldScrollToList: !shouldUsePopper && !shouldHideOnScroll
|
|
7700
|
+
shouldScrollToList: shouldScrollToList && !shouldUsePopper && !shouldHideOnScroll,
|
|
7701
|
+
isOptionDisabled,
|
|
7702
|
+
convertValueToString,
|
|
7703
|
+
convertValueToReactNode,
|
|
7704
|
+
convertValueToId,
|
|
7705
|
+
onOptionClick: handleOptionClick
|
|
7702
7706
|
})
|
|
7703
7707
|
}))
|
|
7704
7708
|
})
|