amis 1.5.6-beta.4 → 1.5.8-beta.2
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/.husky/pre-commit +1 -1
- package/lib/Schema.d.ts +3 -2
- package/lib/Schema.js.map +1 -1
- package/lib/components/AsideNav.d.ts +1 -1
- package/lib/components/AsideNav.js.map +1 -1
- package/lib/components/AssociatedSelection.d.ts +84 -84
- package/lib/components/AssociatedSelection.js +2 -2
- package/lib/components/AssociatedSelection.js.map +2 -2
- package/lib/components/Avatar.d.ts +135 -0
- package/lib/components/Avatar.js +120 -0
- package/lib/components/Avatar.js.map +13 -0
- package/lib/components/BaiduMapPicker.js.map +2 -2
- package/lib/components/CalendarMobile.d.ts +547 -0
- package/lib/components/CalendarMobile.js +432 -0
- package/lib/components/CalendarMobile.js.map +13 -0
- package/lib/components/Card.d.ts +20 -20
- package/lib/components/Card.js +1 -1
- package/lib/components/Card.js.map +2 -2
- package/lib/components/ChainedSelection.d.ts +84 -84
- package/lib/components/ChainedSelection.js +15 -3
- package/lib/components/ChainedSelection.js.map +2 -2
- package/lib/components/CodeMirror.d.ts +26 -0
- package/lib/components/CodeMirror.js +104 -0
- package/lib/components/CodeMirror.js.map +13 -0
- package/lib/components/Collapse.d.ts +22 -21
- package/lib/components/Collapse.js +1 -1
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/ColorPicker.d.ts +85 -84
- package/lib/components/ColorPicker.js +15 -3
- package/lib/components/ColorPicker.js.map +2 -2
- package/lib/components/DatePicker.d.ts +84 -84
- package/lib/components/DatePicker.js +15 -5
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +86 -84
- package/lib/components/DateRangePicker.js +22 -5
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/GroupedSelection.d.ts +84 -84
- package/lib/components/GroupedSelection.js +14 -2
- package/lib/components/GroupedSelection.js.map +2 -2
- package/lib/components/MonthRangePicker.d.ts +86 -84
- package/lib/components/MonthRangePicker.js +20 -5
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/Overlay.d.ts +1 -1
- package/lib/components/Overlay.js.map +1 -1
- package/lib/components/Picker.js +9 -4
- package/lib/components/Picker.js.map +2 -2
- package/lib/components/PickerColumn.js +0 -1
- package/lib/components/PickerColumn.js.map +2 -2
- package/lib/components/PickerContainer.d.ts +5 -1
- package/lib/components/PickerContainer.js +14 -7
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/PopUp.d.ts +94 -0
- package/lib/components/PopUp.js +58 -0
- package/lib/components/PopUp.js.map +13 -0
- package/lib/components/Rating.d.ts +203 -73
- package/lib/components/Rating.js +147 -31
- package/lib/components/Rating.js.map +2 -2
- package/lib/components/ResultBox.js +2 -1
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/ResultList.d.ts +9 -2
- package/lib/components/ResultList.js +22 -2
- package/lib/components/ResultList.js.map +2 -2
- package/lib/components/Select.d.ts +237 -237
- package/lib/components/Select.js +1 -1
- package/lib/components/Select.js.map +1 -1
- package/lib/components/Selection.d.ts +94 -86
- package/lib/components/Selection.js +11 -2
- package/lib/components/Selection.js.map +2 -2
- package/lib/components/Steps.d.ts +1 -0
- package/lib/components/Steps.js +5 -3
- package/lib/components/Steps.js.map +2 -2
- package/lib/components/TableSelection.d.ts +85 -85
- package/lib/components/TableSelection.js +1 -9
- package/lib/components/TableSelection.js.map +2 -2
- package/lib/components/Tabs.js +31 -33
- package/lib/components/Tabs.js.map +2 -2
- package/lib/components/TabsTransfer.d.ts +87 -256
- package/lib/components/TabsTransfer.js +52 -9
- package/lib/components/TabsTransfer.js.map +2 -2
- package/lib/components/TabsTransferPicker.d.ts +1 -1
- package/lib/components/TabsTransferPicker.js +21 -19
- package/lib/components/TabsTransferPicker.js.map +2 -2
- package/lib/components/Timeline.d.ts +69 -0
- package/lib/components/Timeline.js +16 -0
- package/lib/components/Timeline.js.map +13 -0
- package/lib/components/TimelineItem.d.ts +516 -0
- package/lib/components/TimelineItem.js +41 -0
- package/lib/components/TimelineItem.js.map +13 -0
- package/lib/components/Transfer.d.ts +100 -98
- package/lib/components/Transfer.js +2 -3
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +84 -84
- package/lib/components/TransferDropDown.js +1 -5
- package/lib/components/TransferDropDown.js.map +2 -2
- package/lib/components/TransferPicker.d.ts +1 -1
- package/lib/components/TransferPicker.js +21 -19
- package/lib/components/TransferPicker.js.map +2 -2
- package/lib/components/TreeSelection.d.ts +85 -85
- package/lib/components/TreeSelection.js +7 -1
- package/lib/components/TreeSelection.js.map +2 -2
- package/lib/components/calendar/Calendar.d.ts +5 -0
- package/lib/components/calendar/Calendar.js +15 -2
- package/lib/components/calendar/Calendar.js.map +2 -2
- package/lib/components/calendar/DaysView.d.ts +1 -0
- package/lib/components/calendar/DaysView.js +25 -13
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/components/calendar/MonthsView.d.ts +28 -0
- package/lib/components/calendar/MonthsView.js +79 -3
- package/lib/components/calendar/MonthsView.js.map +2 -2
- package/lib/components/calendar/QuartersView.d.ts +1 -0
- package/lib/components/calendar/QuartersView.js +2 -2
- package/lib/components/calendar/QuartersView.js.map +2 -2
- package/lib/components/calendar/TimeView.d.ts +5 -0
- package/lib/components/calendar/TimeView.js +8 -5
- package/lib/components/calendar/TimeView.js.map +2 -2
- package/lib/components/calendar/YearsView.js +6 -4
- package/lib/components/calendar/YearsView.js.map +2 -2
- package/lib/components/condition-builder/Field.js +1 -4
- package/lib/components/condition-builder/Field.js.map +2 -2
- package/lib/components/condition-builder/Func.js +1 -1
- package/lib/components/condition-builder/Func.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +563 -0
- package/lib/components/formula/Editor.js +187 -0
- package/lib/components/formula/Editor.js.map +13 -0
- package/lib/components/formula/FuncList.d.ts +67 -0
- package/lib/components/formula/FuncList.js +36 -0
- package/lib/components/formula/FuncList.js.map +13 -0
- package/lib/components/formula/Picker.d.ts +493 -0
- package/lib/components/formula/Picker.js +48 -0
- package/lib/components/formula/Picker.js.map +13 -0
- package/lib/components/formula/VariableList.d.ts +9 -0
- package/lib/components/formula/VariableList.js +15 -0
- package/lib/components/formula/VariableList.js.map +13 -0
- package/lib/components/formula/plugin.d.ts +18 -0
- package/lib/components/formula/plugin.js +136 -0
- package/lib/components/formula/plugin.js.map +13 -0
- package/lib/components/icons.js +4 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +4 -2
- package/lib/components/index.js.map +2 -2
- package/lib/components/virtual-list/SizeAndPositionManager.js.map +2 -2
- package/lib/components/virtual-list/index.js +1 -2
- package/lib/components/virtual-list/index.js.map +2 -2
- package/lib/factory.js +5 -0
- package/lib/factory.js.map +2 -2
- package/lib/helper.css +57 -57
- package/lib/helper.css.map +1 -1
- package/lib/icons/star.js +12 -0
- package/lib/icons/tree-down.js +7 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +13 -2
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +13 -2
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +12 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Avatar.d.ts +35 -26
- package/lib/renderers/Avatar.js +14 -19
- package/lib/renderers/Avatar.js.map +2 -2
- package/lib/renderers/CRUD.js +1 -2
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Card.js +6 -5
- package/lib/renderers/Card.js.map +2 -2
- package/lib/renderers/Custom.js.map +2 -2
- package/lib/renderers/Each.js +5 -2
- package/lib/renderers/Each.js.map +2 -2
- package/lib/renderers/Flex.js +1 -5
- package/lib/renderers/Flex.js.map +2 -2
- package/lib/renderers/Form/ChartRadios.js.map +2 -2
- package/lib/renderers/Form/Checkboxes.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.js +2 -1
- package/lib/renderers/Form/DiffEditor.js.map +2 -2
- package/lib/renderers/Form/InputCity.d.ts +84 -84
- package/lib/renderers/Form/InputColor.d.ts +84 -84
- package/lib/renderers/Form/InputColor.js +1 -1
- package/lib/renderers/Form/InputColor.js.map +2 -2
- package/lib/renderers/Form/InputDate.js +6 -4
- package/lib/renderers/Form/InputDate.js.map +2 -2
- package/lib/renderers/Form/InputDateRange.js +1 -1
- package/lib/renderers/Form/InputDateRange.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +38 -0
- package/lib/renderers/Form/InputFormula.js +25 -0
- package/lib/renderers/Form/InputFormula.js.map +13 -0
- package/lib/renderers/Form/InputImage.d.ts +1 -0
- package/lib/renderers/Form/InputImage.js +8 -4
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/InputMonthRange.js +1 -1
- package/lib/renderers/Form/InputMonthRange.js.map +2 -2
- package/lib/renderers/Form/InputQuarterRange.js +1 -1
- package/lib/renderers/Form/InputQuarterRange.js.map +2 -2
- package/lib/renderers/Form/InputRating.d.ts +37 -0
- package/lib/renderers/Form/InputRating.js +6 -2
- package/lib/renderers/Form/InputRating.js.map +2 -2
- package/lib/renderers/Form/InputYearRange.js +1 -1
- package/lib/renderers/Form/InputYearRange.js.map +2 -2
- package/lib/renderers/Form/Item.js +11 -4
- package/lib/renderers/Form/Item.js.map +2 -2
- package/lib/renderers/Form/NestedSelect.js +1 -1
- package/lib/renderers/Form/NestedSelect.js.map +2 -2
- package/lib/renderers/Form/Select.js +1 -1
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TabsTransfer.d.ts +5 -32
- package/lib/renderers/Form/TabsTransfer.js +20 -1
- package/lib/renderers/Form/TabsTransfer.js.map +2 -2
- package/lib/renderers/Form/TabsTransferPicker.d.ts +5 -35
- package/lib/renderers/Form/TabsTransferPicker.js +21 -2
- package/lib/renderers/Form/TabsTransferPicker.js.map +2 -2
- package/lib/renderers/Form/Transfer.d.ts +15 -4
- package/lib/renderers/Form/Transfer.js +55 -18
- package/lib/renderers/Form/Transfer.js.map +2 -2
- package/lib/renderers/Form/TransferPicker.d.ts +3 -32
- package/lib/renderers/Form/TransferPicker.js +1 -1
- package/lib/renderers/Form/TransferPicker.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +1 -0
- package/lib/renderers/Form/TreeSelect.js +11 -8
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.js +2 -1
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/IFrame.js +0 -2
- package/lib/renderers/IFrame.js.map +2 -2
- package/lib/renderers/Json.js +7 -0
- package/lib/renderers/Json.js.map +2 -2
- package/lib/renderers/Nav.js +4 -1
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/Remark.d.ts +4 -0
- package/lib/renderers/Remark.js +38 -7
- package/lib/renderers/Remark.js.map +2 -2
- package/lib/renderers/Steps.js +5 -5
- package/lib/renderers/Steps.js.map +2 -2
- package/lib/renderers/Table/TableRow.js +4 -1
- package/lib/renderers/Table/TableRow.js.map +2 -2
- package/lib/renderers/Table/index.js +4 -1
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tabs.js +1 -1
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/renderers/Timeline.d.ts +65 -0
- package/lib/renderers/Timeline.js +54 -0
- package/lib/renderers/Timeline.js.map +13 -0
- package/lib/renderers/Video.js.map +2 -2
- package/lib/store/combo.js.map +2 -2
- package/lib/store/formItem.js +6 -6
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/table.js +1 -1
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +952 -23
- package/lib/themes/ang.css +952 -23
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +987 -23
- package/lib/themes/antd.css +987 -23
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +991 -24
- package/lib/themes/cxd.css +991 -24
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +953 -23
- package/lib/themes/dark.css +953 -23
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +991 -24
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/RootClose.js +3 -1
- package/lib/utils/RootClose.js.map +2 -2
- package/lib/utils/api.js +2 -2
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/helper.d.ts +1 -1
- package/lib/utils/helper.js +1 -1
- package/lib/utils/helper.js.map +2 -2
- package/package.json +12 -3
- package/schema.json +1224 -671
- package/scss/_properties.scss +11 -1
- package/scss/_variables.scss +1 -1
- package/scss/components/_avatar.scss +27 -9
- package/scss/components/_calendar.scss +280 -0
- package/scss/components/_card.scss +1 -1
- package/scss/components/_collapse-group.scss +1 -3
- package/scss/components/_formula.scss +146 -0
- package/scss/components/_modal.scss +18 -0
- package/scss/components/_panel.scss +45 -0
- package/scss/components/_popup.scss +127 -0
- package/scss/components/_steps.scss +60 -0
- package/scss/components/_timeline.scss +198 -0
- package/scss/components/form/_color.scss +4 -0
- package/scss/components/form/_date-range.scss +4 -0
- package/scss/components/form/_date.scss +3 -0
- package/scss/components/form/_form.scss +168 -0
- package/scss/components/form/_rating.scss +60 -21
- package/scss/components/form/_result-list.scss +2 -0
- package/scss/components/form/_selection.scss +5 -4
- package/scss/components/form/_tree-select.scss +4 -0
- package/scss/helper/background/_background-color.scss +1 -1
- package/scss/helper/border/_border-color.scss +1 -1
- package/scss/helper/typography/_text-color.scss +1 -1
- package/scss/themes/_antd-variables.scss +42 -0
- package/scss/themes/_common.scss +3 -0
- package/scss/themes/_cxd-variables.scss +50 -1
- package/scss/themes/_dark-variables.scss +1 -0
- package/sdk/ang-ie11.css +1692 -19
- package/sdk/ang.css +1705 -24
- package/sdk/antd-ie11.css +1692 -19
- package/sdk/antd.css +1740 -24
- package/sdk/charts.js +17 -17
- package/sdk/codemirror.js +14 -0
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +3 -3
- package/sdk/cxd-ie11.css +1693 -20
- package/sdk/cxd.css +1744 -25
- package/sdk/dark-ie11.css +1693 -20
- package/sdk/dark.css +1706 -24
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css +57 -57
- package/sdk/helper.css.map +1 -1
- package/sdk/locale/de-DE.js +13 -2
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +18 -18
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +1693 -20
- package/sdk/sdk.css +1744 -25
- package/sdk/sdk.js +1235 -1275
- package/sdk/thirds/hls.js/hls.js +18 -18
- package/sdk/thirds/mpegts.js/mpegts.js +2 -2
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +4 -0
- package/src/components/AsideNav.tsx +1 -1
- package/src/components/AssociatedSelection.tsx +5 -1
- package/src/components/Avatar.tsx +253 -0
- package/src/components/BaiduMapPicker.tsx +19 -14
- package/src/components/CalendarMobile.tsx +563 -0
- package/src/components/Card.tsx +2 -2
- package/src/components/ChainedSelection.tsx +16 -3
- package/src/components/CodeMirror.tsx +99 -0
- package/src/components/Collapse.tsx +3 -2
- package/src/components/ColorPicker.tsx +43 -3
- package/src/components/DatePicker.tsx +44 -8
- package/src/components/DateRangePicker.tsx +64 -5
- package/src/components/GroupedSelection.tsx +14 -2
- package/src/components/MonthRangePicker.tsx +59 -5
- package/src/components/Overlay.tsx +1 -1
- package/src/components/Picker.tsx +41 -36
- package/src/components/PickerColumn.tsx +22 -25
- package/src/components/PickerContainer.tsx +23 -7
- package/src/components/PopUp.tsx +118 -0
- package/src/components/Rating.tsx +235 -47
- package/src/components/ResultBox.tsx +4 -1
- package/src/components/ResultList.tsx +36 -6
- package/src/components/Select.tsx +1 -1
- package/src/components/Selection.tsx +21 -3
- package/src/components/Steps.tsx +27 -9
- package/src/components/TableSelection.tsx +1 -44
- package/src/components/Tabs.tsx +65 -54
- package/src/components/TabsTransfer.tsx +78 -9
- package/src/components/TabsTransferPicker.tsx +25 -13
- package/src/components/Timeline.tsx +31 -0
- package/src/components/TimelineItem.tsx +107 -0
- package/src/components/Transfer.tsx +11 -8
- package/src/components/TransferDropDown.tsx +1 -7
- package/src/components/TransferPicker.tsx +25 -14
- package/src/components/TreeSelection.tsx +7 -1
- package/src/components/calendar/Calendar.tsx +26 -6
- package/src/components/calendar/DaysView.tsx +79 -31
- package/src/components/calendar/MonthsView.tsx +116 -2
- package/src/components/calendar/QuartersView.tsx +3 -2
- package/src/components/calendar/TimeView.tsx +26 -16
- package/src/components/calendar/YearsView.tsx +14 -16
- package/src/components/condition-builder/Field.tsx +1 -3
- package/src/components/condition-builder/Func.tsx +1 -1
- package/src/components/formula/Editor.tsx +266 -0
- package/src/components/formula/FuncList.tsx +84 -0
- package/src/components/formula/Picker.tsx +87 -0
- package/src/components/formula/VariableList.tsx +49 -0
- package/src/components/formula/plugin.ts +177 -0
- package/src/components/icons.tsx +4 -0
- package/src/components/index.tsx +2 -0
- package/src/components/virtual-list/SizeAndPositionManager.ts +6 -3
- package/src/components/virtual-list/index.tsx +4 -6
- package/src/factory.tsx +6 -0
- package/src/icons/star.svg +12 -0
- package/src/icons/tree-down.svg +5 -0
- package/src/index.tsx +2 -0
- package/src/locale/de-DE.ts +13 -2
- package/src/locale/en-US.ts +13 -2
- package/src/locale/zh-CN.ts +12 -1
- package/src/renderers/Avatar.tsx +83 -74
- package/src/renderers/CRUD.tsx +1 -3
- package/src/renderers/Card.tsx +10 -6
- package/src/renderers/Custom.tsx +6 -3
- package/src/renderers/Each.tsx +4 -4
- package/src/renderers/Flex.tsx +3 -7
- package/src/renderers/Form/ChartRadios.tsx +2 -7
- package/src/renderers/Form/Checkboxes.tsx +1 -1
- package/src/renderers/Form/DiffEditor.tsx +2 -3
- package/src/renderers/Form/InputColor.tsx +1 -2
- package/src/renderers/Form/InputDate.tsx +39 -18
- package/src/renderers/Form/InputDateRange.tsx +1 -0
- package/src/renderers/Form/InputFormula.tsx +80 -0
- package/src/renderers/Form/InputImage.tsx +9 -4
- package/src/renderers/Form/InputMonthRange.tsx +1 -0
- package/src/renderers/Form/InputQuarterRange.tsx +1 -0
- package/src/renderers/Form/InputRating.tsx +66 -3
- package/src/renderers/Form/InputYearRange.tsx +1 -0
- package/src/renderers/Form/Item.tsx +15 -4
- package/src/renderers/Form/NestedSelect.tsx +1 -1
- package/src/renderers/Form/Select.tsx +0 -1
- package/src/renderers/Form/TabsTransfer.tsx +28 -38
- package/src/renderers/Form/TabsTransferPicker.tsx +28 -46
- package/src/renderers/Form/Transfer.tsx +75 -24
- package/src/renderers/Form/TransferPicker.tsx +6 -38
- package/src/renderers/Form/TreeSelect.tsx +80 -63
- package/src/renderers/Form/index.tsx +2 -1
- package/src/renderers/IFrame.tsx +0 -2
- package/src/renderers/Json.tsx +5 -0
- package/src/renderers/Nav.tsx +4 -1
- package/src/renderers/Remark.tsx +67 -18
- package/src/renderers/Steps.tsx +13 -13
- package/src/renderers/Table/TableRow.tsx +3 -1
- package/src/renderers/Table/index.tsx +7 -1
- package/src/renderers/Tabs.tsx +6 -2
- package/src/renderers/Timeline.tsx +141 -0
- package/src/renderers/Video.tsx +4 -20
- package/src/store/combo.ts +1 -3
- package/src/store/formItem.ts +2 -2
- package/src/store/table.ts +2 -1
- package/src/utils/RootClose.ts +5 -1
- package/src/utils/api.ts +5 -2
- package/src/utils/helper.ts +1 -1
@@ -8,22 +8,33 @@ import React from 'react';
|
|
8
8
|
import cx from 'classnames';
|
9
9
|
import {ClassNamesFn, themeable} from '../theme';
|
10
10
|
|
11
|
+
import {isObject} from '../utils/helper';
|
12
|
+
import {Icon} from './icons';
|
13
|
+
|
14
|
+
export type textPositionType = 'left' | 'right';
|
15
|
+
|
11
16
|
interface RatingProps {
|
12
17
|
id?: string;
|
13
18
|
key?: string | number;
|
14
19
|
style?: React.CSSProperties;
|
15
20
|
count: number;
|
16
21
|
half: boolean;
|
17
|
-
char: string;
|
18
|
-
size: number;
|
22
|
+
char: string | React.ReactNode;
|
19
23
|
className?: string;
|
20
|
-
|
24
|
+
charClassName?: string;
|
25
|
+
textClassName?: string;
|
26
|
+
onChange?: (value: number) => void;
|
27
|
+
onHoverChange?: (value: number) => void;
|
21
28
|
value: number;
|
22
|
-
containerClass
|
29
|
+
containerClass?: string;
|
23
30
|
readOnly: boolean;
|
24
31
|
classPrefix: string;
|
25
32
|
disabled?: boolean;
|
26
33
|
allowClear?: boolean;
|
34
|
+
inactiveColor?: string;
|
35
|
+
colors?: string | {[propName: string]: string};
|
36
|
+
texts?: {[propName: string]: string};
|
37
|
+
textPosition?: textPositionType;
|
27
38
|
classnames: ClassNamesFn;
|
28
39
|
}
|
29
40
|
|
@@ -35,13 +46,22 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
35
46
|
allowClear: true,
|
36
47
|
value: 0,
|
37
48
|
count: 5,
|
38
|
-
char:
|
39
|
-
|
49
|
+
char: <Icon icon="star" className="icon" />,
|
50
|
+
colors: {
|
51
|
+
'2': '#abadb1',
|
52
|
+
'3': '#787b81',
|
53
|
+
'5': '#ffa900'
|
54
|
+
},
|
55
|
+
textPosition: 'right' as textPositionType
|
40
56
|
};
|
41
57
|
|
58
|
+
starsNode: Record<string, any>;
|
59
|
+
|
42
60
|
constructor(props: RatingProps) {
|
43
61
|
super(props);
|
44
62
|
|
63
|
+
this.starsNode = {};
|
64
|
+
|
45
65
|
this.state = {
|
46
66
|
value: props.value || 0,
|
47
67
|
stars: [],
|
@@ -49,7 +69,10 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
49
69
|
halfStar: {
|
50
70
|
at: Math.floor(props.value),
|
51
71
|
hidden: props.half && props.value % 1 < 0.5
|
52
|
-
}
|
72
|
+
},
|
73
|
+
showColor: '',
|
74
|
+
showText: null,
|
75
|
+
hoverValue: null
|
53
76
|
};
|
54
77
|
|
55
78
|
this.getRate = this.getRate.bind(this);
|
@@ -58,6 +81,8 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
58
81
|
this.mouseOver = this.mouseOver.bind(this);
|
59
82
|
this.mouseLeave = this.mouseLeave.bind(this);
|
60
83
|
this.handleClick = this.handleClick.bind(this);
|
84
|
+
this.saveRef = this.saveRef.bind(this);
|
85
|
+
this.handleStarMouseLeave = this.handleStarMouseLeave.bind(this);
|
61
86
|
}
|
62
87
|
|
63
88
|
componentDidMount() {
|
@@ -65,6 +90,8 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
65
90
|
this.setState({
|
66
91
|
stars: this.getStars(value)
|
67
92
|
});
|
93
|
+
|
94
|
+
this.getShowColorAndText(value);
|
68
95
|
}
|
69
96
|
|
70
97
|
componentDidUpdate(prevProps: RatingProps) {
|
@@ -82,6 +109,55 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
82
109
|
}
|
83
110
|
}
|
84
111
|
|
112
|
+
sortKeys(map: {[propName: number]: string}) {
|
113
|
+
return Object.keys(map).sort(
|
114
|
+
(a: number | string, b: number | string) => Number(a) - Number(b)
|
115
|
+
);
|
116
|
+
}
|
117
|
+
|
118
|
+
getShowColorAndText(value: number) {
|
119
|
+
const {colors, texts, half} = this.props;
|
120
|
+
|
121
|
+
if (!value)
|
122
|
+
return this.setState({
|
123
|
+
showText: null
|
124
|
+
});
|
125
|
+
|
126
|
+
// 对 value 取整
|
127
|
+
if (half) {
|
128
|
+
value = Math.floor(Number(value) * 2) / 2;
|
129
|
+
} else {
|
130
|
+
value = Math.floor(value);
|
131
|
+
}
|
132
|
+
|
133
|
+
if (colors && typeof colors !== 'string') {
|
134
|
+
const keys: string[] = this.sortKeys(colors);
|
135
|
+
const showKey = keys.filter(item => Number(item) < value).length;
|
136
|
+
|
137
|
+
const showColor = keys[showKey] !== undefined && colors[keys[showKey]];
|
138
|
+
showColor &&
|
139
|
+
this.setState({
|
140
|
+
showColor
|
141
|
+
});
|
142
|
+
} else if (colors && typeof colors === 'string') {
|
143
|
+
this.setState({
|
144
|
+
showColor: colors
|
145
|
+
});
|
146
|
+
}
|
147
|
+
|
148
|
+
if (texts && isObject(texts)) {
|
149
|
+
const keys: string[] = this.sortKeys(texts);
|
150
|
+
const showKey = keys.filter(item => Number(item) < value).length;
|
151
|
+
const showText =
|
152
|
+
keys[showKey] !== undefined &&
|
153
|
+
texts[keys[showKey] as keyof typeof texts];
|
154
|
+
showText &&
|
155
|
+
this.setState({
|
156
|
+
showText
|
157
|
+
});
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
85
161
|
getRate() {
|
86
162
|
let stars;
|
87
163
|
const {value} = this.state;
|
@@ -108,14 +184,28 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
108
184
|
return stars;
|
109
185
|
}
|
110
186
|
|
111
|
-
|
187
|
+
saveRef(index: number) {
|
188
|
+
return (node: React.ReactNode) => {
|
189
|
+
this.starsNode[String(index)] = node;
|
190
|
+
};
|
191
|
+
}
|
192
|
+
|
193
|
+
mouseOver(event: React.ChangeEvent<any>, index: number) {
|
112
194
|
const {isClear} = this.state;
|
113
195
|
if (isClear) return;
|
114
|
-
|
196
|
+
|
197
|
+
const {readOnly, half} = this.props;
|
198
|
+
|
115
199
|
if (readOnly) return;
|
116
|
-
|
200
|
+
|
117
201
|
if (half) {
|
118
|
-
const isAtHalf = this.moreThanHalf(event,
|
202
|
+
const isAtHalf = this.moreThanHalf(event, index);
|
203
|
+
|
204
|
+
const tmpValue = isAtHalf ? index + 1 : index + 0.5;
|
205
|
+
|
206
|
+
this.getShowColorAndText(tmpValue);
|
207
|
+
this.onHoverChange(tmpValue);
|
208
|
+
|
119
209
|
if (isAtHalf) index = index + 1;
|
120
210
|
this.setState({
|
121
211
|
halfStar: {
|
@@ -125,24 +215,43 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
125
215
|
});
|
126
216
|
} else {
|
127
217
|
index = index + 1;
|
218
|
+
this.onHoverChange(index);
|
219
|
+
this.getShowColorAndText(index);
|
128
220
|
}
|
129
221
|
this.setState({
|
130
222
|
stars: this.getStars(index)
|
131
223
|
});
|
132
224
|
}
|
133
225
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
226
|
+
onHoverChange(value: number) {
|
227
|
+
const {onHoverChange} = this.props;
|
228
|
+
const {hoverValue} = this.state;
|
229
|
+
|
230
|
+
if (!hoverValue || (hoverValue && hoverValue !== value)) {
|
231
|
+
this.setState({
|
232
|
+
hoverValue: value
|
233
|
+
});
|
234
|
+
onHoverChange && onHoverChange(value);
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
moreThanHalf(event: any, index: number) {
|
239
|
+
const star = this.starsNode[index];
|
240
|
+
const leftPos = star.getBoundingClientRect().left;
|
241
|
+
|
242
|
+
return event.clientX - leftPos > star.clientWidth / 2;
|
139
243
|
}
|
140
244
|
|
141
245
|
mouseLeave() {
|
142
246
|
const {value, isClear} = this.state;
|
143
247
|
const {half, readOnly} = this.props;
|
144
248
|
if (readOnly) return;
|
145
|
-
if (isClear)
|
249
|
+
if (isClear)
|
250
|
+
return this.setState({
|
251
|
+
isClear: false,
|
252
|
+
hoverValue: null
|
253
|
+
});
|
254
|
+
|
146
255
|
if (half) {
|
147
256
|
this.setState({
|
148
257
|
halfStar: {
|
@@ -152,18 +261,39 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
152
261
|
});
|
153
262
|
}
|
154
263
|
this.setState({
|
155
|
-
stars: this.getStars()
|
264
|
+
stars: this.getStars(),
|
265
|
+
hoverValue: null
|
156
266
|
});
|
267
|
+
this.getShowColorAndText(value);
|
157
268
|
}
|
158
269
|
|
159
|
-
|
160
|
-
const
|
270
|
+
handleStarMouseLeave(event: any, index: number) {
|
271
|
+
const star = this.starsNode[index];
|
272
|
+
const leftSideX = star.getBoundingClientRect().left;
|
273
|
+
const {isClear} = this.state;
|
274
|
+
|
275
|
+
if (isClear) return this.setState({isClear: false});
|
276
|
+
|
277
|
+
// leave star from left side
|
278
|
+
if (event.clientX <= leftSideX) {
|
279
|
+
this.getShowColorAndText(index);
|
280
|
+
this.setState({
|
281
|
+
stars: this.getStars(index),
|
282
|
+
halfStar: {
|
283
|
+
at: index,
|
284
|
+
hidden: true
|
285
|
+
}
|
286
|
+
});
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
handleClick(event: React.ChangeEvent<any>, index: number) {
|
291
|
+
const {half, readOnly, onChange, allowClear} = this.props;
|
161
292
|
if (readOnly) return;
|
162
|
-
let index = Number(event.target.getAttribute('data-index'));
|
163
293
|
|
164
294
|
let value;
|
165
295
|
if (half) {
|
166
|
-
const isAtHalf = this.moreThanHalf(event,
|
296
|
+
const isAtHalf = this.moreThanHalf(event, index);
|
167
297
|
if (isAtHalf) index = index + 1;
|
168
298
|
value = isAtHalf ? index : index + 0.5;
|
169
299
|
this.setState({
|
@@ -183,41 +313,99 @@ export class Rating extends React.Component<RatingProps, any> {
|
|
183
313
|
stars: this.getStars(index),
|
184
314
|
isClear
|
185
315
|
});
|
316
|
+
|
317
|
+
this.getShowColorAndText(value);
|
318
|
+
|
186
319
|
onChange && onChange(value);
|
187
320
|
}
|
188
321
|
|
189
322
|
renderStars() {
|
190
|
-
const {halfStar, stars} = this.state;
|
191
|
-
const {
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
323
|
+
const {halfStar, stars, showColor} = this.state;
|
324
|
+
const {
|
325
|
+
inactiveColor,
|
326
|
+
char,
|
327
|
+
half,
|
328
|
+
disabled,
|
329
|
+
readOnly,
|
330
|
+
charClassName,
|
331
|
+
classnames: cx
|
332
|
+
} = this.props;
|
198
333
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
334
|
+
return (
|
335
|
+
<ul onMouseLeave={this.mouseLeave}>
|
336
|
+
{stars.map((star: any, i: number) => {
|
337
|
+
const isThisHalf = half && !halfStar.hidden && halfStar.at === i;
|
338
|
+
|
339
|
+
return (
|
340
|
+
<li
|
341
|
+
ref={this.saveRef(i)}
|
342
|
+
className={cx('Rating-star', charClassName, {
|
343
|
+
'is-half': isThisHalf,
|
344
|
+
'is-active': star.active,
|
345
|
+
'is-disabled': readOnly || disabled
|
346
|
+
})}
|
347
|
+
key={i}
|
348
|
+
style={{
|
349
|
+
color: star.active ? showColor : inactiveColor
|
350
|
+
}}
|
351
|
+
onMouseOver={e => this.mouseOver(e, i)}
|
352
|
+
onMouseMove={e => this.mouseOver(e, i)}
|
353
|
+
onClick={e => this.handleClick(e, i)}
|
354
|
+
onMouseLeave={e => this.handleStarMouseLeave(e, i)}
|
355
|
+
>
|
356
|
+
{isThisHalf && (
|
357
|
+
<div
|
358
|
+
className={cx('Rating-star-half')}
|
359
|
+
style={{
|
360
|
+
color: showColor
|
361
|
+
}}
|
362
|
+
>
|
363
|
+
{char}
|
364
|
+
</div>
|
365
|
+
)}
|
366
|
+
{char}
|
367
|
+
</li>
|
368
|
+
);
|
369
|
+
})}
|
370
|
+
</ul>
|
371
|
+
);
|
372
|
+
}
|
373
|
+
|
374
|
+
renderText() {
|
375
|
+
const {showText} = this.state;
|
376
|
+
const {textClassName, textPosition, classnames: cx} = this.props;
|
377
|
+
|
378
|
+
if (!showText) return null;
|
379
|
+
|
380
|
+
return (
|
381
|
+
<span
|
382
|
+
className={cx('Rating-text', textClassName, {
|
383
|
+
[`Rating-text--${textPosition === 'left' ? 'left' : 'right'}`]:
|
384
|
+
textPosition
|
385
|
+
})}
|
386
|
+
>
|
387
|
+
{showText}
|
388
|
+
</span>
|
389
|
+
);
|
214
390
|
}
|
215
391
|
|
216
392
|
render() {
|
217
|
-
|
393
|
+
const {className, textPosition, classnames: cx} = this.props;
|
218
394
|
|
219
395
|
return (
|
220
|
-
<div className={cx(
|
396
|
+
<div className={cx('Rating', className)}>
|
397
|
+
{textPosition === 'left' ? (
|
398
|
+
<>
|
399
|
+
{this.renderText()}
|
400
|
+
{this.renderStars()}
|
401
|
+
</>
|
402
|
+
) : (
|
403
|
+
<>
|
404
|
+
{this.renderStars()}
|
405
|
+
{this.renderText()}
|
406
|
+
</>
|
407
|
+
)}
|
408
|
+
</div>
|
221
409
|
);
|
222
410
|
}
|
223
411
|
}
|
@@ -6,6 +6,7 @@ import {Icon} from './icons';
|
|
6
6
|
import Input from './Input';
|
7
7
|
import {autobind, ucFirst} from '../utils/helper';
|
8
8
|
import {LocaleProps, localeable} from '../locale';
|
9
|
+
import isPlainObject = require('lodash/isPlainObject');
|
9
10
|
|
10
11
|
export interface ResultBoxProps
|
11
12
|
extends ThemeProps,
|
@@ -147,7 +148,9 @@ export class ResultBox extends React.Component<ResultBoxProps> {
|
|
147
148
|
</div>
|
148
149
|
))
|
149
150
|
) : result && !Array.isArray(result) ? (
|
150
|
-
<span className={cx('ResultBox-singleValue')}>
|
151
|
+
<span className={cx('ResultBox-singleValue')}>
|
152
|
+
{isPlainObject(result) ? itemRender(result) : result}
|
153
|
+
</span>
|
151
154
|
) : allowInput && !disabled ? null : (
|
152
155
|
<span className={cx('ResultBox-placeholder')}>
|
153
156
|
{__(placeholder || 'placeholder.noData')}
|
@@ -13,21 +13,28 @@ import {LocaleProps, localeable} from '../locale';
|
|
13
13
|
export interface ResultListProps extends ThemeProps, LocaleProps {
|
14
14
|
className?: string;
|
15
15
|
value?: Array<Option>;
|
16
|
-
onChange?: (value: Array<Option
|
16
|
+
onChange?: (value: Array<Option>, optionModified?: boolean) => void;
|
17
17
|
sortable?: boolean;
|
18
18
|
disabled?: boolean;
|
19
19
|
title?: string;
|
20
20
|
placeholder: string;
|
21
|
-
itemRender: (option: Option) => JSX.Element;
|
21
|
+
itemRender: (option: Option, states: ItemRenderStates) => JSX.Element;
|
22
22
|
itemClassName?: string;
|
23
23
|
}
|
24
24
|
|
25
|
+
export interface ItemRenderStates {
|
26
|
+
index: number;
|
27
|
+
disabled?: boolean;
|
28
|
+
onChange: (value: any, name: string) => void;
|
29
|
+
}
|
30
|
+
|
25
31
|
export class ResultList extends React.Component<ResultListProps> {
|
32
|
+
static itemRender(option: any) {
|
33
|
+
return <span>{`${option.scopeLabel || ''}${option.label}`}</span>;
|
34
|
+
}
|
26
35
|
static defaultProps: Pick<ResultListProps, 'placeholder' | 'itemRender'> = {
|
27
36
|
placeholder: 'placeholder.selectData',
|
28
|
-
itemRender:
|
29
|
-
<span>{`${option.scopeLabel || ''}${option.label}`}</span>
|
30
|
-
)
|
37
|
+
itemRender: ResultList.itemRender
|
31
38
|
};
|
32
39
|
|
33
40
|
id = guid();
|
@@ -114,6 +121,23 @@ export class ResultList extends React.Component<ResultListProps> {
|
|
114
121
|
delete this.sortable;
|
115
122
|
}
|
116
123
|
|
124
|
+
handleValueChange(index: number, value: any, name: string) {
|
125
|
+
if (typeof name !== 'string') {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
const {value: list, onChange} = this.props;
|
129
|
+
|
130
|
+
const result = Array.isArray(list) ? list.concat() : [];
|
131
|
+
if (!result[index]) {
|
132
|
+
return;
|
133
|
+
}
|
134
|
+
result.splice(index, 1, {
|
135
|
+
...result[index],
|
136
|
+
[name]: value
|
137
|
+
});
|
138
|
+
onChange?.(result, true);
|
139
|
+
}
|
140
|
+
|
117
141
|
render() {
|
118
142
|
const {
|
119
143
|
classnames: cx,
|
@@ -150,7 +174,13 @@ export class ResultList extends React.Component<ResultListProps> {
|
|
150
174
|
/>
|
151
175
|
) : null}
|
152
176
|
|
153
|
-
<label>
|
177
|
+
<label>
|
178
|
+
{itemRender(option, {
|
179
|
+
index,
|
180
|
+
disabled,
|
181
|
+
onChange: this.handleValueChange.bind(this, index)
|
182
|
+
})}
|
183
|
+
</label>
|
154
184
|
|
155
185
|
{!disabled ? (
|
156
186
|
<a
|
@@ -926,7 +926,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
|
926
926
|
const menu = mobileUI ? (
|
927
927
|
<Picker
|
928
928
|
className={cx('PickerColumns-column', mobileClassName)}
|
929
|
-
labelField=
|
929
|
+
labelField="label"
|
930
930
|
value={value[0]}
|
931
931
|
translate={this.props.translate}
|
932
932
|
locale={this.props.locale}
|
@@ -29,18 +29,30 @@ export interface BaseSelectionProps extends ThemeProps, LocaleProps {
|
|
29
29
|
labelClassName?: string;
|
30
30
|
option2value?: (option: Option) => any;
|
31
31
|
itemClassName?: string;
|
32
|
-
itemRender: (option: Option) => JSX.Element;
|
32
|
+
itemRender: (option: Option, states: ItemRenderStates) => JSX.Element;
|
33
33
|
disabled?: boolean;
|
34
34
|
onClick?: (e: React.MouseEvent) => void;
|
35
35
|
}
|
36
36
|
|
37
|
+
export interface ItemRenderStates {
|
38
|
+
index: number;
|
39
|
+
multiple?: boolean;
|
40
|
+
checked: boolean;
|
41
|
+
onChange: () => void;
|
42
|
+
disabled?: boolean;
|
43
|
+
}
|
44
|
+
|
37
45
|
export class BaseSelection<
|
38
46
|
T extends BaseSelectionProps = BaseSelectionProps,
|
39
47
|
S = any
|
40
48
|
> extends React.Component<T, S> {
|
49
|
+
static itemRender(option: Option, states: ItemRenderStates) {
|
50
|
+
return <span>{option.label}</span>;
|
51
|
+
}
|
52
|
+
|
41
53
|
static defaultProps = {
|
42
54
|
placeholder: 'placeholder.noOption',
|
43
|
-
itemRender:
|
55
|
+
itemRender: BaseSelection.itemRender,
|
44
56
|
multiple: true,
|
45
57
|
clearable: false
|
46
58
|
};
|
@@ -182,7 +194,13 @@ export class BaseSelection<
|
|
182
194
|
labelClassName={labelClassName}
|
183
195
|
description={option.description}
|
184
196
|
>
|
185
|
-
{itemRender(option
|
197
|
+
{itemRender(option, {
|
198
|
+
index: key,
|
199
|
+
multiple: multiple,
|
200
|
+
checked: !!~valueArray.indexOf(option),
|
201
|
+
onChange: () => this.toggleOption(option),
|
202
|
+
disabled: disabled || option.disabled
|
203
|
+
})}
|
186
204
|
</Checkbox>
|
187
205
|
));
|
188
206
|
}
|
package/src/components/Steps.tsx
CHANGED
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import {themeable, ThemeProps} from '../theme';
|
3
3
|
import {Icon} from './icons';
|
4
4
|
import {BaseSchema} from '../Schema';
|
5
|
+
import {isMobile} from '../utils/helper';
|
5
6
|
|
6
7
|
export enum StepStatus {
|
7
8
|
wait = 'wait',
|
@@ -62,7 +63,7 @@ export interface StepsSchema extends BaseSchema {
|
|
62
63
|
*/
|
63
64
|
name?: string;
|
64
65
|
|
65
|
-
status: StepStatus
|
66
|
+
status: StepStatus;
|
66
67
|
|
67
68
|
/**
|
68
69
|
* 展示模式
|
@@ -74,10 +75,13 @@ export interface StepsProps extends ThemeProps {
|
|
74
75
|
steps: StepSchema[];
|
75
76
|
className: string;
|
76
77
|
current: number;
|
77
|
-
status?:
|
78
|
-
|
79
|
-
|
78
|
+
status?:
|
79
|
+
| StepStatus
|
80
|
+
| {
|
81
|
+
[propName: string]: StepStatus;
|
82
|
+
};
|
80
83
|
mode?: 'horizontal' | 'vertical';
|
84
|
+
useMobileUI?: boolean;
|
81
85
|
}
|
82
86
|
|
83
87
|
export function Steps(props: StepsProps) {
|
@@ -87,7 +91,8 @@ export function Steps(props: StepsProps) {
|
|
87
91
|
className,
|
88
92
|
current,
|
89
93
|
status,
|
90
|
-
mode = 'horizontal'
|
94
|
+
mode = 'horizontal',
|
95
|
+
useMobileUI
|
91
96
|
} = props;
|
92
97
|
const FINISH_ICON = 'check';
|
93
98
|
const ERROR_ICON = 'close';
|
@@ -122,8 +127,16 @@ export function Steps(props: StepsProps) {
|
|
122
127
|
};
|
123
128
|
}
|
124
129
|
|
130
|
+
const mobileUI = useMobileUI && isMobile();
|
125
131
|
return (
|
126
|
-
<ul
|
132
|
+
<ul
|
133
|
+
className={cx(
|
134
|
+
'Steps',
|
135
|
+
`Steps--${mode}`,
|
136
|
+
mobileUI ? 'Steps-mobile' : '',
|
137
|
+
className
|
138
|
+
)}
|
139
|
+
>
|
127
140
|
{stepsRow.map((step, i) => {
|
128
141
|
const {stepStatus, icon} = getStepStatus(step, i);
|
129
142
|
|
@@ -133,7 +146,12 @@ export function Steps(props: StepsProps) {
|
|
133
146
|
className={cx('StepsItem', `is-${stepStatus}`, step.className)}
|
134
147
|
>
|
135
148
|
<div className={cx('StepsItem-container')}>
|
136
|
-
<div
|
149
|
+
<div
|
150
|
+
className={cx(
|
151
|
+
'StepsItem-containerIcon',
|
152
|
+
i < current && 'is-success'
|
153
|
+
)}
|
154
|
+
>
|
137
155
|
<span className={cx('StepsItem-icon')}>
|
138
156
|
{icon ? <Icon icon={icon} className="icon" /> : i + 1}
|
139
157
|
</span>
|
@@ -161,7 +179,7 @@ export function Steps(props: StepsProps) {
|
|
161
179
|
);
|
162
180
|
})}
|
163
181
|
</ul>
|
164
|
-
)
|
182
|
+
);
|
165
183
|
}
|
166
184
|
|
167
|
-
export default themeable(Steps);
|
185
|
+
export default themeable(Steps);
|
@@ -153,50 +153,7 @@ export class TableSelection extends BaseSelection<TableSelectionProps> {
|
|
153
153
|
}
|
154
154
|
|
155
155
|
render() {
|
156
|
-
const {
|
157
|
-
value,
|
158
|
-
options,
|
159
|
-
className,
|
160
|
-
labelClassName,
|
161
|
-
disabled,
|
162
|
-
classnames: cx,
|
163
|
-
option2value,
|
164
|
-
itemClassName,
|
165
|
-
itemRender,
|
166
|
-
multiple
|
167
|
-
} = this.props;
|
168
|
-
|
169
|
-
let valueArray = BaseSelection.value2array(value, options, option2value);
|
170
|
-
let body: Array<React.ReactNode> = [];
|
171
|
-
|
172
|
-
if (Array.isArray(options) && options.length) {
|
173
|
-
body = options.map((option, key) => (
|
174
|
-
<div
|
175
|
-
key={key}
|
176
|
-
className={cx(
|
177
|
-
'TableSelection-item',
|
178
|
-
itemClassName,
|
179
|
-
option.className,
|
180
|
-
disabled || option.disabled ? 'is-disabled' : ''
|
181
|
-
)}
|
182
|
-
onClick={() => this.toggleOption(option)}
|
183
|
-
>
|
184
|
-
<div className={cx('TableSelection-itemLabel')}>
|
185
|
-
{itemRender(option)}
|
186
|
-
</div>
|
187
|
-
|
188
|
-
{multiple ? (
|
189
|
-
<Checkbox
|
190
|
-
size="sm"
|
191
|
-
checked={!!~valueArray.indexOf(option)}
|
192
|
-
disabled={disabled || option.disabled}
|
193
|
-
labelClassName={labelClassName}
|
194
|
-
description={option.description}
|
195
|
-
/>
|
196
|
-
) : null}
|
197
|
-
</div>
|
198
|
-
));
|
199
|
-
}
|
156
|
+
const {className, classnames: cx} = this.props;
|
200
157
|
|
201
158
|
return (
|
202
159
|
<div className={cx('TableSelection', className)}>
|