pam-grid 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +5713 -5689
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +1161 -908
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1157 -904
- package/dist/index.mjs.map +1 -1
- package/dist/styles/pam.core.css +5670 -5670
- package/dist/styles/pam.core.css.map +1 -1
- package/dist/styles/pam.grid.css +44 -20
- package/dist/styles/pam.grid.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46,311 +46,671 @@ module.exports = __toCommonJS(index_exports);
|
|
|
46
46
|
var import_react5 = __toESM(require("react"));
|
|
47
47
|
|
|
48
48
|
// src/components/AdvanceFilter.tsx
|
|
49
|
+
var import_react2 = require("react");
|
|
50
|
+
|
|
51
|
+
// src/components/dropdown/PamDropdown.tsx
|
|
49
52
|
var import_react = require("react");
|
|
53
|
+
var import_react_dom = require("react-dom");
|
|
50
54
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
],
|
|
61
|
-
text: [
|
|
62
|
-
{ key: "contains", label: "Contains" },
|
|
63
|
-
{ key: "starts", label: "Starts With" },
|
|
64
|
-
{ key: "ends", label: "Ends With" },
|
|
65
|
-
{ key: "eq", label: "Equals" }
|
|
66
|
-
],
|
|
67
|
-
date: [
|
|
68
|
-
{ key: "before", label: "Before" },
|
|
69
|
-
{ key: "after", label: "After" },
|
|
70
|
-
{ key: "between", label: "Between" }
|
|
71
|
-
]
|
|
72
|
-
};
|
|
73
|
-
function AdvanceFilter({
|
|
74
|
-
type = "number",
|
|
75
|
-
value,
|
|
76
|
-
onApply,
|
|
77
|
-
onClear
|
|
55
|
+
function PamDropdown({
|
|
56
|
+
trigger,
|
|
57
|
+
items,
|
|
58
|
+
title,
|
|
59
|
+
placement = "bottom-start",
|
|
60
|
+
offset = 6,
|
|
61
|
+
disabled = false,
|
|
62
|
+
closeOnItemClick = true,
|
|
63
|
+
className = ""
|
|
78
64
|
}) {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const [
|
|
82
|
-
(0, import_react.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
65
|
+
const triggerRef = (0, import_react.useRef)(null);
|
|
66
|
+
const menuRef = (0, import_react.useRef)(null);
|
|
67
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
68
|
+
const [pos, setPos] = (0, import_react.useState)({ top: 0, left: 0 });
|
|
69
|
+
const [openSubKeys, setOpenSubKeys] = (0, import_react.useState)({});
|
|
70
|
+
const portalRoot = (0, import_react.useMemo)(() => {
|
|
71
|
+
const el = document.getElementById("pam-portal-root");
|
|
72
|
+
if (el) return el;
|
|
73
|
+
const created = document.createElement("div");
|
|
74
|
+
created.id = "pam-portal-root";
|
|
75
|
+
document.body.appendChild(created);
|
|
76
|
+
return created;
|
|
77
|
+
}, []);
|
|
78
|
+
function close() {
|
|
79
|
+
setOpen(false);
|
|
80
|
+
setOpenSubKeys({});
|
|
81
|
+
}
|
|
82
|
+
function toggle() {
|
|
83
|
+
if (disabled) return;
|
|
84
|
+
setOpen((v) => {
|
|
85
|
+
const next = !v;
|
|
86
|
+
if (!next) setOpenSubKeys({});
|
|
87
|
+
return next;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function getDropdownPosition(triggerEl, menuEl) {
|
|
91
|
+
const rect = triggerEl.getBoundingClientRect();
|
|
92
|
+
const menuRect = menuEl.getBoundingClientRect();
|
|
93
|
+
let top = rect.bottom + offset + window.scrollY;
|
|
94
|
+
let left = rect.left + window.scrollX;
|
|
95
|
+
if (placement.startsWith("top")) {
|
|
96
|
+
top = rect.top - menuRect.height - offset + window.scrollY;
|
|
88
97
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
if (placement.endsWith("end")) {
|
|
99
|
+
left = rect.right - menuRect.width + window.scrollX;
|
|
100
|
+
}
|
|
101
|
+
const minLeft = 8 + window.scrollX;
|
|
102
|
+
const maxLeft = window.innerWidth - menuRect.width - 8 + window.scrollX;
|
|
103
|
+
left = Math.max(minLeft, Math.min(left, maxLeft));
|
|
104
|
+
const minTop = 8 + window.scrollY;
|
|
105
|
+
const maxTop = window.innerHeight - menuRect.height - 8 + window.scrollY;
|
|
106
|
+
top = Math.max(minTop, Math.min(top, maxTop));
|
|
107
|
+
const bottomOverflow = top + menuRect.height > window.innerHeight + window.scrollY;
|
|
108
|
+
const topOverflow = top < window.scrollY;
|
|
109
|
+
if (bottomOverflow && rect.top > menuRect.height) {
|
|
110
|
+
top = rect.top - menuRect.height - offset + window.scrollY;
|
|
111
|
+
} else if (topOverflow && window.innerHeight - rect.bottom > menuRect.height) {
|
|
112
|
+
top = rect.bottom + offset + window.scrollY;
|
|
113
|
+
}
|
|
114
|
+
return { top, left };
|
|
115
|
+
}
|
|
116
|
+
function updatePosition() {
|
|
117
|
+
const t = triggerRef.current;
|
|
118
|
+
const m = menuRef.current;
|
|
119
|
+
if (!t || !m) return;
|
|
120
|
+
setPos(getDropdownPosition(t, m));
|
|
121
|
+
}
|
|
122
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
123
|
+
if (!open) return;
|
|
124
|
+
updatePosition();
|
|
125
|
+
}, [open, placement]);
|
|
126
|
+
(0, import_react.useEffect)(() => {
|
|
127
|
+
if (!open) return;
|
|
128
|
+
const onDown = (e) => {
|
|
129
|
+
const t = triggerRef.current;
|
|
130
|
+
const m = menuRef.current;
|
|
131
|
+
if (!t || !m) return;
|
|
132
|
+
const target = e.target;
|
|
133
|
+
if (t.contains(target)) return;
|
|
134
|
+
if (m.contains(target)) return;
|
|
135
|
+
close();
|
|
136
|
+
};
|
|
137
|
+
const onKey = (e) => {
|
|
138
|
+
if (e.key === "Escape") close();
|
|
139
|
+
};
|
|
140
|
+
document.addEventListener("mousedown", onDown);
|
|
141
|
+
document.addEventListener("keydown", onKey);
|
|
142
|
+
return () => {
|
|
143
|
+
document.removeEventListener("mousedown", onDown);
|
|
144
|
+
document.removeEventListener("keydown", onKey);
|
|
145
|
+
};
|
|
146
|
+
}, [open]);
|
|
147
|
+
(0, import_react.useEffect)(() => {
|
|
148
|
+
if (!open) return;
|
|
149
|
+
const handler = () => updatePosition();
|
|
150
|
+
window.addEventListener("scroll", handler, true);
|
|
151
|
+
window.addEventListener("resize", handler);
|
|
152
|
+
return () => {
|
|
153
|
+
window.removeEventListener("scroll", handler, true);
|
|
154
|
+
window.removeEventListener("resize", handler);
|
|
155
|
+
};
|
|
156
|
+
}, [open]);
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: triggerRef, className: `pam-dropdown-trigger ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { onClick: toggle, style: { display: "inline-flex" }, children: trigger }) }),
|
|
159
|
+
open && (0, import_react_dom.createPortal)(
|
|
103
160
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
104
|
-
"
|
|
161
|
+
"div",
|
|
105
162
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
163
|
+
ref: menuRef,
|
|
164
|
+
className: "pam-dropdown-menu",
|
|
165
|
+
style: {
|
|
166
|
+
top: pos.top,
|
|
167
|
+
left: pos.left
|
|
168
|
+
},
|
|
109
169
|
children: [
|
|
110
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
111
|
-
|
|
170
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pam-dropdown-title", children: title }),
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pam-list-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
172
|
+
PamDropdownList,
|
|
173
|
+
{
|
|
174
|
+
items,
|
|
175
|
+
closeOnItemClick,
|
|
176
|
+
onClose: close,
|
|
177
|
+
openSubKeys,
|
|
178
|
+
setOpenSubKeys,
|
|
179
|
+
level: 0
|
|
180
|
+
}
|
|
181
|
+
) })
|
|
112
182
|
]
|
|
113
183
|
}
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "form-label", children: "Value" }),
|
|
118
|
-
operation !== "between" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
-
"input",
|
|
120
|
-
{
|
|
121
|
-
type,
|
|
122
|
-
className: "form-control form-control-sm",
|
|
123
|
-
value: v1,
|
|
124
|
-
onChange: (e) => setV1(e.target.value)
|
|
125
|
-
}
|
|
126
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "d-flex gap-2", children: [
|
|
127
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
-
"input",
|
|
129
|
-
{
|
|
130
|
-
type,
|
|
131
|
-
className: "form-control form-control-sm",
|
|
132
|
-
placeholder: "From",
|
|
133
|
-
value: v1,
|
|
134
|
-
onChange: (e) => setV1(e.target.value)
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
-
"input",
|
|
139
|
-
{
|
|
140
|
-
type,
|
|
141
|
-
className: "form-control form-control-sm",
|
|
142
|
-
placeholder: "To",
|
|
143
|
-
value: v2,
|
|
144
|
-
onChange: (e) => setV2(e.target.value)
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
] })
|
|
148
|
-
] }),
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "d-flex justify-content-between mt-3", children: [
|
|
150
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "btn btn-label-secondary btn-xs", onClick: onClear, children: "Clear" }),
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "btn btn-primary btn-xs", onClick: apply, children: "Apply" })
|
|
152
|
-
] })
|
|
184
|
+
),
|
|
185
|
+
portalRoot
|
|
186
|
+
)
|
|
153
187
|
] });
|
|
154
188
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
let offset = 0;
|
|
177
|
-
const leftCols = colState.filter((c) => c.visible && c.pinned === "left").sort((a, b) => a.order - b.order);
|
|
178
|
-
for (const c of leftCols) {
|
|
179
|
-
if (c.key === key) return offset;
|
|
180
|
-
offset += c.width ?? 120;
|
|
181
|
-
}
|
|
182
|
-
return offset;
|
|
183
|
-
}
|
|
184
|
-
function getRightOffset(colState, key) {
|
|
185
|
-
let offset = 0;
|
|
186
|
-
const rightCols = colState.filter((c) => c.visible && c.pinned === "right").sort((a, b) => b.order - a.order);
|
|
187
|
-
for (const c of rightCols) {
|
|
188
|
-
if (c.key === key) return offset;
|
|
189
|
-
offset += c.width ?? 120;
|
|
190
|
-
}
|
|
191
|
-
return offset;
|
|
189
|
+
function PamDropdownList({
|
|
190
|
+
items,
|
|
191
|
+
onClose,
|
|
192
|
+
closeOnItemClick,
|
|
193
|
+
openSubKeys,
|
|
194
|
+
setOpenSubKeys,
|
|
195
|
+
level
|
|
196
|
+
}) {
|
|
197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "pam-dropdown-list", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
198
|
+
PamDropdownNode,
|
|
199
|
+
{
|
|
200
|
+
item,
|
|
201
|
+
onClose,
|
|
202
|
+
closeOnItemClick,
|
|
203
|
+
openSubKeys,
|
|
204
|
+
setOpenSubKeys,
|
|
205
|
+
level,
|
|
206
|
+
index
|
|
207
|
+
},
|
|
208
|
+
item.key ?? `${level}-${index}`
|
|
209
|
+
)) });
|
|
192
210
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
211
|
+
function PamDropdownNode({
|
|
212
|
+
item,
|
|
213
|
+
onClose,
|
|
214
|
+
closeOnItemClick,
|
|
215
|
+
openSubKeys,
|
|
216
|
+
setOpenSubKeys,
|
|
217
|
+
level,
|
|
218
|
+
index
|
|
219
|
+
}) {
|
|
220
|
+
const liRef = (0, import_react.useRef)(null);
|
|
221
|
+
const submenuRef = (0, import_react.useRef)(null);
|
|
222
|
+
const hasChildren = !!item.children?.length;
|
|
223
|
+
const nodeKey = item.key ?? `${level}-${index}`;
|
|
224
|
+
const submenuOpen = !!openSubKeys[nodeKey];
|
|
225
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
226
|
+
if (!submenuOpen) return;
|
|
227
|
+
const li = liRef.current;
|
|
228
|
+
const menu = submenuRef.current;
|
|
229
|
+
if (!li || !menu) return;
|
|
230
|
+
const rect = li.getBoundingClientRect();
|
|
231
|
+
menu.style.left = "0px";
|
|
232
|
+
menu.style.top = "0px";
|
|
233
|
+
menu.style.maxHeight = "";
|
|
234
|
+
menu.style.overflowY = "";
|
|
235
|
+
const menuRect = menu.getBoundingClientRect();
|
|
236
|
+
const gap = 6;
|
|
237
|
+
const spaceRight = window.innerWidth - rect.right;
|
|
238
|
+
const spaceLeft = rect.left;
|
|
239
|
+
const spaceBottom = window.innerHeight - rect.bottom;
|
|
240
|
+
const spaceTop = rect.top;
|
|
241
|
+
let left = rect.right + gap;
|
|
242
|
+
let top = rect.top;
|
|
243
|
+
let mode = "right";
|
|
244
|
+
if (spaceRight >= menuRect.width) {
|
|
245
|
+
mode = "right";
|
|
246
|
+
left = rect.right + gap;
|
|
247
|
+
top = rect.top;
|
|
248
|
+
} else if (spaceLeft >= menuRect.width) {
|
|
249
|
+
mode = "left";
|
|
250
|
+
left = rect.left - menuRect.width - gap;
|
|
251
|
+
top = rect.top;
|
|
252
|
+
} else {
|
|
253
|
+
if (spaceBottom >= menuRect.height) {
|
|
254
|
+
mode = "bottom";
|
|
255
|
+
left = rect.left;
|
|
256
|
+
top = rect.bottom + gap;
|
|
257
|
+
} else if (spaceTop >= menuRect.height) {
|
|
258
|
+
mode = "top";
|
|
259
|
+
left = rect.left;
|
|
260
|
+
top = rect.top - menuRect.height - gap;
|
|
261
|
+
} else {
|
|
262
|
+
mode = "bottom";
|
|
263
|
+
left = rect.left;
|
|
264
|
+
top = rect.bottom + gap;
|
|
223
265
|
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
window.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
266
|
+
}
|
|
267
|
+
const minLeft = 8;
|
|
268
|
+
const maxLeft = window.innerWidth - menuRect.width - 8;
|
|
269
|
+
left = Math.max(minLeft, Math.min(left, maxLeft));
|
|
270
|
+
const minTop = 8;
|
|
271
|
+
const maxTop = window.innerHeight - menuRect.height - 8;
|
|
272
|
+
top = Math.max(minTop, Math.min(top, maxTop));
|
|
273
|
+
const maxHeight = window.innerHeight - 16;
|
|
274
|
+
menu.style.maxHeight = `${maxHeight}px`;
|
|
275
|
+
menu.style.overflowY = "auto";
|
|
276
|
+
menu.style.left = `${left}px`;
|
|
277
|
+
menu.style.top = `${top}px`;
|
|
278
|
+
menu.setAttribute("data-placement", mode);
|
|
279
|
+
}, [submenuOpen]);
|
|
280
|
+
const handleClick = (e) => {
|
|
281
|
+
e.stopPropagation();
|
|
282
|
+
if (item.disabled) return;
|
|
283
|
+
if (hasChildren) {
|
|
284
|
+
setOpenSubKeys((prev) => {
|
|
285
|
+
const next = {};
|
|
286
|
+
Object.keys(prev).forEach((k) => {
|
|
287
|
+
const lvl = Number(k.split("-")[0]);
|
|
288
|
+
if (lvl < level) next[k] = prev[k];
|
|
289
|
+
});
|
|
290
|
+
next[nodeKey] = !prev[nodeKey];
|
|
291
|
+
return next;
|
|
292
|
+
});
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
item.onClick?.();
|
|
296
|
+
if (item.keepOpenOnClick) return;
|
|
297
|
+
if (closeOnItemClick) onClose();
|
|
298
|
+
};
|
|
299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
300
|
+
"li",
|
|
301
|
+
{
|
|
302
|
+
ref: liRef,
|
|
303
|
+
className: [
|
|
304
|
+
!item.custome ? "pam-dropdown-item" : "",
|
|
305
|
+
item.danger ? "danger" : "",
|
|
306
|
+
item.disabled ? "disabled" : "",
|
|
307
|
+
hasChildren ? "has-children" : "",
|
|
308
|
+
submenuOpen ? "open" : ""
|
|
309
|
+
].join(" "),
|
|
310
|
+
onClick: handleClick,
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
className: `${item.rightSlot ? "pam-dropdown-item-inner-rightSlot" : "pam-dropdown-item-inner"} `,
|
|
316
|
+
children: [
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pam-left", children: [
|
|
318
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: `${item.icon} pam-icon` }),
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pam-label", children: item.label })
|
|
320
|
+
] }),
|
|
321
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pam-right", children: [
|
|
322
|
+
item.rightSlot && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
323
|
+
"span",
|
|
324
|
+
{
|
|
325
|
+
className: "pam-rightslot",
|
|
326
|
+
onClick: (e) => e.stopPropagation(),
|
|
327
|
+
children: item.rightSlot
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
hasChildren && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "bx bx-chevron-right pam-arrow" })
|
|
331
|
+
] })
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
hasChildren && submenuOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: submenuRef, className: "pam-submenu", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
336
|
+
PamDropdownList,
|
|
337
|
+
{
|
|
338
|
+
items: item.children,
|
|
339
|
+
onClose,
|
|
340
|
+
closeOnItemClick,
|
|
341
|
+
openSubKeys,
|
|
342
|
+
setOpenSubKeys,
|
|
343
|
+
level: level + 1
|
|
344
|
+
}
|
|
345
|
+
) })
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
);
|
|
233
349
|
}
|
|
234
|
-
var resolveValue = (value, row) => {
|
|
235
|
-
return typeof value === "function" ? value(row) : value;
|
|
236
|
-
};
|
|
237
350
|
|
|
238
|
-
// src/components/
|
|
239
|
-
var import_react3 = require("react");
|
|
351
|
+
// src/components/AdvanceFilter.tsx
|
|
240
352
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return items.filter((i) => i.name.toLowerCase().includes(q));
|
|
263
|
-
}, [items, search]);
|
|
264
|
-
if (facetLoading?.[columnKey]) {
|
|
265
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "p-3 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-secondary", children: "Loading..." }) });
|
|
266
|
-
}
|
|
267
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pam-grid-facet-filter", style: { width: 240 }, children: [
|
|
268
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
269
|
-
"input",
|
|
270
|
-
{
|
|
271
|
-
type: "search",
|
|
272
|
-
className: "form-control form-control-sm",
|
|
273
|
-
placeholder: "Search...",
|
|
274
|
-
value: search,
|
|
275
|
-
onChange: (e) => setSearch(e.target.value)
|
|
276
|
-
}
|
|
277
|
-
) }),
|
|
278
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
279
|
-
"div",
|
|
280
|
-
{
|
|
281
|
-
className: "list-group list-group-flush text-truncate",
|
|
282
|
-
style: {
|
|
283
|
-
maxHeight: 220,
|
|
284
|
-
overflowY: "auto"
|
|
285
|
-
},
|
|
286
|
-
children: [
|
|
287
|
-
filteredItems.map((item) => {
|
|
288
|
-
const checked = selected.some((s) => s.id === item.id);
|
|
289
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
290
|
-
"label",
|
|
291
|
-
{
|
|
292
|
-
className: "list-group-item list-group-item-action d-flex align-items-center gap-2 py-2",
|
|
293
|
-
children: [
|
|
294
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
295
|
-
"input",
|
|
296
|
-
{
|
|
297
|
-
type: "checkbox",
|
|
298
|
-
className: "form-check-input mt-0",
|
|
299
|
-
checked,
|
|
300
|
-
onChange: () => toggleFacetFilter(columnKey, item)
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex-grow-1", children: item.name }),
|
|
304
|
-
checked && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "bx bx-check text-primary" })
|
|
305
|
-
]
|
|
306
|
-
},
|
|
307
|
-
item.id
|
|
308
|
-
);
|
|
309
|
-
}),
|
|
310
|
-
!filteredItems.length && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "text-center text-muted py-3 small", children: "No results" })
|
|
311
|
-
]
|
|
312
|
-
}
|
|
313
|
-
),
|
|
314
|
-
selected.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "pt-2 border-top mt-2 d-flex justify-content-end", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
315
|
-
"button",
|
|
316
|
-
{
|
|
317
|
-
className: "btn btn-sm btn-label-secondary",
|
|
318
|
-
onClick: clearFacetFilters,
|
|
319
|
-
children: "Clear"
|
|
320
|
-
}
|
|
321
|
-
) })
|
|
322
|
-
] });
|
|
353
|
+
var OPERATORS = {
|
|
354
|
+
number: [
|
|
355
|
+
{ key: "eq", label: "Equals" },
|
|
356
|
+
{ key: "neq", label: "Not Equal" },
|
|
357
|
+
{ key: "gt", label: "Greater Than" },
|
|
358
|
+
{ key: "gte", label: "Greater or Equal" },
|
|
359
|
+
{ key: "lt", label: "Less Than" },
|
|
360
|
+
{ key: "lte", label: "Less or Equal" },
|
|
361
|
+
{ key: "between", label: "Between" }
|
|
362
|
+
],
|
|
363
|
+
text: [
|
|
364
|
+
{ key: "contains", label: "Contains" },
|
|
365
|
+
{ key: "starts", label: "Starts With" },
|
|
366
|
+
{ key: "ends", label: "Ends With" },
|
|
367
|
+
{ key: "eq", label: "Equals" }
|
|
368
|
+
],
|
|
369
|
+
date: [
|
|
370
|
+
{ key: "before", label: "Before" },
|
|
371
|
+
{ key: "after", label: "After" },
|
|
372
|
+
{ key: "between", label: "Between" }
|
|
373
|
+
]
|
|
323
374
|
};
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
375
|
+
function AdvanceFilter({
|
|
376
|
+
type = "number",
|
|
377
|
+
value,
|
|
378
|
+
onApply,
|
|
379
|
+
onClear
|
|
380
|
+
}) {
|
|
381
|
+
const [operation, setOperation] = (0, import_react2.useState)("");
|
|
382
|
+
const [v1, setV1] = (0, import_react2.useState)("");
|
|
383
|
+
const [v2, setV2] = (0, import_react2.useState)("");
|
|
384
|
+
(0, import_react2.useEffect)(() => {
|
|
385
|
+
if (!value) {
|
|
386
|
+
setOperation("");
|
|
387
|
+
setV1("");
|
|
388
|
+
setV2("");
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
setOperation(value.operation);
|
|
392
|
+
setV1(value.value ?? value.from ?? "");
|
|
393
|
+
setV2(value.to ?? "");
|
|
394
|
+
}, [value]);
|
|
395
|
+
const apply = () => {
|
|
396
|
+
if (!operation) return;
|
|
397
|
+
onApply(
|
|
398
|
+
operation === "between" ? { type, operation, from: v1, to: v2 } : { type, operation, value: v1 }
|
|
399
|
+
);
|
|
344
400
|
};
|
|
345
|
-
if (
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
401
|
+
if (!type) return null;
|
|
402
|
+
const isApplyDisabled = !operation || (operation === "between" ? !v1 || !v2 : !v1);
|
|
403
|
+
const selectedOpLabel = OPERATORS[type].find((o) => o.key === operation)?.label || "Select condition...";
|
|
404
|
+
const opItems = OPERATORS[type].map((o) => ({
|
|
405
|
+
key: o.key,
|
|
406
|
+
label: o.label,
|
|
407
|
+
onClick: () => setOperation(o.key)
|
|
408
|
+
}));
|
|
409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
className: "advance-filter-panel",
|
|
413
|
+
style: { width: 260, minWidth: 260 },
|
|
414
|
+
onClick: (e) => e.stopPropagation(),
|
|
415
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
351
416
|
children: [
|
|
352
|
-
{
|
|
353
|
-
|
|
417
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "d-flex align-items-center mb-3", children: [
|
|
418
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "bx bx-filter text-secondary me-2" }),
|
|
419
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-secondary", children: "Filter by Column" })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
422
|
+
PamDropdown,
|
|
423
|
+
{
|
|
424
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
425
|
+
"button",
|
|
426
|
+
{
|
|
427
|
+
type: "button",
|
|
428
|
+
className: "btn d-flex align-items-center gap-2 px-2 py-1 bg-light-secondary-hover rounded",
|
|
429
|
+
children: [
|
|
430
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-truncate", style: { maxWidth: 140 }, children: selectedOpLabel }),
|
|
431
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "bx bx-xs bx-expand-vertical" })
|
|
432
|
+
]
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
items: opItems,
|
|
436
|
+
placement: "bottom-start"
|
|
437
|
+
}
|
|
438
|
+
) }),
|
|
439
|
+
operation && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "mb-3", children: operation !== "between" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
440
|
+
"input",
|
|
441
|
+
{
|
|
442
|
+
type: type === "date" ? "date" : type === "number" ? "number" : "text",
|
|
443
|
+
className: "form-control form-control-sm",
|
|
444
|
+
placeholder: "Value...",
|
|
445
|
+
value: v1,
|
|
446
|
+
onChange: (e) => setV1(e.target.value),
|
|
447
|
+
autoFocus: true
|
|
448
|
+
}
|
|
449
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "d-flex flex-column gap-2", children: [
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
451
|
+
"input",
|
|
452
|
+
{
|
|
453
|
+
type: type === "date" ? "date" : type === "number" ? "number" : "text",
|
|
454
|
+
className: "form-control form-control-sm",
|
|
455
|
+
placeholder: "From",
|
|
456
|
+
value: v1,
|
|
457
|
+
onChange: (e) => setV1(e.target.value)
|
|
458
|
+
}
|
|
459
|
+
),
|
|
460
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
461
|
+
"input",
|
|
462
|
+
{
|
|
463
|
+
type: type === "date" ? "date" : type === "number" ? "number" : "text",
|
|
464
|
+
className: "form-control form-control-sm",
|
|
465
|
+
placeholder: "To",
|
|
466
|
+
value: v2,
|
|
467
|
+
onChange: (e) => setV2(e.target.value)
|
|
468
|
+
}
|
|
469
|
+
)
|
|
470
|
+
] }) }),
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "d-flex align-items-center justify-content-between gap-2 mt-3 pt-2 border-top", children: [
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
473
|
+
"button",
|
|
474
|
+
{
|
|
475
|
+
className: "btn btn-sm btn-label-secondary border-0",
|
|
476
|
+
onClick: onClear,
|
|
477
|
+
style: { fontSize: "0.75rem", padding: "4px 8px" },
|
|
478
|
+
children: "Clear"
|
|
479
|
+
}
|
|
480
|
+
),
|
|
481
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
482
|
+
"button",
|
|
483
|
+
{
|
|
484
|
+
className: "btn btn-sm btn-primary",
|
|
485
|
+
onClick: apply,
|
|
486
|
+
disabled: isApplyDisabled,
|
|
487
|
+
style: { fontSize: "0.75rem", padding: "4px 16px", borderRadius: "4px" },
|
|
488
|
+
children: "Apply"
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
] }),
|
|
492
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: `
|
|
493
|
+
.dropdown-item-custom:hover {
|
|
494
|
+
background-color: #f5f5f9;
|
|
495
|
+
color: #696cff;
|
|
496
|
+
}
|
|
497
|
+
.advance-filter-panel .form-control:focus {
|
|
498
|
+
border-color: #696cff;
|
|
499
|
+
box-shadow: 0 0 0 0.1rem rgba(105, 108, 255, 0.1);
|
|
500
|
+
}
|
|
501
|
+
` })
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// src/core/utils.ts
|
|
508
|
+
var import_react3 = require("react");
|
|
509
|
+
var EDGE_SIZE = 8;
|
|
510
|
+
var getResizeSide = (e, index) => {
|
|
511
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
512
|
+
const nearRight = rect.right - e.clientX < EDGE_SIZE;
|
|
513
|
+
const nearLeft = e.clientX - rect.left < EDGE_SIZE;
|
|
514
|
+
if (nearRight) return "right";
|
|
515
|
+
if (nearLeft && index > 0) return "left";
|
|
516
|
+
return null;
|
|
517
|
+
};
|
|
518
|
+
function getAdvancedFilterType(column) {
|
|
519
|
+
const f = column.enableAdvancedFilter;
|
|
520
|
+
if (!f) return null;
|
|
521
|
+
if (f === true) {
|
|
522
|
+
return "number";
|
|
523
|
+
}
|
|
524
|
+
return f.type;
|
|
525
|
+
}
|
|
526
|
+
function getLeftOffset(colState, key) {
|
|
527
|
+
let offset = 0;
|
|
528
|
+
const leftCols = colState.filter((c) => c.visible && c.pinned === "left").sort((a, b) => a.order - b.order);
|
|
529
|
+
for (const c of leftCols) {
|
|
530
|
+
if (c.key === key) return offset;
|
|
531
|
+
offset += c.width ?? 120;
|
|
532
|
+
}
|
|
533
|
+
return offset;
|
|
534
|
+
}
|
|
535
|
+
function getRightOffset(colState, key) {
|
|
536
|
+
let offset = 0;
|
|
537
|
+
const rightCols = colState.filter((c) => c.visible && c.pinned === "right").sort((a, b) => b.order - a.order);
|
|
538
|
+
for (const c of rightCols) {
|
|
539
|
+
if (c.key === key) return offset;
|
|
540
|
+
offset += c.width ?? 120;
|
|
541
|
+
}
|
|
542
|
+
return offset;
|
|
543
|
+
}
|
|
544
|
+
var getNestedValue = (obj, path) => {
|
|
545
|
+
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
546
|
+
};
|
|
547
|
+
function useLocalStorageState(key, initialValue) {
|
|
548
|
+
const getValue = () => {
|
|
549
|
+
try {
|
|
550
|
+
const stored = localStorage.getItem(key);
|
|
551
|
+
return stored ? JSON.parse(stored) : initialValue;
|
|
552
|
+
} catch {
|
|
553
|
+
return initialValue;
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
const [value, setValue] = (0, import_react3.useState)(getValue);
|
|
557
|
+
const updateValue = (newValue) => {
|
|
558
|
+
setValue(newValue);
|
|
559
|
+
localStorage.setItem(key, JSON.stringify(newValue));
|
|
560
|
+
window.dispatchEvent(
|
|
561
|
+
new CustomEvent("pam-localstorage", {
|
|
562
|
+
detail: { key, value: newValue }
|
|
563
|
+
})
|
|
564
|
+
);
|
|
565
|
+
};
|
|
566
|
+
(0, import_react3.useEffect)(() => {
|
|
567
|
+
const sync = (e) => {
|
|
568
|
+
if (e?.detail?.key === key) {
|
|
569
|
+
setValue(e.detail.value);
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (e?.key === key) {
|
|
573
|
+
setValue(getValue());
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
window.addEventListener("pam-localstorage", sync);
|
|
577
|
+
window.addEventListener("storage", sync);
|
|
578
|
+
return () => {
|
|
579
|
+
window.removeEventListener("pam-localstorage", sync);
|
|
580
|
+
window.removeEventListener("storage", sync);
|
|
581
|
+
};
|
|
582
|
+
}, [key]);
|
|
583
|
+
return [value, updateValue];
|
|
584
|
+
}
|
|
585
|
+
var resolveValue = (value, row) => {
|
|
586
|
+
return typeof value === "function" ? value(row) : value;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// src/components/FacetFilter.tsx
|
|
590
|
+
var import_react4 = require("react");
|
|
591
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
592
|
+
var FacetFilter = ({
|
|
593
|
+
columnKey,
|
|
594
|
+
grid
|
|
595
|
+
}) => {
|
|
596
|
+
const {
|
|
597
|
+
facetItems,
|
|
598
|
+
facetFilters,
|
|
599
|
+
toggleFacetFilter,
|
|
600
|
+
loadFacets,
|
|
601
|
+
facetLoading,
|
|
602
|
+
clearFacetFilters
|
|
603
|
+
} = grid;
|
|
604
|
+
const [search, setSearch] = (0, import_react4.useState)("");
|
|
605
|
+
const items = facetItems?.[columnKey] || [];
|
|
606
|
+
const selected = facetFilters?.[columnKey] || [];
|
|
607
|
+
(0, import_react4.useEffect)(() => {
|
|
608
|
+
loadFacets(columnKey);
|
|
609
|
+
}, [columnKey]);
|
|
610
|
+
const filteredItems = (0, import_react4.useMemo)(() => {
|
|
611
|
+
if (!search) return items;
|
|
612
|
+
const q = search.toLowerCase();
|
|
613
|
+
return items.filter((i) => i.name.toLowerCase().includes(q));
|
|
614
|
+
}, [items, search]);
|
|
615
|
+
if (facetLoading?.[columnKey]) {
|
|
616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "p-3 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-secondary", children: "Loading..." }) });
|
|
617
|
+
}
|
|
618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
619
|
+
"div",
|
|
620
|
+
{
|
|
621
|
+
className: "pam-grid-facet-filter",
|
|
622
|
+
style: { width: 240 },
|
|
623
|
+
onClick: (e) => e.stopPropagation(),
|
|
624
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
627
|
+
"input",
|
|
628
|
+
{
|
|
629
|
+
type: "search",
|
|
630
|
+
className: "form-control form-control-sm",
|
|
631
|
+
placeholder: "Search...",
|
|
632
|
+
value: search,
|
|
633
|
+
onChange: (e) => setSearch(e.target.value)
|
|
634
|
+
}
|
|
635
|
+
) }),
|
|
636
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
className: "list-group list-group-flush text-truncate",
|
|
640
|
+
style: {
|
|
641
|
+
maxHeight: 220,
|
|
642
|
+
overflowY: "auto"
|
|
643
|
+
},
|
|
644
|
+
children: [
|
|
645
|
+
filteredItems.map((item) => {
|
|
646
|
+
const checked = selected.some((s) => s.id === item.id);
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
648
|
+
"label",
|
|
649
|
+
{
|
|
650
|
+
className: "list-group-item list-group-item-action d-flex align-items-center gap-2 py-2",
|
|
651
|
+
children: [
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
653
|
+
"input",
|
|
654
|
+
{
|
|
655
|
+
type: "checkbox",
|
|
656
|
+
className: "form-check-input mt-0",
|
|
657
|
+
checked,
|
|
658
|
+
onChange: () => toggleFacetFilter(columnKey, item)
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex-grow-1", children: item.name }),
|
|
662
|
+
checked && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "bx bx-check text-primary" })
|
|
663
|
+
]
|
|
664
|
+
},
|
|
665
|
+
item.id
|
|
666
|
+
);
|
|
667
|
+
}),
|
|
668
|
+
!filteredItems.length && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-center text-muted py-3 small", children: "No results" })
|
|
669
|
+
]
|
|
670
|
+
}
|
|
671
|
+
),
|
|
672
|
+
selected.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "pt-2 border-top mt-2 d-flex justify-content-end", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
673
|
+
"button",
|
|
674
|
+
{
|
|
675
|
+
className: "btn btn-sm btn-label-secondary",
|
|
676
|
+
onClick: clearFacetFilters,
|
|
677
|
+
children: "Clear"
|
|
678
|
+
}
|
|
679
|
+
) })
|
|
680
|
+
]
|
|
681
|
+
}
|
|
682
|
+
);
|
|
683
|
+
};
|
|
684
|
+
var FacetFilter_default = FacetFilter;
|
|
685
|
+
|
|
686
|
+
// src/components/PamHeaderOption.tsx
|
|
687
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
688
|
+
var PamHeaderOptions = ({
|
|
689
|
+
currentColumn,
|
|
690
|
+
gridFetaures,
|
|
691
|
+
grid
|
|
692
|
+
}) => {
|
|
693
|
+
const items = [];
|
|
694
|
+
const { advanceFilters, setColumnAdvanceFilter, colState, updateColumn } = grid;
|
|
695
|
+
const { key: columnKey } = currentColumn;
|
|
696
|
+
const pinColumn = (key, side) => {
|
|
697
|
+
const col = colState.find((c) => c.key === key);
|
|
698
|
+
if (!col) return;
|
|
699
|
+
const newPinned = col.pinned === side ? null : side;
|
|
700
|
+
updateColumn(key, { pinned: newPinned });
|
|
701
|
+
};
|
|
702
|
+
const unpinColumn = (key) => {
|
|
703
|
+
updateColumn(key, { pinned: null });
|
|
704
|
+
};
|
|
705
|
+
if (gridFetaures.pinning) {
|
|
706
|
+
items.push({
|
|
707
|
+
key: `pined-col-${String(currentColumn.key)}`,
|
|
708
|
+
label: "Pinned",
|
|
709
|
+
icon: "bx bx-pin",
|
|
710
|
+
keepOpenOnClick: true,
|
|
711
|
+
children: [
|
|
712
|
+
{
|
|
713
|
+
key: `pined-col-${String(currentColumn.key)}-noPinned`,
|
|
354
714
|
label: "No Pinned",
|
|
355
715
|
icon: !currentColumn.pinned ? "bx bx-check text-primary" : "",
|
|
356
716
|
onClick: () => unpinColumn(currentColumn.key)
|
|
@@ -380,7 +740,7 @@ var PamHeaderOptions = ({
|
|
|
380
740
|
key: `advance-filter-${String(currentColumn.key)}-apply`,
|
|
381
741
|
keepOpenOnClick: true,
|
|
382
742
|
custome: true,
|
|
383
|
-
label: /* @__PURE__ */ (0,
|
|
743
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
384
744
|
AdvanceFilter,
|
|
385
745
|
{
|
|
386
746
|
type: getAdvancedFilterType(currentColumn),
|
|
@@ -403,17 +763,17 @@ var PamHeaderOptions = ({
|
|
|
403
763
|
key: `facet-filter-${String(currentColumn.key)}-items`,
|
|
404
764
|
keepOpenOnClick: true,
|
|
405
765
|
custome: true,
|
|
406
|
-
label: /* @__PURE__ */ (0,
|
|
766
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FacetFilter_default, { columnKey: String(columnKey), grid })
|
|
407
767
|
}
|
|
408
768
|
]
|
|
409
769
|
});
|
|
410
770
|
}
|
|
411
|
-
return /* @__PURE__ */ (0,
|
|
771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
412
772
|
PamDropdown,
|
|
413
773
|
{
|
|
414
|
-
trigger: /* @__PURE__ */ (0,
|
|
415
|
-
/* @__PURE__ */ (0,
|
|
416
|
-
advanceFilters[String(columnKey)] && /* @__PURE__ */ (0,
|
|
774
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { className: "bx bx-sm bx-dots-vertical-rounded cursor-pointer" }),
|
|
776
|
+
advanceFilters[String(columnKey)] && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "badge rounded-pill bg-info badge-dot badge-notifications" })
|
|
417
777
|
] }),
|
|
418
778
|
items
|
|
419
779
|
}
|
|
@@ -422,7 +782,7 @@ var PamHeaderOptions = ({
|
|
|
422
782
|
var PamHeaderOption_default = PamHeaderOptions;
|
|
423
783
|
|
|
424
784
|
// src/components/FilterApplied.tsx
|
|
425
|
-
var
|
|
785
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
426
786
|
var FilterApplied = ({
|
|
427
787
|
groupBy,
|
|
428
788
|
removeGroupby,
|
|
@@ -466,12 +826,12 @@ var FilterApplied = ({
|
|
|
466
826
|
};
|
|
467
827
|
const facetFilters = grid.facetFilters || {};
|
|
468
828
|
const removeFacetFilter = grid.removeFacetFilter;
|
|
469
|
-
return /* @__PURE__ */ (0,
|
|
470
|
-
groupBy && /* @__PURE__ */ (0,
|
|
829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "d-flex flex-row flex-wrap gap-1 py-1 px-3", children: [
|
|
830
|
+
groupBy && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "badge bg-label-primary text-capitalize", children: [
|
|
471
831
|
"GroupBy : ",
|
|
472
832
|
groupBy.label,
|
|
473
833
|
" ",
|
|
474
|
-
/* @__PURE__ */ (0,
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
475
835
|
"i",
|
|
476
836
|
{
|
|
477
837
|
className: "bx bx-x bx-xs cursor-pointer",
|
|
@@ -479,13 +839,13 @@ var FilterApplied = ({
|
|
|
479
839
|
}
|
|
480
840
|
)
|
|
481
841
|
] }),
|
|
482
|
-
appliedFilters.map((item) => /* @__PURE__ */ (0,
|
|
842
|
+
appliedFilters.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
483
843
|
"span",
|
|
484
844
|
{
|
|
485
845
|
className: "badge bg-label-info text-capitalize me-2",
|
|
486
846
|
children: [
|
|
487
847
|
item.type === "date" && item.operation === "between" ? `${item.column} ${item.from} ${getOperatinName(item.operation)} ${item.to}` : `${item.column} ${getOperatinName(item.operation)} ${item.value}`,
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
489
849
|
"i",
|
|
490
850
|
{
|
|
491
851
|
className: "bx bx-x bx-xs cursor-pointer ms-1",
|
|
@@ -497,7 +857,7 @@ var FilterApplied = ({
|
|
|
497
857
|
item.column
|
|
498
858
|
)),
|
|
499
859
|
Object.entries(facetFilters).map(
|
|
500
|
-
([column, items]) => items.map((item) => /* @__PURE__ */ (0,
|
|
860
|
+
([column, items]) => items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
501
861
|
"span",
|
|
502
862
|
{
|
|
503
863
|
className: "badge bg-label-success text-capitalize me-2",
|
|
@@ -505,7 +865,7 @@ var FilterApplied = ({
|
|
|
505
865
|
getColumnLabel(column),
|
|
506
866
|
": ",
|
|
507
867
|
item.name,
|
|
508
|
-
/* @__PURE__ */ (0,
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
509
869
|
"i",
|
|
510
870
|
{
|
|
511
871
|
className: "bx bx-x bx-xs cursor-pointer ms-1",
|
|
@@ -520,13 +880,13 @@ var FilterApplied = ({
|
|
|
520
880
|
switchFiltersConfig !== void 0 && switchFiltersConfig?.length > 0 && switchFiltersConfig.map((swicth) => {
|
|
521
881
|
return Object.entries(switchQuery).map(([key, value]) => {
|
|
522
882
|
if (swicth.queryParam === key && swicth.defaultValue !== value) {
|
|
523
|
-
return /* @__PURE__ */ (0,
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
524
884
|
"span",
|
|
525
885
|
{
|
|
526
886
|
className: "badge bg-label-warning text-capitalize",
|
|
527
887
|
children: [
|
|
528
888
|
swicth.label,
|
|
529
|
-
/* @__PURE__ */ (0,
|
|
889
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
530
890
|
"i",
|
|
531
891
|
{
|
|
532
892
|
className: "bx bx-x bx-xs cursor-pointer",
|
|
@@ -546,9 +906,9 @@ var FilterApplied = ({
|
|
|
546
906
|
var FilterApplied_default = FilterApplied;
|
|
547
907
|
|
|
548
908
|
// src/components/icons/Minimize.tsx
|
|
549
|
-
var
|
|
909
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
550
910
|
var Minimize = ({ onClick }) => {
|
|
551
|
-
return /* @__PURE__ */ (0,
|
|
911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
552
912
|
"svg",
|
|
553
913
|
{
|
|
554
914
|
className: "w-6 h-6 text-gray-800 dark:text-white cursor-pointer",
|
|
@@ -559,7 +919,7 @@ var Minimize = ({ onClick }) => {
|
|
|
559
919
|
fill: "none",
|
|
560
920
|
viewBox: "0 0 24 24",
|
|
561
921
|
onClick,
|
|
562
|
-
children: /* @__PURE__ */ (0,
|
|
922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
563
923
|
"path",
|
|
564
924
|
{
|
|
565
925
|
stroke: "currentColor",
|
|
@@ -575,9 +935,9 @@ var Minimize = ({ onClick }) => {
|
|
|
575
935
|
var Minimize_default = Minimize;
|
|
576
936
|
|
|
577
937
|
// src/components/icons/Compress.tsx
|
|
578
|
-
var
|
|
938
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
579
939
|
var Compress = ({ onClick }) => {
|
|
580
|
-
return /* @__PURE__ */ (0,
|
|
940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
581
941
|
"svg",
|
|
582
942
|
{
|
|
583
943
|
className: "w-6 h-6 text-gray-800 dark:text-white cursor-pointer",
|
|
@@ -588,7 +948,7 @@ var Compress = ({ onClick }) => {
|
|
|
588
948
|
fill: "none",
|
|
589
949
|
viewBox: "0 0 24 24",
|
|
590
950
|
onClick,
|
|
591
|
-
children: /* @__PURE__ */ (0,
|
|
951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
592
952
|
"path",
|
|
593
953
|
{
|
|
594
954
|
stroke: "currentColor",
|
|
@@ -607,16 +967,16 @@ var Compress_default = Compress;
|
|
|
607
967
|
var Box_default = 'data:image/svg+xml,<svg width="250" height="200" viewBox="0 0 250 200" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">%0D%0A<rect width="250" height="200" fill="url(%23pattern0_249_513)"/>%0D%0A<defs>%0D%0A<pattern id="pattern0_249_513" patternContentUnits="objectBoundingBox" width="1" height="1">%0D%0A<use xlink:href="%23image0_249_513" transform="scale(0.004 0.005)"/>%0D%0A</pattern>%0D%0A<image id="image0_249_513" width="250" height="200" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADICAYAAADBXvybAAAAAXNSR0IArs4c6QAAIABJREFUeF7tfQl4VNXZ/+/OPpOdnWwgCGRh30FRUEShn621KPbf2vpZqxbbz727WK39tK7VqrSubb/aCtrF2kIFr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67z2AnLocIgd6D1x24sxvfuzG2s1unPSKUgcVAj2J0QVG1mhhyhATFs3JwfSKdou2Ok2VstcoOMbjDWHvsQDr9vrmxy40NQSYJd3oaO/tXphnxLWXErCtqCozc2NaD9s3HOg9bMHUw2Wuux0erPioDfsbQwz0csNDEvXJdTel2IQrZjmYy+zul88yg9+rP+iHFi+5wSTVwEUlX8IWcsEEGG1GJtpPO5/+M3epNHQPJ3GvGD4Heq9YRmkSzHW314s3PnRh0xHJdUetjMlvzkR9itKjfuz5ktuLSQHOIEzh/uzU0biy3IT5MxzcBdaL9gVNhQO9ly2oPB1y3a3fR647NwM9c92pQE6/+xabmZ7N3HcjyZIfLt/aS+mi12lxoOtk5YnTr95F/c29aHaGMLfCgvkUicej0nSxAzjQdbHMfJJ6pwAHut53AJ+/LijAga6LZeaT1DsFOND1vgP4/HVBAQ50XSwzn6TeKcCBrvcdwOevCwpwoOtimfkk9U4BDnS97wA+f11QgANdF8vMJ6l3CnCg630H8PnrggIc6LpYZj5JvVOAA13vO4DPXxcU4EDXxTLzSeqdAhzoet8BfP66oAAHui6WmU9S7xTgQNf7DuDz1wUFONB1scx8knqnAAe63ncAn78uKMCBrotl5pPUOwU40PW+A/j8dUEBDnRdLDOfpN4pwIGu9x3A568LCnCg62KZ+ST1TgEOdL3vAD5/XVCAA10Xy8wnqXcKcKDrfQfw+euCAhzoulhmPkm9U4ADXe87gM9fFxTgQNfFMvNJ6p0CHOh63wF8/rqgAAe6LpaZT1LvFOBA1/sO4PPXBQU40HWxzHySeqcAB7redwCfvy4owIGui2Xmk9Q7BTjQ9b4D+Px1QQEOdF0sM5+k3inAga73HcDnrwsKcKDrYpn5JPVOAQ50ve8APn9dUIADXRfLzCepdwpwoOt9B/D564ICHOi6WGY+Sb1TgANd7zuAz18XFPj/WsGwXGrMaOEAAAAASUVORK5CYII="/>%0D%0A</defs>%0D%0A</svg>%0D%0A';
|
|
608
968
|
|
|
609
969
|
// src/components/EmptyState.tsx
|
|
610
|
-
var
|
|
970
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
611
971
|
var EmptyState = ({
|
|
612
972
|
title = "No data available",
|
|
613
973
|
description = "There is nothing to display here.",
|
|
614
974
|
imgSrc = Box_default
|
|
615
975
|
}) => {
|
|
616
|
-
return /* @__PURE__ */ (0,
|
|
617
|
-
/* @__PURE__ */ (0,
|
|
618
|
-
/* @__PURE__ */ (0,
|
|
619
|
-
/* @__PURE__ */ (0,
|
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "empty-state", children: [
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "empty-image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: imgSrc, alt: "Empty" }) }),
|
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h6", { children: title }),
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-muted mb-0", children: description })
|
|
620
980
|
] });
|
|
621
981
|
};
|
|
622
982
|
var EmptyState_default = EmptyState;
|
|
@@ -625,9 +985,9 @@ var EmptyState_default = EmptyState;
|
|
|
625
985
|
var NoSearchResult_default = 'data:image/svg+xml,<svg width="250" height="200" viewBox="0 0 250 200" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A<rect width="250" height="200" fill="white"/>%0D%0A<path fill-rule="evenodd" clip-rule="evenodd" d="M207 65C210.866 65 214 68.134 214 72C214 75.866 210.866 79 207 79H167C170.866 79 174 82.134 174 86C174 89.866 170.866 93 167 93H189C192.866 93 196 96.134 196 100C196 103.866 192.866 107 189 107H178.826C173.952 107 170 110.134 170 114C170 116.577 172 118.911 176 121C179.866 121 183 124.134 183 128C183 131.866 179.866 135 176 135H93C89.134 135 86 131.866 86 128C86 124.134 89.134 121 93 121H54C50.134 121 47 117.866 47 114C47 110.134 50.134 107 54 107H94C97.866 107 101 103.866 101 100C101 96.134 97.866 93 94 93H69C65.134 93 62 89.866 62 86C62 82.134 65.134 79 69 79H109C105.134 79 102 75.866 102 72C102 68.134 105.134 65 109 65H207ZM207 93C210.866 93 214 96.134 214 100C214 103.866 210.866 107 207 107C203.134 107 200 103.866 200 100C200 96.134 203.134 93 207 93Z" fill="%23F3F7FF"/>%0D%0A<path d="M120.5 133C139.002 133 154 118.002 154 99.5C154 80.9985 139.002 66 120.5 66C101.998 66 87 80.9985 87 99.5C87 118.002 101.998 133 120.5 133Z" fill="%23F3F7FF" stroke="%231F64E7" stroke-width="2.5"/>%0D%0A<path fill-rule="evenodd" clip-rule="evenodd" d="M115.132 125.494C116.891 125.819 118.68 125.987 120.5 126C135.136 126 147 114.136 147 99.5C147 84.8645 135.136 73 120.5 73C116.74 73 113.164 73.7829 109.924 75.1946C104.294 77.6479 99.6816 81.9999 96.896 87.4419C95.0445 91.0589 94 95.1575 94 99.5C94 103.44 94.8599 107.179 96.4021 110.54C97.5032 112.94 98.9521 115.146 100.684 117.096" fill="white"/>%0D%0A<path d="M115.132 125.494C116.891 125.819 118.68 125.987 120.5 126C135.136 126 147 114.136 147 99.5C147 84.8645 135.136 73 120.5 73C116.74 73 113.164 73.7829 109.924 75.1946C104.294 77.6479 99.6816 81.9999 96.896 87.4419C95.0445 91.0589 94 95.1575 94 99.5C94 103.44 94.8599 107.179 96.4021 110.54C97.5032 112.94 98.9521 115.146 100.684 117.096" stroke="%231F64E7" stroke-width="2.5" stroke-linecap="round"/>%0D%0A<path d="M103.797 120.075C105.945 121.821 108.372 123.237 111.001 124.247" stroke="%231F64E7" stroke-width="2.5" stroke-linecap="round"/>%0D%0A<path d="M148 126L154 132" stroke="%231F64E7" stroke-width="2.5"/>%0D%0A<path fill-rule="evenodd" clip-rule="evenodd" d="M153.03 131.03C151.138 132.923 151.138 135.992 153.03 137.884L164.116 148.97C166.008 150.862 169.077 150.862 170.97 148.97C172.863 147.077 172.863 144.008 170.97 142.116L159.885 131.03C157.992 129.138 154.923 129.138 153.03 131.03Z" fill="%23E8F0FE" stroke="%231F64E7" stroke-width="2.5"/>%0D%0A<path d="M158 133L169 144" stroke="white" stroke-width="2.5" stroke-linecap="round"/>%0D%0A<path fill-rule="evenodd" clip-rule="evenodd" d="M114 88C114 99.598 123.402 109 135 109C137.278 109 139.472 108.637 141.526 107.966C138.173 116.287 130.023 122.161 120.5 122.161C107.985 122.161 97.8394 112.015 97.8394 99.5C97.8394 88.1596 106.17 78.7648 117.045 77.1011C115.113 80.2793 114 84.0097 114 88Z" fill="%23E8F0FE"/>%0D%0A<path d="M121 81C119.727 81 118.482 81.1253 117.279 81.3642M113.645 82.4761C106.804 85.3508 102 92.1144 102 100" stroke="%2375A4FE" stroke-width="2.5" stroke-linecap="round"/>%0D%0A<path d="M174.176 99.7773H166M180.5 92H163.324H180.5ZM187.5 92H185.279H187.5Z" stroke="%2375A4FE" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>%0D%0A<path d="M84.1758 121.777H76M79.5 113H62.3242H79.5ZM56.5 113H52.2788H56.5Z" stroke="%2375A4FE" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>%0D%0A</svg>%0D%0A';
|
|
626
986
|
|
|
627
987
|
// src/components/icons/ArrowFromBottonToRight.tsx
|
|
628
|
-
var
|
|
988
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
629
989
|
var ArrowFromBottonToRight = () => {
|
|
630
|
-
return /* @__PURE__ */ (0,
|
|
990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
631
991
|
"svg",
|
|
632
992
|
{
|
|
633
993
|
className: "w-[18px] h-[18px] text-gray-800 dark:text-white cursor-pointer",
|
|
@@ -637,7 +997,7 @@ var ArrowFromBottonToRight = () => {
|
|
|
637
997
|
height: "18",
|
|
638
998
|
fill: "none",
|
|
639
999
|
viewBox: "0 0 24 24",
|
|
640
|
-
children: /* @__PURE__ */ (0,
|
|
1000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
641
1001
|
"path",
|
|
642
1002
|
{
|
|
643
1003
|
d: "M4 20V18.6C4 15.2397 4 13.5595 4.65396 12.2761C5.2292 11.1471 6.14708 10.2292 7.27606 9.65396C8.55953 9 10.2397 9 13.6 9H20M20 9L15 14M20 9L15 4",
|
|
@@ -685,414 +1045,118 @@ var getPosition = (x, y, el) => {
|
|
|
685
1045
|
if (top + rect.height > innerHeight) {
|
|
686
1046
|
top = y - rect.height - OFFSET;
|
|
687
1047
|
}
|
|
688
|
-
if (top < 0) {
|
|
689
|
-
top = OFFSET;
|
|
690
|
-
}
|
|
691
|
-
return { left, top };
|
|
692
|
-
};
|
|
693
|
-
var showTooltip = (text, x, y) => {
|
|
694
|
-
const el = getToolTip();
|
|
695
|
-
el.textContent = text;
|
|
696
|
-
el.style.opacity = "1";
|
|
697
|
-
el.style.left = "0px";
|
|
698
|
-
el.style.top = "0px";
|
|
699
|
-
const { left, top } = getPosition(x, y, el);
|
|
700
|
-
el.style.left = `${left}px`;
|
|
701
|
-
el.style.top = `${top}px`;
|
|
702
|
-
};
|
|
703
|
-
var hideTooltip = () => {
|
|
704
|
-
if (!tooltipEl) return;
|
|
705
|
-
tooltipEl.style.opacity = "0";
|
|
706
|
-
};
|
|
707
|
-
|
|
708
|
-
// src/components/BulkAction.tsx
|
|
709
|
-
var
|
|
710
|
-
function BulkAction({ records, actions }) {
|
|
711
|
-
return /* @__PURE__ */ (0,
|
|
712
|
-
/* @__PURE__ */ (0,
|
|
713
|
-
/* @__PURE__ */ (0,
|
|
714
|
-
" ",
|
|
715
|
-
actions.length > 0 && actions?.filter((act) => act.isVisible)?.map((action, index) => /* @__PURE__ */ (0,
|
|
716
|
-
"i",
|
|
717
|
-
{
|
|
718
|
-
className: `${action.icon}`,
|
|
719
|
-
onClick: (e) => {
|
|
720
|
-
e.stopPropagation();
|
|
721
|
-
action.onBulkClick && action.onBulkClick(records);
|
|
722
|
-
},
|
|
723
|
-
onMouseEnter: (e) => showTooltip(action.label, e.clientX, e.clientY),
|
|
724
|
-
onMouseMove: (e) => showTooltip(action.label, e.clientX, e.clientY),
|
|
725
|
-
onMouseLeave: hideTooltip
|
|
726
|
-
},
|
|
727
|
-
`${action.label}_${index}`
|
|
728
|
-
))
|
|
729
|
-
] });
|
|
730
|
-
}
|
|
731
|
-
var BulkAction_default = BulkAction;
|
|
732
|
-
|
|
733
|
-
// src/components/Paginantion.tsx
|
|
734
|
-
var
|
|
735
|
-
var getPaginationRange = (currentPage, totalPages, delta = 1) => {
|
|
736
|
-
const range = [];
|
|
737
|
-
const rangeWithDots = [];
|
|
738
|
-
let last;
|
|
739
|
-
for (let i = 1; i <= totalPages; i++) {
|
|
740
|
-
if (i === 1 || i === totalPages || i >= currentPage - delta && i <= currentPage + delta) {
|
|
741
|
-
range.push(i);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
for (const page of range) {
|
|
745
|
-
if (last !== void 0) {
|
|
746
|
-
if (page - last === 2) {
|
|
747
|
-
rangeWithDots.push(last + 1);
|
|
748
|
-
} else if (page - last > 2) {
|
|
749
|
-
rangeWithDots.push("...");
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
rangeWithDots.push(page);
|
|
753
|
-
last = page;
|
|
754
|
-
}
|
|
755
|
-
return rangeWithDots;
|
|
756
|
-
};
|
|
757
|
-
var Pagination = ({
|
|
758
|
-
currentPage,
|
|
759
|
-
totalPages,
|
|
760
|
-
onPageChange
|
|
761
|
-
}) => {
|
|
762
|
-
if (totalPages <= 1) return null;
|
|
763
|
-
const paginationRange = getPaginationRange(currentPage, totalPages);
|
|
764
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("nav", { "aria-label": "Page navigation", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { className: "pagination pagination-sm justify-content-end py-1 mx-1", children: [
|
|
765
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: `page-item ${currentPage === 1 ? "disabled" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
766
|
-
"button",
|
|
767
|
-
{
|
|
768
|
-
className: "page-link",
|
|
769
|
-
onClick: () => onPageChange(currentPage - 1),
|
|
770
|
-
disabled: currentPage === 1,
|
|
771
|
-
children: "\xAB"
|
|
772
|
-
}
|
|
773
|
-
) }),
|
|
774
|
-
paginationRange.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
775
|
-
"li",
|
|
776
|
-
{
|
|
777
|
-
className: `page-item ${item === currentPage ? "active" : ""} ${item === "..." ? "disabled" : ""}`,
|
|
778
|
-
children: item === "..." ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "page-link", children: "\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "page-link", onClick: () => onPageChange(item), children: item })
|
|
779
|
-
},
|
|
780
|
-
index
|
|
781
|
-
)),
|
|
782
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
783
|
-
"li",
|
|
784
|
-
{
|
|
785
|
-
className: `page-item ${currentPage === totalPages ? "disabled" : ""}`,
|
|
786
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
787
|
-
"button",
|
|
788
|
-
{
|
|
789
|
-
className: "page-link",
|
|
790
|
-
onClick: () => onPageChange(currentPage + 1),
|
|
791
|
-
disabled: currentPage === totalPages,
|
|
792
|
-
children: "\xBB"
|
|
793
|
-
}
|
|
794
|
-
)
|
|
795
|
-
}
|
|
796
|
-
)
|
|
797
|
-
] }) });
|
|
798
|
-
};
|
|
799
|
-
var Paginantion_default = Pagination;
|
|
800
|
-
|
|
801
|
-
// src/components/dropdown/PamDropdown.tsx
|
|
802
|
-
var import_react4 = require("react");
|
|
803
|
-
var import_react_dom = require("react-dom");
|
|
804
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
805
|
-
function PamDropdown({
|
|
806
|
-
trigger,
|
|
807
|
-
items,
|
|
808
|
-
placement = "bottom-start",
|
|
809
|
-
offset = 6,
|
|
810
|
-
disabled = false,
|
|
811
|
-
closeOnItemClick = true,
|
|
812
|
-
className = ""
|
|
813
|
-
}) {
|
|
814
|
-
const triggerRef = (0, import_react4.useRef)(null);
|
|
815
|
-
const menuRef = (0, import_react4.useRef)(null);
|
|
816
|
-
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
817
|
-
const [pos, setPos] = (0, import_react4.useState)({ top: 0, left: 0 });
|
|
818
|
-
const [openSubKeys, setOpenSubKeys] = (0, import_react4.useState)({});
|
|
819
|
-
const portalRoot = (0, import_react4.useMemo)(() => {
|
|
820
|
-
const el = document.getElementById("pam-portal-root");
|
|
821
|
-
if (el) return el;
|
|
822
|
-
const created = document.createElement("div");
|
|
823
|
-
created.id = "pam-portal-root";
|
|
824
|
-
document.body.appendChild(created);
|
|
825
|
-
return created;
|
|
826
|
-
}, []);
|
|
827
|
-
function close() {
|
|
828
|
-
setOpen(false);
|
|
829
|
-
setOpenSubKeys({});
|
|
830
|
-
}
|
|
831
|
-
function toggle() {
|
|
832
|
-
if (disabled) return;
|
|
833
|
-
setOpen((v) => {
|
|
834
|
-
const next = !v;
|
|
835
|
-
if (!next) setOpenSubKeys({});
|
|
836
|
-
return next;
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
function getDropdownPosition(triggerEl, menuEl) {
|
|
840
|
-
const rect = triggerEl.getBoundingClientRect();
|
|
841
|
-
const menuRect = menuEl.getBoundingClientRect();
|
|
842
|
-
let top = rect.bottom + offset + window.scrollY;
|
|
843
|
-
let left = rect.left + window.scrollX;
|
|
844
|
-
if (placement.startsWith("top")) {
|
|
845
|
-
top = rect.top - menuRect.height - offset + window.scrollY;
|
|
846
|
-
}
|
|
847
|
-
if (placement.endsWith("end")) {
|
|
848
|
-
left = rect.right - menuRect.width + window.scrollX;
|
|
849
|
-
}
|
|
850
|
-
const minLeft = 8 + window.scrollX;
|
|
851
|
-
const maxLeft = window.innerWidth - menuRect.width - 8 + window.scrollX;
|
|
852
|
-
left = Math.max(minLeft, Math.min(left, maxLeft));
|
|
853
|
-
const minTop = 8 + window.scrollY;
|
|
854
|
-
const maxTop = window.innerHeight - menuRect.height - 8 + window.scrollY;
|
|
855
|
-
top = Math.max(minTop, Math.min(top, maxTop));
|
|
856
|
-
const bottomOverflow = top + menuRect.height > window.innerHeight + window.scrollY;
|
|
857
|
-
const topOverflow = top < window.scrollY;
|
|
858
|
-
if (bottomOverflow && rect.top > menuRect.height) {
|
|
859
|
-
top = rect.top - menuRect.height - offset + window.scrollY;
|
|
860
|
-
} else if (topOverflow && window.innerHeight - rect.bottom > menuRect.height) {
|
|
861
|
-
top = rect.bottom + offset + window.scrollY;
|
|
862
|
-
}
|
|
863
|
-
return { top, left };
|
|
864
|
-
}
|
|
865
|
-
function updatePosition() {
|
|
866
|
-
const t = triggerRef.current;
|
|
867
|
-
const m = menuRef.current;
|
|
868
|
-
if (!t || !m) return;
|
|
869
|
-
setPos(getDropdownPosition(t, m));
|
|
870
|
-
}
|
|
871
|
-
(0, import_react4.useLayoutEffect)(() => {
|
|
872
|
-
if (!open) return;
|
|
873
|
-
updatePosition();
|
|
874
|
-
}, [open, placement]);
|
|
875
|
-
(0, import_react4.useEffect)(() => {
|
|
876
|
-
if (!open) return;
|
|
877
|
-
const onDown = (e) => {
|
|
878
|
-
const t = triggerRef.current;
|
|
879
|
-
const m = menuRef.current;
|
|
880
|
-
if (!t || !m) return;
|
|
881
|
-
const target = e.target;
|
|
882
|
-
if (t.contains(target)) return;
|
|
883
|
-
if (m.contains(target)) return;
|
|
884
|
-
close();
|
|
885
|
-
};
|
|
886
|
-
const onKey = (e) => {
|
|
887
|
-
if (e.key === "Escape") close();
|
|
888
|
-
};
|
|
889
|
-
document.addEventListener("mousedown", onDown);
|
|
890
|
-
document.addEventListener("keydown", onKey);
|
|
891
|
-
return () => {
|
|
892
|
-
document.removeEventListener("mousedown", onDown);
|
|
893
|
-
document.removeEventListener("keydown", onKey);
|
|
894
|
-
};
|
|
895
|
-
}, [open]);
|
|
896
|
-
(0, import_react4.useEffect)(() => {
|
|
897
|
-
if (!open) return;
|
|
898
|
-
const handler = () => updatePosition();
|
|
899
|
-
window.addEventListener("scroll", handler, true);
|
|
900
|
-
window.addEventListener("resize", handler);
|
|
901
|
-
return () => {
|
|
902
|
-
window.removeEventListener("scroll", handler, true);
|
|
903
|
-
window.removeEventListener("resize", handler);
|
|
904
|
-
};
|
|
905
|
-
}, [open]);
|
|
906
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
907
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { ref: triggerRef, className: `pam-dropdown-trigger ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { onClick: toggle, style: { display: "inline-flex" }, children: trigger }) }),
|
|
908
|
-
open && (0, import_react_dom.createPortal)(
|
|
909
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
910
|
-
"div",
|
|
911
|
-
{
|
|
912
|
-
ref: menuRef,
|
|
913
|
-
className: "pam-dropdown-menu",
|
|
914
|
-
style: {
|
|
915
|
-
top: pos.top,
|
|
916
|
-
left: pos.left
|
|
917
|
-
},
|
|
918
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
919
|
-
PamDropdownList,
|
|
920
|
-
{
|
|
921
|
-
items,
|
|
922
|
-
closeOnItemClick,
|
|
923
|
-
onClose: close,
|
|
924
|
-
openSubKeys,
|
|
925
|
-
setOpenSubKeys,
|
|
926
|
-
level: 0
|
|
927
|
-
}
|
|
928
|
-
)
|
|
929
|
-
}
|
|
930
|
-
),
|
|
931
|
-
portalRoot
|
|
932
|
-
)
|
|
933
|
-
] });
|
|
934
|
-
}
|
|
935
|
-
function PamDropdownList({
|
|
936
|
-
items,
|
|
937
|
-
onClose,
|
|
938
|
-
closeOnItemClick,
|
|
939
|
-
openSubKeys,
|
|
940
|
-
setOpenSubKeys,
|
|
941
|
-
level
|
|
942
|
-
}) {
|
|
943
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "pam-dropdown-list", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
944
|
-
PamDropdownNode,
|
|
945
|
-
{
|
|
946
|
-
item,
|
|
947
|
-
onClose,
|
|
948
|
-
closeOnItemClick,
|
|
949
|
-
openSubKeys,
|
|
950
|
-
setOpenSubKeys,
|
|
951
|
-
level,
|
|
952
|
-
index
|
|
953
|
-
},
|
|
954
|
-
item.key ?? `${level}-${index}`
|
|
955
|
-
)) });
|
|
956
|
-
}
|
|
957
|
-
function PamDropdownNode({
|
|
958
|
-
item,
|
|
959
|
-
onClose,
|
|
960
|
-
closeOnItemClick,
|
|
961
|
-
openSubKeys,
|
|
962
|
-
setOpenSubKeys,
|
|
963
|
-
level,
|
|
964
|
-
index
|
|
965
|
-
}) {
|
|
966
|
-
const liRef = (0, import_react4.useRef)(null);
|
|
967
|
-
const submenuRef = (0, import_react4.useRef)(null);
|
|
968
|
-
const hasChildren = !!item.children?.length;
|
|
969
|
-
const nodeKey = item.key ?? `${level}-${index}`;
|
|
970
|
-
const submenuOpen = !!openSubKeys[nodeKey];
|
|
971
|
-
(0, import_react4.useLayoutEffect)(() => {
|
|
972
|
-
if (!submenuOpen) return;
|
|
973
|
-
const li = liRef.current;
|
|
974
|
-
const menu = submenuRef.current;
|
|
975
|
-
if (!li || !menu) return;
|
|
976
|
-
const rect = li.getBoundingClientRect();
|
|
977
|
-
menu.style.left = "0px";
|
|
978
|
-
menu.style.top = "0px";
|
|
979
|
-
menu.style.maxHeight = "";
|
|
980
|
-
menu.style.overflowY = "";
|
|
981
|
-
const menuRect = menu.getBoundingClientRect();
|
|
982
|
-
const gap = 6;
|
|
983
|
-
const spaceRight = window.innerWidth - rect.right;
|
|
984
|
-
const spaceLeft = rect.left;
|
|
985
|
-
const spaceBottom = window.innerHeight - rect.bottom;
|
|
986
|
-
const spaceTop = rect.top;
|
|
987
|
-
let left = rect.right + gap;
|
|
988
|
-
let top = rect.top;
|
|
989
|
-
let mode = "right";
|
|
990
|
-
if (spaceRight >= menuRect.width) {
|
|
991
|
-
mode = "right";
|
|
992
|
-
left = rect.right + gap;
|
|
993
|
-
top = rect.top;
|
|
994
|
-
} else if (spaceLeft >= menuRect.width) {
|
|
995
|
-
mode = "left";
|
|
996
|
-
left = rect.left - menuRect.width - gap;
|
|
997
|
-
top = rect.top;
|
|
998
|
-
} else {
|
|
999
|
-
if (spaceBottom >= menuRect.height) {
|
|
1000
|
-
mode = "bottom";
|
|
1001
|
-
left = rect.left;
|
|
1002
|
-
top = rect.bottom + gap;
|
|
1003
|
-
} else if (spaceTop >= menuRect.height) {
|
|
1004
|
-
mode = "top";
|
|
1005
|
-
left = rect.left;
|
|
1006
|
-
top = rect.top - menuRect.height - gap;
|
|
1007
|
-
} else {
|
|
1008
|
-
mode = "bottom";
|
|
1009
|
-
left = rect.left;
|
|
1010
|
-
top = rect.bottom + gap;
|
|
1011
|
-
}
|
|
1048
|
+
if (top < 0) {
|
|
1049
|
+
top = OFFSET;
|
|
1050
|
+
}
|
|
1051
|
+
return { left, top };
|
|
1052
|
+
};
|
|
1053
|
+
var showTooltip = (text, x, y) => {
|
|
1054
|
+
const el = getToolTip();
|
|
1055
|
+
el.textContent = text;
|
|
1056
|
+
el.style.opacity = "1";
|
|
1057
|
+
el.style.left = "0px";
|
|
1058
|
+
el.style.top = "0px";
|
|
1059
|
+
const { left, top } = getPosition(x, y, el);
|
|
1060
|
+
el.style.left = `${left}px`;
|
|
1061
|
+
el.style.top = `${top}px`;
|
|
1062
|
+
};
|
|
1063
|
+
var hideTooltip = () => {
|
|
1064
|
+
if (!tooltipEl) return;
|
|
1065
|
+
tooltipEl.style.opacity = "0";
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
// src/components/BulkAction.tsx
|
|
1069
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1070
|
+
function BulkAction({ records, actions }) {
|
|
1071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "d-flex flex-row gap-1 align-items-center py-1 ps-4", children: [
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowFromBottonToRight_default, {}),
|
|
1073
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: `(${records.size}) ${records.size > 1 ? "Records" : "Record"}` }),
|
|
1074
|
+
" ",
|
|
1075
|
+
actions.length > 0 && actions?.filter((act) => act.isVisible)?.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1076
|
+
"i",
|
|
1077
|
+
{
|
|
1078
|
+
className: `${action.icon}`,
|
|
1079
|
+
onClick: (e) => {
|
|
1080
|
+
e.stopPropagation();
|
|
1081
|
+
action.onBulkClick && action.onBulkClick(records);
|
|
1082
|
+
},
|
|
1083
|
+
onMouseEnter: (e) => showTooltip(action.label, e.clientX, e.clientY),
|
|
1084
|
+
onMouseMove: (e) => showTooltip(action.label, e.clientX, e.clientY),
|
|
1085
|
+
onMouseLeave: hideTooltip
|
|
1086
|
+
},
|
|
1087
|
+
`${action.label}_${index}`
|
|
1088
|
+
))
|
|
1089
|
+
] });
|
|
1090
|
+
}
|
|
1091
|
+
var BulkAction_default = BulkAction;
|
|
1092
|
+
|
|
1093
|
+
// src/components/Paginantion.tsx
|
|
1094
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1095
|
+
var getPaginationRange = (currentPage, totalPages, delta = 1) => {
|
|
1096
|
+
const range = [];
|
|
1097
|
+
const rangeWithDots = [];
|
|
1098
|
+
let last;
|
|
1099
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
1100
|
+
if (i === 1 || i === totalPages || i >= currentPage - delta && i <= currentPage + delta) {
|
|
1101
|
+
range.push(i);
|
|
1012
1102
|
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
menu.style.overflowY = "auto";
|
|
1022
|
-
menu.style.left = `${left}px`;
|
|
1023
|
-
menu.style.top = `${top}px`;
|
|
1024
|
-
menu.setAttribute("data-placement", mode);
|
|
1025
|
-
}, [submenuOpen]);
|
|
1026
|
-
const handleClick = (e) => {
|
|
1027
|
-
e.stopPropagation();
|
|
1028
|
-
if (item.disabled) return;
|
|
1029
|
-
if (hasChildren) {
|
|
1030
|
-
setOpenSubKeys((prev) => {
|
|
1031
|
-
const next = {};
|
|
1032
|
-
Object.keys(prev).forEach((k) => {
|
|
1033
|
-
const lvl = Number(k.split("-")[0]);
|
|
1034
|
-
if (lvl < level) next[k] = prev[k];
|
|
1035
|
-
});
|
|
1036
|
-
next[nodeKey] = !prev[nodeKey];
|
|
1037
|
-
return next;
|
|
1038
|
-
});
|
|
1039
|
-
return;
|
|
1103
|
+
}
|
|
1104
|
+
for (const page of range) {
|
|
1105
|
+
if (last !== void 0) {
|
|
1106
|
+
if (page - last === 2) {
|
|
1107
|
+
rangeWithDots.push(last + 1);
|
|
1108
|
+
} else if (page - last > 2) {
|
|
1109
|
+
rangeWithDots.push("...");
|
|
1110
|
+
}
|
|
1040
1111
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
] })
|
|
1078
|
-
]
|
|
1079
|
-
}
|
|
1080
|
-
),
|
|
1081
|
-
hasChildren && submenuOpen && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: submenuRef, className: "pam-submenu", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1082
|
-
PamDropdownList,
|
|
1112
|
+
rangeWithDots.push(page);
|
|
1113
|
+
last = page;
|
|
1114
|
+
}
|
|
1115
|
+
return rangeWithDots;
|
|
1116
|
+
};
|
|
1117
|
+
var Pagination = ({
|
|
1118
|
+
currentPage,
|
|
1119
|
+
totalPages,
|
|
1120
|
+
onPageChange
|
|
1121
|
+
}) => {
|
|
1122
|
+
if (totalPages <= 1) return null;
|
|
1123
|
+
const paginationRange = getPaginationRange(currentPage, totalPages);
|
|
1124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("nav", { "aria-label": "Page navigation", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("ul", { className: "pagination pagination-sm justify-content-end py-1 mx-1", children: [
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { className: `page-item ${currentPage === 1 ? "disabled" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1126
|
+
"button",
|
|
1127
|
+
{
|
|
1128
|
+
className: "page-link",
|
|
1129
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
1130
|
+
disabled: currentPage === 1,
|
|
1131
|
+
children: "\xAB"
|
|
1132
|
+
}
|
|
1133
|
+
) }),
|
|
1134
|
+
paginationRange.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1135
|
+
"li",
|
|
1136
|
+
{
|
|
1137
|
+
className: `page-item ${item === currentPage ? "active" : ""} ${item === "..." ? "disabled" : ""}`,
|
|
1138
|
+
children: item === "..." ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "page-link", children: "\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { className: "page-link", onClick: () => onPageChange(item), children: item })
|
|
1139
|
+
},
|
|
1140
|
+
index
|
|
1141
|
+
)),
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1143
|
+
"li",
|
|
1144
|
+
{
|
|
1145
|
+
className: `page-item ${currentPage === totalPages ? "disabled" : ""}`,
|
|
1146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1147
|
+
"button",
|
|
1083
1148
|
{
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
setOpenSubKeys,
|
|
1089
|
-
level: level + 1
|
|
1149
|
+
className: "page-link",
|
|
1150
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
1151
|
+
disabled: currentPage === totalPages,
|
|
1152
|
+
children: "\xBB"
|
|
1090
1153
|
}
|
|
1091
|
-
)
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
);
|
|
1095
|
-
}
|
|
1154
|
+
)
|
|
1155
|
+
}
|
|
1156
|
+
)
|
|
1157
|
+
] }) });
|
|
1158
|
+
};
|
|
1159
|
+
var Paginantion_default = Pagination;
|
|
1096
1160
|
|
|
1097
1161
|
// src/components/MainFilter.tsx
|
|
1098
1162
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
@@ -1327,12 +1391,14 @@ var PamGrid = ({
|
|
|
1327
1391
|
"bulk-data-toggle",
|
|
1328
1392
|
false
|
|
1329
1393
|
);
|
|
1394
|
+
const [editingCell, setEditingCell] = (0, import_react5.useState)(null);
|
|
1330
1395
|
const wrapperRef = (0, import_react5.useRef)(null);
|
|
1331
1396
|
const dragState = (0, import_react5.useRef)({ from: null });
|
|
1332
1397
|
const {
|
|
1333
1398
|
rows,
|
|
1334
1399
|
page,
|
|
1335
1400
|
totalPages,
|
|
1401
|
+
totalRecord,
|
|
1336
1402
|
pageSize,
|
|
1337
1403
|
setPage,
|
|
1338
1404
|
setPageSize,
|
|
@@ -1483,7 +1549,13 @@ var PamGrid = ({
|
|
|
1483
1549
|
]
|
|
1484
1550
|
}
|
|
1485
1551
|
),
|
|
1486
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1553
|
+
"div",
|
|
1554
|
+
{
|
|
1555
|
+
className: `flex-shrink-0 ${features.fullScreen ? "" : "d-none"}`,
|
|
1556
|
+
children: isFullScreen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Minimize_default, { onClick: () => setFullScreen(!isFullScreen) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Compress_default, { onClick: () => setFullScreen(!isFullScreen) })
|
|
1557
|
+
}
|
|
1558
|
+
)
|
|
1487
1559
|
] }) })
|
|
1488
1560
|
] }),
|
|
1489
1561
|
customeDiv && customeDiv,
|
|
@@ -1500,7 +1572,7 @@ var PamGrid = ({
|
|
|
1500
1572
|
}
|
|
1501
1573
|
)
|
|
1502
1574
|
] }),
|
|
1503
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1504
1576
|
"div",
|
|
1505
1577
|
{
|
|
1506
1578
|
ref: wrapperRef,
|
|
@@ -1508,197 +1580,211 @@ var PamGrid = ({
|
|
|
1508
1580
|
style: {
|
|
1509
1581
|
height: gridHeight
|
|
1510
1582
|
},
|
|
1511
|
-
children:
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
{
|
|
1528
|
-
style: { width: 32, position: "sticky", top: 0, zIndex: 10 },
|
|
1529
|
-
className: "text-center ticky-action-column",
|
|
1530
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1531
|
-
"input",
|
|
1532
|
-
{
|
|
1533
|
-
type: "checkbox",
|
|
1534
|
-
className: "form-check-input mx-3",
|
|
1535
|
-
checked: currentRows.length > 0 && currentRows.every((r) => selected.has(String(r[rowKey]))),
|
|
1536
|
-
onChange: (e) => e.target.checked ? selectAllOnPage(currentRows) : deselectAllOnPage(currentRows),
|
|
1537
|
-
disabled: isFetching
|
|
1538
|
-
}
|
|
1539
|
-
)
|
|
1540
|
-
}
|
|
1541
|
-
),
|
|
1542
|
-
visibleColumns.map((col, index) => {
|
|
1543
|
-
const style = {
|
|
1544
|
-
minWidth: col.width || 120,
|
|
1545
|
-
width: col.width,
|
|
1546
|
-
...col.pinned && { position: "sticky" },
|
|
1547
|
-
...col.pinned === "left" && {
|
|
1548
|
-
left: `${getLeftOffset(colState, col.key)}px`
|
|
1549
|
-
},
|
|
1550
|
-
...col.pinned === "right" && {
|
|
1551
|
-
right: `${getRightOffset(colState, col.key)}px`
|
|
1552
|
-
}
|
|
1553
|
-
};
|
|
1554
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1583
|
+
children: [
|
|
1584
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1585
|
+
"table",
|
|
1586
|
+
{
|
|
1587
|
+
className: "table table-sm rounded mb-0 position-relative",
|
|
1588
|
+
style: { width: "max-content", minWidth: "100%" },
|
|
1589
|
+
children: [
|
|
1590
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1591
|
+
"thead",
|
|
1592
|
+
{
|
|
1593
|
+
className: "bg-light-secondary border p-2 bg-light rounded",
|
|
1594
|
+
style: { position: "sticky", top: 0, zIndex: 10 },
|
|
1595
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("tr", { className: "p-2", children: [
|
|
1596
|
+
features.IsNumbering && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { className: "text-center", children: "#" }),
|
|
1597
|
+
features.expand && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { className: "text-center ticky-action-column", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: "bx bx-collapse-vertical d-none" }) }),
|
|
1598
|
+
isBulkAction && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1555
1599
|
"th",
|
|
1556
1600
|
{
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
if (side) {
|
|
1568
|
-
e.currentTarget.style.cursor = "col-resize";
|
|
1569
|
-
} else if (draggingCol === col.key) {
|
|
1570
|
-
e.currentTarget.style.cursor = "grabbing";
|
|
1571
|
-
} else if (features.reorder) {
|
|
1572
|
-
e.currentTarget.style.cursor = "grab";
|
|
1573
|
-
} else {
|
|
1574
|
-
e.currentTarget.style.cursor = "default";
|
|
1601
|
+
style: { width: 32, position: "sticky", top: 0, zIndex: 10 },
|
|
1602
|
+
className: "text-center ticky-action-column",
|
|
1603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1604
|
+
"input",
|
|
1605
|
+
{
|
|
1606
|
+
type: "checkbox",
|
|
1607
|
+
className: "form-check-input mx-3",
|
|
1608
|
+
checked: currentRows.length > 0 && currentRows.every((r) => selected.has(String(r[rowKey]))),
|
|
1609
|
+
onChange: (e) => e.target.checked ? selectAllOnPage(currentRows) : deselectAllOnPage(currentRows),
|
|
1610
|
+
disabled: isFetching
|
|
1575
1611
|
}
|
|
1612
|
+
)
|
|
1613
|
+
}
|
|
1614
|
+
),
|
|
1615
|
+
visibleColumns.map((col, index) => {
|
|
1616
|
+
const style = {
|
|
1617
|
+
minWidth: col.width || 120,
|
|
1618
|
+
width: col.width,
|
|
1619
|
+
...col.pinned && { position: "sticky" },
|
|
1620
|
+
...col.pinned === "left" && {
|
|
1621
|
+
left: `${getLeftOffset(colState, col.key)}px`
|
|
1576
1622
|
},
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1623
|
+
...col.pinned === "right" && {
|
|
1624
|
+
right: `${getRightOffset(colState, col.key)}px`
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1628
|
+
"th",
|
|
1629
|
+
{
|
|
1630
|
+
draggable: features.reorder,
|
|
1631
|
+
onDragStart: (e) => {
|
|
1632
|
+
setDraggingCol(String(col.key));
|
|
1633
|
+
onDragStart(e, String(col.key));
|
|
1634
|
+
},
|
|
1635
|
+
onDragEnd: () => setDraggingCol(null),
|
|
1636
|
+
onDragOver: (e) => e.preventDefault(),
|
|
1637
|
+
onDrop: (e) => onDrop(e, col.key),
|
|
1638
|
+
onMouseMove: (e) => {
|
|
1639
|
+
const side = getResizeSide(e, index);
|
|
1640
|
+
if (side) {
|
|
1641
|
+
e.currentTarget.style.cursor = "col-resize";
|
|
1642
|
+
} else if (draggingCol === col.key) {
|
|
1643
|
+
e.currentTarget.style.cursor = "grabbing";
|
|
1644
|
+
} else if (features.reorder) {
|
|
1645
|
+
e.currentTarget.style.cursor = "grab";
|
|
1646
|
+
} else {
|
|
1647
|
+
e.currentTarget.style.cursor = "default";
|
|
1648
|
+
}
|
|
1649
|
+
},
|
|
1650
|
+
onMouseLeave: (e) => {
|
|
1651
|
+
e.currentTarget.style.cursor = "default";
|
|
1652
|
+
},
|
|
1653
|
+
onMouseDown: (e) => {
|
|
1654
|
+
const side = getResizeSide(e, index);
|
|
1655
|
+
if (!side) return;
|
|
1656
|
+
e.stopPropagation();
|
|
1657
|
+
onResizeMouseDown(e, col.key, side);
|
|
1658
|
+
},
|
|
1659
|
+
className: `pms-col-header vs-th
|
|
1587
1660
|
${col.pinned ? `pinned pinned-${col.pinned}` : ""}
|
|
1588
1661
|
`,
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1662
|
+
style,
|
|
1663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "d-flex align-items-center w-100 px-1", children: [
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1665
|
+
"div",
|
|
1666
|
+
{
|
|
1667
|
+
className: `flex-grow-1 d-flex align-items-center
|
|
1595
1668
|
${col.align === "center" ? "justify-content-center" : ""}
|
|
1596
1669
|
${col.align === "end" ? "justify-content-end" : ""}
|
|
1597
1670
|
${!col.align || col.align === "start" ? "justify-content-start" : ""}
|
|
1598
1671
|
`,
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1673
|
+
"div",
|
|
1674
|
+
{
|
|
1675
|
+
onClick: () => col.sortable && changeSort(String(col.key)),
|
|
1676
|
+
className: col.sortable ? "cursor-pointer" : "",
|
|
1677
|
+
children: [
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: col.title }),
|
|
1679
|
+
sortBy.key === col.key && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1680
|
+
"i",
|
|
1681
|
+
{
|
|
1682
|
+
className: `bx bx-sm ${sortBy.dir === "asc" ? "bxs-chevron-up" : "bxs-chevron-down"}`
|
|
1683
|
+
}
|
|
1684
|
+
)
|
|
1685
|
+
]
|
|
1686
|
+
}
|
|
1687
|
+
)
|
|
1688
|
+
}
|
|
1689
|
+
),
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "d-flex align-items-center gap-1 flex-shrink-0", children: features.pinning && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1691
|
+
PamHeaderOption_default,
|
|
1692
|
+
{
|
|
1693
|
+
currentColumn: col,
|
|
1694
|
+
gridFetaures: features,
|
|
1695
|
+
grid
|
|
1696
|
+
}
|
|
1697
|
+
) })
|
|
1698
|
+
] })
|
|
1699
|
+
},
|
|
1700
|
+
String(col.key)
|
|
1701
|
+
);
|
|
1702
|
+
}),
|
|
1703
|
+
features.actions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1704
|
+
"th",
|
|
1705
|
+
{
|
|
1706
|
+
className: "text-center sticky-action-column vs-th bg-white th-lastChild",
|
|
1707
|
+
style: { position: "sticky", right: 0, zIndex: 10 },
|
|
1708
|
+
children: "Action"
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1711
|
+
] })
|
|
1712
|
+
}
|
|
1713
|
+
),
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tbody", { children: loading || rows.length === 0 ? Array.from({ length: 1 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1715
|
+
"td",
|
|
1716
|
+
{
|
|
1717
|
+
colSpan: visibleColumns.length + (features.IsNumbering ? 1 : 0) + (features.selection ? 1 : 0) + (features.actions ? 1 : 0),
|
|
1718
|
+
className: "text-center py-4 ",
|
|
1719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: " d-flex justify-content-center align-items-center vh-50", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: "Loading..." }) : !loading && search ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1720
|
+
EmptyState_default,
|
|
1632
1721
|
{
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1722
|
+
title: emptyState.title,
|
|
1723
|
+
description: `No results found for "${search}"`,
|
|
1724
|
+
imgSrc: NoSearchResult_default
|
|
1636
1725
|
}
|
|
1637
|
-
)
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
description: `No results found for "${search}"`,
|
|
1651
|
-
imgSrc: NoSearchResult_default
|
|
1652
|
-
}
|
|
1653
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1654
|
-
EmptyState_default,
|
|
1726
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1727
|
+
EmptyState_default,
|
|
1728
|
+
{
|
|
1729
|
+
title: emptyState.title,
|
|
1730
|
+
imgSrc: Box_default,
|
|
1731
|
+
description: emptyState.description
|
|
1732
|
+
}
|
|
1733
|
+
) }) })
|
|
1734
|
+
},
|
|
1735
|
+
index
|
|
1736
|
+
) }, `row-${index}`)) : !loading && groupBy && groupedRows && groupedRows.length > 0 ? groupedRows.map((g, indG) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react5.default.Fragment, { children: [
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { className: "pam-bg-light-primary", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1738
|
+
"td",
|
|
1655
1739
|
{
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1740
|
+
colSpan: visibleColumns.length + (features.selection ? 1 : 0) + (features.actions ? columns.length : 0),
|
|
1741
|
+
className: "text-start pinned pinned-left tr-group",
|
|
1742
|
+
children: [
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: g.displayLabel }),
|
|
1744
|
+
features.aggregation && Object.keys(g.aggregates).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { className: "ms-3 text-secondary text-capitalize ", children: Object.entries(g.aggregates).map(([k, v]) => `${k}: ${v}`).join(" | ") })
|
|
1745
|
+
]
|
|
1659
1746
|
}
|
|
1660
|
-
) })
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
features.aggregation && Object.keys(g.aggregates).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { className: "ms-3 text-secondary text-capitalize ", children: Object.entries(g.aggregates).map(([k, v]) => `${k}: ${v}`).join(" | ") })
|
|
1672
|
-
]
|
|
1673
|
-
}
|
|
1674
|
-
) }),
|
|
1675
|
-
g.items.map((row, indG2) => renderRow(row, indG2))
|
|
1676
|
-
] }, g.key)) : currentRows.map((row, ind) => renderRow(row, ind)) }),
|
|
1677
|
-
isFetching && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "pam-overlay show d-flex justify-content-center align-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-3 bg-light rounded", children: [
|
|
1678
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "spinner-border spinner-border-sm text-white" }),
|
|
1679
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ms-2 te text-white fw-2 text-light fw-bolder", children: "Loading...." })
|
|
1680
|
-
] }) })
|
|
1681
|
-
]
|
|
1682
|
-
}
|
|
1683
|
-
)
|
|
1747
|
+
) }),
|
|
1748
|
+
g.items.map((row, indG2) => renderRow(row, indG2))
|
|
1749
|
+
] }, g.key)) : currentRows.map((row, ind) => renderRow(row, ind)) })
|
|
1750
|
+
]
|
|
1751
|
+
}
|
|
1752
|
+
),
|
|
1753
|
+
isFetching && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "pam-overlay show d-flex justify-content-center align-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-3 bg-light rounded", children: [
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "spinner-border spinner-border-sm text-white" }),
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ms-2 te text-white fw-2 text-light fw-bolder", children: "Loading...." })
|
|
1756
|
+
] }) })
|
|
1757
|
+
]
|
|
1684
1758
|
}
|
|
1685
1759
|
),
|
|
1686
1760
|
features.pagination && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "d-flex justify-content-between align-items-center mt-2", children: [
|
|
1687
1761
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "d-flex flex-row align-items-center gap-2", children: [
|
|
1688
|
-
|
|
1689
|
-
"
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { className: "text-secondary", children: [
|
|
1763
|
+
"Showing ",
|
|
1764
|
+
rows.length === 0 ? 0 : (page - 1) * pageSize + 1,
|
|
1765
|
+
" - ",
|
|
1766
|
+
(page - 1) * pageSize + rows.length,
|
|
1767
|
+
" of ",
|
|
1768
|
+
totalRecord
|
|
1769
|
+
] }),
|
|
1770
|
+
features.pageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "d-flex align-items-center gap-2 ms-2", children: [
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1772
|
+
PamDropdown,
|
|
1773
|
+
{
|
|
1774
|
+
placement: "top-start",
|
|
1775
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { className: "btn btn-sm border bg-white d-flex align-items-center gap-1", children: [
|
|
1776
|
+
pageSize,
|
|
1777
|
+
" ",
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: "bx bx-chevron-down text-muted" })
|
|
1779
|
+
] }),
|
|
1780
|
+
items: [20, 50, 100].map((n) => ({
|
|
1781
|
+
key: String(n),
|
|
1782
|
+
label: String(n),
|
|
1783
|
+
onClick: () => setPageSize(n)
|
|
1784
|
+
}))
|
|
1785
|
+
}
|
|
1786
|
+
),
|
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { className: "text-secondary", children: "per page" })
|
|
1702
1788
|
] })
|
|
1703
1789
|
] }),
|
|
1704
1790
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -1760,6 +1846,27 @@ var PamGrid = ({
|
|
|
1760
1846
|
if (col.pinned === "right")
|
|
1761
1847
|
style.right = `${getRightOffset(colState, col.key)}px`;
|
|
1762
1848
|
const isActive = activeCell?.row[rowKey] === row[rowKey] && activeCell?.column.key === col.key;
|
|
1849
|
+
const isEditing = editingCell?.rowId === row[rowKey] && editingCell?.columnKey === col.key;
|
|
1850
|
+
const handleEditStart = () => {
|
|
1851
|
+
if (features.editable && col.editable) {
|
|
1852
|
+
setEditingCell({
|
|
1853
|
+
rowId: row[rowKey],
|
|
1854
|
+
columnKey: String(col.key),
|
|
1855
|
+
value: row[col.key]
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
};
|
|
1859
|
+
const handleEditSave = () => {
|
|
1860
|
+
if (editingCell) {
|
|
1861
|
+
grid.updateRow(editingCell.rowId, {
|
|
1862
|
+
[editingCell.columnKey]: editingCell.value
|
|
1863
|
+
});
|
|
1864
|
+
setEditingCell(null);
|
|
1865
|
+
}
|
|
1866
|
+
};
|
|
1867
|
+
const handleEditCancel = () => {
|
|
1868
|
+
setEditingCell(null);
|
|
1869
|
+
};
|
|
1763
1870
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1764
1871
|
"td",
|
|
1765
1872
|
{
|
|
@@ -1771,9 +1878,62 @@ var PamGrid = ({
|
|
|
1771
1878
|
column: col
|
|
1772
1879
|
});
|
|
1773
1880
|
col.onCellClick && col.onCellClick(row, col);
|
|
1881
|
+
handleEditStart();
|
|
1774
1882
|
},
|
|
1775
|
-
className: `${col.className ?? ""} ${col.pinned ? "pinned-left px-3 bg-white pms-grid td pinned" : "px-3"} ${isActive ? "grid-cell-active" : ""}
|
|
1776
|
-
children:
|
|
1883
|
+
className: `${col.className ?? ""} ${col.pinned ? "pinned-left px-3 bg-white pms-grid td pinned" : "px-3"} ${isActive ? "grid-cell-active" : ""} ${isEditing ? "p-0" : ""} cursor-pointer`,
|
|
1884
|
+
children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w-100 h-100 d-flex align-items-center p-0", children: col.editType === "select" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w-100 h-100", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1885
|
+
PamDropdown,
|
|
1886
|
+
{
|
|
1887
|
+
placement: "bottom-start",
|
|
1888
|
+
className: "w-100 h-100",
|
|
1889
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "border-0 rounded-0 h-100 d-flex align-items-center justify-content-between bg-white px-2", children: [
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "d-flex align-items-center gap-2", children: [
|
|
1891
|
+
col.editOptions?.find(
|
|
1892
|
+
(o) => String(o.value) === String(editingCell.value)
|
|
1893
|
+
)?.icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1894
|
+
"i",
|
|
1895
|
+
{
|
|
1896
|
+
className: `${col.editOptions?.find(
|
|
1897
|
+
(o) => String(o.value) === String(editingCell.value)
|
|
1898
|
+
)?.icon} text-secondary`
|
|
1899
|
+
}
|
|
1900
|
+
),
|
|
1901
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: col.editOptions?.find(
|
|
1902
|
+
(o) => String(o.value) === String(editingCell.value)
|
|
1903
|
+
)?.label ?? "Select..." })
|
|
1904
|
+
] }),
|
|
1905
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: "bx bx-chevron-down text-muted" })
|
|
1906
|
+
] }),
|
|
1907
|
+
items: col.editOptions?.map((opt) => ({
|
|
1908
|
+
key: String(opt.value),
|
|
1909
|
+
label: opt.label,
|
|
1910
|
+
icon: opt.icon,
|
|
1911
|
+
onClick: () => {
|
|
1912
|
+
grid.updateRow(editingCell.rowId, {
|
|
1913
|
+
[editingCell.columnKey]: opt.value
|
|
1914
|
+
});
|
|
1915
|
+
setEditingCell(null);
|
|
1916
|
+
}
|
|
1917
|
+
})) || []
|
|
1918
|
+
}
|
|
1919
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1920
|
+
"input",
|
|
1921
|
+
{
|
|
1922
|
+
type: col.editType === "number" ? "number" : col.editType === "date" ? "date" : "text",
|
|
1923
|
+
className: "form-control form-control-sm border-0 rounded-0 p-0 m-0",
|
|
1924
|
+
autoFocus: true,
|
|
1925
|
+
value: editingCell.value ?? "",
|
|
1926
|
+
onChange: (e) => setEditingCell({
|
|
1927
|
+
...editingCell,
|
|
1928
|
+
value: e.target.value
|
|
1929
|
+
}),
|
|
1930
|
+
onBlur: handleEditSave,
|
|
1931
|
+
onKeyDown: (e) => {
|
|
1932
|
+
if (e.key === "Enter") handleEditSave();
|
|
1933
|
+
if (e.key === "Escape") handleEditCancel();
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
) }) : col.render ? col.render(row) : String(row[col.key]) ?? ""
|
|
1777
1937
|
},
|
|
1778
1938
|
String(col.key)
|
|
1779
1939
|
);
|
|
@@ -1937,10 +2097,12 @@ function useGridCore({
|
|
|
1937
2097
|
rowKey = "id",
|
|
1938
2098
|
initialPageSize = 20,
|
|
1939
2099
|
addNewRecord,
|
|
1940
|
-
switchFiltersConfig
|
|
2100
|
+
switchFiltersConfig,
|
|
2101
|
+
onRowUpdate
|
|
1941
2102
|
}) {
|
|
1942
2103
|
const [page, setPage] = (0, import_react6.useState)(1);
|
|
1943
2104
|
const [pageSize, setPageSize] = (0, import_react6.useState)(initialPageSize);
|
|
2105
|
+
const [totalRecord, setTotalRecord] = (0, import_react6.useState)(0);
|
|
1944
2106
|
const [search, setSearch] = (0, import_react6.useState)("");
|
|
1945
2107
|
const [debouncedSearch, setDebouncedSearch] = (0, import_react6.useState)("");
|
|
1946
2108
|
const [groupBy, setGroupBy] = (0, import_react6.useState)(null);
|
|
@@ -1966,6 +2128,14 @@ function useGridCore({
|
|
|
1966
2128
|
const [serverRows, setServerRows] = (0, import_react6.useState)([]);
|
|
1967
2129
|
const [serverTotal, setServerTotal] = (0, import_react6.useState)(0);
|
|
1968
2130
|
const [serverTotalPages, setServerTotalPages] = (0, import_react6.useState)(1);
|
|
2131
|
+
const [editedData, setEditedData] = (0, import_react6.useState)({});
|
|
2132
|
+
const mergedData = (0, import_react6.useMemo)(() => {
|
|
2133
|
+
if (Object.keys(editedData).length === 0) return data;
|
|
2134
|
+
return data.map((row) => {
|
|
2135
|
+
const id = String(row[rowKey]);
|
|
2136
|
+
return editedData[id] ? { ...row, ...editedData[id] } : row;
|
|
2137
|
+
});
|
|
2138
|
+
}, [data, editedData, rowKey]);
|
|
1969
2139
|
const [colState, setColState] = (0, import_react6.useState)(
|
|
1970
2140
|
() => columns.map((c, i) => ({
|
|
1971
2141
|
...c,
|
|
@@ -1982,7 +2152,7 @@ function useGridCore({
|
|
|
1982
2152
|
}, [search]);
|
|
1983
2153
|
const filteredData = (0, import_react6.useMemo)(() => {
|
|
1984
2154
|
if (serverMode) return [];
|
|
1985
|
-
let filtered = [...
|
|
2155
|
+
let filtered = [...mergedData];
|
|
1986
2156
|
if (debouncedSearch) {
|
|
1987
2157
|
const q = debouncedSearch.toLowerCase();
|
|
1988
2158
|
filtered = filtered.filter(
|
|
@@ -1991,18 +2161,87 @@ function useGridCore({
|
|
|
1991
2161
|
)
|
|
1992
2162
|
);
|
|
1993
2163
|
}
|
|
2164
|
+
Object.values(advanceFilters).forEach((f) => {
|
|
2165
|
+
const { column, operation, value, from, to, type } = f;
|
|
2166
|
+
if (!column || !operation) return;
|
|
2167
|
+
filtered = filtered.filter((row) => {
|
|
2168
|
+
const rawValue = getNestedValue(row, column);
|
|
2169
|
+
if (rawValue === void 0 || rawValue === null) return false;
|
|
2170
|
+
const val = type === "number" ? Number(rawValue) : rawValue;
|
|
2171
|
+
const compareValue = type === "number" ? Number(value) : value;
|
|
2172
|
+
const compareFrom = type === "number" ? Number(from) : from;
|
|
2173
|
+
const compareTo = type === "number" ? Number(to) : to;
|
|
2174
|
+
const toDate = (v) => {
|
|
2175
|
+
const d = new Date(v);
|
|
2176
|
+
return isNaN(d.getTime()) ? null : d;
|
|
2177
|
+
};
|
|
2178
|
+
switch (operation) {
|
|
2179
|
+
// Text & Generic
|
|
2180
|
+
case "eq":
|
|
2181
|
+
return String(val).toLowerCase() === String(compareValue).toLowerCase();
|
|
2182
|
+
case "neq":
|
|
2183
|
+
return String(val).toLowerCase() !== String(compareValue).toLowerCase();
|
|
2184
|
+
case "contains":
|
|
2185
|
+
return String(val).toLowerCase().includes(String(compareValue).toLowerCase());
|
|
2186
|
+
case "starts":
|
|
2187
|
+
return String(val).toLowerCase().startsWith(String(compareValue).toLowerCase());
|
|
2188
|
+
case "ends":
|
|
2189
|
+
return String(val).toLowerCase().endsWith(String(compareValue).toLowerCase());
|
|
2190
|
+
// Numbers & Generic comparison
|
|
2191
|
+
case "gt":
|
|
2192
|
+
return val > compareValue;
|
|
2193
|
+
case "gte":
|
|
2194
|
+
return val >= compareValue;
|
|
2195
|
+
case "lt":
|
|
2196
|
+
return val < compareValue;
|
|
2197
|
+
case "lte":
|
|
2198
|
+
return val <= compareValue;
|
|
2199
|
+
case "between":
|
|
2200
|
+
if (type === "date") {
|
|
2201
|
+
const dVal = toDate(val);
|
|
2202
|
+
const dFrom = toDate(compareFrom);
|
|
2203
|
+
const dTo = toDate(compareTo);
|
|
2204
|
+
if (!dVal || !dFrom || !dTo) return false;
|
|
2205
|
+
return dVal >= dFrom && dVal <= dTo;
|
|
2206
|
+
}
|
|
2207
|
+
return val >= compareFrom && val <= compareTo;
|
|
2208
|
+
// Dates specific
|
|
2209
|
+
case "before": {
|
|
2210
|
+
const dVal = toDate(val);
|
|
2211
|
+
const dComp = toDate(compareValue);
|
|
2212
|
+
return dVal && dComp ? dVal < dComp : false;
|
|
2213
|
+
}
|
|
2214
|
+
case "after": {
|
|
2215
|
+
const dVal = toDate(val);
|
|
2216
|
+
const dComp = toDate(compareValue);
|
|
2217
|
+
return dVal && dComp ? dVal > dComp : false;
|
|
2218
|
+
}
|
|
2219
|
+
default:
|
|
2220
|
+
return true;
|
|
2221
|
+
}
|
|
2222
|
+
});
|
|
2223
|
+
});
|
|
2224
|
+
Object.entries(facetFilters).forEach(([column, items]) => {
|
|
2225
|
+
if (!items || items.length === 0) return;
|
|
2226
|
+
const allowedIds = new Set(items.map((i) => String(i.id)));
|
|
2227
|
+
filtered = filtered.filter((row) => {
|
|
2228
|
+
const val = getNestedValue(row, column);
|
|
2229
|
+
return allowedIds.has(String(val ?? ""));
|
|
2230
|
+
});
|
|
2231
|
+
});
|
|
1994
2232
|
if (sortBy.key) {
|
|
1995
2233
|
const dir = sortBy.dir === "asc" ? 1 : -1;
|
|
1996
|
-
filtered.sort(
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2234
|
+
filtered.sort((a, b) => {
|
|
2235
|
+
const vA = a?.[sortBy.key] ?? "";
|
|
2236
|
+
const vB = b?.[sortBy.key] ?? "";
|
|
2237
|
+
return String(vA).localeCompare(String(vB), void 0, {
|
|
2238
|
+
numeric: true,
|
|
2239
|
+
sensitivity: "base"
|
|
2240
|
+
}) * dir;
|
|
2241
|
+
});
|
|
2003
2242
|
}
|
|
2004
2243
|
return filtered;
|
|
2005
|
-
}, [
|
|
2244
|
+
}, [mergedData, debouncedSearch, sortBy, serverMode, advanceFilters, facetFilters]);
|
|
2006
2245
|
const pagedClientRows = (0, import_react6.useMemo)(() => {
|
|
2007
2246
|
if (serverMode) return [];
|
|
2008
2247
|
const start = (page - 1) * pageSize;
|
|
@@ -2157,6 +2396,16 @@ function useGridCore({
|
|
|
2157
2396
|
},
|
|
2158
2397
|
[]
|
|
2159
2398
|
);
|
|
2399
|
+
const updateRow = (0, import_react6.useCallback)((id, patch) => {
|
|
2400
|
+
setEditedData((prev) => ({
|
|
2401
|
+
...prev,
|
|
2402
|
+
[String(id)]: { ...prev[String(id)] || {}, ...patch }
|
|
2403
|
+
}));
|
|
2404
|
+
if (onRowUpdate) onRowUpdate(id, patch);
|
|
2405
|
+
}, [onRowUpdate]);
|
|
2406
|
+
const clearEdits = (0, import_react6.useCallback)(() => {
|
|
2407
|
+
setEditedData({});
|
|
2408
|
+
}, []);
|
|
2160
2409
|
const toggleExpand = (0, import_react6.useCallback)((id) => {
|
|
2161
2410
|
setExpanded((prev) => {
|
|
2162
2411
|
const s = new Set(prev);
|
|
@@ -2172,6 +2421,8 @@ function useGridCore({
|
|
|
2172
2421
|
setPageSize,
|
|
2173
2422
|
totalRows,
|
|
2174
2423
|
totalPages,
|
|
2424
|
+
totalRecord,
|
|
2425
|
+
setTotalRecord,
|
|
2175
2426
|
// search
|
|
2176
2427
|
search,
|
|
2177
2428
|
setSearch,
|
|
@@ -2226,7 +2477,9 @@ function useGridCore({
|
|
|
2226
2477
|
loadFacets,
|
|
2227
2478
|
facetLoading,
|
|
2228
2479
|
removeFacetFilter,
|
|
2229
|
-
clearFacetFilters
|
|
2480
|
+
clearFacetFilters,
|
|
2481
|
+
updateRow,
|
|
2482
|
+
clearEdits
|
|
2230
2483
|
};
|
|
2231
2484
|
}
|
|
2232
2485
|
// Annotate the CommonJS export names for ESM import in node:
|