sccoreui 6.5.31 → 6.5.32
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/App.js +1 -1
- package/dist/components/ag-grid/advancedFeature/column-group.js +8 -4
- package/dist/components/ag-grid/advancedFeature/custom-sort.js +2 -1
- package/dist/components/ag-grid/advancedFeature/global-search.js +3 -3
- package/dist/components/ag-grid/advancedFeature/new-filter/conditions/constants.js +2 -2
- package/dist/components/form/form-fields/FieldLabel.js +1 -1
- package/dist/components/form/form-fields/form-fields.js +8 -8
- package/dist/components/formula-template/FormulaComponent.js +2 -2
- package/dist/components/list-box-dropdown/list-box-dropdown.js +2 -2
- package/dist/components/menu/menu.js +46 -1
- package/dist/components/overlays/overlay-panel.js +3 -3
- package/dist/types/components/form/form-fields/FieldLabel.d.ts +1 -0
- package/dist/types/components/menu/menu.d.ts +2 -1
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -4,6 +4,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
require("./App.scss");
|
|
5
5
|
// import Home from "./pages/home";
|
|
6
6
|
const App = () => {
|
|
7
|
-
return (
|
|
7
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "m-6" });
|
|
8
8
|
};
|
|
9
9
|
exports.default = App;
|
|
@@ -202,9 +202,13 @@ const ColumnGroup = (props) => {
|
|
|
202
202
|
// disabled={isDisabled}
|
|
203
203
|
color: (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0
|
|
204
204
|
? "text-primary-400"
|
|
205
|
-
: "text-gray-500" }), !isDisabled && (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-center" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-primary-400 font-semibold ml-1" }, { children: columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 text-primary-400 font-semibold" }, { children: [(0, jsx_runtime_1.jsx)("p", Object.assign({ className: "ml-2 text-primary-400" }, { children: "Selected" })), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: (e) => clearListItems(e), className: "h-auto p-0 pad_0 sc_icon_hover", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", color: "text-primary-400", size: 18 }) })] }))] })))] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: columnGroupRef, className: "column-group p-1", onHide: handleHide }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-header" }, { children: [(0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "my-0" }, { children: "Grouping" })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 mb-4" }, { children: "Select one or two columns for sorting" }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-body" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-right w-full p-2 bg-gray-50" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix top-0", style: { right: "20px" } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { onChange: (e) => setSearchedText(e.target.value), value: searchText, disabled: false, placeholder: "Enter any column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column gap-1 m-1 max-h-15rem max-w-30rem overflow-y-auto" }, { children: renderColumns.length > 0 ? (renderColumns === null || renderColumns === void 0 ? void 0 : renderColumns.map((column, index) =>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
: "text-gray-500" }), !isDisabled && (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-center" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-primary-400 font-semibold ml-1" }, { children: columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 text-primary-400 font-semibold" }, { children: [(0, jsx_runtime_1.jsx)("p", Object.assign({ className: "ml-2 text-primary-400" }, { children: "Selected" })), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: (e) => clearListItems(e), className: "h-auto p-0 pad_0 sc_icon_hover", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", color: "text-primary-400", size: 18 }) })] }))] })))] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: columnGroupRef, className: "column-group p-1", onHide: handleHide }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-header" }, { children: [(0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "my-0" }, { children: "Grouping" })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 mb-4" }, { children: "Select one or two columns for sorting" }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-body" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-right w-full p-2 bg-gray-50" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix top-0", style: { right: "20px" } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { onChange: (e) => setSearchedText(e.target.value), value: searchText, disabled: false, placeholder: "Enter any column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column gap-1 m-1 max-h-15rem max-w-30rem overflow-y-auto" }, { children: renderColumns.length > 0 ? (renderColumns === null || renderColumns === void 0 ? void 0 : renderColumns.map((column, index) => {
|
|
206
|
+
var _a;
|
|
207
|
+
const checkboxId = `column-group-${(_a = column === null || column === void 0 ? void 0 : column.id) !== null && _a !== void 0 ? _a : index}`;
|
|
208
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center pl-2" }, { children: [checkedColumns.has(column === null || column === void 0 ? void 0 : column.id) && ((0, jsx_runtime_1.jsx)("img", { onDragStart: (e) => onDragStart(e, index), onDragOver: onDragOver, onDrop: (e) => onDrop(e, index), src: drag_and_drop_icon_png_1.default, width: 20, height: 20, className: checkedColumns.has(column === null || column === void 0 ? void 0 : column.id)
|
|
209
|
+
? "col-gr-icon-active mr-2"
|
|
210
|
+
: "col-gr-icon" })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex gap-2 ${checkedColumns.has(column === null || column === void 0 ? void 0 : column.id) && "bg-primary-25"} hover:bg-primary-25 border-round-sm p-3 w-full` }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { inputId: checkboxId, checked: checkedColumns.has(column === null || column === void 0 ? void 0 : column.id), onChange: (e) => onSelectedCheckbox(column, e), disabled: checkedColumns.size === 2 &&
|
|
211
|
+
!checkedColumns.has(column === null || column === void 0 ? void 0 : column.id) }), (0, jsx_runtime_1.jsx)("label", Object.assign({ htmlFor: checkboxId, className: "max-w-18rem line-clamp line-clamp-1 inline-block text-truncate", title: column.headerName }, { children: column.headerName }))] }))] }), column === null || column === void 0 ? void 0 : column.id));
|
|
212
|
+
})) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "max-w-20rem p-6 text-center" }, { children: "No results found on the search criteria" }))) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-footer gap-2 border-top-1 border-gray-200 flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: "btn-text", label: "Remove Grouping", onClick: (e) => clearListItems(e) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", label: "Save Grouping", onClick: (e) => clearSearchAndSaveGrouping(e), disabled: (checkedColumns === null || checkedColumns === void 0 ? void 0 : checkedColumns.size) === 0 })] }))] }))] }));
|
|
209
213
|
};
|
|
210
214
|
exports.default = ColumnGroup;
|
|
@@ -120,7 +120,8 @@ function Sort() {
|
|
|
120
120
|
: "text-gray-500" }) })) })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: showShort, onShow: () => setIsOverlayOpened(true), onHide: () => setIsOverlayOpened(false), className: "w-18rem mt-2 overlay_list_options overflow-hidden", id: "sorting_columns" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-4 text-lg font-semibold line-height-3 text-gray-900 border-bottom-1 border-gray-200" }, { children: (sortModelText === null || sortModelText === void 0 ? void 0 : sortModelText.header) ? sortModelText.header : "Column Sorting" })), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "pl-0 m-1 max-h-10rem overflow-auto" }, { children: columnData === null || columnData === void 0 ? void 0 : columnData.map((eachColumn, index) => {
|
|
121
121
|
if (eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.isSortable) {
|
|
122
122
|
const isSelected = eachColumn.field === (sortValue === null || sortValue === void 0 ? void 0 : sortValue.field);
|
|
123
|
-
|
|
123
|
+
const sortInputId = `tableSort-${index}`;
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)("li", Object.assign({ title: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.headerName, className: `${isSelected && "bg-primary-25"} cursor-pointer br-6 flex align-items-center gap-2 px-3 py-2 text-base line-height-2 text-gray-700 hover:bg-primary-25 mb-1`, style: { listStyleType: "none" }, onClick: () => onSelectSortValue(eachColumn) }, { children: [(0, jsx_runtime_1.jsx)(radiobutton_1.RadioButton, { inputId: sortInputId, checked: isSelected, type: "circle", value: sortValue }), (0, jsx_runtime_1.jsx)("label", Object.assign({ htmlFor: sortInputId, className: `cursor-pointer line-clamp line-clamp-1 block w-15rem ${isSelected && "text-primary-400 font-semibold"}` }, { children: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.headerName }))] }), index));
|
|
124
125
|
}
|
|
125
126
|
else {
|
|
126
127
|
return null;
|
|
@@ -35,10 +35,10 @@ function Search({ searchPlaceHolder }) {
|
|
|
35
35
|
}
|
|
36
36
|
}, [deboucedValue]);
|
|
37
37
|
return (0, utilComponents_1.skeletonLoding)() ? ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px", width: "336px" })) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `p-input-icon-left ${inputValue.length > 0 ? "p-input-icon-right" : ""}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix zoom_animate" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { color: "#667085", icon: "search-lg", size: 18, disabled: isDisabled }) })), inputValue.length > 0 && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer zoom_animate", onClick: () => {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
(_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
(_b = (_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.hideOverlay();
|
|
40
40
|
if (rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE && quickSearch) {
|
|
41
|
-
(
|
|
41
|
+
(_c = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current.api) === null || _c === void 0 ? void 0 : _c.setGridOption("quickFilterText", "");
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
44
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: "" }));
|
|
@@ -229,7 +229,7 @@ const conditionsList = [
|
|
|
229
229
|
fieldOperators: [
|
|
230
230
|
Types_1.FilterDataType.STRING,
|
|
231
231
|
Types_1.FilterDataType.SELECT,
|
|
232
|
-
|
|
232
|
+
// FilterDataType.BOOLEAN,
|
|
233
233
|
Types_1.FilterDataType.INTEGER,
|
|
234
234
|
Types_1.FilterDataType.DECIMAL,
|
|
235
235
|
Types_1.FilterDataType.CURRENCY,
|
|
@@ -247,7 +247,7 @@ const conditionsList = [
|
|
|
247
247
|
fieldOperators: [
|
|
248
248
|
Types_1.FilterDataType.STRING,
|
|
249
249
|
Types_1.FilterDataType.SELECT,
|
|
250
|
-
|
|
250
|
+
// FilterDataType.BOOLEAN,
|
|
251
251
|
Types_1.FilterDataType.INTEGER,
|
|
252
252
|
Types_1.FilterDataType.DECIMAL,
|
|
253
253
|
Types_1.FilterDataType.CURRENCY,
|
|
@@ -4,6 +4,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const svg_1 = require("../../../assets/svg/svg");
|
|
5
5
|
const FieldLabel = (props) => {
|
|
6
6
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center", style: { gap: "2px" } }, { children: [(props === null || props === void 0 ? void 0 : props.isRequired) && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (!(props === null || props === void 0 ? void 0 : props.error) && (props === null || props === void 0 ? void 0 : props.touched)) ||
|
|
7
|
-
((props === null || props === void 0 ? void 0 : props.value) && !(props === null || props === void 0 ? void 0 : props.touched)) ? ((0, jsx_runtime_1.jsx)(svg_1.LightningGreen, {})) : (props === null || props === void 0 ? void 0 : props.error) && (props === null || props === void 0 ? void 0 : props.touched) ? ((0, jsx_runtime_1.jsx)(svg_1.LightningRed, {})) : ((0, jsx_runtime_1.jsx)(svg_1.Lightning, {})) })), (0, jsx_runtime_1.jsx)("label", Object.assign({ htmlFor: props === null || props === void 0 ? void 0 : props.
|
|
7
|
+
((props === null || props === void 0 ? void 0 : props.value) && !(props === null || props === void 0 ? void 0 : props.touched)) ? ((0, jsx_runtime_1.jsx)(svg_1.LightningGreen, {})) : (props === null || props === void 0 ? void 0 : props.error) && (props === null || props === void 0 ? void 0 : props.touched) ? ((0, jsx_runtime_1.jsx)(svg_1.LightningRed, {})) : ((0, jsx_runtime_1.jsx)(svg_1.Lightning, {})) })), (0, jsx_runtime_1.jsx)("label", Object.assign({ htmlFor: props === null || props === void 0 ? void 0 : props.htmlFor, className: "mb-1 text_ellipsis" }, { children: props === null || props === void 0 ? void 0 : props.label }))] })) }));
|
|
8
8
|
};
|
|
9
9
|
exports.default = FieldLabel;
|
|
@@ -19,7 +19,7 @@ const InputTextField = (props) => {
|
|
|
19
19
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
20
20
|
// {label}
|
|
21
21
|
// </label>
|
|
22
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, Object.assign({ maxLength: maxLength, autoComplete: "off", disabled: disabled, placeholder: placeholder }, field, { className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }))) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) }))] })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })));
|
|
22
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, Object.assign({ maxLength: maxLength, autoComplete: "off", disabled: disabled, placeholder: placeholder }, field, { className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }))) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) }))] })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })));
|
|
23
23
|
};
|
|
24
24
|
const InputNumberField = (props) => {
|
|
25
25
|
const { errors, touched, name, length, label, placeholder, useGrouping = false, optional, setFieldValue, min, max, maxLength, className, validate, disabled, isLoading, inputClassName, icon, iconPos, maxFractionDigits, minFractionDigits, inputNumberProps = {}, isRequired = false, value, } = props;
|
|
@@ -27,7 +27,7 @@ const InputNumberField = (props) => {
|
|
|
27
27
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
28
28
|
// {label}
|
|
29
29
|
// </label>
|
|
30
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, errors: errors, touched: touched, validate: validate }, { children: ({ field }) => {
|
|
30
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, errors: errors, touched: touched, validate: validate }, { children: ({ field }) => {
|
|
31
31
|
const { value, name } = field;
|
|
32
32
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: icon ? ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: `p-input-icon-${iconPos}` }, { children: [(0, jsx_runtime_1.jsx)("i", { className: `pi pi-${icon} text-base` }), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ value: value, name: name, useGrouping: useGrouping, maxFractionDigits: maxFractionDigits ? maxFractionDigits : null, minFractionDigits: minFractionDigits ? minFractionDigits : null, inputClassName: inputClassName ? inputClassName : "", min: min, max: max, disabled: disabled, maxLength: maxLength, placeholder: placeholder, onValueChange: (e) => setFieldValue(name, e.value !== null ? e.value : min), className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }, inputNumberProps))] }))) : ((0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ value: value, name: name, useGrouping: useGrouping, maxFractionDigits: maxFractionDigits ? maxFractionDigits : 0, minFractionDigits: minFractionDigits ? minFractionDigits : 0, inputClassName: inputClassName ? inputClassName : "", min: min, max: max, disabled: disabled, maxLength: maxLength, placeholder: placeholder, onValueChange: (e) => setFieldValue(name, e.value !== null ? e.value : min), className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }, inputNumberProps))) }));
|
|
33
33
|
} })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })) })));
|
|
@@ -40,7 +40,7 @@ const InputCurrencyField = (props) => {
|
|
|
40
40
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
41
41
|
// {label}
|
|
42
42
|
// </label>
|
|
43
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errorData, touched: touchedData, isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, errors: errors, touched: touched, validate: validate }, { children: ({ field }) => {
|
|
43
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errorData, touched: touchedData, isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, errors: errors, touched: touched, validate: validate }, { children: ({ field }) => {
|
|
44
44
|
const { value, name } = field;
|
|
45
45
|
return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: `${spanClassName} currency_with_input` }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 w-full" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-lg text-gray-600 font-normal px-2" }, { children: currenyIcon ? currenyIcon : "$" })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ name: name, value: value, "aria-autocomplete": "none", minFractionDigits: 2, disabled: disabled, min: min, max: max, maxLength: maxLength, onValueChange: (e) => setFieldValue(name, e.value !== null ? e.value : min), maxFractionDigits: 2, placeholder: placeholder, className: ` customNumberField ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "" : ""} ${className}`, id: name, useGrouping: useGrouping }, inputNumberProps))] })), Boolean(value) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center px-2", onClick: () => setFieldValue(name, null) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 15, color: "text-gray-600" }) })))] })));
|
|
46
46
|
} })), errorData && touchedData ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errorData }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })) })));
|
|
@@ -56,7 +56,7 @@ const InputTextAreaField = (props) => {
|
|
|
56
56
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
57
57
|
// {label}
|
|
58
58
|
// </label>
|
|
59
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, type: "textarea", validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(inputtextarea_1.InputTextarea, Object.assign({ autoComplete: "off", placeholder: placeholder, style: {
|
|
59
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, type: "textarea", validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(inputtextarea_1.InputTextarea, Object.assign({ autoComplete: "off", placeholder: placeholder, style: {
|
|
60
60
|
height: "154px",
|
|
61
61
|
resize: "none",
|
|
62
62
|
overflowY: "scroll",
|
|
@@ -65,14 +65,14 @@ const InputTextAreaField = (props) => {
|
|
|
65
65
|
const DropDownField = (props) => {
|
|
66
66
|
const { errors, touched, name, length, label, onFocus,
|
|
67
67
|
// onChange,
|
|
68
|
-
placeholder, panelClassName, showClear, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, filter, panelStyle, isLoading, isRequired = false, value, filterPlaceholder, emptyMessage, emptyFilterMessage, unselect = false } = props;
|
|
68
|
+
placeholder, panelClassName, showClear, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, filter, panelStyle, isLoading, isRequired = false, value, filterPlaceholder, emptyMessage, emptyFilterMessage, unselect = false, } = props;
|
|
69
69
|
const errorData = (0, formik_1.getIn)(errors, name);
|
|
70
70
|
const touchedData = (0, formik_1.getIn)(touched, name);
|
|
71
71
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column" }, { children: !isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optional && ((0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between text_ellipsis", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] }))), !optional && (
|
|
72
72
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
73
73
|
// {label}
|
|
74
74
|
// </label>
|
|
75
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errorData, touched: touchedData, isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ onFocus: () => {
|
|
75
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errorData, touched: touchedData, isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ onFocus: () => {
|
|
76
76
|
onFocus && onFocus();
|
|
77
77
|
}, panelClassName: panelClassName, showClear: showClear, panelStyle: panelStyle || "", filter: filter || false, disabled: disabled, placeholder: placeholder }, field, { onChange: (e) => {
|
|
78
78
|
!unselect && field.onChange(e);
|
|
@@ -86,7 +86,7 @@ const MultiSelectField = (props) => {
|
|
|
86
86
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
87
87
|
// {label}
|
|
88
88
|
// </label>
|
|
89
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ filter: filter ? filter : false, disabled: disabled, placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }))) })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) }))] })) })));
|
|
89
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ filter: filter ? filter : false, disabled: disabled, placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }))) })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) }))] })) })));
|
|
90
90
|
};
|
|
91
91
|
const PhoneNumberField = (props) => {
|
|
92
92
|
const { errors, touched, name, length, values, label, placeholder, optional, position, setFieldValue, isLoading, isRequired = false, value, } = props;
|
|
@@ -109,7 +109,7 @@ const PhoneNumberField = (props) => {
|
|
|
109
109
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
110
110
|
// {label}
|
|
111
111
|
// </label>
|
|
112
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(max_1.default, Object.assign({ international: true, countryCallingCodeEditable: false, withCountryCallingCode: false, countrySelectComponent: customCountry, usenationalformatfordefaultcountryvalue: "true", defaultCountry: values[name], limitMaxLength: true, className: ` flex align-items-center ${errors[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"}` }, field, { onChange: (e) => setFieldValue(name, e) }))) })), errors[name] && touched[name] ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px", className: `full_form_field` })] })) })));
|
|
112
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(max_1.default, Object.assign({ international: true, countryCallingCodeEditable: false, withCountryCallingCode: false, countrySelectComponent: customCountry, usenationalformatfordefaultcountryvalue: "true", defaultCountry: values[name], limitMaxLength: true, className: ` flex align-items-center ${errors[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"}` }, field, { onChange: (e) => setFieldValue(name, e) }))) })), errors[name] && touched[name] ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px", className: `full_form_field` })] })) })));
|
|
113
113
|
};
|
|
114
114
|
// const InputGroupField = (props: any) => {
|
|
115
115
|
// value const { errors, touched, name, length, label, placeholder, optional, position, setFieldValue, validate
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const dropdown_1 = require("primereact/dropdown");
|
|
7
7
|
const inputnumber_1 = require("primereact/inputnumber");
|
|
8
8
|
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
9
|
-
const menu_1 = require("
|
|
9
|
+
const menu_1 = tslib_1.__importDefault(require("../menu/menu"));
|
|
10
10
|
// import { InputText } from "primereact/inputtext";
|
|
11
11
|
const Tagify_1 = tslib_1.__importDefault(require("./Tagify"));
|
|
12
12
|
const ExpressionRender_1 = tslib_1.__importDefault(require("./ExpressionRender"));
|
|
@@ -81,6 +81,6 @@ const FormulaComponent = (props) => {
|
|
|
81
81
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
})() }), (0, jsx_runtime_1.jsx)(menu_1.
|
|
84
|
+
})() }), (0, jsx_runtime_1.jsx)(menu_1.default, { onShow: () => setIsMenuVisible(true), onHide: () => setIsMenuVisible(false), popup: true, popupAlignment: "left", className: `w-28rem p-0 ${props === null || props === void 0 ? void 0 : props.menuClassName}`, model: menuContent, ref: priceConditioRef, id: "condition_menu_popup" })] }), "asadssadsasdsdadasd"));
|
|
85
85
|
};
|
|
86
86
|
exports.default = FormulaComponent;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const listbox_1 = require("primereact/listbox");
|
|
6
|
-
const menu_1 = require("primereact/menu");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const button_1 = require("primereact/button");
|
|
9
8
|
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
10
9
|
const virtualization_component_1 = tslib_1.__importDefault(require("./virtualization-component"));
|
|
10
|
+
const menu_1 = tslib_1.__importDefault(require("../menu/menu"));
|
|
11
11
|
// import { InputText } from "primereact/inputtext";
|
|
12
12
|
// import { Checkbox } from "primereact/checkbox";
|
|
13
13
|
const ListBoxDropdown = (props) => {
|
|
@@ -119,7 +119,7 @@ const ListBoxDropdown = (props) => {
|
|
|
119
119
|
window.removeEventListener("scroll", handleScroll);
|
|
120
120
|
};
|
|
121
121
|
}, [buttonPosition]);
|
|
122
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${className}` }, { children: [(0, jsx_runtime_1.jsx)(menu_1.
|
|
122
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${className}` }, { children: [(0, jsx_runtime_1.jsx)(menu_1.default, { onShow: (e) => onShow && onShow(e), onHide: (e) => onHide && onHide(e), onFocus: (e) => onFocus && onFocus(e), popup: true, ref: optionsMenuRef,
|
|
123
123
|
// onMouseLeave={onMouseLeaveMenu}
|
|
124
124
|
id: "popup_menu_bottom", className: menuClassName ? menuClassName : "", model: [
|
|
125
125
|
{
|
|
@@ -1,4 +1,49 @@
|
|
|
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 menu_1 = require("primereact/menu");
|
|
4
|
-
|
|
6
|
+
const Menu = (0, react_1.forwardRef)((props, ref) => {
|
|
7
|
+
const menuRef = (0, react_1.useRef)(null);
|
|
8
|
+
const visibleRef = (0, react_1.useRef)(false);
|
|
9
|
+
(0, react_1.useImperativeHandle)(ref, () => menuRef === null || menuRef === void 0 ? void 0 : menuRef.current);
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
if (!props.popup)
|
|
12
|
+
return undefined;
|
|
13
|
+
const hideMenu = (event) => {
|
|
14
|
+
var _a;
|
|
15
|
+
if (!(visibleRef === null || visibleRef === void 0 ? void 0 : visibleRef.current))
|
|
16
|
+
return;
|
|
17
|
+
(_a = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a === void 0 ? void 0 : _a.hide(event);
|
|
18
|
+
};
|
|
19
|
+
const handleScroll = (event) => {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const target = event.target;
|
|
22
|
+
if (!(target instanceof HTMLElement)) {
|
|
23
|
+
hideMenu(event);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const menuElement = (_b = (_a = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a === void 0 ? void 0 : _a.getElement) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
27
|
+
if (!(menuElement === null || menuElement === void 0 ? void 0 : menuElement.contains(target))) {
|
|
28
|
+
hideMenu(event);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener("scroll", handleScroll, true);
|
|
34
|
+
};
|
|
35
|
+
}, [props.popup]);
|
|
36
|
+
const handleShow = (event) => {
|
|
37
|
+
var _a;
|
|
38
|
+
visibleRef.current = true;
|
|
39
|
+
(_a = props.onShow) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
40
|
+
};
|
|
41
|
+
const handleHide = (event) => {
|
|
42
|
+
var _a;
|
|
43
|
+
visibleRef.current = false;
|
|
44
|
+
(_a = props.onHide) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
45
|
+
};
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(menu_1.Menu, Object.assign({ ref: menuRef }, props, { onShow: handleShow, onHide: handleHide })));
|
|
47
|
+
});
|
|
48
|
+
Menu.displayName = "Menu";
|
|
49
|
+
exports.default = Menu;
|
|
@@ -5,19 +5,19 @@ const react_1 = require("react");
|
|
|
5
5
|
const overlaypanel_1 = require("primereact/overlaypanel");
|
|
6
6
|
const OverlayPanel = (0, react_1.forwardRef)((props, ref) => {
|
|
7
7
|
const overlayRef = (0, react_1.useRef)(null);
|
|
8
|
-
(0, react_1.useImperativeHandle)(ref, () => overlayRef.current);
|
|
8
|
+
(0, react_1.useImperativeHandle)(ref, () => overlayRef === null || overlayRef === void 0 ? void 0 : overlayRef.current);
|
|
9
9
|
(0, react_1.useEffect)(() => {
|
|
10
10
|
const handleScroll = (event) => {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
const target = event.target;
|
|
13
13
|
// Check if target is an HTMLElement
|
|
14
14
|
if (!(target instanceof HTMLElement)) {
|
|
15
|
-
(_a = overlayRef.current) === null || _a === void 0 ? void 0 : _a.hide();
|
|
15
|
+
(_a = overlayRef === null || overlayRef === void 0 ? void 0 : overlayRef.current) === null || _a === void 0 ? void 0 : _a.hide();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
// Hide only when scrolling outside overlay
|
|
19
19
|
if (!target.closest(".p-overlaypanel")) {
|
|
20
|
-
(_b = overlayRef.current) === null || _b === void 0 ? void 0 : _b.hide();
|
|
20
|
+
(_b = overlayRef === null || overlayRef === void 0 ? void 0 : overlayRef.current) === null || _b === void 0 ? void 0 : _b.hide();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
window.addEventListener("scroll", handleScroll, true);
|