domma-js 0.20.0 → 0.21.0
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.
- package/assets/types/elements.d.ts +657 -606
- package/package.json +1 -1
- package/public/dist/bundles/domma-complete.css +184 -22
- package/public/dist/bundles/domma-data-focused.css +184 -22
- package/public/dist/bundles/domma-essentials.css +184 -22
- package/public/dist/bundles/domma-full.css +184 -22
- package/public/dist/bundles/domma-minimal.css +70 -16
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +65 -11
- package/public/dist/domma.esm.js +4 -4
- package/public/dist/domma.min.js +4 -4
- package/public/dist/elements.css +111 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
|
@@ -1,606 +1,657 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domma Elements Module - TypeScript Declarations
|
|
3
|
-
* UI Components: Card, Modal, Tabs, Accordion, Tooltip, Badge, Dropdown, Toast, Carousel, BackToTop
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// ============================================
|
|
7
|
-
// Common Types
|
|
8
|
-
// ============================================
|
|
9
|
-
|
|
10
|
-
export type AnimationType = 'fade' | 'slide' | 'zoom' | 'none';
|
|
11
|
-
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
12
|
-
export type DropdownPosition = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
13
|
-
export type ToastPosition = 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
|
|
14
|
-
export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
15
|
-
export type BadgeVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
16
|
-
export type BadgeSize = 'small' | 'medium' | 'large';
|
|
17
|
-
export type ShadowSize = 'none' | 'small' | 'medium' | 'large';
|
|
18
|
-
export type BackToTopPosition = 'bottom-right' | 'bottom-left';
|
|
19
|
-
|
|
20
|
-
// ============================================
|
|
21
|
-
// Base Component
|
|
22
|
-
// ============================================
|
|
23
|
-
|
|
24
|
-
export interface ComponentInstance {
|
|
25
|
-
/** The DOM element this component is attached to */
|
|
26
|
-
element: HTMLElement | null;
|
|
27
|
-
/** Component options */
|
|
28
|
-
options: Record<string, any>;
|
|
29
|
-
|
|
30
|
-
/** Update component options at runtime */
|
|
31
|
-
setOptions(newOptions: Record<string, any>): this;
|
|
32
|
-
|
|
33
|
-
/** Destroy the component and cleanup event listeners */
|
|
34
|
-
destroy(): void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// ============================================
|
|
38
|
-
// Card Component
|
|
39
|
-
// ============================================
|
|
40
|
-
|
|
41
|
-
export interface CardOptions {
|
|
42
|
-
/** Enable hover effects */
|
|
43
|
-
hoverable?: boolean;
|
|
44
|
-
/** Shadow size: 'none', 'small', 'medium', 'large' */
|
|
45
|
-
shadow?: ShadowSize;
|
|
46
|
-
/** Apply border radius */
|
|
47
|
-
rounded?: boolean;
|
|
48
|
-
/** Enable animations */
|
|
49
|
-
animation?: boolean;
|
|
50
|
-
/** Animation duration in ms */
|
|
51
|
-
animationDuration?: number;
|
|
52
|
-
/** Callback on mouse enter */
|
|
53
|
-
onHover?: (event: MouseEvent, card: CardInstance) => void;
|
|
54
|
-
/** Callback on mouse leave */
|
|
55
|
-
onLeave?: (event: MouseEvent, card: CardInstance) => void;
|
|
56
|
-
/** Callback on click */
|
|
57
|
-
onClick?: (event: MouseEvent, card: CardInstance) => void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface CardInstance extends ComponentInstance {
|
|
61
|
-
/** Set the shadow size */
|
|
62
|
-
setShadow(size: ShadowSize): this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ============================================
|
|
66
|
-
// Modal Component
|
|
67
|
-
// ============================================
|
|
68
|
-
|
|
69
|
-
export interface ModalOptions {
|
|
70
|
-
/** Show backdrop overlay */
|
|
71
|
-
backdrop?: boolean;
|
|
72
|
-
/** Close modal when clicking backdrop */
|
|
73
|
-
backdropClose?: boolean;
|
|
74
|
-
/** Close modal on Escape key */
|
|
75
|
-
keyboard?: boolean;
|
|
76
|
-
/** Animation type: 'fade', 'slide', 'zoom' */
|
|
77
|
-
animation?: AnimationType;
|
|
78
|
-
/** Animation duration in ms */
|
|
79
|
-
animationDuration?: number;
|
|
80
|
-
/** Show close button */
|
|
81
|
-
closeButton?: boolean;
|
|
82
|
-
/** Callback before opening */
|
|
83
|
-
onOpen?: (modal: ModalInstance) => void;
|
|
84
|
-
/** Callback after open animation completes */
|
|
85
|
-
onOpened?: (modal: ModalInstance) => void;
|
|
86
|
-
/** Callback before closing */
|
|
87
|
-
onClose?: (modal: ModalInstance) => void;
|
|
88
|
-
/** Callback after close animation completes */
|
|
89
|
-
onClosed?: (modal: ModalInstance) => void;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface ModalInstance extends ComponentInstance {
|
|
93
|
-
/** Open the modal */
|
|
94
|
-
open(): this;
|
|
95
|
-
|
|
96
|
-
/** Close the modal */
|
|
97
|
-
close(): this;
|
|
98
|
-
|
|
99
|
-
/** Toggle modal visibility */
|
|
100
|
-
toggle(): this;
|
|
101
|
-
|
|
102
|
-
/** Check if modal is currently open */
|
|
103
|
-
isOpen(): boolean;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ============================================
|
|
107
|
-
// Tabs Component
|
|
108
|
-
// ============================================
|
|
109
|
-
|
|
110
|
-
export interface TabChangeEvent {
|
|
111
|
-
index: number;
|
|
112
|
-
oldIndex: number;
|
|
113
|
-
tab: HTMLElement;
|
|
114
|
-
panel: HTMLElement;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface TabsOptions {
|
|
118
|
-
/** Initially active tab index */
|
|
119
|
-
active?: number;
|
|
120
|
-
/** Animation type */
|
|
121
|
-
animation?: 'fade' | 'none';
|
|
122
|
-
/** Animation duration in ms */
|
|
123
|
-
animationDuration?: number;
|
|
124
|
-
/** Selector for tab items */
|
|
125
|
-
tabSelector?: string;
|
|
126
|
-
/** Selector for tab panels */
|
|
127
|
-
panelSelector?: string;
|
|
128
|
-
/** CSS class for active state */
|
|
129
|
-
activeClass?: string;
|
|
130
|
-
/** Callback when tab changes */
|
|
131
|
-
onChange?: (event: TabChangeEvent) => void;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export interface TabsInstance extends ComponentInstance {
|
|
135
|
-
/** Activate a tab by index */
|
|
136
|
-
activate(index: number): this;
|
|
137
|
-
|
|
138
|
-
/** Alias for activate */
|
|
139
|
-
show(index: number): this;
|
|
140
|
-
|
|
141
|
-
/** Get the current active tab index */
|
|
142
|
-
getActive(): number;
|
|
143
|
-
|
|
144
|
-
/** Go to the next tab */
|
|
145
|
-
next(): this;
|
|
146
|
-
|
|
147
|
-
/** Go to the previous tab */
|
|
148
|
-
prev(): this;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// ============================================
|
|
152
|
-
// Accordion Component
|
|
153
|
-
// ============================================
|
|
154
|
-
|
|
155
|
-
export interface AccordionChangeEvent {
|
|
156
|
-
index: number;
|
|
157
|
-
isOpen: boolean;
|
|
158
|
-
header: HTMLElement;
|
|
159
|
-
content: HTMLElement;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface AccordionOptions {
|
|
163
|
-
/** Allow multiple panels open at once */
|
|
164
|
-
allowMultiple?: boolean;
|
|
165
|
-
/** Alias for allowMultiple */
|
|
166
|
-
multiExpand?: boolean;
|
|
167
|
-
/** Initially open panel index(es) */
|
|
168
|
-
activeIndex?: number | number[] | null;
|
|
169
|
-
/** Enable animations */
|
|
170
|
-
animation?: boolean;
|
|
171
|
-
/** Animation duration in ms */
|
|
172
|
-
animationDuration?: number;
|
|
173
|
-
/** Selector for accordion headers */
|
|
174
|
-
headerSelector?: string;
|
|
175
|
-
/** Selector for accordion content */
|
|
176
|
-
contentSelector?: string;
|
|
177
|
-
/** CSS class for active state */
|
|
178
|
-
activeClass?: string;
|
|
179
|
-
/** Callback when panel state changes */
|
|
180
|
-
onChange?: (event: AccordionChangeEvent) => void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export interface AccordionInstance extends ComponentInstance {
|
|
184
|
-
/** Toggle a panel by index */
|
|
185
|
-
toggle(index: number): this;
|
|
186
|
-
|
|
187
|
-
/** Open a panel by index */
|
|
188
|
-
open(index: number): this;
|
|
189
|
-
|
|
190
|
-
/** Close a panel by index */
|
|
191
|
-
close(index: number): this;
|
|
192
|
-
|
|
193
|
-
/** Open all panels */
|
|
194
|
-
openAll(): this;
|
|
195
|
-
|
|
196
|
-
/** Close all panels */
|
|
197
|
-
closeAll(): this;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// ============================================
|
|
201
|
-
// Tooltip Component
|
|
202
|
-
// ============================================
|
|
203
|
-
|
|
204
|
-
export interface TooltipDelay {
|
|
205
|
-
show: number;
|
|
206
|
-
hide: number;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export interface TooltipOptions {
|
|
210
|
-
/** Tooltip content */
|
|
211
|
-
content?: string;
|
|
212
|
-
/** Position relative to element */
|
|
213
|
-
position?: TooltipPosition;
|
|
214
|
-
/** How to trigger: 'hover', 'click', 'focus' */
|
|
215
|
-
trigger?: 'hover' | 'click' | 'focus';
|
|
216
|
-
/** Show/hide delay in ms */
|
|
217
|
-
delay?: TooltipDelay;
|
|
218
|
-
/** Enable animations */
|
|
219
|
-
animation?: boolean;
|
|
220
|
-
/** Animation duration in ms */
|
|
221
|
-
animationDuration?: number;
|
|
222
|
-
/** Allow HTML content */
|
|
223
|
-
html?: boolean;
|
|
224
|
-
/** Position offset [x, y] */
|
|
225
|
-
offset?: [number, number];
|
|
226
|
-
/** Container element for tooltip */
|
|
227
|
-
container?: HTMLElement | null;
|
|
228
|
-
/** Callback when tooltip shows */
|
|
229
|
-
onShow?: (tooltip: TooltipInstance) => void;
|
|
230
|
-
/** Callback when tooltip hides */
|
|
231
|
-
onHide?: (tooltip: TooltipInstance) => void;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface TooltipInstance extends ComponentInstance {
|
|
235
|
-
/** Show the tooltip */
|
|
236
|
-
show(): this;
|
|
237
|
-
|
|
238
|
-
/** Hide the tooltip */
|
|
239
|
-
hide(): this;
|
|
240
|
-
|
|
241
|
-
/** Toggle tooltip visibility */
|
|
242
|
-
toggle(): this;
|
|
243
|
-
|
|
244
|
-
/** Update tooltip content */
|
|
245
|
-
setContent(content: string): this;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// ============================================
|
|
249
|
-
// Badge Component
|
|
250
|
-
// ============================================
|
|
251
|
-
|
|
252
|
-
export interface BadgeOptions {
|
|
253
|
-
/** Badge variant/colour */
|
|
254
|
-
variant?: BadgeVariant;
|
|
255
|
-
/** Badge size */
|
|
256
|
-
size?: BadgeSize;
|
|
257
|
-
/** Use pill/rounded style */
|
|
258
|
-
pill?: boolean;
|
|
259
|
-
/** Use outline style */
|
|
260
|
-
outline?: boolean;
|
|
261
|
-
/** Show remove button */
|
|
262
|
-
removable?: boolean;
|
|
263
|
-
/** Callback on click */
|
|
264
|
-
onClick?: (event: MouseEvent, badge: BadgeInstance) => void;
|
|
265
|
-
/** Callback on remove */
|
|
266
|
-
onRemove?: (event: MouseEvent, badge: BadgeInstance) => void;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export interface BadgeInstance extends ComponentInstance {
|
|
270
|
-
/** Set the badge variant */
|
|
271
|
-
setVariant(variant: BadgeVariant): this;
|
|
272
|
-
|
|
273
|
-
/** Set the badge text */
|
|
274
|
-
setText(text: string): this;
|
|
275
|
-
|
|
276
|
-
/** Remove the badge from DOM */
|
|
277
|
-
remove(): void;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
/** Show
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Domma Elements Module - TypeScript Declarations
|
|
3
|
+
* UI Components: Card, Modal, Tabs, Accordion, Tooltip, Badge, Dropdown, Toast, Carousel, BackToTop
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ============================================
|
|
7
|
+
// Common Types
|
|
8
|
+
// ============================================
|
|
9
|
+
|
|
10
|
+
export type AnimationType = 'fade' | 'slide' | 'zoom' | 'none';
|
|
11
|
+
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
12
|
+
export type DropdownPosition = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
13
|
+
export type ToastPosition = 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
|
|
14
|
+
export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
15
|
+
export type BadgeVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
16
|
+
export type BadgeSize = 'small' | 'medium' | 'large';
|
|
17
|
+
export type ShadowSize = 'none' | 'small' | 'medium' | 'large';
|
|
18
|
+
export type BackToTopPosition = 'bottom-right' | 'bottom-left';
|
|
19
|
+
|
|
20
|
+
// ============================================
|
|
21
|
+
// Base Component
|
|
22
|
+
// ============================================
|
|
23
|
+
|
|
24
|
+
export interface ComponentInstance {
|
|
25
|
+
/** The DOM element this component is attached to */
|
|
26
|
+
element: HTMLElement | null;
|
|
27
|
+
/** Component options */
|
|
28
|
+
options: Record<string, any>;
|
|
29
|
+
|
|
30
|
+
/** Update component options at runtime */
|
|
31
|
+
setOptions(newOptions: Record<string, any>): this;
|
|
32
|
+
|
|
33
|
+
/** Destroy the component and cleanup event listeners */
|
|
34
|
+
destroy(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ============================================
|
|
38
|
+
// Card Component
|
|
39
|
+
// ============================================
|
|
40
|
+
|
|
41
|
+
export interface CardOptions {
|
|
42
|
+
/** Enable hover effects */
|
|
43
|
+
hoverable?: boolean;
|
|
44
|
+
/** Shadow size: 'none', 'small', 'medium', 'large' */
|
|
45
|
+
shadow?: ShadowSize;
|
|
46
|
+
/** Apply border radius */
|
|
47
|
+
rounded?: boolean;
|
|
48
|
+
/** Enable animations */
|
|
49
|
+
animation?: boolean;
|
|
50
|
+
/** Animation duration in ms */
|
|
51
|
+
animationDuration?: number;
|
|
52
|
+
/** Callback on mouse enter */
|
|
53
|
+
onHover?: (event: MouseEvent, card: CardInstance) => void;
|
|
54
|
+
/** Callback on mouse leave */
|
|
55
|
+
onLeave?: (event: MouseEvent, card: CardInstance) => void;
|
|
56
|
+
/** Callback on click */
|
|
57
|
+
onClick?: (event: MouseEvent, card: CardInstance) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface CardInstance extends ComponentInstance {
|
|
61
|
+
/** Set the shadow size */
|
|
62
|
+
setShadow(size: ShadowSize): this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ============================================
|
|
66
|
+
// Modal Component
|
|
67
|
+
// ============================================
|
|
68
|
+
|
|
69
|
+
export interface ModalOptions {
|
|
70
|
+
/** Show backdrop overlay */
|
|
71
|
+
backdrop?: boolean;
|
|
72
|
+
/** Close modal when clicking backdrop */
|
|
73
|
+
backdropClose?: boolean;
|
|
74
|
+
/** Close modal on Escape key */
|
|
75
|
+
keyboard?: boolean;
|
|
76
|
+
/** Animation type: 'fade', 'slide', 'zoom' */
|
|
77
|
+
animation?: AnimationType;
|
|
78
|
+
/** Animation duration in ms */
|
|
79
|
+
animationDuration?: number;
|
|
80
|
+
/** Show close button */
|
|
81
|
+
closeButton?: boolean;
|
|
82
|
+
/** Callback before opening */
|
|
83
|
+
onOpen?: (modal: ModalInstance) => void;
|
|
84
|
+
/** Callback after open animation completes */
|
|
85
|
+
onOpened?: (modal: ModalInstance) => void;
|
|
86
|
+
/** Callback before closing */
|
|
87
|
+
onClose?: (modal: ModalInstance) => void;
|
|
88
|
+
/** Callback after close animation completes */
|
|
89
|
+
onClosed?: (modal: ModalInstance) => void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ModalInstance extends ComponentInstance {
|
|
93
|
+
/** Open the modal */
|
|
94
|
+
open(): this;
|
|
95
|
+
|
|
96
|
+
/** Close the modal */
|
|
97
|
+
close(): this;
|
|
98
|
+
|
|
99
|
+
/** Toggle modal visibility */
|
|
100
|
+
toggle(): this;
|
|
101
|
+
|
|
102
|
+
/** Check if modal is currently open */
|
|
103
|
+
isOpen(): boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ============================================
|
|
107
|
+
// Tabs Component
|
|
108
|
+
// ============================================
|
|
109
|
+
|
|
110
|
+
export interface TabChangeEvent {
|
|
111
|
+
index: number;
|
|
112
|
+
oldIndex: number;
|
|
113
|
+
tab: HTMLElement;
|
|
114
|
+
panel: HTMLElement;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface TabsOptions {
|
|
118
|
+
/** Initially active tab index */
|
|
119
|
+
active?: number;
|
|
120
|
+
/** Animation type */
|
|
121
|
+
animation?: 'fade' | 'none';
|
|
122
|
+
/** Animation duration in ms */
|
|
123
|
+
animationDuration?: number;
|
|
124
|
+
/** Selector for tab items */
|
|
125
|
+
tabSelector?: string;
|
|
126
|
+
/** Selector for tab panels */
|
|
127
|
+
panelSelector?: string;
|
|
128
|
+
/** CSS class for active state */
|
|
129
|
+
activeClass?: string;
|
|
130
|
+
/** Callback when tab changes */
|
|
131
|
+
onChange?: (event: TabChangeEvent) => void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface TabsInstance extends ComponentInstance {
|
|
135
|
+
/** Activate a tab by index */
|
|
136
|
+
activate(index: number): this;
|
|
137
|
+
|
|
138
|
+
/** Alias for activate */
|
|
139
|
+
show(index: number): this;
|
|
140
|
+
|
|
141
|
+
/** Get the current active tab index */
|
|
142
|
+
getActive(): number;
|
|
143
|
+
|
|
144
|
+
/** Go to the next tab */
|
|
145
|
+
next(): this;
|
|
146
|
+
|
|
147
|
+
/** Go to the previous tab */
|
|
148
|
+
prev(): this;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ============================================
|
|
152
|
+
// Accordion Component
|
|
153
|
+
// ============================================
|
|
154
|
+
|
|
155
|
+
export interface AccordionChangeEvent {
|
|
156
|
+
index: number;
|
|
157
|
+
isOpen: boolean;
|
|
158
|
+
header: HTMLElement;
|
|
159
|
+
content: HTMLElement;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface AccordionOptions {
|
|
163
|
+
/** Allow multiple panels open at once */
|
|
164
|
+
allowMultiple?: boolean;
|
|
165
|
+
/** Alias for allowMultiple */
|
|
166
|
+
multiExpand?: boolean;
|
|
167
|
+
/** Initially open panel index(es) */
|
|
168
|
+
activeIndex?: number | number[] | null;
|
|
169
|
+
/** Enable animations */
|
|
170
|
+
animation?: boolean;
|
|
171
|
+
/** Animation duration in ms */
|
|
172
|
+
animationDuration?: number;
|
|
173
|
+
/** Selector for accordion headers */
|
|
174
|
+
headerSelector?: string;
|
|
175
|
+
/** Selector for accordion content */
|
|
176
|
+
contentSelector?: string;
|
|
177
|
+
/** CSS class for active state */
|
|
178
|
+
activeClass?: string;
|
|
179
|
+
/** Callback when panel state changes */
|
|
180
|
+
onChange?: (event: AccordionChangeEvent) => void;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface AccordionInstance extends ComponentInstance {
|
|
184
|
+
/** Toggle a panel by index */
|
|
185
|
+
toggle(index: number): this;
|
|
186
|
+
|
|
187
|
+
/** Open a panel by index */
|
|
188
|
+
open(index: number): this;
|
|
189
|
+
|
|
190
|
+
/** Close a panel by index */
|
|
191
|
+
close(index: number): this;
|
|
192
|
+
|
|
193
|
+
/** Open all panels */
|
|
194
|
+
openAll(): this;
|
|
195
|
+
|
|
196
|
+
/** Close all panels */
|
|
197
|
+
closeAll(): this;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// ============================================
|
|
201
|
+
// Tooltip Component
|
|
202
|
+
// ============================================
|
|
203
|
+
|
|
204
|
+
export interface TooltipDelay {
|
|
205
|
+
show: number;
|
|
206
|
+
hide: number;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface TooltipOptions {
|
|
210
|
+
/** Tooltip content */
|
|
211
|
+
content?: string;
|
|
212
|
+
/** Position relative to element */
|
|
213
|
+
position?: TooltipPosition;
|
|
214
|
+
/** How to trigger: 'hover', 'click', 'focus' */
|
|
215
|
+
trigger?: 'hover' | 'click' | 'focus';
|
|
216
|
+
/** Show/hide delay in ms */
|
|
217
|
+
delay?: TooltipDelay;
|
|
218
|
+
/** Enable animations */
|
|
219
|
+
animation?: boolean;
|
|
220
|
+
/** Animation duration in ms */
|
|
221
|
+
animationDuration?: number;
|
|
222
|
+
/** Allow HTML content */
|
|
223
|
+
html?: boolean;
|
|
224
|
+
/** Position offset [x, y] */
|
|
225
|
+
offset?: [number, number];
|
|
226
|
+
/** Container element for tooltip */
|
|
227
|
+
container?: HTMLElement | null;
|
|
228
|
+
/** Callback when tooltip shows */
|
|
229
|
+
onShow?: (tooltip: TooltipInstance) => void;
|
|
230
|
+
/** Callback when tooltip hides */
|
|
231
|
+
onHide?: (tooltip: TooltipInstance) => void;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface TooltipInstance extends ComponentInstance {
|
|
235
|
+
/** Show the tooltip */
|
|
236
|
+
show(): this;
|
|
237
|
+
|
|
238
|
+
/** Hide the tooltip */
|
|
239
|
+
hide(): this;
|
|
240
|
+
|
|
241
|
+
/** Toggle tooltip visibility */
|
|
242
|
+
toggle(): this;
|
|
243
|
+
|
|
244
|
+
/** Update tooltip content */
|
|
245
|
+
setContent(content: string): this;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// ============================================
|
|
249
|
+
// Badge Component
|
|
250
|
+
// ============================================
|
|
251
|
+
|
|
252
|
+
export interface BadgeOptions {
|
|
253
|
+
/** Badge variant/colour */
|
|
254
|
+
variant?: BadgeVariant;
|
|
255
|
+
/** Badge size */
|
|
256
|
+
size?: BadgeSize;
|
|
257
|
+
/** Use pill/rounded style */
|
|
258
|
+
pill?: boolean;
|
|
259
|
+
/** Use outline style */
|
|
260
|
+
outline?: boolean;
|
|
261
|
+
/** Show remove button */
|
|
262
|
+
removable?: boolean;
|
|
263
|
+
/** Callback on click */
|
|
264
|
+
onClick?: (event: MouseEvent, badge: BadgeInstance) => void;
|
|
265
|
+
/** Callback on remove */
|
|
266
|
+
onRemove?: (event: MouseEvent, badge: BadgeInstance) => void;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface BadgeInstance extends ComponentInstance {
|
|
270
|
+
/** Set the badge variant */
|
|
271
|
+
setVariant(variant: BadgeVariant): this;
|
|
272
|
+
|
|
273
|
+
/** Set the badge text */
|
|
274
|
+
setText(text: string): this;
|
|
275
|
+
|
|
276
|
+
/** Remove the badge from DOM */
|
|
277
|
+
remove(): void;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** Number badge colour variant */
|
|
281
|
+
export type NumberBadgeVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
282
|
+
|
|
283
|
+
export interface NumberBadgeOptions {
|
|
284
|
+
/** Initial count to display */
|
|
285
|
+
count?: number;
|
|
286
|
+
/** Colour variant (default: 'danger') */
|
|
287
|
+
variant?: NumberBadgeVariant;
|
|
288
|
+
/** Show as dot indicator instead of number */
|
|
289
|
+
dot?: boolean;
|
|
290
|
+
/** Enable pulse animation */
|
|
291
|
+
pulse?: boolean;
|
|
292
|
+
/** Custom border ring colour */
|
|
293
|
+
borderColor?: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface NumberBadgeInstance {
|
|
297
|
+
/** The wrapper web component element */
|
|
298
|
+
element: HTMLElement;
|
|
299
|
+
|
|
300
|
+
/** Set the badge count */
|
|
301
|
+
setCount(count: number): this;
|
|
302
|
+
|
|
303
|
+
/** Increment the badge count */
|
|
304
|
+
increment(by?: number): this;
|
|
305
|
+
|
|
306
|
+
/** Decrement the badge count (min 0) */
|
|
307
|
+
decrement(by?: number): this;
|
|
308
|
+
|
|
309
|
+
/** Toggle dot mode */
|
|
310
|
+
setDot(dot: boolean): this;
|
|
311
|
+
|
|
312
|
+
/** Set the colour variant */
|
|
313
|
+
setVariant(variant: NumberBadgeVariant): this;
|
|
314
|
+
|
|
315
|
+
/** Toggle pulse animation */
|
|
316
|
+
setPulse(pulse: boolean): this;
|
|
317
|
+
|
|
318
|
+
/** Get the current count */
|
|
319
|
+
getCount(): number;
|
|
320
|
+
|
|
321
|
+
/** Remove the badge and unwrap the element */
|
|
322
|
+
remove(): void;
|
|
323
|
+
|
|
324
|
+
/** Destroy the component */
|
|
325
|
+
destroy(): void;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// ============================================
|
|
329
|
+
// Dropdown Component
|
|
330
|
+
// ============================================
|
|
331
|
+
|
|
332
|
+
export interface DropdownItem {
|
|
333
|
+
/** Display text */
|
|
334
|
+
label?: string;
|
|
335
|
+
/** Alternative to label */
|
|
336
|
+
text?: string;
|
|
337
|
+
/** Alternative to label */
|
|
338
|
+
name?: string;
|
|
339
|
+
/** Value when selected */
|
|
340
|
+
value?: any;
|
|
341
|
+
/** Icon HTML */
|
|
342
|
+
icon?: string;
|
|
343
|
+
/** Disable item */
|
|
344
|
+
disabled?: boolean;
|
|
345
|
+
/** Render as divider */
|
|
346
|
+
divider?: boolean;
|
|
347
|
+
/** Render as header */
|
|
348
|
+
header?: string;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface DropdownSelectEvent {
|
|
352
|
+
item: DropdownItem | string;
|
|
353
|
+
index: number;
|
|
354
|
+
value: any;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export interface DropdownOptions {
|
|
358
|
+
/** How to trigger: 'click' or 'hover' */
|
|
359
|
+
trigger?: 'click' | 'hover';
|
|
360
|
+
/** Menu position */
|
|
361
|
+
position?: DropdownPosition;
|
|
362
|
+
/** Position offset [x, y] */
|
|
363
|
+
offset?: [number, number];
|
|
364
|
+
/** Enable animations */
|
|
365
|
+
animation?: boolean;
|
|
366
|
+
/** Animation duration in ms */
|
|
367
|
+
animationDuration?: number;
|
|
368
|
+
/** Close menu after item selection */
|
|
369
|
+
closeOnSelect?: boolean;
|
|
370
|
+
/** Close menu when clicking outside */
|
|
371
|
+
closeOnClickOutside?: boolean;
|
|
372
|
+
/** Menu items */
|
|
373
|
+
items?: (DropdownItem | string)[];
|
|
374
|
+
/** Bind to a Domma Model */
|
|
375
|
+
model?: any;
|
|
376
|
+
/** Model key for items array */
|
|
377
|
+
modelKey?: string;
|
|
378
|
+
/** Custom item template function */
|
|
379
|
+
itemTemplate?: (item: DropdownItem, index: number) => string;
|
|
380
|
+
/** Callback when menu opens */
|
|
381
|
+
onOpen?: (dropdown: DropdownInstance) => void;
|
|
382
|
+
/** Callback when menu closes */
|
|
383
|
+
onClose?: (dropdown: DropdownInstance) => void;
|
|
384
|
+
/** Callback when item is selected */
|
|
385
|
+
onSelect?: (event: DropdownSelectEvent, dropdown: DropdownInstance) => void;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export interface DropdownInstance extends ComponentInstance {
|
|
389
|
+
/** Open the dropdown menu */
|
|
390
|
+
open(): this;
|
|
391
|
+
|
|
392
|
+
/** Close the dropdown menu */
|
|
393
|
+
close(): this;
|
|
394
|
+
|
|
395
|
+
/** Toggle dropdown visibility */
|
|
396
|
+
toggle(): this;
|
|
397
|
+
|
|
398
|
+
/** Check if dropdown is open */
|
|
399
|
+
isOpen(): boolean;
|
|
400
|
+
|
|
401
|
+
/** Set menu items */
|
|
402
|
+
setItems(items: (DropdownItem | string)[]): this;
|
|
403
|
+
|
|
404
|
+
/** Add a menu item */
|
|
405
|
+
addItem(item: DropdownItem | string): this;
|
|
406
|
+
|
|
407
|
+
/** Remove item by index */
|
|
408
|
+
removeItem(index: number): this;
|
|
409
|
+
|
|
410
|
+
/** Get currently selected value */
|
|
411
|
+
getSelected(): any;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// ============================================
|
|
415
|
+
// Toast Component
|
|
416
|
+
// ============================================
|
|
417
|
+
|
|
418
|
+
export interface ToastAction {
|
|
419
|
+
/** Button label */
|
|
420
|
+
label: string;
|
|
421
|
+
/** Click handler */
|
|
422
|
+
onClick?: (toast: ToastInstance) => void;
|
|
423
|
+
/** Close toast on click */
|
|
424
|
+
closeOnClick?: boolean;
|
|
425
|
+
/** Primary style */
|
|
426
|
+
primary?: boolean;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface ToastOptions {
|
|
430
|
+
/** Toast position */
|
|
431
|
+
position?: ToastPosition;
|
|
432
|
+
/** Auto-dismiss duration in ms (0 = no auto-dismiss) */
|
|
433
|
+
duration?: number;
|
|
434
|
+
/** Pause countdown on hover */
|
|
435
|
+
pauseOnHover?: boolean;
|
|
436
|
+
/** Show progress bar */
|
|
437
|
+
showProgress?: boolean;
|
|
438
|
+
/** Animation style */
|
|
439
|
+
animation?: 'slide' | 'fade';
|
|
440
|
+
/** Animation duration in ms */
|
|
441
|
+
animationDuration?: number;
|
|
442
|
+
/** Show close button */
|
|
443
|
+
closable?: boolean;
|
|
444
|
+
/** Maximum number of toasts */
|
|
445
|
+
maxToasts?: number;
|
|
446
|
+
/** Toast type */
|
|
447
|
+
type?: ToastType;
|
|
448
|
+
/** Toast title */
|
|
449
|
+
title?: string;
|
|
450
|
+
/** Custom icon HTML */
|
|
451
|
+
icon?: string;
|
|
452
|
+
/** Allow HTML content */
|
|
453
|
+
html?: boolean;
|
|
454
|
+
/** Action buttons */
|
|
455
|
+
actions?: ToastAction[];
|
|
456
|
+
/** Callback when toast closes */
|
|
457
|
+
onClose?: (toast: ToastInstance) => void;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export interface ToastInstance {
|
|
461
|
+
/** Close the toast */
|
|
462
|
+
close(): void;
|
|
463
|
+
|
|
464
|
+
/** Update toast message */
|
|
465
|
+
update(message: string, options?: { html?: boolean }): this;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface ToastStatic {
|
|
469
|
+
/** Default options */
|
|
470
|
+
defaults: ToastOptions;
|
|
471
|
+
|
|
472
|
+
/** Show a toast message */
|
|
473
|
+
show(message: string, options?: ToastOptions): ToastInstance;
|
|
474
|
+
|
|
475
|
+
/** Show success toast */
|
|
476
|
+
success(message: string, options?: ToastOptions): ToastInstance;
|
|
477
|
+
|
|
478
|
+
/** Show error toast */
|
|
479
|
+
error(message: string, options?: ToastOptions): ToastInstance;
|
|
480
|
+
|
|
481
|
+
/** Show warning toast */
|
|
482
|
+
warning(message: string, options?: ToastOptions): ToastInstance;
|
|
483
|
+
|
|
484
|
+
/** Show info toast */
|
|
485
|
+
info(message: string, options?: ToastOptions): ToastInstance;
|
|
486
|
+
|
|
487
|
+
/** Close all toasts */
|
|
488
|
+
closeAll(): void;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// ============================================
|
|
492
|
+
// Carousel Component
|
|
493
|
+
// ============================================
|
|
494
|
+
|
|
495
|
+
export interface CarouselChangeEvent {
|
|
496
|
+
index: number;
|
|
497
|
+
oldIndex: number;
|
|
498
|
+
slide: HTMLElement;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export interface CarouselOptions {
|
|
502
|
+
/** Enable autoplay */
|
|
503
|
+
autoplay?: boolean;
|
|
504
|
+
/** Autoplay interval in ms */
|
|
505
|
+
interval?: number;
|
|
506
|
+
/** Pause autoplay on hover */
|
|
507
|
+
pauseOnHover?: boolean;
|
|
508
|
+
/** Loop back to start */
|
|
509
|
+
loop?: boolean;
|
|
510
|
+
/** Animation type: 'slide' or 'fade' */
|
|
511
|
+
animation?: 'slide' | 'fade';
|
|
512
|
+
/** Animation duration in ms */
|
|
513
|
+
animationDuration?: number;
|
|
514
|
+
/** Show navigation arrows */
|
|
515
|
+
showArrows?: boolean;
|
|
516
|
+
/** Show indicator dots */
|
|
517
|
+
showIndicators?: boolean;
|
|
518
|
+
/** Selector for slide elements */
|
|
519
|
+
slideSelector?: string;
|
|
520
|
+
/** CSS class for active state */
|
|
521
|
+
activeClass?: string;
|
|
522
|
+
/** Callback when slide changes */
|
|
523
|
+
onChange?: (event: CarouselChangeEvent) => void;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export interface CarouselInstance extends ComponentInstance {
|
|
527
|
+
/** Go to a specific slide */
|
|
528
|
+
goTo(index: number): this;
|
|
529
|
+
|
|
530
|
+
/** Go to next slide */
|
|
531
|
+
next(): this;
|
|
532
|
+
|
|
533
|
+
/** Go to previous slide */
|
|
534
|
+
prev(): this;
|
|
535
|
+
|
|
536
|
+
/** Start autoplay */
|
|
537
|
+
play(): this;
|
|
538
|
+
|
|
539
|
+
/** Stop autoplay */
|
|
540
|
+
pause(): this;
|
|
541
|
+
|
|
542
|
+
/** Get current slide index */
|
|
543
|
+
getIndex(): number;
|
|
544
|
+
|
|
545
|
+
/** Get slide element by index */
|
|
546
|
+
getSlide(index?: number): HTMLElement;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// ============================================
|
|
550
|
+
// BackToTop Component
|
|
551
|
+
// ============================================
|
|
552
|
+
|
|
553
|
+
export interface BackToTopScrollEvent {
|
|
554
|
+
scrollY: number;
|
|
555
|
+
isVisible: boolean;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export interface BackToTopShowEvent {
|
|
559
|
+
button: HTMLElement;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export interface BackToTopOptions {
|
|
563
|
+
/** Scroll distance to show button (null = viewport height) */
|
|
564
|
+
showAfter?: number | null;
|
|
565
|
+
/** Scroll animation duration in ms */
|
|
566
|
+
duration?: number;
|
|
567
|
+
/** Button position */
|
|
568
|
+
position?: BackToTopPosition;
|
|
569
|
+
/** Distance from edge in px */
|
|
570
|
+
offset?: number;
|
|
571
|
+
/** Existing button selector (null = create new) */
|
|
572
|
+
target?: string | HTMLElement | null;
|
|
573
|
+
/** z-index for button */
|
|
574
|
+
zIndex?: number;
|
|
575
|
+
/** Callback when button shows */
|
|
576
|
+
onShow?: (event: BackToTopShowEvent) => void;
|
|
577
|
+
/** Callback when button hides */
|
|
578
|
+
onHide?: (event: BackToTopShowEvent) => void;
|
|
579
|
+
/** Callback on scroll */
|
|
580
|
+
onScroll?: (event: BackToTopScrollEvent) => void;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export interface BackToTopInstance extends ComponentInstance {
|
|
584
|
+
/** Scroll to top */
|
|
585
|
+
scroll(): this;
|
|
586
|
+
|
|
587
|
+
/** Show the button */
|
|
588
|
+
show(): this;
|
|
589
|
+
|
|
590
|
+
/** Hide the button */
|
|
591
|
+
hide(): this;
|
|
592
|
+
|
|
593
|
+
/** Toggle button visibility */
|
|
594
|
+
toggle(): this;
|
|
595
|
+
|
|
596
|
+
/** Check if button is visible */
|
|
597
|
+
isVisible(): boolean;
|
|
598
|
+
|
|
599
|
+
/** Get the button element */
|
|
600
|
+
getButton(): HTMLElement;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// ============================================
|
|
604
|
+
// Elements Module
|
|
605
|
+
// ============================================
|
|
606
|
+
|
|
607
|
+
export interface Elements {
|
|
608
|
+
/** Create a Card component */
|
|
609
|
+
card(selector: string | HTMLElement, options?: CardOptions): CardInstance;
|
|
610
|
+
|
|
611
|
+
/** Create a Modal component */
|
|
612
|
+
modal(selector: string | HTMLElement, options?: ModalOptions): ModalInstance;
|
|
613
|
+
|
|
614
|
+
/** Create a Tabs component */
|
|
615
|
+
tabs(selector: string | HTMLElement, options?: TabsOptions): TabsInstance;
|
|
616
|
+
|
|
617
|
+
/** Create an Accordion component */
|
|
618
|
+
accordion(selector: string | HTMLElement, options?: AccordionOptions): AccordionInstance;
|
|
619
|
+
|
|
620
|
+
/** Create Tooltip(s) - returns array if multiple elements match */
|
|
621
|
+
tooltip(selector: string | HTMLElement, options?: TooltipOptions): TooltipInstance | TooltipInstance[];
|
|
622
|
+
|
|
623
|
+
/** Create Badge(s) - returns array if multiple elements match */
|
|
624
|
+
badge(selector: string | HTMLElement, options?: BadgeOptions): BadgeInstance | BadgeInstance[];
|
|
625
|
+
|
|
626
|
+
/** Create a NumberBadge notification counter on an element */
|
|
627
|
+
numberBadge(selector: string | HTMLElement, options?: NumberBadgeOptions): NumberBadgeInstance;
|
|
628
|
+
|
|
629
|
+
/** Create a Dropdown component */
|
|
630
|
+
dropdown(selector: string | HTMLElement, options?: DropdownOptions): DropdownInstance;
|
|
631
|
+
|
|
632
|
+
/** Create a Carousel component */
|
|
633
|
+
carousel(selector: string | HTMLElement, options?: CarouselOptions): CarouselInstance;
|
|
634
|
+
|
|
635
|
+
/** Create a BackToTop component */
|
|
636
|
+
backToTop(selector?: string | HTMLElement, options?: BackToTopOptions): BackToTopInstance;
|
|
637
|
+
|
|
638
|
+
/** Toast notification system */
|
|
639
|
+
toast: ToastStatic;
|
|
640
|
+
|
|
641
|
+
/** Get component instance for an element */
|
|
642
|
+
get(selector: string | HTMLElement): ComponentInstance | undefined;
|
|
643
|
+
|
|
644
|
+
/** Destroy a component */
|
|
645
|
+
destroy(selector: string | HTMLElement): void;
|
|
646
|
+
|
|
647
|
+
/** Destroy all components */
|
|
648
|
+
destroyAll(): void;
|
|
649
|
+
|
|
650
|
+
/** Register a custom component class */
|
|
651
|
+
register(name: string, ComponentClass: new (selector: any, options?: any) => ComponentInstance): void;
|
|
652
|
+
|
|
653
|
+
/** Create a registered custom component */
|
|
654
|
+
create(name: string, selector: string | HTMLElement, options?: Record<string, any>): ComponentInstance;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export declare const elements: Elements;
|