web-mojo 2.1.1101 → 2.1.1102

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.
Files changed (46) hide show
  1. package/dist/admin.cjs.js +1 -1
  2. package/dist/admin.es.js +6 -6
  3. package/dist/auth.cjs.js +1 -1
  4. package/dist/auth.es.js +1 -1
  5. package/dist/charts.cjs.js +1 -1
  6. package/dist/charts.es.js +3 -3
  7. package/dist/chunks/{ChatView-ZqTCdUZP.js → ChatView-BPiICb6r.js} +2 -2
  8. package/dist/chunks/{ChatView-ZqTCdUZP.js.map → ChatView-BPiICb6r.js.map} +1 -1
  9. package/dist/chunks/{ChatView-oka6O6VS.js → ChatView-CQf_AUAm.js} +2 -2
  10. package/dist/chunks/{ChatView-oka6O6VS.js.map → ChatView-CQf_AUAm.js.map} +1 -1
  11. package/dist/chunks/{Dialog-DwgF3hri.js → Dialog-D4-rbbQ3.js} +2 -2
  12. package/dist/chunks/Dialog-D4-rbbQ3.js.map +1 -0
  13. package/dist/chunks/{Dialog-DRf1-ZSd.js → Dialog-e0j2Y7-Q.js} +25 -7
  14. package/dist/chunks/Dialog-e0j2Y7-Q.js.map +1 -0
  15. package/dist/chunks/{MetricsMiniChartWidget-DlmsNmJy.js → MetricsMiniChartWidget-CmH3DMBo.js} +2 -2
  16. package/dist/chunks/{MetricsMiniChartWidget-DlmsNmJy.js.map → MetricsMiniChartWidget-CmH3DMBo.js.map} +1 -1
  17. package/dist/chunks/{MetricsMiniChartWidget-DRIJwI91.js → MetricsMiniChartWidget-CxtXMe1A.js} +2 -2
  18. package/dist/chunks/{MetricsMiniChartWidget-DRIJwI91.js.map → MetricsMiniChartWidget-CxtXMe1A.js.map} +1 -1
  19. package/dist/chunks/{PDFViewer-Cx3C0CHL.js → PDFViewer-CYry-Huc.js} +2 -2
  20. package/dist/chunks/{PDFViewer-Cx3C0CHL.js.map → PDFViewer-CYry-Huc.js.map} +1 -1
  21. package/dist/chunks/{PDFViewer-BRy3UHth.js → PDFViewer-wwUYCy9j.js} +2 -2
  22. package/dist/chunks/{PDFViewer-BRy3UHth.js.map → PDFViewer-wwUYCy9j.js.map} +1 -1
  23. package/dist/chunks/TokenManager-BW19_-5-.js +2 -0
  24. package/dist/chunks/TokenManager-BW19_-5-.js.map +1 -0
  25. package/dist/chunks/{TokenManager-CWi9-XBF.js → TokenManager-CDOXxkjK.js} +21 -5
  26. package/dist/chunks/TokenManager-CDOXxkjK.js.map +1 -0
  27. package/dist/chunks/{version-Ce-8QdEq.js → version-Bjn4rg0G.js} +2 -2
  28. package/dist/chunks/{version-Ce-8QdEq.js.map → version-Bjn4rg0G.js.map} +1 -1
  29. package/dist/chunks/{version-Be_W-mxT.js → version-C11Oq51n.js} +4 -4
  30. package/dist/chunks/{version-Be_W-mxT.js.map → version-C11Oq51n.js.map} +1 -1
  31. package/dist/core.css +144 -0
  32. package/dist/css/web-mojo.css +1 -1
  33. package/dist/docit.cjs.js +1 -1
  34. package/dist/docit.es.js +3 -3
  35. package/dist/index.cjs.js +1 -1
  36. package/dist/index.cjs.js.map +1 -1
  37. package/dist/index.es.js +307 -19
  38. package/dist/index.es.js.map +1 -1
  39. package/dist/lightbox.cjs.js +1 -1
  40. package/dist/lightbox.es.js +4 -4
  41. package/package.json +1 -1
  42. package/dist/chunks/Dialog-DRf1-ZSd.js.map +0 -1
  43. package/dist/chunks/Dialog-DwgF3hri.js.map +0 -1
  44. package/dist/chunks/TokenManager-CWi9-XBF.js.map +0 -1
  45. package/dist/chunks/TokenManager-DVrApE_3.js +0 -2
  46. package/dist/chunks/TokenManager-DVrApE_3.js.map +0 -1
