@schukai/monster 3.69.1 → 3.70.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/package.json +1 -1
  3. package/source/components/datatable/dataset.mjs +278 -202
  4. package/source/components/datatable/datasource/dom.mjs +1 -1
  5. package/source/components/datatable/datasource/rest.mjs +6 -3
  6. package/source/components/datatable/filter.mjs +1 -0
  7. package/source/components/datatable/save-button.mjs +1 -1
  8. package/source/components/datatable/style/datatable.pcss +1 -1
  9. package/source/components/datatable/style/filter-controls-defaults.pcss +1 -1
  10. package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +8 -17
  11. package/source/components/form/context-error.mjs +2 -0
  12. package/source/components/form/context-help.mjs +1 -0
  13. package/source/components/form/field-set.mjs +222 -225
  14. package/source/components/form/form.mjs +192 -545
  15. package/source/components/form/select.mjs +24 -9
  16. package/source/components/form/style/field-set.pcss +84 -7
  17. package/source/components/form/style/form.pcss +5 -3
  18. package/source/components/form/style/select.pcss +5 -4
  19. package/source/components/form/stylesheet/field-set.mjs +7 -14
  20. package/source/components/form/stylesheet/form.mjs +8 -17
  21. package/source/components/form/stylesheet/select.mjs +7 -14
  22. package/source/components/layout/style/collapse.pcss +0 -2
  23. package/source/components/layout/stylesheet/collapse.mjs +7 -14
  24. package/source/components/style/form.pcss +66 -3
  25. package/source/components/style/mixin/property.pcss +8 -1
  26. package/source/components/style/typography.pcss +4 -12
  27. package/source/components/stylesheet/form.mjs +8 -17
  28. package/source/components/stylesheet/mixin/form.mjs +7 -16
  29. package/source/components/stylesheet/mixin/property.mjs +6 -13
  30. package/source/components/stylesheet/typography.mjs +7 -16
  31. package/source/data/datasource/server/restapi.mjs +182 -180
  32. package/source/dom/customelement.mjs +4 -0
  33. package/source/dom/updater.mjs +1 -1
  34. package/source/types/tokenlist.mjs +2 -2
  35. package/test/cases/components/form/form.mjs +1 -182
  36. package/test/cases/components/host/details.mjs +1 -1
  37. package/test/cases/components/host/host.mjs +1 -1
  38. package/test/cases/components/host/overlay.mjs +1 -1
  39. package/test/cases/dom/customcontrol.mjs +1 -1
  40. package/test/cases/dom/customelement.mjs +2 -2
  41. package/source/components/style/mixin/form.pcss +0 -242
@@ -47,7 +47,7 @@ describe('Overlay', function () {
47
47
  setTimeout(() => {
48
48
  try {
49
49
  expect(document.getElementById('mocks')).contain.html(
50
- ' <monster-overlay data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-overlay>')
50
+ ' <monster-overlay style="display: block;" data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-overlay>')
51
51
  } catch (e) {
52
52
  return done(e);
53
53
  }
@@ -138,7 +138,7 @@ describe('DOM', function () {
138
138
 
139
139
  expect(document.getElementsByTagName('monster-customcontrol').length).is.equal(1);
140
140
  // no data-monster-objectlink="Symbol(monsterUpdater)" because it has nothing to update
141
- expect(document.getElementById('test1')).contain.html('<monster-customcontrol data-monster-error="Error: html is not set."></monster-customcontrol>')
141
+ expect(document.getElementById('test1')).contain.html('<monster-customcontrol style="display: block;" data-monster-error="Error: html is not set."></monster-customcontrol>')
142
142
  });
143
143
  });
144
144
 
@@ -242,7 +242,7 @@ describe('DOM', function () {
242
242
  expect(document.getElementsByTagName('monster-testclass').length).is.equal(1);
243
243
  // no data-monster-objectlink="Symbol(monsterUpdater)" because it has nothing to update
244
244
  // but data-monster-error="Error: html is not set."
245
- expect(document.getElementById('test1')).contain.html('<monster-testclass data-monster-error="Error: html is not set."></monster-testclass>');
245
+ expect(document.getElementById('test1')).contain.html('<monster-testclass style="display: block;" data-monster-error="Error: html is not set."></monster-testclass>');
246
246
  });
247
247
  });
