@syncfusion/ej2-navigations 34.2.2 → 34.2.4

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 (79) hide show
  1. package/dist/ej2-navigations.min.js +2 -2
  2. package/dist/ej2-navigations.umd.min.js +2 -2
  3. package/dist/ej2-navigations.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-navigations.es2015.js +310 -563
  5. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  6. package/dist/es6/ej2-navigations.es5.js +312 -563
  7. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  8. package/dist/global/ej2-navigations.min.js +2 -2
  9. package/dist/global/ej2-navigations.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +3 -3
  12. package/src/common/menu-base.js +14 -6
  13. package/src/treeview/treeview-model.d.ts +1 -0
  14. package/src/treeview/treeview.d.ts +7 -210
  15. package/src/treeview/treeview.js +298 -557
  16. package/styles/bds-lite.css +3 -0
  17. package/styles/bds.css +3 -0
  18. package/styles/bootstrap-dark-lite.css +3 -0
  19. package/styles/bootstrap-dark.css +3 -0
  20. package/styles/bootstrap-lite.css +3 -0
  21. package/styles/bootstrap.css +3 -0
  22. package/styles/bootstrap4-lite.css +3 -0
  23. package/styles/bootstrap4.css +3 -0
  24. package/styles/bootstrap5-dark-lite.css +3 -0
  25. package/styles/bootstrap5-dark.css +3 -0
  26. package/styles/bootstrap5-lite.css +3 -0
  27. package/styles/bootstrap5.3-lite.css +3 -0
  28. package/styles/bootstrap5.3.css +3 -0
  29. package/styles/bootstrap5.css +3 -0
  30. package/styles/fabric-dark-lite.css +3 -0
  31. package/styles/fabric-dark.css +3 -0
  32. package/styles/fabric-lite.css +3 -0
  33. package/styles/fabric.css +3 -0
  34. package/styles/fluent-dark-lite.css +3 -0
  35. package/styles/fluent-dark.css +3 -0
  36. package/styles/fluent-lite.css +3 -0
  37. package/styles/fluent.css +3 -0
  38. package/styles/fluent2-lite.css +3 -0
  39. package/styles/fluent2.css +3 -0
  40. package/styles/highcontrast-light-lite.css +3 -0
  41. package/styles/highcontrast-light.css +3 -0
  42. package/styles/highcontrast-lite.css +3 -0
  43. package/styles/highcontrast.css +3 -0
  44. package/styles/material-dark-lite.css +3 -0
  45. package/styles/material-dark.css +3 -0
  46. package/styles/material-lite.css +3 -0
  47. package/styles/material.css +3 -0
  48. package/styles/material3-dark-lite.css +3 -0
  49. package/styles/material3-dark.css +3 -0
  50. package/styles/material3-lite.css +3 -0
  51. package/styles/material3.css +3 -0
  52. package/styles/tailwind-dark-lite.css +3 -0
  53. package/styles/tailwind-dark.css +3 -0
  54. package/styles/tailwind-lite.css +3 -0
  55. package/styles/tailwind.css +3 -0
  56. package/styles/tailwind3-lite.css +3 -0
  57. package/styles/tailwind3.css +3 -0
  58. package/styles/toolbar/_layout.scss +4 -0
  59. package/styles/toolbar/bds.css +3 -0
  60. package/styles/toolbar/bootstrap-dark.css +3 -0
  61. package/styles/toolbar/bootstrap.css +3 -0
  62. package/styles/toolbar/bootstrap4.css +3 -0
  63. package/styles/toolbar/bootstrap5-dark.css +3 -0
  64. package/styles/toolbar/bootstrap5.3.css +3 -0
  65. package/styles/toolbar/bootstrap5.css +3 -0
  66. package/styles/toolbar/fabric-dark.css +3 -0
  67. package/styles/toolbar/fabric.css +3 -0
  68. package/styles/toolbar/fluent-dark.css +3 -0
  69. package/styles/toolbar/fluent.css +3 -0
  70. package/styles/toolbar/fluent2.css +3 -0
  71. package/styles/toolbar/highcontrast-light.css +3 -0
  72. package/styles/toolbar/highcontrast.css +3 -0
  73. package/styles/toolbar/material-dark.css +3 -0
  74. package/styles/toolbar/material.css +3 -0
  75. package/styles/toolbar/material3-dark.css +3 -0
  76. package/styles/toolbar/material3.css +3 -0
  77. package/styles/toolbar/tailwind-dark.css +3 -0
  78. package/styles/toolbar/tailwind.css +3 -0
  79. package/styles/toolbar/tailwind3.css +3 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 34.2.2
