amis 1.9.1-beta.28 → 1.9.1-beta.30
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/AnchorNav.d.ts +9 -2
- package/lib/components/AnchorNav.js +32 -5
- package/lib/components/AnchorNav.js.map +2 -2
- package/lib/components/DatePicker.d.ts +41 -40
- package/lib/components/DatePicker.js +3 -5
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +45 -42
- package/lib/components/DateRangePicker.js +43 -11
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/MonthRangePicker.d.ts +41 -40
- package/lib/components/MonthRangePicker.js +2 -2
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/SearchBox.d.ts +124 -42
- package/lib/components/SearchBox.js +181 -19
- package/lib/components/SearchBox.js.map +2 -2
- package/lib/components/Tag.d.ts +12 -10
- package/lib/components/Tag.js +18 -7
- package/lib/components/Tag.js.map +2 -2
- package/lib/components/calendar/Calendar.d.ts +1 -0
- package/lib/components/calendar/Calendar.js +8 -8
- package/lib/components/calendar/Calendar.js.map +2 -2
- package/lib/components/calendar/DaysView.d.ts +2 -1
- package/lib/components/calendar/DaysView.js +5 -4
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/index.js +1 -1
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/CRUD.d.ts +2 -0
- package/lib/renderers/CRUD.js +8 -2
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Card.d.ts +7 -2
- package/lib/renderers/Card.js +11 -7
- package/lib/renderers/Card.js.map +2 -2
- package/lib/renderers/Form/InputColor.d.ts +0 -458
- package/lib/renderers/Form/InputColor.js +8 -9
- package/lib/renderers/Form/InputColor.js.map +2 -2
- package/lib/renderers/Form/InputExcel.d.ts +1 -0
- package/lib/renderers/Form/InputExcel.js +5 -0
- package/lib/renderers/Form/InputExcel.js.map +2 -2
- package/lib/renderers/Form/InputFile.d.ts +2 -2
- package/lib/renderers/Form/InputFile.js +6 -5
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputTable.js +16 -2
- package/lib/renderers/Form/InputTable.js.map +2 -2
- package/lib/renderers/Form/InputText.d.ts +8 -0
- package/lib/renderers/Form/InputText.js +8 -8
- package/lib/renderers/Form/InputText.js.map +2 -2
- package/lib/renderers/IFrame.d.ts +4 -0
- package/lib/renderers/IFrame.js +2 -2
- package/lib/renderers/IFrame.js.map +2 -2
- package/lib/renderers/Table/index.js +2 -2
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tag.js +2 -2
- package/lib/renderers/Tag.js.map +2 -2
- package/lib/renderers/Wizard.d.ts +1 -1
- package/lib/renderers/Wizard.js +72 -75
- package/lib/renderers/Wizard.js.map +2 -2
- package/lib/store/formItem.js +2 -1
- package/lib/store/formItem.js.map +2 -2
- package/lib/themes/ang-ie11.css +134 -21
- package/lib/themes/ang.css +138 -21
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +134 -21
- package/lib/themes/antd.css +138 -21
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +134 -21
- package/lib/themes/cxd.css +138 -21
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +134 -21
- package/lib/themes/dark.css +138 -21
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +134 -21
- package/lib/themes/default.css +138 -21
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/dom.js +3 -2
- package/lib/utils/dom.js.map +2 -2
- package/package.json +3 -3
- package/schema.json +35 -14
- package/scss/_properties.scss +5 -0
- package/scss/components/_anchor-nav.scss +1 -0
- package/scss/components/_calendar.scss +32 -14
- package/scss/components/_search-box.scss +116 -10
- package/scss/components/_tag.scss +12 -3
- package/scss/components/form/_date-range.scss +1 -1
- package/scss/components/form/_date.scss +28 -24
- package/sdk/ang-ie11.css +146 -20
- package/sdk/ang.css +150 -20
- package/sdk/antd-ie11.css +146 -20
- package/sdk/antd.css +150 -20
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +146 -20
- package/sdk/cxd.css +150 -20
- package/sdk/dark-ie11.css +146 -20
- package/sdk/dark.css +150 -20
- package/sdk/exceljs.js +1 -1
- package/sdk/locale/de-DE.js +1 -0
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +9 -23
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +146 -20
- package/sdk/sdk.css +150 -20
- package/sdk/sdk.js +1480 -1336
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/components/AnchorNav.tsx +48 -7
- package/src/components/DatePicker.tsx +9 -8
- package/src/components/DateRangePicker.tsx +62 -11
- package/src/components/MonthRangePicker.tsx +4 -2
- package/src/components/SearchBox.tsx +262 -29
- package/src/components/Tag.tsx +14 -3
- package/src/components/calendar/Calendar.tsx +30 -14
- package/src/components/calendar/DaysView.tsx +17 -5
- package/src/locale/de-DE.ts +1 -0
- package/src/locale/en-US.ts +1 -0
- package/src/locale/zh-CN.ts +1 -0
- package/src/renderers/CRUD.tsx +10 -0
- package/src/renderers/Card.tsx +24 -12
- package/src/renderers/Form/InputColor.tsx +14 -19
- package/src/renderers/Form/InputExcel.tsx +6 -0
- package/src/renderers/Form/InputFile.tsx +19 -18
- package/src/renderers/Form/InputTable.tsx +25 -4
- package/src/renderers/Form/InputText.tsx +20 -5
- package/src/renderers/IFrame.tsx +30 -1
- package/src/renderers/Table/index.tsx +2 -1
- package/src/renderers/Tag.tsx +2 -0
- package/src/renderers/Wizard.tsx +2 -1
- package/src/store/formItem.ts +4 -1
- package/src/utils/dom.tsx +3 -2
- package/sdk/color-picker.js +0 -130
package/src/renderers/Card.tsx
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import omit from 'lodash/omit';
|
3
|
+
import merge from 'lodash/merge';
|
2
4
|
import {Renderer, RendererProps} from '../factory';
|
3
5
|
import {SchemaNode, Schema, Action, PlainObject} from '../types';
|
4
6
|
import {filter, evalExpression} from '../utils/tpl';
|
@@ -9,7 +11,6 @@ import QuickEdit, {SchemaQuickEdit} from './QuickEdit';
|
|
9
11
|
import PopOver, {SchemaPopOver} from './PopOver';
|
10
12
|
import {TableCell} from './Table';
|
11
13
|
import Copyable, {SchemaCopyable} from './Copyable';
|
12
|
-
import omit = require('lodash/omit');
|
13
14
|
import {
|
14
15
|
BaseSchema,
|
15
16
|
SchemaClassName,
|
@@ -207,6 +208,11 @@ export interface CardSchema extends BaseSchema {
|
|
207
208
|
* 次要说明
|
208
209
|
*/
|
209
210
|
secondary?: SchemaTpl;
|
211
|
+
|
212
|
+
/**
|
213
|
+
* 卡片内容区的表单项label是否使用Card内部的样式,默认为true
|
214
|
+
*/
|
215
|
+
useCardLabel?: boolean;
|
210
216
|
}
|
211
217
|
export interface CardProps
|
212
218
|
extends RendererProps,
|
@@ -249,7 +255,8 @@ export class CardRenderer extends React.Component<CardProps> {
|
|
249
255
|
selectable: false,
|
250
256
|
checkable: true,
|
251
257
|
selected: false,
|
252
|
-
hideCheckToggler: false
|
258
|
+
hideCheckToggler: false,
|
259
|
+
useCardLabel: true
|
253
260
|
};
|
254
261
|
|
255
262
|
static propsList: Array<string> = [
|
@@ -490,10 +497,10 @@ export class CardRenderer extends React.Component<CardProps> {
|
|
490
497
|
return this.renderFeild(`column/${index}`, field, index, props);
|
491
498
|
}
|
492
499
|
|
493
|
-
renderFeild(region: string, field:
|
494
|
-
const {render, classnames: cx, itemIndex} = props;
|
500
|
+
renderFeild(region: string, field: Schema, key: any, props: any) {
|
501
|
+
const {render, classnames: cx, itemIndex, useCardLabel} = props;
|
495
502
|
const data = this.props.data;
|
496
|
-
if (!isVisible(field, data)) {
|
503
|
+
if (!field || !isVisible(field, data)) {
|
497
504
|
return;
|
498
505
|
}
|
499
506
|
|
@@ -501,7 +508,7 @@ export class CardRenderer extends React.Component<CardProps> {
|
|
501
508
|
|
502
509
|
return (
|
503
510
|
<div className={cx('Card-field')} key={key}>
|
504
|
-
{
|
511
|
+
{useCardLabel && field.label ? (
|
505
512
|
<label className={cx('Card-fieldLabel', field.labelClassName)}>
|
506
513
|
{field.label}
|
507
514
|
</label>
|
@@ -510,12 +517,17 @@ export class CardRenderer extends React.Component<CardProps> {
|
|
510
517
|
{
|
511
518
|
render(
|
512
519
|
region,
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
520
|
+
merge(
|
521
|
+
{
|
522
|
+
...field,
|
523
|
+
field: field,
|
524
|
+
$$id,
|
525
|
+
type: 'card-item-field'
|
526
|
+
},
|
527
|
+
useCardLabel
|
528
|
+
? {label: false, field: {...field, label: false}}
|
529
|
+
: {}
|
530
|
+
),
|
519
531
|
{
|
520
532
|
className: cx('Card-fieldValue', field.className),
|
521
533
|
rowIndex: itemIndex,
|
@@ -4,10 +4,7 @@ import cx from 'classnames';
|
|
4
4
|
import {FormItem, FormControlProps, FormBaseControl} from './Item';
|
5
5
|
import type {PresetColor} from '../../components/ColorPicker';
|
6
6
|
import {isMobile} from '../../utils/helper';
|
7
|
-
|
8
|
-
export const ColorPicker = React.lazy(
|
9
|
-
() => import('../../components/ColorPicker')
|
10
|
-
);
|
7
|
+
import ColorPicker from '../../components/ColorPicker';
|
11
8
|
|
12
9
|
/**
|
13
10
|
* Color 颜色选择框
|
@@ -80,21 +77,19 @@ export default class ColorControl extends React.PureComponent<
|
|
80
77
|
const mobileUI = useMobileUI && isMobile();
|
81
78
|
return (
|
82
79
|
<div className={cx(`${ns}ColorControl`, className)}>
|
83
|
-
<
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
/>
|
97
|
-
</Suspense>
|
80
|
+
<ColorPicker
|
81
|
+
classPrefix={ns}
|
82
|
+
{...rest}
|
83
|
+
useMobileUI={useMobileUI}
|
84
|
+
popOverContainer={
|
85
|
+
mobileUI && env && env.getModalContainer
|
86
|
+
? env.getModalContainer
|
87
|
+
: mobileUI
|
88
|
+
? undefined
|
89
|
+
: rest.popOverContainer
|
90
|
+
}
|
91
|
+
value={value || ''}
|
92
|
+
/>
|
98
93
|
</div>
|
99
94
|
);
|
100
95
|
}
|
@@ -66,6 +66,12 @@ export default class ExcelControl extends React.PureComponent<
|
|
66
66
|
|
67
67
|
ExcelJS: any;
|
68
68
|
|
69
|
+
componentDidUpdate(prevProps: ExcelProps) {
|
70
|
+
if (prevProps.value !== this.props.value && !this.props.value) {
|
71
|
+
this.setState({filename: ''});
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
69
75
|
@autobind
|
70
76
|
handleDrop(files: File[]) {
|
71
77
|
const {allSheets, onChange, dispatchEvent, data} = this.props;
|
@@ -222,12 +222,12 @@ export interface FileControlSchema extends FormBaseControl {
|
|
222
222
|
/**
|
223
223
|
* 说明文档内容配置
|
224
224
|
*/
|
225
|
-
|
225
|
+
documentation?: string;
|
226
226
|
|
227
|
-
|
227
|
+
/**
|
228
228
|
* 说明文档链接配置
|
229
229
|
*/
|
230
|
-
|
230
|
+
documentLink?: string;
|
231
231
|
|
232
232
|
/**
|
233
233
|
* 是否为拖拽上传
|
@@ -580,14 +580,16 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
580
580
|
file[urlField as keyof typeof file] ||
|
581
581
|
file[valueField as keyof typeof file];
|
582
582
|
|
583
|
-
|
584
|
-
typeof downloadUrl === 'string' &&
|
583
|
+
const api =
|
584
|
+
typeof downloadUrl === 'string' &&
|
585
|
+
!~downloadUrl.indexOf('$') &&
|
586
|
+
typeof fileUrl === 'string'
|
585
587
|
? `${downloadUrl}${fileUrl}`
|
586
588
|
: downloadUrl
|
587
589
|
? downloadUrl
|
588
|
-
:
|
590
|
+
: undefined;
|
589
591
|
|
590
|
-
this.handleApi(api, file);
|
592
|
+
api && this.handleApi(api, file);
|
591
593
|
}
|
592
594
|
|
593
595
|
downloadTpl(e: React.MouseEvent) {
|
@@ -1283,7 +1285,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
1283
1285
|
templateUrl,
|
1284
1286
|
drag,
|
1285
1287
|
documentation,
|
1286
|
-
documentLink
|
1288
|
+
documentLink
|
1287
1289
|
} = this.props;
|
1288
1290
|
let {files, uploading, error} = this.state;
|
1289
1291
|
const nameField = this.props.nameField || 'name';
|
@@ -1348,17 +1350,16 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
1348
1350
|
<Icon icon="cloud-upload" className="icon" />
|
1349
1351
|
<span>
|
1350
1352
|
{__('File.dragDrop')}
|
1351
|
-
<span
|
1352
|
-
|
1353
|
-
|
1353
|
+
<span className={cx('FileControl-acceptTip-click')}>
|
1354
|
+
{__('File.clickUpload')}
|
1355
|
+
</span>
|
1354
1356
|
</span>
|
1355
|
-
<div
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
>{documentation ? documentation : __('File.helpText')}</a> : null}
|
1357
|
+
<div className={cx('FileControl-acceptTip-help', 'TplField')}>
|
1358
|
+
{documentLink ? (
|
1359
|
+
<a href={documentLink} onClick={e => e.stopPropagation()}>
|
1360
|
+
{documentation ? documentation : __('File.helpText')}
|
1361
|
+
</a>
|
1362
|
+
) : null}
|
1362
1363
|
</div>
|
1363
1364
|
{maxSize ? (
|
1364
1365
|
<div className={cx('FileControl-sizeTip')}>
|
@@ -12,13 +12,14 @@ import {RendererData, Action, Api, Payload, ApiObject} from '../../types';
|
|
12
12
|
import {isEffectiveApi} from '../../utils/api';
|
13
13
|
import {filter} from '../../utils/tpl';
|
14
14
|
import omit from 'lodash/omit';
|
15
|
-
import {dataMapping} from '../../utils/tpl-builtin';
|
15
|
+
import {dataMapping, filterDate} from '../../utils/tpl-builtin';
|
16
16
|
import findIndex from 'lodash/findIndex';
|
17
17
|
import {SimpleMap} from '../../utils/SimpleMap';
|
18
18
|
import {Icon} from '../../components/icons';
|
19
19
|
import {TableSchema} from '../Table';
|
20
20
|
import {SchemaApi} from '../../Schema';
|
21
21
|
import find from 'lodash/find';
|
22
|
+
import moment from 'moment';
|
22
23
|
|
23
24
|
export interface TableControlSchema
|
24
25
|
extends FormBaseControl,
|
@@ -466,19 +467,39 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
|
466
467
|
}
|
467
468
|
|
468
469
|
addItem(index: number) {
|
469
|
-
const {needConfirm, scaffold, columns} = this.props;
|
470
|
+
const {needConfirm, scaffold, columns, data} = this.props;
|
470
471
|
const items = this.state.items.concat();
|
471
472
|
let value: any = {
|
472
473
|
__isPlaceholder: true
|
473
474
|
};
|
474
475
|
|
475
476
|
if (Array.isArray(columns)) {
|
476
|
-
columns.forEach(column => {
|
477
|
+
columns.forEach((column: any) => {
|
477
478
|
if (
|
478
479
|
typeof column.value !== 'undefined' &&
|
479
480
|
typeof column.name === 'string'
|
480
481
|
) {
|
481
|
-
|
482
|
+
if (
|
483
|
+
[
|
484
|
+
'input-date',
|
485
|
+
'input-datetime',
|
486
|
+
'input-time',
|
487
|
+
'input-month',
|
488
|
+
'input-quarter',
|
489
|
+
'input-year'
|
490
|
+
].includes(column.type)
|
491
|
+
) {
|
492
|
+
const date = filterDate(column.value, data, column.format || 'X');
|
493
|
+
setVariable(
|
494
|
+
value,
|
495
|
+
column.name,
|
496
|
+
(column.utc ? moment.utc(date) : date).format(
|
497
|
+
column.format || 'X'
|
498
|
+
)
|
499
|
+
);
|
500
|
+
} else {
|
501
|
+
setVariable(value, column.name, column.value);
|
502
|
+
}
|
482
503
|
}
|
483
504
|
});
|
484
505
|
}
|
@@ -96,6 +96,12 @@ export interface TextControlSchema extends FormOptionsControl {
|
|
96
96
|
/** 用户输入的字符自动转大写 */
|
97
97
|
upperCase?: boolean;
|
98
98
|
};
|
99
|
+
|
100
|
+
/** control节点的CSS类名 */
|
101
|
+
inputControlClassName?: string;
|
102
|
+
|
103
|
+
/** 原生input标签的CSS类名 */
|
104
|
+
nativeInputClassName: string;
|
99
105
|
}
|
100
106
|
|
101
107
|
export type InputTextRendererEvent =
|
@@ -124,6 +130,10 @@ export interface TextProps extends OptionsControlProps {
|
|
124
130
|
lowerCase?: boolean; // 用户输入的字符自动转小写
|
125
131
|
upperCase?: boolean; // 用户输入的字符自动转大写
|
126
132
|
};
|
133
|
+
/** control节点的CSS类名 */
|
134
|
+
inputControlClassName?: string;
|
135
|
+
/** 原生input标签的CSS类名 */
|
136
|
+
nativeInputClassName?: string;
|
127
137
|
}
|
128
138
|
|
129
139
|
export interface TextState {
|
@@ -580,6 +590,8 @@ export default class TextControl extends React.PureComponent<
|
|
580
590
|
renderSugestMode() {
|
581
591
|
const {
|
582
592
|
className,
|
593
|
+
inputControlClassName,
|
594
|
+
nativeInputClassName,
|
583
595
|
inputOnly,
|
584
596
|
value,
|
585
597
|
placeholder,
|
@@ -652,6 +664,7 @@ export default class TextControl extends React.PureComponent<
|
|
652
664
|
<div
|
653
665
|
className={cx(
|
654
666
|
`TextControl-input TextControl-input--withAC`,
|
667
|
+
inputControlClassName,
|
655
668
|
inputOnly ? className : '',
|
656
669
|
{
|
657
670
|
'is-opened': isOpen,
|
@@ -705,6 +718,7 @@ export default class TextControl extends React.PureComponent<
|
|
705
718
|
})}
|
706
719
|
autoComplete="off"
|
707
720
|
size={10}
|
721
|
+
className={cx(nativeInputClassName)}
|
708
722
|
/>
|
709
723
|
</>
|
710
724
|
|
@@ -786,6 +800,8 @@ export default class TextControl extends React.PureComponent<
|
|
786
800
|
classPrefix: ns,
|
787
801
|
classnames: cx,
|
788
802
|
className,
|
803
|
+
inputControlClassName,
|
804
|
+
nativeInputClassName,
|
789
805
|
inputOnly,
|
790
806
|
value,
|
791
807
|
placeholder,
|
@@ -815,6 +831,7 @@ export default class TextControl extends React.PureComponent<
|
|
815
831
|
{
|
816
832
|
[`TextControl-input--border${ucFirst(borderMode)}`]: borderMode
|
817
833
|
},
|
834
|
+
inputControlClassName,
|
818
835
|
inputOnly ? className : ''
|
819
836
|
)}
|
820
837
|
>
|
@@ -839,11 +856,9 @@ export default class TextControl extends React.PureComponent<
|
|
839
856
|
step={step}
|
840
857
|
onChange={this.handleNormalInputChange}
|
841
858
|
value={this.valueToString(value)}
|
842
|
-
className={cx(
|
843
|
-
type === 'password' &&
|
844
|
-
|
845
|
-
'TextControl-input-password'
|
846
|
-
)}
|
859
|
+
className={cx(nativeInputClassName, {
|
860
|
+
'TextControl-input-password': type === 'password' && revealPassword
|
861
|
+
})}
|
847
862
|
/>
|
848
863
|
{clearable && !disabled && !readOnly && value ? (
|
849
864
|
<a onClick={this.clearValue} className={`${ns}TextControl-clear`}>
|
package/src/renderers/IFrame.tsx
CHANGED
@@ -29,6 +29,22 @@ export interface IFrameSchema extends BaseSchema {
|
|
29
29
|
|
30
30
|
width?: number | string;
|
31
31
|
height?: number | string;
|
32
|
+
|
33
|
+
alloow?: string;
|
34
|
+
|
35
|
+
name?: string;
|
36
|
+
|
37
|
+
referrerpolicy?:
|
38
|
+
| 'no-referrer'
|
39
|
+
| 'no-referrer-when-downgrade'
|
40
|
+
| 'origin'
|
41
|
+
| 'origin-when-cross-origin'
|
42
|
+
| 'same-origin'
|
43
|
+
| 'strict-origin'
|
44
|
+
| 'strict-origin-when-cross-origin'
|
45
|
+
| 'unsafe-url';
|
46
|
+
|
47
|
+
sandbox?: string;
|
32
48
|
}
|
33
49
|
|
34
50
|
export interface IFrameProps
|
@@ -145,7 +161,17 @@ export default class IFrame extends React.Component<IFrameProps, object> {
|
|
145
161
|
|
146
162
|
render() {
|
147
163
|
const {width, height} = this.state;
|
148
|
-
let {
|
164
|
+
let {
|
165
|
+
className,
|
166
|
+
src,
|
167
|
+
name,
|
168
|
+
frameBorder,
|
169
|
+
data,
|
170
|
+
style,
|
171
|
+
allow,
|
172
|
+
sandbox,
|
173
|
+
referrerpolicy
|
174
|
+
} = this.props;
|
149
175
|
|
150
176
|
let tempStyle: any = {};
|
151
177
|
|
@@ -178,6 +204,9 @@ export default class IFrame extends React.Component<IFrameProps, object> {
|
|
178
204
|
ref={this.IFrameRef}
|
179
205
|
onLoad={this.onLoad}
|
180
206
|
src={finalSrc}
|
207
|
+
allow={allow}
|
208
|
+
referrerPolicy={referrerpolicy}
|
209
|
+
sandbox={sandbox}
|
181
210
|
/>
|
182
211
|
);
|
183
212
|
}
|
@@ -1941,6 +1941,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1941
1941
|
column.pristine.className,
|
1942
1942
|
column.pristine.labelClassName
|
1943
1943
|
)}
|
1944
|
+
style={props.style}
|
1944
1945
|
>
|
1945
1946
|
{column.label ? render('tpl', column.label) : null}
|
1946
1947
|
|
@@ -1992,7 +1993,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1992
1993
|
classPrefix={ns}
|
1993
1994
|
type={multiple ? 'checkbox' : 'radio'}
|
1994
1995
|
checked={item.checked}
|
1995
|
-
disabled={item.checkdisable}
|
1996
|
+
disabled={item.checkdisable || !item.checkable}
|
1996
1997
|
onChange={
|
1997
1998
|
checkOnItemClick ? noop : this.handleCheck.bind(this, item)
|
1998
1999
|
}
|
package/src/renderers/Tag.tsx
CHANGED
@@ -88,6 +88,7 @@ export class TagField extends React.Component<TagProps, object> {
|
|
88
88
|
displayMode,
|
89
89
|
color,
|
90
90
|
className,
|
91
|
+
closable,
|
91
92
|
data,
|
92
93
|
style = {}
|
93
94
|
} = this.props;
|
@@ -114,6 +115,7 @@ export class TagField extends React.Component<TagProps, object> {
|
|
114
115
|
displayMode={displayMode}
|
115
116
|
color={color}
|
116
117
|
icon={icon}
|
118
|
+
closable={closable}
|
117
119
|
style={style}
|
118
120
|
>
|
119
121
|
{label}
|
package/src/renderers/Wizard.tsx
CHANGED
@@ -745,6 +745,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
|
|
745
745
|
};
|
746
746
|
},
|
747
747
|
onFailed: async (error: any) => {
|
748
|
+
store.markSaving(false);
|
748
749
|
const dispatcher = await this.dispatchEvent(
|
749
750
|
'submitFail',
|
750
751
|
createObject(this.props.data, {error})
|
@@ -805,7 +806,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
|
|
805
806
|
|
806
807
|
// 接管里面 form 的提交,不能直接让 form 提交,因为 wizard 自己需要知道进度。
|
807
808
|
@autobind
|
808
|
-
|
809
|
+
handleSubmit(values: object, action: Action) {
|
809
810
|
const {store, steps, finishedField} = this.props;
|
810
811
|
|
811
812
|
if (this.state.currentStep < steps.length) {
|
package/src/store/formItem.ts
CHANGED
@@ -457,7 +457,10 @@ export const FormItemStore = StoreNode.named('FormItemStore')
|
|
457
457
|
if (childFirst !== undefined) {
|
458
458
|
return childFirst;
|
459
459
|
}
|
460
|
-
} else if (
|
460
|
+
} else if (
|
461
|
+
option[self.valueField || 'value'] != null &&
|
462
|
+
!option.disabled
|
463
|
+
) {
|
461
464
|
return option;
|
462
465
|
}
|
463
466
|
}
|
package/src/utils/dom.tsx
CHANGED
@@ -95,11 +95,12 @@ export function calculatePosition(
|
|
95
95
|
|
96
96
|
const clip = container.getBoundingClientRect();
|
97
97
|
const clip2 = overlayNode.getBoundingClientRect();
|
98
|
+
// getBoundingClientRect 会返回长宽精确值,rem计算后可能会有小数 导致 scale 不正确,所以这里需要四舍五入取整
|
98
99
|
const scaleX = overlayNode.offsetWidth
|
99
|
-
? clip2.width / overlayNode.offsetWidth
|
100
|
+
? Math.round(clip2.width) / overlayNode.offsetWidth
|
100
101
|
: 1;
|
101
102
|
const scaleY = overlayNode.offsetHeight
|
102
|
-
? clip2.height / overlayNode.offsetHeight
|
103
|
+
? Math.round(clip2.height) / overlayNode.offsetHeight
|
103
104
|
: 1;
|
104
105
|
|
105
106
|
// auto 尝试四个方向对齐。
|