@masterteam/data-table 0.0.2 → 0.0.4

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/legacy/README.md CHANGED
@@ -8,6 +8,11 @@ inherited `provideMTComponents` tokens/fonts, reactive Transloco and LTR/RTL. Lo
8
8
 
9
9
  ## Install and profiles
10
10
 
11
+ `provideMTDataTables` and `MT_DATA_TABLE_CONFIGURATION` come from
12
+ `@masterteam/data-table/config` in root providers (this entry re-exports them).
13
+ This entry imports the grid, so a startup import of it puts the grid in the
14
+ initial bundle. `MtTablePreferences` is `providedIn: 'root'`.
15
+
11
16
  ```ts
12
17
  provideMTDataTables(() => ({
13
18
  identity: () => ({ application, tenant, user, actor, template }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/data-table",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Masterteam entity-aware tables and portal renderer for the independent data grid.",
5
5
  "publishConfig": {
6
6
  "directory": "../../../dist/masterteam/data-table",
@@ -14,8 +14,8 @@
14
14
  "@angular/forms": "^21.2.8",
15
15
  "@jsverse/transloco": "^8.3.0",
16
16
  "primeng": "21.1.5",
17
- "@masterteam/components": "^0.0.334",
18
- "@masterteam/data-grid": "^0.0.2",
17
+ "@masterteam/components": "^0.0.335",
18
+ "@masterteam/data-grid": "^0.0.3",
19
19
  "@masterteam/icons": "^0.0.17"
20
20
  },
21
21
  "dependencies": {
@@ -34,6 +34,10 @@
34
34
  "types": "./types/masterteam-data-table.d.ts",
35
35
  "default": "./fesm2022/masterteam-data-table.mjs"
36
36
  },
37
+ "./config": {
38
+ "types": "./types/masterteam-data-table-config.d.ts",
39
+ "default": "./fesm2022/masterteam-data-table-config.mjs"
40
+ },
37
41
  "./icons": {
38
42
  "types": "./types/masterteam-data-table-icons.d.ts",
39
43
  "default": "./fesm2022/masterteam-data-table-icons.mjs"
@@ -0,0 +1,19 @@
1
+ import { InjectionToken, EnvironmentProviders } from '@angular/core';
2
+
3
+ interface MtTableScopeIdentity {
4
+ readonly application: string;
5
+ readonly tenant: string;
6
+ readonly user: string;
7
+ readonly actor: string;
8
+ readonly template?: string | number | null;
9
+ }
10
+ interface MtDataTableConfiguration {
11
+ readonly identity: () => MtTableScopeIdentity | null;
12
+ readonly direction?: () => 'ltr' | 'rtl';
13
+ }
14
+ declare const MT_DATA_TABLE_CONFIGURATION: InjectionToken<MtDataTableConfiguration>;
15
+ /** Root installation of the data-table configuration (portal and Studio). */
16
+ declare function provideMTDataTables(configuration: MtDataTableConfiguration | (() => MtDataTableConfiguration)): EnvironmentProviders;
17
+
18
+ export { MT_DATA_TABLE_CONFIGURATION, provideMTDataTables };
19
+ export type { MtDataTableConfiguration, MtTableScopeIdentity };
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { GridIconName } from '@masterteam/data-grid/tokens';
2
3
  import { HttpClient } from '@angular/common/http';
3
- import { GridIconName } from '@masterteam/data-grid';
4
4
 
5
5
  /** Populated before bootstrap from the same packaged asset map used by mt-icon. */
6
6
  declare const gridDsIcons: Partial<Record<GridIconName, string>>;
@@ -2,8 +2,9 @@ import { MtTableText } from '@masterteam/data-table';
2
2
  export * from '@masterteam/data-table';
3
3
  import { MtSortModel, MtFilterModel, MtColDef, MtCreateRangeChartParams, MtChartModel, MtGridApi, MtGridViewState, MtColumnDef, MtCellRenderer, MtDetailCellRendererParams, MtDataGridComponent, MtSideBar, MtContextMenuItem } from '@masterteam/data-grid';
4
4
  import { TableAction } from '@masterteam/components/table';
5
+ import { MtTableScopeIdentity } from '@masterteam/data-table/config';
6
+ export { MT_DATA_TABLE_CONFIGURATION, MtDataTableConfiguration, MtTableScopeIdentity, provideMTDataTables } from '@masterteam/data-table/config';
5
7
  import * as _angular_core from '@angular/core';
6
- import { InjectionToken, EnvironmentProviders } from '@angular/core';
7
8
  import { MTMenuItem } from '@masterteam/components/menu';
8
9
 
9
10
  /** Actions are supplied after business permission checks; the wrapper rechecks availability on execution. */
@@ -14,17 +15,7 @@ interface MtTableRowAction<T> extends Omit<TableAction, 'action' | 'hidden' | 'l
14
15
  readonly loading?: boolean | ((row: T) => boolean);
15
16
  }
16
17
  type MtDataTableProfile = 'compact' | 'studio' | 'embedded';
17
- interface MtTableScopeIdentity {
18
- readonly application: string;
19
- readonly tenant: string;
20
- readonly user: string;
21
- readonly actor: string;
22
- readonly template?: string | number | null;
23
- }
24
- interface MtDataTableConfiguration {
25
- readonly identity: () => MtTableScopeIdentity | null;
26
- readonly direction?: () => 'ltr' | 'rtl';
27
- }
18
+
28
19
  interface MtTableQuery {
29
20
  readonly offset: number;
30
21
  readonly limit: number;
@@ -76,11 +67,6 @@ interface MtTableExporter<T> {
76
67
  readonly export: (request: MtTableExportRequest<T>, signal: AbortSignal) => Promise<void>;
77
68
  }
78
69
 
79
- declare const MT_DATA_TABLE_CONFIGURATION: InjectionToken<MtDataTableConfiguration>;
80
-
81
- /** Root installation of the data-table configuration and preferences (portal and Studio). */
82
- declare function provideMTDataTables(configuration: MtDataTableConfiguration | (() => MtDataTableConfiguration)): EnvironmentProviders;
83
-
84
70
  /** A shared, cancellable FIFO scheduler. Collapsing one record never cancels another. */
85
71
  declare class MtDatasetScheduler {
86
72
  private readonly concurrency;
@@ -267,5 +253,5 @@ declare class MtDataTableComponent<T extends object> {
267
253
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MtDataTableComponent<any>, "mt-data-table", never, { "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "getRowId": { "alias": "getRowId"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": false; "isSignal": true; }; "profile": { "alias": "profile"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "showHeading": { "alias": "showHeading"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "fitColumns": { "alias": "fitColumns"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "masterDetail": { "alias": "masterDetail"; "required": false; "isSignal": true; }; "detailRenderer": { "alias": "detailRenderer"; "required": false; "isSignal": true; }; "detailRendererParams": { "alias": "detailRendererParams"; "required": false; "isSignal": true; }; "isRowMaster": { "alias": "isRowMaster"; "required": false; "isSignal": true; }; "detailAutoHeight": { "alias": "detailAutoHeight"; "required": false; "isSignal": true; }; "detailHeight": { "alias": "detailHeight"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "groupable": { "alias": "groupable"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "viewIdentity": { "alias": "viewIdentity"; "required": false; "isSignal": true; }; "exporter": { "alias": "exporter"; "required": false; "isSignal": true; }; "exportFormats": { "alias": "exportFormats"; "required": false; "isSignal": true; }; }, { "columnLoadRequested": "columnLoadRequested"; "rowClick": "rowClick"; "selectionChange": "selectionChange"; "focusChange": "focusChange"; "viewStateChange": "viewStateChange"; }, never, ["[tableActions]"], true, never>;
268
254
  }
269
255
 
270
- export { MT_DATA_TABLE_CONFIGURATION, MtDataTableComponent, MtDatasetCache, MtDatasetScheduler, MtIncompleteTableError, MtTablePreferences, captureMtTableChart, loadMtTableResult, mtClientTableSource, mtTablePreferenceKey, parseMtTableCharts, provideMTDataTables, reconcileMtTableView, restoreMtTableChart };
271
- export type { MtDataTableConfiguration, MtDataTableProfile, MtSavedTableChart, MtTableCapabilities, MtTableDataSource, MtTableExportFormat, MtTableExportRequest, MtTableExporter, MtTablePage, MtTableQuery, MtTableRowAction, MtTableScopeIdentity, MtTableViewIdentity };
256
+ export { MtDataTableComponent, MtDatasetCache, MtDatasetScheduler, MtIncompleteTableError, MtTablePreferences, captureMtTableChart, loadMtTableResult, mtClientTableSource, mtTablePreferenceKey, parseMtTableCharts, reconcileMtTableView, restoreMtTableChart };
257
+ export type { MtDataTableProfile, MtSavedTableChart, MtTableCapabilities, MtTableDataSource, MtTableExportFormat, MtTableExportRequest, MtTableExporter, MtTablePage, MtTableQuery, MtTableRowAction, MtTableViewIdentity };
@@ -113,6 +113,9 @@ declare function mtIsControlColumn<T>(column: MtColumnDef<T>): boolean;
113
113
  * replace the header: custom header renderers are dropped and floating filters stay off,
114
114
  * because filtering lives in the header's filter button.
115
115
  *
116
+ * Data columns also resize without an upper limit (a page's `maxWidth` is dropped), so a
117
+ * user can always widen a column to read it. Fit-to-width still sizes them on load.
118
+ *
116
119
  * Backend limits are the only page choices kept: `sortable: false` marks a column the server
117
120
  * cannot sort (its sort indicator is hidden), and with `server` set, `filter: false` marks a
118
121
  * column the server cannot filter (its filter button is hidden). Control columns keep their