@forgeroute/ui 0.4.82 → 0.4.84
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/fesm2022/forgeroute-ui-offline.mjs +179 -22
- package/fesm2022/forgeroute-ui-offline.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-DPY2FHcg.mjs → forgeroute-ui-ui-labels.es-CujY_jus.mjs} +13 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-DPY2FHcg.mjs.map → forgeroute-ui-ui-labels.es-CujY_jus.mjs.map} +1 -1
- package/fesm2022/forgeroute-ui.mjs +347 -136
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-messaging.d.ts +1 -1
- package/types/forgeroute-ui-offline.d.ts +25 -3
- package/types/forgeroute-ui-stripe.d.ts +1 -1
- package/types/forgeroute-ui.d.ts +133 -17
package/package.json
CHANGED
|
@@ -619,7 +619,7 @@ export declare class DocumentSendOptionsComponent implements UiFieldValidity {
|
|
|
619
619
|
/** Roles of documents whose row had no `signerRoles` and that the host resolves (`signers().resolveRoles`). */
|
|
620
620
|
readonly roleStates: import("@angular/core").WritableSignal<Record<string, RoleState>>;
|
|
621
621
|
/** The envelope's documents: `loading` / `error` while the panel reads them (`loadDocuments`), `ready` once known. */
|
|
622
|
-
readonly envelopeStatus: import("@angular/core").WritableSignal<"
|
|
622
|
+
readonly envelopeStatus: import("@angular/core").WritableSignal<"error" | "loading" | "ready" | "idle">;
|
|
623
623
|
private envelopeSub;
|
|
624
624
|
private readonly roleSubs;
|
|
625
625
|
/** The sender opened the collapsed "Signing options" line. */
|
|
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import { EnvironmentProviders, InjectionToken } from "@angular/core";
|
|
3
3
|
import { Subject } from "rxjs";
|
|
4
4
|
import { HttpContextToken, HttpInterceptorFn } from "@angular/common/http";
|
|
5
|
-
import { UiLabelsService } from "@forgeroute/ui";
|
|
5
|
+
import { QueuedNote, UiLabelsService, UiNotesQueue } from "@forgeroute/ui";
|
|
6
6
|
export type MutationStatus = 'pending' | 'syncing' | 'failed' | 'conflict';
|
|
7
7
|
export type MutationErrorKind = 'conflict' | 'rejected' | 'auth' | 'server' | 'network' | 'timeout' | 'dependency';
|
|
8
8
|
export interface MutationError {
|
|
@@ -541,8 +541,8 @@ export declare class OfflineReplayer {
|
|
|
541
541
|
keepMineOne(id: string): Promise<KeepMineRun>;
|
|
542
542
|
/** sent = delivered; shortly = it is still queued (no run could start because another tab holds the lock, still pending / being sent, or waiting out a retry); failed = refused again or a new conflict. */
|
|
543
543
|
private keepMineOutcome;
|
|
544
|
-
/** Deletes one row of the signed-in user (the user chose to discard it). When that row was a stuck (failed / conflict) one with later pending changes of the same record behind it, one normal drain follows so they go out. */
|
|
545
|
-
discard(id: string): Promise<
|
|
544
|
+
/** Deletes one row of the signed-in user (the user chose to discard it). Resolves `true` when this call found and deleted the row, `false` when it was already gone (e.g. delivered meanwhile) or is not the user's. When that row was a stuck (failed / conflict) one with later pending changes of the same record behind it, one normal drain follows so they go out. */
|
|
545
|
+
discard(id: string): Promise<boolean>;
|
|
546
546
|
private readonly discardDrains;
|
|
547
547
|
/** Resolves when EVERY drain started by a `discard` (also overlapping ones) has finished; immediately when none is running. Never rejects. */
|
|
548
548
|
drainSettled(): Promise<void>;
|
|
@@ -736,6 +736,13 @@ export declare class OfflineSupportService {
|
|
|
736
736
|
* Throws `KeepMineError` when the feature is off, the row does not exist, it is not in status `conflict`, or its body has no stamp field (`noStamp`; same rule as `canKeepMine`).
|
|
737
737
|
*/
|
|
738
738
|
keepMine(id: string): Promise<KeepMineOutcome>;
|
|
739
|
+
/** Rows the USER discarded (id -> when), set before the row is deleted so a reader that sees the row leave can tell a discard from a delivery. */
|
|
740
|
+
private readonly discardedIds;
|
|
741
|
+
/** A discard mark only matters while its row leaves the list; it expires after this many ms (and the map is emptied when it grows past 500). */
|
|
742
|
+
private static readonly DISCARD_MARK_MS;
|
|
743
|
+
/** True when the row with this id left the list because the user discarded it (not because it was delivered). */
|
|
744
|
+
wasDiscarded(id: string): boolean;
|
|
745
|
+
private markDiscarded;
|
|
739
746
|
discard(id: string): Promise<void>;
|
|
740
747
|
discardAll(): Promise<void>;
|
|
741
748
|
/**
|
|
@@ -780,6 +787,21 @@ export declare class OfflineSupportService {
|
|
|
780
787
|
* `provideHttpClient(withInterceptors([..., ...offlineHttpInterceptors]))`.
|
|
781
788
|
*/
|
|
782
789
|
export declare function provideOfflineSupport(config: OfflineSupportConfig): EnvironmentProviders;
|
|
790
|
+
/**
|
|
791
|
+
* Lets `ui-notes` show the note changes the offline layer has saved on the device. It reads `OfflineSupportService.rows` (the offline layer's own
|
|
792
|
+
* list - nothing is copied or cached here) and keeps the rows whose URL belongs to the notes list asked for. Provided as `UI_NOTES_QUEUE` by
|
|
793
|
+
* `provideOfflineSupport`; the app still decides whether notes may be queued at all (its `allowQueue` rules / `blockOffline`).
|
|
794
|
+
*/
|
|
795
|
+
export declare class OfflineNotesQueue implements UiNotesQueue {
|
|
796
|
+
private readonly support;
|
|
797
|
+
private readonly connection;
|
|
798
|
+
readonly offline: import("@angular/core").Signal<boolean>;
|
|
799
|
+
wasDiscarded(rowId: string): boolean;
|
|
800
|
+
queuedFor(listPath: string, itemPrefix: string): readonly QueuedNote[];
|
|
801
|
+
private toQueued;
|
|
802
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OfflineNotesQueue, never>;
|
|
803
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
804
|
+
}
|
|
783
805
|
/** How long the green "All changes synced" bar stays after a sync. */
|
|
784
806
|
export declare const SYNCED_FLASH_MS = 3000;
|
|
785
807
|
export type ConnectionBannerKind = 'auth' | 'offline' | 'unreachable' | 'syncing' | 'attention' | 'slow' | 'synced';
|
|
@@ -1314,7 +1314,7 @@ export declare class StripeConnectComponent {
|
|
|
1314
1314
|
readonly navigateTab: import("@angular/core").InputSignal<((url: string) => void) | null>;
|
|
1315
1315
|
protected readonly visible: import("@angular/core").Signal<boolean>;
|
|
1316
1316
|
/** Which screen the card shows. */
|
|
1317
|
-
protected readonly state: import("@angular/core").Signal<"
|
|
1317
|
+
protected readonly state: import("@angular/core").Signal<"complete" | "none" | "verifying" | "incomplete">;
|
|
1318
1318
|
/** What the persistent status region says: the current state, plus "Loading." while a request runs. Empty while nothing is shown. */
|
|
1319
1319
|
protected readonly liveText: import("@angular/core").Signal<string>;
|
|
1320
1320
|
/** The user pressed a button that started a request: when the screen then changes, focus moves to the new screen (the pressed button is gone). */
|
package/types/forgeroute-ui.d.ts
CHANGED
|
@@ -1792,6 +1792,18 @@ export declare const UI_DEFAULT_LABELS: {
|
|
|
1792
1792
|
readonly 'messagingSendMessagePanel.enterValue': "Enter {{ name }}...";
|
|
1793
1793
|
readonly 'messagingTemplatePicker.custom': "Custom";
|
|
1794
1794
|
readonly 'messagingTemplatePicker.system': "System";
|
|
1795
|
+
readonly 'notes.queued.waiting': "Waiting to send";
|
|
1796
|
+
readonly 'notes.queued.sending': "Sending…";
|
|
1797
|
+
readonly 'notes.queued.deleteWaiting': "Waiting to delete";
|
|
1798
|
+
readonly 'notes.queued.deleteSending': "Deleting…";
|
|
1799
|
+
readonly 'notes.queued.failed': "Not sent. This change needs your attention.";
|
|
1800
|
+
readonly 'notes.queued.conflict': "Not sent. Someone else changed this note.";
|
|
1801
|
+
readonly 'notes.queued.addedAnnounce': "Note saved on this device. Waiting to send.";
|
|
1802
|
+
readonly 'notes.queued.editedAnnounce': "Note change saved on this device. Waiting to send.";
|
|
1803
|
+
readonly 'notes.queued.deletedAnnounce': "Note deletion saved on this device. Waiting to send.";
|
|
1804
|
+
readonly 'notes.queued.problemAnnounce': "A note change could not be sent.";
|
|
1805
|
+
readonly 'notes.queued.offlineSome': "You're offline, so only the notes saved on this device are shown here.";
|
|
1806
|
+
readonly 'notes.queued.offlineNone': "You're offline, so the notes can't be loaded right now. A note you add is saved on this device and sent when you're back online.";
|
|
1795
1807
|
readonly 'notes.you': "You";
|
|
1796
1808
|
readonly 'passwordRequirements.met': "met";
|
|
1797
1809
|
readonly 'passwordRequirements.notMet': "not met";
|
|
@@ -2975,7 +2987,7 @@ export declare class SelectComponent implements ControlValueAccessor, Validator,
|
|
|
2975
2987
|
readonly error: import("@angular/core").InputSignal<string>;
|
|
2976
2988
|
/** Reveal the built-in error messages now (e.g. after a failed Save click), without waiting for blur. */
|
|
2977
2989
|
readonly showErrors: import("@angular/core").InputSignal<boolean>;
|
|
2978
|
-
readonly size: import("@angular/core").InputSignal<"
|
|
2990
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "default">;
|
|
2979
2991
|
readonly _disabledInput: import("@angular/core").InputSignal<boolean>;
|
|
2980
2992
|
private readonly _cvaDisabled;
|
|
2981
2993
|
protected readonly disabled: import("@angular/core").Signal<boolean>;
|
|
@@ -4336,7 +4348,7 @@ export declare class ModalComponent implements OnInit, OnDestroy {
|
|
|
4336
4348
|
*/
|
|
4337
4349
|
readonly describedBy: import("@angular/core").InputSignal<string | null>;
|
|
4338
4350
|
readonly maxWidth: import("@angular/core").InputSignal<string>;
|
|
4339
|
-
readonly bodyOverflow: import("@angular/core").InputSignal<"
|
|
4351
|
+
readonly bodyOverflow: import("@angular/core").InputSignal<"hidden" | "visible" | "auto">;
|
|
4340
4352
|
/** `data-testid` of the dialog element itself (the host `<ui-modal>` is always in the page, the dialog only while open). None when empty. */
|
|
4341
4353
|
readonly dialogTestId: import("@angular/core").InputSignal<string>;
|
|
4342
4354
|
/** Hides the header X button (e.g. while a request is running). Escape and a backdrop click still close unless `closable` is false. */
|
|
@@ -5001,7 +5013,7 @@ export declare class AudioPlayerComponent {
|
|
|
5001
5013
|
/** Accessible name of the player. */
|
|
5002
5014
|
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
5003
5015
|
/** How much to load before play: 'metadata' (default), 'auto' or 'none'. */
|
|
5004
|
-
readonly preload: import("@angular/core").InputSignal<"
|
|
5016
|
+
readonly preload: import("@angular/core").InputSignal<"none" | "metadata" | "auto">;
|
|
5005
5017
|
/** Fires when the browser can't load or decode the source. */
|
|
5006
5018
|
readonly playbackError: import("@angular/core").OutputEmitterRef<void>;
|
|
5007
5019
|
protected readonly failed: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -5089,7 +5101,7 @@ export declare class TooltipDirective {
|
|
|
5089
5101
|
/** Tooltip text; empty or null disables the tooltip. */
|
|
5090
5102
|
readonly uiTooltip: import("@angular/core").InputSignal<string | null | undefined>;
|
|
5091
5103
|
/** Preferred side; flips to the other side when there is no room. */
|
|
5092
|
-
readonly tooltipPosition: import("@angular/core").InputSignal<"
|
|
5104
|
+
readonly tooltipPosition: import("@angular/core").InputSignal<"bottom" | "top">;
|
|
5093
5105
|
private readonly host;
|
|
5094
5106
|
private readonly doc;
|
|
5095
5107
|
private bubble;
|
|
@@ -5422,7 +5434,7 @@ export declare class CheckboxComponent implements ControlValueAccessor, Validato
|
|
|
5422
5434
|
* clicking it still toggles the box - e.g. a product name that is both the heading of its card and the label of its checkbox.
|
|
5423
5435
|
* Default null: plain label text, exactly as before. Single mode only.
|
|
5424
5436
|
*/
|
|
5425
|
-
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 |
|
|
5437
|
+
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 5 | 3 | 4 | 6 | null>;
|
|
5426
5438
|
readonly indeterminate: import("@angular/core").InputSignal<boolean>;
|
|
5427
5439
|
readonly checked: import("@angular/core").ModelSignal<boolean>;
|
|
5428
5440
|
/**
|
|
@@ -5883,7 +5895,7 @@ export declare class StepperComponent {
|
|
|
5883
5895
|
protected readonly rows: import("@angular/core").Signal<{
|
|
5884
5896
|
step: StepperStep;
|
|
5885
5897
|
index: number;
|
|
5886
|
-
state: "
|
|
5898
|
+
state: "complete" | "current" | "upcoming";
|
|
5887
5899
|
error: boolean;
|
|
5888
5900
|
errorMessage: string;
|
|
5889
5901
|
selectable: boolean;
|
|
@@ -6513,7 +6525,7 @@ export declare class ButtonComponent {
|
|
|
6513
6525
|
* `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
|
|
6514
6526
|
* background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
|
|
6515
6527
|
*/
|
|
6516
|
-
readonly variant: import("@angular/core").InputSignal<"warning" | "link" | "primary" | "danger" | "
|
|
6528
|
+
readonly variant: import("@angular/core").InputSignal<"warning" | "link" | "primary" | "secondary" | "danger" | "icon" | "ghost" | "ghost-start" | "tab" | "icon-danger">;
|
|
6517
6529
|
/** Renders an anchor to this route instead of a button (use with `variant="link"` for an inline text link). `['/settings']` or `'/settings'`. While `disabled` or `loading` it renders a non-clickable `<span role="link" aria-disabled>` with no href (like `href`). */
|
|
6518
6530
|
readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
|
|
6519
6531
|
/** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
|
|
@@ -6558,8 +6570,8 @@ export declare class ButtonComponent {
|
|
|
6558
6570
|
private readonly _narrow;
|
|
6559
6571
|
readonly color: import("@angular/core").InputSignal<string | undefined>;
|
|
6560
6572
|
readonly active: import("@angular/core").InputSignal<boolean>;
|
|
6561
|
-
readonly size: import("@angular/core").InputSignal<"
|
|
6562
|
-
readonly type: import("@angular/core").InputSignal<"
|
|
6573
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | "xs">;
|
|
6574
|
+
readonly type: import("@angular/core").InputSignal<"reset" | "submit" | "button">;
|
|
6563
6575
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
6564
6576
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
6565
6577
|
readonly fullWidth: import("@angular/core").InputSignal<boolean>;
|
|
@@ -7699,7 +7711,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
|
|
|
7699
7711
|
* `search`, `text`, `none`). Empty (default) = the browser's default for the field, except `type="tel"`, which keeps `tel`.
|
|
7700
7712
|
* It only picks the keyboard; it does not restrict what can be typed or pasted.
|
|
7701
7713
|
*/
|
|
7702
|
-
readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "text" | "
|
|
7714
|
+
readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "text" | "none" | "search" | "tel" | "url" | "decimal" | "numeric">;
|
|
7703
7715
|
readonly readonly: import("@angular/core").InputSignal<boolean>;
|
|
7704
7716
|
readonly hint: import("@angular/core").InputSignal<string>;
|
|
7705
7717
|
/** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */
|
|
@@ -8722,7 +8734,7 @@ export declare class CopyFieldComponent implements OnDestroy {
|
|
|
8722
8734
|
/** Neither the Clipboard API nor the fallback could copy. */
|
|
8723
8735
|
readonly copyFailed: import("@angular/core").OutputEmitterRef<void>;
|
|
8724
8736
|
protected readonly _id: string;
|
|
8725
|
-
protected readonly _state: import("@angular/core").WritableSignal<"
|
|
8737
|
+
protected readonly _state: import("@angular/core").WritableSignal<"failed" | "idle" | "copied">;
|
|
8726
8738
|
protected readonly _announcement: import("@angular/core").Signal<string>;
|
|
8727
8739
|
protected readonly _buttonName: import("@angular/core").Signal<string>;
|
|
8728
8740
|
protected readonly _describedBy: import("@angular/core").Signal<string | null>;
|
|
@@ -9519,7 +9531,7 @@ export declare class DropdownComponent {
|
|
|
9519
9531
|
readonly loader: import("@angular/core").InputSignal<(() => Promise<DropdownItem[]>) | null>;
|
|
9520
9532
|
readonly active: import("@angular/core").InputSignal<boolean>;
|
|
9521
9533
|
readonly activeValue: import("@angular/core").InputSignal<string>;
|
|
9522
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
9534
|
+
readonly variant: import("@angular/core").InputSignal<"badge" | "button">;
|
|
9523
9535
|
/** Trigger size for `variant="button"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */
|
|
9524
9536
|
readonly size: import("@angular/core").InputSignal<"sm" | "md">;
|
|
9525
9537
|
readonly menuWidth: import("@angular/core").InputSignal<string>;
|
|
@@ -9932,7 +9944,7 @@ export type ListItemIconColor = 'slate' | 'amber' | 'red' | 'blue' | 'green' | '
|
|
|
9932
9944
|
export declare class ListItemComponent implements AfterContentChecked {
|
|
9933
9945
|
private readonly host;
|
|
9934
9946
|
/** Show a radio button, checkbox, or nothing on the left. */
|
|
9935
|
-
readonly leading: import("@angular/core").InputSignal<"none" | "
|
|
9947
|
+
readonly leading: import("@angular/core").InputSignal<"none" | "radio" | "checkbox">;
|
|
9936
9948
|
/** `name` attribute for the radio/checkbox (groups radios together). */
|
|
9937
9949
|
readonly inputName: import("@angular/core").InputSignal<string>;
|
|
9938
9950
|
/** `id` attribute for the radio/checkbox (links the label). */
|
|
@@ -10296,6 +10308,44 @@ export declare class CardListItemComponent {
|
|
|
10296
10308
|
"action": "action";
|
|
10297
10309
|
}, never, ["[card-list-inline]", "[card-list-action]", "*", "[card-stats]", "[card-detail]"], true, never>;
|
|
10298
10310
|
}
|
|
10311
|
+
/** Where a note change saved on the device is in the offline layer. */
|
|
10312
|
+
export type QueuedNoteState = 'waiting' | 'sending' | 'failed' | 'conflict';
|
|
10313
|
+
/** One note change that was saved while offline and has not been delivered yet. */
|
|
10314
|
+
export interface QueuedNote {
|
|
10315
|
+
/** The id of the saved change (the offline layer's row), unique per change. */
|
|
10316
|
+
rowId: string;
|
|
10317
|
+
/** `add` = a new note, `edit` = new text for the note `noteId`, `delete` = the note `noteId` is to be deleted. */
|
|
10318
|
+
kind: 'add' | 'edit' | 'delete';
|
|
10319
|
+
/** The note an `edit` / `delete` is about; empty for an `add`. */
|
|
10320
|
+
noteId: string;
|
|
10321
|
+
/** The text of an `add` / `edit` (already trimmed, as it will be sent); empty for a `delete`. */
|
|
10322
|
+
text: string;
|
|
10323
|
+
/** When the change was saved on the device (ms since the epoch). */
|
|
10324
|
+
createdAt: number;
|
|
10325
|
+
state: QueuedNoteState;
|
|
10326
|
+
}
|
|
10327
|
+
/**
|
|
10328
|
+
* The small contract between `ui-notes` and an offline layer (the `@forgeroute/ui/offline` entry point provides it). It is optional: when nothing
|
|
10329
|
+
* provides `UI_NOTES_QUEUE`, `ui-notes` behaves exactly as it always did. It holds no data of its own: `queuedFor` reads the offline layer's own
|
|
10330
|
+
* saved-change list (a signal), so calling it inside a `computed` / template stays reactive.
|
|
10331
|
+
*/
|
|
10332
|
+
export interface UiNotesQueue {
|
|
10333
|
+
/**
|
|
10334
|
+
* The saved changes that belong to one notes list, oldest first. `listPath` is the list URL (`<base>/notes/contact/5` or `<base><basePath>`;
|
|
10335
|
+
* an `add` is a POST to exactly this path) and `itemPrefix` the URL of a single note up to its id (`<base>/notes/` or `<base><basePath>/`; an
|
|
10336
|
+
* `edit` is a PUT and a `delete` a DELETE to `<itemPrefix><noteId>`). Origin and query are ignored when comparing.
|
|
10337
|
+
*/
|
|
10338
|
+
queuedFor(listPath: string, itemPrefix: string): readonly QueuedNote[];
|
|
10339
|
+
/** True while the browser is offline or the server cannot be reached: a failed load is then expected and shows no error toast. */
|
|
10340
|
+
readonly offline: () => boolean;
|
|
10341
|
+
/**
|
|
10342
|
+
* True when the saved change left the list because the USER discarded it. Any other departure (the change was delivered, or the session ended) makes
|
|
10343
|
+
* `ui-notes` reload the list and keep showing that change until the answer arrives, so a delivered note never flashes away or shows stale text.
|
|
10344
|
+
*/
|
|
10345
|
+
wasDiscarded(rowId: string): boolean;
|
|
10346
|
+
}
|
|
10347
|
+
/** Optional provider of queued notes. Provided automatically by `provideOfflineSupport` from `@forgeroute/ui/offline`; absent = `ui-notes` is unchanged. */
|
|
10348
|
+
export declare const UI_NOTES_QUEUE: InjectionToken<UiNotesQueue>;
|
|
10299
10349
|
/** A note as the notes API returns it. */
|
|
10300
10350
|
export interface NoteItem {
|
|
10301
10351
|
id: string;
|
|
@@ -10304,6 +10354,13 @@ export interface NoteItem {
|
|
|
10304
10354
|
createdAt: string;
|
|
10305
10355
|
updatedAt: string;
|
|
10306
10356
|
}
|
|
10357
|
+
/** A note as listed: a server note, or one saved on the device (`queued`) that the server does not have yet / has a pending change for. */
|
|
10358
|
+
interface NoteView extends NoteItem {
|
|
10359
|
+
queued?: {
|
|
10360
|
+
kind: QueuedNote['kind'];
|
|
10361
|
+
state: QueuedNote['state'];
|
|
10362
|
+
};
|
|
10363
|
+
}
|
|
10307
10364
|
/**
|
|
10308
10365
|
* Longest note body, in characters, counted AFTER trimming. Matches the backend `NoteController` cap (10000 after trim; the server trims first,
|
|
10309
10366
|
* so leading / trailing spaces never count). The add box and the edit box block Add Note / Save above it and show "Too long (max 10000 characters).".
|
|
@@ -10326,6 +10383,11 @@ export declare const NOTES_MAX_LENGTH = 10000;
|
|
|
10326
10383
|
* A note may hold at most `NOTES_MAX_LENGTH` (10000) characters after trimming; longer text (typed or pasted) shows the field's
|
|
10327
10384
|
* "Too long" message at once and Add Note / Save stay disabled, so no request is sent.
|
|
10328
10385
|
* Pagination is the library `ui-pagination` (shown only above one page). Cmd/Ctrl+Enter in the add box adds the note.
|
|
10386
|
+
*
|
|
10387
|
+
* Offline (optional): when an offline layer provides `UI_NOTES_QUEUE` (`provideOfflineSupport` from `@forgeroute/ui/offline` does), a note added, edited
|
|
10388
|
+
* or deleted while offline is shown at once with "Waiting to send" (text in the card, announced in a live region), replaced by the real note after the
|
|
10389
|
+
* layer delivered it, and marked "Not sent" when the change failed or conflicted (it disappears if the user discards it). A note that is waiting has no
|
|
10390
|
+
* edit / delete icons. Without a provider nothing of this exists. See `docs/notes-offline.md`.
|
|
10329
10391
|
*/
|
|
10330
10392
|
export declare class NotesComponent {
|
|
10331
10393
|
protected readonly labels: UiLabelsService;
|
|
@@ -10363,6 +10425,22 @@ export declare class NotesComponent {
|
|
|
10363
10425
|
readonly totalElements: import("@angular/core").WritableSignal<number>;
|
|
10364
10426
|
readonly editingId: import("@angular/core").WritableSignal<string | null>;
|
|
10365
10427
|
readonly deletingId: import("@angular/core").WritableSignal<string | null>;
|
|
10428
|
+
/** Optional offline layer (see `UI_NOTES_QUEUE`). Absent = every queue-related behaviour below is off. */
|
|
10429
|
+
protected readonly queue: import("@forgeroute/ui").UiNotesQueue | null;
|
|
10430
|
+
protected readonly announcement: import("@angular/core").WritableSignal<string>;
|
|
10431
|
+
/** Saved changes that just left the queue (delivered) and are still shown until the reload that fetches the real data has answered. Each knows its list. */
|
|
10432
|
+
private readonly settling;
|
|
10433
|
+
/** Overlay clean-ups waiting for the NEWEST load to answer (an older, superseded load never runs them). */
|
|
10434
|
+
private afters;
|
|
10435
|
+
/** Number of the newest load; an answer from an older load is ignored. */
|
|
10436
|
+
private loadSeq;
|
|
10437
|
+
/** True when the last load failed while the offline layer says we are offline (the list then shows only what is saved on this device). */
|
|
10438
|
+
readonly offlineLoadFailed: import("@angular/core").WritableSignal<boolean>;
|
|
10439
|
+
/**
|
|
10440
|
+
* What the list shows: with an offline layer, notes saved on this device are shown right away - new notes first on page 1 (newest first, like the
|
|
10441
|
+
* server's order), and a note with a saved edit / delete keeps its place, marked as waiting. Without one it is exactly `notes()`.
|
|
10442
|
+
*/
|
|
10443
|
+
readonly shown: import("@angular/core").Signal<NoteView[]>;
|
|
10366
10444
|
newBody: string;
|
|
10367
10445
|
editBody: string;
|
|
10368
10446
|
/** Up to two initials of the author's name for the avatar ("Ana Lopez" -> "AL"); "Y" for the current user's own unnamed notes. */
|
|
@@ -10373,13 +10451,29 @@ export declare class NotesComponent {
|
|
|
10373
10451
|
protected validBody(text: string): boolean;
|
|
10374
10452
|
private get listUrl();
|
|
10375
10453
|
private noteUrl;
|
|
10454
|
+
/** The URL of one note up to its id (`.../notes/` or `<basePath>/`). */
|
|
10455
|
+
private get itemPrefix();
|
|
10376
10456
|
private get ready();
|
|
10377
10457
|
/** Request body for create / update: `{ content }` for a `basePath` API, `{ body }` for the generic one. */
|
|
10378
10458
|
private payload;
|
|
10379
10459
|
/** Accepts `body` or `content` as the text and a missing `updatedAt`. */
|
|
10380
10460
|
private normalize;
|
|
10381
10461
|
constructor();
|
|
10382
|
-
|
|
10462
|
+
/** The label under a queued note: what is waiting and why it may be stuck (text, not colour alone). */
|
|
10463
|
+
protected queuedText(q: {
|
|
10464
|
+
kind: QueuedNote['kind'];
|
|
10465
|
+
state: QueuedNote['state'];
|
|
10466
|
+
}): string;
|
|
10467
|
+
/** Says it in the live region; clears first so the same words twice in a row are read twice. */
|
|
10468
|
+
private announce;
|
|
10469
|
+
/** True when the answer is the offline layer's "saved on this device" reply (and an offline layer is present). */
|
|
10470
|
+
private savedOffline;
|
|
10471
|
+
/**
|
|
10472
|
+
* Loads one page. Only the NEWEST load's answer is applied (an older answer arriving late is ignored, so stale data never overwrites newer data and
|
|
10473
|
+
* `loading` stays true until the latest answer). `after` (overlay clean-up of delivered changes) runs when the newest load has answered - also when
|
|
10474
|
+
* a later load superseded the one it was given to, so the overlay drops in the same render the replacing data arrives.
|
|
10475
|
+
*/
|
|
10476
|
+
loadPage(p: number, after?: () => void): void;
|
|
10383
10477
|
addNote(): void;
|
|
10384
10478
|
startEdit(note: NoteItem): void;
|
|
10385
10479
|
cancelEdit(): void;
|
|
@@ -11507,7 +11601,7 @@ export declare class IconComponent {
|
|
|
11507
11601
|
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
11508
11602
|
/** Icon size in px. */
|
|
11509
11603
|
readonly size: import("@angular/core").InputSignal<number>;
|
|
11510
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
11604
|
+
readonly variant: import("@angular/core").InputSignal<"danger" | "default">;
|
|
11511
11605
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
11512
11606
|
/** The host is running the request this icon started: a spinner replaces the picture and the button is disabled (no click) until it is false again. */
|
|
11513
11607
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
@@ -13950,7 +14044,7 @@ export declare class DetailCardComponent {
|
|
|
13950
14044
|
/** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */
|
|
13951
14045
|
readonly uppercaseTitle: import("@angular/core").InputSignal<boolean>;
|
|
13952
14046
|
/** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */
|
|
13953
|
-
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 |
|
|
14047
|
+
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 5 | 3 | 4 | 6 | null>;
|
|
13954
14048
|
/** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */
|
|
13955
14049
|
readonly titleId: import("@angular/core").InputSignal<string>;
|
|
13956
14050
|
/** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */
|
|
@@ -13964,7 +14058,7 @@ export declare class DetailCardComponent {
|
|
|
13964
14058
|
/** Background colour of the footer bar (the `[card-footer]` slot) as any CSS colour. Empty = no colour of its own. */
|
|
13965
14059
|
readonly footerBackground: import("@angular/core").InputSignal<string>;
|
|
13966
14060
|
/** Alignment of the `[card-footer]` content: `'start'` (default, unchanged) or `'end'` = a right-aligned action row with an 8px gap. */
|
|
13967
|
-
readonly footerAlign: import("@angular/core").InputSignal<"
|
|
14061
|
+
readonly footerAlign: import("@angular/core").InputSignal<"end" | "start">;
|
|
13968
14062
|
/** Text colour as any CSS colour (`#fff`, `var(--on-dark)` …). Empty = the default colours. Colours the title, subtitle, chevron and body text. */
|
|
13969
14063
|
readonly textColor: import("@angular/core").InputSignal<string>;
|
|
13970
14064
|
/** false = no header at all (no title, edit button, toggle or divider): the card is only the body, always open. */
|
|
@@ -16177,6 +16271,28 @@ export declare function downloadBlob(blob: Blob, fileName: string): void;
|
|
|
16177
16271
|
* downloads folder.
|
|
16178
16272
|
*/
|
|
16179
16273
|
export declare function fileNameFromContentDisposition(header: string | null | undefined): string;
|
|
16274
|
+
/** One cell of a CSV row: text, a number, or nothing (`null` / `undefined` become an empty cell). */
|
|
16275
|
+
export type CsvCell = string | number | null | undefined;
|
|
16276
|
+
/**
|
|
16277
|
+
* CSV / formula-injection guard. Excel, Sheets and Numbers run a cell that starts with = + - @ (or a tab / carriage return) as a
|
|
16278
|
+
* formula - also after leading spaces, which some spreadsheets skip - and exports carry free text (names, notes, subjects). Such a TEXT cell gets a leading apostrophe so it opens as plain text.
|
|
16279
|
+
* Numbers, and strings that are only a signed number with an optional currency symbol or percent sign (-12.50, -$12.50, +15125550177, -3%),
|
|
16280
|
+
* cannot form a formula and are left exactly as they are, so negative amounts and phone numbers keep their value.
|
|
16281
|
+
*/
|
|
16282
|
+
export declare function csvSafeText(cell: CsvCell): string;
|
|
16283
|
+
/** One CSV cell as it is written to the file: formula-guarded, and wrapped in double quotes (inner quotes doubled) when it holds a comma, quote or line break. */
|
|
16284
|
+
export declare function csvCell(cell: CsvCell): string;
|
|
16285
|
+
/** The text of a CSV file (RFC 4180): the header row, then one line per row, comma separated, `\n` line ends, no trailing line break. */
|
|
16286
|
+
export declare function toCsv(headers: readonly CsvCell[], rows: readonly (readonly CsvCell[])[]): string;
|
|
16287
|
+
export interface DownloadCsvOptions {
|
|
16288
|
+
/** Start the file with a UTF-8 byte order mark so Excel reads accents correctly (default `false`). */
|
|
16289
|
+
bom?: boolean;
|
|
16290
|
+
}
|
|
16291
|
+
/**
|
|
16292
|
+
* Builds a CSV file from `headers` and `rows` (see {@link toCsv}) and starts its download as `fileName`
|
|
16293
|
+
* (`.csv` is added when the name has no extension of that kind). Uses {@link downloadBlob}, so it works in Firefox and Safari.
|
|
16294
|
+
*/
|
|
16295
|
+
export declare function downloadCsv(fileName: string, headers: readonly CsvCell[], rows: readonly (readonly CsvCell[])[], options?: DownloadCsvOptions): void;
|
|
16180
16296
|
/**
|
|
16181
16297
|
* Builds a universal maps URL that opens turn-by-turn navigation.
|
|
16182
16298
|
*
|