@schukai/monster 4.125.3 → 4.127.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 CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.127.0] - 2026-03-14
6
+
7
+ ### Add Features
8
+
9
+ - **button-bar:** add right alignment option
10
+ ### Bug Fixes
11
+
12
+ - update css
13
+
14
+
15
+
16
+ ## [4.126.0] - 2026-03-13
17
+
18
+ ### Add Features
19
+
20
+ - Increase timeout for Pagination tests
21
+ - **conversion:** use field layout classes in wizard example ([#387](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/387))
22
+ - **conversion:** add reusable field layout classes ([#388](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/388))
23
+ - **conversion:** add reusable wizard control ([#387](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/387))
24
+ ### Bug Fixes
25
+
26
+ - **field-set:** remove border inside wizard panels
27
+ - **wizard:** hide back button on first panel
28
+ ### Changes
29
+
30
+ - work in progress
31
+ - Close issue [#387](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/387) and move files
32
+
33
+
34
+
5
35
  ## [4.125.3] - 2026-03-11
6
36
 
7
37
  ### Bug Fixes
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.5","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.125.3"}
1
+ {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.5","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.127.0"}
@@ -35,6 +35,7 @@ import { findTargetElementFromEvent } from "../../dom/events.mjs";
35
35
  import { getDocument } from "../../dom/util.mjs";
36
36
  import { getGlobal } from "../../types/global.mjs";
37
37
  import { ID } from "../../types/id.mjs";
38
+ import { Observer } from "../../types/observer.mjs";
38
39
  import { STYLE_DISPLAY_MODE_BLOCK } from "./constants.mjs";
39
40
  import { ButtonBarStyleSheet } from "./stylesheet/button-bar.mjs";
40
41
  import { positionPopper } from "./util/floating-ui.mjs";
@@ -132,6 +133,12 @@ const layoutStateSymbol = Symbol("layoutState");
132
133
  */
133
134
  const ATTRIBUTE_POPPER_POSITION = "data-monster-popper-position";
134
135
 
136
+ /**
137
+ * @private
138
+ * @type {string}
139
+ */
140
+ const ATTRIBUTE_LAYOUT_ALIGNMENT = "data-monster-layout-alignment";
141
+
135
142
  /**
136
143
  * A button bar control.
137
144
  *
@@ -171,6 +178,9 @@ class ButtonBar extends CustomElement {
171
178
  main: getTemplate(),
172
179
  },
173
180
  labels: {},
181
+ layout: {
182
+ alignment: "left",
183
+ },
174
184
  popper: {
175
185
  placement: "left",
176
186
  middleware: ["autoPlacement", "shift", "offset:5"],
@@ -203,6 +213,12 @@ class ButtonBar extends CustomElement {
203
213
  // setup structure
204
214
  initButtonBar.call(this);
205
215
  initPopperSwitch.call(this);
216
+ applyLayoutAlignment.call(this);
217
+ this.attachObserver(
218
+ new Observer(() => {
219
+ applyLayoutAlignment.call(this);
220
+ }),
221
+ );
206
222
  }
207
223
 
208
224
  /**
@@ -846,6 +862,27 @@ function updatePopper() {
846
862
  );
847
863
  }
848
864
 
865
+ /**
866
+ * @private
867
+ */
868
+ function applyLayoutAlignment() {
869
+ if (!(this[buttonBarElementSymbol] instanceof HTMLElement)) {
870
+ return;
871
+ }
872
+
873
+ const alignment = this.getOption("layout.alignment", "left");
874
+
875
+ if (alignment === "right") {
876
+ this[buttonBarElementSymbol].setAttribute(
877
+ ATTRIBUTE_LAYOUT_ALIGNMENT,
878
+ "right",
879
+ );
880
+ return;
881
+ }
882
+
883
+ this[buttonBarElementSymbol].setAttribute(ATTRIBUTE_LAYOUT_ALIGNMENT, "left");
884
+ }
885
+
849
886
  /**
850
887
  * @private
851
888
  * @return {Select}
@@ -12,6 +12,11 @@ div[data-monster-role="control"] {
12
12
  & [data-monster-role=button-bar] {
13
13
  display: flex;
14
14
  flex-direction: row;
15
+ justify-content: flex-start;
16
+
17
+ &[data-monster-layout-alignment="right"] {
18
+ justify-content: flex-end;
19
+ }
15
20
 
16
21
  & :not(slot[name=button]) {
17
22
  display: flex;
@@ -54,4 +59,3 @@ div[data-monster-role="control"] {
54
59
 
55
60
 
56
61
  }
57
-
@@ -0,0 +1,350 @@
1
+ @import "../../style/color.pcss";
2
+ @import "../../style/theme.pcss";
3
+ @import "../../style/border.pcss";
4
+ @import "../../style/form.pcss";
5
+ @import "../../style/control.pcss";
6
+ @import "../../style/badge.pcss";
7
+ @import '../../style/mixin/typography.pcss';
8
+
9
+ .monster-field-layout {
10
+ container-type: inline-size;
11
+ container-name: field-layout;
12
+ display: grid;
13
+ grid-template-columns: auto 1fr;
14
+ grid-gap: 0.8rem;
15
+ accent-color: var(--monster-color-secondary-2);
16
+ --monster-field-set-h1-size: xx-large;
17
+ --monster-field-set-h2-size: x-large;
18
+ --monster-field-set-h3-size: large;
19
+ --monster-field-set-h4-size: medium;
20
+ --monster-field-set-h5-size: small;
21
+ --monster-field-set-h6-size: smaller;
22
+ --monster-field-set-heading-margin-top: 1rem;
23
+ --monster-field-set-heading-margin-top-first: 0.3rem;
24
+ --monster-field-set-heading-margin-top-1200: 2.2rem;
25
+ --monster-field-set-heading-margin-top-first-1200: 0.6rem;
26
+ --monster-field-set-heading-margin-top-900: 1.8rem;
27
+ --monster-field-set-heading-margin-top-first-900: 0.5rem;
28
+ --monster-field-set-heading-margin-top-500: 1.3rem;
29
+ --monster-field-set-heading-margin-top-first-500: 0.4rem;
30
+ @mixin text;
31
+ }
32
+
33
+ .monster-field-layout.multiple-columns {
34
+ grid-template-columns: auto 1fr auto 1fr auto 1fr;
35
+ }
36
+
37
+ .monster-field-layout > label,
38
+ .monster-field-layout > .label {
39
+ color: var(--monster-color-primary-1);
40
+ border-bottom: thin dotted var(--monster-color-primary-1);
41
+ display: flex;
42
+ align-items: flex-start;
43
+ gap: 0.4rem;
44
+ justify-content: space-between;
45
+ }
46
+
47
+ .monster-field-layout > hr,
48
+ .monster-field-layout > h1,
49
+ .monster-field-layout > h2,
50
+ .monster-field-layout > h3,
51
+ .monster-field-layout > h4,
52
+ .monster-field-layout > h5,
53
+ .monster-field-layout > h6 {
54
+ grid-column: 1 / -1;
55
+ margin: var(--monster-field-set-heading-margin-top, 1rem) 0 0.1rem;
56
+ }
57
+
58
+ .monster-field-layout > h1 {
59
+ font-size: var(--monster-field-set-h1-size, xx-large);
60
+ }
61
+
62
+ .monster-field-layout > h2 {
63
+ font-size: var(--monster-field-set-h2-size, x-large);
64
+ }
65
+
66
+ .monster-field-layout > h3 {
67
+ font-size: var(--monster-field-set-h3-size, large);
68
+ }
69
+
70
+ .monster-field-layout > h4 {
71
+ font-size: var(--monster-field-set-h4-size, medium);
72
+ }
73
+
74
+ .monster-field-layout > h5 {
75
+ font-size: var(--monster-field-set-h5-size, small);
76
+ }
77
+
78
+ .monster-field-layout > h6 {
79
+ font-size: var(--monster-field-set-h6-size, smaller);
80
+ }
81
+
82
+ .monster-field-layout > h1:first-of-type,
83
+ .monster-field-layout > h2:first-of-type,
84
+ .monster-field-layout > h3:first-of-type,
85
+ .monster-field-layout > h4:first-of-type,
86
+ .monster-field-layout > h5:first-of-type {
87
+ margin-top: var(--monster-field-set-heading-margin-top-first, 0.3rem);
88
+ }
89
+
90
+ .monster-field-layout > hr {
91
+ border: none;
92
+ border-top: thin dotted var(--monster-color-gray-3);
93
+ margin: 1rem 0;
94
+ padding: 0;
95
+ }
96
+
97
+ .monster-field-layout > hr.delimiter {
98
+ border: none;
99
+ margin: 0;
100
+ padding: 0;
101
+ }
102
+
103
+ .monster-field-layout > .grid-span-full {
104
+ grid-column-end: -1;
105
+ }
106
+
107
+ .monster-field-layout > .grid-start-1 {
108
+ grid-column-start: 1;
109
+ }
110
+
111
+ .monster-field-layout > .grid-start-2 {
112
+ grid-column-start: 2;
113
+ }
114
+
115
+ .monster-field-layout > .grid-start-3 {
116
+ grid-column-start: 3;
117
+ }
118
+
119
+ .monster-field-layout > .grid-start-4 {
120
+ grid-column-start: 4;
121
+ }
122
+
123
+ .monster-field-layout > .grid-double-span {
124
+ grid-column: span 3;
125
+ }
126
+
127
+ .monster-field-layout > .grid-to-end {
128
+ grid-column-end: -1;
129
+ }
130
+
131
+ .monster-field-layout > input[type="text"],
132
+ .monster-field-layout > input[type="password"],
133
+ .monster-field-layout > input[type="email"],
134
+ .monster-field-layout > input[type="number"],
135
+ .monster-field-layout > input[type="tel"] {
136
+ height: -webkit-fill-available;
137
+ }
138
+
139
+ .monster-field-layout > input:not([type="checkbox"]):not([type="radio"]) {
140
+ width: 100%;
141
+ border-radius: var(--monster-theme-control-border-radius);
142
+ border-width: var(--monster-theme-control-border-width);
143
+ border-color: var(--monster-theme-control-border-color);
144
+ border-style: var(--monster-theme-control-border-style);
145
+ }
146
+
147
+ .monster-field-layout > select {
148
+ width: 100%;
149
+ border-radius: var(--monster-theme-control-border-radius);
150
+ border-width: var(--monster-theme-control-border-width);
151
+ border-color: var(--monster-theme-control-border-color);
152
+ border-style: var(--monster-theme-control-border-style);
153
+ background-color: var(--monster-bg-color-primary-1);
154
+ color: var(--monster-color-primary-1);
155
+ }
156
+
157
+ .monster-field-layout > select[readonly],
158
+ .monster-field-layout > select:disabled {
159
+ background-color: var(--monster-bg-color-primary-2);
160
+ color: var(--monster-color-primary-2);
161
+ cursor: default;
162
+ }
163
+
164
+ .monster-field-layout > input:not([type="checkbox"]):not([type="radio"])[readonly] {
165
+ background-color: var(--monster-bg-color-primary-3);
166
+ color: var(--monster-color-primary-3);
167
+ }
168
+
169
+ .monster-field-layout > input[readonly]:not([type="checkbox"]):not([type="radio"]) {
170
+ background-color: var(--monster-bg-color-primary-2);
171
+ color: var(--monster-color-primary-2);
172
+ cursor: default;
173
+ }
174
+
175
+ .monster-field-layout > input,
176
+ .monster-field-layout > monster-toggle-switch,
177
+ .monster-field-layout > select {
178
+ min-height: 1.8rem;
179
+ padding: 0.5rem;
180
+ box-sizing: border-box;
181
+ }
182
+
183
+ .monster-field-layout > monster-password {
184
+ min-height: 1.8rem;
185
+ }
186
+
187
+ .monster-field-layout > input[type="color"] {
188
+ padding: 0 0.2rem;
189
+ min-height: calc(1.8rem + 0.4rem);
190
+ width: 100%;
191
+ }
192
+
193
+ .monster-field-layout > input[type="time"],
194
+ .monster-field-layout > input[type="date"] {
195
+ padding: 0 0.2rem;
196
+ min-height: calc(1.8rem + 0.4rem);
197
+ }
198
+
199
+ .monster-field-layout > input[type="checkbox"],
200
+ .monster-field-layout > input[type="radio"] {
201
+ width: 1.8rem;
202
+ min-height: calc(1.8rem + 0.4rem);
203
+ padding: 0 0.2rem;
204
+ }
205
+
206
+ .monster-field-layout > input[type="file"] {
207
+ padding: 0.4rem;
208
+ min-height: calc(1.2rem);
209
+ }
210
+
211
+ .monster-field-layout > input,
212
+ .monster-field-layout > monster-toggle-switch,
213
+ .monster-field-layout > monster-password,
214
+ .monster-field-layout > select,
215
+ .monster-field-layout > [data-monster-validation-wrapper] {
216
+ align-self: end;
217
+ }
218
+
219
+ .monster-field-layout > select[multiple],
220
+ .monster-field-layout > select[size]:not([size="1"]) {
221
+ min-height: calc(1.8rem * 4);
222
+ padding: 0.25rem 0.35rem;
223
+ align-self: stretch;
224
+ overflow-y: auto;
225
+ }
226
+
227
+ .monster-field-layout > select[multiple] option,
228
+ .monster-field-layout > select[size]:not([size="1"]) option {
229
+ padding-block: 0.15rem;
230
+ }
231
+
232
+ .monster-field-layout > monster-toggle-switch {
233
+ width: 3rem;
234
+ padding: 0;
235
+ }
236
+
237
+ @container field-layout (max-width: 1200px) {
238
+ .monster-field-layout.multiple-columns {
239
+ grid-template-columns: auto 1fr auto 1fr;
240
+ }
241
+
242
+ .monster-field-layout > h1,
243
+ .monster-field-layout > h2,
244
+ .monster-field-layout > h3,
245
+ .monster-field-layout > h4,
246
+ .monster-field-layout > h5,
247
+ .monster-field-layout > h6 {
248
+ margin: var(--monster-field-set-heading-margin-top-1200, 2.2rem) 0 0.1rem;
249
+ }
250
+
251
+ .monster-field-layout > h1:first-of-type,
252
+ .monster-field-layout > h2:first-of-type,
253
+ .monster-field-layout > h3:first-of-type,
254
+ .monster-field-layout > h4:first-of-type,
255
+ .monster-field-layout > h5:first-of-type {
256
+ margin-top: var(--monster-field-set-heading-margin-top-first-1200, 0.6rem);
257
+ }
258
+
259
+ .monster-field-layout > .grid-double-span {
260
+ grid-column: span 1;
261
+ }
262
+ }
263
+
264
+ @container field-layout (max-width: 900px) {
265
+ .monster-field-layout.multiple-columns {
266
+ grid-template-columns: auto 1fr;
267
+ }
268
+
269
+ .monster-field-layout > h1,
270
+ .monster-field-layout > h2,
271
+ .monster-field-layout > h3,
272
+ .monster-field-layout > h4,
273
+ .monster-field-layout > h5,
274
+ .monster-field-layout > h6 {
275
+ margin: var(--monster-field-set-heading-margin-top-900, 1.8rem) 0 0.1rem;
276
+ }
277
+
278
+ .monster-field-layout > h1:first-of-type,
279
+ .monster-field-layout > h2:first-of-type,
280
+ .monster-field-layout > h3:first-of-type,
281
+ .monster-field-layout > h4:first-of-type,
282
+ .monster-field-layout > h5:first-of-type {
283
+ margin-top: var(--monster-field-set-heading-margin-top-first-900, 0.5rem);
284
+ }
285
+
286
+ .monster-field-layout > .grid-double-span {
287
+ grid-column: span 1;
288
+ }
289
+ }
290
+
291
+ @container field-layout (max-width: 500px) {
292
+ .monster-field-layout {
293
+ grid-template-columns: 1fr;
294
+ gap: 0;
295
+ }
296
+
297
+ .monster-field-layout > h1,
298
+ .monster-field-layout > h2,
299
+ .monster-field-layout > h3,
300
+ .monster-field-layout > h4,
301
+ .monster-field-layout > h5,
302
+ .monster-field-layout > h6 {
303
+ grid-column: 1;
304
+ margin: var(--monster-field-set-heading-margin-top-500, 1.3rem) 0 0.1rem;
305
+ }
306
+
307
+ .monster-field-layout > h1:first-of-type,
308
+ .monster-field-layout > h2:first-of-type,
309
+ .monster-field-layout > h3:first-of-type,
310
+ .monster-field-layout > h4:first-of-type,
311
+ .monster-field-layout > h5:first-of-type {
312
+ margin-top: var(--monster-field-set-heading-margin-top-first-500, 0.4rem);
313
+ }
314
+
315
+ .monster-field-layout > div.wrapper,
316
+ .monster-field-layout > input,
317
+ .monster-field-layout > monster-toggle-switch,
318
+ .monster-field-layout > monster-password,
319
+ .monster-field-layout > textarea,
320
+ .monster-field-layout > select,
321
+ .monster-field-layout > monster-button,
322
+ .monster-field-layout > monster-action-button,
323
+ .monster-field-layout > monster-state-button,
324
+ .monster-field-layout > monster-api-button,
325
+ .monster-field-layout > monster-datasource-save-button {
326
+ grid-column: 1;
327
+ }
328
+
329
+ .monster-field-layout > label,
330
+ .monster-field-layout > .label {
331
+ padding-top: 1rem;
332
+ border-bottom: none;
333
+ }
334
+
335
+ .monster-field-layout.multiple-columns {
336
+ grid-template-columns: 1fr;
337
+ }
338
+
339
+ .monster-field-layout > .grid-start-1,
340
+ .monster-field-layout > .grid-start-2,
341
+ .monster-field-layout > .grid-start-3,
342
+ .monster-field-layout > .grid-start-4,
343
+ .monster-field-layout > .grid-span-full {
344
+ grid-column: 1 !important;
345
+ }
346
+
347
+ .monster-field-layout > .grid-double-span {
348
+ grid-column: span 1 !important;
349
+ }
350
+ }
@@ -82,6 +82,10 @@
82
82
  }
83
83
  }
84
84
 
85
+ :host([data-monster-context="wizard"]) [data-monster-role=header] {
86
+ border-bottom: none;
87
+ }
88
+
85
89
  .hidden {
86
90
  display: none !important;
87
91
  }
@@ -0,0 +1,57 @@
1
+ @import "../../style/typography.pcss";
2
+ @import "../../style/property.pcss";
3
+ @import "../../style/color.pcss";
4
+ @import "../../style/theme.pcss";
5
+ @import "../../style/control.pcss";
6
+
7
+ :host {
8
+ display: block;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ [data-monster-role="control"] {
13
+ width: 100%;
14
+ }
15
+
16
+ [data-monster-role="body"] {
17
+ display: grid;
18
+ grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
19
+ gap: 1.5rem;
20
+ align-items: start;
21
+ }
22
+
23
+ [data-monster-role="content"] {
24
+ display: grid;
25
+ grid-template-columns: minmax(0, 1fr);
26
+ gap: 1rem;
27
+ }
28
+
29
+ [data-monster-role="status"] {
30
+ color: var(--monster-color-primary-2);
31
+ font-size: 0.95rem;
32
+ justify-self: end;
33
+ text-align: right;
34
+ }
35
+
36
+ monster-message-state-button {
37
+ min-width: 7rem;
38
+ }
39
+
40
+ ::slotted([hidden]) {
41
+ display: none !important;
42
+ }
43
+
44
+ ::slotted([data-monster-role="panel"]) {
45
+ box-sizing: border-box;
46
+ display: block;
47
+ }
48
+
49
+ @media (max-width: 820px) {
50
+ [data-monster-role="body"] {
51
+ grid-template-columns: minmax(0, 1fr);
52
+ }
53
+
54
+ monster-message-state-button {
55
+ flex: 1 1 12rem;
56
+ }
57
+ }