selective-ui 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -7
- package/dist/selective-ui.esm.js +11 -8
- 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.js +2 -2
- package/dist/selective-ui.min.js.br +0 -0
- package/dist/selective-ui.umd.js +12 -9
- package/dist/selective-ui.umd.js.map +1 -1
- package/package.json +11 -2
- package/src/ts/adapter/mixed-adapter.ts +1 -0
- package/src/ts/core/search-controller.ts +2 -1
- package/src/ts/global.ts +2 -2
- package/src/ts/index.ts +2 -2
- package/src/ts/models/group-model.ts +1 -2
- package/src/ts/services/ea-observer.ts +7 -5
- package/src/ts/types/core/base/mixed-adapter.type.ts +9 -5
- package/src/ts/types/core/search-controller.type.ts +69 -35
- package/src/ts/types/services/select-observer.type.ts +9 -5
package/README.md
CHANGED
|
@@ -5,12 +5,5 @@ Advanced Custom Select Component - Pure JavaScript, Zero Dependencies
|
|
|
5
5
|
|
|
6
6
|
Full docs with examples: http://selective-ui.maisoft.io.vn/
|
|
7
7
|
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
registerPlugin(MyPlugin);
|
|
12
|
-
bind(".my-select");
|
|
13
|
-
```
|
|
14
|
-
|
|
15
8
|
# License
|
|
16
9
|
This is commercial software. See [LICENSE](https://github.com/maihcx/selective-ui/blob/main/LICENSE) for more info.
|
package/dist/selective-ui.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Selective UI v1.2.
|
|
1
|
+
/*! Selective UI v1.2.7 | MIT License */
|
|
2
2
|
/**
|
|
3
3
|
* @class
|
|
4
4
|
*/
|
|
@@ -3782,6 +3782,7 @@ class GroupModel extends Model {
|
|
|
3782
3782
|
*/
|
|
3783
3783
|
this.privOnCollapsedChanged = [];
|
|
3784
3784
|
this.label = this.targetElement.label;
|
|
3785
|
+
this.collapsed = Libs.string2Boolean(this.targetElement.dataset?.collapsed);
|
|
3785
3786
|
}
|
|
3786
3787
|
/**
|
|
3787
3788
|
* Initializes group state from the backing `<optgroup>` (if present) and mounts the model.
|
|
@@ -3798,7 +3799,6 @@ class GroupModel extends Model {
|
|
|
3798
3799
|
* @override
|
|
3799
3800
|
*/
|
|
3800
3801
|
init() {
|
|
3801
|
-
this.collapsed = Libs.string2Boolean(this.targetElement.dataset?.collapsed);
|
|
3802
3802
|
super.init();
|
|
3803
3803
|
this.mount();
|
|
3804
3804
|
}
|
|
@@ -5518,7 +5518,8 @@ class SearchController extends Lifecycle {
|
|
|
5518
5518
|
.join(",");
|
|
5519
5519
|
let payload;
|
|
5520
5520
|
if (typeof cfg.data === "function") {
|
|
5521
|
-
|
|
5521
|
+
const selectiveInstance = this.selectBox?.Selective?.find(this.selectBox?.container?.targetElement);
|
|
5522
|
+
payload = cfg.data.call(selectiveInstance, keyword, page);
|
|
5522
5523
|
if (payload && typeof payload.selectedValue === "undefined")
|
|
5523
5524
|
payload.selectedValue = selectedValues;
|
|
5524
5525
|
}
|
|
@@ -9998,7 +9999,7 @@ class ElementAdditionObserver {
|
|
|
9998
9999
|
*
|
|
9999
10000
|
* @internal
|
|
10000
10001
|
*/
|
|
10001
|
-
this.actions =
|
|
10002
|
+
this.actions = new Set();
|
|
10002
10003
|
}
|
|
10003
10004
|
/**
|
|
10004
10005
|
* Registers a callback invoked whenever a matching element is detected as added to the DOM.
|
|
@@ -10010,7 +10011,7 @@ class ElementAdditionObserver {
|
|
|
10010
10011
|
* @param action - Function executed with the newly detected element.
|
|
10011
10012
|
*/
|
|
10012
10013
|
onDetect(action) {
|
|
10013
|
-
this.actions.
|
|
10014
|
+
this.actions.add(action);
|
|
10014
10015
|
}
|
|
10015
10016
|
/**
|
|
10016
10017
|
* Clears all registered detection callbacks.
|
|
@@ -10019,7 +10020,7 @@ class ElementAdditionObserver {
|
|
|
10019
10020
|
* to scan mutations but will not invoke any listeners until new callbacks are registered.
|
|
10020
10021
|
*/
|
|
10021
10022
|
clearDetect() {
|
|
10022
|
-
this.actions
|
|
10023
|
+
this.actions.clear();
|
|
10023
10024
|
}
|
|
10024
10025
|
/**
|
|
10025
10026
|
* Starts observing the document for additions of elements matching the given tag name.
|
|
@@ -10093,7 +10094,9 @@ class ElementAdditionObserver {
|
|
|
10093
10094
|
* @internal
|
|
10094
10095
|
*/
|
|
10095
10096
|
handle(element) {
|
|
10096
|
-
this.actions
|
|
10097
|
+
for (const action of this.actions) {
|
|
10098
|
+
action(element);
|
|
10099
|
+
}
|
|
10097
10100
|
}
|
|
10098
10101
|
}
|
|
10099
10102
|
|
|
@@ -10802,7 +10805,7 @@ const SECLASS = new Selective();
|
|
|
10802
10805
|
*
|
|
10803
10806
|
* Declared as `const` literal type to enable strict typing and easy tree-shaking.
|
|
10804
10807
|
*/
|
|
10805
|
-
const version = "1.2.
|
|
10808
|
+
const version = "1.2.7";
|
|
10806
10809
|
/**
|
|
10807
10810
|
* Library name identifier.
|
|
10808
10811
|
*
|