angular-material-wrap 0.1.0-beta.2 → 0.1.0-beta.3
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/docs/API-REFERENCE.md
CHANGED
|
@@ -162,20 +162,55 @@ import { AmwDataTableComponent } from "angular-material-wrap";
|
|
|
162
162
|
|
|
163
163
|
#### AmwAutocompleteComponent
|
|
164
164
|
|
|
165
|
-
Enhanced autocomplete with custom filtering and
|
|
165
|
+
Enhanced autocomplete with custom filtering, loading states, and custom templates.
|
|
166
166
|
|
|
167
167
|
```typescript
|
|
168
168
|
import { AmwAutocompleteComponent } from "angular-material-wrap";
|
|
169
169
|
|
|
170
|
-
//
|
|
170
|
+
// Basic usage
|
|
171
171
|
<amw-autocomplete
|
|
172
|
-
[
|
|
173
|
-
[
|
|
172
|
+
[options]="options"
|
|
173
|
+
[loading]="isSearching"
|
|
174
|
+
[startIcon]="'search'"
|
|
174
175
|
[(ngModel)]="selectedValue"
|
|
175
|
-
(optionSelected)="onOptionSelected($event)"
|
|
176
|
+
(optionSelected)="onOptionSelected($event)"
|
|
177
|
+
(inputChanged)="onSearch($event)">
|
|
178
|
+
</amw-autocomplete>
|
|
179
|
+
|
|
180
|
+
// With custom option template
|
|
181
|
+
<amw-autocomplete
|
|
182
|
+
[options]="options"
|
|
183
|
+
[(ngModel)]="selectedValue">
|
|
184
|
+
<ng-template #amwOption let-option>
|
|
185
|
+
<div>{{ option.label }}</div>
|
|
186
|
+
<small>{{ option.subtitle }}</small>
|
|
187
|
+
</ng-template>
|
|
176
188
|
</amw-autocomplete>
|
|
177
189
|
```
|
|
178
190
|
|
|
191
|
+
**Properties:**
|
|
192
|
+
|
|
193
|
+
- `options: AutocompleteOption[]` - Array of options
|
|
194
|
+
- `loading: boolean` - Show loading spinner (default: false)
|
|
195
|
+
- `startIcon: string` - Prefix icon name
|
|
196
|
+
- `noResultsText: string` - Text when no results (default: 'No results found')
|
|
197
|
+
- `multiple: boolean` - Allow multiple selection
|
|
198
|
+
- `clearable: boolean` - Show clear button (default: true)
|
|
199
|
+
- `appearance: 'outline' | 'fill'` - Form field appearance
|
|
200
|
+
- `minLength: number` - Min chars before filtering
|
|
201
|
+
- `displayWith: (value) => string` - Display function
|
|
202
|
+
|
|
203
|
+
**Events:**
|
|
204
|
+
|
|
205
|
+
- `optionSelected: EventEmitter<AutocompleteOption>` - Option selected
|
|
206
|
+
- `inputChanged: EventEmitter<string>` - Input value changed
|
|
207
|
+
- `opened: EventEmitter<void>` - Panel opened
|
|
208
|
+
- `closed: EventEmitter<void>` - Panel closed
|
|
209
|
+
|
|
210
|
+
**Content Projection:**
|
|
211
|
+
|
|
212
|
+
- `#amwOption` - Custom option rendering template
|
|
213
|
+
|
|
179
214
|
#### AmwDatePickerComponent
|
|
180
215
|
|
|
181
216
|
Enhanced date picker with range selection and custom formatting.
|
|
@@ -430,12 +465,75 @@ import { AmwTextareaComponent } from "angular-material-wrap";
|
|
|
430
465
|
- `wrap: 'soft' | 'hard' | 'off'` - Text wrapping mode
|
|
431
466
|
- `readonly: boolean` - Read-only mode
|
|
432
467
|
- `spellcheck: boolean` - Enable spellcheck (default: true)
|
|
468
|
+
- `autoResize: boolean` - Enable automatic height adjustment (default: false)
|
|
469
|
+
- `minRows: number` - Minimum rows when autoResize is enabled (default: 2)
|
|
470
|
+
- `maxRows: number` - Maximum rows when autoResize is enabled
|
|
433
471
|
|
|
434
472
|
**Events:**
|
|
435
473
|
|
|
436
474
|
- `change: EventEmitter<string>` - Fires on value change
|
|
437
475
|
- `input: EventEmitter<string>` - Fires during input
|
|
438
476
|
|
|
477
|
+
#### AmwChipInputComponent
|
|
478
|
+
|
|
479
|
+
Enhanced chip input with autocomplete suggestions for tag-like selection.
|
|
480
|
+
|
|
481
|
+
```typescript
|
|
482
|
+
import { AmwChipInputComponent, ChipInputOption } from "angular-material-wrap";
|
|
483
|
+
|
|
484
|
+
// Usage
|
|
485
|
+
<amw-chip-input
|
|
486
|
+
[suggestions]="ingredientSuggestions"
|
|
487
|
+
[loading]="isSearching"
|
|
488
|
+
[maxChips]="10"
|
|
489
|
+
[(ngModel)]="selectedIngredients"
|
|
490
|
+
(chipAdded)="onChipAdded($event)"
|
|
491
|
+
(chipRemoved)="onChipRemoved($event)"
|
|
492
|
+
(inputChanged)="onSearchChange($event)"
|
|
493
|
+
label="Ingredients"
|
|
494
|
+
placeholder="Add ingredient...">
|
|
495
|
+
</amw-chip-input>
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**ChipInputOption Interface:**
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
interface ChipInputOption {
|
|
502
|
+
value: any; // Unique identifier
|
|
503
|
+
label: string; // Display text
|
|
504
|
+
icon?: string; // Material icon name
|
|
505
|
+
subtitle?: string; // Secondary text
|
|
506
|
+
isCustom?: boolean; // User-created value
|
|
507
|
+
disabled?: boolean; // Option disabled
|
|
508
|
+
data?: any; // Additional data
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
**Properties:**
|
|
513
|
+
|
|
514
|
+
- `suggestions: ChipInputOption[]` - Autocomplete suggestions
|
|
515
|
+
- `appearance: 'outline' | 'fill'` - Form field appearance (default: 'outline')
|
|
516
|
+
- `loading: boolean` - Show loading spinner (default: false)
|
|
517
|
+
- `removable: boolean` - Allow chip removal (default: true)
|
|
518
|
+
- `allowCustomValues: boolean` - Allow custom values (default: true)
|
|
519
|
+
- `maxChips: number | null` - Maximum chips allowed (default: null)
|
|
520
|
+
- `separatorKeyCodes: number[]` - Keys that add chips (default: [ENTER, COMMA])
|
|
521
|
+
- `addOnBlur: boolean` - Add chip on blur (default: true)
|
|
522
|
+
- `filterDebounce: number` - Filter debounce time in ms (default: 300)
|
|
523
|
+
- `displayWith: (option) => string` - Custom display function
|
|
524
|
+
|
|
525
|
+
**Events:**
|
|
526
|
+
|
|
527
|
+
- `chipAdded: EventEmitter<ChipInputOption>` - Chip added
|
|
528
|
+
- `chipRemoved: EventEmitter<ChipInputOption>` - Chip removed
|
|
529
|
+
- `inputChanged: EventEmitter<string>` - Input value changed (debounced)
|
|
530
|
+
- `suggestionSelected: EventEmitter<ChipInputOption>` - Suggestion selected
|
|
531
|
+
|
|
532
|
+
**Content Projection:**
|
|
533
|
+
|
|
534
|
+
- `#chipTemplate` - Custom chip rendering template
|
|
535
|
+
- `#suggestionTemplate` - Custom suggestion rendering template
|
|
536
|
+
|
|
439
537
|
#### AmwFileInputComponent
|
|
440
538
|
|
|
441
539
|
Enhanced file input with drag-and-drop, preview, validation, and upload progress tracking.
|