@optionfactory/fml 9.0.0-rc30 → 9.0.0-rc31

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
@@ -406,12 +406,13 @@ declare class Bindings {
406
406
  *
407
407
  * The claim setters, the validity protocol and the aria wiring all act on the
408
408
  * pieces, so a field with no native control returns a focusable piece of its
409
- * own chrome as the control. The claims, `value` and `focus()` are the
410
- * members that tolerate a not yet rendered element: before the render the
411
- * `value` getter answers what the rendered field would answer from its current
412
- * declared state, and a value written then is held and applied by the render
413
- * (see `_holdValue`). The other members need the pieces and so work only after
414
- * the render.
409
+ * own chrome as the control. The claims, `value`, `focus()` and
410
+ * `setCustomValidity` are the members that tolerate a not yet rendered
411
+ * element: before the render the `value` getter answers what the rendered
412
+ * field would answer from its current declared state, a value written then is
413
+ * held and applied by the render (see `_holdValue`), and a problem reported
414
+ * then is shown by it. The other members need the pieces and so work only
415
+ * after the render.
415
416
  *
416
417
  * The inner controls carry `form=""`, so the host is the only element the form
417
418
  * sees. Enter pressed in an inner `<input>` of any type but `file`, `button`,
@@ -485,7 +486,9 @@ declare class Field extends ParsedElement {
485
486
  * field owning a whole subtree overrides this to route the message to the
486
487
  * inner control the path names.
487
488
  *
488
- * Needs the render: before it there is no error region to write to.
489
+ * Before the render there is no error region to write to: a message is
490
+ * kept (the last one wins) and shown once the field has rendered, and a
491
+ * clear drops the one kept. A field whose render failed shows nothing.
489
492
  * @param {string} [error] the message, empty or missing to clear
490
493
  * @param {string} [context] the path below this field's name, '' on an exact match
491
494
  */
@@ -608,7 +611,9 @@ declare class Field extends ParsedElement {
608
611
  /**
609
612
  * Calls `_build(conf)` and wires the pieces it answers. When `_build`
610
613
  * returns a promise the pieces are wired once it settles; a field that
611
- * builds synchronously renders synchronously.
614
+ * builds synchronously renders synchronously. A default slot holding
615
+ * nothing but whitespace is emptied first, so the label it becomes is
616
+ * `:empty` and takes no row.
612
617
  * @param {{ slots: Record<string, DocumentFragment> | undefined }} conf
613
618
  * @returns {void | Promise<void>}
614
619
  */
@@ -1173,7 +1178,8 @@ declare class InputInstant extends Input {
1173
1178
  * size and count limits it declares.
1174
1179
  *
1175
1180
  * The `dropzone` and `item-list` attributes show the dropzone and the list of
1176
- * chosen files. A `dropzone` slot replaces the default dropzone's content, and
1181
+ * chosen files, and `no-input` takes the picker control out of sight, leaving
1182
+ * it to the keyboard and to assistive technology. A `dropzone` slot replaces the default dropzone's content, and
1177
1183
  * an `items` slot holding a template replaces the stock item, rendered with the
1178
1184
  * same `files` overlay so that it reads the File objects it lists. Clicking the
1179
1185
  * dropzone opens the picker, and the host carries a `dragover` attribute while
@@ -1287,7 +1293,7 @@ declare class InputFile extends Input {
1287
1293
  * The size of the selected files together, in bytes.
1288
1294
  * @returns {number}
1289
1295
  */
1290
- get totalsize(): number;
1296
+ get totalSize(): number;
1291
1297
  /**
1292
1298
  * The most files a selection may hold; a larger selection is cleared
1293
1299
  * entirely with a warning. Enforced from the next selection on.
@@ -1329,6 +1335,17 @@ declare class InputFile extends Input {
1329
1335
  get dropzone(): boolean;
1330
1336
  /** @param {boolean} v */
1331
1337
  set dropzone(v: boolean);
1338
+ /**
1339
+ * Whether the picker control is taken out of sight, the dropzone and the
1340
+ * item list carrying the field alone; the stylesheet hides it from the
1341
+ * reflected `no-input` attribute. The control stays in the tab order and
1342
+ * keeps the label, the description and the error, and the dropzone shows
1343
+ * the focus ring while it holds the focus.
1344
+ * @returns {boolean}
1345
+ */
1346
+ get noInput(): boolean;
1347
+ /** @param {boolean} v */
1348
+ set noInput(v: boolean);
1332
1349
  }
1333
1350
  /**
1334
1351
  * Places a popover beside the element or the rectangle it belongs to.
@@ -2086,6 +2103,10 @@ export type TableRowLoader = {
2086
2103
  * current `order` in the cycle `asc`, `desc`, `null`. The button does not
2087
2104
  * change its own `order`: whoever handles the event sets it, which `ful-table`
2088
2105
  * does once the sorted page has loaded.
2106
+ *
2107
+ * The stylesheet draws an up arrow for `asc` and a down arrow for `desc`. An
2108
+ * unsorted button shows the up arrow dimmed, `asc` being the order its first
2109
+ * activation asks for.
2089
2110
  */
2090
2111
  declare class SortButton extends ParsedElement {
2091
2112
  #private;
@@ -2170,42 +2191,6 @@ declare class Pagination extends ParsedElement {
2170
2191
  */
2171
2192
  set current(value: number | null);
2172
2193
  }
2173
- /** Reads the schema declaration into the header and row templates a table renders from. */
2174
- declare class TableSchemaParser {
2175
- /**
2176
- * Builds a header `<tr>` and a row `<tr data-tpl-each="rows">` from the
2177
- * `<schema>` child of the slot. The `<schema>` attributes are copied onto
2178
- * both rows. Each `<column>` becomes a `<th>` and a `<td>` carrying the
2179
- * column's attributes except `title`, `sorter` and `order`, so a
2180
- * `data-tpl-*` on a column applies to both cells; the two templates carry
2181
- * `inHeaders` and `inRows` in their scope, so a column can tell them apart,
2182
- * as in `data-tpl-if="inRows"`. The header cell holds the `<title>` child
2183
- * element of the column, else the text of its `title` attribute, wrapped
2184
- * in a `ful-sorter` when the column declares `sorter` or `order`. The body
2185
- * cell holds the column's remaining children.
2186
- *
2187
- * The column elements are consumed: their `<title>`, `title`, `sorter` and
2188
- * `order` are removed and their children moved into the cells.
2189
- * @param {DocumentFragment|Element|undefined} nodeOrFragment the `schema`
2190
- * slot, undefined when the table has none
2191
- * @param {ReturnType<ParsedElement['template']>} template the template the
2192
- * header and row templates derive from, keeping its scope
2193
- * @returns {{ headersTemplate: ReturnType<ParsedElement['template']>, rowsTemplate: ReturnType<ParsedElement['template']>, sort: { sorter: string|null, order: string|null } | null, length: number }}
2194
- * `sort` is the initial sort, taken from the first column declaring both
2195
- * `order` and `sorter` (a column with only `order` gets an arrow but no
2196
- * initial sort), `null` when none does; `length` is the number of columns
2197
- * @throws {Error} when the slot is missing or holds no `<schema>`
2198
- */
2199
- static parse(nodeOrFragment: DocumentFragment | Element | undefined, template: ReturnType<ParsedElement['template']>): {
2200
- headersTemplate: ReturnType<ParsedElement['template']>;
2201
- rowsTemplate: ReturnType<ParsedElement['template']>;
2202
- sort: {
2203
- sorter: string | null;
2204
- order: string | null;
2205
- } | null;
2206
- length: number;
2207
- };
2208
- }
2209
2194
  /** Serves a table's rows from an array held in memory, applying the sort and the paging itself. */
2210
2195
  declare class InMemoryTableLoader {
2211
2196
  #private;
@@ -2342,14 +2327,15 @@ declare class Table extends ParsedElement {
2342
2327
  * writing the size is not a request to start loading, which is what
2343
2328
  * `autoload` and `reload()` are for. A write that does not change the size
2344
2329
  * does nothing. A write made before the render is replaced by the declared
2345
- * `page-size` when the table renders.
2330
+ * `page-size` when the table renders, or by ten when that is not a number
2331
+ * above zero.
2346
2332
  *
2347
2333
  * The reload is not awaited: a failure shows the error panel and its
2348
2334
  * rejection is unhandled.
2349
2335
  * @param {number|string|null|undefined} value a number or a string of
2350
2336
  * one, such as a select's value; absent or null is the default of ten,
2351
2337
  * so removing the attribute restores it, and a value that is not a
2352
- * number is ignored
2338
+ * finite number above zero is ignored
2353
2339
  */
2354
2340
  set pageSize(value: number | string | null | undefined);
2355
2341
  /**
@@ -2440,7 +2426,10 @@ declare class Table extends ParsedElement {
2440
2426
  * `aria-busy` is removed, `load:failure` is dispatched (bubbling, not
2441
2427
  * cancelable) with `detail` set to
2442
2428
  * `{ pageRequest, sortRequest, filterRequest, exception }`, and the
2443
- * returned promise rejects with the same error.
2429
+ * returned promise rejects with the same error. An answer the table cannot
2430
+ * page fails the same way, with an error saying so: one whose `size` is
2431
+ * not a number, as a response of another shape read without a
2432
+ * `response-mapper` is, or a page size of zero.
2444
2433
  *
2445
2434
  * A load started after this one supersedes it: when this one's answer or
2446
2435
  * failure arrives it changes nothing, dispatches nothing and resolves;
@@ -3044,7 +3033,7 @@ declare class Dialog extends ParsedElement {
3044
3033
  * opening, hides the error and loading sections, and dispatches
3045
3034
  * `section:requested` on the element (bubbling, with
3046
3035
  * `detail: { section, first, name: null, index: null }`, `section` being
3047
- * the body and `first` true only on the first answered request), so a
3036
+ * the body and `first` true until a delivery succeeds), so a
3048
3037
  * listener can fill the body. A failed request is painted into the body
3049
3038
  * and does not reject. On a dialog already open nothing is shown or
3050
3039
  * requested, and the call waits for the same ending as the calls before it;
@@ -3240,7 +3229,7 @@ declare class Drawer extends ParsedElement {
3240
3229
  * opening, hides the error and loading sections, and dispatches
3241
3230
  * `section:requested` on the element (bubbling, with
3242
3231
  * `detail: { section, first, name: null, index: null }`, `section` being
3243
- * the content section and `first` true only on the first answered request),
3232
+ * the content section and `first` true until a delivery succeeds),
3244
3233
  * so a listener can fill the content. A failed request is painted into the
3245
3234
  * content section and does not reject. On a drawer already open nothing is
3246
3235
  * shown or requested, except that one sliding out stops and stays open,
@@ -3270,11 +3259,13 @@ declare class Drawer extends ParsedElement {
3270
3259
  /**
3271
3260
  * Slides the drawer out and closes it when the animation ends, setting the
3272
3261
  * `closing` attribute on the native dialog meanwhile; the `close` event is
3273
- * dispatched then, after this call has returned. Where the user prefers
3274
- * reduced motion, or no animation runs, it closes at once. A non-empty
3275
- * result answers as the button carrying that `data-result` would; no
3276
- * result, or an empty one, is a dismissal. Does nothing on a drawer that is
3277
- * closed or already sliding out.
3262
+ * dispatched then, after this call has returned. An animation the page
3263
+ * cancels, by hiding the drawer or an ancestor of it, closes it as one
3264
+ * that ended does. Where the user prefers reduced motion, or no animation
3265
+ * runs, it closes at once. A non-empty result answers as the button
3266
+ * carrying that `data-result` would; no result, or an empty one, is a
3267
+ * dismissal. Does nothing on a drawer that is closed or already sliding
3268
+ * out.
3278
3269
  * @param {string} [result]
3279
3270
  */
3280
3271
  close(result?: string): void;
@@ -3478,7 +3469,7 @@ declare class Tabs extends ParsedElement {
3478
3469
  get active(): number;
3479
3470
  /**
3480
3471
  * Fires the section requests again for a panel, whether it is visible or
3481
- * not, with `first` false once an earlier request was answered.
3472
+ * not, with `first` false once an earlier delivery succeeded.
3482
3473
  * @param {number | Element} ref the panel's index, or the panel itself
3483
3474
  * @returns {Promise<any[] | undefined> | undefined} a promise resolving to
3484
3475
  * the answers, or to undefined when nobody listened or the delivery
@@ -3606,7 +3597,7 @@ declare class Wizard extends ParsedElement {
3606
3597
  move(ref: string): Promise<any[] | undefined> | undefined;
3607
3598
  /**
3608
3599
  * Fires the section requests again for a section, whether it is current or
3609
- * not, with `first` false once an earlier request was answered.
3600
+ * not, with `first` false once an earlier delivery succeeded.
3610
3601
  * @param {string | Element} ref the section's `data-step`, or the section
3611
3602
  * itself
3612
3603
  * @returns {Promise<any[] | undefined> | undefined} a promise resolving to
@@ -3627,8 +3618,11 @@ declare class Plugin {
3627
3618
  /**
3628
3619
  * @param {{ language?: string, translations?: Record<string, any>, httpClient?: HttpClient }} [options]
3629
3620
  * `language` is fixed for the page: a full BCP-47 tag or a primary subtag,
3630
- * defaulting to `navigator.language`, then to 'en'. Its primary subtag,
3631
- * lowercased, picks the built-in translations (en, it, es, fr); the messages
3621
+ * defaulting to `navigator.language`, then to 'en', an empty one included.
3622
+ * It is canonicalized (`IT-it` and `it_IT` both read `it-IT`), and one that
3623
+ * is no language tag at all throws here, rather than at the first message
3624
+ * or number formatted in it. Its primary subtag picks the built-in
3625
+ * translations (en, it, es, fr); the messages
3632
3626
  * are the english ones, overridden by that language's, overridden by
3633
3627
  * `translations`, so a language without built-in translations reads in
3634
3628
  * english. `translations` is a flat map of keys to messages: reword built-in
@@ -3636,6 +3630,7 @@ declare class Plugin {
3636
3630
  * `httpClient` is the client every ful component fetches through, registered
3637
3631
  * as the `http-client` component; without one, `configure` builds a client
3638
3632
  * that sends the csrf token and navigates to '/' on a 401 response.
3633
+ * @throws {RangeError} when `language` is not a language tag
3639
3634
  */
3640
3635
  constructor(options?: {
3641
3636
  language?: string;
@@ -3646,7 +3641,7 @@ declare class Plugin {
3646
3641
  * Defines on `registry` the `l10n` module, the `http-client` component,
3647
3642
  * every `ful-*` element, the `loaders:select`, `loaders:form` and
3648
3643
  * `loaders:table` components, and an overlay publishing `l10n` (the merged
3649
- * messages) and `locale` (the `language` as given) to every template.
3644
+ * messages) and `locale` (the `language`, canonicalized) to every template.
3650
3645
  * @param {{ defineModule(name: string, module: any): any, defineComponent(name: string, component: any): any, defineElement(tag: string, klass: CustomElementConstructor): any, defineOverlay(...data: any[]): any }} registry
3651
3646
  * the ftl `Registry`, each of those methods answering the registry itself
3652
3647
  * @returns {void}
@@ -3658,7 +3653,7 @@ declare class Plugin {
3658
3653
  defineOverlay(...data: any[]): any;
3659
3654
  }): void;
3660
3655
  }
3661
- export { Accordion, Anchors, AsyncEvents, Bindings, BooleanFilter, Checkbox, Claims, CompareFilter, Dialog, Drawer, Dropdown, Field, Form, FormLoader, InFilter, Input, InputFile, InputInstant, InputLocalDate, InputLocalTime, Instant, InstantFilter, LocalDate, LocalDateFilter, LocalStorage, Menu, NumberFilter, PageLeave, Pagination, Plugin, RadioGroup, Select, SelectLoader, SessionStorage, SortButton, Table, TableLoader, TableSchemaParser, Tabs, TextFilter, Timing, Toasts, Tooltip, VersionedLocalStorage, VersionedSessionStorage, Wizard, describable };
3656
+ export { Accordion, Anchors, AsyncEvents, Bindings, BooleanFilter, Checkbox, Claims, CompareFilter, Dialog, Drawer, Dropdown, Field, Form, FormLoader, InFilter, Input, InputFile, InputInstant, InputLocalDate, InputLocalTime, Instant, InstantFilter, LocalDate, LocalDateFilter, LocalStorage, Menu, NumberFilter, PageLeave, Pagination, Plugin, RadioGroup, Select, SelectLoader, SessionStorage, SortButton, Table, TableLoader, Tabs, TextFilter, Timing, Toasts, Tooltip, VersionedLocalStorage, VersionedSessionStorage, Wizard, describable };
3662
3657
 
3663
3658
  declare global {
3664
3659
  interface HTMLElementTagNameMap {