From ff81c6b0c0749c2418330fe32cbe641170c49fb6 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 9 Jun 2020 20:09:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?async=20=E7=9A=84=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E6=94=B9=E6=88=90=E4=BE=9D=E8=B5=96=20async/mapLimit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/loader.ts | 2 +- scss/components/form/_file.scss | 2 +- src/renderers/Form/File.tsx | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/loader.ts b/examples/loader.ts index f675bbb0..b0c64094 100644 --- a/examples/loader.ts +++ b/examples/loader.ts @@ -22,7 +22,7 @@ const mapping: { 'amis': __moduleId('../src'), 'amis/embed': __moduleId('./embed.tsx'), 'prop-types': __moduleId('prop-types'), - 'async': __moduleId('async'), + 'async/mapLimit': __moduleId('async/mapLimit'), 'qs': __moduleId('qs') }; diff --git a/scss/components/form/_file.scss b/scss/components/form/_file.scss index ece71bb7..1cdf7476 100644 --- a/scss/components/form/_file.scss +++ b/scss/components/form/_file.scss @@ -74,7 +74,7 @@ &-itemInfoText { white-space: nowrap; - max-width: 180px; + max-width: 170px; overflow: hidden; text-overflow: ellipsis; display: inline-block; diff --git a/src/renderers/Form/File.tsx b/src/renderers/Form/File.tsx index 6f4186af..9c08f59a 100644 --- a/src/renderers/Form/File.tsx +++ b/src/renderers/Form/File.tsx @@ -4,7 +4,8 @@ import cx from 'classnames'; import qs from 'qs'; import find from 'lodash/find'; import isPlainObject from 'lodash/isPlainObject'; -import {mapLimit} from 'async'; +// @ts-ignore +import mapLimit from 'async/mapLimit'; import ImageControl from './Image'; import {Payload, ApiObject, ApiString} from '../../types'; import {filter} from '../../utils/tpl'; @@ -718,8 +719,8 @@ export default class FileControl extends React.Component { }; mapLimit(tasks, 3, uploadPartFile(state, config), function ( - err, - results + err: any, + results: any ) { if (err) { reject(err); From 4e4c186e4609f67b5ad2030d561728f0fc7d3342 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 9 Jun 2020 20:28:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=B1=BB=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/components/Form/Mode.jsx | 6 ++++-- scss/_utilities.scss | 10 ++++++++++ scss/components/form/_form.scss | 15 ++++++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/examples/components/Form/Mode.jsx b/examples/components/Form/Mode.jsx index fab73311..b63b4066 100644 --- a/examples/components/Form/Mode.jsx +++ b/examples/components/Form/Mode.jsx @@ -263,7 +263,8 @@ export default { mode: 'inline', placeholder: '请输入邮箱地址', label: '邮箱', - size: 'full' + size: 'full', + columnClassName: 'v-bottom' }, { type: 'password', @@ -293,7 +294,8 @@ export default { label: '密码', placeholder: '请输入密码', mode: 'inline', - size: 'full' + size: 'full', + columnClassName: 'v-bottom' } ] }, diff --git a/scss/_utilities.scss b/scss/_utilities.scss index c02c7c6c..54011865 100644 --- a/scss/_utilities.scss +++ b/scss/_utilities.scss @@ -1324,11 +1324,21 @@ } } +.v-top { + vertical-align: top !important; + align-self: flex-start; +} + .v-middle { vertical-align: middle !important; align-self: center; } +.v-bottom { + vertical-align: bottom !important; + align-self: flex-end; +} + .scrollable { overflow-x: hidden; overflow-y: auto; diff --git a/scss/components/form/_form.scss b/scss/components/form/_form.scss index 612b1546..845088c6 100644 --- a/scss/components/form/_form.scss +++ b/scss/components/form/_form.scss @@ -30,9 +30,6 @@ .#{$ns}Form-star { color: $red; font-size: $fontSizeXs; - position: absolute; - left: px2rem(-6px); - top: px2rem(3px); line-height: 1; } @@ -89,6 +86,12 @@ &--normal { > .#{$ns}Form-label { display: block; + + .#{$ns}Form-star { + position: absolute; + left: px2rem(-6px); + top: px2rem(3px); + } } } @@ -202,6 +205,12 @@ > .#{$ns}Form-label { padding-top: $Form-label-paddingTop; margin-bottom: 0; + + .#{$ns}Form-star { + position: absolute; + left: px2rem(-6px); + top: px2rem(3px); + } } .#{$ns}Form-itemColumn--xs {