@pageboard/html 0.14.21 → 0.14.23

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.14.21",
3
+ "version": "0.14.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -164,28 +164,28 @@ class HTMLElementFieldsetList extends Page.Element {
164
164
  }
165
165
  });
166
166
 
167
- const view = this.ownView;
168
- view.textContent = '';
169
- view.appendChild(tpl);
170
-
171
167
  if (placeholder) {
172
- for (const node of view.querySelectorAll(`[name^="${this.#prefixStr}"]`)) {
168
+ for (const node of tpl.querySelectorAll(`[name^="${this.#prefixStr}"]`)) {
173
169
  node.disabled = true;
174
170
  }
175
171
  }
176
172
 
177
- view.querySelectorAll(this.#selector('up')).forEach((node, i) => {
173
+ tpl.querySelectorAll(this.#selector('up')).forEach((node, i) => {
178
174
  node.disabled = i == 0;
179
175
  });
180
- view.querySelectorAll(this.#selector('down')).forEach((node, i, arr) => {
176
+ tpl.querySelectorAll(this.#selector('down')).forEach((node, i, arr) => {
181
177
  node.disabled = i == arr.length - 1;
182
178
  });
183
- view.querySelectorAll(this.#selector('del')).forEach((node) => {
179
+ tpl.querySelectorAll(this.#selector('del')).forEach((node) => {
184
180
  node.disabled = this.#list.length <= min;
185
181
  });
186
- view.querySelectorAll(this.#selector('add')).forEach((node) => {
182
+ tpl.querySelectorAll(this.#selector('add')).forEach((node) => {
187
183
  node.disabled = this.#list.length >= max;
188
184
  });
185
+
186
+ const view = this.ownView;
187
+ view.textContent = '';
188
+ view.appendChild(tpl);
189
189
  }
190
190
 
191
191
  #parts(key) {
package/ui/fieldset.js CHANGED
@@ -13,8 +13,23 @@ class HTMLElementFieldSet extends Page.create(HTMLFieldSetElement) {
13
13
 
14
14
  fill(query) {
15
15
  if (this.isContentEditable || !this.options?.name || !this.form) return;
16
- if (!query) query = this.form.read(true);
17
- const val = query[this.options.name];
16
+ const { name } = this.options;
17
+ if (!query) {
18
+ query = {};
19
+ for (const node of this.form.querySelectorAll(
20
+ `[name="${name}"]`
21
+ )) {
22
+ if (node.type == "checkbox") {
23
+ throw new Error("Unsupported checkbox in fiedset condition: " + this.options.name);
24
+ }
25
+ if (node.type == "radio") {
26
+ if (node.checked) query[name] = node.value;
27
+ } else {
28
+ query[name] = node.value;
29
+ }
30
+ }
31
+ }
32
+ const val = query[name];
18
33
  const disabled = this.disabled = this.hidden = !this.#compare(val);
19
34
  for (const node of this.querySelectorAll('[name]')) {
20
35
  node.disabled = disabled;
@@ -22,13 +37,12 @@ class HTMLElementFieldSet extends Page.create(HTMLFieldSetElement) {
22
37
  }
23
38
 
24
39
  patch(state) {
25
- // before/after form#fill
26
- this.fill(null);
27
- state.finish(() => this.fill(null));
40
+ // initialize
41
+ this.fill();
28
42
  }
29
43
  handleAllChange(e, state) {
30
44
  if (this.form?.contains(e.target)) {
31
- this.fill(null);
45
+ this.fill();
32
46
  }
33
47
  }
34
48
  }
package/ui/layout.css CHANGED
@@ -68,8 +68,7 @@
68
68
  }
69
69
 
70
70
  &.column {
71
- > img,
72
- &.left > img {
71
+ > img, &.left > img {
73
72
  align-self:flex-start;
74
73
  }
75
74
  &.hcenter > img {