@egose/shadcn-theme-ng-tw 0.6.0 → 0.6.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.
Files changed (50) hide show
  1. package/README.md +119 -1
  2. package/autocomplete/fesm2022/autocomplete.mjs +14 -4
  3. package/autocomplete/types/autocomplete.d.ts +4 -1
  4. package/checkbox/README.md +6 -2
  5. package/checkbox/fesm2022/checkbox.mjs +15 -9
  6. package/checkbox/types/checkbox.d.ts +6 -4
  7. package/combobox/fesm2022/combobox.mjs +22 -6
  8. package/combobox/types/combobox.d.ts +8 -2
  9. package/data-table/README.md +10 -0
  10. package/data-table/fesm2022/data-table.mjs +48 -12
  11. package/data-table/types/data-table.d.ts +16 -4
  12. package/date-picker/README.md +41 -9
  13. package/date-picker/fesm2022/date-picker.mjs +265 -59
  14. package/date-picker/types/date-picker.d.ts +58 -27
  15. package/form-autocomplete/README.md +4 -2
  16. package/form-autocomplete/fesm2022/form-autocomplete.mjs +33 -8
  17. package/form-autocomplete/types/form-autocomplete.d.ts +9 -3
  18. package/form-combobox/README.md +4 -2
  19. package/form-combobox/fesm2022/form-combobox.mjs +65 -14
  20. package/form-combobox/types/form-combobox.d.ts +10 -3
  21. package/form-input-otp/README.md +7 -5
  22. package/form-input-otp/fesm2022/form-input-otp.mjs +28 -14
  23. package/form-input-otp/types/form-input-otp.d.ts +9 -3
  24. package/form-searchable-multiselect/README.md +15 -1
  25. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +23 -3
  26. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +9 -1
  27. package/form-slider/README.md +3 -1
  28. package/form-slider/fesm2022/form-slider.mjs +21 -6
  29. package/form-slider/types/form-slider.d.ts +9 -3
  30. package/form-toggle/README.md +22 -18
  31. package/form-toggle/fesm2022/form-toggle.mjs +25 -8
  32. package/form-toggle/types/form-toggle.d.ts +6 -2
  33. package/input-otp/README.md +33 -9
  34. package/input-otp/fesm2022/input-otp.mjs +127 -11
  35. package/input-otp/types/input-otp.d.ts +24 -4
  36. package/package.json +1 -1
  37. package/pagination/README.md +21 -12
  38. package/pagination/fesm2022/pagination.mjs +83 -75
  39. package/pagination/types/pagination.d.ts +21 -8
  40. package/phone-input/README.md +16 -0
  41. package/phone-input/fesm2022/phone-input.mjs +41 -3
  42. package/phone-input/types/phone-input.d.ts +5 -2
  43. package/searchable-multiselect/README.md +62 -40
  44. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +97 -36
  45. package/searchable-multiselect/types/searchable-multiselect.d.ts +23 -6
  46. package/slider/fesm2022/slider.mjs +15 -5
  47. package/slider/types/slider.d.ts +6 -2
  48. package/stepper/README.md +39 -19
  49. package/stepper/fesm2022/stepper.mjs +71 -17
  50. package/stepper/types/stepper.d.ts +12 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, computed, ChangeDetectionStrategy, Component, model, output, signal, linkedSignal, effect, NgModule } from '@angular/core';
2
+ import { input, computed, ChangeDetectionStrategy, Component, model, output, signal, linkedSignal, effect, untracked, NgModule } from '@angular/core';
3
3
  import { NgTemplateOutlet } from '@angular/common';
4
4
  import { HlmButton } from '@egose/shadcn-theme-ng-tw/button';
5
5
  import { HlmCard, HlmCardContent } from '@egose/shadcn-theme-ng-tw/card';
