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

n-modal 新增 max-height 属性 #6759

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 2.41.1

### Features

- `n-modal` add `max-height` props.

## 2.41.0

`2025-01-05`
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 2.41.1

### Features

- `n-modal` 新增 `max-height` 属性

## 2.41.0

`2025-01-05`
Expand Down
2 changes: 2 additions & 0 deletions src/dialog/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default c([
color: var(--n-text-color);
box-sizing: border-box;
margin: auto;
display: flex;
flex-direction: column;
border-radius: var(--n-border-radius);
padding: var(--n-padding);
transition:
Expand Down
1 change: 1 addition & 0 deletions src/modal/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Provided since `2.38.0`.
| transform-origin | `'mouse' \| 'center'` | `'mouse'` | The transform origin of the modal's display animation. | |
| trap-focus | `boolean` | `true` | Whether to trap focus inside modal. | 2.24.2 |
| z-index | `number` | `undefined` | Z index of the modal. | 2.24.0 |
| max-height | `number \| string` | `undefined` | Maximum height of a modal window | |
| on-after-enter | `() => void` | `undefined` | Callback after modal is opened. | |
| on-after-leave | `() => void` | `undefined` | Callback after modal is closed. | |
| on-esc | `() => void` | `undefined` | Callback fired when the escape key is pressed and focus is within modal. | 2.24.2 |
Expand Down
1 change: 1 addition & 0 deletions src/modal/demos/zhCN/dark-1-debug.demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default defineComponent({
v-model:show="showModal"
title="Dark Modal Debug"
preset="card"
max-height="80%"
:style="{ marginTop: '24px', marginBottom: '24px', width: '800px' }"
>
<n-radio-group
Expand Down
1 change: 1 addition & 0 deletions src/modal/demos/zhCN/dark-2-debug.demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default defineComponent({
v-model:show="modalActive"
title="Dark Modal Debug"
preset="card"
max-height="20%"
:style="{ marginTop: '24px', marginBottom: '24px', width: '800px' }"
>
<n-table :bordered="false" :single-line="false">
Expand Down
45 changes: 44 additions & 1 deletion src/modal/demos/zhCN/draggable.demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default defineComponent({
title="card 预设拖拽"
preset="card"
draggable
max-height="200px"
:style="{ width: '800px' }"
>
<div>无意义的内容...</div>
Expand All @@ -82,12 +83,53 @@ export default defineComponent({
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
<div>无意义的内容...</div>
</n-modal>
<n-modal
v-model:show="showModal2"
title="dialog 预设拖拽"
preset="dialog"
draggable
max-height="20%"
:style="{ width: '800px' }"
>
<div>无意义的内容...</div>
Expand All @@ -105,10 +147,11 @@ export default defineComponent({
v-model:show="showModal3"
title="无预设拖拽"
draggable
max-height="30%"
:style="{ width: '800px' }"
>
<template #default="{ draggableClass }">
<n-card>
<n-card content-style="overflow: auto">
<div :class="draggableClass">
点我拖拽
</div>
Expand Down
1 change: 1 addition & 0 deletions src/modal/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ mask-click-debug.vue
| transform-origin | `'mouse' \| 'center'` | `'mouse'` | 模态框动画出现的位置 | |
| trap-focus | `boolean` | `true` | 是否将焦点锁定在 Modal 内部 | 2.24.2 |
| z-index | `number` | `undefined` | Modal 的 z-index | 2.24.0 |
| max-height | `number \| string` | `undefined` | modal 窗口的最大高度 | |
| on-after-enter | `() => void` | `undefined` | Modal 出现后的回调 | |
| on-after-leave | `() => void` | `undefined` | Modal 关闭后的回调 | |
| on-esc | `() => void` | `undefined` | 焦点在 Modal 内部时按下 Esc 键的回调 | 2.24.2 |
Expand Down
Loading
Loading