@schukai/monster 3.76.0 → 3.77.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/source/components/datatable/change-button.mjs +1 -1
  4. package/source/components/datatable/columnbar.mjs +1 -1
  5. package/source/components/datatable/dataset.mjs +1 -1
  6. package/source/components/datatable/datasource/dom.mjs +1 -1
  7. package/source/components/datatable/datasource/rest.mjs +1 -1
  8. package/source/components/datatable/datasource.mjs +1 -1
  9. package/source/components/datatable/datatable.mjs +1 -1
  10. package/source/components/datatable/filter/date-range.mjs +1 -1
  11. package/source/components/datatable/filter/input.mjs +1 -1
  12. package/source/components/datatable/filter/range.mjs +1 -1
  13. package/source/components/datatable/filter/select.mjs +1 -1
  14. package/source/components/datatable/filter-button.mjs +1 -1
  15. package/source/components/datatable/filter.mjs +1 -1
  16. package/source/components/datatable/pagination.mjs +1 -1
  17. package/source/components/datatable/save-button.mjs +1 -1
  18. package/source/components/datatable/status.mjs +1 -1
  19. package/source/components/form/action-button.mjs +1 -1
  20. package/source/components/form/api-button.mjs +1 -1
  21. package/source/components/form/button-bar.mjs +1 -1
  22. package/source/components/form/button.mjs +1 -1
  23. package/source/components/form/confirm-button.mjs +1 -1
  24. package/source/components/form/context-error.mjs +2 -2
  25. package/source/components/form/context-help.mjs +1 -1
  26. package/source/components/form/field-set.mjs +31 -44
  27. package/source/components/form/message-state-button.mjs +1 -1
  28. package/source/components/form/popper-button.mjs +1 -1
  29. package/source/components/form/reload.mjs +1 -1
  30. package/source/components/form/select.mjs +1 -1
  31. package/source/components/form/shadow-reload.mjs +1 -1
  32. package/source/components/form/state-button.mjs +1 -1
  33. package/source/components/form/style/field-set.pcss +164 -70
  34. package/source/components/form/stylesheet/field-set.mjs +7 -14
  35. package/source/components/form/template.mjs +1 -1
  36. package/source/components/form/toggle-switch.mjs +321 -340
  37. package/source/components/form/tree-select.mjs +1 -1
  38. package/source/components/host/call-button.mjs +1 -1
  39. package/source/components/host/collapse.mjs +1 -1
  40. package/source/components/host/config-manager.mjs +1 -1
  41. package/source/components/host/host.mjs +1 -1
  42. package/source/components/host/overlay.mjs +1 -1
  43. package/source/components/host/toggle-button.mjs +1 -1
  44. package/source/components/host/viewer.mjs +1 -1
  45. package/source/components/layout/collapse.mjs +21 -21
  46. package/source/components/layout/details.mjs +11 -11
  47. package/source/components/layout/iframe.mjs +1 -1
  48. package/source/components/layout/panel.mjs +1 -1
  49. package/source/components/layout/popper.mjs +1 -1
  50. package/source/components/layout/slider.mjs +1 -1
  51. package/source/components/layout/split-panel.mjs +1 -1
  52. package/source/components/layout/tabs.mjs +1 -1
  53. package/source/components/layout/width-toggle.mjs +17 -9
  54. package/source/components/navigation/table-of-content.mjs +1 -1
  55. package/source/components/state/log.mjs +167 -153
  56. package/source/components/state/state.mjs +9 -33
  57. package/source/components/stylesheet/form.mjs +6 -13
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.77.0] - 2024-10-03
6
+
7
+ ### Add Features
8
+
9
+ - multipleColumns [#242](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/242)
10
+ ### Changes
11
+
12
+ - doc and code tidy
13
+ - update documentaion
14
+
15
+
16
+
5
17
  ## [3.76.0] - 2024-10-01
6
18
 
7
19
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.11","@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":"3.76.0"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.11","@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":"3.77.0"}
@@ -97,7 +97,7 @@ class ChangeButton extends CustomElement {
97
97
  }
98
98
 
