@lukfel/ng-scaffold 20.0.13 → 20.0.14
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 +42 -22
- package/fesm2022/lukfel-ng-scaffold.mjs +135 -104
- package/fesm2022/lukfel-ng-scaffold.mjs.map +1 -1
- package/index.d.ts +79 -56
- package/package.json +1 -1
- package/styles/_variables.scss +1 -2
package/README.md
CHANGED
|
@@ -369,37 +369,52 @@ import { ListComponent } from '@lukfel/ng-scaffold';
|
|
|
369
369
|
```
|
|
370
370
|
|
|
371
371
|
```ts
|
|
372
|
-
import {
|
|
372
|
+
import { Button, ListHeader, ListItem } from '@lukfel/ng-scaffold';
|
|
373
|
+
|
|
374
|
+
public header: ListHeader = {
|
|
375
|
+
enableSelection: true,
|
|
376
|
+
items: [
|
|
377
|
+
{ title: 'Items', sortToken: 'items' }
|
|
378
|
+
]
|
|
379
|
+
};
|
|
373
380
|
|
|
374
381
|
public items: ListItem[] = [
|
|
375
|
-
{ title: 'Item 1' },
|
|
376
|
-
{ title: 'Item 2', subtitle: '
|
|
377
|
-
{ title: 'Item 3', subtitle: '
|
|
382
|
+
{ id: 0, avatar: 'assets/img/logos/ic_launcher-web.png', title: 'Item 1', subtitle: 'I am clickable', clickable: true },
|
|
383
|
+
{ id: 1, svgIcon: 'logo', title: 'Item 2', subtitle: 'I am disabled', disabled: true },
|
|
384
|
+
{ id: 2, matIcon: 'person', title: 'Item 3', subtitle: 'I have no edit buton', hiddenButtons: ['edit'] },
|
|
378
385
|
];
|
|
379
386
|
|
|
380
|
-
public
|
|
387
|
+
public buttons: Button[] = [
|
|
381
388
|
{ id: 'edit', matIcon: 'edit' },
|
|
382
|
-
{ id: 'delete', matIcon: 'delete',
|
|
389
|
+
{ id: 'delete', matIcon: 'delete', class: 'warn' }
|
|
383
390
|
];
|
|
384
391
|
|
|
385
|
-
public
|
|
386
|
-
// handle
|
|
392
|
+
public onListSortChange(event: { sortToken: string, sortAsc: boolean }): void {
|
|
393
|
+
// handle sort change
|
|
387
394
|
}
|
|
388
395
|
|
|
389
|
-
public
|
|
390
|
-
// handle selection
|
|
396
|
+
public onListSelectionChange(items: ListItem[]): void {
|
|
397
|
+
// handle selection change
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
public onListButtonClick(event: { buttonId: string, item: ListItem }): void {
|
|
401
|
+
// handle button click
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
public onListItemClick(item: ListItem): void {
|
|
405
|
+
// handle item click
|
|
391
406
|
}
|
|
392
407
|
```
|
|
393
408
|
|
|
394
409
|
```html
|
|
395
410
|
<lf-list
|
|
411
|
+
[header]="header"
|
|
396
412
|
[items]="items"
|
|
397
|
-
[
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
(
|
|
402
|
-
(selectionChange)="onSelectionChange($event)"></lf-list>
|
|
413
|
+
[buttons]="buttons"
|
|
414
|
+
(sortChangeEvent)="onListSortChange($event)"
|
|
415
|
+
(selectionChangeEvent)="onListSelectionChange($event)"
|
|
416
|
+
(buttonClickEvent)="onListButtonClick($event)"
|
|
417
|
+
(itemClickEvent)="onListItemClick($event)"></lf-list>
|
|
403
418
|
```
|
|
404
419
|
|
|
405
420
|
### File-Upload
|
|
@@ -410,7 +425,7 @@ import { FileUploadComponent } from '@lukfel/ng-scaffold';
|
|
|
410
425
|
```
|
|
411
426
|
|
|
412
427
|
```ts
|
|
413
|
-
public
|
|
428
|
+
public onFileChange(file: File): void {
|
|
414
429
|
// handle file upload
|
|
415
430
|
}
|
|
416
431
|
```
|
|
@@ -422,7 +437,7 @@ public uploadFile(file: File): void {
|
|
|
422
437
|
matIcon="upload"
|
|
423
438
|
[disabled]="false"
|
|
424
439
|
accept="*"
|
|
425
|
-
(
|
|
440
|
+
(fileChangeEvent)="onFileChange($event)"></lf-file-upload>
|
|
426
441
|
```
|
|
427
442
|
|
|
428
443
|
### Placeholder
|
|
@@ -437,15 +452,20 @@ import { PlaceholderConfig } from '@lukfel/ng-scaffold';
|
|
|
437
452
|
|
|
438
453
|
public placeholderConfig: PlaceholderConfig = {
|
|
439
454
|
matIcon: 'widgets',
|
|
440
|
-
outlineIcon: true,
|
|
441
455
|
heading: 'Heading',
|
|
442
456
|
message: 'This is a placeholder message.',
|
|
443
457
|
actionLabel: 'ACTION'
|
|
444
458
|
}
|
|
459
|
+
|
|
460
|
+
public onPlaceholderButtonClick(): void {
|
|
461
|
+
// handle placeholder click
|
|
462
|
+
}
|
|
445
463
|
```
|
|
446
464
|
|
|
447
465
|
```html
|
|
448
|
-
<lf-placeholder
|
|
466
|
+
<lf-placeholder
|
|
467
|
+
[placeholderConfig]="placeholderConfig"
|
|
468
|
+
(buttonClickEvent)="onPlaceholderButtonClick()"></lf-placeholder>
|
|
449
469
|
```
|
|
450
470
|
|
|
451
471
|
|
|
@@ -457,7 +477,7 @@ Intercept HTTP Calls and automatically show a loading spinner.
|
|
|
457
477
|
* **Note:** The loading spinner can also be manually shown by udpating the value for `scaffoldConfig.loading` in the `ScaffoldService`
|
|
458
478
|
|
|
459
479
|
```ts
|
|
460
|
-
import { ScaffoldModule } from '@lukfel/ng-scaffold';
|
|
480
|
+
import { ScaffoldLoadingInterceptor, ScaffoldModule } from '@lukfel/ng-scaffold';
|
|
461
481
|
import { isDevMode } from '@angular/core';
|
|
462
482
|
|
|
463
483
|
@NgModule({
|
|
@@ -468,7 +488,7 @@ import { isDevMode } from '@angular/core';
|
|
|
468
488
|
providers: [
|
|
469
489
|
{
|
|
470
490
|
provide: HTTP_INTERCEPTORS,
|
|
471
|
-
useClass:
|
|
491
|
+
useClass: ScaffoldLoadingInterceptor,
|
|
472
492
|
multi: true
|
|
473
493
|
}
|
|
474
494
|
]
|