import { MaskitoOptions, Maskito } from '@maskito/core'; import { MaskitoNumberParams, MaskitoDateParams, MaskitoTimeParams } from '@maskito/kit'; import Quill from 'quill'; import { SweetAlertOptions, SweetAlertResult } from 'sweetalert2'; import { InputMask, MaskedNumberOptions } from 'imask'; import PickrCtor from '@simonwep/pickr'; import AirDatepickerCtor from 'air-datepicker'; import * as FilePondNS from 'filepond'; import TomSelectCtor from 'tom-select'; import { TomSettings } from 'tom-select/dist/esm/types/settings.js'; import { RecursivePartial } from 'tom-select/dist/esm/types/core.js'; import * as Jspreadsheet from 'kspreadsheet'; import Jspreadsheet__default from 'kspreadsheet'; import { HelperDelegate } from 'handlebars'; /** * Base options for component initialization. */ interface BaseOptions$1 { } type MElement = HTMLElement | Element; type InitElements = NodeListOf | HTMLCollectionOf; type ComponentConstructor, O extends BaseOptions$1> = { new (el: HTMLElement, options: Partial): T; }; type ComponentType, O extends BaseOptions$1> = ComponentConstructor & typeof Component; interface I18nOptions { cancel: string; clear: string; done: string; } interface Openable { isOpen: boolean; open(): void; close(): void; } /** * Base class implementation for Materialize components. */ declare class Component { /** * The DOM element the plugin was initialized with. */ el: HTMLElement; /** * The options the instance was initialized with. */ options: O; /** * Constructs component instance and set everything up. */ constructor(el: HTMLElement, options: Partial, classDef: ComponentType, O>); /** * Initializes component instance. * @param el HTML element. * @param options Component options. * @param classDef Class definition. */ protected static init>(el: I, options: O, classDef: ComponentType): C; /** * Initializes component instances. * @param els HTML elements. * @param options Component options. * @param classDef Class definition. */ protected static init>(els: InitElements, options: Partial, classDef: ComponentType): C[]; /** * Initializes component instances. * @param els HTML elements. * @param options Component options. * @param classDef Class definition. */ protected static init>(els: I | InitElements, options: Partial, classDef: ComponentType): C | C[]; /** * @returns default options for component instance. */ static get defaults(): BaseOptions$1; /** * Retrieves component instance for the given element. * @param el Associated HTML Element. */ static getInstance(el: HTMLElement): Component; /** * Destroy plugin instance and teardown. */ destroy(): void; } type TinyNavbarPosition = 'inline' | 'top' | 'bottom'; interface TinyNavbarOptions extends BaseOptions$1 { position: TinyNavbarPosition; dismissible: boolean; closeLabel: string; /** Optional control to focus after closing from inside the navbar. */ returnFocus: HTMLElement | null; onClose: ((navbar: TinyNavbar) => void) | null; } /** Compact navigation or announcement bar, optionally fixed to either viewport edge. */ declare class TinyNavbar extends Component { private _closeButton; private _originalClasses; private _originalHidden; private static _classes; constructor(el: HTMLElement, options?: Partial); static get defaults(): TinyNavbarOptions; static init(el: HTMLElement, options?: Partial): TinyNavbar; static init(els: InitElements, options?: Partial): TinyNavbar[]; static getInstance(el: HTMLElement): TinyNavbar; private static _validatePosition; get isOpen(): boolean; getPosition(): TinyNavbarPosition; setPosition(position: TinyNavbarPosition): void; open(): void; close: () => void; destroy(): void; } interface NavbarAutoHideOptions extends BaseOptions$1 { /** Null watches the page. Supply an element for an independently scrolling panel. */ scrollTarget: HTMLElement | null; /** Accumulated pixels in one direction before changing visibility. */ tolerance: number; /** Keep the navbar visible within this many pixels of the top. */ offset: number; } /** A sticky navbar that hides going down and returns going up. */ declare class NavbarAutoHide extends Component { private _target; private _events; private _frame; private _last; private _distance; private _direction; private _originalClasses; constructor(el: HTMLElement, options?: Partial); static get defaults(): NavbarAutoHideOptions; static init(el: HTMLElement, options?: Partial): NavbarAutoHide; static init(els: InitElements, options?: Partial): NavbarAutoHide[]; static getInstance(el: HTMLElement): NavbarAutoHide; private _position; private _reset; private _schedule; private _update; destroy(): void; } interface OtpInputOptions extends BaseOptions$1 { /** Number of editable slots (1–32); inferred when pattern is supplied. */ length?: number; characters?: 'digits' | 'alphanumeric'; /** Horizontal alignment of the code within its container. Defaults to center. */ align?: 'left' | 'center' | 'right'; /** # = digit, A = ASCII letter, * = alphanumeric; backslash escapes literals. */ pattern?: string; /** Maskito processing and overwrite behavior. The slot pattern owns the mask. */ maskOptions?: Partial>; /** Visually group slots without adding separators to the submitted value. */ groupSize?: number; /** Hide entered characters, using a native password input. */ masked?: boolean; onComplete?: (value: string, instance: OtpInput) => void; } /** A single accessible native input, rendered as Material OTP/PIN slots. Requires @maskito/core. */ declare class OtpInput extends Component { el: HTMLInputElement; ready: Promise; private _mask?; private _wrapper?; private _cells; private _slots; private _attributes; private _observer?; private _form; private _resetTimer?; private _destroyed; private _lastComplete; private _hadClass; constructor(el: HTMLInputElement, options?: Partial); static get defaults(): OtpInputOptions; static init(el: HTMLInputElement, options?: Partial): OtpInput; static init(els: InitElements, options?: Partial): OtpInput[]; static getInstance(el: HTMLInputElement): OtpInput; private static _markup; private _setAttribute; private _setup; getValue(): string; /** Editable characters only; pattern separators are omitted. */ getUnmaskedValue(): string; isComplete(): boolean; setValue(value: string, emit?: boolean): Promise; clear(emit?: boolean): Promise; refresh(): Promise; focus(): void; private _onInput; private _onSelection; private _onInvalid; private _onReset; private _onPointerDown; private _render; destroy(): void; } interface MaskitoInputOptions extends BaseOptions$1 { preset?: 'pattern' | 'number' | 'date' | 'time'; /** # = digit, A = ASCII letter, * = alphanumeric. Backslash escapes literals. */ pattern?: string; number?: MaskitoNumberParams; date?: MaskitoDateParams; time?: MaskitoTimeParams; /** Native Maskito options, including regex/dynamic masks, processors and plugins. */ maskOptions?: Partial; } /** Optional Maskito enhancement for native text inputs. */ declare class MaskitoInput extends Component { el: HTMLInputElement; mask?: Maskito; ready: Promise; private _core?; private _maskOptions?; private _destroyed; private _form; private _resetTimer?; constructor(el: HTMLInputElement, options: Partial); static get defaults(): MaskitoInputOptions; static init(el: HTMLInputElement, options?: Partial): MaskitoInput; static init(els: InitElements, options?: Partial): MaskitoInput[]; static getInstance(el: HTMLInputElement): MaskitoInput; private static _readMarkup; private _options; private _setup; /** Set and format a value, emitting a normal input event by default. */ setValue(value: string, emit?: boolean): Promise; /** Normalize a value assigned through input.value without emitting input. */ refresh(): Promise; /** The native, formatted string. Use Maskito kit parsers for typed values. */ getValue(): string; private _onReset; destroy(): void; } type ToolbarItem = string | Record; interface RichTextareaOptions extends BaseOptions$1 { /** Native textarea serialization. HTML preserves formatting; text stores plain text. */ valueFormat?: 'html' | 'text'; toolbar?: false | Array; formats?: string[]; placeholder?: string; /** Default font stack for editor content; load any web fonts separately. */ fontFamily?: string; label?: string; } /** Quill enhancement of a native textarea, including form value synchronization. */ declare class RichTextarea extends Component { el: HTMLTextAreaElement; quill?: Quill; ready: Promise; private _wrapper?; private _error?; private _observer?; private _form; private _labels; private _labelIds; private _hidden; private _ariaHidden; private _destroyed; private _updating; private _dirty; private _invalid; private _lastValue; private _resetTimer?; private _blurTimer?; constructor(el: HTMLTextAreaElement, options: Partial); static get defaults(): RichTextareaOptions; static init(el: HTMLTextAreaElement, options?: Partial): RichTextarea; static init(els: InitElements, options?: Partial): RichTextarea[]; static getInstance(el: HTMLTextAreaElement): RichTextarea; private _setup; private _labelToolbar; /** Refresh native value, state and accessible labels after programmatic changes. */ refresh(): void; /** Set serialized content. Call after ready to update both editor and textarea. */ setValue(value: string, emit?: boolean): void; getValue(): string; getHTML(): string; getText(): string; focus(): void; private _isEmpty; private _sync; private _updateValidity; private _onTextChange; private _onNativeInput; private _onLabelClick; private _onInvalid; private _onBlur; private _onReset; destroy(): void; } /** Display source code with optional syntax highlighting and clipboard controls. */ interface CodeCardOptions extends BaseOptions$1 { code: string; language: string; title: string; copy: boolean; highlight: boolean; copyLabel: string; copiedLabel: string; errorLabel: string; } /** A themed code card. Source text is never executed or interpreted as markup. */ declare class CodeCard extends Component { ready: Promise; private _prism?; private _originalNodes; private _addedClasses; private _code; private _pre; private _button; private _status; private _timer; private _copying; private _destroyed; private _revision; constructor(el: HTMLElement, options?: Partial); static get defaults(): CodeCardOptions; static init(el: HTMLElement, options?: Partial): CodeCard; static init(els: InitElements, options?: Partial): CodeCard[]; static getInstance(el: HTMLElement): CodeCard; /** Update content, language, title, or the optional copy control. */ update(options: Partial): Promise; getCode(): string; /** Copy the original source, preserving whitespace and excluding UI labels. */ copy(): Promise; /** Restore the authored markup and remove component-owned listeners. */ destroy(): void; private _onCopy; private _createElements; private _setCopyFeedback; private _render; } interface DropdownOptions extends BaseOptions$1 { /** * Defines the edge the menu is aligned to. * @default 'left' */ alignment: 'left' | 'right'; /** * If true, automatically focus dropdown el for keyboard. * @default true */ autoFocus: boolean; /** * If true, constrainWidth to the size of the dropdown activator. * @default true */ constrainWidth: boolean; /** * Provide an element that will be the bounding container of the dropdown. * @default null */ container: Element; /** * If false, the dropdown will show below the trigger. * @default true */ coverTrigger: boolean; /** * If true, close dropdown on item click. * @default true */ closeOnClick: boolean; /** * If true, the dropdown will open on hover. * @default false */ hover: boolean; /** * The duration of the transition enter in milliseconds. * @default 150 */ inDuration: number; /** * The duration of the transition out in milliseconds. * @default 250 */ outDuration: number; /** * Function called when dropdown starts entering. * @default null */ onOpenStart: (el: HTMLElement) => void; /** * Function called when dropdown finishes entering. * @default null */ onOpenEnd: (el: HTMLElement) => void; /** * Function called when dropdown starts exiting. * @default null */ onCloseStart: (el: HTMLElement) => void; /** * Function called when dropdown finishes exiting. * @default null */ onCloseEnd: (el: HTMLElement) => void; /** * Function called when item is clicked. * @default null */ onItemClick: (el: HTMLLIElement) => void; } declare class Dropdown extends Component implements Openable { static _dropdowns: Dropdown[]; /** ID of the dropdown element. */ id: string; /** The DOM element of the dropdown. */ dropdownEl: HTMLElement; /** If the dropdown is open. */ isOpen: boolean; /** If the dropdown content is scrollable. */ isScrollable: boolean; isTouchMoving: boolean; /** The index of the item focused. */ focusedIndex: number; filterQuery: string[]; filterTimeout: NodeJS.Timeout | number; /** Timers owned by the current opening or closing animation. */ private _animationTimers; /** Delay before opening a submenu with the pointer. */ private _submenuTimer; /** Whether this opening should transfer keyboard focus. */ private _focusOnOpen; constructor(el: HTMLElement, options: Partial); static get defaults(): DropdownOptions; /** * Initializes instance of Dropdown. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Dropdown; /** * Initializes instances of Dropdown. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Dropdown[]; static getInstance(el: HTMLElement): Dropdown; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _setupTemporaryEventHandlers(): void; _removeTemporaryEventHandlers(): void; _handleClick: (e: MouseEvent) => void; _handleMouseEnter: () => void; _handleMouseLeave: (e: MouseEvent) => void; private _handleMenuPointerOver; private _handleMenuPointerLeave; private _handleAncestorScroll; _handleDocumentClick: (e: MouseEvent) => void; _handleTriggerKeydown: (e: KeyboardEvent) => void; _handleDocumentTouchmove: (e: TouchEvent) => void; _handleDropdownClick: (e: MouseEvent) => void; _handleDropdownKeydown: (e: KeyboardEvent) => void; _handleWindowResize: () => void; _resetFilterQuery: () => void; _resetDropdownStyles(): void; _resetDropdownPositioningStyles(): void; _moveDropdownToElement(containerEl?: HTMLElement): void; /** Resolve the owning menu from the trigger, even if its popup is portalled. */ private _getParentDropdown; /** Resolve direct child instances. */ private _getChildren; /** Resolve a row's registered submenu trigger. */ private _getSubmenu; /** Check whether a row can receive keyboard focus. */ private _isAvailable; /** Include descendant popups when testing pointer containment. */ private _contains; /** Open or refocus a child from keyboard navigation. */ private _openChild; /** Cancel callbacks from a previous animation. */ private _clearAnimationTimers; /** Place a submenu beside its parent and keep it in the viewport. */ private _placeSubmenu; _makeDropdownFocusable(): void; _focusFocusedItem(): void; _getDropdownPosition(closestOverflowParent: HTMLElement): { x: number; y: number; verticalAlignment: string; horizontalAlignment: "left" | "right"; height: number; width: number; }; _animateIn(): void; _animateOut(): void; private _getClosestAncestor; _placeDropdown(): void; /** * Open dropdown. */ open: () => void; /** Close this menu and its descendants, restoring the trigger focus. */ close: () => void; /** Close descendants without repeatedly moving focus through the tree. */ private _close; /** * While dropdown is open, you can recalculate its dimensions if its contents have changed. */ recalculateDimensions: () => void; } interface AutocompleteData { /** * A primitive value that can be converted to string. * If "text" is not provided, it will also be used as "option text" as well */ id: string | number; /** * This optional attribute is used as "display value" for the current entry. * When provided, it will also be taken into consideration by the standard search function. */ text?: string; /** * This optional attribute is used to provide a valid image URL to the current option. */ image?: string; /** * Optional attributes which describes the option. */ description?: string; } interface AutocompleteOptions extends BaseOptions$1 { /** * Data object defining autocomplete options with * optional icon strings. */ data: AutocompleteData[]; /** * Flag which can be set if multiple values can be selected. The Result will be an Array. * @default false */ isMultiSelect: boolean; /** * Callback for when autocompleted. */ onAutocomplete: (entries: AutocompleteData[]) => void; /** * Minimum number of characters before autocomplete starts. * @default 1 */ minLength: number; /** * The height of the Menu which can be set via css-property. * @default '300px' */ maxDropDownHeight: string; /** * Function is called when the input text is altered and data can also be loaded asynchronously. * If the results are collected the items in the list can be updated via the function setMenuItems(collectedItems). * @param text Searched text. * @param autocomplete Current autocomplete instance. */ onSearch: (text: string, autocomplete: Autocomplete) => void; /** * If true will render the key from each item directly as HTML. * User input MUST be properly sanitized first. * @default false */ allowUnsafeHTML: boolean; /** * Pass options object to select dropdown initialization. * @default {} */ dropdownOptions: Partial; /** * Predefined selected values */ selected: number[] | string[]; } declare class Autocomplete extends Component { el: HTMLInputElement; /** If the autocomplete is open. */ isOpen: boolean; /** Number of matching autocomplete options. */ count: number; /** Index of the current selected option. */ activeIndex: number; private oldVal; private $active; private _mousedown; container: HTMLElement; /** Instance of the dropdown plugin for this autocomplete. */ dropdown: Dropdown; static _keydown: boolean; selectedValues: AutocompleteData[]; menuItems: AutocompleteData[]; data: AutocompleteData[]; constructor(el: HTMLInputElement, options: Partial); static get defaults(): AutocompleteOptions; /** * Initializes instance of Autocomplete. * @param el HTML element. * @param options Component options. */ static init(el: HTMLInputElement, options?: Partial): Autocomplete; /** * Initializes instances of Autocomplete. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Autocomplete[]; static getInstance(el: HTMLElement): Autocomplete; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _setupDropdown(): void; _removeDropdown(): void; _handleInputBlur: () => void; _handleInputKeyup: (e: KeyboardEvent) => void; _handleInputFocus: () => void; _inputChangeDetection: (value: string) => void; _handleInputKeydown: (e: KeyboardEvent) => void; _handleInputClick: () => void; _handleContainerMousedownAndTouchstart: () => void; _handleContainerMouseupAndTouchend: () => void; _resetCurrentElementPosition(): void; _resetAutocomplete(): void; _highlightPartialText(input: string, label: string): string[]; _createDropdownItem(entry: AutocompleteData): HTMLLIElement; _renderDropdown(): void; _setStatusLoading(): void; _updateSelectedInfo(): void; _refreshInputText(): void; _triggerChanged(): void; /** * Show autocomplete. */ open: () => void; /** * Hide autocomplete. */ close: () => void; /** * Updates the visible or selectable items shown in the menu. * @param menuItems Items to be available. * @param selected Selected item ids * @param open Option to conditionally open dropdown * @param initial Condition to set initial data */ setMenuItems(menuItems: AutocompleteData[], selected?: number[] | string[], open?: boolean, initial?: boolean): void; /** * Sets selected values. * @deprecated @see https://github.com/materializecss/materialize/issues/552 * @param entries */ setValues(entries: AutocompleteData[]): void; /** * Select a specific autocomplete option via id-property. * @param id The id of a data-entry. */ selectOption(id: number | string): void; selectOptions(ids: []): void; } interface PopupStepConfirmationOptions { /** Custom DOM content. Insert user-provided text using textContent. */ content: HTMLElement; confirmButtonText?: string; /** Read and validate the content. Throw an Error to stay on this step. */ readValue(): T | Promise; } interface PopupStepContext { /** Aborted when the popup closes. Pass this signal to fetch or other work. */ signal: AbortSignal; /** Results from completed steps, in order. */ results: readonly T[]; /** Update the active step's plain-text progress message. */ setMessage(message: string): void; /** Pause for user confirmation. Rejected when the popup closes. */ waitForConfirmation(options: PopupStepConfirmationOptions): Promise; } interface PopupStep { title: string; description?: string; run(context: PopupStepContext): T | Promise; } interface PopupStepsOptions { title: string; description?: string; steps: readonly PopupStep[]; /** Allow cancellation while working. Defaults to true. */ cancellable?: boolean; cancelButtonText?: string; doneButtonText?: string; retryButtonText?: string; } type PopupOptions = SweetAlertOptions; type PopupResult = SweetAlertResult; /** Materialize-themed SweetAlert2 dialogs. No element initialization is needed. */ declare class Popup { /** Fresh defaults so per-dialog customization cannot affect later popups. */ static get defaults(): PopupOptions; private static _load; /** Open a dialog and resolve with SweetAlert2's confirmation/dismissal result. */ static fire(options?: PopupOptions): Promise>>; /** Run async steps in order, with progress, cancellation and failed-step retry. */ static steps(options: PopupStepsOptions): Promise>; /** Confirm the current dialog, including its validation and preConfirm flow. */ static clickConfirm(): Promise; /** Close the current SweetAlert2 dialog, resolving its pending result. */ static close(): Promise; } interface LoadingOptions extends BaseOptions$1 { /** Start animating immediately. */ active: boolean; /** Accessible status while work is in progress. */ label: string; /** Accessible status when work has finished. */ completeLabel: string; } /** A circular loading indicator with an optional centered logo or icon. */ declare class Loading extends Component { private _originalAttributes; private _originalActive; private _originalLoading; private _generatedSpinner; constructor(el: HTMLElement, options?: Partial); static get defaults(): LoadingOptions; static init(el: HTMLElement, options?: Partial): Loading; static init(els: InitElements, options?: Partial): Loading[]; static getInstance(el: HTMLElement): Loading; get isActive(): boolean; /** Show the animated ring and announce the loading status. */ start(label?: string): void; /** Hide the ring, keeping the centered content visible. */ stop(label?: string): void; /** Restore the original markup state and remove the instance. */ destroy(): void; } interface AlertOptions extends BaseOptions$1 { /** Automatically wire a `.alert-close` button when present. */ dismissible: boolean; /** Called after the alert is dismissed. */ onDismiss?: (alert: Alert) => void; } /** A persistent, contextual feedback banner. */ declare class Alert extends Component { private _closeButton; private _onClose; constructor(el: HTMLElement, options: Partial); static get defaults(): AlertOptions; static init(el: HTMLElement, options?: Partial): Alert; static init(els: InitElements, options?: Partial): Alert[]; static getInstance(el: HTMLElement): Alert; private _bindCloseButton; /** Hide and remove the alert from the document. */ dismiss(): void; /** Show an alert that was previously dismissed. */ open(): void; destroy(): void; } type GanttView = 'day' | 'week'; type GanttTone = 'primary' | 'secondary' | 'tertiary' | 'error'; type GanttEditAction = 'move' | 'resize-start' | 'resize-end'; interface GanttDependencyChange { from: string; to: string; action: 'add' | 'remove'; } interface GanttTaskChange { task: GanttTask; previousTask: GanttTask; action: GanttEditAction; } /** Custom color regions up to 100%; overruns always use the critical region. */ interface GanttProgressMeter { low: number; high: number; /** Defaults to 100: higher completion is better. */ optimum?: number; optimalColor?: string; suboptimalColor?: string; criticalColor?: string; } interface GanttTask { id: string; name: string; /** Calendar dates in YYYY-MM-DD format. The end date is inclusive. */ start: string; end: string; /** Non-negative percentage. Values above 100 indicate an overrun. */ progress?: number; /** Any CSS color, including a theme variable. Overrides meter colors. */ progressColor?: string; progressMeter?: GanttProgressMeter; /** Optional secondary label, such as a person or department. */ detail?: string; tone?: GanttTone; /** A milestone must have the same start and end date. */ milestone?: boolean; /** Upstream task IDs. Links propagate moves; they impose no date ordering. */ dependencies?: string[]; } interface GanttOptions extends BaseOptions$1 { tasks: GanttTask[]; view: GanttView; locale: string; label: string; emptyText: string; showToday: boolean; editable: boolean; /** Show direct connection and removal controls while editable. */ connectable: boolean; zoom: number; minZoom: number; maxZoom: number; onTaskClick: ((task: GanttTask, event: MouseEvent) => void) | null; /** Called once after a pointer or keyboard edit commits, with independent copies. */ onTaskChange: ((change: GanttTaskChange) => void) | null; onSelectionChange: ((taskIds: string[]) => void) | null; onDependencyChange: ((change: GanttDependencyChange) => void) | null; } /** Material-themed, horizontally scrollable calendar timeline. */ declare class Gantt extends Component { private _tasks; private _view; private _start; private _end; private _dayWidth; private _viewport; private _original; private _hadClass; private _zoom; private _drag; private _scrollFrame; private _suppressClick; private _announcement; private _originalClasses; private _selected; private _selectionAnchor; private _arrowId; private _resizeObserver; private _connections; constructor(el: HTMLElement, options?: Partial); static get defaults(): GanttOptions; static init(el: HTMLElement, options?: Partial): Gantt; static init(els: InitElements, options?: Partial): Gantt[]; static getInstance(el: HTMLElement): Gantt; private static validateView; /** Returns a copy; mutate it and call setTasks to update the chart. */ getTasks(): GanttTask[]; /** Add an upstream → downstream link without rescheduling either task. */ addDependency(from: string, to: string): void; removeDependency(from: string, to: string): void; setTasks(tasks: GanttTask[]): void; getSelectedTaskIds(): string[]; setSelectedTaskIds(ids: string[]): void; private _selectForInteraction; getView(): GanttView; setView(view: GanttView): void; isEditable(): boolean; setEditable(editable: boolean): void; getZoom(): number; /** Scale calendar columns, preserving the date at the center of the viewport. */ setZoom(zoom: number): void; resetZoom(): void; /** Scroll to a calendar date, or to the user's local today when omitted. */ scrollToDate(date?: string): void; destroy(): void; private _handleClick; private _labelWidth; private _pointerDay; private _handlePointerDown; private _handlePointerMove; private _previewDrag; private _autoScroll; private _handlePointerUp; private _handlePointerCancel; private _finishDrag; private _cancelDrag; private _editedTask; private _editContext; private _editedTasks; private _commitEdits; private _handleKeyDown; private _renderKeepingDate; private _format; /** Measure actual row heights so connectors follow wrapping labels and responsive layouts. */ private _drawDependencies; private _render; } interface KanbanMoveDetail { card: HTMLElement; from: HTMLElement; to: HTMLElement; } interface KanbanOptions extends BaseOptions$1 { /** Enable native drag-and-drop interactions. */ draggable: boolean; /** Called after a card changes column or order. */ onMove?: (detail: KanbanMoveDetail) => void; zoom?: number; minZoom?: number; maxZoom?: number; } /** A lightweight, dependency-free board for columns of draggable cards. */ declare class Kanban extends Component { private _zoom; private _draggedCard; private _dragSourceColumn; private _dropPreview; private _dragImage; private _previewHeight; private _onDragStart; private _onDragOver; private _onDrop; private _onDragEnd; constructor(el: HTMLElement, options: Partial); static get defaults(): KanbanOptions; /** Set the board scale, clamped to the configured limits. */ setZoom(value: number): void; /** Return the current board scale multiplier. */ getZoom(): number; /** Restore the board to 100% scale. */ resetZoom(): void; private _clampZoom; private _applyZoom; static init(el: HTMLElement, options?: Partial): Kanban; static init(els: InitElements, options?: Partial): Kanban[]; static getInstance(el: HTMLElement): Kanban; private _prepareMarkup; private _bindEvents; private _clearDragState; private _updateCounts; private _updateDropPreview; destroy(): void; } interface FloatingActionButtonOptions extends BaseOptions$1 { /** * Direction FAB menu opens. * @default "top" */ direction: 'top' | 'right' | 'bottom' | 'left'; /** * true: FAB menu appears on hover, false: FAB menu appears on click. * @default true */ hoverEnabled: boolean; /** * Enable transit the FAB into a toolbar on click. * @default false */ toolbarEnabled: boolean; } declare class FloatingActionButton extends Component implements Openable { #private; /** * Describes open/close state of FAB. */ isOpen: boolean; offsetY: number; offsetX: number; btnBottom: number; btnLeft: number; btnWidth: number; constructor(el: HTMLElement, options: Partial); static get defaults(): FloatingActionButtonOptions; /** * Initializes instance of FloatingActionButton. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): FloatingActionButton; /** * Initializes instances of FloatingActionButton. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): FloatingActionButton[]; static getInstance(el: HTMLElement): FloatingActionButton; destroy(): void; /** * Open FAB. */ open: () => void; /** * Close FAB. */ close: () => void; } interface CardsOptions extends BaseOptions$1 { onOpen: (el: Element) => void; onClose: (el: Element) => void; inDuration: number; outDuration: number; } declare class Cards extends Component implements Openable { #private; isOpen: boolean; constructor(el: HTMLElement, options: Partial); static get defaults(): CardsOptions; /** * Initializes instance of Cards. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Cards; /** * Initializes instances of Cards. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Cards[]; static getInstance(el: HTMLElement): Cards; /** * {@inheritDoc} */ destroy(): void; /** * Show card reveal. */ open: () => void; /** * Hide card reveal. */ close: () => void; static Init(): void; } interface CarouselOptions extends BaseOptions$1 { /** * Transition duration in milliseconds. * @default 200 */ duration: number; /** * Perspective zoom. If 0, all items are the same size. * @default -100 */ dist: number; /** * Set the spacing of the center item. * @default 0 */ shift: number; /** * Set the padding between non center items. * @default 0 */ padding: number; /** * Set the number of visible items. * @default 5 */ numVisible: number; /** * Make the carousel a full width slider like the second example. * @default false */ fullWidth: boolean; /** * Set to true to show indicators. * @default false */ indicators: boolean; /** * Don't wrap around and cycle through items. * @default false */ noWrap: boolean; /** * Callback for when a new slide is cycled to. * @default null */ onCycleTo: (current: Element, dragged: boolean) => void; } declare class Carousel extends Component { hasMultipleSlides: boolean; showIndicators: boolean; noWrap: boolean; /** If the carousel is being clicked or tapped. */ pressed: boolean; /** If the carousel is currently being dragged. */ dragged: boolean; offset: number; target: number; images: HTMLElement[]; itemWidth: number; itemHeight: number; dim: number; _indicators: HTMLUListElement; count: number; xform: string; verticalDragged: boolean; reference: number; referenceY: number; velocity: number; frame: number; timestamp: number; ticker: string | number | NodeJS.Timeout; amplitude: number; /** The index of the center carousel item. */ center: number; imageHeight: number; scrollingTimeout: number | NodeJS.Timeout; oneTimeCallback: (current: Element, dragged: boolean) => void | null; constructor(el: HTMLElement, options: Partial); static get defaults(): CarouselOptions; /** * Initializes instance of Carousel. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Carousel; /** * Initializes instances of Carousel. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Carousel[]; static getInstance(el: HTMLElement): Carousel; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleThrottledResize: () => void; _handleCarouselTap: (e: MouseEvent | TouchEvent) => void; _handleCarouselDrag: (e: MouseEvent | TouchEvent) => boolean; _handleCarouselRelease: (e: MouseEvent | TouchEvent) => boolean; _handleCarouselClick: (e: MouseEvent | TouchEvent) => boolean; _handleIndicatorClick: (e: Event) => void; _handleIndicatorKeyPress: (e: KeyboardEvent) => void; _handleIndicatorInteraction: (e: Event) => void; _handleResize: () => void; _setCarouselHeight(imageOnly?: boolean): void; _xpos(e: MouseEvent | TouchEvent): number; _ypos(e: MouseEvent | TouchEvent): number; _wrap(x: number): any; _track: () => void; _autoScroll: () => void; _scroll(x?: number): void; _updateItemStyle(el: HTMLElement, opacity: number, zIndex: number, transform: string): void; _cycleTo(n: number, callback?: CarouselOptions['onCycleTo']): void; /** * Move carousel to next slide or go forward a given amount of slides. * @param n How many times the carousel slides. */ next(n?: number): void; /** * Move carousel to previous slide or go back a given amount of slides. * @param n How many times the carousel slides. */ prev(n?: number): void; /** * Move carousel to nth slide. * @param n Index of slide. * @param callback "onCycleTo" optional callback. */ set(n: number, callback?: CarouselOptions['onCycleTo']): void; } interface ChipData { /** Unique identifier. */ id: number | string; /** Chip text. If not specified, "id" will be used. */ text?: string; /** Chip image (URL). */ image?: string; } interface ChipsOptions extends BaseOptions$1 { /** * Set the chip data. * @default [] */ data: ChipData[]; /** * Set first placeholder when there are no tags. * @default "" */ placeholder: string; /** * Set second placeholder when adding additional tags. * @default "" */ secondaryPlaceholder: string; /** * Set autocomplete options. * @default {} */ autocompleteOptions: Partial; /** * Toggles abililty to add custom value not in autocomplete list. * @default false */ autocompleteOnly: boolean; /** * Set chips limit. * @default Infinity */ limit: number; /** * Specifies class to be used in "close" button (useful when working with Material Symbols icon set). * @default 'material-icons' */ closeIconClass: string; /** * Specifies option to render user input field * @default false; */ allowUserInput: boolean; /** * Callback for chip add. * @default null */ onChipAdd: (element: HTMLElement, chip: HTMLElement) => void; /** * Callback for chip select. * @default null */ onChipSelect: (element: HTMLElement, chip: HTMLElement) => void; /** * Callback for chip delete. * @default null */ onChipDelete: (element: HTMLElement, chip: HTMLElement) => void; } declare class Chips extends Component { #private; /** Array of the current chips data. */ chipsData: ChipData[]; /** If the chips has autocomplete enabled. */ hasAutocomplete: boolean; /** Autocomplete instance, if any. */ autocomplete: Autocomplete; constructor(el: HTMLElement, options: Partial); static get defaults(): ChipsOptions; /** * Initializes instance of Chips. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Chips; /** * Initializes instances of Chips. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Chips[]; static getInstance(el: HTMLElement): Chips; getData(): ChipData[]; destroy(): void; /** * Add chip to input. * @param chip Chip data object */ addChip(chip: ChipData): void; /** * Delete nth chip. * @param chipIndex Index of chip */ deleteChip(chipIndex: number): void; /** * Select nth chip. * @param chipIndex Index of chip */ selectChip(chipIndex: number): void; static Init(): void; } interface CollapsibleOptions extends BaseOptions$1 { /** * If accordion versus collapsible. * @default true */ accordion: boolean; /** * Transition in duration in milliseconds. * @default 300 */ inDuration: number; /** * Transition out duration in milliseconds. * @default 300 */ outDuration: number; /** * Callback function called before collapsible is opened. * @default null */ onOpenStart: (el: Element) => void; /** * Callback function called after collapsible is opened. * @default null */ onOpenEnd: (el: Element) => void; /** * Callback function called before collapsible is closed. * @default null */ onCloseStart: (el: Element) => void; /** * Callback function called after collapsible is closed. * @default null */ onCloseEnd: (el: Element) => void; } declare class Collapsible extends Component { private _headers; constructor(el: HTMLElement, options: Partial); static get defaults(): CollapsibleOptions; /** * Initializes instance of Collapsible. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Collapsible; /** * Initializes instances of Collapsible. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Collapsible[]; static getInstance(el: HTMLElement): Collapsible; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleCollapsibleClick: (e: MouseEvent | KeyboardEvent) => void; _handleCollapsibleKeydown: (e: KeyboardEvent) => void; private _setExpanded; _animateIn(index: number): void; _animateOut(index: number): void; /** * Open collapsible section. * @param n Nth section to open. */ open: (index: number) => void; /** * Close collapsible section. * @param n Nth section to close. */ close: (index: number) => void; } interface DateI18nOptions extends I18nOptions { previousMonth: string; nextMonth: string; months: string[]; monthsShort: string[]; weekdays: string[]; weekdaysShort: string[]; weekdaysAbbrev: string[]; } interface DatepickerOptions extends BaseOptions$1 { /** * The date output format for the input field value * or a function taking the date and outputting the * formatted date string. * @default 'mmm dd, yyyy' */ format: string | ((d: Date) => string); /** * Used to create date object from current input string. * @default null */ parse: ((value: string, format: string) => Date) | null; /** * The initial condition if the datepicker is based on date range. * @default false */ isDateRange: boolean; /** * The selector of the user specified date range end element */ dateRangeEndEl: string | null; /** * The initial condition if the datepicker is based on multiple date selection. * @default false */ isMultipleSelection: boolean; /** * The initial date to view when first opened. * @default null */ defaultDate: Date | null; /** * The initial end date to view when first opened. * @default null */ defaultEndDate: Date | null; /** * Make the `defaultDate` the initial selected value. * @default false */ setDefaultDate: boolean; /** * Make the `defaultEndDate` the initial selected value. * @default false */ setDefaultEndDate: boolean; /** * Prevent selection of any date on the weekend. * @default false */ disableWeekends: boolean; /** * Custom function to disable certain days. * @default null */ disableDayFn: ((day: Date) => boolean) | null; /** * First day of week (0: Sunday, 1: Monday etc). * @default 0 */ firstDay: number; /** * The earliest date that can be selected. * @default null */ minDate: Date | null; /** * The latest date that can be selected. * @default null */ maxDate: Date | null; /** * Number of years either side, or array of upper/lower range. * @default 10 */ yearRange: number | number[]; /** * Sort year range in reverse order. * @default false */ yearRangeReverse: boolean; /** * Changes Datepicker to RTL. * @default false */ isRTL: boolean; /** * Show month after year in Datepicker title. * @default false */ showMonthAfterYear: boolean; /** * Render days of the calendar grid that fall in the next * or previous month. * @default false */ showDaysInNextAndPreviousMonths: boolean; /** * Specify if the docked datepicker is in open state by default */ openByDefault: boolean; /** * Specify a DOM element OR selector for a DOM element to render * the calendar in, by default it will be placed before the input. * @default null */ container: HTMLElement | string | null; /** * Show the clear button in the datepicker. * @default false */ showClearBtn: boolean; /** * Autosubmit calendar day select to input field * @default false */ autoSubmit: true; /** * Internationalization options. */ i18n: Partial; /** * An array of string returned by `Date.toDateString()`, * indicating there are events in the specified days. * @default [] */ events: string[]; /** * Callback function when date is selected, * first parameter is the newly selected date. * @default null */ onSelect: ((selectedDate: Date) => void) | null; /** * Callback function when Datepicker is closed. * @default null */ /** * Callback function when Datepicker HTML is refreshed. * @default null */ onDraw: (() => void) | null; /** * Callback function for interaction with input field. * @default null */ onInputInteraction: (() => void) | null; /** * Callback function for interaction with confirm button. * @default null */ onConfirm: (() => void) | null; /** * Callback function for interaction with close button. * @default null */ onCancel: (() => void) | null; /** Field used for internal calculations DO NOT CHANGE IT */ minYear?: number; /** Field used for internal calculations DO NOT CHANGE IT */ maxYear?: number; /** Field used for internal calculations DO NOT CHANGE IT */ minMonth?: number; /** Field used for internal calculations DO NOT CHANGE IT */ maxMonth?: number; /** Field used for internal calculations DO NOT CHANGE IT */ startRange?: Date; /** Field used for internal calculations DO NOT CHANGE IT */ endRange?: Date; /** * Display plugin */ displayPlugin: string; /** * Configurable display plugin options */ displayPluginOptions: object; } declare class Datepicker extends Component { el: HTMLInputElement; id: string; multiple: boolean; calendarEl: HTMLElement; /** CLEAR button instance. */ /** DONE button instance */ containerEl: HTMLElement; yearTextEl: HTMLElement; dateTextEl: HTMLElement; endDateEl: HTMLInputElement; dateEls: HTMLInputElement[]; /** The selected Date. */ date: Date; endDate: null | Date; dates: Date[]; formats: object; calendars: [{ month: number; year: number; }]; private _y; private _m; private displayPlugin; private footer; static _template: string; constructor(el: HTMLInputElement, options: Partial); static get defaults(): DatepickerOptions; /** * Initializes instance of Datepicker. * @param el HTML element. * @param options Component options. */ static init(el: HTMLInputElement, options?: Partial): Datepicker; /** * Initializes instances of Datepicker. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Datepicker[]; static _isDate(obj: any): boolean; static _isWeekend(date: any): boolean; /** * @deprecated as this function has no effect without any return statement or global parameter setter. */ static _setToStartOfDay(date: any): void; static _getDaysInMonth(year: any, month: any): number; static _isLeapYear(year: any): boolean; static _compareDates(a: any, b: any): boolean; static _compareWithinRange(day: Date, date: Date, dateEnd: Date): boolean; static _comparePastDate(a: Date, b: Date): boolean; static getInstance(el: HTMLElement): Datepicker; destroy(): void; destroySelects(): void; _insertHTMLIntoDOM(): void; /** * Renders the date input format */ _renderDateInputFormat(el: HTMLInputElement): void; /** * Gets a string representation of the given date. */ toString(date?: Date, format?: string | ((d: Date) => string)): string; /** * Returns the formatted date. */ formatDate(date: Date, format: string): string; /** * Sets date from input field. */ setDateFromInput(el: HTMLInputElement): void; /** * Set a date on the datepicker. * @param date Date to set on the datepicker. * @param preventOnSelect Undocumented as of 5 March 2018. * @param isEndDate * @param fromUserInput */ setDate(date?: Date, preventOnSelect?: boolean, isEndDate?: boolean, fromUserInput?: boolean): void; validateDate(date: Date): void | Date; /** * Set a single date on the datepicker. * @param date Date to set on the datepicker. * @param isEndDate */ setSingleDate(date: Date, isEndDate: boolean): void; /** * Set a multi date on the datepicker. * @param date Date to set on the datepicker. */ setMultiDate(date: Date): void; /** * Sets the data-date attribute on the date input field */ setDataDate(el: any, date: any): void; /** * Sets dates on the input values. */ setInputValues(): void; setMultipleSelectionInputValues(): void; /** * Sets given date as the input value on the given element. */ setInputValue(el: any, date: any): void; /** * Display plugin setup. */ _setupDisplayPlugin(): void; /** * Renders the date in the modal head section. */ _renderDateDisplay(date: Date, endDate?: Date): void; /** * Change date view to a specific date on the datepicker. * @param date Date to show on the datepicker. */ gotoDate(date: Date): void; adjustCalendars(): void; adjustCalendar(calendar: any): any; nextMonth(): void; prevMonth(): void; render(year: any, month: any, randId: any): string; renderDay(opts: any): string; renderRow(days: any, isRTL: any, isRowSelected: any): string; renderTable(opts: any, data: any, randId: any): string; renderHead(opts: any): string; renderBody(rows: any): string; renderTitle(instance: any, c: any, year: any, month: any, refYear: any, randId: any): string; draw(): void; _setupEventHandlers(): void; _setupVariables(): void; _pickerSetup(): void; _removeEventHandlers(): void; _handleInputClick: (e: any) => void; _handleInputKeydown: (e: KeyboardEvent) => void; _handleCalendarClick: (e: any) => void; _handleDateRangeCalendarClick: (date: Date) => void; _handleClearClick: () => void; _clearDates: () => void; _handleMonthChange: (e: any) => void; _handleYearChange: (e: any) => void; gotoMonth(month: any): void; gotoYear(year: any): void; _handleInputChange: (e: Event) => void; renderDayName(opts: any, day: any, abbr?: boolean): any; createDateInput(): HTMLInputElement; _finishSelection: () => void; _confirm: () => void; _cancel: () => void; open(): this; close(): this; } declare class Forms { /** * Checks if the label has validation and apply * the correct class and styles * @param textfield */ static validateField(textfield: HTMLInputElement): void; /** * Resizes the given TextArea after updating the * value content dynamically. * @param e EventTarget */ static textareaAutoResize(e: EventTarget): void; static Init(): void; static InitTextarea(textarea: HTMLTextAreaElement): void; static InitFileInputPath(fileInput: HTMLInputElement): void; } interface MaterialboxOptions extends BaseOptions$1 { /** * Transition in duration in milliseconds. * @default 275 */ inDuration: number; /** * Transition out duration in milliseconds. * @default 200 */ outDuration: number; /** * Callback function called before materialbox is opened. * @default null */ onOpenStart: (el: Element) => void; /** * Callback function called after materialbox is opened. * @default null */ onOpenEnd: (el: Element) => void; /** * Callback function called before materialbox is closed. * @default null */ onCloseStart: (el: Element) => void; /** * Callback function called after materialbox is closed. * @default null */ onCloseEnd: (el: Element) => void; } declare class Materialbox extends Component { /** If the materialbox overlay is showing. */ overlayActive: boolean; /** If the materialbox is no longer being animated. */ doneAnimating: boolean; /** Caption, if specified. */ caption: string; /** Original width of image. */ originalWidth: number; /** Original height of image. */ originalHeight: number; private originInlineStyles; private placeholder; private _changedAncestorList; private newHeight; private newWidth; private windowWidth; private windowHeight; private attrWidth; private attrHeight; private _overlay; private _photoCaption; constructor(el: HTMLElement, options: Partial); static get defaults(): MaterialboxOptions; /** * Initializes instance of MaterialBox. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Materialbox; /** * Initializes instances of MaterialBox. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Materialbox[]; static getInstance(el: HTMLElement): Materialbox; destroy(): void; private _setupEventHandlers; private _removeEventHandlers; private _handleMaterialboxClick; private _handleMaterialboxKeypress; private _handleMaterialboxToggle; private _handleWindowScroll; private _handleWindowResize; private _handleWindowEscape; private _makeAncestorsOverflowVisible; private _offset; private _updateVars; private _animateImageIn; private _animateImageOut; private _addCaption; private _removeCaption; private _addOverlay; private _removeOverlay; /** * Open materialbox. */ open: () => void; /** * Close materialbox. */ close: () => void; } interface ModalOptions extends BaseOptions$1 { opacity: number; inDuration: number; outDuration: number; preventScrolling: boolean; onOpenStart: (this: Modal, el: HTMLElement) => void; onOpenEnd: (this: Modal, el: HTMLElement) => void; onCloseStart: (el: HTMLElement) => void; onCloseEnd: (el: HTMLElement) => void; dismissible: boolean; startingTop: string; endingTop: string; } declare class Modal extends Component { #private; constructor(el: HTMLElement, options: Partial); static get defaults(): { opacity: number; inDuration: number; outDuration: number; onOpenStart: any; onOpenEnd: any; onCloseStart: any; onCloseEnd: any; preventScrolling: boolean; dismissible: boolean; startingTop: string; endingTop: string; }; static init(el: HTMLElement, options?: Partial): Modal; static init(els: InitElements, options?: Partial): Modal[]; static getInstance(el: HTMLElement): Modal; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleTriggerClick(): void; _handleOverlayClick(): void; _handleModalCloseClick(): void; _handleKeydown(): void; _handleFocus(): void; open(): this; close(): this; static create(config: any): string | HTMLDialogElement; } interface FormSelectOptions extends BaseOptions$1 { /** * Classes to be added to the select wrapper element. * @default "" */ classes: string; /** * Pass options object to select dropdown initialization. * @default {} */ dropdownOptions: Partial; } type ValueStruct = { el: HTMLOptionElement; optionEl: HTMLElement; }; declare class FormSelect extends Component { el: HTMLSelectElement; /** If this is a multiple select. */ isMultiple: boolean; /** * Label associated with the current select element. * Is "null", if not detected. */ labelEl: HTMLLabelElement; /** Dropdown UL element. */ dropdownOptions: HTMLUListElement; /** Text input that shows current selected option. */ input: HTMLInputElement; /** Instance of the dropdown plugin for this select. */ dropdown: Dropdown; /** The select wrapper element. */ wrapper: HTMLDivElement; selectOptions: (HTMLOptionElement | HTMLOptGroupElement)[]; private _values; nativeTabIndex: number; constructor(el: HTMLSelectElement, options: FormSelectOptions); static get defaults(): FormSelectOptions; /** * Initializes instance of FormSelect. * @param el HTML element. * @param options Component options. */ static init(el: HTMLSelectElement, options?: Partial): FormSelect; /** * Initializes instances of FormSelect. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): FormSelect[]; static getInstance(el: HTMLElement): FormSelect; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleSelectChange: () => void; _handleOptionClick: (e: MouseEvent | KeyboardEvent) => void; _arraysEqual(a: T[], b: (E | T)[]): boolean; _selectOptionElement(virtualOption: HTMLElement): void; _handleInputClick: () => void; _setupDropdown(): void; _addOptionToValues(realOption: HTMLOptionElement, virtualOption: HTMLElement): void; _removeDropdown(): void; _createAndAppendOptionWithIcon(realOption: HTMLOptionElement | HTMLOptGroupElement, type: string): HTMLLIElement; _selectValue(value: ValueStruct): void; _deselectValue(value: ValueStruct): void; _deselectAll(): void; _isValueSelected(value: ValueStruct): boolean; _toggleEntryFromArray(value: ValueStruct): void; _getSelectedOptions(): HTMLOptionElement[]; _setValueToInput(): void; _setSelectedStates(): void; _activateOption(ul: HTMLElement, li: HTMLElement): void; getSelectedValues(): string[]; } interface SidenavOptions extends BaseOptions$1 { /** * Side of screen on which Sidenav appears. * @default 'left' */ edge: 'left' | 'right'; /** * Allow swipe gestures to open/close Sidenav. * @default true */ draggable: boolean; /** * Width of the area where you can start dragging. * @default '10px' */ dragTargetWidth: string; /** * Length in ms of enter transition. * @default 250 */ inDuration: number; /** * Length in ms of exit transition. * @default 200 */ outDuration: number; /** * Prevent page from scrolling while sidenav is open. * @default true */ preventScrolling: boolean; /** * Function called when sidenav starts entering. */ onOpenStart: (elem: HTMLElement) => void; /** * Function called when sidenav finishes entering. */ onOpenEnd: (elem: HTMLElement) => void; /** * Function called when sidenav starts exiting. */ onCloseStart: (elem: HTMLElement) => void; /** * Function called when sidenav finishes exiting. */ onCloseEnd: (elem: HTMLElement) => void; } declare class Sidenav extends Component implements Openable { id: string; /** Describes open/close state of Sidenav. */ isOpen: boolean; /** Describes if sidenav is fixed. */ isFixed: boolean; /** Describes if Sidenav is being dragged. */ isDragged: boolean; lastWindowWidth: number; lastWindowHeight: number; static _sidenavs: Sidenav[]; private _overlay; dragTarget: Element; private _startingXpos; private _xPos; private _time; private _width; private _initialScrollTop; private _verticallyScrolling; private deltaX; private velocityX; private percentOpen; constructor(el: HTMLElement, options: Partial); static get defaults(): SidenavOptions; /** * Initializes instance of Sidenav. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Sidenav; /** * Initializes instances of Sidenav. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Sidenav[]; static getInstance(el: HTMLElement): Sidenav; destroy(): void; private _createOverlay; private _setupEventHandlers; private _removeEventHandlers; private _handleTriggerClick; private _startDrag; private _dragMoveUpdate; private _handleDragTargetDrag; private _handleDragTargetRelease; private _handleCloseDrag; private _calculateDelta; private _handleCloseRelease; private _handleCloseTriggerClick; private _handleWindowResize; private _setupClasses; private _removeClasses; private _setupFixed; private _isDraggable; private _isCurrentlyFixed; private _createDragTarget; private _preventBodyScrolling; private _enableBodyScrolling; /** * Opens Sidenav. */ open: () => void; /** * Closes Sidenav. */ close: () => void; private _animateIn; private _animateOut; private _animateSidenavIn; private _animateSidenavOut; private _animateOverlayIn; private _animateOverlayOut; private _setAriaHidden; private _setTabIndex; } interface SliderOptions extends BaseOptions$1 { /** * Set to false to hide slide indicators. * @default true */ indicators: boolean; /** * Set height of slider. * @default 400 */ height: number; /** * Set the duration of the transition animation in ms. * @default 500 */ duration: number; /** * Set the duration between transitions in ms. * @default 6000 */ interval: number; /** * If slider should pause when keyboard focus is received. * @default true */ pauseOnFocus: boolean; /** * If slider should pause when is hovered by a pointer. * @default true */ pauseOnHover: boolean; /** * Optional function used to generate ARIA label to indicators (for accessibility purposes). * @param index Current index, starting from "1". * @param current A which indicates whether it is the current element or not * @returns a string to be used as label indicator. * @default null */ indicatorLabelFunc: (index: number, current: boolean) => string; } declare class Slider extends Component { /** Index of current slide. */ activeIndex: number; interval: string | number | NodeJS.Timeout; eventPause: boolean; _slider: HTMLUListElement; _slides: HTMLLIElement[]; _activeSlide: HTMLLIElement; _indicators: HTMLLIElement[]; _hovered: boolean; _focused: boolean; _focusCurrent: boolean; _sliderId: string; constructor(el: HTMLElement, options: Partial); static get defaults(): SliderOptions; /** * Initializes instance of Slider. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Slider; /** * Initializes instances of Slider. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Slider[]; static getInstance(el: HTMLElement): Slider; destroy(): void; private _setupEventHandlers; private _removeEventHandlers; private _handleIndicatorClick; private _handleAutoPauseHover; private _handleAutoPauseFocus; private _handleAutoStartHover; private _handleAutoStartFocus; private _handleInterval; private _animateSlide; private _setSliderHeight; private _setupIndicators; private _removeIndicators; set(index: number): void; _pause(fromEvent: boolean): void; /** * Pause slider autoslide. */ pause: () => void; /** * Start slider autoslide. */ start: () => void; /** * Move to next slider. */ next: () => void; /** * Move to prev slider. */ prev: () => void; } interface TabsOptions extends BaseOptions$1 { /** * Transition duration in milliseconds. * @default 300 */ duration: number; /** * Callback for when a new tab content is shown. * @default null */ onShow: (newContent: Element) => void; /** * Set to true to enable swipeable tabs. * This also uses the responsiveThreshold option. * @default false */ swipeable: boolean; /** * The maximum width of the screen, in pixels, * where the swipeable functionality initializes. * @default infinity */ responsiveThreshold: number; } declare class Tabs extends Component { _tabLinks: NodeListOf; _index: number; _indicator: HTMLLIElement; _tabWidth: number; _tabsWidth: number; _tabsCarousel: Carousel; _activeTabLink: HTMLAnchorElement | null; _content: HTMLElement; constructor(el: HTMLElement, options: Partial); static get defaults(): TabsOptions; /** * Initializes instance of Tabs. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Tabs; /** * Initializes instances of Tabs. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Tabs[]; static getInstance(el: HTMLElement): Tabs; destroy(): void; /** * The index of tab that is currently shown. */ get index(): number; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleWindowResize: () => void; _handleTabClick: (e: MouseEvent) => void; _createIndicator(): void; _setupActiveTabLink(): void; _setupSwipeableTabs(): void; _teardownSwipeableTabs(): void; _setupNormalTabs(): void; _teardownNormalTabs(): void; _setTabsAndTabWidth(): void; _calcRightPos(el: HTMLElement): number; _calcLeftPos(el: HTMLElement): number; /** * Recalculate tab indicator position. This is useful when * the indicator position is not correct. */ updateTabIndicator(): void; _animateIndicator(prevIndex: number): void; /** * Show tab content that corresponds to the tab with the id. * @param tabId The id of the tab that you want to switch to. */ select(tabId: string): void; } type Views = 'hours' | 'minutes'; interface TimepickerOptions extends BaseOptions$1 { /** * Dial radius. * @default 135 */ dialRadius: number; /** * Outer radius. * @default 105 */ outerRadius: number; /** * Inner radius. * @default 70 */ innerRadius: number; /** * Tick radius. * @default 20 */ tickRadius: number; /** * Duration of the transition from/to the hours/minutes view. * @default 350 */ duration: number; /** * Specify a DOM element OR selector for a DOM element to render * the time picker in, by default it will be placed before the input. * @default null */ container: HTMLElement | string | null; /** * Show the clear button in the Timepicker. * @default false */ showClearBtn: boolean; /** * Autosubmit timepicker selection to input field * @default true */ autoSubmit: true; /** * Default time to set on the timepicker 'now' or '13:14'. * @default 'now'; */ defaultTime: string; /** * Millisecond offset from the defaultTime. * @default 0 */ fromNow: number; /** * Internationalization options. */ i18n: Partial; /** * Use 12 hour AM/PM clock instead of 24 hour clock. * @default true */ twelveHour: boolean; /** * Vibrate device when dragging clock hand. * @default true */ vibrate: boolean; /** * Callback function when a time is selected. * @default null */ onSelect: (hour: number, minute: number) => void; /** * Callback function for interaction with input field. * @default null */ onInputInteraction: (() => void) | null; /** * Callback function for done. * @default null */ onDone: (() => void) | null; /** * Callback function for cancel. * @default null */ onCancel: (() => void) | null; /** * Display plugin */ displayPlugin: string; /** * Configurable display plugin options */ displayPluginOptions: object; } type Point = { x: number; y: number; }; declare class Timepicker extends Component { el: HTMLInputElement; id: string; containerEl: HTMLElement; plate: HTMLElement; digitalClock: HTMLElement; inputHours: HTMLInputElement; inputMinutes: HTMLInputElement; x0: number; y0: number; moved: boolean; dx: number; dy: number; /** * Current view on the timepicker. * @default 'hours' */ currentView: Views; hand: SVGElement; minutesView: HTMLElement; hours: number; minutes: number; /** The selected time. */ time: string; /** * If the time is AM or PM on twelve-hour clock. * @default 'PM' */ amOrPm: 'AM' | 'PM'; static _template: any; /** Vibrate device when dragging clock hand. */ vibrate: 'vibrate' | 'webkitVibrate' | null; _canvas: HTMLElement; hoursView: HTMLElement; spanAmPm: HTMLSpanElement; footer: HTMLElement; private _amBtn; private _pmBtn; bg: Element; bearing: Element; g: Element; toggleViewTimer: string | number | NodeJS.Timeout; vibrateTimer: NodeJS.Timeout | number; private displayPlugin; constructor(el: HTMLInputElement, options: Partial); static get defaults(): TimepickerOptions; /** * Initializes instance of Timepicker. * @param el HTML element. * @param options Component options. */ static init(el: HTMLInputElement, options?: Partial): Timepicker; /** * Initializes instances of Timepicker. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Timepicker[]; static _addLeadingZero(num: number): string; static _createSVGEl(name: string): SVGElement; static _Pos(e: TouchEvent | MouseEvent): Point; static getInstance(el: HTMLElement): Timepicker; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleInputClick: () => void; _handleInputKeydown: (e: KeyboardEvent) => void; _handleTimeInputEnterKey: (e: KeyboardEvent) => void; _handleClockClickStart: (e: any) => void; _handleDocumentClickMove: (e: any) => void; _handleDocumentClickEnd: (e: any) => void; _insertHTMLIntoDOM(): void; _setupVariables(): void; _pickerSetup(): void; private _setupDisplayPlugin; _clockSetup(): void; _buildSVGClock(): void; _buildHoursView(): void; _buildHoursTick(i: number, radian: number, radius: number): void; _buildMinutesView(): void; _handleAmPmClick: (e: MouseEvent) => void; _handleAmPmKeypress: (e: KeyboardEvent) => void; _handleAmPmInteraction: (e: HTMLElement) => void; _updateAmPmView(): void; _updateTimeFromInput(): void; /** * Show hours or minutes view on timepicker. * @param view The name of the view you want to switch to, 'hours' or 'minutes'. * @param delay */ showView: (view: Views, delay?: number) => void; resetClock(delay: any): void; _inputFromTextField: () => void; drawClockFromTimeInput(value: any, isHours: any): void; setHand(x: any, y: any, roundBy5?: boolean): void; setClockAttributes(radian: number, radius: number): void; formatHours(): void; formatMinutes(): void; setHoursDefault(): void; done: (clearValue?: any) => void; confirm: () => void; cancel: () => void; clear: () => void; open(): this; close(): this; } interface ToastOptions extends BaseOptions$1 { /** * The content of the Toast. * @default "" */ text: string; /** * Element Id for the tooltip. * @default "" */ toastId?: string; /** * Length in ms the Toast stays before dismissal. * @default 4000 */ displayLength: number; /** * Transition in duration in milliseconds. * @default 300 */ inDuration: number; /** * Transition out duration in milliseconds. * @default 375 */ outDuration: number; /** * Classes to be added to the toast element. * @default "" */ classes: string; /** * Callback function called when toast is dismissed. * @default null */ completeCallback: () => void; /** * The percentage of the toast's width it takes fora drag * to dismiss a Toast. * @default 0.8 */ activationPercent: number; } declare class Toast { /** The toast element. */ el: HTMLElement; /** * The remaining amount of time in ms that the toast * will stay before dismissal. */ timeRemaining: number; /** * Describes the current pan state of the Toast. */ panning: boolean; options: ToastOptions; message: string; counterInterval: NodeJS.Timeout | number; wasSwiped: boolean; startingXPos: number; xPos: number; time: number; deltaX: number; velocityX: number; static _toasts: Toast[]; private static _container; static _draggedToast: Toast; constructor(options: Partial); static get defaults(): ToastOptions; static getInstance(el: HTMLElement): Toast; static _createContainer(): void; static _removeContainer(): void; static _onDragStart(e: TouchEvent | MouseEvent): void; static _onDragMove(e: TouchEvent | MouseEvent): void; static _onDragEnd(): void; static _xPos(e: TouchEvent | MouseEvent): number; /** * dismiss all toasts. */ static dismissAll(): void; _createToast(): HTMLElement; _animateIn(): void; /** * Create setInterval which automatically removes toast when timeRemaining >= 0 * has been reached. */ _setTimer(): void; /** * Dismiss toast with animation. */ dismiss(): void; } type TooltipPosition = 'top' | 'right' | 'bottom' | 'left'; interface TooltipOptions extends BaseOptions$1 { /** * Delay time before tooltip disappears. * @default 200 */ exitDelay: number; /** * Delay time before tooltip appears. * @default 0 */ enterDelay: number; /** * Element Id for the tooltip. * @default "" */ tooltipId?: string; /** * Text string for the tooltip. * @default "" */ text: string; /** * Set distance tooltip appears away from its activator * excluding transitionMovement. * @default 5 */ margin: number; /** * Enter transition duration. * @default 300 */ inDuration: number; /** * Opacity of the tooltip. * @default 1 */ opacity: number; /** * Exit transition duration. * @default 250 */ outDuration: number; /** * Set the direction of the tooltip. * @default 'bottom' */ position: TooltipPosition; /** * Amount in px that the tooltip moves during its transition. * @default 10 */ transitionMovement: number; } declare class Tooltip extends Component { /** * If tooltip is open. */ isOpen: boolean; /** * If tooltip is hovered. */ isHovered: boolean; /** * If tooltip is focused. */ isFocused: boolean; tooltipEl: HTMLElement; private _exitDelayTimeout; private _enterDelayTimeout; xMovement: number; yMovement: number; constructor(el: HTMLElement, options: Partial); static get defaults(): TooltipOptions; /** * Initializes instance of Tooltip. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Tooltip; /** * Initializes instances of Tooltip. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Tooltip[]; static getInstance(el: HTMLElement): Tooltip; destroy(): void; _appendTooltipEl(): void; _setTooltipContent(tooltipContentEl: HTMLElement): void; _updateTooltipContent(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; /** * Show tooltip. */ open: (isManual: boolean) => void; /** * Hide tooltip. */ close: () => void; _setExitDelayTimeout(): void; _setEnterDelayTimeout(isManual: any): void; _positionTooltip(): void; _repositionWithinScreen(x: number, y: number, width: number, height: number): { x: number; y: number; }; _animateIn(): void; _animateOut(): void; _handleMouseEnter: () => void; _handleMouseLeave: () => void; _handleFocus: () => void; _handleBlur: () => void; _getAttributeOptions(): Partial; } interface RangeOptions extends BaseOptions$1 { /** Show a value indicator during pointer or keyboard interaction. */ showValue: boolean; /** Show ticks at step intervals (dense intervals are thinned to at most 101). */ showTicks: boolean; /** Add one editable number field on the left of a single slider. */ showInput?: boolean; /** Accessible name for the single slider's numeric field. */ inputLabel?: string; /** Optional plain-text value indicator and accessible value formatting. */ formatValue?: (value: number) => string; } /** Material-styled native range input. */ declare class Range extends Component { el: HTMLInputElement; value: HTMLElement; thumb: HTMLElement; private _control?; private _numberField?; private _editingNumber; private _ticks; private _tickValues; private _pointerDown; private _disposed; private _resize?; private _attributes; private _form; private _resetTimer?; private _originalProgress; private _originalPriority; private _originalValueText; constructor(el: HTMLInputElement, options: Partial); static get defaults(): RangeOptions; static init(el: HTMLInputElement, options?: Partial): Range; static init(els: InitElements, options?: Partial): Range[]; static getInstance(el: HTMLInputElement): Range; private _bounds; private _buildTicks; /** Refresh after assigning input.value programmatically or changing layout/direction. */ update: () => void; private _createNumberField; private _handleNumber; private _handleNumberBlur; private _showValue; private _activate; private _handleInput; private _handleDown; private _handleUp; private _handleFocus; private _handleBlur; private _handleReset; destroy(): void; /** Initialize uninitialized ranges currently in the document. */ static Init(): void; } interface RangeIntervalOptions extends RangeOptions { /** Generate editable numeric in/out fields around the slider. */ showInputs: boolean; /** Visible and accessible labels for the generated fields. */ startLabel: string; endLabel: string; } /** Two native sliders sharing a track. The first input defines min, max and step. */ declare class RangeInterval extends Component { readonly start: HTMLInputElement; readonly end: HTMLInputElement; private _ranges; private _control?; private _fields; private _editing?; private _attributes; private _resize?; private _form; private _resetTimer?; private _disposed; private _originalAttributes; private _originalStyle; constructor(el: HTMLElement, options?: Partial); static get defaults(): RangeIntervalOptions; static init(el: HTMLElement, options?: Partial): RangeInterval; static init(els: InitElements, options?: Partial): RangeInterval[]; static getInstance(el: HTMLElement): RangeInterval; /** Read the numeric in/out values in ascending order. */ getValues(): [number, number]; /** Set both values, applying native bounds/step rounding. Does not dispatch input/change. */ setValues(start: number, end: number): void; private _syncBounds; /** Refresh after programmatic changes. The first input owns the shared bounds and step. */ update: () => void; private _handleInput; private _createFields; private _handleField; private _handleFieldBlur; private _handleReset; destroy(): void; } interface ToolbarOptions extends BaseOptions$1 { } declare class Toolbar extends Component { _tracks: HTMLElement[]; constructor(el: HTMLElement, options: Partial); static get defaults(): ToolbarOptions; static init(el: HTMLElement, options?: Partial): Toolbar; static init(els: InitElements, options?: Partial): Toolbar[]; static getInstance(el: HTMLElement): Toolbar; destroy(): void; /** * Re-measure and reposition every track's sliding indicator - call this * after changing which .toolbar-track-item is active from your own code, * or after anything that could have changed the toolbar's layout/width. */ updateIndicators(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleTrackClick: (e: MouseEvent) => void; _handleSearchFocusIn: (e: FocusEvent) => void; _handleSearchFocusOut: (e: FocusEvent) => void; _handleSearchInput: (e: Event) => void; _handleSearchKeydown: (e: KeyboardEvent) => void; _handleWindowResize: () => void; _moveIndicator(track: HTMLElement, animate: boolean): void; } interface PasswordInputOptions extends BaseOptions$1 { /** Accessible name when the password is hidden. */ showLabel: string; /** Accessible name when the password is visible. */ hideLabel: string; } type PasswordInputElement = HTMLInputElement & { M_PasswordInput?: PasswordInput; }; /** * Show or hide a password with an accessible suffix button. * Existing data-password-toggle-icon wrappers remain supported. */ declare class PasswordInput extends Component { el: PasswordInputElement; private _suffixEl; private _stateObserver; private _originalAttributes; constructor(el: HTMLInputElement, options: Partial); static get defaults(): PasswordInputOptions; static init(el: HTMLInputElement, options?: Partial): PasswordInput; static init(els: InitElements, options?: Partial): PasswordInput[]; static getInstance(el: HTMLInputElement): PasswordInput; /** Remove listeners and restore the supplied button attributes. */ destroy(): void; /** Toggle without submitting the form or changing its value or selection. */ toggle(): void; private _isCrazyButton; private _syncState; private _handleToggleClick; private _handleToggleKeydown; } interface NumberInputOptions extends BaseOptions$1 { thousandsSeparator: string; radix: string; mapToRadix: string[]; min?: number; max?: number; scale?: number; /** Opt in to left/right fine and coarse increment controls. */ controls?: boolean; /** Fine increment; otherwise read step, falling back to 1. */ step?: number; /** Coarse increment; otherwise data-number-large-step or ten fine increments. */ largeStep?: number; } declare class NumberInput extends Component { el: HTMLInputElement; mask: InputMask | undefined; ready: Promise; constructor(el: HTMLInputElement, options: Partial); static get defaults(): NumberInputOptions; static init(el: HTMLInputElement, options?: Partial): NumberInput; static init(els: InitElements, options?: Partial): NumberInput[]; static getInstance(el: HTMLInputElement): NumberInput; destroy(): void; private _destroyed; private _controls; private _events; private _observer; private _originalAttributes; private get stepSize(); private get largeStepSize(); private bound; private decimalPlaces; /** Increase by the fine step, or the coarse step when large is true. */ increment(large?: boolean): void; /** Decrease by the fine step, or the coarse step when large is true. */ decrement(large?: boolean): void; private adjust; private setupControls; private syncControls; _setup(): Promise; } interface ColorInputOptions extends BaseOptions$1 { theme: 'classic' | 'monolith' | 'nano'; opacity: boolean; swatches: string[]; locale?: Record; } declare class ColorInput extends Component { el: HTMLInputElement; pickr: PickrCtor | undefined; ready: Promise; private _swatchEl; private _labels; constructor(el: HTMLInputElement, options: Partial); static get defaults(): ColorInputOptions; static init(el: HTMLInputElement, options?: Partial): ColorInput; static init(els: InitElements, options?: Partial): ColorInput[]; static getInstance(el: HTMLInputElement): ColorInput; destroy(): void; _handleInputChange: () => void; _handleLabelClick: (event: MouseEvent) => void; _setup(): Promise; } interface AirDatepickerFieldOptions extends BaseOptions$1 { locale?: unknown; } declare class AirDatepickerField extends Component { el: HTMLInputElement; picker: AirDatepickerCtor | undefined; ready: Promise; private _triggers; private _handleOutsideClick; constructor(el: HTMLInputElement, options: Partial); static get defaults(): AirDatepickerFieldOptions; static init(el: HTMLInputElement, options?: Partial): AirDatepickerField; static init(els: InitElements, options?: Partial): AirDatepickerField[]; static getInstance(el: HTMLInputElement): AirDatepickerField; destroy(): void; private _handleTriggerClick; _setup(): Promise; } type FilePondPluginName = 'image-preview' | 'file-validate-type' | 'image-exif-orientation'; interface FileInputOptions extends BaseOptions$1 { /** Which optional FilePond plugins to register - each is its own optional peerDependency. */ plugins: FilePondPluginName[]; } declare class FileInput extends Component { pond: FilePondNS.FilePond | undefined; ready: Promise; private _fileEl; private _pathEl; constructor(el: HTMLElement, options: Partial); static get defaults(): FileInputOptions; static init(el: HTMLElement, options?: Partial): FileInput; static init(els: InitElements, options?: Partial): FileInput[]; static getInstance(el: HTMLElement): FileInput; destroy(): void; /** Convenience wrapper over the underlying FilePond instance's own getFiles(). */ getFiles(): FilePondNS.FilePondFile[]; _setup(): Promise; _syncPathInput: () => void; } interface RemoteDataSpec { url: string; value: string; label: string; search?: string; dataKey?: string; } interface TomSelectFieldOptions extends BaseOptions$1 { remote?: RemoteDataSpec; settings?: RecursivePartial; } declare class TomSelectField extends Component { el: HTMLSelectElement; tomSelect: TomSelectCtor | undefined; ready: Promise; private _dependsOnEl; /** Popup whose scrolling must keep a body-mounted menu aligned. */ private _dropdownScrollParent; constructor(el: HTMLSelectElement, options: Partial); static get defaults(): TomSelectFieldOptions; static init(el: HTMLSelectElement, options?: Partial): TomSelectField; static init(els: InitElements, options?: Partial): TomSelectField[]; static getInstance(el: HTMLSelectElement): TomSelectField; /** Release the widget and its dependency and popup listeners. */ destroy(): void; _handleDependencyChange: () => void; /** Keep portalled menus aligned with controls inside scrolling popups. */ private _handlePopupScroll; /** Let popup menus escape clipped content without overriding authored settings. */ private _setupPopupDropdown; /** Load the optional peer and enhance the native select. */ _setup(): Promise; } interface TapTargetOptions extends BaseOptions$1 { /** * Callback function called when Tap Target is opened. * @default null */ onOpen: (origin: HTMLElement) => void; /** * Callback function called when Tap Target is closed. * @default null */ onClose: (origin: HTMLElement) => void; } declare class TapTarget extends Component implements Openable { /** * If the tap target is open. */ isOpen: boolean; static _taptargets: TapTarget[]; private wrapper; private originEl; private waveEl; private contentEl; constructor(el: HTMLElement, options: Partial); static get defaults(): TapTargetOptions; /** * Initializes instance of TapTarget. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): TapTarget; /** * Initializes instances of TapTarget. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): TapTarget[]; static getInstance(el: HTMLElement): TapTarget; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleThrottledResize: () => void; _handleKeyboardInteraction: (e: KeyboardEvent) => void; _handleTargetToggle: () => void; _handleResize: () => void; _handleDocumentClick: (e: MouseEvent | TouchEvent | KeyboardEvent) => void; _setup(): void; private _offset; _calculatePositioning(): void; /** * Open Tap Target. */ open: () => void; /** * Close Tap Target. */ close: () => void; } interface BaseOptions { } type InputElement = HTMLInputElement | HTMLTextAreaElement; declare class CharacterCounter extends Component { el: InputElement; /** Stores the reference to the counter HTML element. */ counterEl: HTMLSpanElement; /** Specifies whether the input is valid or not. */ isInvalid: boolean; /** Specifies whether the input text has valid length or not. */ isValidLength: boolean; constructor(el: HTMLInputElement | HTMLTextAreaElement, options: Partial); static get defaults(): BaseOptions; /** * Initializes instance of CharacterCounter. * @param el HTML element. * @param options Component options. */ static init(el: InputElement, options?: Partial): CharacterCounter; /** * Initializes instances of CharacterCounter. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): CharacterCounter[]; static getInstance(el: InputElement): CharacterCounter; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _setupCounter(): void; _removeCounter(): void; updateCounter: () => void; _validateInput(): void; } declare class Edges { top: boolean; right: boolean; bottom: boolean; left: boolean; } declare class Bounding { left: number; top: number; width: number; height: number; } /** * Class with utilitary functions for global usage. */ declare class Utils { /** Specifies wether tab is pressed or not. */ static tabPressed: boolean; /** Specifies wether there is a key pressed. */ static keyDown: boolean; /** * Key maps. */ static keys: { TAB: string[]; ENTER: string[]; ESC: string[]; BACKSPACE: string[]; ARROW_UP: string[]; ARROW_DOWN: string[]; ARROW_LEFT: string[]; ARROW_RIGHT: string[]; DELETE: string[]; }; /** * Detects when a key is pressed. * @param e Event instance. */ static docHandleKeydown(e: KeyboardEvent): void; /** * Detects when a key is released. * @param e Event instance. */ static docHandleKeyup(e: KeyboardEvent): void; /** * Detects when document is focused. * @param e Event instance. */ static docHandleFocus(e: FocusEvent): void; /** * Detects when document is not focused. * @param e Event instance. */ static docHandleBlur(e: FocusEvent): void; /** * Generates a unique string identifier. */ static guid(): string; /** * Checks for exceeded edges * @param container Container element. * @param bounding Bounding rect. * @param offset Element offset. */ static checkWithinContainer(container: HTMLElement, bounding: Bounding, offset: number): Edges; /** * Checks if element can be aligned in multiple directions. * @param el Element to be inspected. * @param container Container element. * @param bounding Bounding rect. * @param offset Element offset. */ static checkPossibleAlignments(el: HTMLElement, container: HTMLElement, bounding: Bounding, offset: number): { top: boolean; right: boolean; bottom: boolean; left: boolean; spaceOnTop: number; spaceOnRight: number; spaceOnBottom: number; spaceOnLeft: number; }; /** * Retrieves target element id from trigger. * @param trigger Trigger element. */ static getIdFromTrigger(trigger: HTMLElement): string; /** * Retrieves document scroll postion from top. */ static getDocumentScrollTop(): number; /** * Retrieves document scroll postion from left. */ static getDocumentScrollLeft(): number; /** * Fires the given function after a certain ammount of time. * @param func Function to be fired. * @param wait Wait time. * @param options Additional options. */ static throttle(func: (Function: object) => void, wait: number, options?: Partial<{ leading: boolean; trailing: boolean; }>): (...args: any[]) => any; /** * Renders confirm/close buttons with callback function */ static createConfirmationContainer(container: HTMLElement, confirmText: string, cancelText: string, onConfirm: (Function: object) => void, onCancel: (Function: object) => void): void; /** * Renders a button with optional callback function */ static createButton(container: HTMLElement, text: string, className?: string[], visibility?: boolean, callback?: (Function: object) => void): void; static _setAbsolutePosition(origin: HTMLElement, container: HTMLElement, position: string, margin: number, transitionMovement: number, align?: string): { x: number; y: number; }; static _repositionWithinScreen(x: number, y: number, width: number, height: number, margin: number, transitionMovement: number, align: string): { x: number; y: number; }; } interface ParallaxOptions extends BaseOptions$1 { /** * The minimum width of the screen, in pixels, where the parallax functionality starts working. * @default 0 */ responsiveThreshold: number; } declare class Parallax extends Component { private _enabled; private _img; static _parallaxes: Parallax[]; static _handleScrollThrottled: () => Utils; static _handleWindowResizeThrottled: () => Utils; constructor(el: HTMLElement, options: Partial); static get defaults(): ParallaxOptions; /** * Initializes instance of Parallax. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Parallax; /** * Initializes instances of Parallax. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Parallax[]; static getInstance(el: HTMLElement): Parallax; destroy(): void; static _handleScroll(): void; static _handleWindowResize(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _setupStyles(): void; _handleImageLoad: () => void; private _offset; _updateParallax(): void; } interface PushpinOptions extends BaseOptions$1 { /** * The distance in pixels from the top of the page where * the element becomes fixed. * @default 0 */ top: number; /** * The distance in pixels from the top of the page where * the elements stops being fixed. * @default Infinity */ bottom: number; /** * The offset from the top the element will be fixed at. * @default 0 */ offset: number; /** * Callback function called when pushpin position changes. * You are provided with a position string. * @default null */ onPositionChange: (position: 'pinned' | 'pin-top' | 'pin-bottom') => void; } declare class Pushpin extends Component { static _pushpins: Pushpin[]; originalOffset: number; constructor(el: HTMLElement, options: Partial); static get defaults(): PushpinOptions; /** * Initializes instance of Pushpin. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): Pushpin; /** * Initializes instances of Pushpin. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): Pushpin[]; static getInstance(el: HTMLElement): Pushpin; destroy(): void; static _updateElements(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _updatePosition(): void; _removePinClasses(): void; } interface ScrollSpyOptions extends BaseOptions$1 { /** * Throttle of scroll handler. * @default 100 */ throttle: number; /** * Offset for centering element when scrolled to. * @default 200 */ scrollOffset: number; /** * Class applied to active elements. * @default 'active' */ activeClass: string; /** * Used to find active element. * @default id => 'a[href="#' + id + '"]' */ getActiveElement: (id: string) => string; /** * Used to keep last top element active even if * scrollbar goes outside of scrollspy elements. * * If there is no last top element, * then the active one will be the first element. * * @default false */ keepTopElementActive: boolean; /** * Used to set scroll animation duration in milliseconds. * @default null (browser's native animation implementation/duration) */ animationDuration: number | null; } declare class ScrollSpy extends Component { static _elements: ScrollSpy[]; static _count: number; static _increment: number; static _elementsInView: ScrollSpy[]; static _visibleElements: HTMLElement[]; static _ticks: number; static _keptTopActiveElement: HTMLElement | null; private tickId; private id; constructor(el: HTMLElement, options: Partial); static get defaults(): ScrollSpyOptions; /** * Initializes instance of ScrollSpy. * @param el HTML element. * @param options Component options. */ static init(el: HTMLElement, options?: Partial): ScrollSpy; /** * Initializes instances of ScrollSpy. * @param els HTML elements. * @param options Component options. */ static init(els: InitElements, options?: Partial): ScrollSpy[]; static getInstance(el: HTMLElement): ScrollSpy; destroy(): void; _setupEventHandlers(): void; _removeEventHandlers(): void; _handleThrottledResize: () => void; _handleTriggerClick: (e: MouseEvent) => void; _handleWindowScroll: () => void; static _offset(el: any): { top: number; left: number; }; static _findElements(top: number, right: number, bottom: number, left: number): ScrollSpy[]; _enter(): void; _exit(): void; private _resetKeptTopActiveElementIfNeeded; private static _getDistanceToViewport; private static _smoothScrollIntoView; } // type RGBColor = { // r: number; // g: number; // b: number; // }; // type Position = { // x: number; // y: number; // }; class Waves { /** * * @param {HTMLElement} el * @returns */ static #offset(el) { const box = el.getBoundingClientRect(); const docElem = document.documentElement; return { top: box.top + window.pageYOffset - docElem.clientTop, left: box.left + window.pageXOffset - docElem.clientLeft }; } // https://phoenix-dx.com/css-techniques-for-material-ripple-effect/ /** * * @param {HTMLElement} targetElement * @param position * @param color */ static renderWaveEffect(targetElement, position = null, color = null) { const isCentered = position === null; const duration = 500; let animationFrame, animationStart; const animationStep = (timestamp) => { if (!animationStart) animationStart = timestamp; const frame = timestamp - animationStart; if (frame < duration) { const easing = (frame / duration) * (2 - frame / duration); const circle = isCentered ? 'circle at 50% 50%' : `circle at ${position.x}px ${position.y}px`; const waveColor = `rgba(${color?.r || 0}, ${color?.g || 0}, ${color?.b || 0}, ${0.3 * (1 - easing)})`; const stop = 90 * easing + '%'; targetElement.style.backgroundImage = 'radial-gradient(' + circle + ', ' + waveColor + ' ' + stop + ', transparent ' + stop + ')'; animationFrame = window.requestAnimationFrame(animationStep); } else { targetElement.style.backgroundImage = 'none'; window.cancelAnimationFrame(animationFrame); } }; animationFrame = window.requestAnimationFrame(animationStep); } static Init() { if (typeof document !== 'undefined') document?.addEventListener('DOMContentLoaded', () => { document.body.addEventListener('click', (e) => { const trigger = e.target; const el = trigger.closest('.waves-effect'); if (el && el.contains(trigger)) { const isCircular = el.classList.contains('waves-circle'); const x = e.pageX - this.#offset(el).left; const y = e.pageY - this.#offset(el).top; let color = null; if (el.classList.contains('waves-light')) color = { r: 255, g: 255, b: 255 }; this.renderWaveEffect(el, isCircular ? null : { x, y }, color); } }); }); } } /** Initialize Materialize dropdowns and the additional button selection states. */ declare function initMaterialButtons(root: HTMLElement): () => void; /** Enhance a submission-style checklist. Ordinary lists need no initialization. */ declare function initListChecklist(root: HTMLElement): () => void; interface ChartPrintOptions { /** PDF-only theme. Does not change the application theme. Defaults to light. */ theme?: 'light' | 'dark'; /** Paper format. Defaults to A3. */ format?: 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'letter' | 'legal' | 'tabloid'; /** Page orientation. Defaults to landscape. */ orientation?: 'portrait' | 'landscape'; } declare function chartPrintLayout(width: number, height: number, options?: ChartPrintOptions): { format: "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | "letter" | "legal" | "tabloid"; orientation: "portrait" | "landscape"; scale: number; printableWidth: number; printableHeight: number; left: number; top: number; }; /** Print a full-size snapshot, without changing the live chart or its zoom. */ declare function printChart(stage: HTMLElement, title: string, options?: ChartPrintOptions): Promise; interface OrgChartAppearance { color?: string; textColor?: string; borderColor?: string; accent?: string; accentPosition?: "top" | "right" | "bottom" | "left"; } interface OrgChartTeam extends OrgChartAppearance { id: string; name: string; x?: number; y?: number; } interface OrgChartPerson extends OrgChartAppearance { id: string; teamId: string; name: string; role?: string; /** Custom avatar text; defaults to initials derived from name. */ avatarText?: string; /** Image URL. A failed image falls back to avatarText or initials. */ avatarImage?: string; /** How the image fills the avatar. Defaults to cover. */ avatarFit?: "cover" | "contain" | "fill" | "none" | "scale-down"; } interface OrgChartLink { from: string; to: string; fromType?: "person" | "team"; toType?: "person" | "team"; label?: string; } interface OrgChartData { teams: OrgChartTeam[]; people: OrgChartPerson[]; links: OrgChartLink[]; } interface OrgChartOptions { data: OrgChartData; /** Shared movement default. Individual movement options take precedence. */ draggable?: boolean; /** Allow team movement. Defaults to draggable, then true. */ draggableTeams?: boolean; /** Allow person reordering and movement between teams. Defaults to draggable, then true. */ draggablePeople?: boolean; /** Enable mouse/touch connection ports on cards and groups. Defaults to true. */ connectable?: boolean; /** Allow inline link-label editing. Defaults to false. */ editable?: boolean; orientation?: "horizontal" | "vertical"; onChange?: (data: OrgChartData) => void; zoom?: number; minZoom?: number; maxZoom?: number; onZoomChange?: (zoom: number) => void; } /** Materialize organization chart; no graph dependency. */ declare class OrgChart { private el; private options; private get canDragTeams(); private get canDragPeople(); private zoom; private labelEditor?; private static instances; private data; private autoPositions; private stage; private svg; private summary; private people; private panels; private events; private observer; private drag?; private frame; private removeCardHandles?; private originalNodes; private hadClass; private removeGestures; private connections?; static init(el: HTMLElement, options: OrgChartOptions): OrgChart; static getInstance(el: HTMLElement): OrgChart | undefined; constructor(el: HTMLElement, options: OrgChartOptions); getData(): OrgChartData; /** Set the canvas scale, clamped to the configured limits. */ setZoom(value: number): void; /** Return the current canvas scale multiplier. */ getZoom(): number; /** Restore the canvas to 100% scale. */ resetZoom(): void; /** Open a full-chart print preview; select Save as PDF in the browser. */ exportPdf(title?: string, options?: ChartPrintOptions): Promise; private clampZoom; setData(data: OrgChartData): void; destroy(): void; private validate; private applyAppearance; private render; private scheduleDraw; private connectionPort; private rememberMissingPositions; private placeAutomaticTeams; private draw; private positionLabelEditor; private editLabel; private finishLabelEdit; private startDrag; private moveDrag; private endDrag; private moveWithKeyboard; private move; } interface CardHandleOptions { cardSelector: string; dropSelector: string; enabled: (card: HTMLElement) => boolean; onMove: (card: HTMLElement, from: HTMLElement, to: HTMLElement) => void; } /** Pointer-based handles keep ordinary swipes available for page scrolling. */ declare function enableCardHandles(root: HTMLElement, options: CardHandleOptions): () => void; interface ChartEndpoint { id: string; type: 'person' | 'team'; } /** Drag a connection port without moving the underlying card or team. */ declare function enableChartConnections(root: HTMLElement, stage: HTMLElement, getZoom: () => number, canConnect: (from: ChartEndpoint, to: ChartEndpoint) => boolean, connect: (from: ChartEndpoint, to: ChartEndpoint) => void): { cancel: () => void; destroy: () => void; }; /** Two-finger pinch and Ctrl/trackpad wheel zoom; ordinary wheel keeps scrolling. */ declare function enableChartGestures(root: HTMLElement, getZoom: () => number, setZoom: (zoom: number) => void, cancelDrag: () => void): () => void; /** * Front * * Front TS scripts for your Crazy App. * * @package kzarshenas/crazyphp * @author kekefreedog * @copyright 2022-2026 Kévin Zarshenas */ declare const Kmcomponent_base: { new (): HTMLElement; prototype: HTMLElement; }; /** * Kmcomponent * * Reactive web components using compiled Handlebars templates and SCSS styles. * Supports light DOM projection or native slots inside an open shadow root. * * @package kzarshenas/crazyphp * @author kekefreedog * @copyright 2022-2026 Kévin Zarshenas */ declare abstract class Kmcomponent> extends Kmcomponent_base { /** Static Parameters ****************************************************** */ /** @var properties Property schema, available before custom element registration */ static properties: KmcomponentProperties; /** @var template Compiled HBS function, HTML string, or module export */ static template: KmcomponentTemplate; /** @var styles Compiled CSS, context function, or css-loader export */ static styles: KmcomponentStyles; /** @var options Default rendering mode for instances of the component */ static options: KmcomponentOptions; /** Parameters ****************************************************** */ /** @var renderRoot Query this element or shadow root in component hooks */ readonly renderRoot: HTMLElement | ShadowRoot; /** @var updateComplete Resolves true after rendering, false if disconnected before the update */ updateComplete: Promise; /** Private Parameters ****************************************************** */ /** @var _values Current typed values, independent from the static schema */ private _values; /** @var _initialized Whether defaults have been validated and copied */ private _initialized; /** @var _pending Whether a render microtask is already queued */ private _pending; /** @var _reflecting Prevent attribute reflection from feeding back into property updates */ private _reflecting; /** @var _template Optional template override for this instance */ private _template?; /** @var _styles Optional stylesheet override for this instance */ private _styles?; /** @var _cleanups Resources to release before rerendering or disconnecting */ private _cleanups; /** @var _observer Observer for light DOM child changes */ private _observer; /** @var _children Supplied child nodes in their projection order */ private _children; /** @var _ownedRoots Template roots, excluded when collecting supplied children */ private _ownedRoots; /** @var _slots Light DOM insertion points and their original fallback content */ private _slots; /** @var _parking Retained children without a matching light DOM slot */ private _parking; /** * Constructor * * Choose the rendering root without reading attributes or supplied children. * Subclass fields are initialized after this constructor returns. * * @param options Rendering options overriding the static defaults */ constructor(options?: KmcomponentOptions); /** Methods | Events ****************************************************** */ /** * Post Render * * Called after the generated markup and projected children have been mounted. * Override to install event handlers or widgets, paired with onCleanup(). * * @return void */ postRender(): void; /** * On Cleanup * * Register a resource disposer for the current rendered content. * * @param cleanup Callback executed before rerendering or disconnecting * @return void */ onCleanup(cleanup: () => void): void; /** Public Methods | Properties ****************************************************** */ /** * Get Property * * Read a typed value, initializing per-instance defaults when necessary. * * @param name Declared property name * @return Current property value * @throws TypeError When the property is not declared */ getProperty(name: K): T[K]; /** * Set Property * * Update a typed value and optionally reflect it to the mapped HTML attribute. * Programmatic values must already match the declared type. * * @param name Declared property name * @param value New typed value * @return void * @throws TypeError When the value is invalid or cannot be serialized */ setProperty(name: K, value: T[K]): void; /** Public Methods | Rendering ****************************************************** */ /** * Set Html And Css * * Override the static assets for one instance, including constructor-based setup. * * @param html HTML string, compiled template, or module export * @param css CSS string, context function, or css-loader export * @return void */ setHtmlAndCss(html: KmcomponentTemplate, css: KmcomponentStyles): void; /** * Render * * Evaluate the template without mounting it or changing supplied children. * Styles are mounted separately during the scheduled update. * * @return Rendered HTML */ render(): string; /** * Request Update * * Batch synchronous changes into one render microtask. * Changes made while disconnected are rendered on the next connection. * * @return Promise resolving whether the queued update rendered */ requestUpdate(): Promise; /** Protected Methods ****************************************************** */ /** * Prepare Context * * Build the template data using the existing attributes/name convention. * Override to add component-specific context. * * @return Template context */ protected prepareContext(): KmcomponentContext; /** Private Methods | Properties ****************************************************** */ /** * Get Component * * Access declarations on the concrete subclass rather than instance fields. * * @return Component constructor */ private get component(); /** * Get Definition * * Resolve an own schema entry, rejecting undeclared property names. * * @param name Property name * @return Property definition */ private definition; /** * Clone Default * * Copy JSON-compatible defaults recursively so instances do not share objects. * * @param value Default value to copy * @return Independent copy of the value */ private clone; /** * Get Default Value * * Use the declared default or the empty value for the declared type. * * @param property Property definition * @return Fresh default value */ private defaultValue; /** * Validate Value * * Check the runtime type and any allowed scalar values. * * @param value Value to validate * @param property Property definition * @return Whether the value matches the schema */ private valid; /** * Initialize Properties * * Validate the schema and create each instance's initial values once. * * @return void * @throws TypeError When defaults or reflection options are inconsistent */ private initialize; /** * Convert Attribute * * Convert HTML strings to typed values. Invalid or removed attributes restore * the declared default, including explicit false and zero values. * * @param value HTML attribute value, or null when removed * @param property Property definition * @return Converted value or default */ private fromAttribute; /** Private Methods | Rendering ****************************************************** */ /** * Get Style Text * * Normalize styles while retaining css-loader's CSS-aware serialization. * * @return CSS text */ private styleText; /** * Update * * Prepare the new markup before replacing the current render. * Retain supplied light DOM nodes and mount them into the new insertion points. * * @return void */ private update; /** * Cleanup * * Release resources in reverse registration order. * Run every disposer even if one fails, then propagate the last error. * * @return void */ private cleanup; /** Private Methods | Children ****************************************************** */ /** * Collect Children * * Retain supplied nodes still owned by this component and discover newly * appended host children. Removed nodes must not return on the next render. * * @return void */ private collectChildren; /** * Project Children * * Assign supplied nodes to the first matching light DOM slot. * Restore fallback content for empty slots and retain unmatched nodes. * * @return void */ private projectChildren; /** * Observe Children * * Watch supplied child changes only in light DOM. Native shadow slots are * managed by the browser. Pause observation while performing internal moves. * * @return void */ private observeChildren; /** Methods | Callbacks ****************************************************** */ /** * Connected Callback * * Initialize values, resume child observation, and schedule rendering. * * @return void */ connectedCallback(): void; /** * Disconnected Callback * * Stop child observation and release resources for the current render. * * @return void */ disconnectedCallback(): void; /** * Attribute Changed Callback * * Keep typed values current even while detached, without reflection loops. * * @param name Changed HTML attribute name * @param oldValue Previous attribute value * @param newValue New attribute value, or null when removed * @return void */ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; /** Static Methods ****************************************************** */ /** * Observed Attributes * * Derive observed attributes from the static schema at registration time. * Duplicate mappings would make property updates ambiguous. * * @return Mapped HTML attribute names */ static get observedAttributes(): string[]; /** * Get Attribute Name * * Resolve and validate an optional lowercase HTML attribute mapping. * * @param name Property name * @param property Property definition * @return Mapped name, or null for a property without an attribute */ private static attributeName; } /** Interface ****************************************************** */ /** Shared property metadata, with allowed values restricted to scalar types. */ type PropertyOptions = { /** Declared runtime value type. */ type: Name; /** Initial value and fallback for removed or invalid attributes. */ default?: T; /** Observed HTML attribute; defaults to the lowercase property name. */ attribute?: boolean | string; /** Also write programmatic changes to the HTML attribute. Default: false. */ reflect?: boolean; /** Allowed scalar values; the default must belong to this collection. */ select?: [T] extends [string | number | boolean] ? readonly T[] : never; }; /** Supported property definitions and their corresponding default types. */ type KmcomponentProperty = PropertyOptions | PropertyOptions | PropertyOptions | PropertyOptions | PropertyOptions, "object">; /** Static property schema for one component class. */ type KmcomponentProperties = Record; /** Rendering configuration, fixed when an instance is constructed. */ interface KmcomponentOptions { /** false: light DOM (default); true: an open shadow root. Fixed at construction. */ shadow?: boolean; } /** Template data compatible with existing CrazyPHP Handlebars expressions. */ interface KmcomponentContext> { /** Current typed property values. */ attributes: T; /** Registered custom element tag name. */ name: string; } /** Compiled Handlebars function, literal HTML, or a default module wrapper. */ type KmcomponentTemplate = string | ((context: KmcomponentContext) => string) | { default: KmcomponentTemplate; }; /** Compiled CSS or loader output; style functions receive the template context. */ type KmcomponentStyles = string | ((context: KmcomponentContext) => string) | { default: KmcomponentStyles; } | { toString(): string; }; /** RegularBtn's attribute API, backed by the renamed Crazycomponent2 runtime. */ declare class CrazyButton extends Kmcomponent { static properties: KmcomponentProperties; /** Resolves when the current render’s optional tooltip has initialized. */ tooltipReady: Promise; getCurrentAttribute(name: string): unknown; hasCurrentAttribute(name: string): boolean; render(): string; postRender(): void; private restoreFocus; private applyColor; } /** Reactive Loading wrapper. Styles and behavior belong to the existing Loading component. */ declare class CrazyLoading extends Kmcomponent { static properties: KmcomponentProperties; get isActive(): boolean; /** Show the ring. Await updateComplete when reading the rendered status. */ start(label?: string): void; /** Hide the ring while retaining the logo or projected content. */ stop(label?: string): void; render(): string; postRender(): void; } /** Original no-attribute markup retains its 10rem size and application favicon. */ declare class LoadingScreenBtn extends CrazyLoading { static properties: KmcomponentProperties; } /** Initialize navbar overflow fades. Returns cleanup; safe to reinitialize. */ declare function initNavbarScroll(navbar: HTMLElement): () => void; interface EditorSpreadsheetColumn { header: string; value: string; /** Output cell type. Text is the default; numeric and checkbox preserve typed values. */ type?: 'text' | 'numeric' | 'checkbox'; width?: number; } interface EditorSpreadsheetResult { headers: string[]; rows: Jspreadsheet__default.CellValue[][]; } type EditorData = Record | Record[]; interface EditorDataSource { id: string; label: string; data?: EditorData; } interface EditorTemplate { id: string; label: string; template?: string; columns?: EditorSpreadsheetColumn[]; } type EditorSelectSettings = Omit, 'options' | 'items' | 'load' | 'valueField' | 'labelField' | 'maxItems' | 'create' | 'dropdownParent'>; /** Pass a Handlebars environment to supply your own helpers and partials. */ type EditorHelpers = Record; interface EditorEngine { compile(template: string, options?: { noEscape?: boolean; }): (data: EditorData, options?: { helpers?: EditorHelpers; }) => string; } interface EditorOptions { variant?: 'handlebars' | 'spreadsheet'; columns?: EditorSpreadsheetColumn[]; onColumnsChange?: (columns: EditorSpreadsheetColumn[]) => void; onSpreadsheetRender?: (result: EditorSpreadsheetResult) => void; template?: string; data?: EditorData; sources?: EditorDataSource[]; sourceId?: string; templates?: EditorTemplate[]; templateId?: string; /** Tom Select settings; false hides the corresponding selector. IDs and labels use id/label fields. */ templateSelect?: EditorSelectSettings | false; sourceSelect?: EditorSelectSettings | false; loadTemplates?: (query: string, signal: AbortSignal) => Promise; loadSources?: (query: string, signal: AbortSignal) => Promise; /** Called only when the selected entry has no cached content. */ loadTemplate?: (id: string, signal: AbortSignal) => Promise; loadData?: (id: string, signal: AbortSignal) => Promise; onTemplateChange?: (id: string) => void; onSourceChange?: (id: string) => void; debounce?: number; readOnly?: boolean; /** Prism HTML, CSS and Handlebars syntax highlighting. Defaults to true. */ highlight?: boolean; engine?: EditorEngine; /** Per-editor Handlebars helpers; never registered globally. */ helpers?: EditorHelpers; onChange?: (template: string) => void; onRender?: (html: string) => void; onError?: (error: Error) => void; } /** Handlebars template workspace with a data browser and isolated HTML preview. */ declare class Editor { readonly el: HTMLElement; readonly options: EditorOptions; private static instances; readonly ready: Promise; private engine?; private spreadsheetView?; private downloadQueue; private source; private lines; private highlight; private highlightCode; private prism?; private dropCaret; private dragPoint?; private _dragScroll?; private _dragScrollFrame?; private helpers; private undoStack; private redoStack; private currentSnapshot; private pendingInput?; private composition?; private lastTyping?; private tree; private search; private selector; private templateSelector; private sourceField?; private templateField?; private templates; private activeTemplate; private drafts; private templateRequest?; private dataRequest?; private listRequests; private status; private error; private frame; private wrapper; private controller; private originalNodes; private hadClass; private sources; private activeSource; private html; private timer?; private destroyed; private resizeObserver?; private version; private tokens; private compiled?; constructor(el: HTMLElement, options?: EditorOptions); static init(el: HTMLElement, options?: EditorOptions): Editor; static getInstance(el: HTMLElement): Editor | undefined; private validateData; private initialize; private build; /** Freeze native scrolling until movement inside the source requests edge scrolling. */ private _startDragScroll; private _updateDragScroll; private _stopDragScroll; private expression; private renderTokens; /** Resolve a drop point in the unwrapped, monospace textarea, including scroll offset. */ private positionAt; private showDropCaret; private syncHighlight; private updateHighlight; private updateLines; private snapshot; private recordEdit; private restoreSnapshot; /** Undo the latest source edit. Returns false when there is nothing to undo or editing is disabled. */ undo(): boolean; /** Restore the latest undone source edit. A new source edit clears redo history. */ redo(): boolean; private changed; private showError; private renderNow; /** Spreadsheet column definitions; use setColumns to update them. */ getColumns(): EditorSpreadsheetColumn[]; setColumns(columns: EditorSpreadsheetColumn[]): void; getSpreadsheetData(): EditorSpreadsheetResult; getWorksheet(): Jspreadsheet.WorksheetInstance; /** Refresh and download the generated worksheet, including column headers. */ download(format?: 'csv' | 'xlsx', filename?: string): Promise; private commitSpreadsheet; private dropSpreadsheetToken; private editingSource; getTemplateId(): string; getTemplate(): string; getHtml(): string; getSource(): string; setTemplate(template: string): void; /** Replace this editor's helpers and refresh the preview. */ setHelpers(helpers: EditorHelpers): void; setData(data: EditorData): void; /** Select a data source, loading its content once when omitted from the entry. */ setSource(id: string): Promise; /** Switch templates at the start of the document, retaining each template's local edits and undo history. */ selectTemplate(id: string): Promise; private addSelectOptions; private initializeSelectors; private setLoading; private showLoadError; /** Find the expression around the selection, ignoring braces inside quoted arguments. */ private expressionContext; /** Replace an argument under the pointer, or add a space-delimited argument. */ private argumentInsertion; insertToken(path: string | string[]): void; /** Insert a configured helper and leave the caret in its argument slot. */ insertHelper(name: string): void; render(): Promise; destroy(): void; } /** A toolbar element or an already initialized Kmaterialize Toolbar. */ type EditorToolbar = HTMLElement | Toolbar; /** Editable source text with a Prism presentation layer and native selection. */ interface ScriptEditorOptions { value: string; language: string; label: string; readOnly: boolean; tabSize: number; lineNumbers: boolean; onChange: ((value: string) => void) | null; } interface ScriptEditorSelection { start: number; end: number; } /** Code editor. Source is highlighted as text and is never executed. */ declare class ScriptEditor extends Component { ready: Promise; readonly textarea: HTMLTextAreaElement; private _pre; private _code; private _gutter; private _status; private _prism?; private _history; private _originalNodes; private _addedClass; private _controller; private _disconnect; private _destroyed; private _composing; constructor(el: HTMLElement, options?: Partial); static get defaults(): ScriptEditorOptions; static init(el: HTMLElement, options?: Partial): ScriptEditor; static init(els: InitElements, options?: Partial): ScriptEditor[]; static getInstance(el: HTMLElement): ScriptEditor; getValue(): string; /** Programmatic loads remain available in read-only mode and are undoable. */ setValue(value: string): void; getSelection(): ScriptEditorSelection; setSelection(start: number, end?: number): void; replaceSelection(text: string): void; /** Indent or outdent all selected lines, preserving their selection. */ indent(outdent?: boolean): void; undo(): void; redo(): void; /** Additional grammars must be loaded by the application before this call. */ setLanguage(language: string): void; setReadOnly(value: boolean): void; focus(): void; canExecute(command: string): boolean; execute(command: string): void; connectToolbar(toolbar: EditorToolbar): () => void; destroy(): void; private _loadPrism; private _snapshot; private _commit; private _restore; private _emitChange; private _render; private _onSelection; private _syncScroll; private _onInput; private _onCompositionStart; private _onCompositionEnd; private _onBeforeInput; private _escapeTab; private _onKeydown; } /** Structured screenplay writing, independent of the application's toolbar. */ type ScreenplayZoom = "fit-parent" | number; type ScreenplayBlockType = "scene" | "action" | "character" | "dialogue" | "parenthetical" | "transition"; interface ScreenplayBlock { id: string; type: ScreenplayBlockType; text: string; } interface ScreenplayDocument { title: string; blocks: ScreenplayBlock[]; } interface ScreenplayEditorOptions { document: ScreenplayDocument; readOnly: boolean; zoom: ScreenplayZoom; label: string; onChange: ((document: ScreenplayDocument) => void) | null; } declare class ScreenplayEditor extends Component { private _document; private _history; private _activeId; private _originalNodes; private _addedClass; private _controller; private _resize; private _resizeFrame; private _width; private _disconnect; private _destroyed; private _composing; private _focusedTitle; private _paper; private _pages; private _draggedBlock; private _dropIndex; private _title; private _cursor; constructor(el: HTMLElement, options?: Partial); static get defaults(): ScreenplayEditorOptions; static init(el: HTMLElement, options?: Partial): ScreenplayEditor; static init(els: InitElements, options?: Partial): ScreenplayEditor[]; static getInstance(el: HTMLElement): ScreenplayEditor; getDocument(): ScreenplayDocument; /** Validate before replacing; programmatic loads are allowed in read-only mode. */ setDocument(document: ScreenplayDocument): void; getActiveBlock(): ScreenplayBlock; insertBlock(type?: ScreenplayBlockType, text?: string, afterId?: string): string; updateBlock(id: string, patch: Partial>): void; setBlockType(type: ScreenplayBlockType): void; removeBlock(id?: string): void; moveBlock(id: string, index: number): void; toJSON(): string; fromJSON(json: string): void; /** Export readable plain text; this is not a Fountain or PDF serializer. */ toText(): string; undo(): void; redo(): void; setReadOnly(value: boolean): void; focus(id?: string, start?: number, end?: number): void; canExecute(command: string): boolean; execute(command: string, value?: string): void; connectToolbar(toolbar: EditorToolbar): () => void; destroy(): void; private _normalize; private _editable; /** Change preview size without changing physical screenplay formatting. */ setZoom(zoom: ScreenplayZoom): void; getZoom(): ScreenplayZoom; private _validateZoom; /** Read the number of complete A4 sheets in the writing layout. */ getPageCount(): number; private _input; private _render; /** Paginate at the same physical width at every screen size. */ private _fitText; private _createPage; private _onResize; private _scalePages; private _state; private _commit; private _emitChange; private _restore; private _onDragStart; private _onDragOver; private _onDrop; private _onDragLeave; private _clearDrop; private _clearDrag; private _rememberSelection; private _onFocus; private _onInput; private _onBeforeInput; private _onCompositionStart; private _onCompositionEnd; private _onKeydown; } /** Visual shot planning with editable cards and serializable document data. */ interface StoryboardShot { id: string; title: string; image: string; description: string; camera: string; duration: number; } interface StoryboardOptions { shots: StoryboardShot[]; readOnly: boolean; label: string; onChange: ((shots: StoryboardShot[]) => void) | null; } /** A storyboard owns data and editing; image storage remains application-owned. */ declare class Storyboard extends Component { private _shots; private _selectedId; private _history; private _originalNodes; private _addedClass; private _controller; private _disconnect; private _destroyed; private _grid; private _status; private _draggedId; private _dropIndex; constructor(el: HTMLElement, options?: Partial); static get defaults(): StoryboardOptions; static init(el: HTMLElement, options?: Partial): Storyboard; static init(els: InitElements, options?: Partial): Storyboard[]; static getInstance(el: HTMLElement): Storyboard; getShots(): StoryboardShot[]; setShots(shots: StoryboardShot[]): void; getSelectedShot(): StoryboardShot | null; selectShot(id: string): void; addShot(shot?: Partial>, index?: number): string; updateShot(id: string, patch: Partial>): void; duplicateShot(id?: string): string; removeShot(id?: string): void; moveShot(id: string, index: number): void; getTotalDuration(): number; toJSON(): string; fromJSON(json: string): void; undo(): void; redo(): void; setReadOnly(value: boolean): void; canExecute(command: string): boolean; execute(command: string): void; connectToolbar(toolbar: EditorToolbar): () => void; destroy(): void; private _editable; private _normalize; private _render; private _field; private _state; private _commit; private _emitChange; private _restore; private _focusSelected; private _onFocus; private _onClick; private _onDragStart; private _onDragOver; private _onDrop; private _onDragLeave; private _clearDrop; private _clearDrag; private _onInput; private _onChange; private _onBeforeInput; private _onKeydown; } declare const version = "2.3.3-1.0.40"; /** * Convenience helper matching v1's `M.toast({...})` call, since Toast is a * class in v2 with no bare functional equivalent of its own. */ declare function toast(options: Partial): Toast; interface AutoInitOptions { TinyNavbar?: Partial; NavbarAutoHide?: Partial; OtpInput?: Partial; MaskitoInput?: Partial; RichTextarea?: Partial; CodeCard?: Partial; Loading?: Partial; Alert?: Partial; Kanban?: Partial; Gantt?: Partial; Autocomplete?: Partial; Cards?: Partial; Carousel?: Partial; Chips?: Partial; Collapsible?: Partial; Datepicker?: Partial; Dropdown?: Partial; Materialbox?: Partial; Modal?: Partial; Parallax?: Partial; Pushpin?: Partial; ScrollSpy?: Partial; FormSelect?: Partial; Sidenav?: Partial; Tabs?: Partial; TapTarget?: Partial; Timepicker?: Partial; Tooltip?: Partial; FloatingActionButton?: Partial; Toolbar?: Partial; PasswordInput?: Partial; NumberInput?: Partial; ColorInput?: Partial; AirDatepickerField?: Partial; FileInput?: Partial; TomSelectField?: Partial; } /** * Automatically initialize components. * @param context Root element to initialize. Defaults to `document.body`. * @param options Options for each component. */ declare function AutoInit(context?: HTMLElement, options?: Partial): void; export { AirDatepickerField, Alert, AutoInit, Autocomplete, Cards, Carousel, CharacterCounter, Chips, CodeCard, Collapsible, ColorInput, CrazyButton, CrazyLoading, Datepicker, Dropdown, Editor, FileInput, FloatingActionButton, FormSelect, Forms, Gantt, Kanban, Kmcomponent, Loading, LoadingScreenBtn, MaskitoInput, Materialbox, Modal, NavbarAutoHide, NumberInput, OrgChart, OtpInput, Parallax, PasswordInput, Popup, Pushpin, Range, RangeInterval, RichTextarea, ScreenplayEditor, ScriptEditor, ScrollSpy, Sidenav, Slider, Storyboard, Tabs, TapTarget, Timepicker, TinyNavbar, Toast, TomSelectField, Toolbar, Tooltip, Waves, chartPrintLayout, enableCardHandles, enableChartConnections, enableChartGestures, initListChecklist, initMaterialButtons, initNavbarScroll, printChart, toast, version }; export type { AutoInitOptions, ChartEndpoint, ChartPrintOptions, CodeCardOptions, EditorData, EditorDataSource, EditorEngine, EditorHelpers, EditorOptions, EditorSelectSettings, EditorSpreadsheetColumn, EditorSpreadsheetResult, EditorTemplate, EditorToolbar, GanttDependencyChange, GanttEditAction, GanttOptions, GanttProgressMeter, GanttTask, GanttTaskChange, GanttTone, GanttView, KmcomponentContext, KmcomponentOptions, KmcomponentProperties, KmcomponentProperty, KmcomponentStyles, KmcomponentTemplate, MaskitoInputOptions, NavbarAutoHideOptions, OrgChartAppearance, OrgChartData, OrgChartLink, OrgChartOptions, OrgChartPerson, OrgChartTeam, OtpInputOptions, PopupOptions, PopupResult, PopupStep, PopupStepConfirmationOptions, PopupStepContext, PopupStepsOptions, RangeIntervalOptions, RangeOptions, RichTextareaOptions, ScreenplayBlock, ScreenplayBlockType, ScreenplayDocument, ScreenplayEditorOptions, ScreenplayZoom, ScriptEditorOptions, ScriptEditorSelection, StoryboardOptions, StoryboardShot, TinyNavbarOptions, TinyNavbarPosition, ToastOptions };