diff --git a/packages/opendesign/src/dialog/__demo__/DialogBasic.vue b/packages/opendesign/src/dialog/__demo__/DialogBasic.vue
index 89df74f78804fc911257e31174314bd4325877ed..656f0ccb7db340dd58519f908e372d32863fe1d6 100644
--- a/packages/opendesign/src/dialog/__demo__/DialogBasic.vue
+++ b/packages/opendesign/src/dialog/__demo__/DialogBasic.vue
@@ -8,6 +8,15 @@ const content =
'This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog This is Dialog';
const showDlg = ref(false);
const dlgSize = ref
('medium');
+const hasHead = ref(false);
+const hasFoot = ref(false);
+const toggleHeadOrFoot = (type: 'foot' | 'head') => {
+ if (type === 'head') {
+ hasHead.value = !hasHead.value;
+ } else if (type === 'foot') {
+ hasFoot.value = !hasFoot.value;
+ }
+};
const toggle = (show?: boolean, size: DialogSizeT = 'medium') => {
dlgSize.value = size;
if (show === undefined) {
@@ -72,21 +81,24 @@ const onChane = (v: boolean) => {
基本
+ show Header
+ show Footer
+
Open auto
Open Small
Open Medium
Open Large
Open exlarge
-
- Dialog Title
+
+ Dialog Title
{{ content }}
Open unmount-on-hide: false
- Dialog Title
+ Dialog Title
This is Dialog
-
+
确定
取消
@@ -98,7 +110,7 @@ const onChane = (v: boolean) => {
Open to parent
- Dialog Title
+ Dialog Title
This is Dialog
@@ -110,7 +122,7 @@ const onChane = (v: boolean) => {
Open to box
box
- Dialog Title
+ Dialog Title
This is Dialog
diff --git a/packages/opendesign/src/dialog/style/media.scss b/packages/opendesign/src/dialog/style/media.scss
index 5a0e387c1ae6eca9e42f669ee1dac44840fc5709..4dffdb0e9b26532d493b2ff399f5c6e6bf2d657e 100644
--- a/packages/opendesign/src/dialog/style/media.scss
+++ b/packages/opendesign/src/dialog/style/media.scss
@@ -32,26 +32,31 @@
}
}
-.o-dialog-auto {
+.o-dialog {
--dlg-margin: 24px;
@include respond-to('<=pad') {
- --dlg-head-padding: 16px 24px 0;
- --dlg-body-padding: 12px 24px;
- --dlg-foot-padding: 0 24px 16px;
+ --dlg-padding: 24px;
+ --dlg-padding-body-top: 16px;
}
}
.o-dlg-header {
+ @include respond-to('laptop') {
+ font-size: var(--o-font_size-h4);
+ line-height: var(--o-line_height-h4);
+ }
@include respond-to('<=pad') {
- font-size: var(--o-font_size-h3);
- line-height: var(--o-line_height-h3);
+ font-size: var(--o-font_size-text2);
+ line-height: var(--o-line_height-text2);
}
}
+
.o-dialog-exlarge {
@include respond-to('laptop') {
--dlg-width: 80%;
--dlg-max-height: 80%;
--dlg-min-height: 65%;
+ --dlg-padding: 24px;
}
@include respond-to('<=pad') {
--dlg-width: 100%;
@@ -65,6 +70,7 @@
--dlg-width: 65%;
--dlg-max-height: 80%;
--dlg-min-height: 50%;
+ --dlg-padding: 24px;
}
@include respond-to('<=pad') {
@@ -79,17 +85,28 @@
--dlg-width: 50%;
--dlg-max-height: 80%;
--dlg-min-height: 35%;
+ --dlg-padding: 24px;
+ --dlg-padding-body-top: 16px;
+ --dlg-padding-body-bottom: 16px;
}
@include respond-to('pad') {
--dlg-width: 65%;
--dlg-max-height: 80%;
--dlg-min-height: 128px;
+ --dlg-margin: 24px;
+
+ --dlg-padding: 24px;
+ --dlg-padding-body-top: 16px;
+ --dlg-padding-body-bottom: 16px;
}
@include respond-to('phone') {
--dlg-width: calc(100vw - 48px);
--dlg-max-height: 65%;
--dlg-min-height: 128px;
--dlg-margin: 24px;
+ --dlg-padding: 16px;
+ --dlg-padding-body-top: 12px;
+ --dlg-padding-body-bottom: 12px;
}
}
.o-dialog-small {
@@ -97,22 +114,30 @@
--dlg-width: 35%;
--dlg-max-height: 50%;
--dlg-min-height: 20%;
+
+ --dlg-padding: 24px;
+ --dlg-padding-body-top: 12px;
+ --dlg-padding-body-bottom: 16px;
+ }
+ @include respond-to('<=pad') {
+ --dlg-min-height: 128px;
+ --dlg-margin: 24px;
+
+ --dlg-padding: 16px;
+ --dlg-padding-body-top: 8px;
+ --dlg-padding-body-bottom: 12px;
}
@include respond-to('pad_h') {
--dlg-width: 50%;
--dlg-max-height: 80%;
- --dlg-min-height: 128px;
}
@include respond-to('pad_v') {
--dlg-width: 65%;
--dlg-max-height: 80%;
- --dlg-min-height: 128px;
}
@include respond-to('phone') {
--dlg-width: calc(100vw - 48px);
--dlg-max-height: 65%;
- --dlg-min-height: 128px;
- --dlg-margin: 24px;
}
}
@@ -120,6 +145,9 @@
@include respond-to('phone') {
--dlg-width: 100%;
--dlg-margin: 0;
- --dlg-radius: var(--o-radius_control-l) var(--o-radius_control-l) 0 0;
+ &.o-dialog-small,
+ &.o-dialog-medium {
+ --dlg-radius: var(--o-radius_control-l) var(--o-radius_control-l) 0 0;
+ }
}
}
diff --git a/packages/opendesign/src/dialog/style/style.scss b/packages/opendesign/src/dialog/style/style.scss
index acc7505b5c479aa1526d76ab7c834237f58091a8..df29cf7f0c2fb7315f2f07b5f72655a288cd4f4c 100644
--- a/packages/opendesign/src/dialog/style/style.scss
+++ b/packages/opendesign/src/dialog/style/style.scss
@@ -38,8 +38,8 @@
.o-dlg-header {
padding: var(--dlg-head-padding);
text-align: center;
- font-size: var(--o-font_size-h1);
- line-height: var(--o-line_height-h1);
+ font-size: var(--o-font_size-h2);
+ line-height: var(--o-line_height-h2);
font-weight: 500;
border-top-left-radius: inherit;
border-top-right-radius: inherit;
@@ -53,13 +53,16 @@
overflow: hidden;
border-radius: inherit;
+
.o-dlg-header + & {
border-top-left-radius: 0;
border-top-right-radius: 0;
+ padding-top: var(--dlg-padding-body-top);
}
&:has(+ .o-dlg-footer) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
+ padding-bottom: var(--dlg-padding-body-bottom);
}
}
.o-dlg-footer {
diff --git a/packages/opendesign/src/dialog/style/var.scss b/packages/opendesign/src/dialog/style/var.scss
index f7d6bdace85120912ffb1261eccdb8e85c935bd6..ee5651a5ed99543d52ac849bec8c49c4541074f7 100644
--- a/packages/opendesign/src/dialog/style/var.scss
+++ b/packages/opendesign/src/dialog/style/var.scss
@@ -10,9 +10,14 @@
--dlg-max-height: 100%;
--dlg-min-width: 272px;
- --dlg-head-padding: 24px 24px 0;
- --dlg-body-padding: 16px 24px;
- --dlg-foot-padding: 0 24px 24px;
+
+ --dlg-padding: 32px;
+ --dlg-padding-body-top: 24px;
+ --dlg-padding-body-bottom: 24px;
+
+ --dlg-head-padding: var(--dlg-padding) var(--dlg-padding) 0;
+ --dlg-body-padding: var(--dlg-padding);
+ --dlg-foot-padding: 0 var(--dlg-padding) var(--dlg-padding);
}
.o-dialog-auto {
@@ -40,7 +45,6 @@
--dlg-max-height: 272px;
--dlg-min-height: 224px;
- --dlg-head-padding: 16px 24px 0;
- --dlg-body-padding: 12px 24px;
- --dlg-foot-padding: 0 24px 16px;
+ --dlg-padding: 32px;
+ --dlg-padding-body-top: 16px;
}
diff --git a/packages/portal-ak/src/ak/theme/dialog.scss b/packages/portal-ak/src/ak/theme/dialog.scss
index 7e12270d90078e888316bfb4fc861d2723b824cb..b5e5cee73089353935be75e8f328608627f345c1 100644
--- a/packages/portal-ak/src/ak/theme/dialog.scss
+++ b/packages/portal-ak/src/ak/theme/dialog.scss
@@ -36,3 +36,10 @@
display: flex;
}
}
+
+.o-dlg-body {
+ @include respond-to('<=laptop') {
+ font-size: var(--o-font_size-tip1);
+ line-height: var(--o-line_height-tip1);
+ }
+}