sag_components 2.0.0-beta117 → 2.0.0-beta119
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.esm.js +50 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +50 -31
- package/dist/index.js.map +1 -1
- package/dist/types/components/ItemManagerPanel/ItemManagerPanel.stories.d.ts +19 -9
- package/dist/types/components/ItemManagerPanel/ItemManagerPanel.style.d.ts +1 -0
- package/dist/types/components/ItemManagerPanel/NewItemList/NewItemList.style.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -41469,12 +41469,15 @@ styled.input`
|
|
|
41469
41469
|
font-size: 15px;
|
|
41470
41470
|
outline: none;
|
|
41471
41471
|
`;
|
|
41472
|
-
const
|
|
41473
|
-
|
|
41474
|
-
|
|
41475
|
-
|
|
41472
|
+
const VendorListWrapper$2 = styled.div`
|
|
41473
|
+
height: calc(100% - ${props => props.headerHeight}px);
|
|
41474
|
+
background: #fff;
|
|
41475
|
+
width: 100%;
|
|
41476
|
+
overflow: auto;
|
|
41476
41477
|
border-radius: 0 0 8px 8px;
|
|
41477
41478
|
`;
|
|
41479
|
+
const VendorList$2 = styled.div`
|
|
41480
|
+
`;
|
|
41478
41481
|
const VendorItem$1 = styled.div`
|
|
41479
41482
|
display: flex;
|
|
41480
41483
|
align-items: center;
|
|
@@ -41571,38 +41574,37 @@ const Trash$1 = styled.div`
|
|
|
41571
41574
|
`;
|
|
41572
41575
|
|
|
41573
41576
|
const VendorSelectionContainer = styled(Card)`
|
|
41574
|
-
display: flex;
|
|
41575
|
-
flex-direction: column;
|
|
41577
|
+
/* display: flex;
|
|
41578
|
+
flex-direction: column; */
|
|
41576
41579
|
background: #faf9fb;
|
|
41577
41580
|
width: 100%;
|
|
41578
41581
|
height: 100%;
|
|
41579
41582
|
overflow: hidden;
|
|
41583
|
+
font-family: 'Poppins', sans-serif;
|
|
41580
41584
|
`;
|
|
41581
|
-
const VendorSelectionTitle = styled.
|
|
41582
|
-
|
|
41585
|
+
const VendorSelectionTitle = styled.h5`
|
|
41586
|
+
text-align: left;
|
|
41583
41587
|
color: #212121;
|
|
41588
|
+
margin: 0 0 16px;
|
|
41584
41589
|
font-size: 18px;
|
|
41585
|
-
|
|
41586
|
-
padding-left: 16px;
|
|
41590
|
+
padding-left: 6px;
|
|
41587
41591
|
font-weight: 700;
|
|
41588
41592
|
`;
|
|
41589
41593
|
const VendorBackTitle = styled.span`
|
|
41590
41594
|
margin-left: 4px;
|
|
41591
41595
|
color: #212121;
|
|
41592
|
-
font-feature-settings: "liga" off;
|
|
41593
|
-
font-family: Poppins;
|
|
41594
41596
|
font-size: 16px;
|
|
41595
|
-
font-style: normal;
|
|
41596
41597
|
font-weight: 400;
|
|
41597
|
-
line-height: normal;
|
|
41598
41598
|
`;
|
|
41599
41599
|
const VendorHeader$1 = styled.div`
|
|
41600
|
+
padding: 12px 16px 20px;
|
|
41601
|
+
text-align: left;
|
|
41602
|
+
`;
|
|
41603
|
+
const VendorRoute = styled.div`
|
|
41600
41604
|
display: flex;
|
|
41601
41605
|
align-items: center;
|
|
41602
|
-
padding-left: 16px;
|
|
41603
|
-
padding-bottom: 14px;
|
|
41604
41606
|
gap: 4px;
|
|
41605
|
-
|
|
41607
|
+
margin-bottom: 16px;
|
|
41606
41608
|
background: #faf9fb;
|
|
41607
41609
|
`;
|
|
41608
41610
|
const VendorBackButton = styled.button`
|
|
@@ -41613,7 +41615,7 @@ const VendorBackButton = styled.button`
|
|
|
41613
41615
|
cursor: pointer;
|
|
41614
41616
|
`;
|
|
41615
41617
|
const VendorSearch = styled.input`
|
|
41616
|
-
|
|
41618
|
+
width: 100%;
|
|
41617
41619
|
margin-bottom: 8px;
|
|
41618
41620
|
padding: 10px 14px;
|
|
41619
41621
|
border-radius: 9px;
|
|
@@ -41623,10 +41625,6 @@ const VendorSearch = styled.input`
|
|
|
41623
41625
|
outline: none;
|
|
41624
41626
|
`;
|
|
41625
41627
|
const VendorSearchResult = styled.span`
|
|
41626
|
-
margin-left: 18px;
|
|
41627
|
-
margin-bottom: 8px;
|
|
41628
|
-
text-align: start;
|
|
41629
|
-
height: 30px;
|
|
41630
41628
|
color: #212121;
|
|
41631
41629
|
font-size: 16px;
|
|
41632
41630
|
font-weight: 400;
|
|
@@ -41636,14 +41634,15 @@ const VendorNameAndPackagesContainer = styled.div`
|
|
|
41636
41634
|
margin-left: 52px;
|
|
41637
41635
|
flex-direction: column;
|
|
41638
41636
|
`;
|
|
41639
|
-
const
|
|
41640
|
-
|
|
41641
|
-
overflow-y: auto;
|
|
41642
|
-
padding: 0 0 8px 0;
|
|
41637
|
+
const VendorListWrapper$1 = styled.div`
|
|
41638
|
+
height: calc(100% - ${props => props.headerHeight}px);
|
|
41643
41639
|
background: #fff;
|
|
41644
41640
|
width: 100%;
|
|
41641
|
+
overflow: auto;
|
|
41645
41642
|
border-radius: 0 0 8px 8px;
|
|
41646
41643
|
`;
|
|
41644
|
+
const VendorList$1 = styled.div`
|
|
41645
|
+
`;
|
|
41647
41646
|
const VendorItem = styled.div`
|
|
41648
41647
|
display: flex;
|
|
41649
41648
|
align-items: center;
|
|
@@ -41709,6 +41708,13 @@ const NewItemList = ({
|
|
|
41709
41708
|
itemAndPackage
|
|
41710
41709
|
}) => {
|
|
41711
41710
|
const [search, setSearch] = useState("");
|
|
41711
|
+
const [headerHeight, setHeaderHeight] = useState(0);
|
|
41712
|
+
const headerRef = useRef(null);
|
|
41713
|
+
useEffect(() => {
|
|
41714
|
+
if (headerRef.current) {
|
|
41715
|
+
setHeaderHeight(headerRef.current.offsetHeight);
|
|
41716
|
+
}
|
|
41717
|
+
}, []);
|
|
41712
41718
|
const searchLower = search.toLowerCase();
|
|
41713
41719
|
const startsWithMatches = itemAndPackage.filter(i => i.name.toLowerCase().startsWith(searchLower));
|
|
41714
41720
|
const includesMatches = itemAndPackage.filter(i => !i.name.toLowerCase().startsWith(searchLower) && i.name.toLowerCase().includes(searchLower));
|
|
@@ -41722,19 +41728,23 @@ const NewItemList = ({
|
|
|
41722
41728
|
key: i
|
|
41723
41729
|
}, part) : part);
|
|
41724
41730
|
};
|
|
41725
|
-
return /*#__PURE__*/React$1.createElement(VendorSelectionContainer, null, /*#__PURE__*/React$1.createElement(VendorHeader$1,
|
|
41731
|
+
return /*#__PURE__*/React$1.createElement(VendorSelectionContainer, null, /*#__PURE__*/React$1.createElement(VendorHeader$1, {
|
|
41732
|
+
ref: headerRef
|
|
41733
|
+
}, /*#__PURE__*/React$1.createElement(VendorRoute, null, /*#__PURE__*/React$1.createElement(VendorBackButton, {
|
|
41726
41734
|
onClick: onBack
|
|
41727
41735
|
}, /*#__PURE__*/React$1.createElement(ArrowLeftIcon, null)), /*#__PURE__*/React$1.createElement(VendorBackTitle, null, "Selected Vendors")), /*#__PURE__*/React$1.createElement(VendorSelectionTitle, null, "Add New Vendor"), /*#__PURE__*/React$1.createElement(VendorSearch, {
|
|
41728
41736
|
type: "search",
|
|
41729
41737
|
placeholder: "Search",
|
|
41730
41738
|
value: search,
|
|
41731
41739
|
onChange: e => setSearch(e.target.value)
|
|
41732
|
-
}), /*#__PURE__*/React$1.createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " "), /*#__PURE__*/React$1.createElement(
|
|
41740
|
+
}), /*#__PURE__*/React$1.createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React$1.createElement(VendorListWrapper$1, {
|
|
41741
|
+
headerHeight: headerHeight
|
|
41742
|
+
}, /*#__PURE__*/React$1.createElement(VendorList$1, null, filteredItems.map((item, idx) => /*#__PURE__*/React$1.createElement(VendorItem, {
|
|
41733
41743
|
onClick: e => {
|
|
41734
41744
|
if (onVendorClick) onVendorClick(item);
|
|
41735
41745
|
},
|
|
41736
41746
|
key: idx
|
|
41737
|
-
}, /*#__PURE__*/React$1.createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React$1.createElement(VendorName$1, null, highlightMatch(item.name, searchLower)), item.packages && /*#__PURE__*/React$1.createElement(VendorPackages, null, `0/${item.packages.length} Packages Sent`)), /*#__PURE__*/React$1.createElement(VendorChevron, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))))));
|
|
41747
|
+
}, /*#__PURE__*/React$1.createElement(VendorNameAndPackagesContainer, null, /*#__PURE__*/React$1.createElement(VendorName$1, null, highlightMatch(item.name, searchLower)), item.packages && /*#__PURE__*/React$1.createElement(VendorPackages, null, `0/${item.packages.length} Packages Sent`)), /*#__PURE__*/React$1.createElement(VendorChevron, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null)))))));
|
|
41738
41748
|
};
|
|
41739
41749
|
|
|
41740
41750
|
const NewSubitemContainer$1 = styled(Card)`
|
|
@@ -50837,6 +50847,13 @@ const ItemManagerPanel = _ref => {
|
|
|
50837
50847
|
const [selectedVendor, setSelectedVendor] = useState(null);
|
|
50838
50848
|
const [selectedPackage, setSelectedPackage] = useState(null);
|
|
50839
50849
|
const [isEditingExisting, setIsEditingExisting] = useState(false);
|
|
50850
|
+
const [headerHeight, setHeaderHeight] = useState(0);
|
|
50851
|
+
const headerRef = useRef(null);
|
|
50852
|
+
useEffect(() => {
|
|
50853
|
+
if (headerRef.current) {
|
|
50854
|
+
setHeaderHeight(headerRef.current.offsetHeight);
|
|
50855
|
+
}
|
|
50856
|
+
}, []);
|
|
50840
50857
|
const handleVendorClick = vendor => {
|
|
50841
50858
|
// console.log("Vendor clicked:", vendor);
|
|
50842
50859
|
setSelectedVendor(vendor);
|
|
@@ -51021,7 +51038,9 @@ const ItemManagerPanel = _ref => {
|
|
|
51021
51038
|
text: "First Vendor",
|
|
51022
51039
|
type: "primary",
|
|
51023
51040
|
textColor: linkColor
|
|
51024
|
-
})), /*#__PURE__*/React$1.createElement(
|
|
51041
|
+
})), /*#__PURE__*/React$1.createElement(VendorListWrapper$2, {
|
|
51042
|
+
headerHeight: headerHeight
|
|
51043
|
+
}, /*#__PURE__*/React$1.createElement(VendorList$2, null, itemAndPackage.filter(item => item.packages !== null).map((item, idx) => /*#__PURE__*/React$1.createElement(VendorItem$1, {
|
|
51025
51044
|
key: idx
|
|
51026
51045
|
}, /*#__PURE__*/React$1.createElement(DotContainer, null, item.packages.length === 0 && /*#__PURE__*/React$1.createElement(RedDot, null)), /*#__PURE__*/React$1.createElement(LineContainer, {
|
|
51027
51046
|
onClick: e => {
|
|
@@ -51040,7 +51059,7 @@ const ItemManagerPanel = _ref => {
|
|
|
51040
51059
|
xmlns: "http://www.w3.org/2000/svg"
|
|
51041
51060
|
}, /*#__PURE__*/React$1.createElement("path", {
|
|
51042
51061
|
d: "M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z"
|
|
51043
|
-
})))))));
|
|
51062
|
+
}))))))));
|
|
51044
51063
|
}
|
|
51045
51064
|
};
|
|
51046
51065
|
|