package/dist/index.es.js CHANGED
@@ -1,14 +1,14 @@
1
- import { B, a, V, b, c, d } from "./chunks/version-Be_W-mxT.js";
1
+ import { B, a, V, b, c, d } from "./chunks/version-C11Oq51n.js";
2
2
  import { V as View, d as dataFormatter, a as Mustache } from "./chunks/Rest-DpbPbmra.js";
3
3
  import { D, b as b2, M, r } from "./chunks/Rest-DpbPbmra.js";
4
4
  import { G as GroupList, P as Page, T as ToastService, U as User, a as Group } from "./chunks/ContextMenu-Dfdrnd0f.js";
5
5
  import { C, b as b3, e, f, g, h, i, d as d2, c as c2 } from "./chunks/ContextMenu-Dfdrnd0f.js";
6
- import { D as Dialog, W as WebApp } from "./chunks/Dialog-DRf1-ZSd.js";
7
- import { E, R } from "./chunks/Dialog-DRf1-ZSd.js";
6
+ import { D as Dialog, W as WebApp } from "./chunks/Dialog-e0j2Y7-Q.js";
7
+ import { E, R } from "./chunks/Dialog-e0j2Y7-Q.js";
8
8
  import { C as C2, M as M2 } from "./chunks/Collection-CsAk0UhA.js";
9
- import { M as Member } from "./chunks/ChatView-oka6O6VS.js";
10
- import { Z, e as e2, d as d3, C as C3, a1, $, E as E2, j, i as i2, q, s, r as r2, w, y, x, t, v, u, F, f as f2, au, av, B as B2, I, A, z, G, N, O, D as D2, K, L, H, J, Y, a2, a7, a8, a4, a3, a5, a6, aa, ac, ab, a9, ad, ae, k, m, l, _, ag, af, aj, ah, ai, P, ao, as, ap, aq, ar, ak, al, am, at, an, V as V2, X, W, R as R2, U, Q, S, h as h2, g as g2, n, p, o, c as c3, b as b4, a as a10, T, aw, aB, aA, ax, ay, az, a0 } from "./chunks/ChatView-oka6O6VS.js";
11
- import { S as SimpleSearchView, T as TokenManager, a as TopNav } from "./chunks/TokenManager-CWi9-XBF.js";
9
+ import { M as Member } from "./chunks/ChatView-CQf_AUAm.js";
10
+ import { Z, e as e2, d as d3, C as C3, a1, $, E as E2, j, i as i2, q, s, r as r2, w, y, x, t, v, u, F, f as f2, au, av, B as B2, I, A, z, G, N, O, D as D2, K, L, H, J, Y, a2, a7, a8, a4, a3, a5, a6, aa, ac, ab, a9, ad, ae, k, m, l, _, ag, af, aj, ah, ai, P, ao, as, ap, aq, ar, ak, al, am, at, an, V as V2, X, W, R as R2, U, Q, S, h as h2, g as g2, n, p, o, c as c3, b as b4, a as a10, T, aw, aB, aA, ax, ay, az, a0 } from "./chunks/ChatView-CQf_AUAm.js";
11
+ import { S as SimpleSearchView, T as TokenManager, a as TopNav } from "./chunks/TokenManager-CDOXxkjK.js";
12
12
  import { a as a11, L as L2 } from "./chunks/ListView-BGJG4GYH.js";
13
13
  import { default as default2 } from "./chunks/DataView-QXyfcg2M.js";
14
14
  import { F as F2, a as a12 } from "./chunks/FormView-DJBMpeMY.js";
@@ -252,6 +252,286 @@ const ConsoleSilencer = {
252
252
  LEVELS
253
253
  };
254
254
  const installConsoleSilencer = (options) => ConsoleSilencer.install(options);
