Upload files to "/"

This commit is contained in:
Sven Minio 2026-05-17 12:39:25 +02:00
commit 1fa6d558c7
149 changed files with 27987 additions and 0 deletions

50
dist/modules/dom/attributes.d.ts vendored Normal file
View file

@ -0,0 +1,50 @@
/**
* @file src/modules/dom/attributes.ts
* @version 2.1.1
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for getting and setting HTML attributes and properties (attr, data, val).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets an attribute from the first element or sets it for all elements in the selection.
* @example attr('href', 'https://example.com') => Sets the 'href' attribute to 'https://example.com' for all matched elements.
* @example attr('href') => Returns the 'href' attribute value of the first matched element.
* @param name The name of the attribute (e.g., 'href', 'data-id').
* @param value (Optional) The value to set. If undefined, acts as a getter.
* @returns The attribute value (string/null) when reading, or the jBase instance when writing.
*/
export declare function attr(this: jBase, name: string, value?: string): string | null | jBase;
/**
* * Gets the 'value' from the first form element or sets it for all elements. Supports Input, Textarea, and Select elements.
* @example val('Hello') => Sets the value of all matched form elements to 'Hello'.
* @example val() => Returns the value of the first matched form element.
* @param value (Optional) The value to set. If undefined, acts as a getter.
* @returns The current value as a string when reading, or the jBase instance when writing.
*/
export declare function val(this: jBase, value?: string): string | jBase;
/**
* * Removes an attribute from all elements in the selection.
* @example removeAttr('disabled') => Removes the 'disabled' attribute from all matched elements.
* @param name The name of the attribute to remove (e.g., 'disabled', 'readonly').
* @returns The jBase instance for chaining.
*/
export declare function removeAttr(this: jBase, name: string): jBase;
/**
* * Gets a property from the first element or sets it for all elements in the selection.
* * Useful for DOM properties that don't directly map to HTML attributes (like 'checked' or 'selectedIndex').
* @example prop('checked', true) => Sets the 'checked' property to true for all matched elements (e.g., checkboxes).
* @example prop('checked') => Returns the 'checked' property value of the first matched element.
* @example prop('selectedIndex', 2) => Sets the 'selectedIndex' property to 2 for all matched <select> elements.
* @param name The name of the property (e.g., 'checked', 'disabled').
* @param value (Optional) The value to set. If undefined, acts as a getter.
* @returns The property value when reading, or the jBase instance when writing.
*/
export declare function prop(this: jBase, name: string, value?: any): any | jBase;
//# sourceMappingURL=attributes.d.ts.map

1
dist/modules/dom/attributes.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAUrF;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAe/D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAK3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAYxE"}

46
dist/modules/dom/content.d.ts vendored Normal file
View file

@ -0,0 +1,46 @@
/**
* @file src/modules/dom/content.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for getting and setting element content (html, text, empty, replaceWith).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets the HTML content of the first element, or sets the HTML content of all matched elements.
* @example html() => Returns the innerHTML of the first element.
* @example html('<div>New</div>') => Sets safe HTML for all matched elements.
* @example html('<script>alert("Hi")</script>', { executeScripts: true }) => Injects and executes scripts.
* @param content The HTML string to set. If undefined, acts as a getter.
* @param options Security and execution options.
* @returns HTML string (getter) or the current jBase instance (setter).
*/
export declare function html(this: jBase, content?: string, options?: {
executeScripts?: boolean;
}): string | jBase;
/**
* * Gets the text content of the first element or sets it for all elements. Safe against XSS attacks.
* @example text('Hello World') => Sets the text content of all matched elements to 'Hello World'.
* @example text() => Returns the text content of the first matched element.
* @param content (Optional) The text content to set.
* @returns The text content (getter) or the current jBase instance (setter).
*/
export declare function text(this: jBase, content?: string): string | jBase;
/**
* * Loads HTML from a server and injects it into the matched elements.
* * This is now a clean wrapper around $.http.getText() and this.html().
* @example $('#content').load('/pages/about.html')
* @param url The URL to fetch the HTML from.
* @param options Fetch options extended with jBase specific settings (e.g., executeScripts).
* @returns A Promise resolving to the current jBase instance.
*/
export declare function load(this: jBase, url: string, options?: RequestInit & {
executeScripts?: boolean;
}): Promise<jBase>;
//# sourceMappingURL=content.d.ts.map

