@trackunit/react-form-components 1.7.0 → 1.7.1

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
@@ -2192,6 +2192,13 @@ const useCustomComponents = ({ componentsProps, disabled, readOnly, setMenuIsEna
2192
2192
  const tags = key === PLACEHOLDER_KEY ? [] : values;
2193
2193
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
2194
2194
  const searchInput = props && props.children && props.children[1];
2195
+ const placeholderElement = Array.isArray(props.children)
2196
+ ? props.children.find(child => child && child.key === "placeholder")
2197
+ : null;
2198
+ const shouldShowPlaceholder = !!placeholderElement && tags?.length === 0;
2199
+ if (shouldShowPlaceholder) {
2200
+ return (jsxRuntime.jsx(ReactSelect.components.ValueContainer, { ...props, isDisabled: props.selectProps.isDisabled, children: props.children }));
2201
+ }
2195
2202
  return (jsxRuntime.jsx(ReactSelect.components.ValueContainer, { ...props, isDisabled: props.selectProps.isDisabled, children: maxSelectedDisplayCount === undefined ? (jsxRuntime.jsx(TagsContainer, { disabled: disabled, items: tags
2196
2203
  ? tags.map(({ props: tagProps }) => {
2197
2204
  return {
package/index.esm.js CHANGED
@@ -2191,6 +2191,13 @@ const useCustomComponents = ({ componentsProps, disabled, readOnly, setMenuIsEna
2191
2191
  const tags = key === PLACEHOLDER_KEY ? [] : values;
2192
2192
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
2193
2193
  const searchInput = props && props.children && props.children[1];
2194
+ const placeholderElement = Array.isArray(props.children)
2195
+ ? props.children.find(child => child && child.key === "placeholder")
2196
+ : null;
2197
+ const shouldShowPlaceholder = !!placeholderElement && tags?.length === 0;
2198
+ if (shouldShowPlaceholder) {
2199
+ return (jsx(components.ValueContainer, { ...props, isDisabled: props.selectProps.isDisabled, children: props.children }));
2200
+ }
2194
2201
  return (jsx(components.ValueContainer, { ...props, isDisabled: props.selectProps.isDisabled, children: maxSelectedDisplayCount === undefined ? (jsx(TagsContainer, { disabled: disabled, items: tags
2195
2202
  ? tags.map(({ props: tagProps }) => {
2196
2203
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -18,7 +18,7 @@
18
18
  "react-hook-form": "7.62.0",
19
19
  "tailwind-merge": "^2.0.0",
20
20
  "@trackunit/css-class-variance-utilities": "1.6.23",
21
- "@trackunit/react-components": "1.7.31",
21
+ "@trackunit/react-components": "1.7.32",
22
22
  "@trackunit/ui-icons": "1.6.22",
23
23
  "@trackunit/shared-utils": "1.8.23",
24
24
  "@trackunit/ui-design-tokens": "1.6.24",