- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
109 lines
4.1 KiB
TypeScript
109 lines
4.1 KiB
TypeScript
import Element from '../nodes/element/Element.js';
|
|
import NodeList from '../nodes/node/NodeList.js';
|
|
import Document from '../nodes/document/Document.js';
|
|
import DocumentFragment from '../nodes/document-fragment/DocumentFragment.js';
|
|
import ISelectorMatch from './ISelectorMatch.js';
|
|
import IHTMLElementTagNameMap from '../config/IHTMLElementTagNameMap.js';
|
|
import ISVGElementTagNameMap from '../config/ISVGElementTagNameMap.js';
|
|
/**
|
|
* Utility for query selection in an HTML element.
|
|
*
|
|
* @class QuerySelector
|
|
*/
|
|
export default class QuerySelector {
|
|
/**
|
|
* Finds elements based on a query selector.
|
|
*
|
|
* @param node Node to search in.
|
|
* @param selector Selector.
|
|
* @returns HTML elements.
|
|
*/
|
|
static querySelectorAll<K extends keyof IHTMLElementTagNameMap>(node: Element | Document | DocumentFragment, selector: K): NodeList<IHTMLElementTagNameMap[K]>;
|
|
/**
|
|
* Finds elements based on a query selector.
|
|
*
|
|
* @param node Node to search in.
|
|
* @param selector Selector.
|
|
* @returns HTML elements.
|
|
*/
|
|
static querySelectorAll<K extends keyof ISVGElementTagNameMap>(node: Element | Document | DocumentFragment, selector: K): NodeList<ISVGElementTagNameMap[K]>;
|
|
/**
|
|
* Finds elements based on a query selector.
|
|
*
|
|
* @param node Node to search in.
|
|
* @param selector Selector.
|
|
* @returns HTML elements.
|
|
*/
|
|
static querySelectorAll(node: Element | Document | DocumentFragment, selector: string): NodeList<Element>;
|
|
/**
|
|
* Finds an element based on a query selector.
|
|
*
|
|
* @param node Node to search in.
|
|
* @param selector Selector.
|
|
* @returns HTML element.
|
|
*/
|
|
static querySelector<K extends keyof IHTMLElementTagNameMap>(node: Element | Document | DocumentFragment, selector: K): IHTMLElementTagNameMap[K] | null;
|
|
/**
|
|
* Finds an element based on a query selector.
|
|
*
|
|
* @param node Node to search in.
|
|
* @param selector Selector.
|
|
* @returns HTML element.
|
|
*/
|
|
static querySelector<K extends keyof ISVGElementTagNameMap>(node: Element | Document | DocumentFragment, selector: K): ISVGElementTagNameMap[K] | null;
|
|
/**
|
|
* Finds an element based on a query selector.
|
|
*
|
|
* @param node Node to search in.
|
|
* @param selector Selector.
|
|
* @returns HTML element.
|
|
*/
|
|
static querySelector(node: Element | Document | DocumentFragment, selector: string): Element | null;
|
|
/**
|
|
* Checks if an element matches a selector and returns priority weight.
|
|
*
|
|
* @param element Element to match.
|
|
* @param selector Selector to match with.
|
|
* @param [options] Options.
|
|
* @param [options.ignoreErrors] Ignores errors.
|
|
* @returns Result.
|
|
*/
|
|
static matches(element: Element, selector: string, options?: {
|
|
ignoreErrors?: boolean;
|
|
}): ISelectorMatch | null;
|
|
/**
|
|
* Checks if a node matches a selector.
|
|
*
|
|
* @param element Target element.
|
|
* @param currentElement
|
|
* @param selectorItems Selector items.
|
|
* @param cachedItem Cached item.
|
|
* @param [previousSelectorItem] Previous selector item.
|
|
* @param [priorityWeight] Priority weight.
|
|
* @returns Result.
|
|
*/
|
|
private static matchSelector;
|
|
/**
|
|
* Finds elements based on a query selector for a part of a list of selectors separated with comma.
|
|
*
|
|
* @param rootElement Root element.
|
|
* @param children Child elements.
|
|
* @param selectorItems Selector items.
|
|
* @param cachedItem Cached item.
|
|
* @param [documentPosition] Document position of the element.
|
|
* @returns Document position and element map.
|
|
*/
|
|
private static findAll;
|
|
/**
|
|
* Finds an element based on a query selector for a part of a list of selectors separated with comma.
|
|
*
|
|
* @param rootElement Root element.
|
|
* @param children Child elements.
|
|
* @param selectorItems Selector items.
|
|
* @param cachedItem Cached item.
|
|
* @param [documentPosition] Document position of the element.
|
|
* @returns Document position and element map.
|
|
*/
|
|
private static findFirst;
|
|
}
|
|
//# sourceMappingURL=QuerySelector.d.ts.map
|