Skip to content

Commit

Permalink
refactor(input,input-text,input-number): updates alignment property…
Browse files Browse the repository at this point in the history
… type (#8289)

**Related Issue:** # N/A

## Summary

Update `alignment` property type to use `Alignment` interface.
  • Loading branch information
anveshmekala authored Nov 28, 2023
1 parent c07144f commit f74ceae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
isPrimaryPointerButton,
setRequestedIcon,
} from "../../utils/dom";
import { Position, Scale, Status } from "../interfaces";
import { Alignment, Scale, Status } from "../interfaces";

import {
connectForm,
Expand Down Expand Up @@ -93,7 +93,7 @@ export class InputNumber
//--------------------------------------------------------------------------

/** Specifies the text alignment of the component's value. */
@Prop({ reflect: true }) alignment: Position = "start";
@Prop({ reflect: true }) alignment: Extract<"start" | "end", Alignment> = "start";

/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
updateMessages,
} from "../../utils/t9n";
import { SetValueOrigin } from "../input/interfaces";
import { Position, Scale, Status } from "../interfaces";
import { Alignment, Scale, Status } from "../interfaces";
import { InputTextMessages } from "./assets/input-text/t9n";
import { CSS, SLOTS } from "./resources";
import { getIconScale } from "../../utils/component";
Expand Down Expand Up @@ -73,7 +73,7 @@ export class InputText
//--------------------------------------------------------------------------

/** Specifies the text alignment of the component's value. */
@Prop({ reflect: true }) alignment: Position = "start";
@Prop({ reflect: true }) alignment: Extract<"start" | "end", Alignment> = "start";

/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
Expand Down
4 changes: 2 additions & 2 deletions packages/calcite-components/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
isPrimaryPointerButton,
setRequestedIcon,
} from "../../utils/dom";
import { Scale, Status, Position } from "../interfaces";
import { Scale, Status, Alignment } from "../interfaces";

import {
connectForm,
Expand Down Expand Up @@ -94,7 +94,7 @@ export class Input
//--------------------------------------------------------------------------

/** Specifies the text alignment of the component's value. */
@Prop({ reflect: true }) alignment: Position = "start";
@Prop({ reflect: true }) alignment: Extract<"start" | "end", Alignment> = "start";

/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
Expand Down

0 comments on commit f74ceae

Please sign in to comment.