sag_components 2.0.0-beta137 → 2.0.0-beta138
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 +4 -18
- package/dist/index.esm.js +101 -131
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +101 -131
- package/dist/index.js.map +1 -1
- package/dist/types/components/QuickFilterCards/QuickFilterCards.d.ts +6 -0
- package/dist/types/components/{EventStatusCards/EventStatusCards.stories.d.ts → QuickFilterCards/QuickFilterCards.stories.d.ts} +4 -19
- package/dist/types/components/{EventStatusCards/EventStatusCards.style.d.ts → QuickFilterCards/QuickFilterCards.style.d.ts} +2 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/components/EventStatusCards/EventStatusCards.d.ts +0 -21
package/dist/index.js
CHANGED
|
@@ -23913,22 +23913,21 @@ const DeleteIcon = styled__default["default"].div`
|
|
|
23913
23913
|
position: absolute;
|
|
23914
23914
|
`;
|
|
23915
23915
|
|
|
23916
|
-
const QuickFilterDropdownSingle =
|
|
23917
|
-
|
|
23918
|
-
|
|
23919
|
-
|
|
23920
|
-
|
|
23921
|
-
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23930
|
-
|
|
23931
|
-
} = _ref;
|
|
23916
|
+
const QuickFilterDropdownSingle = ({
|
|
23917
|
+
label,
|
|
23918
|
+
hoverColor,
|
|
23919
|
+
options,
|
|
23920
|
+
selectedValue,
|
|
23921
|
+
placeHolder,
|
|
23922
|
+
onChange,
|
|
23923
|
+
disabled,
|
|
23924
|
+
width,
|
|
23925
|
+
error,
|
|
23926
|
+
errorMessage,
|
|
23927
|
+
xIconShow,
|
|
23928
|
+
labelColor,
|
|
23929
|
+
showLabelOnTop
|
|
23930
|
+
}) => {
|
|
23932
23931
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
23933
23932
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
23934
23933
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
@@ -24325,24 +24324,23 @@ const IconContainer$2 = styled__default["default"].div`
|
|
|
24325
24324
|
cursor: pointer;
|
|
24326
24325
|
`;
|
|
24327
24326
|
|
|
24328
|
-
const QuickFilterDropdownMultiSelection =
|
|
24329
|
-
|
|
24330
|
-
|
|
24331
|
-
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
|
|
24335
|
-
|
|
24336
|
-
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
|
|
24340
|
-
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
} = _ref;
|
|
24327
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24328
|
+
label,
|
|
24329
|
+
labelEmptyValue,
|
|
24330
|
+
options,
|
|
24331
|
+
selectedValue,
|
|
24332
|
+
placeHolder,
|
|
24333
|
+
onChange,
|
|
24334
|
+
required,
|
|
24335
|
+
disabled,
|
|
24336
|
+
width,
|
|
24337
|
+
error,
|
|
24338
|
+
errorMessage,
|
|
24339
|
+
labelColor,
|
|
24340
|
+
xIconShow,
|
|
24341
|
+
checkBoxColor,
|
|
24342
|
+
showLabelOnTop
|
|
24343
|
+
}) => {
|
|
24346
24344
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24347
24345
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24348
24346
|
const [inputValue, setInputValue] = React$1.useState('');
|
|
@@ -36870,7 +36868,7 @@ const TruncatedText$1 = styled__default["default"].span`
|
|
|
36870
36868
|
text-overflow: ellipsis;
|
|
36871
36869
|
font-size: 14px;
|
|
36872
36870
|
`;
|
|
36873
|
-
const Checkmark
|
|
36871
|
+
const Checkmark = styled__default["default"].span`
|
|
36874
36872
|
color: ${props => props.color};
|
|
36875
36873
|
margin-left: 8px;
|
|
36876
36874
|
font-weight: bold;
|
|
@@ -36969,7 +36967,7 @@ const SortPop = props => {
|
|
|
36969
36967
|
onClick: () => {
|
|
36970
36968
|
handleChange(item);
|
|
36971
36969
|
}
|
|
36972
|
-
}, /*#__PURE__*/React__default["default"].createElement(TruncatedText$1, null, item.label), item.value === value && /*#__PURE__*/React__default["default"].createElement(Checkmark
|
|
36970
|
+
}, /*#__PURE__*/React__default["default"].createElement(TruncatedText$1, null, item.label), item.value === value && /*#__PURE__*/React__default["default"].createElement(Checkmark, {
|
|
36973
36971
|
color: color
|
|
36974
36972
|
}, "\u2713")))), /*#__PURE__*/React__default["default"].createElement(ButtonWrapper$1, null, /*#__PURE__*/React__default["default"].createElement(ResetButton, {
|
|
36975
36973
|
onClick: handleReset,
|
|
@@ -41664,7 +41662,6 @@ const VendorName$2 = styled__default["default"].div`
|
|
|
41664
41662
|
color: #212121;
|
|
41665
41663
|
font-size: 16px;
|
|
41666
41664
|
font-weight: 500;
|
|
41667
|
-
text-align: left;
|
|
41668
41665
|
`;
|
|
41669
41666
|
styled__default["default"].div`
|
|
41670
41667
|
color: #b0b0b0;
|
|
@@ -51111,18 +51108,12 @@ const ItemManagerPanel = _ref => {
|
|
|
51111
51108
|
};
|
|
51112
51109
|
const hasUnisentPackages = React$1.useMemo(() => {
|
|
51113
51110
|
return itemAndPackage.some(vendor => {
|
|
51114
|
-
// In edit mode, treat packages: null as unsent
|
|
51115
|
-
if (editMode && vendor.packages === null) {
|
|
51116
|
-
return true; // This vendor has unsent items
|
|
51117
|
-
}
|
|
51118
|
-
|
|
51119
|
-
// Original logic for other cases
|
|
51120
51111
|
if (vendor.packages === null || !Array.isArray(vendor.packages)) {
|
|
51121
51112
|
return false;
|
|
51122
51113
|
}
|
|
51123
51114
|
return vendor.packages.some(pkg => !pkg.hasOwnProperty('status') || pkg.status == null || pkg.status === undefined || pkg.status === '');
|
|
51124
51115
|
});
|
|
51125
|
-
}, [itemAndPackage
|
|
51116
|
+
}, [itemAndPackage]);
|
|
51126
51117
|
const actuallyAllFormsSent = AllFormsSent && !hasUnisentPackages;
|
|
51127
51118
|
React$1.useEffect(() => {
|
|
51128
51119
|
if (screen === "success" && onSendForms) {
|
|
@@ -51258,28 +51249,22 @@ const ItemManagerPanel = _ref => {
|
|
|
51258
51249
|
}))), /*#__PURE__*/React__default["default"].createElement(VendorListWrapper$2, {
|
|
51259
51250
|
disabled: disableSection,
|
|
51260
51251
|
headerHeight: headerHeight
|
|
51261
|
-
}, /*#__PURE__*/React__default["default"].createElement(VendorList$2, null, itemAndPackage.filter(item => {
|
|
51262
|
-
// In edit mode, show vendors with packages: null as well
|
|
51263
|
-
if (editMode && item.packages === null) {
|
|
51264
|
-
return true;
|
|
51265
|
-
}
|
|
51266
|
-
// Original logic: show only vendors with packages !== null
|
|
51267
|
-
return item.packages !== null;
|
|
51268
|
-
}).map((item, idx) => /*#__PURE__*/React__default["default"].createElement(VendorItem$1, {
|
|
51252
|
+
}, /*#__PURE__*/React__default["default"].createElement(VendorList$2, null, itemAndPackage.filter(item => item.packages !== null).map((item, idx) => /*#__PURE__*/React__default["default"].createElement(VendorItem$1, {
|
|
51269
51253
|
key: idx
|
|
51270
|
-
}, /*#__PURE__*/React__default["default"].createElement(DotContainer, null, item.packages
|
|
51254
|
+
}, /*#__PURE__*/React__default["default"].createElement(DotContainer, null, item.packages.length === 0 && /*#__PURE__*/React__default["default"].createElement(RedDot, null)), /*#__PURE__*/React__default["default"].createElement(LineContainer, {
|
|
51271
51255
|
onClick: e => {
|
|
51272
51256
|
handleVendorClick(item);
|
|
51273
51257
|
}
|
|
51274
|
-
}, /*#__PURE__*/React__default["default"].createElement(VendorNameAndPackagesContainer$1, null, /*#__PURE__*/React__default["default"].createElement(VendorName$2, null, item.name),
|
|
51275
|
-
const packagesWithStatus = item.packages.filter(pkg => pkg.hasOwnProperty('status') && pkg.status != null && pkg.status !== undefined && pkg.status !== ''
|
|
51276
|
-
const
|
|
51277
|
-
|
|
51278
|
-
|
|
51279
|
-
|
|
51280
|
-
|
|
51258
|
+
}, /*#__PURE__*/React__default["default"].createElement(VendorNameAndPackagesContainer$1, null, /*#__PURE__*/React__default["default"].createElement(VendorName$2, null, item.name), item.packages.length === 0 && /*#__PURE__*/React__default["default"].createElement(Subtitle$1, null, "No Packages"), item.packages.length > 0 && /*#__PURE__*/React__default["default"].createElement(Subtitle$1, null, (() => {
|
|
51259
|
+
const packagesWithStatus = item.packages.filter(pkg => pkg.hasOwnProperty('status') && pkg.status != null && pkg.status !== undefined && pkg.status !== '');
|
|
51260
|
+
const allHaveStatus = packagesWithStatus.length === item.packages.length;
|
|
51261
|
+
const noneHaveStatus = packagesWithStatus.length === 0;
|
|
51262
|
+
if (noneHaveStatus) {
|
|
51263
|
+
return `0/${item.packages.length} sent`;
|
|
51264
|
+
} else if (allHaveStatus) {
|
|
51265
|
+
return `${item.packages.length}/${item.packages.length} sent`;
|
|
51281
51266
|
} else {
|
|
51282
|
-
return `${packagesWithStatus.length}/${item.packages.length}
|
|
51267
|
+
return `${packagesWithStatus.length}/${item.packages.length} sent`;
|
|
51283
51268
|
}
|
|
51284
51269
|
})())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(Trash$1, {
|
|
51285
51270
|
className: "trash-icon",
|
|
@@ -52399,7 +52384,7 @@ const CardsContainer = styled__default["default"].div`
|
|
|
52399
52384
|
const StatusCard = styled__default["default"].div`
|
|
52400
52385
|
position: relative;
|
|
52401
52386
|
background-color: white;
|
|
52402
|
-
border-bottom:
|
|
52387
|
+
border-bottom: ${props => props.isSelected ? `3px solid ${props.borderColor}` : 'none'};
|
|
52403
52388
|
border-radius: 12px;
|
|
52404
52389
|
padding: 12px 16px;
|
|
52405
52390
|
flex-grow: 1;
|
|
@@ -52411,6 +52396,27 @@ const CardHeader = styled__default["default"].div`
|
|
|
52411
52396
|
align-items: center;
|
|
52412
52397
|
margin-bottom: 10px;
|
|
52413
52398
|
`;
|
|
52399
|
+
const CheckmarkContainer = styled__default["default"].div`
|
|
52400
|
+
width: 17px;
|
|
52401
|
+
height: 17px;
|
|
52402
|
+
border: 2px solid #212121;
|
|
52403
|
+
border-radius: 4px;
|
|
52404
|
+
display: flex;
|
|
52405
|
+
align-items: center;
|
|
52406
|
+
justify-content: center;
|
|
52407
|
+
margin-left: auto;
|
|
52408
|
+
color: white;
|
|
52409
|
+
transition: background-color .15s ease, border-color .15s ease;
|
|
52410
|
+
pointer-events: none;
|
|
52411
|
+
|
|
52412
|
+
&.checked {
|
|
52413
|
+
background-color: #066768;
|
|
52414
|
+
border-color: #066768;
|
|
52415
|
+
}
|
|
52416
|
+
|
|
52417
|
+
svg { display: none; }
|
|
52418
|
+
&.checked svg { display: block; }
|
|
52419
|
+
`;
|
|
52414
52420
|
const Circle = styled__default["default"].div`
|
|
52415
52421
|
width: 16px;
|
|
52416
52422
|
height: 16px;
|
|
@@ -52422,10 +52428,8 @@ const CardTitle = styled__default["default"].h3`
|
|
|
52422
52428
|
margin: 0;
|
|
52423
52429
|
font-size: 18px;
|
|
52424
52430
|
font-weight: 500;
|
|
52425
|
-
color: ${props => props.isSelected ? props.color : '#666666'};
|
|
52426
|
-
transition: color 0.2s ease-in-out;
|
|
52427
52431
|
`;
|
|
52428
|
-
|
|
52432
|
+
styled__default["default"].input`
|
|
52429
52433
|
width: 16px;
|
|
52430
52434
|
height: 16px;
|
|
52431
52435
|
accent-color: #066768;
|
|
@@ -52439,102 +52443,68 @@ const CardContent = styled__default["default"].div`
|
|
|
52439
52443
|
flex-direction: column;
|
|
52440
52444
|
align-items: flex-start;
|
|
52441
52445
|
`;
|
|
52442
|
-
const StatusCount = styled__default["default"].
|
|
52446
|
+
const StatusCount = styled__default["default"].span`
|
|
52443
52447
|
font-size: 32px;
|
|
52444
52448
|
font-weight: 500;
|
|
52445
|
-
color: ${props => props.isSelected ? props.color : '#999999'};
|
|
52446
52449
|
line-height: 1;
|
|
52447
|
-
margin: 0;
|
|
52448
|
-
transition: color 0.2s ease-in-out;
|
|
52449
52450
|
`;
|
|
52450
52451
|
|
|
52451
52452
|
const EventStatusCards = _ref => {
|
|
52452
52453
|
let {
|
|
52453
|
-
|
|
52454
|
-
|
|
52455
|
-
disabled = false,
|
|
52454
|
+
data = [],
|
|
52455
|
+
onCardToggle = () => {},
|
|
52456
52456
|
width = "100%"
|
|
52457
52457
|
} = _ref;
|
|
52458
|
-
//
|
|
52459
|
-
const
|
|
52460
|
-
|
|
52461
|
-
count: 0,
|
|
52462
|
-
checked: true,
|
|
52463
|
-
color: "#F5C9A7"
|
|
52464
|
-
}, {
|
|
52465
|
-
status: "Received",
|
|
52466
|
-
count: 0,
|
|
52467
|
-
checked: true,
|
|
52468
|
-
color: "#B9D5D5"
|
|
52469
|
-
}, {
|
|
52470
|
-
status: "Approved",
|
|
52471
|
-
count: 0,
|
|
52472
|
-
checked: true,
|
|
52473
|
-
color: "#BEDDC3"
|
|
52474
|
-
}, {
|
|
52475
|
-
status: "Cancelled",
|
|
52476
|
-
count: 0,
|
|
52477
|
-
checked: true,
|
|
52478
|
-
color: "#EBA6AF"
|
|
52479
|
-
}];
|
|
52480
|
-
const displayData = statusData.length > 0 ? statusData : defaultStatusData;
|
|
52458
|
+
// local mirror so UI updates immediately even if parent is slow/not controlling
|
|
52459
|
+
const [items, setItems] = React$1.useState(data);
|
|
52460
|
+
React$1.useEffect(() => setItems(data), [data]);
|
|
52481
52461
|
const handleCardClick = status => {
|
|
52482
|
-
|
|
52483
|
-
|
|
52484
|
-
|
|
52485
|
-
|
|
52486
|
-
|
|
52487
|
-
|
|
52488
|
-
|
|
52462
|
+
setItems(prev => {
|
|
52463
|
+
const clicked = prev.find(i => i.status === status);
|
|
52464
|
+
const nextChecked = clicked ? !clicked.checked : true;
|
|
52465
|
+
const next = prev.map(i => i.status === status ? {
|
|
52466
|
+
...i,
|
|
52467
|
+
checked: nextChecked
|
|
52468
|
+
} : i);
|
|
52469
|
+
onCardToggle(next, status, nextChecked);
|
|
52470
|
+
return next;
|
|
52471
|
+
});
|
|
52489
52472
|
};
|
|
52490
52473
|
return /*#__PURE__*/React__default["default"].createElement(CardsContainer, {
|
|
52491
52474
|
width: width,
|
|
52492
52475
|
className: "EventStatusCardsContainer"
|
|
52493
|
-
},
|
|
52494
|
-
|
|
52476
|
+
}, items.map(_ref2 => {
|
|
52477
|
+
let {
|
|
52495
52478
|
status,
|
|
52496
52479
|
count,
|
|
52497
52480
|
checked,
|
|
52498
52481
|
color
|
|
52499
|
-
} =
|
|
52482
|
+
} = _ref2;
|
|
52500
52483
|
return /*#__PURE__*/React__default["default"].createElement(StatusCard, {
|
|
52501
52484
|
key: status,
|
|
52502
52485
|
className: `StatusCard StatusCard-${status}`,
|
|
52503
52486
|
isSelected: checked,
|
|
52504
52487
|
borderColor: color,
|
|
52505
|
-
|
|
52506
|
-
onClick: () => handleCardClick(status),
|
|
52507
|
-
"data-testid": `status-card-${status.toLowerCase()}`
|
|
52488
|
+
onClick: () => handleCardClick(status)
|
|
52508
52489
|
}, /*#__PURE__*/React__default["default"].createElement(CardHeader, null, /*#__PURE__*/React__default["default"].createElement(Circle, {
|
|
52509
52490
|
color: color
|
|
52510
|
-
}), /*#__PURE__*/React__default["default"].createElement(CardTitle, {
|
|
52511
|
-
|
|
52512
|
-
|
|
52513
|
-
|
|
52514
|
-
|
|
52515
|
-
|
|
52516
|
-
|
|
52517
|
-
}
|
|
52491
|
+
}), /*#__PURE__*/React__default["default"].createElement(CardTitle, null, status), /*#__PURE__*/React__default["default"].createElement(CheckmarkContainer, {
|
|
52492
|
+
className: checked ? "checked" : ""
|
|
52493
|
+
}, checked && /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
52494
|
+
width: "14",
|
|
52495
|
+
height: "14",
|
|
52496
|
+
viewBox: "0 0 20 20",
|
|
52497
|
+
fill: "currentColor"
|
|
52498
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
52499
|
+
fillRule: "evenodd",
|
|
52500
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
52501
|
+
clipRule: "evenodd"
|
|
52502
|
+
})))), /*#__PURE__*/React__default["default"].createElement(CardContent, null, /*#__PURE__*/React__default["default"].createElement(StatusCount, {
|
|
52518
52503
|
isSelected: checked,
|
|
52519
52504
|
color: color
|
|
52520
52505
|
}, count)));
|
|
52521
52506
|
}));
|
|
52522
52507
|
};
|
|
52523
|
-
EventStatusCards.propTypes = {
|
|
52524
|
-
/** Array of status objects with count, checked state, and color information */
|
|
52525
|
-
statusData: PropTypes.arrayOf(PropTypes.shape({
|
|
52526
|
-
status: PropTypes.oneOf(["Pending", "Received", "Approved", "Cancelled"]).isRequired,
|
|
52527
|
-
count: PropTypes.number.isRequired,
|
|
52528
|
-
checked: PropTypes.bool.isRequired,
|
|
52529
|
-
color: PropTypes.string.isRequired
|
|
52530
|
-
})),
|
|
52531
|
-
/** Callback function when status selection changes */
|
|
52532
|
-
onStatusToggle: PropTypes.func,
|
|
52533
|
-
/** Whether the cards are disabled */
|
|
52534
|
-
disabled: PropTypes.bool,
|
|
52535
|
-
/** Width of the entire cards container */
|
|
52536
|
-
width: PropTypes.string
|
|
52537
|
-
};
|
|
52538
52508
|
|
|
52539
52509
|
exports.AreaChart = AreaChart;
|
|
52540
52510
|
exports.BannerEventBoxList = BannerEventBoxList;
|