@pageboard/html 0.13.2 → 0.13.4
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/elements/inputs.js +1 -1
- package/package.json +1 -1
- package/ui/fieldset-list.js +1 -1
- package/ui/form.css +8 -0
- package/ui/form.js +8 -6
package/elements/inputs.js
CHANGED
package/package.json
CHANGED
package/ui/fieldset-list.js
CHANGED
|
@@ -162,7 +162,7 @@ class HTMLElementFieldsetList extends Page.Element {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
const subtpl = inputs.ancestor();
|
|
165
|
+
const subtpl = inputs.map(node => node.closest('.fields') ?? node).ancestor();
|
|
166
166
|
if (!subtpl) {
|
|
167
167
|
console.warn("fieldset-list should contain input[name]", this);
|
|
168
168
|
return;
|
package/ui/form.css
CHANGED
|
@@ -19,6 +19,10 @@ element-select {
|
|
|
19
19
|
z-index:1; /* or else dropdown menu goes under what's next */
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
.inline.fields element-select {
|
|
23
|
+
vertical-align: middle;
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
[contenteditable] .ui.form .field.hidden {
|
|
23
27
|
display: block !important;
|
|
24
28
|
}
|
|
@@ -45,3 +49,7 @@ element-select {
|
|
|
45
49
|
display: block !important;
|
|
46
50
|
opacity:0.5;
|
|
47
51
|
}
|
|
52
|
+
|
|
53
|
+
.ui.form .field :disabled {
|
|
54
|
+
pointer-events:initial;
|
|
55
|
+
}
|
package/ui/form.js
CHANGED
|
@@ -175,8 +175,7 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
|
|
|
175
175
|
let val = node.value;
|
|
176
176
|
if (val == "") val = null;
|
|
177
177
|
let defVal = node.defaultValue;
|
|
178
|
-
if (defVal
|
|
179
|
-
else if (type == "select-one" && defVal === undefined) defVal = null;
|
|
178
|
+
if (defVal === "" || defVal === undefined) defVal = null;
|
|
180
179
|
|
|
181
180
|
switch (type) {
|
|
182
181
|
case "file":
|
|
@@ -193,10 +192,12 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
|
|
|
193
192
|
}
|
|
194
193
|
break;
|
|
195
194
|
case "checkbox":
|
|
196
|
-
if (
|
|
197
|
-
if (
|
|
198
|
-
query[name] =
|
|
195
|
+
if (withDefaults) {
|
|
196
|
+
if (query[name] === undefined) {
|
|
197
|
+
query[name] = null;
|
|
199
198
|
}
|
|
199
|
+
} else if (!query[name]) {
|
|
200
|
+
query[name] = node.required ? null : undefined;
|
|
200
201
|
}
|
|
201
202
|
break;
|
|
202
203
|
case "hidden":
|
|
@@ -336,8 +337,9 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
|
|
|
336
337
|
this.toggleMessages(status);
|
|
337
338
|
}
|
|
338
339
|
async postMethod(e, state) {
|
|
339
|
-
if (e.type != "submit") return;
|
|
340
340
|
const form = this;
|
|
341
|
+
if (e.type != "submit" && form.elements.find(item => item.type == "submit")) return;
|
|
342
|
+
|
|
341
343
|
form.classList.add('loading');
|
|
342
344
|
|
|
343
345
|
await Promise.all(
|