Skip to content

Commit

Permalink
Merge branch 'zentao' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Jul 9, 2024
2 parents 31edf74 + e47371a commit 3365025
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
14 changes: 8 additions & 6 deletions lib/modal/src/component/modal-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {classes} from '@zui/core';
import {classes, CustomContent} from '@zui/core';
import {Toolbar} from '@zui/toolbar/src/component/toolbar';
import {Component, isValidElement} from 'preact';
import {ModalDialogOptions} from '../types';
Expand Down Expand Up @@ -30,6 +30,9 @@ export class ModalDialog extends Component<ModalDialogOptions> {
if (header === false || !title) {
return null;
}
if (header) {
return <CustomContent className={classes('modal-header', headerClass)} content={header} />;
}
return (
<div className={classes('modal-header', headerClass)}>
<div className="modal-title">{title}</div>
Expand Down Expand Up @@ -69,11 +72,7 @@ export class ModalDialog extends Component<ModalDialogOptions> {
if (isValidElement(body)) {
return body;
}
return (
<div className={classes('modal-body', bodyClass)}>
{body}
</div>
);
return <CustomContent className={classes('modal-body', bodyClass)} content={body} />;
}

renderFooter() {
Expand All @@ -88,6 +87,9 @@ export class ModalDialog extends Component<ModalDialogOptions> {
if (footer === false || !footerActions) {
return null;
}
if (footer) {
return <CustomContent className={classes('modal-footer', footerClass)} content={footer} />;
}
return (
<div className={classes('modal-footer', footerClass)}>
{footerActions ? <Toolbar {...footerActions} /> : null}
Expand Down
8 changes: 4 additions & 4 deletions lib/modal/src/types/modal-dialog-options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {ComponentChildren, JSX} from 'preact';
import type {ClassNameLike} from '@zui/core';
import type {ClassNameLike, CustomContentType} from '@zui/core';
import type {ToolbarOptions} from '@zui/toolbar';

export type ModalDialogOptions = {
Expand All @@ -8,13 +8,13 @@ export type ModalDialogOptions = {
bodyClass?: ClassNameLike;
style?: JSX.CSSProperties;
title?: ComponentChildren;
header?: ComponentChildren;
header?: CustomContentType;
headerClass?: ClassNameLike;
body?: ComponentChildren;
body?: CustomContentType;
actions?: ToolbarOptions;
closeBtn?: boolean;
children?: ComponentChildren;
footer?: ComponentChildren;
footer?: CustomContentType;
footerClass?: ClassNameLike;
footerActions?: ToolbarOptions;
afterRender?: (info: {firstRender: boolean}) => void;
Expand Down
6 changes: 3 additions & 3 deletions lib/modal/src/types/modal-options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {ComponentChild} from 'preact';
import type {ToolbarItemOptions} from '@zui/toolbar/src/types';
import type {CustomContentType} from '@zui/core';
import type {ToolbarItemOptions} from '@zui/toolbar';
import type {ModalDialogOptions} from './modal-dialog-options';
import type {ModalBaseOptions} from './modal-base-options';
import type {Modal} from '../vanilla/modal';
Expand All @@ -21,7 +21,7 @@ export type ModalOptions = ModalBaseOptions & {

export interface ModalCustomOptions extends ModalOptions {
type: 'custom',
content?: ComponentChild;
content?: CustomContentType;
custom: ModalDialogOptions | (() => ModalDialogOptions);
}

Expand Down
3 changes: 3 additions & 0 deletions lib/picker/src/style/picker-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
.picker-menu-list.tree {
@apply -p-2;
}
.picker-menu-list .tree-item > .selected .item-content {
@apply -font-normal;
}
.picker-menu .search-menu-footer {
@apply -border-t -py-1;
}
2 changes: 1 addition & 1 deletion lib/tree/src/style/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
background: var(--menu-selected-bg);
}
.tree-item > .selected .item-content {
@apply -text-[--menu-selected-color];
@apply -text-[--menu-selected-color] -font-bold;
}

0 comments on commit 3365025

Please sign in to comment.