selective-ui 1.2.7 → 1.3.0
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.esm.js +160 -73
- 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 +161 -74
- package/dist/selective-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/ts/adapter/mixed-adapter.ts +14 -3
- package/src/ts/components/popup/popup.ts +48 -21
- package/src/ts/components/selectbox.ts +48 -28
- package/src/ts/types/components/searchbox.type.ts +6 -0
- package/src/ts/types/utils/istorage.type.ts +1 -0
- package/src/ts/utils/istorage.ts +3 -2
- package/src/ts/utils/libs.ts +17 -10
- package/src/ts/views/group-view.ts +31 -5
- package/src/ts/views/option-view.ts +16 -3
package/dist/selective-ui.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Selective UI v1.
|
|
1
|
+
/*! Selective UI v1.3.0 | MIT License */
|
|
2
2
|
/**
|
|
3
3
|
* @class
|
|
4
4
|
*/
|
|
@@ -27,6 +27,7 @@ class iStorage {
|
|
|
27
27
|
autofocus: true,
|
|
28
28
|
searchable: true,
|
|
29
29
|
loadingfield: true,
|
|
30
|
+
preload: false,
|
|
30
31
|
visible: true,
|
|
31
32
|
skipError: false,
|
|
32
33
|
customDelimiter: ",",
|
|
@@ -36,8 +37,8 @@ class iStorage {
|
|
|
36
37
|
textSelectAll: "Select all",
|
|
37
38
|
textDeselectAll: "Deselect all",
|
|
38
39
|
textAccessoryDeselect: "Deselect: ",
|
|
39
|
-
animationtime: 200, //
|
|
40
|
-
delaysearchtime: 200, //
|
|
40
|
+
animationtime: 200, // milliseconds
|
|
41
|
+
delaysearchtime: 200, // milliseconds
|
|
41
42
|
allowHtml: false,
|
|
42
43
|
maxSelected: 0,
|
|
43
44
|
labelHalign: "left",
|
|
@@ -655,8 +656,7 @@ class Libs {
|
|
|
655
656
|
tmp.innerHTML = s;
|
|
656
657
|
tmp.querySelectorAll("script, style, iframe, object, embed, link").forEach((n) => n.remove());
|
|
657
658
|
tmp.querySelectorAll("*").forEach((n) => {
|
|
658
|
-
for (const
|
|
659
|
-
const a = n.attributes[k];
|
|
659
|
+
for (const a of Array.from(n.attributes)) {
|
|
660
660
|
const name = a.name ?? "";
|
|
661
661
|
const value = a.value ?? "";
|
|
662
662
|
if (/^on/i.test(name)) {
|
|
@@ -697,26 +697,34 @@ class Libs {
|
|
|
697
697
|
return s.replace(/đ/g, "d").replace(/Đ/g, "d");
|
|
698
698
|
}
|
|
699
699
|
/**
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
*
|
|
700
|
+
* Flattens a `<select>` element into an ordered array that includes optgroups
|
|
701
|
+
* and their child options.
|
|
702
|
+
*
|
|
703
|
+
* Notes:
|
|
704
|
+
* - Keeps original DOM order.
|
|
705
|
+
* - Adds a non-standard `__parentGroup` pointer on options inside optgroups.
|
|
706
|
+
*
|
|
707
|
+
* @param {HTMLSelectElement} selectElement - The source select element.
|
|
708
|
+
* @returns {Array<HTMLOptGroupElement | HTMLOptionElement>} Flattened node list.
|
|
703
709
|
*/
|
|
704
710
|
static parseSelectToArray(selectElement) {
|
|
705
711
|
const result = [];
|
|
706
|
-
const children =
|
|
707
|
-
children.
|
|
712
|
+
const children = selectElement.children;
|
|
713
|
+
for (let childIndex = 0; childIndex < children.length; childIndex++) {
|
|
714
|
+
const child = children[childIndex];
|
|
708
715
|
if (child.tagName === "OPTGROUP") {
|
|
709
716
|
const group = child;
|
|
710
717
|
result.push(group);
|
|
711
|
-
|
|
718
|
+
for (let optionIndex = 0; optionIndex < group.children.length; optionIndex++) {
|
|
719
|
+
const option = group.children[optionIndex];
|
|
712
720
|
option["__parentGroup"] = group;
|
|
713
721
|
result.push(option);
|
|
714
|
-
}
|
|
722
|
+
}
|
|
715
723
|
}
|
|
716
724
|
else if (child.tagName === "OPTION") {
|
|
717
725
|
result.push(child);
|
|
718
726
|
}
|
|
719
|
-
}
|
|
727
|
+
}
|
|
720
728
|
return result;
|
|
721
729
|
}
|
|
722
730
|
/**
|
|
@@ -2398,7 +2406,7 @@ class Popup extends Lifecycle {
|
|
|
2398
2406
|
}
|
|
2399
2407
|
: {};
|
|
2400
2408
|
// Load ModelManager resources into the list container
|
|
2401
|
-
this.modelManager.load(this.optionsContainer, { isMultiple: options.multiple }, recyclerViewOpt);
|
|
2409
|
+
this.modelManager.load(this.optionsContainer, { isMultiple: options.multiple, options: options }, recyclerViewOpt);
|
|
2402
2410
|
const MMResources = this.modelManager.getResources();
|
|
2403
2411
|
this.optionAdapter = MMResources.adapter;
|
|
2404
2412
|
this.recyclerView = MMResources.recyclerView;
|
|
@@ -2525,36 +2533,60 @@ class Popup extends Lifecycle {
|
|
|
2525
2533
|
setupEffector(effectorSvc) {
|
|
2526
2534
|
this.effSvc = effectorSvc;
|
|
2527
2535
|
}
|
|
2536
|
+
/**
|
|
2537
|
+
* Loads and initializes the popup (one-time setup):
|
|
2538
|
+
* - Appends the popup node to `document.body`
|
|
2539
|
+
* - Initializes the resize observer service
|
|
2540
|
+
* - Binds the effect service to the popup element
|
|
2541
|
+
* - Blocks mousedown events inside the popup to prevent auto-close
|
|
2542
|
+
*
|
|
2543
|
+
* Safely no-ops when the popup has already been created
|
|
2544
|
+
* or required dependencies are missing.
|
|
2545
|
+
*/
|
|
2546
|
+
load() {
|
|
2547
|
+
if (!this.node || !this.parent || !this.effSvc)
|
|
2548
|
+
return;
|
|
2549
|
+
if (this.isCreated)
|
|
2550
|
+
return;
|
|
2551
|
+
document.body.appendChild(this.node);
|
|
2552
|
+
this.isCreated = true;
|
|
2553
|
+
this.resizeObser = new ResizeObserverService();
|
|
2554
|
+
this.effSvc.setElement(this.node);
|
|
2555
|
+
this.node.addEventListener("mousedown", (e) => {
|
|
2556
|
+
e.stopPropagation();
|
|
2557
|
+
e.preventDefault();
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2528
2560
|
/**
|
|
2529
2561
|
* Opens (expands) the popup:
|
|
2530
|
-
* -
|
|
2531
|
-
* - Synchronizes
|
|
2532
|
-
* -
|
|
2533
|
-
* -
|
|
2562
|
+
* - Ensures the popup is loaded and initialized
|
|
2563
|
+
* - Synchronizes option handle visibility
|
|
2564
|
+
* - Optionally evaluates and applies the empty/not-found state
|
|
2565
|
+
* - Computes placement relative to the parent anchor
|
|
2566
|
+
* - Runs the expand animation
|
|
2567
|
+
* - Connects the resize observer after animation completes
|
|
2568
|
+
* - Resumes the recycler view
|
|
2569
|
+
*
|
|
2570
|
+
* Safely no-ops when required dependencies are missing.
|
|
2534
2571
|
*
|
|
2535
2572
|
* @param callback - Optional callback invoked when the opening animation completes.
|
|
2536
|
-
* @param isShowEmptyState - If true,
|
|
2573
|
+
* @param isShowEmptyState - If true, applies the empty/not-found state before animation.
|
|
2537
2574
|
*/
|
|
2538
2575
|
open(callback = null, isShowEmptyState) {
|
|
2539
2576
|
if (!this.node || !this.options || !this.optionHandle || !this.parent || !this.effSvc)
|
|
2540
2577
|
return;
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
this.resizeObser = new ResizeObserverService();
|
|
2545
|
-
this.effSvc.setElement(this.node);
|
|
2546
|
-
// Prevent the popup from closing when clicking inside
|
|
2547
|
-
this.node.addEventListener("mousedown", (e) => {
|
|
2548
|
-
e.stopPropagation();
|
|
2549
|
-
e.preventDefault();
|
|
2550
|
-
});
|
|
2551
|
-
}
|
|
2578
|
+
// Ensure one-time initialization
|
|
2579
|
+
this.load();
|
|
2580
|
+
// Sync option visibility state
|
|
2552
2581
|
this.optionHandle.update();
|
|
2582
|
+
// Apply empty state if requested
|
|
2553
2583
|
if (isShowEmptyState) {
|
|
2554
2584
|
this.updateEmptyState();
|
|
2555
2585
|
}
|
|
2586
|
+
// Compute placement based on parent anchor
|
|
2556
2587
|
const location = this.getParentLocation();
|
|
2557
2588
|
const { position, top, maxHeight, realHeight } = this.calculatePosition(location);
|
|
2589
|
+
// Run expand animation
|
|
2558
2590
|
this.effSvc.expand({
|
|
2559
2591
|
duration: this.options.animationtime,
|
|
2560
2592
|
display: "flex",
|
|
@@ -2567,13 +2599,14 @@ class Popup extends Lifecycle {
|
|
|
2567
2599
|
onComplete: () => {
|
|
2568
2600
|
if (!this.resizeObser || !this.parent)
|
|
2569
2601
|
return;
|
|
2602
|
+
// Recompute position on parent resize to keep behavior consistent
|
|
2570
2603
|
this.resizeObser.onChanged = (_metrics) => {
|
|
2571
|
-
// Recompute from parent each time to keep behavior identical.
|
|
2572
2604
|
const loc = this.getParentLocation();
|
|
2573
2605
|
this.handleResize(loc);
|
|
2574
2606
|
};
|
|
2575
2607
|
this.resizeObser.connect(this.parent.container.tags.ViewPanel);
|
|
2576
2608
|
callback?.();
|
|
2609
|
+
// Resume recycler view rendering after animation
|
|
2577
2610
|
const rv = this.recyclerView;
|
|
2578
2611
|
rv?.resume?.();
|
|
2579
2612
|
},
|
|
@@ -6464,8 +6497,18 @@ class View extends Lifecycle {
|
|
|
6464
6497
|
* @see {@link View}
|
|
6465
6498
|
*/
|
|
6466
6499
|
class GroupView extends View {
|
|
6467
|
-
|
|
6468
|
-
|
|
6500
|
+
/**
|
|
6501
|
+
* Creates a new GroupView bound to the given parent element.
|
|
6502
|
+
*
|
|
6503
|
+
* Initialization flow:
|
|
6504
|
+
* 1. Calls `super(parent)` (View base constructor).
|
|
6505
|
+
*
|
|
6506
|
+
* @public
|
|
6507
|
+
* @param {HTMLElement} parent - Container element that will host this group view.
|
|
6508
|
+
* @param {SelectiveOptions} options - Optional configuration for this group view.
|
|
6509
|
+
*/
|
|
6510
|
+
constructor(parent, options) {
|
|
6511
|
+
super(parent);
|
|
6469
6512
|
/**
|
|
6470
6513
|
* Strongly-typed reference to the mounted group view structure.
|
|
6471
6514
|
*
|
|
@@ -6480,6 +6523,16 @@ class GroupView extends View {
|
|
|
6480
6523
|
* @public
|
|
6481
6524
|
*/
|
|
6482
6525
|
this.view = null;
|
|
6526
|
+
/**
|
|
6527
|
+
* Parsed configuration (bound from the `<select>` element via binder map).
|
|
6528
|
+
*
|
|
6529
|
+
* Provides feature flags (multiple/disabled/readonly/visible/virtualScroll/ajax/autoclose…),
|
|
6530
|
+
* a11y ids (e.g. `SEID_LIST`, `SEID_HOLDER`) and user callbacks under `options.on`.
|
|
6531
|
+
*
|
|
6532
|
+
* @internal
|
|
6533
|
+
*/
|
|
6534
|
+
this.options = null;
|
|
6535
|
+
this.options = options;
|
|
6483
6536
|
}
|
|
6484
6537
|
/**
|
|
6485
6538
|
* Mounts the group view into the DOM.
|
|
@@ -6487,8 +6540,8 @@ class GroupView extends View {
|
|
|
6487
6540
|
* Creation flow:
|
|
6488
6541
|
* 1. Generates unique group ID (7-character random string).
|
|
6489
6542
|
* 2. Creates DOM structure via {@link Libs.mountNode}:
|
|
6490
|
-
* - Root: `<div role="group" aria-labelledby="seui-{id}-header">`
|
|
6491
|
-
* - Header: `<div role="presentation" id="seui-{id}-header">`
|
|
6543
|
+
* - Root: `<div role="group" aria-labelledby="seui-{this.options?.SEID || default}-{id}-header">`
|
|
6544
|
+
* - Header: `<div role="presentation" id="seui-{this.options?.SEID || default}-{id}-header">`
|
|
6492
6545
|
* - Items: `<div role="group">` (nested group for child items)
|
|
6493
6546
|
* 3. Appends root to {@link parent} container.
|
|
6494
6547
|
* 4. Transitions `INITIALIZED → MOUNTED` via `super.mount()`.
|
|
@@ -6514,8 +6567,8 @@ class GroupView extends View {
|
|
|
6514
6567
|
node: "div",
|
|
6515
6568
|
classList: ["seui-group"],
|
|
6516
6569
|
role: "group",
|
|
6517
|
-
ariaLabelledby: `seui-${group_id}-header`,
|
|
6518
|
-
id: `seui-${group_id}-group`,
|
|
6570
|
+
ariaLabelledby: `seui-${this.options?.SEID || "default"}-${group_id}-header`,
|
|
6571
|
+
id: `seui-${this.options?.SEID || "default"}-${group_id}-group`,
|
|
6519
6572
|
},
|
|
6520
6573
|
child: {
|
|
6521
6574
|
GroupHeader: {
|
|
@@ -6523,7 +6576,7 @@ class GroupView extends View {
|
|
|
6523
6576
|
node: "div",
|
|
6524
6577
|
classList: ["seui-group-header"],
|
|
6525
6578
|
role: "presentation",
|
|
6526
|
-
id: `seui-${group_id}-header`,
|
|
6579
|
+
id: `seui-${this.options?.SEID || "default"}-${group_id}-header`,
|
|
6527
6580
|
},
|
|
6528
6581
|
},
|
|
6529
6582
|
GroupItems: {
|
|
@@ -6732,8 +6785,9 @@ class OptionView extends View {
|
|
|
6732
6785
|
*
|
|
6733
6786
|
* @public
|
|
6734
6787
|
* @param {HTMLElement} parent - Container element that will host this option view.
|
|
6788
|
+
* @param {SelectiveOptions} options - Optional configuration for this option view.
|
|
6735
6789
|
*/
|
|
6736
|
-
constructor(parent) {
|
|
6790
|
+
constructor(parent, options) {
|
|
6737
6791
|
super(parent);
|
|
6738
6792
|
/**
|
|
6739
6793
|
* Strongly-typed reference to the mounted option view structure.
|
|
@@ -6749,6 +6803,15 @@ class OptionView extends View {
|
|
|
6749
6803
|
* @public
|
|
6750
6804
|
*/
|
|
6751
6805
|
this.view = null;
|
|
6806
|
+
/**
|
|
6807
|
+
* Parsed configuration (bound from the `<select>` element via binder map).
|
|
6808
|
+
*
|
|
6809
|
+
* Provides feature flags (multiple/disabled/readonly/visible/virtualScroll/ajax/autoclose…),
|
|
6810
|
+
* a11y ids (e.g. `SEID_LIST`, `SEID_HOLDER`) and user callbacks under `options.on`.
|
|
6811
|
+
*
|
|
6812
|
+
* @internal
|
|
6813
|
+
*/
|
|
6814
|
+
this.options = null;
|
|
6752
6815
|
/**
|
|
6753
6816
|
* Internal configuration object (Proxy target).
|
|
6754
6817
|
*
|
|
@@ -6790,6 +6853,7 @@ class OptionView extends View {
|
|
|
6790
6853
|
* @private
|
|
6791
6854
|
*/
|
|
6792
6855
|
this.isRendered = false;
|
|
6856
|
+
this.options = options;
|
|
6793
6857
|
this.initialize();
|
|
6794
6858
|
}
|
|
6795
6859
|
/**
|
|
@@ -6994,7 +7058,7 @@ class OptionView extends View {
|
|
|
6994
7058
|
mount() {
|
|
6995
7059
|
const viewClass = ["seui-option-view"];
|
|
6996
7060
|
const opt_id = Libs.randomString(7);
|
|
6997
|
-
const inputID = `option_${opt_id}`;
|
|
7061
|
+
const inputID = `option_${this.options?.SEID ?? "default"}_${opt_id}`;
|
|
6998
7062
|
if (this.config.isMultiple)
|
|
6999
7063
|
viewClass.push("multiple");
|
|
7000
7064
|
if (this.config.hasImage) {
|
|
@@ -7040,7 +7104,7 @@ class OptionView extends View {
|
|
|
7040
7104
|
OptionView: {
|
|
7041
7105
|
tag: {
|
|
7042
7106
|
node: "div",
|
|
7043
|
-
id: `seui-${opt_id}-option`,
|
|
7107
|
+
id: `seui-${this.options?.SEID ?? "default"}-${opt_id}-option`,
|
|
7044
7108
|
classList: viewClass,
|
|
7045
7109
|
role: "option",
|
|
7046
7110
|
ariaSelected: "false",
|
|
@@ -7254,6 +7318,15 @@ class MixedAdapter extends Adapter {
|
|
|
7254
7318
|
super(items);
|
|
7255
7319
|
/** Whether the adapter operates in multi-selection mode. */
|
|
7256
7320
|
this.isMultiple = false;
|
|
7321
|
+
/**
|
|
7322
|
+
* Parsed configuration (bound from the `<select>` element via binder map).
|
|
7323
|
+
*
|
|
7324
|
+
* Provides feature flags (multiple/disabled/readonly/visible/virtualScroll/ajax/autoclose…),
|
|
7325
|
+
* a11y ids (e.g. `SEID_LIST`, `SEID_HOLDER`) and user callbacks under `options.on`.
|
|
7326
|
+
*
|
|
7327
|
+
* @internal
|
|
7328
|
+
*/
|
|
7329
|
+
this.options = null;
|
|
7257
7330
|
/**
|
|
7258
7331
|
* Subscribers for aggregated visibility statistics.
|
|
7259
7332
|
* Fired via a debounced scheduler to avoid repeated recomputation during batch updates.
|
|
@@ -7346,8 +7419,8 @@ class MixedAdapter extends Adapter {
|
|
|
7346
7419
|
*/
|
|
7347
7420
|
viewHolder(parent, item) {
|
|
7348
7421
|
if (item instanceof GroupModel)
|
|
7349
|
-
return new GroupView(parent);
|
|
7350
|
-
return new OptionView(parent);
|
|
7422
|
+
return new GroupView(parent, this.options);
|
|
7423
|
+
return new OptionView(parent, this.options);
|
|
7351
7424
|
}
|
|
7352
7425
|
/**
|
|
7353
7426
|
* Binds a model (group or option) to its view and delegates to specialized handlers.
|
|
@@ -7415,7 +7488,7 @@ class MixedAdapter extends Adapter {
|
|
|
7415
7488
|
groupModel.items.forEach((optionModel, idx) => {
|
|
7416
7489
|
let optionViewer = optionModel.view;
|
|
7417
7490
|
if (!optionModel.isInit || !optionViewer) {
|
|
7418
|
-
optionViewer = new OptionView(itemsContainer);
|
|
7491
|
+
optionViewer = new OptionView(itemsContainer, this.options);
|
|
7419
7492
|
}
|
|
7420
7493
|
this.handleOptionView(optionModel, optionViewer, idx);
|
|
7421
7494
|
optionModel.isInit = true;
|
|
@@ -9172,16 +9245,17 @@ class SelectBox extends Lifecycle {
|
|
|
9172
9245
|
});
|
|
9173
9246
|
this.optionModelManager = optionModelManager;
|
|
9174
9247
|
// Popup
|
|
9175
|
-
|
|
9176
|
-
container.popup
|
|
9177
|
-
|
|
9178
|
-
|
|
9248
|
+
const popup = new Popup(select, options, optionModelManager);
|
|
9249
|
+
container.popup = popup;
|
|
9250
|
+
popup.setupEffector(effector);
|
|
9251
|
+
popup.setupInfiniteScroll(searchController, options);
|
|
9252
|
+
popup.onAdapterPropChanged("selected", () => {
|
|
9179
9253
|
this.getAction()?.change(null, true);
|
|
9180
9254
|
});
|
|
9181
|
-
|
|
9255
|
+
popup.onAdapterPropChanged("selected_internal", () => {
|
|
9182
9256
|
this.getAction()?.change(null, false);
|
|
9183
9257
|
});
|
|
9184
|
-
|
|
9258
|
+
popup.onAdapterPropChanging("select", () => {
|
|
9185
9259
|
this.oldValue = this.getAction()?.value ?? "";
|
|
9186
9260
|
});
|
|
9187
9261
|
accessoryBox.setRoot(container.tags.ViewPanel);
|
|
@@ -9238,7 +9312,11 @@ class SelectBox extends Lifecycle {
|
|
|
9238
9312
|
Refresher.resizeBox(select, container.tags.ViewPanel);
|
|
9239
9313
|
select.classList.add("init");
|
|
9240
9314
|
// initial mask
|
|
9241
|
-
this.getAction()
|
|
9315
|
+
const action = this.getAction();
|
|
9316
|
+
action?.change?.(null, false);
|
|
9317
|
+
if (this.options.preload) {
|
|
9318
|
+
action?.load?.();
|
|
9319
|
+
}
|
|
9242
9320
|
// Call parent lifecycle mount
|
|
9243
9321
|
super.mount();
|
|
9244
9322
|
}
|
|
@@ -9678,6 +9756,26 @@ class SelectBox extends Lifecycle {
|
|
|
9678
9756
|
}
|
|
9679
9757
|
this.change(false, trigger);
|
|
9680
9758
|
},
|
|
9759
|
+
load() {
|
|
9760
|
+
if ((!superThis.hasLoadedOnce || superThis.isBeforeSearch) && bindedOptions?.ajax) {
|
|
9761
|
+
container.searchController.resetPagination();
|
|
9762
|
+
container.popup.showLoading();
|
|
9763
|
+
superThis.hasLoadedOnce = true;
|
|
9764
|
+
superThis.isBeforeSearch = false;
|
|
9765
|
+
setTimeout(() => {
|
|
9766
|
+
if (!container.popup || !container.searchController)
|
|
9767
|
+
return;
|
|
9768
|
+
container.searchController
|
|
9769
|
+
.search("")
|
|
9770
|
+
.then(() => container.popup?.triggerResize?.())
|
|
9771
|
+
.catch((err) => console.error("Initial ajax load error:", err));
|
|
9772
|
+
}, bindedOptions.animationtime);
|
|
9773
|
+
container.popup.load();
|
|
9774
|
+
}
|
|
9775
|
+
else {
|
|
9776
|
+
container.popup.load();
|
|
9777
|
+
}
|
|
9778
|
+
},
|
|
9681
9779
|
open() {
|
|
9682
9780
|
if (superThis.isOpen)
|
|
9683
9781
|
return;
|
|
@@ -9687,45 +9785,34 @@ class SelectBox extends Lifecycle {
|
|
|
9687
9785
|
if (closeToken.isCancel)
|
|
9688
9786
|
return;
|
|
9689
9787
|
}
|
|
9690
|
-
if (this.disabled)
|
|
9788
|
+
if (this.disabled) {
|
|
9691
9789
|
return;
|
|
9790
|
+
}
|
|
9692
9791
|
const beforeShowToken = iEvents.callEvent([getInstance()], ...bindedOptions.on.beforeShow);
|
|
9693
|
-
if (beforeShowToken.isCancel)
|
|
9792
|
+
if (beforeShowToken.isCancel) {
|
|
9694
9793
|
return;
|
|
9794
|
+
}
|
|
9695
9795
|
superThis.isOpen = true;
|
|
9696
9796
|
container.directive.setDropdown(true);
|
|
9697
9797
|
const adapter = container.popup.optionAdapter;
|
|
9698
9798
|
const selectedOption = adapter.getSelectedItem();
|
|
9699
|
-
if (selectedOption)
|
|
9799
|
+
if (selectedOption) {
|
|
9700
9800
|
adapter.setHighlight(selectedOption, false);
|
|
9701
|
-
else
|
|
9702
|
-
adapter.resetHighlight();
|
|
9703
|
-
if ((!superThis.hasLoadedOnce || superThis.isBeforeSearch) && bindedOptions?.ajax) {
|
|
9704
|
-
container.searchController.resetPagination();
|
|
9705
|
-
container.popup.showLoading();
|
|
9706
|
-
superThis.hasLoadedOnce = true;
|
|
9707
|
-
superThis.isBeforeSearch = false;
|
|
9708
|
-
setTimeout(() => {
|
|
9709
|
-
if (!container.popup || !container.searchController)
|
|
9710
|
-
return;
|
|
9711
|
-
container.searchController
|
|
9712
|
-
.search("")
|
|
9713
|
-
.then(() => container.popup?.triggerResize?.())
|
|
9714
|
-
.catch((err) => console.error("Initial ajax load error:", err));
|
|
9715
|
-
}, bindedOptions.animationtime);
|
|
9716
|
-
container.popup.open(null, false);
|
|
9717
9801
|
}
|
|
9718
9802
|
else {
|
|
9719
|
-
|
|
9803
|
+
adapter.resetHighlight();
|
|
9720
9804
|
}
|
|
9805
|
+
this.load();
|
|
9806
|
+
container.popup.open(null, !container.popup.loadingState.isVisible);
|
|
9721
9807
|
container.searchbox.show();
|
|
9722
9808
|
const ViewPanel = container.tags.ViewPanel;
|
|
9723
9809
|
ViewPanel.setAttribute("aria-expanded", "true");
|
|
9724
9810
|
ViewPanel.setAttribute("aria-controls", bindedOptions.SEID_LIST);
|
|
9725
9811
|
ViewPanel.setAttribute("aria-haspopup", "listbox");
|
|
9726
9812
|
ViewPanel.setAttribute("aria-labelledby", bindedOptions.SEID_HOLDER);
|
|
9727
|
-
if (bindedOptions.multiple)
|
|
9813
|
+
if (bindedOptions.multiple) {
|
|
9728
9814
|
ViewPanel.setAttribute("aria-multiselectable", "true");
|
|
9815
|
+
}
|
|
9729
9816
|
iEvents.callEvent([getInstance()], ...bindedOptions.on.show);
|
|
9730
9817
|
if (superThis.pluginContext) {
|
|
9731
9818
|
superThis.runPluginHook("onOpen", (plugin) => plugin.onOpen?.(superThis.pluginContext));
|
|
@@ -10805,7 +10892,7 @@ const SECLASS = new Selective();
|
|
|
10805
10892
|
*
|
|
10806
10893
|
* Declared as `const` literal type to enable strict typing and easy tree-shaking.
|
|
10807
10894
|
*/
|
|
10808
|
-
const version = "1.
|
|
10895
|
+
const version = "1.3.0";
|
|
10809
10896
|
/**
|
|
10810
10897
|
* Library name identifier.
|
|
10811
10898
|
*
|