@@ -518,6 +518,16 @@ class EgDataTable {
518
518
  /** Client rows, or a server page slice when `manualPagination` is set (`null` while loading). */
519
519
  data = input([], /* @ts-ignore */
520
520
  ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
521
+ /**
522
+ * Pure stable identity callback, e.g. `(record) => record.id`. Return a unique
523
+ * string per entity, independent of position, and keep the callback reference stable.
524
+ * Selection survives refreshes only for IDs still in the supplied rows (after
525
+ * `filterRows`); server selection is limited to the loaded slice. Without this
526
+ * callback, IDs are positional and replacing the rows clears selection.
527
+ * Changing the callback clears selection. Update data immutably.
528
+ */
529
+ getRowId = input(/* @ts-ignore */
530
+ ...(ngDevMode ? [undefined, { debugName: "getRowId" }] : /* istanbul ignore next */ []));
521
531
  /** When true, `data` is a server page slice and the table uses TanStack `manualPagination`. Sorting and filtering are then display-only: the slice is shown as-is while `sortingChange` / `filterChange` (`columnFiltersChange`) notify the caller to refetch. */
522
532
  manualPagination = input(false, /* @ts-ignore */
523
533
  ...(ngDevMode ? [{ debugName: "manualPagination" }] : /* istanbul ignore next */ []));
@@ -571,7 +581,7 @@ class EgDataTable {
571
581
  /** Seeds the column-visibility state once at creation. Later changes are ignored. */
572
582
  initialColumnVisibility = input({}, /* @ts-ignore */
573
583
  ...(ngDevMode ? [{ debugName: "initialColumnVisibility" }] : /* istanbul ignore next */ []));
574
- /** Seeds the row-selection state once at creation (keys are row ids). Later changes are ignored. */
584
+ /** Seeds selection once for current rows: keys come from `getRowId`, or positional indices without it. Missing IDs are discarded. Later changes are ignored. */
575
585
  initialRowSelection = input({}, /* @ts-ignore */
576
586
  ...(ngDevMode ? [{ debugName: "initialRowSelection" }] : /* istanbul ignore next */ []));
577
587
  /** Show the rows-per-page selector in the footer pager. */
@@ -584,7 +594,7 @@ class EgDataTable {
584
594
  navMode = input('icons', /* @ts-ignore */
585
595
  ...(ngDevMode ? [{ debugName: "navMode" }] : /* istanbul ignore next */ []));
586
596
  userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
587
- /** Emits the selected rows whenever selection changes (requires `enableSelection`). */
597
+ /** Emits on init and when selected row identities/order or object references change. Includes rows hidden by built-in filters/client pagination, but never rows absent from `data`/`filterRows`. */
588
598
  selectionChange = output();
589
599
  /** Emits the target page index on pager navigation (primary hook for server fetching). */
590
600
  pageChange = output();
@@ -607,8 +617,6 @@ class EgDataTable {
607
617
  ...(ngDevMode ? [{ debugName: "_columnFilters" }] : /* istanbul ignore next */ []));
608
618
  _columnVisibility = signal({}, /* @ts-ignore */
609
619
  ...(ngDevMode ? [{ debugName: "_columnVisibility" }] : /* istanbul ignore next */ []));
610
- _rowSelection = signal({}, /* @ts-ignore */
611
- ...(ngDevMode ? [{ debugName: "_rowSelection" }] : /* istanbul ignore next */ []));
612
620
  _clientPageIndex = signal(0, /* @ts-ignore */
613
621
  ...(ngDevMode ? [{ debugName: "_clientPageIndex" }] : /* istanbul ignore next */ []));
614
622
  // Linked so the bound `defaultPageSize` applies once inputs are set, while
@@ -640,6 +648,32 @@ class EgDataTable {
640
648
  return filter ? filter(rows) : rows;
641
649
  }, /* @ts-ignore */
642
650
  ...(ngDevMode ? [{ debugName: "_items" }] : /* istanbul ignore next */ []));
651
+ // TanStack uses data-reference changes to reset pagination. State/layout
652
+ // updates must not look like a new data set (including selecting page rows).
653
+ _tableItems = computed(() => {
654
+ // A different identity function must also rebuild TanStack's cached rows.
655
+ this.getRowId();
656
+ return [...this._items()];
657
+ }, /* @ts-ignore */
658
+ ...(ngDevMode ? [{ debugName: "_tableItems" }] : /* istanbul ignore next */ []));
659
+ // Reconcile synchronously with the data source, before either TanStack or the
660
+ // output can observe old positional keys against new records. An effect-based
661
+ // reset would permit a transient wrong-entity selection.
662
+ _rowSelection = linkedSignal({ ...(ngDevMode ? { debugName: "_rowSelection" } : /* istanbul ignore next */ {}), source: () => ({ items: this._items(), getRowId: this.getRowId() }),
663
+ computation: (source, previous) => {
664
+ if (!previous || source.getRowId !== previous.source.getRowId)
665
+ return {};
666
+ if (!source.getRowId && source.items !== previous.source.items)
667
+ return {};
668
+ return this._keepCurrentSelection(previous.value);
669
+ } });
670
+ _keepCurrentSelection(selection) {
671
+ const getRowId = this.getRowId();
672
+ return Object.fromEntries(this._items()
673
+ .map((row, index) => (getRowId ? getRowId(row) : String(index)))
674
+ .filter((id) => Object.hasOwn(selection, id) && selection[id])
675
+ .map((id) => [id, true]));
676
+ }
643
677
  _serverPageCount = computed(() => {
644
678
  const paginated = this._page();
645
679
  if (!paginated || paginated.limit <= 0)
@@ -686,7 +720,8 @@ class EgDataTable {
686
720
  return {
687
721
  features: this.features(),
688
722
  columns: this._finalColumns(),
689
- data: [...this._items()],
723
+ data: this._tableItems(),
724
+ getRowId: this.getRowId(),
690
725
  manualPagination: server,
691
726
  manualSorting: server,
692
727
  manualFiltering: server,
@@ -736,10 +771,11 @@ class EgDataTable {
736
771
  },
737
772
  };
738
773
  });
774
+ _selectedRows = computed(() => this._table.getSelectedRowModel().rows.map((row) => row.original), { ...(ngDevMode ? { debugName: "_selectedRows" } : /* istanbul ignore next */ {}), equal: (a, b) => a.length === b.length && a.every((row, index) => row === b[index]) });
739
775
  _emitSelection = effect(() => {
740
- this._rowSelection();
741
- const selected = this._table.getSelectedRowModel().rows.map((row) => row.original);
742
- this.selectionChange.emit(selected);
776
+ const selected = this._selectedRows();
777
+ // Consumer handlers may read signals; those reads must not retrigger us.
778
+ untracked(() => this.selectionChange.emit(selected));
743
779
  }, /* @ts-ignore */
744
780
  ...(ngDevMode ? [{ debugName: "_emitSelection" }] : /* istanbul ignore next */ []));
745
781
  /**
@@ -752,7 +788,7 @@ class EgDataTable {
752
788
  this._sorting.set([...this.initialSorting()]);
753
789
  this._columnFilters.set([...this.initialColumnFilters()]);
754
790
  this._columnVisibility.set({ ...this.initialColumnVisibility() });
755
- this._rowSelection.set({ ...this.initialRowSelection() });
791
+ this._rowSelection.set(this._keepCurrentSelection(this.initialRowSelection()));
756
792
  }
757
793
  _hasGrid = computed(() => this.gridColumns() !== undefined, /* @ts-ignore */
758
794
  ...(ngDevMode ? [{ debugName: "_hasGrid" }] : /* istanbul ignore next */ []));
@@ -832,7 +868,7 @@ class EgDataTable {
832
868
  return cell.column.id.replace(/_/g, ' ');
833
869
  }
834
870
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgDataTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
835
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgDataTable, isStandalone: true, selector: "eg-data-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, gridColumns: { classPropertyName: "gridColumns", publicName: "gridColumns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, manualPagination: { classPropertyName: "manualPagination", publicName: "manualPagination", isSignal: true, isRequired: false, transformFunction: null }, features: { classPropertyName: "features", publicName: "features", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, enableSelection: { classPropertyName: "enableSelection", publicName: "enableSelection", isSignal: true, isRequired: false, transformFunction: null }, hideFooter: { classPropertyName: "hideFooter", publicName: "hideFooter", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, showLayoutToggle: { classPropertyName: "showLayoutToggle", publicName: "showLayoutToggle", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, filterColumnId: { classPropertyName: "filterColumnId", publicName: "filterColumnId", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showColumnToggle: { classPropertyName: "showColumnToggle", publicName: "showColumnToggle", isSignal: true, isRequired: false, transformFunction: null }, toolbarActions: { classPropertyName: "toolbarActions", publicName: "toolbarActions", isSignal: true, isRequired: false, transformFunction: null }, defaultPageSize: { classPropertyName: "defaultPageSize", publicName: "defaultPageSize", isSignal: true, isRequired: false, transformFunction: null }, filterRows: { classPropertyName: "filterRows", publicName: "filterRows", isSignal: true, isRequired: false, transformFunction: null }, initialSorting: { classPropertyName: "initialSorting", publicName: "initialSorting", isSignal: true, isRequired: false, transformFunction: null }, initialColumnFilters: { classPropertyName: "initialColumnFilters", publicName: "initialColumnFilters", isSignal: true, isRequired: false, transformFunction: null }, initialColumnVisibility: { classPropertyName: "initialColumnVisibility", publicName: "initialColumnVisibility", isSignal: true, isRequired: false, transformFunction: null }, initialRowSelection: { classPropertyName: "initialRowSelection", publicName: "initialRowSelection", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null }, navMode: { classPropertyName: "navMode", publicName: "navMode", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layout: "layoutChange", selectionChange: "selectionChange", pageChange: "pageChange", pageSizeChange: "pageSizeChange", rowClick: "rowClick", sortingChange: "sortingChange", columnFiltersChange: "columnFiltersChange", filterChange: "filterChange", columnVisibilityChange: "columnVisibilityChange" }, providers: [
871
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgDataTable, isStandalone: true, selector: "eg-data-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, gridColumns: { classPropertyName: "gridColumns", publicName: "gridColumns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, getRowId: { classPropertyName: "getRowId", publicName: "getRowId", isSignal: true, isRequired: false, transformFunction: null }, manualPagination: { classPropertyName: "manualPagination", publicName: "manualPagination", isSignal: true, isRequired: false, transformFunction: null }, features: { classPropertyName: "features", publicName: "features", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, enableSelection: { classPropertyName: "enableSelection", publicName: "enableSelection", isSignal: true, isRequired: false, transformFunction: null }, hideFooter: { classPropertyName: "hideFooter", publicName: "hideFooter", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, showLayoutToggle: { classPropertyName: "showLayoutToggle", publicName: "showLayoutToggle", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, filterColumnId: { classPropertyName: "filterColumnId", publicName: "filterColumnId", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showColumnToggle: { classPropertyName: "showColumnToggle", publicName: "showColumnToggle", isSignal: true, isRequired: false, transformFunction: null }, toolbarActions: { classPropertyName: "toolbarActions", publicName: "toolbarActions", isSignal: true, isRequired: false, transformFunction: null }, defaultPageSize: { classPropertyName: "defaultPageSize", publicName: "defaultPageSize", isSignal: true, isRequired: false, transformFunction: null }, filterRows: { classPropertyName: "filterRows", publicName: "filterRows", isSignal: true, isRequired: false, transformFunction: null }, initialSorting: { classPropertyName: "initialSorting", publicName: "initialSorting", isSignal: true, isRequired: false, transformFunction: null }, initialColumnFilters: { classPropertyName: "initialColumnFilters", publicName: "initialColumnFilters", isSignal: true, isRequired: false, transformFunction: null }, initialColumnVisibility: { classPropertyName: "initialColumnVisibility", publicName: "initialColumnVisibility", isSignal: true, isRequired: false, transformFunction: null }, initialRowSelection: { classPropertyName: "initialRowSelection", publicName: "initialRowSelection", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null }, navMode: { classPropertyName: "navMode", publicName: "navMode", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layout: "layoutChange", selectionChange: "selectionChange", pageChange: "pageChange", pageSizeChange: "pageSizeChange", rowClick: "rowClick", sortingChange: "sortingChange", columnFiltersChange: "columnFiltersChange", filterChange: "filterChange", columnVisibilityChange: "columnVisibilityChange" }, providers: [
836
872
  provideIcons({ lucideArrowDown, lucideArrowUp, lucideChevronsUpDown, lucideLayoutGrid, lucideLayoutList }),
837
873
  ], ngImport: i0, template: `
838
874
  <div [class]="_containerClass()">
@@ -1281,7 +1317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
1281
1317
  `,
1282
1318
  changeDetection: ChangeDetectionStrategy.OnPush,
1283
1319
  }]
1284
- }], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], gridColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridColumns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], manualPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "manualPagination", required: false }] }], features: [{ type: i0.Input, args: [{ isSignal: true, alias: "features", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], enableSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSelection", required: false }] }], hideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFooter", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }, { type: i0.Output, args: ["layoutChange"] }], showLayoutToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLayoutToggle", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], filterColumnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterColumnId", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], showColumnToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnToggle", required: false }] }], toolbarActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarActions", required: false }] }], defaultPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPageSize", required: false }] }], filterRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterRows", required: false }] }], initialSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialSorting", required: false }] }], initialColumnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialColumnFilters", required: false }] }], initialColumnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialColumnVisibility", required: false }] }], initialRowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialRowSelection", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }], navMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "navMode", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], sortingChange: [{ type: i0.Output, args: ["sortingChange"] }], columnFiltersChange: [{ type: i0.Output, args: ["columnFiltersChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], columnVisibilityChange: [{ type: i0.Output, args: ["columnVisibilityChange"] }] } });
1320
+ }], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], gridColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridColumns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], getRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRowId", required: false }] }], manualPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "manualPagination", required: false }] }], features: [{ type: i0.Input, args: [{ isSignal: true, alias: "features", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], enableSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSelection", required: false }] }], hideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFooter", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }, { type: i0.Output, args: ["layoutChange"] }], showLayoutToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLayoutToggle", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], filterColumnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterColumnId", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], showColumnToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnToggle", required: false }] }], toolbarActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarActions", required: false }] }], defaultPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPageSize", required: false }] }], filterRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterRows", required: false }] }], initialSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialSorting", required: false }] }], initialColumnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialColumnFilters", required: false }] }], initialColumnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialColumnVisibility", required: false }] }], initialRowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialRowSelection", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }], navMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "navMode", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], sortingChange: [{ type: i0.Output, args: ["sortingChange"] }], columnFiltersChange: [{ type: i0.Output, args: ["columnFiltersChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], columnVisibilityChange: [{ type: i0.Output, args: ["columnVisibilityChange"] }] } });
1285
1321
 
