@schukai/monster 3.71.3 → 3.73.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 +27 -0
- package/package.json +1 -1
- package/source/components/datatable/dataset.mjs +268 -272
- package/source/components/datatable/datasource/dom.mjs +2 -2
- 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-help.mjs +1 -1
- package/source/components/form/field-set.mjs +219 -219
- package/source/components/form/form.mjs +309 -185
- 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 +14 -7
- 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/layout/tabs.mjs +0 -1
- 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 +2 -4
- package/source/components/tree-menu/tree-menu.mjs +260 -331
- 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/constants.mjs +18 -0
- package/source/dom/customelement.mjs +2 -6
- package/source/dom/slotted.mjs +6 -1
- package/source/dom/updater.mjs +2 -0
- 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
package/source/dom/constants.mjs
CHANGED
|
@@ -65,6 +65,8 @@ export {
|
|
|
65
65
|
ATTRIBUTE_ENTERKEYHINT,
|
|
66
66
|
ATTRIBUTE_EXPORTPARTS,
|
|
67
67
|
ATTRIBUTE_HIDDEN,
|
|
68
|
+
ATTRIBUTE_FORM_BIND,
|
|
69
|
+
ATTRIBUTE_FORM_BIND_TYPE,
|
|
68
70
|
objectUpdaterLinkSymbol,
|
|
69
71
|
customElementUpdaterLinkSymbol,
|
|
70
72
|
initControlCallbackName,
|
|
@@ -207,6 +209,22 @@ const ATTRIBUTE_UPDATER_REMOVE = `${ATTRIBUTE_PREFIX}remove`;
|
|
|
207
209
|
*/
|
|
208
210
|
const ATTRIBUTE_UPDATER_BIND = `${ATTRIBUTE_PREFIX}bind`;
|
|
209
211
|
|
|
212
|
+
/**
|
|
213
|
+
* @memberOf Monster.DOM
|
|
214
|
+
* @type {string}
|
|
215
|
+
* @license AGPLv3
|
|
216
|
+
* @since 3.73.0
|
|
217
|
+
*/
|
|
218
|
+
const ATTRIBUTE_FORM_BIND = `${ATTRIBUTE_PREFIX}form-bind`;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @memberOf Monster.DOM
|
|
222
|
+
* @type {string}
|
|
223
|
+
* @license AGPLv3
|
|
224
|
+
* @since 3.73.0
|
|
225
|
+
*/
|
|
226
|
+
const ATTRIBUTE_FORM_BIND_TYPE = `${ATTRIBUTE_PREFIX}form-bind-type`;
|
|
227
|
+
|
|
210
228
|
/**
|
|
211
229
|
* @memberOf Monster.DOM
|
|
212
230
|
* @type {string}
|
|
@@ -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
|
@@ -100,7 +100,12 @@ function getSlottedElements(query, name) {
|
|
|
100
100
|
|
|
101
101
|
for (const [, slot] of Object.entries(slots)) {
|
|
102
102
|
slot.assignedElements().forEach(function (node) {
|
|
103
|
-
if (
|
|
103
|
+
if (
|
|
104
|
+
!(node instanceof HTMLElement) &&
|
|
105
|
+
!(node instanceof SVGElement) &&
|
|
106
|
+
!(node instanceof MathMLElement)
|
|
107
|
+
)
|
|
108
|
+
return;
|
|
104
109
|
|
|
105
110
|
if (isString(query)) {
|
|
106
111
|
if (query.length > 0) {
|
package/source/dom/updater.mjs
CHANGED
|
@@ -156,6 +156,7 @@ class Updater extends Base {
|
|
|
156
156
|
|
|
157
157
|
for (const type of this[internalSymbol].eventTypes) {
|
|
158
158
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
|
|
159
|
+
|
|
159
160
|
this[internalSymbol].element.addEventListener(
|
|
160
161
|
type,
|
|
161
162
|
getControlEventHandler.call(this),
|
|
@@ -399,6 +400,7 @@ function retrieveAndSetValue(element) {
|
|
|
399
400
|
}
|
|
400
401
|
|
|
401
402
|
const copy = clone(this[internalSymbol].subject.getRealSubject());
|
|
403
|
+
|
|
402
404
|
const pf = new Pathfinder(copy);
|
|
403
405
|
pf.setVia(path, value);
|
|
404
406
|
|
|
@@ -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);
|