mtrl 0.8.0 → 0.9.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.
- package/dist/components/badge/config.d.ts +2 -2
- package/dist/components/bottom-sheet/bottom-sheet.js +1 -1
- package/dist/components/bottom-sheet/config.d.ts +2 -2
- package/dist/components/bottom-sheet/features/drag.d.ts +2 -2
- package/dist/components/bottom-sheet/features/drag.js +1 -1
- package/dist/components/button/api.d.ts +3 -3
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/config.d.ts +2 -2
- package/dist/components/button/features/progress.d.ts +17 -5
- package/dist/components/button-group/config.d.ts +20 -0
- package/dist/components/card/api.d.ts +10 -1
- package/dist/components/card/api.js +6 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/config.d.ts +15 -9
- package/dist/components/card/content.js +5 -2
- package/dist/components/card/features.d.ts +2 -1
- package/dist/components/card/types.d.ts +5 -4
- package/dist/components/carousel/config.d.ts +2 -2
- package/dist/components/carousel/features/slides.js +3 -2
- package/dist/components/checkbox/config.d.ts +2 -2
- package/dist/components/checkbox/types.d.ts +15 -16
- package/dist/components/chips/api.d.ts +6 -6
- package/dist/components/chips/chip/api.d.ts +2 -2
- package/dist/components/chips/chip/config.d.ts +6 -7
- package/dist/components/chips/config.d.ts +2 -2
- package/dist/components/chips/features/dom.js +0 -1
- package/dist/components/chips/types.d.ts +12 -1
- package/dist/components/datepicker/api.d.ts +5 -2
- package/dist/components/datepicker/config.d.ts +16 -13
- package/dist/components/datepicker/datepicker.js +10 -4
- package/dist/components/datepicker/render.d.ts +14 -6
- package/dist/components/datepicker/render.js +1 -1
- package/dist/components/datepicker/types.d.ts +51 -3
- package/dist/components/dialog/api.d.ts +1 -1
- package/dist/components/dialog/config.d.ts +3 -4
- package/dist/components/dialog/config.js +1 -1
- package/dist/components/dialog/features.js +1 -1
- package/dist/components/dialog/types.d.ts +1 -1
- package/dist/components/divider/features.js +2 -0
- package/dist/components/drawer/api.d.ts +3 -3
- package/dist/components/drawer/config.d.ts +2 -2
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/features/headline.d.ts +12 -2
- package/dist/components/drawer/features/items.d.ts +17 -3
- package/dist/components/drawer/features/state.d.ts +14 -2
- package/dist/components/extended-fab/api.d.ts +12 -4
- package/dist/components/extended-fab/api.js +12 -0
- package/dist/components/extended-fab/config.d.ts +10 -10
- package/dist/components/extended-fab/types.d.ts +4 -2
- package/dist/components/fab/api.d.ts +9 -2
- package/dist/components/fab/api.js +12 -0
- package/dist/components/fab/config.d.ts +8 -8
- package/dist/components/fab/types.d.ts +2 -1
- package/dist/components/icon-button/config.d.ts +2 -2
- package/dist/components/icon-button/features/toggle.d.ts +1 -5
- package/dist/components/icon-button/types.d.ts +6 -0
- package/dist/components/list/api.d.ts +18 -18
- package/dist/components/list/config.d.ts +6 -3
- package/dist/components/list/config.js +6 -7
- package/dist/components/list/features/renderer.js +2 -2
- package/dist/components/list/list.d.ts +20 -1
- package/dist/components/list/types.d.ts +32 -32
- package/dist/components/loading-indicator/config.d.ts +2 -2
- package/dist/components/loading-indicator/types.d.ts +3 -1
- package/dist/components/menu/api.d.ts +6 -5
- package/dist/components/menu/config.d.ts +2 -2
- package/dist/components/menu/features/keyboard.d.ts +19 -9
- package/dist/components/menu/types.d.ts +25 -9
- package/dist/components/navigation/config.d.ts +2 -2
- package/dist/components/navigation/features/controller.d.ts +1 -3
- package/dist/components/navigation/features/items.d.ts +1 -2
- package/dist/components/navigation/system/core.d.ts +6 -6
- package/dist/components/navigation/system/events.d.ts +3 -3
- package/dist/components/navigation/system/mobile.d.ts +6 -6
- package/dist/components/navigation/system/state.d.ts +3 -3
- package/dist/components/navigation/system/types.d.ts +43 -11
- package/dist/components/navigation/types.d.ts +15 -6
- package/dist/components/navigation-rail/navigation-rail.js +2 -1
- package/dist/components/progress/api.js +0 -1
- package/dist/components/progress/config.d.ts +2 -2
- package/dist/components/progress/features/canvas.d.ts +14 -5
- package/dist/components/progress/features/state.d.ts +1 -2
- package/dist/components/progress/types.d.ts +1 -1
- package/dist/components/radios/config.d.ts +2 -2
- package/dist/components/search/api.js +4 -4
- package/dist/components/search/config.d.ts +2 -2
- package/dist/components/search/features/suggestions.d.ts +1 -3
- package/dist/components/search/features/suggestions.js +16 -15
- package/dist/components/search/search.js +1 -1
- package/dist/components/segmented-button/config.d.ts +1 -5
- package/dist/components/segmented-button/config.js +1 -1
- package/dist/components/select/api.d.ts +2 -2
- package/dist/components/select/features.d.ts +2 -2
- package/dist/components/select/features.js +2 -1
- package/dist/components/select/types.d.ts +38 -21
- package/dist/components/side-sheet/config.d.ts +2 -2
- package/dist/components/slider/api.d.ts +6 -6
- package/dist/components/slider/config.d.ts +2 -2
- package/dist/components/slider/types.d.ts +2 -2
- package/dist/components/snackbar/config.d.ts +2 -2
- package/dist/components/snackbar/features.d.ts +3 -3
- package/dist/components/snackbar/position.d.ts +1 -1
- package/dist/components/snackbar/types.d.ts +5 -6
- package/dist/components/split-button/api.js +1 -3
- package/dist/components/split-button/config.d.ts +2 -2
- package/dist/components/split-button/features/buttons.d.ts +3 -2
- package/dist/components/split-button/features/menu.d.ts +3 -2
- package/dist/components/split-button/types.d.ts +13 -2
- package/dist/components/switch/config.d.ts +2 -2
- package/dist/components/switch/types.d.ts +0 -1
- package/dist/components/tabs/api.d.ts +8 -5
- package/dist/components/tabs/config.d.ts +9 -1
- package/dist/components/tabs/features.d.ts +7 -11
- package/dist/components/tabs/features.js +2 -1
- package/dist/components/tabs/indicator.js +4 -2
- package/dist/components/tabs/responsive.js +2 -1
- package/dist/components/tabs/tab-api.d.ts +11 -5
- package/dist/components/tabs/tab-api.js +1 -1
- package/dist/components/tabs/tab.js +9 -1
- package/dist/components/tabs/types.d.ts +9 -2
- package/dist/components/tabs/utils.d.ts +14 -3
- package/dist/components/textfield/api.d.ts +1 -1
- package/dist/components/textfield/config.d.ts +2 -2
- package/dist/components/textfield/features/error.d.ts +1 -2
- package/dist/components/textfield/features/leading-icon.d.ts +1 -2
- package/dist/components/textfield/features/prefix-text.d.ts +1 -2
- package/dist/components/textfield/features/suffix-text.d.ts +1 -2
- package/dist/components/textfield/features/supporting-text.d.ts +1 -2
- package/dist/components/textfield/features/trailing-icon.d.ts +1 -2
- package/dist/components/textfield/types.d.ts +0 -2
- package/dist/components/timepicker/api.d.ts +5 -4
- package/dist/components/timepicker/config.d.ts +14 -11
- package/dist/components/tooltip/config.d.ts +2 -2
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/core/compose/base.d.ts +2 -2
- package/dist/core/compose/base.js +1 -1
- package/dist/core/compose/component.d.ts +13 -4
- package/dist/core/compose/component.js +1 -1
- package/dist/core/compose/features/badge.d.ts +3 -4
- package/dist/core/compose/features/badge.js +1 -1
- package/dist/core/compose/features/checkable.d.ts +3 -4
- package/dist/core/compose/features/debounce.d.ts +2 -3
- package/dist/core/compose/features/disabled.d.ts +1 -2
- package/dist/core/compose/features/events.d.ts +4 -3
- package/dist/core/compose/features/icon.d.ts +1 -5
- package/dist/core/compose/features/input.d.ts +2 -3
- package/dist/core/compose/features/lifecycle.d.ts +2 -2
- package/dist/core/compose/features/lifecycle.js +3 -3
- package/dist/core/compose/features/position.d.ts +1 -2
- package/dist/core/compose/features/ripple.d.ts +1 -2
- package/dist/core/compose/features/size.d.ts +1 -2
- package/dist/core/compose/features/style.d.ts +1 -2
- package/dist/core/compose/features/text.d.ts +1 -5
- package/dist/core/compose/features/textinput.d.ts +2 -3
- package/dist/core/compose/features/textlabel.d.ts +1 -2
- package/dist/core/compose/features/throttle.d.ts +1 -2
- package/dist/core/compose/features/track.d.ts +0 -1
- package/dist/core/compose/features/variant.d.ts +1 -2
- package/dist/core/compose/index.d.ts +1 -1
- package/dist/core/compose/pipe.d.ts +43 -3
- package/dist/core/compose/pipe.js +6 -2
- package/dist/core/compose/utils/type-guards.d.ts +4 -4
- package/dist/core/compose/utils/type-guards.js +1 -1
- package/dist/core/config/component.d.ts +12 -9
- package/dist/core/config/global.d.ts +12 -8
- package/dist/core/config.d.ts +1 -1
- package/dist/core/dom/attributes.d.ts +6 -6
- package/dist/core/dom/attributes.js +8 -5
- package/dist/core/dom/create.d.ts +27 -10
- package/dist/core/dom/create.js +5 -26
- package/dist/core/dom/utils.d.ts +1 -1
- package/dist/core/dom/utils.js +4 -1
- package/dist/core/state/emitter.d.ts +2 -2
- package/dist/core/state/events.d.ts +3 -3
- package/dist/core/state/lifecycle.d.ts +0 -1
- package/dist/core/state/store.d.ts +3 -3
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.js +1 -0
- package/dist/core/utils/object.d.ts +2 -2
- package/dist/core/utils/performance.d.ts +3 -3
- package/dist/core/utils/url.d.ts +20 -0
- package/dist/core/utils/url.js +0 -0
- package/dist/core/utils/validate.d.ts +6 -6
- package/dist/core/utils/validate.js +13 -12
- package/dist/index.cjs +0 -0
- package/dist/package.json +1 -1
- package/dist/styles/badge.css +2 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/bottom-app-bar.css +2 -2
- package/dist/styles/bottom-sheet.css +2 -2
- package/dist/styles/button-group.css +2 -2
- package/dist/styles/button.css +2 -2
- package/dist/styles/card.css +2 -2
- package/dist/styles/carousel.css +2 -2
- package/dist/styles/checkbox.css +2 -2
- package/dist/styles/chips.css +2 -2
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/divider.css +2 -2
- package/dist/styles/drawer.css +2 -2
- package/dist/styles/extended-fab.css +2 -2
- package/dist/styles/fab.css +2 -2
- package/dist/styles/icon-button.css +2 -2
- package/dist/styles/list.css +2 -2
- package/dist/styles/loading-indicator.css +2 -2
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-rail.css +2 -2
- package/dist/styles/navigation.css +2 -2
- package/dist/styles/progress.css +2 -2
- package/dist/styles/radios.css +2 -2
- package/dist/styles/search.css +2 -2
- package/dist/styles/segmented-button.css +2 -2
- package/dist/styles/select.css +2 -2
- package/dist/styles/side-sheet.css +2 -2
- package/dist/styles/slider.css +2 -2
- package/dist/styles/snackbar.css +2 -2
- package/dist/styles/split-button.css +2 -2
- package/dist/styles/switch.css +2 -2
- package/dist/styles/tabs.css +2 -2
- package/dist/styles/textfield.css +2 -2
- package/dist/styles/timepicker.css +2 -2
- package/dist/styles/tooltip.css +2 -0
- package/dist/styles/tooltip.d.ts +1 -0
- package/dist/styles/tooltip.js +2 -0
- package/dist/styles/top-app-bar.css +2 -2
- package/dist/styles/utilities.css +2 -2
- package/dist/styles.css +2 -2
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/browngreen.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/legacy.css +1 -1
- package/dist/themes/material.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/winter.css +1 -1
- package/package.json +2 -2
- package/src/styles/abstract/_mixins.scss +5 -1
- package/src/styles/components/_checkbox.scss +27 -7
- package/src/styles/components/_chips.scss +13 -13
- package/src/styles/components/_datepicker.scss +5 -5
- package/src/styles/components/_dialog.scss +2 -2
- package/src/styles/components/_radios.scss +30 -30
- package/src/styles/components/_switch.scss +36 -26
- package/src/styles/components/_tabs.scss +59 -58
- package/src/styles/components/_timepicker.scss +3 -3
- package/src/styles/main.scss +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createTab } from "./tab.js";
|
|
2
2
|
import { updateTabPanels } from "./utils.js";
|
|
3
3
|
import { createTabIndicator } from "./indicator.js";
|
|
4
|
+
const isCancelable = (event) => !!event && typeof event.preventDefault === "function";
|
|
4
5
|
export const withTabsManagement = (config) => (component) => {
|
|
5
6
|
const tabs = [];
|
|
6
7
|
const tabsContainer = component.scrollContainer || component.element;
|
|
@@ -23,7 +24,7 @@ export const withTabsManagement = (config) => (component) => {
|
|
|
23
24
|
return tabs.find((tab) => tab.isActive()) || null;
|
|
24
25
|
};
|
|
25
26
|
const handleTabClick = (event, tab) => {
|
|
26
|
-
if (event
|
|
27
|
+
if (isCancelable(event)) {
|
|
27
28
|
event.preventDefault();
|
|
28
29
|
}
|
|
29
30
|
if (tab.disabled &&
|
|
@@ -5,7 +5,8 @@ const DEFAULT_CONFIG = {
|
|
|
5
5
|
animationTiming: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
6
6
|
visible: true,
|
|
7
7
|
prefix: 'mtrl',
|
|
8
|
-
variant: 'primary'
|
|
8
|
+
variant: 'primary',
|
|
9
|
+
height: 3
|
|
9
10
|
};
|
|
10
11
|
export const createTabIndicator = (config = {}) => {
|
|
11
12
|
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
@@ -15,6 +16,7 @@ export const createTabIndicator = (config = {}) => {
|
|
|
15
16
|
element.style.transition = `transform ${mergedConfig.animationDuration}ms ${mergedConfig.animationTiming},
|
|
16
17
|
width ${mergedConfig.animationDuration}ms ${mergedConfig.animationTiming}`;
|
|
17
18
|
element.style.width = `${mergedConfig.fixedWidth}px`;
|
|
19
|
+
element.style.height = `${mergedConfig.height}px`;
|
|
18
20
|
if (!mergedConfig.visible) {
|
|
19
21
|
element.style.opacity = '0';
|
|
20
22
|
}
|
|
@@ -27,7 +29,7 @@ export const createTabIndicator = (config = {}) => {
|
|
|
27
29
|
const textElement = tab.element.querySelector(`.${prefix}-tab-text`) ||
|
|
28
30
|
tab.element.querySelector(`.${prefix}-button-text`);
|
|
29
31
|
if (textElement) {
|
|
30
|
-
return textElement.clientWidth;
|
|
32
|
+
return Math.max(textElement.clientWidth, 24);
|
|
31
33
|
}
|
|
32
34
|
return Math.max(tab.element.offsetWidth / 2, 30);
|
|
33
35
|
}
|
|
@@ -61,7 +61,8 @@ export const setupResponsiveBehavior = (tabs, config = {}) => {
|
|
|
61
61
|
updateLayout();
|
|
62
62
|
const resizeObserver = new ResizeObserver(updateLayout);
|
|
63
63
|
resizeObserver.observe(document.body);
|
|
64
|
-
|
|
64
|
+
const host = tabs;
|
|
65
|
+
host._resizeObserver = resizeObserver;
|
|
65
66
|
const originalDestroy = tabs.destroy;
|
|
66
67
|
tabs.destroy = function () {
|
|
67
68
|
if (this._resizeObserver) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TabComponent } from "./types.js";
|
|
1
|
+
import { TabComponent, TabButton } from "./types.js";
|
|
2
2
|
import type { BadgeComponent } from "../badge/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* API options for a Tab component
|
|
@@ -15,7 +15,7 @@ interface ApiOptions {
|
|
|
15
15
|
destroy: () => void;
|
|
16
16
|
};
|
|
17
17
|
/** The button component (optional) */
|
|
18
|
-
button?:
|
|
18
|
+
button?: TabButton;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Component with required elements and methods
|
|
@@ -24,15 +24,21 @@ interface ComponentWithElements {
|
|
|
24
24
|
/** The DOM element */
|
|
25
25
|
element: HTMLElement;
|
|
26
26
|
/** The button component (optional) */
|
|
27
|
-
button?:
|
|
27
|
+
button?: TabButton;
|
|
28
28
|
/** The badge component (optional) */
|
|
29
29
|
badge?: BadgeComponent;
|
|
30
30
|
/** Class name helper */
|
|
31
31
|
getClass: (name: string) => string;
|
|
32
32
|
/** Component configuration */
|
|
33
|
-
config:
|
|
33
|
+
config: {
|
|
34
|
+
prefix?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Event subscription, kept on the returned tab */
|
|
37
|
+
on: TabComponent['on'];
|
|
38
|
+
/** Event unsubscription, kept on the returned tab */
|
|
39
|
+
off: TabComponent['off'];
|
|
34
40
|
/** Event emitter (optional) */
|
|
35
|
-
emit?: (event: string, data
|
|
41
|
+
emit?: (event: string, data?: unknown) => unknown;
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* Enhances a tab component with API methods
|
|
@@ -78,7 +78,7 @@ export const withTabAPI = ({ disabled, lifecycle, button }) => (component) => {
|
|
|
78
78
|
setBadge(content) {
|
|
79
79
|
if (!component.badge) {
|
|
80
80
|
const badgeConfig = {
|
|
81
|
-
content,
|
|
81
|
+
label: content,
|
|
82
82
|
standalone: false,
|
|
83
83
|
target: component.element,
|
|
84
84
|
prefix: component.config.prefix
|
|
@@ -45,6 +45,14 @@ export const createTab = (config = {}) => {
|
|
|
45
45
|
...baseComponent,
|
|
46
46
|
button,
|
|
47
47
|
element: button.element,
|
|
48
|
+
on(event, handler) {
|
|
49
|
+
baseComponent.on(event, handler);
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
off(event, handler) {
|
|
53
|
+
baseComponent.off(event, handler);
|
|
54
|
+
return this;
|
|
55
|
+
},
|
|
48
56
|
badge: null,
|
|
49
57
|
getValue() {
|
|
50
58
|
return button.getValue();
|
|
@@ -103,7 +111,7 @@ export const createTab = (config = {}) => {
|
|
|
103
111
|
setBadge(content) {
|
|
104
112
|
if (!this.badge) {
|
|
105
113
|
const badgeConfig = {
|
|
106
|
-
content,
|
|
114
|
+
label: content,
|
|
107
115
|
standalone: false,
|
|
108
116
|
target: this.element,
|
|
109
117
|
prefix: baseConfig.prefix,
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { BadgeComponent } from "../badge/index.js";
|
|
2
|
+
import type { ButtonComponent } from "../button/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Button methods the tab delegates to; each one is checked before use
|
|
5
|
+
*/
|
|
6
|
+
export type TabButton = Partial<Pick<ButtonComponent, 'getValue' | 'setValue' | 'getText' | 'setText' | 'getIcon' | 'setIcon'>>;
|
|
2
7
|
import { TabIndicator } from "./indicator.js";
|
|
3
8
|
/**
|
|
4
9
|
* Available tabs variants
|
|
@@ -245,6 +250,8 @@ export interface TextAPI {
|
|
|
245
250
|
export interface TabComponent {
|
|
246
251
|
/** The tab's DOM element */
|
|
247
252
|
element: HTMLElement;
|
|
253
|
+
/** The button the tab is built on */
|
|
254
|
+
button?: TabButton;
|
|
248
255
|
/** The tab's badge component (if any) */
|
|
249
256
|
badge?: BadgeComponent;
|
|
250
257
|
/** Gets a class name with the component's prefix */
|
|
@@ -374,7 +381,7 @@ export interface TabsComponent {
|
|
|
374
381
|
* @param data - Event data
|
|
375
382
|
* @returns Tabs component for chaining
|
|
376
383
|
*/
|
|
377
|
-
emit?: (event: string, data:
|
|
384
|
+
emit?: (event: string, data: unknown) => TabsComponent;
|
|
378
385
|
/**
|
|
379
386
|
* Destroys the tabs component and all tabs
|
|
380
387
|
*/
|
|
@@ -382,7 +389,7 @@ export interface TabsComponent {
|
|
|
382
389
|
/**
|
|
383
390
|
* Tab click event handler
|
|
384
391
|
*/
|
|
385
|
-
handleTabClick: (event:
|
|
392
|
+
handleTabClick: (event: unknown, tab: TabComponent) => void;
|
|
386
393
|
/**
|
|
387
394
|
* Scroll container for scrollable tabs
|
|
388
395
|
*/
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { TabComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Tabs members read by these helpers; each one is checked before use
|
|
4
|
+
*/
|
|
5
|
+
interface TabsHost {
|
|
6
|
+
element?: HTMLElement;
|
|
7
|
+
tabs?: TabComponent[];
|
|
8
|
+
getTabs?: () => TabComponent[];
|
|
9
|
+
getActiveTab?: () => TabComponent | null;
|
|
10
|
+
setActiveTab?: (tabOrValue: TabComponent | string) => unknown;
|
|
11
|
+
}
|
|
2
12
|
/**
|
|
3
13
|
* Gets the active tab from a component
|
|
4
14
|
* @param component - Component with tabs
|
|
5
15
|
* @returns Active tab or null
|
|
6
16
|
*/
|
|
7
|
-
export declare function getActiveTab(component:
|
|
17
|
+
export declare function getActiveTab(component: TabsHost): TabComponent | null;
|
|
8
18
|
/**
|
|
9
19
|
* Updates tab panels based on active tab
|
|
10
20
|
* @param component - Component with tabs
|
|
11
21
|
*/
|
|
12
|
-
export declare function updateTabPanels(component:
|
|
22
|
+
export declare function updateTabPanels(component: TabsHost): void;
|
|
13
23
|
/**
|
|
14
24
|
* Sets up keyboard navigation for tabs
|
|
15
25
|
* @param component - Tabs component
|
|
16
26
|
*/
|
|
17
|
-
export declare function setupKeyboardNavigation(component:
|
|
27
|
+
export declare function setupKeyboardNavigation(component: TabsHost): void;
|
|
28
|
+
export {};
|
|
@@ -9,7 +9,7 @@ type ComponentWithDensity = BaseComponent & {
|
|
|
9
9
|
};
|
|
10
10
|
updateElementPositions?: () => void;
|
|
11
11
|
schedulePositionUpdate?: () => void;
|
|
12
|
-
setError?: (error: boolean, message?: string) =>
|
|
12
|
+
setError?: (error: boolean, message?: string) => void;
|
|
13
13
|
isError?: () => boolean;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: TextfieldConfig) => TextfieldCo
|
|
|
17
17
|
export declare const getElementConfig: (config: TextfieldConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
attributes: Record<string,
|
|
20
|
+
attributes: Record<string, unknown>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
id: string;
|
|
@@ -33,7 +33,7 @@ export declare const getElementConfig: (config: TextfieldConfig) => {
|
|
|
33
33
|
ariaHidden: boolean;
|
|
34
34
|
html: string;
|
|
35
35
|
text: string;
|
|
36
|
-
forwardEvents: Record<string,
|
|
36
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
37
37
|
interactive: boolean;
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
@@ -15,7 +15,6 @@ export interface ErrorConfig {
|
|
|
15
15
|
* Component name
|
|
16
16
|
*/
|
|
17
17
|
componentName?: string;
|
|
18
|
-
[key: string]: any;
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Component with supporting text capabilities (if available)
|
|
@@ -50,5 +49,5 @@ export interface ErrorComponent extends BaseComponent {
|
|
|
50
49
|
* @param config - Configuration with error settings
|
|
51
50
|
* @returns Function that enhances a component with error state
|
|
52
51
|
*/
|
|
53
|
-
export declare const withError: <T extends ErrorConfig>(config: T) => <C extends ComponentWithSupportingText>(component: C) => C & ErrorComponent;
|
|
52
|
+
export declare const withError: <T extends ErrorConfig & object>(config: T) => <C extends ComponentWithSupportingText>(component: C) => C & ErrorComponent;
|
|
54
53
|
export {};
|
|
@@ -24,7 +24,6 @@ export interface LeadingIconConfig {
|
|
|
24
24
|
* Component name
|
|
25
25
|
*/
|
|
26
26
|
componentName?: string;
|
|
27
|
-
[key: string]: any;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Component with leading icon capabilities
|
|
@@ -51,5 +50,5 @@ export interface LeadingIconComponent extends BaseComponent {
|
|
|
51
50
|
* @param config - Configuration with leading icon settings
|
|
52
51
|
* @returns Function that enhances a component with leading icon
|
|
53
52
|
*/
|
|
54
|
-
export declare const withLeadingIcon: <T extends LeadingIconConfig>(config: T) => <C extends InputElementComponent>(component: C) => C & LeadingIconComponent
|
|
53
|
+
export declare const withLeadingIcon: <T extends LeadingIconConfig & object>(config: T) => <C extends InputElementComponent>(component: C) => C & Partial<LeadingIconComponent>;
|
|
55
54
|
export {};
|
|
@@ -23,7 +23,6 @@ export interface PrefixTextConfig {
|
|
|
23
23
|
* Component name
|
|
24
24
|
*/
|
|
25
25
|
componentName?: string;
|
|
26
|
-
[key: string]: any;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
28
|
* Component with prefix text capabilities
|
|
@@ -50,5 +49,5 @@ export interface PrefixTextComponent extends BaseComponent {
|
|
|
50
49
|
* @param config - Configuration with prefix text settings
|
|
51
50
|
* @returns Function that enhances a component with prefix text
|
|
52
51
|
*/
|
|
53
|
-
export declare const withPrefixText: <T extends PrefixTextConfig>(config: T) => <C extends LifecycleElementComponent>(component: C) => C & PrefixTextComponent
|
|
52
|
+
export declare const withPrefixText: <T extends PrefixTextConfig & object>(config: T) => <C extends LifecycleElementComponent>(component: C) => C & Partial<PrefixTextComponent>;
|
|
54
53
|
export {};
|
|
@@ -23,7 +23,6 @@ export interface SuffixTextConfig {
|
|
|
23
23
|
* Component name
|
|
24
24
|
*/
|
|
25
25
|
componentName?: string;
|
|
26
|
-
[key: string]: any;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
28
|
* Component with suffix text capabilities
|
|
@@ -50,5 +49,5 @@ export interface SuffixTextComponent extends BaseComponent {
|
|
|
50
49
|
* @param config - Configuration with suffix text settings
|
|
51
50
|
* @returns Function that enhances a component with suffix text
|
|
52
51
|
*/
|
|
53
|
-
export declare const withSuffixText: <T extends SuffixTextConfig>(config: T) => <C extends LifecycleElementComponent>(component: C) => C & SuffixTextComponent
|
|
52
|
+
export declare const withSuffixText: <T extends SuffixTextConfig & object>(config: T) => <C extends LifecycleElementComponent>(component: C) => C & Partial<SuffixTextComponent>;
|
|
54
53
|
export {};
|
|
@@ -27,7 +27,6 @@ export interface SupportingTextConfig {
|
|
|
27
27
|
* Component name
|
|
28
28
|
*/
|
|
29
29
|
componentName?: string;
|
|
30
|
-
[key: string]: any;
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* Component with supporting text capabilities
|
|
@@ -55,5 +54,5 @@ export interface SupportingTextComponent extends BaseComponent {
|
|
|
55
54
|
* @param config - Configuration with supporting text settings
|
|
56
55
|
* @returns Function that enhances a component with supporting text
|
|
57
56
|
*/
|
|
58
|
-
export declare const withSupportingText: <T extends SupportingTextConfig>(config: T) => <C extends LifecycleElementComponent>(component: C) => C & SupportingTextComponent;
|
|
57
|
+
export declare const withSupportingText: <T extends SupportingTextConfig & object>(config: T) => <C extends LifecycleElementComponent>(component: C) => C & SupportingTextComponent;
|
|
59
58
|
export {};
|
|
@@ -24,7 +24,6 @@ export interface TrailingIconConfig {
|
|
|
24
24
|
* Component name
|
|
25
25
|
*/
|
|
26
26
|
componentName?: string;
|
|
27
|
-
[key: string]: any;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Component with trailing icon capabilities
|
|
@@ -51,5 +50,5 @@ export interface TrailingIconComponent extends BaseComponent {
|
|
|
51
50
|
* @param config - Configuration with trailing icon settings
|
|
52
51
|
* @returns Function that enhances a component with trailing icon
|
|
53
52
|
*/
|
|
54
|
-
export declare const withTrailingIcon: <T extends TrailingIconConfig>(config: T) => <C extends InputElementComponent>(component: C) => C & TrailingIconComponent
|
|
53
|
+
export declare const withTrailingIcon: <T extends TrailingIconConfig & object>(config: T) => <C extends InputElementComponent>(component: C) => C & Partial<TrailingIconComponent>;
|
|
55
54
|
export {};
|
|
@@ -188,7 +188,6 @@ export interface BaseComponent {
|
|
|
188
188
|
config?: {
|
|
189
189
|
prefix?: string;
|
|
190
190
|
componentName?: string;
|
|
191
|
-
[key: string]: string | number | boolean | undefined;
|
|
192
191
|
};
|
|
193
192
|
getValue?: () => string;
|
|
194
193
|
setValue?: (value: string) => void;
|
|
@@ -227,5 +226,4 @@ export interface BaseComponent {
|
|
|
227
226
|
errorState?: boolean;
|
|
228
227
|
setError?: (error: boolean, message?: string) => void;
|
|
229
228
|
isError?: () => boolean;
|
|
230
|
-
[key: string]: unknown;
|
|
231
229
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TimePickerComponent, TimePickerConfig, TimeValue } from "./types.js";
|
|
2
|
+
import type { ElementComponent } from "../../core/compose/component.js";
|
|
2
3
|
interface ApiOptions {
|
|
3
4
|
events: {
|
|
4
|
-
on: (event: string, handler: Function) =>
|
|
5
|
-
off: (event: string, handler: Function) =>
|
|
6
|
-
emit: (event: string, data?:
|
|
5
|
+
on: (event: string, handler: Function) => void;
|
|
6
|
+
off: (event: string, handler: Function) => void;
|
|
7
|
+
emit: (event: string, data?: unknown) => void;
|
|
7
8
|
};
|
|
8
9
|
lifecycle: {
|
|
9
10
|
destroy: () => void;
|
|
@@ -20,5 +21,5 @@ interface ApiOptions {
|
|
|
20
21
|
* @param options - API options with events and lifecycle methods
|
|
21
22
|
* @returns TimePicker component API
|
|
22
23
|
*/
|
|
23
|
-
export declare const createTimePickerAPI: (baseComponent:
|
|
24
|
+
export declare const createTimePickerAPI: (baseComponent: ElementComponent, modalElement: HTMLElement, dialogElement: HTMLElement, timeValue: TimeValue, config: TimePickerConfig, options: ApiOptions) => TimePickerComponent;
|
|
24
25
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { EventCallback } from "../../core/state/emitter.js";
|
|
2
|
+
import type { EventComponent } from "../../core/compose/features/events.js";
|
|
3
|
+
import type { LifecycleComponent } from "../../core/compose/features/lifecycle.js";
|
|
1
4
|
import { TimePickerConfig } from "./types.js";
|
|
2
5
|
/**
|
|
3
6
|
* Default configuration for the TimePicker component
|
|
@@ -17,7 +20,7 @@ export declare const createBaseConfig: (config?: TimePickerConfig) => TimePicker
|
|
|
17
20
|
export declare const getContainerConfig: (config: TimePickerConfig) => {
|
|
18
21
|
tag: string;
|
|
19
22
|
componentName: string;
|
|
20
|
-
attributes: Record<string,
|
|
23
|
+
attributes: Record<string, unknown>;
|
|
21
24
|
className: string[];
|
|
22
25
|
rawClass: string | string[];
|
|
23
26
|
id: string;
|
|
@@ -33,7 +36,7 @@ export declare const getContainerConfig: (config: TimePickerConfig) => {
|
|
|
33
36
|
ariaHidden: boolean;
|
|
34
37
|
html: string;
|
|
35
38
|
text: string;
|
|
36
|
-
forwardEvents: Record<string,
|
|
39
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
37
40
|
interactive: boolean;
|
|
38
41
|
};
|
|
39
42
|
/**
|
|
@@ -44,7 +47,7 @@ export declare const getContainerConfig: (config: TimePickerConfig) => {
|
|
|
44
47
|
export declare const getModalConfig: (config: TimePickerConfig) => {
|
|
45
48
|
tag: string;
|
|
46
49
|
componentName: string;
|
|
47
|
-
attributes: Record<string,
|
|
50
|
+
attributes: Record<string, unknown>;
|
|
48
51
|
className: string[];
|
|
49
52
|
rawClass: string | string[];
|
|
50
53
|
id: string;
|
|
@@ -60,7 +63,7 @@ export declare const getModalConfig: (config: TimePickerConfig) => {
|
|
|
60
63
|
ariaHidden: boolean;
|
|
61
64
|
html: string;
|
|
62
65
|
text: string;
|
|
63
|
-
forwardEvents: Record<string,
|
|
66
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
64
67
|
interactive: boolean;
|
|
65
68
|
};
|
|
66
69
|
/**
|
|
@@ -71,7 +74,7 @@ export declare const getModalConfig: (config: TimePickerConfig) => {
|
|
|
71
74
|
export declare const getDialogConfig: (config: TimePickerConfig) => {
|
|
72
75
|
tag: string;
|
|
73
76
|
componentName: string;
|
|
74
|
-
attributes: Record<string,
|
|
77
|
+
attributes: Record<string, unknown>;
|
|
75
78
|
className: string[];
|
|
76
79
|
rawClass: string | string[];
|
|
77
80
|
id: string;
|
|
@@ -87,7 +90,7 @@ export declare const getDialogConfig: (config: TimePickerConfig) => {
|
|
|
87
90
|
ariaHidden: boolean;
|
|
88
91
|
html: string;
|
|
89
92
|
text: string;
|
|
90
|
-
forwardEvents: Record<string,
|
|
93
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
91
94
|
interactive: boolean;
|
|
92
95
|
};
|
|
93
96
|
/**
|
|
@@ -95,14 +98,14 @@ export declare const getDialogConfig: (config: TimePickerConfig) => {
|
|
|
95
98
|
* @param {Object} comp - Component with events and lifecycle features
|
|
96
99
|
* @returns {Object} API configuration object
|
|
97
100
|
*/
|
|
98
|
-
export declare const getApiConfig: (comp:
|
|
101
|
+
export declare const getApiConfig: (comp: EventComponent & LifecycleComponent) => {
|
|
99
102
|
events: {
|
|
100
|
-
on: (event: string, handler:
|
|
101
|
-
off: (event: string, handler:
|
|
102
|
-
emit: (event: string, data?:
|
|
103
|
+
on: (event: string, handler: EventCallback) => EventComponent;
|
|
104
|
+
off: (event: string, handler: EventCallback) => EventComponent;
|
|
105
|
+
emit: (event: string, data?: unknown) => EventComponent;
|
|
103
106
|
};
|
|
104
107
|
lifecycle: {
|
|
105
|
-
destroy: () =>
|
|
108
|
+
destroy: () => void;
|
|
106
109
|
};
|
|
107
110
|
};
|
|
108
111
|
export default defaultConfig;
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: TooltipConfig) => TooltipConfig
|
|
|
17
17
|
export declare const getElementConfig: (config: TooltipConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
attributes: Record<string,
|
|
20
|
+
attributes: Record<string, unknown>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
id: string;
|
|
@@ -33,7 +33,7 @@ export declare const getElementConfig: (config: TooltipConfig) => {
|
|
|
33
33
|
ariaHidden: boolean;
|
|
34
34
|
html: string;
|
|
35
35
|
text: string;
|
|
36
|
-
forwardEvents: Record<string,
|
|
36
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
37
37
|
interactive: boolean;
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
@@ -4,5 +4,5 @@ import { TooltipConfig } from "./types.js";
|
|
|
4
4
|
* @param {TooltipConfig} config - Tooltip configuration object
|
|
5
5
|
* @returns {TooltipComponent} Tooltip component instance
|
|
6
6
|
*/
|
|
7
|
-
declare const createTooltip: (config?: TooltipConfig) =>
|
|
7
|
+
declare const createTooltip: (config?: TooltipConfig) => import("./types.js").TooltipComponent;
|
|
8
8
|
export default createTooltip;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Configuration for component creation
|
|
3
3
|
*/
|
|
4
4
|
export interface ComponentConfig {
|
|
5
|
-
[key: string]:
|
|
5
|
+
[key: string]: unknown;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Basic component interface
|
|
@@ -28,4 +28,4 @@ export interface Component {
|
|
|
28
28
|
* @param config - Component configuration
|
|
29
29
|
* @returns Basic component structure
|
|
30
30
|
*/
|
|
31
|
-
export declare const createComponent: (config?:
|
|
31
|
+
export declare const createComponent: (config?: object) => Component;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @description Core utilities for component composition and creation with built-in mobile support
|
|
4
4
|
*/
|
|
5
5
|
import { type CleanupScope } from "./cleanup.js";
|
|
6
|
+
import { EventCondition } from "../dom/create.js";
|
|
6
7
|
/**
|
|
7
8
|
* Touch state interface to track touch interactions
|
|
8
9
|
*/
|
|
@@ -15,12 +16,20 @@ export interface TouchState {
|
|
|
15
16
|
isTouching: boolean;
|
|
16
17
|
activeTarget: EventTarget | null;
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Config keys the base component and withElement read
|
|
21
|
+
*/
|
|
22
|
+
export interface BaseConfig {
|
|
23
|
+
componentName?: string;
|
|
24
|
+
prefix?: string;
|
|
25
|
+
parent?: HTMLElement | string;
|
|
26
|
+
}
|
|
18
27
|
/**
|
|
19
28
|
* Base component interface with prefix utilities
|
|
20
29
|
*/
|
|
21
30
|
export interface BaseComponent {
|
|
22
31
|
resources?: CleanupScope;
|
|
23
|
-
config: Record<string,
|
|
32
|
+
config: BaseConfig & Record<string, unknown>;
|
|
24
33
|
componentName?: string;
|
|
25
34
|
getClass: (name: string) => string;
|
|
26
35
|
getModifierClass: (base: string, modifier: string) => string;
|
|
@@ -42,7 +51,7 @@ export interface ElementComponent extends BaseComponent {
|
|
|
42
51
|
export interface WithElementOptions {
|
|
43
52
|
tag?: string;
|
|
44
53
|
componentName?: string;
|
|
45
|
-
attributes?: Record<string,
|
|
54
|
+
attributes?: Record<string, unknown>;
|
|
46
55
|
className?: string | string[];
|
|
47
56
|
id?: string;
|
|
48
57
|
name?: string;
|
|
@@ -55,7 +64,7 @@ export interface WithElementOptions {
|
|
|
55
64
|
ariaDescribedBy?: string;
|
|
56
65
|
ariaLabelledBy?: string;
|
|
57
66
|
ariaHidden?: boolean;
|
|
58
|
-
forwardEvents?: Record<string,
|
|
67
|
+
forwardEvents?: Record<string, EventCondition>;
|
|
59
68
|
interactive?: boolean;
|
|
60
69
|
parent?: HTMLElement | string;
|
|
61
70
|
}
|
|
@@ -66,7 +75,7 @@ export interface WithElementOptions {
|
|
|
66
75
|
* @param {Object} config - Component configuration
|
|
67
76
|
* @returns {BaseComponent} Base component with prefix utilities
|
|
68
77
|
*/
|
|
69
|
-
export declare const createBase: (config?:
|
|
78
|
+
export declare const createBase: (config?: BaseConfig & object) => BaseComponent;
|
|
70
79
|
/**
|
|
71
80
|
* Higher-order function that adds a DOM element to a component
|
|
72
81
|
* @param {WithElementOptions} options - Element creation options
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseComponent, ElementComponent } from "../component.js";
|
|
2
|
+
import type { BadgeComponent as Badge } from "../../../components/badge/types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Configuration for badge feature
|
|
4
5
|
*/
|
|
@@ -16,13 +17,11 @@ export interface BadgeConfig {
|
|
|
16
17
|
size?: string;
|
|
17
18
|
position?: string;
|
|
18
19
|
max?: number;
|
|
19
|
-
[key: string]: any;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* CSS class prefix
|
|
23
23
|
*/
|
|
24
24
|
prefix?: string;
|
|
25
|
-
[key: string]: any;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* Component with badge capabilities
|
|
@@ -31,7 +30,7 @@ export interface BadgeComponent extends BaseComponent {
|
|
|
31
30
|
/**
|
|
32
31
|
* Badge component instance
|
|
33
32
|
*/
|
|
34
|
-
badge?:
|
|
33
|
+
badge?: Badge;
|
|
35
34
|
}
|
|
36
35
|
/**
|
|
37
36
|
* Adds badge functionality to a component
|
|
@@ -40,4 +39,4 @@ export interface BadgeComponent extends BaseComponent {
|
|
|
40
39
|
* @param {BadgeConfig} config - Badge configuration
|
|
41
40
|
* @returns {Function} Component enhancer with badge functionality
|
|
42
41
|
*/
|
|
43
|
-
export declare const withBadge: <T extends BadgeConfig>(config: T) => <C extends ElementComponent>(component: C) => C & BadgeComponent;
|
|
42
|
+
export declare const withBadge: <T extends BadgeConfig & object>(config: T) => <C extends ElementComponent>(component: C) => C & BadgeComponent;
|
|
@@ -4,7 +4,6 @@ import { BaseComponent } from "../component.js";
|
|
|
4
4
|
*/
|
|
5
5
|
export interface CheckableConfig {
|
|
6
6
|
checked?: boolean;
|
|
7
|
-
[key: string]: any;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
9
|
* Component with input element
|
|
@@ -12,8 +11,8 @@ export interface CheckableConfig {
|
|
|
12
11
|
export interface InputComponent extends BaseComponent {
|
|
13
12
|
element: HTMLElement;
|
|
14
13
|
input: HTMLInputElement;
|
|
15
|
-
emit?: (event: string, data: unknown) =>
|
|
16
|
-
on?: (event: string, handler: Function) =>
|
|
14
|
+
emit?: (event: string, data: unknown) => unknown;
|
|
15
|
+
on?: (event: string, handler: Function) => unknown;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Checkable state manager interface
|
|
@@ -56,4 +55,4 @@ export interface CheckableComponent extends BaseComponent {
|
|
|
56
55
|
* @param config - Checkable configuration
|
|
57
56
|
* @returns Function that enhances a component with checkable functionality
|
|
58
57
|
*/
|
|
59
|
-
export declare const withCheckable: <T extends CheckableConfig>(config?: T) => <C extends InputComponent>(component: C) => C & CheckableComponent;
|
|
58
|
+
export declare const withCheckable: <T extends CheckableConfig & object>(config?: T) => <C extends InputComponent>(component: C) => C & CheckableComponent;
|
|
@@ -9,7 +9,7 @@ import { BaseComponent, ElementComponent } from "../component.js";
|
|
|
9
9
|
export interface ComponentWithLifecycle extends ElementComponent {
|
|
10
10
|
lifecycle: {
|
|
11
11
|
destroy: () => void;
|
|
12
|
-
[key: string]:
|
|
12
|
+
[key: string]: unknown;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
@@ -27,7 +27,6 @@ export interface DebounceConfig {
|
|
|
27
27
|
maxWait?: number;
|
|
28
28
|
};
|
|
29
29
|
}>;
|
|
30
|
-
[key: string]: any;
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* Component with debounced event capabilities
|
|
@@ -80,5 +79,5 @@ export interface DebounceComponent extends BaseComponent {
|
|
|
80
79
|
* )(config);
|
|
81
80
|
* ```
|
|
82
81
|
*/
|
|
83
|
-
export declare const withDebounce: (config?:
|
|
82
|
+
export declare const withDebounce: <T extends DebounceConfig & object>(config?: T) => <C extends ElementComponent>(component: C) => C & DebounceComponent;
|
|
84
83
|
export default withDebounce;
|