sag_components 2.0.0-beta196 → 2.0.0-beta198
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 +76 -87
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +76 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10589,23 +10589,24 @@ const QuarterPopupPicker = ({
|
|
|
10589
10589
|
};
|
|
10590
10590
|
|
|
10591
10591
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10592
|
-
const QuarterPicker =
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10592
|
+
const QuarterPicker = _ref => {
|
|
10593
|
+
let {
|
|
10594
|
+
availableQuarters,
|
|
10595
|
+
// ["Q1-2024"]
|
|
10596
|
+
label,
|
|
10597
|
+
onChange,
|
|
10598
|
+
borderRadius,
|
|
10599
|
+
required,
|
|
10600
|
+
width,
|
|
10601
|
+
height,
|
|
10602
|
+
placeholder,
|
|
10603
|
+
disabled,
|
|
10604
|
+
borderColor,
|
|
10605
|
+
borderColorFocus,
|
|
10606
|
+
textColor,
|
|
10607
|
+
selectedValue,
|
|
10608
|
+
startYear
|
|
10609
|
+
} = _ref;
|
|
10609
10610
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10610
10611
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10611
10612
|
const [value, setValue] = React$1.useState('');
|
|
@@ -11047,22 +11048,23 @@ const MonthPopupPicker = ({
|
|
|
11047
11048
|
};
|
|
11048
11049
|
|
|
11049
11050
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
11050
|
-
const MonthPicker =
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11051
|
+
const MonthPicker = _ref => {
|
|
11052
|
+
let {
|
|
11053
|
+
availableMonths,
|
|
11054
|
+
label,
|
|
11055
|
+
onChange,
|
|
11056
|
+
borderRadius,
|
|
11057
|
+
required,
|
|
11058
|
+
width,
|
|
11059
|
+
height,
|
|
11060
|
+
placeholder,
|
|
11061
|
+
disabled,
|
|
11062
|
+
borderColor,
|
|
11063
|
+
borderColorFocus,
|
|
11064
|
+
textColor,
|
|
11065
|
+
selectedValue,
|
|
11066
|
+
startYear
|
|
11067
|
+
} = _ref;
|
|
11066
11068
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
11067
11069
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
11068
11070
|
const [value, setValue] = React$1.useState('');
|
|
@@ -34884,17 +34886,18 @@ styled.css`
|
|
|
34884
34886
|
* • onApply(start,end) — callback, both numbers (inclusive)
|
|
34885
34887
|
* • onCancel() — callback
|
|
34886
34888
|
*/
|
|
34887
|
-
const WeeksCalendar =
|
|
34888
|
-
|
|
34889
|
-
|
|
34890
|
-
|
|
34891
|
-
|
|
34892
|
-
|
|
34893
|
-
|
|
34894
|
-
|
|
34895
|
-
|
|
34896
|
-
|
|
34897
|
-
|
|
34889
|
+
const WeeksCalendar = _ref => {
|
|
34890
|
+
let {
|
|
34891
|
+
year,
|
|
34892
|
+
defaultStartWeek = null,
|
|
34893
|
+
defaultEndWeek = null,
|
|
34894
|
+
backgroundColor = "#066768",
|
|
34895
|
+
hoverBackgroundColor = "#E6F0F0",
|
|
34896
|
+
allowedWeekRange = null,
|
|
34897
|
+
// New prop for range restriction
|
|
34898
|
+
onApply,
|
|
34899
|
+
onCancel
|
|
34900
|
+
} = _ref;
|
|
34898
34901
|
// state -------------------------------------------------
|
|
34899
34902
|
const [startWeek, setStartWeek] = React$1.useState(defaultStartWeek);
|
|
34900
34903
|
const [endWeek, setEndWeek] = React$1.useState(defaultEndWeek);
|
|
@@ -35033,28 +35036,22 @@ const StyledInput$1 = styled__default["default"].input`
|
|
|
35033
35036
|
box-sizing: border-box;
|
|
35034
35037
|
color: ${props => props.disabled ? '#888' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333'};
|
|
35035
35038
|
cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
|
|
35036
|
-
|
|
35037
|
-
&:disabled {
|
|
35038
|
-
background-color: #f5f5f5;
|
|
35039
|
-
cursor: not-allowed;
|
|
35040
|
-
}
|
|
35041
35039
|
`;
|
|
35042
35040
|
const StyledLabel = styled__default["default"].label`
|
|
35043
35041
|
font-size: 14px;
|
|
35042
|
+
/* width: ${props => props.isFocused || props.hasValue ? 'auto' : '150px'}; */
|
|
35044
35043
|
color: ${props => props.disabled ? '#888' : (props.isFocused || props.hasValue ? props.borderColorFocus : '#757575') || '#333'};
|
|
35045
35044
|
position: absolute;
|
|
35046
35045
|
top: ${props => props.isFocused || props.hasValue ? '0px' : '50%'};
|
|
35047
35046
|
left: 15px;
|
|
35048
35047
|
background-color: ${props => props.isFocused || props.hasValue ? 'white' : 'transparent'};
|
|
35049
35048
|
transform: translateY(-50%);
|
|
35050
|
-
transition: top 0.3s ease, font-size 0.3s ease
|
|
35049
|
+
transition: top 0.3s ease, font-size 0.3s ease;
|
|
35051
35050
|
display: flex;
|
|
35052
35051
|
font-weight: 400;
|
|
35053
35052
|
align-items: center;
|
|
35054
35053
|
box-sizing: border-box;
|
|
35055
|
-
cursor:
|
|
35056
|
-
padding: 0 4px;
|
|
35057
|
-
z-index: 1;
|
|
35054
|
+
cursor: pointer;
|
|
35058
35055
|
`;
|
|
35059
35056
|
const RequiredIndicator = styled__default["default"].span`
|
|
35060
35057
|
color: red;
|
|
@@ -35070,13 +35067,9 @@ const OptionsContainer = styled__default["default"].div`
|
|
|
35070
35067
|
z-index: 999;
|
|
35071
35068
|
${props => props.showAbove ? `
|
|
35072
35069
|
bottom: 100%;
|
|
35073
|
-
margin-bottom: 4px;
|
|
35074
35070
|
` : `
|
|
35075
35071
|
top: 100%;
|
|
35076
|
-
margin-top: 4px;
|
|
35077
35072
|
`}
|
|
35078
|
-
left: 0;
|
|
35079
|
-
right: 0;
|
|
35080
35073
|
`;
|
|
35081
35074
|
const InputContainer$1 = styled__default["default"].div`
|
|
35082
35075
|
display: flex;
|
|
@@ -35089,22 +35082,20 @@ const InputContainer$1 = styled__default["default"].div`
|
|
|
35089
35082
|
width: 100%;
|
|
35090
35083
|
height: 100%;
|
|
35091
35084
|
box-sizing: border-box;
|
|
35092
|
-
background-color:
|
|
35093
|
-
border:
|
|
35085
|
+
background-color: transparent;
|
|
35086
|
+
border: 1px solid ${props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1'};
|
|
35094
35087
|
font-weight: 400;
|
|
35095
35088
|
font-size: 14px;
|
|
35096
35089
|
border-radius: 12px;
|
|
35097
35090
|
outline: none;
|
|
35098
35091
|
color: ${props => props.disabled ? '#888' : '#212121'};
|
|
35099
|
-
position: relative;
|
|
35100
|
-
transition: border-color 0.3s ease, background-color 0.3s ease;
|
|
35101
35092
|
|
|
35102
35093
|
&:hover {
|
|
35103
35094
|
border: 1px solid ${props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121'};
|
|
35104
35095
|
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
35105
35096
|
}
|
|
35106
35097
|
|
|
35107
|
-
&:focus
|
|
35098
|
+
&:focus {
|
|
35108
35099
|
border: 1px solid ${props => props.disabled ? '#bdbdbd' : props.error ? 'red' : props.borderColorFocus || '#212121'};
|
|
35109
35100
|
}
|
|
35110
35101
|
`;
|
|
@@ -35114,11 +35105,6 @@ const CalendarDiv = styled__default["default"].div`
|
|
|
35114
35105
|
right: 10px;
|
|
35115
35106
|
display: flex;
|
|
35116
35107
|
align-items: center;
|
|
35117
|
-
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
35118
|
-
|
|
35119
|
-
svg {
|
|
35120
|
-
transition: fill 0.3s ease;
|
|
35121
|
-
}
|
|
35122
35108
|
`;
|
|
35123
35109
|
|
|
35124
35110
|
// src/components/WeeksPicker/WeeksPicker.jsx
|
|
@@ -40102,6 +40088,13 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
40102
40088
|
onCheckboxClick = () => {},
|
|
40103
40089
|
onHeaderCheckboxClick = () => {}
|
|
40104
40090
|
}, ref) => {
|
|
40091
|
+
// MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
|
|
40092
|
+
if (!Array.isArray(data) || !Array.isArray(columns)) {
|
|
40093
|
+
console.warn("TableBody: Invalid data or columns prop");
|
|
40094
|
+
return null;
|
|
40095
|
+
}
|
|
40096
|
+
|
|
40097
|
+
// NOW ALL THE HOOKS CAN BE CALLED SAFELY
|
|
40105
40098
|
const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
|
|
40106
40099
|
const [focusedRowIndex, setFocusedRowIndex] = React$1.useState(null);
|
|
40107
40100
|
const [isCommentModalOpen, setIsCommentModalOpen] = React$1.useState(false);
|
|
@@ -40114,12 +40107,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
40114
40107
|
const [hasUserInteracted, setHasUserInteracted] = React$1.useState(false);
|
|
40115
40108
|
const [hasInitialValue, setHasInitialValue] = React$1.useState(false);
|
|
40116
40109
|
|
|
40117
|
-
// Early return for invalid data
|
|
40118
|
-
if (!Array.isArray(data) || !Array.isArray(columns)) {
|
|
40119
|
-
console.warn("TableBody: Invalid data or columns prop");
|
|
40120
|
-
return null;
|
|
40121
|
-
}
|
|
40122
|
-
|
|
40123
40110
|
// Expose methods to parent component via ref
|
|
40124
40111
|
React$1.useImperativeHandle(ref, () => ({
|
|
40125
40112
|
clearFocus: () => {
|
|
@@ -40692,7 +40679,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
|
40692
40679
|
};
|
|
40693
40680
|
}, []);
|
|
40694
40681
|
|
|
40695
|
-
//
|
|
40682
|
+
// HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
|
|
40696
40683
|
if (data.length === 0) {
|
|
40697
40684
|
return /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
|
|
40698
40685
|
ref: ref
|
|
@@ -54566,10 +54553,11 @@ const DropdownList = styled__default["default"].ul`
|
|
|
54566
54553
|
`}
|
|
54567
54554
|
`;
|
|
54568
54555
|
const SectionDiv = styled__default["default"].div`
|
|
54569
|
-
${
|
|
54570
|
-
|
|
54571
|
-
|
|
54572
|
-
|
|
54556
|
+
${_ref => {
|
|
54557
|
+
let {
|
|
54558
|
+
$showBorder,
|
|
54559
|
+
margin
|
|
54560
|
+
} = _ref;
|
|
54573
54561
|
switch ($showBorder) {
|
|
54574
54562
|
case 'Template Offer':
|
|
54575
54563
|
return styled.css`border-top: 1px solid #e6e2e2ff;
|
|
@@ -54754,15 +54742,16 @@ function validateField(value, param) {
|
|
|
54754
54742
|
if (param.type === 'percent' && Number(value) > 100) return 'Max 100%';
|
|
54755
54743
|
return null;
|
|
54756
54744
|
}
|
|
54757
|
-
const OverlayTemplateDialog =
|
|
54758
|
-
|
|
54759
|
-
|
|
54760
|
-
|
|
54761
|
-
|
|
54762
|
-
|
|
54763
|
-
|
|
54764
|
-
|
|
54765
|
-
|
|
54745
|
+
const OverlayTemplateDialog = _ref => {
|
|
54746
|
+
let {
|
|
54747
|
+
open,
|
|
54748
|
+
onClose,
|
|
54749
|
+
onApply,
|
|
54750
|
+
template,
|
|
54751
|
+
params,
|
|
54752
|
+
buttonColor = '#1db6ab',
|
|
54753
|
+
buttonHoverColor = '#066768'
|
|
54754
|
+
} = _ref;
|
|
54766
54755
|
const [fields, setFields] = React$1.useState(() => params.map(() => ''));
|
|
54767
54756
|
const [touched, setTouched] = React$1.useState(() => params.map(() => false));
|
|
54768
54757
|
if (!open) return null;
|