mtrl 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/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/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 +5 -5
- 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 +3 -2
- package/dist/core/dom/create.d.ts +27 -10
- package/dist/core/dom/create.js +0 -24
- package/dist/core/dom/utils.d.ts +1 -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/object.d.ts +2 -2
- package/dist/core/utils/performance.d.ts +3 -3
- package/dist/core/utils/validate.d.ts +6 -6
- package/dist/core/utils/validate.js +13 -12
- package/dist/index.cjs +12 -12
- 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,3 +1,4 @@
|
|
|
1
|
+
import type { EventCallback } from "../../core/state/emitter.js";
|
|
1
2
|
/**
|
|
2
3
|
* Menu position options
|
|
3
4
|
* Controls where the menu will appear relative to its opener element
|
|
@@ -41,7 +42,7 @@ export type MenuPosition = (typeof MENU_POSITION)[keyof typeof MENU_POSITION];
|
|
|
41
42
|
*
|
|
42
43
|
* @category Components
|
|
43
44
|
*/
|
|
44
|
-
export interface MenuItem {
|
|
45
|
+
export interface MenuItem<TData = unknown> {
|
|
45
46
|
/**
|
|
46
47
|
* Unique ID for the menu item
|
|
47
48
|
* Required for accessibility and event handling
|
|
@@ -80,12 +81,12 @@ export interface MenuItem {
|
|
|
80
81
|
* Optional array of submenu items
|
|
81
82
|
* Only used when hasSubmenu is true
|
|
82
83
|
*/
|
|
83
|
-
submenu?: MenuItem[];
|
|
84
|
+
submenu?: MenuItem<TData>[];
|
|
84
85
|
/**
|
|
85
86
|
* Additional data to associate with the menu item
|
|
86
87
|
* This can be used for custom behavior in click handlers
|
|
87
88
|
*/
|
|
88
|
-
data?:
|
|
89
|
+
data?: TData;
|
|
89
90
|
}
|
|
90
91
|
/**
|
|
91
92
|
* Menu item type for dividers
|
|
@@ -129,7 +130,7 @@ export interface MenuGap {
|
|
|
129
130
|
*
|
|
130
131
|
* @category Components
|
|
131
132
|
*/
|
|
132
|
-
export type MenuContent = MenuItem | MenuDivider | MenuGap;
|
|
133
|
+
export type MenuContent<TData = unknown> = MenuItem<TData> | MenuDivider | MenuGap;
|
|
133
134
|
/**
|
|
134
135
|
* Configuration interface for the Menu component
|
|
135
136
|
*
|
|
@@ -290,13 +291,13 @@ export interface MenuEvent {
|
|
|
290
291
|
*
|
|
291
292
|
* @category Components
|
|
292
293
|
*/
|
|
293
|
-
export interface MenuSelectEvent extends MenuEvent {
|
|
294
|
+
export interface MenuSelectEvent<TData = unknown> extends MenuEvent {
|
|
294
295
|
/** The selected menu item */
|
|
295
|
-
item: MenuItem
|
|
296
|
+
item: MenuItem<TData>;
|
|
296
297
|
/** ID of the selected menu item */
|
|
297
298
|
itemId: string;
|
|
298
299
|
/** Data associated with the menu item (if any) */
|
|
299
|
-
itemData?:
|
|
300
|
+
itemData?: TData;
|
|
300
301
|
}
|
|
301
302
|
/**
|
|
302
303
|
* Menu component interface
|
|
@@ -380,14 +381,29 @@ export interface MenuComponent {
|
|
|
380
381
|
* @param handler - Event handler function
|
|
381
382
|
* @returns The menu component for chaining
|
|
382
383
|
*/
|
|
383
|
-
on
|
|
384
|
+
on<T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]): MenuComponent;
|
|
385
|
+
/**
|
|
386
|
+
* Adds an event listener for any event the menu emits, such as
|
|
387
|
+
* 'submenu-opened', 'submenu-closed', 'all-submenus-closed' or 'menu-closing'
|
|
388
|
+
* @param event - Event name
|
|
389
|
+
* @param handler - Event handler function
|
|
390
|
+
* @returns The menu component for chaining
|
|
391
|
+
*/
|
|
392
|
+
on(event: string, handler: EventCallback): MenuComponent;
|
|
384
393
|
/**
|
|
385
394
|
* Removes an event listener from the menu
|
|
386
395
|
* @param event - Event name
|
|
387
396
|
* @param handler - Event handler function
|
|
388
397
|
* @returns The menu component for chaining
|
|
389
398
|
*/
|
|
390
|
-
off
|
|
399
|
+
off<T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]): MenuComponent;
|
|
400
|
+
/**
|
|
401
|
+
* Removes an event listener for any event the menu emits
|
|
402
|
+
* @param event - Event name
|
|
403
|
+
* @param handler - Event handler function
|
|
404
|
+
* @returns The menu component for chaining
|
|
405
|
+
*/
|
|
406
|
+
off(event: string, handler: EventCallback): MenuComponent;
|
|
391
407
|
/**
|
|
392
408
|
* Destroys the menu component and cleans up resources
|
|
393
409
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: NavigationConfig) => Navigation
|
|
|
17
17
|
export declare const getElementConfig: (config: NavigationConfig) => {
|
|
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: NavigationConfig) => {
|
|
|
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
|
/**
|
|
@@ -9,8 +9,6 @@ interface ControllerConfig {
|
|
|
9
9
|
debug?: boolean;
|
|
10
10
|
/** Component name */
|
|
11
11
|
componentName?: string;
|
|
12
|
-
/** Additional configuration options */
|
|
13
|
-
[key: string]: any;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
* Enhanced component with controller capabilities
|
|
@@ -26,5 +24,5 @@ interface ControllerComponent extends BaseComponent {
|
|
|
26
24
|
* @param {ControllerConfig} config - Controller configuration
|
|
27
25
|
* @returns {Function} Component enhancer function
|
|
28
26
|
*/
|
|
29
|
-
export declare const withController: (config: ControllerConfig) => (component:
|
|
27
|
+
export declare const withController: (config: ControllerConfig) => <C extends BaseComponent>(component: C) => C & ControllerComponent;
|
|
30
28
|
export default withController;
|
|
@@ -22,12 +22,11 @@ interface NavigationConfig {
|
|
|
22
22
|
prefix?: string;
|
|
23
23
|
items?: NavItemConfig[];
|
|
24
24
|
debug?: boolean;
|
|
25
|
-
[key: string]: any;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* Adds navigation items management to a component
|
|
29
28
|
* @param {NavigationConfig} config - Navigation configuration
|
|
30
29
|
* @returns {Function} Component enhancer function
|
|
31
30
|
*/
|
|
32
|
-
export declare const withNavItems: (config: NavigationConfig) => (component:
|
|
31
|
+
export declare const withNavItems: (config: NavigationConfig) => <C extends BaseComponent>(component: C) => C & ItemsComponent;
|
|
33
32
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavigationSystemState } from "./types.js";
|
|
1
|
+
import { NavigationSystem, NavigationSystemComponent, NavigationSystemMobileConfig, NavigationSystemResolvedConfig, NavigationSystemState } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Update drawer content for a specific section WITHOUT changing visibility
|
|
4
4
|
*
|
|
@@ -15,7 +15,7 @@ export declare const updateDrawerContent: (state: NavigationSystemState, section
|
|
|
15
15
|
* @param config - System configuration
|
|
16
16
|
* @returns Rail navigation component
|
|
17
17
|
*/
|
|
18
|
-
export declare const createRailNavigation: (state: NavigationSystemState, config:
|
|
18
|
+
export declare const createRailNavigation: (state: NavigationSystemState, config: NavigationSystemResolvedConfig) => NavigationSystemComponent;
|
|
19
19
|
/**
|
|
20
20
|
* Creates the drawer navigation component
|
|
21
21
|
*
|
|
@@ -23,21 +23,21 @@ export declare const createRailNavigation: (state: NavigationSystemState, config
|
|
|
23
23
|
* @param config - System configuration
|
|
24
24
|
* @returns Drawer navigation component
|
|
25
25
|
*/
|
|
26
|
-
export declare const createDrawerNavigation: (state: NavigationSystemState, config:
|
|
26
|
+
export declare const createDrawerNavigation: (state: NavigationSystemState, config: NavigationSystemResolvedConfig) => NavigationSystemComponent;
|
|
27
27
|
/**
|
|
28
28
|
* Shows the drawer with mobile-specific behaviors
|
|
29
29
|
*
|
|
30
30
|
* @param state - System state
|
|
31
31
|
* @param mobileConfig - Mobile configuration
|
|
32
32
|
*/
|
|
33
|
-
export declare const showDrawer: (state: NavigationSystemState, mobileConfig:
|
|
33
|
+
export declare const showDrawer: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig) => void;
|
|
34
34
|
/**
|
|
35
35
|
* Hides the drawer with mobile-specific behaviors
|
|
36
36
|
*
|
|
37
37
|
* @param state - System state
|
|
38
38
|
* @param mobileConfig - Mobile configuration
|
|
39
39
|
*/
|
|
40
|
-
export declare const hideDrawer: (state: NavigationSystemState, mobileConfig:
|
|
40
|
+
export declare const hideDrawer: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig) => void;
|
|
41
41
|
/**
|
|
42
42
|
* Checks if drawer is visible
|
|
43
43
|
*
|
|
@@ -54,7 +54,7 @@ export declare const isDrawerVisible: (state: NavigationSystemState) => boolean;
|
|
|
54
54
|
* @param teardownMobileMode - Function to tear down mobile mode
|
|
55
55
|
* @param systemApi - Reference to the public system API
|
|
56
56
|
*/
|
|
57
|
-
export declare const checkMobileState: (state: NavigationSystemState, mobileConfig:
|
|
57
|
+
export declare const checkMobileState: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig, setupMobileMode: () => void, teardownMobileMode: () => void, systemApi: NavigationSystem) => void;
|
|
58
58
|
/**
|
|
59
59
|
* Clean up resources when the system is destroyed
|
|
60
60
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavigationSystemState } from "./types.js";
|
|
1
|
+
import { NavigationSystem, NavigationSystemResolvedConfig, NavigationSystemState } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Registers rail navigation event handlers
|
|
4
4
|
*
|
|
@@ -9,7 +9,7 @@ import { NavigationSystemState } from "./types.js";
|
|
|
9
9
|
* @param hideDrawer - Function to hide the drawer
|
|
10
10
|
* @param systemApi - Reference to the public system API
|
|
11
11
|
*/
|
|
12
|
-
export declare const registerRailEvents: (state: NavigationSystemState, config:
|
|
12
|
+
export declare const registerRailEvents: (state: NavigationSystemState, config: NavigationSystemResolvedConfig, updateDrawerContent: (sectionId: string) => void, showDrawer: () => void, hideDrawer: () => void, systemApi: NavigationSystem) => void;
|
|
13
13
|
/**
|
|
14
14
|
* Registers drawer navigation event handlers
|
|
15
15
|
*
|
|
@@ -18,7 +18,7 @@ export declare const registerRailEvents: (state: NavigationSystemState, config:
|
|
|
18
18
|
* @param hideDrawer - Function to hide the drawer
|
|
19
19
|
* @param systemApi - Reference to the public system API
|
|
20
20
|
*/
|
|
21
|
-
export declare const registerDrawerEvents: (state: NavigationSystemState, config:
|
|
21
|
+
export declare const registerDrawerEvents: (state: NavigationSystemState, config: NavigationSystemResolvedConfig, hideDrawer: () => void, systemApi: NavigationSystem) => void;
|
|
22
22
|
/**
|
|
23
23
|
* Sets up window resize and orientation change handling
|
|
24
24
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavigationSystemState } from "./types.js";
|
|
1
|
+
import { NavigationSystemMobileConfig, NavigationSystemState } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates and appends overlay element for mobile
|
|
4
4
|
*
|
|
@@ -7,7 +7,7 @@ import { NavigationSystemState } from "./types.js";
|
|
|
7
7
|
* @param hideDrawer - Function to hide the drawer
|
|
8
8
|
* @returns Overlay element
|
|
9
9
|
*/
|
|
10
|
-
export declare const createOverlay: (state: NavigationSystemState, mobileConfig:
|
|
10
|
+
export declare const createOverlay: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig, hideDrawer: () => void) => HTMLElement;
|
|
11
11
|
/**
|
|
12
12
|
* Creates and adds close button to the drawer
|
|
13
13
|
*
|
|
@@ -16,7 +16,7 @@ export declare const createOverlay: (state: NavigationSystemState, mobileConfig:
|
|
|
16
16
|
* @param hideDrawer - Function to hide the drawer
|
|
17
17
|
* @returns Close button element
|
|
18
18
|
*/
|
|
19
|
-
export declare const createCloseButton: (state: NavigationSystemState, mobileConfig:
|
|
19
|
+
export declare const createCloseButton: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig, hideDrawer: () => void) => HTMLElement | null;
|
|
20
20
|
/**
|
|
21
21
|
* Sets up mobile mode features
|
|
22
22
|
*
|
|
@@ -25,7 +25,7 @@ export declare const createCloseButton: (state: NavigationSystemState, mobileCon
|
|
|
25
25
|
* @param hideDrawer - Function to hide the drawer
|
|
26
26
|
* @param isDrawerVisible - Function to check if drawer is visible
|
|
27
27
|
*/
|
|
28
|
-
export declare const setupMobileMode: (state: NavigationSystemState, mobileConfig:
|
|
28
|
+
export declare const setupMobileMode: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig, hideDrawer: () => void, isDrawerVisible: () => boolean) => void;
|
|
29
29
|
/**
|
|
30
30
|
* Sets up outside click handling for mobile
|
|
31
31
|
*
|
|
@@ -34,7 +34,7 @@ export declare const setupMobileMode: (state: NavigationSystemState, mobileConfi
|
|
|
34
34
|
* @param hideDrawer - Function to hide the drawer
|
|
35
35
|
* @param isDrawerVisible - Function to check if drawer is visible
|
|
36
36
|
*/
|
|
37
|
-
export declare const setupOutsideClickHandling: (state: NavigationSystemState, mobileConfig:
|
|
37
|
+
export declare const setupOutsideClickHandling: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig, hideDrawer: () => void, isDrawerVisible: () => boolean) => void;
|
|
38
38
|
/**
|
|
39
39
|
* Sets up touch gestures for mobile
|
|
40
40
|
*
|
|
@@ -49,4 +49,4 @@ export declare const setupTouchGestures: (state: NavigationSystemState, hideDraw
|
|
|
49
49
|
* @param state - System state
|
|
50
50
|
* @param mobileConfig - Mobile configuration
|
|
51
51
|
*/
|
|
52
|
-
export declare const teardownMobileMode: (state: NavigationSystemState, mobileConfig:
|
|
52
|
+
export declare const teardownMobileMode: (state: NavigationSystemState, mobileConfig: NavigationSystemMobileConfig) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavigationSystemConfig, NavigationSystemState } from "./types.js";
|
|
1
|
+
import { NavigationSystemConfig, NavigationSystemMobileConfig, NavigationSystemResolvedConfig, NavigationSystemState } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Create the initial state for the navigation system
|
|
4
4
|
*
|
|
@@ -12,11 +12,11 @@ export declare const createInitialState: (options?: NavigationSystemConfig) => N
|
|
|
12
12
|
* @param options - User-provided configuration
|
|
13
13
|
* @returns Complete configuration with defaults
|
|
14
14
|
*/
|
|
15
|
-
export declare const createConfig: (options?: NavigationSystemConfig) =>
|
|
15
|
+
export declare const createConfig: (options?: NavigationSystemConfig) => NavigationSystemResolvedConfig;
|
|
16
16
|
/**
|
|
17
17
|
* Create mobile configuration with defaults
|
|
18
18
|
*
|
|
19
19
|
* @param options - User-provided configuration
|
|
20
20
|
* @returns Mobile-specific configuration
|
|
21
21
|
*/
|
|
22
|
-
export declare const createMobileConfig: (options?: NavigationSystemConfig) =>
|
|
22
|
+
export declare const createMobileConfig: (options?: NavigationSystemConfig) => NavigationSystemMobileConfig;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NavChangeEvent, NavigationComponent, NavigationConfig, NavItemConfig } from "../types.js";
|
|
1
2
|
/**
|
|
2
3
|
* Configuration options for the navigation system
|
|
3
4
|
*/
|
|
@@ -87,12 +88,20 @@ export interface NavigationSystemConfig {
|
|
|
87
88
|
/**
|
|
88
89
|
* Additional options for the rail component
|
|
89
90
|
*/
|
|
90
|
-
railOptions?: Record<string,
|
|
91
|
+
railOptions?: NavigationConfig | Record<string, unknown>;
|
|
91
92
|
/**
|
|
92
93
|
* Additional options for the drawer component
|
|
93
94
|
*/
|
|
94
|
-
drawerOptions?: Record<string,
|
|
95
|
+
drawerOptions?: NavigationConfig | Record<string, unknown>;
|
|
95
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Display and timing configuration resolved with defaults
|
|
99
|
+
*/
|
|
100
|
+
export type NavigationSystemResolvedConfig = Required<Pick<NavigationSystemConfig, 'animateDrawer' | 'showLabelsOnRail' | 'hideDrawerOnClick' | 'expanded' | 'hoverDelay' | 'closeDelay' | 'railOptions' | 'drawerOptions'>>;
|
|
101
|
+
/**
|
|
102
|
+
* Mobile configuration resolved with defaults
|
|
103
|
+
*/
|
|
104
|
+
export type NavigationSystemMobileConfig = Required<Pick<NavigationSystemConfig, 'breakpoint' | 'lockBodyScroll' | 'hideOnClickOutside' | 'enableSwipeGestures' | 'optimizeForTouch' | 'overlayClass' | 'closeButtonClass' | 'bodyLockClass'>>;
|
|
96
105
|
/**
|
|
97
106
|
* Navigation section configuration
|
|
98
107
|
*/
|
|
@@ -113,7 +122,7 @@ export interface NavigationSection {
|
|
|
113
122
|
/**
|
|
114
123
|
* Navigation item configuration
|
|
115
124
|
*/
|
|
116
|
-
export interface NavigationItem {
|
|
125
|
+
export interface NavigationItem extends NavItemConfig {
|
|
117
126
|
/**
|
|
118
127
|
* Unique identifier for the item
|
|
119
128
|
*/
|
|
@@ -130,10 +139,15 @@ export interface NavigationItem {
|
|
|
130
139
|
* Whether the item is currently active
|
|
131
140
|
*/
|
|
132
141
|
active?: boolean;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Rail or drawer navigation component managed by the system
|
|
145
|
+
*/
|
|
146
|
+
export interface NavigationSystemComponent extends NavigationComponent {
|
|
133
147
|
/**
|
|
134
|
-
*
|
|
148
|
+
* Sets the active item; the navigation component currently ignores `silent`
|
|
135
149
|
*/
|
|
136
|
-
|
|
150
|
+
setActive: (id: string, silent?: boolean) => NavigationComponent;
|
|
137
151
|
}
|
|
138
152
|
/**
|
|
139
153
|
* Navigation system state interface
|
|
@@ -142,11 +156,11 @@ export interface NavigationSystemState {
|
|
|
142
156
|
/**
|
|
143
157
|
* Rail navigation component instance
|
|
144
158
|
*/
|
|
145
|
-
rail:
|
|
159
|
+
rail: NavigationSystemComponent | null;
|
|
146
160
|
/**
|
|
147
161
|
* Drawer navigation component instance
|
|
148
162
|
*/
|
|
149
|
-
drawer:
|
|
163
|
+
drawer: NavigationSystemComponent | null;
|
|
150
164
|
/**
|
|
151
165
|
* ID of the active section
|
|
152
166
|
*/
|
|
@@ -221,6 +235,24 @@ export interface ViewChangeEvent {
|
|
|
221
235
|
*/
|
|
222
236
|
width: number;
|
|
223
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Section change event data
|
|
240
|
+
*/
|
|
241
|
+
export interface SectionChangeEventData {
|
|
242
|
+
/**
|
|
243
|
+
* What triggered the section change
|
|
244
|
+
*/
|
|
245
|
+
source: 'userClick' | 'programmatic';
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Change event emitted by the rail or drawer navigation
|
|
249
|
+
*/
|
|
250
|
+
export interface NavigationSystemChangeEvent extends NavChangeEvent {
|
|
251
|
+
/**
|
|
252
|
+
* What triggered the change, such as 'userAction' or 'api'
|
|
253
|
+
*/
|
|
254
|
+
source?: string;
|
|
255
|
+
}
|
|
224
256
|
/**
|
|
225
257
|
* Navigation system API interface
|
|
226
258
|
*/
|
|
@@ -243,11 +275,11 @@ export interface NavigationSystem {
|
|
|
243
275
|
/**
|
|
244
276
|
* Get the rail navigation component
|
|
245
277
|
*/
|
|
246
|
-
getRail():
|
|
278
|
+
getRail(): NavigationComponent | null;
|
|
247
279
|
/**
|
|
248
280
|
* Get the drawer navigation component
|
|
249
281
|
*/
|
|
250
|
-
getDrawer():
|
|
282
|
+
getDrawer(): NavigationComponent | null;
|
|
251
283
|
/**
|
|
252
284
|
* Get the active section ID
|
|
253
285
|
*/
|
|
@@ -293,11 +325,11 @@ export interface NavigationSystem {
|
|
|
293
325
|
/**
|
|
294
326
|
* Handler for section changes
|
|
295
327
|
*/
|
|
296
|
-
onSectionChange?: (sectionId: string, eventData:
|
|
328
|
+
onSectionChange?: (sectionId: string, eventData: SectionChangeEventData) => void;
|
|
297
329
|
/**
|
|
298
330
|
* Handler for item selection
|
|
299
331
|
*/
|
|
300
|
-
onItemSelect?: (event:
|
|
332
|
+
onItemSelect?: (event: NavigationSystemChangeEvent) => void;
|
|
301
333
|
/**
|
|
302
334
|
* Handler for view changes (mobile/desktop)
|
|
303
335
|
*/
|
|
@@ -190,17 +190,26 @@ export interface BaseComponent {
|
|
|
190
190
|
element: HTMLElement;
|
|
191
191
|
prefix?: string;
|
|
192
192
|
items?: Map<string, NavItemData>;
|
|
193
|
-
emit?: (event: string, data:
|
|
194
|
-
on?: (event: string, handler: Function) =>
|
|
195
|
-
off?: (event: string, handler: Function) =>
|
|
193
|
+
emit?: (event: string, data: unknown) => void;
|
|
194
|
+
on?: (event: string, handler: Function) => unknown;
|
|
195
|
+
off?: (event: string, handler: Function) => unknown;
|
|
196
196
|
lifecycle?: {
|
|
197
197
|
destroy: () => void;
|
|
198
198
|
};
|
|
199
199
|
disabled?: {
|
|
200
|
-
enable: () =>
|
|
201
|
-
disable: () =>
|
|
200
|
+
enable: () => unknown;
|
|
201
|
+
disable: () => unknown;
|
|
202
202
|
};
|
|
203
|
-
|
|
203
|
+
variant?: string;
|
|
204
|
+
componentName?: string;
|
|
205
|
+
addItem?: (config: NavItemConfig) => unknown;
|
|
206
|
+
removeItem?: (id: string) => unknown;
|
|
207
|
+
getItem?: (id: string) => NavItemData | undefined;
|
|
208
|
+
getAllItems?: () => NavItemData[];
|
|
209
|
+
getActive?: () => NavItemData | null;
|
|
210
|
+
getItemPath?: (id: string) => string[];
|
|
211
|
+
setActive?: (id: string) => unknown;
|
|
212
|
+
handleItemClick?: (id: string) => void;
|
|
204
213
|
}
|
|
205
214
|
/**
|
|
206
215
|
* API options interface
|
|
@@ -2,7 +2,6 @@ import { PROGRESS_CLASSES, PROGRESS_EVENTS, PROGRESS_THICKNESS, PROGRESS_SHAPES,
|
|
|
2
2
|
import { addClass, removeClass } from "../../core/dom/index.js";
|
|
3
3
|
export const withAPI = (options) => (comp) => {
|
|
4
4
|
const { element, getClass, canvas } = comp;
|
|
5
|
-
const isCircular = element.classList.contains(getClass(PROGRESS_CLASSES.CIRCULAR));
|
|
6
5
|
const emitEvent = (name, detail) => {
|
|
7
6
|
element.dispatchEvent(new CustomEvent(name, { detail }));
|
|
8
7
|
};
|
|
@@ -21,7 +21,7 @@ export declare const createBaseConfig: (config?: ProgressConfig) => ProgressConf
|
|
|
21
21
|
export declare const getElementConfig: (config: ProgressConfig) => {
|
|
22
22
|
tag: string;
|
|
23
23
|
componentName: string;
|
|
24
|
-
attributes: Record<string,
|
|
24
|
+
attributes: Record<string, unknown>;
|
|
25
25
|
className: string[];
|
|
26
26
|
rawClass: string | string[];
|
|
27
27
|
id: string;
|
|
@@ -37,7 +37,7 @@ export declare const getElementConfig: (config: ProgressConfig) => {
|
|
|
37
37
|
ariaHidden: boolean;
|
|
38
38
|
html: string;
|
|
39
39
|
text: string;
|
|
40
|
-
forwardEvents: Record<string,
|
|
40
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
41
41
|
interactive: boolean;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProgressConfig, ProgressThickness } from "../types.js";
|
|
1
|
+
import { ProgressConfig, ProgressThickness, ProgressShape } from "../types.js";
|
|
2
2
|
export interface CanvasContext {
|
|
3
3
|
canvas: HTMLCanvasElement;
|
|
4
4
|
ctx: CanvasRenderingContext2D;
|
|
@@ -18,13 +18,22 @@ interface BaseComponent {
|
|
|
18
18
|
max?: number;
|
|
19
19
|
buffer?: number;
|
|
20
20
|
indeterminate?: boolean;
|
|
21
|
-
|
|
21
|
+
shape?: ProgressShape;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
ctx?: CanvasRenderingContext2D;
|
|
24
|
+
setValue?: (value: number, animate?: boolean) => void;
|
|
25
|
+
setIndeterminate?: (indeterminate: boolean) => void;
|
|
26
|
+
setThickness?: (thickness: ProgressThickness) => void;
|
|
27
|
+
setShape?: (shape: ProgressShape) => void;
|
|
28
|
+
currentShape?: ProgressShape;
|
|
29
|
+
setSize?: (size: number) => void;
|
|
30
|
+
getSize?: () => number | undefined;
|
|
31
|
+
hide?: () => BaseComponent;
|
|
32
|
+
show?: () => BaseComponent;
|
|
33
|
+
isVisible?: () => boolean;
|
|
24
34
|
}
|
|
25
35
|
export interface CanvasComponent extends BaseComponent {
|
|
26
36
|
canvas: HTMLCanvasElement;
|
|
27
|
-
ctx?: CanvasRenderingContext2D;
|
|
28
37
|
draw: () => void;
|
|
29
38
|
resize: () => void;
|
|
30
39
|
}
|
|
@@ -46,5 +55,5 @@ export declare const getLinearHeight: (strokeWidth: number, isWavy: boolean) =>
|
|
|
46
55
|
/**
|
|
47
56
|
* Adds the canvas, the drawing routine and the animation loop
|
|
48
57
|
*/
|
|
49
|
-
export declare const withCanvas: (config: ProgressConfig) => (component:
|
|
58
|
+
export declare const withCanvas: (config: ProgressConfig) => <C extends BaseComponent>(component: C) => C & CanvasComponent;
|
|
50
59
|
export {};
|
|
@@ -32,7 +32,6 @@ interface ComponentWithLifecycle {
|
|
|
32
32
|
showLabel?: () => unknown;
|
|
33
33
|
setThickness?: (thickness: number | string) => unknown;
|
|
34
34
|
state?: ProgressState;
|
|
35
|
-
[key: string]: any;
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* Adds state management for canvas-based progress component
|
|
@@ -40,7 +39,7 @@ interface ComponentWithLifecycle {
|
|
|
40
39
|
* @param config Progress configuration
|
|
41
40
|
* @returns Component enhancer with state management
|
|
42
41
|
*/
|
|
43
|
-
export declare const withState: (config: ProgressConfig) => (component:
|
|
42
|
+
export declare const withState: (config: ProgressConfig) => <C extends ComponentWithLifecycle>(component: C) => C & {
|
|
44
43
|
state: ProgressState;
|
|
45
44
|
};
|
|
46
45
|
export {};
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config: RadiosConfig) => RadiosConfig;
|
|
|
17
17
|
export declare const getElementConfig: (config: RadiosConfig) => {
|
|
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: RadiosConfig) => {
|
|
|
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
|
/**
|
|
@@ -52,19 +52,19 @@ export const withAPI = (options) => (component) => {
|
|
|
52
52
|
options.value.submit();
|
|
53
53
|
return this;
|
|
54
54
|
},
|
|
55
|
-
setLeadingIcon(
|
|
55
|
+
setLeadingIcon() {
|
|
56
56
|
console.warn("setLeadingIcon: Not yet implemented");
|
|
57
57
|
return this;
|
|
58
58
|
},
|
|
59
|
-
addTrailingItem(
|
|
59
|
+
addTrailingItem() {
|
|
60
60
|
console.warn("addTrailingItem: Not yet implemented");
|
|
61
61
|
return this;
|
|
62
62
|
},
|
|
63
|
-
removeTrailingItem(
|
|
63
|
+
removeTrailingItem() {
|
|
64
64
|
console.warn("removeTrailingItem: Not yet implemented");
|
|
65
65
|
return this;
|
|
66
66
|
},
|
|
67
|
-
setTrailingItems(
|
|
67
|
+
setTrailingItems() {
|
|
68
68
|
console.warn("setTrailingItems: Not yet implemented");
|
|
69
69
|
return this;
|
|
70
70
|
},
|
|
@@ -21,7 +21,7 @@ export declare const createBaseConfig: (config?: SearchConfig) => SearchConfig;
|
|
|
21
21
|
export declare const getElementConfig: (config: SearchConfig) => {
|
|
22
22
|
tag: string;
|
|
23
23
|
componentName: string;
|
|
24
|
-
attributes: Record<string,
|
|
24
|
+
attributes: Record<string, unknown>;
|
|
25
25
|
className: string[];
|
|
26
26
|
rawClass: string | string[];
|
|
27
27
|
id: string;
|
|
@@ -37,7 +37,7 @@ export declare const getElementConfig: (config: SearchConfig) => {
|
|
|
37
37
|
ariaHidden: boolean;
|
|
38
38
|
html: string;
|
|
39
39
|
text: string;
|
|
40
|
-
forwardEvents: Record<string,
|
|
40
|
+
forwardEvents: Record<string, import("../../core/dom/create.js").EventCondition>;
|
|
41
41
|
interactive: boolean;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { SearchConfig } from "../types.js";
|
|
2
1
|
/**
|
|
3
2
|
* Adds suggestion list features to the search component
|
|
4
3
|
* Handles rendering suggestions and keyboard navigation per MD3 specifications
|
|
5
4
|
*
|
|
6
|
-
* @param config Search configuration
|
|
7
5
|
* @returns Component enhancer with suggestions features
|
|
8
6
|
*/
|
|
9
|
-
export declare const withSuggestions: (
|
|
7
|
+
export declare const withSuggestions: () => (component: any) => any;
|
|
@@ -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
|
};
|
|
@@ -43,7 +43,7 @@ export const withSuggestions = (config) => (component) => {
|
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
45
|
if (suggestion.icon) {
|
|
46
|
-
|
|
46
|
+
createElement({
|
|
47
47
|
tag: "span",
|
|
48
48
|
className: getClass(SEARCH_CLASSES.SUGGESTION_ICON),
|
|
49
49
|
container: item,
|
|
@@ -51,14 +51,14 @@ export const withSuggestions = (config) => (component) => {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
|
|
54
|
+
createElement({
|
|
55
55
|
tag: "span",
|
|
56
56
|
className: getClass(SEARCH_CLASSES.SUGGESTION_ICON),
|
|
57
57
|
container: item,
|
|
58
58
|
html: SEARCH_ICONS.HISTORY,
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
createElement({
|
|
62
62
|
tag: "span",
|
|
63
63
|
className: getClass(SEARCH_CLASSES.SUGGESTION_TEXT),
|
|
64
64
|
container: item,
|
|
@@ -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") {
|