@deviceinsight/ng-ui-components 7.10.0 → 7.12.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/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { HexColorPicker, RgbaStringColorPicker, RgbStringColorPicker } from "rea
|
|
|
10
10
|
import timezone from "dayjs/plugin/timezone";
|
|
11
11
|
import utc from "dayjs/plugin/utc";
|
|
12
12
|
import DatePicker, { registerLocale } from "react-datepicker";
|
|
13
|
-
import { debounce, isEqual, orderBy, uniqWith, difference } from "lodash";
|
|
13
|
+
import { debounce, isEqual, kebabCase, orderBy, uniqWith, difference } from "lodash";
|
|
14
14
|
import dayjs from "dayjs";
|
|
15
15
|
import localeData from "dayjs/plugin/localeData";
|
|
16
16
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
@@ -1576,6 +1576,7 @@ class SelectWithSearch extends Component {
|
|
|
1576
1576
|
render() {
|
|
1577
1577
|
const { noResultsMessage, placeholder, value, onChange, clearable, loading, disabled } = this.props;
|
|
1578
1578
|
const { options } = this.state;
|
|
1579
|
+
const dataTestId = this.props["data-testid"];
|
|
1579
1580
|
return /* @__PURE__ */ jsx(
|
|
1580
1581
|
Select,
|
|
1581
1582
|
{
|
|
@@ -1599,6 +1600,7 @@ class SelectWithSearch extends Component {
|
|
|
1599
1600
|
isLoading: loading,
|
|
1600
1601
|
menuPortalTarget: this.portalRoot,
|
|
1601
1602
|
isDisabled: disabled,
|
|
1603
|
+
formatOptionLabel: dataTestId ? (option) => /* @__PURE__ */ jsx("span", { "data-testid": `${dataTestId}-option-${kebabCase(option.label)}`, children: option.label }) : void 0,
|
|
1602
1604
|
onBlur: () => {
|
|
1603
1605
|
if (this.props.freeForm && this.state.inputValue !== null) {
|
|
1604
1606
|
this.setState({ options: this.props.options });
|
|
@@ -2747,6 +2749,7 @@ class SelectWithSearchAsync extends Component {
|
|
|
2747
2749
|
render() {
|
|
2748
2750
|
const { clearable, noResultsMessage, disabled, menuPortalTarget } = this.props;
|
|
2749
2751
|
const { currentItem } = this.state;
|
|
2752
|
+
const dataTestId = this.props["data-testid"];
|
|
2750
2753
|
return /* @__PURE__ */ jsx(
|
|
2751
2754
|
AsyncPaginate,
|
|
2752
2755
|
{
|
|
@@ -2760,7 +2763,8 @@ class SelectWithSearchAsync extends Component {
|
|
|
2760
2763
|
loadOptions: this.fetchOptions,
|
|
2761
2764
|
isDisabled: disabled,
|
|
2762
2765
|
menuPortalTarget,
|
|
2763
|
-
placeholder: this.props.placeholder
|
|
2766
|
+
placeholder: this.props.placeholder,
|
|
2767
|
+
formatOptionLabel: dataTestId ? (option) => /* @__PURE__ */ jsx("span", { "data-testid": `${dataTestId}-option-${kebabCase(option.label)}`, children: option.label }) : void 0
|
|
2764
2768
|
}
|
|
2765
2769
|
);
|
|
2766
2770
|
}
|