Skip to content

dialog: стилизация, сторисы, обёртки#31

Open
khaliulin wants to merge 9 commits intofeature/styles-debugfrom
overlay.dialog
Open

dialog: стилизация, сторисы, обёртки#31
khaliulin wants to merge 9 commits intofeature/styles-debugfrom
overlay.dialog

Conversation

@khaliulin
Copy link
Copy Markdown

No description provided.

[showHeader]="showHeader"
[focusOnShow]="focusOnShow"
[styleClass]="sizeClass"
appendTo="body"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

а почему решил не передавать этот пропс?

Copy link
Copy Markdown
Author

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

@Input() closeOnEscape = true;
@Input() showHeader = true;
@Input() focusOnShow = false;
@Input() footerTemplate: TemplateRef<any> | null = null;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

а в хедер мы не планируем кастомные шаблоны вставлять?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@AxyIX добавлен @input() headerTemplate ecd07ee

import { DialogNoModalComponent } from './examples/dialog-no-modal.component';
import { DialogNoHeaderComponent } from './examples/dialog-no-header.component';

const meta: Meta<DialogComponent> = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ну увидел использования механизма DynamicDialog. по сути своей это тот же Dialog только вызывается динамически. хотя в целом можно попробовать пожить без него. и если будет неудобно - потом добавить

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@AxyIX добавлен DynamicDialog bd0772c

import { Component, TemplateRef, ViewChild } from '@angular/core';
import { Button } from 'primeng/button';
import { DialogComponent } from '@cdek-it/angular-ui-kit';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

у тебя на уровне каждого компонента для стори задается переменная template. Думаю её можно экспортировать и также использовать здесь, в source.code.

import {template as dialogBasicTemplate} from '../dialog-default.component.ts';
...
  standalone: true,
  imports: [DialogComponent, Button],
  template: \`
    ${dialogBasicTemplate}
  \`,
})
export class DialogBasicComponent {
  @ViewChild('footer') footer!: TemplateRef<any>;
  visible = false;
}
...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@AxyIX фикс 25a2cbe

[styleClass]="sizeClass"
[appendTo]="appendTo"
>
@if (headerTemplate) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

а почему хедер через if, а футер нет?
думаю стоит оба через if сделать

template,
})
export class DialogDefaultComponent {
@ViewChild('footer') footer!: TemplateRef<any>;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

это не обязательно если мы используем блок в шаблоне. то есть когда мы делаем #footer у нас на уровне шаблона появляется переменная footer

<p-button (onClick)="visible = true" label="Создать заявку"></p-button>

<ng-template #footer>
<p-button variant="text" label="Отмена" (onClick)="visible = false"></p-button>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

тут думаю должны быть наши кнопки, а не праймовские

selector: 'app-dialog-dynamic',
standalone: true,
imports: [Button],
providers: [DialogService, UiDialogService],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

на уровне стори мы ничего не должны знать про прайм. потому что стори это как будто бы наши модули, которые мы пишем. то есть наш UiDialogService должен сам уметь провайдить праймовский DialogService под капотом.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants