@sdcorejs/angular 20.3.4 → 20.3.5

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 (28) hide show
  1. package/components/modal/index.d.ts +6 -1
  2. package/components/query-bar/index.d.ts +28 -2
  3. package/components/table/index.d.ts +282 -24
  4. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +5 -5
  5. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  6. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +1 -1
  7. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  8. package/fesm2022/sdcorejs-angular-components-modal.mjs +46 -10
  9. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  10. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +171 -151
  11. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  12. package/fesm2022/sdcorejs-angular-components-table.mjs +5403 -3637
  13. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  14. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +1 -1
  15. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  16. package/fesm2022/sdcorejs-angular-forms-select.mjs +23 -4
  17. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  19. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-i18n.mjs +190 -0
  21. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-modules-layout.mjs +10 -6
  23. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  24. package/fesm2022/sdcorejs-angular-services-excel.mjs +34 -0
  25. package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
  26. package/i18n/index.d.ts +38 -0
  27. package/package.json +1 -1
  28. package/services/excel/index.d.ts +59 -0
@@ -23,6 +23,11 @@ declare class SdModal implements OnDestroy {
23
23
  hideClose: _angular_core.InputSignalWithTransform<boolean, boolean | "">;
24
24
  disableBackdropClose: _angular_core.InputSignalWithTransform<boolean, boolean | "">;
25
25
  beforeClose: _angular_core.InputSignal<SdModalBeforeClose | undefined>;
26
+ /**
27
+ * Close when the browser history changes (Back, a route change). `false` lets the content handle Back itself, e.g.
28
+ * a sheet with pages. Same name as `MatDialogConfig.closeOnNavigation`.
29
+ */
30
+ closeOnNavigation: _angular_core.InputSignalWithTransform<boolean, boolean | "">;
26
31
  sdClosed: _angular_core.OutputEmitterRef<void>;
27
32
  sdCloseError: _angular_core.OutputEmitterRef<unknown>;
28
33
  isOpened: _angular_core.WritableSignal<boolean>;
@@ -34,7 +39,7 @@ declare class SdModal implements OnDestroy {
34
39
  requestClose: () => Promise<boolean>;
35
40
  forceClose: () => void;
36
41
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdModal, never>;
37
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdModal, "sd-modal", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "modalClass": { "alias": "modalClass"; "required": false; "isSignal": true; }; "lazyLoadContent": { "alias": "lazyLoadContent"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; "beforeClose": { "alias": "beforeClose"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; "sdCloseError": "sdCloseError"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
42
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdModal, "sd-modal", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "modalClass": { "alias": "modalClass"; "required": false; "isSignal": true; }; "lazyLoadContent": { "alias": "lazyLoadContent"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; "beforeClose": { "alias": "beforeClose"; "required": false; "isSignal": true; }; "closeOnNavigation": { "alias": "closeOnNavigation"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; "sdCloseError": "sdCloseError"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
38
43
  }
39
44
 
40
45
  export { SdModal };
@@ -560,5 +560,31 @@ declare class SdQueryBar {
560
560
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdQueryBar, "sd-query-bar", never, { "option": { "alias": "option"; "required": false; "isSignal": true; }; "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "logic": { "alias": "logic"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "showSavedFilters": { "alias": "showSavedFilters"; "required": false; "isSignal": true; }; "savedFiltersKey": { "alias": "savedFiltersKey"; "required": false; "isSignal": true; }; "showLogicToggle": { "alias": "showLogicToggle"; "required": false; "isSignal": true; }; "showClearAll": { "alias": "showClearAll"; "required": false; "isSignal": true; }; "showOperatorOnChip": { "alias": "showOperatorOnChip"; "required": false; "isSignal": true; }; }, { "filters": "filtersChange"; "logic": "logicChange"; "search": "searchChange"; "queryChange": "queryChange"; "apply": "apply"; }, never, ["[sdQueryBarEnd]"], true, never>;
561
561
  }
562
562
 
563
- export { SD_QUERY_DEFAULT_OPERATOR_BY_TYPE, SD_QUERY_MULTI_OPERATORS, SD_QUERY_NO_DATA_OPERATORS, SD_QUERY_OPERATORS_BY_TYPE, SD_QUERY_TYPE_ICON, SdQueryBar, sdQueryAllowedOperators, sdQueryDefaultOperator, sdQueryFieldIcon, sdQueryShowOperatorSelector };
564
- export type { BuildingChip, SdQuery, SdQueryBarOption, SdQueryField, SdQueryFieldBoolean, SdQueryFieldDate, SdQueryFieldLazyValues, SdQueryFieldNumber, SdQueryFieldString, SdQueryFieldType, SdQueryFieldValues, SdQueryLogic, SdSavedFilter };
563
+ /** What `ɵsdQueryChipValueText` needs from its host: translations, date formatting and the labels it knows. */
564
+ interface ɵSdQueryChipTextContext {
565
+ t: (key: string, params?: Record<string, string | number>) => string;
566
+ toFormat: (value: unknown, format: string) => string;
567
+ /** Options already loaded for the chip being edited (the popover's options). */
568
+ options?: readonly unknown[];
569
+ /** Labels of the field's values loaded by `ɵSdQueryChipLabels`. */
570
+ labels?: ReadonlyMap<unknown, string>;
571
+ }
572
+ /**
573
+ * Value text of a chip, shared by the query bar and the sd-table phone filters so both show the same string:
574
+ * one value → its label; several → `first +n`; a date range in one year → `01/10 – 31/10/2026`; one open end →
575
+ * `From x` / `To y`; `NULL` / `NOT_NULL` → empty.
576
+ */
577
+ declare const ɵsdQueryChipValueText: (filter: Filter, field: SdQueryField | undefined, context: ɵSdQueryChipTextContext) => string;
578
+ /**
579
+ * Labels of `values` / `lazy-values` chip values that are not in memory (restored from a cache, a URL or the
580
+ * table's filter): looked up once per field (`values` with an items function) or per field + value (`lazy-values`,
581
+ * through `views` or `search`). `get` reads a signal, so a view re-renders when a lookup lands.
582
+ */
583
+ declare class ɵSdQueryChipLabels {
584
+ #private;
585
+ get(key: string): ReadonlyMap<unknown, string> | undefined;
586
+ resolve(filter: Filter, field: SdQueryField | undefined): void;
587
+ }
588
+
589
+ export { SD_QUERY_DEFAULT_OPERATOR_BY_TYPE, SD_QUERY_MULTI_OPERATORS, SD_QUERY_NO_DATA_OPERATORS, SD_QUERY_OPERATORS_BY_TYPE, SD_QUERY_TYPE_ICON, SdQueryBar, sdQueryAllowedOperators, sdQueryDefaultOperator, sdQueryFieldIcon, sdQueryShowOperatorSelector, ɵSdQueryChipLabels, ɵsdQueryChipValueText };
590
+ export type { BuildingChip, SdQuery, SdQueryBarOption, SdQueryField, SdQueryFieldBoolean, SdQueryFieldDate, SdQueryFieldLazyValues, SdQueryFieldNumber, SdQueryFieldString, SdQueryFieldType, SdQueryFieldValues, SdQueryLogic, SdSavedFilter, ɵSdQueryChipTextContext };
@@ -13,14 +13,13 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
13
13
  import { MatSort, SortDirection } from '@angular/material/sort';
14
14
  import { MatTable } from '@angular/material/table';
15
15
  import { SdExcelColumn } from '@sdcorejs/angular/services';
16
- import { SdQueryField, SdQueryBar, SdQueryBarOption, SdQuery } from '@sdcorejs/angular/components/query-bar';
16
+ import { SdQueryField, ɵSdQueryChipLabels as _SdQueryChipLabels, SdQueryBar, SdQueryBarOption, SdQuery } from '@sdcorejs/angular/components/query-bar';
17
17
  import { CdkDragDrop, CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
18
18
  import { SdDataStateTemplateDirective } from '@sdcorejs/angular/components/data-state';
19
19
  import { SdReadState } from '@sdcorejs/angular/utilities/read-state';
20
20
  import { SdQuickAction } from '@sdcorejs/angular/components/quick-action';
21
21
  import { SdScrollDirective } from '@sdcorejs/angular/directives';
22
22
  import { FormGroup } from '@angular/forms';
23
- import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
24
23
  import { SdModal } from '@sdcorejs/angular/components/modal';
25
24
  import { MatSelectionList } from '@angular/material/list';
26
25
 
@@ -362,6 +361,8 @@ interface SdTableQuickFilter {
362
361
  }
363
362
  interface TableFilterConfiguration {
364
363
  inlineExternal: Record<string, boolean>;
364
+ /** Giao diện lọc người dùng chọn trong modal Thiết lập; thắng `filter.mode` khi `filter.modeSelectable` khác `false`. */
365
+ mode?: SdTableOptionFilter['mode'];
365
366
  }
366
367
  interface TableFilterValue {
367
368
  quickSearch?: SdTableQuickSearchValue;
@@ -420,14 +421,22 @@ interface SdTableOptionFilter<T = unknown> {
420
421
  * @defaultValue 'default'
421
422
  */
422
423
  mode?: 'default' | 'query-bar';
424
+ /**
425
+ * Cho người dùng chọn giao diện lọc trong modal Thiết lập. Lựa chọn được lưu cùng thiết lập bộ lọc (theo `filter.key`)
426
+ * và thắng `mode`; **Khôi phục mặc định** xoá nó. `false`: luôn dùng `mode` và bỏ qua lựa chọn đã lưu.
427
+ * `SD_TABLE_CONFIGURATION.filter.modeSelectable` đặt cho mọi bảng; option thắng.
428
+ * @defaultValue true
429
+ */
430
+ modeSelectable?: boolean;
423
431
  /** Chỉ dùng khi `mode` là `'query-bar'`. */
424
432
  queryBar?: SdTableOptionFilterQueryBar;
425
433
  }
426
434
  /** Tuỳ chọn của `filter.mode: 'query-bar'`. */
427
435
  interface SdTableOptionFilterQueryBar {
428
436
  /**
429
- * Cách sửa chip: popover hoặc control ngay trên thanh (`sd-query-bar` mode `'inline'`).
430
- * @defaultValue 'popover'
437
+ * Cách sửa chip: control ngay trên thanh (`sd-query-bar` mode `'inline'`) hoặc popover. `sd-query-bar` đứng riêng
438
+ * vẫn mặc định `'popover'`.
439
+ * @defaultValue 'inline'
431
440
  */
432
441
  editor?: 'popover' | 'inline';
433
442
  /**
@@ -1112,6 +1121,58 @@ interface TableOptionTreeLazy<T = any> {
1112
1121
  indentSize?: number;
1113
1122
  }
1114
1123
 
1124
+ /** A leaf column of the table, by its `field`. Checked at build time (`NestedKeyOf<T>`) and at run time (leaf column). */
1125
+ type SdTableMobileField<T> = NestedKeyOf<T>;
1126
+ /** A column value, or fixed text shown as is. */
1127
+ type SdTableMobileText<T> = SdTableMobileField<T> | {
1128
+ text: string;
1129
+ };
1130
+ /** Slots every mobile layout has. */
1131
+ interface SdTableMobileData<T> {
1132
+ /** First line, 15px medium. A missing or unknown field falls back to `mobile.rowLabel`, then `rowKey`. */
1133
+ title: SdTableMobileText<T>;
1134
+ /** Second line, one line cut with "…". */
1135
+ subtitle?: SdTableMobileText<T>;
1136
+ /** After the title. A field must be a column with `useBadge` (checked at run time), otherwise it shows as text. */
1137
+ badge?: SdTableMobileField<T> | SdBadgeData;
1138
+ /** Grid cells with the column title as label, in this order. */
1139
+ fields?: SdTableMobileField<T>[];
1140
+ }
1141
+ /** Data of a `card` (the only layout so far). */
1142
+ interface SdTableMobileCardData<T> extends SdTableMobileData<T> {
1143
+ /** First grid cell, medium weight. */
1144
+ highlight?: SdTableMobileField<T>;
1145
+ /**
1146
+ * Grid cells shown before the "{n} more fields" button, `highlight` included.
1147
+ * @defaultValue 4
1148
+ */
1149
+ maxFields?: number;
1150
+ /**
1151
+ * Not a card slot. why: TypeScript does not report excess properties of an object returned by an arrow function,
1152
+ * so `never` is what rejects `trailing` (a slot of the future `list` layout) on a card.
1153
+ */
1154
+ trailing?: never;
1155
+ }
1156
+ /** Second argument of `mobile.template.data`. */
1157
+ interface SdTableMobileDataContext {
1158
+ /** Zero-based data-row position on the current page, as in `SdTableRowMobileDefContext`. */
1159
+ index: number;
1160
+ selected: boolean;
1161
+ }
1162
+ /**
1163
+ * Builds the slots of one row. Called again when the rows are read again or `detectChanges()` runs, and when the index
1164
+ * or the selection of the row changes.
1165
+ */
1166
+ type SdTableMobileDataFn<T, D> = (item: T, context: SdTableMobileDataContext) => D;
1167
+ /**
1168
+ * Body of the phone card: a consumer template, or slots built from the row (`data`). `layout` is fixed per table;
1169
+ * leaving it out means `'card'`.
1170
+ */
1171
+ type SdTableMobileTemplate<T> = TemplateRef<SdTableRowMobileDefContext<T>> | {
1172
+ layout?: 'card';
1173
+ data: SdTableMobileDataFn<T, SdTableMobileCardData<T>>;
1174
+ };
1175
+
1115
1176
  type SdTableOption<T = any> = SdTableLocalOption<T> | SdTableServerOption<T>;
1116
1177
  interface SdTableBaseOption<T = any> {
1117
1178
  /**
@@ -1141,10 +1202,19 @@ interface SdTableBaseOption<T = any> {
1141
1202
  * cần autoId theo dòng ổn định cho E2E.
1142
1203
  */
1143
1204
  rowKey?: string;
1144
- /** Mobile cards activate automatically when sdTableRowMobileDef is projected. */
1205
+ /**
1206
+ * Phone layout. Cards activate when the table has a card body: a projected `sdTableRowMobileDef` (wins, with a dev
1207
+ * warning when `template` is set too), `template`, or `SD_TABLE_CONFIGURATION.mobile.autoTemplate`.
1208
+ */
1145
1209
  mobile?: {
1146
1210
  /** Row command title and accessible labels; falls back to rowKey, then row number. */
1147
1211
  rowLabel?: (row: T) => string;
1212
+ /**
1213
+ * Card body on phones: a `TemplateRef`, or `{ data }` to build the card from row values. `false` keeps the desktop
1214
+ * table on phones even with `autoTemplate`.
1215
+ * @example `template: { data: row => ({ title: 'code', badge: 'status', highlight: 'total' }) }`
1216
+ */
1217
+ template?: SdTableMobileTemplate<T> | false;
1148
1218
  };
1149
1219
  /**
1150
1220
  * Cấu hình hiển thị/phục hồi config của table.
@@ -1495,6 +1565,30 @@ interface SdTableQueryContext extends SdTableQueryFields {
1495
1565
  defaultColumnOperator?: Record<string, Operator>;
1496
1566
  }
1497
1567
 
1568
+ /**
1569
+ * One filter of the phone UI (chip row and filter sheet).
1570
+ * - `source` + `field`: a filter the query-bar model can read — it gets a chip, a summary and the built-in controls.
1571
+ * - `custom`: a filter only its own control can edit (a template, a time column, an external filter the bar leaves
1572
+ * out). It has a row in the filter sheet that opens that control, but no chip and no summary.
1573
+ */
1574
+ interface SdTableMobileFilterItem {
1575
+ /** `external:<field>` / `column:<field>` as on the query bar, `custom-*:<field>` otherwise. */
1576
+ key: string;
1577
+ label: string;
1578
+ source?: SdTableQuerySource;
1579
+ field?: SdQueryField;
1580
+ custom?: {
1581
+ kind: 'column';
1582
+ column: SdTableColumnAnyRow;
1583
+ } | {
1584
+ kind: 'external';
1585
+ external: SdTableExternalFilter;
1586
+ } | {
1587
+ kind: 'def';
1588
+ def: SdTableFilterDefDirective;
1589
+ };
1590
+ }
1591
+
1498
1592
  /** Internal presentation only; closures keep row and selection callbacks distinct. */
1499
1593
  interface SdTableMobileAction {
1500
1594
  key: string;
@@ -1510,6 +1604,18 @@ interface SdTableMobileAction {
1510
1604
  run?: () => unknown;
1511
1605
  }
1512
1606
 
1607
+ /** What fills a phone card: a template, slots from `mobile.template.data`, or slots derived from the columns. */
1608
+ type SdTableMobileBody<T> = {
1609
+ kind: 'template';
1610
+ templateRef: TemplateRef<SdTableRowMobileDefContext<T>>;
1611
+ } | {
1612
+ kind: 'data';
1613
+ layout: unknown;
1614
+ data: SdTableMobileDataFn<T, SdTableMobileCardData<T>>;
1615
+ } | {
1616
+ kind: 'auto';
1617
+ };
1618
+
1513
1619
  /** What the unknown-total paginator renders; computed by `SdTable`. */
1514
1620
  interface SdTableUnknownTotalPagerState {
1515
1621
  /** Page the controls navigate from: the shown page, or the failed target after a read error. */
@@ -1582,19 +1688,13 @@ declare class ExternalFilterComponent {
1582
1688
  }
1583
1689
 
1584
1690
  /**
1585
- * Mobile-filter — side-drawer chiếm ~90% width thiết bị. Dùng cho table khi
1586
- * render trên màn hình điện thoại (inline filter bị ẩn).
1587
- *
1588
- * Layout (mỗi filter 1 hàng, size='sm'):
1589
- * 1. External filter (render inline — KHÔNG reuse external-filter component
1590
- * vì component đó dùng grid 2/3 cột + có chọn ẩn/hiện không phù hợp mobile).
1591
- * 2. filterDefs — custom templates do app khai báo qua `[sdTableFilterDef]`.
1592
- * 3. Column filter — 1 column-filter / column.
1593
- *
1594
- * State: local working copy. Cancel = đóng (không ghi). Apply = flush vào
1595
- * filterRegister + đóng.
1691
+ * Filter sheet of the phone (handoff table-mobile 5): one `sd-modal` bottom sheet with two levels — the list of
1692
+ * filters with their summary, and the page of one filter. Works on a copy of the filter register: Done keeps the page's
1693
+ * edits in the copy, Apply writes every filter and reads once, Cancel / close / a swipe down / the scrim drop the copy.
1694
+ * Order: external filters → `sdTableFilterDef` templates → columns.
1596
1695
  */
1597
1696
  declare class MobileFilterComponent {
1697
+ #private;
1598
1698
  autoIdInput: _angular_core.InputSignal<string | null | undefined>;
1599
1699
  filter: _angular_core.InputSignal<SdTableOptionFilter<unknown> | undefined>;
1600
1700
  externalFilters: _angular_core.InputSignal<SdTableExternalFilter[] | null | undefined>;
@@ -1602,22 +1702,91 @@ declare class MobileFilterComponent {
1602
1702
  filterDefs: _angular_core.InputSignal<readonly SdTableFilterDefDirective[] | null | undefined>;
1603
1703
  filterRegister: _angular_core.InputSignal<TableFilterRegister | undefined>;
1604
1704
  cacheValues: _angular_core.InputSignal<Record<string, any[]> | undefined>;
1605
- drawer: _angular_core.Signal<SdSideDrawer>;
1705
+ /** Filters and the query model, from the table. */
1706
+ model: _angular_core.InputSignal<{
1707
+ ctx: SdTableQueryContext;
1708
+ items: SdTableMobileFilterItem[];
1709
+ } | undefined>;
1710
+ readonly sheet: _angular_core.Signal<SdModal>;
1711
+ protected readonly head: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
1712
+ protected readonly body: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
1606
1713
  workingColumnFilter: _angular_core.WritableSignal<Record<string, any>>;
1607
1714
  workingColumnOperator: _angular_core.WritableSignal<Record<string, Operator>>;
1608
1715
  workingExternalFilter: _angular_core.WritableSignal<Record<string, any>>;
1716
+ /** Filter whose page is open; `undefined` on the list. */
1717
+ readonly page: _angular_core.WritableSignal<SdTableMobileFilterItem | undefined>;
1718
+ /** Bumped when the copy changes in place, so summaries and counts follow. */
1719
+ readonly revision: _angular_core.WritableSignal<number>;
1720
+ readonly labels: _SdQueryChipLabels;
1609
1721
  autoId: _angular_core.Signal<string>;
1610
1722
  externalFilterItems: _angular_core.Signal<SdTableExternalFilter[]>;
1611
1723
  columnItems: _angular_core.Signal<SdTableColumn[]>;
1612
1724
  filterDefItems: _angular_core.Signal<readonly SdTableFilterDefDirective[]>;
1725
+ /** The copy as one record; its parts are the working signals' objects, edited in place by the field pages. */
1726
+ readonly working: _angular_core.Signal<TableFilterValue>;
1727
+ readonly rows: _angular_core.Signal<{
1728
+ item: SdTableMobileFilterItem;
1729
+ summary: string;
1730
+ active: boolean;
1731
+ field: string;
1732
+ }[]>;
1733
+ readonly activeCount: _angular_core.Signal<number>;
1734
+ constructor();
1613
1735
  open: () => void;
1614
1736
  close: () => void;
1737
+ /** Opens the page of a filter; Back returns to the list. */
1738
+ enter(item: SdTableMobileFilterItem): void;
1739
+ /** Done / ← / Escape on a page: back to the list, the edits stay in the copy. */
1740
+ back(): void;
1615
1741
  onApply: () => void;
1616
1742
  onCancel: () => void;
1743
+ /** "Clear all": empties every filter of the copy; Apply still writes it. */
1744
+ clearAll(): void;
1745
+ /** "Clear" on a page: that filter only. */
1746
+ clearPage(): void;
1747
+ onChanged(): void;
1748
+ onKeydown(event: KeyboardEvent): void;
1749
+ /** Every close path ends here: drop the history entries the sheet pushed. */
1750
+ onClosed(): void;
1617
1751
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MobileFilterComponent, never>;
1618
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MobileFilterComponent, "mobile-filter", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "externalFilters": { "alias": "externalFilters"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "filterDefs": { "alias": "filterDefs"; "required": false; "isSignal": true; }; "filterRegister": { "alias": "filterRegister"; "required": false; "isSignal": true; }; "cacheValues": { "alias": "cacheValues"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1752
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MobileFilterComponent, "mobile-filter", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "externalFilters": { "alias": "externalFilters"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "filterDefs": { "alias": "filterDefs"; "required": false; "isSignal": true; }; "filterRegister": { "alias": "filterRegister"; "required": false; "isSignal": true; }; "cacheValues": { "alias": "cacheValues"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1619
1753
  }
1620
1754
 
1755
+ type FilterMode = NonNullable<SdTableOptionFilter['mode']>;
1756
+ type ConfigTab = 'columns' | 'filters';
1757
+ interface ConfigFilterRow {
1758
+ field: string;
1759
+ title: string;
1760
+ on: boolean;
1761
+ locked: boolean;
1762
+ /** i18n key of the text under the title. */
1763
+ note?: string;
1764
+ }
1765
+ /** What the "Bộ lọc" tab shows; the table builds it, and `undefined` hides the tab. */
1766
+ interface ConfigFilterSetup {
1767
+ /** `filter.mode` after `SD_TABLE_CONFIGURATION`: the kind without a stored choice. */
1768
+ mode: FilterMode;
1769
+ /** The stored choice of the user (`TableFilterConfiguration.mode`). */
1770
+ storedMode?: FilterMode;
1771
+ /** `filter.modeSelectable !== false`: the kinds are offered. */
1772
+ modeSelectable: boolean;
1773
+ /** Stored `TableFilterConfiguration.inlineExternal`. */
1774
+ inlineExternal: Record<string, boolean>;
1775
+ /** External filters in option order; `offBar`: the query bar cannot show it. */
1776
+ externalFilters: {
1777
+ field: string;
1778
+ title: string;
1779
+ required: boolean;
1780
+ offBar: boolean;
1781
+ }[];
1782
+ /** `filter.queryBar.pinned`: the app picks the pinned chips, so the list cannot change them on the bar. */
1783
+ pinned?: string[];
1784
+ /**
1785
+ * Titles of the required external filters the bar cannot show. The bar would block the read with no place to fill
1786
+ * them, so the bar card is off while there is any.
1787
+ */
1788
+ barBlockedBy: string[];
1789
+ }
1621
1790
  declare class ConfigComponent {
1622
1791
  #private;
1623
1792
  autoIdInput: _angular_core.InputSignal<string | null | undefined>;
@@ -1625,6 +1794,10 @@ declare class ConfigComponent {
1625
1794
  changes: _angular_core.OutputEmitterRef<ConfiguredTableResult>;
1626
1795
  /** Restore defaults was confirmed and the stored setup removed. */
1627
1796
  defaultsRestored: _angular_core.OutputEmitterRef<void>;
1797
+ /** The "Bộ lọc" tab; `undefined` hides it. */
1798
+ filterSetup: _angular_core.InputSignal<ConfigFilterSetup | undefined>;
1799
+ /** Apply with a changed "Bộ lọc" tab: the filter setup to store. `mode` is left out when the kind cannot be picked. */
1800
+ filterApplied: _angular_core.OutputEmitterRef<Partial<TableFilterConfiguration>>;
1628
1801
  autoId: _angular_core.Signal<string>;
1629
1802
  modal: _angular_core.Signal<SdModal | undefined>;
1630
1803
  protected readonly handles: _angular_core.Signal<readonly ElementRef<HTMLButtonElement>[]>;
@@ -1649,6 +1822,25 @@ declare class ConfigComponent {
1649
1822
  readonly totalCount: _angular_core.Signal<number>;
1650
1823
  readonly shownCount: _angular_core.Signal<number>;
1651
1824
  readonly allShown: _angular_core.Signal<boolean>;
1825
+ /** Tab on screen; Cột when the table gives no "Bộ lọc" tab. */
1826
+ readonly tab: _angular_core.Signal<ConfigTab>;
1827
+ readonly tabs: readonly ConfigTab[];
1828
+ readonly modes: readonly FilterMode[];
1829
+ /** Picked filter kind (draft until Apply). */
1830
+ readonly filterMode: _angular_core.WritableSignal<FilterMode>;
1831
+ /** Inline external filters (draft until Apply). */
1832
+ readonly inlineExternal: _angular_core.WritableSignal<Record<string, boolean>>;
1833
+ /**
1834
+ * One row per external filter. In the panel the switch shows it there; on the bar it pins it as a chip, so a filter
1835
+ * the bar cannot show is off, a required one is always pinned, and `queryBar.pinned` decides for the app.
1836
+ */
1837
+ readonly filterRows: _angular_core.Signal<ConfigFilterRow[]>;
1838
+ /** Text under the filter list: what its switches do for the picked kind. */
1839
+ readonly filterListHint: _angular_core.Signal<"core.component.table.config.filters-hint-panel" | "core.component.table.config.filters-hint-pinned" | "core.component.table.config.filters-hint-bar">;
1840
+ /** Titles that keep the bar card off, joined for its note; '' when the bar can be picked. */
1841
+ readonly barBlockedBy: _angular_core.Signal<string>;
1842
+ /** On the bar, a filter it cannot show still filters by its value, with no chip to clear it. */
1843
+ readonly offBarWarning: _angular_core.Signal<boolean>;
1652
1844
  open: () => Promise<void>;
1653
1845
  close: () => void;
1654
1846
  onSave: () => void;
@@ -1658,6 +1850,14 @@ declare class ConfigComponent {
1658
1850
  * ô "Hiện" để bật lại.
1659
1851
  */
1660
1852
  isRowDisabled: (item: ConfiguredColumn) => boolean;
1853
+ readonly tabId: (tab: ConfigTab) => string;
1854
+ readonly panelId: (tab: ConfigTab) => string;
1855
+ readonly modeName: string;
1856
+ selectTab: (tab: ConfigTab) => void;
1857
+ /** ← → move between the tabs, Home / End go to the first / last (tablist pattern of the APG, roving tabindex). */
1858
+ onTabKeydown: (event: KeyboardEvent) => void;
1859
+ pickMode: (mode: FilterMode) => void;
1860
+ setInline: (field: string, on: boolean) => void;
1661
1861
  onFind: (value: unknown) => void;
1662
1862
  toggleRow: (field: string) => void;
1663
1863
  /**
@@ -1689,7 +1889,7 @@ declare class ConfigComponent {
1689
1889
  commitWidth: (field: string) => void;
1690
1890
  detailsId: (field: string) => string;
1691
1891
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfigComponent, never>;
1692
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfigComponent, "config", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "tableOption": { "alias": "tableOption"; "required": false; "isSignal": true; }; }, { "changes": "changes"; "defaultsRestored": "defaultsRestored"; }, never, never, true, never>;
1892
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfigComponent, "config", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "tableOption": { "alias": "tableOption"; "required": false; "isSignal": true; }; "filterSetup": { "alias": "filterSetup"; "required": false; "isSignal": true; }; }, { "changes": "changes"; "defaultsRestored": "defaultsRestored"; "filterApplied": "filterApplied"; }, never, never, true, never>;
1693
1893
  }
1694
1894
 
1695
1895
  declare class SdPopupExport {
@@ -1755,6 +1955,8 @@ interface ISdTableConfiguration {
1755
1955
  hideExternalFilterToolbar?: SdTableOptionFilter['hideExternalFilterToolbar'];
1756
1956
  /** Giao diện lọc mặc định cho mọi bảng; `option.filter.mode` thắng. Mặc định là `'default'`. */
1757
1957
  mode?: SdTableOptionFilter['mode'];
1958
+ /** Cho người dùng chọn giao diện lọc trong modal Thiết lập; `option.filter.modeSelectable` thắng. Mặc định là `true`. */
1959
+ modeSelectable?: SdTableOptionFilter['modeSelectable'];
1758
1960
  /** Tuỳ chọn mặc định của mode `'query-bar'`; gộp theo từng field với `option.filter.queryBar`. */
1759
1961
  queryBar?: SdTableOptionFilter['queryBar'];
1760
1962
  operator?: {
@@ -1769,6 +1971,13 @@ interface ISdTableConfiguration {
1769
1971
  };
1770
1972
  /** Lớp hiển thị khi đang tải cho mọi bảng; `option.loading` của từng bảng thắng theo từng field. */
1771
1973
  loading?: SdTableOptionLoading;
1974
+ mobile?: {
1975
+ /**
1976
+ * Phone cards for tables without a card body (`sdTableRowMobileDef` or `mobile.template`): the card is built from
1977
+ * the visible columns. `mobile.template: false` opts a table out. Mặc định là `false`.
1978
+ */
1979
+ autoTemplate?: boolean;
1980
+ };
1772
1981
  }
1773
1982
  declare const SD_TABLE_CONFIGURATION: InjectionToken<ISdTableConfiguration>;
1774
1983
 
@@ -1844,10 +2053,16 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
1844
2053
  sdTitleDefs: _angular_core.Signal<readonly SdTableTitleDefDirective<any>[]>;
1845
2054
  readonly sdRowMobileDef: _angular_core.Signal<SdTableRowMobileDefDirective<T> | undefined>;
1846
2055
  readonly isMobile: _angular_core.Signal<boolean>;
2056
+ /**
2057
+ * Body of the phone cards, by priority: `sdTableRowMobileDef`, then `mobile.template` (a template or `{ data }`),
2058
+ * then `SD_TABLE_CONFIGURATION.mobile.autoTemplate`. `undefined`: phones show the desktop table.
2059
+ */
2060
+ protected readonly mobileBody: _angular_core.Signal<SdTableMobileBody<T> | undefined>;
1847
2061
  readonly mobileCards: _angular_core.Signal<boolean>;
1848
2062
  /**
1849
2063
  * The footer settings button carries a dot while the table uses a setup of its own: stored columns that differ from
1850
- * the option (settings modal or a resize on the table) or inline external filters that differ from `defaultShowing`.
2064
+ * the option (settings modal or a resize on the table), inline external filters that differ from `defaultShowing`, or
2065
+ * a stored filter mode that differs from `filter.mode`.
1851
2066
  */
1852
2067
  readonly hasCustomSetup: _angular_core.Signal<boolean>;
1853
2068
  cellDef: _angular_core.Signal<Record<string, SdTableCellDefDirective<any>>>;
@@ -1915,11 +2130,24 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
1915
2130
  active: string;
1916
2131
  direction: SortDirection;
1917
2132
  }>;
2133
+ /**
2134
+ * Columns of the phone sort sheet: sortable leaf columns of the option in their order, `invisible` and
2135
+ * settings-hidden ones included, `hidden: true` ones left out (handoff table-mobile 6), with the settings title when
2136
+ * the column is on screen.
2137
+ */
1918
2138
  readonly mobileSortColumns: _angular_core.Signal<{
1919
2139
  field: string;
1920
2140
  title: string;
1921
2141
  direction: SortDirection;
1922
2142
  }[]>;
2143
+ /** The phone shows a sort chip / button: `sort.enable` and at least one sortable column. */
2144
+ protected readonly mobileSortAvailable: _angular_core.Signal<boolean>;
2145
+ /** Accessible name of the phone sort chip / button: "Sort", or the column and direction while sorted. */
2146
+ protected readonly mobileSortLabel: _angular_core.Signal<string>;
2147
+ /**
2148
+ * Tools sheet of the phone (⋮): export and settings. Filter, sort and reload live in the chip row, the sort sheet and
2149
+ * pull to refresh. The exports are laid out flat (two at most).
2150
+ */
1923
2151
  readonly mobileToolsActions: _angular_core.Signal<SdTableMobileAction[]>;
1924
2152
  readonly pageRevision: _angular_core.WritableSignal<number>;
1925
2153
  readonly dataRevision: _angular_core.WritableSignal<number>;
@@ -1949,7 +2177,17 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
1949
2177
  readonly quickSearchValue: _angular_core.WritableSignal<SdTableQuickSearchValue>;
1950
2178
  private readonly quickSearchControl;
1951
2179
  readonly quickSearchValid: _angular_core.Signal<boolean>;
1952
- /** `filter.mode` sau khi gộp `SD_TABLE_CONFIGURATION.filter.mode`. */
2180
+ /**
2181
+ * Tab "Bộ lọc" của modal Thiết lập: kiểu lọc và external filter hiện ở khung / ghim trên thanh. Không có tab khi
2182
+ * `filter.disabled`, trên mobile (luôn dùng giao diện mặc định), khi bảng không có bộ lọc nào, hoặc khi không chọn
2183
+ * được kiểu lọc mà cũng không có external filter. `barBlockedBy`: external filter bắt buộc mà thanh không hiển thị
2184
+ * được — thanh sẽ chặn đọc dữ liệu mà người dùng không có chỗ nhập, nên modal không cho chọn thanh.
2185
+ */
2186
+ protected readonly configFilter: _angular_core.Signal<ConfigFilterSetup | undefined>;
2187
+ /**
2188
+ * Giao diện lọc đã chọn: lựa chọn đã lưu của người dùng (trừ khi `filter.modeSelectable` là `false`), rồi
2189
+ * `filter.mode` sau khi gộp `SD_TABLE_CONFIGURATION.filter.mode`.
2190
+ */
1953
2191
  readonly filterMode: _angular_core.Signal<"default" | "query-bar">;
1954
2192
  /** Giao diện lọc đang hiển thị: mobile luôn dùng giao diện mặc định; giá trị lọc không đổi khi đổi viewport. */
1955
2193
  readonly effectiveFilterMode: _angular_core.Signal<"default" | "query-bar">;
@@ -1962,9 +2200,20 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
1962
2200
  readonly queryBarHintId: string;
1963
2201
  /** Field của thanh và bảng tra nguồn; `undefined` khi không ở mode query-bar. */
1964
2202
  readonly queryBarModel: _angular_core.Signal<SdTableQueryContext | undefined>;
2203
+ /**
2204
+ * Filters of the phone UI (chip row and filter sheets), in the fixed order external → `sdTableFilterDef` → columns.
2205
+ * `undefined` on desktop, with `filter.disabled`, or before the configuration is known.
2206
+ */
2207
+ protected readonly mobileFilterModel: _angular_core.Signal<{
2208
+ ctx: SdTableQueryContext;
2209
+ items: SdTableMobileFilterItem[];
2210
+ } | undefined>;
2211
+ /** Applied filter value (last emission of the filter register); the phone chips summarise it. */
2212
+ protected readonly mobileFilterValue: _angular_core.Signal<TableFilterValue | undefined>;
1965
2213
  readonly queryBarOption: _angular_core.Signal<SdQueryBarOption<unknown> | undefined>;
1966
2214
  /** Khoá thanh của các field đang lọc theo giá trị đã áp dụng — icon lọc ở header của chúng luôn hiện. */
1967
2215
  readonly queryBarActiveKeys: _angular_core.Signal<Set<string>>;
2216
+ queryBarTriggerPopup: (key: string) => "menu" | "listbox" | "dialog" | null;
1968
2217
  /** `aria-label` của icon lọc ở header: "Lọc theo …" / "Đang lọc theo …". */
1969
2218
  filterTriggerLabel(column: SdTableColumn, active: boolean): string;
1970
2219
  /** Icon lọc ở header: mở chip của field trên thanh (tạo chip nếu chưa có); đóng popover thì focus về icon. */
@@ -1980,7 +2229,11 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
1980
2229
  exporting: _angular_core.WritableSignal<boolean>;
1981
2230
  exportTitle: _angular_core.Signal<string>;
1982
2231
  tableConfiguration: ISdTableConfiguration | null;
1983
- /** Bảng chính của khung trang (sd-page-list): lấp phần chiều cao còn lại, giữ tối thiểu header + 5 dòng. */
2232
+ /**
2233
+ * Bảng chính của khung trang (sd-page-list): lấp phần chiều cao còn lại, giữ tối thiểu header + 5 dòng. Không áp
2234
+ * dụng khi điện thoại hiện thẻ: thẻ nằm theo trang và vùng cuộn của trang cuộn một lần, thay vì cuộn trong một hộp
2235
+ * thấp giữa header và paginator (và cuộn lồng với trang khi màn thấp).
2236
+ */
1984
2237
  readonly fill: _angular_core.Signal<boolean>;
1985
2238
  /** External filter của bảng chính thu gọn khi khung trang đang ở chế độ màn thấp. */
1986
2239
  readonly externalFilterCollapsedByDefault: _angular_core.Signal<boolean>;
@@ -2066,8 +2319,13 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
2066
2319
  get dataItems(): T[];
2067
2320
  get selectedItems(): T[];
2068
2321
  detectChanges: () => void;
2069
- /** Restore defaults in the settings modal also puts the inline external filters back to `defaultShowing`. */
2322
+ /**
2323
+ * Restore defaults in the settings modal also puts the inline external filters back to `defaultShowing` and clears the
2324
+ * stored filter mode.
2325
+ */
2070
2326
  onConfigDefaultsRestored: () => void;
2327
+ /** Apply in the settings modal with a changed "Bộ lọc" tab: store the filter kind and the inline external filters. */
2328
+ onConfigFilterApplied: (configuration: Partial<TableFilterConfiguration>) => void;
2071
2329
  onColumnResize: (field: string, width: string) => void;
2072
2330
  getSortAria: (field: string) => "none" | "ascending" | "descending";
2073
2331
  onOperatorChange: (column: SdTableColumn, operator: Operator | undefined) => void;
@@ -2081,4 +2339,4 @@ declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
2081
2339
  }
2082
2340
 
2083
2341
  export { SD_TABLE_CONFIGURATION, SD_TABLE_LAYOUT, SdConvertToPagingReq, SdMaterialFooterDefDirective, SdTable, SdTableCellDefDirective, SdTableCommandHeaderDefDirective, SdTableExpandDefDirective, SdTableFilterDefDirective, SdTableGroupDefDirective, SdTablePaginatorIntl, SdTableQuickSearchRightDefDirective, SdTableRowMobileDefDirective, SdTableTitleDefDirective };
2084
- export type { ISdTableConfiguration, SdTableAggregateCallback, SdTableAggregateContext, SdTableAggregateDefinition, SdTableAggregateGroup, SdTableAggregateOperation, SdTableAggregateResult, SdTableAggregateTemplateContext, SdTableColumn, SdTableColumnAggregate, SdTableColumnAnyRow, SdTableColumnChildren, SdTableColumnLazyValues, SdTableColumnNormal, SdTableColumnTransformFunc, SdTableColumnValues, SdTableCommand, SdTableCommandChildren, SdTableCommandNormal, SdTableCommandOption, SdTableDisplay, SdTableExternalFilter, SdTableFilterRequest, SdTableGroupDefContext, SdTableItem, SdTableLayout, SdTableMeta, SdTableOption, SdTableOptionAggregate, SdTableOptionFilter, SdTableOptionFilterQueryBar, SdTableOptionLoading, SdTableOptionQuickSearch, SdTableOptionTree, SdTableQuickFilter, SdTableQuickSearchFilter, SdTableQuickSearchFilterValue, SdTableQuickSearchValue, SdTableRowMobileDefContext, SdTableServerHasMoreResult, SdTableServerTotalResult, TableFilterConfiguration, TableFilterRegister, TableFilterValue, TableOptionTreeLazy, TableOptionTreeStatic };
2342
+ export type { ISdTableConfiguration, SdTableAggregateCallback, SdTableAggregateContext, SdTableAggregateDefinition, SdTableAggregateGroup, SdTableAggregateOperation, SdTableAggregateResult, SdTableAggregateTemplateContext, SdTableColumn, SdTableColumnAggregate, SdTableColumnAnyRow, SdTableColumnChildren, SdTableColumnLazyValues, SdTableColumnNormal, SdTableColumnTransformFunc, SdTableColumnValues, SdTableCommand, SdTableCommandChildren, SdTableCommandNormal, SdTableCommandOption, SdTableDisplay, SdTableExternalFilter, SdTableFilterRequest, SdTableGroupDefContext, SdTableItem, SdTableLayout, SdTableMeta, SdTableMobileCardData, SdTableMobileData, SdTableMobileDataContext, SdTableMobileDataFn, SdTableMobileField, SdTableMobileTemplate, SdTableMobileText, SdTableOption, SdTableOptionAggregate, SdTableOptionFilter, SdTableOptionFilterQueryBar, SdTableOptionLoading, SdTableOptionQuickSearch, SdTableOptionTree, SdTableQuickFilter, SdTableQuickSearchFilter, SdTableQuickSearchFilterValue, SdTableQuickSearchValue, SdTableRowMobileDefContext, SdTableServerHasMoreResult, SdTableServerTotalResult, TableFilterConfiguration, TableFilterRegister, TableFilterValue, TableOptionTreeLazy, TableOptionTreeStatic };