amis 1.9.1-beta.12 → 1.9.1-beta.18
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/lib/components/Select.js +2 -2
- package/lib/components/Select.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +44 -40
- package/lib/components/formula/Editor.js +16 -5
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/Picker.d.ts +88 -41
- package/lib/components/formula/Picker.js +50 -24
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/components/table/HeadCellFilter.js +4 -1
- package/lib/components/table/HeadCellFilter.js.map +2 -2
- package/lib/components/table/HeadCellSort.js +30 -24
- package/lib/components/table/HeadCellSort.js.map +2 -2
- package/lib/components/table/index.d.ts +6 -3
- package/lib/components/table/index.js +72 -86
- package/lib/components/table/index.js.map +2 -2
- package/lib/index.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +21 -4
- package/lib/renderers/Action.js +44 -20
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/Breadcrumb.js +2 -2
- package/lib/renderers/Breadcrumb.js.map +2 -2
- package/lib/renderers/CRUD.js +3 -0
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +6 -2
- package/lib/renderers/Form/InputFormula.js +4 -3
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- package/lib/renderers/Form/InputTree.d.ts +4 -0
- package/lib/renderers/Form/InputTree.js +2 -2
- package/lib/renderers/Form/InputTree.js.map +2 -2
- package/lib/renderers/Form/Picker.d.ts +1 -1
- package/lib/renderers/Form/Picker.js +38 -23
- package/lib/renderers/Form/Picker.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +10 -10
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/Service.js +0 -1
- package/lib/renderers/Service.js.map +2 -2
- package/lib/renderers/Steps.d.ts +2 -2
- package/lib/renderers/Steps.js +1 -1
- package/lib/renderers/Steps.js.map +2 -2
- package/lib/renderers/Table/index.js +2 -1
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.d.ts +1 -1
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js +38 -24
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js.map +2 -2
- package/lib/renderers/Table-v2/index.d.ts +10 -4
- package/lib/renderers/Table-v2/index.js +109 -58
- package/lib/renderers/Table-v2/index.js.map +2 -2
- package/lib/renderers/Tabs.d.ts +6 -2
- package/lib/renderers/Tabs.js +21 -0
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/store/table-v2.d.ts +210 -4
- package/lib/store/table-v2.js +82 -5
- package/lib/store/table-v2.js.map +2 -2
- package/lib/themes/ang-ie11.css +59 -17
- package/lib/themes/ang.css +54 -12
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +59 -17
- package/lib/themes/antd.css +54 -12
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +210 -168
- package/lib/themes/cxd.css +55 -13
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +59 -17
- package/lib/themes/dark.css +54 -12
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +210 -168
- package/lib/themes/default.css +55 -13
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils/formula.js +4 -3
- package/lib/utils/formula.js.map +2 -2
- package/package.json +2 -2
- package/schema.json +22 -14
- package/scss/components/_formula.scss +45 -4
- package/scss/components/_modal.scss +1 -1
- package/scss/components/form/_checks.scss +47 -44
- package/scss/components/form/_icon-picker.scss +10 -6
- package/scss/components/form/_select.scss +3 -2
- package/scss/components/form/_switch.scss +1 -0
- package/scss/components/form/_text.scss +2 -0
- package/scss/themes/_cxd-variables.scss +1 -1
- package/sdk/ang-ie11.css +66 -17
- package/sdk/ang.css +61 -12
- package/sdk/antd-ie11.css +66 -17
- package/sdk/antd.css +61 -12
- 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 +217 -168
- package/sdk/cxd.css +62 -13
- package/sdk/dark-ie11.css +66 -17
- package/sdk/dark.css +61 -12
- 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 +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +217 -168
- package/sdk/sdk.css +62 -13
- package/sdk/sdk.js +1342 -1338
- 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/Select.tsx +3 -6
- package/src/components/formula/Editor.tsx +51 -23
- package/src/components/formula/Picker.tsx +68 -12
- package/src/components/table/HeadCellFilter.tsx +4 -1
- package/src/components/table/HeadCellSort.tsx +1 -1
- package/src/components/table/index.tsx +66 -90
- package/src/locale/zh-CN.ts +1 -1
- package/src/renderers/Action.tsx +64 -19
- package/src/renderers/Breadcrumb.tsx +11 -12
- package/src/renderers/CRUD.tsx +2 -0
- package/src/renderers/Form/InputFormula.tsx +11 -3
- package/src/renderers/Form/InputTree.tsx +7 -0
- package/src/renderers/Form/Picker.tsx +11 -1
- package/src/renderers/Form/wrapControl.tsx +10 -10
- package/src/renderers/Service.tsx +0 -1
- package/src/renderers/Steps.tsx +5 -5
- package/src/renderers/Table/index.tsx +9 -7
- package/src/renderers/Table-v2/HeadCellSearchDropdown.tsx +14 -9
- package/src/renderers/Table-v2/index.tsx +130 -58
- package/src/renderers/Tabs.tsx +33 -3
- package/src/store/table-v2.ts +104 -7
- package/src/types.ts +2 -1
- package/src/utils/formula.ts +5 -3
package/src/renderers/Action.tsx
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import hotkeys from 'hotkeys-js';
|
3
|
+
import omit from 'lodash/omit';
|
4
|
+
import pick from 'lodash/pick';
|
3
5
|
import {Renderer, RendererProps} from '../factory';
|
4
6
|
import {filter} from '../utils/tpl';
|
5
7
|
import Button from '../components/Button';
|
6
|
-
import
|
7
|
-
import
|
8
|
+
import {ScopedContext} from '../Scoped';
|
9
|
+
import {isObject} from '../utils/helper';
|
10
|
+
|
11
|
+
import type {IScopedContext} from '../Scoped';
|
12
|
+
import type {Action as ICmptAction} from '../types';
|
8
13
|
|
9
14
|
export interface ButtonSchema extends BaseSchema {
|
10
15
|
/**
|
@@ -407,7 +412,8 @@ const ActionProps = [
|
|
407
412
|
'copyFormat',
|
408
413
|
'payload',
|
409
414
|
'requireSelected',
|
410
|
-
'countDown'
|
415
|
+
'countDown',
|
416
|
+
'fileName'
|
411
417
|
];
|
412
418
|
import {filterContents} from './Remark';
|
413
419
|
import {ClassNamesFn, themeable, ThemeProps} from '../theme';
|
@@ -431,7 +437,6 @@ import {generateIcon} from '../utils/icon';
|
|
431
437
|
import {BadgeSchema, withBadge} from '../components/Badge';
|
432
438
|
import {normalizeApi, str2AsyncFunction} from '../utils/api';
|
433
439
|
import {TooltipWrapper} from '../components/TooltipWrapper';
|
434
|
-
import handleAction from '../utils/handleAction';
|
435
440
|
|
436
441
|
// 构造一个假的 React 事件避免可能的报错,主要用于快捷键功能
|
437
442
|
// 来自 https://stackoverflow.com/questions/27062455/reactjs-can-i-create-my-own-syntheticevent
|
@@ -851,28 +856,68 @@ export class Action extends React.Component<ActionProps, ActionState> {
|
|
851
856
|
|
852
857
|
export default themeable(Action);
|
853
858
|
|
859
|
+
export type ActionRendererProps = RendererProps &
|
860
|
+
Omit<ActionProps, 'onAction' | 'isCurrentUrl' | 'tooltipContainer'> & {
|
861
|
+
onAction: (
|
862
|
+
e: React.MouseEvent<any> | string | void | null,
|
863
|
+
action: object,
|
864
|
+
data: any
|
865
|
+
) => void;
|
866
|
+
btnDisabled?: boolean;
|
867
|
+
};
|
868
|
+
|
854
869
|
@Renderer({
|
855
870
|
type: 'action'
|
856
871
|
})
|
857
872
|
// @ts-ignore 类型没搞定
|
858
873
|
@withBadge
|
859
|
-
export class ActionRenderer extends React.Component<
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
874
|
+
export class ActionRenderer extends React.Component<ActionRendererProps> {
|
875
|
+
static contextType = ScopedContext;
|
876
|
+
|
877
|
+
constructor(props: ActionRendererProps, scoped: IScopedContext) {
|
878
|
+
super(props);
|
879
|
+
|
880
|
+
scoped.registerComponent(this);
|
881
|
+
}
|
882
|
+
|
883
|
+
componentWillUnmount() {
|
884
|
+
const scoped = this.context as IScopedContext;
|
885
|
+
scoped.unRegisterComponent(this);
|
886
|
+
}
|
887
|
+
|
888
|
+
/**
|
889
|
+
* 动作处理
|
890
|
+
*/
|
891
|
+
doAction(
|
892
|
+
action: ICmptAction,
|
893
|
+
args: {
|
894
|
+
value?: string | {[key: string]: string};
|
895
|
+
}
|
896
|
+
) {
|
897
|
+
const actionType = action?.actionType;
|
898
|
+
|
899
|
+
if (actionType === 'click') {
|
900
|
+
this.handleAction(actionType, action);
|
868
901
|
}
|
869
|
-
|
902
|
+
}
|
903
|
+
|
870
904
|
@autobind
|
871
|
-
async handleAction(
|
905
|
+
async handleAction(
|
906
|
+
e: React.MouseEvent<any> | string | void | null,
|
907
|
+
action: any
|
908
|
+
) {
|
872
909
|
const {env, onAction, data, ignoreConfirm, dispatchEvent} = this.props;
|
910
|
+
let mergedData = data;
|
911
|
+
|
912
|
+
if (action?.actionType === 'click' && isObject(action?.args)) {
|
913
|
+
mergedData = createObject(data, action.args);
|
914
|
+
}
|
873
915
|
|
874
916
|
// 触发渲染器事件
|
875
|
-
const rendererEvent = await dispatchEvent(
|
917
|
+
const rendererEvent = await dispatchEvent(
|
918
|
+
e as React.MouseEvent<any> | string,
|
919
|
+
mergedData
|
920
|
+
);
|
876
921
|
|
877
922
|
// 阻止原有动作执行
|
878
923
|
if (rendererEvent?.prevented) {
|
@@ -880,14 +925,14 @@ export class ActionRenderer extends React.Component<
|
|
880
925
|
}
|
881
926
|
|
882
927
|
if (!ignoreConfirm && action.confirmText && env.confirm) {
|
883
|
-
let confirmed = await env.confirm(filter(action.confirmText,
|
928
|
+
let confirmed = await env.confirm(filter(action.confirmText, mergedData));
|
884
929
|
if (confirmed) {
|
885
|
-
await onAction(e, action,
|
930
|
+
await onAction(e, action, mergedData);
|
886
931
|
} else if (action.countDown) {
|
887
932
|
throw new Error('cancel');
|
888
933
|
}
|
889
934
|
} else {
|
890
|
-
await onAction(e, action,
|
935
|
+
await onAction(e, action, mergedData);
|
891
936
|
}
|
892
937
|
}
|
893
938
|
|
@@ -56,7 +56,7 @@ export type ItemPlace = 'start' | 'middle' | 'end';
|
|
56
56
|
* 文档:https://baidu.gitee.io/amis/docs/components/breadcrumb
|
57
57
|
*/
|
58
58
|
|
59
|
-
|
59
|
+
export interface BreadcrumbSchema extends BaseSchema {
|
60
60
|
/**
|
61
61
|
* 指定为面包屑显示控件
|
62
62
|
*/
|
@@ -103,18 +103,13 @@ export type ItemPlace = 'start' | 'middle' | 'end';
|
|
103
103
|
tooltipPosition?: TooltipPositionType;
|
104
104
|
}
|
105
105
|
|
106
|
-
export interface BreadcrumbProps
|
107
|
-
|
106
|
+
export interface BreadcrumbProps
|
107
|
+
extends RendererProps,
|
108
|
+
Omit<BreadcrumbSchema, 'type' | 'className'> {}
|
108
109
|
|
109
110
|
export class BreadcrumbField extends React.Component<BreadcrumbProps, object> {
|
110
111
|
render() {
|
111
|
-
const {
|
112
|
-
items,
|
113
|
-
source,
|
114
|
-
data,
|
115
|
-
env,
|
116
|
-
...restProps
|
117
|
-
} = this.props;
|
112
|
+
const {items, source, data, env, ...restProps} = this.props;
|
118
113
|
|
119
114
|
let crumbItems = items
|
120
115
|
? items
|
@@ -128,7 +123,7 @@ export class BreadcrumbField extends React.Component<BreadcrumbProps, object> {
|
|
128
123
|
item.label = filter(item.label, data);
|
129
124
|
}
|
130
125
|
if (item.href) {
|
131
|
-
item.href =
|
126
|
+
item.href = resolveVariableAndFilter(item.href, data, '| raw');
|
132
127
|
}
|
133
128
|
if (item.dropdown) {
|
134
129
|
item.dropdown = item.dropdown.map(dropdownItem => {
|
@@ -136,7 +131,11 @@ export class BreadcrumbField extends React.Component<BreadcrumbProps, object> {
|
|
136
131
|
dropdownItem.label = filter(dropdownItem.label, data);
|
137
132
|
}
|
138
133
|
if (dropdownItem.href) {
|
139
|
-
dropdownItem.href =
|
134
|
+
dropdownItem.href = resolveVariableAndFilter(
|
135
|
+
dropdownItem.href,
|
136
|
+
data,
|
137
|
+
'| raw'
|
138
|
+
);
|
140
139
|
}
|
141
140
|
return dropdownItem;
|
142
141
|
});
|
package/src/renderers/CRUD.tsx
CHANGED
@@ -670,6 +670,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
670
670
|
throw e;
|
671
671
|
}
|
672
672
|
});
|
673
|
+
} else if (action.actionType === 'reload' && !action.target) {
|
674
|
+
this.reload();
|
673
675
|
} else if (
|
674
676
|
pickerMode &&
|
675
677
|
(action.actionType === 'confirm' || action.actionType === 'submit')
|
@@ -54,7 +54,7 @@ export interface InputFormulaControlSchema extends FormBaseControl {
|
|
54
54
|
/**
|
55
55
|
* 控件模式
|
56
56
|
*/
|
57
|
-
inputMode?: 'button' | 'input-button';
|
57
|
+
inputMode?: 'button' | 'input-button' | 'input-group';
|
58
58
|
|
59
59
|
/**
|
60
60
|
* 外层input是否允许输入,否需要点击fx在弹窗中输入
|
@@ -94,6 +94,11 @@ export interface InputFormulaControlSchema extends FormBaseControl {
|
|
94
94
|
*/
|
95
95
|
borderMode?: 'full' | 'half' | 'none';
|
96
96
|
|
97
|
+
/**
|
98
|
+
* 只展示变量,不需要其他面板
|
99
|
+
*/
|
100
|
+
onlyVariable?: boolean;
|
101
|
+
|
97
102
|
/**
|
98
103
|
* 输入框占位符
|
99
104
|
*/
|
@@ -123,11 +128,12 @@ export interface InputFormulaProps
|
|
123
128
|
export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
124
129
|
static defaultProps: Pick<
|
125
130
|
InputFormulaControlSchema,
|
126
|
-
'inputMode' | 'borderMode' | 'evalMode'
|
131
|
+
'inputMode' | 'borderMode' | 'evalMode' | 'onlyVariable'
|
127
132
|
> = {
|
128
133
|
inputMode: 'input-button',
|
129
134
|
borderMode: 'full',
|
130
|
-
evalMode: true
|
135
|
+
evalMode: true,
|
136
|
+
onlyVariable: false
|
131
137
|
};
|
132
138
|
|
133
139
|
ref: any;
|
@@ -162,6 +168,7 @@ export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
|
162
168
|
onChange,
|
163
169
|
evalMode,
|
164
170
|
variableMode,
|
171
|
+
onlyVariable,
|
165
172
|
header,
|
166
173
|
label,
|
167
174
|
value,
|
@@ -206,6 +213,7 @@ export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
|
206
213
|
evalMode={evalMode}
|
207
214
|
variables={variables}
|
208
215
|
variableMode={variableMode}
|
216
|
+
onlyVariable={onlyVariable}
|
209
217
|
functions={functions}
|
210
218
|
header={header || label || ''}
|
211
219
|
borderMode={borderMode}
|
@@ -62,6 +62,11 @@ export interface TreeControlSchema extends FormOptionsControl {
|
|
62
62
|
*/
|
63
63
|
onlyChildren?: boolean;
|
64
64
|
|
65
|
+
/**
|
66
|
+
* 单选时,只运行选择叶子节点
|
67
|
+
*/
|
68
|
+
onlyLeaf?: boolean;
|
69
|
+
|
65
70
|
/**
|
66
71
|
* 顶级节点是否可以创建子节点
|
67
72
|
*/
|
@@ -174,6 +179,7 @@ export default class TreeControl extends React.Component<TreeProps> {
|
|
174
179
|
unfoldedLevel,
|
175
180
|
withChildren,
|
176
181
|
onlyChildren,
|
182
|
+
onlyLeaf,
|
177
183
|
loading,
|
178
184
|
hideRoot,
|
179
185
|
rootLabel,
|
@@ -228,6 +234,7 @@ export default class TreeControl extends React.Component<TreeProps> {
|
|
228
234
|
unfoldedLevel={unfoldedLevel}
|
229
235
|
withChildren={withChildren}
|
230
236
|
onlyChildren={onlyChildren}
|
237
|
+
onlyLeaf={onlyLeaf}
|
231
238
|
hideRoot={hideRoot}
|
232
239
|
rootLabel={__(rootLabel)}
|
233
240
|
rootValue={rootValue}
|
@@ -247,7 +247,7 @@ export default class PickerControl extends React.PureComponent<
|
|
247
247
|
}
|
248
248
|
|
249
249
|
@autobind
|
250
|
-
handleChange(items: Array<any>) {
|
250
|
+
async handleChange(items: Array<any>) {
|
251
251
|
const {
|
252
252
|
joinValues,
|
253
253
|
valueField,
|
@@ -255,6 +255,8 @@ export default class PickerControl extends React.PureComponent<
|
|
255
255
|
extractValue,
|
256
256
|
multiple,
|
257
257
|
options,
|
258
|
+
data,
|
259
|
+
dispatchEvent,
|
258
260
|
setOptions,
|
259
261
|
onChange
|
260
262
|
} = this.props;
|
@@ -286,6 +288,14 @@ export default class PickerControl extends React.PureComponent<
|
|
286
288
|
});
|
287
289
|
|
288
290
|
additionalOptions.length && setOptions(options.concat(additionalOptions));
|
291
|
+
const rendererEvent = await dispatchEvent(
|
292
|
+
'change',
|
293
|
+
createObject(data, {value, option: items[0]})
|
294
|
+
);
|
295
|
+
if (rendererEvent?.prevented) {
|
296
|
+
return;
|
297
|
+
}
|
298
|
+
|
289
299
|
onChange(value);
|
290
300
|
}
|
291
301
|
|
@@ -327,7 +327,7 @@ export function wrapControl<
|
|
327
327
|
// 此处需要同时考虑 defaultValue 和 value
|
328
328
|
if (model && typeof props.value !== 'undefined') {
|
329
329
|
// 渲染器中的 value 优先
|
330
|
-
if (props.value
|
330
|
+
if (!isEqual(props.value, prevProps.value) && !isEqual(props.value, model.tmpValue)) {
|
331
331
|
// 外部直接传入的 value 无需执行运算器
|
332
332
|
model.changeTmpValue(props.value);
|
333
333
|
}
|
@@ -338,7 +338,7 @@ export function wrapControl<
|
|
338
338
|
) {
|
339
339
|
// 渲染器中的 defaultValue 优先(备注: SchemaRenderer中会将 value 改成 defaultValue)
|
340
340
|
if (
|
341
|
-
props.defaultValue
|
341
|
+
!isEqual(props.defaultValue, prevProps.defaultValue) ||
|
342
342
|
(!isEqual(props.data, prevProps.data) &&
|
343
343
|
isNeedFormula(props.defaultValue, props.data, prevProps.data))
|
344
344
|
) {
|
@@ -350,7 +350,7 @@ export function wrapControl<
|
|
350
350
|
prevProps.defaultValue,
|
351
351
|
prevProps.data
|
352
352
|
);
|
353
|
-
if (curResult
|
353
|
+
if (!isEqual(curResult, prevResult) && !isEqual(curResult, model.tmpValue)) {
|
354
354
|
// 识别上下文变动、自身数值变动、公式运算结果变动
|
355
355
|
model.changeTmpValue(curResult);
|
356
356
|
if (props.onChange) {
|
@@ -363,29 +363,29 @@ export function wrapControl<
|
|
363
363
|
|
364
364
|
if (
|
365
365
|
valueByName !== undefined &&
|
366
|
-
props.defaultValue
|
366
|
+
isEqual(props.defaultValue, prevProps.defaultValue)
|
367
367
|
) {
|
368
368
|
// value 非公式表达式时,name 值优先,若 defaultValue 主动变动时,则使用 defaultValue
|
369
369
|
if (
|
370
370
|
// 然后才是查看关联的 name 属性值是否变化
|
371
|
-
props.data
|
372
|
-
(!model.emitedValue || model.emitedValue
|
371
|
+
!isEqual(props.data, prevProps.data) &&
|
372
|
+
(!model.emitedValue || isEqual(model.emitedValue, model.tmpValue))
|
373
373
|
) {
|
374
374
|
model.changeEmitedValue(undefined);
|
375
375
|
const prevValueByName = getVariable(props.data, model.name);
|
376
376
|
if (
|
377
|
-
(valueByName
|
377
|
+
(!isEqual(valueByName, prevValueByName) ||
|
378
378
|
getVariable(props.data, model.name, false) !==
|
379
379
|
getVariable(prevProps.data, model.name, false)) &&
|
380
|
-
|
380
|
+
!isEqual(valueByName, model.tmpValue)
|
381
381
|
) {
|
382
382
|
model.changeTmpValue(valueByName);
|
383
383
|
}
|
384
384
|
}
|
385
385
|
} else if (
|
386
386
|
typeof props.defaultValue !== 'undefined' &&
|
387
|
-
props.defaultValue
|
388
|
-
props.defaultValue
|
387
|
+
!isEqual(props.defaultValue, prevProps.defaultValue) &&
|
388
|
+
!isEqual(props.defaultValue, model.tmpValue)
|
389
389
|
) {
|
390
390
|
// 组件默认值非公式
|
391
391
|
const curValue = replaceExpression(props.defaultValue);
|
package/src/renderers/Steps.tsx
CHANGED
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
RemoteOptionsProps,
|
7
7
|
withRemoteConfig
|
8
8
|
} from '../components/WithRemoteConfig';
|
9
|
-
import {resolveVariable} from '../utils/tpl-builtin';
|
9
|
+
import {resolveVariable, resolveVariableAndFilter} from '../utils/tpl-builtin';
|
10
10
|
import {filter} from '../utils/tpl';
|
11
11
|
import {getPropValue} from '../utils/helper';
|
12
12
|
|
@@ -74,12 +74,12 @@ export interface StepsSchema extends BaseSchema {
|
|
74
74
|
/**
|
75
75
|
* 标签放置位置
|
76
76
|
*/
|
77
|
-
|
77
|
+
labelPlacement?: 'horizontal' | 'vertical';
|
78
78
|
|
79
|
-
|
79
|
+
/**
|
80
80
|
* 点状步骤条
|
81
81
|
*/
|
82
|
-
|
82
|
+
progressDot?: boolean;
|
83
83
|
}
|
84
84
|
|
85
85
|
export interface StepsProps
|
@@ -102,7 +102,7 @@ export function StepsCmpt(props: StepsProps) {
|
|
102
102
|
} = props;
|
103
103
|
|
104
104
|
const stepsRow =
|
105
|
-
(
|
105
|
+
(resolveVariableAndFilter(source, data, '| raw') as Array<StepSchema>) ||
|
106
106
|
config ||
|
107
107
|
steps ||
|
108
108
|
[];
|
@@ -972,10 +972,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
972
972
|
return;
|
973
973
|
}
|
974
974
|
|
975
|
-
onSaveOrder(
|
976
|
-
movedItems,
|
977
|
-
items
|
978
|
-
);
|
975
|
+
onSaveOrder(movedItems, items);
|
979
976
|
}
|
980
977
|
|
981
978
|
syncSelected() {
|
@@ -2300,7 +2297,10 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2300
2297
|
onClick={async () => {
|
2301
2298
|
const {data, dispatchEvent} = this.props;
|
2302
2299
|
|
2303
|
-
const allToggled = !(
|
2300
|
+
const allToggled = !(
|
2301
|
+
store.activeToggaleColumns.length ===
|
2302
|
+
store.toggableColumns.length
|
2303
|
+
);
|
2304
2304
|
const rendererEvent = await dispatchEvent(
|
2305
2305
|
'columnToggled',
|
2306
2306
|
createObject(data, {
|
@@ -2341,9 +2341,11 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2341
2341
|
key={column.index}
|
2342
2342
|
onClick={async () => {
|
2343
2343
|
const {data, dispatchEvent} = this.props;
|
2344
|
-
let columns = store.activeToggaleColumns.map(
|
2344
|
+
let columns = store.activeToggaleColumns.map(
|
2345
|
+
item => item.pristine
|
2346
|
+
);
|
2345
2347
|
if (!column.toggled) {
|
2346
|
-
columns.push(column.pristine)
|
2348
|
+
columns.push(column.pristine);
|
2347
2349
|
} else {
|
2348
2350
|
columns = columns.filter(c => c.name !== column.pristine.name);
|
2349
2351
|
}
|
@@ -143,8 +143,8 @@ export class HeadCellSearchDropDown extends React.Component<
|
|
143
143
|
return schema || 'error';
|
144
144
|
}
|
145
145
|
|
146
|
-
handleAction(e: any, action: Action, ctx: object, confirm: Function) {
|
147
|
-
const {onAction} = this.props;
|
146
|
+
async handleAction(e: any, action: Action, ctx: object, confirm: Function) {
|
147
|
+
const {onAction, data, dispatchEvent, name} = this.props;
|
148
148
|
|
149
149
|
if (action.actionType === 'cancel' || action.actionType === 'close') {
|
150
150
|
confirm();
|
@@ -157,17 +157,14 @@ export class HeadCellSearchDropDown extends React.Component<
|
|
157
157
|
return;
|
158
158
|
}
|
159
159
|
|
160
|
-
onAction && onAction(e, action, ctx);
|
161
|
-
}
|
162
|
-
|
163
|
-
async handleReset() {
|
164
|
-
const {onSearch, data, name, store, dispatchEvent} = this.props;
|
165
160
|
const values = {...data};
|
161
|
+
this.formItems.forEach(key => setVariable(values, key, undefined));
|
166
162
|
|
167
163
|
const rendererEvent = await dispatchEvent(
|
168
164
|
'columnSearch',
|
169
165
|
createObject(data, {
|
170
|
-
|
166
|
+
searchName: name,
|
167
|
+
searchValue: values
|
171
168
|
})
|
172
169
|
);
|
173
170
|
|
@@ -175,6 +172,13 @@ export class HeadCellSearchDropDown extends React.Component<
|
|
175
172
|
return;
|
176
173
|
}
|
177
174
|
|
175
|
+
onAction && onAction(e, action, ctx);
|
176
|
+
}
|
177
|
+
|
178
|
+
async handleReset() {
|
179
|
+
const {onSearch, data, name, store} = this.props;
|
180
|
+
const values = {...data};
|
181
|
+
|
178
182
|
this.formItems.forEach(key => setVariable(values, key, undefined));
|
179
183
|
|
180
184
|
if (values.orderBy === name) {
|
@@ -200,7 +204,8 @@ export class HeadCellSearchDropDown extends React.Component<
|
|
200
204
|
const rendererEvent = await dispatchEvent(
|
201
205
|
'columnSearch',
|
202
206
|
createObject(data, {
|
203
|
-
|
207
|
+
searchName: name,
|
208
|
+
searchValue: values
|
204
209
|
})
|
205
210
|
);
|
206
211
|
|