99
99
  /**
100
- * To set the options via the html tag the attribute `data-monster-options` must be used.
100
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
101
101
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
102
102
  *
103
103
  * The individual configuration values can be found in the table.
@@ -103,7 +103,7 @@ class ColumnBar extends CustomElement {
103
103
  }
104
104
 
105
105
  /**
106
- * To set the options via the html tag the attribute `data-monster-options` must be used.
106
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
107
107
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
108
108
  *
109
109
  * The individual configuration values can be found in the table.
@@ -100,7 +100,7 @@ class DataSet extends CustomElement {
100
100
  }
101
101
 
102
102
  /**
103
- * To set the options via the html tag the attribute `data-monster-options` must be used.
103
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
104
104
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
105
105
  *
106
106
  * The individual configuration values can be found in the table.
@@ -59,7 +59,7 @@ class Dom extends Datasource {
59
59
  }
60
60
 
61
61
  /**
62
- * To set the options via the html tag the attribute `data-monster-options` must be used.
62
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
63
63
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
64
64
  *
65
65
  * The individual configuration values can be found in the table.
@@ -100,7 +100,7 @@ class Rest extends Datasource {
100
100
  }
101
101
 
102
102
  /**
103
- * To set the options via the html tag the attribute `data-monster-options` must be used.
103
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
104
104
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
105
105
  *
106
106
  * The individual configuration values can be found in the table.
@@ -65,7 +65,7 @@ class Datasource extends CustomElement {
65
65
  }
66
66
 
67
67
  /**
68
- * To set the options via the html tag the attribute `data-monster-options` must be used.
68
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
69
69
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
70
70
  *
71
71
  * The individual configuration values can be found in the table.
@@ -153,7 +153,7 @@ class DataTable extends CustomElement {
153
153
  }
154
154
 
155
155
  /**
156
- * To set the options via the html tag the attribute `data-monster-options` must be used.
156
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
157
157
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
158
158
  *
159
159
  * The individual configuration values can be found in the table.
@@ -185,7 +185,7 @@ class DateRange extends AbstractBase {
185
185
  }
186
186
 
187
187
  /**
188
- * To set the options via the html tag the attribute `data-monster-options` must be used.
188
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
189
189
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
190
190
  *
191
191
  * The individual configuration values can be found in the table.
@@ -82,7 +82,7 @@ class Input extends AbstractBase {
82
82
  }
83
83
 
84
84
  /**
85
- * To set the options via the html tag the attribute `data-monster-options` must be used.
85
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
86
86
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
87
87
  *
88
88
  * The individual configuration values can be found in the table.
@@ -155,7 +155,7 @@ class Range extends AbstractBase {
155
155
  }
156
156
 
157
157
  /**
158
- * To set the options via the html tag the attribute `data-monster-options` must be used.
158
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
159
159
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
160
160
  *
161
161
  * The individual configuration values can be found in the table.
@@ -38,7 +38,7 @@ import { FilterSelectStyleSheet } from "../stylesheet/filter-select.mjs";
38
38
  */
