@true-engineering/true-react-common-ui-kit 4.0.0-alpha27 → 4.0.0-alpha28
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/FiltersPane/types.d.ts +2 -1
- package/dist/true-react-common-ui-kit.js +29 -35
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +29 -35
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/FiltersPane.tsx +9 -6
- package/src/components/FiltersPane/components/Filter/Filter.tsx +14 -15
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +3 -2
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +7 -5
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +12 -18
- package/src/components/FiltersPane/types.ts +2 -1
|
@@ -19789,7 +19789,7 @@
|
|
|
19789
19789
|
locale: translates,
|
|
19790
19790
|
tweakStyles: tweakSelectStyles,
|
|
19791
19791
|
getValueView: getPeriodTranslate,
|
|
19792
|
-
testId:
|
|
19792
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "select")
|
|
19793
19793
|
})
|
|
19794
19794
|
}),
|
|
19795
19795
|
isDatePickerShown && /* @__PURE__ */ jsx("div", {
|
|
@@ -19811,7 +19811,7 @@
|
|
|
19811
19811
|
onChange: handleCustomDateChange,
|
|
19812
19812
|
localeKey,
|
|
19813
19813
|
locale: translates,
|
|
19814
|
-
testId:
|
|
19814
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "dates")
|
|
19815
19815
|
})
|
|
19816
19816
|
})
|
|
19817
19817
|
]
|
|
@@ -19906,7 +19906,7 @@
|
|
|
19906
19906
|
onClose,
|
|
19907
19907
|
localeKey: translatesLocaleKey,
|
|
19908
19908
|
locale: translates,
|
|
19909
|
-
testId:
|
|
19909
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "select")
|
|
19910
19910
|
}, filter));
|
|
19911
19911
|
}
|
|
19912
19912
|
if (filter.type === "dateRange") {
|
|
@@ -19917,7 +19917,7 @@
|
|
|
19917
19917
|
onClose,
|
|
19918
19918
|
localeKey: translatesLocaleKey,
|
|
19919
19919
|
locale: translates,
|
|
19920
|
-
testId:
|
|
19920
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "period")
|
|
19921
19921
|
}, filter));
|
|
19922
19922
|
}
|
|
19923
19923
|
if (filter.type === "dateRangeWithoutPeriod") {
|
|
@@ -19934,7 +19934,7 @@
|
|
|
19934
19934
|
},
|
|
19935
19935
|
localeKey: translatesLocaleKey,
|
|
19936
19936
|
locale: translates,
|
|
19937
|
-
testId:
|
|
19937
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "dates")
|
|
19938
19938
|
}, filter));
|
|
19939
19939
|
}
|
|
19940
19940
|
if (filter.type === "multiSelect") {
|
|
@@ -19945,7 +19945,7 @@
|
|
|
19945
19945
|
onClose,
|
|
19946
19946
|
localeKey: translatesLocaleKey,
|
|
19947
19947
|
locale: translates,
|
|
19948
|
-
testId:
|
|
19948
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "multiSelect")
|
|
19949
19949
|
}, filter));
|
|
19950
19950
|
}
|
|
19951
19951
|
if (filter.type === "interval") {
|
|
@@ -19956,19 +19956,19 @@
|
|
|
19956
19956
|
localeKey: translatesLocaleKey,
|
|
19957
19957
|
locale: translates,
|
|
19958
19958
|
labelName: filter.name,
|
|
19959
|
-
testId:
|
|
19959
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "interval")
|
|
19960
19960
|
}, filter));
|
|
19961
19961
|
}
|
|
19962
|
-
if (filter.type === "boolean") {
|
|
19963
|
-
return null;
|
|
19964
|
-
}
|
|
19965
19962
|
if (filter.type === "custom" && filter.component) {
|
|
19966
19963
|
var Component = filter.component;
|
|
19967
19964
|
return /* @__PURE__ */ jsx(Component, _object_spread_props$q(_object_spread$r({}, props), {
|
|
19968
|
-
filter
|
|
19965
|
+
filter,
|
|
19966
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "dropdown")
|
|
19969
19967
|
}));
|
|
19970
19968
|
}
|
|
19971
|
-
|
|
19969
|
+
if (filter.type !== "boolean") {
|
|
19970
|
+
console.warn("%cДля фильтра ".concat(filter.name, " не задан тип или component"), "background: red; color: black");
|
|
19971
|
+
}
|
|
19972
19972
|
return null;
|
|
19973
19973
|
}
|
|
19974
19974
|
var useStyles$o = createThemedStyles("FiltersPaneSearch", {
|
|
@@ -20222,17 +20222,11 @@
|
|
|
20222
20222
|
});
|
|
20223
20223
|
setIsOpen(false);
|
|
20224
20224
|
};
|
|
20225
|
-
var selectedFieldLabel = React.useMemo(function() {
|
|
20226
|
-
return field !== void 0 && getValueView !== void 0 ? getValueView(field) : void 0;
|
|
20227
|
-
}, [
|
|
20228
|
-
field
|
|
20229
|
-
]);
|
|
20230
20225
|
var _obj2;
|
|
20231
20226
|
return /* @__PURE__ */ jsxs("div", _object_spread_props$p(_object_spread$q({
|
|
20232
20227
|
className: clsx(classes.root, (_obj2 = {}, _define_property$r(_obj2, classes.focused, isInputFocused), _define_property$r(_obj2, classes.disabled, isDisabled), _obj2)),
|
|
20233
|
-
ref: refRoot
|
|
20234
|
-
|
|
20235
|
-
}, addDataAttributes(data)), {
|
|
20228
|
+
ref: refRoot
|
|
20229
|
+
}, trueReactPlatformHelpers.addDataAttributes(data, testId)), {
|
|
20236
20230
|
children: [
|
|
20237
20231
|
/* @__PURE__ */ jsx(SearchInput, {
|
|
20238
20232
|
value,
|
|
@@ -20245,23 +20239,23 @@
|
|
|
20245
20239
|
onBlur: function() {
|
|
20246
20240
|
return setIsInputFocused(false);
|
|
20247
20241
|
},
|
|
20248
|
-
testId:
|
|
20242
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "input"),
|
|
20249
20243
|
maxLength,
|
|
20250
20244
|
isDisabled
|
|
20251
20245
|
}),
|
|
20252
20246
|
/* @__PURE__ */ jsxs("div", {
|
|
20253
20247
|
className: classes.selectWrapper,
|
|
20254
20248
|
children: [
|
|
20255
|
-
fields.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
20249
|
+
fields.length > 0 && /* @__PURE__ */ jsxs("div", _object_spread_props$p(_object_spread$q({
|
|
20256
20250
|
className: classes.selectBlock,
|
|
20257
20251
|
onClick: !isDisabled ? function() {
|
|
20258
20252
|
return setIsOpen(!isOpen);
|
|
20259
|
-
} : void 0
|
|
20260
|
-
|
|
20253
|
+
} : void 0
|
|
20254
|
+
}, trueReactPlatformHelpers.addDataTestId(testId, "select")), {
|
|
20261
20255
|
children: [
|
|
20262
20256
|
/* @__PURE__ */ jsx("div", {
|
|
20263
|
-
className: clsx(classes.selectLabel,
|
|
20264
|
-
children:
|
|
20257
|
+
className: clsx(classes.selectLabel, _define_property$r({}, classes.active, trueReactPlatformHelpers.isNotEmpty(field))),
|
|
20258
|
+
children: trueReactPlatformHelpers.isNotEmpty(field) ? getValueView === null || getValueView === void 0 ? void 0 : getValueView(field) : translates.displayedFields
|
|
20265
20259
|
}),
|
|
20266
20260
|
/* @__PURE__ */ jsx("div", {
|
|
20267
20261
|
className: clsx(classes.chevronIcon, isOpen && classes.open),
|
|
@@ -20270,7 +20264,7 @@
|
|
|
20270
20264
|
})
|
|
20271
20265
|
})
|
|
20272
20266
|
]
|
|
20273
|
-
}),
|
|
20267
|
+
})),
|
|
20274
20268
|
isOpen && /* @__PURE__ */ jsx("div", {
|
|
20275
20269
|
className: classes.dropdown,
|
|
20276
20270
|
children: /* @__PURE__ */ jsx(FilterSelect, {
|
|
@@ -20285,7 +20279,7 @@
|
|
|
20285
20279
|
onChange: handleFieldsChange,
|
|
20286
20280
|
isSearchEnabled: isSelectSearchEnabled,
|
|
20287
20281
|
hasClearButton: hasClearSelectButton,
|
|
20288
|
-
testId:
|
|
20282
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "dropdown")
|
|
20289
20283
|
})
|
|
20290
20284
|
})
|
|
20291
20285
|
]
|
|
@@ -20670,7 +20664,7 @@
|
|
|
20670
20664
|
var _obj2;
|
|
20671
20665
|
return /* @__PURE__ */ jsx("div", _object_spread_props$o(_object_spread$p({
|
|
20672
20666
|
className: clsx(classes.root, (_obj2 = {}, _define_property$q(_obj2, classes.noValue, !hasValue), _define_property$q(_obj2, classes.openNoValue, isActive && !hasValue), _define_property$q(_obj2, classes.withValue, !isActive && hasValue), _define_property$q(_obj2, classes.openWithValue, isActive && hasValue), _define_property$q(_obj2, classes.boolean, isBoolean), _define_property$q(_obj2, classes.disabled, isDisabled), _obj2))
|
|
20673
|
-
}, trueReactPlatformHelpers.
|
|
20667
|
+
}, trueReactPlatformHelpers.addDataAttributes(data, testId), referenceProps), {
|
|
20674
20668
|
children: /* @__PURE__ */ jsxs("div", {
|
|
20675
20669
|
onClick: handleLabelClick,
|
|
20676
20670
|
className: clsx(classes.item, _define_property$q({}, classes.booleanItem, isBoolean)),
|
|
@@ -20679,7 +20673,7 @@
|
|
|
20679
20673
|
className: classes.name,
|
|
20680
20674
|
children: filter.name
|
|
20681
20675
|
}),
|
|
20682
|
-
!isBoolean && value
|
|
20676
|
+
!isBoolean && trueReactPlatformHelpers.isNotEmpty(value) && /* @__PURE__ */ jsx("div", {
|
|
20683
20677
|
className: classes.value,
|
|
20684
20678
|
children: /* @__PURE__ */ jsx(FilterValueView, {
|
|
20685
20679
|
value,
|
|
@@ -20797,7 +20791,7 @@
|
|
|
20797
20791
|
]);
|
|
20798
20792
|
var filtersKeys = enabledFilters !== null && enabledFilters !== void 0 ? enabledFilters : Object.keys(filtersConfig);
|
|
20799
20793
|
var handleClear = function() {
|
|
20800
|
-
if (onClear
|
|
20794
|
+
if (trueReactPlatformHelpers.isNotEmpty(onClear)) {
|
|
20801
20795
|
onClear();
|
|
20802
20796
|
return;
|
|
20803
20797
|
}
|
|
@@ -20806,9 +20800,9 @@
|
|
|
20806
20800
|
search.onChange({});
|
|
20807
20801
|
}
|
|
20808
20802
|
};
|
|
20809
|
-
var shouldShowClearButton = hasClearButton && (search
|
|
20810
|
-
return filtersConfig[key]
|
|
20811
|
-
})
|
|
20803
|
+
var shouldShowClearButton = hasClearButton && (trueReactPlatformHelpers.isNotEmpty(search) || filtersKeys.some(function(key) {
|
|
20804
|
+
return trueReactPlatformHelpers.isNotEmpty(filtersConfig[key]);
|
|
20805
|
+
}));
|
|
20812
20806
|
var clearButton = /* @__PURE__ */ jsx("div", {
|
|
20813
20807
|
className: classes.clear,
|
|
20814
20808
|
children: /* @__PURE__ */ jsx(Button, {
|
|
@@ -20824,7 +20818,7 @@
|
|
|
20824
20818
|
var _search_localeKey, _search_localeKey1, _search_isDisabled;
|
|
20825
20819
|
return /* @__PURE__ */ jsxs("div", _object_spread_props$n(_object_spread$o({
|
|
20826
20820
|
className: classes.root
|
|
20827
|
-
}, trueReactPlatformHelpers.
|
|
20821
|
+
}, trueReactPlatformHelpers.addDataAttributes(data, testId)), {
|
|
20828
20822
|
children: [
|
|
20829
20823
|
onSettingsButtonClick !== void 0 && /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$o({
|
|
20830
20824
|
className: classes.settings,
|