@trackunit/react-form-components 0.0.99 → 0.0.101-alpha-c88220cebc.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/index.cjs +4 -4
- package/index.js +4 -4
- package/package.json +5 -5
- package/src/components/Select/TagsContainer.d.ts +5 -1
package/index.cjs
CHANGED
|
@@ -13841,7 +13841,7 @@ const TagWithWidth = (_a) => {
|
|
|
13841
13841
|
* @param {TagsContainerProps} props - The props for the TagContainer
|
|
13842
13842
|
* @returns {JSX.Element} TagsContainer
|
|
13843
13843
|
*/
|
|
13844
|
-
const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix }) => {
|
|
13844
|
+
const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix, disabled }) => {
|
|
13845
13845
|
const [isReady, setIsReady] = React__default["default"].useState(false);
|
|
13846
13846
|
const [counterWidth, setCounterWidth] = React__default["default"].useState(0);
|
|
13847
13847
|
const containerRef = React__default["default"].useRef(null);
|
|
@@ -13872,7 +13872,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix }) => {
|
|
|
13872
13872
|
const isLast = index === items.length;
|
|
13873
13873
|
const counterRequired = requiredSpace > availableSpace && counter !== 0;
|
|
13874
13874
|
if (isLast && counterRequired) {
|
|
13875
|
-
return (jsxRuntime.jsx(TagWithWidth, { onWidthKnown: ({ width: reportedWidth }) => setCounterWidth(reportedWidth), color: "neutral", children: jsxRuntime.jsxs(Counter, { children: ["+", counter] }) }, item.text + index));
|
|
13875
|
+
return (jsxRuntime.jsx(TagWithWidth, { onWidthKnown: ({ width: reportedWidth }) => setCounterWidth(reportedWidth), color: "neutral", disabled: disabled, children: jsxRuntime.jsxs(Counter, { children: ["+", counter] }) }, item.text + index));
|
|
13876
13876
|
}
|
|
13877
13877
|
if (isLast) {
|
|
13878
13878
|
return null;
|
|
@@ -13882,7 +13882,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix }) => {
|
|
|
13882
13882
|
return (jsxRuntime.jsx(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: tailwindStyledComponents.tws `shrink-0 inline-flex`, onClose: e => {
|
|
13883
13883
|
e.stopPropagation();
|
|
13884
13884
|
item.onClick();
|
|
13885
|
-
}, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, children: item.text }, item.text + index));
|
|
13885
|
+
}, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, disabled: disabled, children: item.text }, item.text + index));
|
|
13886
13886
|
}
|
|
13887
13887
|
const fromTheItems = item.text !== "";
|
|
13888
13888
|
if (fromTheItems) {
|
|
@@ -13944,7 +13944,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
|
|
|
13944
13944
|
disabled: disabled,
|
|
13945
13945
|
};
|
|
13946
13946
|
})
|
|
13947
|
-
: [], postFix: searchInput })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [tags &&
|
|
13947
|
+
: [], postFix: searchInput, disabled: disabled })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [tags &&
|
|
13948
13948
|
tags.slice(0, maxSelectedDisplayCount).map(({ props: tagProps }) => {
|
|
13949
13949
|
var _a, _b;
|
|
13950
13950
|
return (jsxRuntime.jsx(reactComponents.Tag, { className: tailwindStyledComponents.tws `shrink-0 inline-flex`, onClose: e => {
|
package/index.js
CHANGED
|
@@ -13815,7 +13815,7 @@ const TagWithWidth = (_a) => {
|
|
|
13815
13815
|
* @param {TagsContainerProps} props - The props for the TagContainer
|
|
13816
13816
|
* @returns {JSX.Element} TagsContainer
|
|
13817
13817
|
*/
|
|
13818
|
-
const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix }) => {
|
|
13818
|
+
const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix, disabled }) => {
|
|
13819
13819
|
const [isReady, setIsReady] = React__default.useState(false);
|
|
13820
13820
|
const [counterWidth, setCounterWidth] = React__default.useState(0);
|
|
13821
13821
|
const containerRef = React__default.useRef(null);
|
|
@@ -13846,7 +13846,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix }) => {
|
|
|
13846
13846
|
const isLast = index === items.length;
|
|
13847
13847
|
const counterRequired = requiredSpace > availableSpace && counter !== 0;
|
|
13848
13848
|
if (isLast && counterRequired) {
|
|
13849
|
-
return (jsx$1(TagWithWidth, { onWidthKnown: ({ width: reportedWidth }) => setCounterWidth(reportedWidth), color: "neutral", children: jsxs(Counter, { children: ["+", counter] }) }, item.text + index));
|
|
13849
|
+
return (jsx$1(TagWithWidth, { onWidthKnown: ({ width: reportedWidth }) => setCounterWidth(reportedWidth), color: "neutral", disabled: disabled, children: jsxs(Counter, { children: ["+", counter] }) }, item.text + index));
|
|
13850
13850
|
}
|
|
13851
13851
|
if (isLast) {
|
|
13852
13852
|
return null;
|
|
@@ -13856,7 +13856,7 @@ const TagsContainer = ({ items, width = "100%", itemsGap = 5, postFix }) => {
|
|
|
13856
13856
|
return (jsx$1(TagWithWidth, { onWidthKnown: onWidthKnownHandler, className: tws `shrink-0 inline-flex`, onClose: e => {
|
|
13857
13857
|
e.stopPropagation();
|
|
13858
13858
|
item.onClick();
|
|
13859
|
-
}, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, children: item.text }, item.text + index));
|
|
13859
|
+
}, color: item.disabled ? "unknown" : "primary", dataTestId: item.text, disabled: disabled, children: item.text }, item.text + index));
|
|
13860
13860
|
}
|
|
13861
13861
|
const fromTheItems = item.text !== "";
|
|
13862
13862
|
if (fromTheItems) {
|
|
@@ -13918,7 +13918,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
|
|
|
13918
13918
|
disabled: disabled,
|
|
13919
13919
|
};
|
|
13920
13920
|
})
|
|
13921
|
-
: [], postFix: searchInput })) : (jsxs(Fragment$1, { children: [tags &&
|
|
13921
|
+
: [], postFix: searchInput, disabled: disabled })) : (jsxs(Fragment$1, { children: [tags &&
|
|
13922
13922
|
tags.slice(0, maxSelectedDisplayCount).map(({ props: tagProps }) => {
|
|
13923
13923
|
var _a, _b;
|
|
13924
13924
|
return (jsx$1(Tag, { className: tws `shrink-0 inline-flex`, onClose: e => {
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.101-alpha-c88220cebc.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/css-class-variance-utilities": "0.0.
|
|
11
|
-
"@trackunit/i18n-library-translation": "0.0.
|
|
12
|
-
"@trackunit/react-components": "0.1.
|
|
13
|
-
"@trackunit/tailwind-styled-components": "0.0.
|
|
10
|
+
"@trackunit/css-class-variance-utilities": "0.0.12-alpha-c88220cebc.0",
|
|
11
|
+
"@trackunit/i18n-library-translation": "0.0.68-alpha-c88220cebc.0",
|
|
12
|
+
"@trackunit/react-components": "0.1.138-alpha-c88220cebc.0",
|
|
13
|
+
"@trackunit/tailwind-styled-components": "0.0.61-alpha-c88220cebc.0",
|
|
14
14
|
"date-fns": "2.29.3",
|
|
15
15
|
"libphonenumber-js": "1.10.36",
|
|
16
16
|
"react": "18.2.0",
|
|
@@ -34,6 +34,10 @@ interface TagsContainerProps {
|
|
|
34
34
|
*/
|
|
35
35
|
itemsGap?: number;
|
|
36
36
|
postFix: JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* Is the parent dropdown disabled
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* TagsContainer component to display tags in limited space when children can't fit space it displays counter
|
|
@@ -41,5 +45,5 @@ interface TagsContainerProps {
|
|
|
41
45
|
* @param {TagsContainerProps} props - The props for the TagContainer
|
|
42
46
|
* @returns {JSX.Element} TagsContainer
|
|
43
47
|
*/
|
|
44
|
-
export declare const TagsContainer: ({ items, width, itemsGap, postFix }: TagsContainerProps) => JSX.Element;
|
|
48
|
+
export declare const TagsContainer: ({ items, width, itemsGap, postFix, disabled }: TagsContainerProps) => JSX.Element;
|
|
45
49
|
export {};
|