ngx-lite-form 1.3.3 → 1.3.5
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 +179 -36
- package/fesm2022/ngx-lite-form.mjs +70 -31
- package/fesm2022/ngx-lite-form.mjs.map +1 -1
- package/index.d.ts +11 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,17 +6,17 @@ This library is built for developers who need a robust, out-of-the-box solution
|
|
|
6
6
|
|
|
7
7
|
## Why Choose Lite Form?
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
9
|
+
- **Accelerate Development**: Get a complete suite of form controls ready to use, including complex components like date pickers, file uploads, and data tables. Drastically reduce boilerplate code.
|
|
10
|
+
- **Lightweight & Performant**: Built with modern Angular practices. All components are standalone and tree-shakable, ensuring a minimal bundle size.
|
|
11
|
+
- **Fully Typed & Integrated**: Enjoy excellent developer experience with fully-typed APIs for all components and Data Transfer Objects (DTOs), ensuring type safety and easier integration.
|
|
12
|
+
- **Highly Customizable**: While providing a clean default UI, the library is designed for easy styling. A clear SCSS structure and BEM-style classes allow for deep customization to match your brand.
|
|
13
|
+
- **Secure & Accessible**: Components are built with security and accessibility (ARIA) in mind, including advanced password strength analysis and accessible form field structures.
|
|
14
14
|
|
|
15
15
|
## Live Demo
|
|
16
16
|
|
|
17
17
|
Experience Lite Form in action with our interactive live demo on StackBlitz. Test out all the components and see how they work in a real Angular application.
|
|
18
18
|
|
|
19
|
-
[
|
|
19
|
+
[**Launch Live Demo on StackBlitz**](https://stackblitz.com/~/github.com/liangk/lite-form)
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
## Use Cases
|
|
@@ -30,63 +30,63 @@ Lite Form is ideal for a wide range of applications, including but not limited t
|
|
|
30
30
|
- **Internal Tools**: Rapidly prototype and build internal tools for data collection and management.
|
|
31
31
|
|
|
32
32
|
## Features
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
33
|
+
- **Modern Angular 20+** - Built with standalone components, signals, and latest CLI tooling
|
|
34
|
+
- **TypeScript Support** - Fully typed with generic support and DTO helpers
|
|
35
|
+
- **Reactive Forms** - Integrated with Angular Reactive Forms
|
|
36
|
+
- **Built-in Validation** - Form validation with error messages and utilities
|
|
37
|
+
- **Password Security** - Advanced password validation and strength analysis
|
|
38
|
+
- **Date Handling** - Single date and date range selection with custom formatting
|
|
39
|
+
- **File Upload** - Drag & drop file upload with camera capture and file management
|
|
40
|
+
- **Panels & Dialogs** - Modal panels supporting string, template, or component content with configurable action buttons
|
|
41
|
+
- **Data Tables** - Flexible table component with custom columns, sorting, and pagination
|
|
42
|
+
- **Pagination** - Standalone pagination component with customizable navigation
|
|
43
|
+
- **Loading Indicators** - Spinner and progress bar components with defined/indeterminate states
|
|
44
|
+
- **Customizable Styling** - Space-saving SCSS style guide for consistent overrides
|
|
45
|
+
- **Accessibility** - ARIA-compliant form controls
|
|
46
|
+
- **Animations** - Smooth transitions and interactions
|
|
47
47
|
|
|
48
48
|
## Components
|
|
49
49
|
|
|
50
|
-
###
|
|
50
|
+
### LiteInput
|
|
51
51
|
Basic text input component with floating labels and validation.
|
|
52
52
|
|
|
53
|
-
###
|
|
53
|
+
### LitePassword
|
|
54
54
|
Password input component with toggle visibility, strength indicator, and advanced validation features.
|
|
55
55
|
|
|
56
|
-
###
|
|
56
|
+
### LiteTextarea
|
|
57
57
|
Multi-line text input with auto-resize capabilities.
|
|
58
58
|
|
|
59
|
-
###
|
|
59
|
+
### LiteSelect
|
|
60
60
|
Single-selection dropdown with search and filtering.
|
|
61
61
|
|
|
62
|
-
###
|
|
62
|
+
### LiteMultiSelect
|
|
63
63
|
Multi-selection dropdown with inline selected items display and dynamic height adjustment.
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### LiteRadio
|
|
66
66
|
Radio button group component for single selection from multiple options.
|
|
67
67
|
|
|
68
|
-
###
|
|
68
|
+
### LiteCheckbox
|
|
69
69
|
Checkbox component for boolean input with validation support.
|
|
70
70
|
|
|
71
|
-
###
|
|
71
|
+
### LiteDate
|
|
72
72
|
Advanced date picker component with single date and date range selection, custom formatting, and intelligent calendar positioning.
|
|
73
73
|
|
|
74
|
-
###
|
|
74
|
+
### LiteFile
|
|
75
75
|
File upload component with drag & drop, badge, file management panel, and camera capture support.
|
|
76
76
|
|
|
77
|
-
###
|
|
77
|
+
### LiteDateTime
|
|
78
78
|
Date and time picker with timezone-safe handling and consistent formatting utilities.
|
|
79
79
|
|
|
80
|
-
###
|
|
80
|
+
### LiteTable
|
|
81
81
|
Flexible data table component with custom columns, cell templates, nested property access, and integrated pagination.
|
|
82
82
|
|
|
83
|
-
###
|
|
83
|
+
### LitePaginator
|
|
84
84
|
Standalone pagination component with customizable page navigation, items per page selection, and total item display.
|
|
85
85
|
|
|
86
|
-
###
|
|
87
|
-
Modal-style panel component that renders
|
|
86
|
+
### LitePanel
|
|
87
|
+
Modal-style panel component that renders string content, Angular templates, or dynamic components. Supports configurable header text and action buttons via `LitePanelAction` definitions. Accepts custom `width`, `height`, `maxWidth`, and `maxHeight` inputs with automatic `px` suffix for numeric values.
|
|
88
88
|
|
|
89
|
-
###
|
|
89
|
+
### LiteLoading
|
|
90
90
|
Loading indicator component with view toggle for spinner (loading wheel) or progress bar modes. Supports defined progress percentage (0-100) or indeterminate animation, optional message display, and configurable spinner sizes (small, medium, large).
|
|
91
91
|
|
|
92
92
|
---
|
|
@@ -684,6 +684,149 @@ onRowMenuAction(event: { action: string; row: any }) {
|
|
|
684
684
|
<lite-table [table]="table" (menuAction)="onRowMenuAction($event)"></lite-table>
|
|
685
685
|
```
|
|
686
686
|
|
|
687
|
+
### LitePanel Component
|
|
688
|
+
|
|
689
|
+
**Selector:** `lite-panel`
|
|
690
|
+
|
|
691
|
+
| Input | Type | Default | Description |
|
|
692
|
+
| :---- | :--- | :------ | :---------- |
|
|
693
|
+
| `title` | `string \| null` | `null` | Panel header title text |
|
|
694
|
+
| `content` | `string \| TemplateRef \| Type<any> \| null` | `null` | Content to display: string, template, or component |
|
|
695
|
+
| `contentInputs` | `Record<string, any> \| null` | `null` | Inputs to pass to dynamic component content |
|
|
696
|
+
| `actions` | `LitePanelAction[] \| null` | `null` | Action buttons (defaults to single OK button) |
|
|
697
|
+
| `closeOnOverlayClick` | `boolean` | `true` | Whether clicking backdrop closes the panel |
|
|
698
|
+
| `width` | `string \| number \| null` | `null` | Panel width (numeric values get px suffix) |
|
|
699
|
+
| `height` | `string \| number \| null` | `null` | Panel height (numeric values get px suffix) |
|
|
700
|
+
| `maxWidth` | `string \| number \| null` | `null` | Maximum panel width |
|
|
701
|
+
| `maxHeight` | `string \| number \| null` | `null` | Maximum panel height |
|
|
702
|
+
|
|
703
|
+
| Output | Type | Description |
|
|
704
|
+
| :----- | :--- | :---------- |
|
|
705
|
+
| `closed` | `unknown \| null` | Emitted when panel closes with action value or null |
|
|
706
|
+
|
|
707
|
+
**Features:**
|
|
708
|
+
- Three content types: string, Angular template, or dynamic component
|
|
709
|
+
- Configurable action buttons with variants (primary, secondary, danger)
|
|
710
|
+
- Customizable dimensions with automatic px suffix for numbers
|
|
711
|
+
- Backdrop click to close (configurable)
|
|
712
|
+
- Close button in header
|
|
713
|
+
- Component content with input binding support
|
|
714
|
+
- Accessible with ARIA attributes
|
|
715
|
+
|
|
716
|
+
**String Content Example:**
|
|
717
|
+
```typescript
|
|
718
|
+
panelOpen = signal(false);
|
|
719
|
+
|
|
720
|
+
openPanel() {
|
|
721
|
+
this.panelOpen.set(true);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
onPanelClosed(result: unknown | null) {
|
|
725
|
+
this.panelOpen.set(false);
|
|
726
|
+
}
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
```html
|
|
730
|
+
@if (panelOpen()) {
|
|
731
|
+
<lite-panel
|
|
732
|
+
[title]="'Information'"
|
|
733
|
+
[content]="'This is simple text content.'"
|
|
734
|
+
(closed)="onPanelClosed($event)">
|
|
735
|
+
</lite-panel>
|
|
736
|
+
}
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
**Template Content Example:**
|
|
740
|
+
```typescript
|
|
741
|
+
panelActions: LitePanelAction[] = [
|
|
742
|
+
{ label: 'Confirm', value: 'confirm', variant: 'primary' },
|
|
743
|
+
{ label: 'Cancel', value: null, variant: 'secondary' }
|
|
744
|
+
];
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
```html
|
|
748
|
+
@if (panelOpen()) {
|
|
749
|
+
<lite-panel
|
|
750
|
+
[title]="'Confirmation'"
|
|
751
|
+
[content]="confirmTemplate"
|
|
752
|
+
[actions]="panelActions"
|
|
753
|
+
width="500px"
|
|
754
|
+
(closed)="onPanelClosed($event)">
|
|
755
|
+
</lite-panel>
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
<ng-template #confirmTemplate let-close="close">
|
|
759
|
+
<p>Are you sure you want to proceed?</p>
|
|
760
|
+
<button (click)="close('custom-value')">Custom Action</button>
|
|
761
|
+
</ng-template>
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
**Component Content Example:**
|
|
765
|
+
```typescript
|
|
766
|
+
import { Component, Type } from '@angular/core';
|
|
767
|
+
import { FormControl, Validators } from '@angular/forms';
|
|
768
|
+
import { LiteInput, FieldDto } from 'ngx-lite-form';
|
|
769
|
+
|
|
770
|
+
// Create a standalone component for panel content
|
|
771
|
+
@Component({
|
|
772
|
+
selector: 'user-form',
|
|
773
|
+
standalone: true,
|
|
774
|
+
imports: [LiteInput],
|
|
775
|
+
template: `
|
|
776
|
+
<div class="form-content">
|
|
777
|
+
<p>Fill out the form below:</p>
|
|
778
|
+
<lite-input [control]="nameField"></lite-input>
|
|
779
|
+
<lite-input [control]="emailField"></lite-input>
|
|
780
|
+
</div>
|
|
781
|
+
`
|
|
782
|
+
})
|
|
783
|
+
export class UserFormComponent {
|
|
784
|
+
nameField = new FieldDto('Name', new FormControl('', [Validators.required]));
|
|
785
|
+
emailField = new FieldDto('Email', new FormControl('', [Validators.required, Validators.email]));
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// In your main component
|
|
789
|
+
userFormComponent: Type<any> = UserFormComponent;
|
|
790
|
+
panelActions: LitePanelAction[] = [
|
|
791
|
+
{ label: 'Submit', value: 'submit', variant: 'primary' },
|
|
792
|
+
{ label: 'Cancel', value: null, variant: 'secondary' }
|
|
793
|
+
];
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
```html
|
|
797
|
+
@if (panelOpen()) {
|
|
798
|
+
<lite-panel
|
|
799
|
+
[title]="'User Registration'"
|
|
800
|
+
[content]="userFormComponent"
|
|
801
|
+
[actions]="panelActions"
|
|
802
|
+
width="600px"
|
|
803
|
+
maxHeight="80vh"
|
|
804
|
+
(closed)="onPanelClosed($event)">
|
|
805
|
+
</lite-panel>
|
|
806
|
+
}
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
**Passing Inputs to Component Content:**
|
|
810
|
+
```typescript
|
|
811
|
+
// Component with inputs
|
|
812
|
+
@Component({...})
|
|
813
|
+
export class DataViewComponent {
|
|
814
|
+
@Input() userId!: number;
|
|
815
|
+
@Input() mode!: string;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
// Usage
|
|
819
|
+
componentInputs = { userId: 123, mode: 'edit' };
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
```html
|
|
823
|
+
<lite-panel
|
|
824
|
+
[content]="dataViewComponent"
|
|
825
|
+
[contentInputs]="componentInputs"
|
|
826
|
+
(closed)="onPanelClosed($event)">
|
|
827
|
+
</lite-panel>
|
|
828
|
+
```
|
|
829
|
+
|
|
687
830
|
### LiteLoading Component
|
|
688
831
|
|
|
689
832
|
**Selector:** `lite-loading`
|
|
@@ -986,4 +1129,4 @@ This project is licensed under the MIT License - see the [LICENSE](https://githu
|
|
|
986
1129
|
---
|
|
987
1130
|
|
|
988
1131
|
## Changelog
|
|
989
|
-
- See [docs/CHANGELOG.md](https://github.com/liangk/lite-form/blob/main/docs/CHANGELOG.md) for the full historical record, including the latest `v1.3.
|
|
1132
|
+
- See [docs/CHANGELOG.md](https://github.com/liangk/lite-form/blob/main/docs/CHANGELOG.md) for the full historical record, including the latest `v1.3.5` release with LitePanel data extraction from dynamic components and improved table scrolling.
|