amis 1.8.0-beta.0 → 1.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/DatePicker.d.ts +3 -0
- package/lib/components/DatePicker.js +41 -7
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/Progress.js +12 -9
- package/lib/components/Progress.js.map +2 -2
- package/lib/components/calendar/Calendar.js +16 -12
- package/lib/components/calendar/Calendar.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +3 -1
- package/lib/components/formula/Editor.js +20 -2
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/Picker.d.ts +5 -0
- package/lib/components/formula/Picker.js +19 -4
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/factory.js +2 -2
- package/lib/factory.js.map +2 -2
- package/lib/index.js +1 -1
- package/lib/renderers/Dialog.d.ts +4 -0
- package/lib/renderers/Dialog.js +4 -3
- package/lib/renderers/Dialog.js.map +2 -2
- package/lib/renderers/DropDownButton.d.ts +2 -0
- package/lib/renderers/DropDownButton.js +13 -4
- package/lib/renderers/DropDownButton.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +4 -0
- package/lib/renderers/Form/InputFormula.js +2 -2
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- package/lib/renderers/Form/InputTable.js +4 -2
- package/lib/renderers/Form/InputTable.js.map +2 -2
- package/lib/renderers/Page.js +2 -3
- package/lib/renderers/Page.js.map +2 -2
- package/lib/renderers/Progress.d.ts +1 -1
- package/lib/renderers/Progress.js +1 -1
- package/lib/renderers/Progress.js.map +2 -2
- package/lib/renderers/Table/TableRow.js +1 -1
- package/lib/renderers/Table/TableRow.js.map +2 -2
- package/lib/store/table.js +2 -2
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +34 -7
- package/lib/themes/ang.css +34 -7
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +34 -7
- package/lib/themes/antd.css +34 -7
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +34 -7
- package/lib/themes/cxd.css +34 -7
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +34 -7
- package/lib/themes/dark.css +34 -7
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +34 -7
- package/lib/themes/default.css +34 -7
- package/lib/themes/default.css.map +1 -1
- package/package.json +1 -1
- package/schema.json +20 -8
- package/scss/components/_formula.scss +18 -0
- package/scss/components/_progress.scss +3 -8
- package/scss/components/form/_date.scss +13 -0
- package/sdk/ang-ie11.css +40 -8
- package/sdk/ang.css +40 -8
- package/sdk/antd-ie11.css +40 -8
- package/sdk/antd.css +40 -8
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +40 -8
- package/sdk/cxd.css +40 -8
- package/sdk/dark-ie11.css +40 -8
- package/sdk/dark.css +40 -8
- package/sdk/exceljs.js +1 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +17 -17
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +40 -8
- package/sdk/sdk.css +40 -8
- package/sdk/sdk.js +1248 -1248
- 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/DatePicker.tsx +56 -18
- package/src/components/Progress.tsx +8 -12
- package/src/components/calendar/Calendar.tsx +17 -12
- package/src/components/formula/Editor.tsx +34 -3
- package/src/components/formula/Picker.tsx +28 -1
- package/src/factory.tsx +2 -2
- package/src/renderers/Dialog.tsx +17 -3
- package/src/renderers/DropDownButton.tsx +14 -3
- package/src/renderers/Form/InputFormula.tsx +7 -0
- package/src/renderers/Form/InputTable.tsx +6 -2
- package/src/renderers/Page.tsx +1 -2
- package/src/renderers/Progress.tsx +2 -2
- package/src/renderers/Table/TableRow.tsx +1 -1
- package/src/store/table.ts +2 -2
@@ -17,6 +17,7 @@ import Calendar from './calendar/Calendar';
|
|
17
17
|
import {localeable, LocaleProps, TranslateFn} from '../locale';
|
18
18
|
import {isMobile, ucFirst} from '../utils/helper';
|
19
19
|
import CalendarMobile from './CalendarMobile';
|
20
|
+
import Input from './Input';
|
20
21
|
|
21
22
|
const availableShortcuts: {[propName: string]: any} = {
|
22
23
|
now: {
|
@@ -302,6 +303,7 @@ export interface DatePickerState {
|
|
302
303
|
isOpened: boolean;
|
303
304
|
isFocused: boolean;
|
304
305
|
value: moment.Moment | undefined;
|
306
|
+
inputValue: string | undefined; // 手动输入的值
|
305
307
|
}
|
306
308
|
|
307
309
|
function normalizeValue(value: any, format?: string) {
|
@@ -329,11 +331,15 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
329
331
|
state: DatePickerState = {
|
330
332
|
isOpened: false,
|
331
333
|
isFocused: false,
|
332
|
-
value: normalizeValue(this.props.value, this.props.format)
|
334
|
+
value: normalizeValue(this.props.value, this.props.format),
|
335
|
+
inputValue:
|
336
|
+
normalizeValue(this.props.value, this.props.format)?.format(
|
337
|
+
this.props.inputFormat
|
338
|
+
) || ''
|
333
339
|
};
|
334
340
|
constructor(props: DateProps) {
|
335
341
|
super(props);
|
336
|
-
|
342
|
+
this.inputRef = React.createRef();
|
337
343
|
this.handleChange = this.handleChange.bind(this);
|
338
344
|
this.selectRannge = this.selectRannge.bind(this);
|
339
345
|
this.checkIsValidDate = this.checkIsValidDate.bind(this);
|
@@ -348,10 +354,13 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
348
354
|
this.getTarget = this.getTarget.bind(this);
|
349
355
|
this.handlePopOverClick = this.handlePopOverClick.bind(this);
|
350
356
|
this.renderShortCuts = this.renderShortCuts.bind(this);
|
357
|
+
this.inputChange = this.inputChange.bind(this);
|
351
358
|
}
|
352
359
|
|
353
360
|
dom: HTMLDivElement;
|
354
361
|
|
362
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
363
|
+
|
355
364
|
componentDidUpdate(prevProps: DateProps) {
|
356
365
|
const props = this.props;
|
357
366
|
|
@@ -403,13 +412,17 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
403
412
|
}
|
404
413
|
|
405
414
|
open(fn?: () => void) {
|
406
|
-
this.props.disabled
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
415
|
+
if (this.props.disabled) {
|
416
|
+
return;
|
417
|
+
}
|
418
|
+
this.setState(
|
419
|
+
{
|
420
|
+
isOpened: true
|
421
|
+
},
|
422
|
+
fn
|
423
|
+
);
|
424
|
+
const input = this.inputRef.current;
|
425
|
+
input && input.focus();
|
413
426
|
}
|
414
427
|
|
415
428
|
close() {
|
@@ -423,6 +436,7 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
423
436
|
e.stopPropagation();
|
424
437
|
const onChange = this.props.onChange;
|
425
438
|
onChange('');
|
439
|
+
this.setState({inputValue: ''});
|
426
440
|
}
|
427
441
|
|
428
442
|
handleChange(value: moment.Moment) {
|
@@ -432,6 +446,7 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
432
446
|
minDate,
|
433
447
|
maxDate,
|
434
448
|
dateFormat,
|
449
|
+
inputFormat,
|
435
450
|
timeFormat,
|
436
451
|
closeOnSelect,
|
437
452
|
utc,
|
@@ -453,6 +468,31 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
453
468
|
if (closeOnSelect && dateFormat && !timeFormat) {
|
454
469
|
this.close();
|
455
470
|
}
|
471
|
+
|
472
|
+
this.setState({
|
473
|
+
inputValue: utc
|
474
|
+
? moment.utc(value).format(inputFormat)
|
475
|
+
: value.format(inputFormat)
|
476
|
+
});
|
477
|
+
}
|
478
|
+
|
479
|
+
// 手动输入日期
|
480
|
+
inputChange(e: React.ChangeEvent<HTMLInputElement>) {
|
481
|
+
const {onChange, inputFormat, format, utc} = this.props;
|
482
|
+
const value = e.currentTarget.value;
|
483
|
+
this.setState({inputValue: value});
|
484
|
+
if (value === '') {
|
485
|
+
onChange('');
|
486
|
+
} else {
|
487
|
+
const newDate = moment(value, inputFormat);
|
488
|
+
const dateValue = utc
|
489
|
+
? moment.utc(newDate).format(format)
|
490
|
+
: newDate.format(format);
|
491
|
+
// 小于 0 的日期丢弃
|
492
|
+
if (!dateValue.startsWith('-')) {
|
493
|
+
onChange(dateValue);
|
494
|
+
}
|
495
|
+
}
|
456
496
|
}
|
457
497
|
|
458
498
|
selectRannge(item: any) {
|
@@ -693,15 +733,13 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
|
693
733
|
ref={this.domRef}
|
694
734
|
onClick={this.handleClick}
|
695
735
|
>
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
</span>
|
704
|
-
)}
|
736
|
+
<Input
|
737
|
+
onChange={this.inputChange}
|
738
|
+
ref={this.inputRef}
|
739
|
+
placeholder={__(placeholder)}
|
740
|
+
autoComplete="off"
|
741
|
+
value={this.state.inputValue}
|
742
|
+
/>
|
705
743
|
|
706
744
|
{clearable && !disabled && normalizeValue(value, format) ? (
|
707
745
|
<a className={cx(`DatePicker-clear`)} onClick={this.clearValue}>
|
@@ -74,19 +74,15 @@ export class Progress extends React.Component<ProgressProps, Object> {
|
|
74
74
|
const isLineType = type === 'line';
|
75
75
|
const prefixCls = isLineType ? 'Progress-line' : 'Progress-circle';
|
76
76
|
|
77
|
-
let viewValue: React.ReactNode
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
let viewValue: React.ReactNode;
|
78
|
+
if (typeof value !== 'number') {
|
79
|
+
viewValue = <span className="text-muted">{placeholder}</span>;
|
80
|
+
} else if (type === 'line') {
|
81
|
+
const style: any = {};
|
82
|
+
strokeWidth && (style.height = strokeWidth);
|
82
83
|
viewValue = [
|
83
|
-
<div
|
84
|
-
|
85
|
-
className={cx(prefixCls, progressClassName, {
|
86
|
-
[`${prefixCls}-no-label`]: !showLabel
|
87
|
-
})}
|
88
|
-
>
|
89
|
-
<div className={cx(`${prefixCls}-inter`)}>
|
84
|
+
<div key="progress" className={cx(prefixCls, progressClassName)}>
|
85
|
+
<div className={cx(`${prefixCls}-inter`)} style={style}>
|
90
86
|
<div
|
91
87
|
className={cx(
|
92
88
|
`${prefixCls}-bar`,
|
@@ -161,18 +161,19 @@ class BaseDatePicker extends React.Component<
|
|
161
161
|
updatedState = this.getStateFromProps(props);
|
162
162
|
}
|
163
163
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
}
|
164
|
+
// open 是外部控制了
|
165
|
+
// if (updatedState.open === undefined) {
|
166
|
+
// if (typeof props.open !== 'undefined') {
|
167
|
+
// updatedState.open = props.open;
|
168
|
+
// } else if (
|
169
|
+
// prevProps.closeOnSelect &&
|
170
|
+
// this.state.currentView !== viewModes.TIME
|
171
|
+
// ) {
|
172
|
+
// updatedState.open = false;
|
173
|
+
// } else {
|
174
|
+
// updatedState.open = this.state.open;
|
175
|
+
// }
|
176
|
+
// }
|
176
177
|
|
177
178
|
if (props.viewMode !== prevProps.viewMode) {
|
178
179
|
updatedState.currentView = props.viewMode;
|
@@ -236,6 +237,10 @@ class BaseDatePicker extends React.Component<
|
|
236
237
|
updatedState.viewDate = moment(props.viewDate);
|
237
238
|
}
|
238
239
|
|
240
|
+
if (Object.keys(updatedState).length) {
|
241
|
+
this.setState(updatedState);
|
242
|
+
}
|
243
|
+
|
239
244
|
this.checkTZ(props);
|
240
245
|
}
|
241
246
|
|
@@ -10,7 +10,7 @@ import {FormulaPlugin, editorFactory} from './plugin';
|
|
10
10
|
import FuncList from './FuncList';
|
11
11
|
import {VariableList} from './VariableList';
|
12
12
|
import CodeMirrorEditor from '../CodeMirror';
|
13
|
-
import {autobind} from '../../utils/helper';
|
13
|
+
import {autobind, eachTree} from '../../utils/helper';
|
14
14
|
import {themeable, ThemeProps} from '../../theme';
|
15
15
|
import {localeable, LocaleProps} from '../../locale';
|
16
16
|
|
@@ -133,8 +133,39 @@ export class FormulaEditor extends React.Component<
|
|
133
133
|
variables: Array<VariableItem>,
|
134
134
|
functions: Array<FuncGroup>
|
135
135
|
) {
|
136
|
-
|
137
|
-
|
136
|
+
if (!Array.isArray(variables) || !variables.length || !value) {
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
|
140
|
+
const varMap: {
|
141
|
+
[propname: string]: string;
|
142
|
+
} = {};
|
143
|
+
|
144
|
+
eachTree(
|
145
|
+
variables,
|
146
|
+
item => item.value && (varMap[item.value] = item.label)
|
147
|
+
);
|
148
|
+
const vars = Object.keys(varMap).sort((a, b) => b.length - a.length);
|
149
|
+
let content = value || '';
|
150
|
+
|
151
|
+
// 标记方法调用
|
152
|
+
content = content.replace(/([A-Z]+)\s*\(/g, (_, func, pos) => {
|
153
|
+
return _?.replace(func, `<span class="c-func">${func}</span>`);
|
154
|
+
});
|
155
|
+
|
156
|
+
vars.forEach(v => {
|
157
|
+
let from = 0;
|
158
|
+
let idx = -1;
|
159
|
+
while (~(idx = content.indexOf(v, from))) {
|
160
|
+
content = content.replace(
|
161
|
+
v,
|
162
|
+
`<span class="c-field">${varMap[v]}</span>`
|
163
|
+
);
|
164
|
+
from = idx + v.length;
|
165
|
+
}
|
166
|
+
});
|
167
|
+
|
168
|
+
return {html: content};
|
138
169
|
}
|
139
170
|
|
140
171
|
componentWillUnmount() {
|
@@ -69,6 +69,11 @@ export interface FormulaPickerProps extends FormulaEditorProps {
|
|
69
69
|
*/
|
70
70
|
disabled?: boolean;
|
71
71
|
|
72
|
+
/**
|
73
|
+
* 是否允许输入,否需要点击fx在弹窗中输入
|
74
|
+
*/
|
75
|
+
allowInput?: boolean;
|
76
|
+
|
72
77
|
/**
|
73
78
|
* 占位文本
|
74
79
|
*/
|
@@ -96,12 +101,28 @@ export class FormulaPicker extends React.Component<FormulaPickerProps> {
|
|
96
101
|
this.props.onChange?.(value);
|
97
102
|
}
|
98
103
|
|
104
|
+
@autobind
|
105
|
+
renderFormulaValue(item: any) {
|
106
|
+
const {allowInput, classnames: cx} = this.props;
|
107
|
+
const html = {__html: item.html};
|
108
|
+
if (allowInput) {
|
109
|
+
return '';
|
110
|
+
}
|
111
|
+
return (
|
112
|
+
<div
|
113
|
+
className={cx('FormulaPicker-ResultBox')}
|
114
|
+
dangerouslySetInnerHTML={html}
|
115
|
+
></div>
|
116
|
+
);
|
117
|
+
}
|
118
|
+
|
99
119
|
render() {
|
100
120
|
let {
|
101
121
|
classnames: cx,
|
102
122
|
value,
|
103
123
|
translate: __,
|
104
124
|
disabled,
|
125
|
+
allowInput,
|
105
126
|
className,
|
106
127
|
onChange,
|
107
128
|
size,
|
@@ -186,9 +207,15 @@ export class FormulaPicker extends React.Component<FormulaPickerProps> {
|
|
186
207
|
'FormulaPicker-input',
|
187
208
|
isOpened ? 'is-active' : ''
|
188
209
|
)}
|
189
|
-
allowInput
|
210
|
+
allowInput={allowInput}
|
190
211
|
clearable={clearable}
|
191
212
|
value={value}
|
213
|
+
result={FormulaEditor.highlightValue(
|
214
|
+
value,
|
215
|
+
variables,
|
216
|
+
functions
|
217
|
+
)}
|
218
|
+
itemRender={this.renderFormulaValue}
|
192
219
|
onResultChange={noop}
|
193
220
|
onChange={this.handleConfirm}
|
194
221
|
disabled={disabled}
|
package/src/factory.tsx
CHANGED
@@ -518,13 +518,13 @@ export function render(
|
|
518
518
|
// 进行文本替换
|
519
519
|
if (env.replaceText && isObject(env.replaceText)) {
|
520
520
|
const replaceKeys = Object.keys(env.replaceText);
|
521
|
-
replaceKeys.sort().
|
521
|
+
replaceKeys.sort((a, b) => b.length - a.length); // 避免用户将短的放前面
|
522
522
|
const replaceTextIgnoreKeys = new Set(env.replaceTextIgnoreKeys || []);
|
523
523
|
JSONTraverse(schema, (value: any, key: string, object: any) => {
|
524
524
|
if (typeof value === 'string' && !replaceTextIgnoreKeys.has(key)) {
|
525
525
|
for (const replaceKey of replaceKeys) {
|
526
526
|
if (~value.indexOf(replaceKey)) {
|
527
|
-
object[key] = value.replaceAll(
|
527
|
+
value = object[key] = value.replaceAll(
|
528
528
|
replaceKey,
|
529
529
|
env.replaceText[replaceKey]
|
530
530
|
);
|
package/src/renderers/Dialog.tsx
CHANGED
@@ -90,6 +90,11 @@ export interface DialogSchema extends BaseSchema {
|
|
90
90
|
* 是否显示错误信息
|
91
91
|
*/
|
92
92
|
showErrorMsg?: boolean;
|
93
|
+
|
94
|
+
/**
|
95
|
+
* 是否显示 spinner
|
96
|
+
*/
|
97
|
+
showLoading?: boolean;
|
93
98
|
}
|
94
99
|
|
95
100
|
export type DialogSchemaBase = Omit<DialogSchema, 'type'>;
|
@@ -424,13 +429,22 @@ export default class Dialog extends React.Component<DialogProps> {
|
|
424
429
|
return null;
|
425
430
|
}
|
426
431
|
|
427
|
-
const {
|
432
|
+
const {
|
433
|
+
store,
|
434
|
+
render,
|
435
|
+
classnames: cx,
|
436
|
+
showErrorMsg,
|
437
|
+
showLoading
|
438
|
+
} = this.props;
|
428
439
|
|
429
440
|
return (
|
430
441
|
<div className={cx('Modal-footer')}>
|
431
|
-
{store.loading ||
|
442
|
+
{(showLoading !== false && store.loading) ||
|
443
|
+
(showErrorMsg !== false && store.error) ? (
|
432
444
|
<div className={cx('Dialog-info')} key="info">
|
433
|
-
|
445
|
+
{showLoading !== false ? (
|
446
|
+
<Spinner size="sm" key="info" show={store.loading} />
|
447
|
+
) : null}
|
434
448
|
{store.error && showErrorMsg !== false ? (
|
435
449
|
<span className={cx('Dialog-error')}>{store.msg}</span>
|
436
450
|
) : null}
|
@@ -147,12 +147,14 @@ export default class DropDownButton extends React.Component<
|
|
147
147
|
};
|
148
148
|
|
149
149
|
target: any;
|
150
|
+
timer: ReturnType<typeof setTimeout>;
|
150
151
|
constructor(props: DropDownButtonProps) {
|
151
152
|
super(props);
|
152
153
|
|
153
154
|
this.open = this.open.bind(this);
|
154
155
|
this.close = this.close.bind(this);
|
155
156
|
this.toogle = this.toogle.bind(this);
|
157
|
+
this.keepOpen = this.keepOpen.bind(this);
|
156
158
|
this.domRef = this.domRef.bind(this);
|
157
159
|
}
|
158
160
|
|
@@ -183,9 +185,17 @@ export default class DropDownButton extends React.Component<
|
|
183
185
|
}
|
184
186
|
|
185
187
|
close() {
|
186
|
-
this.
|
187
|
-
|
188
|
-
|
188
|
+
this.timer = setTimeout(() => {
|
189
|
+
this.setState({
|
190
|
+
isOpened: false
|
191
|
+
});
|
192
|
+
}, 200);
|
193
|
+
}
|
194
|
+
|
195
|
+
keepOpen() {
|
196
|
+
if (this.timer) {
|
197
|
+
clearTimeout(this.timer);
|
198
|
+
}
|
189
199
|
}
|
190
200
|
|
191
201
|
renderButton(
|
@@ -260,6 +270,7 @@ export default class DropDownButton extends React.Component<
|
|
260
270
|
menuClassName
|
261
271
|
)}
|
262
272
|
onClick={closeOnClick ? this.close : noop}
|
273
|
+
onMouseEnter={this.keepOpen}
|
263
274
|
ref={ref}
|
264
275
|
>
|
265
276
|
{children
|
@@ -55,6 +55,11 @@ export interface InputFormulaControlSchema extends FormBaseControl {
|
|
55
55
|
*/
|
56
56
|
inputMode?: 'button' | 'input-button';
|
57
57
|
|
58
|
+
/**
|
59
|
+
* 外层input是否允许输入,否需要点击fx在弹窗中输入
|
60
|
+
*/
|
61
|
+
allowInput?: boolean;
|
62
|
+
|
58
63
|
/**
|
59
64
|
* 按钮图标
|
60
65
|
*/
|
@@ -139,6 +144,7 @@ export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
|
139
144
|
className,
|
140
145
|
classPrefix: ns,
|
141
146
|
classnames: cx,
|
147
|
+
allowInput = true,
|
142
148
|
borderMode,
|
143
149
|
placeholder,
|
144
150
|
inputMode,
|
@@ -156,6 +162,7 @@ export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
|
156
162
|
className={className}
|
157
163
|
value={value}
|
158
164
|
disabled={disabled}
|
165
|
+
allowInput={allowInput}
|
159
166
|
onChange={onChange}
|
160
167
|
evalMode={evalMode}
|
161
168
|
variables={variables}
|
@@ -1082,7 +1082,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
|
1082
1082
|
prefixRow,
|
1083
1083
|
formInited,
|
1084
1084
|
perPage,
|
1085
|
-
classnames: cx
|
1085
|
+
classnames: cx,
|
1086
|
+
rowClassName,
|
1087
|
+
rowClassNameExpr
|
1086
1088
|
} = this.props;
|
1087
1089
|
|
1088
1090
|
if (formInited === false) {
|
@@ -1131,7 +1133,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
|
1131
1133
|
expandConfig,
|
1132
1134
|
canAccessSuperData,
|
1133
1135
|
reUseRow: false,
|
1134
|
-
offset
|
1136
|
+
offset,
|
1137
|
+
rowClassName,
|
1138
|
+
rowClassNameExpr
|
1135
1139
|
}
|
1136
1140
|
)}
|
1137
1141
|
{(addable && showAddBtn !== false) || showPager ? (
|
package/src/renderers/Page.tsx
CHANGED
@@ -853,7 +853,7 @@ export class PageRenderer extends Page {
|
|
853
853
|
throwErrors: boolean = false,
|
854
854
|
delegate?: IScopedContext
|
855
855
|
) {
|
856
|
-
const scoped = this.context as IScopedContext;
|
856
|
+
const scoped = delegate || (this.context as IScopedContext);
|
857
857
|
|
858
858
|
if (action.actionType === 'reload') {
|
859
859
|
action.target && scoped.reload(action.target, ctx);
|
@@ -877,7 +877,6 @@ export class PageRenderer extends Page {
|
|
877
877
|
action.reload &&
|
878
878
|
~['url', 'link', 'jump'].indexOf(action.actionType!)
|
879
879
|
) {
|
880
|
-
const scoped = delegate || (this.context as IScopedContext);
|
881
880
|
scoped.reload(action.reload, ctx);
|
882
881
|
}
|
883
882
|
}
|
@@ -59,7 +59,7 @@ export interface ProgressSchema extends BaseSchema {
|
|
59
59
|
animate?: boolean;
|
60
60
|
|
61
61
|
/**
|
62
|
-
*
|
62
|
+
* 进度条线的宽度
|
63
63
|
*/
|
64
64
|
strokeWidth?: number;
|
65
65
|
/**
|
@@ -95,7 +95,7 @@ export class ProgressField extends React.Component<ProgressProps, object> {
|
|
95
95
|
@autobind
|
96
96
|
format(value: number) {
|
97
97
|
const {valueTpl, render, data} = this.props;
|
98
|
-
return render(`progress-value`, valueTpl
|
98
|
+
return render(`progress-value`, valueTpl || '${value}%', {
|
99
99
|
data: createObject(data, {value})
|
100
100
|
});
|
101
101
|
}
|
@@ -195,7 +195,7 @@ export class TableRow extends React.Component<TableRowProps> {
|
|
195
195
|
'is-checked': item.checked,
|
196
196
|
'is-modified': item.modified,
|
197
197
|
'is-moved': item.moved,
|
198
|
-
'is-expanded': item.expanded,
|
198
|
+
'is-expanded': item.expanded && item.expandable,
|
199
199
|
'is-expandable': item.expandable,
|
200
200
|
[`Table-tr--hasItemAction`]: itemAction,
|
201
201
|
[`Table-tr--odd`]: itemIndex % 2 === 0,
|
package/src/store/table.ts
CHANGED
@@ -152,7 +152,7 @@ export const Row = types
|
|
152
152
|
},
|
153
153
|
|
154
154
|
get expanded(): boolean {
|
155
|
-
return !this.collapsed
|
155
|
+
return !this.collapsed;
|
156
156
|
},
|
157
157
|
|
158
158
|
get moved() {
|
@@ -904,7 +904,7 @@ export const TableStore = iRendererStore
|
|
904
904
|
return {
|
905
905
|
// id: String(item && (item as any)[self.primaryField] || `${pindex}-${depth}-${key}`),
|
906
906
|
id: String(id),
|
907
|
-
parentId,
|
907
|
+
parentId: String(parentId),
|
908
908
|
key: String(`${pindex}-${depth}-${index}`),
|
909
909
|
path: `${path}${index}`,
|
910
910
|
depth: depth,
|