wunderbaum 0.11.1 → 0.12.1

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.
@@ -5,6 +5,11 @@
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
7
  /*!
8
+ * Wunderbaum - debounce.ts
9
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
10
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
11
+ */
12
+ /*
8
13
  * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21
9
14
  * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE
10
15
  * Modified for TypeScript type annotations.
@@ -293,8 +298,8 @@
293
298
 
294
299
  /*!
295
300
  * Wunderbaum - util
296
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
297
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
301
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
302
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
298
303
  */
299
304
  /** @module util */
300
305
  /** Readable names for `MouseEvent.button` */
@@ -1147,8 +1152,8 @@
1147
1152
 
1148
1153
  /*!
1149
1154
  * Wunderbaum - types
1150
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1151
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1155
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1156
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1152
1157
  */
1153
1158
  /**
1154
1159
  * Possible values for {@link WunderbaumNode.update} and {@link Wunderbaum.update}.
@@ -1172,7 +1177,7 @@
1172
1177
  /** Vertical scroll event. Update the 'top' property of all rows. */
1173
1178
  ChangeType["scroll"] = "scroll";
1174
1179
  })(ChangeType || (ChangeType = {}));
1175
- /* Internal use. */
1180
+ /** @internal */
1176
1181
  var RenderFlag;
1177
1182
  (function (RenderFlag) {
1178
1183
  RenderFlag["clearMarkup"] = "clearMarkup";
@@ -1203,16 +1208,20 @@
1203
1208
  /** Initial navigation mode and possible transition. */
1204
1209
  var NavModeEnum;
1205
1210
  (function (NavModeEnum) {
1211
+ /** Start with row mode, but allow cell-nav mode */
1206
1212
  NavModeEnum["startRow"] = "startRow";
1213
+ /** Cell-nav mode only */
1207
1214
  NavModeEnum["cell"] = "cell";
1215
+ /** Start in cell-nav mode, but allow row mode */
1208
1216
  NavModeEnum["startCell"] = "startCell";
1217
+ /** Row mode only */
1209
1218
  NavModeEnum["row"] = "row";
1210
1219
  })(NavModeEnum || (NavModeEnum = {}));
1211
1220
 
1212
1221
  /*!
1213
1222
  * Wunderbaum - wb_extension_base
1214
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1215
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1223
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1224
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1216
1225
  */
1217
1226
  class WunderbaumExtension {
1218
1227
  constructor(tree, id, defaults) {
@@ -1270,8 +1279,8 @@
1270
1279
 
1271
1280
  /*!
1272
1281
  * Wunderbaum - ext-filter
1273
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1274
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1282
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1283
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1275
1284
  */
1276
1285
  const START_MARKER = "\uFFF7";
1277
1286
  const END_MARKER = "\uFFF8";
@@ -1403,7 +1412,7 @@
1403
1412
  };
1404
1413
  }
1405
1414
  tree.filterMode = opts.mode;
1406
- // eslint-disable-next-line prefer-rest-params, prefer-spread
1415
+ // eslint-disable-next-line prefer-rest-params
1407
1416
  this.lastFilterArgs = arguments;
1408
1417
  tree.element.classList.toggle("wb-ext-filter-hide", !!hideMode);
1409
1418
  tree.element.classList.toggle("wb-ext-filter-dim", !hideMode);
@@ -1595,8 +1604,8 @@
1595
1604
 
1596
1605
  /*!
1597
1606
  * Wunderbaum - ext-keynav
1598
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1599
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1607
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1608
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1600
1609
  */
1601
1610
  const QUICKSEARCH_DELAY = 500;
1602
1611
  class KeynavExtension extends WunderbaumExtension {
@@ -1959,8 +1968,8 @@
1959
1968
 
1960
1969
  /*!
1961
1970
  * Wunderbaum - ext-logger
1962
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1963
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1971
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1972
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1964
1973
  */
1965
1974
  class LoggerExtension extends WunderbaumExtension {
1966
1975
  constructor(tree) {
@@ -2001,8 +2010,8 @@
2001
2010
 
2002
2011
  /*!
2003
2012
  * Wunderbaum - ext-dnd
2004
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2005
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2013
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2014
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2006
2015
  */
2007
2016
  const nodeMimeType = "application/x-wunderbaum-node";
2008
2017
  class DndExtension extends WunderbaumExtension {
@@ -2222,7 +2231,7 @@
2222
2231
  viewportY >= height - sensitivity) {
2223
2232
  // Mouse in bottom 20px area: scroll down
2224
2233
  // sp.scrollTop = scrollTop + dndOpts.scrollSpeed;
2225
- this.currentScrollDir = +1;
2234
+ this.currentScrollDir = 1;
2226
2235
  }
2227
2236
  if (this.currentScrollDir) {
2228
2237
  this.applyScrollDirThrottled();
@@ -2451,8 +2460,8 @@
2451
2460
 
2452
2461
  /*!
2453
2462
  * Wunderbaum - drag_observer
2454
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2455
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2463
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2464
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2456
2465
  */
2457
2466
  /**
2458
2467
  * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'.
@@ -2600,8 +2609,8 @@
2600
2609
 
2601
2610
  /*!
2602
2611
  * Wunderbaum - common
2603
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2604
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2612
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2613
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2605
2614
  */
2606
2615
  const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script
2607
2616
  /**
@@ -2628,8 +2637,11 @@
2628
2637
  // export const RECURSIVE_REQUEST_ERROR = "$recursive_request";
2629
2638
  // export const INVALID_REQUEST_TARGET_ERROR = "$request_target_invalid";
2630
2639
  /**
2631
- * Default node icons.
2632
- * Requires bootstrap icons https://icons.getbootstrap.com
2640
+ * Default node icons for icon libraries
2641
+ *
2642
+ * - 'bootstrap': {@link https://icons.getbootstrap.com}
2643
+ * - 'fontawesome6' {@link https://fontawesome.com/icons}
2644
+ *
2633
2645
  */
2634
2646
  const iconMaps = {
2635
2647
  bootstrap: {
@@ -2770,10 +2782,12 @@
2770
2782
  /**
2771
2783
  * Convert 'flat' to 'nested' format.
2772
2784
  *
2773
- * Flat node entry format:
2774
- * [PARENT_ID, [POSITIONAL_ARGS]]
2775
- * or
2776
- * [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}]
2785
+ * Flat node entry format:
2786
+ * [PARENT_IDX, {KEY_VALUE_ARGS}]
2787
+ * or, if N _positional re defined:
2788
+ * [PARENT_IDX, POSITIONAL_ARG_1, POSITIONAL_ARG_2, ..., POSITIONAL_ARG_N]
2789
+ * Even if _positional additional are defined, KEY_VALUE_ARGS can be appended:
2790
+ * [PARENT_IDX, POSITIONAL_ARG_1, ..., {KEY_VALUE_ARGS}]
2777
2791
  *
2778
2792
  * 1. Parent-referencing list is converted to a list of nested dicts with
2779
2793
  * optional `children` properties.
@@ -2782,10 +2796,11 @@
2782
2796
  function unflattenSource(source) {
2783
2797
  var _a, _b, _c;
2784
2798
  const { _format, _keyMap = {}, _positional = [], children } = source;
2799
+ const _positionalCount = _positional.length;
2785
2800
  if (_format !== "flat") {
2786
2801
  throw new Error(`Expected source._format: "flat", but got ${_format}`);
2787
2802
  }
2788
- if (_positional && _positional.includes("children")) {
2803
+ if (_positionalCount && _positional.includes("children")) {
2789
2804
  throw new Error(`source._positional must not include "children": ${_positional}`);
2790
2805
  }
2791
2806
  let longToShort = _keyMap;
@@ -2799,7 +2814,7 @@
2799
2814
  longToShort[value] = key;
2800
2815
  }
2801
2816
  }
2802
- const positionalShort = _positional.map((e) => longToShort[e]);
2817
+ const positionalShort = _positional.map((e) => { var _a; return (_a = longToShort[e]) !== null && _a !== void 0 ? _a : e; });
2803
2818
  const newChildren = [];
2804
2819
  const keyToNodeMap = {};
2805
2820
  const indexToNodeMap = {};
@@ -2809,19 +2824,32 @@
2809
2824
  // Node entry format:
2810
2825
  // [PARENT_ID, [POSITIONAL_ARGS]]
2811
2826
  // or
2812
- // [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}]
2813
- const [parentId, args, kwargs = {}] = nodeTuple;
2827
+ // [PARENT_ID, POSITIONAL_ARG_1, POSITIONAL_ARG_2, ..., {KEY_VALUE_ARGS}]
2828
+ let kwargs;
2829
+ const [parentId, ...args] = nodeTuple;
2830
+ if (args.length === _positionalCount) {
2831
+ kwargs = {};
2832
+ }
2833
+ else if (args.length === _positionalCount + 1) {
2834
+ kwargs = args.pop();
2835
+ if (typeof kwargs !== "object") {
2836
+ throw new Error(`unflattenSource: Expected dict as last tuple element: ${nodeTuple}`);
2837
+ }
2838
+ }
2839
+ else {
2840
+ throw new Error(`unflattenSource: unexpected tuple length: ${nodeTuple}`);
2841
+ }
2814
2842
  // Free up some memory as we go
2815
2843
  nodeTuple[1] = null;
2816
2844
  if (nodeTuple[2] != null) {
2817
2845
  nodeTuple[2] = null;
2818
2846
  }
2819
- // console.log("flatten", parentId, args, kwargs)
2820
2847
  // We keep `kwargs` as our new node definition. Then we add all positional
2821
2848
  // values to this object:
2822
2849
  args.forEach((val, positionalIdx) => {
2823
2850
  kwargs[positionalShort[positionalIdx]] = val;
2824
2851
  });
2852
+ args.length = 0;
2825
2853
  // Find the parent node. `null` means 'toplevel'. PARENT_ID may be the numeric
2826
2854
  // index of the source.children list. If PARENT_ID is a string, we search
2827
2855
  // a parent with node.key of this value.
@@ -2940,8 +2968,8 @@
2940
2968
 
2941
2969
  /*!
2942
2970
  * Wunderbaum - ext-grid
2943
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2944
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2971
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2972
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2945
2973
  */
2946
2974
  class GridExtension extends WunderbaumExtension {
2947
2975
  constructor(tree) {
@@ -3031,8 +3059,8 @@
3031
3059
 
3032
3060
  /*!
3033
3061
  * Wunderbaum - deferred
3034
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
3035
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
3062
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
3063
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
3036
3064
  */
3037
3065
  /**
3038
3066
  * Implement a ES6 Promise, that exposes a resolve() and reject() method.
@@ -3084,8 +3112,8 @@
3084
3112
 
3085
3113
  /*!
3086
3114
  * Wunderbaum - wunderbaum_node
3087
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
3088
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
3115
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
3116
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
3089
3117
  */
3090
3118
  /** WunderbaumNode properties that can be passed with source data.
3091
3119
  * (Any other source properties will be stored as `node.data.PROP`.)
@@ -3417,54 +3445,65 @@
3417
3445
  startEditTitle() {
3418
3446
  this.tree._callMethod("edit.startEditTitle", this);
3419
3447
  }
3420
- /** Call `setExpanded()` on all descendant nodes. */
3448
+ /**
3449
+ * Call `setExpanded()` on all descendant nodes.
3450
+ *
3451
+ * @param flag true to expand, false to collapse.
3452
+ * @param options Additional options.
3453
+ * @see {@link Wunderbaum.expandAll}
3454
+ * @see {@link WunderbaumNode.setExpanded}
3455
+ */
3421
3456
  async expandAll(flag = true, options) {
3422
3457
  const tree = this.tree;
3423
- const minExpandLevel = this.tree.options.minExpandLevel;
3424
- const { depth = 99, loadLazy, force, keepActiveNodeVisible = true, } = options !== null && options !== void 0 ? options : {};
3458
+ const { collapseOthers, deep, depth, force, keepActiveNodeVisible = true, loadLazy, resetLazy, } = options !== null && options !== void 0 ? options : {};
3459
+ // limit expansion level to `depth` (or tree.minExpandLevel). Default: unlimited
3460
+ const treeLevel = this.tree.options.minExpandLevel || null; // 0 -> null
3461
+ const minLevel = depth !== null && depth !== void 0 ? depth : (force ? null : treeLevel);
3425
3462
  const expandOpts = {
3426
- scrollIntoView: false, // don't scroll very node on iteration
3463
+ deep: deep,
3427
3464
  force: force,
3428
3465
  loadLazy: loadLazy,
3466
+ resetLazy: resetLazy,
3467
+ scrollIntoView: false, // don't scroll every node while iterating
3429
3468
  };
3430
- // this.logInfo(`expandAll(${flag})`);
3469
+ this.logInfo(`expandAll(${flag}, depth=${depth}, minLevel=${minLevel})`);
3470
+ assert(!(flag && deep != null && !collapseOthers), "Expanding with `deep` option is not supported (implied by the `depth` option).");
3431
3471
  // Expand all direct children in parallel:
3432
3472
  async function _iter(n, level) {
3433
3473
  var _a;
3434
- // n.logInfo(` _iter(${level})`);
3435
- if (level === 0) {
3436
- return;
3437
- }
3438
- // if (!flag && minExpandLevel && !force && n.getLevel() <= minExpandLevel) {
3439
- // return; // Do not collapse until minExpandLevel
3440
- // }
3441
- const level_1 = level == null ? null : level - 1;
3474
+ // n.logInfo(` _iter(level=${level})`);
3442
3475
  const promises = [];
3443
3476
  (_a = n.children) === null || _a === void 0 ? void 0 : _a.forEach((cn) => {
3444
3477
  if (flag) {
3445
- if (!cn.expanded && (cn.children || (loadLazy && cn.lazy))) {
3478
+ if (!cn.expanded &&
3479
+ (minLevel == null || level < minLevel) &&
3480
+ (cn.children || (loadLazy && cn.lazy))) {
3446
3481
  // Node is collapsed and may be expanded (i.e. has children or is lazy)
3447
3482
  // Expanding may be async, so we store the promise.
3448
3483
  // Also the recursion is delayed until expansion finished.
3449
3484
  const p = cn.setExpanded(true, expandOpts);
3450
3485
  promises.push(p);
3451
- p.then(async () => {
3452
- await _iter(cn, level_1);
3453
- });
3486
+ if (depth == null) {
3487
+ p.then(async () => {
3488
+ await _iter(cn, level + 1);
3489
+ });
3490
+ }
3454
3491
  }
3455
3492
  else {
3456
3493
  // We don't expand the node, but still visit descendants.
3457
3494
  // There we may find lazy nodes, so we
3458
- promises.push(_iter(cn, level_1));
3495
+ promises.push(_iter(cn, level + 1));
3459
3496
  }
3460
3497
  }
3461
3498
  else {
3462
3499
  // Collapsing is always synchronous, so no promises required
3463
- if (!minExpandLevel || force || cn.getLevel() > minExpandLevel) {
3464
- // Do not collapse until minExpandLevel
3500
+ // Do not collapse until minExpandLevel
3501
+ if (minLevel == null || level >= minLevel) {
3465
3502
  cn.setExpanded(false, expandOpts);
3466
3503
  }
3467
- _iter(cn, level_1); // recursion, even if cn was already collapsed
3504
+ if ((minLevel != null && level < minLevel) || deep) {
3505
+ _iter(cn, level + 1); // recursion, even if cn was already collapsed
3506
+ }
3468
3507
  }
3469
3508
  });
3470
3509
  return new Promise((resolve) => {
@@ -3473,10 +3512,15 @@
3473
3512
  });
3474
3513
  });
3475
3514
  }
3476
- const tag = tree.logTime(`${this}.expandAll(${flag})`);
3515
+ const tag = tree.logTime(`${this}.expandAll(${flag}, depth=${depth})`);
3477
3516
  try {
3478
3517
  tree.enableUpdate(false);
3479
- await _iter(this, depth);
3518
+ await _iter(this, 0);
3519
+ if (collapseOthers) {
3520
+ assert(flag, "Option `collapseOthers` requires flag=true");
3521
+ assert(minLevel != null, "Option `collapseOthers` requires `depth` or `minExpandLevel`");
3522
+ this.expandAll(false, { depth: minLevel });
3523
+ }
3480
3524
  }
3481
3525
  finally {
3482
3526
  tree.enableUpdate(true);
@@ -4965,7 +5009,7 @@
4965
5009
  const orgEvent = options === null || options === void 0 ? void 0 : options.event; // Default: null
4966
5010
  const colIdx = options === null || options === void 0 ? void 0 : options.colIdx; // Default: null
4967
5011
  const edit = options === null || options === void 0 ? void 0 : options.edit; // Default: false
4968
- assert(!colIdx || tree.isCellNav(), "colIdx requires cellNav");
5012
+ // util.assert(!colIdx || tree.isCellNav(), "colIdx requires cellNav");
4969
5013
  assert(!edit || colIdx != null, "edit requires colIdx");
4970
5014
  if (!noEvents) {
4971
5015
  if (flag) {
@@ -5019,7 +5063,7 @@
5019
5063
  * Expand or collapse this node.
5020
5064
  */
5021
5065
  async setExpanded(flag = true, options) {
5022
- const { force, scrollIntoView, immediate } = options !== null && options !== void 0 ? options : {};
5066
+ const { force, scrollIntoView, immediate, resetLazy } = options !== null && options !== void 0 ? options : {};
5023
5067
  const sendEvents = !(options === null || options === void 0 ? void 0 : options.noEvents); // Default: send events
5024
5068
  if (!flag &&
5025
5069
  this.isExpanded() &&
@@ -5042,6 +5086,9 @@
5042
5086
  if (flag && this.lazy && this.children == null) {
5043
5087
  await this.loadLazy();
5044
5088
  }
5089
+ else if (!flag && resetLazy && this.lazy && this.children) {
5090
+ this.resetLazy();
5091
+ }
5045
5092
  this.expanded = flag;
5046
5093
  const updateOpts = { immediate: immediate };
5047
5094
  // const updateOpts = { immediate: !!util.getOption(options, "immediate") };
@@ -5150,7 +5197,8 @@
5150
5197
  case undefined:
5151
5198
  changed = this.selected || !this._partsel;
5152
5199
  this.selected = false;
5153
- this._partsel = true;
5200
+ // #110: end nodess cannot have a `_partsel` flag
5201
+ this._partsel = this.hasChildren() ? true : false;
5154
5202
  break;
5155
5203
  default:
5156
5204
  error(`Invalid state: ${state}`);
@@ -5611,8 +5659,8 @@
5611
5659
 
5612
5660
  /*!
5613
5661
  * Wunderbaum - ext-edit
5614
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
5615
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
5662
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
5663
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
5616
5664
  */
5617
5665
  // const START_MARKER = "\uFFF7";
5618
5666
  class EditExtension extends WunderbaumExtension {
@@ -5943,12 +5991,12 @@
5943
5991
  *
5944
5992
  * A treegrid control.
5945
5993
  *
5946
- * Copyright (c) 2021-2024, Martin Wendt (https://wwWendt.de).
5994
+ * Copyright (c) 2021-2025, Martin Wendt (https://wwWendt.de).
5947
5995
  * https://github.com/mar10/wunderbaum
5948
5996
  *
5949
5997
  * Released under the MIT license.
5950
- * @version v0.11.1
5951
- * @date Fri, 27 Dec 2024 22:58:06 GMT
5998
+ * @version v0.12.1
5999
+ * @date Sat, 22 Feb 2025 22:59:20 GMT
5952
6000
  */
5953
6001
  // import "./wunderbaum.scss";
5954
6002
  class WbSystemRoot extends WunderbaumNode {
@@ -5969,7 +6017,7 @@
5969
6017
  */
5970
6018
  class Wunderbaum {
5971
6019
  /** Currently active node if any.
5972
- * Use @link {WunderbaumNode.setActive|setActive} to modify.
6020
+ * Use {@link WunderbaumNode.setActive|setActive} to modify.
5973
6021
  */
5974
6022
  get activeNode() {
5975
6023
  var _a;
@@ -5977,7 +6025,7 @@
5977
6025
  return ((_a = this._activeNode) === null || _a === void 0 ? void 0 : _a.tree) ? this._activeNode : null;
5978
6026
  }
5979
6027
  /** Current node hat has keyboard focus if any.
5980
- * Use @link {WunderbaumNode.setFocus|setFocus()} to modify.
6028
+ * Use {@link WunderbaumNode.setFocus|setFocus()} to modify.
5981
6029
  */
5982
6030
  get focusNode() {
5983
6031
  var _a;
@@ -6127,7 +6175,7 @@
6127
6175
  const wantHeader = opts.header == null ? this.columns.length > 1 : !!opts.header;
6128
6176
  if (this.headerElement) {
6129
6177
  // User existing header markup to define `this.columns`
6130
- assert(!this.columns, "`opts.columns` must not be set if markup already contains a header");
6178
+ assert(!this.columns, "`opts.columns` must not be set if table markup already contains a header");
6131
6179
  this.columns = [];
6132
6180
  const rowElement = this.headerElement.querySelector("div.wb-row");
6133
6181
  for (const colDiv of rowElement.querySelectorAll("div")) {
@@ -6175,8 +6223,7 @@
6175
6223
  // --- Load initial data
6176
6224
  if (opts.source) {
6177
6225
  if (opts.showSpinner) {
6178
- this.nodeListElement.innerHTML =
6179
- "<progress class='spinner'>loading...</progress>";
6226
+ this.nodeListElement.innerHTML = `<progress class='spinner'>${opts.strings.loading}</progress>`;
6180
6227
  }
6181
6228
  this.load(opts.source)
6182
6229
  .then(() => {
@@ -6281,7 +6328,10 @@
6281
6328
  false) {
6282
6329
  return false;
6283
6330
  }
6284
- if (node && info.colIdx === 0 && node.isExpandable()) {
6331
+ if (node &&
6332
+ info.colIdx === 0 &&
6333
+ node.isExpandable() &&
6334
+ info.region !== NodeRegion.expander) {
6285
6335
  this._callMethod("edit._stopEditTitle");
6286
6336
  node.setExpanded(!node.isExpanded());
6287
6337
  }
@@ -7968,8 +8018,9 @@
7968
8018
  // this.debug("render", opts);
7969
8019
  const obsoleteNodes = new Set();
7970
8020
  this.nodeListElement.childNodes.forEach((elem) => {
7971
- const tr = elem;
7972
- obsoleteNodes.add(tr._wb_node);
8021
+ if (elem._wb_node) {
8022
+ obsoleteNodes.add(elem._wb_node);
8023
+ }
7973
8024
  });
7974
8025
  let idx = 0;
7975
8026
  let top = 0;
@@ -8270,7 +8321,7 @@
8270
8321
  }
8271
8322
  Wunderbaum.sequence = 0;
8272
8323
  /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
8273
- Wunderbaum.version = "v0.11.1"; // Set to semver by 'grunt release'
8324
+ Wunderbaum.version = "v0.12.1"; // Set to semver by 'grunt release'
8274
8325
  /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
8275
8326
  Wunderbaum.util = util;
8276
8327