mtrl 0.4.4 → 0.5.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/README.md +61 -60
- package/dist/README.md +61 -60
- package/dist/components/chips/chips.d.ts +2 -2
- package/dist/components/chips/config.d.ts +1 -1
- package/dist/components/chips/features/controller.d.ts +1 -1
- package/dist/components/chips/features/dom.d.ts +15 -0
- package/dist/components/chips/features/index.d.ts +5 -4
- package/dist/components/chips/schema.d.ts +2 -2
- package/dist/components/list/api.d.ts +82 -39
- package/dist/components/list/config.d.ts +23 -19
- package/dist/components/list/features/index.d.ts +1 -1
- package/dist/components/list/features/renderer.d.ts +9 -0
- package/dist/components/list/features/selection.d.ts +1 -1
- package/dist/components/list/list.d.ts +3 -2
- package/dist/components/list/types.d.ts +68 -121
- package/dist/components/progress/constants.d.ts +3 -3
- package/dist/components/slider/features/canvas.d.ts +2 -2
- package/dist/components/slider/features/dom.d.ts +21 -0
- package/dist/components/slider/features/index.d.ts +5 -4
- package/dist/components/slider/slider.d.ts +4 -4
- package/dist/components/textfield/api.d.ts +2 -0
- package/dist/components/textfield/features/error.d.ts +54 -0
- package/dist/components/textfield/features/index.d.ts +1 -0
- package/dist/components/textfield/features/placement.d.ts +1 -1
- package/dist/components/textfield/features/supporting-text.d.ts +1 -1
- package/dist/components/textfield/types.d.ts +7 -0
- package/dist/core/compose/features/icon.d.ts +2 -2
- package/dist/core/compose/features/index.d.ts +0 -2
- package/dist/core/compose/features/textinput.d.ts +4 -0
- package/dist/core/compose/features/textlabel.d.ts +2 -2
- package/dist/core/compose/index.d.ts +1 -5
- package/dist/core/dom/attributes.d.ts +32 -2
- package/dist/core/dom/classes.d.ts +15 -13
- package/dist/core/dom/create.d.ts +35 -87
- package/dist/core/dom/index.d.ts +6 -6
- package/dist/core/dom/utils.d.ts +1 -10
- package/dist/core/index.d.ts +18 -22
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +36 -74
- package/dist/index.d.ts +1 -6
- package/dist/index.js +15 -15
- package/dist/index.js.map +36 -74
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +4 -3
- package/dist/components/list/features/listmanager.d.ts +0 -9
- package/dist/components/slider/schema.d.ts +0 -65
- package/dist/core/collection/adapters/base.d.ts +0 -47
- package/dist/core/collection/adapters/route.d.ts +0 -149
- package/dist/core/collection/collection.d.ts +0 -131
- package/dist/core/collection/index.d.ts +0 -10
- package/dist/core/collection/list-manager/config.d.ts +0 -29
- package/dist/core/collection/list-manager/dom-elements.d.ts +0 -30
- package/dist/core/collection/list-manager/index.d.ts +0 -61
- package/dist/core/collection/list-manager/item-measurement.d.ts +0 -91
- package/dist/core/collection/list-manager/renderer.d.ts +0 -31
- package/dist/core/collection/list-manager/scroll-tracker.d.ts +0 -20
- package/dist/core/collection/list-manager/state.d.ts +0 -60
- package/dist/core/collection/list-manager/types.d.ts +0 -361
- package/dist/core/collection/list-manager/utils/recycling.d.ts +0 -34
- package/dist/core/collection/list-manager/utils/visibility.d.ts +0 -45
- package/dist/core/compose/features/gestures/longpress.d.ts +0 -85
- package/dist/core/compose/features/gestures/pan.d.ts +0 -108
- package/dist/core/compose/features/gestures/pinch.d.ts +0 -111
- package/dist/core/compose/features/gestures/rotate.d.ts +0 -111
- package/dist/core/compose/features/gestures/swipe.d.ts +0 -149
- package/dist/core/compose/features/gestures/tap.d.ts +0 -79
- package/dist/core/compose/features/gestures.d.ts +0 -86
- package/dist/core/composition/features/dom.d.ts +0 -19
- package/dist/core/composition/features/icon.d.ts +0 -45
- package/dist/core/composition/features/index.d.ts +0 -7
- package/dist/core/composition/features/label.d.ts +0 -49
- package/dist/core/composition/features/layout.d.ts +0 -31
- package/dist/core/composition/index.d.ts +0 -16
- package/dist/core/gestures/index.d.ts +0 -12
- package/dist/core/gestures/longpress.d.ts +0 -23
- package/dist/core/gestures/manager.d.ts +0 -14
- package/dist/core/gestures/pan.d.ts +0 -12
- package/dist/core/gestures/pinch.d.ts +0 -14
- package/dist/core/gestures/rotate.d.ts +0 -14
- package/dist/core/gestures/swipe.d.ts +0 -20
- package/dist/core/gestures/tap.d.ts +0 -12
- package/dist/core/gestures/types.d.ts +0 -320
- package/dist/core/gestures/utils.d.ts +0 -57
- package/dist/core/layout/array.d.ts +0 -20
- package/dist/core/layout/config.d.ts +0 -32
- package/dist/core/layout/create.d.ts +0 -14
- package/dist/core/layout/index.d.ts +0 -13
- package/dist/core/layout/jsx.d.ts +0 -13
- package/dist/core/layout/object.d.ts +0 -14
- package/dist/core/layout/processor.d.ts +0 -28
- package/dist/core/layout/result.d.ts +0 -12
- package/dist/core/layout/template.d.ts +0 -12
- package/dist/core/layout/types.d.ts +0 -137
- package/dist/core/layout/utils.d.ts +0 -38
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module core/compose/features/gestures
|
|
3
|
-
* @description Adds pan gesture recognition to components
|
|
4
|
-
*/
|
|
5
|
-
import { BaseComponent, ElementComponent } from "../../component";
|
|
6
|
-
import { PanEvent, GestureHandler } from "../../../gestures";
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for pan gesture feature
|
|
9
|
-
*/
|
|
10
|
-
export interface PanGestureConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Whether to prevent default behaviors on touch events
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
preventDefault?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Handler for pan start (first movement)
|
|
18
|
-
*/
|
|
19
|
-
onPanStart?: GestureHandler;
|
|
20
|
-
/**
|
|
21
|
-
* Handler for pan move (continuous updates during pan)
|
|
22
|
-
*/
|
|
23
|
-
onPan?: GestureHandler;
|
|
24
|
-
/**
|
|
25
|
-
* Handler for pan end (touch/mouse release)
|
|
26
|
-
*/
|
|
27
|
-
onPanEnd?: GestureHandler;
|
|
28
|
-
/**
|
|
29
|
-
* Whether to enable pan recognition immediately
|
|
30
|
-
* @default true
|
|
31
|
-
*/
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Component with pan gesture recognition capabilities
|
|
37
|
-
*/
|
|
38
|
-
export interface PanGestureComponent extends BaseComponent {
|
|
39
|
-
/**
|
|
40
|
-
* Add a handler for pan start
|
|
41
|
-
* @param handler - Event handler function
|
|
42
|
-
* @returns Component for chaining
|
|
43
|
-
*/
|
|
44
|
-
onPanStart: (handler: (event: PanEvent) => void) => PanGestureComponent;
|
|
45
|
-
/**
|
|
46
|
-
* Add a handler for pan move (continuous updates)
|
|
47
|
-
* @param handler - Event handler function
|
|
48
|
-
* @returns Component for chaining
|
|
49
|
-
*/
|
|
50
|
-
onPan: (handler: (event: PanEvent) => void) => PanGestureComponent;
|
|
51
|
-
/**
|
|
52
|
-
* Add a handler for pan end
|
|
53
|
-
* @param handler - Event handler function
|
|
54
|
-
* @returns Component for chaining
|
|
55
|
-
*/
|
|
56
|
-
onPanEnd: (handler: (event: PanEvent) => void) => PanGestureComponent;
|
|
57
|
-
/**
|
|
58
|
-
* Remove a pan start handler
|
|
59
|
-
* @param handler - Event handler function
|
|
60
|
-
* @returns Component for chaining
|
|
61
|
-
*/
|
|
62
|
-
offPanStart: (handler: (event: PanEvent) => void) => PanGestureComponent;
|
|
63
|
-
/**
|
|
64
|
-
* Remove a pan move handler
|
|
65
|
-
* @param handler - Event handler function
|
|
66
|
-
* @returns Component for chaining
|
|
67
|
-
*/
|
|
68
|
-
offPan: (handler: (event: PanEvent) => void) => PanGestureComponent;
|
|
69
|
-
/**
|
|
70
|
-
* Remove a pan end handler
|
|
71
|
-
* @param handler - Event handler function
|
|
72
|
-
* @returns Component for chaining
|
|
73
|
-
*/
|
|
74
|
-
offPanEnd: (handler: (event: PanEvent) => void) => PanGestureComponent;
|
|
75
|
-
/**
|
|
76
|
-
* Enable pan recognition
|
|
77
|
-
* @returns Component for chaining
|
|
78
|
-
*/
|
|
79
|
-
enablePan: () => PanGestureComponent;
|
|
80
|
-
/**
|
|
81
|
-
* Disable pan recognition
|
|
82
|
-
* @returns Component for chaining
|
|
83
|
-
*/
|
|
84
|
-
disablePan: () => PanGestureComponent;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Adds pan gesture recognition to a component.
|
|
88
|
-
* This is a lightweight alternative to the full gesture system,
|
|
89
|
-
* focused only on pan detection.
|
|
90
|
-
*
|
|
91
|
-
* @param config - Configuration object containing pan settings
|
|
92
|
-
* @returns Function that enhances a component with pan capabilities
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```ts
|
|
96
|
-
* // Add pan gesture recognition to a component
|
|
97
|
-
* const component = pipe(
|
|
98
|
-
* createBase,
|
|
99
|
-
* withElement(...),
|
|
100
|
-
* withPanGesture({
|
|
101
|
-
* onPanStart: (e) => startDrag(e),
|
|
102
|
-
* onPan: (e) => updateDragPosition(e),
|
|
103
|
-
* onPanEnd: (e) => endDrag(e)
|
|
104
|
-
* })
|
|
105
|
-
* )(config);
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
export declare const withPanGesture: (config?: PanGestureConfig) => <C extends ElementComponent>(component: C) => C & PanGestureComponent;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module core/compose/features/gestures
|
|
3
|
-
* @description Adds pinch gesture recognition to components
|
|
4
|
-
*/
|
|
5
|
-
import { BaseComponent, ElementComponent } from "../../component";
|
|
6
|
-
import { PinchEvent, GestureHandler } from "../../../gestures";
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for pinch gesture feature
|
|
9
|
-
*/
|
|
10
|
-
export interface PinchGestureConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Whether to prevent default behaviors on touch events
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
preventDefault?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Handler for pinch gesture
|
|
18
|
-
*/
|
|
19
|
-
onPinch?: GestureHandler;
|
|
20
|
-
/**
|
|
21
|
-
* Handler for pinch start
|
|
22
|
-
*/
|
|
23
|
-
onPinchStart?: GestureHandler;
|
|
24
|
-
/**
|
|
25
|
-
* Handler for pinch end
|
|
26
|
-
*/
|
|
27
|
-
onPinchEnd?: GestureHandler;
|
|
28
|
-
/**
|
|
29
|
-
* Whether to enable pinch recognition immediately
|
|
30
|
-
* @default true
|
|
31
|
-
*/
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Component with pinch gesture recognition capabilities
|
|
37
|
-
*/
|
|
38
|
-
export interface PinchGestureComponent extends BaseComponent {
|
|
39
|
-
/**
|
|
40
|
-
* Add a pinch event handler
|
|
41
|
-
* @param handler - Event handler function
|
|
42
|
-
* @returns Component for chaining
|
|
43
|
-
*/
|
|
44
|
-
onPinch: (handler: (event: PinchEvent) => void) => PinchGestureComponent;
|
|
45
|
-
/**
|
|
46
|
-
* Add a pinch start event handler
|
|
47
|
-
* @param handler - Event handler function
|
|
48
|
-
* @returns Component for chaining
|
|
49
|
-
*/
|
|
50
|
-
onPinchStart: (handler: (event: PinchEvent) => void) => PinchGestureComponent;
|
|
51
|
-
/**
|
|
52
|
-
* Add a pinch end event handler
|
|
53
|
-
* @param handler - Event handler function
|
|
54
|
-
* @returns Component for chaining
|
|
55
|
-
*/
|
|
56
|
-
onPinchEnd: (handler: (event: PinchEvent) => void) => PinchGestureComponent;
|
|
57
|
-
/**
|
|
58
|
-
* Remove a pinch event handler
|
|
59
|
-
* @param handler - Event handler function
|
|
60
|
-
* @returns Component for chaining
|
|
61
|
-
*/
|
|
62
|
-
offPinch: (handler: (event: PinchEvent) => void) => PinchGestureComponent;
|
|
63
|
-
/**
|
|
64
|
-
* Remove a pinch start event handler
|
|
65
|
-
* @param handler - Event handler function
|
|
66
|
-
* @returns Component for chaining
|
|
67
|
-
*/
|
|
68
|
-
offPinchStart: (handler: (event: PinchEvent) => void) => PinchGestureComponent;
|
|
69
|
-
/**
|
|
70
|
-
* Remove a pinch end event handler
|
|
71
|
-
* @param handler - Event handler function
|
|
72
|
-
* @returns Component for chaining
|
|
73
|
-
*/
|
|
74
|
-
offPinchEnd: (handler: (event: PinchEvent) => void) => PinchGestureComponent;
|
|
75
|
-
/**
|
|
76
|
-
* Enable pinch recognition
|
|
77
|
-
* @returns Component for chaining
|
|
78
|
-
*/
|
|
79
|
-
enablePinch: () => PinchGestureComponent;
|
|
80
|
-
/**
|
|
81
|
-
* Disable pinch recognition
|
|
82
|
-
* @returns Component for chaining
|
|
83
|
-
*/
|
|
84
|
-
disablePinch: () => PinchGestureComponent;
|
|
85
|
-
/**
|
|
86
|
-
* Check if pinch gestures are supported on the current device
|
|
87
|
-
* @returns Whether pinch gestures are supported
|
|
88
|
-
*/
|
|
89
|
-
isPinchSupported: () => boolean;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Adds pinch gesture recognition to a component.
|
|
93
|
-
* This is a lightweight alternative to the full gesture system,
|
|
94
|
-
* focused only on pinch detection.
|
|
95
|
-
*
|
|
96
|
-
* @param config - Configuration object containing pinch settings
|
|
97
|
-
* @returns Function that enhances a component with pinch capabilities
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```ts
|
|
101
|
-
* // Add pinch gesture recognition to a component
|
|
102
|
-
* const component = pipe(
|
|
103
|
-
* createBase,
|
|
104
|
-
* withElement(...),
|
|
105
|
-
* withPinchGesture({
|
|
106
|
-
* onPinch: (e) => updateZoom(e.scale)
|
|
107
|
-
* })
|
|
108
|
-
* )(config);
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
export declare const withPinchGesture: (config?: PinchGestureConfig) => <C extends ElementComponent>(component: C) => C & PinchGestureComponent;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module core/compose/features/gestures
|
|
3
|
-
* @description Adds rotate gesture recognition to components
|
|
4
|
-
*/
|
|
5
|
-
import { BaseComponent, ElementComponent } from "../../component";
|
|
6
|
-
import { RotateEvent, GestureHandler } from "../../../gestures";
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for rotate gesture feature
|
|
9
|
-
*/
|
|
10
|
-
export interface RotateGestureConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Whether to prevent default behaviors on touch events
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
preventDefault?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Handler for rotate gesture
|
|
18
|
-
*/
|
|
19
|
-
onRotate?: GestureHandler;
|
|
20
|
-
/**
|
|
21
|
-
* Handler for rotate start
|
|
22
|
-
*/
|
|
23
|
-
onRotateStart?: GestureHandler;
|
|
24
|
-
/**
|
|
25
|
-
* Handler for rotate end
|
|
26
|
-
*/
|
|
27
|
-
onRotateEnd?: GestureHandler;
|
|
28
|
-
/**
|
|
29
|
-
* Whether to enable rotate recognition immediately
|
|
30
|
-
* @default true
|
|
31
|
-
*/
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Component with rotate gesture recognition capabilities
|
|
37
|
-
*/
|
|
38
|
-
export interface RotateGestureComponent extends BaseComponent {
|
|
39
|
-
/**
|
|
40
|
-
* Add a rotate event handler
|
|
41
|
-
* @param handler - Event handler function
|
|
42
|
-
* @returns Component for chaining
|
|
43
|
-
*/
|
|
44
|
-
onRotate: (handler: (event: RotateEvent) => void) => RotateGestureComponent;
|
|
45
|
-
/**
|
|
46
|
-
* Add a rotate start event handler
|
|
47
|
-
* @param handler - Event handler function
|
|
48
|
-
* @returns Component for chaining
|
|
49
|
-
*/
|
|
50
|
-
onRotateStart: (handler: (event: RotateEvent) => void) => RotateGestureComponent;
|
|
51
|
-
/**
|
|
52
|
-
* Add a rotate end event handler
|
|
53
|
-
* @param handler - Event handler function
|
|
54
|
-
* @returns Component for chaining
|
|
55
|
-
*/
|
|
56
|
-
onRotateEnd: (handler: (event: RotateEvent) => void) => RotateGestureComponent;
|
|
57
|
-
/**
|
|
58
|
-
* Remove a rotate event handler
|
|
59
|
-
* @param handler - Event handler function
|
|
60
|
-
* @returns Component for chaining
|
|
61
|
-
*/
|
|
62
|
-
offRotate: (handler: (event: RotateEvent) => void) => RotateGestureComponent;
|
|
63
|
-
/**
|
|
64
|
-
* Remove a rotate start event handler
|
|
65
|
-
* @param handler - Event handler function
|
|
66
|
-
* @returns Component for chaining
|
|
67
|
-
*/
|
|
68
|
-
offRotateStart: (handler: (event: RotateEvent) => void) => RotateGestureComponent;
|
|
69
|
-
/**
|
|
70
|
-
* Remove a rotate end event handler
|
|
71
|
-
* @param handler - Event handler function
|
|
72
|
-
* @returns Component for chaining
|
|
73
|
-
*/
|
|
74
|
-
offRotateEnd: (handler: (event: RotateEvent) => void) => RotateGestureComponent;
|
|
75
|
-
/**
|
|
76
|
-
* Enable rotate recognition
|
|
77
|
-
* @returns Component for chaining
|
|
78
|
-
*/
|
|
79
|
-
enableRotate: () => RotateGestureComponent;
|
|
80
|
-
/**
|
|
81
|
-
* Disable rotate recognition
|
|
82
|
-
* @returns Component for chaining
|
|
83
|
-
*/
|
|
84
|
-
disableRotate: () => RotateGestureComponent;
|
|
85
|
-
/**
|
|
86
|
-
* Check if rotate gestures are supported on the current device
|
|
87
|
-
* @returns Whether rotate gestures are supported
|
|
88
|
-
*/
|
|
89
|
-
isRotateSupported: () => boolean;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Adds rotate gesture recognition to a component.
|
|
93
|
-
* This is a lightweight alternative to the full gesture system,
|
|
94
|
-
* focused only on rotate detection.
|
|
95
|
-
*
|
|
96
|
-
* @param config - Configuration object containing rotate settings
|
|
97
|
-
* @returns Function that enhances a component with rotate capabilities
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```ts
|
|
101
|
-
* // Add rotate gesture recognition to a component
|
|
102
|
-
* const component = pipe(
|
|
103
|
-
* createBase,
|
|
104
|
-
* withElement(...),
|
|
105
|
-
* withRotateGesture({
|
|
106
|
-
* onRotate: (e) => updateRotation(e.rotation)
|
|
107
|
-
* })
|
|
108
|
-
* )(config);
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
export declare const withRotateGesture: (config?: RotateGestureConfig) => <C extends ElementComponent>(component: C) => C & RotateGestureComponent;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module core/compose/features/gestures
|
|
3
|
-
* @description Adds swipe gesture recognition to components
|
|
4
|
-
*/
|
|
5
|
-
import { BaseComponent, ElementComponent } from "../../component";
|
|
6
|
-
import { SwipeEvent, GestureHandler } from "../../../gestures";
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for swipe gesture feature
|
|
9
|
-
*/
|
|
10
|
-
export interface SwipeGestureConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Minimum distance (in pixels) to recognize a swipe
|
|
13
|
-
* @default 30
|
|
14
|
-
*/
|
|
15
|
-
swipeThreshold?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Maximum time (in ms) in which a swipe must be completed
|
|
18
|
-
* @default 300
|
|
19
|
-
*/
|
|
20
|
-
swipeTimeThreshold?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to prevent default behaviors on touch events
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
preventDefault?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Handler for any swipe direction
|
|
28
|
-
*/
|
|
29
|
-
onSwipe?: GestureHandler;
|
|
30
|
-
/**
|
|
31
|
-
* Handler specifically for left swipes
|
|
32
|
-
*/
|
|
33
|
-
onSwipeLeft?: GestureHandler;
|
|
34
|
-
/**
|
|
35
|
-
* Handler specifically for right swipes
|
|
36
|
-
*/
|
|
37
|
-
onSwipeRight?: GestureHandler;
|
|
38
|
-
/**
|
|
39
|
-
* Handler specifically for up swipes
|
|
40
|
-
*/
|
|
41
|
-
onSwipeUp?: GestureHandler;
|
|
42
|
-
/**
|
|
43
|
-
* Handler specifically for down swipes
|
|
44
|
-
*/
|
|
45
|
-
onSwipeDown?: GestureHandler;
|
|
46
|
-
/**
|
|
47
|
-
* Whether to enable swipe recognition immediately
|
|
48
|
-
* @default true
|
|
49
|
-
*/
|
|
50
|
-
enabled?: boolean;
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Component with swipe gesture recognition capabilities
|
|
55
|
-
*/
|
|
56
|
-
export interface SwipeGestureComponent extends BaseComponent {
|
|
57
|
-
/**
|
|
58
|
-
* Add a handler for any swipe direction
|
|
59
|
-
* @param handler - Event handler function
|
|
60
|
-
* @returns Component for chaining
|
|
61
|
-
*/
|
|
62
|
-
onSwipe: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
63
|
-
/**
|
|
64
|
-
* Add a handler specifically for left swipes
|
|
65
|
-
* @param handler - Event handler function
|
|
66
|
-
* @returns Component for chaining
|
|
67
|
-
*/
|
|
68
|
-
onSwipeLeft: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
69
|
-
/**
|
|
70
|
-
* Add a handler specifically for right swipes
|
|
71
|
-
* @param handler - Event handler function
|
|
72
|
-
* @returns Component for chaining
|
|
73
|
-
*/
|
|
74
|
-
onSwipeRight: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
75
|
-
/**
|
|
76
|
-
* Add a handler specifically for up swipes
|
|
77
|
-
* @param handler - Event handler function
|
|
78
|
-
* @returns Component for chaining
|
|
79
|
-
*/
|
|
80
|
-
onSwipeUp: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
81
|
-
/**
|
|
82
|
-
* Add a handler specifically for down swipes
|
|
83
|
-
* @param handler - Event handler function
|
|
84
|
-
* @returns Component for chaining
|
|
85
|
-
*/
|
|
86
|
-
onSwipeDown: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
87
|
-
/**
|
|
88
|
-
* Remove a swipe event handler for any direction
|
|
89
|
-
* @param handler - Event handler function
|
|
90
|
-
* @returns Component for chaining
|
|
91
|
-
*/
|
|
92
|
-
offSwipe: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
93
|
-
/**
|
|
94
|
-
* Remove a left swipe event handler
|
|
95
|
-
* @param handler - Event handler function
|
|
96
|
-
* @returns Component for chaining
|
|
97
|
-
*/
|
|
98
|
-
offSwipeLeft: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
99
|
-
/**
|
|
100
|
-
* Remove a right swipe event handler
|
|
101
|
-
* @param handler - Event handler function
|
|
102
|
-
* @returns Component for chaining
|
|
103
|
-
*/
|
|
104
|
-
offSwipeRight: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
105
|
-
/**
|
|
106
|
-
* Remove an up swipe event handler
|
|
107
|
-
* @param handler - Event handler function
|
|
108
|
-
* @returns Component for chaining
|
|
109
|
-
*/
|
|
110
|
-
offSwipeUp: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
111
|
-
/**
|
|
112
|
-
* Remove a down swipe event handler
|
|
113
|
-
* @param handler - Event handler function
|
|
114
|
-
* @returns Component for chaining
|
|
115
|
-
*/
|
|
116
|
-
offSwipeDown: (handler: (event: SwipeEvent) => void) => SwipeGestureComponent;
|
|
117
|
-
/**
|
|
118
|
-
* Enable swipe recognition
|
|
119
|
-
* @returns Component for chaining
|
|
120
|
-
*/
|
|
121
|
-
enableSwipe: () => SwipeGestureComponent;
|
|
122
|
-
/**
|
|
123
|
-
* Disable swipe recognition
|
|
124
|
-
* @returns Component for chaining
|
|
125
|
-
*/
|
|
126
|
-
disableSwipe: () => SwipeGestureComponent;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Adds swipe gesture recognition to a component.
|
|
130
|
-
* This is a lightweight alternative to the full gesture system,
|
|
131
|
-
* focused only on swipe detection.
|
|
132
|
-
*
|
|
133
|
-
* @param config - Configuration object containing swipe settings
|
|
134
|
-
* @returns Function that enhances a component with swipe capabilities
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```ts
|
|
138
|
-
* // Add swipe gesture recognition to a component
|
|
139
|
-
* const component = pipe(
|
|
140
|
-
* createBase,
|
|
141
|
-
* withElement(...),
|
|
142
|
-
* withSwipeGesture({
|
|
143
|
-
* onSwipeLeft: () => showNextPage(),
|
|
144
|
-
* onSwipeRight: () => showPreviousPage()
|
|
145
|
-
* })
|
|
146
|
-
* )(config);
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
149
|
-
export declare const withSwipeGesture: (config?: SwipeGestureConfig) => <C extends ElementComponent>(component: C) => C & SwipeGestureComponent;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module core/compose/features/gestures
|
|
3
|
-
* @description Adds tap gesture recognition to components
|
|
4
|
-
*/
|
|
5
|
-
import { BaseComponent, ElementComponent } from "../../component";
|
|
6
|
-
import { TapEvent, GestureHandler } from "../../../gestures";
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for tap gesture feature
|
|
9
|
-
*/
|
|
10
|
-
export interface TapGestureConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Distance threshold (in pixels) for tap recognition
|
|
13
|
-
* @default 10
|
|
14
|
-
*/
|
|
15
|
-
tapDistanceThreshold?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to prevent default behaviors on touch events
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
preventDefault?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Handler for tap gesture
|
|
23
|
-
*/
|
|
24
|
-
onTap?: GestureHandler;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to enable tap recognition immediately
|
|
27
|
-
* @default true
|
|
28
|
-
*/
|
|
29
|
-
enabled?: boolean;
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Component with tap gesture recognition capabilities
|
|
34
|
-
*/
|
|
35
|
-
export interface TapGestureComponent extends BaseComponent {
|
|
36
|
-
/**
|
|
37
|
-
* Add a tap event handler
|
|
38
|
-
* @param handler - Event handler function
|
|
39
|
-
* @returns Component for chaining
|
|
40
|
-
*/
|
|
41
|
-
onTap: (handler: (event: TapEvent) => void) => TapGestureComponent;
|
|
42
|
-
/**
|
|
43
|
-
* Remove a tap event handler
|
|
44
|
-
* @param handler - Event handler function
|
|
45
|
-
* @returns Component for chaining
|
|
46
|
-
*/
|
|
47
|
-
offTap: (handler: (event: TapEvent) => void) => TapGestureComponent;
|
|
48
|
-
/**
|
|
49
|
-
* Enable tap recognition
|
|
50
|
-
* @returns Component for chaining
|
|
51
|
-
*/
|
|
52
|
-
enableTap: () => TapGestureComponent;
|
|
53
|
-
/**
|
|
54
|
-
* Disable tap recognition
|
|
55
|
-
* @returns Component for chaining
|
|
56
|
-
*/
|
|
57
|
-
disableTap: () => TapGestureComponent;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Adds tap gesture recognition to a component.
|
|
61
|
-
* This is a lightweight alternative to the full gesture system,
|
|
62
|
-
* focused only on tap detection.
|
|
63
|
-
*
|
|
64
|
-
* @param config - Configuration object containing tap settings
|
|
65
|
-
* @returns Function that enhances a component with tap capabilities
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* // Add tap gesture recognition to a component
|
|
70
|
-
* const component = pipe(
|
|
71
|
-
* createBase,
|
|
72
|
-
* withElement(...),
|
|
73
|
-
* withTapGesture({
|
|
74
|
-
* onTap: (e) => console.log('Tapped at', e.x, e.y)
|
|
75
|
-
* })
|
|
76
|
-
* )(config);
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
export declare const withTapGesture: (config?: TapGestureConfig) => <C extends ElementComponent>(component: C) => C & TapGestureComponent;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module core/compose/features
|
|
3
|
-
* @description Adds gesture recognition capabilities to components
|
|
4
|
-
*/
|
|
5
|
-
import { BaseComponent, ElementComponent } from "../component";
|
|
6
|
-
import { GestureManager, GestureConfig, GestureHandler } from "../../gestures";
|
|
7
|
-
/**
|
|
8
|
-
* Configuration for gestures feature
|
|
9
|
-
*/
|
|
10
|
-
export interface GesturesFeatureConfig extends GestureConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Whether to enable gesture recognition immediately
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
enableGestures?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Initial gesture event handlers
|
|
18
|
-
*/
|
|
19
|
-
gestureHandlers?: Record<string, GestureHandler>;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Component with gesture recognition capabilities
|
|
24
|
-
*/
|
|
25
|
-
export interface GesturesComponent extends BaseComponent {
|
|
26
|
-
/**
|
|
27
|
-
* Gesture manager instance
|
|
28
|
-
*/
|
|
29
|
-
gestures: GestureManager;
|
|
30
|
-
/**
|
|
31
|
-
* Add a gesture event handler
|
|
32
|
-
* @param eventType - Type of gesture event
|
|
33
|
-
* @param handler - Event handler function
|
|
34
|
-
* @returns GesturesComponent for chaining
|
|
35
|
-
*/
|
|
36
|
-
onGesture: (eventType: string, handler: GestureHandler) => GesturesComponent;
|
|
37
|
-
/**
|
|
38
|
-
* Remove a gesture event handler
|
|
39
|
-
* @param eventType - Type of gesture event
|
|
40
|
-
* @param handler - Event handler function
|
|
41
|
-
* @returns GesturesComponent for chaining
|
|
42
|
-
*/
|
|
43
|
-
offGesture: (eventType: string, handler: GestureHandler) => GesturesComponent;
|
|
44
|
-
/**
|
|
45
|
-
* Check if a gesture type is supported on the current device
|
|
46
|
-
* @param gestureType - Type of gesture to check
|
|
47
|
-
* @returns Whether the gesture is supported
|
|
48
|
-
*/
|
|
49
|
-
isGestureSupported: (gestureType: string) => boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Enable gesture recognition
|
|
52
|
-
* @returns GesturesComponent for chaining
|
|
53
|
-
*/
|
|
54
|
-
enableGestures: () => GesturesComponent;
|
|
55
|
-
/**
|
|
56
|
-
* Disable gesture recognition
|
|
57
|
-
* @returns GesturesComponent for chaining
|
|
58
|
-
*/
|
|
59
|
-
disableGestures: () => GesturesComponent;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Adds gesture recognition capabilities to a component.
|
|
63
|
-
* This is a comprehensive gesture feature that adds support for all gesture types.
|
|
64
|
-
* For more lightweight, specific gestures, use the individual gesture features.
|
|
65
|
-
*
|
|
66
|
-
* @param config - Configuration object containing gesture settings
|
|
67
|
-
* @returns Function that enhances a component with gesture capabilities
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```ts
|
|
71
|
-
* // Add gesture recognition to a component
|
|
72
|
-
* const component = pipe(
|
|
73
|
-
* createBase,
|
|
74
|
-
* withElement(...),
|
|
75
|
-
* withGestures({
|
|
76
|
-
* swipeThreshold: 50,
|
|
77
|
-
* gestureHandlers: {
|
|
78
|
-
* 'tap': (e) => handleTap(e),
|
|
79
|
-
* 'swipeleft': (e) => navigateForward(e),
|
|
80
|
-
* 'swiperight': (e) => navigateBack(e)
|
|
81
|
-
* }
|
|
82
|
-
* })
|
|
83
|
-
* )(config);
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
export declare const withGestures: (config?: GesturesFeatureConfig) => <C extends ElementComponent>(component: C) => C & GesturesComponent;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates DOM elements from component schema using the core createLayout utility
|
|
3
|
-
* This is a key feature that bridges the gap between declarative schema and actual DOM
|
|
4
|
-
*
|
|
5
|
-
* @returns Component enhancer that creates DOM structure from schema
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* // Materialize component schema into DOM
|
|
10
|
-
* const component = pipe(
|
|
11
|
-
* createBase,
|
|
12
|
-
* withLayout(config),
|
|
13
|
-
* withIcon(config),
|
|
14
|
-
* withLabel(config),
|
|
15
|
-
* withDom()
|
|
16
|
-
* )(config);
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare const withDom: () => (component: any) => any;
|