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.
@@ -1,4 +1,9 @@
1
1
  /*!
2
+ * Wunderbaum - debounce.ts
3
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
4
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
5
+ */
6
+ /*
2
7
  * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21
3
8
  * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE
4
9
  * Modified for TypeScript type annotations.
@@ -287,8 +292,8 @@ function throttle(func, wait = 0, options = {}) {
287
292
 
288
293
  /*!
289
294
  * Wunderbaum - util
290
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
291
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
295
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
296
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
292
297
  */
293
298
  /** @module util */
294
299
  /** Readable names for `MouseEvent.button` */
@@ -1141,8 +1146,8 @@ var util = /*#__PURE__*/Object.freeze({
1141
1146
 
1142
1147
  /*!
1143
1148
  * Wunderbaum - types
1144
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1145
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1149
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1150
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1146
1151
  */
1147
1152
  /**
1148
1153
  * Possible values for {@link WunderbaumNode.update} and {@link Wunderbaum.update}.
@@ -1166,7 +1171,7 @@ var ChangeType;
1166
1171
  /** Vertical scroll event. Update the 'top' property of all rows. */
1167
1172
  ChangeType["scroll"] = "scroll";
1168
1173
  })(ChangeType || (ChangeType = {}));
1169
- /* Internal use. */
1174
+ /** @internal */
1170
1175
  var RenderFlag;
