ngx-material-entity 0.1.1 → 0.1.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.
Files changed (133) hide show
  1. package/CONTRIBUTING.md +7 -1
  2. package/README.md +536 -328
  3. package/classes/base.builder.d.ts +35 -0
  4. package/classes/date.utilities.d.ts +58 -0
  5. package/classes/entity.model.d.ts +13 -0
  6. package/classes/{entity-service.class.d.ts → entity.service.d.ts} +35 -20
  7. package/classes/entity.utilities.d.ts +153 -0
  8. package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +23 -0
  9. package/components/confirm-dialog/confirm-dialog-data.d.ts +18 -8
  10. package/components/confirm-dialog/confirm-dialog.component.d.ts +15 -5
  11. package/components/get-validation-error-message.function.d.ts +3 -2
  12. package/components/input/add-array-item-dialog-data.builder.d.ts +20 -0
  13. package/components/input/add-array-item-dialog-data.d.ts +19 -0
  14. package/components/input/input.component.d.ts +151 -30
  15. package/components/input/input.module.d.ts +7 -4
  16. package/components/table/create-dialog/create-dialog-data.builder.d.ts +21 -0
  17. package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +21 -0
  18. package/components/table/create-dialog/create-entity-dialog-data.d.ts +4 -5
  19. package/components/table/create-dialog/create-entity-dialog.component.d.ts +21 -8
  20. package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +24 -0
  21. package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +7 -8
  22. package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +22 -0
  23. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +25 -8
  24. package/components/table/table-data.builder.d.ts +51 -0
  25. package/components/table/table-data.d.ts +46 -30
  26. package/components/table/table.component.d.ts +53 -7
  27. package/components/table/table.module.d.ts +3 -1
  28. package/decorators/array/array-decorator-internal.data.d.ts +45 -0
  29. package/decorators/array/array-decorator.data.d.ts +129 -0
  30. package/decorators/array/array.decorator.d.ts +9 -0
  31. package/decorators/base/base-property.decorator.d.ts +7 -6
  32. package/decorators/base/decorator-types.enum.d.ts +12 -9
  33. package/decorators/base/dropdown-value.interface.d.ts +14 -0
  34. package/decorators/base/property-decorator-internal.data.d.ts +24 -0
  35. package/decorators/base/property-decorator.data.d.ts +70 -0
  36. package/decorators/boolean/boolean-decorator-internal.data.d.ts +25 -0
  37. package/decorators/boolean/boolean-decorator.data.d.ts +37 -0
  38. package/decorators/boolean/boolean.decorator.d.ts +8 -0
  39. package/decorators/date/date-decorator-internal.data.d.ts +44 -0
  40. package/decorators/date/date-decorator.data.d.ts +129 -0
  41. package/decorators/number/number-decorator-internal.data.d.ts +20 -0
  42. package/decorators/number/number-decorator.data.d.ts +36 -0
  43. package/decorators/number/number.decorator.d.ts +8 -0
  44. package/decorators/object/object-decorator-internal.data.d.ts +11 -0
  45. package/decorators/object/object-decorator.data.d.ts +25 -0
  46. package/decorators/object/object.decorator.d.ts +8 -0
  47. package/decorators/string/string-decorator-internal.data.d.ts +41 -0
  48. package/decorators/string/string-decorator.data.d.ts +77 -0
  49. package/decorators/string/string.decorator.d.ts +8 -0
  50. package/esm2020/classes/base.builder.mjs +43 -0
  51. package/esm2020/classes/date.utilities.mjs +138 -0
  52. package/esm2020/classes/entity.model.mjs +19 -0
  53. package/esm2020/classes/entity.service.mjs +83 -0
  54. package/esm2020/classes/entity.utilities.mjs +538 -0
  55. package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +44 -0
  56. package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
  57. package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +18 -22
  58. package/esm2020/components/get-validation-error-message.function.mjs +8 -3
  59. package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +30 -0
  60. package/esm2020/components/input/add-array-item-dialog-data.mjs +2 -0
  61. package/esm2020/components/input/input.component.mjs +240 -36
  62. package/esm2020/components/input/input.module.mjs +23 -9
  63. package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +32 -0
  64. package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +26 -0
  65. package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
  66. package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +31 -31
  67. package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +20 -4
  68. package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +41 -0
  69. package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
  70. package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +27 -0
  71. package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +45 -49
  72. package/esm2020/components/table/table-data.builder.mjs +105 -0
  73. package/esm2020/components/table/table-data.mjs +1 -1
  74. package/esm2020/components/table/table.component.mjs +91 -83
  75. package/esm2020/components/table/table.module.mjs +12 -4
  76. package/esm2020/decorators/array/array-decorator-internal.data.mjs +51 -0
  77. package/esm2020/decorators/array/array-decorator.data.mjs +7 -0
  78. package/esm2020/decorators/array/array.decorator.mjs +24 -0
  79. package/esm2020/decorators/base/base-property.decorator.mjs +6 -5
  80. package/esm2020/decorators/base/decorator-types.enum.mjs +4 -1
  81. package/esm2020/decorators/base/dropdown-value.interface.mjs +2 -0
  82. package/esm2020/decorators/base/property-decorator-internal.data.mjs +38 -0
  83. package/esm2020/decorators/base/property-decorator.data.mjs +6 -0
  84. package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +33 -0
  85. package/esm2020/decorators/boolean/boolean-decorator.data.mjs +7 -0
  86. package/esm2020/decorators/boolean/boolean.decorator.mjs +21 -0
  87. package/esm2020/decorators/date/date-decorator-internal.data.mjs +48 -0
  88. package/esm2020/decorators/date/date-decorator.data.mjs +7 -0
  89. package/esm2020/decorators/number/number-decorator-internal.data.mjs +23 -0
  90. package/esm2020/decorators/number/number-decorator.data.mjs +7 -0
  91. package/esm2020/decorators/number/number.decorator.mjs +18 -0
  92. package/esm2020/decorators/object/object-decorator-internal.data.mjs +12 -0
  93. package/esm2020/decorators/object/object-decorator.data.mjs +7 -0
  94. package/esm2020/decorators/object/object.decorator.mjs +13 -0
  95. package/esm2020/decorators/string/string-decorator-internal.data.mjs +48 -0
  96. package/esm2020/decorators/string/string-decorator.data.mjs +7 -0
  97. package/esm2020/decorators/string/string.decorator.mjs +24 -0
  98. package/esm2020/public-api.mjs +20 -13
  99. package/fesm2015/ngx-material-entity.mjs +1664 -944
  100. package/fesm2015/ngx-material-entity.mjs.map +1 -1
  101. package/fesm2020/ngx-material-entity.mjs +1667 -941
  102. package/fesm2020/ngx-material-entity.mjs.map +1 -1
  103. package/package.json +7 -1
  104. package/public-api.d.ts +21 -10
  105. package/classes/entity-model.class.d.ts +0 -9
  106. package/classes/entity-utilities.class.d.ts +0 -95
  107. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +0 -35
  108. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +0 -12
  109. package/components/input/array-table/array-table.component.d.ts +0 -34
  110. package/components/input/array-table/array-table.module.d.ts +0 -19
  111. package/components/input/internal-input/internal-input.component.d.ts +0 -57
  112. package/components/input/internal-input/internal-input.module.d.ts +0 -16
  113. package/decorators/array.decorator.d.ts +0 -125
  114. package/decorators/base/property-decorator-config.interface.d.ts +0 -50
  115. package/decorators/boolean.decorator.d.ts +0 -42
  116. package/decorators/number.decorator.d.ts +0 -40
  117. package/decorators/object.decorator.d.ts +0 -27
  118. package/decorators/string.decorator.d.ts +0 -76
  119. package/esm2020/classes/entity-model.class.mjs +0 -19
  120. package/esm2020/classes/entity-service.class.mjs +0 -70
  121. package/esm2020/classes/entity-utilities.class.mjs +0 -296
  122. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +0 -43
  123. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +0 -22
  124. package/esm2020/components/input/array-table/array-table.component.mjs +0 -116
  125. package/esm2020/components/input/array-table/array-table.module.mjs +0 -66
  126. package/esm2020/components/input/internal-input/internal-input.component.mjs +0 -73
  127. package/esm2020/components/input/internal-input/internal-input.module.mjs +0 -54
  128. package/esm2020/decorators/array.decorator.mjs +0 -70
  129. package/esm2020/decorators/base/property-decorator-config.interface.mjs +0 -31
  130. package/esm2020/decorators/boolean.decorator.mjs +0 -44
  131. package/esm2020/decorators/number.decorator.mjs +0 -36
  132. package/esm2020/decorators/object.decorator.mjs +0 -23
  133. package/esm2020/decorators/string.decorator.mjs +0 -61
