@schukai/monster 3.52.0 → 3.53.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/CHANGELOG.md +22 -1
- package/README.md +1 -1
- package/example/data/datasource/server/restapi.mjs +7 -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/stylesheet/column-bar.mjs +8 -14
- package/source/components/datatable/stylesheet/dataset.mjs +8 -14
- package/source/components/datatable/stylesheet/datasource.mjs +7 -13
- package/source/components/datatable/stylesheet/datatable.mjs +8 -14
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-button.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-date-range.mjs +7 -13
- package/source/components/datatable/stylesheet/filter-range.mjs +7 -13
- package/source/components/datatable/stylesheet/filter.mjs +8 -14
- package/source/components/datatable/stylesheet/pagination.mjs +8 -14
- package/source/components/datatable/stylesheet/select-filter.mjs +8 -14
- 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 +42 -74
- package/source/components/form/style/tabs.pcss +22 -19
- package/source/components/form/stylesheet/action-button.mjs +7 -13
- package/source/components/form/stylesheet/api-button.mjs +7 -13
- package/source/components/form/stylesheet/button-bar.mjs +8 -14
- package/source/components/form/stylesheet/button.mjs +8 -14
- package/source/components/form/stylesheet/confirm-button.mjs +7 -13
- package/source/components/form/stylesheet/context-help.mjs +7 -13
- package/source/components/form/stylesheet/form.mjs +7 -13
- package/source/components/form/stylesheet/message-state-button.mjs +7 -13
- package/source/components/form/stylesheet/popper-button.mjs +8 -14
- package/source/components/form/stylesheet/popper.mjs +7 -13
- package/source/components/form/stylesheet/select.mjs +7 -13
- package/source/components/form/stylesheet/state-button.mjs +7 -13
- package/source/components/form/stylesheet/tabs.mjs +8 -14
- package/source/components/form/stylesheet/tree-select.mjs +7 -13
- package/source/components/form/tabs.mjs +59 -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/stylesheet/call-button.mjs +8 -14
- package/source/components/host/stylesheet/collapse.mjs +8 -14
- package/source/components/host/stylesheet/config-manager.mjs +7 -13
- package/source/components/host/stylesheet/details.mjs +8 -14
- package/source/components/host/stylesheet/host.mjs +7 -13
- package/source/components/host/stylesheet/overlay.mjs +7 -13
- package/source/components/host/stylesheet/toggle-button.mjs +8 -14
- package/source/components/host/stylesheet/viewer.mjs +8 -14
- 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/notify/stylesheet/message.mjs +7 -13
- package/source/components/notify/stylesheet/notify.mjs +7 -13
- package/source/components/state/log/entry.mjs +1 -1
- package/source/components/state/log.mjs +6 -11
- package/source/components/state/stylesheet/log.mjs +7 -13
- package/source/components/state/stylesheet/state.mjs +8 -14
- package/source/components/style/common.pcss +12 -10
- package/source/components/style/icons.pcss +110 -0
- package/source/components/style/link.pcss +1 -1
- package/source/components/style/mixin/button.pcss +0 -2
- package/source/components/style/mixin/icon.pcss +43 -0
- package/source/components/style/mixin/property.pcss +4 -0
- package/source/components/stylesheet/badge.mjs +7 -13
- package/source/components/stylesheet/border.mjs +7 -13
- package/source/components/stylesheet/button.mjs +8 -14
- package/source/components/stylesheet/card.mjs +7 -13
- package/source/components/stylesheet/color.mjs +7 -13
- package/source/components/stylesheet/common.mjs +8 -14
- package/source/components/stylesheet/control.mjs +7 -13
- package/source/components/stylesheet/data-grid.mjs +7 -13
- package/source/components/stylesheet/display.mjs +7 -13
- package/source/components/stylesheet/floating-ui.mjs +7 -13
- package/source/components/stylesheet/form.mjs +7 -13
- package/source/components/stylesheet/host.mjs +7 -13
- package/source/components/stylesheet/icons.mjs +27 -0
- package/source/components/stylesheet/link.mjs +8 -14
- package/source/components/stylesheet/normalize.mjs +7 -13
- package/source/components/stylesheet/popper.mjs +7 -13
- package/source/components/stylesheet/property.mjs +7 -13
- package/source/components/stylesheet/ripple.mjs +7 -13
- package/source/components/stylesheet/skeleton.mjs +7 -13
- package/source/components/stylesheet/space.mjs +7 -13
- package/source/components/stylesheet/spinner.mjs +7 -13
- package/source/components/stylesheet/table.mjs +7 -13
- package/source/components/stylesheet/theme.mjs +7 -13
- package/source/components/stylesheet/typography.mjs +7 -13
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +7 -13
- package/source/components/tree-menu/tree-menu.mjs +9 -14
- package/source/data/datasource/server/restapi/writeerror.mjs +2 -1
- package/source/data/datasource/server.mjs +4 -4
- package/source/data/datasource.mjs +1 -1
- 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 +10 -2
- 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
|
@@ -8,8 +8,16 @@ import { instanceSymbol } from "../../constants.mjs";
|
|
|
8
8
|
import { createPopper } from "@popperjs/core";
|
|
9
9
|
import { extend } from "../../data/extend.mjs";
|
|
10
10
|
import { Pathfinder } from "../../data/pathfinder.mjs";
|
|
11
|
-
import {
|
|
12
|
-
|
|
11
|
+
import {
|
|
12
|
+
addAttributeToken,
|
|
13
|
+
addToObjectLink,
|
|
14
|
+
hasObjectLink,
|
|
15
|
+
} from "../../dom/attributes.mjs";
|
|
16
|
+
import {
|
|
17
|
+
ATTRIBUTE_ERRORMESSAGE,
|
|
18
|
+
ATTRIBUTE_PREFIX,
|
|
19
|
+
ATTRIBUTE_ROLE,
|
|
20
|
+
} from "../../dom/constants.mjs";
|
|
13
21
|
import {
|
|
14
22
|
assembleMethodSymbol,
|
|
15
23
|
CustomElement,
|
|
@@ -125,8 +133,6 @@ const resizeObserverSymbol = Symbol("resizeObserver");
|
|
|
125
133
|
*
|
|
126
134
|
* <img src="./images/tabs.png">
|
|
127
135
|
*
|
|
128
|
-
* Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library.
|
|
129
|
-
*
|
|
130
136
|
* You can create this control either by specifying the HTML tag `<monster-tabs />` directly in the HTML or using
|
|
131
137
|
* Javascript via the `document.createElement('monster-tabs');` method.
|
|
132
138
|
*
|
|
@@ -141,6 +147,12 @@ const resizeObserverSymbol = Symbol("resizeObserver");
|
|
|
141
147
|
* document.createElement('monster-tabs');
|
|
142
148
|
* ```
|
|
143
149
|
*
|
|
150
|
+
* @example <caption>Create a simple tab control</caption>
|
|
151
|
+
* <monster-tabs>
|
|
152
|
+
* <div id="tab1">Tab 1</div>
|
|
153
|
+
* <div id="tab2">Tab 2</div>
|
|
154
|
+
* </monster-tabs>
|
|
155
|
+
*
|
|
144
156
|
* @startuml tabs.png
|
|
145
157
|
* skinparam monochrome true
|
|
146
158
|
* skinparam shadowing false
|
|
@@ -228,14 +240,14 @@ class Tabs extends CustomElement {
|
|
|
228
240
|
/**
|
|
229
241
|
* This method is called internal and should not be called directly.
|
|
230
242
|
*/
|
|
231
|
-
[assembleMethodSymbol]() {
|
|
243
|
+
[assembleMethodSymbol]() {
|
|
232
244
|
super[assembleMethodSymbol]();
|
|
233
245
|
|
|
234
246
|
initControlReferences.call(this);
|
|
235
247
|
|
|
236
248
|
this[dimensionsSymbol] = new Pathfinder({ data: {} });
|
|
237
249
|
// change and remove Tabs
|
|
238
|
-
|
|
250
|
+
initEventHandler.call(this);
|
|
239
251
|
|
|
240
252
|
// setup structure
|
|
241
253
|
initTabButtons.call(this).then(() => {
|
|
@@ -272,7 +284,7 @@ class Tabs extends CustomElement {
|
|
|
272
284
|
connectedCallback() {
|
|
273
285
|
super.connectedCallback();
|
|
274
286
|
|
|
275
|
-
const document = getDocument()
|
|
287
|
+
const document = getDocument();
|
|
276
288
|
|
|
277
289
|
for (const [, type] of Object.entries(["click", "touch"])) {
|
|
278
290
|
// close on outside ui-events
|
|
@@ -300,8 +312,7 @@ class Tabs extends CustomElement {
|
|
|
300
312
|
/**
|
|
301
313
|
* @private
|
|
302
314
|
*/
|
|
303
|
-
function initPopperSwitch() {
|
|
304
|
-
|
|
315
|
+
function initPopperSwitch() {
|
|
305
316
|
const nodes = getSlottedElements.call(this, `[${ATTRIBUTE_ROLE}="switch"]`); // null ↦ only unnamed slots
|
|
306
317
|
let switchButton;
|
|
307
318
|
if (nodes.size === 0) {
|
|
@@ -337,8 +348,7 @@ function initPopperSwitch() {;
|
|
|
337
348
|
/**
|
|
338
349
|
* @private
|
|
339
350
|
*/
|
|
340
|
-
function hidePopper() {
|
|
341
|
-
|
|
351
|
+
function hidePopper() {
|
|
342
352
|
if (!this[popperInstanceSymbol]) {
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
@@ -351,8 +361,7 @@ function hidePopper() {;
|
|
|
351
361
|
/**
|
|
352
362
|
* @private
|
|
353
363
|
*/
|
|
354
|
-
function showPopper() {
|
|
355
|
-
|
|
364
|
+
function showPopper() {
|
|
356
365
|
if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
|
|
357
366
|
return;
|
|
358
367
|
}
|
|
@@ -366,14 +375,18 @@ function showPopper() {;
|
|
|
366
375
|
|
|
367
376
|
new Processing(() => {
|
|
368
377
|
this[popperElementSymbol].style.removeProperty("visibility");
|
|
369
|
-
})
|
|
378
|
+
})
|
|
379
|
+
.run(undefined)
|
|
380
|
+
.then(() => {})
|
|
381
|
+
.catch((e) => {
|
|
382
|
+
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
|
|
383
|
+
});
|
|
370
384
|
}
|
|
371
385
|
|
|
372
386
|
/**
|
|
373
387
|
* @private
|
|
374
388
|
*/
|
|
375
|
-
function togglePopper() {
|
|
376
|
-
|
|
389
|
+
function togglePopper() {
|
|
377
390
|
if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
|
|
378
391
|
hidePopper.call(this);
|
|
379
392
|
} else {
|
|
@@ -384,8 +397,7 @@ function togglePopper() {;
|
|
|
384
397
|
/**
|
|
385
398
|
* @private
|
|
386
399
|
*/
|
|
387
|
-
function attachResizeObserver() {
|
|
388
|
-
|
|
400
|
+
function attachResizeObserver() {
|
|
389
401
|
// against flickering
|
|
390
402
|
this[resizeObserverSymbol] = new ResizeObserver((entries) => {
|
|
391
403
|
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
|
@@ -409,8 +421,7 @@ function attachResizeObserver() {;
|
|
|
409
421
|
/**
|
|
410
422
|
* @private
|
|
411
423
|
*/
|
|
412
|
-
function attachTabChangeObserver() {
|
|
413
|
-
|
|
424
|
+
function attachTabChangeObserver() {
|
|
414
425
|
// against flickering
|
|
415
426
|
new MutationObserver((mutations) => {
|
|
416
427
|
let runUpdate = false;
|
|
@@ -485,8 +496,7 @@ function initPopper() {
|
|
|
485
496
|
* @private
|
|
486
497
|
* @param {HTMLElement} element
|
|
487
498
|
*/
|
|
488
|
-
function show(element) {
|
|
489
|
-
|
|
499
|
+
function show(element) {
|
|
490
500
|
if (!this.shadowRoot) {
|
|
491
501
|
throw new Error("no shadow-root is defined");
|
|
492
502
|
}
|
|
@@ -496,6 +506,7 @@ function show(element) {;
|
|
|
496
506
|
const nodes = getSlottedElements.call(this);
|
|
497
507
|
for (const node of nodes) {
|
|
498
508
|
const id = node.getAttribute("id");
|
|
509
|
+
|
|
499
510
|
if (id === reference) {
|
|
500
511
|
node.classList.add("active");
|
|
501
512
|
|
|
@@ -510,7 +521,12 @@ function show(element) {;
|
|
|
510
521
|
}
|
|
511
522
|
|
|
512
523
|
const options = this.getOption("fetch", {});
|
|
513
|
-
|
|
524
|
+
const filter = undefined;
|
|
525
|
+
loadAndAssignContent(node, url, options, filter)
|
|
526
|
+
.then(() => {})
|
|
527
|
+
.catch((e) => {
|
|
528
|
+
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
|
|
529
|
+
});
|
|
514
530
|
}
|
|
515
531
|
} else {
|
|
516
532
|
node.classList.remove("active");
|
|
@@ -518,14 +534,14 @@ function show(element) {;
|
|
|
518
534
|
}
|
|
519
535
|
|
|
520
536
|
const standardButtons = this.getOption("buttons.standard");
|
|
521
|
-
for (const
|
|
537
|
+
for (const index in standardButtons) {
|
|
522
538
|
const button = standardButtons[index];
|
|
523
539
|
const state = button["reference"] === reference ? "active" : "inactive";
|
|
524
540
|
this.setOption(`buttons.standard.${index}.state`, state);
|
|
525
541
|
}
|
|
526
542
|
|
|
527
543
|
const popperButton = this.getOption("buttons.popper");
|
|
528
|
-
for (const
|
|
544
|
+
for (const index in popperButton) {
|
|
529
545
|
const button = popperButton[index];
|
|
530
546
|
const state = button["reference"] === reference ? "active" : "inactive";
|
|
531
547
|
this.setOption(`buttons.popper.${index}.state`, state);
|
|
@@ -537,8 +553,7 @@ function show(element) {;
|
|
|
537
553
|
/**
|
|
538
554
|
* @private
|
|
539
555
|
*/
|
|
540
|
-
function
|
|
541
|
-
|
|
556
|
+
function initEventHandler() {
|
|
542
557
|
if (!this.shadowRoot) {
|
|
543
558
|
throw new Error("no shadow-root is defined");
|
|
544
559
|
}
|
|
@@ -653,8 +668,7 @@ function attachTabMutationObserver(observedNode) {
|
|
|
653
668
|
* @return {Select}
|
|
654
669
|
* @throws {Error} no shadow-root is defined
|
|
655
670
|
*/
|
|
656
|
-
function initControlReferences() {
|
|
657
|
-
|
|
671
|
+
function initControlReferences() {
|
|
658
672
|
if (!this.shadowRoot) {
|
|
659
673
|
throw new Error("no shadow-root is defined");
|
|
660
674
|
}
|
|
@@ -679,8 +693,7 @@ function initControlReferences() {;
|
|
|
679
693
|
* @throws {Error} no shadow-root is defined
|
|
680
694
|
*
|
|
681
695
|
*/
|
|
682
|
-
function initTabButtons() {
|
|
683
|
-
|
|
696
|
+
function initTabButtons() {
|
|
684
697
|
if (!this.shadowRoot) {
|
|
685
698
|
throw new Error("no shadow-root is defined");
|
|
686
699
|
}
|
|
@@ -758,15 +771,19 @@ function initTabButtons() {;
|
|
|
758
771
|
if (button instanceof HTMLButtonElement && button.disabled !== true) {
|
|
759
772
|
show.call(this, button);
|
|
760
773
|
}
|
|
761
|
-
})
|
|
774
|
+
})
|
|
775
|
+
.run(undefined)
|
|
776
|
+
.then(() => {})
|
|
777
|
+
.catch((e) => {
|
|
778
|
+
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
|
|
779
|
+
});
|
|
762
780
|
}
|
|
763
781
|
|
|
764
|
-
return;
|
|
782
|
+
return Promise.resolve();
|
|
765
783
|
});
|
|
766
784
|
}
|
|
767
785
|
|
|
768
|
-
function checkAndRearrangeButtons() {
|
|
769
|
-
|
|
786
|
+
function checkAndRearrangeButtons() {
|
|
770
787
|
if (this[dimensionsSymbol].getVia("data.calculated", false) !== true) {
|
|
771
788
|
calculateNavigationButtonsDimensions.call(this);
|
|
772
789
|
}
|
|
@@ -806,7 +823,7 @@ function adjustButtonVisibility() {
|
|
|
806
823
|
|
|
807
824
|
/**
|
|
808
825
|
* @private
|
|
809
|
-
* @param
|
|
826
|
+
* @param {string} value
|
|
810
827
|
* @return {number}
|
|
811
828
|
*/
|
|
812
829
|
function getDimValue(value) {
|
|
@@ -847,8 +864,7 @@ function calcBoxWidth(node) {
|
|
|
847
864
|
* @private
|
|
848
865
|
* @return {Object}
|
|
849
866
|
*/
|
|
850
|
-
function rearrangeButtons() {
|
|
851
|
-
|
|
867
|
+
function rearrangeButtons() {
|
|
852
868
|
const standardButtons = [];
|
|
853
869
|
const popperButtons = [];
|
|
854
870
|
|
|
@@ -884,8 +900,7 @@ function rearrangeButtons() {;
|
|
|
884
900
|
* @private
|
|
885
901
|
* @return {Object}
|
|
886
902
|
*/
|
|
887
|
-
function calculateNavigationButtonsDimensions() {
|
|
888
|
-
|
|
903
|
+
function calculateNavigationButtonsDimensions() {
|
|
889
904
|
const width = this[navElementSymbol].getBoundingClientRect().width;
|
|
890
905
|
|
|
891
906
|
let startEndWidth = 0;
|
|
@@ -901,9 +916,9 @@ function calculateNavigationButtonsDimensions() {;
|
|
|
901
916
|
this[dimensionsSymbol].setVia("data.space", width - startEndWidth - 2);
|
|
902
917
|
this[dimensionsSymbol].setVia("data.visible", !(width === 0));
|
|
903
918
|
|
|
904
|
-
const buttons = this
|
|
905
|
-
.getOption("buttons.
|
|
906
|
-
|
|
919
|
+
const buttons = this.getOption("buttons.standard").concat(
|
|
920
|
+
this.getOption("buttons.popper"),
|
|
921
|
+
);
|
|
907
922
|
|
|
908
923
|
for (const [i, button] of buttons.entries()) {
|
|
909
924
|
const ref = button?.reference;
|
|
@@ -937,8 +952,7 @@ function calculateNavigationButtonsDimensions() {;
|
|
|
937
952
|
* @param {HTMLElement} node
|
|
938
953
|
* @return {string}
|
|
939
954
|
*/
|
|
940
|
-
function getButtonLabel(node) {
|
|
941
|
-
|
|
955
|
+
function getButtonLabel(node) {
|
|
942
956
|
let label;
|
|
943
957
|
let setLabel = false;
|
|
944
958
|
if (node.hasAttribute(ATTRIBUTE_BUTTON_LABEL)) {
|
|
@@ -133,7 +133,7 @@ class Template extends CustomElement {
|
|
|
133
133
|
/**
|
|
134
134
|
*
|
|
135
135
|
*/
|
|
136
|
-
[initMethodSymbol]() {
|
|
136
|
+
[initMethodSymbol]() {
|
|
137
137
|
super[initMethodSymbol]();
|
|
138
138
|
|
|
139
139
|
// data-monster-options
|
|
@@ -158,7 +158,7 @@ class Template extends CustomElement {
|
|
|
158
158
|
* @fires Monster.Components.Form.event:monster-fetched
|
|
159
159
|
* @return {Monster.Components.Form.Form}
|
|
160
160
|
*/
|
|
161
|
-
[assembleMethodSymbol]() {
|
|
161
|
+
[assembleMethodSymbol]() {
|
|
162
162
|
super[assembleMethodSymbol]();
|
|
163
163
|
initIntersectionObserver.call(this);
|
|
164
164
|
}
|
|
@@ -216,7 +216,7 @@ class Template extends CustomElement {
|
|
|
216
216
|
* @private
|
|
217
217
|
* @return {object}
|
|
218
218
|
*/
|
|
219
|
-
function initOptionsFromArguments() {
|
|
219
|
+
function initOptionsFromArguments() {
|
|
220
220
|
const options = {};
|
|
221
221
|
|
|
222
222
|
const url = this.getAttribute(ATTRIBUTE_FORM_URL);
|
|
@@ -243,8 +243,7 @@ function initOptionsFromArguments() {;
|
|
|
243
243
|
* @throws {Error} undefined status or type
|
|
244
244
|
* @fires Monster.Components.Form.event:monster-fetched
|
|
245
245
|
*/
|
|
246
|
-
function initIntersectionObserver() {
|
|
247
|
-
|
|
246
|
+
function initIntersectionObserver() {
|
|
248
247
|
if (this[intersectionObserverWasInitialized] === true) {
|
|
249
248
|
return;
|
|
250
249
|
}
|
|
@@ -290,8 +289,7 @@ function initIntersectionObserver() {;
|
|
|
290
289
|
* @throws {TypeError} value is not a string
|
|
291
290
|
* @fires Monster.Components.Form.event:monster-fetched
|
|
292
291
|
*/
|
|
293
|
-
function loadContent() {
|
|
294
|
-
|
|
292
|
+
function loadContent() {
|
|
295
293
|
if (!this.shadowRoot) {
|
|
296
294
|
throw new Error("no shadow-root is defined");
|
|
297
295
|
}
|
|
@@ -334,8 +332,7 @@ function loadContent() {;
|
|
|
334
332
|
* @private
|
|
335
333
|
* @return {runProcessors}
|
|
336
334
|
*/
|
|
337
|
-
function runProcessors() {
|
|
338
|
-
|
|
335
|
+
function runProcessors() {
|
|
339
336
|
const processors = this.getOption("processors");
|
|
340
337
|
if (!isArray(processors)) return;
|
|
341
338
|
|
|
@@ -151,8 +151,7 @@ class TreeSelect extends Select {
|
|
|
151
151
|
* @return {Select}
|
|
152
152
|
* @throws {Error} map is not iterable
|
|
153
153
|
*/
|
|
154
|
-
importOptions(data) {
|
|
155
|
-
|
|
154
|
+
importOptions(data) {
|
|
156
155
|
this[internalNodesSymbol] = new Map();
|
|
157
156
|
|
|
158
157
|
const mappingOptions = this.getOption("mapping", {});
|
|
@@ -214,8 +213,7 @@ class TreeSelect extends Select {
|
|
|
214
213
|
* @private
|
|
215
214
|
* @param event
|
|
216
215
|
*/
|
|
217
|
-
function handleOptionKeyboardEvents(event) {
|
|
218
|
-
|
|
216
|
+
function handleOptionKeyboardEvents(event) {
|
|
219
217
|
switch (event?.["code"]) {
|
|
220
218
|
case "ArrowLeft":
|
|
221
219
|
closeOrOpenCurrentOption.call(this, event, "close");
|
|
@@ -260,7 +258,7 @@ function closeOrOpenCurrentOption(event, mode) {
|
|
|
260
258
|
* @memberOf Monster.Components.Form
|
|
261
259
|
* @private
|
|
262
260
|
*/
|
|
263
|
-
function formatKeyLabel(node) {
|
|
261
|
+
function formatKeyLabel(node) {
|
|
264
262
|
validateInstance(node, Node);
|
|
265
263
|
|
|
266
264
|
const label = new Formatter(node.value).format(
|
|
@@ -281,7 +279,7 @@ function formatKeyLabel(node) {;
|
|
|
281
279
|
* @param {string} value
|
|
282
280
|
* @return {Array}
|
|
283
281
|
*/
|
|
284
|
-
function buildTreeLabels(value) {
|
|
282
|
+
function buildTreeLabels(value) {
|
|
285
283
|
let node = this[internalNodesSymbol].get(value);
|
|
286
284
|
if (node === undefined) {
|
|
287
285
|
node = this[internalNodesSymbol].get(parseInt(value));
|
|
@@ -316,7 +314,7 @@ function buildTreeLabels(value) {;
|
|
|
316
314
|
* @return {string}
|
|
317
315
|
* @memberOf Monster.Components.Form
|
|
318
316
|
*/
|
|
319
|
-
function formatHierarchicalSelection(value) {
|
|
317
|
+
function formatHierarchicalSelection(value) {
|
|
320
318
|
return buildTreeLabels
|
|
321
319
|
.call(this, value)
|
|
322
320
|
.join(this.getOption("formatter.separator", " / "));
|
|
@@ -332,8 +330,7 @@ const openOptionEventHandler = Symbol("openOptionEventHandler");
|
|
|
332
330
|
* @private
|
|
333
331
|
* @throws {Error} no shadow-root is defined
|
|
334
332
|
*/
|
|
335
|
-
function initEventhandler() {
|
|
336
|
-
|
|
333
|
+
function initEventhandler() {
|
|
337
334
|
if (!this.shadowRoot) {
|
|
338
335
|
throw new Error("no shadow-root is defined");
|
|
339
336
|
}
|
|
@@ -439,7 +436,7 @@ function initEventhandler() {;
|
|
|
439
436
|
* @private
|
|
440
437
|
* @return {object}
|
|
441
438
|
*/
|
|
442
|
-
function initOptionsFromArguments() {
|
|
439
|
+
function initOptionsFromArguments() {
|
|
443
440
|
const options = {};
|
|
444
441
|
|
|
445
442
|
const url = this.getAttribute(ATTRIBUTE_FORM_URL);
|
|
@@ -22,8 +22,7 @@ const popperInstanceSymbol = Symbol("popperInstance");
|
|
|
22
22
|
* @this {CustomElement}
|
|
23
23
|
* @param {Boolean} mode
|
|
24
24
|
*/
|
|
25
|
-
function setEventListenersModifiers(mode) {
|
|
26
|
-
|
|
25
|
+
function setEventListenersModifiers(mode) {
|
|
27
26
|
const options = extend({}, this.getOption("popper"));
|
|
28
27
|
const modifiers = options?.["modifiers"];
|
|
29
28
|
|
|
@@ -127,7 +127,7 @@ class CallButton extends CustomElement {
|
|
|
127
127
|
*
|
|
128
128
|
* @return {CallButton}
|
|
129
129
|
*/
|
|
130
|
-
[assembleMethodSymbol]() {
|
|
130
|
+
[assembleMethodSymbol]() {
|
|
131
131
|
super[assembleMethodSymbol]();
|
|
132
132
|
|
|
133
133
|
initControlReferences.call(this);
|
|
@@ -146,8 +146,7 @@ class CallButton extends CustomElement {
|
|
|
146
146
|
* @private
|
|
147
147
|
* @return {CallButton}
|
|
148
148
|
*/
|
|
149
|
-
function initControlReferences() {
|
|
150
|
-
|
|
149
|
+
function initControlReferences() {
|
|
151
150
|
if (!this.shadowRoot) {
|
|
152
151
|
throw new Error("no shadow-root is defined");
|
|
153
152
|
}
|
|
@@ -164,7 +163,7 @@ function initControlReferences() {;
|
|
|
164
163
|
* @throws {TypeError} incorrect arguments passed for the datasource
|
|
165
164
|
* @throws {Error} the datasource could not be initialized
|
|
166
165
|
*/
|
|
167
|
-
function initOptionsFromArguments() {
|
|
166
|
+
function initOptionsFromArguments() {
|
|
168
167
|
const options = {};
|
|
169
168
|
const value = this.getAttribute(ATTRIBUTE_REFERENCE);
|
|
170
169
|
if (value) {
|
|
@@ -191,8 +190,7 @@ function initOptionsFromArguments() {;
|
|
|
191
190
|
* @private
|
|
192
191
|
* @throws {Error} The option references.callableSelector must be an array
|
|
193
192
|
*/
|
|
194
|
-
function initEventHandler() {
|
|
195
|
-
|
|
193
|
+
function initEventHandler() {
|
|
196
194
|
const doc = getDocument();
|
|
197
195
|
|
|
198
196
|
this[callButtonElementSymbol].addEventListener("click", (event) => {
|
|
@@ -195,7 +195,7 @@ class Collapse extends CustomElement {
|
|
|
195
195
|
*
|
|
196
196
|
* @returns {Monster.Components.Host.Collapse}
|
|
197
197
|
*/
|
|
198
|
-
toggle() {
|
|
198
|
+
toggle() {
|
|
199
199
|
if (this[detailsElementSymbol].classList.contains("active")) {
|
|
200
200
|
this.close();
|
|
201
201
|
} else {
|
|
@@ -227,7 +227,7 @@ class Collapse extends CustomElement {
|
|
|
227
227
|
* @fires Monster.Components.Host.Collapse.event:monster-collapse-open
|
|
228
228
|
*/
|
|
229
229
|
open() {
|
|
230
|
-
let node
|
|
230
|
+
let node;
|
|
231
231
|
if (this[detailsElementSymbol].classList.contains("active")) {
|
|
232
232
|
return this;
|
|
233
233
|
}
|
|
@@ -270,7 +270,7 @@ class Collapse extends CustomElement {
|
|
|
270
270
|
* @fires Monster.Components.Host.Collapse.event:monster-collapse-before-close
|
|
271
271
|
* @fires Monster.Components.Host.Collapse.event:monster-collapse-closed
|
|
272
272
|
*/
|
|
273
|
-
close() {
|
|
273
|
+
close() {
|
|
274
274
|
if (!this[detailsElementSymbol].classList.contains("active")) {
|
|
275
275
|
return this;
|
|
276
276
|
}
|
|
@@ -309,14 +309,13 @@ class Collapse extends CustomElement {
|
|
|
309
309
|
* @return {Monster.Components.Host.Collapse}
|
|
310
310
|
* @fires Monster.Components.Host.Collapse.event:monster-collapse-adjust-height
|
|
311
311
|
*/
|
|
312
|
-
adjustHeight() {
|
|
312
|
+
adjustHeight() {
|
|
313
313
|
adjustHeight.call(this);
|
|
314
314
|
return this;
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
function adjustHeight() {
|
|
319
|
-
|
|
318
|
+
function adjustHeight() {
|
|
320
319
|
let height = 0;
|
|
321
320
|
|
|
322
321
|
if (this[detailsContainerElementSymbol]) {
|
|
@@ -344,8 +343,7 @@ function adjustHeight() {;
|
|
|
344
343
|
fireCustomEvent(this, "monster-" + this[nameSymbol] + "-adjust-height", {});
|
|
345
344
|
}
|
|
346
345
|
|
|
347
|
-
function updateResizeObserverObservation() {
|
|
348
|
-
|
|
346
|
+
function updateResizeObserverObservation() {
|
|
349
347
|
this[resizeObserverSymbol].disconnect();
|
|
350
348
|
|
|
351
349
|
const slottedNodes = getSlottedElements.call(this);
|
|
@@ -363,8 +361,7 @@ function updateResizeObserverObservation() {;
|
|
|
363
361
|
/**
|
|
364
362
|
* @private
|
|
365
363
|
*/
|
|
366
|
-
function initEventHandler() {
|
|
367
|
-
|
|
364
|
+
function initEventHandler() {
|
|
368
365
|
if (!this.shadowRoot) {
|
|
369
366
|
throw new Error("no shadow-root is defined");
|
|
370
367
|
}
|
|
@@ -373,8 +370,7 @@ function initEventHandler() {;
|
|
|
373
370
|
return this;
|
|
374
371
|
}
|
|
375
372
|
|
|
376
|
-
function initSlotChangedHandler() {
|
|
377
|
-
|
|
373
|
+
function initSlotChangedHandler() {
|
|
378
374
|
this[detailsSlotElementSymbol].addEventListener("slotchange", () => {
|
|
379
375
|
updateResizeObserverObservation.call(this);
|
|
380
376
|
});
|
|
@@ -385,8 +381,7 @@ function initSlotChangedHandler() {;
|
|
|
385
381
|
* @return {Select}
|
|
386
382
|
* @throws {Error} no shadow-root is defined
|
|
387
383
|
*/
|
|
388
|
-
function initControlReferences() {
|
|
389
|
-
|
|
384
|
+
function initControlReferences() {
|
|
390
385
|
if (!this.shadowRoot) {
|
|
391
386
|
throw new Error("no shadow-root is defined");
|
|
392
387
|
}
|
|
@@ -410,15 +405,14 @@ function initControlReferences() {;
|
|
|
410
405
|
* @private
|
|
411
406
|
* @returns {string}
|
|
412
407
|
*/
|
|
413
|
-
function getConfigKey() {
|
|
408
|
+
function getConfigKey() {
|
|
414
409
|
return generateUniqueConfigKey(this[nameSymbol], this.id, "state");
|
|
415
410
|
}
|
|
416
411
|
|
|
417
412
|
/**
|
|
418
413
|
* @private
|
|
419
414
|
*/
|
|
420
|
-
function updateStateConfig() {
|
|
421
|
-
|
|
415
|
+
function updateStateConfig() {
|
|
422
416
|
if (!this.getOption("features.persistState")) {
|
|
423
417
|
return;
|
|
424
418
|
}
|
|
@@ -446,8 +440,7 @@ function updateStateConfig() {;
|
|
|
446
440
|
* @private
|
|
447
441
|
* @returns {Promise}
|
|
448
442
|
*/
|
|
449
|
-
function initStateFromHostConfig() {
|
|
450
|
-
|
|
443
|
+
function initStateFromHostConfig() {
|
|
451
444
|
if (!this.getOption("features.persistState")) {
|
|
452
445
|
return Promise.resolve({});
|
|
453
446
|
}
|
|
@@ -482,8 +475,7 @@ function initStateFromHostConfig() {;
|
|
|
482
475
|
/**
|
|
483
476
|
* @private
|
|
484
477
|
*/
|
|
485
|
-
function initResizeObserver() {
|
|
486
|
-
|
|
478
|
+
function initResizeObserver() {
|
|
487
479
|
// against flickering
|
|
488
480
|
this[resizeObserverSymbol] = new ResizeObserver((entries) => {
|
|
489
481
|
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
|
@@ -501,7 +493,7 @@ function initResizeObserver() {;
|
|
|
501
493
|
});
|
|
502
494
|
}
|
|
503
495
|
|
|
504
|
-
function checkAndRearrangeContent() {
|
|
496
|
+
function checkAndRearrangeContent() {
|
|
505
497
|
this.adjustHeight();
|
|
506
498
|
}
|
|
507
499
|
|
|
@@ -135,8 +135,7 @@ class ConfigManager extends CustomElement {
|
|
|
135
135
|
* @param {string} key
|
|
136
136
|
* @returns {Promise<unknown>}
|
|
137
137
|
*/
|
|
138
|
-
getConfig(key) {
|
|
139
|
-
|
|
138
|
+
getConfig(key) {
|
|
140
139
|
return this.ready().then(() => {
|
|
141
140
|
return getBlob.call(this, key);
|
|
142
141
|
});
|
|
@@ -147,7 +146,7 @@ class ConfigManager extends CustomElement {
|
|
|
147
146
|
* @param {*} value
|
|
148
147
|
* @returns {Promise<unknown>}
|
|
149
148
|
*/
|
|
150
|
-
setConfig(key, value) {
|
|
149
|
+
setConfig(key, value) {
|
|
151
150
|
return this.ready().then(() => {
|
|
152
151
|
return setBlob.call(this, key, value);
|
|
153
152
|
});
|
|
@@ -177,7 +176,7 @@ class ConfigManager extends CustomElement {
|
|
|
177
176
|
}
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
function openDatabase() {
|
|
179
|
+
function openDatabase() {
|
|
181
180
|
const window = getWindow();
|
|
182
181
|
|
|
183
182
|
const name = this.getOption("indexDB.name");
|
|
@@ -221,7 +220,7 @@ function openDatabase() {;
|
|
|
221
220
|
/**
|
|
222
221
|
* @param {string} mode either "readonly" or "readwrite"
|
|
223
222
|
*/
|
|
224
|
-
function getObjectStore(mode) {
|
|
223
|
+
function getObjectStore(mode) {
|
|
225
224
|
const storageName = this.getOption("indexDB.objectStore.name");
|
|
226
225
|
|
|
227
226
|
if (!this[indexDBInstanceSymbol]) {
|
|
@@ -238,8 +237,7 @@ function getObjectStore(mode) {;
|
|
|
238
237
|
* @param {string} key
|
|
239
238
|
* @returns {Promise<unknown>}
|
|
240
239
|
*/
|
|
241
|
-
function clearObjectStore() {
|
|
242
|
-
|
|
240
|
+
function clearObjectStore() {
|
|
243
241
|
const store = getObjectStore.call(this, "readwrite");
|
|
244
242
|
|
|
245
243
|
return new Promise((resolve, reject) => {
|
|
@@ -255,7 +253,7 @@ function clearObjectStore() {;
|
|
|
255
253
|
});
|
|
256
254
|
}
|
|
257
255
|
|
|
258
|
-
function getBlob(key) {
|
|
256
|
+
function getBlob(key) {
|
|
259
257
|
const store = getObjectStore.call(this, MODE_READONLY);
|
|
260
258
|
|
|
261
259
|
const req = store.get(key);
|
|
@@ -272,7 +270,7 @@ function getBlob(key) {;
|
|
|
272
270
|
});
|
|
273
271
|
}
|
|
274
272
|
|
|
275
|
-
function setBlob(key, blob) {
|
|
273
|
+
function setBlob(key, blob) {
|
|
276
274
|
const store = getObjectStore.call(this, MODE_READ_WRITE);
|
|
277
275
|
|
|
278
276
|
const KeyPath = this.getOption("indexDB.objectStore.keyPath");
|
|
@@ -131,7 +131,7 @@ class Details extends Collapse {
|
|
|
131
131
|
initEventHandler.call(this);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
connectedCallback() {
|
|
134
|
+
connectedCallback() {
|
|
135
135
|
super.connectedCallback();
|
|
136
136
|
|
|
137
137
|
const containDocument = this.shadowRoot;
|
|
@@ -167,8 +167,7 @@ class Details extends Collapse {
|
|
|
167
167
|
* @return {Select}
|
|
168
168
|
* @throws {Error} no shadow-root is defined
|
|
169
169
|
*/
|
|
170
|
-
function initControlReferences() {
|
|
171
|
-
|
|
170
|
+
function initControlReferences() {
|
|
172
171
|
if (!this.shadowRoot) {
|
|
173
172
|
throw new Error("no shadow-root is defined");
|
|
174
173
|
}
|
|
@@ -181,8 +180,7 @@ function initControlReferences() {;
|
|
|
181
180
|
/**
|
|
182
181
|
* @private
|
|
183
182
|
*/
|
|
184
|
-
function initEventHandler() {
|
|
185
|
-
|
|
183
|
+
function initEventHandler() {
|
|
186
184
|
if (!this.shadowRoot) {
|
|
187
185
|
throw new Error("no shadow-root is defined");
|
|
188
186
|
}
|
|
@@ -203,8 +201,7 @@ function initEventHandler() {;
|
|
|
203
201
|
* @private
|
|
204
202
|
* @return {string}
|
|
205
203
|
*/
|
|
206
|
-
function initButtonLabel() {
|
|
207
|
-
|
|
204
|
+
function initButtonLabel() {
|
|
208
205
|
let label;
|
|
209
206
|
const setLabel = false;
|
|
210
207
|
if (this.hasAttribute(ATTRIBUTE_BUTTON_LABEL)) {
|
|
@@ -237,7 +234,7 @@ function initButtonLabel() {;
|
|
|
237
234
|
* @private
|
|
238
235
|
* @returns {string}
|
|
239
236
|
*/
|
|
240
|
-
function getConfigKey() {
|
|
237
|
+
function getConfigKey() {
|
|
241
238
|
return generateUniqueConfigKey("details", this.id, "state");
|
|
242
239
|
}
|
|
243
240
|
|