mtrl 0.3.9 → 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 +18 -8
- 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 +18 -7
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/components/chips/chips.d.ts +1 -1
- package/dist/components/chips/config.d.ts +1 -1
- package/dist/components/chips/features/chip-items.d.ts +1 -1
- package/dist/components/chips/schema.d.ts +1 -2
- package/dist/components/datepicker/api.d.ts +1 -1
- package/dist/components/datepicker/config.d.ts +4 -4
- package/dist/components/datepicker/datepicker.d.ts +1 -1
- package/dist/components/datepicker/render.d.ts +5 -5
- package/dist/components/dialog/config.d.ts +2 -2
- package/dist/components/dialog/features.d.ts +1 -1
- package/dist/components/dialog/types.d.ts +1 -1
- package/dist/components/divider/divider.d.ts +2 -2
- package/dist/components/extended-fab/config.d.ts +2 -2
- package/dist/components/fab/config.d.ts +2 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/list/config.d.ts +1 -1
- package/dist/components/menu/api.d.ts +14 -14
- package/dist/components/menu/config.d.ts +2 -2
- 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 +2 -2
- 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 +49 -18
- package/dist/components/progress/config.d.ts +20 -11
- package/dist/components/progress/constants.d.ts +86 -1
- package/dist/components/progress/features/canvas.d.ts +61 -0
- package/dist/components/progress/features/circular.d.ts +9 -0
- package/dist/components/progress/features/index.d.ts +8 -0
- package/dist/components/progress/features/linear.d.ts +9 -0
- package/dist/components/progress/features/resize-observer.d.ts +5 -0
- package/dist/components/progress/features/state.d.ts +46 -0
- package/dist/components/progress/index.d.ts +2 -2
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/types.d.ts +102 -17
- package/dist/components/radios/api.d.ts +11 -11
- package/dist/components/radios/config.d.ts +2 -2
- package/dist/components/radios/radios.d.ts +1 -1
- package/dist/components/search/api.d.ts +15 -11
- package/dist/components/search/config.d.ts +1 -1
- package/dist/components/search/features/search.d.ts +1 -1
- package/dist/components/segmented-button/config.d.ts +8 -8
- 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 +2 -2
- 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 +2 -2
- 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 +7 -50
- 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 +3 -3
- package/dist/components/switch/api.d.ts +1 -1
- package/dist/components/switch/config.d.ts +2 -2
- 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 +2 -2
- 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 +4 -4
- 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 +2 -2
- 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 +8 -0
- package/dist/core/canvas/resize.d.ts +14 -0
- 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 +2 -1
- 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 +4 -2
- package/dist/core/config/global.d.ts +65 -0
- package/dist/core/dom/attributes.d.ts +13 -15
- package/dist/core/dom/classes.d.ts +10 -0
- package/dist/core/dom/create.d.ts +36 -6
- package/dist/core/dom/index.d.ts +2 -2
- 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 +3 -1
- package/dist/core/layout/array.d.ts +7 -2
- package/dist/core/layout/object.d.ts +2 -2
- 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 +2 -6
- package/dist/core/utils/theme.d.ts +38 -0
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +158 -143
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/index.js.map +158 -143
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +9 -13
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ProgressConfig, ProgressThickness } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Canvas dimensions and drawing context
|
|
4
|
+
*/
|
|
5
|
+
export interface CanvasContext {
|
|
6
|
+
canvas: HTMLCanvasElement;
|
|
7
|
+
ctx: CanvasRenderingContext2D;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
pixelRatio: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Component with canvas capabilities
|
|
14
|
+
*/
|
|
15
|
+
interface CanvasComponent {
|
|
16
|
+
element: HTMLElement;
|
|
17
|
+
canvas: HTMLCanvasElement;
|
|
18
|
+
ctx: CanvasRenderingContext2D;
|
|
19
|
+
getClass: (name: string) => string;
|
|
20
|
+
draw: () => void;
|
|
21
|
+
resize: () => void;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Base component interface for withCanvas
|
|
26
|
+
*/
|
|
27
|
+
interface BaseComponent {
|
|
28
|
+
element: HTMLElement;
|
|
29
|
+
getClass: (name: string) => string;
|
|
30
|
+
lifecycle?: {
|
|
31
|
+
init?: () => void;
|
|
32
|
+
destroy?: () => void;
|
|
33
|
+
};
|
|
34
|
+
state?: {
|
|
35
|
+
value?: number;
|
|
36
|
+
max?: number;
|
|
37
|
+
buffer?: number;
|
|
38
|
+
indeterminate?: boolean;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
};
|
|
41
|
+
animationId?: number | null;
|
|
42
|
+
wavyAnimationId?: number | null;
|
|
43
|
+
valueAnimationId?: number | null;
|
|
44
|
+
animationTime?: number;
|
|
45
|
+
setIndeterminate?: (indeterminate: boolean) => void;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the stroke width for a given thickness preset or custom value
|
|
50
|
+
*/
|
|
51
|
+
export declare const getStrokeWidth: (thickness?: ProgressThickness) => number;
|
|
52
|
+
/**
|
|
53
|
+
* Calculates wave amplitude based on stroke width
|
|
54
|
+
* Uses thickness 4 as the baseline (where amplitude is perfect)
|
|
55
|
+
*/
|
|
56
|
+
export declare const getWaveAmplitude: (strokeWidth: number, baseAmplitude: number, maxAmplitude?: number) => number;
|
|
57
|
+
/**
|
|
58
|
+
* Adds canvas functionality to replace complex DOM structure
|
|
59
|
+
*/
|
|
60
|
+
export declare const withCanvas: (config: ProgressConfig) => (component: BaseComponent) => CanvasComponent;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Circular progress drawing functionality
|
|
3
|
+
*/
|
|
4
|
+
import { ProgressConfig, ProgressShape } from "../types";
|
|
5
|
+
import { CanvasContext } from "./canvas";
|
|
6
|
+
/**
|
|
7
|
+
* Draws circular progress on canvas
|
|
8
|
+
*/
|
|
9
|
+
export declare const drawCircularProgress: (context: CanvasContext, config: ProgressConfig, value: number, max: number, isIndeterminate: boolean, animationTime?: number, currentShape?: ProgressShape) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress component features
|
|
3
|
+
* Exports all features used by the progress component
|
|
4
|
+
*/
|
|
5
|
+
export { withCanvas } from './canvas';
|
|
6
|
+
export { withState } from './state';
|
|
7
|
+
export { drawCircularProgress } from './circular';
|
|
8
|
+
export { drawLinearProgress } from './linear';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear progress drawing functionality
|
|
3
|
+
*/
|
|
4
|
+
import { ProgressConfig, ProgressShape } from "../types";
|
|
5
|
+
import { CanvasContext } from "./canvas";
|
|
6
|
+
/**
|
|
7
|
+
* Draws linear progress on canvas with shape support
|
|
8
|
+
*/
|
|
9
|
+
export declare const drawLinearProgress: (context: CanvasContext, config: ProgressConfig, value: number, max: number, buffer: number, isIndeterminate: boolean, animationTime?: number, showStopIndicator?: boolean, currentShape?: ProgressShape) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a ResizeObserver to handle canvas dimension changes
|
|
3
|
+
* This ensures the canvas always matches its container size
|
|
4
|
+
*/
|
|
5
|
+
export declare const createCanvasResizeObserver: (element: HTMLElement, canvas: HTMLCanvasElement, onResize: () => void) => (() => void);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ProgressConfig, ProgressShape } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Progress component state
|
|
4
|
+
*/
|
|
5
|
+
interface ProgressState {
|
|
6
|
+
value: number;
|
|
7
|
+
max: number;
|
|
8
|
+
buffer: number;
|
|
9
|
+
indeterminate: boolean;
|
|
10
|
+
thickness: number | string;
|
|
11
|
+
shape: ProgressShape;
|
|
12
|
+
labelFormatter: (value: number, max: number) => string;
|
|
13
|
+
label?: HTMLElement;
|
|
14
|
+
showLabel?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Component with lifecycle methods and canvas drawing
|
|
18
|
+
*/
|
|
19
|
+
interface ComponentWithLifecycle {
|
|
20
|
+
element: HTMLElement;
|
|
21
|
+
canvas?: HTMLCanvasElement;
|
|
22
|
+
draw?: () => void;
|
|
23
|
+
lifecycle?: {
|
|
24
|
+
init?: () => void;
|
|
25
|
+
destroy?: () => void;
|
|
26
|
+
};
|
|
27
|
+
getClass?: (name: string) => string;
|
|
28
|
+
setIndeterminate?: (indeterminate: boolean) => unknown;
|
|
29
|
+
setValue?: (value: number) => unknown;
|
|
30
|
+
setBuffer?: (buffer: number) => unknown;
|
|
31
|
+
setShape?: (shape: ProgressShape) => unknown;
|
|
32
|
+
showLabel?: () => unknown;
|
|
33
|
+
setThickness?: (thickness: number | string) => unknown;
|
|
34
|
+
state?: ProgressState;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Adds state management for canvas-based progress component
|
|
39
|
+
*
|
|
40
|
+
* @param config Progress configuration
|
|
41
|
+
* @returns Component enhancer with state management
|
|
42
|
+
*/
|
|
43
|
+
export declare const withState: (config: ProgressConfig) => (component: ComponentWithLifecycle) => ComponentWithLifecycle & {
|
|
44
|
+
state: ProgressState;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './progress';
|
|
2
|
-
export { ProgressConfig, ProgressComponent } from './types';
|
|
3
|
-
export { PROGRESS_VARIANTS, PROGRESS_EVENTS, PROGRESS_DEFAULTS, PROGRESS_CLASSES } from './constants';
|
|
2
|
+
export { ProgressConfig, ProgressComponent, ProgressShape } from './types';
|
|
3
|
+
export { PROGRESS_VARIANTS, PROGRESS_SHAPES, PROGRESS_EVENTS, PROGRESS_DEFAULTS, PROGRESS_CLASSES, PROGRESS_MEASUREMENTS, PROGRESS_THICKNESS } from './constants';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProgressConfig, ProgressComponent } from
|
|
1
|
+
import { ProgressConfig, ProgressComponent } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
* Creates a new Progress component
|
|
3
|
+
* Creates a new Progress component using canvas rendering
|
|
4
4
|
* @param {ProgressConfig} config - Progress configuration object
|
|
5
5
|
* @returns {ProgressComponent} Progress component instance
|
|
6
6
|
*
|
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
* Progress variant types
|
|
3
3
|
* @category Components
|
|
4
4
|
*/
|
|
5
|
-
export type ProgressVariant =
|
|
5
|
+
export type ProgressVariant = "linear" | "circular";
|
|
6
|
+
/**
|
|
7
|
+
* Progress thickness options
|
|
8
|
+
* @category Components
|
|
9
|
+
*/
|
|
10
|
+
export type ProgressThickness = "thin" | "thick" | number;
|
|
11
|
+
/**
|
|
12
|
+
* Progress shape options (linear only)
|
|
13
|
+
* @category Components
|
|
14
|
+
*/
|
|
15
|
+
export type ProgressShape = "flat" | "wavy";
|
|
6
16
|
/**
|
|
7
17
|
* Progress component event types
|
|
8
18
|
* @category Components
|
|
9
19
|
*/
|
|
10
|
-
export type ProgressEvent =
|
|
20
|
+
export type ProgressEvent = "change" | "complete";
|
|
11
21
|
/**
|
|
12
22
|
* Configuration interface for the Progress component
|
|
13
23
|
* @category Components
|
|
@@ -17,7 +27,7 @@ export interface ProgressConfig {
|
|
|
17
27
|
* Progress variant that determines visual style
|
|
18
28
|
* @default 'linear'
|
|
19
29
|
*/
|
|
20
|
-
variant?: ProgressVariant
|
|
30
|
+
variant?: ProgressVariant;
|
|
21
31
|
/**
|
|
22
32
|
* Initial progress value (0-100)
|
|
23
33
|
* @default 0
|
|
@@ -40,9 +50,20 @@ export interface ProgressConfig {
|
|
|
40
50
|
buffer?: number;
|
|
41
51
|
/**
|
|
42
52
|
* Additional CSS classes to add to the progress component
|
|
43
|
-
* @example 'page-loader main-progress'
|
|
44
53
|
*/
|
|
45
54
|
class?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Thickness of the progress track and indicator
|
|
57
|
+
* Can be a named preset ('thin', 'default', 'thick') or a specific number in pixels
|
|
58
|
+
* @default 'default'
|
|
59
|
+
*/
|
|
60
|
+
thickness?: ProgressThickness;
|
|
61
|
+
/**
|
|
62
|
+
* Shape of the linear indeterminate progress animation
|
|
63
|
+
* Only affects linear variant in indeterminate state
|
|
64
|
+
* @default 'flat'
|
|
65
|
+
*/
|
|
66
|
+
shape?: ProgressShape;
|
|
46
67
|
/**
|
|
47
68
|
* Whether to show text label with percentage
|
|
48
69
|
* @default false
|
|
@@ -55,7 +76,6 @@ export interface ProgressConfig {
|
|
|
55
76
|
indeterminate?: boolean;
|
|
56
77
|
/**
|
|
57
78
|
* Custom label formatter function
|
|
58
|
-
* @example (value, max) => `${Math.round((value/max) * 100)}%`
|
|
59
79
|
*/
|
|
60
80
|
labelFormatter?: (value: number, max: number) => string;
|
|
61
81
|
/**
|
|
@@ -68,6 +88,17 @@ export interface ProgressConfig {
|
|
|
68
88
|
* @default 'progress'
|
|
69
89
|
*/
|
|
70
90
|
componentName?: string;
|
|
91
|
+
/**
|
|
92
|
+
* DOM structure schema
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
schema?: any;
|
|
96
|
+
/**
|
|
97
|
+
* Size of the circular progress indicator in dp (only for circular variant)
|
|
98
|
+
* Clamped between 24 and 240
|
|
99
|
+
* @default 50
|
|
100
|
+
*/
|
|
101
|
+
size?: number;
|
|
71
102
|
}
|
|
72
103
|
/**
|
|
73
104
|
* Progress component interface
|
|
@@ -76,14 +107,12 @@ export interface ProgressConfig {
|
|
|
76
107
|
export interface ProgressComponent {
|
|
77
108
|
/** The component's root DOM element */
|
|
78
109
|
element: HTMLElement;
|
|
79
|
-
/** The track element (
|
|
80
|
-
|
|
81
|
-
/** The indicator element (filled part) */
|
|
82
|
-
|
|
83
|
-
/** The buffer element for linear variant (pre-loaded state) */
|
|
84
|
-
|
|
85
|
-
/** The label element if showLabel is enabled */
|
|
86
|
-
labelElement?: HTMLElement;
|
|
110
|
+
/** The track element (unfilled part) - always an SVG element */
|
|
111
|
+
track: SVGElement;
|
|
112
|
+
/** The indicator element (filled part) - always an SVG element */
|
|
113
|
+
indicator: SVGElement;
|
|
114
|
+
/** The buffer element for linear variant (pre-loaded state) - always an SVG element */
|
|
115
|
+
buffer?: SVGElement;
|
|
87
116
|
/**
|
|
88
117
|
* Gets a class name with the component's prefix
|
|
89
118
|
* @param name - Base class name
|
|
@@ -91,16 +120,22 @@ export interface ProgressComponent {
|
|
|
91
120
|
*/
|
|
92
121
|
getClass: (name: string) => string;
|
|
93
122
|
/**
|
|
94
|
-
* Sets the
|
|
95
|
-
* @param value - Progress value
|
|
96
|
-
* @
|
|
123
|
+
* Sets the progress value
|
|
124
|
+
* @param value - Progress value between 0 and max
|
|
125
|
+
* @param animate - Whether to animate the value change (default: true)
|
|
126
|
+
* @returns The component instance for chaining
|
|
97
127
|
*/
|
|
98
|
-
setValue: (value: number) => ProgressComponent;
|
|
128
|
+
setValue: (value: number, animate?: boolean) => ProgressComponent;
|
|
99
129
|
/**
|
|
100
130
|
* Gets the current progress value
|
|
101
131
|
* @returns Current progress value
|
|
102
132
|
*/
|
|
103
133
|
getValue: () => number;
|
|
134
|
+
/**
|
|
135
|
+
* Gets the maximum progress value
|
|
136
|
+
* @returns Maximum progress value
|
|
137
|
+
*/
|
|
138
|
+
getMax: () => number;
|
|
104
139
|
/**
|
|
105
140
|
* Sets the buffer value (for linear variant with buffer indicators)
|
|
106
141
|
* @param value - Buffer value (between 0 and max)
|
|
@@ -127,6 +162,21 @@ export interface ProgressComponent {
|
|
|
127
162
|
* @returns Whether the component is disabled
|
|
128
163
|
*/
|
|
129
164
|
isDisabled: () => boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Hides the progress component
|
|
167
|
+
* @returns The progress component for chaining
|
|
168
|
+
*/
|
|
169
|
+
hide: () => ProgressComponent;
|
|
170
|
+
/**
|
|
171
|
+
* Shows the progress component
|
|
172
|
+
* @returns The progress component for chaining
|
|
173
|
+
*/
|
|
174
|
+
show: () => ProgressComponent;
|
|
175
|
+
/**
|
|
176
|
+
* Checks if the progress component is visible
|
|
177
|
+
* @returns Whether the component is visible
|
|
178
|
+
*/
|
|
179
|
+
isVisible: () => boolean;
|
|
130
180
|
/**
|
|
131
181
|
* Shows the label element
|
|
132
182
|
* @returns The progress component for chaining
|
|
@@ -143,6 +193,29 @@ export interface ProgressComponent {
|
|
|
143
193
|
* @returns The progress component for chaining
|
|
144
194
|
*/
|
|
145
195
|
setLabelFormatter: (formatter: (value: number, max: number) => string) => ProgressComponent;
|
|
196
|
+
/**
|
|
197
|
+
* Sets the thickness of the progress track and indicator
|
|
198
|
+
* @param thickness - Thickness value ('thin', 'default', 'thick' or number in pixels)
|
|
199
|
+
* @returns The progress component for chaining
|
|
200
|
+
*/
|
|
201
|
+
setThickness: (thickness: ProgressThickness) => ProgressComponent;
|
|
202
|
+
/**
|
|
203
|
+
* Gets the current thickness value in pixels
|
|
204
|
+
* @returns Current thickness in pixels
|
|
205
|
+
*/
|
|
206
|
+
getThickness: () => number;
|
|
207
|
+
/**
|
|
208
|
+
* Sets the shape of the linear indeterminate progress animation
|
|
209
|
+
* Only affects linear variant in indeterminate state
|
|
210
|
+
* @param shape - Shape value ('flat' or 'wavy')
|
|
211
|
+
* @returns The progress component for chaining
|
|
212
|
+
*/
|
|
213
|
+
setShape: (shape: ProgressShape) => ProgressComponent;
|
|
214
|
+
/**
|
|
215
|
+
* Gets the current shape value
|
|
216
|
+
* @returns Current shape
|
|
217
|
+
*/
|
|
218
|
+
getShape: () => ProgressShape;
|
|
146
219
|
/**
|
|
147
220
|
* Sets the indeterminate state
|
|
148
221
|
* @param indeterminate - Whether progress is indeterminate
|
|
@@ -154,6 +227,18 @@ export interface ProgressComponent {
|
|
|
154
227
|
* @returns Whether the component is indeterminate
|
|
155
228
|
*/
|
|
156
229
|
isIndeterminate: () => boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Sets the size of the circular progress indicator
|
|
232
|
+
* Only applies to circular variant
|
|
233
|
+
* @param size - Size in pixels (clamped between 24 and 240)
|
|
234
|
+
* @returns The progress component for chaining
|
|
235
|
+
*/
|
|
236
|
+
setSize: (size: number) => ProgressComponent;
|
|
237
|
+
/**
|
|
238
|
+
* Gets the current size of the circular progress indicator
|
|
239
|
+
* @returns Current size in pixels, or undefined for linear variant
|
|
240
|
+
*/
|
|
241
|
+
getSize: () => number | undefined;
|
|
157
242
|
/**
|
|
158
243
|
* Adds an event listener to the progress
|
|
159
244
|
* @param event - Event name ('change', 'complete')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RadiosComponent } from
|
|
1
|
+
import { RadiosComponent, RadioItem, RadioOptionConfig } from "./types";
|
|
2
2
|
interface ApiOptions {
|
|
3
3
|
disabled: {
|
|
4
4
|
enable: () => void;
|
|
@@ -10,21 +10,21 @@ interface ApiOptions {
|
|
|
10
10
|
}
|
|
11
11
|
interface ComponentWithRadio {
|
|
12
12
|
element: HTMLElement;
|
|
13
|
-
radios:
|
|
13
|
+
radios: RadioItem[];
|
|
14
14
|
getValue: () => string;
|
|
15
|
-
setValue: (value: string) =>
|
|
16
|
-
getSelected: () =>
|
|
17
|
-
addOption: (option:
|
|
18
|
-
removeOption: (value: string) =>
|
|
19
|
-
enable: () =>
|
|
20
|
-
disable: () =>
|
|
21
|
-
enableOption: (value: string) =>
|
|
22
|
-
disableOption: (value: string) =>
|
|
15
|
+
setValue: (value: string) => void;
|
|
16
|
+
getSelected: () => RadioOptionConfig | null;
|
|
17
|
+
addOption: (option: RadioOptionConfig) => void;
|
|
18
|
+
removeOption: (value: string) => void;
|
|
19
|
+
enable: () => void;
|
|
20
|
+
disable: () => void;
|
|
21
|
+
enableOption: (value: string) => void;
|
|
22
|
+
disableOption: (value: string) => void;
|
|
23
23
|
getClass: (name: string) => string;
|
|
24
24
|
events: {
|
|
25
25
|
on: (event: string, handler: Function) => void;
|
|
26
26
|
off: (event: string, handler: Function) => void;
|
|
27
|
-
emit?: (event: string, data:
|
|
27
|
+
emit?: (event: string, data: unknown) => void;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RadiosConfig } from
|
|
1
|
+
import { RadiosConfig } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration for the Radios component
|
|
4
4
|
*/
|
|
@@ -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
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { SearchComponent } from
|
|
1
|
+
import { SearchComponent } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* API options interface - structured by feature area
|
|
4
4
|
*/
|
|
5
5
|
interface ApiOptions {
|
|
6
6
|
search: {
|
|
7
|
-
setValue: (value: string, triggerEvent?: boolean) =>
|
|
7
|
+
setValue: (value: string, triggerEvent?: boolean) => void;
|
|
8
8
|
getValue: () => string;
|
|
9
|
-
setPlaceholder: (text: string) =>
|
|
9
|
+
setPlaceholder: (text: string) => void;
|
|
10
10
|
getPlaceholder: () => string;
|
|
11
|
-
focus: () =>
|
|
12
|
-
blur: () =>
|
|
13
|
-
expand: () =>
|
|
14
|
-
collapse: () =>
|
|
15
|
-
clear: () =>
|
|
16
|
-
submit: () =>
|
|
17
|
-
setSuggestions: (suggestions:
|
|
18
|
-
|
|
11
|
+
focus: () => void;
|
|
12
|
+
blur: () => void;
|
|
13
|
+
expand: () => void;
|
|
14
|
+
collapse: () => void;
|
|
15
|
+
clear: () => void;
|
|
16
|
+
submit: () => void;
|
|
17
|
+
setSuggestions: (suggestions: string[] | Array<{
|
|
18
|
+
text: string;
|
|
19
|
+
value?: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
}>) => void;
|
|
22
|
+
showSuggestions: (show: boolean) => void;
|
|
19
23
|
};
|
|
20
24
|
disabled: {
|
|
21
25
|
enable: () => void;
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SearchConfig) => SearchConfig;
|
|
|
17
17
|
export declare const getElementConfig: (config: SearchConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SegmentedButtonConfig, SelectionMode } from
|
|
1
|
+
import { SegmentedButtonConfig, SelectionMode } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration values for segmented buttons
|
|
4
4
|
* @internal
|
|
@@ -24,11 +24,11 @@ export declare const createBaseConfig: (config?: SegmentedButtonConfig) => Segme
|
|
|
24
24
|
export declare const getContainerConfig: (config: SegmentedButtonConfig) => {
|
|
25
25
|
tag: string;
|
|
26
26
|
componentName: string;
|
|
27
|
-
|
|
27
|
+
attributes: {
|
|
28
28
|
role: string;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
"aria-label": string;
|
|
30
|
+
"data-mode": SelectionMode;
|
|
31
|
+
"data-density": string;
|
|
32
32
|
};
|
|
33
33
|
className: string[];
|
|
34
34
|
interactive: boolean;
|
|
@@ -50,16 +50,16 @@ export declare const getDensityStyles: (density: string) => Record<string, strin
|
|
|
50
50
|
*/
|
|
51
51
|
export declare const getSegmentConfig: (segment: any, prefix: any, groupDisabled?: boolean) => {
|
|
52
52
|
tag: string;
|
|
53
|
-
|
|
53
|
+
attributes: {
|
|
54
54
|
type: string;
|
|
55
55
|
role: string;
|
|
56
56
|
disabled: boolean;
|
|
57
|
-
|
|
57
|
+
"aria-pressed": string;
|
|
58
58
|
value: any;
|
|
59
59
|
};
|
|
60
60
|
className: any[];
|
|
61
61
|
forwardEvents: {
|
|
62
|
-
click: (
|
|
62
|
+
click: () => boolean;
|
|
63
63
|
};
|
|
64
64
|
interactive: boolean;
|
|
65
65
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Available Select variants
|
|
3
3
|
*/
|
|
4
|
-
export type SelectVariant =
|
|
4
|
+
export type SelectVariant = "filled" | "outlined";
|
|
5
5
|
/**
|
|
6
6
|
* Select variant constants
|
|
7
7
|
*/
|
|
@@ -59,6 +59,10 @@ export interface SelectConfig {
|
|
|
59
59
|
* Visual variant (filled, outlined)
|
|
60
60
|
*/
|
|
61
61
|
variant?: SelectVariant | string;
|
|
62
|
+
/**
|
|
63
|
+
* Density level (default, compact)
|
|
64
|
+
*/
|
|
65
|
+
density?: "default" | "compact" | string;
|
|
62
66
|
/**
|
|
63
67
|
* Label text
|
|
64
68
|
*/
|
|
@@ -166,7 +170,7 @@ export interface SelectComponent {
|
|
|
166
170
|
* @param interactionType - The type of interaction ('mouse' or 'keyboard')
|
|
167
171
|
* @returns Select component for chaining
|
|
168
172
|
*/
|
|
169
|
-
open: (interactionType?:
|
|
173
|
+
open: (interactionType?: "mouse" | "keyboard") => SelectComponent;
|
|
170
174
|
/**
|
|
171
175
|
* Closes the select menu
|
|
172
176
|
* @returns Select component for chaining
|
|
@@ -176,6 +180,17 @@ export interface SelectComponent {
|
|
|
176
180
|
* Checks if the menu is open
|
|
177
181
|
*/
|
|
178
182
|
isOpen: () => boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Sets the density of the select
|
|
185
|
+
* @param density - The density level to set
|
|
186
|
+
* @returns Select component for chaining
|
|
187
|
+
*/
|
|
188
|
+
setDensity: (density: "default" | "compact" | string) => SelectComponent;
|
|
189
|
+
/**
|
|
190
|
+
* Gets the current density setting
|
|
191
|
+
* @returns The current density
|
|
192
|
+
*/
|
|
193
|
+
getDensity: () => string;
|
|
179
194
|
/**
|
|
180
195
|
* Adds an event listener
|
|
181
196
|
* @param event - Event name
|
|
@@ -248,9 +263,9 @@ export interface SelectChangeEvent extends SelectEvent {
|
|
|
248
263
|
* @internal
|
|
249
264
|
*/
|
|
250
265
|
export interface SelectEvents {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
266
|
+
change: (event: SelectChangeEvent) => void;
|
|
267
|
+
open: (event: SelectEvent) => void;
|
|
268
|
+
close: (event: SelectEvent) => void;
|
|
254
269
|
}
|
|
255
270
|
/**
|
|
256
271
|
* API options interface
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SheetConfig } from
|
|
1
|
+
import { SheetConfig } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration for the Sheet component
|
|
4
4
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SheetConfig) => SheetConfig;
|
|
|
17
17
|
export declare const getElementConfig: (config: SheetConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SliderComponent } from
|
|
1
|
+
import { SliderComponent } from "./types";
|
|
2
|
+
import { SliderSize } from "./constants";
|
|
2
3
|
/**
|
|
3
4
|
* API options interface - structured by feature area
|
|
4
5
|
*/
|
|
@@ -24,7 +25,7 @@ interface ApiOptions {
|
|
|
24
25
|
appearance: {
|
|
25
26
|
setColor: (color: string) => void;
|
|
26
27
|
getColor: () => string;
|
|
27
|
-
setSize: (size:
|
|
28
|
+
setSize: (size: SliderSize) => void;
|
|
28
29
|
getSize: () => string;
|
|
29
30
|
showTicks: (show: boolean) => void;
|
|
30
31
|
showCurrentValue: (show: boolean) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SliderConfig } from
|
|
1
|
+
import { SliderConfig } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration for the Slider component
|
|
4
4
|
*/
|
|
@@ -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
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|