angular-ui-controls 0.1.0-rc.2 → 0.1.0-rc.4

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.
@@ -0,0 +1,162 @@
1
+ # NumberInputComponent
2
+
3
+ Numeric values.
4
+
5
+ Selector `ui-number-input`.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { NumberInputComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `NumberInputComponent` to the host component's imports. Add `FormsModule` for this example.
14
+
15
+ ```html
16
+ <ui-number-input
17
+ inputId="quantity"
18
+ label="Quantity"
19
+ [(ngModel)]="quantity"
20
+ [minValue]="0"
21
+ [maxValue]="100"
22
+ [allowDecimal]="false"
23
+ />
24
+ ```
25
+
26
+ Example fields in the host component.
27
+
28
+ ```ts
29
+ quantity = 1;
30
+ ```
31
+
32
+ Use Angular Forms or `[(value)]` for binding. The tables include inherited bindings. The Required column refers to whether the template must supply the input.
33
+
34
+ ## Inputs
35
+
36
+ | Input | Type | Required | Default | Description |
37
+ | --------------------- | ---------------------------------------- | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
38
+ | `preventCopyPasteCut` | `boolean` | No | `false` | Blocks copy, cut, and paste on the field when enabled. |
39
+ | `inputId` | `string` | Yes | — | Identifier assigned to the inner control. Set `idPrefix` to add a prefix. |
40
+ | `label` | `string` | No | `''` | Label text or translation key displayed for this control. |
41
+ | `errorMessage` | `string` | No | `''` | Error message displayed when validation fails. |
42
+ | `required` | `boolean` | No | `false` | Marks the control as required. Configure any parent-form validators separately. |
43
+ | `fieldName` | `string \| number` | No | `undefined` | Consumer-defined field identifier included in event metadata. |
44
+ | `placeholder` | `string` | No | `''` | Hint text or translation key displayed while the control is empty. |
45
+ | `readonly` | `boolean` | No | `false` | Requests the existing read-only behavior without disabling the parent form control. |
46
+ | `inputType` | `'number' \| 'percentage' \| 'integers'` | No | `'number'` | Defines input behavior: number or percentage. |
47
+ | `textAlign` | `'left' \| 'right' \| 'center'` | No | `'left'` | Text alignment inside the input: 'left' \| 'right' \| 'center' (defaults to 'left'). |
48
+ | `maxDigits` | `number` | No | `undefined` | Maximum allowed digits. |
49
+ | `minValue` | `number` | No | `undefined` | Minimum allowed numeric value. |
50
+ | `maxValue` | `number` | No | `undefined` | Maximum allowed numeric value. |
51
+ | `allowDecimal` | `boolean` | No | `undefined` | Allows decimal values when true. |
52
+ | `decimalPlaces` | `number` | No | `undefined` | Maximum number of decimal places allowed. |
53
+ | `allowNegative` | `boolean` | No | `false` | Allows negative numbers when true. |
54
+ | `prefix` | `string` | No | `''` | Text displayed before the input value (e.g. '$', '+91', 'kg'). |
55
+ | `showPrefix` | `boolean` | No | `false` | Controls whether the prefix is rendered. Set to `true` only when the prefix should be visible. |
56
+ | `suffix` | `string` | No | `''` | Text displayed after the input, such as a unit or percentage sign. |
57
+ | `showSuffix` | `boolean` | No | `false` | Controls whether the suffix is rendered. |
58
+ | `disabled` | `boolean` | No | `false` | Disables the control. Angular Forms can also update this state through setDisabledState. Uses Angular boolean attribute coercion. |
59
+ | `idPrefix` | `string` | No | `''` | Optional namespace prepended to inner control IDs to distinguish repeated instances. |
60
+ | `value` | `number \| null` | No | `null` | Canonical value binding. Programmatic writes never emit user change events. |
61
+
62
+ ## Outputs
63
+
64
+ | Output | Payload | When it fires |
65
+ | -------------- | ----------------------------- | ----------------------------------------------------------------------- |
66
+ | `modelChange` | `NumberInputModelChangeEvent` | Emits a model-change event with field metadata. |
67
+ | `inputChanged` | `NumberInputInputEvent` | Emits when the user edits the field. |
68
+ | `focusGained` | `NumberInputFocusEvent` | Emits when the inner field gains focus. |
69
+ | `focusLost` | `NumberInputBlurEvent` | Emits when the inner field loses focus. |
70
+ | `keyPressed` | `NumberInputKeydownEvent` | Emits on the inner field keydown event. |
71
+ | `keyReleased` | `NumberInputKeyupEvent` | Emits on the inner field keyup event. |
72
+ | `enterPressed` | `NumberInputKeyEnterEvent` | Emits when Enter is released in the inner field. |
73
+ | `valueChange` | `number \| null` | Emits the raw value once per committed user edit. Supports `[(value)]`. |
74
+
75
+ ## Local option and event types
76
+
77
+ These declarations describe the payload and option shapes. Import availability depends on the package entry point.
78
+
79
+ ```ts
80
+ export interface NumberInputModelChangeEvent extends NumberInputFieldInfo {
81
+ /** Updated numeric value */
82
+ modelChangeEvent: number;
83
+ }
84
+
85
+ export interface NumberInputFieldInfo {
86
+ /** Current numeric value */
87
+ modelValue: number;
88
+
89
+ /** Field name provided by parent component */
90
+ textFieldName: string | number;
91
+
92
+ /** Native input element reference (if inputId exists) */
93
+ inputRef?: Element | null;
94
+ }
95
+
96
+ export interface NumberInputInputEvent extends NumberInputFieldInfo {
97
+ /** Native input/change event */
98
+ changeEvent: Event;
99
+ }
100
+
101
+ export interface NumberInputFocusEvent extends NumberInputFieldInfo {
102
+ /** Native focus event */
103
+ focusEvent: FocusEvent;
104
+ }
105
+
106
+ export interface NumberInputBlurEvent extends NumberInputFieldInfo {
107
+ /** Native blur event */
108
+ blurEvent: FocusEvent;
109
+ }
110
+
111
+ export interface NumberInputKeydownEvent extends NumberInputFieldInfo {
112
+ /** Native keyboard event */
113
+ keyDownEvent: KeyboardEvent;
114
+ }
115
+
116
+ export interface NumberInputKeyupEvent extends NumberInputFieldInfo {
117
+ /** Native keyboard event */
118
+ keyUpEvent: KeyboardEvent;
119
+ }
120
+
121
+ export interface NumberInputKeyEnterEvent extends NumberInputFieldInfo {
122
+ /** Enter key or input-related event */
123
+ keyEnterEvent: Event;
124
+ }
125
+ ```
126
+
127
+ ## Public instance properties
128
+
129
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
130
+
131
+ | Property | Type | Description |
132
+ | ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
133
+ | `modelValue` | `number` | Internal model getter/setter backed by the shared control value. |
134
+ | `enablePrefix` | `boolean` | — |
135
+ | `enablePostfix` | `boolean` | — |
136
+ | `onChangeCallback` | `(value: T \| null) => void` | Standard change and touch callbacks. |
137
+ | `onTouchedCallback` | `() => void` | — |
138
+ | `effectiveId` | `string` | Plain string property bound in template [id]="effectiveId" (zero function or CD overhead). |
139
+
140
+ ## Public instance methods
141
+
142
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
143
+
144
+ | Method | Signature | Description |
145
+ | ------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------- |
146
+ | `modelValueChange` | `(modelChange: number): void` | Emits when the model value changes. |
147
+ | `inputChange` | `(changeValue: Event): void` | Emits when the input value changes. |
148
+ | `focusChange` | `(onFocus: FocusEvent): void` | Emits when input gains focus. |
149
+ | `blurChange` | `(blurEvent: FocusEvent): void` | Emits when input loses focus. |
150
+ | `keydownHandle` | `(event: KeyboardEvent): void` | Emits on keydown action. |
151
+ | `keyupHandle` | `(event: KeyboardEvent): void` | Emits on keyup action. |
152
+ | `keyEnterHandle` | `(event: Event): void` | Emits when Enter key is pressed. |
153
+ | `onWheel` | `(event: WheelEvent): void` | — |
154
+ | `configureId` | `(): void` | — |
155
+ | `commitValue` | `(value?: number \| null): void` | Commit a view edit after the inner control has updated its local model. |
156
+ | `handleFocusOut` | `(event: FocusEvent): void` | Touch the outer control only when focus leaves the whole composite control. |
157
+ | `writeValue` | `(value: number \| null): void` | Writes a new value from the form model to the view. |
158
+ | `registerOnChange` | `(fn: (value: number \| null) => void): void` | Registers a callback function that is called when the control's value changes in the UI. |
159
+ | `registerOnTouched` | `(fn: () => void): void` | Registers a callback function that is called when the control is touched. |
160
+ | `setDisabledState` | `(isDisabled: boolean): void` | Updates the disabled state from the form model. |
161
+
162
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/number-input/number-input.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)
@@ -0,0 +1,142 @@
1
+ # PasswordInputComponent
2
+
3
+ Password entry with a visibility toggle.
4
+
5
+ Selector `ui-password-input`.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { PasswordInputComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `PasswordInputComponent` to the host component's imports. Add `FormsModule` for this example.
14
+
15
+ ```html
16
+ <ui-password-input inputId="password" label="Password" [(ngModel)]="password" />
17
+ ```
18
+
19
+ Example fields in the host component.
20
+
21
+ ```ts
22
+ password = '';
23
+ ```
24
+
25
+ Use Angular Forms or `[(value)]` for binding. The tables include inherited bindings. The Required column refers to whether the template must supply the input.
26
+
27
+ ## Inputs
28
+
29
+ | Input | Type | Required | Default | Description |
30
+ | --------------------- | ------------------ | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
31
+ | `preventCopyPasteCut` | `boolean` | No | `false` | Blocks copy, cut, and paste on the field when enabled. |
32
+ | `inputId` | `string` | Yes | — | Identifier assigned to the inner control. Set `idPrefix` to add a prefix. |
33
+ | `label` | `string` | No | `''` | Label text or translation key displayed for this control. |
34
+ | `errorMessage` | `string` | No | `''` | Error message shown when validation fails. |
35
+ | `required` | `boolean` | No | `false` | Marks the control as required. Configure any parent-form validators separately. |
36
+ | `fieldName` | `string \| number` | No | `undefined` | Consumer-defined field identifier included in event metadata. |
37
+ | `placeholder` | `string` | No | `''` | Hint text or translation key displayed while the control is empty. |
38
+ | `readonly` | `boolean` | No | `false` | Requests the existing read-only behavior without disabling the parent form control. |
39
+ | `enableArabicInput` | `boolean` | No | `false` | Passes the Arabic typing flag to the existing utility directive. |
40
+ | `disabled` | `boolean` | No | `false` | Disables the control. Angular Forms can also update this state through setDisabledState. Uses Angular boolean attribute coercion. |
41
+ | `idPrefix` | `string` | No | `''` | Optional namespace prepended to inner control IDs to distinguish repeated instances. |
42
+ | `value` | `string \| null` | No | `null` | Canonical value binding. Programmatic writes never emit user change events. |
43
+
44
+ ## Outputs
45
+
46
+ | Output | Payload | When it fires |
47
+ | -------------- | ------------------------------- | ----------------------------------------------------------------------- |
48
+ | `modelChange` | `PasswordInputModelChangeEvent` | Emits a model-change event with field metadata. |
49
+ | `inputChanged` | `PasswordInputInputEvent` | Emits when the user edits the field. |
50
+ | `focusGained` | `PasswordInputFocusEvent` | Emits when the inner field gains focus. |
51
+ | `focusLost` | `PasswordInputBlurEvent` | Emits when the inner field loses focus. |
52
+ | `keyPressed` | `PasswordInputKeydownEvent` | Emits on the inner field keydown event. |
53
+ | `keyReleased` | `PasswordInputKeyupEvent` | Emits on the inner field keyup event. |
54
+ | `enterPressed` | `PasswordInputKeyEnterEvent` | Emits when Enter is released in the inner field. |
55
+ | `valueChange` | `string \| null` | Emits the raw value once per committed user edit. Supports `[(value)]`. |
56
+
57
+ ## Local option and event types
58
+
59
+ These declarations describe the payload and option shapes. Import availability depends on the package entry point.
60
+
61
+ ```ts
62
+ export interface PasswordInputModelChangeEvent extends PasswordInputFieldInfo {
63
+ /** Updated password value */
64
+ modelChangeEvent: string;
65
+ }
66
+
67
+ export interface PasswordInputFieldInfo {
68
+ /** Current password value */
69
+ modelValue: number;
70
+
71
+ /** Field name provided by parent component */
72
+ textFieldName: string | number;
73
+
74
+ /** Native input element reference (if inputId exists) */
75
+ inputRef?: Element | null;
76
+ }
77
+
78
+ export interface PasswordInputInputEvent extends PasswordInputFieldInfo {
79
+ /** Native input event */
80
+ inputChangeEvent: Event;
81
+ }
82
+
83
+ export interface PasswordInputFocusEvent extends PasswordInputFieldInfo {
84
+ /** Native focus event */
85
+ focusEvent: FocusEvent;
86
+ }
87
+
88
+ export interface PasswordInputBlurEvent extends PasswordInputFieldInfo {
89
+ /** Native blur event */
90
+ blurEvent: FocusEvent;
91
+ }
92
+
93
+ export interface PasswordInputKeydownEvent extends PasswordInputFieldInfo {
94
+ /** Native keyboard event */
95
+ keyDownEvent: KeyboardEvent;
96
+ }
97
+
98
+ export interface PasswordInputKeyupEvent extends PasswordInputFieldInfo {
99
+ /** Native keyboard event */
100
+ keyUpEvent: KeyboardEvent;
101
+ }
102
+
103
+ export interface PasswordInputKeyEnterEvent extends PasswordInputFieldInfo {
104
+ /** Enter key or input-related event */
105
+ keyEnterEvent: Event;
106
+ }
107
+ ```
108
+
109
+ ## Public instance properties
110
+
111
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
112
+
113
+ | Property | Type | Description |
114
+ | ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
115
+ | `modelValue` | `any` | Internal model getter/setter backed by the shared control value. |
116
+ | `showPassword` | `boolean` | Toggles visibility of the password. |
117
+ | `onChangeCallback` | `(value: T \| null) => void` | Standard change and touch callbacks. |
118
+ | `onTouchedCallback` | `() => void` | — |
119
+ | `effectiveId` | `string` | Plain string property bound in template [id]="effectiveId" (zero function or CD overhead). |
120
+
121
+ ## Public instance methods
122
+
123
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
124
+
125
+ | Method | Signature | Description |
126
+ | ------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------- |
127
+ | `modelValueChange` | `(modelValueChange: string): void` | Emits when the password model value changes. |
128
+ | `inputChange` | `(changeValue: Event): void` | Emits on input change event. |
129
+ | `focusChange` | `(onFocusEvent: FocusEvent): void` | Emits when input gains focus. |
130
+ | `blurChange` | `(blurEvent: FocusEvent): void` | Emits when input loses focus. |
131
+ | `keydownHandle` | `(event: KeyboardEvent): void` | Emits on keydown event. |
132
+ | `keyupHandle` | `(event: KeyboardEvent): void` | Emits on keyup event. |
133
+ | `keyEnterHandle` | `(event: Event): void` | Emits when Enter key is pressed. |
134
+ | `configureId` | `(): void` | — |
135
+ | `commitValue` | `(value?: string \| null): void` | Commit a view edit after the inner control has updated its local model. |
136
+ | `handleFocusOut` | `(event: FocusEvent): void` | Touch the outer control only when focus leaves the whole composite control. |
137
+ | `writeValue` | `(value: string \| null): void` | Writes a new value from the form model to the view. |
138
+ | `registerOnChange` | `(fn: (value: string \| null) => void): void` | Registers a callback function that is called when the control's value changes in the UI. |
139
+ | `registerOnTouched` | `(fn: () => void): void` | Registers a callback function that is called when the control is touched. |
140
+ | `setDisabledState` | `(isDisabled: boolean): void` | Updates the disabled state from the form model. |
141
+
142
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/password-input/password-input.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)
@@ -0,0 +1,50 @@
1
+ # PdfViewerComponent
2
+
3
+ An embedded PDF preview.
4
+
5
+ Selector `ui-pdf-viewer`.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { PdfViewerComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `PdfViewerComponent` to the host component's imports. Replace the example path with a trusted PDF URL.
14
+
15
+ ```html
16
+ <ui-pdf-viewer [pdfUrl]="pdfUrl" title="Sample PDF preview" />
17
+ ```
18
+
19
+ Example fields in the host component.
20
+
21
+ ```ts
22
+ pdfUrl = 'assets/sample.pdf';
23
+ ```
24
+
25
+ ## Inputs
26
+
27
+ | Input | Type | Required | Default | Description |
28
+ | -------- | -------- | -------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------- |
29
+ | `title` | `string` | No | `'PDF document'` | Accessible title for the embedded document. |
30
+ | `pdfUrl` | `string` | No | No document | Resource URL embedded in the viewer. The current implementation trusts this URL; callers must supply a trusted source. |
31
+
32
+ ## Outputs
33
+
34
+ None.
35
+
36
+ ## Public instance properties
37
+
38
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
39
+
40
+ | Property | Type | Description |
41
+ | --------- | ----------------- | ------------------------------------------------------------------- |
42
+ | `urlSafe` | `SafeResourceUrl` | Safe resource URL processed by DomSanitizer for iframe consumption. |
43
+
44
+ ## Public instance methods
45
+
46
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
47
+
48
+ None.
49
+
50
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/pdf-viewer/pdf-viewer.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)
@@ -0,0 +1,126 @@
1
+ # RadioGroupComponent
2
+
3
+ One choice from a set.
4
+
5
+ Selector `ui-radio-group`. The package also exports this component as `RadioButtonComponent` with the `ui-radio-button` selector.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { RadioGroupComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `RadioGroupComponent` to the host component's imports. Add `FormsModule` for this example.
14
+
15
+ ```html
16
+ <ui-radio-group
17
+ inputId="priority"
18
+ label="Priority"
19
+ [(ngModel)]="priority"
20
+ [options]="priorities"
21
+ labelKey="label"
22
+ valueKey="value"
23
+ />
24
+ ```
25
+
26
+ Example fields in the host component.
27
+
28
+ ```ts
29
+ priority = 'medium';
30
+ priorities = [
31
+ { value: 'low', label: 'Low' },
32
+ { value: 'medium', label: 'Medium' },
33
+ { value: 'high', label: 'High' },
34
+ ];
35
+ ```
36
+
37
+ Use Angular Forms or `[(value)]` for binding. The tables include inherited bindings. The Required column refers to whether the template must supply the input.
38
+
39
+ ## Inputs
40
+
41
+ | Input | Type | Required | Default | Description |
42
+ | -------------- | --------------------- | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
43
+ | `inputId` | `string` | Yes | — | Identifier assigned to the inner control. Set `idPrefix` to add a prefix. |
44
+ | `label` | `string` | No | `''` | Label text or translation key displayed for this control. |
45
+ | `labelKey` | `string` | No | `''` | Property name read from an option object to obtain its visible label. |
46
+ | `options` | `RadioButtonOption[]` | No | `[]` | Options rendered by the control; use the label/value key inputs for object options. |
47
+ | `errorMessage` | `string` | No | `''` | Error message displayed on validation failure. |
48
+ | `required` | `boolean` | No | `false` | Marks the control as required. Configure any parent-form validators separately. |
49
+ | `fieldName` | `string \| number` | No | `undefined` | Consumer-defined field identifier included in event metadata. |
50
+ | `valueKey` | `string` | No | `''` | Property name used to identify or extract an option value. |
51
+ | `disabled` | `boolean` | No | `false` | Disables the control. Angular Forms can also update this state through setDisabledState. Uses Angular boolean attribute coercion. |
52
+ | `idPrefix` | `string` | No | `''` | Optional namespace prepended to inner control IDs to distinguish repeated instances. |
53
+ | `value` | `any` | No | `null` | Canonical value binding. Programmatic writes never emit user change events. |
54
+
55
+ ## Outputs
56
+
57
+ | Output | Payload | When it fires |
58
+ | -------------- | ----------------------------- | ----------------------------------------------------------------------- |
59
+ | `modelChange` | `RadioButtonModelChangeEvent` | Emits a model-change event with field metadata. |
60
+ | `inputChanged` | `RadioButtonInputEvent` | Emits when the user edits the field. |
61
+ | `valueChange` | `any` | Emits the raw value once per committed user edit. Supports `[(value)]`. |
62
+
63
+ ## Local option and event types
64
+
65
+ These declarations describe the payload and option shapes. Import availability depends on the package entry point.
66
+
67
+ ```ts
68
+ export type RadioButtonOption = string | number | Record<string, any>;
69
+
70
+ export interface RadioButtonModelChangeEvent extends RadioButtonFieldInfo {
71
+ /** Updated selected radio value */
72
+ modelChangeEvent: any;
73
+ index?: number;
74
+ }
75
+
76
+ export interface RadioButtonFieldInfo {
77
+ /** Currently selected radio value */
78
+ modelValue: any;
79
+
80
+ /** Field identifier used by parent component */
81
+ textFieldName: string | number;
82
+
83
+ /** Optional native input element reference */
84
+ inputRef?: Element | null;
85
+ }
86
+
87
+ export interface RadioButtonInputEvent extends RadioButtonFieldInfo {
88
+ /** Native input event */
89
+ changeEvent: Event;
90
+ }
91
+ ```
92
+
93
+ ## Public instance properties
94
+
95
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
96
+
97
+ | Property | Type | Description |
98
+ | ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
99
+ | `modelValue` | `any` | Internal model getter/setter backed by the shared control value. |
100
+ | `inputModelValue` | `any` | **Deprecated.** Use value for direct component access. |
101
+ | `onChangeCallback` | `(value: T \| null) => void` | Standard change and touch callbacks. |
102
+ | `onTouchedCallback` | `() => void` | — |
103
+ | `effectiveId` | `string` | Plain string property bound in template [id]="effectiveId" (zero function or CD overhead). |
104
+
105
+ ## Public instance methods
106
+
107
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
108
+
109
+ | Method | Signature | Description |
110
+ | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------- |
111
+ | `onGroupChange` | `(event: MatRadioChange): void` | — |
112
+ | `modelValueChange` | `(modelChange: RadioButtonOption): void` | Emits when the selected radio value changes. |
113
+ | `inputChange` | `(changeValue: Event): void` | Emits when a radio input change event occurs. |
114
+ | `getOptionValue` | `(option: RadioButtonOption): any` | — |
115
+ | `getOptionLabel` | `(option: RadioButtonOption): any` | — |
116
+ | `isOptionDisabled` | `(option: RadioButtonOption): boolean` | — |
117
+ | `getModelValue` | `(): any` | — |
118
+ | `configureId` | `(): void` | — |
119
+ | `commitValue` | `(value?: any \| null): void` | Commit a view edit after the inner control has updated its local model. |
120
+ | `handleFocusOut` | `(event: FocusEvent): void` | Touch the outer control only when focus leaves the whole composite control. |
121
+ | `writeValue` | `(value: any \| null): void` | Writes a new value from the form model to the view. |
122
+ | `registerOnChange` | `(fn: (value: any \| null) => void): void` | Registers a callback function that is called when the control's value changes in the UI. |
123
+ | `registerOnTouched` | `(fn: () => void): void` | Registers a callback function that is called when the control is touched. |
124
+ | `setDisabledState` | `(isDisabled: boolean): void` | Updates the disabled state from the form model. |
125
+
126
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/radio-button/radio-button.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)
@@ -0,0 +1,86 @@
1
+ # RichTextEditorComponent
2
+
3
+ Editing formatted HTML.
4
+
5
+ Selector `ui-rich-text-editor`.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { RichTextEditorComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `RichTextEditorComponent` to the host component's imports. Add `FormsModule` for this example. Load the CKEditor stylesheet and supply the license configuration described in the README.
14
+
15
+ ```html
16
+ <ui-rich-text-editor inputId="richEditor" [(ngModel)]="richContent" />
17
+ ```
18
+
19
+ Example fields in the host component.
20
+
21
+ ```ts
22
+ richContent = '<p>Write your notes here.</p>';
23
+ ```
24
+
25
+ Use Angular Forms or `[(value)]` for binding. The tables include inherited bindings. The Required column refers to whether the template must supply the input.
26
+
27
+ ## Inputs
28
+
29
+ | Input | Type | Required | Default | Description |
30
+ | -------------------- | ------------------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
31
+ | `licenseKey` | `string` | No | `'GPL'` | CKEditor license configuration; GPL requires a GPL-compatible use case. |
32
+ | `inputId` | `string` | Yes | — | Identifier assigned to the inner control. Set `idPrefix` to add a prefix. |
33
+ | `hiddenToolbarItems` | `string[]` | No | `[]` | Toolbar item identifiers removed from the editor configuration. |
34
+ | `editorType` | `string \| number` | No | `''` | Editor type identifier. |
35
+ | `errorMessage` | `string` | No | `''` | Error message or translation key displayed when validation fails. |
36
+ | `required` | `boolean` | No | `false` | Marks the control as required. Configure any parent-form validators separately. |
37
+ | `placeholder` | `string` | No | `''` | Hint text or translation key displayed while the control is empty. |
38
+ | `readonly` | `boolean` | No | `false` | Requests the existing read-only behavior without disabling the parent form control. |
39
+ | `disabled` | `boolean` | No | `false` | Disables the control. Angular Forms can also update this state through setDisabledState. Uses Angular boolean attribute coercion. |
40
+ | `idPrefix` | `string` | No | `''` | Optional namespace prepended to inner control IDs to distinguish repeated instances. |
41
+ | `value` | `string \| null` | No | `null` | Canonical value binding. Programmatic writes never emit user change events. |
42
+
43
+ ## Outputs
44
+
45
+ | Output | Payload | When it fires |
46
+ | ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------- |
47
+ | `editorLoadFailed` | `unknown` | — |
48
+ | `modelChange` | `any` | Emits a model-change event with field metadata. Emits `{ editorType: string \| number; modelValue: string; }`. |
49
+ | `blurred` | `any` | Emits when the control loses focus. Emits `{ editorType: string \| number; modelValue: string; }`. |
50
+ | `valueChange` | `string \| null` | Emits the raw value once per committed user edit. Supports `[(value)]`. |
51
+
52
+ ## Public instance properties
53
+
54
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
55
+
56
+ | Property | Type | Description |
57
+ | ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
58
+ | `showEditor` | `boolean` | Controls editor rendering (used for language reload). |
59
+ | `decoupledEditor` | `any` | CKEditor decoupled editor reference. |
60
+ | `editorLoadError` | `boolean` | — |
61
+ | `editorConfig` | `any` | CKEditor configuration object. |
62
+ | `modelValue` | `string` | Internal model getter/setter backed by the shared control value. |
63
+ | `onChangeCallback` | `(value: T \| null) => void` | Standard change and touch callbacks. |
64
+ | `onTouchedCallback` | `() => void` | — |
65
+ | `effectiveId` | `string` | Plain string property bound in template [id]="effectiveId" (zero function or CD overhead). |
66
+
67
+ ## Public instance methods
68
+
69
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
70
+
71
+ | Method | Signature | Description |
72
+ | ------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
73
+ | `reportError` | `(error: unknown): void` | — |
74
+ | `configureToolbar` | `(): void` | Filters CKEditor toolbar items Removes tools listed in hiddenToolbarItems input. |
75
+ | `onReady` | `(editor: any): void` | CKEditor ready callback - Moves toolbar above editable area - Registers custom image upload adapter. |
76
+ | `onChangeHandler` | `(): void` | Handles editor content change Emits updated value to parent component. |
77
+ | `onBlurHandler` | `(): void` | Marks the form control touched and emits the blur event payload. |
78
+ | `configureId` | `(): void` | — |
79
+ | `commitValue` | `(value?: string \| null): void` | Commit a view edit after the inner control has updated its local model. |
80
+ | `handleFocusOut` | `(event: FocusEvent): void` | Touch the outer control only when focus leaves the whole composite control. |
81
+ | `writeValue` | `(value: string \| null): void` | Writes a new value from the form model to the view. |
82
+ | `registerOnChange` | `(fn: (value: string \| null) => void): void` | Registers a callback function that is called when the control's value changes in the UI. |
83
+ | `registerOnTouched` | `(fn: () => void): void` | Registers a callback function that is called when the control is touched. |
84
+ | `setDisabledState` | `(isDisabled: boolean): void` | Updates the disabled state from the form model. |
85
+
86
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/rich-text-editor/rich-text-editor.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)