248
248
 
@@ -256,7 +256,7 @@ describe('DOM', function () {
256
256
  try {
257
257
  expect(document.getElementsByTagName('monster-testclass2').length).is.equal(1);
258
258
  expect(document.getElementsByTagName('monster-testclass2').item(0).shadowRoot.innerHTML).is.equal('<h1></h1><article><p>test</p><div id="container"></div></article>');
259
- expect(document.getElementById('test1')).contain.html('<monster-testclass2 data-monster-objectlink="Symbol(' + updaterSymbolKey + ')"></monster-testclass2>');
259
+ expect(document.getElementById('test1')).contain.html('<monster-testclass2 style="display: block;" data-monster-objectlink="Symbol(' + updaterSymbolKey + ')"></monster-testclass2>');
260
260
  return done();
261
261
  } catch (e) {
262
262
  done(e);
@@ -1,242 +0,0 @@
1
- @import "hover.pcss";
2
-
3
- @define-mixin form {
4
-
5
- box-sizing: border-box;
6
- display: flex;
7
- flex-wrap: nowrap;
8
- position: relative;
9
- flex-direction: column;
10
- align-content: flex-start;
11
- align-items: flex-start;
12
- accent-color: var(--monster-color-secondary-2);
13
-
14
- & label {
15
- color: var(--monster-color-primary-1);
16
- background-color: var(--monster-bg-color-primary-1);
17
- display: grid;
18
- }
19
-
20
- & label:has(input[type="radio"]) {
21
- display: flex;
22
- flex-direction: row;
23
- flex-wrap: nowrap;
24
- justify-content: flex-start;
25
-
26
- & input {
27
- margin-right: 0.4rem;
28
- margin-left: 0.4rem;
29
- }
30
- }
31
-
32
- & label:has(input[type="radio"]) ~ label:has(input[type="radio"]) {
33
- margin-top: 0.2rem;
34
- }
35
-
36
- & label:has(input[type="checkbox"]) {
37
- display: flex;
38
- flex-direction: row;
39
- flex-wrap: nowrap;
40
- justify-content: flex-start;
41
-
42
- & input {
43
- margin-right: 0.4rem;
44
- margin-left: 0.4rem;
45
- }
46
-
47
- }
48
-
49
- & label:has(input[type="checkbox"]) ~ label:has(input[type="checkbox"]) {
50
- margin-top: 0.2rem;
51
- }
52
-
53
- & label ~ label {
54
- margin-top: 1rem;
55
- }
56
-
57
- & label ~ fieldset {
58
- margin-top: 1rem;
59
- }
60
-
61
- & button,
62
- & input,
63
- & select,
64
- & textarea {
65
- font-family: inherit;
66
- font-size: 100%;
67
- padding: 0.4rem 0.6rem;
68
- margin: 0;
69
- outline: none;
70
- box-sizing: border-box;
71
- accent-color: var(--monster-color-secondary-2);
72
-
73
- color: var(--monster-color-primary-1);
74
- background-color: var(--monster-bg-color-primary-1);
75
-
76
- }
77
-
78
-
79
- & button {
80
- color: var(--monster-color-tertiary-1);
81
- background-color: var(--monster-bg-color-tertiary-1);
82
-
83
- /** monster-border-primary-1 */
84
- border-width: var(--monster-border-width);
85
- border-radius: var(--monster-border-radius);
86
- border-style: var(--monster-border-style);
87
- border-color: var(--monster-bg-color-primary-3);
88
- }
89
-
90
- & option:checked {
91
- background-color: var(--monster-bg-color-primary-3);
92
- color: var(--monster-color-primary-3);
93
- }
94
-
95
- & option:focus {
96
- background-color: var(--monster-bg-color-primary-3);
97
- color: var(--monster-color-primary-3);
98
- }
99
-
100
- & option:hover {
101
- background-color: var(--monster-bg-color-primary-2);
102
- color: var(--monster-color-primary-2);
103
- }
104
-
105
- & input,
106
- & select,
107
- & textarea {
108
- border: 0;
109
- border-bottom-width: thin;
110
- border-radius: var(--monster-border-radius);
111
- border-bottom-style: var(--monster-border-style);
112
- border-bottom-color: var(--monster-bg-color-primary-1);
113
- }
114
-
115
-
116
- & input,
117
- & select,
118
- & textarea {
119
- border-width: thin;
120
- border-radius: var(--monster-border-radius);
121
- border-style: var(--monster-border-style);
122
- border-color: var(--monster-bg-color-primary-2);
123
- }
124
-
125
-
126
- & button,
127
- & input:not([type="radio"]):not([type="checkbox"]),
128
- & select,
129
- & textarea {
130
- width: 100%;
131
- }
132
-
133
- & label {
134
- width: 100%;
135
-
136
- & input:not([type="radio"]):not([type="checkbox"]),
137
- & select,
138
- & textarea {
139
- width: 100%;
140
- margin-top: 0.2rem;
141
- }
142
-
143
- }
144
-
145
- & label + input:not([type="radio"]):not([type="checkbox"]),
146
- & label + select,
147
- & label + textarea {
148
- width: 100%;
149
- margin-top: 0.2rem;
150
- }
151
-
152
-
153
- & fieldset {
154
- margin: 0;
155
- position: relative;
156
- padding: 2.5rem 2rem 2rem;
157
- border: 1px dotted var(--monster-bg-color-primary-4);
158
-
159
- background-color: var(--monster-bg-color-primary-1);
160
- color: var(--monster-color-primary-1);
161
-
162
- box-sizing: border-box;
163
- width: 100%;
164
- outline: none;
165
-
166
- & legend {
167
- position: absolute;
168
- top: 0;
169
- right: 0;
170
- padding: 0.1rem 2rem 0.2rem 0.5rem;
171
- max-width: 95%;
172
- text-align: right;
173
- text-transform: uppercase;
174
- text-overflow: ellipsis;
175
- font-size: 0.8rem;
176
- overflow: hidden;
177
- white-space: nowrap;
178
- }
179
-
180
- & label {
181
- }
182
-
183
- }
184
-
185
- & fieldset ~ fieldset {
186
- margin-top: 1rem;
187
- }
188
-
189
- & button {
190
- margin: 0.2rem 0;
191
- }
192
-
193
- & button:first-of-type {
194
- margin-top: 1rem;
195
- }
196
-
197
- & button:last-of-type {
198
- margin-bottom: 1rem;
199
- }
200
-
201
- & input:focus-visible {
202
- outline: none;
203
- }
204
-
205
-
206
- & button:focus,
207
- & input:focus,
208
- & select:focus,
209
- & textarea:focus {
210
- outline: 1px dashed var(--monster-color-selection-4);
211
- outline-offset: 2px;
212
- }
213
-
214
-
215
- @media (prefers-color-scheme: light) {
216
- & button,
217
- & input,
218
- & select,
219
- & textarea {
220
- background-color: var(--monster-bg-color-primary-1);
221
- color: var(--monster-color-primary-1);
222
- border-color: var(--monster-bg-color-primary-4);
223
- }
224
-
225
- & button:focus,
226
- & input:focus,
227
- & select:focus,
228
- & textarea:focus {
229
- outline: 1px dashed var(--monster-color-selection-3);
230
- }
231
-
232
- }
233
-
234
- & button:hover,
235
- & input:hover:not([type="radio"]):not([type="checkbox"]):not([type="range"]),
236
- & select:hover,
237
- & textarea:hover {
238
- @mixin box-hover;
239
- }
240
-
241
-
242
- }