@true-engineering/true-react-common-ui-kit 4.0.0-alpha26 → 4.0.0-alpha27
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/Select/components/SelectListItem/SelectListItem.d.ts +2 -1
- package/dist/true-react-common-ui-kit.js +26 -19
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +26 -19
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +22 -23
- package/src/components/Select/components/SelectList/SelectList.tsx +3 -1
- package/src/components/Select/components/SelectListItem/SelectListItem.tsx +5 -2
|
@@ -11461,7 +11461,7 @@
|
|
|
11461
11461
|
return target;
|
|
11462
11462
|
}
|
|
11463
11463
|
var SelectListItem = function(param) {
|
|
11464
|
-
var classes = param.classes, index = param.index, isSemiChecked = param.isSemiChecked, isDisabled = param.isDisabled, isActive = param.isActive, children = param.children, isFocused = param.isFocused, isMultiSelect = param.isMultiSelect, onOptionSelect = param.onOptionSelect, onToggleCheckbox = param.onToggleCheckbox;
|
|
11464
|
+
var classes = param.classes, index = param.index, isSemiChecked = param.isSemiChecked, isDisabled = param.isDisabled, isActive = param.isActive, children = param.children, isFocused = param.isFocused, isMultiSelect = param.isMultiSelect, data = param.data, onOptionSelect = param.onOptionSelect, onToggleCheckbox = param.onToggleCheckbox;
|
|
11465
11465
|
var multiSelectContent = isMultiSelect && /* @__PURE__ */ jsx(Checkbox, {
|
|
11466
11466
|
isChecked: isActive || isSemiChecked,
|
|
11467
11467
|
isSemiChecked,
|
|
@@ -11480,11 +11480,11 @@
|
|
|
11480
11480
|
block: "nearest"
|
|
11481
11481
|
},
|
|
11482
11482
|
className: clsx(classes.cell, (_obj2 = {}, _define_property$N(_obj2, classes.cellWithCheckbox, isMultiSelect), _define_property$N(_obj2, classes.focused, isFocused), _define_property$N(_obj2, classes.active, isActive && !isMultiSelect), _define_property$N(_obj2, classes.disabled, isDisabled), _obj2))
|
|
11483
|
-
}, addDataAttributes({
|
|
11483
|
+
}, trueReactPlatformHelpers.addDataAttributes(_object_spread$L({
|
|
11484
11484
|
disabled: isDisabled,
|
|
11485
11485
|
active: isActive,
|
|
11486
11486
|
focused: isFocused
|
|
11487
|
-
})), {
|
|
11487
|
+
}, data))), {
|
|
11488
11488
|
onClick: !isDisabled && !isMultiSelect ? function(event) {
|
|
11489
11489
|
return onOptionSelect(index, event);
|
|
11490
11490
|
} : void 0,
|
|
@@ -11613,8 +11613,9 @@
|
|
|
11613
11613
|
}),
|
|
11614
11614
|
listOptions.map(function(opt, i) {
|
|
11615
11615
|
var optionValue = options[i];
|
|
11616
|
+
var id = convertValueToId(optionValue);
|
|
11616
11617
|
var isFocused = focusedIndex === i;
|
|
11617
|
-
var isActive = activeOptionsIds.has(
|
|
11618
|
+
var isActive = activeOptionsIds.has(id);
|
|
11618
11619
|
var isDisabled = optionsDisableMap[i];
|
|
11619
11620
|
return /* @__PURE__ */ jsx(SelectListItem, {
|
|
11620
11621
|
classes,
|
|
@@ -11625,6 +11626,9 @@
|
|
|
11625
11626
|
isMultiSelect,
|
|
11626
11627
|
onOptionSelect,
|
|
11627
11628
|
onToggleCheckbox,
|
|
11629
|
+
data: {
|
|
11630
|
+
id
|
|
11631
|
+
},
|
|
11628
11632
|
children: opt
|
|
11629
11633
|
}, i);
|
|
11630
11634
|
}),
|
|
@@ -19064,7 +19068,7 @@
|
|
|
19064
19068
|
}, []);
|
|
19065
19069
|
return /* @__PURE__ */ jsxs("div", _object_spread_props$t(_object_spread$u({
|
|
19066
19070
|
className: classes.root
|
|
19067
|
-
}, addDataAttributes(data)), {
|
|
19071
|
+
}, trueReactPlatformHelpers.addDataAttributes(data, testId)), {
|
|
19068
19072
|
children: [
|
|
19069
19073
|
isSearchEnabled && /* @__PURE__ */ jsx("div", {
|
|
19070
19074
|
className: classes.dropdownInput,
|
|
@@ -19073,20 +19077,20 @@
|
|
|
19073
19077
|
placeholder: translates.searchPlaceholder,
|
|
19074
19078
|
onChange: handleOnChange,
|
|
19075
19079
|
tweakStyles: tweakSearchInputStyles,
|
|
19076
|
-
testId:
|
|
19080
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "search"),
|
|
19077
19081
|
shouldFocusOnMount: true
|
|
19078
19082
|
})
|
|
19079
19083
|
}),
|
|
19080
19084
|
!isLoading && /* @__PURE__ */ jsxs(Fragment, {
|
|
19081
19085
|
children: [
|
|
19082
|
-
allOptions
|
|
19083
|
-
className: clsx(classes.list,
|
|
19084
|
-
|
|
19086
|
+
trueReactPlatformHelpers.isArrayNotEmpty(allOptions) && /* @__PURE__ */ jsxs("div", _object_spread_props$t(_object_spread$u({
|
|
19087
|
+
className: clsx(classes.list, _define_property$v({}, classes.withClearButton, hasClearButton))
|
|
19088
|
+
}, trueReactPlatformHelpers.addDataTestId(testId, "list")), {
|
|
19085
19089
|
children: [
|
|
19086
|
-
isGroupingEnabled && value
|
|
19090
|
+
isGroupingEnabled && trueReactPlatformHelpers.isNotEmpty(value) && /* @__PURE__ */ jsxs(Fragment, {
|
|
19087
19091
|
children: [
|
|
19088
19092
|
/* @__PURE__ */ jsx("div", {
|
|
19089
|
-
className: clsx(classes.label, classes.labelChosen,
|
|
19093
|
+
className: clsx(classes.label, classes.labelChosen, _define_property$v({}, classes.withoutTopGap, !isSearchEnabled)),
|
|
19090
19094
|
children: translates.chosen
|
|
19091
19095
|
}),
|
|
19092
19096
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -19114,7 +19118,7 @@
|
|
|
19114
19118
|
]
|
|
19115
19119
|
}),
|
|
19116
19120
|
allOptions.map(function(item, index) {
|
|
19117
|
-
var isActive = value
|
|
19121
|
+
var isActive = trueReactPlatformHelpers.isNotEmpty(value) && getValueId(value) === getValueId(item);
|
|
19118
19122
|
if (isGroupingEnabled && isActive) {
|
|
19119
19123
|
return null;
|
|
19120
19124
|
}
|
|
@@ -19127,11 +19131,14 @@
|
|
|
19127
19131
|
return handleChange(item);
|
|
19128
19132
|
},
|
|
19129
19133
|
children: [
|
|
19130
|
-
/* @__PURE__ */ jsx("div", {
|
|
19131
|
-
className: classes.option
|
|
19132
|
-
|
|
19134
|
+
/* @__PURE__ */ jsx("div", _object_spread_props$t(_object_spread$u({
|
|
19135
|
+
className: classes.option
|
|
19136
|
+
}, trueReactPlatformHelpers.addDataAttributes({
|
|
19137
|
+
id,
|
|
19138
|
+
option: id
|
|
19139
|
+
})), {
|
|
19133
19140
|
children: view
|
|
19134
|
-
}),
|
|
19141
|
+
})),
|
|
19135
19142
|
isActive && /* @__PURE__ */ jsx("div", {
|
|
19136
19143
|
className: classes.icon,
|
|
19137
19144
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
@@ -19150,14 +19157,14 @@
|
|
|
19150
19157
|
}
|
|
19151
19158
|
})
|
|
19152
19159
|
]
|
|
19153
|
-
}),
|
|
19160
|
+
})),
|
|
19154
19161
|
shouldShowPreloader && /* @__PURE__ */ jsx("div", {
|
|
19155
19162
|
className: classes.preloader,
|
|
19156
19163
|
children: /* @__PURE__ */ jsx(ThemedPreloader, {
|
|
19157
19164
|
type: "dots"
|
|
19158
19165
|
})
|
|
19159
19166
|
}),
|
|
19160
|
-
allOptions
|
|
19167
|
+
!trueReactPlatformHelpers.isArrayNotEmpty(allOptions) && /* @__PURE__ */ jsx("div", {
|
|
19161
19168
|
className: classes.nothingFound,
|
|
19162
19169
|
children: translates.nothingFound
|
|
19163
19170
|
}),
|
|
@@ -19174,7 +19181,7 @@
|
|
|
19174
19181
|
onClick: handleClear,
|
|
19175
19182
|
size: "s",
|
|
19176
19183
|
view: "text",
|
|
19177
|
-
testId:
|
|
19184
|
+
testId: trueReactPlatformHelpers.getTestId(testId, "clear-button"),
|
|
19178
19185
|
tweakStyles: tweakClearButtonStyles,
|
|
19179
19186
|
children: translates.clear
|
|
19180
19187
|
})
|