From 134e24f8d855dfd73809a2e516f74d288619b087 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Thu, 11 Jan 2024 20:37:38 +0100 Subject: [PATCH] Bump version to 0.8.0 --- dist/wunderbaum.css | 5 +- dist/wunderbaum.css.map | 2 +- dist/wunderbaum.d.ts | 571 +- dist/wunderbaum.esm.js | 1253 +- dist/wunderbaum.esm.min.js | 64 +- dist/wunderbaum.esm.min.js.map | 2 +- dist/wunderbaum.umd.js | 15391 ++++++++-------- dist/wunderbaum.umd.min.js | 139 +- dist/wunderbaum.umd.min.js.map | 2 +- docs/api/assets/navigation.js | 2 +- docs/api/assets/search.js | 2 +- docs/api/classes/util.Deferred.html | 20 +- docs/api/classes/util.ValidationError.html | 10 +- docs/api/classes/wb_node.WunderbaumNode.html | 318 +- docs/api/classes/wunderbaum.Wunderbaum.html | 293 +- docs/api/enums/types.ChangeType.html | 24 +- docs/api/enums/types.NavModeEnum.html | 16 +- docs/api/enums/types.NodeRegion.html | 22 +- docs/api/enums/types.NodeStatusType.html | 18 +- docs/api/enums/types.RenderFlag.html | 16 +- .../common.decompressSourceData.html | 8 +- .../common.makeNodeTitleMatcher.html | 10 +- .../common.makeNodeTitleStartMatcher.html | 8 +- .../api/functions/common.nodeTitleSorter.html | 8 +- docs/api/functions/util.adaptiveThrottle.html | 8 +- docs/api/functions/util.assert.html | 8 +- docs/api/functions/util.debounce.html | 101 + docs/api/functions/util.documentReady.html | 8 +- .../functions/util.documentReadyPromise.html | 8 +- docs/api/functions/util.each.html | 8 +- docs/api/functions/util.elemFromHtml.html | 8 +- docs/api/functions/util.elemFromSelector.html | 8 +- docs/api/functions/util.error.html | 8 +- docs/api/functions/util.escapeHtml.html | 8 +- docs/api/functions/util.escapeRegex.html | 8 +- docs/api/functions/util.escapeTooltip.html | 8 +- docs/api/functions/util.eventToString.html | 8 +- docs/api/functions/util.extend.html | 8 +- docs/api/functions/util.extractHtmlText.html | 8 +- docs/api/functions/util.getOption.html | 8 +- docs/api/functions/util.getValueFromElem.html | 8 +- docs/api/functions/util.isArray.html | 8 +- docs/api/functions/util.isEmptyObject.html | 8 +- docs/api/functions/util.isFunction.html | 8 +- docs/api/functions/util.isPlainObject.html | 8 +- docs/api/functions/util.noop.html | 8 +- docs/api/functions/util.onEvent.html | 10 +- docs/api/functions/util.overrideMethod.html | 8 +- docs/api/functions/util.setElemDisplay.html | 8 +- .../api/functions/util.setTimeoutPromise.html | 8 +- docs/api/functions/util.setValueToElem.html | 8 +- docs/api/functions/util.sleep.html | 8 +- docs/api/functions/util.throttle.html | 100 + docs/api/functions/util.toSet.html | 8 +- docs/api/functions/util.toggleCheckbox.html | 8 +- docs/api/functions/util.type.html | 8 +- docs/api/index.html | 8 +- .../interfaces/types.AddChildrenOptions.html | 14 +- .../interfaces/types.ApplyCommandOptions.html | 8 +- .../interfaces/types.ColumnDefinition.html | 30 +- .../api/interfaces/types.ColumnEventInfo.html | 16 +- .../interfaces/types.ExpandAllOptions.html | 16 +- .../interfaces/types.FilterNodesOptions.html | 22 +- .../interfaces/types.MakeVisibleOptions.html | 14 +- .../api/interfaces/types.NavigateOptions.html | 12 +- .../interfaces/types.NodeTypeDefinition.html | 18 +- docs/api/interfaces/types.RenderOptions.html | 22 +- .../types.ScrollIntoViewOptions.html | 16 +- .../api/interfaces/types.ScrollToOptions.html | 18 +- .../interfaces/types.SetActiveOptions.html | 20 +- .../interfaces/types.SetColumnOptions.html | 12 +- .../interfaces/types.SetExpandedOptions.html | 20 +- .../interfaces/types.SetSelectedOptions.html | 16 +- .../interfaces/types.SetStatusOptions.html | 12 +- docs/api/interfaces/types.SourceAjaxType.html | 16 +- .../interfaces/types.SourceObjectType.html | 24 +- docs/api/interfaces/types.UpdateOptions.html | 10 +- .../interfaces/types.VisitRowsOptions.html | 18 +- .../interfaces/types.WbActivateEventType.html | 22 +- .../interfaces/types.WbChangeEventType.html | 36 +- .../interfaces/types.WbClickEventType.html | 20 +- .../types.WbDeactivateEventType.html | 22 +- .../types.WbEditApplyEventType.html | 38 +- .../interfaces/types.WbEditEditEventType.html | 22 +- .../interfaces/types.WbErrorEventType.html | 22 +- docs/api/interfaces/types.WbEventInfo.html | 26 +- .../interfaces/types.WbExpandEventType.html | 142 + .../interfaces/types.WbFocusEventType.html | 18 +- .../types.WbIconBadgeEventResultType.html | 14 +- .../types.WbIconBadgeEventType.html | 22 +- .../api/interfaces/types.WbInitEventType.html | 18 +- .../interfaces/types.WbKeydownEventType.html | 20 +- docs/api/interfaces/types.WbNodeData.html | 44 +- .../api/interfaces/types.WbNodeEventType.html | 25 +- .../interfaces/types.WbReceiveEventType.html | 22 +- .../interfaces/types.WbRenderEventType.html | 30 +- .../interfaces/types.WbSelectEventType.html | 22 +- .../api/interfaces/types.WbTreeEventType.html | 16 +- .../wb_options.WunderbaumOptions.html | 112 +- docs/api/modules/common.html | 8 +- docs/api/modules/types.html | 9 +- docs/api/modules/util.html | 30 +- docs/api/modules/wb_node.html | 8 +- docs/api/modules/wb_options.html | 8 +- docs/api/modules/wunderbaum.html | 8 +- docs/api/types/types.ApplyCommandType.html | 8 +- docs/api/types/types.BoolOptionResolver.html | 8 +- .../types.BoolOrStringOptionResolver.html | 8 +- docs/api/types/types.CheckboxOption.html | 8 +- .../api/types/types.ColumnDefinitionList.html | 8 +- docs/api/types/types.ColumnEventInfoMap.html | 8 +- docs/api/types/types.DndOptionsType.html | 8 +- .../types/types.DropEffectAllowedType.html | 8 +- docs/api/types/types.DropEffectType.html | 8 +- docs/api/types/types.DropRegionType.html | 8 +- docs/api/types/types.DropRegionTypeSet.html | 8 +- docs/api/types/types.DynamicBoolOption.html | 8 +- .../types.DynamicBoolOrStringOption.html | 8 +- .../types/types.DynamicCheckboxOption.html | 8 +- docs/api/types/types.DynamicIconOption.html | 8 +- docs/api/types/types.DynamicStringOption.html | 8 +- docs/api/types/types.EditOptionsType.html | 8 +- docs/api/types/types.FilterModeType.html | 8 +- docs/api/types/types.FilterOptionsType.html | 17 +- docs/api/types/types.GridOptionsType.html | 8 +- docs/api/types/types.IconOption.html | 8 +- docs/api/types/types.InsertNodeType.html | 8 +- docs/api/types/types.MatcherCallback.html | 8 +- docs/api/types/types.NodeAnyCallback.html | 8 +- docs/api/types/types.NodeFilterCallback.html | 8 +- docs/api/types/types.NodeFilterResponse.html | 8 +- docs/api/types/types.NodeSelectCallback.html | 8 +- docs/api/types/types.NodeStringCallback.html | 8 +- docs/api/types/types.NodeToDictCallback.html | 8 +- .../types/types.NodeTypeDefinitionMap.html | 8 +- docs/api/types/types.NodeVisitCallback.html | 8 +- docs/api/types/types.NodeVisitResponse.html | 8 +- docs/api/types/types.SelectModeType.html | 8 +- docs/api/types/types.SortCallback.html | 8 +- docs/api/types/types.SourceListType.html | 8 +- docs/api/types/types.SourceType.html | 8 +- docs/api/types/types.TristateType.html | 8 +- docs/api/types/types.WbIconBadgeCallback.html | 8 +- docs/api/types/util.EventCallbackType.html | 8 +- docs/api/types/util.FunctionType.html | 8 +- .../variables/common.DEFAULT_DEBUGLEVEL.html | 8 +- docs/api/variables/common.ICON_WIDTH.html | 8 +- docs/api/variables/common.INPUT_KEYS.html | 8 +- docs/api/variables/common.KEY_NODATA.html | 8 +- .../variables/common.KEY_TO_ACTION_DICT.html | 8 +- .../variables/common.RENDER_MAX_PREFETCH.html | 8 +- .../variables/common.RENDER_MIN_PREFETCH.html | 8 +- .../common.RESERVED_TREE_SOURCE_KEYS.html | 8 +- docs/api/variables/common.ROW_HEIGHT.html | 8 +- docs/api/variables/common.TEST_IMG.html | 8 +- .../variables/common.TITLE_SPAN_PAD_Y.html | 8 +- docs/api/variables/common.iconMaps.html | 8 +- docs/api/variables/util.MAX_INT.html | 8 +- docs/api/variables/util.MOUSE_BUTTONS.html | 8 +- docs/api/variables/util.isMac.html | 8 +- docs/unittest/test-core.js | 46 +- package.json | 2 +- 162 files changed, 10637 insertions(+), 9653 deletions(-) create mode 100644 docs/api/functions/util.debounce.html create mode 100644 docs/api/functions/util.throttle.html create mode 100644 docs/api/interfaces/types.WbExpandEventType.html diff --git a/dist/wunderbaum.css b/dist/wunderbaum.css index d4d5f23d..5b183667 100644 --- a/dist/wunderbaum.css +++ b/dist/wunderbaum.css @@ -492,10 +492,13 @@ i.wb-icon > span.wb-badge { } .wb-col input:invalid { - color: var(--wb-error-color); background-color: var(--wb-error-background-color); } +.wb-col.wb-invalid { + border: 1px dotted var(--wb-error-color); +} + @keyframes wb-spin-animation { 0% { transform: rotate(0deg); diff --git a/dist/wunderbaum.css.map b/dist/wunderbaum.css.map index 3bfee3bd..ce2be56e 100644 --- a/dist/wunderbaum.css.map +++ b/dist/wunderbaum.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../src/wunderbaum.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AA2EA;AAAA;EAME;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAMF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAGA;AAsBA;AAuBA;AAwQA;AAoHA;AAwBA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AAziBA;EAEE;;AAIF;EACE;EACA;;AAGF;EACE;EAEA;;AAMF;EACE;EACA;EACA;;AAGF;AAAA;EAEE;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAMA;EACE;EACA;EACA;EACA;;AAIA;EACE;;AAKF;EAEE;;AAGF;EAEE;;AAGF;EACE;;AAOA;EAEE;EACA;;AAEA;EACE;;AAaN;EAEE;EACA;;AAEA;EACE;;AAON;EACE;;AAEA;EACE;;AAOF;EACE;;AAGF;EAEE;;AAGA;EACE;;AAKJ;EACE;EACA;;AAGF;EAEE;EACA;;AAEA;EAEE;;AA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;EACE;EACA;;;AAQJ;AACA;AAAA;EAEE;;;AAGF;AAAA;EAEE;;;AAIA;AAAA;EAEE;;AAGF;AAAA;EAEE;;;AAIJ;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;;;AAIJ;AAAA;AAAA;AAMA;EACE;EACA;;;AAGF;EAEE;EACA;;;AAGF;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE","file":"wunderbaum.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../src/wunderbaum.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AA2EA;AAAA;EAME;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAMF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAGA;AAsBA;AAuBA;AAwQA;AAoHA;AAwBA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AAziBA;EAEE;;AAIF;EACE;EACA;;AAGF;EACE;EAEA;;AAMF;EACE;EACA;EACA;;AAGF;AAAA;EAEE;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAMA;EACE;EACA;EACA;EACA;;AAIA;EACE;;AAKF;EAEE;;AAGF;EAEE;;AAGF;EACE;;AAOA;EAEE;EACA;;AAEA;EACE;;AAaN;EAEE;EACA;;AAEA;EACE;;AAON;EACE;;AAEA;EACE;;AAOF;EACE;;AAGF;EAEE;;AAGA;EACE;;AAKJ;EACE;EACA;;AAGF;EAEE;EACA;;AAEA;EAEE;;AAIJ;EACE;;AAGF;AAAA;AAAA;EAG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AEE;;;AAGF;AAAA;EAEE;;;AAIA;AAAA;EAEE;;AAGF;AAAA;EAEE;;;AAIJ;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;;;AAIJ;AAAA;AAAA;AAMA;EACE;EACA;;;AAGF;EAGE;;;AAGF;EACE;;;AAKF;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE","file":"wunderbaum.css"} \ No newline at end of file diff --git a/dist/wunderbaum.d.ts b/dist/wunderbaum.d.ts index 4f08b4b7..2060e3c4 100644 --- a/dist/wunderbaum.d.ts +++ b/dist/wunderbaum.d.ts @@ -1,3 +1,137 @@ +declare module "debounce" { + /*! + * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 + * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE + * Modified for TypeScript type annotations. + */ + type Procedure = (...args: any[]) => any; + type DebounceOptions = { + leading?: boolean; + maxWait?: number; + trailing?: boolean; + }; + type ThrottleOptions = { + leading?: boolean; + trailing?: boolean; + }; + export interface DebouncedFunction { + (this: ThisParameterType, ...args: Parameters): ReturnType; + cancel: () => void; + flush: () => any; + pending: () => boolean; + } + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked, or until the next browser frame is drawn. The debounced function + * comes with a `cancel` method to cancel delayed `func` invocations and a + * `flush` method to immediately invoke them. Provide `options` to indicate + * whether `func` should be invoked on the leading and/or trailing edge of the + * `wait` timeout. The `func` is invoked with the last arguments provided to the + * debounced function. Subsequent calls to the debounced function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until the next tick, similar to `setTimeout` with a timeout of `0`. + * + * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` + * invocation will be deferred until the next frame is drawn (typically about + * 16ms). + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `debounce` and `throttle`. + * + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] + * The number of milliseconds to delay; if omitted, `requestAnimationFrame` is + * used (if available). + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', debounce(calculateLayout, 150)) + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })) + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 }) + * const source = new EventSource('/stream') + * jQuery(source).on('message', debounced) + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel) + * + * // Check for pending invocations. + * const status = debounced.pending() ? "Pending..." : "Ready" + */ + export function debounce(func: F, wait?: number, options?: DebounceOptions): DebouncedFunction; + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds (or once per browser frame). The throttled function + * comes with a `cancel` method to cancel delayed `func` invocations and a + * `flush` method to immediately invoke them. Provide `options` to indicate + * whether `func` should be invoked on the leading and/or trailing edge of the + * `wait` timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until the next tick, similar to `setTimeout` with a timeout of `0`. + * + * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` + * invocation will be deferred until the next frame is drawn (typically about + * 16ms). + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `throttle` and `debounce`. + * + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] + * The number of milliseconds to throttle invocations to; if omitted, + * `requestAnimationFrame` is used (if available). + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', throttle(updatePosition, 100)) + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * const throttled = throttle(renewToken, 300000, { 'trailing': false }) + * jQuery(element).on('click', throttled) + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel) + */ + export function throttle(func: F, wait?: number, options?: ThrottleOptions): DebouncedFunction; +} declare module "util" { /*! * Wunderbaum - util @@ -5,6 +139,8 @@ declare module "util" { * @VERSION, @DATE (https://github.com/mar10/wunderbaum) */ /** @module util */ + import { DebouncedFunction, debounce, throttle } from "debounce"; + export { debounce, throttle }; /** Readable names for `MouseEvent.button` */ export const MOUSE_BUTTONS: { [key: number]: string; @@ -14,8 +150,18 @@ declare module "util" { export const isMac: boolean; export type FunctionType = (...args: any[]) => any; export type EventCallbackType = (e: Event) => boolean | void; + /** A generic error that can be thrown to indicate a validation error when + * handling the `apply` event for a node title or the `change` event for a + * grid cell. + */ + export class ValidationError extends Error { + constructor(message: string); + } /** * A ES6 Promise, that exposes the resolve()/reject() methods. + * + * TODO: See [Promise.withResolvers()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers#description) + * , a proposed standard, but not yet implemented in any browser. */ export class Deferred { private thens; @@ -115,13 +261,11 @@ declare module "util" { */ export function setValueToElem(elem: HTMLElement, value: any): void; /** Show/hide element by setting the `display` style to 'none'. */ - export function setElemDisplay(elem: string | Element, flag: boolean): void; + export function setElemDisplay(elem: string | HTMLElement, flag: boolean): void; /** Create and return an unconnected `HTMLElement` from a HTML string. */ - export function elemFromHtml(html: string): HTMLElement; + export function elemFromHtml(html: string): T; /** Return a HtmlElement from selector or cast an existing element. */ - export function elemFromSelector(obj: string | Element): HTMLElement | null; - /** Return a EventTarget from selector or cast an existing element. */ - export function eventTargetFromSelector(obj: string | EventTarget): EventTarget | null; + export function elemFromSelector(obj: string | T): T | null; /** * Return a canonical descriptive string for a keyboard or mouse event. * @@ -164,7 +308,7 @@ declare module "util" { /** A dummy function that does nothing ('no operation'). */ export function noop(...args: any[]): any; /** - * Bind one or more event handlers directly to an [[EventTarget]]. + * Bind one or more event handlers directly to an [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget). * * @param element EventTarget or selector * @param eventNames @@ -202,7 +346,7 @@ declare module "util" { */ export function overrideMethod(instance: any, methodName: string, handler: FunctionType, ctx?: any): void; /** Run function after ms milliseconds and return a promise that resolves when done. */ - export function setTimeoutPromise(this: unknown, callback: (...args: any[]) => void, ms: number): Promise; + export function setTimeoutPromise(this: unknown, callback: (...args: any[]) => T, ms: number): Promise; /** * Wait `ms` microseconds. * @@ -249,7 +393,7 @@ declare module "util" { * throttledFoo(); * ``` */ - export function adaptiveThrottle(this: unknown, callback: (...args: any[]) => void, options: any): (...args: any[]) => void; + export function adaptiveThrottle(this: unknown, callback: (...args: any[]) => void, options: object): DebouncedFunction<(...args: any[]) => void>; } declare module "common" { /*! @@ -305,7 +449,7 @@ declare module "common" { }; /** Return a callback that returns true if the node title matches the string * or regular expression. - * @see {@link WunderbaumNode.findAll} + * @see {@link WunderbaumNode.findAll()} */ export function makeNodeTitleMatcher(match: string | RegExp): MatcherCallback; /** Return a callback that returns true if the node title starts with a string (case-insensitive). */ @@ -346,23 +490,23 @@ declare module "deferred" { * } * ``` */ - export class Deferred { + export class Deferred { private _promise; protected _resolve: any; protected _reject: any; constructor(); - /** Resolve the [[Promise]]. */ + /** Resolve the Promise. */ resolve(value?: any): void; - /** Reject the [[Promise]]. */ + /** Reject the Promise. */ reject(reason?: any): void; - /** Return the native [[Promise]] instance.*/ - promise(): Promise; - /** Call [[Promise.then]] on the embedded promise instance.*/ + /** Return the native Promise instance.*/ + promise(): Promise; + /** Call Promise.then on the embedded promise instance.*/ then(cb: PromiseCallbackType): Promise; - /** Call [[Promise.catch]] on the embedded promise instance.*/ - catch(cb: PromiseCallbackType): Promise; - /** Call [[Promise.finally]] on the embedded promise instance.*/ - finally(cb: finallyCallbackType): Promise; + /** Call Promise.catch on the embedded promise instance.*/ + catch(cb: PromiseCallbackType): Promise; + /** Call Promise.finally on the embedded promise instance.*/ + finally(cb: finallyCallbackType): Promise; } } declare module "wb_node" { @@ -489,6 +633,8 @@ declare module "wb_node" { * as space-separated string, array of strings, or set of strings. */ setClass(className: string | string[] | Set, flag?: boolean): void; + /** Start editing this node's title. */ + startEditTitle(): void; /** Call `setExpanded()` on all descendant nodes. */ expandAll(flag?: boolean, options?: ExpandAllOptions): Promise; /** @@ -554,6 +700,13 @@ declare module "wb_node" { * @returns {WunderbaumNode | null} */ getColElem(colIdx: number | string): HTMLSpanElement; + /** + * Return all nodes with the same refKey. + * + * @param includeSelf Include this node itself. + * @see {@link Wunderbaum.findByRefKey} + */ + getCloneList(includeSelf?: boolean): WunderbaumNode[]; /** Return the first child node or null. * @returns {WunderbaumNode | null} */ @@ -590,19 +743,22 @@ declare module "wb_node" { /** Return true if this node is the currently active tree node. */ isActive(): boolean; /** Return true if this node is a direct or indirect parent of `other`. - * (See also [[isParentOf]].) + * @see {@link WunderbaumNode.isParentOf} */ isAncestorOf(other: WunderbaumNode): boolean; /** Return true if this node is a **direct** subnode of `other`. - * (See also [[isDescendantOf]].) + * @see {@link WunderbaumNode.isDescendantOf} */ isChildOf(other: WunderbaumNode): boolean; + /** Return true if this node's refKey is used by at least one other node. + */ + isClone(): boolean; /** Return true if this node's title spans all columns, i.e. the node has no * grid cells. */ isColspan(): boolean; /** Return true if this node is a direct or indirect subnode of `other`. - * (See also [[isChildOf]].) + * @see {@link WunderbaumNode.isChildOf} */ isDescendantOf(other: WunderbaumNode): boolean; /** Return true if this node has children, i.e. the node is generally expandable. @@ -610,8 +766,11 @@ declare module "wb_node" { * an expand operation is currently possible. */ isExpandable(andCollapsed?: boolean): boolean; - /** Return true if this node is currently in edit-title mode. */ - isEditing(): boolean; + /** Return true if _this_ node is currently in edit-title mode. + * + * See {@link Wunderbaum.startEditTitle} to check if any node is currently edited. + */ + isEditingTitle(): boolean; /** Return true if this node is currently expanded. */ isExpanded(): boolean; /** Return true if this node is the first node of its parent's children. */ @@ -627,7 +786,7 @@ declare module "wb_node" { /** Return true if this node is a temporarily generated status node of type 'paging'. */ isPagingNode(): boolean; /** Return true if this node is a **direct** parent of `other`. - * (See also [[isAncestorOf]].) + * @see {@link WunderbaumNode.isAncestorOf} */ isParentOf(other: WunderbaumNode): boolean; /** (experimental) Return true if this node is partially loaded. */ @@ -639,7 +798,7 @@ declare module "wb_node" { /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */ isRendered(): boolean; /** Return true if this node is the (invisible) system root node. - * (See also [[isTopLevel()]].) + * @see {@link WunderbaumNode.isTopLevel} */ isRootNode(): boolean; /** Return true if this node is selected, i.e. the checkbox is set. @@ -677,7 +836,7 @@ declare module "wb_node" { * @param {object} [options] passed to `setExpanded()`. * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true} */ - makeVisible(options?: MakeVisibleOptions): Promise; + makeVisible(options?: MakeVisibleOptions): Promise; /** Move this node to targetNode. */ moveTo(targetNode: WunderbaumNode, mode?: InsertNodeType, map?: NodeAnyCallback): void; /** Set focus relative to this node and optionally activate. @@ -756,9 +915,10 @@ declare module "wb_node" { */ scrollIntoView(options?: ScrollIntoViewOptions): Promise; /** - * Activate this node, deactivate previous, send events, activate column and scroll int viewport. + * Activate this node, deactivate previous, send events, activate column and + * scroll into viewport. */ - setActive(flag?: boolean, options?: SetActiveOptions): Promise; + setActive(flag?: boolean, options?: SetActiveOptions): Promise; /** * Expand or collapse this node. */ @@ -874,7 +1034,7 @@ declare module "wb_options" { */ import { ColumnDefinitionList, DndOptionsType, DynamicBoolOption, DynamicBoolOrStringOption, DynamicCheckboxOption, DynamicIconOption, EditOptionsType, FilterOptionsType, NavModeEnum, NodeTypeDefinitionMap, SelectModeType, WbActivateEventType, WbChangeEventType, WbClickEventType, WbDeactivateEventType, WbErrorEventType, WbIconBadgeCallback, WbInitEventType, WbKeydownEventType, WbNodeData, WbNodeEventType, WbReceiveEventType, WbRenderEventType, WbTreeEventType } from "types"; /** - * Available options for [[Wunderbaum]]. + * Available options for {@link wunderbaum.Wunderbaum}. * * Options are passed to the constructor as plain object: * @@ -1307,24 +1467,56 @@ declare module "types" { event: Event; } export interface WbChangeEventType extends WbNodeEventType { + /** Additional information derived from the original change event. */ info: WbEventInfo; - inputElem: HTMLInputElement; + /** The embedded element that fired the change event. */ + inputElem: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; + /** The new value of the embedded element, depending on the input element type. */ inputValue: any; + /** Result of `inputElem.checkValidity()`. */ + inputValid: boolean; } export interface WbClickEventType extends WbTreeEventType { /** The original event. */ event: MouseEvent; + /** The clicked node if any. */ node: WunderbaumNode; + /** Additional information derived from the original mouse event. */ info: WbEventInfo; } - export interface WbErrorEventType extends WbNodeEventType { - error: any; - } export interface WbDeactivateEventType extends WbNodeEventType { nextNode: WunderbaumNode; /** The original event. */ event: Event; } + export interface WbEditApplyEventType extends WbNodeEventType { + /** Additional information derived from the original change event. */ + info: WbEventInfo; + /** The input element of the node title that fired the change event. */ + inputElem: HTMLInputElement; + /** The previous node title. */ + oldValue: string; + /** The new node title. */ + newValue: string; + /** Result of `inputElem.checkValidity()`. */ + inputValid: boolean; + } + export interface WbEditEditEventType extends WbNodeEventType { + /** The input element of the node title that was just created. */ + inputElem: HTMLInputElement; + } + export interface WbErrorEventType extends WbNodeEventType { + error: any; + } + export interface WbExpandEventType extends WbNodeEventType { + flag: boolean; + } + export interface WbFocusEventType extends WbTreeEventType { + /** The original event. */ + event: FocusEvent; + /** True if `focusin`, false if `focusout`. */ + flag: boolean; + } export interface WbIconBadgeEventType extends WbNodeEventType { iconSpan: HTMLElement; } @@ -1336,29 +1528,29 @@ declare module "types" { /** Tooltip for the badge. */ badgeTooltip?: string; } - export interface WbFocusEventType extends WbTreeEventType { - /** The original event. */ - event: FocusEvent; - /** True if `focusin`, false if `focusout`. */ - flag: boolean; + export interface WbInitEventType extends WbTreeEventType { + error?: any; } export interface WbKeydownEventType extends WbTreeEventType { /** The original event. */ event: KeyboardEvent; node: WunderbaumNode; + /** Additional information derived from the original keyboard event. */ info: WbEventInfo; } - export interface WbInitEventType extends WbTreeEventType { - error?: any; - } export interface WbReceiveEventType extends WbNodeEventType { response: any; } + export interface WbSelectEventType extends WbNodeEventType { + flag: boolean; + } export interface WbRenderEventType extends WbNodeEventType { /** * True if the node's markup was not yet created. In this case the render * event should create embedded input controls (in addition to update the - * values according to to current node data). + * values according to to current node data).
+ * False if the node's markup was already created. In this case the render + * event should only update the values according to to current node data. */ isNew: boolean; /** The node's `` element. */ @@ -1372,9 +1564,20 @@ declare module "types" { */ allColInfosById: ColumnEventInfoMap; /** - * Array of node's `` elements, *that should be rendered*. + * Array of node's `` elements, + * *that should be rendered by the event handler*. * In contrast to `allColInfosById`, the node title is not part of this array. * If node.isColspan() is true, this array is empty (`[]`). + * This allows to iterate over all relevant in a simple loop: + * ``` + * for (const col of Object.values(e.renderColInfosById)) { + * switch (col.id) { + * default: + * // Assumption: we named column.id === node.data.NAME + * col.elem.textContent = node.data[col.id]; + * break; + * } + * } */ renderColInfosById: ColumnEventInfoMap; } @@ -1425,14 +1628,17 @@ declare module "types" { * elements of that column. */ classes?: string; - /** If `headerClasses` is a string, it will be used for the header element, - * while `classes` is used for data elements. + /** If `headerClasses` is a set, it will be used for the header element only + * (unlike `classes`, which is used for body and header cells). */ headerClasses?: string; /** Optional HTML content that is rendered into all `span.wb-col` elements of that column.*/ html?: string; + /** @internal */ _weight?: number; + /** @internal */ _widthPx?: number; + /** @internal */ _ofsPx?: number; [key: string]: unknown; } @@ -1454,7 +1660,7 @@ declare module "types" { [colId: string]: ColumnEventInfo; }; /** - * Additional inforation derived from mouse or keyboard events. + * Additional information derived from mouse or keyboard events. * @see {@link Wunderbaum.getEventInfo} */ export interface WbEventInfo { @@ -1625,22 +1831,37 @@ declare module "types" { /** Which node to scroll into the viewport.*/ node: WunderbaumNode; } - /** Possible values for {@link WunderbaumNode.setActive()} `options` argument. */ + /** Possible values for {@link WunderbaumNode.setActive} `options` argument. */ export interface SetActiveOptions { - /** Generate (de)activate event, even if node already has this status (default: false). */ + /** Generate (de)activate event, even if node already has this status (@default: false). */ retrigger?: boolean; - /** Do not generate (de)activate event (default: false). */ + /** Do not generate (de)activate event (@default: false). */ noEvents?: boolean; - /** Set node as focused node (default: true). */ - focusNode?: boolean; - /** Set node as focused node (default: false). */ + /** Call `tree.setFocus()` to acquire keyboard focus (@default: false). */ focusTree?: boolean; /** Optional original event that will be passed to the (de)activate handler. */ event?: Event; - /** Call {@link Wunderbaum.setColumn}. */ - colIdx?: number; + /** Also call {@link Wunderbaum.setColumn()}. */ + colIdx?: number | string; + /** + * Focus embedded input control of the grid cell if any (requires colIdx >= 0). + * If colIdx is 0 or '*', the node title is put into edit mode. + * Implies `focusTree: true`, requires `colIdx`. + */ + edit?: boolean; + } + /** Possible values for {@link WunderbaumNode.setColumn()} `options` argument. */ + export interface SetColumnOptions { + /** + * Focus embedded input control of the grid cell if any . + * If colIdx is 0 or '*', the node title is put into edit mode. + * @default false + */ + edit?: boolean; + /** Horizontically scroll into view. @default: true */ + scrollIntoView?: boolean; } - /** Possible values for {@link WunderbaumNode.setExpanded()} `options` argument. */ + /** Possible values for {@link WunderbaumNode.setExpanded} `options` argument. */ export interface SetExpandedOptions { /** Ignore {@link WunderbaumOptions.minExpandLevel}. @default false */ force?: boolean; @@ -1740,46 +1961,63 @@ declare module "types" { * Grayout unmatched nodes (pass "hide" to remove unmatched node instead) * @default 'dim' */ - mode?: "dim" | "hide"; + mode?: FilterModeType; /** - * Display a 'no data' status node if result is empty + * Display a 'no data' status node if result is empty (hide-mode only). + * Pass false to simply show an empy pane, or pass a string to customize the message. * @default true */ - noData?: boolean; + noData?: boolean | string; }; + /** + * Note:
+ * This options are used for renaming node titles.
+ * There is also the `tree.change` event to handle modifying node data from + * input controls that are embedded in grid cells. + */ export type EditOptionsType = { /** + * Used to debounce the `change` event handler for grid cells [ms]. * @default 100 */ debounce?: number; /** + * Minimum number of characters required for node title input field. * @default 1 */ minlength?: number; /** + * Maximum number of characters allowed for node title input field. * @default null; */ maxlength?: null | number; /** - * ["clickActive", "F2", "macEnter"], + * Array of strings to determine which user input should trigger edit mode. + * E.g. `["clickActive", "F2", "macEnter"]`:
+ * 'clickActive': single click on active node title
+ * 'F2': press F2 key
+ * 'macEnter': press Enter (on macOS only)
+ * Pass an empty array to disable edit mode. * @default [] */ trigger?: string[]; /** + * Trim whitespace before saving a node title. * @default true */ trim?: boolean; /** + * Select all text of a node title, so it can be overwritten by typing. * @default true */ select?: boolean; /** - * Handle 'clickActive' only if last click is less than this old (0: always) + * Handle 'clickActive' only if last click is less than this ms old (0: always) * @default 1000 */ slowClickDelay?: number; /** - * Please enter a title", + * Permanently apply node title input validations (CSS and tooltip) on keydown. * @default true */ validity?: boolean; @@ -1975,140 +2213,6 @@ declare module "wb_extension_base" { onRender(data: any): boolean | undefined; } } -declare module "debounce" { - /*! - * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 - * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE - * Modified for TypeScript type annotations. - */ - type Procedure = (...args: any[]) => any; - type DebounceOptions = { - leading?: boolean; - maxWait?: number; - trailing?: boolean; - }; - type ThrottleOptions = { - leading?: boolean; - trailing?: boolean; - }; - export interface DebouncedFunction { - (this: ThisParameterType, ...args: Parameters): ReturnType; - cancel: () => void; - flush: () => any; - pending: () => boolean; - } - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked, or until the next browser frame is drawn. The debounced function - * comes with a `cancel` method to cancel delayed `func` invocations and a - * `flush` method to immediately invoke them. Provide `options` to indicate - * whether `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. The `func` is invoked with the last arguments provided to the - * debounced function. Subsequent calls to the debounced function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until the next tick, similar to `setTimeout` with a timeout of `0`. - * - * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` - * invocation will be deferred until the next frame is drawn (typically about - * 16ms). - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `debounce` and `throttle`. - * - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] - * The number of milliseconds to delay; if omitted, `requestAnimationFrame` is - * used (if available). - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', debounce(calculateLayout, 150)) - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })) - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 }) - * const source = new EventSource('/stream') - * jQuery(source).on('message', debounced) - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel) - * - * // Check for pending invocations. - * const status = debounced.pending() ? "Pending..." : "Ready" - */ - export function debounce(func: F, wait?: number, options?: DebounceOptions): DebouncedFunction; - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds (or once per browser frame). The throttled function - * comes with a `cancel` method to cancel delayed `func` invocations and a - * `flush` method to immediately invoke them. Provide `options` to indicate - * whether `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until the next tick, similar to `setTimeout` with a timeout of `0`. - * - * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` - * invocation will be deferred until the next frame is drawn (typically about - * 16ms). - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `throttle` and `debounce`. - * - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] - * The number of milliseconds to throttle invocations to; if omitted, - * `requestAnimationFrame` is used (if available). - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', throttle(updatePosition, 100)) - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * const throttled = throttle(renewToken, 300000, { 'trailing': false }) - * jQuery(element).on('click', throttled) - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel) - */ - export function throttle(func: F, wait?: number, options?: ThrottleOptions): DebouncedFunction; -} declare module "wb_ext_filter" { import { FilterNodesOptions, FilterOptionsType, NodeFilterCallback } from "types"; import { Wunderbaum } from "wunderbaum"; @@ -2299,7 +2403,7 @@ declare module "wb_ext_edit" { protected curEditNode: WunderbaumNode | null; protected relatedNode: WunderbaumNode | null; constructor(tree: Wunderbaum); - protected _applyChange(eventName: string, node: WunderbaumNode, colElem: HTMLElement, extra: any): Promise; + protected _applyChange(eventName: string, node: WunderbaumNode, colElem: HTMLElement, inputElem: HTMLInputElement, extra: any): Promise; protected _onChange(e: Event): void; init(): void; _preprocessKeyEvent(data: any): boolean | undefined; @@ -2335,13 +2439,14 @@ declare module "wunderbaum" { */ import * as util from "util"; import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base"; - import { ApplyCommandType, ChangeType, ColumnDefinitionList, ExpandAllOptions, FilterModeType, MatcherCallback, NavModeEnum, NodeStatusType, NodeStringCallback, NodeTypeDefinitionMap, ScrollToOptions, SetActiveOptions, UpdateOptions, SetStatusOptions, WbEventInfo, ApplyCommandOptions, AddChildrenOptions, VisitRowsOptions, NodeFilterCallback, FilterNodesOptions, RenderFlag, NodeVisitCallback, SortCallback, NodeToDictCallback, WbNodeData, DynamicCheckboxOption, SourceType, DynamicIconOption, DynamicStringOption, DynamicBoolOption } from "types"; + import { ApplyCommandType, ChangeType, ColumnDefinitionList, ExpandAllOptions, FilterModeType, MatcherCallback, NavModeEnum, NodeStatusType, NodeStringCallback, NodeTypeDefinitionMap, ScrollToOptions, SetActiveOptions, UpdateOptions, SetStatusOptions, WbEventInfo, ApplyCommandOptions, AddChildrenOptions, VisitRowsOptions, NodeFilterCallback, FilterNodesOptions, RenderFlag, NodeVisitCallback, SortCallback, NodeToDictCallback, WbNodeData, DynamicCheckboxOption, SourceType, DynamicIconOption, DynamicStringOption, DynamicBoolOption, SetColumnOptions } from "types"; import { WunderbaumNode } from "wb_node"; import { WunderbaumOptions } from "wb_options"; + import { DebouncedFunction } from "debounce"; /** * A persistent plain object or array. * - * See also [[WunderbaumOptions]]. + * See also {@link WunderbaumOptions}. */ export class Wunderbaum { protected static sequence: number; @@ -2364,7 +2469,7 @@ declare module "wunderbaum" { readonly data: { [key: string]: any; }; - protected readonly _updateViewportThrottled: (...args: any) => void; + protected readonly _updateViewportThrottled: DebouncedFunction<() => void>; protected extensionList: WunderbaumExtension[]; protected extensions: ExtensionsDict; /** Merged options from constructor args and tree- and extension defaults. */ @@ -2399,7 +2504,7 @@ declare module "wunderbaum" { /** Expose some useful methods of the util.ts module as `tree._util`. */ _util: typeof util; filterMode: FilterModeType; - /** @internal Use `setColumn()`/`getActiveColElem()`*/ + /** @internal Use `setColumn()`/`getActiveColElem()` to access. */ activeColIdx: number; /** @internal */ _cellNavMode: boolean; @@ -2417,7 +2522,7 @@ declare module "wunderbaum" { * getTree(1); // Get second Wunderbaum instance on page * getTree(event); // Get tree for this mouse- or keyboard event * getTree("foo"); // Get tree for this `tree.options.id` - * getTree("#tree"); // Get tree for this matching element + * getTree("#tree"); // Get tree for first matching element selector * ``` */ static getTree(el?: Element | Event | number | string | WunderbaumNode): Wunderbaum | null; @@ -2559,20 +2664,32 @@ declare module "wunderbaum" { /** * Find all nodes that match condition. * + * @param match title string to search for, or a + * callback function that returns `true` if a node is matched. * @see {@link WunderbaumNode.findAll} */ findAll(match: string | RegExp | MatcherCallback): WunderbaumNode[]; + /** + * Find all nodes with a given _refKey_ (aka a list of clones). + * + * @param refKey a `node.refKey` value to search for. + * @returns an array of matching nodes with at least two element or `[]` + * if nothing found. + * + * @see {@link WunderbaumNode.getCloneList} + */ + findByRefKey(refKey: string): WunderbaumNode[]; /** * Find first node that matches condition. * + * @param match title string to search for, or a + * callback function that returns `true` if a node is matched. * @see {@link WunderbaumNode.findFirst} */ findFirst(match: string | RegExp | MatcherCallback): WunderbaumNode; /** * Find first node that matches condition. * - * @param match title string to search for, or a - * callback function that returns `true` if a node is matched. * @see {@link WunderbaumNode.findFirst} * */ @@ -2580,6 +2697,7 @@ declare module "wunderbaum" { /** * Find the next visible node that starts with `match`, starting at `startNode` * and wrap-around at the end. + * Used by quicksearch and keyboard navigation. */ findNextNode(match: string | MatcherCallback, startNode?: WunderbaumNode | null): WunderbaumNode | null; /** @@ -2623,6 +2741,9 @@ declare module "wunderbaum" { getActiveColElem(): HTMLSpanElement; /** * Return the currently active node or null. + * @see {@link WunderbaumNode.setActive} + * @see {@link WunderbaumNode.isActive} + * @see {@link WunderbaumNode.getFocusNode} */ getActiveNode(): WunderbaumNode; /** @@ -2630,7 +2751,8 @@ declare module "wunderbaum" { */ getFirstChild(): WunderbaumNode; /** - * Return the currently active node or null. + * Return the node that currently has keyboard focus or null. + * @see {@link WunderbaumNode.getActiveNode} */ getFocusNode(): WunderbaumNode; /** Return a {node: WunderbaumNode, region: TYPE} object for a mouse event. @@ -2645,8 +2767,16 @@ declare module "wunderbaum" { * @internal */ toString(): string; - /** Return true if any node is currently in edit-title mode. */ + /** Return true if any node title or grid cell is currently beeing edited. + * + * See also {@link Wunderbaum.isEditingTitle}. + */ isEditing(): boolean; + /** Return true if any node is currently in edit-title mode. + * + * See also {@link WunderbaumNode.isEditingTitle} and {@link Wunderbaum.isEditing}. + */ + isEditingTitle(): boolean; /** * Return true if any node is currently beeing loaded, i.e. a Ajax request is pending. */ @@ -2682,18 +2812,23 @@ declare module "wunderbaum" { /** * Set column #colIdx to 'active'. * - * This higlights the column header and -cells by adding the `wb-active` class. + * This higlights the column header and -cells by adding the `wb-active` + * class to all grid cells of the active column.
* Available in cell-nav mode only. + * + * If _options.edit_ is true, the embedded input element is focused, or if + * colIdx is 0, the node title is put into edit mode. */ - setColumn(colIdx: number): void; - /** Set or remove keybaord focus to the tree container. */ + setColumn(colIdx: number | string, options?: SetColumnOptions): void; + /** Set or remove keyboard focus to the tree container. */ setActiveNode(key: string, flag?: boolean, options?: SetActiveOptions): void; - /** Set or remove keybaord focus to the tree container. */ + /** Set or remove keyboard focus to the tree container. */ setFocus(flag?: boolean): void; /** * Schedule an update request to reflect a tree change. * The render operation is async and debounced unless the `immediate` option * is set. + * * Use {@link WunderbaumNode.update()} if only a single node has changed, * or {@link WunderbaumNode._render()}) to pass special options. */ @@ -2820,29 +2955,23 @@ declare module "wunderbaum" { */ enableUpdate(flag: boolean): void; /** - * [ext-filter] Dim or hide nodes. + * Dim or hide nodes. */ filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions): void; /** - * [ext-filter] Dim or hide whole branches. + * Dim or hide whole branches. */ filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): void; /** - * [ext-filter] Reset the filter. - * - * @requires [[FilterExtension]] + * Reset the filter. */ clearFilter(): void; /** - * [ext-filter] Return true if a filter is currently applied. - * - * @requires [[FilterExtension]] + * Return true if a filter is currently applied. */ isFilterActive(): boolean; /** - * [ext-filter] Re-apply current filter. - * - * @requires [[FilterExtension]] + * Re-apply current filter. */ updateFilter(): void; } diff --git a/dist/wunderbaum.esm.js b/dist/wunderbaum.esm.js index fa92e8a9..fa29926f 100644 --- a/dist/wunderbaum.esm.js +++ b/dist/wunderbaum.esm.js @@ -1,7 +1,304 @@ +/*! + * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 + * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE + * Modified for TypeScript type annotations. + */ +/* --- */ +/** Detect free variable `global` from Node.js. */ +const freeGlobal = typeof global === "object" && + global !== null && + global.Object === Object && + global; +/** Detect free variable `globalThis` */ +const freeGlobalThis = typeof globalThis === "object" && + globalThis !== null && + globalThis.Object == Object && + globalThis; +/** Detect free variable `self`. */ +const freeSelf = typeof self === "object" && self !== null && self.Object === Object && self; +/** Used as a reference to the global object. */ +const root = freeGlobalThis || freeGlobal || freeSelf || Function("return this")(); +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * isObject({}) + * // => true + * + * isObject([1, 2, 3]) + * // => true + * + * isObject(Function) + * // => true + * + * isObject(null) + * // => false + */ +function isObject(value) { + const type = typeof value; + return value != null && (type === "object" || type === "function"); +} +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked, or until the next browser frame is drawn. The debounced function + * comes with a `cancel` method to cancel delayed `func` invocations and a + * `flush` method to immediately invoke them. Provide `options` to indicate + * whether `func` should be invoked on the leading and/or trailing edge of the + * `wait` timeout. The `func` is invoked with the last arguments provided to the + * debounced function. Subsequent calls to the debounced function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until the next tick, similar to `setTimeout` with a timeout of `0`. + * + * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` + * invocation will be deferred until the next frame is drawn (typically about + * 16ms). + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `debounce` and `throttle`. + * + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] + * The number of milliseconds to delay; if omitted, `requestAnimationFrame` is + * used (if available). + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', debounce(calculateLayout, 150)) + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })) + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 }) + * const source = new EventSource('/stream') + * jQuery(source).on('message', debounced) + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel) + * + * // Check for pending invocations. + * const status = debounced.pending() ? "Pending..." : "Ready" + */ +function debounce(func, wait = 0, options = {}) { + let lastArgs, lastThis, maxWait, result, timerId, lastCallTime; + let lastInvokeTime = 0; + let leading = false; + let maxing = false; + let trailing = true; + // Bypass `requestAnimationFrame` by explicitly setting `wait=0`. + const useRAF = !wait && wait !== 0 && typeof root.requestAnimationFrame === "function"; + if (typeof func !== "function") { + throw new TypeError("Expected a function"); + } + wait = +wait || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = "maxWait" in options; + maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : maxWait; + trailing = "trailing" in options ? !!options.trailing : trailing; + } + function invokeFunc(time) { + const args = lastArgs; + const thisArg = lastThis; + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + function startTimer(pendingFunc, wait) { + if (useRAF) { + root.cancelAnimationFrame(timerId); + return root.requestAnimationFrame(pendingFunc); + } + return setTimeout(pendingFunc, wait); + } + function cancelTimer(id) { + if (useRAF) { + return root.cancelAnimationFrame(id); + } + clearTimeout(id); + } + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = startTimer(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + function remainingWait(time) { + const timeSinceLastCall = time - lastCallTime; + const timeSinceLastInvoke = time - lastInvokeTime; + const timeWaiting = wait - timeSinceLastCall; + return maxing + ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + function shouldInvoke(time) { + const timeSinceLastCall = time - lastCallTime; + const timeSinceLastInvoke = time - lastInvokeTime; + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || + timeSinceLastCall >= wait || + timeSinceLastCall < 0 || + (maxing && timeSinceLastInvoke >= maxWait)); + } + function timerExpired() { + const time = Date.now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = startTimer(timerExpired, remainingWait(time)); + } + function trailingEdge(time) { + timerId = undefined; + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + function cancel() { + if (timerId !== undefined) { + cancelTimer(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + function flush() { + return timerId === undefined ? result : trailingEdge(Date.now()); + } + function pending() { + return timerId !== undefined; + } + function debounced(...args) { + const time = Date.now(); + const isInvoking = shouldInvoke(time); + lastArgs = args; + // eslint-disable-next-line @typescript-eslint/no-this-alias + lastThis = this; + lastCallTime = time; + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = startTimer(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = startTimer(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + debounced.pending = pending; + return debounced; +} +/** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds (or once per browser frame). The throttled function + * comes with a `cancel` method to cancel delayed `func` invocations and a + * `flush` method to immediately invoke them. Provide `options` to indicate + * whether `func` should be invoked on the leading and/or trailing edge of the + * `wait` timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until the next tick, similar to `setTimeout` with a timeout of `0`. + * + * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` + * invocation will be deferred until the next frame is drawn (typically about + * 16ms). + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `throttle` and `debounce`. + * + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] + * The number of milliseconds to throttle invocations to; if omitted, + * `requestAnimationFrame` is used (if available). + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', throttle(updatePosition, 100)) + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * const throttled = throttle(renewToken, 300000, { 'trailing': false }) + * jQuery(element).on('click', throttled) + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel) + */ +function throttle(func, wait = 0, options = {}) { + let leading = true; + let trailing = true; + if (typeof func !== "function") { + throw new TypeError("Expected a function"); + } + if (isObject(options)) { + leading = "leading" in options ? !!options.leading : leading; + trailing = "trailing" in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + leading, + trailing, + maxWait: wait, + }); +} + /*! * Wunderbaum - util * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ /** @module util */ /** Readable names for `MouseEvent.button` */ @@ -27,8 +324,21 @@ const ENTITY_MAP = { "'": "'", "/": "/", }; +/** A generic error that can be thrown to indicate a validation error when + * handling the `apply` event for a node title or the `change` event for a + * grid cell. + */ +class ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + } +} /** * A ES6 Promise, that exposes the resolve()/reject() methods. + * + * TODO: See [Promise.withResolvers()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers#description) + * , a proposed standard, but not yet implemented in any browser. */ let Deferred$1 = class Deferred { constructor() { @@ -360,27 +670,29 @@ function elemFromHtml(html) { t.innerHTML = html.trim(); return t.content.firstElementChild; } -const _IGNORE_KEYS = new Set(["Alt", "Control", "Meta", "Shift"]); -/** Return a HtmlElement from selector or cast an existing element. */ -function elemFromSelector(obj) { - if (!obj) { - return null; //(null as unknown) as HTMLElement; - } - if (typeof obj === "string") { - return document.querySelector(obj); - } - return obj; -} -/** Return a EventTarget from selector or cast an existing element. */ -function eventTargetFromSelector(obj) { +const _IGNORE_KEYS = new Set(["Alt", "Control", "Meta", "Shift"]); +/** Return a HtmlElement from selector or cast an existing element. */ +function elemFromSelector(obj) { if (!obj) { - return null; + return null; //(null as unknown) as HTMLElement; } if (typeof obj === "string") { return document.querySelector(obj); } return obj; } +// /** Return a EventTarget from selector or cast an existing element. */ +// export function eventTargetFromSelector( +// obj: string | EventTarget +// ): EventTarget | null { +// if (!obj) { +// return null; +// } +// if (typeof obj === "string") { +// return document.querySelector(obj) as EventTarget; +// } +// return obj as EventTarget; +// } /** * Return a canonical descriptive string for a keyboard or mouse event. * @@ -478,7 +790,8 @@ function isPlainObject(obj) { function noop(...args) { } function onEvent(rootTarget, eventNames, selectorOrHandler, handlerOrNone) { let selector, handler; - rootTarget = eventTargetFromSelector(rootTarget); + rootTarget = elemFromSelector(rootTarget); + // rootTarget = eventTargetFromSelector(rootTarget)!; if (handlerOrNone) { selector = selectorOrHandler; handler = handlerOrNone; @@ -669,8 +982,6 @@ function type(obj) { * ``` */ function adaptiveThrottle(callback, options) { - let waiting = 0; // Initially, we're not waiting - let pendingArgs = null; const opts = Object.assign({ minDelay: 16, defaultDelay: 200, @@ -679,6 +990,9 @@ function adaptiveThrottle(callback, options) { }, options); const minDelay = Math.max(16, +opts.minDelay); const maxDelay = +opts.maxDelay; + let waiting = 0; // Initially, we're not waiting + let pendingArgs = null; + let pendingTimer = null; const throttledFn = (...args) => { if (waiting) { pendingArgs = args; @@ -705,9 +1019,10 @@ function adaptiveThrottle(callback, options) { // `adaptiveThrottle() calling worker took ${elap}ms. delay = ${curDelay}ms, using ${useDelay}ms`, // pendingArgs // ); - setTimeout(() => { + pendingTimer = setTimeout(() => { // Unblock, and trigger pending requests if any // const skipped = waiting - 1; + pendingTimer = null; waiting = 0; // And allow future invocations if (pendingArgs != null) { // There was another request while running or waiting @@ -720,52 +1035,68 @@ function adaptiveThrottle(callback, options) { }, useDelay); } }; + throttledFn.cancel = () => { + if (pendingTimer) { + clearTimeout(pendingTimer); + pendingTimer = null; + } + pendingArgs = null; + waiting = 0; + }; + throttledFn.pending = () => { + return !!pendingTimer; + }; + throttledFn.flush = () => { + throw new Error("Not implemented"); + }; return throttledFn; } var util = /*#__PURE__*/Object.freeze({ - __proto__: null, - Deferred: Deferred$1, - MAX_INT: MAX_INT, - MOUSE_BUTTONS: MOUSE_BUTTONS, - adaptiveThrottle: adaptiveThrottle, - assert: assert, - documentReady: documentReady, - documentReadyPromise: documentReadyPromise, - each: each, - elemFromHtml: elemFromHtml, - elemFromSelector: elemFromSelector, - error: error, - escapeHtml: escapeHtml, - escapeRegex: escapeRegex, - escapeTooltip: escapeTooltip, - eventTargetFromSelector: eventTargetFromSelector, - eventToString: eventToString, - extend: extend, - extractHtmlText: extractHtmlText, - getOption: getOption, - getValueFromElem: getValueFromElem, - isArray: isArray, - isEmptyObject: isEmptyObject, - isFunction: isFunction, - isMac: isMac, - isPlainObject: isPlainObject, - noop: noop, - onEvent: onEvent, - overrideMethod: overrideMethod, - setElemDisplay: setElemDisplay, - setTimeoutPromise: setTimeoutPromise, - setValueToElem: setValueToElem, - sleep: sleep, - toSet: toSet, - toggleCheckbox: toggleCheckbox, - type: type + __proto__: null, + Deferred: Deferred$1, + MAX_INT: MAX_INT, + MOUSE_BUTTONS: MOUSE_BUTTONS, + ValidationError: ValidationError, + adaptiveThrottle: adaptiveThrottle, + assert: assert, + debounce: debounce, + documentReady: documentReady, + documentReadyPromise: documentReadyPromise, + each: each, + elemFromHtml: elemFromHtml, + elemFromSelector: elemFromSelector, + error: error, + escapeHtml: escapeHtml, + escapeRegex: escapeRegex, + escapeTooltip: escapeTooltip, + eventToString: eventToString, + extend: extend, + extractHtmlText: extractHtmlText, + getOption: getOption, + getValueFromElem: getValueFromElem, + isArray: isArray, + isEmptyObject: isEmptyObject, + isFunction: isFunction, + isMac: isMac, + isPlainObject: isPlainObject, + noop: noop, + onEvent: onEvent, + overrideMethod: overrideMethod, + setElemDisplay: setElemDisplay, + setTimeoutPromise: setTimeoutPromise, + setValueToElem: setValueToElem, + sleep: sleep, + throttle: throttle, + toSet: toSet, + toggleCheckbox: toggleCheckbox, + type: type }); /*! * Wunderbaum - types * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ /** * Possible values for {@link WunderbaumNode.update()} and {@link Wunderbaum.update()}. @@ -829,363 +1160,66 @@ var NavModeEnum; /*! * Wunderbaum - wb_extension_base * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ class WunderbaumExtension { constructor(tree, id, defaults) { this.enabled = true; - this.tree = tree; - this.id = id; - this.treeOpts = tree.options; - const opts = tree.options; - if (this.treeOpts[id] === undefined) { - opts[id] = this.extensionOpts = extend({}, defaults); - } - else { - // TODO: do we break existing object instance references here? - this.extensionOpts = extend({}, defaults, opts[id]); - opts[id] = this.extensionOpts; - } - this.enabled = this.getPluginOption("enabled", true); - } - /** Called on tree (re)init after all extensions are added, but before loading.*/ - init() { - this.tree.element.classList.add("wb-ext-" + this.id); - } - // protected callEvent(type: string, extra?: any): any { - // let func = this.extensionOpts[type]; - // if (func) { - // return func.call( - // this.tree, - // util.extend( - // { - // event: this.id + "." + type, - // }, - // extra - // ) - // ); - // } - // } - getPluginOption(name, defaultValue) { - var _a; - return (_a = this.extensionOpts[name]) !== null && _a !== void 0 ? _a : defaultValue; - } - setPluginOption(name, value) { - this.extensionOpts[name] = value; - } - setEnabled(flag = true) { - return this.setPluginOption("enabled", !!flag); - // this.enabled = !!flag; - } - onKeyEvent(data) { - return; - } - onRender(data) { - return; - } -} - -/*! - * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 - * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE - * Modified for TypeScript type annotations. - */ -/* --- */ -/** Detect free variable `global` from Node.js. */ -const freeGlobal = typeof global === "object" && - global !== null && - global.Object === Object && - global; -/** Detect free variable `globalThis` */ -const freeGlobalThis = typeof globalThis === "object" && - globalThis !== null && - globalThis.Object == Object && - globalThis; -/** Detect free variable `self`. */ -const freeSelf = typeof self === "object" && self !== null && self.Object === Object && self; -/** Used as a reference to the global object. */ -const root = freeGlobalThis || freeGlobal || freeSelf || Function("return this")(); -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * isObject({}) - * // => true - * - * isObject([1, 2, 3]) - * // => true - * - * isObject(Function) - * // => true - * - * isObject(null) - * // => false - */ -function isObject(value) { - const type = typeof value; - return value != null && (type === "object" || type === "function"); -} -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked, or until the next browser frame is drawn. The debounced function - * comes with a `cancel` method to cancel delayed `func` invocations and a - * `flush` method to immediately invoke them. Provide `options` to indicate - * whether `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. The `func` is invoked with the last arguments provided to the - * debounced function. Subsequent calls to the debounced function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until the next tick, similar to `setTimeout` with a timeout of `0`. - * - * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` - * invocation will be deferred until the next frame is drawn (typically about - * 16ms). - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `debounce` and `throttle`. - * - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] - * The number of milliseconds to delay; if omitted, `requestAnimationFrame` is - * used (if available). - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', debounce(calculateLayout, 150)) - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })) - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 }) - * const source = new EventSource('/stream') - * jQuery(source).on('message', debounced) - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel) - * - * // Check for pending invocations. - * const status = debounced.pending() ? "Pending..." : "Ready" - */ -function debounce(func, wait = 0, options = {}) { - let lastArgs, lastThis, maxWait, result, timerId, lastCallTime; - let lastInvokeTime = 0; - let leading = false; - let maxing = false; - let trailing = true; - // Bypass `requestAnimationFrame` by explicitly setting `wait=0`. - const useRAF = !wait && wait !== 0 && typeof root.requestAnimationFrame === "function"; - if (typeof func !== "function") { - throw new TypeError("Expected a function"); - } - wait = +wait || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = "maxWait" in options; - maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : maxWait; - trailing = "trailing" in options ? !!options.trailing : trailing; - } - function invokeFunc(time) { - const args = lastArgs; - const thisArg = lastThis; - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - function startTimer(pendingFunc, wait) { - if (useRAF) { - root.cancelAnimationFrame(timerId); - return root.requestAnimationFrame(pendingFunc); - } - return setTimeout(pendingFunc, wait); - } - function cancelTimer(id) { - if (useRAF) { - return root.cancelAnimationFrame(id); - } - clearTimeout(id); - } - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = startTimer(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - function remainingWait(time) { - const timeSinceLastCall = time - lastCallTime; - const timeSinceLastInvoke = time - lastInvokeTime; - const timeWaiting = wait - timeSinceLastCall; - return maxing - ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - function shouldInvoke(time) { - const timeSinceLastCall = time - lastCallTime; - const timeSinceLastInvoke = time - lastInvokeTime; - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || - timeSinceLastCall >= wait || - timeSinceLastCall < 0 || - (maxing && timeSinceLastInvoke >= maxWait)); - } - function timerExpired() { - const time = Date.now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = startTimer(timerExpired, remainingWait(time)); - } - function trailingEdge(time) { - timerId = undefined; - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); + this.tree = tree; + this.id = id; + this.treeOpts = tree.options; + const opts = tree.options; + if (this.treeOpts[id] === undefined) { + opts[id] = this.extensionOpts = extend({}, defaults); } - lastArgs = lastThis = undefined; - return result; - } - function cancel() { - if (timerId !== undefined) { - cancelTimer(timerId); + else { + // TODO: do we break existing object instance references here? + this.extensionOpts = extend({}, defaults, opts[id]); + opts[id] = this.extensionOpts; } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; + this.enabled = this.getPluginOption("enabled", true); } - function flush() { - return timerId === undefined ? result : trailingEdge(Date.now()); + /** Called on tree (re)init after all extensions are added, but before loading.*/ + init() { + this.tree.element.classList.add("wb-ext-" + this.id); } - function pending() { - return timerId !== undefined; + // protected callEvent(type: string, extra?: any): any { + // let func = this.extensionOpts[type]; + // if (func) { + // return func.call( + // this.tree, + // util.extend( + // { + // event: this.id + "." + type, + // }, + // extra + // ) + // ); + // } + // } + getPluginOption(name, defaultValue) { + var _a; + return (_a = this.extensionOpts[name]) !== null && _a !== void 0 ? _a : defaultValue; } - function debounced(...args) { - const time = Date.now(); - const isInvoking = shouldInvoke(time); - lastArgs = args; - // eslint-disable-next-line @typescript-eslint/no-this-alias - lastThis = this; - lastCallTime = time; - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = startTimer(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = startTimer(timerExpired, wait); - } - return result; + setPluginOption(name, value) { + this.extensionOpts[name] = value; } - debounced.cancel = cancel; - debounced.flush = flush; - debounced.pending = pending; - return debounced; -} -/** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds (or once per browser frame). The throttled function - * comes with a `cancel` method to cancel delayed `func` invocations and a - * `flush` method to immediately invoke them. Provide `options` to indicate - * whether `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until the next tick, similar to `setTimeout` with a timeout of `0`. - * - * If `wait` is omitted in an environment with `requestAnimationFrame`, `func` - * invocation will be deferred until the next frame is drawn (typically about - * 16ms). - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `throttle` and `debounce`. - * - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] - * The number of milliseconds to throttle invocations to; if omitted, - * `requestAnimationFrame` is used (if available). - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', throttle(updatePosition, 100)) - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * const throttled = throttle(renewToken, 300000, { 'trailing': false }) - * jQuery(element).on('click', throttled) - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel) - */ -function throttle(func, wait = 0, options = {}) { - let leading = true; - let trailing = true; - if (typeof func !== "function") { - throw new TypeError("Expected a function"); + setEnabled(flag = true) { + return this.setPluginOption("enabled", !!flag); + // this.enabled = !!flag; } - if (isObject(options)) { - leading = "leading" in options ? !!options.leading : leading; - trailing = "trailing" in options ? !!options.trailing : trailing; + onKeyEvent(data) { + return; + } + onRender(data) { + return; } - return debounce(func, wait, { - leading, - trailing, - maxWait: wait, - }); } /*! * Wunderbaum - ext-filter * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ const START_MARKER = "\uFFF7"; const END_MARKER = "\uFFF8"; @@ -1367,7 +1401,12 @@ class FilterExtension extends WunderbaumExtension { }); treeOpts.autoCollapse = prevAutoCollapse; if (count === 0 && opts.noData && hideMode) { - tree.root.setStatus(NodeStatusType.noData); + if (typeof opts.noData === "string") { + tree.root.setStatus(NodeStatusType.noData, { message: opts.noData }); + } + else { + tree.root.setStatus(NodeStatusType.noData); + } } // Redraw whole tree tree.logInfo(`Filter '${match}' found ${count} nodes in ${Date.now() - start} ms.`); @@ -1485,7 +1524,7 @@ function _markFuzzyMatchedChars(text, matches, escapeTitles = true) { /*! * Wunderbaum - ext-keynav * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ const QUICKSEARCH_DELAY = 500; class KeynavExtension extends WunderbaumExtension { @@ -1507,6 +1546,13 @@ class KeynavExtension extends WunderbaumExtension { } return input; } + // /* Return the current cell's embedded input that has keyboard focus. */ + // protected _getFocusedInputElem(): HTMLInputElement | null { + // const ace = this.tree + // .getActiveColElem() + // ?.querySelector("input:focus,select:focus"); + // return ace || null; + // } /* Return true if the current cell's embedded input has keyboard focus. */ _isCurInputFocused() { var _a; @@ -1522,7 +1568,6 @@ class KeynavExtension extends WunderbaumExtension { const curInput = this._getEmbeddedInputElem(event.target); const inputHasFocus = curInput && this._isCurInputFocused(); const navModeOption = opts.navigationModeOption; - // isCellEditMode = tree.navMode === NavigationMode.cellEdit; let focusNode, eventName = eventToString(event), node = data.node, handled = true; // tree.log(`onKeyEvent: ${eventName}, curInput`, curInput); if (!tree.isEnabled()) { @@ -1667,22 +1712,34 @@ class KeynavExtension extends WunderbaumExtension { } } else { - const curInput = this._getEmbeddedInputElem(null); + // ----------------------------------------------------------------------- + // --- Cell Mode --- + // ----------------------------------------------------------------------- + // // Standard navigation (cell mode) + // if (isCellEditMode && INPUT_BREAKOUT_KEYS.has(eventName)) { + // } + // const curInput = this._getEmbeddedInputElem(null); const curInputType = curInput ? curInput.type || curInput.tagName : ""; - const inputHasFocus = curInput && this._isCurInputFocused(); + // const inputHasFocus = curInput && this._isCurInputFocused(); const inputCanFocus = curInput && curInputType !== "checkbox"; if (inputHasFocus) { if (eventName === "Escape") { - // Discard changes + node.logDebug(`Reset focused input on Escape`); + // Discard changes and reset input validation state + curInput.setCustomValidity(""); node._render(); // Keep cell-nav mode - node.logDebug(`Reset focused input`); tree.setFocus(); tree.setColumn(tree.activeColIdx); return; // } else if (!INPUT_BREAKOUT_KEYS.has(eventName)) { } else if (eventName !== "Enter") { + if (curInput && curInput.checkValidity && !curInput.checkValidity()) { + // Invalid input: ignore all keys except Enter and Escape + node.logDebug(`Ignored ${eventName} inside invalid input`); + return false; + } // Let current `` handle it node.logDebug(`Ignored ${eventName} inside focused input`); return; @@ -1697,9 +1754,10 @@ class KeynavExtension extends WunderbaumExtension { else if (curInput) { // On a cell that has an embedded, unfocused if (eventName.length === 1 && inputCanFocus) { + // Typing a single char curInput.focus(); curInput.value = ""; - node.logDebug(`Focus imput: ${eventName}`); + node.logDebug(`Focus input: ${eventName}`); return false; } } @@ -1711,7 +1769,6 @@ class KeynavExtension extends WunderbaumExtension { eventName = tree.activeColIdx > 0 ? "ArrowLeft" : ""; handled = true; } - else ; switch (eventName) { case "+": case "Add": @@ -1831,7 +1888,7 @@ class KeynavExtension extends WunderbaumExtension { /*! * Wunderbaum - ext-logger * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ class LoggerExtension extends WunderbaumExtension { constructor(tree) { @@ -1873,7 +1930,7 @@ class LoggerExtension extends WunderbaumExtension { /*! * Wunderbaum - common * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script /** @@ -1992,7 +2049,7 @@ const KEY_TO_ACTION_DICT = { }; /** Return a callback that returns true if the node title matches the string * or regular expression. - * @see {@link WunderbaumNode.findAll} + * @see {@link WunderbaumNode.findAll()} */ function makeNodeTitleMatcher(match) { if (match instanceof RegExp) { @@ -2196,7 +2253,7 @@ function decompressSourceData(source) { /*! * Wunderbaum - ext-dnd * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ const nodeMimeType = "application/x-wunderbaum-node"; class DndExtension extends WunderbaumExtension { @@ -2445,7 +2502,7 @@ class DndExtension extends WunderbaumExtension { if (e.type === "dragstart") { // Set a default definition of allowed effects e.dataTransfer.effectAllowed = dndOpts.effectAllowed; //"copyMove"; // "all"; - if (srcNode.isEditing()) { + if (srcNode.isEditingTitle()) { srcNode.logDebug("Prevented dragging node in edit mode."); e.preventDefault(); return false; @@ -2627,7 +2684,7 @@ class DndExtension extends WunderbaumExtension { /*! * Wunderbaum - drag_observer * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ /** * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'. @@ -2763,7 +2820,7 @@ class DragObserver { /*! * Wunderbaum - ext-grid * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ class GridExtension extends WunderbaumExtension { constructor(tree) { @@ -2800,7 +2857,7 @@ class GridExtension extends WunderbaumExtension { /*! * Wunderbaum - deferred * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ /** * Implement a ES6 Promise, that exposes a resolve() and reject() method. @@ -2824,27 +2881,27 @@ class Deferred { this._reject = reject; }); } - /** Resolve the [[Promise]]. */ + /** Resolve the Promise. */ resolve(value) { this._resolve(value); } - /** Reject the [[Promise]]. */ + /** Reject the Promise. */ reject(reason) { this._reject(reason); } - /** Return the native [[Promise]] instance.*/ + /** Return the native Promise instance.*/ promise() { return this._promise; } - /** Call [[Promise.then]] on the embedded promise instance.*/ + /** Call Promise.then on the embedded promise instance.*/ then(cb) { return this._promise.then(cb); } - /** Call [[Promise.catch]] on the embedded promise instance.*/ + /** Call Promise.catch on the embedded promise instance.*/ catch(cb) { return this._promise.catch(cb); } - /** Call [[Promise.finally]] on the embedded promise instance.*/ + /** Call Promise.finally on the embedded promise instance.*/ finally(cb) { return this._promise.finally(cb); } @@ -2853,7 +2910,7 @@ class Deferred { /*! * Wunderbaum - wunderbaum_node * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ /** WunderbaumNode properties that can be passed with source data. * (Any other source properties will be stored as `node.data.PROP`.) @@ -3154,6 +3211,10 @@ class WunderbaumNode { } } } + /** Start editing this node's title. */ + startEditTitle() { + this.tree._callMethod("edit.startEditTitle", this); + } /** Call `setExpanded()` on all descendant nodes. */ async expandAll(flag = true, options) { const tree = this.tree; @@ -3363,6 +3424,22 @@ class WunderbaumNode { const colElems = (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.querySelectorAll("span.wb-col"); return colElems ? colElems[colIdx] : null; } + /** + * Return all nodes with the same refKey. + * + * @param includeSelf Include this node itself. + * @see {@link Wunderbaum.findByRefKey} + */ + getCloneList(includeSelf = false) { + if (!this.refKey) { + return []; + } + const clones = this.tree.findByRefKey(this.refKey); + if (includeSelf) { + return clones; + } + return [...clones].filter((n) => n !== this); + } /** Return the first child node or null. * @returns {WunderbaumNode | null} */ @@ -3467,17 +3544,22 @@ class WunderbaumNode { return this.tree.activeNode === this; } /** Return true if this node is a direct or indirect parent of `other`. - * (See also [[isParentOf]].) + * @see {@link WunderbaumNode.isParentOf} */ isAncestorOf(other) { return other && other.isDescendantOf(this); } /** Return true if this node is a **direct** subnode of `other`. - * (See also [[isDescendantOf]].) + * @see {@link WunderbaumNode.isDescendantOf} */ isChildOf(other) { return other && this.parent === other; } + /** Return true if this node's refKey is used by at least one other node. + */ + isClone() { + return !!this.refKey && this.tree.findByRefKey(this.refKey).length > 1; + } /** Return true if this node's title spans all columns, i.e. the node has no * grid cells. */ @@ -3485,7 +3567,7 @@ class WunderbaumNode { return !!this.getOption("colspan"); } /** Return true if this node is a direct or indirect subnode of `other`. - * (See also [[isChildOf]].) + * @see {@link WunderbaumNode.isChildOf} */ isDescendantOf(other) { if (!other || other.tree !== this.tree) { @@ -3520,8 +3602,11 @@ class WunderbaumNode { } return true; } - /** Return true if this node is currently in edit-title mode. */ - isEditing() { + /** Return true if _this_ node is currently in edit-title mode. + * + * See {@link Wunderbaum.startEditTitle} to check if any node is currently edited. + */ + isEditingTitle() { return this.tree._callMethod("edit.isEditingTitle", this); } /** Return true if this node is currently expanded. */ @@ -3555,7 +3640,7 @@ class WunderbaumNode { return this.statusNodeType === "paging"; } /** Return true if this node is a **direct** parent of `other`. - * (See also [[isAncestorOf]].) + * @see {@link WunderbaumNode.isAncestorOf} */ isParentOf(other) { return other && other.parent === this; @@ -3577,7 +3662,7 @@ class WunderbaumNode { return !!this._rowElem; } /** Return true if this node is the (invisible) system root node. - * (See also [[isTopLevel()]].) + * @see {@link WunderbaumNode.isTopLevel} */ isRootNode() { return this.tree.root === this; @@ -4456,6 +4541,7 @@ class WunderbaumNode { let i = 0; for (const colSpan of rowDiv.children) { colSpan.classList.toggle("wb-active", i++ === tree.activeColIdx); + colSpan.classList.remove("wb-error", "wb-invalid"); } // Update icon (if not opts.isNew, which would rebuild markup anyway) const iconSpan = nodeElem.querySelector("i.wb-icon"); @@ -4637,16 +4723,21 @@ class WunderbaumNode { return this.tree.scrollTo(opts); } /** - * Activate this node, deactivate previous, send events, activate column and scroll int viewport. + * Activate this node, deactivate previous, send events, activate column and + * scroll into viewport. */ async setActive(flag = true, options) { const tree = this.tree; const prev = tree.activeNode; const retrigger = options === null || options === void 0 ? void 0 : options.retrigger; // Default: false const focusTree = options === null || options === void 0 ? void 0 : options.focusTree; // Default: false - const focusNode = (options === null || options === void 0 ? void 0 : options.focusNode) !== false; // Default: true + // const focusNode = options?.focusNode !== false; // Default: true const noEvents = options === null || options === void 0 ? void 0 : options.noEvents; // Default: false - const orgEvent = options === null || options === void 0 ? void 0 : options.event; // Default: false + const orgEvent = options === null || options === void 0 ? void 0 : options.event; // Default: null + const colIdx = options === null || options === void 0 ? void 0 : options.colIdx; // Default: null + const edit = options === null || options === void 0 ? void 0 : options.edit; // Default: false + assert(!colIdx || tree.isCellNav(), "colIdx requires cellNav"); + assert(!edit || colIdx != null, "edit requires colIdx"); if (!noEvents) { if (flag) { if (prev !== this || retrigger) { @@ -4671,32 +4762,36 @@ class WunderbaumNode { if (prev !== this) { if (flag) { tree.activeNode = this; - if (focusNode || focusTree) { - tree.focusNode = this; - } - if (focusTree) { - tree.setFocus(); - } } prev === null || prev === void 0 ? void 0 : prev.update(ChangeType.status); this.update(ChangeType.status); } - if (options && - options.colIdx != null && - options.colIdx !== tree.activeColIdx && - tree.isCellNav()) { - tree.setColumn(options.colIdx); - } - if (flag && !noEvents) { - this._callEvent("activate", { prevNode: prev, event: orgEvent }); - } - return this.makeVisible(); + return this.makeVisible().then(() => { + if (flag) { + if (focusTree || edit) { + tree.setFocus(); + tree.focusNode = this; + tree.focusNode.setFocus(); + } + // if (focusNode || edit) { + // tree.focusNode = this; + // tree.focusNode.setFocus(); + // } + if (colIdx != null && tree.isCellNav()) { + tree.setColumn(colIdx, { edit: edit }); + } + if (!noEvents) { + this._callEvent("activate", { prevNode: prev, event: orgEvent }); + } + } + }); } /** * Expand or collapse this node. */ async setExpanded(flag = true, options) { const { force, scrollIntoView, immediate } = options !== null && options !== void 0 ? options : {}; + const sendEvents = !(options === null || options === void 0 ? void 0 : options.noEvents); // Default: send events if (!flag && this.isExpanded() && this.getLevel() <= this.tree.getOption("minExpandLevel") && @@ -4707,6 +4802,10 @@ class WunderbaumNode { if (!flag === !this.expanded) { return; // Nothing to do } + if (sendEvents && + this._callEvent("beforeExpand", { flag: flag }) === false) { + return; + } // this.log("setExpanded()"); if (flag && this.getOption("autoCollapse")) { this.collapseSiblings(options); @@ -4725,13 +4824,16 @@ class WunderbaumNode { lastChild.scrollIntoView({ topNode: this }); } } + if (sendEvents) { + this._callEvent("expand", { flag: flag }); + } } /** * Set keyboard focus here. * @see {@link setActive} */ setFocus(flag = true) { - assert(!!flag, "blur is not yet implemented"); + assert(!!flag, "Blur is not yet implemented"); const prev = this.tree.focusNode; this.tree.focusNode = this; prev === null || prev === void 0 ? void 0 : prev.update(); @@ -5186,7 +5288,7 @@ WunderbaumNode.sequence = 0; /*! * Wunderbaum - ext-edit * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ // const START_MARKER = "\uFFF7"; class EditExtension extends WunderbaumExtension { @@ -5211,40 +5313,62 @@ class EditExtension extends WunderbaumExtension { this.debouncedOnChange = debounce(this._onChange.bind(this), this.getPluginOption("debounce")); } /* - * Call an event handler, while marking the current node cell 'dirty'. + * Call an event handler, while marking the current node cell 'busy'. + * Deal with returned promises and ValidationError. + * Convert a ValidationError into a input.setCustomValidity() call and vice versa. */ - _applyChange(eventName, node, colElem, extra) { - let res; + async _applyChange(eventName, node, colElem, inputElem, extra) { node.log(`_applyChange(${eventName})`, extra); colElem.classList.add("wb-busy"); - colElem.classList.remove("wb-error"); - try { - res = node._callEvent(eventName, extra); - } - catch (err) { - node.logError(`Error in ${eventName} event handler`, err); - colElem.classList.add("wb-error"); - colElem.classList.remove("wb-busy"); - } - // Convert scalar return value to a resolved promise - if (!(res instanceof Promise)) { - res = Promise.resolve(res); - } - res + colElem.classList.remove("wb-error", "wb-invalid"); + inputElem.setCustomValidity(""); + // Call event handler either ('change' or 'edit.appy'), which may return a + // promise or a scalar value or throw a ValidationError. + return new Promise((resolve, reject) => { + const res = node._callEvent(eventName, extra); + // normalize to promise, even if a scalar value was returned and await it + Promise.resolve(res) + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }) + .then((res) => { + if (!inputElem.checkValidity()) { + // Native validation failed or handler called 'inputElem.setCustomValidity()' + node.logWarn("inputElem.checkValidity() failed: throwing...."); + throw new ValidationError(inputElem.validationMessage); + } + return res; + }) .catch((err) => { - node.logError(`Error in ${eventName} event promise`, err); - colElem.classList.add("wb-error"); + if (err instanceof ValidationError) { + node.logWarn("catched ", err); + colElem.classList.add("wb-invalid"); + if (inputElem.setCustomValidity && !inputElem.validationMessage) { + inputElem.setCustomValidity(err.message); + } + if (inputElem.validationMessage) { + inputElem.reportValidity(); + } + // throw err; + } + else { + node.logError(`Error in ${eventName} event handler (throw e.util.ValidationError instead if this was intended)`, err); + colElem.classList.add("wb-error"); + throw err; + } }) .finally(() => { colElem.classList.remove("wb-busy"); }); - return res; } /* * Called for when a control that is embedded in a cell fires a `change` event. */ _onChange(e) { - // let res; const info = Wunderbaum.getEventInfo(e); const node = info.node; const colElem = info.colElem; @@ -5252,16 +5376,15 @@ class EditExtension extends WunderbaumExtension { this.tree.log("Ignored change event for removed element or node title"); return; } - this._applyChange("change", node, colElem, { + // See also WbChangeEventType + this._applyChange("change", node, colElem, e.target, { info: info, event: e, inputElem: e.target, inputValue: Wunderbaum.util.getValueFromElem(e.target), + inputValid: e.target.checkValidity(), }); } - // handleKey(e:KeyboardEvent):boolean { - // if(this.tree.cellNavMode ) - // } init() { super.init(); onEvent(this.tree.element, "change", //"change input", @@ -5308,7 +5431,6 @@ class EditExtension extends WunderbaumExtension { break; case "F2": if (trigger.indexOf("F2") >= 0) { - // tree.setNavigationMode(NavigationMode.cellEdit); this.startEditTitle(); return false; } @@ -5333,14 +5455,21 @@ class EditExtension extends WunderbaumExtension { this.tree.logDebug(`startEditTitle(node=${node})`); let inputHtml = node._callEvent("edit.beforeEdit"); if (inputHtml === false) { - node.logInfo("beforeEdit canceled operation."); + node.logDebug("beforeEdit canceled operation."); return; } - // `beforeEdit(e)` may return an input HTML string. Otherwise use a default. + // `beforeEdit(e)` may return an input HTML string. Otherwise use a default // (we also treat a `true` return value as 'use default'): if (inputHtml === true || !inputHtml) { const title = escapeHtml(node.title); - inputHtml = ``; + let opt = this.getPluginOption("maxlength"); + const maxlength = opt ? ` maxlength="${opt}"` : ""; + opt = this.getPluginOption("minlength"); + const minlength = opt ? ` minlength="${opt}"` : ""; + const required = opt > 0 ? " required" : ""; + inputHtml = + ``; } const titleSpan = node .getColElem(0) @@ -5351,7 +5480,9 @@ class EditExtension extends WunderbaumExtension { // Permanently apply input validations (CSS and tooltip) inputElem.addEventListener("keydown", (e) => { inputElem.setCustomValidity(""); - if (!inputElem.reportValidity()) ; + if (!inputElem.reportValidity()) { + node.logWarn(`Invalid input: '${inputElem.value}'`); + } }); } inputElem.focus(); @@ -5398,12 +5529,12 @@ class EditExtension extends WunderbaumExtension { throw new Error(`Input validation failed for "${newValue}": ${errMsg}.`); } const colElem = node.getColElem(0); - this._applyChange("edit.apply", node, colElem, { + this._applyChange("edit.apply", node, colElem, focusElem, { oldValue: node.title, newValue: newValue, inputElem: focusElem, - }) - .then((value) => { + inputValid: focusElem.checkValidity(), + }).then((value) => { const errMsg = focusElem.validationMessage; if (validity && errMsg && value !== false) { // Handler called 'inputElem.setCustomValidity()' to signal error @@ -5422,10 +5553,10 @@ class EditExtension extends WunderbaumExtension { this.curEditNode = null; this.relatedNode = null; this.tree.setFocus(); // restore focus that was in the input element - }) - .catch((err) => { - node.logError(err); }); + // .catch((err) => { + // node.logError(err); + // }); // Trigger 'change' event for embedded `` // focusElem.blur(); } @@ -5486,8 +5617,8 @@ class EditExtension extends WunderbaumExtension { * https://github.com/mar10/wunderbaum * * Released under the MIT license. - * @version v0.7.0 - * @date Sat, 09 Dec 2023 13:47:27 GMT + * @version v0.8.0 + * @date Thu, 11 Jan 2024 19:37:23 GMT */ // import "./wunderbaum.scss"; class WbSystemRoot extends WunderbaumNode { @@ -5504,7 +5635,7 @@ class WbSystemRoot extends WunderbaumNode { /** * A persistent plain object or array. * - * See also [[WunderbaumOptions]]. + * See also {@link WunderbaumOptions}. */ class Wunderbaum { constructor(options) { @@ -5537,7 +5668,7 @@ class Wunderbaum { // --- FILTER --- this.filterMode = null; // --- KEYNAV --- - /** @internal Use `setColumn()`/`getActiveColElem()`*/ + /** @internal Use `setColumn()`/`getActiveColElem()` to access. */ this.activeColIdx = 0; /** @internal */ this._cellNavMode = false; @@ -5713,6 +5844,7 @@ class Wunderbaum { else { this.setNavigationOption(opts.navigationModeOption); } + this.update(ChangeType.structure, { immediate: true }); readyDeferred.resolve(); }) .catch((error) => { @@ -5764,7 +5896,7 @@ class Wunderbaum { info.region === "title" && node.isActive() && (!slowClickDelay || Date.now() - this.lastClickTime < slowClickDelay)) { - this._callMethod("edit.startEditTitle", node); + node.startEditTitle(); } if (info.colIdx >= 0) { node.setActive(true, { colIdx: info.colIdx, event: e }); @@ -5811,7 +5943,7 @@ class Wunderbaum { const flag = e.type === "focusin"; const targetNode = Wunderbaum.getNode(e); this._callEvent("focus", { flag: flag, event: e }); - if (flag && this.isRowNav() && !this.isEditing()) { + if (flag && this.isRowNav() && !this.isEditingTitle()) { if (opts.navigationModeOption === NavModeEnum.row) { targetNode === null || targetNode === void 0 ? void 0 : targetNode.setActive(); } @@ -5835,7 +5967,7 @@ class Wunderbaum { * getTree(1); // Get second Wunderbaum instance on page * getTree(event); // Get tree for this mouse- or keyboard event * getTree("foo"); // Get tree for this `tree.options.id` - * getTree("#tree"); // Get tree for this matching element + * getTree("#tree"); // Get tree for first matching element selector * ``` */ static getTree(el) { @@ -5942,31 +6074,33 @@ class Wunderbaum { assert(key != null && !this.keyMap.has(key), `Missing or duplicate key: '${key}'.`); this.keyMap.set(key, node); const rk = node.refKey; - if (rk) { + if (rk != null) { const rks = this.refKeyMap.get(rk); // Set of nodes with this refKey if (rks) { rks.add(node); } else { - this.refKeyMap.set(rk, new Set()); + this.refKeyMap.set(rk, new Set([node])); } } } /** Remove node from tree's bookkeeping data structures. */ _unregisterNode(node) { + // Remove refKey reference from map (if any) const rk = node.refKey; - if (rk) { + if (rk != null) { const rks = this.refKeyMap.get(rk); if (rks && rks.delete(node) && !rks.size) { // We just removed the last element this.refKeyMap.delete(rk); } } - // mark as disposed + // Remove key reference from map + this.keyMap.delete(node.key); + // Mark as disposed node.tree = null; node.parent = null; - // node.title = "DISPOSED: " + node.title - // this.viewNodes.delete(node); + // Remove HTML markup node.removeMarkup(); } /** Call all hook methods of all registered extensions.*/ @@ -6170,7 +6304,7 @@ class Wunderbaum { this._callMethod("edit.createNode", "after"); break; case "rename": - this._callMethod("edit.startEditTitle"); + node.startEditTitle(); break; // Simple clipboard simulation: // case "cut": @@ -6217,7 +6351,6 @@ class Wunderbaum { this.root.children = null; this.keyMap.clear(); this.refKeyMap.clear(); - // this.viewNodes.clear(); this.treeRowCount = 0; this.activeNode = null; this.focusNode = null; @@ -6410,14 +6543,31 @@ class Wunderbaum { /** * Find all nodes that match condition. * + * @param match title string to search for, or a + * callback function that returns `true` if a node is matched. * @see {@link WunderbaumNode.findAll} */ findAll(match) { return this.root.findAll(match); } + /** + * Find all nodes with a given _refKey_ (aka a list of clones). + * + * @param refKey a `node.refKey` value to search for. + * @returns an array of matching nodes with at least two element or `[]` + * if nothing found. + * + * @see {@link WunderbaumNode.getCloneList} + */ + findByRefKey(refKey) { + const clones = this.refKeyMap.get(refKey); + return clones ? Array.from(clones) : []; + } /** * Find first node that matches condition. * + * @param match title string to search for, or a + * callback function that returns `true` if a node is matched. * @see {@link WunderbaumNode.findFirst} */ findFirst(match) { @@ -6426,8 +6576,6 @@ class Wunderbaum { /** * Find first node that matches condition. * - * @param match title string to search for, or a - * callback function that returns `true` if a node is matched. * @see {@link WunderbaumNode.findFirst} * */ @@ -6437,6 +6585,7 @@ class Wunderbaum { /** * Find the next visible node that starts with `match`, starting at `startNode` * and wrap-around at the end. + * Used by quicksearch and keyboard navigation. */ findNextNode(match, startNode) { //, visibleOnly) { @@ -6604,6 +6753,9 @@ class Wunderbaum { } /** * Return the currently active node or null. + * @see {@link WunderbaumNode.setActive} + * @see {@link WunderbaumNode.isActive} + * @see {@link WunderbaumNode.getFocusNode} */ getActiveNode() { return this.activeNode; @@ -6615,7 +6767,8 @@ class Wunderbaum { return this.root.getFirstChild(); } /** - * Return the currently active node or null. + * Return the node that currently has keyboard focus or null. + * @see {@link WunderbaumNode.getActiveNode} */ getFocusNode() { return this.focusNode; @@ -6692,8 +6845,19 @@ class Wunderbaum { toString() { return `Wunderbaum<'${this.id}'>`; } - /** Return true if any node is currently in edit-title mode. */ + /** Return true if any node title or grid cell is currently beeing edited. + * + * See also {@link Wunderbaum.isEditingTitle}. + */ isEditing() { + const focusElem = this.nodeListElement.querySelector("input:focus,select:focus"); + return !!focusElem; + } + /** Return true if any node is currently in edit-title mode. + * + * See also {@link WunderbaumNode.isEditingTitle} and {@link Wunderbaum.isEditing}. + */ + isEditingTitle() { return this._callMethod("edit.isEditingTitle"); } /** @@ -6829,12 +6993,23 @@ class Wunderbaum { /** * Set column #colIdx to 'active'. * - * This higlights the column header and -cells by adding the `wb-active` class. + * This higlights the column header and -cells by adding the `wb-active` + * class to all grid cells of the active column.
* Available in cell-nav mode only. + * + * If _options.edit_ is true, the embedded input element is focused, or if + * colIdx is 0, the node title is put into edit mode. */ - setColumn(colIdx) { - var _a; - assert(this.isCellNav(), "Exected cellNav mode"); + setColumn(colIdx, options) { + var _a, _b, _c; + const edit = options === null || options === void 0 ? void 0 : options.edit; + const scroll = (options === null || options === void 0 ? void 0 : options.scrollIntoView) !== false; + assert(this.isCellNav(), "Expected cellNav mode"); + if (typeof colIdx === "string") { + const cid = colIdx; + colIdx = this.columns.findIndex((c) => c.id === colIdx); + assert(colIdx >= 0, `Invalid colId: ${cid}`); + } assert(0 <= colIdx && colIdx < this.columns.length, `Invalid colIdx: ${colIdx}`); this.activeColIdx = colIdx; // Update `wb-active` class for all headers @@ -6854,17 +7029,26 @@ class Wunderbaum { colDiv.classList.toggle("wb-active", i++ === colIdx); } } - // Vertical scroll into view - // if (this.options.fixedCol) { - this.scrollToHorz(); - // } + // Horizontically scroll into view + if (scroll || edit) { + this.scrollToHorz(); + } + if (edit && this.activeNode) { + // this.activeNode.setFocus(); // Blur prev. input if any + if (colIdx === 0) { + this.activeNode.startEditTitle(); + } + else { + (_c = (_b = this.getActiveColElem()) === null || _b === void 0 ? void 0 : _b.querySelector("input,select")) === null || _c === void 0 ? void 0 : _c.focus(); + } + } } - /** Set or remove keybaord focus to the tree container. */ + /** Set or remove keyboard focus to the tree container. */ setActiveNode(key, flag = true, options) { var _a; (_a = this.findKey(key)) === null || _a === void 0 ? void 0 : _a.setActive(flag, options); } - /** Set or remove keybaord focus to the tree container. */ + /** Set or remove keyboard focus to the tree container. */ setFocus(flag = true) { if (flag) { this.element.focus(); @@ -6874,6 +7058,14 @@ class Wunderbaum { } } update(change, node, options) { + // this.log(`update(${change}) node=${node}`); + if (!(node instanceof WunderbaumNode)) { + options = node; + node = undefined; + } + const immediate = !!getOption(options, "immediate"); + const RF = RenderFlag; + const pending = this.pendingChangeTypes; if (this._disableUpdateCount) { // Assuming that we redraw all when enableUpdate() is re-enabled. // this.log( @@ -6882,14 +7074,6 @@ class Wunderbaum { this._disableUpdateIgnoreCount++; return; } - // this.log(`update(${change}) node=${node}`); - if (!(node instanceof WunderbaumNode)) { - options = node; - node = null; - } - const immediate = !!getOption(options, "immediate"); - const RF = RenderFlag; - const pending = this.pendingChangeTypes; switch (change) { case ChangeType.any: case ChangeType.colStructure: @@ -7217,10 +7401,14 @@ class Wunderbaum { _updateViewportImmediately() { var _a; if (this._disableUpdateCount) { - this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount})`); + this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount}).`); this._disableUpdateIgnoreCount++; return; } + if (this._updateViewportThrottled.pending()) { + // this.logWarn(`_updateViewportImmediately() cancel pending timer.`); + this._updateViewportThrottled.cancel(); + } // Shorten container height to avoid v-scrollbar const FIX_ADJUST_HEIGHT = 1; const RF = RenderFlag; @@ -7324,9 +7512,6 @@ class Wunderbaum { } let endIdx = Math.max(0, (ofs + vp_height) / row_height + prefetch); endIdx = Math.ceil(endIdx); - // const obsoleteViewNodes = this.viewNodes; - // this.viewNodes = new Set(); - // const viewNodes = this.viewNodes; // this.debug("render", opts); const obsoleteNodes = new Set(); this.nodeListElement.childNodes.forEach((elem) => { @@ -7582,37 +7767,31 @@ class Wunderbaum { * FILTER * -------------------------------------------------------------------------*/ /** - * [ext-filter] Dim or hide nodes. + * Dim or hide nodes. */ filterNodes(filter, options) { return this.extensions.filter.filterNodes(filter, options); } /** - * [ext-filter] Dim or hide whole branches. + * Dim or hide whole branches. */ filterBranches(filter, options) { return this.extensions.filter.filterBranches(filter, options); } /** - * [ext-filter] Reset the filter. - * - * @requires [[FilterExtension]] + * Reset the filter. */ clearFilter() { return this.extensions.filter.clearFilter(); } /** - * [ext-filter] Return true if a filter is currently applied. - * - * @requires [[FilterExtension]] + * Return true if a filter is currently applied. */ isFilterActive() { return !!this.filterMode; } /** - * [ext-filter] Re-apply current filter. - * - * @requires [[FilterExtension]] + * Re-apply current filter. */ updateFilter() { return this.extensions.filter.updateFilter(); @@ -7620,7 +7799,7 @@ class Wunderbaum { } Wunderbaum.sequence = 0; /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */ -Wunderbaum.version = "v0.7.0"; // Set to semver by 'grunt release' +Wunderbaum.version = "v0.8.0"; // Set to semver by 'grunt release' /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */ Wunderbaum.util = util; diff --git a/dist/wunderbaum.esm.min.js b/dist/wunderbaum.esm.min.js index ca29aa94..979ac5cc 100644 --- a/dist/wunderbaum.esm.min.js +++ b/dist/wunderbaum.esm.min.js @@ -1,76 +1,76 @@ +/*! + * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 + * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE + * Modified for TypeScript type annotations. + */ +const freeGlobal="object"==typeof global&&null!==global&&global.Object===Object&&global,freeGlobalThis="object"==typeof globalThis&&null!==globalThis&&globalThis.Object==Object&&globalThis,freeSelf="object"==typeof self&&null!==self&&self.Object===Object&&self,root=freeGlobalThis||freeGlobal||freeSelf||Function("return this")();function isObject(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function debounce(e,t=0,i={}){let s,n,r,o,l,a,d=0,c=!1,h=!1,u=!0;const p=!t&&0!==t&&"function"==typeof root.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){const i=s,r=n;return s=n=void 0,d=t,o=e.apply(r,i),o}function g(e,t){return p?(root.cancelAnimationFrame(l),root.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-a;return void 0===a||i>=t||i<0||h&&e-d>=r}function v(){const e=Date.now();if(m(e))return y(e);l=g(v,function(e){const i=e-d,s=t-(e-a);return h?Math.min(s,r-i):s}(e))}function y(e){return l=void 0,u&&s?f(e):(s=n=void 0,o)}function b(...e){const i=Date.now(),r=m(i);if(s=e,n=this,a=i,r){if(void 0===l)return function(e){return d=e,l=g(v,t),c?f(e):o}(a);if(h)return l=g(v,t),f(a)}return void 0===l&&(l=g(v,t)),o}return t=+t||0,isObject(i)&&(c=!!i.leading,h="maxWait"in i,r=h?Math.max(+i.maxWait||0,t):r,u="trailing"in i?!!i.trailing:u),b.cancel=function(){void 0!==l&&function(e){if(p)return root.cancelAnimationFrame(e);clearTimeout(e)}(l),d=0,s=a=n=l=void 0},b.flush=function(){return void 0===l?o:y(Date.now())},b.pending=function(){return void 0!==l},b}function throttle(e,t=0,i={}){let s=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return isObject(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),debounce(e,t,{leading:s,trailing:n,maxWait:t})} /*! * Wunderbaum - util * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ -const MOUSE_BUTTONS={0:"",1:"left",2:"middle",3:"right",4:"back",5:"forward"},MAX_INT=9007199254740991,userInfo=_getUserInfo(),isMac=userInfo.isMac,REX_HTML=/[&<>"'/]/g,REX_TOOLTIP=/[<>"'/]/g,ENTITY_MAP={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};let Deferred$1=class{constructor(){this.thens=[],this.catches=[],this.status=""}resolve(e){if(this.status)throw new Error("already settled");this.status="resolved",this.resolvedValue=e,this.thens.forEach((t=>t(e))),this.thens=[]}reject(e){if(this.status)throw new Error("already settled");this.status="rejected",this.rejectedError=e,this.catches.forEach((t=>t(e))),this.catches=[]}then(e){"resolved"===status?e(this.resolvedValue):this.thens.unshift(e)}catch(e){"rejected"===this.status?e(this.rejectedError):this.catches.unshift(e)}promise(){return{then:this.then,catch:this.catch}}};function assert(e,t){if(!e)throw t=t||"Assertion failed.",new Error(t)}function _getUserInfo(){const e=navigator;return{isMac:/Mac/.test(e.platform)}}function documentReady(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function documentReadyPromise(){return new Promise((e=>{documentReady(e)}))}function each(e,t){if(null==e)return e;const s=e.length;let i=0;if("number"==typeof s)for(;i")>=0&&error("Not implemented"),e}function getValueFromElem(e,t=!1){const s=e.tagName;let i=null;if("SPAN"===s&&e.classList.contains("wb-col")){const s=e,n=s.querySelector("input,select");if(n)return getValueFromElem(n,t);s.innerText=""+i}else if("INPUT"===s){const s=e;switch(s.type){case"button":case"reset":case"submit":case"image":break;case"checkbox":i=s.indeterminate?null:s.checked;break;case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":i=t?s.valueAsDate:s.value;break;case"number":case"range":i=s.valueAsNumber;break;case"radio":{const e=s.name,t=s.parentElement.querySelector(`input[name="${e}"]:checked`);i=t?t.value:void 0}break;default:i=s.value}}else if("SELECT"===s){i=e.value}return i}function setValueToElem(e,t){const s=e.tagName;if("SPAN"===s&&e.classList.contains("wb-col")){const s=e,i=s.querySelector("input,select");if(i)return setValueToElem(i,t);s.innerText=""+t}else if("INPUT"===s){const s=e,i=s.type;switch(i){case"checkbox":s.indeterminate=null===t,s.checked=!!t;break;case"date":case"month":case"time":case"week":case"datetime":case"datetime-local":s.valueAsDate=new Date(t);break;case"number":case"range":null==t?s.value=t:s.valueAsNumber=t;break;case"radio":error(`Not yet implemented: ${i}`);break;case"button":case"reset":case"submit":case"image":break;default:s.value=null!=t?t:""}}else if("SELECT"===s){const s=e;null==t?s.selectedIndex=-1:s.value=t}}function setElemDisplay(e,t){const s=elemFromSelector(e).style;t?"none"===s.display&&(s.display=""):""===s.display&&(s.display="none")}function elemFromHtml(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstElementChild}const _IGNORE_KEYS=new Set(["Alt","Control","Meta","Shift"]);function elemFromSelector(e){return e?"string"==typeof e?document.querySelector(e):e:null}function eventTargetFromSelector(e){return e?"string"==typeof e?document.querySelector(e):e:null}function eventToString(e){const t=e.key,s=e.type,i=[];return e.altKey&&i.push("Alt"),e.ctrlKey&&i.push("Control"),e.metaKey&&i.push("Meta"),e.shiftKey&&i.push("Shift"),"click"===s||"dblclick"===s?i.push(MOUSE_BUTTONS[e.button]+s):"wheel"===s?i.push(s):_IGNORE_KEYS.has(t)||i.push(t),i.join("+")}function extend(...e){for(let t=1;t{e.addEventListener(t,(function(e){if(!n)return r(e);if(e.target){let t=e.target;if(t.matches(n))return r(e);if(t=t.closest(n),t)return r(e)}}))}))}function overrideMethod(e,t,s,i){let n,r;const o=i||e,l=e[t],a=(...e)=>l.apply(o,e),d=e=>l.apply(o,e);e[t]=(...e)=>{try{return n=o._super,r=o._superApply,o._super=a,o._superApply=d,s.apply(o,e)}finally{o._super=n,o._superApply=r}}}function setTimeoutPromise(e,t){return new Promise(((s,i)=>{setTimeout((()=>{try{s(e.apply(this))}catch(e){i(e)}}),t)}))}async function sleep(e){return new Promise((t=>setTimeout(t,e)))}function toggleCheckbox(e,t,s){const i=elemFromSelector(e);if(assert("checkbox"===i.type,`Expected a checkbox: ${i.type}`),null!=s||(s=i.classList.contains("wb-tristate")||i.indeterminate),void 0===t){switch(i.indeterminate?null:i.checked){case!0:t=!1;break;case!1:t=!s||null;break;case null:t=!0}}i.indeterminate=null==t,i.checked=!!t}function getOption(e,t,s=void 0){let i;e&&t.indexOf(".")>=0&&([i,t]=t.split("."),e=e[i]);const n=e?e[t]:null;return null!=n?n:s}function toSet(e){if(e instanceof Set)return e;if("string"==typeof e){const t=new Set;for(const s of e.split(" "))t.add(s.trim());return t}if(Array.isArray(e))return new Set(e);throw new Error("Cannot convert to Set: "+e)}function type(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}function adaptiveThrottle(e,t){let s=0,i=null;const n=Object.assign({minDelay:16,defaultDelay:200,maxDelay:5e3,delayFactor:2},t),r=Math.max(16,+n.minDelay),o=+n.maxDelay,l=(...t)=>{if(s)i=t,s+=1;else{s=1;const a=t;i=null;const d=Date.now();try{e.apply(this,a)}catch(e){console.error(e)}const c=Date.now()-d,h=Math.min(Math.max(r,c*n.delayFactor),o),u=Math.max(r,h-c);setTimeout((()=>{s=0,null!=i&&l.apply(this,i)}),u)}};return l}var ChangeType,RenderFlag,NodeStatusType,NodeRegion,NavModeEnum,util=Object.freeze({__proto__:null,Deferred:Deferred$1,MAX_INT:MAX_INT,MOUSE_BUTTONS:MOUSE_BUTTONS,adaptiveThrottle:adaptiveThrottle,assert:assert,documentReady:documentReady,documentReadyPromise:documentReadyPromise,each:each,elemFromHtml:elemFromHtml,elemFromSelector:elemFromSelector,error:error,escapeHtml:escapeHtml,escapeRegex:escapeRegex,escapeTooltip:escapeTooltip,eventTargetFromSelector:eventTargetFromSelector,eventToString:eventToString,extend:extend,extractHtmlText:extractHtmlText,getOption:getOption,getValueFromElem:getValueFromElem,isArray:isArray,isEmptyObject:isEmptyObject,isFunction:isFunction,isMac:isMac,isPlainObject:isPlainObject,noop:noop,onEvent:onEvent,overrideMethod:overrideMethod,setElemDisplay:setElemDisplay,setTimeoutPromise:setTimeoutPromise,setValueToElem:setValueToElem,sleep:sleep,toSet:toSet,toggleCheckbox:toggleCheckbox,type:type}); + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const MOUSE_BUTTONS={0:"",1:"left",2:"middle",3:"right",4:"back",5:"forward"},MAX_INT=9007199254740991,userInfo=_getUserInfo(),isMac=userInfo.isMac,REX_HTML=/[&<>"'/]/g,REX_TOOLTIP=/[<>"'/]/g,ENTITY_MAP={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};class ValidationError extends Error{constructor(e){super(e),this.name="ValidationError"}}let Deferred$1=class{constructor(){this.thens=[],this.catches=[],this.status=""}resolve(e){if(this.status)throw new Error("already settled");this.status="resolved",this.resolvedValue=e,this.thens.forEach((t=>t(e))),this.thens=[]}reject(e){if(this.status)throw new Error("already settled");this.status="rejected",this.rejectedError=e,this.catches.forEach((t=>t(e))),this.catches=[]}then(e){"resolved"===status?e(this.resolvedValue):this.thens.unshift(e)}catch(e){"rejected"===this.status?e(this.rejectedError):this.catches.unshift(e)}promise(){return{then:this.then,catch:this.catch}}};function assert(e,t){if(!e)throw t=t||"Assertion failed.",new Error(t)}function _getUserInfo(){const e=navigator;return{isMac:/Mac/.test(e.platform)}}function documentReady(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function documentReadyPromise(){return new Promise((e=>{documentReady(e)}))}function each(e,t){if(null==e)return e;const i=e.length;let s=0;if("number"==typeof i)for(;s")>=0&&error("Not implemented"),e}function getValueFromElem(e,t=!1){const i=e.tagName;let s=null;if("SPAN"===i&&e.classList.contains("wb-col")){const i=e,n=i.querySelector("input,select");if(n)return getValueFromElem(n,t);i.innerText=""+s}else if("INPUT"===i){const i=e;switch(i.type){case"button":case"reset":case"submit":case"image":break;case"checkbox":s=i.indeterminate?null:i.checked;break;case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":s=t?i.valueAsDate:i.value;break;case"number":case"range":s=i.valueAsNumber;break;case"radio":{const e=i.name,t=i.parentElement.querySelector(`input[name="${e}"]:checked`);s=t?t.value:void 0}break;default:s=i.value}}else if("SELECT"===i){s=e.value}return s}function setValueToElem(e,t){const i=e.tagName;if("SPAN"===i&&e.classList.contains("wb-col")){const i=e,s=i.querySelector("input,select");if(s)return setValueToElem(s,t);i.innerText=""+t}else if("INPUT"===i){const i=e,s=i.type;switch(s){case"checkbox":i.indeterminate=null===t,i.checked=!!t;break;case"date":case"month":case"time":case"week":case"datetime":case"datetime-local":i.valueAsDate=new Date(t);break;case"number":case"range":null==t?i.value=t:i.valueAsNumber=t;break;case"radio":error(`Not yet implemented: ${s}`);break;case"button":case"reset":case"submit":case"image":break;default:i.value=null!=t?t:""}}else if("SELECT"===i){const i=e;null==t?i.selectedIndex=-1:i.value=t}}function setElemDisplay(e,t){const i=elemFromSelector(e).style;t?"none"===i.display&&(i.display=""):""===i.display&&(i.display="none")}function elemFromHtml(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstElementChild}const _IGNORE_KEYS=new Set(["Alt","Control","Meta","Shift"]);function elemFromSelector(e){return e?"string"==typeof e?document.querySelector(e):e:null}function eventToString(e){const t=e.key,i=e.type,s=[];return e.altKey&&s.push("Alt"),e.ctrlKey&&s.push("Control"),e.metaKey&&s.push("Meta"),e.shiftKey&&s.push("Shift"),"click"===i||"dblclick"===i?s.push(MOUSE_BUTTONS[e.button]+i):"wheel"===i?s.push(i):_IGNORE_KEYS.has(t)||s.push(t),s.join("+")}function extend(...e){for(let t=1;t{e.addEventListener(t,(function(e){if(!n)return r(e);if(e.target){let t=e.target;if(t.matches(n))return r(e);if(t=t.closest(n),t)return r(e)}}))}))}function overrideMethod(e,t,i,s){let n,r;const o=s||e,l=e[t],a=(...e)=>l.apply(o,e),d=e=>l.apply(o,e);e[t]=(...e)=>{try{return n=o._super,r=o._superApply,o._super=a,o._superApply=d,i.apply(o,e)}finally{o._super=n,o._superApply=r}}}function setTimeoutPromise(e,t){return new Promise(((i,s)=>{setTimeout((()=>{try{i(e.apply(this))}catch(e){s(e)}}),t)}))}async function sleep(e){return new Promise((t=>setTimeout(t,e)))}function toggleCheckbox(e,t,i){const s=elemFromSelector(e);if(assert("checkbox"===s.type,`Expected a checkbox: ${s.type}`),null!=i||(i=s.classList.contains("wb-tristate")||s.indeterminate),void 0===t){switch(s.indeterminate?null:s.checked){case!0:t=!1;break;case!1:t=!i||null;break;case null:t=!0}}s.indeterminate=null==t,s.checked=!!t}function getOption(e,t,i=void 0){let s;e&&t.indexOf(".")>=0&&([s,t]=t.split("."),e=e[s]);const n=e?e[t]:null;return null!=n?n:i}function toSet(e){if(e instanceof Set)return e;if("string"==typeof e){const t=new Set;for(const i of e.split(" "))t.add(i.trim());return t}if(Array.isArray(e))return new Set(e);throw new Error("Cannot convert to Set: "+e)}function type(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}function adaptiveThrottle(e,t){const i=Object.assign({minDelay:16,defaultDelay:200,maxDelay:5e3,delayFactor:2},t),s=Math.max(16,+i.minDelay),n=+i.maxDelay;let r=0,o=null,l=null;const a=(...t)=>{if(r)o=t,r+=1;else{r=1;const d=t;o=null;const c=Date.now();try{e.apply(this,d)}catch(e){console.error(e)}const h=Date.now()-c,u=Math.min(Math.max(s,h*i.delayFactor),n),p=Math.max(s,u-h);l=setTimeout((()=>{l=null,r=0,null!=o&&a.apply(this,o)}),p)}};return a.cancel=()=>{l&&(clearTimeout(l),l=null),o=null,r=0},a.pending=()=>!!l,a.flush=()=>{throw new Error("Not implemented")},a}var ChangeType,RenderFlag,NodeStatusType,NodeRegion,NavModeEnum,util=Object.freeze({__proto__:null,Deferred:Deferred$1,MAX_INT:MAX_INT,MOUSE_BUTTONS:MOUSE_BUTTONS,ValidationError:ValidationError,adaptiveThrottle:adaptiveThrottle,assert:assert,debounce:debounce,documentReady:documentReady,documentReadyPromise:documentReadyPromise,each:each,elemFromHtml:elemFromHtml,elemFromSelector:elemFromSelector,error:error,escapeHtml:escapeHtml,escapeRegex:escapeRegex,escapeTooltip:escapeTooltip,eventToString:eventToString,extend:extend,extractHtmlText:extractHtmlText,getOption:getOption,getValueFromElem:getValueFromElem,isArray:isArray,isEmptyObject:isEmptyObject,isFunction:isFunction,isMac:isMac,isPlainObject:isPlainObject,noop:noop,onEvent:onEvent,overrideMethod:overrideMethod,setElemDisplay:setElemDisplay,setTimeoutPromise:setTimeoutPromise,setValueToElem:setValueToElem,sleep:sleep,throttle:throttle,toSet:toSet,toggleCheckbox:toggleCheckbox,type:type}); /*! * Wunderbaum - types * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */!function(e){e.any="any",e.data="data",e.colStructure="colStructure",e.resize="resize",e.row="row",e.structure="structure",e.status="status",e.scroll="scroll"}(ChangeType||(ChangeType={})),function(e){e.clearMarkup="clearMarkup",e.header="header",e.redraw="redraw",e.scroll="scroll"}(RenderFlag||(RenderFlag={})),function(e){e.ok="ok",e.loading="loading",e.error="error",e.noData="noData",e.paging="paging"}(NodeStatusType||(NodeStatusType={})),function(e){e.unknown="",e.checkbox="checkbox",e.column="column",e.expander="expander",e.icon="icon",e.prefix="prefix",e.title="title"}(NodeRegion||(NodeRegion={})),function(e){e.startRow="startRow",e.cell="cell",e.startCell="startCell",e.row="row"}(NavModeEnum||(NavModeEnum={})); /*! * Wunderbaum - wb_extension_base * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */ -class WunderbaumExtension{constructor(e,t,s){this.enabled=!0,this.tree=e,this.id=t,this.treeOpts=e.options;const i=e.options;void 0===this.treeOpts[t]?i[t]=this.extensionOpts=extend({},s):(this.extensionOpts=extend({},s,i[t]),i[t]=this.extensionOpts),this.enabled=this.getPluginOption("enabled",!0)}init(){this.tree.element.classList.add("wb-ext-"+this.id)}getPluginOption(e,t){var s;return null!==(s=this.extensionOpts[e])&&void 0!==s?s:t}setPluginOption(e,t){this.extensionOpts[e]=t}setEnabled(e=!0){return this.setPluginOption("enabled",!!e)}onKeyEvent(e){}onRender(e){}} -/*! - * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 - * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE - * Modified for TypeScript type annotations. - */const freeGlobal="object"==typeof global&&null!==global&&global.Object===Object&&global,freeGlobalThis="object"==typeof globalThis&&null!==globalThis&&globalThis.Object==Object&&globalThis,freeSelf="object"==typeof self&&null!==self&&self.Object===Object&&self,root=freeGlobalThis||freeGlobal||freeSelf||Function("return this")();function isObject(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function debounce(e,t=0,s={}){let i,n,r,o,l,a,d=0,c=!1,h=!1,u=!0;const p=!t&&0!==t&&"function"==typeof root.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){const s=i,r=n;return i=n=void 0,d=t,o=e.apply(r,s),o}function g(e,t){return p?(root.cancelAnimationFrame(l),root.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const s=e-a;return void 0===a||s>=t||s<0||h&&e-d>=r}function v(){const e=Date.now();if(m(e))return b(e);l=g(v,function(e){const s=e-d,i=t-(e-a);return h?Math.min(i,r-s):i}(e))}function b(e){return l=void 0,u&&i?f(e):(i=n=void 0,o)}function y(...e){const s=Date.now(),r=m(s);if(i=e,n=this,a=s,r){if(void 0===l)return function(e){return d=e,l=g(v,t),c?f(e):o}(a);if(h)return l=g(v,t),f(a)}return void 0===l&&(l=g(v,t)),o}return t=+t||0,isObject(s)&&(c=!!s.leading,h="maxWait"in s,r=h?Math.max(+s.maxWait||0,t):r,u="trailing"in s?!!s.trailing:u),y.cancel=function(){void 0!==l&&function(e){if(p)return root.cancelAnimationFrame(e);clearTimeout(e)}(l),d=0,i=a=n=l=void 0},y.flush=function(){return void 0===l?o:b(Date.now())},y.pending=function(){return void 0!==l},y}function throttle(e,t=0,s={}){let i=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return isObject(s)&&(i="leading"in s?!!s.leading:i,n="trailing"in s?!!s.trailing:n),debounce(e,t,{leading:i,trailing:n,maxWait:t})} +class WunderbaumExtension{constructor(e,t,i){this.enabled=!0,this.tree=e,this.id=t,this.treeOpts=e.options;const s=e.options;void 0===this.treeOpts[t]?s[t]=this.extensionOpts=extend({},i):(this.extensionOpts=extend({},i,s[t]),s[t]=this.extensionOpts),this.enabled=this.getPluginOption("enabled",!0)}init(){this.tree.element.classList.add("wb-ext-"+this.id)}getPluginOption(e,t){var i;return null!==(i=this.extensionOpts[e])&&void 0!==i?i:t}setPluginOption(e,t){this.extensionOpts[e]=t}setEnabled(e=!0){return this.setPluginOption("enabled",!!e)}onKeyEvent(e){}onRender(e){}} /*! * Wunderbaum - ext-filter * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const START_MARKER="￷",END_MARKER="￸",RE_START_MARKER=new RegExp(escapeRegex("￷"),"g"),RE_END_MARTKER=new RegExp(escapeRegex("￸"),"g");class FilterExtension extends WunderbaumExtension{constructor(e){super(e,"filter",{connectInput:null,autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,mode:"dim",noData:!0}),this.lastFilterArgs=null}init(){super.init();const e=this.getPluginOption("connectInput");e&&(this.queryInput=elemFromSelector(e),onEvent(this.queryInput,"input",debounce((e=>{this.filterNodes(this.queryInput.value.trim(),{})}),700)))}setPluginOption(e,t){if(super.setPluginOption(e,t),"mode"===e)this.tree.filterMode="hide"===t?"hide":"dim",this.tree.updateFilter()}_applyFilterNoUpdate(e,t,s){return this.tree.runWithDeferredUpdate((()=>this._applyFilterImpl(e,t,s)))}_applyFilterImpl(e,t,s){let i,n,r=0;const o=Date.now(),l=this.tree,a=l.options,d=a.autoCollapse,c=extend({},a.filter,s),h="hide"===c.mode,u=!!c.leavesOnly&&!t;if("string"==typeof e){if(""===e)return l.logInfo("Passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();i=c.fuzzy?e.split("").map(escapeRegex).reduce((function(e,t){return e+"([^"+t+"]*)"+t}),""):escapeRegex(e);const t=new RegExp(i,"i"),s=new RegExp(escapeRegex(e),"gi");e=e=>{if(!e.title)return!1;const i=e.title,r=i.match(t);return r&&c.highlight&&(n=c.fuzzy?_markFuzzyMatchedChars(i,r,!0):i.replace(s,(function(e){return"￷"+e+"￸"})),e.titleWithHighlight=escapeHtml(n).replace(RE_START_MARKER,"").replace(RE_END_MARTKER,"")),!!r}}return l.filterMode=c.mode,this.lastFilterArgs=arguments,l.element.classList.toggle("wb-ext-filter-hide",!!h),l.element.classList.toggle("wb-ext-filter-dim",!h),l.element.classList.toggle("wb-ext-filter-hide-expanders",!!c.hideExpanders),l.root.subMatchCount=0,l.visit((e=>{delete e.match,delete e.titleWithHighlight,e.subMatchCount=0})),l.setStatus(NodeStatusType.ok),a.autoCollapse=!1,l.visit((s=>{if(u&&null!=s.children)return;let i=e(s);if("skip"===i)return s.visit((function(e){e.match=!1}),!0),"skip";let n=!1;(t||"branch"===i)&&s.parent.match&&(i=!0,n=!0),i&&(r++,s.match=!0,s.visitParents((e=>{e!==s&&(e.subMatchCount+=1),!c.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0}),e._filterAutoExpanded=!0)}),!0))})),a.autoCollapse=d,0===r&&c.noData&&h&&l.root.setStatus(NodeStatusType.noData),l.logInfo(`Filter '${i}' found ${r} nodes in ${Date.now()-o} ms.`),r}filterNodes(e,t){return this._applyFilterNoUpdate(e,!1,t)}filterBranches(e,t){return this._applyFilterNoUpdate(e,!0,t)}updateFilter(){var e;const t=this.tree;t.filterMode&&this.lastFilterArgs&&(null===(e=t.options.filter)||void 0===e?void 0:e.autoApply)?this._applyFilterNoUpdate.apply(this,this.lastFilterArgs):t.logWarn("updateFilter(): no filter active.")}clearFilter(){const e=this.tree;e.enableUpdate(!1),e.setStatus(NodeStatusType.ok),delete e.root.match,delete e.root.subMatchCount,e.visit((e=>{delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0}),delete e._filterAutoExpanded})),e.filterMode=null,this.lastFilterArgs=null,e.element.classList.remove("wb-ext-filter-dim","wb-ext-filter-hide"),e.enableUpdate(!0)}}function _markFuzzyMatchedChars(e,t,s=!0){const i=[];for(let e=1;e"})),n.join("")} + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const START_MARKER="￷",END_MARKER="￸",RE_START_MARKER=new RegExp(escapeRegex("￷"),"g"),RE_END_MARTKER=new RegExp(escapeRegex("￸"),"g");class FilterExtension extends WunderbaumExtension{constructor(e){super(e,"filter",{connectInput:null,autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,mode:"dim",noData:!0}),this.lastFilterArgs=null}init(){super.init();const e=this.getPluginOption("connectInput");e&&(this.queryInput=elemFromSelector(e),onEvent(this.queryInput,"input",debounce((e=>{this.filterNodes(this.queryInput.value.trim(),{})}),700)))}setPluginOption(e,t){if(super.setPluginOption(e,t),"mode"===e)this.tree.filterMode="hide"===t?"hide":"dim",this.tree.updateFilter()}_applyFilterNoUpdate(e,t,i){return this.tree.runWithDeferredUpdate((()=>this._applyFilterImpl(e,t,i)))}_applyFilterImpl(e,t,i){let s,n,r=0;const o=Date.now(),l=this.tree,a=l.options,d=a.autoCollapse,c=extend({},a.filter,i),h="hide"===c.mode,u=!!c.leavesOnly&&!t;if("string"==typeof e){if(""===e)return l.logInfo("Passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();s=c.fuzzy?e.split("").map(escapeRegex).reduce((function(e,t){return e+"([^"+t+"]*)"+t}),""):escapeRegex(e);const t=new RegExp(s,"i"),i=new RegExp(escapeRegex(e),"gi");e=e=>{if(!e.title)return!1;const s=e.title,r=s.match(t);return r&&c.highlight&&(n=c.fuzzy?_markFuzzyMatchedChars(s,r,!0):s.replace(i,(function(e){return"￷"+e+"￸"})),e.titleWithHighlight=escapeHtml(n).replace(RE_START_MARKER,"").replace(RE_END_MARTKER,"")),!!r}}return l.filterMode=c.mode,this.lastFilterArgs=arguments,l.element.classList.toggle("wb-ext-filter-hide",!!h),l.element.classList.toggle("wb-ext-filter-dim",!h),l.element.classList.toggle("wb-ext-filter-hide-expanders",!!c.hideExpanders),l.root.subMatchCount=0,l.visit((e=>{delete e.match,delete e.titleWithHighlight,e.subMatchCount=0})),l.setStatus(NodeStatusType.ok),a.autoCollapse=!1,l.visit((i=>{if(u&&null!=i.children)return;let s=e(i);if("skip"===s)return i.visit((function(e){e.match=!1}),!0),"skip";let n=!1;(t||"branch"===s)&&i.parent.match&&(s=!0,n=!0),s&&(r++,i.match=!0,i.visitParents((e=>{e!==i&&(e.subMatchCount+=1),!c.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0}),e._filterAutoExpanded=!0)}),!0))})),a.autoCollapse=d,0===r&&c.noData&&h&&("string"==typeof c.noData?l.root.setStatus(NodeStatusType.noData,{message:c.noData}):l.root.setStatus(NodeStatusType.noData)),l.logInfo(`Filter '${s}' found ${r} nodes in ${Date.now()-o} ms.`),r}filterNodes(e,t){return this._applyFilterNoUpdate(e,!1,t)}filterBranches(e,t){return this._applyFilterNoUpdate(e,!0,t)}updateFilter(){var e;const t=this.tree;t.filterMode&&this.lastFilterArgs&&(null===(e=t.options.filter)||void 0===e?void 0:e.autoApply)?this._applyFilterNoUpdate.apply(this,this.lastFilterArgs):t.logWarn("updateFilter(): no filter active.")}clearFilter(){const e=this.tree;e.enableUpdate(!1),e.setStatus(NodeStatusType.ok),delete e.root.match,delete e.root.subMatchCount,e.visit((e=>{delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0}),delete e._filterAutoExpanded})),e.filterMode=null,this.lastFilterArgs=null,e.element.classList.remove("wb-ext-filter-dim","wb-ext-filter-hide"),e.enableUpdate(!0)}}function _markFuzzyMatchedChars(e,t,i=!0){const s=[];for(let e=1;e"})),n.join("")} /*! * Wunderbaum - ext-keynav * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const QUICKSEARCH_DELAY=500;class KeynavExtension extends WunderbaumExtension{constructor(e){super(e,"keynav",{})}_getEmbeddedInputElem(e){var t;let s=null;if(e&&null!=e.type)s=e;else{const e=null===(t=this.tree.getActiveColElem())||void 0===t?void 0:t.querySelector("input,select");e&&(s=e)}return s}_isCurInputFocused(){var e;return!!(null===(e=this.tree.getActiveColElem())||void 0===e?void 0:e.querySelector("input:focus,select:focus"))}onKeyEvent(e){const t=e.event,s=this.tree,i=e.options,n=!t.ctrlKey||i.autoActivate,r=this._getEmbeddedInputElem(t.target),o=r&&this._isCurInputFocused(),l=i.navigationModeOption;let a,d=eventToString(t),c=e.node,h=!0;if(!s.isEnabled())return!1;if(!1===s._callEvent("keydown",e))return!1;if(!1===s._callMethod("edit._preprocessKeyEvent",e))return!1;if(!c){const e=s.getFocusNode()||s.getActiveNode(),t=s.getFirstChild();if(!e&&t&&"ArrowDown"===d)return t.logInfo("Keydown: activate first node."),void t.setActive();a=e||t,a&&(a.setFocus(),c=s.getFocusNode(),c.logInfo("Keydown: force focus on active node."))}const u=c.isColspan();if(s.isRowNav()){if(o){switch(d){case"Enter":r.blur(),s.setFocus();break;case"Escape":c._render(),s.setFocus()}return}if(i.quicksearch&&1===d.length&&/^\w$/.test(d)&&!r){const e=Date.now();e-s.lastQuicksearchTime>500&&(s.lastQuicksearchTerm=""),s.lastQuicksearchTime=e,s.lastQuicksearchTerm+=d;const i=s.findNextNode(s.lastQuicksearchTerm,s.getActiveNode());return i&&i.setActive(!0,{event:t}),void t.preventDefault()}switch(d){case"Enter":c.isActive()&&(c.isExpanded()?d="Subtract":c.isExpandable(!0)&&(d="Add"));break;case"ArrowLeft":c.expanded&&(d="Subtract");break;case"ArrowRight":if(!c.expanded&&c.isExpandable(!0))d="Add";else if(l===NavModeEnum.startCell||l===NavModeEnum.startRow)return t.preventDefault(),s.setCellNav(),!1}switch(d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":c.getOption("checkbox")?c.toggleSelected():c.setActive(!0,{event:t});break;case"Enter":c.setActive(!0,{event:t});break;case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"Backspace":case"End":case"Home":case"Control+End":case"Control+Home":case"Meta+ArrowDown":case"Meta+ArrowUp":case"PageDown":case"PageUp":c.navigate(d,{activate:n,event:t});break;default:h=!1}}else{const e=this._getEmbeddedInputElem(null),i=e?e.type||e.tagName:"",r=e&&this._isCurInputFocused(),o=e&&"checkbox"!==i;if(r){if("Escape"===d)return c._render(),c.logDebug("Reset focused input"),s.setFocus(),void s.setColumn(s.activeColIdx);if("Enter"!==d)return void c.logDebug(`Ignored ${d} inside focused input`)}else if(e&&1===d.length&&o)return e.focus(),e.value="",c.logDebug(`Focus imput: ${d}`),!1;switch("Tab"===d?(d="ArrowRight",h=!0):"Shift+Tab"===d&&(d=s.activeColIdx>0?"ArrowLeft":"",h=!0),d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":0===s.activeColIdx&&c.getOption("checkbox")?(c.toggleSelected(),h=!0):e&&"checkbox"===i&&(e.click(),h=!0);break;case"F2":e&&!r&&o&&(e.focus(),h=!0);break;case"Enter":s.setFocus(),(0===s.activeColIdx||u)&&c.isExpandable()?(c.setExpanded(!c.isExpanded()),h=!0):e&&!r&&o&&(e.focus(),h=!0);break;case"Escape":s.setFocus(),c.log("keynav: focus tree..."),s.isCellNav()&&l!==NavModeEnum.cell&&(c.log("keynav: setCellNav(false)"),s.setCellNav(!1),s.setFocus(),h=!0);break;case"ArrowLeft":s.setFocus(),u&&c.isExpanded()?c.setExpanded(!1):!u&&s.activeColIdx>0?s.setColumn(s.activeColIdx-1):l!==NavModeEnum.cell&&s.setCellNav(!1),h=!0;break;case"ArrowRight":s.setFocus(),u&&!c.isExpanded()?c.setExpanded():!u&&s.activeColIdx0&&s.setColumn(0),h=!0;break;case"End":s.setFocus(),!u&&s.activeColIdx500&&(i.lastQuicksearchTerm=""),i.lastQuicksearchTime=e,i.lastQuicksearchTerm+=d;const s=i.findNextNode(i.lastQuicksearchTerm,i.getActiveNode());return s&&s.setActive(!0,{event:t}),void t.preventDefault()}switch(d){case"Enter":c.isActive()&&(c.isExpanded()?d="Subtract":c.isExpandable(!0)&&(d="Add"));break;case"ArrowLeft":c.expanded&&(d="Subtract");break;case"ArrowRight":if(!c.expanded&&c.isExpandable(!0))d="Add";else if(l===NavModeEnum.startCell||l===NavModeEnum.startRow)return t.preventDefault(),i.setCellNav(),!1}switch(d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":c.getOption("checkbox")?c.toggleSelected():c.setActive(!0,{event:t});break;case"Enter":c.setActive(!0,{event:t});break;case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"Backspace":case"End":case"Home":case"Control+End":case"Control+Home":case"Meta+ArrowDown":case"Meta+ArrowUp":case"PageDown":case"PageUp":c.navigate(d,{activate:n,event:t});break;default:h=!1}}else{const e=r?r.type||r.tagName:"",s=r&&"checkbox"!==e;if(o){if("Escape"===d)return c.logDebug("Reset focused input on Escape"),r.setCustomValidity(""),c._render(),i.setFocus(),void i.setColumn(i.activeColIdx);if("Enter"!==d)return r&&r.checkValidity&&!r.checkValidity()?(c.logDebug(`Ignored ${d} inside invalid input`),!1):void c.logDebug(`Ignored ${d} inside focused input`)}else if(r&&1===d.length&&s)return r.focus(),r.value="",c.logDebug(`Focus input: ${d}`),!1;switch("Tab"===d?(d="ArrowRight",h=!0):"Shift+Tab"===d&&(d=i.activeColIdx>0?"ArrowLeft":"",h=!0),d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":0===i.activeColIdx&&c.getOption("checkbox")?(c.toggleSelected(),h=!0):r&&"checkbox"===e&&(r.click(),h=!0);break;case"F2":r&&!o&&s&&(r.focus(),h=!0);break;case"Enter":i.setFocus(),(0===i.activeColIdx||u)&&c.isExpandable()?(c.setExpanded(!c.isExpanded()),h=!0):r&&!o&&s&&(r.focus(),h=!0);break;case"Escape":i.setFocus(),c.log("keynav: focus tree..."),i.isCellNav()&&l!==NavModeEnum.cell&&(c.log("keynav: setCellNav(false)"),i.setCellNav(!1),i.setFocus(),h=!0);break;case"ArrowLeft":i.setFocus(),u&&c.isExpanded()?c.setExpanded(!1):!u&&i.activeColIdx>0?i.setColumn(i.activeColIdx-1):l!==NavModeEnum.cell&&i.setCellNav(!1),h=!0;break;case"ArrowRight":i.setFocus(),u&&!c.isExpanded()?c.setExpanded():!u&&i.activeColIdx0&&i.setColumn(0),h=!0;break;case"End":i.setFocus(),!u&&i.activeColIdx=4){const t=this.ignoreEvents,s=this.prefix;overrideMethod(e,"callEvent",(function(i,n){if(t.has(i))return e._superApply(arguments);const r=Date.now(),o=e._superApply(arguments);return e.logDebug(`${s}: callEvent('${i}') took ${Date.now()-r} ms.`,arguments[1]),o}))}}onKeyEvent(e){this.tree.logDebug(`${this.prefix}: onKeyEvent()`,e)}} + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */class LoggerExtension extends WunderbaumExtension{constructor(e){super(e,"logger",{}),this.ignoreEvents=new Set(["iconBadge","render","discard"]),this.prefix=e+".ext-logger"}init(){const e=this.tree;if(e.getOption("debugLevel")>=4){const t=this.ignoreEvents,i=this.prefix;overrideMethod(e,"callEvent",(function(s,n){if(t.has(s))return e._superApply(arguments);const r=Date.now(),o=e._superApply(arguments);return e.logDebug(`${i}: callEvent('${s}') took ${Date.now()-r} ms.`,arguments[1]),o}))}}onKeyEvent(e){this.tree.logDebug(`${this.prefix}: onKeyEvent()`,e)}} /*! * Wunderbaum - common * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const DEFAULT_DEBUGLEVEL=3,ROW_HEIGHT=22,ICON_WIDTH=20,TITLE_SPAN_PAD_Y=7,RENDER_MAX_PREFETCH=5,TEST_IMG=new RegExp(/\.|\//),iconMaps={bootstrap:{error:"bi bi-exclamation-triangle",loading:"bi bi-chevron-right wb-busy",noData:"bi bi-question-circle",expanderExpanded:"bi bi-chevron-down",expanderCollapsed:"bi bi-chevron-right",expanderLazy:"bi bi-chevron-right wb-helper-lazy-expander",checkChecked:"bi bi-check-square",checkUnchecked:"bi bi-square",checkUnknown:"bi bi-dash-square-dotted",radioChecked:"bi bi-circle-fill",radioUnchecked:"bi bi-circle",radioUnknown:"bi bi-record-circle",folder:"bi bi-folder2",folderOpen:"bi bi-folder2-open",folderLazy:"bi bi-folder-symlink",doc:"bi bi-file-earmark"},fontawesome6:{error:"fa-solid fa-triangle-exclamation",loading:"fa-solid fa-chevron-right fa-beat",noData:"fa-solid fa-circle-question",expanderExpanded:"fa-solid fa-chevron-down",expanderCollapsed:"fa-solid fa-chevron-right",expanderLazy:"fa-solid fa-chevron-right wb-helper-lazy-expander",checkChecked:"fa-regular fa-square-check",checkUnchecked:"fa-regular fa-square",checkUnknown:"fa-regular fa-square-minus",radioChecked:"fa-solid fa-circle",radioUnchecked:"fa-regular fa-circle",radioUnknown:"fa-regular fa-circle-question",folder:"fa-solid fa-folder-closed",folderOpen:"fa-regular fa-folder-open",folderLazy:"fa-solid fa-folder-plus",doc:"fa-regular fa-file"}},RESERVED_TREE_SOURCE_KEYS=new Set(["_format","_keyMap","_positional","_typeList","_valueMap","_version","children","columns","types"]),KEY_TO_ACTION_DICT={" ":"toggleSelect","+":"expand",Add:"expand",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",Backspace:"parent","/":"collapseAll",Divide:"collapseAll",End:"lastCol",Home:"firstCol","Control+End":"last","Control+Home":"first","Meta+ArrowDown":"last","Meta+ArrowUp":"first","*":"expandAll",Multiply:"expandAll",PageDown:"pageDown",PageUp:"pageUp","-":"collapse",Subtract:"collapse"};function makeNodeTitleMatcher(e){return e instanceof RegExp?function(t){return e.test(t.title)}:(assert("string"==typeof e,`Expected a string or RegExp: ${e}`),function(t){return t.title===e})}function makeNodeTitleStartMatcher(e){e=escapeRegex(e);const t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function nodeTitleSorter(e,t){const s=e.title.toLowerCase(),i=t.title.toLowerCase();return s===i?0:s>i?1:-1}function unflattenSource(e){var t,s,i;const{_format:n,_keyMap:r={},_positional:o=[],children:l}=e;if("flat"!==n)throw new Error(`Expected source._format: "flat", but got ${n}`);if(o&&o.includes("children"))throw new Error(`source._positional must not include "children": ${o}`);let a=r;if(r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),a={};for(const[e,t]of Object.entries(r))a[t]=e}const d=o.map((e=>a[e])),c=[],h={},u={},p=null!==(t=a.key)&&void 0!==t?t:"key",f=null!==(s=a.children)&&void 0!==s?s:"children";for(const[e,t]of l.entries()){const[s,n,r={}]=t;t[1]=null,null!=t[2]&&(t[2]=null),n.forEach(((e,t)=>{r[d[t]]=e})),u[e]=r;const o=r[p];null!=o&&(h[o]=r);let l=null;if(null===s);else if("number"==typeof s){if(l=u[s],void 0===l)throw new Error(`unflattenSource: Could not find parent node by index: ${s}.`)}else if(l=h[s],void 0===l)throw new Error(`unflattenSource: Could not find parent node by key: ${s}`);l?(null!==(i=l[f])&&void 0!==i||(l[f]=[]),l[f].push(r)):c.push(r)}e.children=c}function decompressSourceData(e){let{_format:t,_version:s=1,_keyMap:i,_valueMap:n}=e;assert(1===s,`Expected file version 1 instead of ${s}`);let r=i,o={};if(r)for(const[e,t]of Object.entries(r))o[t]=e;if(r&&r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),[r,o]=[o,r]}if(null!=e._typeList){const t='source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.';if(null!=n)throw new Error(t);console.warn(t),n={type:e._typeList},delete e._typeList}"flat"===t&&unflattenSource(e),delete e._format,delete e._version,delete e._keyMap,delete e._valueMap,delete e._positional,(i||n)&&function e(t){for(const s of t)Object.getOwnPropertyNames(s).forEach((e=>{const t=s[e];let r=e;if(i&&null!=o[e]&&(r=o[e],r!==e&&(s[r]=t,delete s[e])),n&&"number"==typeof t&&null!=n[r]){const e=n[r][t];if(null==e)throw new Error(`Expected valueMap[${r}][${t}] entry in [${n[r]}]`);s[r]=e}})),s.children&&e(s.children)}(e.children)} + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const DEFAULT_DEBUGLEVEL=3,ROW_HEIGHT=22,ICON_WIDTH=20,TITLE_SPAN_PAD_Y=7,RENDER_MAX_PREFETCH=5,TEST_IMG=new RegExp(/\.|\//),iconMaps={bootstrap:{error:"bi bi-exclamation-triangle",loading:"bi bi-chevron-right wb-busy",noData:"bi bi-question-circle",expanderExpanded:"bi bi-chevron-down",expanderCollapsed:"bi bi-chevron-right",expanderLazy:"bi bi-chevron-right wb-helper-lazy-expander",checkChecked:"bi bi-check-square",checkUnchecked:"bi bi-square",checkUnknown:"bi bi-dash-square-dotted",radioChecked:"bi bi-circle-fill",radioUnchecked:"bi bi-circle",radioUnknown:"bi bi-record-circle",folder:"bi bi-folder2",folderOpen:"bi bi-folder2-open",folderLazy:"bi bi-folder-symlink",doc:"bi bi-file-earmark"},fontawesome6:{error:"fa-solid fa-triangle-exclamation",loading:"fa-solid fa-chevron-right fa-beat",noData:"fa-solid fa-circle-question",expanderExpanded:"fa-solid fa-chevron-down",expanderCollapsed:"fa-solid fa-chevron-right",expanderLazy:"fa-solid fa-chevron-right wb-helper-lazy-expander",checkChecked:"fa-regular fa-square-check",checkUnchecked:"fa-regular fa-square",checkUnknown:"fa-regular fa-square-minus",radioChecked:"fa-solid fa-circle",radioUnchecked:"fa-regular fa-circle",radioUnknown:"fa-regular fa-circle-question",folder:"fa-solid fa-folder-closed",folderOpen:"fa-regular fa-folder-open",folderLazy:"fa-solid fa-folder-plus",doc:"fa-regular fa-file"}},RESERVED_TREE_SOURCE_KEYS=new Set(["_format","_keyMap","_positional","_typeList","_valueMap","_version","children","columns","types"]),KEY_TO_ACTION_DICT={" ":"toggleSelect","+":"expand",Add:"expand",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",Backspace:"parent","/":"collapseAll",Divide:"collapseAll",End:"lastCol",Home:"firstCol","Control+End":"last","Control+Home":"first","Meta+ArrowDown":"last","Meta+ArrowUp":"first","*":"expandAll",Multiply:"expandAll",PageDown:"pageDown",PageUp:"pageUp","-":"collapse",Subtract:"collapse"};function makeNodeTitleMatcher(e){return e instanceof RegExp?function(t){return e.test(t.title)}:(assert("string"==typeof e,`Expected a string or RegExp: ${e}`),function(t){return t.title===e})}function makeNodeTitleStartMatcher(e){e=escapeRegex(e);const t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function nodeTitleSorter(e,t){const i=e.title.toLowerCase(),s=t.title.toLowerCase();return i===s?0:i>s?1:-1}function unflattenSource(e){var t,i,s;const{_format:n,_keyMap:r={},_positional:o=[],children:l}=e;if("flat"!==n)throw new Error(`Expected source._format: "flat", but got ${n}`);if(o&&o.includes("children"))throw new Error(`source._positional must not include "children": ${o}`);let a=r;if(r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),a={};for(const[e,t]of Object.entries(r))a[t]=e}const d=o.map((e=>a[e])),c=[],h={},u={},p=null!==(t=a.key)&&void 0!==t?t:"key",f=null!==(i=a.children)&&void 0!==i?i:"children";for(const[e,t]of l.entries()){const[i,n,r={}]=t;t[1]=null,null!=t[2]&&(t[2]=null),n.forEach(((e,t)=>{r[d[t]]=e})),u[e]=r;const o=r[p];null!=o&&(h[o]=r);let l=null;if(null===i);else if("number"==typeof i){if(l=u[i],void 0===l)throw new Error(`unflattenSource: Could not find parent node by index: ${i}.`)}else if(l=h[i],void 0===l)throw new Error(`unflattenSource: Could not find parent node by key: ${i}`);l?(null!==(s=l[f])&&void 0!==s||(l[f]=[]),l[f].push(r)):c.push(r)}e.children=c}function decompressSourceData(e){let{_format:t,_version:i=1,_keyMap:s,_valueMap:n}=e;assert(1===i,`Expected file version 1 instead of ${i}`);let r=s,o={};if(r)for(const[e,t]of Object.entries(r))o[t]=e;if(r&&r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),[r,o]=[o,r]}if(null!=e._typeList){const t='source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.';if(null!=n)throw new Error(t);console.warn(t),n={type:e._typeList},delete e._typeList}"flat"===t&&unflattenSource(e),delete e._format,delete e._version,delete e._keyMap,delete e._valueMap,delete e._positional,(s||n)&&function e(t){for(const i of t)Object.getOwnPropertyNames(i).forEach((e=>{const t=i[e];let r=e;if(s&&null!=o[e]&&(r=o[e],r!==e&&(i[r]=t,delete i[e])),n&&"number"==typeof t&&null!=n[r]){const e=n[r][t];if(null==e)throw new Error(`Expected valueMap[${r}][${t}] entry in [${n[r]}]`);i[r]=e}})),i.children&&e(i.children)}(e.children)} /*! * Wunderbaum - ext-dnd * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const nodeMimeType="application/x-wunderbaum-node";class DndExtension extends WunderbaumExtension{constructor(e){super(e,"dnd",{autoExpandMS:1500,multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",guessDropEffect:!0,preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,serializeClipboardData:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,sourceCopyHook:null,dragStart:null,drag:null,dragEnd:null,dragEnter:null,dragOver:null,dragExpand:null,drop:null,dragLeave:null}),this.srcNode=null,this.lastTargetNode=null,this.lastEnterStamp=0,this.lastAllowedDropRegions=null,this.lastDropEffect=null,this.lastDropRegion=!1,this.currentScrollDir=0,this.applyScrollDirThrottled=throttle(this._applyScrollDir,50)}init(){super.init();const e=this.tree,t=e.options.dnd;t.dragStart&&onEvent(e.element,"dragstart drag dragend",this.onDragEvent.bind(this)),t.dragEnter&&onEvent(e.element,"dragenter dragover dragleave drop",this.onDropEvent.bind(this))}_leaveNode(){const e=this.lastTargetNode;this.lastEnterStamp=0,e&&(e.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before",!1),this.lastTargetNode=null)}unifyDragover(e){if(!1===e)return!1;if(e instanceof Set)return e.size>0&&e;if(!0===e)return new Set(["over","before","after"]);if("string"==typeof e||isArray(e))return(e=toSet(e)).size>0&&e;throw new Error("Unsupported drop region definition: "+e)}_calcDropRegion(e,t){const s=e.offsetY;return!!t&&(3===t.size?s<5.5?"before":s>16.5?"after":"over":1===t.size&&t.has("over")?"over":s>11?"after":"before")}_guessDropEffect(e){var t;const s=this.treeOpts.dnd,i=null!==(t=s.effectAllowed)&&void 0!==t?t:"all",n=["all","copy","copyLink","copyMove"].includes(i),r=["all","link","copyLink","linkMove"].includes(i),o=["all","move","copyMove","linkMove"].includes(i);let l=s.dropEffectDefault;return s.guessDropEffect&&(isMac?(e.altKey&&n&&(l="copy"),e.metaKey&&o&&(l="move"),e.altKey&&e.metaKey&&r&&(l="link")):(e.ctrlKey&&n&&(l="copy"),e.shiftKey&&o&&(l="move"),e.altKey&&r&&(l="link"))),l}_isVoidDrop(e,t,s){return!(!this.treeOpts.dnd.preventVoidMoves||!t)&&("before"===s&&e===t.getNextSibling()||"after"===s&&e===t.getPrevSibling()||(t===e||t.parent===e))}_applyScrollDir(){if(this.isDragging()&&this.currentScrollDir){const e=this.tree.options.dnd,t=this.tree.element,s=t.scrollTop;this.currentScrollDir<0?t.scrollTop=Math.max(0,s-e.scrollSpeed):this.currentScrollDir>0&&(t.scrollTop=s+e.scrollSpeed)}}_autoScroll(e){const t=this.tree,s=t.options.dnd.scrollSensitivity,i=t.element,n=t.headerElement.clientHeight,r=i.offsetHeight,o=i.scrollTop;return this.currentScrollDir=0,o>0&&e>0&&e<=s+n?this.currentScrollDir=-1:o=r-s&&(this.currentScrollDir=1),this.currentScrollDir&&this.applyScrollDirThrottled(),i.scrollTop-o}isDragging(){return!!this.srcNode}onDragEvent(e){var t;const s=this.treeOpts.dnd,i=Wunderbaum.getNode(e);if(i){if(["dragstart","dragend"].includes(e.type)&&this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${i}`,e),"dragstart"===e.type){if(e.dataTransfer.effectAllowed=s.effectAllowed,i.isEditing())return i.logDebug("Prevented dragging node in edit mode."),e.preventDefault(),!1;if(!i._callEvent("dnd.dragStart",{event:e}))return e.preventDefault(),!1;const n=i.toDict(!0,(e=>{e._orgKey=e.key,delete e.key}));n._treeId=i.tree.id,s.serializeClipboardData&&("function"==typeof s.serializeClipboardData?e.dataTransfer.setData(nodeMimeType,s.serializeClipboardData(n,i)):e.dataTransfer.setData(nodeMimeType,JSON.stringify(n))),(null===(t=e.dataTransfer)||void 0===t?void 0:t.types.includes("text/plain"))||e.dataTransfer.setData("text/plain",i.title),this.srcNode=i,setTimeout((()=>{i.setClass("wb-drag-source")}),0)}else"drag"===e.type?s.drag&&i._callEvent("dnd.drag",{event:e}):"dragend"===e.type&&(i.setClass("wb-drag-source",!1),this.srcNode=null,this.lastTargetNode&&this._leaveNode(),i._callEvent("dnd.dragEnd",{event:e}));return!0}this.tree.logWarn(`onDragEvent.${e.type} no node`)}onDropEvent(e){var t;const s=this.srcNode,i=s?s.tree:null,n=Wunderbaum.getNode(e),r=this.treeOpts.dnd,o=e.dataTransfer,l=this._calcDropRegion(e,this.lastAllowedDropRegions);if(n){if(["drop"].includes(e.type)&&this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${n}, ea: ${null==o?void 0:o.effectAllowed}, de: ${null==o?void 0:o.dropEffect}, cy: ${e.offsetY}, r: ${l}, srcNode: ${s}`,e),"dragenter"===e.type){if(this.lastAllowedDropRegions=null,this.lastTargetNode&&this.lastTargetNode!==n&&this._leaveNode(),this.lastTargetNode=n,this.lastEnterStamp=Date.now(),n.isStatusNode()||r.preventForeignNodes&&n.tree!==i||r.preventLazyParents&&!n.isLoaded()||r.preventNonNodes&&!s||r.preventRecursion&&(null==s?void 0:s.isAncestorOf(n))||r.preventSameParent&&s&&n.parent===s.parent||r.preventVoidMoves&&n===s)return o.dropEffect="none",this.tree.log("Prevented drop operation"),!0;o.dropEffect=this._guessDropEffect(e)||"none";let t=n._callEvent("dnd.dragEnter",{event:e});return t=this.unifyDragover(t),t?(this.lastAllowedDropRegions=t,this.lastDropEffect=o.dropEffect,n.setClass("wb-drop-target"),e.preventDefault(),!1):(o.dropEffect="none",!0)}if("dragover"===e.type){const t=e.clientY-this.tree.element.offsetTop;this._autoScroll(t),o.dropEffect=this._guessDropEffect(e)||"none",n._callEvent("dnd.dragOver",{event:e});const i=this._calcDropRegion(e,this.lastAllowedDropRegions);if(this.lastDropRegion=i,this.lastDropEffect=o.dropEffect,r.autoExpandMS>0&&n.isExpandable(!0)&&!n._isLoading&&Date.now()-this.lastEnterStamp>r.autoExpandMS&&!1!==n._callEvent("dnd.dragExpand",{event:e})&&n.setExpanded(),!i||this._isVoidDrop(n,s,i))return;return n.setClass("wb-drop-over","over"===i),n.setClass("wb-drop-before","before"===i),n.setClass("wb-drop-after","after"===i),e.preventDefault(),!1}if("dragleave"===e.type)n._callEvent("dnd.dragLeave",{event:e});else if("drop"===e.type){e.stopPropagation(),e.preventDefault(),this._leaveNode();const s=this.lastDropRegion;let i=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData(nodeMimeType);i=i?JSON.parse(i):null;const r=this.srcNode,o=this.lastDropEffect;setTimeout((()=>{n._callEvent("dnd.drop",{event:e,region:s,suggestedDropMode:"over"===s?"appendChild":s,suggestedDropEffect:o,sourceNode:r,sourceNodeData:i})}),10)}return!1}this._leaveNode()}} + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const nodeMimeType="application/x-wunderbaum-node";class DndExtension extends WunderbaumExtension{constructor(e){super(e,"dnd",{autoExpandMS:1500,multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",guessDropEffect:!0,preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,serializeClipboardData:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,sourceCopyHook:null,dragStart:null,drag:null,dragEnd:null,dragEnter:null,dragOver:null,dragExpand:null,drop:null,dragLeave:null}),this.srcNode=null,this.lastTargetNode=null,this.lastEnterStamp=0,this.lastAllowedDropRegions=null,this.lastDropEffect=null,this.lastDropRegion=!1,this.currentScrollDir=0,this.applyScrollDirThrottled=throttle(this._applyScrollDir,50)}init(){super.init();const e=this.tree,t=e.options.dnd;t.dragStart&&onEvent(e.element,"dragstart drag dragend",this.onDragEvent.bind(this)),t.dragEnter&&onEvent(e.element,"dragenter dragover dragleave drop",this.onDropEvent.bind(this))}_leaveNode(){const e=this.lastTargetNode;this.lastEnterStamp=0,e&&(e.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before",!1),this.lastTargetNode=null)}unifyDragover(e){if(!1===e)return!1;if(e instanceof Set)return e.size>0&&e;if(!0===e)return new Set(["over","before","after"]);if("string"==typeof e||isArray(e))return(e=toSet(e)).size>0&&e;throw new Error("Unsupported drop region definition: "+e)}_calcDropRegion(e,t){const i=e.offsetY;return!!t&&(3===t.size?i<5.5?"before":i>16.5?"after":"over":1===t.size&&t.has("over")?"over":i>11?"after":"before")}_guessDropEffect(e){var t;const i=this.treeOpts.dnd,s=null!==(t=i.effectAllowed)&&void 0!==t?t:"all",n=["all","copy","copyLink","copyMove"].includes(s),r=["all","link","copyLink","linkMove"].includes(s),o=["all","move","copyMove","linkMove"].includes(s);let l=i.dropEffectDefault;return i.guessDropEffect&&(isMac?(e.altKey&&n&&(l="copy"),e.metaKey&&o&&(l="move"),e.altKey&&e.metaKey&&r&&(l="link")):(e.ctrlKey&&n&&(l="copy"),e.shiftKey&&o&&(l="move"),e.altKey&&r&&(l="link"))),l}_isVoidDrop(e,t,i){return!(!this.treeOpts.dnd.preventVoidMoves||!t)&&("before"===i&&e===t.getNextSibling()||"after"===i&&e===t.getPrevSibling()||(t===e||t.parent===e))}_applyScrollDir(){if(this.isDragging()&&this.currentScrollDir){const e=this.tree.options.dnd,t=this.tree.element,i=t.scrollTop;this.currentScrollDir<0?t.scrollTop=Math.max(0,i-e.scrollSpeed):this.currentScrollDir>0&&(t.scrollTop=i+e.scrollSpeed)}}_autoScroll(e){const t=this.tree,i=t.options.dnd.scrollSensitivity,s=t.element,n=t.headerElement.clientHeight,r=s.offsetHeight,o=s.scrollTop;return this.currentScrollDir=0,o>0&&e>0&&e<=i+n?this.currentScrollDir=-1:o=r-i&&(this.currentScrollDir=1),this.currentScrollDir&&this.applyScrollDirThrottled(),s.scrollTop-o}isDragging(){return!!this.srcNode}onDragEvent(e){var t;const i=this.treeOpts.dnd,s=Wunderbaum.getNode(e);if(s){if(["dragstart","dragend"].includes(e.type)&&this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${s}`,e),"dragstart"===e.type){if(e.dataTransfer.effectAllowed=i.effectAllowed,s.isEditingTitle())return s.logDebug("Prevented dragging node in edit mode."),e.preventDefault(),!1;if(!s._callEvent("dnd.dragStart",{event:e}))return e.preventDefault(),!1;const n=s.toDict(!0,(e=>{e._orgKey=e.key,delete e.key}));n._treeId=s.tree.id,i.serializeClipboardData&&("function"==typeof i.serializeClipboardData?e.dataTransfer.setData(nodeMimeType,i.serializeClipboardData(n,s)):e.dataTransfer.setData(nodeMimeType,JSON.stringify(n))),(null===(t=e.dataTransfer)||void 0===t?void 0:t.types.includes("text/plain"))||e.dataTransfer.setData("text/plain",s.title),this.srcNode=s,setTimeout((()=>{s.setClass("wb-drag-source")}),0)}else"drag"===e.type?i.drag&&s._callEvent("dnd.drag",{event:e}):"dragend"===e.type&&(s.setClass("wb-drag-source",!1),this.srcNode=null,this.lastTargetNode&&this._leaveNode(),s._callEvent("dnd.dragEnd",{event:e}));return!0}this.tree.logWarn(`onDragEvent.${e.type} no node`)}onDropEvent(e){var t;const i=this.srcNode,s=i?i.tree:null,n=Wunderbaum.getNode(e),r=this.treeOpts.dnd,o=e.dataTransfer,l=this._calcDropRegion(e,this.lastAllowedDropRegions);if(n){if(["drop"].includes(e.type)&&this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${n}, ea: ${null==o?void 0:o.effectAllowed}, de: ${null==o?void 0:o.dropEffect}, cy: ${e.offsetY}, r: ${l}, srcNode: ${i}`,e),"dragenter"===e.type){if(this.lastAllowedDropRegions=null,this.lastTargetNode&&this.lastTargetNode!==n&&this._leaveNode(),this.lastTargetNode=n,this.lastEnterStamp=Date.now(),n.isStatusNode()||r.preventForeignNodes&&n.tree!==s||r.preventLazyParents&&!n.isLoaded()||r.preventNonNodes&&!i||r.preventRecursion&&(null==i?void 0:i.isAncestorOf(n))||r.preventSameParent&&i&&n.parent===i.parent||r.preventVoidMoves&&n===i)return o.dropEffect="none",this.tree.log("Prevented drop operation"),!0;o.dropEffect=this._guessDropEffect(e)||"none";let t=n._callEvent("dnd.dragEnter",{event:e});return t=this.unifyDragover(t),t?(this.lastAllowedDropRegions=t,this.lastDropEffect=o.dropEffect,n.setClass("wb-drop-target"),e.preventDefault(),!1):(o.dropEffect="none",!0)}if("dragover"===e.type){const t=e.clientY-this.tree.element.offsetTop;this._autoScroll(t),o.dropEffect=this._guessDropEffect(e)||"none",n._callEvent("dnd.dragOver",{event:e});const s=this._calcDropRegion(e,this.lastAllowedDropRegions);if(this.lastDropRegion=s,this.lastDropEffect=o.dropEffect,r.autoExpandMS>0&&n.isExpandable(!0)&&!n._isLoading&&Date.now()-this.lastEnterStamp>r.autoExpandMS&&!1!==n._callEvent("dnd.dragExpand",{event:e})&&n.setExpanded(),!s||this._isVoidDrop(n,i,s))return;return n.setClass("wb-drop-over","over"===s),n.setClass("wb-drop-before","before"===s),n.setClass("wb-drop-after","after"===s),e.preventDefault(),!1}if("dragleave"===e.type)n._callEvent("dnd.dragLeave",{event:e});else if("drop"===e.type){e.stopPropagation(),e.preventDefault(),this._leaveNode();const i=this.lastDropRegion;let s=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData(nodeMimeType);s=s?JSON.parse(s):null;const r=this.srcNode,o=this.lastDropEffect;setTimeout((()=>{n._callEvent("dnd.drop",{event:e,region:i,suggestedDropMode:"over"===i?"appendChild":i,suggestedDropEffect:o,sourceNode:r,sourceNodeData:s})}),10)}return!1}this._leaveNode()}} /*! * Wunderbaum - drag_observer * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */class DragObserver{constructor(e){if(this.start={x:0,y:0,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1},this.dragElem=null,this.dragging=!1,this.events=["mousedown","mouseup","mousemove","keydown"],!e.root)throw new Error("Missing `root` option.");this.opts=Object.assign({thresh:5},e),this.root=e.root,this._handler=this.handleEvent.bind(this),this.events.forEach((e=>{this.root.addEventListener(e,this._handler)}))}disconnect(){this.events.forEach((e=>{this.root.removeEventListener(e,this._handler)}))}getDragElem(){return this.dragElem}isDragging(){return this.dragging}stopDrag(e){this.dragging&&this.opts.dragstop&&e&&(e.type="dragstop",this.opts.dragstop(e)),this.dragElem=null,this.dragging=!1}handleEvent(e){const t=e.type,s=this.opts,i={type:e.type,event:e,dragElem:this.dragElem,dx:e.pageX-this.start.x,dy:e.pageY-this.start.y,apply:void 0};switch(t){case"keydown":this.stopDrag(i);break;case"mousedown":if(this.dragElem){this.stopDrag(i);break}if(s.selector){let t=e.target;if(t.matches(s.selector))this.dragElem=t;else{if(t=t.closest(s.selector),!t)break;this.dragElem=t}}this.start.x=e.pageX,this.start.y=e.pageY,this.start.altKey=e.altKey,this.start.ctrlKey=e.ctrlKey,this.start.metaKey=e.metaKey,this.start.shiftKey=e.shiftKey;break;case"mousemove":if(!this.dragElem)break;if(!this.dragging){if(s.thresh){if(i.dx*i.dx+i.dy*i.dy{this.root.addEventListener(e,this._handler)}))}disconnect(){this.events.forEach((e=>{this.root.removeEventListener(e,this._handler)}))}getDragElem(){return this.dragElem}isDragging(){return this.dragging}stopDrag(e){this.dragging&&this.opts.dragstop&&e&&(e.type="dragstop",this.opts.dragstop(e)),this.dragElem=null,this.dragging=!1}handleEvent(e){const t=e.type,i=this.opts,s={type:e.type,event:e,dragElem:this.dragElem,dx:e.pageX-this.start.x,dy:e.pageY-this.start.y,apply:void 0};switch(t){case"keydown":this.stopDrag(s);break;case"mousedown":if(this.dragElem){this.stopDrag(s);break}if(i.selector){let t=e.target;if(t.matches(i.selector))this.dragElem=t;else{if(t=t.closest(i.selector),!t)break;this.dragElem=t}}this.start.x=e.pageX,this.start.y=e.pageY,this.start.altKey=e.altKey,this.start.ctrlKey=e.ctrlKey,this.start.metaKey=e.metaKey,this.start.shiftKey=e.shiftKey;break;case"mousemove":if(!this.dragElem)break;if(!this.dragging){if(i.thresh){if(s.dx*s.dx+s.dy*s.dythis.tree.element.contains(e.dragElem),drag:e=>this.handleDrag(e),dragstop:e=>this.handleDrag(e)})}init(){super.init()}handleDrag(e){const t=Wunderbaum.getEventInfo(e.event);this.tree.log(`${e.type}(${e.dx})`,e,t)}} /*! * Wunderbaum - deferred * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) */class Deferred{constructor(){this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){this._resolve(e)}reject(e){this._reject(e)}promise(){return this._promise}then(e){return this._promise.then(e)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}} /*! * Wunderbaum - wunderbaum_node * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const NODE_PROPS=new Set(["checkbox","classes","expanded","icon","iconTooltip","key","lazy","_partsel","radiogroup","refKey","selected","statusNodeType","title","tooltip","type","unselectable"]),NODE_DICT_PROPS=new Set(NODE_PROPS);NODE_DICT_PROPS.delete("_partsel"),NODE_DICT_PROPS.delete("unselectable");class WunderbaumNode{constructor(e,t,s){var i,n;this.refKey=void 0,this.children=null,this.classes=null,this.data={},this._isLoading=!1,this._requestId=0,this._errorInfo=null,this._partsel=!1,this._partload=!1,this.subMatchCount=0,this._rowIdx=0,this._rowElem=void 0,assert(!t||t.tree===e,`Invalid parent: ${t}`),assert(!s.children,"'children' not allowed here"),this.tree=e,this.parent=t,this.key=""+(null!==(i=s.key)&&void 0!==i?i:++WunderbaumNode.sequence),this.title=""+(null!==(n=s.title)&&void 0!==n?n:"<"+this.key+">"),null!=s.refKey&&(this.refKey=""+s.refKey),null!=s.type&&(this.type=""+s.type),this.expanded=!0===s.expanded,null!=s.icon&&(this.icon=s.icon),this.lazy=!0===s.lazy,null!=s.statusNodeType&&(this.statusNodeType=""+s.statusNodeType),null!=s.colspan&&(this.colspan=!!s.colspan),null!=s.checkbox&&(this.checkbox=!!s.checkbox),null!=s.radiogroup&&(this.radiogroup=!!s.radiogroup),this.selected=!0===s.selected,!0===s.unselectable&&(this.unselectable=!0),s.classes&&this.setClass(s.classes);for(const[e,t]of Object.entries(s))NODE_PROPS.has(e)||(this.data[e]=t);t&&!this.statusNodeType&&e._registerNode(this)}toString(){return`WunderbaumNode@${this.key}<'${this.title}'>`}*[Symbol.iterator](){const e=this.children;if(e)for(let t=0,s=e.length;t=0,`options.before must be a direct child of ${this}`),this.children.splice(e,0,...o)}else this.children=o;s.update(ChangeType.structure)}finally{s.enableUpdate(!0)}return o[0]}addNode(e,t="appendChild"){switch("over"===t&&(t="appendChild"),t){case"after":return this.parent.addChildren(e,{before:this.getNextSibling()});case"before":return this.parent.addChildren(e,{before:this});case"prependChild":return this.addChildren(e,{before:0});case"appendChild":return this.addChildren(e)}assert(!1,`Invalid mode: ${t}`)}applyCommand(e,t){return this.tree.applyCommand(e,this,t)}collapseSiblings(e){for(const t of this.parent.children)t!==this&&t.expanded&&t.setExpanded(!1,e)}setClass(e,t=!0){const s=toSet(e);if(t)null===this.classes&&(this.classes=new Set),s.forEach((e=>{var s;this.classes.add(e),null===(s=this._rowElem)||void 0===s||s.classList.toggle(e,t)}));else{if(null===this.classes)return;s.forEach((e=>{var s;this.classes.delete(e),null===(s=this._rowElem)||void 0===s||s.classList.toggle(e,t)})),0===this.classes.size&&(this.classes=null)}}async expandAll(e=!0,t){const s=this.tree,i=this.tree.options.minExpandLevel,{depth:n=99,loadLazy:r,force:o,keepActiveNodeVisible:l=!0}=null!=t?t:{},a={scrollIntoView:!1,force:o,loadLazy:r};const d=s.logTime(`${this}.expandAll(${e})`);try{s.enableUpdate(!1),await async function t(s,n){var l;if(0===n)return;const d=null==n?null:n-1,c=[];return null===(l=s.children)||void 0===l||l.forEach((s=>{if(e)if(!s.expanded&&(s.children||r&&s.lazy)){const e=s.setExpanded(!0,a);c.push(e),e.then((async()=>{await t(s,d)}))}else c.push(t(s,d));else(!i||o||s.getLevel()>i)&&s.setExpanded(!1,a),t(s,d)})),new Promise((e=>{Promise.all(c).then((()=>{e(!0)}))}))}(this,n)}finally{s.enableUpdate(!0),s.logTimeEnd(d)}s.activeNode&&l&&s.activeNode.scrollIntoView()}findAll(e){const t="function"==typeof e?e:makeNodeTitleMatcher(e),s=[];return this.visit((e=>{t(e)&&s.push(e)})),s}findDirectChild(e){const t=this.children;if(!t)return null;if("string"==typeof e){for(let s=0,i=t.length;s{if(t(e))return s=e,!1})),s}findRelatedNode(e,t=!1){return this.tree.findRelatedNode(this,e,t)}*format_iter(e,t){function s(e){const t=e.parent.children;return e===t[t.length-1]}null!=t||(t=[" "," | "," ╰─ "," ├─ "]),null!=e||(e=e=>""+e);const i=i=>{const n=[e(i)];n.unshift(t[s(i)?2:3]);let r=i.parent;for(;r&&r!==this;)n.unshift(t[s(r)?0:1]),r=r.parent;return n.join("")};yield e(this);for(const e of this)yield i(e)}format(e,t){const s=[];for(const i of this.format_iter(e,t))s.push(i);return s.join("\n")}getColElem(e){var t;"string"==typeof e&&(e=this.tree.columns.findIndex((t=>t.id===e)));const s=null===(t=this._rowElem)||void 0===t?void 0:t.querySelectorAll("span.wb-col");return s?s[e]:null}getFirstChild(){return this.children?this.children[0]:null}getLastChild(){return this.children?this.children[this.children.length-1]:null}getLevel(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}getNextSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t+1]||null}getParent(){return this.parent}getParentList(e=!1,t=!1){const s=[];let i=t?this:this.parent;for(;i;)(e||i.parent)&&s.unshift(i),i=i.parent;return s}getPath(e=!0,t="title",s="/"){let i;const n=[],r="function"==typeof t;return this.visitParents((e=>{e.parent&&(i=r?t(e):e[t],n.unshift(i))}),e),n.join(s)}getPrevSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t-1]||null}hasChildren(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)}hasClass(e){return!!this.classes&&this.classes.has(e)}isActive(){return this.tree.activeNode===this}isAncestorOf(e){return e&&e.isDescendantOf(this)}isChildOf(e){return e&&this.parent===e}isColspan(){return!!this.getOption("colspan")}isDescendantOf(e){if(!e||e.tree!==this.tree)return!1;let t=this.parent;for(;t;){if(t===e)return!0;t===t.parent&&error(`Recursive parent link: ${t}`),t=t.parent}return!1}isExpandable(e=!1){return!(e&&this.expanded||!1===this.children)&&(null==this.children?!!this.lazy:0!==this.children.length||!!this.tree.options.emptyChildListExpandable)}isEditing(){return this.tree._callMethod("edit.isEditingTitle",this)}isExpanded(){return!!this.expanded}isFirstSibling(){const e=this.parent;return!e||e.children[0]===this}isLastSibling(){const e=this.parent;return!e||e.children[e.children.length-1]===this}isLazy(){return!!this.lazy}isLoaded(){return!this.lazy||void 0!==this.hasChildren()}isLoading(){return this._isLoading}isPagingNode(){return"paging"===this.statusNodeType}isParentOf(e){return e&&e.parent===this}isPartload(){return!!this._partload}isPartsel(){return!this.selected&&!!this._partsel}isRadio(){return!!this.parent.radiogroup||"radio"===this.getOption("checkbox")}isRendered(){return!!this._rowElem}isRootNode(){return this.tree.root===this}isSelected(){return!!this.selected||!!this._partsel&&void 0}isStatusNode(){return!!this.statusNodeType}isTopLevel(){return this.tree.root===this.parent}isUnloaded(){return void 0===this.hasChildren()}isVisible(){const e="hide"===this.tree.filterMode,t=this.getParentList(!1,!1);if(e&&!this.match&&!this.subMatchCount)return!1;for(let e=0,s=t.length;es)return void this.logWarn(`Ignored load response #${s} because #${this._requestId} is pending.`);if(this.logDebug(`Received response for load request #${s}`),null===this.parent&&null!==i)return void this.logWarn("Lazy parent node was removed while loading: discarding response.");this.setStatus(NodeStatusType.ok);const r=Date.now();this._loadSourceObject(t),l=Date.now()-r}else{if("function"==typeof e.then){const s=t.logTime(`Resolve thenable ${e}`);e=await Promise.resolve(e),t.logTimeEnd(s)}this._loadSourceObject(e),l=Date.now()-n}}catch(t){throw this.logError("Error during load()",e,t),this._callEvent("error",{error:t}),this.setStatus(NodeStatusType.error,{message:""+t}),t}finally{this._requestId=0,r=Date.now()-n,t.options.debugLevel>=3&&t.logInfo(`Load source took ${r/1e3} seconds (transfer: ${o/1e3}s, processing: ${l/1e3}s)`)}}async loadLazy(e=!1){const t=this.expanded;if(assert(this.lazy,"load() requires a lazy node"),e||this.isUnloaded()){this.isLoaded()&&this.resetLazy(),this.setStatus(NodeStatusType.loading);try{const e=await this._callEvent("lazyLoad");if(!1===e)return void this.setStatus(NodeStatusType.ok);assert(isArray(e)||e&&e.url,"The lazyLoad event must return a node list, `{url: ...}`, or false."),await this.load(e),this.setStatus(NodeStatusType.ok),t?(this.expanded=!0,this.tree.update(ChangeType.structure)):this.update()}catch(e){this.logError("Error during loadLazy()",e),this._callEvent("error",{error:e}),this.setStatus(NodeStatusType.error,{message:""+e})}}}log(...e){this.logDebug(...e)}logDebug(...e){this.tree.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.tree.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.tree.options.debugLevel>=3&&console.info(this.toString(),...e)}logWarn(...e){this.tree.options.debugLevel>=2&&console.warn(this.toString(),...e)}async makeVisible(e){let t;const s=new Deferred,i=[],n=this.getParentList(!1,!1),r=n.length,o=getOption(e,"noAnimation",!1),l=getOption(e,"scrollIntoView",!0);for(t=r-1;t>=0;t--){const e={noAnimation:o};i.push(n[t].setExpanded(!0,e))}return Promise.all(i).then((()=>{l&&this.tree?(this.tree.updatePendingModifications(),this.scrollIntoView().then((()=>{s.resolve()}))):s.resolve()})),s.promise()}moveTo(e,t="appendChild",s){let i;"over"===t&&(t="appendChild"),"prependChild"===t&&(e.children&&e.children.length?(t="before",e=e.children[0]):t="appendChild");const n=this.tree,r=this.parent,o="appendChild"===t?e:e.parent;if(this!==e){if(this.parent?o.isDescendantOf(this)&&error("Cannot move a node to its own descendant"):error("Cannot move system root"),o!==r&&r.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===o)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else i=this.parent.children.indexOf(this),assert(i>=0,"invalid source parent"),this.parent.children.splice(i,1);if(this.parent=o,o.hasChildren())switch(t){case"appendChild":o.children.push(this);break;case"before":i=o.children.indexOf(e),assert(i>=0,"invalid target parent"),o.children.splice(i,0,this);break;case"after":i=o.children.indexOf(e),assert(i>=0,"invalid target parent"),o.children.splice(i+1,0,this);break;default:error(`Invalid mode '${t}'.`)}else o.children=[this];s&&e.visit(s,!0),o===r?o.triggerModifyChild("move",this):o.triggerModifyChild("add",this),n!==e.tree&&(this.logWarn("Cross-tree moveTo is experimental!"),this.visit((t=>{t.tree=e.tree}),!0)),setTimeout((()=>{n.update(ChangeType.any)}),0)}}async navigate(e,t){e=KEY_TO_ACTION_DICT[e]||e;const s=this.findRelatedNode(e);if(!s)return this.logWarn(`Could not find related node '${e}'.`),Promise.resolve(this);try{s.makeVisible({scrollIntoView:!1})}catch(e){}return s.setFocus(),!1===(null==t?void 0:t.activate)?Promise.resolve(this):s.setActive(!0,{event:null==t?void 0:t.event})}remove(){const e=this.tree,t=this.parent.children.indexOf(this);this.triggerModify("remove"),this.parent.children.splice(t,1),this.visit((t=>{t.removeMarkup(),e._unregisterNode(t)}),!0),e.update(ChangeType.structure)}removeChildren(){const e=this.tree;this.children&&(e.activeNode&&e.activeNode.isDescendantOf(this)&&e.activeNode.setActive(!1),e.focusNode&&e.focusNode.isDescendantOf(this)&&(e.focusNode=null),this.triggerModifyChild("remove",null),this.visit((t=>{e._unregisterNode(t)})),this.lazy?this.children=[]:this.children=null,this.isRootNode()||(this.expanded=!1),this.tree.update(ChangeType.structure))}removeMarkup(){this._rowElem&&(delete this._rowElem._wb_node,this._rowElem.remove(),this._rowElem=void 0)}_getRenderInfo(){const e={},t={},s=this.isColspan(),i=this._rowElem?this._rowElem.querySelectorAll("span.wb-col"):null;let n=0;for(const r of this.tree.columns)e[r.id]={id:r.id,idx:n,elem:i?i[n]:null,info:r},s||"*"===r.id||(t[r.id]=e[r.id]),n++;return{allColInfosById:e,renderColInfosById:t}}_createIcon(e,t,s,i){let n,r=this.getOption("icon");if(this._errorInfo?r=e.error:this._isLoading&&i&&(r=e.loading),!1===r)return null;"string"==typeof r||(r=this.statusNodeType?e[this.statusNodeType]:this.expanded?e.folderOpen:this.children?e.folder:this.lazy?e.folderLazy:e.doc),r?r.indexOf("<")>=0?n=elemFromHtml(r):TEST_IMG.test(r)?n=elemFromHtml(``):(n=document.createElement("i"),n.className="wb-icon "+r):(n=document.createElement("i"),n.className="wb-icon"),s?t.replaceChild(n,s):t.appendChild(n);const o=this._callEvent("iconBadge",{iconSpan:n});let l=null;if(null!=o&&!1!==o){let e="",t="";isPlainObject(o)?(l=""+o.badge,e=o.badgeClass?" "+o.badgeClass:"",t=o.badgeTooltip?` title="${o.badgeTooltip}"`:""):l="number"==typeof o?""+o:o,"string"==typeof l&&(l=elemFromHtml(`${escapeHtml(l)}`)),l&&n.append(l)}return n}_render_markup(e){const t=this.tree,s=t.options,i=this.getOption("checkbox"),n=t.columns,r=this.getLevel(),o=t.isRowNav()?null:t.activeColIdx;let l,a=this._rowElem,d=null,c=null;const h=!a;assert(h,"Expected unrendered node"),assert(!h||e&&e.after,"opts.after expected, unless updating"),assert(!this.isRootNode(),"Root node not allowed"),a=document.createElement("div"),a.classList.add("wb-row"),a.style.top=22*this._rowIdx+"px",this._rowElem=a,a._wb_node=this;const u=document.createElement("span");u.classList.add("wb-node","wb-col"),a.appendChild(u);let p=0;i&&(d=document.createElement("i"),d.classList.add("wb-checkbox"),("radio"===i||this.parent.radiogroup)&&d.classList.add("wb-radio"),u.appendChild(d),p+=20);for(let e=r-1;e>0;e--)l=document.createElement("i"),l.classList.add("wb-indent"),u.appendChild(l),p+=20;(!s.minExpandLevel||r>s.minExpandLevel)&&(c=document.createElement("i"),c.classList.add("wb-expander"),u.appendChild(c),p+=20);this._createIcon(t.iconMap,u,null,!c)&&(p+=20);const f=document.createElement("span");f.classList.add("wb-title"),u.appendChild(f),u._ofsTitlePx=p,t.options.dnd.dragStart&&(u.draggable=!0);if(!this.isColspan()&&n.length>1){let e=0;for(const t of n){let s;e++,"*"===t.id?s=u:(s=document.createElement("span"),s.classList.add("wb-col"),a.appendChild(s)),e===o&&s.classList.add("wb-active"),t.classes&&s.classList.add(...t.classes.split(" ")),s.style.left=t._ofsPx+"px",s.style.width=t._widthPx+"px",h&&t.html&&"string"==typeof t.html&&(s.innerHTML=t.html)}}switch(e?e.after:"last"){case"first":t.nodeListElement.prepend(a);break;case"last":t.nodeListElement.appendChild(a);break;default:e.after.after(a)}e.isNew=!0,this._render_data(e)}_render_data(e){assert(this._rowElem,"No _rowElem");const t=this.tree,s=t.options,i=this._rowElem,n=!!e.isNew,r=!!e.preventScroll,o=t.columns,l=this.isColspan(),a=i.querySelector("span.wb-node"),d=a.querySelector("span.wb-title"),c=t.element.scrollTop;if(this.titleWithHighlight?d.innerHTML=this.titleWithHighlight:d.textContent=this.title,r&&(t.element.scrollTop=c),!s.skeleton)if(l){const e=t.element.clientWidth;d.style.width=e-a._ofsTitlePx-7+"px"}else d.style.width=o[0]._widthPx-a._ofsTitlePx-7+"px";if(e.isDataChange=!0,this._render_status(e),this.statusNodeType)this._callEvent("renderStatusNode",{isNew:n,nodeElem:a,isColspan:l});else if(this.parent){const e=this._getRenderInfo();this._callEvent("render",{isNew:n,nodeElem:a,isColspan:l,allColInfosById:e.allColInfosById,renderColInfosById:e.renderColInfosById})}}_render_status(e){const t=this.tree,s=t.iconMap,i=t.options,n=this.type?t.types[this.type]:null,r=this._rowElem,o=r.querySelector("span.wb-node"),l=o.querySelector("i.wb-expander"),a=o.querySelector("i.wb-checkbox"),d=["wb-row"];if(this.expanded&&d.push("wb-expanded"),this.lazy&&d.push("wb-lazy"),this.selected&&d.push("wb-selected"),this._partsel&&d.push("wb-partsel"),this===t.activeNode&&d.push("wb-active"),this===t.focusNode&&d.push("wb-focus"),this._errorInfo&&d.push("wb-error"),this._isLoading&&d.push("wb-loading"),this.isColspan()&&d.push("wb-colspan"),this.statusNodeType&&d.push("wb-status-"+this.statusNodeType),this.match&&d.push("wb-match"),this.subMatchCount&&d.push("wb-submatch"),i.skeleton&&d.push("wb-skeleton"),r.className=d.join(" "),this.classes&&r.classList.add(...this.classes),n&&n.classes&&r.classList.add(...n.classes),l){let e=null;this._isLoading?e=s.loading:this.isExpandable(!1)?e=this.expanded?s.expanderExpanded:s.expanderCollapsed:this.lazy&&null==this.children&&(e=s.expanderLazy),null==e?l.classList.add("wb-indent"):TEST_IMG.test(e)?l.style.backgroundImage=`url('${e}')`:l.className="wb-expander "+e}if(a){let e="wb-checkbox ";this.isRadio()?(e+="wb-radio ",this.selected?e+=s.radioChecked:e+=s.radioUnchecked):this.selected?e+=s.checkChecked:this._partsel?e+=s.checkUnknown:e+=s.checkUnchecked,a.className=e}if(!e.isNew){let e=0;for(const s of r.children)s.classList.toggle("wb-active",e++===t.activeColIdx);const s=o.querySelector("i.wb-icon");s&&this._createIcon(t.iconMap,o,s,!l)}if(!1!==e.resizeCols&&!this.isColspan()){const e=r.querySelectorAll("span.wb-col");let t=0,s=0;for(const i of this.tree.columns){const n=e[t];n.style.left=`${s}px`,n.style.width=`${i._widthPx}px`,t++,s+=i._widthPx}}}_render(e){const t=Object.assign({change:ChangeType.data},e);switch(this._rowElem||(t.change=ChangeType.row),t.change){case"status":this._render_status(t);break;case"data":this._render_data(t);break;case"row":this._render_markup(t);break;default:error(`Invalid change type '${t.change}'.`)}}resetLazy(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=null,this.tree.update(ChangeType.structure)}toDict(e=!1,t){const s={};if(NODE_DICT_PROPS.forEach((e=>{const t=this[e];t instanceof Set?t.size&&(s[e]=Array.prototype.join.call(t.keys()," ")):(t||!1===t||0===t)&&(s[e]=t)})),isEmptyObject(this.data)||(s.data=extend({},this.data),isEmptyObject(s.data)&&delete s.data),t){const i=t(s,this);if(!1===i)return!1;"skip"===i&&(e=!1)}if(e&&isArray(this.children)){s.children=[];for(let e=0,i=this.children.length;e=0&&([i,e]=e.split("."));const n=i[e];if("function"==typeof n){const e=n.call(s,{type:"resolve",tree:s,node:this});if(void 0!==e)return e}if(void 0!==this[e])return this[e];const r=this.type?s.types[this.type]:void 0,o=r?r[e]:void 0;return void 0!==o?o:null!=n?n:t}async scrollIntoView(e){const t=Object.assign({node:this},e);return this.tree.scrollTo(t)}async setActive(e=!0,t){const s=this.tree,i=s.activeNode,n=null==t?void 0:t.retrigger,r=null==t?void 0:t.focusTree,o=!1!==(null==t?void 0:t.focusNode),l=null==t?void 0:t.noEvents,a=null==t?void 0:t.event;if(!l)if(e){if(i!==this||n){if(!1===(null==i?void 0:i._callEvent("deactivate",{nextNode:this,event:a}))||!1===this._callEvent("beforeActivate",{prevNode:i,event:a}))return;s.activeNode=null,null==i||i.update(ChangeType.status)}}else(i===this||n)&&this._callEvent("deactivate",{nextNode:null,event:a});return i!==this&&(e&&(s.activeNode=this,(o||r)&&(s.focusNode=this),r&&s.setFocus()),null==i||i.update(ChangeType.status),this.update(ChangeType.status)),t&&null!=t.colIdx&&t.colIdx!==s.activeColIdx&&s.isCellNav()&&s.setColumn(t.colIdx),e&&!l&&this._callEvent("activate",{prevNode:i,event:a}),this.makeVisible()}async setExpanded(e=!0,t){const{force:s,scrollIntoView:i,immediate:n}=null!=t?t:{};if(!e&&this.isExpanded()&&this.getLevel()<=this.tree.getOption("minExpandLevel")&&!s)return void this.logDebug("Ignored collapse request below expandLevel.");if(!e==!this.expanded)return;e&&this.getOption("autoCollapse")&&this.collapseSiblings(t),e&&this.lazy&&null==this.children&&await this.loadLazy(),this.expanded=e;const r={immediate:n};if(this.tree.update(ChangeType.structure,r),e&&i){const e=this.getLastChild();e&&(this.tree.updatePendingModifications(),e.scrollIntoView({topNode:this}))}}setFocus(e=!0){assert(!!e,"blur is not yet implemented");const t=this.tree.focusNode;this.tree.focusNode=this,null==t||t.update(),this.update()}setIcon(e){this.icon=e,this.update()}setKey(e,t){throw new Error("Not yet implemented")}update(e=ChangeType.data){assert(e===ChangeType.status||e===ChangeType.data,`Invalid change type ${e}`),this.tree.update(e,this)}getSelectedNodes(e=!1){const t=[];return this.visit((s=>{if(s.selected&&(t.push(s),!0===e))return"skip"})),t}toggleSelected(e){let t=this.isSelected();return t=void 0!==t||this.isRadio()?!t:this._anySelectable(),this.setSelected(t,e)}_anySelectable(){let e=!1;return this.visit((t=>{if(!1===t.selected&&!t.unselectable&&!t.hasChildren()&&!t.parent.radiogroup)return e=!0,!1})),e}_changeSelectStatusProps(e){let t=!1;switch(e){case!1:t=this.selected||this._partsel,this.selected=!1,this._partsel=!1;break;case!0:t=!this.selected||!this._partsel,this.selected=!0,this._partsel=!0;break;case void 0:t=this.selected||!this._partsel,this.selected=!1,this._partsel=!0;break;default:error(`Invalid state: ${e}`)}return t&&this.update(),t}fixSelection3AfterClick(e){const t=!!(null==e?void 0:e.force),s=this.isSelected();this.visit((e=>{if(e.radiogroup)return"skip";!t&&e.getOption("unselectable")||e._changeSelectStatusProps(s)})),this.fixSelection3FromEndNodes()}fixSelection3FromEndNodes(e){const t=!!(null==e?void 0:e.force);assert("hier"===this.tree.options.selectMode,"expected selectMode 'hier'");const s=e=>{let i;const n=e.children;if(n&&n.length){let e=!0,t=!1;for(let i=0,r=n.length;i{let t;const s=e.children;let i=!0,n=!1;for(let e=0,r=s.length;e{this.visit((t=>{t.setSelected(e)}))})),n):(e===n||i&&!1===this._callEvent("beforeSelect",{flag:e})||(s.runWithDeferredUpdate((()=>{if(r){if(!e&&!(null==t?void 0:t.force))return n;for(const e of this.parent.children)e.selected=e===this}else this.selected=e,"hier"===o?this.fixSelection3AfterClick():"single"===o&&s.visit((e=>{e.selected=!1}))})),i&&this._callEvent("select",{flag:e})),n):n}setStatus(e,t){const s=this.tree,i=null==t?void 0:t.message,n=null==t?void 0:t.details;let r=null;const o=e=>{const t=this.children,i=t?t[0]:null;return assert(e.statusNodeType,"Not a status node"),assert(!i||!i.isStatusNode(),"Child must not be a status node"),r=this.addNode(e,"prependChild"),r.match=!0,s.update(ChangeType.structure),r};switch((()=>{const e=this.children;e&&e.length&&e[0].isStatusNode()&&e[0].remove()})(),e){case"ok":this._isLoading=!1,this._errorInfo=null;break;case"loading":this._isLoading=!0,this._errorInfo=null,this.parent?this.update(ChangeType.status):o({statusNodeType:e,title:s.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,colspan:!0,tooltip:n});break;case"error":o({statusNodeType:e,title:s.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo={message:i,details:n};break;case"noData":o({statusNodeType:e,title:i||s.options.strings.noData,checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo=null;break;default:error("invalid node status "+e)}return s.update(ChangeType.structure),r}setTitle(e){this.title=e,this.update()}_sortChildren(e,t){const s=this.children;if(s&&(s.sort(e),t))for(let i=0,n=s.length;i"),null!=i.refKey&&(this.refKey=""+i.refKey),null!=i.type&&(this.type=""+i.type),this.expanded=!0===i.expanded,null!=i.icon&&(this.icon=i.icon),this.lazy=!0===i.lazy,null!=i.statusNodeType&&(this.statusNodeType=""+i.statusNodeType),null!=i.colspan&&(this.colspan=!!i.colspan),null!=i.checkbox&&(this.checkbox=!!i.checkbox),null!=i.radiogroup&&(this.radiogroup=!!i.radiogroup),this.selected=!0===i.selected,!0===i.unselectable&&(this.unselectable=!0),i.classes&&this.setClass(i.classes);for(const[e,t]of Object.entries(i))NODE_PROPS.has(e)||(this.data[e]=t);t&&!this.statusNodeType&&e._registerNode(this)}toString(){return`WunderbaumNode@${this.key}<'${this.title}'>`}*[Symbol.iterator](){const e=this.children;if(e)for(let t=0,i=e.length;t=0,`options.before must be a direct child of ${this}`),this.children.splice(e,0,...o)}else this.children=o;i.update(ChangeType.structure)}finally{i.enableUpdate(!0)}return o[0]}addNode(e,t="appendChild"){switch("over"===t&&(t="appendChild"),t){case"after":return this.parent.addChildren(e,{before:this.getNextSibling()});case"before":return this.parent.addChildren(e,{before:this});case"prependChild":return this.addChildren(e,{before:0});case"appendChild":return this.addChildren(e)}assert(!1,`Invalid mode: ${t}`)}applyCommand(e,t){return this.tree.applyCommand(e,this,t)}collapseSiblings(e){for(const t of this.parent.children)t!==this&&t.expanded&&t.setExpanded(!1,e)}setClass(e,t=!0){const i=toSet(e);if(t)null===this.classes&&(this.classes=new Set),i.forEach((e=>{var i;this.classes.add(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)}));else{if(null===this.classes)return;i.forEach((e=>{var i;this.classes.delete(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)})),0===this.classes.size&&(this.classes=null)}}startEditTitle(){this.tree._callMethod("edit.startEditTitle",this)}async expandAll(e=!0,t){const i=this.tree,s=this.tree.options.minExpandLevel,{depth:n=99,loadLazy:r,force:o,keepActiveNodeVisible:l=!0}=null!=t?t:{},a={scrollIntoView:!1,force:o,loadLazy:r};const d=i.logTime(`${this}.expandAll(${e})`);try{i.enableUpdate(!1),await async function t(i,n){var l;if(0===n)return;const d=null==n?null:n-1,c=[];return null===(l=i.children)||void 0===l||l.forEach((i=>{if(e)if(!i.expanded&&(i.children||r&&i.lazy)){const e=i.setExpanded(!0,a);c.push(e),e.then((async()=>{await t(i,d)}))}else c.push(t(i,d));else(!s||o||i.getLevel()>s)&&i.setExpanded(!1,a),t(i,d)})),new Promise((e=>{Promise.all(c).then((()=>{e(!0)}))}))}(this,n)}finally{i.enableUpdate(!0),i.logTimeEnd(d)}i.activeNode&&l&&i.activeNode.scrollIntoView()}findAll(e){const t="function"==typeof e?e:makeNodeTitleMatcher(e),i=[];return this.visit((e=>{t(e)&&i.push(e)})),i}findDirectChild(e){const t=this.children;if(!t)return null;if("string"==typeof e){for(let i=0,s=t.length;i{if(t(e))return i=e,!1})),i}findRelatedNode(e,t=!1){return this.tree.findRelatedNode(this,e,t)}*format_iter(e,t){function i(e){const t=e.parent.children;return e===t[t.length-1]}null!=t||(t=[" "," | "," ╰─ "," ├─ "]),null!=e||(e=e=>""+e);const s=s=>{const n=[e(s)];n.unshift(t[i(s)?2:3]);let r=s.parent;for(;r&&r!==this;)n.unshift(t[i(r)?0:1]),r=r.parent;return n.join("")};yield e(this);for(const e of this)yield s(e)}format(e,t){const i=[];for(const s of this.format_iter(e,t))i.push(s);return i.join("\n")}getColElem(e){var t;"string"==typeof e&&(e=this.tree.columns.findIndex((t=>t.id===e)));const i=null===(t=this._rowElem)||void 0===t?void 0:t.querySelectorAll("span.wb-col");return i?i[e]:null}getCloneList(e=!1){if(!this.refKey)return[];const t=this.tree.findByRefKey(this.refKey);return e?t:[...t].filter((e=>e!==this))}getFirstChild(){return this.children?this.children[0]:null}getLastChild(){return this.children?this.children[this.children.length-1]:null}getLevel(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}getNextSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t+1]||null}getParent(){return this.parent}getParentList(e=!1,t=!1){const i=[];let s=t?this:this.parent;for(;s;)(e||s.parent)&&i.unshift(s),s=s.parent;return i}getPath(e=!0,t="title",i="/"){let s;const n=[],r="function"==typeof t;return this.visitParents((e=>{e.parent&&(s=r?t(e):e[t],n.unshift(s))}),e),n.join(i)}getPrevSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t-1]||null}hasChildren(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)}hasClass(e){return!!this.classes&&this.classes.has(e)}isActive(){return this.tree.activeNode===this}isAncestorOf(e){return e&&e.isDescendantOf(this)}isChildOf(e){return e&&this.parent===e}isClone(){return!!this.refKey&&this.tree.findByRefKey(this.refKey).length>1}isColspan(){return!!this.getOption("colspan")}isDescendantOf(e){if(!e||e.tree!==this.tree)return!1;let t=this.parent;for(;t;){if(t===e)return!0;t===t.parent&&error(`Recursive parent link: ${t}`),t=t.parent}return!1}isExpandable(e=!1){return!(e&&this.expanded||!1===this.children)&&(null==this.children?!!this.lazy:0!==this.children.length||!!this.tree.options.emptyChildListExpandable)}isEditingTitle(){return this.tree._callMethod("edit.isEditingTitle",this)}isExpanded(){return!!this.expanded}isFirstSibling(){const e=this.parent;return!e||e.children[0]===this}isLastSibling(){const e=this.parent;return!e||e.children[e.children.length-1]===this}isLazy(){return!!this.lazy}isLoaded(){return!this.lazy||void 0!==this.hasChildren()}isLoading(){return this._isLoading}isPagingNode(){return"paging"===this.statusNodeType}isParentOf(e){return e&&e.parent===this}isPartload(){return!!this._partload}isPartsel(){return!this.selected&&!!this._partsel}isRadio(){return!!this.parent.radiogroup||"radio"===this.getOption("checkbox")}isRendered(){return!!this._rowElem}isRootNode(){return this.tree.root===this}isSelected(){return!!this.selected||!!this._partsel&&void 0}isStatusNode(){return!!this.statusNodeType}isTopLevel(){return this.tree.root===this.parent}isUnloaded(){return void 0===this.hasChildren()}isVisible(){const e="hide"===this.tree.filterMode,t=this.getParentList(!1,!1);if(e&&!this.match&&!this.subMatchCount)return!1;for(let e=0,i=t.length;ei)return void this.logWarn(`Ignored load response #${i} because #${this._requestId} is pending.`);if(this.logDebug(`Received response for load request #${i}`),null===this.parent&&null!==s)return void this.logWarn("Lazy parent node was removed while loading: discarding response.");this.setStatus(NodeStatusType.ok);const r=Date.now();this._loadSourceObject(t),l=Date.now()-r}else{if("function"==typeof e.then){const i=t.logTime(`Resolve thenable ${e}`);e=await Promise.resolve(e),t.logTimeEnd(i)}this._loadSourceObject(e),l=Date.now()-n}}catch(t){throw this.logError("Error during load()",e,t),this._callEvent("error",{error:t}),this.setStatus(NodeStatusType.error,{message:""+t}),t}finally{this._requestId=0,r=Date.now()-n,t.options.debugLevel>=3&&t.logInfo(`Load source took ${r/1e3} seconds (transfer: ${o/1e3}s, processing: ${l/1e3}s)`)}}async loadLazy(e=!1){const t=this.expanded;if(assert(this.lazy,"load() requires a lazy node"),e||this.isUnloaded()){this.isLoaded()&&this.resetLazy(),this.setStatus(NodeStatusType.loading);try{const e=await this._callEvent("lazyLoad");if(!1===e)return void this.setStatus(NodeStatusType.ok);assert(isArray(e)||e&&e.url,"The lazyLoad event must return a node list, `{url: ...}`, or false."),await this.load(e),this.setStatus(NodeStatusType.ok),t?(this.expanded=!0,this.tree.update(ChangeType.structure)):this.update()}catch(e){this.logError("Error during loadLazy()",e),this._callEvent("error",{error:e}),this.setStatus(NodeStatusType.error,{message:""+e})}}}log(...e){this.logDebug(...e)}logDebug(...e){this.tree.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.tree.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.tree.options.debugLevel>=3&&console.info(this.toString(),...e)}logWarn(...e){this.tree.options.debugLevel>=2&&console.warn(this.toString(),...e)}async makeVisible(e){let t;const i=new Deferred,s=[],n=this.getParentList(!1,!1),r=n.length,o=getOption(e,"noAnimation",!1),l=getOption(e,"scrollIntoView",!0);for(t=r-1;t>=0;t--){const e={noAnimation:o};s.push(n[t].setExpanded(!0,e))}return Promise.all(s).then((()=>{l&&this.tree?(this.tree.updatePendingModifications(),this.scrollIntoView().then((()=>{i.resolve()}))):i.resolve()})),i.promise()}moveTo(e,t="appendChild",i){let s;"over"===t&&(t="appendChild"),"prependChild"===t&&(e.children&&e.children.length?(t="before",e=e.children[0]):t="appendChild");const n=this.tree,r=this.parent,o="appendChild"===t?e:e.parent;if(this!==e){if(this.parent?o.isDescendantOf(this)&&error("Cannot move a node to its own descendant"):error("Cannot move system root"),o!==r&&r.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===o)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else s=this.parent.children.indexOf(this),assert(s>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=o,o.hasChildren())switch(t){case"appendChild":o.children.push(this);break;case"before":s=o.children.indexOf(e),assert(s>=0,"invalid target parent"),o.children.splice(s,0,this);break;case"after":s=o.children.indexOf(e),assert(s>=0,"invalid target parent"),o.children.splice(s+1,0,this);break;default:error(`Invalid mode '${t}'.`)}else o.children=[this];i&&e.visit(i,!0),o===r?o.triggerModifyChild("move",this):o.triggerModifyChild("add",this),n!==e.tree&&(this.logWarn("Cross-tree moveTo is experimental!"),this.visit((t=>{t.tree=e.tree}),!0)),setTimeout((()=>{n.update(ChangeType.any)}),0)}}async navigate(e,t){e=KEY_TO_ACTION_DICT[e]||e;const i=this.findRelatedNode(e);if(!i)return this.logWarn(`Could not find related node '${e}'.`),Promise.resolve(this);try{i.makeVisible({scrollIntoView:!1})}catch(e){}return i.setFocus(),!1===(null==t?void 0:t.activate)?Promise.resolve(this):i.setActive(!0,{event:null==t?void 0:t.event})}remove(){const e=this.tree,t=this.parent.children.indexOf(this);this.triggerModify("remove"),this.parent.children.splice(t,1),this.visit((t=>{t.removeMarkup(),e._unregisterNode(t)}),!0),e.update(ChangeType.structure)}removeChildren(){const e=this.tree;this.children&&(e.activeNode&&e.activeNode.isDescendantOf(this)&&e.activeNode.setActive(!1),e.focusNode&&e.focusNode.isDescendantOf(this)&&(e.focusNode=null),this.triggerModifyChild("remove",null),this.visit((t=>{e._unregisterNode(t)})),this.lazy?this.children=[]:this.children=null,this.isRootNode()||(this.expanded=!1),this.tree.update(ChangeType.structure))}removeMarkup(){this._rowElem&&(delete this._rowElem._wb_node,this._rowElem.remove(),this._rowElem=void 0)}_getRenderInfo(){const e={},t={},i=this.isColspan(),s=this._rowElem?this._rowElem.querySelectorAll("span.wb-col"):null;let n=0;for(const r of this.tree.columns)e[r.id]={id:r.id,idx:n,elem:s?s[n]:null,info:r},i||"*"===r.id||(t[r.id]=e[r.id]),n++;return{allColInfosById:e,renderColInfosById:t}}_createIcon(e,t,i,s){let n,r=this.getOption("icon");if(this._errorInfo?r=e.error:this._isLoading&&s&&(r=e.loading),!1===r)return null;"string"==typeof r||(r=this.statusNodeType?e[this.statusNodeType]:this.expanded?e.folderOpen:this.children?e.folder:this.lazy?e.folderLazy:e.doc),r?r.indexOf("<")>=0?n=elemFromHtml(r):TEST_IMG.test(r)?n=elemFromHtml(``):(n=document.createElement("i"),n.className="wb-icon "+r):(n=document.createElement("i"),n.className="wb-icon"),i?t.replaceChild(n,i):t.appendChild(n);const o=this._callEvent("iconBadge",{iconSpan:n});let l=null;if(null!=o&&!1!==o){let e="",t="";isPlainObject(o)?(l=""+o.badge,e=o.badgeClass?" "+o.badgeClass:"",t=o.badgeTooltip?` title="${o.badgeTooltip}"`:""):l="number"==typeof o?""+o:o,"string"==typeof l&&(l=elemFromHtml(`${escapeHtml(l)}`)),l&&n.append(l)}return n}_render_markup(e){const t=this.tree,i=t.options,s=this.getOption("checkbox"),n=t.columns,r=this.getLevel(),o=t.isRowNav()?null:t.activeColIdx;let l,a=this._rowElem,d=null,c=null;const h=!a;assert(h,"Expected unrendered node"),assert(!h||e&&e.after,"opts.after expected, unless updating"),assert(!this.isRootNode(),"Root node not allowed"),a=document.createElement("div"),a.classList.add("wb-row"),a.style.top=22*this._rowIdx+"px",this._rowElem=a,a._wb_node=this;const u=document.createElement("span");u.classList.add("wb-node","wb-col"),a.appendChild(u);let p=0;s&&(d=document.createElement("i"),d.classList.add("wb-checkbox"),("radio"===s||this.parent.radiogroup)&&d.classList.add("wb-radio"),u.appendChild(d),p+=20);for(let e=r-1;e>0;e--)l=document.createElement("i"),l.classList.add("wb-indent"),u.appendChild(l),p+=20;(!i.minExpandLevel||r>i.minExpandLevel)&&(c=document.createElement("i"),c.classList.add("wb-expander"),u.appendChild(c),p+=20);this._createIcon(t.iconMap,u,null,!c)&&(p+=20);const f=document.createElement("span");f.classList.add("wb-title"),u.appendChild(f),u._ofsTitlePx=p,t.options.dnd.dragStart&&(u.draggable=!0);if(!this.isColspan()&&n.length>1){let e=0;for(const t of n){let i;e++,"*"===t.id?i=u:(i=document.createElement("span"),i.classList.add("wb-col"),a.appendChild(i)),e===o&&i.classList.add("wb-active"),t.classes&&i.classList.add(...t.classes.split(" ")),i.style.left=t._ofsPx+"px",i.style.width=t._widthPx+"px",h&&t.html&&"string"==typeof t.html&&(i.innerHTML=t.html)}}switch(e?e.after:"last"){case"first":t.nodeListElement.prepend(a);break;case"last":t.nodeListElement.appendChild(a);break;default:e.after.after(a)}e.isNew=!0,this._render_data(e)}_render_data(e){assert(this._rowElem,"No _rowElem");const t=this.tree,i=t.options,s=this._rowElem,n=!!e.isNew,r=!!e.preventScroll,o=t.columns,l=this.isColspan(),a=s.querySelector("span.wb-node"),d=a.querySelector("span.wb-title"),c=t.element.scrollTop;if(this.titleWithHighlight?d.innerHTML=this.titleWithHighlight:d.textContent=this.title,r&&(t.element.scrollTop=c),!i.skeleton)if(l){const e=t.element.clientWidth;d.style.width=e-a._ofsTitlePx-7+"px"}else d.style.width=o[0]._widthPx-a._ofsTitlePx-7+"px";if(e.isDataChange=!0,this._render_status(e),this.statusNodeType)this._callEvent("renderStatusNode",{isNew:n,nodeElem:a,isColspan:l});else if(this.parent){const e=this._getRenderInfo();this._callEvent("render",{isNew:n,nodeElem:a,isColspan:l,allColInfosById:e.allColInfosById,renderColInfosById:e.renderColInfosById})}}_render_status(e){const t=this.tree,i=t.iconMap,s=t.options,n=this.type?t.types[this.type]:null,r=this._rowElem,o=r.querySelector("span.wb-node"),l=o.querySelector("i.wb-expander"),a=o.querySelector("i.wb-checkbox"),d=["wb-row"];if(this.expanded&&d.push("wb-expanded"),this.lazy&&d.push("wb-lazy"),this.selected&&d.push("wb-selected"),this._partsel&&d.push("wb-partsel"),this===t.activeNode&&d.push("wb-active"),this===t.focusNode&&d.push("wb-focus"),this._errorInfo&&d.push("wb-error"),this._isLoading&&d.push("wb-loading"),this.isColspan()&&d.push("wb-colspan"),this.statusNodeType&&d.push("wb-status-"+this.statusNodeType),this.match&&d.push("wb-match"),this.subMatchCount&&d.push("wb-submatch"),s.skeleton&&d.push("wb-skeleton"),r.className=d.join(" "),this.classes&&r.classList.add(...this.classes),n&&n.classes&&r.classList.add(...n.classes),l){let e=null;this._isLoading?e=i.loading:this.isExpandable(!1)?e=this.expanded?i.expanderExpanded:i.expanderCollapsed:this.lazy&&null==this.children&&(e=i.expanderLazy),null==e?l.classList.add("wb-indent"):TEST_IMG.test(e)?l.style.backgroundImage=`url('${e}')`:l.className="wb-expander "+e}if(a){let e="wb-checkbox ";this.isRadio()?(e+="wb-radio ",this.selected?e+=i.radioChecked:e+=i.radioUnchecked):this.selected?e+=i.checkChecked:this._partsel?e+=i.checkUnknown:e+=i.checkUnchecked,a.className=e}if(!e.isNew){let e=0;for(const i of r.children)i.classList.toggle("wb-active",e++===t.activeColIdx),i.classList.remove("wb-error","wb-invalid");const i=o.querySelector("i.wb-icon");i&&this._createIcon(t.iconMap,o,i,!l)}if(!1!==e.resizeCols&&!this.isColspan()){const e=r.querySelectorAll("span.wb-col");let t=0,i=0;for(const s of this.tree.columns){const n=e[t];n.style.left=`${i}px`,n.style.width=`${s._widthPx}px`,t++,i+=s._widthPx}}}_render(e){const t=Object.assign({change:ChangeType.data},e);switch(this._rowElem||(t.change=ChangeType.row),t.change){case"status":this._render_status(t);break;case"data":this._render_data(t);break;case"row":this._render_markup(t);break;default:error(`Invalid change type '${t.change}'.`)}}resetLazy(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=null,this.tree.update(ChangeType.structure)}toDict(e=!1,t){const i={};if(NODE_DICT_PROPS.forEach((e=>{const t=this[e];t instanceof Set?t.size&&(i[e]=Array.prototype.join.call(t.keys()," ")):(t||!1===t||0===t)&&(i[e]=t)})),isEmptyObject(this.data)||(i.data=extend({},this.data),isEmptyObject(i.data)&&delete i.data),t){const s=t(i,this);if(!1===s)return!1;"skip"===s&&(e=!1)}if(e&&isArray(this.children)){i.children=[];for(let e=0,s=this.children.length;e=0&&([s,e]=e.split("."));const n=s[e];if("function"==typeof n){const e=n.call(i,{type:"resolve",tree:i,node:this});if(void 0!==e)return e}if(void 0!==this[e])return this[e];const r=this.type?i.types[this.type]:void 0,o=r?r[e]:void 0;return void 0!==o?o:null!=n?n:t}async scrollIntoView(e){const t=Object.assign({node:this},e);return this.tree.scrollTo(t)}async setActive(e=!0,t){const i=this.tree,s=i.activeNode,n=null==t?void 0:t.retrigger,r=null==t?void 0:t.focusTree,o=null==t?void 0:t.noEvents,l=null==t?void 0:t.event,a=null==t?void 0:t.colIdx,d=null==t?void 0:t.edit;if(assert(!a||i.isCellNav(),"colIdx requires cellNav"),assert(!d||null!=a,"edit requires colIdx"),!o)if(e){if(s!==this||n){if(!1===(null==s?void 0:s._callEvent("deactivate",{nextNode:this,event:l}))||!1===this._callEvent("beforeActivate",{prevNode:s,event:l}))return;i.activeNode=null,null==s||s.update(ChangeType.status)}}else(s===this||n)&&this._callEvent("deactivate",{nextNode:null,event:l});return s!==this&&(e&&(i.activeNode=this),null==s||s.update(ChangeType.status),this.update(ChangeType.status)),this.makeVisible().then((()=>{e&&((r||d)&&(i.setFocus(),i.focusNode=this,i.focusNode.setFocus()),null!=a&&i.isCellNav()&&i.setColumn(a,{edit:d}),o||this._callEvent("activate",{prevNode:s,event:l}))}))}async setExpanded(e=!0,t){const{force:i,scrollIntoView:s,immediate:n}=null!=t?t:{},r=!(null==t?void 0:t.noEvents);if(!e&&this.isExpanded()&&this.getLevel()<=this.tree.getOption("minExpandLevel")&&!i)return void this.logDebug("Ignored collapse request below expandLevel.");if(!e==!this.expanded)return;if(r&&!1===this._callEvent("beforeExpand",{flag:e}))return;e&&this.getOption("autoCollapse")&&this.collapseSiblings(t),e&&this.lazy&&null==this.children&&await this.loadLazy(),this.expanded=e;const o={immediate:n};if(this.tree.update(ChangeType.structure,o),e&&s){const e=this.getLastChild();e&&(this.tree.updatePendingModifications(),e.scrollIntoView({topNode:this}))}r&&this._callEvent("expand",{flag:e})}setFocus(e=!0){assert(!!e,"Blur is not yet implemented");const t=this.tree.focusNode;this.tree.focusNode=this,null==t||t.update(),this.update()}setIcon(e){this.icon=e,this.update()}setKey(e,t){throw new Error("Not yet implemented")}update(e=ChangeType.data){assert(e===ChangeType.status||e===ChangeType.data,`Invalid change type ${e}`),this.tree.update(e,this)}getSelectedNodes(e=!1){const t=[];return this.visit((i=>{if(i.selected&&(t.push(i),!0===e))return"skip"})),t}toggleSelected(e){let t=this.isSelected();return t=void 0!==t||this.isRadio()?!t:this._anySelectable(),this.setSelected(t,e)}_anySelectable(){let e=!1;return this.visit((t=>{if(!1===t.selected&&!t.unselectable&&!t.hasChildren()&&!t.parent.radiogroup)return e=!0,!1})),e}_changeSelectStatusProps(e){let t=!1;switch(e){case!1:t=this.selected||this._partsel,this.selected=!1,this._partsel=!1;break;case!0:t=!this.selected||!this._partsel,this.selected=!0,this._partsel=!0;break;case void 0:t=this.selected||!this._partsel,this.selected=!1,this._partsel=!0;break;default:error(`Invalid state: ${e}`)}return t&&this.update(),t}fixSelection3AfterClick(e){const t=!!(null==e?void 0:e.force),i=this.isSelected();this.visit((e=>{if(e.radiogroup)return"skip";!t&&e.getOption("unselectable")||e._changeSelectStatusProps(i)})),this.fixSelection3FromEndNodes()}fixSelection3FromEndNodes(e){const t=!!(null==e?void 0:e.force);assert("hier"===this.tree.options.selectMode,"expected selectMode 'hier'");const i=e=>{let s;const n=e.children;if(n&&n.length){let e=!0,t=!1;for(let s=0,r=n.length;s{let t;const i=e.children;let s=!0,n=!1;for(let e=0,r=i.length;e{this.visit((t=>{t.setSelected(e)}))})),n):(e===n||s&&!1===this._callEvent("beforeSelect",{flag:e})||(i.runWithDeferredUpdate((()=>{if(r){if(!e&&!(null==t?void 0:t.force))return n;for(const e of this.parent.children)e.selected=e===this}else this.selected=e,"hier"===o?this.fixSelection3AfterClick():"single"===o&&i.visit((e=>{e.selected=!1}))})),s&&this._callEvent("select",{flag:e})),n):n}setStatus(e,t){const i=this.tree,s=null==t?void 0:t.message,n=null==t?void 0:t.details;let r=null;const o=e=>{const t=this.children,s=t?t[0]:null;return assert(e.statusNodeType,"Not a status node"),assert(!s||!s.isStatusNode(),"Child must not be a status node"),r=this.addNode(e,"prependChild"),r.match=!0,i.update(ChangeType.structure),r};switch((()=>{const e=this.children;e&&e.length&&e[0].isStatusNode()&&e[0].remove()})(),e){case"ok":this._isLoading=!1,this._errorInfo=null;break;case"loading":this._isLoading=!0,this._errorInfo=null,this.parent?this.update(ChangeType.status):o({statusNodeType:e,title:i.options.strings.loading+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n});break;case"error":o({statusNodeType:e,title:i.options.strings.loadError+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo={message:s,details:n};break;case"noData":o({statusNodeType:e,title:s||i.options.strings.noData,checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo=null;break;default:error("invalid node status "+e)}return i.update(ChangeType.structure),r}setTitle(e){this.title=e,this.update()}_sortChildren(e,t){const i=this.children;if(i&&(i.sort(e),t))for(let s=0,n=i.length;s{t.logError(`Error in ${e} event promise`,i),s.classList.add("wb-error")})).finally((()=>{s.classList.remove("wb-busy")})),n}_onChange(e){const t=Wunderbaum.getEventInfo(e),s=t.node,i=t.colElem;s&&0!==t.colIdx?this._applyChange("change",s,i,{info:t,event:e,inputElem:e.target,inputValue:Wunderbaum.util.getValueFromElem(e.target)}):this.tree.log("Ignored change event for removed element or node title")}init(){super.init(),onEvent(this.tree.element,"change",".contenteditable,input,textarea,select",(e=>this._onChange(e)))}_preprocessKeyEvent(e){const t=e.event,s=eventToString(t),i=this.tree,n=this.getPluginOption("trigger");if(this.isEditingTitle()){switch(s){case"Enter":return this._stopEditTitle(!0,{event:t}),!1;case"Escape":return this._stopEditTitle(!1,{event:t}),!1}return!1}if(i.isRowNav()||0===i.activeColIdx){switch(s){case"Enter":if(n.indexOf("macEnter")>=0&&isMac)return this.startEditTitle(),!1;break;case"F2":if(n.indexOf("F2")>=0)return this.startEditTitle(),!1}return!0}return!0}isEditingTitle(e){return e?this.curEditNode===e:!!this.curEditNode}startEditTitle(e){e=null!=e?e:this.tree.getActiveNode();const t=this.getPluginOption("validity"),s=this.getPluginOption("select");if(!e)return;this.tree.logDebug(`startEditTitle(node=${e})`);let i=e._callEvent("edit.beforeEdit");if(!1===i)return void e.logInfo("beforeEdit canceled operation.");if(!0===i||!i){i=``}const n=e.getColElem(0).querySelector(".wb-title");n.innerHTML=i;const r=n.firstElementChild;t&&r.addEventListener("keydown",(e=>{r.setCustomValidity(""),r.reportValidity()})),r.focus(),s&&r.select(),this.curEditNode=e,e._callEvent("edit.edit",{inputElem:r})}stopEditTitle(e){return this._stopEditTitle(e,{})}_stopEditTitle(e,t){null!=t||(t={});const s=document.activeElement;let i=s?getValueFromElem(s):null;const n=this.curEditNode,r=!!t.forceClose,o=this.getPluginOption("validity");if(i&&this.getPluginOption("trim")&&(i=i.trim()),n)if(n.logDebug(`stopEditTitle(${e})`,t,s,i),e&&null!==i&&i!==n.title){const e=s.validationMessage;if(e)throw new Error(`Input validation failed for "${i}": ${e}.`);const t=n.getColElem(0);this._applyChange("edit.apply",n,t,{oldValue:n.title,newValue:i,inputElem:s}).then((e=>{const t=s.validationMessage;if(o&&t&&!1!==e)throw new Error(`Edit apply validation failed for "${i}": ${t}.`);(r||!1!==e)&&(null==n||n.setTitle(i),this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus())})).catch((e=>{n.logError(e)}))}else this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus();else this.tree.logDebug("stopEditTitle: not in edit mode.")}createNode(e="after",t,s){const i=this.tree;if(assert(t=null!=t?t:i.getActiveNode(),"No node was passed, or no node is currently active."),e=e||"prependChild",null==s?s={title:""}:"string"==typeof s?s={title:s}:assert(isPlainObject(s),`Expected a plain object: ${s}`),("prependChild"===e||"appendChild"===e)&&(null==t?void 0:t.isExpandable(!0)))return void t.setExpanded().then((()=>{this.createNode(e,t,s)}));const n=t.addNode(s,e);n.setClass("wb-edit-new"),this.relatedNode=t,n.match=!0,n.makeVisible({noAnimation:!0}).then((()=>{this.startEditTitle(n)}))}} +class EditExtension extends WunderbaumExtension{constructor(e){super(e,"edit",{debounce:100,minlength:1,maxlength:null,trigger:[],trim:!0,select:!0,slowClickDelay:1e3,validity:!0,beforeEdit:null,edit:null,apply:null}),this.curEditNode=null,this.relatedNode=null,this.debouncedOnChange=debounce(this._onChange.bind(this),this.getPluginOption("debounce"))}async _applyChange(e,t,i,s,n){return t.log(`_applyChange(${e})`,n),i.classList.add("wb-busy"),i.classList.remove("wb-error","wb-invalid"),s.setCustomValidity(""),new Promise(((i,s)=>{const r=t._callEvent(e,n);Promise.resolve(r).then((e=>{i(e)})).catch((e=>{s(e)}))})).then((e=>{if(!s.checkValidity())throw t.logWarn("inputElem.checkValidity() failed: throwing...."),new ValidationError(s.validationMessage);return e})).catch((n=>{if(!(n instanceof ValidationError))throw t.logError(`Error in ${e} event handler (throw e.util.ValidationError instead if this was intended)`,n),i.classList.add("wb-error"),n;t.logWarn("catched ",n),i.classList.add("wb-invalid"),s.setCustomValidity&&!s.validationMessage&&s.setCustomValidity(n.message),s.validationMessage&&s.reportValidity()})).finally((()=>{i.classList.remove("wb-busy")}))}_onChange(e){const t=Wunderbaum.getEventInfo(e),i=t.node,s=t.colElem;i&&0!==t.colIdx?this._applyChange("change",i,s,e.target,{info:t,event:e,inputElem:e.target,inputValue:Wunderbaum.util.getValueFromElem(e.target),inputValid:e.target.checkValidity()}):this.tree.log("Ignored change event for removed element or node title")}init(){super.init(),onEvent(this.tree.element,"change",".contenteditable,input,textarea,select",(e=>this._onChange(e)))}_preprocessKeyEvent(e){const t=e.event,i=eventToString(t),s=this.tree,n=this.getPluginOption("trigger");if(this.isEditingTitle()){switch(i){case"Enter":return this._stopEditTitle(!0,{event:t}),!1;case"Escape":return this._stopEditTitle(!1,{event:t}),!1}return!1}if(s.isRowNav()||0===s.activeColIdx){switch(i){case"Enter":if(n.indexOf("macEnter")>=0&&isMac)return this.startEditTitle(),!1;break;case"F2":if(n.indexOf("F2")>=0)return this.startEditTitle(),!1}return!0}return!0}isEditingTitle(e){return e?this.curEditNode===e:!!this.curEditNode}startEditTitle(e){e=null!=e?e:this.tree.getActiveNode();const t=this.getPluginOption("validity"),i=this.getPluginOption("select");if(!e)return;this.tree.logDebug(`startEditTitle(node=${e})`);let s=e._callEvent("edit.beforeEdit");if(!1===s)return void e.logDebug("beforeEdit canceled operation.");if(!0===s||!s){const t=escapeHtml(e.title);let i=this.getPluginOption("maxlength");const n=i?` maxlength="${i}"`:"";i=this.getPluginOption("minlength");s=`0?" required":""}${i?` minlength="${i}"`:""}${n} >`}const n=e.getColElem(0).querySelector(".wb-title");n.innerHTML=s;const r=n.firstElementChild;t&&r.addEventListener("keydown",(t=>{r.setCustomValidity(""),r.reportValidity()||e.logWarn(`Invalid input: '${r.value}'`)})),r.focus(),i&&r.select(),this.curEditNode=e,e._callEvent("edit.edit",{inputElem:r})}stopEditTitle(e){return this._stopEditTitle(e,{})}_stopEditTitle(e,t){null!=t||(t={});const i=document.activeElement;let s=i?getValueFromElem(i):null;const n=this.curEditNode,r=!!t.forceClose,o=this.getPluginOption("validity");if(s&&this.getPluginOption("trim")&&(s=s.trim()),n)if(n.logDebug(`stopEditTitle(${e})`,t,i,s),e&&null!==s&&s!==n.title){const e=i.validationMessage;if(e)throw new Error(`Input validation failed for "${s}": ${e}.`);const t=n.getColElem(0);this._applyChange("edit.apply",n,t,i,{oldValue:n.title,newValue:s,inputElem:i,inputValid:i.checkValidity()}).then((e=>{const t=i.validationMessage;if(o&&t&&!1!==e)throw new Error(`Edit apply validation failed for "${s}": ${t}.`);(r||!1!==e)&&(null==n||n.setTitle(s),this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus())}))}else this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus();else this.tree.logDebug("stopEditTitle: not in edit mode.")}createNode(e="after",t,i){const s=this.tree;if(assert(t=null!=t?t:s.getActiveNode(),"No node was passed, or no node is currently active."),e=e||"prependChild",null==i?i={title:""}:"string"==typeof i?i={title:i}:assert(isPlainObject(i),`Expected a plain object: ${i}`),("prependChild"===e||"appendChild"===e)&&(null==t?void 0:t.isExpandable(!0)))return void t.setExpanded().then((()=>{this.createNode(e,t,i)}));const n=t.addNode(i,e);n.setClass("wb-edit-new"),this.relatedNode=t,n.match=!0,n.makeVisible({noAnimation:!0}).then((()=>{this.startEditTitle(n)}))}} /*! * wunderbaum.ts * @@ -80,7 +80,7 @@ class EditExtension extends WunderbaumExtension{constructor(e){super(e,"edit",{d * https://github.com/mar10/wunderbaum * * Released under the MIT license. - * @version v0.7.0 - * @date Sat, 09 Dec 2023 13:47:27 GMT - */class WbSystemRoot extends WunderbaumNode{constructor(e){super(e,null,{key:"__root__",title:e.id})}toString(){return`WbSystemRoot@${this.key}<'${this.tree.id}'>`}}class Wunderbaum{constructor(e){this.enabled=!0,this.data={},this.extensionList=[],this.extensions={},this.keyMap=new Map,this.refKeyMap=new Map,this.treeRowCount=0,this._disableUpdateCount=0,this._disableUpdateIgnoreCount=0,this.activeNode=null,this.focusNode=null,this.types={},this.columns=[],this._columnsById={},this.pendingChangeTypes=new Set,this._util=util,this.filterMode=null,this.activeColIdx=0,this._cellNavMode=!1,this.lastQuicksearchTime=0,this.lastQuicksearchTerm="",this.lastClickTime=0,this.log=this.logDebug;const t=this.options=extend({id:null,source:null,element:null,debugLevel:3,header:null,rowHeightPx:22,iconMap:"bootstrap",columns:null,types:null,enabled:!0,fixedCol:!1,showSpinner:!1,checkbox:!1,minExpandLevel:0,emptyChildListExpandable:!1,skeleton:!1,connectTopBreadcrumb:null,selectMode:"multi",navigationModeOption:null,quicksearch:!0,iconBadge:null,change:null,error:null,receive:null,strings:{loadError:"Error",loading:"Loading...",noData:"No data"}},e),s=new Deferred;this.ready=s.promise();let i=!1;if(this.ready.then((()=>{i=!0;try{this._callEvent("init")}catch(e){this.logError("Exception inside `init(e)` event:",e)}})).catch((e=>{if(i)throw e;this._callEvent("init",{error:e})})),this.id=t.id||"wb_"+ ++Wunderbaum.sequence,this.root=new WbSystemRoot(this),this._registerExtension(new KeynavExtension(this)),this._registerExtension(new EditExtension(this)),this._registerExtension(new FilterExtension(this)),this._registerExtension(new DndExtension(this)),this._registerExtension(new GridExtension(this)),this._registerExtension(new LoggerExtension(this)),this._updateViewportThrottled=adaptiveThrottle(this._updateViewportImmediately.bind(this),{}),this.columns=t.columns,delete t.columns,!this.columns||!this.columns.length){const e="string"==typeof t.header?t.header:this.id;this.columns=[{id:"*",title:e,width:"*"}]}t.types&&this.setTypes(t.types,!0),delete t.types,this.element=elemFromSelector(t.element),assert(!!this.element,`Invalid 'element' option: ${t.element}`),this.element.classList.add("wunderbaum"),this.element.getAttribute("tabindex")||(this.element.tabIndex=0),this.element._wb_tree=this,this.headerElement=this.element.querySelector("div.wb-header");const n=null==t.header?this.columns.length>1:!!t.header;if(this.headerElement){assert(!this.columns,"`opts.columns` must not be set if markup already contains a header"),this.columns=[];const e=this.headerElement.querySelector("div.wb-row");for(const t of e.querySelectorAll("div"))this.columns.push({id:t.dataset.id||`col_${this.columns.length}`,title:""+t.textContent,width:"*"})}else{const e="".repeat(this.columns.length);if(this.element.innerHTML=`\n
\n
\n ${e}\n
\n
`,!n){this.element.querySelector("div.wb-header").style.display="none"}}this.element.innerHTML+='\n
\n
\n
',this.listContainerElement=this.element.querySelector("div.wb-list-container"),this.nodeListElement=this.listContainerElement.querySelector("div.wb-node-list"),this.headerElement=this.element.querySelector("div.wb-header"),this.element.classList.toggle("wb-grid",this.columns.length>1),this._initExtensions(),["enabled","fixedCol"].forEach((e=>{null!=t[e]&&this.setOption(e,t[e])})),t.source?(t.showSpinner&&(this.nodeListElement.innerHTML="loading..."),this.load(t.source).then((()=>{null==t.navigationModeOption?this.isGrid()?this.setNavigationOption(NavModeEnum.cell):this.setNavigationOption(NavModeEnum.row):this.setNavigationOption(t.navigationModeOption),s.resolve()})).catch((e=>{s.reject(e)})).finally((()=>{var e;null===(e=this.element.querySelector("progress.spinner"))||void 0===e||e.remove(),this.element.classList.remove("wb-initializing")}))):s.resolve(),this.update(ChangeType.any),this.element.addEventListener("scroll",(e=>{this.update(ChangeType.scroll)})),this.resizeObserver=new ResizeObserver((e=>{this.update(ChangeType.resize)})),this.resizeObserver.observe(this.element),onEvent(this.nodeListElement,"click","div.wb-row",(t=>{const s=Wunderbaum.getEventInfo(t),i=s.node,n=t;if(!1===this._callEvent("click",{event:t,node:i,info:s}))return this.lastClickTime=Date.now(),!1;if(i){if(n.ctrlKey)return void i.toggleSelected();const r=this.getOption("edit.trigger"),o=this.getOption("edit.slowClickDelay");r.indexOf("clickActive")>=0&&"title"===s.region&&i.isActive()&&(!o||Date.now()-this.lastClickTime=0?i.setActive(!0,{colIdx:s.colIdx,event:t}):i.setActive(!0,{event:t}),s.region===NodeRegion.expander?i.setExpanded(!i.isExpanded(),{scrollIntoView:!1!==e.scrollIntoViewOnExpandClick}):s.region===NodeRegion.checkbox&&i.toggleSelected()}this.lastClickTime=Date.now()})),onEvent(this.nodeListElement,"dblclick","div.wb-row",(e=>{const t=Wunderbaum.getEventInfo(e),s=t.node;if(!1===this._callEvent("dblclick",{event:e,node:s,info:t}))return!1;s&&0===t.colIdx&&s.isExpandable()&&(this._callMethod("edit._stopEditTitle"),s.setExpanded(!s.isExpanded()))})),onEvent(this.element,"keydown",(e=>{const t=Wunderbaum.getEventInfo(e),s=eventToString(e),i=t.node||this.getFocusNode();this._callHook("onKeyEvent",{event:e,node:i,info:t,eventName:s})})),onEvent(this.element,"focusin focusout",(e=>{const s="focusin"===e.type,i=Wunderbaum.getNode(e);this._callEvent("focus",{flag:s,event:e}),s&&this.isRowNav()&&!this.isEditing()&&(t.navigationModeOption===NavModeEnum.row?null==i||i.setActive():this.setCellNav()),s||this._callMethod("edit._stopEditTitle",!0,{event:e,forceClose:!0})}))}static getTree(e){if(e instanceof Wunderbaum)return e;if(e instanceof WunderbaumNode)return e.tree;if(void 0===e&&(e=0),"number"==typeof e)e=document.querySelectorAll(".wunderbaum")[e];else if("string"==typeof e){for(const t of document.querySelectorAll(".wunderbaum")){const s=t._wb_tree;if(s&&s.id===e)return s}if(!(e=document.querySelector(e)))return null}else e.target&&(e=e.target);return assert(e instanceof Element,`Invalid el type: ${e}`),e.matches(".wunderbaum")||(e=e.closest(".wunderbaum")),e&&e._wb_tree?e._wb_tree:null}get iconMap(){const e=this.options.iconMap;return"string"==typeof e?iconMaps[e]:e}static getNode(e){if(!e)return null;if(e instanceof WunderbaumNode)return e;for(void 0!==e.target&&(e=e.target);e;){if(e._wb_node)return e._wb_node;e=e.parentElement}return null}*[Symbol.iterator](){yield*this.root}_registerExtension(e){this.extensionList.push(e),this.extensions[e.id]=e}_initExtensions(){for(const e of this.extensionList)e.init()}_registerNode(e){const t=e.key;assert(null!=t&&!this.keyMap.has(t),`Missing or duplicate key: '${t}'.`),this.keyMap.set(t,e);const s=e.refKey;if(s){const t=this.refKeyMap.get(s);t?t.add(e):this.refKeyMap.set(s,new Set)}}_unregisterNode(e){const t=e.refKey;if(t){const s=this.refKeyMap.get(t);s&&s.delete(e)&&!s.size&&this.refKeyMap.delete(t)}e.tree=null,e.parent=null,e.removeMarkup()}_callHook(e,t={}){let s;const i=extend({},{tree:this,options:this.options,result:void 0},t);for(const t of this.extensionList){if(s=t[e].call(t,i),!1===s)break;void 0!==i.result&&(s=i.result)}return s}_callMethod(e,...t){const[s,i]=e.split("."),n=i?this.extensions[s]:this,r=n[i];if(r)return r.apply(n,t);this.logError(`Calling undefined method '${e}()'.`)}_callEvent(e,t){const[s,i]=e.split("."),n=this.options,r=i?n[s][i]:n[s];if(r)return r.call(this,extend({type:e,tree:this,util:this._util},t))}_getNodeByRowIdx(e){let t=null;return this.visitRows((s=>{if(s._rowIdx===e)return t=s,!1})),t}getTopmostVpNode(e=!0){const t=this.element.scrollTop;let s;return s=e?Math.ceil((t-1)/22):Math.floor(t/22),this._getNodeByRowIdx(s)}getLowestVpNode(e=!0){const t=this.element,s=this.headerElement.clientHeight,i=t.scrollTop,n=t.clientHeight-s;let r;return r=e?Math.floor((i+n)/22)-1:Math.ceil((i+n)/22)-1,r=Math.min(r,this.count(!0)-1),this._getNodeByRowIdx(r)}_getPrevNodeInView(e,t=1){return this.visitRows((s=>{if(e=s,t--<=0)return!1}),{reverse:!0,start:e||this.getActiveNode()}),e}_getNextNodeInView(e,t=1){return this.visitRows((s=>{if(e=s,t--<=0)return!1}),{reverse:!1,start:e||this.getActiveNode()}),e}addChildren(e,t){return this.root.addChildren(e,t)}applyCommand(e,t,s){let i,n;switch(t instanceof WunderbaumNode?i=t:(i=this.getActiveNode(),assert(void 0===s,`Unexpected options: ${s}`),s=t),e){case"moveUp":n=i.getPrevSibling(),n&&(i.moveTo(n,"before"),i.setActive());break;case"moveDown":n=i.getNextSibling(),n&&(i.moveTo(n,"after"),i.setActive());break;case"indent":n=i.getPrevSibling(),n&&(i.moveTo(n,"appendChild"),n.setExpanded(),i.setActive());break;case"outdent":i.isTopLevel()||(i.moveTo(i.getParent(),"after"),i.setActive());break;case"remove":n=i.getPrevSibling()||i.getParent(),i.remove(),n&&n.setActive();break;case"addChild":this._callMethod("edit.createNode","prependChild");break;case"addSibling":this._callMethod("edit.createNode","after");break;case"rename":this._callMethod("edit.startEditTitle");break;case"down":case"first":case"last":case"left":case"pageDown":case"pageUp":case"parent":case"right":case"up":return i.navigate(e);default:error(`Unhandled command: '${e}'`)}}clear(){this.root.removeChildren(),this.root.children=null,this.keyMap.clear(),this.refKeyMap.clear(),this.treeRowCount=0,this.activeNode=null,this.focusNode=null,this.update(ChangeType.structure)}destroy(){this.logInfo("destroy()..."),this.clear(),this.resizeObserver.disconnect(),this.element.innerHTML="",this.element.outerHTML=this.element.outerHTML}getOption(e,t){let s,i=this.options;e.indexOf(".")>=0&&([s,e]=e.split("."),i=i[s]);let n=i[e];return"function"==typeof n&&(n=n({type:"resolve",tree:this})),null!=n?n:t}setOption(e,t){if(e.indexOf(".")>=0){const s=e.split(".");this.extensions[s[0]].setPluginOption(s[1],t)}else switch(this.options[e]=t,e){case"checkbox":this.update(ChangeType.any);break;case"enabled":this.setEnabled(!!t);break;case"fixedCol":this.element.classList.toggle("wb-fixed-col",!!t)}}hasFocus(){return this.element.contains(document.activeElement)}hasHeader(){const e=this.options.header;return this.isGrid()?!1!==e:!!e}runWithDeferredUpdate(e,t=null){try{this.enableUpdate(!1);const t=e();return assert(!(t instanceof Promise),`Promise return not allowed: ${t}`),t}finally{this.enableUpdate(!0)}}async expandAll(e=!0,t){await this.root.expandAll(e,t)}selectAll(e=!0){return this.root.setSelected(e,{propagateDown:!0})}toggleSelect(){this.selectAll(this.root._anySelectable())}getSelectedNodes(e=!1){return this.root.getSelectedNodes(e)}_selectRange(e){this.logDebug("_selectRange",e),error("Not yet implemented.")}count(e=!1){return e?this.treeRowCount:this.keyMap.size}_check(){let e=0;this.visit((t=>{e++})),this.keyMap.size!==e&&this.logWarn(`_check failed: ${this.keyMap.size} !== ${e}`)}findAll(e){return this.root.findAll(e)}findFirst(e){return this.root.findFirst(e)}findKey(e){return this.keyMap.get(e)||null}findNextNode(e,t){let s=null;const i=this.getFirstChild(),n="string"==typeof e?makeNodeTitleStartMatcher(e):e;function r(e){if(n(e)&&(s=e),s||e===t)return!1}return t=t||i,this.visitRows(r,{start:t,includeSelf:!1}),s||t===i||this.visitRows(r,{start:i,includeSelf:!0}),s}findRelatedNode(e,t,s=!1){let i=null;const n=Math.floor(this.listContainerElement.clientHeight/22);switch(t){case"parent":case"left":e.parent&&e.parent.parent&&(i=e.parent);break;case"first":this.visit((e=>{if(e.isVisible())return i=e,!1}));break;case"last":this.visit((e=>{e.isVisible()&&(i=e)}));break;case"right":e.children&&e.children.length&&(i=e.children[0]);break;case"up":i=this._getPrevNodeInView(e);break;case"down":i=this._getNextNodeInView(e);break;case"pageDown":{const t=this.getLowestVpNode();i=e._rowIdxt._rowIdx?t:this._getPrevNodeInView(e,n)}break;default:this.logWarn("Unknown relation '"+t+"'.")}return i}*format_iter(e,t){yield*this.root.format_iter(e,t)}format(e,t){return this.root.format(e,t)}getActiveColElem(){return this.activeNode&&this.activeColIdx>=0?this.activeNode.getColElem(this.activeColIdx):null}getActiveNode(){return this.activeNode}getFirstChild(){return this.root.getFirstChild()}getFocusNode(){return this.focusNode}static getEventInfo(e){const t=e.target,s=t.classList,i=t.closest("span.wb-col"),n=Wunderbaum.getNode(t),r=n?n.tree:Wunderbaum.getTree(e),o={event:e,canonicalName:eventToString(e),tree:r,node:n,region:NodeRegion.unknown,colDef:void 0,colIdx:-1,colId:void 0,colElem:i};if(s.contains("wb-title"))o.region=NodeRegion.title;else if(s.contains("wb-expander"))o.region=n.isExpandable()?NodeRegion.expander:NodeRegion.prefix;else if(s.contains("wb-checkbox"))o.region=NodeRegion.checkbox;else if(s.contains("wb-icon"))o.region=NodeRegion.icon;else if(s.contains("wb-node"))o.region=NodeRegion.title;else if(i){o.region=NodeRegion.column;const e=Array.prototype.indexOf.call(i.parentNode.children,i);o.colIdx=e}else{if(!s.contains("wb-row"))return"mousemove"===e.type||e instanceof KeyboardEvent||null==r||r.logWarn("getEventInfo(): not found",e,o),o;o.region=NodeRegion.title}return-1===o.colIdx&&(o.colIdx=0),o.colDef=null==r?void 0:r.columns[o.colIdx],null!=o.colDef&&(o.colId=o.colDef.id),o}toString(){return`Wunderbaum<'${this.id}'>`}isEditing(){return this._callMethod("edit.isEditingTitle")}isLoading(){let e=!1;return this.root.visit((t=>{if(t._isLoading||t._requestId)return e=!0,!1}),!0),e}logDebug(...e){this.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.options.debugLevel>=3&&console.info(this.toString(),...e)}logTime(e){return this.options.debugLevel>=4&&console.time(this+": "+e),e}logTimeEnd(e){this.options.debugLevel>=4&&console.timeEnd(this+": "+e)}logWarn(...e){this.options.debugLevel>=2&&console.warn(this.toString(),...e)}scrollTo(e){let t,s;e instanceof WunderbaumNode?t=e:(s=e,t=s.node),assert(t&&null!=t._rowIdx,`Invalid node: ${t}`);const i=this.element,n=this.headerElement.clientHeight,r=i.scrollTop,o=i.clientHeight,l=22*t._rowIdx+n,a=n,d=l-r,c=d+22,h=null==s?void 0:s.topNode;let u=null;d>=a?c<=o||(u=l+22-o+2):u=l-a-2,null!=u&&(this.log(`scrollTo(${l}): ${r} => ${u}`),i.scrollTop=u,h&&this.scrollTo(h))}scrollToHorz(){const e=this.columns[0]._widthPx,t=this.element.clientWidth,s=this.element.scrollLeft,i=this.getActiveColElem(),n=Number.parseInt(null==i?void 0:i.style.left,10),r=n+Number.parseInt(null==i?void 0:i.style.width,10);let o=s;n-st&&(o=r-t),o=Math.max(0,o),this.log(`scrollToHorz(${this.activeColIdx}): ${n}..${r}, fixedOfs=${e}, vpWidth=${t}, curLeft=${s} -> ${o}`),this.element.scrollLeft=o}setColumn(e){var t;if(assert(this.isCellNav(),"Exected cellNav mode"),assert(0<=e&&e0&&(i?this._updateViewportImmediately():this._updateViewportThrottled())}setEnabled(e=!0){const t=this.enabled;return this.enabled=!!e,this.element.classList.toggle("wb-disabled",!e),t}isEnabled(){return this.enabled}isGrid(){return this.columns&&this.columns.length>1}isCellNav(){return!!this._cellNavMode}isRowNav(){return!this._cellNavMode}setCellNav(e=!0){var t;const s=this._cellNavMode;this._cellNavMode=!!e,e&&!s&&this.setColumn(0),this.element.classList.toggle("wb-cell-mode",e),null===(t=this.activeNode)||void 0===t||t.update(ChangeType.status)}setNavigationOption(e,t=!1){if(this.isGrid()||e===NavModeEnum.row)switch(this.options.navigationModeOption=e,e){case NavModeEnum.cell:this.setCellNav(!0);break;case NavModeEnum.row:this.setCellNav(!1);break;case NavModeEnum.startCell:t&&this.setCellNav(!0);break;case NavModeEnum.startRow:t&&this.setCellNav(!1);break;default:error(`Invalid mode '${e}'.`)}else this.logWarn("Plain trees only support row navigation mode.")}setStatus(e,t){return this.root.setStatus(e,t)}setTypes(e,t=!0){assert(isPlainObject(e),`Expected plain objext: ${e}`),t?this.types=e:extend(this.types,e);for(const e of Object.values(this.types))e.classes&&(e.classes=toSet(e.classes))}sortChildren(e=nodeTitleSorter,t=!1){this.root.sortChildren(e,t)}toDictArray(e){var t;return null!==(t=this.root.toDict(!0,e).children)&&void 0!==t?t:[]}_updateColumnWidths(){const e=this.element.clientWidth,t=this.columns,s=t[0];let i=0,n=0,r=0,o=!1;if("*"!==s.id)throw new Error(`First column must have id '*': got '${s.id}'.`);this._columnsById={};for(const e of t){this._columnsById[e.id]=e;const t=e.width;if("*"===e.id&&e!==s)throw new Error(`Column id '*' must be defined only once: '${e.title}'.`);if(t&&"*"!==t)if("number"==typeof t)e._weight=t,n+=t;else if("string"==typeof t&&t.endsWith("px")){e._weight=0;const s=parseFloat(t.slice(0,-2));e._widthPx!=s&&(o=!0,e._widthPx=s),r+=s}else error(`Invalid column width: ${t} (expected string ending with 'px' or number, e.g. "px" or ).`);else e._weight=1,n+=1}const l=Math.max(0,e-r);let a=0;for(const e of t){let t;if(e._weight){const s=e.minWidth;t="number"==typeof s?s:"string"==typeof s&&s.endsWith("px")?parseFloat(s.slice(0,-2)):4;const i=Math.max(t,l*e._weight/n);e._widthPx!=i&&(o=!0,e._widthPx=i)}e._ofsPx=a,a+=e._widthPx}t[t.length-1]._widthPx-=1,i=a-1;const d=`${i}px`;return this.headerElement.style.width=d,this.listContainerElement.style.width=d,o}_renderHeaderMarkup(){assert(this.headerElement,"Expected a headerElement");const e=this.hasHeader();if(setElemDisplay(this.headerElement,e),!e)return;const t=this.columns.length,s=this.headerElement.querySelector(".wb-row");assert(s,"Expected a row in header element"),s.innerHTML="".repeat(t);for(let e=0;e${r}
${l}`,this.isCellNav()&&n.classList.toggle("wb-active",e===this.activeColIdx)}}updatePendingModifications(){this.pendingChangeTypes.size>0&&this._updateViewportImmediately()}_updateViewportImmediately(){var e;if(this._disableUpdateCount)return this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount})`),void this._disableUpdateIgnoreCount++;const t=RenderFlag,s=new Set(this.pendingChangeTypes);this.pendingChangeTypes.clear();if(s.has(t.scroll)&&1===s.size)this._updateRows({newNodesOnly:!0});else{if(this.log("_updateViewportImmediately():",s),!1!==this.options.adjustHeight){let e=this.listContainerElement.clientHeight;const t=this.headerElement.clientHeight,s=this.element.clientHeight-t-1;Math.abs(e-s)>1&&(this.listContainerElement.style.height=s+"px",e=s)}s.has(t.clearMarkup)&&this.visit((e=>{e.removeMarkup()})),s.has(t.header)&&(this._updateColumnWidths(),this._renderHeaderMarkup()),this._updateRows()}if(this.options.connectTopBreadcrumb){let t=null===(e=this.getTopmostVpNode(!0))||void 0===e?void 0:e.getPath(!1,"title"," > ");t=t?t+" >":"",this.options.connectTopBreadcrumb.textContent=t}this._callEvent("update")}_updateRows(e){const t=!!(e=Object.assign({newNodesOnly:!1},e)).newNodesOnly,s=this.element.clientHeight,i=this.element.scrollTop;let n=Math.max(0,i/22-5);n=Math.floor(n),n%2&&n--;let r=Math.max(0,(i+s)/22+5);r=Math.ceil(r);const o=new Set;this.nodeListElement.childNodes.forEach((e=>{const t=e;o.add(t._wb_node)}));let l=0,a=0,d=!1,c="first";this.visitRows((function(e){const s=e._rowElem;e._rowIdx!==l&&(e._rowIdx=l,d=!0),lr?s&&(c=s):s&&t?(o.delete(e),s.style.top=22*l+"px",c=s):(o.delete(e),s&&(s.style.top=22*l+"px"),e._render({top:a,after:c}),c=e._rowElem),l++,a+=22})),this.treeRowCount=l;for(const e of o)e._callEvent("discard"),e.removeMarkup();return this.nodeListElement.style.height=`${a}px`,d}visit(e){return this.root.visit(e,!1)}visitRows(e,t){if(!this.root.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);let s,i,n,r,o,l,a=0,d=!1===(t=t||{}).includeSelf,c=t.start||this.root.children[0];const h=!!t.includeHidden,u=!h&&"hide"===this.filterMode;for(n=c.parent;n;){for(o=n.children,i=o.indexOf(c)+a,assert(i>=0,`Could not find ${c} in parent's children: ${n}`),s=i;st!==l&&(!u||t.match||t.subMatchCount?!1!==e(t)&&(h||!t.children||t.expanded?void 0:"skip"):"skip")),!1),!1===r))return!1}}c=n,n=n.parent,a=1,!n&&t.wrap&&(this.logDebug("visitRows(): wrap around"),assert(t.start,"`wrap` option requires `start`"),l=t.start,t.wrap=!1,n=this.root,a=0)}return!0}_visitRowsUp(e,t){let s,i,n,r=t.start||this.root.children[0];const o=!!t.includeHidden;if(!1!==t.includeSelf&&!1===e(r))return!1;for(;;){if(n=r.parent,s=n.children,s[0]===r){if(r=n,!r.parent)break;s=n.children}else for(i=s.indexOf(r),r=s[i-1];(o||r.expanded)&&r.children&&r.children.length;)s=r.children,n=r,r=s[s.length-1];if((o||r.isVisible())&&!1===e(r))return!1}return!0}load(e){return this.clear(),this.root.load(e)}enableUpdate(e){e?(assert(this._disableUpdateCount>0,"enableUpdate(true) was called too often"),this._disableUpdateCount--,0===this._disableUpdateCount&&(this.logDebug(`enableUpdate(): active again. Re-painting to catch up with ${this._disableUpdateIgnoreCount} ignored update requests...`),this._disableUpdateIgnoreCount=0,this.update(ChangeType.any,{immediate:!0}))):this._disableUpdateCount++}filterNodes(e,t){return this.extensions.filter.filterNodes(e,t)}filterBranches(e,t){return this.extensions.filter.filterBranches(e,t)}clearFilter(){return this.extensions.filter.clearFilter()}isFilterActive(){return!!this.filterMode}updateFilter(){return this.extensions.filter.updateFilter()}}Wunderbaum.sequence=0,Wunderbaum.version="v0.7.0",Wunderbaum.util=util;export{Wunderbaum}; + * @version v0.8.0 + * @date Thu, 11 Jan 2024 19:37:23 GMT + */class WbSystemRoot extends WunderbaumNode{constructor(e){super(e,null,{key:"__root__",title:e.id})}toString(){return`WbSystemRoot@${this.key}<'${this.tree.id}'>`}}class Wunderbaum{constructor(e){this.enabled=!0,this.data={},this.extensionList=[],this.extensions={},this.keyMap=new Map,this.refKeyMap=new Map,this.treeRowCount=0,this._disableUpdateCount=0,this._disableUpdateIgnoreCount=0,this.activeNode=null,this.focusNode=null,this.types={},this.columns=[],this._columnsById={},this.pendingChangeTypes=new Set,this._util=util,this.filterMode=null,this.activeColIdx=0,this._cellNavMode=!1,this.lastQuicksearchTime=0,this.lastQuicksearchTerm="",this.lastClickTime=0,this.log=this.logDebug;const t=this.options=extend({id:null,source:null,element:null,debugLevel:3,header:null,rowHeightPx:22,iconMap:"bootstrap",columns:null,types:null,enabled:!0,fixedCol:!1,showSpinner:!1,checkbox:!1,minExpandLevel:0,emptyChildListExpandable:!1,skeleton:!1,connectTopBreadcrumb:null,selectMode:"multi",navigationModeOption:null,quicksearch:!0,iconBadge:null,change:null,error:null,receive:null,strings:{loadError:"Error",loading:"Loading...",noData:"No data"}},e),i=new Deferred;this.ready=i.promise();let s=!1;if(this.ready.then((()=>{s=!0;try{this._callEvent("init")}catch(e){this.logError("Exception inside `init(e)` event:",e)}})).catch((e=>{if(s)throw e;this._callEvent("init",{error:e})})),this.id=t.id||"wb_"+ ++Wunderbaum.sequence,this.root=new WbSystemRoot(this),this._registerExtension(new KeynavExtension(this)),this._registerExtension(new EditExtension(this)),this._registerExtension(new FilterExtension(this)),this._registerExtension(new DndExtension(this)),this._registerExtension(new GridExtension(this)),this._registerExtension(new LoggerExtension(this)),this._updateViewportThrottled=adaptiveThrottle(this._updateViewportImmediately.bind(this),{}),this.columns=t.columns,delete t.columns,!this.columns||!this.columns.length){const e="string"==typeof t.header?t.header:this.id;this.columns=[{id:"*",title:e,width:"*"}]}t.types&&this.setTypes(t.types,!0),delete t.types,this.element=elemFromSelector(t.element),assert(!!this.element,`Invalid 'element' option: ${t.element}`),this.element.classList.add("wunderbaum"),this.element.getAttribute("tabindex")||(this.element.tabIndex=0),this.element._wb_tree=this,this.headerElement=this.element.querySelector("div.wb-header");const n=null==t.header?this.columns.length>1:!!t.header;if(this.headerElement){assert(!this.columns,"`opts.columns` must not be set if markup already contains a header"),this.columns=[];const e=this.headerElement.querySelector("div.wb-row");for(const t of e.querySelectorAll("div"))this.columns.push({id:t.dataset.id||`col_${this.columns.length}`,title:""+t.textContent,width:"*"})}else{const e="".repeat(this.columns.length);if(this.element.innerHTML=`\n
\n
\n ${e}\n
\n
`,!n){this.element.querySelector("div.wb-header").style.display="none"}}this.element.innerHTML+='\n
\n
\n
',this.listContainerElement=this.element.querySelector("div.wb-list-container"),this.nodeListElement=this.listContainerElement.querySelector("div.wb-node-list"),this.headerElement=this.element.querySelector("div.wb-header"),this.element.classList.toggle("wb-grid",this.columns.length>1),this._initExtensions(),["enabled","fixedCol"].forEach((e=>{null!=t[e]&&this.setOption(e,t[e])})),t.source?(t.showSpinner&&(this.nodeListElement.innerHTML="loading..."),this.load(t.source).then((()=>{null==t.navigationModeOption?this.isGrid()?this.setNavigationOption(NavModeEnum.cell):this.setNavigationOption(NavModeEnum.row):this.setNavigationOption(t.navigationModeOption),this.update(ChangeType.structure,{immediate:!0}),i.resolve()})).catch((e=>{i.reject(e)})).finally((()=>{var e;null===(e=this.element.querySelector("progress.spinner"))||void 0===e||e.remove(),this.element.classList.remove("wb-initializing")}))):i.resolve(),this.update(ChangeType.any),this.element.addEventListener("scroll",(e=>{this.update(ChangeType.scroll)})),this.resizeObserver=new ResizeObserver((e=>{this.update(ChangeType.resize)})),this.resizeObserver.observe(this.element),onEvent(this.nodeListElement,"click","div.wb-row",(t=>{const i=Wunderbaum.getEventInfo(t),s=i.node,n=t;if(!1===this._callEvent("click",{event:t,node:s,info:i}))return this.lastClickTime=Date.now(),!1;if(s){if(n.ctrlKey)return void s.toggleSelected();const r=this.getOption("edit.trigger"),o=this.getOption("edit.slowClickDelay");r.indexOf("clickActive")>=0&&"title"===i.region&&s.isActive()&&(!o||Date.now()-this.lastClickTime=0?s.setActive(!0,{colIdx:i.colIdx,event:t}):s.setActive(!0,{event:t}),i.region===NodeRegion.expander?s.setExpanded(!s.isExpanded(),{scrollIntoView:!1!==e.scrollIntoViewOnExpandClick}):i.region===NodeRegion.checkbox&&s.toggleSelected()}this.lastClickTime=Date.now()})),onEvent(this.nodeListElement,"dblclick","div.wb-row",(e=>{const t=Wunderbaum.getEventInfo(e),i=t.node;if(!1===this._callEvent("dblclick",{event:e,node:i,info:t}))return!1;i&&0===t.colIdx&&i.isExpandable()&&(this._callMethod("edit._stopEditTitle"),i.setExpanded(!i.isExpanded()))})),onEvent(this.element,"keydown",(e=>{const t=Wunderbaum.getEventInfo(e),i=eventToString(e),s=t.node||this.getFocusNode();this._callHook("onKeyEvent",{event:e,node:s,info:t,eventName:i})})),onEvent(this.element,"focusin focusout",(e=>{const i="focusin"===e.type,s=Wunderbaum.getNode(e);this._callEvent("focus",{flag:i,event:e}),i&&this.isRowNav()&&!this.isEditingTitle()&&(t.navigationModeOption===NavModeEnum.row?null==s||s.setActive():this.setCellNav()),i||this._callMethod("edit._stopEditTitle",!0,{event:e,forceClose:!0})}))}static getTree(e){if(e instanceof Wunderbaum)return e;if(e instanceof WunderbaumNode)return e.tree;if(void 0===e&&(e=0),"number"==typeof e)e=document.querySelectorAll(".wunderbaum")[e];else if("string"==typeof e){for(const t of document.querySelectorAll(".wunderbaum")){const i=t._wb_tree;if(i&&i.id===e)return i}if(!(e=document.querySelector(e)))return null}else e.target&&(e=e.target);return assert(e instanceof Element,`Invalid el type: ${e}`),e.matches(".wunderbaum")||(e=e.closest(".wunderbaum")),e&&e._wb_tree?e._wb_tree:null}get iconMap(){const e=this.options.iconMap;return"string"==typeof e?iconMaps[e]:e}static getNode(e){if(!e)return null;if(e instanceof WunderbaumNode)return e;for(void 0!==e.target&&(e=e.target);e;){if(e._wb_node)return e._wb_node;e=e.parentElement}return null}*[Symbol.iterator](){yield*this.root}_registerExtension(e){this.extensionList.push(e),this.extensions[e.id]=e}_initExtensions(){for(const e of this.extensionList)e.init()}_registerNode(e){const t=e.key;assert(null!=t&&!this.keyMap.has(t),`Missing or duplicate key: '${t}'.`),this.keyMap.set(t,e);const i=e.refKey;if(null!=i){const t=this.refKeyMap.get(i);t?t.add(e):this.refKeyMap.set(i,new Set([e]))}}_unregisterNode(e){const t=e.refKey;if(null!=t){const i=this.refKeyMap.get(t);i&&i.delete(e)&&!i.size&&this.refKeyMap.delete(t)}this.keyMap.delete(e.key),e.tree=null,e.parent=null,e.removeMarkup()}_callHook(e,t={}){let i;const s=extend({},{tree:this,options:this.options,result:void 0},t);for(const t of this.extensionList){if(i=t[e].call(t,s),!1===i)break;void 0!==s.result&&(i=s.result)}return i}_callMethod(e,...t){const[i,s]=e.split("."),n=s?this.extensions[i]:this,r=n[s];if(r)return r.apply(n,t);this.logError(`Calling undefined method '${e}()'.`)}_callEvent(e,t){const[i,s]=e.split("."),n=this.options,r=s?n[i][s]:n[i];if(r)return r.call(this,extend({type:e,tree:this,util:this._util},t))}_getNodeByRowIdx(e){let t=null;return this.visitRows((i=>{if(i._rowIdx===e)return t=i,!1})),t}getTopmostVpNode(e=!0){const t=this.element.scrollTop;let i;return i=e?Math.ceil((t-1)/22):Math.floor(t/22),this._getNodeByRowIdx(i)}getLowestVpNode(e=!0){const t=this.element,i=this.headerElement.clientHeight,s=t.scrollTop,n=t.clientHeight-i;let r;return r=e?Math.floor((s+n)/22)-1:Math.ceil((s+n)/22)-1,r=Math.min(r,this.count(!0)-1),this._getNodeByRowIdx(r)}_getPrevNodeInView(e,t=1){return this.visitRows((i=>{if(e=i,t--<=0)return!1}),{reverse:!0,start:e||this.getActiveNode()}),e}_getNextNodeInView(e,t=1){return this.visitRows((i=>{if(e=i,t--<=0)return!1}),{reverse:!1,start:e||this.getActiveNode()}),e}addChildren(e,t){return this.root.addChildren(e,t)}applyCommand(e,t,i){let s,n;switch(t instanceof WunderbaumNode?s=t:(s=this.getActiveNode(),assert(void 0===i,`Unexpected options: ${i}`),i=t),e){case"moveUp":n=s.getPrevSibling(),n&&(s.moveTo(n,"before"),s.setActive());break;case"moveDown":n=s.getNextSibling(),n&&(s.moveTo(n,"after"),s.setActive());break;case"indent":n=s.getPrevSibling(),n&&(s.moveTo(n,"appendChild"),n.setExpanded(),s.setActive());break;case"outdent":s.isTopLevel()||(s.moveTo(s.getParent(),"after"),s.setActive());break;case"remove":n=s.getPrevSibling()||s.getParent(),s.remove(),n&&n.setActive();break;case"addChild":this._callMethod("edit.createNode","prependChild");break;case"addSibling":this._callMethod("edit.createNode","after");break;case"rename":s.startEditTitle();break;case"down":case"first":case"last":case"left":case"pageDown":case"pageUp":case"parent":case"right":case"up":return s.navigate(e);default:error(`Unhandled command: '${e}'`)}}clear(){this.root.removeChildren(),this.root.children=null,this.keyMap.clear(),this.refKeyMap.clear(),this.treeRowCount=0,this.activeNode=null,this.focusNode=null,this.update(ChangeType.structure)}destroy(){this.logInfo("destroy()..."),this.clear(),this.resizeObserver.disconnect(),this.element.innerHTML="",this.element.outerHTML=this.element.outerHTML}getOption(e,t){let i,s=this.options;e.indexOf(".")>=0&&([i,e]=e.split("."),s=s[i]);let n=s[e];return"function"==typeof n&&(n=n({type:"resolve",tree:this})),null!=n?n:t}setOption(e,t){if(e.indexOf(".")>=0){const i=e.split(".");this.extensions[i[0]].setPluginOption(i[1],t)}else switch(this.options[e]=t,e){case"checkbox":this.update(ChangeType.any);break;case"enabled":this.setEnabled(!!t);break;case"fixedCol":this.element.classList.toggle("wb-fixed-col",!!t)}}hasFocus(){return this.element.contains(document.activeElement)}hasHeader(){const e=this.options.header;return this.isGrid()?!1!==e:!!e}runWithDeferredUpdate(e,t=null){try{this.enableUpdate(!1);const t=e();return assert(!(t instanceof Promise),`Promise return not allowed: ${t}`),t}finally{this.enableUpdate(!0)}}async expandAll(e=!0,t){await this.root.expandAll(e,t)}selectAll(e=!0){return this.root.setSelected(e,{propagateDown:!0})}toggleSelect(){this.selectAll(this.root._anySelectable())}getSelectedNodes(e=!1){return this.root.getSelectedNodes(e)}_selectRange(e){this.logDebug("_selectRange",e),error("Not yet implemented.")}count(e=!1){return e?this.treeRowCount:this.keyMap.size}_check(){let e=0;this.visit((t=>{e++})),this.keyMap.size!==e&&this.logWarn(`_check failed: ${this.keyMap.size} !== ${e}`)}findAll(e){return this.root.findAll(e)}findByRefKey(e){const t=this.refKeyMap.get(e);return t?Array.from(t):[]}findFirst(e){return this.root.findFirst(e)}findKey(e){return this.keyMap.get(e)||null}findNextNode(e,t){let i=null;const s=this.getFirstChild(),n="string"==typeof e?makeNodeTitleStartMatcher(e):e;function r(e){if(n(e)&&(i=e),i||e===t)return!1}return t=t||s,this.visitRows(r,{start:t,includeSelf:!1}),i||t===s||this.visitRows(r,{start:s,includeSelf:!0}),i}findRelatedNode(e,t,i=!1){let s=null;const n=Math.floor(this.listContainerElement.clientHeight/22);switch(t){case"parent":case"left":e.parent&&e.parent.parent&&(s=e.parent);break;case"first":this.visit((e=>{if(e.isVisible())return s=e,!1}));break;case"last":this.visit((e=>{e.isVisible()&&(s=e)}));break;case"right":e.children&&e.children.length&&(s=e.children[0]);break;case"up":s=this._getPrevNodeInView(e);break;case"down":s=this._getNextNodeInView(e);break;case"pageDown":{const t=this.getLowestVpNode();s=e._rowIdxt._rowIdx?t:this._getPrevNodeInView(e,n)}break;default:this.logWarn("Unknown relation '"+t+"'.")}return s}*format_iter(e,t){yield*this.root.format_iter(e,t)}format(e,t){return this.root.format(e,t)}getActiveColElem(){return this.activeNode&&this.activeColIdx>=0?this.activeNode.getColElem(this.activeColIdx):null}getActiveNode(){return this.activeNode}getFirstChild(){return this.root.getFirstChild()}getFocusNode(){return this.focusNode}static getEventInfo(e){const t=e.target,i=t.classList,s=t.closest("span.wb-col"),n=Wunderbaum.getNode(t),r=n?n.tree:Wunderbaum.getTree(e),o={event:e,canonicalName:eventToString(e),tree:r,node:n,region:NodeRegion.unknown,colDef:void 0,colIdx:-1,colId:void 0,colElem:s};if(i.contains("wb-title"))o.region=NodeRegion.title;else if(i.contains("wb-expander"))o.region=n.isExpandable()?NodeRegion.expander:NodeRegion.prefix;else if(i.contains("wb-checkbox"))o.region=NodeRegion.checkbox;else if(i.contains("wb-icon"))o.region=NodeRegion.icon;else if(i.contains("wb-node"))o.region=NodeRegion.title;else if(s){o.region=NodeRegion.column;const e=Array.prototype.indexOf.call(s.parentNode.children,s);o.colIdx=e}else{if(!i.contains("wb-row"))return"mousemove"===e.type||e instanceof KeyboardEvent||null==r||r.logWarn("getEventInfo(): not found",e,o),o;o.region=NodeRegion.title}return-1===o.colIdx&&(o.colIdx=0),o.colDef=null==r?void 0:r.columns[o.colIdx],null!=o.colDef&&(o.colId=o.colDef.id),o}toString(){return`Wunderbaum<'${this.id}'>`}isEditing(){return!!this.nodeListElement.querySelector("input:focus,select:focus")}isEditingTitle(){return this._callMethod("edit.isEditingTitle")}isLoading(){let e=!1;return this.root.visit((t=>{if(t._isLoading||t._requestId)return e=!0,!1}),!0),e}logDebug(...e){this.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.options.debugLevel>=3&&console.info(this.toString(),...e)}logTime(e){return this.options.debugLevel>=4&&console.time(this+": "+e),e}logTimeEnd(e){this.options.debugLevel>=4&&console.timeEnd(this+": "+e)}logWarn(...e){this.options.debugLevel>=2&&console.warn(this.toString(),...e)}scrollTo(e){let t,i;e instanceof WunderbaumNode?t=e:(i=e,t=i.node),assert(t&&null!=t._rowIdx,`Invalid node: ${t}`);const s=this.element,n=this.headerElement.clientHeight,r=s.scrollTop,o=s.clientHeight,l=22*t._rowIdx+n,a=n,d=l-r,c=d+22,h=null==i?void 0:i.topNode;let u=null;d>=a?c<=o||(u=l+22-o+2):u=l-a-2,null!=u&&(this.log(`scrollTo(${l}): ${r} => ${u}`),s.scrollTop=u,h&&this.scrollTo(h))}scrollToHorz(){const e=this.columns[0]._widthPx,t=this.element.clientWidth,i=this.element.scrollLeft,s=this.getActiveColElem(),n=Number.parseInt(null==s?void 0:s.style.left,10),r=n+Number.parseInt(null==s?void 0:s.style.width,10);let o=i;n-it&&(o=r-t),o=Math.max(0,o),this.log(`scrollToHorz(${this.activeColIdx}): ${n}..${r}, fixedOfs=${e}, vpWidth=${t}, curLeft=${i} -> ${o}`),this.element.scrollLeft=o}setColumn(e,t){var i,s,n;const r=null==t?void 0:t.edit,o=!1!==(null==t?void 0:t.scrollIntoView);if(assert(this.isCellNav(),"Expected cellNav mode"),"string"==typeof e){const t=e;assert((e=this.columns.findIndex((t=>t.id===e)))>=0,`Invalid colId: ${t}`)}if(assert(0<=e&&e0&&(s?this._updateViewportImmediately():this._updateViewportThrottled())}}setEnabled(e=!0){const t=this.enabled;return this.enabled=!!e,this.element.classList.toggle("wb-disabled",!e),t}isEnabled(){return this.enabled}isGrid(){return this.columns&&this.columns.length>1}isCellNav(){return!!this._cellNavMode}isRowNav(){return!this._cellNavMode}setCellNav(e=!0){var t;const i=this._cellNavMode;this._cellNavMode=!!e,e&&!i&&this.setColumn(0),this.element.classList.toggle("wb-cell-mode",e),null===(t=this.activeNode)||void 0===t||t.update(ChangeType.status)}setNavigationOption(e,t=!1){if(this.isGrid()||e===NavModeEnum.row)switch(this.options.navigationModeOption=e,e){case NavModeEnum.cell:this.setCellNav(!0);break;case NavModeEnum.row:this.setCellNav(!1);break;case NavModeEnum.startCell:t&&this.setCellNav(!0);break;case NavModeEnum.startRow:t&&this.setCellNav(!1);break;default:error(`Invalid mode '${e}'.`)}else this.logWarn("Plain trees only support row navigation mode.")}setStatus(e,t){return this.root.setStatus(e,t)}setTypes(e,t=!0){assert(isPlainObject(e),`Expected plain objext: ${e}`),t?this.types=e:extend(this.types,e);for(const e of Object.values(this.types))e.classes&&(e.classes=toSet(e.classes))}sortChildren(e=nodeTitleSorter,t=!1){this.root.sortChildren(e,t)}toDictArray(e){var t;return null!==(t=this.root.toDict(!0,e).children)&&void 0!==t?t:[]}_updateColumnWidths(){const e=this.element.clientWidth,t=this.columns,i=t[0];let s=0,n=0,r=0,o=!1;if("*"!==i.id)throw new Error(`First column must have id '*': got '${i.id}'.`);this._columnsById={};for(const e of t){this._columnsById[e.id]=e;const t=e.width;if("*"===e.id&&e!==i)throw new Error(`Column id '*' must be defined only once: '${e.title}'.`);if(t&&"*"!==t)if("number"==typeof t)e._weight=t,n+=t;else if("string"==typeof t&&t.endsWith("px")){e._weight=0;const i=parseFloat(t.slice(0,-2));e._widthPx!=i&&(o=!0,e._widthPx=i),r+=i}else error(`Invalid column width: ${t} (expected string ending with 'px' or number, e.g. "px" or ).`);else e._weight=1,n+=1}const l=Math.max(0,e-r);let a=0;for(const e of t){let t;if(e._weight){const i=e.minWidth;t="number"==typeof i?i:"string"==typeof i&&i.endsWith("px")?parseFloat(i.slice(0,-2)):4;const s=Math.max(t,l*e._weight/n);e._widthPx!=s&&(o=!0,e._widthPx=s)}e._ofsPx=a,a+=e._widthPx}t[t.length-1]._widthPx-=1,s=a-1;const d=`${s}px`;return this.headerElement.style.width=d,this.listContainerElement.style.width=d,o}_renderHeaderMarkup(){assert(this.headerElement,"Expected a headerElement");const e=this.hasHeader();if(setElemDisplay(this.headerElement,e),!e)return;const t=this.columns.length,i=this.headerElement.querySelector(".wb-row");assert(i,"Expected a row in header element"),i.innerHTML="".repeat(t);for(let e=0;e${r}
${l}`,this.isCellNav()&&n.classList.toggle("wb-active",e===this.activeColIdx)}}updatePendingModifications(){this.pendingChangeTypes.size>0&&this._updateViewportImmediately()}_updateViewportImmediately(){var e;if(this._disableUpdateCount)return this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount}).`),void this._disableUpdateIgnoreCount++;this._updateViewportThrottled.pending()&&this._updateViewportThrottled.cancel();const t=RenderFlag,i=new Set(this.pendingChangeTypes);this.pendingChangeTypes.clear();if(i.has(t.scroll)&&1===i.size)this._updateRows({newNodesOnly:!0});else{if(this.log("_updateViewportImmediately():",i),!1!==this.options.adjustHeight){let e=this.listContainerElement.clientHeight;const t=this.headerElement.clientHeight,i=this.element.clientHeight-t-1;Math.abs(e-i)>1&&(this.listContainerElement.style.height=i+"px",e=i)}i.has(t.clearMarkup)&&this.visit((e=>{e.removeMarkup()})),i.has(t.header)&&(this._updateColumnWidths(),this._renderHeaderMarkup()),this._updateRows()}if(this.options.connectTopBreadcrumb){let t=null===(e=this.getTopmostVpNode(!0))||void 0===e?void 0:e.getPath(!1,"title"," > ");t=t?t+" >":"",this.options.connectTopBreadcrumb.textContent=t}this._callEvent("update")}_updateRows(e){const t=!!(e=Object.assign({newNodesOnly:!1},e)).newNodesOnly,i=this.element.clientHeight,s=this.element.scrollTop;let n=Math.max(0,s/22-5);n=Math.floor(n),n%2&&n--;let r=Math.max(0,(s+i)/22+5);r=Math.ceil(r);const o=new Set;this.nodeListElement.childNodes.forEach((e=>{const t=e;o.add(t._wb_node)}));let l=0,a=0,d=!1,c="first";this.visitRows((function(e){const i=e._rowElem;e._rowIdx!==l&&(e._rowIdx=l,d=!0),lr?i&&(c=i):i&&t?(o.delete(e),i.style.top=22*l+"px",c=i):(o.delete(e),i&&(i.style.top=22*l+"px"),e._render({top:a,after:c}),c=e._rowElem),l++,a+=22})),this.treeRowCount=l;for(const e of o)e._callEvent("discard"),e.removeMarkup();return this.nodeListElement.style.height=`${a}px`,d}visit(e){return this.root.visit(e,!1)}visitRows(e,t){if(!this.root.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);let i,s,n,r,o,l,a=0,d=!1===(t=t||{}).includeSelf,c=t.start||this.root.children[0];const h=!!t.includeHidden,u=!h&&"hide"===this.filterMode;for(n=c.parent;n;){for(o=n.children,s=o.indexOf(c)+a,assert(s>=0,`Could not find ${c} in parent's children: ${n}`),i=s;it!==l&&(!u||t.match||t.subMatchCount?!1!==e(t)&&(h||!t.children||t.expanded?void 0:"skip"):"skip")),!1),!1===r))return!1}}c=n,n=n.parent,a=1,!n&&t.wrap&&(this.logDebug("visitRows(): wrap around"),assert(t.start,"`wrap` option requires `start`"),l=t.start,t.wrap=!1,n=this.root,a=0)}return!0}_visitRowsUp(e,t){let i,s,n,r=t.start||this.root.children[0];const o=!!t.includeHidden;if(!1!==t.includeSelf&&!1===e(r))return!1;for(;;){if(n=r.parent,i=n.children,i[0]===r){if(r=n,!r.parent)break;i=n.children}else for(s=i.indexOf(r),r=i[s-1];(o||r.expanded)&&r.children&&r.children.length;)i=r.children,n=r,r=i[i.length-1];if((o||r.isVisible())&&!1===e(r))return!1}return!0}load(e){return this.clear(),this.root.load(e)}enableUpdate(e){e?(assert(this._disableUpdateCount>0,"enableUpdate(true) was called too often"),this._disableUpdateCount--,0===this._disableUpdateCount&&(this.logDebug(`enableUpdate(): active again. Re-painting to catch up with ${this._disableUpdateIgnoreCount} ignored update requests...`),this._disableUpdateIgnoreCount=0,this.update(ChangeType.any,{immediate:!0}))):this._disableUpdateCount++}filterNodes(e,t){return this.extensions.filter.filterNodes(e,t)}filterBranches(e,t){return this.extensions.filter.filterBranches(e,t)}clearFilter(){return this.extensions.filter.clearFilter()}isFilterActive(){return!!this.filterMode}updateFilter(){return this.extensions.filter.updateFilter()}}Wunderbaum.sequence=0,Wunderbaum.version="v0.8.0",Wunderbaum.util=util;export{Wunderbaum}; //# sourceMappingURL=wunderbaum.esm.min.js.map \ No newline at end of file diff --git a/dist/wunderbaum.esm.min.js.map b/dist/wunderbaum.esm.min.js.map index 4be77e6b..50e684a2 100644 --- a/dist/wunderbaum.esm.min.js.map +++ b/dist/wunderbaum.esm.min.js.map @@ -1 +1 @@ -{"version":3,"file":"wunderbaum.esm.js","names":["MOUSE_BUTTONS","MAX_INT","userInfo","_getUserInfo","isMac","REX_HTML","REX_TOOLTIP","ENTITY_MAP","Deferred$1","constructor","this","thens","catches","status","resolve","value","Error","resolvedValue","forEach","t","reject","error","rejectedError","c","then","cb","unshift","promise","catch","assert","cond","msg","nav","navigator","test","platform","documentReady","callback","document","readyState","addEventListener","documentReadyPromise","Promise","each","obj","length","i","call","k","escapeHtml","s","replace","escapeRegex","escapeTooltip","extractHtmlText","indexOf","getValueFromElem","elem","coerce","tag","tagName","classList","contains","span","embeddedInput","querySelector","innerText","input","type","indeterminate","checked","valueAsDate","valueAsNumber","name","parentElement","undefined","setValueToElem","Date","select","selectedIndex","setElemDisplay","flag","style","elemFromSelector","display","elemFromHtml","html","createElement","innerHTML","trim","content","firstElementChild","_IGNORE_KEYS","Set","eventTargetFromSelector","eventToString","event","key","et","altKey","push","ctrlKey","metaKey","shiftKey","button","has","join","extend","args","arg","Object","prototype","hasOwnProperty","isArray","Array","isEmptyObject","keys","isFunction","isPlainObject","toString","noop","onEvent","rootTarget","eventNames","selectorOrHandler","handlerOrNone","selector","handler","split","evn","e","target","matches","closest","overrideMethod","instance","methodName","ctx","prevSuper","prevSuperApply","self","prevFunc","_super","apply","_superApply","argsArray","setTimeoutPromise","ms","setTimeout","err","async","sleep","toggleCheckbox","element","tristate","getOption","opts","defaultValue","ext","toSet","val","set","add","toLowerCase","adaptiveThrottle","options","waiting","pendingArgs","assign","minDelay","defaultDelay","maxDelay","delayFactor","Math","max","throttledFn","useArgs","start","now","console","elap","curDelay","min","useDelay","ChangeType","RenderFlag","NodeStatusType","NodeRegion","NavModeEnum","util","freeze","__proto__","Deferred","WunderbaumExtension","tree","id","defaults","enabled","treeOpts","extensionOpts","getPluginOption","init","_a","setPluginOption","setEnabled","onKeyEvent","data","onRender","freeGlobal","global","freeGlobalThis","globalThis","freeSelf","root","Function","isObject","debounce","func","wait","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","useRAF","requestAnimationFrame","TypeError","invokeFunc","time","thisArg","startTimer","pendingFunc","cancelAnimationFrame","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeSinceLastInvoke","timeWaiting","remainingWait","debounced","isInvoking","leadingEdge","cancel","clearTimeout","cancelTimer","flush","pending","throttle","START_MARKER","END_MARKER","RE_START_MARKER","RegExp","RE_END_MARTKER","FilterExtension","super","connectInput","autoApply","autoExpand","counter","fuzzy","hideExpandedCounter","hideExpanders","highlight","leavesOnly","mode","noData","lastFilterArgs","queryInput","filterNodes","filterMode","updateFilter","_applyFilterNoUpdate","filter","branchMode","_opts","runWithDeferredUpdate","_applyFilterImpl","match","temp","count","prevAutoCollapse","autoCollapse","hideMode","logInfo","clearFilter","map","reduce","a","b","re","reHighlight","node","title","text","res","_markFuzzyMatchedChars","titleWithHighlight","arguments","toggle","subMatchCount","visit","setStatus","ok","children","matchedByBranch","parent","visitParents","p","expanded","setExpanded","noAnimation","noEvents","_filterAutoExpanded","filterBranches","logWarn","enableUpdate","remove","escapeTitles","matchingIndices","_matchingArrIdx","_mIdx","textPoses","v","QUICKSEARCH_DELAY","KeynavExtension","_getEmbeddedInputElem","ace","getActiveColElem","_isCurInputFocused","activate","autoActivate","curInput","inputHasFocus","navModeOption","navigationModeOption","focusNode","eventName","handled","isEnabled","_callEvent","_callMethod","currentNode","getFocusNode","getActiveNode","firstNode","getFirstChild","setActive","setFocus","isColspan","isRowNav","blur","_render","quicksearch","stamp","lastQuicksearchTime","lastQuicksearchTerm","matchNode","findNextNode","preventDefault","isActive","isExpanded","isExpandable","startCell","startRow","setCellNav","toggleSelected","navigate","curInputType","inputCanFocus","logDebug","setColumn","activeColIdx","focus","click","log","isCellNav","cell","columns","LoggerExtension","ignoreEvents","prefix","extra","DEFAULT_DEBUGLEVEL","ROW_HEIGHT","ICON_WIDTH","TITLE_SPAN_PAD_Y","RENDER_MAX_PREFETCH","TEST_IMG","iconMaps","bootstrap","loading","expanderExpanded","expanderCollapsed","expanderLazy","checkChecked","checkUnchecked","checkUnknown","radioChecked","radioUnchecked","radioUnknown","folder","folderOpen","folderLazy","doc","fontawesome6","RESERVED_TREE_SOURCE_KEYS","KEY_TO_ACTION_DICT","Add","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Divide","End","Home","Multiply","PageDown","PageUp","Subtract","makeNodeTitleMatcher","makeNodeTitleStartMatcher","reMatch","nodeTitleSorter","x","y","unflattenSource","source","_b","_c","_format","_keyMap","_positional","includes","longToShort","warn","entries","positionalShort","newChildren","keyToNodeMap","indexToNodeMap","keyAttrName","childrenAttrName","index","nodeTuple","parentId","kwargs","positionalIdx","parentNode","decompressSourceData","_version","_valueMap","shortToLong","_typeList","_iter","childList","getOwnPropertyNames","propName","longName","newValue","nodeMimeType","DndExtension","autoExpandMS","multiSource","effectAllowed","dropEffectDefault","guessDropEffect","preventForeignNodes","preventLazyParents","preventNonNodes","preventRecursion","preventSameParent","preventVoidMoves","serializeClipboardData","scroll","scrollSensitivity","scrollSpeed","sourceCopyHook","dragStart","drag","dragEnd","dragEnter","dragOver","dragExpand","drop","dragLeave","srcNode","lastTargetNode","lastEnterStamp","lastAllowedDropRegions","lastDropEffect","lastDropRegion","currentScrollDir","applyScrollDirThrottled","_applyScrollDir","dndOpts","dnd","onDragEvent","bind","onDropEvent","_leaveNode","ltn","setClass","unifyDragover","size","_calcDropRegion","allowed","dy","offsetY","_guessDropEffect","ea","canCopy","canLink","canMove","_isVoidDrop","targetNode","dropRegion","getNextSibling","getPrevSibling","isDragging","sp","scrollTop","_autoScroll","viewportY","sensitivity","headerHeight","headerElement","clientHeight","height","offsetHeight","scrollHeight","Wunderbaum","getNode","dataTransfer","isEditing","nodeData","toDict","n","_orgKey","_treeId","setData","JSON","stringify","types","srcTree","dt","dropEffect","isStatusNode","isLoaded","isAncestorOf","regionSet","clientY","offsetTop","region","_isLoading","stopPropagation","getData","parse","suggestedDropMode","suggestedDropEffect","sourceNode","sourceNodeData","DragObserver","dragElem","dragging","events","thresh","_handler","handleEvent","disconnect","removeEventListener","getDragElem","stopDrag","cb_event","dragstop","dx","pageX","pageY","dragstart","GridExtension","observer","window","handleDrag","info","getEventInfo","_promise","_resolve","_reject","reason","finally","NODE_PROPS","NODE_DICT_PROPS","delete","WunderbaumNode","refKey","classes","_requestId","_errorInfo","_partsel","_partload","_rowIdx","_rowElem","sequence","icon","lazy","statusNodeType","colspan","checkbox","radiogroup","selected","unselectable","_registerNode","Symbol","iterator","cl","l","typeInfo","addChildren","before","applyMinExpanLevel","_level","getLevel","nodeList","forceExpand","minExpandLevel","child","subChildren","isUnloaded","concat","findDirectChild","pos","splice","update","structure","addNode","applyCommand","cmd","collapseSiblings","className","cnSet","cn","expandAll","depth","loadLazy","force","keepActiveNodeVisible","expandOpts","scrollIntoView","logTime","level","level_1","promises","all","logTimeEnd","activeNode","findAll","matcher","ptr","findFirst","findRelatedNode","where","includeHidden","format_iter","name_cb","connectors","_is_last","ca","_format_line","parts","format","line","getColElem","colIdx","findIndex","colElems","querySelectorAll","getLastChild","ac","idx","getParent","getParentList","includeRoot","includeSelf","dtn","getPath","part","separator","path","isFunc","hasChildren","hasClass","other","isDescendantOf","isChildOf","andCollapsed","emptyChildListExpandable","isFirstSibling","isLastSibling","isLazy","isLoading","isPagingNode","isParentOf","isPartload","isPartsel","isRadio","isRendered","isRootNode","isSelected","isTopLevel","isVisible","hasFilter","parents","_loadSourceObject","response","setTypes","colStructure","selectMode","fixSelection3FromEndNodes","_fetchWithOptions","url","params","body","rest","fetchOpts","method","URLSearchParams","fetch","json","load","requestId","prevParent","elapLoad","elapProcess","startProcess","logError","message","debugLevel","forceReload","wasExpanded","resetLazy","makeVisible","dfd","deferreds","len","seOpts","updatePendingModifications","moveTo","targetParent","triggerModifyChild","any","triggerModify","removeMarkup","_unregisterNode","removeChildren","_wb_node","_getRenderInfo","allColInfosById","renderColInfosById","col","_createIcon","iconMap","parentElem","replaceChild","showLoading","iconSpan","appendChild","cbRes","badge","tooltip","badgeClass","badgeTooltip","append","_render_markup","treeOptions","rowDiv","checkboxSpan","expanderSpan","isNew","after","top","nodeElem","ofsTitlePx","titleSpan","_ofsTitlePx","draggable","colElem","left","_ofsPx","width","_widthPx","nodeListElement","prepend","_render_data","preventScroll","textContent","skeleton","vpWidth","clientWidth","isDataChange","_render_status","renderInfo","rowClasses","image","backgroundImage","cbclass","colSpan","resizeCols","ofs","colDef","change","row","recursive","dict","scrollTo","prev","retrigger","focusTree","orgEvent","nextNode","prevNode","immediate","updateOpts","lastChild","topNode","setIcon","setKey","getSelectedNodes","stopOnParents","_anySelectable","setSelected","found","_changeSelectStatusProps","state","changed","fixSelection3AfterClick","_walk","allSelected","someSelected","sendEvents","canSelect","propagateDown","sibling","details","statusNode","_setStatusNode","firstChild","_clearStatusNode","strings","loadError","setTitle","_sortChildren","cmp","deep","sort","sortChildren","operation","modifyChild","visitSiblings","isMatched","EditExtension","minlength","maxlength","trigger","slowClickDelay","validity","beforeEdit","edit","curEditNode","relatedNode","debouncedOnChange","_onChange","_applyChange","inputElem","inputValue","_preprocessKeyEvent","isEditingTitle","_stopEditTitle","startEditTitle","inputHtml","setCustomValidity","reportValidity","stopEditTitle","focusElem","activeElement","forceClose","errMsg","validationMessage","oldValue","createNode","newNode","WbSystemRoot","extensionList","extensions","keyMap","Map","refKeyMap","treeRowCount","_disableUpdateCount","_disableUpdateIgnoreCount","_columnsById","pendingChangeTypes","_util","_cellNavMode","lastClickTime","header","rowHeightPx","fixedCol","showSpinner","connectTopBreadcrumb","iconBadge","receive","readyDeferred","ready","readyOk","_registerExtension","_updateViewportThrottled","_updateViewportImmediately","getAttribute","tabIndex","_wb_tree","wantHeader","rowElement","colDiv","dataset","coldivs","repeat","listContainerElement","_initExtensions","optName","setOption","isGrid","setNavigationOption","resizeObserver","ResizeObserver","resize","observe","mouseEvent","expander","scrollIntoViewOnExpandClick","_callHook","getTree","el","treeElem","Element","extension","rk","rks","get","hook","d","_getNodeByRowIdx","visitRows","getTopmostVpNode","complete","topIdx","ceil","floor","getLowestVpNode","scrollParent","bottomIdx","_getPrevNodeInView","reverse","_getNextNodeInView","nodeOrOpts","refNode","clear","destroy","outerHTML","hasFocus","hasHeader","hint","selectAll","toggleSelect","_selectRange","eventInfo","visible","_check","findKey","startNode","_checkNode","pageSize","bottomNode","parentCol","canonicalName","unknown","colId","column","KeyboardEvent","label","timeEnd","vpHeight","rowTop","vpTop","vpRowTop","vpRowBottom","newScrollTop","scrollToHorz","fixedWidth","scrollLeft","colLeft","Number","parseInt","colRight","newLeft","setActiveNode","RF","clearMarkup","redraw","reset","values","toDictArray","_updateColumnWidths","col0","totalWidth","totalWeight","modified","cw","_weight","endsWith","px","parseFloat","slice","restPx","ofsPx","minWidth","cmw","tw","_renderHeaderMarkup","colCount","headerRow","headerClasses","resizer","_updateRows","newNodesOnly","adjustHeight","wantHeight","abs","vp_height","startIdx","endIdx","obsoleteNodes","childNodes","tr","prevElem","_visitRowsUp","nextIdx","siblings","stopNode","siblingOfs","skipFirstNode","checkFilter","wrap","isFilterActive","version"],"sources":["wunderbaum.esm.js"],"mappings":";;;;;AAOA,MAAMA,cAAgB,CAClB,EAAG,GACH,EAAG,OACH,EAAG,SACH,EAAG,QACH,EAAG,OACH,EAAG,WAEDC,QAAU,iBACVC,SAAWC,eAEXC,MAAQF,SAASE,MACjBC,SAAW,YACXC,YAAc,WACdC,WAAa,CACf,IAAK,QACL,IAAK,OACL,IAAK,OACL,IAAK,SACL,IAAK,QACL,IAAK,UAKT,IAAIC,WAAa,MACb,WAAAC,GACIC,KAAKC,MAAQ,GACbD,KAAKE,QAAU,GACfF,KAAKG,OAAS,EAClB,CACA,OAAAC,CAAQC,GACJ,GAAIL,KAAKG,OACL,MAAM,IAAIG,MAAM,mBAEpBN,KAAKG,OAAS,WACdH,KAAKO,cAAgBF,EACrBL,KAAKC,MAAMO,SAASC,GAAMA,EAAEJ,KAC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Kw3B,WAAW5mB,OAAOY,aAClC,CAMA,cAAAgwB,GACI,QAASxhC,KAAKyQ,UAClB,CAMA,YAAAC,GACI,OAAO1Q,KAAKw3B,WAAW5mB,OAAOF,cAClC,EAEJqQ,WAAWuE,SAAW,EAEtBvE,WAAW0gB,QAAU,SAErB1gB,WAAW5V,KAAOA,YAET4V"} \ No newline at end of file +{"version":3,"file":"wunderbaum.esm.js","names":["freeGlobal","global","Object","freeGlobalThis","globalThis","freeSelf","self","root","Function","isObject","value","type","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","useRAF","requestAnimationFrame","TypeError","invokeFunc","time","args","thisArg","undefined","apply","startTimer","pendingFunc","cancelAnimationFrame","setTimeout","shouldInvoke","timeSinceLastCall","timerExpired","Date","now","trailingEdge","timeSinceLastInvoke","timeWaiting","Math","min","remainingWait","debounced","isInvoking","this","leadingEdge","max","cancel","id","clearTimeout","cancelTimer","flush","pending","throttle","MOUSE_BUTTONS","MAX_INT","userInfo","_getUserInfo","isMac","REX_HTML","REX_TOOLTIP","ENTITY_MAP","ValidationError","Error","constructor","message","super","name","Deferred$1","thens","catches","status","resolve","resolvedValue","forEach","t","reject","error","rejectedError","c","then","cb","unshift","promise","catch","assert","cond","msg","nav","navigator","test","platform","documentReady","callback","document","readyState","addEventListener","documentReadyPromise","Promise","each","obj","length","i","call","k","escapeHtml","s","replace","escapeRegex","escapeTooltip","extractHtmlText","indexOf","getValueFromElem","elem","coerce","tag","tagName","classList","contains","span","embeddedInput","querySelector","innerText","input","indeterminate","checked","valueAsDate","valueAsNumber","parentElement","setValueToElem","select","selectedIndex","setElemDisplay","flag","style","elemFromSelector","display","elemFromHtml","html","createElement","innerHTML","trim","content","firstElementChild","_IGNORE_KEYS","Set","eventToString","event","key","et","altKey","push","ctrlKey","metaKey","shiftKey","button","has","join","extend","arg","prototype","hasOwnProperty","isArray","Array","isEmptyObject","keys","isFunction","isPlainObject","toString","noop","onEvent","rootTarget","eventNames","selectorOrHandler","handlerOrNone","selector","handler","split","evn","e","target","matches","closest","overrideMethod","instance","methodName","ctx","prevSuper","prevSuperApply","prevFunc","_super","_superApply","argsArray","setTimeoutPromise","ms","err","async","sleep","toggleCheckbox","element","tristate","getOption","opts","defaultValue","ext","toSet","val","set","add","toLowerCase","adaptiveThrottle","assign","minDelay","defaultDelay","maxDelay","delayFactor","waiting","pendingArgs","pendingTimer","throttledFn","useArgs","start","console","elap","curDelay","useDelay","ChangeType","RenderFlag","NodeStatusType","NodeRegion","NavModeEnum","util","freeze","__proto__","Deferred","WunderbaumExtension","tree","defaults","enabled","treeOpts","extensionOpts","getPluginOption","init","_a","setPluginOption","setEnabled","onKeyEvent","data","onRender","START_MARKER","END_MARKER","RE_START_MARKER","RegExp","RE_END_MARTKER","FilterExtension","connectInput","autoApply","autoExpand","counter","fuzzy","hideExpandedCounter","hideExpanders","highlight","leavesOnly","mode","noData","lastFilterArgs","queryInput","filterNodes","filterMode","updateFilter","_applyFilterNoUpdate","filter","branchMode","_opts","runWithDeferredUpdate","_applyFilterImpl","match","temp","count","prevAutoCollapse","autoCollapse","hideMode","logInfo","clearFilter","map","reduce","a","b","re","reHighlight","node","title","text","res","_markFuzzyMatchedChars","titleWithHighlight","arguments","toggle","subMatchCount","visit","setStatus","ok","children","matchedByBranch","parent","visitParents","p","expanded","setExpanded","noAnimation","noEvents","_filterAutoExpanded","filterBranches","logWarn","enableUpdate","remove","escapeTitles","matchingIndices","_matchingArrIdx","_mIdx","textPoses","v","QUICKSEARCH_DELAY","KeynavExtension","_getEmbeddedInputElem","ace","getActiveColElem","_isCurInputFocused","activate","autoActivate","curInput","inputHasFocus","navModeOption","navigationModeOption","focusNode","eventName","handled","isEnabled","_callEvent","_callMethod","currentNode","getFocusNode","getActiveNode","firstNode","getFirstChild","setActive","setFocus","isColspan","isRowNav","blur","_render","quicksearch","stamp","lastQuicksearchTime","lastQuicksearchTerm","matchNode","findNextNode","preventDefault","isActive","isExpanded","isExpandable","startCell","startRow","setCellNav","toggleSelected","navigate","curInputType","inputCanFocus","logDebug","setCustomValidity","setColumn","activeColIdx","checkValidity","focus","click","log","isCellNav","cell","columns","LoggerExtension","ignoreEvents","prefix","extra","DEFAULT_DEBUGLEVEL","ROW_HEIGHT","ICON_WIDTH","TITLE_SPAN_PAD_Y","RENDER_MAX_PREFETCH","TEST_IMG","iconMaps","bootstrap","loading","expanderExpanded","expanderCollapsed","expanderLazy","checkChecked","checkUnchecked","checkUnknown","radioChecked","radioUnchecked","radioUnknown","folder","folderOpen","folderLazy","doc","fontawesome6","RESERVED_TREE_SOURCE_KEYS","KEY_TO_ACTION_DICT","Add","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Divide","End","Home","Multiply","PageDown","PageUp","Subtract","makeNodeTitleMatcher","makeNodeTitleStartMatcher","reMatch","nodeTitleSorter","x","y","unflattenSource","source","_b","_c","_format","_keyMap","_positional","includes","longToShort","warn","entries","positionalShort","newChildren","keyToNodeMap","indexToNodeMap","keyAttrName","childrenAttrName","index","nodeTuple","parentId","kwargs","positionalIdx","parentNode","decompressSourceData","_version","_valueMap","shortToLong","_typeList","_iter","childList","getOwnPropertyNames","propName","longName","newValue","nodeMimeType","DndExtension","autoExpandMS","multiSource","effectAllowed","dropEffectDefault","guessDropEffect","preventForeignNodes","preventLazyParents","preventNonNodes","preventRecursion","preventSameParent","preventVoidMoves","serializeClipboardData","scroll","scrollSensitivity","scrollSpeed","sourceCopyHook","dragStart","drag","dragEnd","dragEnter","dragOver","dragExpand","drop","dragLeave","srcNode","lastTargetNode","lastEnterStamp","lastAllowedDropRegions","lastDropEffect","lastDropRegion","currentScrollDir","applyScrollDirThrottled","_applyScrollDir","dndOpts","dnd","onDragEvent","bind","onDropEvent","_leaveNode","ltn","setClass","unifyDragover","size","_calcDropRegion","allowed","dy","offsetY","_guessDropEffect","ea","canCopy","canLink","canMove","_isVoidDrop","targetNode","dropRegion","getNextSibling","getPrevSibling","isDragging","sp","scrollTop","_autoScroll","viewportY","sensitivity","headerHeight","headerElement","clientHeight","height","offsetHeight","scrollHeight","Wunderbaum","getNode","dataTransfer","isEditingTitle","nodeData","toDict","n","_orgKey","_treeId","setData","JSON","stringify","types","srcTree","dt","dropEffect","isStatusNode","isLoaded","isAncestorOf","regionSet","clientY","offsetTop","region","_isLoading","stopPropagation","getData","parse","suggestedDropMode","suggestedDropEffect","sourceNode","sourceNodeData","DragObserver","dragElem","dragging","events","thresh","_handler","handleEvent","disconnect","removeEventListener","getDragElem","stopDrag","cb_event","dragstop","dx","pageX","pageY","dragstart","GridExtension","observer","window","handleDrag","info","getEventInfo","_promise","_resolve","_reject","reason","finally","NODE_PROPS","NODE_DICT_PROPS","delete","WunderbaumNode","refKey","classes","_requestId","_errorInfo","_partsel","_partload","_rowIdx","_rowElem","sequence","icon","lazy","statusNodeType","colspan","checkbox","radiogroup","selected","unselectable","_registerNode","Symbol","iterator","cl","l","typeInfo","addChildren","before","applyMinExpanLevel","_level","getLevel","nodeList","forceExpand","minExpandLevel","child","subChildren","isUnloaded","concat","findDirectChild","pos","splice","update","structure","addNode","applyCommand","cmd","collapseSiblings","className","cnSet","cn","startEditTitle","expandAll","depth","loadLazy","force","keepActiveNodeVisible","expandOpts","scrollIntoView","logTime","level","level_1","promises","all","logTimeEnd","activeNode","findAll","matcher","ptr","findFirst","findRelatedNode","where","includeHidden","format_iter","name_cb","connectors","_is_last","ca","_format_line","parts","format","line","getColElem","colIdx","findIndex","colElems","querySelectorAll","getCloneList","includeSelf","clones","findByRefKey","getLastChild","ac","idx","getParent","getParentList","includeRoot","dtn","getPath","part","separator","path","isFunc","hasChildren","hasClass","other","isDescendantOf","isChildOf","isClone","andCollapsed","emptyChildListExpandable","isFirstSibling","isLastSibling","isLazy","isLoading","isPagingNode","isParentOf","isPartload","isPartsel","isRadio","isRendered","isRootNode","isSelected","isTopLevel","isVisible","hasFilter","parents","_loadSourceObject","response","setTypes","colStructure","selectMode","fixSelection3FromEndNodes","_fetchWithOptions","url","params","body","rest","fetchOpts","method","URLSearchParams","fetch","json","load","requestId","prevParent","elapLoad","elapProcess","startProcess","logError","debugLevel","forceReload","wasExpanded","resetLazy","makeVisible","dfd","deferreds","len","seOpts","updatePendingModifications","moveTo","targetParent","triggerModifyChild","any","triggerModify","removeMarkup","_unregisterNode","removeChildren","_wb_node","_getRenderInfo","allColInfosById","renderColInfosById","col","_createIcon","iconMap","parentElem","replaceChild","showLoading","iconSpan","appendChild","cbRes","badge","tooltip","badgeClass","badgeTooltip","append","_render_markup","treeOptions","rowDiv","checkboxSpan","expanderSpan","isNew","after","top","nodeElem","ofsTitlePx","titleSpan","_ofsTitlePx","draggable","colElem","left","_ofsPx","width","_widthPx","nodeListElement","prepend","_render_data","preventScroll","textContent","skeleton","vpWidth","clientWidth","isDataChange","_render_status","renderInfo","rowClasses","image","backgroundImage","cbclass","colSpan","resizeCols","ofs","colDef","change","row","recursive","dict","scrollTo","prev","retrigger","focusTree","orgEvent","edit","nextNode","prevNode","immediate","sendEvents","updateOpts","lastChild","topNode","setIcon","setKey","getSelectedNodes","stopOnParents","_anySelectable","setSelected","found","_changeSelectStatusProps","state","changed","fixSelection3AfterClick","_walk","allSelected","someSelected","canSelect","propagateDown","sibling","details","statusNode","_setStatusNode","firstChild","_clearStatusNode","strings","loadError","setTitle","_sortChildren","cmp","deep","sort","sortChildren","operation","modifyChild","visitSiblings","isMatched","EditExtension","minlength","maxlength","trigger","slowClickDelay","validity","beforeEdit","curEditNode","relatedNode","debouncedOnChange","_onChange","_applyChange","inputElem","validationMessage","reportValidity","inputValue","inputValid","_preprocessKeyEvent","_stopEditTitle","inputHtml","opt","stopEditTitle","focusElem","activeElement","forceClose","errMsg","oldValue","createNode","newNode","WbSystemRoot","extensionList","extensions","keyMap","Map","refKeyMap","treeRowCount","_disableUpdateCount","_disableUpdateIgnoreCount","_columnsById","pendingChangeTypes","_util","_cellNavMode","lastClickTime","header","rowHeightPx","fixedCol","showSpinner","connectTopBreadcrumb","iconBadge","receive","readyDeferred","ready","readyOk","_registerExtension","_updateViewportThrottled","_updateViewportImmediately","getAttribute","tabIndex","_wb_tree","wantHeader","rowElement","colDiv","dataset","coldivs","repeat","listContainerElement","_initExtensions","optName","setOption","isGrid","setNavigationOption","resizeObserver","ResizeObserver","resize","observe","mouseEvent","expander","scrollIntoViewOnExpandClick","_callHook","getTree","el","treeElem","Element","extension","rk","rks","get","hook","d","_getNodeByRowIdx","visitRows","getTopmostVpNode","complete","topIdx","ceil","floor","getLowestVpNode","scrollParent","bottomIdx","_getPrevNodeInView","reverse","_getNextNodeInView","nodeOrOpts","refNode","clear","destroy","outerHTML","hasFocus","hasHeader","hint","selectAll","toggleSelect","_selectRange","eventInfo","visible","_check","from","findKey","startNode","_checkNode","pageSize","bottomNode","parentCol","canonicalName","unknown","colId","column","KeyboardEvent","isEditing","label","timeEnd","vpHeight","rowTop","vpTop","vpRowTop","vpRowBottom","newScrollTop","scrollToHorz","fixedWidth","scrollLeft","colLeft","Number","parseInt","colRight","newLeft","cid","setActiveNode","RF","clearMarkup","redraw","reset","values","toDictArray","_updateColumnWidths","col0","totalWidth","totalWeight","modified","cw","_weight","endsWith","px","parseFloat","slice","restPx","ofsPx","minWidth","cmw","tw","_renderHeaderMarkup","colCount","headerRow","headerClasses","resizer","_updateRows","newNodesOnly","adjustHeight","wantHeight","abs","vp_height","startIdx","endIdx","obsoleteNodes","childNodes","tr","prevElem","_visitRowsUp","nextIdx","siblings","stopNode","siblingOfs","skipFirstNode","checkFilter","wrap","isFilterActive","version"],"sources":["wunderbaum.esm.js"],"mappings":";;;;;AAOA,MAAMA,WAA+B,iBAAXC,QACX,OAAXA,QACAA,OAAOC,SAAWA,QAClBD,OAEEE,eAAuC,iBAAfC,YACX,OAAfA,YACAA,WAAWF,QAAUA,QACrBE,WAEEC,SAA2B,iBAATC,MAA8B,OAATA,MAAiBA,KAAKJ,SAAWA,QAAUI,KAElFC,KAAOJ,gBAAkBH,YAAcK,UAAYG,SAA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CACX,CAOA,IAAA4b,CAAKlT,GAED,OADAjY,KAAK85B,QACE95B,KAAK7C,KAAKguB,KAAKlT,EAC1B,CAgBA,YAAAlH,CAAatL,GAOLA,GACAhD,OAAOzC,KAAK01B,oBAAsB,EAAG,2CACrC11B,KAAK01B,sBAI4B,IAA7B11B,KAAK01B,sBACL11B,KAAKqU,SAAS,8DAA8DrU,KAAK21B,wDACjF31B,KAAK21B,0BAA4B,EACjC31B,KAAK8kB,OAAOxZ,WAAWihB,IAAK,CAAEwE,WAAW,MAI7C/wB,KAAK01B,qBAOb,CAOA,WAAA1nB,CAAYI,EAAQzQ,GAChB,OAAOqC,KAAKq1B,WAAWjnB,OAAOJ,YAAYI,EAAQzQ,EACtD,CAIA,cAAAkT,CAAezC,EAAQzQ,GACnB,OAAOqC,KAAKq1B,WAAWjnB,OAAOyC,eAAezC,EAAQzQ,EACzD,CAIA,WAAAqR,GACI,OAAOhP,KAAKq1B,WAAWjnB,OAAOY,aAClC,CAIA,cAAAwwB,GACI,QAASx/B,KAAKiO,UAClB,CAIA,YAAAC,GACI,OAAOlO,KAAKq1B,WAAWjnB,OAAOF,cAClC,EAEJuQ,WAAWuE,SAAW,EAEtBvE,WAAWghB,QAAU,SAErBhhB,WAAW9S,KAAOA,YAET8S"} \ No newline at end of file diff --git a/dist/wunderbaum.umd.js b/dist/wunderbaum.umd.js index 59a24825..501bd344 100644 --- a/dist/wunderbaum.umd.js +++ b/dist/wunderbaum.umd.js @@ -1,7635 +1,7814 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.mar10 = {})); + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.mar10 = {})); })(this, (function (exports) { 'use strict'; - /*! - * Wunderbaum - util - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - /** @module util */ - /** Readable names for `MouseEvent.button` */ - const MOUSE_BUTTONS = { - 0: "", - 1: "left", - 2: "middle", - 3: "right", - 4: "back", - 5: "forward", - }; - const MAX_INT = 9007199254740991; - const userInfo = _getUserInfo(); - /**True if the client is using a macOS platform. */ - const isMac = userInfo.isMac; - const REX_HTML = /[&<>"'/]/g; // Escape those characters - const REX_TOOLTIP = /[<>"'/]/g; // Don't escape `&` in tooltips - const ENTITY_MAP = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - "/": "/", - }; - /** - * A ES6 Promise, that exposes the resolve()/reject() methods. - */ - let Deferred$1 = class Deferred { - constructor() { - this.thens = []; - this.catches = []; - this.status = ""; - } - resolve(value) { - if (this.status) { - throw new Error("already settled"); - } - this.status = "resolved"; - this.resolvedValue = value; - this.thens.forEach((t) => t(value)); - this.thens = []; // Avoid memleaks. - } - reject(error) { - if (this.status) { - throw new Error("already settled"); - } - this.status = "rejected"; - this.rejectedError = error; - this.catches.forEach((c) => c(error)); - this.catches = []; // Avoid memleaks. - } - then(cb) { - if (status === "resolved") { - cb(this.resolvedValue); - } - else { - this.thens.unshift(cb); - } - } - catch(cb) { - if (this.status === "rejected") { - cb(this.rejectedError); - } - else { - this.catches.unshift(cb); - } - } - promise() { - return { - then: this.then, - catch: this.catch, - }; - } - }; - /**Throw an `Error` if `cond` is falsey. */ - function assert(cond, msg) { - if (!cond) { - msg = msg || "Assertion failed."; - throw new Error(msg); - } - } - function _getUserInfo() { - const nav = navigator; - // const ua = nav.userAgentData; - const res = { - isMac: /Mac/.test(nav.platform), - }; - return res; - } - /** Run `callback` when document was loaded. */ - function documentReady(callback) { - if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", callback); - } - else { - callback(); - } - } - /** Resolve when document was loaded. */ - function documentReadyPromise() { - return new Promise((resolve) => { - documentReady(resolve); - }); - } - /** - * Iterate over Object properties or array elements. - * - * @param obj `Object`, `Array` or null - * @param callback(index, item) called for every item. - * `this` also contains the item. - * Return `false` to stop the iteration. - */ - function each(obj, callback) { - if (obj == null) { - // accept `null` or `undefined` - return obj; - } - const length = obj.length; - let i = 0; - if (typeof length === "number") { - for (; i < length; i++) { - if (callback.call(obj[i], i, obj[i]) === false) { - break; - } - } - } - else { - for (const k in obj) { - if (callback.call(obj[i], k, obj[k]) === false) { - break; - } - } - } - return obj; - } - /** Shortcut for `throw new Error(msg)`.*/ - function error(msg) { - throw new Error(msg); - } - /** Convert `<`, `>`, `&`, `"`, `'`, and `/` to the equivalent entities. */ - function escapeHtml(s) { - return ("" + s).replace(REX_HTML, function (s) { - return ENTITY_MAP[s]; - }); - } - // export function escapeRegExp(s: string) { - // return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string - // } - /**Convert a regular expression string by escaping special characters (e.g. `"$"` -> `"\$"`) */ - function escapeRegex(s) { - return ("" + s).replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - } - /** Convert `<`, `>`, `"`, `'`, and `/` (but not `&`) to the equivalent entities. */ - function escapeTooltip(s) { - return ("" + s).replace(REX_TOOLTIP, function (s) { - return ENTITY_MAP[s]; - }); - } - /** TODO */ - function extractHtmlText(s) { - if (s.indexOf(">") >= 0) { - error("Not implemented"); - // return $("
").html(s).text(); - } - return s; - } - /** - * Read the value from an HTML input element. - * - * If a `` is passed, the first child input is used. - * Depending on the target element type, `value` is interpreted accordingly. - * For example for a checkbox, a value of true, false, or null is returned if - * the element is checked, unchecked, or indeterminate. - * For datetime input control a numerical value is assumed, etc. - * - * Common use case: store the new user input in a `change` event handler: - * - * ```ts - * change: (e) => { - * const tree = e.tree; - * const node = e.node; - * // Read the value from the input control that triggered the change event: - * let value = tree.getValueFromElem(e.element); - * // and store it to the node model (assuming the column id matches the property name) - * node.data[e.info.colId] = value; - * }, - * ``` - * @param elem `` or `` or `` or `` or `` handle it - node.logDebug(`Ignored ${eventName} inside focused input`); - return; - } - // const curInputType = curInput.type || curInput.tagName; - // const breakoutKeys = INPUT_KEYS[curInputType]; - // if (!breakoutKeys.includes(eventName)) { - // node.logDebug(`Ignored ${eventName} inside ${curInputType} input`); - // return; - // } - } - else if (curInput) { - // On a cell that has an embedded, unfocused - if (eventName.length === 1 && inputCanFocus) { - curInput.focus(); - curInput.value = ""; - node.logDebug(`Focus imput: ${eventName}`); - return false; - } - } - if (eventName === "Tab") { - eventName = "ArrowRight"; - handled = true; - } - else if (eventName === "Shift+Tab") { - eventName = tree.activeColIdx > 0 ? "ArrowLeft" : ""; - handled = true; - } - else ; - switch (eventName) { - case "+": - case "Add": - // case "=": // 187: '+' @ Chrome, Safari - node.setExpanded(true); - break; - case "-": - case "Subtract": - node.setExpanded(false); - break; - case " ": // Space - if (tree.activeColIdx === 0 && node.getOption("checkbox")) { - node.toggleSelected(); - handled = true; - } - else if (curInput && curInputType === "checkbox") { - curInput.click(); - // toggleCheckbox(curInput) - // new Event("change") - // curInput.change - handled = true; - } - break; - case "F2": - if (curInput && !inputHasFocus && inputCanFocus) { - curInput.focus(); - handled = true; - } - break; - case "Enter": - tree.setFocus(); // Blur prev. input if any - if ((tree.activeColIdx === 0 || isColspan) && node.isExpandable()) { - node.setExpanded(!node.isExpanded()); - handled = true; - } - else if (curInput && !inputHasFocus && inputCanFocus) { - curInput.focus(); - handled = true; - } - break; - case "Escape": - tree.setFocus(); // Blur prev. input if any - node.log(`keynav: focus tree...`); - if (tree.isCellNav() && navModeOption !== NavModeEnum.cell) { - node.log(`keynav: setCellNav(false)`); - tree.setCellNav(false); // row-nav mode - tree.setFocus(); // - handled = true; - } - break; - case "ArrowLeft": - tree.setFocus(); // Blur prev. input if any - if (isColspan && node.isExpanded()) { - node.setExpanded(false); - } - else if (!isColspan && tree.activeColIdx > 0) { - tree.setColumn(tree.activeColIdx - 1); - } - else if (navModeOption !== NavModeEnum.cell) { - tree.setCellNav(false); // row-nav mode - } - handled = true; - break; - case "ArrowRight": - tree.setFocus(); // Blur prev. input if any - if (isColspan && !node.isExpanded()) { - node.setExpanded(); - } - else if (!isColspan && - tree.activeColIdx < tree.columns.length - 1) { - tree.setColumn(tree.activeColIdx + 1); - } - handled = true; - break; - case "Home": // Generated by [Fn] + ArrowLeft on Mac - // case "Meta+ArrowLeft": - tree.setFocus(); // Blur prev. input if any - if (!isColspan && tree.activeColIdx > 0) { - tree.setColumn(0); - } - handled = true; - break; - case "End": // Generated by [Fn] + ArrowRight on Mac - // case "Meta+ArrowRight": - tree.setFocus(); // Blur prev. input if any - if (!isColspan && tree.activeColIdx < tree.columns.length - 1) { - tree.setColumn(tree.columns.length - 1); - } - handled = true; - break; - case "ArrowDown": - case "ArrowUp": - case "Backspace": - case "Control+End": // Generated by Control + [Fn] + ArrowRight on Mac - case "Control+Home": // Generated by Control + [Fn] + Arrowleft on Mac - case "Meta+ArrowDown": // [⌘] + ArrowDown on Mac - case "Meta+ArrowUp": // [⌘] + ArrowUp on Mac - case "PageDown": // Generated by [Fn] + ArrowDown on Mac - case "PageUp": // Generated by [Fn] + ArrowUp on Mac - node.navigate(eventName, { activate: activate, event: event }); - // if (isCellEditMode) { - // this._getEmbeddedInputElem(null, true); // set focus to input - // } - handled = true; - break; - default: - handled = false; - } - } - if (handled) { - event.preventDefault(); - } - return; - } - } + /*! + * Wunderbaum - ext-keynav + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + const QUICKSEARCH_DELAY = 500; + class KeynavExtension extends WunderbaumExtension { + constructor(tree) { + super(tree, "keynav", {}); + } + _getEmbeddedInputElem(elem) { + var _a; + let input = null; + if (elem && elem.type != null) { + input = elem; + } + else { + // ,[contenteditable] + const ace = (_a = this.tree.getActiveColElem()) === null || _a === void 0 ? void 0 : _a.querySelector("input,select"); + if (ace) { + input = ace; + } + } + return input; + } + // /* Return the current cell's embedded input that has keyboard focus. */ + // protected _getFocusedInputElem(): HTMLInputElement | null { + // const ace = this.tree + // .getActiveColElem() + // ?.querySelector("input:focus,select:focus"); + // return ace || null; + // } + /* Return true if the current cell's embedded input has keyboard focus. */ + _isCurInputFocused() { + var _a; + const ace = (_a = this.tree + .getActiveColElem()) === null || _a === void 0 ? void 0 : _a.querySelector("input:focus,select:focus"); + return !!ace; + } + onKeyEvent(data) { + const event = data.event; + const tree = this.tree; + const opts = data.options; + const activate = !event.ctrlKey || opts.autoActivate; + const curInput = this._getEmbeddedInputElem(event.target); + const inputHasFocus = curInput && this._isCurInputFocused(); + const navModeOption = opts.navigationModeOption; + let focusNode, eventName = eventToString(event), node = data.node, handled = true; + // tree.log(`onKeyEvent: ${eventName}, curInput`, curInput); + if (!tree.isEnabled()) { + // tree.logDebug(`onKeyEvent ignored for disabled tree: ${eventName}`); + return false; + } + // Let callback prevent default processing + if (tree._callEvent("keydown", data) === false) { + return false; + } + // Let ext-edit trigger editing + if (tree._callMethod("edit._preprocessKeyEvent", data) === false) { + return false; + } + // Set focus to active (or first node) if no other node has the focus yet + if (!node) { + const currentNode = tree.getFocusNode() || tree.getActiveNode(); + const firstNode = tree.getFirstChild(); + if (!currentNode && firstNode && eventName === "ArrowDown") { + firstNode.logInfo("Keydown: activate first node."); + firstNode.setActive(); + return; + } + focusNode = currentNode || firstNode; + if (focusNode) { + focusNode.setFocus(); + node = tree.getFocusNode(); + node.logInfo("Keydown: force focus on active node."); + } + } + const isColspan = node.isColspan(); + if (tree.isRowNav()) { + // ----------------------------------------------------------------------- + // --- Row Mode --- + // ----------------------------------------------------------------------- + if (inputHasFocus) { + // If editing an embedded input control, let the control handle all + // keys. Only Enter and Escape should apply / discard, but keep the + // keyboard focus. + switch (eventName) { + case "Enter": + curInput.blur(); + tree.setFocus(); + break; + case "Escape": + node._render(); + tree.setFocus(); + break; + } + return; + } + // --- Quick-Search + if (opts.quicksearch && + eventName.length === 1 && + /^\w$/.test(eventName) && + !curInput) { + // Allow to search for longer streaks if typed in quickly + const stamp = Date.now(); + if (stamp - tree.lastQuicksearchTime > QUICKSEARCH_DELAY) { + tree.lastQuicksearchTerm = ""; + } + tree.lastQuicksearchTime = stamp; + tree.lastQuicksearchTerm += eventName; + const matchNode = tree.findNextNode(tree.lastQuicksearchTerm, tree.getActiveNode()); + if (matchNode) { + matchNode.setActive(true, { event: event }); + } + event.preventDefault(); + return; + } + // Pre-Evaluate expand/collapse action for LEFT/RIGHT + switch (eventName) { + case "Enter": + if (node.isActive()) { + if (node.isExpanded()) { + eventName = "Subtract"; // callapse + } + else if (node.isExpandable(true)) { + eventName = "Add"; // expand + } + } + break; + case "ArrowLeft": + if (node.expanded) { + eventName = "Subtract"; // collapse + } + break; + case "ArrowRight": + if (!node.expanded && node.isExpandable(true)) { + eventName = "Add"; // expand + } + else if (navModeOption === NavModeEnum.startCell || + navModeOption === NavModeEnum.startRow) { + event.preventDefault(); + tree.setCellNav(); + return false; + } + break; + } + // Standard navigation (row mode) + switch (eventName) { + case "+": + case "Add": + // case "=": // 187: '+' @ Chrome, Safari + node.setExpanded(true); + break; + case "-": + case "Subtract": + node.setExpanded(false); + break; + case " ": // Space + // if (node.isPagingNode()) { + // tree._triggerNodeEvent("clickPaging", ctx, event); + // } else + if (node.getOption("checkbox")) { + node.toggleSelected(); + } + else { + node.setActive(true, { event: event }); + } + break; + case "Enter": + node.setActive(true, { event: event }); + break; + case "ArrowDown": + case "ArrowLeft": + case "ArrowRight": + case "ArrowUp": + case "Backspace": + case "End": + case "Home": + case "Control+End": + case "Control+Home": + case "Meta+ArrowDown": + case "Meta+ArrowUp": + case "PageDown": + case "PageUp": + node.navigate(eventName, { activate: activate, event: event }); + break; + default: + handled = false; + } + } + else { + // ----------------------------------------------------------------------- + // --- Cell Mode --- + // ----------------------------------------------------------------------- + // // Standard navigation (cell mode) + // if (isCellEditMode && INPUT_BREAKOUT_KEYS.has(eventName)) { + // } + // const curInput = this._getEmbeddedInputElem(null); + const curInputType = curInput ? curInput.type || curInput.tagName : ""; + // const inputHasFocus = curInput && this._isCurInputFocused(); + const inputCanFocus = curInput && curInputType !== "checkbox"; + if (inputHasFocus) { + if (eventName === "Escape") { + node.logDebug(`Reset focused input on Escape`); + // Discard changes and reset input validation state + curInput.setCustomValidity(""); + node._render(); + // Keep cell-nav mode + tree.setFocus(); + tree.setColumn(tree.activeColIdx); + return; + // } else if (!INPUT_BREAKOUT_KEYS.has(eventName)) { + } + else if (eventName !== "Enter") { + if (curInput && curInput.checkValidity && !curInput.checkValidity()) { + // Invalid input: ignore all keys except Enter and Escape + node.logDebug(`Ignored ${eventName} inside invalid input`); + return false; + } + // Let current `` handle it + node.logDebug(`Ignored ${eventName} inside focused input`); + return; + } + // const curInputType = curInput.type || curInput.tagName; + // const breakoutKeys = INPUT_KEYS[curInputType]; + // if (!breakoutKeys.includes(eventName)) { + // node.logDebug(`Ignored ${eventName} inside ${curInputType} input`); + // return; + // } + } + else if (curInput) { + // On a cell that has an embedded, unfocused + if (eventName.length === 1 && inputCanFocus) { + // Typing a single char + curInput.focus(); + curInput.value = ""; + node.logDebug(`Focus input: ${eventName}`); + return false; + } + } + if (eventName === "Tab") { + eventName = "ArrowRight"; + handled = true; + } + else if (eventName === "Shift+Tab") { + eventName = tree.activeColIdx > 0 ? "ArrowLeft" : ""; + handled = true; + } + switch (eventName) { + case "+": + case "Add": + // case "=": // 187: '+' @ Chrome, Safari + node.setExpanded(true); + break; + case "-": + case "Subtract": + node.setExpanded(false); + break; + case " ": // Space + if (tree.activeColIdx === 0 && node.getOption("checkbox")) { + node.toggleSelected(); + handled = true; + } + else if (curInput && curInputType === "checkbox") { + curInput.click(); + // toggleCheckbox(curInput) + // new Event("change") + // curInput.change + handled = true; + } + break; + case "F2": + if (curInput && !inputHasFocus && inputCanFocus) { + curInput.focus(); + handled = true; + } + break; + case "Enter": + tree.setFocus(); // Blur prev. input if any + if ((tree.activeColIdx === 0 || isColspan) && node.isExpandable()) { + node.setExpanded(!node.isExpanded()); + handled = true; + } + else if (curInput && !inputHasFocus && inputCanFocus) { + curInput.focus(); + handled = true; + } + break; + case "Escape": + tree.setFocus(); // Blur prev. input if any + node.log(`keynav: focus tree...`); + if (tree.isCellNav() && navModeOption !== NavModeEnum.cell) { + node.log(`keynav: setCellNav(false)`); + tree.setCellNav(false); // row-nav mode + tree.setFocus(); // + handled = true; + } + break; + case "ArrowLeft": + tree.setFocus(); // Blur prev. input if any + if (isColspan && node.isExpanded()) { + node.setExpanded(false); + } + else if (!isColspan && tree.activeColIdx > 0) { + tree.setColumn(tree.activeColIdx - 1); + } + else if (navModeOption !== NavModeEnum.cell) { + tree.setCellNav(false); // row-nav mode + } + handled = true; + break; + case "ArrowRight": + tree.setFocus(); // Blur prev. input if any + if (isColspan && !node.isExpanded()) { + node.setExpanded(); + } + else if (!isColspan && + tree.activeColIdx < tree.columns.length - 1) { + tree.setColumn(tree.activeColIdx + 1); + } + handled = true; + break; + case "Home": // Generated by [Fn] + ArrowLeft on Mac + // case "Meta+ArrowLeft": + tree.setFocus(); // Blur prev. input if any + if (!isColspan && tree.activeColIdx > 0) { + tree.setColumn(0); + } + handled = true; + break; + case "End": // Generated by [Fn] + ArrowRight on Mac + // case "Meta+ArrowRight": + tree.setFocus(); // Blur prev. input if any + if (!isColspan && tree.activeColIdx < tree.columns.length - 1) { + tree.setColumn(tree.columns.length - 1); + } + handled = true; + break; + case "ArrowDown": + case "ArrowUp": + case "Backspace": + case "Control+End": // Generated by Control + [Fn] + ArrowRight on Mac + case "Control+Home": // Generated by Control + [Fn] + Arrowleft on Mac + case "Meta+ArrowDown": // [⌘] + ArrowDown on Mac + case "Meta+ArrowUp": // [⌘] + ArrowUp on Mac + case "PageDown": // Generated by [Fn] + ArrowDown on Mac + case "PageUp": // Generated by [Fn] + ArrowUp on Mac + node.navigate(eventName, { activate: activate, event: event }); + // if (isCellEditMode) { + // this._getEmbeddedInputElem(null, true); // set focus to input + // } + handled = true; + break; + default: + handled = false; + } + } + if (handled) { + event.preventDefault(); + } + return; + } + } - /*! - * Wunderbaum - ext-logger - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - class LoggerExtension extends WunderbaumExtension { - constructor(tree) { - super(tree, "logger", {}); - this.ignoreEvents = new Set([ - "iconBadge", - // "enhanceTitle", - "render", - "discard", - ]); - this.prefix = tree + ".ext-logger"; - } - init() { - const tree = this.tree; - // this.ignoreEvents.add(); - if (tree.getOption("debugLevel") >= 4) { - // const self = this; - const ignoreEvents = this.ignoreEvents; - const prefix = this.prefix; - overrideMethod(tree, "callEvent", function (name, extra) { - /* eslint-disable prefer-rest-params */ - if (ignoreEvents.has(name)) { - return tree._superApply(arguments); - } - const start = Date.now(); - const res = tree._superApply(arguments); - tree.logDebug(`${prefix}: callEvent('${name}') took ${Date.now() - start} ms.`, arguments[1]); - return res; - }); - } - } - onKeyEvent(data) { - // this.tree.logInfo("onKeyEvent", eventToString(data.event), data); - this.tree.logDebug(`${this.prefix}: onKeyEvent()`, data); - return; - } - } + /*! + * Wunderbaum - ext-logger + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + class LoggerExtension extends WunderbaumExtension { + constructor(tree) { + super(tree, "logger", {}); + this.ignoreEvents = new Set([ + "iconBadge", + // "enhanceTitle", + "render", + "discard", + ]); + this.prefix = tree + ".ext-logger"; + } + init() { + const tree = this.tree; + // this.ignoreEvents.add(); + if (tree.getOption("debugLevel") >= 4) { + // const self = this; + const ignoreEvents = this.ignoreEvents; + const prefix = this.prefix; + overrideMethod(tree, "callEvent", function (name, extra) { + /* eslint-disable prefer-rest-params */ + if (ignoreEvents.has(name)) { + return tree._superApply(arguments); + } + const start = Date.now(); + const res = tree._superApply(arguments); + tree.logDebug(`${prefix}: callEvent('${name}') took ${Date.now() - start} ms.`, arguments[1]); + return res; + }); + } + } + onKeyEvent(data) { + // this.tree.logInfo("onKeyEvent", eventToString(data.event), data); + this.tree.logDebug(`${this.prefix}: onKeyEvent()`, data); + return; + } + } - /*! - * Wunderbaum - common - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script - /** - * Fixed height of a row in pixel. Must match the SCSS variable `$row-outer-height`. - */ - const ROW_HEIGHT = 22; - /** - * Fixed width of node icons in pixel. Must match the SCSS variable `$icon-outer-width`. - */ - const ICON_WIDTH = 20; - /** - * Adjust the width of the title span, so overflow ellipsis work. - * (2 x `$col-padding-x` + 3px rounding errors). - */ - const TITLE_SPAN_PAD_Y = 7; - /** Render row markup for N nodes above and below the visible viewport. */ - const RENDER_MAX_PREFETCH = 5; - /** Regular expression to detect if a string describes an image URL (in contrast - * to a class name). Strings are considered image urls if they contain '.' or '/'. - */ - const TEST_IMG = new RegExp(/\.|\//); - // export const RECURSIVE_REQUEST_ERROR = "$recursive_request"; - // export const INVALID_REQUEST_TARGET_ERROR = "$request_target_invalid"; - /** - * Default node icons. - * Requires bootstrap icons https://icons.getbootstrap.com - */ - const iconMaps = { - bootstrap: { - error: "bi bi-exclamation-triangle", - // loading: "bi bi-hourglass-split wb-busy", - loading: "bi bi-chevron-right wb-busy", - // loading: "bi bi-arrow-repeat wb-spin", - // loading: '
Loading...
', - // noData: "bi bi-search", - noData: "bi bi-question-circle", - expanderExpanded: "bi bi-chevron-down", - // expanderExpanded: "bi bi-dash-square", - expanderCollapsed: "bi bi-chevron-right", - // expanderCollapsed: "bi bi-plus-square", - expanderLazy: "bi bi-chevron-right wb-helper-lazy-expander", - // expanderLazy: "bi bi-chevron-bar-right", - checkChecked: "bi bi-check-square", - checkUnchecked: "bi bi-square", - checkUnknown: "bi bi-dash-square-dotted", - radioChecked: "bi bi-circle-fill", - radioUnchecked: "bi bi-circle", - radioUnknown: "bi bi-record-circle", - folder: "bi bi-folder2", - folderOpen: "bi bi-folder2-open", - folderLazy: "bi bi-folder-symlink", - doc: "bi bi-file-earmark", - }, - fontawesome6: { - error: "fa-solid fa-triangle-exclamation", - loading: "fa-solid fa-chevron-right fa-beat", - noData: "fa-solid fa-circle-question", - expanderExpanded: "fa-solid fa-chevron-down", - expanderCollapsed: "fa-solid fa-chevron-right", - expanderLazy: "fa-solid fa-chevron-right wb-helper-lazy-expander", - checkChecked: "fa-regular fa-square-check", - checkUnchecked: "fa-regular fa-square", - checkUnknown: "fa-regular fa-square-minus", - radioChecked: "fa-solid fa-circle", - radioUnchecked: "fa-regular fa-circle", - radioUnknown: "fa-regular fa-circle-question", - folder: "fa-solid fa-folder-closed", - folderOpen: "fa-regular fa-folder-open", - folderLazy: "fa-solid fa-folder-plus", - doc: "fa-regular fa-file", - }, - }; - /** Dict keys that are evaluated by source loader (others are added to `tree.data` instead). */ - const RESERVED_TREE_SOURCE_KEYS = new Set([ - "_format", - "_keyMap", - "_positional", - "_typeList", - "_valueMap", - "_version", - "children", - "columns", - "types", - ]); - // /** Key codes that trigger grid navigation, even when inside an input element. */ - // export const INPUT_BREAKOUT_KEYS: Set = new Set([ - // // "ArrowDown", - // // "ArrowUp", - // "Enter", - // "Escape", - // ]); - /** Map `KeyEvent.key` to navigation action. */ - const KEY_TO_ACTION_DICT = { - " ": "toggleSelect", - "+": "expand", - Add: "expand", - ArrowDown: "down", - ArrowLeft: "left", - ArrowRight: "right", - ArrowUp: "up", - Backspace: "parent", - "/": "collapseAll", - Divide: "collapseAll", - End: "lastCol", - Home: "firstCol", - "Control+End": "last", - "Control+Home": "first", - "Meta+ArrowDown": "last", - "Meta+ArrowUp": "first", - "*": "expandAll", - Multiply: "expandAll", - PageDown: "pageDown", - PageUp: "pageUp", - "-": "collapse", - Subtract: "collapse", - }; - /** Return a callback that returns true if the node title matches the string - * or regular expression. - * @see {@link WunderbaumNode.findAll} - */ - function makeNodeTitleMatcher(match) { - if (match instanceof RegExp) { - return function (node) { - return match.test(node.title); - }; - } - assert(typeof match === "string", `Expected a string or RegExp: ${match}`); - // s = escapeRegex(s.toLowerCase()); - return function (node) { - return node.title === match; - // console.log("match " + node, node.title.toLowerCase().indexOf(match)) - // return node.title.toLowerCase().indexOf(match) >= 0; - }; - } - /** Return a callback that returns true if the node title starts with a string (case-insensitive). */ - function makeNodeTitleStartMatcher(s) { - s = escapeRegex(s); - const reMatch = new RegExp("^" + s, "i"); - return function (node) { - return reMatch.test(node.title); - }; - } - /** Compare two nodes by title (case-insensitive). */ - function nodeTitleSorter(a, b) { - const x = a.title.toLowerCase(); - const y = b.title.toLowerCase(); - return x === y ? 0 : x > y ? 1 : -1; - } - /** - * Convert 'flat' to 'nested' format. - * - * Flat node entry format: - * [PARENT_ID, [POSITIONAL_ARGS]] - * or - * [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}] - * - * 1. Parent-referencing list is converted to a list of nested dicts with - * optional `children` properties. - * 2. `[POSITIONAL_ARGS]` are added as dict attributes. - */ - function unflattenSource(source) { - var _a, _b, _c; - const { _format, _keyMap = {}, _positional = [], children } = source; - if (_format !== "flat") { - throw new Error(`Expected source._format: "flat", but got ${_format}`); - } - if (_positional && _positional.includes("children")) { - throw new Error(`source._positional must not include "children": ${_positional}`); - } - let longToShort = _keyMap; - if (_keyMap.t) { - // Inverse keyMap was used (pre 0.7.0) - // TODO: raise Error on final 1.x release - const msg = `source._keyMap maps from long to short since v0.7.0. Flip key/value!`; - console.warn(msg); // eslint-disable-line no-console - longToShort = {}; - for (const [key, value] of Object.entries(_keyMap)) { - longToShort[value] = key; - } - } - const positionalShort = _positional.map((e) => longToShort[e]); - const newChildren = []; - const keyToNodeMap = {}; - const indexToNodeMap = {}; - const keyAttrName = (_a = longToShort["key"]) !== null && _a !== void 0 ? _a : "key"; - const childrenAttrName = (_b = longToShort["children"]) !== null && _b !== void 0 ? _b : "children"; - for (const [index, nodeTuple] of children.entries()) { - // Node entry format: - // [PARENT_ID, [POSITIONAL_ARGS]] - // or - // [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}] - const [parentId, args, kwargs = {}] = nodeTuple; - // Free up some memory as we go - nodeTuple[1] = null; - if (nodeTuple[2] != null) { - nodeTuple[2] = null; - } - // console.log("flatten", parentId, args, kwargs) - // We keep `kwargs` as our new node definition. Then we add all positional - // values to this object: - args.forEach((val, positionalIdx) => { - kwargs[positionalShort[positionalIdx]] = val; - }); - // Find the parent node. `null` means 'toplevel'. PARENT_ID may be the numeric - // index of the source.children list. If PARENT_ID is a string, we search - // a parent with node.key of this value. - indexToNodeMap[index] = kwargs; - const key = kwargs[keyAttrName]; - if (key != null) { - keyToNodeMap[key] = kwargs; - } - let parentNode = null; - if (parentId === null) ; - else if (typeof parentId === "number") { - parentNode = indexToNodeMap[parentId]; - if (parentNode === undefined) { - throw new Error(`unflattenSource: Could not find parent node by index: ${parentId}.`); - } - } - else { - parentNode = keyToNodeMap[parentId]; - if (parentNode === undefined) { - throw new Error(`unflattenSource: Could not find parent node by key: ${parentId}`); - } - } - if (parentNode) { - (_c = parentNode[childrenAttrName]) !== null && _c !== void 0 ? _c : (parentNode[childrenAttrName] = []); - parentNode[childrenAttrName].push(kwargs); - } - else { - newChildren.push(kwargs); - } - } - source.children = newChildren; - } - /** - * Decompresses the source data by - * - converting from 'flat' to 'nested' format - * - expanding short alias names to long names (if defined in _keyMap) - * - resolving value indexes to value strings (if defined in _valueMap) - * - * @param source - The source object to be decompressed. - * @returns void - */ - function decompressSourceData(source) { - let { _format, _version = 1, _keyMap, _valueMap } = source; - assert(_version === 1, `Expected file version 1 instead of ${_version}`); - let longToShort = _keyMap; - let shortToLong = {}; - if (longToShort) { - for (const [key, value] of Object.entries(longToShort)) { - shortToLong[value] = key; - } - } - // Fallback for old format (pre 0.7.0, using _keyMap in reverse direction) - // TODO: raise Error on final 1.x release - if (longToShort && longToShort.t) { - const msg = `source._keyMap maps from long to short since v0.7.0. Flip key/value!`; - console.warn(msg); // eslint-disable-line no-console - [longToShort, shortToLong] = [shortToLong, longToShort]; - } - // Fallback for old format (pre 0.7.0, using _typeList instead of _valueMap) - // TODO: raise Error on final 1.x release - if (source._typeList != null) { - const msg = `source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.`; - if (_valueMap != null) { - throw new Error(msg); - } - else { - console.warn(msg); // eslint-disable-line no-console - _valueMap = { type: source._typeList }; - delete source._typeList; - } - } - if (_format === "flat") { - unflattenSource(source); - } - delete source._format; - delete source._version; - delete source._keyMap; - delete source._valueMap; - delete source._positional; - function _iter(childList) { - for (const node of childList) { - // Iterate over a list of names, because we modify inside the loop - // (for ... of ... does not allow this) - Object.getOwnPropertyNames(node).forEach((propName) => { - const value = node[propName]; - // Replace short names with long names if defined in _keyMap - let longName = propName; - if (_keyMap && shortToLong[propName] != null) { - longName = shortToLong[propName]; - if (longName !== propName) { - node[longName] = value; - delete node[propName]; - } - } - // Replace type index with type name if defined in _valueMap - if (_valueMap && - typeof value === "number" && - _valueMap[longName] != null) { - const newValue = _valueMap[longName][value]; - if (newValue == null) { - throw new Error(`Expected valueMap[${longName}][${value}] entry in [${_valueMap[longName]}]`); - } - node[longName] = newValue; - } - }); - // Recursion - if (node.children) { - _iter(node.children); - } - } - } - if (_keyMap || _valueMap) { - _iter(source.children); - } - } + /*! + * Wunderbaum - common + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script + /** + * Fixed height of a row in pixel. Must match the SCSS variable `$row-outer-height`. + */ + const ROW_HEIGHT = 22; + /** + * Fixed width of node icons in pixel. Must match the SCSS variable `$icon-outer-width`. + */ + const ICON_WIDTH = 20; + /** + * Adjust the width of the title span, so overflow ellipsis work. + * (2 x `$col-padding-x` + 3px rounding errors). + */ + const TITLE_SPAN_PAD_Y = 7; + /** Render row markup for N nodes above and below the visible viewport. */ + const RENDER_MAX_PREFETCH = 5; + /** Regular expression to detect if a string describes an image URL (in contrast + * to a class name). Strings are considered image urls if they contain '.' or '/'. + */ + const TEST_IMG = new RegExp(/\.|\//); + // export const RECURSIVE_REQUEST_ERROR = "$recursive_request"; + // export const INVALID_REQUEST_TARGET_ERROR = "$request_target_invalid"; + /** + * Default node icons. + * Requires bootstrap icons https://icons.getbootstrap.com + */ + const iconMaps = { + bootstrap: { + error: "bi bi-exclamation-triangle", + // loading: "bi bi-hourglass-split wb-busy", + loading: "bi bi-chevron-right wb-busy", + // loading: "bi bi-arrow-repeat wb-spin", + // loading: '
Loading...
', + // noData: "bi bi-search", + noData: "bi bi-question-circle", + expanderExpanded: "bi bi-chevron-down", + // expanderExpanded: "bi bi-dash-square", + expanderCollapsed: "bi bi-chevron-right", + // expanderCollapsed: "bi bi-plus-square", + expanderLazy: "bi bi-chevron-right wb-helper-lazy-expander", + // expanderLazy: "bi bi-chevron-bar-right", + checkChecked: "bi bi-check-square", + checkUnchecked: "bi bi-square", + checkUnknown: "bi bi-dash-square-dotted", + radioChecked: "bi bi-circle-fill", + radioUnchecked: "bi bi-circle", + radioUnknown: "bi bi-record-circle", + folder: "bi bi-folder2", + folderOpen: "bi bi-folder2-open", + folderLazy: "bi bi-folder-symlink", + doc: "bi bi-file-earmark", + }, + fontawesome6: { + error: "fa-solid fa-triangle-exclamation", + loading: "fa-solid fa-chevron-right fa-beat", + noData: "fa-solid fa-circle-question", + expanderExpanded: "fa-solid fa-chevron-down", + expanderCollapsed: "fa-solid fa-chevron-right", + expanderLazy: "fa-solid fa-chevron-right wb-helper-lazy-expander", + checkChecked: "fa-regular fa-square-check", + checkUnchecked: "fa-regular fa-square", + checkUnknown: "fa-regular fa-square-minus", + radioChecked: "fa-solid fa-circle", + radioUnchecked: "fa-regular fa-circle", + radioUnknown: "fa-regular fa-circle-question", + folder: "fa-solid fa-folder-closed", + folderOpen: "fa-regular fa-folder-open", + folderLazy: "fa-solid fa-folder-plus", + doc: "fa-regular fa-file", + }, + }; + /** Dict keys that are evaluated by source loader (others are added to `tree.data` instead). */ + const RESERVED_TREE_SOURCE_KEYS = new Set([ + "_format", + "_keyMap", + "_positional", + "_typeList", + "_valueMap", + "_version", + "children", + "columns", + "types", + ]); + // /** Key codes that trigger grid navigation, even when inside an input element. */ + // export const INPUT_BREAKOUT_KEYS: Set = new Set([ + // // "ArrowDown", + // // "ArrowUp", + // "Enter", + // "Escape", + // ]); + /** Map `KeyEvent.key` to navigation action. */ + const KEY_TO_ACTION_DICT = { + " ": "toggleSelect", + "+": "expand", + Add: "expand", + ArrowDown: "down", + ArrowLeft: "left", + ArrowRight: "right", + ArrowUp: "up", + Backspace: "parent", + "/": "collapseAll", + Divide: "collapseAll", + End: "lastCol", + Home: "firstCol", + "Control+End": "last", + "Control+Home": "first", + "Meta+ArrowDown": "last", + "Meta+ArrowUp": "first", + "*": "expandAll", + Multiply: "expandAll", + PageDown: "pageDown", + PageUp: "pageUp", + "-": "collapse", + Subtract: "collapse", + }; + /** Return a callback that returns true if the node title matches the string + * or regular expression. + * @see {@link WunderbaumNode.findAll()} + */ + function makeNodeTitleMatcher(match) { + if (match instanceof RegExp) { + return function (node) { + return match.test(node.title); + }; + } + assert(typeof match === "string", `Expected a string or RegExp: ${match}`); + // s = escapeRegex(s.toLowerCase()); + return function (node) { + return node.title === match; + // console.log("match " + node, node.title.toLowerCase().indexOf(match)) + // return node.title.toLowerCase().indexOf(match) >= 0; + }; + } + /** Return a callback that returns true if the node title starts with a string (case-insensitive). */ + function makeNodeTitleStartMatcher(s) { + s = escapeRegex(s); + const reMatch = new RegExp("^" + s, "i"); + return function (node) { + return reMatch.test(node.title); + }; + } + /** Compare two nodes by title (case-insensitive). */ + function nodeTitleSorter(a, b) { + const x = a.title.toLowerCase(); + const y = b.title.toLowerCase(); + return x === y ? 0 : x > y ? 1 : -1; + } + /** + * Convert 'flat' to 'nested' format. + * + * Flat node entry format: + * [PARENT_ID, [POSITIONAL_ARGS]] + * or + * [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}] + * + * 1. Parent-referencing list is converted to a list of nested dicts with + * optional `children` properties. + * 2. `[POSITIONAL_ARGS]` are added as dict attributes. + */ + function unflattenSource(source) { + var _a, _b, _c; + const { _format, _keyMap = {}, _positional = [], children } = source; + if (_format !== "flat") { + throw new Error(`Expected source._format: "flat", but got ${_format}`); + } + if (_positional && _positional.includes("children")) { + throw new Error(`source._positional must not include "children": ${_positional}`); + } + let longToShort = _keyMap; + if (_keyMap.t) { + // Inverse keyMap was used (pre 0.7.0) + // TODO: raise Error on final 1.x release + const msg = `source._keyMap maps from long to short since v0.7.0. Flip key/value!`; + console.warn(msg); // eslint-disable-line no-console + longToShort = {}; + for (const [key, value] of Object.entries(_keyMap)) { + longToShort[value] = key; + } + } + const positionalShort = _positional.map((e) => longToShort[e]); + const newChildren = []; + const keyToNodeMap = {}; + const indexToNodeMap = {}; + const keyAttrName = (_a = longToShort["key"]) !== null && _a !== void 0 ? _a : "key"; + const childrenAttrName = (_b = longToShort["children"]) !== null && _b !== void 0 ? _b : "children"; + for (const [index, nodeTuple] of children.entries()) { + // Node entry format: + // [PARENT_ID, [POSITIONAL_ARGS]] + // or + // [PARENT_ID, [POSITIONAL_ARGS], {KEY_VALUE_ARGS}] + const [parentId, args, kwargs = {}] = nodeTuple; + // Free up some memory as we go + nodeTuple[1] = null; + if (nodeTuple[2] != null) { + nodeTuple[2] = null; + } + // console.log("flatten", parentId, args, kwargs) + // We keep `kwargs` as our new node definition. Then we add all positional + // values to this object: + args.forEach((val, positionalIdx) => { + kwargs[positionalShort[positionalIdx]] = val; + }); + // Find the parent node. `null` means 'toplevel'. PARENT_ID may be the numeric + // index of the source.children list. If PARENT_ID is a string, we search + // a parent with node.key of this value. + indexToNodeMap[index] = kwargs; + const key = kwargs[keyAttrName]; + if (key != null) { + keyToNodeMap[key] = kwargs; + } + let parentNode = null; + if (parentId === null) ; + else if (typeof parentId === "number") { + parentNode = indexToNodeMap[parentId]; + if (parentNode === undefined) { + throw new Error(`unflattenSource: Could not find parent node by index: ${parentId}.`); + } + } + else { + parentNode = keyToNodeMap[parentId]; + if (parentNode === undefined) { + throw new Error(`unflattenSource: Could not find parent node by key: ${parentId}`); + } + } + if (parentNode) { + (_c = parentNode[childrenAttrName]) !== null && _c !== void 0 ? _c : (parentNode[childrenAttrName] = []); + parentNode[childrenAttrName].push(kwargs); + } + else { + newChildren.push(kwargs); + } + } + source.children = newChildren; + } + /** + * Decompresses the source data by + * - converting from 'flat' to 'nested' format + * - expanding short alias names to long names (if defined in _keyMap) + * - resolving value indexes to value strings (if defined in _valueMap) + * + * @param source - The source object to be decompressed. + * @returns void + */ + function decompressSourceData(source) { + let { _format, _version = 1, _keyMap, _valueMap } = source; + assert(_version === 1, `Expected file version 1 instead of ${_version}`); + let longToShort = _keyMap; + let shortToLong = {}; + if (longToShort) { + for (const [key, value] of Object.entries(longToShort)) { + shortToLong[value] = key; + } + } + // Fallback for old format (pre 0.7.0, using _keyMap in reverse direction) + // TODO: raise Error on final 1.x release + if (longToShort && longToShort.t) { + const msg = `source._keyMap maps from long to short since v0.7.0. Flip key/value!`; + console.warn(msg); // eslint-disable-line no-console + [longToShort, shortToLong] = [shortToLong, longToShort]; + } + // Fallback for old format (pre 0.7.0, using _typeList instead of _valueMap) + // TODO: raise Error on final 1.x release + if (source._typeList != null) { + const msg = `source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.`; + if (_valueMap != null) { + throw new Error(msg); + } + else { + console.warn(msg); // eslint-disable-line no-console + _valueMap = { type: source._typeList }; + delete source._typeList; + } + } + if (_format === "flat") { + unflattenSource(source); + } + delete source._format; + delete source._version; + delete source._keyMap; + delete source._valueMap; + delete source._positional; + function _iter(childList) { + for (const node of childList) { + // Iterate over a list of names, because we modify inside the loop + // (for ... of ... does not allow this) + Object.getOwnPropertyNames(node).forEach((propName) => { + const value = node[propName]; + // Replace short names with long names if defined in _keyMap + let longName = propName; + if (_keyMap && shortToLong[propName] != null) { + longName = shortToLong[propName]; + if (longName !== propName) { + node[longName] = value; + delete node[propName]; + } + } + // Replace type index with type name if defined in _valueMap + if (_valueMap && + typeof value === "number" && + _valueMap[longName] != null) { + const newValue = _valueMap[longName][value]; + if (newValue == null) { + throw new Error(`Expected valueMap[${longName}][${value}] entry in [${_valueMap[longName]}]`); + } + node[longName] = newValue; + } + }); + // Recursion + if (node.children) { + _iter(node.children); + } + } + } + if (_keyMap || _valueMap) { + _iter(source.children); + } + } - /*! - * Wunderbaum - ext-dnd - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - const nodeMimeType = "application/x-wunderbaum-node"; - class DndExtension extends WunderbaumExtension { - constructor(tree) { - super(tree, "dnd", { - autoExpandMS: 1500, - // dropMarkerInsertOffsetX: -16, // Additional offset for drop-marker with hitMode = "before"/"after" - // dropMarkerOffsetX: -24, // Absolute position offset for .fancytree-drop-marker relatively to ..fancytree-title (icon/img near a node accepting drop) - // #1021 `document.body` is not available yet - // dropMarkerParent: "body", // Root Container used for drop marker (could be a shadow root) - multiSource: false, - effectAllowed: "all", - dropEffectDefault: "move", - guessDropEffect: true, - preventForeignNodes: false, - preventLazyParents: true, - preventNonNodes: false, - preventRecursion: true, - preventSameParent: false, - preventVoidMoves: true, - serializeClipboardData: true, - scroll: true, - scrollSensitivity: 20, - // scrollnterval: 50, // Generate event every 50 ms - scrollSpeed: 5, - // setTextTypeJson: false, // Allow dragging of nodes to different IE windows - sourceCopyHook: null, - // Events (drag support) - dragStart: null, - drag: null, - dragEnd: null, - // Events (drop support) - dragEnter: null, - dragOver: null, - dragExpand: null, - drop: null, - dragLeave: null, // Callback(targetNode, data) - }); - // public dropMarkerElem?: HTMLElement; - this.srcNode = null; - this.lastTargetNode = null; - this.lastEnterStamp = 0; - this.lastAllowedDropRegions = null; - this.lastDropEffect = null; - this.lastDropRegion = false; - this.currentScrollDir = 0; - this.applyScrollDirThrottled = throttle(this._applyScrollDir, 50); - } - init() { - super.init(); - // Store the current scroll parent, which may be the tree - // container, any enclosing div, or the document. - // #761: scrollParent() always needs a container child - // $temp = $("").appendTo(this.$container); - // this.$scrollParent = $temp.scrollParent(); - // $temp.remove(); - const tree = this.tree; - const dndOpts = tree.options.dnd; - // Enable drag support if dragStart() is specified: - if (dndOpts.dragStart) { - onEvent(tree.element, "dragstart drag dragend", this.onDragEvent.bind(this)); - } - // Enable drop support if dragEnter() is specified: - if (dndOpts.dragEnter) { - onEvent(tree.element, "dragenter dragover dragleave drop", this.onDropEvent.bind(this)); - } - } - /** Cleanup classes after target node is no longer hovered. */ - _leaveNode() { - // We remove the marker on dragenter from the previous target: - const ltn = this.lastTargetNode; - this.lastEnterStamp = 0; - if (ltn) { - ltn.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before", false); - this.lastTargetNode = null; - } - } - /** */ - unifyDragover(res) { - if (res === false) { - return false; - } - else if (res instanceof Set) { - return res.size > 0 ? res : false; - } - else if (res === true) { - return new Set(["over", "before", "after"]); - } - else if (typeof res === "string" || isArray(res)) { - res = toSet(res); - return res.size > 0 ? res : false; - } - throw new Error("Unsupported drop region definition: " + res); - } - /** - * Calculates the drop region based on the drag event and the allowed drop regions. - */ - _calcDropRegion(e, allowed) { - const dy = e.offsetY; - if (!allowed) { - return false; - } - else if (allowed.size === 3) { - return dy < 0.25 * ROW_HEIGHT - ? "before" - : dy > 0.75 * ROW_HEIGHT - ? "after" - : "over"; - } - else if (allowed.size === 1 && allowed.has("over")) { - return "over"; - } - else { - // Only 'before' and 'after': - return dy > ROW_HEIGHT / 2 ? "after" : "before"; - } - // return "over"; - } - /** - * Guess drop effect (copy/link/move) using opinionated conventions. - * - * Default: dnd.dropEffectDefault - */ - _guessDropEffect(e) { - // const nativeDropEffect = e.dataTransfer?.dropEffect; - var _a; - // if (nativeDropEffect && nativeDropEffect !== "none") { - // return nativeDropEffect; - // } - const dndOpts = this.treeOpts.dnd; - const ea = (_a = dndOpts.effectAllowed) !== null && _a !== void 0 ? _a : "all"; - const canCopy = ["all", "copy", "copyLink", "copyMove"].includes(ea); - const canLink = ["all", "link", "copyLink", "linkMove"].includes(ea); - const canMove = ["all", "move", "copyMove", "linkMove"].includes(ea); - let res = dndOpts.dropEffectDefault; - if (dndOpts.guessDropEffect) { - if (isMac) { - if (e.altKey && canCopy) { - res = "copy"; - } - if (e.metaKey && canMove) { - res = "move"; // command key - } - if (e.altKey && e.metaKey && canLink) { - res = "link"; - } - } - else { - if (e.ctrlKey && canCopy) { - res = "copy"; - } - if (e.shiftKey && canMove) { - res = "move"; - } - if (e.altKey && canLink) { - res = "link"; - } - } - } - return res; - } - /** Don't allow void operation ('drop on self').*/ - _isVoidDrop(targetNode, srcNode, dropRegion) { - // this.tree.logDebug( - // `_isVoidDrop: ${srcNode} -> ${dropRegion} ${targetNode}` - // ); - // TODO: should be checked on move only - if (!this.treeOpts.dnd.preventVoidMoves || !srcNode) { - return false; - } - if ((dropRegion === "before" && targetNode === srcNode.getNextSibling()) || - (dropRegion === "after" && targetNode === srcNode.getPrevSibling())) { - // this.tree.logDebug("Prevented before/after self"); - return true; - } - // Don't allow dropping nodes on own parent (or self) - return srcNode === targetNode || srcNode.parent === targetNode; - } - /* Implement auto scrolling when drag cursor is in top/bottom area of scroll parent. */ - _applyScrollDir() { - if (this.isDragging() && this.currentScrollDir) { - const dndOpts = this.tree.options.dnd; - const sp = this.tree.element; // scroll parent - const scrollTop = sp.scrollTop; - if (this.currentScrollDir < 0) { - sp.scrollTop = Math.max(0, scrollTop - dndOpts.scrollSpeed); - } - else if (this.currentScrollDir > 0) { - sp.scrollTop = scrollTop + dndOpts.scrollSpeed; - } - } - } - /* Implement auto scrolling when drag cursor is in top/bottom area of scroll parent. */ - _autoScroll(viewportY) { - const tree = this.tree; - const dndOpts = tree.options.dnd; - const sensitivity = dndOpts.scrollSensitivity; - const sp = tree.element; // scroll parent - const headerHeight = tree.headerElement.clientHeight; // May be 0 - // const height = sp.clientHeight - headerHeight; - // const height = sp.offsetHeight + headerHeight; - const height = sp.offsetHeight; - const scrollTop = sp.scrollTop; - // tree.logDebug( - // `autoScroll: height=${height}, scrollTop=${scrollTop}, viewportY=${viewportY}` - // ); - this.currentScrollDir = 0; - if (scrollTop > 0 && - viewportY > 0 && - viewportY <= sensitivity + headerHeight) { - // Mouse in top 20px area: scroll up - // sp.scrollTop = Math.max(0, scrollTop - dndOpts.scrollSpeed); - this.currentScrollDir = -1; - } - else if (scrollTop < sp.scrollHeight - height && - viewportY >= height - sensitivity) { - // Mouse in bottom 20px area: scroll down - // sp.scrollTop = scrollTop + dndOpts.scrollSpeed; - this.currentScrollDir = +1; - } - if (this.currentScrollDir) { - this.applyScrollDirThrottled(); - } - return sp.scrollTop - scrollTop; - } - /** Return true if a drag operation currently in progress. */ - isDragging() { - return !!this.srcNode; - } - /** - * Handle dragstart, drag and dragend events for the source node. - */ - onDragEvent(e) { - var _a; - // const tree = this.tree; - const dndOpts = this.treeOpts.dnd; - const srcNode = Wunderbaum.getNode(e); - if (!srcNode) { - this.tree.logWarn(`onDragEvent.${e.type} no node`); - return; - } - if (["dragstart", "dragend"].includes(e.type)) { - this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${srcNode}`, e); - } - // --- dragstart --- - if (e.type === "dragstart") { - // Set a default definition of allowed effects - e.dataTransfer.effectAllowed = dndOpts.effectAllowed; //"copyMove"; // "all"; - if (srcNode.isEditing()) { - srcNode.logDebug("Prevented dragging node in edit mode."); - e.preventDefault(); - return false; - } - // Let user cancel the drag operation, override effectAllowed, etc.: - const res = srcNode._callEvent("dnd.dragStart", { event: e }); - if (!res) { - e.preventDefault(); - return false; - } - const nodeData = srcNode.toDict(true, (n) => { - // We don't want to re-use the key on drop: - n._orgKey = n.key; - delete n.key; - }); - nodeData._treeId = srcNode.tree.id; - if (dndOpts.serializeClipboardData) { - if (typeof dndOpts.serializeClipboardData === "function") { - e.dataTransfer.setData(nodeMimeType, dndOpts.serializeClipboardData(nodeData, srcNode)); - } - else { - e.dataTransfer.setData(nodeMimeType, JSON.stringify(nodeData)); - } - } - // e.dataTransfer!.setData("text/html", $(node.span).html()); - if (!((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.types.includes("text/plain"))) { - e.dataTransfer.setData("text/plain", srcNode.title); - } - this.srcNode = srcNode; - setTimeout(() => { - // Decouple this call, so the CSS is applied to the node, but not to - // the system generated drag image - srcNode.setClass("wb-drag-source"); - }, 0); - // --- drag --- - } - else if (e.type === "drag") { - if (dndOpts.drag) { - srcNode._callEvent("dnd.drag", { event: e }); - } - // --- dragend --- - } - else if (e.type === "dragend") { - srcNode.setClass("wb-drag-source", false); - this.srcNode = null; - if (this.lastTargetNode) { - this._leaveNode(); - } - srcNode._callEvent("dnd.dragEnd", { event: e }); - } - return true; - } - /** - * Handle dragenter, dragover, dragleave, drop events. - */ - onDropEvent(e) { - var _a; - // const isLink = event.dataTransfer.types.includes("text/uri-list"); - const srcNode = this.srcNode; - const srcTree = srcNode ? srcNode.tree : null; - const targetNode = Wunderbaum.getNode(e); - const dndOpts = this.treeOpts.dnd; - const dt = e.dataTransfer; - const dropRegion = this._calcDropRegion(e, this.lastAllowedDropRegions); - if (!targetNode) { - this._leaveNode(); - return; - } - if (["drop"].includes(e.type)) { - this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${targetNode}, ea: ${dt === null || dt === void 0 ? void 0 : dt.effectAllowed}, ` + - `de: ${dt === null || dt === void 0 ? void 0 : dt.dropEffect}, cy: ${e.offsetY}, r: ${dropRegion}, srcNode: ${srcNode}`, e); - } - // --- dragenter --- - if (e.type === "dragenter") { - this.lastAllowedDropRegions = null; - // `dragleave` is not reliable with event delegation, so we generate it - // from dragenter: - if (this.lastTargetNode && this.lastTargetNode !== targetNode) { - this._leaveNode(); - } - this.lastTargetNode = targetNode; - this.lastEnterStamp = Date.now(); - if ( - // Don't drop on status node: - targetNode.isStatusNode() || - // Prevent dropping nodes from different Wunderbaum trees: - (dndOpts.preventForeignNodes && targetNode.tree !== srcTree) || - // Prevent dropping items on unloaded lazy Wunderbaum tree nodes: - (dndOpts.preventLazyParents && !targetNode.isLoaded()) || - // Prevent dropping items other than Wunderbaum tree nodes: - (dndOpts.preventNonNodes && !srcNode) || - // Prevent dropping nodes on own descendants: - (dndOpts.preventRecursion && (srcNode === null || srcNode === void 0 ? void 0 : srcNode.isAncestorOf(targetNode))) || - // Prevent dropping nodes under same direct parent: - (dndOpts.preventSameParent && - srcNode && - targetNode.parent === srcNode.parent) || - // Don't allow void operation ('drop on self'): TODO: should be checked on move only - (dndOpts.preventVoidMoves && targetNode === srcNode)) { - dt.dropEffect = "none"; - this.tree.log("Prevented drop operation"); - return true; // Prevent drop operation - } - // User may return a set of regions (or `false` to prevent drop) - // Figure out a drop effect (copy/link/move) using opinated conventions. - dt.dropEffect = this._guessDropEffect(e) || "none"; - let regionSet = targetNode._callEvent("dnd.dragEnter", { event: e }); - // - regionSet = this.unifyDragover(regionSet); - if (!regionSet) { - dt.dropEffect = "none"; - return true; // Prevent drop operation - } - this.lastAllowedDropRegions = regionSet; - this.lastDropEffect = dt.dropEffect; - targetNode.setClass("wb-drop-target"); - e.preventDefault(); // Allow drop (Drop operation is denied by default) - return false; - // --- dragover --- - } - else if (e.type === "dragover") { - const viewportY = e.clientY - this.tree.element.offsetTop; - this._autoScroll(viewportY); - dt.dropEffect = this._guessDropEffect(e) || "none"; - targetNode._callEvent("dnd.dragOver", { event: e }); - const region = this._calcDropRegion(e, this.lastAllowedDropRegions); - this.lastDropRegion = region; - this.lastDropEffect = dt.dropEffect; - if (dndOpts.autoExpandMS > 0 && - targetNode.isExpandable(true) && - !targetNode._isLoading && - Date.now() - this.lastEnterStamp > dndOpts.autoExpandMS && - targetNode._callEvent("dnd.dragExpand", { event: e }) !== false) { - targetNode.setExpanded(); - } - if (!region || this._isVoidDrop(targetNode, srcNode, region)) { - return; // We already rejected in dragenter - } - targetNode.setClass("wb-drop-over", region === "over"); - targetNode.setClass("wb-drop-before", region === "before"); - targetNode.setClass("wb-drop-after", region === "after"); - e.preventDefault(); // Allow drop (Drop operation is denied by default) - return false; - // --- dragleave --- - } - else if (e.type === "dragleave") { - // NOTE: we cannot trust this event, since it is always fired, - // Instead we remove the marker on dragenter - targetNode._callEvent("dnd.dragLeave", { event: e }); - // --- drop --- - } - else if (e.type === "drop") { - e.stopPropagation(); // prevent browser from opening links? - e.preventDefault(); // #69 prevent iOS browser from opening links - this._leaveNode(); - const region = this.lastDropRegion; - let nodeData = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(nodeMimeType); - nodeData = nodeData ? JSON.parse(nodeData) : null; - const srcNode = this.srcNode; - const lastDropEffect = this.lastDropEffect; - setTimeout(() => { - // Decouple this call, because drop actions may prevent the dragend event - // from being fired on some browsers - targetNode._callEvent("dnd.drop", { - event: e, - region: region, - suggestedDropMode: region === "over" ? "appendChild" : region, - suggestedDropEffect: lastDropEffect, - // suggestedDropEffect: e.dataTransfer?.dropEffect, - sourceNode: srcNode, - sourceNodeData: nodeData, - }); - }, 10); - } - return false; - } - } + /*! + * Wunderbaum - ext-dnd + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + const nodeMimeType = "application/x-wunderbaum-node"; + class DndExtension extends WunderbaumExtension { + constructor(tree) { + super(tree, "dnd", { + autoExpandMS: 1500, + // dropMarkerInsertOffsetX: -16, // Additional offset for drop-marker with hitMode = "before"/"after" + // dropMarkerOffsetX: -24, // Absolute position offset for .fancytree-drop-marker relatively to ..fancytree-title (icon/img near a node accepting drop) + // #1021 `document.body` is not available yet + // dropMarkerParent: "body", // Root Container used for drop marker (could be a shadow root) + multiSource: false, + effectAllowed: "all", + dropEffectDefault: "move", + guessDropEffect: true, + preventForeignNodes: false, + preventLazyParents: true, + preventNonNodes: false, + preventRecursion: true, + preventSameParent: false, + preventVoidMoves: true, + serializeClipboardData: true, + scroll: true, + scrollSensitivity: 20, + // scrollnterval: 50, // Generate event every 50 ms + scrollSpeed: 5, + // setTextTypeJson: false, // Allow dragging of nodes to different IE windows + sourceCopyHook: null, + // Events (drag support) + dragStart: null, + drag: null, + dragEnd: null, + // Events (drop support) + dragEnter: null, + dragOver: null, + dragExpand: null, + drop: null, + dragLeave: null, // Callback(targetNode, data) + }); + // public dropMarkerElem?: HTMLElement; + this.srcNode = null; + this.lastTargetNode = null; + this.lastEnterStamp = 0; + this.lastAllowedDropRegions = null; + this.lastDropEffect = null; + this.lastDropRegion = false; + this.currentScrollDir = 0; + this.applyScrollDirThrottled = throttle(this._applyScrollDir, 50); + } + init() { + super.init(); + // Store the current scroll parent, which may be the tree + // container, any enclosing div, or the document. + // #761: scrollParent() always needs a container child + // $temp = $("").appendTo(this.$container); + // this.$scrollParent = $temp.scrollParent(); + // $temp.remove(); + const tree = this.tree; + const dndOpts = tree.options.dnd; + // Enable drag support if dragStart() is specified: + if (dndOpts.dragStart) { + onEvent(tree.element, "dragstart drag dragend", this.onDragEvent.bind(this)); + } + // Enable drop support if dragEnter() is specified: + if (dndOpts.dragEnter) { + onEvent(tree.element, "dragenter dragover dragleave drop", this.onDropEvent.bind(this)); + } + } + /** Cleanup classes after target node is no longer hovered. */ + _leaveNode() { + // We remove the marker on dragenter from the previous target: + const ltn = this.lastTargetNode; + this.lastEnterStamp = 0; + if (ltn) { + ltn.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before", false); + this.lastTargetNode = null; + } + } + /** */ + unifyDragover(res) { + if (res === false) { + return false; + } + else if (res instanceof Set) { + return res.size > 0 ? res : false; + } + else if (res === true) { + return new Set(["over", "before", "after"]); + } + else if (typeof res === "string" || isArray(res)) { + res = toSet(res); + return res.size > 0 ? res : false; + } + throw new Error("Unsupported drop region definition: " + res); + } + /** + * Calculates the drop region based on the drag event and the allowed drop regions. + */ + _calcDropRegion(e, allowed) { + const dy = e.offsetY; + if (!allowed) { + return false; + } + else if (allowed.size === 3) { + return dy < 0.25 * ROW_HEIGHT + ? "before" + : dy > 0.75 * ROW_HEIGHT + ? "after" + : "over"; + } + else if (allowed.size === 1 && allowed.has("over")) { + return "over"; + } + else { + // Only 'before' and 'after': + return dy > ROW_HEIGHT / 2 ? "after" : "before"; + } + // return "over"; + } + /** + * Guess drop effect (copy/link/move) using opinionated conventions. + * + * Default: dnd.dropEffectDefault + */ + _guessDropEffect(e) { + // const nativeDropEffect = e.dataTransfer?.dropEffect; + var _a; + // if (nativeDropEffect && nativeDropEffect !== "none") { + // return nativeDropEffect; + // } + const dndOpts = this.treeOpts.dnd; + const ea = (_a = dndOpts.effectAllowed) !== null && _a !== void 0 ? _a : "all"; + const canCopy = ["all", "copy", "copyLink", "copyMove"].includes(ea); + const canLink = ["all", "link", "copyLink", "linkMove"].includes(ea); + const canMove = ["all", "move", "copyMove", "linkMove"].includes(ea); + let res = dndOpts.dropEffectDefault; + if (dndOpts.guessDropEffect) { + if (isMac) { + if (e.altKey && canCopy) { + res = "copy"; + } + if (e.metaKey && canMove) { + res = "move"; // command key + } + if (e.altKey && e.metaKey && canLink) { + res = "link"; + } + } + else { + if (e.ctrlKey && canCopy) { + res = "copy"; + } + if (e.shiftKey && canMove) { + res = "move"; + } + if (e.altKey && canLink) { + res = "link"; + } + } + } + return res; + } + /** Don't allow void operation ('drop on self').*/ + _isVoidDrop(targetNode, srcNode, dropRegion) { + // this.tree.logDebug( + // `_isVoidDrop: ${srcNode} -> ${dropRegion} ${targetNode}` + // ); + // TODO: should be checked on move only + if (!this.treeOpts.dnd.preventVoidMoves || !srcNode) { + return false; + } + if ((dropRegion === "before" && targetNode === srcNode.getNextSibling()) || + (dropRegion === "after" && targetNode === srcNode.getPrevSibling())) { + // this.tree.logDebug("Prevented before/after self"); + return true; + } + // Don't allow dropping nodes on own parent (or self) + return srcNode === targetNode || srcNode.parent === targetNode; + } + /* Implement auto scrolling when drag cursor is in top/bottom area of scroll parent. */ + _applyScrollDir() { + if (this.isDragging() && this.currentScrollDir) { + const dndOpts = this.tree.options.dnd; + const sp = this.tree.element; // scroll parent + const scrollTop = sp.scrollTop; + if (this.currentScrollDir < 0) { + sp.scrollTop = Math.max(0, scrollTop - dndOpts.scrollSpeed); + } + else if (this.currentScrollDir > 0) { + sp.scrollTop = scrollTop + dndOpts.scrollSpeed; + } + } + } + /* Implement auto scrolling when drag cursor is in top/bottom area of scroll parent. */ + _autoScroll(viewportY) { + const tree = this.tree; + const dndOpts = tree.options.dnd; + const sensitivity = dndOpts.scrollSensitivity; + const sp = tree.element; // scroll parent + const headerHeight = tree.headerElement.clientHeight; // May be 0 + // const height = sp.clientHeight - headerHeight; + // const height = sp.offsetHeight + headerHeight; + const height = sp.offsetHeight; + const scrollTop = sp.scrollTop; + // tree.logDebug( + // `autoScroll: height=${height}, scrollTop=${scrollTop}, viewportY=${viewportY}` + // ); + this.currentScrollDir = 0; + if (scrollTop > 0 && + viewportY > 0 && + viewportY <= sensitivity + headerHeight) { + // Mouse in top 20px area: scroll up + // sp.scrollTop = Math.max(0, scrollTop - dndOpts.scrollSpeed); + this.currentScrollDir = -1; + } + else if (scrollTop < sp.scrollHeight - height && + viewportY >= height - sensitivity) { + // Mouse in bottom 20px area: scroll down + // sp.scrollTop = scrollTop + dndOpts.scrollSpeed; + this.currentScrollDir = +1; + } + if (this.currentScrollDir) { + this.applyScrollDirThrottled(); + } + return sp.scrollTop - scrollTop; + } + /** Return true if a drag operation currently in progress. */ + isDragging() { + return !!this.srcNode; + } + /** + * Handle dragstart, drag and dragend events for the source node. + */ + onDragEvent(e) { + var _a; + // const tree = this.tree; + const dndOpts = this.treeOpts.dnd; + const srcNode = Wunderbaum.getNode(e); + if (!srcNode) { + this.tree.logWarn(`onDragEvent.${e.type} no node`); + return; + } + if (["dragstart", "dragend"].includes(e.type)) { + this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${srcNode}`, e); + } + // --- dragstart --- + if (e.type === "dragstart") { + // Set a default definition of allowed effects + e.dataTransfer.effectAllowed = dndOpts.effectAllowed; //"copyMove"; // "all"; + if (srcNode.isEditingTitle()) { + srcNode.logDebug("Prevented dragging node in edit mode."); + e.preventDefault(); + return false; + } + // Let user cancel the drag operation, override effectAllowed, etc.: + const res = srcNode._callEvent("dnd.dragStart", { event: e }); + if (!res) { + e.preventDefault(); + return false; + } + const nodeData = srcNode.toDict(true, (n) => { + // We don't want to re-use the key on drop: + n._orgKey = n.key; + delete n.key; + }); + nodeData._treeId = srcNode.tree.id; + if (dndOpts.serializeClipboardData) { + if (typeof dndOpts.serializeClipboardData === "function") { + e.dataTransfer.setData(nodeMimeType, dndOpts.serializeClipboardData(nodeData, srcNode)); + } + else { + e.dataTransfer.setData(nodeMimeType, JSON.stringify(nodeData)); + } + } + // e.dataTransfer!.setData("text/html", $(node.span).html()); + if (!((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.types.includes("text/plain"))) { + e.dataTransfer.setData("text/plain", srcNode.title); + } + this.srcNode = srcNode; + setTimeout(() => { + // Decouple this call, so the CSS is applied to the node, but not to + // the system generated drag image + srcNode.setClass("wb-drag-source"); + }, 0); + // --- drag --- + } + else if (e.type === "drag") { + if (dndOpts.drag) { + srcNode._callEvent("dnd.drag", { event: e }); + } + // --- dragend --- + } + else if (e.type === "dragend") { + srcNode.setClass("wb-drag-source", false); + this.srcNode = null; + if (this.lastTargetNode) { + this._leaveNode(); + } + srcNode._callEvent("dnd.dragEnd", { event: e }); + } + return true; + } + /** + * Handle dragenter, dragover, dragleave, drop events. + */ + onDropEvent(e) { + var _a; + // const isLink = event.dataTransfer.types.includes("text/uri-list"); + const srcNode = this.srcNode; + const srcTree = srcNode ? srcNode.tree : null; + const targetNode = Wunderbaum.getNode(e); + const dndOpts = this.treeOpts.dnd; + const dt = e.dataTransfer; + const dropRegion = this._calcDropRegion(e, this.lastAllowedDropRegions); + if (!targetNode) { + this._leaveNode(); + return; + } + if (["drop"].includes(e.type)) { + this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${targetNode}, ea: ${dt === null || dt === void 0 ? void 0 : dt.effectAllowed}, ` + + `de: ${dt === null || dt === void 0 ? void 0 : dt.dropEffect}, cy: ${e.offsetY}, r: ${dropRegion}, srcNode: ${srcNode}`, e); + } + // --- dragenter --- + if (e.type === "dragenter") { + this.lastAllowedDropRegions = null; + // `dragleave` is not reliable with event delegation, so we generate it + // from dragenter: + if (this.lastTargetNode && this.lastTargetNode !== targetNode) { + this._leaveNode(); + } + this.lastTargetNode = targetNode; + this.lastEnterStamp = Date.now(); + if ( + // Don't drop on status node: + targetNode.isStatusNode() || + // Prevent dropping nodes from different Wunderbaum trees: + (dndOpts.preventForeignNodes && targetNode.tree !== srcTree) || + // Prevent dropping items on unloaded lazy Wunderbaum tree nodes: + (dndOpts.preventLazyParents && !targetNode.isLoaded()) || + // Prevent dropping items other than Wunderbaum tree nodes: + (dndOpts.preventNonNodes && !srcNode) || + // Prevent dropping nodes on own descendants: + (dndOpts.preventRecursion && (srcNode === null || srcNode === void 0 ? void 0 : srcNode.isAncestorOf(targetNode))) || + // Prevent dropping nodes under same direct parent: + (dndOpts.preventSameParent && + srcNode && + targetNode.parent === srcNode.parent) || + // Don't allow void operation ('drop on self'): TODO: should be checked on move only + (dndOpts.preventVoidMoves && targetNode === srcNode)) { + dt.dropEffect = "none"; + this.tree.log("Prevented drop operation"); + return true; // Prevent drop operation + } + // User may return a set of regions (or `false` to prevent drop) + // Figure out a drop effect (copy/link/move) using opinated conventions. + dt.dropEffect = this._guessDropEffect(e) || "none"; + let regionSet = targetNode._callEvent("dnd.dragEnter", { event: e }); + // + regionSet = this.unifyDragover(regionSet); + if (!regionSet) { + dt.dropEffect = "none"; + return true; // Prevent drop operation + } + this.lastAllowedDropRegions = regionSet; + this.lastDropEffect = dt.dropEffect; + targetNode.setClass("wb-drop-target"); + e.preventDefault(); // Allow drop (Drop operation is denied by default) + return false; + // --- dragover --- + } + else if (e.type === "dragover") { + const viewportY = e.clientY - this.tree.element.offsetTop; + this._autoScroll(viewportY); + dt.dropEffect = this._guessDropEffect(e) || "none"; + targetNode._callEvent("dnd.dragOver", { event: e }); + const region = this._calcDropRegion(e, this.lastAllowedDropRegions); + this.lastDropRegion = region; + this.lastDropEffect = dt.dropEffect; + if (dndOpts.autoExpandMS > 0 && + targetNode.isExpandable(true) && + !targetNode._isLoading && + Date.now() - this.lastEnterStamp > dndOpts.autoExpandMS && + targetNode._callEvent("dnd.dragExpand", { event: e }) !== false) { + targetNode.setExpanded(); + } + if (!region || this._isVoidDrop(targetNode, srcNode, region)) { + return; // We already rejected in dragenter + } + targetNode.setClass("wb-drop-over", region === "over"); + targetNode.setClass("wb-drop-before", region === "before"); + targetNode.setClass("wb-drop-after", region === "after"); + e.preventDefault(); // Allow drop (Drop operation is denied by default) + return false; + // --- dragleave --- + } + else if (e.type === "dragleave") { + // NOTE: we cannot trust this event, since it is always fired, + // Instead we remove the marker on dragenter + targetNode._callEvent("dnd.dragLeave", { event: e }); + // --- drop --- + } + else if (e.type === "drop") { + e.stopPropagation(); // prevent browser from opening links? + e.preventDefault(); // #69 prevent iOS browser from opening links + this._leaveNode(); + const region = this.lastDropRegion; + let nodeData = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(nodeMimeType); + nodeData = nodeData ? JSON.parse(nodeData) : null; + const srcNode = this.srcNode; + const lastDropEffect = this.lastDropEffect; + setTimeout(() => { + // Decouple this call, because drop actions may prevent the dragend event + // from being fired on some browsers + targetNode._callEvent("dnd.drop", { + event: e, + region: region, + suggestedDropMode: region === "over" ? "appendChild" : region, + suggestedDropEffect: lastDropEffect, + // suggestedDropEffect: e.dataTransfer?.dropEffect, + sourceNode: srcNode, + sourceNodeData: nodeData, + }); + }, 10); + } + return false; + } + } - /*! - * Wunderbaum - drag_observer - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - /** - * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'. - */ - class DragObserver { - constructor(opts) { - this.start = { - x: 0, - y: 0, - altKey: false, - ctrlKey: false, - metaKey: false, - shiftKey: false, - }; - this.dragElem = null; - this.dragging = false; - // TODO: touch events - this.events = ["mousedown", "mouseup", "mousemove", "keydown"]; - if (!opts.root) { - throw new Error("Missing `root` option."); - } - this.opts = Object.assign({ thresh: 5 }, opts); - this.root = opts.root; - this._handler = this.handleEvent.bind(this); - this.events.forEach((type) => { - this.root.addEventListener(type, this._handler); - }); - } - /** Unregister all event listeners. */ - disconnect() { - this.events.forEach((type) => { - this.root.removeEventListener(type, this._handler); - }); - } - getDragElem() { - return this.dragElem; - } - isDragging() { - return this.dragging; - } - stopDrag(cb_event) { - if (this.dragging && this.opts.dragstop && cb_event) { - cb_event.type = "dragstop"; - this.opts.dragstop(cb_event); - } - this.dragElem = null; - this.dragging = false; - } - handleEvent(e) { - const type = e.type; - const opts = this.opts; - const cb_event = { - type: e.type, - event: e, - dragElem: this.dragElem, - dx: e.pageX - this.start.x, - dy: e.pageY - this.start.y, - apply: undefined, - }; - switch (type) { - case "keydown": - this.stopDrag(cb_event); - break; - case "mousedown": - if (this.dragElem) { - this.stopDrag(cb_event); - break; - } - if (opts.selector) { - let elem = e.target; - if (elem.matches(opts.selector)) { - this.dragElem = elem; - } - else { - elem = elem.closest(opts.selector); - if (elem) { - this.dragElem = elem; - } - else { - break; // no event delegation selector matched - } - } - } - this.start.x = e.pageX; - this.start.y = e.pageY; - this.start.altKey = e.altKey; - this.start.ctrlKey = e.ctrlKey; - this.start.metaKey = e.metaKey; - this.start.shiftKey = e.shiftKey; - break; - case "mousemove": - // TODO: debounce/throttle? - // TODO: horizontal mode: ignore if dx unchanged - if (!this.dragElem) { - break; - } - if (!this.dragging) { - if (opts.thresh) { - const dist2 = cb_event.dx * cb_event.dx + cb_event.dy * cb_event.dy; - if (dist2 < opts.thresh * opts.thresh) { - break; - } - } - cb_event.type = "dragstart"; - if (opts.dragstart(cb_event) === false) { - this.stopDrag(cb_event); - break; - } - this.dragging = true; - } - if (this.dragging && this.opts.drag) { - cb_event.type = "drag"; - this.opts.drag(cb_event); - } - break; - case "mouseup": - if (!this.dragging) { - this.stopDrag(cb_event); - break; - } - if (e.button === 0) { - cb_event.apply = true; - } - else { - cb_event.apply = false; - } - this.stopDrag(cb_event); - break; - } - } - } + /*! + * Wunderbaum - drag_observer + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + /** + * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'. + */ + class DragObserver { + constructor(opts) { + this.start = { + x: 0, + y: 0, + altKey: false, + ctrlKey: false, + metaKey: false, + shiftKey: false, + }; + this.dragElem = null; + this.dragging = false; + // TODO: touch events + this.events = ["mousedown", "mouseup", "mousemove", "keydown"]; + if (!opts.root) { + throw new Error("Missing `root` option."); + } + this.opts = Object.assign({ thresh: 5 }, opts); + this.root = opts.root; + this._handler = this.handleEvent.bind(this); + this.events.forEach((type) => { + this.root.addEventListener(type, this._handler); + }); + } + /** Unregister all event listeners. */ + disconnect() { + this.events.forEach((type) => { + this.root.removeEventListener(type, this._handler); + }); + } + getDragElem() { + return this.dragElem; + } + isDragging() { + return this.dragging; + } + stopDrag(cb_event) { + if (this.dragging && this.opts.dragstop && cb_event) { + cb_event.type = "dragstop"; + this.opts.dragstop(cb_event); + } + this.dragElem = null; + this.dragging = false; + } + handleEvent(e) { + const type = e.type; + const opts = this.opts; + const cb_event = { + type: e.type, + event: e, + dragElem: this.dragElem, + dx: e.pageX - this.start.x, + dy: e.pageY - this.start.y, + apply: undefined, + }; + switch (type) { + case "keydown": + this.stopDrag(cb_event); + break; + case "mousedown": + if (this.dragElem) { + this.stopDrag(cb_event); + break; + } + if (opts.selector) { + let elem = e.target; + if (elem.matches(opts.selector)) { + this.dragElem = elem; + } + else { + elem = elem.closest(opts.selector); + if (elem) { + this.dragElem = elem; + } + else { + break; // no event delegation selector matched + } + } + } + this.start.x = e.pageX; + this.start.y = e.pageY; + this.start.altKey = e.altKey; + this.start.ctrlKey = e.ctrlKey; + this.start.metaKey = e.metaKey; + this.start.shiftKey = e.shiftKey; + break; + case "mousemove": + // TODO: debounce/throttle? + // TODO: horizontal mode: ignore if dx unchanged + if (!this.dragElem) { + break; + } + if (!this.dragging) { + if (opts.thresh) { + const dist2 = cb_event.dx * cb_event.dx + cb_event.dy * cb_event.dy; + if (dist2 < opts.thresh * opts.thresh) { + break; + } + } + cb_event.type = "dragstart"; + if (opts.dragstart(cb_event) === false) { + this.stopDrag(cb_event); + break; + } + this.dragging = true; + } + if (this.dragging && this.opts.drag) { + cb_event.type = "drag"; + this.opts.drag(cb_event); + } + break; + case "mouseup": + if (!this.dragging) { + this.stopDrag(cb_event); + break; + } + if (e.button === 0) { + cb_event.apply = true; + } + else { + cb_event.apply = false; + } + this.stopDrag(cb_event); + break; + } + } + } - /*! - * Wunderbaum - ext-grid - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - class GridExtension extends WunderbaumExtension { - constructor(tree) { - super(tree, "grid", { - // throttle: 200, - }); - this.observer = new DragObserver({ - root: window.document, - selector: "span.wb-col-resizer", - thresh: 4, - // throttle: 400, - dragstart: (e) => { - return this.tree.element.contains(e.dragElem); - }, - drag: (e) => { - // TODO: throttle - return this.handleDrag(e); - }, - dragstop: (e) => { - return this.handleDrag(e); - }, - }); - } - init() { - super.init(); - } - handleDrag(e) { - const info = Wunderbaum.getEventInfo(e.event); - // this.tree.options. - this.tree.log(`${e.type}(${e.dx})`, e, info); - } - } + /*! + * Wunderbaum - ext-grid + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + class GridExtension extends WunderbaumExtension { + constructor(tree) { + super(tree, "grid", { + // throttle: 200, + }); + this.observer = new DragObserver({ + root: window.document, + selector: "span.wb-col-resizer", + thresh: 4, + // throttle: 400, + dragstart: (e) => { + return this.tree.element.contains(e.dragElem); + }, + drag: (e) => { + // TODO: throttle + return this.handleDrag(e); + }, + dragstop: (e) => { + return this.handleDrag(e); + }, + }); + } + init() { + super.init(); + } + handleDrag(e) { + const info = Wunderbaum.getEventInfo(e.event); + // this.tree.options. + this.tree.log(`${e.type}(${e.dx})`, e, info); + } + } - /*! - * Wunderbaum - deferred - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - /** - * Implement a ES6 Promise, that exposes a resolve() and reject() method. - * - * Loosely mimics {@link https://api.jquery.com/category/deferred-object/ | jQuery.Deferred}. - * Example: - * ```js - * function foo() { - * let dfd = new Deferred(), - * ... - * dfd.resolve('foo') - * ... - * return dfd.promise(); - * } - * ``` - */ - class Deferred { - constructor() { - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - } - /** Resolve the [[Promise]]. */ - resolve(value) { - this._resolve(value); - } - /** Reject the [[Promise]]. */ - reject(reason) { - this._reject(reason); - } - /** Return the native [[Promise]] instance.*/ - promise() { - return this._promise; - } - /** Call [[Promise.then]] on the embedded promise instance.*/ - then(cb) { - return this._promise.then(cb); - } - /** Call [[Promise.catch]] on the embedded promise instance.*/ - catch(cb) { - return this._promise.catch(cb); - } - /** Call [[Promise.finally]] on the embedded promise instance.*/ - finally(cb) { - return this._promise.finally(cb); - } - } + /*! + * Wunderbaum - deferred + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + /** + * Implement a ES6 Promise, that exposes a resolve() and reject() method. + * + * Loosely mimics {@link https://api.jquery.com/category/deferred-object/ | jQuery.Deferred}. + * Example: + * ```js + * function foo() { + * let dfd = new Deferred(), + * ... + * dfd.resolve('foo') + * ... + * return dfd.promise(); + * } + * ``` + */ + class Deferred { + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + /** Resolve the Promise. */ + resolve(value) { + this._resolve(value); + } + /** Reject the Promise. */ + reject(reason) { + this._reject(reason); + } + /** Return the native Promise instance.*/ + promise() { + return this._promise; + } + /** Call Promise.then on the embedded promise instance.*/ + then(cb) { + return this._promise.then(cb); + } + /** Call Promise.catch on the embedded promise instance.*/ + catch(cb) { + return this._promise.catch(cb); + } + /** Call Promise.finally on the embedded promise instance.*/ + finally(cb) { + return this._promise.finally(cb); + } + } - /*! - * Wunderbaum - wunderbaum_node - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - /** WunderbaumNode properties that can be passed with source data. - * (Any other source properties will be stored as `node.data.PROP`.) - */ - const NODE_PROPS = new Set([ - "checkbox", - "classes", - "expanded", - "icon", - "iconTooltip", - "key", - "lazy", - "_partsel", - "radiogroup", - "refKey", - "selected", - "statusNodeType", - "title", - "tooltip", - "type", - "unselectable", - ]); - /** WunderbaumNode properties that will be returned by `node.toDict()`.) - */ - const NODE_DICT_PROPS = new Set(NODE_PROPS); - NODE_DICT_PROPS.delete("_partsel"); - NODE_DICT_PROPS.delete("unselectable"); - /** - * A single tree node. - * - * **NOTE:**
- * Generally you should not modify properties directly, since this may break - * the internal bookkeeping. - */ - class WunderbaumNode { - constructor(tree, parent, data) { - var _a, _b; - /** Reference key. Unlike {@link key}, a `refKey` may occur multiple - * times within a tree (in this case we have 'clone nodes'). - * @see Use {@link setKey} to modify. - */ - this.refKey = undefined; - this.children = null; - /** Additional classes added to `div.wb-row`. - * @see {@link hasClass}, {@link setClass}. */ - this.classes = null; //new Set(); - /** Custom data that was passed to the constructor */ - this.data = {}; - this._isLoading = false; - this._requestId = 0; - this._errorInfo = null; - this._partsel = false; - this._partload = false; - this.subMatchCount = 0; - this._rowIdx = 0; - this._rowElem = undefined; - assert(!parent || parent.tree === tree, `Invalid parent: ${parent}`); - assert(!data.children, "'children' not allowed here"); - this.tree = tree; - this.parent = parent; - this.key = "" + ((_a = data.key) !== null && _a !== void 0 ? _a : ++WunderbaumNode.sequence); - this.title = "" + ((_b = data.title) !== null && _b !== void 0 ? _b : "<" + this.key + ">"); - data.refKey != null ? (this.refKey = "" + data.refKey) : 0; - data.type != null ? (this.type = "" + data.type) : 0; - this.expanded = data.expanded === true; - data.icon != null ? (this.icon = data.icon) : 0; - this.lazy = data.lazy === true; - data.statusNodeType != null - ? (this.statusNodeType = ("" + data.statusNodeType)) - : 0; - data.colspan != null ? (this.colspan = !!data.colspan) : 0; - // Selection - data.checkbox != null ? (this.checkbox = !!data.checkbox) : 0; - data.radiogroup != null ? (this.radiogroup = !!data.radiogroup) : 0; - this.selected = data.selected === true; - data.unselectable === true ? (this.unselectable = true) : 0; - if (data.classes) { - this.setClass(data.classes); - } - // Store custom fields as `node.data` - for (const [key, value] of Object.entries(data)) { - if (!NODE_PROPS.has(key)) { - this.data[key] = value; - } - } - if (parent && !this.statusNodeType) { - // Don't register root node or status nodes - tree._registerNode(this); - } - } - /** - * Return readable string representation for this instance. - * @internal - */ - toString() { - return `WunderbaumNode@${this.key}<'${this.title}'>`; - } - /** - * Iterate all descendant nodes depth-first, pre-order using `for ... of ...` syntax. - * More concise, but slightly slower than {@link WunderbaumNode.visit}. - * - * Example: - * ```js - * for(const n of node) { - * ... - * } - * ``` - */ - *[Symbol.iterator]() { - // let node: WunderbaumNode | null = this; - const cl = this.children; - if (cl) { - for (let i = 0, l = cl.length; i < l; i++) { - const n = cl[i]; - yield n; - if (n.children) { - yield* n; - } - } - // Slower: - // for (let node of this.children) { - // yield node; - // yield* node : 0; - // } - } - } - // /** Return an option value. */ - // protected _getOpt( - // name: string, - // nodeObject: any = null, - // treeOptions: any = null, - // defaultValue: any = null - // ): any { - // return evalOption( - // name, - // this, - // nodeObject || this, - // treeOptions || this.tree.options, - // defaultValue - // ); - // } - /** Call event handler if defined in tree.options. - * Example: - * ```js - * node._callEvent("edit.beforeEdit", {foo: 42}) - * ``` - */ - _callEvent(type, extra) { - return this.tree._callEvent(type, extend({ - node: this, - typeInfo: this.type ? this.tree.types[this.type] : {}, - }, extra)); - } - /** - * Append (or insert) a list of child nodes. - * - * Tip: pass `{ before: 0 }` to prepend new nodes as first children. - * - * @returns first child added - */ - addChildren(nodeData, options) { - const tree = this.tree; - let { before = null, applyMinExpanLevel = true, _level } = options !== null && options !== void 0 ? options : {}; - // let { before, loadLazy=true, _level } = options ?? {}; - // const isTopCall = _level == null; - _level !== null && _level !== void 0 ? _level : (_level = this.getLevel()); - const nodeList = []; - try { - tree.enableUpdate(false); - if (isPlainObject(nodeData)) { - nodeData = [nodeData]; - } - const forceExpand = applyMinExpanLevel && _level < tree.options.minExpandLevel; - for (const child of nodeData) { - const subChildren = child.children; - delete child.children; - const n = new WunderbaumNode(tree, this, child); - if (forceExpand && !n.isUnloaded()) { - n.expanded = true; - } - nodeList.push(n); - if (subChildren) { - n.addChildren(subChildren, { _level: _level + 1 }); - } - } - if (!this.children) { - this.children = nodeList; - } - else if (before == null || this.children.length === 0) { - this.children = this.children.concat(nodeList); - } - else { - // Returns null if before is not a direct child: - before = this.findDirectChild(before); - const pos = this.children.indexOf(before); - assert(pos >= 0, `options.before must be a direct child of ${this}`); - // insert nodeList after children[pos] - this.children.splice(pos, 0, ...nodeList); - } - // this.triggerModifyChild("add", nodeList.length === 1 ? nodeList[0] : null); - tree.update(ChangeType.structure); - } - finally { - // if (tree.options.selectMode === "hier") { - // if (this.parent && this.parent.children) { - // this.fixSelection3FromEndNodes(); - // } else { - // // may happen when loading __root__; - // } - // } - tree.enableUpdate(true); - } - // if(isTopCall && loadLazy){ - // this.logWarn("addChildren(): loadLazy is not yet implemented.") - // } - return nodeList[0]; - } - /** - * Append or prepend a node, or append a child node. - * - * This a convenience function that calls addChildren() - * - * @param nodeData node definition - * @param [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child') - * @returns new node - */ - addNode(nodeData, mode = "appendChild") { - if (mode === "over") { - mode = "appendChild"; // compatible with drop region - } - switch (mode) { - case "after": - return this.parent.addChildren(nodeData, { - before: this.getNextSibling(), - }); - case "before": - return this.parent.addChildren(nodeData, { before: this }); - case "prependChild": - // Insert before the first child if any - // let insertBefore = this.children ? this.children[0] : undefined; - return this.addChildren(nodeData, { before: 0 }); - case "appendChild": - return this.addChildren(nodeData); - } - assert(false, `Invalid mode: ${mode}`); - return undefined; - } - /** - * Apply a modification (or navigation) operation. - * - * @see {@link Wunderbaum.applyCommand} - */ - applyCommand(cmd, options) { - return this.tree.applyCommand(cmd, this, options); - } - /** - * Collapse all expanded sibling nodes if any. - * (Automatically called when `autoCollapse` is true.) - */ - collapseSiblings(options) { - for (const node of this.parent.children) { - if (node !== this && node.expanded) { - node.setExpanded(false, options); - } - } - } - /** - * Add/remove one or more classes to `
`. - * - * This also maintains `node.classes`, so the class will survive a re-render. - * - * @param className one or more class names. Multiple classes can be passed - * as space-separated string, array of strings, or set of strings. - */ - setClass(className, flag = true) { - const cnSet = toSet(className); - if (flag) { - if (this.classes === null) { - this.classes = new Set(); - } - cnSet.forEach((cn) => { - var _a; - this.classes.add(cn); - (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.classList.toggle(cn, flag); - }); - } - else { - if (this.classes === null) { - return; - } - cnSet.forEach((cn) => { - var _a; - this.classes.delete(cn); - (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.classList.toggle(cn, flag); - }); - if (this.classes.size === 0) { - this.classes = null; - } - } - } - /** Call `setExpanded()` on all descendant nodes. */ - async expandAll(flag = true, options) { - const tree = this.tree; - const minExpandLevel = this.tree.options.minExpandLevel; - const { depth = 99, loadLazy, force, keepActiveNodeVisible = true, } = options !== null && options !== void 0 ? options : {}; - const expandOpts = { - scrollIntoView: false, - force: force, - loadLazy: loadLazy, - }; - // this.logInfo(`expandAll(${flag})`); - // Expand all direct children in parallel: - async function _iter(n, level) { - var _a; - // n.logInfo(` _iter(${level})`); - if (level === 0) { - return; - } - // if (!flag && minExpandLevel && !force && n.getLevel() <= minExpandLevel) { - // return; // Do not collapse until minExpandLevel - // } - const level_1 = level == null ? null : level - 1; - const promises = []; - (_a = n.children) === null || _a === void 0 ? void 0 : _a.forEach((cn) => { - if (flag) { - if (!cn.expanded && (cn.children || (loadLazy && cn.lazy))) { - // Node is collapsed and may be expanded (i.e. has children or is lazy) - // Expanding may be async, so we store the promise. - // Also the recursion is delayed until expansion finished. - const p = cn.setExpanded(true, expandOpts); - promises.push(p); - p.then(async () => { - await _iter(cn, level_1); - }); - } - else { - // We don't expand the node, but still visit descendants. - // There we may find lazy nodes, so we - promises.push(_iter(cn, level_1)); - } - } - else { - // Collapsing is always synchronous, so no promises required - if (!minExpandLevel || force || cn.getLevel() > minExpandLevel) { - // Do not collapse until minExpandLevel - cn.setExpanded(false, expandOpts); - } - _iter(cn, level_1); // recursion, even if cn was already collapsed - } - }); - return new Promise((resolve) => { - Promise.all(promises).then(() => { - resolve(true); - }); - }); - } - const tag = tree.logTime(`${this}.expandAll(${flag})`); - try { - tree.enableUpdate(false); - await _iter(this, depth); - } - finally { - tree.enableUpdate(true); - tree.logTimeEnd(tag); - } - if (tree.activeNode && keepActiveNodeVisible) { - tree.activeNode.scrollIntoView(); - } - } - /** - * Find all descendant nodes that match condition (excluding self). - * - * If `match` is a string, search for exact node title. - * If `match` is a RegExp expression, apply it to node.title, using - * [RegExp.test()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test). - * If `match` is a callback, match all nodes for that the callback(node) returns true. - * - * Returns an empty array if no nodes were found. - * - * Examples: - * ```js - * // Match all node titles that match exactly 'Joe': - * nodeList = node.findAll("Joe") - * // Match all node titles that start with 'Joe' case sensitive: - * nodeList = node.findAll(/^Joe/) - * // Match all node titles that contain 'oe', case insensitive: - * nodeList = node.findAll(/oe/i) - * // Match all nodes with `data.price` >= 99: - * nodeList = node.findAll((n) => { - * return n.data.price >= 99; - * }) - * ``` - */ - findAll(match) { - const matcher = typeof match === "function" ? match : makeNodeTitleMatcher(match); - const res = []; - this.visit((n) => { - if (matcher(n)) { - res.push(n); - } - }); - return res; - } - /** Return the direct child with a given key, index or null. */ - findDirectChild(ptr) { - const cl = this.children; - if (!cl) { - return null; - } - if (typeof ptr === "string") { - for (let i = 0, l = cl.length; i < l; i++) { - if (cl[i].key === ptr) { - return cl[i]; - } - } - } - else if (typeof ptr === "number") { - return cl[ptr]; - } - else if (ptr.parent === this) { - // Return null if `ptr` is not a direct child - return ptr; - } - return null; - } - /** - * Find first descendant node that matches condition (excluding self) or null. - * - * @see {@link WunderbaumNode.findAll} for examples. - */ - findFirst(match) { - const matcher = typeof match === "function" ? match : makeNodeTitleMatcher(match); - let res = null; - this.visit((n) => { - if (matcher(n)) { - res = n; - return false; - } - }); - return res; - } - /** Find a node relative to self. - * - * @see {@link Wunderbaum.findRelatedNode|tree.findRelatedNode()} - */ - findRelatedNode(where, includeHidden = false) { - return this.tree.findRelatedNode(this, where, includeHidden); - } - /** - * Iterator version of {@link WunderbaumNode.format}. - */ - *format_iter(name_cb, connectors) { - connectors !== null && connectors !== void 0 ? connectors : (connectors = [" ", " | ", " ╰─ ", " ├─ "]); - name_cb !== null && name_cb !== void 0 ? name_cb : (name_cb = (node) => "" + node); - function _is_last(node) { - const ca = node.parent.children; - return node === ca[ca.length - 1]; - } - const _format_line = (node) => { - // https://www.measurethat.net/Benchmarks/Show/12196/0/arr-unshift-vs-push-reverse-small-array - const parts = [name_cb(node)]; - parts.unshift(connectors[_is_last(node) ? 2 : 3]); - let p = node.parent; - while (p && p !== this) { - // `this` is the top node - parts.unshift(connectors[_is_last(p) ? 0 : 1]); - p = p.parent; - } - return parts.join(""); - }; - yield name_cb(this); - for (const node of this) { - yield _format_line(node); - } - } - /** - * Return a multiline string representation of a node/subnode hierarchy. - * Mostly useful for debugging. - * - * Example: - * ```js - * console.info(tree.getActiveNode().format((n)=>n.title)); - * ``` - * logs - * ``` - * Books - * ├─ Art of War - * ╰─ Don Quixote - * ``` - * @see {@link WunderbaumNode.format_iter} - */ - format(name_cb, connectors) { - const a = []; - for (const line of this.format_iter(name_cb, connectors)) { - a.push(line); - } - return a.join("\n"); - } - /** Return the `` element with a given index or id. - * @returns {WunderbaumNode | null} - */ - getColElem(colIdx) { - var _a; - if (typeof colIdx === "string") { - colIdx = this.tree.columns.findIndex((value) => value.id === colIdx); - } - const colElems = (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.querySelectorAll("span.wb-col"); - return colElems ? colElems[colIdx] : null; - } - /** Return the first child node or null. - * @returns {WunderbaumNode | null} - */ - getFirstChild() { - return this.children ? this.children[0] : null; - } - /** Return the last child node or null. - * @returns {WunderbaumNode | null} - */ - getLastChild() { - return this.children ? this.children[this.children.length - 1] : null; - } - /** Return node depth (starting with 1 for top level nodes). */ - getLevel() { - let i = 0, p = this.parent; - while (p) { - i++; - p = p.parent; - } - return i; - } - /** Return the successive node (under the same parent) or null. */ - getNextSibling() { - const ac = this.parent.children; - const idx = ac.indexOf(this); - return ac[idx + 1] || null; - } - /** Return the parent node (null for the system root node). */ - getParent() { - // TODO: return null for top-level nodes? - return this.parent; - } - /** Return an array of all parent nodes (top-down). - * @param includeRoot Include the invisible system root node. - * @param includeSelf Include the node itself. - */ - getParentList(includeRoot = false, includeSelf = false) { - const l = []; - let dtn = includeSelf ? this : this.parent; - while (dtn) { - if (includeRoot || dtn.parent) { - l.unshift(dtn); - } - dtn = dtn.parent; - } - return l; - } - /** Return a string representing the hierachical node path, e.g. "a/b/c". - * @param includeSelf - * @param node property name or callback - * @param separator - */ - getPath(includeSelf = true, part = "title", separator = "/") { - // includeSelf = includeSelf !== false; - // part = part || "title"; - // separator = separator || "/"; - let val; - const path = []; - const isFunc = typeof part === "function"; - this.visitParents((n) => { - if (n.parent) { - val = isFunc - ? part(n) - : n[part]; - path.unshift(val); - } - return undefined; // TODO remove this line - }, includeSelf); - return path.join(separator); - } - /** Return the preceeding node (under the same parent) or null. */ - getPrevSibling() { - const ac = this.parent.children; - const idx = ac.indexOf(this); - return ac[idx - 1] || null; - } - /** Return true if node has children. - * Return undefined if not sure, i.e. the node is lazy and not yet loaded. - */ - hasChildren() { - if (this.lazy) { - if (this.children == null) { - return undefined; // null or undefined: Not yet loaded - } - else if (this.children.length === 0) { - return false; // Loaded, but response was empty - } - else if (this.children.length === 1 && - this.children[0].isStatusNode()) { - return undefined; // Currently loading or load error - } - return true; // One or more child nodes - } - return !!(this.children && this.children.length); - } - /** Return true if node has className set. */ - hasClass(className) { - return this.classes ? this.classes.has(className) : false; - } - /** Return true if this node is the currently active tree node. */ - isActive() { - return this.tree.activeNode === this; - } - /** Return true if this node is a direct or indirect parent of `other`. - * (See also [[isParentOf]].) - */ - isAncestorOf(other) { - return other && other.isDescendantOf(this); - } - /** Return true if this node is a **direct** subnode of `other`. - * (See also [[isDescendantOf]].) - */ - isChildOf(other) { - return other && this.parent === other; - } - /** Return true if this node's title spans all columns, i.e. the node has no - * grid cells. - */ - isColspan() { - return !!this.getOption("colspan"); - } - /** Return true if this node is a direct or indirect subnode of `other`. - * (See also [[isChildOf]].) - */ - isDescendantOf(other) { - if (!other || other.tree !== this.tree) { - return false; - } - let p = this.parent; - while (p) { - if (p === other) { - return true; - } - if (p === p.parent) { - error(`Recursive parent link: ${p}`); - } - p = p.parent; - } - return false; - } - /** Return true if this node has children, i.e. the node is generally expandable. - * If `andCollapsed` is set, we also check if this node is collapsed, i.e. - * an expand operation is currently possible. - */ - isExpandable(andCollapsed = false) { - // `false` is never expandable (unoffical) - if ((andCollapsed && this.expanded) || this.children === false) { - return false; - } - if (this.children == null) { - return !!this.lazy; // null or undefined can trigger lazy load - } - if (this.children.length === 0) { - return !!this.tree.options.emptyChildListExpandable; - } - return true; - } - /** Return true if this node is currently in edit-title mode. */ - isEditing() { - return this.tree._callMethod("edit.isEditingTitle", this); - } - /** Return true if this node is currently expanded. */ - isExpanded() { - return !!this.expanded; - } - /** Return true if this node is the first node of its parent's children. */ - isFirstSibling() { - const p = this.parent; - return !p || p.children[0] === this; - } - /** Return true if this node is the last node of its parent's children. */ - isLastSibling() { - const p = this.parent; - return !p || p.children[p.children.length - 1] === this; - } - /** Return true if this node is lazy (even if data was already loaded) */ - isLazy() { - return !!this.lazy; - } - /** Return true if node is lazy and loaded. For non-lazy nodes always return true. */ - isLoaded() { - return !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node - } - /** Return true if node is currently loading, i.e. a GET request is pending. */ - isLoading() { - return this._isLoading; - } - /** Return true if this node is a temporarily generated status node of type 'paging'. */ - isPagingNode() { - return this.statusNodeType === "paging"; - } - /** Return true if this node is a **direct** parent of `other`. - * (See also [[isAncestorOf]].) - */ - isParentOf(other) { - return other && other.parent === this; - } - /** (experimental) Return true if this node is partially loaded. */ - isPartload() { - return !!this._partload; - } - /** Return true if this node is partially selected (tri-state). */ - isPartsel() { - return !this.selected && !!this._partsel; - } - /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */ - isRadio() { - return !!this.parent.radiogroup || this.getOption("checkbox") === "radio"; - } - /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */ - isRendered() { - return !!this._rowElem; - } - /** Return true if this node is the (invisible) system root node. - * (See also [[isTopLevel()]].) - */ - isRootNode() { - return this.tree.root === this; - } - /** Return true if this node is selected, i.e. the checkbox is set. - * `undefined` if partly selected (tri-state), false otherwise. - */ - isSelected() { - return this.selected ? true : this._partsel ? undefined : false; - } - /** Return true if this node is a temporarily generated system node like - * 'loading', 'paging', or 'error' (node.statusNodeType contains the type). - */ - isStatusNode() { - return !!this.statusNodeType; - } - /** Return true if this a top level node, i.e. a direct child of the (invisible) system root node. */ - isTopLevel() { - return this.tree.root === this.parent; - } - /** Return true if node is marked lazy but not yet loaded. - * For non-lazy nodes always return false. - */ - isUnloaded() { - // Also checks if the only child is a status node: - return this.hasChildren() === undefined; - } - /** Return true if all parent nodes are expanded. Note: this does not check - * whether the node is scrolled into the visible part of the screen or viewport. - */ - isVisible() { - const hasFilter = this.tree.filterMode === "hide"; - const parents = this.getParentList(false, false); - // TODO: check $(n.span).is(":visible") - // i.e. return false for nodes (but not parents) that are hidden - // by a filter - if (hasFilter && !this.match && !this.subMatchCount) { - // this.debug( "isVisible: HIDDEN (" + hasFilter + ", " + this.match + ", " + this.match + ")" ); - return false; - } - for (let i = 0, l = parents.length; i < l; i++) { - const n = parents[i]; - if (!n.expanded) { - // this.debug("isVisible: HIDDEN (parent collapsed)"); - return false; - } - // if (hasFilter && !n.match && !n.subMatchCount) { - // this.debug("isVisible: HIDDEN (" + hasFilter + ", " + this.match + ", " + this.match + ")"); - // return false; - // } - } - // this.debug("isVisible: VISIBLE"); - return true; - } - _loadSourceObject(source, level) { - var _a; - const tree = this.tree; - level !== null && level !== void 0 ? level : (level = this.getLevel()); - // Let caller modify the parsed JSON response: - const res = this._callEvent("receive", { response: source }); - if (res != null) { - source = res; - } - if (isArray(source)) { - source = { children: source }; - } - assert(isPlainObject(source), `Expected an array or plain object: ${source}`); - const format = (_a = source.format) !== null && _a !== void 0 ? _a : "nested"; - assert(format === "nested" || format === "flat", `Expected source.format = 'nested' or 'flat': ${format}`); - // Pre-rocess for 'nested' or 'flat' format - decompressSourceData(source); - assert(source.children, "If `source` is an object, it must have a `children` property"); - if (source.types) { - tree.logInfo("Redefine types", source.columns); - tree.setTypes(source.types, false); - delete source.types; - } - if (source.columns) { - tree.logInfo("Redefine columns", source.columns); - tree.columns = source.columns; - delete source.columns; - tree.update(ChangeType.colStructure); - } - this.addChildren(source.children); - // Add extra data to `tree.data` - for (const [key, value] of Object.entries(source)) { - if (!RESERVED_TREE_SOURCE_KEYS.has(key)) { - tree.data[key] = value; - // tree.logDebug(`Add source.${key} to tree.data.${key}`); - } - } - if (tree.options.selectMode === "hier") { - this.fixSelection3FromEndNodes(); - } - this._callEvent("load"); - } - async _fetchWithOptions(source) { - var _a, _b; - // Either a URL string or an object with a `.url` property. - let url, params, body, options, rest; - let fetchOpts = {}; - if (typeof source === "string") { - // source is a plain URL string: assume GET request - url = source; - fetchOpts.method = "GET"; - } - else if (isPlainObject(source)) { - // source is a plain object with `.url` property. - ({ url, params, body, options, ...rest } = source); - assert(!rest || Object.keys(rest).length === 0, `Unexpected source properties: ${Object.keys(rest)}. Use 'options' instead.`); - assert(typeof url === "string", `expected source.url as string`); - if (isPlainObject(options)) { - fetchOpts = options; - } - if (isPlainObject(body)) { - // we also accept 'body' as object... - assert(!fetchOpts.body, "options.body should be passed as source.body"); - fetchOpts.body = JSON.stringify(fetchOpts.body); - (_a = fetchOpts.method) !== null && _a !== void 0 ? _a : (fetchOpts.method = "POST"); // set default - } - if (isPlainObject(params)) { - url += "?" + new URLSearchParams(params); - (_b = fetchOpts.method) !== null && _b !== void 0 ? _b : (fetchOpts.method = "GET"); // set default - } - } - else { - url = ""; // keep linter happy - error(`Unsupported source format: ${source}`); - } - this.setStatus(NodeStatusType.loading); - const response = await fetch(url, fetchOpts); - if (!response.ok) { - error(`GET ${url} returned ${response.status}, ${response}`); - } - return await response.json(); - } - /** Download data from the cloud, then call `.update()`. */ - async load(source) { - const tree = this.tree; - const requestId = Date.now(); - const prevParent = this.parent; - const start = Date.now(); - let elap = 0, elapLoad = 0, elapProcess = 0; - // Check for overlapping requests - if (this._requestId) { - this.logWarn(`Recursive load request #${requestId} while #${this._requestId} is pending.`); - // node.debug("Send load request #" + requestId); - } - this._requestId = requestId; - // const timerLabel = tree.logTime(this + ".load()"); - try { - const url = typeof source === "string" ? source : source.url; - if (!url) { - // An array or a plain object (that does NOT contain a `.url` property) - // will be treated as native Wunderbaum data - if (typeof source.then === "function") { - const msg = tree.logTime(`Resolve thenable ${source}`); - source = await Promise.resolve(source); - tree.logTimeEnd(msg); - } - this._loadSourceObject(source); - elapProcess = Date.now() - start; - } - else { - // Either a URL string or an object with a `.url` property. - const data = await this._fetchWithOptions(source); - elapLoad = Date.now() - start; - if (this._requestId && this._requestId > requestId) { - this.logWarn(`Ignored load response #${requestId} because #${this._requestId} is pending.`); - return; - } - else { - this.logDebug(`Received response for load request #${requestId}`); - } - if (this.parent === null && prevParent !== null) { - this.logWarn("Lazy parent node was removed while loading: discarding response."); - return; - } - this.setStatus(NodeStatusType.ok); - // if (data.columns) { - // tree.logInfo("Re-define columns", data.columns); - // util.assert(!this.parent); - // tree.columns = data.columns; - // delete data.columns; - // tree.updateColumns({ calculateCols: false }); - // } - const startProcess = Date.now(); - this._loadSourceObject(data); - elapProcess = Date.now() - startProcess; - } - } - catch (error) { - this.logError("Error during load()", source, error); - this._callEvent("error", { error: error }); - this.setStatus(NodeStatusType.error, { message: "" + error }); - throw error; - } - finally { - this._requestId = 0; - elap = Date.now() - start; - if (tree.options.debugLevel >= 3) { - tree.logInfo(`Load source took ${elap / 1000} seconds ` + - `(transfer: ${elapLoad / 1000}s, ` + - `processing: ${elapProcess / 1000}s)`); - } - } - } - /**Load content of a lazy node. */ - async loadLazy(forceReload = false) { - const wasExpanded = this.expanded; - assert(this.lazy, "load() requires a lazy node"); - // _assert( forceReload || this.isUndefined(), "Pass forceReload=true to re-load a lazy node" ); - if (!forceReload && !this.isUnloaded()) { - return; - } - if (this.isLoaded()) { - this.resetLazy(); // Also collapses if currently expanded - } - // `lazyLoad` may be long-running, so mark node as loading now. `this.load()` - // will reset the status later. - this.setStatus(NodeStatusType.loading); - try { - const source = await this._callEvent("lazyLoad"); - if (source === false) { - this.setStatus(NodeStatusType.ok); - return; - } - assert(isArray(source) || (source && source.url), "The lazyLoad event must return a node list, `{url: ...}`, or false."); - await this.load(source); - this.setStatus(NodeStatusType.ok); - if (wasExpanded) { - this.expanded = true; - this.tree.update(ChangeType.structure); - } - else { - this.update(); // Fix expander icon to 'loaded' - } - } - catch (e) { - this.logError("Error during loadLazy()", e); - this._callEvent("error", { error: e }); - this.setStatus(NodeStatusType.error, { message: "" + e }); - } - return; - } - /** Alias for `logDebug` */ - log(...args) { - this.logDebug(...args); - } - /* Log to console if opts.debugLevel >= 4 */ - logDebug(...args) { - if (this.tree.options.debugLevel >= 4) { - console.log(this.toString(), ...args); // eslint-disable-line no-console - } - } - /* Log error to console. */ - logError(...args) { - if (this.tree.options.debugLevel >= 1) { - console.error(this.toString(), ...args); // eslint-disable-line no-console - } - } - /* Log to console if opts.debugLevel >= 3 */ - logInfo(...args) { - if (this.tree.options.debugLevel >= 3) { - console.info(this.toString(), ...args); // eslint-disable-line no-console - } - } - /* Log warning to console if opts.debugLevel >= 2 */ - logWarn(...args) { - if (this.tree.options.debugLevel >= 2) { - console.warn(this.toString(), ...args); // eslint-disable-line no-console - } - } - /** Expand all parents and optionally scroll into visible area as neccessary. - * Promise is resolved, when lazy loading and animations are done. - * @param {object} [options] passed to `setExpanded()`. - * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true} - */ - async makeVisible(options) { - let i; - const dfd = new Deferred(); - const deferreds = []; - const parents = this.getParentList(false, false); - const len = parents.length; - const noAnimation = getOption(options, "noAnimation", false); - const scroll = getOption(options, "scrollIntoView", true); - // Expand bottom-up, so only the top node is animated - for (i = len - 1; i >= 0; i--) { - // self.debug("pushexpand" + parents[i]); - const seOpts = { noAnimation: noAnimation }; - deferreds.push(parents[i].setExpanded(true, seOpts)); - } - Promise.all(deferreds).then(() => { - // All expands have finished - // self.debug("expand DONE", scroll); - // Note: this.tree may be none when switching demo trees - if (scroll && this.tree) { - // Make sure markup and _rowIdx is updated before we do the scroll calculations - this.tree.updatePendingModifications(); - this.scrollIntoView().then(() => { - // self.debug("scroll DONE"); - dfd.resolve(); - }); - } - else { - dfd.resolve(); - } - }); - return dfd.promise(); - } - /** Move this node to targetNode. */ - moveTo(targetNode, mode = "appendChild", map) { - if (mode === "over") { - mode = "appendChild"; // compatible with drop region - } - if (mode === "prependChild") { - if (targetNode.children && targetNode.children.length) { - mode = "before"; - targetNode = targetNode.children[0]; - } - else { - mode = "appendChild"; - } - } - let pos; - const tree = this.tree; - const prevParent = this.parent; - const targetParent = mode === "appendChild" ? targetNode : targetNode.parent; - if (this === targetNode) { - return; - } - else if (!this.parent) { - error("Cannot move system root"); - } - else if (targetParent.isDescendantOf(this)) { - error("Cannot move a node to its own descendant"); - } - if (targetParent !== prevParent) { - prevParent.triggerModifyChild("remove", this); - } - // Unlink this node from current parent - if (this.parent.children.length === 1) { - if (this.parent === targetParent) { - return; // #258 - } - this.parent.children = this.parent.lazy ? [] : null; - this.parent.expanded = false; - } - else { - pos = this.parent.children.indexOf(this); - assert(pos >= 0, "invalid source parent"); - this.parent.children.splice(pos, 1); - } - // Insert this node to target parent's child list - this.parent = targetParent; - if (targetParent.hasChildren()) { - switch (mode) { - case "appendChild": - // Append to existing target children - targetParent.children.push(this); - break; - case "before": - // Insert this node before target node - pos = targetParent.children.indexOf(targetNode); - assert(pos >= 0, "invalid target parent"); - targetParent.children.splice(pos, 0, this); - break; - case "after": - // Insert this node after target node - pos = targetParent.children.indexOf(targetNode); - assert(pos >= 0, "invalid target parent"); - targetParent.children.splice(pos + 1, 0, this); - break; - default: - error(`Invalid mode '${mode}'.`); - } - } - else { - targetParent.children = [this]; - } - // Let caller modify the nodes - if (map) { - targetNode.visit(map, true); - } - if (targetParent === prevParent) { - targetParent.triggerModifyChild("move", this); - } - else { - // prevParent.triggerModifyChild("remove", this); - targetParent.triggerModifyChild("add", this); - } - // Handle cross-tree moves - if (tree !== targetNode.tree) { - // Fix node.tree for all source nodes - // util.assert(false, "Cross-tree move is not yet implemented."); - this.logWarn("Cross-tree moveTo is experimental!"); - this.visit((n) => { - // TODO: fix selection state and activation, ... - n.tree = targetNode.tree; - }, true); - } - // Make sure we update async, because discarding the markup would prevent - // DragAndDrop to generate a dragend event on the source node - setTimeout(() => { - // Even indentation may have changed: - tree.update(ChangeType.any); - }, 0); - // TODO: fix selection state - // TODO: fix active state - } - /** Set focus relative to this node and optionally activate. - * - * 'left' collapses the node if it is expanded, or move to the parent - * otherwise. - * 'right' expands the node if it is collapsed, or move to the first - * child otherwise. - * - * @param where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'. - * (Alternatively the `event.key` that would normally trigger this move, - * e.g. `ArrowLeft` = 'left'. - * @param options - */ - async navigate(where, options) { - // Allow to pass 'ArrowLeft' instead of 'left' - where = KEY_TO_ACTION_DICT[where] || where; - // Otherwise activate or focus the related node - const node = this.findRelatedNode(where); - if (!node) { - this.logWarn(`Could not find related node '${where}'.`); - return Promise.resolve(this); - } - // setFocus/setActive will scroll later (if autoScroll is specified) - try { - node.makeVisible({ scrollIntoView: false }); - } - catch (e) { - // ignore - } - node.setFocus(); - if ((options === null || options === void 0 ? void 0 : options.activate) === false) { - return Promise.resolve(this); - } - return node.setActive(true, { event: options === null || options === void 0 ? void 0 : options.event }); - } - /** Delete this node and all descendants. */ - remove() { - const tree = this.tree; - const pos = this.parent.children.indexOf(this); - this.triggerModify("remove"); - this.parent.children.splice(pos, 1); - this.visit((n) => { - n.removeMarkup(); - tree._unregisterNode(n); - }, true); - tree.update(ChangeType.structure); - } - /** Remove all descendants of this node. */ - removeChildren() { - const tree = this.tree; - if (!this.children) { - return; - } - if (tree.activeNode && tree.activeNode.isDescendantOf(this)) { - tree.activeNode.setActive(false); // TODO: don't fire events - } - if (tree.focusNode && tree.focusNode.isDescendantOf(this)) { - tree.focusNode = null; - } - // TODO: persist must take care to clear select and expand cookies - // Unlink children to support GC - // TODO: also delete this.children (not possible using visit()) - this.triggerModifyChild("remove", null); - this.visit((n) => { - tree._unregisterNode(n); - }); - if (this.lazy) { - // 'undefined' would be interpreted as 'not yet loaded' for lazy nodes - this.children = []; - } - else { - this.children = null; - } - // util.assert(this.parent); // don't call this for root node - if (!this.isRootNode()) { - this.expanded = false; - } - this.tree.update(ChangeType.structure); - } - /** Remove all HTML markup from the DOM. */ - removeMarkup() { - if (this._rowElem) { - delete this._rowElem._wb_node; - this._rowElem.remove(); - this._rowElem = undefined; - } - } - _getRenderInfo() { - const allColInfosById = {}; - const renderColInfosById = {}; - const isColspan = this.isColspan(); - const colElems = this._rowElem - ? (this._rowElem.querySelectorAll("span.wb-col")) - : null; - let idx = 0; - for (const col of this.tree.columns) { - allColInfosById[col.id] = { - id: col.id, - idx: idx, - elem: colElems ? colElems[idx] : null, - info: col, - }; - // renderColInfosById only contains columns that need rendering: - if (!isColspan && col.id !== "*") { - renderColInfosById[col.id] = allColInfosById[col.id]; - } - idx++; - } - return { - allColInfosById: allColInfosById, - renderColInfosById: renderColInfosById, - }; - } - _createIcon(iconMap, parentElem, replaceChild, showLoading) { - let iconSpan; - let icon = this.getOption("icon"); - if (this._errorInfo) { - icon = iconMap.error; - } - else if (this._isLoading && showLoading) { - // Status nodes, or nodes without expander (< minExpandLevel) should - // display the 'loading' status with the i.wb-icon span - icon = iconMap.loading; - } - if (icon === false) { - return null; // explicitly disabled: don't try default icons - } - if (typeof icon === "string") ; - else if (this.statusNodeType) { - icon = iconMap[this.statusNodeType]; - } - else if (this.expanded) { - icon = iconMap.folderOpen; - } - else if (this.children) { - icon = iconMap.folder; - } - else if (this.lazy) { - icon = iconMap.folderLazy; - } - else { - icon = iconMap.doc; - } - // this.log("_createIcon: " + icon); - if (!icon) { - iconSpan = document.createElement("i"); - iconSpan.className = "wb-icon"; - } - else if (icon.indexOf("<") >= 0) { - // HTML - iconSpan = elemFromHtml(icon); - } - else if (TEST_IMG.test(icon)) { - // Image URL - iconSpan = elemFromHtml(``); - } - else { - // Class name - iconSpan = document.createElement("i"); - iconSpan.className = "wb-icon " + icon; - } - if (replaceChild) { - parentElem.replaceChild(iconSpan, replaceChild); - } - else { - parentElem.appendChild(iconSpan); - } - // Event handler `tree.iconBadge` can return a badge text or HTMLSpanElement - const cbRes = this._callEvent("iconBadge", { iconSpan: iconSpan }); - let badge = null; - if (cbRes != null && cbRes !== false) { - let classes = ""; - let tooltip = ""; - if (isPlainObject(cbRes)) { - badge = "" + cbRes.badge; - classes = cbRes.badgeClass ? " " + cbRes.badgeClass : ""; - tooltip = cbRes.badgeTooltip ? ` title="${cbRes.badgeTooltip}"` : ""; - } - else if (typeof cbRes === "number") { - badge = "" + cbRes; - } - else { - badge = cbRes; // string or HTMLSpanElement - } - if (typeof badge === "string") { - badge = elemFromHtml(`${escapeHtml(badge)}`); - } - if (badge) { - iconSpan.append(badge); - } - } - // this.log("_createIcon: ", iconSpan); - return iconSpan; - } - /** - * Create a whole new `
` element. - * @see {@link WunderbaumNode._render} - */ - _render_markup(opts) { - const tree = this.tree; - const treeOptions = tree.options; - const checkbox = this.getOption("checkbox"); - const columns = tree.columns; - const level = this.getLevel(); - const activeColIdx = tree.isRowNav() ? null : tree.activeColIdx; - let elem; - let rowDiv = this._rowElem; - let checkboxSpan = null; - let expanderSpan = null; - const isNew = !rowDiv; - assert(isNew, "Expected unrendered node"); - assert(!isNew || (opts && opts.after), "opts.after expected, unless updating"); - assert(!this.isRootNode(), "Root node not allowed"); - rowDiv = document.createElement("div"); - rowDiv.classList.add("wb-row"); - rowDiv.style.top = this._rowIdx * ROW_HEIGHT + "px"; - this._rowElem = rowDiv; - // Attach a node reference to the DOM Element: - rowDiv._wb_node = this; - const nodeElem = document.createElement("span"); - nodeElem.classList.add("wb-node", "wb-col"); - rowDiv.appendChild(nodeElem); - let ofsTitlePx = 0; - if (checkbox) { - checkboxSpan = document.createElement("i"); - checkboxSpan.classList.add("wb-checkbox"); - if (checkbox === "radio" || this.parent.radiogroup) { - checkboxSpan.classList.add("wb-radio"); - } - nodeElem.appendChild(checkboxSpan); - ofsTitlePx += ICON_WIDTH; - } - for (let i = level - 1; i > 0; i--) { - elem = document.createElement("i"); - elem.classList.add("wb-indent"); - nodeElem.appendChild(elem); - ofsTitlePx += ICON_WIDTH; - } - if (!treeOptions.minExpandLevel || level > treeOptions.minExpandLevel) { - expanderSpan = document.createElement("i"); - expanderSpan.classList.add("wb-expander"); - nodeElem.appendChild(expanderSpan); - ofsTitlePx += ICON_WIDTH; - } - // Render the icon (show a 'loading' icon if we do not have an expander that - // we would prefer). - const iconSpan = this._createIcon(tree.iconMap, nodeElem, null, !expanderSpan); - if (iconSpan) { - ofsTitlePx += ICON_WIDTH; - } - const titleSpan = document.createElement("span"); - titleSpan.classList.add("wb-title"); - nodeElem.appendChild(titleSpan); - // this._callEvent("enhanceTitle", { titleSpan: titleSpan }); - // Store the width of leading icons with the node, so we can calculate - // the width of the embedded title span later - nodeElem._ofsTitlePx = ofsTitlePx; - // Support HTML5 drag-n-drop - if (tree.options.dnd.dragStart) { - nodeElem.draggable = true; - } - // Render columns - const isColspan = this.isColspan(); - if (!isColspan && columns.length > 1) { - let colIdx = 0; - for (const col of columns) { - colIdx++; - let colElem; - if (col.id === "*") { - colElem = nodeElem; - } - else { - colElem = document.createElement("span"); - colElem.classList.add("wb-col"); - rowDiv.appendChild(colElem); - } - if (colIdx === activeColIdx) { - colElem.classList.add("wb-active"); - } - // Add classes from `columns` definition to `` cells - col.classes ? colElem.classList.add(...col.classes.split(" ")) : 0; - colElem.style.left = col._ofsPx + "px"; - colElem.style.width = col._widthPx + "px"; - if (isNew && col.html) { - if (typeof col.html === "string") { - colElem.innerHTML = col.html; - } - } - } - } - // Attach to DOM as late as possible - const after = opts ? opts.after : "last"; - switch (after) { - case "first": - tree.nodeListElement.prepend(rowDiv); - break; - case "last": - tree.nodeListElement.appendChild(rowDiv); - break; - default: - opts.after.after(rowDiv); - } - // Now go on and fill in data and update classes - opts.isNew = true; - this._render_data(opts); - } - /** - * Render `node.title`, `.icon` into an existing row. - * - * @see {@link WunderbaumNode._render} - */ - _render_data(opts) { - assert(this._rowElem, "No _rowElem"); - const tree = this.tree; - const treeOptions = tree.options; - const rowDiv = this._rowElem; - const isNew = !!opts.isNew; // Called by _render_markup()? - const preventScroll = !!opts.preventScroll; - const columns = tree.columns; - const isColspan = this.isColspan(); - // Row markup already exists - const nodeElem = rowDiv.querySelector("span.wb-node"); - const titleSpan = nodeElem.querySelector("span.wb-title"); - const scrollTop = tree.element.scrollTop; - if (this.titleWithHighlight) { - titleSpan.innerHTML = this.titleWithHighlight; - } - else { - titleSpan.textContent = this.title; // TODO: this triggers scroll events - } - // NOTE: At least on Safari, this render call triggers a scroll event - // probably when a focused input is replaced. - if (preventScroll) { - tree.element.scrollTop = scrollTop; - } - // Set the width of the title span, so overflow ellipsis work - if (!treeOptions.skeleton) { - if (isColspan) { - const vpWidth = tree.element.clientWidth; - titleSpan.style.width = - vpWidth - nodeElem._ofsTitlePx - TITLE_SPAN_PAD_Y + "px"; - } - else { - titleSpan.style.width = - columns[0]._widthPx - - nodeElem._ofsTitlePx - - TITLE_SPAN_PAD_Y + - "px"; - } - } - // Update row classes - opts.isDataChange = true; - this._render_status(opts); - // Let user modify the result - if (this.statusNodeType) { - this._callEvent("renderStatusNode", { - isNew: isNew, - nodeElem: nodeElem, - isColspan: isColspan, - }); - } - else if (this.parent) { - // Skip root node - const renderInfo = this._getRenderInfo(); - this._callEvent("render", { - isNew: isNew, - nodeElem: nodeElem, - isColspan: isColspan, - allColInfosById: renderInfo.allColInfosById, - renderColInfosById: renderInfo.renderColInfosById, - }); - } - } - /** - * Update row classes to reflect active, focuses, etc. - * @see {@link WunderbaumNode._render} - */ - _render_status(opts) { - // this.log("_render_status", opts); - const tree = this.tree; - const iconMap = tree.iconMap; - const treeOptions = tree.options; - const typeInfo = this.type ? tree.types[this.type] : null; - const rowDiv = this._rowElem; - // Row markup already exists - const nodeElem = rowDiv.querySelector("span.wb-node"); - const expanderSpan = nodeElem.querySelector("i.wb-expander"); - const checkboxSpan = nodeElem.querySelector("i.wb-checkbox"); - const rowClasses = ["wb-row"]; - this.expanded ? rowClasses.push("wb-expanded") : 0; - this.lazy ? rowClasses.push("wb-lazy") : 0; - this.selected ? rowClasses.push("wb-selected") : 0; - this._partsel ? rowClasses.push("wb-partsel") : 0; - this === tree.activeNode ? rowClasses.push("wb-active") : 0; - this === tree.focusNode ? rowClasses.push("wb-focus") : 0; - this._errorInfo ? rowClasses.push("wb-error") : 0; - this._isLoading ? rowClasses.push("wb-loading") : 0; - this.isColspan() ? rowClasses.push("wb-colspan") : 0; - this.statusNodeType - ? rowClasses.push("wb-status-" + this.statusNodeType) - : 0; - this.match ? rowClasses.push("wb-match") : 0; - this.subMatchCount ? rowClasses.push("wb-submatch") : 0; - treeOptions.skeleton ? rowClasses.push("wb-skeleton") : 0; - // Replace previous classes: - rowDiv.className = rowClasses.join(" "); - // Add classes from `node.classes` - this.classes ? rowDiv.classList.add(...this.classes) : 0; - // Add classes from `tree.types[node.type]` - if (typeInfo && typeInfo.classes) { - rowDiv.classList.add(...typeInfo.classes); - } - if (expanderSpan) { - let image = null; - if (this._isLoading) { - image = iconMap.loading; - } - else if (this.isExpandable(false)) { - if (this.expanded) { - image = iconMap.expanderExpanded; - } - else { - image = iconMap.expanderCollapsed; - } - } - else if (this.lazy && this.children == null) { - image = iconMap.expanderLazy; - } - if (image == null) { - expanderSpan.classList.add("wb-indent"); - } - else if (TEST_IMG.test(image)) { - expanderSpan.style.backgroundImage = `url('${image}')`; - } - else { - expanderSpan.className = "wb-expander " + image; - } - } - if (checkboxSpan) { - let cbclass = "wb-checkbox "; - if (this.isRadio()) { - cbclass += "wb-radio "; - if (this.selected) { - cbclass += iconMap.radioChecked; - // } else if (this._partsel) { - // cbclass += iconMap.radioUnknown; - } - else { - cbclass += iconMap.radioUnchecked; - } - } - else { - if (this.selected) { - cbclass += iconMap.checkChecked; - } - else if (this._partsel) { - cbclass += iconMap.checkUnknown; - } - else { - cbclass += iconMap.checkUnchecked; - } - } - checkboxSpan.className = cbclass; - } - // Fix active cell in cell-nav mode - if (!opts.isNew) { - let i = 0; - for (const colSpan of rowDiv.children) { - colSpan.classList.toggle("wb-active", i++ === tree.activeColIdx); - } - // Update icon (if not opts.isNew, which would rebuild markup anyway) - const iconSpan = nodeElem.querySelector("i.wb-icon"); - if (iconSpan) { - this._createIcon(tree.iconMap, nodeElem, iconSpan, !expanderSpan); - } - } - // Adjust column width - if (opts.resizeCols !== false && !this.isColspan()) { - const colElems = rowDiv.querySelectorAll("span.wb-col"); - let idx = 0; - let ofs = 0; - for (const colDef of this.tree.columns) { - const colElem = colElems[idx]; - colElem.style.left = `${ofs}px`; - colElem.style.width = `${colDef._widthPx}px`; - idx++; - ofs += colDef._widthPx; - } - } - } - /* - * Create or update node's markup. - * - * `options.change` defaults to ChangeType.data, which updates the title, - * icon, and status. It also triggers the `render` event, that lets the user - * create or update the content of embeded cell elements. - * - * If only the status or other class-only modifications have changed, - * `options.change` should be set to ChangeType.status instead for best - * efficiency. - * - * Calling `update()` is almost always a better alternative. - * @see {@link WunderbaumNode.update} - */ - _render(options) { - // this.log("render", options); - const opts = Object.assign({ change: ChangeType.data }, options); - if (!this._rowElem) { - opts.change = ChangeType.row; - } - switch (opts.change) { - case "status": - this._render_status(opts); - break; - case "data": - this._render_data(opts); - break; - case "row": - // _rowElem is not yet created (asserted in _render_markup) - this._render_markup(opts); - break; - default: - error(`Invalid change type '${opts.change}'.`); - } - } - /** - * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad - * event is triggered on next expand. - */ - resetLazy() { - this.removeChildren(); - this.expanded = false; - this.lazy = true; - this.children = null; - this.tree.update(ChangeType.structure); - } - /** Convert node (or whole branch) into a plain object. - * - * The result is compatible with node.addChildren(). - * - * @param include child nodes - * @param callback(dict, node) is called for every node, in order to allow - * modifications. - * Return `false` to ignore this node or `"skip"` to include this node - * without its children. - * @see {@link Wunderbaum.toDictArray}. - */ - toDict(recursive = false, callback) { - const dict = {}; - NODE_DICT_PROPS.forEach((propName) => { - const val = this[propName]; - if (val instanceof Set) { - // Convert Set to string (or skip if set is empty) - val.size - ? (dict[propName] = Array.prototype.join.call(val.keys(), " ")) - : 0; - } - else if (val || val === false || val === 0) { - dict[propName] = val; - } - }); - if (!isEmptyObject(this.data)) { - dict.data = extend({}, this.data); - if (isEmptyObject(dict.data)) { - delete dict.data; - } - } - if (callback) { - const res = callback(dict, this); - if (res === false) { - // Note: a return value of `false` is only used internally - return false; // Don't include this node nor its children - } - if (res === "skip") { - recursive = false; // Include this node, but not the children - } - } - if (recursive) { - if (isArray(this.children)) { - dict.children = []; - for (let i = 0, l = this.children.length; i < l; i++) { - const node = this.children[i]; - if (!node.isStatusNode()) { - // Note: a return value of `false` is only used internally - const res = node.toDict(true, callback); - if (res !== false) { - dict.children.push(res); - } - } - } - } - } - return dict; - } - /** Return an option value that has a default, but may be overridden by a - * callback or a node instance attribute. - * - * Evaluation sequence: - * - * - If `tree.options.` is a callback that returns something, use that. - * - Else if `node.` is defined, use that. - * - Else if `tree.types[]` is a value, use that. - * - Else if `tree.options.` is a value, use that. - * - Else use `defaultValue`. - * - * @param name name of the option property (on node and tree) - * @param defaultValue return this if nothing else matched - * {@link Wunderbaum.getOption|Wunderbaum.getOption()} - */ - getOption(name, defaultValue) { - const tree = this.tree; - let opts = tree.options; - // Lookup `name` in options dict - if (name.indexOf(".") >= 0) { - [opts, name] = name.split("."); - } - const value = opts[name]; // ?? defaultValue; - // A callback resolver always takes precedence - if (typeof value === "function") { - const res = value.call(tree, { - type: "resolve", - tree: tree, - node: this, - // typeInfo: this.type ? tree.types[this.type] : {}, - }); - if (res !== undefined) { - return res; - } - } - // If this node has an explicit local setting, use it: - if (this[name] !== undefined) { - return this[name]; - } - // Use value from type definition if defined - const typeInfo = this.type ? tree.types[this.type] : undefined; - const res = typeInfo ? typeInfo[name] : undefined; - if (res !== undefined) { - return res; - } - // Use value from value options dict, fallback do default - return value !== null && value !== void 0 ? value : defaultValue; - } - /** Make sure that this node is visible in the viewport. - * @see {@link Wunderbaum.scrollTo|Wunderbaum.scrollTo()} - */ - async scrollIntoView(options) { - const opts = Object.assign({ node: this }, options); - return this.tree.scrollTo(opts); - } - /** - * Activate this node, deactivate previous, send events, activate column and scroll int viewport. - */ - async setActive(flag = true, options) { - const tree = this.tree; - const prev = tree.activeNode; - const retrigger = options === null || options === void 0 ? void 0 : options.retrigger; // Default: false - const focusTree = options === null || options === void 0 ? void 0 : options.focusTree; // Default: false - const focusNode = (options === null || options === void 0 ? void 0 : options.focusNode) !== false; // Default: true - const noEvents = options === null || options === void 0 ? void 0 : options.noEvents; // Default: false - const orgEvent = options === null || options === void 0 ? void 0 : options.event; // Default: false - if (!noEvents) { - if (flag) { - if (prev !== this || retrigger) { - if ((prev === null || prev === void 0 ? void 0 : prev._callEvent("deactivate", { - nextNode: this, - event: orgEvent, - })) === false || - this._callEvent("beforeActivate", { - prevNode: prev, - event: orgEvent, - }) === false) { - return; - } - tree.activeNode = null; - prev === null || prev === void 0 ? void 0 : prev.update(ChangeType.status); - } - } - else if (prev === this || retrigger) { - this._callEvent("deactivate", { nextNode: null, event: orgEvent }); - } - } - if (prev !== this) { - if (flag) { - tree.activeNode = this; - if (focusNode || focusTree) { - tree.focusNode = this; - } - if (focusTree) { - tree.setFocus(); - } - } - prev === null || prev === void 0 ? void 0 : prev.update(ChangeType.status); - this.update(ChangeType.status); - } - if (options && - options.colIdx != null && - options.colIdx !== tree.activeColIdx && - tree.isCellNav()) { - tree.setColumn(options.colIdx); - } - if (flag && !noEvents) { - this._callEvent("activate", { prevNode: prev, event: orgEvent }); - } - return this.makeVisible(); - } - /** - * Expand or collapse this node. - */ - async setExpanded(flag = true, options) { - const { force, scrollIntoView, immediate } = options !== null && options !== void 0 ? options : {}; - if (!flag && - this.isExpanded() && - this.getLevel() <= this.tree.getOption("minExpandLevel") && - !force) { - this.logDebug("Ignored collapse request below expandLevel."); - return; - } - if (!flag === !this.expanded) { - return; // Nothing to do - } - // this.log("setExpanded()"); - if (flag && this.getOption("autoCollapse")) { - this.collapseSiblings(options); - } - if (flag && this.lazy && this.children == null) { - await this.loadLazy(); - } - this.expanded = flag; - const updateOpts = { immediate: immediate }; - // const updateOpts = { immediate: !!util.getOption(options, "immediate") }; - this.tree.update(ChangeType.structure, updateOpts); - if (flag && scrollIntoView) { - const lastChild = this.getLastChild(); - if (lastChild) { - this.tree.updatePendingModifications(); - lastChild.scrollIntoView({ topNode: this }); - } - } - } - /** - * Set keyboard focus here. - * @see {@link setActive} - */ - setFocus(flag = true) { - assert(!!flag, "blur is not yet implemented"); - const prev = this.tree.focusNode; - this.tree.focusNode = this; - prev === null || prev === void 0 ? void 0 : prev.update(); - this.update(); - } - /** Set a new icon path or class. */ - setIcon(icon) { - this.icon = icon; - this.update(); - } - /** Change node's {@link key} and/or {@link refKey}. */ - setKey(key, refKey) { - throw new Error("Not yet implemented"); - } - /** - * Trigger a repaint, typically after a status or data change. - * - * `change` defaults to 'data', which handles modifcations of title, icon, - * and column content. It can be reduced to 'ChangeType.status' if only - * active/focus/selected state has changed. - * - * This method will eventually call {@link WunderbaumNode._render()} with - * default options, but may be more consistent with the tree's - * {@link Wunderbaum.update()} API. - */ - update(change = ChangeType.data) { - assert(change === ChangeType.status || change === ChangeType.data, `Invalid change type ${change}`); - this.tree.update(change, this); - } - /** - * Return an array of selected nodes. - * @param stopOnParents only return the topmost selected node (useful with selectMode 'hier') - */ - getSelectedNodes(stopOnParents = false) { - const nodeList = []; - this.visit((node) => { - if (node.selected) { - nodeList.push(node); - if (stopOnParents === true) { - return "skip"; // stop processing this branch - } - } - }); - return nodeList; - } - /** Toggle the check/uncheck state. */ - toggleSelected(options) { - let flag = this.isSelected(); - if (flag === undefined && !this.isRadio()) { - flag = this._anySelectable(); - } - else { - flag = !flag; - } - return this.setSelected(flag, options); - } - /** Return true if at least on selectable descendant end-node is unselected. @internal */ - _anySelectable() { - let found = false; - this.visit((node) => { - if (node.selected === false && - !node.unselectable && - !node.hasChildren() && - !node.parent.radiogroup) { - found = true; - return false; // Stop iteration - } - }); - return found; - } - /* Apply selection state to a single node. */ - _changeSelectStatusProps(state) { - let changed = false; - switch (state) { - case false: - changed = this.selected || this._partsel; - this.selected = false; - this._partsel = false; - break; - case true: - changed = !this.selected || !this._partsel; - this.selected = true; - this._partsel = true; - break; - case undefined: - changed = this.selected || !this._partsel; - this.selected = false; - this._partsel = true; - break; - default: - error(`Invalid state: ${state}`); - } - if (changed) { - this.update(); - } - return changed; - } - /** - * Fix selection status, after this node was (de)selected in `selectMode: 'hier'`. - * This includes (de)selecting all descendants. - */ - fixSelection3AfterClick(opts) { - const force = !!(opts === null || opts === void 0 ? void 0 : opts.force); - const flag = this.isSelected(); - this.visit((node) => { - if (node.radiogroup) { - return "skip"; // Don't (de)select this branch - } - if (force || !node.getOption("unselectable")) { - node._changeSelectStatusProps(flag); - } - }); - this.fixSelection3FromEndNodes(); - } - /** - * Fix selection status for multi-hier mode. - * Only end-nodes are considered to update the descendants branch and parents. - * Should be called after this node has loaded new children or after - * children have been modified using the API. - */ - fixSelection3FromEndNodes(opts) { - const force = !!(opts === null || opts === void 0 ? void 0 : opts.force); - assert(this.tree.options.selectMode === "hier", "expected selectMode 'hier'"); - // Visit all end nodes and adjust their parent's `selected` and `_partsel` - // attributes. Return selection state true, false, or undefined. - const _walk = (node) => { - let state; - const children = node.children; - if (children && children.length) { - // check all children recursively - let allSelected = true; - let someSelected = false; - for (let i = 0, l = children.length; i < l; i++) { - const child = children[i]; - // the selection state of a node is not relevant; we need the end-nodes - const s = _walk(child); - if (s !== false) { - someSelected = true; - } - if (s !== true) { - allSelected = false; - } - } - state = allSelected ? true : someSelected ? undefined : false; - } - else { - // This is an end-node: simply report the status - state = !!node.selected; - } - // #939: Keep a `_partsel` flag that was explicitly set on a lazy node - if (node._partsel && - !node.selected && - node.lazy && - node.children == null) { - state = undefined; - } - if (force || !node.getOption("unselectable")) { - node._changeSelectStatusProps(state); - } - return state; - }; - _walk(this); - // Update parent's state - this.visitParents((node) => { - let state; - const children = node.children; - let allSelected = true; - let someSelected = false; - for (let i = 0, l = children.length; i < l; i++) { - const child = children[i]; - state = !!child.selected; - // When fixing the parents, we trust the sibling status (i.e. we don't recurse) - if (state || child._partsel) { - someSelected = true; - } - if (!state) { - allSelected = false; - } - } - state = allSelected ? true : someSelected ? undefined : false; - node._changeSelectStatusProps(state); - }); - } - /** Modify the check/uncheck state. */ - setSelected(flag = true, options) { - const tree = this.tree; - const sendEvents = !(options === null || options === void 0 ? void 0 : options.noEvents); // Default: send events - const prev = this.isSelected(); - const isRadio = this.parent && this.parent.radiogroup; - const selectMode = tree.options.selectMode; - const canSelect = (options === null || options === void 0 ? void 0 : options.force) || !this.getOption("unselectable"); - flag = !!flag; - // this.logDebug(`setSelected(${flag})`, this); - if (!canSelect) { - return prev; - } - if ((options === null || options === void 0 ? void 0 : options.propagateDown) && selectMode === "multi") { - tree.runWithDeferredUpdate(() => { - this.visit((node) => { - node.setSelected(flag); - }); - }); - return prev; - } - if (flag === prev || - (sendEvents && this._callEvent("beforeSelect", { flag: flag }) === false)) { - return prev; - } - tree.runWithDeferredUpdate(() => { - if (isRadio) { - // Radiobutton Group - if (!flag && !(options === null || options === void 0 ? void 0 : options.force)) { - return prev; // don't uncheck radio buttons - } - for (const sibling of this.parent.children) { - sibling.selected = sibling === this; - } - } - else { - this.selected = flag; - if (selectMode === "hier") { - this.fixSelection3AfterClick(); - } - else if (selectMode === "single") { - tree.visit((n) => { - n.selected = false; - }); - } - } - }); - if (sendEvents) { - this._callEvent("select", { flag: flag }); - } - return prev; - } - /** Display node status (ok, loading, error, noData) using styles and a dummy child node. */ - setStatus(status, options) { - const tree = this.tree; - const message = options === null || options === void 0 ? void 0 : options.message; - const details = options === null || options === void 0 ? void 0 : options.details; - let statusNode = null; - const _clearStatusNode = () => { - // Remove dedicated dummy node, if any - const children = this.children; - if (children && children.length && children[0].isStatusNode()) { - children[0].remove(); - } - }; - const _setStatusNode = (data) => { - // Create/modify the dedicated dummy node for 'loading...' or - // 'error!' status. (only called for direct child of the invisible - // system root) - const children = this.children; - const firstChild = children ? children[0] : null; - assert(data.statusNodeType, "Not a status node"); - assert(!firstChild || !firstChild.isStatusNode(), "Child must not be a status node"); - statusNode = this.addNode(data, "prependChild"); - statusNode.match = true; - tree.update(ChangeType.structure); - return statusNode; - }; - _clearStatusNode(); - switch (status) { - case "ok": - this._isLoading = false; - this._errorInfo = null; - break; - case "loading": - this._isLoading = true; - this._errorInfo = null; - if (this.parent) { - this.update(ChangeType.status); - } - else { - // If this is the invisible root, add a visible top-level node - _setStatusNode({ - statusNodeType: status, - title: tree.options.strings.loading + - (message ? " (" + message + ")" : ""), - checkbox: false, - colspan: true, - tooltip: details, - }); - } - // this.update(); - break; - case "error": - _setStatusNode({ - statusNodeType: status, - title: tree.options.strings.loadError + - (message ? " (" + message + ")" : ""), - checkbox: false, - colspan: true, - // classes: "wb-center", - tooltip: details, - }); - this._isLoading = false; - this._errorInfo = { message: message, details: details }; - break; - case "noData": - _setStatusNode({ - statusNodeType: status, - title: message || tree.options.strings.noData, - checkbox: false, - colspan: true, - tooltip: details, - }); - this._isLoading = false; - this._errorInfo = null; - break; - default: - error("invalid node status " + status); - } - tree.update(ChangeType.structure); - return statusNode; - } - /** Rename this node. */ - setTitle(title) { - this.title = title; - this.update(); - // this.triggerModify("rename"); // TODO - } - _sortChildren(cmp, deep) { - const cl = this.children; - if (!cl) { - return; - } - cl.sort(cmp); - if (deep) { - for (let i = 0, l = cl.length; i < l; i++) { - if (cl[i].children) { - cl[i]._sortChildren(cmp, deep); - } - } - } - } - /** - * Sort child list by title or custom criteria. - * @param {function} cmp custom compare function(a, b) that returns -1, 0, or 1 - * (defaults to sorting by title). - * @param {boolean} deep pass true to sort all descendant nodes recursively - */ - sortChildren(cmp = nodeTitleSorter, deep = false) { - this._sortChildren(cmp || nodeTitleSorter, deep); - this.tree.update(ChangeType.structure); - // this.triggerModify("sort"); // TODO - } - /** - * Trigger `modifyChild` event on a parent to signal that a child was modified. - * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ... - */ - triggerModifyChild(operation, child, extra) { - this.logDebug(`modifyChild(${operation})`, extra, child); - if (!this.tree.options.modifyChild) { - return; - } - if (child && child.parent !== this) { - error("child " + child + " is not a child of " + this); - } - this._callEvent("modifyChild", extend({ operation: operation, child: child }, extra)); - } - /** - * Trigger `modifyChild` event on node.parent(!). - * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ... - * @param {object} [extra] - */ - triggerModify(operation, extra) { - // if (!this.parent) { - // return; - // } - this.parent.triggerModifyChild(operation, this, extra); - } - /** - * Call `callback(node)` for all descendant nodes in hierarchical order (depth-first, pre-order). - * - * Stop iteration, if fn() returns false. Skip current branch, if fn() - * returns "skip".
- * Return false if iteration was stopped. - * - * @param {function} callback the callback function. - * Return false to stop iteration, return "skip" to skip this node and - * its children only. - * @see {@link IterableIterator}, {@link Wunderbaum.visit}. - */ - visit(callback, includeSelf = false) { - let res = true; - const children = this.children; - if (includeSelf === true) { - res = callback(this); - if (res === false || res === "skip") { - return res; - } - } - if (children) { - for (let i = 0, l = children.length; i < l; i++) { - res = children[i].visit(callback, true); - if (res === false) { - break; - } - } - } - return res; - } - /** Call fn(node) for all parent nodes, bottom-up, including invisible system root.
- * Stop iteration, if callback() returns false.
- * Return false if iteration was stopped. - * - * @param callback the callback function. Return false to stop iteration - */ - visitParents(callback, includeSelf = false) { - if (includeSelf && callback(this) === false) { - return false; - } - let p = this.parent; - while (p) { - if (callback(p) === false) { - return false; - } - p = p.parent; - } - return true; - } - /** - * Call fn(node) for all sibling nodes.
- * Stop iteration, if fn() returns false.
- * Return false if iteration was stopped. - * - * @param {function} fn the callback function. - * Return false to stop iteration. - */ - visitSiblings(callback, includeSelf = false) { - const ac = this.parent.children; - for (let i = 0, l = ac.length; i < l; i++) { - const n = ac[i]; - if (includeSelf || n !== this) { - if (callback(n) === false) { - return false; - } - } - } - return true; - } - /** - * [ext-filter] Return true if this node is matched by current filter (or no filter is active). - */ - isMatched() { - return !(this.tree.filterMode && !this.match); - } - } - WunderbaumNode.sequence = 0; + /*! + * Wunderbaum - wunderbaum_node + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + /** WunderbaumNode properties that can be passed with source data. + * (Any other source properties will be stored as `node.data.PROP`.) + */ + const NODE_PROPS = new Set([ + "checkbox", + "classes", + "expanded", + "icon", + "iconTooltip", + "key", + "lazy", + "_partsel", + "radiogroup", + "refKey", + "selected", + "statusNodeType", + "title", + "tooltip", + "type", + "unselectable", + ]); + /** WunderbaumNode properties that will be returned by `node.toDict()`.) + */ + const NODE_DICT_PROPS = new Set(NODE_PROPS); + NODE_DICT_PROPS.delete("_partsel"); + NODE_DICT_PROPS.delete("unselectable"); + /** + * A single tree node. + * + * **NOTE:**
+ * Generally you should not modify properties directly, since this may break + * the internal bookkeeping. + */ + class WunderbaumNode { + constructor(tree, parent, data) { + var _a, _b; + /** Reference key. Unlike {@link key}, a `refKey` may occur multiple + * times within a tree (in this case we have 'clone nodes'). + * @see Use {@link setKey} to modify. + */ + this.refKey = undefined; + this.children = null; + /** Additional classes added to `div.wb-row`. + * @see {@link hasClass}, {@link setClass}. */ + this.classes = null; //new Set(); + /** Custom data that was passed to the constructor */ + this.data = {}; + this._isLoading = false; + this._requestId = 0; + this._errorInfo = null; + this._partsel = false; + this._partload = false; + this.subMatchCount = 0; + this._rowIdx = 0; + this._rowElem = undefined; + assert(!parent || parent.tree === tree, `Invalid parent: ${parent}`); + assert(!data.children, "'children' not allowed here"); + this.tree = tree; + this.parent = parent; + this.key = "" + ((_a = data.key) !== null && _a !== void 0 ? _a : ++WunderbaumNode.sequence); + this.title = "" + ((_b = data.title) !== null && _b !== void 0 ? _b : "<" + this.key + ">"); + data.refKey != null ? (this.refKey = "" + data.refKey) : 0; + data.type != null ? (this.type = "" + data.type) : 0; + this.expanded = data.expanded === true; + data.icon != null ? (this.icon = data.icon) : 0; + this.lazy = data.lazy === true; + data.statusNodeType != null + ? (this.statusNodeType = ("" + data.statusNodeType)) + : 0; + data.colspan != null ? (this.colspan = !!data.colspan) : 0; + // Selection + data.checkbox != null ? (this.checkbox = !!data.checkbox) : 0; + data.radiogroup != null ? (this.radiogroup = !!data.radiogroup) : 0; + this.selected = data.selected === true; + data.unselectable === true ? (this.unselectable = true) : 0; + if (data.classes) { + this.setClass(data.classes); + } + // Store custom fields as `node.data` + for (const [key, value] of Object.entries(data)) { + if (!NODE_PROPS.has(key)) { + this.data[key] = value; + } + } + if (parent && !this.statusNodeType) { + // Don't register root node or status nodes + tree._registerNode(this); + } + } + /** + * Return readable string representation for this instance. + * @internal + */ + toString() { + return `WunderbaumNode@${this.key}<'${this.title}'>`; + } + /** + * Iterate all descendant nodes depth-first, pre-order using `for ... of ...` syntax. + * More concise, but slightly slower than {@link WunderbaumNode.visit}. + * + * Example: + * ```js + * for(const n of node) { + * ... + * } + * ``` + */ + *[Symbol.iterator]() { + // let node: WunderbaumNode | null = this; + const cl = this.children; + if (cl) { + for (let i = 0, l = cl.length; i < l; i++) { + const n = cl[i]; + yield n; + if (n.children) { + yield* n; + } + } + // Slower: + // for (let node of this.children) { + // yield node; + // yield* node : 0; + // } + } + } + // /** Return an option value. */ + // protected _getOpt( + // name: string, + // nodeObject: any = null, + // treeOptions: any = null, + // defaultValue: any = null + // ): any { + // return evalOption( + // name, + // this, + // nodeObject || this, + // treeOptions || this.tree.options, + // defaultValue + // ); + // } + /** Call event handler if defined in tree.options. + * Example: + * ```js + * node._callEvent("edit.beforeEdit", {foo: 42}) + * ``` + */ + _callEvent(type, extra) { + return this.tree._callEvent(type, extend({ + node: this, + typeInfo: this.type ? this.tree.types[this.type] : {}, + }, extra)); + } + /** + * Append (or insert) a list of child nodes. + * + * Tip: pass `{ before: 0 }` to prepend new nodes as first children. + * + * @returns first child added + */ + addChildren(nodeData, options) { + const tree = this.tree; + let { before = null, applyMinExpanLevel = true, _level } = options !== null && options !== void 0 ? options : {}; + // let { before, loadLazy=true, _level } = options ?? {}; + // const isTopCall = _level == null; + _level !== null && _level !== void 0 ? _level : (_level = this.getLevel()); + const nodeList = []; + try { + tree.enableUpdate(false); + if (isPlainObject(nodeData)) { + nodeData = [nodeData]; + } + const forceExpand = applyMinExpanLevel && _level < tree.options.minExpandLevel; + for (const child of nodeData) { + const subChildren = child.children; + delete child.children; + const n = new WunderbaumNode(tree, this, child); + if (forceExpand && !n.isUnloaded()) { + n.expanded = true; + } + nodeList.push(n); + if (subChildren) { + n.addChildren(subChildren, { _level: _level + 1 }); + } + } + if (!this.children) { + this.children = nodeList; + } + else if (before == null || this.children.length === 0) { + this.children = this.children.concat(nodeList); + } + else { + // Returns null if before is not a direct child: + before = this.findDirectChild(before); + const pos = this.children.indexOf(before); + assert(pos >= 0, `options.before must be a direct child of ${this}`); + // insert nodeList after children[pos] + this.children.splice(pos, 0, ...nodeList); + } + // this.triggerModifyChild("add", nodeList.length === 1 ? nodeList[0] : null); + tree.update(ChangeType.structure); + } + finally { + // if (tree.options.selectMode === "hier") { + // if (this.parent && this.parent.children) { + // this.fixSelection3FromEndNodes(); + // } else { + // // may happen when loading __root__; + // } + // } + tree.enableUpdate(true); + } + // if(isTopCall && loadLazy){ + // this.logWarn("addChildren(): loadLazy is not yet implemented.") + // } + return nodeList[0]; + } + /** + * Append or prepend a node, or append a child node. + * + * This a convenience function that calls addChildren() + * + * @param nodeData node definition + * @param [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child') + * @returns new node + */ + addNode(nodeData, mode = "appendChild") { + if (mode === "over") { + mode = "appendChild"; // compatible with drop region + } + switch (mode) { + case "after": + return this.parent.addChildren(nodeData, { + before: this.getNextSibling(), + }); + case "before": + return this.parent.addChildren(nodeData, { before: this }); + case "prependChild": + // Insert before the first child if any + // let insertBefore = this.children ? this.children[0] : undefined; + return this.addChildren(nodeData, { before: 0 }); + case "appendChild": + return this.addChildren(nodeData); + } + assert(false, `Invalid mode: ${mode}`); + return undefined; + } + /** + * Apply a modification (or navigation) operation. + * + * @see {@link Wunderbaum.applyCommand} + */ + applyCommand(cmd, options) { + return this.tree.applyCommand(cmd, this, options); + } + /** + * Collapse all expanded sibling nodes if any. + * (Automatically called when `autoCollapse` is true.) + */ + collapseSiblings(options) { + for (const node of this.parent.children) { + if (node !== this && node.expanded) { + node.setExpanded(false, options); + } + } + } + /** + * Add/remove one or more classes to `
`. + * + * This also maintains `node.classes`, so the class will survive a re-render. + * + * @param className one or more class names. Multiple classes can be passed + * as space-separated string, array of strings, or set of strings. + */ + setClass(className, flag = true) { + const cnSet = toSet(className); + if (flag) { + if (this.classes === null) { + this.classes = new Set(); + } + cnSet.forEach((cn) => { + var _a; + this.classes.add(cn); + (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.classList.toggle(cn, flag); + }); + } + else { + if (this.classes === null) { + return; + } + cnSet.forEach((cn) => { + var _a; + this.classes.delete(cn); + (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.classList.toggle(cn, flag); + }); + if (this.classes.size === 0) { + this.classes = null; + } + } + } + /** Start editing this node's title. */ + startEditTitle() { + this.tree._callMethod("edit.startEditTitle", this); + } + /** Call `setExpanded()` on all descendant nodes. */ + async expandAll(flag = true, options) { + const tree = this.tree; + const minExpandLevel = this.tree.options.minExpandLevel; + const { depth = 99, loadLazy, force, keepActiveNodeVisible = true, } = options !== null && options !== void 0 ? options : {}; + const expandOpts = { + scrollIntoView: false, + force: force, + loadLazy: loadLazy, + }; + // this.logInfo(`expandAll(${flag})`); + // Expand all direct children in parallel: + async function _iter(n, level) { + var _a; + // n.logInfo(` _iter(${level})`); + if (level === 0) { + return; + } + // if (!flag && minExpandLevel && !force && n.getLevel() <= minExpandLevel) { + // return; // Do not collapse until minExpandLevel + // } + const level_1 = level == null ? null : level - 1; + const promises = []; + (_a = n.children) === null || _a === void 0 ? void 0 : _a.forEach((cn) => { + if (flag) { + if (!cn.expanded && (cn.children || (loadLazy && cn.lazy))) { + // Node is collapsed and may be expanded (i.e. has children or is lazy) + // Expanding may be async, so we store the promise. + // Also the recursion is delayed until expansion finished. + const p = cn.setExpanded(true, expandOpts); + promises.push(p); + p.then(async () => { + await _iter(cn, level_1); + }); + } + else { + // We don't expand the node, but still visit descendants. + // There we may find lazy nodes, so we + promises.push(_iter(cn, level_1)); + } + } + else { + // Collapsing is always synchronous, so no promises required + if (!minExpandLevel || force || cn.getLevel() > minExpandLevel) { + // Do not collapse until minExpandLevel + cn.setExpanded(false, expandOpts); + } + _iter(cn, level_1); // recursion, even if cn was already collapsed + } + }); + return new Promise((resolve) => { + Promise.all(promises).then(() => { + resolve(true); + }); + }); + } + const tag = tree.logTime(`${this}.expandAll(${flag})`); + try { + tree.enableUpdate(false); + await _iter(this, depth); + } + finally { + tree.enableUpdate(true); + tree.logTimeEnd(tag); + } + if (tree.activeNode && keepActiveNodeVisible) { + tree.activeNode.scrollIntoView(); + } + } + /** + * Find all descendant nodes that match condition (excluding self). + * + * If `match` is a string, search for exact node title. + * If `match` is a RegExp expression, apply it to node.title, using + * [RegExp.test()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test). + * If `match` is a callback, match all nodes for that the callback(node) returns true. + * + * Returns an empty array if no nodes were found. + * + * Examples: + * ```js + * // Match all node titles that match exactly 'Joe': + * nodeList = node.findAll("Joe") + * // Match all node titles that start with 'Joe' case sensitive: + * nodeList = node.findAll(/^Joe/) + * // Match all node titles that contain 'oe', case insensitive: + * nodeList = node.findAll(/oe/i) + * // Match all nodes with `data.price` >= 99: + * nodeList = node.findAll((n) => { + * return n.data.price >= 99; + * }) + * ``` + */ + findAll(match) { + const matcher = typeof match === "function" ? match : makeNodeTitleMatcher(match); + const res = []; + this.visit((n) => { + if (matcher(n)) { + res.push(n); + } + }); + return res; + } + /** Return the direct child with a given key, index or null. */ + findDirectChild(ptr) { + const cl = this.children; + if (!cl) { + return null; + } + if (typeof ptr === "string") { + for (let i = 0, l = cl.length; i < l; i++) { + if (cl[i].key === ptr) { + return cl[i]; + } + } + } + else if (typeof ptr === "number") { + return cl[ptr]; + } + else if (ptr.parent === this) { + // Return null if `ptr` is not a direct child + return ptr; + } + return null; + } + /** + * Find first descendant node that matches condition (excluding self) or null. + * + * @see {@link WunderbaumNode.findAll} for examples. + */ + findFirst(match) { + const matcher = typeof match === "function" ? match : makeNodeTitleMatcher(match); + let res = null; + this.visit((n) => { + if (matcher(n)) { + res = n; + return false; + } + }); + return res; + } + /** Find a node relative to self. + * + * @see {@link Wunderbaum.findRelatedNode|tree.findRelatedNode()} + */ + findRelatedNode(where, includeHidden = false) { + return this.tree.findRelatedNode(this, where, includeHidden); + } + /** + * Iterator version of {@link WunderbaumNode.format}. + */ + *format_iter(name_cb, connectors) { + connectors !== null && connectors !== void 0 ? connectors : (connectors = [" ", " | ", " ╰─ ", " ├─ "]); + name_cb !== null && name_cb !== void 0 ? name_cb : (name_cb = (node) => "" + node); + function _is_last(node) { + const ca = node.parent.children; + return node === ca[ca.length - 1]; + } + const _format_line = (node) => { + // https://www.measurethat.net/Benchmarks/Show/12196/0/arr-unshift-vs-push-reverse-small-array + const parts = [name_cb(node)]; + parts.unshift(connectors[_is_last(node) ? 2 : 3]); + let p = node.parent; + while (p && p !== this) { + // `this` is the top node + parts.unshift(connectors[_is_last(p) ? 0 : 1]); + p = p.parent; + } + return parts.join(""); + }; + yield name_cb(this); + for (const node of this) { + yield _format_line(node); + } + } + /** + * Return a multiline string representation of a node/subnode hierarchy. + * Mostly useful for debugging. + * + * Example: + * ```js + * console.info(tree.getActiveNode().format((n)=>n.title)); + * ``` + * logs + * ``` + * Books + * ├─ Art of War + * ╰─ Don Quixote + * ``` + * @see {@link WunderbaumNode.format_iter} + */ + format(name_cb, connectors) { + const a = []; + for (const line of this.format_iter(name_cb, connectors)) { + a.push(line); + } + return a.join("\n"); + } + /** Return the `` element with a given index or id. + * @returns {WunderbaumNode | null} + */ + getColElem(colIdx) { + var _a; + if (typeof colIdx === "string") { + colIdx = this.tree.columns.findIndex((value) => value.id === colIdx); + } + const colElems = (_a = this._rowElem) === null || _a === void 0 ? void 0 : _a.querySelectorAll("span.wb-col"); + return colElems ? colElems[colIdx] : null; + } + /** + * Return all nodes with the same refKey. + * + * @param includeSelf Include this node itself. + * @see {@link Wunderbaum.findByRefKey} + */ + getCloneList(includeSelf = false) { + if (!this.refKey) { + return []; + } + const clones = this.tree.findByRefKey(this.refKey); + if (includeSelf) { + return clones; + } + return [...clones].filter((n) => n !== this); + } + /** Return the first child node or null. + * @returns {WunderbaumNode | null} + */ + getFirstChild() { + return this.children ? this.children[0] : null; + } + /** Return the last child node or null. + * @returns {WunderbaumNode | null} + */ + getLastChild() { + return this.children ? this.children[this.children.length - 1] : null; + } + /** Return node depth (starting with 1 for top level nodes). */ + getLevel() { + let i = 0, p = this.parent; + while (p) { + i++; + p = p.parent; + } + return i; + } + /** Return the successive node (under the same parent) or null. */ + getNextSibling() { + const ac = this.parent.children; + const idx = ac.indexOf(this); + return ac[idx + 1] || null; + } + /** Return the parent node (null for the system root node). */ + getParent() { + // TODO: return null for top-level nodes? + return this.parent; + } + /** Return an array of all parent nodes (top-down). + * @param includeRoot Include the invisible system root node. + * @param includeSelf Include the node itself. + */ + getParentList(includeRoot = false, includeSelf = false) { + const l = []; + let dtn = includeSelf ? this : this.parent; + while (dtn) { + if (includeRoot || dtn.parent) { + l.unshift(dtn); + } + dtn = dtn.parent; + } + return l; + } + /** Return a string representing the hierachical node path, e.g. "a/b/c". + * @param includeSelf + * @param node property name or callback + * @param separator + */ + getPath(includeSelf = true, part = "title", separator = "/") { + // includeSelf = includeSelf !== false; + // part = part || "title"; + // separator = separator || "/"; + let val; + const path = []; + const isFunc = typeof part === "function"; + this.visitParents((n) => { + if (n.parent) { + val = isFunc + ? part(n) + : n[part]; + path.unshift(val); + } + return undefined; // TODO remove this line + }, includeSelf); + return path.join(separator); + } + /** Return the preceeding node (under the same parent) or null. */ + getPrevSibling() { + const ac = this.parent.children; + const idx = ac.indexOf(this); + return ac[idx - 1] || null; + } + /** Return true if node has children. + * Return undefined if not sure, i.e. the node is lazy and not yet loaded. + */ + hasChildren() { + if (this.lazy) { + if (this.children == null) { + return undefined; // null or undefined: Not yet loaded + } + else if (this.children.length === 0) { + return false; // Loaded, but response was empty + } + else if (this.children.length === 1 && + this.children[0].isStatusNode()) { + return undefined; // Currently loading or load error + } + return true; // One or more child nodes + } + return !!(this.children && this.children.length); + } + /** Return true if node has className set. */ + hasClass(className) { + return this.classes ? this.classes.has(className) : false; + } + /** Return true if this node is the currently active tree node. */ + isActive() { + return this.tree.activeNode === this; + } + /** Return true if this node is a direct or indirect parent of `other`. + * @see {@link WunderbaumNode.isParentOf} + */ + isAncestorOf(other) { + return other && other.isDescendantOf(this); + } + /** Return true if this node is a **direct** subnode of `other`. + * @see {@link WunderbaumNode.isDescendantOf} + */ + isChildOf(other) { + return other && this.parent === other; + } + /** Return true if this node's refKey is used by at least one other node. + */ + isClone() { + return !!this.refKey && this.tree.findByRefKey(this.refKey).length > 1; + } + /** Return true if this node's title spans all columns, i.e. the node has no + * grid cells. + */ + isColspan() { + return !!this.getOption("colspan"); + } + /** Return true if this node is a direct or indirect subnode of `other`. + * @see {@link WunderbaumNode.isChildOf} + */ + isDescendantOf(other) { + if (!other || other.tree !== this.tree) { + return false; + } + let p = this.parent; + while (p) { + if (p === other) { + return true; + } + if (p === p.parent) { + error(`Recursive parent link: ${p}`); + } + p = p.parent; + } + return false; + } + /** Return true if this node has children, i.e. the node is generally expandable. + * If `andCollapsed` is set, we also check if this node is collapsed, i.e. + * an expand operation is currently possible. + */ + isExpandable(andCollapsed = false) { + // `false` is never expandable (unoffical) + if ((andCollapsed && this.expanded) || this.children === false) { + return false; + } + if (this.children == null) { + return !!this.lazy; // null or undefined can trigger lazy load + } + if (this.children.length === 0) { + return !!this.tree.options.emptyChildListExpandable; + } + return true; + } + /** Return true if _this_ node is currently in edit-title mode. + * + * See {@link Wunderbaum.startEditTitle} to check if any node is currently edited. + */ + isEditingTitle() { + return this.tree._callMethod("edit.isEditingTitle", this); + } + /** Return true if this node is currently expanded. */ + isExpanded() { + return !!this.expanded; + } + /** Return true if this node is the first node of its parent's children. */ + isFirstSibling() { + const p = this.parent; + return !p || p.children[0] === this; + } + /** Return true if this node is the last node of its parent's children. */ + isLastSibling() { + const p = this.parent; + return !p || p.children[p.children.length - 1] === this; + } + /** Return true if this node is lazy (even if data was already loaded) */ + isLazy() { + return !!this.lazy; + } + /** Return true if node is lazy and loaded. For non-lazy nodes always return true. */ + isLoaded() { + return !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node + } + /** Return true if node is currently loading, i.e. a GET request is pending. */ + isLoading() { + return this._isLoading; + } + /** Return true if this node is a temporarily generated status node of type 'paging'. */ + isPagingNode() { + return this.statusNodeType === "paging"; + } + /** Return true if this node is a **direct** parent of `other`. + * @see {@link WunderbaumNode.isAncestorOf} + */ + isParentOf(other) { + return other && other.parent === this; + } + /** (experimental) Return true if this node is partially loaded. */ + isPartload() { + return !!this._partload; + } + /** Return true if this node is partially selected (tri-state). */ + isPartsel() { + return !this.selected && !!this._partsel; + } + /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */ + isRadio() { + return !!this.parent.radiogroup || this.getOption("checkbox") === "radio"; + } + /** Return true if this node has DOM representaion, i.e. is displayed in the viewport. */ + isRendered() { + return !!this._rowElem; + } + /** Return true if this node is the (invisible) system root node. + * @see {@link WunderbaumNode.isTopLevel} + */ + isRootNode() { + return this.tree.root === this; + } + /** Return true if this node is selected, i.e. the checkbox is set. + * `undefined` if partly selected (tri-state), false otherwise. + */ + isSelected() { + return this.selected ? true : this._partsel ? undefined : false; + } + /** Return true if this node is a temporarily generated system node like + * 'loading', 'paging', or 'error' (node.statusNodeType contains the type). + */ + isStatusNode() { + return !!this.statusNodeType; + } + /** Return true if this a top level node, i.e. a direct child of the (invisible) system root node. */ + isTopLevel() { + return this.tree.root === this.parent; + } + /** Return true if node is marked lazy but not yet loaded. + * For non-lazy nodes always return false. + */ + isUnloaded() { + // Also checks if the only child is a status node: + return this.hasChildren() === undefined; + } + /** Return true if all parent nodes are expanded. Note: this does not check + * whether the node is scrolled into the visible part of the screen or viewport. + */ + isVisible() { + const hasFilter = this.tree.filterMode === "hide"; + const parents = this.getParentList(false, false); + // TODO: check $(n.span).is(":visible") + // i.e. return false for nodes (but not parents) that are hidden + // by a filter + if (hasFilter && !this.match && !this.subMatchCount) { + // this.debug( "isVisible: HIDDEN (" + hasFilter + ", " + this.match + ", " + this.match + ")" ); + return false; + } + for (let i = 0, l = parents.length; i < l; i++) { + const n = parents[i]; + if (!n.expanded) { + // this.debug("isVisible: HIDDEN (parent collapsed)"); + return false; + } + // if (hasFilter && !n.match && !n.subMatchCount) { + // this.debug("isVisible: HIDDEN (" + hasFilter + ", " + this.match + ", " + this.match + ")"); + // return false; + // } + } + // this.debug("isVisible: VISIBLE"); + return true; + } + _loadSourceObject(source, level) { + var _a; + const tree = this.tree; + level !== null && level !== void 0 ? level : (level = this.getLevel()); + // Let caller modify the parsed JSON response: + const res = this._callEvent("receive", { response: source }); + if (res != null) { + source = res; + } + if (isArray(source)) { + source = { children: source }; + } + assert(isPlainObject(source), `Expected an array or plain object: ${source}`); + const format = (_a = source.format) !== null && _a !== void 0 ? _a : "nested"; + assert(format === "nested" || format === "flat", `Expected source.format = 'nested' or 'flat': ${format}`); + // Pre-rocess for 'nested' or 'flat' format + decompressSourceData(source); + assert(source.children, "If `source` is an object, it must have a `children` property"); + if (source.types) { + tree.logInfo("Redefine types", source.columns); + tree.setTypes(source.types, false); + delete source.types; + } + if (source.columns) { + tree.logInfo("Redefine columns", source.columns); + tree.columns = source.columns; + delete source.columns; + tree.update(ChangeType.colStructure); + } + this.addChildren(source.children); + // Add extra data to `tree.data` + for (const [key, value] of Object.entries(source)) { + if (!RESERVED_TREE_SOURCE_KEYS.has(key)) { + tree.data[key] = value; + // tree.logDebug(`Add source.${key} to tree.data.${key}`); + } + } + if (tree.options.selectMode === "hier") { + this.fixSelection3FromEndNodes(); + } + this._callEvent("load"); + } + async _fetchWithOptions(source) { + var _a, _b; + // Either a URL string or an object with a `.url` property. + let url, params, body, options, rest; + let fetchOpts = {}; + if (typeof source === "string") { + // source is a plain URL string: assume GET request + url = source; + fetchOpts.method = "GET"; + } + else if (isPlainObject(source)) { + // source is a plain object with `.url` property. + ({ url, params, body, options, ...rest } = source); + assert(!rest || Object.keys(rest).length === 0, `Unexpected source properties: ${Object.keys(rest)}. Use 'options' instead.`); + assert(typeof url === "string", `expected source.url as string`); + if (isPlainObject(options)) { + fetchOpts = options; + } + if (isPlainObject(body)) { + // we also accept 'body' as object... + assert(!fetchOpts.body, "options.body should be passed as source.body"); + fetchOpts.body = JSON.stringify(fetchOpts.body); + (_a = fetchOpts.method) !== null && _a !== void 0 ? _a : (fetchOpts.method = "POST"); // set default + } + if (isPlainObject(params)) { + url += "?" + new URLSearchParams(params); + (_b = fetchOpts.method) !== null && _b !== void 0 ? _b : (fetchOpts.method = "GET"); // set default + } + } + else { + url = ""; // keep linter happy + error(`Unsupported source format: ${source}`); + } + this.setStatus(NodeStatusType.loading); + const response = await fetch(url, fetchOpts); + if (!response.ok) { + error(`GET ${url} returned ${response.status}, ${response}`); + } + return await response.json(); + } + /** Download data from the cloud, then call `.update()`. */ + async load(source) { + const tree = this.tree; + const requestId = Date.now(); + const prevParent = this.parent; + const start = Date.now(); + let elap = 0, elapLoad = 0, elapProcess = 0; + // Check for overlapping requests + if (this._requestId) { + this.logWarn(`Recursive load request #${requestId} while #${this._requestId} is pending.`); + // node.debug("Send load request #" + requestId); + } + this._requestId = requestId; + // const timerLabel = tree.logTime(this + ".load()"); + try { + const url = typeof source === "string" ? source : source.url; + if (!url) { + // An array or a plain object (that does NOT contain a `.url` property) + // will be treated as native Wunderbaum data + if (typeof source.then === "function") { + const msg = tree.logTime(`Resolve thenable ${source}`); + source = await Promise.resolve(source); + tree.logTimeEnd(msg); + } + this._loadSourceObject(source); + elapProcess = Date.now() - start; + } + else { + // Either a URL string or an object with a `.url` property. + const data = await this._fetchWithOptions(source); + elapLoad = Date.now() - start; + if (this._requestId && this._requestId > requestId) { + this.logWarn(`Ignored load response #${requestId} because #${this._requestId} is pending.`); + return; + } + else { + this.logDebug(`Received response for load request #${requestId}`); + } + if (this.parent === null && prevParent !== null) { + this.logWarn("Lazy parent node was removed while loading: discarding response."); + return; + } + this.setStatus(NodeStatusType.ok); + // if (data.columns) { + // tree.logInfo("Re-define columns", data.columns); + // util.assert(!this.parent); + // tree.columns = data.columns; + // delete data.columns; + // tree.updateColumns({ calculateCols: false }); + // } + const startProcess = Date.now(); + this._loadSourceObject(data); + elapProcess = Date.now() - startProcess; + } + } + catch (error) { + this.logError("Error during load()", source, error); + this._callEvent("error", { error: error }); + this.setStatus(NodeStatusType.error, { message: "" + error }); + throw error; + } + finally { + this._requestId = 0; + elap = Date.now() - start; + if (tree.options.debugLevel >= 3) { + tree.logInfo(`Load source took ${elap / 1000} seconds ` + + `(transfer: ${elapLoad / 1000}s, ` + + `processing: ${elapProcess / 1000}s)`); + } + } + } + /**Load content of a lazy node. */ + async loadLazy(forceReload = false) { + const wasExpanded = this.expanded; + assert(this.lazy, "load() requires a lazy node"); + // _assert( forceReload || this.isUndefined(), "Pass forceReload=true to re-load a lazy node" ); + if (!forceReload && !this.isUnloaded()) { + return; + } + if (this.isLoaded()) { + this.resetLazy(); // Also collapses if currently expanded + } + // `lazyLoad` may be long-running, so mark node as loading now. `this.load()` + // will reset the status later. + this.setStatus(NodeStatusType.loading); + try { + const source = await this._callEvent("lazyLoad"); + if (source === false) { + this.setStatus(NodeStatusType.ok); + return; + } + assert(isArray(source) || (source && source.url), "The lazyLoad event must return a node list, `{url: ...}`, or false."); + await this.load(source); + this.setStatus(NodeStatusType.ok); + if (wasExpanded) { + this.expanded = true; + this.tree.update(ChangeType.structure); + } + else { + this.update(); // Fix expander icon to 'loaded' + } + } + catch (e) { + this.logError("Error during loadLazy()", e); + this._callEvent("error", { error: e }); + this.setStatus(NodeStatusType.error, { message: "" + e }); + } + return; + } + /** Alias for `logDebug` */ + log(...args) { + this.logDebug(...args); + } + /* Log to console if opts.debugLevel >= 4 */ + logDebug(...args) { + if (this.tree.options.debugLevel >= 4) { + console.log(this.toString(), ...args); // eslint-disable-line no-console + } + } + /* Log error to console. */ + logError(...args) { + if (this.tree.options.debugLevel >= 1) { + console.error(this.toString(), ...args); // eslint-disable-line no-console + } + } + /* Log to console if opts.debugLevel >= 3 */ + logInfo(...args) { + if (this.tree.options.debugLevel >= 3) { + console.info(this.toString(), ...args); // eslint-disable-line no-console + } + } + /* Log warning to console if opts.debugLevel >= 2 */ + logWarn(...args) { + if (this.tree.options.debugLevel >= 2) { + console.warn(this.toString(), ...args); // eslint-disable-line no-console + } + } + /** Expand all parents and optionally scroll into visible area as neccessary. + * Promise is resolved, when lazy loading and animations are done. + * @param {object} [options] passed to `setExpanded()`. + * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true} + */ + async makeVisible(options) { + let i; + const dfd = new Deferred(); + const deferreds = []; + const parents = this.getParentList(false, false); + const len = parents.length; + const noAnimation = getOption(options, "noAnimation", false); + const scroll = getOption(options, "scrollIntoView", true); + // Expand bottom-up, so only the top node is animated + for (i = len - 1; i >= 0; i--) { + // self.debug("pushexpand" + parents[i]); + const seOpts = { noAnimation: noAnimation }; + deferreds.push(parents[i].setExpanded(true, seOpts)); + } + Promise.all(deferreds).then(() => { + // All expands have finished + // self.debug("expand DONE", scroll); + // Note: this.tree may be none when switching demo trees + if (scroll && this.tree) { + // Make sure markup and _rowIdx is updated before we do the scroll calculations + this.tree.updatePendingModifications(); + this.scrollIntoView().then(() => { + // self.debug("scroll DONE"); + dfd.resolve(); + }); + } + else { + dfd.resolve(); + } + }); + return dfd.promise(); + } + /** Move this node to targetNode. */ + moveTo(targetNode, mode = "appendChild", map) { + if (mode === "over") { + mode = "appendChild"; // compatible with drop region + } + if (mode === "prependChild") { + if (targetNode.children && targetNode.children.length) { + mode = "before"; + targetNode = targetNode.children[0]; + } + else { + mode = "appendChild"; + } + } + let pos; + const tree = this.tree; + const prevParent = this.parent; + const targetParent = mode === "appendChild" ? targetNode : targetNode.parent; + if (this === targetNode) { + return; + } + else if (!this.parent) { + error("Cannot move system root"); + } + else if (targetParent.isDescendantOf(this)) { + error("Cannot move a node to its own descendant"); + } + if (targetParent !== prevParent) { + prevParent.triggerModifyChild("remove", this); + } + // Unlink this node from current parent + if (this.parent.children.length === 1) { + if (this.parent === targetParent) { + return; // #258 + } + this.parent.children = this.parent.lazy ? [] : null; + this.parent.expanded = false; + } + else { + pos = this.parent.children.indexOf(this); + assert(pos >= 0, "invalid source parent"); + this.parent.children.splice(pos, 1); + } + // Insert this node to target parent's child list + this.parent = targetParent; + if (targetParent.hasChildren()) { + switch (mode) { + case "appendChild": + // Append to existing target children + targetParent.children.push(this); + break; + case "before": + // Insert this node before target node + pos = targetParent.children.indexOf(targetNode); + assert(pos >= 0, "invalid target parent"); + targetParent.children.splice(pos, 0, this); + break; + case "after": + // Insert this node after target node + pos = targetParent.children.indexOf(targetNode); + assert(pos >= 0, "invalid target parent"); + targetParent.children.splice(pos + 1, 0, this); + break; + default: + error(`Invalid mode '${mode}'.`); + } + } + else { + targetParent.children = [this]; + } + // Let caller modify the nodes + if (map) { + targetNode.visit(map, true); + } + if (targetParent === prevParent) { + targetParent.triggerModifyChild("move", this); + } + else { + // prevParent.triggerModifyChild("remove", this); + targetParent.triggerModifyChild("add", this); + } + // Handle cross-tree moves + if (tree !== targetNode.tree) { + // Fix node.tree for all source nodes + // util.assert(false, "Cross-tree move is not yet implemented."); + this.logWarn("Cross-tree moveTo is experimental!"); + this.visit((n) => { + // TODO: fix selection state and activation, ... + n.tree = targetNode.tree; + }, true); + } + // Make sure we update async, because discarding the markup would prevent + // DragAndDrop to generate a dragend event on the source node + setTimeout(() => { + // Even indentation may have changed: + tree.update(ChangeType.any); + }, 0); + // TODO: fix selection state + // TODO: fix active state + } + /** Set focus relative to this node and optionally activate. + * + * 'left' collapses the node if it is expanded, or move to the parent + * otherwise. + * 'right' expands the node if it is collapsed, or move to the first + * child otherwise. + * + * @param where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'. + * (Alternatively the `event.key` that would normally trigger this move, + * e.g. `ArrowLeft` = 'left'. + * @param options + */ + async navigate(where, options) { + // Allow to pass 'ArrowLeft' instead of 'left' + where = KEY_TO_ACTION_DICT[where] || where; + // Otherwise activate or focus the related node + const node = this.findRelatedNode(where); + if (!node) { + this.logWarn(`Could not find related node '${where}'.`); + return Promise.resolve(this); + } + // setFocus/setActive will scroll later (if autoScroll is specified) + try { + node.makeVisible({ scrollIntoView: false }); + } + catch (e) { + // ignore + } + node.setFocus(); + if ((options === null || options === void 0 ? void 0 : options.activate) === false) { + return Promise.resolve(this); + } + return node.setActive(true, { event: options === null || options === void 0 ? void 0 : options.event }); + } + /** Delete this node and all descendants. */ + remove() { + const tree = this.tree; + const pos = this.parent.children.indexOf(this); + this.triggerModify("remove"); + this.parent.children.splice(pos, 1); + this.visit((n) => { + n.removeMarkup(); + tree._unregisterNode(n); + }, true); + tree.update(ChangeType.structure); + } + /** Remove all descendants of this node. */ + removeChildren() { + const tree = this.tree; + if (!this.children) { + return; + } + if (tree.activeNode && tree.activeNode.isDescendantOf(this)) { + tree.activeNode.setActive(false); // TODO: don't fire events + } + if (tree.focusNode && tree.focusNode.isDescendantOf(this)) { + tree.focusNode = null; + } + // TODO: persist must take care to clear select and expand cookies + // Unlink children to support GC + // TODO: also delete this.children (not possible using visit()) + this.triggerModifyChild("remove", null); + this.visit((n) => { + tree._unregisterNode(n); + }); + if (this.lazy) { + // 'undefined' would be interpreted as 'not yet loaded' for lazy nodes + this.children = []; + } + else { + this.children = null; + } + // util.assert(this.parent); // don't call this for root node + if (!this.isRootNode()) { + this.expanded = false; + } + this.tree.update(ChangeType.structure); + } + /** Remove all HTML markup from the DOM. */ + removeMarkup() { + if (this._rowElem) { + delete this._rowElem._wb_node; + this._rowElem.remove(); + this._rowElem = undefined; + } + } + _getRenderInfo() { + const allColInfosById = {}; + const renderColInfosById = {}; + const isColspan = this.isColspan(); + const colElems = this._rowElem + ? (this._rowElem.querySelectorAll("span.wb-col")) + : null; + let idx = 0; + for (const col of this.tree.columns) { + allColInfosById[col.id] = { + id: col.id, + idx: idx, + elem: colElems ? colElems[idx] : null, + info: col, + }; + // renderColInfosById only contains columns that need rendering: + if (!isColspan && col.id !== "*") { + renderColInfosById[col.id] = allColInfosById[col.id]; + } + idx++; + } + return { + allColInfosById: allColInfosById, + renderColInfosById: renderColInfosById, + }; + } + _createIcon(iconMap, parentElem, replaceChild, showLoading) { + let iconSpan; + let icon = this.getOption("icon"); + if (this._errorInfo) { + icon = iconMap.error; + } + else if (this._isLoading && showLoading) { + // Status nodes, or nodes without expander (< minExpandLevel) should + // display the 'loading' status with the i.wb-icon span + icon = iconMap.loading; + } + if (icon === false) { + return null; // explicitly disabled: don't try default icons + } + if (typeof icon === "string") ; + else if (this.statusNodeType) { + icon = iconMap[this.statusNodeType]; + } + else if (this.expanded) { + icon = iconMap.folderOpen; + } + else if (this.children) { + icon = iconMap.folder; + } + else if (this.lazy) { + icon = iconMap.folderLazy; + } + else { + icon = iconMap.doc; + } + // this.log("_createIcon: " + icon); + if (!icon) { + iconSpan = document.createElement("i"); + iconSpan.className = "wb-icon"; + } + else if (icon.indexOf("<") >= 0) { + // HTML + iconSpan = elemFromHtml(icon); + } + else if (TEST_IMG.test(icon)) { + // Image URL + iconSpan = elemFromHtml(``); + } + else { + // Class name + iconSpan = document.createElement("i"); + iconSpan.className = "wb-icon " + icon; + } + if (replaceChild) { + parentElem.replaceChild(iconSpan, replaceChild); + } + else { + parentElem.appendChild(iconSpan); + } + // Event handler `tree.iconBadge` can return a badge text or HTMLSpanElement + const cbRes = this._callEvent("iconBadge", { iconSpan: iconSpan }); + let badge = null; + if (cbRes != null && cbRes !== false) { + let classes = ""; + let tooltip = ""; + if (isPlainObject(cbRes)) { + badge = "" + cbRes.badge; + classes = cbRes.badgeClass ? " " + cbRes.badgeClass : ""; + tooltip = cbRes.badgeTooltip ? ` title="${cbRes.badgeTooltip}"` : ""; + } + else if (typeof cbRes === "number") { + badge = "" + cbRes; + } + else { + badge = cbRes; // string or HTMLSpanElement + } + if (typeof badge === "string") { + badge = elemFromHtml(`${escapeHtml(badge)}`); + } + if (badge) { + iconSpan.append(badge); + } + } + // this.log("_createIcon: ", iconSpan); + return iconSpan; + } + /** + * Create a whole new `
` element. + * @see {@link WunderbaumNode._render} + */ + _render_markup(opts) { + const tree = this.tree; + const treeOptions = tree.options; + const checkbox = this.getOption("checkbox"); + const columns = tree.columns; + const level = this.getLevel(); + const activeColIdx = tree.isRowNav() ? null : tree.activeColIdx; + let elem; + let rowDiv = this._rowElem; + let checkboxSpan = null; + let expanderSpan = null; + const isNew = !rowDiv; + assert(isNew, "Expected unrendered node"); + assert(!isNew || (opts && opts.after), "opts.after expected, unless updating"); + assert(!this.isRootNode(), "Root node not allowed"); + rowDiv = document.createElement("div"); + rowDiv.classList.add("wb-row"); + rowDiv.style.top = this._rowIdx * ROW_HEIGHT + "px"; + this._rowElem = rowDiv; + // Attach a node reference to the DOM Element: + rowDiv._wb_node = this; + const nodeElem = document.createElement("span"); + nodeElem.classList.add("wb-node", "wb-col"); + rowDiv.appendChild(nodeElem); + let ofsTitlePx = 0; + if (checkbox) { + checkboxSpan = document.createElement("i"); + checkboxSpan.classList.add("wb-checkbox"); + if (checkbox === "radio" || this.parent.radiogroup) { + checkboxSpan.classList.add("wb-radio"); + } + nodeElem.appendChild(checkboxSpan); + ofsTitlePx += ICON_WIDTH; + } + for (let i = level - 1; i > 0; i--) { + elem = document.createElement("i"); + elem.classList.add("wb-indent"); + nodeElem.appendChild(elem); + ofsTitlePx += ICON_WIDTH; + } + if (!treeOptions.minExpandLevel || level > treeOptions.minExpandLevel) { + expanderSpan = document.createElement("i"); + expanderSpan.classList.add("wb-expander"); + nodeElem.appendChild(expanderSpan); + ofsTitlePx += ICON_WIDTH; + } + // Render the icon (show a 'loading' icon if we do not have an expander that + // we would prefer). + const iconSpan = this._createIcon(tree.iconMap, nodeElem, null, !expanderSpan); + if (iconSpan) { + ofsTitlePx += ICON_WIDTH; + } + const titleSpan = document.createElement("span"); + titleSpan.classList.add("wb-title"); + nodeElem.appendChild(titleSpan); + // this._callEvent("enhanceTitle", { titleSpan: titleSpan }); + // Store the width of leading icons with the node, so we can calculate + // the width of the embedded title span later + nodeElem._ofsTitlePx = ofsTitlePx; + // Support HTML5 drag-n-drop + if (tree.options.dnd.dragStart) { + nodeElem.draggable = true; + } + // Render columns + const isColspan = this.isColspan(); + if (!isColspan && columns.length > 1) { + let colIdx = 0; + for (const col of columns) { + colIdx++; + let colElem; + if (col.id === "*") { + colElem = nodeElem; + } + else { + colElem = document.createElement("span"); + colElem.classList.add("wb-col"); + rowDiv.appendChild(colElem); + } + if (colIdx === activeColIdx) { + colElem.classList.add("wb-active"); + } + // Add classes from `columns` definition to `` cells + col.classes ? colElem.classList.add(...col.classes.split(" ")) : 0; + colElem.style.left = col._ofsPx + "px"; + colElem.style.width = col._widthPx + "px"; + if (isNew && col.html) { + if (typeof col.html === "string") { + colElem.innerHTML = col.html; + } + } + } + } + // Attach to DOM as late as possible + const after = opts ? opts.after : "last"; + switch (after) { + case "first": + tree.nodeListElement.prepend(rowDiv); + break; + case "last": + tree.nodeListElement.appendChild(rowDiv); + break; + default: + opts.after.after(rowDiv); + } + // Now go on and fill in data and update classes + opts.isNew = true; + this._render_data(opts); + } + /** + * Render `node.title`, `.icon` into an existing row. + * + * @see {@link WunderbaumNode._render} + */ + _render_data(opts) { + assert(this._rowElem, "No _rowElem"); + const tree = this.tree; + const treeOptions = tree.options; + const rowDiv = this._rowElem; + const isNew = !!opts.isNew; // Called by _render_markup()? + const preventScroll = !!opts.preventScroll; + const columns = tree.columns; + const isColspan = this.isColspan(); + // Row markup already exists + const nodeElem = rowDiv.querySelector("span.wb-node"); + const titleSpan = nodeElem.querySelector("span.wb-title"); + const scrollTop = tree.element.scrollTop; + if (this.titleWithHighlight) { + titleSpan.innerHTML = this.titleWithHighlight; + } + else { + titleSpan.textContent = this.title; // TODO: this triggers scroll events + } + // NOTE: At least on Safari, this render call triggers a scroll event + // probably when a focused input is replaced. + if (preventScroll) { + tree.element.scrollTop = scrollTop; + } + // Set the width of the title span, so overflow ellipsis work + if (!treeOptions.skeleton) { + if (isColspan) { + const vpWidth = tree.element.clientWidth; + titleSpan.style.width = + vpWidth - nodeElem._ofsTitlePx - TITLE_SPAN_PAD_Y + "px"; + } + else { + titleSpan.style.width = + columns[0]._widthPx - + nodeElem._ofsTitlePx - + TITLE_SPAN_PAD_Y + + "px"; + } + } + // Update row classes + opts.isDataChange = true; + this._render_status(opts); + // Let user modify the result + if (this.statusNodeType) { + this._callEvent("renderStatusNode", { + isNew: isNew, + nodeElem: nodeElem, + isColspan: isColspan, + }); + } + else if (this.parent) { + // Skip root node + const renderInfo = this._getRenderInfo(); + this._callEvent("render", { + isNew: isNew, + nodeElem: nodeElem, + isColspan: isColspan, + allColInfosById: renderInfo.allColInfosById, + renderColInfosById: renderInfo.renderColInfosById, + }); + } + } + /** + * Update row classes to reflect active, focuses, etc. + * @see {@link WunderbaumNode._render} + */ + _render_status(opts) { + // this.log("_render_status", opts); + const tree = this.tree; + const iconMap = tree.iconMap; + const treeOptions = tree.options; + const typeInfo = this.type ? tree.types[this.type] : null; + const rowDiv = this._rowElem; + // Row markup already exists + const nodeElem = rowDiv.querySelector("span.wb-node"); + const expanderSpan = nodeElem.querySelector("i.wb-expander"); + const checkboxSpan = nodeElem.querySelector("i.wb-checkbox"); + const rowClasses = ["wb-row"]; + this.expanded ? rowClasses.push("wb-expanded") : 0; + this.lazy ? rowClasses.push("wb-lazy") : 0; + this.selected ? rowClasses.push("wb-selected") : 0; + this._partsel ? rowClasses.push("wb-partsel") : 0; + this === tree.activeNode ? rowClasses.push("wb-active") : 0; + this === tree.focusNode ? rowClasses.push("wb-focus") : 0; + this._errorInfo ? rowClasses.push("wb-error") : 0; + this._isLoading ? rowClasses.push("wb-loading") : 0; + this.isColspan() ? rowClasses.push("wb-colspan") : 0; + this.statusNodeType + ? rowClasses.push("wb-status-" + this.statusNodeType) + : 0; + this.match ? rowClasses.push("wb-match") : 0; + this.subMatchCount ? rowClasses.push("wb-submatch") : 0; + treeOptions.skeleton ? rowClasses.push("wb-skeleton") : 0; + // Replace previous classes: + rowDiv.className = rowClasses.join(" "); + // Add classes from `node.classes` + this.classes ? rowDiv.classList.add(...this.classes) : 0; + // Add classes from `tree.types[node.type]` + if (typeInfo && typeInfo.classes) { + rowDiv.classList.add(...typeInfo.classes); + } + if (expanderSpan) { + let image = null; + if (this._isLoading) { + image = iconMap.loading; + } + else if (this.isExpandable(false)) { + if (this.expanded) { + image = iconMap.expanderExpanded; + } + else { + image = iconMap.expanderCollapsed; + } + } + else if (this.lazy && this.children == null) { + image = iconMap.expanderLazy; + } + if (image == null) { + expanderSpan.classList.add("wb-indent"); + } + else if (TEST_IMG.test(image)) { + expanderSpan.style.backgroundImage = `url('${image}')`; + } + else { + expanderSpan.className = "wb-expander " + image; + } + } + if (checkboxSpan) { + let cbclass = "wb-checkbox "; + if (this.isRadio()) { + cbclass += "wb-radio "; + if (this.selected) { + cbclass += iconMap.radioChecked; + // } else if (this._partsel) { + // cbclass += iconMap.radioUnknown; + } + else { + cbclass += iconMap.radioUnchecked; + } + } + else { + if (this.selected) { + cbclass += iconMap.checkChecked; + } + else if (this._partsel) { + cbclass += iconMap.checkUnknown; + } + else { + cbclass += iconMap.checkUnchecked; + } + } + checkboxSpan.className = cbclass; + } + // Fix active cell in cell-nav mode + if (!opts.isNew) { + let i = 0; + for (const colSpan of rowDiv.children) { + colSpan.classList.toggle("wb-active", i++ === tree.activeColIdx); + colSpan.classList.remove("wb-error", "wb-invalid"); + } + // Update icon (if not opts.isNew, which would rebuild markup anyway) + const iconSpan = nodeElem.querySelector("i.wb-icon"); + if (iconSpan) { + this._createIcon(tree.iconMap, nodeElem, iconSpan, !expanderSpan); + } + } + // Adjust column width + if (opts.resizeCols !== false && !this.isColspan()) { + const colElems = rowDiv.querySelectorAll("span.wb-col"); + let idx = 0; + let ofs = 0; + for (const colDef of this.tree.columns) { + const colElem = colElems[idx]; + colElem.style.left = `${ofs}px`; + colElem.style.width = `${colDef._widthPx}px`; + idx++; + ofs += colDef._widthPx; + } + } + } + /* + * Create or update node's markup. + * + * `options.change` defaults to ChangeType.data, which updates the title, + * icon, and status. It also triggers the `render` event, that lets the user + * create or update the content of embeded cell elements. + * + * If only the status or other class-only modifications have changed, + * `options.change` should be set to ChangeType.status instead for best + * efficiency. + * + * Calling `update()` is almost always a better alternative. + * @see {@link WunderbaumNode.update} + */ + _render(options) { + // this.log("render", options); + const opts = Object.assign({ change: ChangeType.data }, options); + if (!this._rowElem) { + opts.change = ChangeType.row; + } + switch (opts.change) { + case "status": + this._render_status(opts); + break; + case "data": + this._render_data(opts); + break; + case "row": + // _rowElem is not yet created (asserted in _render_markup) + this._render_markup(opts); + break; + default: + error(`Invalid change type '${opts.change}'.`); + } + } + /** + * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad + * event is triggered on next expand. + */ + resetLazy() { + this.removeChildren(); + this.expanded = false; + this.lazy = true; + this.children = null; + this.tree.update(ChangeType.structure); + } + /** Convert node (or whole branch) into a plain object. + * + * The result is compatible with node.addChildren(). + * + * @param include child nodes + * @param callback(dict, node) is called for every node, in order to allow + * modifications. + * Return `false` to ignore this node or `"skip"` to include this node + * without its children. + * @see {@link Wunderbaum.toDictArray}. + */ + toDict(recursive = false, callback) { + const dict = {}; + NODE_DICT_PROPS.forEach((propName) => { + const val = this[propName]; + if (val instanceof Set) { + // Convert Set to string (or skip if set is empty) + val.size + ? (dict[propName] = Array.prototype.join.call(val.keys(), " ")) + : 0; + } + else if (val || val === false || val === 0) { + dict[propName] = val; + } + }); + if (!isEmptyObject(this.data)) { + dict.data = extend({}, this.data); + if (isEmptyObject(dict.data)) { + delete dict.data; + } + } + if (callback) { + const res = callback(dict, this); + if (res === false) { + // Note: a return value of `false` is only used internally + return false; // Don't include this node nor its children + } + if (res === "skip") { + recursive = false; // Include this node, but not the children + } + } + if (recursive) { + if (isArray(this.children)) { + dict.children = []; + for (let i = 0, l = this.children.length; i < l; i++) { + const node = this.children[i]; + if (!node.isStatusNode()) { + // Note: a return value of `false` is only used internally + const res = node.toDict(true, callback); + if (res !== false) { + dict.children.push(res); + } + } + } + } + } + return dict; + } + /** Return an option value that has a default, but may be overridden by a + * callback or a node instance attribute. + * + * Evaluation sequence: + * + * - If `tree.options.` is a callback that returns something, use that. + * - Else if `node.` is defined, use that. + * - Else if `tree.types[]` is a value, use that. + * - Else if `tree.options.` is a value, use that. + * - Else use `defaultValue`. + * + * @param name name of the option property (on node and tree) + * @param defaultValue return this if nothing else matched + * {@link Wunderbaum.getOption|Wunderbaum.getOption()} + */ + getOption(name, defaultValue) { + const tree = this.tree; + let opts = tree.options; + // Lookup `name` in options dict + if (name.indexOf(".") >= 0) { + [opts, name] = name.split("."); + } + const value = opts[name]; // ?? defaultValue; + // A callback resolver always takes precedence + if (typeof value === "function") { + const res = value.call(tree, { + type: "resolve", + tree: tree, + node: this, + // typeInfo: this.type ? tree.types[this.type] : {}, + }); + if (res !== undefined) { + return res; + } + } + // If this node has an explicit local setting, use it: + if (this[name] !== undefined) { + return this[name]; + } + // Use value from type definition if defined + const typeInfo = this.type ? tree.types[this.type] : undefined; + const res = typeInfo ? typeInfo[name] : undefined; + if (res !== undefined) { + return res; + } + // Use value from value options dict, fallback do default + return value !== null && value !== void 0 ? value : defaultValue; + } + /** Make sure that this node is visible in the viewport. + * @see {@link Wunderbaum.scrollTo|Wunderbaum.scrollTo()} + */ + async scrollIntoView(options) { + const opts = Object.assign({ node: this }, options); + return this.tree.scrollTo(opts); + } + /** + * Activate this node, deactivate previous, send events, activate column and + * scroll into viewport. + */ + async setActive(flag = true, options) { + const tree = this.tree; + const prev = tree.activeNode; + const retrigger = options === null || options === void 0 ? void 0 : options.retrigger; // Default: false + const focusTree = options === null || options === void 0 ? void 0 : options.focusTree; // Default: false + // const focusNode = options?.focusNode !== false; // Default: true + const noEvents = options === null || options === void 0 ? void 0 : options.noEvents; // Default: false + const orgEvent = options === null || options === void 0 ? void 0 : options.event; // Default: null + const colIdx = options === null || options === void 0 ? void 0 : options.colIdx; // Default: null + const edit = options === null || options === void 0 ? void 0 : options.edit; // Default: false + assert(!colIdx || tree.isCellNav(), "colIdx requires cellNav"); + assert(!edit || colIdx != null, "edit requires colIdx"); + if (!noEvents) { + if (flag) { + if (prev !== this || retrigger) { + if ((prev === null || prev === void 0 ? void 0 : prev._callEvent("deactivate", { + nextNode: this, + event: orgEvent, + })) === false || + this._callEvent("beforeActivate", { + prevNode: prev, + event: orgEvent, + }) === false) { + return; + } + tree.activeNode = null; + prev === null || prev === void 0 ? void 0 : prev.update(ChangeType.status); + } + } + else if (prev === this || retrigger) { + this._callEvent("deactivate", { nextNode: null, event: orgEvent }); + } + } + if (prev !== this) { + if (flag) { + tree.activeNode = this; + } + prev === null || prev === void 0 ? void 0 : prev.update(ChangeType.status); + this.update(ChangeType.status); + } + return this.makeVisible().then(() => { + if (flag) { + if (focusTree || edit) { + tree.setFocus(); + tree.focusNode = this; + tree.focusNode.setFocus(); + } + // if (focusNode || edit) { + // tree.focusNode = this; + // tree.focusNode.setFocus(); + // } + if (colIdx != null && tree.isCellNav()) { + tree.setColumn(colIdx, { edit: edit }); + } + if (!noEvents) { + this._callEvent("activate", { prevNode: prev, event: orgEvent }); + } + } + }); + } + /** + * Expand or collapse this node. + */ + async setExpanded(flag = true, options) { + const { force, scrollIntoView, immediate } = options !== null && options !== void 0 ? options : {}; + const sendEvents = !(options === null || options === void 0 ? void 0 : options.noEvents); // Default: send events + if (!flag && + this.isExpanded() && + this.getLevel() <= this.tree.getOption("minExpandLevel") && + !force) { + this.logDebug("Ignored collapse request below expandLevel."); + return; + } + if (!flag === !this.expanded) { + return; // Nothing to do + } + if (sendEvents && + this._callEvent("beforeExpand", { flag: flag }) === false) { + return; + } + // this.log("setExpanded()"); + if (flag && this.getOption("autoCollapse")) { + this.collapseSiblings(options); + } + if (flag && this.lazy && this.children == null) { + await this.loadLazy(); + } + this.expanded = flag; + const updateOpts = { immediate: immediate }; + // const updateOpts = { immediate: !!util.getOption(options, "immediate") }; + this.tree.update(ChangeType.structure, updateOpts); + if (flag && scrollIntoView) { + const lastChild = this.getLastChild(); + if (lastChild) { + this.tree.updatePendingModifications(); + lastChild.scrollIntoView({ topNode: this }); + } + } + if (sendEvents) { + this._callEvent("expand", { flag: flag }); + } + } + /** + * Set keyboard focus here. + * @see {@link setActive} + */ + setFocus(flag = true) { + assert(!!flag, "Blur is not yet implemented"); + const prev = this.tree.focusNode; + this.tree.focusNode = this; + prev === null || prev === void 0 ? void 0 : prev.update(); + this.update(); + } + /** Set a new icon path or class. */ + setIcon(icon) { + this.icon = icon; + this.update(); + } + /** Change node's {@link key} and/or {@link refKey}. */ + setKey(key, refKey) { + throw new Error("Not yet implemented"); + } + /** + * Trigger a repaint, typically after a status or data change. + * + * `change` defaults to 'data', which handles modifcations of title, icon, + * and column content. It can be reduced to 'ChangeType.status' if only + * active/focus/selected state has changed. + * + * This method will eventually call {@link WunderbaumNode._render()} with + * default options, but may be more consistent with the tree's + * {@link Wunderbaum.update()} API. + */ + update(change = ChangeType.data) { + assert(change === ChangeType.status || change === ChangeType.data, `Invalid change type ${change}`); + this.tree.update(change, this); + } + /** + * Return an array of selected nodes. + * @param stopOnParents only return the topmost selected node (useful with selectMode 'hier') + */ + getSelectedNodes(stopOnParents = false) { + const nodeList = []; + this.visit((node) => { + if (node.selected) { + nodeList.push(node); + if (stopOnParents === true) { + return "skip"; // stop processing this branch + } + } + }); + return nodeList; + } + /** Toggle the check/uncheck state. */ + toggleSelected(options) { + let flag = this.isSelected(); + if (flag === undefined && !this.isRadio()) { + flag = this._anySelectable(); + } + else { + flag = !flag; + } + return this.setSelected(flag, options); + } + /** Return true if at least on selectable descendant end-node is unselected. @internal */ + _anySelectable() { + let found = false; + this.visit((node) => { + if (node.selected === false && + !node.unselectable && + !node.hasChildren() && + !node.parent.radiogroup) { + found = true; + return false; // Stop iteration + } + }); + return found; + } + /* Apply selection state to a single node. */ + _changeSelectStatusProps(state) { + let changed = false; + switch (state) { + case false: + changed = this.selected || this._partsel; + this.selected = false; + this._partsel = false; + break; + case true: + changed = !this.selected || !this._partsel; + this.selected = true; + this._partsel = true; + break; + case undefined: + changed = this.selected || !this._partsel; + this.selected = false; + this._partsel = true; + break; + default: + error(`Invalid state: ${state}`); + } + if (changed) { + this.update(); + } + return changed; + } + /** + * Fix selection status, after this node was (de)selected in `selectMode: 'hier'`. + * This includes (de)selecting all descendants. + */ + fixSelection3AfterClick(opts) { + const force = !!(opts === null || opts === void 0 ? void 0 : opts.force); + const flag = this.isSelected(); + this.visit((node) => { + if (node.radiogroup) { + return "skip"; // Don't (de)select this branch + } + if (force || !node.getOption("unselectable")) { + node._changeSelectStatusProps(flag); + } + }); + this.fixSelection3FromEndNodes(); + } + /** + * Fix selection status for multi-hier mode. + * Only end-nodes are considered to update the descendants branch and parents. + * Should be called after this node has loaded new children or after + * children have been modified using the API. + */ + fixSelection3FromEndNodes(opts) { + const force = !!(opts === null || opts === void 0 ? void 0 : opts.force); + assert(this.tree.options.selectMode === "hier", "expected selectMode 'hier'"); + // Visit all end nodes and adjust their parent's `selected` and `_partsel` + // attributes. Return selection state true, false, or undefined. + const _walk = (node) => { + let state; + const children = node.children; + if (children && children.length) { + // check all children recursively + let allSelected = true; + let someSelected = false; + for (let i = 0, l = children.length; i < l; i++) { + const child = children[i]; + // the selection state of a node is not relevant; we need the end-nodes + const s = _walk(child); + if (s !== false) { + someSelected = true; + } + if (s !== true) { + allSelected = false; + } + } + state = allSelected ? true : someSelected ? undefined : false; + } + else { + // This is an end-node: simply report the status + state = !!node.selected; + } + // #939: Keep a `_partsel` flag that was explicitly set on a lazy node + if (node._partsel && + !node.selected && + node.lazy && + node.children == null) { + state = undefined; + } + if (force || !node.getOption("unselectable")) { + node._changeSelectStatusProps(state); + } + return state; + }; + _walk(this); + // Update parent's state + this.visitParents((node) => { + let state; + const children = node.children; + let allSelected = true; + let someSelected = false; + for (let i = 0, l = children.length; i < l; i++) { + const child = children[i]; + state = !!child.selected; + // When fixing the parents, we trust the sibling status (i.e. we don't recurse) + if (state || child._partsel) { + someSelected = true; + } + if (!state) { + allSelected = false; + } + } + state = allSelected ? true : someSelected ? undefined : false; + node._changeSelectStatusProps(state); + }); + } + /** Modify the check/uncheck state. */ + setSelected(flag = true, options) { + const tree = this.tree; + const sendEvents = !(options === null || options === void 0 ? void 0 : options.noEvents); // Default: send events + const prev = this.isSelected(); + const isRadio = this.parent && this.parent.radiogroup; + const selectMode = tree.options.selectMode; + const canSelect = (options === null || options === void 0 ? void 0 : options.force) || !this.getOption("unselectable"); + flag = !!flag; + // this.logDebug(`setSelected(${flag})`, this); + if (!canSelect) { + return prev; + } + if ((options === null || options === void 0 ? void 0 : options.propagateDown) && selectMode === "multi") { + tree.runWithDeferredUpdate(() => { + this.visit((node) => { + node.setSelected(flag); + }); + }); + return prev; + } + if (flag === prev || + (sendEvents && this._callEvent("beforeSelect", { flag: flag }) === false)) { + return prev; + } + tree.runWithDeferredUpdate(() => { + if (isRadio) { + // Radiobutton Group + if (!flag && !(options === null || options === void 0 ? void 0 : options.force)) { + return prev; // don't uncheck radio buttons + } + for (const sibling of this.parent.children) { + sibling.selected = sibling === this; + } + } + else { + this.selected = flag; + if (selectMode === "hier") { + this.fixSelection3AfterClick(); + } + else if (selectMode === "single") { + tree.visit((n) => { + n.selected = false; + }); + } + } + }); + if (sendEvents) { + this._callEvent("select", { flag: flag }); + } + return prev; + } + /** Display node status (ok, loading, error, noData) using styles and a dummy child node. */ + setStatus(status, options) { + const tree = this.tree; + const message = options === null || options === void 0 ? void 0 : options.message; + const details = options === null || options === void 0 ? void 0 : options.details; + let statusNode = null; + const _clearStatusNode = () => { + // Remove dedicated dummy node, if any + const children = this.children; + if (children && children.length && children[0].isStatusNode()) { + children[0].remove(); + } + }; + const _setStatusNode = (data) => { + // Create/modify the dedicated dummy node for 'loading...' or + // 'error!' status. (only called for direct child of the invisible + // system root) + const children = this.children; + const firstChild = children ? children[0] : null; + assert(data.statusNodeType, "Not a status node"); + assert(!firstChild || !firstChild.isStatusNode(), "Child must not be a status node"); + statusNode = this.addNode(data, "prependChild"); + statusNode.match = true; + tree.update(ChangeType.structure); + return statusNode; + }; + _clearStatusNode(); + switch (status) { + case "ok": + this._isLoading = false; + this._errorInfo = null; + break; + case "loading": + this._isLoading = true; + this._errorInfo = null; + if (this.parent) { + this.update(ChangeType.status); + } + else { + // If this is the invisible root, add a visible top-level node + _setStatusNode({ + statusNodeType: status, + title: tree.options.strings.loading + + (message ? " (" + message + ")" : ""), + checkbox: false, + colspan: true, + tooltip: details, + }); + } + // this.update(); + break; + case "error": + _setStatusNode({ + statusNodeType: status, + title: tree.options.strings.loadError + + (message ? " (" + message + ")" : ""), + checkbox: false, + colspan: true, + // classes: "wb-center", + tooltip: details, + }); + this._isLoading = false; + this._errorInfo = { message: message, details: details }; + break; + case "noData": + _setStatusNode({ + statusNodeType: status, + title: message || tree.options.strings.noData, + checkbox: false, + colspan: true, + tooltip: details, + }); + this._isLoading = false; + this._errorInfo = null; + break; + default: + error("invalid node status " + status); + } + tree.update(ChangeType.structure); + return statusNode; + } + /** Rename this node. */ + setTitle(title) { + this.title = title; + this.update(); + // this.triggerModify("rename"); // TODO + } + _sortChildren(cmp, deep) { + const cl = this.children; + if (!cl) { + return; + } + cl.sort(cmp); + if (deep) { + for (let i = 0, l = cl.length; i < l; i++) { + if (cl[i].children) { + cl[i]._sortChildren(cmp, deep); + } + } + } + } + /** + * Sort child list by title or custom criteria. + * @param {function} cmp custom compare function(a, b) that returns -1, 0, or 1 + * (defaults to sorting by title). + * @param {boolean} deep pass true to sort all descendant nodes recursively + */ + sortChildren(cmp = nodeTitleSorter, deep = false) { + this._sortChildren(cmp || nodeTitleSorter, deep); + this.tree.update(ChangeType.structure); + // this.triggerModify("sort"); // TODO + } + /** + * Trigger `modifyChild` event on a parent to signal that a child was modified. + * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ... + */ + triggerModifyChild(operation, child, extra) { + this.logDebug(`modifyChild(${operation})`, extra, child); + if (!this.tree.options.modifyChild) { + return; + } + if (child && child.parent !== this) { + error("child " + child + " is not a child of " + this); + } + this._callEvent("modifyChild", extend({ operation: operation, child: child }, extra)); + } + /** + * Trigger `modifyChild` event on node.parent(!). + * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ... + * @param {object} [extra] + */ + triggerModify(operation, extra) { + // if (!this.parent) { + // return; + // } + this.parent.triggerModifyChild(operation, this, extra); + } + /** + * Call `callback(node)` for all descendant nodes in hierarchical order (depth-first, pre-order). + * + * Stop iteration, if fn() returns false. Skip current branch, if fn() + * returns "skip".
+ * Return false if iteration was stopped. + * + * @param {function} callback the callback function. + * Return false to stop iteration, return "skip" to skip this node and + * its children only. + * @see {@link IterableIterator}, {@link Wunderbaum.visit}. + */ + visit(callback, includeSelf = false) { + let res = true; + const children = this.children; + if (includeSelf === true) { + res = callback(this); + if (res === false || res === "skip") { + return res; + } + } + if (children) { + for (let i = 0, l = children.length; i < l; i++) { + res = children[i].visit(callback, true); + if (res === false) { + break; + } + } + } + return res; + } + /** Call fn(node) for all parent nodes, bottom-up, including invisible system root.
+ * Stop iteration, if callback() returns false.
+ * Return false if iteration was stopped. + * + * @param callback the callback function. Return false to stop iteration + */ + visitParents(callback, includeSelf = false) { + if (includeSelf && callback(this) === false) { + return false; + } + let p = this.parent; + while (p) { + if (callback(p) === false) { + return false; + } + p = p.parent; + } + return true; + } + /** + * Call fn(node) for all sibling nodes.
+ * Stop iteration, if fn() returns false.
+ * Return false if iteration was stopped. + * + * @param {function} fn the callback function. + * Return false to stop iteration. + */ + visitSiblings(callback, includeSelf = false) { + const ac = this.parent.children; + for (let i = 0, l = ac.length; i < l; i++) { + const n = ac[i]; + if (includeSelf || n !== this) { + if (callback(n) === false) { + return false; + } + } + } + return true; + } + /** + * [ext-filter] Return true if this node is matched by current filter (or no filter is active). + */ + isMatched() { + return !(this.tree.filterMode && !this.match); + } + } + WunderbaumNode.sequence = 0; - /*! - * Wunderbaum - ext-edit - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ - // const START_MARKER = "\uFFF7"; - class EditExtension extends WunderbaumExtension { - constructor(tree) { - super(tree, "edit", { - debounce: 100, - minlength: 1, - maxlength: null, - trigger: [], - trim: true, - select: true, - slowClickDelay: 1000, - validity: true, - // --- Events --- - // (note: there is also the `tree.change` event.) - beforeEdit: null, - edit: null, - apply: null, - }); - this.curEditNode = null; - this.relatedNode = null; - this.debouncedOnChange = debounce(this._onChange.bind(this), this.getPluginOption("debounce")); - } - /* - * Call an event handler, while marking the current node cell 'dirty'. - */ - _applyChange(eventName, node, colElem, extra) { - let res; - node.log(`_applyChange(${eventName})`, extra); - colElem.classList.add("wb-busy"); - colElem.classList.remove("wb-error"); - try { - res = node._callEvent(eventName, extra); - } - catch (err) { - node.logError(`Error in ${eventName} event handler`, err); - colElem.classList.add("wb-error"); - colElem.classList.remove("wb-busy"); - } - // Convert scalar return value to a resolved promise - if (!(res instanceof Promise)) { - res = Promise.resolve(res); - } - res - .catch((err) => { - node.logError(`Error in ${eventName} event promise`, err); - colElem.classList.add("wb-error"); - }) - .finally(() => { - colElem.classList.remove("wb-busy"); - }); - return res; - } - /* - * Called for when a control that is embedded in a cell fires a `change` event. - */ - _onChange(e) { - // let res; - const info = Wunderbaum.getEventInfo(e); - const node = info.node; - const colElem = info.colElem; - if (!node || info.colIdx === 0) { - this.tree.log("Ignored change event for removed element or node title"); - return; - } - this._applyChange("change", node, colElem, { - info: info, - event: e, - inputElem: e.target, - inputValue: Wunderbaum.util.getValueFromElem(e.target), - }); - } - // handleKey(e:KeyboardEvent):boolean { - // if(this.tree.cellNavMode ) - // } - init() { - super.init(); - onEvent(this.tree.element, "change", //"change input", - ".contenteditable,input,textarea,select", - // #61: we must not debounce the `change`, event.target may be reset to null - // when the debounced handler is called. - // (e) => { - // this.debouncedOnChange(e); - // } - (e) => this._onChange(e)); - } - /* Called by ext_keynav to pre-process input. */ - _preprocessKeyEvent(data) { - const event = data.event; - const eventName = eventToString(event); - const tree = this.tree; - const trigger = this.getPluginOption("trigger"); - // const inputElem = - // event.target && event.target.closest("input,[contenteditable]"); - // tree.logDebug(`_preprocessKeyEvent: ${eventName}, editing:${this.isEditingTitle()}`); - // --- Title editing: apply/discard --- - // if (inputElem) { - if (this.isEditingTitle()) { - switch (eventName) { - case "Enter": - this._stopEditTitle(true, { event: event }); - return false; - case "Escape": - this._stopEditTitle(false, { event: event }); - return false; - } - // If the event target is an input element or `contenteditable="true"`, - // we ignore it as navigation command - return false; - } - // --- Trigger title editing - if (tree.isRowNav() || tree.activeColIdx === 0) { - switch (eventName) { - case "Enter": - if (trigger.indexOf("macEnter") >= 0 && isMac) { - this.startEditTitle(); - return false; - } - break; - case "F2": - if (trigger.indexOf("F2") >= 0) { - // tree.setNavigationMode(NavigationMode.cellEdit); - this.startEditTitle(); - return false; - } - break; - } - return true; - } - return true; - } - /** Return true if a title is currently being edited. */ - isEditingTitle(node) { - return node ? this.curEditNode === node : !!this.curEditNode; - } - /** Start renaming, i.e. replace the title with an embedded ``. */ - startEditTitle(node) { - node = node !== null && node !== void 0 ? node : this.tree.getActiveNode(); - const validity = this.getPluginOption("validity"); - const select = this.getPluginOption("select"); - if (!node) { - return; - } - this.tree.logDebug(`startEditTitle(node=${node})`); - let inputHtml = node._callEvent("edit.beforeEdit"); - if (inputHtml === false) { - node.logInfo("beforeEdit canceled operation."); - return; - } - // `beforeEdit(e)` may return an input HTML string. Otherwise use a default. - // (we also treat a `true` return value as 'use default'): - if (inputHtml === true || !inputHtml) { - const title = escapeHtml(node.title); - inputHtml = ``; - } - const titleSpan = node - .getColElem(0) - .querySelector(".wb-title"); - titleSpan.innerHTML = inputHtml; - const inputElem = titleSpan.firstElementChild; - if (validity) { - // Permanently apply input validations (CSS and tooltip) - inputElem.addEventListener("keydown", (e) => { - inputElem.setCustomValidity(""); - if (!inputElem.reportValidity()) ; - }); - } - inputElem.focus(); - if (select) { - inputElem.select(); - } - this.curEditNode = node; - node._callEvent("edit.edit", { - inputElem: inputElem, - }); - } - /** - * - * @param apply - * @returns - */ - stopEditTitle(apply) { - return this._stopEditTitle(apply, {}); - } - /* - * - * @param apply - * @param opts.canKeepOpen - */ - _stopEditTitle(apply, options) { - options !== null && options !== void 0 ? options : (options = {}); - const focusElem = document.activeElement; - let newValue = focusElem ? getValueFromElem(focusElem) : null; - const node = this.curEditNode; - const forceClose = !!options.forceClose; - const validity = this.getPluginOption("validity"); - if (newValue && this.getPluginOption("trim")) { - newValue = newValue.trim(); - } - if (!node) { - this.tree.logDebug("stopEditTitle: not in edit mode."); - return; - } - node.logDebug(`stopEditTitle(${apply})`, options, focusElem, newValue); - if (apply && newValue !== null && newValue !== node.title) { - const errMsg = focusElem.validationMessage; - if (errMsg) { - // input element's native validation failed - throw new Error(`Input validation failed for "${newValue}": ${errMsg}.`); - } - const colElem = node.getColElem(0); - this._applyChange("edit.apply", node, colElem, { - oldValue: node.title, - newValue: newValue, - inputElem: focusElem, - }) - .then((value) => { - const errMsg = focusElem.validationMessage; - if (validity && errMsg && value !== false) { - // Handler called 'inputElem.setCustomValidity()' to signal error - throw new Error(`Edit apply validation failed for "${newValue}": ${errMsg}.`); - } - // Discard the embedded `` - // node.logDebug("applyChange:", value, forceClose) - if (!forceClose && value === false) { - // Keep open - return; - } - node === null || node === void 0 ? void 0 : node.setTitle(newValue); - // NOTE: At least on Safari, this render call triggers a scroll event - // probably because the focused input is replaced. - this.curEditNode._render({ preventScroll: true }); - this.curEditNode = null; - this.relatedNode = null; - this.tree.setFocus(); // restore focus that was in the input element - }) - .catch((err) => { - node.logError(err); - }); - // Trigger 'change' event for embedded `` - // focusElem.blur(); - } - else { - // Discard the embedded `` - // NOTE: At least on Safari, this render call triggers a scroll event - // probably because the focused input is replaced. - this.curEditNode._render({ preventScroll: true }); - this.curEditNode = null; - this.relatedNode = null; - // We discarded the , so we have to acquire keyboard focus again - this.tree.setFocus(); - } - } - /** - * Create a new child or sibling node and start edit mode. - */ - createNode(mode = "after", node, init) { - const tree = this.tree; - node = node !== null && node !== void 0 ? node : tree.getActiveNode(); - assert(node, "No node was passed, or no node is currently active."); - // const validity = this.getPluginOption("validity"); - mode = mode || "prependChild"; - if (init == null) { - init = { title: "" }; - } - else if (typeof init === "string") { - init = { title: init }; - } - else { - assert(isPlainObject(init), `Expected a plain object: ${init}`); - } - // Make sure node is expanded (and loaded) in 'child' mode - if ((mode === "prependChild" || mode === "appendChild") && - (node === null || node === void 0 ? void 0 : node.isExpandable(true))) { - node.setExpanded().then(() => { - this.createNode(mode, node, init); - }); - return; - } - const newNode = node.addNode(init, mode); - newNode.setClass("wb-edit-new"); - this.relatedNode = node; - // Don't filter new nodes: - newNode.match = true; - newNode.makeVisible({ noAnimation: true }).then(() => { - this.startEditTitle(newNode); - }); - } - } + /*! + * Wunderbaum - ext-edit + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ + // const START_MARKER = "\uFFF7"; + class EditExtension extends WunderbaumExtension { + constructor(tree) { + super(tree, "edit", { + debounce: 100, + minlength: 1, + maxlength: null, + trigger: [], + trim: true, + select: true, + slowClickDelay: 1000, + validity: true, + // --- Events --- + // (note: there is also the `tree.change` event.) + beforeEdit: null, + edit: null, + apply: null, + }); + this.curEditNode = null; + this.relatedNode = null; + this.debouncedOnChange = debounce(this._onChange.bind(this), this.getPluginOption("debounce")); + } + /* + * Call an event handler, while marking the current node cell 'busy'. + * Deal with returned promises and ValidationError. + * Convert a ValidationError into a input.setCustomValidity() call and vice versa. + */ + async _applyChange(eventName, node, colElem, inputElem, extra) { + node.log(`_applyChange(${eventName})`, extra); + colElem.classList.add("wb-busy"); + colElem.classList.remove("wb-error", "wb-invalid"); + inputElem.setCustomValidity(""); + // Call event handler either ('change' or 'edit.appy'), which may return a + // promise or a scalar value or throw a ValidationError. + return new Promise((resolve, reject) => { + const res = node._callEvent(eventName, extra); + // normalize to promise, even if a scalar value was returned and await it + Promise.resolve(res) + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }) + .then((res) => { + if (!inputElem.checkValidity()) { + // Native validation failed or handler called 'inputElem.setCustomValidity()' + node.logWarn("inputElem.checkValidity() failed: throwing...."); + throw new ValidationError(inputElem.validationMessage); + } + return res; + }) + .catch((err) => { + if (err instanceof ValidationError) { + node.logWarn("catched ", err); + colElem.classList.add("wb-invalid"); + if (inputElem.setCustomValidity && !inputElem.validationMessage) { + inputElem.setCustomValidity(err.message); + } + if (inputElem.validationMessage) { + inputElem.reportValidity(); + } + // throw err; + } + else { + node.logError(`Error in ${eventName} event handler (throw e.util.ValidationError instead if this was intended)`, err); + colElem.classList.add("wb-error"); + throw err; + } + }) + .finally(() => { + colElem.classList.remove("wb-busy"); + }); + } + /* + * Called for when a control that is embedded in a cell fires a `change` event. + */ + _onChange(e) { + const info = Wunderbaum.getEventInfo(e); + const node = info.node; + const colElem = info.colElem; + if (!node || info.colIdx === 0) { + this.tree.log("Ignored change event for removed element or node title"); + return; + } + // See also WbChangeEventType + this._applyChange("change", node, colElem, e.target, { + info: info, + event: e, + inputElem: e.target, + inputValue: Wunderbaum.util.getValueFromElem(e.target), + inputValid: e.target.checkValidity(), + }); + } + init() { + super.init(); + onEvent(this.tree.element, "change", //"change input", + ".contenteditable,input,textarea,select", + // #61: we must not debounce the `change`, event.target may be reset to null + // when the debounced handler is called. + // (e) => { + // this.debouncedOnChange(e); + // } + (e) => this._onChange(e)); + } + /* Called by ext_keynav to pre-process input. */ + _preprocessKeyEvent(data) { + const event = data.event; + const eventName = eventToString(event); + const tree = this.tree; + const trigger = this.getPluginOption("trigger"); + // const inputElem = + // event.target && event.target.closest("input,[contenteditable]"); + // tree.logDebug(`_preprocessKeyEvent: ${eventName}, editing:${this.isEditingTitle()}`); + // --- Title editing: apply/discard --- + // if (inputElem) { + if (this.isEditingTitle()) { + switch (eventName) { + case "Enter": + this._stopEditTitle(true, { event: event }); + return false; + case "Escape": + this._stopEditTitle(false, { event: event }); + return false; + } + // If the event target is an input element or `contenteditable="true"`, + // we ignore it as navigation command + return false; + } + // --- Trigger title editing + if (tree.isRowNav() || tree.activeColIdx === 0) { + switch (eventName) { + case "Enter": + if (trigger.indexOf("macEnter") >= 0 && isMac) { + this.startEditTitle(); + return false; + } + break; + case "F2": + if (trigger.indexOf("F2") >= 0) { + this.startEditTitle(); + return false; + } + break; + } + return true; + } + return true; + } + /** Return true if a title is currently being edited. */ + isEditingTitle(node) { + return node ? this.curEditNode === node : !!this.curEditNode; + } + /** Start renaming, i.e. replace the title with an embedded ``. */ + startEditTitle(node) { + node = node !== null && node !== void 0 ? node : this.tree.getActiveNode(); + const validity = this.getPluginOption("validity"); + const select = this.getPluginOption("select"); + if (!node) { + return; + } + this.tree.logDebug(`startEditTitle(node=${node})`); + let inputHtml = node._callEvent("edit.beforeEdit"); + if (inputHtml === false) { + node.logDebug("beforeEdit canceled operation."); + return; + } + // `beforeEdit(e)` may return an input HTML string. Otherwise use a default + // (we also treat a `true` return value as 'use default'): + if (inputHtml === true || !inputHtml) { + const title = escapeHtml(node.title); + let opt = this.getPluginOption("maxlength"); + const maxlength = opt ? ` maxlength="${opt}"` : ""; + opt = this.getPluginOption("minlength"); + const minlength = opt ? ` minlength="${opt}"` : ""; + const required = opt > 0 ? " required" : ""; + inputHtml = + ``; + } + const titleSpan = node + .getColElem(0) + .querySelector(".wb-title"); + titleSpan.innerHTML = inputHtml; + const inputElem = titleSpan.firstElementChild; + if (validity) { + // Permanently apply input validations (CSS and tooltip) + inputElem.addEventListener("keydown", (e) => { + inputElem.setCustomValidity(""); + if (!inputElem.reportValidity()) { + node.logWarn(`Invalid input: '${inputElem.value}'`); + } + }); + } + inputElem.focus(); + if (select) { + inputElem.select(); + } + this.curEditNode = node; + node._callEvent("edit.edit", { + inputElem: inputElem, + }); + } + /** + * + * @param apply + * @returns + */ + stopEditTitle(apply) { + return this._stopEditTitle(apply, {}); + } + /* + * + * @param apply + * @param opts.canKeepOpen + */ + _stopEditTitle(apply, options) { + options !== null && options !== void 0 ? options : (options = {}); + const focusElem = document.activeElement; + let newValue = focusElem ? getValueFromElem(focusElem) : null; + const node = this.curEditNode; + const forceClose = !!options.forceClose; + const validity = this.getPluginOption("validity"); + if (newValue && this.getPluginOption("trim")) { + newValue = newValue.trim(); + } + if (!node) { + this.tree.logDebug("stopEditTitle: not in edit mode."); + return; + } + node.logDebug(`stopEditTitle(${apply})`, options, focusElem, newValue); + if (apply && newValue !== null && newValue !== node.title) { + const errMsg = focusElem.validationMessage; + if (errMsg) { + // input element's native validation failed + throw new Error(`Input validation failed for "${newValue}": ${errMsg}.`); + } + const colElem = node.getColElem(0); + this._applyChange("edit.apply", node, colElem, focusElem, { + oldValue: node.title, + newValue: newValue, + inputElem: focusElem, + inputValid: focusElem.checkValidity(), + }).then((value) => { + const errMsg = focusElem.validationMessage; + if (validity && errMsg && value !== false) { + // Handler called 'inputElem.setCustomValidity()' to signal error + throw new Error(`Edit apply validation failed for "${newValue}": ${errMsg}.`); + } + // Discard the embedded `` + // node.logDebug("applyChange:", value, forceClose) + if (!forceClose && value === false) { + // Keep open + return; + } + node === null || node === void 0 ? void 0 : node.setTitle(newValue); + // NOTE: At least on Safari, this render call triggers a scroll event + // probably because the focused input is replaced. + this.curEditNode._render({ preventScroll: true }); + this.curEditNode = null; + this.relatedNode = null; + this.tree.setFocus(); // restore focus that was in the input element + }); + // .catch((err) => { + // node.logError(err); + // }); + // Trigger 'change' event for embedded `` + // focusElem.blur(); + } + else { + // Discard the embedded `` + // NOTE: At least on Safari, this render call triggers a scroll event + // probably because the focused input is replaced. + this.curEditNode._render({ preventScroll: true }); + this.curEditNode = null; + this.relatedNode = null; + // We discarded the , so we have to acquire keyboard focus again + this.tree.setFocus(); + } + } + /** + * Create a new child or sibling node and start edit mode. + */ + createNode(mode = "after", node, init) { + const tree = this.tree; + node = node !== null && node !== void 0 ? node : tree.getActiveNode(); + assert(node, "No node was passed, or no node is currently active."); + // const validity = this.getPluginOption("validity"); + mode = mode || "prependChild"; + if (init == null) { + init = { title: "" }; + } + else if (typeof init === "string") { + init = { title: init }; + } + else { + assert(isPlainObject(init), `Expected a plain object: ${init}`); + } + // Make sure node is expanded (and loaded) in 'child' mode + if ((mode === "prependChild" || mode === "appendChild") && + (node === null || node === void 0 ? void 0 : node.isExpandable(true))) { + node.setExpanded().then(() => { + this.createNode(mode, node, init); + }); + return; + } + const newNode = node.addNode(init, mode); + newNode.setClass("wb-edit-new"); + this.relatedNode = node; + // Don't filter new nodes: + newNode.match = true; + newNode.makeVisible({ noAnimation: true }).then(() => { + this.startEditTitle(newNode); + }); + } + } - /*! - * wunderbaum.ts - * - * A treegrid control. - * - * Copyright (c) 2021-2023, Martin Wendt (https://wwWendt.de). - * https://github.com/mar10/wunderbaum - * - * Released under the MIT license. - * @version v0.7.0 - * @date Sat, 09 Dec 2023 13:47:27 GMT - */ - // import "./wunderbaum.scss"; - class WbSystemRoot extends WunderbaumNode { - constructor(tree) { - super(tree, null, { - key: "__root__", - title: tree.id, - }); - } - toString() { - return `WbSystemRoot@${this.key}<'${this.tree.id}'>`; - } - } - /** - * A persistent plain object or array. - * - * See also [[WunderbaumOptions]]. - */ - class Wunderbaum { - constructor(options) { - this.enabled = true; - /** Contains additional data that was sent as response to an Ajax source load request. */ - this.data = {}; - this.extensionList = []; - this.extensions = {}; - this.keyMap = new Map(); - this.refKeyMap = new Map(); - this.treeRowCount = 0; - this._disableUpdateCount = 0; - this._disableUpdateIgnoreCount = 0; - /** Currently active node if any. */ - this.activeNode = null; - /** Current node hat has keyboard focus if any. */ - this.focusNode = null; - /** Shared properties, referenced by `node.type`. */ - this.types = {}; - /** List of column definitions. */ - this.columns = []; // any[] = []; - this._columnsById = {}; - // Modification Status - this.pendingChangeTypes = new Set(); - /** Expose some useful methods of the util.ts module as `tree._util`. */ - this._util = util; - // --- SELECT --- - // /** @internal */ - // public selectRangeAnchor: WunderbaumNode | null = null; - // --- FILTER --- - this.filterMode = null; - // --- KEYNAV --- - /** @internal Use `setColumn()`/`getActiveColElem()`*/ - this.activeColIdx = 0; - /** @internal */ - this._cellNavMode = false; - /** @internal */ - this.lastQuicksearchTime = 0; - /** @internal */ - this.lastQuicksearchTerm = ""; - // --- EDIT --- - this.lastClickTime = 0; - /** Alias for {@link Wunderbaum.logDebug}. - * @alias Wunderbaum.logDebug - */ - this.log = this.logDebug; - const opts = (this.options = extend({ - id: null, - source: null, - element: null, - debugLevel: DEFAULT_DEBUGLEVEL, - header: null, - // headerHeightPx: ROW_HEIGHT, - rowHeightPx: ROW_HEIGHT, - iconMap: "bootstrap", - columns: null, - types: null, - // escapeTitles: true, - enabled: true, - fixedCol: false, - showSpinner: false, - checkbox: false, - minExpandLevel: 0, - emptyChildListExpandable: false, - // updateThrottleWait: 200, - skeleton: false, - connectTopBreadcrumb: null, - selectMode: "multi", - // --- KeyNav --- - navigationModeOption: null, - quicksearch: true, - // --- Events --- - iconBadge: null, - change: null, - // enhanceTitle: null, - error: null, - receive: null, - // --- Strings --- - strings: { - loadError: "Error", - loading: "Loading...", - // loading: "Loading…", - noData: "No data", - }, - }, options)); - const readyDeferred = new Deferred(); - this.ready = readyDeferred.promise(); - let readyOk = false; - this.ready - .then(() => { - readyOk = true; - try { - this._callEvent("init"); - } - catch (error) { - // We re-raise in the reject handler, but Chrome resets the stack - // frame then, so we log it here: - this.logError("Exception inside `init(e)` event:", error); - } - }) - .catch((err) => { - if (readyOk) { - // Error occurred in `init` handler. We can re-raise, but Chrome - // resets the stack frame. - throw err; - } - else { - // Error in load process - this._callEvent("init", { error: err }); - } - }); - this.id = opts.id || "wb_" + ++Wunderbaum.sequence; - this.root = new WbSystemRoot(this); - this._registerExtension(new KeynavExtension(this)); - this._registerExtension(new EditExtension(this)); - this._registerExtension(new FilterExtension(this)); - this._registerExtension(new DndExtension(this)); - this._registerExtension(new GridExtension(this)); - this._registerExtension(new LoggerExtension(this)); - this._updateViewportThrottled = adaptiveThrottle(this._updateViewportImmediately.bind(this), {}); - // --- Evaluate options - this.columns = opts.columns; - delete opts.columns; - if (!this.columns || !this.columns.length) { - const title = typeof opts.header === "string" ? opts.header : this.id; - this.columns = [{ id: "*", title: title, width: "*" }]; - } - if (opts.types) { - this.setTypes(opts.types, true); - } - delete opts.types; - // --- Create Markup - this.element = elemFromSelector(opts.element); - assert(!!this.element, `Invalid 'element' option: ${opts.element}`); - this.element.classList.add("wunderbaum"); - if (!this.element.getAttribute("tabindex")) { - this.element.tabIndex = 0; - } - // Attach tree instance to
- this.element._wb_tree = this; - // Create header markup, or take it from the existing html - this.headerElement = this.element.querySelector("div.wb-header"); - const wantHeader = opts.header == null ? this.columns.length > 1 : !!opts.header; - if (this.headerElement) { - // User existing header markup to define `this.columns` - assert(!this.columns, "`opts.columns` must not be set if markup already contains a header"); - this.columns = []; - const rowElement = this.headerElement.querySelector("div.wb-row"); - for (const colDiv of rowElement.querySelectorAll("div")) { - this.columns.push({ - id: colDiv.dataset.id || `col_${this.columns.length}`, - // id: colDiv.dataset.id || null, - title: "" + colDiv.textContent, - // text: "" + colDiv.textContent, - width: "*", // TODO: read from header span - }); - } - } - else { - // We need a row div, the rest will be computed from `this.columns` - const coldivs = "".repeat(this.columns.length); - this.element.innerHTML = ` + /*! + * wunderbaum.ts + * + * A treegrid control. + * + * Copyright (c) 2021-2023, Martin Wendt (https://wwWendt.de). + * https://github.com/mar10/wunderbaum + * + * Released under the MIT license. + * @version v0.8.0 + * @date Thu, 11 Jan 2024 19:37:23 GMT + */ + // import "./wunderbaum.scss"; + class WbSystemRoot extends WunderbaumNode { + constructor(tree) { + super(tree, null, { + key: "__root__", + title: tree.id, + }); + } + toString() { + return `WbSystemRoot@${this.key}<'${this.tree.id}'>`; + } + } + /** + * A persistent plain object or array. + * + * See also {@link WunderbaumOptions}. + */ + class Wunderbaum { + constructor(options) { + this.enabled = true; + /** Contains additional data that was sent as response to an Ajax source load request. */ + this.data = {}; + this.extensionList = []; + this.extensions = {}; + this.keyMap = new Map(); + this.refKeyMap = new Map(); + this.treeRowCount = 0; + this._disableUpdateCount = 0; + this._disableUpdateIgnoreCount = 0; + /** Currently active node if any. */ + this.activeNode = null; + /** Current node hat has keyboard focus if any. */ + this.focusNode = null; + /** Shared properties, referenced by `node.type`. */ + this.types = {}; + /** List of column definitions. */ + this.columns = []; // any[] = []; + this._columnsById = {}; + // Modification Status + this.pendingChangeTypes = new Set(); + /** Expose some useful methods of the util.ts module as `tree._util`. */ + this._util = util; + // --- SELECT --- + // /** @internal */ + // public selectRangeAnchor: WunderbaumNode | null = null; + // --- FILTER --- + this.filterMode = null; + // --- KEYNAV --- + /** @internal Use `setColumn()`/`getActiveColElem()` to access. */ + this.activeColIdx = 0; + /** @internal */ + this._cellNavMode = false; + /** @internal */ + this.lastQuicksearchTime = 0; + /** @internal */ + this.lastQuicksearchTerm = ""; + // --- EDIT --- + this.lastClickTime = 0; + /** Alias for {@link Wunderbaum.logDebug}. + * @alias Wunderbaum.logDebug + */ + this.log = this.logDebug; + const opts = (this.options = extend({ + id: null, + source: null, + element: null, + debugLevel: DEFAULT_DEBUGLEVEL, + header: null, + // headerHeightPx: ROW_HEIGHT, + rowHeightPx: ROW_HEIGHT, + iconMap: "bootstrap", + columns: null, + types: null, + // escapeTitles: true, + enabled: true, + fixedCol: false, + showSpinner: false, + checkbox: false, + minExpandLevel: 0, + emptyChildListExpandable: false, + // updateThrottleWait: 200, + skeleton: false, + connectTopBreadcrumb: null, + selectMode: "multi", + // --- KeyNav --- + navigationModeOption: null, + quicksearch: true, + // --- Events --- + iconBadge: null, + change: null, + // enhanceTitle: null, + error: null, + receive: null, + // --- Strings --- + strings: { + loadError: "Error", + loading: "Loading...", + // loading: "Loading…", + noData: "No data", + }, + }, options)); + const readyDeferred = new Deferred(); + this.ready = readyDeferred.promise(); + let readyOk = false; + this.ready + .then(() => { + readyOk = true; + try { + this._callEvent("init"); + } + catch (error) { + // We re-raise in the reject handler, but Chrome resets the stack + // frame then, so we log it here: + this.logError("Exception inside `init(e)` event:", error); + } + }) + .catch((err) => { + if (readyOk) { + // Error occurred in `init` handler. We can re-raise, but Chrome + // resets the stack frame. + throw err; + } + else { + // Error in load process + this._callEvent("init", { error: err }); + } + }); + this.id = opts.id || "wb_" + ++Wunderbaum.sequence; + this.root = new WbSystemRoot(this); + this._registerExtension(new KeynavExtension(this)); + this._registerExtension(new EditExtension(this)); + this._registerExtension(new FilterExtension(this)); + this._registerExtension(new DndExtension(this)); + this._registerExtension(new GridExtension(this)); + this._registerExtension(new LoggerExtension(this)); + this._updateViewportThrottled = adaptiveThrottle(this._updateViewportImmediately.bind(this), {}); + // --- Evaluate options + this.columns = opts.columns; + delete opts.columns; + if (!this.columns || !this.columns.length) { + const title = typeof opts.header === "string" ? opts.header : this.id; + this.columns = [{ id: "*", title: title, width: "*" }]; + } + if (opts.types) { + this.setTypes(opts.types, true); + } + delete opts.types; + // --- Create Markup + this.element = elemFromSelector(opts.element); + assert(!!this.element, `Invalid 'element' option: ${opts.element}`); + this.element.classList.add("wunderbaum"); + if (!this.element.getAttribute("tabindex")) { + this.element.tabIndex = 0; + } + // Attach tree instance to
+ this.element._wb_tree = this; + // Create header markup, or take it from the existing html + this.headerElement = this.element.querySelector("div.wb-header"); + const wantHeader = opts.header == null ? this.columns.length > 1 : !!opts.header; + if (this.headerElement) { + // User existing header markup to define `this.columns` + assert(!this.columns, "`opts.columns` must not be set if markup already contains a header"); + this.columns = []; + const rowElement = this.headerElement.querySelector("div.wb-row"); + for (const colDiv of rowElement.querySelectorAll("div")) { + this.columns.push({ + id: colDiv.dataset.id || `col_${this.columns.length}`, + // id: colDiv.dataset.id || null, + title: "" + colDiv.textContent, + // text: "" + colDiv.textContent, + width: "*", // TODO: read from header span + }); + } + } + else { + // We need a row div, the rest will be computed from `this.columns` + const coldivs = "".repeat(this.columns.length); + this.element.innerHTML = `
${coldivs}
`; - if (!wantHeader) { - const he = this.element.querySelector("div.wb-header"); - he.style.display = "none"; - } - } - // - this.element.innerHTML += ` + if (!wantHeader) { + const he = this.element.querySelector("div.wb-header"); + he.style.display = "none"; + } + } + // + this.element.innerHTML += `
`; - this.listContainerElement = this.element.querySelector("div.wb-list-container"); - this.nodeListElement = this.listContainerElement.querySelector("div.wb-node-list"); - this.headerElement = this.element.querySelector("div.wb-header"); - this.element.classList.toggle("wb-grid", this.columns.length > 1); - this._initExtensions(); - // --- apply initial options - ["enabled", "fixedCol"].forEach((optName) => { - if (opts[optName] != null) { - this.setOption(optName, opts[optName]); - } - }); - // --- Load initial data - if (opts.source) { - if (opts.showSpinner) { - this.nodeListElement.innerHTML = - "loading..."; - } - this.load(opts.source) - .then(() => { - // The source may have defined columns, so we may adjust the nav mode - if (opts.navigationModeOption == null) { - if (this.isGrid()) { - this.setNavigationOption(NavModeEnum.cell); - } - else { - this.setNavigationOption(NavModeEnum.row); - } - } - else { - this.setNavigationOption(opts.navigationModeOption); - } - readyDeferred.resolve(); - }) - .catch((error) => { - readyDeferred.reject(error); - }) - .finally(() => { - var _a; - (_a = this.element.querySelector("progress.spinner")) === null || _a === void 0 ? void 0 : _a.remove(); - this.element.classList.remove("wb-initializing"); - }); - } - else { - readyDeferred.resolve(); - } - // Async mode is sometimes required, because this.element.clientWidth - // has a wrong value at start??? - this.update(ChangeType.any); - // --- Bind listeners - this.element.addEventListener("scroll", (e) => { - // this.log(`scroll, scrollTop:${e.target.scrollTop}`, e); - this.update(ChangeType.scroll); - }); - this.resizeObserver = new ResizeObserver((entries) => { - // this.log("ResizeObserver: Size changed", entries); - this.update(ChangeType.resize); - }); - this.resizeObserver.observe(this.element); - onEvent(this.nodeListElement, "click", "div.wb-row", (e) => { - const info = Wunderbaum.getEventInfo(e); - const node = info.node; - const mouseEvent = e; - // this.log("click", info); - // if (this._selectRange(info) === false) { - // return; - // } - if (this._callEvent("click", { event: e, node: node, info: info }) === false) { - this.lastClickTime = Date.now(); - return false; - } - if (node) { - if (mouseEvent.ctrlKey) { - node.toggleSelected(); - return; - } - // Edit title if 'clickActive' is triggered: - const trigger = this.getOption("edit.trigger"); - const slowClickDelay = this.getOption("edit.slowClickDelay"); - if (trigger.indexOf("clickActive") >= 0 && - info.region === "title" && - node.isActive() && - (!slowClickDelay || Date.now() - this.lastClickTime < slowClickDelay)) { - this._callMethod("edit.startEditTitle", node); - } - if (info.colIdx >= 0) { - node.setActive(true, { colIdx: info.colIdx, event: e }); - } - else { - node.setActive(true, { event: e }); - } - if (info.region === NodeRegion.expander) { - node.setExpanded(!node.isExpanded(), { - scrollIntoView: options.scrollIntoViewOnExpandClick !== false, - }); - } - else if (info.region === NodeRegion.checkbox) { - node.toggleSelected(); - } - } - this.lastClickTime = Date.now(); - }); - onEvent(this.nodeListElement, "dblclick", "div.wb-row", (e) => { - const info = Wunderbaum.getEventInfo(e); - const node = info.node; - // this.log("dblclick", info, e); - if (this._callEvent("dblclick", { event: e, node: node, info: info }) === - false) { - return false; - } - if (node && info.colIdx === 0 && node.isExpandable()) { - this._callMethod("edit._stopEditTitle"); - node.setExpanded(!node.isExpanded()); - } - }); - onEvent(this.element, "keydown", (e) => { - const info = Wunderbaum.getEventInfo(e); - const eventName = eventToString(e); - const node = info.node || this.getFocusNode(); - this._callHook("onKeyEvent", { - event: e, - node: node, - info: info, - eventName: eventName, - }); - }); - onEvent(this.element, "focusin focusout", (e) => { - const flag = e.type === "focusin"; - const targetNode = Wunderbaum.getNode(e); - this._callEvent("focus", { flag: flag, event: e }); - if (flag && this.isRowNav() && !this.isEditing()) { - if (opts.navigationModeOption === NavModeEnum.row) { - targetNode === null || targetNode === void 0 ? void 0 : targetNode.setActive(); - } - else { - this.setCellNav(); - } - } - if (!flag) { - this._callMethod("edit._stopEditTitle", true, { - event: e, - forceClose: true, - }); - } - }); - } - /** - * Return a Wunderbaum instance, from element, id, index, or event. - * - * ```js - * getTree(); // Get first Wunderbaum instance on page - * getTree(1); // Get second Wunderbaum instance on page - * getTree(event); // Get tree for this mouse- or keyboard event - * getTree("foo"); // Get tree for this `tree.options.id` - * getTree("#tree"); // Get tree for this matching element - * ``` - */ - static getTree(el) { - if (el instanceof Wunderbaum) { - return el; - } - else if (el instanceof WunderbaumNode) { - return el.tree; - } - if (el === undefined) { - el = 0; // get first tree - } - if (typeof el === "number") { - el = document.querySelectorAll(".wunderbaum")[el]; // el was an integer: return nth element - } - else if (typeof el === "string") { - // Search all trees for matching ID - for (const treeElem of document.querySelectorAll(".wunderbaum")) { - const tree = treeElem._wb_tree; - if (tree && tree.id === el) { - return tree; - } - } - // Search by selector - el = document.querySelector(el); - if (!el) { - return null; - } - } - else if (el.target) { - el = el.target; - } - assert(el instanceof Element, `Invalid el type: ${el}`); - if (!el.matches(".wunderbaum")) { - el = el.closest(".wunderbaum"); - } - if (el && el._wb_tree) { - return el._wb_tree; - } - return null; - } - /** - * Return the icon-function -> icon-definition mapping. - */ - get iconMap() { - const map = this.options.iconMap; - if (typeof map === "string") { - return iconMaps[map]; - } - return map; - } - /** - * Return a WunderbaumNode instance from element or event. - */ - static getNode(el) { - if (!el) { - return null; - } - else if (el instanceof WunderbaumNode) { - return el; - } - else if (el.target !== undefined) { - el = el.target; // el was an Event - } - // `el` is a DOM element - // let nodeElem = obj.closest("div.wb-row"); - while (el) { - if (el._wb_node) { - return el._wb_node; - } - el = el.parentElement; //.parentNode; - } - return null; - } - /** - * Iterate all descendant nodes depth-first, pre-order using `for ... of ...` syntax. - * More concise, but slightly slower than {@link Wunderbaum.visit}. - * - * Example: - * ```js - * for(const node of tree) { - * ... - * } - * ``` - */ - *[Symbol.iterator]() { - yield* this.root; - } - /** @internal */ - _registerExtension(extension) { - this.extensionList.push(extension); - this.extensions[extension.id] = extension; - // this.extensionMap.set(extension.id, extension); - } - /** Called on tree (re)init after markup is created, before loading. */ - _initExtensions() { - for (const ext of this.extensionList) { - ext.init(); - } - } - /** Add node to tree's bookkeeping data structures. */ - _registerNode(node) { - const key = node.key; - assert(key != null && !this.keyMap.has(key), `Missing or duplicate key: '${key}'.`); - this.keyMap.set(key, node); - const rk = node.refKey; - if (rk) { - const rks = this.refKeyMap.get(rk); // Set of nodes with this refKey - if (rks) { - rks.add(node); - } - else { - this.refKeyMap.set(rk, new Set()); - } - } - } - /** Remove node from tree's bookkeeping data structures. */ - _unregisterNode(node) { - const rk = node.refKey; - if (rk) { - const rks = this.refKeyMap.get(rk); - if (rks && rks.delete(node) && !rks.size) { - // We just removed the last element - this.refKeyMap.delete(rk); - } - } - // mark as disposed - node.tree = null; - node.parent = null; - // node.title = "DISPOSED: " + node.title - // this.viewNodes.delete(node); - node.removeMarkup(); - } - /** Call all hook methods of all registered extensions.*/ - _callHook(hook, data = {}) { - let res; - const d = extend({}, { tree: this, options: this.options, result: undefined }, data); - for (const ext of this.extensionList) { - res = ext[hook].call(ext, d); - if (res === false) { - break; - } - if (d.result !== undefined) { - res = d.result; - } - } - return res; - } - /** - * Call tree method or extension method if defined. - * - * Example: - * ```js - * tree._callMethod("edit.startEdit", "arg1", "arg2") - * ``` - */ - _callMethod(name, ...args) { - const [p, n] = name.split("."); - const obj = n ? this.extensions[p] : this; - const func = obj[n]; - if (func) { - return func.apply(obj, args); - } - else { - this.logError(`Calling undefined method '${name}()'.`); - } - } - /** - * Call event handler if defined in tree or tree.EXTENSION options. - * - * Example: - * ```js - * tree._callEvent("edit.beforeEdit", {foo: 42}) - * ``` - */ - _callEvent(type, extra) { - const [p, n] = type.split("."); - const opts = this.options; - const func = n ? opts[p][n] : opts[p]; - if (func) { - return func.call(this, extend({ type: type, tree: this, util: this._util }, extra)); - // } else { - // this.logError(`Triggering undefined event '${type}'.`) - } - } - /** Return the node for given row index. */ - _getNodeByRowIdx(idx) { - // TODO: start searching from active node (reverse) - let node = null; - this.visitRows((n) => { - if (n._rowIdx === idx) { - node = n; - return false; - } - }); - return node; - } - /** Return the topmost visible node in the viewport. */ - getTopmostVpNode(complete = true) { - const gracePx = 1; // ignore subpixel scrolling - const scrollParent = this.element; - // const headerHeight = this.headerElement.clientHeight; // May be 0 - const scrollTop = scrollParent.scrollTop; // + headerHeight; - let topIdx; - if (complete) { - topIdx = Math.ceil((scrollTop - gracePx) / ROW_HEIGHT); - } - else { - topIdx = Math.floor(scrollTop / ROW_HEIGHT); - } - return this._getNodeByRowIdx(topIdx); - } - /** Return the lowest visible node in the viewport. */ - getLowestVpNode(complete = true) { - const scrollParent = this.element; - const headerHeight = this.headerElement.clientHeight; // May be 0 - const scrollTop = scrollParent.scrollTop; - const clientHeight = scrollParent.clientHeight - headerHeight; - let bottomIdx; - if (complete) { - bottomIdx = Math.floor((scrollTop + clientHeight) / ROW_HEIGHT) - 1; - } - else { - bottomIdx = Math.ceil((scrollTop + clientHeight) / ROW_HEIGHT) - 1; - } - bottomIdx = Math.min(bottomIdx, this.count(true) - 1); - return this._getNodeByRowIdx(bottomIdx); - } - /** Return preceeding visible node in the viewport. */ - _getPrevNodeInView(node, ofs = 1) { - this.visitRows((n) => { - node = n; - if (ofs-- <= 0) { - return false; - } - }, { reverse: true, start: node || this.getActiveNode() }); - return node; - } - /** Return following visible node in the viewport. */ - _getNextNodeInView(node, ofs = 1) { - this.visitRows((n) => { - node = n; - if (ofs-- <= 0) { - return false; - } - }, { reverse: false, start: node || this.getActiveNode() }); - return node; - } - /** - * Append (or insert) a list of toplevel nodes. - * - * @see {@link WunderbaumNode.addChildren} - */ - addChildren(nodeData, options) { - return this.root.addChildren(nodeData, options); - } - /** - * Apply a modification or navigation operation. - * - * Most of these commands simply map to a node or tree method. - * This method is especially useful when implementing keyboard mapping, - * context menus, or external buttons. - * - * Valid commands: - * - 'moveUp', 'moveDown' - * - 'indent', 'outdent' - * - 'remove' - * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension) - * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard') - * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate - * - */ - applyCommand(cmd, nodeOrOpts, options) { - let // clipboard, - node, refNode; - // options = $.extend( - // { setActive: true, clipboard: CLIPBOARD }, - // options_ - // ); - if (nodeOrOpts instanceof WunderbaumNode) { - node = nodeOrOpts; - } - else { - node = this.getActiveNode(); - assert(options === undefined, `Unexpected options: ${options}`); - options = nodeOrOpts; - } - // clipboard = options.clipboard; - switch (cmd) { - // Sorting and indentation: - case "moveUp": - refNode = node.getPrevSibling(); - if (refNode) { - node.moveTo(refNode, "before"); - node.setActive(); - } - break; - case "moveDown": - refNode = node.getNextSibling(); - if (refNode) { - node.moveTo(refNode, "after"); - node.setActive(); - } - break; - case "indent": - refNode = node.getPrevSibling(); - if (refNode) { - node.moveTo(refNode, "appendChild"); - refNode.setExpanded(); - node.setActive(); - } - break; - case "outdent": - if (!node.isTopLevel()) { - node.moveTo(node.getParent(), "after"); - node.setActive(); - } - break; - // Remove: - case "remove": - refNode = node.getPrevSibling() || node.getParent(); - node.remove(); - if (refNode) { - refNode.setActive(); - } - break; - // Add, edit (requires ext-edit): - case "addChild": - this._callMethod("edit.createNode", "prependChild"); - break; - case "addSibling": - this._callMethod("edit.createNode", "after"); - break; - case "rename": - this._callMethod("edit.startEditTitle"); - break; - // Simple clipboard simulation: - // case "cut": - // clipboard = { mode: cmd, data: node }; - // break; - // case "copy": - // clipboard = { - // mode: cmd, - // data: node.toDict(function(d, n) { - // delete d.key; - // }), - // }; - // break; - // case "clear": - // clipboard = null; - // break; - // case "paste": - // if (clipboard.mode === "cut") { - // // refNode = node.getPrevSibling(); - // clipboard.data.moveTo(node, "child"); - // clipboard.data.setActive(); - // } else if (clipboard.mode === "copy") { - // node.addChildren(clipboard.data).setActive(); - // } - // break; - // Navigation commands: - case "down": - case "first": - case "last": - case "left": - case "pageDown": - case "pageUp": - case "parent": - case "right": - case "up": - return node.navigate(cmd); - default: - error(`Unhandled command: '${cmd}'`); - } - } - /** Delete all nodes. */ - clear() { - this.root.removeChildren(); - this.root.children = null; - this.keyMap.clear(); - this.refKeyMap.clear(); - // this.viewNodes.clear(); - this.treeRowCount = 0; - this.activeNode = null; - this.focusNode = null; - // this.types = {}; - // this. columns =[]; - // this._columnsById = {}; - // Modification Status - // this.changedSince = 0; - // this.changes.clear(); - // this.changedNodes.clear(); - // // --- FILTER --- - // public filterMode: FilterModeType = null; - // // --- KEYNAV --- - // public activeColIdx = 0; - // public cellNavMode = false; - // public lastQuicksearchTime = 0; - // public lastQuicksearchTerm = ""; - this.update(ChangeType.structure); - } - /** - * Clear nodes and markup and detach events and observers. - * - * This method may be useful to free up resources before re-creating a tree - * on an existing div, for example in unittest suites. - * Note that this Wunderbaum instance becomes unusable afterwards. - */ - destroy() { - this.logInfo("destroy()..."); - this.clear(); - this.resizeObserver.disconnect(); - this.element.innerHTML = ""; - // Remove all event handlers - this.element.outerHTML = this.element.outerHTML; // eslint-disable-line - } - /** - * Return `tree.option.NAME` (also resolving if this is a callback). - * - * See also {@link WunderbaumNode.getOption|WunderbaumNode.getOption()} - * to evaluate `node.NAME` setting and `tree.types[node.type].NAME`. - * - * @param name option name (use dot notation to access extension option, e.g. - * `filter.mode`) - */ - getOption(name, defaultValue) { - let ext; - let opts = this.options; - // Lookup `name` in options dict - if (name.indexOf(".") >= 0) { - [ext, name] = name.split("."); - opts = opts[ext]; - } - let value = opts[name]; - // A callback resolver always takes precedence - if (typeof value === "function") { - value = value({ type: "resolve", tree: this }); - } - // Use value from value options dict, fallback do default - // console.info(name, value, opts) - return value !== null && value !== void 0 ? value : defaultValue; - } - /** - * Set tree option. - * Use dot notation to set plugin option, e.g. "filter.mode". - */ - setOption(name, value) { - // this.log(`setOption(${name}, ${value})`); - if (name.indexOf(".") >= 0) { - const parts = name.split("."); - const ext = this.extensions[parts[0]]; - ext.setPluginOption(parts[1], value); - return; - } - this.options[name] = value; - switch (name) { - case "checkbox": - this.update(ChangeType.any); - break; - case "enabled": - this.setEnabled(!!value); - break; - case "fixedCol": - this.element.classList.toggle("wb-fixed-col", !!value); - break; - } - } - /** Return true if the tree (or one of its nodes) has the input focus. */ - hasFocus() { - return this.element.contains(document.activeElement); - } - /** - * Return true if the tree displays a header. Grids have a header unless the - * `header` option is set to `false`. Plain trees have a header if the `header` - * option is a string or `true`. - */ - hasHeader() { - const header = this.options.header; - return this.isGrid() ? header !== false : !!header; - } - /** Run code, but defer rendering of viewport until done. - * - * ``` - * tree.runWithDeferredUpdate(() => { - * return someFuncThatWouldUpdateManyNodes(); - * }); - * ``` - */ - runWithDeferredUpdate(func, hint = null) { - try { - this.enableUpdate(false); - const res = func(); - assert(!(res instanceof Promise), `Promise return not allowed: ${res}`); - return res; - } - finally { - this.enableUpdate(true); - } - } - /** Recursively expand all expandable nodes (triggers lazy load if needed). */ - async expandAll(flag = true, options) { - await this.root.expandAll(flag, options); - } - /** Recursively select all nodes. */ - selectAll(flag = true) { - return this.root.setSelected(flag, { propagateDown: true }); - } - /** Toggle select all nodes. */ - toggleSelect() { - this.selectAll(this.root._anySelectable()); - } - /** - * Return an array of selected nodes. - * @param stopOnParents only return the topmost selected node (useful with selectMode 'hier') - */ - getSelectedNodes(stopOnParents = false) { - return this.root.getSelectedNodes(stopOnParents); - } - /* - * Return an array of selected nodes. - */ - _selectRange(eventInfo) { - this.logDebug("_selectRange", eventInfo); - error("Not yet implemented."); - // const mode = this.options.selectMode!; - // if (mode !== "multi") { - // this.logDebug(`Range selection only available for selectMode 'multi'`); - // return; - // } - // if (eventInfo.canonicalName === "Meta+click") { - // eventInfo.node?.toggleSelected(); - // return false; // don't - // } else if (eventInfo.canonicalName === "Shift+click") { - // let from = this.activeNode; - // let to = eventInfo.node; - // if (!from || !to || from === to) { - // return; - // } - // this.runWithDeferredUpdate(() => { - // this.visitRows( - // (node) => { - // node.setSelected(); - // }, - // { - // includeHidden: true, - // includeSelf: false, - // start: from, - // reverse: from!._rowIdx! > to!._rowIdx!, - // } - // ); - // }); - // return false; - // } - } - /** Return the number of nodes in the data model. - * @param visible if true, nodes that are hidden due to collapsed parents are ignored. - */ - count(visible = false) { - return visible ? this.treeRowCount : this.keyMap.size; - } - /** @internal sanity check. */ - _check() { - let i = 0; - this.visit((n) => { - i++; - }); - if (this.keyMap.size !== i) { - this.logWarn(`_check failed: ${this.keyMap.size} !== ${i}`); - } - // util.assert(this.keyMap.size === i); - } - /** - * Find all nodes that match condition. - * - * @see {@link WunderbaumNode.findAll} - */ - findAll(match) { - return this.root.findAll(match); - } - /** - * Find first node that matches condition. - * - * @see {@link WunderbaumNode.findFirst} - */ - findFirst(match) { - return this.root.findFirst(match); - } - /** - * Find first node that matches condition. - * - * @param match title string to search for, or a - * callback function that returns `true` if a node is matched. - * @see {@link WunderbaumNode.findFirst} - * - */ - findKey(key) { - return this.keyMap.get(key) || null; - } - /** - * Find the next visible node that starts with `match`, starting at `startNode` - * and wrap-around at the end. - */ - findNextNode(match, startNode) { - //, visibleOnly) { - let res = null; - const firstNode = this.getFirstChild(); - const matcher = typeof match === "string" ? makeNodeTitleStartMatcher(match) : match; - startNode = startNode || firstNode; - function _checkNode(n) { - // console.log("_check " + n) - if (matcher(n)) { - res = n; - } - if (res || n === startNode) { - return false; - } - } - this.visitRows(_checkNode, { - start: startNode, - includeSelf: false, - }); - // Wrap around search - if (!res && startNode !== firstNode) { - this.visitRows(_checkNode, { - start: firstNode, - includeSelf: true, - }); - } - return res; - } - /** - * Find a node relative to another node. - * - * @param node - * @param where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'. - * (Alternatively the keyCode that would normally trigger this move, - * e.g. `$.ui.keyCode.LEFT` = 'left'. - * @param includeHidden Not yet implemented - */ - findRelatedNode(node, where, includeHidden = false) { - let res = null; - const pageSize = Math.floor(this.listContainerElement.clientHeight / ROW_HEIGHT); - switch (where) { - case "parent": - if (node.parent && node.parent.parent) { - res = node.parent; - } - break; - case "first": - // First visible node - this.visit((n) => { - if (n.isVisible()) { - res = n; - return false; - } - }); - break; - case "last": - this.visit((n) => { - // last visible node - if (n.isVisible()) { - res = n; - } - }); - break; - case "left": - if (node.parent && node.parent.parent) { - res = node.parent; - } - // if (node.expanded) { - // node.setExpanded(false); - // } else if (node.parent && node.parent.parent) { - // res = node.parent; - // } - break; - case "right": - if (node.children && node.children.length) { - res = node.children[0]; - } - // if (this.cellNavMode) { - // throw new Error("Not implemented"); - // } else { - // if (!node.expanded && (node.children || node.lazy)) { - // node.setExpanded(); - // res = node; - // } else if (node.children && node.children.length) { - // res = node.children[0]; - // } - // } - break; - case "up": - res = this._getPrevNodeInView(node); - break; - case "down": - res = this._getNextNodeInView(node); - break; - case "pageDown": - { - const bottomNode = this.getLowestVpNode(); - // this.logDebug(`${where}(${node}) -> ${bottomNode}`); - if (node._rowIdx < bottomNode._rowIdx) { - res = bottomNode; - } - else { - res = this._getNextNodeInView(node, pageSize); - } - } - break; - case "pageUp": - if (node._rowIdx === 0) { - res = node; - } - else { - const topNode = this.getTopmostVpNode(); - // this.logDebug(`${where}(${node}) -> ${topNode}`); - if (node._rowIdx > topNode._rowIdx) { - res = topNode; - } - else { - res = this._getPrevNodeInView(node, pageSize); - } - } - break; - default: - this.logWarn("Unknown relation '" + where + "'."); - } - return res; - } - /** - * Iterator version of {@link Wunderbaum.format}. - */ - *format_iter(name_cb, connectors) { - yield* this.root.format_iter(name_cb, connectors); - } - /** - * Return multiline string representation of the node hierarchy. - * Mostly useful for debugging. - * - * Example: - * ```js - * console.info(tree.format((n)=>n.title)); - * ``` - * logs - * ``` - * Playground - * ├─ Books - * | ├─ Art of War - * | ╰─ Don Quixote - * ├─ Music - * ... - * ``` - * - * @see {@link Wunderbaum.format_iter} and {@link WunderbaumNode.format}. - */ - format(name_cb, connectors) { - return this.root.format(name_cb, connectors); - } - /** - * Return the active cell (`span.wb-col`) of the currently active node or null. - */ - getActiveColElem() { - if (this.activeNode && this.activeColIdx >= 0) { - return this.activeNode.getColElem(this.activeColIdx); - } - return null; - } - /** - * Return the currently active node or null. - */ - getActiveNode() { - return this.activeNode; - } - /** - * Return the first top level node if any (not the invisible root node). - */ - getFirstChild() { - return this.root.getFirstChild(); - } - /** - * Return the currently active node or null. - */ - getFocusNode() { - return this.focusNode; - } - /** Return a {node: WunderbaumNode, region: TYPE} object for a mouse event. - * - * @param {Event} event Mouse event, e.g. click, ... - * @returns {object} Return a {node: WunderbaumNode, region: TYPE} object - * TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined - */ - static getEventInfo(event) { - const target = event.target; - const cl = target.classList; - const parentCol = target.closest("span.wb-col"); - const node = Wunderbaum.getNode(target); - const tree = node ? node.tree : Wunderbaum.getTree(event); - const res = { - event: event, - canonicalName: eventToString(event), - tree: tree, - node: node, - region: NodeRegion.unknown, - colDef: undefined, - colIdx: -1, - colId: undefined, - colElem: parentCol, - }; - if (cl.contains("wb-title")) { - res.region = NodeRegion.title; - } - else if (cl.contains("wb-expander")) { - res.region = node.isExpandable() - ? NodeRegion.expander - : NodeRegion.prefix; - } - else if (cl.contains("wb-checkbox")) { - res.region = NodeRegion.checkbox; - } - else if (cl.contains("wb-icon")) { - //|| cl.contains("wb-custom-icon")) { - res.region = NodeRegion.icon; - } - else if (cl.contains("wb-node")) { - res.region = NodeRegion.title; - } - else if (parentCol) { - res.region = NodeRegion.column; - const idx = Array.prototype.indexOf.call(parentCol.parentNode.children, parentCol); - res.colIdx = idx; - } - else if (cl.contains("wb-row")) { - // Plain tree - res.region = NodeRegion.title; - } - else { - // Somewhere near the title - if (event.type !== "mousemove" && !(event instanceof KeyboardEvent)) { - tree === null || tree === void 0 ? void 0 : tree.logWarn("getEventInfo(): not found", event, res); - } - return res; - } - if (res.colIdx === -1) { - res.colIdx = 0; - } - res.colDef = tree === null || tree === void 0 ? void 0 : tree.columns[res.colIdx]; - res.colDef != null ? (res.colId = res.colDef.id) : 0; - // this.log("Event", event, res); - return res; - } - /** - * Return readable string representation for this instance. - * @internal - */ - toString() { - return `Wunderbaum<'${this.id}'>`; - } - /** Return true if any node is currently in edit-title mode. */ - isEditing() { - return this._callMethod("edit.isEditingTitle"); - } - /** - * Return true if any node is currently beeing loaded, i.e. a Ajax request is pending. - */ - isLoading() { - let res = false; - this.root.visit((n) => { - // also visit rootNode - if (n._isLoading || n._requestId) { - res = true; - return false; - } - }, true); - return res; - } - /** Log to console if opts.debugLevel >= 4 */ - logDebug(...args) { - if (this.options.debugLevel >= 4) { - console.log(this.toString(), ...args); // eslint-disable-line no-console - } - } - /** Log error to console. */ - logError(...args) { - if (this.options.debugLevel >= 1) { - console.error(this.toString(), ...args); // eslint-disable-line no-console - } - } - /** Log to console if opts.debugLevel >= 3 */ - logInfo(...args) { - if (this.options.debugLevel >= 3) { - console.info(this.toString(), ...args); // eslint-disable-line no-console - } - } - /** @internal */ - logTime(label) { - if (this.options.debugLevel >= 4) { - console.time(this + ": " + label); // eslint-disable-line no-console - } - return label; - } - /** @internal */ - logTimeEnd(label) { - if (this.options.debugLevel >= 4) { - console.timeEnd(this + ": " + label); // eslint-disable-line no-console - } - } - /** Log to console if opts.debugLevel >= 2 */ - logWarn(...args) { - if (this.options.debugLevel >= 2) { - console.warn(this.toString(), ...args); // eslint-disable-line no-console - } - } - /** - * Make sure that this node is vertically scrolled into the viewport. - * - * Nodes that are above the visible area become the top row, nodes that are - * below the viewport become the bottom row. - */ - scrollTo(nodeOrOpts) { - const PADDING = 2; // leave some pixels between viewport bounds - let node; - let options; - if (nodeOrOpts instanceof WunderbaumNode) { - node = nodeOrOpts; - } - else { - options = nodeOrOpts; - node = options.node; - } - assert(node && node._rowIdx != null, `Invalid node: ${node}`); - const scrollParent = this.element; - const headerHeight = this.headerElement.clientHeight; // May be 0 - const scrollTop = scrollParent.scrollTop; - const vpHeight = scrollParent.clientHeight; - const rowTop = node._rowIdx * ROW_HEIGHT + headerHeight; - const vpTop = headerHeight; - const vpRowTop = rowTop - scrollTop; - const vpRowBottom = vpRowTop + ROW_HEIGHT; - const topNode = options === null || options === void 0 ? void 0 : options.topNode; - // this.log( `scrollTo(${node.title}), vpTop:${vpTop}px, scrollTop:${scrollTop}, vpHeight:${vpHeight}, rowTop:${rowTop}, vpRowTop:${vpRowTop}`, nodeOrOpts , options); - let newScrollTop = null; - if (vpRowTop >= vpTop) { - if (vpRowBottom <= vpHeight) ; - else { - // Node is below viewport - // this.log("Below viewport"); - newScrollTop = rowTop + ROW_HEIGHT - vpHeight + PADDING; // leave some pixels between viewport bounds - } - } - else { - // Node is above viewport - // this.log("Above viewport"); - newScrollTop = rowTop - vpTop - PADDING; // leave some pixels between viewport bounds - } - if (newScrollTop != null) { - this.log(`scrollTo(${rowTop}): ${scrollTop} => ${newScrollTop}`); - scrollParent.scrollTop = newScrollTop; - if (topNode) { - // Make sure the topNode is always visible - this.scrollTo(topNode); - } - // this.update(ChangeType.scroll); - } - } - /** - * Make sure that this node is horizontally scrolled into the viewport. - * Called by {@link setColumn}. - */ - scrollToHorz() { - // const PADDING = 1; - const fixedWidth = this.columns[0]._widthPx; - const vpWidth = this.element.clientWidth; - const scrollLeft = this.element.scrollLeft; - const colElem = this.getActiveColElem(); - const colLeft = Number.parseInt(colElem === null || colElem === void 0 ? void 0 : colElem.style.left, 10); - const colRight = colLeft + Number.parseInt(colElem === null || colElem === void 0 ? void 0 : colElem.style.width, 10); - let newLeft = scrollLeft; - if (colLeft - scrollLeft < fixedWidth) { - // The current column is scrolled behind the left fixed column - newLeft = colLeft - fixedWidth; - } - else if (colRight - scrollLeft > vpWidth) { - // The current column is scrolled outside the right side - newLeft = colRight - vpWidth; - } - newLeft = Math.max(0, newLeft); - // util.assert(node._rowIdx != null); - this.log(`scrollToHorz(${this.activeColIdx}): ${colLeft}..${colRight}, fixedOfs=${fixedWidth}, vpWidth=${vpWidth}, curLeft=${scrollLeft} -> ${newLeft}`); - this.element.scrollLeft = newLeft; - // this.update(ChangeType.scroll); - } - /** - * Set column #colIdx to 'active'. - * - * This higlights the column header and -cells by adding the `wb-active` class. - * Available in cell-nav mode only. - */ - setColumn(colIdx) { - var _a; - assert(this.isCellNav(), "Exected cellNav mode"); - assert(0 <= colIdx && colIdx < this.columns.length, `Invalid colIdx: ${colIdx}`); - this.activeColIdx = colIdx; - // Update `wb-active` class for all headers - if (this.hasHeader()) { - for (const rowDiv of this.headerElement.children) { - let i = 0; - for (const colDiv of rowDiv.children) { - colDiv.classList.toggle("wb-active", i++ === colIdx); - } - } - } - (_a = this.activeNode) === null || _a === void 0 ? void 0 : _a.update(ChangeType.status); - // Update `wb-active` class for all cell spans - for (const rowDiv of this.nodeListElement.children) { - let i = 0; - for (const colDiv of rowDiv.children) { - colDiv.classList.toggle("wb-active", i++ === colIdx); - } - } - // Vertical scroll into view - // if (this.options.fixedCol) { - this.scrollToHorz(); - // } - } - /** Set or remove keybaord focus to the tree container. */ - setActiveNode(key, flag = true, options) { - var _a; - (_a = this.findKey(key)) === null || _a === void 0 ? void 0 : _a.setActive(flag, options); - } - /** Set or remove keybaord focus to the tree container. */ - setFocus(flag = true) { - if (flag) { - this.element.focus(); - } - else { - this.element.blur(); - } - } - update(change, node, options) { - if (this._disableUpdateCount) { - // Assuming that we redraw all when enableUpdate() is re-enabled. - // this.log( - // `IGNORED update(${change}) node=${node} (disable level ${this._disableUpdateCount})` - // ); - this._disableUpdateIgnoreCount++; - return; - } - // this.log(`update(${change}) node=${node}`); - if (!(node instanceof WunderbaumNode)) { - options = node; - node = null; - } - const immediate = !!getOption(options, "immediate"); - const RF = RenderFlag; - const pending = this.pendingChangeTypes; - switch (change) { - case ChangeType.any: - case ChangeType.colStructure: - pending.add(RF.header); - pending.add(RF.clearMarkup); - pending.add(RF.redraw); - pending.add(RF.scroll); - break; - case ChangeType.resize: - // case ChangeType.colWidth: - pending.add(RF.header); - pending.add(RF.redraw); - break; - case ChangeType.structure: - pending.add(RF.redraw); - break; - case ChangeType.scroll: - pending.add(RF.scroll); - break; - case ChangeType.row: - case ChangeType.data: - case ChangeType.status: - assert(node, `Option '${change}' requires a node.`); - // Single nodes are immediately updated if already inside the viewport - // (otherwise we can ignore) - if (node._rowElem) { - node._render({ change: change }); - } - break; - default: - error(`Invalid change type '${change}'.`); - } - if (change === ChangeType.colStructure) { - const isGrid = this.isGrid(); - this.element.classList.toggle("wb-grid", isGrid); - if (!isGrid && this.isCellNav()) { - this.setCellNav(false); - } - } - if (pending.size > 0) { - if (immediate) { - this._updateViewportImmediately(); - } - else { - this._updateViewportThrottled(); - } - } - } - /** Disable mouse and keyboard interaction (return prev. state). */ - setEnabled(flag = true) { - const prev = this.enabled; - this.enabled = !!flag; - this.element.classList.toggle("wb-disabled", !flag); - return prev; - } - /** Return false if tree is disabled. */ - isEnabled() { - return this.enabled; - } - /** Return true if tree has more than one column, i.e. has additional data columns. */ - isGrid() { - return this.columns && this.columns.length > 1; - } - /** Return true if cell-navigation mode is active. */ - isCellNav() { - return !!this._cellNavMode; - } - /** Return true if row-navigation mode is active. */ - isRowNav() { - return !this._cellNavMode; - } - /** Set the tree's navigation mode. */ - setCellNav(flag = true) { - var _a; - const prev = this._cellNavMode; - // if (flag === prev) { - // return; - // } - this._cellNavMode = !!flag; - if (flag && !prev) { - // switch from row to cell mode - this.setColumn(0); - } - this.element.classList.toggle("wb-cell-mode", flag); - (_a = this.activeNode) === null || _a === void 0 ? void 0 : _a.update(ChangeType.status); - } - /** Set the tree's navigation mode option. */ - setNavigationOption(mode, reset = false) { - if (!this.isGrid() && mode !== NavModeEnum.row) { - this.logWarn("Plain trees only support row navigation mode."); - return; - } - this.options.navigationModeOption = mode; - switch (mode) { - case NavModeEnum.cell: - this.setCellNav(true); - break; - case NavModeEnum.row: - this.setCellNav(false); - break; - case NavModeEnum.startCell: - if (reset) { - this.setCellNav(true); - } - break; - case NavModeEnum.startRow: - if (reset) { - this.setCellNav(false); - } - break; - default: - error(`Invalid mode '${mode}'.`); - } - } - /** Display tree status (ok, loading, error, noData) using styles and a dummy root node. */ - setStatus(status, options) { - return this.root.setStatus(status, options); - } - /** Add or redefine node type definitions. */ - setTypes(types, replace = true) { - assert(isPlainObject(types), `Expected plain objext: ${types}`); - if (replace) { - this.types = types; - } - else { - extend(this.types, types); - } - // Convert `TYPE.classes` to a Set - for (const t of Object.values(this.types)) { - if (t.classes) { - t.classes = toSet(t.classes); - } - } - } - /** - * Sort nodes list by title or custom criteria. - * @param {function} cmp custom compare function(a, b) that returns -1, 0, or 1 - * (defaults to sorting by title). - * @param {boolean} deep pass true to sort all descendant nodes recursively - */ - sortChildren(cmp = nodeTitleSorter, deep = false) { - this.root.sortChildren(cmp, deep); - } - /** Convert tree to an array of plain objects. - * - * @param callback(dict, node) is called for every node, in order to allow - * modifications. - * Return `false` to ignore this node or `"skip"` to include this node - * without its children. - * @see {@link WunderbaumNode.toDict}. - */ - toDictArray(callback) { - var _a; - const res = this.root.toDict(true, callback); - return (_a = res.children) !== null && _a !== void 0 ? _a : []; - } - /** - * Update column headers and column width. - * Return true if at least one column width changed. - */ - // _updateColumnWidths(options?: UpdateColumnsOptions): boolean { - _updateColumnWidths() { - // options = Object.assign({ updateRows: true, renderMarkup: false }, options); - const defaultMinWidth = 4; - const vpWidth = this.element.clientWidth; - // Shorten last column width to avoid h-scrollbar - // (otherwise resizbing the demo would display a void scrollbar?) - const FIX_ADJUST_LAST_COL = 1; - const columns = this.columns; - const col0 = columns[0]; - let totalWidth = 0; - let totalWeight = 0; - let fixedWidth = 0; - let modified = false; - // this.element.classList.toggle("wb-grid", isGrid); - // if (!isGrid && this.isCellNav()) { - // this.setCellNav(false); - // } - // if (options.calculateCols) { - if (col0.id !== "*") { - throw new Error(`First column must have id '*': got '${col0.id}'.`); - } - // Gather width definitions - this._columnsById = {}; - for (const col of columns) { - this._columnsById[col.id] = col; - const cw = col.width; - if (col.id === "*" && col !== col0) { - throw new Error(`Column id '*' must be defined only once: '${col.title}'.`); - } - if (!cw || cw === "*") { - col._weight = 1.0; - totalWeight += 1.0; - } - else if (typeof cw === "number") { - col._weight = cw; - totalWeight += cw; - } - else if (typeof cw === "string" && cw.endsWith("px")) { - col._weight = 0; - const px = parseFloat(cw.slice(0, -2)); - if (col._widthPx != px) { - modified = true; - col._widthPx = px; - } - fixedWidth += px; - } - else { - error(`Invalid column width: ${cw} (expected string ending with 'px' or number, e.g. "px" or ).`); - } - } - // Share remaining space between non-fixed columns - const restPx = Math.max(0, vpWidth - fixedWidth); - let ofsPx = 0; - for (const col of columns) { - let minWidth; - if (col._weight) { - const cmw = col.minWidth; - if (typeof cmw === "number") { - minWidth = cmw; - } - else if (typeof cmw === "string" && cmw.endsWith("px")) { - minWidth = parseFloat(cmw.slice(0, -2)); - } - else { - minWidth = defaultMinWidth; - } - const px = Math.max(minWidth, (restPx * col._weight) / totalWeight); - if (col._widthPx != px) { - modified = true; - col._widthPx = px; - } - } - col._ofsPx = ofsPx; - ofsPx += col._widthPx; - } - columns[columns.length - 1]._widthPx -= FIX_ADJUST_LAST_COL; - totalWidth = ofsPx - FIX_ADJUST_LAST_COL; - const tw = `${totalWidth}px`; - this.headerElement.style.width = tw; - this.listContainerElement.style.width = tw; - // } - // Every column has now a calculated `_ofsPx` and `_widthPx` - // this.logInfo("UC", this.columns, vpWidth, this.element.clientWidth, this.element); - // console.trace(); - // util.error("BREAK"); - // if (modified) { - // this._renderHeaderMarkup(); - // if (options.renderMarkup) { - // this.update(ChangeType.header, { removeMarkup: true }); - // } else if (options.updateRows) { - // this._updateRows(); - // } - // } - return modified; - } - /** Create/update header markup from `this.columns` definition. - * @internal - */ - _renderHeaderMarkup() { - assert(this.headerElement, "Expected a headerElement"); - const wantHeader = this.hasHeader(); - setElemDisplay(this.headerElement, wantHeader); - if (!wantHeader) { - return; - } - const colCount = this.columns.length; - const headerRow = this.headerElement.querySelector(".wb-row"); - assert(headerRow, "Expected a row in header element"); - headerRow.innerHTML = "".repeat(colCount); - for (let i = 0; i < colCount; i++) { - const col = this.columns[i]; - const colElem = headerRow.children[i]; - colElem.style.left = col._ofsPx + "px"; - colElem.style.width = col._widthPx + "px"; - // Add classes from `columns` definition to `` cells - if (typeof col.headerClasses === "string") { - col.headerClasses - ? colElem.classList.add(...col.headerClasses.split(" ")) - : 0; - } - else { - col.classes ? colElem.classList.add(...col.classes.split(" ")) : 0; - } - const title = escapeHtml(col.title || col.id); - let tooltip = ""; - if (col.tooltip) { - tooltip = escapeTooltip(col.tooltip); - tooltip = ` title="${tooltip}"`; - } - let resizer = ""; - if (i < colCount - 1) { - resizer = ''; - } - colElem.innerHTML = `${title}${resizer}`; - if (this.isCellNav()) { - colElem.classList.toggle("wb-active", i === this.activeColIdx); - } - } - } - /** - * Render pending changes that were scheduled using {@link WunderbaumNode.update} if any. - * - * This is hardly ever neccessary, since we normally either - * - call `update(ChangeType.TYPE)` (async, throttled), or - * - call `update(ChangeType.TYPE, {immediate: true})` (synchronous) - * - * `updatePendingModifications()` will only force immediate execution of - * pending async changes if any. - */ - updatePendingModifications() { - if (this.pendingChangeTypes.size > 0) { - this._updateViewportImmediately(); - } - } - /** - * This is the actual update method, which is wrapped inside a throttle method. - * It calls `updateColumns()` and `_updateRows()`. - * - * This protected method should not be called directly but via - * {@link WunderbaumNode.update}`, {@link Wunderbaum.update}, - * or {@link Wunderbaum.updatePendingModifications}. - * @internal - */ - _updateViewportImmediately() { - var _a; - if (this._disableUpdateCount) { - this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount})`); - this._disableUpdateIgnoreCount++; - return; - } - // Shorten container height to avoid v-scrollbar - const FIX_ADJUST_HEIGHT = 1; - const RF = RenderFlag; - const pending = new Set(this.pendingChangeTypes); - this.pendingChangeTypes.clear(); - const scrollOnly = pending.has(RF.scroll) && pending.size === 1; - if (scrollOnly) { - this._updateRows({ newNodesOnly: true }); - // this.log("_updateViewportImmediately(): scroll only."); - } - else { - this.log("_updateViewportImmediately():", pending); - if (this.options.adjustHeight !== false) { - let height = this.listContainerElement.clientHeight; - const headerHeight = this.headerElement.clientHeight; // May be 0 - const wantHeight = this.element.clientHeight - headerHeight - FIX_ADJUST_HEIGHT; - if (Math.abs(height - wantHeight) > 1.0) { - // this.log("resize", height, wantHeight); - this.listContainerElement.style.height = wantHeight + "px"; - height = wantHeight; - } - } - // console.profile(`_updateViewportImmediately()`) - if (pending.has(RF.clearMarkup)) { - this.visit((n) => { - n.removeMarkup(); - }); - } - // let widthModified = false; - if (pending.has(RF.header)) { - // widthModified = this._updateColumnWidths(); - this._updateColumnWidths(); - this._renderHeaderMarkup(); - } - this._updateRows(); - // console.profileEnd(`_updateViewportImmediately()`) - } - if (this.options.connectTopBreadcrumb) { - let path = (_a = this.getTopmostVpNode(true)) === null || _a === void 0 ? void 0 : _a.getPath(false, "title", " > "); - path = path ? path + " >" : ""; - this.options.connectTopBreadcrumb.textContent = path; - } - this._callEvent("update"); - } - // /** - // * Assert that TR order matches the natural node order - // * @internal - // */ - // protected _validateRows(): boolean { - // let trs = this.nodeListElement.childNodes; - // let i = 0; - // let prev = -1; - // let ok = true; - // trs.forEach((element) => { - // const tr = element as HTMLTableRowElement; - // const top = Number.parseInt(tr.style.top); - // const n = (tr)._wb_node; - // // if (i < 4) { - // // console.info( - // // `TR#${i}, rowIdx=${n._rowIdx} , top=${top}px: '${n.title}'` - // // ); - // // } - // if (prev >= 0 && top !== prev + ROW_HEIGHT) { - // n.logWarn( - // `TR order mismatch at index ${i}: top=${top}px != ${ - // prev + ROW_HEIGHT - // }` - // ); - // // throw new Error("fault"); - // ok = false; - // } - // prev = top; - // i++; - // }); - // return ok; - // } - /* - * - Traverse all *visible* nodes of the whole tree, i.e. skip collapsed nodes. - * - Store count of rows to `tree.treeRowCount`. - * - Renumber `node._rowIdx` for all visible nodes. - * - Calculate the index range that must be rendered to fill the viewport - * (including upper and lower prefetch) - * - - */ - _updateRows(options) { - // const label = this.logTime("_updateRows"); - // this.log("_updateRows", opts) - options = Object.assign({ newNodesOnly: false }, options); - const newNodesOnly = !!options.newNodesOnly; - const row_height = ROW_HEIGHT; - const vp_height = this.element.clientHeight; - const prefetch = RENDER_MAX_PREFETCH; - // const grace_prefetch = RENDER_MAX_PREFETCH - RENDER_MIN_PREFETCH; - const ofs = this.element.scrollTop; - let startIdx = Math.max(0, ofs / row_height - prefetch); - startIdx = Math.floor(startIdx); - // Make sure start is always even, so the alternating row colors don't - // change when scrolling: - if (startIdx % 2) { - startIdx--; - } - let endIdx = Math.max(0, (ofs + vp_height) / row_height + prefetch); - endIdx = Math.ceil(endIdx); - // const obsoleteViewNodes = this.viewNodes; - // this.viewNodes = new Set(); - // const viewNodes = this.viewNodes; - // this.debug("render", opts); - const obsoleteNodes = new Set(); - this.nodeListElement.childNodes.forEach((elem) => { - const tr = elem; - obsoleteNodes.add(tr._wb_node); - }); - let idx = 0; - let top = 0; - let modified = false; - let prevElem = "first"; - this.visitRows(function (node) { - // node.log("visit") - const rowDiv = node._rowElem; - // Renumber all expanded nodes - if (node._rowIdx !== idx) { - node._rowIdx = idx; - modified = true; - } - if (idx < startIdx || idx > endIdx) { - // row is outside viewport bounds - if (rowDiv) { - prevElem = rowDiv; - } - } - else if (rowDiv && newNodesOnly) { - obsoleteNodes.delete(node); - // no need to update existing node markup - rowDiv.style.top = idx * ROW_HEIGHT + "px"; - prevElem = rowDiv; - } - else { - obsoleteNodes.delete(node); - // Create new markup - if (rowDiv) { - rowDiv.style.top = idx * ROW_HEIGHT + "px"; - } - node._render({ top: top, after: prevElem }); - // node.log("render", top, prevElem, "=>", node._rowElem); - prevElem = node._rowElem; - } - idx++; - top += row_height; - }); - this.treeRowCount = idx; - for (const n of obsoleteNodes) { - n._callEvent("discard"); - n.removeMarkup(); - } - // Resize tree container - this.nodeListElement.style.height = `${top}px`; - // this.log( - // `_updateRows(scrollOfs:${ofs}, ${startIdx}..${endIdx})`, - // this.nodeListElement.style.height - // ); - // this.logTimeEnd(label); - // this._validateRows(); - return modified; - } - /** - * Call `callback(node)` for all nodes in hierarchical order (depth-first, pre-order). - * @see {@link IterableIterator}, {@link WunderbaumNode.visit}. - * - * @param {function} callback the callback function. - * Return false to stop iteration, return "skip" to skip this node and - * children only. - * @returns {boolean} false, if the iterator was stopped. - */ - visit(callback) { - return this.root.visit(callback, false); - } - /** - * Call callback(node) for all nodes in vertical order, top down (or bottom up). - * - * Note that this considers expansion state, i.e. filtered nodes and children - * of collapsed nodes are skipped, unless `includeHidden` is set. - * - * Stop iteration if callback() returns false.
- * Return false if iteration was stopped. - * - * @returns {boolean} false if iteration was canceled - */ - visitRows(callback, options) { - if (!this.root.hasChildren()) { - return false; - } - if (options && options.reverse) { - delete options.reverse; - return this._visitRowsUp(callback, options); - } - options = options || {}; - let i, nextIdx, parent, res, siblings, stopNode, siblingOfs = 0, skipFirstNode = options.includeSelf === false, node = options.start || this.root.children[0]; - const includeHidden = !!options.includeHidden; - const checkFilter = !includeHidden && this.filterMode === "hide"; - parent = node.parent; - while (parent) { - // visit siblings - siblings = parent.children; - nextIdx = siblings.indexOf(node) + siblingOfs; - assert(nextIdx >= 0, `Could not find ${node} in parent's children: ${parent}`); - for (i = nextIdx; i < siblings.length; i++) { - node = siblings[i]; - if (node === stopNode) { - return false; - } - if (checkFilter && - !node.statusNodeType && - !node.match && - !node.subMatchCount) { - continue; - } - if (!skipFirstNode && callback(node) === false) { - return false; - } - skipFirstNode = false; - // Dive into node's child nodes - if (node.children && - node.children.length && - (includeHidden || node.expanded)) { - res = node.visit((n) => { - if (n === stopNode) { - return false; - } - if (checkFilter && !n.match && !n.subMatchCount) { - return "skip"; - } - if (callback(n) === false) { - return false; - } - if (!includeHidden && n.children && !n.expanded) { - return "skip"; - } - }, false); - if (res === false) { - return false; - } - } - } - // Visit parent nodes (bottom up) - node = parent; - parent = parent.parent; - siblingOfs = 1; // - if (!parent && options.wrap) { - this.logDebug("visitRows(): wrap around"); - assert(options.start, "`wrap` option requires `start`"); - stopNode = options.start; - options.wrap = false; - parent = this.root; - siblingOfs = 0; - } - } - return true; - } - /** - * Call fn(node) for all nodes in vertical order, bottom up. - * @internal - */ - _visitRowsUp(callback, options) { - let children, idx, parent, node = options.start || this.root.children[0]; - const includeHidden = !!options.includeHidden; - if (options.includeSelf !== false) { - if (callback(node) === false) { - return false; - } - } - while (true) { - parent = node.parent; - children = parent.children; - if (children[0] === node) { - // If this is already the first sibling, goto parent - node = parent; - if (!node.parent) { - break; // first node of the tree - } - children = parent.children; - } - else { - // Otherwise, goto prev. sibling - idx = children.indexOf(node); - node = children[idx - 1]; - // If the prev. sibling has children, follow down to last descendant - while ((includeHidden || node.expanded) && - node.children && - node.children.length) { - children = node.children; - parent = node; - node = children[children.length - 1]; - } - } - // Skip invisible - if (!includeHidden && !node.isVisible()) { - continue; - } - if (callback(node) === false) { - return false; - } - } - return true; - } - /** - * Reload the tree with a new source. - * - * Previous data is cleared. Note that also column- and type defintions may - * be passed with the `source` object. - */ - load(source) { - this.clear(); - return this.root.load(source); - } - /** - * Disable render requests during operations that would trigger many updates. - * - * ```js - * try { - * tree.enableUpdate(false); - * // ... (long running operation that would trigger many updates) - * foo(); - * // ... NOTE: make sure that async operations have finished, e.g. - * await foo(); - * } finally { - * tree.enableUpdate(true); - * } - * ``` - */ - enableUpdate(flag) { - /* - 5 7 9 20 25 30 - 1 >-------------------------------------< - 2 >--------------------< - 3 >--------------------------< - */ - if (flag) { - assert(this._disableUpdateCount > 0, "enableUpdate(true) was called too often"); - this._disableUpdateCount--; - // this.logDebug( - // `enableUpdate(${flag}): count -> ${this._disableUpdateCount}...` - // ); - if (this._disableUpdateCount === 0) { - this.logDebug(`enableUpdate(): active again. Re-painting to catch up with ${this._disableUpdateIgnoreCount} ignored update requests...`); - this._disableUpdateIgnoreCount = 0; - this.update(ChangeType.any, { immediate: true }); - } - } - else { - this._disableUpdateCount++; - // this.logDebug( - // `enableUpdate(${flag}): count -> ${this._disableUpdateCount}...` - // ); - // this._disableUpdate = Date.now(); - } - // return !flag; // return previous value - } - /* --------------------------------------------------------------------------- - * FILTER - * -------------------------------------------------------------------------*/ - /** - * [ext-filter] Dim or hide nodes. - */ - filterNodes(filter, options) { - return this.extensions.filter.filterNodes(filter, options); - } - /** - * [ext-filter] Dim or hide whole branches. - */ - filterBranches(filter, options) { - return this.extensions.filter.filterBranches(filter, options); - } - /** - * [ext-filter] Reset the filter. - * - * @requires [[FilterExtension]] - */ - clearFilter() { - return this.extensions.filter.clearFilter(); - } - /** - * [ext-filter] Return true if a filter is currently applied. - * - * @requires [[FilterExtension]] - */ - isFilterActive() { - return !!this.filterMode; - } - /** - * [ext-filter] Re-apply current filter. - * - * @requires [[FilterExtension]] - */ - updateFilter() { - return this.extensions.filter.updateFilter(); - } - } - Wunderbaum.sequence = 0; - /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */ - Wunderbaum.version = "v0.7.0"; // Set to semver by 'grunt release' - /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */ - Wunderbaum.util = util; + this.listContainerElement = this.element.querySelector("div.wb-list-container"); + this.nodeListElement = this.listContainerElement.querySelector("div.wb-node-list"); + this.headerElement = this.element.querySelector("div.wb-header"); + this.element.classList.toggle("wb-grid", this.columns.length > 1); + this._initExtensions(); + // --- apply initial options + ["enabled", "fixedCol"].forEach((optName) => { + if (opts[optName] != null) { + this.setOption(optName, opts[optName]); + } + }); + // --- Load initial data + if (opts.source) { + if (opts.showSpinner) { + this.nodeListElement.innerHTML = + "loading..."; + } + this.load(opts.source) + .then(() => { + // The source may have defined columns, so we may adjust the nav mode + if (opts.navigationModeOption == null) { + if (this.isGrid()) { + this.setNavigationOption(NavModeEnum.cell); + } + else { + this.setNavigationOption(NavModeEnum.row); + } + } + else { + this.setNavigationOption(opts.navigationModeOption); + } + this.update(ChangeType.structure, { immediate: true }); + readyDeferred.resolve(); + }) + .catch((error) => { + readyDeferred.reject(error); + }) + .finally(() => { + var _a; + (_a = this.element.querySelector("progress.spinner")) === null || _a === void 0 ? void 0 : _a.remove(); + this.element.classList.remove("wb-initializing"); + }); + } + else { + readyDeferred.resolve(); + } + // Async mode is sometimes required, because this.element.clientWidth + // has a wrong value at start??? + this.update(ChangeType.any); + // --- Bind listeners + this.element.addEventListener("scroll", (e) => { + // this.log(`scroll, scrollTop:${e.target.scrollTop}`, e); + this.update(ChangeType.scroll); + }); + this.resizeObserver = new ResizeObserver((entries) => { + // this.log("ResizeObserver: Size changed", entries); + this.update(ChangeType.resize); + }); + this.resizeObserver.observe(this.element); + onEvent(this.nodeListElement, "click", "div.wb-row", (e) => { + const info = Wunderbaum.getEventInfo(e); + const node = info.node; + const mouseEvent = e; + // this.log("click", info); + // if (this._selectRange(info) === false) { + // return; + // } + if (this._callEvent("click", { event: e, node: node, info: info }) === false) { + this.lastClickTime = Date.now(); + return false; + } + if (node) { + if (mouseEvent.ctrlKey) { + node.toggleSelected(); + return; + } + // Edit title if 'clickActive' is triggered: + const trigger = this.getOption("edit.trigger"); + const slowClickDelay = this.getOption("edit.slowClickDelay"); + if (trigger.indexOf("clickActive") >= 0 && + info.region === "title" && + node.isActive() && + (!slowClickDelay || Date.now() - this.lastClickTime < slowClickDelay)) { + node.startEditTitle(); + } + if (info.colIdx >= 0) { + node.setActive(true, { colIdx: info.colIdx, event: e }); + } + else { + node.setActive(true, { event: e }); + } + if (info.region === NodeRegion.expander) { + node.setExpanded(!node.isExpanded(), { + scrollIntoView: options.scrollIntoViewOnExpandClick !== false, + }); + } + else if (info.region === NodeRegion.checkbox) { + node.toggleSelected(); + } + } + this.lastClickTime = Date.now(); + }); + onEvent(this.nodeListElement, "dblclick", "div.wb-row", (e) => { + const info = Wunderbaum.getEventInfo(e); + const node = info.node; + // this.log("dblclick", info, e); + if (this._callEvent("dblclick", { event: e, node: node, info: info }) === + false) { + return false; + } + if (node && info.colIdx === 0 && node.isExpandable()) { + this._callMethod("edit._stopEditTitle"); + node.setExpanded(!node.isExpanded()); + } + }); + onEvent(this.element, "keydown", (e) => { + const info = Wunderbaum.getEventInfo(e); + const eventName = eventToString(e); + const node = info.node || this.getFocusNode(); + this._callHook("onKeyEvent", { + event: e, + node: node, + info: info, + eventName: eventName, + }); + }); + onEvent(this.element, "focusin focusout", (e) => { + const flag = e.type === "focusin"; + const targetNode = Wunderbaum.getNode(e); + this._callEvent("focus", { flag: flag, event: e }); + if (flag && this.isRowNav() && !this.isEditingTitle()) { + if (opts.navigationModeOption === NavModeEnum.row) { + targetNode === null || targetNode === void 0 ? void 0 : targetNode.setActive(); + } + else { + this.setCellNav(); + } + } + if (!flag) { + this._callMethod("edit._stopEditTitle", true, { + event: e, + forceClose: true, + }); + } + }); + } + /** + * Return a Wunderbaum instance, from element, id, index, or event. + * + * ```js + * getTree(); // Get first Wunderbaum instance on page + * getTree(1); // Get second Wunderbaum instance on page + * getTree(event); // Get tree for this mouse- or keyboard event + * getTree("foo"); // Get tree for this `tree.options.id` + * getTree("#tree"); // Get tree for first matching element selector + * ``` + */ + static getTree(el) { + if (el instanceof Wunderbaum) { + return el; + } + else if (el instanceof WunderbaumNode) { + return el.tree; + } + if (el === undefined) { + el = 0; // get first tree + } + if (typeof el === "number") { + el = document.querySelectorAll(".wunderbaum")[el]; // el was an integer: return nth element + } + else if (typeof el === "string") { + // Search all trees for matching ID + for (const treeElem of document.querySelectorAll(".wunderbaum")) { + const tree = treeElem._wb_tree; + if (tree && tree.id === el) { + return tree; + } + } + // Search by selector + el = document.querySelector(el); + if (!el) { + return null; + } + } + else if (el.target) { + el = el.target; + } + assert(el instanceof Element, `Invalid el type: ${el}`); + if (!el.matches(".wunderbaum")) { + el = el.closest(".wunderbaum"); + } + if (el && el._wb_tree) { + return el._wb_tree; + } + return null; + } + /** + * Return the icon-function -> icon-definition mapping. + */ + get iconMap() { + const map = this.options.iconMap; + if (typeof map === "string") { + return iconMaps[map]; + } + return map; + } + /** + * Return a WunderbaumNode instance from element or event. + */ + static getNode(el) { + if (!el) { + return null; + } + else if (el instanceof WunderbaumNode) { + return el; + } + else if (el.target !== undefined) { + el = el.target; // el was an Event + } + // `el` is a DOM element + // let nodeElem = obj.closest("div.wb-row"); + while (el) { + if (el._wb_node) { + return el._wb_node; + } + el = el.parentElement; //.parentNode; + } + return null; + } + /** + * Iterate all descendant nodes depth-first, pre-order using `for ... of ...` syntax. + * More concise, but slightly slower than {@link Wunderbaum.visit}. + * + * Example: + * ```js + * for(const node of tree) { + * ... + * } + * ``` + */ + *[Symbol.iterator]() { + yield* this.root; + } + /** @internal */ + _registerExtension(extension) { + this.extensionList.push(extension); + this.extensions[extension.id] = extension; + // this.extensionMap.set(extension.id, extension); + } + /** Called on tree (re)init after markup is created, before loading. */ + _initExtensions() { + for (const ext of this.extensionList) { + ext.init(); + } + } + /** Add node to tree's bookkeeping data structures. */ + _registerNode(node) { + const key = node.key; + assert(key != null && !this.keyMap.has(key), `Missing or duplicate key: '${key}'.`); + this.keyMap.set(key, node); + const rk = node.refKey; + if (rk != null) { + const rks = this.refKeyMap.get(rk); // Set of nodes with this refKey + if (rks) { + rks.add(node); + } + else { + this.refKeyMap.set(rk, new Set([node])); + } + } + } + /** Remove node from tree's bookkeeping data structures. */ + _unregisterNode(node) { + // Remove refKey reference from map (if any) + const rk = node.refKey; + if (rk != null) { + const rks = this.refKeyMap.get(rk); + if (rks && rks.delete(node) && !rks.size) { + // We just removed the last element + this.refKeyMap.delete(rk); + } + } + // Remove key reference from map + this.keyMap.delete(node.key); + // Mark as disposed + node.tree = null; + node.parent = null; + // Remove HTML markup + node.removeMarkup(); + } + /** Call all hook methods of all registered extensions.*/ + _callHook(hook, data = {}) { + let res; + const d = extend({}, { tree: this, options: this.options, result: undefined }, data); + for (const ext of this.extensionList) { + res = ext[hook].call(ext, d); + if (res === false) { + break; + } + if (d.result !== undefined) { + res = d.result; + } + } + return res; + } + /** + * Call tree method or extension method if defined. + * + * Example: + * ```js + * tree._callMethod("edit.startEdit", "arg1", "arg2") + * ``` + */ + _callMethod(name, ...args) { + const [p, n] = name.split("."); + const obj = n ? this.extensions[p] : this; + const func = obj[n]; + if (func) { + return func.apply(obj, args); + } + else { + this.logError(`Calling undefined method '${name}()'.`); + } + } + /** + * Call event handler if defined in tree or tree.EXTENSION options. + * + * Example: + * ```js + * tree._callEvent("edit.beforeEdit", {foo: 42}) + * ``` + */ + _callEvent(type, extra) { + const [p, n] = type.split("."); + const opts = this.options; + const func = n ? opts[p][n] : opts[p]; + if (func) { + return func.call(this, extend({ type: type, tree: this, util: this._util }, extra)); + // } else { + // this.logError(`Triggering undefined event '${type}'.`) + } + } + /** Return the node for given row index. */ + _getNodeByRowIdx(idx) { + // TODO: start searching from active node (reverse) + let node = null; + this.visitRows((n) => { + if (n._rowIdx === idx) { + node = n; + return false; + } + }); + return node; + } + /** Return the topmost visible node in the viewport. */ + getTopmostVpNode(complete = true) { + const gracePx = 1; // ignore subpixel scrolling + const scrollParent = this.element; + // const headerHeight = this.headerElement.clientHeight; // May be 0 + const scrollTop = scrollParent.scrollTop; // + headerHeight; + let topIdx; + if (complete) { + topIdx = Math.ceil((scrollTop - gracePx) / ROW_HEIGHT); + } + else { + topIdx = Math.floor(scrollTop / ROW_HEIGHT); + } + return this._getNodeByRowIdx(topIdx); + } + /** Return the lowest visible node in the viewport. */ + getLowestVpNode(complete = true) { + const scrollParent = this.element; + const headerHeight = this.headerElement.clientHeight; // May be 0 + const scrollTop = scrollParent.scrollTop; + const clientHeight = scrollParent.clientHeight - headerHeight; + let bottomIdx; + if (complete) { + bottomIdx = Math.floor((scrollTop + clientHeight) / ROW_HEIGHT) - 1; + } + else { + bottomIdx = Math.ceil((scrollTop + clientHeight) / ROW_HEIGHT) - 1; + } + bottomIdx = Math.min(bottomIdx, this.count(true) - 1); + return this._getNodeByRowIdx(bottomIdx); + } + /** Return preceeding visible node in the viewport. */ + _getPrevNodeInView(node, ofs = 1) { + this.visitRows((n) => { + node = n; + if (ofs-- <= 0) { + return false; + } + }, { reverse: true, start: node || this.getActiveNode() }); + return node; + } + /** Return following visible node in the viewport. */ + _getNextNodeInView(node, ofs = 1) { + this.visitRows((n) => { + node = n; + if (ofs-- <= 0) { + return false; + } + }, { reverse: false, start: node || this.getActiveNode() }); + return node; + } + /** + * Append (or insert) a list of toplevel nodes. + * + * @see {@link WunderbaumNode.addChildren} + */ + addChildren(nodeData, options) { + return this.root.addChildren(nodeData, options); + } + /** + * Apply a modification or navigation operation. + * + * Most of these commands simply map to a node or tree method. + * This method is especially useful when implementing keyboard mapping, + * context menus, or external buttons. + * + * Valid commands: + * - 'moveUp', 'moveDown' + * - 'indent', 'outdent' + * - 'remove' + * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension) + * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard') + * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate + * + */ + applyCommand(cmd, nodeOrOpts, options) { + let // clipboard, + node, refNode; + // options = $.extend( + // { setActive: true, clipboard: CLIPBOARD }, + // options_ + // ); + if (nodeOrOpts instanceof WunderbaumNode) { + node = nodeOrOpts; + } + else { + node = this.getActiveNode(); + assert(options === undefined, `Unexpected options: ${options}`); + options = nodeOrOpts; + } + // clipboard = options.clipboard; + switch (cmd) { + // Sorting and indentation: + case "moveUp": + refNode = node.getPrevSibling(); + if (refNode) { + node.moveTo(refNode, "before"); + node.setActive(); + } + break; + case "moveDown": + refNode = node.getNextSibling(); + if (refNode) { + node.moveTo(refNode, "after"); + node.setActive(); + } + break; + case "indent": + refNode = node.getPrevSibling(); + if (refNode) { + node.moveTo(refNode, "appendChild"); + refNode.setExpanded(); + node.setActive(); + } + break; + case "outdent": + if (!node.isTopLevel()) { + node.moveTo(node.getParent(), "after"); + node.setActive(); + } + break; + // Remove: + case "remove": + refNode = node.getPrevSibling() || node.getParent(); + node.remove(); + if (refNode) { + refNode.setActive(); + } + break; + // Add, edit (requires ext-edit): + case "addChild": + this._callMethod("edit.createNode", "prependChild"); + break; + case "addSibling": + this._callMethod("edit.createNode", "after"); + break; + case "rename": + node.startEditTitle(); + break; + // Simple clipboard simulation: + // case "cut": + // clipboard = { mode: cmd, data: node }; + // break; + // case "copy": + // clipboard = { + // mode: cmd, + // data: node.toDict(function(d, n) { + // delete d.key; + // }), + // }; + // break; + // case "clear": + // clipboard = null; + // break; + // case "paste": + // if (clipboard.mode === "cut") { + // // refNode = node.getPrevSibling(); + // clipboard.data.moveTo(node, "child"); + // clipboard.data.setActive(); + // } else if (clipboard.mode === "copy") { + // node.addChildren(clipboard.data).setActive(); + // } + // break; + // Navigation commands: + case "down": + case "first": + case "last": + case "left": + case "pageDown": + case "pageUp": + case "parent": + case "right": + case "up": + return node.navigate(cmd); + default: + error(`Unhandled command: '${cmd}'`); + } + } + /** Delete all nodes. */ + clear() { + this.root.removeChildren(); + this.root.children = null; + this.keyMap.clear(); + this.refKeyMap.clear(); + this.treeRowCount = 0; + this.activeNode = null; + this.focusNode = null; + // this.types = {}; + // this. columns =[]; + // this._columnsById = {}; + // Modification Status + // this.changedSince = 0; + // this.changes.clear(); + // this.changedNodes.clear(); + // // --- FILTER --- + // public filterMode: FilterModeType = null; + // // --- KEYNAV --- + // public activeColIdx = 0; + // public cellNavMode = false; + // public lastQuicksearchTime = 0; + // public lastQuicksearchTerm = ""; + this.update(ChangeType.structure); + } + /** + * Clear nodes and markup and detach events and observers. + * + * This method may be useful to free up resources before re-creating a tree + * on an existing div, for example in unittest suites. + * Note that this Wunderbaum instance becomes unusable afterwards. + */ + destroy() { + this.logInfo("destroy()..."); + this.clear(); + this.resizeObserver.disconnect(); + this.element.innerHTML = ""; + // Remove all event handlers + this.element.outerHTML = this.element.outerHTML; // eslint-disable-line + } + /** + * Return `tree.option.NAME` (also resolving if this is a callback). + * + * See also {@link WunderbaumNode.getOption|WunderbaumNode.getOption()} + * to evaluate `node.NAME` setting and `tree.types[node.type].NAME`. + * + * @param name option name (use dot notation to access extension option, e.g. + * `filter.mode`) + */ + getOption(name, defaultValue) { + let ext; + let opts = this.options; + // Lookup `name` in options dict + if (name.indexOf(".") >= 0) { + [ext, name] = name.split("."); + opts = opts[ext]; + } + let value = opts[name]; + // A callback resolver always takes precedence + if (typeof value === "function") { + value = value({ type: "resolve", tree: this }); + } + // Use value from value options dict, fallback do default + // console.info(name, value, opts) + return value !== null && value !== void 0 ? value : defaultValue; + } + /** + * Set tree option. + * Use dot notation to set plugin option, e.g. "filter.mode". + */ + setOption(name, value) { + // this.log(`setOption(${name}, ${value})`); + if (name.indexOf(".") >= 0) { + const parts = name.split("."); + const ext = this.extensions[parts[0]]; + ext.setPluginOption(parts[1], value); + return; + } + this.options[name] = value; + switch (name) { + case "checkbox": + this.update(ChangeType.any); + break; + case "enabled": + this.setEnabled(!!value); + break; + case "fixedCol": + this.element.classList.toggle("wb-fixed-col", !!value); + break; + } + } + /** Return true if the tree (or one of its nodes) has the input focus. */ + hasFocus() { + return this.element.contains(document.activeElement); + } + /** + * Return true if the tree displays a header. Grids have a header unless the + * `header` option is set to `false`. Plain trees have a header if the `header` + * option is a string or `true`. + */ + hasHeader() { + const header = this.options.header; + return this.isGrid() ? header !== false : !!header; + } + /** Run code, but defer rendering of viewport until done. + * + * ``` + * tree.runWithDeferredUpdate(() => { + * return someFuncThatWouldUpdateManyNodes(); + * }); + * ``` + */ + runWithDeferredUpdate(func, hint = null) { + try { + this.enableUpdate(false); + const res = func(); + assert(!(res instanceof Promise), `Promise return not allowed: ${res}`); + return res; + } + finally { + this.enableUpdate(true); + } + } + /** Recursively expand all expandable nodes (triggers lazy load if needed). */ + async expandAll(flag = true, options) { + await this.root.expandAll(flag, options); + } + /** Recursively select all nodes. */ + selectAll(flag = true) { + return this.root.setSelected(flag, { propagateDown: true }); + } + /** Toggle select all nodes. */ + toggleSelect() { + this.selectAll(this.root._anySelectable()); + } + /** + * Return an array of selected nodes. + * @param stopOnParents only return the topmost selected node (useful with selectMode 'hier') + */ + getSelectedNodes(stopOnParents = false) { + return this.root.getSelectedNodes(stopOnParents); + } + /* + * Return an array of selected nodes. + */ + _selectRange(eventInfo) { + this.logDebug("_selectRange", eventInfo); + error("Not yet implemented."); + // const mode = this.options.selectMode!; + // if (mode !== "multi") { + // this.logDebug(`Range selection only available for selectMode 'multi'`); + // return; + // } + // if (eventInfo.canonicalName === "Meta+click") { + // eventInfo.node?.toggleSelected(); + // return false; // don't + // } else if (eventInfo.canonicalName === "Shift+click") { + // let from = this.activeNode; + // let to = eventInfo.node; + // if (!from || !to || from === to) { + // return; + // } + // this.runWithDeferredUpdate(() => { + // this.visitRows( + // (node) => { + // node.setSelected(); + // }, + // { + // includeHidden: true, + // includeSelf: false, + // start: from, + // reverse: from!._rowIdx! > to!._rowIdx!, + // } + // ); + // }); + // return false; + // } + } + /** Return the number of nodes in the data model. + * @param visible if true, nodes that are hidden due to collapsed parents are ignored. + */ + count(visible = false) { + return visible ? this.treeRowCount : this.keyMap.size; + } + /** @internal sanity check. */ + _check() { + let i = 0; + this.visit((n) => { + i++; + }); + if (this.keyMap.size !== i) { + this.logWarn(`_check failed: ${this.keyMap.size} !== ${i}`); + } + // util.assert(this.keyMap.size === i); + } + /** + * Find all nodes that match condition. + * + * @param match title string to search for, or a + * callback function that returns `true` if a node is matched. + * @see {@link WunderbaumNode.findAll} + */ + findAll(match) { + return this.root.findAll(match); + } + /** + * Find all nodes with a given _refKey_ (aka a list of clones). + * + * @param refKey a `node.refKey` value to search for. + * @returns an array of matching nodes with at least two element or `[]` + * if nothing found. + * + * @see {@link WunderbaumNode.getCloneList} + */ + findByRefKey(refKey) { + const clones = this.refKeyMap.get(refKey); + return clones ? Array.from(clones) : []; + } + /** + * Find first node that matches condition. + * + * @param match title string to search for, or a + * callback function that returns `true` if a node is matched. + * @see {@link WunderbaumNode.findFirst} + */ + findFirst(match) { + return this.root.findFirst(match); + } + /** + * Find first node that matches condition. + * + * @see {@link WunderbaumNode.findFirst} + * + */ + findKey(key) { + return this.keyMap.get(key) || null; + } + /** + * Find the next visible node that starts with `match`, starting at `startNode` + * and wrap-around at the end. + * Used by quicksearch and keyboard navigation. + */ + findNextNode(match, startNode) { + //, visibleOnly) { + let res = null; + const firstNode = this.getFirstChild(); + const matcher = typeof match === "string" ? makeNodeTitleStartMatcher(match) : match; + startNode = startNode || firstNode; + function _checkNode(n) { + // console.log("_check " + n) + if (matcher(n)) { + res = n; + } + if (res || n === startNode) { + return false; + } + } + this.visitRows(_checkNode, { + start: startNode, + includeSelf: false, + }); + // Wrap around search + if (!res && startNode !== firstNode) { + this.visitRows(_checkNode, { + start: firstNode, + includeSelf: true, + }); + } + return res; + } + /** + * Find a node relative to another node. + * + * @param node + * @param where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'. + * (Alternatively the keyCode that would normally trigger this move, + * e.g. `$.ui.keyCode.LEFT` = 'left'. + * @param includeHidden Not yet implemented + */ + findRelatedNode(node, where, includeHidden = false) { + let res = null; + const pageSize = Math.floor(this.listContainerElement.clientHeight / ROW_HEIGHT); + switch (where) { + case "parent": + if (node.parent && node.parent.parent) { + res = node.parent; + } + break; + case "first": + // First visible node + this.visit((n) => { + if (n.isVisible()) { + res = n; + return false; + } + }); + break; + case "last": + this.visit((n) => { + // last visible node + if (n.isVisible()) { + res = n; + } + }); + break; + case "left": + if (node.parent && node.parent.parent) { + res = node.parent; + } + // if (node.expanded) { + // node.setExpanded(false); + // } else if (node.parent && node.parent.parent) { + // res = node.parent; + // } + break; + case "right": + if (node.children && node.children.length) { + res = node.children[0]; + } + // if (this.cellNavMode) { + // throw new Error("Not implemented"); + // } else { + // if (!node.expanded && (node.children || node.lazy)) { + // node.setExpanded(); + // res = node; + // } else if (node.children && node.children.length) { + // res = node.children[0]; + // } + // } + break; + case "up": + res = this._getPrevNodeInView(node); + break; + case "down": + res = this._getNextNodeInView(node); + break; + case "pageDown": + { + const bottomNode = this.getLowestVpNode(); + // this.logDebug(`${where}(${node}) -> ${bottomNode}`); + if (node._rowIdx < bottomNode._rowIdx) { + res = bottomNode; + } + else { + res = this._getNextNodeInView(node, pageSize); + } + } + break; + case "pageUp": + if (node._rowIdx === 0) { + res = node; + } + else { + const topNode = this.getTopmostVpNode(); + // this.logDebug(`${where}(${node}) -> ${topNode}`); + if (node._rowIdx > topNode._rowIdx) { + res = topNode; + } + else { + res = this._getPrevNodeInView(node, pageSize); + } + } + break; + default: + this.logWarn("Unknown relation '" + where + "'."); + } + return res; + } + /** + * Iterator version of {@link Wunderbaum.format}. + */ + *format_iter(name_cb, connectors) { + yield* this.root.format_iter(name_cb, connectors); + } + /** + * Return multiline string representation of the node hierarchy. + * Mostly useful for debugging. + * + * Example: + * ```js + * console.info(tree.format((n)=>n.title)); + * ``` + * logs + * ``` + * Playground + * ├─ Books + * | ├─ Art of War + * | ╰─ Don Quixote + * ├─ Music + * ... + * ``` + * + * @see {@link Wunderbaum.format_iter} and {@link WunderbaumNode.format}. + */ + format(name_cb, connectors) { + return this.root.format(name_cb, connectors); + } + /** + * Return the active cell (`span.wb-col`) of the currently active node or null. + */ + getActiveColElem() { + if (this.activeNode && this.activeColIdx >= 0) { + return this.activeNode.getColElem(this.activeColIdx); + } + return null; + } + /** + * Return the currently active node or null. + * @see {@link WunderbaumNode.setActive} + * @see {@link WunderbaumNode.isActive} + * @see {@link WunderbaumNode.getFocusNode} + */ + getActiveNode() { + return this.activeNode; + } + /** + * Return the first top level node if any (not the invisible root node). + */ + getFirstChild() { + return this.root.getFirstChild(); + } + /** + * Return the node that currently has keyboard focus or null. + * @see {@link WunderbaumNode.getActiveNode} + */ + getFocusNode() { + return this.focusNode; + } + /** Return a {node: WunderbaumNode, region: TYPE} object for a mouse event. + * + * @param {Event} event Mouse event, e.g. click, ... + * @returns {object} Return a {node: WunderbaumNode, region: TYPE} object + * TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined + */ + static getEventInfo(event) { + const target = event.target; + const cl = target.classList; + const parentCol = target.closest("span.wb-col"); + const node = Wunderbaum.getNode(target); + const tree = node ? node.tree : Wunderbaum.getTree(event); + const res = { + event: event, + canonicalName: eventToString(event), + tree: tree, + node: node, + region: NodeRegion.unknown, + colDef: undefined, + colIdx: -1, + colId: undefined, + colElem: parentCol, + }; + if (cl.contains("wb-title")) { + res.region = NodeRegion.title; + } + else if (cl.contains("wb-expander")) { + res.region = node.isExpandable() + ? NodeRegion.expander + : NodeRegion.prefix; + } + else if (cl.contains("wb-checkbox")) { + res.region = NodeRegion.checkbox; + } + else if (cl.contains("wb-icon")) { + //|| cl.contains("wb-custom-icon")) { + res.region = NodeRegion.icon; + } + else if (cl.contains("wb-node")) { + res.region = NodeRegion.title; + } + else if (parentCol) { + res.region = NodeRegion.column; + const idx = Array.prototype.indexOf.call(parentCol.parentNode.children, parentCol); + res.colIdx = idx; + } + else if (cl.contains("wb-row")) { + // Plain tree + res.region = NodeRegion.title; + } + else { + // Somewhere near the title + if (event.type !== "mousemove" && !(event instanceof KeyboardEvent)) { + tree === null || tree === void 0 ? void 0 : tree.logWarn("getEventInfo(): not found", event, res); + } + return res; + } + if (res.colIdx === -1) { + res.colIdx = 0; + } + res.colDef = tree === null || tree === void 0 ? void 0 : tree.columns[res.colIdx]; + res.colDef != null ? (res.colId = res.colDef.id) : 0; + // this.log("Event", event, res); + return res; + } + /** + * Return readable string representation for this instance. + * @internal + */ + toString() { + return `Wunderbaum<'${this.id}'>`; + } + /** Return true if any node title or grid cell is currently beeing edited. + * + * See also {@link Wunderbaum.isEditingTitle}. + */ + isEditing() { + const focusElem = this.nodeListElement.querySelector("input:focus,select:focus"); + return !!focusElem; + } + /** Return true if any node is currently in edit-title mode. + * + * See also {@link WunderbaumNode.isEditingTitle} and {@link Wunderbaum.isEditing}. + */ + isEditingTitle() { + return this._callMethod("edit.isEditingTitle"); + } + /** + * Return true if any node is currently beeing loaded, i.e. a Ajax request is pending. + */ + isLoading() { + let res = false; + this.root.visit((n) => { + // also visit rootNode + if (n._isLoading || n._requestId) { + res = true; + return false; + } + }, true); + return res; + } + /** Log to console if opts.debugLevel >= 4 */ + logDebug(...args) { + if (this.options.debugLevel >= 4) { + console.log(this.toString(), ...args); // eslint-disable-line no-console + } + } + /** Log error to console. */ + logError(...args) { + if (this.options.debugLevel >= 1) { + console.error(this.toString(), ...args); // eslint-disable-line no-console + } + } + /** Log to console if opts.debugLevel >= 3 */ + logInfo(...args) { + if (this.options.debugLevel >= 3) { + console.info(this.toString(), ...args); // eslint-disable-line no-console + } + } + /** @internal */ + logTime(label) { + if (this.options.debugLevel >= 4) { + console.time(this + ": " + label); // eslint-disable-line no-console + } + return label; + } + /** @internal */ + logTimeEnd(label) { + if (this.options.debugLevel >= 4) { + console.timeEnd(this + ": " + label); // eslint-disable-line no-console + } + } + /** Log to console if opts.debugLevel >= 2 */ + logWarn(...args) { + if (this.options.debugLevel >= 2) { + console.warn(this.toString(), ...args); // eslint-disable-line no-console + } + } + /** + * Make sure that this node is vertically scrolled into the viewport. + * + * Nodes that are above the visible area become the top row, nodes that are + * below the viewport become the bottom row. + */ + scrollTo(nodeOrOpts) { + const PADDING = 2; // leave some pixels between viewport bounds + let node; + let options; + if (nodeOrOpts instanceof WunderbaumNode) { + node = nodeOrOpts; + } + else { + options = nodeOrOpts; + node = options.node; + } + assert(node && node._rowIdx != null, `Invalid node: ${node}`); + const scrollParent = this.element; + const headerHeight = this.headerElement.clientHeight; // May be 0 + const scrollTop = scrollParent.scrollTop; + const vpHeight = scrollParent.clientHeight; + const rowTop = node._rowIdx * ROW_HEIGHT + headerHeight; + const vpTop = headerHeight; + const vpRowTop = rowTop - scrollTop; + const vpRowBottom = vpRowTop + ROW_HEIGHT; + const topNode = options === null || options === void 0 ? void 0 : options.topNode; + // this.log( `scrollTo(${node.title}), vpTop:${vpTop}px, scrollTop:${scrollTop}, vpHeight:${vpHeight}, rowTop:${rowTop}, vpRowTop:${vpRowTop}`, nodeOrOpts , options); + let newScrollTop = null; + if (vpRowTop >= vpTop) { + if (vpRowBottom <= vpHeight) ; + else { + // Node is below viewport + // this.log("Below viewport"); + newScrollTop = rowTop + ROW_HEIGHT - vpHeight + PADDING; // leave some pixels between viewport bounds + } + } + else { + // Node is above viewport + // this.log("Above viewport"); + newScrollTop = rowTop - vpTop - PADDING; // leave some pixels between viewport bounds + } + if (newScrollTop != null) { + this.log(`scrollTo(${rowTop}): ${scrollTop} => ${newScrollTop}`); + scrollParent.scrollTop = newScrollTop; + if (topNode) { + // Make sure the topNode is always visible + this.scrollTo(topNode); + } + // this.update(ChangeType.scroll); + } + } + /** + * Make sure that this node is horizontally scrolled into the viewport. + * Called by {@link setColumn}. + */ + scrollToHorz() { + // const PADDING = 1; + const fixedWidth = this.columns[0]._widthPx; + const vpWidth = this.element.clientWidth; + const scrollLeft = this.element.scrollLeft; + const colElem = this.getActiveColElem(); + const colLeft = Number.parseInt(colElem === null || colElem === void 0 ? void 0 : colElem.style.left, 10); + const colRight = colLeft + Number.parseInt(colElem === null || colElem === void 0 ? void 0 : colElem.style.width, 10); + let newLeft = scrollLeft; + if (colLeft - scrollLeft < fixedWidth) { + // The current column is scrolled behind the left fixed column + newLeft = colLeft - fixedWidth; + } + else if (colRight - scrollLeft > vpWidth) { + // The current column is scrolled outside the right side + newLeft = colRight - vpWidth; + } + newLeft = Math.max(0, newLeft); + // util.assert(node._rowIdx != null); + this.log(`scrollToHorz(${this.activeColIdx}): ${colLeft}..${colRight}, fixedOfs=${fixedWidth}, vpWidth=${vpWidth}, curLeft=${scrollLeft} -> ${newLeft}`); + this.element.scrollLeft = newLeft; + // this.update(ChangeType.scroll); + } + /** + * Set column #colIdx to 'active'. + * + * This higlights the column header and -cells by adding the `wb-active` + * class to all grid cells of the active column.
+ * Available in cell-nav mode only. + * + * If _options.edit_ is true, the embedded input element is focused, or if + * colIdx is 0, the node title is put into edit mode. + */ + setColumn(colIdx, options) { + var _a, _b, _c; + const edit = options === null || options === void 0 ? void 0 : options.edit; + const scroll = (options === null || options === void 0 ? void 0 : options.scrollIntoView) !== false; + assert(this.isCellNav(), "Expected cellNav mode"); + if (typeof colIdx === "string") { + const cid = colIdx; + colIdx = this.columns.findIndex((c) => c.id === colIdx); + assert(colIdx >= 0, `Invalid colId: ${cid}`); + } + assert(0 <= colIdx && colIdx < this.columns.length, `Invalid colIdx: ${colIdx}`); + this.activeColIdx = colIdx; + // Update `wb-active` class for all headers + if (this.hasHeader()) { + for (const rowDiv of this.headerElement.children) { + let i = 0; + for (const colDiv of rowDiv.children) { + colDiv.classList.toggle("wb-active", i++ === colIdx); + } + } + } + (_a = this.activeNode) === null || _a === void 0 ? void 0 : _a.update(ChangeType.status); + // Update `wb-active` class for all cell spans + for (const rowDiv of this.nodeListElement.children) { + let i = 0; + for (const colDiv of rowDiv.children) { + colDiv.classList.toggle("wb-active", i++ === colIdx); + } + } + // Horizontically scroll into view + if (scroll || edit) { + this.scrollToHorz(); + } + if (edit && this.activeNode) { + // this.activeNode.setFocus(); // Blur prev. input if any + if (colIdx === 0) { + this.activeNode.startEditTitle(); + } + else { + (_c = (_b = this.getActiveColElem()) === null || _b === void 0 ? void 0 : _b.querySelector("input,select")) === null || _c === void 0 ? void 0 : _c.focus(); + } + } + } + /** Set or remove keyboard focus to the tree container. */ + setActiveNode(key, flag = true, options) { + var _a; + (_a = this.findKey(key)) === null || _a === void 0 ? void 0 : _a.setActive(flag, options); + } + /** Set or remove keyboard focus to the tree container. */ + setFocus(flag = true) { + if (flag) { + this.element.focus(); + } + else { + this.element.blur(); + } + } + update(change, node, options) { + // this.log(`update(${change}) node=${node}`); + if (!(node instanceof WunderbaumNode)) { + options = node; + node = undefined; + } + const immediate = !!getOption(options, "immediate"); + const RF = RenderFlag; + const pending = this.pendingChangeTypes; + if (this._disableUpdateCount) { + // Assuming that we redraw all when enableUpdate() is re-enabled. + // this.log( + // `IGNORED update(${change}) node=${node} (disable level ${this._disableUpdateCount})` + // ); + this._disableUpdateIgnoreCount++; + return; + } + switch (change) { + case ChangeType.any: + case ChangeType.colStructure: + pending.add(RF.header); + pending.add(RF.clearMarkup); + pending.add(RF.redraw); + pending.add(RF.scroll); + break; + case ChangeType.resize: + // case ChangeType.colWidth: + pending.add(RF.header); + pending.add(RF.redraw); + break; + case ChangeType.structure: + pending.add(RF.redraw); + break; + case ChangeType.scroll: + pending.add(RF.scroll); + break; + case ChangeType.row: + case ChangeType.data: + case ChangeType.status: + assert(node, `Option '${change}' requires a node.`); + // Single nodes are immediately updated if already inside the viewport + // (otherwise we can ignore) + if (node._rowElem) { + node._render({ change: change }); + } + break; + default: + error(`Invalid change type '${change}'.`); + } + if (change === ChangeType.colStructure) { + const isGrid = this.isGrid(); + this.element.classList.toggle("wb-grid", isGrid); + if (!isGrid && this.isCellNav()) { + this.setCellNav(false); + } + } + if (pending.size > 0) { + if (immediate) { + this._updateViewportImmediately(); + } + else { + this._updateViewportThrottled(); + } + } + } + /** Disable mouse and keyboard interaction (return prev. state). */ + setEnabled(flag = true) { + const prev = this.enabled; + this.enabled = !!flag; + this.element.classList.toggle("wb-disabled", !flag); + return prev; + } + /** Return false if tree is disabled. */ + isEnabled() { + return this.enabled; + } + /** Return true if tree has more than one column, i.e. has additional data columns. */ + isGrid() { + return this.columns && this.columns.length > 1; + } + /** Return true if cell-navigation mode is active. */ + isCellNav() { + return !!this._cellNavMode; + } + /** Return true if row-navigation mode is active. */ + isRowNav() { + return !this._cellNavMode; + } + /** Set the tree's navigation mode. */ + setCellNav(flag = true) { + var _a; + const prev = this._cellNavMode; + // if (flag === prev) { + // return; + // } + this._cellNavMode = !!flag; + if (flag && !prev) { + // switch from row to cell mode + this.setColumn(0); + } + this.element.classList.toggle("wb-cell-mode", flag); + (_a = this.activeNode) === null || _a === void 0 ? void 0 : _a.update(ChangeType.status); + } + /** Set the tree's navigation mode option. */ + setNavigationOption(mode, reset = false) { + if (!this.isGrid() && mode !== NavModeEnum.row) { + this.logWarn("Plain trees only support row navigation mode."); + return; + } + this.options.navigationModeOption = mode; + switch (mode) { + case NavModeEnum.cell: + this.setCellNav(true); + break; + case NavModeEnum.row: + this.setCellNav(false); + break; + case NavModeEnum.startCell: + if (reset) { + this.setCellNav(true); + } + break; + case NavModeEnum.startRow: + if (reset) { + this.setCellNav(false); + } + break; + default: + error(`Invalid mode '${mode}'.`); + } + } + /** Display tree status (ok, loading, error, noData) using styles and a dummy root node. */ + setStatus(status, options) { + return this.root.setStatus(status, options); + } + /** Add or redefine node type definitions. */ + setTypes(types, replace = true) { + assert(isPlainObject(types), `Expected plain objext: ${types}`); + if (replace) { + this.types = types; + } + else { + extend(this.types, types); + } + // Convert `TYPE.classes` to a Set + for (const t of Object.values(this.types)) { + if (t.classes) { + t.classes = toSet(t.classes); + } + } + } + /** + * Sort nodes list by title or custom criteria. + * @param {function} cmp custom compare function(a, b) that returns -1, 0, or 1 + * (defaults to sorting by title). + * @param {boolean} deep pass true to sort all descendant nodes recursively + */ + sortChildren(cmp = nodeTitleSorter, deep = false) { + this.root.sortChildren(cmp, deep); + } + /** Convert tree to an array of plain objects. + * + * @param callback(dict, node) is called for every node, in order to allow + * modifications. + * Return `false` to ignore this node or `"skip"` to include this node + * without its children. + * @see {@link WunderbaumNode.toDict}. + */ + toDictArray(callback) { + var _a; + const res = this.root.toDict(true, callback); + return (_a = res.children) !== null && _a !== void 0 ? _a : []; + } + /** + * Update column headers and column width. + * Return true if at least one column width changed. + */ + // _updateColumnWidths(options?: UpdateColumnsOptions): boolean { + _updateColumnWidths() { + // options = Object.assign({ updateRows: true, renderMarkup: false }, options); + const defaultMinWidth = 4; + const vpWidth = this.element.clientWidth; + // Shorten last column width to avoid h-scrollbar + // (otherwise resizbing the demo would display a void scrollbar?) + const FIX_ADJUST_LAST_COL = 1; + const columns = this.columns; + const col0 = columns[0]; + let totalWidth = 0; + let totalWeight = 0; + let fixedWidth = 0; + let modified = false; + // this.element.classList.toggle("wb-grid", isGrid); + // if (!isGrid && this.isCellNav()) { + // this.setCellNav(false); + // } + // if (options.calculateCols) { + if (col0.id !== "*") { + throw new Error(`First column must have id '*': got '${col0.id}'.`); + } + // Gather width definitions + this._columnsById = {}; + for (const col of columns) { + this._columnsById[col.id] = col; + const cw = col.width; + if (col.id === "*" && col !== col0) { + throw new Error(`Column id '*' must be defined only once: '${col.title}'.`); + } + if (!cw || cw === "*") { + col._weight = 1.0; + totalWeight += 1.0; + } + else if (typeof cw === "number") { + col._weight = cw; + totalWeight += cw; + } + else if (typeof cw === "string" && cw.endsWith("px")) { + col._weight = 0; + const px = parseFloat(cw.slice(0, -2)); + if (col._widthPx != px) { + modified = true; + col._widthPx = px; + } + fixedWidth += px; + } + else { + error(`Invalid column width: ${cw} (expected string ending with 'px' or number, e.g. "px" or ).`); + } + } + // Share remaining space between non-fixed columns + const restPx = Math.max(0, vpWidth - fixedWidth); + let ofsPx = 0; + for (const col of columns) { + let minWidth; + if (col._weight) { + const cmw = col.minWidth; + if (typeof cmw === "number") { + minWidth = cmw; + } + else if (typeof cmw === "string" && cmw.endsWith("px")) { + minWidth = parseFloat(cmw.slice(0, -2)); + } + else { + minWidth = defaultMinWidth; + } + const px = Math.max(minWidth, (restPx * col._weight) / totalWeight); + if (col._widthPx != px) { + modified = true; + col._widthPx = px; + } + } + col._ofsPx = ofsPx; + ofsPx += col._widthPx; + } + columns[columns.length - 1]._widthPx -= FIX_ADJUST_LAST_COL; + totalWidth = ofsPx - FIX_ADJUST_LAST_COL; + const tw = `${totalWidth}px`; + this.headerElement.style.width = tw; + this.listContainerElement.style.width = tw; + // } + // Every column has now a calculated `_ofsPx` and `_widthPx` + // this.logInfo("UC", this.columns, vpWidth, this.element.clientWidth, this.element); + // console.trace(); + // util.error("BREAK"); + // if (modified) { + // this._renderHeaderMarkup(); + // if (options.renderMarkup) { + // this.update(ChangeType.header, { removeMarkup: true }); + // } else if (options.updateRows) { + // this._updateRows(); + // } + // } + return modified; + } + /** Create/update header markup from `this.columns` definition. + * @internal + */ + _renderHeaderMarkup() { + assert(this.headerElement, "Expected a headerElement"); + const wantHeader = this.hasHeader(); + setElemDisplay(this.headerElement, wantHeader); + if (!wantHeader) { + return; + } + const colCount = this.columns.length; + const headerRow = this.headerElement.querySelector(".wb-row"); + assert(headerRow, "Expected a row in header element"); + headerRow.innerHTML = "".repeat(colCount); + for (let i = 0; i < colCount; i++) { + const col = this.columns[i]; + const colElem = headerRow.children[i]; + colElem.style.left = col._ofsPx + "px"; + colElem.style.width = col._widthPx + "px"; + // Add classes from `columns` definition to `` cells + if (typeof col.headerClasses === "string") { + col.headerClasses + ? colElem.classList.add(...col.headerClasses.split(" ")) + : 0; + } + else { + col.classes ? colElem.classList.add(...col.classes.split(" ")) : 0; + } + const title = escapeHtml(col.title || col.id); + let tooltip = ""; + if (col.tooltip) { + tooltip = escapeTooltip(col.tooltip); + tooltip = ` title="${tooltip}"`; + } + let resizer = ""; + if (i < colCount - 1) { + resizer = ''; + } + colElem.innerHTML = `${title}${resizer}`; + if (this.isCellNav()) { + colElem.classList.toggle("wb-active", i === this.activeColIdx); + } + } + } + /** + * Render pending changes that were scheduled using {@link WunderbaumNode.update} if any. + * + * This is hardly ever neccessary, since we normally either + * - call `update(ChangeType.TYPE)` (async, throttled), or + * - call `update(ChangeType.TYPE, {immediate: true})` (synchronous) + * + * `updatePendingModifications()` will only force immediate execution of + * pending async changes if any. + */ + updatePendingModifications() { + if (this.pendingChangeTypes.size > 0) { + this._updateViewportImmediately(); + } + } + /** + * This is the actual update method, which is wrapped inside a throttle method. + * It calls `updateColumns()` and `_updateRows()`. + * + * This protected method should not be called directly but via + * {@link WunderbaumNode.update}`, {@link Wunderbaum.update}, + * or {@link Wunderbaum.updatePendingModifications}. + * @internal + */ + _updateViewportImmediately() { + var _a; + if (this._disableUpdateCount) { + this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount}).`); + this._disableUpdateIgnoreCount++; + return; + } + if (this._updateViewportThrottled.pending()) { + // this.logWarn(`_updateViewportImmediately() cancel pending timer.`); + this._updateViewportThrottled.cancel(); + } + // Shorten container height to avoid v-scrollbar + const FIX_ADJUST_HEIGHT = 1; + const RF = RenderFlag; + const pending = new Set(this.pendingChangeTypes); + this.pendingChangeTypes.clear(); + const scrollOnly = pending.has(RF.scroll) && pending.size === 1; + if (scrollOnly) { + this._updateRows({ newNodesOnly: true }); + // this.log("_updateViewportImmediately(): scroll only."); + } + else { + this.log("_updateViewportImmediately():", pending); + if (this.options.adjustHeight !== false) { + let height = this.listContainerElement.clientHeight; + const headerHeight = this.headerElement.clientHeight; // May be 0 + const wantHeight = this.element.clientHeight - headerHeight - FIX_ADJUST_HEIGHT; + if (Math.abs(height - wantHeight) > 1.0) { + // this.log("resize", height, wantHeight); + this.listContainerElement.style.height = wantHeight + "px"; + height = wantHeight; + } + } + // console.profile(`_updateViewportImmediately()`) + if (pending.has(RF.clearMarkup)) { + this.visit((n) => { + n.removeMarkup(); + }); + } + // let widthModified = false; + if (pending.has(RF.header)) { + // widthModified = this._updateColumnWidths(); + this._updateColumnWidths(); + this._renderHeaderMarkup(); + } + this._updateRows(); + // console.profileEnd(`_updateViewportImmediately()`) + } + if (this.options.connectTopBreadcrumb) { + let path = (_a = this.getTopmostVpNode(true)) === null || _a === void 0 ? void 0 : _a.getPath(false, "title", " > "); + path = path ? path + " >" : ""; + this.options.connectTopBreadcrumb.textContent = path; + } + this._callEvent("update"); + } + // /** + // * Assert that TR order matches the natural node order + // * @internal + // */ + // protected _validateRows(): boolean { + // let trs = this.nodeListElement.childNodes; + // let i = 0; + // let prev = -1; + // let ok = true; + // trs.forEach((element) => { + // const tr = element as HTMLTableRowElement; + // const top = Number.parseInt(tr.style.top); + // const n = (tr)._wb_node; + // // if (i < 4) { + // // console.info( + // // `TR#${i}, rowIdx=${n._rowIdx} , top=${top}px: '${n.title}'` + // // ); + // // } + // if (prev >= 0 && top !== prev + ROW_HEIGHT) { + // n.logWarn( + // `TR order mismatch at index ${i}: top=${top}px != ${ + // prev + ROW_HEIGHT + // }` + // ); + // // throw new Error("fault"); + // ok = false; + // } + // prev = top; + // i++; + // }); + // return ok; + // } + /* + * - Traverse all *visible* nodes of the whole tree, i.e. skip collapsed nodes. + * - Store count of rows to `tree.treeRowCount`. + * - Renumber `node._rowIdx` for all visible nodes. + * - Calculate the index range that must be rendered to fill the viewport + * (including upper and lower prefetch) + * - + */ + _updateRows(options) { + // const label = this.logTime("_updateRows"); + // this.log("_updateRows", opts) + options = Object.assign({ newNodesOnly: false }, options); + const newNodesOnly = !!options.newNodesOnly; + const row_height = ROW_HEIGHT; + const vp_height = this.element.clientHeight; + const prefetch = RENDER_MAX_PREFETCH; + // const grace_prefetch = RENDER_MAX_PREFETCH - RENDER_MIN_PREFETCH; + const ofs = this.element.scrollTop; + let startIdx = Math.max(0, ofs / row_height - prefetch); + startIdx = Math.floor(startIdx); + // Make sure start is always even, so the alternating row colors don't + // change when scrolling: + if (startIdx % 2) { + startIdx--; + } + let endIdx = Math.max(0, (ofs + vp_height) / row_height + prefetch); + endIdx = Math.ceil(endIdx); + // this.debug("render", opts); + const obsoleteNodes = new Set(); + this.nodeListElement.childNodes.forEach((elem) => { + const tr = elem; + obsoleteNodes.add(tr._wb_node); + }); + let idx = 0; + let top = 0; + let modified = false; + let prevElem = "first"; + this.visitRows(function (node) { + // node.log("visit") + const rowDiv = node._rowElem; + // Renumber all expanded nodes + if (node._rowIdx !== idx) { + node._rowIdx = idx; + modified = true; + } + if (idx < startIdx || idx > endIdx) { + // row is outside viewport bounds + if (rowDiv) { + prevElem = rowDiv; + } + } + else if (rowDiv && newNodesOnly) { + obsoleteNodes.delete(node); + // no need to update existing node markup + rowDiv.style.top = idx * ROW_HEIGHT + "px"; + prevElem = rowDiv; + } + else { + obsoleteNodes.delete(node); + // Create new markup + if (rowDiv) { + rowDiv.style.top = idx * ROW_HEIGHT + "px"; + } + node._render({ top: top, after: prevElem }); + // node.log("render", top, prevElem, "=>", node._rowElem); + prevElem = node._rowElem; + } + idx++; + top += row_height; + }); + this.treeRowCount = idx; + for (const n of obsoleteNodes) { + n._callEvent("discard"); + n.removeMarkup(); + } + // Resize tree container + this.nodeListElement.style.height = `${top}px`; + // this.log( + // `_updateRows(scrollOfs:${ofs}, ${startIdx}..${endIdx})`, + // this.nodeListElement.style.height + // ); + // this.logTimeEnd(label); + // this._validateRows(); + return modified; + } + /** + * Call `callback(node)` for all nodes in hierarchical order (depth-first, pre-order). + * @see {@link IterableIterator}, {@link WunderbaumNode.visit}. + * + * @param {function} callback the callback function. + * Return false to stop iteration, return "skip" to skip this node and + * children only. + * @returns {boolean} false, if the iterator was stopped. + */ + visit(callback) { + return this.root.visit(callback, false); + } + /** + * Call callback(node) for all nodes in vertical order, top down (or bottom up). + * + * Note that this considers expansion state, i.e. filtered nodes and children + * of collapsed nodes are skipped, unless `includeHidden` is set. + * + * Stop iteration if callback() returns false.
+ * Return false if iteration was stopped. + * + * @returns {boolean} false if iteration was canceled + */ + visitRows(callback, options) { + if (!this.root.hasChildren()) { + return false; + } + if (options && options.reverse) { + delete options.reverse; + return this._visitRowsUp(callback, options); + } + options = options || {}; + let i, nextIdx, parent, res, siblings, stopNode, siblingOfs = 0, skipFirstNode = options.includeSelf === false, node = options.start || this.root.children[0]; + const includeHidden = !!options.includeHidden; + const checkFilter = !includeHidden && this.filterMode === "hide"; + parent = node.parent; + while (parent) { + // visit siblings + siblings = parent.children; + nextIdx = siblings.indexOf(node) + siblingOfs; + assert(nextIdx >= 0, `Could not find ${node} in parent's children: ${parent}`); + for (i = nextIdx; i < siblings.length; i++) { + node = siblings[i]; + if (node === stopNode) { + return false; + } + if (checkFilter && + !node.statusNodeType && + !node.match && + !node.subMatchCount) { + continue; + } + if (!skipFirstNode && callback(node) === false) { + return false; + } + skipFirstNode = false; + // Dive into node's child nodes + if (node.children && + node.children.length && + (includeHidden || node.expanded)) { + res = node.visit((n) => { + if (n === stopNode) { + return false; + } + if (checkFilter && !n.match && !n.subMatchCount) { + return "skip"; + } + if (callback(n) === false) { + return false; + } + if (!includeHidden && n.children && !n.expanded) { + return "skip"; + } + }, false); + if (res === false) { + return false; + } + } + } + // Visit parent nodes (bottom up) + node = parent; + parent = parent.parent; + siblingOfs = 1; // + if (!parent && options.wrap) { + this.logDebug("visitRows(): wrap around"); + assert(options.start, "`wrap` option requires `start`"); + stopNode = options.start; + options.wrap = false; + parent = this.root; + siblingOfs = 0; + } + } + return true; + } + /** + * Call fn(node) for all nodes in vertical order, bottom up. + * @internal + */ + _visitRowsUp(callback, options) { + let children, idx, parent, node = options.start || this.root.children[0]; + const includeHidden = !!options.includeHidden; + if (options.includeSelf !== false) { + if (callback(node) === false) { + return false; + } + } + while (true) { + parent = node.parent; + children = parent.children; + if (children[0] === node) { + // If this is already the first sibling, goto parent + node = parent; + if (!node.parent) { + break; // first node of the tree + } + children = parent.children; + } + else { + // Otherwise, goto prev. sibling + idx = children.indexOf(node); + node = children[idx - 1]; + // If the prev. sibling has children, follow down to last descendant + while ((includeHidden || node.expanded) && + node.children && + node.children.length) { + children = node.children; + parent = node; + node = children[children.length - 1]; + } + } + // Skip invisible + if (!includeHidden && !node.isVisible()) { + continue; + } + if (callback(node) === false) { + return false; + } + } + return true; + } + /** + * Reload the tree with a new source. + * + * Previous data is cleared. Note that also column- and type defintions may + * be passed with the `source` object. + */ + load(source) { + this.clear(); + return this.root.load(source); + } + /** + * Disable render requests during operations that would trigger many updates. + * + * ```js + * try { + * tree.enableUpdate(false); + * // ... (long running operation that would trigger many updates) + * foo(); + * // ... NOTE: make sure that async operations have finished, e.g. + * await foo(); + * } finally { + * tree.enableUpdate(true); + * } + * ``` + */ + enableUpdate(flag) { + /* + 5 7 9 20 25 30 + 1 >-------------------------------------< + 2 >--------------------< + 3 >--------------------------< + */ + if (flag) { + assert(this._disableUpdateCount > 0, "enableUpdate(true) was called too often"); + this._disableUpdateCount--; + // this.logDebug( + // `enableUpdate(${flag}): count -> ${this._disableUpdateCount}...` + // ); + if (this._disableUpdateCount === 0) { + this.logDebug(`enableUpdate(): active again. Re-painting to catch up with ${this._disableUpdateIgnoreCount} ignored update requests...`); + this._disableUpdateIgnoreCount = 0; + this.update(ChangeType.any, { immediate: true }); + } + } + else { + this._disableUpdateCount++; + // this.logDebug( + // `enableUpdate(${flag}): count -> ${this._disableUpdateCount}...` + // ); + // this._disableUpdate = Date.now(); + } + // return !flag; // return previous value + } + /* --------------------------------------------------------------------------- + * FILTER + * -------------------------------------------------------------------------*/ + /** + * Dim or hide nodes. + */ + filterNodes(filter, options) { + return this.extensions.filter.filterNodes(filter, options); + } + /** + * Dim or hide whole branches. + */ + filterBranches(filter, options) { + return this.extensions.filter.filterBranches(filter, options); + } + /** + * Reset the filter. + */ + clearFilter() { + return this.extensions.filter.clearFilter(); + } + /** + * Return true if a filter is currently applied. + */ + isFilterActive() { + return !!this.filterMode; + } + /** + * Re-apply current filter. + */ + updateFilter() { + return this.extensions.filter.updateFilter(); + } + } + Wunderbaum.sequence = 0; + /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */ + Wunderbaum.version = "v0.8.0"; // Set to semver by 'grunt release' + /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */ + Wunderbaum.util = util; - exports.Wunderbaum = Wunderbaum; + exports.Wunderbaum = Wunderbaum; })); diff --git a/dist/wunderbaum.umd.min.js b/dist/wunderbaum.umd.min.js index 7b8d7e48..1499bf2a 100644 --- a/dist/wunderbaum.umd.min.js +++ b/dist/wunderbaum.umd.min.js @@ -1,87 +1,86 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).mar10={})}(this,(function(e){"use strict"; /*! - * Wunderbaum - util - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const t={0:"",1:"left",2:"middle",3:"right",4:"back",5:"forward"},i=function(){const e=navigator;return{isMac:/Mac/.test(e.platform)}}().isMac,s=/[&<>"'/]/g,n=/[<>"'/]/g,r={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function o(e,t){if(!e)throw t=t||"Assertion failed.",new Error(t)}function l(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function a(e){throw new Error(e)}function d(e){return(""+e).replace(s,(function(e){return r[e]}))}function c(e){return(""+e).replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function h(e){return(""+e).replace(n,(function(e){return r[e]}))}function u(e,t=!1){const i=e.tagName;let s=null;if("SPAN"===i&&e.classList.contains("wb-col")){const i=e,n=i.querySelector("input,select");if(n)return u(n,t);i.innerText=""+s}else if("INPUT"===i){const i=e;switch(i.type){case"button":case"reset":case"submit":case"image":break;case"checkbox":s=i.indeterminate?null:i.checked;break;case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":s=t?i.valueAsDate:i.value;break;case"number":case"range":s=i.valueAsNumber;break;case"radio":{const e=i.name,t=i.parentElement.querySelector(`input[name="${e}"]:checked`);s=t?t.value:void 0}break;default:s=i.value}}else if("SELECT"===i){s=e.value}return s}function p(e,t){const i=v(e).style;t?"none"===i.display&&(i.display=""):""===i.display&&(i.display="none")}function f(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstElementChild}const g=new Set(["Alt","Control","Meta","Shift"]);function v(e){return e?"string"==typeof e?document.querySelector(e):e:null}function m(e){return e?"string"==typeof e?document.querySelector(e):e:null}function b(e){const i=e.key,s=e.type,n=[];return e.altKey&&n.push("Alt"),e.ctrlKey&&n.push("Control"),e.metaKey&&n.push("Meta"),e.shiftKey&&n.push("Shift"),"click"===s||"dblclick"===s?n.push(t[e.button]+s):"wheel"===s?n.push(s):g.has(i)||n.push(i),n.join("+")}function y(...e){for(let t=1;t{e.addEventListener(t,(function(e){if(!n)return r(e);if(e.target){let t=e.target;if(t.matches(n))return r(e);if(t=t.closest(n),t)return r(e)}}))}))}function k(e,t,i,s){let n,r;const o=s||e,l=e[t],a=(...e)=>l.apply(o,e),d=e=>l.apply(o,e);e[t]=(...e)=>{try{return n=o._super,r=o._superApply,o._super=a,o._superApply=d,i.apply(o,e)}finally{o._super=n,o._superApply=r}}}function C(e,t,i=void 0){let s;e&&t.indexOf(".")>=0&&([s,t]=t.split("."),e=e[s]);const n=e?e[t]:null;return null!=n?n:i}function N(e){if(e instanceof Set)return e;if("string"==typeof e){const t=new Set;for(const i of e.split(" "))t.add(i.trim());return t}if(Array.isArray(e))return new Set(e);throw new Error("Cannot convert to Set: "+e)}function S(e,t){let i=0,s=null;const n=Object.assign({minDelay:16,defaultDelay:200,maxDelay:5e3,delayFactor:2},t),r=Math.max(16,+n.minDelay),o=+n.maxDelay,l=(...t)=>{if(i)s=t,i+=1;else{i=1;const a=t;s=null;const d=Date.now();try{e.apply(this,a)}catch(e){console.error(e)}const c=Date.now()-d,h=Math.min(Math.max(r,c*n.delayFactor),o),u=Math.max(r,h-c);setTimeout((()=>{i=0,null!=s&&l.apply(this,s)}),u)}};return l}var D,I,T,L,M,O=Object.freeze({__proto__:null,Deferred:class{constructor(){this.thens=[],this.catches=[],this.status=""}resolve(e){if(this.status)throw new Error("already settled");this.status="resolved",this.resolvedValue=e,this.thens.forEach((t=>t(e))),this.thens=[]}reject(e){if(this.status)throw new Error("already settled");this.status="rejected",this.rejectedError=e,this.catches.forEach((t=>t(e))),this.catches=[]}then(e){"resolved"===status?e(this.resolvedValue):this.thens.unshift(e)}catch(e){"rejected"===this.status?e(this.rejectedError):this.catches.unshift(e)}promise(){return{then:this.then,catch:this.catch}}},MAX_INT:9007199254740991,MOUSE_BUTTONS:t,adaptiveThrottle:S,assert:o,documentReady:l,documentReadyPromise:function(){return new Promise((e=>{l(e)}))},each:function(e,t){if(null==e)return e;const i=e.length;let s=0;if("number"==typeof i)for(;s")>=0&&a("Not implemented"),e},getOption:C,getValueFromElem:u,isArray:w,isEmptyObject:E,isFunction:function(e){return"function"==typeof e},isMac:i,isPlainObject:x,noop:function(...e){},onEvent:_,overrideMethod:k,setElemDisplay:p,setTimeoutPromise:function(e,t){return new Promise(((i,s)=>{setTimeout((()=>{try{i(e.apply(this))}catch(e){s(e)}}),t)}))},setValueToElem:function e(t,i){const s=t.tagName;if("SPAN"===s&&t.classList.contains("wb-col")){const s=t,n=s.querySelector("input,select");if(n)return e(n,i);s.innerText=""+i}else if("INPUT"===s){const e=t,s=e.type;switch(s){case"checkbox":e.indeterminate=null===i,e.checked=!!i;break;case"date":case"month":case"time":case"week":case"datetime":case"datetime-local":e.valueAsDate=new Date(i);break;case"number":case"range":null==i?e.value=i:e.valueAsNumber=i;break;case"radio":a(`Not yet implemented: ${s}`);break;case"button":case"reset":case"submit":case"image":break;default:e.value=null!=i?i:""}}else if("SELECT"===s){const e=t;null==i?e.selectedIndex=-1:e.value=i}},sleep:async function(e){return new Promise((t=>setTimeout(t,e)))},toSet:N,toggleCheckbox:function(e,t,i){const s=v(e);if(o("checkbox"===s.type,`Expected a checkbox: ${s.type}`),null!=i||(i=s.classList.contains("wb-tristate")||s.indeterminate),void 0===t){switch(s.indeterminate?null:s.checked){case!0:t=!1;break;case!1:t=!i||null;break;case null:t=!0}}s.indeterminate=null==t,s.checked=!!t},type:function(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}}); + * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 + * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE + * Modified for TypeScript type annotations. + */const t="object"==typeof global&&null!==global&&global.Object===Object&&global,i="object"==typeof globalThis&&null!==globalThis&&globalThis.Object==Object&&globalThis,s="object"==typeof self&&null!==self&&self.Object===Object&&self,n=i||t||s||Function("return this")();function r(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function o(e,t=0,i={}){let s,o,l,a,d,c,h=0,u=!1,p=!1,f=!0;const g=!t&&0!==t&&"function"==typeof n.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){const i=s,n=o;return s=o=void 0,h=t,a=e.apply(n,i),a}function m(e,t){return g?(n.cancelAnimationFrame(d),n.requestAnimationFrame(e)):setTimeout(e,t)}function y(e){const i=e-c;return void 0===c||i>=t||i<0||p&&e-h>=l}function b(){const e=Date.now();if(y(e))return w(e);d=m(b,function(e){const i=e-h,s=t-(e-c);return p?Math.min(s,l-i):s}(e))}function w(e){return d=void 0,f&&s?v(e):(s=o=void 0,a)}function E(...e){const i=Date.now(),n=y(i);if(s=e,o=this,c=i,n){if(void 0===d)return function(e){return h=e,d=m(b,t),u?v(e):a}(c);if(p)return d=m(b,t),v(c)}return void 0===d&&(d=m(b,t)),a}return t=+t||0,r(i)&&(u=!!i.leading,p="maxWait"in i,l=p?Math.max(+i.maxWait||0,t):l,f="trailing"in i?!!i.trailing:f),E.cancel=function(){void 0!==d&&function(e){if(g)return n.cancelAnimationFrame(e);clearTimeout(e)}(d),h=0,s=c=o=d=void 0},E.flush=function(){return void 0===d?a:w(Date.now())},E.pending=function(){return void 0!==d},E}function l(e,t=0,i={}){let s=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),o(e,t,{leading:s,trailing:n,maxWait:t})} /*! - * Wunderbaum - types - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */!function(e){e.any="any",e.data="data",e.colStructure="colStructure",e.resize="resize",e.row="row",e.structure="structure",e.status="status",e.scroll="scroll"}(D||(D={})),function(e){e.clearMarkup="clearMarkup",e.header="header",e.redraw="redraw",e.scroll="scroll"}(I||(I={})),function(e){e.ok="ok",e.loading="loading",e.error="error",e.noData="noData",e.paging="paging"}(T||(T={})),function(e){e.unknown="",e.checkbox="checkbox",e.column="column",e.expander="expander",e.icon="icon",e.prefix="prefix",e.title="title"}(L||(L={})),function(e){e.startRow="startRow",e.cell="cell",e.startCell="startCell",e.row="row"}(M||(M={})); + * Wunderbaum - util + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const a={0:"",1:"left",2:"middle",3:"right",4:"back",5:"forward"},d=function(){const e=navigator;return{isMac:/Mac/.test(e.platform)}}().isMac,c=/[&<>"'/]/g,h=/[<>"'/]/g,u={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};class p extends Error{constructor(e){super(e),this.name="ValidationError"}}function f(e,t){if(!e)throw t=t||"Assertion failed.",new Error(t)}function g(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function v(e){throw new Error(e)}function m(e){return(""+e).replace(c,(function(e){return u[e]}))}function y(e){return(""+e).replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function b(e){return(""+e).replace(h,(function(e){return u[e]}))}function w(e,t=!1){const i=e.tagName;let s=null;if("SPAN"===i&&e.classList.contains("wb-col")){const i=e,n=i.querySelector("input,select");if(n)return w(n,t);i.innerText=""+s}else if("INPUT"===i){const i=e;switch(i.type){case"button":case"reset":case"submit":case"image":break;case"checkbox":s=i.indeterminate?null:i.checked;break;case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":s=t?i.valueAsDate:i.value;break;case"number":case"range":s=i.valueAsNumber;break;case"radio":{const e=i.name,t=i.parentElement.querySelector(`input[name="${e}"]:checked`);s=t?t.value:void 0}break;default:s=i.value}}else if("SELECT"===i){s=e.value}return s}function E(e,t){const i=k(e).style;t?"none"===i.display&&(i.display=""):""===i.display&&(i.display="none")}function x(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstElementChild}const _=new Set(["Alt","Control","Meta","Shift"]);function k(e){return e?"string"==typeof e?document.querySelector(e):e:null}function C(e){const t=e.key,i=e.type,s=[];return e.altKey&&s.push("Alt"),e.ctrlKey&&s.push("Control"),e.metaKey&&s.push("Meta"),e.shiftKey&&s.push("Shift"),"click"===i||"dblclick"===i?s.push(a[e.button]+i):"wheel"===i?s.push(i):_.has(t)||s.push(t),s.join("+")}function N(...e){for(let t=1;t{e.addEventListener(t,(function(e){if(!n)return r(e);if(e.target){let t=e.target;if(t.matches(n))return r(e);if(t=t.closest(n),t)return r(e)}}))}))}function L(e,t,i,s){let n,r;const o=s||e,l=e[t],a=(...e)=>l.apply(o,e),d=e=>l.apply(o,e);e[t]=(...e)=>{try{return n=o._super,r=o._superApply,o._super=a,o._superApply=d,i.apply(o,e)}finally{o._super=n,o._superApply=r}}}function M(e,t,i=void 0){let s;e&&t.indexOf(".")>=0&&([s,t]=t.split("."),e=e[s]);const n=e?e[t]:null;return null!=n?n:i}function O(e){if(e instanceof Set)return e;if("string"==typeof e){const t=new Set;for(const i of e.split(" "))t.add(i.trim());return t}if(Array.isArray(e))return new Set(e);throw new Error("Cannot convert to Set: "+e)}function A(e,t){const i=Object.assign({minDelay:16,defaultDelay:200,maxDelay:5e3,delayFactor:2},t),s=Math.max(16,+i.minDelay),n=+i.maxDelay;let r=0,o=null,l=null;const a=(...t)=>{if(r)o=t,r+=1;else{r=1;const d=t;o=null;const c=Date.now();try{e.apply(this,d)}catch(e){console.error(e)}const h=Date.now()-c,u=Math.min(Math.max(s,h*i.delayFactor),n),p=Math.max(s,u-h);l=setTimeout((()=>{l=null,r=0,null!=o&&a.apply(this,o)}),p)}};return a.cancel=()=>{l&&(clearTimeout(l),l=null),o=null,r=0},a.pending=()=>!!l,a.flush=()=>{throw new Error("Not implemented")},a}var $,P,R,F,z,U=Object.freeze({__proto__:null,Deferred:class{constructor(){this.thens=[],this.catches=[],this.status=""}resolve(e){if(this.status)throw new Error("already settled");this.status="resolved",this.resolvedValue=e,this.thens.forEach((t=>t(e))),this.thens=[]}reject(e){if(this.status)throw new Error("already settled");this.status="rejected",this.rejectedError=e,this.catches.forEach((t=>t(e))),this.catches=[]}then(e){"resolved"===status?e(this.resolvedValue):this.thens.unshift(e)}catch(e){"rejected"===this.status?e(this.rejectedError):this.catches.unshift(e)}promise(){return{then:this.then,catch:this.catch}}},MAX_INT:9007199254740991,MOUSE_BUTTONS:a,ValidationError:p,adaptiveThrottle:A,assert:f,debounce:o,documentReady:g,documentReadyPromise:function(){return new Promise((e=>{g(e)}))},each:function(e,t){if(null==e)return e;const i=e.length;let s=0;if("number"==typeof i)for(;s")>=0&&v("Not implemented"),e},getOption:M,getValueFromElem:w,isArray:S,isEmptyObject:D,isFunction:function(e){return"function"==typeof e},isMac:d,isPlainObject:T,noop:function(...e){},onEvent:I,overrideMethod:L,setElemDisplay:E,setTimeoutPromise:function(e,t){return new Promise(((i,s)=>{setTimeout((()=>{try{i(e.apply(this))}catch(e){s(e)}}),t)}))},setValueToElem:function e(t,i){const s=t.tagName;if("SPAN"===s&&t.classList.contains("wb-col")){const s=t,n=s.querySelector("input,select");if(n)return e(n,i);s.innerText=""+i}else if("INPUT"===s){const e=t,s=e.type;switch(s){case"checkbox":e.indeterminate=null===i,e.checked=!!i;break;case"date":case"month":case"time":case"week":case"datetime":case"datetime-local":e.valueAsDate=new Date(i);break;case"number":case"range":null==i?e.value=i:e.valueAsNumber=i;break;case"radio":v(`Not yet implemented: ${s}`);break;case"button":case"reset":case"submit":case"image":break;default:e.value=null!=i?i:""}}else if("SELECT"===s){const e=t;null==i?e.selectedIndex=-1:e.value=i}},sleep:async function(e){return new Promise((t=>setTimeout(t,e)))},throttle:l,toSet:O,toggleCheckbox:function(e,t,i){const s=k(e);if(f("checkbox"===s.type,`Expected a checkbox: ${s.type}`),null!=i||(i=s.classList.contains("wb-tristate")||s.indeterminate),void 0===t){switch(s.indeterminate?null:s.checked){case!0:t=!1;break;case!1:t=!i||null;break;case null:t=!0}}s.indeterminate=null==t,s.checked=!!t},type:function(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}}); /*! - * Wunderbaum - wb_extension_base - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ -class A{constructor(e,t,i){this.enabled=!0,this.tree=e,this.id=t,this.treeOpts=e.options;const s=e.options;void 0===this.treeOpts[t]?s[t]=this.extensionOpts=y({},i):(this.extensionOpts=y({},i,s[t]),s[t]=this.extensionOpts),this.enabled=this.getPluginOption("enabled",!0)}init(){this.tree.element.classList.add("wb-ext-"+this.id)}getPluginOption(e,t){var i;return null!==(i=this.extensionOpts[e])&&void 0!==i?i:t}setPluginOption(e,t){this.extensionOpts[e]=t}setEnabled(e=!0){return this.setPluginOption("enabled",!!e)}onKeyEvent(e){}onRender(e){}} + * Wunderbaum - types + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */!function(e){e.any="any",e.data="data",e.colStructure="colStructure",e.resize="resize",e.row="row",e.structure="structure",e.status="status",e.scroll="scroll"}($||($={})),function(e){e.clearMarkup="clearMarkup",e.header="header",e.redraw="redraw",e.scroll="scroll"}(P||(P={})),function(e){e.ok="ok",e.loading="loading",e.error="error",e.noData="noData",e.paging="paging"}(R||(R={})),function(e){e.unknown="",e.checkbox="checkbox",e.column="column",e.expander="expander",e.icon="icon",e.prefix="prefix",e.title="title"}(F||(F={})),function(e){e.startRow="startRow",e.cell="cell",e.startCell="startCell",e.row="row"}(z||(z={})); /*! - * debounce & throttle, taken from https://github.com/lodash/lodash v4.17.21 - * MIT License: https://raw.githubusercontent.com/lodash/lodash/4.17.21-npm/LICENSE - * Modified for TypeScript type annotations. - */const $="object"==typeof global&&null!==global&&global.Object===Object&&global,P="object"==typeof globalThis&&null!==globalThis&&globalThis.Object==Object&&globalThis,R="object"==typeof self&&null!==self&&self.Object===Object&&self,F=P||$||R||Function("return this")();function z(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function U(e,t=0,i={}){let s,n,r,o,l,a,d=0,c=!1,h=!1,u=!0;const p=!t&&0!==t&&"function"==typeof F.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){const i=s,r=n;return s=n=void 0,d=t,o=e.apply(r,i),o}function g(e,t){return p?(F.cancelAnimationFrame(l),F.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){const i=e-a;return void 0===a||i>=t||i<0||h&&e-d>=r}function m(){const e=Date.now();if(v(e))return b(e);l=g(m,function(e){const i=e-d,s=t-(e-a);return h?Math.min(s,r-i):s}(e))}function b(e){return l=void 0,u&&s?f(e):(s=n=void 0,o)}function y(...e){const i=Date.now(),r=v(i);if(s=e,n=this,a=i,r){if(void 0===l)return function(e){return d=e,l=g(m,t),c?f(e):o}(a);if(h)return l=g(m,t),f(a)}return void 0===l&&(l=g(m,t)),o}return t=+t||0,z(i)&&(c=!!i.leading,h="maxWait"in i,r=h?Math.max(+i.maxWait||0,t):r,u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==l&&function(e){if(p)return F.cancelAnimationFrame(e);clearTimeout(e)}(l),d=0,s=a=n=l=void 0},y.flush=function(){return void 0===l?o:b(Date.now())},y.pending=function(){return void 0!==l},y} + * Wunderbaum - wb_extension_base + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ +class V{constructor(e,t,i){this.enabled=!0,this.tree=e,this.id=t,this.treeOpts=e.options;const s=e.options;void 0===this.treeOpts[t]?s[t]=this.extensionOpts=N({},i):(this.extensionOpts=N({},i,s[t]),s[t]=this.extensionOpts),this.enabled=this.getPluginOption("enabled",!0)}init(){this.tree.element.classList.add("wb-ext-"+this.id)}getPluginOption(e,t){var i;return null!==(i=this.extensionOpts[e])&&void 0!==i?i:t}setPluginOption(e,t){this.extensionOpts[e]=t}setEnabled(e=!0){return this.setPluginOption("enabled",!!e)}onKeyEvent(e){}onRender(e){}} /*! - * Wunderbaum - ext-filter - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */ -const q="￷",j="￸",H=new RegExp(c("￷"),"g"),V=new RegExp(c("￸"),"g");class K extends A{constructor(e){super(e,"filter",{connectInput:null,autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,mode:"dim",noData:!0}),this.lastFilterArgs=null}init(){super.init();const e=this.getPluginOption("connectInput");e&&(this.queryInput=v(e),_(this.queryInput,"input",U((e=>{this.filterNodes(this.queryInput.value.trim(),{})}),700)))}setPluginOption(e,t){if(super.setPluginOption(e,t),"mode"===e)this.tree.filterMode="hide"===t?"hide":"dim",this.tree.updateFilter()}_applyFilterNoUpdate(e,t,i){return this.tree.runWithDeferredUpdate((()=>this._applyFilterImpl(e,t,i)))}_applyFilterImpl(e,t,i){let s,n,r=0;const o=Date.now(),l=this.tree,a=l.options,h=a.autoCollapse,u=y({},a.filter,i),p="hide"===u.mode,f=!!u.leavesOnly&&!t;if("string"==typeof e){if(""===e)return l.logInfo("Passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();s=u.fuzzy?e.split("").map(c).reduce((function(e,t){return e+"([^"+t+"]*)"+t}),""):c(e);const t=new RegExp(s,"i"),i=new RegExp(c(e),"gi");e=e=>{if(!e.title)return!1;const s=e.title,r=s.match(t);return r&&u.highlight&&(n=u.fuzzy?function(e,t,i=!0){const s=[];for(let e=1;e"+n[e]+""}));return n.join("")} + * Wunderbaum - ext-filter + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const q="￷",j="￸",K=new RegExp(y("￷"),"g"),H=new RegExp(y("￸"),"g");class W extends V{constructor(e){super(e,"filter",{connectInput:null,autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,mode:"dim",noData:!0}),this.lastFilterArgs=null}init(){super.init();const e=this.getPluginOption("connectInput");e&&(this.queryInput=k(e),I(this.queryInput,"input",o((e=>{this.filterNodes(this.queryInput.value.trim(),{})}),700)))}setPluginOption(e,t){if(super.setPluginOption(e,t),"mode"===e)this.tree.filterMode="hide"===t?"hide":"dim",this.tree.updateFilter()}_applyFilterNoUpdate(e,t,i){return this.tree.runWithDeferredUpdate((()=>this._applyFilterImpl(e,t,i)))}_applyFilterImpl(e,t,i){let s,n,r=0;const o=Date.now(),l=this.tree,a=l.options,d=a.autoCollapse,c=N({},a.filter,i),h="hide"===c.mode,u=!!c.leavesOnly&&!t;if("string"==typeof e){if(""===e)return l.logInfo("Passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();s=c.fuzzy?e.split("").map(y).reduce((function(e,t){return e+"([^"+t+"]*)"+t}),""):y(e);const t=new RegExp(s,"i"),i=new RegExp(y(e),"gi");e=e=>{if(!e.title)return!1;const s=e.title,r=s.match(t);return r&&c.highlight&&(n=c.fuzzy?function(e,t,i=!0){const s=[];for(let e=1;e"+n[e]+""}));return n.join("")} /*! - * Wunderbaum - ext-keynav - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */(s,r,!0):s.replace(i,(function(e){return q+e+j})),e.titleWithHighlight=d(n).replace(H,"").replace(V,"")),!!r}}return l.filterMode=u.mode,this.lastFilterArgs=arguments,l.element.classList.toggle("wb-ext-filter-hide",!!p),l.element.classList.toggle("wb-ext-filter-dim",!p),l.element.classList.toggle("wb-ext-filter-hide-expanders",!!u.hideExpanders),l.root.subMatchCount=0,l.visit((e=>{delete e.match,delete e.titleWithHighlight,e.subMatchCount=0})),l.setStatus(T.ok),a.autoCollapse=!1,l.visit((i=>{if(f&&null!=i.children)return;let s=e(i);if("skip"===s)return i.visit((function(e){e.match=!1}),!0),"skip";let n=!1;(t||"branch"===s)&&i.parent.match&&(s=!0,n=!0),s&&(r++,i.match=!0,i.visitParents((e=>{e!==i&&(e.subMatchCount+=1),!u.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0}),e._filterAutoExpanded=!0)}),!0))})),a.autoCollapse=h,0===r&&u.noData&&p&&l.root.setStatus(T.noData),l.logInfo(`Filter '${s}' found ${r} nodes in ${Date.now()-o} ms.`),r}filterNodes(e,t){return this._applyFilterNoUpdate(e,!1,t)}filterBranches(e,t){return this._applyFilterNoUpdate(e,!0,t)}updateFilter(){var e;const t=this.tree;t.filterMode&&this.lastFilterArgs&&(null===(e=t.options.filter)||void 0===e?void 0:e.autoApply)?this._applyFilterNoUpdate.apply(this,this.lastFilterArgs):t.logWarn("updateFilter(): no filter active.")}clearFilter(){const e=this.tree;e.enableUpdate(!1),e.setStatus(T.ok),delete e.root.match,delete e.root.subMatchCount,e.visit((e=>{delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0}),delete e._filterAutoExpanded})),e.filterMode=null,this.lastFilterArgs=null,e.element.classList.remove("wb-ext-filter-dim","wb-ext-filter-hide"),e.enableUpdate(!0)}}class W extends A{constructor(e){super(e,"keynav",{})}_getEmbeddedInputElem(e){var t;let i=null;if(e&&null!=e.type)i=e;else{const e=null===(t=this.tree.getActiveColElem())||void 0===t?void 0:t.querySelector("input,select");e&&(i=e)}return i}_isCurInputFocused(){var e;return!!(null===(e=this.tree.getActiveColElem())||void 0===e?void 0:e.querySelector("input:focus,select:focus"))}onKeyEvent(e){const t=e.event,i=this.tree,s=e.options,n=!t.ctrlKey||s.autoActivate,r=this._getEmbeddedInputElem(t.target),o=r&&this._isCurInputFocused(),l=s.navigationModeOption;let a,d=b(t),c=e.node,h=!0;if(!i.isEnabled())return!1;if(!1===i._callEvent("keydown",e))return!1;if(!1===i._callMethod("edit._preprocessKeyEvent",e))return!1;if(!c){const e=i.getFocusNode()||i.getActiveNode(),t=i.getFirstChild();if(!e&&t&&"ArrowDown"===d)return t.logInfo("Keydown: activate first node."),void t.setActive();a=e||t,a&&(a.setFocus(),c=i.getFocusNode(),c.logInfo("Keydown: force focus on active node."))}const u=c.isColspan();if(i.isRowNav()){if(o){switch(d){case"Enter":r.blur(),i.setFocus();break;case"Escape":c._render(),i.setFocus()}return}if(s.quicksearch&&1===d.length&&/^\w$/.test(d)&&!r){const e=Date.now();e-i.lastQuicksearchTime>500&&(i.lastQuicksearchTerm=""),i.lastQuicksearchTime=e,i.lastQuicksearchTerm+=d;const s=i.findNextNode(i.lastQuicksearchTerm,i.getActiveNode());return s&&s.setActive(!0,{event:t}),void t.preventDefault()}switch(d){case"Enter":c.isActive()&&(c.isExpanded()?d="Subtract":c.isExpandable(!0)&&(d="Add"));break;case"ArrowLeft":c.expanded&&(d="Subtract");break;case"ArrowRight":if(!c.expanded&&c.isExpandable(!0))d="Add";else if(l===M.startCell||l===M.startRow)return t.preventDefault(),i.setCellNav(),!1}switch(d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":c.getOption("checkbox")?c.toggleSelected():c.setActive(!0,{event:t});break;case"Enter":c.setActive(!0,{event:t});break;case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"Backspace":case"End":case"Home":case"Control+End":case"Control+Home":case"Meta+ArrowDown":case"Meta+ArrowUp":case"PageDown":case"PageUp":c.navigate(d,{activate:n,event:t});break;default:h=!1}}else{const e=this._getEmbeddedInputElem(null),s=e?e.type||e.tagName:"",r=e&&this._isCurInputFocused(),o=e&&"checkbox"!==s;if(r){if("Escape"===d)return c._render(),c.logDebug("Reset focused input"),i.setFocus(),void i.setColumn(i.activeColIdx);if("Enter"!==d)return void c.logDebug(`Ignored ${d} inside focused input`)}else if(e&&1===d.length&&o)return e.focus(),e.value="",c.logDebug(`Focus imput: ${d}`),!1;switch("Tab"===d?(d="ArrowRight",h=!0):"Shift+Tab"===d&&(d=i.activeColIdx>0?"ArrowLeft":"",h=!0),d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":0===i.activeColIdx&&c.getOption("checkbox")?(c.toggleSelected(),h=!0):e&&"checkbox"===s&&(e.click(),h=!0);break;case"F2":e&&!r&&o&&(e.focus(),h=!0);break;case"Enter":i.setFocus(),(0===i.activeColIdx||u)&&c.isExpandable()?(c.setExpanded(!c.isExpanded()),h=!0):e&&!r&&o&&(e.focus(),h=!0);break;case"Escape":i.setFocus(),c.log("keynav: focus tree..."),i.isCellNav()&&l!==M.cell&&(c.log("keynav: setCellNav(false)"),i.setCellNav(!1),i.setFocus(),h=!0);break;case"ArrowLeft":i.setFocus(),u&&c.isExpanded()?c.setExpanded(!1):!u&&i.activeColIdx>0?i.setColumn(i.activeColIdx-1):l!==M.cell&&i.setCellNav(!1),h=!0;break;case"ArrowRight":i.setFocus(),u&&!c.isExpanded()?c.setExpanded():!u&&i.activeColIdx0&&i.setColumn(0),h=!0;break;case"End":i.setFocus(),!u&&i.activeColIdx").replace(H,"")),!!r}}return l.filterMode=c.mode,this.lastFilterArgs=arguments,l.element.classList.toggle("wb-ext-filter-hide",!!h),l.element.classList.toggle("wb-ext-filter-dim",!h),l.element.classList.toggle("wb-ext-filter-hide-expanders",!!c.hideExpanders),l.root.subMatchCount=0,l.visit((e=>{delete e.match,delete e.titleWithHighlight,e.subMatchCount=0})),l.setStatus(R.ok),a.autoCollapse=!1,l.visit((i=>{if(u&&null!=i.children)return;let s=e(i);if("skip"===s)return i.visit((function(e){e.match=!1}),!0),"skip";let n=!1;(t||"branch"===s)&&i.parent.match&&(s=!0,n=!0),s&&(r++,i.match=!0,i.visitParents((e=>{e!==i&&(e.subMatchCount+=1),!c.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0}),e._filterAutoExpanded=!0)}),!0))})),a.autoCollapse=d,0===r&&c.noData&&h&&("string"==typeof c.noData?l.root.setStatus(R.noData,{message:c.noData}):l.root.setStatus(R.noData)),l.logInfo(`Filter '${s}' found ${r} nodes in ${Date.now()-o} ms.`),r}filterNodes(e,t){return this._applyFilterNoUpdate(e,!1,t)}filterBranches(e,t){return this._applyFilterNoUpdate(e,!0,t)}updateFilter(){var e;const t=this.tree;t.filterMode&&this.lastFilterArgs&&(null===(e=t.options.filter)||void 0===e?void 0:e.autoApply)?this._applyFilterNoUpdate.apply(this,this.lastFilterArgs):t.logWarn("updateFilter(): no filter active.")}clearFilter(){const e=this.tree;e.enableUpdate(!1),e.setStatus(R.ok),delete e.root.match,delete e.root.subMatchCount,e.visit((e=>{delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0}),delete e._filterAutoExpanded})),e.filterMode=null,this.lastFilterArgs=null,e.element.classList.remove("wb-ext-filter-dim","wb-ext-filter-hide"),e.enableUpdate(!0)}}class B extends V{constructor(e){super(e,"keynav",{})}_getEmbeddedInputElem(e){var t;let i=null;if(e&&null!=e.type)i=e;else{const e=null===(t=this.tree.getActiveColElem())||void 0===t?void 0:t.querySelector("input,select");e&&(i=e)}return i}_isCurInputFocused(){var e;return!!(null===(e=this.tree.getActiveColElem())||void 0===e?void 0:e.querySelector("input:focus,select:focus"))}onKeyEvent(e){const t=e.event,i=this.tree,s=e.options,n=!t.ctrlKey||s.autoActivate,r=this._getEmbeddedInputElem(t.target),o=r&&this._isCurInputFocused(),l=s.navigationModeOption;let a,d=C(t),c=e.node,h=!0;if(!i.isEnabled())return!1;if(!1===i._callEvent("keydown",e))return!1;if(!1===i._callMethod("edit._preprocessKeyEvent",e))return!1;if(!c){const e=i.getFocusNode()||i.getActiveNode(),t=i.getFirstChild();if(!e&&t&&"ArrowDown"===d)return t.logInfo("Keydown: activate first node."),void t.setActive();a=e||t,a&&(a.setFocus(),c=i.getFocusNode(),c.logInfo("Keydown: force focus on active node."))}const u=c.isColspan();if(i.isRowNav()){if(o){switch(d){case"Enter":r.blur(),i.setFocus();break;case"Escape":c._render(),i.setFocus()}return}if(s.quicksearch&&1===d.length&&/^\w$/.test(d)&&!r){const e=Date.now();e-i.lastQuicksearchTime>500&&(i.lastQuicksearchTerm=""),i.lastQuicksearchTime=e,i.lastQuicksearchTerm+=d;const s=i.findNextNode(i.lastQuicksearchTerm,i.getActiveNode());return s&&s.setActive(!0,{event:t}),void t.preventDefault()}switch(d){case"Enter":c.isActive()&&(c.isExpanded()?d="Subtract":c.isExpandable(!0)&&(d="Add"));break;case"ArrowLeft":c.expanded&&(d="Subtract");break;case"ArrowRight":if(!c.expanded&&c.isExpandable(!0))d="Add";else if(l===z.startCell||l===z.startRow)return t.preventDefault(),i.setCellNav(),!1}switch(d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":c.getOption("checkbox")?c.toggleSelected():c.setActive(!0,{event:t});break;case"Enter":c.setActive(!0,{event:t});break;case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"Backspace":case"End":case"Home":case"Control+End":case"Control+Home":case"Meta+ArrowDown":case"Meta+ArrowUp":case"PageDown":case"PageUp":c.navigate(d,{activate:n,event:t});break;default:h=!1}}else{const e=r?r.type||r.tagName:"",s=r&&"checkbox"!==e;if(o){if("Escape"===d)return c.logDebug("Reset focused input on Escape"),r.setCustomValidity(""),c._render(),i.setFocus(),void i.setColumn(i.activeColIdx);if("Enter"!==d)return r&&r.checkValidity&&!r.checkValidity()?(c.logDebug(`Ignored ${d} inside invalid input`),!1):void c.logDebug(`Ignored ${d} inside focused input`)}else if(r&&1===d.length&&s)return r.focus(),r.value="",c.logDebug(`Focus input: ${d}`),!1;switch("Tab"===d?(d="ArrowRight",h=!0):"Shift+Tab"===d&&(d=i.activeColIdx>0?"ArrowLeft":"",h=!0),d){case"+":case"Add":c.setExpanded(!0);break;case"-":case"Subtract":c.setExpanded(!1);break;case" ":0===i.activeColIdx&&c.getOption("checkbox")?(c.toggleSelected(),h=!0):r&&"checkbox"===e&&(r.click(),h=!0);break;case"F2":r&&!o&&s&&(r.focus(),h=!0);break;case"Enter":i.setFocus(),(0===i.activeColIdx||u)&&c.isExpandable()?(c.setExpanded(!c.isExpanded()),h=!0):r&&!o&&s&&(r.focus(),h=!0);break;case"Escape":i.setFocus(),c.log("keynav: focus tree..."),i.isCellNav()&&l!==z.cell&&(c.log("keynav: setCellNav(false)"),i.setCellNav(!1),i.setFocus(),h=!0);break;case"ArrowLeft":i.setFocus(),u&&c.isExpanded()?c.setExpanded(!1):!u&&i.activeColIdx>0?i.setColumn(i.activeColIdx-1):l!==z.cell&&i.setCellNav(!1),h=!0;break;case"ArrowRight":i.setFocus(),u&&!c.isExpanded()?c.setExpanded():!u&&i.activeColIdx0&&i.setColumn(0),h=!0;break;case"End":i.setFocus(),!u&&i.activeColIdx=4){const t=this.ignoreEvents,i=this.prefix;k(e,"callEvent",(function(s,n){if(t.has(s))return e._superApply(arguments);const r=Date.now(),o=e._superApply(arguments);return e.logDebug(`${i}: callEvent('${s}') took ${Date.now()-r} ms.`,arguments[1]),o}))}}onKeyEvent(e){this.tree.logDebug(`${this.prefix}: onKeyEvent()`,e)}} + * Wunderbaum - ext-logger + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */class G extends V{constructor(e){super(e,"logger",{}),this.ignoreEvents=new Set(["iconBadge","render","discard"]),this.prefix=e+".ext-logger"}init(){const e=this.tree;if(e.getOption("debugLevel")>=4){const t=this.ignoreEvents,i=this.prefix;L(e,"callEvent",(function(s,n){if(t.has(s))return e._superApply(arguments);const r=Date.now(),o=e._superApply(arguments);return e.logDebug(`${i}: callEvent('${s}') took ${Date.now()-r} ms.`,arguments[1]),o}))}}onKeyEvent(e){this.tree.logDebug(`${this.prefix}: onKeyEvent()`,e)}} /*! - * Wunderbaum - common - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const G=22,Q=new RegExp(/\.|\//),Y={bootstrap:{error:"bi bi-exclamation-triangle",loading:"bi bi-chevron-right wb-busy",noData:"bi bi-question-circle",expanderExpanded:"bi bi-chevron-down",expanderCollapsed:"bi bi-chevron-right",expanderLazy:"bi bi-chevron-right wb-helper-lazy-expander",checkChecked:"bi bi-check-square",checkUnchecked:"bi bi-square",checkUnknown:"bi bi-dash-square-dotted",radioChecked:"bi bi-circle-fill",radioUnchecked:"bi bi-circle",radioUnknown:"bi bi-record-circle",folder:"bi bi-folder2",folderOpen:"bi bi-folder2-open",folderLazy:"bi bi-folder-symlink",doc:"bi bi-file-earmark"},fontawesome6:{error:"fa-solid fa-triangle-exclamation",loading:"fa-solid fa-chevron-right fa-beat",noData:"fa-solid fa-circle-question",expanderExpanded:"fa-solid fa-chevron-down",expanderCollapsed:"fa-solid fa-chevron-right",expanderLazy:"fa-solid fa-chevron-right wb-helper-lazy-expander",checkChecked:"fa-regular fa-square-check",checkUnchecked:"fa-regular fa-square",checkUnknown:"fa-regular fa-square-minus",radioChecked:"fa-solid fa-circle",radioUnchecked:"fa-regular fa-circle",radioUnknown:"fa-regular fa-circle-question",folder:"fa-solid fa-folder-closed",folderOpen:"fa-regular fa-folder-open",folderLazy:"fa-solid fa-folder-plus",doc:"fa-regular fa-file"}},J=new Set(["_format","_keyMap","_positional","_typeList","_valueMap","_version","children","columns","types"]),X={" ":"toggleSelect","+":"expand",Add:"expand",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",Backspace:"parent","/":"collapseAll",Divide:"collapseAll",End:"lastCol",Home:"firstCol","Control+End":"last","Control+Home":"first","Meta+ArrowDown":"last","Meta+ArrowUp":"first","*":"expandAll",Multiply:"expandAll",PageDown:"pageDown",PageUp:"pageUp","-":"collapse",Subtract:"collapse"};function Z(e){return e instanceof RegExp?function(t){return e.test(t.title)}:(o("string"==typeof e,`Expected a string or RegExp: ${e}`),function(t){return t.title===e})}function ee(e,t){const i=e.title.toLowerCase(),s=t.title.toLowerCase();return i===s?0:i>s?1:-1}function te(e){let{_format:t,_version:i=1,_keyMap:s,_valueMap:n}=e;o(1===i,`Expected file version 1 instead of ${i}`);let r=s,l={};if(r)for(const[e,t]of Object.entries(r))l[t]=e;if(r&&r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),[r,l]=[l,r]}if(null!=e._typeList){const t='source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.';if(null!=n)throw new Error(t);console.warn(t),n={type:e._typeList},delete e._typeList}"flat"===t&&function(e){var t,i,s;const{_format:n,_keyMap:r={},_positional:o=[],children:l}=e;if("flat"!==n)throw new Error(`Expected source._format: "flat", but got ${n}`);if(o&&o.includes("children"))throw new Error(`source._positional must not include "children": ${o}`);let a=r;if(r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),a={};for(const[e,t]of Object.entries(r))a[t]=e}const d=o.map((e=>a[e])),c=[],h={},u={},p=null!==(t=a.key)&&void 0!==t?t:"key",f=null!==(i=a.children)&&void 0!==i?i:"children";for(const[e,t]of l.entries()){const[i,n,r={}]=t;t[1]=null,null!=t[2]&&(t[2]=null),n.forEach(((e,t)=>{r[d[t]]=e})),u[e]=r;const o=r[p];null!=o&&(h[o]=r);let l=null;if(null===i);else if("number"==typeof i){if(l=u[i],void 0===l)throw new Error(`unflattenSource: Could not find parent node by index: ${i}.`)}else if(l=h[i],void 0===l)throw new Error(`unflattenSource: Could not find parent node by key: ${i}`);l?(null!==(s=l[f])&&void 0!==s||(l[f]=[]),l[f].push(r)):c.push(r)}e.children=c}(e),delete e._format,delete e._version,delete e._keyMap,delete e._valueMap,delete e._positional,(s||n)&&function e(t){for(const i of t)Object.getOwnPropertyNames(i).forEach((e=>{const t=i[e];let r=e;if(s&&null!=l[e]&&(r=l[e],r!==e&&(i[r]=t,delete i[e])),n&&"number"==typeof t&&null!=n[r]){const e=n[r][t];if(null==e)throw new Error(`Expected valueMap[${r}][${t}] entry in [${n[r]}]`);i[r]=e}})),i.children&&e(i.children)}(e.children)} + * Wunderbaum - common + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const Q=22,Y=new RegExp(/\.|\//),J={bootstrap:{error:"bi bi-exclamation-triangle",loading:"bi bi-chevron-right wb-busy",noData:"bi bi-question-circle",expanderExpanded:"bi bi-chevron-down",expanderCollapsed:"bi bi-chevron-right",expanderLazy:"bi bi-chevron-right wb-helper-lazy-expander",checkChecked:"bi bi-check-square",checkUnchecked:"bi bi-square",checkUnknown:"bi bi-dash-square-dotted",radioChecked:"bi bi-circle-fill",radioUnchecked:"bi bi-circle",radioUnknown:"bi bi-record-circle",folder:"bi bi-folder2",folderOpen:"bi bi-folder2-open",folderLazy:"bi bi-folder-symlink",doc:"bi bi-file-earmark"},fontawesome6:{error:"fa-solid fa-triangle-exclamation",loading:"fa-solid fa-chevron-right fa-beat",noData:"fa-solid fa-circle-question",expanderExpanded:"fa-solid fa-chevron-down",expanderCollapsed:"fa-solid fa-chevron-right",expanderLazy:"fa-solid fa-chevron-right wb-helper-lazy-expander",checkChecked:"fa-regular fa-square-check",checkUnchecked:"fa-regular fa-square",checkUnknown:"fa-regular fa-square-minus",radioChecked:"fa-solid fa-circle",radioUnchecked:"fa-regular fa-circle",radioUnknown:"fa-regular fa-circle-question",folder:"fa-solid fa-folder-closed",folderOpen:"fa-regular fa-folder-open",folderLazy:"fa-solid fa-folder-plus",doc:"fa-regular fa-file"}},X=new Set(["_format","_keyMap","_positional","_typeList","_valueMap","_version","children","columns","types"]),Z={" ":"toggleSelect","+":"expand",Add:"expand",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",Backspace:"parent","/":"collapseAll",Divide:"collapseAll",End:"lastCol",Home:"firstCol","Control+End":"last","Control+Home":"first","Meta+ArrowDown":"last","Meta+ArrowUp":"first","*":"expandAll",Multiply:"expandAll",PageDown:"pageDown",PageUp:"pageUp","-":"collapse",Subtract:"collapse"};function ee(e){return e instanceof RegExp?function(t){return e.test(t.title)}:(f("string"==typeof e,`Expected a string or RegExp: ${e}`),function(t){return t.title===e})}function te(e,t){const i=e.title.toLowerCase(),s=t.title.toLowerCase();return i===s?0:i>s?1:-1}function ie(e){let{_format:t,_version:i=1,_keyMap:s,_valueMap:n}=e;f(1===i,`Expected file version 1 instead of ${i}`);let r=s,o={};if(r)for(const[e,t]of Object.entries(r))o[t]=e;if(r&&r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),[r,o]=[o,r]}if(null!=e._typeList){const t='source._typeList is deprecated since v0.7.0: use source._valueMap: {"type": [...]} instead.';if(null!=n)throw new Error(t);console.warn(t),n={type:e._typeList},delete e._typeList}"flat"===t&&function(e){var t,i,s;const{_format:n,_keyMap:r={},_positional:o=[],children:l}=e;if("flat"!==n)throw new Error(`Expected source._format: "flat", but got ${n}`);if(o&&o.includes("children"))throw new Error(`source._positional must not include "children": ${o}`);let a=r;if(r.t){const e="source._keyMap maps from long to short since v0.7.0. Flip key/value!";console.warn(e),a={};for(const[e,t]of Object.entries(r))a[t]=e}const d=o.map((e=>a[e])),c=[],h={},u={},p=null!==(t=a.key)&&void 0!==t?t:"key",f=null!==(i=a.children)&&void 0!==i?i:"children";for(const[e,t]of l.entries()){const[i,n,r={}]=t;t[1]=null,null!=t[2]&&(t[2]=null),n.forEach(((e,t)=>{r[d[t]]=e})),u[e]=r;const o=r[p];null!=o&&(h[o]=r);let l=null;if(null===i);else if("number"==typeof i){if(l=u[i],void 0===l)throw new Error(`unflattenSource: Could not find parent node by index: ${i}.`)}else if(l=h[i],void 0===l)throw new Error(`unflattenSource: Could not find parent node by key: ${i}`);l?(null!==(s=l[f])&&void 0!==s||(l[f]=[]),l[f].push(r)):c.push(r)}e.children=c}(e),delete e._format,delete e._version,delete e._keyMap,delete e._valueMap,delete e._positional,(s||n)&&function e(t){for(const i of t)Object.getOwnPropertyNames(i).forEach((e=>{const t=i[e];let r=e;if(s&&null!=o[e]&&(r=o[e],r!==e&&(i[r]=t,delete i[e])),n&&"number"==typeof t&&null!=n[r]){const e=n[r][t];if(null==e)throw new Error(`Expected valueMap[${r}][${t}] entry in [${n[r]}]`);i[r]=e}})),i.children&&e(i.children)}(e.children)} /*! - * Wunderbaum - ext-dnd - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const ie="application/x-wunderbaum-node";class se extends A{constructor(e){super(e,"dnd",{autoExpandMS:1500,multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",guessDropEffect:!0,preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,serializeClipboardData:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,sourceCopyHook:null,dragStart:null,drag:null,dragEnd:null,dragEnter:null,dragOver:null,dragExpand:null,drop:null,dragLeave:null}),this.srcNode=null,this.lastTargetNode=null,this.lastEnterStamp=0,this.lastAllowedDropRegions=null,this.lastDropEffect=null,this.lastDropRegion=!1,this.currentScrollDir=0,this.applyScrollDirThrottled=function(e,t=0,i={}){let s=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return z(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),U(e,t,{leading:s,trailing:n,maxWait:t})}(this._applyScrollDir,50)}init(){super.init();const e=this.tree,t=e.options.dnd;t.dragStart&&_(e.element,"dragstart drag dragend",this.onDragEvent.bind(this)),t.dragEnter&&_(e.element,"dragenter dragover dragleave drop",this.onDropEvent.bind(this))}_leaveNode(){const e=this.lastTargetNode;this.lastEnterStamp=0,e&&(e.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before",!1),this.lastTargetNode=null)}unifyDragover(e){if(!1===e)return!1;if(e instanceof Set)return e.size>0&&e;if(!0===e)return new Set(["over","before","after"]);if("string"==typeof e||w(e))return(e=N(e)).size>0&&e;throw new Error("Unsupported drop region definition: "+e)}_calcDropRegion(e,t){const i=e.offsetY;return!!t&&(3===t.size?i<5.5?"before":i>16.5?"after":"over":1===t.size&&t.has("over")?"over":i>11?"after":"before")}_guessDropEffect(e){var t;const s=this.treeOpts.dnd,n=null!==(t=s.effectAllowed)&&void 0!==t?t:"all",r=["all","copy","copyLink","copyMove"].includes(n),o=["all","link","copyLink","linkMove"].includes(n),l=["all","move","copyMove","linkMove"].includes(n);let a=s.dropEffectDefault;return s.guessDropEffect&&(i?(e.altKey&&r&&(a="copy"),e.metaKey&&l&&(a="move"),e.altKey&&e.metaKey&&o&&(a="link")):(e.ctrlKey&&r&&(a="copy"),e.shiftKey&&l&&(a="move"),e.altKey&&o&&(a="link"))),a}_isVoidDrop(e,t,i){return!(!this.treeOpts.dnd.preventVoidMoves||!t)&&("before"===i&&e===t.getNextSibling()||"after"===i&&e===t.getPrevSibling()||(t===e||t.parent===e))}_applyScrollDir(){if(this.isDragging()&&this.currentScrollDir){const e=this.tree.options.dnd,t=this.tree.element,i=t.scrollTop;this.currentScrollDir<0?t.scrollTop=Math.max(0,i-e.scrollSpeed):this.currentScrollDir>0&&(t.scrollTop=i+e.scrollSpeed)}}_autoScroll(e){const t=this.tree,i=t.options.dnd.scrollSensitivity,s=t.element,n=t.headerElement.clientHeight,r=s.offsetHeight,o=s.scrollTop;return this.currentScrollDir=0,o>0&&e>0&&e<=i+n?this.currentScrollDir=-1:o=r-i&&(this.currentScrollDir=1),this.currentScrollDir&&this.applyScrollDirThrottled(),s.scrollTop-o}isDragging(){return!!this.srcNode}onDragEvent(e){var t;const i=this.treeOpts.dnd,s=ue.getNode(e);if(s){if(["dragstart","dragend"].includes(e.type)&&this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${s}`,e),"dragstart"===e.type){if(e.dataTransfer.effectAllowed=i.effectAllowed,s.isEditing())return s.logDebug("Prevented dragging node in edit mode."),e.preventDefault(),!1;if(!s._callEvent("dnd.dragStart",{event:e}))return e.preventDefault(),!1;const n=s.toDict(!0,(e=>{e._orgKey=e.key,delete e.key}));n._treeId=s.tree.id,i.serializeClipboardData&&("function"==typeof i.serializeClipboardData?e.dataTransfer.setData(ie,i.serializeClipboardData(n,s)):e.dataTransfer.setData(ie,JSON.stringify(n))),(null===(t=e.dataTransfer)||void 0===t?void 0:t.types.includes("text/plain"))||e.dataTransfer.setData("text/plain",s.title),this.srcNode=s,setTimeout((()=>{s.setClass("wb-drag-source")}),0)}else"drag"===e.type?i.drag&&s._callEvent("dnd.drag",{event:e}):"dragend"===e.type&&(s.setClass("wb-drag-source",!1),this.srcNode=null,this.lastTargetNode&&this._leaveNode(),s._callEvent("dnd.dragEnd",{event:e}));return!0}this.tree.logWarn(`onDragEvent.${e.type} no node`)}onDropEvent(e){var t;const i=this.srcNode,s=i?i.tree:null,n=ue.getNode(e),r=this.treeOpts.dnd,o=e.dataTransfer,l=this._calcDropRegion(e,this.lastAllowedDropRegions);if(n){if(["drop"].includes(e.type)&&this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${n}, ea: ${null==o?void 0:o.effectAllowed}, de: ${null==o?void 0:o.dropEffect}, cy: ${e.offsetY}, r: ${l}, srcNode: ${i}`,e),"dragenter"===e.type){if(this.lastAllowedDropRegions=null,this.lastTargetNode&&this.lastTargetNode!==n&&this._leaveNode(),this.lastTargetNode=n,this.lastEnterStamp=Date.now(),n.isStatusNode()||r.preventForeignNodes&&n.tree!==s||r.preventLazyParents&&!n.isLoaded()||r.preventNonNodes&&!i||r.preventRecursion&&(null==i?void 0:i.isAncestorOf(n))||r.preventSameParent&&i&&n.parent===i.parent||r.preventVoidMoves&&n===i)return o.dropEffect="none",this.tree.log("Prevented drop operation"),!0;o.dropEffect=this._guessDropEffect(e)||"none";let t=n._callEvent("dnd.dragEnter",{event:e});return t=this.unifyDragover(t),t?(this.lastAllowedDropRegions=t,this.lastDropEffect=o.dropEffect,n.setClass("wb-drop-target"),e.preventDefault(),!1):(o.dropEffect="none",!0)}if("dragover"===e.type){const t=e.clientY-this.tree.element.offsetTop;this._autoScroll(t),o.dropEffect=this._guessDropEffect(e)||"none",n._callEvent("dnd.dragOver",{event:e});const s=this._calcDropRegion(e,this.lastAllowedDropRegions);if(this.lastDropRegion=s,this.lastDropEffect=o.dropEffect,r.autoExpandMS>0&&n.isExpandable(!0)&&!n._isLoading&&Date.now()-this.lastEnterStamp>r.autoExpandMS&&!1!==n._callEvent("dnd.dragExpand",{event:e})&&n.setExpanded(),!s||this._isVoidDrop(n,i,s))return;return n.setClass("wb-drop-over","over"===s),n.setClass("wb-drop-before","before"===s),n.setClass("wb-drop-after","after"===s),e.preventDefault(),!1}if("dragleave"===e.type)n._callEvent("dnd.dragLeave",{event:e});else if("drop"===e.type){e.stopPropagation(),e.preventDefault(),this._leaveNode();const i=this.lastDropRegion;let s=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData(ie);s=s?JSON.parse(s):null;const r=this.srcNode,o=this.lastDropEffect;setTimeout((()=>{n._callEvent("dnd.drop",{event:e,region:i,suggestedDropMode:"over"===i?"appendChild":i,suggestedDropEffect:o,sourceNode:r,sourceNodeData:s})}),10)}return!1}this._leaveNode()}} + * Wunderbaum - ext-dnd + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */const se="application/x-wunderbaum-node";class ne extends V{constructor(e){super(e,"dnd",{autoExpandMS:1500,multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",guessDropEffect:!0,preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,serializeClipboardData:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,sourceCopyHook:null,dragStart:null,drag:null,dragEnd:null,dragEnter:null,dragOver:null,dragExpand:null,drop:null,dragLeave:null}),this.srcNode=null,this.lastTargetNode=null,this.lastEnterStamp=0,this.lastAllowedDropRegions=null,this.lastDropEffect=null,this.lastDropRegion=!1,this.currentScrollDir=0,this.applyScrollDirThrottled=l(this._applyScrollDir,50)}init(){super.init();const e=this.tree,t=e.options.dnd;t.dragStart&&I(e.element,"dragstart drag dragend",this.onDragEvent.bind(this)),t.dragEnter&&I(e.element,"dragenter dragover dragleave drop",this.onDropEvent.bind(this))}_leaveNode(){const e=this.lastTargetNode;this.lastEnterStamp=0,e&&(e.setClass("wb-drop-target wb-drop-over wb-drop-after wb-drop-before",!1),this.lastTargetNode=null)}unifyDragover(e){if(!1===e)return!1;if(e instanceof Set)return e.size>0&&e;if(!0===e)return new Set(["over","before","after"]);if("string"==typeof e||S(e))return(e=O(e)).size>0&&e;throw new Error("Unsupported drop region definition: "+e)}_calcDropRegion(e,t){const i=e.offsetY;return!!t&&(3===t.size?i<5.5?"before":i>16.5?"after":"over":1===t.size&&t.has("over")?"over":i>11?"after":"before")}_guessDropEffect(e){var t;const i=this.treeOpts.dnd,s=null!==(t=i.effectAllowed)&&void 0!==t?t:"all",n=["all","copy","copyLink","copyMove"].includes(s),r=["all","link","copyLink","linkMove"].includes(s),o=["all","move","copyMove","linkMove"].includes(s);let l=i.dropEffectDefault;return i.guessDropEffect&&(d?(e.altKey&&n&&(l="copy"),e.metaKey&&o&&(l="move"),e.altKey&&e.metaKey&&r&&(l="link")):(e.ctrlKey&&n&&(l="copy"),e.shiftKey&&o&&(l="move"),e.altKey&&r&&(l="link"))),l}_isVoidDrop(e,t,i){return!(!this.treeOpts.dnd.preventVoidMoves||!t)&&("before"===i&&e===t.getNextSibling()||"after"===i&&e===t.getPrevSibling()||(t===e||t.parent===e))}_applyScrollDir(){if(this.isDragging()&&this.currentScrollDir){const e=this.tree.options.dnd,t=this.tree.element,i=t.scrollTop;this.currentScrollDir<0?t.scrollTop=Math.max(0,i-e.scrollSpeed):this.currentScrollDir>0&&(t.scrollTop=i+e.scrollSpeed)}}_autoScroll(e){const t=this.tree,i=t.options.dnd.scrollSensitivity,s=t.element,n=t.headerElement.clientHeight,r=s.offsetHeight,o=s.scrollTop;return this.currentScrollDir=0,o>0&&e>0&&e<=i+n?this.currentScrollDir=-1:o=r-i&&(this.currentScrollDir=1),this.currentScrollDir&&this.applyScrollDirThrottled(),s.scrollTop-o}isDragging(){return!!this.srcNode}onDragEvent(e){var t;const i=this.treeOpts.dnd,s=pe.getNode(e);if(s){if(["dragstart","dragend"].includes(e.type)&&this.tree.logDebug(`onDragEvent.${e.type} srcNode: ${s}`,e),"dragstart"===e.type){if(e.dataTransfer.effectAllowed=i.effectAllowed,s.isEditingTitle())return s.logDebug("Prevented dragging node in edit mode."),e.preventDefault(),!1;if(!s._callEvent("dnd.dragStart",{event:e}))return e.preventDefault(),!1;const n=s.toDict(!0,(e=>{e._orgKey=e.key,delete e.key}));n._treeId=s.tree.id,i.serializeClipboardData&&("function"==typeof i.serializeClipboardData?e.dataTransfer.setData(se,i.serializeClipboardData(n,s)):e.dataTransfer.setData(se,JSON.stringify(n))),(null===(t=e.dataTransfer)||void 0===t?void 0:t.types.includes("text/plain"))||e.dataTransfer.setData("text/plain",s.title),this.srcNode=s,setTimeout((()=>{s.setClass("wb-drag-source")}),0)}else"drag"===e.type?i.drag&&s._callEvent("dnd.drag",{event:e}):"dragend"===e.type&&(s.setClass("wb-drag-source",!1),this.srcNode=null,this.lastTargetNode&&this._leaveNode(),s._callEvent("dnd.dragEnd",{event:e}));return!0}this.tree.logWarn(`onDragEvent.${e.type} no node`)}onDropEvent(e){var t;const i=this.srcNode,s=i?i.tree:null,n=pe.getNode(e),r=this.treeOpts.dnd,o=e.dataTransfer,l=this._calcDropRegion(e,this.lastAllowedDropRegions);if(n){if(["drop"].includes(e.type)&&this.tree.logDebug(`onDropEvent.${e.type} targetNode: ${n}, ea: ${null==o?void 0:o.effectAllowed}, de: ${null==o?void 0:o.dropEffect}, cy: ${e.offsetY}, r: ${l}, srcNode: ${i}`,e),"dragenter"===e.type){if(this.lastAllowedDropRegions=null,this.lastTargetNode&&this.lastTargetNode!==n&&this._leaveNode(),this.lastTargetNode=n,this.lastEnterStamp=Date.now(),n.isStatusNode()||r.preventForeignNodes&&n.tree!==s||r.preventLazyParents&&!n.isLoaded()||r.preventNonNodes&&!i||r.preventRecursion&&(null==i?void 0:i.isAncestorOf(n))||r.preventSameParent&&i&&n.parent===i.parent||r.preventVoidMoves&&n===i)return o.dropEffect="none",this.tree.log("Prevented drop operation"),!0;o.dropEffect=this._guessDropEffect(e)||"none";let t=n._callEvent("dnd.dragEnter",{event:e});return t=this.unifyDragover(t),t?(this.lastAllowedDropRegions=t,this.lastDropEffect=o.dropEffect,n.setClass("wb-drop-target"),e.preventDefault(),!1):(o.dropEffect="none",!0)}if("dragover"===e.type){const t=e.clientY-this.tree.element.offsetTop;this._autoScroll(t),o.dropEffect=this._guessDropEffect(e)||"none",n._callEvent("dnd.dragOver",{event:e});const s=this._calcDropRegion(e,this.lastAllowedDropRegions);if(this.lastDropRegion=s,this.lastDropEffect=o.dropEffect,r.autoExpandMS>0&&n.isExpandable(!0)&&!n._isLoading&&Date.now()-this.lastEnterStamp>r.autoExpandMS&&!1!==n._callEvent("dnd.dragExpand",{event:e})&&n.setExpanded(),!s||this._isVoidDrop(n,i,s))return;return n.setClass("wb-drop-over","over"===s),n.setClass("wb-drop-before","before"===s),n.setClass("wb-drop-after","after"===s),e.preventDefault(),!1}if("dragleave"===e.type)n._callEvent("dnd.dragLeave",{event:e});else if("drop"===e.type){e.stopPropagation(),e.preventDefault(),this._leaveNode();const i=this.lastDropRegion;let s=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData(se);s=s?JSON.parse(s):null;const r=this.srcNode,o=this.lastDropEffect;setTimeout((()=>{n._callEvent("dnd.drop",{event:e,region:i,suggestedDropMode:"over"===i?"appendChild":i,suggestedDropEffect:o,sourceNode:r,sourceNodeData:s})}),10)}return!1}this._leaveNode()}} /*! - * Wunderbaum - drag_observer - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */class ne{constructor(e){if(this.start={x:0,y:0,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1},this.dragElem=null,this.dragging=!1,this.events=["mousedown","mouseup","mousemove","keydown"],!e.root)throw new Error("Missing `root` option.");this.opts=Object.assign({thresh:5},e),this.root=e.root,this._handler=this.handleEvent.bind(this),this.events.forEach((e=>{this.root.addEventListener(e,this._handler)}))}disconnect(){this.events.forEach((e=>{this.root.removeEventListener(e,this._handler)}))}getDragElem(){return this.dragElem}isDragging(){return this.dragging}stopDrag(e){this.dragging&&this.opts.dragstop&&e&&(e.type="dragstop",this.opts.dragstop(e)),this.dragElem=null,this.dragging=!1}handleEvent(e){const t=e.type,i=this.opts,s={type:e.type,event:e,dragElem:this.dragElem,dx:e.pageX-this.start.x,dy:e.pageY-this.start.y,apply:void 0};switch(t){case"keydown":this.stopDrag(s);break;case"mousedown":if(this.dragElem){this.stopDrag(s);break}if(i.selector){let t=e.target;if(t.matches(i.selector))this.dragElem=t;else{if(t=t.closest(i.selector),!t)break;this.dragElem=t}}this.start.x=e.pageX,this.start.y=e.pageY,this.start.altKey=e.altKey,this.start.ctrlKey=e.ctrlKey,this.start.metaKey=e.metaKey,this.start.shiftKey=e.shiftKey;break;case"mousemove":if(!this.dragElem)break;if(!this.dragging){if(i.thresh){if(s.dx*s.dx+s.dy*s.dy{this.root.addEventListener(e,this._handler)}))}disconnect(){this.events.forEach((e=>{this.root.removeEventListener(e,this._handler)}))}getDragElem(){return this.dragElem}isDragging(){return this.dragging}stopDrag(e){this.dragging&&this.opts.dragstop&&e&&(e.type="dragstop",this.opts.dragstop(e)),this.dragElem=null,this.dragging=!1}handleEvent(e){const t=e.type,i=this.opts,s={type:e.type,event:e,dragElem:this.dragElem,dx:e.pageX-this.start.x,dy:e.pageY-this.start.y,apply:void 0};switch(t){case"keydown":this.stopDrag(s);break;case"mousedown":if(this.dragElem){this.stopDrag(s);break}if(i.selector){let t=e.target;if(t.matches(i.selector))this.dragElem=t;else{if(t=t.closest(i.selector),!t)break;this.dragElem=t}}this.start.x=e.pageX,this.start.y=e.pageY,this.start.altKey=e.altKey,this.start.ctrlKey=e.ctrlKey,this.start.metaKey=e.metaKey,this.start.shiftKey=e.shiftKey;break;case"mousemove":if(!this.dragElem)break;if(!this.dragging){if(i.thresh){if(s.dx*s.dx+s.dy*s.dythis.tree.element.contains(e.dragElem),drag:e=>this.handleDrag(e),dragstop:e=>this.handleDrag(e)})}init(){super.init()}handleDrag(e){const t=ue.getEventInfo(e.event);this.tree.log(`${e.type}(${e.dx})`,e,t)}} + * Wunderbaum - ext-grid + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */class oe extends V{constructor(e){super(e,"grid",{}),this.observer=new re({root:window.document,selector:"span.wb-col-resizer",thresh:4,dragstart:e=>this.tree.element.contains(e.dragElem),drag:e=>this.handleDrag(e),dragstop:e=>this.handleDrag(e)})}init(){super.init()}handleDrag(e){const t=pe.getEventInfo(e.event);this.tree.log(`${e.type}(${e.dx})`,e,t)}} /*! - * Wunderbaum - deferred - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */class oe{constructor(){this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){this._resolve(e)}reject(e){this._reject(e)}promise(){return this._promise}then(e){return this._promise.then(e)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}} + * Wunderbaum - deferred + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */class le{constructor(){this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){this._resolve(e)}reject(e){this._reject(e)}promise(){return this._promise}then(e){return this._promise.then(e)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}} /*! - * Wunderbaum - wunderbaum_node - * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. - * v0.7.0, Sat, 09 Dec 2023 13:47:27 GMT (https://github.com/mar10/wunderbaum) - */const le=new Set(["checkbox","classes","expanded","icon","iconTooltip","key","lazy","_partsel","radiogroup","refKey","selected","statusNodeType","title","tooltip","type","unselectable"]),ae=new Set(le);ae.delete("_partsel"),ae.delete("unselectable");class de{constructor(e,t,i){var s,n;this.refKey=void 0,this.children=null,this.classes=null,this.data={},this._isLoading=!1,this._requestId=0,this._errorInfo=null,this._partsel=!1,this._partload=!1,this.subMatchCount=0,this._rowIdx=0,this._rowElem=void 0,o(!t||t.tree===e,`Invalid parent: ${t}`),o(!i.children,"'children' not allowed here"),this.tree=e,this.parent=t,this.key=""+(null!==(s=i.key)&&void 0!==s?s:++de.sequence),this.title=""+(null!==(n=i.title)&&void 0!==n?n:"<"+this.key+">"),null!=i.refKey&&(this.refKey=""+i.refKey),null!=i.type&&(this.type=""+i.type),this.expanded=!0===i.expanded,null!=i.icon&&(this.icon=i.icon),this.lazy=!0===i.lazy,null!=i.statusNodeType&&(this.statusNodeType=""+i.statusNodeType),null!=i.colspan&&(this.colspan=!!i.colspan),null!=i.checkbox&&(this.checkbox=!!i.checkbox),null!=i.radiogroup&&(this.radiogroup=!!i.radiogroup),this.selected=!0===i.selected,!0===i.unselectable&&(this.unselectable=!0),i.classes&&this.setClass(i.classes);for(const[e,t]of Object.entries(i))le.has(e)||(this.data[e]=t);t&&!this.statusNodeType&&e._registerNode(this)}toString(){return`WunderbaumNode@${this.key}<'${this.title}'>`}*[Symbol.iterator](){const e=this.children;if(e)for(let t=0,i=e.length;t=0,`options.before must be a direct child of ${this}`),this.children.splice(e,0,...l)}else this.children=l;i.update(D.structure)}finally{i.enableUpdate(!0)}return l[0]}addNode(e,t="appendChild"){switch("over"===t&&(t="appendChild"),t){case"after":return this.parent.addChildren(e,{before:this.getNextSibling()});case"before":return this.parent.addChildren(e,{before:this});case"prependChild":return this.addChildren(e,{before:0});case"appendChild":return this.addChildren(e)}o(!1,`Invalid mode: ${t}`)}applyCommand(e,t){return this.tree.applyCommand(e,this,t)}collapseSiblings(e){for(const t of this.parent.children)t!==this&&t.expanded&&t.setExpanded(!1,e)}setClass(e,t=!0){const i=N(e);if(t)null===this.classes&&(this.classes=new Set),i.forEach((e=>{var i;this.classes.add(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)}));else{if(null===this.classes)return;i.forEach((e=>{var i;this.classes.delete(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)})),0===this.classes.size&&(this.classes=null)}}async expandAll(e=!0,t){const i=this.tree,s=this.tree.options.minExpandLevel,{depth:n=99,loadLazy:r,force:o,keepActiveNodeVisible:l=!0}=null!=t?t:{},a={scrollIntoView:!1,force:o,loadLazy:r};const d=i.logTime(`${this}.expandAll(${e})`);try{i.enableUpdate(!1),await async function t(i,n){var l;if(0===n)return;const d=null==n?null:n-1,c=[];return null===(l=i.children)||void 0===l||l.forEach((i=>{if(e)if(!i.expanded&&(i.children||r&&i.lazy)){const e=i.setExpanded(!0,a);c.push(e),e.then((async()=>{await t(i,d)}))}else c.push(t(i,d));else(!s||o||i.getLevel()>s)&&i.setExpanded(!1,a),t(i,d)})),new Promise((e=>{Promise.all(c).then((()=>{e(!0)}))}))}(this,n)}finally{i.enableUpdate(!0),i.logTimeEnd(d)}i.activeNode&&l&&i.activeNode.scrollIntoView()}findAll(e){const t="function"==typeof e?e:Z(e),i=[];return this.visit((e=>{t(e)&&i.push(e)})),i}findDirectChild(e){const t=this.children;if(!t)return null;if("string"==typeof e){for(let i=0,s=t.length;i{if(t(e))return i=e,!1})),i}findRelatedNode(e,t=!1){return this.tree.findRelatedNode(this,e,t)}*format_iter(e,t){function i(e){const t=e.parent.children;return e===t[t.length-1]}null!=t||(t=[" "," | "," ╰─ "," ├─ "]),null!=e||(e=e=>""+e);const s=s=>{const n=[e(s)];n.unshift(t[i(s)?2:3]);let r=s.parent;for(;r&&r!==this;)n.unshift(t[i(r)?0:1]),r=r.parent;return n.join("")};yield e(this);for(const e of this)yield s(e)}format(e,t){const i=[];for(const s of this.format_iter(e,t))i.push(s);return i.join("\n")}getColElem(e){var t;"string"==typeof e&&(e=this.tree.columns.findIndex((t=>t.id===e)));const i=null===(t=this._rowElem)||void 0===t?void 0:t.querySelectorAll("span.wb-col");return i?i[e]:null}getFirstChild(){return this.children?this.children[0]:null}getLastChild(){return this.children?this.children[this.children.length-1]:null}getLevel(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}getNextSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t+1]||null}getParent(){return this.parent}getParentList(e=!1,t=!1){const i=[];let s=t?this:this.parent;for(;s;)(e||s.parent)&&i.unshift(s),s=s.parent;return i}getPath(e=!0,t="title",i="/"){let s;const n=[],r="function"==typeof t;return this.visitParents((e=>{e.parent&&(s=r?t(e):e[t],n.unshift(s))}),e),n.join(i)}getPrevSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t-1]||null}hasChildren(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)}hasClass(e){return!!this.classes&&this.classes.has(e)}isActive(){return this.tree.activeNode===this}isAncestorOf(e){return e&&e.isDescendantOf(this)}isChildOf(e){return e&&this.parent===e}isColspan(){return!!this.getOption("colspan")}isDescendantOf(e){if(!e||e.tree!==this.tree)return!1;let t=this.parent;for(;t;){if(t===e)return!0;t===t.parent&&a(`Recursive parent link: ${t}`),t=t.parent}return!1}isExpandable(e=!1){return!(e&&this.expanded||!1===this.children)&&(null==this.children?!!this.lazy:0!==this.children.length||!!this.tree.options.emptyChildListExpandable)}isEditing(){return this.tree._callMethod("edit.isEditingTitle",this)}isExpanded(){return!!this.expanded}isFirstSibling(){const e=this.parent;return!e||e.children[0]===this}isLastSibling(){const e=this.parent;return!e||e.children[e.children.length-1]===this}isLazy(){return!!this.lazy}isLoaded(){return!this.lazy||void 0!==this.hasChildren()}isLoading(){return this._isLoading}isPagingNode(){return"paging"===this.statusNodeType}isParentOf(e){return e&&e.parent===this}isPartload(){return!!this._partload}isPartsel(){return!this.selected&&!!this._partsel}isRadio(){return!!this.parent.radiogroup||"radio"===this.getOption("checkbox")}isRendered(){return!!this._rowElem}isRootNode(){return this.tree.root===this}isSelected(){return!!this.selected||!!this._partsel&&void 0}isStatusNode(){return!!this.statusNodeType}isTopLevel(){return this.tree.root===this.parent}isUnloaded(){return void 0===this.hasChildren()}isVisible(){const e="hide"===this.tree.filterMode,t=this.getParentList(!1,!1);if(e&&!this.match&&!this.subMatchCount)return!1;for(let e=0,i=t.length;ei)return void this.logWarn(`Ignored load response #${i} because #${this._requestId} is pending.`);if(this.logDebug(`Received response for load request #${i}`),null===this.parent&&null!==s)return void this.logWarn("Lazy parent node was removed while loading: discarding response.");this.setStatus(T.ok);const r=Date.now();this._loadSourceObject(t),l=Date.now()-r}else{if("function"==typeof e.then){const i=t.logTime(`Resolve thenable ${e}`);e=await Promise.resolve(e),t.logTimeEnd(i)}this._loadSourceObject(e),l=Date.now()-n}}catch(t){throw this.logError("Error during load()",e,t),this._callEvent("error",{error:t}),this.setStatus(T.error,{message:""+t}),t}finally{this._requestId=0,r=Date.now()-n,t.options.debugLevel>=3&&t.logInfo(`Load source took ${r/1e3} seconds (transfer: ${o/1e3}s, processing: ${l/1e3}s)`)}}async loadLazy(e=!1){const t=this.expanded;if(o(this.lazy,"load() requires a lazy node"),e||this.isUnloaded()){this.isLoaded()&&this.resetLazy(),this.setStatus(T.loading);try{const e=await this._callEvent("lazyLoad");if(!1===e)return void this.setStatus(T.ok);o(w(e)||e&&e.url,"The lazyLoad event must return a node list, `{url: ...}`, or false."),await this.load(e),this.setStatus(T.ok),t?(this.expanded=!0,this.tree.update(D.structure)):this.update()}catch(e){this.logError("Error during loadLazy()",e),this._callEvent("error",{error:e}),this.setStatus(T.error,{message:""+e})}}}log(...e){this.logDebug(...e)}logDebug(...e){this.tree.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.tree.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.tree.options.debugLevel>=3&&console.info(this.toString(),...e)}logWarn(...e){this.tree.options.debugLevel>=2&&console.warn(this.toString(),...e)}async makeVisible(e){let t;const i=new oe,s=[],n=this.getParentList(!1,!1),r=n.length,o=C(e,"noAnimation",!1),l=C(e,"scrollIntoView",!0);for(t=r-1;t>=0;t--){const e={noAnimation:o};s.push(n[t].setExpanded(!0,e))}return Promise.all(s).then((()=>{l&&this.tree?(this.tree.updatePendingModifications(),this.scrollIntoView().then((()=>{i.resolve()}))):i.resolve()})),i.promise()}moveTo(e,t="appendChild",i){let s;"over"===t&&(t="appendChild"),"prependChild"===t&&(e.children&&e.children.length?(t="before",e=e.children[0]):t="appendChild");const n=this.tree,r=this.parent,l="appendChild"===t?e:e.parent;if(this!==e){if(this.parent?l.isDescendantOf(this)&&a("Cannot move a node to its own descendant"):a("Cannot move system root"),l!==r&&r.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===l)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else s=this.parent.children.indexOf(this),o(s>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=l,l.hasChildren())switch(t){case"appendChild":l.children.push(this);break;case"before":s=l.children.indexOf(e),o(s>=0,"invalid target parent"),l.children.splice(s,0,this);break;case"after":s=l.children.indexOf(e),o(s>=0,"invalid target parent"),l.children.splice(s+1,0,this);break;default:a(`Invalid mode '${t}'.`)}else l.children=[this];i&&e.visit(i,!0),l===r?l.triggerModifyChild("move",this):l.triggerModifyChild("add",this),n!==e.tree&&(this.logWarn("Cross-tree moveTo is experimental!"),this.visit((t=>{t.tree=e.tree}),!0)),setTimeout((()=>{n.update(D.any)}),0)}}async navigate(e,t){e=X[e]||e;const i=this.findRelatedNode(e);if(!i)return this.logWarn(`Could not find related node '${e}'.`),Promise.resolve(this);try{i.makeVisible({scrollIntoView:!1})}catch(e){}return i.setFocus(),!1===(null==t?void 0:t.activate)?Promise.resolve(this):i.setActive(!0,{event:null==t?void 0:t.event})}remove(){const e=this.tree,t=this.parent.children.indexOf(this);this.triggerModify("remove"),this.parent.children.splice(t,1),this.visit((t=>{t.removeMarkup(),e._unregisterNode(t)}),!0),e.update(D.structure)}removeChildren(){const e=this.tree;this.children&&(e.activeNode&&e.activeNode.isDescendantOf(this)&&e.activeNode.setActive(!1),e.focusNode&&e.focusNode.isDescendantOf(this)&&(e.focusNode=null),this.triggerModifyChild("remove",null),this.visit((t=>{e._unregisterNode(t)})),this.lazy?this.children=[]:this.children=null,this.isRootNode()||(this.expanded=!1),this.tree.update(D.structure))}removeMarkup(){this._rowElem&&(delete this._rowElem._wb_node,this._rowElem.remove(),this._rowElem=void 0)}_getRenderInfo(){const e={},t={},i=this.isColspan(),s=this._rowElem?this._rowElem.querySelectorAll("span.wb-col"):null;let n=0;for(const r of this.tree.columns)e[r.id]={id:r.id,idx:n,elem:s?s[n]:null,info:r},i||"*"===r.id||(t[r.id]=e[r.id]),n++;return{allColInfosById:e,renderColInfosById:t}}_createIcon(e,t,i,s){let n,r=this.getOption("icon");if(this._errorInfo?r=e.error:this._isLoading&&s&&(r=e.loading),!1===r)return null;"string"==typeof r||(r=this.statusNodeType?e[this.statusNodeType]:this.expanded?e.folderOpen:this.children?e.folder:this.lazy?e.folderLazy:e.doc),r?r.indexOf("<")>=0?n=f(r):Q.test(r)?n=f(``):(n=document.createElement("i"),n.className="wb-icon "+r):(n=document.createElement("i"),n.className="wb-icon"),i?t.replaceChild(n,i):t.appendChild(n);const o=this._callEvent("iconBadge",{iconSpan:n});let l=null;if(null!=o&&!1!==o){let e="",t="";x(o)?(l=""+o.badge,e=o.badgeClass?" "+o.badgeClass:"",t=o.badgeTooltip?` title="${o.badgeTooltip}"`:""):l="number"==typeof o?""+o:o,"string"==typeof l&&(l=f(`${d(l)}`)),l&&n.append(l)}return n}_render_markup(e){const t=this.tree,i=t.options,s=this.getOption("checkbox"),n=t.columns,r=this.getLevel(),l=t.isRowNav()?null:t.activeColIdx;let a,d=this._rowElem,c=null,h=null;const u=!d;o(u,"Expected unrendered node"),o(!u||e&&e.after,"opts.after expected, unless updating"),o(!this.isRootNode(),"Root node not allowed"),d=document.createElement("div"),d.classList.add("wb-row"),d.style.top=this._rowIdx*G+"px",this._rowElem=d,d._wb_node=this;const p=document.createElement("span");p.classList.add("wb-node","wb-col"),d.appendChild(p);let f=0;s&&(c=document.createElement("i"),c.classList.add("wb-checkbox"),("radio"===s||this.parent.radiogroup)&&c.classList.add("wb-radio"),p.appendChild(c),f+=20);for(let e=r-1;e>0;e--)a=document.createElement("i"),a.classList.add("wb-indent"),p.appendChild(a),f+=20;(!i.minExpandLevel||r>i.minExpandLevel)&&(h=document.createElement("i"),h.classList.add("wb-expander"),p.appendChild(h),f+=20);this._createIcon(t.iconMap,p,null,!h)&&(f+=20);const g=document.createElement("span");g.classList.add("wb-title"),p.appendChild(g),p._ofsTitlePx=f,t.options.dnd.dragStart&&(p.draggable=!0);if(!this.isColspan()&&n.length>1){let e=0;for(const t of n){let i;e++,"*"===t.id?i=p:(i=document.createElement("span"),i.classList.add("wb-col"),d.appendChild(i)),e===l&&i.classList.add("wb-active"),t.classes&&i.classList.add(...t.classes.split(" ")),i.style.left=t._ofsPx+"px",i.style.width=t._widthPx+"px",u&&t.html&&"string"==typeof t.html&&(i.innerHTML=t.html)}}switch(e?e.after:"last"){case"first":t.nodeListElement.prepend(d);break;case"last":t.nodeListElement.appendChild(d);break;default:e.after.after(d)}e.isNew=!0,this._render_data(e)}_render_data(e){o(this._rowElem,"No _rowElem");const t=this.tree,i=t.options,s=this._rowElem,n=!!e.isNew,r=!!e.preventScroll,l=t.columns,a=this.isColspan(),d=s.querySelector("span.wb-node"),c=d.querySelector("span.wb-title"),h=t.element.scrollTop;if(this.titleWithHighlight?c.innerHTML=this.titleWithHighlight:c.textContent=this.title,r&&(t.element.scrollTop=h),!i.skeleton)if(a){const e=t.element.clientWidth;c.style.width=e-d._ofsTitlePx-7+"px"}else c.style.width=l[0]._widthPx-d._ofsTitlePx-7+"px";if(e.isDataChange=!0,this._render_status(e),this.statusNodeType)this._callEvent("renderStatusNode",{isNew:n,nodeElem:d,isColspan:a});else if(this.parent){const e=this._getRenderInfo();this._callEvent("render",{isNew:n,nodeElem:d,isColspan:a,allColInfosById:e.allColInfosById,renderColInfosById:e.renderColInfosById})}}_render_status(e){const t=this.tree,i=t.iconMap,s=t.options,n=this.type?t.types[this.type]:null,r=this._rowElem,o=r.querySelector("span.wb-node"),l=o.querySelector("i.wb-expander"),a=o.querySelector("i.wb-checkbox"),d=["wb-row"];if(this.expanded&&d.push("wb-expanded"),this.lazy&&d.push("wb-lazy"),this.selected&&d.push("wb-selected"),this._partsel&&d.push("wb-partsel"),this===t.activeNode&&d.push("wb-active"),this===t.focusNode&&d.push("wb-focus"),this._errorInfo&&d.push("wb-error"),this._isLoading&&d.push("wb-loading"),this.isColspan()&&d.push("wb-colspan"),this.statusNodeType&&d.push("wb-status-"+this.statusNodeType),this.match&&d.push("wb-match"),this.subMatchCount&&d.push("wb-submatch"),s.skeleton&&d.push("wb-skeleton"),r.className=d.join(" "),this.classes&&r.classList.add(...this.classes),n&&n.classes&&r.classList.add(...n.classes),l){let e=null;this._isLoading?e=i.loading:this.isExpandable(!1)?e=this.expanded?i.expanderExpanded:i.expanderCollapsed:this.lazy&&null==this.children&&(e=i.expanderLazy),null==e?l.classList.add("wb-indent"):Q.test(e)?l.style.backgroundImage=`url('${e}')`:l.className="wb-expander "+e}if(a){let e="wb-checkbox ";this.isRadio()?(e+="wb-radio ",this.selected?e+=i.radioChecked:e+=i.radioUnchecked):this.selected?e+=i.checkChecked:this._partsel?e+=i.checkUnknown:e+=i.checkUnchecked,a.className=e}if(!e.isNew){let e=0;for(const i of r.children)i.classList.toggle("wb-active",e++===t.activeColIdx);const i=o.querySelector("i.wb-icon");i&&this._createIcon(t.iconMap,o,i,!l)}if(!1!==e.resizeCols&&!this.isColspan()){const e=r.querySelectorAll("span.wb-col");let t=0,i=0;for(const s of this.tree.columns){const n=e[t];n.style.left=`${i}px`,n.style.width=`${s._widthPx}px`,t++,i+=s._widthPx}}}_render(e){const t=Object.assign({change:D.data},e);switch(this._rowElem||(t.change=D.row),t.change){case"status":this._render_status(t);break;case"data":this._render_data(t);break;case"row":this._render_markup(t);break;default:a(`Invalid change type '${t.change}'.`)}}resetLazy(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=null,this.tree.update(D.structure)}toDict(e=!1,t){const i={};if(ae.forEach((e=>{const t=this[e];t instanceof Set?t.size&&(i[e]=Array.prototype.join.call(t.keys()," ")):(t||!1===t||0===t)&&(i[e]=t)})),E(this.data)||(i.data=y({},this.data),E(i.data)&&delete i.data),t){const s=t(i,this);if(!1===s)return!1;"skip"===s&&(e=!1)}if(e&&w(this.children)){i.children=[];for(let e=0,s=this.children.length;e=0&&([s,e]=e.split("."));const n=s[e];if("function"==typeof n){const e=n.call(i,{type:"resolve",tree:i,node:this});if(void 0!==e)return e}if(void 0!==this[e])return this[e];const r=this.type?i.types[this.type]:void 0,o=r?r[e]:void 0;return void 0!==o?o:null!=n?n:t}async scrollIntoView(e){const t=Object.assign({node:this},e);return this.tree.scrollTo(t)}async setActive(e=!0,t){const i=this.tree,s=i.activeNode,n=null==t?void 0:t.retrigger,r=null==t?void 0:t.focusTree,o=!1!==(null==t?void 0:t.focusNode),l=null==t?void 0:t.noEvents,a=null==t?void 0:t.event;if(!l)if(e){if(s!==this||n){if(!1===(null==s?void 0:s._callEvent("deactivate",{nextNode:this,event:a}))||!1===this._callEvent("beforeActivate",{prevNode:s,event:a}))return;i.activeNode=null,null==s||s.update(D.status)}}else(s===this||n)&&this._callEvent("deactivate",{nextNode:null,event:a});return s!==this&&(e&&(i.activeNode=this,(o||r)&&(i.focusNode=this),r&&i.setFocus()),null==s||s.update(D.status),this.update(D.status)),t&&null!=t.colIdx&&t.colIdx!==i.activeColIdx&&i.isCellNav()&&i.setColumn(t.colIdx),e&&!l&&this._callEvent("activate",{prevNode:s,event:a}),this.makeVisible()}async setExpanded(e=!0,t){const{force:i,scrollIntoView:s,immediate:n}=null!=t?t:{};if(!e&&this.isExpanded()&&this.getLevel()<=this.tree.getOption("minExpandLevel")&&!i)return void this.logDebug("Ignored collapse request below expandLevel.");if(!e==!this.expanded)return;e&&this.getOption("autoCollapse")&&this.collapseSiblings(t),e&&this.lazy&&null==this.children&&await this.loadLazy(),this.expanded=e;const r={immediate:n};if(this.tree.update(D.structure,r),e&&s){const e=this.getLastChild();e&&(this.tree.updatePendingModifications(),e.scrollIntoView({topNode:this}))}}setFocus(e=!0){o(!!e,"blur is not yet implemented");const t=this.tree.focusNode;this.tree.focusNode=this,null==t||t.update(),this.update()}setIcon(e){this.icon=e,this.update()}setKey(e,t){throw new Error("Not yet implemented")}update(e=D.data){o(e===D.status||e===D.data,`Invalid change type ${e}`),this.tree.update(e,this)}getSelectedNodes(e=!1){const t=[];return this.visit((i=>{if(i.selected&&(t.push(i),!0===e))return"skip"})),t}toggleSelected(e){let t=this.isSelected();return t=void 0!==t||this.isRadio()?!t:this._anySelectable(),this.setSelected(t,e)}_anySelectable(){let e=!1;return this.visit((t=>{if(!1===t.selected&&!t.unselectable&&!t.hasChildren()&&!t.parent.radiogroup)return e=!0,!1})),e}_changeSelectStatusProps(e){let t=!1;switch(e){case!1:t=this.selected||this._partsel,this.selected=!1,this._partsel=!1;break;case!0:t=!this.selected||!this._partsel,this.selected=!0,this._partsel=!0;break;case void 0:t=this.selected||!this._partsel,this.selected=!1,this._partsel=!0;break;default:a(`Invalid state: ${e}`)}return t&&this.update(),t}fixSelection3AfterClick(e){const t=!!(null==e?void 0:e.force),i=this.isSelected();this.visit((e=>{if(e.radiogroup)return"skip";!t&&e.getOption("unselectable")||e._changeSelectStatusProps(i)})),this.fixSelection3FromEndNodes()}fixSelection3FromEndNodes(e){const t=!!(null==e?void 0:e.force);o("hier"===this.tree.options.selectMode,"expected selectMode 'hier'");const i=e=>{let s;const n=e.children;if(n&&n.length){let e=!0,t=!1;for(let s=0,r=n.length;s{let t;const i=e.children;let s=!0,n=!1;for(let e=0,r=i.length;e{this.visit((t=>{t.setSelected(e)}))})),n):(e===n||s&&!1===this._callEvent("beforeSelect",{flag:e})||(i.runWithDeferredUpdate((()=>{if(r){if(!e&&!(null==t?void 0:t.force))return n;for(const e of this.parent.children)e.selected=e===this}else this.selected=e,"hier"===o?this.fixSelection3AfterClick():"single"===o&&i.visit((e=>{e.selected=!1}))})),s&&this._callEvent("select",{flag:e})),n):n}setStatus(e,t){const i=this.tree,s=null==t?void 0:t.message,n=null==t?void 0:t.details;let r=null;const l=e=>{const t=this.children,s=t?t[0]:null;return o(e.statusNodeType,"Not a status node"),o(!s||!s.isStatusNode(),"Child must not be a status node"),r=this.addNode(e,"prependChild"),r.match=!0,i.update(D.structure),r};switch((()=>{const e=this.children;e&&e.length&&e[0].isStatusNode()&&e[0].remove()})(),e){case"ok":this._isLoading=!1,this._errorInfo=null;break;case"loading":this._isLoading=!0,this._errorInfo=null,this.parent?this.update(D.status):l({statusNodeType:e,title:i.options.strings.loading+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n});break;case"error":l({statusNodeType:e,title:i.options.strings.loadError+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo={message:s,details:n};break;case"noData":l({statusNodeType:e,title:s||i.options.strings.noData,checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo=null;break;default:a("invalid node status "+e)}return i.update(D.structure),r}setTitle(e){this.title=e,this.update()}_sortChildren(e,t){const i=this.children;if(i&&(i.sort(e),t))for(let s=0,n=i.length;s"),null!=i.refKey&&(this.refKey=""+i.refKey),null!=i.type&&(this.type=""+i.type),this.expanded=!0===i.expanded,null!=i.icon&&(this.icon=i.icon),this.lazy=!0===i.lazy,null!=i.statusNodeType&&(this.statusNodeType=""+i.statusNodeType),null!=i.colspan&&(this.colspan=!!i.colspan),null!=i.checkbox&&(this.checkbox=!!i.checkbox),null!=i.radiogroup&&(this.radiogroup=!!i.radiogroup),this.selected=!0===i.selected,!0===i.unselectable&&(this.unselectable=!0),i.classes&&this.setClass(i.classes);for(const[e,t]of Object.entries(i))ae.has(e)||(this.data[e]=t);t&&!this.statusNodeType&&e._registerNode(this)}toString(){return`WunderbaumNode@${this.key}<'${this.title}'>`}*[Symbol.iterator](){const e=this.children;if(e)for(let t=0,i=e.length;t=0,`options.before must be a direct child of ${this}`),this.children.splice(e,0,...o)}else this.children=o;i.update($.structure)}finally{i.enableUpdate(!0)}return o[0]}addNode(e,t="appendChild"){switch("over"===t&&(t="appendChild"),t){case"after":return this.parent.addChildren(e,{before:this.getNextSibling()});case"before":return this.parent.addChildren(e,{before:this});case"prependChild":return this.addChildren(e,{before:0});case"appendChild":return this.addChildren(e)}f(!1,`Invalid mode: ${t}`)}applyCommand(e,t){return this.tree.applyCommand(e,this,t)}collapseSiblings(e){for(const t of this.parent.children)t!==this&&t.expanded&&t.setExpanded(!1,e)}setClass(e,t=!0){const i=O(e);if(t)null===this.classes&&(this.classes=new Set),i.forEach((e=>{var i;this.classes.add(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)}));else{if(null===this.classes)return;i.forEach((e=>{var i;this.classes.delete(e),null===(i=this._rowElem)||void 0===i||i.classList.toggle(e,t)})),0===this.classes.size&&(this.classes=null)}}startEditTitle(){this.tree._callMethod("edit.startEditTitle",this)}async expandAll(e=!0,t){const i=this.tree,s=this.tree.options.minExpandLevel,{depth:n=99,loadLazy:r,force:o,keepActiveNodeVisible:l=!0}=null!=t?t:{},a={scrollIntoView:!1,force:o,loadLazy:r};const d=i.logTime(`${this}.expandAll(${e})`);try{i.enableUpdate(!1),await async function t(i,n){var l;if(0===n)return;const d=null==n?null:n-1,c=[];return null===(l=i.children)||void 0===l||l.forEach((i=>{if(e)if(!i.expanded&&(i.children||r&&i.lazy)){const e=i.setExpanded(!0,a);c.push(e),e.then((async()=>{await t(i,d)}))}else c.push(t(i,d));else(!s||o||i.getLevel()>s)&&i.setExpanded(!1,a),t(i,d)})),new Promise((e=>{Promise.all(c).then((()=>{e(!0)}))}))}(this,n)}finally{i.enableUpdate(!0),i.logTimeEnd(d)}i.activeNode&&l&&i.activeNode.scrollIntoView()}findAll(e){const t="function"==typeof e?e:ee(e),i=[];return this.visit((e=>{t(e)&&i.push(e)})),i}findDirectChild(e){const t=this.children;if(!t)return null;if("string"==typeof e){for(let i=0,s=t.length;i{if(t(e))return i=e,!1})),i}findRelatedNode(e,t=!1){return this.tree.findRelatedNode(this,e,t)}*format_iter(e,t){function i(e){const t=e.parent.children;return e===t[t.length-1]}null!=t||(t=[" "," | "," ╰─ "," ├─ "]),null!=e||(e=e=>""+e);const s=s=>{const n=[e(s)];n.unshift(t[i(s)?2:3]);let r=s.parent;for(;r&&r!==this;)n.unshift(t[i(r)?0:1]),r=r.parent;return n.join("")};yield e(this);for(const e of this)yield s(e)}format(e,t){const i=[];for(const s of this.format_iter(e,t))i.push(s);return i.join("\n")}getColElem(e){var t;"string"==typeof e&&(e=this.tree.columns.findIndex((t=>t.id===e)));const i=null===(t=this._rowElem)||void 0===t?void 0:t.querySelectorAll("span.wb-col");return i?i[e]:null}getCloneList(e=!1){if(!this.refKey)return[];const t=this.tree.findByRefKey(this.refKey);return e?t:[...t].filter((e=>e!==this))}getFirstChild(){return this.children?this.children[0]:null}getLastChild(){return this.children?this.children[this.children.length-1]:null}getLevel(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}getNextSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t+1]||null}getParent(){return this.parent}getParentList(e=!1,t=!1){const i=[];let s=t?this:this.parent;for(;s;)(e||s.parent)&&i.unshift(s),s=s.parent;return i}getPath(e=!0,t="title",i="/"){let s;const n=[],r="function"==typeof t;return this.visitParents((e=>{e.parent&&(s=r?t(e):e[t],n.unshift(s))}),e),n.join(i)}getPrevSibling(){const e=this.parent.children,t=e.indexOf(this);return e[t-1]||null}hasChildren(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)}hasClass(e){return!!this.classes&&this.classes.has(e)}isActive(){return this.tree.activeNode===this}isAncestorOf(e){return e&&e.isDescendantOf(this)}isChildOf(e){return e&&this.parent===e}isClone(){return!!this.refKey&&this.tree.findByRefKey(this.refKey).length>1}isColspan(){return!!this.getOption("colspan")}isDescendantOf(e){if(!e||e.tree!==this.tree)return!1;let t=this.parent;for(;t;){if(t===e)return!0;t===t.parent&&v(`Recursive parent link: ${t}`),t=t.parent}return!1}isExpandable(e=!1){return!(e&&this.expanded||!1===this.children)&&(null==this.children?!!this.lazy:0!==this.children.length||!!this.tree.options.emptyChildListExpandable)}isEditingTitle(){return this.tree._callMethod("edit.isEditingTitle",this)}isExpanded(){return!!this.expanded}isFirstSibling(){const e=this.parent;return!e||e.children[0]===this}isLastSibling(){const e=this.parent;return!e||e.children[e.children.length-1]===this}isLazy(){return!!this.lazy}isLoaded(){return!this.lazy||void 0!==this.hasChildren()}isLoading(){return this._isLoading}isPagingNode(){return"paging"===this.statusNodeType}isParentOf(e){return e&&e.parent===this}isPartload(){return!!this._partload}isPartsel(){return!this.selected&&!!this._partsel}isRadio(){return!!this.parent.radiogroup||"radio"===this.getOption("checkbox")}isRendered(){return!!this._rowElem}isRootNode(){return this.tree.root===this}isSelected(){return!!this.selected||!!this._partsel&&void 0}isStatusNode(){return!!this.statusNodeType}isTopLevel(){return this.tree.root===this.parent}isUnloaded(){return void 0===this.hasChildren()}isVisible(){const e="hide"===this.tree.filterMode,t=this.getParentList(!1,!1);if(e&&!this.match&&!this.subMatchCount)return!1;for(let e=0,i=t.length;ei)return void this.logWarn(`Ignored load response #${i} because #${this._requestId} is pending.`);if(this.logDebug(`Received response for load request #${i}`),null===this.parent&&null!==s)return void this.logWarn("Lazy parent node was removed while loading: discarding response.");this.setStatus(R.ok);const r=Date.now();this._loadSourceObject(t),l=Date.now()-r}else{if("function"==typeof e.then){const i=t.logTime(`Resolve thenable ${e}`);e=await Promise.resolve(e),t.logTimeEnd(i)}this._loadSourceObject(e),l=Date.now()-n}}catch(t){throw this.logError("Error during load()",e,t),this._callEvent("error",{error:t}),this.setStatus(R.error,{message:""+t}),t}finally{this._requestId=0,r=Date.now()-n,t.options.debugLevel>=3&&t.logInfo(`Load source took ${r/1e3} seconds (transfer: ${o/1e3}s, processing: ${l/1e3}s)`)}}async loadLazy(e=!1){const t=this.expanded;if(f(this.lazy,"load() requires a lazy node"),e||this.isUnloaded()){this.isLoaded()&&this.resetLazy(),this.setStatus(R.loading);try{const e=await this._callEvent("lazyLoad");if(!1===e)return void this.setStatus(R.ok);f(S(e)||e&&e.url,"The lazyLoad event must return a node list, `{url: ...}`, or false."),await this.load(e),this.setStatus(R.ok),t?(this.expanded=!0,this.tree.update($.structure)):this.update()}catch(e){this.logError("Error during loadLazy()",e),this._callEvent("error",{error:e}),this.setStatus(R.error,{message:""+e})}}}log(...e){this.logDebug(...e)}logDebug(...e){this.tree.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.tree.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.tree.options.debugLevel>=3&&console.info(this.toString(),...e)}logWarn(...e){this.tree.options.debugLevel>=2&&console.warn(this.toString(),...e)}async makeVisible(e){let t;const i=new le,s=[],n=this.getParentList(!1,!1),r=n.length,o=M(e,"noAnimation",!1),l=M(e,"scrollIntoView",!0);for(t=r-1;t>=0;t--){const e={noAnimation:o};s.push(n[t].setExpanded(!0,e))}return Promise.all(s).then((()=>{l&&this.tree?(this.tree.updatePendingModifications(),this.scrollIntoView().then((()=>{i.resolve()}))):i.resolve()})),i.promise()}moveTo(e,t="appendChild",i){let s;"over"===t&&(t="appendChild"),"prependChild"===t&&(e.children&&e.children.length?(t="before",e=e.children[0]):t="appendChild");const n=this.tree,r=this.parent,o="appendChild"===t?e:e.parent;if(this!==e){if(this.parent?o.isDescendantOf(this)&&v("Cannot move a node to its own descendant"):v("Cannot move system root"),o!==r&&r.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===o)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else s=this.parent.children.indexOf(this),f(s>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=o,o.hasChildren())switch(t){case"appendChild":o.children.push(this);break;case"before":s=o.children.indexOf(e),f(s>=0,"invalid target parent"),o.children.splice(s,0,this);break;case"after":s=o.children.indexOf(e),f(s>=0,"invalid target parent"),o.children.splice(s+1,0,this);break;default:v(`Invalid mode '${t}'.`)}else o.children=[this];i&&e.visit(i,!0),o===r?o.triggerModifyChild("move",this):o.triggerModifyChild("add",this),n!==e.tree&&(this.logWarn("Cross-tree moveTo is experimental!"),this.visit((t=>{t.tree=e.tree}),!0)),setTimeout((()=>{n.update($.any)}),0)}}async navigate(e,t){e=Z[e]||e;const i=this.findRelatedNode(e);if(!i)return this.logWarn(`Could not find related node '${e}'.`),Promise.resolve(this);try{i.makeVisible({scrollIntoView:!1})}catch(e){}return i.setFocus(),!1===(null==t?void 0:t.activate)?Promise.resolve(this):i.setActive(!0,{event:null==t?void 0:t.event})}remove(){const e=this.tree,t=this.parent.children.indexOf(this);this.triggerModify("remove"),this.parent.children.splice(t,1),this.visit((t=>{t.removeMarkup(),e._unregisterNode(t)}),!0),e.update($.structure)}removeChildren(){const e=this.tree;this.children&&(e.activeNode&&e.activeNode.isDescendantOf(this)&&e.activeNode.setActive(!1),e.focusNode&&e.focusNode.isDescendantOf(this)&&(e.focusNode=null),this.triggerModifyChild("remove",null),this.visit((t=>{e._unregisterNode(t)})),this.lazy?this.children=[]:this.children=null,this.isRootNode()||(this.expanded=!1),this.tree.update($.structure))}removeMarkup(){this._rowElem&&(delete this._rowElem._wb_node,this._rowElem.remove(),this._rowElem=void 0)}_getRenderInfo(){const e={},t={},i=this.isColspan(),s=this._rowElem?this._rowElem.querySelectorAll("span.wb-col"):null;let n=0;for(const r of this.tree.columns)e[r.id]={id:r.id,idx:n,elem:s?s[n]:null,info:r},i||"*"===r.id||(t[r.id]=e[r.id]),n++;return{allColInfosById:e,renderColInfosById:t}}_createIcon(e,t,i,s){let n,r=this.getOption("icon");if(this._errorInfo?r=e.error:this._isLoading&&s&&(r=e.loading),!1===r)return null;"string"==typeof r||(r=this.statusNodeType?e[this.statusNodeType]:this.expanded?e.folderOpen:this.children?e.folder:this.lazy?e.folderLazy:e.doc),r?r.indexOf("<")>=0?n=x(r):Y.test(r)?n=x(``):(n=document.createElement("i"),n.className="wb-icon "+r):(n=document.createElement("i"),n.className="wb-icon"),i?t.replaceChild(n,i):t.appendChild(n);const o=this._callEvent("iconBadge",{iconSpan:n});let l=null;if(null!=o&&!1!==o){let e="",t="";T(o)?(l=""+o.badge,e=o.badgeClass?" "+o.badgeClass:"",t=o.badgeTooltip?` title="${o.badgeTooltip}"`:""):l="number"==typeof o?""+o:o,"string"==typeof l&&(l=x(`${m(l)}`)),l&&n.append(l)}return n}_render_markup(e){const t=this.tree,i=t.options,s=this.getOption("checkbox"),n=t.columns,r=this.getLevel(),o=t.isRowNav()?null:t.activeColIdx;let l,a=this._rowElem,d=null,c=null;const h=!a;f(h,"Expected unrendered node"),f(!h||e&&e.after,"opts.after expected, unless updating"),f(!this.isRootNode(),"Root node not allowed"),a=document.createElement("div"),a.classList.add("wb-row"),a.style.top=this._rowIdx*Q+"px",this._rowElem=a,a._wb_node=this;const u=document.createElement("span");u.classList.add("wb-node","wb-col"),a.appendChild(u);let p=0;s&&(d=document.createElement("i"),d.classList.add("wb-checkbox"),("radio"===s||this.parent.radiogroup)&&d.classList.add("wb-radio"),u.appendChild(d),p+=20);for(let e=r-1;e>0;e--)l=document.createElement("i"),l.classList.add("wb-indent"),u.appendChild(l),p+=20;(!i.minExpandLevel||r>i.minExpandLevel)&&(c=document.createElement("i"),c.classList.add("wb-expander"),u.appendChild(c),p+=20);this._createIcon(t.iconMap,u,null,!c)&&(p+=20);const g=document.createElement("span");g.classList.add("wb-title"),u.appendChild(g),u._ofsTitlePx=p,t.options.dnd.dragStart&&(u.draggable=!0);if(!this.isColspan()&&n.length>1){let e=0;for(const t of n){let i;e++,"*"===t.id?i=u:(i=document.createElement("span"),i.classList.add("wb-col"),a.appendChild(i)),e===o&&i.classList.add("wb-active"),t.classes&&i.classList.add(...t.classes.split(" ")),i.style.left=t._ofsPx+"px",i.style.width=t._widthPx+"px",h&&t.html&&"string"==typeof t.html&&(i.innerHTML=t.html)}}switch(e?e.after:"last"){case"first":t.nodeListElement.prepend(a);break;case"last":t.nodeListElement.appendChild(a);break;default:e.after.after(a)}e.isNew=!0,this._render_data(e)}_render_data(e){f(this._rowElem,"No _rowElem");const t=this.tree,i=t.options,s=this._rowElem,n=!!e.isNew,r=!!e.preventScroll,o=t.columns,l=this.isColspan(),a=s.querySelector("span.wb-node"),d=a.querySelector("span.wb-title"),c=t.element.scrollTop;if(this.titleWithHighlight?d.innerHTML=this.titleWithHighlight:d.textContent=this.title,r&&(t.element.scrollTop=c),!i.skeleton)if(l){const e=t.element.clientWidth;d.style.width=e-a._ofsTitlePx-7+"px"}else d.style.width=o[0]._widthPx-a._ofsTitlePx-7+"px";if(e.isDataChange=!0,this._render_status(e),this.statusNodeType)this._callEvent("renderStatusNode",{isNew:n,nodeElem:a,isColspan:l});else if(this.parent){const e=this._getRenderInfo();this._callEvent("render",{isNew:n,nodeElem:a,isColspan:l,allColInfosById:e.allColInfosById,renderColInfosById:e.renderColInfosById})}}_render_status(e){const t=this.tree,i=t.iconMap,s=t.options,n=this.type?t.types[this.type]:null,r=this._rowElem,o=r.querySelector("span.wb-node"),l=o.querySelector("i.wb-expander"),a=o.querySelector("i.wb-checkbox"),d=["wb-row"];if(this.expanded&&d.push("wb-expanded"),this.lazy&&d.push("wb-lazy"),this.selected&&d.push("wb-selected"),this._partsel&&d.push("wb-partsel"),this===t.activeNode&&d.push("wb-active"),this===t.focusNode&&d.push("wb-focus"),this._errorInfo&&d.push("wb-error"),this._isLoading&&d.push("wb-loading"),this.isColspan()&&d.push("wb-colspan"),this.statusNodeType&&d.push("wb-status-"+this.statusNodeType),this.match&&d.push("wb-match"),this.subMatchCount&&d.push("wb-submatch"),s.skeleton&&d.push("wb-skeleton"),r.className=d.join(" "),this.classes&&r.classList.add(...this.classes),n&&n.classes&&r.classList.add(...n.classes),l){let e=null;this._isLoading?e=i.loading:this.isExpandable(!1)?e=this.expanded?i.expanderExpanded:i.expanderCollapsed:this.lazy&&null==this.children&&(e=i.expanderLazy),null==e?l.classList.add("wb-indent"):Y.test(e)?l.style.backgroundImage=`url('${e}')`:l.className="wb-expander "+e}if(a){let e="wb-checkbox ";this.isRadio()?(e+="wb-radio ",this.selected?e+=i.radioChecked:e+=i.radioUnchecked):this.selected?e+=i.checkChecked:this._partsel?e+=i.checkUnknown:e+=i.checkUnchecked,a.className=e}if(!e.isNew){let e=0;for(const i of r.children)i.classList.toggle("wb-active",e++===t.activeColIdx),i.classList.remove("wb-error","wb-invalid");const i=o.querySelector("i.wb-icon");i&&this._createIcon(t.iconMap,o,i,!l)}if(!1!==e.resizeCols&&!this.isColspan()){const e=r.querySelectorAll("span.wb-col");let t=0,i=0;for(const s of this.tree.columns){const n=e[t];n.style.left=`${i}px`,n.style.width=`${s._widthPx}px`,t++,i+=s._widthPx}}}_render(e){const t=Object.assign({change:$.data},e);switch(this._rowElem||(t.change=$.row),t.change){case"status":this._render_status(t);break;case"data":this._render_data(t);break;case"row":this._render_markup(t);break;default:v(`Invalid change type '${t.change}'.`)}}resetLazy(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=null,this.tree.update($.structure)}toDict(e=!1,t){const i={};if(de.forEach((e=>{const t=this[e];t instanceof Set?t.size&&(i[e]=Array.prototype.join.call(t.keys()," ")):(t||!1===t||0===t)&&(i[e]=t)})),D(this.data)||(i.data=N({},this.data),D(i.data)&&delete i.data),t){const s=t(i,this);if(!1===s)return!1;"skip"===s&&(e=!1)}if(e&&S(this.children)){i.children=[];for(let e=0,s=this.children.length;e=0&&([s,e]=e.split("."));const n=s[e];if("function"==typeof n){const e=n.call(i,{type:"resolve",tree:i,node:this});if(void 0!==e)return e}if(void 0!==this[e])return this[e];const r=this.type?i.types[this.type]:void 0,o=r?r[e]:void 0;return void 0!==o?o:null!=n?n:t}async scrollIntoView(e){const t=Object.assign({node:this},e);return this.tree.scrollTo(t)}async setActive(e=!0,t){const i=this.tree,s=i.activeNode,n=null==t?void 0:t.retrigger,r=null==t?void 0:t.focusTree,o=null==t?void 0:t.noEvents,l=null==t?void 0:t.event,a=null==t?void 0:t.colIdx,d=null==t?void 0:t.edit;if(f(!a||i.isCellNav(),"colIdx requires cellNav"),f(!d||null!=a,"edit requires colIdx"),!o)if(e){if(s!==this||n){if(!1===(null==s?void 0:s._callEvent("deactivate",{nextNode:this,event:l}))||!1===this._callEvent("beforeActivate",{prevNode:s,event:l}))return;i.activeNode=null,null==s||s.update($.status)}}else(s===this||n)&&this._callEvent("deactivate",{nextNode:null,event:l});return s!==this&&(e&&(i.activeNode=this),null==s||s.update($.status),this.update($.status)),this.makeVisible().then((()=>{e&&((r||d)&&(i.setFocus(),i.focusNode=this,i.focusNode.setFocus()),null!=a&&i.isCellNav()&&i.setColumn(a,{edit:d}),o||this._callEvent("activate",{prevNode:s,event:l}))}))}async setExpanded(e=!0,t){const{force:i,scrollIntoView:s,immediate:n}=null!=t?t:{},r=!(null==t?void 0:t.noEvents);if(!e&&this.isExpanded()&&this.getLevel()<=this.tree.getOption("minExpandLevel")&&!i)return void this.logDebug("Ignored collapse request below expandLevel.");if(!e==!this.expanded)return;if(r&&!1===this._callEvent("beforeExpand",{flag:e}))return;e&&this.getOption("autoCollapse")&&this.collapseSiblings(t),e&&this.lazy&&null==this.children&&await this.loadLazy(),this.expanded=e;const o={immediate:n};if(this.tree.update($.structure,o),e&&s){const e=this.getLastChild();e&&(this.tree.updatePendingModifications(),e.scrollIntoView({topNode:this}))}r&&this._callEvent("expand",{flag:e})}setFocus(e=!0){f(!!e,"Blur is not yet implemented");const t=this.tree.focusNode;this.tree.focusNode=this,null==t||t.update(),this.update()}setIcon(e){this.icon=e,this.update()}setKey(e,t){throw new Error("Not yet implemented")}update(e=$.data){f(e===$.status||e===$.data,`Invalid change type ${e}`),this.tree.update(e,this)}getSelectedNodes(e=!1){const t=[];return this.visit((i=>{if(i.selected&&(t.push(i),!0===e))return"skip"})),t}toggleSelected(e){let t=this.isSelected();return t=void 0!==t||this.isRadio()?!t:this._anySelectable(),this.setSelected(t,e)}_anySelectable(){let e=!1;return this.visit((t=>{if(!1===t.selected&&!t.unselectable&&!t.hasChildren()&&!t.parent.radiogroup)return e=!0,!1})),e}_changeSelectStatusProps(e){let t=!1;switch(e){case!1:t=this.selected||this._partsel,this.selected=!1,this._partsel=!1;break;case!0:t=!this.selected||!this._partsel,this.selected=!0,this._partsel=!0;break;case void 0:t=this.selected||!this._partsel,this.selected=!1,this._partsel=!0;break;default:v(`Invalid state: ${e}`)}return t&&this.update(),t}fixSelection3AfterClick(e){const t=!!(null==e?void 0:e.force),i=this.isSelected();this.visit((e=>{if(e.radiogroup)return"skip";!t&&e.getOption("unselectable")||e._changeSelectStatusProps(i)})),this.fixSelection3FromEndNodes()}fixSelection3FromEndNodes(e){const t=!!(null==e?void 0:e.force);f("hier"===this.tree.options.selectMode,"expected selectMode 'hier'");const i=e=>{let s;const n=e.children;if(n&&n.length){let e=!0,t=!1;for(let s=0,r=n.length;s{let t;const i=e.children;let s=!0,n=!1;for(let e=0,r=i.length;e{this.visit((t=>{t.setSelected(e)}))})),n):(e===n||s&&!1===this._callEvent("beforeSelect",{flag:e})||(i.runWithDeferredUpdate((()=>{if(r){if(!e&&!(null==t?void 0:t.force))return n;for(const e of this.parent.children)e.selected=e===this}else this.selected=e,"hier"===o?this.fixSelection3AfterClick():"single"===o&&i.visit((e=>{e.selected=!1}))})),s&&this._callEvent("select",{flag:e})),n):n}setStatus(e,t){const i=this.tree,s=null==t?void 0:t.message,n=null==t?void 0:t.details;let r=null;const o=e=>{const t=this.children,s=t?t[0]:null;return f(e.statusNodeType,"Not a status node"),f(!s||!s.isStatusNode(),"Child must not be a status node"),r=this.addNode(e,"prependChild"),r.match=!0,i.update($.structure),r};switch((()=>{const e=this.children;e&&e.length&&e[0].isStatusNode()&&e[0].remove()})(),e){case"ok":this._isLoading=!1,this._errorInfo=null;break;case"loading":this._isLoading=!0,this._errorInfo=null,this.parent?this.update($.status):o({statusNodeType:e,title:i.options.strings.loading+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n});break;case"error":o({statusNodeType:e,title:i.options.strings.loadError+(s?" ("+s+")":""),checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo={message:s,details:n};break;case"noData":o({statusNodeType:e,title:s||i.options.strings.noData,checkbox:!1,colspan:!0,tooltip:n}),this._isLoading=!1,this._errorInfo=null;break;default:v("invalid node status "+e)}return i.update($.structure),r}setTitle(e){this.title=e,this.update()}_sortChildren(e,t){const i=this.children;if(i&&(i.sort(e),t))for(let s=0,n=i.length;s{t.logError(`Error in ${e} event promise`,s),i.classList.add("wb-error")})).finally((()=>{i.classList.remove("wb-busy")})),n}_onChange(e){const t=ue.getEventInfo(e),i=t.node,s=t.colElem;i&&0!==t.colIdx?this._applyChange("change",i,s,{info:t,event:e,inputElem:e.target,inputValue:ue.util.getValueFromElem(e.target)}):this.tree.log("Ignored change event for removed element or node title")}init(){super.init(),_(this.tree.element,"change",".contenteditable,input,textarea,select",(e=>this._onChange(e)))}_preprocessKeyEvent(e){const t=e.event,s=b(t),n=this.tree,r=this.getPluginOption("trigger");if(this.isEditingTitle()){switch(s){case"Enter":return this._stopEditTitle(!0,{event:t}),!1;case"Escape":return this._stopEditTitle(!1,{event:t}),!1}return!1}if(n.isRowNav()||0===n.activeColIdx){switch(s){case"Enter":if(r.indexOf("macEnter")>=0&&i)return this.startEditTitle(),!1;break;case"F2":if(r.indexOf("F2")>=0)return this.startEditTitle(),!1}return!0}return!0}isEditingTitle(e){return e?this.curEditNode===e:!!this.curEditNode}startEditTitle(e){e=null!=e?e:this.tree.getActiveNode();const t=this.getPluginOption("validity"),i=this.getPluginOption("select");if(!e)return;this.tree.logDebug(`startEditTitle(node=${e})`);let s=e._callEvent("edit.beforeEdit");if(!1===s)return void e.logInfo("beforeEdit canceled operation.");if(!0===s||!s){s=``}const n=e.getColElem(0).querySelector(".wb-title");n.innerHTML=s;const r=n.firstElementChild;t&&r.addEventListener("keydown",(e=>{r.setCustomValidity(""),r.reportValidity()})),r.focus(),i&&r.select(),this.curEditNode=e,e._callEvent("edit.edit",{inputElem:r})}stopEditTitle(e){return this._stopEditTitle(e,{})}_stopEditTitle(e,t){null!=t||(t={});const i=document.activeElement;let s=i?u(i):null;const n=this.curEditNode,r=!!t.forceClose,o=this.getPluginOption("validity");if(s&&this.getPluginOption("trim")&&(s=s.trim()),n)if(n.logDebug(`stopEditTitle(${e})`,t,i,s),e&&null!==s&&s!==n.title){const e=i.validationMessage;if(e)throw new Error(`Input validation failed for "${s}": ${e}.`);const t=n.getColElem(0);this._applyChange("edit.apply",n,t,{oldValue:n.title,newValue:s,inputElem:i}).then((e=>{const t=i.validationMessage;if(o&&t&&!1!==e)throw new Error(`Edit apply validation failed for "${s}": ${t}.`);(r||!1!==e)&&(null==n||n.setTitle(s),this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus())})).catch((e=>{n.logError(e)}))}else this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus();else this.tree.logDebug("stopEditTitle: not in edit mode.")}createNode(e="after",t,i){const s=this.tree;if(o(t=null!=t?t:s.getActiveNode(),"No node was passed, or no node is currently active."),e=e||"prependChild",null==i?i={title:""}:"string"==typeof i?i={title:i}:o(x(i),`Expected a plain object: ${i}`),("prependChild"===e||"appendChild"===e)&&(null==t?void 0:t.isExpandable(!0)))return void t.setExpanded().then((()=>{this.createNode(e,t,i)}));const n=t.addNode(i,e);n.setClass("wb-edit-new"),this.relatedNode=t,n.match=!0,n.makeVisible({noAnimation:!0}).then((()=>{this.startEditTitle(n)}))}} + * Wunderbaum - ext-edit + * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license. + * v0.8.0, Thu, 11 Jan 2024 19:37:23 GMT (https://github.com/mar10/wunderbaum) + */ +class he extends V{constructor(e){super(e,"edit",{debounce:100,minlength:1,maxlength:null,trigger:[],trim:!0,select:!0,slowClickDelay:1e3,validity:!0,beforeEdit:null,edit:null,apply:null}),this.curEditNode=null,this.relatedNode=null,this.debouncedOnChange=o(this._onChange.bind(this),this.getPluginOption("debounce"))}async _applyChange(e,t,i,s,n){return t.log(`_applyChange(${e})`,n),i.classList.add("wb-busy"),i.classList.remove("wb-error","wb-invalid"),s.setCustomValidity(""),new Promise(((i,s)=>{const r=t._callEvent(e,n);Promise.resolve(r).then((e=>{i(e)})).catch((e=>{s(e)}))})).then((e=>{if(!s.checkValidity())throw t.logWarn("inputElem.checkValidity() failed: throwing...."),new p(s.validationMessage);return e})).catch((n=>{if(!(n instanceof p))throw t.logError(`Error in ${e} event handler (throw e.util.ValidationError instead if this was intended)`,n),i.classList.add("wb-error"),n;t.logWarn("catched ",n),i.classList.add("wb-invalid"),s.setCustomValidity&&!s.validationMessage&&s.setCustomValidity(n.message),s.validationMessage&&s.reportValidity()})).finally((()=>{i.classList.remove("wb-busy")}))}_onChange(e){const t=pe.getEventInfo(e),i=t.node,s=t.colElem;i&&0!==t.colIdx?this._applyChange("change",i,s,e.target,{info:t,event:e,inputElem:e.target,inputValue:pe.util.getValueFromElem(e.target),inputValid:e.target.checkValidity()}):this.tree.log("Ignored change event for removed element or node title")}init(){super.init(),I(this.tree.element,"change",".contenteditable,input,textarea,select",(e=>this._onChange(e)))}_preprocessKeyEvent(e){const t=e.event,i=C(t),s=this.tree,n=this.getPluginOption("trigger");if(this.isEditingTitle()){switch(i){case"Enter":return this._stopEditTitle(!0,{event:t}),!1;case"Escape":return this._stopEditTitle(!1,{event:t}),!1}return!1}if(s.isRowNav()||0===s.activeColIdx){switch(i){case"Enter":if(n.indexOf("macEnter")>=0&&d)return this.startEditTitle(),!1;break;case"F2":if(n.indexOf("F2")>=0)return this.startEditTitle(),!1}return!0}return!0}isEditingTitle(e){return e?this.curEditNode===e:!!this.curEditNode}startEditTitle(e){e=null!=e?e:this.tree.getActiveNode();const t=this.getPluginOption("validity"),i=this.getPluginOption("select");if(!e)return;this.tree.logDebug(`startEditTitle(node=${e})`);let s=e._callEvent("edit.beforeEdit");if(!1===s)return void e.logDebug("beforeEdit canceled operation.");if(!0===s||!s){const t=m(e.title);let i=this.getPluginOption("maxlength");const n=i?` maxlength="${i}"`:"";i=this.getPluginOption("minlength");s=`0?" required":""}${i?` minlength="${i}"`:""}${n} >`}const n=e.getColElem(0).querySelector(".wb-title");n.innerHTML=s;const r=n.firstElementChild;t&&r.addEventListener("keydown",(t=>{r.setCustomValidity(""),r.reportValidity()||e.logWarn(`Invalid input: '${r.value}'`)})),r.focus(),i&&r.select(),this.curEditNode=e,e._callEvent("edit.edit",{inputElem:r})}stopEditTitle(e){return this._stopEditTitle(e,{})}_stopEditTitle(e,t){null!=t||(t={});const i=document.activeElement;let s=i?w(i):null;const n=this.curEditNode,r=!!t.forceClose,o=this.getPluginOption("validity");if(s&&this.getPluginOption("trim")&&(s=s.trim()),n)if(n.logDebug(`stopEditTitle(${e})`,t,i,s),e&&null!==s&&s!==n.title){const e=i.validationMessage;if(e)throw new Error(`Input validation failed for "${s}": ${e}.`);const t=n.getColElem(0);this._applyChange("edit.apply",n,t,i,{oldValue:n.title,newValue:s,inputElem:i,inputValid:i.checkValidity()}).then((e=>{const t=i.validationMessage;if(o&&t&&!1!==e)throw new Error(`Edit apply validation failed for "${s}": ${t}.`);(r||!1!==e)&&(null==n||n.setTitle(s),this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus())}))}else this.curEditNode._render({preventScroll:!0}),this.curEditNode=null,this.relatedNode=null,this.tree.setFocus();else this.tree.logDebug("stopEditTitle: not in edit mode.")}createNode(e="after",t,i){const s=this.tree;if(f(t=null!=t?t:s.getActiveNode(),"No node was passed, or no node is currently active."),e=e||"prependChild",null==i?i={title:""}:"string"==typeof i?i={title:i}:f(T(i),`Expected a plain object: ${i}`),("prependChild"===e||"appendChild"===e)&&(null==t?void 0:t.isExpandable(!0)))return void t.setExpanded().then((()=>{this.createNode(e,t,i)}));const n=t.addNode(i,e);n.setClass("wb-edit-new"),this.relatedNode=t,n.match=!0,n.makeVisible({noAnimation:!0}).then((()=>{this.startEditTitle(n)}))}} /*! - * wunderbaum.ts - * - * A treegrid control. - * - * Copyright (c) 2021-2023, Martin Wendt (https://wwWendt.de). - * https://github.com/mar10/wunderbaum - * - * Released under the MIT license. - * @version v0.7.0 - * @date Sat, 09 Dec 2023 13:47:27 GMT - */class he extends de{constructor(e){super(e,null,{key:"__root__",title:e.id})}toString(){return`WbSystemRoot@${this.key}<'${this.tree.id}'>`}}class ue{constructor(e){this.enabled=!0,this.data={},this.extensionList=[],this.extensions={},this.keyMap=new Map,this.refKeyMap=new Map,this.treeRowCount=0,this._disableUpdateCount=0,this._disableUpdateIgnoreCount=0,this.activeNode=null,this.focusNode=null,this.types={},this.columns=[],this._columnsById={},this.pendingChangeTypes=new Set,this._util=O,this.filterMode=null,this.activeColIdx=0,this._cellNavMode=!1,this.lastQuicksearchTime=0,this.lastQuicksearchTerm="",this.lastClickTime=0,this.log=this.logDebug;const t=this.options=y({id:null,source:null,element:null,debugLevel:3,header:null,rowHeightPx:G,iconMap:"bootstrap",columns:null,types:null,enabled:!0,fixedCol:!1,showSpinner:!1,checkbox:!1,minExpandLevel:0,emptyChildListExpandable:!1,skeleton:!1,connectTopBreadcrumb:null,selectMode:"multi",navigationModeOption:null,quicksearch:!0,iconBadge:null,change:null,error:null,receive:null,strings:{loadError:"Error",loading:"Loading...",noData:"No data"}},e),i=new oe;this.ready=i.promise();let s=!1;if(this.ready.then((()=>{s=!0;try{this._callEvent("init")}catch(e){this.logError("Exception inside `init(e)` event:",e)}})).catch((e=>{if(s)throw e;this._callEvent("init",{error:e})})),this.id=t.id||"wb_"+ ++ue.sequence,this.root=new he(this),this._registerExtension(new W(this)),this._registerExtension(new ce(this)),this._registerExtension(new K(this)),this._registerExtension(new se(this)),this._registerExtension(new re(this)),this._registerExtension(new B(this)),this._updateViewportThrottled=S(this._updateViewportImmediately.bind(this),{}),this.columns=t.columns,delete t.columns,!this.columns||!this.columns.length){const e="string"==typeof t.header?t.header:this.id;this.columns=[{id:"*",title:e,width:"*"}]}t.types&&this.setTypes(t.types,!0),delete t.types,this.element=v(t.element),o(!!this.element,`Invalid 'element' option: ${t.element}`),this.element.classList.add("wunderbaum"),this.element.getAttribute("tabindex")||(this.element.tabIndex=0),this.element._wb_tree=this,this.headerElement=this.element.querySelector("div.wb-header");const n=null==t.header?this.columns.length>1:!!t.header;if(this.headerElement){o(!this.columns,"`opts.columns` must not be set if markup already contains a header"),this.columns=[];const e=this.headerElement.querySelector("div.wb-row");for(const t of e.querySelectorAll("div"))this.columns.push({id:t.dataset.id||`col_${this.columns.length}`,title:""+t.textContent,width:"*"})}else{const e="".repeat(this.columns.length);if(this.element.innerHTML=`\n
\n
\n ${e}\n
\n
`,!n){this.element.querySelector("div.wb-header").style.display="none"}}this.element.innerHTML+='\n
\n
\n
',this.listContainerElement=this.element.querySelector("div.wb-list-container"),this.nodeListElement=this.listContainerElement.querySelector("div.wb-node-list"),this.headerElement=this.element.querySelector("div.wb-header"),this.element.classList.toggle("wb-grid",this.columns.length>1),this._initExtensions(),["enabled","fixedCol"].forEach((e=>{null!=t[e]&&this.setOption(e,t[e])})),t.source?(t.showSpinner&&(this.nodeListElement.innerHTML="loading..."),this.load(t.source).then((()=>{null==t.navigationModeOption?this.isGrid()?this.setNavigationOption(M.cell):this.setNavigationOption(M.row):this.setNavigationOption(t.navigationModeOption),i.resolve()})).catch((e=>{i.reject(e)})).finally((()=>{var e;null===(e=this.element.querySelector("progress.spinner"))||void 0===e||e.remove(),this.element.classList.remove("wb-initializing")}))):i.resolve(),this.update(D.any),this.element.addEventListener("scroll",(e=>{this.update(D.scroll)})),this.resizeObserver=new ResizeObserver((e=>{this.update(D.resize)})),this.resizeObserver.observe(this.element),_(this.nodeListElement,"click","div.wb-row",(t=>{const i=ue.getEventInfo(t),s=i.node,n=t;if(!1===this._callEvent("click",{event:t,node:s,info:i}))return this.lastClickTime=Date.now(),!1;if(s){if(n.ctrlKey)return void s.toggleSelected();const r=this.getOption("edit.trigger"),o=this.getOption("edit.slowClickDelay");r.indexOf("clickActive")>=0&&"title"===i.region&&s.isActive()&&(!o||Date.now()-this.lastClickTime=0?s.setActive(!0,{colIdx:i.colIdx,event:t}):s.setActive(!0,{event:t}),i.region===L.expander?s.setExpanded(!s.isExpanded(),{scrollIntoView:!1!==e.scrollIntoViewOnExpandClick}):i.region===L.checkbox&&s.toggleSelected()}this.lastClickTime=Date.now()})),_(this.nodeListElement,"dblclick","div.wb-row",(e=>{const t=ue.getEventInfo(e),i=t.node;if(!1===this._callEvent("dblclick",{event:e,node:i,info:t}))return!1;i&&0===t.colIdx&&i.isExpandable()&&(this._callMethod("edit._stopEditTitle"),i.setExpanded(!i.isExpanded()))})),_(this.element,"keydown",(e=>{const t=ue.getEventInfo(e),i=b(e),s=t.node||this.getFocusNode();this._callHook("onKeyEvent",{event:e,node:s,info:t,eventName:i})})),_(this.element,"focusin focusout",(e=>{const i="focusin"===e.type,s=ue.getNode(e);this._callEvent("focus",{flag:i,event:e}),i&&this.isRowNav()&&!this.isEditing()&&(t.navigationModeOption===M.row?null==s||s.setActive():this.setCellNav()),i||this._callMethod("edit._stopEditTitle",!0,{event:e,forceClose:!0})}))}static getTree(e){if(e instanceof ue)return e;if(e instanceof de)return e.tree;if(void 0===e&&(e=0),"number"==typeof e)e=document.querySelectorAll(".wunderbaum")[e];else if("string"==typeof e){for(const t of document.querySelectorAll(".wunderbaum")){const i=t._wb_tree;if(i&&i.id===e)return i}if(!(e=document.querySelector(e)))return null}else e.target&&(e=e.target);return o(e instanceof Element,`Invalid el type: ${e}`),e.matches(".wunderbaum")||(e=e.closest(".wunderbaum")),e&&e._wb_tree?e._wb_tree:null}get iconMap(){const e=this.options.iconMap;return"string"==typeof e?Y[e]:e}static getNode(e){if(!e)return null;if(e instanceof de)return e;for(void 0!==e.target&&(e=e.target);e;){if(e._wb_node)return e._wb_node;e=e.parentElement}return null}*[Symbol.iterator](){yield*this.root}_registerExtension(e){this.extensionList.push(e),this.extensions[e.id]=e}_initExtensions(){for(const e of this.extensionList)e.init()}_registerNode(e){const t=e.key;o(null!=t&&!this.keyMap.has(t),`Missing or duplicate key: '${t}'.`),this.keyMap.set(t,e);const i=e.refKey;if(i){const t=this.refKeyMap.get(i);t?t.add(e):this.refKeyMap.set(i,new Set)}}_unregisterNode(e){const t=e.refKey;if(t){const i=this.refKeyMap.get(t);i&&i.delete(e)&&!i.size&&this.refKeyMap.delete(t)}e.tree=null,e.parent=null,e.removeMarkup()}_callHook(e,t={}){let i;const s=y({},{tree:this,options:this.options,result:void 0},t);for(const t of this.extensionList){if(i=t[e].call(t,s),!1===i)break;void 0!==s.result&&(i=s.result)}return i}_callMethod(e,...t){const[i,s]=e.split("."),n=s?this.extensions[i]:this,r=n[s];if(r)return r.apply(n,t);this.logError(`Calling undefined method '${e}()'.`)}_callEvent(e,t){const[i,s]=e.split("."),n=this.options,r=s?n[i][s]:n[i];if(r)return r.call(this,y({type:e,tree:this,util:this._util},t))}_getNodeByRowIdx(e){let t=null;return this.visitRows((i=>{if(i._rowIdx===e)return t=i,!1})),t}getTopmostVpNode(e=!0){const t=this.element.scrollTop;let i;return i=e?Math.ceil((t-1)/G):Math.floor(t/G),this._getNodeByRowIdx(i)}getLowestVpNode(e=!0){const t=this.element,i=this.headerElement.clientHeight,s=t.scrollTop,n=t.clientHeight-i;let r;return r=e?Math.floor((s+n)/G)-1:Math.ceil((s+n)/G)-1,r=Math.min(r,this.count(!0)-1),this._getNodeByRowIdx(r)}_getPrevNodeInView(e,t=1){return this.visitRows((i=>{if(e=i,t--<=0)return!1}),{reverse:!0,start:e||this.getActiveNode()}),e}_getNextNodeInView(e,t=1){return this.visitRows((i=>{if(e=i,t--<=0)return!1}),{reverse:!1,start:e||this.getActiveNode()}),e}addChildren(e,t){return this.root.addChildren(e,t)}applyCommand(e,t,i){let s,n;switch(t instanceof de?s=t:(s=this.getActiveNode(),o(void 0===i,`Unexpected options: ${i}`),i=t),e){case"moveUp":n=s.getPrevSibling(),n&&(s.moveTo(n,"before"),s.setActive());break;case"moveDown":n=s.getNextSibling(),n&&(s.moveTo(n,"after"),s.setActive());break;case"indent":n=s.getPrevSibling(),n&&(s.moveTo(n,"appendChild"),n.setExpanded(),s.setActive());break;case"outdent":s.isTopLevel()||(s.moveTo(s.getParent(),"after"),s.setActive());break;case"remove":n=s.getPrevSibling()||s.getParent(),s.remove(),n&&n.setActive();break;case"addChild":this._callMethod("edit.createNode","prependChild");break;case"addSibling":this._callMethod("edit.createNode","after");break;case"rename":this._callMethod("edit.startEditTitle");break;case"down":case"first":case"last":case"left":case"pageDown":case"pageUp":case"parent":case"right":case"up":return s.navigate(e);default:a(`Unhandled command: '${e}'`)}}clear(){this.root.removeChildren(),this.root.children=null,this.keyMap.clear(),this.refKeyMap.clear(),this.treeRowCount=0,this.activeNode=null,this.focusNode=null,this.update(D.structure)}destroy(){this.logInfo("destroy()..."),this.clear(),this.resizeObserver.disconnect(),this.element.innerHTML="",this.element.outerHTML=this.element.outerHTML}getOption(e,t){let i,s=this.options;e.indexOf(".")>=0&&([i,e]=e.split("."),s=s[i]);let n=s[e];return"function"==typeof n&&(n=n({type:"resolve",tree:this})),null!=n?n:t}setOption(e,t){if(e.indexOf(".")>=0){const i=e.split(".");this.extensions[i[0]].setPluginOption(i[1],t)}else switch(this.options[e]=t,e){case"checkbox":this.update(D.any);break;case"enabled":this.setEnabled(!!t);break;case"fixedCol":this.element.classList.toggle("wb-fixed-col",!!t)}}hasFocus(){return this.element.contains(document.activeElement)}hasHeader(){const e=this.options.header;return this.isGrid()?!1!==e:!!e}runWithDeferredUpdate(e,t=null){try{this.enableUpdate(!1);const t=e();return o(!(t instanceof Promise),`Promise return not allowed: ${t}`),t}finally{this.enableUpdate(!0)}}async expandAll(e=!0,t){await this.root.expandAll(e,t)}selectAll(e=!0){return this.root.setSelected(e,{propagateDown:!0})}toggleSelect(){this.selectAll(this.root._anySelectable())}getSelectedNodes(e=!1){return this.root.getSelectedNodes(e)}_selectRange(e){this.logDebug("_selectRange",e),a("Not yet implemented.")}count(e=!1){return e?this.treeRowCount:this.keyMap.size}_check(){let e=0;this.visit((t=>{e++})),this.keyMap.size!==e&&this.logWarn(`_check failed: ${this.keyMap.size} !== ${e}`)}findAll(e){return this.root.findAll(e)}findFirst(e){return this.root.findFirst(e)}findKey(e){return this.keyMap.get(e)||null}findNextNode(e,t){let i=null;const s=this.getFirstChild(),n="string"==typeof e?function(e){e=c(e);const t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}(e):e;function r(e){if(n(e)&&(i=e),i||e===t)return!1}return t=t||s,this.visitRows(r,{start:t,includeSelf:!1}),i||t===s||this.visitRows(r,{start:s,includeSelf:!0}),i}findRelatedNode(e,t,i=!1){let s=null;const n=Math.floor(this.listContainerElement.clientHeight/G);switch(t){case"parent":case"left":e.parent&&e.parent.parent&&(s=e.parent);break;case"first":this.visit((e=>{if(e.isVisible())return s=e,!1}));break;case"last":this.visit((e=>{e.isVisible()&&(s=e)}));break;case"right":e.children&&e.children.length&&(s=e.children[0]);break;case"up":s=this._getPrevNodeInView(e);break;case"down":s=this._getNextNodeInView(e);break;case"pageDown":{const t=this.getLowestVpNode();s=e._rowIdxt._rowIdx?t:this._getPrevNodeInView(e,n)}break;default:this.logWarn("Unknown relation '"+t+"'.")}return s}*format_iter(e,t){yield*this.root.format_iter(e,t)}format(e,t){return this.root.format(e,t)}getActiveColElem(){return this.activeNode&&this.activeColIdx>=0?this.activeNode.getColElem(this.activeColIdx):null}getActiveNode(){return this.activeNode}getFirstChild(){return this.root.getFirstChild()}getFocusNode(){return this.focusNode}static getEventInfo(e){const t=e.target,i=t.classList,s=t.closest("span.wb-col"),n=ue.getNode(t),r=n?n.tree:ue.getTree(e),o={event:e,canonicalName:b(e),tree:r,node:n,region:L.unknown,colDef:void 0,colIdx:-1,colId:void 0,colElem:s};if(i.contains("wb-title"))o.region=L.title;else if(i.contains("wb-expander"))o.region=n.isExpandable()?L.expander:L.prefix;else if(i.contains("wb-checkbox"))o.region=L.checkbox;else if(i.contains("wb-icon"))o.region=L.icon;else if(i.contains("wb-node"))o.region=L.title;else if(s){o.region=L.column;const e=Array.prototype.indexOf.call(s.parentNode.children,s);o.colIdx=e}else{if(!i.contains("wb-row"))return"mousemove"===e.type||e instanceof KeyboardEvent||null==r||r.logWarn("getEventInfo(): not found",e,o),o;o.region=L.title}return-1===o.colIdx&&(o.colIdx=0),o.colDef=null==r?void 0:r.columns[o.colIdx],null!=o.colDef&&(o.colId=o.colDef.id),o}toString(){return`Wunderbaum<'${this.id}'>`}isEditing(){return this._callMethod("edit.isEditingTitle")}isLoading(){let e=!1;return this.root.visit((t=>{if(t._isLoading||t._requestId)return e=!0,!1}),!0),e}logDebug(...e){this.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.options.debugLevel>=3&&console.info(this.toString(),...e)}logTime(e){return this.options.debugLevel>=4&&console.time(this+": "+e),e}logTimeEnd(e){this.options.debugLevel>=4&&console.timeEnd(this+": "+e)}logWarn(...e){this.options.debugLevel>=2&&console.warn(this.toString(),...e)}scrollTo(e){let t,i;e instanceof de?t=e:(i=e,t=i.node),o(t&&null!=t._rowIdx,`Invalid node: ${t}`);const s=this.element,n=this.headerElement.clientHeight,r=s.scrollTop,l=s.clientHeight,a=t._rowIdx*G+n,d=n,c=a-r,h=c+G,u=null==i?void 0:i.topNode;let p=null;c>=d?h<=l||(p=a+G-l+2):p=a-d-2,null!=p&&(this.log(`scrollTo(${a}): ${r} => ${p}`),s.scrollTop=p,u&&this.scrollTo(u))}scrollToHorz(){const e=this.columns[0]._widthPx,t=this.element.clientWidth,i=this.element.scrollLeft,s=this.getActiveColElem(),n=Number.parseInt(null==s?void 0:s.style.left,10),r=n+Number.parseInt(null==s?void 0:s.style.width,10);let o=i;n-it&&(o=r-t),o=Math.max(0,o),this.log(`scrollToHorz(${this.activeColIdx}): ${n}..${r}, fixedOfs=${e}, vpWidth=${t}, curLeft=${i} -> ${o}`),this.element.scrollLeft=o}setColumn(e){var t;if(o(this.isCellNav(),"Exected cellNav mode"),o(0<=e&&e0&&(s?this._updateViewportImmediately():this._updateViewportThrottled())}setEnabled(e=!0){const t=this.enabled;return this.enabled=!!e,this.element.classList.toggle("wb-disabled",!e),t}isEnabled(){return this.enabled}isGrid(){return this.columns&&this.columns.length>1}isCellNav(){return!!this._cellNavMode}isRowNav(){return!this._cellNavMode}setCellNav(e=!0){var t;const i=this._cellNavMode;this._cellNavMode=!!e,e&&!i&&this.setColumn(0),this.element.classList.toggle("wb-cell-mode",e),null===(t=this.activeNode)||void 0===t||t.update(D.status)}setNavigationOption(e,t=!1){if(this.isGrid()||e===M.row)switch(this.options.navigationModeOption=e,e){case M.cell:this.setCellNav(!0);break;case M.row:this.setCellNav(!1);break;case M.startCell:t&&this.setCellNav(!0);break;case M.startRow:t&&this.setCellNav(!1);break;default:a(`Invalid mode '${e}'.`)}else this.logWarn("Plain trees only support row navigation mode.")}setStatus(e,t){return this.root.setStatus(e,t)}setTypes(e,t=!0){o(x(e),`Expected plain objext: ${e}`),t?this.types=e:y(this.types,e);for(const e of Object.values(this.types))e.classes&&(e.classes=N(e.classes))}sortChildren(e=ee,t=!1){this.root.sortChildren(e,t)}toDictArray(e){var t;return null!==(t=this.root.toDict(!0,e).children)&&void 0!==t?t:[]}_updateColumnWidths(){const e=this.element.clientWidth,t=this.columns,i=t[0];let s=0,n=0,r=0,o=!1;if("*"!==i.id)throw new Error(`First column must have id '*': got '${i.id}'.`);this._columnsById={};for(const e of t){this._columnsById[e.id]=e;const t=e.width;if("*"===e.id&&e!==i)throw new Error(`Column id '*' must be defined only once: '${e.title}'.`);if(t&&"*"!==t)if("number"==typeof t)e._weight=t,n+=t;else if("string"==typeof t&&t.endsWith("px")){e._weight=0;const i=parseFloat(t.slice(0,-2));e._widthPx!=i&&(o=!0,e._widthPx=i),r+=i}else a(`Invalid column width: ${t} (expected string ending with 'px' or number, e.g. "px" or ).`);else e._weight=1,n+=1}const l=Math.max(0,e-r);let d=0;for(const e of t){let t;if(e._weight){const i=e.minWidth;t="number"==typeof i?i:"string"==typeof i&&i.endsWith("px")?parseFloat(i.slice(0,-2)):4;const s=Math.max(t,l*e._weight/n);e._widthPx!=s&&(o=!0,e._widthPx=s)}e._ofsPx=d,d+=e._widthPx}t[t.length-1]._widthPx-=1,s=d-1;const c=`${s}px`;return this.headerElement.style.width=c,this.listContainerElement.style.width=c,o}_renderHeaderMarkup(){o(this.headerElement,"Expected a headerElement");const e=this.hasHeader();if(p(this.headerElement,e),!e)return;const t=this.columns.length,i=this.headerElement.querySelector(".wb-row");o(i,"Expected a row in header element"),i.innerHTML="".repeat(t);for(let e=0;e${r}${l}`,this.isCellNav()&&n.classList.toggle("wb-active",e===this.activeColIdx)}}updatePendingModifications(){this.pendingChangeTypes.size>0&&this._updateViewportImmediately()}_updateViewportImmediately(){var e;if(this._disableUpdateCount)return this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount})`),void this._disableUpdateIgnoreCount++;const t=I,i=new Set(this.pendingChangeTypes);this.pendingChangeTypes.clear();if(i.has(t.scroll)&&1===i.size)this._updateRows({newNodesOnly:!0});else{if(this.log("_updateViewportImmediately():",i),!1!==this.options.adjustHeight){let e=this.listContainerElement.clientHeight;const t=this.headerElement.clientHeight,i=this.element.clientHeight-t-1;Math.abs(e-i)>1&&(this.listContainerElement.style.height=i+"px",e=i)}i.has(t.clearMarkup)&&this.visit((e=>{e.removeMarkup()})),i.has(t.header)&&(this._updateColumnWidths(),this._renderHeaderMarkup()),this._updateRows()}if(this.options.connectTopBreadcrumb){let t=null===(e=this.getTopmostVpNode(!0))||void 0===e?void 0:e.getPath(!1,"title"," > ");t=t?t+" >":"",this.options.connectTopBreadcrumb.textContent=t}this._callEvent("update")}_updateRows(e){const t=!!(e=Object.assign({newNodesOnly:!1},e)).newNodesOnly,i=this.element.clientHeight,s=this.element.scrollTop;let n=Math.max(0,s/22-5);n=Math.floor(n),n%2&&n--;let r=Math.max(0,(s+i)/22+5);r=Math.ceil(r);const o=new Set;this.nodeListElement.childNodes.forEach((e=>{const t=e;o.add(t._wb_node)}));let l=0,a=0,d=!1,c="first";this.visitRows((function(e){const i=e._rowElem;e._rowIdx!==l&&(e._rowIdx=l,d=!0),lr?i&&(c=i):i&&t?(o.delete(e),i.style.top=l*G+"px",c=i):(o.delete(e),i&&(i.style.top=l*G+"px"),e._render({top:a,after:c}),c=e._rowElem),l++,a+=22})),this.treeRowCount=l;for(const e of o)e._callEvent("discard"),e.removeMarkup();return this.nodeListElement.style.height=`${a}px`,d}visit(e){return this.root.visit(e,!1)}visitRows(e,t){if(!this.root.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);let i,s,n,r,l,a,d=0,c=!1===(t=t||{}).includeSelf,h=t.start||this.root.children[0];const u=!!t.includeHidden,p=!u&&"hide"===this.filterMode;for(n=h.parent;n;){for(l=n.children,s=l.indexOf(h)+d,o(s>=0,`Could not find ${h} in parent's children: ${n}`),i=s;it!==a&&(!p||t.match||t.subMatchCount?!1!==e(t)&&(u||!t.children||t.expanded?void 0:"skip"):"skip")),!1),!1===r))return!1}}h=n,n=n.parent,d=1,!n&&t.wrap&&(this.logDebug("visitRows(): wrap around"),o(t.start,"`wrap` option requires `start`"),a=t.start,t.wrap=!1,n=this.root,d=0)}return!0}_visitRowsUp(e,t){let i,s,n,r=t.start||this.root.children[0];const o=!!t.includeHidden;if(!1!==t.includeSelf&&!1===e(r))return!1;for(;;){if(n=r.parent,i=n.children,i[0]===r){if(r=n,!r.parent)break;i=n.children}else for(s=i.indexOf(r),r=i[s-1];(o||r.expanded)&&r.children&&r.children.length;)i=r.children,n=r,r=i[i.length-1];if((o||r.isVisible())&&!1===e(r))return!1}return!0}load(e){return this.clear(),this.root.load(e)}enableUpdate(e){e?(o(this._disableUpdateCount>0,"enableUpdate(true) was called too often"),this._disableUpdateCount--,0===this._disableUpdateCount&&(this.logDebug(`enableUpdate(): active again. Re-painting to catch up with ${this._disableUpdateIgnoreCount} ignored update requests...`),this._disableUpdateIgnoreCount=0,this.update(D.any,{immediate:!0}))):this._disableUpdateCount++}filterNodes(e,t){return this.extensions.filter.filterNodes(e,t)}filterBranches(e,t){return this.extensions.filter.filterBranches(e,t)}clearFilter(){return this.extensions.filter.clearFilter()}isFilterActive(){return!!this.filterMode}updateFilter(){return this.extensions.filter.updateFilter()}}ue.sequence=0,ue.version="v0.7.0",ue.util=O,e.Wunderbaum=ue})); + * wunderbaum.ts + * + * A treegrid control. + * + * Copyright (c) 2021-2023, Martin Wendt (https://wwWendt.de). + * https://github.com/mar10/wunderbaum + * + * Released under the MIT license. + * @version v0.8.0 + * @date Thu, 11 Jan 2024 19:37:23 GMT + */class ue extends ce{constructor(e){super(e,null,{key:"__root__",title:e.id})}toString(){return`WbSystemRoot@${this.key}<'${this.tree.id}'>`}}class pe{constructor(e){this.enabled=!0,this.data={},this.extensionList=[],this.extensions={},this.keyMap=new Map,this.refKeyMap=new Map,this.treeRowCount=0,this._disableUpdateCount=0,this._disableUpdateIgnoreCount=0,this.activeNode=null,this.focusNode=null,this.types={},this.columns=[],this._columnsById={},this.pendingChangeTypes=new Set,this._util=U,this.filterMode=null,this.activeColIdx=0,this._cellNavMode=!1,this.lastQuicksearchTime=0,this.lastQuicksearchTerm="",this.lastClickTime=0,this.log=this.logDebug;const t=this.options=N({id:null,source:null,element:null,debugLevel:3,header:null,rowHeightPx:Q,iconMap:"bootstrap",columns:null,types:null,enabled:!0,fixedCol:!1,showSpinner:!1,checkbox:!1,minExpandLevel:0,emptyChildListExpandable:!1,skeleton:!1,connectTopBreadcrumb:null,selectMode:"multi",navigationModeOption:null,quicksearch:!0,iconBadge:null,change:null,error:null,receive:null,strings:{loadError:"Error",loading:"Loading...",noData:"No data"}},e),i=new le;this.ready=i.promise();let s=!1;if(this.ready.then((()=>{s=!0;try{this._callEvent("init")}catch(e){this.logError("Exception inside `init(e)` event:",e)}})).catch((e=>{if(s)throw e;this._callEvent("init",{error:e})})),this.id=t.id||"wb_"+ ++pe.sequence,this.root=new ue(this),this._registerExtension(new B(this)),this._registerExtension(new he(this)),this._registerExtension(new W(this)),this._registerExtension(new ne(this)),this._registerExtension(new oe(this)),this._registerExtension(new G(this)),this._updateViewportThrottled=A(this._updateViewportImmediately.bind(this),{}),this.columns=t.columns,delete t.columns,!this.columns||!this.columns.length){const e="string"==typeof t.header?t.header:this.id;this.columns=[{id:"*",title:e,width:"*"}]}t.types&&this.setTypes(t.types,!0),delete t.types,this.element=k(t.element),f(!!this.element,`Invalid 'element' option: ${t.element}`),this.element.classList.add("wunderbaum"),this.element.getAttribute("tabindex")||(this.element.tabIndex=0),this.element._wb_tree=this,this.headerElement=this.element.querySelector("div.wb-header");const n=null==t.header?this.columns.length>1:!!t.header;if(this.headerElement){f(!this.columns,"`opts.columns` must not be set if markup already contains a header"),this.columns=[];const e=this.headerElement.querySelector("div.wb-row");for(const t of e.querySelectorAll("div"))this.columns.push({id:t.dataset.id||`col_${this.columns.length}`,title:""+t.textContent,width:"*"})}else{const e="".repeat(this.columns.length);if(this.element.innerHTML=`\n
\n
\n ${e}\n
\n
`,!n){this.element.querySelector("div.wb-header").style.display="none"}}this.element.innerHTML+='\n
\n
\n
',this.listContainerElement=this.element.querySelector("div.wb-list-container"),this.nodeListElement=this.listContainerElement.querySelector("div.wb-node-list"),this.headerElement=this.element.querySelector("div.wb-header"),this.element.classList.toggle("wb-grid",this.columns.length>1),this._initExtensions(),["enabled","fixedCol"].forEach((e=>{null!=t[e]&&this.setOption(e,t[e])})),t.source?(t.showSpinner&&(this.nodeListElement.innerHTML="loading..."),this.load(t.source).then((()=>{null==t.navigationModeOption?this.isGrid()?this.setNavigationOption(z.cell):this.setNavigationOption(z.row):this.setNavigationOption(t.navigationModeOption),this.update($.structure,{immediate:!0}),i.resolve()})).catch((e=>{i.reject(e)})).finally((()=>{var e;null===(e=this.element.querySelector("progress.spinner"))||void 0===e||e.remove(),this.element.classList.remove("wb-initializing")}))):i.resolve(),this.update($.any),this.element.addEventListener("scroll",(e=>{this.update($.scroll)})),this.resizeObserver=new ResizeObserver((e=>{this.update($.resize)})),this.resizeObserver.observe(this.element),I(this.nodeListElement,"click","div.wb-row",(t=>{const i=pe.getEventInfo(t),s=i.node,n=t;if(!1===this._callEvent("click",{event:t,node:s,info:i}))return this.lastClickTime=Date.now(),!1;if(s){if(n.ctrlKey)return void s.toggleSelected();const r=this.getOption("edit.trigger"),o=this.getOption("edit.slowClickDelay");r.indexOf("clickActive")>=0&&"title"===i.region&&s.isActive()&&(!o||Date.now()-this.lastClickTime=0?s.setActive(!0,{colIdx:i.colIdx,event:t}):s.setActive(!0,{event:t}),i.region===F.expander?s.setExpanded(!s.isExpanded(),{scrollIntoView:!1!==e.scrollIntoViewOnExpandClick}):i.region===F.checkbox&&s.toggleSelected()}this.lastClickTime=Date.now()})),I(this.nodeListElement,"dblclick","div.wb-row",(e=>{const t=pe.getEventInfo(e),i=t.node;if(!1===this._callEvent("dblclick",{event:e,node:i,info:t}))return!1;i&&0===t.colIdx&&i.isExpandable()&&(this._callMethod("edit._stopEditTitle"),i.setExpanded(!i.isExpanded()))})),I(this.element,"keydown",(e=>{const t=pe.getEventInfo(e),i=C(e),s=t.node||this.getFocusNode();this._callHook("onKeyEvent",{event:e,node:s,info:t,eventName:i})})),I(this.element,"focusin focusout",(e=>{const i="focusin"===e.type,s=pe.getNode(e);this._callEvent("focus",{flag:i,event:e}),i&&this.isRowNav()&&!this.isEditingTitle()&&(t.navigationModeOption===z.row?null==s||s.setActive():this.setCellNav()),i||this._callMethod("edit._stopEditTitle",!0,{event:e,forceClose:!0})}))}static getTree(e){if(e instanceof pe)return e;if(e instanceof ce)return e.tree;if(void 0===e&&(e=0),"number"==typeof e)e=document.querySelectorAll(".wunderbaum")[e];else if("string"==typeof e){for(const t of document.querySelectorAll(".wunderbaum")){const i=t._wb_tree;if(i&&i.id===e)return i}if(!(e=document.querySelector(e)))return null}else e.target&&(e=e.target);return f(e instanceof Element,`Invalid el type: ${e}`),e.matches(".wunderbaum")||(e=e.closest(".wunderbaum")),e&&e._wb_tree?e._wb_tree:null}get iconMap(){const e=this.options.iconMap;return"string"==typeof e?J[e]:e}static getNode(e){if(!e)return null;if(e instanceof ce)return e;for(void 0!==e.target&&(e=e.target);e;){if(e._wb_node)return e._wb_node;e=e.parentElement}return null}*[Symbol.iterator](){yield*this.root}_registerExtension(e){this.extensionList.push(e),this.extensions[e.id]=e}_initExtensions(){for(const e of this.extensionList)e.init()}_registerNode(e){const t=e.key;f(null!=t&&!this.keyMap.has(t),`Missing or duplicate key: '${t}'.`),this.keyMap.set(t,e);const i=e.refKey;if(null!=i){const t=this.refKeyMap.get(i);t?t.add(e):this.refKeyMap.set(i,new Set([e]))}}_unregisterNode(e){const t=e.refKey;if(null!=t){const i=this.refKeyMap.get(t);i&&i.delete(e)&&!i.size&&this.refKeyMap.delete(t)}this.keyMap.delete(e.key),e.tree=null,e.parent=null,e.removeMarkup()}_callHook(e,t={}){let i;const s=N({},{tree:this,options:this.options,result:void 0},t);for(const t of this.extensionList){if(i=t[e].call(t,s),!1===i)break;void 0!==s.result&&(i=s.result)}return i}_callMethod(e,...t){const[i,s]=e.split("."),n=s?this.extensions[i]:this,r=n[s];if(r)return r.apply(n,t);this.logError(`Calling undefined method '${e}()'.`)}_callEvent(e,t){const[i,s]=e.split("."),n=this.options,r=s?n[i][s]:n[i];if(r)return r.call(this,N({type:e,tree:this,util:this._util},t))}_getNodeByRowIdx(e){let t=null;return this.visitRows((i=>{if(i._rowIdx===e)return t=i,!1})),t}getTopmostVpNode(e=!0){const t=this.element.scrollTop;let i;return i=e?Math.ceil((t-1)/Q):Math.floor(t/Q),this._getNodeByRowIdx(i)}getLowestVpNode(e=!0){const t=this.element,i=this.headerElement.clientHeight,s=t.scrollTop,n=t.clientHeight-i;let r;return r=e?Math.floor((s+n)/Q)-1:Math.ceil((s+n)/Q)-1,r=Math.min(r,this.count(!0)-1),this._getNodeByRowIdx(r)}_getPrevNodeInView(e,t=1){return this.visitRows((i=>{if(e=i,t--<=0)return!1}),{reverse:!0,start:e||this.getActiveNode()}),e}_getNextNodeInView(e,t=1){return this.visitRows((i=>{if(e=i,t--<=0)return!1}),{reverse:!1,start:e||this.getActiveNode()}),e}addChildren(e,t){return this.root.addChildren(e,t)}applyCommand(e,t,i){let s,n;switch(t instanceof ce?s=t:(s=this.getActiveNode(),f(void 0===i,`Unexpected options: ${i}`),i=t),e){case"moveUp":n=s.getPrevSibling(),n&&(s.moveTo(n,"before"),s.setActive());break;case"moveDown":n=s.getNextSibling(),n&&(s.moveTo(n,"after"),s.setActive());break;case"indent":n=s.getPrevSibling(),n&&(s.moveTo(n,"appendChild"),n.setExpanded(),s.setActive());break;case"outdent":s.isTopLevel()||(s.moveTo(s.getParent(),"after"),s.setActive());break;case"remove":n=s.getPrevSibling()||s.getParent(),s.remove(),n&&n.setActive();break;case"addChild":this._callMethod("edit.createNode","prependChild");break;case"addSibling":this._callMethod("edit.createNode","after");break;case"rename":s.startEditTitle();break;case"down":case"first":case"last":case"left":case"pageDown":case"pageUp":case"parent":case"right":case"up":return s.navigate(e);default:v(`Unhandled command: '${e}'`)}}clear(){this.root.removeChildren(),this.root.children=null,this.keyMap.clear(),this.refKeyMap.clear(),this.treeRowCount=0,this.activeNode=null,this.focusNode=null,this.update($.structure)}destroy(){this.logInfo("destroy()..."),this.clear(),this.resizeObserver.disconnect(),this.element.innerHTML="",this.element.outerHTML=this.element.outerHTML}getOption(e,t){let i,s=this.options;e.indexOf(".")>=0&&([i,e]=e.split("."),s=s[i]);let n=s[e];return"function"==typeof n&&(n=n({type:"resolve",tree:this})),null!=n?n:t}setOption(e,t){if(e.indexOf(".")>=0){const i=e.split(".");this.extensions[i[0]].setPluginOption(i[1],t)}else switch(this.options[e]=t,e){case"checkbox":this.update($.any);break;case"enabled":this.setEnabled(!!t);break;case"fixedCol":this.element.classList.toggle("wb-fixed-col",!!t)}}hasFocus(){return this.element.contains(document.activeElement)}hasHeader(){const e=this.options.header;return this.isGrid()?!1!==e:!!e}runWithDeferredUpdate(e,t=null){try{this.enableUpdate(!1);const t=e();return f(!(t instanceof Promise),`Promise return not allowed: ${t}`),t}finally{this.enableUpdate(!0)}}async expandAll(e=!0,t){await this.root.expandAll(e,t)}selectAll(e=!0){return this.root.setSelected(e,{propagateDown:!0})}toggleSelect(){this.selectAll(this.root._anySelectable())}getSelectedNodes(e=!1){return this.root.getSelectedNodes(e)}_selectRange(e){this.logDebug("_selectRange",e),v("Not yet implemented.")}count(e=!1){return e?this.treeRowCount:this.keyMap.size}_check(){let e=0;this.visit((t=>{e++})),this.keyMap.size!==e&&this.logWarn(`_check failed: ${this.keyMap.size} !== ${e}`)}findAll(e){return this.root.findAll(e)}findByRefKey(e){const t=this.refKeyMap.get(e);return t?Array.from(t):[]}findFirst(e){return this.root.findFirst(e)}findKey(e){return this.keyMap.get(e)||null}findNextNode(e,t){let i=null;const s=this.getFirstChild(),n="string"==typeof e?function(e){e=y(e);const t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}(e):e;function r(e){if(n(e)&&(i=e),i||e===t)return!1}return t=t||s,this.visitRows(r,{start:t,includeSelf:!1}),i||t===s||this.visitRows(r,{start:s,includeSelf:!0}),i}findRelatedNode(e,t,i=!1){let s=null;const n=Math.floor(this.listContainerElement.clientHeight/Q);switch(t){case"parent":case"left":e.parent&&e.parent.parent&&(s=e.parent);break;case"first":this.visit((e=>{if(e.isVisible())return s=e,!1}));break;case"last":this.visit((e=>{e.isVisible()&&(s=e)}));break;case"right":e.children&&e.children.length&&(s=e.children[0]);break;case"up":s=this._getPrevNodeInView(e);break;case"down":s=this._getNextNodeInView(e);break;case"pageDown":{const t=this.getLowestVpNode();s=e._rowIdxt._rowIdx?t:this._getPrevNodeInView(e,n)}break;default:this.logWarn("Unknown relation '"+t+"'.")}return s}*format_iter(e,t){yield*this.root.format_iter(e,t)}format(e,t){return this.root.format(e,t)}getActiveColElem(){return this.activeNode&&this.activeColIdx>=0?this.activeNode.getColElem(this.activeColIdx):null}getActiveNode(){return this.activeNode}getFirstChild(){return this.root.getFirstChild()}getFocusNode(){return this.focusNode}static getEventInfo(e){const t=e.target,i=t.classList,s=t.closest("span.wb-col"),n=pe.getNode(t),r=n?n.tree:pe.getTree(e),o={event:e,canonicalName:C(e),tree:r,node:n,region:F.unknown,colDef:void 0,colIdx:-1,colId:void 0,colElem:s};if(i.contains("wb-title"))o.region=F.title;else if(i.contains("wb-expander"))o.region=n.isExpandable()?F.expander:F.prefix;else if(i.contains("wb-checkbox"))o.region=F.checkbox;else if(i.contains("wb-icon"))o.region=F.icon;else if(i.contains("wb-node"))o.region=F.title;else if(s){o.region=F.column;const e=Array.prototype.indexOf.call(s.parentNode.children,s);o.colIdx=e}else{if(!i.contains("wb-row"))return"mousemove"===e.type||e instanceof KeyboardEvent||null==r||r.logWarn("getEventInfo(): not found",e,o),o;o.region=F.title}return-1===o.colIdx&&(o.colIdx=0),o.colDef=null==r?void 0:r.columns[o.colIdx],null!=o.colDef&&(o.colId=o.colDef.id),o}toString(){return`Wunderbaum<'${this.id}'>`}isEditing(){return!!this.nodeListElement.querySelector("input:focus,select:focus")}isEditingTitle(){return this._callMethod("edit.isEditingTitle")}isLoading(){let e=!1;return this.root.visit((t=>{if(t._isLoading||t._requestId)return e=!0,!1}),!0),e}logDebug(...e){this.options.debugLevel>=4&&console.log(this.toString(),...e)}logError(...e){this.options.debugLevel>=1&&console.error(this.toString(),...e)}logInfo(...e){this.options.debugLevel>=3&&console.info(this.toString(),...e)}logTime(e){return this.options.debugLevel>=4&&console.time(this+": "+e),e}logTimeEnd(e){this.options.debugLevel>=4&&console.timeEnd(this+": "+e)}logWarn(...e){this.options.debugLevel>=2&&console.warn(this.toString(),...e)}scrollTo(e){let t,i;e instanceof ce?t=e:(i=e,t=i.node),f(t&&null!=t._rowIdx,`Invalid node: ${t}`);const s=this.element,n=this.headerElement.clientHeight,r=s.scrollTop,o=s.clientHeight,l=t._rowIdx*Q+n,a=n,d=l-r,c=d+Q,h=null==i?void 0:i.topNode;let u=null;d>=a?c<=o||(u=l+Q-o+2):u=l-a-2,null!=u&&(this.log(`scrollTo(${l}): ${r} => ${u}`),s.scrollTop=u,h&&this.scrollTo(h))}scrollToHorz(){const e=this.columns[0]._widthPx,t=this.element.clientWidth,i=this.element.scrollLeft,s=this.getActiveColElem(),n=Number.parseInt(null==s?void 0:s.style.left,10),r=n+Number.parseInt(null==s?void 0:s.style.width,10);let o=i;n-it&&(o=r-t),o=Math.max(0,o),this.log(`scrollToHorz(${this.activeColIdx}): ${n}..${r}, fixedOfs=${e}, vpWidth=${t}, curLeft=${i} -> ${o}`),this.element.scrollLeft=o}setColumn(e,t){var i,s,n;const r=null==t?void 0:t.edit,o=!1!==(null==t?void 0:t.scrollIntoView);if(f(this.isCellNav(),"Expected cellNav mode"),"string"==typeof e){const t=e;f((e=this.columns.findIndex((t=>t.id===e)))>=0,`Invalid colId: ${t}`)}if(f(0<=e&&e0&&(s?this._updateViewportImmediately():this._updateViewportThrottled())}}setEnabled(e=!0){const t=this.enabled;return this.enabled=!!e,this.element.classList.toggle("wb-disabled",!e),t}isEnabled(){return this.enabled}isGrid(){return this.columns&&this.columns.length>1}isCellNav(){return!!this._cellNavMode}isRowNav(){return!this._cellNavMode}setCellNav(e=!0){var t;const i=this._cellNavMode;this._cellNavMode=!!e,e&&!i&&this.setColumn(0),this.element.classList.toggle("wb-cell-mode",e),null===(t=this.activeNode)||void 0===t||t.update($.status)}setNavigationOption(e,t=!1){if(this.isGrid()||e===z.row)switch(this.options.navigationModeOption=e,e){case z.cell:this.setCellNav(!0);break;case z.row:this.setCellNav(!1);break;case z.startCell:t&&this.setCellNav(!0);break;case z.startRow:t&&this.setCellNav(!1);break;default:v(`Invalid mode '${e}'.`)}else this.logWarn("Plain trees only support row navigation mode.")}setStatus(e,t){return this.root.setStatus(e,t)}setTypes(e,t=!0){f(T(e),`Expected plain objext: ${e}`),t?this.types=e:N(this.types,e);for(const e of Object.values(this.types))e.classes&&(e.classes=O(e.classes))}sortChildren(e=te,t=!1){this.root.sortChildren(e,t)}toDictArray(e){var t;return null!==(t=this.root.toDict(!0,e).children)&&void 0!==t?t:[]}_updateColumnWidths(){const e=this.element.clientWidth,t=this.columns,i=t[0];let s=0,n=0,r=0,o=!1;if("*"!==i.id)throw new Error(`First column must have id '*': got '${i.id}'.`);this._columnsById={};for(const e of t){this._columnsById[e.id]=e;const t=e.width;if("*"===e.id&&e!==i)throw new Error(`Column id '*' must be defined only once: '${e.title}'.`);if(t&&"*"!==t)if("number"==typeof t)e._weight=t,n+=t;else if("string"==typeof t&&t.endsWith("px")){e._weight=0;const i=parseFloat(t.slice(0,-2));e._widthPx!=i&&(o=!0,e._widthPx=i),r+=i}else v(`Invalid column width: ${t} (expected string ending with 'px' or number, e.g. "px" or ).`);else e._weight=1,n+=1}const l=Math.max(0,e-r);let a=0;for(const e of t){let t;if(e._weight){const i=e.minWidth;t="number"==typeof i?i:"string"==typeof i&&i.endsWith("px")?parseFloat(i.slice(0,-2)):4;const s=Math.max(t,l*e._weight/n);e._widthPx!=s&&(o=!0,e._widthPx=s)}e._ofsPx=a,a+=e._widthPx}t[t.length-1]._widthPx-=1,s=a-1;const d=`${s}px`;return this.headerElement.style.width=d,this.listContainerElement.style.width=d,o}_renderHeaderMarkup(){f(this.headerElement,"Expected a headerElement");const e=this.hasHeader();if(E(this.headerElement,e),!e)return;const t=this.columns.length,i=this.headerElement.querySelector(".wb-row");f(i,"Expected a row in header element"),i.innerHTML="".repeat(t);for(let e=0;e${r}${l}`,this.isCellNav()&&n.classList.toggle("wb-active",e===this.activeColIdx)}}updatePendingModifications(){this.pendingChangeTypes.size>0&&this._updateViewportImmediately()}_updateViewportImmediately(){var e;if(this._disableUpdateCount)return this.log(`_updateViewportImmediately() IGNORED (disable level: ${this._disableUpdateCount}).`),void this._disableUpdateIgnoreCount++;this._updateViewportThrottled.pending()&&this._updateViewportThrottled.cancel();const t=P,i=new Set(this.pendingChangeTypes);this.pendingChangeTypes.clear();if(i.has(t.scroll)&&1===i.size)this._updateRows({newNodesOnly:!0});else{if(this.log("_updateViewportImmediately():",i),!1!==this.options.adjustHeight){let e=this.listContainerElement.clientHeight;const t=this.headerElement.clientHeight,i=this.element.clientHeight-t-1;Math.abs(e-i)>1&&(this.listContainerElement.style.height=i+"px",e=i)}i.has(t.clearMarkup)&&this.visit((e=>{e.removeMarkup()})),i.has(t.header)&&(this._updateColumnWidths(),this._renderHeaderMarkup()),this._updateRows()}if(this.options.connectTopBreadcrumb){let t=null===(e=this.getTopmostVpNode(!0))||void 0===e?void 0:e.getPath(!1,"title"," > ");t=t?t+" >":"",this.options.connectTopBreadcrumb.textContent=t}this._callEvent("update")}_updateRows(e){const t=!!(e=Object.assign({newNodesOnly:!1},e)).newNodesOnly,i=this.element.clientHeight,s=this.element.scrollTop;let n=Math.max(0,s/22-5);n=Math.floor(n),n%2&&n--;let r=Math.max(0,(s+i)/22+5);r=Math.ceil(r);const o=new Set;this.nodeListElement.childNodes.forEach((e=>{const t=e;o.add(t._wb_node)}));let l=0,a=0,d=!1,c="first";this.visitRows((function(e){const i=e._rowElem;e._rowIdx!==l&&(e._rowIdx=l,d=!0),lr?i&&(c=i):i&&t?(o.delete(e),i.style.top=l*Q+"px",c=i):(o.delete(e),i&&(i.style.top=l*Q+"px"),e._render({top:a,after:c}),c=e._rowElem),l++,a+=22})),this.treeRowCount=l;for(const e of o)e._callEvent("discard"),e.removeMarkup();return this.nodeListElement.style.height=`${a}px`,d}visit(e){return this.root.visit(e,!1)}visitRows(e,t){if(!this.root.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);let i,s,n,r,o,l,a=0,d=!1===(t=t||{}).includeSelf,c=t.start||this.root.children[0];const h=!!t.includeHidden,u=!h&&"hide"===this.filterMode;for(n=c.parent;n;){for(o=n.children,s=o.indexOf(c)+a,f(s>=0,`Could not find ${c} in parent's children: ${n}`),i=s;it!==l&&(!u||t.match||t.subMatchCount?!1!==e(t)&&(h||!t.children||t.expanded?void 0:"skip"):"skip")),!1),!1===r))return!1}}c=n,n=n.parent,a=1,!n&&t.wrap&&(this.logDebug("visitRows(): wrap around"),f(t.start,"`wrap` option requires `start`"),l=t.start,t.wrap=!1,n=this.root,a=0)}return!0}_visitRowsUp(e,t){let i,s,n,r=t.start||this.root.children[0];const o=!!t.includeHidden;if(!1!==t.includeSelf&&!1===e(r))return!1;for(;;){if(n=r.parent,i=n.children,i[0]===r){if(r=n,!r.parent)break;i=n.children}else for(s=i.indexOf(r),r=i[s-1];(o||r.expanded)&&r.children&&r.children.length;)i=r.children,n=r,r=i[i.length-1];if((o||r.isVisible())&&!1===e(r))return!1}return!0}load(e){return this.clear(),this.root.load(e)}enableUpdate(e){e?(f(this._disableUpdateCount>0,"enableUpdate(true) was called too often"),this._disableUpdateCount--,0===this._disableUpdateCount&&(this.logDebug(`enableUpdate(): active again. Re-painting to catch up with ${this._disableUpdateIgnoreCount} ignored update requests...`),this._disableUpdateIgnoreCount=0,this.update($.any,{immediate:!0}))):this._disableUpdateCount++}filterNodes(e,t){return this.extensions.filter.filterNodes(e,t)}filterBranches(e,t){return this.extensions.filter.filterBranches(e,t)}clearFilter(){return this.extensions.filter.clearFilter()}isFilterActive(){return!!this.filterMode}updateFilter(){return this.extensions.filter.updateFilter()}}pe.sequence=0,pe.version="v0.8.0",pe.util=U,e.Wunderbaum=pe})); //# sourceMappingURL=wunderbaum.umd.min.js.map \ No newline at end of file diff --git a/dist/wunderbaum.umd.min.js.map b/dist/wunderbaum.umd.min.js.map index 08270245..96e2714e 100644 --- a/dist/wunderbaum.umd.min.js.map +++ b/dist/wunderbaum.umd.min.js.map @@ -1 +1 @@ -{"version":3,"file":"wunderbaum.umd.js","names":["global","factory","exports","module","define","amd","globalThis","self","mar10","this","MOUSE_BUTTONS","isMac","nav","navigator","test","platform","_getUserInfo","REX_HTML","REX_TOOLTIP","ENTITY_MAP","assert","cond","msg","Error","documentReady","callback","document","readyState","addEventListener","error","escapeHtml","s","replace","escapeRegex","escapeTooltip","getValueFromElem","elem","coerce","tag","tagName","value","classList","contains","span","embeddedInput","querySelector","innerText","input","type","indeterminate","checked","valueAsDate","valueAsNumber","name","parentElement","undefined","setElemDisplay","flag","style","elemFromSelector","display","elemFromHtml","html","t","createElement","innerHTML","trim","content","firstElementChild","_IGNORE_KEYS","Set","obj","eventTargetFromSelector","eventToString","event","key","et","altKey","push","ctrlKey","metaKey","shiftKey","button","has","join","extend","args","i","length","arg","Object","prototype","hasOwnProperty","call","isArray","Array","isEmptyObject","keys","constructor","isPlainObject","toString","onEvent","rootTarget","eventNames","selectorOrHandler","handlerOrNone","selector","handler","split","forEach","evn","e","target","matches","closest","overrideMethod","instance","methodName","ctx","prevSuper","prevSuperApply","prevFunc","_super","apply","_superApply","argsArray","getOption","opts","defaultValue","ext","indexOf","toSet","val","set","c","add","adaptiveThrottle","options","waiting","pendingArgs","assign","minDelay","defaultDelay","maxDelay","delayFactor","Math","max","throttledFn","useArgs","start","Date","now","console","elap","curDelay","min","useDelay","setTimeout","ChangeType","RenderFlag","NodeStatusType","NodeRegion","NavModeEnum","util","freeze","__proto__","Deferred","thens","catches","status","resolve","resolvedValue","reject","rejectedError","then","cb","unshift","promise","catch","MAX_INT","documentReadyPromise","Promise","each","k","extractHtmlText","isFunction","noop","setTimeoutPromise","ms","err","setValueToElem","select","selectedIndex","sleep","async","toggleCheckbox","element","tristate","toLowerCase","WunderbaumExtension","tree","id","defaults","enabled","treeOpts","extensionOpts","getPluginOption","init","_a","setPluginOption","setEnabled","onKeyEvent","data","onRender","freeGlobal","freeGlobalThis","freeSelf","root","Function","isObject","debounce","func","wait","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","useRAF","requestAnimationFrame","TypeError","invokeFunc","time","thisArg","startTimer","pendingFunc","cancelAnimationFrame","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeSinceLastInvoke","timeWaiting","remainingWait","debounced","isInvoking","leadingEdge","cancel","clearTimeout","cancelTimer","flush","pending","START_MARKER","END_MARKER","RE_START_MARKER","RegExp","RE_END_MARTKER","FilterExtension","super","connectInput","autoApply","autoExpand","counter","fuzzy","hideExpandedCounter","hideExpanders","highlight","leavesOnly","mode","noData","lastFilterArgs","queryInput","filterNodes","filterMode","updateFilter","_applyFilterNoUpdate","filter","branchMode","_opts","runWithDeferredUpdate","_applyFilterImpl","match","temp","count","prevAutoCollapse","autoCollapse","hideMode","logInfo","clearFilter","map","reduce","a","b","re","reHighlight","node","title","text","res","escapeTitles","matchingIndices","_matchingArrIdx","_mIdx","textPoses","v","_markFuzzyMatchedChars","titleWithHighlight","arguments","toggle","subMatchCount","visit","setStatus","ok","children","matchedByBranch","parent","visitParents","p","expanded","setExpanded","noAnimation","noEvents","_filterAutoExpanded","filterBranches","logWarn","enableUpdate","remove","KeynavExtension","_getEmbeddedInputElem","ace","getActiveColElem","_isCurInputFocused","activate","autoActivate","curInput","inputHasFocus","navModeOption","navigationModeOption","focusNode","eventName","handled","isEnabled","_callEvent","_callMethod","currentNode","getFocusNode","getActiveNode","firstNode","getFirstChild","setActive","setFocus","isColspan","isRowNav","blur","_render","quicksearch","stamp","lastQuicksearchTime","lastQuicksearchTerm","matchNode","findNextNode","preventDefault","isActive","isExpanded","isExpandable","startCell","startRow","setCellNav","toggleSelected","navigate","curInputType","inputCanFocus","logDebug","setColumn","activeColIdx","focus","click","log","isCellNav","cell","columns","LoggerExtension","ignoreEvents","prefix","extra","ROW_HEIGHT","TEST_IMG","iconMaps","bootstrap","loading","expanderExpanded","expanderCollapsed","expanderLazy","checkChecked","checkUnchecked","checkUnknown","radioChecked","radioUnchecked","radioUnknown","folder","folderOpen","folderLazy","doc","fontawesome6","RESERVED_TREE_SOURCE_KEYS","KEY_TO_ACTION_DICT","Add","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Divide","End","Home","Multiply","PageDown","PageUp","Subtract","makeNodeTitleMatcher","nodeTitleSorter","x","y","decompressSourceData","source","_format","_version","_keyMap","_valueMap","longToShort","shortToLong","entries","warn","_typeList","_b","_c","_positional","includes","positionalShort","newChildren","keyToNodeMap","indexToNodeMap","keyAttrName","childrenAttrName","index","nodeTuple","parentId","kwargs","positionalIdx","parentNode","unflattenSource","_iter","childList","getOwnPropertyNames","propName","longName","newValue","nodeMimeType","DndExtension","autoExpandMS","multiSource","effectAllowed","dropEffectDefault","guessDropEffect","preventForeignNodes","preventLazyParents","preventNonNodes","preventRecursion","preventSameParent","preventVoidMoves","serializeClipboardData","scroll","scrollSensitivity","scrollSpeed","sourceCopyHook","dragStart","drag","dragEnd","dragEnter","dragOver","dragExpand","drop","dragLeave","srcNode","lastTargetNode","lastEnterStamp","lastAllowedDropRegions","lastDropEffect","lastDropRegion","currentScrollDir","applyScrollDirThrottled","throttle","_applyScrollDir","dndOpts","dnd","onDragEvent","bind","onDropEvent","_leaveNode","ltn","setClass","unifyDragover","size","_calcDropRegion","allowed","dy","offsetY","_guessDropEffect","ea","canCopy","canLink","canMove","_isVoidDrop","targetNode","dropRegion","getNextSibling","getPrevSibling","isDragging","sp","scrollTop","_autoScroll","viewportY","sensitivity","headerHeight","headerElement","clientHeight","height","offsetHeight","scrollHeight","Wunderbaum","getNode","dataTransfer","isEditing","nodeData","toDict","n","_orgKey","_treeId","setData","JSON","stringify","types","srcTree","dt","dropEffect","isStatusNode","isLoaded","isAncestorOf","regionSet","clientY","offsetTop","region","_isLoading","stopPropagation","getData","parse","suggestedDropMode","suggestedDropEffect","sourceNode","sourceNodeData","DragObserver","dragElem","dragging","events","thresh","_handler","handleEvent","disconnect","removeEventListener","getDragElem","stopDrag","cb_event","dragstop","dx","pageX","pageY","dragstart","GridExtension","observer","window","handleDrag","info","getEventInfo","_promise","_resolve","_reject","reason","finally","NODE_PROPS","NODE_DICT_PROPS","delete","WunderbaumNode","refKey","classes","_requestId","_errorInfo","_partsel","_partload","_rowIdx","_rowElem","sequence","icon","lazy","statusNodeType","colspan","checkbox","radiogroup","selected","unselectable","_registerNode","Symbol","iterator","cl","l","typeInfo","addChildren","before","applyMinExpanLevel","_level","getLevel","nodeList","forceExpand","minExpandLevel","child","subChildren","isUnloaded","concat","findDirectChild","pos","splice","update","structure","addNode","applyCommand","cmd","collapseSiblings","className","cnSet","cn","expandAll","depth","loadLazy","force","keepActiveNodeVisible","expandOpts","scrollIntoView","logTime","level","level_1","promises","all","logTimeEnd","activeNode","findAll","matcher","ptr","findFirst","findRelatedNode","where","includeHidden","format_iter","name_cb","connectors","_is_last","ca","_format_line","parts","format","line","getColElem","colIdx","findIndex","colElems","querySelectorAll","getLastChild","ac","idx","getParent","getParentList","includeRoot","includeSelf","dtn","getPath","part","separator","path","isFunc","hasChildren","hasClass","other","isDescendantOf","isChildOf","andCollapsed","emptyChildListExpandable","isFirstSibling","isLastSibling","isLazy","isLoading","isPagingNode","isParentOf","isPartload","isPartsel","isRadio","isRendered","isRootNode","isSelected","isTopLevel","isVisible","hasFilter","parents","_loadSourceObject","response","setTypes","colStructure","selectMode","fixSelection3FromEndNodes","_fetchWithOptions","url","params","body","rest","fetchOpts","method","URLSearchParams","fetch","json","load","requestId","prevParent","elapLoad","elapProcess","startProcess","logError","message","debugLevel","forceReload","wasExpanded","resetLazy","makeVisible","dfd","deferreds","len","seOpts","updatePendingModifications","moveTo","targetParent","triggerModifyChild","any","triggerModify","removeMarkup","_unregisterNode","removeChildren","_wb_node","_getRenderInfo","allColInfosById","renderColInfosById","col","_createIcon","iconMap","parentElem","replaceChild","showLoading","iconSpan","appendChild","cbRes","badge","tooltip","badgeClass","badgeTooltip","append","_render_markup","treeOptions","rowDiv","checkboxSpan","expanderSpan","isNew","after","top","nodeElem","ofsTitlePx","titleSpan","_ofsTitlePx","draggable","colElem","left","_ofsPx","width","_widthPx","nodeListElement","prepend","_render_data","preventScroll","textContent","skeleton","vpWidth","clientWidth","isDataChange","_render_status","renderInfo","rowClasses","image","backgroundImage","cbclass","colSpan","resizeCols","ofs","colDef","change","row","recursive","dict","scrollTo","prev","retrigger","focusTree","orgEvent","nextNode","prevNode","immediate","updateOpts","lastChild","topNode","setIcon","setKey","getSelectedNodes","stopOnParents","_anySelectable","setSelected","found","_changeSelectStatusProps","state","changed","fixSelection3AfterClick","_walk","allSelected","someSelected","sendEvents","canSelect","propagateDown","sibling","details","statusNode","_setStatusNode","firstChild","_clearStatusNode","strings","loadError","setTitle","_sortChildren","cmp","deep","sort","sortChildren","operation","modifyChild","visitSiblings","isMatched","EditExtension","minlength","maxlength","trigger","slowClickDelay","validity","beforeEdit","edit","curEditNode","relatedNode","debouncedOnChange","_onChange","_applyChange","inputElem","inputValue","_preprocessKeyEvent","isEditingTitle","_stopEditTitle","startEditTitle","inputHtml","setCustomValidity","reportValidity","stopEditTitle","focusElem","activeElement","forceClose","errMsg","validationMessage","oldValue","createNode","newNode","WbSystemRoot","extensionList","extensions","keyMap","Map","refKeyMap","treeRowCount","_disableUpdateCount","_disableUpdateIgnoreCount","_columnsById","pendingChangeTypes","_util","_cellNavMode","lastClickTime","header","rowHeightPx","fixedCol","showSpinner","connectTopBreadcrumb","iconBadge","receive","readyDeferred","ready","readyOk","_registerExtension","_updateViewportThrottled","_updateViewportImmediately","getAttribute","tabIndex","_wb_tree","wantHeader","rowElement","colDiv","dataset","coldivs","repeat","listContainerElement","_initExtensions","optName","setOption","isGrid","setNavigationOption","resizeObserver","ResizeObserver","resize","observe","mouseEvent","expander","scrollIntoViewOnExpandClick","_callHook","getTree","el","treeElem","Element","extension","rk","rks","get","hook","d","_getNodeByRowIdx","visitRows","getTopmostVpNode","complete","topIdx","ceil","floor","getLowestVpNode","scrollParent","bottomIdx","_getPrevNodeInView","reverse","_getNextNodeInView","nodeOrOpts","refNode","clear","destroy","outerHTML","hasFocus","hasHeader","hint","selectAll","toggleSelect","_selectRange","eventInfo","visible","_check","findKey","startNode","reMatch","makeNodeTitleStartMatcher","_checkNode","pageSize","bottomNode","parentCol","canonicalName","unknown","colId","column","KeyboardEvent","label","timeEnd","vpHeight","rowTop","vpTop","vpRowTop","vpRowBottom","newScrollTop","scrollToHorz","fixedWidth","scrollLeft","colLeft","Number","parseInt","colRight","newLeft","setActiveNode","RF","clearMarkup","redraw","reset","values","toDictArray","_updateColumnWidths","col0","totalWidth","totalWeight","modified","cw","_weight","endsWith","px","parseFloat","slice","restPx","ofsPx","minWidth","cmw","tw","_renderHeaderMarkup","colCount","headerRow","headerClasses","resizer","_updateRows","newNodesOnly","adjustHeight","wantHeight","abs","vp_height","startIdx","endIdx","obsoleteNodes","childNodes","tr","prevElem","_visitRowsUp","nextIdx","siblings","stopNode","siblingOfs","skipFirstNode","checkFilter","wrap","isFilterActive","version"],"sources":["wunderbaum.umd.js"],"mappings":"CAAA,SAAWA,EAAQC,GACE,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,SACrD,mBAAXE,QAAyBA,OAAOC,IAAMD,OAAO,CAAC,WAAYH,GACUA,GAA1ED,EAA+B,oBAAfM,WAA6BA,WAAaN,GAAUO,MAAqBC,MAAQ,CAAC,EACpG,CAJD,CAIGC,MAAM,SAAWP,GAAW;;;;;KAS7B,MAAMQ,EAAgB,CAClB,EAAG,GACH,EAAG,OACH,EAAG,SACH,EAAG,QACH,EAAG,OACH,EAAG,WAKDC,EAoEN,WACI,MAAMC,EAAMC,UAKZ,MAHY,CACRF,MAAO,MAAMG,KAAKF,EAAIG,UAG9B,CA7EiBC,GAEML,MACjBM,EAAW,YACXC,EAAc,WACdC,EAAa,CACf,IAAK,QACL,IAAK,OACL,IAAK,OACL,IAAK,SACL,IAAK,QACL,IAAK,UAqDT,SAASC,EAAOC,EAAMC,GAClB,IAAKD,EAED,MADAC,EAAMA,GAAO,oBACP,IAAIC,MAAMD,EAExB,CAUA,SAASE,EAAcC,GACS,YAAxBC,SAASC,WACTD,SAASE,iBAAiB,mBAAoBH,GAG9CA,GAER,CAuCA,SAASI,EAAMP,GACX,MAAM,IAAIC,MAAMD,EACpB,CAEA,SAASQ,EAAWC,GA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,EAAKkB,UACLlB,EAAKkB,SAAStO,QACdsO,EAAWlB,EAAKkB,SAChBE,EAASpB,EACTA,EAAOkB,EAASA,EAAStO,OAAS,GAI1C,IAAKgkB,GAAkB5W,EAAK4Z,eAGL,IAAnB/qB,EAASmR,GACT,OAAO,CAEf,CACA,OAAO,CACX,CAOA,IAAA+a,CAAK9S,GAED,OADApa,KAAK+7B,QACE/7B,KAAKgN,KAAKkgB,KAAK9S,EAC1B,CAgBA,YAAAnG,CAAajR,GAOLA,GACArC,EAAOX,KAAK23B,oBAAsB,EAAG,2CACrC33B,KAAK23B,sBAI4B,IAA7B33B,KAAK23B,sBACL33B,KAAKgX,SAAS,8DAA8DhX,KAAK43B,wDACjF53B,KAAK43B,0BAA4B,EACjC53B,KAAKknB,OAAO7d,EAAWklB,IAAK,CAAEuE,WAAW,MAI7C9yB,KAAK23B,qBAOb,CAOA,WAAA/mB,CAAYI,EAAQhJ,GAChB,OAAOhI,KAAKs3B,WAAWtmB,OAAOJ,YAAYI,EAAQhJ,EACtD,CAIA,cAAA+L,CAAe/C,EAAQhJ,GACnB,OAAOhI,KAAKs3B,WAAWtmB,OAAO+C,eAAe/C,EAAQhJ,EACzD,CAMA,WAAA4J,GACI,OAAO5R,KAAKs3B,WAAWtmB,OAAOY,aAClC,CAMA,cAAA4vB,GACI,QAASxhC,KAAK6Q,UAClB,CAMA,YAAAC,GACI,OAAO9Q,KAAKs3B,WAAWtmB,OAAOF,cAClC,EAEJ+P,GAAWuE,SAAW,EAEtBvE,GAAW4gB,QAAU,SAErB5gB,GAAWnX,KAAOA,EAElBjK,EAAQohB,WAAaA,EAEtB"} \ No newline at end of file +{"version":3,"file":"wunderbaum.umd.js","names":["global","factory","exports","module","define","amd","globalThis","self","mar10","this","freeGlobal","Object","freeGlobalThis","freeSelf","root","Function","isObject","value","type","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","useRAF","requestAnimationFrame","TypeError","invokeFunc","time","args","thisArg","undefined","apply","startTimer","pendingFunc","cancelAnimationFrame","setTimeout","shouldInvoke","timeSinceLastCall","timerExpired","Date","now","trailingEdge","timeSinceLastInvoke","timeWaiting","Math","min","remainingWait","debounced","isInvoking","leadingEdge","max","cancel","id","clearTimeout","cancelTimer","flush","pending","throttle","MOUSE_BUTTONS","isMac","nav","navigator","test","platform","_getUserInfo","REX_HTML","REX_TOOLTIP","ENTITY_MAP","ValidationError","Error","constructor","message","super","name","assert","cond","msg","documentReady","callback","document","readyState","addEventListener","error","escapeHtml","s","replace","escapeRegex","escapeTooltip","getValueFromElem","elem","coerce","tag","tagName","classList","contains","span","embeddedInput","querySelector","innerText","input","indeterminate","checked","valueAsDate","valueAsNumber","parentElement","setElemDisplay","flag","style","elemFromSelector","display","elemFromHtml","html","t","createElement","innerHTML","trim","content","firstElementChild","_IGNORE_KEYS","Set","obj","eventToString","event","key","et","altKey","push","ctrlKey","metaKey","shiftKey","button","has","join","extend","i","length","arg","prototype","hasOwnProperty","call","isArray","Array","isEmptyObject","keys","isPlainObject","toString","onEvent","rootTarget","eventNames","selectorOrHandler","handlerOrNone","selector","handler","split","forEach","evn","e","target","matches","closest","overrideMethod","instance","methodName","ctx","prevSuper","prevSuperApply","prevFunc","_super","_superApply","argsArray","getOption","opts","defaultValue","ext","indexOf","toSet","val","set","c","add","adaptiveThrottle","assign","minDelay","defaultDelay","maxDelay","delayFactor","waiting","pendingArgs","pendingTimer","throttledFn","useArgs","start","console","elap","curDelay","useDelay","ChangeType","RenderFlag","NodeStatusType","NodeRegion","NavModeEnum","util","freeze","__proto__","Deferred","thens","catches","status","resolve","resolvedValue","reject","rejectedError","then","cb","unshift","promise","catch","MAX_INT","documentReadyPromise","Promise","each","k","extractHtmlText","isFunction","noop","setTimeoutPromise","ms","err","setValueToElem","select","selectedIndex","sleep","async","toggleCheckbox","element","tristate","toLowerCase","WunderbaumExtension","tree","defaults","enabled","treeOpts","extensionOpts","getPluginOption","init","_a","setPluginOption","setEnabled","onKeyEvent","data","onRender","START_MARKER","END_MARKER","RE_START_MARKER","RegExp","RE_END_MARTKER","FilterExtension","connectInput","autoApply","autoExpand","counter","fuzzy","hideExpandedCounter","hideExpanders","highlight","leavesOnly","mode","noData","lastFilterArgs","queryInput","filterNodes","filterMode","updateFilter","_applyFilterNoUpdate","filter","branchMode","_opts","runWithDeferredUpdate","_applyFilterImpl","match","temp","count","prevAutoCollapse","autoCollapse","hideMode","logInfo","clearFilter","map","reduce","a","b","re","reHighlight","node","title","text","res","escapeTitles","matchingIndices","_matchingArrIdx","_mIdx","textPoses","v","_markFuzzyMatchedChars","titleWithHighlight","arguments","toggle","subMatchCount","visit","setStatus","ok","children","matchedByBranch","parent","visitParents","p","expanded","setExpanded","noAnimation","noEvents","_filterAutoExpanded","filterBranches","logWarn","enableUpdate","remove","KeynavExtension","_getEmbeddedInputElem","ace","getActiveColElem","_isCurInputFocused","activate","autoActivate","curInput","inputHasFocus","navModeOption","navigationModeOption","focusNode","eventName","handled","isEnabled","_callEvent","_callMethod","currentNode","getFocusNode","getActiveNode","firstNode","getFirstChild","setActive","setFocus","isColspan","isRowNav","blur","_render","quicksearch","stamp","lastQuicksearchTime","lastQuicksearchTerm","matchNode","findNextNode","preventDefault","isActive","isExpanded","isExpandable","startCell","startRow","setCellNav","toggleSelected","navigate","curInputType","inputCanFocus","logDebug","setCustomValidity","setColumn","activeColIdx","checkValidity","focus","click","log","isCellNav","cell","columns","LoggerExtension","ignoreEvents","prefix","extra","ROW_HEIGHT","TEST_IMG","iconMaps","bootstrap","loading","expanderExpanded","expanderCollapsed","expanderLazy","checkChecked","checkUnchecked","checkUnknown","radioChecked","radioUnchecked","radioUnknown","folder","folderOpen","folderLazy","doc","fontawesome6","RESERVED_TREE_SOURCE_KEYS","KEY_TO_ACTION_DICT","Add","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Divide","End","Home","Multiply","PageDown","PageUp","Subtract","makeNodeTitleMatcher","nodeTitleSorter","x","y","decompressSourceData","source","_format","_version","_keyMap","_valueMap","longToShort","shortToLong","entries","warn","_typeList","_b","_c","_positional","includes","positionalShort","newChildren","keyToNodeMap","indexToNodeMap","keyAttrName","childrenAttrName","index","nodeTuple","parentId","kwargs","positionalIdx","parentNode","unflattenSource","_iter","childList","getOwnPropertyNames","propName","longName","newValue","nodeMimeType","DndExtension","autoExpandMS","multiSource","effectAllowed","dropEffectDefault","guessDropEffect","preventForeignNodes","preventLazyParents","preventNonNodes","preventRecursion","preventSameParent","preventVoidMoves","serializeClipboardData","scroll","scrollSensitivity","scrollSpeed","sourceCopyHook","dragStart","drag","dragEnd","dragEnter","dragOver","dragExpand","drop","dragLeave","srcNode","lastTargetNode","lastEnterStamp","lastAllowedDropRegions","lastDropEffect","lastDropRegion","currentScrollDir","applyScrollDirThrottled","_applyScrollDir","dndOpts","dnd","onDragEvent","bind","onDropEvent","_leaveNode","ltn","setClass","unifyDragover","size","_calcDropRegion","allowed","dy","offsetY","_guessDropEffect","ea","canCopy","canLink","canMove","_isVoidDrop","targetNode","dropRegion","getNextSibling","getPrevSibling","isDragging","sp","scrollTop","_autoScroll","viewportY","sensitivity","headerHeight","headerElement","clientHeight","height","offsetHeight","scrollHeight","Wunderbaum","getNode","dataTransfer","isEditingTitle","nodeData","toDict","n","_orgKey","_treeId","setData","JSON","stringify","types","srcTree","dt","dropEffect","isStatusNode","isLoaded","isAncestorOf","regionSet","clientY","offsetTop","region","_isLoading","stopPropagation","getData","parse","suggestedDropMode","suggestedDropEffect","sourceNode","sourceNodeData","DragObserver","dragElem","dragging","events","thresh","_handler","handleEvent","disconnect","removeEventListener","getDragElem","stopDrag","cb_event","dragstop","dx","pageX","pageY","dragstart","GridExtension","observer","window","handleDrag","info","getEventInfo","_promise","_resolve","_reject","reason","finally","NODE_PROPS","NODE_DICT_PROPS","delete","WunderbaumNode","refKey","classes","_requestId","_errorInfo","_partsel","_partload","_rowIdx","_rowElem","sequence","icon","lazy","statusNodeType","colspan","checkbox","radiogroup","selected","unselectable","_registerNode","Symbol","iterator","cl","l","typeInfo","addChildren","before","applyMinExpanLevel","_level","getLevel","nodeList","forceExpand","minExpandLevel","child","subChildren","isUnloaded","concat","findDirectChild","pos","splice","update","structure","addNode","applyCommand","cmd","collapseSiblings","className","cnSet","cn","startEditTitle","expandAll","depth","loadLazy","force","keepActiveNodeVisible","expandOpts","scrollIntoView","logTime","level","level_1","promises","all","logTimeEnd","activeNode","findAll","matcher","ptr","findFirst","findRelatedNode","where","includeHidden","format_iter","name_cb","connectors","_is_last","ca","_format_line","parts","format","line","getColElem","colIdx","findIndex","colElems","querySelectorAll","getCloneList","includeSelf","clones","findByRefKey","getLastChild","ac","idx","getParent","getParentList","includeRoot","dtn","getPath","part","separator","path","isFunc","hasChildren","hasClass","other","isDescendantOf","isChildOf","isClone","andCollapsed","emptyChildListExpandable","isFirstSibling","isLastSibling","isLazy","isLoading","isPagingNode","isParentOf","isPartload","isPartsel","isRadio","isRendered","isRootNode","isSelected","isTopLevel","isVisible","hasFilter","parents","_loadSourceObject","response","setTypes","colStructure","selectMode","fixSelection3FromEndNodes","_fetchWithOptions","url","params","body","rest","fetchOpts","method","URLSearchParams","fetch","json","load","requestId","prevParent","elapLoad","elapProcess","startProcess","logError","debugLevel","forceReload","wasExpanded","resetLazy","makeVisible","dfd","deferreds","len","seOpts","updatePendingModifications","moveTo","targetParent","triggerModifyChild","any","triggerModify","removeMarkup","_unregisterNode","removeChildren","_wb_node","_getRenderInfo","allColInfosById","renderColInfosById","col","_createIcon","iconMap","parentElem","replaceChild","showLoading","iconSpan","appendChild","cbRes","badge","tooltip","badgeClass","badgeTooltip","append","_render_markup","treeOptions","rowDiv","checkboxSpan","expanderSpan","isNew","after","top","nodeElem","ofsTitlePx","titleSpan","_ofsTitlePx","draggable","colElem","left","_ofsPx","width","_widthPx","nodeListElement","prepend","_render_data","preventScroll","textContent","skeleton","vpWidth","clientWidth","isDataChange","_render_status","renderInfo","rowClasses","image","backgroundImage","cbclass","colSpan","resizeCols","ofs","colDef","change","row","recursive","dict","scrollTo","prev","retrigger","focusTree","orgEvent","edit","nextNode","prevNode","immediate","sendEvents","updateOpts","lastChild","topNode","setIcon","setKey","getSelectedNodes","stopOnParents","_anySelectable","setSelected","found","_changeSelectStatusProps","state","changed","fixSelection3AfterClick","_walk","allSelected","someSelected","canSelect","propagateDown","sibling","details","statusNode","_setStatusNode","firstChild","_clearStatusNode","strings","loadError","setTitle","_sortChildren","cmp","deep","sort","sortChildren","operation","modifyChild","visitSiblings","isMatched","EditExtension","minlength","maxlength","trigger","slowClickDelay","validity","beforeEdit","curEditNode","relatedNode","debouncedOnChange","_onChange","_applyChange","inputElem","validationMessage","reportValidity","inputValue","inputValid","_preprocessKeyEvent","_stopEditTitle","inputHtml","opt","stopEditTitle","focusElem","activeElement","forceClose","errMsg","oldValue","createNode","newNode","WbSystemRoot","extensionList","extensions","keyMap","Map","refKeyMap","treeRowCount","_disableUpdateCount","_disableUpdateIgnoreCount","_columnsById","pendingChangeTypes","_util","_cellNavMode","lastClickTime","header","rowHeightPx","fixedCol","showSpinner","connectTopBreadcrumb","iconBadge","receive","readyDeferred","ready","readyOk","_registerExtension","_updateViewportThrottled","_updateViewportImmediately","getAttribute","tabIndex","_wb_tree","wantHeader","rowElement","colDiv","dataset","coldivs","repeat","listContainerElement","_initExtensions","optName","setOption","isGrid","setNavigationOption","resizeObserver","ResizeObserver","resize","observe","mouseEvent","expander","scrollIntoViewOnExpandClick","_callHook","getTree","el","treeElem","Element","extension","rk","rks","get","hook","d","_getNodeByRowIdx","visitRows","getTopmostVpNode","complete","topIdx","ceil","floor","getLowestVpNode","scrollParent","bottomIdx","_getPrevNodeInView","reverse","_getNextNodeInView","nodeOrOpts","refNode","clear","destroy","outerHTML","hasFocus","hasHeader","hint","selectAll","toggleSelect","_selectRange","eventInfo","visible","_check","from","findKey","startNode","reMatch","makeNodeTitleStartMatcher","_checkNode","pageSize","bottomNode","parentCol","canonicalName","unknown","colId","column","KeyboardEvent","isEditing","label","timeEnd","vpHeight","rowTop","vpTop","vpRowTop","vpRowBottom","newScrollTop","scrollToHorz","fixedWidth","scrollLeft","colLeft","Number","parseInt","colRight","newLeft","cid","setActiveNode","RF","clearMarkup","redraw","reset","values","toDictArray","_updateColumnWidths","col0","totalWidth","totalWeight","modified","cw","_weight","endsWith","px","parseFloat","slice","restPx","ofsPx","minWidth","cmw","tw","_renderHeaderMarkup","colCount","headerRow","headerClasses","resizer","_updateRows","newNodesOnly","adjustHeight","wantHeight","abs","vp_height","startIdx","endIdx","obsoleteNodes","childNodes","tr","prevElem","_visitRowsUp","nextIdx","siblings","stopNode","siblingOfs","skipFirstNode","checkFilter","wrap","isFilterActive","version"],"sources":["wunderbaum.umd.js"],"mappings":"CAAA,SAAWA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,SACrD,mBAAXE,QAAyBA,OAAOC,IAAMD,OAAO,CAAC,WAAYH,GACUA,GAA1ED,EAA+B,oBAAfM,WAA6BA,WAAaN,GAAUO,MAAqBC,MAAQ,CAAC,EACtG,CAJD,CAIGC,MAAM,SAAWP,GAAW;;;;;OAS3B,MAAMQ,EAA+B,iBAAXV,QACX,OAAXA,QACAA,OAAOW,SAAWA,QAClBX,OAEEY,EAAuC,iBAAfN,YACX,OAAfA,YACAA,WAAWK,QAAUA,QACrBL,WAEEO,EAA2B,iBAATN,MAA8B,OAATA,MAAiBA,KAAKI,SAAWA,QAAUJ,KAElFO,EAAOF,GAAkBF,GAAcG,GAAYE,SAAS,cAATA,GAwBzD,SAASC,EAASC,GACd,MAAMC,SAAcD,EACpB,OAAgB,MAATA,IAA2B,WAATC,GAA8B,aAATA,EAClD,CA8DA,SAASC,EAASC,EAAMC,EAAO,EAAGC,EAAU,CAAC,GACzC,IAAIC,EAAUC,EAAUC,EAASC,EAAQC,EAASC,EAC9CC,EAAiB,EACjBC,GAAU,EACVC,GAAS,EACTC,GAAW,EAEf,MAAMC,GAAUZ,GAAiB,IAATA,GA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A,EAAOkB,EAASiX,EAAM,IAEdrB,GAAiB9W,EAAKuB,WAC1BvB,EAAKkB,UACLlB,EAAKkB,SAAShL,QACdgL,EAAWlB,EAAKkB,SAChBE,EAASpB,EACTA,EAAOkB,EAASA,EAAShL,OAAS,GAI1C,IAAK4gB,GAAkB9W,EAAKka,eAGL,IAAnBznB,EAASuN,GACT,OAAO,CAEf,CACA,OAAO,CACX,CAOA,IAAAqb,CAAKlT,GAED,OADAza,KAAKs8B,QACEt8B,KAAKK,KAAKstB,KAAKlT,EAC1B,CAgBA,YAAArG,CAAazN,GAOLA,GACAhC,EAAO3E,KAAKk4B,oBAAsB,EAAG,2CACrCl4B,KAAKk4B,sBAI4B,IAA7Bl4B,KAAKk4B,sBACLl4B,KAAKmX,SAAS,8DAA8DnX,KAAKm4B,wDACjFn4B,KAAKm4B,0BAA4B,EACjCn4B,KAAKsnB,OAAOjb,EAAW0iB,IAAK,CAAEwE,WAAW,MAI7CvzB,KAAKk4B,qBAOb,CAOA,WAAAnnB,CAAYI,EAAQtQ,GAChB,OAAOb,KAAK63B,WAAW1mB,OAAOJ,YAAYI,EAAQtQ,EACtD,CAIA,cAAAqT,CAAe/C,EAAQtQ,GACnB,OAAOb,KAAK63B,WAAW1mB,OAAO+C,eAAe/C,EAAQtQ,EACzD,CAIA,WAAAkR,GACI,OAAO/R,KAAK63B,WAAW1mB,OAAOY,aAClC,CAIA,cAAAmwB,GACI,QAASliC,KAAKgR,UAClB,CAIA,YAAAC,GACI,OAAOjR,KAAK63B,WAAW1mB,OAAOF,cAClC,EAEJgQ,GAAWuE,SAAW,EAEtBvE,GAAWkhB,QAAU,SAErBlhB,GAAWvU,KAAOA,EAElBjN,EAAQwhB,WAAaA,EAExB"} \ No newline at end of file diff --git a/docs/api/assets/navigation.js b/docs/api/assets/navigation.js index b34f9ed8..d3c1a731 100644 --- a/docs/api/assets/navigation.js +++ b/docs/api/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4s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DHnw51YpgK5lbSO4zq5y1Qw924X8/pQCtCYGOSzQq+upRd2db6qe90GxUd4/Wj3nEAKeB+PxfXHlh0PC8tVB6u1y+b64WqnYrJ7127UTTov17HqQbf3hrSXoX9FYlW1wR1VbdIurKqjFVvV44C1asQf/wPUCgS80C4AAA==" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE5Wa0XKbOBRA/8XPnd1td9vd7Ztjk8TT2M7YOGmn02FkUGw1GDEgJ/F09t9XgAFJwL3XD3mIdXQkJCFdSXz/NVL8TY0+j0J5OMhk9G6UMrXX/x9kdIx5/nv1+297dYh14rNIotHnD+9G4V7EUcaT0efvjWLqXY83d34w9a42N3feg3fX6l5YJtjWEHZhu4w/P/z3rjHPJstF8Dib+reAsYUg0+J+4wdfvG9ryNRAgEknB4vldOyPAVMLISZ/GYwn/kw/wXQ28RGjDQPmlbeYeqtgPv4a3K+8a8+fQA3YQxPcs8UlboMG3Wtv9eBNA3/lecF6uVlNPKzTBvNA5Swfg1tvdnMLtXgLASbfW/vBbH4DeGoEssz8O133+7FupfE0+AbZHBSwilAmc5bmgK1GAEvENZtmPM/X8piFfMoUa41PxyRUQiaNsQ+37Z/+MuwH9swXMuK+UDGfMxXueQbY+3Cqfa1Ypi4swswDlJM0vMwUaHfIjvOHYVWnlBudV8/M5c+kiXmyZ8mO+5pvLTw5HmpHm27r/jEqsWAvc11nT2frlxgAYNHEiu+EudJYkiYdduj+UMd8+IlsZti14knEs+uY7fo9bfqwYxxFk3OjL9Oyk1uXSHTnPrGw6a4u7PTgx0+mOk3j00SPGJZEBHeXhuQTGR8PyZQ/iUQoq0c6ZhfFtd4LT9QseZKotSEhqfeW6ocaxzHeCi4Kaa9FrHMXgyXHxV0YUs/19PEgcqFnWVzdhSG1ftPEjimC1yFBaTEh6Uyk8dCFIXX1EuG1tThIuA4zGcezRMkHwV9xcS+PF+BLqrohQSlXY70IvBD6zUURbfUikbQWimirN4kTZp4ujKjXPOahIqodGFOX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6GiEoGNfl6O6hEirjOFGQrz7ZkFUcN20wKsr0pnkTDmjIZzp+xUBVt6Re/ACKTA4w7rtzdieNqCNiiV5AjL4acp4ceJLNAwCnycZax4XnhnA4avEOqTtUNIuAxKNBWr0CAqkZAz33MRILWyqDAT6/k8CAvEoG8sjqcG8x+TocML3p+EBGfc7WXw+PaxgBfzlUxKqYiT2Og620M9vniwOVRYQtCh4St5SD2JTjWbQzyxZwPd2KZCuRWWFSg8GhASetY0BXIzmmgk3u3i3l9OAZoTAzyWSGga+mEf85ng6/boPjKsBt1nxNIgffjsbiG2bLjYWG56qC5dtlcN2x2KibdjwmMusnerwew6kGfJxjSTobuVY1V1QbvqWqTdmFVe1qxVT0OWKtG/PE/y+JUQrEvAAA=" \ No newline at end of file diff --git a/docs/api/assets/search.js b/docs/api/assets/search.js index 7815c999..7c07b7ed 100644 --- a/docs/api/assets/search.js +++ b/docs/api/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE819bXPbOLLuf0m+ZnINAiCl/ZZNMjupM293kpm5p6a2XLRE29zIog4l2clu7X+/BEBKjWY3SFD0nvkwNY6NRj9AAw3g6Qb4rxd19bR/8Zc//vXic7ldv/hL8urFNn8oXvzlxdNxuy7qm/z48OLVi2O9aX71UK2Pm2L/f85/en1/eNg0f19t8v2+aCp68eLfr7q6RLI41fZ7v7ZWBtb2e6jiVy92eV1sDz42oO4qUSd9j0W9L6tthLKXZ5EhpUCU0388lJsY5W35aZqTK3Xu6bvi8KkuihjlZ5F59P9YrWP1tyLz6H//2Mh92N5WkSCg3DQkWpwn0Kra7g/1cXWo6hgcvtgMQ7GuqkMMgLb8DJrLdYxeW3oGrcWmeDBiEarPIjPovy/ypsT7eBRYcAYsm3J/eFttD3m5nQSJkZ8B2baZ8N83tU8A1RedAc86P+QxINry0zSnWsv0pPr6+vB1F+UwjfLXJ7EIDK8tbKYLqt2hWf/2MUDOIjOYIF8dyscidvHwpGZAcVutjvtYEFBoB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qqjtWQ3fp37pjsTR7cKGoUBhKSHmn4CRdQqG/m4DHFnYt9+T7r8wsvUv4ARD+zhOy7imbDteImRWqv4pDzluyDxH31zTovropJZen0dCZs7OQ6gaK6p4VUN2j8apLg1PdczGqe3FAde81qe5upupeyFfdg5lq2dn+6pRX1l2d7kZexiabmIb1r2jDp8q7WlX3kpUSp2HctVJ1P+jT6O2kumR01SXWaXEatNz+pXc68b7Acrp934VST59kYbf/x+3nLYoIS7h90+xp97ilP37rPd3fPct0fmSgQ8QepfoEOWSlTx87PsVQ2cCgq6j/BKOArlmwd8CdOHmUhaQzu9Q5+V2xNfc57MwuV3mvMjigWPdyrP2sbEgbSjbjtPeJSiDUGaHzm92Tp6qbICo5+ehucHejSnWZVKpbHlX3mrLKToO7K7PofuiWAd0tA7ozoe5I4IxdXZvDdbm2vde7IKJhDCBjd7G2Bkz9wyewUvbQQHx5EzpkTsoku3mmBjhPH91m/aoVJxJ2BKwmYV/xdKl21ZM/2MDUZM85J0lq6MPbtyl7Gd5WQX78ByJI2Eu7TzfXvQuV0MqC3dw2klRuGtwRJexm7Omm+5yIe3cXL4iw5xUbPX66cQ8ZMHXAl5jYE0JTh6FWmCrgN0TZKN/TzfnrKGQ9Ep4cFctTPN2YtxHsJxmZauCSyH5MwlVj/6Nrgf3CRkGbWsz0Z6qAz6ewCTJNFeRnkOC9Js0eQZ5uLLXNAICBXDa59Onm9IgRTX/BJGP2fRRQS5tXtz9u+pAgY6/YmAeurN8yOOTYad9Us+XsCwO+io1ePN2012GZSrzHyPjWGOfRu9MLKXzJLhNOmJl4ME+U5TWfbtqMM6YNXrSf92PtPXq6DrhBYzcwTzftUZmsA27TNHtifroxhzy6OyAxLlnKgLjcBVkzlt94qv1UdZV4Z1NW7Gi67Sb3bwYBw3XXWAfl+ysQvNbM3nw8V0AuRDABiU4F+vurF7tyVzRrZ1Pqj7//+9//Hz/g5fCvpQIA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE819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s/api/classes/util.Deferred.html b/docs/api/classes/util.Deferred.html index 74e9896a..f481aade 100644 --- a/docs/api/classes/util.Deferred.html +++ b/docs/api/classes/util.Deferred.html @@ -1,4 +1,4 @@ -Deferred | wunderbaum - v0.7.1-0
+Deferred | wunderbaum - v0.8.0
  • Preparing search index...
  • -
  • The search index is not available
wunderbaum - v0.7.1-0
+
  • The search index is not available
  • wunderbaum - v0.8.0
    @@ -27,7 +27,7 @@

    Hierarchy

    • Deferred
    +
  • Defined in src/util.ts:60
  • @@ -54,7 +54,7 @@
    +
  • Defined in src/util.ts:68
  • Methods

    @@ -69,7 +69,7 @@

    Parameters

    cb: any

    Returns void

    +
  • Defined in src/util.ts:95
    • @@ -104,7 +104,7 @@

      Parameters

      cb: any

    Returns void

    +
  • Defined in src/util.ts:102
    • @@ -117,7 +117,7 @@

      Parameters

      Optional error: any

    Returns void

    +
  • Defined in src/util.ts:79
    • @@ -130,7 +130,7 @@

      Parameters

      Optional value: any

    Returns void

    +
  • Defined in src/util.ts:70
    • @@ -143,7 +143,7 @@

      Parameters

      cb: any

    Returns void

    +
  • Defined in src/util.ts:88
  • @@ -29,7 +29,7 @@

    Hierarchy

    • ValidationError
    +
  • Defined in src/util.ts:47
  • @@ -66,7 +66,7 @@
    message: Returns ValidationError
    +
  • Defined in src/util.ts:48
  • Properties

    @@ -165,7 +165,7 @@

    stackTraceLimit
  • captureStackTrace
  • Returns WunderbaumNode

    +
  • Defined in src/wb_node.ts:145
  • Properties

    _errorInfo: any = null
    +
  • Defined in src/wb_node.ts:131
  • _filterAutoExpanded?: boolean
    +
  • Defined in src/wb_node.ts:140
  • _isLoading: boolean = false
    +
  • Defined in src/wb_node.ts:129
  • _partload: boolean = false
    +
  • Defined in src/wb_node.ts:133
  • _partsel: boolean = false
    +
  • Defined in src/wb_node.ts:132
  • _requestId: number = 0
    +
  • Defined in src/wb_node.ts:130
  • _rowElem: undefined | HTMLDivElement = undefined
    +
  • Defined in src/wb_node.ts:143
  • _rowIdx: undefined | number = 0
    +
  • Defined in src/wb_node.ts:142
  • checkbox?: CheckboxOption
    +
  • Defined in src/wb_node.ts:107
  • children: null | WunderbaumNode[] = null
    +
  • Defined in src/wb_node.ts:106
  • classes: null | Set<string> = null
    @@ -247,7 +250,7 @@
    +
  • Defined in src/wb_node.ts:124
  • colspan?: boolean
    @@ -255,7 +258,7 @@
    +
  • Defined in src/wb_node.ts:110
  • data: any = {}
    @@ -263,7 +266,7 @@
    +
  • Defined in src/wb_node.ts:126
  • expanded?: boolean
    @@ -273,12 +276,12 @@

    isExpandable, isExpanded, setExpanded.

    +
  • Defined in src/wb_node.ts:115
  • icon?: IconOption
    +
  • Defined in src/wb_node.ts:111
  • key: string
    @@ -288,17 +291,17 @@

    Use setKey to modify.

    +
  • Defined in src/wb_node.ts:100
  • lazy?: boolean
    +
  • Defined in src/wb_node.ts:112
  • match?: boolean
    +
  • Defined in src/wb_node.ts:135
  • @@ -306,12 +309,12 @@
    +
  • Defined in src/wb_node.ts:94
  • radiogroup?: boolean
    +
  • Defined in src/wb_node.ts:108
  • refKey: undefined | string = undefined
    @@ -322,7 +325,7 @@

    Use setKey to modify.

    +
  • Defined in src/wb_node.ts:105
  • selected?: boolean
    @@ -332,17 +335,17 @@

    isSelected, setSelected, toggleSelected.

    +
  • Defined in src/wb_node.ts:118
  • statusNodeType?: NodeStatusType
    +
  • Defined in src/wb_node.ts:128
  • subMatchCount?: number = 0
    +
  • Defined in src/wb_node.ts:136
  • title: string
    @@ -352,18 +355,18 @@
    +
  • Defined in src/wb_node.ts:97
  • titleWithHighlight?: string
    +
  • Defined in src/wb_node.ts:139
  • tooltip?: string | boolean
    +
  • Defined in src/wb_node.ts:121
  • @@ -371,22 +374,22 @@
    +
  • Defined in src/wb_node.ts:92
  • type?: string
    +
  • Defined in src/wb_node.ts:120
  • unselectable?: boolean
    +
  • Defined in src/wb_node.ts:119
  • sequence: number = 0
    +
  • Defined in src/wb_node.ts:89
  • Methods

    @@ -403,7 +406,7 @@
    +
  • Defined in src/wb_node.ts:206
  • +
  • Defined in src/wb_node.ts:2301
  • +
  • Defined in src/wb_node.ts:247
    • @@ -448,7 +451,7 @@

      Parameters

      source: any

    Returns Promise<any>

    +
  • Defined in src/wb_node.ts:1055
  • Returns void

    +
  • Defined in src/wb_node.ts:1960
  • Returns void

    +
  • Defined in src/wb_node.ts:2608
  • +
  • Defined in src/wb_node.ts:267
  • +
  • Defined in src/wb_node.ts:342
  • +
  • Defined in src/wb_node.ts:372
  • +
  • Defined in src/wb_node.ts:380
  • +
  • Defined in src/wb_node.ts:429
  • +
  • Defined in src/wb_node.ts:526
  • +
  • Defined in src/wb_node.ts:539
  • +
  • Defined in src/wb_node.ts:567
  • +
  • Defined in src/wb_node.ts:584
  • +
  • Defined in src/wb_node.ts:2348
  • +
  • Defined in src/wb_node.ts:2369
  • +
  • Defined in src/wb_node.ts:638
    • @@ -736,7 +739,28 @@
      Optional Returns IterableIterator<string>
    +
  • Defined in src/wb_node.ts:591
  • +
    + +
      @@ -752,7 +776,7 @@
      colIdx: Returns null | HTMLSpanElement
    +
  • Defined in src/wb_node.ts:649
  • +
  • Defined in src/wb_node.ts:676
  • +
  • Defined in src/wb_node.ts:683
  • +
  • Defined in src/wb_node.ts:688
  • +
  • Defined in src/wb_node.ts:700
  • +
  • Defined in src/wb_node.ts:2069
  • +
  • Defined in src/wb_node.ts:707
  • +
  • Defined in src/wb_node.ts:716
  • +
  • Defined in src/wb_node.ts:732
  • +
  • Defined in src/wb_node.ts:758
  • +
  • Defined in src/wb_node.ts:2276
  • +
  • Defined in src/wb_node.ts:767
  • +
  • Defined in src/wb_node.ts:785
  • +
  • Defined in src/wb_node.ts:790
  • +
  • Defined in src/wb_node.ts:797
  • +
  • Defined in src/wb_node.ts:804
  • +
    + +
      + +
    • +

      Return true if this node's refKey is used by at least one other node.

      +
      +

      Returns boolean

      +
    +
  • Defined in src/wb_node.ts:816
  • -
    - +
  • Defined in src/wb_node.ts:823
  • +
    +
      - +
    • -

      Return true if this node is currently in edit-title mode.

      +

      Return true if this node is currently in edit-title mode.

      +

      See Wunderbaum.startEditTitle to check if any node is currently edited.

      Returns boolean

    +
  • Defined in src/wb_node.ts:862
  • +
  • Defined in src/wb_node.ts:844
  • +
  • Defined in src/wb_node.ts:867
  • +
  • Defined in src/wb_node.ts:872
  • +
  • Defined in src/wb_node.ts:878
  • +
  • Defined in src/wb_node.ts:884
  • +
  • Defined in src/wb_node.ts:889
  • +
  • Defined in src/wb_node.ts:894
  • +
  • Defined in src/wb_node.ts:2759
  • +
  • Defined in src/wb_node.ts:899
  • +
  • Defined in src/wb_node.ts:906
  • +
  • Defined in src/wb_node.ts:911
  • +
  • Defined in src/wb_node.ts:916
  • +
  • Defined in src/wb_node.ts:921
  • +
  • Defined in src/wb_node.ts:926
  • +
  • Defined in src/wb_node.ts:933
  • +
  • Defined in src/wb_node.ts:940
  • +
  • Defined in src/wb_node.ts:947
  • +
  • Defined in src/wb_node.ts:952
  • +
  • Defined in src/wb_node.ts:959
  • +
  • Defined in src/wb_node.ts:967
  • +
  • Defined in src/wb_node.ts:1101
  • +
  • Defined in src/wb_node.ts:1185
  • +
  • Defined in src/wb_node.ts:1229
    • @@ -1334,7 +1370,7 @@

      Parameters

      Rest ...args: any[]

    Returns void

    +
  • Defined in src/wb_node.ts:1234
    • @@ -1347,7 +1383,7 @@

      Parameters

      Rest ...args: any[]

    Returns void

    +
  • Defined in src/wb_node.ts:1241
    • @@ -1360,7 +1396,7 @@

      Parameters

      Rest ...args: any[]

    Returns void

    +
  • Defined in src/wb_node.ts:1248
    • @@ -1373,7 +1409,7 @@

      Parameters

      Rest ...args: any[]

    Returns void

    +
  • Defined in src/wb_node.ts:1255
  • +
  • Defined in src/wb_node.ts:1266
  • +
  • Defined in src/wb_node.ts:1300
  • +
  • Defined in src/wb_node.ts:1414
  • +
  • Defined in src/wb_node.ts:1438
  • +
  • Defined in src/wb_node.ts:1451
  • +
  • Defined in src/wb_node.ts:1484
  • +
  • Defined in src/wb_node.ts:1986
  • +
  • Defined in src/wb_node.ts:2108
  • +
  • Defined in src/wb_node.ts:2117
  • +
  • Defined in src/wb_node.ts:396
  • +
  • Defined in src/wb_node.ts:2185
  • +
  • Defined in src/wb_node.ts:2234
  • +
  • Defined in src/wb_node.ts:2243
  • +
  • Defined in src/wb_node.ts:2249
  • +
  • Defined in src/wb_node.ts:2444
  • +
  • Defined in src/wb_node.ts:2504
  • +
  • Defined in src/wb_node.ts:2602
  • +
  • Defined in src/wb_node.ts:2630
  • +
    + +
      + +
    • +

      Start editing this node's title.

      +
      +

      Returns void

      +
    +
  • Defined in src/wb_node.ts:2005
  • +
  • Defined in src/wb_node.ts:190
  • +
  • Defined in src/wb_node.ts:2290
  • +
  • Defined in src/wb_node.ts:2666
  • +
  • Defined in src/wb_node.ts:2643
  • +
  • Defined in src/wb_node.ts:2264
  • +
  • Defined in src/wb_node.ts:2685
  • +
  • Defined in src/wb_node.ts:2715
  • +
  • Defined in src/wb_node.ts:2740
  • @@ -26,7 +26,7 @@

    Hierarchy

    • Wunderbaum
    +
  • Defined in src/wunderbaum.ts:87
  • @@ -90,6 +90,7 @@

    Methods

    filterBranches filterNodes findAll +findByRefKey findFirst findKey findNextNode @@ -108,6 +109,7 @@

    Methods

    hasHeader isCellNav isEditing +isEditingTitle isEnabled isFilterActive isGrid @@ -159,7 +161,7 @@

    Parameters

    options: WunderbaumOptions

    Returns Wunderbaum

    +
  • Defined in src/wunderbaum.ts:170
  • Properties

    @@ -167,7 +169,7 @@
    +
  • Defined in src/wunderbaum.ts:161
  • _util: util = util
    @@ -175,7 +177,7 @@
    +
  • Defined in src/wunderbaum.ts:148
  • activeColIdx: number = 0
    @@ -183,7 +185,7 @@
    +
  • Defined in src/wunderbaum.ts:159
  • activeNode: null | WunderbaumNode = null
    @@ -191,12 +193,12 @@
    +
  • Defined in src/wunderbaum.ts:123
  • +
  • Defined in src/wunderbaum.ts:131
  • columns: ColumnDefinitionList = []
    @@ -204,7 +206,7 @@
    +
  • Defined in src/wunderbaum.ts:130
  • data: {
        [key: string]: any;
    } = {}
    @@ -217,7 +219,7 @@

    Type declaration

    [key: string]: any
    +
  • Defined in src/wunderbaum.ts:107
  • element: HTMLDivElement
    @@ -225,12 +227,12 @@
    +
  • Defined in src/wunderbaum.ts:99
  • filterMode: FilterModeType = null
    +
  • Defined in src/wunderbaum.ts:155
  • focusNode: null | WunderbaumNode = null
    @@ -238,7 +240,7 @@
    +
  • Defined in src/wunderbaum.ts:125
  • headerElement: HTMLDivElement
    @@ -246,17 +248,17 @@
    +
  • Defined in src/wunderbaum.ts:101
  • +
  • Defined in src/wunderbaum.ts:132
  • iconTooltip?: DynamicStringOption
    +
  • Defined in src/wunderbaum.ts:133
  • id: string
    @@ -264,19 +266,19 @@
    +
  • Defined in src/wunderbaum.ts:97
  • lastQuicksearchTerm: string = ""
    +
  • Defined in src/wunderbaum.ts:165
  • lastQuicksearchTime: number = 0
    +
  • Defined in src/wunderbaum.ts:163
  • listContainerElement: HTMLDivElement
    @@ -284,7 +286,7 @@
    +
  • Defined in src/wunderbaum.ts:103
  • log: ((...args) => void) = ...
    @@ -307,7 +309,7 @@

    Returns voidAlias

    Wunderbaum.logDebug

    +
  • Defined in src/wunderbaum.ts:1528
  • nodeListElement: HTMLDivElement
    @@ -315,7 +317,7 @@
    +
  • Defined in src/wunderbaum.ts:105
  • @@ -323,7 +325,7 @@
    +
  • Defined in src/wunderbaum.ts:114
  • ready: Promise<any>
    @@ -331,7 +333,7 @@
    +
  • Defined in src/wunderbaum.ts:144
  • @@ -339,12 +341,12 @@
    +
  • Defined in src/wunderbaum.ts:95
  • +
  • Defined in src/wunderbaum.ts:134
  • @@ -352,12 +354,12 @@
    +
  • Defined in src/wunderbaum.ts:128
  • unselectable?: DynamicBoolOption
    +
  • Defined in src/wunderbaum.ts:135
  • util: util = util
    @@ -365,7 +367,7 @@
    +
  • Defined in src/wunderbaum.ts:146
  • version: string = "@VERSION"
    @@ -373,7 +375,7 @@
    +
  • Defined in src/wunderbaum.ts:92
  • Accessors

    @@ -389,7 +391,7 @@

    Returns { [key: string]: string

    +
  • Defined in src/wunderbaum.ts:558
  • Methods

    @@ -406,7 +408,7 @@
    +
  • Defined in src/wunderbaum.ts:599
  • +
  • Defined in src/wunderbaum.ts:707
  • +
  • Defined in src/wunderbaum.ts:688
  • +
  • Defined in src/wunderbaum.ts:1152
  • +
  • Defined in src/wunderbaum.ts:618
  • +
  • Defined in src/wunderbaum.ts:637
  • +
  • Defined in src/wunderbaum.ts:1959
  • +
  • Defined in src/wunderbaum.ts:800
  • Apply a modification (or navigation) operation on a node.

    @@ -560,7 +562,7 @@

    Returns anySee

    WunderbaumNode.applyCommand

  • +
  • Defined in src/wunderbaum.ts:813
  • +
  • Defined in src/wunderbaum.ts:945
    • -

      [ext-filter] Reset the filter.

      +

      Reset the filter.

      Returns void

      -
      -

      Requires

      See also FilterExtension

      -
    +
  • Defined in src/wunderbaum.ts:2581
  • +
  • Defined in src/wunderbaum.ts:1147
  • +
  • Defined in src/wunderbaum.ts:981
  • +
  • Defined in src/wunderbaum.ts:2516
  • +
  • Defined in src/wunderbaum.ts:1084
  • +
  • Defined in src/wunderbaum.ts:2568
  • +
  • Defined in src/wunderbaum.ts:2555
  • Returns WunderbaumNode[]

    +
  • Defined in src/wunderbaum.ts:1170
  • +
    + +

    Returns null | WunderbaumNode

    +
  • Defined in src/wunderbaum.ts:1195
  • +
  • Defined in src/wunderbaum.ts:1205
    • Find the next visible node that starts with match, starting at startNode -and wrap-around at the end.

      +and wrap-around at the end. +Used by quicksearch and keyboard navigation.

      Parameters

      @@ -762,7 +794,7 @@
      Optional Returns null | WunderbaumNode
    +
  • Defined in src/wunderbaum.ts:1214
  • +
  • Defined in src/wunderbaum.ts:1258
  • +
  • Defined in src/wunderbaum.ts:1380
  • +
  • Defined in src/wunderbaum.ts:1353
  • +
  • Defined in src/wunderbaum.ts:1387
  • +
  • Defined in src/wunderbaum.ts:1400
  • +
  • Defined in src/wunderbaum.ts:1407
  • +
  • Defined in src/wunderbaum.ts:1415
  • +
  • Defined in src/wunderbaum.ts:751
  • +
  • Defined in src/wunderbaum.ts:1000
  • +
  • Defined in src/wunderbaum.ts:1102
  • +
  • Defined in src/wunderbaum.ts:735
  • +
  • Defined in src/wunderbaum.ts:1047
  • +
  • Defined in src/wunderbaum.ts:1056
  • +
  • Defined in src/wunderbaum.ts:1851
  • +
    + +
    +
  • Defined in src/wunderbaum.ts:1505
  • +
  • Defined in src/wunderbaum.ts:1841
    • -

      [ext-filter] Return true if a filter is currently applied.

      +

      Return true if a filter is currently applied.

      Returns boolean

      -
      -

      Requires

      See also FilterExtension

      -
    +
  • Defined in src/wunderbaum.ts:2587
  • +
  • Defined in src/wunderbaum.ts:1846
  • +
  • Defined in src/wunderbaum.ts:1512
  • +
  • Defined in src/wunderbaum.ts:1855
  • +
  • Defined in src/wunderbaum.ts:2496
  • +
  • Defined in src/wunderbaum.ts:1531
  • +
  • Defined in src/wunderbaum.ts:1538
  • +
  • Defined in src/wunderbaum.ts:1545
  • +
  • Defined in src/wunderbaum.ts:1552
  • +
  • Defined in src/wunderbaum.ts:1560
  • +
  • Defined in src/wunderbaum.ts:1567
  • +
  • Defined in src/wunderbaum.ts:1069
  • +
  • Defined in src/wunderbaum.ts:1579
  • +
  • Defined in src/wunderbaum.ts:1089
  • +
  • Defined in src/wunderbaum.ts:1725
  • +
  • Defined in src/wunderbaum.ts:1860
  • +
  • Defined in src/wunderbaum.ts:1671
  • +
  • Defined in src/wunderbaum.ts:1833
  • +
  • Defined in src/wunderbaum.ts:1730
  • +
  • Defined in src/wunderbaum.ts:1875
  • +
  • Defined in src/wunderbaum.ts:1024
  • +
  • Defined in src/wunderbaum.ts:1905
  • +
  • Defined in src/wunderbaum.ts:1913
  • +
  • Defined in src/wunderbaum.ts:1934
  • +
  • Defined in src/wunderbaum.ts:1949
  • +
  • Defined in src/wunderbaum.ts:1486
  • +
  • Defined in src/wunderbaum.ts:1094
  • Update a row to reflect a single node's modification.

    @@ -1506,20 +1549,18 @@

    Returns voidSee

    (), ()

  • +
  • Defined in src/wunderbaum.ts:1753
    • -

      [ext-filter] Re-apply current filter.

      +

      Re-apply current filter.

      Returns void

      -
      -

      Requires

      See also FilterExtension

      -
    +
  • Defined in src/wunderbaum.ts:2593
  • +
  • Defined in src/wunderbaum.ts:2119
  • +
  • Defined in src/wunderbaum.ts:2330
  • +
  • Defined in src/wunderbaum.ts:2345
  • +
  • Defined in src/wunderbaum.ts:1425
  • +
  • Defined in src/wunderbaum.ts:568
    • Return a Wunderbaum instance, from element, id, index, or event.

      -
      getTree();         // Get first Wunderbaum instance on page
      getTree(1); // Get second Wunderbaum instance on page
      getTree(event); // Get tree for this mouse- or keyboard event
      getTree("foo"); // Get tree for this `tree.options.id`
      getTree("#tree"); // Get tree for this matching element +
      getTree();         // Get first Wunderbaum instance on page
      getTree(1); // Get second Wunderbaum instance on page
      getTree(event); // Get tree for this mouse- or keyboard event
      getTree("foo"); // Get tree for this `tree.options.id`
      getTree("#tree"); // Get tree for first matching element selector
      @@ -1650,7 +1691,7 @@
      Optional Returns null | Wunderbaum
    +
  • Defined in src/wunderbaum.ts:515
  • @@ -21,7 +21,7 @@

    Enumeration ChangeType

    +
  • Defined in src/types.ts:435
  • @@ -47,7 +47,7 @@
    +
  • Defined in src/types.ts:437
  • colStructure: "colStructure"
    @@ -55,7 +55,7 @@
    +
  • Defined in src/types.ts:441
  • data: "data"
    @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:439
  • resize: "resize"
    @@ -71,7 +71,7 @@
    +
  • Defined in src/types.ts:443
  • row: "row"
    @@ -79,7 +79,7 @@
    +
  • Defined in src/types.ts:445
  • scroll: "scroll"
    @@ -87,7 +87,7 @@
    +
  • Defined in src/types.ts:451
  • status: "status"
    @@ -95,7 +95,7 @@
    +
  • Defined in src/types.ts:449
  • structure: "structure"
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:447
  • @@ -21,7 +21,7 @@

    Enumeration NavModeEnum

    +
  • Defined in src/types.ts:483
  • @@ -40,22 +40,22 @@

    Enumeration Members

    cell: "cell"
    +
  • Defined in src/types.ts:485
  • row: "row"
    +
  • Defined in src/types.ts:487
  • startCell: "startCell"
    +
  • Defined in src/types.ts:486
  • startRow: "startRow"
    +
  • Defined in src/types.ts:484
  • @@ -21,7 +21,7 @@

    Enumeration NodeRegion

    +
  • Defined in src/types.ts:472
  • @@ -43,37 +43,37 @@

    Enumeration Members

    checkbox: "checkbox"
    +
  • Defined in src/types.ts:474
  • column: "column"
    +
  • Defined in src/types.ts:475
  • expander: "expander"
    +
  • Defined in src/types.ts:476
  • icon: "icon"
    +
  • Defined in src/types.ts:477
  • prefix: "prefix"
    +
  • Defined in src/types.ts:478
  • title: "title"
    +
  • Defined in src/types.ts:479
  • unknown: ""
    +
  • Defined in src/types.ts:473
  • @@ -21,7 +21,7 @@

    Enumeration NodeStatusType

    +
  • Defined in src/types.ts:463
  • @@ -41,27 +41,27 @@

    Enumeration Members

    error: "error"
    +
  • Defined in src/types.ts:466
  • loading: "loading"
    +
  • Defined in src/types.ts:465
  • noData: "noData"
    +
  • Defined in src/types.ts:467
  • ok: "ok"
    +
  • Defined in src/types.ts:464
  • paging: "paging"
    +
  • Defined in src/types.ts:468
  • @@ -17,7 +17,7 @@
  • RenderFlag
  • Enumeration RenderFlag

    +
  • Defined in src/types.ts:455
  • @@ -36,22 +36,22 @@

    Enumeration Members

    clearMarkup: "clearMarkup"
    +
  • Defined in src/types.ts:456
  • header: "header"
    +
  • Defined in src/types.ts:457
  • redraw: "redraw"
    +
  • Defined in src/types.ts:458
  • scroll: "scroll"
    +
  • Defined in src/types.ts:459
  • @@ -39,7 +39,7 @@

    Returns void

    +
  • Defined in src/common.ts:294
  • @@ -30,10 +30,10 @@

    Parameters

    match: string | RegExp

    Returns MatcherCallback

    +
  • Defined in src/common.ts:152
  • @@ -30,7 +30,7 @@
    s:

    Returns MatcherCallback

    +
  • Defined in src/common.ts:172
  • @@ -51,7 +51,7 @@
    options: Returns DebouncedFunction<((...args) => void)>
    +
  • Defined in src/util.ts:804
  • @@ -32,7 +32,7 @@
    msg: Returns void
    +
  • Defined in src/util.ts:111
  • @@ -36,7 +36,7 @@

    Returns voidReturns void

    +
  • Defined in src/util.ts:128
  • @@ -25,7 +25,7 @@

    Function documentReadyPromise

    Returns Promise<void>

    +
  • Defined in src/util.ts:137
  • @@ -48,7 +48,7 @@

    Returns booleanReturns any

    +
  • Defined in src/util.ts:151
  • @@ -35,7 +35,7 @@
    html: Returns T
    +
  • Defined in src/util.ts:408
  • @@ -35,7 +35,7 @@
    obj: Returns T | null
    +
  • Defined in src/util.ts:417
  • @@ -30,7 +30,7 @@
    msg: Returns void
    +
  • Defined in src/util.ts:179
  • @@ -30,7 +30,7 @@
    s:

    Returns string

    +
  • Defined in src/util.ts:184
  • @@ -30,7 +30,7 @@
    s:

    Returns string

    +
  • Defined in src/util.ts:195
  • @@ -30,7 +30,7 @@
    s:

    Returns string

    +
  • Defined in src/util.ts:200
  • @@ -36,7 +36,7 @@
    event: Returns string
    +
  • Defined in src/util.ts:464
  • @@ -31,7 +31,7 @@

    Returns any

    +
  • Defined in src/util.ts:504
  • @@ -30,7 +30,7 @@
    s:

    Returns string

    +
  • Defined in src/util.ts:207
  • @@ -43,7 +43,7 @@
    defaultValue: Returns any
    +
  • Defined in src/util.ts:732
  • @@ -47,7 +47,7 @@

    Returns any

    +
  • Defined in src/util.ts:240
  • @@ -30,7 +30,7 @@
    obj: Returns boolean
    +
  • Defined in src/util.ts:520
  • @@ -30,7 +30,7 @@
    obj: Returns boolean
    +
  • Defined in src/util.ts:525
  • @@ -30,7 +30,7 @@
    obj: Returns boolean
    +
  • Defined in src/util.ts:530
  • @@ -30,7 +30,7 @@
    obj: Returns boolean
    +
  • Defined in src/util.ts:535
  • @@ -30,7 +30,7 @@
    Rest Returns any
    +
  • Defined in src/util.ts:540
  • @@ -36,7 +36,7 @@
    handler: Returns void
    +
  • Defined in src/util.ts:549
  • Bind one or more event handlers using event delegation.

    @@ -62,7 +62,7 @@
    handler: Returns void
  • +
  • Defined in src/util.ts:571
  • @@ -38,7 +38,7 @@
    Optional Returns void
    +
  • Defined in src/util.ts:626
  • @@ -32,7 +32,7 @@
    flag: Returns void
    +
  • Defined in src/util.ts:393
  • @@ -50,7 +50,7 @@
    ms: Returns Promise<T>
    +
  • Defined in src/util.ts:658
  • @@ -46,7 +46,7 @@
    value: Returns void
    +
  • Defined in src/util.ts:326
  • @@ -36,7 +36,7 @@
    ms: Returns Promise<unknown>
    +
  • Defined in src/util.ts:684
  • @@ -30,7 +30,7 @@
    val: Returns Set<string>
    +
  • Defined in src/util.ts:750
  • @@ -39,7 +39,7 @@
    Optional Returns void
    +
  • Defined in src/util.ts:698
  • @@ -30,7 +30,7 @@
    obj: Returns string
    +
  • Defined in src/util.ts:785
  • -

    wunderbaum - v0.7.1-0

    +

    wunderbaum - v0.8.0

    wunderbaum

    GitHub version Node.js CI npm @@ -66,7 +66,7 @@

    Details

    @@ -25,7 +25,7 @@

    Hierarchy

    • AddChildrenOptions
    +
  • Defined in src/types.ts:495
  • @@ -46,7 +46,7 @@
    +
  • Defined in src/types.ts:507
  • applyMinExpanLevel?: boolean
    @@ -58,7 +58,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:505
  • before?: null | number | WunderbaumNode
    @@ -69,7 +69,7 @@

    Default

    undefined
    +
  • Defined in src/types.ts:499
  • @@ -28,7 +28,7 @@

    Hierarchy

    Indexable

    [key: string]: unknown
    +
  • Defined in src/types.ts:511
  • @@ -30,7 +30,7 @@

    Hierarchy

    Indexable

    [key: string]: unknown
    +
  • Defined in src/types.ts:319
  • @@ -57,19 +57,19 @@
    +
  • Defined in src/types.ts:351
  • _weight?: number
    +
  • Defined in src/types.ts:347
  • _widthPx?: number
    +
  • Defined in src/types.ts:349
  • classes?: string
    @@ -78,7 +78,7 @@
    +
  • Defined in src/types.ts:339
  • headerClasses?: string
    @@ -87,7 +87,7 @@
    +
  • Defined in src/types.ts:343
  • html?: string
    @@ -95,7 +95,7 @@
    +
  • Defined in src/types.ts:345
  • id: string
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:321
  • minWidth?: string | number
    @@ -112,7 +112,7 @@
    +
  • Defined in src/types.ts:335
  • title: string
    @@ -120,7 +120,7 @@
    +
  • Defined in src/types.ts:323
  • tooltip?: string
    @@ -128,7 +128,7 @@
    +
  • Defined in src/types.ts:325
  • width?: string | number
    @@ -139,7 +139,7 @@
    +
  • Defined in src/types.ts:331
  • @@ -25,7 +25,7 @@

    Hierarchy

    • ColumnEventInfo
    +
  • Defined in src/types.ts:361
  • @@ -47,7 +47,7 @@
    +
  • Defined in src/types.ts:367
  • id: string
    @@ -55,7 +55,7 @@
    +
  • Defined in src/types.ts:363
  • idx: number
    @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:365
  • @@ -71,7 +71,7 @@
    +
  • Defined in src/types.ts:369
  • @@ -25,7 +25,7 @@

    Hierarchy

    • ExpandAllOptions
    +
  • Defined in src/types.ts:516
  • @@ -50,7 +50,7 @@

    Default

    99
     
    +
  • Defined in src/types.ts:518
  • force?: boolean
    @@ -61,7 +61,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:522
  • keepActiveNodeVisible?: boolean
    @@ -72,7 +72,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:524
  • loadLazy?: boolean
    @@ -83,7 +83,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:520
  • @@ -25,7 +25,7 @@

    Hierarchy

    • FilterNodesOptions
    +
  • Defined in src/types.ts:528
  • @@ -47,37 +47,37 @@

    Properties

    autoExpand?: boolean
    +
  • Defined in src/types.ts:534
  • fuzzy?: boolean
    +
  • Defined in src/types.ts:531
  • hideExpanders?: boolean
    +
  • Defined in src/types.ts:533
  • highlight?: boolean
    +
  • Defined in src/types.ts:532
  • leavesOnly?: boolean
    +
  • Defined in src/types.ts:530
  • mode?: string
    +
  • Defined in src/types.ts:529
  • noData?: boolean
    +
  • Defined in src/types.ts:535
  • @@ -25,7 +25,7 @@

    Hierarchy

    • MakeVisibleOptions
    +
  • Defined in src/types.ts:539
  • @@ -49,7 +49,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:541
  • noEvents?: boolean
    @@ -60,7 +60,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:545
  • scrollIntoView?: boolean
    @@ -71,7 +71,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:543
  • @@ -25,7 +25,7 @@

    Hierarchy

    • NavigateOptions
    +
  • Defined in src/types.ts:549
  • @@ -48,7 +48,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:551
  • event?: Event
    @@ -56,7 +56,7 @@
    +
  • Defined in src/types.ts:553
  • @@ -32,7 +32,7 @@

    Hierarchy

    Indexable

    [key: string]: unknown
    +
  • Defined in src/types.ts:294
  • @@ -55,7 +55,7 @@
    +
  • Defined in src/types.ts:296
  • classes?: string
    @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:298
  • colspan?: boolean
    @@ -71,7 +71,7 @@
    +
  • Defined in src/types.ts:300
  • icon?: IconOption
    @@ -79,7 +79,7 @@
    +
  • Defined in src/types.ts:302
  • iconTooltip?: string | boolean
    @@ -87,7 +87,7 @@
    +
  • Defined in src/types.ts:304
  • @@ -25,7 +25,7 @@

    Hierarchy

    • RenderOptions
    +
  • Defined in src/types.ts:557
  • @@ -53,7 +53,7 @@

    Default

    'last'
     
    +
  • Defined in src/types.ts:561
  • change?: ChangeType
    @@ -64,7 +64,7 @@

    Default

    ChangeType
    +
  • Defined in src/types.ts:559
  • isDataChange?: boolean
    @@ -75,7 +75,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:567
  • isNew?: boolean
    @@ -86,7 +86,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:563
  • preventScroll?: boolean
    @@ -97,7 +97,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:565
  • resizeCols?: boolean
    @@ -108,7 +108,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:571
  • top?: number
    @@ -119,7 +119,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:569
  • @@ -27,7 +27,7 @@

    Hierarchy

    +
  • Defined in src/types.ts:575
  • @@ -52,7 +52,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:577
  • noEvents?: boolean
    @@ -63,7 +63,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:579
  • ofsY?: number
    @@ -71,7 +71,7 @@
    +
  • Defined in src/types.ts:583
  • topNode?: WunderbaumNode
    @@ -79,7 +79,7 @@
    +
  • Defined in src/types.ts:581
  • @@ -27,7 +27,7 @@

    Hierarchy

    • ScrollToOptions
    +
  • Defined in src/types.ts:587
  • @@ -54,7 +54,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:577
  • noEvents?: boolean
    @@ -66,7 +66,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:579
  • @@ -74,7 +74,7 @@
    +
  • Defined in src/types.ts:589
  • ofsY?: number
    @@ -83,7 +83,7 @@
    +
  • Defined in src/types.ts:583
  • topNode?: WunderbaumNode
    @@ -92,7 +92,7 @@
    +
  • Defined in src/types.ts:581
  • @@ -25,7 +25,7 @@

    Hierarchy

    • SetActiveOptions
    +
  • Defined in src/types.ts:593
  • @@ -49,7 +49,7 @@
    +
  • Defined in src/types.ts:607
  • edit?: boolean
    @@ -59,7 +59,7 @@
    +
  • Defined in src/types.ts:613
  • event?: Event
    @@ -67,7 +67,7 @@
    +
  • Defined in src/types.ts:605
  • focusTree?: boolean
    @@ -75,7 +75,7 @@
    +
  • Defined in src/types.ts:603
  • noEvents?: boolean
    @@ -83,7 +83,7 @@
    +
  • Defined in src/types.ts:597
  • retrigger?: boolean
    @@ -91,7 +91,7 @@
    +
  • Defined in src/types.ts:595
  • @@ -25,7 +25,7 @@

    Hierarchy

    • SetColumnOptions
    +
  • Defined in src/types.ts:617
  • @@ -49,7 +49,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:623
  • scrollIntoView?: boolean
    @@ -57,7 +57,7 @@
    +
  • Defined in src/types.ts:625
  • @@ -17,7 +17,7 @@
  • SetExpandedOptions
  • Interface SetExpandedOptions

    -

    Possible values for () options argument.

    +

    Possible values for WunderbaumNode.setExpanded options argument.

    @@ -25,7 +25,7 @@

    Hierarchy

    • SetExpandedOptions
    +
  • Defined in src/types.ts:629
  • @@ -51,7 +51,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:631
  • immediate?: boolean
    @@ -62,7 +62,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:633
  • noAnimation?: boolean
    @@ -73,7 +73,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:635
  • noEvents?: boolean
    @@ -84,7 +84,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:637
  • scrollIntoView?: boolean
    @@ -95,7 +95,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:639
  • @@ -25,7 +25,7 @@

    Hierarchy

    • SetSelectedOptions
    +
  • Defined in src/types.ts:651
  • @@ -50,7 +50,7 @@

    Default

    null
     
    +
  • Defined in src/types.ts:661
  • force?: boolean
    @@ -61,7 +61,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:653
  • noEvents?: boolean
    @@ -72,7 +72,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:655
  • propagateDown?: boolean
    @@ -83,7 +83,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:657
  • @@ -25,7 +25,7 @@

    Hierarchy

    • SetStatusOptions
    +
  • Defined in src/types.ts:665
  • @@ -45,7 +45,7 @@
    +
  • Defined in src/types.ts:669
  • message?: string
    @@ -53,7 +53,7 @@
    +
  • Defined in src/types.ts:667
  • @@ -21,7 +21,7 @@

    Hierarchy

    • SourceAjaxType
    +
  • Defined in src/types.ts:27
  • @@ -40,22 +40,22 @@

    Properties

    body?: any
    +
  • Defined in src/types.ts:30
  • options?: RequestInit
    +
  • Defined in src/types.ts:31
  • params?: any
    +
  • Defined in src/types.ts:29
  • url: string
    +
  • Defined in src/types.ts:28
  • @@ -21,7 +21,7 @@

    Hierarchy

    • SourceObjectType
    +
  • Defined in src/types.ts:34
  • @@ -44,7 +44,7 @@

    Properties

    _format?: "flat" | "nested"
    +
  • Defined in src/types.ts:35
  • _keyMap?: {
        [key: string]: string;
    }
    @@ -54,12 +54,12 @@

    Type declaration

  • [key: string]: string
  • +
  • Defined in src/types.ts:40
  • _positional?: string[]
    +
  • Defined in src/types.ts:41
  • _valueMap?: {
        [key: string]: string[];
    }
    @@ -69,27 +69,27 @@

    Type declaration

  • [key: string]: string[]
  • +
  • Defined in src/types.ts:43
  • _version?: number
    +
  • Defined in src/types.ts:36
  • children: SourceListType
    +
  • Defined in src/types.ts:39
  • +
  • Defined in src/types.ts:38
  • +
  • Defined in src/types.ts:37
  • @@ -25,7 +25,7 @@

    Hierarchy

    • UpdateOptions
    +
  • Defined in src/types.ts:643
  • @@ -47,7 +47,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:645
  • @@ -25,7 +25,7 @@

    Hierarchy

    • VisitRowsOptions
    +
  • Defined in src/types.ts:673
  • @@ -51,7 +51,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:675
  • includeSelf?: boolean
    @@ -62,7 +62,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:677
  • reverse?: boolean
    @@ -73,7 +73,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:679
  • start?: null | WunderbaumNode
    @@ -84,7 +84,7 @@

    Default

    first
    +
  • Defined in src/types.ts:681
  • wrap?: boolean
    @@ -96,7 +96,7 @@

    Default

    false
     
    +
  • Defined in src/types.ts:684
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbActivateEventType
    +
  • Defined in src/types.ts:151
  • @@ -49,7 +49,7 @@
    +
  • Defined in src/types.ts:154
  • @@ -58,12 +58,12 @@
    +
  • Defined in src/types.ts:143
  • prevNode: WunderbaumNode
    +
  • Defined in src/types.ts:152
  • @@ -72,7 +72,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -93,7 +93,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbChangeEventType
    +
  • Defined in src/types.ts:157
  • @@ -34,6 +34,7 @@

    Properties

    event? info inputElem +inputValid inputValue node tree @@ -51,7 +52,7 @@
    +
  • Defined in src/types.ts:137
  • @@ -59,7 +60,7 @@
    +
  • Defined in src/types.ts:159
  • inputElem: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
    @@ -67,7 +68,15 @@
    +
  • Defined in src/types.ts:161
  • +
    + +
    inputValid: boolean
    +

    Result of inputElem.checkValidity().

    +
    +
    inputValue: any
    @@ -75,7 +84,7 @@
    +
  • Defined in src/types.ts:163
  • @@ -84,7 +93,7 @@
    +
  • Defined in src/types.ts:143
  • @@ -93,7 +102,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -102,7 +111,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -114,7 +123,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -124,7 +133,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbClickEventType
    +
  • Defined in src/types.ts:168
  • @@ -48,7 +48,7 @@
    +
  • Defined in src/types.ts:170
  • @@ -56,7 +56,7 @@
    +
  • Defined in src/types.ts:174
  • @@ -64,7 +64,7 @@
    +
  • Defined in src/types.ts:172
  • @@ -73,7 +73,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -82,7 +82,7 @@
    +
  • Defined in src/types.ts:129
  • util: any
    @@ -92,7 +92,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbDeactivateEventType
    +
  • Defined in src/types.ts:177
  • @@ -49,12 +49,12 @@
    +
  • Defined in src/types.ts:180
  • nextNode: WunderbaumNode
    +
  • Defined in src/types.ts:178
  • @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:143
  • @@ -72,7 +72,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -93,7 +93,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbEditApplyEventType
    +
  • Defined in src/types.ts:183
  • @@ -34,6 +34,7 @@

    Properties

    event? info inputElem +inputValid newValue node oldValue @@ -52,7 +53,7 @@
    +
  • Defined in src/types.ts:137
  • @@ -60,7 +61,7 @@
    +
  • Defined in src/types.ts:185
  • inputElem: HTMLInputElement
    @@ -68,7 +69,15 @@
    +
  • Defined in src/types.ts:187
  • +
    + +
    inputValid: boolean
    +

    Result of inputElem.checkValidity().

    +
    +
    newValue: string
    @@ -76,7 +85,7 @@
    +
  • Defined in src/types.ts:191
  • @@ -85,7 +94,7 @@
    +
  • Defined in src/types.ts:143
  • oldValue: string
    @@ -93,7 +102,7 @@
    +
  • Defined in src/types.ts:189
  • @@ -102,7 +111,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -111,7 +120,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -123,7 +132,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -133,7 +142,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbEditEditEventType
    +
  • Defined in src/types.ts:196
  • @@ -49,7 +49,7 @@
    +
  • Defined in src/types.ts:137
  • inputElem: HTMLInputElement
    @@ -57,7 +57,7 @@
    +
  • Defined in src/types.ts:198
  • @@ -66,7 +66,7 @@
    +
  • Defined in src/types.ts:143
  • @@ -75,7 +75,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -84,7 +84,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -96,7 +96,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -106,7 +106,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbErrorEventType
    +
  • Defined in src/types.ts:205
  • @@ -45,7 +45,7 @@

    Properties

    error: any
    +
  • Defined in src/types.ts:206
  • event?: Event
    @@ -54,7 +54,7 @@
    +
  • Defined in src/types.ts:137
  • @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:143
  • @@ -72,7 +72,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -93,7 +93,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -27,7 +27,7 @@

    Hierarchy

    • WbEventInfo
    +
  • Defined in src/types.ts:378
  • @@ -57,7 +57,7 @@
    +
  • Defined in src/types.ts:384
  • @@ -65,7 +65,7 @@
    +
  • Defined in src/types.ts:392
  • colElem?: HTMLSpanElement
    @@ -73,7 +73,7 @@
    +
  • Defined in src/types.ts:398
  • colId?: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:396
  • colIdx: number
    @@ -89,7 +89,7 @@
    +
  • Defined in src/types.ts:394
  • event: MouseEvent | KeyboardEvent
    @@ -97,7 +97,7 @@
    +
  • Defined in src/types.ts:380
  • node: null | WunderbaumNode
    @@ -105,7 +105,7 @@
    +
  • Defined in src/types.ts:388
  • region: NodeRegion
    @@ -113,7 +113,7 @@
    +
  • Defined in src/types.ts:390
  • @@ -121,7 +121,7 @@
    +
  • Defined in src/types.ts:386
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbFocusEventType
    +
  • Defined in src/types.ts:212
  • @@ -47,7 +47,7 @@
    +
  • Defined in src/types.ts:214
  • flag: boolean
    @@ -55,7 +55,7 @@
    +
  • Defined in src/types.ts:216
  • @@ -64,7 +64,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -73,7 +73,7 @@
    +
  • Defined in src/types.ts:129
  • util: any
    @@ -83,7 +83,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -21,7 +21,7 @@

    Hierarchy

    • WbIconBadgeEventResultType
    +
  • Defined in src/types.ts:222
  • @@ -42,7 +42,7 @@
    +
  • Defined in src/types.ts:224
  • badgeClass?: string
    @@ -50,7 +50,7 @@
    +
  • Defined in src/types.ts:226
  • badgeTooltip?: string
    @@ -58,7 +58,7 @@
    +
  • Defined in src/types.ts:228
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbIconBadgeEventType
    +
  • Defined in src/types.ts:219
  • @@ -49,12 +49,12 @@
    +
  • Defined in src/types.ts:137
  • iconSpan: HTMLElement
    +
  • Defined in src/types.ts:220
  • @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:143
  • @@ -72,7 +72,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -93,7 +93,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbInitEventType
    +
  • Defined in src/types.ts:231
  • @@ -43,7 +43,7 @@

    Properties

    error?: any
    +
  • Defined in src/types.ts:232
  • event?: Event
    @@ -52,7 +52,7 @@
    +
  • Defined in src/types.ts:137
  • @@ -61,7 +61,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -70,7 +70,7 @@
    +
  • Defined in src/types.ts:129
  • util: any
    @@ -80,7 +80,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbKeydownEventType
    +
  • Defined in src/types.ts:235
  • @@ -48,7 +48,7 @@
    +
  • Defined in src/types.ts:237
  • @@ -56,12 +56,12 @@
    +
  • Defined in src/types.ts:240
  • +
  • Defined in src/types.ts:238
  • @@ -70,7 +70,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -79,7 +79,7 @@
    +
  • Defined in src/types.ts:129
  • util: any
    @@ -89,7 +89,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -28,7 +28,7 @@

    Hierarchy

    Indexable

    [key: string]: unknown
    +
  • Defined in src/types.ts:98
  • @@ -62,52 +62,52 @@
    +
  • Defined in src/types.ts:118
  • checkbox?: CheckboxOption
    +
  • Defined in src/types.ts:99
  • children?: WbNodeData[]
    +
  • Defined in src/types.ts:100
  • classes?: string
    +
  • Defined in src/types.ts:101
  • colspan?: boolean
    +
  • Defined in src/types.ts:102
  • expanded?: boolean
    +
  • Defined in src/types.ts:103
  • icon?: IconOption
    +
  • Defined in src/types.ts:104
  • iconTooltip?: string | boolean
    +
  • Defined in src/types.ts:105
  • key?: string
    +
  • Defined in src/types.ts:106
  • lazy?: boolean
    +
  • Defined in src/types.ts:107
  • radiogroup?: boolean
    @@ -115,42 +115,42 @@
    +
  • Defined in src/types.ts:109
  • refKey?: string
    +
  • Defined in src/types.ts:110
  • selected?: boolean
    +
  • Defined in src/types.ts:111
  • statusNodeType?: NodeStatusType
    +
  • Defined in src/types.ts:112
  • title: string
    +
  • Defined in src/types.ts:113
  • tooltip?: string | boolean
    +
  • Defined in src/types.ts:114
  • type?: string
    +
  • Defined in src/types.ts:115
  • unselectable?: boolean
    +
  • Defined in src/types.ts:116
  • +
  • Defined in src/types.ts:143
  • @@ -76,7 +77,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -85,7 +86,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -96,7 +97,7 @@

    Wunderbaum.types

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -106,7 +107,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbReceiveEventType
    +
  • Defined in src/types.ts:243
  • @@ -49,7 +49,7 @@
    +
  • Defined in src/types.ts:137
  • @@ -58,12 +58,12 @@
    +
  • Defined in src/types.ts:143
  • response: any
    +
  • Defined in src/types.ts:244
  • @@ -72,7 +72,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -93,7 +93,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbRenderEventType
    +
  • Defined in src/types.ts:250
  • @@ -54,7 +54,7 @@
    +
  • Defined in src/types.ts:268
  • event?: Event
    @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:137
  • isColspan: boolean
    @@ -71,7 +71,7 @@
    +
  • Defined in src/types.ts:262
  • isNew: boolean
    @@ -83,7 +83,7 @@
    +
  • Defined in src/types.ts:258
  • @@ -92,7 +92,7 @@
    +
  • Defined in src/types.ts:143
  • nodeElem: HTMLSpanElement
    @@ -100,7 +100,7 @@
    +
  • Defined in src/types.ts:260
  • renderColInfosById: ColumnEventInfoMap
    @@ -114,7 +114,7 @@
    +
  • Defined in src/types.ts:285
  • @@ -123,7 +123,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -132,7 +132,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -144,7 +144,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -154,7 +154,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -23,7 +23,7 @@

    Hierarchy

    • WbSelectEventType
    +
  • Defined in src/types.ts:246
  • @@ -49,12 +49,12 @@
    +
  • Defined in src/types.ts:137
  • flag: boolean
    +
  • Defined in src/types.ts:247
  • @@ -63,7 +63,7 @@
    +
  • Defined in src/types.ts:143
  • @@ -72,7 +72,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -81,7 +81,7 @@
    +
  • Defined in src/types.ts:129
  • @@ -93,7 +93,7 @@

    See

    Inherited from WbNodeEventType.typeInfo

    +
  • Defined in src/types.ts:148
  • util: any
    @@ -103,7 +103,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -27,7 +27,7 @@

    Hierarchy

  • WbInitEventType
  • WbKeydownEventType
  • +
  • Defined in src/types.ts:127
  • @@ -49,7 +49,7 @@
    +
  • Defined in src/types.ts:137
  • @@ -57,7 +57,7 @@
    +
  • Defined in src/types.ts:131
  • type: string
    @@ -65,7 +65,7 @@
    +
  • Defined in src/types.ts:129
  • util: any
    @@ -74,7 +74,7 @@
    +
  • Defined in src/types.ts:135
  • @@ -31,7 +31,7 @@

    Hierarchy

    • WunderbaumOptions
    +
  • Defined in src/wb_options.ts:63
  • @@ -115,7 +115,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:244
  • beforeActivate?: ((e) => void)
    @@ -136,7 +136,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:250
  • change?: ((e) => void)
    @@ -155,7 +155,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:255
  • click?: ((e) => void)
    @@ -176,7 +176,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:261
  • dblclick?: ((e) => void)
    @@ -195,7 +195,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:266
  • deactivate?: ((e) => void)
    @@ -217,7 +217,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:273
  • discard?: ((e) => void)
    @@ -236,7 +236,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:278
  • error?: ((e) => void)
    @@ -255,7 +255,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:293
  • focus?: ((e) => void)
    @@ -276,13 +276,13 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:299
  • +
  • Defined in src/wb_options.ts:283
  • init?: ((e) => void)
    @@ -306,7 +306,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:307
  • keydown?: ((e) => void)
    @@ -325,7 +325,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:312
  • lazyLoad?: ((e) => void)
    @@ -348,7 +348,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:319
  • load?: ((e) => void)
    @@ -370,7 +370,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:325
  • modifyChild?: ((e) => void)
    @@ -389,7 +389,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:329
  • receive?: ((e) => void)
    @@ -413,7 +413,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:337
  • render?: ((e) => void)
    @@ -438,7 +438,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:346
  • renderStatusNode?: ((e) => void)
    @@ -457,7 +457,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:351
  • select?: ((e) => void)
    @@ -478,7 +478,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:357
  • update?: ((e) => void)
    @@ -499,7 +499,7 @@
    e: Returns void
    +
  • Defined in src/wb_options.ts:362
  • Other

    @@ -517,7 +517,7 @@
    +
  • Defined in src/wb_options.ts:163
  • autoCollapse?: boolean
    @@ -526,7 +526,7 @@
    +
  • Defined in src/wb_options.ts:149
  • @@ -536,7 +536,7 @@
    +
  • Defined in src/wb_options.ts:190
  • @@ -548,7 +548,7 @@
    +
  • Defined in src/wb_options.ts:98
  • connectTopBreadcrumb?: HTMLElement
    @@ -557,7 +557,7 @@
    +
  • Defined in src/wb_options.ts:168
  • debugLevel?: number
    @@ -566,17 +566,17 @@
    +
  • Defined in src/wb_options.ts:114
  • +
  • Defined in src/wb_options.ts:233
  • +
  • Defined in src/wb_options.ts:234
  • element: string | HTMLDivElement
    @@ -584,7 +584,7 @@
    +
  • Defined in src/wb_options.ts:67
  • emptyChildListExpandable?: boolean
    @@ -594,7 +594,7 @@
    +
  • Defined in src/wb_options.ts:126
  • enabled?: boolean
    @@ -602,12 +602,12 @@
    +
  • Defined in src/wb_options.ts:208
  • +
  • Defined in src/wb_options.ts:235
  • fixedCol?: boolean
    @@ -615,12 +615,12 @@
    +
  • Defined in src/wb_options.ts:212
  • grid?: any
    +
  • Defined in src/wb_options.ts:236
  • header?: null | string | boolean
    @@ -632,7 +632,7 @@
    +
  • Defined in src/wb_options.ts:180
  • @@ -640,7 +640,7 @@
    +
  • Defined in src/wb_options.ts:192
  • iconMap?: string | {
        [key: string]: string;
    }
    @@ -656,7 +656,7 @@

    Type declaration

    [key: string]: string
    +
  • Defined in src/wb_options.ts:144
  • @@ -664,7 +664,7 @@
    +
  • Defined in src/wb_options.ts:194
  • id?: string
    @@ -674,7 +674,7 @@
    +
  • Defined in src/wb_options.ts:74
  • minExpandLevel?: number
    @@ -684,7 +684,7 @@
    +
  • Defined in src/wb_options.ts:120
  • navigationModeOption?: NavModeEnum
    @@ -692,7 +692,7 @@
    +
  • Defined in src/wb_options.ts:172
  • quicksearch?: boolean
    @@ -700,7 +700,7 @@
    +
  • Defined in src/wb_options.ts:224
  • rowHeightPx?: number
    @@ -709,7 +709,7 @@
    +
  • Defined in src/wb_options.ts:137
  • scrollIntoViewOnExpandClick?: boolean
    @@ -720,7 +720,7 @@

    Default

    true
     
    +
  • Defined in src/wb_options.ts:230
  • selectMode?: SelectModeType
    @@ -728,13 +728,13 @@
    +
  • Defined in src/wb_options.ts:218
  • showSpinner?: boolean
    +
  • Defined in src/wb_options.ts:184
  • skeleton?: boolean
    @@ -745,7 +745,7 @@
    +
  • Defined in src/wb_options.ts:105
  • source?: string | WbNodeData[]
    @@ -756,7 +756,7 @@
    +
  • Defined in src/wb_options.ts:82
  • strings?: any
    @@ -764,7 +764,7 @@
    +
  • Defined in src/wb_options.ts:109
  • @@ -773,7 +773,7 @@
    +
  • Defined in src/wb_options.ts:198
  • @@ -784,7 +784,7 @@
    +
  • Defined in src/wb_options.ts:90
  • unselectable?: DynamicBoolOption
    @@ -792,7 +792,7 @@
    +
  • Defined in src/wb_options.ts:200
  • @@ -16,7 +16,7 @@
  • common
  • Module common

    +
  • Defined in src/common.ts:1
  • Index

    @@ -56,7 +56,7 @@

    Member Visibility

    Theme

    @@ -16,7 +16,7 @@
  • types
  • Module types

    +
  • Defined in src/types.ts:1
  • Index

    @@ -59,6 +59,7 @@

    Interfaces

    WbEditEditEventType WbErrorEventType WbEventInfo +WbExpandEventType WbFocusEventType WbIconBadgeEventResultType WbIconBadgeEventType @@ -126,7 +127,7 @@

    Member Visibility

    Theme

    @@ -16,29 +16,25 @@
  • util
  • Module util

    +
  • Defined in src/util.ts:1
  • Index

    -

    Classes

    -
    -

    Type Aliases

    -
    -
    -

    Variables

    -
    -
    -

    Functions

    -
    adaptiveThrottle +adaptiveThrottle assert documentReady documentReadyPromise @@ -83,7 +79,7 @@

    Member Visibility

    Theme

    @@ -16,7 +16,7 @@
  • wb_node
  • Module wb_node

    +
  • Defined in src/wb_node.ts:1
  • Index

    @@ -38,7 +38,7 @@

    Member Visibility

    Theme

    @@ -16,7 +16,7 @@
  • wb_options
  • Module wb_options

    +
  • Defined in src/wb_options.ts:1
  • Index

    @@ -38,7 +38,7 @@

    Member Visibility

    Theme

    @@ -16,7 +16,7 @@
  • wunderbaum
  • Module wunderbaum

    +
  • Defined in src/wunderbaum.ts:1
  • Index

    @@ -38,7 +38,7 @@

    Member Visibility

    Theme

    @@ -18,7 +18,7 @@

    Type alias ApplyCommandType

    ApplyCommandType: "addChild" | "addSibling" | "copy" | "cut" | "down" | "first" | "indent" | "last" | "left" | "moveDown" | "moveUp" | "outdent" | "pageDown" | "pageUp" | "parent" | "paste" | "remove" | "rename" | "right" | "up"
    +
  • Defined in src/types.ts:407
  • +
  • Defined in src/types.ts:62
  • +
  • Defined in src/types.ts:64
  • @@ -21,7 +21,7 @@

    Type alias CheckboxOption

    +
  • Defined in src/types.ts:14
  • @@ -18,7 +18,7 @@

    Type alias ColumnDefinitionList

    ColumnDefinitionList: ColumnDefinition[]
    +
  • Defined in src/types.ts:356
  • @@ -23,7 +23,7 @@

    Type declaration

  • [colId: string]: ColumnEventInfo
  • +
  • Defined in src/types.ts:372
  • @@ -220,7 +220,7 @@

    Default

    null
     
    +
  • Defined in src/types.ts:857
  • @@ -18,7 +18,7 @@

    Type alias DropEffectAllowedType

    DropEffectAllowedType: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all"
    +
  • Defined in src/types.ts:834
  • @@ -18,7 +18,7 @@

    Type alias DropEffectType

    DropEffectType: "none" | "copy" | "link" | "move"
    +
  • Defined in src/types.ts:833
  • @@ -18,7 +18,7 @@

    Type alias DropRegionType

    DropRegionType: "over" | "before" | "after"
    +
  • Defined in src/types.ts:844
  • @@ -18,7 +18,7 @@

    Type alias DropRegionTypeSet

    DropRegionTypeSet: Set<DropRegionType>
    +
  • Defined in src/types.ts:845
  • @@ -22,7 +22,7 @@

    Type alias DynamicBoolOption

    +
  • Defined in src/types.ts:87
  • @@ -18,7 +18,7 @@

    Type alias DynamicBoolOrStringOption

    DynamicBoolOrStringOption: boolean | string | BoolOrStringOptionResolver
    +
  • Defined in src/types.ts:89
  • @@ -18,7 +18,7 @@

    Type alias DynamicCheckboxOption

    +
  • Defined in src/types.ts:93
  • @@ -18,7 +18,7 @@

    Type alias DynamicIconOption

    +
  • Defined in src/types.ts:94
  • @@ -18,7 +18,7 @@

    Type alias DynamicStringOption

    DynamicStringOption: string | BoolOptionResolver
    +
  • Defined in src/types.ts:88
  • @@ -107,7 +107,7 @@

    Default

    true
     
    +
  • Defined in src/types.ts:752
  • @@ -18,7 +18,7 @@

    Type alias FilterModeType

    FilterModeType: null | "dim" | "hide"
    +
  • Defined in src/types.ts:405
  • @@ -16,7 +16,7 @@
  • types
  • FilterOptionsType
  • Type alias FilterOptionsType

    -
    FilterOptionsType: {
        autoApply?: boolean;
        autoExpand?: boolean;
        connectInput?: null | string | Element;
        counter?: boolean;
        fuzzy?: boolean;
        hideExpandedCounter?: boolean;
        hideExpanders?: boolean;
        highlight?: boolean;
        leavesOnly?: boolean;
        mode?: "dim" | "hide";
        noData?: boolean;
    }
    +
    FilterOptionsType: {
        autoApply?: boolean;
        autoExpand?: boolean;
        connectInput?: null | string | Element;
        counter?: boolean;
        fuzzy?: boolean;
        hideExpandedCounter?: boolean;
        hideExpanders?: boolean;
        highlight?: boolean;
        leavesOnly?: boolean;
        mode?: FilterModeType;
        noData?: boolean | string;
    }

    Type declaration

      @@ -93,7 +93,7 @@

      Default

      false
       
  • -
    Optional mode?: "dim" | "hide"
    +
    Optional mode?: FilterModeType

    Grayout unmatched nodes (pass "hide" to remove unmatched node instead)

    @@ -101,15 +101,16 @@

    Default

    'dim'<
     
  • -
    Optional noData?: boolean
    -

    Display a 'no data' status node if result is empty

    +
    Optional noData?: boolean | string
    +

    Display a 'no data' status node if result is empty (hide-mode only). +Pass false to simply show an empy pane, or pass a string to customize the message.

    Default

    true
     
  • +
  • Defined in src/types.ts:687
  • @@ -18,7 +18,7 @@

    Type alias GridOptionsType

    GridOptionsType: object
    +
  • Defined in src/types.ts:820
  • @@ -26,7 +26,7 @@

    Type alias IconOption

    +
  • Defined in src/types.ts:22
  • @@ -18,7 +18,7 @@

    Type alias InsertNodeType

    InsertNodeType: "before" | "after" | "prependChild" | "appendChild"
    +
  • Defined in src/types.ts:826
  • +
  • Defined in src/types.ts:54
  • +
  • Defined in src/types.ts:68
  • @@ -31,7 +31,7 @@

    Parameters

    node: WunderbaumNode

    Returns NodeFilterResponse

    +
  • Defined in src/types.ts:430
  • @@ -18,7 +18,7 @@

    Type alias NodeFilterResponse

    NodeFilterResponse: "skip" | "branch" | boolean | void
    +
  • Defined in src/types.ts:429
  • +
  • Defined in src/types.ts:81
  • +
  • Defined in src/types.ts:70
  • @@ -36,7 +36,7 @@
    node: Returns NodeVisitResponse
    +
  • Defined in src/types.ts:76
  • @@ -23,7 +23,7 @@

    Type declaration

  • [type: string]: NodeTypeDefinition
  • +
  • Defined in src/types.ts:313
  • @@ -34,7 +34,7 @@
    node: Returns NodeVisitResponse
    +
  • Defined in src/types.ts:72
  • @@ -21,7 +21,7 @@

    Type alias NodeVisitResponse

    +
  • Defined in src/types.ts:74
  • @@ -18,7 +18,7 @@

    Type alias SelectModeType

    SelectModeType: "single" | "multi" | "hier"
    +
  • Defined in src/types.ts:406
  • +
  • Defined in src/types.ts:60
  • @@ -18,7 +18,7 @@

    Type alias SourceListType

    SourceListType: WbNodeData[]
    +
  • Defined in src/types.ts:33
  • @@ -21,7 +21,7 @@

    Type alias SourceType

    +
  • Defined in src/types.ts:47
  • @@ -21,7 +21,7 @@

    Type alias TristateType

    +
  • Defined in src/types.ts:12
  • @@ -34,7 +34,7 @@
    e: Returns WbIconBadgeEventResultType
    +
  • Defined in src/types.ts:56
  • @@ -31,7 +31,7 @@

    Parameters

    e: Event

    Returns boolean | void

    +
  • Defined in src/util.ts:40
  • @@ -31,7 +31,7 @@

    Parameters

    Rest ...args: any[]

    Returns any

    +
  • Defined in src/util.ts:39
  • @@ -18,7 +18,7 @@

    Variable DEFAULT_DEBUGLEVELConst

    DEFAULT_DEBUGLEVEL: 4 = 4
    +
  • Defined in src/common.ts:11
  • @@ -21,7 +21,7 @@

    Variable ICON_WIDTHConst

    +
  • Defined in src/common.ts:19
  • @@ -27,7 +27,7 @@

    Type declaration

    [key: string]: string[]
    +
  • Defined in src/common.ts:91
  • @@ -18,7 +18,7 @@

    Variable KEY_NODATAConst

    KEY_NODATA: "__not_found__" = "__not_found__"
    +
  • Defined in src/common.ts:86
  • @@ -26,7 +26,7 @@

    Type declaration

    [key: string]: string
    +
  • Defined in src/common.ts:123
  • @@ -21,7 +21,7 @@

    Variable RENDER_MAX_PREFETCHConst

    +
  • Defined in src/common.ts:26
  • @@ -21,7 +21,7 @@

    Variable RENDER_MIN_PREFETCHConst

    +
  • Defined in src/common.ts:28
  • @@ -21,7 +21,7 @@

    Variable RESERVED_TREE_SOURCE_KEYSConst

    +
  • Defined in src/common.ts:102
  • @@ -21,7 +21,7 @@

    Variable ROW_HEIGHTConst

    +
  • Defined in src/common.ts:15
  • @@ -22,7 +22,7 @@

    Variable TEST_IMGConst

    +
  • Defined in src/common.ts:32
  • @@ -22,7 +22,7 @@

    Variable TITLE_SPAN_PAD_YConst

    +
  • Defined in src/common.ts:24
  • @@ -30,7 +30,7 @@
    [
    [key: string]: string
    +
  • Defined in src/common.ts:40
  • @@ -18,7 +18,7 @@

    Variable MAX_INTConst

    MAX_INT: 9007199254740991 = 9007199254740991
    +
  • Defined in src/util.ts:23
  • @@ -26,7 +26,7 @@

    Type declaration

    [key: number]: string
    +
  • Defined in src/util.ts:14
  • @@ -21,7 +21,7 @@

    Variable isMacConst

    +
  • Defined in src/util.ts:26