@alfadocs/ui-kit 1.9.3 → 1.10.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.9.3",
3
+ "packageVersion": "1.10.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -24,6 +24,17 @@ export interface DataTableHandle<TData = unknown> {
24
24
  clearSelection: () => void;
25
25
  getFilter: () => Record<string, unknown>;
26
26
  setFilter: (model: Record<string, unknown>) => void;
27
+ /**
28
+ * Columns whose visibility the user set by hand (ColumnToggle, column menu,
29
+ * drag). Persisted with the column state under `gridId`; a responsive
30
+ * baseline must leave them alone.
31
+ */
32
+ getUserTouchedColumns: () => string[];
33
+ /**
34
+ * Record columns as user-set — for programmatic writes that stand in for the
35
+ * user (a saved view), so they persist and stop being auto-managed.
36
+ */
37
+ markColumnsUserTouched: (colIds: readonly string[]) => void;
27
38
  getSort: () => DataTableSortEntry[];
28
39
  setSort: (model: DataTableSortEntry[]) => void;
29
40
  getCurrentPage: () => number;
@@ -1,33 +1,33 @@
1
- import { A as r, D as l, E as t, T as s, a as d, b as n, c as o, d as i, e as R, f as C, g as T, i as F, h as g } from "../../_chunks/actions-cell-renderer-B2pw6iH8.js";
2
- import { B as b, C as u, E as x, a as c, R as p, T as E, b as m, r as f, u as h } from "../../_chunks/editable-currency-cell-renderer-DYdzKpjL.js";
3
- import { C as A, D as w, a as y, b as I, I as L, L as N, N as P, c as W, S as B, d as U, e as _, T as k, f as v, g as O, U as X } from "../../_chunks/link-cell-renderer-x8kS41M7.js";
1
+ import { A as r, D as l, E as t, T as s, a as d, b as n, c as o, d as i, e as R, f as C, g as T, i as F, h as g } from "../../_chunks/actions-cell-renderer-BbzCqcld.js";
2
+ import { B as b, C as c, a as u, E as x, b as p, R as E, T as m, c as f, r as h, u as S } from "../../_chunks/editable-currency-cell-renderer-zLf_bXvL.js";
3
+ import { D as w, a as y, b as I, I as L, L as N, N as P, c as W, S as B, d as U, e as _, T as k, f as v, g as O, U as X } from "../../_chunks/link-cell-renderer-Cp2MSlJl.js";
4
4
  export {
5
5
  r as ActionsCellRenderer,
6
6
  b as BalanceCellRenderer,
7
- u as ColorDotCellRenderer,
8
- A as CurrencyCellRenderer,
7
+ c as ColorDotCellRenderer,
8
+ u as CurrencyCellRenderer,
9
9
  l as DataTable,
10
10
  w as DateCellRenderer,
11
11
  y as DateRangeFilter,
12
12
  I as DateRangeFloatingFilter,
13
13
  t as EXPANDED_ROW_CLASS,
14
14
  x as EditableCurrencyCellRenderer,
15
- c as EditableTextCellRenderer,
15
+ p as EditableTextCellRenderer,
16
16
  L as ImageCellRenderer,
17
17
  N as LinkCellRenderer,
18
18
  P as NumberFilter,
19
19
  W as NumberFloatingFilter,
20
- p as ReorderCellRenderer,
20
+ E as ReorderCellRenderer,
21
21
  B as SelectFilter,
22
22
  U as SelectFloatingFilter,
23
23
  _ as StatusCellRenderer,
24
24
  k as TagListCellRenderer,
25
25
  s as TextFilter,
26
26
  d as TextFloatingFilter,
27
- E as ToggleCellRenderer,
27
+ m as ToggleCellRenderer,
28
28
  n as Toolbar,
29
29
  o as ToolbarProvider,
30
- m as ToothCellRenderer,
30
+ f as ToothCellRenderer,
31
31
  v as TypeaheadFilter,
32
32
  O as TypeaheadFloatingFilter,
33
33
  X as UserCellRenderer,
@@ -37,7 +37,7 @@ export {
37
37
  T as expandedRowDetailId,
38
38
  F as isExpandedRowDetail,
39
39
  g as isExpandedRowDetailId,
40
- f as reorderColumnWidth,
41
- h as useTotalRow
40
+ h as reorderColumnWidth,
41
+ S as useTotalRow
42
42
  };
43
43
  //# sourceMappingURL=index.js.map
@@ -6,9 +6,10 @@ export interface ToolbarProviderProps {
6
6
  getApi: () => GridApi | undefined;
7
7
  selectionCount: number;
8
8
  onPrint: () => void;
9
+ markColumnsUserTouched?: (colIds: readonly string[]) => void;
9
10
  children: ReactNode;
10
11
  }
11
- export declare function ToolbarProvider({ getApi, selectionCount, onPrint, children, }: ToolbarProviderProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ToolbarProvider({ getApi, selectionCount, onPrint, markColumnsUserTouched, children, }: ToolbarProviderProps): import("react/jsx-runtime").JSX.Element;
12
13
  export type ToolbarRootProps = HTMLAttributes<HTMLDivElement>;
13
14
  type ToolbarIconButtonProps = Omit<IconButtonProps, 'icon' | 'aria-label' | 'tooltip' | 'onClick'> & {
14
15
  /** Accessible label — becomes the tooltip text and `aria-label`. */
@@ -62,6 +62,8 @@ export interface DataTableTabsProps extends VariantProps<typeof dataTableTabsTri
62
62
  * id is deliberately not persisted.
63
63
  */
64
64
  persistKey?: string;
65
+ /** Persist the active tab id too (needs `persistKey`). Default `false`. */
66
+ persistActiveTab?: boolean;
65
67
  /** Capture/restore the quick-filter text alongside the model. Default false. */
66
68
  captureQuickFilter?: boolean;
67
69
  /** Apply the active tab's model on mount + switch. Default true. */
@@ -1,4 +1,4 @@
1
- import { D as b, d as t, a as T, b as e } from "../../_chunks/data-table-tabs-C1kRUzat.js";
1
+ import { D as b, d as t, a as T, b as e } from "../../_chunks/data-table-tabs-D24qj89A.js";
2
2
  export {
3
3
  b as DataTableTabs,
4
4
  t as dataTableTabsAgent,
@@ -35,6 +35,13 @@ export interface UseDataTableFilterTabsOptions {
35
35
  onActiveTabChange?: (id: string) => void;
36
36
  /** Opt-in localStorage persistence — disabled while `tabs` is controlled. */
37
37
  persistKey?: string;
38
+ /**
39
+ * Also persist the active tab id (needs `persistKey`), so a return to the
40
+ * page lands on the tab — and the filter — the user left. Off by default:
41
+ * the kit's baseline lands on the first tab so a stale aggressive filter is
42
+ * never re-applied silently.
43
+ */
44
+ persistActiveTab?: boolean;
38
45
  /** Capture/restore `quickFilterText` alongside the model. Default false. */
39
46
  captureQuickFilter?: boolean;
40
47
  /** Apply the active tab's model on mount + tab switch. Default true. */
@@ -1,4 +1,4 @@
1
- import { F as r, f } from "../../_chunks/file-manager-Crg5dKez.js";
1
+ import { F as r, f } from "../../_chunks/file-manager-CRxq0UIl.js";
2
2
  export {
3
3
  r as FileManager,
4
4
  f as fileManagerAgent
@@ -0,0 +1,17 @@
1
+ import type { CustomCellRendererProps } from 'ag-grid-react';
2
+ import type { TransactionState } from '../../transaction-chip/transaction-chip';
3
+ import type { PatientRow } from '../types';
4
+ export interface TransactionChipCellParams {
5
+ /** State shown for a positive amount; zero always reads as `settled`. */
6
+ positiveState: Extract<TransactionState, 'debt' | 'credit' | 'to-invoice'>;
7
+ /** Show the state label beside the amount. Default `true` — a table cell has no other caption. */
8
+ showLabel?: boolean;
9
+ }
10
+ /**
11
+ * Money column → `TransactionChip`, the kit's one financial-state pill (PRS
12
+ * §27: "Financial transaction state pill (debt / credit / settled)"). Takes the
13
+ * cell VALUE in integer cents — the `PatientRow` contract — and hands the chip
14
+ * major units, so the row model and the chip each keep their own convention.
15
+ */
16
+ export declare function TransactionChipCell(props: CustomCellRendererProps<PatientRow, number | null | undefined> & TransactionChipCellParams): import("react/jsx-runtime").JSX.Element | null;
17
+ //# sourceMappingURL=transaction-chip-cell.d.ts.map
@@ -15,6 +15,8 @@ export { NextAppointmentCell } from './cell-renderers/next-appointment-cell';
15
15
  export type { NextAppointmentCellParams } from './cell-renderers/next-appointment-cell';
16
16
  export { BalanceBadgeCell } from './cell-renderers/balance-badge-cell';
17
17
  export type { BalanceBadgeCellParams } from './cell-renderers/balance-badge-cell';
18
+ export { TransactionChipCell } from './cell-renderers/transaction-chip-cell';
19
+ export type { TransactionChipCellParams } from './cell-renderers/transaction-chip-cell';
18
20
  export { CarePlanStatusCell } from './cell-renderers/care-plan-status-cell';
19
21
  export type { CarePlanStatusCellParams } from './cell-renderers/care-plan-status-cell';
20
22
  //# sourceMappingURL=index.d.ts.map
@@ -1,12 +1,13 @@
1
- import { B as s, C as l, N as t, P as n, a as C, b as i, g as o, u } from "../../_chunks/patient-table-S77TBCEB.js";
1
+ import { B as s, C as l, N as n, P as t, a as C, T as i, b as o, g as T, u as p } from "../../_chunks/balance-badge-cell-DK9wxCxW.js";
2
2
  export {
3
3
  s as BalanceBadgeCell,
4
4
  l as CarePlanStatusCell,
5
- t as NextAppointmentCell,
6
- n as PATIENT_ROW_ACTION_COUNT,
5
+ n as NextAppointmentCell,
6
+ t as PATIENT_ROW_ACTION_COUNT,
7
7
  C as PatientTable,
8
- i as buildPatientColumns,
9
- o as getResponsiveTier,
10
- u as useResponsiveColumns
8
+ i as TransactionChipCell,
9
+ o as buildPatientColumns,
10
+ T as getResponsiveTier,
11
+ p as useResponsiveColumns
11
12
  };
12
13
  //# sourceMappingURL=index.js.map
@@ -36,10 +36,13 @@
36
36
  * pollute the set (and we additionally guard with a re-entrancy flag).
37
37
  * 3. Once a column is user-touched, the hook leaves it alone forever this
38
38
  * session — its visibility is whatever the user chose, which is what
39
- * `data-table.tsx` then persists on unmount. The persisted choice therefore
40
- * wins on the next mount too: we seed the user-touched set from the saved
41
- * column state so a previously hidden/shown column is treated as a manual
42
- * override and not clobbered by the baseline on re-entry.
39
+ * `data-table.tsx` then persists. The persisted choice therefore wins on
40
+ * the next mount too: the DataTable persists the user-touched set with
41
+ * its column state (`getUserTouchedColumns` / `markColumnsUserTouched` on
42
+ * the handle), and every reconcile pass reads it live.
43
+ * 4. A programmatic visibility write by someone else (the DataTable restoring
44
+ * persisted state, a columnDefs update) schedules one reconcile pass, so
45
+ * the baseline is re-asserted for untouched columns without a resize.
43
46
  *
44
47
  * CONSTRAINTS: no `any` (AG Grid's `ColumnEventType` is read off the typed event,
45
48
  * tier read via the typed `getResponsiveTier` helper). No DOM `data-*` attribute