@kouji-ui/core 0.10.0 → 0.11.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kouji-ui/core",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "Headless Angular UI primitives — signal-driven directives with WCAG 2.1 AAA semantics, no CDK, and a handful of opt-in global stylesheets.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -12141,6 +12141,25 @@ declare class KjTable<TData extends RowData = unknown> {
12141
12141
  * row index. Mirrors TanStack's `getRowId` option.
12142
12142
  */
12143
12143
  kjGetRowId: _angular_core.InputSignal<((row: TData, index: number) => string) | undefined>;
12144
+ /**
12145
+ * Tree rows: returns a row's children (TanStack `getSubRows`). Children are
12146
+ * real table rows with the same columns, shown under their parent while it
12147
+ * is expanded. `undefined` (default) keeps the table flat.
12148
+ */
12149
+ kjGetSubRows: _angular_core.InputSignal<((row: TData, index: number) => readonly TData[] | undefined) | undefined>;
12150
+ /**
12151
+ * Tree rows: whether selecting a parent also selects its children
12152
+ * (TanStack `enableSubRowSelection`). Defaults to `false` — every row is
12153
+ * selected on its own.
12154
+ */
12155
+ kjSelectSubRows: _angular_core.InputSignalWithTransform<boolean, unknown>;
12156
+ /**
12157
+ * Tree rows: whether parents start expanded. Applies to every parent with
12158
+ * no explicit expanded state — on first render, to rows loaded later, and
12159
+ * again after {@link resetExpansion} (an infinite table's request change).
12160
+ * Defaults to `false`.
12161
+ */
12162
+ kjDefaultExpanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
12144
12163
  private readonly _state;
12145
12164
  /**
12146
12165
  * The full table state as a single deep signal. Call `state()` for the
@@ -12186,6 +12205,20 @@ declare class KjTable<TData extends RowData = unknown> {
12186
12205
  * @param on `true` while the data is a sparse window of a server result set.
12187
12206
  */
12188
12207
  setInfinite(on: boolean): void;
12208
+ /**
12209
+ * Whether a tree parent with no explicit entry in `state.expanded` is open.
12210
+ * Starts at `kjDefaultExpanded`; {@link expandAll} / {@link collapseAll}
12211
+ * flip it so rows loaded later follow the last bulk action.
12212
+ */
12213
+ private readonly _expandDefault;
12214
+ /**
12215
+ * `state.expanded` as TanStack sees it. Open-by-default with no exceptions
12216
+ * is handed over as `true`: TanStack skips expansion altogether for an
12217
+ * empty record, and `getIsRowExpanded` still keeps leaf rows closed.
12218
+ */
12219
+ private readonly tanstackExpanded;
12220
+ /** Whether a row is expanded: its explicit state, else the tree default for parents. */
12221
+ private isRowExpanded;
12189
12222
  /** Rows handed to TanStack plus, in infinite mode, their positions in the full result set. */
12190
12223
  private readonly compacted;
12191
12224
  /**
@@ -12218,6 +12251,32 @@ declare class KjTable<TData extends RowData = unknown> {
12218
12251
  private readonly boundColumns;
12219
12252
  /** The TanStack table instance. Access rows, headers, and state here. */
12220
12253
  readonly table: () => Table<TData>;
12254
+ constructor();
12255
+ /**
12256
+ * Whether every loaded parent row is expanded (`false` when no row has
12257
+ * children). Rows of an infinite table that are not loaded yet do not count.
12258
+ */
12259
+ readonly isAllExpanded: _angular_core.Signal<boolean>;
12260
+ /**
12261
+ * Whether a row is expanded — its own choice, else `kjDefaultExpanded`
12262
+ * (or the last expand-all / collapse-all) for parents.
12263
+ * @param row The row.
12264
+ */
12265
+ getRowExpanded(row: Row<TData>): boolean;
12266
+ /**
12267
+ * Expand or collapse one row. Unlike TanStack's `row.toggleExpanded()`, the
12268
+ * choice is stored explicitly, so it holds against `kjDefaultExpanded`.
12269
+ * @param row The row.
12270
+ * @param expanded The new state; omitted, the current one flips.
12271
+ * @returns The row's new expanded state.
12272
+ */
12273
+ setRowExpanded(row: Row<TData>, expanded?: boolean): boolean;
12274
+ /** Expand every parent row, including the ones loaded later. */
12275
+ expandAll(): void;
12276
+ /** Collapse every parent row, including the ones loaded later. */
12277
+ collapseAll(): void;
12278
+ /** Forget per-row expansion and go back to `kjDefaultExpanded` — e.g. when the rows are replaced. */
12279
+ resetExpansion(): void;
12221
12280
  /** Merge a partial state. Unspecified slices are left untouched. */
12222
12281
  setState(partial: Partial<KjTableState>): void;
12223
12282
  /** Reset every slice back to the directive's default state. */
@@ -12238,7 +12297,7 @@ declare class KjTable<TData extends RowData = unknown> {
12238
12297
  */
12239
12298
  get columnApi(): KjColumnApi<TData>;
12240
12299
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<KjTable<any>, never>;
12241
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTable<any>, "[kjTable]", ["kjTable"], { "kjTable": { "alias": "kjTable"; "required": true; "isSignal": true; }; "kjTableData": { "alias": "kjTableData"; "required": false; "isSignal": true; }; "kjGetRowId": { "alias": "kjGetRowId"; "required": false; "isSignal": true; }; }, { "kjTableData": "kjTableDataChange"; }, never, never, true, never>;
12300
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTable<any>, "[kjTable]", ["kjTable"], { "kjTable": { "alias": "kjTable"; "required": true; "isSignal": true; }; "kjTableData": { "alias": "kjTableData"; "required": false; "isSignal": true; }; "kjGetRowId": { "alias": "kjGetRowId"; "required": false; "isSignal": true; }; "kjGetSubRows": { "alias": "kjGetSubRows"; "required": false; "isSignal": true; }; "kjSelectSubRows": { "alias": "kjSelectSubRows"; "required": false; "isSignal": true; }; "kjDefaultExpanded": { "alias": "kjDefaultExpanded"; "required": false; "isSignal": true; }; }, { "kjTableData": "kjTableDataChange"; }, never, never, true, never>;
12242
12301
  }
12243
12302
 
12244
12303
  /** Sort direction for table columns. */
@@ -12328,13 +12387,19 @@ declare class KjTableSort {
12328
12387
  declare class KjTableRow<TData extends RowData = unknown> {
12329
12388
  /** TanStack row instance — pass from getRowModel().rows. */
12330
12389
  kjRow: _angular_core.InputSignal<_tanstack_angular_table.Row<TData>>;
12390
+ /**
12391
+ * Overrides the 1-based `aria-rowindex` — for rows whose place in the grid
12392
+ * is not their `row.index`, like the children of a tree row. `null`
12393
+ * (default) derives it from the row.
12394
+ */
12395
+ kjAriaRowIndex: _angular_core.InputSignal<number | null>;
12331
12396
  private readonly table;
12332
12397
  /** 1-based ARIA index — accounts for header row(s). */
12333
12398
  readonly ariaRowIndex: _angular_core.Signal<number>;
12334
12399
  readonly isSelectable: _angular_core.Signal<boolean>;
12335
12400
  readonly isSelected: _angular_core.Signal<boolean>;
12336
12401
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<KjTableRow<any>, never>;
12337
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTableRow<any>, "[kjTableRow]", never, { "kjRow": { "alias": "kjRow"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
12402
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KjTableRow<any>, "[kjTableRow]", never, { "kjRow": { "alias": "kjRow"; "required": true; "isSignal": true; }; "kjAriaRowIndex": { "alias": "kjAriaRowIndex"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
12338
12403
  }
12339
12404
 
12340
12405
  /**