Skip to content

Commit

Permalink
chore: update numeric formats and steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dtopalov committed Sep 20, 2024
1 parent a3bb7af commit ef57282
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<kendo-numerictextbox
size="large"
rounded="large"
[step]="step"
[format]="format"
[min]="$any(min)"
[max]="$any(max)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
<form class="k-form k-form-md">
<kendo-formfield>
<kendo-label text="Text size:"></kendo-label>
<kendo-numeric-textbox-buttons [showBadge]="getSetting('fontSize') !== 16" (valueChange)="settingChange({'fontSize': $event})" [value]="getSetting('fontSize')"></kendo-numeric-textbox-buttons>
<kendo-numeric-textbox-buttons
[showBadge]="getSetting('fontSize') !== 16"
[step]="4"
(valueChange)="settingChange({'fontSize': $event})" [value]="getSetting('fontSize')" format="# PX"></kendo-numeric-textbox-buttons>
</kendo-formfield>
<kendo-formfield>
<kendo-label text="Color theme:"></kendo-label>
Expand Down Expand Up @@ -61,12 +64,17 @@

<kendo-formfield>
<kendo-label text="Line Height:"></kendo-label>
<kendo-numeric-textbox-buttons [showBadge]="getSetting('lineHeight') !== 1" [min]="1" (valueChange)="settingChange({'lineHeight': $event})" [value]="getSetting('lineHeight')"></kendo-numeric-textbox-buttons>
<kendo-numeric-textbox-buttons
[step]="0.1" [decimals]="1"
[showBadge]="getSetting('lineHeight') !== 1"
[min]="0" (valueChange)="settingChange({'lineHeight': $event})"
format="#.# EM"
[value]="getSetting('lineHeight')"></kendo-numeric-textbox-buttons>
</kendo-formfield>

<kendo-formfield>
<kendo-label text="Letter Spacing:"></kendo-label>
<kendo-numeric-textbox-buttons [showBadge]="getSetting('letterSpacing') !== 0" (valueChange)="settingChange({'letterSpacing': $event})" [value]="getSetting('letterSpacing')"></kendo-numeric-textbox-buttons>
<kendo-numeric-textbox-buttons format="# PX" [min]="0" [showBadge]="getSetting('letterSpacing') !== 0" (valueChange)="settingChange({'letterSpacing': $event})" [value]="getSetting('letterSpacing')"></kendo-numeric-textbox-buttons>
</kendo-formfield>

<kendo-formfield>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,7 @@ export class SettingsListComponent {
}

public onValueChange(value: string) {
console.log(`combo value changed, new value: `, value);
// get settings after API call
// call settingChange with the respective settings for the combobox value

// sample usage
this.subs.add(this.httpService.get('https://jsonplaceholder.typicode.com/todos/1')
.subscribe(r => console.log('from API', r)));

this.subs.add(this.httpService.post('https://jsonplaceholder.typicode.com/posts', {
title: value,
body: 'body',
userId: 1,
}).subscribe(r => console.log('from API', r)));

console.log(`value change`);
this.comboboxValue = value;
}

Expand Down

0 comments on commit ef57282

Please sign in to comment.