Skip to content

Commit d15c92b

Browse files
committed
SVY-20819 use signals instead of @input in our components
fix: correct internal variable value assignments
1 parent 34e4ae1 commit d15c92b

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

components/projects/bootstrapcomponents/src/bts_basefield.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ export class ServoyBootstrapBasefield<T extends HTMLElement> extends ServoyBoots
5757

5858
svyOnChanges(changes: SimpleChanges) {
5959
if (changes) {
60+
if (changes.dataProviderID) {
61+
this._dataProviderID.set(this.dataProviderID());
62+
}
6063
for (const property of Object.keys(changes)) {
6164
const change = changes[property];
6265
switch (property) {
@@ -69,6 +72,9 @@ export class ServoyBootstrapBasefield<T extends HTMLElement> extends ServoyBoots
6972
}
7073
}
7174
if (changes.editable || changes.readOnly || changes.findmode) {
75+
if (changes.editable) {
76+
this._editable.set(this.editable());
77+
}
7278
const findmode = this.findmode();
7379
const realFindmode = findmode === undefined? false: findmode; // default for find is false
7480
const readOnly = this.readOnly();

components/projects/bootstrapcomponents/src/calendar/basecalendar.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ export class ServoyBootstrapBaseCalendar extends ServoyBootstrapBasefield<HTMLDi
1717
readonly maxDateChange = output();
1818
readonly minDate = input<Date>(undefined);
1919
readonly minDateChange = output();
20-
readonly keepInvalid = signal<boolean>(undefined);
20+
readonly keepInvalid = input<boolean>(undefined);
2121
readonly keepInvalidChange = output<boolean>();
2222

2323
readonly calendarWeeks = input<boolean>(undefined);
2424
readonly theme = input<string>(undefined);
2525

2626
readonly options = input<Options>(undefined);
27+
28+
_keepInvalid = signal<boolean>(undefined);
2729

2830
picker: TempusDominus;
2931

@@ -125,8 +127,11 @@ export class ServoyBootstrapBaseCalendar extends ServoyBootstrapBasefield<HTMLDi
125127
}
126128
}
127129

128-
if (changes.keepInvalid && changes.keepInvalid.currentValue !== undefined)
130+
if (changes.keepInvalid && changes.keepInvalid.currentValue !== undefined) {
129131
this.config.keepInvalid = changes.keepInvalid.currentValue;
132+
this._keepInvalid.set(changes.keepInvalid.currentValue);
133+
}
134+
130135
if (this.picker && (changes.calendarWeeks || changes.minDate || changes.options
131136
|| changes.maxDate || changes.disabledDays || changes.disabledDates)) this.picker.updateOptions(this.config);
132137
}
@@ -189,7 +194,7 @@ export class ServoyBootstrapBaseCalendar extends ServoyBootstrapBasefield<HTMLDi
189194
private checkInvalidAndPicker(keepInvalid: boolean) {
190195
if (keepInvalid !== undefined) {
191196
this.config.keepInvalid = keepInvalid;
192-
this.keepInvalid.set(keepInvalid);
197+
this._keepInvalid.set(keepInvalid);
193198
this.keepInvalidChange.emit(keepInvalid);
194199
}
195200
if (this.picker) this.picker.updateOptions(this.config);

0 commit comments

Comments
 (0)