quang 20.1.9 → 20.2.2
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/components/autocomplete/README.md +71 -54
- package/components/checkbox/README.md +50 -40
- package/components/date/README.md +481 -23
- package/components/input/README.md +150 -26
- package/components/input/index.d.ts +6 -1
- package/components/paginator/README.md +51 -27
- package/components/select/README.md +18 -28
- package/components/wysiwyg/README.md +11 -23
- package/fesm2022/quang-components-input.mjs +11 -4
- package/fesm2022/quang-components-input.mjs.map +1 -1
- package/fesm2022/quang-overlay-modal.mjs +125 -2
- package/fesm2022/quang-overlay-modal.mjs.map +1 -1
- package/fesm2022/quang-overlay-shared.mjs +13 -15
- package/fesm2022/quang-overlay-shared.mjs.map +1 -1
- package/overlay/modal/index.d.ts +34 -3
- package/overlay/shared/index.d.ts +6 -6
- package/package.json +37 -37
|
@@ -1,73 +1,90 @@
|
|
|
1
1
|
# QuangAutocompleteComponent
|
|
2
2
|
|
|
3
|
-
The `QuangAutocompleteComponent`
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Real-time suggestions as the user types
|
|
8
|
-
- Easy selection from filtered options
|
|
9
|
-
- Customizable suggestion list and display
|
|
10
|
-
- Supports Angular Reactive Forms and Template-driven Forms
|
|
11
|
-
- Configurable debounce for search input
|
|
12
|
-
- Readonly and validation support
|
|
13
|
-
- **Multiple selection with chips** (with horizontal/vertical display)
|
|
14
|
-
- Keyboard navigation and chip deletion (Backspace)
|
|
15
|
-
- Focus management for chips (Backspace focuses last chip, second Backspace deletes it)
|
|
3
|
+
The `QuangAutocompleteComponent` is a comprehensive autocomplete input with real-time suggestions, multiple selection capabilities, and chip management. It provides intelligent filtering, keyboard navigation, and seamless integration with Angular forms while supporting both single and multiple selection modes.
|
|
16
4
|
|
|
17
5
|
## Inputs
|
|
18
6
|
|
|
19
|
-
- `selectOptions`: `SelectOption[]` — Array of options
|
|
20
|
-
- `multiple`: `boolean` — Enable multiple selection mode
|
|
21
|
-
- `multiSelectDisplayMode`: `'vertical' | 'horizontal'` —
|
|
22
|
-
- `chipMaxLength`: `number` — Maximum length
|
|
23
|
-
- `syncFormWithText`: `boolean` —
|
|
24
|
-
- `optionListMaxHeight`: `string` —
|
|
25
|
-
- `translateValue`: `boolean` —
|
|
26
|
-
- `scrollBehaviorOnOpen`: `ScrollBehavior` — Scroll behavior when opening
|
|
27
|
-
- `emitOnly`: `boolean` —
|
|
28
|
-
- `searchTextDebounce`: `number` — Debounce
|
|
29
|
-
- `internalFilterOptions`: `boolean` —
|
|
30
|
-
-
|
|
31
|
-
|
|
7
|
+
- `selectOptions`: `SelectOption[]` — Array of available options for selection. Each option should have `value` and `label` properties. **(Required)**
|
|
8
|
+
- `multiple`: `boolean` — Enable multiple selection mode with chip display. Default: `false`
|
|
9
|
+
- `multiSelectDisplayMode`: `'vertical' | 'horizontal'` — Layout direction for chips in multiple mode. Horizontal mode includes scroll support. Default: `'vertical'`
|
|
10
|
+
- `chipMaxLength`: `number` — Maximum character length for chip labels. Longer labels will be truncated with ellipsis. Default: `0` (no limit)
|
|
11
|
+
- `syncFormWithText`: `boolean` — Synchronize form control value with input text as user types. Useful for free-text input with suggestions. Default: `false`
|
|
12
|
+
- `optionListMaxHeight`: `string` — Maximum height for dropdown option list with CSS units. Default: `'200px'`
|
|
13
|
+
- `translateValue`: `boolean` — Enable translation of option values through QuangTranslationService. Default: `true`
|
|
14
|
+
- `scrollBehaviorOnOpen`: `ScrollBehavior` — Scroll behavior when opening dropdown ('smooth' or 'instant'). Default: `'smooth'`
|
|
15
|
+
- `emitOnly`: `boolean` — Only emit selection events without updating form control. Useful for read-only suggestion display. Default: `false`
|
|
16
|
+
- `searchTextDebounce`: `number` — Debounce delay in milliseconds for search input to optimize performance. Default: `300`
|
|
17
|
+
- `internalFilterOptions`: `boolean` — Use built-in filtering logic. Disable for custom external filtering via searchTextChange event. Default: `true`
|
|
18
|
+
- `isReadonly`: `boolean` — Set component to read-only mode. Inherited from `QuangBaseComponent`
|
|
19
|
+
- `componentLabel`: `string` — Label text for the component. Inherited from `QuangBaseComponent`
|
|
20
|
+
- `componentPlaceholder`: `string` — Placeholder text for the input. Inherited from `QuangBaseComponent`
|
|
21
|
+
- `componentTabIndex`: `number` — Tab index for accessibility. Inherited from `QuangBaseComponent`
|
|
22
|
+
- `componentClass`: `string | string[]` — Additional CSS classes. Inherited from `QuangBaseComponent`
|
|
23
|
+
- `errorMap`: `{[key: string]: string}` — Custom error messages. Inherited from `QuangBaseComponent`
|
|
24
|
+
- `successMessage`: `string` — Success message to display. Inherited from `QuangBaseComponent`
|
|
25
|
+
- `helpMessage`: `string` — Help text for the component. Inherited from `QuangBaseComponent`
|
|
26
|
+
- `formControl`: `FormControl` — Form control for reactive forms. Inherited from `QuangBaseComponent`
|
|
32
27
|
|
|
33
28
|
## Outputs
|
|
34
29
|
|
|
35
|
-
- `selectedOption`:
|
|
36
|
-
- `searchTextChange`:
|
|
37
|
-
-
|
|
38
|
-
- `componentBlur`
|
|
30
|
+
- `selectedOption`: `EventEmitter<string | number | null>` — Emitted when an option is selected in single mode. Provides the selected option's value
|
|
31
|
+
- `searchTextChange`: `EventEmitter<string>` — Emitted when search text changes after debounce period. Use for external filtering or API calls
|
|
32
|
+
- `componentBlur`: `EventEmitter<void>` — Emitted when component loses focus. Inherited from `QuangBaseComponent`
|
|
39
33
|
|
|
40
|
-
##
|
|
34
|
+
## Usage
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
- Chips can be displayed horizontally or vertically using `multiSelectDisplayMode`.
|
|
44
|
-
- Chips have a close button for removal. When the input is empty, pressing Backspace focuses the last chip; pressing Backspace again deletes it.
|
|
45
|
-
- Focus is managed for accessibility: after deleting a chip, focus moves to the previous chip or input.
|
|
46
|
-
- Chip container supports horizontal scrolling with the mouse wheel in horizontal mode.
|
|
47
|
-
- You can limit chip label length with `chipMaxLength`.
|
|
36
|
+
### Basic Single Selection
|
|
48
37
|
|
|
49
|
-
|
|
38
|
+
```html
|
|
39
|
+
<quang-autocomplete
|
|
40
|
+
[selectOptions]="countryOptions"
|
|
41
|
+
formControlName="country"
|
|
42
|
+
>
|
|
43
|
+
</quang-autocomplete>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Multiple Selection with Chips
|
|
50
47
|
|
|
51
48
|
```html
|
|
52
49
|
<quang-autocomplete
|
|
50
|
+
[selectOptions]="skillOptions"
|
|
53
51
|
[multiple]="true"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
formControlName="skills"
|
|
53
|
+
>
|
|
54
|
+
</quang-autocomplete>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### TypeScript Example
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
export class MyComponent {
|
|
61
|
+
countryOptions: SelectOption[] = [
|
|
62
|
+
{ value: 'us', label: 'United States' },
|
|
63
|
+
{ value: 'ca', label: 'Canada' },
|
|
64
|
+
{ value: 'uk', label: 'United Kingdom' }
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
skillOptions: SelectOption[] = [
|
|
68
|
+
{ value: 'angular', label: 'Angular' },
|
|
69
|
+
{ value: 'typescript', label: 'TypeScript' },
|
|
70
|
+
{ value: 'javascript', label: 'JavaScript' }
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
onOptionSelected(value: string | number | null): void {
|
|
74
|
+
console.log('Selected:', value)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
onSearchChange(searchTerm: string): void {
|
|
78
|
+
// Handle external filtering
|
|
79
|
+
}
|
|
80
|
+
}
|
|
67
81
|
```
|
|
68
82
|
|
|
69
|
-
|
|
83
|
+
### Translation Integration
|
|
70
84
|
|
|
71
|
-
|
|
85
|
+
The component uses QuangTranslationService for all text content:
|
|
72
86
|
|
|
73
|
-
|
|
87
|
+
- **Automatic Translation**: Option labels and component messages are translated automatically
|
|
88
|
+
- **Key Support**: Use translation keys as labels for automatic localization
|
|
89
|
+
- **Fallback Handling**: Provides fallback display when translations are unavailable
|
|
90
|
+
- **Dynamic Language Switching**: Responds to language changes without component reload
|
|
@@ -1,63 +1,73 @@
|
|
|
1
1
|
# QuangCheckboxComponent
|
|
2
2
|
|
|
3
|
-
The `QuangCheckboxComponent`
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Standard checkbox functionality
|
|
8
|
-
- Toggle switch mode
|
|
9
|
-
- Configurable label position
|
|
10
|
-
- Validation feedback (success and error messages)
|
|
3
|
+
The `QuangCheckboxComponent` is a versatile checkbox and toggle switch component that provides flexible label positioning, comprehensive validation feedback, and seamless integration with Angular forms. It supports both traditional checkbox and modern toggle switch modes with extensive customization options.
|
|
11
4
|
|
|
12
5
|
## Inputs
|
|
13
6
|
|
|
14
|
-
- `checkType`: `'checkbox' | 'toggle'` — Specifies the type
|
|
15
|
-
- `labelPosition`: `'top' | 'left' | 'right' | 'bottom'` — Position of the label. Default: `'top'
|
|
16
|
-
- `removeMargin`: `boolean` — Removes
|
|
17
|
-
-
|
|
18
|
-
|
|
7
|
+
- `checkType`: `'checkbox' | 'toggle'` — Specifies the input type. Checkbox renders as traditional checkmark input, toggle renders as modern switch control. **(Required)**
|
|
8
|
+
- `labelPosition`: `'top' | 'left' | 'right' | 'bottom'` — Position of the label relative to the input control. Affects layout direction and spacing. Default: `'top'`
|
|
9
|
+
- `removeMargin`: `boolean` — Removes default bottom margin and form-check class. Useful for custom layouts or tight spacing requirements. Default: `false`
|
|
10
|
+
- `isReadonly`: `boolean` — Set component to read-only mode. Inherited from `QuangBaseComponent`
|
|
11
|
+
- `componentLabel`: `string` — Label text for the component. Inherited from `QuangBaseComponent`
|
|
12
|
+
- `componentPlaceholder`: `string` — Placeholder text for the input. Inherited from `QuangBaseComponent`
|
|
13
|
+
- `componentTabIndex`: `number` — Tab index for accessibility. Inherited from `QuangBaseComponent`
|
|
14
|
+
- `componentClass`: `string | string[]` — Additional CSS classes. Inherited from `QuangBaseComponent`
|
|
15
|
+
- `errorMap`: `{[key: string]: string}` — Custom error messages. Inherited from `QuangBaseComponent`
|
|
16
|
+
- `successMessage`: `string` — Success message to display. Inherited from `QuangBaseComponent`
|
|
17
|
+
- `helpMessage`: `string` — Help text for the component. Inherited from `QuangBaseComponent`
|
|
18
|
+
- `formControl`: `FormControl` — Form control for reactive forms. Inherited from `QuangBaseComponent`
|
|
19
19
|
|
|
20
20
|
## Outputs
|
|
21
21
|
|
|
22
|
-
- `changedHandler`:
|
|
23
|
-
-
|
|
24
|
-
- `componentBlur`
|
|
22
|
+
- `changedHandler`: `EventEmitter<boolean>` — Emitted when checkbox state changes. Provides the new boolean value (true for checked, false for unchecked)
|
|
23
|
+
- `componentBlur`: `EventEmitter<void>` — Emitted when component loses focus. Inherited from `QuangBaseComponent`
|
|
25
24
|
|
|
26
25
|
## Usage
|
|
27
26
|
|
|
27
|
+
### Basic Checkbox
|
|
28
|
+
|
|
28
29
|
```html
|
|
29
30
|
<quang-checkbox
|
|
30
|
-
[errorMap]="errors()"
|
|
31
|
-
[isReadonly]="isReadonly()"
|
|
32
31
|
checkType="checkbox"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
componentLabel="form.label.agreeToTerms"
|
|
33
|
+
formControlName="agreeToTerms"
|
|
34
|
+
>
|
|
35
|
+
</quang-checkbox>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Toggle Switch
|
|
39
|
+
|
|
40
|
+
```html
|
|
39
41
|
<quang-checkbox
|
|
40
|
-
[errorMap]="errors()"
|
|
41
|
-
[isReadonly]="isReadonly()"
|
|
42
42
|
checkType="toggle"
|
|
43
|
-
|
|
44
|
-
componentLabel="form.label.checkbox"
|
|
45
|
-
formControlName="checkbox"
|
|
43
|
+
componentLabel="form.label.enableNotifications"
|
|
46
44
|
labelPosition="left"
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
formControlName="notifications"
|
|
46
|
+
>
|
|
47
|
+
</quang-checkbox>
|
|
49
48
|
```
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
#### TypeScript Example
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
```typescript
|
|
53
|
+
export class MyComponent {
|
|
54
|
+
form = this.fb.group({
|
|
55
|
+
agreeToTerms: [false, Validators.requiredTrue],
|
|
56
|
+
enableNotifications: [true]
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
onToggleChange(isChecked: boolean): void {
|
|
60
|
+
console.log('Checkbox state changed:', isChecked)
|
|
61
|
+
// Handle state change
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
54
65
|
|
|
55
|
-
|
|
56
|
-
- `.label-bottom`: Positions the label below the checkbox.
|
|
57
|
-
- `.label-left`: Positions the label to the left of the checkbox.
|
|
58
|
-
- `.label-right`: Positions the label to the right of the checkbox.
|
|
59
|
-
- `.toggle-wrapper`: Styles the component as a toggle switch.
|
|
66
|
+
### Translation Integration
|
|
60
67
|
|
|
61
|
-
|
|
68
|
+
The component uses QuangTranslationService for all text content:
|
|
62
69
|
|
|
63
|
-
|
|
70
|
+
- **Automatic Translation**: All labels, help text, and error messages are automatically translated
|
|
71
|
+
- **Key Support**: Use translation keys for all text content
|
|
72
|
+
- **Fallback Handling**: Provides graceful fallback when translations are unavailable
|
|
73
|
+
- **Dynamic Language**: Responds to language changes without component reload
|