sccoreui 6.5.28 → 6.5.30
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/components/ag-grid/advancedFeature/global-search.js +1 -2
- package/dist/components/ag-grid/advancedFeature/hide-column.js +18 -8
- package/dist/components/ag-grid/advancedFeature/new-filter/table-filter.js +10 -8
- package/dist/components/overlays/overlay-panel.js +28 -1
- package/dist/types/components/overlays/overlay-panel.d.ts +2 -1
- package/package.json +1 -1
|
@@ -11,9 +11,8 @@ const helper_1 = require("../helper");
|
|
|
11
11
|
const utilComponents_1 = require("../utilComponents");
|
|
12
12
|
const skeleton_1 = require("primereact/skeleton");
|
|
13
13
|
function Search({ searchPlaceHolder }) {
|
|
14
|
-
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, inputValue, deboucedValue, setInputValue } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
14
|
+
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, inputValue, deboucedValue, setInputValue, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
15
15
|
const isDisabled = (0, helper_1.isComponentDisable)(conditionsToDisplay.displaySearch);
|
|
16
|
-
console.log(deboucedValue, inputValue, "input-data-values");
|
|
17
16
|
(0, react_1.useEffect)(() => {
|
|
18
17
|
var _a, _b, _c;
|
|
19
18
|
if (rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE && quickSearch) {
|
|
@@ -117,11 +117,19 @@ function HideColumn() {
|
|
|
117
117
|
// When selected item dropped
|
|
118
118
|
const handleDrop = (index) => (event) => {
|
|
119
119
|
event.preventDefault();
|
|
120
|
-
const draggedIndex = event.dataTransfer.getData("text");
|
|
121
|
-
if (draggedIndex !== index
|
|
120
|
+
const draggedIndex = Number(event.dataTransfer.getData("text"));
|
|
121
|
+
if (draggedIndex !== index) {
|
|
122
|
+
// Get the visible panel items to find actual storeNodes indices
|
|
123
|
+
const visibleCols = storeNodes.filter((col) => col.visibleInPanel);
|
|
124
|
+
const draggedItem = visibleCols[draggedIndex];
|
|
125
|
+
const dropItem = visibleCols[index];
|
|
126
|
+
// Find their real positions in storeNodes
|
|
127
|
+
const realDraggedIndex = storeNodes.findIndex((col) => col.id === draggedItem.id);
|
|
128
|
+
const realDropIndex = storeNodes.findIndex((col) => col.id === dropItem.id);
|
|
129
|
+
// Reorder in storeNodes directly
|
|
122
130
|
const updatedColumns = [...storeNodes];
|
|
123
|
-
const [
|
|
124
|
-
updatedColumns.splice(
|
|
131
|
+
const [removed] = updatedColumns.splice(realDraggedIndex, 1);
|
|
132
|
+
updatedColumns.splice(realDropIndex, 0, removed);
|
|
125
133
|
setNodes(updatedColumns);
|
|
126
134
|
setStoreNodes(updatedColumns);
|
|
127
135
|
setHasChanges(true);
|
|
@@ -152,9 +160,11 @@ function HideColumn() {
|
|
|
152
160
|
setInputValue("");
|
|
153
161
|
setHasChanges(false);
|
|
154
162
|
};
|
|
155
|
-
const visibleColumnsInSideBar = (0, react_1.useMemo)(() => {
|
|
163
|
+
const visibleColumnsInSideBar = (0, react_1.useMemo)(() => {
|
|
164
|
+
return nodes.filter((y) => y === null || y === void 0 ? void 0 : y.visibleInPanel);
|
|
165
|
+
}, [nodes]);
|
|
156
166
|
return (0, utilComponents_1.skeletonLoding)() ? ((0, jsx_runtime_1.jsx)(FeatureSkeleton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: () => !isDisabled && setVisibleRight(true), className: `rounded_btn sc_icon_hover icon-40x40 ${isDisabled && "disabled"}`, title: "Manage Columns" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "columns-02", color: "text-gray-500", size: 18 }) })), (0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, Object.assign({ className: "md:w-6 lg:w-4 overflow-hidden h-full ag_grid_sidebar", visible: visibleRight, position: "right", onHide: () => hidePanel() }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "bg-white" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex justify-content-between align-items-center px-4 py-3 border-bottom-1 border-gray-200" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-gray-900 text-lg font-semibold line-height-3" }, { children: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.header) || "Configure Columns" })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: "btn-text", label: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.disacrd_button) || "Discard", onClick: () => hidePanel() }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: "font-semibold", label: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.update_button) || "Update", disabled: !hasChanges ||
|
|
157
|
-
(storeNodes === null || storeNodes === void 0 ? void 0 : storeNodes.filter((node) => !node.hide).length) > 15, onClick: () => updateColumns() })] }))] })), enableManageColumnsCallback && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4 pb-0" }, { children: [(0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: "flex align-items-center justify-content-between my-0" }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.apply_to_all_views) || "Apply to all views", (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: enableManageColumnsCallbackAPI, onChange: (e) => setEnableManageColumnsCallbackAPI(e.value) })] })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 text-sm text-gray-600" }, { children: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.apply_subHeading) ||
|
|
167
|
+
(storeNodes === null || storeNodes === void 0 ? void 0 : storeNodes.filter((node) => (node === null || node === void 0 ? void 0 : node.visibleInPanel) && !node.hide).length) > 15, onClick: () => updateColumns() })] }))] })), enableManageColumnsCallback && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4 pb-0" }, { children: [(0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: "flex align-items-center justify-content-between my-0" }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.apply_to_all_views) || "Apply to all views", (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: enableManageColumnsCallbackAPI, onChange: (e) => setEnableManageColumnsCallbackAPI(e.value) })] })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 text-sm text-gray-600" }, { children: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.apply_subHeading) ||
|
|
158
168
|
"Apply the chosen column selection to all available views" })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "mt-2" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (inpValue === null || inpValue === void 0 ? void 0 : inpValue.length) > 0 && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer zoom_animate", onClick: clearSearch }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 18 }) }))), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { id: "email", value: inpValue, onChange: (e) => {
|
|
159
169
|
searchHandler(e.target.value);
|
|
160
170
|
}, disabled: false, placeholder: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.search_placeHolder) ||
|
|
@@ -162,10 +172,10 @@ function HideColumn() {
|
|
|
162
172
|
position: "sticky",
|
|
163
173
|
top: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) && "0px",
|
|
164
174
|
} }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) || "Selected Attributes", " ", (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-gray-500 text-lg font-normal ml-1" }, { children: [`(`, visibleColumnsInSideBar === null || visibleColumnsInSideBar === void 0 ? void 0 : visibleColumnsInSideBar.filter((node) => node.hide !== undefined && node.hide === false).length, "/", visibleColumnsInSideBar.length, `)`] }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-full" }, { children: (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 mt-0" }, { children: (visibleColumnsInSideBar === null || visibleColumnsInSideBar === void 0 ? void 0 : visibleColumnsInSideBar.length) > 0 ? (visibleColumnsInSideBar === null || visibleColumnsInSideBar === void 0 ? void 0 : visibleColumnsInSideBar.map((listItem, idx) => (listItem === null || listItem === void 0 ? void 0 : listItem.visibleInPanel) &&
|
|
165
|
-
!(listItem === null || listItem === void 0 ? void 0 : listItem.hide) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3 text-gray-600 text-base", draggable: true, onDragStart: handleDragStart(idx), onDrop: handleDrop(idx), onDragOver: handleDragOver }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-3 align-items-center", style: { minWidth: 0 } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: drag_and_drop_icon_png_1.default, alt: "Drag and drop", className: "cursor-move flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "white-space-nowrap overflow-hidden text-overflow-ellipsis", style: { maxWidth:
|
|
175
|
+
!(listItem === null || listItem === void 0 ? void 0 : listItem.hide) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3 text-gray-600 text-base", draggable: true, onDragStart: handleDragStart(idx), onDrop: handleDrop(idx), onDragOver: handleDragOver }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-3 align-items-center", style: { minWidth: 0 } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: drag_and_drop_icon_png_1.default, alt: "Drag and drop", className: "cursor-move flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "white-space-nowrap overflow-hidden text-overflow-ellipsis", style: { maxWidth: "200px" }, title: listItem.headerName }, { children: listItem.headerName }))] })), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: !(listItem === null || listItem === void 0 ? void 0 : listItem.hide), onChange: (e) => handleSwitchChange(listItem, e.value) })] }), idx)))) : ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column -mx-3" }, { children: (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "mt-0 mb-2 flex align-items-center justify-content-center py-8 bg-gray-50 p-8 border-round-md mt-2 text-gray-900 font-normal" }, { children: "No results found on the search criteria" })) })) })) })) })), (0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: " mb-0 mt-0 py-2 border-bottom-1 border-gray-200 bg-white z-5", style: {
|
|
166
176
|
position: "sticky",
|
|
167
177
|
top: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) && "35px",
|
|
168
178
|
} }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.unselected_attributes) || "Unselected Attributes", (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-gray-500 text-lg font-normal ml-2" }, { children: [`(`, visibleColumnsInSideBar === null || visibleColumnsInSideBar === void 0 ? void 0 : visibleColumnsInSideBar.filter((node) => node.hide).length, "/", visibleColumnsInSideBar === null || visibleColumnsInSideBar === void 0 ? void 0 : visibleColumnsInSideBar.length, `)`] }))] })), (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 ? ((0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 mt-2 ml-3" }, { children: visibleColumnsInSideBar === null || visibleColumnsInSideBar === void 0 ? void 0 : visibleColumnsInSideBar.map((listItem) => (listItem === null || listItem === void 0 ? void 0 : listItem.visibleInPanel) &&
|
|
169
|
-
(listItem === null || listItem === void 0 ? void 0 : listItem.hide) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3 text-gray-600 text-base" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "white-space-nowrap overflow-hidden text-overflow-ellipsis", style: { maxWidth:
|
|
179
|
+
(listItem === null || listItem === void 0 ? void 0 : listItem.hide) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3 text-gray-600 text-base" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "white-space-nowrap overflow-hidden text-overflow-ellipsis", style: { maxWidth: "200px" }, title: listItem.headerName }, { children: listItem.headerName })), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: !listItem.hide, onChange: (e) => handleSwitchChange(listItem, e.value) })] }), listItem.id))) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "mt-0 mb-2 flex align-items-center justify-content-center py-8 bg-gray-50 p-8 border-round-md mt-4 text-gray-900 text-lg" }, { children: "No results found on the search criteria" })))] }))] }))] }));
|
|
170
180
|
}
|
|
171
181
|
exports.default = HideColumn;
|
|
@@ -225,7 +225,7 @@ const TableFilter = () => {
|
|
|
225
225
|
/**
|
|
226
226
|
* Apply filter conditions to the grid
|
|
227
227
|
*/
|
|
228
|
-
const applyAdvancedFilter = (array
|
|
228
|
+
const applyAdvancedFilter = (array) => {
|
|
229
229
|
const allQueries = array.map((query) => {
|
|
230
230
|
const column = { code: query.columnName };
|
|
231
231
|
const operation = query.condition;
|
|
@@ -240,7 +240,7 @@ const TableFilter = () => {
|
|
|
240
240
|
const currentFeature = Object.assign({}, featureDetails);
|
|
241
241
|
currentFeature.filterQueries = allQueries;
|
|
242
242
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
|
|
243
|
-
|
|
243
|
+
callGrid(currentFeature);
|
|
244
244
|
return [];
|
|
245
245
|
};
|
|
246
246
|
/**
|
|
@@ -304,8 +304,8 @@ const TableFilter = () => {
|
|
|
304
304
|
/**
|
|
305
305
|
* Reset all filters to default state
|
|
306
306
|
*/
|
|
307
|
-
const onResetFilter = (formSetter
|
|
308
|
-
applyAdvancedFilter([]
|
|
307
|
+
const onResetFilter = (formSetter) => {
|
|
308
|
+
applyAdvancedFilter([]);
|
|
309
309
|
const newDefault = Object.assign(Object.assign({}, defaultCondition), { id: Math.random().toString() });
|
|
310
310
|
setConditionsArray([newDefault]);
|
|
311
311
|
setViewName("");
|
|
@@ -401,13 +401,14 @@ const TableFilter = () => {
|
|
|
401
401
|
// Count of active filters for display
|
|
402
402
|
const activeFilterCount = (globalFilters === null || globalFilters === void 0 ? void 0 : globalFilters.filter((each) => each.isActive).length) || 0;
|
|
403
403
|
const hasActiveFilters = activeFilterCount >= 1;
|
|
404
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({
|
|
404
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `cursor-pointer filter-btn-grid font-semibold hover:bg-primary-25 sc_icon_hover flex align-items-center gap-2 border-round-6 ${isDisabled && "disabled"} ${isVisible || hasActiveFilters ? "bg-primary-50" : "bg-white"}`, title: "Apply Filters" }, { children: [(0, jsx_runtime_1.jsx)("div", { id: "advancedFilterParent", className: "hidden" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ onClick: (e) => !isDisabled && onClickFilter(e), className: "flex zoom_animate", id: "advance-filter-id" }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines", size: 18, color: isVisible || hasActiveFilters ? "#243DC6" : "#667085" }), hasActiveFilters && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ id: "selected-filters", className: "flex gap-2 align-items-center text-primary-400 pl-2 white-space-nowrap" }, { children: [`${activeFilterCount} ${(filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.onSelectedFilter)
|
|
405
405
|
? filterModelText.onSelectedFilter
|
|
406
406
|
: "Selected"}`, (0, jsx_runtime_1.jsx)("span", Object.assign({ onClick: (e) => {
|
|
407
407
|
e.preventDefault();
|
|
408
408
|
e.stopPropagation();
|
|
409
|
-
onResetFilter(
|
|
409
|
+
onResetFilter();
|
|
410
410
|
} }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 18, color: "#243DC6" }) }))] })))] }))] })), (0, jsx_runtime_1.jsx)(form_1.default, Object.assign({ values: formInitialValues, enableReinitialize: true, formRef: formRef, validateOnChange: true, validateOnBlur: false, validateOnMount: true, validations: validationSchema, className: "h-full", onSubmit: () => onApplyFilter() }, { children: ({ handleSubmit, setFieldValue, isValid, values, errors, touched, }) => {
|
|
411
|
+
var _a;
|
|
411
412
|
const conditionsToRender = (values === null || values === void 0 ? void 0 : values.conditions) && values.conditions.length > 0
|
|
412
413
|
? values.conditions
|
|
413
414
|
: conditionsArray;
|
|
@@ -417,9 +418,10 @@ const TableFilter = () => {
|
|
|
417
418
|
: "Streamline Your Search With Filters" }))] })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "w-full p-0 m-0" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-2" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "max-h-14rem overflow-y-auto overflow-x-hidden flex flex-column gap-1" }, { children: conditionsToRender.map((eachCondition, index) => {
|
|
418
419
|
var _a, _b;
|
|
419
420
|
return ((0, jsx_runtime_1.jsx)("div", { children: renderCondition(eachCondition, index, setFieldValue, (_a = errors === null || errors === void 0 ? void 0 : errors.conditions) === null || _a === void 0 ? void 0 : _a[index], (_b = touched === null || touched === void 0 ? void 0 : touched.conditions) === null || _b === void 0 ? void 0 : _b[index]) }, eachCondition.id || index));
|
|
420
|
-
}) })) })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "w-full p-0 m-0" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4 flex justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(button_1.Button, { outlined: true,
|
|
421
|
+
}) })) })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "w-full p-0 m-0" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4 flex justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(button_1.Button, { outlined: true, disabled: (conditionsToRender === null || conditionsToRender === void 0 ? void 0 : conditionsToRender.length) === 1 &&
|
|
422
|
+
typeof ((_a = conditionsToRender === null || conditionsToRender === void 0 ? void 0 : conditionsToRender[0]) === null || _a === void 0 ? void 0 : _a.columnName) === "string", className: "focus:shadow-none font-semibold border-none hover:bg-primary-25 text-primary-400", label: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.resetFilterAction)
|
|
421
423
|
? filterModelText.resetFilterAction
|
|
422
|
-
: "Reset Filter", onClick: () => onResetFilter(setFieldValue
|
|
424
|
+
: "Reset Filter", onClick: () => onResetFilter(setFieldValue) }) }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [!displayInput && enableViewCreate && ((0, jsx_runtime_1.jsx)(button_1.Button, { className: "text-base px-2 font-semibold text-primary-400 flex gap-2 p-1 px-4 flex justify-content-center focus:shadow-none mr-3", label: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.createViewAction)
|
|
423
425
|
? filterModelText.createViewAction
|
|
424
426
|
: "Create view", onClick: () => setDisplayInput(true), disabled: !isFormReady, text: true, iconPos: "left", icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus", color: "text-primary-400 mr-2" }) })), displayInput && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-suffix" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: createViewFromFilters, disabled: !viewName.length, className: "p-0 h-auto mr-2", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "check", color: "text-gray-500" }) }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => {
|
|
425
427
|
setViewName("");
|
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
3
5
|
const overlaypanel_1 = require("primereact/overlaypanel");
|
|
4
|
-
|
|
6
|
+
const OverlayPanel = (0, react_1.forwardRef)((props, ref) => {
|
|
7
|
+
const overlayRef = (0, react_1.useRef)(null);
|
|
8
|
+
(0, react_1.useImperativeHandle)(ref, () => overlayRef.current);
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
const handleScroll = (event) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const target = event.target;
|
|
13
|
+
// Check if target is an HTMLElement
|
|
14
|
+
if (!(target instanceof HTMLElement)) {
|
|
15
|
+
(_a = overlayRef.current) === null || _a === void 0 ? void 0 : _a.hide();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// Hide only when scrolling outside overlay
|
|
19
|
+
if (!target.closest(".p-overlaypanel")) {
|
|
20
|
+
(_b = overlayRef.current) === null || _b === void 0 ? void 0 : _b.hide();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
24
|
+
return () => {
|
|
25
|
+
window.removeEventListener("scroll", handleScroll, true);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
return (0, jsx_runtime_1.jsx)(overlaypanel_1.OverlayPanel, Object.assign({ ref: overlayRef }, props));
|
|
29
|
+
});
|
|
30
|
+
OverlayPanel.displayName = "OverlayPanel";
|
|
31
|
+
exports.default = OverlayPanel;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { OverlayPanel } from
|
|
1
|
+
import { OverlayPanel as PrimeOverlayPanel, OverlayPanelProps } from "primereact/overlaypanel";
|
|
2
|
+
declare const OverlayPanel: import("react").ForwardRefExoticComponent<OverlayPanelProps & import("react").RefAttributes<PrimeOverlayPanel>>;
|
|
2
3
|
export default OverlayPanel;
|