feat: 静态展示也支持 borderMode 配置 (#2672)

* feat: 静态展示也支持 borderMode 配置

* 更新 carousel dom 变化后的 snapshot
This commit is contained in:
liaoxuezhi 2021-10-11 11:24:51 +08:00 committed by GitHub
parent 7e5f498ec9
commit f5d44aabe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 19 deletions

View File

@ -66,24 +66,20 @@ exports[`Renderer:carousel 1`] = `
/>
</div>
<div
class="cxd-Carousel-arrowsControl"
class="cxd-Carousel-leftArrow"
>
<div
class="cxd-Carousel-leftArrow"
>
<icon-mock
classname="icon icon-left-arrow"
icon="left-arrow"
/>
</div>
<div
class="cxd-Carousel-rightArrow"
>
<icon-mock
classname="icon icon-right-arrow"
icon="right-arrow"
/>
</div>
<icon-mock
classname="icon icon-left-arrow"
icon="left-arrow"
/>
</div>
<div
class="cxd-Carousel-rightArrow"
>
<icon-mock
classname="icon icon-right-arrow"
icon="right-arrow"
/>
</div>
</div>
</div>

View File

@ -33,6 +33,19 @@
display: inline-block;
vertical-align: top;
}
&--borderFull {
border: var(--Form-input-borderWidth) solid var(--Form-input-borderColor);
border-radius: var(--Form-input-borderRadius);
padding: var(--Form-input-paddingY) var(--Form-input-paddingX);
}
&--borderHalf {
border-bottom: var(--Form-input-borderWidth) solid
var(--Form-input-borderColor);
border-radius: var(--Form-input-borderRadius);
padding: var(--Form-input-paddingY) var(--Form-input-paddingX);
}
}
.#{$ns}Form-label {

View File

@ -5,7 +5,7 @@ import PopOver, {SchemaPopOver} from '../PopOver';
import QuickEdit, {SchemaQuickEdit} from '../QuickEdit';
import {Renderer} from '../../factory';
import Copyable, {SchemaCopyable} from '../Copyable';
import {extendObject} from '../../utils/helper';
import {extendObject, ucFirst} from '../../utils/helper';
import omit = require('lodash/omit');
import {SchemaObject, SchemaTpl, SchemaType} from '../../Schema';
@ -40,6 +40,11 @@ export interface StaticExactControlSchema extends FormBaseControl {
*
*/
copyable?: SchemaCopyable;
/**
*
*/
borderMode?: 'full' | 'half' | 'none';
}
export interface StaticProps extends FormControlProps {
@ -91,6 +96,7 @@ export default class StaticControl extends React.Component<StaticProps, any> {
disabled,
$schema,
defaultValue,
borderMode,
...rest
} = this.props;
@ -106,7 +112,11 @@ export default class StaticControl extends React.Component<StaticProps, any> {
};
return (
<div className={cx('Form-static')}>
<div
className={cx('Form-static', {
[`Form-static--border${ucFirst(borderMode)}`]: borderMode
})}
>
<StaticFieldRenderer
{...{
...(rest as any),