Skip to content

Commit 1cc9d85

Browse files
committed
Prepare V5.1.0
* preparing launch of 5.1.0 * performance improvements * update tests 100% coverage * update types
1 parent 19e8607 commit 1cc9d85

File tree

165 files changed

+4234
-4025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+4234
-4025
lines changed

.npmignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ node_modules
66
experiments
77
docs
88
coverage
9-
test/__screenshots__
9+
vite.config.mts
10+
vite.config.components.mts
11+
vitest.config.mts
12+
vitest.config-ui.mts
13+
test
14+
src

dist/bootstrap-native.cjs

+1-1
Large diffs are not rendered by default.

dist/bootstrap-native.cjs.map

+1-1
Large diffs are not rendered by default.

dist/bootstrap-native.d.ts

+63-52
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { default as default_2 } from '@thednp/position-observer';
2+
import { TouchEvent as TouchEvent_2 } from '@thednp/shorty';
23

34
/** Creates a new Alert instance. */
45
export declare class Alert extends BaseComponent {
56
static selector: string;
6-
static init: (element: HTMLElement) => Alert;
7-
static getInstance: (element: HTMLElement) => Alert | null;
7+
static init: (element: Element) => Alert;
8+
static getInstance: (element: Element) => Alert | null;
89
dismiss: HTMLElement | null;
9-
constructor(target: HTMLElement | string);
10+
constructor(target: Element | string);
1011
/** Returns component name string. */
1112
get name(): string;
1213
/**
@@ -27,13 +28,13 @@ export declare class Alert extends BaseComponent {
2728

2829
/** Returns a new `BaseComponent` instance. */
2930
declare class BaseComponent {
30-
element: HTMLElement;
31+
element: Element;
3132
options?: BaseOptions;
3233
/**
33-
* @param target `HTMLElement` or selector string
34+
* @param target `Element` or selector string
3435
* @param config component instance options
3536
*/
36-
constructor(target: HTMLElement | string, config?: BaseOptions);
37+
constructor(target: Element | string, config?: BaseOptions);
3738
get version(): string;
3839
get name(): string;
3940
get defaults(): {};
@@ -50,13 +51,14 @@ declare interface BaseOptions {
5051
/** Creates a new `Button` instance. */
5152
export declare class Button extends BaseComponent {
5253
static selector: string;
53-
static init: (element: HTMLElement) => Button;
54-
static getInstance: (element: HTMLElement) => Button | null;
54+
static init: (element: Element) => Button;
55+
static getInstance: (element: Element) => Button | null;
5556
isActive: boolean;
57+
element: HTMLElement;
5658
/**
5759
* @param target usually a `.btn` element
5860
*/
59-
constructor(target: HTMLElement | string);
61+
constructor(target: Element | string);
6062
/**
6163
* Returns component name string.
6264
*/
@@ -80,8 +82,9 @@ export declare class Button extends BaseComponent {
8082
/** Creates a new `Carousel` instance. */
8183
export declare class Carousel extends BaseComponent {
8284
static selector: string;
83-
static init: (element: HTMLElement) => Carousel;
84-
static getInstance: (element: HTMLElement) => Carousel | null;
85+
static init: (element: Element) => Carousel;
86+
static getInstance: (element: Element) => Carousel | null;
87+
element: HTMLElement;
8588
options: CarouselOptions;
8689
direction: "right" | "left";
8790
index: number;
@@ -94,7 +97,7 @@ export declare class Carousel extends BaseComponent {
9497
* @param target mostly a `.carousel` element
9598
* @param config instance options
9699
*/
97-
constructor(target: HTMLElement | string, config?: Partial<CarouselOptions>);
100+
constructor(target: Element | string, config?: Partial<CarouselOptions>);
98101
/**
99102
* Returns component name string.
100103
*/
@@ -145,16 +148,17 @@ declare interface CarouselOptions extends BaseOptions {
145148
/** Returns a new `Colapse` instance. */
146149
export declare class Collapse extends BaseComponent {
147150
static selector: string;
148-
static init: (element: HTMLElement) => Collapse;
149-
static getInstance: (element: HTMLElement) => Collapse | null;
151+
static init: (element: Element) => Collapse;
152+
static getInstance: (element: Element) => Collapse | null;
153+
element: HTMLElement;
150154
options: CollapseOptions;
151-
parent: HTMLElement | null;
152-
triggers: HTMLElement[];
155+
parent: Element | null;
156+
triggers: Element[];
153157
/**
154158
* @param target and `Element` that matches the selector
155159
* @param config instance options
156160
*/
157-
constructor(target: HTMLElement | string, config?: Partial<CollapseOptions>);
161+
constructor(target: Element | string, config?: Partial<CollapseOptions>);
158162
/**
159163
* Returns component name string.
160164
*/
@@ -188,8 +192,9 @@ declare interface CollapseOptions extends BaseOptions {
188192
/** Returns a new Dropdown instance. */
189193
export declare class Dropdown extends BaseComponent {
190194
static selector: string;
191-
static init: (element: HTMLElement) => Dropdown;
192-
static getInstance: (element: HTMLElement) => Dropdown | null;
195+
static init: (element: Element) => Dropdown;
196+
static getInstance: (element: Element) => Dropdown | null;
197+
element: HTMLElement;
193198
options: DropdownOptions;
194199
open: boolean;
195200
parentElement: HTMLElement;
@@ -199,7 +204,7 @@ export declare class Dropdown extends BaseComponent {
199204
* @param target Element or string selector
200205
* @param config the instance options
201206
*/
202-
constructor(target: HTMLElement | string, config?: Partial<DropdownOptions>);
207+
constructor(target: Element | string, config?: Partial<DropdownOptions>);
203208
/**
204209
* Returns component name string.
205210
*/
@@ -242,20 +247,21 @@ export declare const initCallback: (context?: ParentNode) => void;
242247
/** Returns a new `Modal` instance. */
243248
export declare class Modal extends BaseComponent {
244249
static selector: string;
245-
static init: (element: HTMLElement) => Modal;
246-
static getInstance: (element: HTMLElement) => Modal | null;
250+
static init: (element: Element) => Modal;
251+
static getInstance: (element: Element) => Modal | null;
252+
element: HTMLElement;
247253
options: ModalOptions;
248254
modalDialog: HTMLElement;
249255
triggers: HTMLElement[];
250256
isStatic: boolean;
251257
hasFade: boolean;
252-
relatedTarget: HTMLElement | null;
258+
relatedTarget: EventTarget & HTMLElement | null;
253259
_observer: ResizeObserver;
254260
/**
255261
* @param target usually the `.modal` element
256262
* @param config instance options
257263
*/
258-
constructor(target: HTMLElement | string, config?: Partial<ModalOptions>);
264+
constructor(target: Element | string, config?: Partial<ModalOptions>);
259265
/**
260266
* Returns component name string.
261267
*/
@@ -295,16 +301,17 @@ declare interface ModalOptions extends BaseOptions {
295301
/** Returns a new `Offcanvas` instance. */
296302
export declare class Offcanvas extends BaseComponent {
297303
static selector: string;
298-
static init: (element: HTMLElement) => Offcanvas;
299-
static getInstance: (element: HTMLElement) => Offcanvas | null;
304+
static init: (element: Element) => Offcanvas;
305+
static getInstance: (element: Element) => Offcanvas | null;
306+
element: HTMLElement;
300307
options: OffcanvasOptions;
301308
triggers: HTMLElement[];
302-
relatedTarget: HTMLElement | null;
309+
relatedTarget: EventTarget & HTMLElement | undefined;
303310
/**
304311
* @param target usually an `.offcanvas` element
305312
* @param config instance options
306313
*/
307-
constructor(target: HTMLElement | string, config?: Partial<OffcanvasOptions>);
314+
constructor(target: Element | string, config?: Partial<OffcanvasOptions>);
308315
/**
309316
* Returns component name string.
310317
*/
@@ -342,15 +349,15 @@ declare interface OffcanvasOptions extends BaseOptions {
342349
/** Returns a new `Popover` instance. */
343350
export declare class Popover extends Tooltip {
344351
static selector: string;
345-
static init: (element: HTMLElement) => Popover;
346-
static getInstance: (element: HTMLElement) => Popover | null;
347-
static styleTip: <T extends Tooltip>(self: T) => void;
352+
static init: (element: Element) => Popover;
353+
static getInstance: (element: Element) => Popover | null;
354+
static styleTip: (self: Tooltip) => void;
348355
options: PopoverOptions;
349356
/**
350357
* @param target the target element
351358
* @param config the instance options
352359
*/
353-
constructor(target: HTMLElement | string, config?: Partial<PopoverOptions>);
360+
constructor(target: Element | string, config?: Partial<PopoverOptions>);
354361
/**
355362
* Returns component name string.
356363
*/
@@ -379,8 +386,9 @@ export declare const removeDataAPI: (context?: ParentNode) => void;
379386
/** Returns a new `ScrollSpy` instance. */
380387
export declare class ScrollSpy extends BaseComponent {
381388
static selector: string;
382-
static init: (element: HTMLElement) => ScrollSpy;
383-
static getInstance: (element: HTMLElement) => ScrollSpy | null;
389+
static init: (element: Element) => ScrollSpy;
390+
static getInstance: (element: Element) => ScrollSpy | null;
391+
element: HTMLElement;
384392
options: ScrollSpyOptions;
385393
target: HTMLElement | null;
386394
scrollTarget: HTMLElement;
@@ -397,15 +405,15 @@ export declare class ScrollSpy extends BaseComponent {
397405
* @param target the target element
398406
* @param config the instance options
399407
*/
400-
constructor(target: HTMLElement | string, config?: Partial<ScrollSpyOptions>);
408+
constructor(target: Element | string, config?: Partial<ScrollSpyOptions>);
401409
/**
402410
* Returns component name string.
403411
*/
404412
get name(): string;
405413
/**
406414
* Returns component default options.
407415
*/
408-
get defaults(): ScrollSpyOptions;
416+
get defaults(): Partial<ScrollSpyOptions>;
409417
/** Updates all items. */
410418
refresh: () => void;
411419
/** Removes `ScrollSpy` from the target element. */
@@ -414,21 +422,22 @@ export declare class ScrollSpy extends BaseComponent {
414422

415423
declare interface ScrollSpyOptions extends BaseOptions {
416424
offset: number;
417-
target: HTMLElement | string | null;
425+
target: HTMLElement | string;
418426
}
419427

420428
/** Creates a new `Tab` instance. */
421429
export declare class Tab extends BaseComponent {
422430
static selector: string;
423-
static init: (element: HTMLElement) => Tab;
424-
static getInstance: (element: HTMLElement) => Tab | null;
431+
static init: (element: Element) => Tab;
432+
static getInstance: (element: Element) => Tab | null;
433+
element: HTMLElement;
425434
nav: HTMLElement | null;
426435
content: HTMLElement | null;
427436
tabContent: HTMLElement | null;
428437
nextContent: HTMLElement | null;
429438
dropdown: HTMLElement | null;
430439
/** @param target the target element */
431-
constructor(target: HTMLElement | string);
440+
constructor(target: Element | string);
432441
/**
433442
* Returns component name string.
434443
*/
@@ -448,8 +457,9 @@ export declare class Tab extends BaseComponent {
448457
/** Creates a new `Toast` instance. */
449458
export declare class Toast extends BaseComponent {
450459
static selector: string;
451-
static init: (element: HTMLElement) => Toast;
452-
static getInstance: (element: HTMLElement) => Toast | null;
460+
static init: (element: Element) => Toast;
461+
static getInstance: (element: Element) => Toast | null;
462+
element: HTMLElement;
453463
options: ToastOptions;
454464
dismiss: HTMLElement | null;
455465
triggers: HTMLElement[];
@@ -458,7 +468,7 @@ export declare class Toast extends BaseComponent {
458468
* @param target the target `.toast` element
459469
* @param config the instance options
460470
*/
461-
constructor(target: HTMLElement | string, config?: Partial<ToastOptions>);
471+
constructor(target: Element | string, config?: Partial<ToastOptions>);
462472
/**
463473
* Returns component name string.
464474
*/
@@ -498,23 +508,24 @@ declare interface ToastOptions extends BaseOptions {
498508
/** Creates a new `Tooltip` instance. */
499509
export declare class Tooltip extends BaseComponent {
500510
static selector: string;
501-
static init: (element: HTMLElement) => Tooltip;
502-
static getInstance: (element: HTMLElement) => Tooltip | null;
503-
static styleTip: <T extends Tooltip>(self: T) => void;
511+
static init: (element: Element) => Tooltip;
512+
static getInstance: (element: Element) => Tooltip | null;
513+
static styleTip: (self: Tooltip) => void;
514+
element: Element & HTMLOrSVGElement;
504515
options: TooltipOptions;
505516
btn?: HTMLElement;
506-
tooltip?: HTMLElement;
507-
container: ParentNode;
508-
arrow?: HTMLElement;
509-
offsetParent?: HTMLElement;
517+
tooltip: HTMLElement;
518+
container: HTMLElement;
519+
offsetParent: Element | Window;
520+
arrow: HTMLElement;
510521
enabled: boolean;
511522
id: string;
512523
_observer: default_2;
513524
/**
514525
* @param target the target element
515526
* @param config the instance options
516527
*/
517-
constructor(target: HTMLElement | string, config?: Partial<TooltipOptions>);
528+
constructor(target: Element | string, config?: Partial<TooltipOptions>);
518529
/**
519530
* Returns component name string.
520531
*/
@@ -547,7 +558,7 @@ export declare class Tooltip extends BaseComponent {
547558
* @this {Tooltip}
548559
* @param {TouchEvent} e the `Event` object
549560
*/
550-
handleTouch: ({ target }: TouchEvent) => void;
561+
handleTouch: ({ target }: TouchEvent_2) => void;
551562
/**
552563
* Toggles on/off the `Tooltip` event listeners.
553564
*

dist/bootstrap-native.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bootstrap-native.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)