mtrl 0.4.0 → 0.4.3
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/api.d.ts +5 -5
- package/dist/components/badge/config.d.ts +17 -7
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +1 -1
- package/dist/components/bottom-app-bar/config.d.ts +1 -1
- package/dist/components/button/api.d.ts +19 -3
- package/dist/components/button/button.d.ts +41 -1
- package/dist/components/button/config.d.ts +17 -6
- package/dist/components/button/constants.d.ts +36 -0
- package/dist/components/button/features/progress.d.ts +26 -0
- package/dist/components/button/types.d.ts +108 -1
- package/dist/components/card/config.d.ts +1 -1
- package/dist/components/card/features.d.ts +14 -1
- package/dist/components/card/index.d.ts +6 -6
- package/dist/components/carousel/api.d.ts +15 -11
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/config.d.ts +1 -1
- package/dist/components/carousel/features/drag.d.ts +1 -1
- package/dist/components/carousel/features/slides.d.ts +1 -1
- package/dist/components/checkbox/config.d.ts +1 -1
- package/dist/components/checkbox/types.d.ts +2 -2
- package/dist/components/chips/chip/chip.d.ts +1 -1
- package/dist/components/chips/chip/config.d.ts +1 -1
- package/dist/components/chips/chips.d.ts +1 -1
- package/dist/components/chips/features/chip-items.d.ts +1 -1
- package/dist/components/chips/schema.d.ts +0 -1
- package/dist/components/datepicker/api.d.ts +1 -1
- package/dist/components/datepicker/config.d.ts +1 -1
- package/dist/components/datepicker/datepicker.d.ts +1 -1
- package/dist/components/datepicker/render.d.ts +5 -5
- package/dist/components/dialog/features.d.ts +1 -1
- package/dist/components/divider/divider.d.ts +2 -2
- package/dist/components/extended-fab/config.d.ts +1 -1
- package/dist/components/fab/config.d.ts +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/menu/api.d.ts +14 -14
- package/dist/components/menu/config.d.ts +1 -1
- package/dist/components/menu/features/controller.d.ts +1 -1
- package/dist/components/menu/features/keyboard.d.ts +2 -2
- package/dist/components/menu/features/submenu.d.ts +1 -1
- package/dist/components/menu/menu.d.ts +1 -1
- package/dist/components/navigation/config.d.ts +1 -1
- package/dist/components/navigation/features/controller.d.ts +1 -1
- package/dist/components/navigation/features/items.d.ts +2 -1
- package/dist/components/navigation/navigation.d.ts +1 -1
- package/dist/components/navigation/system/core.d.ts +1 -1
- package/dist/components/navigation/system/events.d.ts +1 -1
- package/dist/components/navigation/system/index.d.ts +2 -2
- package/dist/components/progress/api.d.ts +33 -2
- package/dist/components/progress/config.d.ts +2 -2
- package/dist/components/progress/constants.d.ts +25 -21
- package/dist/components/progress/features/canvas.d.ts +34 -5
- package/dist/components/progress/features/circular.d.ts +2 -2
- package/dist/components/progress/features/linear.d.ts +2 -2
- package/dist/components/progress/features/state.d.ts +9 -1
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/progress/types.d.ts +18 -6
- package/dist/components/radios/api.d.ts +11 -11
- package/dist/components/radios/config.d.ts +1 -1
- package/dist/components/radios/radios.d.ts +1 -1
- package/dist/components/search/api.d.ts +15 -11
- package/dist/components/search/features/search.d.ts +1 -1
- package/dist/components/segmented-button/config.d.ts +6 -6
- package/dist/components/select/api.d.ts +1 -1
- package/dist/components/select/config.d.ts +1 -1
- package/dist/components/select/features.d.ts +1 -1
- package/dist/components/select/types.d.ts +20 -5
- package/dist/components/sheet/config.d.ts +1 -1
- package/dist/components/sheet/sheet.d.ts +1 -1
- package/dist/components/slider/api.d.ts +3 -2
- package/dist/components/slider/config.d.ts +1 -1
- package/dist/components/slider/constants.d.ts +50 -21
- package/dist/components/slider/features/canvas.d.ts +47 -0
- package/dist/components/slider/features/controller.d.ts +1 -1
- package/dist/components/slider/features/handlers.d.ts +1 -1
- package/dist/components/slider/features/index.d.ts +1 -0
- package/dist/components/slider/features/states.d.ts +1 -1
- package/dist/components/slider/schema.d.ts +4 -47
- package/dist/components/slider/slider.d.ts +5 -4
- package/dist/components/slider/types.d.ts +10 -37
- package/dist/components/snackbar/api.d.ts +1 -1
- package/dist/components/snackbar/config.d.ts +2 -2
- package/dist/components/switch/api.d.ts +1 -1
- package/dist/components/switch/config.d.ts +1 -1
- package/dist/components/switch/features.d.ts +4 -4
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/types.d.ts +22 -17
- package/dist/components/tabs/config.d.ts +2 -3
- package/dist/components/tabs/features.d.ts +5 -5
- package/dist/components/tabs/index.d.ts +10 -10
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/utils.d.ts +1 -1
- package/dist/components/textfield/api.d.ts +13 -3
- package/dist/components/textfield/config.d.ts +1 -1
- package/dist/components/textfield/constants.d.ts +12 -20
- package/dist/components/textfield/features/density.d.ts +28 -0
- package/dist/components/textfield/features/index.d.ts +13 -12
- package/dist/components/textfield/index.d.ts +3 -3
- package/dist/components/textfield/textfield.d.ts +1 -1
- package/dist/components/textfield/types.d.ts +42 -35
- package/dist/components/timepicker/clockdial.d.ts +2 -2
- package/dist/components/timepicker/config.d.ts +1 -1
- package/dist/components/timepicker/render.d.ts +1 -1
- package/dist/components/timepicker/timepicker.d.ts +1 -1
- package/dist/components/timepicker/utils.d.ts +2 -2
- package/dist/components/tooltip/api.d.ts +1 -1
- package/dist/components/tooltip/config.d.ts +1 -1
- package/dist/components/top-app-bar/top-app-bar.d.ts +2 -2
- package/dist/constants.d.ts +30 -30
- package/dist/core/canvas/animation.d.ts +27 -0
- package/dist/core/canvas/drawing.d.ts +57 -0
- package/dist/core/canvas/index.d.ts +6 -3
- package/dist/core/canvas/utils.d.ts +84 -0
- package/dist/core/collection/collection.d.ts +7 -7
- package/dist/core/collection/list-manager/index.d.ts +2 -2
- package/dist/core/collection/list-manager/renderer.d.ts +3 -3
- package/dist/core/collection/list-manager/scroll-tracker.d.ts +1 -1
- package/dist/core/compose/component.d.ts +1 -0
- package/dist/core/compose/features/checkable.d.ts +2 -2
- package/dist/core/compose/features/gestures/longpress.d.ts +2 -2
- package/dist/core/compose/features/gestures/pan.d.ts +2 -2
- package/dist/core/compose/features/gestures/pinch.d.ts +2 -2
- package/dist/core/compose/features/gestures/rotate.d.ts +2 -2
- package/dist/core/compose/features/gestures/swipe.d.ts +2 -2
- package/dist/core/compose/features/gestures/tap.d.ts +2 -2
- package/dist/core/compose/features/gestures.d.ts +2 -2
- package/dist/core/compose/features/input.d.ts +1 -1
- package/dist/core/compose/features/ripple.d.ts +2 -2
- package/dist/core/compose/features/size.d.ts +1 -1
- package/dist/core/compose/features/textinput.d.ts +1 -1
- package/dist/core/compose/features/throttle.d.ts +1 -1
- package/dist/core/compose/features/variant.d.ts +1 -1
- package/dist/core/compose/features/withEvents.d.ts +1 -1
- package/dist/core/composition/features/label.d.ts +1 -1
- package/dist/core/config/component.d.ts +2 -0
- package/dist/core/config/global.d.ts +65 -0
- package/dist/core/dom/create.d.ts +1 -1
- package/dist/core/gestures/pan.d.ts +1 -1
- package/dist/core/gestures/pinch.d.ts +1 -1
- package/dist/core/gestures/rotate.d.ts +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/layout/array.d.ts +7 -2
- package/dist/core/layout/object.d.ts +1 -1
- package/dist/core/layout/processor.d.ts +2 -2
- package/dist/core/layout/utils.d.ts +1 -1
- package/dist/core/utils/color.d.ts +14 -0
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +149 -140
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/index.js.map +149 -140
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +9 -13
- package/dist/components/progress/features.d.ts +0 -40
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type SwitchPosition =
|
|
1
|
+
export type SwitchPosition = "center" | "start" | "end";
|
|
2
2
|
/**
|
|
3
3
|
* Switch label position types
|
|
4
4
|
*/
|
|
5
|
-
export type SwitchLabelPosition =
|
|
5
|
+
export type SwitchLabelPosition = "start" | "end";
|
|
6
6
|
/**
|
|
7
7
|
* Switch label positions
|
|
8
8
|
*/
|
|
@@ -40,6 +40,8 @@ export interface SwitchConfig {
|
|
|
40
40
|
componentName?: string;
|
|
41
41
|
/** Icon HTML content */
|
|
42
42
|
icon?: string;
|
|
43
|
+
/** Index signature for additional properties */
|
|
44
|
+
[key: string]: unknown;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Switch component interface
|
|
@@ -87,16 +89,16 @@ export interface SwitchComponent {
|
|
|
87
89
|
*/
|
|
88
90
|
export interface ApiOptions {
|
|
89
91
|
disabled: {
|
|
90
|
-
enable: () =>
|
|
91
|
-
disable: () =>
|
|
92
|
+
enable: () => void;
|
|
93
|
+
disable: () => void;
|
|
92
94
|
};
|
|
93
95
|
lifecycle: {
|
|
94
96
|
destroy: () => void;
|
|
95
97
|
};
|
|
96
98
|
checkable: {
|
|
97
|
-
check: () =>
|
|
98
|
-
uncheck: () =>
|
|
99
|
-
toggle: () =>
|
|
99
|
+
check: () => void;
|
|
100
|
+
uncheck: () => void;
|
|
101
|
+
toggle: () => void;
|
|
100
102
|
isChecked: () => boolean;
|
|
101
103
|
};
|
|
102
104
|
}
|
|
@@ -107,25 +109,28 @@ export interface BaseComponent {
|
|
|
107
109
|
element: HTMLElement;
|
|
108
110
|
input?: HTMLInputElement;
|
|
109
111
|
getValue?: () => string;
|
|
110
|
-
setValue?: (value: string) =>
|
|
112
|
+
setValue?: (value: string) => void;
|
|
111
113
|
text?: {
|
|
112
|
-
setText: (content: string) =>
|
|
114
|
+
setText: (content: string) => void;
|
|
113
115
|
getText: () => string;
|
|
114
116
|
};
|
|
115
|
-
on?: (event: string, handler: Function) =>
|
|
116
|
-
off?: (event: string, handler: Function) =>
|
|
117
|
+
on?: (event: string, handler: Function) => void;
|
|
118
|
+
off?: (event: string, handler: Function) => void;
|
|
117
119
|
disabled?: {
|
|
118
|
-
enable: () =>
|
|
119
|
-
disable: () =>
|
|
120
|
+
enable: () => void;
|
|
121
|
+
disable: () => void;
|
|
120
122
|
};
|
|
121
123
|
lifecycle?: {
|
|
122
124
|
destroy: () => void;
|
|
123
125
|
};
|
|
124
126
|
checkable?: {
|
|
125
|
-
check: () =>
|
|
126
|
-
uncheck: () =>
|
|
127
|
-
toggle: () =>
|
|
127
|
+
check: () => void;
|
|
128
|
+
uncheck: () => void;
|
|
129
|
+
toggle: () => void;
|
|
128
130
|
isChecked: () => boolean;
|
|
129
131
|
};
|
|
130
|
-
|
|
132
|
+
supportingTextElement?: HTMLElement | null;
|
|
133
|
+
setSupportingText?: (text: string, isError?: boolean) => void;
|
|
134
|
+
removeSupportingText?: () => void;
|
|
135
|
+
[key: string]: unknown;
|
|
131
136
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TabConfig } from './types';
|
|
1
|
+
import { TabConfig } from "./types";
|
|
3
2
|
/**
|
|
4
3
|
* Default configuration for a Tab
|
|
5
4
|
*/
|
|
@@ -13,7 +12,7 @@ export declare const defaultTabsConfig: {
|
|
|
13
12
|
showDivider: true;
|
|
14
13
|
componentName: string;
|
|
15
14
|
};
|
|
16
|
-
export declare const createTabsConfig: (config?: {}) => BaseComponentConfig;
|
|
15
|
+
export declare const createTabsConfig: (config?: {}) => import("../../core/config/component").BaseComponentConfig;
|
|
17
16
|
/**
|
|
18
17
|
* Creates the base configuration for a Tab
|
|
19
18
|
* @param {TabConfig} config - User provided configuration
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TabConfig, TabComponent } from
|
|
2
|
-
import { TabIndicator } from
|
|
1
|
+
import { TabConfig, TabComponent } from "./types";
|
|
2
|
+
import { TabIndicator } from "./indicator";
|
|
3
3
|
interface ComponentBase {
|
|
4
4
|
element: HTMLElement;
|
|
5
5
|
getClass: (name: string) => string;
|
|
@@ -88,7 +88,7 @@ export interface IndicatorFeatureConfig {
|
|
|
88
88
|
/** Component prefix */
|
|
89
89
|
prefix?: string;
|
|
90
90
|
/** Width strategy for the indicator */
|
|
91
|
-
widthStrategy?:
|
|
91
|
+
widthStrategy?: "fixed" | "dynamic" | "content";
|
|
92
92
|
/** Height of the indicator in pixels */
|
|
93
93
|
height?: number;
|
|
94
94
|
/** Fixed width in pixels (when using fixed strategy) */
|
|
@@ -102,10 +102,10 @@ export interface IndicatorFeatureConfig {
|
|
|
102
102
|
/** Legacy height property */
|
|
103
103
|
indicatorHeight?: number;
|
|
104
104
|
/** Legacy width strategy property */
|
|
105
|
-
indicatorWidthStrategy?:
|
|
105
|
+
indicatorWidthStrategy?: "fixed" | "dynamic" | "content";
|
|
106
106
|
/** Indicator configuration object */
|
|
107
107
|
indicator?: {
|
|
108
|
-
widthStrategy?:
|
|
108
|
+
widthStrategy?: "fixed" | "dynamic" | "content";
|
|
109
109
|
height?: number;
|
|
110
110
|
fixedWidth?: number;
|
|
111
111
|
animationDuration?: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import createTabs from
|
|
2
|
-
import { addScrollIndicators } from
|
|
3
|
-
import { setupResponsiveBehavior } from
|
|
4
|
-
import { createTabsState } from
|
|
5
|
-
import { createTabIndicator } from
|
|
6
|
-
import { updateTabPanels, setupKeyboardNavigation } from
|
|
7
|
-
export { TAB_VARIANTS, TAB_STATES, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_EVENTS, TABS_EVENTS, TABS_DEFAULTS, TABS_CLASSES, TAB_CLASSES } from
|
|
8
|
-
export { TabsConfig, TabsComponent, TabComponent, TabConfig, TabChangeEventData, IndicatorConfig } from
|
|
9
|
-
export { addScrollIndicators, setupResponsiveBehavior, createTabsState, createTabIndicator, updateTabPanels, setupKeyboardNavigation };
|
|
10
|
-
export { withTabsManagement, withScrollable, withDivider, withIndicator, TabsManagementConfig, TabsManagementComponent, ScrollableConfig, ScrollableComponent, DividerConfig, IndicatorFeatureConfig, IndicatorComponent } from
|
|
1
|
+
import createTabs from "./tabs";
|
|
2
|
+
import { addScrollIndicators } from "./scroll-indicators";
|
|
3
|
+
import { setupResponsiveBehavior } from "./responsive";
|
|
4
|
+
import { createTabsState } from "./state";
|
|
5
|
+
import { createTabIndicator } from "./indicator";
|
|
6
|
+
import { updateTabPanels, setupKeyboardNavigation } from "./utils";
|
|
7
|
+
export { TAB_VARIANTS, TAB_STATES, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_EVENTS, TABS_EVENTS, TABS_DEFAULTS, TABS_CLASSES, TAB_CLASSES, } from "./constants";
|
|
8
|
+
export { TabsConfig, TabsComponent, TabComponent, TabConfig, TabChangeEventData, IndicatorConfig, } from "./types";
|
|
9
|
+
export { addScrollIndicators, setupResponsiveBehavior, createTabsState, createTabIndicator, updateTabPanels, setupKeyboardNavigation, };
|
|
10
|
+
export { withTabsManagement, withScrollable, withDivider, withIndicator, TabsManagementConfig, TabsManagementComponent, ScrollableConfig, ScrollableComponent, DividerConfig, IndicatorFeatureConfig, IndicatorComponent, } from "./features";
|
|
11
11
|
export default createTabs;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { BaseComponent, TextfieldComponent, ApiOptions } from
|
|
2
|
-
|
|
1
|
+
import { BaseComponent, TextfieldComponent, ApiOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Component interface with density feature
|
|
4
|
+
*/
|
|
5
|
+
type ComponentWithDensity = BaseComponent & {
|
|
6
|
+
density?: {
|
|
7
|
+
current: string;
|
|
8
|
+
set: (density: string) => void;
|
|
9
|
+
};
|
|
10
|
+
updateElementPositions?: () => void;
|
|
11
|
+
};
|
|
3
12
|
/**
|
|
4
13
|
* Enhances textfield component with API methods
|
|
5
14
|
* @param {ApiOptions} options - API configuration
|
|
6
15
|
* @returns {Function} Higher-order function that adds API methods to component
|
|
7
16
|
*/
|
|
8
|
-
export declare const withAPI: ({ disabled, lifecycle }: ApiOptions) => (component:
|
|
17
|
+
export declare const withAPI: ({ disabled, lifecycle }: ApiOptions) => (component: ComponentWithDensity) => TextfieldComponent;
|
|
18
|
+
export {};
|
|
@@ -8,18 +8,6 @@ export declare const TEXTFIELD_VARIANTS: {
|
|
|
8
8
|
/** Outlined variant with border and animated label */
|
|
9
9
|
readonly OUTLINED: "outlined";
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
* Textfield size constants
|
|
13
|
-
* @category Components
|
|
14
|
-
*/
|
|
15
|
-
export declare const TEXTFIELD_SIZES: {
|
|
16
|
-
/** Small textfield */
|
|
17
|
-
readonly SMALL: "small";
|
|
18
|
-
/** Medium textfield (default) */
|
|
19
|
-
readonly MEDIUM: "medium";
|
|
20
|
-
/** Large textfield */
|
|
21
|
-
readonly LARGE: "large";
|
|
22
|
-
};
|
|
23
11
|
/**
|
|
24
12
|
* Textfield state constants
|
|
25
13
|
* @category Components
|
|
@@ -74,6 +62,16 @@ export declare const TEXTFIELD_EVENTS: {
|
|
|
74
62
|
/** Fired when a key is released */
|
|
75
63
|
readonly KEYUP: "keyup";
|
|
76
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Textfield density constants
|
|
67
|
+
* @category Components
|
|
68
|
+
*/
|
|
69
|
+
export declare const TEXTFIELD_DENSITY: {
|
|
70
|
+
/** Default density (56px height) */
|
|
71
|
+
readonly DEFAULT: "default";
|
|
72
|
+
/** Compact density (40px height) */
|
|
73
|
+
readonly COMPACT: "compact";
|
|
74
|
+
};
|
|
77
75
|
/**
|
|
78
76
|
* Default textfield configuration values
|
|
79
77
|
* @category Components
|
|
@@ -83,8 +81,8 @@ export declare const TEXTFIELD_DEFAULTS: {
|
|
|
83
81
|
readonly TYPE: "text";
|
|
84
82
|
/** Default visual variant */
|
|
85
83
|
readonly VARIANT: "filled";
|
|
86
|
-
/** Default
|
|
87
|
-
readonly
|
|
84
|
+
/** Default density level */
|
|
85
|
+
readonly DENSITY: "default";
|
|
88
86
|
/** Default disabled state */
|
|
89
87
|
readonly DISABLED: false;
|
|
90
88
|
/** Default required state */
|
|
@@ -113,12 +111,6 @@ export declare const TEXTFIELD_CLASSES: {
|
|
|
113
111
|
readonly FILLED: "textfield--filled";
|
|
114
112
|
/** Outlined variant class */
|
|
115
113
|
readonly OUTLINED: "textfield--outlined";
|
|
116
|
-
/** Small size class */
|
|
117
|
-
readonly SMALL: "textfield--small";
|
|
118
|
-
/** Medium size class */
|
|
119
|
-
readonly MEDIUM: "textfield--medium";
|
|
120
|
-
/** Large size class */
|
|
121
|
-
readonly LARGE: "textfield--large";
|
|
122
114
|
/** Focused state class */
|
|
123
115
|
readonly FOCUSED: "textfield--focused";
|
|
124
116
|
/** Disabled state class */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TextfieldConfig, TextfieldDensity } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for density feature
|
|
4
|
+
*/
|
|
5
|
+
interface DensityConfig extends TextfieldConfig {
|
|
6
|
+
density?: TextfieldDensity | string;
|
|
7
|
+
prefix?: string;
|
|
8
|
+
componentName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Component with density feature
|
|
12
|
+
*/
|
|
13
|
+
interface DensityComponent {
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
16
|
+
density?: {
|
|
17
|
+
current: string;
|
|
18
|
+
set: (density: string) => void;
|
|
19
|
+
};
|
|
20
|
+
updateElementPositions?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Adds density support to textfield component
|
|
24
|
+
* @param {DensityConfig} config - Configuration with density option
|
|
25
|
+
* @returns {Function} Higher-order function that adds density capabilities
|
|
26
|
+
*/
|
|
27
|
+
export declare const withDensity: (config: DensityConfig) => (component: DensityComponent) => DensityComponent;
|
|
28
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { withLeadingIcon } from
|
|
2
|
-
export { withTrailingIcon } from
|
|
3
|
-
export { withPrefixText } from
|
|
4
|
-
export { withSuffixText } from
|
|
5
|
-
export { withSupportingText } from
|
|
6
|
-
export { withPlacement } from
|
|
7
|
-
export
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
1
|
+
export { withLeadingIcon } from "./leading-icon";
|
|
2
|
+
export { withTrailingIcon } from "./trailing-icon";
|
|
3
|
+
export { withPrefixText } from "./prefix-text";
|
|
4
|
+
export { withSuffixText } from "./suffix-text";
|
|
5
|
+
export { withSupportingText } from "./supporting-text";
|
|
6
|
+
export { withPlacement } from "./placement";
|
|
7
|
+
export { withDensity } from "./density";
|
|
8
|
+
export type { LeadingIconComponent, LeadingIconConfig } from "./leading-icon";
|
|
9
|
+
export type { TrailingIconComponent, TrailingIconConfig, } from "./trailing-icon";
|
|
10
|
+
export type { PrefixTextComponent, PrefixTextConfig } from "./prefix-text";
|
|
11
|
+
export type { SuffixTextComponent, SuffixTextConfig } from "./suffix-text";
|
|
12
|
+
export type { SupportingTextComponent, SupportingTextConfig, } from "./supporting-text";
|
|
13
|
+
export type { PlacementComponent } from "./placement";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from
|
|
2
|
-
export { TEXTFIELD_VARIANTS,
|
|
3
|
-
export { TextfieldConfig, TextfieldComponent } from
|
|
1
|
+
export { default } from "./textfield";
|
|
2
|
+
export { TEXTFIELD_VARIANTS, TEXTFIELD_STATES, TEXTFIELD_TYPES, TEXTFIELD_EVENTS, TEXTFIELD_DEFAULTS, TEXTFIELD_CLASSES, TEXTFIELD_DENSITY, } from "./constants";
|
|
3
|
+
export { TextfieldConfig, TextfieldComponent, TextfieldDensity } from "./types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Available Textfield variants
|
|
3
3
|
*/
|
|
4
|
-
export type TextfieldVariant =
|
|
4
|
+
export type TextfieldVariant = "filled" | "outlined";
|
|
5
5
|
/**
|
|
6
6
|
* Textfield variant constants
|
|
7
7
|
*/
|
|
@@ -10,25 +10,24 @@ export declare const TEXTFIELD_VARIANTS: {
|
|
|
10
10
|
readonly OUTLINED: "outlined";
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Available Textfield
|
|
13
|
+
* Available Textfield states
|
|
14
14
|
*/
|
|
15
|
-
export type
|
|
15
|
+
export type TextfieldStates = "active" | "inactive" | "disabled";
|
|
16
16
|
/**
|
|
17
|
-
* Textfield
|
|
17
|
+
* Available Textfield density levels
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
20
|
-
readonly SMALL: "small";
|
|
21
|
-
readonly MEDIUM: "medium";
|
|
22
|
-
readonly LARGE: "large";
|
|
23
|
-
};
|
|
19
|
+
export type TextfieldDensity = "default" | "compact";
|
|
24
20
|
/**
|
|
25
|
-
*
|
|
21
|
+
* Textfield density constants
|
|
26
22
|
*/
|
|
27
|
-
export
|
|
23
|
+
export declare const TEXTFIELD_DENSITY: {
|
|
24
|
+
readonly DEFAULT: "default";
|
|
25
|
+
readonly COMPACT: "compact";
|
|
26
|
+
};
|
|
28
27
|
/**
|
|
29
28
|
* Available Textfield types
|
|
30
29
|
*/
|
|
31
|
-
export type TextfieldTypes =
|
|
30
|
+
export type TextfieldTypes = "text" | "password" | "email" | "number" | "tel" | "url" | "search" | "multiline";
|
|
32
31
|
/**
|
|
33
32
|
* Textfield type constants
|
|
34
33
|
*/
|
|
@@ -50,12 +49,16 @@ export interface TextfieldConfig {
|
|
|
50
49
|
type?: TextfieldTypes | string;
|
|
51
50
|
/** Visual variant (filled, outlined) */
|
|
52
51
|
variant?: TextfieldVariant | string;
|
|
52
|
+
/** Density level (default, compact) */
|
|
53
|
+
density?: TextfieldDensity | string;
|
|
53
54
|
/** Input name attribute */
|
|
54
55
|
name?: string;
|
|
55
56
|
/** Label text */
|
|
56
57
|
label?: string;
|
|
57
58
|
/** Initial value */
|
|
58
59
|
value?: string;
|
|
60
|
+
/** Placeholder text */
|
|
61
|
+
placeholder?: string;
|
|
59
62
|
/** Whether input is required */
|
|
60
63
|
required?: boolean;
|
|
61
64
|
/** Whether textfield is disabled */
|
|
@@ -145,6 +148,10 @@ export interface TextfieldComponent {
|
|
|
145
148
|
removeSuffixText: () => TextfieldComponent;
|
|
146
149
|
/** Manually update element positions (useful after DOM changes) */
|
|
147
150
|
updatePositions: () => TextfieldComponent;
|
|
151
|
+
/** Sets the density of the textfield */
|
|
152
|
+
setDensity: (density: TextfieldDensity | string) => TextfieldComponent;
|
|
153
|
+
/** Gets the current density setting */
|
|
154
|
+
getDensity: () => string;
|
|
148
155
|
/** Adds event listener */
|
|
149
156
|
on: (event: string, handler: Function) => TextfieldComponent;
|
|
150
157
|
/** Removes event listener */
|
|
@@ -161,8 +168,8 @@ export interface TextfieldComponent {
|
|
|
161
168
|
*/
|
|
162
169
|
export interface ApiOptions {
|
|
163
170
|
disabled: {
|
|
164
|
-
enable: () =>
|
|
165
|
-
disable: () =>
|
|
171
|
+
enable: () => void;
|
|
172
|
+
disable: () => void;
|
|
166
173
|
};
|
|
167
174
|
lifecycle: {
|
|
168
175
|
destroy: () => void;
|
|
@@ -177,41 +184,41 @@ export interface BaseComponent {
|
|
|
177
184
|
config?: {
|
|
178
185
|
prefix?: string;
|
|
179
186
|
componentName?: string;
|
|
180
|
-
[key: string]:
|
|
187
|
+
[key: string]: string | number | boolean | undefined;
|
|
181
188
|
};
|
|
182
189
|
getValue?: () => string;
|
|
183
|
-
setValue?: (value: string) =>
|
|
184
|
-
setAttribute?: (name: string, value: string) =>
|
|
190
|
+
setValue?: (value: string) => void;
|
|
191
|
+
setAttribute?: (name: string, value: string) => void;
|
|
185
192
|
getAttribute?: (name: string) => string | null;
|
|
186
|
-
removeAttribute?: (name: string) =>
|
|
193
|
+
removeAttribute?: (name: string) => void;
|
|
187
194
|
label?: {
|
|
188
|
-
setText: (content: string) =>
|
|
195
|
+
setText: (content: string) => void;
|
|
189
196
|
getText: () => string;
|
|
190
197
|
};
|
|
191
198
|
leadingIcon?: HTMLElement | null;
|
|
192
|
-
setLeadingIcon?: (html: string) =>
|
|
193
|
-
removeLeadingIcon?: () =>
|
|
199
|
+
setLeadingIcon?: (html: string) => void;
|
|
200
|
+
removeLeadingIcon?: () => void;
|
|
194
201
|
trailingIcon?: HTMLElement | null;
|
|
195
|
-
setTrailingIcon?: (html: string) =>
|
|
196
|
-
removeTrailingIcon?: () =>
|
|
202
|
+
setTrailingIcon?: (html: string) => void;
|
|
203
|
+
removeTrailingIcon?: () => void;
|
|
197
204
|
supportingTextElement?: HTMLElement | null;
|
|
198
|
-
setSupportingText?: (text: string, isError?: boolean) =>
|
|
199
|
-
removeSupportingText?: () =>
|
|
205
|
+
setSupportingText?: (text: string, isError?: boolean) => void;
|
|
206
|
+
removeSupportingText?: () => void;
|
|
200
207
|
prefixTextElement?: HTMLElement | null;
|
|
201
|
-
setPrefixText?: (text: string) =>
|
|
202
|
-
removePrefixText?: () =>
|
|
208
|
+
setPrefixText?: (text: string) => void;
|
|
209
|
+
removePrefixText?: () => void;
|
|
203
210
|
suffixTextElement?: HTMLElement | null;
|
|
204
|
-
setSuffixText?: (text: string) =>
|
|
205
|
-
removeSuffixText?: () =>
|
|
206
|
-
updateElementPositions?: () =>
|
|
207
|
-
on?: (event: string, handler: Function) =>
|
|
208
|
-
off?: (event: string, handler: Function) =>
|
|
211
|
+
setSuffixText?: (text: string) => void;
|
|
212
|
+
removeSuffixText?: () => void;
|
|
213
|
+
updateElementPositions?: () => void;
|
|
214
|
+
on?: (event: string, handler: Function) => void;
|
|
215
|
+
off?: (event: string, handler: Function) => void;
|
|
209
216
|
disabled?: {
|
|
210
|
-
enable: () =>
|
|
211
|
-
disable: () =>
|
|
217
|
+
enable: () => void;
|
|
218
|
+
disable: () => void;
|
|
212
219
|
};
|
|
213
220
|
lifecycle?: {
|
|
214
221
|
destroy: () => void;
|
|
215
222
|
};
|
|
216
|
-
[key: string]:
|
|
223
|
+
[key: string]: unknown;
|
|
217
224
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimeValue, TIME_FORMAT, TIME_PICKER_TYPE } from
|
|
1
|
+
import { TimeValue, TIME_FORMAT, TIME_PICKER_TYPE } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for Clock Dial rendering options
|
|
4
4
|
*/
|
|
@@ -7,7 +7,7 @@ export interface ClockDialOptions {
|
|
|
7
7
|
format: TIME_FORMAT;
|
|
8
8
|
showSeconds: boolean;
|
|
9
9
|
prefix: string;
|
|
10
|
-
activeSelector:
|
|
10
|
+
activeSelector: "hour" | "minute" | "second";
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Renders a clock dial on canvas with improved visual design
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimeValue, TIME_PERIOD, TIME_FORMAT } from
|
|
1
|
+
import { TimeValue, TIME_PERIOD, TIME_FORMAT } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Pads a number with leading zeros to ensure two-digit format
|
|
4
4
|
* @param {number} num - Number to pad
|
|
@@ -11,7 +11,7 @@ export declare const padZero: (num: number) => string;
|
|
|
11
11
|
* @param {TIME_FORMAT} format - Time format (12h or 24h)
|
|
12
12
|
* @returns {TimeValue} Parsed time value
|
|
13
13
|
*/
|
|
14
|
-
export declare const parseTime: (timeString: string,
|
|
14
|
+
export declare const parseTime: (timeString: string, _format: TIME_FORMAT) => TimeValue;
|
|
15
15
|
/**
|
|
16
16
|
* Formats a TimeValue object as a time string
|
|
17
17
|
* @param {TimeValue} timeValue - Time value to format
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @module components/top-app-bar
|
|
3
3
|
* @description Top app bar implementation
|
|
4
4
|
*/
|
|
5
|
-
import { ElementComponent } from
|
|
6
|
-
import { TopAppBarConfig, TopAppBarType } from
|
|
5
|
+
import { ElementComponent } from "../../core/compose";
|
|
6
|
+
import { TopAppBarConfig, TopAppBarType } from "./types";
|
|
7
7
|
/**
|
|
8
8
|
* Top app bar component interface
|
|
9
9
|
*/
|