@optionfactory/fml 9.0.0-rc23 → 9.0.0-rc24

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.
@@ -419,7 +419,7 @@
419
419
  },
420
420
  {
421
421
  "name": "submit:requested",
422
- "description": "Fired after the submit was accepted, to let a listener resolve the response itself.",
422
+ "description": "Fired after the submit was accepted, to let a listener resolve the response itself. Register it through AsyncEvents.asyncOn: the form awaits only such a listener, and one added with addEventListener is not waited for.",
423
423
  "type": {
424
424
  "text": "CustomEvent"
425
425
  }
package/dist/fml.iife.js CHANGED
@@ -6963,6 +6963,11 @@ var fml = (function (exports) {
6963
6963
  * `rest` being the remainder of the path (`''` on an exact match) that a
6964
6964
  * composite can use to route the problem to an inner control.
6965
6965
  *
6966
+ * A control counts only when it can show a problem, through a
6967
+ * `setCustomValidity` of its own: a form-associated element that has none is
6968
+ * skipped, so its problems fall to a shorter prefix or to the banner instead
6969
+ * of being dropped.
6970
+ *
6966
6971
  * Every other problem, and a field problem naming no control, is shown in
6967
6972
  * each `ful-errors` banner of the form: the banner gets `role="alert"`, is
6968
6973
  * revealed and holds the reasons one per line. With no such problem the
@@ -7001,7 +7006,7 @@ var fml = (function (exports) {
7001
7006
  const parts = name.split('.');
7002
7007
  for (let i = parts.length; i !== 0; --i) {
7003
7008
  const prefix = parts.slice(0, i).join('.');
7004
- const targets = named.get(prefix) ?? [];
7009
+ const targets = (named.get(prefix) ?? []).filter((el) => typeof el.setCustomValidity === 'function');
7005
7010
  if (targets.length === 0) {
7006
7011
  continue;
7007
7012
  }
@@ -7459,6 +7464,14 @@ var fml = (function (exports) {
7459
7464
  * accessibility tree.
7460
7465
  * - `also` are further controls that mirror `disabled` and `readOnly`
7461
7466
  * beside the claim target.
7467
+ *
7468
+ * The pieces are elements the field rendered itself, native controls or
7469
+ * wrappers of its own. A ful field is not one: it has no `readOnly`, its
7470
+ * host's role takes no aria, and a label's `for` names its host rather than
7471
+ * its control. A composite built from ful fields answers the inner field as
7472
+ * `control`, which forwards `focus()`, lets it render its own label with
7473
+ * `label` and `announces` null, and forwards the claims in its setters,
7474
+ * calling super first.
7462
7475
  * @param {{ slots: Record<string, DocumentFragment> | undefined }} conf
7463
7476
  * @returns {any} the pieces, or a promise of them
7464
7477
  * @throws {Error} when the subclass does not implement it
@@ -10846,7 +10859,7 @@ var fml = (function (exports) {
10846
10859
  return;
10847
10860
  }
10848
10861
  /** @type {HTMLInputElement|null} */
10849
- const el = this.querySelector(`input[type=radio][value=${CSS.escape(String(value))}]`);
10862
+ const el = this.querySelector(`input[type=radio][value="${CSS.escape(String(value))}"]`);
10850
10863
  if (el === null) {
10851
10864
  clear();
10852
10865
  return;
@@ -13120,11 +13133,12 @@ var fml = (function (exports) {
13120
13133
  * `show`, and fills the content with what the callback resolves to. A
13121
13134
  * rejection is shown, as the problems' reasons, in the error section, and
13122
13135
  * the content is hidden. When a newer `update()` starts before the callback
13123
- * settles, this call paints nothing: it resolves with the section regardless,
13124
- * and still rejects with the callback's error.
13136
+ * settles, this call paints nothing and resolves `null`, the section being
13137
+ * the newer call's; it still rejects with the callback's error.
13125
13138
  * @param {() => Node|string|Promise<Node|string>} cb producing the content
13126
13139
  * @param {() => void} show opens the dialog when it is closed
13127
- * @returns {Promise<HTMLElement>} the content section
13140
+ * @returns {Promise<HTMLElement|null>} the content section, or `null` for a
13141
+ * call a newer one overtook
13128
13142
  * @throws {any} what the callback threw or rejected with
13129
13143
  */
13130
13144
  async update(cb, show) {
@@ -13137,7 +13151,7 @@ var fml = (function (exports) {
13137
13151
  try {
13138
13152
  const delivered = await cb();
13139
13153
  if (claim.stale) {
13140
- return this.#section;
13154
+ return null;
13141
13155
  }
13142
13156
  this.#section.replaceChildren(delivered);
13143
13157
  this.#loading?.setAttribute('hidden', '');
@@ -13383,11 +13397,12 @@ var fml = (function (exports) {
13383
13397
  *
13384
13398
  * No `section:requested` is dispatched, and no `ask()` waiter is added:
13385
13399
  * listen for the `close` event to learn how the dialog ended. When a newer
13386
- * `update()` starts before the callback settles, this call paints nothing:
13387
- * it resolves with the body regardless, and still rejects with the
13388
- * callback's error.
13400
+ * `update()` starts before the callback settles, this call paints nothing
13401
+ * and resolves `null`, the body being the newer call's; it still rejects
13402
+ * with the callback's error.
13389
13403
  * @param {() => Node|string|Promise<Node|string>} cb producing the body content
13390
- * @returns {Promise<Element>} the body section, in the document
13404
+ * @returns {Promise<Element|null>} the body section, in the document, or
13405
+ * `null` for a call a newer one overtook
13391
13406
  * @throws {any} what the callback threw or rejected with
13392
13407
  */
13393
13408
  async update(cb) {
@@ -13677,12 +13692,13 @@ var fml = (function (exports) {
13677
13692
  * which has `role="alert"`, and the content is hidden.
13678
13693
  *
13679
13694
  * No `section:requested` is dispatched. When a newer `update()` starts
13680
- * before the callback settles, this call paints nothing: it resolves with
13681
- * the content section regardless, and still rejects with the callback's
13682
- * error.
13695
+ * before the callback settles, this call paints nothing and resolves
13696
+ * `null`, the content section being the newer call's; it still rejects with
13697
+ * the callback's error.
13683
13698
  * @param {string} header the title, set as text
13684
13699
  * @param {() => Node|string|Promise<Node|string>} cb producing the content
13685
- * @returns {Promise<Element>} the content section, in the document
13700
+ * @returns {Promise<Element|null>} the content section, in the document, or
13701
+ * `null` for a call a newer one overtook
13686
13702
  * @throws {any} what the callback threw or rejected with
13687
13703
  */
13688
13704
  async update(header, cb) {