Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ input {
background-color: var(--calcite-input-number-background-color, var(--calcite-color-foreground-1));
color: var(--calcite-input-number-text-color, var(--calcite-color-text-1));
border-radius: var(--calcite-input-number-corner-radius, var(--calcite-corner-radius-sharp));
text-align: var(--calcite-internal-input-number-alignment);
&:placeholder-shown {
@apply text-ellipsis;
}
Expand Down Expand Up @@ -300,15 +301,15 @@ input:focus {

// alignment type
:host([alignment="start"]) {
& input {
text-align: start;
}
--calcite-internal-input-number-alignment: start;
}

:host([alignment="center"]) {
--calcite-internal-input-number-alignment: center;
}

:host([alignment="end"]) {
& input {
text-align: end;
}
--calcite-internal-input-number-alignment: end;
}

.number-button-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
control: { type: "select" },
},
alignment: {
options: alignment.values.filter((option) => option !== "center"),
options: alignment.values,
control: { type: "select" },
},
numberButtonType: {
Expand Down Expand Up @@ -227,3 +227,13 @@ export const fontSizeSetAtRoot = (): string =>
<calcite-input-number placeholder="Placeholder" prefix-text="Prefix" suffix-text="Suffix" icon="search">
<calcite-button slot="action"> Search </calcite-button>
</calcite-input-number>`;

export const alignmentAllOptions = (): string => html`
<div style="width:300px;max-width:100%;text-align:center;">
<calcite-input-number alignment="start" placeholder="Placeholder text"></calcite-input-number>
<br />
<calcite-input-number alignment="center" placeholder="Placeholder text"></calcite-input-number>
<br />
<calcite-input-number alignment="end" placeholder="Placeholder text"></calcite-input-number>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class InputNumber
//#region Public Properties

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

/**
* Specifies the type of content to autocomplete, for use in forms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ input {
color: var(--calcite-input-text-text-color, var(--calcite-color-text-1));
border-radius: var(--calcite-input-text-corner-radius, var(--calcite-corner-radius-sharp));
border-color: var(--calcite-input-text-border-color, var(--calcite-color-border-input));
text-align: var(--calcite-internal-input-text-alignment);

&:placeholder-shown {
@apply text-ellipsis;
Expand Down Expand Up @@ -358,15 +359,15 @@ input[type="text"]::-ms-reveal {

// alignment type
:host([alignment="start"]) {
& input {
text-align: start;
}
--calcite-internal-input-text-alignment: start;
}

:host([alignment="center"]) {
--calcite-internal-input-text-alignment: center;
}

:host([alignment="end"]) {
& input {
text-align: end;
}
--calcite-internal-input-text-alignment: end;
}

.wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
control: { type: "select" },
},
alignment: {
options: alignment.values.filter((option) => option !== "center"),
options: alignment.values,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great for manual testing, but could you also include stories that provide coverage for alignment changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added stories to cover the alignment changes.
cc @Elijbet

control: { type: "select" },
},
validationIcon: {
Expand Down Expand Up @@ -177,3 +177,13 @@ export const fontSizeSetAtRoot = (): string =>
<calcite-input-text placeholder="Placeholder" prefix-text="Prefix" suffix-text="Suffix" icon="search">
<calcite-button slot="action"> Search </calcite-button>
</calcite-input-text>`;

export const alignmentAllOptions = (): string => html`
<div style="width:300px;max-width:100%;text-align:center;">
<calcite-input-text alignment="start" placeholder="Placeholder text"></calcite-input-text>
<br />
<calcite-input-text alignment="center" placeholder="Placeholder text"></calcite-input-text>
<br />
<calcite-input-text alignment="end" placeholder="Placeholder text"></calcite-input-text>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class InputText
//#region Public Properties

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

/**
* Specifies the type of content to autocomplete, for use in forms.
Expand Down
Loading