39
39
  class FilterSelect extends Select {
40
40
  /**
41
- * To set the options via the html tag the attribute `data-monster-options` must be used.
41
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
42
42
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
43
43
  *
44
44
  * The individual configuration values can be found in the table.
@@ -70,7 +70,7 @@ class FilterButton extends ToggleButton {
70
70
  }
71
71
 
72
72
  /**
73
- * To set the options via the html tag the attribute `data-monster-options` must be used.
73
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
74
74
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
75
75
  *
76
76
  * The individual configuration values can be found in the table.
@@ -207,7 +207,7 @@ class Filter extends CustomElement {
207
207
  }
208
208
 
209
209
  /**
210
- * To set the options via the html tag the attribute `data-monster-options` must be used.
210
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
211
211
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
212
212
  *
213
213
  * The individual configuration values can be found in the table.
@@ -100,7 +100,7 @@ class Pagination extends CustomElement {
100
100
  }
101
101
 
102
102
  /**
103
- * To set the options via the html tag the attribute `data-monster-options` must be used.
103
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
104
104
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
105
105
  *
106
106
  * The individual configuration values can be found in the table.
@@ -70,7 +70,7 @@ class SaveButton extends CustomElement {
70
70
  }
71
71
 
72
72
  /**
73
- * To set the options via the html tag the attribute `data-monster-options` must be used.
73
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
74
74
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
75
75
  *
76
76
  * The individual configuration values can be found in the table.
@@ -95,7 +95,7 @@ class DatasourceStatus extends CustomElement {
95
95
  }
96
96
 
97
97
  /**
98
- * To set the options via the html tag the attribute `data-monster-options` must be used.
98
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
99
99
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
100
100
  *
101
101
  * The individual configuration values can be found in the table.
@@ -97,7 +97,7 @@ class ActionButton extends PopperButton {
97
97
  }
98
98
 
99
99
  /**
100
- * To set the options via the html tag the attribute `data-monster-options` must be used.
100
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
101
101
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
102
102
  *
103
103
  * The individual configuration values can be found in the table.
@@ -108,7 +108,7 @@ class ApiButton extends ActionButton {
108
108
  }
109
109
 
110
110
  /**
111
- * To set the options via the html tag the attribute `data-monster-options` must be used.
111
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
112
112
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
113
113
  *
114
114
  * The individual configuration values can be found in the table.
@@ -180,7 +180,7 @@ class ButtonBar extends CustomElement {
180
180
  }
181
181
 
182
182
  /**
183
- * To set the options via the html tag the attribute `data-monster-options` must be used.
183
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
184
184
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
185
185
  *
186
186
  * The individual configuration values can be found in the table.
@@ -179,7 +179,7 @@ class Button extends CustomControl {
179
179
  }
180
180
 
181
181
  /**
182
- * To set the options via the html tag the attribute `data-monster-options` must be used.
182
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
183
183
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
184
184
  *
185
185
  * The individual configuration values can be found in the table.
@@ -114,7 +114,7 @@ class ConfirmButton extends PopperButton {
114
114
  }
115
115
 
116
116
  /**
117
- * To set the options via the html tag the attribute `data-monster-options` must be used.
117
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
118
118
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
119
119
  *
120
120
  * The individual configuration values can be found in the table.
@@ -104,7 +104,7 @@ class ContextError extends Popper {
104
104
  }
105
105
 
106
106
  /**
107
- * To set the options via the html tag the attribute `data-monster-options` must be used.
107
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
108
108
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
109
109
  *
110
110
  * The individual configuration values can be found in the table.
@@ -228,7 +228,7 @@ class ContextError extends Popper {
228
228
  }
229
229
 
230
230
  /**
231
- * Returns the html tag of the control.
231
+ * Returns the HTML Tag of the control.
232
232
  *
233
233
  * @return {string}
234
234
  */
@@ -79,7 +79,7 @@ class ContextHelp extends Popper {
79
79
  }
80
80
 
81
81
  /**
82
- * To set the options via the html tag the attribute `data-monster-options` must be used.
82
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
83
83
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
84
84
  *
85
85
  * The individual configuration values can be found in the table.
@@ -67,39 +67,6 @@ const toggleSwitchElementSymbol = Symbol("toggleSwitchElement");
67
67
  */
68
68
  const extendedSwitchElementSymbol = Symbol("extendedSwitchElement");
69
69
 
70
- /**
71
- * This CustomControl creates a FieldSet element with a variety of options.
72
- *
73
- * <img src="./images/field-set.png">
74
- *
75
- * You can create this control either by specifying the HTML tag <monster-field-set />` directly in the HTML or using
76
- * Javascript via the `document.createElement('monster-field-set');` method.
77
- *
78
- * ```html
79
- * <monster-field-set></monster-field-set>
80
- * ```
81
- *
82
- * Or you can create this CustomControl directly in Javascript:
83
- *
84
- * ```js
85
- * import {FieldSet} from '@schukai/monster/source/components/form/field-set.mjs';
86
- * document.createElement('monster-field-set');
87
- * ```
88
- *
89
- * @externalExample ../..../example/components/form/field-set.mjs
90
- * @startuml field-set.png
91
- * skinparam monochrome true
92
- * skinparam shadowing false
93
- * HTMLElement <|-- CustomElement
94
- * CustomElement <|-- CustomControl
95
- * CustomControl <|-- FieldSet
96
- * @enduml
97
- *
98
- * @copyright schukai GmbH
99
- * @memberOf Monster.Components.Form
100
- * @summary A simple FieldSet
101
- */
102
-
103
70
  /**
104
71
  * A field set control that can be used to group form elements.
105
72
  *
@@ -128,11 +95,12 @@ class FieldSet extends CustomControl {
128
95
  initControlReferences.call(this);
129
96
  initEventHandler.call(this);
130
97
  updateExtendedFields.call(this);
98
+ updateColumns.call(this);
131
99
  return this;
132
100
  }
133
101
 
134
102
  /**
135
- * To set the options via the html tag the attribute `data-monster-options` must be used.
103
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
136
104
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
137
105
  *
138
106
  * The individual configuration values can be found in the table.
@@ -143,6 +111,7 @@ class FieldSet extends CustomControl {
143
111
  * @property {Object} actions Callbacks
144
112
  * @property {string} actions.click="throw Error" Callback when clicked
145
113
  * @property {Object} features Features
114
+ * @property {boolean} features.multipleColumns=true Multiple columns
146
115
  * @property {Object} classes CSS classes
147
116
  * @property {boolean} disabled=false Disabled state
148
117
  */
@@ -152,14 +121,16 @@ class FieldSet extends CustomControl {
152
121
  main: getTemplate(),
153
122
  },
154
123
  labels: {
155
- "toggle-switch-on": "✔",
156
- "toggle-switch-off": "✖",
157
- "toggle-switch-label": "Expand",
124
+ toggleSwitchOn: "✔",
125
+ toggleSwitchOff: "✖",
126
+ toggleSwitchLabel: "Expand",
158
127
  title: "",
159
128
  },
160
129
  classes: {},
161
130
  disabled: false,
162
- features: {},
131
+ features: {
132
+ multipleColumns: true,
133
+ },
163
134
  actions: {
164
135
  click: () => {
165
136
  throw new Error("the click action is not defined");
@@ -257,7 +228,7 @@ class FieldSet extends CustomControl {
257
228
  }
258
229
 
259
230
  /**
260
- * Set value of the form control.
231
+ * Set the value of the form control.
261
232
  *
262
233
  * ```
263
234
  * e = document.querySelector('monster-field-set');
@@ -277,6 +248,9 @@ class FieldSet extends CustomControl {
277
248
  }
278
249
  }
279
250
 
251
+ /**
252
+ * @private
253
+ */
280
254
  function updateExtendedFields() {
281
255
  const nodes = getSlottedElements.call(this, "", "extended");
282
256
  if (nodes.size > 0) {
@@ -286,19 +260,32 @@ function updateExtendedFields() {
286
260
  }
287
261
  }
288
262
 
263
+ /**
264
+ * @private
265
+ */
266
+ function updateColumns() {
267
+ if (this.getOption("features.multipleColumns") !== true) {
268
+ this[fieldSetElementSymbol].classList.remove("multiple-columns");
269
+ return;
270
+ }
271
+
272
+ this[fieldSetElementSymbol].classList.add("multiple-columns");
273
+
274
+ }
275
+
289
276
  /**
290
277
  * @private
291
278
  * @return {initEventHandler}
292
- * @fires Monster.Components.Form.event:monster-field-set-clicked
279
+ * @fires event:monster-field-set-clicked
293
280
  */
294
281
  function initEventHandler() {
295
282
  this[toggleSwitchElementSymbol].setOption(
296
- "labels.toggle-switch-on",
297
- this.getOption("labels.toggle-switch-on"),
283
+ "labels.toggleSwitchOn",
284
+ this.getOption("labels.toggleSwitchOn"),
298
285
  );
299
286
  this[toggleSwitchElementSymbol].setOption(
300
- "labels.toggle-switch-off",
301
- this.getOption("labels.toggle-switch-off"),
287
+ "labels.toggleSwitchOff",
288
+ this.getOption("labels.toggleSwitchOff"),
302
289
  );
303
290
 
304
291
  this[toggleSwitchElementSymbol].setOption("actions.on", () => {
@@ -123,7 +123,7 @@ class MessageStateButton extends Popper {
123
123
  }
124
124
 
125
125
  /**
126
- * To set the options via the html tag the attribute `data-monster-options` must be used.
126
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
127
127
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
128
128
  *
129
129
  * The individual configuration values can be found in the table.
@@ -154,7 +154,7 @@ class PopperButton extends Popper {
154
154
  }
155
155
 
156
156
  /**
157
- * To set the options via the html tag the attribute `data-monster-options` must be used.
157
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
158
158
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
159
159
  *
160
160
  * The individual configuration values can be found in the table.
@@ -128,7 +128,7 @@ class Reload extends CustomElement {
128
128
  }
129
129
 
130
130
  /**
131
- * To set the options via the html tag the attribute `data-monster-options` must be used.
131
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
132
132
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
133
133
  *
134
134
  * The individual configuration values can be found in the table.
@@ -347,7 +347,7 @@ class Select extends CustomControl {
347
347
  }
348
348
 
349
349
  /**
350
- * To set the options via the html tag the attribute `data-monster-options` must be used.
350
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
351
351
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
352
352
  *
353
353
  * The individual configuration values can be found in the table.
@@ -40,7 +40,7 @@ class ShadowReload extends Reload {
40
40
  }
41
41
 
42
42
  /**
43
- * To set the options via the html tag the attribute `data-monster-options` must be used.
43
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
44
44
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
45
45
  *
46
46
  * The individual configuration values can be found in the table.
@@ -46,7 +46,7 @@ class StateButton extends Button {
46
46
  }
47
47
 
48
48
  /**
49
- * To set the options via the html tag the attribute `data-monster-options` must be used.
49
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
50
50
  * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
51
51
  *
52
52
  * The individual configuration values can be found in the table.