@timlassiter11/yatl-ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,768 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement, PropertyValues, nothing, ComplexAttributeConverter, ReactiveController, ReactiveControllerHost } from 'lit';
4
+ export { html, noChange, nothing, svg } from 'lit';
5
+ import * as _timlassiter11_yatl from '@timlassiter11/yatl';
6
+ import { UnspecifiedRecord, YatlTable, YatlTableController, DisplayColumnOptions } from '@timlassiter11/yatl';
7
+ export { unsafeHTML } from 'lit/directives/unsafe-html.js';
8
+
9
+ declare class YatlBase extends LitElement {
10
+ static styles: lit.CSSResult[];
11
+ }
12
+
13
+ type YatlButtonVariant = 'neutral' | 'outline' | 'plain';
14
+ type YatlButtonColor = 'neutral' | 'brand' | 'danger' | 'warning' | 'success' | 'raised' | 'muted';
15
+ declare class YatlButton extends YatlBase {
16
+ static styles: lit.CSSResult[];
17
+ disabled: boolean;
18
+ type: 'button' | 'submit' | 'reset';
19
+ variant: YatlButtonVariant;
20
+ color: YatlButtonColor;
21
+ protected render(): lit_html.TemplateResult<1>;
22
+ }
23
+ declare global {
24
+ interface HTMLElementTagNameMap {
25
+ 'yatl-button': YatlButton;
26
+ }
27
+ }
28
+
29
+ declare class YatlButtonGroup extends YatlBase {
30
+ static styles: lit.CSSResult[];
31
+ protected render(): lit_html.TemplateResult<1>;
32
+ private handleSlotChange;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ 'yatl-button-group': YatlButtonGroup;
37
+ }
38
+ }
39
+
40
+ declare class YatlCard extends YatlBase {
41
+ static styles: lit.CSSResult[];
42
+ private slotController;
43
+ protected render(): lit_html.TemplateResult<1>;
44
+ }
45
+ declare global {
46
+ interface HTMLElementTagNameMap {
47
+ 'yatl-card': YatlCard;
48
+ }
49
+ }
50
+
51
+ declare class YatlConfirmationDialog extends YatlBase {
52
+ static styles: lit.CSSResult[];
53
+ private dialogElement?;
54
+ open: boolean;
55
+ modal: boolean;
56
+ label: string;
57
+ acceptText: string;
58
+ rejectText: string;
59
+ show(): Promise<void>;
60
+ hide(): Promise<void>;
61
+ confirm(): Promise<boolean>;
62
+ accept(): Promise<void>;
63
+ reject(): Promise<void>;
64
+ protected render(): lit_html.TemplateResult<1>;
65
+ private handleDialogShow;
66
+ private handleDialogHide;
67
+ }
68
+ declare global {
69
+ interface HTMLElementTagNameMap {
70
+ 'yatl-confirmation-dialog': YatlConfirmationDialog;
71
+ }
72
+ }
73
+
74
+ declare class YatlDialog extends YatlBase {
75
+ static styles: lit.CSSResult[];
76
+ private _open;
77
+ private _transitionPromise?;
78
+ get transitionComplete(): Promise<void> | undefined;
79
+ private set transitionComplete(value);
80
+ get isTransitioning(): boolean;
81
+ private dialogElement?;
82
+ label: string;
83
+ modal: boolean;
84
+ get open(): boolean;
85
+ set open(value: boolean);
86
+ show(): Promise<void>;
87
+ hide(): Promise<void>;
88
+ protected firstUpdated(_changedProperties: PropertyValues): void;
89
+ protected render(): lit_html.TemplateResult<1>;
90
+ private requestClose;
91
+ private handleCloseClick;
92
+ private handleDialogPointerdown;
93
+ private handleDialogCancel;
94
+ }
95
+ declare global {
96
+ interface HTMLElementTagNameMap {
97
+ 'yatl-dialog': YatlDialog;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * @fires yatl-dropdown-select
103
+ * @fires yatl-dropdown-open
104
+ * @fires yatl-dropdown-close
105
+ */
106
+ declare class YatlDropdown extends YatlBase {
107
+ static styles: lit.CSSResult[];
108
+ private autoUpdateCleanup?;
109
+ private menuElement;
110
+ private triggerSlot?;
111
+ private defaultSlot?;
112
+ open: boolean;
113
+ matchWidth: boolean;
114
+ protected render(): lit_html.TemplateResult<1>;
115
+ protected updated(changedProperties: PropertyValues<YatlDropdown>): void;
116
+ disconnectedCallback(): void;
117
+ private handleTriggerClick;
118
+ private handleItemClick;
119
+ private handleTriggerKeydown;
120
+ private handleKeydown;
121
+ private handleDocumentFocusin;
122
+ private addListeners;
123
+ private removeListeners;
124
+ private getItems;
125
+ private getActiveItem;
126
+ private startPositioning;
127
+ private get referenceElement();
128
+ }
129
+ declare global {
130
+ interface HTMLElementTagNameMap {
131
+ 'yatl-dropdown': YatlDropdown;
132
+ }
133
+ }
134
+
135
+ declare class YatlIcon extends YatlBase {
136
+ static styles: lit.CSSResult[];
137
+ name: string;
138
+ viewBox: string;
139
+ label: string;
140
+ render(): lit_html.TemplateResult<1>;
141
+ }
142
+ declare global {
143
+ interface HTMLElementTagNameMap {
144
+ 'yatl-icon': YatlIcon;
145
+ }
146
+ }
147
+
148
+ declare class YatlOption extends YatlBase {
149
+ static styles: lit.CSSResult[];
150
+ value: string;
151
+ checkable: boolean;
152
+ checked: boolean;
153
+ disabled: boolean;
154
+ label: string;
155
+ protected render(): lit_html.TemplateResult<1>;
156
+ protected renderLabel(): lit_html.TemplateResult<1>;
157
+ protected renderCheck(): lit_html.TemplateResult<1> | typeof nothing;
158
+ connectedCallback(): void;
159
+ disconnectedCallback(): void;
160
+ private handleItemClicked;
161
+ }
162
+ declare global {
163
+ interface HTMLElementTagNameMap {
164
+ 'yatl-option': YatlOption;
165
+ }
166
+ }
167
+
168
+ /**
169
+ * A "Batteries Included" wrapper for `<yatl-table>` that provides a built-in toolbar.
170
+ *
171
+ * This element extends the core table engine to automatically render UI controls
172
+ * for common user actions, such as toggling column visibility and exporting data.
173
+ *
174
+ * It inherits all properties and events from `<yatl-table>`.
175
+ *
176
+ * @element yatl-table-ui
177
+ *
178
+ * @slot toolbar - Adds contents to the right of the toolbar button group
179
+ * @slot toolbar-button-group - Adds content into the toolbar button group.
180
+ * @slot footer - Inherited from `yatl-table`. Content to display in the table footer area.
181
+ * @slot body - Inherited from `yatl-table`. Custom rendering for the table body.
182
+ */
183
+ declare class YatlTableUi<T extends object = UnspecifiedRecord> extends YatlTable<T> {
184
+ static styles: lit.CSSResult[];
185
+ /**
186
+ * Toggles the visibility of the column picker button in the toolbar. Defaults to `true`.
187
+ */
188
+ showColumnPicker: boolean;
189
+ /**
190
+ * Toggles the visibility of the CSV export button in the toolbar. Defaults to `true`.
191
+ */
192
+ showExportButton: boolean;
193
+ protected render(): lit_html.TemplateResult<1>;
194
+ private handleTableExportClicked;
195
+ }
196
+ declare global {
197
+ interface HTMLElementTagNameMap {
198
+ 'yatl-table-ui': YatlTableUi;
199
+ }
200
+ }
201
+
202
+ declare class YatlTableView extends YatlTableUi {
203
+ static styles: lit.CSSResult[];
204
+ private tableContext;
205
+ protected willUpdate(changedProperties: PropertyValues<YatlTableView>): void;
206
+ protected render(): lit_html.TemplateResult<1>;
207
+ }
208
+ declare global {
209
+ interface HTMLElementTagNameMap {
210
+ 'yatl-table-view': YatlTableView;
211
+ }
212
+ }
213
+
214
+ /**
215
+ * @fires yatl-tag-dismiss-request
216
+ * @fires yatl-tag-dismiss
217
+ */
218
+ declare class YatlTag extends YatlBase {
219
+ static styles: lit.CSSResult[];
220
+ dismissable: boolean;
221
+ protected render(): lit_html.TemplateResult<1>;
222
+ protected renderClearIcon(): lit_html.TemplateResult<1> | typeof nothing;
223
+ private dismissClick;
224
+ }
225
+ declare global {
226
+ interface HTMLElementTagNameMap {
227
+ 'yatl-tag': YatlTag;
228
+ }
229
+ }
230
+
231
+ /**
232
+ * A table toolbar component with a search input, column picker, and export button.
233
+ *
234
+ * @element yatl-toolbar
235
+ * @summary Provides a cohesive set of controls for searching, exporting, and managing column visibility,
236
+ * along with a flexible slot for custom actions.
237
+ *
238
+ * @slot - Adds contents to the right of the toolbar button group
239
+ * @slot toolbar-button-group - Adds content into the toolbar button group.
240
+ * @slot column-picker-trigger - Replaces the button used to trigger the column picker.
241
+ * @slot column-picker-icon - Replaces the icon for the column picker button.
242
+ * @slot export-button-icon - Replaces the icon for the export button.
243
+ *
244
+ * @fires yatl-toolbar-search-input - Fired synchronously as the user types in the search box. Useful for real-time highlighting or suggestions.
245
+ * @fires yatl-toolbar-search-change - Fired when the user commits a search query (e.g., on 'Enter' or blur). Use this for triggering the actual table filter.
246
+ * @fires yatl-toolbar-export-click - Fired when the export button is clicked. Payload indicates the requested format.
247
+ * @fires yatl-column-toggle-request - Fired when a column's visibility is toggled in the dropdown. The consumer must handle this by updating the table state.
248
+ *
249
+ */
250
+ declare class YatlToolbar<T extends object = UnspecifiedRecord> extends YatlBase {
251
+ static styles: lit.CSSResult[];
252
+ private _controller?;
253
+ get controller(): YatlTableController<T> | undefined;
254
+ set controller(controller: YatlTableController<T> | undefined);
255
+ showColumnPicker: boolean;
256
+ showExportButton: boolean;
257
+ protected render(): lit_html.TemplateResult<1>;
258
+ protected renderColumnPicker(): lit_html.TemplateResult<1>;
259
+ protected renderColumnVisibilityToggle(column: DisplayColumnOptions<T>): lit_html.TemplateResult<1>;
260
+ private handleDropdownSelect;
261
+ protected renderExportButton(): lit_html.TemplateResult<1>;
262
+ private onSearchInput;
263
+ private onSearchChange;
264
+ private onExportClick;
265
+ }
266
+ declare global {
267
+ interface HTMLElementTagNameMap {
268
+ 'yatl-toolbar': YatlToolbar;
269
+ }
270
+ }
271
+
272
+ declare class YatlBaseFilter<T> extends YatlBase {
273
+ private _filterOptions?;
274
+ private _controller?;
275
+ get controller(): YatlTableController<_timlassiter11_yatl.UnspecifiedRecord> | undefined;
276
+ set controller(controller: YatlTableController<_timlassiter11_yatl.UnspecifiedRecord> | undefined);
277
+ private _value?;
278
+ get value(): T | undefined;
279
+ set value(value: T | undefined);
280
+ field: string;
281
+ label: string;
282
+ protected get filters(): Partial<{
283
+ [x: string]: unknown;
284
+ }> | null | undefined;
285
+ protected set filters(filters: Partial<{
286
+ [x: string]: unknown;
287
+ }> | null | undefined);
288
+ protected get options(): Map<T, number>;
289
+ protected willUpdate(changedProperties: PropertyValues): void;
290
+ protected updateFilters(): void;
291
+ private updateFilterOptions;
292
+ }
293
+
294
+ declare class YatlDateFilter extends YatlBaseFilter<Date> {
295
+ static styles: lit.CSSResult[];
296
+ protected render(): lit_html.TemplateResult<1>;
297
+ private handleChange;
298
+ }
299
+ declare global {
300
+ interface HTMLElementTagNameMap {
301
+ 'yatl-date-filter': YatlDateFilter;
302
+ }
303
+ }
304
+
305
+ declare class YatlSearchFilter extends YatlBaseFilter<string[]> {
306
+ static styles: lit.CSSResult[];
307
+ size: number;
308
+ protected render(): lit_html.TemplateResult<1>;
309
+ protected renderSelectOptions(): unknown;
310
+ protected renderDropdownOption(value: string, count: number): lit_html.TemplateResult<1>;
311
+ private handleSelectChange;
312
+ }
313
+ declare global {
314
+ interface HTMLElementTagNameMap {
315
+ 'yatl-search-filter': YatlSearchFilter;
316
+ }
317
+ }
318
+
319
+ declare class YatlSelectFilter extends YatlBaseFilter<string[]> {
320
+ static styles: lit.CSSResult[];
321
+ placeholder: string;
322
+ maxTags: number;
323
+ multi: boolean;
324
+ clearable: boolean;
325
+ protected render(): lit_html.TemplateResult<1>;
326
+ protected renderSelectOptions(): unknown;
327
+ protected renderDropdownOption(value: string, count: number): lit_html.TemplateResult<1>;
328
+ private handleSelectChange;
329
+ }
330
+ declare global {
331
+ interface HTMLElementTagNameMap {
332
+ 'yatl-select-filter': YatlSelectFilter;
333
+ }
334
+ }
335
+
336
+ type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | YatlFormControl;
337
+ declare abstract class YatlFormControl<TData = string, TInput extends FormControl = HTMLInputElement> extends YatlBase implements ElementInternals {
338
+ static formAssociated: boolean;
339
+ static shadowRootOptions: {
340
+ delegatesFocus: boolean;
341
+ clonable?: boolean;
342
+ customElementRegistry?: CustomElementRegistry;
343
+ mode: ShadowRootMode;
344
+ serializable?: boolean;
345
+ slotAssignment?: SlotAssignmentMode;
346
+ };
347
+ static styles: lit.CSSResult[];
348
+ protected readonly internals: ElementInternals;
349
+ private slotController;
350
+ /**
351
+ * Used to associate the label with the control element
352
+ */
353
+ readonly inputId = "input";
354
+ protected formControl?: TInput;
355
+ protected labelSlot?: HTMLSlotElement;
356
+ name: string;
357
+ label: string;
358
+ hint: string;
359
+ disabled: boolean;
360
+ readonly: boolean;
361
+ required: boolean;
362
+ inline: boolean;
363
+ abstract value?: TData;
364
+ abstract defaultValue?: TData;
365
+ abstract formValue: string | File | FormData | null;
366
+ protected onValueChange(_event: Event): boolean | void;
367
+ private _errorText;
368
+ get errorText(): string;
369
+ requiredText: string;
370
+ set errorText(newValue: string);
371
+ protected get hasLabel(): boolean;
372
+ protected get hasHint(): boolean;
373
+ protected get hasError(): boolean;
374
+ constructor();
375
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
376
+ connectedCallback(): void;
377
+ protected willUpdate(changedProperties: PropertyValues<YatlFormControl<TData, TInput>>): void;
378
+ protected render(): lit_html.TemplateResult<1>;
379
+ protected renderBase(contents: unknown): lit_html.TemplateResult<1>;
380
+ protected renderLabel(): unknown;
381
+ protected renderHint(): unknown;
382
+ protected renderErrorText(): unknown;
383
+ protected abstract renderInput(): unknown;
384
+ protected get hasErrorText(): boolean;
385
+ get labels(): NodeList;
386
+ get states(): CustomStateSet;
387
+ get validity(): ValidityState;
388
+ get validationMessage(): string;
389
+ get willValidate(): boolean;
390
+ get form(): HTMLFormElement | null;
391
+ setFormValue(value: string | File | FormData | null): void;
392
+ setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void;
393
+ checkValidity(): boolean;
394
+ reportValidity(): boolean;
395
+ formResetCallback(): void;
396
+ private updateValidity;
397
+ protected toggleState(name: string, state?: boolean): void;
398
+ private handleInputChange;
399
+ }
400
+
401
+ declare class YatlCheckbox extends YatlFormControl<string> {
402
+ static styles: lit.CSSResult[];
403
+ private _value;
404
+ private _uncheckedValue?;
405
+ /**
406
+ * The value to store in the form data if the checkbox is checked
407
+ */
408
+ get value(): string;
409
+ set value(value: string);
410
+ get defaultValue(): string;
411
+ get uncheckedValue(): string | undefined;
412
+ set uncheckedValue(value: string | undefined);
413
+ defaultChecked: boolean;
414
+ alwaysInclude: boolean;
415
+ inline: boolean;
416
+ private _checked;
417
+ get checked(): boolean;
418
+ set checked(value: boolean);
419
+ get formValue(): string | null;
420
+ formResetCallback(): void;
421
+ constructor();
422
+ connectedCallback(): void;
423
+ protected render(): lit_html.TemplateResult<1>;
424
+ protected renderInput(): lit_html.TemplateResult<1>;
425
+ private updateFormValue;
426
+ protected onValueChange(event: Event): void;
427
+ private handleClick;
428
+ }
429
+ declare global {
430
+ interface HTMLElementTagNameMap {
431
+ 'yatl-checkbox': YatlCheckbox;
432
+ }
433
+ }
434
+
435
+ declare class YatlDateInput extends YatlFormControl<Date> {
436
+ static styles: lit.CSSResult[];
437
+ placeholder: string;
438
+ size: number;
439
+ min?: Date;
440
+ max?: Date;
441
+ defaultValue?: Date;
442
+ private _value?;
443
+ get value(): Date | undefined;
444
+ set value(value: Date | undefined);
445
+ get formValue(): string | null;
446
+ protected renderInput(): lit_html.TemplateResult<1>;
447
+ protected onValueChange(event: Event): void;
448
+ }
449
+ declare global {
450
+ interface HTMLElementTagNameMap {
451
+ 'yatl-date-input': YatlDateInput;
452
+ }
453
+ }
454
+
455
+ type YatlInputType = 'email' | 'password' | 'search' | 'text' | 'tel' | 'url';
456
+ declare class YatlInput extends YatlFormControl<string> {
457
+ static styles: lit.CSSResult[];
458
+ type: YatlInputType;
459
+ size: number;
460
+ /** A regular expression pattern to validate input against. */
461
+ pattern?: string;
462
+ /** The input's minimum value. Only applies to date and number input types. */
463
+ placeholder: string;
464
+ passwordToggle: boolean;
465
+ /** The minimum length of input that will be considered valid. */
466
+ minlength?: number;
467
+ /** The maximum length of input that will be considered valid. */
468
+ maxlength?: number;
469
+ showCount: boolean;
470
+ defaultValue: string;
471
+ value: string;
472
+ get formValue(): string;
473
+ protected renderInput(): lit_html.TemplateResult<1>;
474
+ protected renderLabel(): lit_html.TemplateResult<1> | typeof nothing;
475
+ protected renderCount(): lit_html.TemplateResult<1>;
476
+ protected onValueChange(event: Event): void;
477
+ }
478
+ declare global {
479
+ interface HTMLElementTagNameMap {
480
+ 'yatl-input': YatlInput;
481
+ }
482
+ }
483
+
484
+ declare class YatlNumberInput extends YatlFormControl<number> {
485
+ static styles: lit.CSSResult[];
486
+ placeholder: string;
487
+ size: number;
488
+ min?: number;
489
+ max?: number;
490
+ defaultValue?: number;
491
+ value?: number;
492
+ get formValue(): string;
493
+ protected renderInput(): lit_html.TemplateResult<1>;
494
+ protected onValueChange(event: Event): void;
495
+ }
496
+ declare global {
497
+ interface HTMLElementTagNameMap {
498
+ 'yatl-number-input': YatlNumberInput;
499
+ }
500
+ }
501
+
502
+ declare class YatlRadio extends YatlFormControl<string> {
503
+ static styles: lit.CSSResult[];
504
+ private _value;
505
+ private _uncheckedValue?;
506
+ /**
507
+ * The value to store in the form data if the checkbox is checked
508
+ */
509
+ get value(): string;
510
+ set value(value: string);
511
+ get defaultValue(): string;
512
+ get uncheckedValue(): string | undefined;
513
+ set uncheckedValue(value: string | undefined);
514
+ defaultChecked: boolean;
515
+ alwaysInclude: boolean;
516
+ inline: boolean;
517
+ private _checked;
518
+ get checked(): boolean;
519
+ set checked(value: boolean);
520
+ get formValue(): string | null;
521
+ formResetCallback(): void;
522
+ constructor();
523
+ connectedCallback(): void;
524
+ protected render(): lit_html.TemplateResult<1>;
525
+ protected renderInput(): lit_html.TemplateResult<1>;
526
+ private updateFormValue;
527
+ protected onValueChange(event: Event): void;
528
+ private handleClick;
529
+ }
530
+ declare global {
531
+ interface HTMLElementTagNameMap {
532
+ 'yatl-radio': YatlRadio;
533
+ }
534
+ }
535
+
536
+ declare class YatlRadioGroup extends YatlFormControl<string> {
537
+ static styles: lit.CSSResult[];
538
+ defaultValue: string;
539
+ value: string;
540
+ get formValue(): string;
541
+ connectedCallback(): void;
542
+ protected render(): lit_html.TemplateResult<1>;
543
+ protected renderInput(): lit_html.TemplateResult<1>;
544
+ protected onValueChange(event: Event): boolean;
545
+ private syncChildStates;
546
+ private getAllChildren;
547
+ }
548
+ declare global {
549
+ interface HTMLElementTagNameMap {
550
+ 'yatl-radio-group': YatlRadioGroup;
551
+ }
552
+ }
553
+
554
+ declare class YatlSearchSelect extends YatlFormControl<string[]> {
555
+ static styles: lit.CSSResult[];
556
+ static shadowRootOptions: {
557
+ delegatesFocus: boolean;
558
+ clonable?: boolean;
559
+ customElementRegistry?: CustomElementRegistry;
560
+ mode: ShadowRootMode;
561
+ serializable?: boolean;
562
+ slotAssignment?: SlotAssignmentMode;
563
+ };
564
+ private noMatch;
565
+ private hasFocus;
566
+ placeholder: string;
567
+ noResultsText: string;
568
+ matchWidth: boolean;
569
+ size: number;
570
+ defaultValue: never[];
571
+ private _value;
572
+ get value(): string[];
573
+ set value(value: string[]);
574
+ get formValue(): FormData;
575
+ get hasSelection(): boolean;
576
+ constructor();
577
+ connectedCallback(): void;
578
+ disconnectedCallback(): void;
579
+ toggleOption(value: string, state?: boolean): void;
580
+ protected render(): lit_html.TemplateResult<1>;
581
+ protected renderInput(): lit_html.TemplateResult<1>;
582
+ protected renderContents(): unknown;
583
+ protected renderSelectedOptions(): unknown;
584
+ protected renderOption(option: YatlOption): lit_html.TemplateResult<1>;
585
+ private handleOptionClick;
586
+ private handleFocus;
587
+ private handleInput;
588
+ private handleSlotChange;
589
+ private handleSelectedOptionClick;
590
+ private updateVisibleOptions;
591
+ private updateSelectedOptions;
592
+ private getSelectedOptions;
593
+ private getAllOptions;
594
+ private dispatchChange;
595
+ }
596
+ declare global {
597
+ interface HTMLElementTagNameMap {
598
+ 'yatl-search-select': YatlSearchSelect;
599
+ }
600
+ }
601
+
602
+ declare class YatlSelect extends YatlFormControl<string[], YatlFormControl> {
603
+ static styles: lit.CSSResult[];
604
+ placeholder: string;
605
+ multi: boolean;
606
+ maxTags: number;
607
+ defaultValue: never[];
608
+ open: boolean;
609
+ clearable: boolean;
610
+ private _value;
611
+ get value(): string[];
612
+ set value(value: string[]);
613
+ get formValue(): FormData;
614
+ toggleOption(value: string, state?: boolean): void;
615
+ protected render(): lit_html.TemplateResult<1>;
616
+ protected renderInput(): lit_html.TemplateResult<1>;
617
+ protected renderDisplayValue(): lit_html.TemplateResult<1> | typeof nothing;
618
+ protected renderTags(): lit_html.TemplateResult<1> | typeof nothing;
619
+ protected renderTag(option: YatlOption): lit_html.TemplateResult<1>;
620
+ protected renderClearIcon(): lit_html.TemplateResult<1> | typeof nothing;
621
+ protected renderArrowIcon(): lit_html.TemplateResult<1>;
622
+ private handleTagDissmiss;
623
+ private handleSlotChange;
624
+ private handleClearButtonClick;
625
+ private handleDropdownToggle;
626
+ private handleDropdownSelect;
627
+ private updateSelectedOptions;
628
+ private getSelectedOptions;
629
+ private getAllOptions;
630
+ private dispatchChange;
631
+ }
632
+ declare global {
633
+ interface HTMLElementTagNameMap {
634
+ 'yatl-select': YatlSelect;
635
+ }
636
+ }
637
+
638
+ declare class YatlSwitch extends YatlFormControl<string> {
639
+ static styles: lit.CSSResult[];
640
+ private _value;
641
+ private _uncheckedValue?;
642
+ /**
643
+ * The value to store in the form data if the checkbox is checked
644
+ */
645
+ get value(): string;
646
+ set value(value: string);
647
+ get defaultValue(): string;
648
+ get uncheckedValue(): string | undefined;
649
+ set uncheckedValue(value: string | undefined);
650
+ defaultChecked: boolean;
651
+ alwaysInclude: boolean;
652
+ inline: boolean;
653
+ private _checked;
654
+ get checked(): boolean;
655
+ set checked(value: boolean);
656
+ get formValue(): string | null;
657
+ formResetCallback(): void;
658
+ constructor();
659
+ connectedCallback(): void;
660
+ protected render(): lit_html.TemplateResult<1>;
661
+ protected renderInput(): lit_html.TemplateResult<1>;
662
+ private updateFormValue;
663
+ protected onValueChange(event: Event): void;
664
+ private handleClick;
665
+ }
666
+ declare global {
667
+ interface HTMLElementTagNameMap {
668
+ 'yatl-switch': YatlSwitch;
669
+ }
670
+ }
671
+
672
+ declare class YatlTypeahead extends YatlFormControl {
673
+ static styles: lit.CSSResult[];
674
+ private _uri;
675
+ private _minQueryLength;
676
+ private _searchParam;
677
+ private _debounceTimer;
678
+ private loading;
679
+ private error;
680
+ private options;
681
+ private open;
682
+ placeholder: string;
683
+ defaultValue: string;
684
+ value: string;
685
+ get formValue(): string;
686
+ get uri(): string;
687
+ set uri(uri: string);
688
+ get minQueryLength(): number;
689
+ set minQueryLength(value: number);
690
+ get searchParam(): string;
691
+ set searchParam(value: string);
692
+ searchDebounce: number;
693
+ parser?: (value: unknown) => string[];
694
+ protected get hasOptions(): boolean;
695
+ protected get canSearch(): boolean;
696
+ protected render(): lit_html.TemplateResult<1>;
697
+ protected renderInput(): void;
698
+ protected renderDropdownContent(): unknown;
699
+ protected renderOption(option: string): lit_html.TemplateResult<1>;
700
+ protected onValueChange(event: Event): boolean | void;
701
+ private handleDropdownSelect;
702
+ private handleDropdownRequest;
703
+ private handleDropdownClose;
704
+ private scheduleFetch;
705
+ private updateOptions;
706
+ }
707
+ declare global {
708
+ interface HTMLElementTagNameMap {
709
+ 'yatl-typeahead': YatlTypeahead;
710
+ }
711
+ }
712
+
713
+ /**
714
+ * Retrieves the flattened list of elements assigned to a slot.
715
+ *
716
+ * Unlike the native `assignedElements({flatten: true})`, this function
717
+ * correctly falls back to the slot's default content (its light DOM children)
718
+ * if no nodes are assigned.
719
+ *
720
+ * It recursively resolves nested slots in the default content to ensure
721
+ * you always get the final rendered leaf elements.
722
+ */
723
+ declare function getEffectiveChildren(node: Node): Element[];
724
+ /**
725
+ * Lit Property converter to convert between date string and date objects
726
+ */
727
+ declare class DateConverter implements ComplexAttributeConverter<Date | undefined> {
728
+ fromAttribute(value: string): Date | undefined;
729
+ toAttribute(value: Date | string | undefined): string | null;
730
+ }
731
+ declare const dateConverter: DateConverter;
732
+ /**
733
+ * Use a generator so we can iterate and possibly break early.
734
+ * @example
735
+ * // to operate like a regular array. This kinda nullifies generator benefits, but worth knowing if you need the whole array.
736
+ * const allActiveElements = [...activeElements()]
737
+ *
738
+ * // Early return
739
+ * for (const activeElement of activeElements()) {
740
+ * if (<cond>) {
741
+ * break; // Break the loop, don't need to iterate over the whole array or store an array in memory!
742
+ * }
743
+ * }
744
+ */
745
+ declare function activeElements(activeElement?: Element | null): Generator<Element>;
746
+ declare function animateWithClass(element: HTMLElement, className: string, timeout?: number): Promise<void>;
747
+
748
+ /** A reactive controller that determines when slots exist. */
749
+ declare class HasSlotController implements ReactiveController {
750
+ private host;
751
+ private slotNames;
752
+ constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]);
753
+ private hasDefaultSlot;
754
+ private hasNamedSlot;
755
+ test(slotName: string): boolean;
756
+ hostConnected(): void;
757
+ hostDisconnected(): void;
758
+ private handleSlotChange;
759
+ }
760
+ /**
761
+ * Given a list of nodes, this function iterates over all of them and returns the concatenated
762
+ * HTML as a string. This is useful for getting the HTML that corresponds to a slot’s assigned nodes (since we can't use slot.innerHTML as an alternative).
763
+ * @param nodes - The list of nodes to iterate over.
764
+ * @param callback - A function that can be used to customize the HTML output for specific types of nodes. If the function returns undefined, the default HTML output will be used.
765
+ */
766
+ declare function getInnerHTML(nodes: Iterable<Node>, callback?: (node: Node) => string | undefined): string;
767
+
768
+ export { type FormControl, HasSlotController, YatlBaseFilter, YatlButton, type YatlButtonColor, YatlButtonGroup, type YatlButtonVariant, YatlCard, YatlCheckbox, YatlConfirmationDialog, YatlDateFilter, YatlDateInput, YatlDialog, YatlDropdown, YatlFormControl, YatlIcon, YatlInput, type YatlInputType, YatlNumberInput, YatlOption, YatlRadio, YatlRadioGroup, YatlSearchFilter, YatlSearchSelect, YatlSelect, YatlSelectFilter, YatlSwitch, YatlTableUi, YatlTableView, YatlTag, YatlToolbar, YatlTypeahead, activeElements, animateWithClass, dateConverter, getEffectiveChildren, getInnerHTML };