1
dist/modules/dom/content.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAmCnC;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,KAAK,CAmB1G;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAWlE;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAazH"}

83
dist/modules/dom/index.d.ts vendored Normal file
View file

@ -0,0 +1,83 @@
/**
* @file src/modules/dom/index.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Central entry point for DOM operations. Aggregates methods for attributes, content, manipulation, traversal, and states.
* @requires ./attributes
* * Attribute and value manipulation.
* @requires ./content
* * Content handling (html, text).
* @requires ./manipulation
* * DOM manipulation (append, remove, etc.).
* @requires ./traversal
* * Tree traversal (find, parent, children).
* @requires ./states
* * State checks (checked, disabled).
*/
/**
* * Aggregation of all DOM methods. Bundles specialized sub-modules into a single interface. Used to extend the jBase prototype centrally via Object.assign.
*/
export declare const domMethods: {
checked(this: import("../..").JBaseClass, state?: boolean): boolean | import("../..").JBaseClass;
selected(this: import("../..").JBaseClass, state?: boolean): boolean | import("../..").JBaseClass;
disabled(this: import("../..").JBaseClass, state?: boolean): boolean | import("../..").JBaseClass;
check(this: import("../..").JBaseClass): import("../..").JBaseClass;
uncheck(this: import("../..").JBaseClass): import("../..").JBaseClass;
select(this: import("../..").JBaseClass): import("../..").JBaseClass;
disable(this: import("../..").JBaseClass): import("../..").JBaseClass;
enable(this: import("../..").JBaseClass): import("../..").JBaseClass;
closest(this: import("../..").JBaseClass, selector: string): import("../..").JBaseClass;
parent(this: import("../..").JBaseClass): import("../..").JBaseClass;
children(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
findAll(this: import("../..").JBaseClass, selector: string): import("../..").JBaseClass;
descendants(this: import("../..").JBaseClass): import("../..").JBaseClass;
parents(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
parentsUntil(this: import("../..").JBaseClass, selector: string, filter?: string): import("../..").JBaseClass;
descendantsUntil(this: import("../..").JBaseClass, untilSelector: string, filter?: string): import("../..").JBaseClass;
next(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
prev(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
nextSibling(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
prevSibling(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
sibling(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
nextAll(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
prevAll(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
siblings(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
nextUntil(this: import("../..").JBaseClass, untilSelector: string, filter?: string): import("../..").JBaseClass;
prevUntil(this: import("../..").JBaseClass, untilSelector: string, filter?: string): import("../..").JBaseClass;
eq(this: import("../..").JBaseClass, index: number): import("../..").JBaseClass;
first(this: import("../..").JBaseClass): import("../..").JBaseClass;
last(this: import("../..").JBaseClass): import("../..").JBaseClass;
filterBy(this: import("../..").JBaseClass, selectorOrFn: string | ((index: number, element: Element) => boolean)): import("../..").JBaseClass;
not(this: import("../..").JBaseClass, selectorOrFn: string | ((index: number, element: Element) => boolean)): import("../..").JBaseClass;
remove(this: import("../..").JBaseClass): import("../..").JBaseClass;
empty(this: import("../..").JBaseClass): import("../..").JBaseClass;
replaceWithClone(this: import("../..").JBaseClass): import("../..").JBaseClass;
append(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
prepend(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
before(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
after(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
replaceWith(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
appendTo(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
prependTo(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
insertBefore(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
insertAfter(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
wrap(this: import("../..").JBaseClass, wrapperHtml: string): import("../..").JBaseClass;
unwrap(this: import("../..").JBaseClass): import("../..").JBaseClass;
html(this: import("../..").JBaseClass, content?: string, options?: {
executeScripts?: boolean;
}): string | import("../..").JBaseClass;
text(this: import("../..").JBaseClass, content?: string): string | import("../..").JBaseClass;
load(this: import("../..").JBaseClass, url: string, options?: RequestInit & {
executeScripts?: boolean;
}): Promise<import("../..").JBaseClass>;
attr(this: import("../..").JBaseClass, name: string, value?: string): string | null | import("../..").JBaseClass;
val(this: import("../..").JBaseClass, value?: string): string | import("../..").JBaseClass;
removeAttr(this: import("../..").JBaseClass, name: string): import("../..").JBaseClass;
prop(this: import("../..").JBaseClass, name: string, value?: any): any | import("../..").JBaseClass;
};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/dom/index.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAMimC,CAAC;;;;sBAAo2D,CAAC;;;;;;CAA79F,CAAC"}

111
dist/modules/dom/manipulation.d.ts vendored Normal file
View file

@ -0,0 +1,111 @@
/**
* @file src/modules/dom/manipulation.ts
* @version 2.0.4
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for inserting, moving, and removing elements (append, prepend, remove).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires src/utils
* * Depends on utility functions (e.g., each).
*/
import { jBase } from '../../core';
/**
* * Removes the selected elements from the DOM.
* @example remove() => Removes all matched elements from the DOM.
* @returns The current jBase instance.
*/
export declare function remove(this: jBase): jBase;
/**
* * Removes all child nodes and text content from the selected elements.
* @example empty() => Empties the content of all matched elements, leaving them in the DOM.
* @returns The current jBase instance.
*/
export declare function empty(this: jBase): jBase;
/**
* * Replaces each element with a deep clone of itself. Useful for removing all event listeners ("Nuke" strategy).
* @example replaceWithClone() => Replaces each matched element with a clone, effectively removing all event listeners.
* @returns A new jBase instance containing the cloned elements.
*/
export declare function replaceWithClone(this: jBase): jBase;
/**
* * Inserts content at the end of each selected element (inside).
* @example append('<span>New</span>') => Appends a new <span> element to the end of each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function append(this: jBase, content: string | Node | jBase): jBase;
/**
* * Inserts content at the beginning of each selected element (inside).
* @example prepend('<span>New</span>') => Prepends a new <span> element to the beginning of each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function prepend(this: jBase, content: string | Node | jBase): jBase;
/**
* * Inserts content before the element (outside).
* @example before('<div>New</div>') => Inserts a new <div> element immediately before each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function before(this: jBase, content: string | Node | jBase): jBase;
/**
* * Inserts content after the element (outside).
* @example after('<div>New</div>') => Inserts a new <div> element immediately after each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function after(this: jBase, content: string | Node | jBase): jBase;
/**
* * Replaces the element with new content.
* @example replaceWith('<div>New</div>') => Replaces each matched element with a new <div> element.
* @param content The new content.
* @returns The current jBase instance.
*/
export declare function replaceWith(this: jBase, content: string | Node | jBase): jBase;
/**
* * Appends the selected elements to the end of a target element.
* @example appendTo('#container') => Appends all matched elements to the element with id 'container'.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function appendTo(this: jBase, target: string | Element): jBase;
/**
* * Prepends the selected elements to the beginning of a target element.
* @example prependTo('#container') => Prepends all matched elements to the element with id 'container', before its existing content.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function prependTo(this: jBase, target: string | Element): jBase;
/**
* * Inserts the selected elements immediately before the target element.
* @example insertBefore('#target') => Inserts all matched elements immediately before the element with id 'target'.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function insertBefore(this: jBase, target: string | Element): jBase;
/**
* * Inserts the selected elements immediately after the target element.
* @example insertAfter('#target') => Inserts all matched elements immediately after the element with id 'target'.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function insertAfter(this: jBase, target: string | Element): jBase;
/**
* * Wraps each selected element with the specified HTML structure.
* @example wrap('<div class="box"></div>') => Wraps each matched element with a <div class="box"></div> element.
* @param wrapperHtml HTML string defining the wrapper (e.g., `<div class="box"></div>`).
* @returns The current jBase instance.
*/
export declare function wrap(this: jBase, wrapperHtml: string): jBase;
/**
* * Removes the direct parent of the selected elements from the DOM.
* * @example unwrap() => Removes the parent element of each matched element, effectively "unwrapping" it from its container.
* @returns The current jBase instance.
*/
export declare function unwrap(this: jBase): jBase;
//# sourceMappingURL=manipulation.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"manipulation.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/manipulation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA6DnC;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAKzC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAKxC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAUnD;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GA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* @file src/modules/dom/states.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for checking element states (e.g., visibility, checked, disabled).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets or sets the 'checked' state of checkboxes and radio buttons.
* @example checked() => Gets the checked state of the first matched element.
* @example checked(true) => Checks the first matched element.
* @param state (Optional) `true` to check, `false` to uncheck. If undefined, acts as a getter.
* @returns Boolean (getter) or the current jBase instance (setter).
*/
export declare function checked(this: jBase, state?: boolean): boolean | jBase;
/**
* * Gets or sets the 'selected' state of `<option>` elements.
* @example selected() => Gets the selected state of the first matched option element.
* @example selected(true) => Selects the first matched option element.
* @param state (Optional) `true` to select, `false` to deselect. If undefined, acts as a getter.
* @returns Boolean (getter) or the current jBase instance (setter).
*/
export declare function selected(this: jBase, state?: boolean): boolean | jBase;
/**
* * Enables or disables form fields and buttons. Additionally toggles the CSS class `.disabled`.
* @example disabled() => Gets the disabled state of the first matched element.
* @example disabled(true) => Disables the first matched element.
* @param state (Optional) `true` to disable, `false` to enable. If undefined, acts as a getter.
* @returns Boolean (getter) or the current jBase instance (setter).
*/
export declare function disabled(this: jBase, state?: boolean): boolean | jBase;
/**
* * ALIAS for .checked(true). Checks the matched elements.
* @example check() => Checks all matched checkboxes/radio buttons.
* @returns The current jBase instance.
*/
export declare function check(this: jBase): jBase;
/**
* * ALIAS for .checked(false). Unchecks the matched elements.
* @example uncheck() => Unchecks all matched checkboxes/radio buttons.
* @returns The current jBase instance.
*/
export declare function uncheck(this: jBase): jBase;
/**
* * ALIAS for .selected(true). Selects the matched <option> elements.
* @example select() => Selects all matched option elements.
* @returns The current jBase instance.
*/
export declare function select(this: jBase): jBase;
/**
* * ALIAS for .disabled(true). Disables the matched elements and adds the 'disabled' class.
* @example disable() => Disables all matched elements.
* @returns The current jBase instance.
*/
export declare function disable(this: jBase): jBase;
/**
* * ALIAS for .disabled(false). Enables the matched elements and removes the 'disabled' class.
* @example enable() => Enables all matched elements.
* @returns The current jBase instance.
*/
export declare function enable(this: jBase): jBase;
//# sourceMappingURL=states.d.ts.map

1
dist/modules/dom/states.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"states.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/states.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAUrE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAUtE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAetE;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAExC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAEzC"}

184
dist/modules/dom/traversal.d.ts vendored Normal file
View file

@ -0,0 +1,184 @@
/**
* @file src/modules/dom/traversal.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for navigating the DOM tree (find, parent, children, siblings).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires ../../utils
* * Utility functions (e.g., `each` for iteration).
*/
import { jBase } from '../../core';
/**
* * Traverses the parents (heading toward the document root) of each element and finds the first element that matches the specified selector.
* @example closest('.container') => For each matched element, finds the nearest ancestor with the class 'container'.
* @param selector A string containing a selector expression.
* @returns A new jBase instance containing the matched elements.
*/
export declare function closest(this: jBase, selector: string): jBase;
/**
* * Gets the direct parent of each element in the current set. Deduplicates results.
* @example parent() => Returns a new jBase instance containing the parent elements of all matched elements, without duplicates.
* @returns A new jBase instance containing the parent elements.
*/
export declare function parent(this: jBase): jBase;
/**
* * Gets the direct children of each element in the set, optionally filtered by a selector.
* @example children() => Returns a new jBase instance containing all direct children of the matched elements.
* @example children('.item') => Returns a new jBase instance containing only the direct children that match the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance containing the children.
*/
export declare function children(this: jBase, selector?: string): jBase;
/**
* * Finds descendants (deep) that match the selector using `querySelectorAll`.
* @example findAll('.item') => Returns a new jBase instance containing all descendant elements that match the selector '.item'.
* @param selector The CSS selector to search for.
* @returns A new jBase instance with the found elements.
*/
export declare function findAll(this: jBase, selector: string): jBase;
/**
* * Recursively gets ALL descendants (not just direct children).
* @example descendants() => Returns a new jBase instance containing all descendant elements of the matched elements.
* @returns A new jBase instance with all descendants.
*/
export declare function descendants(this: jBase): jBase;
/**
* * Gets all ancestors (parents, grandparents...) up to the root. Optionally filtered.
* @example parents() => Returns a new jBase instance containing all ancestors of the matched elements, without duplicates.
* @example parents('.container') => Returns a new jBase instance containing only the ancestors that match the selector '.container'.
* @param selector (Optional) Filter selector for ancestors.
* @returns A new jBase instance with the ancestors.
*/
export declare function parents(this: jBase, selector?: string): jBase;
/**
* * Gets all ancestors UP TO (but not including) an element matching the selector.
* @example parentsUntil('.container') => Returns a new jBase instance containing all ancestors of the matched elements up to (but not including) the nearest ancestor that matches '.container'.
* @example parentsUntil('.container', '.item') => Returns a new jBase instance containing ancestors up to '.container' that also match '.item'.
* @param selector The selector where traversal stops.
* @param filter (Optional) Filter for the collected elements.
* @returns A new jBase instance.
*/
export declare function parentsUntil(this: jBase, selector: string, filter?: string): jBase;
/**
* * Recursively finds descendants but stops traversing a branch if `untilSelector` is met. Useful for finding nested elements without going too deep (e.g., nested forms).
* @example descendantsUntil('.stop-here') => Returns a new jBase instance containing all descendant elements of the matched elements, but does not include any elements that are descendants of an element matching '.stop-here'.
* @example descendantsUntil('.stop-here', '.item') => Returns a new jBase instance containing descendant elements that match '.item', but does not include any elements that are descendants of an element matching '.stop-here'.
* @param untilSelector The selector that stops recursion in a branch.
* @param filter (Optional) Selector to filter collected elements.
* @returns A new jBase instance.
*/
export declare function descendantsUntil(this: jBase, untilSelector: string, filter?: string): jBase;
/**
* * Gets the immediately following sibling.
* @example next() => Returns a new jBase instance containing the immediately following sibling of each matched element.
* @example next('.item') => Returns a new jBase instance containing the immediately following sibling that matches the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function next(this: jBase, selector?: string): jBase;
/**
* * Gets the immediately preceding sibling.
* @example prev() => Returns a new jBase instance containing the immediately preceding sibling of each matched element.
* @example prev('.item') => Returns a new jBase instance containing the immediately preceding sibling that matches the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function prev(this: jBase, selector?: string): jBase;
/**
* * Alias for `next()`.
*/
export declare function nextSibling(this: jBase, selector?: string): jBase;
/**
* * Alias for `prev()`.
*/
export declare function prevSibling(this: jBase, selector?: string): jBase;
/**
* * Alias for `next()`.
*/
export declare function sibling(this: jBase, selector?: string): jBase;
/**
* * Gets ALL following siblings.
* @example nextAll() => Returns a new jBase instance containing all following siblings of each matched element.
* @example nextAll('.item') => Returns a new jBase instance containing all following siblings that match the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function nextAll(this: jBase, selector?: string): jBase;
/**
* * Gets ALL preceding siblings.
* @example prevAll() => Returns a new jBase instance containing all preceding siblings of each matched element.
* @example prevAll('.item') => Returns a new jBase instance containing all preceding siblings that match the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function prevAll(this: jBase, selector?: string): jBase;
/**
* * Gets ALL siblings (previous and next), excluding itself.
* @example siblings() => Returns a new jBase instance containing all siblings of each matched element, without duplicates.
* @example siblings('.item') => Returns a new jBase instance containing all siblings that match the selector '.item', without duplicates.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function siblings(this: jBase, selector?: string): jBase;
/**
* * Gets all following siblings UNTIL a selector is met (exclusive).
* @example nextUntil('.stop-here') => Returns a new jBase instance containing all following siblings of the matched elements up to (but not including) the nearest sibling that matches '.stop-here'.
* @example nextUntil('.stop-here', '.item') => Returns a new jBase instance containing following siblings that match '.item' up to (but not including) the nearest sibling that matches '.stop-here'.
* @param untilSelector The selector that stops the search.
* @param filter (Optional) Filter for the found elements.
* @returns A new jBase instance.
*/
export declare function nextUntil(this: jBase, untilSelector: string, filter?: string): jBase;
/**
* * Gets all preceding siblings UNTIL a selector is met (exclusive).
* @example prevUntil('.stop-here') => Returns a new jBase instance containing all preceding siblings of the matched elements up to (but not including) the nearest sibling that matches '.stop-here'.
* @example prevUntil('.stop-here', '.item') => Returns a new jBase instance containing preceding siblings that match '.item' up to (but not including) the nearest sibling that matches '.stop-here'.
* @param untilSelector The selector that stops the search.
* @param filter (Optional) Filter for the found elements.
* @returns A new jBase instance.
*/
export declare function prevUntil(this: jBase, untilSelector: string, filter?: string): jBase;
/**
* * Reduces the set to the element at the specified index. Supports negative indices.
* @example eq(0) => Returns a new jBase instance containing only the first element of the matched set.
* @example eq(-1) => Returns a new jBase instance containing only the last element of the matched set.
* @param index The position (0-based). Negative values count from the end.
* @returns A new jBase instance containing the single element (or empty).
*/
export declare function eq(this: jBase, index: number): jBase;
/**
* * Reduces the set of matched elements to the first one in the collection.
* @example first() => Returns a new jBase instance containing only the first element of the matched set.
* @param selector (Optional) Filter selector to find the first matching element.
* @returns A new jBase instance containing only the first element, allowing for further method chaining.
*/
export declare function first(this: jBase): jBase;
/**
* * Reduces the set of matched elements to the final one in the collection.
* @example last() => Returns a new jBase instance containing only the last element of the matched set.
* @returns A new jBase instance containing only the last element, allowing for further method chaining.
*/
export declare function last(this: jBase): jBase;
/**
* * Filters elements based on a selector or a function.
* @example filterBy('.active') => Returns a new jBase instance containing only the elements that match the selector '.active'.
* @example filterBy((index, el) => el.textContent.includes('Hello')) => Returns a new jBase instance containing only the elements for which the function returns true.
* @param selectorOrFn CSS selector string or filter function.
* @returns A new jBase instance with filtered elements.
*/
export declare function filterBy(this: jBase, selectorOrFn: string | ((index: number, element: Element) => boolean)): jBase;
/**
* * Removes elements from the set that match the selector or function (Inverse of filterBy).
* @example not('.active') => Returns a new jBase instance containing only the elements that do NOT match the selector '.active'.
* @example not((index, el) => el.textContent.includes('Hello')) => Returns a new jBase instance containing only the elements for which the function returns false.
* @param selectorOrFn CSS selector string or filter function.
* @returns A new jBase instance with remaining elements.
*/
export declare function not(this: jBase, selectorOrFn: string | ((index: number, element: Element) => boolean)): jBase;
//# sourceMappingURL=traversal.d.ts.map

1
dist/modules/dom/traversal.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/traversal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAc5D;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CASzC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,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