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,8 +1,8 @@
|
|
|
1
1
|
import { SEARCH_CLASSES, SEARCH_KEYS, SEARCH_ICONS } from "../constants.js";
|
|
2
2
|
import { createElement } from "../../../core/dom/create.js";
|
|
3
|
-
export const withSuggestions = (
|
|
3
|
+
export const withSuggestions = () => (component) => {
|
|
4
4
|
let highlightedIndex = -1;
|
|
5
|
-
|
|
5
|
+
const currentSuggestions = [];
|
|
6
6
|
const getClass = (className) => {
|
|
7
7
|
return component.getClass ? component.getClass(className) : className;
|
|
8
8
|
};
|
|
@@ -14,16 +14,17 @@ export const withSuggestions = (config) => (component) => {
|
|
|
14
14
|
};
|
|
15
15
|
const highlightMatch = (text, query) => {
|
|
16
16
|
if (!query)
|
|
17
|
-
return text;
|
|
18
|
-
const
|
|
19
|
-
const lowerQuery = query.toLowerCase();
|
|
20
|
-
const matchIndex = lowerText.indexOf(lowerQuery);
|
|
17
|
+
return [document.createTextNode(text)];
|
|
18
|
+
const matchIndex = text.toLowerCase().indexOf(query.toLowerCase());
|
|
21
19
|
if (matchIndex === -1)
|
|
22
|
-
return text;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
return [document.createTextNode(text)];
|
|
21
|
+
const strong = document.createElement("strong");
|
|
22
|
+
strong.textContent = text.slice(matchIndex, matchIndex + query.length);
|
|
23
|
+
return [
|
|
24
|
+
document.createTextNode(text.slice(0, matchIndex)),
|
|
25
|
+
strong,
|
|
26
|
+
document.createTextNode(text.slice(matchIndex + query.length)),
|
|
27
|
+
];
|
|
27
28
|
};
|
|
28
29
|
const createSuggestionItem = (suggestion, index, query) => {
|
|
29
30
|
const isHighlighted = index === highlightedIndex;
|
|
@@ -43,7 +44,7 @@ export const withSuggestions = (config) => (component) => {
|
|
|
43
44
|
},
|
|
44
45
|
});
|
|
45
46
|
if (suggestion.icon) {
|
|
46
|
-
|
|
47
|
+
createElement({
|
|
47
48
|
tag: "span",
|
|
48
49
|
className: getClass(SEARCH_CLASSES.SUGGESTION_ICON),
|
|
49
50
|
container: item,
|
|
@@ -51,19 +52,19 @@ export const withSuggestions = (config) => (component) => {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
54
|
-
|
|
55
|
+
createElement({
|
|
55
56
|
tag: "span",
|
|
56
57
|
className: getClass(SEARCH_CLASSES.SUGGESTION_ICON),
|
|
57
58
|
container: item,
|
|
58
59
|
html: SEARCH_ICONS.HISTORY,
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
const
|
|
62
|
+
const label = createElement({
|
|
62
63
|
tag: "span",
|
|
63
64
|
className: getClass(SEARCH_CLASSES.SUGGESTION_TEXT),
|
|
64
65
|
container: item,
|
|
65
|
-
html: highlightMatch(suggestion.text, query),
|
|
66
66
|
});
|
|
67
|
+
label.append(...highlightMatch(suggestion.text, query));
|
|
67
68
|
return item;
|
|
68
69
|
};
|
|
69
70
|
const createDivider = () => {
|
|
@@ -7,7 +7,7 @@ import { createBaseConfig, getElementConfig, getApiConfig } from "./config.js";
|
|
|
7
7
|
const createSearch = (config = {}) => {
|
|
8
8
|
const baseConfig = createBaseConfig(config);
|
|
9
9
|
try {
|
|
10
|
-
const component = pipe(createBase, withEvents(), withElement(getElementConfig(baseConfig)), withStructure(baseConfig), withStates(baseConfig), withInput(baseConfig), withSuggestions(
|
|
10
|
+
const component = pipe(createBase, withEvents(), withElement(getElementConfig(baseConfig)), withStructure(baseConfig), withStates(baseConfig), withInput(baseConfig), withSuggestions(), withLifecycle())(baseConfig);
|
|
11
11
|
const apiOptions = getApiConfig(component);
|
|
12
12
|
const search = withAPI(apiOptions)(component);
|
|
13
13
|
if (baseConfig.on && typeof search.on === "function") {
|
|
@@ -3,11 +3,7 @@ import { SegmentedButtonConfig, SelectionMode } from "./types.js";
|
|
|
3
3
|
* Default configuration values for segmented buttons
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export declare const DEFAULT_CONFIG:
|
|
7
|
-
mode: "single";
|
|
8
|
-
ripple: true;
|
|
9
|
-
density: "default";
|
|
10
|
-
};
|
|
6
|
+
export declare const DEFAULT_CONFIG: SegmentedButtonConfig;
|
|
11
7
|
/**
|
|
12
8
|
* Creates the base configuration for Segmented Button component
|
|
13
9
|
* @param {SegmentedButtonConfig} config - User provided configuration
|
|
@@ -2,7 +2,7 @@ import { createComponentConfig } from "../../core/config/component.js";
|
|
|
2
2
|
import { SelectionMode, Density } from "./types.js";
|
|
3
3
|
import { SEGMENTED_BUTTON_DEFAULTS } from "./constants.js";
|
|
4
4
|
export const DEFAULT_CONFIG = {
|
|
5
|
-
mode:
|
|
5
|
+
mode: SelectionMode.SINGLE,
|
|
6
6
|
ripple: SEGMENTED_BUTTON_DEFAULTS.RIPPLE,
|
|
7
7
|
density: SEGMENTED_BUTTON_DEFAULTS.DENSITY,
|
|
8
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SelectComponent, ApiOptions } from "./types.js";
|
|
1
|
+
import { SelectComponent, ApiOptions, BaseComponent } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Enhances a select component with API methods
|
|
4
4
|
* @param options - API configuration options
|
|
5
5
|
* @returns Higher-order function that adds API methods to component
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export declare const withAPI: (options: ApiOptions) => (component:
|
|
8
|
+
export declare const withAPI: (options: ApiOptions) => (component: BaseComponent) => SelectComponent;
|
|
@@ -4,10 +4,10 @@ import { SelectConfig, BaseComponent } from "./types.js";
|
|
|
4
4
|
* @param config - Select configuration
|
|
5
5
|
* @returns Function that enhances a component with textfield functionality
|
|
6
6
|
*/
|
|
7
|
-
export declare const withTextfield: (config: SelectConfig) => (component:
|
|
7
|
+
export declare const withTextfield: (config: SelectConfig) => <C extends object>(component: C) => C & Required<Pick<BaseComponent, "element" | "textfield">>;
|
|
8
8
|
/**
|
|
9
9
|
* Creates a menu for the select component
|
|
10
10
|
* @param config - Select configuration
|
|
11
11
|
* @returns Function that enhances a component with menu functionality
|
|
12
12
|
*/
|
|
13
|
-
export declare const withMenu: (config: SelectConfig) => (component:
|
|
13
|
+
export declare const withMenu: (config: SelectConfig) => <C extends BaseComponent>(component: C) => C & Pick<BaseComponent, "menu" | "select">;
|
|
@@ -54,6 +54,7 @@ export const withTextfield = (config) => (component) => {
|
|
|
54
54
|
textfield,
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
+
const isSelectOption = (value) => typeof value === "object" && value !== null && "id" in value && "text" in value;
|
|
57
58
|
const processMenuItems = (options) => {
|
|
58
59
|
return options.map((option) => {
|
|
59
60
|
if ("type" in option && option.type === "divider") {
|
|
@@ -106,7 +107,7 @@ export const withMenu = (config) => (component) => {
|
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
const option = event.item.data;
|
|
109
|
-
if (!
|
|
110
|
+
if (!isSelectOption(option)) {
|
|
110
111
|
console.warn("Invalid menu selection: missing required data properties");
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { MenuColor, MenuVariant } from "../menu/types.js";
|
|
1
|
+
import type { MenuColor, MenuComponent, MenuVariant } from "../menu/types.js";
|
|
2
|
+
import type { TextfieldComponent } from "../textfield/types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Available Select variants
|
|
4
5
|
*/
|
|
@@ -42,7 +43,7 @@ export interface SelectOption {
|
|
|
42
43
|
/**
|
|
43
44
|
* Additional data associated with the option
|
|
44
45
|
*/
|
|
45
|
-
data?:
|
|
46
|
+
data?: unknown;
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
49
|
* Configuration interface for the Select component
|
|
@@ -153,11 +154,11 @@ export interface SelectComponent {
|
|
|
153
154
|
/**
|
|
154
155
|
* The textfield component
|
|
155
156
|
*/
|
|
156
|
-
textfield:
|
|
157
|
+
textfield: TextfieldComponent;
|
|
157
158
|
/**
|
|
158
159
|
* The menu component
|
|
159
160
|
*/
|
|
160
|
-
menu:
|
|
161
|
+
menu: MenuComponent;
|
|
161
162
|
/**
|
|
162
163
|
* Gets the select's current value (selected option id)
|
|
163
164
|
*/
|
|
@@ -312,45 +313,61 @@ export interface SelectEvents {
|
|
|
312
313
|
export interface ApiOptions {
|
|
313
314
|
select: {
|
|
314
315
|
getValue: () => string | null;
|
|
315
|
-
setValue: (value: string | null | undefined) =>
|
|
316
|
-
clear: () =>
|
|
316
|
+
setValue: (value: string | null | undefined) => void;
|
|
317
|
+
clear: () => void;
|
|
317
318
|
getText: () => string;
|
|
318
319
|
getSelectedOption: () => SelectOption | null;
|
|
319
320
|
getOptions: () => SelectOption[];
|
|
320
|
-
setOptions: (options: SelectOption[]) =>
|
|
321
|
-
open: () =>
|
|
322
|
-
close: () =>
|
|
321
|
+
setOptions: (options: SelectOption[]) => void;
|
|
322
|
+
open: () => void;
|
|
323
|
+
close: () => void;
|
|
323
324
|
isOpen: () => boolean;
|
|
324
325
|
};
|
|
325
326
|
events?: {
|
|
326
|
-
on: <T extends
|
|
327
|
-
off: <T extends
|
|
327
|
+
on: <T extends keyof SelectEvents>(event: T, handler: SelectEvents[T]) => void;
|
|
328
|
+
off: <T extends keyof SelectEvents>(event: T, handler: SelectEvents[T]) => void;
|
|
328
329
|
};
|
|
329
330
|
disabled: {
|
|
330
|
-
enable: () =>
|
|
331
|
-
disable: () =>
|
|
331
|
+
enable: () => void;
|
|
332
|
+
disable: () => void;
|
|
332
333
|
};
|
|
333
334
|
lifecycle: {
|
|
334
335
|
destroy: () => void;
|
|
335
336
|
};
|
|
336
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Select controller added by the menu feature
|
|
340
|
+
* @internal
|
|
341
|
+
*/
|
|
342
|
+
export interface SelectController {
|
|
343
|
+
getValue: () => string | null;
|
|
344
|
+
setValue: (value: string | null | undefined) => BaseComponent;
|
|
345
|
+
clear: () => BaseComponent;
|
|
346
|
+
getText: () => string;
|
|
347
|
+
getSelectedOption: () => SelectOption | null;
|
|
348
|
+
getOptions: () => SelectOption[];
|
|
349
|
+
setOptions: (options: SelectOption[]) => BaseComponent;
|
|
350
|
+
open: (event?: Event, interactionType?: "mouse" | "keyboard") => BaseComponent;
|
|
351
|
+
close: (event?: Event) => BaseComponent;
|
|
352
|
+
isOpen: () => boolean;
|
|
353
|
+
}
|
|
337
354
|
/**
|
|
338
355
|
* Base component interface
|
|
339
356
|
* @internal
|
|
340
357
|
*/
|
|
341
358
|
export interface BaseComponent {
|
|
342
359
|
element: HTMLElement;
|
|
343
|
-
textfield?:
|
|
344
|
-
menu?:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
360
|
+
textfield?: TextfieldComponent;
|
|
361
|
+
menu?: MenuComponent;
|
|
362
|
+
select?: SelectController;
|
|
363
|
+
on?: (event: string, handler: Function) => void;
|
|
364
|
+
off?: (event: string, handler: Function) => void;
|
|
365
|
+
emit?: (event: string, data?: unknown) => void;
|
|
348
366
|
disabled?: {
|
|
349
|
-
enable: () =>
|
|
350
|
-
disable: () =>
|
|
367
|
+
enable: () => void;
|
|
368
|
+
disable: () => void;
|
|
351
369
|
};
|
|
352
370
|
lifecycle?: {
|
|
353
371
|
destroy: () => void;
|
|
354
372
|
};
|
|
355
|
-
[key: string]: any;
|
|
356
373
|
}
|
|
@@ -13,7 +13,7 @@ export declare const createBaseConfig: (config?: SideSheetConfig) => SideSheetCo
|
|
|
13
13
|
export declare const getElementConfig: (config: SideSheetConfig) => {
|
|
14
14
|
tag: string;
|
|
15
15
|
componentName: string;
|
|
16
|
-
attributes: Record<string,
|
|
16
|
+
attributes: Record<string, unknown>;
|
|
17
17
|
className: string[];
|
|
18
18
|
rawClass: string | string[];
|
|
19
19
|
id: string;
|
|
@@ -29,6 +29,6 @@ export declare const getElementConfig: (config: SideSheetConfig) => {
|
|
|
29
29
|
ariaHidden: boolean;
|
|
30
30
|
html: string;
|
|
31
31
|
text: string;
|
|
32
|
-
forwardEvents: Record<string,
|
|
32
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
33
33
|
interactive: boolean;
|
|
34
34
|
};
|
|
@@ -5,17 +5,17 @@ import { SliderSize } from "./constants.js";
|
|
|
5
5
|
*/
|
|
6
6
|
interface ApiOptions {
|
|
7
7
|
slider: {
|
|
8
|
-
setValue: (value: number, triggerEvent?: boolean) =>
|
|
8
|
+
setValue: (value: number, triggerEvent?: boolean) => unknown;
|
|
9
9
|
getValue: () => number;
|
|
10
|
-
setSecondValue: (value: number, triggerEvent?: boolean) =>
|
|
10
|
+
setSecondValue: (value: number, triggerEvent?: boolean) => unknown;
|
|
11
11
|
getSecondValue: () => number | null;
|
|
12
|
-
setMin: (min: number) =>
|
|
12
|
+
setMin: (min: number) => unknown;
|
|
13
13
|
getMin: () => number;
|
|
14
|
-
setMax: (max: number) =>
|
|
14
|
+
setMax: (max: number) => unknown;
|
|
15
15
|
getMax: () => number;
|
|
16
|
-
setStep: (step: number) =>
|
|
16
|
+
setStep: (step: number) => unknown;
|
|
17
17
|
getStep: () => number;
|
|
18
|
-
regenerateTicks: () =>
|
|
18
|
+
regenerateTicks: () => unknown;
|
|
19
19
|
};
|
|
20
20
|
disabled: {
|
|
21
21
|
enable: () => void;
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SliderConfig) => SliderConfig;
|
|
|
17
17
|
export declare const getElementConfig: (config: SliderConfig) => {
|
|
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: SliderConfig) => {
|
|
|
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
|
/**
|
|
@@ -65,7 +65,7 @@ export interface SliderConfig extends BaseComponentConfig {
|
|
|
65
65
|
/** CSS class prefix */
|
|
66
66
|
prefix?: string;
|
|
67
67
|
/** Component schema */
|
|
68
|
-
schema?:
|
|
68
|
+
schema?: object;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Slider event data
|
|
@@ -73,7 +73,7 @@ export interface SliderConfig extends BaseComponentConfig {
|
|
|
73
73
|
*/
|
|
74
74
|
export interface SliderEvent {
|
|
75
75
|
/** The slider component that triggered the event */
|
|
76
|
-
slider:
|
|
76
|
+
slider: SliderComponent;
|
|
77
77
|
/** Current slider value */
|
|
78
78
|
value: number;
|
|
79
79
|
/** Secondary value (for range sliders) */
|
|
@@ -30,7 +30,7 @@ export declare const durationToMs: (duration: SnackbarDuration | undefined, hasA
|
|
|
30
30
|
export declare const getElementConfig: (config: SnackbarConfig) => {
|
|
31
31
|
tag: string;
|
|
32
32
|
componentName: string;
|
|
33
|
-
attributes: Record<string,
|
|
33
|
+
attributes: Record<string, unknown>;
|
|
34
34
|
className: string[];
|
|
35
35
|
rawClass: string | string[];
|
|
36
36
|
id: string;
|
|
@@ -46,7 +46,7 @@ export declare const getElementConfig: (config: SnackbarConfig) => {
|
|
|
46
46
|
ariaHidden: boolean;
|
|
47
47
|
html: string;
|
|
48
48
|
text: string;
|
|
49
|
-
forwardEvents: Record<string,
|
|
49
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
50
50
|
interactive: boolean;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
@@ -6,7 +6,7 @@ import { BaseComponent, SnackbarConfig } from "./types.js";
|
|
|
6
6
|
* @param {SnackbarConfig} config - Component configuration
|
|
7
7
|
* @returns {Function} Higher-order function that adds the action button
|
|
8
8
|
*/
|
|
9
|
-
export declare const withActionButton: (config: SnackbarConfig) => (component:
|
|
9
|
+
export declare const withActionButton: (config: SnackbarConfig) => <C extends BaseComponent>(component: C) => C & Pick<BaseComponent, "action" | "actionButton">;
|
|
10
10
|
/**
|
|
11
11
|
* Adds the optional close affordance: a standard icon button (40dp, 24dp
|
|
12
12
|
* icon; `SnackbarTokens.IconSize`), coloured inverse-on-surface by the
|
|
@@ -14,7 +14,7 @@ export declare const withActionButton: (config: SnackbarConfig) => (component: B
|
|
|
14
14
|
* @param {SnackbarConfig} config - Component configuration
|
|
15
15
|
* @returns {Function} Higher-order function that adds the close button
|
|
16
16
|
*/
|
|
17
|
-
export declare const withCloseButton: (config: SnackbarConfig) => (component:
|
|
17
|
+
export declare const withCloseButton: (config: SnackbarConfig) => <C extends BaseComponent>(component: C) => C & Pick<BaseComponent, "close" | "closeButton">;
|
|
18
18
|
/**
|
|
19
19
|
* Adds the auto-dismiss timer. It emits `timeout` when the duration runs out
|
|
20
20
|
* and holds while the pointer is over the snackbar or focus is inside it:
|
|
@@ -23,4 +23,4 @@ export declare const withCloseButton: (config: SnackbarConfig) => (component: Ba
|
|
|
23
23
|
* @param {SnackbarConfig} config - Component configuration
|
|
24
24
|
* @returns {Function} Higher-order function that adds timer features
|
|
25
25
|
*/
|
|
26
|
-
export declare const withDismissTimer: (config: SnackbarConfig) => (component:
|
|
26
|
+
export declare const withDismissTimer: (config: SnackbarConfig) => <C extends BaseComponent>(component: C) => C & Required<Pick<BaseComponent, "timer">>;
|
|
@@ -12,5 +12,5 @@ interface PositionConfig {
|
|
|
12
12
|
* @param {PositionConfig} config - Position configuration
|
|
13
13
|
* @returns {Function} Higher-order function that adds position features
|
|
14
14
|
*/
|
|
15
|
-
export declare const withPosition: (config: PositionConfig) => (component:
|
|
15
|
+
export declare const withPosition: (config: PositionConfig) => <C extends BaseComponent>(component: C) => C & Required<Pick<BaseComponent, "position">>;
|
|
16
16
|
export {};
|
|
@@ -134,27 +134,26 @@ export interface SnackbarComponent {
|
|
|
134
134
|
*/
|
|
135
135
|
export interface BaseComponent {
|
|
136
136
|
element: HTMLElement;
|
|
137
|
-
emit?: (event: string, data?:
|
|
138
|
-
on?: (event: string, handler:
|
|
139
|
-
off?: (event: string, handler:
|
|
137
|
+
emit?: (event: string, data?: unknown) => void;
|
|
138
|
+
on?: (event: string, handler: Function) => unknown;
|
|
139
|
+
off?: (event: string, handler: Function) => unknown;
|
|
140
140
|
getClass?: (name: string) => string;
|
|
141
141
|
lifecycle?: {
|
|
142
142
|
destroy?: () => void;
|
|
143
143
|
};
|
|
144
144
|
text?: {
|
|
145
|
-
setText: (text: string) =>
|
|
145
|
+
setText: (text: string) => unknown;
|
|
146
146
|
getText: () => string;
|
|
147
147
|
};
|
|
148
148
|
position?: {
|
|
149
149
|
getPosition: () => SnackbarPosition;
|
|
150
|
-
setPosition: (position: SnackbarPosition) =>
|
|
150
|
+
setPosition: (position: SnackbarPosition) => unknown;
|
|
151
151
|
};
|
|
152
152
|
action?: ButtonComponent;
|
|
153
153
|
actionButton?: HTMLElement;
|
|
154
154
|
close?: IconButtonComponent;
|
|
155
155
|
closeButton?: HTMLElement;
|
|
156
156
|
timer?: SnackbarTimer;
|
|
157
|
-
[key: string]: any;
|
|
158
157
|
}
|
|
159
158
|
/**
|
|
160
159
|
* Timer interface for snackbar auto-dismissal
|
|
@@ -2,9 +2,7 @@ import { SPLIT_BUTTON_CLASSES, SPLIT_BUTTON_EVENTS } from "./constants.js";
|
|
|
2
2
|
export const withAPI = ({ config, lifecycle }) => (component) => {
|
|
3
3
|
const element = component.element;
|
|
4
4
|
const prefix = config.prefix || "mtrl";
|
|
5
|
-
const leading = component
|
|
6
|
-
const trailing = component.trailing;
|
|
7
|
-
const menu = component.menu;
|
|
5
|
+
const { leading, trailing, menu } = component;
|
|
8
6
|
const expandedClass = `${prefix}-${SPLIT_BUTTON_CLASSES.EXPANDED}`;
|
|
9
7
|
let expanded = false;
|
|
10
8
|
if (menu)
|
|
@@ -18,7 +18,7 @@ export declare const createBaseConfig: (config?: SplitButtonConfig) => SplitButt
|
|
|
18
18
|
export declare const getElementConfig: (config: SplitButtonConfig) => {
|
|
19
19
|
tag: string;
|
|
20
20
|
componentName: string;
|
|
21
|
-
attributes: Record<string,
|
|
21
|
+
attributes: Record<string, unknown>;
|
|
22
22
|
className: string[];
|
|
23
23
|
rawClass: string | string[];
|
|
24
24
|
id: string;
|
|
@@ -34,7 +34,7 @@ export declare const getElementConfig: (config: SplitButtonConfig) => {
|
|
|
34
34
|
ariaHidden: boolean;
|
|
35
35
|
html: string;
|
|
36
36
|
text: string;
|
|
37
|
-
forwardEvents: Record<string,
|
|
37
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
38
38
|
interactive: boolean;
|
|
39
39
|
};
|
|
40
40
|
export default defaultConfig;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ElementComponent } from "../../../core/compose/component.js";
|
|
2
|
+
import { ButtonsFeature, SplitButtonConfig } from "../types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Adds the leading and trailing buttons
|
|
4
5
|
* @param {SplitButtonConfig} config - Component configuration
|
|
5
6
|
* @returns {Function} Higher-order function that adds both buttons
|
|
6
7
|
*/
|
|
7
|
-
export declare const withButtons: (config: SplitButtonConfig) => (component:
|
|
8
|
+
export declare const withButtons: (config: SplitButtonConfig) => <C extends ElementComponent>(component: C) => C & ButtonsFeature;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ElementComponent } from "../../../core/compose/component.js";
|
|
2
|
+
import { ButtonsFeature, MenuFeature, SplitButtonConfig } from "../types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Adds a menu anchored to the trailing button
|
|
4
5
|
* @param {SplitButtonConfig} config - Component configuration
|
|
5
6
|
* @returns {Function} Higher-order function that adds the menu
|
|
6
7
|
*/
|
|
7
|
-
export declare const withMenu: (config: SplitButtonConfig) => (component:
|
|
8
|
+
export declare const withMenu: (config: SplitButtonConfig) => <C extends ElementComponent & ButtonsFeature>(component: C) => C & MenuFeature;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MenuContent, MenuComponent } from "../menu/types.js";
|
|
2
|
+
import type { ButtonComponent } from "../button/types.js";
|
|
2
3
|
/** Visual style, the same set the button offers */
|
|
3
4
|
export type SplitButtonVariant = "filled" | "tonal" | "outlined" | "elevated";
|
|
4
5
|
/** Size, matching the button and icon button scale */
|
|
@@ -102,8 +103,19 @@ export interface SplitButtonComponent {
|
|
|
102
103
|
/** Takes the component off the page and releases what it holds */
|
|
103
104
|
destroy: () => void;
|
|
104
105
|
}
|
|
106
|
+
/** What withButtons adds */
|
|
107
|
+
export interface ButtonsFeature {
|
|
108
|
+
leading: ButtonComponent;
|
|
109
|
+
trailing: ButtonComponent;
|
|
110
|
+
leadingElement: HTMLElement;
|
|
111
|
+
trailingElement: HTMLElement;
|
|
112
|
+
}
|
|
113
|
+
/** What withMenu adds: the menu, when the component was given items */
|
|
114
|
+
export interface MenuFeature {
|
|
115
|
+
menu?: MenuComponent;
|
|
116
|
+
}
|
|
105
117
|
/** The component as it passes through the enhancers */
|
|
106
|
-
export interface BaseComponent {
|
|
118
|
+
export interface BaseComponent extends ButtonsFeature, MenuFeature {
|
|
107
119
|
element: HTMLElement;
|
|
108
120
|
emit?: (event: string, data?: unknown) => void;
|
|
109
121
|
on?: (event: string, handler: (...args: unknown[]) => void) => unknown;
|
|
@@ -112,5 +124,4 @@ export interface BaseComponent {
|
|
|
112
124
|
lifecycle?: {
|
|
113
125
|
destroy?: () => void;
|
|
114
126
|
};
|
|
115
|
-
[key: string]: unknown;
|
|
116
127
|
}
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SwitchConfig) => SwitchConfig;
|
|
|
17
17
|
export declare const getElementConfig: (config: SwitchConfig) => {
|
|
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: SwitchConfig) => {
|
|
|
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
|
/**
|
|
@@ -25,13 +25,16 @@ interface ComponentWithElements {
|
|
|
25
25
|
/** Class name helper */
|
|
26
26
|
getClass: (name: string) => string;
|
|
27
27
|
/** Event subscription (optional) */
|
|
28
|
-
on?: (event: string, handler: Function) =>
|
|
28
|
+
on?: (event: string, handler: Function) => unknown;
|
|
29
29
|
/** Event unsubscription (optional) */
|
|
30
|
-
off?: (event: string, handler: Function) =>
|
|
31
|
-
/** Event emission (optional) */
|
|
32
|
-
emit?:
|
|
30
|
+
off?: (event: string, handler: Function) => unknown;
|
|
31
|
+
/** Event emission (optional); returns `this`, the tabs component once spread */
|
|
32
|
+
emit?: TabsComponent['emit'];
|
|
33
33
|
/** Component configuration */
|
|
34
|
-
config:
|
|
34
|
+
config: {
|
|
35
|
+
prefix?: string;
|
|
36
|
+
variant?: string;
|
|
37
|
+
};
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* Enhances a tabs component with API methods
|
|
@@ -12,7 +12,15 @@ export declare const defaultTabsConfig: {
|
|
|
12
12
|
showDivider: true;
|
|
13
13
|
componentName: string;
|
|
14
14
|
};
|
|
15
|
-
export declare const createTabsConfig: (config?: {}) =>
|
|
15
|
+
export declare const createTabsConfig: (config?: {}) => {
|
|
16
|
+
variant: "primary";
|
|
17
|
+
scrollable: true;
|
|
18
|
+
showDivider: true;
|
|
19
|
+
componentName: string;
|
|
20
|
+
} & {
|
|
21
|
+
componentName: string;
|
|
22
|
+
prefix: string;
|
|
23
|
+
};
|
|
16
24
|
/**
|
|
17
25
|
* Creates the base configuration for a Tab
|
|
18
26
|
* @param {TabConfig} config - User provided configuration
|
|
@@ -4,10 +4,10 @@ interface ComponentBase {
|
|
|
4
4
|
element: HTMLElement;
|
|
5
5
|
getClass: (name: string) => string;
|
|
6
6
|
scrollContainer?: HTMLElement;
|
|
7
|
-
emit?: (event: string, data
|
|
7
|
+
emit?: (event: string, data?: unknown) => unknown;
|
|
8
8
|
destroy?: () => void;
|
|
9
9
|
tabs?: TabComponent[];
|
|
10
|
-
handleTabClick?: (event:
|
|
10
|
+
handleTabClick?: (event: unknown, tab: TabComponent) => void;
|
|
11
11
|
variant?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -20,8 +20,6 @@ export interface TabsManagementConfig {
|
|
|
20
20
|
variant?: string;
|
|
21
21
|
/** Component prefix */
|
|
22
22
|
prefix?: string;
|
|
23
|
-
/** Other configuration properties */
|
|
24
|
-
[key: string]: any;
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Component with tabs management capabilities
|
|
@@ -43,15 +41,13 @@ export interface TabsManagementComponent {
|
|
|
43
41
|
* @param {TabsManagementConfig} config - Tabs configuration
|
|
44
42
|
* @returns {Function} Component enhancer with tabs management
|
|
45
43
|
*/
|
|
46
|
-
export declare const withTabsManagement: <T extends TabsManagementConfig>(config: T) => <C extends ComponentBase>(component: C) => C & TabsManagementComponent;
|
|
44
|
+
export declare const withTabsManagement: <T extends TabsManagementConfig & object>(config: T) => <C extends ComponentBase>(component: C) => C & TabsManagementComponent;
|
|
47
45
|
/**
|
|
48
46
|
* Configuration for scrollable feature
|
|
49
47
|
*/
|
|
50
48
|
export interface ScrollableConfig {
|
|
51
49
|
/** Whether tabs are scrollable horizontally */
|
|
52
50
|
scrollable?: boolean;
|
|
53
|
-
/** Other configuration properties */
|
|
54
|
-
[key: string]: any;
|
|
55
51
|
}
|
|
56
52
|
/**
|
|
57
53
|
* Component with scrollable capabilities
|
|
@@ -65,28 +61,28 @@ export interface ScrollableComponent {
|
|
|
65
61
|
* @param {ScrollableConfig} config - Scrollable configuration
|
|
66
62
|
* @returns {Function} Component enhancer with scrollable container
|
|
67
63
|
*/
|
|
68
|
-
export declare const withScrollable: <T extends ScrollableConfig>(config: T) => <C extends ComponentBase>(component: C) => C & ScrollableComponent;
|
|
64
|
+
export declare const withScrollable: <T extends ScrollableConfig & object>(config: T) => <C extends ComponentBase>(component: C) => C & ScrollableComponent;
|
|
69
65
|
/**
|
|
70
66
|
* Configuration for divider feature
|
|
71
67
|
*/
|
|
72
68
|
export interface DividerConfig {
|
|
73
69
|
/** Whether to show a divider below the tabs */
|
|
74
70
|
showDivider?: boolean;
|
|
75
|
-
/** Other configuration properties */
|
|
76
|
-
[key: string]: any;
|
|
77
71
|
}
|
|
78
72
|
/**
|
|
79
73
|
* Adds a divider to a component
|
|
80
74
|
* @param {DividerConfig} config - Divider configuration
|
|
81
75
|
* @returns {Function} Component enhancer with divider
|
|
82
76
|
*/
|
|
83
|
-
export declare const withDivider: <T extends DividerConfig>(config: T) => <C extends ComponentBase>(component: C) => C;
|
|
77
|
+
export declare const withDivider: <T extends DividerConfig & object>(config: T) => <C extends ComponentBase>(component: C) => C;
|
|
84
78
|
/**
|
|
85
79
|
* Configuration for indicator feature
|
|
86
80
|
*/
|
|
87
81
|
export interface IndicatorFeatureConfig {
|
|
88
82
|
/** Component prefix */
|
|
89
83
|
prefix?: string;
|
|
84
|
+
/** Tabs variant passed to the indicator */
|
|
85
|
+
variant?: string;
|
|
90
86
|
/** Width strategy for the indicator */
|
|
91
87
|
widthStrategy?: "fixed" | "dynamic" | "content";
|
|
92
88
|
/** Height of the indicator in pixels */
|