selective-ui 1.4.0 → 1.4.1
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/selective-ui.css +0 -6
- package/dist/selective-ui.css.map +1 -1
- package/dist/selective-ui.esm.js +252 -553
- package/dist/selective-ui.esm.js.map +1 -1
- package/dist/selective-ui.esm.min.js +2 -2
- package/dist/selective-ui.esm.min.js.br +0 -0
- package/dist/selective-ui.min.css +1 -1
- package/dist/selective-ui.min.css.br +0 -0
- package/dist/selective-ui.min.js +2 -2
- package/dist/selective-ui.min.js.br +0 -0
- package/dist/selective-ui.umd.js +254 -555
- package/dist/selective-ui.umd.js.map +1 -1
- package/package.json +12 -12
- package/src/ts/adapter/mixed-adapter.ts +147 -68
- package/src/ts/components/accessorybox.ts +14 -11
- package/src/ts/components/directive.ts +1 -1
- package/src/ts/components/option-handle.ts +12 -9
- package/src/ts/components/placeholder.ts +5 -5
- package/src/ts/components/popup/empty-state.ts +5 -5
- package/src/ts/components/popup/loading-state.ts +5 -5
- package/src/ts/components/popup/popup.ts +138 -76
- package/src/ts/components/searchbox.ts +17 -13
- package/src/ts/components/selectbox.ts +242 -81
- package/src/ts/core/base/adapter.ts +39 -14
- package/src/ts/core/base/fenwick.ts +3 -2
- package/src/ts/core/base/lifecycle.ts +14 -4
- package/src/ts/core/base/model.ts +17 -15
- package/src/ts/core/base/recyclerview.ts +7 -5
- package/src/ts/core/base/view.ts +10 -5
- package/src/ts/core/base/virtual-recyclerview.ts +89 -37
- package/src/ts/core/model-manager.ts +48 -21
- package/src/ts/core/search-controller.ts +174 -56
- package/src/ts/global.ts +5 -8
- package/src/ts/index.ts +2 -2
- package/src/ts/models/group-model.ts +33 -8
- package/src/ts/models/option-model.ts +60 -19
- package/src/ts/services/dataset-observer.ts +6 -3
- package/src/ts/services/ea-observer.ts +1 -1
- package/src/ts/services/effector.ts +22 -12
- package/src/ts/services/refresher.ts +7 -3
- package/src/ts/services/resize-observer.ts +24 -11
- package/src/ts/services/select-observer.ts +2 -2
- package/src/ts/types/components/popup.type.ts +18 -1
- package/src/ts/types/components/searchbox.type.ts +43 -30
- package/src/ts/types/components/state.box.type.ts +1 -1
- package/src/ts/types/core/base/adapter.type.ts +13 -5
- package/src/ts/types/core/base/lifecycle.type.ts +1 -2
- package/src/ts/types/core/base/model.type.ts +3 -3
- package/src/ts/types/core/base/recyclerview.type.ts +7 -5
- package/src/ts/types/core/base/view.type.ts +6 -6
- package/src/ts/types/core/base/virtual-recyclerview.type.ts +45 -46
- package/src/ts/types/core/search-controller.type.ts +18 -2
- package/src/ts/types/css.d.ts +1 -0
- package/src/ts/types/plugins/plugin.type.ts +2 -2
- package/src/ts/types/services/effector.type.ts +25 -25
- package/src/ts/types/services/resize-observer.type.ts +23 -12
- package/src/ts/types/utils/callback-scheduler.type.ts +2 -2
- package/src/ts/types/utils/ievents.type.ts +1 -1
- package/src/ts/types/utils/istorage.type.ts +62 -60
- package/src/ts/types/utils/libs.type.ts +19 -17
- package/src/ts/types/utils/selective.type.ts +6 -3
- package/src/ts/types/views/view.group.type.ts +9 -5
- package/src/ts/types/views/view.option.type.ts +39 -17
- package/src/ts/utils/callback-scheduler.ts +12 -7
- package/src/ts/utils/ievents.ts +12 -5
- package/src/ts/utils/istorage.ts +5 -3
- package/src/ts/utils/libs.ts +122 -43
- package/src/ts/utils/selective.ts +15 -8
- package/src/ts/views/group-view.ts +11 -9
- package/src/ts/views/option-view.ts +37 -18
|
@@ -14,8 +14,8 @@ import { OptionModel } from "src/ts/models/option-model";
|
|
|
14
14
|
* Represents the DOM elements used in the SearchBox component.
|
|
15
15
|
*/
|
|
16
16
|
export type SearchBoxTags = {
|
|
17
|
-
SearchBox: HTMLDivElement;
|
|
18
|
-
SearchInput: HTMLInputElement;
|
|
17
|
+
SearchBox: HTMLDivElement; // Container for the search box
|
|
18
|
+
SearchInput: HTMLInputElement; // Input field for search queries
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -35,7 +35,7 @@ export type NavigateHandler = (direction: 1 | -1) => void;
|
|
|
35
35
|
* Represents the DOM elements used in the SelectBox component.
|
|
36
36
|
*/
|
|
37
37
|
export type SelectBoxTags = {
|
|
38
|
-
ViewPanel: HTMLDivElement;
|
|
38
|
+
ViewPanel: HTMLDivElement; // Panel that displays selectable options
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -43,46 +43,46 @@ export type SelectBoxTags = {
|
|
|
43
43
|
* Combines mounted view result with additional services and components.
|
|
44
44
|
*/
|
|
45
45
|
export type ContainerRuntime = MountViewResult<SelectBoxTags> & {
|
|
46
|
-
placeholder: PlaceHolder;
|
|
47
|
-
directive: Directive;
|
|
48
|
-
searchbox: SearchBox;
|
|
49
|
-
popup: Popup;
|
|
50
|
-
effector: EffectorInterface;
|
|
51
|
-
targetElement: HTMLSelectElement;
|
|
52
|
-
accessorybox: AccessoryBox;
|
|
46
|
+
placeholder: PlaceHolder; // Placeholder manager
|
|
47
|
+
directive: Directive; // Directive handler for dynamic behavior
|
|
48
|
+
searchbox: SearchBox; // Search box component
|
|
49
|
+
popup: Popup; // Popup component for dropdown
|
|
50
|
+
effector: EffectorInterface; // Effector for state management
|
|
51
|
+
targetElement: HTMLSelectElement; // Original select element
|
|
52
|
+
accessorybox: AccessoryBox; // Accessory box for extra UI elements
|
|
53
53
|
searchController: SearchController; // Controller for search logic
|
|
54
|
-
selectObserver: SelectObserver;
|
|
55
|
-
datasetObserver: DatasetObserver;
|
|
54
|
+
selectObserver: SelectObserver; // Observer for selection changes
|
|
55
|
+
datasetObserver: DatasetObserver; // Observer for dataset updates
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Interface defining actions and properties for the SelectBox component.
|
|
60
60
|
*/
|
|
61
61
|
export interface SelectBoxAction {
|
|
62
|
-
targetElement: HTMLSelectElement;
|
|
62
|
+
targetElement: HTMLSelectElement; // Target Select element
|
|
63
63
|
|
|
64
|
-
placeholder: string;
|
|
65
|
-
oldValue: unknown;
|
|
64
|
+
placeholder: string; // Placeholder text
|
|
65
|
+
oldValue: unknown; // Previous value before change
|
|
66
66
|
|
|
67
|
-
value: string | string[];
|
|
68
|
-
valueArray: string[];
|
|
69
|
-
valueString: string;
|
|
67
|
+
value: string | string[]; // Current selected value(s)
|
|
68
|
+
valueArray: string[]; // Selected values as an array
|
|
69
|
+
valueString: string; // Selected values as a single string
|
|
70
70
|
|
|
71
|
-
valueOptions: OptionModel[];
|
|
72
|
-
mask: string[];
|
|
73
|
-
valueText: string | string[];
|
|
71
|
+
valueOptions: OptionModel[]; // Selected option models
|
|
72
|
+
mask: string[]; // Masked values for filtering
|
|
73
|
+
valueText: string | string[]; // Display text for selected values
|
|
74
74
|
|
|
75
|
-
isOpen: boolean;
|
|
75
|
+
isOpen: boolean; // Indicates if the dropdown is open
|
|
76
76
|
|
|
77
|
-
disabled: boolean;
|
|
78
|
-
readonly: boolean;
|
|
79
|
-
visible: boolean;
|
|
77
|
+
disabled: boolean; // Indicates if the component is disabled
|
|
78
|
+
readonly: boolean; // Indicates if the component is read-only
|
|
79
|
+
visible: boolean; // Indicates if the component is visible
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Get parent of self
|
|
83
83
|
* @param evtToken - Optional event token for tracking.
|
|
84
84
|
*/
|
|
85
|
-
getParent(evtToken?: unknown): HTMLElement
|
|
85
|
+
getParent(evtToken?: unknown): HTMLElement;
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Get dataset from selected options
|
|
@@ -90,7 +90,11 @@ export interface SelectBoxAction {
|
|
|
90
90
|
* @param strDataset - Property to find
|
|
91
91
|
* @param isArray - Keep array or return once
|
|
92
92
|
*/
|
|
93
|
-
valueDataset(
|
|
93
|
+
valueDataset(
|
|
94
|
+
evtToken?: unknown,
|
|
95
|
+
strDataset?: string,
|
|
96
|
+
isArray?: boolean,
|
|
97
|
+
): any[] | string;
|
|
94
98
|
|
|
95
99
|
/**
|
|
96
100
|
* Select all available options.
|
|
@@ -113,7 +117,12 @@ export interface SelectBoxAction {
|
|
|
113
117
|
* @param trigger - Whether to trigger change events.
|
|
114
118
|
* @param force - Whether to force the update.
|
|
115
119
|
*/
|
|
116
|
-
setValue(
|
|
120
|
+
setValue(
|
|
121
|
+
evtToken?: unknown,
|
|
122
|
+
value?: unknown,
|
|
123
|
+
trigger?: boolean,
|
|
124
|
+
force?: boolean,
|
|
125
|
+
): void;
|
|
117
126
|
|
|
118
127
|
/**
|
|
119
128
|
* Load options for the SelectBox, typically from an AJAX source.
|
|
@@ -156,7 +165,11 @@ export interface SelectBoxAction {
|
|
|
156
165
|
* @param evtName - Name of the event.
|
|
157
166
|
* @param handle - Callback function for the event.
|
|
158
167
|
*/
|
|
159
|
-
on(
|
|
168
|
+
on(
|
|
169
|
+
evtToken: unknown,
|
|
170
|
+
evtName: string,
|
|
171
|
+
handle: (...args: any[]) => any,
|
|
172
|
+
): void;
|
|
160
173
|
|
|
161
174
|
/**
|
|
162
175
|
* Perform an AJAX request.
|
|
@@ -170,4 +183,4 @@ export interface SelectBoxAction {
|
|
|
170
183
|
* @param evtToken - Event token for tracking.
|
|
171
184
|
*/
|
|
172
185
|
loadAjax(evtToken: unknown, obj: unknown): void;
|
|
173
|
-
}
|
|
186
|
+
}
|
|
@@ -6,7 +6,9 @@ import type { ModelContract } from "./model.type";
|
|
|
6
6
|
*
|
|
7
7
|
* @template TItem - A model type that implements ModelContract.
|
|
8
8
|
*/
|
|
9
|
-
export interface AdapterContract<
|
|
9
|
+
export interface AdapterContract<
|
|
10
|
+
TItem extends ModelContract<any, any>,
|
|
11
|
+
> extends Lifecycle {
|
|
10
12
|
/**
|
|
11
13
|
* List of items managed by the adapter.
|
|
12
14
|
* These items are rendered or updated in the associated container.
|
|
@@ -64,7 +66,7 @@ export interface AdapterContract<TItem extends ModelContract<any, any>> extends
|
|
|
64
66
|
* @param item - The item for which the viewer is being created.
|
|
65
67
|
* @returns An adapter-specific viewer instance.
|
|
66
68
|
*/
|
|
67
|
-
viewHolder(parent: HTMLElement, item: TItem): unknown;
|
|
69
|
+
viewHolder?(parent: HTMLElement, item: TItem): unknown;
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
* Bind an item to its viewer at a given position.
|
|
@@ -83,7 +85,10 @@ export interface AdapterContract<TItem extends ModelContract<any, any>> extends
|
|
|
83
85
|
* @param propName - The name of the property being changed.
|
|
84
86
|
* @param callback - The handler invoked with change context/args.
|
|
85
87
|
*/
|
|
86
|
-
onPropChanging(
|
|
88
|
+
onPropChanging(
|
|
89
|
+
propName: string,
|
|
90
|
+
callback: (...args: unknown[]) => void,
|
|
91
|
+
): void;
|
|
87
92
|
|
|
88
93
|
/**
|
|
89
94
|
* Register a post-change callback for a given property.
|
|
@@ -92,7 +97,10 @@ export interface AdapterContract<TItem extends ModelContract<any, any>> extends
|
|
|
92
97
|
* @param propName - The name of the property that changed.
|
|
93
98
|
* @param callback - The handler invoked with change context/args.
|
|
94
99
|
*/
|
|
95
|
-
onPropChanged(
|
|
100
|
+
onPropChanged(
|
|
101
|
+
propName: string,
|
|
102
|
+
callback: (...args: unknown[]) => void,
|
|
103
|
+
): void;
|
|
96
104
|
|
|
97
105
|
/**
|
|
98
106
|
* Trigger the post-change pipeline for a property.
|
|
@@ -127,4 +135,4 @@ export interface AdapterContract<TItem extends ModelContract<any, any>> extends
|
|
|
127
135
|
* @param items - The incoming items to process/update.
|
|
128
136
|
*/
|
|
129
137
|
updateData(items: TItem[]): void;
|
|
130
|
-
}
|
|
138
|
+
}
|
|
@@ -11,13 +11,13 @@ export interface ModelContract<TTarget, TView> extends Lifecycle {
|
|
|
11
11
|
* The target element that this model is bound to.
|
|
12
12
|
* Can be null if not yet initialized.
|
|
13
13
|
*/
|
|
14
|
-
targetElement
|
|
14
|
+
targetElement?: TTarget;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The view associated with the target element.
|
|
18
18
|
* Can be null if the view is not yet created.
|
|
19
19
|
*/
|
|
20
|
-
view
|
|
20
|
+
view?: TView;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* The value represented by this model.
|
|
@@ -39,4 +39,4 @@ export interface ModelContract<TTarget, TView> extends Lifecycle {
|
|
|
39
39
|
* Indicates whether the model has been vissibly.
|
|
40
40
|
*/
|
|
41
41
|
visible?: boolean;
|
|
42
|
-
}
|
|
42
|
+
}
|
|
@@ -6,18 +6,20 @@ import { AdapterContract } from "./adapter.type";
|
|
|
6
6
|
*
|
|
7
7
|
* @template TAdapter - A concrete adapter type that implements AdapterContract.
|
|
8
8
|
*/
|
|
9
|
-
export interface RecyclerViewContract<
|
|
9
|
+
export interface RecyclerViewContract<
|
|
10
|
+
TAdapter extends AdapterContract<any>,
|
|
11
|
+
> extends Lifecycle {
|
|
10
12
|
/**
|
|
11
13
|
* The container element that hosts all item views.
|
|
12
14
|
* Can be null until `setView` is called.
|
|
13
15
|
*/
|
|
14
|
-
viewElement
|
|
16
|
+
viewElement?: HTMLElement;
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* The adapter instance responsible for providing and binding item views.
|
|
18
20
|
* Can be null until `setAdapter` is called.
|
|
19
21
|
*/
|
|
20
|
-
adapter
|
|
22
|
+
adapter?: TAdapter;
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* Attach an adapter and refresh the view accordingly.
|
|
@@ -42,8 +44,8 @@ export interface RecyclerViewContract<TAdapter extends AdapterContract<any>> ext
|
|
|
42
44
|
/**
|
|
43
45
|
* Refresh the rendered views to reflect current adapter data/state.
|
|
44
46
|
* May perform diffing, partial updates, or full re-binding.
|
|
45
|
-
*
|
|
47
|
+
*
|
|
46
48
|
* @param isUpdate - Indicates if this refresh is due to an update operation.
|
|
47
49
|
*/
|
|
48
50
|
refresh(isUpdate: boolean): void;
|
|
49
|
-
}
|
|
51
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { Lifecycle } from "src/ts/core/base/lifecycle";
|
|
3
2
|
import { MountViewResult } from "../../utils/libs.type";
|
|
4
3
|
|
|
@@ -20,8 +19,9 @@ import { MountViewResult } from "../../utils/libs.type";
|
|
|
20
19
|
* }
|
|
21
20
|
* ```
|
|
22
21
|
*/
|
|
23
|
-
export interface ViewContract<
|
|
24
|
-
|
|
22
|
+
export interface ViewContract<
|
|
23
|
+
TTags extends Record<string, HTMLElement>,
|
|
24
|
+
> extends Lifecycle {
|
|
25
25
|
/**
|
|
26
26
|
* The parent DOM element into which the view is mounted.
|
|
27
27
|
*
|
|
@@ -29,7 +29,7 @@ export interface ViewContract<TTags extends Record<string, HTMLElement>> extends
|
|
|
29
29
|
* - `null` before the view is mounted
|
|
30
30
|
* - Set once the view is attached to the DOM
|
|
31
31
|
*/
|
|
32
|
-
parent
|
|
32
|
+
parent?: HTMLElement;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Internal representation of the mounted view returned by `mountNode`.
|
|
@@ -40,7 +40,7 @@ export interface ViewContract<TTags extends Record<string, HTMLElement>> extends
|
|
|
40
40
|
*
|
|
41
41
|
* Will be `null` if the view has not been mounted yet.
|
|
42
42
|
*/
|
|
43
|
-
view
|
|
43
|
+
view?: MountViewResult<TTags>;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Returns the root HTMLElement of the mounted view.
|
|
@@ -52,4 +52,4 @@ export interface ViewContract<TTags extends Record<string, HTMLElement>> extends
|
|
|
52
52
|
* @throws {Error} If the view has not been mounted or initialized.
|
|
53
53
|
*/
|
|
54
54
|
getView(): HTMLElement;
|
|
55
|
-
}
|
|
55
|
+
}
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
|
|
2
1
|
/**
|
|
3
2
|
* Configuration options for the virtualized recycler view.
|
|
4
3
|
* Controls which element is used for scrolling, sizing heuristics, and how many
|
|
5
4
|
* extra items are rendered outside the viewport to reduce popping.
|
|
6
5
|
*/
|
|
7
6
|
export type VirtualOptions = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The scroll container element used to measure scroll position and viewport.
|
|
9
|
+
* If omitted, the implementation may default to the nearest scrollable parent
|
|
10
|
+
* or the window (depending on your mount strategy).
|
|
11
|
+
*/
|
|
12
|
+
scrollEl?: HTMLElement;
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Estimated height (in pixels) for a single item.
|
|
16
|
+
* Used as a heuristic before real measurements are available (especially when
|
|
17
|
+
* `dynamicHeights` is enabled) to compute the total scrollable size.
|
|
18
|
+
*/
|
|
19
|
+
estimateItemHeight?: number;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Number of extra items to render above and below the visible range.
|
|
23
|
+
* Higher values reduce blanking during fast scroll at the cost of more DOM work.
|
|
24
|
+
*/
|
|
25
|
+
overscan?: number;
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Enables measuring and caching actual item heights.
|
|
29
|
+
* When `true`, the recycler view supports variable-height items instead of
|
|
30
|
+
* assuming a fixed height for all items.
|
|
31
|
+
*/
|
|
32
|
+
dynamicHeights?: boolean;
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Enables adaptive estimation based on observed item measurements.
|
|
36
|
+
* When `true`, `estimateItemHeight` may be refined over time to improve
|
|
37
|
+
* scrollbar accuracy and reduce layout jumps.
|
|
38
|
+
*/
|
|
39
|
+
adaptiveEstimate?: boolean;
|
|
41
40
|
};
|
|
42
41
|
|
|
43
42
|
/**
|
|
@@ -46,21 +45,21 @@ export type VirtualOptions = {
|
|
|
46
45
|
* manipulate padding and host the rendered item elements.
|
|
47
46
|
*/
|
|
48
47
|
export type VirtualRecyclerViewTags = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Top spacer element that simulates the height of items scrolled past.
|
|
50
|
+
* Its height is adjusted to keep the visible items aligned with the scroll offset.
|
|
51
|
+
*/
|
|
52
|
+
PadTop: HTMLDivElement;
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Container that hosts the currently rendered (visible + overscan) item elements.
|
|
56
|
+
* Items are inserted/updated within this element during virtualization.
|
|
57
|
+
*/
|
|
58
|
+
ItemsHost: HTMLDivElement;
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
60
|
+
/**
|
|
61
|
+
* Bottom spacer element that simulates the height of items not yet rendered.
|
|
62
|
+
* Its height is adjusted to represent remaining content below the visible range.
|
|
63
|
+
*/
|
|
64
|
+
PadBottom: HTMLDivElement;
|
|
65
|
+
};
|
|
@@ -87,8 +87,24 @@ export type AjaxOptGroupItem = {
|
|
|
87
87
|
export type NormalizedAjaxItem =
|
|
88
88
|
| HTMLOptionElement
|
|
89
89
|
| HTMLOptGroupElement
|
|
90
|
-
| {
|
|
91
|
-
|
|
90
|
+
| {
|
|
91
|
+
type: "option";
|
|
92
|
+
value: string;
|
|
93
|
+
text: string;
|
|
94
|
+
selected?: boolean;
|
|
95
|
+
data?: Record<string, any>;
|
|
96
|
+
}
|
|
97
|
+
| {
|
|
98
|
+
type: "optgroup";
|
|
99
|
+
label: string;
|
|
100
|
+
data?: Record<string, any>;
|
|
101
|
+
options: Array<{
|
|
102
|
+
value: string;
|
|
103
|
+
text: string;
|
|
104
|
+
selected?: boolean;
|
|
105
|
+
data?: Record<string, any>;
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
92
108
|
|
|
93
109
|
/**
|
|
94
110
|
* Represents the result of parsing an AJAX response.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module "*.css";
|
|
@@ -10,8 +10,8 @@ import { SelectiveOptions } from "../utils/selective.type";
|
|
|
10
10
|
export interface PluginContext<TTags extends Record<string, HTMLElement>> {
|
|
11
11
|
selectBox: SelectBox;
|
|
12
12
|
options: SelectiveOptions;
|
|
13
|
-
adapter
|
|
14
|
-
recycler
|
|
13
|
+
adapter?: AdapterContract<any>;
|
|
14
|
+
recycler?: RecyclerViewContract<AdapterContract<any>>;
|
|
15
15
|
viewTags: TTags & { id: string };
|
|
16
16
|
actions: SelectBoxAction;
|
|
17
17
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Typically includes width and height of an element.
|
|
4
4
|
*/
|
|
5
5
|
export interface SizeObject {
|
|
6
|
-
width: number;
|
|
6
|
+
width: number; // Element width in pixels
|
|
7
7
|
height: number; // Element height in pixels
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -12,8 +12,8 @@ export interface SizeObject {
|
|
|
12
12
|
* Includes scrollable height for overflow calculations.
|
|
13
13
|
*/
|
|
14
14
|
export interface DimensionObject {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
15
|
+
width: number; // Element width in pixels
|
|
16
|
+
height: number; // Element height in pixels
|
|
17
17
|
scrollHeight: number; // Total scrollable height of the element
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -87,45 +87,45 @@ export interface EffectorInterface {
|
|
|
87
87
|
* Configuration options for expanding an element.
|
|
88
88
|
*/
|
|
89
89
|
export type ExpandConfig = {
|
|
90
|
-
duration?: number;
|
|
91
|
-
display?: string;
|
|
92
|
-
width: number;
|
|
93
|
-
left: number;
|
|
94
|
-
top: number;
|
|
95
|
-
maxHeight: number;
|
|
96
|
-
realHeight: number;
|
|
90
|
+
duration?: number; // Animation duration in milliseconds
|
|
91
|
+
display?: string; // CSS display property during expansion
|
|
92
|
+
width: number; // Target width in pixels
|
|
93
|
+
left: number; // Target left position
|
|
94
|
+
top: number; // Target top position
|
|
95
|
+
maxHeight: number; // Maximum height allowed
|
|
96
|
+
realHeight: number; // Actual height of the content
|
|
97
97
|
position?: "top" | "bottom"; // Positioning reference
|
|
98
|
-
onComplete?: () => void;
|
|
98
|
+
onComplete?: () => void; // Callback after expansion completes
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Configuration options for collapsing an element.
|
|
103
103
|
*/
|
|
104
104
|
export type CollapseConfig = {
|
|
105
|
-
duration?: number;
|
|
106
|
-
onComplete?: () => void;
|
|
105
|
+
duration?: number; // Animation duration in milliseconds
|
|
106
|
+
onComplete?: () => void; // Callback after collapse completes
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Configuration options for swipe animations.
|
|
111
111
|
*/
|
|
112
112
|
export type SwipeConfig = {
|
|
113
|
-
duration?: number;
|
|
114
|
-
display?: string;
|
|
115
|
-
onComplete?: () => void;
|
|
113
|
+
duration?: number; // Animation duration in milliseconds
|
|
114
|
+
display?: string; // CSS display property during swipe
|
|
115
|
+
onComplete?: () => void; // Callback after swipe completes
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Configuration options for resizing an element.
|
|
120
120
|
*/
|
|
121
121
|
export type ResizeConfig = {
|
|
122
|
-
duration?: number;
|
|
123
|
-
width: number;
|
|
124
|
-
left: number;
|
|
125
|
-
top: number;
|
|
126
|
-
maxHeight: number;
|
|
127
|
-
realHeight: number;
|
|
122
|
+
duration?: number; // Animation duration in milliseconds
|
|
123
|
+
width: number; // Target width in pixels
|
|
124
|
+
left: number; // Target left position
|
|
125
|
+
top: number; // Target top position
|
|
126
|
+
maxHeight: number; // Maximum height allowed
|
|
127
|
+
realHeight: number; // Actual height of the content
|
|
128
128
|
position?: "top" | "bottom"; // Positioning reference
|
|
129
|
-
animate?: boolean;
|
|
130
|
-
onComplete?: () => void;
|
|
131
|
-
};
|
|
129
|
+
animate?: boolean; // Whether to animate the resize
|
|
130
|
+
onComplete?: () => void; // Callback after resize completes
|
|
131
|
+
};
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
* Represents the measurements for each side of a box (padding, border, or margin).
|
|
3
3
|
*/
|
|
4
4
|
export interface BoxSides {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/** Size of the top side in pixels */
|
|
6
|
+
top: number;
|
|
7
|
+
/** Size of the right side in pixels */
|
|
8
|
+
right: number;
|
|
9
|
+
/** Size of the bottom side in pixels */
|
|
10
|
+
bottom: number;
|
|
11
|
+
/** Size of the left side in pixels */
|
|
12
|
+
left: number;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
/**
|
|
@@ -13,11 +17,18 @@ export interface BoxSides {
|
|
|
13
17
|
* and box model properties (padding, border, margin).
|
|
14
18
|
*/
|
|
15
19
|
export interface ElementMetrics {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/** Element width in pixels */
|
|
21
|
+
width: number;
|
|
22
|
+
/** Element height in pixels */
|
|
23
|
+
height: number;
|
|
24
|
+
/** Distance from the top of the parent/container */
|
|
25
|
+
top: number;
|
|
26
|
+
/** Distance from the left of the parent/container */
|
|
27
|
+
left: number;
|
|
28
|
+
/** Padding values for all sides */
|
|
29
|
+
padding: BoxSides;
|
|
30
|
+
/** Border thickness values for all sides */
|
|
31
|
+
border: BoxSides;
|
|
32
|
+
/** Margin values for all sides */
|
|
33
|
+
margin: BoxSides;
|
|
34
|
+
}
|
|
@@ -63,7 +63,7 @@ export interface TimerEntry<T extends any[] = any[]> {
|
|
|
63
63
|
* - `null` when `run()` is called without parameters
|
|
64
64
|
*/
|
|
65
65
|
export type StoredEntry = {
|
|
66
|
-
callback: (payload
|
|
66
|
+
callback: (payload?: any[]) => void;
|
|
67
67
|
timeout: number;
|
|
68
68
|
once: boolean;
|
|
69
|
-
};
|
|
69
|
+
};
|