mtrl-addons 0.2.1 → 0.2.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/{src/components/index.ts → dist/components/index.d.ts} +0 -2
- package/dist/components/vlist/config.d.ts +86 -0
- package/{src/components/vlist/constants.ts → dist/components/vlist/constants.d.ts} +10 -11
- package/dist/components/vlist/features/api.d.ts +7 -0
- package/{src/components/vlist/features/index.ts → dist/components/vlist/features/index.d.ts} +0 -2
- package/dist/components/vlist/features/selection.d.ts +6 -0
- package/dist/components/vlist/features/viewport.d.ts +9 -0
- package/dist/components/vlist/features.d.ts +31 -0
- package/{src/components/vlist/index.ts → dist/components/vlist/index.d.ts} +1 -9
- package/dist/components/vlist/types.d.ts +596 -0
- package/dist/components/vlist/vlist.d.ts +29 -0
- package/dist/core/compose/features/gestures/index.d.ts +86 -0
- package/dist/core/compose/features/gestures/longpress.d.ts +85 -0
- package/dist/core/compose/features/gestures/pan.d.ts +108 -0
- package/dist/core/compose/features/gestures/pinch.d.ts +111 -0
- package/dist/core/compose/features/gestures/rotate.d.ts +111 -0
- package/dist/core/compose/features/gestures/swipe.d.ts +149 -0
- package/dist/core/compose/features/gestures/tap.d.ts +79 -0
- package/{src/core/compose/features/index.ts → dist/core/compose/features/index.d.ts} +1 -2
- package/{src/core/compose/index.ts → dist/core/compose/index.d.ts} +2 -11
- package/{src/core/gestures/index.ts → dist/core/gestures/index.d.ts} +1 -20
- package/dist/core/gestures/longpress.d.ts +23 -0
- package/dist/core/gestures/manager.d.ts +14 -0
- package/dist/core/gestures/pan.d.ts +12 -0
- package/dist/core/gestures/pinch.d.ts +14 -0
- package/dist/core/gestures/rotate.d.ts +14 -0
- package/dist/core/gestures/swipe.d.ts +20 -0
- package/dist/core/gestures/tap.d.ts +12 -0
- package/dist/core/gestures/types.d.ts +320 -0
- package/dist/core/gestures/utils.d.ts +57 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/layout/config.d.ts +33 -0
- package/dist/core/layout/index.d.ts +51 -0
- package/dist/core/layout/jsx.d.ts +65 -0
- package/dist/core/layout/schema.d.ts +112 -0
- package/dist/core/layout/types.d.ts +69 -0
- package/dist/core/viewport/constants.d.ts +105 -0
- package/dist/core/viewport/features/base.d.ts +14 -0
- package/dist/core/viewport/features/collection.d.ts +41 -0
- package/dist/core/viewport/features/events.d.ts +13 -0
- package/{src/core/viewport/features/index.ts → dist/core/viewport/features/index.d.ts} +0 -7
- package/dist/core/viewport/features/item-size.d.ts +30 -0
- package/dist/core/viewport/features/loading.d.ts +34 -0
- package/dist/core/viewport/features/momentum.d.ts +17 -0
- package/dist/core/viewport/features/performance.d.ts +53 -0
- package/dist/core/viewport/features/placeholders.d.ts +38 -0
- package/dist/core/viewport/features/rendering.d.ts +16 -0
- package/dist/core/viewport/features/scrollbar.d.ts +26 -0
- package/dist/core/viewport/features/scrolling.d.ts +16 -0
- package/dist/core/viewport/features/utils.d.ts +43 -0
- package/dist/core/viewport/features/virtual.d.ts +18 -0
- package/{src/core/viewport/index.ts → dist/core/viewport/index.d.ts} +1 -17
- package/dist/core/viewport/types.d.ts +96 -0
- package/dist/core/viewport/utils/speed-tracker.d.ts +22 -0
- package/dist/core/viewport/viewport.d.ts +11 -0
- package/{src/index.ts → dist/index.d.ts} +0 -4
- package/dist/index.js +5143 -0
- package/dist/index.mjs +5111 -0
- package/dist/styles.css +254 -0
- package/dist/styles.css.map +1 -0
- package/package.json +6 -1
- package/src/styles/components/_vlist.scss +234 -213
- package/.cursorrules +0 -117
- package/AI.md +0 -241
- package/build.js +0 -201
- package/scripts/analyze-orphaned-functions.ts +0 -387
- package/scripts/debug/vlist-selection.ts +0 -121
- package/src/components/vlist/config.ts +0 -323
- package/src/components/vlist/features/api.ts +0 -322
- package/src/components/vlist/features/selection.ts +0 -444
- package/src/components/vlist/features/viewport.ts +0 -65
- package/src/components/vlist/features.ts +0 -112
- package/src/components/vlist/types.ts +0 -591
- package/src/components/vlist/vlist.ts +0 -92
- package/src/core/compose/features/gestures/index.ts +0 -227
- package/src/core/compose/features/gestures/longpress.ts +0 -383
- package/src/core/compose/features/gestures/pan.ts +0 -424
- package/src/core/compose/features/gestures/pinch.ts +0 -475
- package/src/core/compose/features/gestures/rotate.ts +0 -485
- package/src/core/compose/features/gestures/swipe.ts +0 -492
- package/src/core/compose/features/gestures/tap.ts +0 -334
- package/src/core/gestures/longpress.ts +0 -68
- package/src/core/gestures/manager.ts +0 -418
- package/src/core/gestures/pan.ts +0 -48
- package/src/core/gestures/pinch.ts +0 -58
- package/src/core/gestures/rotate.ts +0 -58
- package/src/core/gestures/swipe.ts +0 -66
- package/src/core/gestures/tap.ts +0 -45
- package/src/core/gestures/types.ts +0 -387
- package/src/core/gestures/utils.ts +0 -128
- package/src/core/index.ts +0 -43
- package/src/core/layout/config.ts +0 -102
- package/src/core/layout/index.ts +0 -168
- package/src/core/layout/jsx.ts +0 -174
- package/src/core/layout/schema.ts +0 -1001
- package/src/core/layout/types.ts +0 -95
- package/src/core/viewport/constants.ts +0 -140
- package/src/core/viewport/features/base.ts +0 -73
- package/src/core/viewport/features/collection.ts +0 -882
- package/src/core/viewport/features/events.ts +0 -130
- package/src/core/viewport/features/item-size.ts +0 -271
- package/src/core/viewport/features/loading.ts +0 -263
- package/src/core/viewport/features/momentum.ts +0 -260
- package/src/core/viewport/features/performance.ts +0 -161
- package/src/core/viewport/features/placeholders.ts +0 -335
- package/src/core/viewport/features/rendering.ts +0 -568
- package/src/core/viewport/features/scrollbar.ts +0 -434
- package/src/core/viewport/features/scrolling.ts +0 -618
- package/src/core/viewport/features/utils.ts +0 -88
- package/src/core/viewport/features/virtual.ts +0 -384
- package/src/core/viewport/types.ts +0 -133
- package/src/core/viewport/utils/speed-tracker.ts +0 -79
- package/src/core/viewport/viewport.ts +0 -246
- package/test/benchmarks/layout/advanced.test.ts +0 -656
- package/test/benchmarks/layout/comparison.test.ts +0 -519
- package/test/benchmarks/layout/performance-comparison.test.ts +0 -274
- package/test/benchmarks/layout/real-components.test.ts +0 -733
- package/test/benchmarks/layout/simple.test.ts +0 -321
- package/test/benchmarks/layout/stress.test.ts +0 -990
- package/test/collection/basic.test.ts +0 -304
- package/test/components/vlist-selection.test.ts +0 -240
- package/test/components/vlist.test.ts +0 -63
- package/test/core/collection/adapter.test.ts +0 -161
- package/test/core/collection/collection.test.ts +0 -394
- package/test/core/layout/layout.test.ts +0 -201
- package/test/utils/dom-helpers.ts +0 -275
- package/test/utils/performance-helpers.ts +0 -392
- package/tsconfig.json +0 -20
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mtrl-addons List Component Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration utilities and defaults for the list component.
|
|
5
|
+
* Follows mtrl patterns for component configuration.
|
|
6
|
+
*/
|
|
7
|
+
import type { ListConfig, ListItem } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Default configuration for the mtrl-addons List component
|
|
10
|
+
*/
|
|
11
|
+
export declare const defaultConfig: Partial<ListConfig>;
|
|
12
|
+
export declare function createBaseConfig<T extends ListItem = ListItem>(config?: ListConfig<T>): Required<ListConfig<T>>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates element configuration for withElement
|
|
15
|
+
* @param {ListConfig} config - List configuration
|
|
16
|
+
* @returns {Object} Element configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare function getElementConfig<T extends ListItem = ListItem>(config: ListConfig<T>): any;
|
|
19
|
+
/**
|
|
20
|
+
* Creates API configuration for the List component
|
|
21
|
+
* @param {Object} component - Component with list functionality
|
|
22
|
+
* @returns {Object} API configuration object for withApi
|
|
23
|
+
*/
|
|
24
|
+
export declare function getApiConfig<T extends ListItem = ListItem>(component: any): {
|
|
25
|
+
data: {
|
|
26
|
+
add: any;
|
|
27
|
+
update: any;
|
|
28
|
+
remove: any;
|
|
29
|
+
clear: any;
|
|
30
|
+
refresh: any;
|
|
31
|
+
getItems: any;
|
|
32
|
+
getItem: any;
|
|
33
|
+
query: any;
|
|
34
|
+
sort: any;
|
|
35
|
+
getSize: any;
|
|
36
|
+
isEmpty: any;
|
|
37
|
+
isLoading: any;
|
|
38
|
+
getError: any;
|
|
39
|
+
};
|
|
40
|
+
selection: {
|
|
41
|
+
selectItem: any;
|
|
42
|
+
deselectItem: any;
|
|
43
|
+
selectAll: any;
|
|
44
|
+
deselectAll: any;
|
|
45
|
+
getSelectedItems: any;
|
|
46
|
+
getSelectedIds: any;
|
|
47
|
+
} | undefined;
|
|
48
|
+
scrolling: {
|
|
49
|
+
scrollToItem: any;
|
|
50
|
+
scrollToIndex: any;
|
|
51
|
+
scrollToPage: any;
|
|
52
|
+
};
|
|
53
|
+
performance: {
|
|
54
|
+
getMetrics: any;
|
|
55
|
+
resetMetrics: any;
|
|
56
|
+
};
|
|
57
|
+
template: {
|
|
58
|
+
setTemplate: any;
|
|
59
|
+
getTemplate: any;
|
|
60
|
+
};
|
|
61
|
+
events: {
|
|
62
|
+
on: any;
|
|
63
|
+
off: any;
|
|
64
|
+
emit: any;
|
|
65
|
+
subscribe: any;
|
|
66
|
+
};
|
|
67
|
+
lifecycle: {
|
|
68
|
+
destroy: any;
|
|
69
|
+
};
|
|
70
|
+
config: {
|
|
71
|
+
selection: any;
|
|
72
|
+
scroll: any;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Validates list configuration
|
|
77
|
+
*/
|
|
78
|
+
export declare const validateConfig: (config: ListConfig) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Creates Collection configuration from List config
|
|
81
|
+
*/
|
|
82
|
+
export declare const getCollectionConfig: (config: ListConfig) => {
|
|
83
|
+
adapter: import("./types").ListAdapter<ListItem> | undefined;
|
|
84
|
+
items: ListItem[] | undefined;
|
|
85
|
+
cache: any;
|
|
86
|
+
};
|
|
@@ -5,19 +5,18 @@
|
|
|
5
5
|
* Note: Base mtrl list functionality is handled by mtrl core.
|
|
6
6
|
* These constants are for addons-specific features only.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* CSS class names for VList component
|
|
11
10
|
* Following BEM convention: component__element--modifier
|
|
12
11
|
* Note: mtrl prefix is added automatically by core DOM classes system
|
|
13
12
|
*/
|
|
14
|
-
export const VLIST_CLASSES
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
13
|
+
export declare const VLIST_CLASSES: {
|
|
14
|
+
/** List element */
|
|
15
|
+
readonly LIST: "vlist";
|
|
16
|
+
/** List item */
|
|
17
|
+
readonly ITEM: "viewport-item";
|
|
18
|
+
/** Selected list item */
|
|
19
|
+
readonly SELECTED: "viewport-item--selected";
|
|
20
|
+
/** Empty state */
|
|
21
|
+
readonly EMPTY: "vlist--empty";
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API feature for VList
|
|
3
|
+
* Provides a clean public API for the VList component
|
|
4
|
+
*/
|
|
5
|
+
import type { VListConfig, VListItem } from "../types";
|
|
6
|
+
export type { RemoveItemOptions } from "../types";
|
|
7
|
+
export declare const withAPI: <T extends VListItem = VListItem>(config: VListConfig<T>) => (component: any) => any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VListConfig, VListComponent, VListItem } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Adds selection management capabilities to VList component
|
|
4
|
+
*/
|
|
5
|
+
export declare const withSelection: <T extends VListItem = VListItem>(config: VListConfig<T>) => (component: VListComponent<T>) => VListComponent<T>;
|
|
6
|
+
export default withSelection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewport feature for VList
|
|
3
|
+
* Integrates the core viewport functionality with VList component
|
|
4
|
+
*/
|
|
5
|
+
import type { VListConfig, VListItem } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* Adds viewport functionality to VList
|
|
8
|
+
*/
|
|
9
|
+
export declare const withViewport: <T extends VListItem = VListItem>(config: VListConfig<T>) => (component: any) => any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List component features
|
|
3
|
+
*
|
|
4
|
+
* Modular features that can be composed with the list component.
|
|
5
|
+
* Following mtrl's functional composition pattern.
|
|
6
|
+
*/
|
|
7
|
+
import type { ListComponent, ListItem } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Virtual scrolling feature (future implementation)
|
|
10
|
+
* This will provide window-based virtual scrolling for massive datasets
|
|
11
|
+
*/
|
|
12
|
+
export declare function withVirtualScroll<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Enhanced list selection feature (future implementation)
|
|
15
|
+
* This will provide advanced selection patterns
|
|
16
|
+
*/
|
|
17
|
+
export declare function withListSelection<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Advanced list styling feature (future implementation)
|
|
20
|
+
* This will provide theme integration and advanced styling
|
|
21
|
+
*/
|
|
22
|
+
export declare function withListStyling<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Performance optimization feature (future implementation)
|
|
25
|
+
* This will provide advanced performance monitoring and optimization
|
|
26
|
+
*/
|
|
27
|
+
export declare function withListPerformance<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Re-export the internal composition functions for advanced usage
|
|
30
|
+
* These are the actual working implementations used in createList
|
|
31
|
+
*/
|
|
@@ -4,13 +4,5 @@
|
|
|
4
4
|
* A high-performance virtual list component that uses the viewport
|
|
5
5
|
* feature directly without the list-manager layer.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
export { createVList } from "./vlist";
|
|
9
|
-
export type {
|
|
10
|
-
VListConfig,
|
|
11
|
-
VListComponent,
|
|
12
|
-
VListItem,
|
|
13
|
-
VListAPI,
|
|
14
|
-
VListState,
|
|
15
|
-
VListEvents,
|
|
16
|
-
} from "./types";
|
|
8
|
+
export type { RemoveItemOptions, VListConfig, VListComponent, VListItem, VListAPI, VListState, VListEvents, } from "./types";
|