@schukai/monster 3.96.1 → 3.96.3
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 +20 -5
- package/package.json +1 -1
- package/source/components/datatable/change-button.mjs +39 -41
- package/source/components/datatable/dataset.mjs +335 -325
- package/source/components/datatable/datasource/rest.mjs +33 -29
- package/source/components/datatable/embedded-pagination.mjs +3 -1
- package/source/components/datatable/filter.mjs +164 -63
- package/source/components/datatable/pagination.mjs +13 -6
- package/source/components/datatable/save-button.mjs +25 -3
- package/source/components/datatable/status.mjs +21 -26
- package/source/components/datatable/style/status.pcss +12 -2
- package/source/components/datatable/stylesheet/status.mjs +1 -1
- package/source/components/datatable/util.mjs +1 -2
- package/source/components/form/form.mjs +5 -4
- package/source/components/form/select.mjs +2008 -2013
- package/source/components/form/style/field-set.pcss +28 -7
- package/source/components/form/style/toggle-switch.pcss +13 -2
- package/source/components/form/stylesheet/field-set.mjs +14 -7
- package/source/components/form/stylesheet/toggle-switch.mjs +14 -7
- package/source/components/form/toggle-switch.mjs +372 -380
- package/source/components/layout/tabs.mjs +1 -2
- package/source/constants.mjs +14 -1
- package/source/data/extend.mjs +2 -1
- package/source/data/transformer.mjs +2 -0
- package/source/dom/constants.mjs +0 -1
- package/source/dom/customelement.mjs +7 -3
- package/source/dom/updater.mjs +5 -1
- package/source/monster.mjs +1 -1
- package/source/text/formatter.mjs +5 -3
- package/source/types/is.mjs +13 -0
- package/source/types/proxyobserver.mjs +7 -2
- package/source/types/version.mjs +1 -1
- package/source/util/clone.mjs +9 -14
- package/test/cases/data/pathfinder.mjs +18 -0
- package/test/cases/monster.mjs +1 -1
- package/test/cases/text/formatter.mjs +21 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +266 -176
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,24 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## [3.96.3] - 2025-01-03
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- optimize the filter rest api pipeline [#274](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/274) [#241](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/241)
|
10
|
+
- update undefined handling [#275](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/275)
|
11
|
+
- repair some small issues [#274](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/274)
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
## [3.96.2] - 2024-12-31
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
- update small things ....
|
20
|
+
|
21
|
+
|
22
|
+
|
5
23
|
## [3.96.1] - 2024-12-30
|
6
24
|
|
7
25
|
### Bug Fixes
|
@@ -19,15 +37,16 @@
|
|
19
37
|
### Add Features
|
20
38
|
|
21
39
|
- **tabs:** add auto open feature [#273](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/273)
|
40
|
+
|
22
41
|
### Bug Fixes
|
23
42
|
|
24
43
|
- the form tests are outdated
|
44
|
+
|
25
45
|
### Changes
|
26
46
|
|
27
47
|
- update project
|
28
48
|
|
29
49
|
|
30
|
-
|
31
50
|
## [3.95.2] - 2024-12-28
|
32
51
|
|
33
52
|
### Bug Fixes
|
@@ -35,7 +54,6 @@
|
|
35
54
|
- datatable, datasource optimisation [#272](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/272)
|
36
55
|
|
37
56
|
|
38
|
-
|
39
57
|
## [3.95.1] - 2024-12-23
|
40
58
|
|
41
59
|
### Bug Fixes
|
@@ -43,7 +61,6 @@
|
|
43
61
|
- check rendering [#271](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/271)
|
44
62
|
|
45
63
|
|
46
|
-
|
47
64
|
## [3.95.0] - 2024-12-23
|
48
65
|
|
49
66
|
### Add Features
|
@@ -51,7 +68,6 @@
|
|
51
68
|
- **log:** set direction
|
52
69
|
|
53
70
|
|
54
|
-
|
55
71
|
## [3.94.1] - 2024-12-22
|
56
72
|
|
57
73
|
### Bug Fixes
|
@@ -59,7 +75,6 @@
|
|
59
75
|
- **log:** optimize layout [#270](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/270)
|
60
76
|
|
61
77
|
|
62
|
-
|
63
78
|
## [3.94.0] - 2024-12-22
|
64
79
|
|
65
80
|
### Add Features
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@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.96.
|
1
|
+
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@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.96.3"}
|
@@ -47,42 +47,16 @@ const datasetLinkedElementSymbol = Symbol("datasetLinkedElement");
|
|
47
47
|
const overlayLinkedElementSymbol = Symbol("overlayLinkedElement");
|
48
48
|
|
49
49
|
/**
|
50
|
-
* The
|
50
|
+
* The change button component is used to change the data of a dataset.
|
51
51
|
*
|
52
|
-
*
|
52
|
+
* @fragments /fragments/components/datatable/change-button/
|
53
53
|
*
|
54
|
-
*
|
55
|
-
* Javascript via the `document.createElement('monster-datatable-change-button');` method.
|
54
|
+
* @example /examples/components/datatable/change-button-simple Simple change button
|
56
55
|
*
|
57
|
-
*
|
58
|
-
* <monster-datatable-change-button></monster-datatable-change-button>
|
59
|
-
* ```
|
60
|
-
*
|
61
|
-
* Or you can create this CustomControl directly in Javascript:
|
62
|
-
*
|
63
|
-
* ```js
|
64
|
-
* import '@schukai/monster/components/datatable/change-button.mjs';
|
65
|
-
* document.createElement('monster-datatable-change-button');
|
66
|
-
* ```
|
67
|
-
*
|
68
|
-
* The Body should have a class "hidden" to ensure that the
|
69
|
-
* styles are applied correctly.
|
70
|
-
*
|
71
|
-
* ```css
|
72
|
-
* body.hidden {
|
73
|
-
* visibility: hidden;
|
74
|
-
* }
|
75
|
-
* ```
|
76
|
-
*
|
77
|
-
* @startuml change-button.png
|
78
|
-
* skinparam monochrome true
|
79
|
-
* skinparam shadowing false
|
80
|
-
* HTMLElement <|-- CustomElement
|
81
|
-
* CustomElement <|-- ChangeButton
|
82
|
-
* @enduml
|
56
|
+
* @issue https://localhost.alvine.dev:8443/development/issues/closed/274.html
|
83
57
|
*
|
84
58
|
* @copyright schukai GmbH
|
85
|
-
* @summary
|
59
|
+
* @summary The Status component is used to show the current status of a datasource.
|
86
60
|
*/
|
87
61
|
class ChangeButton extends CustomElement {
|
88
62
|
/**
|
@@ -179,7 +153,16 @@ class ChangeButton extends CustomElement {
|
|
179
153
|
|
180
154
|
/**
|
181
155
|
* @private
|
182
|
-
* @return {
|
156
|
+
* @return {ChangeButton}
|
157
|
+
* @throws {Error} no shadow-root is defined
|
158
|
+
* @throws {TypeError} the element must be a dataset
|
159
|
+
* @throws {Error} the selector must match exactly one element
|
160
|
+
* @throws {TypeError} the element must be a overlay
|
161
|
+
* @throws {Error} the selector must match exactly one element
|
162
|
+
* @throws {Error} no reference found
|
163
|
+
* @throws {Error} reference is missing or empty
|
164
|
+
* @throws {Error} index is not a number
|
165
|
+
* @throws {TypeError} this must be a HTMLElement
|
183
166
|
*/
|
184
167
|
function initControlReferences() {
|
185
168
|
if (!this.shadowRoot) {
|
@@ -244,15 +227,21 @@ function initControlReferences() {
|
|
244
227
|
return this;
|
245
228
|
}
|
246
229
|
|
230
|
+
/**
|
231
|
+
* @private
|
232
|
+
* @returns {number}
|
233
|
+
* @throws {TypeError}
|
234
|
+
* @throws {Error}
|
235
|
+
*/
|
247
236
|
function getIndex() {
|
248
237
|
if (!(this instanceof HTMLElement)) {
|
249
|
-
|
238
|
+
throw new TypeError("this must be a HTMLElement");
|
250
239
|
}
|
251
240
|
|
252
241
|
const row = this.closest("[data-monster-insert-reference]");
|
253
242
|
if (!row) {
|
254
243
|
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, "no reference found");
|
255
|
-
|
244
|
+
throw new Error("no reference found");
|
256
245
|
}
|
257
246
|
|
258
247
|
const ref = row.getAttribute("data-monster-insert-reference");
|
@@ -262,12 +251,12 @@ function getIndex() {
|
|
262
251
|
ATTRIBUTE_ERRORMESSAGE,
|
263
252
|
"reference is missing or empty",
|
264
253
|
);
|
265
|
-
|
254
|
+
throw new Error("reference is missing or empty");
|
266
255
|
}
|
267
256
|
|
268
257
|
const index = Number(ref.split("-").pop());
|
269
258
|
if (isNaN(index)) {
|
270
|
-
|
259
|
+
throw new Error("index is not a number");
|
271
260
|
}
|
272
261
|
|
273
262
|
return index;
|
@@ -279,17 +268,26 @@ function getIndex() {
|
|
279
268
|
function initEventHandler() {
|
280
269
|
queueMicrotask(() => {
|
281
270
|
this[stateButtonElementSymbol].setOption("actions.click", () => {
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
271
|
+
try {
|
272
|
+
const index = getIndex.call(this);
|
273
|
+
|
274
|
+
if (!isNaN(index)) {
|
275
|
+
this[datasetLinkedElementSymbol].setOption("mapping.index", index);
|
276
|
+
this[overlayLinkedElementSymbol].open();
|
277
|
+
}
|
278
|
+
} catch (error) {
|
279
|
+
addAttributeToken(
|
280
|
+
this,
|
281
|
+
ATTRIBUTE_ERRORMESSAGE,
|
282
|
+
error.message || `${error}`,
|
283
|
+
);
|
287
284
|
}
|
288
285
|
});
|
289
286
|
});
|
290
287
|
}
|
291
288
|
|
292
289
|
/**
|
290
|
+
* @private
|
293
291
|
* @param {Object} options
|
294
292
|
*/
|
295
293
|
function updateOptionsFromArguments(options) {
|