@schukai/monster 3.52.1 → 3.54.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/source/components/datatable/columnbar.mjs +2 -3
- package/source/components/datatable/dataset.mjs +3 -5
- package/source/components/datatable/datasource/dom.mjs +5 -8
- package/source/components/datatable/datasource/rest.mjs +12 -18
- package/source/components/datatable/datasource.mjs +1 -1
- package/source/components/datatable/datatable/header.mjs +3 -5
- package/source/components/datatable/datatable.mjs +13 -18
- package/source/components/datatable/filter/date-range.mjs +15 -27
- package/source/components/datatable/filter/input.mjs +3 -5
- package/source/components/datatable/filter/range.mjs +10 -17
- package/source/components/datatable/filter/settings.mjs +6 -7
- package/source/components/datatable/filter.mjs +14 -21
- package/source/components/datatable/pagination.mjs +5 -7
- package/source/components/datatable/util.mjs +1 -2
- package/source/components/form/action-button.mjs +2 -3
- package/source/components/form/api-button.mjs +5 -9
- package/source/components/form/button-bar.mjs +15 -27
- package/source/components/form/button.mjs +2 -2
- package/source/components/form/confirm-button.mjs +9 -12
- package/source/components/form/form.mjs +8 -14
- package/source/components/form/message-state-button.mjs +4 -5
- package/source/components/form/popper-button.mjs +7 -11
- package/source/components/form/popper.mjs +7 -11
- package/source/components/form/reload.mjs +5 -7
- package/source/components/form/select.mjs +50 -76
- package/source/components/form/tabs.mjs +41 -45
- package/source/components/form/template.mjs +6 -9
- package/source/components/form/tree-select.mjs +7 -10
- package/source/components/form/util/popper.mjs +1 -2
- package/source/components/host/call-button.mjs +4 -6
- package/source/components/host/collapse.mjs +14 -22
- package/source/components/host/config-manager.mjs +7 -9
- package/source/components/host/details.mjs +5 -8
- package/source/components/host/host.mjs +7 -12
- package/source/components/host/overlay.mjs +4 -6
- package/source/components/host/viewer.mjs +2 -3
- package/source/components/notify/message.mjs +10 -13
- package/source/components/notify/notify.mjs +4 -6
- package/source/components/state/log/entry.mjs +1 -1
- package/source/components/state/log.mjs +6 -11
- package/source/components/style/icons.pcss +110 -0
- package/source/components/style/mixin/icon.pcss +43 -0
- package/source/components/stylesheet/icons.mjs +27 -0
- package/source/components/tree-menu/tree-menu.mjs +9 -14
- package/source/data/transformer.mjs +9 -4
- package/source/dom/customelement.mjs +1 -1
- package/source/dom/util.mjs +4 -5
- package/source/monster.mjs +0 -1
- package/source/types/observer.mjs +4 -4
- package/source/types/version.mjs +1 -1
- package/source/util/clone.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +1 -1
@@ -142,8 +142,7 @@ class PopperButton extends Popper {
|
|
142
142
|
* @property {object} popper - The popper options.
|
143
143
|
* @extends {Button.defaults}
|
144
144
|
*/
|
145
|
-
get defaults() {
|
146
|
-
|
145
|
+
get defaults() {
|
147
146
|
return Object.assign({}, super.defaults, {
|
148
147
|
templates: {
|
149
148
|
main: getTemplate(),
|
@@ -169,7 +168,7 @@ class PopperButton extends Popper {
|
|
169
168
|
* @return {Monster.Components.Form.PopperButton}
|
170
169
|
*/
|
171
170
|
[assembleMethodSymbol]() {
|
172
|
-
super[assembleMethodSymbol]()
|
171
|
+
super[assembleMethodSymbol]();
|
173
172
|
initControlReferences.call(this);
|
174
173
|
initEventhandler.call(this);
|
175
174
|
|
@@ -198,7 +197,7 @@ class PopperButton extends Popper {
|
|
198
197
|
connectedCallback() {
|
199
198
|
super.connectedCallback();
|
200
199
|
|
201
|
-
const document = getDocument()
|
200
|
+
const document = getDocument();
|
202
201
|
|
203
202
|
for (const [, type] of Object.entries(["click", "touch"])) {
|
204
203
|
// close on outside ui-events
|
@@ -324,8 +323,7 @@ class PopperButton extends Popper {
|
|
324
323
|
* @private
|
325
324
|
* @return {initEventhandler}
|
326
325
|
*/
|
327
|
-
function initEventhandler() {
|
328
|
-
|
326
|
+
function initEventhandler() {
|
329
327
|
this[closeEventHandler] = (event) => {
|
330
328
|
const path = event.composedPath();
|
331
329
|
|
@@ -343,8 +341,7 @@ function initEventhandler() {;
|
|
343
341
|
/**
|
344
342
|
* @private
|
345
343
|
*/
|
346
|
-
function attachResizeObserver() {
|
347
|
-
|
344
|
+
function attachResizeObserver() {
|
348
345
|
// against flickering
|
349
346
|
this[resizeObserverSymbol] = new ResizeObserver(() => {
|
350
347
|
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
@@ -364,7 +361,7 @@ function attachResizeObserver() {;
|
|
364
361
|
this[resizeObserverSymbol].observe(this.parentElement);
|
365
362
|
}
|
366
363
|
|
367
|
-
function disconnectResizeObserver() {
|
364
|
+
function disconnectResizeObserver() {
|
368
365
|
if (this[resizeObserverSymbol] instanceof ResizeObserver) {
|
369
366
|
this[resizeObserverSymbol].disconnect();
|
370
367
|
}
|
@@ -373,8 +370,7 @@ function disconnectResizeObserver() {;
|
|
373
370
|
/**
|
374
371
|
* @private
|
375
372
|
*/
|
376
|
-
function updatePopper() {
|
377
|
-
|
373
|
+
function updatePopper() {
|
378
374
|
if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
|
379
375
|
return;
|
380
376
|
}
|
@@ -164,7 +164,7 @@ class Popper extends CustomControl {
|
|
164
164
|
* @return {Monster.Components.Form.Popper}
|
165
165
|
*/
|
166
166
|
[assembleMethodSymbol]() {
|
167
|
-
super[assembleMethodSymbol]()
|
167
|
+
super[assembleMethodSymbol]();
|
168
168
|
initControlReferences.call(this);
|
169
169
|
initEventhandler.call(this);
|
170
170
|
|
@@ -191,7 +191,7 @@ class Popper extends CustomControl {
|
|
191
191
|
connectedCallback() {
|
192
192
|
super.connectedCallback();
|
193
193
|
|
194
|
-
const document = getDocument()
|
194
|
+
const document = getDocument();
|
195
195
|
|
196
196
|
for (const [, type] of Object.entries(["click", "touch"])) {
|
197
197
|
// close on outside ui-events
|
@@ -252,8 +252,7 @@ class Popper extends CustomControl {
|
|
252
252
|
* @private
|
253
253
|
* @return {Monster.Components.Form.Popper}
|
254
254
|
*/
|
255
|
-
function initEventhandler() {
|
256
|
-
|
255
|
+
function initEventhandler() {
|
257
256
|
this[closeEventHandler] = (event) => {
|
258
257
|
const path = event.composedPath();
|
259
258
|
|
@@ -287,8 +286,7 @@ function initEventhandler() {;
|
|
287
286
|
return this;
|
288
287
|
}
|
289
288
|
|
290
|
-
function initEventHandlerByMode(mode) {
|
291
|
-
|
289
|
+
function initEventHandlerByMode(mode) {
|
292
290
|
switch (mode) {
|
293
291
|
case "manual":
|
294
292
|
break;
|
@@ -345,8 +343,7 @@ function initEventHandlerByMode(mode) {;
|
|
345
343
|
/**
|
346
344
|
* @private
|
347
345
|
*/
|
348
|
-
function attachResizeObserver() {
|
349
|
-
|
346
|
+
function attachResizeObserver() {
|
350
347
|
// against flickering
|
351
348
|
this[resizeObserverSymbol] = new ResizeObserver((entries) => {
|
352
349
|
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
@@ -366,7 +363,7 @@ function attachResizeObserver() {;
|
|
366
363
|
this[resizeObserverSymbol].observe(this.parentElement);
|
367
364
|
}
|
368
365
|
|
369
|
-
function disconnectResizeObserver() {
|
366
|
+
function disconnectResizeObserver() {
|
370
367
|
if (this[resizeObserverSymbol] instanceof ResizeObserver) {
|
371
368
|
this[resizeObserverSymbol].disconnect();
|
372
369
|
}
|
@@ -427,8 +424,7 @@ function show() {
|
|
427
424
|
/**
|
428
425
|
* @private
|
429
426
|
*/
|
430
|
-
function updatePopper() {
|
431
|
-
|
427
|
+
function updatePopper() {
|
432
428
|
if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
|
433
429
|
return;
|
434
430
|
}
|
@@ -166,7 +166,7 @@ class Reload extends CustomElement {
|
|
166
166
|
/**
|
167
167
|
*
|
168
168
|
*/
|
169
|
-
[initMethodSymbol]() {
|
169
|
+
[initMethodSymbol]() {
|
170
170
|
super[initMethodSymbol]();
|
171
171
|
|
172
172
|
// data-monster-options
|
@@ -191,7 +191,7 @@ class Reload extends CustomElement {
|
|
191
191
|
* @fires Monster.Components.Form.event:monster-fetched
|
192
192
|
* @return {Monster.Components.Form.Form}
|
193
193
|
*/
|
194
|
-
[assembleMethodSymbol]() {
|
194
|
+
[assembleMethodSymbol]() {
|
195
195
|
super[assembleMethodSymbol]();
|
196
196
|
initIntersectionObserver.call(this);
|
197
197
|
}
|
@@ -232,7 +232,7 @@ class Reload extends CustomElement {
|
|
232
232
|
* @private
|
233
233
|
* @return {object}
|
234
234
|
*/
|
235
|
-
function initOptionsFromArguments() {
|
235
|
+
function initOptionsFromArguments() {
|
236
236
|
const options = {};
|
237
237
|
|
238
238
|
const url = this.getAttribute(ATTRIBUTE_FORM_URL);
|
@@ -259,8 +259,7 @@ function initOptionsFromArguments() {;
|
|
259
259
|
* @throws {Error} undefined status or type
|
260
260
|
* @fires Monster.Components.Form.event:monster-fetched
|
261
261
|
*/
|
262
|
-
function initIntersectionObserver() {
|
263
|
-
|
262
|
+
function initIntersectionObserver() {
|
264
263
|
if (this[intersectionObserverWasInitialized] === true) {
|
265
264
|
return;
|
266
265
|
}
|
@@ -310,8 +309,7 @@ function initIntersectionObserver() {;
|
|
310
309
|
* @fires Monster.Components.Form.event:monster-fetched
|
311
310
|
* @return {Promise}
|
312
311
|
*/
|
313
|
-
function loadContent() {
|
314
|
-
|
312
|
+
function loadContent() {
|
315
313
|
const url = this.getOption("url", undefined);
|
316
314
|
if (!isString(url) || url === "") {
|
317
315
|
throw new Error("missing url");
|
@@ -349,8 +349,7 @@ class Select extends CustomControl {
|
|
349
349
|
* @since 1.2.0
|
350
350
|
* @throws {Error} unsupported type
|
351
351
|
*/
|
352
|
-
set value(value) {
|
353
|
-
|
352
|
+
set value(value) {
|
354
353
|
const result = convertValueToSelection.call(this, value);
|
355
354
|
setSelection
|
356
355
|
.call(this, result.selection)
|
@@ -392,6 +391,7 @@ class Select extends CustomControl {
|
|
392
391
|
* @property {Boolean} features.clearAll=true Display of a delete button to delete the entire selection
|
393
392
|
* @property {Boolean} features.clear=true Display of a delete key for deleting the specific selection
|
394
393
|
* @property {Boolean} features.loadOnOpen=false Load options when opening the dropdown
|
394
|
+
* @property {Boolean} features.closeOnSelect=false Close the dropdown when an option is selected (since 3.54.0)
|
395
395
|
* @property {Boolean} filter.defaultValue=* Default filter value, if the filter is empty
|
396
396
|
* @property {Boolean} filter.mode=options Filter mode, values: options, remote, disabled
|
397
397
|
* @property {Object} templates Template definitions
|
@@ -425,6 +425,7 @@ class Select extends CustomControl {
|
|
425
425
|
clearAll: true,
|
426
426
|
clear: true,
|
427
427
|
loadOnOpen: false,
|
428
|
+
closeOnSelect: false,
|
428
429
|
},
|
429
430
|
url: null,
|
430
431
|
labels: {
|
@@ -558,7 +559,7 @@ class Select extends CustomControl {
|
|
558
559
|
* @since 3.27.0
|
559
560
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click}
|
560
561
|
*/
|
561
|
-
click() {
|
562
|
+
click() {
|
562
563
|
if (this.getOption("disabled") === true) {
|
563
564
|
return;
|
564
565
|
}
|
@@ -572,7 +573,7 @@ class Select extends CustomControl {
|
|
572
573
|
* @since 3.27.0
|
573
574
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus}
|
574
575
|
*/
|
575
|
-
focus(options) {
|
576
|
+
focus(options) {
|
576
577
|
if (this.getOption("disabled") === true) {
|
577
578
|
return;
|
578
579
|
}
|
@@ -591,7 +592,7 @@ class Select extends CustomControl {
|
|
591
592
|
* The Button.blur() method removes focus from the internal button element.
|
592
593
|
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur
|
593
594
|
*/
|
594
|
-
blur() {
|
595
|
+
blur() {
|
595
596
|
new Processing(() => {
|
596
597
|
gatherState.call(this);
|
597
598
|
blurFilter.call(this);
|
@@ -608,8 +609,7 @@ class Select extends CustomControl {
|
|
608
609
|
* @param {string|URL} url URL to fetch the options
|
609
610
|
* @return {Promise}
|
610
611
|
*/
|
611
|
-
fetch(url) {
|
612
|
-
|
612
|
+
fetch(url) {
|
613
613
|
if (url instanceof URL) {
|
614
614
|
url = url.toString();
|
615
615
|
}
|
@@ -634,7 +634,7 @@ class Select extends CustomControl {
|
|
634
634
|
*/
|
635
635
|
connectedCallback() {
|
636
636
|
super.connectedCallback();
|
637
|
-
const document = getDocument()
|
637
|
+
const document = getDocument();
|
638
638
|
|
639
639
|
for (const [, type] of Object.entries(["click", "touch"])) {
|
640
640
|
// close on outside ui-events
|
@@ -656,7 +656,7 @@ class Select extends CustomControl {
|
|
656
656
|
*/
|
657
657
|
disconnectedCallback() {
|
658
658
|
super.disconnectedCallback();
|
659
|
-
const document = getDocument()
|
659
|
+
const document = getDocument();
|
660
660
|
|
661
661
|
// close on outside ui-events
|
662
662
|
for (const [, type] of Object.entries(["click", "touch"])) {
|
@@ -676,8 +676,7 @@ class Select extends CustomControl {
|
|
676
676
|
* @throws {Error} map is not iterable
|
677
677
|
* @throws {Error} missing label configuration
|
678
678
|
*/
|
679
|
-
importOptions(data) {
|
680
|
-
|
679
|
+
importOptions(data) {
|
681
680
|
const mappingOptions = this.getOption("mapping", {});
|
682
681
|
const selector = mappingOptions?.["selector"];
|
683
682
|
const labelTemplate = mappingOptions?.["labelTemplate"];
|
@@ -722,7 +721,7 @@ class Select extends CustomControl {
|
|
722
721
|
fireCustomEvent(this, "monster-options-set", {
|
723
722
|
options,
|
724
723
|
});
|
725
|
-
|
724
|
+
|
726
725
|
return this;
|
727
726
|
}
|
728
727
|
|
@@ -762,7 +761,7 @@ class Select extends CustomControl {
|
|
762
761
|
* @private
|
763
762
|
* @return {object}
|
764
763
|
*/
|
765
|
-
function initOptionsFromArguments() {
|
764
|
+
function initOptionsFromArguments() {
|
766
765
|
const options = {};
|
767
766
|
|
768
767
|
const template = this.getAttribute("data-monster-selected-template");
|
@@ -792,8 +791,7 @@ function initOptionsFromArguments() {;
|
|
792
791
|
/**
|
793
792
|
* @private
|
794
793
|
*/
|
795
|
-
function attachResizeObserver() {
|
796
|
-
|
794
|
+
function attachResizeObserver() {
|
797
795
|
// against flickering
|
798
796
|
this[resizeObserverSymbol] = new ResizeObserver((entries) => {
|
799
797
|
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
@@ -814,7 +812,7 @@ function attachResizeObserver() {;
|
|
814
812
|
this[resizeObserverSymbol].observe(this.parentElement);
|
815
813
|
}
|
816
814
|
|
817
|
-
function disconnectResizeObserver() {
|
815
|
+
function disconnectResizeObserver() {
|
818
816
|
if (this[resizeObserverSymbol] instanceof ResizeObserver) {
|
819
817
|
this[resizeObserverSymbol].disconnect();
|
820
818
|
}
|
@@ -848,8 +846,7 @@ function getSummaryTemplate() {
|
|
848
846
|
* @return {void}
|
849
847
|
* @private
|
850
848
|
*/
|
851
|
-
function parseSlotsToOptions() {
|
852
|
-
|
849
|
+
function parseSlotsToOptions() {
|
853
850
|
let options = this.getOption("options");
|
854
851
|
if (!isIterable(options)) {
|
855
852
|
options = [];
|
@@ -857,7 +854,7 @@ function parseSlotsToOptions() {;
|
|
857
854
|
|
858
855
|
let counter = 1;
|
859
856
|
getSlottedElements.call(this, "div").forEach((node) => {
|
860
|
-
let value =
|
857
|
+
let value = (counter++).toString();
|
861
858
|
let visibility = "visible";
|
862
859
|
|
863
860
|
if (node.hasAttribute("data-monster-value")) {
|
@@ -928,7 +925,7 @@ function runAsOptionLengthChanged(targetLength) {
|
|
928
925
|
* @param {*} value
|
929
926
|
* @return {*}
|
930
927
|
*/
|
931
|
-
function buildSelectionLabel(value) {
|
928
|
+
function buildSelectionLabel(value) {
|
932
929
|
const options = this.getOption("options");
|
933
930
|
|
934
931
|
for (let i = 0; i < options.length; i++) {
|
@@ -949,8 +946,7 @@ function buildSelectionLabel(value) {;
|
|
949
946
|
* @return {string}
|
950
947
|
* @throws {Error} no value found
|
951
948
|
*/
|
952
|
-
function getSelectionLabel(value) {
|
953
|
-
|
949
|
+
function getSelectionLabel(value) {
|
954
950
|
const callback = this.getOption("formatter.selection");
|
955
951
|
if (isFunction(callback)) {
|
956
952
|
const label = callback.call(this, value);
|
@@ -968,8 +964,7 @@ function getSelectionLabel(value) {;
|
|
968
964
|
* @private
|
969
965
|
* @param {Event} event
|
970
966
|
*/
|
971
|
-
function handleToggleKeyboardEvents(event) {
|
972
|
-
|
967
|
+
function handleToggleKeyboardEvents(event) {
|
973
968
|
switch (event?.["code"]) {
|
974
969
|
case "Escape":
|
975
970
|
toggle.call(this);
|
@@ -1007,8 +1002,7 @@ function initOptionObserver() {
|
|
1007
1002
|
);
|
1008
1003
|
}
|
1009
1004
|
|
1010
|
-
function getDefaultTranslation() {
|
1011
|
-
|
1005
|
+
function getDefaultTranslation() {
|
1012
1006
|
const translation = new Translations("en").assignTranslations(
|
1013
1007
|
this.getOption("labels", {}),
|
1014
1008
|
);
|
@@ -1025,8 +1019,7 @@ function getDefaultTranslation() {;
|
|
1025
1019
|
* @private
|
1026
1020
|
* @returns {string|*}
|
1027
1021
|
*/
|
1028
|
-
function setSummaryAndControlText() {
|
1029
|
-
|
1022
|
+
function setSummaryAndControlText() {
|
1030
1023
|
const translations = getDefaultTranslation.call(this);
|
1031
1024
|
const selections = this.getOption("selection");
|
1032
1025
|
|
@@ -1091,8 +1084,7 @@ function getOptionElements() {
|
|
1091
1084
|
/**
|
1092
1085
|
* @private
|
1093
1086
|
*/
|
1094
|
-
function calcAndSetOptionsDimension() {
|
1095
|
-
|
1087
|
+
function calcAndSetOptionsDimension() {
|
1096
1088
|
const options = getOptionElements.call(this);
|
1097
1089
|
const container = this[optionsElementSymbol];
|
1098
1090
|
if (!(container instanceof HTMLElement && options instanceof NodeList)) {
|
@@ -1168,8 +1160,7 @@ function calcAndSetOptionsDimension() {;
|
|
1168
1160
|
* @param {number} direction
|
1169
1161
|
* @throws {Error} no shadow-root is defined
|
1170
1162
|
*/
|
1171
|
-
function activateCurrentOption(direction) {
|
1172
|
-
|
1163
|
+
function activateCurrentOption(direction) {
|
1173
1164
|
if (!this.shadowRoot) {
|
1174
1165
|
throw new Error("no shadow-root is defined");
|
1175
1166
|
}
|
@@ -1237,8 +1228,7 @@ function activateCurrentOption(direction) {;
|
|
1237
1228
|
/**
|
1238
1229
|
* @private
|
1239
1230
|
*/
|
1240
|
-
function filterOptions() {
|
1241
|
-
|
1231
|
+
function filterOptions() {
|
1242
1232
|
new Processing(() => {
|
1243
1233
|
let filterValue;
|
1244
1234
|
|
@@ -1285,8 +1275,7 @@ function filterOptions() {;
|
|
1285
1275
|
* @private
|
1286
1276
|
* @param {Event} event
|
1287
1277
|
*/
|
1288
|
-
function handleFilterKeyboardEvents(event) {
|
1289
|
-
|
1278
|
+
function handleFilterKeyboardEvents(event) {
|
1290
1279
|
const shiftKey = event?.["shiftKey"];
|
1291
1280
|
|
1292
1281
|
switch (event?.["code"]) {
|
@@ -1322,8 +1311,7 @@ function handleFilterKeyboardEvents(event) {;
|
|
1322
1311
|
/**
|
1323
1312
|
* @private
|
1324
1313
|
*/
|
1325
|
-
function filterFromRemote() {
|
1326
|
-
|
1314
|
+
function filterFromRemote() {
|
1327
1315
|
if (!(this[inlineFilterElementSymbol] instanceof HTMLElement)) {
|
1328
1316
|
return;
|
1329
1317
|
}
|
@@ -1347,8 +1335,7 @@ function filterFromRemote() {;
|
|
1347
1335
|
url = new Formatter({ filter: filterValue }).format(optionUrl);
|
1348
1336
|
}
|
1349
1337
|
|
1350
|
-
this
|
1351
|
-
.fetch(url)
|
1338
|
+
this.fetch(url)
|
1352
1339
|
.then(() => {
|
1353
1340
|
checkOptionState.call(this);
|
1354
1341
|
})
|
@@ -1363,8 +1350,7 @@ function filterFromRemote() {;
|
|
1363
1350
|
* @param {Event} event
|
1364
1351
|
* @private
|
1365
1352
|
*/
|
1366
|
-
function handleOptionKeyboardEvents(event) {
|
1367
|
-
|
1353
|
+
function handleOptionKeyboardEvents(event) {
|
1368
1354
|
const shiftKey = event?.["shiftKey"];
|
1369
1355
|
|
1370
1356
|
switch (event?.["code"]) {
|
@@ -1410,8 +1396,7 @@ function handleOptionKeyboardEvents(event) {;
|
|
1410
1396
|
* @private
|
1411
1397
|
* @returns {string}
|
1412
1398
|
*/
|
1413
|
-
function getFilterMode() {
|
1414
|
-
|
1399
|
+
function getFilterMode() {
|
1415
1400
|
switch (this.getOption("filter.mode")) {
|
1416
1401
|
case FILTER_MODE_OPTIONS:
|
1417
1402
|
return FILTER_MODE_OPTIONS;
|
@@ -1425,8 +1410,7 @@ function getFilterMode() {;
|
|
1425
1410
|
/**
|
1426
1411
|
* @private
|
1427
1412
|
*/
|
1428
|
-
function blurFilter() {
|
1429
|
-
|
1413
|
+
function blurFilter() {
|
1430
1414
|
if (!(this[inlineFilterElementSymbol] instanceof HTMLElement)) {
|
1431
1415
|
return;
|
1432
1416
|
}
|
@@ -1446,8 +1430,7 @@ function blurFilter() {;
|
|
1446
1430
|
* @private
|
1447
1431
|
* @param focusOptions
|
1448
1432
|
*/
|
1449
|
-
function focusPopperFilter(focusOptions) {
|
1450
|
-
|
1433
|
+
function focusPopperFilter(focusOptions) {
|
1451
1434
|
this[popperFilterContainerElementSymbol].classList.remove("d-none");
|
1452
1435
|
this[popperFilterElementSymbol].classList.add("active");
|
1453
1436
|
this[inlineFilterElementSymbol].classList.remove("active");
|
@@ -1477,8 +1460,7 @@ function focusPopperFilter(focusOptions) {;
|
|
1477
1460
|
* @private
|
1478
1461
|
* @param focusOptions
|
1479
1462
|
*/
|
1480
|
-
function focusInlineFilter(focusOptions) {
|
1481
|
-
|
1463
|
+
function focusInlineFilter(focusOptions) {
|
1482
1464
|
const options = this.getOption("options");
|
1483
1465
|
if (
|
1484
1466
|
(!isArray(options) || options.length === 0) &&
|
@@ -1505,8 +1487,7 @@ function focusInlineFilter(focusOptions) {;
|
|
1505
1487
|
/**
|
1506
1488
|
* @private
|
1507
1489
|
*/
|
1508
|
-
function focusFilter(focusOptions) {
|
1509
|
-
|
1490
|
+
function focusFilter(focusOptions) {
|
1510
1491
|
if (getFilterMode.call(this) === FILTER_MODE_DISABLED) {
|
1511
1492
|
this[popperFilterContainerElementSymbol].classList.add("d-none");
|
1512
1493
|
this[inlineFilterElementSymbol].classList.add("d-none");
|
@@ -1526,8 +1507,7 @@ function focusFilter(focusOptions) {;
|
|
1526
1507
|
* @throws {Error} no shadow-root is defined
|
1527
1508
|
* @throws {Error} unsupported type
|
1528
1509
|
*/
|
1529
|
-
function gatherState() {
|
1530
|
-
|
1510
|
+
function gatherState() {
|
1531
1511
|
const type = this.getOption("type");
|
1532
1512
|
if (["radio", "checkbox"].indexOf(type) === -1) {
|
1533
1513
|
throw new Error("unsupported type");
|
@@ -1554,6 +1534,10 @@ function gatherState() {;
|
|
1554
1534
|
.catch((e) => {
|
1555
1535
|
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, `${e}`);
|
1556
1536
|
});
|
1537
|
+
|
1538
|
+
if (this.getOption("features.closeOnSelect") === true) {
|
1539
|
+
toggle.call(this);
|
1540
|
+
}
|
1557
1541
|
|
1558
1542
|
return this;
|
1559
1543
|
}
|
@@ -1563,8 +1547,7 @@ function gatherState() {;
|
|
1563
1547
|
* @throws {Error} no shadow-root is defined
|
1564
1548
|
* @throws {Error} unsupported type
|
1565
1549
|
*/
|
1566
|
-
function clearSelection() {
|
1567
|
-
|
1550
|
+
function clearSelection() {
|
1568
1551
|
const type = this.getOption("type");
|
1569
1552
|
if (["radio", "checkbox"].indexOf(type) === -1) {
|
1570
1553
|
throw new Error("unsupported type");
|
@@ -1585,8 +1568,7 @@ function clearSelection() {;
|
|
1585
1568
|
/**
|
1586
1569
|
* @private
|
1587
1570
|
*/
|
1588
|
-
function areOptionsAvailableAndInit() {
|
1589
|
-
|
1571
|
+
function areOptionsAvailableAndInit() {
|
1590
1572
|
// prevent multiple calls
|
1591
1573
|
if (this[areOptionsAvailableAndInitSymbol] === undefined) {
|
1592
1574
|
this[areOptionsAvailableAndInitSymbol] = 0;
|
@@ -1676,8 +1658,7 @@ function areOptionsAvailableAndInit() {;
|
|
1676
1658
|
* @private
|
1677
1659
|
* @throws {Error} no shadow-root is defined
|
1678
1660
|
*/
|
1679
|
-
function checkOptionState() {
|
1680
|
-
|
1661
|
+
function checkOptionState() {
|
1681
1662
|
if (!this.shadowRoot) {
|
1682
1663
|
throw new Error("no shadow-root is defined");
|
1683
1664
|
}
|
@@ -1709,7 +1690,7 @@ function checkOptionState() {;
|
|
1709
1690
|
* @param {*} value
|
1710
1691
|
* @return {Object}
|
1711
1692
|
*/
|
1712
|
-
function convertValueToSelection(value) {
|
1693
|
+
function convertValueToSelection(value) {
|
1713
1694
|
const selection = [];
|
1714
1695
|
|
1715
1696
|
if (isString(value)) {
|
@@ -1752,8 +1733,7 @@ function convertValueToSelection(value) {;
|
|
1752
1733
|
* @param {array} selection
|
1753
1734
|
* @return {string}
|
1754
1735
|
*/
|
1755
|
-
function convertSelectionToValue(selection) {
|
1756
|
-
|
1736
|
+
function convertSelectionToValue(selection) {
|
1757
1737
|
const value = [];
|
1758
1738
|
|
1759
1739
|
if (isArray(selection)) {
|
@@ -1778,8 +1758,7 @@ function convertSelectionToValue(selection) {;
|
|
1778
1758
|
* @return {Promise}
|
1779
1759
|
* @throws {Error} no shadow-root is defined
|
1780
1760
|
*/
|
1781
|
-
function setSelection(selection) {
|
1782
|
-
|
1761
|
+
function setSelection(selection) {
|
1783
1762
|
if (isString(selection)) {
|
1784
1763
|
const result = convertValueToSelection.call(this, selection);
|
1785
1764
|
selection = result?.selection;
|
@@ -1837,8 +1816,7 @@ function setSelection(selection) {;
|
|
1837
1816
|
* @throws {TypeError} the result cannot be parsed
|
1838
1817
|
* @throws {TypeError} unsupported response
|
1839
1818
|
*/
|
1840
|
-
function fetchData(url) {
|
1841
|
-
|
1819
|
+
function fetchData(url) {
|
1842
1820
|
if (!url) url = this.getOption("url");
|
1843
1821
|
if (!url) return Promise.resolve();
|
1844
1822
|
|
@@ -1872,8 +1850,7 @@ function fetchData(url) {;
|
|
1872
1850
|
/**
|
1873
1851
|
* @private
|
1874
1852
|
*/
|
1875
|
-
function hide() {
|
1876
|
-
|
1853
|
+
function hide() {
|
1877
1854
|
this[popperElementSymbol].style.display = "none";
|
1878
1855
|
setStatusOrRemoveBadges.call(this, "status");
|
1879
1856
|
removeAttributeToken(this[controlElementSymbol], "class", "open");
|
@@ -1882,8 +1859,7 @@ function hide() {;
|
|
1882
1859
|
/**
|
1883
1860
|
* @private
|
1884
1861
|
*/
|
1885
|
-
function show() {
|
1886
|
-
|
1862
|
+
function show() {
|
1887
1863
|
if (this.getOption("disabled", undefined) === true) {
|
1888
1864
|
return;
|
1889
1865
|
}
|
@@ -2131,7 +2107,7 @@ function initEventhandler() {
|
|
2131
2107
|
* @private
|
2132
2108
|
* @return {Select}
|
2133
2109
|
*/
|
2134
|
-
function setStatusOrRemoveBadges(suggestion) {
|
2110
|
+
function setStatusOrRemoveBadges(suggestion) {
|
2135
2111
|
setTimeout(() => {
|
2136
2112
|
const selection = this.getOption("selection");
|
2137
2113
|
const clearAllFlag =
|
@@ -2178,8 +2154,7 @@ function setStatusOrRemoveBadges(suggestion) {;
|
|
2178
2154
|
* @return {Select}
|
2179
2155
|
* @throws {Error} no shadow-root is defined
|
2180
2156
|
*/
|
2181
|
-
function initControlReferences() {
|
2182
|
-
|
2157
|
+
function initControlReferences() {
|
2183
2158
|
if (!this.shadowRoot) {
|
2184
2159
|
throw new Error("no shadow-root is defined");
|
2185
2160
|
}
|
@@ -2218,8 +2193,7 @@ function initControlReferences() {;
|
|
2218
2193
|
/**
|
2219
2194
|
* @private
|
2220
2195
|
*/
|
2221
|
-
function updatePopper() {
|
2222
|
-
|
2196
|
+
function updatePopper() {
|
2223
2197
|
if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
|
2224
2198
|
return;
|
2225
2199
|
}
|