react-restyle-components 0.3.65 → 0.3.67
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/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-group-by-multiple-select-multiple-fields-display/auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.d.ts +100 -12
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-group-by-multiple-select-multiple-fields-display/auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-group-by-multiple-select-multiple-fields-display/auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.js +85 -51
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-multi-fields-display-drag-drop/auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.d.ts +108 -7
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-multi-fields-display-drag-drop/auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-multi-fields-display-drag-drop/auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.js +154 -60
- package/lib/src/core-components/src/components/AutoComplete/autocomplete/autocomplete.d.ts +104 -6
- package/lib/src/core-components/src/components/AutoComplete/autocomplete/autocomplete.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/autocomplete/autocomplete.js +261 -71
- package/lib/src/core-components/src/components/Loader/loader.component.d.ts +13 -1
- package/lib/src/core-components/src/components/Loader/loader.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Loader/loader.component.js +121 -3
- package/lib/src/core-components/src/components/check-box/checkBox.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/check-box/checkBox.component.js +2 -2
- package/lib/src/core-components/src/components/date-picker/date-picker.component.js +2 -2
- package/lib/src/core-components/src/components/radio/radio.component.js +2 -2
- package/lib/src/core-components/src/components/stepper/stepper.component.d.ts +54 -6
- package/lib/src/core-components/src/components/stepper/stepper.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/stepper/stepper.component.js +127 -19
- package/lib/src/core-components/src/components/timer/timer.component.js +2 -2
- package/lib/src/core-components/src/tc.global.css +7 -1
- package/lib/src/core-components/src/tc.module.css +1 -1
- package/package.json +1 -1
- package/lib/src/core-components/src/library/assets/svg/CheckedBox.svg +0 -14
- package/lib/src/core-components/src/library/assets/svg/DownArrow.svg +0 -14
- package/lib/src/core-components/src/library/assets/svg/UnCheckbox.svg +0 -3
- package/lib/src/core-components/src/library/assets/svg/UpArrow.svg +0 -14
- package/lib/src/core-components/src/library/assets/svg/checkedRadio.svg +0 -13
- package/lib/src/core-components/src/library/assets/svg/datePicker.svg +0 -3
- package/lib/src/core-components/src/library/assets/svg/index.d.ts +0 -10
- package/lib/src/core-components/src/library/assets/svg/index.d.ts.map +0 -1
- package/lib/src/core-components/src/library/assets/svg/index.js +0 -28
- package/lib/src/core-components/src/library/assets/svg/timer copy.svg +0 -3
- package/lib/src/core-components/src/library/assets/svg/timer.svg +0 -3
- package/lib/src/core-components/src/library/assets/svg/uncheckRadio.svg +0 -3
|
@@ -1,23 +1,111 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Item data structure */
|
|
3
|
+
export interface AutoCompleteItem {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Grouped data structure */
|
|
8
|
+
export interface GroupedData {
|
|
9
|
+
[groupKey: string]: AutoCompleteItem[];
|
|
10
|
+
}
|
|
11
|
+
/** Component data prop structure */
|
|
12
|
+
export interface AutoCompleteData {
|
|
13
|
+
/** List of items (array) or grouped items (object) */
|
|
14
|
+
list: AutoCompleteItem[] | GroupedData;
|
|
15
|
+
/** Selected items */
|
|
16
|
+
selected?: AutoCompleteItem[] | string[];
|
|
17
|
+
/** Display keys for rendering item text */
|
|
18
|
+
displayKey?: string[];
|
|
19
|
+
}
|
|
20
|
+
/** Group by configuration */
|
|
21
|
+
export interface GroupByDetails {
|
|
22
|
+
/** Field name to group by */
|
|
23
|
+
groupByName: string;
|
|
24
|
+
/** Field name for total items label */
|
|
25
|
+
totalItemName: string;
|
|
26
|
+
/** Default group name if item doesn't have group field */
|
|
27
|
+
defaultGroupName?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Display configuration */
|
|
30
|
+
export interface DisplayConfig {
|
|
31
|
+
/** Keys to use for displaying item text (joined with separator) */
|
|
32
|
+
displayKeys?: string[];
|
|
33
|
+
/** Separator for joining display keys */
|
|
34
|
+
displaySeparator?: string;
|
|
35
|
+
/** Fallback keys if displayKeys not provided */
|
|
36
|
+
fallbackKeys?: string[];
|
|
37
|
+
/** Custom render function for item display */
|
|
38
|
+
renderItem?: (item: AutoCompleteItem) => React.ReactNode;
|
|
39
|
+
/** Custom render function for group name */
|
|
40
|
+
renderGroupName?: (groupName: string, count: number) => React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/** Selection configuration */
|
|
43
|
+
export interface SelectionConfig {
|
|
44
|
+
/** Whether selected items are string arrays (IDs only) */
|
|
45
|
+
isSelectedStringArray?: boolean;
|
|
46
|
+
/** Callback when selection changes */
|
|
47
|
+
onSelectionChange?: (selectedItems: GroupedData) => void;
|
|
48
|
+
/** Maximum number of items that can be selected */
|
|
49
|
+
maxSelection?: number;
|
|
50
|
+
}
|
|
51
|
+
/** UI Configuration */
|
|
52
|
+
export interface UIConfig {
|
|
53
|
+
/** Show group headers */
|
|
54
|
+
showGroupHeaders?: boolean;
|
|
55
|
+
/** Enable collapsible groups */
|
|
56
|
+
collapsibleGroups?: boolean;
|
|
57
|
+
/** Show "Select All" buttons in group headers */
|
|
58
|
+
showSelectAllButtons?: boolean;
|
|
59
|
+
/** Show selected items section */
|
|
60
|
+
showSelectedSection?: boolean;
|
|
61
|
+
/** Custom placeholder text when items are selected */
|
|
62
|
+
selectedPlaceholder?: string | ((count: number) => string);
|
|
63
|
+
/** Empty state message */
|
|
64
|
+
emptyStateMessage?: string;
|
|
65
|
+
/** Empty state description */
|
|
66
|
+
emptyStateDescription?: string;
|
|
67
|
+
}
|
|
1
68
|
export interface AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplayProps {
|
|
69
|
+
/** Unique identifier field name for items */
|
|
2
70
|
uniqueField?: string;
|
|
3
|
-
|
|
71
|
+
/** Field name to group items by */
|
|
72
|
+
groupByField?: string;
|
|
73
|
+
/** Selection configuration */
|
|
74
|
+
selectionConfig?: SelectionConfig;
|
|
75
|
+
/** Display configuration */
|
|
76
|
+
displayConfig?: DisplayConfig;
|
|
77
|
+
/** UI configuration */
|
|
78
|
+
uiConfig?: UIConfig;
|
|
79
|
+
/** Loading state */
|
|
4
80
|
loader?: boolean;
|
|
81
|
+
/** Input placeholder */
|
|
5
82
|
placeholder?: string;
|
|
6
|
-
data
|
|
83
|
+
/** Component data */
|
|
84
|
+
data: AutoCompleteData;
|
|
85
|
+
/** Error state */
|
|
7
86
|
hasError?: boolean;
|
|
87
|
+
/** Disabled state */
|
|
8
88
|
disable?: boolean;
|
|
89
|
+
/** Convert input to uppercase */
|
|
9
90
|
isUpperCase?: boolean;
|
|
91
|
+
/** Input name attribute */
|
|
10
92
|
name?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
groupByName: string;
|
|
15
|
-
totalItemName: string;
|
|
16
|
-
};
|
|
93
|
+
/** Group by details (legacy, use groupByField instead) */
|
|
94
|
+
groupByDetails?: GroupByDetails;
|
|
95
|
+
/** Filter callback */
|
|
17
96
|
onFilter?: (value: string) => void;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
97
|
+
/** Update callback (fires on every selection change) */
|
|
98
|
+
onUpdate?: (items: AutoCompleteItem[]) => void;
|
|
99
|
+
/** Select callback (fires when OK is clicked or dropdown closes) */
|
|
100
|
+
onSelect: (selectedGroups: GroupedData) => void;
|
|
101
|
+
/** Blur callback */
|
|
102
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
103
|
+
/** Additional className */
|
|
104
|
+
className?: string;
|
|
105
|
+
/** Custom styles */
|
|
106
|
+
style?: React.CSSProperties;
|
|
107
|
+
/** Debounce delay for filter (ms) */
|
|
108
|
+
filterDebounceDelay?: number;
|
|
21
109
|
}
|
|
22
|
-
export declare const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay: ({ uniqueField,
|
|
110
|
+
export declare const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay: ({ uniqueField, groupByField, selectionConfig, displayConfig, uiConfig, loader, placeholder, data, hasError, disable, isUpperCase, name, groupByDetails, onFilter, onUpdate, onSelect, onBlur, className, style, filterDebounceDelay, }: AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
111
|
//# sourceMappingURL=auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/AutoComplete/auto-complete-filter-group-by-multiple-select-multiple-fields-display/auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/AutoComplete/auto-complete-filter-group-by-multiple-select-multiple-fields-display/auto-complete-filter-group-by-multiple-select-multiple-fields-display.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAMzD,0BAA0B;AAC1B,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,6BAA6B;AAC7B,MAAM,WAAW,W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KAAK,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC/C,oEAAoE;IACpE,QAAQ,EAAE,CAAC,cAAc,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,oBAAoB;IACpB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,qCAAqC;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,4DAA4D,2OAqBtE,iEAAiE,4CA60BnE,CAAC"}
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
4
4
|
import { Icon } from '../../';
|
|
5
5
|
import s from '../../../tc.module.css';
|
|
6
6
|
import { cn } from '../../../utils';
|
|
7
7
|
import { debounce } from '@techabl/core-utils';
|
|
8
|
-
export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ uniqueField = '_id',
|
|
8
|
+
export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ uniqueField = '_id', groupByField, selectionConfig = {}, displayConfig = {}, uiConfig = {}, loader = false, placeholder = 'Search...', data, hasError = false, disable = false, isUpperCase = false, name, groupByDetails, onFilter, onUpdate, onSelect, onBlur, className, style, filterDebounceDelay = 300, }) => {
|
|
9
|
+
// Merge configs with defaults
|
|
10
|
+
const { isSelectedStringArray = false, maxSelection, onSelectionChange, } = selectionConfig;
|
|
11
|
+
const { displayKeys, displaySeparator = ' - ', fallbackKeys = ['name', 'code'], renderItem, renderGroupName, } = displayConfig;
|
|
12
|
+
const { showGroupHeaders = true, collapsibleGroups = false, showSelectAllButtons = true, showSelectedSection = true, selectedPlaceholder, emptyStateMessage = 'No results found', emptyStateDescription = 'Try adjusting your search terms', } = uiConfig;
|
|
13
|
+
// Get groupByField from props or legacy groupByDetails
|
|
14
|
+
const groupField = groupByField || groupByDetails?.groupByName || 'lab';
|
|
15
|
+
const defaultGroupName = groupByDetails?.defaultGroupName || 'Default';
|
|
16
|
+
const totalItemName = groupByDetails?.totalItemName || 'department';
|
|
17
|
+
// Helper to get display text for item
|
|
18
|
+
const getItemDisplayText = (item) => {
|
|
19
|
+
if (renderItem) {
|
|
20
|
+
const rendered = renderItem(item);
|
|
21
|
+
if (typeof rendered === 'string')
|
|
22
|
+
return rendered;
|
|
23
|
+
}
|
|
24
|
+
const keys = displayKeys || data.displayKey || fallbackKeys;
|
|
25
|
+
return (keys
|
|
26
|
+
.map((key) => item[key])
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.join(displaySeparator) || 'Unnamed Item');
|
|
29
|
+
};
|
|
30
|
+
// Helper to get group name display
|
|
31
|
+
const getGroupNameDisplay = (groupName, count) => {
|
|
32
|
+
if (renderGroupName) {
|
|
33
|
+
return renderGroupName(groupName, count);
|
|
34
|
+
}
|
|
35
|
+
return groupName;
|
|
36
|
+
};
|
|
9
37
|
const [value, setValue] = useState('');
|
|
10
38
|
const [groupedOptions, setGroupedOptions] = useState({});
|
|
11
39
|
const [originalGroupedOptions, setOriginalGroupedOptions] = useState({});
|
|
@@ -13,18 +41,24 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
13
41
|
const [collapsedGroups, setCollapsedGroups] = useState(new Set());
|
|
14
42
|
const [isListOpen, setIsListOpen] = useState(false);
|
|
15
43
|
const [totalItems, setTotalItems] = useState(0);
|
|
44
|
+
// Helper to get selected groups
|
|
45
|
+
const getSelectedGroups = React.useCallback(() => {
|
|
46
|
+
return Object.keys(originalGroupedOptions).reduce((acc, groupKey) => {
|
|
47
|
+
const selectedItems = (originalGroupedOptions[groupKey] || []).filter((item) => item.selected);
|
|
48
|
+
if (selectedItems.length > 0) {
|
|
49
|
+
acc[groupKey] = selectedItems;
|
|
50
|
+
}
|
|
51
|
+
return acc;
|
|
52
|
+
}, {});
|
|
53
|
+
}, [originalGroupedOptions]);
|
|
16
54
|
const useOutsideAlerter = (ref) => {
|
|
17
55
|
useEffect(() => {
|
|
18
56
|
function handleClickOutside(event) {
|
|
19
|
-
if (ref.current &&
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
acc[groupKey] = selectedItems;
|
|
25
|
-
}
|
|
26
|
-
return acc;
|
|
27
|
-
}, {}));
|
|
57
|
+
if (ref.current &&
|
|
58
|
+
!ref.current.contains(event.target) &&
|
|
59
|
+
isListOpen) {
|
|
60
|
+
const selectedGroups = getSelectedGroups();
|
|
61
|
+
onSelect && onSelect(selectedGroups);
|
|
28
62
|
setIsListOpen(false);
|
|
29
63
|
setValue('');
|
|
30
64
|
}
|
|
@@ -33,7 +67,7 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
33
67
|
return () => {
|
|
34
68
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
35
69
|
};
|
|
36
|
-
}, [ref, isListOpen,
|
|
70
|
+
}, [ref, isListOpen, getSelectedGroups, onSelect]);
|
|
37
71
|
};
|
|
38
72
|
const prevGroupedOptionsRef = useRef(groupedOptions);
|
|
39
73
|
useEffect(() => {
|
|
@@ -92,10 +126,9 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
92
126
|
// Handle both grouped data structure and regular list structure
|
|
93
127
|
let processedData = {};
|
|
94
128
|
if (data.list && Array.isArray(data.list)) {
|
|
95
|
-
// If data.list is an array,
|
|
96
|
-
// Group by 'lab' field or create a single group
|
|
129
|
+
// If data.list is an array, group by the specified field
|
|
97
130
|
const grouped = data.list.reduce((groups, item) => {
|
|
98
|
-
const groupKey = item?.
|
|
131
|
+
const groupKey = item?.[groupField] || defaultGroupName;
|
|
99
132
|
if (!groups[groupKey]) {
|
|
100
133
|
groups[groupKey] = [];
|
|
101
134
|
}
|
|
@@ -117,22 +150,30 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
117
150
|
const selectedInGroup = (processedData[groupKey] || []).filter((item) => item.selected);
|
|
118
151
|
allSelected.push(...selectedInGroup);
|
|
119
152
|
});
|
|
120
|
-
setSelectedItems(Array.isArray(data?.selected)
|
|
121
|
-
|
|
153
|
+
setSelectedItems(Array.isArray(data?.selected) && !isSelectedStringArray
|
|
154
|
+
? data.selected
|
|
155
|
+
: allSelected);
|
|
156
|
+
}, [
|
|
157
|
+
data,
|
|
158
|
+
data.selected,
|
|
159
|
+
isSelectedStringArray,
|
|
160
|
+
uniqueField,
|
|
161
|
+
groupField,
|
|
162
|
+
defaultGroupName,
|
|
163
|
+
]);
|
|
164
|
+
const debouncedFilter = React.useMemo(() => debounce((search) => {
|
|
165
|
+
onFilter && onFilter(search);
|
|
166
|
+
}, filterDebounceDelay), [onFilter, filterDebounceDelay]);
|
|
122
167
|
const onChange = (e) => {
|
|
123
168
|
const search = e.target.value;
|
|
124
169
|
setValue(search);
|
|
125
|
-
|
|
126
|
-
onFilter && onFilter(search);
|
|
127
|
-
});
|
|
170
|
+
debouncedFilter(search);
|
|
128
171
|
};
|
|
129
172
|
const onKeyUp = (e) => {
|
|
130
173
|
const charCode = e.which ? e.which : e.keyCode;
|
|
131
174
|
if (charCode === 8) {
|
|
132
|
-
const search = e.
|
|
133
|
-
|
|
134
|
-
onFilter && onFilter(search);
|
|
135
|
-
});
|
|
175
|
+
const search = e.currentTarget.value;
|
|
176
|
+
debouncedFilter(search);
|
|
136
177
|
}
|
|
137
178
|
};
|
|
138
179
|
const toggleGroupCollapse = (groupName) => {
|
|
@@ -231,7 +272,7 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
231
272
|
return (_jsxs("div", { className: cn(s['p-4'], s['text-center'], s['text-gray-500']), children: [_jsx(Icon, { nameIcon: "FaSearch", propsIcon: {
|
|
232
273
|
size: 24,
|
|
233
274
|
color: '#ccc',
|
|
234
|
-
} }), _jsx("p", { className: cn(s['mt-2'], s['text-sm']), children:
|
|
275
|
+
} }), _jsx("p", { className: cn(s['mt-2'], s['text-sm']), children: emptyStateMessage }), _jsx("p", { className: cn(s['text-xs']), children: emptyStateDescription })] }));
|
|
235
276
|
}
|
|
236
277
|
return groupNames.map((groupName) => {
|
|
237
278
|
const groupItems = groupedOptions[groupName] || [];
|
|
@@ -241,33 +282,37 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
241
282
|
return (_jsxs("div", { className: cn(s['border-b'], s['border-gray-200'], s['last:border-b-0']), children: [showGroupHeaders && (_jsxs("div", { className: cn(s['flex'], s['items-center'], s['justify-between'], s['p-3'], s['bg-gray-50'], s['border-b'], s['border-gray-200'], s['font-semibold'], s['text-sm'], s['text-gray-700'], collapsibleGroups && s['cursor-pointer'], s['hover:bg-gray-100']), onClick: () => collapsibleGroups && toggleGroupCollapse(groupName), children: [_jsxs("div", { className: cn(s['flex'], s['items-center'], s['gap-2']), children: [collapsibleGroups && (_jsx(Icon, { nameIcon: isCollapsed ? 'FaChevronRight' : 'FaChevronDown', propsIcon: {
|
|
242
283
|
size: 12,
|
|
243
284
|
color: '#666',
|
|
244
|
-
} })), _jsx("span", { className: cn(s['font-bold'], s['text-blue-700']), children: groupName }), _jsxs("span", { className: cn(s['text-xs'], s['bg-blue-100'], s['text-blue-800'], s['px-2'], s['py-1'], s['rounded-full']), children: [selectedInGroup, "/", groupItems.length] })] }), _jsxs("div", { className: cn(s['flex'], s['gap-1']), children: [_jsx("button", { type: "button", onClick: (e) => {
|
|
285
|
+
} })), _jsx("span", { className: cn(s['font-bold'], s['text-blue-700']), children: getGroupNameDisplay(groupName, groupItems.length) }), _jsxs("span", { className: cn(s['text-xs'], s['bg-blue-100'], s['text-blue-800'], s['px-2'], s['py-1'], s['rounded-full']), children: [selectedInGroup, "/", groupItems.length] })] }), showSelectAllButtons && (_jsxs("div", { className: cn(s['flex'], s['gap-1']), children: [_jsx("button", { type: "button", onClick: (e) => {
|
|
245
286
|
e.stopPropagation();
|
|
246
287
|
handleGroupSelectAll(groupName, groupItems, true);
|
|
247
288
|
}, className: cn(s['text-xs'], s['px-2'], s['py-1'], s['bg-green-500'], s['text-white'], s['rounded'], s['hover:bg-green-600'], s['transition-colors'], selectedInGroup === groupItems.length && s['opacity-50'], selectedInGroup === groupItems.length &&
|
|
248
289
|
s['cursor-not-allowed']), title: `Select all in ${groupName}`, disabled: selectedInGroup === groupItems.length, children: "All" }), _jsx("button", { type: "button", onClick: (e) => {
|
|
249
290
|
e.stopPropagation();
|
|
250
291
|
handleGroupSelectAll(groupName, groupItems, false);
|
|
251
|
-
}, className: cn(s['text-xs'], s['px-2'], s['py-1'], s['bg-gray-500'], s['text-white'], s['rounded'], s['hover:bg-gray-600'], s['transition-colors'], selectedInGroup === 0 && s['opacity-50'], selectedInGroup === 0 && s['cursor-not-allowed']), title: `Deselect all in ${groupName}`, disabled: selectedInGroup === 0, children: "None" })] })] })), (!collapsibleGroups || !isCollapsed) && (_jsxs("div", { className: cn(s['max-h-60'], s['overflow-y-auto']), children: [unselectedInGroup.map((item, index) => (_jsx("div", { className: cn(s['flex'], s['items-center'], s['gap-3'], s['p-3'], s['hover:bg-blue-50'], s['border-l-4'], s['border-transparent'], s['transition-colors']), children: _jsxs("label", { className: cn(s['flex'], s['items-center'], s['cursor-pointer'], s['w-full']), children: [_jsx("input", { id: `${groupName}-${index}`, className: cn(s['h-4'], s['w-4'], s['text-blue-600'], s['border-gray-300'], s['rounded'], s['focus:ring-blue-500'], s['cursor-pointer']), type: "checkbox", checked: false, onChange: () => {
|
|
292
|
+
}, className: cn(s['text-xs'], s['px-2'], s['py-1'], s['bg-gray-500'], s['text-white'], s['rounded'], s['hover:bg-gray-600'], s['transition-colors'], selectedInGroup === 0 && s['opacity-50'], selectedInGroup === 0 && s['cursor-not-allowed']), title: `Deselect all in ${groupName}`, disabled: selectedInGroup === 0, children: "None" })] }))] })), (!collapsibleGroups || !isCollapsed) && (_jsxs("div", { className: cn(s['max-h-60'], s['overflow-y-auto']), children: [unselectedInGroup.map((item, index) => (_jsx("div", { className: cn(s['flex'], s['items-center'], s['gap-3'], s['p-3'], s['hover:bg-blue-50'], s['border-l-4'], s['border-transparent'], s['transition-colors']), children: _jsxs("label", { className: cn(s['flex'], s['items-center'], s['cursor-pointer'], s['w-full']), children: [_jsx("input", { id: `${groupName}-${index}`, className: cn(s['h-4'], s['w-4'], s['text-blue-600'], s['border-gray-300'], s['rounded'], s['focus:ring-blue-500'], s['cursor-pointer']), type: "checkbox", checked: false, onChange: () => {
|
|
252
293
|
const itemIndex = groupedOptions[groupName].findIndex((grpItem) => grpItem[uniqueField] === item[uniqueField]);
|
|
253
294
|
handleGroupSelectToggle(groupName, false, itemIndex);
|
|
254
|
-
} }), _jsx("div", { className: cn(s['ml-3'], s['flex'], s['flex-col']), children: _jsx("span", { className: cn(s['text-sm'], s['font-medium'], s['text-gray-700']), children:
|
|
255
|
-
? data.displayKey
|
|
256
|
-
.map((key) => item[key])
|
|
257
|
-
.filter(Boolean)
|
|
258
|
-
.join(' - ')
|
|
259
|
-
: item.name || item.code || 'Unnamed Item' }) })] }) }, `${groupName}-${item[uniqueField] || index}`))), unselectedInGroup.length === 0 && groupItems.length > 0 && (_jsx("div", { className: cn(s['p-3'], s['text-center'], s['text-gray-500'], s['text-sm']), children: "All items in this group are selected" }))] }))] }, groupName));
|
|
295
|
+
} }), _jsx("div", { className: cn(s['ml-3'], s['flex'], s['flex-col']), children: renderItem ? (renderItem(item)) : (_jsx("span", { className: cn(s['text-sm'], s['font-medium'], s['text-gray-700']), children: getItemDisplayText(item) })) })] }) }, `${groupName}-${item[uniqueField] || index}`))), unselectedInGroup.length === 0 && groupItems.length > 0 && (_jsx("div", { className: cn(s['p-3'], s['text-center'], s['text-gray-500'], s['text-sm']), children: "All items in this group are selected" }))] }))] }, groupName));
|
|
260
296
|
});
|
|
261
297
|
};
|
|
262
298
|
const getSelectedCount = () => {
|
|
263
299
|
return selectedItems?.length;
|
|
264
300
|
};
|
|
265
|
-
|
|
301
|
+
// Call selection change callback when selection updates
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
if (onSelectionChange) {
|
|
304
|
+
onSelectionChange(getSelectedGroups());
|
|
305
|
+
}
|
|
306
|
+
}, [groupedOptions, onSelectionChange, getSelectedGroups]);
|
|
307
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { ref: wrapperRef, className: cn(s['w-full'], s['relative'], className), style: style, children: [_jsxs("div", { className: cn(s['flex'], s['items-center'], s['leading-4'], s['p-2'], s['focus:outline-none'], s['focus:ring'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border'], s['rounded-md'], {
|
|
266
308
|
[s['border-red']]: hasError,
|
|
267
309
|
[s['border-gray-300']]: !hasError,
|
|
268
310
|
}, s['bg-white']), children: [_jsx("input", { placeholder: placeholder, disabled: disable, name: name, value: !isListOpen
|
|
269
311
|
? getSelectedCount() > 0
|
|
270
|
-
?
|
|
312
|
+
? typeof selectedPlaceholder === 'function'
|
|
313
|
+
? selectedPlaceholder(getSelectedCount())
|
|
314
|
+
: selectedPlaceholder ||
|
|
315
|
+
`${getSelectedCount()} Items Selected`
|
|
271
316
|
: placeholder
|
|
272
317
|
: isUpperCase
|
|
273
318
|
? value?.toUpperCase()
|
|
@@ -277,24 +322,13 @@ export const AutoCompleteFilterGroupByMultipleSelectMultipleFieldsDisplay = ({ u
|
|
|
277
322
|
} }) })) : (_jsx(Icon, { nameIcon: isListOpen ? 'FaChevronUp' : 'FaChevronDown', propsIcon: {
|
|
278
323
|
size: 16,
|
|
279
324
|
color: '#000000',
|
|
280
|
-
} }))] }), isListOpen && (_jsxs("div", { className: cn(s['mt-1'], s['absolute'], s['rounded-md'], s['bg-white'], s['border'], s['border-gray-300'], s['shadow-lg'], s['z-50'], s['w-full'], s['max-h-96'], s['overflow-hidden']), style: { zIndex: 1000 }, children: [_jsx("div", { className: cn(s['p-3'], s['border-b'], s['border-gray-200'], s['bg-gray-50'], s['text-sm'], s['font-medium'], s['text-gray-700']), children: _jsxs("div", { className: cn(s['flex'], s['justify-between'], s['items-center']), children: [_jsxs("span", { children: [Object.keys(groupedOptions).length, ' ',
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (selectedItems.length > 0) {
|
|
284
|
-
acc[groupKey] = selectedItems;
|
|
285
|
-
}
|
|
286
|
-
return acc;
|
|
287
|
-
}, {}));
|
|
325
|
+
} }))] }), isListOpen && (_jsxs("div", { className: cn(s['mt-1'], s['absolute'], s['rounded-md'], s['bg-white'], s['border'], s['border-gray-300'], s['shadow-lg'], s['z-50'], s['w-full'], s['max-h-96'], s['overflow-hidden']), style: { zIndex: 1000 }, children: [_jsx("div", { className: cn(s['p-3'], s['border-b'], s['border-gray-200'], s['bg-gray-50'], s['text-sm'], s['font-medium'], s['text-gray-700']), children: _jsxs("div", { className: cn(s['flex'], s['justify-between'], s['items-center']), children: [_jsxs("span", { children: [Object.keys(groupedOptions).length, ' ', groupField?.toUpperCase(), ", ", totalItems, ' ', totalItemName?.toUpperCase()] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: cn(s['text-blue-600']), children: [getSelectedCount(), " Selected"] }), _jsx("div", { className: cn(s['flex'], s['gap-2']), children: _jsx("button", { type: "button", className: cn(s['text-xs'], s['px-3'], s['py-1'], s['bg-blue-600'], s['text-white'], s['rounded'], s['hover:bg-blue-700'], s['transition-colors']), onClick: () => {
|
|
326
|
+
const selectedGroups = getSelectedGroups();
|
|
327
|
+
onSelect(selectedGroups);
|
|
288
328
|
setIsListOpen(false);
|
|
289
329
|
setValue('');
|
|
290
|
-
}, children: "OK" }) })] })] }) }), _jsxs("div", { className: cn(s['max-h-80'], s['overflow-y-auto']), children: [getSelectedCount() > 0 && (_jsxs("div", { className: cn(s['border-b'], s['border-gray-200']), children: [_jsx("div", { className: cn(s['p-3'], s['bg-blue-50'], s['border-b'], s['border-blue-200'], s['font-semibold'], s['text-sm'], s['text-blue-700']), children: _jsxs("div", { className: cn(s['flex'], s['items-center'], s['gap-2']), children: [_jsx(Icon, { nameIcon: "FaCheck", propsIcon: {
|
|
330
|
+
}, children: "OK" }) })] })] }) }), _jsxs("div", { className: cn(s['max-h-80'], s['overflow-y-auto']), children: [showSelectedSection && getSelectedCount() > 0 && (_jsxs("div", { className: cn(s['border-b'], s['border-gray-200']), children: [_jsx("div", { className: cn(s['p-3'], s['bg-blue-50'], s['border-b'], s['border-blue-200'], s['font-semibold'], s['text-sm'], s['text-blue-700']), children: _jsxs("div", { className: cn(s['flex'], s['items-center'], s['gap-2']), children: [_jsx(Icon, { nameIcon: "FaCheck", propsIcon: {
|
|
291
331
|
size: 12,
|
|
292
332
|
color: '#1976d2',
|
|
293
|
-
} }), _jsxs("span", { children: ["Selected Items (", getSelectedCount(), ")"] })] }) }), _jsx("div", { className: cn(s['max-h-48'], s['overflow-y-auto']), children: selectedItems?.map((item, index) => (_jsx("div", { className: cn(s['flex'], s['items-center'], s['gap-3'], s['p-3'], s['hover:bg-blue-50'], s['border-l-4'], s['border-blue-500'], s['bg-blue-25'], s['transition-colors']), children: _jsxs("label", { className: cn(s['flex'], s['items-center'], s['cursor-pointer'], s['w-full']), children: [_jsx("input", { type: "checkbox", checked: true, onChange: () => handleDeselectItem(item), className: cn(s['h-4'], s['w-4'], s['text-blue-600'], s['border-gray-300'], s['rounded'], s['focus:ring-blue-500'], s['cursor-pointer']) }),
|
|
294
|
-
?.map((key) => item[key])
|
|
295
|
-
.filter(Boolean)
|
|
296
|
-
.join(' - ') ||
|
|
297
|
-
item.name ||
|
|
298
|
-
item.code ||
|
|
299
|
-
'Unnamed Item' }), _jsx("span", { className: cn(s['text-xs'], s['text-gray-500']), children: item.lab || 'Default Group' })] })] }) }, `selected-${item[uniqueField] || index}`))) })] })), _jsx("div", { children: renderGroupedOptions() })] })] }))] }) }));
|
|
333
|
+
} }), _jsxs("span", { children: ["Selected Items (", getSelectedCount(), ")"] })] }) }), _jsx("div", { className: cn(s['max-h-48'], s['overflow-y-auto']), children: selectedItems?.map((item, index) => (_jsx("div", { className: cn(s['flex'], s['items-center'], s['gap-3'], s['p-3'], s['hover:bg-blue-50'], s['border-l-4'], s['border-blue-500'], s['bg-blue-25'], s['transition-colors']), children: _jsxs("label", { className: cn(s['flex'], s['items-center'], s['cursor-pointer'], s['w-full']), children: [_jsx("input", { type: "checkbox", checked: true, onChange: () => handleDeselectItem(item), className: cn(s['h-4'], s['w-4'], s['text-blue-600'], s['border-gray-300'], s['rounded'], s['focus:ring-blue-500'], s['cursor-pointer']) }), _jsx("div", { className: cn(s['ml-3'], s['flex'], s['flex-col']), children: renderItem ? (renderItem(item)) : (_jsxs(_Fragment, { children: [_jsx("span", { className: cn(s['text-sm'], s['font-medium'], s['text-blue-700']), children: getItemDisplayText(item) }), _jsx("span", { className: cn(s['text-xs'], s['text-gray-500']), children: item[groupField] || defaultGroupName })] })) })] }) }, `selected-${item[uniqueField] || index}`))) })] })), _jsx("div", { children: renderGroupedOptions() })] })] }))] }) }));
|
|
300
334
|
};
|
|
@@ -1,19 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SortingStrategy } from '@dnd-kit/sortable';
|
|
3
|
+
/** Item data structure with optional sort field for drag-drop */
|
|
4
|
+
export interface DragDropItem {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
sort?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Component data prop structure */
|
|
10
|
+
export interface DragDropAutoCompleteData {
|
|
11
|
+
/** List of available items */
|
|
12
|
+
list: DragDropItem[];
|
|
13
|
+
/** Selected items */
|
|
14
|
+
selected?: DragDropItem[];
|
|
15
|
+
/** Display keys for rendering item text */
|
|
16
|
+
displayKey?: string[];
|
|
17
|
+
}
|
|
18
|
+
/** Display configuration */
|
|
19
|
+
export interface DragDropDisplayConfig {
|
|
20
|
+
/** Keys to use for displaying item text */
|
|
21
|
+
displayKeys?: string[];
|
|
22
|
+
/** Separator for joining display keys */
|
|
23
|
+
displaySeparator?: string;
|
|
24
|
+
/** Fallback keys if displayKeys not provided */
|
|
25
|
+
fallbackKeys?: string[];
|
|
26
|
+
/** Custom render function for item display */
|
|
27
|
+
renderItem?: (item: DragDropItem) => React.ReactNode;
|
|
28
|
+
/** Custom render function for selected item badge */
|
|
29
|
+
renderSelectedBadge?: (item: DragDropItem, index: number, onRemove: () => void) => React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/** Drag and Drop configuration */
|
|
32
|
+
export interface DragDropConfig {
|
|
33
|
+
/** Enable drag and drop */
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
/** Sorting strategy */
|
|
36
|
+
strategy?: SortingStrategy;
|
|
37
|
+
/** Callback when drag ends */
|
|
38
|
+
onDragEnd?: (reorderedItems: DragDropItem[]) => void;
|
|
39
|
+
/** Animation duration (ms) */
|
|
40
|
+
animationDuration?: number;
|
|
41
|
+
}
|
|
42
|
+
/** Selection configuration */
|
|
43
|
+
export interface DragDropSelectionConfig {
|
|
44
|
+
/** Maximum number of items that can be selected */
|
|
45
|
+
maxSelection?: number;
|
|
46
|
+
/** Callback when selection changes */
|
|
47
|
+
onSelectionChange?: (selectedItems: DragDropItem[]) => void;
|
|
48
|
+
}
|
|
49
|
+
/** UI Configuration */
|
|
50
|
+
export interface DragDropUIConfig {
|
|
51
|
+
/** Show selected items section */
|
|
52
|
+
showSelectedSection?: boolean;
|
|
53
|
+
/** Custom placeholder text when items are selected */
|
|
54
|
+
selectedPlaceholder?: string | ((count: number) => string);
|
|
55
|
+
/** Empty state message */
|
|
56
|
+
emptyStateMessage?: string;
|
|
57
|
+
/** Maximum height for dropdown */
|
|
58
|
+
maxHeight?: string;
|
|
59
|
+
/** Z-index for dropdown */
|
|
60
|
+
zIndex?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Draggable selected item props */
|
|
63
|
+
export interface DraggableSelectedItemProps {
|
|
64
|
+
item: DragDropItem;
|
|
65
|
+
index: number;
|
|
66
|
+
onRemove: (index: number) => void;
|
|
67
|
+
displayKey?: string[];
|
|
68
|
+
uniqueField?: string;
|
|
69
|
+
displayConfig?: DragDropDisplayConfig;
|
|
70
|
+
className?: string;
|
|
71
|
+
style?: React.CSSProperties;
|
|
72
|
+
}
|
|
73
|
+
export declare const DraggableSelectedItem: ({ item, index, onRemove, displayKey, uniqueField, displayConfig, className, style: customStyle, }: DraggableSelectedItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
interface AutoCompleteFilterMultiSelectMultiFieldsDisplayDragDropProps {
|
|
75
|
+
/** Component key for React */
|
|
76
|
+
componentKey?: string;
|
|
77
|
+
/** Unique identifier field name for items */
|
|
3
78
|
uniqueField?: string;
|
|
79
|
+
/** Loading state */
|
|
4
80
|
loader?: boolean;
|
|
81
|
+
/** Input placeholder */
|
|
5
82
|
placeholder?: string;
|
|
6
|
-
data
|
|
83
|
+
/** Component data */
|
|
84
|
+
data: DragDropAutoCompleteData;
|
|
85
|
+
/** Error state */
|
|
7
86
|
hasError?: boolean;
|
|
87
|
+
/** Disabled state */
|
|
8
88
|
disable?: boolean;
|
|
89
|
+
/** Convert input to uppercase */
|
|
9
90
|
isUpperCase?: boolean;
|
|
91
|
+
/** Input name attribute */
|
|
10
92
|
name?: string;
|
|
93
|
+
/** Default input value */
|
|
11
94
|
defaultValue?: string;
|
|
95
|
+
/** Display configuration */
|
|
96
|
+
displayConfig?: DragDropDisplayConfig;
|
|
97
|
+
/** Drag and drop configuration */
|
|
98
|
+
dragDropConfig?: DragDropConfig;
|
|
99
|
+
/** Selection configuration */
|
|
100
|
+
selectionConfig?: DragDropSelectionConfig;
|
|
101
|
+
/** UI configuration */
|
|
102
|
+
uiConfig?: DragDropUIConfig;
|
|
103
|
+
/** Filter callback */
|
|
12
104
|
onFilter?: (value: string) => void;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
105
|
+
/** Update callback (fires when dropdown closes) */
|
|
106
|
+
onUpdate: (items: DragDropItem[]) => void;
|
|
107
|
+
/** Select callback (fires when item is selected/deselected) */
|
|
108
|
+
onSelect: (item: DragDropItem) => void;
|
|
109
|
+
/** Blur callback */
|
|
110
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
111
|
+
/** Additional className */
|
|
112
|
+
className?: string;
|
|
113
|
+
/** Custom styles */
|
|
114
|
+
style?: React.CSSProperties;
|
|
115
|
+
/** Debounce delay for filter (ms) */
|
|
116
|
+
filterDebounceDelay?: number;
|
|
16
117
|
}
|
|
17
|
-
export declare const AutoCompleteFilterMultiSelectMultiFieldsDisplayDragDrop: ({
|
|
118
|
+
export declare const AutoCompleteFilterMultiSelectMultiFieldsDisplayDragDrop: ({ componentKey, uniqueField, loader, placeholder, data, hasError, disable, isUpperCase, name, defaultValue, displayConfig, dragDropConfig, selectionConfig, uiConfig, onFilter, onUpdate, onSelect, onBlur, className, style, filterDebounceDelay, }: AutoCompleteFilterMultiSelectMultiFieldsDisplayDragDropProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
119
|
export {};
|
|
19
120
|
//# sourceMappingURL=auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-multi-fields-display-drag-drop/auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-multi-fields-display-drag-drop/auto-complete-filter-multi-select-multi-fields-display-drag-drop.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAUzD,OAAO,EAKL,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAM3B,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oCAAoC;AACpC,MAAM,WAAW,wBAAwB;IACvC,8BAA8B;IAC9B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,4BAA4B;AAC5B,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,KAAK,CAAC,SAAS,CAAC;IACrD,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,CACpB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,IAAI,KACjB,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,8BAA8B;IAC9B,SAAS,CAAC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