@schukai/monster 3.64.1 → 3.65.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/example/components/form/button.mjs +1 -1
  3. package/example/components/form/field-set.mjs +4 -0
  4. package/example/components/form/select.mjs +1 -1
  5. package/package.json +2 -1
  6. package/source/components/datatable/datatable/header.mjs +228 -221
  7. package/source/components/datatable/style/dataset.pcss +1 -0
  8. package/source/components/datatable/style/datatable.pcss +1 -0
  9. package/source/components/datatable/stylesheet/dataset.mjs +1 -1
  10. package/source/components/datatable/stylesheet/datatable.mjs +1 -1
  11. package/source/components/form/button.mjs +263 -281
  12. package/source/components/form/field-set.mjs +300 -0
  13. package/source/components/form/popper.mjs +13 -480
  14. package/source/components/form/style/field-set.pcss +13 -0
  15. package/source/components/form/stylesheet/button-bar.mjs +1 -1
  16. package/source/components/form/stylesheet/confirm-button.mjs +1 -1
  17. package/source/components/form/stylesheet/field-set.mjs +31 -0
  18. package/source/components/form/stylesheet/form.mjs +1 -1
  19. package/source/components/host/collapse.mjs +14 -516
  20. package/source/components/host/config-manager.mjs +9 -2
  21. package/source/components/host/constants.mjs +9 -4
  22. package/source/components/host/details.mjs +14 -253
  23. package/source/components/host/stylesheet/host.mjs +1 -1
  24. package/source/components/host/stylesheet/overlay.mjs +1 -1
  25. package/source/components/layout/collapse.mjs +542 -0
  26. package/source/components/layout/details.mjs +271 -0
  27. package/source/components/layout/popper.mjs +476 -0
  28. package/source/components/layout/tabs.mjs +3 -3
  29. package/source/components/layout/width-toggle.mjs +3 -3
  30. package/source/components/navigation/style/table-of-content.pcss +84 -0
  31. package/source/components/navigation/stylesheet/table-of-content.mjs +31 -0
  32. package/source/components/navigation/table-of-content.mjs +418 -0
  33. package/source/components/state/stylesheet/state.mjs +1 -1
  34. package/source/components/style/link.pcss +0 -1
  35. package/source/components/style/mixin/typography.pcss +7 -7
  36. package/source/components/style/typography.pcss +1 -1
  37. package/source/components/stylesheet/typography.mjs +1 -1
  38. package/source/dom/ready.mjs +10 -4
  39. package/source/monster.mjs +5 -84
  40. package/source/types/proxyobserver.mjs +4 -2
  41. package/source/types/version.mjs +1 -1
  42. package/test/cases/monster.mjs +1 -1
  43. package/test/web/tests.js +4 -4
  44. package/source/components/form/form-field.mjs +0 -341
  45. package/source/components/form/style/form-field.pcss +0 -4
  46. package/source/components/form/stylesheet/form-field.mjs +0 -31
  47. /package/source/components/{host → layout}/style/collapse.pcss +0 -0
  48. /package/source/components/{host → layout}/style/details.pcss +0 -0
  49. /package/source/components/{form → layout}/style/popper.pcss +0 -0
  50. /package/source/components/{host → layout}/stylesheet/collapse.mjs +0 -0
  51. /package/source/components/{host → layout}/stylesheet/details.mjs +0 -0
  52. /package/source/components/{form → layout}/stylesheet/popper.mjs +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,22 @@
1
1
 
