sag_components 2.0.0-beta126 → 2.0.0-beta128
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 +8 -2
- package/dist/index.esm.js +239 -107
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +238 -106
- package/dist/index.js.map +1 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.d.ts +7 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.stories.d.ts +126 -0
- package/dist/types/components/OverlayDropdown/OverlayDropdown.style.d.ts +1 -0
- package/dist/types/components/Table/Table.d.ts +2 -1
- package/dist/types/components/Table/Table.stories.d.ts +32 -0
- package/dist/types/components/Table/TableBody.d.ts +2 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ const ButtonItem = styled__default["default"].div`
|
|
|
64
64
|
transition: background-color 0.3s, color 0.3s;
|
|
65
65
|
}
|
|
66
66
|
`;
|
|
67
|
-
const Label$
|
|
67
|
+
const Label$b = styled__default["default"].label`
|
|
68
68
|
font-family: "Poppins";
|
|
69
69
|
font-size: 14px;
|
|
70
70
|
font-weight: 400;
|
|
@@ -536,7 +536,7 @@ const Button$1 = props => {
|
|
|
536
536
|
onMouseEnter: () => setHover(true),
|
|
537
537
|
onMouseLeave: () => setHover(false),
|
|
538
538
|
borderRadius: borderRadius
|
|
539
|
-
}, commonProps), getIcon(leftIcon), /*#__PURE__*/React__default["default"].createElement(Label$
|
|
539
|
+
}, commonProps), getIcon(leftIcon), /*#__PURE__*/React__default["default"].createElement(Label$b, {
|
|
540
540
|
className: "Label",
|
|
541
541
|
disabled: disabled
|
|
542
542
|
}, text), getIcon(rightIcon)));
|
|
@@ -2978,7 +2978,7 @@ const LinkButtonItem = styled__default["default"].div`
|
|
|
2978
2978
|
transition: background-color 0.3s, color 0.3s;
|
|
2979
2979
|
}
|
|
2980
2980
|
`;
|
|
2981
|
-
const Label$
|
|
2981
|
+
const Label$a = styled__default["default"].label`
|
|
2982
2982
|
user-select: none;
|
|
2983
2983
|
pointer-events: none;
|
|
2984
2984
|
`;
|
|
@@ -3241,7 +3241,7 @@ const LinkButton = _ref => {
|
|
|
3241
3241
|
disabled: disabled,
|
|
3242
3242
|
text_color: textColor || (type === 'secondary' ? '#212121' : '#229E38'),
|
|
3243
3243
|
font_size: size === 'small' ? '14px' : '16px'
|
|
3244
|
-
}, getLeftIcon(), /*#__PURE__*/React__default["default"].createElement(Label$
|
|
3244
|
+
}, getLeftIcon(), /*#__PURE__*/React__default["default"].createElement(Label$a, {
|
|
3245
3245
|
className: "Label",
|
|
3246
3246
|
disabled: disabled,
|
|
3247
3247
|
font_size: size === 'small' ? '14px' : '16px'
|
|
@@ -3650,7 +3650,7 @@ const Body = styled__default["default"].div`
|
|
|
3650
3650
|
border-radius: ${props => props.setBackground ? '12px' : '0'};
|
|
3651
3651
|
box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
|
|
3652
3652
|
`;
|
|
3653
|
-
const Label$
|
|
3653
|
+
const Label$9 = styled__default["default"].div`
|
|
3654
3654
|
font-size: 12px;
|
|
3655
3655
|
font-weight: 400;
|
|
3656
3656
|
padding: 8px;
|
|
@@ -3901,7 +3901,7 @@ const TabMenu = props => {
|
|
|
3901
3901
|
hoverBorderColor: buttonHoverColor
|
|
3902
3902
|
})), showActions && /*#__PURE__*/React__default["default"].createElement(ActionsWrapper, {
|
|
3903
3903
|
className: "ActionsWrapper"
|
|
3904
|
-
}, showLabel && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
3904
|
+
}, showLabel && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Label$9, {
|
|
3905
3905
|
className: "Label"
|
|
3906
3906
|
}, /*#__PURE__*/React__default["default"].createElement("span", null, "Platform: "), "Total"), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3907
3907
|
className: "separator"
|
|
@@ -8535,7 +8535,7 @@ const DropdownWrapper$2 = styled__default["default"].div`
|
|
|
8535
8535
|
pointer-events: none;
|
|
8536
8536
|
}
|
|
8537
8537
|
`;
|
|
8538
|
-
const Label$
|
|
8538
|
+
const Label$8 = styled__default["default"].label`
|
|
8539
8539
|
font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
|
|
8540
8540
|
font-weight: 400;
|
|
8541
8541
|
padding-inline-end: 5px;
|
|
@@ -8857,7 +8857,7 @@ const DropdownSingleNew = ({
|
|
|
8857
8857
|
disabled: disabled,
|
|
8858
8858
|
error: error,
|
|
8859
8859
|
onClick: handleLabelClick
|
|
8860
|
-
}, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
8860
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$8, {
|
|
8861
8861
|
className: "Label",
|
|
8862
8862
|
isFocused: isFocused,
|
|
8863
8863
|
labelColor: labelColor,
|
|
@@ -8994,7 +8994,7 @@ const DropdownWrapper$1 = styled__default["default"].div`
|
|
|
8994
8994
|
pointer-events: none;
|
|
8995
8995
|
}
|
|
8996
8996
|
`;
|
|
8997
|
-
const Label$
|
|
8997
|
+
const Label$7 = styled__default["default"].label`
|
|
8998
8998
|
font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
|
|
8999
8999
|
font-weight: 400;
|
|
9000
9000
|
padding-inline-end: 5px;
|
|
@@ -9365,7 +9365,7 @@ const DropdownMultiNew = ({
|
|
|
9365
9365
|
disabled: disabled,
|
|
9366
9366
|
error: error,
|
|
9367
9367
|
onClick: handleLabelClick
|
|
9368
|
-
}, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
9368
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$7, {
|
|
9369
9369
|
className: "Label",
|
|
9370
9370
|
isFocused: isFocused,
|
|
9371
9371
|
labelColor: labelColor,
|
|
@@ -9883,21 +9883,20 @@ const DatePicker = ({
|
|
|
9883
9883
|
};
|
|
9884
9884
|
|
|
9885
9885
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
9886
|
-
const RangePicker =
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
} = _ref;
|
|
9886
|
+
const RangePicker = ({
|
|
9887
|
+
label,
|
|
9888
|
+
onChange,
|
|
9889
|
+
borderRadius,
|
|
9890
|
+
required,
|
|
9891
|
+
width,
|
|
9892
|
+
height,
|
|
9893
|
+
placeholder,
|
|
9894
|
+
disabled,
|
|
9895
|
+
borderColor,
|
|
9896
|
+
borderColorFocus,
|
|
9897
|
+
textColor,
|
|
9898
|
+
selectedValue
|
|
9899
|
+
}) => {
|
|
9901
9900
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
9902
9901
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
9903
9902
|
const [value, setValue] = React$1.useState(''); // Added value state
|
|
@@ -10321,24 +10320,23 @@ const QuarterPopupPicker = ({
|
|
|
10321
10320
|
};
|
|
10322
10321
|
|
|
10323
10322
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10324
|
-
const QuarterPicker =
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
} = _ref;
|
|
10323
|
+
const QuarterPicker = ({
|
|
10324
|
+
availableQuarters,
|
|
10325
|
+
// ["Q1-2024"]
|
|
10326
|
+
label,
|
|
10327
|
+
onChange,
|
|
10328
|
+
borderRadius,
|
|
10329
|
+
required,
|
|
10330
|
+
width,
|
|
10331
|
+
height,
|
|
10332
|
+
placeholder,
|
|
10333
|
+
disabled,
|
|
10334
|
+
borderColor,
|
|
10335
|
+
borderColorFocus,
|
|
10336
|
+
textColor,
|
|
10337
|
+
selectedValue,
|
|
10338
|
+
startYear
|
|
10339
|
+
}) => {
|
|
10342
10340
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10343
10341
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10344
10342
|
const [value, setValue] = React$1.useState('');
|
|
@@ -10780,23 +10778,22 @@ const MonthPopupPicker = ({
|
|
|
10780
10778
|
};
|
|
10781
10779
|
|
|
10782
10780
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10783
|
-
const MonthPicker =
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
} = _ref;
|
|
10781
|
+
const MonthPicker = ({
|
|
10782
|
+
availableMonths,
|
|
10783
|
+
label,
|
|
10784
|
+
onChange,
|
|
10785
|
+
borderRadius,
|
|
10786
|
+
required,
|
|
10787
|
+
width,
|
|
10788
|
+
height,
|
|
10789
|
+
placeholder,
|
|
10790
|
+
disabled,
|
|
10791
|
+
borderColor,
|
|
10792
|
+
borderColorFocus,
|
|
10793
|
+
textColor,
|
|
10794
|
+
selectedValue,
|
|
10795
|
+
startYear
|
|
10796
|
+
}) => {
|
|
10800
10797
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10801
10798
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10802
10799
|
const [value, setValue] = React$1.useState('');
|
|
@@ -23797,7 +23794,7 @@ const QuickFilterInput = styled__default["default"].div`
|
|
|
23797
23794
|
font-size: 14px;
|
|
23798
23795
|
border-radius: 8px;
|
|
23799
23796
|
`;
|
|
23800
|
-
const Label$
|
|
23797
|
+
const Label$6 = styled__default["default"].label`
|
|
23801
23798
|
font-size: 14px;
|
|
23802
23799
|
font-weight: 500;
|
|
23803
23800
|
color: ${props => props.disabled ? '#D0D0D0' : '212121'};
|
|
@@ -23907,21 +23904,22 @@ const DeleteIcon = styled__default["default"].div`
|
|
|
23907
23904
|
position: absolute;
|
|
23908
23905
|
`;
|
|
23909
23906
|
|
|
23910
|
-
const QuickFilterDropdownSingle =
|
|
23911
|
-
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
23915
|
-
|
|
23916
|
-
|
|
23917
|
-
|
|
23918
|
-
|
|
23919
|
-
|
|
23920
|
-
|
|
23921
|
-
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
|
|
23907
|
+
const QuickFilterDropdownSingle = _ref => {
|
|
23908
|
+
let {
|
|
23909
|
+
label,
|
|
23910
|
+
hoverColor,
|
|
23911
|
+
options,
|
|
23912
|
+
selectedValue,
|
|
23913
|
+
placeHolder,
|
|
23914
|
+
onChange,
|
|
23915
|
+
disabled,
|
|
23916
|
+
width,
|
|
23917
|
+
error,
|
|
23918
|
+
errorMessage,
|
|
23919
|
+
xIconShow,
|
|
23920
|
+
labelColor,
|
|
23921
|
+
showLabelOnTop
|
|
23922
|
+
} = _ref;
|
|
23925
23923
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
23926
23924
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
23927
23925
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
@@ -24044,7 +24042,7 @@ const QuickFilterDropdownSingle = ({
|
|
|
24044
24042
|
disabled: disabled,
|
|
24045
24043
|
error: error,
|
|
24046
24044
|
onClick: handleLabelClick
|
|
24047
|
-
}, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
24045
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$6, {
|
|
24048
24046
|
className: "Label",
|
|
24049
24047
|
isFocused: isFocused,
|
|
24050
24048
|
labelColor: labelColor,
|
|
@@ -24151,7 +24149,7 @@ const DropdownWrapper = styled__default["default"].div`
|
|
|
24151
24149
|
font-size: 14px;
|
|
24152
24150
|
border-radius: 10px;
|
|
24153
24151
|
`;
|
|
24154
|
-
const Label$
|
|
24152
|
+
const Label$5 = styled__default["default"].label`
|
|
24155
24153
|
font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
|
|
24156
24154
|
font-weight: 400;
|
|
24157
24155
|
padding-inline-end: 5px;
|
|
@@ -24508,7 +24506,7 @@ const QuickFilterDropdownMultiSelection = _ref => {
|
|
|
24508
24506
|
disabled: disabled,
|
|
24509
24507
|
error: error,
|
|
24510
24508
|
onClick: handleLabelClick
|
|
24511
|
-
}, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
24509
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$5, {
|
|
24512
24510
|
className: "Label",
|
|
24513
24511
|
isFocused: isFocused,
|
|
24514
24512
|
labelColor: labelColor,
|
|
@@ -29104,7 +29102,7 @@ const Controls$5 = styled__default["default"].div`
|
|
|
29104
29102
|
display: flex;
|
|
29105
29103
|
align-items: center;
|
|
29106
29104
|
`;
|
|
29107
|
-
const Label$
|
|
29105
|
+
const Label$4 = styled__default["default"].div`
|
|
29108
29106
|
display: flex;
|
|
29109
29107
|
padding: 0 10px 0 10px;
|
|
29110
29108
|
white-space: nowrap;
|
|
@@ -29184,7 +29182,7 @@ const CheckBox = props => {
|
|
|
29184
29182
|
width: iconSize,
|
|
29185
29183
|
height: iconSize,
|
|
29186
29184
|
color: disabled ? colorDisabled : colorUnchecked
|
|
29187
|
-
})), /*#__PURE__*/React__default["default"].createElement(Label$
|
|
29185
|
+
})), /*#__PURE__*/React__default["default"].createElement(Label$4, {
|
|
29188
29186
|
className: "Label",
|
|
29189
29187
|
"data-testid": "label"
|
|
29190
29188
|
}, label)));
|
|
@@ -34428,7 +34426,11 @@ const ModalWithOverlay = props => {
|
|
|
34428
34426
|
leftIcon: cancelButtonLeftIcon,
|
|
34429
34427
|
rightIcon: cancelButtonRightIcon,
|
|
34430
34428
|
text: cancelButtonText,
|
|
34431
|
-
onClick: onCancel
|
|
34429
|
+
onClick: onCancel,
|
|
34430
|
+
borderColor: "#D3D3D3",
|
|
34431
|
+
hoverTextColor: "#212121",
|
|
34432
|
+
hoverBackgroundColor: "#E6F0F0",
|
|
34433
|
+
hoverBorderColor: "#D3D3D3"
|
|
34432
34434
|
}), showOkButton && (disableOkButton && tooltipContent !== '' ? /*#__PURE__*/React__default["default"].createElement(Tooltip$2, {
|
|
34433
34435
|
direction: "top",
|
|
34434
34436
|
topFactor: -0.85,
|
|
@@ -35194,7 +35196,7 @@ const MainContainer = styled__default["default"].div`
|
|
|
35194
35196
|
padding: 0;
|
|
35195
35197
|
cursor: ${props => props.disabled ? 'not-allowed' : 'default'};
|
|
35196
35198
|
`;
|
|
35197
|
-
const Label$
|
|
35199
|
+
const Label$3 = styled__default["default"].label`
|
|
35198
35200
|
|
|
35199
35201
|
font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
|
|
35200
35202
|
font-weight: 400;
|
|
@@ -35416,7 +35418,7 @@ const Input$2 = _ref => {
|
|
|
35416
35418
|
error: error,
|
|
35417
35419
|
onClick: handleLabelClick,
|
|
35418
35420
|
size: size
|
|
35419
|
-
}, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
35421
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$3, {
|
|
35420
35422
|
className: "Label",
|
|
35421
35423
|
isFocused: isFocused,
|
|
35422
35424
|
labelColor: labelColor,
|
|
@@ -36670,7 +36672,7 @@ const FieldRow$1 = styled__default["default"].div`
|
|
|
36670
36672
|
justify-content: center;
|
|
36671
36673
|
padding: 16px;
|
|
36672
36674
|
`;
|
|
36673
|
-
const Label$
|
|
36675
|
+
const Label$2 = styled__default["default"].label`
|
|
36674
36676
|
color: #222;
|
|
36675
36677
|
display: flex;
|
|
36676
36678
|
align-items: center;
|
|
@@ -36760,7 +36762,7 @@ const RangePop = props => {
|
|
|
36760
36762
|
e.preventDefault();
|
|
36761
36763
|
if (isValid) onApply(fields);
|
|
36762
36764
|
}
|
|
36763
|
-
}, /*#__PURE__*/React__default["default"].createElement(RadioWrapper, null, radioOptions.map((option, idx) => /*#__PURE__*/React__default["default"].createElement(Label$
|
|
36765
|
+
}, /*#__PURE__*/React__default["default"].createElement(RadioWrapper, null, radioOptions.map((option, idx) => /*#__PURE__*/React__default["default"].createElement(Label$2, {
|
|
36764
36766
|
key: option
|
|
36765
36767
|
}, /*#__PURE__*/React__default["default"].createElement(Radio, {
|
|
36766
36768
|
type: "radio",
|
|
@@ -36773,7 +36775,7 @@ const RangePop = props => {
|
|
|
36773
36775
|
}
|
|
36774
36776
|
}), option))), /*#__PURE__*/React__default["default"].createElement(FieldRow$1, null, params.map((param, idx) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
36775
36777
|
key: param.label
|
|
36776
|
-
}, /*#__PURE__*/React__default["default"].createElement(Label$
|
|
36778
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$2, {
|
|
36777
36779
|
htmlFor: `param-${idx}`
|
|
36778
36780
|
}, param.label), /*#__PURE__*/React__default["default"].createElement(Input$1, {
|
|
36779
36781
|
id: `param-${idx}`,
|
|
@@ -36784,7 +36786,7 @@ const RangePop = props => {
|
|
|
36784
36786
|
onBlur: () => handleBlur(idx),
|
|
36785
36787
|
min: 0,
|
|
36786
36788
|
max: param.type === 'percent' ? 100 : undefined
|
|
36787
|
-
}))), /*#__PURE__*/React__default["default"].createElement(Label$
|
|
36789
|
+
}))), /*#__PURE__*/React__default["default"].createElement(Label$2, null, paramType)), /*#__PURE__*/React__default["default"].createElement(Actions$1, null, /*#__PURE__*/React__default["default"].createElement(ClearButton, {
|
|
36788
36790
|
type: "button",
|
|
36789
36791
|
onClick: () => {
|
|
36790
36792
|
setFields(params.map(() => ''));
|
|
@@ -37898,17 +37900,39 @@ const DisabledTrashIcon = ({
|
|
|
37898
37900
|
};
|
|
37899
37901
|
|
|
37900
37902
|
// TableBody.jsx
|
|
37901
|
-
const TableBody = ({
|
|
37903
|
+
const TableBody = /*#__PURE__*/React$1.forwardRef(({
|
|
37902
37904
|
columns,
|
|
37903
37905
|
data,
|
|
37904
37906
|
onRowClick,
|
|
37905
37907
|
onSendClick,
|
|
37906
37908
|
buttonColor,
|
|
37907
|
-
onDeleteClick
|
|
37908
|
-
|
|
37909
|
+
onDeleteClick,
|
|
37910
|
+
resetFocus = false,
|
|
37911
|
+
onFocusChange
|
|
37912
|
+
}, ref) => {
|
|
37909
37913
|
const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
|
|
37910
37914
|
const [focusedRowIndex, setFocusedRowIndex] = React$1.useState(null);
|
|
37911
37915
|
|
|
37916
|
+
// Expose methods to parent components via ref
|
|
37917
|
+
React$1.useImperativeHandle(ref, () => ({
|
|
37918
|
+
clearFocus: () => setFocusedRowIndex(null),
|
|
37919
|
+
getFocusedRowIndex: () => focusedRowIndex
|
|
37920
|
+
}));
|
|
37921
|
+
|
|
37922
|
+
// Handle resetFocus prop
|
|
37923
|
+
React$1.useEffect(() => {
|
|
37924
|
+
if (resetFocus) {
|
|
37925
|
+
setFocusedRowIndex(null);
|
|
37926
|
+
}
|
|
37927
|
+
}, [resetFocus]);
|
|
37928
|
+
|
|
37929
|
+
// Notify parent of focus changes
|
|
37930
|
+
React$1.useEffect(() => {
|
|
37931
|
+
if (onFocusChange) {
|
|
37932
|
+
onFocusChange(focusedRowIndex);
|
|
37933
|
+
}
|
|
37934
|
+
}, [focusedRowIndex, onFocusChange]);
|
|
37935
|
+
|
|
37912
37936
|
// Handle row click for focus state
|
|
37913
37937
|
const handleRowClick = (row, rowIndex) => {
|
|
37914
37938
|
setFocusedRowIndex(rowIndex);
|
|
@@ -38148,7 +38172,10 @@ const TableBody = ({
|
|
|
38148
38172
|
$maxWidth: column.maxWidth
|
|
38149
38173
|
}, formattedValue);
|
|
38150
38174
|
}))));
|
|
38151
|
-
};
|
|
38175
|
+
});
|
|
38176
|
+
|
|
38177
|
+
// Add displayName for better debugging
|
|
38178
|
+
TableBody.displayName = 'TableBody';
|
|
38152
38179
|
|
|
38153
38180
|
var nm$1 = "calendar_lottie";
|
|
38154
38181
|
var ddd$1 = 0;
|
|
@@ -41317,7 +41344,7 @@ var Lottie = function Lottie(props) {
|
|
|
41317
41344
|
};
|
|
41318
41345
|
|
|
41319
41346
|
// Table.jsx
|
|
41320
|
-
const Table = props => {
|
|
41347
|
+
const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
|
|
41321
41348
|
const {
|
|
41322
41349
|
width = '100%',
|
|
41323
41350
|
height = 'auto',
|
|
@@ -41348,10 +41375,34 @@ const Table = props => {
|
|
|
41348
41375
|
onDeleteClick = () => {},
|
|
41349
41376
|
showNoDataInSearch = false,
|
|
41350
41377
|
noDataInSearchTitle = "No Results Found",
|
|
41351
|
-
noDataInSearchMessage = "Try to refine your query and search again"
|
|
41378
|
+
noDataInSearchMessage = "Try to refine your query and search again",
|
|
41379
|
+
// New props for focus management
|
|
41380
|
+
resetTableFocus = false,
|
|
41381
|
+
onTableFocusChange = () => {},
|
|
41382
|
+
clearFocusOnOutsideClick = true
|
|
41352
41383
|
} = props;
|
|
41353
41384
|
const scrollWrapperRef = React$1.useRef(null);
|
|
41385
|
+
const tableBodyRef = React$1.useRef(null);
|
|
41386
|
+
const tableContainerRef = React$1.useRef(null);
|
|
41354
41387
|
const [hasTriggered, setHasTriggered] = React$1.useState(false);
|
|
41388
|
+
|
|
41389
|
+
// Expose method to clear table focus to parent components
|
|
41390
|
+
const clearTableFocus = () => {
|
|
41391
|
+
if (tableBodyRef.current) {
|
|
41392
|
+
tableBodyRef.current.clearFocus();
|
|
41393
|
+
}
|
|
41394
|
+
};
|
|
41395
|
+
|
|
41396
|
+
// Handle focus change from TableBody
|
|
41397
|
+
const handleTableFocusChange = focusedRowIndex => {
|
|
41398
|
+
onTableFocusChange(focusedRowIndex);
|
|
41399
|
+
};
|
|
41400
|
+
|
|
41401
|
+
// Expose methods to parent components via ref
|
|
41402
|
+
React$1.useImperativeHandle(ref, () => ({
|
|
41403
|
+
clearTableFocus,
|
|
41404
|
+
getTableBodyRef: () => tableBodyRef.current
|
|
41405
|
+
}));
|
|
41355
41406
|
React$1.useEffect(() => {
|
|
41356
41407
|
const scrollWrapper = scrollWrapperRef.current;
|
|
41357
41408
|
if (!scrollWrapper || !onLastRowsReached) return;
|
|
@@ -41380,6 +41431,23 @@ const Table = props => {
|
|
|
41380
41431
|
scrollWrapper.addEventListener('scroll', handleScroll);
|
|
41381
41432
|
return () => scrollWrapper.removeEventListener('scroll', handleScroll);
|
|
41382
41433
|
}, [onLastRowsReached, data.length, lastRowsThreshold, hasTriggered]);
|
|
41434
|
+
|
|
41435
|
+
// Handle outside click to clear focus
|
|
41436
|
+
React$1.useEffect(() => {
|
|
41437
|
+
if (!clearFocusOnOutsideClick) return;
|
|
41438
|
+
const handleOutsideClick = event => {
|
|
41439
|
+
if (tableContainerRef.current && !tableContainerRef.current.contains(event.target)) {
|
|
41440
|
+
// Click is outside the table container
|
|
41441
|
+
if (tableBodyRef.current) {
|
|
41442
|
+
tableBodyRef.current.clearFocus();
|
|
41443
|
+
}
|
|
41444
|
+
}
|
|
41445
|
+
};
|
|
41446
|
+
document.addEventListener('mousedown', handleOutsideClick);
|
|
41447
|
+
return () => {
|
|
41448
|
+
document.removeEventListener('mousedown', handleOutsideClick);
|
|
41449
|
+
};
|
|
41450
|
+
}, [clearFocusOnOutsideClick]);
|
|
41383
41451
|
return /*#__PURE__*/React__default["default"].createElement(TableWrapper, {
|
|
41384
41452
|
width: width,
|
|
41385
41453
|
height: height
|
|
@@ -41394,7 +41462,8 @@ const Table = props => {
|
|
|
41394
41462
|
hoverBackgroundColor: sideButtonHoverColor,
|
|
41395
41463
|
onClick: onSideButtonClick
|
|
41396
41464
|
})), children, /*#__PURE__*/React__default["default"].createElement(TableContainer, {
|
|
41397
|
-
showHorizontalScroll: showHorizontalScroll
|
|
41465
|
+
showHorizontalScroll: showHorizontalScroll,
|
|
41466
|
+
ref: tableContainerRef
|
|
41398
41467
|
}, /*#__PURE__*/React__default["default"].createElement(TableBodyScrollWrapper, {
|
|
41399
41468
|
tableBodyHeight: tableBodyHeight,
|
|
41400
41469
|
showHorizontalScroll: showHorizontalScroll,
|
|
@@ -41405,12 +41474,15 @@ const Table = props => {
|
|
|
41405
41474
|
onFilter: onFilter,
|
|
41406
41475
|
onSelectAll: onSelectAll
|
|
41407
41476
|
}), columns.length > 0 && data.length > 0 && /*#__PURE__*/React__default["default"].createElement(TableBody, {
|
|
41477
|
+
ref: tableBodyRef,
|
|
41408
41478
|
columns: columns,
|
|
41409
41479
|
data: data,
|
|
41410
41480
|
onRowClick: onRowClick,
|
|
41411
41481
|
onSendClick: onSendClick,
|
|
41412
41482
|
onDeleteClick: onDeleteClick,
|
|
41413
|
-
buttonColor: buttonColor
|
|
41483
|
+
buttonColor: buttonColor,
|
|
41484
|
+
resetFocus: resetTableFocus,
|
|
41485
|
+
onFocusChange: handleTableFocusChange
|
|
41414
41486
|
})), data.length === 0 && /*#__PURE__*/React__default["default"].createElement(NoEventsParent, null, /*#__PURE__*/React__default["default"].createElement(NoEventsWrapper, null, showNoDataInSearch ? /*#__PURE__*/React__default["default"].createElement(NoDataInSearchIcon, null) : /*#__PURE__*/React__default["default"].createElement(NoEvents, null)), /*#__PURE__*/React__default["default"].createElement(NoEventsMessage, null, showNoDataInSearch ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, "You haven't created any events yet"), /*#__PURE__*/React__default["default"].createElement("br", null), "Let's get started and create your first one!")), !showNoDataInSearch && /*#__PURE__*/React__default["default"].createElement(Button$1, {
|
|
41415
41487
|
height: "45px",
|
|
41416
41488
|
leftIcon: "Plus",
|
|
@@ -41429,7 +41501,10 @@ const Table = props => {
|
|
|
41429
41501
|
animationData: LoadingAnimation,
|
|
41430
41502
|
loop: true
|
|
41431
41503
|
}), /*#__PURE__*/React__default["default"].createElement(LoadingText, null, isLoadingText)))));
|
|
41432
|
-
};
|
|
41504
|
+
});
|
|
41505
|
+
|
|
41506
|
+
// Add displayName for better debugging
|
|
41507
|
+
Table.displayName = 'Table';
|
|
41433
41508
|
|
|
41434
41509
|
const Card = styled__default["default"].div`
|
|
41435
41510
|
background: ${props => props.backgroundColor};
|
|
@@ -51283,7 +51358,7 @@ const TruncatedText = styled__default["default"].span`
|
|
|
51283
51358
|
line-height: 21px;
|
|
51284
51359
|
font-size: 14px;
|
|
51285
51360
|
font-weight: 400;
|
|
51286
|
-
color:
|
|
51361
|
+
color: ${props => props.color};
|
|
51287
51362
|
max-width: 340px;
|
|
51288
51363
|
white-space: nowrap;
|
|
51289
51364
|
overflow: hidden;
|
|
@@ -51305,6 +51380,28 @@ styled__default["default"].div`
|
|
|
51305
51380
|
/* max-width: 320px; */
|
|
51306
51381
|
white-space: pre-line;
|
|
51307
51382
|
`;
|
|
51383
|
+
const Label$1 = styled__default["default"].label`
|
|
51384
|
+
font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
|
|
51385
|
+
font-weight: 400;
|
|
51386
|
+
padding-inline-end: 5px;
|
|
51387
|
+
padding-inline-start: 5px;
|
|
51388
|
+
margin-right: 10px;
|
|
51389
|
+
z-index: 2;
|
|
51390
|
+
color: ${props => props.error ? 'red' : props.disabled ? '#888' : props.labelColor};
|
|
51391
|
+
background-color: ${props => props.showLabelOnTop ? 'white' : 'transparent'} ;
|
|
51392
|
+
position: absolute;
|
|
51393
|
+
top: ${props => props.isFocused || props.hasValue ? '0px' : '24px'};
|
|
51394
|
+
left: ${props => props.isFocused || props.hasValue ? '23px' : '14px'};
|
|
51395
|
+
transform: translateY(-50%);
|
|
51396
|
+
transition: ${props => props.showLabelOnTop ? 'top 0.3s ease, font-size 0.3s ease, color 0.3s ease' : ''} ;
|
|
51397
|
+
display: flex;
|
|
51398
|
+
align-items: center;
|
|
51399
|
+
box-sizing: border-box;
|
|
51400
|
+
gap: 4px;
|
|
51401
|
+
&:hover {
|
|
51402
|
+
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
51403
|
+
}
|
|
51404
|
+
`;
|
|
51308
51405
|
|
|
51309
51406
|
const DialogOverlay = styled__default["default"].div`
|
|
51310
51407
|
position: fixed;
|
|
@@ -51529,6 +51626,12 @@ const OverlayDropdown = _ref => {
|
|
|
51529
51626
|
hoverColor = '#E6F0F0',
|
|
51530
51627
|
dropdownMaxHeight = '600px',
|
|
51531
51628
|
width = '100%',
|
|
51629
|
+
label,
|
|
51630
|
+
labelEmptyValue,
|
|
51631
|
+
showLabelOnTop,
|
|
51632
|
+
placeHolder,
|
|
51633
|
+
labelColor,
|
|
51634
|
+
placeHolderColor,
|
|
51532
51635
|
...props
|
|
51533
51636
|
} = _ref;
|
|
51534
51637
|
const [open, setOpen] = React$1.useState(false);
|
|
@@ -51599,6 +51702,7 @@ const OverlayDropdown = _ref => {
|
|
|
51599
51702
|
return null;
|
|
51600
51703
|
};
|
|
51601
51704
|
const selected = findSelectedItem();
|
|
51705
|
+
const hasValue = !!selected;
|
|
51602
51706
|
|
|
51603
51707
|
// Tooltip logic for long string
|
|
51604
51708
|
const getDisplayText = text => {
|
|
@@ -51712,10 +51816,42 @@ const OverlayDropdown = _ref => {
|
|
|
51712
51816
|
setOpen(prev => !prev);
|
|
51713
51817
|
};
|
|
51714
51818
|
const dataToRender = getDataWithLastDefined();
|
|
51819
|
+
const getLabel = () => {
|
|
51820
|
+
if (!showLabelOnTop && open) {
|
|
51821
|
+
return "";
|
|
51822
|
+
}
|
|
51823
|
+
if (hasValue) {
|
|
51824
|
+
return label;
|
|
51825
|
+
}
|
|
51826
|
+
return labelEmptyValue;
|
|
51827
|
+
};
|
|
51828
|
+
const getRequired = () => {
|
|
51829
|
+
if (!showLabelOnTop && open) {
|
|
51830
|
+
return "";
|
|
51831
|
+
}
|
|
51832
|
+
if (!showLabelOnTop && !label && hasValue) {
|
|
51833
|
+
return "";
|
|
51834
|
+
}
|
|
51835
|
+
if (required) {
|
|
51836
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
51837
|
+
style: {
|
|
51838
|
+
color: "red"
|
|
51839
|
+
}
|
|
51840
|
+
}, "*");
|
|
51841
|
+
}
|
|
51842
|
+
return "";
|
|
51843
|
+
};
|
|
51715
51844
|
return /*#__PURE__*/React__default["default"].createElement(DropdownContainer, {
|
|
51716
51845
|
width: width,
|
|
51717
51846
|
ref: containerRef
|
|
51718
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
51847
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label$1, {
|
|
51848
|
+
className: "Label",
|
|
51849
|
+
isFocused: open,
|
|
51850
|
+
labelColor: labelColor,
|
|
51851
|
+
hasValue: hasValue,
|
|
51852
|
+
disabled: disabled,
|
|
51853
|
+
showLabelOnTop: showLabelOnTop
|
|
51854
|
+
}, getLabel(), getRequired()), /*#__PURE__*/React__default["default"].createElement(DropdownButton, {
|
|
51719
51855
|
ref: buttonRef,
|
|
51720
51856
|
onClick: toggleDropdown,
|
|
51721
51857
|
disabled: disabled,
|
|
@@ -51723,13 +51859,9 @@ const OverlayDropdown = _ref => {
|
|
|
51723
51859
|
type: "button"
|
|
51724
51860
|
}, /*#__PURE__*/React__default["default"].createElement(TruncatedText, {
|
|
51725
51861
|
onMouseEnter: () => setHoveredText(selected?.label),
|
|
51726
|
-
onMouseLeave: () => setHoveredText(null)
|
|
51727
|
-
|
|
51728
|
-
|
|
51729
|
-
color: 'red',
|
|
51730
|
-
marginLeft: '2px'
|
|
51731
|
-
}
|
|
51732
|
-
}, "*")), open ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
|
|
51862
|
+
onMouseLeave: () => setHoveredText(null),
|
|
51863
|
+
color: !selected && open ? placeHolderColor : "inherit"
|
|
51864
|
+
}, selected ? getDisplayText(selected.label) : open ? placeHolder : ''), open ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
|
|
51733
51865
|
width: "12px",
|
|
51734
51866
|
height: "12px",
|
|
51735
51867
|
color: "#B1B1B1"
|