@schukai/monster 4.130.0 → 4.130.1

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/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"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.130.0"}
1
+ {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.6"},"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.130.1"}
@@ -46,7 +46,8 @@ const containerElementSymbol = Symbol("containerElement");
46
46
  *
47
47
  * @fragments /fragments/components/form/action-button
48
48
  *
49
- * @example /examples/components/form/action-button
49
+ * @example /examples/components/form/action-button Inline menu
50
+ * @example /examples/components/form/action-button-bulk-actions Bulk action menu
50
51
  *
51
52
  * @issue https://localhost.alvine.dev:8440/development/issues/closed/264.html
52
53
  *
@@ -24,6 +24,8 @@ export { ContextHint };
24
24
  * A context hint control.
25
25
  *
26
26
  * @fragments /fragments/components/form/context-hint
27
+ * @example /examples/components/form/context-hint-inline
28
+ * @example /examples/components/form/context-hint-shortcuts
27
29
  *
28
30
  * @since 3.55.0
29
31
  * @copyright Volker Schukai
@@ -24,6 +24,8 @@ export { ContextInfo };
24
24
  * A context info control.
25
25
  *
26
26
  * @fragments /fragments/components/form/context-info
27
+ * @example /examples/components/form/context-info-workspace
28
+ * @example /examples/components/form/context-info-retention
27
29
  *
28
30
  * @since 3.55.0
29
31
  * @copyright Volker Schukai
@@ -24,6 +24,8 @@ export { ContextNote };
24
24
  * A context note control.
25
25
  *
26
26
  * @fragments /fragments/components/form/context-note
27
+ * @example /examples/components/form/context-note-handover
28
+ * @example /examples/components/form/context-note-review
27
29
  *
28
30
  * @since 3.55.0
29
31
  * @copyright Volker Schukai
@@ -24,6 +24,8 @@ export { ContextSuccess };
24
24
  * A context success control.
25
25
  *
26
26
  * @fragments /fragments/components/form/context-success
27
+ * @example /examples/components/form/context-success-domain
28
+ * @example /examples/components/form/context-success-checklist
27
29
  *
28
30
  * @since 3.55.0
29
31
  * @copyright Volker Schukai
@@ -24,6 +24,8 @@ export { ContextWarning };
24
24
  * A context warning control.
25
25
  *
26
26
  * @fragments /fragments/components/form/context-warning
27
+ * @example /examples/components/form/context-warning-retention
28
+ * @example /examples/components/form/context-warning-delete
27
29
  *
28
30
  * @since 3.55.0
29
31
  * @copyright Volker Schukai
@@ -51,7 +51,8 @@ const MESSAGE_LAYOUT_WIDE = "wide";
51
51
  * or manual actions.
52
52
  *
53
53
  * @fragments /fragments/components/form/message-state-button/
54
- * @example /examples/components/form/message-state-button-simple
54
+ * @example /examples/components/form/message-state-button-simple Success message
55
+ * @example /examples/components/form/message-state-button-retry Retry and error message
55
56
  *
56
57
  * @since 2.11.0
57
58
  * @copyright Volker Schukai
@@ -27,7 +27,8 @@ export { StateButton };
27
27
  *
28
28
  * @fragments /fragments/components/form/state-button/
29
29
  *
30
- * @example /examples/components/form/state-button-simple
30
+ * @example /examples/components/form/state-button-simple Simple state cycle
31
+ * @example /examples/components/form/state-button-deployment Deployment state sequence
31
32
  *
32
33
  * @since 1.5.0
33
34
  * @copyright Volker Schukai
@@ -216,7 +216,7 @@ class Tabs extends CustomElement {
216
216
  features: {
217
217
  openDelay: null,
218
218
  removeBehavior: "auto",
219
- openFirst: false,
219
+ openFirst: true,
220
220
  },
221
221
 
222
222
  classes: {
@@ -217,7 +217,7 @@ class VerticalTabs extends CustomElement {
217
217
  features: {
218
218
  openDelay: null,
219
219
  removeBehavior: "auto",
220
- openFirst: false,
220
+ openFirst: true,
221
221
  },
222
222
 
223
223
  classes: {
@@ -28,6 +28,21 @@ let html1 = `
28
28
  </monster-tabs>
29
29
  `;
30
30
 
31
+ // language=html
32
+ let htmlActiveSecond = `
33
+ <monster-tabs id="mytabs">
34
+ <div data-monster-button-label="TAB1">
35
+ Das ist tab 1
36
+ </div>
37
+ <div data-monster-button-label="TAB2" class="active">
38
+ Das ist tab 2
39
+ </div>
40
+ <div data-monster-button-label="TAB3">
41
+ Das ist tab 3
42
+ </div>
43
+ </monster-tabs>
44
+ `;
45
+
31
46
  let Tabs;
32
47
 
33
48
  describe('Tabs', function () {
@@ -122,6 +137,50 @@ describe('Tabs', function () {
122
137
  }, 0);
123
138
  });
124
139
 
140
+ it('should open the first tab by default when no tab is predefined as active', function (done) {
141
+
142
+ let mocks = document.getElementById('mocks');
143
+ mocks.innerHTML = html1;
144
+
145
+ setTimeout(() => {
146
+ try {
147
+ const tabs = document.getElementById('mytabs');
148
+ expect(tabs).is.instanceof(Tabs);
149
+
150
+ setTimeout(() => {
151
+ expect(tabs.children[0].classList.contains('active')).to.equal(true);
152
+ expect(tabs.children[1].classList.contains('active')).to.equal(false);
153
+ expect(tabs.getActiveTab()).to.equal(tabs.children[0].getAttribute('id'));
154
+ done();
155
+ }, 100);
156
+ } catch (e) {
157
+ return done(e);
158
+ }
159
+ }, 0);
160
+ });
161
+
162
+ it('should keep a predefined active tab instead of opening the first tab', function (done) {
163
+
164
+ let mocks = document.getElementById('mocks');
165
+ mocks.innerHTML = htmlActiveSecond;
166
+
167
+ setTimeout(() => {
168
+ try {
169
+ const tabs = document.getElementById('mytabs');
170
+ expect(tabs).is.instanceof(Tabs);
171
+
172
+ setTimeout(() => {
173
+ expect(tabs.children[0].classList.contains('active')).to.equal(false);
174
+ expect(tabs.children[1].classList.contains('active')).to.equal(true);
175
+ expect(tabs.getActiveTab()).to.equal(tabs.children[1].getAttribute('id'));
176
+ done();
177
+ }, 100);
178
+ } catch (e) {
179
+ return done(e);
180
+ }
181
+ }, 0);
182
+ });
183
+
125
184
  });
126
185
 
127
186