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.
Files changed (71) hide show
  1. package/dist/selective-ui.css +2 -2
  2. package/dist/selective-ui.css.map +1 -1
  3. package/dist/selective-ui.esm.js +407 -573
  4. package/dist/selective-ui.esm.js.map +1 -1
  5. package/dist/selective-ui.esm.min.js +2 -2
  6. package/dist/selective-ui.esm.min.js.br +0 -0
  7. package/dist/selective-ui.min.css +1 -1
  8. package/dist/selective-ui.min.css.br +0 -0
  9. package/dist/selective-ui.min.js +2 -2
  10. package/dist/selective-ui.min.js.br +0 -0
  11. package/dist/selective-ui.umd.js +409 -575
  12. package/dist/selective-ui.umd.js.map +1 -1
  13. package/package.json +12 -12
  14. package/src/css/views/option-view.css +2 -2
  15. package/src/ts/adapter/mixed-adapter.ts +149 -71
  16. package/src/ts/components/accessorybox.ts +14 -11
  17. package/src/ts/components/directive.ts +1 -1
  18. package/src/ts/components/option-handle.ts +12 -9
  19. package/src/ts/components/placeholder.ts +5 -5
  20. package/src/ts/components/popup/empty-state.ts +5 -5
  21. package/src/ts/components/popup/loading-state.ts +5 -5
  22. package/src/ts/components/popup/popup.ts +138 -76
  23. package/src/ts/components/searchbox.ts +17 -13
  24. package/src/ts/components/selectbox.ts +260 -84
  25. package/src/ts/core/base/adapter.ts +61 -14
  26. package/src/ts/core/base/fenwick.ts +3 -2
  27. package/src/ts/core/base/lifecycle.ts +14 -4
  28. package/src/ts/core/base/model.ts +17 -15
  29. package/src/ts/core/base/recyclerview.ts +7 -5
  30. package/src/ts/core/base/view.ts +10 -5
  31. package/src/ts/core/base/virtual-recyclerview.ts +178 -45
  32. package/src/ts/core/model-manager.ts +48 -21
  33. package/src/ts/core/search-controller.ts +174 -56
  34. package/src/ts/global.ts +5 -8
  35. package/src/ts/index.ts +2 -2
  36. package/src/ts/models/group-model.ts +33 -8
  37. package/src/ts/models/option-model.ts +88 -20
  38. package/src/ts/services/dataset-observer.ts +6 -3
  39. package/src/ts/services/ea-observer.ts +1 -1
  40. package/src/ts/services/effector.ts +22 -12
  41. package/src/ts/services/refresher.ts +14 -4
  42. package/src/ts/services/resize-observer.ts +24 -11
  43. package/src/ts/services/select-observer.ts +2 -2
  44. package/src/ts/types/components/popup.type.ts +18 -1
  45. package/src/ts/types/components/searchbox.type.ts +43 -30
  46. package/src/ts/types/components/state.box.type.ts +1 -1
  47. package/src/ts/types/core/base/adapter.type.ts +13 -5
  48. package/src/ts/types/core/base/lifecycle.type.ts +1 -2
  49. package/src/ts/types/core/base/model.type.ts +3 -3
  50. package/src/ts/types/core/base/recyclerview.type.ts +7 -5
  51. package/src/ts/types/core/base/view.type.ts +6 -6
  52. package/src/ts/types/core/base/virtual-recyclerview.type.ts +45 -46
  53. package/src/ts/types/core/search-controller.type.ts +18 -2
  54. package/src/ts/types/css.d.ts +1 -0
  55. package/src/ts/types/plugins/plugin.type.ts +2 -2
  56. package/src/ts/types/services/effector.type.ts +25 -25
  57. package/src/ts/types/services/resize-observer.type.ts +23 -12
  58. package/src/ts/types/utils/callback-scheduler.type.ts +2 -2
  59. package/src/ts/types/utils/ievents.type.ts +1 -1
  60. package/src/ts/types/utils/istorage.type.ts +62 -60
  61. package/src/ts/types/utils/libs.type.ts +19 -17
  62. package/src/ts/types/utils/selective.type.ts +6 -3
  63. package/src/ts/types/views/view.group.type.ts +9 -5
  64. package/src/ts/types/views/view.option.type.ts +39 -17
  65. package/src/ts/utils/callback-scheduler.ts +12 -7
  66. package/src/ts/utils/ievents.ts +12 -5
  67. package/src/ts/utils/istorage.ts +5 -3
  68. package/src/ts/utils/libs.ts +122 -43
  69. package/src/ts/utils/selective.ts +15 -8
  70. package/src/ts/views/group-view.ts +11 -9
  71. 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<TItem extends ModelContract<any, any>> extends Lifecycle {
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(propName: string, callback: (...args: unknown[]) => void): void;
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(propName: string, callback: (...args: unknown[]) => void): void;
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
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Enumerates the finite lifecycle states used across core classes (e.g., View/Model).
4
3
  *
@@ -59,4 +58,4 @@ export interface LifecycleHooks {
59
58
  export type LifecycleHookContext = {
60
59
  state: LifecycleState;
61
60
  prevState: LifecycleState;
62
- };
61
+ };
@@ -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: TTarget | null;
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: TView | null;
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<TAdapter extends AdapterContract<any>> extends Lifecycle {
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: HTMLElement | null;
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: TAdapter | null;
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<TTags extends Record<string, HTMLElement>> extends Lifecycle {
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: HTMLElement | null;
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: MountViewResult<TTags> | null;
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
- * The scroll container element used to measure scroll position and viewport.
10
- * If omitted, the implementation may default to the nearest scrollable parent
11
- * or the window (depending on your mount strategy).
12
- */
13
- scrollEl?: HTMLElement;
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
- * Estimated height (in pixels) for a single item.
17
- * Used as a heuristic before real measurements are available (especially when
18
- * `dynamicHeights` is enabled) to compute the total scrollable size.
19
- */
20
- estimateItemHeight?: number;
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
- * Number of extra items to render above and below the visible range.
24
- * Higher values reduce blanking during fast scroll at the cost of more DOM work.
25
- */
26
- overscan?: number;
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
- * Enables measuring and caching actual item heights.
30
- * When `true`, the recycler view supports variable-height items instead of
31
- * assuming a fixed height for all items.
32
- */
33
- dynamicHeights?: boolean;
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
- * Enables adaptive estimation based on observed item measurements.
37
- * When `true`, `estimateItemHeight` may be refined over time to improve
38
- * scrollbar accuracy and reduce layout jumps.
39
- */
40
- adaptiveEstimate?: boolean;
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
- * Top spacer element that simulates the height of items scrolled past.
51
- * Its height is adjusted to keep the visible items aligned with the scroll offset.
52
- */
53
- PadTop: HTMLDivElement;
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
- * Container that hosts the currently rendered (visible + overscan) item elements.
57
- * Items are inserted/updated within this element during virtualization.
58
- */
59
- ItemsHost: HTMLDivElement;
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
- * Bottom spacer element that simulates the height of items not yet rendered.
63
- * Its height is adjusted to represent remaining content below the visible range.
64
- */
65
- PadBottom: HTMLDivElement;
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
- | { type: "option"; value: string; text: string; selected?: boolean; data?: Record<string, any> }
91
- | { type: "optgroup"; label: string; data?: Record<string, any>; options: Array<{ value: string; text: string; selected?: boolean; data?: Record<string, any> }> };
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: AdapterContract<any> | null;
14
- recycler: RecyclerViewContract<AdapterContract<any>> | null;
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; // Element width in pixels
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; // Element width in pixels
16
- height: number; // Element height in pixels
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; // 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
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; // Callback after expansion completes
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; // Animation duration in milliseconds
106
- onComplete?: () => void; // Callback after collapse completes
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; // Animation duration in milliseconds
114
- display?: string; // CSS display property during swipe
115
- onComplete?: () => void; // Callback after swipe completes
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; // 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
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; // Whether to animate the resize
130
- onComplete?: () => void; // Callback after resize completes
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
- top: number; // Size of the top side in pixels
6
- right: number; // Size of the right side in pixels
7
- bottom: number; // Size of the bottom side in pixels
8
- left: number; // Size of the left side in pixels
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
- width: number; // Element width in pixels
17
- height: number; // Element height in pixels
18
- top: number; // Distance from the top of the parent/container
19
- left: number; // Distance from the left of the parent/container
20
- padding: BoxSides; // Padding values for all sides
21
- border: BoxSides; // Border thickness values for all sides
22
- margin: BoxSides; // Margin values for all sides
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: any[] | null) => void;
66
+ callback: (payload?: any[]) => void;
67
67
  timeout: number;
68
68
  once: boolean;
69
- };
69
+ };
@@ -37,4 +37,4 @@ export interface IEventToken {
37
37
  export type IEventHandler<TParams extends unknown[] = []> = (
38
38
  cb: IEventCallback,
39
39
  ...params: TParams
40
- ) => void;
40
+ ) => void;
@@ -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>; // 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
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; // 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 | null; // 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 | null; // AJAX configuration for dynamic data loading
67
- on?: StorageEvents; // Event handlers for component lifecycle
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> = { 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; // Component options
80
- container?: TContainer; // Reference to the container element
81
- action?: TAction; // Action handlers or methods
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; // Property name
91
- };
92
+ name: string; // Property name
93
+ };