amis 1.4.0 → 1.4.2-beta.12
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 +26 -2
- 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/AnchorNav.d.ts +22 -21
- package/lib/components/AnchorNav.js +7 -3
- package/lib/components/AnchorNav.js.map +2 -2
- package/lib/components/ArrayInput.d.ts +84 -84
- package/lib/components/AssociatedSelection.d.ts +930 -0
- package/lib/components/AssociatedSelection.js +89 -0
- package/lib/components/AssociatedSelection.js.map +13 -0
- package/lib/components/Badge.d.ts +4 -3
- package/lib/components/Badge.js +42 -7
- package/lib/components/Badge.js.map +2 -2
- package/lib/components/Button.d.ts +24 -22
- package/lib/components/Button.js +13 -7
- package/lib/components/Button.js.map +2 -2
- package/lib/components/{ChainedCheckboxes.d.ts → ChainedSelection.d.ts} +267 -98
- package/lib/components/{ChainedCheckboxes.js → ChainedSelection.js} +30 -24
- package/lib/components/ChainedSelection.js.map +13 -0
- package/lib/components/Collapse.js +1 -1
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/ColorPicker.d.ts +84 -84
- package/lib/components/DatePicker.d.ts +84 -84
- package/lib/components/DatePicker.js +1 -1
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +84 -84
- package/lib/components/DateRangePicker.js +1 -1
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/Editor.d.ts +84 -84
- package/lib/components/GroupedSelection.d.ts +907 -0
- package/lib/components/GroupedSelection.js +48 -0
- package/lib/components/GroupedSelection.js.map +13 -0
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Link.d.ts +84 -0
- package/lib/components/Link.js +43 -0
- package/lib/components/Link.js.map +13 -0
- package/lib/components/ListGroup.d.ts +21 -21
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/ModalManager.js.map +2 -2
- package/lib/components/MonthRangePicker.d.ts +84 -84
- package/lib/components/MonthRangePicker.js +1 -1
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/NumberInput.d.ts +20 -20
- package/lib/components/PickerColumn.d.ts +514 -0
- package/lib/components/PickerColumn.js +279 -0
- package/lib/components/PickerColumn.js.map +13 -0
- package/lib/components/PickerContainer.d.ts +513 -0
- package/lib/components/PickerContainer.js +96 -0
- package/lib/components/PickerContainer.js.map +13 -0
- package/lib/components/Radios.d.ts +22 -21
- package/lib/components/Radios.js +1 -0
- package/lib/components/Radios.js.map +2 -2
- package/lib/components/Rating.d.ts +21 -21
- package/lib/components/ResultBox.d.ts +84 -84
- package/lib/components/RichText.d.ts +6 -1
- package/lib/components/RichText.js +207 -8
- package/lib/components/RichText.js.map +2 -2
- package/lib/components/SearchBox.d.ts +84 -84
- package/lib/components/SearchBox.js +4 -4
- package/lib/components/SearchBox.js.map +2 -2
- package/lib/components/Select.d.ts +245 -237
- package/lib/components/Select.js +28 -4
- package/lib/components/Select.js.map +2 -2
- package/lib/components/{Checkboxes.d.ts → Selection.d.ts} +273 -98
- package/lib/components/Selection.js +134 -0
- package/lib/components/Selection.js.map +13 -0
- 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/{TableCheckboxes.d.ts → TableSelection.d.ts} +266 -96
- package/lib/components/{TableCheckboxes.js → TableSelection.js} +30 -30
- package/lib/components/TableSelection.js.map +13 -0
- package/lib/components/Tabs.d.ts +20 -20
- package/lib/components/TabsTransfer.d.ts +84 -84
- package/lib/components/TabsTransfer.js +9 -9
- package/lib/components/TabsTransfer.js.map +2 -2
- package/lib/components/TabsTransferPicker.d.ts +489 -0
- package/lib/components/TabsTransferPicker.js +60 -0
- package/lib/components/TabsTransferPicker.js.map +13 -0
- package/lib/components/Toast.js +2 -2
- package/lib/components/Toast.js.map +2 -2
- package/lib/components/Transfer.d.ts +908 -274
- package/lib/components/Transfer.js +31 -24
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +487 -0
- package/lib/components/TransferDropDown.js +59 -0
- package/lib/components/TransferDropDown.js.map +13 -0
- package/lib/components/TransferPicker.d.ts +489 -0
- package/lib/components/TransferPicker.js +60 -0
- package/lib/components/TransferPicker.js.map +13 -0
- package/lib/components/Tree.d.ts +84 -84
- package/lib/components/Tree.js +5 -3
- package/lib/components/Tree.js.map +2 -2
- package/lib/components/{TreeCheckboxes.d.ts → TreeSelection.d.ts} +269 -99
- package/lib/components/{TreeCheckboxes.js → TreeSelection.js} +36 -32
- package/lib/components/TreeSelection.js.map +13 -0
- package/lib/components/WithRemoteConfig.js +1 -1
- package/lib/components/WithRemoteConfig.js.map +2 -2
- package/lib/components/calendar/DaysView.js +2 -2
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/components/condition-builder/Field.js +5 -2
- package/lib/components/condition-builder/Field.js.map +2 -2
- package/lib/components/condition-builder/Func.js +2 -2
- package/lib/components/condition-builder/Func.js.map +2 -2
- package/lib/components/condition-builder/InputSwitch.js +2 -2
- package/lib/components/condition-builder/InputSwitch.js.map +2 -2
- package/lib/components/condition-builder/Item.js +3 -3
- package/lib/components/condition-builder/Item.js.map +2 -2
- package/lib/components/icons.js +14 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +8 -8
- package/lib/components/index.js +16 -16
- package/lib/components/index.js.map +2 -2
- package/lib/envOverwrite.js.map +2 -2
- package/lib/factory.d.ts +4 -0
- package/lib/factory.js +4 -2
- package/lib/factory.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.js +14 -0
- package/lib/hooks/index.js.map +13 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-set-state.js +15 -0
- package/lib/hooks/use-set-state.js.map +13 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-touch.js +73 -0
- package/lib/hooks/use-touch.js.map +13 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +17 -0
- package/lib/hooks/use-update-effect.js.map +13 -0
- package/lib/icons/clock.js +10 -0
- package/lib/icons/loading-outline.js +7 -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.d.ts +3 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +4 -0
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +4 -0
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +7 -3
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +17 -1
- package/lib/renderers/Action.js +21 -8
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/AnchorNav.d.ts +1 -0
- package/lib/renderers/AnchorNav.js +2 -2
- package/lib/renderers/AnchorNav.js.map +2 -2
- package/lib/renderers/Avatar.js +3 -3
- package/lib/renderers/Avatar.js.map +2 -2
- package/lib/renderers/Breadcrumb.js +1 -1
- package/lib/renderers/Breadcrumb.js.map +2 -2
- package/lib/renderers/CRUD.d.ts +9 -0
- package/lib/renderers/CRUD.js +43 -8
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Card.d.ts +4 -0
- package/lib/renderers/Card.js +29 -23
- package/lib/renderers/Card.js.map +2 -2
- package/lib/renderers/Chart.js +1 -1
- package/lib/renderers/Chart.js.map +2 -2
- package/lib/renderers/Collapse.js +3 -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 +9 -1
- package/lib/renderers/DropDownButton.js +8 -4
- 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/DiffEditor.d.ts +4 -3
- package/lib/renderers/Form/Editor.d.ts +3 -2
- package/lib/renderers/Form/InputCity.d.ts +84 -84
- package/lib/renderers/Form/InputCity.js +7 -6
- package/lib/renderers/Form/InputCity.js.map +2 -2
- package/lib/renderers/Form/InputColor.d.ts +84 -84
- package/lib/renderers/Form/InputFile.js +12 -6
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputImage.js +16 -7
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +1 -1
- package/lib/renderers/Form/Item.js.map +1 -1
- package/lib/renderers/Form/Options.js +19 -6
- 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/Select.d.ts +41 -4
- package/lib/renderers/Form/Select.js +37 -3
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TabsTransferPicker.d.ts +48 -0
- package/lib/renderers/Form/TabsTransferPicker.js +29 -0
- package/lib/renderers/Form/TabsTransferPicker.js.map +13 -0
- package/lib/renderers/Form/Transfer.js +18 -3
- package/lib/renderers/Form/Transfer.js.map +2 -2
- package/lib/renderers/Form/TransferPicker.d.ts +48 -0
- package/lib/renderers/Form/TransferPicker.js +43 -0
- package/lib/renderers/Form/TransferPicker.js.map +13 -0
- package/lib/renderers/Form/TreeSelect.js +2 -2
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.d.ts +5 -0
- package/lib/renderers/Form/index.js +5 -3
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +15 -3
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/IFrame.js +3 -5
- 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/Json.d.ts +4 -0
- package/lib/renderers/Json.js +4 -13
- package/lib/renderers/Json.js.map +2 -2
- package/lib/renderers/Link.d.ts +18 -3
- package/lib/renderers/Link.js +27 -15
- package/lib/renderers/Link.js.map +2 -2
- package/lib/renderers/List.js +1 -1
- package/lib/renderers/List.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/Mapping.d.ts +9 -2
- package/lib/renderers/Mapping.js +18 -6
- package/lib/renderers/Mapping.js.map +2 -2
- package/lib/renderers/Nav.d.ts +81 -25
- package/lib/renderers/Nav.js +292 -31
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/Page.js +1 -1
- package/lib/renderers/Page.js.map +2 -2
- package/lib/renderers/Portlet.d.ts +125 -0
- package/lib/renderers/Portlet.js +156 -0
- package/lib/renderers/Portlet.js.map +13 -0
- package/lib/renderers/Property.js +2 -1
- package/lib/renderers/Property.js.map +2 -2
- package/lib/renderers/SearchBox.d.ts +6 -1
- package/lib/renderers/SearchBox.js +19 -5
- package/lib/renderers/SearchBox.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/TableContent.d.ts +4 -1
- package/lib/renderers/Table/TableContent.js +21 -1
- package/lib/renderers/Table/TableContent.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +19 -2
- package/lib/renderers/Table/index.js +172 -57
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tabs.js +9 -1
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/renderers/WebComponent.js +1 -1
- package/lib/renderers/WebComponent.js.map +2 -2
- package/lib/store/combo.d.ts +2 -16
- package/lib/store/crud.js +3 -7
- package/lib/store/crud.js.map +2 -2
- package/lib/store/form.d.ts +1 -1
- package/lib/store/form.js +5 -6
- package/lib/store/form.js.map +2 -2
- package/lib/store/service.js +5 -4
- package/lib/store/service.js.map +2 -2
- package/lib/store/table.d.ts +260 -3
- package/lib/store/table.js +64 -6
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +1175 -255
- package/lib/themes/ang.css +1175 -255
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +1175 -255
- package/lib/themes/antd.css +1175 -255
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +1761 -514
- package/lib/themes/cxd.css +1761 -514
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +1175 -255
- package/lib/themes/dark.css +1175 -255
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +1761 -514
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +37 -0
- package/lib/types.js +0 -5
- package/lib/types.js.map +2 -2
- package/lib/utils/api.d.ts +3 -2
- package/lib/utils/api.js +31 -15
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/dom.d.ts +4 -0
- package/lib/utils/dom.js +11 -1
- package/lib/utils/dom.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 +3 -1
- package/lib/utils/helper.js +14 -5
- package/lib/utils/helper.js.map +2 -2
- package/lib/utils/icon.js +3 -0
- package/lib/utils/icon.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 -2
- package/schema.json +3534 -1028
- package/scss/_mixins.scss +27 -0
- package/scss/_properties.scss +84 -13
- package/scss/_utilities.scss +4 -0
- package/scss/base/_normalize.scss +2 -0
- package/scss/components/_anchor-nav.scss +88 -29
- package/scss/components/_badge.scss +52 -1
- package/scss/components/_button.scss +34 -3
- package/scss/components/_card.scss +8 -14
- package/scss/components/_collapse.scss +41 -8
- package/scss/components/_column-toggler.scss +234 -0
- package/scss/components/_dropdown.scss +2 -1
- package/scss/components/_image-gallery.scss +1 -1
- package/scss/components/_images.scss +2 -1
- package/scss/components/_link.scss +6 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_nav.scss +236 -154
- package/scss/components/_page.scss +5 -4
- package/scss/components/_picker-columns.scss +123 -0
- package/scss/components/_popover.scss +17 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_progress.scss +2 -0
- package/scss/components/_status.scss +1 -1
- package/scss/components/_steps.scss +1 -1
- package/scss/components/_table.scss +51 -1
- package/scss/components/form/_checks.scss +0 -351
- 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 +6 -3
- package/scss/components/form/_file.scss +5 -4
- package/scss/components/form/_form.scss +48 -0
- 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/_selection.scss +354 -0
- package/scss/components/form/_text.scss +13 -0
- package/scss/components/form/_textarea.scss +10 -0
- package/scss/components/form/_transfer.scss +77 -18
- package/scss/themes/_common.scss +6 -0
- package/scss/themes/_cxd-colors.scss +56 -0
- package/scss/themes/_cxd-variables.scss +219 -91
- package/scss/themes/cxd.scss +370 -0
- package/sdk/ang-ie11.css +1596 -515
- package/sdk/ang.css +1395 -256
- package/sdk/antd-ie11.css +1397 -318
- package/sdk/antd.css +1395 -256
- package/sdk/charts.js +13 -13
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +2739 -1361
- package/sdk/cxd.css +2095 -588
- package/sdk/dark-ie11.css +1593 -512
- package/sdk/dark.css +1395 -256
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/iconfont.svg +2513 -0
- package/sdk/iconfont.ttf +0 -0
- package/sdk/iconfont.woff +0 -0
- package/sdk/ie11-patch.css +1 -0
- package/sdk/locale/de-DE.js +4 -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 +18 -32
- package/sdk/rich-text.js +62 -64
- package/sdk/sdk-ie11.css +2739 -1361
- package/sdk/sdk.css +2095 -588
- package/sdk/sdk.js +1189 -1133
- 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 +32 -0
- package/src/components/Alert.tsx +3 -1
- package/src/components/AnchorNav.tsx +15 -4
- package/src/components/{AssociatedCheckboxes.tsx → AssociatedSelection.tsx} +41 -37
- package/src/components/Badge.tsx +96 -28
- package/src/components/Button.tsx +23 -7
- package/src/components/{ChainedCheckboxes.tsx → ChainedSelection.tsx} +57 -40
- package/src/components/Collapse.tsx +14 -9
- package/src/components/DatePicker.tsx +1 -1
- package/src/components/DateRangePicker.tsx +23 -11
- package/src/components/{ListCheckboxes.tsx → GroupedSelection.tsx} +26 -21
- package/src/components/InputBox.tsx +1 -1
- package/src/components/Link.tsx +85 -0
- package/src/components/ModalManager.ts +1 -1
- package/src/components/MonthRangePicker.tsx +10 -2
- package/src/components/PickerColumn.tsx +429 -0
- package/src/components/PickerContainer.tsx +128 -0
- package/src/components/Radios.tsx +3 -8
- package/src/components/RichText.tsx +244 -3
- package/src/components/SearchBox.tsx +4 -5
- package/src/components/Select.tsx +60 -5
- package/src/components/{Checkboxes.tsx → Selection.tsx} +75 -21
- package/src/components/SparkLine.tsx +4 -1
- package/src/components/{TableCheckboxes.tsx → TableSelection.tsx} +46 -25
- package/src/components/TabsTransfer.tsx +13 -7
- package/src/components/TabsTransferPicker.tsx +85 -0
- package/src/components/Toast.tsx +5 -5
- package/src/components/Transfer.tsx +71 -50
- package/src/components/TransferDropDown.tsx +117 -0
- package/src/components/TransferPicker.tsx +84 -0
- package/src/components/Tree.tsx +6 -8
- package/src/components/{TreeCheckboxes.tsx → TreeSelection.tsx} +33 -26
- package/src/components/WithRemoteConfig.tsx +7 -2
- package/src/components/calendar/DaysView.tsx +2 -2
- package/src/components/condition-builder/Field.tsx +5 -5
- package/src/components/condition-builder/Func.tsx +3 -3
- package/src/components/condition-builder/InputSwitch.tsx +3 -3
- package/src/components/condition-builder/Item.tsx +5 -12
- package/src/components/icons.tsx +15 -0
- package/src/components/index.tsx +13 -13
- package/src/envOverwrite.ts +0 -1
- package/src/factory.tsx +18 -3
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-set-state.ts +19 -0
- package/src/hooks/use-touch.ts +100 -0
- package/src/hooks/use-update-effect.ts +16 -0
- package/src/icons/clock.svg +1 -0
- package/src/icons/loading-outline.svg +4 -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/index.tsx +3 -0
- package/src/locale/de-DE.ts +4 -0
- package/src/locale/en-US.ts +4 -0
- package/src/locale/zh-CN.ts +7 -3
- package/src/renderers/Action.tsx +99 -15
- package/src/renderers/AnchorNav.tsx +4 -0
- package/src/renderers/Avatar.tsx +8 -4
- package/src/renderers/Breadcrumb.tsx +5 -1
- package/src/renderers/CRUD.tsx +63 -28
- package/src/renderers/Card.tsx +63 -34
- package/src/renderers/Chart.tsx +6 -2
- package/src/renderers/Collapse.tsx +4 -2
- package/src/renderers/Dialog.tsx +0 -4
- package/src/renderers/Drawer.tsx +0 -4
- package/src/renderers/DropDownButton.tsx +26 -12
- package/src/renderers/Form/Checkbox.tsx +8 -0
- package/src/renderers/Form/Combo.tsx +2 -3
- package/src/renderers/Form/InputCity.tsx +4 -8
- package/src/renderers/Form/InputFile.tsx +30 -20
- package/src/renderers/Form/InputImage.tsx +16 -5
- package/src/renderers/Form/Item.tsx +1 -1
- package/src/renderers/Form/Options.tsx +32 -7
- package/src/renderers/Form/Picker.tsx +3 -2
- package/src/renderers/Form/Select.tsx +158 -21
- package/src/renderers/Form/TabsTransferPicker.tsx +123 -0
- package/src/renderers/Form/Transfer.tsx +19 -4
- package/src/renderers/Form/TransferPicker.tsx +139 -0
- package/src/renderers/Form/TreeSelect.tsx +25 -0
- package/src/renderers/Form/index.tsx +16 -2
- package/src/renderers/Form/wrapControl.tsx +28 -3
- package/src/renderers/IFrame.tsx +4 -5
- package/src/renderers/Image.tsx +10 -0
- package/src/renderers/Json.tsx +9 -9
- package/src/renderers/Link.tsx +53 -14
- package/src/renderers/List.tsx +1 -1
- package/src/renderers/Log.tsx +16 -3
- package/src/renderers/Mapping.tsx +27 -11
- package/src/renderers/Nav.tsx +392 -60
- package/src/renderers/Page.tsx +1 -1
- package/src/renderers/Portlet.tsx +423 -0
- package/src/renderers/Property.tsx +3 -2
- package/src/renderers/SearchBox.tsx +23 -4
- 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/TableContent.tsx +40 -2
- package/src/renderers/Table/index.tsx +257 -80
- package/src/renderers/Tabs.tsx +9 -1
- package/src/renderers/WebComponent.tsx +2 -2
- package/src/store/crud.ts +3 -8
- package/src/store/form.ts +5 -10
- package/src/store/service.ts +5 -4
- package/src/store/table.ts +94 -6
- package/src/types.ts +57 -0
- package/src/utils/api.ts +52 -23
- package/src/utils/dom.tsx +12 -0
- package/src/utils/handleAction.ts +41 -0
- package/src/utils/helper.ts +12 -3
- package/src/utils/icon.tsx +4 -0
- package/src/utils/tpl-builtin.ts +48 -17
- package/dump.rdb +0 -0
- package/lib/components/AssociatedCheckboxes.d.ts +0 -762
- package/lib/components/AssociatedCheckboxes.js +0 -90
- package/lib/components/AssociatedCheckboxes.js.map +0 -13
- package/lib/components/ChainedCheckboxes.js.map +0 -13
- package/lib/components/Checkboxes.js +0 -101
- package/lib/components/Checkboxes.js.map +0 -13
- package/lib/components/ListCheckboxes.d.ts +0 -739
- package/lib/components/ListCheckboxes.js +0 -48
- package/lib/components/ListCheckboxes.js.map +0 -13
- package/lib/components/ListRadios.d.ts +0 -763
- package/lib/components/ListRadios.js +0 -86
- package/lib/components/ListRadios.js.map +0 -13
- package/lib/components/TableCheckboxes.js.map +0 -13
- package/lib/components/TreeCheckboxes.js.map +0 -13
- package/lib/components/TreeRadios.d.ts +0 -838
- package/lib/components/TreeRadios.js +0 -116
- package/lib/components/TreeRadios.js.map +0 -13
- package/src/components/ListRadios.tsx +0 -159
- package/src/components/TreeRadios.tsx +0 -202
@@ -5,9 +5,11 @@ import {SchemaNode, Action, Schema} from '../../types';
|
|
5
5
|
import forEach from 'lodash/forEach';
|
6
6
|
import {filter} from '../../utils/tpl';
|
7
7
|
import DropDownButton from '../DropDownButton';
|
8
|
+
import './ColumnToggler';
|
8
9
|
import Checkbox from '../../components/Checkbox';
|
9
10
|
import Button from '../../components/Button';
|
10
11
|
import {TableStore, ITableStore, IColumn, IRow} from '../../store/table';
|
12
|
+
import {saveAs} from 'file-saver';
|
11
13
|
import {
|
12
14
|
anyChanged,
|
13
15
|
getScrollParent,
|
@@ -16,7 +18,10 @@ import {
|
|
16
18
|
autobind,
|
17
19
|
isArrayChildrenModified,
|
18
20
|
getVariable,
|
19
|
-
removeHTMLTag
|
21
|
+
removeHTMLTag,
|
22
|
+
eachTree,
|
23
|
+
isObject,
|
24
|
+
createObject
|
20
25
|
} from '../../utils/helper';
|
21
26
|
import {
|
22
27
|
isPureVariable,
|
@@ -50,6 +55,10 @@ import {TableBody} from './TableBody';
|
|
50
55
|
import {TplSchema} from '../Tpl';
|
51
56
|
import {MappingSchema} from '../Mapping';
|
52
57
|
import {isAlive, getSnapshot} from 'mobx-state-tree';
|
58
|
+
import ColumnToggler from './ColumnToggler';
|
59
|
+
import {BadgeSchema} from '../../components/Badge';
|
60
|
+
import offset from '../../utils/offset';
|
61
|
+
import {getStyleNumber} from '../../utils/dom';
|
53
62
|
|
54
63
|
/**
|
55
64
|
* 表格列,不指定类型时默认为文本类型。
|
@@ -98,7 +107,7 @@ export type TableColumnObject = {
|
|
98
107
|
/**
|
99
108
|
* 是否可快速搜索
|
100
109
|
*/
|
101
|
-
searchable?: boolean;
|
110
|
+
searchable?: boolean | SchemaObject;
|
102
111
|
|
103
112
|
/**
|
104
113
|
* 配置是否默认展示
|
@@ -278,6 +287,16 @@ export interface TableSchema extends BaseSchema {
|
|
278
287
|
* 行样式表表达式
|
279
288
|
*/
|
280
289
|
rowClassNameExpr?: string;
|
290
|
+
|
291
|
+
/**
|
292
|
+
* 行角标
|
293
|
+
*/
|
294
|
+
itemBadge?: BadgeSchema;
|
295
|
+
|
296
|
+
/**
|
297
|
+
* 开启查询区域,会根据列元素的searchable属性值,自动生成查询条件表单
|
298
|
+
*/
|
299
|
+
autoGenerateFilter?: boolean;
|
281
300
|
}
|
282
301
|
|
283
302
|
export interface TableProps extends RendererProps {
|
@@ -345,6 +364,7 @@ export interface TableProps extends RendererProps {
|
|
345
364
|
popOverContainer?: any;
|
346
365
|
canAccessSuperData?: boolean;
|
347
366
|
reUseRow?: boolean;
|
367
|
+
itemBadge?: BadgeSchema;
|
348
368
|
}
|
349
369
|
|
350
370
|
type ExportExcelToolbar = SchemaNode & {
|
@@ -404,7 +424,9 @@ export default class Table extends React.Component<TableProps, object> {
|
|
404
424
|
'popOverContainer',
|
405
425
|
'headerToolbarClassName',
|
406
426
|
'toolbarClassName',
|
407
|
-
'footerToolbarClassName'
|
427
|
+
'footerToolbarClassName',
|
428
|
+
'itemBadge',
|
429
|
+
'autoFillHeight'
|
408
430
|
];
|
409
431
|
static defaultProps: Partial<TableProps> = {
|
410
432
|
className: '',
|
@@ -477,6 +499,9 @@ export default class Table extends React.Component<TableProps, object> {
|
|
477
499
|
this.handleMouseMove = this.handleMouseMove.bind(this);
|
478
500
|
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
479
501
|
this.subFormRef = this.subFormRef.bind(this);
|
502
|
+
this.handleColumnToggle = this.handleColumnToggle.bind(this);
|
503
|
+
this.renderAutoFilterForm = this.renderAutoFilterForm.bind(this);
|
504
|
+
this.updateAutoFillHeight = this.updateAutoFillHeight.bind(this);
|
480
505
|
|
481
506
|
const {
|
482
507
|
store,
|
@@ -587,6 +612,68 @@ export default class Table extends React.Component<TableProps, object> {
|
|
587
612
|
this.affixDetect();
|
588
613
|
parent.addEventListener('scroll', this.affixDetect);
|
589
614
|
window.addEventListener('resize', this.affixDetect);
|
615
|
+
this.updateAutoFillHeight();
|
616
|
+
window.addEventListener('resize', this.updateAutoFillHeight);
|
617
|
+
}
|
618
|
+
|
619
|
+
/**
|
620
|
+
* 自动设置表格高度占满界面剩余区域
|
621
|
+
* 用 css 实现有点麻烦,要改很多结构,所以先用 dom hack 了,避免对之前的功能有影响
|
622
|
+
*/
|
623
|
+
updateAutoFillHeight() {
|
624
|
+
const {autoFillHeight, footerToolbar, classPrefix: ns} = this.props;
|
625
|
+
if (!autoFillHeight) {
|
626
|
+
return;
|
627
|
+
}
|
628
|
+
const table = findDOMNode(this) as HTMLElement;
|
629
|
+
const tableContent = table.querySelector(
|
630
|
+
`.${ns}Table-content`
|
631
|
+
) as HTMLElement;
|
632
|
+
const tableContentWrap = table.querySelector(
|
633
|
+
`.${ns}Table-contentWrap`
|
634
|
+
) as HTMLElement;
|
635
|
+
const footToolbar = table.querySelector(
|
636
|
+
`.${ns}Table-footToolbar`
|
637
|
+
) as HTMLElement;
|
638
|
+
if (!tableContent) {
|
639
|
+
return;
|
640
|
+
}
|
641
|
+
|
642
|
+
// 计算 table-content 在 dom 中的位置
|
643
|
+
const tableContentTop = offset(tableContent).top;
|
644
|
+
const viewportHeight = window.innerHeight;
|
645
|
+
// 有时候会拿不到 footToolbar?
|
646
|
+
const footToolbarHeight = footToolbar ? offset(footToolbar).height : 0;
|
647
|
+
// 有时候会拿不到 footToolbar,等一下在执行
|
648
|
+
if (!footToolbarHeight && footerToolbar && footerToolbar.length) {
|
649
|
+
setTimeout(() => {
|
650
|
+
this.updateAutoFillHeight();
|
651
|
+
}, 100);
|
652
|
+
return;
|
653
|
+
}
|
654
|
+
const tableContentWrapMarginButtom = getStyleNumber(
|
655
|
+
tableContentWrap,
|
656
|
+
'margin-bottom'
|
657
|
+
);
|
658
|
+
|
659
|
+
// 循环计算父级节点的 pddding,这里不考虑父级节点还可能会有其它兄弟节点的情况了
|
660
|
+
let allParentPaddingButtom = 0;
|
661
|
+
let parentNode = tableContent.parentElement;
|
662
|
+
while (parentNode) {
|
663
|
+
const paddingButtom = getStyleNumber(parentNode, 'padding-bottom');
|
664
|
+
const borderBottom = getStyleNumber(parentNode, 'border-bottom-width');
|
665
|
+
allParentPaddingButtom =
|
666
|
+
allParentPaddingButtom + paddingButtom + borderBottom;
|
667
|
+
parentNode = parentNode.parentElement;
|
668
|
+
}
|
669
|
+
|
670
|
+
tableContent.style.height = `${
|
671
|
+
viewportHeight -
|
672
|
+
tableContentTop -
|
673
|
+
tableContentWrapMarginButtom -
|
674
|
+
footToolbarHeight -
|
675
|
+
allParentPaddingButtom
|
676
|
+
}px`;
|
590
677
|
}
|
591
678
|
|
592
679
|
componentDidUpdate(prevProps: TableProps) {
|
@@ -655,8 +742,12 @@ export default class Table extends React.Component<TableProps, object> {
|
|
655
742
|
) {
|
656
743
|
Table.syncRows(store, props, prevProps) && this.syncSelected();
|
657
744
|
} else if (isArrayChildrenModified(prevProps.selected!, props.selected!)) {
|
745
|
+
const prevSelectedRows = store.selectedRows
|
746
|
+
.map(item => item.id)
|
747
|
+
.join(',');
|
658
748
|
store.updateSelected(props.selected || [], props.valueField);
|
659
|
-
|
749
|
+
const selectedRows = store.selectedRows.map(item => item.id).join(',');
|
750
|
+
prevSelectedRows !== selectedRows && this.syncSelected();
|
660
751
|
}
|
661
752
|
|
662
753
|
this.updateTableInfoLazy();
|
@@ -668,6 +759,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
668
759
|
const parent = this.parentNode;
|
669
760
|
parent && parent.removeEventListener('scroll', this.affixDetect);
|
670
761
|
window.removeEventListener('resize', this.affixDetect);
|
762
|
+
window.removeEventListener('resize', this.updateAutoFillHeight);
|
671
763
|
(this.updateTableInfoLazy as any).cancel();
|
672
764
|
this.unSensor && this.unSensor();
|
673
765
|
|
@@ -857,7 +949,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
857
949
|
}
|
858
950
|
|
859
951
|
affixDetect() {
|
860
|
-
if (!this.props.affixHeader || !this.table) {
|
952
|
+
if (!this.props.affixHeader || !this.table || this.props.autoFillHeight) {
|
861
953
|
return;
|
862
954
|
}
|
863
955
|
|
@@ -1111,7 +1203,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1111
1203
|
|
1112
1204
|
handleMouseMove(e: React.MouseEvent<any>) {
|
1113
1205
|
const tr: HTMLElement = (e.target as HTMLElement).closest(
|
1114
|
-
'tr[data-
|
1206
|
+
'tr[data-id]'
|
1115
1207
|
) as HTMLElement;
|
1116
1208
|
|
1117
1209
|
if (!tr) {
|
@@ -1129,20 +1221,20 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1129
1221
|
return;
|
1130
1222
|
}
|
1131
1223
|
|
1132
|
-
const
|
1224
|
+
const id = tr.getAttribute('data-id') as string;
|
1225
|
+
const row = store.hoverRow;
|
1133
1226
|
|
1134
|
-
if (
|
1227
|
+
if (row?.id === id) {
|
1135
1228
|
return;
|
1136
1229
|
}
|
1137
|
-
store.rows
|
1230
|
+
eachTree<IRow>(store.rows, (item: IRow) => item.setIsHover(item.id === id));
|
1138
1231
|
}
|
1139
1232
|
|
1140
1233
|
handleMouseLeave() {
|
1141
1234
|
const store = this.props.store;
|
1235
|
+
const row = store.hoverRow;
|
1142
1236
|
|
1143
|
-
|
1144
|
-
store.rows[store.hoverIndex].setIsHover(false);
|
1145
|
-
}
|
1237
|
+
row?.setIsHover(false);
|
1146
1238
|
}
|
1147
1239
|
|
1148
1240
|
draggingTr: HTMLTableRowElement;
|
@@ -1346,6 +1438,111 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1346
1438
|
document.removeEventListener('mouseup', this.handleColResizeMouseUp);
|
1347
1439
|
}
|
1348
1440
|
|
1441
|
+
handleColumnToggle(columns: Array<IColumn>) {
|
1442
|
+
const {store} = this.props;
|
1443
|
+
|
1444
|
+
store.updateColumns(columns);
|
1445
|
+
}
|
1446
|
+
|
1447
|
+
renderAutoFilterForm(): React.ReactNode {
|
1448
|
+
const {
|
1449
|
+
render,
|
1450
|
+
store,
|
1451
|
+
onSearchableFromReset,
|
1452
|
+
onSearchableFromSubmit,
|
1453
|
+
onSearchableFromInit,
|
1454
|
+
classnames: cx,
|
1455
|
+
translate: __
|
1456
|
+
} = this.props;
|
1457
|
+
const searchableColumns = store.searchableColumns;
|
1458
|
+
const activedSearchableColumns = store.activedSearchableColumns;
|
1459
|
+
|
1460
|
+
if (!searchableColumns.length) {
|
1461
|
+
return null;
|
1462
|
+
}
|
1463
|
+
|
1464
|
+
const groupedSearchableColumns: Array<Record<string, any>> = [
|
1465
|
+
{body: [], md: 4},
|
1466
|
+
{body: [], md: 4},
|
1467
|
+
{body: [], md: 4}
|
1468
|
+
];
|
1469
|
+
|
1470
|
+
activedSearchableColumns.forEach((column, index) => {
|
1471
|
+
groupedSearchableColumns[index % 3].body.push({
|
1472
|
+
...column.searchable,
|
1473
|
+
name: column.searchable?.name ?? column.name,
|
1474
|
+
label: column.searchable?.label ?? column.label,
|
1475
|
+
mode: 'horizontal'
|
1476
|
+
});
|
1477
|
+
});
|
1478
|
+
|
1479
|
+
return render(
|
1480
|
+
'searchable-form',
|
1481
|
+
{
|
1482
|
+
type: 'form',
|
1483
|
+
api: null,
|
1484
|
+
title: '',
|
1485
|
+
mode: 'normal',
|
1486
|
+
submitText: __('search'),
|
1487
|
+
body: [
|
1488
|
+
{
|
1489
|
+
type: 'grid',
|
1490
|
+
columns: groupedSearchableColumns
|
1491
|
+
}
|
1492
|
+
],
|
1493
|
+
actions: [
|
1494
|
+
{
|
1495
|
+
type: 'dropdown-button',
|
1496
|
+
label: __('Table.searchFields'),
|
1497
|
+
className: cx('Table-searchableForm-dropdown', 'mr-2'),
|
1498
|
+
level: 'link',
|
1499
|
+
trigger: 'click',
|
1500
|
+
size: 'sm',
|
1501
|
+
align: 'right',
|
1502
|
+
buttons: searchableColumns.map(column => {
|
1503
|
+
return {
|
1504
|
+
type: 'checkbox',
|
1505
|
+
className: cx('Table-searchableForm-checkbox'),
|
1506
|
+
name: `__search_${column.searchable?.name ?? column.name}`,
|
1507
|
+
option: column.searchable?.label ?? column.label,
|
1508
|
+
value: column.enableSearch,
|
1509
|
+
badge: {
|
1510
|
+
offset: [-10, 5],
|
1511
|
+
visibleOn: `${
|
1512
|
+
column.toggable && !column.toggled && column.enableSearch
|
1513
|
+
}`
|
1514
|
+
},
|
1515
|
+
onChange: (value: boolean) => {
|
1516
|
+
column.setEnableSearch(value);
|
1517
|
+
}
|
1518
|
+
};
|
1519
|
+
})
|
1520
|
+
},
|
1521
|
+
{
|
1522
|
+
type: 'submit',
|
1523
|
+
label: __('search'),
|
1524
|
+
level: 'primary',
|
1525
|
+
className: 'w-18'
|
1526
|
+
},
|
1527
|
+
{
|
1528
|
+
type: 'reset',
|
1529
|
+
label: __('reset'),
|
1530
|
+
className: 'w-18'
|
1531
|
+
}
|
1532
|
+
]
|
1533
|
+
},
|
1534
|
+
{
|
1535
|
+
key: 'searchable-form',
|
1536
|
+
panelClassName: cx('Table-searchableForm'),
|
1537
|
+
actionsClassName: cx('Table-searchableForm-footer'),
|
1538
|
+
onReset: onSearchableFromReset,
|
1539
|
+
onSubmit: onSearchableFromSubmit,
|
1540
|
+
onInit: onSearchableFromInit,
|
1541
|
+
formStore: undefined
|
1542
|
+
}
|
1543
|
+
);
|
1544
|
+
}
|
1545
|
+
|
1349
1546
|
renderHeading() {
|
1350
1547
|
let {
|
1351
1548
|
title,
|
@@ -1435,7 +1632,8 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1435
1632
|
render,
|
1436
1633
|
classPrefix: ns,
|
1437
1634
|
resizable,
|
1438
|
-
classnames: cx
|
1635
|
+
classnames: cx,
|
1636
|
+
autoGenerateFilter
|
1439
1637
|
} = this.props;
|
1440
1638
|
|
1441
1639
|
if (column.type === '__checkme') {
|
@@ -1482,7 +1680,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1482
1680
|
|
1483
1681
|
let affix = null;
|
1484
1682
|
|
1485
|
-
if (column.searchable && column.name) {
|
1683
|
+
if (column.searchable && column.name && !autoGenerateFilter) {
|
1486
1684
|
affix = (
|
1487
1685
|
<HeadCellSearchDropDown
|
1488
1686
|
{...this.props}
|
@@ -1635,7 +1833,8 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1635
1833
|
classnames: cx,
|
1636
1834
|
checkOnItemClick,
|
1637
1835
|
popOverContainer,
|
1638
|
-
canAccessSuperData
|
1836
|
+
canAccessSuperData,
|
1837
|
+
itemBadge
|
1639
1838
|
} = this.props;
|
1640
1839
|
|
1641
1840
|
if (column.name && item.rowSpans[column.name] === 0) {
|
@@ -1723,7 +1922,13 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1723
1922
|
quickEditFormRef: this.subFormRef,
|
1724
1923
|
prefix,
|
1725
1924
|
onImageEnlarge: this.handleImageEnlarge,
|
1726
|
-
canAccessSuperData
|
1925
|
+
canAccessSuperData,
|
1926
|
+
row: item,
|
1927
|
+
itemBadge,
|
1928
|
+
showBadge:
|
1929
|
+
!props.isHead &&
|
1930
|
+
itemBadge &&
|
1931
|
+
store.firstToggledColumnIndex === props.colIndex
|
1727
1932
|
};
|
1728
1933
|
delete subProps.label;
|
1729
1934
|
|
@@ -1950,7 +2155,6 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1950
2155
|
} = this.props;
|
1951
2156
|
const __ = rest.translate;
|
1952
2157
|
const env = rest.env;
|
1953
|
-
|
1954
2158
|
const render = this.props.render;
|
1955
2159
|
|
1956
2160
|
if (!store.columnsTogglable) {
|
@@ -1958,23 +2162,29 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1958
2162
|
}
|
1959
2163
|
|
1960
2164
|
return (
|
1961
|
-
<
|
2165
|
+
<ColumnToggler
|
1962
2166
|
{...rest}
|
1963
|
-
|
2167
|
+
{...(isObject(config) ? config : {})}
|
2168
|
+
tooltip={config?.tooltip || __('Table.columnsVisibility')}
|
1964
2169
|
tooltipContainer={
|
1965
2170
|
env && env.getModalContainer ? env.getModalContainer : undefined
|
1966
2171
|
}
|
1967
|
-
align={config
|
2172
|
+
align={config?.align ?? 'left'}
|
1968
2173
|
isActived={store.hasColumnHidden()}
|
1969
2174
|
classnames={cx}
|
1970
2175
|
classPrefix={ns}
|
1971
2176
|
key="columns-toggable"
|
1972
|
-
size=
|
1973
|
-
label={
|
2177
|
+
size={config?.size || 'sm'}
|
2178
|
+
label={
|
2179
|
+
config?.label || <Icon icon="columns" className="icon m-r-none" />
|
2180
|
+
}
|
2181
|
+
draggable={config?.draggable}
|
2182
|
+
columns={store.columnsData}
|
2183
|
+
onColumnToggle={this.handleColumnToggle}
|
1974
2184
|
>
|
1975
2185
|
{store.toggableColumns.map(column => (
|
1976
2186
|
<li
|
1977
|
-
className={cx('
|
2187
|
+
className={cx('ColumnToggler-menuItem')}
|
1978
2188
|
key={column.index}
|
1979
2189
|
onClick={column.toggleToggle}
|
1980
2190
|
>
|
@@ -1983,7 +2193,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1983
2193
|
</Checkbox>
|
1984
2194
|
</li>
|
1985
2195
|
))}
|
1986
|
-
</
|
2196
|
+
</ColumnToggler>
|
1987
2197
|
);
|
1988
2198
|
}
|
1989
2199
|
|
@@ -2238,7 +2448,10 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2238
2448
|
} else {
|
2239
2449
|
if ((column as TplSchema).tpl) {
|
2240
2450
|
sheetRow.getCell(columIndex).value = removeHTMLTag(
|
2241
|
-
filter(
|
2451
|
+
filter(
|
2452
|
+
(column as TplSchema).tpl,
|
2453
|
+
createObject(data, row.data)
|
2454
|
+
)
|
2242
2455
|
);
|
2243
2456
|
} else {
|
2244
2457
|
sheetRow.getCell(columIndex).value = value;
|
@@ -2441,57 +2654,6 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2441
2654
|
: footerNode || toolbarNode || null;
|
2442
2655
|
}
|
2443
2656
|
|
2444
|
-
renderItemActions() {
|
2445
|
-
const {itemActions, render, store, classnames: cx} = this.props;
|
2446
|
-
const finalActions = Array.isArray(itemActions)
|
2447
|
-
? itemActions.filter(action => !action.hiddenOnHover)
|
2448
|
-
: [];
|
2449
|
-
|
2450
|
-
if (!finalActions.length) {
|
2451
|
-
return null;
|
2452
|
-
}
|
2453
|
-
const rowIndex = store.hoverIndex;
|
2454
|
-
const heights = this.heights;
|
2455
|
-
let height = 40;
|
2456
|
-
let top = 0;
|
2457
|
-
|
2458
|
-
if (heights && heights[rowIndex]) {
|
2459
|
-
height = heights[rowIndex];
|
2460
|
-
top += heights.header;
|
2461
|
-
for (let i = rowIndex - 1; i >= 0; i--) {
|
2462
|
-
top += heights[i];
|
2463
|
-
}
|
2464
|
-
}
|
2465
|
-
|
2466
|
-
return (
|
2467
|
-
<div
|
2468
|
-
className={cx('Table-itemActions-wrap')}
|
2469
|
-
style={{
|
2470
|
-
top,
|
2471
|
-
height
|
2472
|
-
}}
|
2473
|
-
>
|
2474
|
-
<div className={cx('Table-itemActions')}>
|
2475
|
-
{finalActions.map((action, index) =>
|
2476
|
-
render(
|
2477
|
-
`itemAction/${index}`,
|
2478
|
-
{
|
2479
|
-
...(action as any),
|
2480
|
-
isMenuItem: true
|
2481
|
-
},
|
2482
|
-
{
|
2483
|
-
key: index,
|
2484
|
-
item: store.rows[rowIndex],
|
2485
|
-
data: store.rows[rowIndex].locals,
|
2486
|
-
rowIndex
|
2487
|
-
}
|
2488
|
-
)
|
2489
|
-
)}
|
2490
|
-
</div>
|
2491
|
-
</div>
|
2492
|
-
);
|
2493
|
-
}
|
2494
|
-
|
2495
2657
|
renderTableContent() {
|
2496
2658
|
const {
|
2497
2659
|
classnames: cx,
|
@@ -2506,8 +2668,11 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2506
2668
|
prefixRow,
|
2507
2669
|
locale,
|
2508
2670
|
affixRow,
|
2671
|
+
tableContentClassName,
|
2509
2672
|
translate,
|
2510
|
-
itemAction
|
2673
|
+
itemAction,
|
2674
|
+
autoFillHeight,
|
2675
|
+
itemActions
|
2511
2676
|
} = this.props;
|
2512
2677
|
|
2513
2678
|
// 理论上来说 store.rows 应该也行啊
|
@@ -2518,9 +2683,13 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2518
2683
|
<TableContent
|
2519
2684
|
tableClassName={cx(
|
2520
2685
|
store.combineNum > 0 ? 'Table-table--withCombine' : '',
|
2686
|
+
{'Table-table--checkOnItemClick': checkOnItemClick},
|
2521
2687
|
tableClassName
|
2522
2688
|
)}
|
2689
|
+
className={tableContentClassName}
|
2690
|
+
itemActions={itemActions}
|
2523
2691
|
itemAction={itemAction}
|
2692
|
+
store={store}
|
2524
2693
|
classnames={cx}
|
2525
2694
|
columns={store.filteredColumns}
|
2526
2695
|
columnsGroup={store.columnGroup}
|
@@ -2551,7 +2720,14 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2551
2720
|
}
|
2552
2721
|
|
2553
2722
|
render() {
|
2554
|
-
const {
|
2723
|
+
const {
|
2724
|
+
className,
|
2725
|
+
store,
|
2726
|
+
classnames: cx,
|
2727
|
+
affixColumns,
|
2728
|
+
autoFillHeight,
|
2729
|
+
autoGenerateFilter
|
2730
|
+
} = this.props;
|
2555
2731
|
|
2556
2732
|
this.renderedToolbars = []; // 用来记录哪些 toolbar 已经渲染了,已经渲染了就不重复渲染了。
|
2557
2733
|
const heading = this.renderHeading();
|
@@ -2566,9 +2742,11 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2566
2742
|
return (
|
2567
2743
|
<div
|
2568
2744
|
className={cx('Table', className, {
|
2569
|
-
'Table--unsaved': !!store.modified || !!store.moved
|
2745
|
+
'Table--unsaved': !!store.modified || !!store.moved,
|
2746
|
+
'Table--autoFillHeight': autoFillHeight
|
2570
2747
|
})}
|
2571
2748
|
>
|
2749
|
+
{autoGenerateFilter ? this.renderAutoFilterForm() : null}
|
2572
2750
|
{header}
|
2573
2751
|
{heading}
|
2574
2752
|
<div
|
@@ -2602,7 +2780,6 @@ export default class Table extends React.Component<TableProps, object> {
|
|
2602
2780
|
: null}
|
2603
2781
|
</div>
|
2604
2782
|
{this.renderTableContent()}
|
2605
|
-
{~store.hoverIndex ? this.renderItemActions() : null}
|
2606
2783
|
</div>
|
2607
2784
|
{this.renderAffixHeader(tableClassName)}
|
2608
2785
|
{footer}
|
package/src/renderers/Tabs.tsx
CHANGED
@@ -374,7 +374,15 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
|
|
374
374
|
|
375
375
|
@autobind
|
376
376
|
handleSelect(key: any) {
|
377
|
-
const {env, onSelect} = this.props;
|
377
|
+
const {env, onSelect, id} = this.props;
|
378
|
+
|
379
|
+
env.tracker?.({
|
380
|
+
eventType: 'tabChange',
|
381
|
+
eventData: {
|
382
|
+
id,
|
383
|
+
key
|
384
|
+
}
|
385
|
+
});
|
378
386
|
|
379
387
|
// 是 hash,需要更新到地址栏
|
380
388
|
if (typeof key === 'string' && env) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import {Renderer, RendererProps} from '../factory';
|
3
3
|
import {BaseSchema, SchemaCollection} from '../Schema';
|
4
|
-
import {resolveVariable} from '../utils/tpl-builtin';
|
4
|
+
import {resolveVariable, resolveVariableAndFilter} from '../utils/tpl-builtin';
|
5
5
|
import mapValues from 'lodash/mapValues';
|
6
6
|
|
7
7
|
/**
|
@@ -43,7 +43,7 @@ export default class WebComponent extends React.Component<RendererProps> {
|
|
43
43
|
|
44
44
|
const propsValues = mapValues(props, s => {
|
45
45
|
if (typeof s === 'string') {
|
46
|
-
return
|
46
|
+
return resolveVariableAndFilter(s, data, '| raw') || s;
|
47
47
|
} else {
|
48
48
|
return s;
|
49
49
|
}
|
package/src/store/crud.ts
CHANGED
@@ -21,6 +21,7 @@ import {
|
|
21
21
|
import {Api, Payload, fetchOptions, Action, ApiObject} from '../types';
|
22
22
|
import pick from 'lodash/pick';
|
23
23
|
import {resolveVariableAndFilter} from '../utils/tpl-builtin';
|
24
|
+
import {normalizeApiResponseData} from '../utils/api';
|
24
25
|
|
25
26
|
class ServerError extends Error {
|
26
27
|
type = 'ServerError';
|
@@ -228,13 +229,7 @@ export const CRUDStore = ServiceStore.named('CRUDStore')
|
|
228
229
|
}
|
229
230
|
|
230
231
|
self.updatedAt = Date.now();
|
231
|
-
let result = json.data;
|
232
|
-
|
233
|
-
if (Array.isArray(result)) {
|
234
|
-
result = {
|
235
|
-
items: result
|
236
|
-
};
|
237
|
-
}
|
232
|
+
let result = normalizeApiResponseData(json.data);
|
238
233
|
|
239
234
|
const {
|
240
235
|
total,
|
@@ -384,7 +379,7 @@ export const CRUDStore = ServiceStore.named('CRUDStore')
|
|
384
379
|
|
385
380
|
if (!isEmpty(json.data) || json.ok) {
|
386
381
|
self.updateData(
|
387
|
-
json.data,
|
382
|
+
normalizeApiResponseData(json.data),
|
388
383
|
{
|
389
384
|
__saved: Date.now()
|
390
385
|
},
|
package/src/store/form.ts
CHANGED
@@ -29,6 +29,7 @@ import isEqual from 'lodash/isEqual';
|
|
29
29
|
import flatten from 'lodash/flatten';
|
30
30
|
import {getStoreById, removeStore} from './manager';
|
31
31
|
import {filter} from '../utils/tpl';
|
32
|
+
import {normalizeApiResponseData} from '../utils/api';
|
32
33
|
|
33
34
|
export const FormStore = ServiceStore.named('FormStore')
|
34
35
|
.props({
|
@@ -305,7 +306,7 @@ export const FormStore = ServiceStore.named('FormStore')
|
|
305
306
|
self.updatedAt = Date.now();
|
306
307
|
|
307
308
|
setValues(
|
308
|
-
json.data,
|
309
|
+
normalizeApiResponseData(json.data),
|
309
310
|
json.ok
|
310
311
|
? {
|
311
312
|
__saved: Date.now()
|
@@ -587,14 +588,9 @@ export const FormStore = ServiceStore.named('FormStore')
|
|
587
588
|
self.persistData = value;
|
588
589
|
}
|
589
590
|
|
590
|
-
const setLocalPersistData =
|
591
|
-
|
592
|
-
|
593
|
-
{
|
594
|
-
trailing: true,
|
595
|
-
leading: false
|
596
|
-
}
|
597
|
-
);
|
591
|
+
const setLocalPersistData = () => {
|
592
|
+
localStorage.setItem(self.persistKey, JSON.stringify(self.data));
|
593
|
+
};
|
598
594
|
|
599
595
|
function getLocalPersistData() {
|
600
596
|
let data = localStorage.getItem(self.persistKey);
|
@@ -638,7 +634,6 @@ export const FormStore = ServiceStore.named('FormStore')
|
|
638
634
|
clearRestError,
|
639
635
|
beforeDestroy() {
|
640
636
|
syncOptions.cancel();
|
641
|
-
setLocalPersistData.cancel();
|
642
637
|
}
|
643
638
|
};
|
644
639
|
});
|