sag_components 2.0.0-beta141 → 2.0.0-beta142
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 -1
- package/dist/index.esm.js +450 -45
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +449 -44
- package/dist/index.js.map +1 -1
- package/dist/types/components/Table/CommentModal.d.ts +2 -0
- package/dist/types/components/Table/CommentModal.styles.d.ts +11 -0
- package/dist/types/components/Table/Table.d.ts +4 -2
- package/dist/types/components/Table/Table.stories.d.ts +23 -91
- package/dist/types/components/Table/TableBody.d.ts +31 -2
- package/dist/types/components/Table/TableBody.styles.d.ts +1 -0
- package/dist/types/components/Table/data.d.ts +206 -0
- package/dist/types/icons/CommentIcon.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React$1, { useState, useRef, useEffect, useMemo, useCallback,
|
|
1
|
+
import React$1, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
2
2
|
import styled, { keyframes, css } from 'styled-components';
|
|
3
3
|
import { ResponsiveContainer, PieChart as PieChart$1, Pie, Cell, Tooltip as Tooltip$3, BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, Bar, LabelList, ReferenceLine, LineChart, Line, AreaChart as AreaChart$1, Legend, Area, ScatterChart, ZAxis, Scatter, Brush, ComposedChart } from 'recharts';
|
|
4
4
|
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
|
|
@@ -13070,17 +13070,17 @@ const Modal$1 = styled.div`
|
|
|
13070
13070
|
margin: 0 auto;
|
|
13071
13071
|
${scrollableStyles$a}
|
|
13072
13072
|
`;
|
|
13073
|
-
const ModalHeader$
|
|
13073
|
+
const ModalHeader$2 = styled.div`
|
|
13074
13074
|
display: flex;
|
|
13075
13075
|
align-items: center;
|
|
13076
13076
|
justify-content: space-between;
|
|
13077
13077
|
margin-bottom: 32px;
|
|
13078
13078
|
`;
|
|
13079
|
-
const ModalBody$
|
|
13079
|
+
const ModalBody$2 = styled.div`
|
|
13080
13080
|
${scrollableStyles$a}
|
|
13081
13081
|
max-height: 80vh;
|
|
13082
13082
|
`;
|
|
13083
|
-
const ModalTitle$
|
|
13083
|
+
const ModalTitle$3 = styled.h5`
|
|
13084
13084
|
font-family: 'Poppins', sans-serif;
|
|
13085
13085
|
font-size: 32px;
|
|
13086
13086
|
font-weight: 500;
|
|
@@ -13112,12 +13112,12 @@ const DialogOverlay$1 = props => {
|
|
|
13112
13112
|
};
|
|
13113
13113
|
return /*#__PURE__*/React.createElement(ModalWrapper$1, {
|
|
13114
13114
|
className: className
|
|
13115
|
-
}, /*#__PURE__*/React.createElement(Modal$1, null, /*#__PURE__*/React.createElement(ModalHeader$
|
|
13115
|
+
}, /*#__PURE__*/React.createElement(Modal$1, null, /*#__PURE__*/React.createElement(ModalHeader$2, null, /*#__PURE__*/React.createElement(ModalTitle$3, null, title), /*#__PURE__*/React.createElement(ModalClose, {
|
|
13116
13116
|
type: "button",
|
|
13117
13117
|
onClick: closeModal
|
|
13118
13118
|
}, /*#__PURE__*/React.createElement(CloseXIcon, {
|
|
13119
13119
|
fill: "white"
|
|
13120
|
-
}))), /*#__PURE__*/React.createElement(ModalBody$
|
|
13120
|
+
}))), /*#__PURE__*/React.createElement(ModalBody$2, {
|
|
13121
13121
|
id: "modalBody"
|
|
13122
13122
|
}, children)));
|
|
13123
13123
|
};
|
|
@@ -27209,7 +27209,7 @@ const scrollableStyles$6 = `
|
|
|
27209
27209
|
}
|
|
27210
27210
|
`;
|
|
27211
27211
|
const MainContainer$1 = styled.div``;
|
|
27212
|
-
const ModalOverlay$
|
|
27212
|
+
const ModalOverlay$2 = styled.div`
|
|
27213
27213
|
position: fixed;
|
|
27214
27214
|
z-index: 100;
|
|
27215
27215
|
top: 0;
|
|
@@ -27221,7 +27221,7 @@ const ModalOverlay$1 = styled.div`
|
|
|
27221
27221
|
justify-content: center;
|
|
27222
27222
|
align-items: center;
|
|
27223
27223
|
`;
|
|
27224
|
-
const ModalContent$
|
|
27224
|
+
const ModalContent$2 = styled.div`
|
|
27225
27225
|
font-family: "Poppins", sans-serif;
|
|
27226
27226
|
font-weight: 500;
|
|
27227
27227
|
font-size: 18px;
|
|
@@ -27451,10 +27451,10 @@ const PopupCharts = props => {
|
|
|
27451
27451
|
}, displayChart(item)));
|
|
27452
27452
|
return /*#__PURE__*/React$1.createElement(MainContainer$1, {
|
|
27453
27453
|
id: "MainContainer"
|
|
27454
|
-
}, IsPopupChartsOpen && /*#__PURE__*/React$1.createElement(ModalOverlay$
|
|
27454
|
+
}, IsPopupChartsOpen && /*#__PURE__*/React$1.createElement(ModalOverlay$2, {
|
|
27455
27455
|
id: "ModalOverlay",
|
|
27456
27456
|
className: "modal-overlay"
|
|
27457
|
-
}, /*#__PURE__*/React$1.createElement(ModalContent$
|
|
27457
|
+
}, /*#__PURE__*/React$1.createElement(ModalContent$2, {
|
|
27458
27458
|
id: "ModalContent",
|
|
27459
27459
|
ref: divRef,
|
|
27460
27460
|
className: "modal-content",
|
|
@@ -33807,7 +33807,7 @@ const Overlay$2 = styled.div`
|
|
|
33807
33807
|
align-items: center;
|
|
33808
33808
|
z-index: 999;
|
|
33809
33809
|
`;
|
|
33810
|
-
const ModalContent = styled.div`
|
|
33810
|
+
const ModalContent$1 = styled.div`
|
|
33811
33811
|
position: absolute;
|
|
33812
33812
|
width: 70%;
|
|
33813
33813
|
height: 80%;
|
|
@@ -33833,7 +33833,7 @@ const Header$3 = styled.div`
|
|
|
33833
33833
|
align-items: flex-start;
|
|
33834
33834
|
}
|
|
33835
33835
|
`;
|
|
33836
|
-
const CloseButton$
|
|
33836
|
+
const CloseButton$2 = styled.button`
|
|
33837
33837
|
position: absolute;
|
|
33838
33838
|
top: -10px;
|
|
33839
33839
|
right: 0px;
|
|
@@ -34030,11 +34030,11 @@ const InsightsCarousel = _ref => {
|
|
|
34030
34030
|
const nextIndex = (currentIndex + 1) % totalChildren;
|
|
34031
34031
|
return /*#__PURE__*/React$1.createElement(Overlay$2, {
|
|
34032
34032
|
className: className
|
|
34033
|
-
}, /*#__PURE__*/React$1.createElement(ModalContent, null, /*#__PURE__*/React$1.createElement(Header$3, null, /*#__PURE__*/React$1.createElement(Title$8, {
|
|
34033
|
+
}, /*#__PURE__*/React$1.createElement(ModalContent$1, null, /*#__PURE__*/React$1.createElement(Header$3, null, /*#__PURE__*/React$1.createElement(Title$8, {
|
|
34034
34034
|
$titleColor: titleColor
|
|
34035
34035
|
}, /*#__PURE__*/React$1.cloneElement(icon, {
|
|
34036
34036
|
fill: iconColor
|
|
34037
|
-
}), title), /*#__PURE__*/React$1.createElement(CloseButton$
|
|
34037
|
+
}), title), /*#__PURE__*/React$1.createElement(CloseButton$2, {
|
|
34038
34038
|
onClick: () => onClose?.({
|
|
34039
34039
|
label: "closeCarousel"
|
|
34040
34040
|
}),
|
|
@@ -34351,7 +34351,7 @@ const Modal = styled.div`
|
|
|
34351
34351
|
border-radius: 12px;
|
|
34352
34352
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
34353
34353
|
`;
|
|
34354
|
-
const ModalHeader = styled.div`
|
|
34354
|
+
const ModalHeader$1 = styled.div`
|
|
34355
34355
|
display: flex;
|
|
34356
34356
|
justify-content: space-between;
|
|
34357
34357
|
`;
|
|
@@ -34359,12 +34359,12 @@ const ModalButtons = styled.div`
|
|
|
34359
34359
|
display: flex;
|
|
34360
34360
|
gap: 10px;
|
|
34361
34361
|
`;
|
|
34362
|
-
const ModalTitle$
|
|
34362
|
+
const ModalTitle$2 = styled.h3`
|
|
34363
34363
|
margin: 0;
|
|
34364
34364
|
font-size: 24px;
|
|
34365
34365
|
font-weight: 500;
|
|
34366
34366
|
`;
|
|
34367
|
-
const ModalBody = styled.div`
|
|
34367
|
+
const ModalBody$1 = styled.div`
|
|
34368
34368
|
width: 100%;
|
|
34369
34369
|
height: 100%;
|
|
34370
34370
|
`;
|
|
@@ -34415,9 +34415,9 @@ const ModalWithOverlay = props => {
|
|
|
34415
34415
|
width,
|
|
34416
34416
|
height
|
|
34417
34417
|
}
|
|
34418
|
-
}, /*#__PURE__*/React$1.createElement(ModalHeader, {
|
|
34418
|
+
}, /*#__PURE__*/React$1.createElement(ModalHeader$1, {
|
|
34419
34419
|
className: "modal-header"
|
|
34420
|
-
}, /*#__PURE__*/React$1.createElement(ModalTitle$
|
|
34420
|
+
}, /*#__PURE__*/React$1.createElement(ModalTitle$2, null, title), /*#__PURE__*/React$1.createElement(ModalButtons, {
|
|
34421
34421
|
className: "modal-buttons"
|
|
34422
34422
|
}, showCancelButton && /*#__PURE__*/React$1.createElement(Button$1, {
|
|
34423
34423
|
size: "medium",
|
|
@@ -34464,7 +34464,7 @@ const ModalWithOverlay = props => {
|
|
|
34464
34464
|
backgroundColor: okButtonColor,
|
|
34465
34465
|
hoverBorderColor: okButtonHoverBackgroundColor,
|
|
34466
34466
|
hoverBackgroundColor: okButtonHoverBackgroundColor
|
|
34467
|
-
})))), /*#__PURE__*/React$1.createElement(ModalBody, {
|
|
34467
|
+
})))), /*#__PURE__*/React$1.createElement(ModalBody$1, {
|
|
34468
34468
|
className: "modal-body"
|
|
34469
34469
|
}, children)));
|
|
34470
34470
|
};
|
|
@@ -38050,6 +38050,7 @@ const TableRow = styled.tr`
|
|
|
38050
38050
|
transition: all 0.3s ease;
|
|
38051
38051
|
font-family: "Poppins", sans-serif;
|
|
38052
38052
|
position: relative;
|
|
38053
|
+
background-color: ${props => props.isFocused ? props.selectedColor : "white"};
|
|
38053
38054
|
|
|
38054
38055
|
&:hover {
|
|
38055
38056
|
background-color: #e6f0f0;
|
|
@@ -38262,6 +38263,27 @@ const TrashIconWrapper = styled.div`
|
|
|
38262
38263
|
}
|
|
38263
38264
|
}
|
|
38264
38265
|
`;
|
|
38266
|
+
const CommentIconWrapper = styled.div`
|
|
38267
|
+
cursor: pointer;
|
|
38268
|
+
transition: color 0.2s ease;
|
|
38269
|
+
display: inline-flex;
|
|
38270
|
+
align-items: center;
|
|
38271
|
+
justify-content: center;
|
|
38272
|
+
width: 100%;
|
|
38273
|
+
height: 100%;
|
|
38274
|
+
position: relative;
|
|
38275
|
+
|
|
38276
|
+
${tooltipStyles}
|
|
38277
|
+
|
|
38278
|
+
/* Override tooltip position to move left */
|
|
38279
|
+
&[data-tooltip]:hover::before {
|
|
38280
|
+
left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
|
|
38281
|
+
}
|
|
38282
|
+
|
|
38283
|
+
&[data-tooltip]:hover::after {
|
|
38284
|
+
left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
|
|
38285
|
+
}
|
|
38286
|
+
`;
|
|
38265
38287
|
const DisabledTrashIconWrapper = styled.div`
|
|
38266
38288
|
display: inline-flex;
|
|
38267
38289
|
align-items: center;
|
|
@@ -38286,6 +38308,285 @@ const DisabledTrashIconWrapper = styled.div`
|
|
|
38286
38308
|
}
|
|
38287
38309
|
`;
|
|
38288
38310
|
|
|
38311
|
+
// CommentModal.styles.js
|
|
38312
|
+
const ModalOverlay$1 = styled.div`
|
|
38313
|
+
position: fixed;
|
|
38314
|
+
top: 0;
|
|
38315
|
+
left: 0;
|
|
38316
|
+
right: 0;
|
|
38317
|
+
bottom: 0;
|
|
38318
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
38319
|
+
display: flex;
|
|
38320
|
+
align-items: center;
|
|
38321
|
+
justify-content: center;
|
|
38322
|
+
z-index: 1000;
|
|
38323
|
+
`;
|
|
38324
|
+
const ModalContent = styled.div`
|
|
38325
|
+
background: white;
|
|
38326
|
+
border-radius: 12px;
|
|
38327
|
+
width: 90%;
|
|
38328
|
+
max-width: 500px;
|
|
38329
|
+
max-height: 400px;
|
|
38330
|
+
display: flex;
|
|
38331
|
+
flex-direction: column;
|
|
38332
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
38333
|
+
animation: slideUp 0.3s ease-out;
|
|
38334
|
+
|
|
38335
|
+
@keyframes slideUp {
|
|
38336
|
+
from {
|
|
38337
|
+
opacity: 0;
|
|
38338
|
+
transform: translateY(20px) scale(0.95);
|
|
38339
|
+
}
|
|
38340
|
+
to {
|
|
38341
|
+
opacity: 1;
|
|
38342
|
+
transform: translateY(0) scale(1);
|
|
38343
|
+
}
|
|
38344
|
+
}
|
|
38345
|
+
`;
|
|
38346
|
+
const ModalHeader = styled.div`
|
|
38347
|
+
display: flex;
|
|
38348
|
+
justify-content: space-between;
|
|
38349
|
+
align-items: center;
|
|
38350
|
+
padding: 12px 24px;
|
|
38351
|
+
border-bottom: 1px solid #D9D9D9;
|
|
38352
|
+
flex-shrink: 0;
|
|
38353
|
+
`;
|
|
38354
|
+
const ModalTitle$1 = styled.h5`
|
|
38355
|
+
font-family: "Poppins", sans-serif;
|
|
38356
|
+
font-size: 18px;
|
|
38357
|
+
font-weight: 600;
|
|
38358
|
+
color: #212121;
|
|
38359
|
+
margin: 0;
|
|
38360
|
+
`;
|
|
38361
|
+
const CloseButton$1 = styled.button`
|
|
38362
|
+
background: none;
|
|
38363
|
+
border: none;
|
|
38364
|
+
padding: 8px;
|
|
38365
|
+
cursor: pointer;
|
|
38366
|
+
color: #6b7280;
|
|
38367
|
+
border-radius: 6px;
|
|
38368
|
+
transition: all 0.2s ease;
|
|
38369
|
+
display: flex;
|
|
38370
|
+
align-items: center;
|
|
38371
|
+
justify-content: center;
|
|
38372
|
+
|
|
38373
|
+
&:hover {
|
|
38374
|
+
background-color: #f3f4f6;
|
|
38375
|
+
color: #374151;
|
|
38376
|
+
}
|
|
38377
|
+
|
|
38378
|
+
&:active {
|
|
38379
|
+
transform: scale(0.95);
|
|
38380
|
+
}
|
|
38381
|
+
`;
|
|
38382
|
+
const ModalBody = styled.div`
|
|
38383
|
+
padding: 20px 24px 24px;
|
|
38384
|
+
flex: 1;
|
|
38385
|
+
display: flex;
|
|
38386
|
+
flex-direction: column;
|
|
38387
|
+
overflow: hidden;
|
|
38388
|
+
`;
|
|
38389
|
+
const TextareaWrapper = styled.div`
|
|
38390
|
+
position: relative;
|
|
38391
|
+
display: flex;
|
|
38392
|
+
flex-direction: column;
|
|
38393
|
+
flex: 1;
|
|
38394
|
+
`;
|
|
38395
|
+
const TextareaLabel = styled.label`
|
|
38396
|
+
position: absolute;
|
|
38397
|
+
font-size: 14px;
|
|
38398
|
+
font-weight: 400;
|
|
38399
|
+
top: -10px;
|
|
38400
|
+
left: 25px;
|
|
38401
|
+
padding: 0 4px;
|
|
38402
|
+
background-color: white;
|
|
38403
|
+
color: ${props => props.color};
|
|
38404
|
+
transition: all 0.2s ease;
|
|
38405
|
+
animation: slideInLabel 0.2s ease-out;
|
|
38406
|
+
|
|
38407
|
+
@keyframes slideInLabel {
|
|
38408
|
+
from {
|
|
38409
|
+
opacity: 0;
|
|
38410
|
+
transform: translateY(-4px);
|
|
38411
|
+
}
|
|
38412
|
+
to {
|
|
38413
|
+
opacity: 1;
|
|
38414
|
+
transform: translateY(0);
|
|
38415
|
+
}
|
|
38416
|
+
}
|
|
38417
|
+
`;
|
|
38418
|
+
const CommentTextarea = styled.textarea`
|
|
38419
|
+
width: 100%;
|
|
38420
|
+
min-height: 120px;
|
|
38421
|
+
max-height: 200px;
|
|
38422
|
+
padding: 12px 16px;
|
|
38423
|
+
outline: none;
|
|
38424
|
+
border: 1px solid ${props => props.$hasValue ? props.color : '#8B8989'};
|
|
38425
|
+
border-radius: 12px;
|
|
38426
|
+
font-weight: 400;
|
|
38427
|
+
font-size: 14px;
|
|
38428
|
+
line-height: 1.5;
|
|
38429
|
+
resize: vertical;
|
|
38430
|
+
box-sizing: border-box;
|
|
38431
|
+
transition: all 0.2s ease;
|
|
38432
|
+
overflow-y: auto;
|
|
38433
|
+
font-family: "Poppins", sans-serif;
|
|
38434
|
+
resize: none;
|
|
38435
|
+
|
|
38436
|
+
&:focus {
|
|
38437
|
+
border: 1px solid ${props => props.color};
|
|
38438
|
+
}
|
|
38439
|
+
|
|
38440
|
+
&::placeholder {
|
|
38441
|
+
color: #9ca3af;
|
|
38442
|
+
}
|
|
38443
|
+
|
|
38444
|
+
/* Custom scrollbar */
|
|
38445
|
+
&::-webkit-scrollbar {
|
|
38446
|
+
width: 6px;
|
|
38447
|
+
}
|
|
38448
|
+
|
|
38449
|
+
&::-webkit-scrollbar-track {
|
|
38450
|
+
background: #f1f5f9;
|
|
38451
|
+
border-radius: 3px;
|
|
38452
|
+
}
|
|
38453
|
+
|
|
38454
|
+
&::-webkit-scrollbar-thumb {
|
|
38455
|
+
background: #cbd5e1;
|
|
38456
|
+
border-radius: 3px;
|
|
38457
|
+
}
|
|
38458
|
+
|
|
38459
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
38460
|
+
background: #94a3b8;
|
|
38461
|
+
}
|
|
38462
|
+
`;
|
|
38463
|
+
const CharacterCount = styled.div`
|
|
38464
|
+
margin-top: 8px;
|
|
38465
|
+
font-family: "Poppins", sans-serif;
|
|
38466
|
+
font-size: 12px;
|
|
38467
|
+
font-weight: 400;
|
|
38468
|
+
color: #6b7280;
|
|
38469
|
+
text-align: right;
|
|
38470
|
+
transition: color 0.2s ease;
|
|
38471
|
+
`;
|
|
38472
|
+
const ModalBottom = styled.div`
|
|
38473
|
+
padding: 16px 24px;
|
|
38474
|
+
border-top: 1px solid #D9D9D9;
|
|
38475
|
+
display: flex;
|
|
38476
|
+
gap: 16px;
|
|
38477
|
+
justify-content: flex-end;
|
|
38478
|
+
align-items: center;
|
|
38479
|
+
`;
|
|
38480
|
+
|
|
38481
|
+
const CommentModal = props => {
|
|
38482
|
+
const {
|
|
38483
|
+
isOpen,
|
|
38484
|
+
onClose,
|
|
38485
|
+
onSave,
|
|
38486
|
+
maxLength = 150,
|
|
38487
|
+
color = "#066768",
|
|
38488
|
+
saveButtonHoverColor = "#388586",
|
|
38489
|
+
initialValue = ''
|
|
38490
|
+
} = props;
|
|
38491
|
+
const [commentText, setCommentText] = useState('');
|
|
38492
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
38493
|
+
const [hasUserInteracted, setHasUserInteracted] = useState(false); // Track if user has started typing
|
|
38494
|
+
const [hasInitialValue, setHasInitialValue] = useState(false); // Track if there was initial text
|
|
38495
|
+
|
|
38496
|
+
// Update comment text when modal opens with initial value
|
|
38497
|
+
useEffect(() => {
|
|
38498
|
+
if (isOpen) {
|
|
38499
|
+
const initialText = initialValue || '';
|
|
38500
|
+
setCommentText(initialText);
|
|
38501
|
+
setHasInitialValue(Boolean(initialText.trim())); // Check if there's actual content
|
|
38502
|
+
setHasUserInteracted(false); // Reset interaction state
|
|
38503
|
+
}
|
|
38504
|
+
}, [isOpen, initialValue]);
|
|
38505
|
+
if (!isOpen) return null;
|
|
38506
|
+
const handleTextChange = e => {
|
|
38507
|
+
const text = e.target.value;
|
|
38508
|
+
if (text.length <= maxLength) {
|
|
38509
|
+
setCommentText(text);
|
|
38510
|
+
if (!hasUserInteracted) {
|
|
38511
|
+
setHasUserInteracted(true); // Mark that user has started interacting
|
|
38512
|
+
}
|
|
38513
|
+
}
|
|
38514
|
+
};
|
|
38515
|
+
const handleOverlayClick = e => {
|
|
38516
|
+
if (e.target === e.currentTarget) {
|
|
38517
|
+
onClose();
|
|
38518
|
+
}
|
|
38519
|
+
};
|
|
38520
|
+
const handleSave = () => {
|
|
38521
|
+
if (onSave) {
|
|
38522
|
+
onSave(commentText);
|
|
38523
|
+
}
|
|
38524
|
+
// Don't clear the text here - let the parent handle closing
|
|
38525
|
+
};
|
|
38526
|
+
const handleClose = () => {
|
|
38527
|
+
setCommentText('');
|
|
38528
|
+
setHasUserInteracted(false);
|
|
38529
|
+
setHasInitialValue(false);
|
|
38530
|
+
onClose();
|
|
38531
|
+
};
|
|
38532
|
+
const handleFocus = () => {
|
|
38533
|
+
setIsFocused(true);
|
|
38534
|
+
};
|
|
38535
|
+
const handleBlur = () => {
|
|
38536
|
+
setIsFocused(false);
|
|
38537
|
+
};
|
|
38538
|
+
|
|
38539
|
+
// Determine if save button should be enabled
|
|
38540
|
+
const isSaveEnabled = hasUserInteracted && (commentText.length > 0 || hasInitialValue);
|
|
38541
|
+
return /*#__PURE__*/React$1.createElement(ModalOverlay$1, {
|
|
38542
|
+
onClick: handleOverlayClick
|
|
38543
|
+
}, /*#__PURE__*/React$1.createElement(ModalContent, null, /*#__PURE__*/React$1.createElement(ModalHeader, null, /*#__PURE__*/React$1.createElement(ModalTitle$1, null, "Add Comment"), /*#__PURE__*/React$1.createElement(CloseButton$1, {
|
|
38544
|
+
onClick: handleClose
|
|
38545
|
+
}, /*#__PURE__*/React$1.createElement("svg", {
|
|
38546
|
+
width: "24",
|
|
38547
|
+
height: "24",
|
|
38548
|
+
viewBox: "0 0 24 24",
|
|
38549
|
+
fill: "none"
|
|
38550
|
+
}, /*#__PURE__*/React$1.createElement("path", {
|
|
38551
|
+
d: "M18 6L6 18M6 6l12 12",
|
|
38552
|
+
stroke: "currentColor",
|
|
38553
|
+
strokeWidth: "2",
|
|
38554
|
+
strokeLinecap: "round",
|
|
38555
|
+
strokeLinejoin: "round"
|
|
38556
|
+
})))), /*#__PURE__*/React$1.createElement(ModalBody, null, /*#__PURE__*/React$1.createElement(TextareaWrapper, null, (commentText.length > 0 || isFocused) && /*#__PURE__*/React$1.createElement(TextareaLabel, {
|
|
38557
|
+
color: color
|
|
38558
|
+
}, "Comment"), /*#__PURE__*/React$1.createElement(CommentTextarea, {
|
|
38559
|
+
value: commentText,
|
|
38560
|
+
onChange: handleTextChange,
|
|
38561
|
+
placeholder: "Type a Comment...",
|
|
38562
|
+
maxLength: maxLength,
|
|
38563
|
+
color: color,
|
|
38564
|
+
$hasValue: commentText.length > 0,
|
|
38565
|
+
onBlur: handleBlur,
|
|
38566
|
+
onFocus: handleFocus
|
|
38567
|
+
}), /*#__PURE__*/React$1.createElement(CharacterCount, null, commentText.length, "/", maxLength))), /*#__PURE__*/React$1.createElement(ModalBottom, null, /*#__PURE__*/React$1.createElement(Button$1, {
|
|
38568
|
+
text: "Cancel",
|
|
38569
|
+
type: "secondary",
|
|
38570
|
+
size: "medium",
|
|
38571
|
+
borderColor: "#D3D3D3",
|
|
38572
|
+
hoverTextColor: "#212121",
|
|
38573
|
+
hoverBackgroundColor: "#E6F0F0",
|
|
38574
|
+
hoverBorderColor: "#D3D3D3",
|
|
38575
|
+
onClick: handleClose
|
|
38576
|
+
}), /*#__PURE__*/React$1.createElement(Button$1, {
|
|
38577
|
+
text: "Save",
|
|
38578
|
+
size: "medium",
|
|
38579
|
+
disabled: !isSaveEnabled,
|
|
38580
|
+
hoverTextColor: "#ffffff",
|
|
38581
|
+
disabledTextColor: "#ffffff",
|
|
38582
|
+
borderColor: color,
|
|
38583
|
+
backgroundColor: color,
|
|
38584
|
+
hoverBorderColor: saveButtonHoverColor,
|
|
38585
|
+
hoverBackgroundColor: saveButtonHoverColor,
|
|
38586
|
+
onClick: handleSave
|
|
38587
|
+
}))));
|
|
38588
|
+
};
|
|
38589
|
+
|
|
38289
38590
|
// OkIcon.jsx
|
|
38290
38591
|
const OkIcon = _ref => {
|
|
38291
38592
|
let {
|
|
@@ -38304,6 +38605,30 @@ const OkIcon = _ref => {
|
|
|
38304
38605
|
}));
|
|
38305
38606
|
};
|
|
38306
38607
|
|
|
38608
|
+
const CommentIcon = ({
|
|
38609
|
+
width = '15',
|
|
38610
|
+
height = '15',
|
|
38611
|
+
showCircle = false,
|
|
38612
|
+
circleColor = '#066768'
|
|
38613
|
+
}) => /*#__PURE__*/React$1.createElement("svg", {
|
|
38614
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38615
|
+
width: width,
|
|
38616
|
+
height: height,
|
|
38617
|
+
viewBox: "0 0 15 15",
|
|
38618
|
+
fill: "none"
|
|
38619
|
+
}, showCircle ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("path", {
|
|
38620
|
+
d: "M7.41699 1C7.2371 1.41164 7.1112 1.85196 7.04785 2.3125H1.75C1.5094 2.3125 1.31254 2.5094 1.3125 2.75V10.625C1.3125 10.8656 1.50937 11.0625 1.75 11.0625H4.375C5.09961 11.0625 5.6875 11.6513 5.6875 12.376V12.8135L7.66992 11.3252C7.89675 11.1558 8.17284 11.0626 8.45703 11.0625H12.25C12.4906 11.0625 12.6875 10.8656 12.6875 10.625V7.95117C13.148 7.88782 13.5884 7.76288 14 7.58301V10.625C14 11.5903 13.2152 12.376 12.25 12.376H8.45703L5.6875 14.4541L5.68164 14.459L5.54297 14.5635L5.0752 14.9131C4.94395 15.0115 4.76562 15.0279 4.61523 14.9541C4.46515 14.8803 4.37514 14.73 4.375 14.5635V12.376H1.75C0.784766 12.376 0 11.5903 0 10.625V2.75C4.08976e-05 1.78476 0.784791 1 1.75 1H7.41699Z",
|
|
38621
|
+
fill: "#212121"
|
|
38622
|
+
}), /*#__PURE__*/React$1.createElement("circle", {
|
|
38623
|
+
cx: "12",
|
|
38624
|
+
cy: "3",
|
|
38625
|
+
r: "3",
|
|
38626
|
+
fill: circleColor
|
|
38627
|
+
})) : /*#__PURE__*/React$1.createElement("path", {
|
|
38628
|
+
d: "M4.375 10.0629C5.09961 10.0629 5.6875 10.6509 5.6875 11.3755V11.813L7.66992 10.3254C7.89687 10.1559 8.17305 10.0629 8.45742 10.0629H12.25C12.4906 10.0629 12.6875 9.86605 12.6875 9.62541V1.75008C12.6875 1.50944 12.4906 1.31256 12.25 1.31256H1.75C1.50937 1.31256 1.3125 1.50944 1.3125 1.75008V9.62541C1.3125 9.86605 1.50937 10.0629 1.75 10.0629H4.375ZM5.6875 13.4537L5.68203 13.4592L5.54258 13.5631L5.075 13.9131C4.94375 14.0115 4.76602 14.0279 4.61562 13.9541C4.46523 13.8803 4.375 13.7299 4.375 13.5631V12.9806V12.8056V12.7974V12.688V11.3755H3.0625H1.75C0.784766 11.3755 0 10.5907 0 9.62541V1.75008C0 0.784799 0.784766 0 1.75 0H12.25C13.2152 0 14 0.784799 14 1.75008V9.62541C14 10.5907 13.2152 11.3755 12.25 11.3755H8.45742L5.6875 13.4537Z",
|
|
38629
|
+
fill: "#212121"
|
|
38630
|
+
}));
|
|
38631
|
+
|
|
38307
38632
|
// TrashIcon.jsx
|
|
38308
38633
|
const TrashIcon = ({
|
|
38309
38634
|
width = "14",
|
|
@@ -38344,27 +38669,31 @@ const DisabledTrashIcon = ({
|
|
|
38344
38669
|
};
|
|
38345
38670
|
|
|
38346
38671
|
// TableBody.jsx
|
|
38347
|
-
const TableBody =
|
|
38672
|
+
const TableBody = ({
|
|
38348
38673
|
columns,
|
|
38349
38674
|
data,
|
|
38350
38675
|
onRowClick,
|
|
38351
38676
|
onSendClick,
|
|
38352
38677
|
buttonColor,
|
|
38353
38678
|
onDeleteClick,
|
|
38679
|
+
selectedColor,
|
|
38354
38680
|
resetFocus = false,
|
|
38355
38681
|
onFocusChange,
|
|
38356
|
-
indexToShimmer = 0
|
|
38357
|
-
|
|
38682
|
+
indexToShimmer = 0,
|
|
38683
|
+
onCommentSave = () => {},
|
|
38684
|
+
ref = null
|
|
38685
|
+
}) => {
|
|
38358
38686
|
const [hoveredRowIndex, setHoveredRowIndex] = useState(null);
|
|
38359
38687
|
const [focusedRowIndex, setFocusedRowIndex] = useState(null);
|
|
38688
|
+
const [isCommentModalOpen, setIsCommentModalOpen] = useState(false);
|
|
38689
|
+
const [currentCommentRow, setCurrentCommentRow] = useState(null); // Track which row is being edited
|
|
38360
38690
|
|
|
38361
|
-
// Expose methods to parent components via ref
|
|
38362
|
-
useImperativeHandle(ref, () => ({
|
|
38363
|
-
|
|
38364
|
-
|
|
38365
|
-
}));
|
|
38691
|
+
// Expose methods to parent components via ref (if ref is provided)
|
|
38692
|
+
// useImperativeHandle(ref, () => ({
|
|
38693
|
+
// clearFocus: () => setFocusedRowIndex(null),
|
|
38694
|
+
// getFocusedRowIndex: () => focusedRowIndex
|
|
38695
|
+
// }), [focusedRowIndex]);
|
|
38366
38696
|
|
|
38367
|
-
// Handle resetFocus prop
|
|
38368
38697
|
useEffect(() => {
|
|
38369
38698
|
if (resetFocus) {
|
|
38370
38699
|
setFocusedRowIndex(null);
|
|
@@ -38372,11 +38701,11 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
38372
38701
|
}, [resetFocus]);
|
|
38373
38702
|
|
|
38374
38703
|
// Notify parent of focus changes
|
|
38375
|
-
useEffect(() => {
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
|
|
38379
|
-
}, [focusedRowIndex, onFocusChange]);
|
|
38704
|
+
// useEffect(() => {
|
|
38705
|
+
// if (onFocusChange) {
|
|
38706
|
+
// onFocusChange(focusedRowIndex);
|
|
38707
|
+
// }
|
|
38708
|
+
// }, [focusedRowIndex, onFocusChange]);
|
|
38380
38709
|
|
|
38381
38710
|
// Handle row click for focus state
|
|
38382
38711
|
const handleRowClick = (row, rowIndex) => {
|
|
@@ -38386,6 +38715,21 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
38386
38715
|
}
|
|
38387
38716
|
};
|
|
38388
38717
|
|
|
38718
|
+
// Handle comment save
|
|
38719
|
+
const handleCommentSave = commentText => {
|
|
38720
|
+
if (currentCommentRow !== null) {
|
|
38721
|
+
onCommentSave(currentCommentRow, commentText);
|
|
38722
|
+
}
|
|
38723
|
+
setCurrentCommentRow(null);
|
|
38724
|
+
setIsCommentModalOpen(false);
|
|
38725
|
+
};
|
|
38726
|
+
|
|
38727
|
+
// Handle comment modal close
|
|
38728
|
+
const handleCommentModalClose = () => {
|
|
38729
|
+
setCurrentCommentRow(null);
|
|
38730
|
+
setIsCommentModalOpen(false);
|
|
38731
|
+
};
|
|
38732
|
+
|
|
38389
38733
|
// Function to calculate tooltip height based on text length
|
|
38390
38734
|
const calculateTooltipOffset = (text, isRegularCell = false) => {
|
|
38391
38735
|
if (!text) return {
|
|
@@ -38521,6 +38865,49 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
38521
38865
|
}), /*#__PURE__*/React$1.createElement("span", null, "All Sent"));
|
|
38522
38866
|
}
|
|
38523
38867
|
return value;
|
|
38868
|
+
case 'comments':
|
|
38869
|
+
const commentText = value || '';
|
|
38870
|
+
const hasComments = commentText.trim().length > 0;
|
|
38871
|
+
|
|
38872
|
+
// Truncate tooltip text if longer than 150 characters
|
|
38873
|
+
const commentTooltipText = commentText.length > 150 ? commentText.substring(0, 147) + '...' : commentText;
|
|
38874
|
+
return /*#__PURE__*/React$1.createElement(CommentIconWrapper, {
|
|
38875
|
+
$buttonColor: buttonColor,
|
|
38876
|
+
ref: el => {
|
|
38877
|
+
if (el) {
|
|
38878
|
+
if (hasComments) {
|
|
38879
|
+
// Add tooltip if there are comments
|
|
38880
|
+
const rect = el.getBoundingClientRect();
|
|
38881
|
+
const {
|
|
38882
|
+
offset,
|
|
38883
|
+
height
|
|
38884
|
+
} = calculateTooltipOffset(commentTooltipText);
|
|
38885
|
+
el.style.setProperty('--tooltip-top', `${rect.top}px`);
|
|
38886
|
+
el.style.setProperty('--tooltip-left', `${rect.left}px`);
|
|
38887
|
+
el.style.setProperty('--tooltip-width', `${rect.width}px`);
|
|
38888
|
+
el.style.setProperty('--tooltip-offset', `${offset}px`);
|
|
38889
|
+
el.style.setProperty('--tooltip-height', `${height}px`);
|
|
38890
|
+
el.setAttribute('data-tooltip', commentTooltipText);
|
|
38891
|
+
} else {
|
|
38892
|
+
// Remove tooltip if there are no comments
|
|
38893
|
+
el.removeAttribute('data-tooltip');
|
|
38894
|
+
el.style.removeProperty('--tooltip-top');
|
|
38895
|
+
el.style.removeProperty('--tooltip-left');
|
|
38896
|
+
el.style.removeProperty('--tooltip-width');
|
|
38897
|
+
el.style.removeProperty('--tooltip-offset');
|
|
38898
|
+
el.style.removeProperty('--tooltip-height');
|
|
38899
|
+
}
|
|
38900
|
+
}
|
|
38901
|
+
},
|
|
38902
|
+
onClick: e => {
|
|
38903
|
+
e.stopPropagation();
|
|
38904
|
+
setCurrentCommentRow(rowIndex);
|
|
38905
|
+
setIsCommentModalOpen(true);
|
|
38906
|
+
}
|
|
38907
|
+
}, /*#__PURE__*/React$1.createElement(CommentIcon, {
|
|
38908
|
+
showCircle: hasComments,
|
|
38909
|
+
circleColor: "#066768"
|
|
38910
|
+
}));
|
|
38524
38911
|
case 'trash':
|
|
38525
38912
|
// Only show trash icon when row is hovered
|
|
38526
38913
|
if (hoveredRowIndex !== rowIndex) {
|
|
@@ -38584,11 +38971,12 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
38584
38971
|
const shouldShowTooltip = (element, content) => {
|
|
38585
38972
|
return element && element.scrollWidth > element.clientWidth;
|
|
38586
38973
|
};
|
|
38587
|
-
return /*#__PURE__*/React$1.createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React$1.createElement(TableRow, {
|
|
38974
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React$1.createElement(TableRow, {
|
|
38588
38975
|
key: rowIndex,
|
|
38589
38976
|
"data-row-index": rowIndex,
|
|
38590
38977
|
className: indexToShimmer === rowIndex ? 'shimmer-row' : '',
|
|
38591
|
-
|
|
38978
|
+
isFocused: focusedRowIndex === rowIndex,
|
|
38979
|
+
selectedColor: selectedColor,
|
|
38592
38980
|
onMouseEnter: () => setHoveredRowIndex(rowIndex),
|
|
38593
38981
|
onMouseLeave: () => setHoveredRowIndex(null),
|
|
38594
38982
|
onClick: () => handleRowClick(row, rowIndex)
|
|
@@ -38617,8 +39005,13 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
38617
39005
|
$minWidth: column.minWidth,
|
|
38618
39006
|
$maxWidth: column.maxWidth
|
|
38619
39007
|
}, formattedValue);
|
|
38620
|
-
}))))
|
|
38621
|
-
|
|
39008
|
+
})))), /*#__PURE__*/React$1.createElement(CommentModal, {
|
|
39009
|
+
isOpen: isCommentModalOpen,
|
|
39010
|
+
onClose: handleCommentModalClose,
|
|
39011
|
+
onSave: handleCommentSave,
|
|
39012
|
+
initialValue: currentCommentRow !== null ? data[currentCommentRow]?.Comments || '' : ''
|
|
39013
|
+
}));
|
|
39014
|
+
};
|
|
38622
39015
|
TableBody.propTypes = {
|
|
38623
39016
|
columns: PropTypes.array.isRequired,
|
|
38624
39017
|
data: PropTypes.array.isRequired,
|
|
@@ -38628,7 +39021,9 @@ TableBody.propTypes = {
|
|
|
38628
39021
|
onDeleteClick: PropTypes.func,
|
|
38629
39022
|
resetFocus: PropTypes.bool,
|
|
38630
39023
|
onFocusChange: PropTypes.func,
|
|
38631
|
-
indexToShimmer: PropTypes.number
|
|
39024
|
+
indexToShimmer: PropTypes.number,
|
|
39025
|
+
onCommentSave: PropTypes.func,
|
|
39026
|
+
ref: PropTypes.object
|
|
38632
39027
|
};
|
|
38633
39028
|
TableBody.displayName = 'TableBody';
|
|
38634
39029
|
|
|
@@ -41799,7 +42194,7 @@ var Lottie = function Lottie(props) {
|
|
|
41799
42194
|
};
|
|
41800
42195
|
|
|
41801
42196
|
// Table.jsx
|
|
41802
|
-
const Table =
|
|
42197
|
+
const Table = props => {
|
|
41803
42198
|
const {
|
|
41804
42199
|
width = '100%',
|
|
41805
42200
|
height = 'auto',
|
|
@@ -41810,7 +42205,6 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41810
42205
|
onButtonClick = () => {},
|
|
41811
42206
|
buttonColor = '#066768',
|
|
41812
42207
|
buttonHoverColor = '#388586',
|
|
41813
|
-
// Updated props for new table structure
|
|
41814
42208
|
columns = [],
|
|
41815
42209
|
onRowClick = () => {},
|
|
41816
42210
|
onSort,
|
|
@@ -41820,6 +42214,7 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41820
42214
|
onSideButtonClick = () => {},
|
|
41821
42215
|
sideButtonColor = '#066768',
|
|
41822
42216
|
sideButtonHoverColor = '#388586',
|
|
42217
|
+
selectedColor = '#B4D1D2',
|
|
41823
42218
|
children = null,
|
|
41824
42219
|
tableBodyHeight = '728px',
|
|
41825
42220
|
isLoading = false,
|
|
@@ -41839,7 +42234,10 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41839
42234
|
clearFocusOnOutsideClick = true,
|
|
41840
42235
|
// NEW: Props for edit mode focus management
|
|
41841
42236
|
isEditMode = false,
|
|
41842
|
-
editRowIndex = -1
|
|
42237
|
+
editRowIndex = -1,
|
|
42238
|
+
onCommentSave = () => {},
|
|
42239
|
+
// Accept ref as a regular prop
|
|
42240
|
+
ref = null
|
|
41843
42241
|
} = props;
|
|
41844
42242
|
const scrollWrapperRef = useRef(null);
|
|
41845
42243
|
const tableBodyRef = useRef(null);
|
|
@@ -41858,11 +42256,16 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41858
42256
|
onTableFocusChange(focusedRowIndex);
|
|
41859
42257
|
};
|
|
41860
42258
|
|
|
41861
|
-
//
|
|
42259
|
+
// Handle comment save - pass through to parent
|
|
42260
|
+
const handleCommentSave = (rowIndex, commentText) => {
|
|
42261
|
+
onCommentSave(rowIndex, commentText);
|
|
42262
|
+
};
|
|
42263
|
+
|
|
42264
|
+
// Expose methods to parent components via ref (if ref is provided)
|
|
41862
42265
|
useImperativeHandle(ref, () => ({
|
|
41863
42266
|
clearTableFocus,
|
|
41864
42267
|
getTableBodyRef: () => tableBodyRef.current
|
|
41865
|
-
}));
|
|
42268
|
+
}), []);
|
|
41866
42269
|
useEffect(() => {
|
|
41867
42270
|
const scrollWrapper = scrollWrapperRef.current;
|
|
41868
42271
|
if (!scrollWrapper || !onLastRowsReached) return;
|
|
@@ -41940,9 +42343,11 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41940
42343
|
columns: columns,
|
|
41941
42344
|
indexToShimmer: indexToShimmer,
|
|
41942
42345
|
data: data,
|
|
42346
|
+
selectedColor: selectedColor,
|
|
41943
42347
|
onRowClick: onRowClick,
|
|
41944
42348
|
onSendClick: onSendClick,
|
|
41945
42349
|
onDeleteClick: onDeleteClick,
|
|
42350
|
+
onCommentSave: handleCommentSave,
|
|
41946
42351
|
buttonColor: buttonColor,
|
|
41947
42352
|
resetFocus: resetTableFocus,
|
|
41948
42353
|
onFocusChange: handleTableFocusChange
|
|
@@ -41964,7 +42369,7 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41964
42369
|
animationData: LoadingAnimation,
|
|
41965
42370
|
loop: true
|
|
41966
42371
|
}), /*#__PURE__*/React$1.createElement(LoadingText, null, isLoadingText)))));
|
|
41967
|
-
}
|
|
42372
|
+
};
|
|
41968
42373
|
|
|
41969
42374
|
// Add displayName for better debugging
|
|
41970
42375
|
Table.displayName = 'Table';
|