1286
1322
  /**
1287
1323
  * Sortable + hideable column header.
@@ -188,6 +188,15 @@ declare class EgDataTable<TData extends RowData> implements OnInit {
188
188
  }, TData>[] | undefined>;
189
189
  /** Client rows, or a server page slice when `manualPagination` is set (`null` while loading). */
190
190
  readonly data: _angular_core.InputSignal<EgPaginatedResponse<TData> | readonly TData[] | null>;
191
+ /**
192
+ * Pure stable identity callback, e.g. `(record) => record.id`. Return a unique
193
+ * string per entity, independent of position, and keep the callback reference stable.
194
+ * Selection survives refreshes only for IDs still in the supplied rows (after
195
+ * `filterRows`); server selection is limited to the loaded slice. Without this
196
+ * callback, IDs are positional and replacing the rows clears selection.
197
+ * Changing the callback clears selection. Update data immutably.
198
+ */
199
+ readonly getRowId: _angular_core.InputSignal<((row: TData) => string) | undefined>;
191
200
  /** When true, `data` is a server page slice and the table uses TanStack `manualPagination`. Sorting and filtering are then display-only: the slice is shown as-is while `sortingChange` / `filterChange` (`columnFiltersChange`) notify the caller to refetch. */
192
201
  readonly manualPagination: _angular_core.InputSignal<boolean>;
