sag_components 2.0.0-beta117 → 2.0.0-beta118
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
CHANGED
|
@@ -41571,38 +41571,37 @@ const Trash$1 = styled.div`
|
|
|
41571
41571
|
`;
|
|
41572
41572
|
|
|
41573
41573
|
const VendorSelectionContainer = styled(Card)`
|
|
41574
|
-
display: flex;
|
|
41575
|
-
flex-direction: column;
|
|
41574
|
+
/* display: flex;
|
|
41575
|
+
flex-direction: column; */
|
|
41576
41576
|
background: #faf9fb;
|
|
41577
41577
|
width: 100%;
|
|
41578
41578
|
height: 100%;
|
|
41579
41579
|
overflow: hidden;
|
|
41580
|
+
font-family: 'Poppins', sans-serif;
|
|
41580
41581
|
`;
|
|
41581
|
-
const VendorSelectionTitle = styled.
|
|
41582
|
-
|
|
41582
|
+
const VendorSelectionTitle = styled.h5`
|
|
41583
|
+
text-align: left;
|
|
41583
41584
|
color: #212121;
|
|
41585
|
+
margin: 0 0 16px;
|
|
41584
41586
|
font-size: 18px;
|
|
41585
|
-
|
|
41586
|
-
padding-left: 16px;
|
|
41587
|
+
padding-left: 6px;
|
|
41587
41588
|
font-weight: 700;
|
|
41588
41589
|
`;
|
|
41589
41590
|
const VendorBackTitle = styled.span`
|
|
41590
41591
|
margin-left: 4px;
|
|
41591
41592
|
color: #212121;
|
|
41592
|
-
font-feature-settings: "liga" off;
|
|
41593
|
-
font-family: Poppins;
|
|
41594
41593
|
font-size: 16px;
|
|
41595
|
-
font-style: normal;
|
|
41596
41594
|
font-weight: 400;
|
|
41597
|
-
line-height: normal;
|
|
41598
41595
|
`;
|
|
41599
41596
|
const VendorHeader$1 = styled.div`
|
|
41597
|
+
padding: 12px 16px 20px;
|
|
41598
|
+
text-align: left;
|
|
41599
|
+
`;
|
|
41600
|
+
const VendorRoute = styled.div`
|
|
41600
41601
|
display: flex;
|
|
41601
41602
|
align-items: center;
|
|
41602
|
-
padding-left: 16px;
|
|
41603
|
-
padding-bottom: 14px;
|
|
41604
41603
|
gap: 4px;
|
|
41605
|
-
|
|
41604
|
+
margin-bottom: 16px;
|
|
41606
41605
|
background: #faf9fb;
|
|
41607
41606
|
`;
|
|
41608
41607
|
const VendorBackButton = styled.button`
|
|
@@ -41613,7 +41612,7 @@ const VendorBackButton = styled.button`
|
|
|
41613
41612
|
cursor: pointer;
|
|
41614
41613
|
`;
|
|
41615
41614
|
const VendorSearch = styled.input`
|
|
41616
|
-
|
|
41615
|
+
width: 100%;
|
|
41617
41616
|
margin-bottom: 8px;
|
|
41618
41617
|
padding: 10px 14px;
|
|
41619
41618
|
border-radius: 9px;
|
|
@@ -41623,10 +41622,6 @@ const VendorSearch = styled.input`
|
|
|
41623
41622
|
outline: none;
|
|
41624
41623
|
`;
|
|
41625
41624
|
const VendorSearchResult = styled.span`
|
|
41626
|
-
margin-left: 18px;
|
|
41627
|
-
margin-bottom: 8px;
|
|
41628
|
-
text-align: start;
|
|
41629
|
-
height: 30px;
|
|
41630
41625
|
color: #212121;
|
|
41631
41626
|
font-size: 16px;
|
|
41632
41627
|
font-weight: 400;
|
|
@@ -41637,9 +41632,8 @@ const VendorNameAndPackagesContainer = styled.div`
|
|
|
41637
41632
|
flex-direction: column;
|
|
41638
41633
|
`;
|
|
41639
41634
|
const VendorList$1 = styled.div`
|
|
41640
|
-
|
|
41635
|
+
height: calc(100% - ${props => props.headerHeight}px);
|
|
41641
41636
|
overflow-y: auto;
|
|
41642
|
-
padding: 0 0 8px 0;
|
|
41643
41637
|
background: #fff;
|
|
41644
41638
|
width: 100%;
|
|
41645
41639
|
border-radius: 0 0 8px 8px;
|
|
@@ -41709,6 +41703,13 @@ const NewItemList = ({
|
|
|
41709
41703
|
itemAndPackage
|
|
41710
41704
|
}) => {
|
|
41711
41705
|
const [search, setSearch] = useState("");
|
|
41706
|
+
const [headerHeight, setHeaderHeight] = useState(0);
|
|
41707
|
+
const headerRef = useRef(null);
|
|
41708
|
+
useEffect(() => {
|
|
41709
|
+
if (headerRef.current) {
|
|
41710
|
+
setHeaderHeight(headerRef.current.offsetHeight);
|
|
41711
|
+
}
|
|
41712
|
+
}, []);
|
|
41712
41713
|
const searchLower = search.toLowerCase();
|
|
41713
41714
|
const startsWithMatches = itemAndPackage.filter(i => i.name.toLowerCase().startsWith(searchLower));
|
|
41714
41715
|
const includesMatches = itemAndPackage.filter(i => !i.name.toLowerCase().startsWith(searchLower) && i.name.toLowerCase().includes(searchLower));
|
|
@@ -41722,14 +41723,18 @@ const NewItemList = ({
|
|
|
41722
41723
|
key: i
|
|
41723
41724
|
}, part) : part);
|
|
41724
41725
|
};
|
|
41725
|
-
return /*#__PURE__*/React$1.createElement(VendorSelectionContainer, null, /*#__PURE__*/React$1.createElement(VendorHeader$1,
|
|
41726
|
+
return /*#__PURE__*/React$1.createElement(VendorSelectionContainer, null, /*#__PURE__*/React$1.createElement(VendorHeader$1, {
|
|
41727
|
+
ref: headerRef
|
|
41728
|
+
}, /*#__PURE__*/React$1.createElement(VendorRoute, null, /*#__PURE__*/React$1.createElement(VendorBackButton, {
|
|
41726
41729
|
onClick: onBack
|
|
41727
41730
|
}, /*#__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
41731
|
type: "search",
|
|
41729
41732
|
placeholder: "Search",
|
|
41730
41733
|
value: search,
|
|
41731
41734
|
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(VendorList$1,
|
|
41735
|
+
}), /*#__PURE__*/React$1.createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React$1.createElement(VendorList$1, {
|
|
41736
|
+
headerHeight: headerHeight
|
|
41737
|
+
}, filteredItems.map((item, idx) => /*#__PURE__*/React$1.createElement(VendorItem, {
|
|
41733
41738
|
onClick: e => {
|
|
41734
41739
|
if (onVendorClick) onVendorClick(item);
|
|
41735
41740
|
},
|