sag_components 2.0.0-beta136 → 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 +74 -90
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +74 -90
- 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.d.ts
CHANGED
|
@@ -1508,25 +1508,11 @@ declare function ToasterMessageBox({ color, messageText, linkText, duration, wid
|
|
|
1508
1508
|
onClose?: () => void;
|
|
1509
1509
|
}): react_jsx_runtime.JSX.Element;
|
|
1510
1510
|
|
|
1511
|
-
declare function EventStatusCards({
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
disabled?: boolean;
|
|
1511
|
+
declare function EventStatusCards({ data, onCardToggle, width, }: {
|
|
1512
|
+
data?: any[];
|
|
1513
|
+
onCardToggle?: () => void;
|
|
1515
1514
|
width?: string;
|
|
1516
|
-
}): react_jsx_runtime.JSX.Element;
|
|
1517
|
-
declare namespace EventStatusCards {
|
|
1518
|
-
namespace propTypes {
|
|
1519
|
-
const statusData: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1520
|
-
status: PropTypes.Validator<string>;
|
|
1521
|
-
count: PropTypes.Validator<number>;
|
|
1522
|
-
checked: PropTypes.Validator<boolean>;
|
|
1523
|
-
color: PropTypes.Validator<string>;
|
|
1524
|
-
}>[]>;
|
|
1525
|
-
const onStatusToggle: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1526
|
-
const disabled: PropTypes.Requireable<boolean>;
|
|
1527
|
-
const width: PropTypes.Requireable<string>;
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1515
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1530
1516
|
|
|
1531
1517
|
declare function RangePicker({ label, onChange, borderRadius, required, width, height, placeholder, disabled, borderColor, borderColorFocus, textColor, selectedValue, }: {
|
|
1532
1518
|
label: any;
|
package/dist/index.esm.js
CHANGED
|
@@ -24314,24 +24314,23 @@ const IconContainer$2 = styled.div`
|
|
|
24314
24314
|
cursor: pointer;
|
|
24315
24315
|
`;
|
|
24316
24316
|
|
|
24317
|
-
const QuickFilterDropdownMultiSelection =
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24322
|
-
|
|
24323
|
-
|
|
24324
|
-
|
|
24325
|
-
|
|
24326
|
-
|
|
24327
|
-
|
|
24328
|
-
|
|
24329
|
-
|
|
24330
|
-
|
|
24331
|
-
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
} = _ref;
|
|
24317
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24318
|
+
label,
|
|
24319
|
+
labelEmptyValue,
|
|
24320
|
+
options,
|
|
24321
|
+
selectedValue,
|
|
24322
|
+
placeHolder,
|
|
24323
|
+
onChange,
|
|
24324
|
+
required,
|
|
24325
|
+
disabled,
|
|
24326
|
+
width,
|
|
24327
|
+
error,
|
|
24328
|
+
errorMessage,
|
|
24329
|
+
labelColor,
|
|
24330
|
+
xIconShow,
|
|
24331
|
+
checkBoxColor,
|
|
24332
|
+
showLabelOnTop
|
|
24333
|
+
}) => {
|
|
24335
24334
|
const [isFocused, setIsFocused] = useState(false);
|
|
24336
24335
|
const [showOptions, setShowOptions] = useState(false);
|
|
24337
24336
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -36859,7 +36858,7 @@ const TruncatedText$1 = styled.span`
|
|
|
36859
36858
|
text-overflow: ellipsis;
|
|
36860
36859
|
font-size: 14px;
|
|
36861
36860
|
`;
|
|
36862
|
-
const Checkmark
|
|
36861
|
+
const Checkmark = styled.span`
|
|
36863
36862
|
color: ${props => props.color};
|
|
36864
36863
|
margin-left: 8px;
|
|
36865
36864
|
font-weight: bold;
|
|
@@ -36958,7 +36957,7 @@ const SortPop = props => {
|
|
|
36958
36957
|
onClick: () => {
|
|
36959
36958
|
handleChange(item);
|
|
36960
36959
|
}
|
|
36961
|
-
}, /*#__PURE__*/React$1.createElement(TruncatedText$1, null, item.label), item.value === value && /*#__PURE__*/React$1.createElement(Checkmark
|
|
36960
|
+
}, /*#__PURE__*/React$1.createElement(TruncatedText$1, null, item.label), item.value === value && /*#__PURE__*/React$1.createElement(Checkmark, {
|
|
36962
36961
|
color: color
|
|
36963
36962
|
}, "\u2713")))), /*#__PURE__*/React$1.createElement(ButtonWrapper$1, null, /*#__PURE__*/React$1.createElement(ResetButton, {
|
|
36964
36963
|
onClick: handleReset,
|
|
@@ -52375,7 +52374,7 @@ const CardsContainer = styled.div`
|
|
|
52375
52374
|
const StatusCard = styled.div`
|
|
52376
52375
|
position: relative;
|
|
52377
52376
|
background-color: white;
|
|
52378
|
-
border-bottom:
|
|
52377
|
+
border-bottom: ${props => props.isSelected ? `3px solid ${props.borderColor}` : 'none'};
|
|
52379
52378
|
border-radius: 12px;
|
|
52380
52379
|
padding: 12px 16px;
|
|
52381
52380
|
flex-grow: 1;
|
|
@@ -52387,6 +52386,27 @@ const CardHeader = styled.div`
|
|
|
52387
52386
|
align-items: center;
|
|
52388
52387
|
margin-bottom: 10px;
|
|
52389
52388
|
`;
|
|
52389
|
+
const CheckmarkContainer = styled.div`
|
|
52390
|
+
width: 17px;
|
|
52391
|
+
height: 17px;
|
|
52392
|
+
border: 2px solid #212121;
|
|
52393
|
+
border-radius: 4px;
|
|
52394
|
+
display: flex;
|
|
52395
|
+
align-items: center;
|
|
52396
|
+
justify-content: center;
|
|
52397
|
+
margin-left: auto;
|
|
52398
|
+
color: white;
|
|
52399
|
+
transition: background-color .15s ease, border-color .15s ease;
|
|
52400
|
+
pointer-events: none;
|
|
52401
|
+
|
|
52402
|
+
&.checked {
|
|
52403
|
+
background-color: #066768;
|
|
52404
|
+
border-color: #066768;
|
|
52405
|
+
}
|
|
52406
|
+
|
|
52407
|
+
svg { display: none; }
|
|
52408
|
+
&.checked svg { display: block; }
|
|
52409
|
+
`;
|
|
52390
52410
|
const Circle = styled.div`
|
|
52391
52411
|
width: 16px;
|
|
52392
52412
|
height: 16px;
|
|
@@ -52398,10 +52418,8 @@ const CardTitle = styled.h3`
|
|
|
52398
52418
|
margin: 0;
|
|
52399
52419
|
font-size: 18px;
|
|
52400
52420
|
font-weight: 500;
|
|
52401
|
-
color: ${props => props.isSelected ? props.color : '#666666'};
|
|
52402
|
-
transition: color 0.2s ease-in-out;
|
|
52403
52421
|
`;
|
|
52404
|
-
|
|
52422
|
+
styled.input`
|
|
52405
52423
|
width: 16px;
|
|
52406
52424
|
height: 16px;
|
|
52407
52425
|
accent-color: #066768;
|
|
@@ -52415,102 +52433,68 @@ const CardContent = styled.div`
|
|
|
52415
52433
|
flex-direction: column;
|
|
52416
52434
|
align-items: flex-start;
|
|
52417
52435
|
`;
|
|
52418
|
-
const StatusCount = styled.
|
|
52436
|
+
const StatusCount = styled.span`
|
|
52419
52437
|
font-size: 32px;
|
|
52420
52438
|
font-weight: 500;
|
|
52421
|
-
color: ${props => props.isSelected ? props.color : '#999999'};
|
|
52422
52439
|
line-height: 1;
|
|
52423
|
-
margin: 0;
|
|
52424
|
-
transition: color 0.2s ease-in-out;
|
|
52425
52440
|
`;
|
|
52426
52441
|
|
|
52427
52442
|
const EventStatusCards = _ref => {
|
|
52428
52443
|
let {
|
|
52429
|
-
|
|
52430
|
-
|
|
52431
|
-
disabled = false,
|
|
52444
|
+
data = [],
|
|
52445
|
+
onCardToggle = () => {},
|
|
52432
52446
|
width = "100%"
|
|
52433
52447
|
} = _ref;
|
|
52434
|
-
//
|
|
52435
|
-
const
|
|
52436
|
-
|
|
52437
|
-
count: 0,
|
|
52438
|
-
checked: true,
|
|
52439
|
-
color: "#F5C9A7"
|
|
52440
|
-
}, {
|
|
52441
|
-
status: "Received",
|
|
52442
|
-
count: 0,
|
|
52443
|
-
checked: true,
|
|
52444
|
-
color: "#B9D5D5"
|
|
52445
|
-
}, {
|
|
52446
|
-
status: "Approved",
|
|
52447
|
-
count: 0,
|
|
52448
|
-
checked: true,
|
|
52449
|
-
color: "#BEDDC3"
|
|
52450
|
-
}, {
|
|
52451
|
-
status: "Cancelled",
|
|
52452
|
-
count: 0,
|
|
52453
|
-
checked: true,
|
|
52454
|
-
color: "#EBA6AF"
|
|
52455
|
-
}];
|
|
52456
|
-
const displayData = statusData.length > 0 ? statusData : defaultStatusData;
|
|
52448
|
+
// local mirror so UI updates immediately even if parent is slow/not controlling
|
|
52449
|
+
const [items, setItems] = useState(data);
|
|
52450
|
+
useEffect(() => setItems(data), [data]);
|
|
52457
52451
|
const handleCardClick = status => {
|
|
52458
|
-
|
|
52459
|
-
|
|
52460
|
-
|
|
52461
|
-
|
|
52462
|
-
|
|
52463
|
-
|
|
52464
|
-
|
|
52452
|
+
setItems(prev => {
|
|
52453
|
+
const clicked = prev.find(i => i.status === status);
|
|
52454
|
+
const nextChecked = clicked ? !clicked.checked : true;
|
|
52455
|
+
const next = prev.map(i => i.status === status ? {
|
|
52456
|
+
...i,
|
|
52457
|
+
checked: nextChecked
|
|
52458
|
+
} : i);
|
|
52459
|
+
onCardToggle(next, status, nextChecked);
|
|
52460
|
+
return next;
|
|
52461
|
+
});
|
|
52465
52462
|
};
|
|
52466
52463
|
return /*#__PURE__*/React$1.createElement(CardsContainer, {
|
|
52467
52464
|
width: width,
|
|
52468
52465
|
className: "EventStatusCardsContainer"
|
|
52469
|
-
},
|
|
52470
|
-
|
|
52466
|
+
}, items.map(_ref2 => {
|
|
52467
|
+
let {
|
|
52471
52468
|
status,
|
|
52472
52469
|
count,
|
|
52473
52470
|
checked,
|
|
52474
52471
|
color
|
|
52475
|
-
} =
|
|
52472
|
+
} = _ref2;
|
|
52476
52473
|
return /*#__PURE__*/React$1.createElement(StatusCard, {
|
|
52477
52474
|
key: status,
|
|
52478
52475
|
className: `StatusCard StatusCard-${status}`,
|
|
52479
52476
|
isSelected: checked,
|
|
52480
52477
|
borderColor: color,
|
|
52481
|
-
|
|
52482
|
-
onClick: () => handleCardClick(status),
|
|
52483
|
-
"data-testid": `status-card-${status.toLowerCase()}`
|
|
52478
|
+
onClick: () => handleCardClick(status)
|
|
52484
52479
|
}, /*#__PURE__*/React$1.createElement(CardHeader, null, /*#__PURE__*/React$1.createElement(Circle, {
|
|
52485
52480
|
color: color
|
|
52486
|
-
}), /*#__PURE__*/React$1.createElement(CardTitle, {
|
|
52487
|
-
|
|
52488
|
-
|
|
52489
|
-
|
|
52490
|
-
|
|
52491
|
-
|
|
52492
|
-
|
|
52493
|
-
}
|
|
52481
|
+
}), /*#__PURE__*/React$1.createElement(CardTitle, null, status), /*#__PURE__*/React$1.createElement(CheckmarkContainer, {
|
|
52482
|
+
className: checked ? "checked" : ""
|
|
52483
|
+
}, checked && /*#__PURE__*/React$1.createElement("svg", {
|
|
52484
|
+
width: "14",
|
|
52485
|
+
height: "14",
|
|
52486
|
+
viewBox: "0 0 20 20",
|
|
52487
|
+
fill: "currentColor"
|
|
52488
|
+
}, /*#__PURE__*/React$1.createElement("path", {
|
|
52489
|
+
fillRule: "evenodd",
|
|
52490
|
+
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",
|
|
52491
|
+
clipRule: "evenodd"
|
|
52492
|
+
})))), /*#__PURE__*/React$1.createElement(CardContent, null, /*#__PURE__*/React$1.createElement(StatusCount, {
|
|
52494
52493
|
isSelected: checked,
|
|
52495
52494
|
color: color
|
|
52496
52495
|
}, count)));
|
|
52497
52496
|
}));
|
|
52498
52497
|
};
|
|
52499
|
-
EventStatusCards.propTypes = {
|
|
52500
|
-
/** Array of status objects with count, checked state, and color information */
|
|
52501
|
-
statusData: PropTypes.arrayOf(PropTypes.shape({
|
|
52502
|
-
status: PropTypes.oneOf(["Pending", "Received", "Approved", "Cancelled"]).isRequired,
|
|
52503
|
-
count: PropTypes.number.isRequired,
|
|
52504
|
-
checked: PropTypes.bool.isRequired,
|
|
52505
|
-
color: PropTypes.string.isRequired
|
|
52506
|
-
})),
|
|
52507
|
-
/** Callback function when status selection changes */
|
|
52508
|
-
onStatusToggle: PropTypes.func,
|
|
52509
|
-
/** Whether the cards are disabled */
|
|
52510
|
-
disabled: PropTypes.bool,
|
|
52511
|
-
/** Width of the entire cards container */
|
|
52512
|
-
width: PropTypes.string
|
|
52513
|
-
};
|
|
52514
52498
|
|
|
52515
52499
|
export { AreaChart, BannerEventBoxList, BarChart, BarChartTwoRows, BarChartWithAreaChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Build, Button$1 as Button, CollapseData, CollapseHeader, ContainerTable, DialogOverlay$1 as DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, DownloadProgress, DropdownNew, EventDetailsCard, EventList, EventStatusCards, Execute, FilterPanel, FilterPop, Heatmap, IconButton$1 as IconButton, Input$2 as Input, InsightsCarousel, ItemManagerPanel, LinkButton, LinnerDataBox, MarketShareDescription, MenuRoute, MessageBox, ModalDrawer, ModalWithOverlay, OneColumnContainer, OverlayDropdown, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, RangePicker, RangePop, ReportTable, SearchInput, SingleBarLineCharts, SortPop, TabMenu, Table, ToasterMessageBox, ToggleSwitch, Tooltip$2 as Tooltip, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts, Track, TwoBarCharts, WeeksPicker };
|
|
52516
52500
|
//# sourceMappingURL=index.esm.js.map
|