sag_components 2.0.0-beta137 → 2.0.0-beta139
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 +5 -19
- package/dist/index.esm.js +112 -137
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +112 -137
- 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} +5 -20
- 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
|
@@ -8720,24 +8720,25 @@ const IconContainer$5 = styled__default["default"].div`
|
|
|
8720
8720
|
cursor: pointer;
|
|
8721
8721
|
`;
|
|
8722
8722
|
|
|
8723
|
-
const DropdownSingleNew =
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8723
|
+
const DropdownSingleNew = _ref => {
|
|
8724
|
+
let {
|
|
8725
|
+
label,
|
|
8726
|
+
labelEmptyValue,
|
|
8727
|
+
options,
|
|
8728
|
+
selectedValue,
|
|
8729
|
+
onChange,
|
|
8730
|
+
required,
|
|
8731
|
+
disabled,
|
|
8732
|
+
width,
|
|
8733
|
+
withMarginBottom = true,
|
|
8734
|
+
error,
|
|
8735
|
+
errorMessage,
|
|
8736
|
+
xIconShow,
|
|
8737
|
+
labelColor,
|
|
8738
|
+
showLabelOnTop,
|
|
8739
|
+
orderBy,
|
|
8740
|
+
elementType
|
|
8741
|
+
} = _ref;
|
|
8741
8742
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
8742
8743
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
8743
8744
|
const [showAbove, setShowAbove] = React$1.useState(false);
|
|
@@ -9209,25 +9210,26 @@ const IconContainer$4 = styled__default["default"].div`
|
|
|
9209
9210
|
cursor: pointer;
|
|
9210
9211
|
`;
|
|
9211
9212
|
|
|
9212
|
-
const DropdownMultiNew =
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9213
|
+
const DropdownMultiNew = _ref => {
|
|
9214
|
+
let {
|
|
9215
|
+
label,
|
|
9216
|
+
labelEmptyValue,
|
|
9217
|
+
options,
|
|
9218
|
+
selectedValue,
|
|
9219
|
+
onChange,
|
|
9220
|
+
required,
|
|
9221
|
+
disabled,
|
|
9222
|
+
width,
|
|
9223
|
+
withMarginBottom = true,
|
|
9224
|
+
error,
|
|
9225
|
+
errorMessage,
|
|
9226
|
+
labelColor,
|
|
9227
|
+
xIconShow,
|
|
9228
|
+
checkBoxColor,
|
|
9229
|
+
showLabelOnTop,
|
|
9230
|
+
orderBy,
|
|
9231
|
+
elementType
|
|
9232
|
+
} = _ref;
|
|
9231
9233
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
9232
9234
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
9233
9235
|
const [showAbove, setShowAbove] = React$1.useState(false);
|
|
@@ -36870,7 +36872,7 @@ const TruncatedText$1 = styled__default["default"].span`
|
|
|
36870
36872
|
text-overflow: ellipsis;
|
|
36871
36873
|
font-size: 14px;
|
|
36872
36874
|
`;
|
|
36873
|
-
const Checkmark
|
|
36875
|
+
const Checkmark = styled__default["default"].span`
|
|
36874
36876
|
color: ${props => props.color};
|
|
36875
36877
|
margin-left: 8px;
|
|
36876
36878
|
font-weight: bold;
|
|
@@ -36969,7 +36971,7 @@ const SortPop = props => {
|
|
|
36969
36971
|
onClick: () => {
|
|
36970
36972
|
handleChange(item);
|
|
36971
36973
|
}
|
|
36972
|
-
}, /*#__PURE__*/React__default["default"].createElement(TruncatedText$1, null, item.label), item.value === value && /*#__PURE__*/React__default["default"].createElement(Checkmark
|
|
36974
|
+
}, /*#__PURE__*/React__default["default"].createElement(TruncatedText$1, null, item.label), item.value === value && /*#__PURE__*/React__default["default"].createElement(Checkmark, {
|
|
36973
36975
|
color: color
|
|
36974
36976
|
}, "\u2713")))), /*#__PURE__*/React__default["default"].createElement(ButtonWrapper$1, null, /*#__PURE__*/React__default["default"].createElement(ResetButton, {
|
|
36975
36977
|
onClick: handleReset,
|
|
@@ -41664,7 +41666,6 @@ const VendorName$2 = styled__default["default"].div`
|
|
|
41664
41666
|
color: #212121;
|
|
41665
41667
|
font-size: 16px;
|
|
41666
41668
|
font-weight: 500;
|
|
41667
|
-
text-align: left;
|
|
41668
41669
|
`;
|
|
41669
41670
|
styled__default["default"].div`
|
|
41670
41671
|
color: #b0b0b0;
|
|
@@ -51111,18 +51112,12 @@ const ItemManagerPanel = _ref => {
|
|
|
51111
51112
|
};
|
|
51112
51113
|
const hasUnisentPackages = React$1.useMemo(() => {
|
|
51113
51114
|
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
51115
|
if (vendor.packages === null || !Array.isArray(vendor.packages)) {
|
|
51121
51116
|
return false;
|
|
51122
51117
|
}
|
|
51123
51118
|
return vendor.packages.some(pkg => !pkg.hasOwnProperty('status') || pkg.status == null || pkg.status === undefined || pkg.status === '');
|
|
51124
51119
|
});
|
|
51125
|
-
}, [itemAndPackage
|
|
51120
|
+
}, [itemAndPackage]);
|
|
51126
51121
|
const actuallyAllFormsSent = AllFormsSent && !hasUnisentPackages;
|
|
51127
51122
|
React$1.useEffect(() => {
|
|
51128
51123
|
if (screen === "success" && onSendForms) {
|
|
@@ -51258,28 +51253,22 @@ const ItemManagerPanel = _ref => {
|
|
|
51258
51253
|
}))), /*#__PURE__*/React__default["default"].createElement(VendorListWrapper$2, {
|
|
51259
51254
|
disabled: disableSection,
|
|
51260
51255
|
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, {
|
|
51256
|
+
}, /*#__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
51257
|
key: idx
|
|
51270
|
-
}, /*#__PURE__*/React__default["default"].createElement(DotContainer, null, item.packages
|
|
51258
|
+
}, /*#__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
51259
|
onClick: e => {
|
|
51272
51260
|
handleVendorClick(item);
|
|
51273
51261
|
}
|
|
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
|
-
|
|
51262
|
+
}, /*#__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, (() => {
|
|
51263
|
+
const packagesWithStatus = item.packages.filter(pkg => pkg.hasOwnProperty('status') && pkg.status != null && pkg.status !== undefined && pkg.status !== '');
|
|
51264
|
+
const allHaveStatus = packagesWithStatus.length === item.packages.length;
|
|
51265
|
+
const noneHaveStatus = packagesWithStatus.length === 0;
|
|
51266
|
+
if (noneHaveStatus) {
|
|
51267
|
+
return `0/${item.packages.length} sent`;
|
|
51268
|
+
} else if (allHaveStatus) {
|
|
51269
|
+
return `${item.packages.length}/${item.packages.length} sent`;
|
|
51281
51270
|
} else {
|
|
51282
|
-
return `${packagesWithStatus.length}/${item.packages.length}
|
|
51271
|
+
return `${packagesWithStatus.length}/${item.packages.length} sent`;
|
|
51283
51272
|
}
|
|
51284
51273
|
})())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(Trash$1, {
|
|
51285
51274
|
className: "trash-icon",
|
|
@@ -52399,11 +52388,12 @@ const CardsContainer = styled__default["default"].div`
|
|
|
52399
52388
|
const StatusCard = styled__default["default"].div`
|
|
52400
52389
|
position: relative;
|
|
52401
52390
|
background-color: white;
|
|
52402
|
-
border-bottom:
|
|
52391
|
+
border-bottom: ${props => props.isSelected ? `3px solid ${props.borderColor}` : 'none'};
|
|
52403
52392
|
border-radius: 12px;
|
|
52404
52393
|
padding: 12px 16px;
|
|
52405
52394
|
flex-grow: 1;
|
|
52406
52395
|
flex-basis: 0;
|
|
52396
|
+
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.10);
|
|
52407
52397
|
`;
|
|
52408
52398
|
const CardHeader = styled__default["default"].div`
|
|
52409
52399
|
display: flex;
|
|
@@ -52411,6 +52401,27 @@ const CardHeader = styled__default["default"].div`
|
|
|
52411
52401
|
align-items: center;
|
|
52412
52402
|
margin-bottom: 10px;
|
|
52413
52403
|
`;
|
|
52404
|
+
const CheckmarkContainer = styled__default["default"].div`
|
|
52405
|
+
width: 17px;
|
|
52406
|
+
height: 17px;
|
|
52407
|
+
border: 2px solid #212121;
|
|
52408
|
+
border-radius: 4px;
|
|
52409
|
+
display: flex;
|
|
52410
|
+
align-items: center;
|
|
52411
|
+
justify-content: center;
|
|
52412
|
+
margin-left: auto;
|
|
52413
|
+
color: white;
|
|
52414
|
+
transition: background-color .15s ease, border-color .15s ease;
|
|
52415
|
+
pointer-events: none;
|
|
52416
|
+
|
|
52417
|
+
&.checked {
|
|
52418
|
+
background-color: #066768;
|
|
52419
|
+
border-color: #066768;
|
|
52420
|
+
}
|
|
52421
|
+
|
|
52422
|
+
svg { display: none; }
|
|
52423
|
+
&.checked svg { display: block; }
|
|
52424
|
+
`;
|
|
52414
52425
|
const Circle = styled__default["default"].div`
|
|
52415
52426
|
width: 16px;
|
|
52416
52427
|
height: 16px;
|
|
@@ -52422,10 +52433,8 @@ const CardTitle = styled__default["default"].h3`
|
|
|
52422
52433
|
margin: 0;
|
|
52423
52434
|
font-size: 18px;
|
|
52424
52435
|
font-weight: 500;
|
|
52425
|
-
color: ${props => props.isSelected ? props.color : '#666666'};
|
|
52426
|
-
transition: color 0.2s ease-in-out;
|
|
52427
52436
|
`;
|
|
52428
|
-
|
|
52437
|
+
styled__default["default"].input`
|
|
52429
52438
|
width: 16px;
|
|
52430
52439
|
height: 16px;
|
|
52431
52440
|
accent-color: #066768;
|
|
@@ -52439,102 +52448,68 @@ const CardContent = styled__default["default"].div`
|
|
|
52439
52448
|
flex-direction: column;
|
|
52440
52449
|
align-items: flex-start;
|
|
52441
52450
|
`;
|
|
52442
|
-
const StatusCount = styled__default["default"].
|
|
52451
|
+
const StatusCount = styled__default["default"].span`
|
|
52443
52452
|
font-size: 32px;
|
|
52444
52453
|
font-weight: 500;
|
|
52445
|
-
color: ${props => props.isSelected ? props.color : '#999999'};
|
|
52446
52454
|
line-height: 1;
|
|
52447
|
-
margin: 0;
|
|
52448
|
-
transition: color 0.2s ease-in-out;
|
|
52449
52455
|
`;
|
|
52450
52456
|
|
|
52451
|
-
const
|
|
52457
|
+
const QuickFilterCards = _ref => {
|
|
52452
52458
|
let {
|
|
52453
|
-
|
|
52454
|
-
|
|
52455
|
-
disabled = false,
|
|
52459
|
+
data = [],
|
|
52460
|
+
onCardToggle = () => {},
|
|
52456
52461
|
width = "100%"
|
|
52457
52462
|
} = _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;
|
|
52463
|
+
// local mirror so UI updates immediately even if parent is slow/not controlling
|
|
52464
|
+
const [items, setItems] = React$1.useState(data);
|
|
52465
|
+
React$1.useEffect(() => setItems(data), [data]);
|
|
52481
52466
|
const handleCardClick = status => {
|
|
52482
|
-
|
|
52483
|
-
|
|
52484
|
-
|
|
52485
|
-
|
|
52486
|
-
|
|
52487
|
-
|
|
52488
|
-
|
|
52467
|
+
setItems(prev => {
|
|
52468
|
+
const clicked = prev.find(i => i.status === status);
|
|
52469
|
+
const nextChecked = clicked ? !clicked.checked : true;
|
|
52470
|
+
const next = prev.map(i => i.status === status ? {
|
|
52471
|
+
...i,
|
|
52472
|
+
checked: nextChecked
|
|
52473
|
+
} : i);
|
|
52474
|
+
onCardToggle(next, status, nextChecked);
|
|
52475
|
+
return next;
|
|
52476
|
+
});
|
|
52489
52477
|
};
|
|
52490
52478
|
return /*#__PURE__*/React__default["default"].createElement(CardsContainer, {
|
|
52491
52479
|
width: width,
|
|
52492
|
-
className: "
|
|
52493
|
-
},
|
|
52494
|
-
|
|
52480
|
+
className: "QuickFilterCardsContainer"
|
|
52481
|
+
}, items.map(_ref2 => {
|
|
52482
|
+
let {
|
|
52495
52483
|
status,
|
|
52496
52484
|
count,
|
|
52497
52485
|
checked,
|
|
52498
52486
|
color
|
|
52499
|
-
} =
|
|
52487
|
+
} = _ref2;
|
|
52500
52488
|
return /*#__PURE__*/React__default["default"].createElement(StatusCard, {
|
|
52501
52489
|
key: status,
|
|
52502
52490
|
className: `StatusCard StatusCard-${status}`,
|
|
52503
52491
|
isSelected: checked,
|
|
52504
52492
|
borderColor: color,
|
|
52505
|
-
|
|
52506
|
-
onClick: () => handleCardClick(status),
|
|
52507
|
-
"data-testid": `status-card-${status.toLowerCase()}`
|
|
52493
|
+
onClick: () => handleCardClick(status)
|
|
52508
52494
|
}, /*#__PURE__*/React__default["default"].createElement(CardHeader, null, /*#__PURE__*/React__default["default"].createElement(Circle, {
|
|
52509
52495
|
color: color
|
|
52510
|
-
}), /*#__PURE__*/React__default["default"].createElement(CardTitle, {
|
|
52511
|
-
|
|
52512
|
-
|
|
52513
|
-
|
|
52514
|
-
|
|
52515
|
-
|
|
52516
|
-
|
|
52517
|
-
}
|
|
52496
|
+
}), /*#__PURE__*/React__default["default"].createElement(CardTitle, null, status), /*#__PURE__*/React__default["default"].createElement(CheckmarkContainer, {
|
|
52497
|
+
className: checked ? "checked" : ""
|
|
52498
|
+
}, checked && /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
52499
|
+
width: "14",
|
|
52500
|
+
height: "14",
|
|
52501
|
+
viewBox: "0 0 20 20",
|
|
52502
|
+
fill: "currentColor"
|
|
52503
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
52504
|
+
fillRule: "evenodd",
|
|
52505
|
+
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",
|
|
52506
|
+
clipRule: "evenodd"
|
|
52507
|
+
})))), /*#__PURE__*/React__default["default"].createElement(CardContent, null, /*#__PURE__*/React__default["default"].createElement(StatusCount, {
|
|
52518
52508
|
isSelected: checked,
|
|
52519
52509
|
color: color
|
|
52520
52510
|
}, count)));
|
|
52521
52511
|
}));
|
|
52522
52512
|
};
|
|
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
52513
|
|
|
52539
52514
|
exports.AreaChart = AreaChart;
|
|
52540
52515
|
exports.BannerEventBoxList = BannerEventBoxList;
|
|
@@ -52558,7 +52533,6 @@ exports.DownloadProgress = DownloadProgress;
|
|
|
52558
52533
|
exports.DropdownNew = DropdownNew;
|
|
52559
52534
|
exports.EventDetailsCard = EventDetailsCard;
|
|
52560
52535
|
exports.EventList = EventList;
|
|
52561
|
-
exports.EventStatusCards = EventStatusCards;
|
|
52562
52536
|
exports.Execute = Execute;
|
|
52563
52537
|
exports.FilterPanel = FilterPanel;
|
|
52564
52538
|
exports.FilterPop = FilterPop;
|
|
@@ -52580,6 +52554,7 @@ exports.PerformanceAnalyticsLegend = PerformanceAnalyticsLegend;
|
|
|
52580
52554
|
exports.PieChart = PieChart;
|
|
52581
52555
|
exports.PopupCharts = PopupCharts;
|
|
52582
52556
|
exports.QuickFilter = QuickFilter;
|
|
52557
|
+
exports.QuickFilterCards = QuickFilterCards;
|
|
52583
52558
|
exports.RangePicker = RangePicker;
|
|
52584
52559
|
exports.RangePop = RangePop;
|
|
52585
52560
|
exports.ReportTable = ReportTable;
|