@jm-7c3/common-lib 22.0.0 → 22.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.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Common Lib
2
2
 
3
- Constains elements based on PrimeNG library.
3
+ Constains elements based on Angular Material and PrimeNG libraries.
4
4
 
5
5
  Now the major version matches the Angular version used in the project.
6
6
 
7
7
  ## Controls
8
8
 
9
- Standalone UI controls, based on [PrimeNG](https://primeng.org) components.
9
+ Standalone UI controls, based on [Angular Material](https://material.angular.dev/) and [PrimeNG](https://primeng.org) components.
10
10
 
11
11
  ### Button
12
12
 
@@ -156,7 +156,9 @@ Shows the provided form in a dialog.
156
156
 
157
157
  #### Import the component
158
158
 
159
+ ```
159
160
  import {FormDialogComponent} from '@jm-7c3/common-lib';
161
+ ```
160
162
 
161
163
  #### Add the component
162
164
 
@@ -234,6 +236,79 @@ import {IconButtonComponent} from '@jm-7c3/common-lib';
234
236
  | severity | '', 'danger', 'help', 'info', 'secondary', 'success', 'warning' | '' | false | Style of the button |
235
237
  | type | 'button', 'submit' | 'button' | false | Type of the button |
236
238
 
239
+ ### Mat Confirmation
240
+
241
+ Shows a confirmation dialog using Angular Material components.
242
+
243
+ #### Import the service
244
+
245
+ ```
246
+ import {MatConfirmationService} from '@jm-7c3/common-lib';
247
+ ```
248
+
249
+ #### Inject the service
250
+
251
+ ```
252
+ private readonly matConfirmationService = inject(MatConfirmationService);
253
+ ```
254
+
255
+ #### Methods
256
+
257
+ | Method | Description |
258
+ | - | - |
259
+ | confirm | Opens the confirmation dialog. Returns an observable with a boolean value. |
260
+
261
+ #### Example
262
+
263
+ Open the confirmation dialog and subscribe to the result.
264
+
265
+ ```
266
+ const config: MatConfirmationData = {
267
+ message: 'Message to be displayed in the dialog.',
268
+ title: 'Dialog Title'
269
+ };
270
+
271
+ this.matConfirmationService.confirm(config).subscribe(result => {
272
+ // Custom code here.
273
+ });
274
+ ```
275
+
276
+ ### Mat Form Dialog
277
+
278
+ Shows the provided form in a dialog using Angular Material components.
279
+
280
+ #### Import the service
281
+
282
+ ```
283
+ import {MatFormDialogService} from '@jm-7c3/common-lib';
284
+ ```
285
+
286
+ #### Inject the service
287
+
288
+ ```
289
+ private readonly matFormDialogService = inject(MatFormDialogService);
290
+ ```
291
+
292
+ #### Methods
293
+
294
+ | Method | Description |
295
+ | - | - |
296
+ | open | Opens the Angular Material dialog component displaying the form. It returns an observable with the form's value.|
297
+
298
+ #### Example
299
+
300
+ Open the form dialog and subscribe to the result.
301
+
302
+ ```
303
+ const config: MatFormDialogData = {
304
+ component: FormComponent
305
+ };
306
+
307
+ this.matFormDialogService.open(config).subscribe(formValue => {
308
+ // Custom code here.
309
+ });
310
+ ```
311
+
237
312
  ### Progress Bar Dialog
238
313
 
239
314
  Displays a dialog with a progress bar animation.
@@ -353,7 +428,7 @@ Input to select a single file.
353
428
  #### Import
354
429
 
355
430
  ```
356
- import {FileInputComponent} from '@jm-7c3/sp-integration';
431
+ import {FileInputComponent} from '@jm-7c3/common-lib';
357
432
  ```
358
433
 
359
434
  #### Implementation
@@ -384,7 +459,7 @@ Inputs to select a single file.
384
459
  #### Import
385
460
 
386
461
  ```
387
- import {FileInputsComponent} from '@jm-7c3/sp-integration';
462
+ import {FileInputsComponent} from '@jm-7c3/common-lib';
388
463
  ```
389
464
 
390
465
  #### Implementation
@@ -416,7 +491,7 @@ A wrapper component for form controls.
416
491
  #### Import
417
492
 
418
493
  ```
419
- import {FormFieldComponent} from '@jm-7c3/sp-integration';
494
+ import {FormFieldComponent} from '@jm-7c3/common-lib';
420
495
  ```
421
496
 
422
497
  #### Implementation
@@ -430,3 +505,66 @@ import {FormFieldComponent} from '@jm-7c3/sp-integration';
430
505
  <ff-error>
431
506
  </cl-form-field>
432
507
  ```
508
+
509
+ ### Mat File Input
510
+
511
+ Input to select a single file using Angular Material components.
512
+
513
+ #### Import
514
+
515
+ ```
516
+ import {MatFileInputComponent} from '@jm-7c3/common-lib';
517
+ ```
518
+
519
+ #### Implementation
520
+
521
+ ```
522
+ <cl-mat-file-input />
523
+ ```
524
+
525
+ #### Inputs
526
+
527
+ | Input | Type | Default | Required | Description |
528
+ | - | - | - | - | - |
529
+ | directory | string | '' | false | Path to the directory where the files is stored. |
530
+ | icon | string | 'pi pi-plus' | false | Prime icon being used. |
531
+ | label | boolean | 'Browse' | false | Label for the input control. |
532
+ | readonly | string | | false | Disables the input control. |
533
+
534
+ #### Outputs
535
+
536
+ | onDownload | Type | Description |
537
+ | - | - | - |
538
+ | onDownload | FileInput[] | Returns the file to be downloaded. |
539
+
540
+ ### Mat File Inputs
541
+
542
+ Inputs to select a single file using Angular Material components.
543
+
544
+ #### Import
545
+
546
+ ```
547
+ import {MatFileInputsComponent} from '@jm-7c3/common-lib';
548
+ ```
549
+
550
+ #### Implementation
551
+
552
+ ```
553
+ <cl-mat-file-inputs />
554
+ ```
555
+
556
+ #### Inputs
557
+
558
+ | Input | Type | Default | Required | Description |
559
+ | - | - | - | - | - |
560
+ | directory | string | '' | false | Path to the directory where the files is stored. |
561
+ | icon | string | 'pi pi-plus' | false | Prime icon being used. |
562
+ | label | boolean | 'Browse' | false | Label for the input control. |
563
+ | max | number | 5 | false | Maximum number of file controls allowed. |
564
+ | readonly | string | | false | Disables the input control. |
565
+
566
+ #### Outputs
567
+
568
+ | onDownload | Type | Description |
569
+ | - | - | - |
570
+ | onDownload | FileInput[] | Returns the file to be downloaded. |