Skip to content

Commit

Permalink
Remove Iso8601 from kolInputNumber value (#7356)
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio authored Feb 6, 2025
2 parents ac17810 + 615e42b commit a6c43c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class InputNumberController extends InputIconController implements InputN

// set the value here when the value is switched between blank and set (or vice versa) to enable value resets via setting null as value.
if (!!(event.target as HTMLInputElement).value !== !!this.component._value) {
this.component._value = (event.target as HTMLInputElement).value as number | Iso8601;
this.component._value = parseFloat((event.target as HTMLInputElement).value);
}
}

Expand Down
13 changes: 6 additions & 7 deletions packages/components/src/components/input-number/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type {
InputNumberStates,
InputTypeOnDefault,
InputTypeOnOff,
Iso8601,
KoliBriHorizontalIcons,
LabelWithExpertSlotPropType,
MsgPropType,
Expand Down Expand Up @@ -171,12 +170,12 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
/**
* Defines the largest possible input value.
*/
@Prop() public _max?: number | Iso8601;
@Prop() public _max?: number;

/**
* Defines the smallest possible input value.
*/
@Prop() public _min?: number | Iso8601;
@Prop() public _min?: number;

/**
* Defines the properties for a message rendered as Alert component.
Expand Down Expand Up @@ -255,7 +254,7 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
/**
* Defines the value of the input.
*/
@Prop({ mutable: true, reflect: true }) public _value?: number | Iso8601 | null;
@Prop({ mutable: true, reflect: true }) public _value?: number | null;

@State() public state: InputNumberStates = {
_autoComplete: 'off',
Expand Down Expand Up @@ -322,12 +321,12 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
}

@Watch('_max')
public validateMax(value?: number | Iso8601): void {
public validateMax(value?: number): void {
this.controller.validateMax(value);
}

@Watch('_min')
public validateMin(value?: number | Iso8601): void {
public validateMin(value?: number): void {
this.controller.validateMin(value);
}

Expand Down Expand Up @@ -397,7 +396,7 @@ export class KolInputNumber implements InputNumberAPI, FocusableElement {
}

@Watch('_value')
public validateValue(value?: number | Iso8601 | null): void {
public validateValue(value?: number | null): void {
this.controller.validateValueEx(value);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/schema/components/input-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import type {
PropSyncValueBySelector,
PropTouched,
} from '../props';
import type { InputTypeOnDefault, InputTypeOnOff, Iso8601, KoliBriHorizontalIcons, OptionalInputProps, Stringified, W3CInputValue } from '../types';
import type { InputTypeOnDefault, InputTypeOnOff, KoliBriHorizontalIcons, OptionalInputProps, Stringified, W3CInputValue } from '../types';
import type { ButtonProps } from './button';

type RequiredProps = PropLabelWithExpertSlot;
type OptionalProps = {
msg: Stringified<MsgPropType>;
placeholder: string;
} & OptionalInputProps<number | Iso8601> &
} & OptionalInputProps<number> &
PropHideError &
PropSuggestions;

Expand Down

0 comments on commit a6c43c3

Please sign in to comment.