@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.
package/dist/ful.d.mts CHANGED
@@ -363,6 +363,11 @@ declare class Bindings {
363
363
  * `rest` being the remainder of the path (`''` on an exact match) that a
364
364
  * composite can use to route the problem to an inner control.
365
365
  *
366
+ * A control counts only when it can show a problem, through a
367
+ * `setCustomValidity` of its own: a form-associated element that has none is
368
+ * skipped, so its problems fall to a shorter prefix or to the banner instead
369
+ * of being dropped.
370
+ *
366
371
  * Every other problem, and a field problem naming no control, is shown in
367
372
  * each `ful-errors` banner of the form: the banner gets `role="alert"`, is
368
373
  * revealed and holds the reasons one per line. With no such problem the
@@ -616,6 +621,14 @@ declare class Field extends ParsedElement {
616
621
  * accessibility tree.
617
622
  * - `also` are further controls that mirror `disabled` and `readOnly`
618
623
  * beside the claim target.
624
+ *
625
+ * The pieces are elements the field rendered itself, native controls or
626
+ * wrappers of its own. A ful field is not one: it has no `readOnly`, its
627
+ * host's role takes no aria, and a label's `for` names its host rather than
628
+ * its control. A composite built from ful fields answers the inner field as
629
+ * `control`, which forwards `focus()`, lets it render its own label with
630
+ * `label` and `announces` null, and forwards the claims in its setters,
631
+ * calling super first.
619
632
  * @param {{ slots: Record<string, DocumentFragment> | undefined }} conf
620
633
  * @returns {any} the pieces, or a promise of them
621
634
  * @throws {Error} when the subclass does not implement it
@@ -2931,14 +2944,15 @@ declare class Dialog extends ParsedElement {
2931
2944
  *
2932
2945
  * No `section:requested` is dispatched, and no `ask()` waiter is added:
2933
2946
  * listen for the `close` event to learn how the dialog ended. When a newer
2934
- * `update()` starts before the callback settles, this call paints nothing:
2935
- * it resolves with the body regardless, and still rejects with the
2936
- * callback's error.
2947
+ * `update()` starts before the callback settles, this call paints nothing
2948
+ * and resolves `null`, the body being the newer call's; it still rejects
2949
+ * with the callback's error.
2937
2950
  * @param {() => Node|string|Promise<Node|string>} cb producing the body content
2938
- * @returns {Promise<Element>} the body section, in the document
2951
+ * @returns {Promise<Element|null>} the body section, in the document, or
2952
+ * `null` for a call a newer one overtook
2939
2953
  * @throws {any} what the callback threw or rejected with
2940
2954
  */
2941
- update(cb: () => Node | string | Promise<Node | string>): Promise<Element>;
2955
+ update(cb: () => Node | string | Promise<Node | string>): Promise<Element | null>;
2942
2956
  /**
2943
2957
  * Dispatches `section:requested` for the body again, as `ask()` does,
2944
2958
  * whether the dialog is open or closed. A failed request is painted into
@@ -3067,15 +3081,16 @@ declare class Drawer extends ParsedElement {
3067
3081
  * which has `role="alert"`, and the content is hidden.
3068
3082
  *
3069
3083
  * No `section:requested` is dispatched. When a newer `update()` starts
3070
- * before the callback settles, this call paints nothing: it resolves with
3071
- * the content section regardless, and still rejects with the callback's
3072
- * error.
3084
+ * before the callback settles, this call paints nothing and resolves
3085
+ * `null`, the content section being the newer call's; it still rejects with
3086
+ * the callback's error.
3073
3087
  * @param {string} header the title, set as text
3074
3088
  * @param {() => Node|string|Promise<Node|string>} cb producing the content
3075
- * @returns {Promise<Element>} the content section, in the document
3089
+ * @returns {Promise<Element|null>} the content section, in the document, or
3090
+ * `null` for a call a newer one overtook
3076
3091
  * @throws {any} what the callback threw or rejected with
3077
3092
  */
3078
- update(header: string, cb: () => Node | string | Promise<Node | string>): Promise<Element>;
3093
+ update(header: string, cb: () => Node | string | Promise<Node | string>): Promise<Element | null>;
3079
3094
  /**
3080
3095
  * Dispatches `section:requested` for the content again, as `open()` does,
3081
3096
  * whether the drawer is open or closed. A failed request is painted into
package/dist/ful.iife.js CHANGED
@@ -693,6 +693,11 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
693
693
  * `rest` being the remainder of the path (`''` on an exact match) that a
694
694
  * composite can use to route the problem to an inner control.
695
695
  *
696
+ * A control counts only when it can show a problem, through a
697
+ * `setCustomValidity` of its own: a form-associated element that has none is
698
+ * skipped, so its problems fall to a shorter prefix or to the banner instead
699
+ * of being dropped.
700
+ *
696
701
  * Every other problem, and a field problem naming no control, is shown in
697
702
  * each `ful-errors` banner of the form: the banner gets `role="alert"`, is
698
703
  * revealed and holds the reasons one per line. With no such problem the
@@ -731,7 +736,7 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
731
736
  const parts = name.split('.');
732
737
  for (let i = parts.length; i !== 0; --i) {
733
738
  const prefix = parts.slice(0, i).join('.');
734
- const targets = named.get(prefix) ?? [];
739
+ const targets = (named.get(prefix) ?? []).filter((el) => typeof el.setCustomValidity === 'function');
735
740
  if (targets.length === 0) {
736
741
  continue;
737
742
  }
@@ -1189,6 +1194,14 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
1189
1194
  * accessibility tree.
1190
1195
  * - `also` are further controls that mirror `disabled` and `readOnly`
1191
1196
  * beside the claim target.
1197
+ *
1198
+ * The pieces are elements the field rendered itself, native controls or
1199
+ * wrappers of its own. A ful field is not one: it has no `readOnly`, its
1200
+ * host's role takes no aria, and a label's `for` names its host rather than
1201
+ * its control. A composite built from ful fields answers the inner field as
1202
+ * `control`, which forwards `focus()`, lets it render its own label with
1203
+ * `label` and `announces` null, and forwards the claims in its setters,
1204
+ * calling super first.
1192
1205
  * @param {{ slots: Record<string, DocumentFragment> | undefined }} conf
1193
1206
  * @returns {any} the pieces, or a promise of them
1194
1207
  * @throws {Error} when the subclass does not implement it
@@ -4576,7 +4589,7 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
4576
4589
  return;
4577
4590
  }
4578
4591
  /** @type {HTMLInputElement|null} */
4579
- const el = this.querySelector(`input[type=radio][value=${CSS.escape(String(value))}]`);
4592
+ const el = this.querySelector(`input[type=radio][value="${CSS.escape(String(value))}"]`);
4580
4593
  if (el === null) {
4581
4594
  clear();
4582
4595
  return;
@@ -6850,11 +6863,12 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
6850
6863
  * `show`, and fills the content with what the callback resolves to. A
6851
6864
  * rejection is shown, as the problems' reasons, in the error section, and
6852
6865
  * the content is hidden. When a newer `update()` starts before the callback
6853
- * settles, this call paints nothing: it resolves with the section regardless,
6854
- * and still rejects with the callback's error.
6866
+ * settles, this call paints nothing and resolves `null`, the section being
6867
+ * the newer call's; it still rejects with the callback's error.
6855
6868
  * @param {() => Node|string|Promise<Node|string>} cb producing the content
6856
6869
  * @param {() => void} show opens the dialog when it is closed
6857
- * @returns {Promise<HTMLElement>} the content section
6870
+ * @returns {Promise<HTMLElement|null>} the content section, or `null` for a
6871
+ * call a newer one overtook
6858
6872
  * @throws {any} what the callback threw or rejected with
6859
6873
  */
6860
6874
  async update(cb, show) {
@@ -6867,7 +6881,7 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
6867
6881
  try {
6868
6882
  const delivered = await cb();
6869
6883
  if (claim.stale) {
6870
- return this.#section;
6884
+ return null;
6871
6885
  }
6872
6886
  this.#section.replaceChildren(delivered);
6873
6887
  this.#loading?.setAttribute('hidden', '');
@@ -7113,11 +7127,12 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
7113
7127
  *
7114
7128
  * No `section:requested` is dispatched, and no `ask()` waiter is added:
7115
7129
  * listen for the `close` event to learn how the dialog ended. When a newer
7116
- * `update()` starts before the callback settles, this call paints nothing:
7117
- * it resolves with the body regardless, and still rejects with the
7118
- * callback's error.
7130
+ * `update()` starts before the callback settles, this call paints nothing
7131
+ * and resolves `null`, the body being the newer call's; it still rejects
7132
+ * with the callback's error.
7119
7133
  * @param {() => Node|string|Promise<Node|string>} cb producing the body content
7120
- * @returns {Promise<Element>} the body section, in the document
7134
+ * @returns {Promise<Element|null>} the body section, in the document, or
7135
+ * `null` for a call a newer one overtook
7121
7136
  * @throws {any} what the callback threw or rejected with
7122
7137
  */
7123
7138
  async update(cb) {
@@ -7407,12 +7422,13 @@ var ful = (function (exports, index_mjs, index_mjs$1) {
7407
7422
  * which has `role="alert"`, and the content is hidden.
7408
7423
  *
7409
7424
  * No `section:requested` is dispatched. When a newer `update()` starts
7410
- * before the callback settles, this call paints nothing: it resolves with
7411
- * the content section regardless, and still rejects with the callback's
7412
- * error.
7425
+ * before the callback settles, this call paints nothing and resolves
7426
+ * `null`, the content section being the newer call's; it still rejects with
7427
+ * the callback's error.
7413
7428
  * @param {string} header the title, set as text
7414
7429
  * @param {() => Node|string|Promise<Node|string>} cb producing the content
7415
- * @returns {Promise<Element>} the content section, in the document
7430
+ * @returns {Promise<Element|null>} the content section, in the document, or
7431
+ * `null` for a call a newer one overtook
7416
7432
  * @throws {any} what the callback threw or rejected with
7417
7433
  */
7418
7434
  async update(header, cb) {