wunderbaum 0.4.0 → 0.5.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.
@@ -7,7 +7,7 @@
7
7
  /*!
8
8
  * Wunderbaum - util
9
9
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
10
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
10
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
11
11
  */
12
12
  /** @module util */
13
13
  /** Readable names for `MouseEvent.button` */
@@ -762,7 +762,7 @@
762
762
  /*!
763
763
  * Wunderbaum - types
764
764
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
765
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
765
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
766
766
  */
767
767
  /**
768
768
  * Possible values for {@link WunderbaumNode.update()} and {@link Wunderbaum.update()}.
@@ -801,7 +801,7 @@
801
801
  NodeStatusType["loading"] = "loading";
802
802
  NodeStatusType["error"] = "error";
803
803
  NodeStatusType["noData"] = "noData";
804
- // paging = "paging",
804
+ NodeStatusType["paging"] = "paging";
805
805
  })(NodeStatusType || (NodeStatusType = {}));
806
806
  /** Define the subregion of a node, where an event occurred. */
807
807
  var NodeRegion;
@@ -826,7 +826,7 @@
826
826
  /*!
827
827
  * Wunderbaum - wb_extension_base
828
828
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
829
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
829
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
830
830
  */
831
831
  class WunderbaumExtension {
832
832
  constructor(tree, id, defaults) {
@@ -1181,7 +1181,7 @@
1181
1181
  /*!
1182
1182
  * Wunderbaum - ext-filter
1183
1183
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
1184
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
1184
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
1185
1185
  */
1186
1186
  const START_MARKER = "\uFFF7";
1187
1187
  const END_MARKER = "\uFFF8";
@@ -1396,7 +1396,6 @@
1396
1396
  let tree = this.tree;
1397
1397
  // statusNode = tree.root.findDirectChild(KEY_NODATA),
1398
1398
  // escapeTitles = tree.options.escapeTitles;
1399
- // enhanceTitle = tree.options.enhanceTitle,
1400
1399
  tree.enableUpdate(false);
1401
1400
  // if (statusNode) {
1402
1401
  // statusNode.remove();
@@ -1406,16 +1405,10 @@
1406
1405
  delete tree.root.match;
1407
1406
  delete tree.root.subMatchCount;
1408
1407
  tree.visit((node) => {
1409
- if (node.match && node._rowElem) {
1410
- // #491, #601
1411
- let titleElem = node._rowElem.querySelector("span.wb-title");
1412
- // if (escapeTitles) {
1413
- titleElem.textContent = node.title;
1414
- // } else {
1415
- // titleElem.innerHTML = node.title;
1416
- // }
1417
- node._callEvent("enhanceTitle", { titleElem: titleElem });
1418
- }
1408
+ // if (node.match && node._rowElem) {
1409
+ // let titleElem = node._rowElem.querySelector("span.wb-title")!;
1410
+ // node._callEvent("enhanceTitle", { titleElem: titleElem });
1411
+ // }
1419
1412
  delete node.match;
1420
1413
  delete node.subMatchCount;
1421
1414
  delete node.titleWithHighlight;
@@ -1481,7 +1474,7 @@
1481
1474
  /*!
1482
1475
  * Wunderbaum - ext-keynav
1483
1476
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
1484
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
1477
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
1485
1478
  */
1486
1479
  const QUICKSEARCH_DELAY = 500;
1487
1480
  class KeynavExtension extends WunderbaumExtension {
@@ -1821,13 +1814,14 @@
1821
1814
  /*!
1822
1815
  * Wunderbaum - ext-logger
1823
1816
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
1824
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
1817
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
1825
1818
  */
1826
1819
  class LoggerExtension extends WunderbaumExtension {
1827
1820
  constructor(tree) {
1828
1821
  super(tree, "logger", {});
1829
1822
  this.ignoreEvents = new Set([
1830
- "enhanceTitle",
1823
+ "iconBadge",
1824
+ // "enhanceTitle",
1831
1825
  "render",
1832
1826
  "discard",
1833
1827
  ]);
@@ -1861,7 +1855,7 @@
1861
1855
  /*!
1862
1856
  * Wunderbaum - common
1863
1857
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
1864
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
1858
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
1865
1859
  */
1866
1860
  const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script
1867
1861
  /**
@@ -1889,30 +1883,50 @@
1889
1883
  * Default node icons.
1890
1884
  * Requires bootstrap icons https://icons.getbootstrap.com
1891
1885
  */
1892
- const iconMap = {
1893
- error: "bi bi-exclamation-triangle",
1894
- // loading: "bi bi-hourglass-split wb-busy",
1895
- loading: "bi bi-chevron-right wb-busy",
1896
- // loading: "bi bi-arrow-repeat wb-spin",
1897
- // loading: '<div class="spinner-border spinner-border-sm" role="status"> <span class="visually-hidden">Loading...</span> </div>',
1898
- // noData: "bi bi-search",
1899
- noData: "bi bi-question-circle",
1900
- expanderExpanded: "bi bi-chevron-down",
1901
- // expanderExpanded: "bi bi-dash-square",
1902
- expanderCollapsed: "bi bi-chevron-right",
1903
- // expanderCollapsed: "bi bi-plus-square",
1904
- expanderLazy: "bi bi-chevron-right wb-helper-lazy-expander",
1905
- // expanderLazy: "bi bi-chevron-bar-right",
1906
- checkChecked: "bi bi-check-square",
1907
- checkUnchecked: "bi bi-square",
1908
- checkUnknown: "bi bi-dash-square-dotted",
1909
- radioChecked: "bi bi-circle-fill",
1910
- radioUnchecked: "bi bi-circle",
1911
- radioUnknown: "bi bi-record-circle",
1912
- folder: "bi bi-folder2",
1913
- folderOpen: "bi bi-folder2-open",
1914
- folderLazy: "bi bi-folder-symlink",
1915
- doc: "bi bi-file-earmark",
1886
+ const iconMaps = {
1887
+ bootstrap: {
1888
+ error: "bi bi-exclamation-triangle",
1889
+ // loading: "bi bi-hourglass-split wb-busy",
1890
+ loading: "bi bi-chevron-right wb-busy",
1891
+ // loading: "bi bi-arrow-repeat wb-spin",
1892
+ // loading: '<div class="spinner-border spinner-border-sm" role="status"> <span class="visually-hidden">Loading...</span> </div>',
1893
+ // noData: "bi bi-search",
1894
+ noData: "bi bi-question-circle",
1895
+ expanderExpanded: "bi bi-chevron-down",
1896
+ // expanderExpanded: "bi bi-dash-square",
1897
+ expanderCollapsed: "bi bi-chevron-right",
1898
+ // expanderCollapsed: "bi bi-plus-square",
1899
+ expanderLazy: "bi bi-chevron-right wb-helper-lazy-expander",
1900
+ // expanderLazy: "bi bi-chevron-bar-right",
1901
+ checkChecked: "bi bi-check-square",
1902
+ checkUnchecked: "bi bi-square",
1903
+ checkUnknown: "bi bi-dash-square-dotted",
1904
+ radioChecked: "bi bi-circle-fill",
1905
+ radioUnchecked: "bi bi-circle",
1906
+ radioUnknown: "bi bi-record-circle",
1907
+ folder: "bi bi-folder2",
1908
+ folderOpen: "bi bi-folder2-open",
1909
+ folderLazy: "bi bi-folder-symlink",
1910
+ doc: "bi bi-file-earmark",
1911
+ },
1912
+ fontawesome6: {
1913
+ error: "fa-solid fa-triangle-exclamation",
1914
+ loading: "fa-solid fa-chevron-right fa-beat",
1915
+ noData: "fa-solid fa-circle-question",
1916
+ expanderExpanded: "fa-solid fa-chevron-down",
1917
+ expanderCollapsed: "fa-solid fa-chevron-right",
1918
+ expanderLazy: "fa-solid fa-chevron-right wb-helper-lazy-expander",
1919
+ checkChecked: "fa-regular fa-square-check",
1920
+ checkUnchecked: "fa-regular fa-square",
1921
+ checkUnknown: "fa-regular fa-square-minus",
1922
+ radioChecked: "fa-solid fa-circle",
1923
+ radioUnchecked: "fa-regular fa-circle",
1924
+ radioUnknown: "fa-regular fa-circle-question",
1925
+ folder: "fa-solid fa-folder-closed",
1926
+ folderOpen: "fa-regular fa-folder-open",
1927
+ folderLazy: "fa-solid fa-folder-plus",
1928
+ doc: "fa-regular fa-file",
1929
+ },
1916
1930
  };
1917
1931
  /** Dict keys that are evaluated by source loader (others are added to `tree.data` instead). */
1918
1932
  const RESERVED_TREE_SOURCE_KEYS = new Set([
@@ -2107,7 +2121,7 @@
2107
2121
  /*!
2108
2122
  * Wunderbaum - ext-dnd
2109
2123
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2110
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
2124
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
2111
2125
  */
2112
2126
  const nodeMimeType = "application/x-wunderbaum-node";
2113
2127
  class DndExtension extends WunderbaumExtension {
@@ -2304,7 +2318,7 @@
2304
2318
  n._org_key = n.key;
2305
2319
  delete n.key;
2306
2320
  });
2307
- nodeData.treeId = srcNode.tree.id;
2321
+ nodeData._treeId = srcNode.tree.id;
2308
2322
  const json = JSON.stringify(nodeData);
2309
2323
  e.dataTransfer.setData(nodeMimeType, json);
2310
2324
  // e.dataTransfer!.setData("text/html", $(node.span).html());
@@ -2437,7 +2451,7 @@
2437
2451
  /*!
2438
2452
  * Wunderbaum - drag_observer
2439
2453
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2440
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
2454
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
2441
2455
  */
2442
2456
  /**
2443
2457
  * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'.
@@ -2573,7 +2587,7 @@
2573
2587
  /*!
2574
2588
  * Wunderbaum - ext-grid
2575
2589
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2576
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
2590
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
2577
2591
  */
2578
2592
  class GridExtension extends WunderbaumExtension {
2579
2593
  constructor(tree) {
@@ -2610,7 +2624,7 @@
2610
2624
  /*!
2611
2625
  * Wunderbaum - deferred
2612
2626
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2613
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
2627
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
2614
2628
  */
2615
2629
  /**
2616
2630
  * Implement a ES6 Promise, that exposes a resolve() and reject() method.
@@ -2663,7 +2677,7 @@
2663
2677
  /*!
2664
2678
  * Wunderbaum - wunderbaum_node
2665
2679
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2666
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
2680
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
2667
2681
  */
2668
2682
  /** WunderbaumNode properties that can be passed with source data.
2669
2683
  * (Any other source properties will be stored as `node.data.PROP`.)
@@ -2685,16 +2699,12 @@
2685
2699
  "tooltip",
2686
2700
  "type",
2687
2701
  "unselectable",
2688
- // "unselectableIgnore",
2689
- // "unselectableStatus",
2690
2702
  ]);
2691
2703
  /** WunderbaumNode properties that will be returned by `node.toDict()`.)
2692
2704
  */
2693
2705
  const NODE_DICT_PROPS = new Set(NODE_PROPS);
2694
2706
  NODE_DICT_PROPS.delete("_partsel");
2695
2707
  NODE_DICT_PROPS.delete("unselectable");
2696
- // NODE_DICT_PROPS.delete("unselectableIgnore");
2697
- // NODE_DICT_PROPS.delete("unselectableStatus");
2698
2708
  /**
2699
2709
  * A single tree node.
2700
2710
  *
@@ -2711,13 +2721,6 @@
2711
2721
  */
2712
2722
  this.refKey = undefined;
2713
2723
  this.children = null;
2714
- this.lazy = false;
2715
- /** Expansion state.
2716
- * @see {@link isExpandable}, {@link isExpanded}, {@link setExpanded}. */
2717
- this.expanded = false;
2718
- /** Selection state.
2719
- * @see {@link isSelected}, {@link setSelected}, {@link toggleSelected}. */
2720
- this.selected = false;
2721
2724
  /** Additional classes added to `div.wb-row`.
2722
2725
  * @see {@link hasClass}, {@link setClass}. */
2723
2726
  this.classes = null; //new Set<string>();
@@ -2743,7 +2746,7 @@
2743
2746
  data.icon != null ? (this.icon = data.icon) : 0;
2744
2747
  this.lazy = data.lazy === true;
2745
2748
  data.statusNodeType != null
2746
- ? (this.statusNodeType = "" + data.statusNodeType)
2749
+ ? (this.statusNodeType = ("" + data.statusNodeType))
2747
2750
  : 0;
2748
2751
  data.colspan != null ? (this.colspan = !!data.colspan) : 0;
2749
2752
  // Selection
@@ -2751,10 +2754,6 @@
2751
2754
  data.radiogroup != null ? (this.radiogroup = !!data.radiogroup) : 0;
2752
2755
  this.selected = data.selected === true;
2753
2756
  data.unselectable === true ? (this.unselectable = true) : 0;
2754
- // data.unselectableStatus != null
2755
- // ? (this.unselectableStatus = !!data.unselectableStatus)
2756
- // : 0;
2757
- // data.unselectableIgnore === true ? (this.unselectableIgnore = true) : 0;
2758
2757
  if (data.classes) {
2759
2758
  this.setClass(data.classes);
2760
2759
  }
@@ -2886,7 +2885,7 @@
2886
2885
  // if (this.parent && this.parent.children) {
2887
2886
  // this.fixSelection3FromEndNodes();
2888
2887
  // } else {
2889
- // // my happen when loading __root__;
2888
+ // // may happen when loading __root__;
2890
2889
  // }
2891
2890
  // }
2892
2891
  tree.enableUpdate(true);
@@ -3331,7 +3330,7 @@
3331
3330
  return false;
3332
3331
  }
3333
3332
  if (this.children == null) {
3334
- return this.lazy; // null or undefined can trigger lazy load
3333
+ return !!this.lazy; // null or undefined can trigger lazy load
3335
3334
  }
3336
3335
  if (this.children.length === 0) {
3337
3336
  return !!this.tree.options.emptyChildListExpandable;
@@ -3387,6 +3386,10 @@
3387
3386
  return !this.selected && !!this._partsel;
3388
3387
  }
3389
3388
  /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */
3389
+ isRadio() {
3390
+ return this.checkbox === "radio" || !!this.parent.radiogroup;
3391
+ }
3392
+ /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */
3390
3393
  isRendered() {
3391
3394
  return !!this._rowElem;
3392
3395
  }
@@ -3500,6 +3503,7 @@
3500
3503
  else if (isPlainObject(source)) {
3501
3504
  // source is a plain object with `.url` property.
3502
3505
  ({ url, params, body, options, ...rest } = source);
3506
+ assert(!rest || Object.keys(rest).length === 0, `Unexpected source properties: ${Object.keys(rest)}. Use 'options' instead.`);
3503
3507
  assert(typeof url === "string", `expected source.url as string`);
3504
3508
  if (isPlainObject(options)) {
3505
3509
  fetchOpts = options;
@@ -3898,7 +3902,7 @@
3898
3902
  renderColInfosById: renderColInfosById,
3899
3903
  };
3900
3904
  }
3901
- _createIcon(parentElem, replaceChild, showLoading) {
3905
+ _createIcon(iconMap, parentElem, replaceChild, showLoading) {
3902
3906
  let iconSpan;
3903
3907
  let icon = this.getOption("icon");
3904
3908
  if (this._errorInfo) {
@@ -3952,6 +3956,30 @@
3952
3956
  else {
3953
3957
  parentElem.appendChild(iconSpan);
3954
3958
  }
3959
+ // Event handler `tree.iconBadge` can return a badge text or HTMLSpanElement
3960
+ let cbRes = this._callEvent("iconBadge", { iconSpan: iconSpan });
3961
+ let badge = null;
3962
+ if (cbRes != null && cbRes !== false) {
3963
+ let classes = "";
3964
+ let tooltip = "";
3965
+ if (isPlainObject(cbRes)) {
3966
+ badge = "" + cbRes.badge;
3967
+ classes = cbRes.badgeClass ? " " + cbRes.badgeClass : "";
3968
+ tooltip = cbRes.badgeTooltip ? ` title="${cbRes.badgeTooltip}"` : "";
3969
+ }
3970
+ else if (typeof cbRes === "number") {
3971
+ badge = "" + cbRes;
3972
+ }
3973
+ else {
3974
+ badge = cbRes; // string or HTMLSpanElement
3975
+ }
3976
+ if (typeof badge === "string") {
3977
+ badge = elemFromHtml(`<span class="wb-badge${classes}"${tooltip}>${escapeHtml(badge)}</span>`);
3978
+ }
3979
+ if (badge) {
3980
+ iconSpan.append(badge);
3981
+ }
3982
+ }
3955
3983
  // this.log("_createIcon: ", iconSpan);
3956
3984
  return iconSpan;
3957
3985
  }
@@ -4011,14 +4039,14 @@
4011
4039
  }
4012
4040
  // Render the icon (show a 'loading' icon if we do not have an expander that
4013
4041
  // we would prefer).
4014
- iconSpan = this._createIcon(nodeElem, null, !expanderSpan);
4042
+ iconSpan = this._createIcon(tree.iconMap, nodeElem, null, !expanderSpan);
4015
4043
  if (iconSpan) {
4016
4044
  ofsTitlePx += ICON_WIDTH;
4017
4045
  }
4018
4046
  titleSpan = document.createElement("span");
4019
4047
  titleSpan.classList.add("wb-title");
4020
4048
  nodeElem.appendChild(titleSpan);
4021
- this._callEvent("enhanceTitle", { titleSpan: titleSpan });
4049
+ // this._callEvent("enhanceTitle", { titleSpan: titleSpan });
4022
4050
  // Store the width of leading icons with the node, so we can calculate
4023
4051
  // the width of the embedded title span later
4024
4052
  nodeElem._ofsTitlePx = ofsTitlePx;
@@ -4145,6 +4173,7 @@
4145
4173
  _render_status(opts) {
4146
4174
  // this.log("_render_status", opts);
4147
4175
  const tree = this.tree;
4176
+ const iconMap = tree.iconMap;
4148
4177
  const treeOptions = tree.options;
4149
4178
  const typeInfo = this.type ? tree.types[this.type] : null;
4150
4179
  const rowDiv = this._rowElem;
@@ -4230,7 +4259,7 @@
4230
4259
  // Update icon (if not opts.isNew, which would rebuild markup anyway)
4231
4260
  const iconSpan = nodeElem.querySelector("i.wb-icon");
4232
4261
  if (iconSpan) {
4233
- this._createIcon(nodeElem, iconSpan, !expanderSpan);
4262
+ this._createIcon(tree.iconMap, nodeElem, iconSpan, !expanderSpan);
4234
4263
  }
4235
4264
  }
4236
4265
  // Adjust column width
@@ -4555,7 +4584,7 @@
4555
4584
  /** Toggle the check/uncheck state. */
4556
4585
  toggleSelected(options) {
4557
4586
  let flag = this.isSelected();
4558
- if (flag === undefined) {
4587
+ if (flag === undefined && !this.isRadio()) {
4559
4588
  flag = this._anySelectable();
4560
4589
  }
4561
4590
  else {
@@ -4959,7 +4988,7 @@
4959
4988
  /*!
4960
4989
  * Wunderbaum - ext-edit
4961
4990
  * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
4962
- * v0.4.0, Wed, 06 Sep 2023 08:21:56 GMT (https://github.com/mar10/wunderbaum)
4991
+ * v0.5.1, Sat, 16 Sep 2023 19:08:55 GMT (https://github.com/mar10/wunderbaum)
4963
4992
  */
4964
4993
  // const START_MARKER = "\uFFF7";
4965
4994
  class EditExtension extends WunderbaumExtension {
@@ -5255,8 +5284,8 @@
5255
5284
  * https://github.com/mar10/wunderbaum
5256
5285
  *
5257
5286
  * Released under the MIT license.
5258
- * @version v0.4.0
5259
- * @date Wed, 06 Sep 2023 08:21:56 GMT
5287
+ * @version v0.5.1
5288
+ * @date Sat, 16 Sep 2023 19:08:55 GMT
5260
5289
  */
5261
5290
  // import "./wunderbaum.scss";
5262
5291
  class WbSystemRoot extends WunderbaumNode {
@@ -5328,6 +5357,7 @@
5328
5357
  header: null,
5329
5358
  // headerHeightPx: ROW_HEIGHT,
5330
5359
  rowHeightPx: ROW_HEIGHT,
5360
+ iconMap: "bootstrap",
5331
5361
  columns: null,
5332
5362
  types: null,
5333
5363
  // escapeTitles: true,
@@ -5345,10 +5375,11 @@
5345
5375
  navigationModeOption: null,
5346
5376
  quicksearch: true,
5347
5377
  // --- Events ---
5348
- change: noop,
5349
- enhanceTitle: noop,
5350
- error: noop,
5351
- receive: noop,
5378
+ iconBadge: null,
5379
+ change: null,
5380
+ // enhanceTitle: null,
5381
+ error: null,
5382
+ receive: null,
5352
5383
  // --- Strings ---
5353
5384
  strings: {
5354
5385
  loadError: "Error",
@@ -5642,6 +5673,16 @@
5642
5673
  }
5643
5674
  return null;
5644
5675
  }
5676
+ /**
5677
+ * Return the icon-function -> icon-definition mapping.
5678
+ */
5679
+ get iconMap() {
5680
+ const map = this.options.iconMap;
5681
+ if (typeof map === "string") {
5682
+ return iconMaps[map];
5683
+ }
5684
+ return map;
5685
+ }
5645
5686
  /**
5646
5687
  * Return a WunderbaumNode instance from element or event.
5647
5688
  */
@@ -7378,7 +7419,7 @@
7378
7419
  }
7379
7420
  Wunderbaum.sequence = 0;
7380
7421
  /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
7381
- Wunderbaum.version = "v0.4.0"; // Set to semver by 'grunt release'
7422
+ Wunderbaum.version = "v0.5.1"; // Set to semver by 'grunt release'
7382
7423
  /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
7383
7424
  Wunderbaum.util = util;
7384
7425