@m1z23r/ngx-ui 1.1.37 → 1.1.39
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 +74 -27
- package/fesm2022/m1z23r-ngx-ui.mjs +58 -32
- package/fesm2022/m1z23r-ngx-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/m1z23r-ngx-ui.d.ts +17 -3
package/README.md
CHANGED
|
@@ -45,12 +45,20 @@ import { ButtonComponent } from '@m1z23r/ngx-ui';
|
|
|
45
45
|
@Component({
|
|
46
46
|
imports: [ButtonComponent],
|
|
47
47
|
template: `
|
|
48
|
-
<ui-button
|
|
48
|
+
<ui-button color="primary" size="md" (clicked)="handleClick($event)">
|
|
49
49
|
Click me
|
|
50
50
|
</ui-button>
|
|
51
51
|
|
|
52
|
-
<ui-button variant="outline" [loading]="isLoading">
|
|
53
|
-
|
|
52
|
+
<ui-button variant="outline" color="danger" [loading]="isLoading">
|
|
53
|
+
Delete
|
|
54
|
+
</ui-button>
|
|
55
|
+
|
|
56
|
+
<ui-button variant="ghost" color="secondary">
|
|
57
|
+
Cancel
|
|
58
|
+
</ui-button>
|
|
59
|
+
|
|
60
|
+
<ui-button variant="elevated" color="success">
|
|
61
|
+
Save
|
|
54
62
|
</ui-button>
|
|
55
63
|
`
|
|
56
64
|
})
|
|
@@ -60,7 +68,8 @@ import { ButtonComponent } from '@m1z23r/ngx-ui';
|
|
|
60
68
|
|
|
61
69
|
| Input | Type | Default | Description |
|
|
62
70
|
|-------|------|---------|-------------|
|
|
63
|
-
| `variant` | `'
|
|
71
|
+
| `variant` | `'default' \| 'outline' \| 'ghost' \| 'elevated'` | `'default'` | Button style variant |
|
|
72
|
+
| `color` | `'primary' \| 'secondary' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Button color |
|
|
64
73
|
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
|
|
65
74
|
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | HTML button type |
|
|
66
75
|
| `disabled` | `boolean` | `false` | Disable the button |
|
|
@@ -109,6 +118,9 @@ import { InputComponent } from '@m1z23r/ngx-ui';
|
|
|
109
118
|
| `readonly` | `boolean` | `false` | Make input read-only |
|
|
110
119
|
| `required` | `boolean` | `false` | Mark as required (shows asterisk) |
|
|
111
120
|
| `id` | `string` | auto-generated | Custom input ID |
|
|
121
|
+
| `validators` | `ValidatorFn[]` | `[]` | Array of validator functions |
|
|
122
|
+
| `validatorFn` | `ValidatorFn \| null` | `null` | Single validator function |
|
|
123
|
+
| `showErrorsOn` | `'touched' \| 'dirty' \| 'always'` | `'touched'` | When to show validation errors |
|
|
112
124
|
|
|
113
125
|
#### Two-way Binding
|
|
114
126
|
|
|
@@ -116,6 +128,26 @@ import { InputComponent } from '@m1z23r/ngx-ui';
|
|
|
116
128
|
|-------|------|-------------|
|
|
117
129
|
| `value` | `string \| number` | The input value |
|
|
118
130
|
|
|
131
|
+
#### Validation
|
|
132
|
+
|
|
133
|
+
The input component has built-in validation support:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
// Computed properties
|
|
137
|
+
errors: Signal<ValidationError[]> // All current validation errors
|
|
138
|
+
isValid: Signal<boolean> // Whether input passes validation
|
|
139
|
+
isInvalid: Signal<boolean> // Whether input fails validation
|
|
140
|
+
errorMessage: Signal<string | null> // First error message
|
|
141
|
+
validationState: Signal<ValidationState> // Full validation state
|
|
142
|
+
|
|
143
|
+
// Methods
|
|
144
|
+
reset(): void // Reset value and validation state
|
|
145
|
+
markAsTouched(): void // Mark as touched
|
|
146
|
+
markAsDirty(): void // Mark as dirty
|
|
147
|
+
hasError(key: string): boolean // Check for specific error
|
|
148
|
+
getError(key: string): ValidationError | undefined // Get specific error
|
|
149
|
+
```
|
|
150
|
+
|
|
119
151
|
---
|
|
120
152
|
|
|
121
153
|
### Table
|
|
@@ -399,7 +431,7 @@ import { ButtonComponent, LoadingDirective, LoadingService } from '@m1z23r/ngx-u
|
|
|
399
431
|
<!-- These buttons automatically show loading when their identifier is active -->
|
|
400
432
|
<ui-button uiLoading="login" (clicked)="login()">Login</ui-button>
|
|
401
433
|
<ui-button uiLoading="submit" (clicked)="submit()">Submit</ui-button>
|
|
402
|
-
<ui-button uiLoading="delete" variant="outline">Delete</ui-button>
|
|
434
|
+
<ui-button uiLoading="delete" variant="outline" color="danger">Delete</ui-button>
|
|
403
435
|
`
|
|
404
436
|
})
|
|
405
437
|
export class MyComponent {
|
|
@@ -569,7 +601,7 @@ import { CircularProgressComponent } from '@m1z23r/ngx-ui';
|
|
|
569
601
|
|-------|------|---------|-------------|
|
|
570
602
|
| `value` | `number` | `0` | Progress value (0-100) |
|
|
571
603
|
| `variant` | `'primary' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Color variant |
|
|
572
|
-
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Circle size |
|
|
604
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Circle size |
|
|
573
605
|
| `strokeWidth` | `number` | `4` | Stroke width in pixels |
|
|
574
606
|
| `showLabel` | `boolean` | `false` | Show percentage in center |
|
|
575
607
|
| `indeterminate` | `boolean` | `false` | Spinning animation |
|
|
@@ -791,6 +823,7 @@ import { TabsComponent, TabComponent } from '@m1z23r/ngx-ui';
|
|
|
791
823
|
| `variant` | `'default' \| 'pills' \| 'underline'` | `'default'` | Tab style |
|
|
792
824
|
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Tab size |
|
|
793
825
|
| `ariaLabel` | `string` | `''` | Accessibility label |
|
|
826
|
+
| `renderMode` | `'conditional' \| 'persistent'` | `'conditional'` | Tab content rendering strategy |
|
|
794
827
|
|
|
795
828
|
### Tabs Two-way Binding
|
|
796
829
|
|
|
@@ -798,12 +831,6 @@ import { TabsComponent, TabComponent } from '@m1z23r/ngx-ui';
|
|
|
798
831
|
|-------|------|-------------|
|
|
799
832
|
| `activeTab` | `string \| number` | Active tab ID or index |
|
|
800
833
|
|
|
801
|
-
### Tabs Outputs
|
|
802
|
-
|
|
803
|
-
| Output | Type | Description |
|
|
804
|
-
|--------|------|-------------|
|
|
805
|
-
| `changed` | `string \| number` | Emitted when active tab changes |
|
|
806
|
-
|
|
807
834
|
### Tab Inputs
|
|
808
835
|
|
|
809
836
|
| Input | Type | Default | Description |
|
|
@@ -876,10 +903,10 @@ export class MyComponent {
|
|
|
876
903
|
| Method | Parameters | Returns | Description |
|
|
877
904
|
|--------|------------|---------|-------------|
|
|
878
905
|
| `show(config)` | `ToastConfig` | `ToastRef` | Show toast with full config |
|
|
879
|
-
| `success(message, title?)` | `string, string?` | `ToastRef` | Success toast |
|
|
880
|
-
| `error(message, title?)` | `string, string?` | `ToastRef` | Error toast |
|
|
881
|
-
| `warning(message, title?)` | `string, string?` | `ToastRef` | Warning toast |
|
|
882
|
-
| `info(message, title?)` | `string, string?` | `ToastRef` | Info toast |
|
|
906
|
+
| `success(message, title?, duration?)` | `string, string?, number?` | `ToastRef` | Success toast |
|
|
907
|
+
| `error(message, title?, duration?)` | `string, string?, number?` | `ToastRef` | Error toast |
|
|
908
|
+
| `warning(message, title?, duration?)` | `string, string?, number?` | `ToastRef` | Warning toast |
|
|
909
|
+
| `info(message, title?, duration?)` | `string, string?, number?` | `ToastRef` | Info toast |
|
|
883
910
|
| `dismiss(id)` | `string` | `void` | Dismiss specific toast |
|
|
884
911
|
| `dismissAll()` | - | `void` | Dismiss all toasts |
|
|
885
912
|
|
|
@@ -894,6 +921,7 @@ export class MyComponent {
|
|
|
894
921
|
| `position` | `ToastPosition` | `'top-right'` | Screen position |
|
|
895
922
|
| `dismissible` | `boolean` | `true` | Show close button |
|
|
896
923
|
| `showProgress` | `boolean` | `true` | Show countdown bar |
|
|
924
|
+
| `maxVisible` | `number` | - | Max visible toasts at once |
|
|
897
925
|
|
|
898
926
|
### ToastPosition Values
|
|
899
927
|
|
|
@@ -927,7 +955,6 @@ import { PaginationComponent } from '@m1z23r/ngx-ui';
|
|
|
927
955
|
[maxPages]="7"
|
|
928
956
|
[showFirstLast]="true"
|
|
929
957
|
size="md"
|
|
930
|
-
(changed)="onPageChange($event)"
|
|
931
958
|
/>
|
|
932
959
|
```
|
|
933
960
|
|
|
@@ -947,12 +974,6 @@ import { PaginationComponent } from '@m1z23r/ngx-ui';
|
|
|
947
974
|
|-------|------|-------------|
|
|
948
975
|
| `page` | `number` | Current page (1-indexed) |
|
|
949
976
|
|
|
950
|
-
### Outputs
|
|
951
|
-
|
|
952
|
-
| Output | Type | Description |
|
|
953
|
-
|--------|------|-------------|
|
|
954
|
-
| `changed` | `number` | Emitted when page changes |
|
|
955
|
-
|
|
956
977
|
### Features
|
|
957
978
|
|
|
958
979
|
- **Smart truncation**: Shows ellipsis when there are many pages
|
|
@@ -981,7 +1002,7 @@ import { DialogService, DIALOG_DATA, DIALOG_REF, DialogRef, ModalComponent, Butt
|
|
|
981
1002
|
<p>{{ data.message }}</p>
|
|
982
1003
|
|
|
983
1004
|
<ng-container footer>
|
|
984
|
-
<ui-button variant="outline" (clicked)="dialogRef.close(false)">Cancel</ui-button>
|
|
1005
|
+
<ui-button variant="outline" color="secondary" (clicked)="dialogRef.close(false)">Cancel</ui-button>
|
|
985
1006
|
<ui-button (clicked)="dialogRef.close(true)">Confirm</ui-button>
|
|
986
1007
|
</ng-container>
|
|
987
1008
|
</ui-modal>
|
|
@@ -1021,7 +1042,7 @@ A wrapper component that provides the modal UI with backdrop, header, body, and
|
|
|
1021
1042
|
|
|
1022
1043
|
<!-- Footer content (named slot) -->
|
|
1023
1044
|
<ng-container footer>
|
|
1024
|
-
<ui-button variant="outline" (clicked)="cancel()">Cancel</ui-button>
|
|
1045
|
+
<ui-button variant="outline" color="secondary" (clicked)="cancel()">Cancel</ui-button>
|
|
1025
1046
|
<ui-button (clicked)="save()">Save</ui-button>
|
|
1026
1047
|
</ng-container>
|
|
1027
1048
|
</ui-modal>
|
|
@@ -1109,8 +1130,17 @@ All components use CSS custom properties for styling. Override these in your glo
|
|
|
1109
1130
|
|
|
1110
1131
|
// Semantic colors
|
|
1111
1132
|
--ui-success: #22c55e;
|
|
1133
|
+
--ui-success-hover: #16a34a;
|
|
1134
|
+
--ui-success-active: #15803d;
|
|
1135
|
+
--ui-success-text: #ffffff;
|
|
1112
1136
|
--ui-danger: #ef4444;
|
|
1137
|
+
--ui-danger-hover: #dc2626;
|
|
1138
|
+
--ui-danger-active: #b91c1c;
|
|
1139
|
+
--ui-danger-text: #ffffff;
|
|
1113
1140
|
--ui-warning: #f59e0b;
|
|
1141
|
+
--ui-warning-hover: #d97706;
|
|
1142
|
+
--ui-warning-active: #b45309;
|
|
1143
|
+
--ui-warning-text: #ffffff;
|
|
1114
1144
|
|
|
1115
1145
|
// Background colors
|
|
1116
1146
|
--ui-bg: #ffffff;
|
|
@@ -1132,6 +1162,7 @@ All components use CSS custom properties for styling. Override these in your glo
|
|
|
1132
1162
|
--ui-radius-sm: 0.25rem;
|
|
1133
1163
|
--ui-radius-md: 0.375rem;
|
|
1134
1164
|
--ui-radius-lg: 0.5rem;
|
|
1165
|
+
--ui-radius-xl: 0.75rem;
|
|
1135
1166
|
|
|
1136
1167
|
// Spacing
|
|
1137
1168
|
--ui-spacing-xs: 0.25rem;
|
|
@@ -1146,10 +1177,13 @@ All components use CSS custom properties for styling. Override these in your glo
|
|
|
1146
1177
|
--ui-navbar-height: 4rem;
|
|
1147
1178
|
--ui-footer-height: 3rem;
|
|
1148
1179
|
|
|
1180
|
+
// Breakpoints
|
|
1181
|
+
--ui-breakpoint-mobile: 768px;
|
|
1182
|
+
|
|
1149
1183
|
// Shadows
|
|
1150
1184
|
--ui-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
1151
|
-
--ui-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
1152
|
-
--ui-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
1185
|
+
--ui-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
1186
|
+
--ui-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
1153
1187
|
|
|
1154
1188
|
// Transitions
|
|
1155
1189
|
--ui-transition-fast: 150ms ease;
|
|
@@ -1161,6 +1195,19 @@ All components use CSS custom properties for styling. Override these in your glo
|
|
|
1161
1195
|
--ui-font-sm: 0.875rem;
|
|
1162
1196
|
--ui-font-md: 1rem;
|
|
1163
1197
|
--ui-font-lg: 1.125rem;
|
|
1198
|
+
--ui-font-xl: 1.25rem;
|
|
1199
|
+
|
|
1200
|
+
// Dropdown & Select
|
|
1201
|
+
--ui-dropdown-bg: var(--ui-bg);
|
|
1202
|
+
--ui-dropdown-border: var(--ui-border);
|
|
1203
|
+
--ui-dropdown-shadow: var(--ui-shadow-lg);
|
|
1204
|
+
--ui-dropdown-radius: var(--ui-radius-md);
|
|
1205
|
+
--ui-dropdown-max-height: 300px;
|
|
1206
|
+
|
|
1207
|
+
// Option/Item states
|
|
1208
|
+
--ui-option-hover-bg: var(--ui-bg-hover);
|
|
1209
|
+
--ui-option-selected-bg: color-mix(in srgb, var(--ui-primary) 10%, transparent);
|
|
1210
|
+
--ui-option-selected-text: var(--ui-primary);
|
|
1164
1211
|
}
|
|
1165
1212
|
```
|
|
1166
1213
|
|