amis 1.9.0-beta.12 → 1.9.0-beta.15
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/Schema.d.ts +4 -2
- package/lib/Schema.js.map +1 -1
- package/lib/SchemaRenderer.d.ts +2 -2
- package/lib/SchemaRenderer.js +3 -3
- package/lib/SchemaRenderer.js.map +2 -2
- package/lib/actions/Action.d.ts +8 -6
- package/lib/actions/Action.js.map +2 -2
- package/lib/actions/AjaxAction.d.ts +10 -7
- package/lib/actions/AjaxAction.js +27 -21
- package/lib/actions/AjaxAction.js.map +2 -2
- package/lib/actions/BreakAction.d.ts +2 -2
- package/lib/actions/BreakAction.js.map +1 -1
- package/lib/actions/BroadcastAction.d.ts +3 -3
- package/lib/actions/BroadcastAction.js +3 -2
- package/lib/actions/BroadcastAction.js.map +2 -2
- package/lib/actions/CmptAction.d.ts +2 -2
- package/lib/actions/CmptAction.js +7 -9
- package/lib/actions/CmptAction.js.map +2 -2
- package/lib/actions/ContinueAction.d.ts +2 -2
- package/lib/actions/ContinueAction.js.map +1 -1
- package/lib/actions/CopyAction.d.ts +7 -4
- package/lib/actions/CopyAction.js +8 -6
- package/lib/actions/CopyAction.js.map +2 -2
- package/lib/actions/CustomAction.d.ts +2 -2
- package/lib/actions/CustomAction.js.map +1 -1
- package/lib/actions/DialogAction.d.ts +14 -8
- package/lib/actions/DialogAction.js +6 -6
- package/lib/actions/DialogAction.js.map +2 -2
- package/lib/actions/DrawerAction.d.ts +3 -3
- package/lib/actions/DrawerAction.js.map +1 -1
- package/lib/actions/EmailAction.d.ts +10 -7
- package/lib/actions/EmailAction.js +4 -5
- package/lib/actions/EmailAction.js.map +2 -2
- package/lib/actions/LinkAction.d.ts +19 -11
- package/lib/actions/LinkAction.js +6 -5
- package/lib/actions/LinkAction.js.map +2 -2
- package/lib/actions/LoopAction.d.ts +6 -3
- package/lib/actions/LoopAction.js +22 -20
- package/lib/actions/LoopAction.js.map +2 -2
- package/lib/actions/PageAction.d.ts +8 -5
- package/lib/actions/PageAction.js +3 -2
- package/lib/actions/PageAction.js.map +2 -2
- package/lib/actions/ParallelAction.d.ts +2 -2
- package/lib/actions/ParallelAction.js.map +1 -1
- package/lib/actions/SwitchAction.d.ts +2 -2
- package/lib/actions/SwitchAction.js.map +1 -1
- package/lib/actions/ToastAction.d.ts +2 -2
- package/lib/actions/ToastAction.js +6 -4
- package/lib/actions/ToastAction.js.map +2 -2
- package/lib/components/Editor.d.ts +84 -84
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Pagination.d.ts +1175 -0
- package/lib/components/Pagination.js +274 -0
- package/lib/components/Pagination.js.map +13 -0
- package/lib/components/PickerContainer.d.ts +1 -0
- package/lib/components/PickerContainer.js +3 -2
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/Rating.js +11 -9
- package/lib/components/Rating.js.map +2 -2
- package/lib/components/Select.js +3 -3
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Tag.d.ts +148 -0
- package/lib/components/Tag.js +96 -0
- package/lib/components/Tag.js.map +13 -0
- package/lib/components/TooltipWrapper.d.ts +25 -21
- package/lib/components/TooltipWrapper.js +11 -1
- package/lib/components/TooltipWrapper.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +85 -84
- package/lib/components/TransferDropDown.js +2 -2
- package/lib/components/TransferDropDown.js.map +2 -2
- package/lib/components/Tree.d.ts +84 -84
- package/lib/components/formula/VariableList.d.ts +1 -0
- package/lib/components/formula/VariableList.js.map +2 -2
- package/lib/components/icons.js +2 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +4 -1
- package/lib/components/index.js +7 -1
- package/lib/components/index.js.map +2 -2
- package/lib/components/schema-editor/Array.d.ts +11 -0
- package/lib/components/schema-editor/Array.js +66 -0
- package/lib/components/schema-editor/Array.js.map +13 -0
- package/lib/components/schema-editor/Common.d.ts +29 -0
- package/lib/components/schema-editor/Common.js +69 -0
- package/lib/components/schema-editor/Common.js.map +13 -0
- package/lib/components/schema-editor/Item.d.ts +9 -0
- package/lib/components/schema-editor/Item.js +31 -0
- package/lib/components/schema-editor/Item.js.map +13 -0
- package/lib/components/schema-editor/Object.d.ts +44 -0
- package/lib/components/schema-editor/Object.js +191 -0
- package/lib/components/schema-editor/Object.js.map +13 -0
- package/lib/components/schema-editor/SchemaVariableList.d.ts +316 -0
- package/lib/components/schema-editor/SchemaVariableList.js +74 -0
- package/lib/components/schema-editor/SchemaVariableList.js.map +13 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +305 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js +32 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js.map +13 -0
- package/lib/components/schema-editor/index.d.ts +520 -0
- package/lib/components/schema-editor/index.js +118 -0
- package/lib/components/schema-editor/index.js.map +13 -0
- package/lib/components/table/Cell.d.ts +930 -0
- package/lib/components/table/Cell.js +36 -0
- package/lib/components/table/Cell.js.map +13 -0
- package/lib/components/table/HeadCellDropDown.d.ts +514 -0
- package/lib/components/table/HeadCellDropDown.js +52 -0
- package/lib/components/table/HeadCellDropDown.js.map +13 -0
- package/lib/components/table/HeadCellFilter.d.ts +771 -0
- package/lib/components/table/HeadCellFilter.js +106 -0
- package/lib/components/table/HeadCellFilter.js.map +13 -0
- package/lib/components/table/HeadCellSelect.d.ts +672 -0
- package/lib/components/table/HeadCellSelect.js +46 -0
- package/lib/components/table/HeadCellSelect.js.map +13 -0
- package/lib/components/table/HeadCellSort.d.ts +498 -0
- package/lib/components/table/HeadCellSort.js +67 -0
- package/lib/components/table/HeadCellSort.js.map +13 -0
- package/lib/components/table/index.d.ts +1355 -0
- package/lib/components/table/index.js +1095 -0
- package/lib/components/table/index.js.map +13 -0
- package/lib/env.d.ts +2 -4
- package/lib/env.js.map +2 -2
- package/lib/factory.js +0 -95
- package/lib/factory.js.map +2 -2
- package/lib/icons/dot.js +11 -0
- package/lib/index.d.ts +6 -1
- package/lib/index.js +9 -2
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +18 -1
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +18 -1
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +20 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.js +0 -2
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/Carousel.d.ts +5 -1
- package/lib/renderers/Carousel.js +18 -5
- package/lib/renderers/Carousel.js.map +2 -2
- package/lib/renderers/Form/ButtonGroupSelect.d.ts +2 -0
- package/lib/renderers/Form/ButtonGroupSelect.js +7 -0
- package/lib/renderers/Form/ButtonGroupSelect.js.map +2 -2
- package/lib/renderers/Form/Checkbox.js +3 -4
- package/lib/renderers/Form/Checkbox.js.map +2 -2
- package/lib/renderers/Form/Checkboxes.d.ts +2 -1
- package/lib/renderers/Form/Checkboxes.js +19 -14
- package/lib/renderers/Form/Checkboxes.js.map +2 -2
- package/lib/renderers/Form/Combo.js +23 -4
- package/lib/renderers/Form/Combo.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +126 -18
- package/lib/renderers/Form/Editor.d.ts +412 -112
- package/lib/renderers/Form/Editor.js +10 -1
- package/lib/renderers/Form/Editor.js.map +2 -2
- package/lib/renderers/Form/InputExcel.js +6 -1
- package/lib/renderers/Form/InputExcel.js.map +2 -2
- package/lib/renderers/Form/InputFile.js +1 -2
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputTree.js +1 -1
- package/lib/renderers/Form/InputTree.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +0 -6
- package/lib/renderers/Form/JSONSchemaEditor.d.ts +41 -0
- package/lib/renderers/Form/JSONSchemaEditor.js +33 -0
- package/lib/renderers/Form/JSONSchemaEditor.js.map +13 -0
- package/lib/renderers/Form/ListSelect.d.ts +2 -0
- package/lib/renderers/Form/ListSelect.js +7 -0
- package/lib/renderers/Form/ListSelect.js.map +2 -2
- package/lib/renderers/Form/Options.js +1 -0
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Select.js +12 -1
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TabsTransfer.d.ts +1 -1
- package/lib/renderers/Form/TabsTransfer.js +2 -2
- package/lib/renderers/Form/TabsTransfer.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +4 -0
- package/lib/renderers/Form/TreeSelect.js +2 -2
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +10 -5
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/Pagination.d.ts +49 -30
- package/lib/renderers/Pagination.js +3 -132
- package/lib/renderers/Pagination.js.map +2 -2
- package/lib/renderers/Table/HeadCellSearchDropdown.js +0 -1
- package/lib/renderers/Table/HeadCellSearchDropdown.js.map +2 -2
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.d.ts +29 -0
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js +158 -0
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js.map +13 -0
- package/lib/renderers/Table-v2/TableCell.d.ts +6 -0
- package/lib/renderers/Table-v2/TableCell.js +28 -0
- package/lib/renderers/Table-v2/TableCell.js.map +13 -0
- package/lib/renderers/Table-v2/index.d.ts +256 -0
- package/lib/renderers/Table-v2/index.js +548 -0
- package/lib/renderers/Table-v2/index.js.map +13 -0
- package/lib/renderers/Tabs.js +1 -1
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/renderers/Tag.d.ts +66 -0
- package/lib/renderers/Tag.js +53 -0
- package/lib/renderers/Tag.js.map +13 -0
- package/lib/renderers/Wizard.js +3 -3
- package/lib/renderers/Wizard.js.map +2 -2
- package/lib/schemaExtend.js +24 -30
- package/lib/schemaExtend.js.map +2 -2
- package/lib/store/combo.d.ts +140 -20
- package/lib/store/form.d.ts +56 -8
- package/lib/store/formItem.d.ts +3 -1
- package/lib/store/formItem.js +3 -1
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/index.js +2 -0
- package/lib/store/index.js.map +2 -2
- package/lib/store/table-v2.d.ts +308 -0
- package/lib/store/table-v2.js +452 -0
- package/lib/store/table-v2.js.map +13 -0
- package/lib/store/table.d.ts +112 -16
- package/lib/store/table.js +1 -1
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +1686 -120
- package/lib/themes/ang.css +1807 -208
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +1667 -101
- package/lib/themes/antd.css +1789 -201
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +1662 -97
- package/lib/themes/cxd.css +1983 -394
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +1667 -101
- package/lib/themes/dark.css +1789 -201
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +1662 -97
- package/lib/themes/default.css +1983 -394
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/DataSchema.d.ts +25 -0
- package/lib/utils/DataSchema.js +104 -0
- package/lib/utils/DataSchema.js.map +13 -0
- package/lib/utils/DataScope.d.ts +23 -0
- package/lib/utils/DataScope.js +140 -0
- package/lib/utils/DataScope.js.map +13 -0
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/handleAction.js.map +2 -2
- package/lib/utils/renderer-event.d.ts +8 -2
- package/lib/utils/renderer-event.js +102 -1
- package/lib/utils/renderer-event.js.map +2 -2
- package/package.json +3 -2
- package/schema.json +1476 -469
- package/scss/_properties.scss +69 -0
- package/scss/components/_button.scss +37 -39
- package/scss/components/_context-menu.scss +3 -18
- package/scss/components/_json-schema-editor.scss +126 -0
- package/scss/components/_pagination.scss +104 -23
- package/scss/components/_result-box.scss +2 -2
- package/scss/components/_table-v2.scss +912 -0
- package/scss/components/_tag.scss +177 -0
- package/scss/components/form/_selection.scss +1 -14
- package/scss/components/form/_text.scss +1 -1
- package/scss/themes/_antd-variables.scss +0 -13
- package/scss/themes/_common.scss +3 -0
- package/scss/themes/_cxd-variables.scss +7 -17
- package/scss/themes/_dark-variables.scss +0 -13
- package/scss/themes/cxd.scss +1 -1
- package/sdk/ang-ie11.css +2240 -227
- package/sdk/ang.css +2905 -859
- package/sdk/antd-ie11.css +2233 -220
- package/sdk/antd.css +2905 -870
- 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 +2223 -211
- package/sdk/cxd.css +2911 -875
- package/sdk/dark-ie11.css +2233 -220
- package/sdk/dark.css +2905 -870
- package/sdk/exceljs.js +1 -1
- package/sdk/locale/de-DE.js +18 -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 +2223 -211
- package/sdk/sdk.css +2911 -875
- package/sdk/sdk.js +1326 -1270
- 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/Schema.ts +7 -0
- package/src/SchemaRenderer.tsx +4 -5
- package/src/actions/Action.ts +7 -6
- package/src/actions/AjaxAction.ts +33 -24
- package/src/actions/BreakAction.ts +2 -2
- package/src/actions/BroadcastAction.ts +6 -5
- package/src/actions/CmptAction.ts +5 -6
- package/src/actions/ContinueAction.ts +2 -2
- package/src/actions/CopyAction.ts +14 -8
- package/src/actions/CustomAction.ts +2 -2
- package/src/actions/DialogAction.ts +16 -10
- package/src/actions/DrawerAction.ts +3 -3
- package/src/actions/EmailAction.ts +12 -12
- package/src/actions/LinkAction.ts +34 -14
- package/src/actions/LoopAction.ts +13 -8
- package/src/actions/PageAction.ts +9 -6
- package/src/actions/ParallelAction.ts +2 -2
- package/src/actions/SwitchAction.ts +2 -2
- package/src/actions/ToastAction.ts +9 -5
- package/src/components/InputBox.tsx +1 -0
- package/src/components/Pagination.tsx +446 -0
- package/src/components/PickerContainer.tsx +8 -5
- package/src/components/Rating.tsx +16 -9
- package/src/components/Select.tsx +3 -3
- package/src/components/Tag.tsx +179 -0
- package/src/components/TooltipWrapper.tsx +14 -1
- package/src/components/TransferDropDown.tsx +3 -0
- package/src/components/formula/VariableList.tsx +1 -0
- package/src/components/icons.tsx +2 -0
- package/src/components/index.tsx +7 -1
- package/src/components/schema-editor/Array.tsx +95 -0
- package/src/components/schema-editor/Common.tsx +138 -0
- package/src/components/schema-editor/Item.tsx +36 -0
- package/src/components/schema-editor/Object.tsx +299 -0
- package/src/components/schema-editor/SchemaVariableList.tsx +97 -0
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +66 -0
- package/src/components/schema-editor/index.tsx +211 -0
- package/src/components/table/Cell.tsx +70 -0
- package/src/components/table/HeadCellDropDown.tsx +115 -0
- package/src/components/table/HeadCellFilter.tsx +193 -0
- package/src/components/table/HeadCellSelect.tsx +86 -0
- package/src/components/table/HeadCellSort.tsx +102 -0
- package/src/components/table/index.tsx +1681 -0
- package/src/env.tsx +7 -14
- package/src/factory.tsx +3 -106
- package/src/icons/dot.svg +11 -0
- package/src/index.tsx +8 -1
- package/src/locale/de-DE.ts +18 -1
- package/src/locale/en-US.ts +18 -1
- package/src/locale/zh-CN.ts +20 -1
- package/src/renderers/Action.tsx +1 -1
- package/src/renderers/Carousel.tsx +21 -6
- package/src/renderers/Form/ButtonGroupSelect.tsx +10 -1
- package/src/renderers/Form/Checkbox.tsx +4 -4
- package/src/renderers/Form/Checkboxes.tsx +31 -25
- package/src/renderers/Form/Combo.tsx +20 -4
- package/src/renderers/Form/Editor.tsx +15 -1
- package/src/renderers/Form/InputExcel.tsx +6 -1
- package/src/renderers/Form/InputFile.tsx +1 -2
- package/src/renderers/Form/InputTree.tsx +1 -1
- package/src/renderers/Form/JSONSchemaEditor.tsx +67 -0
- package/src/renderers/Form/ListSelect.tsx +9 -1
- package/src/renderers/Form/Options.tsx +1 -1
- package/src/renderers/Form/Select.tsx +7 -0
- package/src/renderers/Form/TabsTransfer.tsx +2 -2
- package/src/renderers/Form/TreeSelect.tsx +8 -1
- package/src/renderers/Form/wrapControl.tsx +11 -5
- package/src/renderers/Pagination.tsx +65 -253
- package/src/renderers/Table/HeadCellSearchDropdown.tsx +0 -1
- package/src/renderers/Table-v2/HeadCellSearchDropdown.tsx +244 -0
- package/src/renderers/Table-v2/TableCell.tsx +19 -0
- package/src/renderers/Table-v2/index.tsx +1140 -0
- package/src/renderers/Tabs.tsx +1 -1
- package/src/renderers/Tag.tsx +128 -0
- package/src/renderers/Wizard.tsx +3 -3
- package/src/schemaExtend.ts +24 -28
- package/src/store/formItem.ts +5 -1
- package/src/store/index.ts +2 -0
- package/src/store/table-v2.ts +646 -0
- package/src/store/table.ts +1 -1
- package/src/utils/DataSchema.ts +131 -0
- package/src/utils/DataScope.ts +190 -0
- package/src/utils/handleAction.ts +1 -1
- package/src/utils/renderer-event.ts +113 -2
@@ -122,7 +122,7 @@ export default class TreeControl extends React.Component<TreeProps> {
|
|
122
122
|
onChange && onChange(resetValue ?? '');
|
123
123
|
}
|
124
124
|
if (action.actionType === 'expand') {
|
125
|
-
this.treeRef.syncUnFolded(this.props, action.openLevel);
|
125
|
+
this.treeRef.syncUnFolded(this.props, action.args.openLevel);
|
126
126
|
}
|
127
127
|
if (action.actionType === 'collapse') {
|
128
128
|
this.treeRef.syncUnFolded(this.props, 0);
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import {FormItem, FormControlProps, FormBaseControl} from './Item';
|
3
|
+
import JSONSchemaEditor from '../../components/schema-editor/index';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* JSON Schema Editor
|
7
|
+
* 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema-editor
|
8
|
+
*/
|
9
|
+
export interface JSONSchemaEditorControlSchema extends FormBaseControl {
|
10
|
+
/**
|
11
|
+
* 指定为 JSON Schema Editor
|
12
|
+
*/
|
13
|
+
type: 'json-schema-editor';
|
14
|
+
|
15
|
+
/**
|
16
|
+
* 可以理解为类型模板,方便快速定义复杂类型
|
17
|
+
*/
|
18
|
+
definitions?: {
|
19
|
+
[propName: string]: {
|
20
|
+
title: string;
|
21
|
+
type:
|
22
|
+
| 'string'
|
23
|
+
| 'number'
|
24
|
+
| 'interger'
|
25
|
+
| 'object'
|
26
|
+
| 'array'
|
27
|
+
| 'boolean'
|
28
|
+
| 'null';
|
29
|
+
[propName: string]: any;
|
30
|
+
};
|
31
|
+
};
|
32
|
+
|
33
|
+
/**
|
34
|
+
* 顶层是否允许修改类型
|
35
|
+
*/
|
36
|
+
rootTypeMutable?: boolean;
|
37
|
+
|
38
|
+
/**
|
39
|
+
* 顶层类型信息是否隐藏
|
40
|
+
*/
|
41
|
+
showRootInfo?: boolean;
|
42
|
+
|
43
|
+
/**
|
44
|
+
* 禁用类型,默认禁用了 null 类型
|
45
|
+
*/
|
46
|
+
disabledTypes?: Array<string>;
|
47
|
+
}
|
48
|
+
|
49
|
+
export interface JSONSchemaEditorProps
|
50
|
+
extends FormControlProps,
|
51
|
+
Omit<
|
52
|
+
JSONSchemaEditorControlSchema,
|
53
|
+
'type' | 'className' | 'descriptionClassName' | 'inputClassName'
|
54
|
+
> {}
|
55
|
+
|
56
|
+
export default class JSONSchemaEditorControl extends React.PureComponent<JSONSchemaEditorProps> {
|
57
|
+
render() {
|
58
|
+
const {...rest} = this.props;
|
59
|
+
|
60
|
+
return <JSONSchemaEditor {...rest} />;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
@FormItem({
|
65
|
+
type: 'json-schema-editor'
|
66
|
+
})
|
67
|
+
export class JSONSchemaEditorRenderer extends JSONSchemaEditorControl {}
|
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
Option,
|
6
6
|
FormOptionsControl
|
7
7
|
} from './Options';
|
8
|
-
import {Schema} from '../../types';
|
8
|
+
import {Action, Schema} from '../../types';
|
9
9
|
import {createObject, isEmpty} from '../../utils/helper';
|
10
10
|
import {dataMapping} from '../../utils/tpl-builtin';
|
11
11
|
import {SchemaClassName, SchemaCollection} from '../../Schema';
|
@@ -58,6 +58,14 @@ export default class ListControl extends React.Component<ListProps, any> {
|
|
58
58
|
submitOnDBClick: false
|
59
59
|
};
|
60
60
|
|
61
|
+
doAction(action: Action, data: object, throwErrors: boolean) {
|
62
|
+
const {resetValue, onChange} = this.props;
|
63
|
+
const actionType = action?.actionType as string;
|
64
|
+
if (!!~['clear', 'reset'].indexOf(actionType)) {
|
65
|
+
onChange(resetValue ?? '');
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
61
69
|
handleDBClick(option: Option, e: React.MouseEvent<HTMLElement>) {
|
62
70
|
this.props.onToggle(option, false, true);
|
63
71
|
this.props.onAction(null, {
|
@@ -471,7 +471,7 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
471
471
|
doAction(action: Action, data: object, throwErrors: boolean) {
|
472
472
|
const {resetValue, onChange} = this.props;
|
473
473
|
const actionType = action?.actionType as string;
|
474
|
-
|
474
|
+
debugger;
|
475
475
|
if (!!~['clear', 'reset'].indexOf(actionType)) {
|
476
476
|
onChange(resetValue ?? '');
|
477
477
|
}
|
@@ -438,6 +438,12 @@ export interface TransferDropDownProps
|
|
438
438
|
}
|
439
439
|
|
440
440
|
class TransferDropdownRenderer extends BaseTransferRenderer<TransferDropDownProps> {
|
441
|
+
@autobind
|
442
|
+
renderItem(item: Option): any {
|
443
|
+
const {labelField} = this.props;
|
444
|
+
return `${item.scopeLabel || ''}${item[labelField || 'label']}`;
|
445
|
+
}
|
446
|
+
|
441
447
|
render() {
|
442
448
|
const {
|
443
449
|
className,
|
@@ -488,6 +494,7 @@ class TransferDropdownRenderer extends BaseTransferRenderer<TransferDropDownProp
|
|
488
494
|
options={options}
|
489
495
|
onChange={this.handleChange}
|
490
496
|
option2value={this.option2value}
|
497
|
+
itemRender={this.renderItem}
|
491
498
|
sortable={sortable}
|
492
499
|
searchResultMode={searchResultMode}
|
493
500
|
onSearch={searchable ? this.handleSearch : undefined}
|
@@ -249,9 +249,9 @@ export class TabsTransferRenderer extends BaseTabsTransferRenderer<TabsTransferP
|
|
249
249
|
}
|
250
250
|
|
251
251
|
// 动作
|
252
|
-
doAction(action: Action) {
|
252
|
+
doAction(action: Action, args: any) {
|
253
253
|
const {resetValue, onChange} = this.props;
|
254
|
-
const activeKey =
|
254
|
+
const activeKey = args?.activeKey as number;
|
255
255
|
switch (action.actionType) {
|
256
256
|
case 'clear':
|
257
257
|
onChange('');
|
@@ -94,6 +94,11 @@ export interface TreeSelectControlSchema extends FormOptionsControl {
|
|
94
94
|
* 开启节点路径模式后,节点路径的分隔符
|
95
95
|
*/
|
96
96
|
pathSeparator?: string;
|
97
|
+
|
98
|
+
/**
|
99
|
+
* 是否显示展开线
|
100
|
+
*/
|
101
|
+
showOutline?: boolean;
|
97
102
|
}
|
98
103
|
|
99
104
|
export interface TreeSelectProps extends OptionsControlProps {
|
@@ -536,7 +541,8 @@ export default class TreeSelectControl extends React.Component<
|
|
536
541
|
translate: __,
|
537
542
|
deferLoad,
|
538
543
|
expandTreeOptions,
|
539
|
-
selfDisabledAffectChildren
|
544
|
+
selfDisabledAffectChildren,
|
545
|
+
showOutline
|
540
546
|
} = this.props;
|
541
547
|
|
542
548
|
let filtedOptions =
|
@@ -568,6 +574,7 @@ export default class TreeSelectControl extends React.Component<
|
|
568
574
|
rootValue={rootValue}
|
569
575
|
showIcon={showIcon}
|
570
576
|
showRadio={showRadio}
|
577
|
+
showOutline={showOutline}
|
571
578
|
cascade={cascade}
|
572
579
|
foldedField="collapsed"
|
573
580
|
hideRoot
|
@@ -133,7 +133,8 @@ export function wrapControl<
|
|
133
133
|
validateApi,
|
134
134
|
minLength,
|
135
135
|
maxLength,
|
136
|
-
validateOnChange
|
136
|
+
validateOnChange,
|
137
|
+
label
|
137
138
|
}
|
138
139
|
} = this.props;
|
139
140
|
|
@@ -179,7 +180,8 @@ export function wrapControl<
|
|
179
180
|
validateApi,
|
180
181
|
minLength,
|
181
182
|
maxLength,
|
182
|
-
validateOnChange
|
183
|
+
validateOnChange,
|
184
|
+
label
|
183
185
|
});
|
184
186
|
|
185
187
|
// issue 这个逻辑应该在 combo 里面自己实现。
|
@@ -267,7 +269,10 @@ export function wrapControl<
|
|
267
269
|
'selectFirst',
|
268
270
|
'autoFill',
|
269
271
|
'clearValueOnHidden',
|
270
|
-
'validateApi'
|
272
|
+
'validateApi',
|
273
|
+
'minLength',
|
274
|
+
'maxLength',
|
275
|
+
'label'
|
271
276
|
],
|
272
277
|
prevProps.$schema,
|
273
278
|
props.$schema
|
@@ -290,8 +295,9 @@ export function wrapControl<
|
|
290
295
|
autoFill: props.$schema.autoFill,
|
291
296
|
clearValueOnHidden: props.$schema.clearValueOnHidden,
|
292
297
|
validateApi: props.$schema.validateApi,
|
293
|
-
minLength: props.minLength,
|
294
|
-
maxLength: props.maxLength
|
298
|
+
minLength: props.$schema.minLength,
|
299
|
+
maxLength: props.$schema.maxLength,
|
300
|
+
label: props.$schema.label
|
295
301
|
});
|
296
302
|
}
|
297
303
|
|
@@ -1,23 +1,20 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import {Renderer, RendererProps} from '../factory';
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
3
|
+
import {BaseSchema} from '../Schema';
|
4
|
+
import {
|
5
|
+
MODE_TYPE,
|
6
|
+
PaginationState as BasicPaginationState,
|
7
|
+
Pagination as BasicPagination
|
8
|
+
} from '../components/Pagination';
|
6
9
|
|
7
10
|
export interface PaginationSchema extends BaseSchema {
|
8
11
|
type: 'pagination';
|
9
12
|
|
10
|
-
className?: SchemaClassName;
|
11
|
-
|
12
13
|
/**
|
13
|
-
*
|
14
|
+
* 通过控制layout属性的顺序,调整分页结构 total,perPage,pager,go
|
15
|
+
* @default 'pager'
|
14
16
|
*/
|
15
|
-
|
16
|
-
|
17
|
-
/**
|
18
|
-
* 模式,默认显示多个分页数字,如果只想简单显示可以配置成 `simple`。
|
19
|
-
*/
|
20
|
-
mode?: 'simple' | 'normal';
|
17
|
+
layout?: string | Array<string>;
|
21
18
|
|
22
19
|
/**
|
23
20
|
* 最多显示多少个分页按钮。
|
@@ -25,268 +22,83 @@ export interface PaginationSchema extends BaseSchema {
|
|
25
22
|
* @default 5
|
26
23
|
*/
|
27
24
|
maxButtons?: number;
|
28
|
-
}
|
29
|
-
|
30
|
-
export interface PaginationProps
|
31
|
-
extends RendererProps,
|
32
|
-
Omit<PaginationSchema, 'type' | 'className'> {
|
33
|
-
activePage: number;
|
34
|
-
lastPage: number;
|
35
|
-
hasNext: boolean;
|
36
|
-
maxButtons: number;
|
37
|
-
onPageChange: (page: number, perPage?: number) => void;
|
38
|
-
}
|
39
|
-
|
40
|
-
export interface PaginationState {
|
41
|
-
pageNum: string;
|
42
|
-
}
|
43
|
-
|
44
|
-
export default class Pagination extends React.Component<
|
45
|
-
PaginationProps,
|
46
|
-
PaginationState
|
47
|
-
> {
|
48
|
-
static defaultProps = {
|
49
|
-
activePage: 1,
|
50
|
-
lastPage: 1,
|
51
|
-
maxButtons: 5,
|
52
|
-
mode: 'normal',
|
53
|
-
hasNext: false,
|
54
|
-
showPageInput: false
|
55
|
-
};
|
56
25
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
const props = prevProps;
|
63
|
-
if (prevProps.activePage !== props.activePage) {
|
64
|
-
this.setState({
|
65
|
-
pageNum: String(props.activePage) || ''
|
66
|
-
});
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
renderSimple() {
|
71
|
-
const {activePage, hasNext, onPageChange, classnames: cx} = this.props;
|
72
|
-
|
73
|
-
return (
|
74
|
-
<ul className={cx('Pagination', 'Pagination--sm')}>
|
75
|
-
<li
|
76
|
-
className={cx({
|
77
|
-
'is-disabled': activePage < 2
|
78
|
-
})}
|
79
|
-
onClick={
|
80
|
-
activePage < 2
|
81
|
-
? e => e.preventDefault()
|
82
|
-
: () => onPageChange(activePage - 1)
|
83
|
-
}
|
84
|
-
>
|
85
|
-
<a>
|
86
|
-
<Icon icon="left-arrow" className="icon" />
|
87
|
-
</a>
|
88
|
-
</li>
|
89
|
-
<li
|
90
|
-
className={cx({
|
91
|
-
'is-disabled': !hasNext
|
92
|
-
})}
|
93
|
-
onClick={
|
94
|
-
!hasNext
|
95
|
-
? e => e.preventDefault()
|
96
|
-
: () => onPageChange(activePage + 1)
|
97
|
-
}
|
98
|
-
>
|
99
|
-
<a>
|
100
|
-
<Icon icon="right-arrow" className="icon" />
|
101
|
-
</a>
|
102
|
-
</li>
|
103
|
-
</ul>
|
104
|
-
);
|
105
|
-
}
|
106
|
-
|
107
|
-
@autobind
|
108
|
-
handlePageChange(e: React.ChangeEvent<any>) {
|
109
|
-
const {lastPage} = this.props;
|
110
|
-
let value = e.currentTarget.value;
|
111
|
-
|
112
|
-
if (/^\d+$/.test(value) && parseInt(value, 10) > lastPage) {
|
113
|
-
value = String(lastPage);
|
114
|
-
}
|
26
|
+
/**
|
27
|
+
* 模式,默认normal,如果只想简单显示可以配置成 `simple`。
|
28
|
+
* @default 'normal'
|
29
|
+
*/
|
30
|
+
mode?: MODE_TYPE;
|
115
31
|
|
116
|
-
|
117
|
-
|
32
|
+
/**
|
33
|
+
* 当前页数
|
34
|
+
*/
|
35
|
+
activePage: number;
|
118
36
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
maxButtons,
|
124
|
-
onPageChange,
|
125
|
-
classnames: cx,
|
126
|
-
showPageInput,
|
127
|
-
className,
|
128
|
-
translate: __
|
129
|
-
} = this.props;
|
130
|
-
const pageNum = this.state.pageNum;
|
37
|
+
/**
|
38
|
+
* 总条数
|
39
|
+
*/
|
40
|
+
total?: number;
|
131
41
|
|
132
|
-
|
133
|
-
|
134
|
-
|
42
|
+
/**
|
43
|
+
* 最后一页,总页数(如果传入了total,会重新计算lastPage)
|
44
|
+
*/
|
45
|
+
lastPage?: number;
|
135
46
|
|
136
|
-
|
137
|
-
|
138
|
-
|
47
|
+
/**
|
48
|
+
* 每页显示条数
|
49
|
+
* @default 10
|
50
|
+
*/
|
51
|
+
perPage?: number;
|
139
52
|
|
140
|
-
|
141
|
-
|
142
|
-
|
53
|
+
/**
|
54
|
+
* 是否展示分页切换,也同时受layout控制
|
55
|
+
* @default false
|
56
|
+
*/
|
57
|
+
showPerPage?: boolean;
|
143
58
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
),
|
150
|
-
1
|
151
|
-
);
|
152
|
-
endPage = startPage + maxButtons - 1;
|
153
|
-
} else {
|
154
|
-
startPage = 1;
|
155
|
-
endPage = lastPage;
|
156
|
-
}
|
59
|
+
/**
|
60
|
+
* 指定每页可以显示多少条
|
61
|
+
* @default [10, 20, 50, 100]
|
62
|
+
*/
|
63
|
+
perPageAvailable?: Array<number>;
|
157
64
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
className={cx({
|
164
|
-
'is-active': page === activePage
|
165
|
-
})}
|
166
|
-
>
|
167
|
-
<a role="button">{page}</a>
|
168
|
-
</li>
|
169
|
-
);
|
170
|
-
}
|
65
|
+
/**
|
66
|
+
* 是否显示快速跳转输入框
|
67
|
+
* @default false
|
68
|
+
*/
|
69
|
+
showPageInput?: boolean;
|
171
70
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
</li>
|
178
|
-
);
|
179
|
-
}
|
71
|
+
/**
|
72
|
+
* 是否禁用
|
73
|
+
* @default false
|
74
|
+
*/
|
75
|
+
disabled?: boolean;
|
180
76
|
|
181
|
-
pageButtons.unshift(
|
182
|
-
<li
|
183
|
-
onClick={() => onPageChange(1)}
|
184
|
-
key={1}
|
185
|
-
className={cx({
|
186
|
-
'is-active': 1 === activePage
|
187
|
-
})}
|
188
|
-
>
|
189
|
-
<a role="button">{1}</a>
|
190
|
-
</li>
|
191
|
-
);
|
192
|
-
}
|
193
77
|
|
194
|
-
|
195
|
-
|
196
|
-
pageButtons.push(
|
197
|
-
<li
|
198
|
-
className={cx('Pagination-ellipsis')}
|
199
|
-
onClick={() => onPageChange(endPage + 1)}
|
200
|
-
key="next-ellipsis"
|
201
|
-
>
|
202
|
-
<a role="button">
|
203
|
-
<span>...</span>
|
204
|
-
</a>
|
205
|
-
</li>
|
206
|
-
);
|
207
|
-
}
|
78
|
+
hasNext?: boolean;
|
79
|
+
}
|
208
80
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
className={cx({
|
214
|
-
'is-active': lastPage === activePage
|
215
|
-
})}
|
216
|
-
>
|
217
|
-
<a role="button">{lastPage}</a>
|
218
|
-
</li>
|
219
|
-
);
|
220
|
-
}
|
81
|
+
export interface PaginationProps
|
82
|
+
extends RendererProps,
|
83
|
+
Omit<PaginationSchema, 'type' | 'className'> {
|
84
|
+
}
|
221
85
|
|
222
|
-
|
223
|
-
<li
|
224
|
-
className={cx('Pagination-prev', {
|
225
|
-
'is-disabled': activePage === 1
|
226
|
-
})}
|
227
|
-
onClick={
|
228
|
-
activePage === 1
|
229
|
-
? (e: any) => e.preventDefault()
|
230
|
-
: () => onPageChange(activePage - 1)
|
231
|
-
}
|
232
|
-
key="prev"
|
233
|
-
>
|
234
|
-
<span>
|
235
|
-
<Icon icon="left-arrow" className="icon" />
|
236
|
-
</span>
|
237
|
-
</li>
|
238
|
-
);
|
86
|
+
export interface PaginationState extends BasicPaginationState{}
|
239
87
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
})}
|
245
|
-
onClick={
|
246
|
-
activePage === lastPage
|
247
|
-
? (e: any) => e.preventDefault()
|
248
|
-
: () => onPageChange(activePage + 1)
|
249
|
-
}
|
250
|
-
key="next"
|
251
|
-
>
|
252
|
-
<span>
|
253
|
-
<Icon icon="right-arrow" className="icon" />
|
254
|
-
</span>
|
255
|
-
</li>
|
256
|
-
);
|
88
|
+
export default class Pagination extends React.Component<
|
89
|
+
PaginationProps,
|
90
|
+
PaginationState
|
91
|
+
> {
|
257
92
|
|
93
|
+
render() {
|
258
94
|
return (
|
259
|
-
<
|
260
|
-
<ul className={cx('Pagination', 'Pagination--sm')}>{pageButtons}</ul>
|
261
|
-
|
262
|
-
{showPageInput === true || lastPage > 9 ? (
|
263
|
-
<div className={cx('Pagination-inputGroup')} key="toPage">
|
264
|
-
{__('CRUD.paginationGoText')}
|
265
|
-
<input
|
266
|
-
type="text"
|
267
|
-
onChange={this.handlePageChange}
|
268
|
-
onKeyUp={(e: any) =>
|
269
|
-
e.keyCode == 13 &&
|
270
|
-
onPageChange(parseInt(e.currentTarget.value, 10))
|
271
|
-
}
|
272
|
-
value={pageNum}
|
273
|
-
/>
|
274
|
-
{__('CRUD.paginationPageText')}
|
275
|
-
</div>
|
276
|
-
) : null}
|
277
|
-
</div>
|
95
|
+
<BasicPagination {...this.props} />
|
278
96
|
);
|
279
97
|
}
|
280
|
-
|
281
|
-
render() {
|
282
|
-
const {mode} = this.props;
|
283
|
-
|
284
|
-
return mode === 'simple' ? this.renderSimple() : this.renderNormal();
|
285
|
-
}
|
286
98
|
}
|
287
99
|
|
288
100
|
@Renderer({
|
289
101
|
test: /(^|\/)(?:pagination|pager)$/,
|
290
102
|
name: 'pagination'
|
291
103
|
})
|
292
|
-
export class PaginationRenderer extends Pagination {}
|
104
|
+
export class PaginationRenderer extends Pagination { }
|
@@ -37,7 +37,6 @@ export class HeadCellSearchDropDown extends React.Component<
|
|
37
37
|
|
38
38
|
this.open = this.open.bind(this);
|
39
39
|
this.close = this.close.bind(this);
|
40
|
-
this.close = this.close.bind(this);
|
41
40
|
this.handleSubmit = this.handleSubmit.bind(this);
|
42
41
|
this.handleAction = this.handleAction.bind(this);
|
43
42
|
}
|