@molecule/app-data-table-ui-angular 0.0.0-stage → 0.0.1-stage

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 (35) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +982 -2
  3. package/dist/data-table-card.component.d.ts +214 -0
  4. package/dist/data-table-card.component.d.ts.map +1 -0
  5. package/dist/data-table-card.component.js +568 -0
  6. package/dist/data-table-card.component.js.map +1 -0
  7. package/dist/index.d.ts +88 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +88 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/row-with-actions.component.d.ts +76 -0
  12. package/dist/row-with-actions.component.d.ts.map +1 -0
  13. package/dist/row-with-actions.component.js +167 -0
  14. package/dist/row-with-actions.component.js.map +1 -0
  15. package/dist/slot-dom.d.ts +67 -0
  16. package/dist/slot-dom.d.ts.map +1 -0
  17. package/dist/slot-dom.js +94 -0
  18. package/dist/slot-dom.js.map +1 -0
  19. package/dist/table-empty.component.d.ts +44 -0
  20. package/dist/table-empty.component.d.ts.map +1 -0
  21. package/dist/table-empty.component.js +99 -0
  22. package/dist/table-empty.component.js.map +1 -0
  23. package/dist/table-footer.component.d.ts +55 -0
  24. package/dist/table-footer.component.d.ts.map +1 -0
  25. package/dist/table-footer.component.js +138 -0
  26. package/dist/table-footer.component.js.map +1 -0
  27. package/dist/table-toolbar.component.d.ts +77 -0
  28. package/dist/table-toolbar.component.d.ts.map +1 -0
  29. package/dist/table-toolbar.component.js +195 -0
  30. package/dist/table-toolbar.component.js.map +1 -0
  31. package/dist/types.d.ts +100 -0
  32. package/dist/types.d.ts.map +1 -0
  33. package/dist/types.js +13 -0
  34. package/dist/types.js.map +1 -0
  35. package/package.json +69 -4