2
+ ## [3.65.0] - 2024-04-15
3
+
4
+ ### Add Features
5
+
6
+ - new toc control finished [#189](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/189)
7
+ - new toc component [#189](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/189)
8
+ - new toc component [#189](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/189)
9
+ - new toc component [#188](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/188)
10
+ - new component field-set [#186](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/186)
11
+ ### Changes
12
+
13
+ - documetation script
14
+ - wip showroom
15
+ - update build scripts [#186](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/186)
16
+ ### Code Refactoring
17
+
18
+ - move popper to layout namespace [#190](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/190) [#189](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/189)
19
+
2
20
  ## [3.64.1] - 2024-04-07
3
21
 
4
22
  ### Bug Fixes
@@ -6,6 +24,7 @@
6
24
  - monster.mjs
7
25
  ### Changes
8
26
 
27
+ - release and publish to npm new version 3.64.1
9
28
  - update license text
10
29
  - fix import statements
11
30
  - add showroot files
@@ -1,4 +1,4 @@
1
- import {Button} from '@schukai/component-form/source/button.js';
1
+ import {Button} from '@schukai/monster/source/components/form/button.js';
2
2
 
3
3
  const button = document.createElement('monster-button');
4
4
  // set label
@@ -0,0 +1,4 @@
1
+ import "@schukai/monster/source/components/form/field-set.mjs";
2
+ const element = document.createElement('monster-field-set');
3
+ element.setOption('disable', 'false')
4
+ document.body.appendChild(element);
@@ -1,4 +1,4 @@
1
- import {Select} from '@schukai/component-form/source/select.js';
1
+ import '@schukai/component-form/source/select.js';
2
2
 
3
3
  const select = document.createElement('monster-select');
4
4
  select.setOption('mapping.labelTemplate', '${name} (${alpha-2})')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schukai/monster",
3
- "version": "3.64.1",
3
+ "version": "3.65.0",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -42,6 +42,7 @@
42
42
  "dependencies": {
43
43
  "@floating-ui/dom": "^1.6.3",
44
44
  "@popperjs/core": "^2.11.8",
45
+ "estraverse": "^5.3.0",
45
46
  "vite-plugin-directory-index": "^3.0.1"
46
47
  }
47
48
  }
@@ -1,24 +1,31 @@
1
1
  /**
2
- * Copyright 2023 schukai GmbH
3
- * SPDX-License-Identifier: AGPL-3.0
2
+ * Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. 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 schukai GmbH.
4
11
  */
5
12
 
6
- import { Base } from "../../../types/base.mjs";
7
- import { equipWithInternal } from "../../../types/internal.mjs";
8
- import { instanceSymbol } from "../../../constants.mjs";
9
- import { Observer } from "../../../types/observer.mjs";
10
- import { ATTRIBUTE_DATATABLE_SORTABLE } from "../../constants.mjs";
13
+ import {Base} from "../../../types/base.mjs";
14
+ import {equipWithInternal} from "../../../types/internal.mjs";
15
+ import {instanceSymbol} from "../../../constants.mjs";
16
+ import {Observer} from "../../../types/observer.mjs";
17
+ import {ATTRIBUTE_DATATABLE_SORTABLE} from "../../constants.mjs";
11
18
  import {
12
- validateIterable,
13
- validateInstance,
19
+ validateIterable,
20
+ validateInstance,
14
21
  } from "../../../types/validate.mjs";
15
22
 
16
23
  export {
17
- Header,
18
- DIRECTION_ASC,
19
- DIRECTION_DESC,
20
- DIRECTION_NONE,
21
- createOrderStatement,
24
+ Header,
25
+ DIRECTION_ASC,
26
+ DIRECTION_DESC,
27
+ DIRECTION_NONE,
28
+ createOrderStatement,
22
29
  };
23
30
 
24
31
  /**
@@ -36,7 +43,7 @@ const DIRECTION_ASC = "asc";
36
43
  const DIRECTION_DESC = "desc";
37
44
 
38
45
  /**
39
- * no direction and no order statement
46
+ * no direction and no order statement
40
47
  *
41
48
  * @private
42
49
  * @type {string}
@@ -51,178 +58,178 @@ const DIRECTION_NONE = "";
51
58
  * @summary A datatable
52
59
  */
53
60
  class Header extends Base {
54
- constructor() {
55
- super();
56
-
57
- /**
58
- * - attachInternalObserver
59
- * - detachInternalObserver
60
- * - containsInternalObserver
61
- * - setInternal
62
- * - setInternals
63
- * - getInternal
64
- */
65
- equipWithInternal.call(this);
66
-
67
- this.attachInternalObserver(
68
- new Observer(() => {
69
- updateStruct.call(this);
70
- }),
71
- );
72
- }
73
-
74
- /**
75
- * This method is called by the `instanceof` operator.
76
- * @returns {symbol}
77
- */
78
- static get [instanceSymbol]() {
79
- return Symbol.for("@schukai/monster/components/datatable/header");
80
- }
81
-
82
- /**
83
- *
84
- * @returns {object}
85
- */
86
- get internalDefaults() {
87
- return {
88
- field: undefined,
89
- html: undefined,
90
- order: undefined,
91
- direction: undefined,
92
- label: undefined,
93
- labelKey: undefined,
94
- classes: undefined,
95
- index: undefined,
96
- mode: undefined,
97
- grid: undefined,
98
- };
99
- }
100
-
101
- changeDirection() {
102
- let direction = this.getInternal("direction");
103
- if (direction === DIRECTION_ASC) {
104
- direction = DIRECTION_DESC;
105
- } else if (direction === DIRECTION_DESC) {
106
- direction = DIRECTION_NONE;
107
- } else {
108
- direction = DIRECTION_ASC;
109
- }
110
- this.setInternal("direction", direction);
111
- }
112
-
113
- /**
114
- *
115
- * @param direction
116
- */
117
- setDirection(direction) {
118
- this.setInternal("direction", direction);
119
- }
120
-
121
- /**
122
- * @param {string} field
123
- */
124
- set field(field) {
125
- this.setInternal("field", String(field));
126
- }
127
-
128
- /**
129
- * @param {string} direction
130
- */
131
- set direction(direction) {
132
- this.setInternal("direction", String(direction));
133
- }
134
-
135
- set labelKey(labelKey) {
136
- this.setInternal("labelKey", String(labelKey));
137
- }
138
-
139
- /**
140
- * @param {string} label
141
- */
142
- set label(label) {
143
- this.setInternal("label", String(label));
144
- }
145
-
146
- /**
147
- * @param {string} classes
148
- */
149
- set classes(classes) {
150
- this.setInternal("classes", String(classes));
151
- }
152
-
153
- /**
154
- * @param {number} index
155
- */
156
- set index(index) {
157
- this.setInternal("index", String(index));
158
- }
159
-
160
- /**
161
- * @param {string} grid
162
- */
163
- get grid() {
164
- return this.getInternal("grid");
165
- }
166
-
167
- /**
168
- * @returns {string}
169
- */
170
- get labelKey() {
171
- return this.getInternal("labelKey");
172
- }
173
-
174
- /**
175
- * @returns {string}
176
- */
177
- get html() {
178
- return this.getInternal("html");
179
- }
180
-
181
- get order() {
182
- return this.getInternal("order");
183
- }
184
-
185
- /**
186
- * @returns {string}
187
- */
188
- get field() {
189
- return this.getInternal("field");
190
- }
191
-
192
- /**
193
- * @returns {string}
194
- */
195
- get index() {
196
- return this.getInternal("index");
197
- }
198
-
199
- /**
200
- * @returns {string}
201
- */
202
- get classes() {
203
- return this.getInternal("classes");
204
- }
205
-
206
- /**
207
- * @returns {string}
208
- */
209
- get label() {
210
- return this.getInternal("label");
211
- }
212
-
213
- /**
214
- * @returns {string}
215
- */
216
- get direction() {
217
- return this.getInternal("direction");
218
- }
219
-
220
- /**
221
- * @returns {string}
222
- */
223
- get mode() {
224
- return this.getInternal("mode");
225
- }
61
+ constructor() {
62
+ super();
63
+
64
+ /**
65
+ * - attachInternalObserver
66
+ * - detachInternalObserver
67
+ * - containsInternalObserver
68
+ * - setInternal
69
+ * - setInternals
70
+ * - getInternal
71
+ */
72
+ equipWithInternal.call(this);
73
+
74
+ this.attachInternalObserver(
75
+ new Observer(() => {
76
+ updateStruct.call(this);
77
+ }),
78
+ );
79
+ }
80
+
81
+ /**
82
+ * This method is called by the `instanceof` operator.
83
+ * @returns {symbol}
84
+ */
85
+ static get [instanceSymbol]() {
86
+ return Symbol.for("@schukai/monster/components/datatable/header@@instance");
87
+ }
88
+
89
+ /**
90
+ *
91
+ * @returns {object}
92
+ */
93
+ get internalDefaults() {
94
+ return {
95
+ field: undefined,
96
+ html: undefined,
97
+ order: undefined,
98
+ direction: undefined,
99
+ label: undefined,
100
+ labelKey: undefined,
101
+ classes: undefined,
102
+ index: undefined,
103
+ mode: undefined,
104
+ grid: undefined,
105
+ };
106
+ }
107
+
108
+ changeDirection() {
109
+ let direction = this.getInternal("direction");
110
+ if (direction === DIRECTION_ASC) {
111
+ direction = DIRECTION_DESC;
112
+ } else if (direction === DIRECTION_DESC) {
113
+ direction = DIRECTION_NONE;
114
+ } else {
115
+ direction = DIRECTION_ASC;
116
+ }
117
+ this.setInternal("direction", direction);
118
+ }
119
+
120
+ /**
121
+ *
122
+ * @param direction
123
+ */
124
+ setDirection(direction) {
125
+ this.setInternal("direction", direction);
126
+ }
127
+
128
+ /**
129
+ * @param {string} field
130
+ */
131
+ set field(field) {
132
+ this.setInternal("field", String(field));
133
+ }
134
+
135
+ /**
136
+ * @param {string} direction
137
+ */
138
+ set direction(direction) {
139
+ this.setInternal("direction", String(direction));
140
+ }
141
+
142
+ set labelKey(labelKey) {
143
+ this.setInternal("labelKey", String(labelKey));
144
+ }
145
+
146
+ /**
147
+ * @param {string} label
148
+ */
149
+ set label(label) {
150
+ this.setInternal("label", String(label));
151
+ }
152
+
153
+ /**
154
+ * @param {string} classes
155
+ */
156
+ set classes(classes) {
157
+ this.setInternal("classes", String(classes));
158
+ }
159
+
160
+ /**
161
+ * @param {number} index
162
+ */
163
+ set index(index) {
164
+ this.setInternal("index", String(index));
165
+ }
166
+
167
+ /**
168
+ * @param {string} grid
169
+ */
170
+ get grid() {
171
+ return this.getInternal("grid");
172
+ }
173
+
174
+ /**
175
+ * @returns {string}
176
+ */
177
+ get labelKey() {
178
+ return this.getInternal("labelKey");
179
+ }
180
+
181
+ /**
182
+ * @returns {string}
183
+ */
184
+ get html() {
185
+ return this.getInternal("html");
186
+ }
187
+
188
+ get order() {
189
+ return this.getInternal("order");
190
+ }
191
+
192
+ /**
193
+ * @returns {string}
194
+ */
195
+ get field() {
196
+ return this.getInternal("field");
197
+ }
198
+
199
+ /**
200
+ * @returns {string}
201
+ */
202
+ get index() {
203
+ return this.getInternal("index");
204
+ }
205
+
206
+ /**
207
+ * @returns {string}
208
+ */
209
+ get classes() {
210
+ return this.getInternal("classes");
211
+ }
212
+
213
+ /**
214
+ * @returns {string}
215
+ */
216
+ get label() {
217
+ return this.getInternal("label");
218
+ }
219
+
220
+ /**
221
+ * @returns {string}
222
+ */
223
+ get direction() {
224
+ return this.getInternal("direction");
225
+ }
226
+
227
+ /**
228
+ * @returns {string}
229
+ */
230
+ get mode() {
231
+ return this.getInternal("mode");
232
+ }
226
233
  }
227
234
 
228
235
  /**
@@ -231,44 +238,44 @@ class Header extends Base {
231
238
  * @returns {string}
232
239
  */
233
240
  function createOrderStatement(headers) {
234
- validateIterable(headers);
235
-
236
- const oderStatement = [];
237
- for (const header of headers) {
238
- validateInstance(header, Header);
239
- const order = header.getInternal("order");
240
-
241
- if (!order) {
242
- continue;
243
- }
244
- oderStatement.push(order);
245
- }
246
- return oderStatement.join(",");
241
+ validateIterable(headers);
242
+
243
+ const oderStatement = [];
244
+ for (const header of headers) {
245
+ validateInstance(header, Header);
246
+ const order = header.getInternal("order");
247
+
248
+ if (!order) {
249
+ continue;
250
+ }
251
+ oderStatement.push(order);
252
+ }
253
+ return oderStatement.join(",");
247
254
  }
248
255
 
249
256
  /**
250
257
  * @private
251
258
  */
252
259
  function updateStruct() {
253
- const label = this.getInternal("label");
254
- const direction = this.getInternal("direction");
255
- const field = this.getInternal("field");
256
-
257
- let order = "";
258
-
259
- if (!field) {
260
- this.setInternal("order", order);
261
- this.setInternal("html", label);
262
- return;
263
- }
264
-
265
- if (direction) {
266
- order = `${field} ${direction}`.trim();
267
- }
268
-
269
- this.setInternal("order", order);
270
- this.setInternal(
271
- "html",
272
- `<a href="#" ${ATTRIBUTE_DATATABLE_SORTABLE}="${order}">${label}</a>`,
273
- );
260
+ const label = this.getInternal("label");
261
+ const direction = this.getInternal("direction");
262
+ const field = this.getInternal("field");
263
+
264
+ let order = "";
265
+
266
+ if (!field) {
267
+ this.setInternal("order", order);
268
+ this.setInternal("html", label);
269
+ return;
270
+ }
271
+
272
+ if (direction) {
273
+ order = `${field} ${direction}`.trim();
274
+ }
275
+
276
+ this.setInternal("order", order);
277
+ this.setInternal(
278
+ "html",
279
+ `<a href="#" ${ATTRIBUTE_DATATABLE_SORTABLE}="${order}">${label}</a>`,
280
+ );
274
281
  }
@@ -10,5 +10,6 @@
10
10
  @import "../../style/badge.pcss";
11
11
  @import "../../style/icons.pcss";
12
12
  @import "../../style/link.pcss";
13
+ @import "../../style/skeleton.pcss";
13
14
 
14
15
 
@@ -15,6 +15,7 @@
15
15
  @import "../../style/mixin/hover.pcss";
16
16
  @import "../../style/mixin/media.pcss";
17
17
  @import "../../style/theme.pcss";
18
+ @import "../../style/skeleton.pcss";
18
19
 
19
20
  [data-monster-role="control"] {
20
21
  display: flex;