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.js
CHANGED
|
@@ -41581,38 +41581,37 @@ const Trash$1 = styled__default["default"].div`
|
|
|
41581
41581
|
`;
|
|
41582
41582
|
|
|
41583
41583
|
const VendorSelectionContainer = styled__default["default"](Card)`
|
|
41584
|
-
display: flex;
|
|
41585
|
-
flex-direction: column;
|
|
41584
|
+
/* display: flex;
|
|
41585
|
+
flex-direction: column; */
|
|
41586
41586
|
background: #faf9fb;
|
|
41587
41587
|
width: 100%;
|
|
41588
41588
|
height: 100%;
|
|
41589
41589
|
overflow: hidden;
|
|
41590
|
+
font-family: 'Poppins', sans-serif;
|
|
41590
41591
|
`;
|
|
41591
|
-
const VendorSelectionTitle = styled__default["default"].
|
|
41592
|
-
|
|
41592
|
+
const VendorSelectionTitle = styled__default["default"].h5`
|
|
41593
|
+
text-align: left;
|
|
41593
41594
|
color: #212121;
|
|
41595
|
+
margin: 0 0 16px;
|
|
41594
41596
|
font-size: 18px;
|
|
41595
|
-
|
|
41596
|
-
padding-left: 16px;
|
|
41597
|
+
padding-left: 6px;
|
|
41597
41598
|
font-weight: 700;
|
|
41598
41599
|
`;
|
|
41599
41600
|
const VendorBackTitle = styled__default["default"].span`
|
|
41600
41601
|
margin-left: 4px;
|
|
41601
41602
|
color: #212121;
|
|
41602
|
-
font-feature-settings: "liga" off;
|
|
41603
|
-
font-family: Poppins;
|
|
41604
41603
|
font-size: 16px;
|
|
41605
|
-
font-style: normal;
|
|
41606
41604
|
font-weight: 400;
|
|
41607
|
-
line-height: normal;
|
|
41608
41605
|
`;
|
|
41609
41606
|
const VendorHeader$1 = styled__default["default"].div`
|
|
41607
|
+
padding: 12px 16px 20px;
|
|
41608
|
+
text-align: left;
|
|
41609
|
+
`;
|
|
41610
|
+
const VendorRoute = styled__default["default"].div`
|
|
41610
41611
|
display: flex;
|
|
41611
41612
|
align-items: center;
|
|
41612
|
-
padding-left: 16px;
|
|
41613
|
-
padding-bottom: 14px;
|
|
41614
41613
|
gap: 4px;
|
|
41615
|
-
|
|
41614
|
+
margin-bottom: 16px;
|
|
41616
41615
|
background: #faf9fb;
|
|
41617
41616
|
`;
|
|
41618
41617
|
const VendorBackButton = styled__default["default"].button`
|
|
@@ -41623,7 +41622,7 @@ const VendorBackButton = styled__default["default"].button`
|
|
|
41623
41622
|
cursor: pointer;
|
|
41624
41623
|
`;
|
|
41625
41624
|
const VendorSearch = styled__default["default"].input`
|
|
41626
|
-
|
|
41625
|
+
width: 100%;
|
|
41627
41626
|
margin-bottom: 8px;
|
|
41628
41627
|
padding: 10px 14px;
|
|
41629
41628
|
border-radius: 9px;
|
|
@@ -41633,10 +41632,6 @@ const VendorSearch = styled__default["default"].input`
|
|
|
41633
41632
|
outline: none;
|
|
41634
41633
|
`;
|
|
41635
41634
|
const VendorSearchResult = styled__default["default"].span`
|
|
41636
|
-
margin-left: 18px;
|
|
41637
|
-
margin-bottom: 8px;
|
|
41638
|
-
text-align: start;
|
|
41639
|
-
height: 30px;
|
|
41640
41635
|
color: #212121;
|
|
41641
41636
|
font-size: 16px;
|
|
41642
41637
|
font-weight: 400;
|
|
@@ -41647,9 +41642,8 @@ const VendorNameAndPackagesContainer = styled__default["default"].div`
|
|
|
41647
41642
|
flex-direction: column;
|
|
41648
41643
|
`;
|
|
41649
41644
|
const VendorList$1 = styled__default["default"].div`
|
|
41650
|
-
|
|
41645
|
+
height: calc(100% - ${props => props.headerHeight}px);
|
|
41651
41646
|
overflow-y: auto;
|
|
41652
|
-
padding: 0 0 8px 0;
|
|
41653
41647
|
background: #fff;
|
|
41654
41648
|
width: 100%;
|
|
41655
41649
|
border-radius: 0 0 8px 8px;
|
|
@@ -41719,6 +41713,13 @@ const NewItemList = ({
|
|
|
41719
41713
|
itemAndPackage
|
|
41720
41714
|
}) => {
|
|
41721
41715
|
const [search, setSearch] = React$1.useState("");
|
|
41716
|
+
const [headerHeight, setHeaderHeight] = React$1.useState(0);
|
|
41717
|
+
const headerRef = React$1.useRef(null);
|
|
41718
|
+
React$1.useEffect(() => {
|
|
41719
|
+
if (headerRef.current) {
|
|
41720
|
+
setHeaderHeight(headerRef.current.offsetHeight);
|
|
41721
|
+
}
|
|
41722
|
+
}, []);
|
|
41722
41723
|
const searchLower = search.toLowerCase();
|
|
41723
41724
|
const startsWithMatches = itemAndPackage.filter(i => i.name.toLowerCase().startsWith(searchLower));
|
|
41724
41725
|
const includesMatches = itemAndPackage.filter(i => !i.name.toLowerCase().startsWith(searchLower) && i.name.toLowerCase().includes(searchLower));
|
|
@@ -41732,14 +41733,18 @@ const NewItemList = ({
|
|
|
41732
41733
|
key: i
|
|
41733
41734
|
}, part) : part);
|
|
41734
41735
|
};
|
|
41735
|
-
return /*#__PURE__*/React__default["default"].createElement(VendorSelectionContainer, null, /*#__PURE__*/React__default["default"].createElement(VendorHeader$1,
|
|
41736
|
+
return /*#__PURE__*/React__default["default"].createElement(VendorSelectionContainer, null, /*#__PURE__*/React__default["default"].createElement(VendorHeader$1, {
|
|
41737
|
+
ref: headerRef
|
|
41738
|
+
}, /*#__PURE__*/React__default["default"].createElement(VendorRoute, null, /*#__PURE__*/React__default["default"].createElement(VendorBackButton, {
|
|
41736
41739
|
onClick: onBack
|
|
41737
41740
|
}, /*#__PURE__*/React__default["default"].createElement(ArrowLeftIcon, null)), /*#__PURE__*/React__default["default"].createElement(VendorBackTitle, null, "Selected Vendors")), /*#__PURE__*/React__default["default"].createElement(VendorSelectionTitle, null, "Add New Vendor"), /*#__PURE__*/React__default["default"].createElement(VendorSearch, {
|
|
41738
41741
|
type: "search",
|
|
41739
41742
|
placeholder: "Search",
|
|
41740
41743
|
value: search,
|
|
41741
41744
|
onChange: e => setSearch(e.target.value)
|
|
41742
|
-
}), /*#__PURE__*/React__default["default"].createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " "), /*#__PURE__*/React__default["default"].createElement(VendorList$1,
|
|
41745
|
+
}), /*#__PURE__*/React__default["default"].createElement(VendorSearchResult, null, search !== "" ? `${filteredItems.length === 0 ? "No" : filteredItems.length} Vendors Found` : " ")), /*#__PURE__*/React__default["default"].createElement(VendorList$1, {
|
|
41746
|
+
headerHeight: headerHeight
|
|
41747
|
+
}, filteredItems.map((item, idx) => /*#__PURE__*/React__default["default"].createElement(VendorItem, {
|
|
41743
41748
|
onClick: e => {
|
|
41744
41749
|
if (onVendorClick) onVendorClick(item);
|
|
41745
41750
|
},
|