angular-ui-controls 0.0.0-stage → 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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -2
  3. package/docs/api/README.md +29 -0
  4. package/docs/api/abbreviation-textarea.md +118 -0
  5. package/docs/api/action-menu.md +86 -0
  6. package/docs/api/advanced-select.md +214 -0
  7. package/docs/api/autocomplete.md +134 -0
  8. package/docs/api/checkbox.md +98 -0
  9. package/docs/api/date-picker.md +152 -0
  10. package/docs/api/date-range-picker.md +175 -0
  11. package/docs/api/date-time-picker.md +159 -0
  12. package/docs/api/file-upload.md +85 -0
  13. package/docs/api/number-input.md +162 -0
  14. package/docs/api/password-input.md +142 -0
  15. package/docs/api/pdf-viewer.md +50 -0
  16. package/docs/api/radio-group.md +126 -0
  17. package/docs/api/rich-text-editor.md +86 -0
  18. package/docs/api/search-filter.md +192 -0
  19. package/docs/api/search-input.md +160 -0
  20. package/docs/api/searchable-select.md +195 -0
  21. package/docs/api/segmented-control.md +93 -0
  22. package/docs/api/selection-list.md +120 -0
  23. package/docs/api/slide-toggle.md +105 -0
  24. package/docs/api/text-area.md +148 -0
  25. package/docs/api/text-input.md +159 -0
  26. package/docs/api/time-input.md +99 -0
  27. package/docs/api/time-picker.md +130 -0
  28. package/fesm2022/angular-ui-controls-editor-build-Cm2HSXEy.mjs +2 -0
  29. package/fesm2022/angular-ui-controls-editor-build-Cm2HSXEy.mjs.map +1 -0
  30. package/fesm2022/angular-ui-controls-forms.mjs +865 -0
  31. package/fesm2022/angular-ui-controls-forms.mjs.map +1 -0
  32. package/fesm2022/angular-ui-controls-text-input.mjs +1210 -0
  33. package/fesm2022/angular-ui-controls-text-input.mjs.map +1 -0
  34. package/fesm2022/angular-ui-controls.mjs +7181 -0
  35. package/fesm2022/angular-ui-controls.mjs.map +1 -0
  36. package/forms/index.d.ts +425 -0
  37. package/forms/index.d.ts.map +1 -0
  38. package/index.d.ts +4345 -0
  39. package/index.d.ts.map +1 -0
  40. package/package.json +82 -3
  41. package/text-input/index.d.ts +609 -0
  42. package/text-input/index.d.ts.map +1 -0
