sag_components 2.0.0-beta103 → 2.0.0-beta104
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
|
@@ -416,21 +416,19 @@ const RedDot = ({
|
|
|
416
416
|
fill: "#F00021"
|
|
417
417
|
}));
|
|
418
418
|
|
|
419
|
-
const CalendarInOpen = (
|
|
420
|
-
width
|
|
421
|
-
height
|
|
422
|
-
|
|
419
|
+
const CalendarInOpen = ({
|
|
420
|
+
width = "16",
|
|
421
|
+
height = "17",
|
|
422
|
+
fill = "#726F6F"
|
|
423
|
+
}) => /*#__PURE__*/React$1.createElement("svg", {
|
|
424
|
+
width: width,
|
|
425
|
+
height: height,
|
|
426
|
+
viewBox: "0 0 16 17",
|
|
423
427
|
fill: "none",
|
|
424
428
|
xmlns: "http://www.w3.org/2000/svg"
|
|
425
|
-
}, /*#__PURE__*/React$1.createElement("
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
rx: "4",
|
|
429
|
-
fill: "#229E38",
|
|
430
|
-
fillOpacity: "0.1"
|
|
431
|
-
}), /*#__PURE__*/React$1.createElement("path", {
|
|
432
|
-
d: "M7.625 5C7.8125 5 8 5.1875 8 5.375V6.5H12.5V5.375C12.5 5.1875 12.6641 5 12.875 5C13.0625 5 13.25 5.1875 13.25 5.375V6.5H14C14.8203 6.5 15.5 7.17969 15.5 8V8.75V9.5V15.5C15.5 16.3438 14.8203 17 14 17H6.5C5.65625 17 5 16.3438 5 15.5V9.5V8.75V8C5 7.17969 5.65625 6.5 6.5 6.5H7.25V5.375C7.25 5.1875 7.41406 5 7.625 5ZM14.75 9.5H5.75V15.5C5.75 15.9219 6.07812 16.25 6.5 16.25H14C14.3984 16.25 14.75 15.9219 14.75 15.5V9.5ZM14 7.25H6.5C6.07812 7.25 5.75 7.60156 5.75 8V8.75H14.75V8C14.75 7.60156 14.3984 7.25 14 7.25Z",
|
|
433
|
-
fill: "#066768"
|
|
429
|
+
}, /*#__PURE__*/React$1.createElement("path", {
|
|
430
|
+
d: "M5.375 2.7002C5.5625 2.7002 5.75 2.87327 5.75 3.04635V4.08481H10.25V3.04635C10.25 2.87327 10.4141 2.7002 10.625 2.7002C10.8125 2.7002 11 2.87327 11 3.04635V4.08481H11.75C12.5703 4.08481 13.25 4.71222 13.25 5.46943V6.16173V6.85404V12.3925C13.25 13.1714 12.5703 13.7771 11.75 13.7771H4.25C3.40625 13.7771 2.75 13.1714 2.75 12.3925V6.85404V6.16173V5.46943C2.75 4.71222 3.40625 4.08481 4.25 4.08481H5V3.04635C5 2.87327 5.16406 2.7002 5.375 2.7002ZM12.5 6.85404H10.0625V8.41173H12.5V6.85404ZM12.5 9.10404H10.0625V10.8348H12.5V9.10404ZM12.5 11.5271H10.0625V13.0848H11.75C12.1484 13.0848 12.5 12.7819 12.5 12.3925V11.5271ZM9.3125 10.8348V9.10404H6.6875V10.8348H9.3125ZM6.6875 11.5271V13.0848H9.3125V11.5271H6.6875ZM5.9375 10.8348V9.10404H3.5V10.8348H5.9375ZM3.5 11.5271V12.3925C3.5 12.7819 3.82812 13.0848 4.25 13.0848H5.9375V11.5271H3.5ZM3.5 8.41173H5.9375V6.85404H3.5V8.41173ZM6.6875 8.41173H9.3125V6.85404H6.6875V8.41173ZM11.75 4.77712H4.25C3.82812 4.77712 3.5 5.10164 3.5 5.46943V6.16173H12.5V5.46943C12.5 5.10164 12.1484 4.77712 11.75 4.77712Z",
|
|
431
|
+
fill: fill
|
|
434
432
|
}));
|
|
435
433
|
|
|
436
434
|
const Calendar = () => /*#__PURE__*/React$1.createElement("svg", {
|
|
@@ -23921,22 +23919,21 @@ const DeleteIcon = styled.div`
|
|
|
23921
23919
|
position: absolute;
|
|
23922
23920
|
`;
|
|
23923
23921
|
|
|
23924
|
-
const QuickFilterDropdownSingle =
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23930
|
-
|
|
23931
|
-
|
|
23932
|
-
|
|
23933
|
-
|
|
23934
|
-
|
|
23935
|
-
|
|
23936
|
-
|
|
23937
|
-
|
|
23938
|
-
|
|
23939
|
-
} = _ref;
|
|
23922
|
+
const QuickFilterDropdownSingle = ({
|
|
23923
|
+
label,
|
|
23924
|
+
hoverColor,
|
|
23925
|
+
options,
|
|
23926
|
+
selectedValue,
|
|
23927
|
+
placeHolder,
|
|
23928
|
+
onChange,
|
|
23929
|
+
disabled,
|
|
23930
|
+
width,
|
|
23931
|
+
error,
|
|
23932
|
+
errorMessage,
|
|
23933
|
+
xIconShow,
|
|
23934
|
+
labelColor,
|
|
23935
|
+
showLabelOnTop
|
|
23936
|
+
}) => {
|
|
23940
23937
|
const [isFocused, setIsFocused] = useState(false);
|
|
23941
23938
|
const [showOptions, setShowOptions] = useState(false);
|
|
23942
23939
|
const [inputValue, setInputValue] = useState("");
|
|
@@ -34363,6 +34360,7 @@ const Modal = styled.div`
|
|
|
34363
34360
|
display: flex;
|
|
34364
34361
|
gap: 20px;
|
|
34365
34362
|
padding: 20px;
|
|
34363
|
+
margin-top: 50px;
|
|
34366
34364
|
flex-direction: column;
|
|
34367
34365
|
background-color: white;
|
|
34368
34366
|
border-radius: 12px;
|
|
@@ -34482,15 +34480,10 @@ const CalendarWrapper = styled.div`
|
|
|
34482
34480
|
|
|
34483
34481
|
/* ───────────────────────── header */
|
|
34484
34482
|
const Header$2 = styled.h4`
|
|
34485
|
-
margin: 0 0
|
|
34483
|
+
margin: 0 0 20px;
|
|
34486
34484
|
color: ${c.text};
|
|
34487
|
-
|
|
34488
|
-
/* Content/P3 Regular */
|
|
34489
|
-
font-family: Poppins;
|
|
34490
34485
|
font-size: 12px;
|
|
34491
|
-
font-style: normal;
|
|
34492
34486
|
font-weight: 400;
|
|
34493
|
-
line-height: normal;
|
|
34494
34487
|
`;
|
|
34495
34488
|
|
|
34496
34489
|
/* ───────────────────────── grid */
|
|
@@ -34642,20 +34635,24 @@ const WeeksCalendar = ({
|
|
|
34642
34635
|
onClick: () => handleCellClick(wk)
|
|
34643
34636
|
}, wk);
|
|
34644
34637
|
})), /*#__PURE__*/React$1.createElement(Footer, null, /*#__PURE__*/React$1.createElement(Button$1, {
|
|
34638
|
+
text: "CLEAR",
|
|
34645
34639
|
type: "secondary",
|
|
34646
34640
|
disabled: !hasSelection,
|
|
34647
|
-
|
|
34648
|
-
|
|
34641
|
+
borderRadius: "8px",
|
|
34642
|
+
onClick: clearAll
|
|
34649
34643
|
}), /*#__PURE__*/React$1.createElement(Button$1, {
|
|
34650
34644
|
type: "primary",
|
|
34645
|
+
text: "APPLY",
|
|
34651
34646
|
disabled: !hasSelection,
|
|
34647
|
+
borderRadius: "8px",
|
|
34648
|
+
borderColor: backgroundColor,
|
|
34652
34649
|
backgroundColor: backgroundColor,
|
|
34650
|
+
hoverBorderColor: hoverBackgroundColor,
|
|
34653
34651
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
34654
34652
|
hoverTextColor: "#212121",
|
|
34655
34653
|
onClick: () => {
|
|
34656
34654
|
if (hasSelection) onApply(startWeek, endWeek ?? startWeek);
|
|
34657
|
-
}
|
|
34658
|
-
text: "APPLY"
|
|
34655
|
+
}
|
|
34659
34656
|
}), onCancel && /*#__PURE__*/React$1.createElement("button", {
|
|
34660
34657
|
style: {
|
|
34661
34658
|
display: "none"
|
|
@@ -34678,9 +34675,10 @@ const WeeksPickerContainer = styled.div`
|
|
|
34678
34675
|
margin-bottom: ${props => props.withMarginBottom ? '10px' : '0'};
|
|
34679
34676
|
width: ${props => props.width || '100%'};
|
|
34680
34677
|
height: ${props => props.height || 'auto'};
|
|
34678
|
+
font-family: "Poppins", sans-serif;
|
|
34681
34679
|
`;
|
|
34682
34680
|
const StyledInput$1 = styled.input`
|
|
34683
|
-
padding:
|
|
34681
|
+
padding: 16px;
|
|
34684
34682
|
font-size: 14px;
|
|
34685
34683
|
border-radius: ${props => props.borderRadius || '4px'};
|
|
34686
34684
|
border: none;
|
|
@@ -34695,8 +34693,8 @@ const StyledInput$1 = styled.input`
|
|
|
34695
34693
|
cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
|
|
34696
34694
|
`;
|
|
34697
34695
|
const StyledLabel = styled.label`
|
|
34698
|
-
font-size:
|
|
34699
|
-
width: ${props => props.isFocused || props.hasValue ? 'auto' : '150px'};
|
|
34696
|
+
font-size: 14px;
|
|
34697
|
+
/* width: ${props => props.isFocused || props.hasValue ? 'auto' : '150px'}; */
|
|
34700
34698
|
color: ${props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333'};
|
|
34701
34699
|
position: absolute;
|
|
34702
34700
|
top: ${props => props.isFocused || props.hasValue ? '0px' : '50%'};
|
|
@@ -34720,11 +34718,15 @@ styled.div`
|
|
|
34720
34718
|
margin-top: 5px;
|
|
34721
34719
|
`;
|
|
34722
34720
|
const OptionsContainer = styled.div`
|
|
34723
|
-
position:
|
|
34721
|
+
position: absolute;
|
|
34724
34722
|
z-index: 999;
|
|
34723
|
+
${props => props.showAbove ? `
|
|
34724
|
+
bottom: 100%;
|
|
34725
|
+
` : `
|
|
34726
|
+
top: 100%;
|
|
34727
|
+
`}
|
|
34725
34728
|
`;
|
|
34726
34729
|
const InputContainer$1 = styled.div`
|
|
34727
|
-
position: relative;
|
|
34728
34730
|
display: flex;
|
|
34729
34731
|
flex-wrap: nowrap;
|
|
34730
34732
|
justify-content: flex-start;
|
|
@@ -34737,7 +34739,6 @@ const InputContainer$1 = styled.div`
|
|
|
34737
34739
|
box-sizing: border-box;
|
|
34738
34740
|
background-color: transparent;
|
|
34739
34741
|
border: 1px solid ${props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1'};
|
|
34740
|
-
font-family: "Poppins", sans-serif;
|
|
34741
34742
|
font-weight: 400;
|
|
34742
34743
|
font-size: 14px;
|
|
34743
34744
|
border-radius: 12px;
|
|
@@ -34782,8 +34783,46 @@ const WeeksPicker = _ref => {
|
|
|
34782
34783
|
} = _ref;
|
|
34783
34784
|
const [value, setValue] = useState("");
|
|
34784
34785
|
const inputRef = useRef(null);
|
|
34786
|
+
const containerRef = useRef(null);
|
|
34787
|
+
const optionsRef = useRef(null);
|
|
34785
34788
|
const [isFocused, setIsFocused] = useState(false);
|
|
34786
34789
|
const [isOpen, setIsOpen] = useState(false);
|
|
34790
|
+
const [showAbove, setShowAbove] = useState(false);
|
|
34791
|
+
|
|
34792
|
+
// Handle click outside to close calendar
|
|
34793
|
+
useEffect(() => {
|
|
34794
|
+
const handleClickOutside = event => {
|
|
34795
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
34796
|
+
setIsOpen(false);
|
|
34797
|
+
}
|
|
34798
|
+
};
|
|
34799
|
+
if (isOpen) {
|
|
34800
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
34801
|
+
}
|
|
34802
|
+
return () => {
|
|
34803
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
34804
|
+
};
|
|
34805
|
+
}, [isOpen]);
|
|
34806
|
+
|
|
34807
|
+
// Handle positioning when calendar opens
|
|
34808
|
+
useEffect(() => {
|
|
34809
|
+
if (isOpen && optionsRef.current && containerRef.current) {
|
|
34810
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
34811
|
+
const viewportHeight = window.innerHeight;
|
|
34812
|
+
const calendarHeight = 400; // Approximate height of the calendar
|
|
34813
|
+
|
|
34814
|
+
// Check if there's enough space below
|
|
34815
|
+
const spaceBelow = viewportHeight - containerRect.bottom;
|
|
34816
|
+
const spaceAbove = containerRect.top;
|
|
34817
|
+
|
|
34818
|
+
// Show above if there's not enough space below but enough space above
|
|
34819
|
+
if (spaceBelow < calendarHeight && spaceAbove > calendarHeight) {
|
|
34820
|
+
setShowAbove(true);
|
|
34821
|
+
} else {
|
|
34822
|
+
setShowAbove(false);
|
|
34823
|
+
}
|
|
34824
|
+
}
|
|
34825
|
+
}, [isOpen]);
|
|
34787
34826
|
const handleToggle = () => {
|
|
34788
34827
|
setIsOpen(!isOpen);
|
|
34789
34828
|
};
|
|
@@ -34809,11 +34848,16 @@ const WeeksPicker = _ref => {
|
|
|
34809
34848
|
setIsFocused(false);
|
|
34810
34849
|
};
|
|
34811
34850
|
return /*#__PURE__*/React$1.createElement(WeeksPickerContainer, {
|
|
34851
|
+
ref: containerRef,
|
|
34812
34852
|
width: width,
|
|
34813
34853
|
height: height,
|
|
34814
34854
|
withMarginBottom: withMarginBottom
|
|
34815
34855
|
}, /*#__PURE__*/React$1.createElement(InputContainer$1, {
|
|
34816
|
-
onClick:
|
|
34856
|
+
onClick: () => {
|
|
34857
|
+
if (!disabled) {
|
|
34858
|
+
handleToggle();
|
|
34859
|
+
}
|
|
34860
|
+
},
|
|
34817
34861
|
className: "InputContainer",
|
|
34818
34862
|
isFocused: isFocused,
|
|
34819
34863
|
hasValue: value,
|
|
@@ -34823,7 +34867,11 @@ const WeeksPicker = _ref => {
|
|
|
34823
34867
|
borderColorFocus: borderColorFocus
|
|
34824
34868
|
}, /*#__PURE__*/React$1.createElement(StyledLabel, {
|
|
34825
34869
|
className: "StyledLabel",
|
|
34826
|
-
onClick:
|
|
34870
|
+
onClick: () => {
|
|
34871
|
+
if (!disabled) {
|
|
34872
|
+
handleFocus();
|
|
34873
|
+
}
|
|
34874
|
+
},
|
|
34827
34875
|
isFocused: isFocused,
|
|
34828
34876
|
hasValue: value,
|
|
34829
34877
|
disabled: disabled,
|
|
@@ -34847,8 +34895,13 @@ const WeeksPicker = _ref => {
|
|
|
34847
34895
|
borderColor: borderColor,
|
|
34848
34896
|
textColor: textColor
|
|
34849
34897
|
}), /*#__PURE__*/React$1.createElement(CalendarDiv, {
|
|
34850
|
-
onClick: handleToggle
|
|
34851
|
-
},
|
|
34898
|
+
onClick: disabled ? undefined : handleToggle
|
|
34899
|
+
}, /*#__PURE__*/React$1.createElement(CalendarInOpen, {
|
|
34900
|
+
fill: isOpen === true ? "#726F6F" : "#B1B1B1"
|
|
34901
|
+
}))), isOpen && /*#__PURE__*/React$1.createElement(OptionsContainer, {
|
|
34902
|
+
ref: optionsRef,
|
|
34903
|
+
showAbove: showAbove
|
|
34904
|
+
}, /*#__PURE__*/React$1.createElement(WeeksCalendar, {
|
|
34852
34905
|
year: year,
|
|
34853
34906
|
backgroundColor: borderColorFocus,
|
|
34854
34907
|
hoverBackgroundColor: hoverColor,
|
|
@@ -37365,6 +37418,10 @@ const tooltipStyles = css`
|
|
|
37365
37418
|
top: calc(var(--tooltip-top, 0px) - var(--tooltip-offset, 60px));
|
|
37366
37419
|
left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2);
|
|
37367
37420
|
transform: translateX(-50%);
|
|
37421
|
+
|
|
37422
|
+
/* Add delay */
|
|
37423
|
+
opacity: 0;
|
|
37424
|
+
animation: showTooltip 0.3s ease-in-out 0.5s forwards;
|
|
37368
37425
|
}
|
|
37369
37426
|
|
|
37370
37427
|
/* Tooltip arrow */
|
|
@@ -37378,6 +37435,16 @@ const tooltipStyles = css`
|
|
|
37378
37435
|
border-top-color: white;
|
|
37379
37436
|
z-index: 1001;
|
|
37380
37437
|
pointer-events: none;
|
|
37438
|
+
|
|
37439
|
+
/* Add delay */
|
|
37440
|
+
opacity: 0;
|
|
37441
|
+
animation: showTooltip 0.3s ease-in-out 0.5s forwards;
|
|
37442
|
+
}
|
|
37443
|
+
|
|
37444
|
+
@keyframes showTooltip {
|
|
37445
|
+
to {
|
|
37446
|
+
opacity: 1;
|
|
37447
|
+
}
|
|
37381
37448
|
}
|
|
37382
37449
|
`;
|
|
37383
37450
|
const StyledTableBody = styled.tbody`
|
|
@@ -37467,6 +37534,10 @@ const TableCell = styled.td`
|
|
|
37467
37534
|
top: calc(var(--cell-top, 0px) - var(--cell-offset, 40px));
|
|
37468
37535
|
left: calc(var(--cell-left, 0px) + var(--cell-width, 0px) / 2);
|
|
37469
37536
|
transform: translateX(-50%);
|
|
37537
|
+
|
|
37538
|
+
/* Add delay */
|
|
37539
|
+
opacity: 0;
|
|
37540
|
+
animation: showTooltip 0.3s ease-in-out 0.5s forwards;
|
|
37470
37541
|
}
|
|
37471
37542
|
|
|
37472
37543
|
/* Tooltip arrow */
|
|
@@ -37480,6 +37551,10 @@ const TableCell = styled.td`
|
|
|
37480
37551
|
border-top-color: white;
|
|
37481
37552
|
z-index: 1001;
|
|
37482
37553
|
pointer-events: none;
|
|
37554
|
+
|
|
37555
|
+
/* Add delay */
|
|
37556
|
+
opacity: 0;
|
|
37557
|
+
animation: showTooltip 0.3s ease-in-out 0.5s forwards;
|
|
37483
37558
|
}
|
|
37484
37559
|
|
|
37485
37560
|
&[title] {
|