-
Notifications
You must be signed in to change notification settings - Fork 0
dialog: стилизация, сторисы, обёртки #31
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ca86301
dialog: стилизация, сторисы, обёртки
8ad1cc2
фикс сторисов согласно размеров ширины
f8d18ec
stories.ts в argTypes
ecd07ee
добавлен @Input() headerTemplate
bd0772c
добавлен DynamicDialog
1573fab
Merge branch 'feature/styles-debug' into overlay.dialog
khaliulin 25a2cbe
добавлен export в const template
f123f8a
резолв конфликта
e22c44f
Merge branch 'feature/styles-debug' into overlay.dialog
khaliulin b729d9e
dialog: оборачиваем footerTemplate в @if, аналогично headerTemplate
4421117
dialog сторис: убираем @ViewChild('footer'), переменная #footer досту…
0bc52f5
dialog сторис: заменяем p-button на ButtonComponent, (onClick) → (click)
175a7e4
dialog: UiDialogService.providers() инкапсулирует DialogService, прай…
58640e1
удаление файла claude.md
892dd28
метод open() принимает injector: Injector вторым аргументом
99bfd5f
cr fixes
AxyIX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import { Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core'; | ||
| import { NgTemplateOutlet } from '@angular/common'; | ||
| import { Dialog } from 'primeng/dialog'; | ||
| import { PrimeTemplate } from 'primeng/api'; | ||
|
|
||
| export type DialogSize = 'sm' | 'default' | 'lg' | 'xlg'; | ||
|
|
||
| @Component({ | ||
| selector: 'dialog', | ||
| host: { style: 'display: contents' }, | ||
| standalone: true, | ||
| imports: [Dialog, NgTemplateOutlet, PrimeTemplate], | ||
| template: ` | ||
| <p-dialog | ||
| [header]="header" | ||
| [visible]="visible" | ||
| (visibleChange)="visibleChange.emit($event)" | ||
| [modal]="modal" | ||
| [dismissableMask]="dismissableMask" | ||
| [closeOnEscape]="closeOnEscape" | ||
| [showHeader]="showHeader" | ||
| [focusOnShow]="focusOnShow" | ||
| [styleClass]="sizeClass" | ||
| appendTo="body" | ||
| > | ||
| <ng-content></ng-content> | ||
| <ng-template pTemplate="footer"> | ||
| <ng-container [ngTemplateOutlet]="footerTemplate"></ng-container> | ||
| </ng-template> | ||
| </p-dialog> | ||
| `, | ||
| }) | ||
| export class DialogComponent { | ||
| @Input() header = ''; | ||
| @Input() visible = false; | ||
| @Input() modal = true; | ||
| @Input() size: DialogSize = 'default'; | ||
| @Input() dismissableMask = false; | ||
| @Input() closeOnEscape = true; | ||
| @Input() showHeader = true; | ||
| @Input() focusOnShow = false; | ||
| @Input() footerTemplate: TemplateRef<any> | null = null; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а в хедер мы не планируем кастомные шаблоны вставлять?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| @Output() visibleChange = new EventEmitter<boolean>(); | ||
|
|
||
| get sizeClass(): string { | ||
| if (this.size === 'sm') return 'p-dialog-sm'; | ||
| if (this.size === 'lg') return 'p-dialog-lg'; | ||
| if (this.size === 'xlg') return 'p-dialog-xlg'; | ||
| return ''; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| export const dialogCss = ({ dt }: { dt: (token: string) => string }): string => ` | ||
| .p-dialog .p-dialog-title { | ||
| font-family: ${dt('fonts.fontFamily.heading')}; | ||
| font-size: ${dt('dialog.title.fontSize')}; | ||
| font-weight: ${dt('dialog.title.fontWeight')}; | ||
| line-height: ${dt('fonts.lineHeight.550')}; | ||
| } | ||
|
|
||
| .p-dialog .p-dialog-content { | ||
| font-family: ${dt('fonts.fontFamily.base')}; | ||
| font-size: ${dt('fonts.fontSize.300')}; | ||
| font-weight: ${dt('fonts.fontWeight.regular')}; | ||
| line-height: ${dt('fonts.lineHeight.500')}; | ||
| } | ||
|
|
||
| .p-dialog .p-dialog-header { | ||
| border-bottom: ${dt('borderWidth.100')} solid ${dt('dialog.root.borderColor')}; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| .p-dialog .p-dialog-header-actions { | ||
| display: flex; | ||
| align-items: center; | ||
| margin-left: auto; | ||
| } | ||
|
|
||
| .p-dialog .p-dialog-header-actions .p-dialog-close-button.p-button-text:focus-visible, | ||
| .p-dialog .p-dialog-header-actions .p-dialog-close-button.p-button:focus-visible, | ||
| .p-dialog .p-button-text:focus-visible, | ||
| .p-dialog .p-button:focus-visible { | ||
| outline: 0 none; | ||
| outline-color: transparent; | ||
| box-shadow: none; | ||
| } | ||
|
|
||
| .p-dialog { | ||
| width: ${dt('sizing.80x')}; | ||
| } | ||
|
|
||
| .p-dialog.p-component.p-dialog-sm { | ||
| width: ${dt('overlay.sm.width')}; | ||
| } | ||
|
|
||
| .p-dialog.p-component.p-dialog-lg { | ||
| width: ${dt('overlay.lg.width')}; | ||
| } | ||
|
|
||
| .p-dialog.p-component.p-dialog-xlg { | ||
| width: ${dt('overlay.xlg.width')}; | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему решил не передавать этот пропс?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AxyIX добавление stories.ts в argTypes f8d18ec