@table-bro/angular-material 0.0.0-stage → 1.1.0

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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -2
  3. package/THIRD_PARTY_NOTICES.md +69 -0
  4. package/dist/table-bro.material.min.css +1 -0
  5. package/fesm2022/table-bro-angular-material.mjs +2050 -0
  6. package/fesm2022/table-bro-angular-material.mjs.map +1 -0
  7. package/package.json +49 -3
  8. package/styles/_table-bro.api.scss +3 -0
  9. package/styles/_table-bro.material.api.scss +5 -0
  10. package/styles/mixins/_text-ellipsis.scss +5 -0
  11. package/styles/skin/angular-material/_themes.scss +29 -0
  12. package/styles/skin/angular-material/_variables.scss +81 -0
  13. package/styles/skin/angular-material/components/_shadows.scss +7 -0
  14. package/styles/skin/angular-material/table-bro/_filter-drawer.scss +111 -0
  15. package/styles/skin/angular-material/table-bro/_paginator.scss +12 -0
  16. package/styles/skin/angular-material/table-bro/_progress-bar.scss +7 -0
  17. package/styles/skin/angular-material/table-bro/_slide-toggle.scss +5 -0
  18. package/styles/skin/angular-material/table-bro/_sort-header.scss +12 -0
  19. package/styles/skin/angular-material/table-bro/_table.scss +68 -0
  20. package/styles/skin/angular-material/table-bro/_text-ellipsis.scss +8 -0
  21. package/styles/skin/angular-material/table-bro/_toolbar-search.scss +27 -0
  22. package/styles/skin/angular-material/table-bro/_toolbar.scss +14 -0
  23. package/styles/skin/shared/_variables.scss +94 -0
  24. package/styles/skin/shared/mixins/_custom-properties.scss +39 -0
  25. package/styles/skin/shared/mixins/_progress-bar.scss +27 -0
  26. package/styles/skin/shared/mixins/_shared.scss +87 -0
  27. package/styles/skin/shared/mixins/_skin-colors.scss +64 -0
  28. package/styles/skin/shared/mixins/_slide-toggle.scss +5 -0
  29. package/styles/skin/shared/mixins/_sort-header.scss +11 -0
  30. package/styles/skin/shared/mixins/_toolbar.scss +61 -0
  31. package/styles/skin/shared/table-bro/_details.scss +11 -0
  32. package/styles/skin/shared/table-bro/_filter-drawer.scss +62 -0
  33. package/styles/skin/shared/table-bro/_shadows.scss +19 -0
  34. package/styles/skin/shared/table-bro/_state.scss +38 -0
  35. package/styles/skin/shared/table-bro/_table.scss +70 -0
  36. package/styles/skin/shared/table-bro/_text-ellipsis.scss +14 -0
  37. package/styles/table-bro.material.scss +74 -0
  38. package/types/table-bro-angular-material.d.ts +482 -0
