sag_components 2.0.0-beta194 → 2.0.0-beta195
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 +297 -156
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +297 -156
- package/dist/index.js.map +1 -1
- package/dist/types/components/Table/DropMenus/FilterPop.style.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3782,7 +3782,7 @@ const TextFieldInput = styled__default["default"].input`
|
|
|
3782
3782
|
}
|
|
3783
3783
|
`;
|
|
3784
3784
|
|
|
3785
|
-
const SearchInput = props => {
|
|
3785
|
+
const SearchInput$1 = props => {
|
|
3786
3786
|
const {
|
|
3787
3787
|
value,
|
|
3788
3788
|
placeholder = 'Search',
|
|
@@ -3927,7 +3927,7 @@ const ActionsWrapper = styled__default["default"].div`
|
|
|
3927
3927
|
gap: 10px;
|
|
3928
3928
|
width: 100%;
|
|
3929
3929
|
`;
|
|
3930
|
-
const SearchInputWrap = styled__default["default"](SearchInput)`
|
|
3930
|
+
const SearchInputWrap = styled__default["default"](SearchInput$1)`
|
|
3931
3931
|
margin-left: auto;
|
|
3932
3932
|
`;
|
|
3933
3933
|
|
|
@@ -10589,24 +10589,23 @@ 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
|
-
|
|
10609
|
-
} = _ref;
|
|
10592
|
+
const QuarterPicker = ({
|
|
10593
|
+
availableQuarters,
|
|
10594
|
+
// ["Q1-2024"]
|
|
10595
|
+
label,
|
|
10596
|
+
onChange,
|
|
10597
|
+
borderRadius,
|
|
10598
|
+
required,
|
|
10599
|
+
width,
|
|
10600
|
+
height,
|
|
10601
|
+
placeholder,
|
|
10602
|
+
disabled,
|
|
10603
|
+
borderColor,
|
|
10604
|
+
borderColorFocus,
|
|
10605
|
+
textColor,
|
|
10606
|
+
selectedValue,
|
|
10607
|
+
startYear
|
|
10608
|
+
}) => {
|
|
10610
10609
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10611
10610
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10612
10611
|
const [value, setValue] = React$1.useState('');
|
|
@@ -11048,23 +11047,22 @@ const MonthPopupPicker = ({
|
|
|
11048
11047
|
};
|
|
11049
11048
|
|
|
11050
11049
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
11051
|
-
const MonthPicker =
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
} = _ref;
|
|
11050
|
+
const MonthPicker = ({
|
|
11051
|
+
availableMonths,
|
|
11052
|
+
label,
|
|
11053
|
+
onChange,
|
|
11054
|
+
borderRadius,
|
|
11055
|
+
required,
|
|
11056
|
+
width,
|
|
11057
|
+
height,
|
|
11058
|
+
placeholder,
|
|
11059
|
+
disabled,
|
|
11060
|
+
borderColor,
|
|
11061
|
+
borderColorFocus,
|
|
11062
|
+
textColor,
|
|
11063
|
+
selectedValue,
|
|
11064
|
+
startYear
|
|
11065
|
+
}) => {
|
|
11068
11066
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
11069
11067
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
11070
11068
|
const [value, setValue] = React$1.useState('');
|
|
@@ -12264,16 +12262,13 @@ const Td$1 = styled__default["default"].td`
|
|
|
12264
12262
|
`;
|
|
12265
12263
|
const Tr = styled__default["default"].tr`
|
|
12266
12264
|
border-bottom: 1px solid #f3f4f6;
|
|
12267
|
-
${
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12271
|
-
} = _ref;
|
|
12272
|
-
return enableHover && `&:hover {
|
|
12265
|
+
${({
|
|
12266
|
+
enableHover,
|
|
12267
|
+
selectHoverColor
|
|
12268
|
+
}) => enableHover && `&:hover {
|
|
12273
12269
|
background-color: ${selectHoverColor};
|
|
12274
12270
|
cursor: pointer;
|
|
12275
|
-
}
|
|
12276
|
-
}}
|
|
12271
|
+
}`}
|
|
12277
12272
|
`;
|
|
12278
12273
|
const InfoText = styled__default["default"].div`
|
|
12279
12274
|
font-weight: 400;
|
|
@@ -24175,22 +24170,21 @@ const DeleteIcon = styled__default["default"].div`
|
|
|
24175
24170
|
position: absolute;
|
|
24176
24171
|
`;
|
|
24177
24172
|
|
|
24178
|
-
const QuickFilterDropdownSingle =
|
|
24179
|
-
|
|
24180
|
-
|
|
24181
|
-
|
|
24182
|
-
|
|
24183
|
-
|
|
24184
|
-
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
|
|
24189
|
-
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
} = _ref;
|
|
24173
|
+
const QuickFilterDropdownSingle = ({
|
|
24174
|
+
label,
|
|
24175
|
+
hoverColor,
|
|
24176
|
+
options,
|
|
24177
|
+
selectedValue,
|
|
24178
|
+
placeHolder,
|
|
24179
|
+
onChange,
|
|
24180
|
+
disabled,
|
|
24181
|
+
width,
|
|
24182
|
+
error,
|
|
24183
|
+
errorMessage,
|
|
24184
|
+
xIconShow,
|
|
24185
|
+
labelColor,
|
|
24186
|
+
showLabelOnTop
|
|
24187
|
+
}) => {
|
|
24194
24188
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24195
24189
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24196
24190
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
@@ -24587,24 +24581,23 @@ const IconContainer$2 = styled__default["default"].div`
|
|
|
24587
24581
|
cursor: pointer;
|
|
24588
24582
|
`;
|
|
24589
24583
|
|
|
24590
|
-
const QuickFilterDropdownMultiSelection =
|
|
24591
|
-
|
|
24592
|
-
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24601
|
-
|
|
24602
|
-
|
|
24603
|
-
|
|
24604
|
-
|
|
24605
|
-
|
|
24606
|
-
|
|
24607
|
-
} = _ref;
|
|
24584
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24585
|
+
label,
|
|
24586
|
+
labelEmptyValue,
|
|
24587
|
+
options,
|
|
24588
|
+
selectedValue,
|
|
24589
|
+
placeHolder,
|
|
24590
|
+
onChange,
|
|
24591
|
+
required,
|
|
24592
|
+
disabled,
|
|
24593
|
+
width,
|
|
24594
|
+
error,
|
|
24595
|
+
errorMessage,
|
|
24596
|
+
labelColor,
|
|
24597
|
+
xIconShow,
|
|
24598
|
+
checkBoxColor,
|
|
24599
|
+
showLabelOnTop
|
|
24600
|
+
}) => {
|
|
24608
24601
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24609
24602
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24610
24603
|
const [inputValue, setInputValue] = React$1.useState('');
|
|
@@ -35935,9 +35928,9 @@ const ToggleSlider = styled__default["default"].span`
|
|
|
35935
35928
|
}
|
|
35936
35929
|
`;
|
|
35937
35930
|
|
|
35938
|
-
/**
|
|
35939
|
-
* ToggleSwitch component for on/off states.
|
|
35940
|
-
* Supports small/large sizes and disabled state.
|
|
35931
|
+
/**
|
|
35932
|
+
* ToggleSwitch component for on/off states.
|
|
35933
|
+
* Supports small/large sizes and disabled state.
|
|
35941
35934
|
*/
|
|
35942
35935
|
function ToggleSwitch(_ref) {
|
|
35943
35936
|
let {
|
|
@@ -37345,11 +37338,15 @@ const FilterPopContainer = styled__default["default"].div`
|
|
|
37345
37338
|
font-family: 'Poppins', sans-serif;
|
|
37346
37339
|
width: ${props => props.width || '300px'};
|
|
37347
37340
|
height: ${props => props.height || 'auto'};
|
|
37341
|
+
max-height: ${props => props.maxHeight || '400px'};
|
|
37348
37342
|
padding: 8px;
|
|
37349
37343
|
color: #212121;
|
|
37350
37344
|
background-color: #fff;
|
|
37351
37345
|
border-radius: 4px;
|
|
37352
37346
|
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.10);
|
|
37347
|
+
display: flex;
|
|
37348
|
+
flex-direction: column;
|
|
37349
|
+
overflow: hidden;
|
|
37353
37350
|
|
|
37354
37351
|
/* Add this CSS for checkbox styling */
|
|
37355
37352
|
input[type="checkbox"] {
|
|
@@ -37364,52 +37361,133 @@ const Title$5 = styled__default["default"].h6`
|
|
|
37364
37361
|
padding: 4px 12px;
|
|
37365
37362
|
margin: 0 0 10px;
|
|
37366
37363
|
text-align: left;
|
|
37364
|
+
flex-shrink: 0;
|
|
37365
|
+
`;
|
|
37366
|
+
const SearchInput = styled__default["default"].input`
|
|
37367
|
+
width: 100%;
|
|
37368
|
+
padding: 8px 12px;
|
|
37369
|
+
margin: 0 0 12px;
|
|
37370
|
+
font-size: 14px;
|
|
37371
|
+
font-family: 'Poppins', sans-serif;
|
|
37372
|
+
border: 1px solid #e0e0e0;
|
|
37373
|
+
border-radius: 4px;
|
|
37374
|
+
background-color: #fff;
|
|
37375
|
+
color: #212121;
|
|
37376
|
+
flex-shrink: 0;
|
|
37377
|
+
box-sizing: border-box;
|
|
37378
|
+
|
|
37379
|
+
&::placeholder {
|
|
37380
|
+
color: #999;
|
|
37381
|
+
font-style: italic;
|
|
37382
|
+
}
|
|
37383
|
+
|
|
37384
|
+
&:focus {
|
|
37385
|
+
outline: none;
|
|
37386
|
+
border-color: ${props => props.accentColor || '#066768'};
|
|
37387
|
+
box-shadow: 0 0 0 2px ${props => props.accentColor || '#066768'}20;
|
|
37388
|
+
}
|
|
37389
|
+
|
|
37390
|
+
&:hover {
|
|
37391
|
+
border-color: #c0c0c0;
|
|
37392
|
+
}
|
|
37367
37393
|
`;
|
|
37368
37394
|
const CheckboxGroup = styled__default["default"].div`
|
|
37369
|
-
|
|
37370
|
-
|
|
37371
|
-
|
|
37372
|
-
|
|
37395
|
+
display: flex;
|
|
37396
|
+
flex-direction: column;
|
|
37397
|
+
gap: 8px;
|
|
37398
|
+
margin-bottom: 16px;
|
|
37399
|
+
overflow-y: auto;
|
|
37400
|
+
flex: 1;
|
|
37401
|
+
min-height: 0;
|
|
37402
|
+
|
|
37403
|
+
/* Custom scrollbar styling */
|
|
37404
|
+
&::-webkit-scrollbar {
|
|
37405
|
+
width: 6px;
|
|
37406
|
+
}
|
|
37407
|
+
|
|
37408
|
+
&::-webkit-scrollbar-track {
|
|
37409
|
+
background: #f1f1f1;
|
|
37410
|
+
border-radius: 3px;
|
|
37411
|
+
}
|
|
37412
|
+
|
|
37413
|
+
&::-webkit-scrollbar-thumb {
|
|
37414
|
+
background: #c1c1c1;
|
|
37415
|
+
border-radius: 3px;
|
|
37416
|
+
}
|
|
37417
|
+
|
|
37418
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
37419
|
+
background: #a8a8a8;
|
|
37420
|
+
}
|
|
37421
|
+
|
|
37422
|
+
/* For Firefox */
|
|
37423
|
+
scrollbar-width: thin;
|
|
37424
|
+
scrollbar-color: #c1c1c1 #f1f1f1;
|
|
37373
37425
|
`;
|
|
37374
37426
|
const CheckboxLabel = styled__default["default"].label`
|
|
37375
|
-
|
|
37376
|
-
|
|
37377
|
-
|
|
37378
|
-
|
|
37379
|
-
|
|
37380
|
-
|
|
37381
|
-
|
|
37382
|
-
|
|
37383
|
-
|
|
37384
|
-
|
|
37385
|
-
|
|
37386
|
-
|
|
37387
|
-
|
|
37388
|
-
|
|
37389
|
-
|
|
37390
|
-
|
|
37391
|
-
|
|
37392
|
-
|
|
37393
|
-
|
|
37427
|
+
display: flex;
|
|
37428
|
+
align-items: center;
|
|
37429
|
+
gap: 8px;
|
|
37430
|
+
padding: 8px 12px;
|
|
37431
|
+
font-size: 14px;
|
|
37432
|
+
font-weight: 400;
|
|
37433
|
+
color: #212121;
|
|
37434
|
+
cursor: pointer;
|
|
37435
|
+
flex-shrink: 0;
|
|
37436
|
+
|
|
37437
|
+
&:hover {
|
|
37438
|
+
background-color: #E6F0F0;
|
|
37439
|
+
}
|
|
37440
|
+
|
|
37441
|
+
> span {
|
|
37442
|
+
width: ${props => props.width};
|
|
37443
|
+
white-space: nowrap;
|
|
37444
|
+
overflow: hidden;
|
|
37445
|
+
text-overflow: ellipsis;
|
|
37446
|
+
}
|
|
37447
|
+
`;
|
|
37448
|
+
const NoResultsMessage = styled__default["default"].div`
|
|
37449
|
+
padding: 16px 12px;
|
|
37450
|
+
text-align: center;
|
|
37451
|
+
color: #999;
|
|
37452
|
+
font-size: 14px;
|
|
37453
|
+
font-style: italic;
|
|
37394
37454
|
`;
|
|
37395
37455
|
const ButtonWrapper$2 = styled__default["default"].div`
|
|
37396
37456
|
text-align: right;
|
|
37457
|
+
flex-shrink: 0;
|
|
37458
|
+
padding-top: 8px;
|
|
37459
|
+
border-top: 1px solid #e0e0e0;
|
|
37460
|
+
display: flex;
|
|
37461
|
+
justify-content: flex-end;
|
|
37462
|
+
align-items: center;
|
|
37397
37463
|
`;
|
|
37398
37464
|
const ResetButton$1 = styled__default["default"].button`
|
|
37399
37465
|
font-size: 14px;
|
|
37400
37466
|
font-weight: 400;
|
|
37401
|
-
padding:
|
|
37467
|
+
padding: 4px 8px;
|
|
37402
37468
|
background-color: transparent;
|
|
37403
37469
|
border: none;
|
|
37404
37470
|
cursor: pointer;
|
|
37471
|
+
border-radius: 3px;
|
|
37472
|
+
|
|
37473
|
+
&:hover {
|
|
37474
|
+
background-color: #f0f0f0;
|
|
37475
|
+
color: #066768;
|
|
37476
|
+
}
|
|
37405
37477
|
|
|
37406
|
-
|
|
37407
|
-
|
|
37408
|
-
|
|
37409
|
-
|
|
37410
|
-
|
|
37411
|
-
|
|
37412
|
-
|
|
37478
|
+
&:active {
|
|
37479
|
+
color: #066768;
|
|
37480
|
+
}
|
|
37481
|
+
|
|
37482
|
+
&:disabled {
|
|
37483
|
+
color: #ccc;
|
|
37484
|
+
cursor: not-allowed;
|
|
37485
|
+
|
|
37486
|
+
&:hover {
|
|
37487
|
+
background-color: transparent;
|
|
37488
|
+
color: #ccc;
|
|
37489
|
+
}
|
|
37490
|
+
}
|
|
37413
37491
|
`;
|
|
37414
37492
|
|
|
37415
37493
|
const FilterPop = props => {
|
|
@@ -37417,15 +37495,22 @@ const FilterPop = props => {
|
|
|
37417
37495
|
menuName = '',
|
|
37418
37496
|
width = 'auto',
|
|
37419
37497
|
height = 'auto',
|
|
37498
|
+
maxHeight = '400px',
|
|
37420
37499
|
list = [],
|
|
37421
37500
|
color = '#007bff',
|
|
37422
37501
|
onCheck = () => {},
|
|
37423
37502
|
onReset = () => {},
|
|
37424
37503
|
doubleColumn = false,
|
|
37425
37504
|
isAsc = true,
|
|
37426
|
-
selectedAttributes: propSelectedAttributes = {}
|
|
37505
|
+
selectedAttributes: propSelectedAttributes = {},
|
|
37506
|
+
showSearch = true,
|
|
37507
|
+
// New prop to enable/disable search
|
|
37508
|
+
searchPlaceholder = 'Search...' // New prop for search placeholder
|
|
37427
37509
|
} = props;
|
|
37428
37510
|
|
|
37511
|
+
// State for search term
|
|
37512
|
+
const [searchTerm, setSearchTerm] = React$1.useState('');
|
|
37513
|
+
|
|
37429
37514
|
// Add hardcoded "Select All" as first item
|
|
37430
37515
|
const fullList = [{
|
|
37431
37516
|
value: 'All',
|
|
@@ -37449,18 +37534,49 @@ const FilterPop = props => {
|
|
|
37449
37534
|
return fullList.filter(item => item.value !== 'All');
|
|
37450
37535
|
};
|
|
37451
37536
|
|
|
37452
|
-
//
|
|
37537
|
+
// Filter items based on search term
|
|
37538
|
+
const filteredList = React$1.useMemo(() => {
|
|
37539
|
+
if (!searchTerm.trim()) {
|
|
37540
|
+
return fullList;
|
|
37541
|
+
}
|
|
37542
|
+
const searchLower = searchTerm.toLowerCase().trim();
|
|
37543
|
+
const filteredNonAllItems = fullList.filter(item => {
|
|
37544
|
+
if (item.value === 'All') return false; // Don't filter out "Select All" in search
|
|
37545
|
+
return item.label.toLowerCase().includes(searchLower);
|
|
37546
|
+
});
|
|
37547
|
+
|
|
37548
|
+
// Always include "Select All" at the top when searching
|
|
37549
|
+
return [fullList.find(item => item.value === 'All'), ...filteredNonAllItems];
|
|
37550
|
+
}, [fullList, searchTerm]);
|
|
37551
|
+
|
|
37552
|
+
// Sort the filtered list based on the `isAsc` prop, keeping 'All' as the first option
|
|
37553
|
+
const sortedList = React$1.useMemo(() => {
|
|
37554
|
+
return [...filteredList.filter(item => item.value === 'All'), ...filteredList.filter(item => item.value !== 'All').sort((a, b) => {
|
|
37555
|
+
return isAsc ? a.label.localeCompare(b.label) : b.label.localeCompare(a.label);
|
|
37556
|
+
})];
|
|
37557
|
+
}, [filteredList, isAsc]);
|
|
37558
|
+
|
|
37559
|
+
// Helper functions for "Select All" logic based on ALL items (not just filtered)
|
|
37453
37560
|
const areAllNonAllItemsSelected = function () {
|
|
37454
37561
|
let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selectedAttributes;
|
|
37455
37562
|
const nonAllItems = getNonAllItems();
|
|
37456
37563
|
return nonAllItems.every(item => attributes[item.value]);
|
|
37457
37564
|
};
|
|
37458
37565
|
|
|
37459
|
-
// Helper
|
|
37460
|
-
const
|
|
37566
|
+
// Helper functions for visible filtered items
|
|
37567
|
+
const getVisibleNonAllItems = () => {
|
|
37568
|
+
return sortedList.filter(item => item.value !== 'All');
|
|
37569
|
+
};
|
|
37570
|
+
const areAllVisibleItemsSelected = function () {
|
|
37461
37571
|
let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selectedAttributes;
|
|
37462
|
-
const
|
|
37463
|
-
|
|
37572
|
+
const visibleItems = getVisibleNonAllItems();
|
|
37573
|
+
if (visibleItems.length === 0) return false;
|
|
37574
|
+
return visibleItems.every(item => attributes[item.value]);
|
|
37575
|
+
};
|
|
37576
|
+
const areAnyVisibleItemsSelected = function () {
|
|
37577
|
+
let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selectedAttributes;
|
|
37578
|
+
const visibleItems = getVisibleNonAllItems();
|
|
37579
|
+
return visibleItems.some(item => attributes[item.value]);
|
|
37464
37580
|
};
|
|
37465
37581
|
|
|
37466
37582
|
// New helper function to create the efficient data structure
|
|
@@ -37484,14 +37600,12 @@ const FilterPop = props => {
|
|
|
37484
37600
|
isSelectAll: false
|
|
37485
37601
|
};
|
|
37486
37602
|
} else if (mostSelected) {
|
|
37487
|
-
// More items selected than unselected - use exclude approach
|
|
37488
37603
|
return {
|
|
37489
37604
|
excluded: unselectedItems.map(item => item.value),
|
|
37490
37605
|
included: [],
|
|
37491
37606
|
isSelectAll: true
|
|
37492
37607
|
};
|
|
37493
37608
|
} else {
|
|
37494
|
-
// Fewer items selected than unselected - use include approach
|
|
37495
37609
|
return {
|
|
37496
37610
|
excluded: [],
|
|
37497
37611
|
included: selectedItems.map(item => item.value),
|
|
@@ -37501,47 +37615,50 @@ const FilterPop = props => {
|
|
|
37501
37615
|
};
|
|
37502
37616
|
const handleCheckboxChange = attribute => {
|
|
37503
37617
|
if (attribute === 'All') {
|
|
37504
|
-
//
|
|
37505
|
-
const
|
|
37506
|
-
const
|
|
37507
|
-
const updatedAttributes = {};
|
|
37618
|
+
// "Select All" behavior - affects ALL visible filtered items
|
|
37619
|
+
const visibleNonAllItems = getVisibleNonAllItems();
|
|
37620
|
+
const allVisibleSelected = areAllVisibleItemsSelected();
|
|
37508
37621
|
|
|
37509
|
-
//
|
|
37510
|
-
|
|
37511
|
-
|
|
37622
|
+
// Toggle all visible items
|
|
37623
|
+
const updatedAttributes = {
|
|
37624
|
+
...selectedAttributes
|
|
37625
|
+
};
|
|
37626
|
+
visibleNonAllItems.forEach(item => {
|
|
37627
|
+
updatedAttributes[item.value] = !allVisibleSelected;
|
|
37512
37628
|
});
|
|
37513
37629
|
|
|
37514
|
-
//
|
|
37630
|
+
// Update "Select All" state based on all items (not just visible)
|
|
37631
|
+
updatedAttributes.All = areAllNonAllItemsSelected(updatedAttributes);
|
|
37515
37632
|
const filterData = createFilterData(updatedAttributes);
|
|
37516
37633
|
onCheck({
|
|
37517
37634
|
changedItem: attribute,
|
|
37518
37635
|
filterData: filterData,
|
|
37519
|
-
allItems: updatedAttributes
|
|
37636
|
+
allItems: updatedAttributes
|
|
37520
37637
|
});
|
|
37521
37638
|
} else {
|
|
37522
|
-
//
|
|
37639
|
+
// Individual item clicked
|
|
37523
37640
|
const updatedAttributes = {
|
|
37524
37641
|
...selectedAttributes,
|
|
37525
37642
|
[attribute]: !selectedAttributes[attribute]
|
|
37526
37643
|
};
|
|
37527
37644
|
|
|
37528
|
-
//
|
|
37645
|
+
// Update "Select All" state based on all items
|
|
37646
|
+
updatedAttributes.All = areAllNonAllItemsSelected(updatedAttributes);
|
|
37529
37647
|
const filterData = createFilterData(updatedAttributes);
|
|
37530
37648
|
onCheck({
|
|
37531
37649
|
changedItem: attribute,
|
|
37532
37650
|
filterData: filterData,
|
|
37533
|
-
allItems: updatedAttributes
|
|
37651
|
+
allItems: updatedAttributes
|
|
37534
37652
|
});
|
|
37535
37653
|
}
|
|
37536
37654
|
};
|
|
37537
37655
|
const handleReset = () => {
|
|
37656
|
+
// Clear search when resetting
|
|
37657
|
+
setSearchTerm('');
|
|
37658
|
+
|
|
37538
37659
|
// Reset to the original default state (all selected)
|
|
37539
37660
|
const resetState = createInitialState();
|
|
37540
|
-
|
|
37541
|
-
// Call the onReset callback
|
|
37542
37661
|
onReset();
|
|
37543
|
-
|
|
37544
|
-
// Also call onCheck to notify parent of the reset with new efficient structure
|
|
37545
37662
|
const filterData = createFilterData(resetState);
|
|
37546
37663
|
onCheck({
|
|
37547
37664
|
changedItem: 'reset',
|
|
@@ -37550,17 +37667,24 @@ const FilterPop = props => {
|
|
|
37550
37667
|
});
|
|
37551
37668
|
};
|
|
37552
37669
|
|
|
37553
|
-
// Function to determine checkbox state for "Select All"
|
|
37670
|
+
// Function to determine checkbox state for "Select All" based on visible items
|
|
37554
37671
|
const getSelectAllCheckboxProps = () => {
|
|
37555
|
-
const
|
|
37556
|
-
|
|
37557
|
-
|
|
37558
|
-
|
|
37672
|
+
const visibleItems = getVisibleNonAllItems();
|
|
37673
|
+
if (visibleItems.length === 0) {
|
|
37674
|
+
return {
|
|
37675
|
+
checked: false,
|
|
37676
|
+
indeterminate: false
|
|
37677
|
+
};
|
|
37678
|
+
}
|
|
37679
|
+
const allVisibleSelected = areAllVisibleItemsSelected();
|
|
37680
|
+
const anyVisibleSelected = areAnyVisibleItemsSelected();
|
|
37681
|
+
const noneVisibleSelected = !anyVisibleSelected;
|
|
37682
|
+
if (allVisibleSelected) {
|
|
37559
37683
|
return {
|
|
37560
37684
|
checked: true,
|
|
37561
37685
|
indeterminate: false
|
|
37562
37686
|
};
|
|
37563
|
-
} else if (
|
|
37687
|
+
} else if (noneVisibleSelected) {
|
|
37564
37688
|
return {
|
|
37565
37689
|
checked: false,
|
|
37566
37690
|
indeterminate: false
|
|
@@ -37573,38 +37697,50 @@ const FilterPop = props => {
|
|
|
37573
37697
|
}
|
|
37574
37698
|
};
|
|
37575
37699
|
|
|
37576
|
-
//
|
|
37577
|
-
const
|
|
37578
|
-
|
|
37579
|
-
}
|
|
37700
|
+
// Handle search input change
|
|
37701
|
+
const handleSearchChange = e => {
|
|
37702
|
+
setSearchTerm(e.target.value);
|
|
37703
|
+
};
|
|
37704
|
+
|
|
37705
|
+
// Clear search
|
|
37706
|
+
const clearSearch = () => {
|
|
37707
|
+
setSearchTerm('');
|
|
37708
|
+
};
|
|
37580
37709
|
return /*#__PURE__*/React__default["default"].createElement(FilterPopContainer, {
|
|
37581
37710
|
width: width,
|
|
37582
37711
|
height: height,
|
|
37583
|
-
|
|
37584
|
-
|
|
37712
|
+
maxHeight: maxHeight,
|
|
37713
|
+
accentColor: color
|
|
37714
|
+
}, /*#__PURE__*/React__default["default"].createElement(Title$5, null, menuName), showSearch && /*#__PURE__*/React__default["default"].createElement(SearchInput, {
|
|
37715
|
+
type: "text",
|
|
37716
|
+
placeholder: searchPlaceholder,
|
|
37717
|
+
value: searchTerm,
|
|
37718
|
+
onChange: handleSearchChange,
|
|
37719
|
+
accentColor: color
|
|
37720
|
+
}), /*#__PURE__*/React__default["default"].createElement(CheckboxGroup, {
|
|
37585
37721
|
style: {
|
|
37586
37722
|
display: doubleColumn ? 'grid' : 'flex',
|
|
37587
37723
|
gridTemplateColumns: doubleColumn ? '1fr 1fr' : 'none',
|
|
37588
37724
|
gap: '8px'
|
|
37589
37725
|
}
|
|
37590
|
-
}, sortedList.
|
|
37726
|
+
}, sortedList.length === 1 ?
|
|
37727
|
+
/*#__PURE__*/
|
|
37728
|
+
// Only "Select All" is visible
|
|
37729
|
+
React__default["default"].createElement(NoResultsMessage, null, "No items match your search") : sortedList.map(item => {
|
|
37591
37730
|
const isSelectAll = item.value === 'All';
|
|
37592
37731
|
const checkboxProps = isSelectAll ? getSelectAllCheckboxProps() : {};
|
|
37593
37732
|
const isChecked = isSelectAll ? checkboxProps.checked : selectedAttributes[item.value] || false;
|
|
37594
37733
|
return /*#__PURE__*/React__default["default"].createElement(CheckboxLabel, {
|
|
37595
37734
|
width: !doubleColumn ?? width,
|
|
37596
|
-
key: `${item.value}-${JSON.stringify(selectedAttributes)}`
|
|
37735
|
+
key: `${item.value}-${JSON.stringify(selectedAttributes)}-${searchTerm}`
|
|
37597
37736
|
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
37598
37737
|
type: "checkbox",
|
|
37599
37738
|
checked: isChecked,
|
|
37600
37739
|
ref: el => {
|
|
37601
37740
|
if (el) {
|
|
37602
|
-
// Handle indeterminate for Select All FIRST
|
|
37603
37741
|
if (isSelectAll) {
|
|
37604
37742
|
el.indeterminate = checkboxProps.indeterminate;
|
|
37605
37743
|
}
|
|
37606
|
-
|
|
37607
|
-
// FORCE DOM SYNC - manually set DOM state to match React state
|
|
37608
37744
|
if (el.checked !== isChecked) {
|
|
37609
37745
|
el.checked = isChecked;
|
|
37610
37746
|
}
|
|
@@ -37614,7 +37750,12 @@ const FilterPop = props => {
|
|
|
37614
37750
|
handleCheckboxChange(item.value);
|
|
37615
37751
|
}
|
|
37616
37752
|
}), /*#__PURE__*/React__default["default"].createElement("span", null, item.label));
|
|
37617
|
-
})), /*#__PURE__*/React__default["default"].createElement(ButtonWrapper$2, null, /*#__PURE__*/React__default["default"].createElement(ResetButton$1, {
|
|
37753
|
+
})), /*#__PURE__*/React__default["default"].createElement(ButtonWrapper$2, null, showSearch && searchTerm && /*#__PURE__*/React__default["default"].createElement(ResetButton$1, {
|
|
37754
|
+
onClick: clearSearch,
|
|
37755
|
+
style: {
|
|
37756
|
+
marginRight: '8px'
|
|
37757
|
+
}
|
|
37758
|
+
}, "Clear Search"), /*#__PURE__*/React__default["default"].createElement(ResetButton$1, {
|
|
37618
37759
|
onClick: handleReset,
|
|
37619
37760
|
disabled: areAllNonAllItemsSelected() && selectedAttributes.All
|
|
37620
37761
|
}, "Reset")));
|
|
@@ -55375,7 +55516,7 @@ exports.RangePop = RangePop;
|
|
|
55375
55516
|
exports.ReportTable = ReportTable;
|
|
55376
55517
|
exports.RulesEngine = RulesEngine;
|
|
55377
55518
|
exports.SampleRunEngine = SampleRunEngine;
|
|
55378
|
-
exports.SearchInput = SearchInput;
|
|
55519
|
+
exports.SearchInput = SearchInput$1;
|
|
55379
55520
|
exports.SingleBarLineCharts = SingleBarLineCharts;
|
|
55380
55521
|
exports.SortPop = SortPop;
|
|
55381
55522
|
exports.TabMenu = TabMenu;
|