From 7cbe0610e2e800c4b77a2c30fa7e7277f370fe0b Mon Sep 17 00:00:00 2001 From: devin Date: Thu, 14 Sep 2023 10:18:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?table=E5=93=8D=E5=BA=94=E5=BC=8F=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/table/__demo__/TheIndex.vue | 4 +- .../opendesign/src/table/style/index.scss | 116 +----------------- .../opendesign/src/table/style/media.scss | 70 +++++++++++ .../opendesign/src/table/style/style.scss | 114 +++++++++++++++++ packages/opendesign/src/table/style/var.scss | 23 ++-- packages/portal-ak/src/ak/theme/table.scss | 64 ---------- 6 files changed, 203 insertions(+), 188 deletions(-) create mode 100644 packages/opendesign/src/table/style/media.scss create mode 100644 packages/opendesign/src/table/style/style.scss diff --git a/packages/opendesign/src/table/__demo__/TheIndex.vue b/packages/opendesign/src/table/__demo__/TheIndex.vue index a76d1daf..2375f039 100644 --- a/packages/opendesign/src/table/__demo__/TheIndex.vue +++ b/packages/opendesign/src/table/__demo__/TheIndex.vue @@ -12,9 +12,9 @@ import TableDiyHead from './TableDiyHead.vue';
- +
diff --git a/packages/opendesign/src/table/style/index.scss b/packages/opendesign/src/table/style/index.scss index 3ccc20e8..504d59c4 100644 --- a/packages/opendesign/src/table/style/index.scss +++ b/packages/opendesign/src/table/style/index.scss @@ -1,114 +1,2 @@ -@use '../../_styles/mixin.scss' as *; -@use './var.scss'; - -.o-table { - position: relative; - color: var(--table-color); - - table { - width: 100%; - // border-collapse: collapse; - border-spacing: 0; - } - th, - td { - box-sizing: border-box; - } - th { - text-align: left; - font-weight: normal; - background-color: var(--table-head-bg); - - padding: var(--table-cell-padding); - font-size: var(--table-head-text-size); - line-height: var(--table-head-text-height); - height: var(--table-head-cell-height); - } - td { - padding: var(--table-cell-padding); - font-size: var(--table-text-size); - line-height: var(--table-text-height); - height: var(--table-cell-height); - } - - tbody tr { - @include hover { - &:hover { - background-color: var(--table-row-hover); - } - } - &:active { - background-color: var(--table-row-active); - } - } -} -.o-table-wrap { - border-radius: var(--table-radius); - overflow: hidden; - background-color: var(--table-bg-color); -} - -// border -.o-table-border-all, -.o-table-border-frame { - border: var(--table-border); -} -.o-table-border-all, -.o-table-border-row { - th, - td { - border-bottom: var(--table-border); - } -} - -.o-table-border-all, -.o-table-border-frame, -.o-table-border-row { - tr.last { - td { - border-bottom-color: transparent; - } - } -} - -.o-table-border-all, -.o-table-border-column { - th, - td { - border-right: var(--table-border); - - &.last { - border-right-color: transparent; - } - } -} - -// tip -.o-table-tip-wrap { - display: flex; - justify-content: center; - align-items: center; - font-size: var(--table-tip-text-size); - line-height: var(--table-tip-text-height); - color: var(--table-tip-color); - min-height: var(--table-body-min-height); -} -.o-table-loading-wrap { - display: flex; - justify-content: center; - align-items: center; - font-size: var(--table-tip-text-size); - line-height: var(--table-tip-text-height); - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: var(--table-loading-mask); - color: var(--table-loading-color); - border-radius: var(--table-radius); -} - -.o-table-loading-label { - margin-left: 8px; -} +@use './style.scss' as *; +@use './media.scss' as *; diff --git a/packages/opendesign/src/table/style/media.scss b/packages/opendesign/src/table/style/media.scss new file mode 100644 index 00000000..d1b3400a --- /dev/null +++ b/packages/opendesign/src/table/style/media.scss @@ -0,0 +1,70 @@ +@use '../../_styles/mixin.scss' as *; + +.o-table { + @include respond-to('<=pad') { + --table-radius: var(--o-radius_control-s); + } + + @include respond-to('laptop') { + --table-text-size: var(--o-font_size-tip1); + --table-text-height: var(--o-line_height-tip1); + + --table-head-cell-height: 40px; + --table-cell-height: 48px; + + --table-cell-padding: 12px 12px; + } + @include respond-to('pad') { + --table-text-size: var(--o-font_size-tip1); + --table-text-height: var(--o-line_height-tip1); + + --table-head-cell-height: 40px; + --table-cell-height: 48px; + + --table-cell-padding: 8px 12px; + } + @include respond-to('phone') { + --table-text-size: var(--o-font_size-tip2); + --table-text-height: var(--o-line_height-tip2); + + --table-head-cell-height: 32px; + --table-cell-height: 32px; + + --table-head-cell-padding: 4px 12px; + --table-cell-padding: 4px 12px; + } +} +.o-table-small { + @include respond-to('<=laptop') { + --table-head-cell-padding: 4px 12px; + --table-cell-padding: 8px 12px; + } + + @include respond-to('<=pad') { + --table-radius: var(--o-radius_control-s); + } + + @include respond-to('laptop') { + --table-text-size: var(--o-font_size-tip1); + --table-text-height: var(--o-line_height-tip1); + + --table-head-cell-height: 32px; + --table-cell-height: 40px; + } + + @include respond-to('pad') { + --table-text-size: var(--o-font_size-tip1); + --table-text-height: var(--o-line_height-tip1); + + --table-head-cell-height: 32px; + --table-cell-height: 40px; + } + + @include respond-to('phone') { + --table-text-size: var(--o-font_size-tip2); + --table-text-height: var(--o-line_height-tip2); + + --table-head-cell-height: 32px; + --table-cell-height: 32px; + } +} diff --git a/packages/opendesign/src/table/style/style.scss b/packages/opendesign/src/table/style/style.scss new file mode 100644 index 00000000..78668c1a --- /dev/null +++ b/packages/opendesign/src/table/style/style.scss @@ -0,0 +1,114 @@ +@use '../../_styles/mixin.scss' as *; +@use './var.scss'; + +.o-table { + position: relative; + color: var(--table-color); + + table { + width: 100%; + // border-collapse: collapse; + border-spacing: 0; + } + th, + td { + box-sizing: border-box; + } + th { + text-align: left; + font-weight: normal; + background-color: var(--table-head-bg); + + padding: var(--table-head-cell-padding); + font-size: var(--table-head-text-size); + line-height: var(--table-head-text-height); + height: var(--table-head-cell-height); + } + td { + padding: var(--table-cell-padding); + font-size: var(--table-text-size); + line-height: var(--table-text-height); + height: var(--table-cell-height); + } + + tbody tr { + @include hover { + &:hover { + background-color: var(--table-row-hover); + } + } + &:active { + background-color: var(--table-row-active); + } + } +} +.o-table-wrap { + border-radius: var(--table-radius); + overflow: hidden; + background-color: var(--table-bg-color); +} + +// border +.o-table-border-all, +.o-table-border-frame { + border: var(--table-border); +} +.o-table-border-all, +.o-table-border-row { + // th, + td { + border-bottom: var(--table-border); + } +} + +.o-table-border-all, +.o-table-border-frame, +.o-table-border-row { + tr.last { + td { + border-bottom-color: transparent; + } + } +} + +.o-table-border-all, +.o-table-border-column { + th, + td { + border-right: var(--table-border); + + &.last { + border-right-color: transparent; + } + } +} + +// tip +.o-table-tip-wrap { + display: flex; + justify-content: center; + align-items: center; + font-size: var(--table-tip-text-size); + line-height: var(--table-tip-text-height); + color: var(--table-tip-color); + min-height: var(--table-body-min-height); +} +.o-table-loading-wrap { + display: flex; + justify-content: center; + align-items: center; + font-size: var(--table-tip-text-size); + line-height: var(--table-tip-text-height); + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: var(--table-loading-mask); + color: var(--table-loading-color); + border-radius: var(--table-radius); +} + +.o-table-loading-label { + margin-left: 8px; +} diff --git a/packages/opendesign/src/table/style/var.scss b/packages/opendesign/src/table/style/var.scss index ce26b742..315ab486 100644 --- a/packages/opendesign/src/table/style/var.scss +++ b/packages/opendesign/src/table/style/var.scss @@ -22,21 +22,28 @@ --table-body-min-height: 200px; --table-bg-color: var(--o-color-control-light); - --table-radius: var(--o-radius_control-s); - --table-cell-padding: 8px 12px; - --table-cell-height: 48px; + --table-radius: var(--o-radius_control-m); + + --table-head-cell-padding: 8px 16px; + --table-cell-padding: 16px 16px; + + --table-cell-height: 56px; --table-head-cell-height: 48px; } .o-table-small { - --table-text-size: var(--o-font_size-tip1); - --table-text-height: var(--o-line_height-tip1); + --table-text-size: var(--o-font_size-text1); + --table-text-height: var(--o-line_height-text1); --table-head-text-size: var(--table-text-size); --table-head-text-height: var(--table-text-height); - --table-cell-padding: 4px 12px; - --table-cell-height: 32px; - --table-head-cell-height: 32px; + --table-radius: var(--o-radius_control-m); + + --table-head-cell-padding: 8px 12px; + --table-cell-padding: 12px 12px; + + --table-cell-height: 48px; + --table-head-cell-height: 40px; } diff --git a/packages/portal-ak/src/ak/theme/table.scss b/packages/portal-ak/src/ak/theme/table.scss index d27a5bcb..2162e0ce 100644 --- a/packages/portal-ak/src/ak/theme/table.scss +++ b/packages/portal-ak/src/ak/theme/table.scss @@ -1,65 +1 @@ @use './mixin.scss' as *; - -.o-table { - --table-cell-height: 56px; - --table-head-cell-height: 48px; - --table-cell-padding: 8px 16px 7px; - @include respond-to('laptop') { - --table-cell-height: 48px; - --table-head-cell-height: 40px; - --table-text-size: var(--o-font_size-tip1); - --table-text-height: var(--o-line_height-tip1); - } - - @include respond-to('laptop') { - --table-cell-height: 48px; - --table-head-cell-height: 40px; - --table-text-size: var(--o-font_size-tip1); - --table-text-height: var(--o-line_height-tip1); - - --table-cell-padding: 8px 12px 7px; - } - - @include respond-to('phone') { - --table-cell-height: 32px; - --table-head-cell-height: 32px; - - --table-text-size: var(--o-font_size-tip2); - --table-text-height: var(--o-line_height-tip2); - - --table-cell-padding: 8px 12px 7px; - --table-radius: var(--o-radius_control-xs); - } -} - -.o-table-small { - --table-text-size: var(--o-font_size-text1); - --table-text-height: var(--o-line_height-text1); - - --table-cell-height: 48px; - --table-head-cell-height: 40px; - - --table-cell-padding: 8px 12px 7px; - - @include respond-to('pad') { - --table-cell-height: 40px; - --table-head-cell-height: 32px; - - --table-text-size: var(--o-font_size-tip1); - --table-text-height: var(--o-line_height-tip1); - } - @include respond-to('phone') { - --table-cell-height: 34px; - --table-head-cell-height: 34px; - - --table-text-size: var(--o-font_size-tip2); - --table-text-height: var(--o-line_height-tip2); - --table-radius: var(--o-radius_control-xs); - } -} -.o-table-border-all, -.o-table-border-row { - th { - border-bottom: none; - } -} -- Gitee From 9d1b0fafe1a1d419319602d3d08af55095f4153d Mon Sep 17 00:00:00 2001 From: devin Date: Thu, 14 Sep 2023 11:49:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?select=E5=93=8D=E5=BA=94=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/opendesign/src/select/OSelect.vue | 1 + .../src/select/__demo__/SelectBasic.vue | 15 ++- .../src/select/__demo__/SelectLoading.vue | 1 - packages/opendesign/src/select/style/index.ts | 1 + .../opendesign/src/select/style/media.scss | 15 ++- .../opendesign/src/select/style/style.scss | 14 +-- packages/opendesign/src/select/style/var.scss | 104 +++++++++++------- packages/portal-ak/src/ak/theme/select.scss | 45 -------- 8 files changed, 100 insertions(+), 96 deletions(-) diff --git a/packages/opendesign/src/select/OSelect.vue b/packages/opendesign/src/select/OSelect.vue index 5828c83c..712b2f5c 100644 --- a/packages/opendesign/src/select/OSelect.vue +++ b/packages/opendesign/src/select/OSelect.vue @@ -366,6 +366,7 @@ const selectDlgAction: DialogActionT[] = [ { selectVal1.value = 'opt3'; @@ -22,7 +33,7 @@ const changeVal = () => { - + @@ -37,7 +48,7 @@ const changeVal = () => { - + diff --git a/packages/opendesign/src/select/__demo__/SelectLoading.vue b/packages/opendesign/src/select/__demo__/SelectLoading.vue index bf595a86..513f1729 100644 --- a/packages/opendesign/src/select/__demo__/SelectLoading.vue +++ b/packages/opendesign/src/select/__demo__/SelectLoading.vue @@ -104,7 +104,6 @@ const onAdd = () => {