@forgeroute/ui 0.5.18 → 0.5.20
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-boards.mjs +2 -2
- package/fesm2022/forgeroute-ui-boards.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-chip.mjs +25 -6
- package/fesm2022/forgeroute-ui-chip.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-core-ui-labels.es-Woi3az70.mjs → forgeroute-ui-core-ui-labels.es-ChTmqFlw.mjs} +37 -10
- package/fesm2022/forgeroute-ui-core-ui-labels.es-ChTmqFlw.mjs.map +1 -0
- package/fesm2022/forgeroute-ui-core.mjs +94 -19
- package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-data-table-core.mjs +217 -26
- package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-messaging.mjs +19 -2
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-more-menu.mjs +61 -8
- package/fesm2022/forgeroute-ui-more-menu.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-multi-select.mjs +2 -1
- package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-payments.mjs +870 -57
- package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +815 -49
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
- package/package.json +2 -6
- package/types/forgeroute-ui-chip.d.ts +11 -1
- package/types/forgeroute-ui-core.d.ts +65 -12
- package/types/forgeroute-ui-data-table-core.d.ts +60 -1
- package/types/forgeroute-ui-messaging.d.ts +15 -5
- package/types/forgeroute-ui-more-menu.d.ts +7 -0
- package/types/forgeroute-ui-payments.d.ts +332 -8
- package/types/forgeroute-ui-quickbooks.d.ts +2 -2
- package/types/forgeroute-ui-square.d.ts +1 -1
- package/types/forgeroute-ui-stripe.d.ts +293 -20
- package/types/forgeroute-ui-table-types.d.ts +29 -0
- package/fesm2022/forgeroute-ui-core-ui-labels.es-Woi3az70.mjs.map +0 -1
|
@@ -108,6 +108,12 @@ export interface RowAction {
|
|
|
108
108
|
variant?: 'default' | 'danger';
|
|
109
109
|
hidden?: (item: any) => boolean;
|
|
110
110
|
disabled?: (item: any) => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Why a disabled action is disabled (library source 2026-11-21, additive). Shown in the row menu as visible text under the action's label, linked to it with `aria-describedby` and also set as its `title`.
|
|
113
|
+
* A function receives the row (inside `<ui-data-table>`; a standalone `ui-more-menu` calls it with `null`); `null` / `undefined` / empty = no reason. Only used while the action is disabled. An action with a
|
|
114
|
+
* reason stays focusable (`aria-disabled`, so a screen-reader user can reach it and hear the reason) but never runs, and is never clickable.
|
|
115
|
+
*/
|
|
116
|
+
disabledReason?: string | ((item: any) => string | null | undefined);
|
|
111
117
|
/** How the table handles this action when clicked.
|
|
112
118
|
* 'modal' — table shows a built-in confirm modal; onAction is called only if confirmed.
|
|
113
119
|
* 'panel' — table emits (panelActionClick); host component opens the right panel or form modal.
|
|
@@ -410,6 +416,18 @@ export type BulkUpdateOption<T = any> = string | {
|
|
|
410
416
|
* { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row) }
|
|
411
417
|
*/
|
|
412
418
|
canChange?: (row: T, target: string) => boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Field changes (`{ field, skipReason }`): WHY a row is skipped, in the host's words. Called for every selected row that will be skipped because it cannot move to `target`
|
|
421
|
+
* (`allowedFrom` / `canChange` refused it; a row that already holds the target is NOT asked: the standard "already has this value" wording covers it) with the row and the
|
|
422
|
+
* target value. Return a short plain sentence ("Needs a document and a recipient first.") or `null` / `''` for no reason. A function that throws counts as no reason.
|
|
423
|
+
* The reasons are grouped (the same text is one line with the number of rows: "Needs a document and a recipient first. (3)"), listed as bullets in the confirm (`confirm-details`,
|
|
424
|
+
* after the host's own `details`), and passed to a host `confirm` function as `ctx.skippedReasons` (one entry per row, so the copy can name them). It only sees rows on the loaded
|
|
425
|
+
* page. It changes no rule: it never makes a row skipped or eligible. Omit it and nothing changes.
|
|
426
|
+
*
|
|
427
|
+
* { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row),
|
|
428
|
+
* skipReason: (row, target) => (target === 'SENT' && row.status === 'DRAFT' && !canSend(row)) ? 'Needs a document and a recipient first.' : null }
|
|
429
|
+
*/
|
|
430
|
+
skipReason?: (row: T, target: string) => string | null | undefined;
|
|
413
431
|
/**
|
|
414
432
|
* Field changes (`{ field, canApply }`): a rule on the WHOLE selection, in addition to the per-row `allowedFrom` / `canChange`. Called with every
|
|
415
433
|
* selected row of the loaded page and the target value; return `true` to allow, `false` (generic reason) or a string (the reason shown to the
|
|
@@ -521,6 +539,15 @@ export interface BulkConfirmContext<T = any> {
|
|
|
521
539
|
rows: T[];
|
|
522
540
|
/** The selected rows that will be skipped. */
|
|
523
541
|
skippedRows: T[];
|
|
542
|
+
/**
|
|
543
|
+
* Field changes with a `skipReason` callback: one `{ row, reason }` per skipped row the callback gave a reason for (trimmed, single line, at most 300 characters; rows that already hold the
|
|
544
|
+
* target value are not asked). Empty when the entry has no `skipReason`; always `[]` for Delete and direct actions. The library already lists the grouped reasons in the confirm; use this to
|
|
545
|
+
* word the message yourself (`omitSkippedNote`).
|
|
546
|
+
*/
|
|
547
|
+
skippedReasons?: {
|
|
548
|
+
row: T;
|
|
549
|
+
reason: string;
|
|
550
|
+
}[];
|
|
524
551
|
}
|
|
525
552
|
/** Host copy for one bulk confirm. Plain text only (never HTML); `\n` in `message` shows as a line break. */
|
|
526
553
|
export interface BulkConfirmCopy {
|
|
@@ -556,6 +583,8 @@ export interface BulkActionDef {
|
|
|
556
583
|
deletable?: (row: any) => boolean;
|
|
557
584
|
/** Field changes: per-row check that the server will accept the move to a target (from `{ field, canChange }`). */
|
|
558
585
|
canChange?: (row: any, target: string) => boolean;
|
|
586
|
+
/** Field changes: why a skipped row is skipped (from `{ field, skipReason }`). */
|
|
587
|
+
skipReason?: (row: any, target: string) => string | null | undefined;
|
|
559
588
|
/** Field changes: rule on the whole selection (from `{ field, canApply }`): true = allowed, false / a string = refused (the string is the reason). */
|
|
560
589
|
canApply?: (rows: any[], target: string) => boolean | string;
|
|
561
590
|
/** Field changes: list the full value set (from `{ field, listAll }`): `true` or the exact list of values. */
|