@syncfusion/ej2-navigations 34.2.3 → 34.2.5

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.
@@ -1,12 +1,3 @@
1
- /*!
2
- * filename: index.d.ts
3
- * version : 34.2.3
4
- * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  import * as _navigations from '@syncfusion/ej2-navigations';
11
2
 
12
3
  export declare namespace ej {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-navigations",
3
- "version": "34.2.3",
3
+ "version": "34.2.5",
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.5",
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.3"
17
+ "@syncfusion/ej2-popups": "~34.2.4"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -270,6 +270,8 @@ export declare class Toolbar extends Component<HTMLElement> implements INotifyPr
270
270
  private scrollEvent;
271
271
  private resizeContext;
272
272
  private orientationChangeContext;
273
+ private resizeObserver;
274
+ private lastObservedWidth;
273
275
  /**
274
276
  * Contains the keyboard configuration of the Toolbar.
275
277
  */
@@ -155,6 +155,7 @@ var Toolbar = /** @class */ (function (_super) {
155
155
  var _this = _super.call(this, options, element) || this;
156
156
  _this.resizeContext = _this.resize.bind(_this);
157
157
  _this.orientationChangeContext = _this.orientationChange.bind(_this);
158
+ _this.lastObservedWidth = 0;
158
159
  /**
159
160
  * Contains the keyboard configuration of the Toolbar.
160
161
  */
@@ -188,6 +189,10 @@ var Toolbar = /** @class */ (function (_super) {
188
189
  }
189
190
  });
190
191
  this.unwireEvents();
192
+ this.lastObservedWidth = 0;
193
+ if (this.resizeObserver && this.element.closest('.e-splitter')) {
194
+ this.resizeObserver.disconnect();
195
+ }
191
196
  this.tempId.forEach(function (ele) {
192
197
  if (!isNOU(_this.element.querySelector(ele))) {
193
198
  document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';
@@ -772,6 +777,17 @@ var Toolbar = /** @class */ (function (_super) {
772
777
  this.scrollEvent = this.docEvent.bind(this);
773
778
  this.renderControl();
774
779
  this.wireEvents();
780
+ if (this.element.closest('.e-splitter')) {
781
+ this.lastObservedWidth = this.element.offsetWidth;
782
+ this.resizeObserver = new window.ResizeObserver(function () {
783
+ if (_this.element.offsetWidth === _this.lastObservedWidth) {
784
+ return;
785
+ }
786
+ _this.lastObservedWidth = _this.element.offsetWidth;
787
+ _this.refreshOverflow();
788
+ });
789
+ this.resizeObserver.observe(this.element);
790
+ }
775
791
  this.renderComplete();
776
792
  if (this.isReact && this.portals && this.portals.length > 0) {
777
793
  this.renderReactTemplates(function () {
@@ -553,54 +553,27 @@ 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;
575
+ private filterCheckedNodes;
576
+ private filterIndeterminateNodes;
604
577
  /**
605
578
  * Indicates whether the TreeView allows drag and drop of nodes. To drag and drop a node in
606
579
  * desktop, hold the mouse on the node, drag it to the target node and drop the node by releasing
@@ -1108,6 +1081,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1108
1081
  private getType;
1109
1082
  private setRootData;
1110
1083
  private isChildObject;
1084
+ private isRemoteDataLoadOnDemand;
1111
1085
  private renderItems;
1112
1086
  /**
1113
1087
  * Update the checkedNodes from datasource at initial rendering
@@ -1347,6 +1321,8 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1347
1321
  private appendIndicator;
1348
1322
  private dropAction;
1349
1323
  private appendNode;
1324
+ private virtualMoveAsSibling;
1325
+ private virtualMoveAsChild;
1350
1326
  private dropAsSiblingNode;
1351
1327
  private dropAsChildNode;
1352
1328
  private moveData;
@@ -1437,223 +1413,34 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1437
1413
  private dmFailure;
1438
1414
  private updatePreviousText;
1439
1415
  private getHierarchicalParentId;
1440
- /**
1441
- * Parses the `height` property (string like '400px' or number) to a pixel value.
1442
- * Returns 0 if the value cannot be determined.
1443
- *
1444
- * @returns {number} Pixel height.
1445
- * @private
1446
- */
1447
1416
  private parseHeightToPixels;
1448
- /**
1449
- * Measures the height of the first rendered list item so subsequent calculations
1450
- * use real layout values. Falls back to the stored `virtualItemHeight` default (40).
1451
- *
1452
- * @returns {number} Row height in pixels.
1453
- * @private
1454
- */
1455
1417
  private measureVirtualItemHeight;
1456
- /**
1457
- * Rebuilds the cached Sets for checked/selected nodes to enable O(1) lookup
1458
- * during the flatten operation instead of O(n) array indexOf calls.
1459
- *
1460
- * @returns {void}
1461
- * @private
1462
- */
1463
1418
  private rebuildVirtualCheckCache;
1464
- /**
1465
- * Recursively walks the treeData (or groupedData for flat lists) and builds
1466
- * `virtualFlatNodes` — an ordered list of every node that is currently visible
1467
- * (i.e. its ancestors are all expanded). Uses cached Sets for O(1) state lookups.
1468
- *
1469
- * @returns {VirtualNodeData[]} Ordered flat list of visible nodes.
1470
- * @private
1471
- */
1472
1419
  private flattenVisibleNodes;
1473
- /**
1474
- * Recursive helper for `flattenVisibleNodes`.
1475
- *
1476
- * @param {Object[]} nodes - Array of raw data objects at this level.
1477
- * @param {number} level - 1-based depth level.
1478
- * @param {string | null} parentId - The parent node id, or null for root.
1479
- * @param {VirtualNodeData[]} result - Accumulator array.
1480
- * @returns {void}
1481
- * @private
1482
- */
1483
1420
  private flattenNodeRecursive;
1484
- /**
1485
- * Checks whether a raw datasource node has child records.
1486
- *
1487
- * @param {Object} raw - Raw datasource object.
1488
- * @returns {boolean} True if children exist.
1489
- * @private
1490
- */
1491
- private hasChildRecords;
1492
- /**
1493
- * Rebuilds `virtualNodeMap` (id → index) from the current `virtualFlatNodes`.
1494
- *
1495
- * @returns {void}
1496
- * @private
1497
- */
1498
1421
  private rebuildVirtualNodeMap;
1499
1422
  private getVirtualWindow;
1500
1423
  private getVirtualWindowAt;
1501
1424
  private getVirtualPadding;
1502
- /**
1503
- * Renders the virtual window into a **nested** `<ul>/<li>` hierarchy identical to
1504
- * the non-virtualized DOM structure.
1505
- *
1506
- * ## Scroll math
1507
- * The flat-index ↔ pixel mapping stays unchanged: every entry in
1508
- * `virtualFlatNodes` represents exactly one `itemHeight` row.
1509
- * `paddingTop = startIndex * itemHeight` and
1510
- * `paddingBottom = (total - endIndex) * itemHeight` keep the scrollbar
1511
- * thumb in the correct position.
1512
- *
1513
- * ## Ancestor injection
1514
- * When `startIndex` points at a child node whose ancestor(s) have already
1515
- * scrolled above the viewport (their flat indices are < startIndex), the
1516
- * ancestors would normally be missing from the DOM, forcing the children to
1517
- * fall back to the root `<ul>` as flat siblings — producing wrong HTML.
1518
- *
1519
- * To fix this, before rendering the window we walk the ancestor chain of the
1520
- * first visible node and collect every ancestor that lies **outside** the
1521
- * window. Those ancestors are injected as real `<li>` containers at the
1522
- * very top of the root `<ul>`. To compensate for their presence, `paddingTop`
1523
- * is reduced by `injectedCount * itemHeight` so the total scroll height
1524
- * remains the same.
1525
- *
1526
- * Once the ancestors are in the DOM they are registered in `renderedParentMap`
1527
- * so the normal window-rendering loop can nest children inside them exactly
1528
- * as it does when both parent and child are in the same window.
1529
- *
1530
- * @returns {void}
1531
- * @private
1532
- */
1533
1425
  private renderVirtualItems;
1534
- /**
1535
- * Creates a single `<li>` element for the virtual window representing `node`.
1536
- *
1537
- * @param {VirtualNodeData} node - The node data.
1538
- * @param {boolean} _isFirst - True if this is the first rendered item (unused here but kept for potential override).
1539
- * @returns {HTMLElement} The constructed `<li>` element.
1540
- * @private
1541
- */
1542
1426
  private createVirtualListItem;
1543
- /**
1544
- * Initialises the virtual-scrolling layout:
1545
- * 1. Adds the `e-virtualization` CSS class and applies a fixed `height` + `overflow-y`.
1546
- * 2. Flattens all visible nodes into `virtualFlatNodes`.
1547
- * 3. Measures item height and viewport height.
1548
- * 4. Computes the initial window and renders it.
1549
- * 5. Wires the scroll event handler.
1550
- *
1551
- * @returns {void}
1552
- * @private
1553
- */
1554
1427
  private initVirtualization;
1555
- /**
1556
- * Wires the scroll event listener on the TreeView element.
1557
- *
1558
- * @returns {void}
1559
- * @private
1560
- */
1561
1428
  private wireVirtualScrollEvents;
1562
- /**
1563
- * Removes the scroll event listener previously wired by `wireVirtualScrollEvents`.
1564
- *
1565
- * @returns {void}
1566
- * @private
1567
- */
1568
1429
  private unwireVirtualScrollEvents;
1569
- /**
1570
- * Scroll handler for the virtual TreeView. Throttled via `requestAnimationFrame`.
1571
- * Shows the loading mask during fast scrolls, re-renders the window, then hides the mask.
1572
- *
1573
- * @returns {void}
1574
- * @private
1575
- */
1576
1430
  private onVirtualScroll;
1577
- /**
1578
- * Creates the skeleton mask overlay used to indicate loading during fast scrolls.
1579
- * Skeleton instances are stored in `skeletonInstances` for later disposal.
1580
- *
1581
- * @returns {void}
1582
- * @private
1583
- */
1584
1431
  private createVirtualMask;
1585
- /**
1586
- * Refreshes the mask position so it always overlays the TreeView's viewport.
1587
- * Called on every show / scroll, since `position:fixed` is relative to the
1588
- * page viewport, not to the TreeView scroll container.
1589
- *
1590
- * @returns {void}
1591
- * @private
1592
- */
1593
1432
  private updateMaskPosition;
1594
- /**
1595
- * Destroys all skeleton instances and removes the mask overlay from the DOM.
1596
- *
1597
- * @returns {void}
1598
- * @private
1599
- */
1600
1433
  private destroyVirtualMask;
1601
- /**
1602
- * Positions and shows the skeleton mask at the current `scrollTop` position.
1603
- *
1604
- * @param {number} _scrollTop - Current scrollTop of the container.
1605
- * @returns {void}
1606
- * @private
1607
- */
1608
1434
  private showVirtualMask;
1609
- /**
1610
- * Hides the skeleton mask overlay after the virtual window has been rendered.
1611
- *
1612
- * @returns {void}
1613
- * @private
1614
- */
1615
1435
  private hideVirtualMask;
1616
- /**
1617
- * Ensures the node identified by `id` is scrolled into view inside the virtual container.
1618
- * If the node falls outside the rendered window, the container's `scrollTop` is adjusted so
1619
- * that the node becomes visible, the window is re-computed and `renderVirtualItems` is called.
1620
- *
1621
- * @param {string} id - The `data-uid` of the target node.
1622
- * @returns {void}
1623
- * @private
1624
- */
1625
1436
  private ensureVirtualNodeVisible;
1626
- /**
1627
- * Recursively walks the treeData (and any nested `childFieldName` arrays) to
1628
- * find the node whose `idFieldName` matches the given `id` (compared as
1629
- * strings). Used by the virtual-mode expand/collapse handlers so they can
1630
- * locate nodes at any depth — not just the root level — before writing the
1631
- * `expanded` flag back to the datasource.
1632
- *
1633
- * @param {string} id - The id (as a string) of the node to locate.
1634
- * @returns {Object | null} The matching raw datasource node, or null if not found.
1635
- * @private
1636
- */
1637
1437
  private findNodeInTreeData;
1438
+ private getNodeLevel;
1638
1439
  private handleVirtualExpand;
1440
+ private loadVirtualChildData;
1441
+ private completeVirtualExpand;
1639
1442
  private handleVirtualCollapse;
1640
- /**
1641
- * Updates the selected state of a node in `virtualFlatNodes` and re-renders the window.
1642
- *
1643
- * @param {string} id - The `data-uid` of the target node.
1644
- * @param {boolean} selected - Whether the node is now selected.
1645
- * @returns {void}
1646
- * @private
1647
- */
1648
1443
  private updateVirtualNodeSelection;
1649
- /**
1650
- * Updates the checkbox state of a node in `virtualFlatNodes` and re-renders the window.
1651
- *
1652
- * @param {string} id - The `data-uid` of the target node.
1653
- * @param {'check' | 'uncheck' | 'indeterminate'} state - The new check state.
1654
- * @returns {void}
1655
- * @private
1656
- */
1657
1444
  private updateVirtualNodeCheckState;
1658
1445
  /**
1659
1446
  * Called internally if any of the property value changed.