amis 1.4.1 → 1.4.2-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/README.md +1 -1
- package/lib/Schema.d.ts +17 -0
- package/lib/Schema.js.map +1 -1
- package/lib/components/Alert.js +3 -1
- package/lib/components/Alert.js.map +2 -2
- package/lib/components/Badge.d.ts +2 -2
- package/lib/components/Badge.js +12 -6
- package/lib/components/Badge.js.map +2 -2
- package/lib/components/Collapse.js +1 -1
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/DatePicker.js +1 -1
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.js +1 -1
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Link.d.ts +91 -0
- package/lib/components/Link.js +44 -0
- package/lib/components/Link.js.map +13 -0
- package/lib/components/MonthRangePicker.js +1 -1
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/RichText.js +17 -53
- package/lib/components/RichText.js.map +2 -2
- package/lib/components/Select.js +3 -0
- package/lib/components/Select.js.map +2 -2
- package/lib/components/SparkLine.d.ts +85 -84
- package/lib/components/SparkLine.js +2 -2
- package/lib/components/SparkLine.js.map +2 -2
- package/lib/components/Toast.js +2 -2
- package/lib/components/Toast.js.map +2 -2
- package/lib/components/Tree.js +5 -3
- package/lib/components/Tree.js.map +2 -2
- package/lib/components/icons.js +12 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/icons/clock.js +10 -0
- package/lib/icons/status-close.js +11 -0
- package/lib/icons/status-fail.js +11 -0
- package/lib/icons/status-info.js +10 -0
- package/lib/icons/status-success.js +11 -0
- package/lib/icons/status-warning.js +10 -0
- package/lib/index.js +1 -1
- package/lib/locale/de-DE.js +2 -0
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +2 -0
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +3 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +7 -0
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/CRUD.js +21 -6
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Collapse.js +2 -2
- package/lib/renderers/Collapse.js.map +2 -2
- package/lib/renderers/Dialog.js +0 -3
- package/lib/renderers/Dialog.js.map +2 -2
- package/lib/renderers/Drawer.js +0 -3
- package/lib/renderers/Drawer.js.map +2 -2
- package/lib/renderers/DropDownButton.d.ts +5 -1
- package/lib/renderers/DropDownButton.js +8 -6
- package/lib/renderers/DropDownButton.js.map +2 -2
- package/lib/renderers/Form/Checkbox.d.ts +5 -0
- package/lib/renderers/Form/Checkbox.js +4 -0
- package/lib/renderers/Form/Checkbox.js.map +2 -2
- package/lib/renderers/Form/Combo.js +2 -2
- package/lib/renderers/Form/Combo.js.map +2 -2
- package/lib/renderers/Form/InputFile.js +2 -2
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputImage.js +5 -3
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/Options.js +6 -3
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Picker.js +2 -2
- package/lib/renderers/Form/Picker.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +2 -2
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/IFrame.js +2 -2
- package/lib/renderers/IFrame.js.map +2 -2
- package/lib/renderers/Image.d.ts +1 -0
- package/lib/renderers/Image.js +15 -1
- package/lib/renderers/Image.js.map +2 -2
- package/lib/renderers/Link.d.ts +16 -3
- package/lib/renderers/Link.js +16 -13
- package/lib/renderers/Link.js.map +2 -2
- package/lib/renderers/Log.d.ts +2 -2
- package/lib/renderers/Log.js +7 -1
- package/lib/renderers/Log.js.map +2 -2
- package/lib/renderers/Nav.d.ts +62 -36
- package/lib/renderers/Nav.js +248 -90
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/SparkLine.d.ts +4 -0
- package/lib/renderers/SparkLine.js.map +2 -2
- package/lib/renderers/Table/ColumnToggler.d.ts +113 -0
- package/lib/renderers/Table/ColumnToggler.js +216 -0
- package/lib/renderers/Table/ColumnToggler.js.map +13 -0
- package/lib/renderers/Table/ItemActionsWrapper.d.ts +11 -0
- package/lib/renderers/Table/ItemActionsWrapper.js +31 -0
- package/lib/renderers/Table/ItemActionsWrapper.js.map +13 -0
- package/lib/renderers/Table/TableBody.d.ts +4 -0
- package/lib/renderers/Table/TableCell.js +3 -1
- package/lib/renderers/Table/TableCell.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +14 -1
- package/lib/renderers/Table/index.js +116 -36
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/store/table.d.ts +257 -1
- package/lib/store/table.js +41 -6
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +393 -90
- package/lib/themes/ang.css +393 -90
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +393 -90
- package/lib/themes/antd.css +393 -90
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +904 -263
- package/lib/themes/cxd.css +904 -263
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +393 -90
- package/lib/themes/dark.css +393 -90
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +904 -263
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/api.js +4 -4
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/handleAction.d.ts +7 -0
- package/lib/utils/handleAction.js +30 -0
- package/lib/utils/handleAction.js.map +13 -0
- package/lib/utils/helper.d.ts +1 -1
- package/lib/utils/helper.js +3 -3
- package/lib/utils/helper.js.map +2 -2
- package/lib/utils/tpl-builtin.d.ts +1 -1
- package/lib/utils/tpl-builtin.js +25 -15
- package/lib/utils/tpl-builtin.js.map +2 -2
- package/package.json +1 -1
- package/schema.json +322 -261
- package/scss/_properties.scss +39 -4
- package/scss/_utilities.scss +4 -0
- package/scss/components/_button.scss +4 -5
- package/scss/components/_collapse.scss +26 -8
- package/scss/components/_column-toggler.scss +234 -0
- package/scss/components/_dropdown.scss +2 -1
- package/scss/components/_images.scss +2 -1
- package/scss/components/_link.scss +6 -0
- package/scss/components/_nav.scss +231 -223
- package/scss/components/_page.scss +5 -4
- package/scss/components/_progress.scss +2 -0
- package/scss/components/_steps.scss +1 -1
- package/scss/components/_table.scss +25 -1
- package/scss/components/form/_color.scss +1 -0
- package/scss/components/form/_date-range.scss +2 -0
- package/scss/components/form/_date.scss +2 -0
- package/scss/components/form/_fieldset.scss +1 -2
- package/scss/components/form/_file.scss +5 -4
- package/scss/components/form/_image.scss +7 -2
- package/scss/components/form/_list.scss +1 -0
- package/scss/components/form/_location.scss +1 -1
- package/scss/components/form/_text.scss +13 -0
- package/scss/components/form/_textarea.scss +10 -0
- package/scss/components/form/_transfer.scss +2 -0
- package/scss/themes/_common.scss +2 -0
- package/scss/themes/_cxd-colors.scss +56 -0
- package/scss/themes/_cxd-variables.scss +215 -90
- package/scss/themes/cxd.scss +366 -0
- package/sdk/ang-ie11.css +569 -235
- package/sdk/ang.css +512 -151
- package/sdk/antd-ie11.css +558 -224
- package/sdk/antd.css +512 -151
- package/sdk/charts.js +13 -13
- package/sdk/color-picker.js +67 -67
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +1506 -870
- package/sdk/cxd.css +1064 -324
- package/sdk/dark-ie11.css +569 -235
- package/sdk/dark.css +512 -151
- package/sdk/exceljs.js +1 -1
- package/sdk/ie11-patch.css +1 -0
- package/sdk/locale/de-DE.js +2 -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 +22 -22
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +1506 -870
- package/sdk/sdk.css +1064 -324
- package/sdk/sdk.js +1138 -1118
- 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 +18 -0
- package/src/components/Alert.tsx +3 -1
- package/src/components/Badge.tsx +36 -24
- package/src/components/Collapse.tsx +14 -9
- package/src/components/DatePicker.tsx +1 -1
- package/src/components/DateRangePicker.tsx +23 -11
- package/src/components/InputBox.tsx +1 -1
- package/src/components/Link.tsx +94 -0
- package/src/components/MonthRangePicker.tsx +10 -2
- package/src/components/RichText.tsx +17 -57
- package/src/components/Select.tsx +3 -0
- package/src/components/SparkLine.tsx +4 -1
- package/src/components/Toast.tsx +5 -5
- package/src/components/Tree.tsx +6 -8
- package/src/components/icons.tsx +13 -0
- package/src/icons/clock.svg +1 -0
- package/src/icons/status-close.svg +10 -0
- package/src/icons/status-fail.svg +10 -0
- package/src/icons/status-info.svg +8 -0
- package/src/icons/status-success.svg +10 -0
- package/src/icons/status-warning.svg +8 -0
- package/src/locale/de-DE.ts +2 -0
- package/src/locale/en-US.ts +2 -0
- package/src/locale/zh-CN.ts +3 -1
- package/src/renderers/Action.tsx +5 -0
- package/src/renderers/CRUD.tsx +31 -26
- package/src/renderers/Collapse.tsx +1 -1
- package/src/renderers/Dialog.tsx +0 -4
- package/src/renderers/Drawer.tsx +0 -4
- package/src/renderers/DropDownButton.tsx +19 -14
- package/src/renderers/Form/Checkbox.tsx +8 -0
- package/src/renderers/Form/Combo.tsx +2 -3
- package/src/renderers/Form/InputFile.tsx +2 -1
- package/src/renderers/Form/InputImage.tsx +5 -2
- package/src/renderers/Form/Options.tsx +16 -5
- package/src/renderers/Form/Picker.tsx +3 -2
- package/src/renderers/Form/wrapControl.tsx +2 -2
- package/src/renderers/IFrame.tsx +2 -1
- package/src/renderers/Image.tsx +10 -0
- package/src/renderers/Link.tsx +36 -11
- package/src/renderers/Log.tsx +16 -3
- package/src/renderers/Nav.tsx +255 -100
- package/src/renderers/SparkLine.tsx +5 -0
- package/src/renderers/Table/ColumnToggler.tsx +544 -0
- package/src/renderers/Table/ItemActionsWrapper.tsx +44 -0
- package/src/renderers/Table/TableCell.tsx +16 -1
- package/src/renderers/Table/index.tsx +179 -47
- package/src/store/table.ts +57 -6
- package/src/utils/api.ts +13 -4
- package/src/utils/handleAction.ts +41 -0
- package/src/utils/helper.ts +4 -4
- package/src/utils/tpl-builtin.ts +48 -17
- package/sdk.zip +0 -0
package/src/components/icons.tsx
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
import React from 'react';
|
7
7
|
|
8
8
|
import CloseIcon from '../icons/close.svg';
|
9
|
+
import StatusCloseIcon from '../icons/status-close.svg';
|
9
10
|
import UnDoIcon from '../icons/undo.svg';
|
10
11
|
import ReDoIcon from '../icons/redo.svg';
|
11
12
|
import EnterIcon from '../icons/enter.svg';
|
@@ -24,6 +25,10 @@ import RemoveIcon from '../icons/remove.svg';
|
|
24
25
|
import RetryIcon from '../icons/retry.svg';
|
25
26
|
import UploadIcon from '../icons/upload.svg';
|
26
27
|
import FileIcon from '../icons/file.svg';
|
28
|
+
import StatusSuccessIcon from '../icons/status-success.svg';
|
29
|
+
import StatusFailIcon from '../icons/status-fail.svg';
|
30
|
+
import StatusInfoIcon from '../icons/status-info.svg';
|
31
|
+
import StatusWarningIcon from '../icons/status-warning.svg';
|
27
32
|
import SuccessIcon from '../icons/success.svg';
|
28
33
|
import FailIcon from '../icons/fail.svg';
|
29
34
|
import SearchIcon from '../icons/search.svg';
|
@@ -36,6 +41,8 @@ import ReloadIcon from '../icons/reload.svg';
|
|
36
41
|
import ExchangeIcon from '../icons/exchange.svg';
|
37
42
|
import ColmunsIcon from '../icons/columns.svg';
|
38
43
|
import CalendarIcon from '../icons/calendar.svg';
|
44
|
+
import ClockIcon from '../icons/clock.svg';
|
45
|
+
|
39
46
|
import CopyIcon from '../icons/copy.svg';
|
40
47
|
import FilterIcon from '../icons/filter.svg';
|
41
48
|
import CaretIcon from '../icons/caret.svg';
|
@@ -92,6 +99,7 @@ export function registerIcon(key: string, component: React.ReactType<{}>) {
|
|
92
99
|
}
|
93
100
|
|
94
101
|
registerIcon('close', CloseIcon);
|
102
|
+
registerIcon('status-close', StatusCloseIcon);
|
95
103
|
registerIcon('undo', UnDoIcon);
|
96
104
|
registerIcon('redo', ReDoIcon);
|
97
105
|
registerIcon('enter', EnterIcon);
|
@@ -113,6 +121,10 @@ registerIcon('remove', RemoveIcon);
|
|
113
121
|
registerIcon('retry', RetryIcon);
|
114
122
|
registerIcon('upload', UploadIcon);
|
115
123
|
registerIcon('file', FileIcon);
|
124
|
+
registerIcon('status-success', StatusSuccessIcon);
|
125
|
+
registerIcon('status-fail', StatusFailIcon);
|
126
|
+
registerIcon('status-info', StatusInfoIcon);
|
127
|
+
registerIcon('status-warning', StatusWarningIcon);
|
116
128
|
registerIcon('success', SuccessIcon);
|
117
129
|
registerIcon('fail', FailIcon);
|
118
130
|
registerIcon('warning', WarningIcon);
|
@@ -128,6 +140,7 @@ registerIcon('reload', ReloadIcon);
|
|
128
140
|
registerIcon('exchange', ExchangeIcon);
|
129
141
|
registerIcon('columns', ColmunsIcon);
|
130
142
|
registerIcon('calendar', CalendarIcon);
|
143
|
+
registerIcon('clock', ClockIcon);
|
131
144
|
registerIcon('copy', CopyIcon);
|
132
145
|
registerIcon('filter', FilterIcon);
|
133
146
|
registerIcon('column-filter', ColumnFilterIcon);
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg width="24px" height="24px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>ic_时间</title><g id="ic_时间" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><circle id="1-FL" stroke="#000" cx="8" cy="8" r="6.5" stroke-width="1px" fill="none" stroke-linecap="butt" stroke-linejoin="round"/><polyline id="2-FLW" stroke="#000" points="7.87443646 5.5 7.87443646 8.53778873 5.5 9.28133409" stroke-width="1px" fill="none" stroke-linecap="butt" stroke-linejoin="round"/></g></svg>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<title>关闭</title>
|
4
|
+
<g id="关闭" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<g id="图标-关闭">
|
6
|
+
<rect id="矩形" stroke="#979797" fill="#D8D8D8" opacity="0" x="0.5" y="0.5" width="15" height="15"></rect>
|
7
|
+
<path d="M12.549,2.65 L13.256,3.357 L8.659,7.952 L13.2563,12.549 L12.5493,13.257 L7.953,8.659 L3.357,13.257 L2.65,12.549 L7.246,7.952 L2.6503,3.357 L3.3573,2.65 L7.953,7.245 L12.549,2.65 Z" id="图标-填色" fill="#080E1A" opacity="0.5"></path>
|
8
|
+
</g>
|
9
|
+
</g>
|
10
|
+
</svg>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<title>状态-失败</title>
|
4
|
+
<g id="状态-失败" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<g id="图示-图标">
|
6
|
+
<rect id="矩形" stroke="#979797" stroke-width="1.33333333" fill="#D8D8D8" opacity="0" x="0.666666667" y="0.666666667" width="14.6666667" height="14.6666667"></rect>
|
7
|
+
<path d="M10.4361,11.0054 L7.9531,8.5394 L5.4861,11.0224 L4.7771,10.3184 L7.2431,7.8344 L4.7601,5.3674 L5.4651,4.6584 L7.9481,7.1244 L10.4151,4.6424 L11.1241,5.3464 L8.6571,7.8294 L11.1411,10.2964 L10.4361,11.0054 Z M1.00001937,8.0244 C1.0131,11.8894 4.1581,15.0134 8.0231,14.9994934 C11.8901,14.9864 15.0131,11.8424 15.0001806,7.9764 C14.9871,4.1104 11.8421,0.9864 7.9771,1.00030657 C4.1101,1.0134 0.9871,4.1574 1.00001937,8.0244 Z" id="图标-填色" fill="#E8684A"></path>
|
8
|
+
</g>
|
9
|
+
</g>
|
10
|
+
</svg>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<title>6.图标/6.提示/通知/面</title>
|
4
|
+
<g id="6.图标/6.提示/通知/面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<polygon id="Clip-2" points="1.0001 1 15 1 15 14.9999 1.0001 14.9999"></polygon>
|
6
|
+
<path d="M8.0001,0.9999 C11.8661,0.9999 15.0001,4.1349 15.0001,7.9999 C15.0001,11.8659 11.8661,14.9999 8.0001,14.9999 C4.1341,14.9999 1.0001,11.8659 1.0001,7.9999 C1.0001,4.1349 4.1341,0.9999 8.0001,0.9999 Z M8.5001,6.5459 L7.5001,6.5459 L7.5001,11.9999 L8.5001,11.9999 L8.5001,6.5459 Z M8.0001,3.9999 C7.6681,3.9999 7.4001,4.2679 7.4001,4.5999 C7.4001,4.9309 7.6681,5.1999 8.0001,5.1999 C8.3321,5.1999 8.6001,4.9309 8.6001,4.5999 C8.6001,4.2679 8.3321,3.9999 8.0001,3.9999 Z" id="图标-填色" fill="#2468F2"></path>
|
7
|
+
</g>
|
8
|
+
</svg>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<title>状态-成功</title>
|
4
|
+
<g id="状态-成功" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<g id="图标-提示">
|
6
|
+
<rect id="矩形" stroke="#979797" stroke-width="1.33333333" fill="#D8D8D8" opacity="0" x="0.666666667" y="0.666666667" width="14.6666667" height="14.6666667"></rect>
|
7
|
+
<path d="M7.0286,11.0408 L6.3196,10.3358 L6.3206,10.3348 L4.1896,8.2188 L4.8946,7.5088 L7.0256,9.6258 L11.2526,5.3698 L11.9616,6.0738 L7.0286,11.0408 Z M7.9766,0.999759561 C4.1106,1.0138 0.9866,4.1578 0.999559574,8.0228 C1.0126,11.8898 4.1576,15.0138 8.0236,14.9998469 C11.8896,14.9868 15.0126,11.8428 14.9996404,7.9768 C14.9866,4.1098 11.8426,0.9868 7.9766,0.999759561 L7.9766,0.999759561 Z" id="图标-填色" fill="#0BC280"></path>
|
8
|
+
</g>
|
9
|
+
</g>
|
10
|
+
</svg>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<title>6.图标/6.提示/异常/面</title>
|
4
|
+
<g id="6.图标/6.提示/异常/面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<polygon id="Clip-2" points="1.0001 1 15 1 15 14.9997 1.0001 14.9997"></polygon>
|
6
|
+
<path d="M8.0001,0.9997 C11.8661,0.9997 15.0001,4.1347 15.0001,7.9997 C15.0001,11.8657 11.8661,14.9997 8.0001,14.9997 C4.1341,14.9997 1.0001,11.8657 1.0001,7.9997 C1.0001,4.1347 4.1341,0.9997 8.0001,0.9997 Z M8.0001,10.7997 C7.6681,10.7997 7.4001,11.0687 7.4001,11.3997 C7.4001,11.7307 7.6681,11.9997 8.0001,11.9997 C8.3321,11.9997 8.6001,11.7307 8.6001,11.3997 C8.6001,11.0687 8.3321,10.7997 8.0001,10.7997 Z M8.5001,3.9997 L7.5001,3.9997 L7.5001,9.4547 L8.5001,9.4547 L8.5001,3.9997 Z" id="形状结合" fill="#FFB200"></path>
|
7
|
+
</g>
|
8
|
+
</svg>
|
package/src/locale/de-DE.ts
CHANGED
@@ -172,6 +172,8 @@ register('de-DE', {
|
|
172
172
|
'Table.startSort': 'Klicken, um Sortierung zu starten',
|
173
173
|
'Table.valueField': 'valueField muss vorhanden sein',
|
174
174
|
'Table.index': 'Index',
|
175
|
+
'Table.toggleColumn': 'Spalten anzeigen',
|
176
|
+
'Table.searchFields': 'Abfragefelder setzen',
|
175
177
|
'Tag.placeholder': 'Noch kein Tag',
|
176
178
|
'Tag.tip': 'Kürzlich verwendetes Tag',
|
177
179
|
'Text.add': 'Neu {{label}}',
|
package/src/locale/en-US.ts
CHANGED
@@ -173,6 +173,8 @@ register('en-US', {
|
|
173
173
|
'Table.startSort': 'Click to start sorting',
|
174
174
|
'Table.valueField': 'Must have valueField',
|
175
175
|
'Table.index': 'Index',
|
176
|
+
'Table.toggleColumn': 'Display columns',
|
177
|
+
'Table.searchFields': 'Set query fields',
|
176
178
|
'Tag.placeholder': 'No tag yet',
|
177
179
|
'Tag.tip': 'Recently used tag',
|
178
180
|
'Text.add': 'New {{label}}',
|
package/src/locale/zh-CN.ts
CHANGED
@@ -99,7 +99,7 @@ register('zh-CN', {
|
|
99
99
|
'File.start': '开始上传',
|
100
100
|
'File.upload': '上传文件',
|
101
101
|
'File.uploadFailed': '接口返回错误,请仔细检查',
|
102
|
-
'File.uploading': '
|
102
|
+
'File.uploading': '上传中...',
|
103
103
|
'Form.loadOptionsFailed': '加载选项失败,原因:{{reason}}',
|
104
104
|
'Form.submit': '提交',
|
105
105
|
'Form.title': '表单',
|
@@ -177,6 +177,8 @@ register('zh-CN', {
|
|
177
177
|
'Table.startSort': '点击开始排序',
|
178
178
|
'Table.valueField': '请配置 valueField',
|
179
179
|
'Table.index': '序号',
|
180
|
+
'Table.toggleColumn': '显示列',
|
181
|
+
'Table.searchFields': '设置查询字段',
|
180
182
|
'Tag.placeholder': '暂无标签',
|
181
183
|
'Tag.tip': '最近使用的标签',
|
182
184
|
'Text.add': '新增:{{label}}',
|
package/src/renderers/Action.tsx
CHANGED
package/src/renderers/CRUD.tsx
CHANGED
@@ -1,43 +1,28 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
|
3
|
-
import PropTypes from 'prop-types';
|
4
3
|
import {Renderer, RendererProps} from '../factory';
|
5
|
-
import {
|
6
|
-
SchemaNode,
|
7
|
-
Schema,
|
8
|
-
Action,
|
9
|
-
Api,
|
10
|
-
ApiObject,
|
11
|
-
PlainObject
|
12
|
-
} from '../types';
|
4
|
+
import {SchemaNode, Schema, Action, PlainObject} from '../types';
|
13
5
|
import {CRUDStore, ICRUDStore} from '../store/crud';
|
14
6
|
import {
|
15
7
|
createObject,
|
16
8
|
extendObject,
|
17
9
|
anyChanged,
|
18
10
|
isObjectShallowModified,
|
19
|
-
noop,
|
20
11
|
isVisible,
|
21
12
|
getPropValue,
|
22
13
|
getVariable,
|
23
14
|
qsstringify,
|
24
|
-
qsparse
|
15
|
+
qsparse,
|
16
|
+
isArrayChildrenModified
|
25
17
|
} from '../utils/helper';
|
26
|
-
import {
|
27
|
-
import partition from 'lodash/partition';
|
28
|
-
import Scoped, {ScopedContext, IScopedContext} from '../Scoped';
|
18
|
+
import {ScopedContext, IScopedContext} from '../Scoped';
|
29
19
|
import Button from '../components/Button';
|
30
20
|
import Select from '../components/Select';
|
31
21
|
import getExprProperties from '../utils/filter-schema';
|
32
22
|
import pick from 'lodash/pick';
|
33
23
|
import {findDOMNode} from 'react-dom';
|
34
24
|
import {evalExpression, filter} from '../utils/tpl';
|
35
|
-
import {
|
36
|
-
isValidApi,
|
37
|
-
buildApi,
|
38
|
-
isEffectiveApi,
|
39
|
-
isApiOutdated
|
40
|
-
} from '../utils/api';
|
25
|
+
import {isEffectiveApi, isApiOutdated, str2function} from '../utils/api';
|
41
26
|
import omit from 'lodash/omit';
|
42
27
|
import find from 'lodash/find';
|
43
28
|
import findIndex from 'lodash/findIndex';
|
@@ -48,7 +33,6 @@ import {
|
|
48
33
|
BaseSchema,
|
49
34
|
SchemaApi,
|
50
35
|
SchemaClassName,
|
51
|
-
SchemaCollection,
|
52
36
|
SchemaExpression,
|
53
37
|
SchemaMessage,
|
54
38
|
SchemaName,
|
@@ -362,6 +346,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
362
346
|
'footerToolbar',
|
363
347
|
'filterTogglable',
|
364
348
|
'filterDefaultVisible',
|
349
|
+
'autoGenerateFilter',
|
365
350
|
'syncResponse2Query',
|
366
351
|
'keepItemSelectionOnPageChange',
|
367
352
|
'labelTpl',
|
@@ -478,8 +463,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
478
463
|
this.handleFilterInit({});
|
479
464
|
}
|
480
465
|
|
481
|
-
|
482
|
-
if (this.props.pickerMode && val) {
|
466
|
+
let val: any;
|
467
|
+
if (this.props.pickerMode && (val = getPropValue(this.props))) {
|
483
468
|
store.setSelectedItems(val);
|
484
469
|
}
|
485
470
|
}
|
@@ -500,8 +485,14 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
500
485
|
this.renderFooterToolbar = this.renderFooterToolbar.bind(this);
|
501
486
|
}
|
502
487
|
|
503
|
-
|
504
|
-
if (
|
488
|
+
let val: any;
|
489
|
+
if (
|
490
|
+
this.props.pickerMode &&
|
491
|
+
isArrayChildrenModified(
|
492
|
+
(val = getPropValue(this.props)),
|
493
|
+
getPropValue(prevProps)
|
494
|
+
)
|
495
|
+
) {
|
505
496
|
store.setSelectedItems(val);
|
506
497
|
}
|
507
498
|
|
@@ -654,6 +645,13 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
654
645
|
return Promise.resolve({
|
655
646
|
items: store.selectedItems.concat()
|
656
647
|
});
|
648
|
+
} else if (action.onClick) {
|
649
|
+
store.setCurrentAction(action);
|
650
|
+
let onClick = action.onClick;
|
651
|
+
if (typeof onClick === 'string') {
|
652
|
+
onClick = str2function(onClick, 'event', 'props', 'data');
|
653
|
+
}
|
654
|
+
onClick && onClick(e, this.props, ctx);
|
657
655
|
} else {
|
658
656
|
onAction(e, action, ctx, throwErrors, delegate || this.context);
|
659
657
|
}
|
@@ -1792,6 +1790,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
1792
1790
|
return null;
|
1793
1791
|
}
|
1794
1792
|
|
1793
|
+
const {render, store} = this.props;
|
1795
1794
|
const type = (toolbar as Schema).type || toolbar;
|
1796
1795
|
|
1797
1796
|
if (type === 'bulkActions' || type === 'bulk-actions') {
|
@@ -1810,6 +1809,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
1810
1809
|
return this.renderExportCSV(toolbar as Schema);
|
1811
1810
|
} else if (Array.isArray(toolbar)) {
|
1812
1811
|
const children: Array<any> = toolbar
|
1812
|
+
.filter((toolbar: any) => isVisible(toolbar, store.filterData))
|
1813
1813
|
.map((toolbar, index) => ({
|
1814
1814
|
dom: this.renderToolbar(toolbar, index, childProps, toolbarRenderer),
|
1815
1815
|
toolbar
|
@@ -1851,7 +1851,6 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
1851
1851
|
return result;
|
1852
1852
|
}
|
1853
1853
|
|
1854
|
-
const {render, store} = this.props;
|
1855
1854
|
const $$editable = childProps.$$editable;
|
1856
1855
|
|
1857
1856
|
return render(`toolbar/${index}`, toolbar, {
|
@@ -1994,6 +1993,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
1994
1993
|
popOverContainer,
|
1995
1994
|
translate: __,
|
1996
1995
|
onQuery,
|
1996
|
+
autoGenerateFilter,
|
1997
|
+
onSelect,
|
1997
1998
|
...rest
|
1998
1999
|
} = this.props;
|
1999
2000
|
|
@@ -2044,6 +2045,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
2044
2045
|
key: 'body',
|
2045
2046
|
className: cx('Crud-body', bodyClassName),
|
2046
2047
|
ref: this.controlRef,
|
2048
|
+
autoGenerateFilter: !filter && autoGenerateFilter,
|
2047
2049
|
selectable: !!(
|
2048
2050
|
(this.hasBulkActionsToolbar() && this.hasBulkActions()) ||
|
2049
2051
|
pickerMode
|
@@ -2076,6 +2078,9 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
|
2076
2078
|
onSelect: this.handleSelect,
|
2077
2079
|
onPopOverOpened: this.handleChildPopOverOpen,
|
2078
2080
|
onPopOverClosed: this.handleChildPopOverClose,
|
2081
|
+
onSearchableFromReset: this.handleFilterReset,
|
2082
|
+
onSearchableFromSubmit: this.handleFilterSubmit,
|
2083
|
+
onSearchableFromInit: this.handleFilterInit,
|
2079
2084
|
headerToolbarRender: this.renderHeaderToolbar,
|
2080
2085
|
footerToolbarRender: this.renderFooterToolbar,
|
2081
2086
|
data: store.mergedData
|
@@ -176,8 +176,8 @@ export default class Collapse extends React.Component<
|
|
176
176
|
onClick={this.toggleCollapsed}
|
177
177
|
className={cx(`Collapse-header`, headingClassName)}
|
178
178
|
>
|
179
|
-
{render('heading', finalTitle)}
|
180
179
|
{collapsable && <span className={cx('Collapse-arrow')} />}
|
180
|
+
{render('heading', finalTitle)}
|
181
181
|
</HeadingComponent>
|
182
182
|
) : null,
|
183
183
|
|
package/src/renderers/Dialog.tsx
CHANGED
@@ -629,10 +629,6 @@ export class DialogRenderer extends Dialog {
|
|
629
629
|
tryChildrenToHandle(action: Action, ctx: object, rawAction?: Action) {
|
630
630
|
const scoped = this.context as IScopedContext;
|
631
631
|
|
632
|
-
if (action.fromDialog) {
|
633
|
-
return false;
|
634
|
-
}
|
635
|
-
|
636
632
|
const targets: Array<any> = [];
|
637
633
|
const {onConfirm, store} = this.props;
|
638
634
|
|
package/src/renderers/Drawer.tsx
CHANGED
@@ -687,10 +687,6 @@ export class DrawerRenderer extends Drawer {
|
|
687
687
|
tryChildrenToHandle(action: Action, ctx: object, rawAction?: Action) {
|
688
688
|
const scoped = this.context as IScopedContext;
|
689
689
|
|
690
|
-
if (action.fromDialog) {
|
691
|
-
return false;
|
692
|
-
}
|
693
|
-
|
694
690
|
const targets: Array<any> = [];
|
695
691
|
const {onConfirm, store} = this.props;
|
696
692
|
|
@@ -7,10 +7,11 @@ import type {TooltipObject, Trigger} from '../components/TooltipWrapper';
|
|
7
7
|
import {isDisabled, isVisible, noop} from '../utils/helper';
|
8
8
|
import {filter} from '../utils/tpl';
|
9
9
|
import {Icon} from '../components/icons';
|
10
|
-
import {BaseSchema, SchemaClassName} from '../Schema';
|
10
|
+
import {BaseSchema, SchemaClassName, SchemaIcon} from '../Schema';
|
11
11
|
import {ActionSchema} from './Action';
|
12
12
|
import {DividerSchema} from './Divider';
|
13
13
|
import {RootClose} from '../utils/RootClose';
|
14
|
+
import {generateIcon} from '../utils/icon';
|
14
15
|
|
15
16
|
/**
|
16
17
|
* 下拉按钮渲染器。
|
@@ -77,10 +78,16 @@ export interface DropdownButtonSchema extends BaseSchema {
|
|
77
78
|
*/
|
78
79
|
iconOnly?: boolean;
|
79
80
|
|
81
|
+
/**
|
82
|
+
* 右侧图标
|
83
|
+
*/
|
84
|
+
rightIcon?: SchemaIcon;
|
85
|
+
|
80
86
|
/**
|
81
87
|
* 触发条件,默认是 click
|
82
88
|
*/
|
83
89
|
trigger?: 'click' | 'hover';
|
90
|
+
|
84
91
|
/**
|
85
92
|
* 是否显示下拉按钮
|
86
93
|
*/
|
@@ -274,12 +281,17 @@ export default class DropDownButton extends React.Component<
|
|
274
281
|
align,
|
275
282
|
iconOnly,
|
276
283
|
icon,
|
284
|
+
rightIcon,
|
277
285
|
isActived,
|
278
286
|
trigger,
|
279
287
|
data,
|
280
288
|
hideCaret
|
281
289
|
} = this.props;
|
282
290
|
|
291
|
+
const iconElement = generateIcon(cx, icon, 'm-r-xs');
|
292
|
+
|
293
|
+
const rightIconElement = generateIcon(cx, rightIcon, 'm-l-xs');
|
294
|
+
|
283
295
|
return (
|
284
296
|
<div
|
285
297
|
className={cx(
|
@@ -322,21 +334,14 @@ export default class DropDownButton extends React.Component<
|
|
322
334
|
size ? `Button--${size}` : ''
|
323
335
|
)}
|
324
336
|
>
|
325
|
-
{
|
326
|
-
typeof icon === 'string' ? (
|
327
|
-
<i className={cx(icon, 'm-r-xs')} />
|
328
|
-
) : (
|
329
|
-
icon
|
330
|
-
)
|
331
|
-
) : null}
|
337
|
+
{iconElement}
|
332
338
|
{typeof label === 'string' ? filter(label, data) : label}
|
333
|
-
{
|
334
|
-
|
335
|
-
|
336
|
-
<Icon icon="
|
339
|
+
{rightIconElement}
|
340
|
+
{!hideCaret ? (
|
341
|
+
<span className={cx('DropDown-caret')}>
|
342
|
+
<Icon icon="ellipsis-v" className="icon" />
|
337
343
|
</span>
|
338
|
-
|
339
|
-
}
|
344
|
+
) : null}
|
340
345
|
</button>
|
341
346
|
</TooltipWrapper>
|
342
347
|
{this.state.isOpened ? this.renderOuter() : null}
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import {FormItem, FormControlProps, FormBaseControl} from './Item';
|
3
3
|
import cx from 'classnames';
|
4
4
|
import Checkbox from '../../components/Checkbox';
|
5
|
+
import {withBadge, BadgeSchema} from '../../components/Badge';
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Checkbox 勾选框。
|
@@ -27,6 +28,11 @@ export interface CheckboxControlSchema extends FormBaseControl {
|
|
27
28
|
* 选项说明
|
28
29
|
*/
|
29
30
|
option?: string;
|
31
|
+
|
32
|
+
/**
|
33
|
+
* 角标
|
34
|
+
*/
|
35
|
+
badge?: BadgeSchema;
|
30
36
|
}
|
31
37
|
|
32
38
|
export interface CheckboxProps
|
@@ -78,4 +84,6 @@ export default class CheckboxControl extends React.Component<
|
|
78
84
|
type: 'checkbox',
|
79
85
|
sizeMutable: false
|
80
86
|
})
|
87
|
+
// @ts-ignore
|
88
|
+
@withBadge
|
81
89
|
export class CheckboxControlRenderer extends CheckboxControl {}
|
@@ -251,7 +251,6 @@ export interface ComboControlSchema extends FormBaseControl {
|
|
251
251
|
/**
|
252
252
|
* 最大值验证错误提示
|
253
253
|
*/
|
254
|
-
|
255
254
|
maxLengthValidateFailed?: string;
|
256
255
|
};
|
257
256
|
}
|
@@ -1010,7 +1009,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|
1010
1009
|
{deleteIcon ? (
|
1011
1010
|
<i className={deleteIcon} />
|
1012
1011
|
) : (
|
1013
|
-
<Icon icon="close" className="icon" />
|
1012
|
+
<Icon icon="status-close" className="icon" />
|
1014
1013
|
)}
|
1015
1014
|
</div>
|
1016
1015
|
);
|
@@ -1189,7 +1188,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|
1189
1188
|
{deleteIcon ? (
|
1190
1189
|
<i className={deleteIcon} />
|
1191
1190
|
) : (
|
1192
|
-
<Icon icon="close" className="icon" />
|
1191
|
+
<Icon icon="status-close" className="icon" />
|
1193
1192
|
)}
|
1194
1193
|
</a>
|
1195
1194
|
);
|
@@ -1223,13 +1223,14 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|
1223
1223
|
onClick={this.handleSelect}
|
1224
1224
|
>
|
1225
1225
|
<Icon icon="upload" className="icon" />
|
1226
|
-
{!multiple && files.length
|
1226
|
+
<span>{!multiple && files.length
|
1227
1227
|
? __('File.repick')
|
1228
1228
|
: multiple && files.length
|
1229
1229
|
? __('File.continueAdd')
|
1230
1230
|
: btnLabel
|
1231
1231
|
? btnLabel
|
1232
1232
|
: __('File.upload')}
|
1233
|
+
</span>
|
1233
1234
|
</Button>
|
1234
1235
|
) : null}
|
1235
1236
|
|
@@ -1377,7 +1377,6 @@ export default class ImageControl extends React.Component<
|
|
1377
1377
|
fixedSize ? fixedSizeClassName : ''
|
1378
1378
|
)}
|
1379
1379
|
>
|
1380
|
-
<p>{__('File.uploading')}</p>
|
1381
1380
|
<div className={cx('ImageControl-progress')}>
|
1382
1381
|
<span
|
1383
1382
|
style={{
|
@@ -1390,6 +1389,7 @@ export default class ImageControl extends React.Component<
|
|
1390
1389
|
)}
|
1391
1390
|
/>
|
1392
1391
|
</div>
|
1392
|
+
<p>{__('File.uploading')}</p>
|
1393
1393
|
</div>
|
1394
1394
|
</>
|
1395
1395
|
) : (
|
@@ -1524,7 +1524,10 @@ export default class ImageControl extends React.Component<
|
|
1524
1524
|
thumbRatio={thumbRatio}
|
1525
1525
|
/>
|
1526
1526
|
) : (
|
1527
|
-
|
1527
|
+
<>
|
1528
|
+
<Icon icon="plus" className="icon" />
|
1529
|
+
<span>{__('File.upload')}</span>
|
1530
|
+
</>
|
1528
1531
|
)}
|
1529
1532
|
|
1530
1533
|
{isFocused ? (
|
@@ -270,7 +270,8 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
270
270
|
: [];
|
271
271
|
static ComposedComponent = Control;
|
272
272
|
|
273
|
-
|
273
|
+
toDispose: Array<() => void> = [];
|
274
|
+
|
274
275
|
input: any;
|
275
276
|
mounted = false;
|
276
277
|
|
@@ -302,9 +303,18 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
302
303
|
data
|
303
304
|
);
|
304
305
|
|
305
|
-
this.
|
306
|
-
(
|
307
|
-
|
306
|
+
this.toDispose.push(
|
307
|
+
reaction(
|
308
|
+
() => JSON.stringify([formItem.loading, formItem.filteredOptions]),
|
309
|
+
() => this.mounted && this.forceUpdate()
|
310
|
+
)
|
311
|
+
);
|
312
|
+
|
313
|
+
this.toDispose.push(
|
314
|
+
reaction(
|
315
|
+
() => JSON.stringify(formItem.options),
|
316
|
+
() => this.mounted && this.syncAutoFill(formItem.tmpValue)
|
317
|
+
)
|
308
318
|
);
|
309
319
|
// 默认全选。这里会和默认值\回填值逻辑冲突,所以如果有配置source则不执行默认全选
|
310
320
|
if (
|
@@ -432,7 +442,8 @@ export function registerOptionsControl(config: OptionsConfig) {
|
|
432
442
|
|
433
443
|
componentWillUnmount() {
|
434
444
|
this.props.removeHook?.(this.reload, 'init');
|
435
|
-
this.
|
445
|
+
this.toDispose.forEach(fn => fn());
|
446
|
+
this.toDispose = [];
|
436
447
|
}
|
437
448
|
|
438
449
|
syncAutoFill(value: any) {
|
@@ -397,14 +397,15 @@ export default class PickerControl extends React.PureComponent<
|
|
397
397
|
options,
|
398
398
|
multiple,
|
399
399
|
valueField,
|
400
|
-
embed
|
400
|
+
embed,
|
401
|
+
source
|
401
402
|
} = this.props;
|
402
403
|
|
403
404
|
return render('modal-body', this.state.schema, {
|
404
405
|
value: selectedOptions,
|
405
406
|
valueField,
|
406
407
|
primaryField: valueField,
|
407
|
-
options: options,
|
408
|
+
options: source ? [] : options,
|
408
409
|
multiple,
|
409
410
|
onSelect: embed ? this.handleChange : undefined,
|
410
411
|
ref: this.crudRef,
|
@@ -506,8 +506,8 @@ export function wrapControl<
|
|
506
506
|
|
507
507
|
if (
|
508
508
|
// 如果配置了 minLength 或者 maxLength 就切成及时验证
|
509
|
-
|
510
|
-
|
509
|
+
this.model.rules.minLength ||
|
510
|
+
this.model.rules.maxLength ||
|
511
511
|
validateOnChange === true ||
|
512
512
|
(validateOnChange !== false && (formSubmited || validated))
|
513
513
|
) {
|
package/src/renderers/IFrame.tsx
CHANGED
@@ -149,7 +149,7 @@ export default class IFrame extends React.Component<IFrameProps, object> {
|
|
149
149
|
|
150
150
|
render() {
|
151
151
|
const {width, height} = this.state;
|
152
|
-
let {className, src, frameBorder, data, style} = this.props;
|
152
|
+
let {className, src, name, frameBorder, data, style} = this.props;
|
153
153
|
|
154
154
|
let tempStyle: any = {};
|
155
155
|
|
@@ -177,6 +177,7 @@ export default class IFrame extends React.Component<IFrameProps, object> {
|
|
177
177
|
|
178
178
|
return (
|
179
179
|
<iframe
|
180
|
+
name={name}
|
180
181
|
className={className}
|
181
182
|
frameBorder={frameBorder}
|
182
183
|
style={style}
|
package/src/renderers/Image.tsx
CHANGED
@@ -7,6 +7,7 @@ import {Icon} from '../components/icons';
|
|
7
7
|
import {LocaleProps, localeable} from '../locale';
|
8
8
|
import {BaseSchema, SchemaClassName, SchemaTpl, SchemaUrlPath} from '../Schema';
|
9
9
|
import {resolveVariable} from '../utils/tpl-builtin';
|
10
|
+
import handleAction from '../utils/handleAction';
|
10
11
|
|
11
12
|
/**
|
12
13
|
* 图片展示控件。
|
@@ -322,6 +323,14 @@ export class ImageField extends React.Component<ImageFieldProps, object> {
|
|
322
323
|
);
|
323
324
|
}
|
324
325
|
|
326
|
+
@autobind
|
327
|
+
handleClick(e: React.MouseEvent<HTMLElement>) {
|
328
|
+
const clickAction = this.props.clickAction;
|
329
|
+
if (clickAction) {
|
330
|
+
handleAction(e, clickAction, this.props);
|
331
|
+
}
|
332
|
+
}
|
333
|
+
|
325
334
|
render() {
|
326
335
|
const {
|
327
336
|
className,
|
@@ -359,6 +368,7 @@ export class ImageField extends React.Component<ImageFieldProps, object> {
|
|
359
368
|
: 'ImageField--thumb',
|
360
369
|
className
|
361
370
|
)}
|
371
|
+
onClick={this.handleClick}
|
362
372
|
>
|
363
373
|
{value ? (
|
364
374
|
<ThemedImageThumb
|