@schukai/monster 3.71.2 → 3.72.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 +26 -0
- package/package.json +1 -1
- package/source/components/datatable/dataset.mjs +272 -272
- package/source/components/datatable/datasource/dom.mjs +1 -1
- package/source/components/datatable/datasource/rest.mjs +408 -410
- package/source/components/datatable/filter.mjs +0 -1
- package/source/components/datatable/style/datatable.pcss +7 -5
- package/source/components/datatable/style/embedded-pagination.pcss +1 -1
- package/source/components/datatable/style/pagination.pcss +1 -1
- package/source/components/datatable/stylesheet/change-button.mjs +2 -4
- package/source/components/datatable/stylesheet/column-bar.mjs +2 -4
- package/source/components/datatable/stylesheet/dataset.mjs +2 -4
- package/source/components/datatable/stylesheet/datasource.mjs +1 -3
- package/source/components/datatable/stylesheet/datatable.mjs +2 -4
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
- package/source/components/datatable/stylesheet/filter-button.mjs +1 -3
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +14 -7
- package/source/components/datatable/stylesheet/filter-date-range.mjs +1 -3
- package/source/components/datatable/stylesheet/filter-range.mjs +1 -3
- package/source/components/datatable/stylesheet/filter.mjs +2 -4
- package/source/components/datatable/stylesheet/pagination.mjs +2 -4
- package/source/components/datatable/stylesheet/save-button.mjs +2 -4
- package/source/components/datatable/stylesheet/select-filter.mjs +2 -4
- package/source/components/datatable/stylesheet/status.mjs +2 -4
- package/source/components/form/context-error.mjs +0 -2
- package/source/components/form/context-help.mjs +1 -2
- package/source/components/form/field-set.mjs +219 -219
- package/source/components/form/form.mjs +137 -187
- package/source/components/form/reload.mjs +211 -211
- package/source/components/form/select.mjs +12 -13
- package/source/components/form/style/field-set.pcss +2 -2
- package/source/components/form/style/form.pcss +8 -0
- package/source/components/form/stylesheet/action-button.mjs +2 -4
- package/source/components/form/stylesheet/api-button.mjs +1 -3
- package/source/components/form/stylesheet/button-bar.mjs +2 -4
- package/source/components/form/stylesheet/button.mjs +2 -4
- package/source/components/form/stylesheet/confirm-button.mjs +2 -4
- package/source/components/form/stylesheet/context-error.mjs +2 -4
- package/source/components/form/stylesheet/context-help.mjs +2 -4
- package/source/components/form/stylesheet/field-set.mjs +14 -7
- package/source/components/form/stylesheet/form.mjs +1 -1
- package/source/components/form/stylesheet/message-state-button.mjs +1 -3
- package/source/components/form/stylesheet/popper-button.mjs +2 -4
- package/source/components/form/stylesheet/select.mjs +14 -7
- package/source/components/form/stylesheet/state-button.mjs +2 -4
- package/source/components/form/stylesheet/tree-select.mjs +1 -3
- package/source/components/host/stylesheet/call-button.mjs +2 -4
- package/source/components/host/stylesheet/config-manager.mjs +1 -3
- package/source/components/host/stylesheet/host.mjs +2 -4
- package/source/components/host/stylesheet/overlay.mjs +2 -4
- package/source/components/host/stylesheet/toggle-button.mjs +2 -4
- package/source/components/host/stylesheet/viewer.mjs +2 -4
- package/source/components/layout/style/collapse.pcss +2 -2
- package/source/components/layout/style/details.pcss +2 -2
- package/source/components/layout/stylesheet/collapse.mjs +14 -7
- package/source/components/layout/stylesheet/details.mjs +2 -4
- package/source/components/layout/stylesheet/panel.mjs +2 -4
- package/source/components/layout/stylesheet/popper.mjs +2 -4
- package/source/components/layout/stylesheet/split-panel.mjs +1 -3
- package/source/components/layout/stylesheet/tabs.mjs +2 -4
- package/source/components/layout/stylesheet/width-toggle.mjs +1 -3
- package/source/components/navigation/stylesheet/table-of-content.mjs +2 -4
- package/source/components/notify/stylesheet/message.mjs +2 -4
- package/source/components/notify/stylesheet/notify.mjs +2 -4
- package/source/components/state/stylesheet/log.mjs +2 -4
- package/source/components/state/stylesheet/state.mjs +2 -4
- package/source/components/style/control.pcss +5 -0
- package/source/components/style/data-grid.pcss +2 -2
- package/source/components/style/mixin/typography.pcss +7 -1
- package/source/components/style/normalize.pcss +1 -1
- package/source/components/stylesheet/badge.mjs +1 -3
- package/source/components/stylesheet/border.mjs +1 -3
- package/source/components/stylesheet/button.mjs +1 -3
- package/source/components/stylesheet/card.mjs +1 -3
- package/source/components/stylesheet/color.mjs +1 -3
- package/source/components/stylesheet/common.mjs +1 -3
- package/source/components/stylesheet/control.mjs +2 -4
- package/source/components/stylesheet/data-grid.mjs +2 -4
- package/source/components/stylesheet/display.mjs +1 -3
- package/source/components/stylesheet/floating-ui.mjs +1 -3
- package/source/components/stylesheet/form.mjs +13 -6
- package/source/components/stylesheet/host.mjs +1 -3
- package/source/components/stylesheet/icons.mjs +1 -3
- package/source/components/stylesheet/mixin/badge.mjs +1 -3
- package/source/components/stylesheet/mixin/button.mjs +1 -3
- package/source/components/stylesheet/mixin/form.mjs +13 -6
- package/source/components/stylesheet/mixin/hover.mjs +1 -3
- package/source/components/stylesheet/mixin/icon.mjs +1 -3
- package/source/components/stylesheet/mixin/media.mjs +1 -3
- package/source/components/stylesheet/mixin/property.mjs +13 -6
- package/source/components/stylesheet/mixin/skeleton.mjs +1 -3
- package/source/components/stylesheet/mixin/spinner.mjs +1 -3
- package/source/components/stylesheet/mixin/typography.mjs +1 -3
- package/source/components/stylesheet/normalize.mjs +1 -3
- package/source/components/stylesheet/popper.mjs +1 -3
- package/source/components/stylesheet/property.mjs +2 -4
- package/source/components/stylesheet/ripple.mjs +1 -3
- package/source/components/stylesheet/skeleton.mjs +1 -3
- package/source/components/stylesheet/space.mjs +1 -3
- package/source/components/stylesheet/spinner.mjs +1 -3
- package/source/components/stylesheet/table.mjs +1 -3
- package/source/components/stylesheet/theme.mjs +1 -3
- package/source/components/stylesheet/typography.mjs +13 -6
- package/source/components/tree-menu/dragable-tree-menu.mjs +693 -0
- package/source/components/tree-menu/style/tree-menu.pcss +69 -42
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +8 -17
- package/source/components/tree-menu/tree-menu.mjs +468 -532
- package/source/data/datasource/server/restapi.mjs +194 -191
- package/source/data/datasource/server.mjs +107 -105
- package/source/data/diff.mjs +1 -1
- package/source/dom/customelement.mjs +2 -6
- package/source/dom/slotted.mjs +89 -85
- package/test/cases/components/host/details.mjs +1 -1
- package/test/cases/components/host/host.mjs +1 -1
- package/test/cases/components/host/overlay.mjs +1 -1
- package/test/cases/dom/customcontrol.mjs +1 -1
- package/test/cases/dom/customelement.mjs +2 -2
|
@@ -327,7 +327,6 @@ class CustomElement extends HTMLElement {
|
|
|
327
327
|
* @property {Object} templates Specifies the templates used by the control.
|
|
328
328
|
* @property {string} templates.main=undefined Specifies the main template used by the control.
|
|
329
329
|
* @property {Object} templateMapping Specifies the mapping of templates.
|
|
330
|
-
* @property {string} display=block Specifies the display mode of the control.
|
|
331
330
|
* @since 1.8.0
|
|
332
331
|
*/
|
|
333
332
|
get defaults() {
|
|
@@ -339,20 +338,19 @@ class CustomElement extends HTMLElement {
|
|
|
339
338
|
main: undefined,
|
|
340
339
|
},
|
|
341
340
|
templateMapping: {},
|
|
342
|
-
display: "block"
|
|
343
341
|
};
|
|
344
342
|
}
|
|
345
343
|
|
|
346
344
|
/**
|
|
347
345
|
* This method updates the labels of the element.
|
|
348
|
-
* The labels are defined in the
|
|
346
|
+
* The labels are defined in the option object.
|
|
349
347
|
* The key of the label is used to retrieve the translation from the document.
|
|
350
348
|
* If the translation is different from the label, the label is updated.
|
|
351
349
|
*
|
|
352
350
|
* Before you can use this method, you must have loaded the translations.
|
|
353
351
|
*
|
|
354
352
|
* @returns {Monster.DOM.CustomElement}
|
|
355
|
-
* @throws {Error} Cannot find element with translations. Add a
|
|
353
|
+
* @throws {Error} Cannot find an element with translations. Add a translation object to the document.
|
|
356
354
|
*/
|
|
357
355
|
updateI18n() {
|
|
358
356
|
let translations;
|
|
@@ -597,8 +595,6 @@ class CustomElement extends HTMLElement {
|
|
|
597
595
|
let elements;
|
|
598
596
|
let nodeList;
|
|
599
597
|
|
|
600
|
-
this.style.setProperty("display", this.getOption("display"));
|
|
601
|
-
|
|
602
598
|
// Extract options from attributes and set them
|
|
603
599
|
const AttributeOptions = getOptionsFromAttributes.call(this);
|
|
604
600
|
if (
|
package/source/dom/slotted.mjs
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* SPDX-License-Identifier: AGPL-3.0
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import {isString} from "../types/is.mjs";
|
|
16
|
+
import {validateString} from "../types/validate.mjs";
|
|
17
17
|
|
|
18
|
-
export {
|
|
18
|
+
export {getSlottedElements, getSlottedNodes};
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @private
|
|
@@ -28,46 +28,46 @@ export { getSlottedElements, getSlottedNodes };
|
|
|
28
28
|
* @throws {Error} query must be a string
|
|
29
29
|
*/
|
|
30
30
|
function getSlottedNodes(query, name) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
31
|
+
const result = new Set();
|
|
32
|
+
|
|
33
|
+
if (!this.shadowRoot) {
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let selector = "slot";
|
|
38
|
+
if (name !== undefined) {
|
|
39
|
+
if (name === null) {
|
|
40
|
+
selector += ":not([name])";
|
|
41
|
+
} else {
|
|
42
|
+
selector += `[name=${validateString(name)}]`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const slots = this.shadowRoot.querySelectorAll(selector);
|
|
47
|
+
|
|
48
|
+
for (const [, slot] of Object.entries(slots)) {
|
|
49
|
+
slot.assignedNodes().forEach(function (node) {
|
|
50
|
+
if (node === null || node === undefined) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (isString(query)) {
|
|
55
|
+
node.querySelectorAll(query).forEach(function (n) {
|
|
56
|
+
result.add(n);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
if (node.matches(query)) {
|
|
60
|
+
result.add(node);
|
|
61
|
+
}
|
|
62
|
+
} else if (query !== undefined) {
|
|
63
|
+
throw new Error("query must be a string");
|
|
64
|
+
} else {
|
|
65
|
+
result.add(node);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return result;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -81,46 +81,50 @@ function getSlottedNodes(query, name) {
|
|
|
81
81
|
* @throws {Error} query must be a string
|
|
82
82
|
*/
|
|
83
83
|
function getSlottedElements(query, name) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
84
|
+
const result = new Set();
|
|
85
|
+
|
|
86
|
+
if (!(this.shadowRoot instanceof ShadowRoot)) {
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let selector = "slot";
|
|
91
|
+
if (name !== undefined) {
|
|
92
|
+
if (name === null) {
|
|
93
|
+
selector += ":not([name])";
|
|
94
|
+
} else {
|
|
95
|
+
selector += `[name=${validateString(name)}]`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const slots = this.shadowRoot.querySelectorAll(selector);
|
|
100
|
+
|
|
101
|
+
for (const [, slot] of Object.entries(slots)) {
|
|
102
|
+
slot.assignedElements().forEach(function (node) {
|
|
103
|
+
|
|
104
|
+
if (!(node instanceof HTMLElement)
|
|
105
|
+
&& !(node instanceof SVGElement)
|
|
106
|
+
&& !(node instanceof MathMLElement)
|
|
107
|
+
) return;
|
|
108
|
+
|
|
109
|
+
if (isString(query)) {
|
|
110
|
+
if (query.length > 0) {
|
|
111
|
+
node.querySelectorAll(query).forEach(function (n) {
|
|
112
|
+
result.add(n);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
if (node.matches(query)) {
|
|
116
|
+
result.add(node);
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
result.add(node);
|
|
120
|
+
}
|
|
121
|
+
} else if (query !== undefined) {
|
|
122
|
+
throw new Error("query must be a string and not empty");
|
|
123
|
+
} else {
|
|
124
|
+
result.add(node);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return result;
|
|
126
130
|
}
|
|
@@ -55,7 +55,7 @@ describe('Details', function () {
|
|
|
55
55
|
try {
|
|
56
56
|
|
|
57
57
|
expect(document.getElementById('mocks')).contain.html(
|
|
58
|
-
'<monster-details id="details1"
|
|
58
|
+
'<monster-details id="details1" data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)" data-monster-button-label="Details"></monster-details>')
|
|
59
59
|
} catch (e) {
|
|
60
60
|
return done(e);
|
|
61
61
|
}
|
|
@@ -52,7 +52,7 @@ describe('Host', function () {
|
|
|
52
52
|
|
|
53
53
|
setTimeout(() => {
|
|
54
54
|
try {
|
|
55
|
-
expect(document.getElementById('mocks')).contain.html('<monster-host
|
|
55
|
+
expect(document.getElementById('mocks')).contain.html('<monster-host data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-host>')
|
|
56
56
|
} catch (e) {
|
|
57
57
|
return done(e);
|
|
58
58
|
}
|
|
@@ -47,7 +47,7 @@ describe('Overlay', function () {
|
|
|
47
47
|
setTimeout(() => {
|
|
48
48
|
try {
|
|
49
49
|
expect(document.getElementById('mocks')).contain.html(
|
|
50
|
-
' <monster-overlay
|
|
50
|
+
' <monster-overlay data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-overlay>')
|
|
51
51
|
} catch (e) {
|
|
52
52
|
return done(e);
|
|
53
53
|
}
|
|
@@ -138,7 +138,7 @@ describe('DOM', function () {
|
|
|
138
138
|
|
|
139
139
|
expect(document.getElementsByTagName('monster-customcontrol').length).is.equal(1);
|
|
140
140
|
// no data-monster-objectlink="Symbol(monsterUpdater)" because it has nothing to update
|
|
141
|
-
expect(document.getElementById('test1')).contain.html('<monster-customcontrol
|
|
141
|
+
expect(document.getElementById('test1')).contain.html('<monster-customcontrol data-monster-error="Error: html is not set."></monster-customcontrol>')
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
|
|
@@ -242,7 +242,7 @@ describe('DOM', function () {
|
|
|
242
242
|
expect(document.getElementsByTagName('monster-testclass').length).is.equal(1);
|
|
243
243
|
// no data-monster-objectlink="Symbol(monsterUpdater)" because it has nothing to update
|
|
244
244
|
// but data-monster-error="Error: html is not set."
|
|
245
|
-
expect(document.getElementById('test1')).contain.html('<monster-testclass
|
|
245
|
+
expect(document.getElementById('test1')).contain.html('<monster-testclass data-monster-error="Error: html is not set."></monster-testclass>');
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
|
|
@@ -256,7 +256,7 @@ describe('DOM', function () {
|
|
|
256
256
|
try {
|
|
257
257
|
expect(document.getElementsByTagName('monster-testclass2').length).is.equal(1);
|
|
258
258
|
expect(document.getElementsByTagName('monster-testclass2').item(0).shadowRoot.innerHTML).is.equal('<h1></h1><article><p>test</p><div id="container"></div></article>');
|
|
259
|
-
expect(document.getElementById('test1')).contain.html('<monster-testclass2
|
|
259
|
+
expect(document.getElementById('test1')).contain.html('<monster-testclass2 data-monster-objectlink="Symbol(' + updaterSymbolKey + ')"></monster-testclass2>');
|
|
260
260
|
return done();
|
|
261
261
|
} catch (e) {
|
|
262
262
|
done(e);
|