package/README.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # NgxMaterialEntity
2
- Create Entities and define how to display them directly on their properties.
3
- <br>
4
- Can even generate complete and highly customizable CRUD-Tables for them.
2
+ With NgxMaterialEntity you can define how to display entities directly on their properties by using a multitude of decorators for them. You can then use the input component to display the value solely based on the entity and the propertyKey.
3
+
4
+ It also offers a table component which generates complete CRUD-functionality right out of the box.
5
+
6
+ NgxMaterialEntity aims to have a fast way to get started with a lot of default options which can be overriden to allow high customization aswell.
5
7
 
6
8
  [![CI/CD](https://github.com/tim-fabian/ngx-material-entity/actions/workflows/main.yml/badge.svg?branch=release)](https://github.com/tim-fabian/ngx-material-entity/actions/workflows/main.yml)
9
+ [![npm version](https://badge.fury.io/js/ngx-material-entity.svg)](https://badge.fury.io/js/ngx-material-entity)
10
+ [![Known Vulnerabilities](https://snyk.io/test/npm/ngx-material-entity/badge.svg)](https://snyk.io/test/npm/ngx-material-entity)
11
+ [![codecov](https://codecov.io/gh/tim-fabian/ngx-material-entity/branch/dev/graph/badge.svg?token=8Y45KLA74K)](https://codecov.io/gh/tim-fabian/ngx-material-entity)
7
12
 
8
13
  # Table of Contents
9
14
  - [NgxMaterialEntity](#ngxmaterialentity)
@@ -26,6 +31,9 @@ Can even generate complete and highly customizable CRUD-Tables for them.
26
31
  - [@boolean toggle](#boolean-toggle)
27
32
  - [@boolean checkbox](#boolean-checkbox)
28
33
  - [@boolean dropdown](#boolean-dropdown)
34
+ - [@date default](#date-default)
35
+ - [@date dateRange](#date-daterange)
36
+ - [@date datetime](#date-datetime)
29
37
  - [@object default](#object-default)
30
38
  - [@array](#array)
31
39
  - [@array entity](#array-entity)
@@ -52,6 +60,8 @@ Create your entity and define Metadata directly on the properties:
52
60
  ```typescript
53
61
  import { Entity, EntityUtilities, string } from 'ngx-material-entity';
54
62
 
63
+ // The "extends Entity" can be left out.
64
+ // The abstract Entity-Class provides an id out of the box.
55
65
  export class MyEntity extends Entity {
56
66
 
57
67
  /**
@@ -67,12 +77,14 @@ export class MyEntity extends Entity {
67
77
 
68
78
  constructor(entity?: MyEntity) {
69
79
  super();
80
+ // this helper-method sets all values from the provided entity.
81
+ // It can be used universally.
70
82
  EntityUtilities.new(this, entity);
71
83
  }
72
84
 
73
85
  }
74
86
  ```
75
- For a list of all decorators and configuration options see [PropertyDecorators](#propertydecorators).
87
+ For a list of all property decorators and their configuration options see [PropertyDecorators](#propertydecorators).
76
88
 
77
89
  ## Use the input for your entity property
78
90
  You can import the ```NgxMatEntityInputModule``` anywhere in your code:
@@ -90,19 +102,29 @@ import { NgxMatEntityInputModule } from 'ngx-material-entity';
90
102
  In the html you can then define:
91
103
 
92
104
  ```html
93
- <ngx-mat-entity-input
94
- [entity]="myEntity"
95
- [propertyKey]="myString">
105
+ <ngx-mat-entity-input [entity]="myEntity" [propertyKey]="myString">
96
106
  </ngx-mat-entity-input>
97
107
  ```
98
108
 
109
+ That's it!
110
+
99
111
  This snippet automatically generates an material input for "myString" based on the metadata you defined earlier.
100
112
  <br>
101
- For a list of all configuration options for the input see [PropertyInput Configuration](#propertyinput-configuration).
113
+ For a list of further configuration options for the input see [PropertyInput Configuration](#propertyinput-configuration).
102
114
 
103
115
  ## Generate a complete CRUD Table for your entity
116
+ It is pretty easy to use the input component inside a for-loop that iterates over every key of an entity to build a complete form for that entity.
117
+ <br>
118
+ We thought this approach a bit further and build a complete CRUD table component with support for:
119
+ - omitting values for creation or updating
120
+ - layouting
121
+ - responsive design
122
+ - multi select actions
123
+
124
+ As always is the component ready to use out of the box but offers a lot of customization aswell.
125
+
104
126
  ### Create a Service for your entity
105
- In order to use the ngx-material-entites component you have to define a service that handles http-Requests for the entity and extends from the abstract EntityService-Class:
127
+ In order to use the table component you have to define a service that handles http-Requests for the entity and extends from the abstract EntityService-Class:
106
128
 
107
129
  ```typescript
108
130
  // ↓ It's required that the service can be injected
@@ -111,6 +133,7 @@ In order to use the ngx-material-entites component you have to define a service
111
133
  })
112
134
  export class MyEntityService extends EntityService<MyEntity> {
113
135
  baseUrl: string = `${environment.apiUrl}/my-entity`;
136
+ idKey: keyof MyEntity;
114
137
 
115
138
  constructor(private readonly httpClient: HttpClient) {
116
139
  super(httpClient);
@@ -152,44 +175,50 @@ The property decorators contain all the metadata of an entity property.
152
175
  Contains information that is universally defined on every property.
153
176
 
154
177
  ```typescript
155
- /**
156
- * Whether or not the Property is displayed at all.
157
- * @default true
158
- */
159
- display?: boolean;
160
- /**
161
- * The name of the property used as a label for form fields.
162
- */
163
- displayName: string;
164
- /**
165
- * Whether or not the Property is required.
166
- * @default true
167
- */
168
- required?: boolean;
169
- /**
170
- * Whether or not the property gets omitted when creating new Entities.
171
- * @default false
172
- */
173
- omitForCreate?: boolean;
174
- /**
175
- * Whether or not the property gets omitted when updating Entities.
176
- * @default false
177
- */
178
- omitForUpdate?: boolean;
179
- /**
180
- * Defines the width of the input property when used inside the default create or edit dialog.
181
- * Has 3 bootstrap values for different breakpoints for simple responsive design.
182
- * @var firstValue: col-lg-{{firstValue}}
183
- * @var secondValue: col-md-{{secondValue}}
184
- * @var thirdValue: col-sm-{{thirdValue}}
185
- */
186
- defaultWidths?: [cols, cols, cols];
187
- /**
188
- * Specifies order of the input property when used inside the default create or edit dialog.
189
- * Ordering is ascending
190
- * @default -1 (sets this property at the end)
191
- */
192
- order?: number;
178
+ export abstract class PropertyDecoratorConfig {
179
+ /**
180
+ * Whether or not the Property is displayed at all.
181
+ *
182
+ * @default true
183
+ */
184
+ display?: boolean;
185
+ /**
186
+ * The name of the property used as a label for form fields.
187
+ */
188
+ displayName!: string;
189
+ /**
190
+ * Whether or not the Property is required.
191
+ *
192
+ * @default true
193
+ */
194
+ required?: boolean;
195
+ /**
196
+ * Whether or not the property gets omitted when creating new Entities.
197
+ *
198
+ * @default false
199
+ */
200
+ omitForCreate?: boolean;
201
+ /**
202
+ * Whether or not the property gets omitted when updating Entities.
203
+ *
204
+ * @default false
205
+ */
206
+ omitForUpdate?: boolean;
207
+ /**
208
+ * Defines the width of the input property when used inside the default create or edit dialog.
209
+ * Has 3 bootstrap values for different breakpoints for simple responsive design.
210
+ * The first value sets the columns for the screen size lg, the second for md and the third for sm.
211
+ *
212
+ * @default [6, 6, 12]
213
+ */
214
+ defaultWidths?: [Col, Col, Col];
215
+ /**
216
+ * Specifies the how to position this property when using default create/edit dialogs.
217
+ *
218
+ * @default { row: -1, order: -1} (Adds the property at the end)
219
+ */
220
+ position?: Position
221
+ }
193
222
  ```
194
223
  For more information regarding the defaultWidths see the bootstrap guide about the [Grid system](https://getbootstrap.com/docs/5.0/layout/grid/).
195
224
 
@@ -197,262 +226,421 @@ For more information regarding the defaultWidths see the bootstrap guide about t
197
226
  The "default" display of a string value. Inside a single line mat-input.
198
227
 
199
228
  ```typescript
200
- override displayStyle: 'line';
201
- /**
202
- * (optional) The minimum required length of the string
203
- */
204
- minLength?: number;
205
- /**
206
- * (optional) The maximum required length of the string
207
- */
208
- maxLength?: number;
209
- /**
210
- * (optional) A regex used for validation
211
- */
212
- regex?: RegExp;
229
+ export interface DefaultStringDecoratorConfig extends StringDecoratorConfig {
230
+ // eslint-disable-next-line jsdoc/require-jsdoc
231
+ displayStyle: 'line',
232
+ /**
233
+ * The minimum required length of the string.
234
+ */
235
+ minLength?: number,
236
+ /**
237
+ * The maximum required length of the string.
238
+ */
239
+ maxLength?: number,
240
+ /**
241
+ * A regex used for validation.
242
+ */
243
+ regex?: RegExp
244
+ }
213
245
  ```
214
246
 
215
247
  ## @string dropdown
216
248
  Displays a string as a dropdown where the user can input one of the defined dropdownValues.
217
249
 
218
250
  ```typescript
219
- override displayStyle: 'dropdown';
220
- /**
221
- * The values of the dropdown, consisting of a name to display and the actual value
222
- * Can also receive a function to determine the values
223
- */
224
- dropdownValues: { displayName: string, value: string }[];
251
+ export interface DropdownStringDecoratorConfig extends StringDecoratorConfig {
252
+ // eslint-disable-next-line jsdoc/require-jsdoc
253
+ displayStyle: 'dropdown',
254
+ /**
255
+ * The values of the dropdown, consisting of a name to display and the actual value
256
+ * Can also receive a function to determine the values.
257
+ */
258
+ // eslint-disable-next-line jsdoc/require-jsdoc
259
+ dropdownValues: DropdownValue<string>[]
260
+ }
225
261
  ```
226
262
 
227
263
  ## @string textbox
228
264
  Displays a string as a textbox.
229
265
 
230
266
  ```typescript
231
- override displayStyle: 'textbox';
232
- /**
233
- * (optional) The minimum required length of the string
234
- */
235
- minLength?: number;
236
- /**
237
- * (optional) The maximum required length of the string
238
- */
239
- maxLength?: number;
267
+ export interface TextboxStringDecoratorConfig extends StringDecoratorConfig {
268
+ // eslint-disable-next-line jsdoc/require-jsdoc
269
+ displayStyle: 'textbox',
270
+ /**
271
+ * The minimum required length of the string.
272
+ */
273
+ minLength?: number,
274
+ /**
275
+ * The maximum required length of the string.
276
+ */
277
+ maxLength?: number
278
+ }
240
279
  ```
241
280
 
242
281
  ## @string autocomplete
243
282
  Just like the default @string, but the user has additional autocomplete values to quickly input data.
244
283
 
245
284
  ```typescript
246
- override displayStyle: 'autocomplete';
247
- /**
248
- * The autocomplete values
249
- */
250
- autocompleteValues: string[];
251
- /**
252
- * (optional) The minimum required length of the string
253
- */
254
- minLength?: number;
255
- /**
256
- * (optional) The maximum required length of the string
257
- */
258
- maxLength?: number;
259
- /**
260
- * (optional) A regex used for validation
261
- */
262
- regex?: RegExp;
285
+ export interface AutocompleteStringDecoratorConfig extends StringDecoratorConfig {
286
+ // eslint-disable-next-line jsdoc/require-jsdoc
287
+ displayStyle: 'autocomplete',
288
+ /**
289
+ * The autocomplete values.
290
+ */
291
+ autocompleteValues: string[],
292
+ /**
293
+ * The minimum required length of the string.
294
+ */
295
+ minLength?: number,
296
+ /**
297
+ * The maximum required length of the string.
298
+ */
299
+ maxLength?: number,
300
+ /**
301
+ * A regex used for validation.
302
+ */
303
+ regex?: RegExp
304
+ }
263
305
  ```
264
306
 
265
307
  ## @number default
266
308
  The "default" display of a number value. Inside a single line mat-input.
267
309
 
268
310
  ```typescript
269
- override displayStyle: 'line';
270
- /**
271
- * (optional) The minimum value of the number
272
- */
273
- min?: number;
274
- /**
275
- * (optional) The maximum value of the number
276
- */
277
- max?: number;
311
+ export interface DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
312
+ // eslint-disable-next-line jsdoc/require-jsdoc
313
+ displayStyle: 'line',
314
+ /**
315
+ * The minimum value of the number.
316
+ */
317
+ min?: number,
318
+ /**
319
+ * The maximum value of the number.
320
+ */
321
+ max?: number
322
+ }
278
323
  ```
279
324
 
280
325
  ## @number dropdown
281
326
  Displays the numbers in a dropdown
282
327
 
283
328
  ```typescript
284
- override displayStyle: 'dropdown';
285
- /**
286
- * The values of the dropdown, consisting of a name to display and the actual value
287
- * Can also receive a function to determine the values
288
- */
289
- dropdownValues: { displayName: string, value: number }[];
329
+ export interface DropdownNumberDecoratorConfig extends NumberDecoratorConfig {
330
+ // eslint-disable-next-line jsdoc/require-jsdoc
331
+ displayStyle: 'dropdown',
332
+ /**
333
+ * The values of the dropdown, consisting of a name to display and the actual value.
334
+ */
335
+ // eslint-disable-next-line jsdoc/require-jsdoc
336
+ dropdownValues: DropdownValue<number>[]
337
+ }
290
338
  ```
291
339
 
292
340
  ## @boolean toggle
293
341
  Displays the boolean value as a MatSlideToggle
294
342
 
295
343
  ```typescript
296
- override displayStyle: 'toggle';
344
+ export interface ToggleBooleanDecoratorConfig extends BooleanDecoratorConfig {
345
+ // eslint-disable-next-line jsdoc/require-jsdoc
346
+ displayStyle: 'toggle'
347
+ }
297
348
  ```
298
349
 
299
350
  ## @boolean checkbox
300
351
  Displays the boolean value as a MatCheckbox
301
352
 
302
353
  ```typescript
303
- override displayStyle: 'checkbox';
354
+ export interface CheckboxBooleanDecoratorConfig extends BooleanDecoratorConfig {
355
+ // eslint-disable-next-line jsdoc/require-jsdoc
356
+ displayStyle: 'checkbox'
357
+ }
304
358
  ```
305
359
 
306
360
  ## @boolean dropdown
307
361
  Displays the boolean value as a MatCheckbox
308
362
 
309
363
  ```typescript
310
- override displayStyle: 'dropdown';
311
- /**
312
- * The name of the true value if displayStyle dropdown is used.
313
- * Can also receive a function to determine the name.
314
- */
315
- dropdownTrue: string | { (args: unknown): string };
316
- /**
317
- * The name of the false value if displayStyle dropdown is used.
318
- * Can also receive a function to determine the name,
319
- */
320
- dropdownFalse: string | { (args: unknown): string };
364
+ export interface DropdownBooleanDecoratorConfig extends BooleanDecoratorConfig {
365
+ // eslint-disable-next-line jsdoc/require-jsdoc
366
+ displayStyle: 'dropdown',
367
+ /**
368
+ * The name of the true value if displayStyle dropdown is used.
369
+ */
370
+ dropdownTrue: string,
371
+ /**
372
+ * The name of the false value if displayStyle dropdown is used.
373
+ */
374
+ dropdownFalse: string
375
+ }
376
+ ```
377
+
378
+ ## @date default
379
+ Displays a date value as an mat-datepicker.
380
+ ```typescript
381
+ export interface DefaultDateDecoratorConfig extends DateDecoratorConfig {
382
+ // eslint-disable-next-line jsdoc/require-jsdoc
383
+ displayStyle: 'date',
384
+ /**
385
+ * A function to get the minimum value of the date.
386
+ */
387
+ min?: (date?: Date) => Date,
388
+ /**
389
+ * A function to get the maximum value of the date.
390
+ */
391
+ max?: (date?: Date) => Date,
392
+ /**
393
+ * A filter function to do more specific filtering. This could be the removal of e.g. All weekends.
394
+ */
395
+ filter?: DateFilterFn<Date | null | undefined>
396
+ }
397
+ ```
398
+
399
+ ## @date dateRange
400
+ Displays the selection of a time period as the daterange-picker.
401
+
402
+ ```typescript
403
+ export interface DateRangeDateDecoratorConfig extends DateDecoratorConfig {
404
+ // eslint-disable-next-line jsdoc/require-jsdoc
405
+ displayStyle: 'daterange',
406
+ /**
407
+ * A function to get the minimum value of the start date.
408
+ */
409
+ minStart?: (date?: Date) => Date,
410
+ /**
411
+ * A function to get the maximum value of the start date.
412
+ */
413
+ maxStart?: (date?: Date) => Date,
414
+ /**
415
+ * A function to get the minimum value of the end date.
416
+ */
417
+ minEnd?: (date?: Date) => Date,
418
+ /**
419
+ * A function to get the maximum value of the end date.
420
+ */
421
+ maxEnd?: (date?: Date) => Date,
422
+ /**
423
+ * A filter function to do more specific filtering on the disallowed end date values. This could be the removal of e.g. All weekends.
424
+ */
425
+ filter?: DateFilterFn<Date>,
426
+ /**
427
+ * The placeholder for the start date of the date range picker.
428
+ *
429
+ * @default "Start"
430
+ */
431
+ placeholderStart?: string,
432
+ /**
433
+ * The placeholder for the end date of the date range picker.
434
+ *
435
+ * @default "End"
436
+ */
437
+ placeholderEnd?: string
438
+ }
439
+ ```
440
+
441
+ ## @date datetime
442
+ Displays the date as a datetime input.
443
+
444
+ ```typescript
445
+ export interface DateTimeDateDecoratorConfig extends DateDecoratorConfig {
446
+ // eslint-disable-next-line jsdoc/require-jsdoc
447
+ displayStyle: 'datetime',
448
+ /**
449
+ * The selectable times.
450
+ */
451
+ times?: DropdownValue<Time>[],
452
+ /**
453
+ * The name to use as a label for the time form field.
454
+ *
455
+ * @default 'Time'
456
+ */
457
+ timeDisplayName?: string,
458
+ /**
459
+ * A function to get the minimum value of the date.
460
+ */
461
+ minDate?: (date?: Date) => Date,
462
+ /**
463
+ * A function to get the maximum value of the date.
464
+ */
465
+ maxDate?: (date?: Date) => Date,
466
+ /**
467
+ * A filter function to do more specific date filtering. This could be the removal of e.g. All weekends.
468
+ */
469
+ filterDate?: DateFilterFn<Date | null | undefined>,
470
+ /**
471
+ * A function to get the minimum value of the time.
472
+ */
473
+ minTime?: (date?: Date) => Time,
474
+ /**
475
+ * A function to get the maximum value of the time.
476
+ */
477
+ maxTime?: (date?: Date) => Time,
478
+ /**
479
+ * A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
480
+ */
481
+ filterTime?: ((time: Time) => boolean) | (() => boolean)
482
+ }
321
483
  ```
322
484
 
323
485
  ## @object default
324
486
  Displays an entity object inline.
325
487
 
326
488
  ```typescript
327
- override displayStyle: 'inline';
328
- /**
329
- * (optional) The title of the section containing all object properties. Defaults to the display name.
330
- */
331
- sectionTitle?: string;
489
+ export interface DefaultObjectDecoratorConfig<EntityType extends object> extends ObjectDecoratorConfig<EntityType> {
490
+ /**
491
+ * The class of the object. Is used to call the constructor so that all metadata is initialized.
492
+ */
493
+ EntityClass!: EntityClassNewable<EntityType>;
494
+
495
+ /**
496
+ * How to display the object.
497
+ *
498
+ * The objects properties are added as input fields in an section of the entity.
499
+ * Useful if the object only contains a few properties (e.g. A address on a user).
500
+ */
501
+ displayStyle!: 'inline';
502
+ }
332
503
  ```
333
504
 
334
505
  ## @array
335
506
  ```typescript
336
507
  /**
337
- * Base definition for the @array metadata
508
+ * Interface definition for the @array metadata.
338
509
  */
339
510
  abstract class ArrayDecoratorConfig extends PropertyDecoratorConfig {
340
511
  /**
341
- * How to display the items
512
+ * How to display the string.
342
513
  */
343
514
  displayStyle!: 'table' | 'chips';
344
515
 
345
516
  /**
346
- * The type of the items inside the array
517
+ * The type of the items inside the array.
347
518
  */
348
519
  itemType!: DecoratorTypes;
349
-
350
- /**
351
- * The error-message to display when the array is required but contains no values
352
- */
353
- missingErrorMessage?: string;
354
520
  }
355
521
  ```
356
522
  ## @array entity
357
523
  ```typescript
358
524
  /**
359
- * Definition for an array of Entities
525
+ * Definition for an array of Entities.
360
526
  */
361
- export class EntityArrayDecoratorConfig<EntityType extends Entity> extends ArrayDecoratorConfig {
362
- override itemType: DecoratorTypes.OBJECT;
363
- override displayStyle: 'table';
527
+ export interface EntityArrayDecoratorConfig<EntityType extends object> extends ArrayDecoratorConfig {
528
+ // eslint-disable-next-line jsdoc/require-jsdoc
529
+ itemType: DecoratorTypes.OBJECT,
530
+ // eslint-disable-next-line jsdoc/require-jsdoc
531
+ displayStyle: 'table',
364
532
 
365
533
  /**
366
- * The EntityClass used for generating the create inputs
534
+ * The EntityClass used for generating the create inputs.
367
535
  */
368
- EntityClass!: new (entity?: EntityType) => EntityType;
536
+ EntityClass: EntityClassNewable<EntityType>,
369
537
 
370
538
  /**
371
539
  * The definition of the columns to display. Consists of the displayName to show in the header of the row
372
- * and the value, which is a function that generates the value to display inside a column
540
+ * and the value, which is a function that generates the value to display inside a column.
373
541
  */
374
- displayColumns: ArrayTableDisplayColumn<EntityType>[];
542
+ displayColumns: ArrayTableDisplayColumn<EntityType>[],
375
543
 
376
544
  /**
377
545
  * The data for the add-item-dialog.
378
546
  * Can be omitted when adding items inline.
379
547
  */
380
- createDialogData?: CreateDialogData
548
+ createDialogData?: CreateDialogData,
381
549
 
382
550
  /**
383
551
  * Whether or not the form for adding items to the array
384
552
  * should be displayed inline.
553
+ *
385
554
  * @default true
386
555
  */
387
- createInline?: boolean
556
+ createInline?: boolean,
557
+
558
+ /**
559
+ * The label for the add button when createInline is true.
560
+ *
561
+ * @default 'Add'
562
+ */
563
+ addButtonLabel?: string,
564
+
565
+ /**
566
+ * The label for the remove button when createInline is true.
567
+ *
568
+ * @default 'Remove'
569
+ */
570
+ removeButtonLabel?: string,
571
+
572
+ /**
573
+ * The error-message to display when the array is required but contains no values.
574
+ */
575
+ missingErrorMessage?: string
388
576
  }
389
577
  ```
390
578
 
391
579
  ## @array string chips
392
580
  ```typescript
393
581
  /**
394
- * Definition for an array of strings displayed as a chips list
582
+ * Definition for an array of strings displayed as a chips list.
395
583
  */
396
- export class StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
397
- override itemType: DecoratorTypes.STRING;
398
- override displayStyle: 'chips';
584
+ export interface StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
585
+ // eslint-disable-next-line jsdoc/require-jsdoc
586
+ itemType: DecoratorTypes.STRING,
587
+ // eslint-disable-next-line jsdoc/require-jsdoc
588
+ displayStyle: 'chips',
399
589
 
400
590
  /**
401
- * The html inside the delete-button.
402
- * Please note that custom tags such as <mat-icon></mat-icon>
403
- * need to be defined as known elements, otherwise the sanitizer will remove them.
404
- * You can however work around this by using `<span class="material-icons"></span>`
405
- * @default <mat-icon>cancel</mat-icon>
591
+ * The class for the <i> tag used to remove an entry from the array.
592
+ *
593
+ * @default 'fas fa-circle-minus'
406
594
  */
407
- deleteHtml?: string
595
+ deleteIcon?: string,
408
596
  /**
409
- * (optional) The minimum required length of the string
597
+ * The minimum required length of the string.
410
598
  */
411
- minLength?: number;
599
+ minLength?: number,
412
600
  /**
413
- * (optional) The maximum required length of the string
601
+ * The maximum required length of the string.
414
602
  */
415
- maxLength?: number;
603
+ maxLength?: number,
416
604
  /**
417
- * (optional) A regex used for validation
605
+ * A regex used for validation.
418
606
  */
419
- regex?: RegExp;
607
+ regex?: RegExp
420
608
  }
421
609
  ```
422
610
 
423
611
  ## @array string chips autocomplete
424
612
  ```typescript
425
613
  /**
426
- * Definition for an array of autocomplete strings displayed as a chips list
614
+ * Definition for an array of autocomplete strings displayed as a chips list.
427
615
  */
428
- export class AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
429
- override itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
430
- override displayStyle: 'chips';
616
+ export interface AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
617
+ // eslint-disable-next-line jsdoc/require-jsdoc
618
+ itemType: DecoratorTypes.STRING_AUTOCOMPLETE,
619
+ // eslint-disable-next-line jsdoc/require-jsdoc
620
+ displayStyle: 'chips',
431
621
 
432
622
  /**
433
- * The html inside the delete-button.
434
- * Please note that custom tags such as <mat-icon></mat-icon>
435
- * need to be defined as known elements, otherwise the sanitizer will remove them.
436
- * You can however work around this by using `<span class="material-icons"></span>`
437
- * @default <mat-icon>cancel</mat-icon>
623
+ * The class for the <i> tag used to remove an entry from the array.
624
+ *
625
+ * @default 'fas fa-circle-minus'
438
626
  */
439
- deleteHtml?: string;
627
+ deleteIcon?: string,
440
628
  /**
441
- * The autocomplete values
629
+ * The autocomplete values.
442
630
  */
443
- autocompleteValues: string[];
631
+ autocompleteValues: string[],
444
632
  /**
445
- * (optional) The minimum required length of the string
633
+ * The minimum required length of the string.
446
634
  */
447
- minLength?: number;
635
+ minLength?: number,
448
636
  /**
449
- * (optional) The maximum required length of the string
637
+ * The maximum required length of the string.
450
638
  */
451
- maxLength?: number;
639
+ maxLength?: number,
452
640
  /**
453
- * (optional) A regex used for validation
641
+ * A regex used for validation.
454
642
  */
455
- regex?: RegExp;
643
+ regex?: RegExp
456
644
  }
457
645
  ```
458
646
 
@@ -463,14 +651,14 @@ Configuration options are:
463
651
 
464
652
  ```typescript
465
653
  /**
466
- * The entity on which the property exists. Used in conjuction with the "propertyKey"
654
+ * The entity on which the property exists. Used in conjunction with the "propertyKey"
467
655
  * to determine the property for which the input should be generated.
468
656
  */
469
657
  @Input()
470
658
  entity!: EntityType;
471
659
 
472
660
  /**
473
- * The name of the property to generate the input for. Used in conjuction with the "entity".
661
+ * The name of the property to generate the input for. Used in conjunction with the "entity".
474
662
  */
475
663
  @Input()
476
664
  propertyKey!: keyof EntityType;
@@ -503,168 +691,178 @@ As this component is highly configurable and allows you to either create your ow
503
691
 
504
692
  ```typescript
505
693
  /**
506
- * The title of the table
507
- */
508
- @Input()
509
- title!: string;
510
- /**
511
- * The definition of the columns to display. Consists of the displayName to show in the header of the row
512
- * and the value, which is a function that generates the value to display inside a column
513
- */
514
- @Input()
515
- displayColumns!: DisplayColumn<EntityType>[];
516
- /**
517
- * The label on the search bar. Defaults to "Search".
694
+ * The base data of the ngx-mat-entity-table.
518
695
  */
519
- @Input()
520
- searchLabel?: string;
521
- /**
522
- * The label on the button for adding new entities. Defaults to "Create".
523
- */
524
- @Input()
525
- createButtonLabel?: string;
526
- /**
527
- * The Class of the entities to manage
528
- */
529
- @Input()
530
- EntityClass!: new (entity?: EntityType) => EntityType;
531
- /**
532
- * The Class of the service that handles the entities.
533
- * Needs to be injectable and an extension of the "EntityService"-Class
534
- */
535
- @Input()
536
- EntityServiceClass!: new (httpClient: HttpClient) => EntityService<EntityType>;
537
- /**
538
- * Takes a custom edit method which runs when you click on a entity.
539
- * If you don't need any special editing of entries you can also omit this.
540
- * In that case a default edit dialog is generated.
541
- */
542
- @Input()
543
- edit?: (entity: EntityType) => unknown;
544
- /**
545
- * Takes a method to run when you click on the new button.
546
- * If you don't need anything special you can also omit this.
547
- * In that case a default create dialog is generated.
548
- */
549
- @Input()
550
- create?: (entity: EntityType) => unknown;
551
- /**
552
- * Defines how the search string of entities is generated.
553
- */
554
- @Input()
555
- searchString?: (enity: EntityType) => string;
556
- /**
557
- * Defines whether or not the user can add new entities.
558
- */
559
- @Input()
560
- allowCreate!: boolean;
561
- /**
562
- * Defines whether or not the user can edit entities.
563
- */
564
- @Input()
565
- allowEdit!: boolean;
566
- /**
567
- * Defines whether or not the user can delete entities.
568
- */
569
- @Input()
570
- allowDelete!: boolean;
571
- /**
572
- * All Actions that you want to run on multiple entities can be defined here.
573
- * (e.g. download as zip-file or mass delete)
574
- */
575
- @Input()
576
- multiSelectActions?: MultiSelectAction<EntityType>[];
577
- /**
578
- * The Label for the button that opens all multi-actions.
579
- */
580
- @Input()
581
- multiSelectLabel?: string;
582
-
583
-
696
+ export interface BaseData<EntityType extends object> {
697
+ /**
698
+ * The title of the table.
699
+ */
700
+ title: string,
701
+ /**
702
+ * The definition of the columns to display. Consists of the displayName to show in the header of the row
703
+ * and the value, which is a function that generates the value to display inside a column.
704
+ */
705
+ displayColumns: DisplayColumn<EntityType>[],
706
+ /**
707
+ * The Class of the service that handles the entities.
708
+ * Needs to be injectable and an extension of the "EntityService"-Class.
709
+ */
710
+ EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>,
711
+ /**
712
+ * The Class of the entities to manage.
713
+ */
714
+ EntityClass?: EntityClassNewable<EntityType>,
715
+ /**
716
+ * The label on the search bar. Defaults to "Search".
717
+ */
718
+ searchLabel?: string,
719
+ /**
720
+ * The label on the button for adding new entities. Defaults to "Create".
721
+ */
722
+ createButtonLabel?: string,
723
+ /**
724
+ * Takes a custom edit method which runs when you click on a entity.
725
+ * If you don't need any special editing of entries you can also omit this.
726
+ * In that case a default edit dialog is generated.
727
+ */
728
+ edit?: (entity: EntityType) => unknown,
729
+ /**
730
+ * Takes a method to run when you click on the new button.
731
+ * If you don't need anything special you can also omit this.
732
+ * In that case a default create dialog is generated.
733
+ */
734
+ create?: (entity: EntityType) => unknown,
735
+ /**
736
+ * Defines how the search string of entities is generated.
737
+ */
738
+ searchString?: (entity: EntityType) => string,
739
+ /**
740
+ * Defines whether or not the user can add new entities.
741
+ *
742
+ * @default true
743
+ */
744
+ allowCreate?: boolean,
745
+ /**
746
+ * Defines whether or not the user can edit entities.
747
+ *
748
+ * @default () => true
749
+ */
750
+ allowEdit?: (entity: EntityType) => boolean,
751
+ /**
752
+ * Whether or not the user can delete this specific entity.
753
+ */
754
+ allowDelete?: (entity: EntityType) => boolean,
755
+ /**
756
+ * All Actions that you want to run on multiple entities can be defined here.
757
+ * (e.g. Download as zip-file or mass delete).
758
+ */
759
+ multiSelectActions?: MultiSelectAction<EntityType>[],
760
+ /**
761
+ * The Label for the button that opens all multi-actions.
762
+ */
763
+ multiSelectLabel?: string
764
+ }
584
765
 
585
766
  /**
586
- * The title of the default create-dialog.
767
+ * The data of the default create-dialog.
587
768
  */
588
- @Input()
589
- createDialogTitle!: string;
590
- /**
591
- * The label on the create-button of the default create-dialog. Defaults to "Create".
592
- */
593
- @Input()
594
- createDialogCreateButtonLabel?: string;
769
+ export interface CreateDialogData {
770
+ /**
771
+ * The title of the default create-dialog.
772
+ */
773
+ title?: string,
774
+ /**
775
+ * The label on the create-button of the default create-dialog. Defaults to "Create".
776
+ */
777
+ createButtonLabel?: string,
778
+ /**
779
+ * The label on the cancel-button for the default create-dialog. Defaults to "Cancel".
780
+ */
781
+ cancelButtonLabel?: string,
782
+ /**
783
+ * Whether or not the creation of an entry should require a confirm dialog.
784
+ */
785
+ createRequiresConfirmDialog?: boolean,
786
+ /**
787
+ * The data used to generate a confirmation dialog for the create action.
788
+ */
789
+ confirmCreateDialogData?: ConfirmDialogData
790
+ }
791
+
595
792
  /**
596
- * The label on the cancel-button for the default create-dialog. Defaults to "Cancel".
793
+ * The data of the default edit-dialog.
597
794
  */
598
- @Input()
599
- createDialogCancelButtonLabel?: string;
795
+ export interface EditDialogData<EntityType extends object> {
796
+ /**
797
+ * The title of the default edit-dialog.
798
+ */
799
+ title?: (entity: EntityType) => string,
800
+ /**
801
+ * The label on the confirm-button of the default edit-dialog. Defaults to "Save".
802
+ */
803
+ confirmButtonLabel?: string,
804
+ /**
805
+ * The label on the delete-button of the default edit-dialog. Defaults to "Delete".
806
+ */
807
+ deleteButtonLabel?: string,
808
+ /**
809
+ * The label on the cancel-button for the default edit-dialog. Defaults to "Cancel".
810
+ */
811
+ cancelButtonLabel?: string,
812
+ /**
813
+ * Whether or not the deletion of an entry should require a confirm dialog.
814
+ */
815
+ deleteRequiresConfirmDialog?: boolean,
816
+ /**
817
+ * Whether or not the editing of an entry should require a confirm dialog.
818
+ */
819
+ editRequiresConfirmDialog?: boolean,
600
820
 
821
+ /**
822
+ * The data used to generate a confirmation dialog for the delete action.
823
+ */
824
+ confirmDeleteDialogData?: ConfirmDialogData,
601
825
 
826
+ /**
827
+ * The data used to generate a confirmation dialog for the delete action.
828
+ */
829
+ confirmEditDialogData?: ConfirmDialogData
830
+ }
602
831
 
603
832
  /**
604
- * The title of the default edit-dialog.
833
+ * All the configuration data required to display a ngx-mat-entity-table.
605
834
  */
606
- @Input()
607
- editDialogTitle!: string;
608
- /**
609
- * The label on the confirm-button of the default edit-dialog. Defaults to "Save".
610
- */
611
- @Input()
612
- editDialogConfirmButtonLabel?: string;
613
- /**
614
- * The label on the delete-button of the default edit-dialog. Defaults to "Delete".
615
- */
616
- @Input()
617
- editDialogDeleteButtonLabel?: string;
618
- /**
619
- * The label on the cancel-button for the default edit-dialog. Defaults to "Cancel".
620
- */
621
- @Input()
622
- editDialogCancelButtonLabel?: string;
623
- /**
624
- * The text inside the confirm delete dialog.
625
- * Each string inside the array is a paragraph.
626
- */
627
- @Input()
628
- confirmDeleteText?: string[];
629
- /**
630
- * The label on the button that confirms the deletion of an entity.
631
- */
632
- @Input()
633
- confirmDeleteButtonLabel?: string;
634
- /**
635
- * The label on the button that cancels the deletion of an entity.
636
- */
637
- @Input()
638
- cancelDeleteButtonLabel?: string;
639
- /**
640
- * The title of the dialog where you have to either confirm or cancel the deletion of an entity.
641
- */
642
- @Input()
643
- confirmDeleteDialogTitle?: string;
644
- /**
645
- * Whether or not a checkbox needs to be checked before being able to click on the confirm-delete-button
646
- */
647
- @Input()
648
- confirmDeleteRequireConfirmation?: boolean;
649
- /**
650
- * The text next to the checkbox
651
- */
652
- @Input()
653
- confirmDeleteConfirmationText?: string
835
+ export interface TableData<EntityType extends object> {
836
+ /**
837
+ * The base data for the table-component.
838
+ * Includes stuff like the title for the table, what to display inside the rows etc.
839
+ */
840
+ baseData: BaseData<EntityType>,
841
+ /**
842
+ * The data for the default create-dialog.
843
+ * Can be omitted when specifying a custom "create" method inside the baseData.
844
+ */
845
+ createDialogData?: CreateDialogData,
846
+ /**
847
+ * The data for the default edit-dialog.
848
+ * Can be omitted when specifying a custom "edit" method inside the baseData.
849
+ */
850
+ editDialogData?: EditDialogData<EntityType>
851
+ }
654
852
  ```
655
853
 
656
854
  ## Display Columns
657
855
  The definition of a column inside the table.
658
856
  ```typescript
659
- export interface DisplayColumn<EntityType extends Entity> {
857
+ export interface DisplayColumn<EntityType extends object> {
660
858
  /**
661
859
  * The name inside the header.
662
860
  */
663
- displayName: string;
861
+ displayName: string,
664
862
  /**
665
- * A method to get the value inside an entry
863
+ * A method to get the value inside an row.
666
864
  */
667
- value: (entity: EntityType) => string;
865
+ value: (entity: EntityType) => string
668
866
  }
669
867
  ```
670
868
 
@@ -672,20 +870,30 @@ export interface DisplayColumn<EntityType extends Entity> {
672
870
  Multiselect Actions appear on the right upper corner and allow you to do actions on all selected entries.
673
871
 
674
872
  ```typescript
675
- export interface MultiSelectAction<EntityType extends Entity> {
873
+ export interface MultiSelectAction<EntityType extends object> {
676
874
  /**
677
- * The name of the action
875
+ * The name of the action.
678
876
  */
679
- displayName: string;
877
+ displayName: string,
680
878
  /**
681
- * The action itself
879
+ * The action itself.
682
880
  */
683
- action: (entity: EntityType[]) => unknown;
881
+ action: (selectedEntities: EntityType[]) => unknown,
684
882
  /**
685
883
  * A method that defines whether or not the action can be used.
686
- * Defaults to true.
884
+ *
885
+ * @default true
886
+ */
887
+ enabled?: (selectedEntities: EntityType[]) => boolean,
888
+ /**
889
+ * A method that defines whether or not a confirm dialog is needed to run the action.
890
+ *
891
+ * @default false
892
+ */
893
+ requireConfirmDialog?: (selectedEntities: EntityType[]) => boolean,
894
+ /**
895
+ * The data used to generate a confirmation dialog for the multiSelect action.
687
896
  */
688
- enabled?: (entity: EntityType[]) => boolean;
897
+ confirmDialogData?: ConfirmDialogData
689
898
  }
690
899
  ```
691
- //TODO