255
+ class GroupSearchView extends SimpleSearchView {
256
+ constructor(options = {}) {
257
+ super({
258
+ ...options,
259
+ className: `group-search-view ${options.className || ""}`.trim()
260
+ });
261
+ this.showKind = options.showKind !== void 0 ? options.showKind : true;
262
+ this.parentField = options.parentField || "parent";
263
+ this.kindField = options.kindField || "kind";
264
+ this.expandedNodes = /* @__PURE__ */ new Set();
265
+ this.treeData = [];
266
+ this.flattenedItems = [];
267
+ this.autoExpandRoot = options.autoExpandRoot !== void 0 ? options.autoExpandRoot : true;
268
+ this.autoExpandAll = options.autoExpandAll || false;
269
+ this.indentSize = options.indentSize || 20;
270
+ this.showLines = options.showLines !== void 0 ? options.showLines : true;
271
+ }
272
+ /**
273
+ * Build tree hierarchy from flat list
274
+ */
275
+ buildTreeHierarchy(items) {
276
+ if (!items || items.length === 0) {
277
+ return [];
278
+ }
279
+ const itemsById = /* @__PURE__ */ new Map();
280
+ items.forEach((item) => {
281
+ if (!itemsById.has(item.id)) {
282
+ itemsById.set(item.id, {
283
+ ...item,
284
+ children: [],
285
+ level: 0,
286
+ hasChildren: false,
287
+ isExpanded: false
288
+ });
289
+ }
290
+ const parentObj = item[this.parentField];
291
+ if (parentObj && parentObj.id && !itemsById.has(parentObj.id)) {
292
+ itemsById.set(parentObj.id, {
293
+ ...parentObj,
294
+ children: [],
295
+ level: 0,
296
+ hasChildren: false,
297
+ isExpanded: false
298
+ });
299
+ }
300
+ });
301
+ const rootItems = [];
302
+ itemsById.forEach((treeItem, itemId) => {
303
+ const originalItem = items.find((i3) => i3.id === itemId) || treeItem;
304
+ const parentId = originalItem[this.parentField]?.id;
305
+ if (parentId && itemsById.has(parentId)) {
306
+ const parent = itemsById.get(parentId);
307
+ parent.children.push(treeItem);
308
+ parent.hasChildren = true;
309
+ if (this.autoExpandAll || this.autoExpandRoot && parent.level === 0) {
310
+ this.expandedNodes.add(parent.id);
311
+ parent.isExpanded = true;
312
+ }
313
+ } else {
314
+ rootItems.push(treeItem);
315
+ if (this.autoExpandRoot) {
316
+ this.expandedNodes.add(treeItem.id);
317
+ treeItem.isExpanded = true;
318
+ }
319
+ }
320
+ });
321
+ const calculateLevels = (nodes, level = 0) => {
322
+ nodes.forEach((node) => {
323
+ node.level = level;
324
+ node.isExpanded = this.expandedNodes.has(node.id);
325
+ if (node.children.length > 0) {
326
+ node.children.sort((a13, b5) => (a13.name || "").localeCompare(b5.name || ""));
327
+ calculateLevels(node.children, level + 1);
328
+ }
329
+ });
330
+ };
331
+ rootItems.sort((a13, b5) => (a13.name || "").localeCompare(b5.name || ""));
332
+ calculateLevels(rootItems);
333
+ return rootItems;
334
+ }
335
+ /**
336
+ * Flatten tree structure for rendering
337
+ */
338
+ flattenTree(nodes, result = []) {
339
+ nodes.forEach((node, index2) => {
340
+ node._isLastChild = index2 === nodes.length - 1;
341
+ result.push(node);
342
+ if (node.isExpanded && node.children.length > 0) {
343
+ this.flattenTree(node.children, result);
344
+ }
345
+ });
346
+ return result;
347
+ }
348
+ /**
349
+ * Update filtered items with tree structure
350
+ */
351
+ updateFilteredItems() {
352
+ if (!this.collection) {
353
+ this.filteredItems = [];
354
+ this.treeData = [];
355
+ this.flattenedItems = [];
356
+ return;
357
+ }
358
+ const items = this.collection.toJSON();
359
+ let filteredItems = items;
360
+ if (this.searchValue && this.searchValue.trim()) {
361
+ const searchTerm = this.searchValue.toLowerCase().trim();
362
+ filteredItems = items.filter((item) => {
363
+ return this.searchFields.some((field) => {
364
+ const value = this.getNestedValue(item, field);
365
+ return value && value.toString().toLowerCase().includes(searchTerm);
366
+ });
367
+ });
368
+ }
369
+ this.treeData = this.buildTreeHierarchy(filteredItems);
370
+ this.flattenedItems = this.flattenTree(this.treeData);
371
+ this.filteredItems = this.flattenedItems;
372
+ this.updateResultsView();
373
+ }
374
+ /**
375
+ * Toggle node expansion
376
+ */
377
+ toggleNode(itemId) {
378
+ if (this.expandedNodes.has(itemId)) {
379
+ this.expandedNodes.delete(itemId);
380
+ } else {
381
+ this.expandedNodes.add(itemId);
382
+ }
383
+ this.updateFilteredItems();
384
+ }
385
+ /**
386
+ * Handle expand/collapse button clicks
387
+ */
388
+ async handleActionToggleNode(event, element) {
389
+ event.preventDefault();
390
+ event.stopPropagation();
391
+ const itemId = parseInt(element.getAttribute("data-item-id"));
392
+ if (!isNaN(itemId)) {
393
+ this.toggleNode(itemId);
394
+ }
395
+ }
396
+ /**
397
+ * Get tree-specific item template
398
+ */
399
+ getDefaultItemTemplate() {
400
+ return `
401
+ <div class="tree-item-content">
402
+ <div class="tree-item-name">{{name}}</div>
403
+ {{#showKind}}
404
+ <div class="tree-item-kind">{{kind}}</div>
405
+ {{/showKind}}
406
+ </div>
407
+ `;
408
+ }
409
+ /**
410
+ * Process item template with tree structure
411
+ */
412
+ processItemTemplate(item) {
413
+ const indent = item.level * this.indentSize;
414
+ const hasChildren = item.hasChildren;
415
+ const isExpanded = item.isExpanded;
416
+ let expandIcon = "";
417
+ if (hasChildren) {
418
+ const iconClass = isExpanded ? "bi-chevron-down" : "bi-chevron-right";
419
+ expandIcon = `
420
+ <button class="tree-expand-btn"
421
+ type="button"
422
+ data-action="toggle-node"
423
+ data-item-id="${item.id}"
424
+ aria-label="${isExpanded ? "Collapse" : "Expand"}">
425
+ <i class="bi ${iconClass}"></i>
426
+ </button>
427
+ `;
428
+ } else {
429
+ expandIcon = '<span class="tree-expand-spacer"></span>';
430
+ }
431
+ let content = this.itemTemplate;
432
+ content = content.replace(/\{\{(\w+)\}\}/g, (match, prop) => {
433
+ if (prop === "showKind") {
434
+ return this.showKind ? "true" : "";
435
+ }
436
+ return this.getNestedValue(item, prop) || "";
437
+ });
438
+ if (this.showKind) {
439
+ content = content.replace(/\{\{#showKind\}\}(.*?)\{\{\/showKind\}\}/gs, "$1");
440
+ } else {
441
+ content = content.replace(/\{\{#showKind\}\}.*?\{\{\/showKind\}\}/gs, "");
442
+ }
443
+ let treeConnector = "";
444
+ if (this.showLines && item.level > 0) {
445
+ const isLastChild = item._isLastChild || false;
446
+ const connectorClass = isLastChild ? "tree-connector-last" : "tree-connector";
447
+ treeConnector = `<span class="${connectorClass}"></span>`;
448
+ }
449
+ return `
450
+ <div class="tree-item-wrapper" data-tree-level="${item.level}">
451
+ <div class="tree-indent" style="width: ${indent}px;">
452
+ ${treeConnector}
453
+ </div>
454
+ <div class="tree-item-expand">
455
+ ${expandIcon}
456
+ </div>
457
+ <div class="tree-item-body flex-grow-1">
458
+ ${content}
459
+ </div>
460
+ </div>
461
+ `;
462
+ }
463
+ /**
464
+ * Expand all nodes
465
+ */
466
+ expandAll() {
467
+ const expandRecursive = (nodes) => {
468
+ nodes.forEach((node) => {
469
+ if (node.hasChildren) {
470
+ this.expandedNodes.add(node.id);
471
+ expandRecursive(node.children);
472
+ }
473
+ });
474
+ };
475
+ expandRecursive(this.treeData);
476
+ this.updateFilteredItems();
477
+ }
478
+ /**
479
+ * Collapse all nodes
480
+ */
481
+ collapseAll() {
482
+ this.expandedNodes.clear();
483
+ this.updateFilteredItems();
484
+ }
485
+ /**
486
+ * Expand to specific node (and all parents)
487
+ */
488
+ expandToNode(nodeId) {
489
+ const findAndExpandParents = (nodes, targetId, parents = []) => {
490
+ for (const node of nodes) {
491
+ if (node.id === targetId) {
492
+ parents.forEach((parent) => {
493
+ this.expandedNodes.add(parent.id);
494
+ });
495
+ this.expandedNodes.add(node.id);
496
+ return true;
497
+ }
498
+ if (node.children.length > 0) {
499
+ if (findAndExpandParents(node.children, targetId, [...parents, node])) {
500
+ return true;
501
+ }
502
+ }
503
+ }
504
+ return false;
505
+ };
506
+ if (findAndExpandParents(this.treeData, nodeId)) {
507
+ this.updateFilteredItems();
508
+ }
509
+ }
510
+ /**
511
+ * Get all root items
512
+ */
513
+ getRootItems() {
514
+ return this.treeData;
515
+ }
516
+ /**
517
+ * Get children of a specific node
518
+ */
519
+ getNodeChildren(nodeId) {
520
+ const findNode = (nodes, targetId) => {
521
+ for (const node of nodes) {
522
+ if (node.id === targetId) {
523
+ return node.children;
524
+ }
525
+ if (node.children.length > 0) {
526
+ const found = findNode(node.children, targetId);
527
+ if (found) return found;
528
+ }
529
+ }
530
+ return null;
531
+ };
532
+ return findNode(this.treeData, nodeId) || [];
533
+ }
534
+ }
255
535
  class Sidebar extends View {
256
536
  constructor(options = {}) {
257
537
  super({
@@ -299,7 +579,7 @@ class Sidebar extends View {
299
579
  }
300
580
  }
301
581
  this.initializeTooltips();
302
- this.searchView = new SimpleSearchView({
582
+ this.searchView = new GroupSearchView({
303
583
  noAppend: true,
304
584
  showExitButton: true,
305
585
  headerText: "Select Group",
@@ -350,28 +630,36 @@ class Sidebar extends View {
350
630
  */
351
631
  async showGroupSearchDialog() {
352
632
  const collection = new GroupList();
353
- const searchView = new SimpleSearchView({
633
+ const searchView = new GroupSearchView({
354
634
  Collection: GroupList,
355
635
  collection,
356
636
  // Pass the collection instance
357
- itemTemplate: `
358
- <div class="p-3 border-bottom">
359
- <div class="fw-semibold text-dark">{{name}}</div>
360
- <small class="text-muted">#{{id}} {{kind}}</small>
361
- </div>
362
- `,
363
637
  searchFields: ["name"],
364
- headerText: "Select Group",
638
+ headerText: null,
365
639
  searchPlaceholder: "Search groups...",
366
- headerIcon: "bi-building",
367
- showExitButton: false
640
+ headerIcon: null,
641
+ maxHeight: Math.min(600, window.innerHeight - 200),
642
+ showExitButton: false,
643
+ showKind: true,
644
+ // Show kind badges (default: true)
645
+ parentField: "parent",
646
+ // Field containing parent object
647
+ kindField: "kind",
648
+ // Field containing kind/type
649
+ autoExpandRoot: true,
650
+ // Auto-expand root items (default: true)
651
+ autoExpandAll: false,
652
+ // Auto-expand all nodes (default: false)
653
+ indentSize: 20,
654
+ // Pixels per level (default: 20)
655
+ showLines: true
368
656
  });
369
657
  this.groupSelectorDialog = new Dialog({
370
- title: "Select Group",
371
658
  body: searchView,
372
659
  size: "md",
373
- scrollable: true,
660
+ header: null,
374
661
  noBodyPadding: true,
662
+ scrollable: false,
375
663
  buttons: [],
376
664
  closeButton: true
377
665
  });