@trackunit/react-form-components 0.0.272 → 0.0.273

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/index.cjs.js CHANGED
@@ -1072,7 +1072,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix, disabled
1072
1072
  return (jsxRuntime.jsx(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: "inline-flex shrink-0", onClose: e => {
1073
1073
  e.stopPropagation();
1074
1074
  item.onClick();
1075
- }, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, disabled: disabled, children: item.text }, item.text + index));
1075
+ }, color: item.disabled ? "unknown" : "primary", dataTestId: `${item.text}-tag`, disabled: disabled, children: item.text }, item.text + index));
1076
1076
  }
1077
1077
  const fromTheItems = item.text !== "";
1078
1078
  if (fromTheItems) {
@@ -1133,8 +1133,8 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
1133
1133
  e.stopPropagation();
1134
1134
  refMenuIsEnabled.current = false;
1135
1135
  ((_a = tagProps === null || tagProps === void 0 ? void 0 : tagProps.removeProps) === null || _a === void 0 ? void 0 : _a.onClick) && ((_b = tagProps === null || tagProps === void 0 ? void 0 : tagProps.removeProps) === null || _b === void 0 ? void 0 : _b.onClick(e));
1136
- }, color: disabled ? "unknown" : "primary", dataTestId: (_a = tagProps.children) === null || _a === void 0 ? void 0 : _a.toString(), children: tagProps.children }, (_b = tagProps.children) === null || _b === void 0 ? void 0 : _b.toString()));
1137
- }), tags && tags.length > maxSelectedDisplayCount && (jsxRuntime.jsxs(reactComponents.Tag, { color: "neutral", dataTestId: "counter", children: ["+", tags.length - maxSelectedDisplayCount] })), searchInput] })) })));
1136
+ }, color: disabled ? "unknown" : "primary", dataTestId: tagProps.children ? `${(_a = tagProps.children) === null || _a === void 0 ? void 0 : _a.toString()}-tag` : undefined, children: tagProps.children }, (_b = tagProps.children) === null || _b === void 0 ? void 0 : _b.toString()));
1137
+ }), tags && tags.length > maxSelectedDisplayCount && (jsxRuntime.jsxs(reactComponents.Tag, { color: "neutral", dataTestId: "counter-tag", children: ["+", tags.length - maxSelectedDisplayCount] })), searchInput] })) })));
1138
1138
  }
1139
1139
  return (jsxRuntime.jsx(ReactSelect.components.ValueContainer, Object.assign({}, props, { isDisabled: props.selectProps.isDisabled, children: props.children })));
1140
1140
  }, LoadingIndicator: props => {
package/index.esm.js CHANGED
@@ -1042,7 +1042,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix, disabled
1042
1042
  return (jsx(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: "inline-flex shrink-0", onClose: e => {
1043
1043
  e.stopPropagation();
1044
1044
  item.onClick();
1045
- }, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, disabled: disabled, children: item.text }, item.text + index));
1045
+ }, color: item.disabled ? "unknown" : "primary", dataTestId: `${item.text}-tag`, disabled: disabled, children: item.text }, item.text + index));
1046
1046
  }
1047
1047
  const fromTheItems = item.text !== "";
1048
1048
  if (fromTheItems) {
@@ -1103,8 +1103,8 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
1103
1103
  e.stopPropagation();
1104
1104
  refMenuIsEnabled.current = false;
1105
1105
  ((_a = tagProps === null || tagProps === void 0 ? void 0 : tagProps.removeProps) === null || _a === void 0 ? void 0 : _a.onClick) && ((_b = tagProps === null || tagProps === void 0 ? void 0 : tagProps.removeProps) === null || _b === void 0 ? void 0 : _b.onClick(e));
1106
- }, color: disabled ? "unknown" : "primary", dataTestId: (_a = tagProps.children) === null || _a === void 0 ? void 0 : _a.toString(), children: tagProps.children }, (_b = tagProps.children) === null || _b === void 0 ? void 0 : _b.toString()));
1107
- }), tags && tags.length > maxSelectedDisplayCount && (jsxs(Tag, { color: "neutral", dataTestId: "counter", children: ["+", tags.length - maxSelectedDisplayCount] })), searchInput] })) })));
1106
+ }, color: disabled ? "unknown" : "primary", dataTestId: tagProps.children ? `${(_a = tagProps.children) === null || _a === void 0 ? void 0 : _a.toString()}-tag` : undefined, children: tagProps.children }, (_b = tagProps.children) === null || _b === void 0 ? void 0 : _b.toString()));
1107
+ }), tags && tags.length > maxSelectedDisplayCount && (jsxs(Tag, { color: "neutral", dataTestId: "counter-tag", children: ["+", tags.length - maxSelectedDisplayCount] })), searchInput] })) })));
1108
1108
  }
1109
1109
  return (jsx(components.ValueContainer, Object.assign({}, props, { isDisabled: props.selectProps.isDisabled, children: props.children })));
1110
1110
  }, LoadingIndicator: props => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "0.0.272",
3
+ "version": "0.0.273",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { GroupBase } from "react-select";
3
3
  import { SelectProps } from "./useSelect";
4
- export interface SelectOption<T extends string> {
4
+ export interface SelectOption<T extends string | number> {
5
5
  label: string;
6
6
  value: T;
7
7
  disabled?: boolean;