1171
1176
  (function (RenderFlag) {
1172
1177
  RenderFlag["clearMarkup"] = "clearMarkup";
@@ -1197,16 +1202,20 @@ var NodeRegion;
1197
1202
  /** Initial navigation mode and possible transition. */
1198
1203
  var NavModeEnum;
1199
1204
  (function (NavModeEnum) {
1205
+ /** Start with row mode, but allow cell-nav mode */
1200
1206
  NavModeEnum["startRow"] = "startRow";
1207
+ /** Cell-nav mode only */
1201
1208
  NavModeEnum["cell"] = "cell";
1209
+ /** Start in cell-nav mode, but allow row mode */
1202
1210
  NavModeEnum["startCell"] = "startCell";
1211
+ /** Row mode only */
1203
1212
  NavModeEnum["row"] = "row";
1204
1213
  })(NavModeEnum || (NavModeEnum = {}));
1205
1214
 
1206
1215
  /*!
1207
1216
  * Wunderbaum - wb_extension_base
1208
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1209
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1217
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1218
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1210
1219
  */
1211
1220
  class WunderbaumExtension {
1212
1221
  constructor(tree, id, defaults) {
@@ -1264,8 +1273,8 @@ class WunderbaumExtension {
1264
1273
 
1265
1274
  /*!
1266
1275
  * Wunderbaum - ext-filter
1267
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1268
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1276
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1277
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1269
1278
  */
1270
1279
  const START_MARKER = "\uFFF7";
1271
1280
  const END_MARKER = "\uFFF8";
@@ -1397,7 +1406,7 @@ class FilterExtension extends WunderbaumExtension {
1397
1406
  };
1398
1407
  }
1399
1408
  tree.filterMode = opts.mode;
1400
- // eslint-disable-next-line prefer-rest-params, prefer-spread
1409
+ // eslint-disable-next-line prefer-rest-params
1401
1410
  this.lastFilterArgs = arguments;
1402
1411
  tree.element.classList.toggle("wb-ext-filter-hide", !!hideMode);
1403
1412
  tree.element.classList.toggle("wb-ext-filter-dim", !hideMode);
@@ -1589,8 +1598,8 @@ function _markFuzzyMatchedChars(text, matches, escapeTitles = true) {
1589
1598
 
1590
1599
  /*!
1591
1600
  * Wunderbaum - ext-keynav
1592
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1593
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1601
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1602
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1594
1603
  */
1595
1604
  const QUICKSEARCH_DELAY = 500;
1596
1605
  class KeynavExtension extends WunderbaumExtension {
@@ -1953,8 +1962,8 @@ class KeynavExtension extends WunderbaumExtension {
1953
1962
 
1954
1963
  /*!
1955
1964
  * Wunderbaum - ext-logger
1956
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1957
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
1965
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
1966
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
1958
1967
  */
1959
1968
  class LoggerExtension extends WunderbaumExtension {
1960
1969
  constructor(tree) {
@@ -1995,8 +2004,8 @@ class LoggerExtension extends WunderbaumExtension {
1995
2004
 
1996
2005
  /*!
1997
2006
  * Wunderbaum - ext-dnd
1998
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1999
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2007
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2008
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2000
2009
  */
2001
2010
  const nodeMimeType = "application/x-wunderbaum-node";
2002
2011
  class DndExtension extends WunderbaumExtension {
@@ -2216,7 +2225,7 @@ class DndExtension extends WunderbaumExtension {
2216
2225
  viewportY >= height - sensitivity) {
2217
2226
  // Mouse in bottom 20px area: scroll down
2218
2227
  // sp.scrollTop = scrollTop + dndOpts.scrollSpeed;
2219
- this.currentScrollDir = +1;
2228
+ this.currentScrollDir = 1;
2220
2229
  }
2221
2230
  if (this.currentScrollDir) {
2222
2231
  this.applyScrollDirThrottled();
@@ -2445,8 +2454,8 @@ class DndExtension extends WunderbaumExtension {
2445
2454
 
2446
2455
  /*!
2447
2456
  * Wunderbaum - drag_observer
2448
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2449
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2457
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2458
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2450
2459
  */
2451
2460
  /**
2452
2461
  * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'.
@@ -2594,8 +2603,8 @@ class DragObserver {
2594
2603
 
2595
2604
  /*!
2596
2605
  * Wunderbaum - common
2597
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2598
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2606
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2607
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2599
2608
  */
2600
2609
  const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script
2601
2610
  /**
@@ -2622,8 +2631,11 @@ const TEST_IMG = new RegExp(/\.|\//);
2622
2631
  // export const RECURSIVE_REQUEST_ERROR = "$recursive_request";
2623
2632
  // export const INVALID_REQUEST_TARGET_ERROR = "$request_target_invalid";
2624
2633
  /**
2625
- * Default node icons.
2626
- * Requires bootstrap icons https://icons.getbootstrap.com
2634
+ * Default node icons for icon libraries
2635
+ *
2636
+ * - 'bootstrap': {@link https://icons.getbootstrap.com}
2637
+ * - 'fontawesome6' {@link https://fontawesome.com/icons}
2638
+ *
2627
2639
  */
2628
2640
  const iconMaps = {
2629
2641
  bootstrap: {
@@ -2764,10 +2776,12 @@ function nodeTitleSorter(a, b) {
2764
2776
  /**
2765
2777
  * Convert 'flat' to 'nested' format.
2766
2778
  *
2767
- * Flat node entry format:
2768
- * [PARENT_ID, [POSITIONAL_ARGS]]
2769
- * or
2770
- * [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}]
2779
+ * Flat node entry format:
2780
+ * [PARENT_IDX, {KEY_VALUE_ARGS}]
2781
+ * or, if N _positional re defined:
2782
+ * [PARENT_IDX, POSITIONAL_ARG_1, POSITIONAL_ARG_2, ..., POSITIONAL_ARG_N]
2783
+ * Even if _positional additional are defined, KEY_VALUE_ARGS can be appended:
2784
+ * [PARENT_IDX, POSITIONAL_ARG_1, ..., {KEY_VALUE_ARGS}]
2771
2785
  *
2772
2786
  * 1. Parent-referencing list is converted to a list of nested dicts with
2773
2787
  * optional `children` properties.
@@ -2776,10 +2790,11 @@ function nodeTitleSorter(a, b) {
2776
2790
  function unflattenSource(source) {
2777
2791
  var _a, _b, _c;
2778
2792
  const { _format, _keyMap = {}, _positional = [], children } = source;
2793
+ const _positionalCount = _positional.length;
2779
2794
  if (_format !== "flat") {
2780
2795
  throw new Error(`Expected source._format: "flat", but got ${_format}`);
2781
2796
  }
2782
- if (_positional && _positional.includes("children")) {
2797
+ if (_positionalCount && _positional.includes("children")) {
2783
2798
  throw new Error(`source._positional must not include "children": ${_positional}`);
2784
2799
  }
2785
2800
  let longToShort = _keyMap;
@@ -2793,7 +2808,7 @@ function unflattenSource(source) {
2793
2808
  longToShort[value] = key;
2794
2809
  }
2795
2810
  }
2796
- const positionalShort = _positional.map((e) => longToShort[e]);
2811
+ const positionalShort = _positional.map((e) => { var _a; return (_a = longToShort[e]) !== null && _a !== void 0 ? _a : e; });
2797
2812
  const newChildren = [];
2798
2813
  const keyToNodeMap = {};
2799
2814
  const indexToNodeMap = {};
@@ -2803,19 +2818,32 @@ function unflattenSource(source) {
2803
2818
  // Node entry format:
2804
2819
  // [PARENT_ID, [POSITIONAL_ARGS]]
2805
2820
  // or
2806
- // [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}]
2807
- const [parentId, args, kwargs = {}] = nodeTuple;
2821
+ // [PARENT_ID, POSITIONAL_ARG_1, POSITIONAL_ARG_2, ..., {KEY_VALUE_ARGS}]
2822
+ let kwargs;
2823
+ const [parentId, ...args] = nodeTuple;
2824
+ if (args.length === _positionalCount) {
2825
+ kwargs = {};
2826
+ }
2827
+ else if (args.length === _positionalCount + 1) {
2828
+ kwargs = args.pop();
2829
+ if (typeof kwargs !== "object") {
2830
+ throw new Error(`unflattenSource: Expected dict as last tuple element: ${nodeTuple}`);
2831
+ }
2832
+ }
2833
+ else {
2834
+ throw new Error(`unflattenSource: unexpected tuple length: ${nodeTuple}`);
2835
+ }
2808
2836
  // Free up some memory as we go
2809
2837
  nodeTuple[1] = null;
2810
2838
  if (nodeTuple[2] != null) {
2811
2839
  nodeTuple[2] = null;
2812
2840
  }
2813
- // console.log("flatten", parentId, args, kwargs)
2814
2841
  // We keep `kwargs` as our new node definition. Then we add all positional
2815
2842
  // values to this object:
2816
2843
  args.forEach((val, positionalIdx) => {
2817
2844
  kwargs[positionalShort[positionalIdx]] = val;
2818
2845
  });
2846
+ args.length = 0;
2819
2847
  // Find the parent node. `null` means 'toplevel'. PARENT_ID may be the numeric
2820
2848
  // index of the source.children list. If PARENT_ID is a string, we search
2821
2849
  // a parent with node.key of this value.
@@ -2934,8 +2962,8 @@ function decompressSourceData(source) {
2934
2962
 
2935
2963
  /*!
2936
2964
  * Wunderbaum - ext-grid
2937
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2938
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
2965
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
2966
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
2939
2967
  */
2940
2968
  class GridExtension extends WunderbaumExtension {
2941
2969
  constructor(tree) {
@@ -3025,8 +3053,8 @@ class GridExtension extends WunderbaumExtension {
3025
3053
 
3026
3054
  /*!
3027
3055
  * Wunderbaum - deferred
3028
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
3029
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
3056
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
3057
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
3030
3058
  */
3031
3059
  /**
3032
3060
  * Implement a ES6 Promise, that exposes a resolve() and reject() method.
@@ -3078,8 +3106,8 @@ class Deferred {
3078
3106
 
3079
3107
  /*!
3080
3108
  * Wunderbaum - wunderbaum_node
3081
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
3082
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
3109
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
3110
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
3083
3111
  */
3084
3112
  /** WunderbaumNode properties that can be passed with source data.
3085
3113
  * (Any other source properties will be stored as `node.data.PROP`.)
@@ -3411,54 +3439,65 @@ class WunderbaumNode {
3411
3439
  startEditTitle() {
3412
3440
  this.tree._callMethod("edit.startEditTitle", this);
3413
3441
  }
3414
- /** Call `setExpanded()` on all descendant nodes. */
3442
+ /**
3443
+ * Call `setExpanded()` on all descendant nodes.
3444
+ *
3445
+ * @param flag true to expand, false to collapse.
3446
+ * @param options Additional options.
3447
+ * @see {@link Wunderbaum.expandAll}
3448
+ * @see {@link WunderbaumNode.setExpanded}
3449
+ */
3415
3450
  async expandAll(flag = true, options) {
3416
3451
  const tree = this.tree;
3417
- const minExpandLevel = this.tree.options.minExpandLevel;
3418
- const { depth = 99, loadLazy, force, keepActiveNodeVisible = true, } = options !== null && options !== void 0 ? options : {};
3452
+ const { collapseOthers, deep, depth, force, keepActiveNodeVisible = true, loadLazy, resetLazy, } = options !== null && options !== void 0 ? options : {};
3453
+ // limit expansion level to `depth` (or tree.minExpandLevel). Default: unlimited
3454
+ const treeLevel = this.tree.options.minExpandLevel || null; // 0 -> null
3455
+ const minLevel = depth !== null && depth !== void 0 ? depth : (force ? null : treeLevel);
3419
3456
  const expandOpts = {
3420
- scrollIntoView: false, // don't scroll very node on iteration
3457
+ deep: deep,
3421
3458
  force: force,
3422
3459
  loadLazy: loadLazy,
3460
+ resetLazy: resetLazy,
3461
+ scrollIntoView: false, // don't scroll every node while iterating
3423
3462
  };
3424
- // this.logInfo(`expandAll(${flag})`);
3463
+ this.logInfo(`expandAll(${flag}, depth=${depth}, minLevel=${minLevel})`);
3464
+ assert(!(flag && deep != null && !collapseOthers), "Expanding with `deep` option is not supported (implied by the `depth` option).");
3425
3465
  // Expand all direct children in parallel:
3426
3466
  async function _iter(n, level) {
3427
3467
  var _a;
3428
- // n.logInfo(` _iter(${level})`);
3429
- if (level === 0) {
3430
- return;
3431
- }
3432
- // if (!flag && minExpandLevel && !force && n.getLevel() <= minExpandLevel) {
3433
- // return; // Do not collapse until minExpandLevel
3434
- // }
3435
- const level_1 = level == null ? null : level - 1;
3468
+ // n.logInfo(` _iter(level=${level})`);
3436
3469
  const promises = [];
3437
3470
  (_a = n.children) === null || _a === void 0 ? void 0 : _a.forEach((cn) => {
3438
3471
  if (flag) {
3439
- if (!cn.expanded && (cn.children || (loadLazy && cn.lazy))) {
3472
+ if (!cn.expanded &&
3473
+ (minLevel == null || level < minLevel) &&
3474
+ (cn.children || (loadLazy && cn.lazy))) {
3440
3475
  // Node is collapsed and may be expanded (i.e. has children or is lazy)
3441
3476
  // Expanding may be async, so we store the promise.
3442
3477
  // Also the recursion is delayed until expansion finished.
3443
3478
  const p = cn.setExpanded(true, expandOpts);
3444
3479
  promises.push(p);
3445
- p.then(async () => {
3446
- await _iter(cn, level_1);
3447
- });
3480
+ if (depth == null) {
3481
+ p.then(async () => {
3482
+ await _iter(cn, level + 1);
3483
+ });
3484
+ }
3448
3485
  }
3449
3486
  else {
3450
3487
  // We don't expand the node, but still visit descendants.
3451
3488
  // There we may find lazy nodes, so we
3452
- promises.push(_iter(cn, level_1));
3489
+ promises.push(_iter(cn, level + 1));
3453
3490
  }
3454
3491
  }
3455
3492
  else {
3456
3493
  // Collapsing is always synchronous, so no promises required
3457
- if (!minExpandLevel || force || cn.getLevel() > minExpandLevel) {
3458
- // Do not collapse until minExpandLevel
3494
+ // Do not collapse until minExpandLevel
3495
+ if (minLevel == null || level >= minLevel) {
3459
3496
  cn.setExpanded(false, expandOpts);
3460
3497
  }
3461
- _iter(cn, level_1); // recursion, even if cn was already collapsed
3498
+ if ((minLevel != null && level < minLevel) || deep) {
3499
+ _iter(cn, level + 1); // recursion, even if cn was already collapsed
3500
+ }
3462
3501
  }
3463
3502
  });
3464
3503
  return new Promise((resolve) => {
@@ -3467,10 +3506,15 @@ class WunderbaumNode {
3467
3506
  });
3468
3507
  });
3469
3508
  }
3470
- const tag = tree.logTime(`${this}.expandAll(${flag})`);
3509
+ const tag = tree.logTime(`${this}.expandAll(${flag}, depth=${depth})`);
3471
3510
  try {
3472
3511
  tree.enableUpdate(false);
3473
- await _iter(this, depth);
3512
+ await _iter(this, 0);
3513
+ if (collapseOthers) {
3514
+ assert(flag, "Option `collapseOthers` requires flag=true");
3515
+ assert(minLevel != null, "Option `collapseOthers` requires `depth` or `minExpandLevel`");
3516
+ this.expandAll(false, { depth: minLevel });
3517
+ }
3474
3518
  }
3475
3519
  finally {
3476
3520
  tree.enableUpdate(true);
@@ -4959,7 +5003,7 @@ class WunderbaumNode {
4959
5003
  const orgEvent = options === null || options === void 0 ? void 0 : options.event; // Default: null
4960
5004
  const colIdx = options === null || options === void 0 ? void 0 : options.colIdx; // Default: null
4961
5005
  const edit = options === null || options === void 0 ? void 0 : options.edit; // Default: false
4962
- assert(!colIdx || tree.isCellNav(), "colIdx requires cellNav");
5006
+ // util.assert(!colIdx || tree.isCellNav(), "colIdx requires cellNav");
4963
5007
  assert(!edit || colIdx != null, "edit requires colIdx");
4964
5008
  if (!noEvents) {
4965
5009
  if (flag) {
@@ -5013,7 +5057,7 @@ class WunderbaumNode {
5013
5057
  * Expand or collapse this node.
5014
5058
  */
5015
5059
  async setExpanded(flag = true, options) {
5016
- const { force, scrollIntoView, immediate } = options !== null && options !== void 0 ? options : {};
5060
+ const { force, scrollIntoView, immediate, resetLazy } = options !== null && options !== void 0 ? options : {};
5017
5061
  const sendEvents = !(options === null || options === void 0 ? void 0 : options.noEvents); // Default: send events
5018
5062
  if (!flag &&
5019
5063
  this.isExpanded() &&
@@ -5036,6 +5080,9 @@ class WunderbaumNode {
5036
5080
  if (flag && this.lazy && this.children == null) {
5037
5081
  await this.loadLazy();
5038
5082
  }
5083
+ else if (!flag && resetLazy && this.lazy && this.children) {
5084
+ this.resetLazy();
5085
+ }
5039
5086
  this.expanded = flag;
5040
5087
  const updateOpts = { immediate: immediate };
5041
5088
  // const updateOpts = { immediate: !!util.getOption(options, "immediate") };
@@ -5144,7 +5191,8 @@ class WunderbaumNode {
5144
5191
  case undefined:
5145
5192
  changed = this.selected || !this._partsel;
5146
5193
  this.selected = false;
5147
- this._partsel = true;
5194
+ // #110: end nodess cannot have a `_partsel` flag
5195
+ this._partsel = this.hasChildren() ? true : false;
5148
5196
  break;
5149
5197
  default:
5150
5198
  error(`Invalid state: ${state}`);
@@ -5605,8 +5653,8 @@ WunderbaumNode.sequence = 0;
5605
5653
 
5606
5654
  /*!
5607
5655
  * Wunderbaum - ext-edit
5608
- * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
5609
- * v0.11.1, Fri, 27 Dec 2024 22:58:06 GMT (https://github.com/mar10/wunderbaum)
5656
+ * Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
5657
+ * v0.12.1, Sat, 22 Feb 2025 22:59:20 GMT (https://github.com/mar10/wunderbaum)
5610
5658
  */
5611
5659
  // const START_MARKER = "\uFFF7";
5612
5660
  class EditExtension extends WunderbaumExtension {
@@ -5937,12 +5985,12 @@ class EditExtension extends WunderbaumExtension {
5937
5985
  *
5938
5986
  * A treegrid control.
5939
5987
  *
5940
- * Copyright (c) 2021-2024, Martin Wendt (https://wwWendt.de).
5988
+ * Copyright (c) 2021-2025, Martin Wendt (https://wwWendt.de).
5941
5989
  * https://github.com/mar10/wunderbaum
5942
5990
  *
5943
5991
  * Released under the MIT license.
5944
- * @version v0.11.1
5945
- * @date Fri, 27 Dec 2024 22:58:06 GMT
5992
+ * @version v0.12.1
5993
+ * @date Sat, 22 Feb 2025 22:59:20 GMT
5946
5994
  */
5947
5995
  // import "./wunderbaum.scss";
5948
5996
  class WbSystemRoot extends WunderbaumNode {
@@ -5963,7 +6011,7 @@ class WbSystemRoot extends WunderbaumNode {
5963
6011
  */
5964
6012
  class Wunderbaum {
5965
6013
  /** Currently active node if any.
5966
- * Use @link {WunderbaumNode.setActive|setActive} to modify.
6014
+ * Use {@link WunderbaumNode.setActive|setActive} to modify.
5967
6015
  */
5968
6016
  get activeNode() {
5969
6017
  var _a;
@@ -5971,7 +6019,7 @@ class Wunderbaum {
5971
6019
  return ((_a = this._activeNode) === null || _a === void 0 ? void 0 : _a.tree) ? this._activeNode : null;
5972
6020
  }
5973
6021
  /** Current node hat has keyboard focus if any.
5974
- * Use @link {WunderbaumNode.setFocus|setFocus()} to modify.
6022
+ * Use {@link WunderbaumNode.setFocus|setFocus()} to modify.
5975
6023
  */
5976
6024
  get focusNode() {
5977
6025
  var _a;
@@ -6121,7 +6169,7 @@ class Wunderbaum {
6121
6169
  const wantHeader = opts.header == null ? this.columns.length > 1 : !!opts.header;
6122
6170
  if (this.headerElement) {
6123
6171
  // User existing header markup to define `this.columns`
6124
- assert(!this.columns, "`opts.columns` must not be set if markup already contains a header");
6172
+ assert(!this.columns, "`opts.columns` must not be set if table markup already contains a header");
6125
6173
  this.columns = [];
6126
6174
  const rowElement = this.headerElement.querySelector("div.wb-row");
6127
6175
  for (const colDiv of rowElement.querySelectorAll("div")) {
@@ -6169,8 +6217,7 @@ class Wunderbaum {
6169
6217
  // --- Load initial data
6170
6218
  if (opts.source) {
6171
6219
  if (opts.showSpinner) {
6172
- this.nodeListElement.innerHTML =
6173
- "<progress class='spinner'>loading...</progress>";
6220
+ this.nodeListElement.innerHTML = `<progress class='spinner'>${opts.strings.loading}</progress>`;
6174
6221
  }
6175
6222
  this.load(opts.source)
6176
6223
  .then(() => {
@@ -6275,7 +6322,10 @@ class Wunderbaum {
6275
6322
  false) {
6276
6323
  return false;
6277
6324
  }
6278
- if (node && info.colIdx === 0 && node.isExpandable()) {
6325
+ if (node &&
6326
+ info.colIdx === 0 &&
6327
+ node.isExpandable() &&
6328
+ info.region !== NodeRegion.expander) {
6279
6329
  this._callMethod("edit._stopEditTitle");
6280
6330
  node.setExpanded(!node.isExpanded());
6281
6331
  }
@@ -7962,8 +8012,9 @@ class Wunderbaum {
7962
8012
  // this.debug("render", opts);
7963
8013
  const obsoleteNodes = new Set();
7964
8014
  this.nodeListElement.childNodes.forEach((elem) => {
7965
- const tr = elem;
7966
- obsoleteNodes.add(tr._wb_node);
8015
+ if (elem._wb_node) {
8016
+ obsoleteNodes.add(elem._wb_node);
8017
+ }
7967
8018
  });
7968
8019
  let idx = 0;
7969
8020
  let top = 0;
@@ -8264,7 +8315,7 @@ class Wunderbaum {
8264
8315
  }
8265
8316
  Wunderbaum.sequence = 0;
8266
8317
  /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
8267
- Wunderbaum.version = "v0.11.1"; // Set to semver by 'grunt release'
8318
+ Wunderbaum.version = "v0.12.1"; // Set to semver by 'grunt release'
8268
8319
  /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
8269
8320
  Wunderbaum.util = util;
8270
8321