@@ -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)
@@ -0,0 +1,192 @@
1
+ # SearchFilterComponent
2
+
3
+ Search box with a category filter.
4
+
5
+ Selector `ui-search-filter`.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { SearchFilterComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `SearchFilterComponent` to the host component's imports. Add `FormsModule` for this example. Import `SearchFilterValue` from `angular-ui-controls` for the example field.
14
+
15
+ ```html
16
+ <ui-search-filter
17
+ inputId="searchFilter"
18
+ searchTextLabel="Search"
19
+ searchSelectLabel="Department filter"
20
+ [(ngModel)]="searchFilter"
21
+ [options]="departments"
22
+ labelKey="name"
23
+ valueKey="id"
24
+ />
25
+ ```
26
+
27
+ Example fields in the host component.
28
+
29
+ ```ts
30
+ searchFilter: SearchFilterValue | null = { searchVal: '', selectVal: null };
31
+ departments = [
32
+ { id: 1, name: 'Engineering' },
33
+ { id: 2, name: 'Design' },
34
+ { id: 3, name: 'Support' },
35
+ ...Array.from({ length: 75 }, (_, i) => ({ id: i + 4, name: 'Regional office ' + (i + 1) })),
36
+ ];
37
+ ```
38
+
39
+ ## Inputs
40
+
41
+ | Input | Type | Required | Default | Description |
42
+ | --------------------- | ------------------------------------ | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
43
+ | `preventCopyPasteCut` | `boolean` | No | `false` | Blocks copy, cut, and paste on the field when enabled. |
44
+ | `idPrefix` | `string` | No | `''` | Optional namespace prepended to inner control IDs to distinguish repeated instances. |
45
+ | `inputId` | `string` | Yes | — | Identifier assigned to the inner control. Set `idPrefix` to add a prefix. |
46
+ | `searchTextLabel` | `string` | No | `''` | Label displayed above the input field. |
47
+ | `searchSelectLabel` | `string` | No | `''` | Label displayed above the dropdown. |
48
+ | `disabled` | `boolean` | No | `false` | Disables the control. Angular Forms can also update this state through setDisabledState. Uses Angular boolean attribute coercion. |
49
+ | `fieldName` | `string \| number` | No | `undefined` | Consumer-defined field identifier included in event metadata. |
50
+ | `placeholder` | `string` | No | `''` | Hint text or translation key displayed while the control is empty. |
51
+ | `readonly` | `boolean` | No | `false` | Requests the existing read-only behavior without disabling the parent form control. |
52
+ | `maxLength` | `number` | No | `undefined` | Maximum number of characters allowed. |
53
+ | `inputType` | `'text' \| 'number' \| 'percentage'` | No | `'text'` | Defines input behavior: number or percentage. |
54
+ | `errorMessage` | `string` | No | `''` | Error message displayed when validation fails. |
55
+ | `required` | `boolean` | No | `false` | Marks the control as required. Configure any parent-form validators separately. |
56
+ | `searchButtonTooltip` | `string` | No | `''` | Tooltip text or translation key for the search button. |
57
+ | `selectPlaceholder` | `string` | No | `''` | Placeholder text for select dropdown. |
58
+ | `options` | `any[]` | No | `[]` | Options rendered by the control; use the label/value key inputs for object options. |
59
+ | `labelKey` | `string` | No | `''` | Property name read from an option object to obtain its visible label. |
60
+ | `valueKey` | `string` | No | `''` | Property name used to identify or extract an option value. |
61
+ | `multiple` | `boolean` | No | `false` | Enables the existing multiple-selection mode. |
62
+ | `showClearIcon` | `boolean` | No | `false` | Show clear icon button in select dropdown. |
63
+ | `value` | `SearchFilterValue \| null` | No | `null` | Compound model; legacy searchVal/selectVal keys remain stable. |
64
+
65
+ ## Outputs
66
+
67
+ | Output | Payload | When it fires |
68
+ | ------------------------ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
69
+ | `modelChange` | `SearchInputModelChangeEvent` | Emits a model-change event with field metadata. |
70
+ | `inputChanged` | `SearchInputInputEvent` | Emits when the user edits the field. |
71
+ | `focusGained` | `SearchInputFocusEvent` | Emits when the inner field gains focus. |
72
+ | `focusLost` | `SearchInputBlurEvent` | Emits when the inner field loses focus. |
73
+ | `keyPressed` | `SearchInputKeydownEvent` | Emits on the inner field keydown event. |
74
+ | `keyReleased` | `SearchInputKeyupEvent` | Emits on the inner field keyup event. |
75
+ | `enterPressed` | `SearchInputKeyEnterEvent` | Emits when Enter is released in the inner field. |
76
+ | `inputClicked` | `SearchInputClickEvent` | Emits when the inner input is clicked. |
77
+ | `searchClicked` | `SearchInputInfo` | Emits when the search action is activated. |
78
+ | `selectionChange` | `any` | Emits when the selection handler processes a selection. Emits `{ selectionChange: unknown; modelValue: any; fieldName: string \| number; inputRef?: Element \| null; }` or `{ selectionChange: null; modelValue: any; fieldName: string \| number; inputRef?: Element \| null; }`. |
79
+ | `panelOpenChange` | `any` | Emits when the select panel open state changes. Emits `{ opened: boolean; selectionChange: boolean; modelValue: any; fieldName: string \| number; inputRef?: Element \| null; }`. |
80
+ | `panelOpened` | `any` | Emits when the select panel opens. |
81
+ | `panelClosed` | `any` | Emits when the select panel closes. |
82
+ | `blurred` | `any` | Emits when the control loses focus. |
83
+ | `optionClicked` | `any` | Emits when an option is clicked. Emits `{ activeOption: unknown; }`. |
84
+ | `optionSelectionChanged` | `any` | Emits when the existing option-selection handler runs. Emits `{ event: unknown; option: unknown; }`. |
85
+ | `valueChange` | `SearchFilterValue \| null` | — |
86
+
87
+ ## Local option and event types
88
+
89
+ These declarations describe the payload and option shapes. Import availability depends on the package entry point.
90
+
91
+ ```ts
92
+ export interface SearchFilterValue {
93
+ searchVal: string;
94
+ selectVal: any;
95
+ }
96
+
97
+ export interface SearchInputModelChangeEvent extends SearchInputInfo {
98
+ /** Updated input value */
99
+ modelChangeEvent: any;
100
+ }
101
+
102
+ export interface SearchInputInfo {
103
+ /** Current input value */
104
+ modelValue: any;
105
+
106
+ /** Field identifier used by parent component */
107
+ fieldName: string | number;
108
+
109
+ /** Native input element reference (if inputId is provided) */
110
+ inputRef?: Element | null;
111
+ }
112
+
113
+ export interface SearchInputInputEvent extends SearchInputInfo {
114
+ /** Native input/change event */
115
+ changeEvent: Event;
116
+ }
117
+
118
+ export interface SearchInputFocusEvent extends SearchInputInfo {
119
+ /** Native focus event */
120
+ focusEvent: FocusEvent;
121
+ }
122
+
123
+ export interface SearchInputBlurEvent extends SearchInputInfo {
124
+ /** Native blur event */
125
+ blurEvent: FocusEvent;
126
+ }
127
+
128
+ export interface SearchInputKeydownEvent extends SearchInputInfo {
129
+ /** Native keyboard event */
130
+ keyDownEvent: KeyboardEvent;
131
+ }
132
+
133
+ export interface SearchInputKeyupEvent extends SearchInputInfo {
134
+ /** Native keyboard event */
135
+ keyUpEvent: KeyboardEvent;
136
+ }
137
+
138
+ export interface SearchInputKeyEnterEvent extends SearchInputInfo {
139
+ /** Enter key or input-related event */
140
+ keyEnterEvent: Event;
141
+ }
142
+
143
+ export interface SearchInputClickEvent extends SearchInputInfo {
144
+ /** Mouse click event */
145
+ clickEvent: MouseEvent;
146
+ }
147
+ ```
148
+
149
+ ## Public instance properties
150
+
151
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
152
+
153
+ | Property | Type | Description |
154
+ | ------------------- | -------------------------------------------- | -------------------------------------------------------------- |
155
+ | `effectiveId` | `string` | — |
156
+ | `onChangeCallback` | `(value: SearchFilterValue \| null) => void` | — |
157
+ | `onTouchedCallback` | `() => void` | — |
158
+ | `modelValue` | `string` | Getters and setters for the internal form controls. |
159
+ | `selectedValue` | `any` | — |
160
+ | `inputModelValue` | `any` | **Deprecated.** Use selectedValue for direct component access. |
161
+
162
+ ## Public instance methods
163
+
164
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
165
+
166
+ | Method | Signature | Description |
167
+ | ----------------------- | -------------------------------------------------------- | ----------------------------------------------- |
168
+ | `commitValue` | `(): void` | — |
169
+ | `handleFocusOut` | `(event: FocusEvent): void` | — |
170
+ | `writeValue` | `(value: SearchFilterValue \| null): void` | ControlValueAccessor implementation. |
171
+ | `registerOnChange` | `(fn: (value: SearchFilterValue \| null) => void): void` | — |
172
+ | `registerOnTouched` | `(fn: () => void): void` | — |
173
+ | `setDisabledState` | `(isDisabled: boolean): void` | — |
174
+ | `modelValueChange` | `(modelChangeEvent: string): void` | Emits when the model value changes. |
175
+ | `inputChange` | `(changeValue: Event): void` | Emits on input value change. |
176
+ | `focusChange` | `(onFocusEvent: FocusEvent): void` | Emits when input gains focus. |
177
+ | `blurChange` | `(blurEvent: FocusEvent): void` | Emits when input loses focus. |
178
+ | `keydownHandle` | `(keyDownEvent: KeyboardEvent): void` | Emits on keydown action. |
179
+ | `keyupHandle` | `(keyUpEvent: KeyboardEvent): void` | Emits on keyup action. |
180
+ | `keyEnterHandle` | `(event: Event): void` | Emits when Enter key is pressed. |
181
+ | `inputClick` | `(clickEvent: MouseEvent): void` | Emits when input field is clicked. |
182
+ | `onSearchClick` | `(): void` | Emits when search button is clicked. |
183
+ | `handleSelectionChange` | `(event: unknown): void` | Emits dropdown selection change event. |
184
+ | `openedChange` | `(opened: boolean): void` | Emits dropdown opened/closed change event. |
185
+ | `opened` | `(): void` | Emits dropdown opened event. |
186
+ | `closed` | `(): void` | Emits dropdown closed event. |
187
+ | `blur` | `(): void` | Emits select dropdown blur event. |
188
+ | `optionSelectionChange` | `(event: unknown, option: unknown): void` | Emits when a dropdown option selection changes. |
189
+ | `optionClick` | `(option: unknown): void` | Emits when a dropdown option is clicked. |
190
+ | `clearSelect` | `(): void` | Clears select dropdown value. |
191
+
192
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/search-filter/search-filter.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)
@@ -0,0 +1,160 @@
1
+ # SearchInputComponent
2
+
3
+ Search box with a search action.
4
+
5
+ Selector `ui-search-input`.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { SearchInputComponent } from 'angular-ui-controls';
11
+ ```
12
+
13
+ Add `SearchInputComponent` to the host component's imports. Add `FormsModule` for this example.
14
+
15
+ ```html
16
+ <ui-search-input
17
+ inputId="searchText"
18
+ label="Search"
19
+ placeholder="Type to search..."
20
+ [(ngModel)]="searchText"
21
+ />
22
+ ```
23
+
24
+ Example fields in the host component.
25
+
26
+ ```ts
27
+ searchText = '';
28
+ ```
29
+
30
+ Use Angular Forms or `[(value)]` for binding. The tables include inherited bindings. The Required column refers to whether the template must supply the input.
31
+
32
+ ## Inputs
33
+
34
+ | Input | Type | Required | Default | Description |
35
+ | ---------------------- | ------------------------------------ | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
36
+ | `preventCopyPasteCut` | `boolean` | No | `false` | Blocks copy, cut, and paste on the field when enabled. |
37
+ | `inputId` | `string` | Yes | — | Identifier assigned to the inner control. Set `idPrefix` to add a prefix. |
38
+ | `label` | `string` | No | `''` | Label text or translation key displayed for this control. |
39
+ | `searchDisabled` | `boolean` | No | `false` | Disables the search text input independently of the search button. |
40
+ | `searchButtonDisabled` | `boolean` | No | `false` | Disables the search action button independently of the text input. |
41
+ | `fieldName` | `string \| number` | No | `undefined` | Consumer-defined field identifier included in event metadata. |
42
+ | `placeholder` | `string` | No | `''` | Hint text or translation key displayed while the control is empty. |
43
+ | `readonly` | `boolean` | No | `false` | Requests the existing read-only behavior without disabling the parent form control. |
44
+ | `maxLength` | `number` | No | `undefined` | Maximum number of characters allowed. |
45
+ | `searchButtonPosition` | `'before' \| 'after'` | No | `'after'` | Determines where the search button is rendered relative to the input. |
46
+ | `inputType` | `'text' \| 'number' \| 'percentage'` | No | `'text'` | Defines input behavior: number or percentage. |
47
+ | `errorMessage` | `string` | No | `''` | Error message displayed when validation fails. |
48
+ | `required` | `boolean` | No | `false` | Marks the control as required. Configure any parent-form validators separately. |
49
+ | `searchButtonTooltip` | `string` | No | `''` | Tooltip text or translation key for the search button. |
50
+ | `disabled` | `boolean` | No | `false` | Disables the control. Angular Forms can also update this state through setDisabledState. Uses Angular boolean attribute coercion. |
51
+ | `idPrefix` | `string` | No | `''` | Optional namespace prepended to inner control IDs to distinguish repeated instances. |
52
+ | `value` | `any` | No | `null` | Canonical value binding. Programmatic writes never emit user change events. |
53
+
54
+ ## Outputs
55
+
56
+ | Output | Payload | When it fires |
57
+ | --------------- | ----------------------------- | ----------------------------------------------------------------------- |
58
+ | `modelChange` | `SearchInputModelChangeEvent` | Emits a model-change event with field metadata. |
59
+ | `inputChanged` | `SearchInputInputEvent` | Emits when the user edits the field. |
60
+ | `focusGained` | `SearchInputFocusEvent` | Emits when the inner field gains focus. |
61
+ | `focusLost` | `SearchInputBlurEvent` | Emits when the inner field loses focus. |
62
+ | `keyPressed` | `SearchInputKeydownEvent` | Emits on the inner field keydown event. |
63
+ | `keyReleased` | `SearchInputKeyupEvent` | Emits on the inner field keyup event. |
64
+ | `enterPressed` | `SearchInputKeyEnterEvent` | Emits when Enter is released in the inner field. |
65
+ | `inputClicked` | `SearchInputClickEvent` | Emits when the inner input is clicked. |
66
+ | `searchClicked` | `SearchInputInfo` | Emits when the search action is activated. |
67
+ | `valueChange` | `any` | Emits the raw value once per committed user edit. Supports `[(value)]`. |
68
+
69
+ ## Local option and event types
70
+
71
+ These declarations describe the payload and option shapes. Import availability depends on the package entry point.
72
+
73
+ ```ts
74
+ export interface SearchInputModelChangeEvent extends SearchInputInfo {
75
+ /** Updated input value */
76
+ modelChangeEvent: any;
77
+ }
78
+
79
+ export interface SearchInputInfo {
80
+ /** Current input value */
81
+ modelValue: any;
82
+
83
+ /** Field identifier used by parent component */
84
+ fieldName: string | number;
85
+
86
+ /** Native input element reference (if inputId is provided) */
87
+ inputRef?: Element | null;
88
+ }
89
+
90
+ export interface SearchInputInputEvent extends SearchInputInfo {
91
+ /** Native input/change event */
92
+ changeEvent: Event;
93
+ }
94
+
95
+ export interface SearchInputFocusEvent extends SearchInputInfo {
96
+ /** Native focus event */
97
+ focusEvent: FocusEvent;
98
+ }
99
+
100
+ export interface SearchInputBlurEvent extends SearchInputInfo {
101
+ /** Native blur event */
102
+ blurEvent: FocusEvent;
103
+ }
104
+
105
+ export interface SearchInputKeydownEvent extends SearchInputInfo {
106
+ /** Native keyboard event */
107
+ keyDownEvent: KeyboardEvent;
108
+ }
109
+
110
+ export interface SearchInputKeyupEvent extends SearchInputInfo {
111
+ /** Native keyboard event */
112
+ keyUpEvent: KeyboardEvent;
113
+ }
114
+
115
+ export interface SearchInputKeyEnterEvent extends SearchInputInfo {
116
+ /** Enter key or input-related event */
117
+ keyEnterEvent: Event;
118
+ }
119
+
120
+ export interface SearchInputClickEvent extends SearchInputInfo {
121
+ /** Mouse click event */
122
+ clickEvent: MouseEvent;
123
+ }
124
+ ```
125
+
126
+ ## Public instance properties
127
+
128
+ These TypeScript properties include state exposed by the class. Use the Inputs and Outputs tables for Angular template bindings.
129
+
130
+ | Property | Type | Description |
131
+ | ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
132
+ | `modelValue` | `any` | Internal model getter/setter backed by the shared control value. |
133
+ | `onChangeCallback` | `(value: T \| null) => void` | Standard change and touch callbacks. |
134
+ | `onTouchedCallback` | `() => void` | — |
135
+ | `effectiveId` | `string` | Plain string property bound in template [id]="effectiveId" (zero function or CD overhead). |
136
+
137
+ ## Public instance methods
138
+
139
+ The list includes Angular Forms plumbing and component event handlers as well as methods called directly by consumers.
140
+
141
+ | Method | Signature | Description |
142
+ | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------- |
143
+ | `modelValueChange` | `(modelChangeEvent: string): void` | Emits when the model value changes. |
144
+ | `inputChange` | `(changeValue: Event): void` | Emits on input value change. |
145
+ | `focusChange` | `(onFocusEvent: FocusEvent): void` | Emits when input gains focus. |
146
+ | `blurChange` | `(blurEvent: FocusEvent): void` | Emits when input loses focus. |
147
+ | `keydownHandle` | `(keyDownEvent: KeyboardEvent): void` | Emits on keydown action. |
148
+ | `keyupHandle` | `(keyUpEvent: KeyboardEvent): void` | Emits on keyup action. |
149
+ | `keyEnterHandle` | `(event: Event): void` | Emits when Enter key is pressed. |
150
+ | `inputClick` | `(clickEvent: MouseEvent): void` | Emits when input field is clicked. |
151
+ | `onSearchClick` | `(): void` | Emits when search button field is clicked. |
152
+ | `configureId` | `(): void` | — |
153
+ | `commitValue` | `(value?: any \| null): void` | Commit a view edit after the inner control has updated its local model. |
154
+ | `handleFocusOut` | `(event: FocusEvent): void` | Touch the outer control only when focus leaves the whole composite control. |
155
+ | `writeValue` | `(value: any \| null): void` | Writes a new value from the form model to the view. |
156
+ | `registerOnChange` | `(fn: (value: any \| null) => void): void` | Registers a callback function that is called when the control's value changes in the UI. |
157
+ | `registerOnTouched` | `(fn: () => void): void` | Registers a callback function that is called when the control is touched. |
158
+ | `setDisabledState` | `(isDisabled: boolean): void` | Updates the disabled state from the form model. |
159
+
160
+ [Component source](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/ui-controls/src/lib/component/search-input/search-input.component.ts) · [Playground example](https://github.com/Abhilash-A-S/angular-ui-controls/blob/develop/projects/demo/src/app.component.html)