mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat: 静态展示也支持 borderMode 配置 (#2672)
* feat: 静态展示也支持 borderMode 配置 * 更新 carousel dom 变化后的 snapshot
This commit is contained in:
parent
7e5f498ec9
commit
f5d44aabe4
@ -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>
|
||||
|
@ -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 {
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user