unifyedx-storybook-new 0.1.38 → 0.1.40
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/unifyedx-storybook-new.css +436 -10648
- package/dist/unifyedx-storybook-new.es.js +1968 -115
- package/dist/unifyedx-storybook-new.es.js.map +1 -1
- package/package.json +1 -7
|
@@ -5,8 +5,6 @@ import { Popover as Popover$1, PopoverButton, PopoverPanel, Transition, Dialog,
|
|
|
5
5
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
6
6
|
import { useFloating, offset as offset$2, flip as flip$2, shift as shift$2, autoUpdate as autoUpdate$1, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
7
7
|
import { unstable_batchedUpdates, createPortal } from 'react-dom';
|
|
8
|
-
import { CKEditor } from '@ckeditor/ckeditor5-react';
|
|
9
|
-
import { Essentials, Paragraph, Heading, Alignment, BlockQuote, Bold, Italic, Underline, Strikethrough, Link, List, Indent, IndentBlock, Table, SourceEditing, Undo, ClassicEditor } from 'ckeditor5';
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -125,11 +123,11 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
125
123
|
*/
|
|
126
124
|
|
|
127
125
|
|
|
128
|
-
const __iconNode$
|
|
126
|
+
const __iconNode$w = [
|
|
129
127
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
130
128
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
131
129
|
];
|
|
132
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$
|
|
130
|
+
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$w);
|
|
133
131
|
|
|
134
132
|
/**
|
|
135
133
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -139,13 +137,13 @@ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$o);
|
|
|
139
137
|
*/
|
|
140
138
|
|
|
141
139
|
|
|
142
|
-
const __iconNode$
|
|
140
|
+
const __iconNode$v = [
|
|
143
141
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
144
142
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
145
143
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
146
144
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
147
145
|
];
|
|
148
|
-
const Calendar$1 = createLucideIcon("calendar", __iconNode$
|
|
146
|
+
const Calendar$1 = createLucideIcon("calendar", __iconNode$v);
|
|
149
147
|
|
|
150
148
|
/**
|
|
151
149
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -155,8 +153,8 @@ const Calendar$1 = createLucideIcon("calendar", __iconNode$n);
|
|
|
155
153
|
*/
|
|
156
154
|
|
|
157
155
|
|
|
158
|
-
const __iconNode$
|
|
159
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
156
|
+
const __iconNode$u = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
157
|
+
const Check = createLucideIcon("check", __iconNode$u);
|
|
160
158
|
|
|
161
159
|
/**
|
|
162
160
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -166,8 +164,8 @@ const Check = createLucideIcon("check", __iconNode$m);
|
|
|
166
164
|
*/
|
|
167
165
|
|
|
168
166
|
|
|
169
|
-
const __iconNode$
|
|
170
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
167
|
+
const __iconNode$t = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
168
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$t);
|
|
171
169
|
|
|
172
170
|
/**
|
|
173
171
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -177,11 +175,11 @@ const ChevronDown = createLucideIcon("chevron-down", __iconNode$l);
|
|
|
177
175
|
*/
|
|
178
176
|
|
|
179
177
|
|
|
180
|
-
const __iconNode$
|
|
178
|
+
const __iconNode$s = [
|
|
181
179
|
["path", { d: "m17 18-6-6 6-6", key: "1yerx2" }],
|
|
182
180
|
["path", { d: "M7 6v12", key: "1p53r6" }]
|
|
183
181
|
];
|
|
184
|
-
const ChevronFirst = createLucideIcon("chevron-first", __iconNode$
|
|
182
|
+
const ChevronFirst = createLucideIcon("chevron-first", __iconNode$s);
|
|
185
183
|
|
|
186
184
|
/**
|
|
187
185
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -191,11 +189,11 @@ const ChevronFirst = createLucideIcon("chevron-first", __iconNode$k);
|
|
|
191
189
|
*/
|
|
192
190
|
|
|
193
191
|
|
|
194
|
-
const __iconNode$
|
|
192
|
+
const __iconNode$r = [
|
|
195
193
|
["path", { d: "m7 18 6-6-6-6", key: "lwmzdw" }],
|
|
196
194
|
["path", { d: "M17 6v12", key: "1o0aio" }]
|
|
197
195
|
];
|
|
198
|
-
const ChevronLast = createLucideIcon("chevron-last", __iconNode$
|
|
196
|
+
const ChevronLast = createLucideIcon("chevron-last", __iconNode$r);
|
|
199
197
|
|
|
200
198
|
/**
|
|
201
199
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -205,8 +203,8 @@ const ChevronLast = createLucideIcon("chevron-last", __iconNode$j);
|
|
|
205
203
|
*/
|
|
206
204
|
|
|
207
205
|
|
|
208
|
-
const __iconNode$
|
|
209
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
206
|
+
const __iconNode$q = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
207
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$q);
|
|
210
208
|
|
|
211
209
|
/**
|
|
212
210
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -216,8 +214,8 @@ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$i);
|
|
|
216
214
|
*/
|
|
217
215
|
|
|
218
216
|
|
|
219
|
-
const __iconNode$
|
|
220
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
217
|
+
const __iconNode$p = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
218
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$p);
|
|
221
219
|
|
|
222
220
|
/**
|
|
223
221
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -227,11 +225,11 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
|
|
|
227
225
|
*/
|
|
228
226
|
|
|
229
227
|
|
|
230
|
-
const __iconNode$
|
|
228
|
+
const __iconNode$o = [
|
|
231
229
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
232
230
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
233
231
|
];
|
|
234
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$
|
|
232
|
+
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$o);
|
|
235
233
|
|
|
236
234
|
/**
|
|
237
235
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -241,11 +239,11 @@ const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$g);
|
|
|
241
239
|
*/
|
|
242
240
|
|
|
243
241
|
|
|
244
|
-
const __iconNode$
|
|
242
|
+
const __iconNode$n = [
|
|
245
243
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
246
244
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
247
245
|
];
|
|
248
|
-
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$
|
|
246
|
+
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$n);
|
|
249
247
|
|
|
250
248
|
/**
|
|
251
249
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -255,12 +253,12 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$f);
|
|
|
255
253
|
*/
|
|
256
254
|
|
|
257
255
|
|
|
258
|
-
const __iconNode$
|
|
256
|
+
const __iconNode$m = [
|
|
259
257
|
["path", { d: "M12 13v8", key: "1l5pq0" }],
|
|
260
258
|
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
|
|
261
259
|
["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
|
|
262
260
|
];
|
|
263
|
-
const CloudUpload = createLucideIcon("cloud-upload", __iconNode$
|
|
261
|
+
const CloudUpload = createLucideIcon("cloud-upload", __iconNode$m);
|
|
264
262
|
|
|
265
263
|
/**
|
|
266
264
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -270,12 +268,36 @@ const CloudUpload = createLucideIcon("cloud-upload", __iconNode$e);
|
|
|
270
268
|
*/
|
|
271
269
|
|
|
272
270
|
|
|
273
|
-
const __iconNode$
|
|
271
|
+
const __iconNode$l = [
|
|
272
|
+
["path", { d: "M10.5 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.5", key: "1g2yzs" }],
|
|
273
|
+
["path", { d: "m14.3 19.6 1-.4", key: "11sv9r" }],
|
|
274
|
+
["path", { d: "M15 3v7.5", key: "7lm50a" }],
|
|
275
|
+
["path", { d: "m15.2 16.9-.9-.3", key: "1t7mvx" }],
|
|
276
|
+
["path", { d: "m16.6 21.7.3-.9", key: "1j67ps" }],
|
|
277
|
+
["path", { d: "m16.8 15.3-.4-1", key: "1ei7r6" }],
|
|
278
|
+
["path", { d: "m19.1 15.2.3-.9", key: "18r7jp" }],
|
|
279
|
+
["path", { d: "m19.6 21.7-.4-1", key: "z2vh2" }],
|
|
280
|
+
["path", { d: "m20.7 16.8 1-.4", key: "19m87a" }],
|
|
281
|
+
["path", { d: "m21.7 19.4-.9-.3", key: "1qgwi9" }],
|
|
282
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
283
|
+
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }]
|
|
284
|
+
];
|
|
285
|
+
const Columns3Cog = createLucideIcon("columns-3-cog", __iconNode$l);
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @license lucide-react v0.525.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
const __iconNode$k = [
|
|
274
296
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
275
297
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
276
298
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
277
299
|
];
|
|
278
|
-
const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$
|
|
300
|
+
const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$k);
|
|
279
301
|
|
|
280
302
|
/**
|
|
281
303
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -285,12 +307,12 @@ const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$d);
|
|
|
285
307
|
*/
|
|
286
308
|
|
|
287
309
|
|
|
288
|
-
const __iconNode$
|
|
310
|
+
const __iconNode$j = [
|
|
289
311
|
["path", { d: "M12 17h.01", key: "p32p05" }],
|
|
290
312
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }],
|
|
291
313
|
["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
|
|
292
314
|
];
|
|
293
|
-
const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$
|
|
315
|
+
const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$j);
|
|
294
316
|
|
|
295
317
|
/**
|
|
296
318
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -300,7 +322,42 @@ const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$c);
|
|
|
300
322
|
*/
|
|
301
323
|
|
|
302
324
|
|
|
303
|
-
const __iconNode$
|
|
325
|
+
const __iconNode$i = [
|
|
326
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
327
|
+
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
328
|
+
["path", { d: "M8 13h2", key: "yr2amv" }],
|
|
329
|
+
["path", { d: "M14 13h2", key: "un5t4a" }],
|
|
330
|
+
["path", { d: "M8 17h2", key: "2yhykz" }],
|
|
331
|
+
["path", { d: "M14 17h2", key: "10kma7" }]
|
|
332
|
+
];
|
|
333
|
+
const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$i);
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @license lucide-react v0.525.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
const __iconNode$h = [
|
|
344
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
345
|
+
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
346
|
+
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
347
|
+
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
348
|
+
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
349
|
+
];
|
|
350
|
+
const FileText = createLucideIcon("file-text", __iconNode$h);
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @license lucide-react v0.525.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
const __iconNode$g = [
|
|
304
361
|
[
|
|
305
362
|
"path",
|
|
306
363
|
{
|
|
@@ -309,7 +366,7 @@ const __iconNode$b = [
|
|
|
309
366
|
}
|
|
310
367
|
]
|
|
311
368
|
];
|
|
312
|
-
const Folder = createLucideIcon("folder", __iconNode$
|
|
369
|
+
const Folder = createLucideIcon("folder", __iconNode$g);
|
|
313
370
|
|
|
314
371
|
/**
|
|
315
372
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -319,7 +376,7 @@ const Folder = createLucideIcon("folder", __iconNode$b);
|
|
|
319
376
|
*/
|
|
320
377
|
|
|
321
378
|
|
|
322
|
-
const __iconNode$
|
|
379
|
+
const __iconNode$f = [
|
|
323
380
|
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
324
381
|
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
325
382
|
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
@@ -327,7 +384,7 @@ const __iconNode$a = [
|
|
|
327
384
|
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
328
385
|
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
329
386
|
];
|
|
330
|
-
const GripVertical = createLucideIcon("grip-vertical", __iconNode$
|
|
387
|
+
const GripVertical = createLucideIcon("grip-vertical", __iconNode$f);
|
|
331
388
|
|
|
332
389
|
/**
|
|
333
390
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -337,12 +394,12 @@ const GripVertical = createLucideIcon("grip-vertical", __iconNode$a);
|
|
|
337
394
|
*/
|
|
338
395
|
|
|
339
396
|
|
|
340
|
-
const __iconNode$
|
|
397
|
+
const __iconNode$e = [
|
|
341
398
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
342
399
|
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
343
400
|
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
344
401
|
];
|
|
345
|
-
const Info = createLucideIcon("info", __iconNode$
|
|
402
|
+
const Info = createLucideIcon("info", __iconNode$e);
|
|
346
403
|
|
|
347
404
|
/**
|
|
348
405
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -352,8 +409,12 @@ const Info = createLucideIcon("info", __iconNode$9);
|
|
|
352
409
|
*/
|
|
353
410
|
|
|
354
411
|
|
|
355
|
-
const __iconNode$
|
|
356
|
-
|
|
412
|
+
const __iconNode$d = [
|
|
413
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
414
|
+
["path", { d: "M7 12h10", key: "b7w52i" }],
|
|
415
|
+
["path", { d: "M10 18h4", key: "1ulq68" }]
|
|
416
|
+
];
|
|
417
|
+
const ListFilter = createLucideIcon("list-filter", __iconNode$d);
|
|
357
418
|
|
|
358
419
|
/**
|
|
359
420
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -363,12 +424,23 @@ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$8);
|
|
|
363
424
|
*/
|
|
364
425
|
|
|
365
426
|
|
|
366
|
-
const __iconNode$
|
|
427
|
+
const __iconNode$c = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
428
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$c);
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @license lucide-react v0.525.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
const __iconNode$b = [
|
|
367
439
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
368
440
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
369
441
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
370
442
|
];
|
|
371
|
-
const LogOut = createLucideIcon("log-out", __iconNode$
|
|
443
|
+
const LogOut = createLucideIcon("log-out", __iconNode$b);
|
|
372
444
|
|
|
373
445
|
/**
|
|
374
446
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -378,12 +450,12 @@ const LogOut = createLucideIcon("log-out", __iconNode$7);
|
|
|
378
450
|
*/
|
|
379
451
|
|
|
380
452
|
|
|
381
|
-
const __iconNode$
|
|
453
|
+
const __iconNode$a = [
|
|
382
454
|
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
383
455
|
["path", { d: "M4 18h16", key: "19g7jn" }],
|
|
384
456
|
["path", { d: "M4 6h16", key: "1o0s65" }]
|
|
385
457
|
];
|
|
386
|
-
const Menu = createLucideIcon("menu", __iconNode$
|
|
458
|
+
const Menu = createLucideIcon("menu", __iconNode$a);
|
|
387
459
|
|
|
388
460
|
/**
|
|
389
461
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -393,11 +465,11 @@ const Menu = createLucideIcon("menu", __iconNode$6);
|
|
|
393
465
|
*/
|
|
394
466
|
|
|
395
467
|
|
|
396
|
-
const __iconNode$
|
|
468
|
+
const __iconNode$9 = [
|
|
397
469
|
["path", { d: "M6 8L2 12L6 16", key: "kyvwex" }],
|
|
398
470
|
["path", { d: "M2 12H22", key: "1m8cig" }]
|
|
399
471
|
];
|
|
400
|
-
const MoveLeft = createLucideIcon("move-left", __iconNode$
|
|
472
|
+
const MoveLeft = createLucideIcon("move-left", __iconNode$9);
|
|
401
473
|
|
|
402
474
|
/**
|
|
403
475
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -407,11 +479,62 @@ const MoveLeft = createLucideIcon("move-left", __iconNode$5);
|
|
|
407
479
|
*/
|
|
408
480
|
|
|
409
481
|
|
|
410
|
-
const __iconNode$
|
|
482
|
+
const __iconNode$8 = [
|
|
483
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
484
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
485
|
+
];
|
|
486
|
+
const Plus = createLucideIcon("plus", __iconNode$8);
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* @license lucide-react v0.525.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
const __iconNode$7 = [
|
|
497
|
+
[
|
|
498
|
+
"path",
|
|
499
|
+
{
|
|
500
|
+
d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",
|
|
501
|
+
key: "143wyd"
|
|
502
|
+
}
|
|
503
|
+
],
|
|
504
|
+
["path", { d: "M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6", key: "1itne7" }],
|
|
505
|
+
["rect", { x: "6", y: "14", width: "12", height: "8", rx: "1", key: "1ue0tg" }]
|
|
506
|
+
];
|
|
507
|
+
const Printer = createLucideIcon("printer", __iconNode$7);
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @license lucide-react v0.525.0 - ISC
|
|
511
|
+
*
|
|
512
|
+
* This source code is licensed under the ISC license.
|
|
513
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
+
*/
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
const __iconNode$6 = [
|
|
518
|
+
["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
|
|
519
|
+
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
520
|
+
["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
|
|
521
|
+
["path", { d: "M16 16h5v5", key: "ccwih5" }]
|
|
522
|
+
];
|
|
523
|
+
const RefreshCcw = createLucideIcon("refresh-ccw", __iconNode$6);
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* @license lucide-react v0.525.0 - ISC
|
|
527
|
+
*
|
|
528
|
+
* This source code is licensed under the ISC license.
|
|
529
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
+
*/
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
const __iconNode$5 = [
|
|
411
534
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
412
535
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
413
536
|
];
|
|
414
|
-
const Search = createLucideIcon("search", __iconNode$
|
|
537
|
+
const Search = createLucideIcon("search", __iconNode$5);
|
|
415
538
|
|
|
416
539
|
/**
|
|
417
540
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -421,14 +544,29 @@ const Search = createLucideIcon("search", __iconNode$4);
|
|
|
421
544
|
*/
|
|
422
545
|
|
|
423
546
|
|
|
424
|
-
const __iconNode$
|
|
547
|
+
const __iconNode$4 = [
|
|
425
548
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
426
549
|
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
427
550
|
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
428
551
|
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
429
552
|
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
430
553
|
];
|
|
431
|
-
const Trash2 = createLucideIcon("trash-2", __iconNode$
|
|
554
|
+
const Trash2 = createLucideIcon("trash-2", __iconNode$4);
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @license lucide-react v0.525.0 - ISC
|
|
558
|
+
*
|
|
559
|
+
* This source code is licensed under the ISC license.
|
|
560
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
561
|
+
*/
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
const __iconNode$3 = [
|
|
565
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
566
|
+
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
567
|
+
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
|
|
568
|
+
];
|
|
569
|
+
const Trash = createLucideIcon("trash", __iconNode$3);
|
|
432
570
|
|
|
433
571
|
/**
|
|
434
572
|
* @license lucide-react v0.525.0 - ISC
|
|
@@ -680,7 +818,7 @@ const Avatar = ({
|
|
|
680
818
|
showIcon && /* @__PURE__ */ jsx("span", { className: "avatar-icon", children: /* @__PURE__ */ jsx(User, {}) })
|
|
681
819
|
] });
|
|
682
820
|
};
|
|
683
|
-
const AvatarGroup = ({ children, max = 4, truncatedMessage = "Members", ...props }) => {
|
|
821
|
+
const AvatarGroup$1 = ({ children, max = 4, truncatedMessage = "Members", ...props }) => {
|
|
684
822
|
const avatars = React__default.Children.toArray(children);
|
|
685
823
|
const visibleAvatars = avatars.slice(0, max);
|
|
686
824
|
const hiddenCount = avatars.length - max;
|
|
@@ -69507,7 +69645,7 @@ const AvatarGroupDisplay = ({
|
|
|
69507
69645
|
"div",
|
|
69508
69646
|
{
|
|
69509
69647
|
className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
|
|
69510
|
-
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: "Not shared with anyone yet
|
|
69648
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: "Not shared with anyone yet....." })
|
|
69511
69649
|
}
|
|
69512
69650
|
);
|
|
69513
69651
|
}
|
|
@@ -69668,9 +69806,9 @@ const InviteFlow = ({
|
|
|
69668
69806
|
case ADD_USERS_GROUPS_ROLES_MODAL.INTEREST:
|
|
69669
69807
|
return "Add Audience";
|
|
69670
69808
|
case ADD_USERS_GROUPS_ROLES_MODAL.ARTICLE:
|
|
69671
|
-
return "Add Users, Groups or Roles";
|
|
69809
|
+
return "Add Users, Groups or Roles test";
|
|
69672
69810
|
default:
|
|
69673
|
-
return "Add User, Groups or Roles";
|
|
69811
|
+
return "Add User, Groups or Roles test";
|
|
69674
69812
|
}
|
|
69675
69813
|
};
|
|
69676
69814
|
const isDisabled = useMemo(() => {
|
|
@@ -74992,78 +75130,1629 @@ function TreeView({
|
|
|
74992
75130
|
] });
|
|
74993
75131
|
}
|
|
74994
75132
|
|
|
74995
|
-
|
|
74996
|
-
|
|
74997
|
-
|
|
74998
|
-
|
|
74999
|
-
|
|
75000
|
-
|
|
75001
|
-
|
|
75002
|
-
|
|
75003
|
-
|
|
75004
|
-
|
|
75005
|
-
|
|
75006
|
-
|
|
75007
|
-
|
|
75008
|
-
|
|
75009
|
-
|
|
75010
|
-
|
|
75011
|
-
|
|
75012
|
-
|
|
75013
|
-
|
|
75014
|
-
|
|
75015
|
-
|
|
75016
|
-
|
|
75017
|
-
|
|
75018
|
-
|
|
75019
|
-
|
|
75020
|
-
|
|
75021
|
-
|
|
75022
|
-
|
|
75023
|
-
|
|
75024
|
-
|
|
75025
|
-
|
|
75026
|
-
|
|
75027
|
-
|
|
75028
|
-
|
|
75029
|
-
|
|
75030
|
-
|
|
75031
|
-
|
|
75032
|
-
|
|
75033
|
-
|
|
75034
|
-
|
|
75035
|
-
|
|
75036
|
-
"
|
|
75037
|
-
|
|
75038
|
-
|
|
75039
|
-
|
|
75040
|
-
|
|
75041
|
-
|
|
75042
|
-
|
|
75043
|
-
|
|
75044
|
-
|
|
75045
|
-
|
|
75046
|
-
|
|
75047
|
-
|
|
75048
|
-
|
|
75049
|
-
|
|
75050
|
-
|
|
75051
|
-
data: value,
|
|
75052
|
-
onReady: (editor) => {
|
|
75053
|
-
if (mergedConfig.height) {
|
|
75054
|
-
editor.ui.view.editable.element.style.minHeight = mergedConfig.height;
|
|
75133
|
+
function SectionRenderer({ item, data: initialData, updateHandler, validationErrors = {} }) {
|
|
75134
|
+
console.log(item);
|
|
75135
|
+
const [section, setSection] = React__default.useState(item);
|
|
75136
|
+
const [data, setData] = React__default.useState(() => {
|
|
75137
|
+
const sectionData = initialData && initialData[item.key] || {};
|
|
75138
|
+
console.log("Initial Section data for", item.key, sectionData);
|
|
75139
|
+
return sectionData;
|
|
75140
|
+
});
|
|
75141
|
+
const prevInitialDataRef = useRef(initialData);
|
|
75142
|
+
useEffect(() => {
|
|
75143
|
+
if (prevInitialDataRef.current !== initialData) {
|
|
75144
|
+
prevInitialDataRef.current = initialData;
|
|
75145
|
+
const sectionData = initialData && initialData[item.key] || {};
|
|
75146
|
+
console.log("Updated Section data for", item.key, sectionData);
|
|
75147
|
+
setData(sectionData);
|
|
75148
|
+
}
|
|
75149
|
+
}, [initialData, item.key]);
|
|
75150
|
+
console.log("Section data", data);
|
|
75151
|
+
const prevDataRef = useRef(data);
|
|
75152
|
+
useEffect(() => {
|
|
75153
|
+
if (prevDataRef.current !== data && updateHandler && typeof updateHandler === "function") {
|
|
75154
|
+
prevDataRef.current = data;
|
|
75155
|
+
updateHandler(section.key, data);
|
|
75156
|
+
}
|
|
75157
|
+
}, [section.key, data, updateHandler]);
|
|
75158
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
|
|
75159
|
+
/* @__PURE__ */ jsxs(
|
|
75160
|
+
"h2",
|
|
75161
|
+
{
|
|
75162
|
+
style: {
|
|
75163
|
+
fontSize: "20px",
|
|
75164
|
+
fontWeight: "bold",
|
|
75165
|
+
marginBottom: "10px"
|
|
75166
|
+
},
|
|
75167
|
+
children: [
|
|
75168
|
+
section.title,
|
|
75169
|
+
" - ",
|
|
75170
|
+
section.type
|
|
75171
|
+
]
|
|
75172
|
+
}
|
|
75173
|
+
),
|
|
75174
|
+
/* @__PURE__ */ jsx("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: section.description }),
|
|
75175
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: section.fields.map((field, idx) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: "10px" }, children: [
|
|
75176
|
+
/* @__PURE__ */ jsxs(
|
|
75177
|
+
"label",
|
|
75178
|
+
{
|
|
75179
|
+
style: {
|
|
75180
|
+
display: "block",
|
|
75181
|
+
fontWeight: "600",
|
|
75182
|
+
marginBottom: "5px"
|
|
75183
|
+
},
|
|
75184
|
+
children: [
|
|
75185
|
+
field.label,
|
|
75186
|
+
" ",
|
|
75187
|
+
field.required && /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
|
|
75188
|
+
]
|
|
75055
75189
|
}
|
|
75056
|
-
|
|
75057
|
-
|
|
75190
|
+
),
|
|
75191
|
+
field.fieldtype === "text" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75192
|
+
/* @__PURE__ */ jsx(
|
|
75193
|
+
Input,
|
|
75194
|
+
{
|
|
75195
|
+
type: "text",
|
|
75196
|
+
name: field.key,
|
|
75197
|
+
defaultValue: field.default,
|
|
75198
|
+
placeholder: field.placeholder,
|
|
75199
|
+
value: data[field.key] || "",
|
|
75200
|
+
onChange: (e) => {
|
|
75201
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75202
|
+
setData(newData);
|
|
75203
|
+
if (updateHandler) {
|
|
75204
|
+
updateHandler(section.key, newData);
|
|
75205
|
+
}
|
|
75206
|
+
},
|
|
75207
|
+
required: field.required,
|
|
75208
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75209
|
+
}
|
|
75210
|
+
),
|
|
75211
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75212
|
+
] }),
|
|
75213
|
+
field.fieldtype === "textarea" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75214
|
+
/* @__PURE__ */ jsx(
|
|
75215
|
+
Textarea,
|
|
75216
|
+
{
|
|
75217
|
+
name: field.key,
|
|
75218
|
+
defaultValue: field.default,
|
|
75219
|
+
placeholder: field.placeholder,
|
|
75220
|
+
value: data[field.key] || "",
|
|
75221
|
+
onChange: (e) => {
|
|
75222
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75223
|
+
setData(newData);
|
|
75224
|
+
if (updateHandler) {
|
|
75225
|
+
updateHandler(section.key, newData);
|
|
75226
|
+
}
|
|
75227
|
+
},
|
|
75228
|
+
rows: 3,
|
|
75229
|
+
required: field.required,
|
|
75230
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75231
|
+
}
|
|
75232
|
+
),
|
|
75233
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75234
|
+
] }),
|
|
75235
|
+
field.fieldtype === "number" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75236
|
+
/* @__PURE__ */ jsx(
|
|
75237
|
+
Input,
|
|
75238
|
+
{
|
|
75239
|
+
type: "number",
|
|
75240
|
+
name: field.key,
|
|
75241
|
+
defaultValue: field.default,
|
|
75242
|
+
placeholder: field.placeholder,
|
|
75243
|
+
value: data[field.key] || "",
|
|
75244
|
+
onChange: (e) => {
|
|
75245
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75246
|
+
setData(newData);
|
|
75247
|
+
if (updateHandler) {
|
|
75248
|
+
updateHandler(section.key, newData);
|
|
75249
|
+
}
|
|
75250
|
+
},
|
|
75251
|
+
required: field.required,
|
|
75252
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75253
|
+
}
|
|
75254
|
+
),
|
|
75255
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75256
|
+
] }),
|
|
75257
|
+
field.fieldtype === "checkbox" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75258
|
+
/* @__PURE__ */ jsx(
|
|
75259
|
+
Checkbox,
|
|
75260
|
+
{
|
|
75261
|
+
name: field.key,
|
|
75262
|
+
checked: Boolean(data[field.key] || field.default),
|
|
75263
|
+
onChange: (checked) => {
|
|
75264
|
+
const newData = { ...data, [field.key]: checked };
|
|
75265
|
+
setData(newData);
|
|
75266
|
+
if (updateHandler) {
|
|
75267
|
+
updateHandler(section.key, newData);
|
|
75268
|
+
}
|
|
75269
|
+
},
|
|
75270
|
+
label: field.placeholder || field.label,
|
|
75271
|
+
className: "w-full"
|
|
75272
|
+
}
|
|
75273
|
+
),
|
|
75274
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75275
|
+
] }),
|
|
75276
|
+
field.fieldtype === "select" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75277
|
+
/* @__PURE__ */ jsx(
|
|
75278
|
+
Select,
|
|
75279
|
+
{
|
|
75280
|
+
name: field.key,
|
|
75281
|
+
defaultValue: field.default,
|
|
75282
|
+
value: data[field.key] || "",
|
|
75283
|
+
onChange: (value) => {
|
|
75284
|
+
const newData = { ...data, [field.key]: value };
|
|
75285
|
+
setData(newData);
|
|
75286
|
+
if (updateHandler) {
|
|
75287
|
+
updateHandler(section.key, newData);
|
|
75288
|
+
}
|
|
75289
|
+
},
|
|
75290
|
+
options: field.options || [],
|
|
75291
|
+
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75292
|
+
required: field.required,
|
|
75293
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75294
|
+
}
|
|
75295
|
+
),
|
|
75296
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75297
|
+
] }),
|
|
75298
|
+
field.fieldtype === "email" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75299
|
+
/* @__PURE__ */ jsx(
|
|
75300
|
+
Input,
|
|
75301
|
+
{
|
|
75302
|
+
type: "email",
|
|
75303
|
+
name: field.key,
|
|
75304
|
+
defaultValue: field.default,
|
|
75305
|
+
placeholder: field.placeholder || "Enter email address",
|
|
75306
|
+
value: data[field.key] || "",
|
|
75307
|
+
onChange: (e) => {
|
|
75308
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75309
|
+
setData(newData);
|
|
75310
|
+
if (updateHandler) {
|
|
75311
|
+
updateHandler(section.key, newData);
|
|
75312
|
+
}
|
|
75313
|
+
},
|
|
75314
|
+
required: field.required,
|
|
75315
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75316
|
+
}
|
|
75317
|
+
),
|
|
75318
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75319
|
+
] }),
|
|
75320
|
+
field.fieldtype === "url" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75321
|
+
/* @__PURE__ */ jsx(
|
|
75322
|
+
Input,
|
|
75323
|
+
{
|
|
75324
|
+
type: "url",
|
|
75325
|
+
name: field.key,
|
|
75326
|
+
defaultValue: field.default,
|
|
75327
|
+
placeholder: field.placeholder || "Enter URL",
|
|
75328
|
+
value: data[field.key] || "",
|
|
75329
|
+
onChange: (e) => {
|
|
75330
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75331
|
+
setData(newData);
|
|
75332
|
+
if (updateHandler) {
|
|
75333
|
+
updateHandler(section.key, newData);
|
|
75334
|
+
}
|
|
75335
|
+
},
|
|
75336
|
+
required: field.required,
|
|
75337
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75338
|
+
}
|
|
75339
|
+
),
|
|
75340
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75341
|
+
] }),
|
|
75342
|
+
field.fieldtype === "password" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75343
|
+
/* @__PURE__ */ jsx(
|
|
75344
|
+
Input,
|
|
75345
|
+
{
|
|
75346
|
+
type: "password",
|
|
75347
|
+
name: field.key,
|
|
75348
|
+
defaultValue: field.default,
|
|
75349
|
+
placeholder: field.placeholder || "Enter password",
|
|
75350
|
+
value: data[field.key] || "",
|
|
75351
|
+
onChange: (e) => {
|
|
75352
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75353
|
+
setData(newData);
|
|
75354
|
+
if (updateHandler) {
|
|
75355
|
+
updateHandler(section.key, newData);
|
|
75356
|
+
}
|
|
75357
|
+
},
|
|
75358
|
+
required: field.required,
|
|
75359
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75360
|
+
}
|
|
75361
|
+
),
|
|
75362
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75363
|
+
] }),
|
|
75364
|
+
field.fieldtype === "multiselect" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75365
|
+
/* @__PURE__ */ jsx(
|
|
75366
|
+
MultiSelect,
|
|
75367
|
+
{
|
|
75368
|
+
selectedItems: data[field.key] || [],
|
|
75369
|
+
onSelectionChange: (selectedItems) => {
|
|
75370
|
+
const newData = { ...data, [field.key]: selectedItems };
|
|
75371
|
+
setData(newData);
|
|
75372
|
+
if (updateHandler) {
|
|
75373
|
+
updateHandler(section.key, newData);
|
|
75374
|
+
}
|
|
75375
|
+
},
|
|
75376
|
+
options: field.options || [],
|
|
75377
|
+
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75378
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75379
|
+
}
|
|
75380
|
+
),
|
|
75381
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75382
|
+
] }),
|
|
75383
|
+
field.fieldtype === "toggle" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75384
|
+
/* @__PURE__ */ jsx(
|
|
75385
|
+
ToggleSwitch,
|
|
75386
|
+
{
|
|
75387
|
+
checked: Boolean(data[field.key] || field.default),
|
|
75388
|
+
onChange: (isOn) => {
|
|
75389
|
+
console.log("Toggle changed:", field.key, isOn);
|
|
75390
|
+
const newData = { ...data, [field.key]: isOn };
|
|
75391
|
+
setData(newData);
|
|
75392
|
+
if (updateHandler) {
|
|
75393
|
+
updateHandler(section.key, newData);
|
|
75394
|
+
}
|
|
75395
|
+
},
|
|
75396
|
+
label: field.placeholder || field.label
|
|
75397
|
+
}
|
|
75398
|
+
),
|
|
75399
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75400
|
+
] }),
|
|
75401
|
+
field.fieldtype === "date" && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
75402
|
+
DatePicker,
|
|
75403
|
+
{
|
|
75404
|
+
label: field.label,
|
|
75405
|
+
value: data[field.key] ? new Date(data[field.key]) : null,
|
|
75406
|
+
onChange: (date) => {
|
|
75407
|
+
const newData = { ...data, [field.key]: date ? date.toISOString().split("T")[0] : "" };
|
|
75408
|
+
setData(newData);
|
|
75409
|
+
if (updateHandler) {
|
|
75410
|
+
updateHandler(section.key, newData);
|
|
75411
|
+
}
|
|
75412
|
+
},
|
|
75413
|
+
placeholder: field.placeholder || "Select date",
|
|
75414
|
+
error: validationErrors[section.key]?.[field.key],
|
|
75415
|
+
className: "w-full"
|
|
75416
|
+
}
|
|
75417
|
+
) }),
|
|
75418
|
+
field.fieldtype === "daterange" && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
75419
|
+
DateRangePicker$1,
|
|
75420
|
+
{
|
|
75421
|
+
label: field.label,
|
|
75422
|
+
value: data[field.key] || { from: null, to: null },
|
|
75423
|
+
onChange: (dateRange) => {
|
|
75424
|
+
const newData = { ...data, [field.key]: dateRange };
|
|
75425
|
+
setData(newData);
|
|
75426
|
+
if (updateHandler) {
|
|
75427
|
+
updateHandler(section.key, newData);
|
|
75428
|
+
}
|
|
75429
|
+
},
|
|
75430
|
+
placeholder: field.placeholder || "Select date range",
|
|
75431
|
+
error: validationErrors[section.key]?.[field.key],
|
|
75432
|
+
className: "w-full"
|
|
75433
|
+
}
|
|
75434
|
+
) }),
|
|
75435
|
+
field.fieldtype === "radio" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75436
|
+
/* @__PURE__ */ jsx(
|
|
75437
|
+
RadioGroup,
|
|
75438
|
+
{
|
|
75439
|
+
selectedValue: data[field.key] || "",
|
|
75440
|
+
onValueChange: (value) => {
|
|
75441
|
+
const newData = { ...data, [field.key]: value };
|
|
75442
|
+
setData(newData);
|
|
75443
|
+
if (updateHandler) {
|
|
75444
|
+
updateHandler(section.key, newData);
|
|
75445
|
+
}
|
|
75446
|
+
},
|
|
75447
|
+
options: field.options || [],
|
|
75448
|
+
className: "w-full"
|
|
75449
|
+
}
|
|
75450
|
+
),
|
|
75451
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75452
|
+
] }),
|
|
75453
|
+
field.fieldtype === "search" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75454
|
+
/* @__PURE__ */ jsx(
|
|
75455
|
+
SearchBar,
|
|
75456
|
+
{
|
|
75457
|
+
value: data[field.key] || "",
|
|
75458
|
+
onChange: (value) => {
|
|
75459
|
+
const newData = { ...data, [field.key]: value };
|
|
75460
|
+
setData(newData);
|
|
75461
|
+
if (updateHandler) {
|
|
75462
|
+
updateHandler(section.key, newData);
|
|
75463
|
+
}
|
|
75464
|
+
},
|
|
75465
|
+
placeholder: field.placeholder || `Search ${field.label}`,
|
|
75466
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75467
|
+
}
|
|
75468
|
+
),
|
|
75469
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75470
|
+
] }),
|
|
75471
|
+
(field.fieldtype === "datetime" || field.fieldtype === "datetime-local") && /* @__PURE__ */ jsxs("div", { children: [
|
|
75472
|
+
/* @__PURE__ */ jsx(
|
|
75473
|
+
Input,
|
|
75474
|
+
{
|
|
75475
|
+
type: "datetime-local",
|
|
75476
|
+
name: field.key,
|
|
75477
|
+
defaultValue: field.default,
|
|
75478
|
+
placeholder: field.placeholder || "Select date and time",
|
|
75479
|
+
value: data[field.key] || "",
|
|
75480
|
+
onChange: (e) => {
|
|
75481
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75482
|
+
setData(newData);
|
|
75483
|
+
if (updateHandler) {
|
|
75484
|
+
updateHandler(section.key, newData);
|
|
75485
|
+
}
|
|
75486
|
+
},
|
|
75487
|
+
required: field.required,
|
|
75488
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75489
|
+
}
|
|
75490
|
+
),
|
|
75491
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75492
|
+
] }),
|
|
75493
|
+
field.fieldtype === "time" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75494
|
+
/* @__PURE__ */ jsx(
|
|
75495
|
+
Input,
|
|
75496
|
+
{
|
|
75497
|
+
type: "time",
|
|
75498
|
+
name: field.key,
|
|
75499
|
+
defaultValue: field.default,
|
|
75500
|
+
placeholder: field.placeholder || "Select time",
|
|
75501
|
+
value: data[field.key] || "",
|
|
75502
|
+
onChange: (e) => {
|
|
75503
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75504
|
+
setData(newData);
|
|
75505
|
+
if (updateHandler) {
|
|
75506
|
+
updateHandler(section.key, newData);
|
|
75507
|
+
}
|
|
75508
|
+
},
|
|
75509
|
+
required: field.required,
|
|
75510
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75511
|
+
}
|
|
75512
|
+
),
|
|
75513
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75514
|
+
] }),
|
|
75515
|
+
field.fieldtype === "color" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75516
|
+
/* @__PURE__ */ jsx(
|
|
75517
|
+
Input,
|
|
75518
|
+
{
|
|
75519
|
+
type: "color",
|
|
75520
|
+
name: field.key,
|
|
75521
|
+
defaultValue: field.default || "#000000",
|
|
75522
|
+
value: data[field.key] || "#000000",
|
|
75523
|
+
onChange: (e) => {
|
|
75524
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75525
|
+
setData(newData);
|
|
75526
|
+
if (updateHandler) {
|
|
75527
|
+
updateHandler(section.key, newData);
|
|
75528
|
+
}
|
|
75529
|
+
},
|
|
75530
|
+
className: `w-full h-10 ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75531
|
+
}
|
|
75532
|
+
),
|
|
75533
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75534
|
+
] }),
|
|
75535
|
+
field.fieldtype === "range" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75536
|
+
/* @__PURE__ */ jsx(
|
|
75537
|
+
Input,
|
|
75538
|
+
{
|
|
75539
|
+
type: "range",
|
|
75540
|
+
name: field.key,
|
|
75541
|
+
defaultValue: field.default || field.min || 0,
|
|
75542
|
+
value: data[field.key] || field.min || 0,
|
|
75543
|
+
onChange: (e) => {
|
|
75544
|
+
const newData = { ...data, [field.key]: e.target.value };
|
|
75545
|
+
setData(newData);
|
|
75546
|
+
if (updateHandler) {
|
|
75547
|
+
updateHandler(section.key, newData);
|
|
75548
|
+
}
|
|
75549
|
+
},
|
|
75550
|
+
min: field.min || 0,
|
|
75551
|
+
max: field.max || 100,
|
|
75552
|
+
step: field.step || 1,
|
|
75553
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75554
|
+
}
|
|
75555
|
+
),
|
|
75556
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm text-gray-500 mt-1", children: [
|
|
75557
|
+
/* @__PURE__ */ jsx("span", { children: field.min || 0 }),
|
|
75558
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
75559
|
+
"Current: ",
|
|
75560
|
+
data[field.key] || field.min || 0
|
|
75561
|
+
] }),
|
|
75562
|
+
/* @__PURE__ */ jsx("span", { children: field.max || 100 })
|
|
75563
|
+
] }),
|
|
75564
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75565
|
+
] }),
|
|
75566
|
+
field.fieldtype === "file" && /* @__PURE__ */ jsxs("div", { children: [
|
|
75567
|
+
/* @__PURE__ */ jsx(
|
|
75568
|
+
Input,
|
|
75569
|
+
{
|
|
75570
|
+
type: "file",
|
|
75571
|
+
name: field.key,
|
|
75572
|
+
onChange: (e) => {
|
|
75573
|
+
const file = e.target.files[0];
|
|
75574
|
+
const newData = { ...data, [field.key]: file ? file.name : "" };
|
|
75575
|
+
setData(newData);
|
|
75576
|
+
if (updateHandler) {
|
|
75577
|
+
updateHandler(section.key, newData);
|
|
75578
|
+
}
|
|
75579
|
+
},
|
|
75580
|
+
accept: field.accept,
|
|
75581
|
+
className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
|
|
75582
|
+
}
|
|
75583
|
+
),
|
|
75584
|
+
validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
|
|
75585
|
+
] }),
|
|
75586
|
+
field.info && /* @__PURE__ */ jsx(
|
|
75587
|
+
"p",
|
|
75588
|
+
{
|
|
75589
|
+
style: {
|
|
75590
|
+
fontSize: "12px",
|
|
75591
|
+
color: "#666",
|
|
75592
|
+
marginTop: "5px"
|
|
75593
|
+
},
|
|
75594
|
+
children: field.info
|
|
75595
|
+
}
|
|
75596
|
+
)
|
|
75597
|
+
] }, idx)) })
|
|
75598
|
+
] }) });
|
|
75599
|
+
}
|
|
75600
|
+
|
|
75601
|
+
const AvatarGroup = ({ children }) => /* @__PURE__ */ jsx("div", { className: "flex -space-x-2", children });
|
|
75602
|
+
function DataTableRenderer({ item, data: initialData, updateHandler, validationErrors = {} }) {
|
|
75603
|
+
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${item.key}`);
|
|
75604
|
+
const [section, setSection] = useState(item);
|
|
75605
|
+
const [audienceRowId, setAudienceRowId] = useState(null);
|
|
75606
|
+
const [audienceFieldName, setAudienceFieldName] = useState(null);
|
|
75607
|
+
console.log(`[DataTableRenderer] ${section.key} - Received props:`, { item, initialData });
|
|
75608
|
+
const [data, setData] = useState(() => {
|
|
75609
|
+
const existingData = initialData && initialData[section.key] || [];
|
|
75610
|
+
const result = existingData.length > 0 ? existingData : [{ id: 0 }];
|
|
75611
|
+
console.log(`[DataTableRenderer] ${section.key} - Initial data:`, result);
|
|
75612
|
+
return result;
|
|
75613
|
+
});
|
|
75614
|
+
const prevInitialDataRef = useRef(initialData);
|
|
75615
|
+
useEffect(() => {
|
|
75616
|
+
console.log(`[DataTableRenderer] ${section.key} - Checking for initialData changes`);
|
|
75617
|
+
console.log(`[DataTableRenderer] ${section.key} - Previous:`, prevInitialDataRef.current);
|
|
75618
|
+
console.log(`[DataTableRenderer] ${section.key} - Current:`, initialData);
|
|
75619
|
+
if (prevInitialDataRef.current !== initialData) {
|
|
75620
|
+
prevInitialDataRef.current = initialData;
|
|
75621
|
+
const existingData = initialData && initialData[section.key] || [];
|
|
75622
|
+
const newData = existingData.length > 0 ? existingData : [{ id: 0 }];
|
|
75623
|
+
console.log(`[DataTableRenderer] ${section.key} - Setting new data:`, newData);
|
|
75624
|
+
setData(newData);
|
|
75625
|
+
}
|
|
75626
|
+
}, [initialData, section.key]);
|
|
75627
|
+
const prevDataRef = useRef(data);
|
|
75628
|
+
const updateTimeoutRef = useRef(null);
|
|
75629
|
+
useEffect(() => {
|
|
75630
|
+
if (prevDataRef.current !== data && updateHandler && typeof updateHandler === "function") {
|
|
75631
|
+
prevDataRef.current = data;
|
|
75632
|
+
if (updateTimeoutRef.current) {
|
|
75633
|
+
clearTimeout(updateTimeoutRef.current);
|
|
75634
|
+
}
|
|
75635
|
+
updateTimeoutRef.current = setTimeout(() => {
|
|
75636
|
+
updateHandler(section.key, data);
|
|
75637
|
+
}, 300);
|
|
75058
75638
|
}
|
|
75059
|
-
);
|
|
75060
|
-
|
|
75639
|
+
}, [section.key, data, updateHandler]);
|
|
75640
|
+
useEffect(() => {
|
|
75641
|
+
return () => {
|
|
75642
|
+
if (updateTimeoutRef.current) {
|
|
75643
|
+
clearTimeout(updateTimeoutRef.current);
|
|
75644
|
+
}
|
|
75645
|
+
};
|
|
75646
|
+
}, []);
|
|
75647
|
+
const getFieldRenderer = (field) => {
|
|
75648
|
+
const updateFieldValue = (rowIndex, value) => {
|
|
75649
|
+
console.log(`[DataTableRenderer] updateFieldValue called with:`, { rowIndex, value, type: typeof value });
|
|
75650
|
+
setData((prevData) => {
|
|
75651
|
+
const newData = [...prevData];
|
|
75652
|
+
newData[rowIndex][field.key] = value;
|
|
75653
|
+
return newData;
|
|
75654
|
+
});
|
|
75655
|
+
};
|
|
75656
|
+
const getFieldError = (rowIndex) => {
|
|
75657
|
+
return validationErrors[section.key]?.[rowIndex]?.[field.key];
|
|
75658
|
+
};
|
|
75659
|
+
const renderError = (rowIndex) => {
|
|
75660
|
+
const error = getFieldError(rowIndex);
|
|
75661
|
+
return error ? /* @__PURE__ */ jsx("div", { className: "text-red-500 text-xs mt-1", children: error }) : null;
|
|
75662
|
+
};
|
|
75663
|
+
switch (field.fieldtype) {
|
|
75664
|
+
case "text":
|
|
75665
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75666
|
+
/* @__PURE__ */ jsx(
|
|
75667
|
+
Input,
|
|
75668
|
+
{
|
|
75669
|
+
value: props[field.key] || "",
|
|
75670
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75671
|
+
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75672
|
+
required: field.required,
|
|
75673
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75674
|
+
}
|
|
75675
|
+
),
|
|
75676
|
+
renderError(rowIndex)
|
|
75677
|
+
] });
|
|
75678
|
+
case "textarea":
|
|
75679
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75680
|
+
/* @__PURE__ */ jsx(
|
|
75681
|
+
Textarea,
|
|
75682
|
+
{
|
|
75683
|
+
value: props[field.key] || "",
|
|
75684
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75685
|
+
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75686
|
+
required: field.required,
|
|
75687
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`,
|
|
75688
|
+
rows: 3
|
|
75689
|
+
}
|
|
75690
|
+
),
|
|
75691
|
+
renderError(rowIndex)
|
|
75692
|
+
] });
|
|
75693
|
+
case "number":
|
|
75694
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75695
|
+
/* @__PURE__ */ jsx(
|
|
75696
|
+
Input,
|
|
75697
|
+
{
|
|
75698
|
+
type: "number",
|
|
75699
|
+
value: props[field.key] || "",
|
|
75700
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75701
|
+
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75702
|
+
required: field.required,
|
|
75703
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75704
|
+
}
|
|
75705
|
+
),
|
|
75706
|
+
renderError(rowIndex)
|
|
75707
|
+
] });
|
|
75708
|
+
case "email":
|
|
75709
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75710
|
+
/* @__PURE__ */ jsx(
|
|
75711
|
+
Input,
|
|
75712
|
+
{
|
|
75713
|
+
type: "email",
|
|
75714
|
+
value: props[field.key] || "",
|
|
75715
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75716
|
+
placeholder: field.placeholder || "Enter email address",
|
|
75717
|
+
required: field.required,
|
|
75718
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75719
|
+
}
|
|
75720
|
+
),
|
|
75721
|
+
renderError(rowIndex)
|
|
75722
|
+
] });
|
|
75723
|
+
case "url":
|
|
75724
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75725
|
+
/* @__PURE__ */ jsx(
|
|
75726
|
+
Input,
|
|
75727
|
+
{
|
|
75728
|
+
type: "url",
|
|
75729
|
+
value: props[field.key] || "",
|
|
75730
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75731
|
+
placeholder: field.placeholder || "Enter URL",
|
|
75732
|
+
required: field.required,
|
|
75733
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75734
|
+
}
|
|
75735
|
+
),
|
|
75736
|
+
renderError(rowIndex)
|
|
75737
|
+
] });
|
|
75738
|
+
case "password":
|
|
75739
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75740
|
+
/* @__PURE__ */ jsx(
|
|
75741
|
+
Input,
|
|
75742
|
+
{
|
|
75743
|
+
type: "password",
|
|
75744
|
+
value: props[field.key] || "",
|
|
75745
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75746
|
+
placeholder: field.placeholder || "Enter password",
|
|
75747
|
+
required: field.required,
|
|
75748
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75749
|
+
}
|
|
75750
|
+
),
|
|
75751
|
+
renderError(rowIndex)
|
|
75752
|
+
] });
|
|
75753
|
+
case "select":
|
|
75754
|
+
case "dropdown":
|
|
75755
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75756
|
+
/* @__PURE__ */ jsx(
|
|
75757
|
+
Select,
|
|
75758
|
+
{
|
|
75759
|
+
value: props[field.key] || "",
|
|
75760
|
+
onChange: (value) => updateFieldValue(rowIndex, value),
|
|
75761
|
+
options: field.options || [],
|
|
75762
|
+
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75763
|
+
required: field.required,
|
|
75764
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75765
|
+
}
|
|
75766
|
+
),
|
|
75767
|
+
renderError(rowIndex)
|
|
75768
|
+
] });
|
|
75769
|
+
case "multiselect":
|
|
75770
|
+
return (props, rowIndex) => {
|
|
75771
|
+
const currentValue = props[field.key] || [];
|
|
75772
|
+
return /* @__PURE__ */ jsx(
|
|
75773
|
+
MultiSelect,
|
|
75774
|
+
{
|
|
75775
|
+
selectedItems: currentValue,
|
|
75776
|
+
onSelectionChange: (selectedItems) => updateFieldValue(rowIndex, selectedItems),
|
|
75777
|
+
options: field.options || [],
|
|
75778
|
+
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75779
|
+
className: "w-full"
|
|
75780
|
+
}
|
|
75781
|
+
);
|
|
75782
|
+
};
|
|
75783
|
+
case "checkbox":
|
|
75784
|
+
case "boolean":
|
|
75785
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75786
|
+
Checkbox,
|
|
75787
|
+
{
|
|
75788
|
+
checked: Boolean(props[field.key]),
|
|
75789
|
+
onChange: (checked) => updateFieldValue(rowIndex, checked),
|
|
75790
|
+
label: field.placeholder || field.label,
|
|
75791
|
+
className: "w-full"
|
|
75792
|
+
}
|
|
75793
|
+
);
|
|
75794
|
+
case "toggle":
|
|
75795
|
+
case "switch":
|
|
75796
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75797
|
+
ToggleSwitch,
|
|
75798
|
+
{
|
|
75799
|
+
isOn: Boolean(props[field.key]),
|
|
75800
|
+
onToggle: (isOn) => updateFieldValue(rowIndex, isOn),
|
|
75801
|
+
label: field.placeholder || field.label,
|
|
75802
|
+
className: "w-full"
|
|
75803
|
+
}
|
|
75804
|
+
);
|
|
75805
|
+
case "date":
|
|
75806
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75807
|
+
DatePicker,
|
|
75808
|
+
{
|
|
75809
|
+
selectedDate: props[field.key] ? new Date(props[field.key]) : null,
|
|
75810
|
+
onDateChange: (date) => updateFieldValue(rowIndex, date ? date.toISOString().split("T")[0] : ""),
|
|
75811
|
+
placeholder: field.placeholder || "Select date",
|
|
75812
|
+
className: "w-full"
|
|
75813
|
+
}
|
|
75814
|
+
);
|
|
75815
|
+
case "datetime":
|
|
75816
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75817
|
+
Input,
|
|
75818
|
+
{
|
|
75819
|
+
type: "datetime-local",
|
|
75820
|
+
value: props[field.key] || "",
|
|
75821
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75822
|
+
placeholder: field.placeholder || "Select date and time",
|
|
75823
|
+
required: field.required,
|
|
75824
|
+
className: "w-full"
|
|
75825
|
+
}
|
|
75826
|
+
);
|
|
75827
|
+
case "time":
|
|
75828
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75829
|
+
Input,
|
|
75830
|
+
{
|
|
75831
|
+
type: "time",
|
|
75832
|
+
value: props[field.key] || "",
|
|
75833
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75834
|
+
placeholder: field.placeholder || "Select time",
|
|
75835
|
+
required: field.required,
|
|
75836
|
+
className: "w-full"
|
|
75837
|
+
}
|
|
75838
|
+
);
|
|
75839
|
+
case "radio":
|
|
75840
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75841
|
+
RadioGroup,
|
|
75842
|
+
{
|
|
75843
|
+
selectedValue: props[field.key] || "",
|
|
75844
|
+
onValueChange: (value) => updateFieldValue(rowIndex, value),
|
|
75845
|
+
options: field.options || [],
|
|
75846
|
+
className: "w-full"
|
|
75847
|
+
}
|
|
75848
|
+
);
|
|
75849
|
+
case "search":
|
|
75850
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75851
|
+
SearchBar,
|
|
75852
|
+
{
|
|
75853
|
+
value: props[field.key] || "",
|
|
75854
|
+
onChange: (value) => updateFieldValue(rowIndex, value),
|
|
75855
|
+
placeholder: field.placeholder || `Search ${field.label}`,
|
|
75856
|
+
className: "w-full"
|
|
75857
|
+
}
|
|
75858
|
+
);
|
|
75859
|
+
case "audience":
|
|
75860
|
+
return (props, rowIndex) => {
|
|
75861
|
+
const audienceData = props[field.key] || { users: [], groups: [], roles: [] };
|
|
75862
|
+
const allAudience = [
|
|
75863
|
+
...audienceData.users || [],
|
|
75864
|
+
...audienceData.groups || [],
|
|
75865
|
+
...audienceData.roles || []
|
|
75866
|
+
];
|
|
75867
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
75868
|
+
/* @__PURE__ */ jsx(AvatarGroup, { children: allAudience.length > 0 ? allAudience.slice(0, 3).map((aud, idx) => /* @__PURE__ */ jsx(
|
|
75869
|
+
Avatar,
|
|
75870
|
+
{
|
|
75871
|
+
size: "small",
|
|
75872
|
+
name: aud.name || aud.displayName || aud.id,
|
|
75873
|
+
src: aud.avatarUrl
|
|
75874
|
+
},
|
|
75875
|
+
idx
|
|
75876
|
+
)) : null }),
|
|
75877
|
+
/* @__PURE__ */ jsx(
|
|
75878
|
+
"button",
|
|
75879
|
+
{
|
|
75880
|
+
className: "text-indigo-600 font-semibold hover:text-indigo-800",
|
|
75881
|
+
onClick: () => {
|
|
75882
|
+
setAudienceFieldName(field.key);
|
|
75883
|
+
setAudienceRowId(rowIndex);
|
|
75884
|
+
},
|
|
75885
|
+
children: allAudience.length > 0 ? "Edit" : "Assign"
|
|
75886
|
+
}
|
|
75887
|
+
)
|
|
75888
|
+
] });
|
|
75889
|
+
};
|
|
75890
|
+
case "color":
|
|
75891
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75892
|
+
Input,
|
|
75893
|
+
{
|
|
75894
|
+
type: "color",
|
|
75895
|
+
value: props[field.key] || "#000000",
|
|
75896
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75897
|
+
className: "w-full h-10"
|
|
75898
|
+
}
|
|
75899
|
+
);
|
|
75900
|
+
case "range":
|
|
75901
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
75902
|
+
/* @__PURE__ */ jsx(
|
|
75903
|
+
Input,
|
|
75904
|
+
{
|
|
75905
|
+
type: "range",
|
|
75906
|
+
value: props[field.key] || field.min || 0,
|
|
75907
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75908
|
+
min: field.min || 0,
|
|
75909
|
+
max: field.max || 100,
|
|
75910
|
+
step: field.step || 1,
|
|
75911
|
+
className: "w-full"
|
|
75912
|
+
}
|
|
75913
|
+
),
|
|
75914
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-500", children: props[field.key] || field.min || 0 })
|
|
75915
|
+
] });
|
|
75916
|
+
case "file":
|
|
75917
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75918
|
+
Input,
|
|
75919
|
+
{
|
|
75920
|
+
type: "file",
|
|
75921
|
+
onChange: (e) => {
|
|
75922
|
+
const file = e.target.files[0];
|
|
75923
|
+
updateFieldValue(rowIndex, file ? file.name : "");
|
|
75924
|
+
},
|
|
75925
|
+
accept: field.accept,
|
|
75926
|
+
className: "w-full"
|
|
75927
|
+
}
|
|
75928
|
+
);
|
|
75929
|
+
case "hidden":
|
|
75930
|
+
return (props, rowIndex) => /* @__PURE__ */ jsx(
|
|
75931
|
+
Input,
|
|
75932
|
+
{
|
|
75933
|
+
type: "hidden",
|
|
75934
|
+
value: props[field.key] || "",
|
|
75935
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value)
|
|
75936
|
+
}
|
|
75937
|
+
);
|
|
75938
|
+
// Default fallback for unknown field types
|
|
75939
|
+
default:
|
|
75940
|
+
return (props, rowIndex) => /* @__PURE__ */ jsxs("div", { children: [
|
|
75941
|
+
/* @__PURE__ */ jsx(
|
|
75942
|
+
Input,
|
|
75943
|
+
{
|
|
75944
|
+
value: props[field.key] || "",
|
|
75945
|
+
onChange: (e) => updateFieldValue(rowIndex, e.target.value),
|
|
75946
|
+
placeholder: field.placeholder || `Enter ${field.label}`,
|
|
75947
|
+
required: field.required,
|
|
75948
|
+
className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
|
|
75949
|
+
}
|
|
75950
|
+
),
|
|
75951
|
+
renderError(rowIndex)
|
|
75952
|
+
] });
|
|
75953
|
+
}
|
|
75954
|
+
};
|
|
75955
|
+
const addBlankRow = useCallback(() => {
|
|
75956
|
+
console.log("[DataTableRenderer] Adding blank row");
|
|
75957
|
+
setData((prevData) => {
|
|
75958
|
+
console.log("[DataTableRenderer] Current data before add:", prevData);
|
|
75959
|
+
const blankRow = {
|
|
75960
|
+
id: prevData.length
|
|
75961
|
+
// Assign next available ID
|
|
75962
|
+
};
|
|
75963
|
+
section.fields.forEach((field) => {
|
|
75964
|
+
if (field.fieldtype === "audience") {
|
|
75965
|
+
blankRow[field.key] = { users: [], groups: [], roles: [] };
|
|
75966
|
+
} else {
|
|
75967
|
+
blankRow[field.key] = field.default || "";
|
|
75968
|
+
}
|
|
75969
|
+
});
|
|
75970
|
+
console.log("[DataTableRenderer] New blank row:", blankRow);
|
|
75971
|
+
const newData = [...prevData, blankRow];
|
|
75972
|
+
console.log("[DataTableRenderer] Updated data:", newData);
|
|
75973
|
+
return newData;
|
|
75974
|
+
});
|
|
75975
|
+
}, [section.fields]);
|
|
75976
|
+
const removeRow = useCallback((index) => {
|
|
75977
|
+
setData((prevData) => {
|
|
75978
|
+
if (prevData.length <= 1) {
|
|
75979
|
+
return prevData;
|
|
75980
|
+
}
|
|
75981
|
+
const newData = [...prevData];
|
|
75982
|
+
newData.splice(index, 1);
|
|
75983
|
+
return newData;
|
|
75984
|
+
});
|
|
75985
|
+
}, []);
|
|
75986
|
+
const [draggedIndex, setDraggedIndex] = useState(null);
|
|
75987
|
+
const handleDragStart = useCallback((e, index) => {
|
|
75988
|
+
setDraggedIndex(index);
|
|
75989
|
+
e.dataTransfer.effectAllowed = "move";
|
|
75990
|
+
e.dataTransfer.setData("text/html", "");
|
|
75991
|
+
}, []);
|
|
75992
|
+
const handleDragOver = useCallback((e) => {
|
|
75993
|
+
e.preventDefault();
|
|
75994
|
+
e.dataTransfer.dropEffect = "move";
|
|
75995
|
+
}, []);
|
|
75996
|
+
const handleDrop = useCallback((e, dropIndex) => {
|
|
75997
|
+
e.preventDefault();
|
|
75998
|
+
if (draggedIndex === null || draggedIndex === dropIndex) return;
|
|
75999
|
+
setData((prevData) => {
|
|
76000
|
+
const newData = [...prevData];
|
|
76001
|
+
const draggedItem = newData[draggedIndex];
|
|
76002
|
+
newData.splice(draggedIndex, 1);
|
|
76003
|
+
newData.splice(dropIndex, 0, draggedItem);
|
|
76004
|
+
return newData;
|
|
76005
|
+
});
|
|
76006
|
+
setDraggedIndex(null);
|
|
76007
|
+
}, [draggedIndex]);
|
|
76008
|
+
const handleDragEnd = useCallback(() => {
|
|
76009
|
+
setDraggedIndex(null);
|
|
76010
|
+
}, []);
|
|
76011
|
+
const handleAddAudience = useCallback((selectedEntities) => {
|
|
76012
|
+
console.log("[DataTableRenderer] handleAddAudience called with:", selectedEntities);
|
|
76013
|
+
setData((prevData) => {
|
|
76014
|
+
const newData = [...prevData];
|
|
76015
|
+
if (audienceRowId !== null && audienceFieldName && newData[audienceRowId]) {
|
|
76016
|
+
const pendingInvites = selectedEntities.pendingInvites || [];
|
|
76017
|
+
const users = pendingInvites.filter((invite) => invite.type === "User");
|
|
76018
|
+
const groups = pendingInvites.filter((invite) => invite.type === "Group");
|
|
76019
|
+
const roles = pendingInvites.filter((invite) => invite.type === "Role");
|
|
76020
|
+
newData[audienceRowId][audienceFieldName] = {
|
|
76021
|
+
users: [...newData[audienceRowId][audienceFieldName]?.users || [], ...users],
|
|
76022
|
+
groups: [...newData[audienceRowId][audienceFieldName]?.groups || [], ...groups],
|
|
76023
|
+
roles: [...newData[audienceRowId][audienceFieldName]?.roles || [], ...roles]
|
|
76024
|
+
};
|
|
76025
|
+
console.log("[DataTableRenderer] Updated audience data:", newData[audienceRowId][audienceFieldName]);
|
|
76026
|
+
}
|
|
76027
|
+
return newData;
|
|
76028
|
+
});
|
|
76029
|
+
setAudienceRowId(null);
|
|
76030
|
+
setAudienceFieldName(null);
|
|
76031
|
+
}, [audienceRowId, audienceFieldName]);
|
|
76032
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
76033
|
+
/* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
|
|
76034
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
76035
|
+
/* @__PURE__ */ jsx("h2", { style: { fontSize: "20px", fontWeight: "bold", marginBottom: "10px" }, children: section.title }),
|
|
76036
|
+
/* @__PURE__ */ jsx(
|
|
76037
|
+
"button",
|
|
76038
|
+
{
|
|
76039
|
+
className: "bg-black text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
|
|
76040
|
+
onClick: addBlankRow,
|
|
76041
|
+
children: "Add"
|
|
76042
|
+
}
|
|
76043
|
+
)
|
|
76044
|
+
] }),
|
|
76045
|
+
/* @__PURE__ */ jsx("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: section.description })
|
|
76046
|
+
] }),
|
|
76047
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full bg-white border border-gray-300", children: [
|
|
76048
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "bg-gray-50", children: [
|
|
76049
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-2 w-10" }),
|
|
76050
|
+
section.fields.map((field, idx) => /* @__PURE__ */ jsx(
|
|
76051
|
+
"th",
|
|
76052
|
+
{
|
|
76053
|
+
className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
|
|
76054
|
+
children: field.label || field.key
|
|
76055
|
+
},
|
|
76056
|
+
idx
|
|
76057
|
+
)),
|
|
76058
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-2 w-16" })
|
|
76059
|
+
] }) }),
|
|
76060
|
+
/* @__PURE__ */ jsx("tbody", { children: data.map((row, rowIndex) => /* @__PURE__ */ jsxs(
|
|
76061
|
+
"tr",
|
|
76062
|
+
{
|
|
76063
|
+
className: `hover:bg-gray-50 ${draggedIndex === rowIndex ? "opacity-50" : ""}`,
|
|
76064
|
+
draggable: true,
|
|
76065
|
+
onDragStart: (e) => handleDragStart(e, rowIndex),
|
|
76066
|
+
onDragOver: handleDragOver,
|
|
76067
|
+
onDrop: (e) => handleDrop(e, rowIndex),
|
|
76068
|
+
onDragEnd: handleDragEnd,
|
|
76069
|
+
children: [
|
|
76070
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ jsx("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ jsx(GripVertical, { size: 16 }) }) }),
|
|
76071
|
+
section.fields.map((field, fieldIndex) => /* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: getFieldRenderer(field)(row, rowIndex) }, fieldIndex)),
|
|
76072
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ jsx(
|
|
76073
|
+
"button",
|
|
76074
|
+
{
|
|
76075
|
+
onClick: () => removeRow(rowIndex),
|
|
76076
|
+
className: "text-red-500 hover:text-red-700",
|
|
76077
|
+
title: "Delete row",
|
|
76078
|
+
children: /* @__PURE__ */ jsx(Trash, { size: 16 })
|
|
76079
|
+
}
|
|
76080
|
+
) })
|
|
76081
|
+
]
|
|
76082
|
+
},
|
|
76083
|
+
rowIndex
|
|
76084
|
+
)) })
|
|
76085
|
+
] }) }),
|
|
76086
|
+
audienceRowId !== null && (() => {
|
|
76087
|
+
const existingAudienceData = data[audienceRowId] && data[audienceRowId][audienceFieldName] ? {
|
|
76088
|
+
users: data[audienceRowId][audienceFieldName].users || [],
|
|
76089
|
+
groups: data[audienceRowId][audienceFieldName].groups || [],
|
|
76090
|
+
roles: data[audienceRowId][audienceFieldName].roles || []
|
|
76091
|
+
} : { users: [], groups: [], roles: [] };
|
|
76092
|
+
console.log("[DataTableRenderer] Opening modal with existing data:", existingAudienceData);
|
|
76093
|
+
console.log("[DataTableRenderer] Row data:", data[audienceRowId]);
|
|
76094
|
+
console.log("[DataTableRenderer] Field name:", audienceFieldName);
|
|
76095
|
+
return /* @__PURE__ */ jsx(
|
|
76096
|
+
AddUserGroupsRolesModal,
|
|
76097
|
+
{
|
|
76098
|
+
isOpen: true,
|
|
76099
|
+
onClose: () => {
|
|
76100
|
+
setAudienceRowId(null);
|
|
76101
|
+
setAudienceFieldName(null);
|
|
76102
|
+
},
|
|
76103
|
+
onFinalSubmit: handleAddAudience,
|
|
76104
|
+
existingShares: existingAudienceData,
|
|
76105
|
+
allowedPermissions: ["view", "remove"]
|
|
76106
|
+
}
|
|
76107
|
+
);
|
|
76108
|
+
})()
|
|
76109
|
+
] });
|
|
76110
|
+
}
|
|
76111
|
+
|
|
76112
|
+
const UnknownType = ({ item }) => /* @__PURE__ */ jsxs("div", { className: "p-3 rounded-xl border border-dashed text-sm opacity-70", children: [
|
|
76113
|
+
"Unknown type:",
|
|
76114
|
+
" ",
|
|
76115
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono", children: String(item?.type ?? "N/A") })
|
|
76116
|
+
] });
|
|
76117
|
+
const REGISTRY = /* @__PURE__ */ Object.create(null);
|
|
76118
|
+
REGISTRY.section = SectionRenderer;
|
|
76119
|
+
REGISTRY.datatable = DataTableRenderer;
|
|
76120
|
+
function toType(input) {
|
|
76121
|
+
if (typeof input === "string") return input.trim();
|
|
76122
|
+
if (input && typeof input === "object")
|
|
76123
|
+
return String(input.type || "").trim();
|
|
76124
|
+
return "";
|
|
76125
|
+
}
|
|
76126
|
+
function getComponentForType(input) {
|
|
76127
|
+
const t = toType(input);
|
|
76128
|
+
const C = REGISTRY[t] || REGISTRY[t.toLowerCase?.()] || UnknownType;
|
|
76129
|
+
return C;
|
|
76130
|
+
}
|
|
76131
|
+
function renderByType(input, props = {}) {
|
|
76132
|
+
const C = getComponentForType(input);
|
|
76133
|
+
const pass = input && typeof input === "object" ? { item: input, ...props } : props;
|
|
76134
|
+
return /* @__PURE__ */ jsx(C, { ...pass });
|
|
76135
|
+
}
|
|
76136
|
+
function register(type, component) {
|
|
76137
|
+
if (!type || !component) return;
|
|
76138
|
+
const key = String(type).trim();
|
|
76139
|
+
REGISTRY[key] = component;
|
|
76140
|
+
REGISTRY[key.toLowerCase()] = component;
|
|
76141
|
+
}
|
|
76142
|
+
function ConfigRenderFactory(input, props = {}) {
|
|
76143
|
+
return renderByType(input, props);
|
|
76144
|
+
}
|
|
75061
76145
|
|
|
75062
76146
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
75063
76147
|
|
|
75064
76148
|
function Mt(t){if(typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",o.firstChild?o.insertBefore(e,o.firstChild):o.appendChild(e),e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t));}Mt(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
75065
76149
|
`);var L=t=>typeof t=="number"&&!isNaN(t),N=t=>typeof t=="string",P=t=>typeof t=="function",mt=t=>N(t)||L(t),B=t=>N(t)||P(t)?t:null,pt=(t,o)=>t===false||L(t)&&t>0?t:o,z=t=>isValidElement(t)||N(t)||P(t)||L(t);function Z(t,o,e=300){let{scrollHeight:r,style:s}=t;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${e}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(o,e);});});}function $({enter:t,exit:o,appendPosition:e=false,collapse:r=true,collapseDuration:s=300}){return function({children:a,position:d,preventExitTransition:c,done:T,nodeRef:g,isIn:v,playToast:x}){let C=e?`${t}--${d}`:t,S=e?`${o}--${d}`:o,E=useRef(0);return useLayoutEffect(()=>{let f=g.current,p=C.split(" "),b=n=>{n.target===g.current&&(x(),f.removeEventListener("animationend",b),f.removeEventListener("animationcancel",b),E.current===0&&n.type!=="animationcancel"&&f.classList.remove(...p));};(()=>{f.classList.add(...p),f.addEventListener("animationend",b),f.addEventListener("animationcancel",b);})();},[]),useEffect(()=>{let f=g.current,p=()=>{f.removeEventListener("animationend",p),r?Z(f,T,s):T();};v||(c?p():(()=>{E.current=1,f.className+=` ${S}`,f.addEventListener("animationend",p);})());},[v]),React__default.createElement(React__default.Fragment,null,a)}}function J(t,o){return {content:tt(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:o}}function tt(t,o,e=false){return isValidElement(t)&&!N(t.type)?cloneElement(t,{closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:e}):P(t)?t({closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:e}):t}function yt({closeToast:t,theme:o,ariaLabel:e="close"}){return React__default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:r=>{r.stopPropagation(),t(true);},"aria-label":e},React__default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},React__default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function gt({delay:t,isRunning:o,closeToast:e,type:r="default",hide:s,className:l,controlledProgress:a,progress:d,rtl:c,isIn:T,theme:g}){let v=s||a&&d===0,x={animationDuration:`${t}ms`,animationPlayState:o?"running":"paused"};a&&(x.transform=`scaleX(${d})`);let C=clsx("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${r}`,{["Toastify__progress-bar--rtl"]:c}),S=P(l)?l({rtl:c,type:r,defaultClassName:C}):clsx(C,l),E={[a&&d>=1?"onTransitionEnd":"onAnimationEnd"]:a&&d<1?null:()=>{T&&e();}};return React__default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":v},React__default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${r}`}),React__default.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:S,style:x,...E}))}var Xt=1,at=()=>`${Xt++}`;function _t(t,o,e){let r=1,s=0,l=[],a=[],d=o,c=new Map,T=new Set,g=i=>(T.add(i),()=>T.delete(i)),v=()=>{a=Array.from(c.values()),T.forEach(i=>i());},x=({containerId:i,toastId:n,updateId:u})=>{let h=i?i!==t:t!==1,m=c.has(n)&&u==null;return h||m},C=(i,n)=>{c.forEach(u=>{var h;(n==null||n===u.props.toastId)&&((h=u.toggle)==null||h.call(u,i));});},S=i=>{var n,u;(u=(n=i.props)==null?void 0:n.onClose)==null||u.call(n,i.removalReason),i.isActive=false;},E=i=>{if(i==null)c.forEach(S);else {let n=c.get(i);n&&S(n);}v();},f=()=>{s-=l.length,l=[];},p=i=>{var m,_;let{toastId:n,updateId:u}=i.props,h=u==null;i.staleId&&c.delete(i.staleId),i.isActive=true,c.set(n,i),v(),e(J(i,h?"added":"updated")),h&&((_=(m=i.props).onOpen)==null||_.call(m));};return {id:t,props:d,observe:g,toggle:C,removeToast:E,toasts:c,clearQueue:f,buildToast:(i,n)=>{if(x(n))return;let{toastId:u,updateId:h,data:m,staleId:_,delay:k}=n,M=h==null;M&&s++;let A={...d,style:d.toastStyle,key:r++,...Object.fromEntries(Object.entries(n).filter(([D,Y])=>Y!=null)),toastId:u,updateId:h,data:m,isIn:false,className:B(n.className||d.toastClassName),progressClassName:B(n.progressClassName||d.progressClassName),autoClose:n.isLoading?false:pt(n.autoClose,d.autoClose),closeToast(D){c.get(u).removalReason=D,E(u);},deleteToast(){let D=c.get(u);if(D!=null){if(e(J(D,"removed")),c.delete(u),s--,s<0&&(s=0),l.length>0){p(l.shift());return}v();}}};A.closeButton=d.closeButton,n.closeButton===false||z(n.closeButton)?A.closeButton=n.closeButton:n.closeButton===true&&(A.closeButton=z(d.closeButton)?d.closeButton:true);let R={content:i,props:A,staleId:_};d.limit&&d.limit>0&&s>d.limit&&M?l.push(R):L(k)?setTimeout(()=>{p(R);},k):p(R);},setProps(i){d=i;},setToggle:(i,n)=>{let u=c.get(i);u&&(u.toggle=n);},isToastActive:i=>{var n;return (n=c.get(i))==null?void 0:n.isActive},getSnapshot:()=>a}}var I=new Map,F=[],st=new Set,Vt=t=>st.forEach(o=>o(t)),bt=()=>I.size>0;function Qt(){F.forEach(t=>nt(t.content,t.options)),F=[];}var vt=(t,{containerId:o})=>{var e;return (e=I.get(o||1))==null?void 0:e.toasts.get(t)};function X(t,o){var r;if(o)return !!((r=I.get(o))!=null&&r.isToastActive(t));let e=false;return I.forEach(s=>{s.isToastActive(t)&&(e=true);}),e}function ht(t){if(!bt()){F=F.filter(o=>t!=null&&o.options.toastId!==t);return}if(t==null||mt(t))I.forEach(o=>{o.removeToast(t);});else if(t&&("containerId"in t||"id"in t)){let o=I.get(t.containerId);o?o.removeToast(t.id):I.forEach(e=>{e.removeToast(t.id);});}}var Ct=(t={})=>{I.forEach(o=>{o.props.limit&&(!t.containerId||o.id===t.containerId)&&o.clearQueue();});};function nt(t,o){z(t)&&(bt()||F.push({content:t,options:o}),I.forEach(e=>{e.buildToast(t,o);}));}function xt(t){var o;(o=I.get(t.containerId||1))==null||o.setToggle(t.id,t.fn);}function rt(t,o){I.forEach(e=>{(o==null||!(o!=null&&o.containerId)||(o==null?void 0:o.containerId)===e.id)&&e.toggle(t,o==null?void 0:o.id);});}function Et(t){let o=t.containerId||1;return {subscribe(e){let r=_t(o,t,Vt);I.set(o,r);let s=r.observe(e);return Qt(),()=>{s(),I.delete(o);}},setProps(e){var r;(r=I.get(o))==null||r.setProps(e);},getSnapshot(){var e;return (e=I.get(o))==null?void 0:e.getSnapshot()}}}function Pt(t){return st.add(t),()=>{st.delete(t);}}function Wt(t){return t&&(N(t.toastId)||L(t.toastId))?t.toastId:at()}function U(t,o){return nt(t,o),o.toastId}function V(t,o){return {...o,type:o&&o.type||t,toastId:Wt(o)}}function Q(t){return (o,e)=>U(o,V(t,e))}function y(t,o){return U(t,V("default",o))}y.loading=(t,o)=>U(t,V("default",{isLoading:true,autoClose:false,closeOnClick:false,closeButton:false,draggable:false,...o}));function Gt(t,{pending:o,error:e,success:r},s){let l;o&&(l=N(o)?y.loading(o,s):y.loading(o.render,{...s,...o}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(T,g,v)=>{if(g==null){y.dismiss(l);return}let x={type:T,...a,...s,data:v},C=N(g)?{render:g}:g;return l?y.update(l,{...x,...C}):y(C.render,{...x,...C}),v},c=P(t)?t():t;return c.then(T=>d("success",r,T)).catch(T=>d("error",e,T)),c}y.promise=Gt;y.success=Q("success");y.info=Q("info");y.error=Q("error");y.warning=Q("warning");y.warn=y.warning;y.dark=(t,o)=>U(t,V("default",{theme:"dark",...o}));function qt(t){ht(t);}y.dismiss=qt;y.clearWaitingQueue=Ct;y.isActive=X;y.update=(t,o={})=>{let e=vt(t,o);if(e){let{props:r,content:s}=e,l={delay:100,...r,...o,toastId:o.toastId||t,updateId:at()};l.toastId!==t&&(l.staleId=t);let a=l.render||s;delete l.render,U(a,l);}};y.done=t=>{y.update(t,{progress:1});};y.onChange=Pt;y.play=t=>rt(true,t);y.pause=t=>rt(false,t);function It(t){var a;let{subscribe:o,getSnapshot:e,setProps:r}=useRef(Et(t)).current;r(t);let s=(a=useSyncExternalStore(o,e,e))==null?void 0:a.slice();function l(d){if(!s)return [];let c=new Map;return t.newestOnTop&&s.reverse(),s.forEach(T=>{let{position:g}=T.props;c.has(g)||c.set(g,[]),c.get(g).push(T);}),Array.from(c,T=>d(T[0],T[1]))}return {getToastToRender:l,isToastActive:X,count:s==null?void 0:s.length}}function At(t){let[o,e]=useState(false),[r,s]=useState(false),l=useRef(null),a=useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:true,canDrag:false,didMove:false}).current,{autoClose:d,pauseOnHover:c,closeToast:T,onClick:g,closeOnClick:v}=t;xt({id:t.toastId,containerId:t.containerId,fn:e}),useEffect(()=>{if(t.pauseOnFocusLoss)return x(),()=>{C();}},[t.pauseOnFocusLoss]);function x(){document.hasFocus()||p(),window.addEventListener("focus",f),window.addEventListener("blur",p);}function C(){window.removeEventListener("focus",f),window.removeEventListener("blur",p);}function S(m){if(t.draggable===true||t.draggable===m.pointerType){b();let _=l.current;a.canCloseOnClick=true,a.canDrag=true,_.style.transition="none",t.draggableDirection==="x"?(a.start=m.clientX,a.removalDistance=_.offsetWidth*(t.draggablePercent/100)):(a.start=m.clientY,a.removalDistance=_.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100);}}function E(m){let{top:_,bottom:k,left:M,right:A}=l.current.getBoundingClientRect();m.nativeEvent.type!=="touchend"&&t.pauseOnHover&&m.clientX>=M&&m.clientX<=A&&m.clientY>=_&&m.clientY<=k?p():f();}function f(){e(true);}function p(){e(false);}function b(){a.didMove=false,document.addEventListener("pointermove",n),document.addEventListener("pointerup",u);}function i(){document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",u);}function n(m){let _=l.current;if(a.canDrag&&_){a.didMove=true,o&&p(),t.draggableDirection==="x"?a.delta=m.clientX-a.start:a.delta=m.clientY-a.start,a.start!==m.clientX&&(a.canCloseOnClick=false);let k=t.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;_.style.transform=`translate3d(${k},0)`,_.style.opacity=`${1-Math.abs(a.delta/a.removalDistance)}`;}}function u(){i();let m=l.current;if(a.canDrag&&a.didMove&&m){if(a.canDrag=false,Math.abs(a.delta)>a.removalDistance){s(true),t.closeToast(true),t.collapseAll();return}m.style.transition="transform 0.2s, opacity 0.2s",m.style.removeProperty("transform"),m.style.removeProperty("opacity");}}let h={onPointerDown:S,onPointerUp:E};return d&&c&&(h.onMouseEnter=p,t.stacked||(h.onMouseLeave=f)),v&&(h.onClick=m=>{g&&g(m),a.canCloseOnClick&&T(true);}),{playToast:f,pauseToast:p,isRunning:o,preventExitTransition:r,toastRef:l,eventHandlers:h}}var Ot=typeof window!="undefined"?useLayoutEffect:useEffect;var G=({theme:t,type:o,isLoading:e,...r})=>React__default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${o})`,...r});function ao(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function so(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function no(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function ro(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function io(){return React__default.createElement("div",{className:"Toastify__spinner"})}var W={info:so,warning:ao,success:no,error:ro,spinner:io},lo=t=>t in W;function Nt({theme:t,type:o,isLoading:e,icon:r}){let s=null,l={theme:t,type:o};return r===false||(P(r)?s=r({...l,isLoading:e}):isValidElement(r)?s=cloneElement(r,l):e?s=W.spinner():lo(o)&&(s=W[o](l))),s}var wt=t=>{let{isRunning:o,preventExitTransition:e,toastRef:r,eventHandlers:s,playToast:l}=At(t),{closeButton:a,children:d,autoClose:c,onClick:T,type:g,hideProgressBar:v,closeToast:x,transition:C,position:S,className:E,style:f,progressClassName:p,updateId:b,role:i,progress:n,rtl:u,toastId:h,deleteToast:m,isIn:_,isLoading:k,closeOnClick:M,theme:A,ariaLabel:R}=t,D=clsx("Toastify__toast",`Toastify__toast-theme--${A}`,`Toastify__toast--${g}`,{["Toastify__toast--rtl"]:u},{["Toastify__toast--close-on-click"]:M}),Y=P(E)?E({rtl:u,position:S,type:g,defaultClassName:D}):clsx(D,E),ft=Nt(t),dt=!!n||!c,j={closeToast:x,type:g,theme:A},H=null;return a===false||(P(a)?H=a(j):isValidElement(a)?H=cloneElement(a,j):H=yt(j)),React__default.createElement(C,{isIn:_,done:m,position:S,preventExitTransition:e,nodeRef:r,playToast:l},React__default.createElement("div",{id:h,tabIndex:0,onClick:T,"data-in":_,className:Y,...s,style:f,ref:r,..._&&{role:i,"aria-label":R}},ft!=null&&React__default.createElement("div",{className:clsx("Toastify__toast-icon",{["Toastify--animate-icon Toastify__zoom-enter"]:!k})},ft),tt(d,t,!o),H,!t.customProgressBar&&React__default.createElement(gt,{...b&&!dt?{key:`p-${b}`}:{},rtl:u,theme:A,delay:c,isRunning:o,isIn:_,closeToast:x,hide:v,type:g,className:p,controlledProgress:dt,progress:n||0})))};var K=(t,o=false)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:o}),lt=$(K("bounce",true)),mo=$(K("slide",true));var _o={position:"top-right",transition:lt,autoClose:5e3,closeButton:true,pauseOnHover:true,pauseOnFocusLoss:true,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function Lt(t){let o={..._o,...t},e=t.stacked,[r,s]=useState(true),l=useRef(null),{getToastToRender:a,isToastActive:d,count:c}=It(o),{className:T,style:g,rtl:v,containerId:x,hotKeys:C}=o;function S(f){let p=clsx("Toastify__toast-container",`Toastify__toast-container--${f}`,{["Toastify__toast-container--rtl"]:v});return P(T)?T({position:f,rtl:v,defaultClassName:p}):clsx(p,B(T))}function E(){e&&(s(true),y.play());}return Ot(()=>{var f;if(e){let p=l.current.querySelectorAll('[data-in="true"]'),b=12,i=(f=o.position)==null?void 0:f.includes("top"),n=0,u=0;Array.from(p).reverse().forEach((h,m)=>{let _=h;_.classList.add("Toastify__toast--stacked"),m>0&&(_.dataset.collapsed=`${r}`),_.dataset.pos||(_.dataset.pos=i?"top":"bot");let k=n*(r?.2:1)+(r?0:b*m);_.style.setProperty("--y",`${i?k:k*-1}px`),_.style.setProperty("--g",`${b}`),_.style.setProperty("--s",`${1-(r?u:0)}`),n+=_.offsetHeight,u+=.025;});}},[r,c,e]),useEffect(()=>{function f(p){var i;let b=l.current;C(p)&&((i=b.querySelector('[tabIndex="0"]'))==null||i.focus(),s(false),y.pause()),p.key==="Escape"&&(document.activeElement===b||b!=null&&b.contains(document.activeElement))&&(s(true),y.play());}return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f);}},[C]),React__default.createElement("section",{ref:l,className:"Toastify",id:x,onMouseEnter:()=>{e&&(s(false),y.pause());},onMouseLeave:E,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":o["aria-label"]},a((f,p)=>{let b=p.length?{...g}:{...g,pointerEvents:"none"};return React__default.createElement("div",{tabIndex:-1,className:S(f),"data-stacked":e,style:b,key:`c-${f}`},p.map(({content:i,props:n})=>React__default.createElement(wt,{...n,stacked:e,collapseAll:E,isIn:d(n.toastId,n.containerId),key:`t-${n.key}`},i)))}))}
|
|
75066
76150
|
|
|
76151
|
+
function DynamicConfig({
|
|
76152
|
+
appid,
|
|
76153
|
+
configdata = null,
|
|
76154
|
+
disableApi = false
|
|
76155
|
+
}) {
|
|
76156
|
+
const [config, setConfig] = React__default.useState(configdata);
|
|
76157
|
+
const [data, setData] = React__default.useState(null);
|
|
76158
|
+
const [loading, setLoading] = useState(false);
|
|
76159
|
+
const [validationErrors, setValidationErrors] = useState({});
|
|
76160
|
+
const configEndPoint = `${gatewayBase()}/unifyedxappmodulemanagement/api/v1/appmanager/${appid}/configuration`;
|
|
76161
|
+
const updateEndPoint = configEndPoint;
|
|
76162
|
+
const [reload, setReload] = useState(1);
|
|
76163
|
+
const transformApiResponse = (apiResponse) => {
|
|
76164
|
+
if (!configdata || !configdata.configuration) {
|
|
76165
|
+
return apiResponse;
|
|
76166
|
+
}
|
|
76167
|
+
const transformedData = {};
|
|
76168
|
+
const configurationData = apiResponse?.configuration || {};
|
|
76169
|
+
configdata.configuration.forEach((section) => {
|
|
76170
|
+
if (section.key && section.type === "datatable" && section.key === "newsFeeds") {
|
|
76171
|
+
const newsFeeds = configurationData.newsFeeds || [];
|
|
76172
|
+
const transformedRows = newsFeeds.map((nf, index) => {
|
|
76173
|
+
let audienceData = { users: [], groups: [], roles: [] };
|
|
76174
|
+
if (nf.audience) {
|
|
76175
|
+
if (Array.isArray(nf.audience)) {
|
|
76176
|
+
audienceData = { users: [], groups: [], roles: [] };
|
|
76177
|
+
} else if (typeof nf.audience === "object") {
|
|
76178
|
+
audienceData = {
|
|
76179
|
+
users: nf.audience.users || [],
|
|
76180
|
+
groups: nf.audience.groups || [],
|
|
76181
|
+
roles: nf.audience.roles || []
|
|
76182
|
+
};
|
|
76183
|
+
}
|
|
76184
|
+
}
|
|
76185
|
+
const transformedRow = {
|
|
76186
|
+
id: nf.id || 0,
|
|
76187
|
+
category: nf.category || "",
|
|
76188
|
+
url: nf.url || "",
|
|
76189
|
+
// Keep as 'url' to match config.json
|
|
76190
|
+
audience: audienceData
|
|
76191
|
+
};
|
|
76192
|
+
return transformedRow;
|
|
76193
|
+
});
|
|
76194
|
+
if (transformedRows.length === 0) {
|
|
76195
|
+
const emptyRow = { id: 0 };
|
|
76196
|
+
if (section.fields) {
|
|
76197
|
+
section.fields.forEach((field) => {
|
|
76198
|
+
if (field.fieldtype === "audience") {
|
|
76199
|
+
emptyRow[field.key] = { users: [], groups: [], roles: [] };
|
|
76200
|
+
} else {
|
|
76201
|
+
emptyRow[field.key] = field.default || "";
|
|
76202
|
+
}
|
|
76203
|
+
});
|
|
76204
|
+
}
|
|
76205
|
+
transformedRows.push(emptyRow);
|
|
76206
|
+
}
|
|
76207
|
+
transformedData[section.key] = transformedRows;
|
|
76208
|
+
} else if (section.key) {
|
|
76209
|
+
transformedData[section.key] = configurationData[section.key] || {};
|
|
76210
|
+
}
|
|
76211
|
+
});
|
|
76212
|
+
return transformedData;
|
|
76213
|
+
};
|
|
76214
|
+
const initializeEmptyData = () => {
|
|
76215
|
+
if (configdata && configdata.configuration) {
|
|
76216
|
+
const configDataState = {};
|
|
76217
|
+
configdata.configuration.forEach((section) => {
|
|
76218
|
+
if (section.key) {
|
|
76219
|
+
if (section.type === "datatable") {
|
|
76220
|
+
const emptyRow = { id: 0 };
|
|
76221
|
+
if (section.fields) {
|
|
76222
|
+
section.fields.forEach((field) => {
|
|
76223
|
+
if (field.fieldtype === "audience") {
|
|
76224
|
+
emptyRow[field.key] = { users: [], groups: [], roles: [] };
|
|
76225
|
+
} else {
|
|
76226
|
+
emptyRow[field.key] = field.default || "";
|
|
76227
|
+
}
|
|
76228
|
+
});
|
|
76229
|
+
}
|
|
76230
|
+
configDataState[section.key] = [emptyRow];
|
|
76231
|
+
} else if (section.type === "section") {
|
|
76232
|
+
const sectionData = {};
|
|
76233
|
+
if (section.fields && Array.isArray(section.fields)) {
|
|
76234
|
+
section.fields.forEach((field) => {
|
|
76235
|
+
if (field.key) {
|
|
76236
|
+
sectionData[field.key] = field.default || "";
|
|
76237
|
+
}
|
|
76238
|
+
});
|
|
76239
|
+
}
|
|
76240
|
+
configDataState[section.key] = sectionData;
|
|
76241
|
+
} else {
|
|
76242
|
+
configDataState[section.key] = {};
|
|
76243
|
+
}
|
|
76244
|
+
}
|
|
76245
|
+
});
|
|
76246
|
+
setData(configDataState);
|
|
76247
|
+
}
|
|
76248
|
+
};
|
|
76249
|
+
useEffect(() => {
|
|
76250
|
+
if (disableApi) {
|
|
76251
|
+
setLoading(false);
|
|
76252
|
+
return;
|
|
76253
|
+
}
|
|
76254
|
+
const fetchData = async () => {
|
|
76255
|
+
try {
|
|
76256
|
+
setLoading(true);
|
|
76257
|
+
let response = await axiosGet(configEndPoint);
|
|
76258
|
+
if (response) {
|
|
76259
|
+
const transformedData = transformApiResponse(response);
|
|
76260
|
+
setData(transformedData);
|
|
76261
|
+
} else {
|
|
76262
|
+
initializeEmptyData();
|
|
76263
|
+
}
|
|
76264
|
+
} catch (error) {
|
|
76265
|
+
console.error("Error fetching configuration:", error);
|
|
76266
|
+
let errorMessage = "Failed to load configuration";
|
|
76267
|
+
if (error.response) {
|
|
76268
|
+
const status = error.response.status;
|
|
76269
|
+
const serverMessage = error.response.data?.message || error.response.data?.error;
|
|
76270
|
+
if (status === 400) {
|
|
76271
|
+
errorMessage = serverMessage || "Invalid request. Please check the application ID.";
|
|
76272
|
+
} else if (status === 401) {
|
|
76273
|
+
errorMessage = "You are not authorized to access this configuration.";
|
|
76274
|
+
} else if (status === 403) {
|
|
76275
|
+
errorMessage = "Access denied. You don't have permission to view this configuration.";
|
|
76276
|
+
} else if (status === 404) {
|
|
76277
|
+
errorMessage = "Configuration not found. It may not exist yet or the application ID is incorrect.";
|
|
76278
|
+
} else if (status >= 500) {
|
|
76279
|
+
errorMessage = serverMessage || "Server error. Please try again later.";
|
|
76280
|
+
} else {
|
|
76281
|
+
errorMessage = serverMessage || `Failed to load configuration (Error ${status})`;
|
|
76282
|
+
}
|
|
76283
|
+
} else if (error.request) {
|
|
76284
|
+
errorMessage = "Network error. Please check your connection and try again.";
|
|
76285
|
+
} else {
|
|
76286
|
+
errorMessage = error.message || "An unexpected error occurred while loading configuration.";
|
|
76287
|
+
}
|
|
76288
|
+
y.error(errorMessage, {
|
|
76289
|
+
autoClose: 6e3,
|
|
76290
|
+
hideProgressBar: false,
|
|
76291
|
+
closeOnClick: true,
|
|
76292
|
+
pauseOnHover: true,
|
|
76293
|
+
draggable: true
|
|
76294
|
+
});
|
|
76295
|
+
initializeEmptyData();
|
|
76296
|
+
} finally {
|
|
76297
|
+
setLoading(false);
|
|
76298
|
+
}
|
|
76299
|
+
};
|
|
76300
|
+
if (configdata) {
|
|
76301
|
+
setConfig(configdata);
|
|
76302
|
+
if (appid) {
|
|
76303
|
+
fetchData();
|
|
76304
|
+
} else {
|
|
76305
|
+
initializeEmptyData();
|
|
76306
|
+
}
|
|
76307
|
+
}
|
|
76308
|
+
}, [configdata, reload, appid, disableApi]);
|
|
76309
|
+
const handleSectionChange = (name, sectiondata) => {
|
|
76310
|
+
setData((prev) => {
|
|
76311
|
+
const newData = {
|
|
76312
|
+
...prev,
|
|
76313
|
+
[name]: sectiondata
|
|
76314
|
+
};
|
|
76315
|
+
return newData;
|
|
76316
|
+
});
|
|
76317
|
+
setValidationErrors((prevErrors) => {
|
|
76318
|
+
const newErrors = { ...prevErrors };
|
|
76319
|
+
if (newErrors[name]) {
|
|
76320
|
+
delete newErrors[name];
|
|
76321
|
+
}
|
|
76322
|
+
return newErrors;
|
|
76323
|
+
});
|
|
76324
|
+
};
|
|
76325
|
+
const validateRequiredFields = () => {
|
|
76326
|
+
const errors = {};
|
|
76327
|
+
if (!config || !data) {
|
|
76328
|
+
return errors;
|
|
76329
|
+
}
|
|
76330
|
+
config.configuration.forEach((section) => {
|
|
76331
|
+
if (section.type === "section") {
|
|
76332
|
+
section.fields.forEach((field) => {
|
|
76333
|
+
if (field.required) {
|
|
76334
|
+
const value = data[section.key]?.[field.key];
|
|
76335
|
+
if (!value || typeof value === "string" && value.trim() === "") {
|
|
76336
|
+
if (!errors[section.key]) errors[section.key] = {};
|
|
76337
|
+
errors[section.key][field.key] = `${field.label} is required`;
|
|
76338
|
+
}
|
|
76339
|
+
}
|
|
76340
|
+
});
|
|
76341
|
+
} else if (section.type === "datatable") {
|
|
76342
|
+
const tableData = data[section.key];
|
|
76343
|
+
if (Array.isArray(tableData)) {
|
|
76344
|
+
tableData.forEach((row, rowIndex) => {
|
|
76345
|
+
section.fields.forEach((field) => {
|
|
76346
|
+
if (field.required) {
|
|
76347
|
+
const value = row[field.key];
|
|
76348
|
+
if (!value || typeof value === "string" && value.trim() === "") {
|
|
76349
|
+
if (!errors[section.key]) errors[section.key] = {};
|
|
76350
|
+
if (!errors[section.key][rowIndex]) errors[section.key][rowIndex] = {};
|
|
76351
|
+
errors[section.key][rowIndex][field.key] = `${field.label} is required`;
|
|
76352
|
+
}
|
|
76353
|
+
}
|
|
76354
|
+
});
|
|
76355
|
+
});
|
|
76356
|
+
}
|
|
76357
|
+
}
|
|
76358
|
+
});
|
|
76359
|
+
return errors;
|
|
76360
|
+
};
|
|
76361
|
+
const hasValidationErrors = (errors) => {
|
|
76362
|
+
return Object.keys(errors).length > 0;
|
|
76363
|
+
};
|
|
76364
|
+
const handleSave = () => {
|
|
76365
|
+
const errors = validateRequiredFields();
|
|
76366
|
+
setValidationErrors(errors);
|
|
76367
|
+
if (hasValidationErrors(errors)) {
|
|
76368
|
+
let errorCount = 0;
|
|
76369
|
+
let errorDetails = [];
|
|
76370
|
+
Object.keys(errors).forEach((sectionKey) => {
|
|
76371
|
+
if (typeof errors[sectionKey] === "object") {
|
|
76372
|
+
Object.keys(errors[sectionKey]).forEach((itemKey) => {
|
|
76373
|
+
if (typeof errors[sectionKey][itemKey] === "object") {
|
|
76374
|
+
Object.keys(errors[sectionKey][itemKey]).forEach((fieldKey) => {
|
|
76375
|
+
errorCount++;
|
|
76376
|
+
errorDetails.push(`${sectionKey} row ${parseInt(itemKey) + 1}: ${errors[sectionKey][itemKey][fieldKey]}`);
|
|
76377
|
+
});
|
|
76378
|
+
} else {
|
|
76379
|
+
errorCount++;
|
|
76380
|
+
errorDetails.push(`${sectionKey}: ${errors[sectionKey][itemKey]}`);
|
|
76381
|
+
}
|
|
76382
|
+
});
|
|
76383
|
+
}
|
|
76384
|
+
});
|
|
76385
|
+
const errorMessage = errorCount === 1 ? "Please fill in the required field before saving" : `Please fill in all ${errorCount} required fields before saving`;
|
|
76386
|
+
y.error(errorMessage, {
|
|
76387
|
+
autoClose: 6e3,
|
|
76388
|
+
hideProgressBar: false,
|
|
76389
|
+
closeOnClick: true,
|
|
76390
|
+
pauseOnHover: true,
|
|
76391
|
+
draggable: true
|
|
76392
|
+
});
|
|
76393
|
+
return;
|
|
76394
|
+
}
|
|
76395
|
+
const saveData = async () => {
|
|
76396
|
+
try {
|
|
76397
|
+
setLoading(true);
|
|
76398
|
+
const transformedPayload = {};
|
|
76399
|
+
if (data) {
|
|
76400
|
+
Object.keys(data).forEach((key) => {
|
|
76401
|
+
if (key === "newsFeeds" && Array.isArray(data[key])) {
|
|
76402
|
+
transformedPayload[key] = data[key].map((item) => {
|
|
76403
|
+
let audienceData = { users: [], groups: [], roles: [] };
|
|
76404
|
+
if (item.audience) {
|
|
76405
|
+
if (typeof item.audience === "object" && !Array.isArray(item.audience)) {
|
|
76406
|
+
audienceData = {
|
|
76407
|
+
users: item.audience.users || [],
|
|
76408
|
+
groups: item.audience.groups || [],
|
|
76409
|
+
roles: item.audience.roles || []
|
|
76410
|
+
};
|
|
76411
|
+
}
|
|
76412
|
+
}
|
|
76413
|
+
return {
|
|
76414
|
+
id: item.id || 0,
|
|
76415
|
+
category: item.category || "",
|
|
76416
|
+
url: item.url || "",
|
|
76417
|
+
// Keep as 'url' to match API and config
|
|
76418
|
+
audience: audienceData
|
|
76419
|
+
};
|
|
76420
|
+
});
|
|
76421
|
+
} else {
|
|
76422
|
+
transformedPayload[key] = data[key];
|
|
76423
|
+
}
|
|
76424
|
+
});
|
|
76425
|
+
}
|
|
76426
|
+
let response = await axiosPost(updateEndPoint, transformedPayload);
|
|
76427
|
+
if (response && response.data?.status != "fail") {
|
|
76428
|
+
setValidationErrors({});
|
|
76429
|
+
const successMessage = response.message || "Configuration has been saved successfully";
|
|
76430
|
+
y.success(successMessage, {
|
|
76431
|
+
autoClose: 4e3,
|
|
76432
|
+
hideProgressBar: false,
|
|
76433
|
+
closeOnClick: true,
|
|
76434
|
+
pauseOnHover: true,
|
|
76435
|
+
draggable: true
|
|
76436
|
+
});
|
|
76437
|
+
} else {
|
|
76438
|
+
throw new Error("No response received from server");
|
|
76439
|
+
}
|
|
76440
|
+
} catch (error) {
|
|
76441
|
+
let errorMessage = "Failed to save configuration";
|
|
76442
|
+
if (error.response) {
|
|
76443
|
+
const status = error.response.status;
|
|
76444
|
+
const serverMessage = error.response.data?.message || error.response.data?.error;
|
|
76445
|
+
if (status === 400) {
|
|
76446
|
+
errorMessage = serverMessage || "Invalid configuration data. Please check your inputs.";
|
|
76447
|
+
} else if (status === 401) {
|
|
76448
|
+
errorMessage = "You are not authorized to save this configuration.";
|
|
76449
|
+
} else if (status === 403) {
|
|
76450
|
+
errorMessage = "Access denied. You don't have permission to save this configuration.";
|
|
76451
|
+
} else if (status === 404) {
|
|
76452
|
+
errorMessage = "Configuration endpoint not found. Please contact support.";
|
|
76453
|
+
} else if (status >= 500) {
|
|
76454
|
+
errorMessage = serverMessage || "Server error. Please try again later.";
|
|
76455
|
+
} else {
|
|
76456
|
+
errorMessage = serverMessage || `Failed to save configuration (Error ${status})`;
|
|
76457
|
+
}
|
|
76458
|
+
} else if (error.request) {
|
|
76459
|
+
errorMessage = "Network error. Please check your connection and try again.";
|
|
76460
|
+
} else {
|
|
76461
|
+
errorMessage = error.message || "An unexpected error occurred while saving.";
|
|
76462
|
+
}
|
|
76463
|
+
y.error(errorMessage, {
|
|
76464
|
+
autoClose: 8e3,
|
|
76465
|
+
hideProgressBar: false,
|
|
76466
|
+
closeOnClick: true,
|
|
76467
|
+
pauseOnHover: true,
|
|
76468
|
+
draggable: true
|
|
76469
|
+
});
|
|
76470
|
+
} finally {
|
|
76471
|
+
setLoading(false);
|
|
76472
|
+
}
|
|
76473
|
+
};
|
|
76474
|
+
saveData();
|
|
76475
|
+
};
|
|
76476
|
+
const handleCancel = () => {
|
|
76477
|
+
const hasUnsavedChanges = validationErrors && Object.keys(validationErrors).length > 0;
|
|
76478
|
+
if (hasUnsavedChanges) {
|
|
76479
|
+
const confirmed = window.confirm(
|
|
76480
|
+
"You have validation errors that will be lost. Are you sure you want to cancel?"
|
|
76481
|
+
);
|
|
76482
|
+
if (!confirmed) {
|
|
76483
|
+
return;
|
|
76484
|
+
}
|
|
76485
|
+
}
|
|
76486
|
+
setValidationErrors({});
|
|
76487
|
+
setData(null);
|
|
76488
|
+
setReload((prev) => prev + 1);
|
|
76489
|
+
y.info("Configuration changes cancelled", {
|
|
76490
|
+
autoClose: 2e3,
|
|
76491
|
+
hideProgressBar: false,
|
|
76492
|
+
closeOnClick: true,
|
|
76493
|
+
pauseOnHover: true,
|
|
76494
|
+
draggable: true
|
|
76495
|
+
});
|
|
76496
|
+
};
|
|
76497
|
+
if (!config?.configuration && !configdata?.configuration) {
|
|
76498
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen flex items-center justify-center", children: [
|
|
76499
|
+
/* @__PURE__ */ jsx("div", { className: "text-gray-500", children: "No configuration available" }),
|
|
76500
|
+
/* @__PURE__ */ jsx(
|
|
76501
|
+
Lt,
|
|
76502
|
+
{
|
|
76503
|
+
position: "top-right",
|
|
76504
|
+
autoClose: 5e3,
|
|
76505
|
+
hideProgressBar: false,
|
|
76506
|
+
newestOnTop: false,
|
|
76507
|
+
closeOnClick: true,
|
|
76508
|
+
rtl: false,
|
|
76509
|
+
pauseOnFocusLoss: true,
|
|
76510
|
+
draggable: true,
|
|
76511
|
+
pauseOnHover: true,
|
|
76512
|
+
theme: "light"
|
|
76513
|
+
}
|
|
76514
|
+
)
|
|
76515
|
+
] });
|
|
76516
|
+
}
|
|
76517
|
+
const configurationSections = configdata?.configuration || config?.configuration;
|
|
76518
|
+
useEffect(() => {
|
|
76519
|
+
if (disableApi && configdata) {
|
|
76520
|
+
const transformedData = transformApiResponse(configdata);
|
|
76521
|
+
setData(transformedData);
|
|
76522
|
+
} else if (disableApi && !configdata) {
|
|
76523
|
+
initializeEmptyData();
|
|
76524
|
+
}
|
|
76525
|
+
}, [disableApi, configdata]);
|
|
76526
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
76527
|
+
/* @__PURE__ */ jsxs(
|
|
76528
|
+
"div",
|
|
76529
|
+
{
|
|
76530
|
+
className: "dynamic-config bg-white border rounded-t-2xl border-gray-300 w-full h-[calc(100vh-350px)] overflow-y-auto",
|
|
76531
|
+
style: { padding: "20px", fontFamily: "Arial, sans-serif" },
|
|
76532
|
+
children: [
|
|
76533
|
+
loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center mb-4 p-4 bg-blue-50 border border-blue-200 rounded", children: [
|
|
76534
|
+
/* @__PURE__ */ jsx(Spinner, { size: "small" }),
|
|
76535
|
+
/* @__PURE__ */ jsx("span", { className: "ml-2 text-blue-700", children: "Loading configuration..." })
|
|
76536
|
+
] }),
|
|
76537
|
+
configurationSections?.map((section, index) => {
|
|
76538
|
+
const C = getComponentForType(section.type);
|
|
76539
|
+
if (C && C !== "UnknownType") {
|
|
76540
|
+
return /* @__PURE__ */ jsx(
|
|
76541
|
+
C,
|
|
76542
|
+
{
|
|
76543
|
+
item: section,
|
|
76544
|
+
data,
|
|
76545
|
+
updateHandler: handleSectionChange,
|
|
76546
|
+
validationErrors
|
|
76547
|
+
},
|
|
76548
|
+
index
|
|
76549
|
+
);
|
|
76550
|
+
}
|
|
76551
|
+
})
|
|
76552
|
+
]
|
|
76553
|
+
}
|
|
76554
|
+
),
|
|
76555
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", children: [
|
|
76556
|
+
/* @__PURE__ */ jsx(
|
|
76557
|
+
UnifyedCoreButton,
|
|
76558
|
+
{
|
|
76559
|
+
category: "secondary",
|
|
76560
|
+
onClick: handleCancel,
|
|
76561
|
+
label: "Cancel",
|
|
76562
|
+
disabled: loading
|
|
76563
|
+
}
|
|
76564
|
+
),
|
|
76565
|
+
/* @__PURE__ */ jsx(
|
|
76566
|
+
UnifyedCoreButton,
|
|
76567
|
+
{
|
|
76568
|
+
category: "primary",
|
|
76569
|
+
onClick: handleSave,
|
|
76570
|
+
disabled: loading,
|
|
76571
|
+
label: loading ? "Saving..." : "Apply",
|
|
76572
|
+
type: "submit"
|
|
76573
|
+
}
|
|
76574
|
+
)
|
|
76575
|
+
] }),
|
|
76576
|
+
/* @__PURE__ */ jsx(
|
|
76577
|
+
Lt,
|
|
76578
|
+
{
|
|
76579
|
+
position: "top-right",
|
|
76580
|
+
autoClose: 5e3,
|
|
76581
|
+
hideProgressBar: false,
|
|
76582
|
+
newestOnTop: false,
|
|
76583
|
+
closeOnClick: true,
|
|
76584
|
+
rtl: false,
|
|
76585
|
+
pauseOnFocusLoss: true,
|
|
76586
|
+
draggable: true,
|
|
76587
|
+
pauseOnHover: true,
|
|
76588
|
+
theme: "light",
|
|
76589
|
+
style: { zIndex: 9999 }
|
|
76590
|
+
}
|
|
76591
|
+
)
|
|
76592
|
+
] });
|
|
76593
|
+
}
|
|
76594
|
+
|
|
76595
|
+
const DynamicConfig_stories = {
|
|
76596
|
+
title: "Utils/Configuration/DynamicConfig",
|
|
76597
|
+
parameters: {
|
|
76598
|
+
layout: "fullscreen",
|
|
76599
|
+
docs: {
|
|
76600
|
+
description: {
|
|
76601
|
+
component: "DynamicConfig is a powerful configuration component that automatically generates UI forms based on JSON schema. It handles API calls, data transformation, and form validation."
|
|
76602
|
+
}
|
|
76603
|
+
}
|
|
76604
|
+
}
|
|
76605
|
+
};
|
|
76606
|
+
|
|
76607
|
+
const FullConfigPage = ({
|
|
76608
|
+
config,
|
|
76609
|
+
appid = "default-app",
|
|
76610
|
+
disableApi = false
|
|
76611
|
+
}) => {
|
|
76612
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
76613
|
+
const {
|
|
76614
|
+
pageHeader = {},
|
|
76615
|
+
appletHeader = {},
|
|
76616
|
+
breadcrumb = [],
|
|
76617
|
+
overview = {},
|
|
76618
|
+
configuration = []
|
|
76619
|
+
} = config;
|
|
76620
|
+
const defaultPageHeader = {
|
|
76621
|
+
heading: "App Details",
|
|
76622
|
+
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
76623
|
+
isLeftArrow: true,
|
|
76624
|
+
...pageHeader
|
|
76625
|
+
};
|
|
76626
|
+
const defaultAppletHeader = {
|
|
76627
|
+
heading: "Application",
|
|
76628
|
+
subHeading: "Application configuration and details",
|
|
76629
|
+
tags: [],
|
|
76630
|
+
...appletHeader
|
|
76631
|
+
};
|
|
76632
|
+
const defaultOverview = {
|
|
76633
|
+
about: "This application provides comprehensive functionality for your organization.",
|
|
76634
|
+
images: {
|
|
76635
|
+
desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
|
|
76636
|
+
mobile1: "https://via.placeholder.com/200x400?text=Mobile+View+1",
|
|
76637
|
+
mobile2: "https://via.placeholder.com/200x400?text=Mobile+View+2"
|
|
76638
|
+
},
|
|
76639
|
+
features: [
|
|
76640
|
+
{
|
|
76641
|
+
title: "Feature 1",
|
|
76642
|
+
description: "Description of feature 1"
|
|
76643
|
+
},
|
|
76644
|
+
{
|
|
76645
|
+
title: "Feature 2",
|
|
76646
|
+
description: "Description of feature 2"
|
|
76647
|
+
}
|
|
76648
|
+
],
|
|
76649
|
+
...overview
|
|
76650
|
+
};
|
|
76651
|
+
const tabs = [
|
|
76652
|
+
{ label: "Overview", content: renderOverview(defaultOverview) },
|
|
76653
|
+
{ label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi }) }
|
|
76654
|
+
];
|
|
76655
|
+
function renderIcon(icon) {
|
|
76656
|
+
if (!icon) {
|
|
76657
|
+
return "📱";
|
|
76658
|
+
}
|
|
76659
|
+
if (icon.includes("<svg")) {
|
|
76660
|
+
return /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: icon } });
|
|
76661
|
+
}
|
|
76662
|
+
return icon;
|
|
76663
|
+
}
|
|
76664
|
+
function renderOverview(overviewData) {
|
|
76665
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
76666
|
+
/* @__PURE__ */ jsxs("section", { className: "mb-8", children: [
|
|
76667
|
+
/* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
76668
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-700 text-base", children: overviewData.about })
|
|
76669
|
+
] }),
|
|
76670
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
|
|
76671
|
+
/* @__PURE__ */ jsx(
|
|
76672
|
+
"img",
|
|
76673
|
+
{
|
|
76674
|
+
src: overviewData.images.desktop,
|
|
76675
|
+
alt: "Desktop View",
|
|
76676
|
+
className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
|
|
76677
|
+
}
|
|
76678
|
+
),
|
|
76679
|
+
/* @__PURE__ */ jsx(
|
|
76680
|
+
"img",
|
|
76681
|
+
{
|
|
76682
|
+
src: overviewData.images.mobile1,
|
|
76683
|
+
alt: "Mobile View 1",
|
|
76684
|
+
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
76685
|
+
}
|
|
76686
|
+
),
|
|
76687
|
+
/* @__PURE__ */ jsx(
|
|
76688
|
+
"img",
|
|
76689
|
+
{
|
|
76690
|
+
src: overviewData.images.mobile2,
|
|
76691
|
+
alt: "Mobile View 2",
|
|
76692
|
+
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
76693
|
+
}
|
|
76694
|
+
)
|
|
76695
|
+
] }),
|
|
76696
|
+
/* @__PURE__ */ jsxs("section", { children: [
|
|
76697
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
76698
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-3", children: overviewData.features.map((feature, index) => /* @__PURE__ */ jsxs("li", { children: [
|
|
76699
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: feature.title }),
|
|
76700
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
76701
|
+
/* @__PURE__ */ jsx("span", { className: "text-gray-700", children: feature.description })
|
|
76702
|
+
] }, index)) })
|
|
76703
|
+
] })
|
|
76704
|
+
] });
|
|
76705
|
+
}
|
|
76706
|
+
return /* @__PURE__ */ jsxs("div", { className: "full-config-page", children: [
|
|
76707
|
+
/* @__PURE__ */ jsxs("div", { className: "py-3 flex items-center gap-4", children: [
|
|
76708
|
+
defaultPageHeader.isLeftArrow && /* @__PURE__ */ jsx(
|
|
76709
|
+
"button",
|
|
76710
|
+
{
|
|
76711
|
+
className: "cursor-pointer flex-shrink-0 mt-1",
|
|
76712
|
+
"aria-label": "Go back",
|
|
76713
|
+
onClick: () => window.history.back(),
|
|
76714
|
+
children: /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7", stroke: "#6b7280", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
76715
|
+
}
|
|
76716
|
+
),
|
|
76717
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
76718
|
+
/* @__PURE__ */ jsx("h1", { className: "text-[18px] font-semibold leading-tight truncate m-0", children: defaultPageHeader.heading }),
|
|
76719
|
+
/* @__PURE__ */ jsx("p", { className: "text-[13px] font-normal text-[#6b7280] opacity-90 mt-1 truncate mb-0", children: defaultPageHeader.subHeading })
|
|
76720
|
+
] })
|
|
76721
|
+
] }),
|
|
76722
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("nav", { className: "flex gap-2 items-center text-[13px] text-[#6b7280] mb-4", "aria-label": "Breadcrumb", children: breadcrumb.map((item, index) => /* @__PURE__ */ jsxs("span", { className: "flex items-center", children: [
|
|
76723
|
+
index > 0 && /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", style: { margin: "0 2px" }, children: /* @__PURE__ */ jsx("path", { d: "M9 18L15 12L9 6", stroke: "#6b7280", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
76724
|
+
item.isCurrent ? /* @__PURE__ */ jsx("span", { className: "font-semibold text-[#252525]", children: item.text }) : /* @__PURE__ */ jsx("a", { href: item.href, className: "hover:text-[#1f6ed4] cursor-pointer", style: { textDecoration: "none" }, children: item.text })
|
|
76725
|
+
] }, index)) }),
|
|
76726
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
76727
|
+
/* @__PURE__ */ jsx("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: renderIcon(defaultAppletHeader.icon) }),
|
|
76728
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
76729
|
+
/* @__PURE__ */ jsx("h2", { className: "text-[18px] font-semibold m-0 leading-tight truncate", children: defaultAppletHeader.heading }),
|
|
76730
|
+
/* @__PURE__ */ jsx("p", { className: "text-[13px] text-[#767676] mt-1 mb-0 max-w-[800px] leading-normal", children: defaultAppletHeader.subHeading }),
|
|
76731
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: defaultAppletHeader.tags && defaultAppletHeader.tags.map((tag, index) => /* @__PURE__ */ jsx(
|
|
76732
|
+
"span",
|
|
76733
|
+
{
|
|
76734
|
+
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
76735
|
+
children: tag
|
|
76736
|
+
},
|
|
76737
|
+
index
|
|
76738
|
+
)) })
|
|
76739
|
+
] })
|
|
76740
|
+
] }),
|
|
76741
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
76742
|
+
/* @__PURE__ */ jsx("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ jsx("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: tabs.map((tab, index) => /* @__PURE__ */ jsx(
|
|
76743
|
+
"button",
|
|
76744
|
+
{
|
|
76745
|
+
onClick: () => setActiveTab(index),
|
|
76746
|
+
className: `${activeTab === index ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
|
|
76747
|
+
children: tab.label
|
|
76748
|
+
},
|
|
76749
|
+
index
|
|
76750
|
+
)) }) }),
|
|
76751
|
+
/* @__PURE__ */ jsx("div", { className: "p-6 h-full overflow-y-auto", children: tabs[activeTab].content })
|
|
76752
|
+
] })
|
|
76753
|
+
] });
|
|
76754
|
+
};
|
|
76755
|
+
|
|
75067
76756
|
function ToastProvider({ children }) {
|
|
75068
76757
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75069
76758
|
children,
|
|
@@ -75142,5 +76831,169 @@ const notify = {
|
|
|
75142
76831
|
)
|
|
75143
76832
|
};
|
|
75144
76833
|
|
|
75145
|
-
|
|
76834
|
+
const CustomGridToolbar = ({
|
|
76835
|
+
heading = "Data Grid",
|
|
76836
|
+
subheading = "",
|
|
76837
|
+
totalCount = 0,
|
|
76838
|
+
gridRef,
|
|
76839
|
+
onAdd,
|
|
76840
|
+
onFilterOpen,
|
|
76841
|
+
addBtnText = "Add",
|
|
76842
|
+
// Feature toggles
|
|
76843
|
+
showSearch = true,
|
|
76844
|
+
showColumnChooser = true,
|
|
76845
|
+
showFilter = false,
|
|
76846
|
+
showPrint = false,
|
|
76847
|
+
showExcel = false,
|
|
76848
|
+
showPdf = false,
|
|
76849
|
+
showRefresh = false,
|
|
76850
|
+
showAdd = false,
|
|
76851
|
+
// Additional props
|
|
76852
|
+
searchPlaceholder = "Search...",
|
|
76853
|
+
handleRefreshClick = () => {
|
|
76854
|
+
},
|
|
76855
|
+
handleSearchChange = () => {
|
|
76856
|
+
}
|
|
76857
|
+
}) => {
|
|
76858
|
+
const handleAction = (action, event) => {
|
|
76859
|
+
const grid = gridRef?.current;
|
|
76860
|
+
console.log("Grid Ref:", gridRef);
|
|
76861
|
+
console.log("the grid", grid?.value);
|
|
76862
|
+
if (!grid) {
|
|
76863
|
+
console.warn("Grid reference is not available");
|
|
76864
|
+
return;
|
|
76865
|
+
}
|
|
76866
|
+
switch (action) {
|
|
76867
|
+
case "ColumnChooser":
|
|
76868
|
+
if (event) {
|
|
76869
|
+
const target = event.currentTarget || event.target;
|
|
76870
|
+
if (target && typeof target.getBoundingClientRect === "function") {
|
|
76871
|
+
const rect = target.getBoundingClientRect();
|
|
76872
|
+
const viewportWidth = window.innerWidth;
|
|
76873
|
+
const viewportHeight = window.innerHeight;
|
|
76874
|
+
let x = rect.left - 130;
|
|
76875
|
+
let y = rect.bottom - 80;
|
|
76876
|
+
x = Math.max(10, Math.min(x, viewportWidth - 320));
|
|
76877
|
+
y = Math.max(10, Math.min(y, viewportHeight - 400));
|
|
76878
|
+
grid.columnChooserModule?.openColumnChooser(x, y);
|
|
76879
|
+
} else {
|
|
76880
|
+
const fallbackX = Math.min(1240, window.innerWidth - 320);
|
|
76881
|
+
grid.columnChooserModule?.openColumnChooser(fallbackX, 55);
|
|
76882
|
+
}
|
|
76883
|
+
} else {
|
|
76884
|
+
grid.columnChooserModule?.openColumnChooser();
|
|
76885
|
+
}
|
|
76886
|
+
break;
|
|
76887
|
+
case "Print":
|
|
76888
|
+
grid.print?.();
|
|
76889
|
+
break;
|
|
76890
|
+
case "Excel":
|
|
76891
|
+
grid.excelExport?.({ fileName: `${heading}.xlsx` });
|
|
76892
|
+
break;
|
|
76893
|
+
case "Pdf":
|
|
76894
|
+
grid.pdfExport?.({ fileName: `${heading}.pdf` });
|
|
76895
|
+
break;
|
|
76896
|
+
case "Refresh":
|
|
76897
|
+
handleRefreshClick();
|
|
76898
|
+
break;
|
|
76899
|
+
}
|
|
76900
|
+
};
|
|
76901
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-red border-t border-gray-400/50 rounded-t-2xl shadow", children: [
|
|
76902
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col ", children: [
|
|
76903
|
+
/* @__PURE__ */ jsxs("div", { className: "text-lg font-semibold text-gray-800", children: [
|
|
76904
|
+
heading,
|
|
76905
|
+
" (",
|
|
76906
|
+
totalCount,
|
|
76907
|
+
")"
|
|
76908
|
+
] }),
|
|
76909
|
+
subheading && /* @__PURE__ */ jsx("div", { className: "text-sm font-light", children: subheading })
|
|
76910
|
+
] }),
|
|
76911
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
76912
|
+
showSearch && /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
76913
|
+
SearchBar,
|
|
76914
|
+
{
|
|
76915
|
+
placeholder: searchPlaceholder,
|
|
76916
|
+
onDebouncedChange: (searchValue) => {
|
|
76917
|
+
handleSearchChange(searchValue);
|
|
76918
|
+
}
|
|
76919
|
+
}
|
|
76920
|
+
) }),
|
|
76921
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
76922
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
76923
|
+
showColumnChooser && /* @__PURE__ */ jsx(
|
|
76924
|
+
UnifyedCoreButton,
|
|
76925
|
+
{
|
|
76926
|
+
icon: Columns3Cog,
|
|
76927
|
+
onClick: (e) => handleAction("ColumnChooser", e),
|
|
76928
|
+
size: "small",
|
|
76929
|
+
ariaLabel: "Column Chooser",
|
|
76930
|
+
category: "secondary"
|
|
76931
|
+
}
|
|
76932
|
+
),
|
|
76933
|
+
showFilter && /* @__PURE__ */ jsx(
|
|
76934
|
+
UnifyedCoreButton,
|
|
76935
|
+
{
|
|
76936
|
+
icon: ListFilter,
|
|
76937
|
+
onClick: onFilterOpen,
|
|
76938
|
+
size: "small",
|
|
76939
|
+
ariaLabel: "Filters",
|
|
76940
|
+
category: "secondary"
|
|
76941
|
+
}
|
|
76942
|
+
),
|
|
76943
|
+
showPrint && /* @__PURE__ */ jsx(
|
|
76944
|
+
UnifyedCoreButton,
|
|
76945
|
+
{
|
|
76946
|
+
icon: Printer,
|
|
76947
|
+
onClick: () => handleAction("Print"),
|
|
76948
|
+
ariaLabel: "Print",
|
|
76949
|
+
size: "small",
|
|
76950
|
+
category: "secondary"
|
|
76951
|
+
}
|
|
76952
|
+
),
|
|
76953
|
+
showExcel && /* @__PURE__ */ jsx(
|
|
76954
|
+
UnifyedCoreButton,
|
|
76955
|
+
{
|
|
76956
|
+
icon: FileSpreadsheet,
|
|
76957
|
+
onClick: () => handleAction("Excel"),
|
|
76958
|
+
ariaLabel: "Excel Download",
|
|
76959
|
+
size: "small",
|
|
76960
|
+
category: "secondary"
|
|
76961
|
+
}
|
|
76962
|
+
),
|
|
76963
|
+
showPdf && /* @__PURE__ */ jsx(
|
|
76964
|
+
UnifyedCoreButton,
|
|
76965
|
+
{
|
|
76966
|
+
icon: FileText,
|
|
76967
|
+
onClick: () => handleAction("Pdf"),
|
|
76968
|
+
ariaLabel: "Pdf Download",
|
|
76969
|
+
size: "small",
|
|
76970
|
+
category: "secondary"
|
|
76971
|
+
}
|
|
76972
|
+
),
|
|
76973
|
+
showRefresh && /* @__PURE__ */ jsx(
|
|
76974
|
+
UnifyedCoreButton,
|
|
76975
|
+
{
|
|
76976
|
+
icon: RefreshCcw,
|
|
76977
|
+
onClick: () => handleAction("Refresh"),
|
|
76978
|
+
ariaLabel: "Refresh",
|
|
76979
|
+
size: "small",
|
|
76980
|
+
category: "secondary"
|
|
76981
|
+
}
|
|
76982
|
+
)
|
|
76983
|
+
] }),
|
|
76984
|
+
/* @__PURE__ */ jsx("div", { children: showAdd && onAdd && /* @__PURE__ */ jsx(
|
|
76985
|
+
UnifyedCoreButton,
|
|
76986
|
+
{
|
|
76987
|
+
label: addBtnText,
|
|
76988
|
+
icon: Plus,
|
|
76989
|
+
onClick: onAdd,
|
|
76990
|
+
size: "small"
|
|
76991
|
+
}
|
|
76992
|
+
) })
|
|
76993
|
+
] })
|
|
76994
|
+
] })
|
|
76995
|
+
] });
|
|
76996
|
+
};
|
|
76997
|
+
|
|
76998
|
+
export { AddUserGroupsRolesModal, Avatar, AvatarGroup$1 as AvatarGroup, Badge, Breadcrumbs, Button$1 as Button, Checkbox, ConfigRenderFactory, CustomDialog, CustomGridToolbar, DataTableRenderer, DatePicker, DateRangePicker$1 as DateRangePicker, DynamicConfig, DynamicConfig_stories as DynamicConfigStory, FileUploadModal, FullConfigPage, FullScreenLoader, GenericFilter, Input, Modal, MultiSelect, OptionsMenu, PageHeader, PageLayout, Pagination, RadioGroup, SearchBar, SectionRenderer, Select, Sidebar, Spinner, Textarea, ToastProvider, ToggleSwitch, Tooltip, TreeView, UnifyedCoreButton, WizardModal, adGroupsListSearchApi, axiosDelete, axiosGet, axiosPatch, axiosPost, axiosPut, cookies$1 as cookies, createHttpClient, directoryPermissionsApi, filePermissionsApi, gateWayUrl, gatewayBase, getBaseUrl, getComponentForType, getSnapshot, http, localStore, myDriveGatewayBaseV2, notify, provisioningBase, rbacBase, register, renderByType, searchRolesApi, sessionStore, userSearchBase };
|
|
75146
76999
|
//# sourceMappingURL=unifyedx-storybook-new.es.js.map
|