@@ -0,0 +1,214 @@
1
+ import { type AfterViewInit, type DoCheck, type TemplateRef } from '@angular/core';
2
+ import type { UIClassMap } from '@molecule/app-ui';
3
+ import type { DataTableColumn } from './types.js';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * DataTableCard component.
7
+ *
8
+ * Drop-in card-shaped data table matching the polished flagship pattern — the
9
+ * Angular counterpart of `@molecule/app-data-table-ui-react`'s
10
+ * `DataTableCard`: the same props (React names), the same ClassMap tokens, and
11
+ * the same DOM for the same input. The host IS the outer `<section>`
12
+ * (`section[mol-data-table-card]`), matching React's root exactly.
13
+ *
14
+ * Renders an optional title row (title + action), then a card-wrapped table
15
+ * with uppercase headers, divided rows, a 5-row loading skeleton and a single
16
+ * spanning empty cell. Rows are keyed by `rowKey(row)` (React's
17
+ * `key={rowKey(row)}`), so a row keeps its DOM node while its key is unchanged.
18
+ *
19
+ * Column `cell` templates receive the row as `$implicit` and `a0`; a column
20
+ * `header` may be text or a `TemplateRef`. Node props (`title`, `titleAction`,
21
+ * `emptyMessage`) may be `[slot=…]` content, a `TemplateRef`, or text.
22
+ */
23
+ export declare class DataTableCard<T = unknown> implements AfterViewInit, DoCheck {
24
+ /** Optional title above the table chrome (text, a `TemplateRef`, or `[slot=title]` content). */
25
+ title?: unknown;
26
+ /** Right-aligned action in the title row (a `TemplateRef` or `[slot=titleAction]` content). */
27
+ titleAction?: unknown;
28
+ /** Column definitions. */
29
+ columns: ReadonlyArray<DataTableColumn<T>>;
30
+ /** Rows to render. */
31
+ rows: ReadonlyArray<T>;
32
+ /** Pull a stable key from a row (React's `key={rowKey(row)}`). */
33
+ rowKey?: (row: T) => string;
34
+ /** When true, renders 5 skeleton rows instead of `rows`. */
35
+ loading?: boolean;
36
+ /** Optional click handler per row. */
37
+ onRowClick?: (row: T) => void;
38
+ /** Empty-state content (text, a `TemplateRef`, or `[slot=emptyMessage]` content). */
39
+ emptyMessage?: unknown;
40
+ /** Extra classes on the outer card. */
41
+ className?: string;
42
+ /** `data-mol-id` for AI-agent selectors. */
43
+ dataMolId?: string;
44
+ /** The index list of the five skeleton rows. */
45
+ readonly skeletonIndexes: number[];
46
+ /** The title row wrapper, detached while React renders no title row. */
47
+ private headerRow?;
48
+ /** The `<h3>`, detached while React renders no title. */
49
+ private titleHeading?;
50
+ private readonly renderer;
51
+ private readonly conditional;
52
+ /**
53
+ * The current class map.
54
+ * @returns The UIClassMap.
55
+ */
56
+ cm(): UIClassMap;
57
+ /**
58
+ * The card's class list (React's `cm.cn(cm.stack(4), cm.dataTableCardShell, className)`).
59
+ * @returns The class string.
60
+ */
61
+ classes(): string;
62
+ /**
63
+ * The title row's class list (`flex between/center` + `px-8` + `pt-8`).
64
+ * @returns The class string.
65
+ */
66
+ headerRowClasses(): string;
67
+ /**
68
+ * The title's class list (`text-xl` + `bold` + the card title token).
69
+ * @returns The class string.
70
+ */
71
+ titleClasses(): string;
72
+ /**
73
+ * The scroller's class list (`overflow-x-auto`).
74
+ * @returns The class string.
75
+ */
76
+ scrollerClasses(): string;
77
+ /**
78
+ * The table's class list (`w-full` + the card table token).
79
+ * @returns The class string.
80
+ */
81
+ tableClasses(): string;
82
+ /**
83
+ * The header row's class list (the card head token).
84
+ * @returns The class string.
85
+ */
86
+ headClasses(): string;
87
+ /**
88
+ * One header cell's class list (first column `px-8`, the rest `px-4`, plus
89
+ * the column's own classes).
90
+ * @param column - The column.
91
+ * @param index - The column's index.
92
+ * @returns The class string.
93
+ */
94
+ headerCellClasses(column: DataTableColumn<T>, index: number): string;
95
+ /**
96
+ * The body's class list (the card body token).
97
+ * @returns The class string.
98
+ */
99
+ bodyClasses(): string;
100
+ /**
101
+ * A skeleton cell's class list (`px-8` + `py-5`).
102
+ * @returns The class string.
103
+ */
104
+ skeletonCellClasses(): string;
105
+ /**
106
+ * A skeleton bar's class list (`h-4` + the skeleton token).
107
+ * @returns The class string.
108
+ */
109
+ skeletonBarClasses(): string;
110
+ /**
111
+ * The empty cell's class list (`px-8 py-12 text-center` + the empty token).
112
+ * @returns The class string.
113
+ */
114
+ emptyCellClasses(): string;
115
+ /**
116
+ * A body row's class list: React adds `cursor-pointer` only when the row is
117
+ * clickable, then the hover token.
118
+ * @returns The class string.
119
+ */
120
+ rowClasses(): string;
121
+ /**
122
+ * One body cell's class list (first column `px-8`, the rest `px-4`, plus the
123
+ * column's own classes).
124
+ * @param column - The column.
125
+ * @param index - The column's index.
126
+ * @returns The class string.
127
+ */
128
+ cellClasses(column: DataTableColumn<T>, index: number): string;
129
+ /**
130
+ * The title's text (React's `{title}` for a text title).
131
+ * @returns The text, or `''` for a node title.
132
+ */
133
+ titleText(): string;
134
+ /**
135
+ * The title's template, when the caller passed a node.
136
+ * @returns The template, or null.
137
+ */
138
+ titleTemplate(): TemplateRef<unknown> | null;
139
+ /**
140
+ * The title action's text (React's `{titleAction}` for text).
141
+ * @returns The text, or `''` for a node action.
142
+ */
143
+ titleActionText(): string;
144
+ /**
145
+ * The title action's template, when the caller passed a node.
146
+ * @returns The template, or null.
147
+ */
148
+ titleActionTemplate(): TemplateRef<unknown> | null;
149
+ /**
150
+ * The empty state's text (React's `{emptyMessage}` for text).
151
+ * @returns The text, or `''` for a node empty state.
152
+ */
153
+ emptyText(): string;
154
+ /**
155
+ * The empty state's template, when the caller passed a node.
156
+ * @returns The template, or null.
157
+ */
158
+ emptyTemplate(): TemplateRef<unknown> | null;
159
+ /**
160
+ * One column's header template, when the caller passed a node.
161
+ * @param column - The column.
162
+ * @returns The template, or null for a text header.
163
+ */
164
+ headerTemplate(column: DataTableColumn<T>): TemplateRef<unknown> | null;
165
+ /**
166
+ * One column's header text (React's `{col.header}` for a text header).
167
+ * @param column - The column.
168
+ * @returns The text, or `''` for a node header.
169
+ */
170
+ headerText(column: DataTableColumn<T>): string;
171
+ /**
172
+ * One column's cell template.
173
+ * @param column - The column.
174
+ * @returns The template, or null.
175
+ */
176
+ cellTemplate(column: DataTableColumn<T>): TemplateRef<unknown> | null;
177
+ /**
178
+ * The template context for one row: the row as `$implicit` and `a0`
179
+ * (React calls `cell(row)`).
180
+ * @param row - The row.
181
+ * @returns The template context.
182
+ */
183
+ rowContext(row: T): Record<string, unknown>;
184
+ /**
185
+ * The key a row is tracked by (React's `key={rowKey(row)}`).
186
+ * @param row - The row.
187
+ * @returns The row's key.
188
+ */
189
+ trackKey(row: T): string;
190
+ /**
191
+ * Runs the row's click handler the way React's `onClick` does.
192
+ * @param row - The clicked row.
193
+ */
194
+ clickRow(row: T): void;
195
+ /** Reconciles the title row once the view (and its projected content) exists. */
196
+ ngAfterViewInit(): void;
197
+ /** Re-reconciles the title row after input writes. */
198
+ ngDoCheck(): void;
199
+ /**
200
+ * Keeps the title row and the `<h3>` in the DOM exactly while React renders
201
+ * them: the row when a title or a title action exists, the heading when a
202
+ * title exists.
203
+ */
204
+ private syncVisibility;
205
+ /**
206
+ * Whether React renders a title action: the prop, or `[slot=titleAction]`
207
+ * content beside the heading.
208
+ * @returns True when an action renders.
209
+ */
210
+ private hasTitleAction;
211
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableCard<any>, never>;
212
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableCard<any>, "section[mol-data-table-card]", never, { "title": { "alias": "title"; "required": false; }; "titleAction": { "alias": "titleAction"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "rowKey": { "alias": "rowKey"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "onRowClick": { "alias": "onRowClick"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; }, {}, never, ["[slot=title]", "[slot=titleAction]", "[slot=emptyMessage]"], true, never>;
213
+ }
214
+ //# sourceMappingURL=data-table-card.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table-card.component.d.ts","sourceRoot":"","sources":["../src/data-table-card.component.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EAIZ,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;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