@optionfactory/fml 9.0.0-rc31 → 9.0.0-rc33

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
@@ -2075,6 +2075,12 @@ export type TablePageResponse = {
2075
2075
  data: any[];
2076
2076
  size: number;
2077
2077
  };
2078
+ export type TableStatus = {
2079
+ count: Element;
2080
+ appending: Element;
2081
+ failure: Element;
2082
+ error: Element;
2083
+ };
2078
2084
  export type TableRowLoader = {
2079
2085
  load(pageRequest: TablePageRequest, sortRequest: TableSortRequest | null, filterRequest: Record<string, any>): Promise<TablePageResponse>;
2080
2086
  };
@@ -2090,6 +2096,10 @@ export type TableRowLoader = {
2090
2096
  * @typedef {{ data: any[], size: number }} TablePageResponse the rows of the
2091
2097
  * requested page and the total number of rows across every page
2092
2098
  */
2099
+ /**
2100
+ * @typedef {{ count: Element, appending: Element, failure: Element, error: Element }} TableStatus the pieces
2101
+ * of the status bar `paging="infinite"` and `paging="virtual"` show in place of the pager
2102
+ */
2093
2103
  /**
2094
2104
  * @typedef {{ load(pageRequest: TablePageRequest, sortRequest: TableSortRequest|null, filterRequest: Record<string, any>): Promise<TablePageResponse> }} TableRowLoader
2095
2105
  */
@@ -2287,6 +2297,21 @@ declare class TableLoader {
2287
2297
  * for it. Without it the table shows an initial panel until `load`,
2288
2298
  * `reload` or `resetWithFilter` is called.
2289
2299
  *
2300
+ * `paging="infinite"`, read once at the upgrade, replaces the pager with a
2301
+ * status bar saying how many rows of how many are shown, with a reload
2302
+ * button. A load still replaces the rows with one page, scrolling the rows
2303
+ * back to the top; from then on, whenever a row of the last half page
2304
+ * comes into view, the next page is asked with the same size, sort and
2305
+ * filters and appended (see `load`). `reload`, a sort, a filter submit and a
2306
+ * size change start over from the first page.
2307
+ *
2308
+ * `paging="virtual"` shows the same status bar, saying which rows of how many
2309
+ * are in view, and keeps in the page only the page in view and one on either
2310
+ * side of it, the others standing in as empty space sized on the height of
2311
+ * the rows. The rows must scroll inside the table, as `ful-fill` makes them:
2312
+ * a table whose rows the page scrolls appends as `paging="infinite"` does,
2313
+ * and warns. See `load` and `reload`.
2314
+ *
2290
2315
  * Inside the table, and not inside a `ful-table` nested in it, a
2291
2316
  * `page:requested` loads that page with the current size,
2292
2317
  * sort and filters; a `sort:requested` loads the current page with the new
@@ -2310,6 +2335,7 @@ declare class Table extends ParsedElement {
2310
2335
  static config: {
2311
2336
  searchIcon: string;
2312
2337
  emptyIcon: string;
2338
+ reloadIcon: string;
2313
2339
  };
2314
2340
  static template: string;
2315
2341
  static templates: {
@@ -2400,6 +2426,14 @@ declare class Table extends ParsedElement {
2400
2426
  * `submit` listeners as the later ones, and the load its `submit:success`
2401
2427
  * starts is the one awaited. A filter submit that is cancelled, fails or
2402
2428
  * is dropped for one in flight loads nothing, and the promise resolves.
2429
+ *
2430
+ * Under `paging="virtual"`, once rows show, it asks again for the pages in
2431
+ * the page, with the same size, sort and filters, and shows them where
2432
+ * they are, the scroll position and the widths of the columns kept; the
2433
+ * table is busy and settles, fails and dispatches as a load does, one
2434
+ * `load:success` per page. When the answers report fewer rows than the
2435
+ * window starts at, it loads the first page instead. A `src` or `method`
2436
+ * write still starts over from the first page.
2403
2437
  * @returns {Promise<void>} as `load`
2404
2438
  */
2405
2439
  reload(): Promise<void>;
@@ -2435,6 +2469,40 @@ declare class Table extends ParsedElement {
2435
2469
  * failure arrives it changes nothing, dispatches nothing and resolves;
2436
2470
  * superseded while its rows render, it leaves them to the newer load and
2437
2471
  * dispatches nothing.
2472
+ *
2473
+ * Under `paging="infinite"` the status bar takes the pager's place, and
2474
+ * once the load has dispatched `load:success` the next page is awaited:
2475
+ * when a row of the last half page comes into view, through
2476
+ * whatever scrolls it, the following page is asked for with the same
2477
+ * size, sort and filters and its rows are appended. An append runs
2478
+ * without `aria-busy`, a spinner in the status bar standing in, and
2479
+ * dispatches `load:success` or `load:failure` as a load does, its
2480
+ * `pageRequest` naming the appended page. A failed append keeps the
2481
+ * rows, shows the error in the status bar with a retry button and
2482
+ * rejects to nobody, nothing awaiting it. Appending stops once the rows
2483
+ * shown reach the total the last answer reported, or an answer carries
2484
+ * no rows. A load supersedes an append in flight; `reload` repeats this
2485
+ * load, not the pages appended to it.
2486
+ *
2487
+ * Under `paging="virtual"` the load shows its page as the window, scrolled
2488
+ * to where it sits among the total, and measures two things on its rows:
2489
+ * the height the empty space standing in for the other rows is sized on,
2490
+ * and the width of the columns, which then stay as they are, in
2491
+ * proportion, until the next load, so that the pages coming and going do
2492
+ * not move them. From then on the window follows the scroll: the page in
2493
+ * view and one on either side stay in the page and the others are dropped,
2494
+ * the page holding the focus kept while it is within two pages of them. A
2495
+ * page next to the window is asked for at once; a scroll landing farther
2496
+ * waits for the scroll to rest. Window pages are asked for without
2497
+ * `aria-busy`, a spinner in the status bar standing in, and dispatch
2498
+ * `load:success` or `load:failure` per page as appends do; a failure keeps
2499
+ * the rows and offers a retry. The row in view stays where it is as pages
2500
+ * come and go above it: the table measures it before and after and
2501
+ * corrects the scroll by whatever the browser's own scroll anchoring has
2502
+ * not kept, which is all of it where the browser anchors no table rows
2503
+ * (Firefox), has no scroll anchoring or the rows' container declares
2504
+ * `overflow-anchor: none`, and nothing where it has. The table carries
2505
+ * `aria-rowcount` and each row its `aria-rowindex`.
2438
2506
  * @param {TablePageRequest} pageRequest
2439
2507
  * @param {TableSortRequest|null} sortRequest
2440
2508
  * @param {Record<string, any>} filterRequest