@deviceinsight/ng-ui-components 7.10.0 → 7.11.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.cjs
CHANGED
|
@@ -1595,6 +1595,7 @@ class SelectWithSearch extends React.Component {
|
|
|
1595
1595
|
render() {
|
|
1596
1596
|
const { noResultsMessage, placeholder, value, onChange, clearable, loading, disabled } = this.props;
|
|
1597
1597
|
const { options } = this.state;
|
|
1598
|
+
const dataTestId = this.props["data-testid"];
|
|
1598
1599
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1599
1600
|
Select,
|
|
1600
1601
|
{
|
|
@@ -1618,6 +1619,7 @@ class SelectWithSearch extends React.Component {
|
|
|
1618
1619
|
isLoading: loading,
|
|
1619
1620
|
menuPortalTarget: this.portalRoot,
|
|
1620
1621
|
isDisabled: disabled,
|
|
1622
|
+
formatOptionLabel: dataTestId ? (option) => /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": `${dataTestId}-option-${option.label}`, children: option.label }) : void 0,
|
|
1621
1623
|
onBlur: () => {
|
|
1622
1624
|
if (this.props.freeForm && this.state.inputValue !== null) {
|
|
1623
1625
|
this.setState({ options: this.props.options });
|
|
@@ -2766,6 +2768,7 @@ class SelectWithSearchAsync extends React.Component {
|
|
|
2766
2768
|
render() {
|
|
2767
2769
|
const { clearable, noResultsMessage, disabled, menuPortalTarget } = this.props;
|
|
2768
2770
|
const { currentItem } = this.state;
|
|
2771
|
+
const dataTestId = this.props["data-testid"];
|
|
2769
2772
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2770
2773
|
reactSelectAsyncPaginate.AsyncPaginate,
|
|
2771
2774
|
{
|
|
@@ -2779,7 +2782,8 @@ class SelectWithSearchAsync extends React.Component {
|
|
|
2779
2782
|
loadOptions: this.fetchOptions,
|
|
2780
2783
|
isDisabled: disabled,
|
|
2781
2784
|
menuPortalTarget,
|
|
2782
|
-
placeholder: this.props.placeholder
|
|
2785
|
+
placeholder: this.props.placeholder,
|
|
2786
|
+
formatOptionLabel: dataTestId ? (option) => /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": `${dataTestId}-option-${option.label}`, children: option.label }) : void 0
|
|
2783
2787
|
}
|
|
2784
2788
|
);
|
|
2785
2789
|
}
|