@schukai/monster 4.67.0 → 4.69.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 +23 -0
- package/package.json +1 -1
- package/source/components/content/image-editor.mjs +3251 -0
- package/source/components/datatable/filter/date-presets.mjs +18 -6
- package/source/components/datatable/filter/date-time.mjs +7 -4
- package/source/components/datatable/filter/date.mjs +7 -4
- package/source/components/datatable/filter/text-operator.mjs +14 -5
- package/source/components/datatable/filter/time.mjs +7 -4
- package/source/components/files/file-manager.mjs +2464 -0
- package/source/components/files/stylesheet/file-manager.mjs +55 -0
- package/source/components/layout/panel.mjs +16 -1
- package/source/components/layout/split-panel.mjs +8 -0
- package/source/components/layout/tabs.mjs +48 -19
- package/source/monster.mjs +11 -5
- package/source/types/version.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +62 -23
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © Volker Schukai and all contributing authors, 2025. All rights reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
7
|
+
*
|
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
|
10
|
+
* For more information about purchasing a commercial license, please contact Volker Schukai.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { addAttributeToken } from "../../../dom/attributes.mjs";
|
|
14
|
+
import { ATTRIBUTE_ERRORMESSAGE } from "../../../dom/constants.mjs";
|
|
15
|
+
|
|
16
|
+
export { FileManagerStyleSheet };
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
* @type {CSSStyleSheet}
|
|
21
|
+
*/
|
|
22
|
+
const FileManagerStyleSheet = new CSSStyleSheet();
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
FileManagerStyleSheet.insertRule(
|
|
26
|
+
`
|
|
27
|
+
@layer filemanager {
|
|
28
|
+
:host{box-sizing:border-box;display:block;height:100%;height:-webkit-fill-available;height:fill-available;height:-moz-available;height:stretch;min-height:320px}
|
|
29
|
+
[data-monster-role=control]{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--monster-space-4);height:100%}
|
|
30
|
+
[data-monster-role=toolbar]{align-items:center;display:flex;gap:var(--monster-space-4);justify-content:space-between}
|
|
31
|
+
[data-monster-role=actions]{display:flex;gap:var(--monster-space-3);justify-content:flex-end}
|
|
32
|
+
[data-monster-role=title]{font-weight:700}
|
|
33
|
+
monster-split-panel{flex:1;min-height:300px}
|
|
34
|
+
monster-split-panel::part(control){height:100%}
|
|
35
|
+
monster-split-panel::part(endPanel){overflow:hidden}
|
|
36
|
+
[data-monster-role=nav-panel],[data-monster-role=editor-panel]{height:100%}
|
|
37
|
+
[data-monster-role=nav-panel]{display:flex;flex-direction:column;min-height:0}
|
|
38
|
+
[data-monster-role=editor-panel]{display:flex;flex-direction:column;gap:var(--monster-space-3);min-height:0;overflow:hidden;position:relative}
|
|
39
|
+
[data-monster-role=tabs-container]{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
|
|
40
|
+
monster-tabs{flex:1;min-height:0;height:100%}
|
|
41
|
+
[data-monster-role=empty]{align-items:center;display:flex;inset:0;justify-content:center;padding:var(--monster-space-4);position:absolute;text-align:center}
|
|
42
|
+
[data-monster-role=tab-content]{display:flex;flex-direction:column;flex:1;height:100%;min-height:0;overflow:auto}
|
|
43
|
+
[data-monster-role=tab-content]:not(.active){display:none}
|
|
44
|
+
[data-monster-role=editor]{flex:1;font-family:var(--monster-font-family-monospace);height:100%;min-height:0;overflow:auto;resize:none;width:100%}
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
0,
|
|
48
|
+
);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
addAttributeToken(
|
|
51
|
+
document.getRootNode().querySelector("html"),
|
|
52
|
+
ATTRIBUTE_ERRORMESSAGE,
|
|
53
|
+
e + "",
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -141,11 +141,18 @@ class Panel extends CustomElement {
|
|
|
141
141
|
function calcHeight() {
|
|
142
142
|
this.style.boxSizing = "border-box";
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
let height = calculateMaximumHeight.call(this, this);
|
|
145
145
|
if (height < 0) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
const parent =
|
|
150
|
+
this.parentNode instanceof HTMLElement ? this.parentNode : null;
|
|
151
|
+
const parentHeight = parent?.clientHeight || 0;
|
|
152
|
+
if (parentHeight > 0) {
|
|
153
|
+
height = Math.min(height, parentHeight);
|
|
154
|
+
}
|
|
155
|
+
|
|
149
156
|
this.style.height = `${height}px`;
|
|
150
157
|
}
|
|
151
158
|
|
|
@@ -162,11 +169,19 @@ function calculateMaximumHeight(element) {
|
|
|
162
169
|
let totalBoxShadowHeight = 0;
|
|
163
170
|
let currentElement = element;
|
|
164
171
|
|
|
172
|
+
if (!(element instanceof Element)) {
|
|
173
|
+
return -1;
|
|
174
|
+
}
|
|
175
|
+
|
|
165
176
|
// Get the distance from the top of the element to the top of the viewport
|
|
166
177
|
const distanceFromTop = element.getBoundingClientRect().top;
|
|
167
178
|
|
|
168
179
|
// Loop through the elements up to the body to sum up the bottom borders, padding, and margin
|
|
169
180
|
while (currentElement && currentElement !== document.body) {
|
|
181
|
+
if (!(currentElement instanceof Element)) {
|
|
182
|
+
currentElement = currentElement.parentNode || currentElement.host;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
170
185
|
const style = window.getComputedStyle(currentElement);
|
|
171
186
|
|
|
172
187
|
// Box sizing
|
|
@@ -182,6 +182,14 @@ class SplitPanel extends CustomElement {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
this[internalSymbol].getSubject().currentDimension = dimension;
|
|
185
|
+
if (
|
|
186
|
+
this[startPanelElementSymbol] &&
|
|
187
|
+
this[endPanelElementSymbol] &&
|
|
188
|
+
this[draggerElementSymbol] &&
|
|
189
|
+
this[splitScreenElementSymbol]
|
|
190
|
+
) {
|
|
191
|
+
applyPanelDimensions.call(this);
|
|
192
|
+
}
|
|
185
193
|
return this;
|
|
186
194
|
}
|
|
187
195
|
|
|
@@ -181,8 +181,8 @@ class Tabs extends CustomElement {
|
|
|
181
181
|
* @property {string} labels.new-tab-label="New Tab"
|
|
182
182
|
* @property {Object} features
|
|
183
183
|
* @property {number} features.openDelay=500 Open delay in milliseconds
|
|
184
|
-
* @property {string} features.removeBehavior
|
|
185
|
-
* @property {boolean} features.openFirst
|
|
184
|
+
* @property {string} features.removeBehavior Remove behavior, auto, next, previous and none
|
|
185
|
+
* @property {boolean} features.openFirst Open the first tab when no active tab is set
|
|
186
186
|
* @property {Object} fetch Fetch [see Using Fetch mozilla.org](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)
|
|
187
187
|
* @property {String} fetch.redirect=error
|
|
188
188
|
* @property {String} fetch.method=GET
|
|
@@ -216,7 +216,7 @@ class Tabs extends CustomElement {
|
|
|
216
216
|
features: {
|
|
217
217
|
openDelay: null,
|
|
218
218
|
removeBehavior: "auto",
|
|
219
|
-
openFirst:
|
|
219
|
+
openFirst: false,
|
|
220
220
|
},
|
|
221
221
|
|
|
222
222
|
classes: {
|
|
@@ -845,55 +845,85 @@ function initEventHandler() {
|
|
|
845
845
|
let doChange = false;
|
|
846
846
|
let nextName = null;
|
|
847
847
|
let previousName = null;
|
|
848
|
+
let targetReference = null;
|
|
849
|
+
let activeReference = null;
|
|
850
|
+
let restoreOpenFirst = null;
|
|
848
851
|
|
|
849
852
|
const btn = this.getOption("buttons");
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
853
|
+
if (btn?.standard) {
|
|
854
|
+
const activeButton = btn.standard.find(
|
|
855
|
+
(item) => item.state === "active",
|
|
856
|
+
);
|
|
857
|
+
activeReference = activeButton?.reference || null;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const nodes = getSlottedElements.call(this);
|
|
861
|
+
const orderedTabs = [];
|
|
862
|
+
for (const node of nodes) {
|
|
863
|
+
if (node instanceof HTMLElement) {
|
|
864
|
+
orderedTabs.push(node);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
for (let i = 0; i < orderedTabs.length; i++) {
|
|
869
|
+
const node = orderedTabs[i];
|
|
870
|
+
if (node.getAttribute("id") === reference) {
|
|
871
|
+
if (reference === activeReference) {
|
|
872
|
+
doChange = true;
|
|
873
|
+
nextName = orderedTabs[i + 1]?.getAttribute?.("id") || null;
|
|
874
|
+
previousName = orderedTabs[i - 1]?.getAttribute?.("id") || null;
|
|
860
875
|
}
|
|
861
876
|
break;
|
|
862
877
|
}
|
|
863
878
|
}
|
|
864
879
|
|
|
865
880
|
if (reference) {
|
|
866
|
-
const
|
|
881
|
+
const escapedReference =
|
|
882
|
+
typeof CSS !== "undefined" && CSS.escape
|
|
883
|
+
? CSS.escape(reference)
|
|
884
|
+
: reference;
|
|
885
|
+
const container = this.querySelector(`[id=${escapedReference}]`);
|
|
867
886
|
if (container instanceof HTMLElement) {
|
|
868
887
|
if (doChange) {
|
|
869
888
|
switch (this.getOption("features.removeBehavior")) {
|
|
870
889
|
case "auto":
|
|
871
890
|
if (nextName !== null) {
|
|
872
|
-
|
|
891
|
+
targetReference = nextName;
|
|
873
892
|
} else {
|
|
874
893
|
if (previousName !== null) {
|
|
875
|
-
|
|
894
|
+
targetReference = previousName;
|
|
876
895
|
}
|
|
877
896
|
}
|
|
878
897
|
break;
|
|
879
898
|
case "next":
|
|
880
899
|
if (nextName !== null) {
|
|
881
|
-
|
|
900
|
+
targetReference = nextName;
|
|
882
901
|
}
|
|
883
902
|
break;
|
|
884
903
|
case "previous":
|
|
885
904
|
if (previousName !== null) {
|
|
886
|
-
|
|
905
|
+
targetReference = previousName;
|
|
887
906
|
}
|
|
888
907
|
break;
|
|
889
908
|
|
|
890
909
|
default: // and "none"
|
|
891
910
|
break;
|
|
892
911
|
}
|
|
912
|
+
if (targetReference) {
|
|
913
|
+
self.activeTab(targetReference);
|
|
914
|
+
restoreOpenFirst = this.getOption("features.openFirst");
|
|
915
|
+
this.setOption("features.openFirst", false);
|
|
916
|
+
}
|
|
893
917
|
}
|
|
894
918
|
|
|
895
919
|
container.remove();
|
|
896
920
|
initTabButtons.call(this);
|
|
921
|
+
if (targetReference) {
|
|
922
|
+
if (restoreOpenFirst !== null) {
|
|
923
|
+
this.setOption("features.openFirst", restoreOpenFirst);
|
|
924
|
+
}
|
|
925
|
+
self.activeTab(targetReference);
|
|
926
|
+
}
|
|
897
927
|
fireCustomEvent(this, "monster-tab-remove", {
|
|
898
928
|
reference,
|
|
899
929
|
});
|
|
@@ -1053,7 +1083,6 @@ function initTabButtons() {
|
|
|
1053
1083
|
}
|
|
1054
1084
|
|
|
1055
1085
|
if (node.matches(".active") === true && disabled !== true) {
|
|
1056
|
-
node.classList.remove("active");
|
|
1057
1086
|
activeReference = reference;
|
|
1058
1087
|
}
|
|
1059
1088
|
|
package/source/monster.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright © Volker Schukai and all contributing authors,
|
|
2
|
+
* Copyright © Volker Schukai and all contributing authors, 2026. All rights reserved.
|
|
3
3
|
* Node module: @schukai/monster
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
|
@@ -34,12 +34,15 @@ export * from "./components/content/fetch-box.mjs";
|
|
|
34
34
|
export * from "./components/content/viewer.mjs";
|
|
35
35
|
export * from "./components/content/camera-capture.mjs";
|
|
36
36
|
export * from "./components/content/copy.mjs";
|
|
37
|
+
export * from "./components/content/image-editor.mjs";
|
|
37
38
|
export * from "./components/content/viewer/html.mjs";
|
|
38
39
|
export * from "./components/content/viewer/message.mjs";
|
|
40
|
+
export * from "./components/files/file-manager.mjs";
|
|
39
41
|
export * from "./components/time/timeline/appointment.mjs";
|
|
40
42
|
export * from "./components/time/timeline/segment.mjs";
|
|
41
43
|
export * from "./components/time/day.mjs";
|
|
42
44
|
export * from "./components/time/month-calendar.mjs";
|
|
45
|
+
export * from "./components/form/buy-box.mjs";
|
|
43
46
|
export * from "./components/form/message-state-button.mjs";
|
|
44
47
|
export * from "./components/form/password.mjs";
|
|
45
48
|
export * from "./components/form/dropzone.mjs";
|
|
@@ -53,10 +56,13 @@ export * from "./components/form/api-bar.mjs";
|
|
|
53
56
|
export * from "./components/form/tabs.mjs";
|
|
54
57
|
export * from "./components/form/state-button.mjs";
|
|
55
58
|
export * from "./components/form/popper.mjs";
|
|
59
|
+
export * from "./components/form/cart-control.mjs";
|
|
56
60
|
export * from "./components/form/select.mjs";
|
|
57
61
|
export * from "./components/form/login.mjs";
|
|
58
62
|
export * from "./components/form/confirm-button.mjs";
|
|
59
63
|
export * from "./components/form/context-error.mjs";
|
|
64
|
+
export * from "./components/form/variant-select.mjs";
|
|
65
|
+
export * from "./components/form/register-wizard.mjs";
|
|
60
66
|
export * from "./components/form/action-button.mjs";
|
|
61
67
|
export * from "./components/form/form.mjs";
|
|
62
68
|
export * from "./components/form/api-button.mjs";
|
|
@@ -88,15 +94,15 @@ export * from "./components/host/util.mjs";
|
|
|
88
94
|
export * from "./components/host/call-button.mjs";
|
|
89
95
|
export * from "./components/host/details.mjs";
|
|
90
96
|
export * from "./components/host/constants.mjs";
|
|
97
|
+
export * from "./components/datatable/filter/text-operator.mjs";
|
|
98
|
+
export * from "./components/datatable/filter/time.mjs";
|
|
91
99
|
export * from "./components/datatable/filter/input.mjs";
|
|
92
|
-
export * from "./components/datatable/filter/date.mjs";
|
|
93
100
|
export * from "./components/datatable/filter/date-presets.mjs";
|
|
101
|
+
export * from "./components/datatable/filter/date.mjs";
|
|
94
102
|
export * from "./components/datatable/filter/date-range.mjs";
|
|
95
|
-
export * from "./components/datatable/filter/date-time.mjs";
|
|
96
|
-
export * from "./components/datatable/filter/time.mjs";
|
|
97
|
-
export * from "./components/datatable/filter/text-operator.mjs";
|
|
98
103
|
export * from "./components/datatable/filter/abstract-base.mjs";
|
|
99
104
|
export * from "./components/datatable/filter/settings.mjs";
|
|
105
|
+
export * from "./components/datatable/filter/date-time.mjs";
|
|
100
106
|
export * from "./components/datatable/filter/range.mjs";
|
|
101
107
|
export * from "./components/datatable/datasource/dom.mjs";
|
|
102
108
|
export * from "./components/datatable/datasource/rest.mjs";
|
package/source/types/version.mjs
CHANGED
package/test/cases/monster.mjs
CHANGED
package/test/web/test.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
|
|
12
|
-
<h1 style='margin-bottom: 0.1em;'>Monster 4.
|
|
13
|
-
<div id="lastupdate" style='font-size:0.7em'>last update
|
|
12
|
+
<h1 style='margin-bottom: 0.1em;'>Monster 4.68.0</h1>
|
|
13
|
+
<div id="lastupdate" style='font-size:0.7em'>last update Fr 2. Jan 17:20:55 CET 2026</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div id="mocha-errors"
|
|
16
16
|
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
|