Skip to content

Commit d36d855

Browse files
fix: update input handling to support numeric values across components
1 parent 932fb5e commit d36d855

File tree

8 files changed

+680
-42
lines changed

8 files changed

+680
-42
lines changed

projects/composition/src/app/components/navigation-sidebar/navigation-sidebar.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ export class NavigationSidebarComponent implements OnInit {
168168
this.filteredComponents = [...this._components];
169169
}
170170

171-
onSearchChanged(value: string) {
172-
this._filterComponentsList(value);
171+
onSearchChanged(value: string | number) {
172+
this._filterComponentsList(String(value));
173173
}
174174

175175
private _filterComponentsList(searchStr: string) {

projects/composition/src/app/pages/colors-page/colors-page/colors-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ export class ColorsPageComponent implements OnInit {
151151
this.filteredColorsList = [...this.colorsList];
152152
}
153153

154-
onSearchChanged(value: string) {
155-
this._filterColors(value);
154+
onSearchChanged(value: string | number) {
155+
this._filterColors(String(value));
156156
}
157157

158158
private _filterColors(searchStr: string) {

projects/composition/src/app/pages/icons-page/icons-page/icons-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class IconsPageComponent implements OnInit {
3636
this.filteredIconsList = iconNames;
3737
}
3838

39-
onSearchChanged(value: string) {
40-
this._filterIcons(value);
39+
onSearchChanged(value: string | number) {
40+
this._filterIcons(String(value));
4141
}
4242

4343
private _filterIcons(name: string) {

projects/cps-ui-kit/src/lib/components/cps-datepicker/cps-datepicker.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import {
1111
ViewChild
1212
} from '@angular/core';
1313
import { ControlValueAccessor, FormsModule, NgControl } from '@angular/forms';
14-
import { CpsInputComponent } from '../cps-input/cps-input.component';
14+
import { DatePickerModule } from 'primeng/datepicker';
1515
import { Subscription } from 'rxjs';
16-
import { convertSize } from '../../utils/internal/size-utils';
1716
import { CpsTooltipPosition } from '../../directives/cps-tooltip/cps-tooltip.directive';
17+
import { convertSize } from '../../utils/internal/size-utils';
18+
import { CpsInputComponent } from '../cps-input/cps-input.component';
1819
import { CpsMenuComponent } from '../cps-menu/cps-menu.component';
19-
import { DatePickerModule } from 'primeng/datepicker';
2020

2121
/**
2222
* CpsDatepickerAppearanceType is used to define the border of the datepicker input.
@@ -226,13 +226,13 @@ export class CpsDatepickerComponent
226226
this.onTouched = fn;
227227
}
228228

229-
onInputValueChanged(val: string) {
230-
this.stringDate = val;
229+
onInputValueChanged(val: string | number) {
230+
this.stringDate = String(val);
231231
if (!val) {
232232
this._updateValue(null);
233233
return;
234234
}
235-
const dt = this._stringToDate(val);
235+
const dt = this._stringToDate(String(val));
236236
if (dt) this._updateValue(dt);
237237
}
238238

0 commit comments

Comments
 (0)