@lukfel/ng-scaffold 20.0.11 → 20.0.13
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 +95 -0
- package/fesm2022/lukfel-ng-scaffold.mjs +248 -183
- package/fesm2022/lukfel-ng-scaffold.mjs.map +1 -1
- package/index.d.ts +49 -5
- package/package.json +1 -1
- package/styles/_theme.scss +1 -0
- package/styles/_variables.scss +1 -1
package/README.md
CHANGED
|
@@ -356,6 +356,101 @@ export class AppComponent {
|
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
|
|
359
|
+
## Standalone Components
|
|
360
|
+
In addition to the components provided by default by the the `ScaffoldModule` there are several standalone components that can be utilized.
|
|
361
|
+
|
|
362
|
+
* **Note:** Standalone components must be imported manually and are not part of the `ScaffoldModule` import
|
|
363
|
+
|
|
364
|
+
### List
|
|
365
|
+
A flexible, Material Design–inspired list and table hybrid component for displaying structured collections of items. It supports avatars, titles, subtitles, actions, and selection checkboxes — making it ideal for dashboards, inventories, and administrative views.
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
import { ListComponent } from '@lukfel/ng-scaffold';
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
```ts
|
|
372
|
+
import { ListAction, ListItem } from '@lukfel/ng-scaffold';
|
|
373
|
+
|
|
374
|
+
public items: ListItem[] = [
|
|
375
|
+
{ title: 'Item 1' },
|
|
376
|
+
{ title: 'Item 2', subtitle: 'My delete action is disabled', disabledActions: ['delete'] },
|
|
377
|
+
{ title: 'Item 3', subtitle: 'My edit action is hidden', hiddenActions: ['edit'] }
|
|
378
|
+
];
|
|
379
|
+
|
|
380
|
+
public actions: ListAction[] = [
|
|
381
|
+
{ id: 'edit', matIcon: 'edit' },
|
|
382
|
+
{ id: 'delete', matIcon: 'delete', color: 'warn' }
|
|
383
|
+
];
|
|
384
|
+
|
|
385
|
+
public onActionClick(event: { id: string, item: ListItem }): void {
|
|
386
|
+
// handle list actions
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
public onSelectionChange(items: ListItem[]): void {
|
|
390
|
+
// handle selection changes
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
```html
|
|
395
|
+
<lf-list
|
|
396
|
+
[items]="items"
|
|
397
|
+
[actions]="actions"
|
|
398
|
+
[showHeader]="true"
|
|
399
|
+
[enableCheckboxes]="true"
|
|
400
|
+
avatarFallbackPath="assets/img/error/missing.png"
|
|
401
|
+
(actionClick)="onActionClick($event)"
|
|
402
|
+
(selectionChange)="onSelectionChange($event)"></lf-list>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### File-Upload
|
|
406
|
+
A lightweight Angular component that provides a clean, Material Design–styled button for selecting and uploading files. It wraps a hidden native file input and exposes a simple, customizable interface with built-in icon, tooltip, and state management.
|
|
407
|
+
|
|
408
|
+
```ts
|
|
409
|
+
import { FileUploadComponent } from '@lukfel/ng-scaffold';
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
```ts
|
|
413
|
+
public uploadFile(file: File): void {
|
|
414
|
+
// handle file upload
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
```html
|
|
419
|
+
<lf-file-upload
|
|
420
|
+
color="accent"
|
|
421
|
+
label="Upload File"
|
|
422
|
+
matIcon="upload"
|
|
423
|
+
[disabled]="false"
|
|
424
|
+
accept="*"
|
|
425
|
+
(fileChange)="uploadFile($event)"></lf-file-upload>
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### Placeholder
|
|
429
|
+
A versatile UI component designed to display an informative placeholder or empty state when no data is available. It provides a structured layout for an icon, heading, message, and optional action — helping guide users toward the next step.
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
import { PlaceholderComponent } from '@lukfel/ng-scaffold';
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
```ts
|
|
436
|
+
import { PlaceholderConfig } from '@lukfel/ng-scaffold';
|
|
437
|
+
|
|
438
|
+
public placeholderConfig: PlaceholderConfig = {
|
|
439
|
+
matIcon: 'widgets',
|
|
440
|
+
outlineIcon: true,
|
|
441
|
+
heading: 'Heading',
|
|
442
|
+
message: 'This is a placeholder message.',
|
|
443
|
+
actionLabel: 'ACTION'
|
|
444
|
+
}
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
```html
|
|
448
|
+
<lf-placeholder [placeholderConfig]="placeholderConfig"></lf-placeholder>
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
359
454
|
## Interceptors
|
|
360
455
|
Intercept HTTP Calls and automatically show a loading spinner.
|
|
361
456
|
|