Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): dialog has padding for close button event when not closeable #10012

Merged
merged 1 commit into from
Dec 18, 2024
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
3 changes: 3 additions & 0 deletions projects/core/components/dialog/dialog.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
*/
export interface TuiDialogOptions<I> {
readonly appearance: string;
/**
* TODO: rename to closable in v5.0
*/
readonly closeable: Observable<boolean> | boolean;
readonly data: I extends void ? undefined : I & {button?: string};
readonly dismissible: Observable<boolean> | boolean;
readonly header: PolymorpheusContent<TuiPopover<TuiDialogOptions<I>, any>>;

Check warning on line 28 in projects/core/components/dialog/dialog.interfaces.ts

View check run for this annotation

codefactor.io / CodeFactor

projects/core/components/dialog/dialog.interfaces.ts#L28

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
readonly label: string;
readonly required: boolean;
readonly size: TuiDialogSize;
Expand Down
5 changes: 4 additions & 1 deletion projects/core/components/dialog/dialog.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@

.t-heading {
margin: 0 0 0.5rem;
padding-inline-end: 2rem;
overflow-wrap: break-word;
font: var(--tui-font-heading-4);

&_closable {
padding-inline-end: 2rem;
}

&:empty {
display: none;
}
Expand Down
1 change: 1 addition & 0 deletions projects/core/components/dialog/dialog.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<div class="t-content">
<h2
class="t-heading"
[class.t-heading_closable]="context.closeable"
[id]="context.id"
[textContent]="context.label"
></h2>
Expand Down
Loading