@@ -0,0 +1,482 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, Type } from "@angular/core";
3
+ import { BroActionDetail, BroButton, BroCol, BroColDataType, BroColSort, BroConfig, BroDropdown, BroEmptyState, BroFilters, BroQuery, BroResolvedConfig, BroRow, BroUserTheme } from "@table-bro/core";
4
+ import { Sort, SortDirection, SortHeaderArrowPosition } from "@angular/material/sort";
5
+ import { MatDrawerMode } from "@angular/material/sidenav";
6
+ import { BroServerFacade } from "@table-bro/angular";
7
+ export declare const matSkinConfig: {
8
+ css: {
9
+ table: {
10
+ className: string;
11
+ thead: {
12
+ tr: {
13
+ className: string;
14
+ th: {
15
+ className: string;
16
+ };
17
+ };
18
+ };
19
+ tbody: {
20
+ tr: {
21
+ className: string;
22
+ td: {
23
+ className: string;
24
+ };
25
+ };
26
+ };
27
+ };
28
+ shadow: {
29
+ className: string;
30
+ };
31
+ };
32
+ components: {
33
+ button: {
34
+ selector: string;
35
+ iconSelector: string;
36
+ beforeRender: (element: Element, value: string) => void;
37
+ };
38
+ filterDrawer: {};
39
+ fontIcon: {
40
+ html: (materialIcon: string) => string;
41
+ };
42
+ paginator: {
43
+ selector: string;
44
+ inputsAsProperties: true;
45
+ recreateOnReplaceRows: true;
46
+ };
47
+ progressBar: {
48
+ selector: string;
49
+ };
50
+ sortHeader: {
51
+ selector: string;
52
+ titleAsContent: true;
53
+ contentSelector: string;
54
+ };
55
+ state: {
56
+ fontIcon: true;
57
+ states: {
58
+ loading: [string, string];
59
+ 'no-data': [string, string];
60
+ 'not-found': [string, string];
61
+ fail: [string, string];
62
+ };
63
+ };
64
+ switch: {
65
+ selector: string;
66
+ };
67
+ textEllipsis: {
68
+ selector: string;
69
+ };
70
+ toolbar: {
71
+ selector: string;
72
+ };
73
+ toolbarMain: {
74
+ selector: string;
75
+ };
76
+ toolbarSearch: {
77
+ beforeRender: (backButton: Element, clearButton: Element) => void;
78
+ };
79
+ };
80
+ };
81
+ /** The button of the skin, the element bro-mat-button with the properties of BroButton. */
82
+ export declare class BroMaterialButtonComponent {
83
+ readonly buttonClassName: import("@angular/core").InputSignal<string | null | undefined>;
84
+ readonly buttonTitle: import("@angular/core").InputSignal<string>;
85
+ readonly eventType: import("@angular/core").InputSignal<string>;
86
+ readonly icon: import("@angular/core").InputSignal<string | undefined>;
87
+ /** The name of a button without a title: the table gives it as the attribute label, not aria-label on the element. */
88
+ readonly label: import("@angular/core").InputSignal<string | undefined>;
89
+ readonly action: import("@angular/core").OutputEmitterRef<string>;
90
+ onClickButton(): void;
91
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialButtonComponent, never>;
92
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialButtonComponent, "ng-component", never, {
93
+ "buttonClassName": {
94
+ "alias": "button-class";
95
+ "required": false;
96
+ "isSignal": true;
97
+ };
98
+ "buttonTitle": {
99
+ "alias": "button-title";
100
+ "required": false;
101
+ "isSignal": true;
102
+ };
103
+ "eventType": {
104
+ "alias": "event-type";
105
+ "required": false;
106
+ "isSignal": true;
107
+ };
108
+ "icon": {
109
+ "alias": "icon";
110
+ "required": false;
111
+ "isSignal": true;
112
+ };
113
+ "label": {
114
+ "alias": "label";
115
+ "required": false;
116
+ "isSignal": true;
117
+ };
118
+ }, {
119
+ "action": "action";
120
+ }, never, never, true, never>;
121
+ }
122
+ /**
123
+ * A switch of a boolean of a cell. A change sends the action of the attribute name in the output action, which the
124
+ * table turns into bro-action with the column and the row (event: 'action' of the column); the title of the column
125
+ * names the switch for screen readers.
126
+ */
127
+ export declare class BroMaterialSlideToggleComponent<T extends object = BroRow> {
128
+ readonly col: import("@angular/core").InputSignal<BroCol<T> | undefined>;
129
+ readonly row: import("@angular/core").InputSignal<T | undefined>;
130
+ /** The action of a change. */
131
+ readonly name: import("@angular/core").InputSignal<string | undefined>;
132
+ readonly action: import("@angular/core").OutputEmitterRef<string>;
133
+ /** The value of the field of the column in the row. */
134
+ readonly checked: import("@angular/core").Signal<boolean>;
135
+ onChange(): void;
136
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialSlideToggleComponent<any>, never>;
137
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialSlideToggleComponent<any>, "ng-component", never, {
138
+ "col": {
139
+ "alias": "col";
140
+ "required": false;
141
+ "isSignal": true;
142
+ };
143
+ "row": {
144
+ "alias": "row";
145
+ "required": false;
146
+ "isSignal": true;
147
+ };
148
+ "name": {
149
+ "alias": "name";
150
+ "required": false;
151
+ "isSignal": true;
152
+ };
153
+ }, {
154
+ "action": "action";
155
+ }, never, never, true, never>;
156
+ }
157
+ /** The sort header of a column, the element bro-mat-sort-header with the properties of BroSortHeader. */
158
+ export declare class BroMaterialSortHeaderComponent {
159
+ /** The active sort of the table: a sort of another column resets the arrow of this header. */
160
+ readonly activeSort: import("@angular/core").InputSignal<BroColSort<import("@table-bro/core").BroRow> | undefined>;
161
+ readonly arrowPosition: import("@angular/core").InputSignal<SortHeaderArrowPosition>;
162
+ readonly dataType: import("@angular/core").InputSignal<BroColDataType | undefined>;
163
+ readonly headerTitle: import("@angular/core").InputSignal<string>;
164
+ readonly sortId: import("@angular/core").InputSignal<string>;
165
+ readonly tooltip: import("@angular/core").InputSignal<string>;
166
+ /** The key of the column, or an own one of the header. */
167
+ readonly id: import("@angular/core").Signal<string>;
168
+ readonly matSortDirection: import("@angular/core").WritableSignal<SortDirection>;
169
+ private readonly elementRef;
170
+ private readonly sortHeader;
171
+ private sortedDirection;
172
+ constructor();
173
+ onSort(event: Sort): void;
174
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialSortHeaderComponent, never>;
175
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialSortHeaderComponent, "ng-component", never, {
176
+ "activeSort": {
177
+ "alias": "activeSort";
178
+ "required": false;
179
+ "isSignal": true;
180
+ };
181
+ "arrowPosition": {
182
+ "alias": "arrow-position";
183
+ "required": false;
184
+ "isSignal": true;
185
+ };
186
+ "dataType": {
187
+ "alias": "data-type";
188
+ "required": false;
189
+ "isSignal": true;
190
+ };
191
+ "headerTitle": {
192
+ "alias": "header-title";
193
+ "required": false;
194
+ "isSignal": true;
195
+ };
196
+ "sortId": {
197
+ "alias": "sort-id";
198
+ "required": false;
199
+ "isSignal": true;
200
+ };
201
+ "tooltip": {
202
+ "alias": "tooltip";
203
+ "required": false;
204
+ "isSignal": true;
205
+ };
206
+ }, {}, never, ["*"], true, never>;
207
+ }
208
+ /** The tags of a cell: the items of the field of the column, as the chips of Material. */
209
+ export declare class BroMaterialTagsComponent {
210
+ readonly col: import("@angular/core").InputSignal<BroCol<BroRow> | undefined>;
211
+ readonly row: import("@angular/core").InputSignal<BroRow | undefined>;
212
+ /** The config of the table, which the table gives the elements of its cells: the text of a cell without items. */
213
+ readonly config: import("@angular/core").InputSignal<BroResolvedConfig | undefined>;
214
+ /** The items of the field of the column in the row. */
215
+ readonly chipList: import("@angular/core").Signal<string[]>;
216
+ private readonly elementRef;
217
+ /** Stops fitting the chips into the line when the component goes. */
218
+ private readonly fitting;
219
+ constructor();
220
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialTagsComponent, never>;
221
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialTagsComponent, "ng-component", never, {
222
+ "col": {
223
+ "alias": "col";
224
+ "required": false;
225
+ "isSignal": true;
226
+ };
227
+ "row": {
228
+ "alias": "row";
229
+ "required": false;
230
+ "isSignal": true;
231
+ };
232
+ "config": {
233
+ "alias": "config";
234
+ "required": false;
235
+ "isSignal": true;
236
+ };
237
+ }, {}, never, never, true, never>;
238
+ }
239
+ /** A value wider than its column, with the whole value in a tooltip: the element bro-mat-text-ellipsis of BroTextEllipsis. */
240
+ export declare class BroMaterialTextEllipsisComponent {
241
+ /** The column of the cell: with html: true the value is markup. */
242
+ readonly col: import("@angular/core").InputSignal<BroCol<import("@table-bro/core").BroRow> | undefined>;
243
+ readonly containerClassName: import("@angular/core").InputSignal<string | null>;
244
+ readonly value: import("@angular/core").InputSignal<string>;
245
+ /** The text of the value: the text of the markup of an HTML value. */
246
+ readonly tooltip: import("@angular/core").Signal<string>;
247
+ readonly tableCellTextEllipsisContainer: string;
248
+ readonly tableCellTextEllipsis: string;
249
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialTextEllipsisComponent, never>;
250
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialTextEllipsisComponent, "ng-component", never, {
251
+ "col": {
252
+ "alias": "col";
253
+ "required": false;
254
+ "isSignal": true;
255
+ };
256
+ "containerClassName": {
257
+ "alias": "container-class";
258
+ "required": false;
259
+ "isSignal": true;
260
+ };
261
+ "value": {
262
+ "alias": "value";
263
+ "required": false;
264
+ "isSignal": true;
265
+ };
266
+ }, {}, never, never, true, never>;
267
+ }
268
+ /**
269
+ * The table with the filter drawer of the mat skin: mat-drawer-container with <table-bro-ng> in its content and the filters
270
+ * of the application, the content of this component, in mat-drawer. It takes the inputs and gives the outputs
271
+ * of <table-bro-ng>. The Filters button of the table toolbar opens the drawer, any other button of the page calls toggle().
272
+ * Material opens the drawer and narrows the table in the side mode; the card of the skin in the drawer grows
273
+ * from its right edge. A table that would get narrower than its minimum width next to the drawer keeps its width:
274
+ * the drawer lies over it in the mode over, with the scrim of Material, as the modal side sheet of Material 3.
275
+ */
276
+ export declare class TableBroFilterDrawerContainerNg<MODEL extends object> implements BroServerFacade<MODEL> {
277
+ cols: import("@angular/core").InputSignal<BroCol<MODEL>[]>;
278
+ rows: import("@angular/core").InputSignal<MODEL[] | null | undefined>;
279
+ conf: import("@angular/core").InputSignal<BroConfig<MODEL>>;
280
+ total: import("@angular/core").InputSignal<number | undefined>;
281
+ rowsToAppend: import("@angular/core").InputSignal<MODEL[] | undefined>;
282
+ loading: import("@angular/core").InputSignal<boolean>;
283
+ failed: import("@angular/core").InputSignal<boolean>;
284
+ filter: import("@angular/core").InputSignal<BroFilters<MODEL> | undefined>;
285
+ emptyState: import("@angular/core").InputSignal<BroEmptyState | undefined>;
286
+ tableId: import("@angular/core").InputSignal<string | undefined>;
287
+ theme: import("@angular/core").InputSignal<BroUserTheme | null | undefined>;
288
+ action: import("@angular/core").OutputEmitterRef<BroActionDetail<MODEL>>;
289
+ query: import("@angular/core").OutputEmitterRef<BroQuery<MODEL, object>>;
290
+ /** Whether the drawer is opened; [(opened)] binds it both ways. */
291
+ opened: import("@angular/core").ModelSignal<boolean>;
292
+ /**
293
+ * The mode of mat-drawer: side, by default, narrows the content, and the drawer lies over a table that would get
294
+ * narrower than its minimum width; over lies over the table always, with the scrim of Material; push as in Material.
295
+ */
296
+ mode: import("@angular/core").InputSignal<MatDrawerMode>;
297
+ /** The drawer lies over a table that would not keep its minimum width next to it. */
298
+ protected over: import("@angular/core").WritableSignal<boolean>;
299
+ protected drawerMode: import("@angular/core").Signal<MatDrawerMode>;
300
+ /** With shadows the table lets them into its margins and takes the full width; the card has the shadow too. */
301
+ protected shadowsEnabled: import("@angular/core").Signal<boolean>;
302
+ /** The class of the shadow of the skin config, as the card of the drawer of the core takes it. */
303
+ protected shadowClassName: import("@angular/core").Signal<string>;
304
+ /** The texts of the config of the table: the title of the drawer and the name of its close button. */
305
+ protected texts: import("@angular/core").Signal<import("@table-bro/core").BroTexts>;
306
+ /** The host of the table has the class of the dark theme: the container takes it too, as the drawer of the core does. */
307
+ protected dark: import("@angular/core").WritableSignal<boolean>;
308
+ /** The host of the table has the class of its own light theme: the container stays light under a dark ancestor too. */
309
+ protected light: import("@angular/core").WritableSignal<boolean>;
310
+ private host;
311
+ private container;
312
+ private content;
313
+ private drawer;
314
+ private drawerElement;
315
+ constructor();
316
+ toggle(): void;
317
+ /** The Filters button of the table toolbar opens the drawer; every action goes on to the page. */
318
+ protected onTableAction(event: BroActionDetail<MODEL>): void;
319
+ /**
320
+ * Opens or closes the drawer and narrows the content in the same frame. Material narrows it on transitionrun
321
+ * of the drawer, a frame later, so the space between the table and the card would change while they move.
322
+ */
323
+ protected setOpened(opened: boolean): void;
324
+ /**
325
+ * Moves the opened drawer over the table when the table would get narrower than its minimum width next to it, and
326
+ * back next to it when it fits again: the table takes its new width at once, and the scrim of Material comes or goes
327
+ * by its transition; the drawer keeps its place at the right edge.
328
+ */
329
+ private fitMode;
330
+ /** The table keeps at least its minimum width next to the opened drawer: the width of the drawer holds its space. */
331
+ private fitsNextToDrawer;
332
+ /**
333
+ * Gives the table at once the width it has at the end of the transition: the drawer has a fixed width, so the columns
334
+ * take their new widths right at the click and come with the table. In the side mode Material narrows the content
335
+ * by the width of the drawer; during a transition the content counts from its margin at this moment.
336
+ */
337
+ private fitTableColumns;
338
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableBroFilterDrawerContainerNg<any>, never>;
339
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableBroFilterDrawerContainerNg<any>, "table-bro-filter-drawer-container-ng", never, {
340
+ "cols": {
341
+ "alias": "cols";
342
+ "required": true;
343
+ "isSignal": true;
344
+ };
345
+ "rows": {
346
+ "alias": "rows";
347
+ "required": true;
348
+ "isSignal": true;
349
+ };
350
+ "conf": {
351
+ "alias": "conf";
352
+ "required": true;
353
+ "isSignal": true;
354
+ };
355
+ "total": {
356
+ "alias": "total";
357
+ "required": false;
358
+ "isSignal": true;
359
+ };
360
+ "rowsToAppend": {
361
+ "alias": "rowsToAppend";
362
+ "required": false;
363
+ "isSignal": true;
364
+ };
365
+ "loading": {
366
+ "alias": "loading";
367
+ "required": false;
368
+ "isSignal": true;
369
+ };
370
+ "failed": {
371
+ "alias": "failed";
372
+ "required": false;
373
+ "isSignal": true;
374
+ };
375
+ "filter": {
376
+ "alias": "filter";
377
+ "required": false;
378
+ "isSignal": true;
379
+ };
380
+ "emptyState": {
381
+ "alias": "emptyState";
382
+ "required": false;
383
+ "isSignal": true;
384
+ };
385
+ "tableId": {
386
+ "alias": "tableId";
387
+ "required": false;
388
+ "isSignal": true;
389
+ };
390
+ "theme": {
391
+ "alias": "theme";
392
+ "required": false;
393
+ "isSignal": true;
394
+ };
395
+ "opened": {
396
+ "alias": "opened";
397
+ "required": false;
398
+ "isSignal": true;
399
+ };
400
+ "mode": {
401
+ "alias": "mode";
402
+ "required": false;
403
+ "isSignal": true;
404
+ };
405
+ }, {
406
+ "action": "action";
407
+ "query": "query";
408
+ "opened": "openedChange";
409
+ }, never, ["*"], true, never>;
410
+ }
411
+ /** The toolbar of a table: its title, its search and the buttons and the menu of the config. */
412
+ export declare class BroMaterialToolbarMainComponent {
413
+ /** The config of the table: the name of the search button. */
414
+ readonly config: import("@angular/core").InputSignal<BroResolvedConfig | undefined>;
415
+ readonly buttons: import("@angular/core").InputSignal<string>;
416
+ readonly title: import("@angular/core").InputSignal<string>;
417
+ readonly action: import("@angular/core").OutputEmitterRef<string>;
418
+ /** The buttons and the one menu of the config. */
419
+ private readonly toolbarButtons;
420
+ readonly mainButtons: import("@angular/core").Signal<BroButton[]>;
421
+ readonly dropdown: import("@angular/core").Signal<BroDropdown | undefined>;
422
+ onClickSearch(): void;
423
+ onClickButton(action: string): void;
424
+ /** The element of the menu sends the value of its item as the detail of its event action. */
425
+ onMenuAction(event: Event): void;
426
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialToolbarMainComponent, never>;
427
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialToolbarMainComponent, "ng-component", never, {
428
+ "config": {
429
+ "alias": "config";
430
+ "required": false;
431
+ "isSignal": true;
432
+ };
433
+ "buttons": {
434
+ "alias": "buttons";
435
+ "required": false;
436
+ "isSignal": true;
437
+ };
438
+ "title": {
439
+ "alias": "title";
440
+ "required": false;
441
+ "isSignal": true;
442
+ };
443
+ }, {
444
+ "action": "bro-toolbar";
445
+ }, never, never, true, never>;
446
+ }
447
+ /**
448
+ * The menu of the toolbar, the element bro-mat-toolbar-more of withToolbarMenu(): a button with the title of the menu as
449
+ * its name, and the items that send their values.
450
+ */
451
+ export declare class BroMaterialToolbarMoreComponent {
452
+ readonly dropdown: import("@angular/core").InputSignal<BroDropdown | undefined>;
453
+ readonly action: import("@angular/core").OutputEmitterRef<string>;
454
+ onClickButton(action: string | undefined): void;
455
+ static ɵfac: i0.ɵɵFactoryDeclaration<BroMaterialToolbarMoreComponent, never>;
456
+ static ɵcmp: i0.ɵɵComponentDeclaration<BroMaterialToolbarMoreComponent, "ng-component", never, {
457
+ "dropdown": {
458
+ "alias": "dropdown";
459
+ "required": false;
460
+ "isSignal": true;
461
+ };
462
+ }, {
463
+ "action": "action";
464
+ }, never, never, true, never>;
465
+ }
466
+ /** An optional element of the skin mat for provideTableBroMatSkin(): its tag and its component. */
467
+ export interface TableBroMatSkinFeature {
468
+ /** The tag of the element and its component. */
469
+ readonly elements: Record<string, Type<unknown>>;
470
+ }
471
+ /**
472
+ * Connects the skin mat: registers its config and defines its elements when the application starts. A feature adds
473
+ * an optional element, which only a table with a certain config uses, so a table without it does not carry its code.
474
+ * @param features - the optional elements: withTags(), withSwitch(), withToolbarMenu()
475
+ */
476
+ export declare function provideTableBroMatSkin(...features: TableBroMatSkinFeature[]): EnvironmentProviders;
477
+ /** The element bro-mat-tags: the items of a column as the chips of Material. */
478
+ export declare function withTags(): TableBroMatSkinFeature;
479
+ /** The element bro-mat-slide-toggle: a boolean of a column as a slide toggle. */
480
+ export declare function withSwitch(): TableBroMatSkinFeature;
481
+ /** The menu of the toolbar: a button of toolbarMain.buttons with the mode navbar-dropdown. */
482
+ export declare function withToolbarMenu(): TableBroMatSkinFeature;