@schukai/monster 3.52.1 → 3.53.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +13 -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 +42 -74
- 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
@@ -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,
|
@@ -138,7 +146,7 @@ const resizeObserverSymbol = Symbol("resizeObserver");
|
|
138
146
|
* import {Tabs} from '@schukai/component-form/source/tab.js';
|
139
147
|
* document.createElement('monster-tabs');
|
140
148
|
* ```
|
141
|
-
*
|
149
|
+
*
|
142
150
|
* @example <caption>Create a simple tab control</caption>
|
143
151
|
* <monster-tabs>
|
144
152
|
* <div id="tab1">Tab 1</div>
|
@@ -232,7 +240,7 @@ class Tabs extends CustomElement {
|
|
232
240
|
/**
|
233
241
|
* This method is called internal and should not be called directly.
|
234
242
|
*/
|
235
|
-
[assembleMethodSymbol]() {
|
243
|
+
[assembleMethodSymbol]() {
|
236
244
|
super[assembleMethodSymbol]();
|
237
245
|
|
238
246
|
initControlReferences.call(this);
|
@@ -276,7 +284,7 @@ class Tabs extends CustomElement {
|
|
276
284
|
connectedCallback() {
|
277
285
|
super.connectedCallback();
|
278
286
|
|
279
|
-
const document = getDocument()
|
287
|
+
const document = getDocument();
|
280
288
|
|
281
289
|
for (const [, type] of Object.entries(["click", "touch"])) {
|
282
290
|
// close on outside ui-events
|
@@ -304,8 +312,7 @@ class Tabs extends CustomElement {
|
|
304
312
|
/**
|
305
313
|
* @private
|
306
314
|
*/
|
307
|
-
function initPopperSwitch() {
|
308
|
-
|
315
|
+
function initPopperSwitch() {
|
309
316
|
const nodes = getSlottedElements.call(this, `[${ATTRIBUTE_ROLE}="switch"]`); // null ↦ only unnamed slots
|
310
317
|
let switchButton;
|
311
318
|
if (nodes.size === 0) {
|
@@ -342,7 +349,6 @@ function initPopperSwitch() {;
|
|
342
349
|
* @private
|
343
350
|
*/
|
344
351
|
function hidePopper() {
|
345
|
-
|
346
352
|
if (!this[popperInstanceSymbol]) {
|
347
353
|
return;
|
348
354
|
}
|
@@ -356,7 +362,6 @@ function hidePopper() {
|
|
356
362
|
* @private
|
357
363
|
*/
|
358
364
|
function showPopper() {
|
359
|
-
|
360
365
|
if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
|
361
366
|
return;
|
362
367
|
}
|
@@ -370,18 +375,18 @@ function showPopper() {
|
|
370
375
|
|
371
376
|
new Processing(() => {
|
372
377
|
this[popperElementSymbol].style.removeProperty("visibility");
|
373
|
-
})
|
374
|
-
()
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
+
})
|
379
|
+
.run(undefined)
|
380
|
+
.then(() => {})
|
381
|
+
.catch((e) => {
|
382
|
+
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
|
383
|
+
});
|
378
384
|
}
|
379
385
|
|
380
386
|
/**
|
381
387
|
* @private
|
382
388
|
*/
|
383
389
|
function togglePopper() {
|
384
|
-
|
385
390
|
if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
|
386
391
|
hidePopper.call(this);
|
387
392
|
} else {
|
@@ -393,7 +398,6 @@ function togglePopper() {
|
|
393
398
|
* @private
|
394
399
|
*/
|
395
400
|
function attachResizeObserver() {
|
396
|
-
|
397
401
|
// against flickering
|
398
402
|
this[resizeObserverSymbol] = new ResizeObserver((entries) => {
|
399
403
|
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
@@ -418,7 +422,6 @@ function attachResizeObserver() {
|
|
418
422
|
* @private
|
419
423
|
*/
|
420
424
|
function attachTabChangeObserver() {
|
421
|
-
|
422
425
|
// against flickering
|
423
426
|
new MutationObserver((mutations) => {
|
424
427
|
let runUpdate = false;
|
@@ -494,7 +497,6 @@ function initPopper() {
|
|
494
497
|
* @param {HTMLElement} element
|
495
498
|
*/
|
496
499
|
function show(element) {
|
497
|
-
|
498
500
|
if (!this.shadowRoot) {
|
499
501
|
throw new Error("no shadow-root is defined");
|
500
502
|
}
|
@@ -504,7 +506,7 @@ function show(element) {
|
|
504
506
|
const nodes = getSlottedElements.call(this);
|
505
507
|
for (const node of nodes) {
|
506
508
|
const id = node.getAttribute("id");
|
507
|
-
|
509
|
+
|
508
510
|
if (id === reference) {
|
509
511
|
node.classList.add("active");
|
510
512
|
|
@@ -520,11 +522,11 @@ function show(element) {
|
|
520
522
|
|
521
523
|
const options = this.getOption("fetch", {});
|
522
524
|
const filter = undefined;
|
523
|
-
loadAndAssignContent(node, url, options,filter)
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
525
|
+
loadAndAssignContent(node, url, options, filter)
|
526
|
+
.then(() => {})
|
527
|
+
.catch((e) => {
|
528
|
+
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
|
529
|
+
});
|
528
530
|
}
|
529
531
|
} else {
|
530
532
|
node.classList.remove("active");
|
@@ -552,7 +554,6 @@ function show(element) {
|
|
552
554
|
* @private
|
553
555
|
*/
|
554
556
|
function initEventHandler() {
|
555
|
-
|
556
557
|
if (!this.shadowRoot) {
|
557
558
|
throw new Error("no shadow-root is defined");
|
558
559
|
}
|
@@ -667,8 +668,7 @@ function attachTabMutationObserver(observedNode) {
|
|
667
668
|
* @return {Select}
|
668
669
|
* @throws {Error} no shadow-root is defined
|
669
670
|
*/
|
670
|
-
function initControlReferences() {
|
671
|
-
|
671
|
+
function initControlReferences() {
|
672
672
|
if (!this.shadowRoot) {
|
673
673
|
throw new Error("no shadow-root is defined");
|
674
674
|
}
|
@@ -693,8 +693,7 @@ function initControlReferences() {;
|
|
693
693
|
* @throws {Error} no shadow-root is defined
|
694
694
|
*
|
695
695
|
*/
|
696
|
-
function initTabButtons() {
|
697
|
-
|
696
|
+
function initTabButtons() {
|
698
697
|
if (!this.shadowRoot) {
|
699
698
|
throw new Error("no shadow-root is defined");
|
700
699
|
}
|
@@ -772,19 +771,19 @@ function initTabButtons() {;
|
|
772
771
|
if (button instanceof HTMLButtonElement && button.disabled !== true) {
|
773
772
|
show.call(this, button);
|
774
773
|
}
|
775
|
-
})
|
776
|
-
()
|
777
|
-
|
778
|
-
|
779
|
-
|
774
|
+
})
|
775
|
+
.run(undefined)
|
776
|
+
.then(() => {})
|
777
|
+
.catch((e) => {
|
778
|
+
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
|
779
|
+
});
|
780
780
|
}
|
781
781
|
|
782
782
|
return Promise.resolve();
|
783
783
|
});
|
784
784
|
}
|
785
785
|
|
786
|
-
function checkAndRearrangeButtons() {
|
787
|
-
|
786
|
+
function checkAndRearrangeButtons() {
|
788
787
|
if (this[dimensionsSymbol].getVia("data.calculated", false) !== true) {
|
789
788
|
calculateNavigationButtonsDimensions.call(this);
|
790
789
|
}
|
@@ -865,8 +864,7 @@ function calcBoxWidth(node) {
|
|
865
864
|
* @private
|
866
865
|
* @return {Object}
|
867
866
|
*/
|
868
|
-
function rearrangeButtons() {
|
869
|
-
|
867
|
+
function rearrangeButtons() {
|
870
868
|
const standardButtons = [];
|
871
869
|
const popperButtons = [];
|
872
870
|
|
@@ -902,8 +900,7 @@ function rearrangeButtons() {;
|
|
902
900
|
* @private
|
903
901
|
* @return {Object}
|
904
902
|
*/
|
905
|
-
function calculateNavigationButtonsDimensions() {
|
906
|
-
|
903
|
+
function calculateNavigationButtonsDimensions() {
|
907
904
|
const width = this[navElementSymbol].getBoundingClientRect().width;
|
908
905
|
|
909
906
|
let startEndWidth = 0;
|
@@ -919,9 +916,9 @@ function calculateNavigationButtonsDimensions() {;
|
|
919
916
|
this[dimensionsSymbol].setVia("data.space", width - startEndWidth - 2);
|
920
917
|
this[dimensionsSymbol].setVia("data.visible", !(width === 0));
|
921
918
|
|
922
|
-
const buttons = this
|
923
|
-
.getOption("buttons.
|
924
|
-
|
919
|
+
const buttons = this.getOption("buttons.standard").concat(
|
920
|
+
this.getOption("buttons.popper"),
|
921
|
+
);
|
925
922
|
|
926
923
|
for (const [i, button] of buttons.entries()) {
|
927
924
|
const ref = button?.reference;
|
@@ -955,8 +952,7 @@ function calculateNavigationButtonsDimensions() {;
|
|
955
952
|
* @param {HTMLElement} node
|
956
953
|
* @return {string}
|
957
954
|
*/
|
958
|
-
function getButtonLabel(node) {
|
959
|
-
|
955
|
+
function getButtonLabel(node) {
|
960
956
|
let label;
|
961
957
|
let setLabel = false;
|
962
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
|
|