@schukai/monster 4.25.3 → 4.25.5

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.
@@ -0,0 +1,113 @@
1
+
2
+ .wizard-steps {
3
+ counter-reset: step;
4
+ }
5
+
6
+
7
+ /* Basic Reset */
8
+ .wizard-steps,
9
+ .wizard-steps .substeps {
10
+ list-style: none;
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+
15
+ /* Main Steps */
16
+ .wizard-steps .step {
17
+ position: relative;
18
+ padding-left: 2.5em;
19
+ margin-bottom: 1.5em;
20
+ }
21
+
22
+ /* Number Circle */
23
+ .wizard-steps .step::before {
24
+ counter-increment: step;
25
+ content: counter(step);
26
+ position: absolute;
27
+ left: 0;
28
+ top: 0;
29
+ width: 1.8em;
30
+ height: 1.8em;
31
+ border: 2px solid var(--monster-color-primary-1);
32
+ border-radius: 50%;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ font-weight: bold;
37
+ color: var(--monster-color-primary-4);
38
+ background-color: var(--monster-color-primary-1);
39
+ box-sizing: border-box;
40
+ z-index: 2;
41
+ }
42
+
43
+ /* Connecting line between circles */
44
+ .wizard-steps .step:not(:last-child)::after {
45
+ content: "";
46
+ position: absolute;
47
+ left: 0.9em; /* Exakte Mitte von 1.8em Kreis */
48
+ top: 2em;
49
+ bottom: 0;
50
+ width: 2px;
51
+ background: var(--monster-color-primary-1);
52
+ z-index: 1;
53
+ }
54
+
55
+ /* Active / completed step */
56
+ .wizard-steps .step-active::before {
57
+ border-color: var(--monster-color-secondary-1);
58
+ background: var(--monster-bg-color-secondary-2);
59
+ color: var(--monster-color-secondary-1);
60
+ }
61
+
62
+ .wizard-steps .step-active .step-title {
63
+ font-weight: bold;
64
+ color: var(--monster-color-secondary-1);
65
+ }
66
+
67
+ /* Step titles */
68
+ .wizard-steps .step-title {
69
+ font-size: 1rem;
70
+ line-height: 1.6em;
71
+ vertical-align: middle;
72
+ color: var(--monster-color-primary-1);
73
+ background-color: var(--monster-bg-color-primary-1);
74
+ }
75
+
76
+ /* Sub-steps */
77
+ .wizard-steps .substeps {
78
+ margin-top: 0.5em;
79
+ margin-left: 1.5em;
80
+ }
81
+
82
+ .wizard-steps .substep {
83
+ position: relative;
84
+ padding-left: 1.2em;
85
+ margin-bottom: 0.4em;
86
+ color: var(--monster-color-primary-1);
87
+ background-color: var(--monster-bg-color-primary-1);
88
+ font-size: 0.9rem;
89
+ }
90
+
91
+ /* Bullet point */
92
+ .wizard-steps .substep::before {
93
+ content: "•";
94
+ position: absolute;
95
+ left: 0;
96
+ top: 0;
97
+ font-size: 1.2em;
98
+ line-height: 1;
99
+ color: var(--monster-color-primary-1);
100
+ background-color: var(--monster-bg-color-primary-1);
101
+ }
102
+
103
+ /* Active sub-step */
104
+ .wizard-steps .substep.active {
105
+ font-weight: bold;
106
+ color: var(--monster-color-secondary-2);
107
+ background-color: var(--monster-bg-color-secondary-2);
108
+ }
109
+
110
+ .wizard-steps .substep.active::before {
111
+ color: var(--monster-color-secondary-2);
112
+ background-color: var(--monster-bg-color-secondary-2);
113
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright © schukai GmbH 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 schukai GmbH.
11
+ */
12
+
13
+ import {addAttributeToken} from "../../../dom/attributes.mjs";
14
+ import {ATTRIBUTE_ERRORMESSAGE} from "../../../dom/constants.mjs";
15
+
16
+ export {WizardNavigationStyleSheet}
17
+
18
+ /**
19
+ * @private
20
+ * @type {CSSStyleSheet}
21
+ */
22
+ const WizardNavigationStyleSheet = new CSSStyleSheet();
23
+
24
+ try {
25
+ WizardNavigationStyleSheet.insertRule(`
26
+ @layer wizardnavigation {
27
+ .wizard-steps{counter-reset:step}.wizard-steps,.wizard-steps .substeps{list-style:none;margin:0;padding:0}.wizard-steps .step{margin-bottom:1.5em;padding-left:2.5em;position:relative}.wizard-steps .step:before{align-items:center;background-color:var(--monster-color-primary-1);border:2px solid var(--monster-color-primary-1);border-radius:50%;box-sizing:border-box;color:var(--monster-color-primary-4);content:counter(step);counter-increment:step;display:flex;font-weight:700;height:1.8em;justify-content:center;left:0;position:absolute;top:0;width:1.8em;z-index:2}.wizard-steps .step:not(:last-child):after{background:var(--monster-color-primary-1);bottom:0;content:\"\";left:.9em;position:absolute;top:2em;width:2px;z-index:1}.wizard-steps .step-active:before{background:var(--monster-bg-color-secondary-2);border-color:var(--monster-color-secondary-1);color:var(--monster-color-secondary-1)}.wizard-steps .step-active .step-title{color:var(--monster-color-secondary-1);font-weight:700}.wizard-steps .step-title{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1);font-size:1rem;line-height:1.6em;vertical-align:middle}.wizard-steps .substeps{margin-left:1.5em;margin-top:.5em}.wizard-steps .substep{font-size:.9rem;margin-bottom:.4em;padding-left:1.2em;position:relative}.wizard-steps .substep,.wizard-steps .substep:before{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1)}.wizard-steps .substep:before{content:\"•\";font-size:1.2em;left:0;line-height:1;position:absolute;top:0}.wizard-steps .substep.active{font-weight:700}.wizard-steps .substep.active,.wizard-steps .substep.active:before{background-color:var(--monster-bg-color-secondary-2);color:var(--monster-color-secondary-2)}
28
+ }`, 0);
29
+ } catch (e) {
30
+ addAttributeToken(document.getRootNode().querySelector('html'), ATTRIBUTE_ERRORMESSAGE, e + "");
31
+ }
@@ -0,0 +1,219 @@
1
+ /**
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.
11
+ */
12
+
13
+ import { instanceSymbol } from "../../constants.mjs";
14
+ import { addAttributeToken } from "../../dom/attributes.mjs";
15
+ import {
16
+ ATTRIBUTE_ERRORMESSAGE,
17
+ ATTRIBUTE_ROLE,
18
+ } from "../../dom/constants.mjs";
19
+ import { CustomControl } from "../../dom/customcontrol.mjs";
20
+ import {CustomElement, getSlottedElements} from "../../dom/customelement.mjs";
21
+ import {
22
+ assembleMethodSymbol,
23
+ registerCustomElement,
24
+ } from "../../dom/customelement.mjs";
25
+ import {findTargetElementFromEvent, fireEvent} from "../../dom/events.mjs";
26
+ import { isFunction } from "../../types/is.mjs";
27
+ import { WizardNavigationStyleSheet } from "./stylesheet/wizard-navigation.mjs";
28
+ import { fireCustomEvent } from "../../dom/events.mjs";
29
+ import {buildTree} from "../../data/buildtree.mjs";
30
+ import { NodeRecursiveIterator } from "../../types/noderecursiveiterator.mjs";
31
+ import {validateInstance} from "../../types/validate.mjs";
32
+ import {Node} from "../../types/node.mjs";
33
+ import {Formatter} from "../../text/formatter.mjs";
34
+
35
+
36
+ export { WizardNavigation };
37
+
38
+ /**
39
+ * @private
40
+ * @type {symbol}
41
+ */
42
+ const wizardNavigationElementSymbol = Symbol("wizardNavigationElement");
43
+
44
+ /**
45
+ * @private
46
+ * @type {symbol}
47
+ */
48
+ const wizardNavigationListElementSymbol = Symbol("wizardNavigationListElement");
49
+
50
+
51
+ /**
52
+ * A WizardNavigation
53
+ *
54
+ * @fragments /fragments/components/navigation/wizard-navigation/
55
+ *
56
+ * @example /examples/components/navigation/wizard-navigation-simple
57
+ *
58
+ * Work in Progress, currently only the basic functionality is implemented.
59
+ *
60
+ * @since 4.26.0
61
+ * @copyright schukai GmbH
62
+ * @summary A beautiful WizardNavigation that can make your life easier and also looks good.
63
+ */
64
+ class WizardNavigation extends CustomElement {
65
+ /**
66
+ * This method is called by the `instanceof` operator.
67
+ * @returns {symbol}
68
+ */
69
+ static get [instanceSymbol]() {
70
+ return Symbol.for(
71
+ "@schukai/monster/components/navigation/wizard-navigation@@instance",
72
+ );
73
+ }
74
+
75
+ /**
76
+ *
77
+ * @return {Components.Navigation.WizardNavigation
78
+ */
79
+ [assembleMethodSymbol]() {
80
+ super[assembleMethodSymbol]();
81
+ initControlReferences.call(this);
82
+ initEventHandler.call(this);
83
+ queueMicrotask(() => {
84
+ importContent.call(this);
85
+ });
86
+ return this;
87
+ }
88
+
89
+ /**
90
+ * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
91
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
92
+ *
93
+ * The individual configuration values can be found in the table.
94
+ *
95
+ * @property {Object} templates Template definitions
96
+ * @property {string} templates.main Main template
97
+ * @property {Object} labels Label definitions
98
+ * @property {Object} actions Callbacks
99
+ * @property {string} actions.click="throw Error" Callback when clicked
100
+ * @property {Object} features Features
101
+ * @property {Object} classes CSS classes
102
+ * @property {boolean} disabled=false Disabled state
103
+ */
104
+ get defaults() {
105
+ return Object.assign({}, super.defaults, {
106
+ templates: {
107
+ main: getTemplate(),
108
+ },
109
+ labels: {},
110
+ classes: {},
111
+ disabled: false,
112
+ features: {},
113
+ actions: {
114
+ click: () => {
115
+ throw new Error("the click action is not defined");
116
+ },
117
+ },
118
+ });
119
+ }
120
+
121
+ /**
122
+ * @return {string}
123
+ */
124
+ static getTag() {
125
+ return "monster-wizard-navigation";
126
+ }
127
+
128
+ /**
129
+ * @return {CSSStyleSheet[]}
130
+ */
131
+ static getCSSStyleSheet() {
132
+ return [WizardNavigationStyleSheet];
133
+ }
134
+ }
135
+
136
+ /**
137
+ * @private
138
+ * @return {initEventHandler}
139
+ * @fires monster-wizard-navigation-clicked
140
+ */
141
+ function initEventHandler() {
142
+ const self = this;
143
+ const element = this[wizardNavigationElementSymbol];
144
+
145
+ const type = "click";
146
+
147
+ element.addEventListener(type, function (event) {
148
+ const callback = self.getOption("actions.click");
149
+
150
+ fireCustomEvent(self, "monster-wizard-navigation-clicked", {
151
+ element: self,
152
+ });
153
+
154
+ if (!isFunction(callback)) {
155
+ return;
156
+ }
157
+
158
+ const element = findTargetElementFromEvent(
159
+ event,
160
+ ATTRIBUTE_ROLE,
161
+ "control",
162
+ );
163
+
164
+ if (!(element instanceof Node && self.hasNode(element))) {
165
+ return;
166
+ }
167
+
168
+ callback.call(self, event);
169
+ });
170
+
171
+ return this;
172
+ }
173
+
174
+ /**
175
+ * @private
176
+ * @return {void}
177
+ */
178
+ function initControlReferences() {
179
+ this[wizardNavigationElementSymbol] = this.shadowRoot.querySelector(
180
+ `[${ATTRIBUTE_ROLE}="control"]`,
181
+ );
182
+
183
+ this[wizardNavigationListElementSymbol] = this.shadowRoot.querySelector(
184
+ `[${ATTRIBUTE_ROLE}="list"]`,
185
+ );
186
+ }
187
+
188
+ /**
189
+ * Import Menu Entries from dataset
190
+ *
191
+ * @since 1.0.0
192
+ * @return {TreeMenu}
193
+ * @throws {Error} map is not iterable
194
+ * @private
195
+ */
196
+ function importContent() {
197
+ const elements = getSlottedElements.call(this, "ol.wizard-steps")
198
+ elements.forEach(element => {
199
+ const clonedContent = element.cloneNode(true);
200
+ this[wizardNavigationListElementSymbol].innerHTML = '';
201
+ this[wizardNavigationListElementSymbol].appendChild(clonedContent);
202
+ })
203
+ }
204
+
205
+
206
+ /**
207
+ * @private
208
+ * @return {string}
209
+ */
210
+ function getTemplate() {
211
+ // language=HTML
212
+ return `
213
+ <div data-monster-role="control" part="control">
214
+ <slot style="display: none;"></slot>
215
+ <div data-monster-role="list"></div>
216
+ </div>`;
217
+ }
218
+
219
+ registerCustomElement(WizardNavigation);
@@ -1,2 +1,33 @@
1
1
  /** generated from accessibility.pcss **/
2
- .visually-hidden{height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;width:1px!important;clip:rect(0,0,0,0)!important;border:0!important;white-space:nowrap!important}.visually-hidden:not(caption){position:absolute!important}.visually-hidden-focusable:not(:focus):not(:focus-within){height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;width:1px!important;clip:rect(0,0,0,0)!important;border:0!important;white-space:nowrap!important}.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute!important}@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
2
+ .visually-hidden {
3
+ height: 1px !important;
4
+ margin: -1px !important;
5
+ overflow: hidden !important;
6
+ padding: 0 !important;
7
+ width: 1px !important;
8
+ clip: rect(0, 0, 0, 0) !important;
9
+ border: 0 !important;
10
+ white-space: nowrap !important;
11
+ }
12
+ .visually-hidden:not(caption) {
13
+ position: absolute !important;
14
+ }
15
+ .visually-hidden-focusable:not(:focus):not(:focus-within) {
16
+ height: 1px !important;
17
+ margin: -1px !important;
18
+ overflow: hidden !important;
19
+ padding: 0 !important;
20
+ width: 1px !important;
21
+ clip: rect(0, 0, 0, 0) !important;
22
+ border: 0 !important;
23
+ white-space: nowrap !important;
24
+ }
25
+ .visually-hidden-focusable:not(:focus):not(:focus-within):not(caption) {
26
+ position: absolute !important;
27
+ }
28
+ @media (prefers-reduced-motion: reduce) {
29
+ * {
30
+ animation: none !important;
31
+ transition: none !important;
32
+ }
33
+ }
@@ -10,10 +10,10 @@
10
10
  * For more information about purchasing a commercial license, please contact schukai GmbH.
11
11
  */
12
12
 
13
- import {addAttributeToken} from "../../dom/attributes.mjs";
14
- import {ATTRIBUTE_ERRORMESSAGE} from "../../dom/constants.mjs";
13
+ import { addAttributeToken } from "../../dom/attributes.mjs";
14
+ import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";
15
15
 
16
- export {AccessibilityStyleSheet}
16
+ export { AccessibilityStyleSheet };
17
17
 
18
18
  /**
19
19
  * @private
@@ -22,10 +22,17 @@ export {AccessibilityStyleSheet}
22
22
  const AccessibilityStyleSheet = new CSSStyleSheet();
23
23
 
24
24
  try {
25
- AccessibilityStyleSheet.insertRule(`
25
+ AccessibilityStyleSheet.insertRule(
26
+ `
26
27
  @layer accessibility {
27
28
  .visually-hidden{height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;width:1px!important;clip:rect(0,0,0,0)!important;border:0!important;white-space:nowrap!important}.visually-hidden:not(caption){position:absolute!important}.visually-hidden-focusable:not(:focus):not(:focus-within){height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;width:1px!important;clip:rect(0,0,0,0)!important;border:0!important;white-space:nowrap!important}.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute!important}@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
28
- }`, 0);
29
+ }`,
30
+ 0,
31
+ );
29
32
  } catch (e) {
30
- addAttributeToken(document.getRootNode().querySelector('html'), ATTRIBUTE_ERRORMESSAGE, e + "");
33
+ addAttributeToken(
34
+ document.getRootNode().querySelector("html"),
35
+ ATTRIBUTE_ERRORMESSAGE,
36
+ e + "",
37
+ );
31
38
  }
@@ -456,7 +456,7 @@ function importEntries() {
456
456
 
457
457
  let filteredData;
458
458
  if (this[firstRunDoneSymbol] !== true) {
459
- filteredData = data.filter(
459
+ filteredData = data?.filter(
460
460
  (entry) =>
461
461
  !entry[parentKey] ||
462
462
  entry[parentKey] === null ||
@@ -156,7 +156,7 @@ function getMonsterVersion() {
156
156
  }
157
157
 
158
158
  /** don't touch, replaced by make with package.json version */
159
- monsterVersion = new Version("4.25.0");
159
+ monsterVersion = new Version("4.25.3");
160
160
 
161
161
  return monsterVersion;
162
162
  }
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("4.25.0")
10
+ monsterVersion = new Version("4.25.3")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -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.25.0</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update Mo 30. Jun 16:45:37 CEST 2025</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 4.25.3</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update Do 3. Jul 13:10:44 CEST 2025</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>