193
202
  /** TanStack feature registry. Defaults to filtering + visibility + pagination + selection + sorting. */
@@ -242,7 +251,7 @@ declare class EgDataTable<TData extends RowData> implements OnInit {
242
251
  readonly initialColumnFilters: _angular_core.InputSignal<ColumnFiltersState>;
243
252
  /** Seeds the column-visibility state once at creation. Later changes are ignored. */
244
253
  readonly initialColumnVisibility: _angular_core.InputSignal<ColumnVisibilityState>;
245
- /** Seeds the row-selection state once at creation (keys are row ids). Later changes are ignored. */
254
+ /** Seeds selection once for current rows: keys come from `getRowId`, or positional indices without it. Missing IDs are discarded. Later changes are ignored. */
246
255
  readonly initialRowSelection: _angular_core.InputSignal<RowSelectionState>;
247
256
  /** Show the rows-per-page selector in the footer pager. */
248
257
  readonly showPageSize: _angular_core.InputSignal<boolean>;
@@ -251,7 +260,7 @@ declare class EgDataTable<TData extends RowData> implements OnInit {
251
260
  /** Footer navigation-button content: icons only, text labels only, or both. */
252
261
  readonly navMode: _angular_core.InputSignal<EgPaginationNavMode>;
253
262
  readonly userClass: _angular_core.InputSignal<string>;
254
- /** Emits the selected rows whenever selection changes (requires `enableSelection`). */
263
+ /** Emits on init and when selected row identities/order or object references change. Includes rows hidden by built-in filters/client pagination, but never rows absent from `data`/`filterRows`. */
255
264
  readonly selectionChange: _angular_core.OutputEmitterRef<readonly TData[]>;
256
265
  /** Emits the target page index on pager navigation (primary hook for server fetching). */
257
266
  readonly pageChange: _angular_core.OutputEmitterRef<number>;
@@ -269,13 +278,15 @@ declare class EgDataTable<TData extends RowData> implements OnInit {
269
278
  private readonly _sorting;
270
279
  private readonly _columnFilters;
271
280
  private readonly _columnVisibility;
272
- private readonly _rowSelection;
273
281
  private readonly _clientPageIndex;
274
282
  private readonly _clientPageSize;
275
283
  private readonly _isServer;
276
284
  /** The server page slice when in server mode; `null` for client data, misuse shapes, or `null` while loading. */
277
285
  private readonly _page;
278
286
  private readonly _items;
287
+ private readonly _tableItems;
288
+ private readonly _rowSelection;
289
+ private _keepCurrentSelection;
279
290
  private readonly _serverPageCount;
280
291
  private readonly _serverPageIndex;
281
292
  private readonly _paginationState;
@@ -323,6 +334,7 @@ declare class EgDataTable<TData extends RowData> implements OnInit {
323
334
  readonly thumbnail?: boolean;
324
335
  };
325
336
  }, TData>;
337
+ private readonly _selectedRows;
326
338
  private readonly _emitSelection;
327
339
  /**
328
340
  * Seeds internal state from the `initial*` inputs. Runs in `ngOnInit` (after
@@ -352,7 +364,7 @@ declare class EgDataTable<TData extends RowData> implements OnInit {
352
364
  protected _contentCells(row: Row<EgDataTableFeatures, TData>): Cell<EgDataTableFeatures, TData, CellData>[];
353
365
  protected _cellLabel(cell: Cell<EgDataTableFeatures, TData, CellData>): string;
354
366
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgDataTable<any>, never>;
355
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgDataTable<any>, "eg-data-table", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "gridColumns": { "alias": "gridColumns"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "manualPagination": { "alias": "manualPagination"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "enableSelection": { "alias": "enableSelection"; "required": false; "isSignal": true; }; "hideFooter": { "alias": "hideFooter"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "showLayoutToggle": { "alias": "showLayoutToggle"; "required": false; "isSignal": true; }; "showToolbar": { "alias": "showToolbar"; "required": false; "isSignal": true; }; "filterColumnId": { "alias": "filterColumnId"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "showColumnToggle": { "alias": "showColumnToggle"; "required": false; "isSignal": true; }; "toolbarActions": { "alias": "toolbarActions"; "required": false; "isSignal": true; }; "defaultPageSize": { "alias": "defaultPageSize"; "required": false; "isSignal": true; }; "filterRows": { "alias": "filterRows"; "required": false; "isSignal": true; }; "initialSorting": { "alias": "initialSorting"; "required": false; "isSignal": true; }; "initialColumnFilters": { "alias": "initialColumnFilters"; "required": false; "isSignal": true; }; "initialColumnVisibility": { "alias": "initialColumnVisibility"; "required": false; "isSignal": true; }; "initialRowSelection": { "alias": "initialRowSelection"; "required": false; "isSignal": true; }; "showPageSize": { "alias": "showPageSize"; "required": false; "isSignal": true; }; "pageSizes": { "alias": "pageSizes"; "required": false; "isSignal": true; }; "navMode": { "alias": "navMode"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "layout": "layoutChange"; "selectionChange": "selectionChange"; "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; "rowClick": "rowClick"; "sortingChange": "sortingChange"; "columnFiltersChange": "columnFiltersChange"; "filterChange": "filterChange"; "columnVisibilityChange": "columnVisibilityChange"; }, never, never, true, never>;
367
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgDataTable<any>, "eg-data-table", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "gridColumns": { "alias": "gridColumns"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "getRowId": { "alias": "getRowId"; "required": false; "isSignal": true; }; "manualPagination": { "alias": "manualPagination"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "enableSelection": { "alias": "enableSelection"; "required": false; "isSignal": true; }; "hideFooter": { "alias": "hideFooter"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "showLayoutToggle": { "alias": "showLayoutToggle"; "required": false; "isSignal": true; }; "showToolbar": { "alias": "showToolbar"; "required": false; "isSignal": true; }; "filterColumnId": { "alias": "filterColumnId"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "showColumnToggle": { "alias": "showColumnToggle"; "required": false; "isSignal": true; }; "toolbarActions": { "alias": "toolbarActions"; "required": false; "isSignal": true; }; "defaultPageSize": { "alias": "defaultPageSize"; "required": false; "isSignal": true; }; "filterRows": { "alias": "filterRows"; "required": false; "isSignal": true; }; "initialSorting": { "alias": "initialSorting"; "required": false; "isSignal": true; }; "initialColumnFilters": { "alias": "initialColumnFilters"; "required": false; "isSignal": true; }; "initialColumnVisibility": { "alias": "initialColumnVisibility"; "required": false; "isSignal": true; }; "initialRowSelection": { "alias": "initialRowSelection"; "required": false; "isSignal": true; }; "showPageSize": { "alias": "showPageSize"; "required": false; "isSignal": true; }; "pageSizes": { "alias": "pageSizes"; "required": false; "isSignal": true; }; "navMode": { "alias": "navMode"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "layout": "layoutChange"; "selectionChange": "selectionChange"; "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; "rowClick": "rowClick"; "sortingChange": "sortingChange"; "columnFiltersChange": "columnFiltersChange"; "filterChange": "filterChange"; "columnVisibilityChange": "columnVisibilityChange"; }, never, never, true, never>;
356
368
  }
357
369
 
358
370
  /**
@@ -135,6 +135,38 @@ Real selectors (from source):
135
135
 
136
136
  ## API reference
137
137
 
138
+ ### User commits, invalid drafts, and programmatic writes
139
+
140
+ The single, range and multi text inputs commit on **blur or Enter**. Both parsed and transformed values
141
+ must have a finite `getTime` through the configured Spartan date adapter and satisfy inclusive whole-day
142
+ `min`/`max` bounds (`startOfDay(min)` through `endOfDay(max)`). Provide matching parsing, formatting and
143
+ pure transformation callbacks when using a custom adapter/date type. A transformed range must be ordered;
144
+ custom transforms may sort endpoints. The default range parser still treats one date as a same-day range,
145
+ but an explicitly unparseable second endpoint is rejected.
146
+
147
+ For multi selection, `maxSelection` caps the raw and transformed array counts. `minSelection` is the
148
+ calendar's **deselection floor**: reductions below it are rejected, while growth from empty is allowed.
149
+ Supply unique dates. When the calendar proposes resetting a full selection to one new date, that reset
150
+ must also satisfy the floor. Rejected calendar commits restore the previous selection without user emissions.
151
+
152
+ On rejection the committed value stays unchanged, no `dateChange`/CVA `onChange` fires, and the input
153
+ preserves editable text across blur, Enter and refocus. `inputInvalid()` exposes local rejection state;
154
+ the native input receives `aria-invalid="true"` and invalid styling, combined with `forceInvalid`.
155
+ The interaction touches the form control but does not install an Angular validator or overwrite its
156
+ errors: form validators continue to see the last committed value. If unresolved drafts should block
157
+ submission, include `inputInvalid()` in that decision. Use `ariaDescribedby` to associate explanatory text.
158
+
159
+ A successful text/calendar commit, explicit clear, or external value write clears the local rejection.
160
+ Empty text and the clear button bypass transforms and the selection floor, emitting `null` (single/range)
161
+ or `[]` (multi); whitespace is passed to the parser. Enter keeps edit formatting for a subsequent blur;
162
+ blur restores display formatting. Disabled/readonly text inputs do not commit or clear.
163
+
164
+ `updateDate(value)` returns a boolean indicating whether a user commit was accepted. Programmatic CVA
165
+ `writeValue` applies configured transforms without enforcing user constraints or emitting; it replaces
166
+ rejected drafts, including repeated same-value/null writes. `[date]` remains a direct, untransformed
167
+ standalone input. `reset()` is an explicit programmatic clear and emits. Month/year retains its existing
168
+ brain-input lifecycle; this constraint/draft contract applies to single, range and multi pickers.
169
+
138
170
  ### `HlmDatePicker` — `hlm-date-picker`
139
171
 
140
172
  Single-date picker. Generic `<T>` (usually `Date`). Implements `BrnDatePickerBase<T>` + `ControlValueAccessor`, hosts `BrnFieldControl`.
@@ -230,15 +262,15 @@ Outputs/methods mirror `HlmDatePicker` (`dateChange: T | null`, `updateDate`, `o
230
262
 
231
263
  `HlmDatePickerInput<T>`, `HlmDateMultiInput<T>`, `HlmDateRangeInput<T>`, `HlmMonthYearInput<T>` extend `BrnDateInput` (inheriting `placeholder`, `inputId`, disabled/invalid wiring, clear-button and calendar-button behavior) and add:
232
264
 
233
- | Input | Type | Default | Notes |
234
- | -------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------- |
235
- | `parseDate` | `(value: string) => T \| null` (or `T[] \| null` / `[T,T] \| null` per variant) | from matching `provideHlm*Config` | Return `null` for invalid text; picker clears while text is preserved. |
236
- | `formatInputDate` / `formatInputDates` | `(date) => string` | from config | Edit format shown while focused. |
237
- | `ariaLabel` / `ariaDescribedby` | `string` | — | Accessible labelling for the inner `<input>`. |
238
- | `name` | `string \| undefined` | — | Native `name` forwarded to the inner `<input>`. |
239
- | `readonly` | `boolean` | `false` | Native `readonly` forwarded to the inner `<input>`. |
240
- | `class` | `ClassValue` | `''` | Extra classes on the host group container. |
241
- | `inputClass` | `ClassValue` | `''` | Extra classes on the inner `<input>` (e.g. text size). |
265
+ | Input | Type | Default | Notes |
266
+ | -------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------- |
267
+ | `parseDate` | `(value: string) => T \| null` (or `T[] \| null` / `[T,T] \| null` per variant) | from matching `provideHlm*Config` | Return `null` for invalid text; single/range/multi preserve the committed value and rejected text. |
268
+ | `formatInputDate` / `formatInputDates` | `(date) => string` | from config | Edit format shown while focused. |
269
+ | `ariaLabel` / `ariaDescribedby` | `string` | — | Accessible labelling for the inner `<input>`. |
270
+ | `name` | `string \| undefined` | — | Native `name` forwarded to the inner `<input>`. |
271
+ | `readonly` | `boolean` | `false` | Native `readonly` forwarded to the inner `<input>`. |
272
+ | `class` | `ClassValue` | `''` | Extra classes on the host group container. |
273
+ | `inputClass` | `ClassValue` | `''` | Extra classes on the inner `<input>` (e.g. text size). |
242
274
 
243
275
  ### `HlmDatePickerTrigger` — `hlm-date-picker-trigger`
244
276