selective-ui 1.4.0 → 1.4.2
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 +2 -2
- package/dist/selective-ui.css.map +1 -1
- package/dist/selective-ui.esm.js +407 -573
- 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 +409 -575
- package/dist/selective-ui.umd.js.map +1 -1
- package/package.json +12 -12
- package/src/css/views/option-view.css +2 -2
- package/src/ts/adapter/mixed-adapter.ts +149 -71
- 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 +260 -84
- package/src/ts/core/base/adapter.ts +61 -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 +178 -45
- 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 +88 -20
- 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 +14 -4
- 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
|
@@ -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
|
+
};
|
|
@@ -6,13 +6,13 @@ import { SelectiveOptions } from "./selective.type";
|
|
|
6
6
|
* Each event can have multiple callbacks.
|
|
7
7
|
*/
|
|
8
8
|
export type StorageEvents = {
|
|
9
|
-
load?: Array<(...args: any[]) => void>;
|
|
10
|
-
beforeShow?: Array<(...args: any[]) => void>;
|
|
11
|
-
show?: Array<(...args: any[]) => void>;
|
|
12
|
-
beforeChange?: Array<(...args: any[]) => void>;
|
|
13
|
-
change?: Array<(...args: any[]) => void>;
|
|
14
|
-
beforeClose?: Array<(...args: any[]) => void>;
|
|
15
|
-
close?: Array<(...args: any[]) => void>;
|
|
9
|
+
load?: Array<(...args: any[]) => void>; // Triggered when data or component is loaded
|
|
10
|
+
beforeShow?: Array<(...args: any[]) => void>; // Triggered before the panel is shown
|
|
11
|
+
show?: Array<(...args: any[]) => void>; // Triggered when the panel is displayed
|
|
12
|
+
beforeChange?: Array<(...args: any[]) => void>; // Triggered before a value change occurs
|
|
13
|
+
change?: Array<(...args: any[]) => void>; // Triggered after a value change occurs
|
|
14
|
+
beforeClose?: Array<(...args: any[]) => void>; // Triggered before the panel is closed
|
|
15
|
+
close?: Array<(...args: any[]) => void>; // Triggered when the panel is closed
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -20,51 +20,51 @@ export type StorageEvents = {
|
|
|
20
20
|
* Includes UI settings, behavior flags, and AJAX configuration.
|
|
21
21
|
*/
|
|
22
22
|
export interface DefaultConfig {
|
|
23
|
-
accessoryVisible?: boolean;
|
|
24
|
-
virtualScroll?: boolean;
|
|
25
|
-
accessoryStyle?: string;
|
|
26
|
-
multiple?: boolean;
|
|
27
|
-
minWidth?: string;
|
|
28
|
-
width?: string;
|
|
29
|
-
offsetWidth?: number
|
|
30
|
-
minHeight?: string;
|
|
31
|
-
height?: string;
|
|
32
|
-
panelHeight?: string;
|
|
33
|
-
panelMinHeight?: string;
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
readonly?: boolean;
|
|
36
|
-
selectall?: boolean;
|
|
37
|
-
keepSelected?: boolean;
|
|
38
|
-
placeholder?: string;
|
|
39
|
-
altMask?: string;
|
|
40
|
-
autoclose?: boolean;
|
|
41
|
-
autoscroll?: boolean;
|
|
42
|
-
autofocus?: boolean;
|
|
43
|
-
searchable?: boolean;
|
|
44
|
-
loadingfield?: boolean;
|
|
45
|
-
preload?: boolean;
|
|
46
|
-
visible?: boolean;
|
|
47
|
-
skipError?: boolean;
|
|
48
|
-
customDelimiter?: string;
|
|
49
|
-
textLoading?: string;
|
|
50
|
-
textNoData?: string;
|
|
51
|
-
textNotFound?: string;
|
|
52
|
-
textSelectAll?: string;
|
|
53
|
-
textDeselectAll?: string;
|
|
54
|
-
textAccessoryDeselect?: string;
|
|
55
|
-
animationtime?: number;
|
|
56
|
-
delaysearchtime?: number;
|
|
57
|
-
allowHtml?: boolean;
|
|
58
|
-
maxSelected?: number;
|
|
59
|
-
labelHalign?: string;
|
|
60
|
-
labelValign?: string;
|
|
61
|
-
imageMode?: boolean;
|
|
62
|
-
imageWidth?: string;
|
|
63
|
-
imageHeight?: string;
|
|
64
|
-
imageBorderRadius?: string;
|
|
65
|
-
imagePosition?: string;
|
|
66
|
-
ajax?: AjaxConfig
|
|
67
|
-
on?: StorageEvents;
|
|
23
|
+
accessoryVisible?: boolean; // Whether to show the accessory panel initially
|
|
24
|
+
virtualScroll?: boolean; // Enable virtual scroll
|
|
25
|
+
accessoryStyle?: string; // CSS style for accessory elements
|
|
26
|
+
multiple?: boolean; // Enable multiple selection
|
|
27
|
+
minWidth?: string; // Minimum width of the component
|
|
28
|
+
width?: string; // Fixed width of the component
|
|
29
|
+
offsetWidth?: number; // Offset width for positioning
|
|
30
|
+
minHeight?: string; // Minimum height of the component
|
|
31
|
+
height?: string; // Fixed height of the component
|
|
32
|
+
panelHeight?: string; // Height of the dropdown panel
|
|
33
|
+
panelMinHeight?: string; // Minimum height of the dropdown panel
|
|
34
|
+
disabled?: boolean; // Disable the component
|
|
35
|
+
readonly?: boolean; // Make the component read-only
|
|
36
|
+
selectall?: boolean; // Enable "Select All" functionality
|
|
37
|
+
keepSelected?: boolean; // Keep selected items after refresh
|
|
38
|
+
placeholder?: string; // Placeholder text
|
|
39
|
+
altMask?: string; // Alternative mask for display
|
|
40
|
+
autoclose?: boolean; // Close panel automatically after selection
|
|
41
|
+
autoscroll?: boolean; // Auto-scroll to selected item
|
|
42
|
+
autofocus?: boolean; // Focus on input automatically
|
|
43
|
+
searchable?: boolean; // Enable search functionality
|
|
44
|
+
loadingfield?: boolean; // Show loading indicator in the field
|
|
45
|
+
preload?: boolean; // Preload data on initialization
|
|
46
|
+
visible?: boolean; // Control visibility of the component
|
|
47
|
+
skipError?: boolean; // Skip error handling
|
|
48
|
+
customDelimiter?: string; // Custom delimiter for multiple values
|
|
49
|
+
textLoading?: string; // Text shown during loading
|
|
50
|
+
textNoData?: string; // Text shown when no data is available
|
|
51
|
+
textNotFound?: string; // Text shown when no search results are found
|
|
52
|
+
textSelectAll?: string; // Label for "Select All"
|
|
53
|
+
textDeselectAll?: string; // Label for "Deselect All"
|
|
54
|
+
textAccessoryDeselect?: string; // Label for accessory deselect button
|
|
55
|
+
animationtime?: number; // Animation duration in milliseconds
|
|
56
|
+
delaysearchtime?: number; // Delay before triggering search (ms)
|
|
57
|
+
allowHtml?: boolean; // Allow HTML in option labels
|
|
58
|
+
maxSelected?: number; // Maximum number of selections allowed
|
|
59
|
+
labelHalign?: string; // Horizontal alignment for labels
|
|
60
|
+
labelValign?: string; // Vertical alignment for labels
|
|
61
|
+
imageMode?: boolean; // Enable image display in options
|
|
62
|
+
imageWidth?: string; // Width for option images
|
|
63
|
+
imageHeight?: string; // Height for option images
|
|
64
|
+
imageBorderRadius?: string; // Border radius for option images
|
|
65
|
+
imagePosition?: string; // Position of images relative to text
|
|
66
|
+
ajax?: AjaxConfig; // AJAX configuration for dynamic data loading
|
|
67
|
+
on?: StorageEvents; // Event handlers for component lifecycle
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -72,13 +72,15 @@ export interface DefaultConfig {
|
|
|
72
72
|
* Includes options, container reference, and lifecycle actions.
|
|
73
73
|
*/
|
|
74
74
|
export type BinderMap<
|
|
75
|
-
TContainer extends any = any,
|
|
76
|
-
TAction extends Record<string, any> = Record<string, any>,
|
|
77
|
-
TSelf extends { deInit?: () => void } & Record<string, any> = {
|
|
75
|
+
TContainer extends any = any,
|
|
76
|
+
TAction extends Record<string, any> = Record<string, any>,
|
|
77
|
+
TSelf extends { deInit?: () => void } & Record<string, any> = {
|
|
78
|
+
deInit?: () => void;
|
|
79
|
+
} & Record<string, any>,
|
|
78
80
|
> = {
|
|
79
|
-
options: SelectiveOptions;
|
|
80
|
-
container?: TContainer;
|
|
81
|
-
action?: TAction;
|
|
81
|
+
options: SelectiveOptions; // Component options
|
|
82
|
+
container?: TContainer; // Reference to the container element
|
|
83
|
+
action?: TAction; // Action handlers or methods
|
|
82
84
|
self?: TSelf; // Self-reference with optional cleanup
|
|
83
85
|
};
|
|
84
86
|
|
|
@@ -87,5 +89,5 @@ export type BinderMap<
|
|
|
87
89
|
*/
|
|
88
90
|
export type PropertiesType = {
|
|
89
91
|
type: "variable" | "get-set" | "func"; // Property type (variable, getter/setter, or function)
|
|
90
|
-
name: string;
|
|
91
|
-
};
|
|
92
|
+
name: string; // Property name
|
|
93
|
+
};
|