sag_components 2.0.0-beta145 → 2.0.0-beta146
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.d.ts +2 -1
- package/dist/index.esm.js +15 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/types/components/ItemManagerPanel/ItemManagerPanel.d.ts +2 -1
- package/dist/types/components/ItemManagerPanel/SuccessScreen/SuccessScreen.d.ts +2 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1509,7 +1509,7 @@ declare function RangePop(props: any): react_jsx_runtime.JSX.Element;
|
|
|
1509
1509
|
|
|
1510
1510
|
declare function SearchInput(props: any): react_jsx_runtime.JSX.Element;
|
|
1511
1511
|
|
|
1512
|
-
declare function ItemManagerPanel({ width, height, disableSection, onSendForms, editMode, disabledSendForms, AllFormsSent, itemAndPackage, setItemAndPackage, linkColor, backgroundColor, buttonTooltipText, }: {
|
|
1512
|
+
declare function ItemManagerPanel({ width, height, disableSection, onSendForms, editMode, disabledSendForms, AllFormsSent, itemAndPackage, setItemAndPackage, linkColor, backgroundColor, buttonTooltipText, maxVisibleVendors }: {
|
|
1513
1513
|
width?: string;
|
|
1514
1514
|
height?: string;
|
|
1515
1515
|
disableSection?: boolean;
|
|
@@ -1522,6 +1522,7 @@ declare function ItemManagerPanel({ width, height, disableSection, onSendForms,
|
|
|
1522
1522
|
linkColor?: string;
|
|
1523
1523
|
backgroundColor?: string;
|
|
1524
1524
|
buttonTooltipText?: string;
|
|
1525
|
+
maxVisibleVendors?: number;
|
|
1525
1526
|
}): react_jsx_runtime.JSX.Element;
|
|
1526
1527
|
|
|
1527
1528
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -43452,6 +43452,7 @@ const Tooltip = styled.div`
|
|
|
43452
43452
|
z-index: 10;
|
|
43453
43453
|
white-space: nowrap;
|
|
43454
43454
|
transition: opacity 0.2s;
|
|
43455
|
+
max-height: 600px;
|
|
43455
43456
|
|
|
43456
43457
|
&::after {
|
|
43457
43458
|
content: '';
|
|
@@ -43469,7 +43470,6 @@ const ExpandButtonWrapper = styled.div`
|
|
|
43469
43470
|
display: flex;
|
|
43470
43471
|
justify-content: center;
|
|
43471
43472
|
align-items: center;
|
|
43472
|
-
|
|
43473
43473
|
&:hover ${Tooltip},
|
|
43474
43474
|
&:focus-within ${Tooltip} {
|
|
43475
43475
|
visibility: visible;
|
|
@@ -51830,14 +51830,20 @@ var successAnimation = {
|
|
|
51830
51830
|
};
|
|
51831
51831
|
|
|
51832
51832
|
const SAMPLE_VENDORS = ["Colgate-Palmolive", "Unilever", "P&G", "Kellog’s", "Coca-Cola Company", "Pepsico", "Colgate-Palmolive", "Unilever", "P&G", "Kellog’s", "Coca-Cola Company", "Pepsico", "Colgate-Palmolive", "Unilever", "P&G", "Kellog’s", "Coca-Cola Company", "Pepsico"];
|
|
51833
|
-
const COLLAPSED_COUNT = 7;
|
|
51834
51833
|
const SuccessScreen = ({
|
|
51835
51834
|
width = "100%",
|
|
51836
51835
|
height = "100%",
|
|
51837
51836
|
packagesCount = 7,
|
|
51838
51837
|
vendorsCount = 3,
|
|
51839
|
-
vendors = SAMPLE_VENDORS
|
|
51838
|
+
vendors = SAMPLE_VENDORS,
|
|
51839
|
+
maxVisibleVendors = 12
|
|
51840
51840
|
}) => {
|
|
51841
|
+
const [visibleCount, setVisibleCount] = useState(() => Math.min(vendors.length, maxVisibleVendors));
|
|
51842
|
+
useEffect(() => {
|
|
51843
|
+
const count = Math.min(maxVisibleVendors, vendors.length);
|
|
51844
|
+
setVisibleCount(count);
|
|
51845
|
+
}, [vendors, maxVisibleVendors]);
|
|
51846
|
+
const hiddenVendors = vendors.slice(visibleCount);
|
|
51841
51847
|
return /*#__PURE__*/React$1.createElement(SuccessScreenContainer, {
|
|
51842
51848
|
width: width,
|
|
51843
51849
|
height: height
|
|
@@ -51848,9 +51854,9 @@ const SuccessScreen = ({
|
|
|
51848
51854
|
},
|
|
51849
51855
|
animationData: successAnimation,
|
|
51850
51856
|
loop: false
|
|
51851
|
-
})), /*#__PURE__*/React$1.createElement(SuccessHeader, null, /*#__PURE__*/React$1.createElement(SuccessTitle, null, "Packages", /*#__PURE__*/React$1.createElement("br", null), " Successfully Sent"), /*#__PURE__*/React$1.createElement(SuccessSubtitle, null, /*#__PURE__*/React$1.createElement("b", null, packagesCount), " packages have been sent to", " ", /*#__PURE__*/React$1.createElement("b", null, vendorsCount), " vendors")), /*#__PURE__*/React$1.createElement(DividerLine, null), /*#__PURE__*/React$1.createElement(VendorListWrapper, null, /*#__PURE__*/React$1.createElement(VendorList, null, vendors.slice(0,
|
|
51857
|
+
})), /*#__PURE__*/React$1.createElement(SuccessHeader, null, /*#__PURE__*/React$1.createElement(SuccessTitle, null, "Packages", /*#__PURE__*/React$1.createElement("br", null), " Successfully Sent"), /*#__PURE__*/React$1.createElement(SuccessSubtitle, null, /*#__PURE__*/React$1.createElement("b", null, packagesCount), " packages have been sent to", " ", /*#__PURE__*/React$1.createElement("b", null, vendorsCount), " vendors")), /*#__PURE__*/React$1.createElement(DividerLine, null), /*#__PURE__*/React$1.createElement(VendorListWrapper, null, /*#__PURE__*/React$1.createElement(VendorList, null, vendors.slice(0, visibleCount).map((vendor, idx) => /*#__PURE__*/React$1.createElement(VendorListItem, {
|
|
51852
51858
|
key: idx
|
|
51853
|
-
}, vendor))), /*#__PURE__*/React$1.createElement(ExpandButtonWrapper, null, /*#__PURE__*/React$1.createElement(ExpandButton, {
|
|
51859
|
+
}, vendor))), hiddenVendors.length > 0 && /*#__PURE__*/React$1.createElement(ExpandButtonWrapper, null, /*#__PURE__*/React$1.createElement(ExpandButton, {
|
|
51854
51860
|
tabIndex: 0
|
|
51855
51861
|
}, "\u2022\u2022\u2022"), /*#__PURE__*/React$1.createElement(Tooltip, null, vendors.map((vendor, idx) => /*#__PURE__*/React$1.createElement(React$1.Fragment, {
|
|
51856
51862
|
key: idx
|
|
@@ -51870,7 +51876,8 @@ const ItemManagerPanel = _ref => {
|
|
|
51870
51876
|
setItemAndPackage,
|
|
51871
51877
|
linkColor = "#212121",
|
|
51872
51878
|
backgroundColor = 'white',
|
|
51873
|
-
buttonTooltipText = "Please fill out all forms before sending."
|
|
51879
|
+
buttonTooltipText = "Please fill out all forms before sending.",
|
|
51880
|
+
maxVisibleVendors = 12
|
|
51874
51881
|
} = _ref;
|
|
51875
51882
|
const [screen, setScreen] = useState("initial");
|
|
51876
51883
|
const [selectedVendor, setSelectedVendor] = useState(null);
|
|
@@ -52025,7 +52032,8 @@ const ItemManagerPanel = _ref => {
|
|
|
52025
52032
|
height: height,
|
|
52026
52033
|
packagesCount: itemAndPackage.filter(item => item.packages !== null).reduce((acc, item) => acc + (item.packages ? item.packages.length : 0), 0),
|
|
52027
52034
|
vendorsCount: itemAndPackage.filter(item => item.packages !== null).length.toString(),
|
|
52028
|
-
vendors: itemAndPackage.filter(item => item.packages !== null).map(item => item.name)
|
|
52035
|
+
vendors: itemAndPackage.filter(item => item.packages !== null).map(item => item.name),
|
|
52036
|
+
maxVisibleVendors: maxVisibleVendors
|
|
52029
52037
|
});
|
|
52030
52038
|
}
|
|
52031
52039
|
if (screen === "subitemdetail") {
|