3
+ * version : 34.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-navigations",
3
- "version": "34.2.2",
3
+ "version": "34.2.4",
4
4
  "description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,13 +8,13 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-navigations.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~34.2.2",
11
+ "@syncfusion/ej2-base": "~34.2.4",
12
12
  "@syncfusion/ej2-buttons": "~34.2.2",
13
13
  "@syncfusion/ej2-data": "~34.2.2",
14
14
  "@syncfusion/ej2-inputs": "~34.2.2",
15
15
  "@syncfusion/ej2-lists": "~34.2.2",
16
16
  "@syncfusion/ej2-notifications": "~34.2.2",
17
- "@syncfusion/ej2-popups": "~34.2.2"
17
+ "@syncfusion/ej2-popups": "~34.2.4"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -437,8 +437,10 @@ var MenuBase = /** @class */ (function (_super) {
437
437
  if (!active) {
438
438
  return;
439
439
  }
440
+ var isInputElement = active.tagName === 'INPUT' || active.tagName === 'TEXTAREA' ||
441
+ active.contentEditable === 'true';
440
442
  var expanded = active.getAttribute('aria-expanded') === 'true';
441
- if (!expanded) {
443
+ if (!expanded || isInputElement) {
442
444
  return;
443
445
  }
444
446
  var ul = this.element;
@@ -552,13 +554,19 @@ var MenuBase = /** @class */ (function (_super) {
552
554
  var cli = cul.children[fliIdx];
553
555
  fliIdx = this.isValidLI(cli, fliIdx, e.action);
554
556
  cul.children[fliIdx].classList.add(FOCUSED);
555
- cul.children[fliIdx].focus();
557
+ var liToFocus = cul.children[fliIdx];
556
558
  if (closest(this.element, '.e-popup')) {
557
- var focusedLiItem = cul.children[fliIdx];
558
- var focusableChild = focusedLiItem.querySelector('[tabindex], span[tabindex], a, button, [tabindex]:not([tabindex="-1"])');
559
- if (!focusableChild) {
560
- cul.focus();
559
+ var focusableChild = liToFocus.querySelector('[tabindex], span[tabindex], a, button, [tabindex]:not([tabindex="-1"])');
560
+ var isSpreadsheet = this.element.id.includes('_cf_menu') && this.element.parentElement.classList.contains('e-cf-menu');
561
+ if (focusableChild && !isSpreadsheet) {
562
+ focusableChild.focus();
561
563
  }
564
+ else {
565
+ liToFocus.focus();
566
+ }
567
+ }
568
+ else {
569
+ liToFocus.focus();
562
570
  }
563
571
  };
564
572
  MenuBase.prototype.isValidLI = function (cli, index, action) {
@@ -222,6 +222,7 @@ export interface TreeViewModel extends ComponentModel{
222
222
  * This value is used to calculate the virtual viewport and the total scrollable height.
223
223
  *
224
224
  * @default undefined
225
+ * @aspType string
225
226
  */
226
227
  height?: string | number;
227
228
 
@@ -553,53 +553,24 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
553
553
  private OldCheckedData;
554
554
  private isHiddenItem;
555
555
  private nodeIndex;
556
- /** Flat ordered list of all currently-visible (non-collapsed) tree nodes. */
557
556
  private virtualFlatNodes;
558
- /** Maps node id → index in virtualFlatNodes for O(1) lookups. */
559
557
  private virtualNodeMap;
560
- /** Set of expanded node IDs for O(1) lookup performance during flattening (avoids array indexOf). */
561
558
  private virtualExpandedNodesSet;
562
- /** Set of checked node IDs for O(1) lookup performance during flattening. */
563
559
  private virtualCheckedNodesSet;
564
- /** Set of indeterminate node IDs — persists across flattenVisibleNodes() rebuilds. */
565
560
  private virtualIndeterminateNodesSet;
566
- /** Set of selected node IDs for O(1) lookup performance during flattening. */
567
561
  private virtualSelectedNodesSet;
568
- /** Row height in pixels, measured from the first rendered item or set to 40 as a default. */
569
562
  private virtualItemHeight;
570
- /** Height of the scrollable container in pixels. */
571
563
  private virtualViewportHeight;
572
- /** scrollTop captured during the previous scroll handler invocation. */
573
564
  private virtualPrevScrollTop;
574
- /** Index of the first rendered row in the current window. */
575
565
  private virtualStartIndex;
576
- /** Index one past the last rendered row in the current window. */
577
566
  private virtualEndIndex;
578
- /** Extra rows rendered above and below the visible window to smooth scrolling. */
579
567
  private virtualOverscanCount;
580
- /** RequestAnimationFrame handle used for throttling scroll events. */
581
568
  private virtualScrollRAF;
582
- /** The `.e-mask-parent` overlay element shown during fast scroll. */
583
569
  private virtualMaskElement;
584
- /** Bound scroll handler stored for later removeEventListener. */
585
570
  private virtualScrollBound;
586
- /** Skeleton component instances inside the mask overlay. */
587
571
  private skeletonInstances;
588
- /** Set to true whenever the flat node list must be rebuilt on next render. */
589
572
  private virtualTreeDirty;
590
- /** The data-uid of the currently keyboard-focused node in virtual mode (persists across re-renders). */
591
573
  private virtualFocusedId;
592
- /**
593
- * Set to true by the document-level `keydown` handler when the user presses
594
- * the Tab key. The browser will auto-scroll the focused element into view
595
- * immediately after focus, which fires a `scroll` event on the TreeView
596
- * container. We want to skip the re-render that the virtual scroll handler
597
- * would otherwise trigger, because the element being focused is already
598
- * rendered (it is the single `<li tabindex="0">` of the current window) and
599
- * re-rendering would tear down the DOM element that is currently holding
600
- * focus. The flag is consumed (reset to `false`) inside `onVirtualScroll`
601
- * after the auto-scroll has been handled.
602
- */
603
574
  private virtualSkipNextScrollRender;
604
575
  /**
605
576
  * Indicates whether the TreeView allows drag and drop of nodes. To drag and drop a node in
@@ -662,6 +633,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
662
633
  * This value is used to calculate the virtual viewport and the total scrollable height.
663
634
  *
664
635
  * @default undefined
636
+ * @aspType string
665
637
  */
666
638
  height: string | number;
667
639
  /**
@@ -1346,6 +1318,8 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1346
1318
  private appendIndicator;
1347
1319
  private dropAction;
1348
1320
  private appendNode;
1321
+ private virtualMoveAsSibling;
1322
+ private virtualMoveAsChild;
1349
1323
  private dropAsSiblingNode;
1350
1324
  private dropAsChildNode;
1351
1325
  private moveData;
@@ -1436,211 +1410,34 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1436
1410
  private dmFailure;
1437
1411
  private updatePreviousText;
1438
1412
  private getHierarchicalParentId;
1439
- /**
1440
- * Parses the `height` property (string like '400px' or number) to a pixel value.
1441
- * Returns 0 if the value cannot be determined.
1442
- *
1443
- * @returns {number} Pixel height.
1444
- * @private
1445
- */
1446
1413
  private parseHeightToPixels;
1447
- /**
1448
- * Measures the height of the first rendered list item so subsequent calculations
1449
- * use real layout values. Falls back to the stored `virtualItemHeight` default (40).
1450
- *
1451
- * @returns {number} Row height in pixels.
1452
- * @private
1453
- */
1454
1414
  private measureVirtualItemHeight;
1455
- /**
1456
- * Rebuilds the cached Sets for checked/selected nodes to enable O(1) lookup
1457
- * during the flatten operation instead of O(n) array indexOf calls.
1458
- *
1459
- * @returns {void}
1460
- * @private
1461
- */
1462
1415
  private rebuildVirtualCheckCache;
1463
- /**
1464
- * Recursively walks the treeData (or groupedData for flat lists) and builds
1465
- * `virtualFlatNodes` — an ordered list of every node that is currently visible
1466
- * (i.e. its ancestors are all expanded). Uses cached Sets for O(1) state lookups.
1467
- *
1468
- * @returns {VirtualNodeData[]} Ordered flat list of visible nodes.
1469
- * @private
1470
- */
1471
1416
  private flattenVisibleNodes;
1472
- /**
1473
- * Recursive helper for `flattenVisibleNodes`.
1474
- *
1475
- * @param {Object[]} nodes - Array of raw data objects at this level.
1476
- * @param {number} level - 1-based depth level.
1477
- * @param {string | null} parentId - The parent node id, or null for root.
1478
- * @param {VirtualNodeData[]} result - Accumulator array.
1479
- * @returns {void}
1480
- * @private
1481
- */
1482
1417
  private flattenNodeRecursive;
1483
- /**
1484
- * Checks whether a raw datasource node has child records.
1485
- *
1486
- * @param {Object} raw - Raw datasource object.
1487
- * @returns {boolean} True if children exist.
1488
- * @private
1489
- */
1490
- private hasChildRecords;
1491
- /**
1492
- * Rebuilds `virtualNodeMap` (id → index) from the current `virtualFlatNodes`.
1493
- *
1494
- * @returns {void}
1495
- * @private
1496
- */
1497
1418
  private rebuildVirtualNodeMap;
1498
1419
  private getVirtualWindow;
1499
1420
  private getVirtualWindowAt;
1500
1421
  private getVirtualPadding;
1501
- /**
1502
- * Renders the virtual window into a **nested** `<ul>/<li>` hierarchy identical to
1503
- * the non-virtualized DOM structure.
1504
- *
1505
- * ## Scroll math
1506
- * The flat-index ↔ pixel mapping stays unchanged: every entry in
1507
- * `virtualFlatNodes` represents exactly one `itemHeight` row.
1508
- * `paddingTop = startIndex * itemHeight` and
1509
- * `paddingBottom = (total - endIndex) * itemHeight` keep the scrollbar
1510
- * thumb in the correct position.
1511
- *
1512
- * ## Ancestor injection
1513
- * When `startIndex` points at a child node whose ancestor(s) have already
1514
- * scrolled above the viewport (their flat indices are < startIndex), the
1515
- * ancestors would normally be missing from the DOM, forcing the children to
1516
- * fall back to the root `<ul>` as flat siblings — producing wrong HTML.
1517
- *
1518
- * To fix this, before rendering the window we walk the ancestor chain of the
1519
- * first visible node and collect every ancestor that lies **outside** the
1520
- * window. Those ancestors are injected as real `<li>` containers at the
1521
- * very top of the root `<ul>`. To compensate for their presence, `paddingTop`
1522
- * is reduced by `injectedCount * itemHeight` so the total scroll height
1523
- * remains the same.
1524
- *
1525
- * Once the ancestors are in the DOM they are registered in `renderedParentMap`
1526
- * so the normal window-rendering loop can nest children inside them exactly
1527
- * as it does when both parent and child are in the same window.
1528
- *
1529
- * @returns {void}
1530
- * @private
1531
- */
1532
1422
  private renderVirtualItems;
1533
- /**
1534
- * Creates a single `<li>` element for the virtual window representing `node`.
1535
- *
1536
- * @param {VirtualNodeData} node - The node data.
1537
- * @param {boolean} _isFirst - True if this is the first rendered item (unused here but kept for potential override).
1538
- * @returns {HTMLElement} The constructed `<li>` element.
1539
- * @private
1540
- */
1541
1423
  private createVirtualListItem;
1542
- /**
1543
- * Initialises the virtual-scrolling layout:
1544
- * 1. Adds the `e-virtualization` CSS class and applies a fixed `height` + `overflow-y`.
1545
- * 2. Flattens all visible nodes into `virtualFlatNodes`.
1546
- * 3. Measures item height and viewport height.
1547
- * 4. Computes the initial window and renders it.
1548
- * 5. Wires the scroll event handler.
1549
- *
1550
- * @returns {void}
1551
- * @private
1552
- */
1553
1424
  private initVirtualization;
1554
- /**
1555
- * Wires the scroll event listener on the TreeView element.
1556
- *
1557
- * @returns {void}
1558
- * @private
1559
- */
1560
1425
  private wireVirtualScrollEvents;
1561
- /**
1562
- * Removes the scroll event listener previously wired by `wireVirtualScrollEvents`.
1563
- *
1564
- * @returns {void}
1565
- * @private
1566
- */
1567
1426
  private unwireVirtualScrollEvents;
1568
- /**
1569
- * Scroll handler for the virtual TreeView. Throttled via `requestAnimationFrame`.
1570
- * Shows the loading mask during fast scrolls, re-renders the window, then hides the mask.
1571
- *
1572
- * @returns {void}
1573
- * @private
1574
- */
1575
1427
  private onVirtualScroll;
1576
- /**
1577
- * Creates the skeleton mask overlay used to indicate loading during fast scrolls.
1578
- * Skeleton instances are stored in `skeletonInstances` for later disposal.
1579
- *
1580
- * @returns {void}
1581
- * @private
1582
- */
1583
1428
  private createVirtualMask;
1584
- /**
1585
- * Refreshes the mask position so it always overlays the TreeView's viewport.
1586
- * Called on every show / scroll, since `position:fixed` is relative to the
1587
- * page viewport, not to the TreeView scroll container.
1588
- *
1589
- * @returns {void}
1590
- * @private
1591
- */
1592
1429
  private updateMaskPosition;
1593
- /**
1594
- * Destroys all skeleton instances and removes the mask overlay from the DOM.
1595
- *
1596
- * @returns {void}
1597
- * @private
1598
- */
1599
1430
  private destroyVirtualMask;
1600
- /**
1601
- * Positions and shows the skeleton mask at the current `scrollTop` position.
1602
- *
1603
- * @param {number} _scrollTop - Current scrollTop of the container.
1604
- * @returns {void}
1605
- * @private
1606
- */
1607
1431
  private showVirtualMask;
1608
- /**
1609
- * Hides the skeleton mask overlay after the virtual window has been rendered.
1610
- *
1611
- * @returns {void}
1612
- * @private
1613
- */
1614
1432
  private hideVirtualMask;
1615
- /**
1616
- * Ensures the node identified by `id` is scrolled into view inside the virtual container.
1617
- * If the node falls outside the rendered window, the container's `scrollTop` is adjusted so
1618
- * that the node becomes visible, the window is re-computed and `renderVirtualItems` is called.
1619
- *
1620
- * @param {string} id - The `data-uid` of the target node.
1621
- * @returns {void}
1622
- * @private
1623
- */
1624
1433
  private ensureVirtualNodeVisible;
1434
+ private findNodeInTreeData;
1435
+ private getNodeLevel;
1625
1436
  private handleVirtualExpand;
1437
+ private loadVirtualChildData;
1438
+ private completeVirtualExpand;
1626
1439
  private handleVirtualCollapse;
1627
- /**
1628
- * Updates the selected state of a node in `virtualFlatNodes` and re-renders the window.
1629
- *
1630
- * @param {string} id - The `data-uid` of the target node.
1631
- * @param {boolean} isSelected - Whether the node is now selected.
1632
- * @returns {void}
1633
- * @private
1634
- */
1635
1440
  private updateVirtualNodeSelection;
1636
- /**
1637
- * Updates the checkbox state of a node in `virtualFlatNodes` and re-renders the window.
1638
- *
1639
- * @param {string} id - The `data-uid` of the target node.
1640
- * @param {'check' | 'uncheck' | 'indeterminate'} state - The new check state.
1641
- * @returns {void}
1642
- * @private
1643
- */
1644
1441
  private updateVirtualNodeCheckState;
1645
1442
  /**
1646
1443
  * Called internally if any of the property value changed.