amis 1.5.6 → 1.6.1-beta.0
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/README.md +1 -0
- package/lib/RootRenderer.d.ts +2 -0
- package/lib/RootRenderer.js +19 -1
- package/lib/RootRenderer.js.map +2 -2
- package/lib/Schema.d.ts +3 -2
- package/lib/Schema.js.map +1 -1
- package/lib/SchemaRenderer.js +52 -1
- package/lib/SchemaRenderer.js.map +2 -2
- package/lib/Scoped.d.ts +2 -0
- package/lib/Scoped.js +27 -1
- package/lib/Scoped.js.map +2 -2
- package/lib/actions/Action.d.ts +33 -0
- package/lib/actions/Action.js +100 -0
- package/lib/actions/Action.js.map +13 -0
- package/lib/actions/AjaxAction.d.ts +14 -0
- package/lib/actions/AjaxAction.js +68 -0
- package/lib/actions/AjaxAction.js.map +13 -0
- package/lib/actions/BreakAction.d.ts +12 -0
- package/lib/actions/BreakAction.js +28 -0
- package/lib/actions/BreakAction.js.map +13 -0
- package/lib/actions/BroadcastAction.d.ts +12 -0
- package/lib/actions/BroadcastAction.js +40 -0
- package/lib/actions/BroadcastAction.js.map +13 -0
- package/lib/actions/CmptAction.d.ts +12 -0
- package/lib/actions/CmptAction.js +40 -0
- package/lib/actions/CmptAction.js.map +13 -0
- package/lib/actions/ContinueAction.d.ts +12 -0
- package/lib/actions/ContinueAction.js +28 -0
- package/lib/actions/ContinueAction.js.map +13 -0
- package/lib/actions/CopyAction.d.ts +12 -0
- package/lib/actions/CopyAction.js +35 -0
- package/lib/actions/CopyAction.js.map +13 -0
- package/lib/actions/CustomAction.d.ts +12 -0
- package/lib/actions/CustomAction.js +43 -0
- package/lib/actions/CustomAction.js.map +13 -0
- package/lib/actions/DialogAction.d.ts +12 -0
- package/lib/actions/DialogAction.js +31 -0
- package/lib/actions/DialogAction.js.map +13 -0
- package/lib/actions/DrawerAction.d.ts +12 -0
- package/lib/actions/DrawerAction.js +31 -0
- package/lib/actions/DrawerAction.js.map +13 -0
- package/lib/actions/EmailAction.d.ts +12 -0
- package/lib/actions/EmailAction.js +37 -0
- package/lib/actions/EmailAction.js.map +13 -0
- package/lib/actions/LoopAction.d.ts +12 -0
- package/lib/actions/LoopAction.js +93 -0
- package/lib/actions/LoopAction.js.map +13 -0
- package/lib/actions/OpenPageAction.d.ts +12 -0
- package/lib/actions/OpenPageAction.js +33 -0
- package/lib/actions/OpenPageAction.js.map +13 -0
- package/lib/actions/ParallelAction.d.ts +5 -0
- package/lib/actions/ParallelAction.js +33 -0
- package/lib/actions/ParallelAction.js.map +13 -0
- package/lib/actions/SwitchAction.d.ts +8 -0
- package/lib/actions/SwitchAction.js +45 -0
- package/lib/actions/SwitchAction.js.map +13 -0
- package/lib/actions/index.d.ts +18 -0
- package/lib/actions/index.js +22 -0
- package/lib/actions/index.js.map +13 -0
- package/lib/components/AnchorNav.d.ts +20 -20
- 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/Button.d.ts +20 -20
- package/lib/components/CalendarMobile.d.ts +573 -0
- package/lib/components/CalendarMobile.js +486 -0
- package/lib/components/CalendarMobile.js.map +13 -0
- package/lib/components/Cascader.d.ts +123 -0
- package/lib/components/Cascader.js +487 -0
- package/lib/components/Cascader.js.map +13 -0
- 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/CityArea.d.ts +527 -0
- package/lib/components/CityArea.js +177 -0
- package/lib/components/CityArea.js.map +13 -0
- package/lib/components/Collapse.d.ts +20 -20
- package/lib/components/ColorPicker.d.ts +84 -84
- package/lib/components/ColorPicker.js +4 -3
- package/lib/components/ColorPicker.js.map +2 -2
- package/lib/components/DatePicker.d.ts +85 -84
- package/lib/components/DatePicker.js +21 -8
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +85 -84
- package/lib/components/DateRangePicker.js +19 -6
- 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/InputBox.d.ts +21 -21
- package/lib/components/ListGroup.d.ts +21 -21
- package/lib/components/ListMenu.d.ts +84 -84
- package/lib/components/MonthRangePicker.d.ts +85 -84
- package/lib/components/MonthRangePicker.js +18 -7
- 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.d.ts +1 -0
- package/lib/components/Picker.js +16 -7
- package/lib/components/Picker.js.map +2 -2
- package/lib/components/PickerColumn.d.ts +1 -0
- package/lib/components/PickerColumn.js +21 -18
- package/lib/components/PickerColumn.js.map +2 -2
- package/lib/components/PickerContainer.d.ts +3 -0
- package/lib/components/PickerContainer.js +12 -5
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/PopOverContainer.d.ts +1 -0
- package/lib/components/PopOverContainer.js +5 -3
- package/lib/components/PopOverContainer.js.map +2 -2
- package/lib/components/PopUp.d.ts +1041 -28
- package/lib/components/PopUp.js +32 -8
- package/lib/components/PopUp.js.map +2 -2
- package/lib/components/Radios.d.ts +21 -21
- package/lib/components/Rating.d.ts +21 -21
- package/lib/components/ResultBox.d.ts +85 -84
- package/lib/components/ResultBox.js +9 -4
- 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 +238 -238
- package/lib/components/Select.js +13 -9
- package/lib/components/Select.js.map +2 -2
- 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.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 +20 -18
- 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 +517 -0
- package/lib/components/TimelineItem.js +40 -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 +85 -84
- package/lib/components/TransferDropDown.js +9 -10
- package/lib/components/TransferDropDown.js.map +2 -2
- package/lib/components/TransferPicker.d.ts +1 -0
- package/lib/components/TransferPicker.js +19 -4
- package/lib/components/TransferPicker.js.map +2 -2
- package/lib/components/Tree.d.ts +84 -84
- 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 +19 -0
- package/lib/components/calendar/Calendar.js +71 -1
- package/lib/components/calendar/Calendar.js.map +2 -2
- package/lib/components/calendar/DaysView.d.ts +21 -0
- package/lib/components/calendar/DaysView.js +76 -17
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/components/calendar/MonthsView.d.ts +34 -0
- package/lib/components/calendar/MonthsView.js +68 -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 +30 -18
- package/lib/components/calendar/TimeView.js +47 -8
- package/lib/components/calendar/TimeView.js.map +2 -2
- package/lib/components/calendar/YearsView.d.ts +6 -0
- package/lib/components/calendar/YearsView.js +21 -10
- 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 +3 -0
- package/lib/components/formula/Editor.js +3 -2
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/FuncList.js +2 -1
- package/lib/components/formula/FuncList.js.map +2 -2
- package/lib/components/formula/Picker.js +1 -1
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/components/formula/plugin.js +0 -1
- package/lib/components/formula/plugin.js.map +2 -2
- package/lib/components/icons.js +2 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +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/env.d.ts +4 -0
- package/lib/env.js.map +2 -2
- package/lib/factory.d.ts +2 -1
- package/lib/factory.js +83 -0
- package/lib/factory.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/icons/tree-down.js +7 -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 +17 -2
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +17 -2
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +16 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +1 -1
- package/lib/renderers/Action.js +26 -10
- package/lib/renderers/Action.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.d.ts +1 -1
- package/lib/renderers/Custom.js +1 -1
- package/lib/renderers/Custom.js.map +2 -2
- package/lib/renderers/DropDownButton.d.ts +11 -2
- package/lib/renderers/DropDownButton.js +30 -12
- package/lib/renderers/DropDownButton.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/CityDB.js +526 -2
- package/lib/renderers/Form/CityDB.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +6 -0
- package/lib/renderers/Form/DiffEditor.js +2 -1
- package/lib/renderers/Form/DiffEditor.js.map +2 -2
- package/lib/renderers/Form/Editor.d.ts +6 -0
- package/lib/renderers/Form/InputCity.d.ts +85 -84
- package/lib/renderers/Form/InputCity.js +4 -2
- package/lib/renderers/Form/InputCity.js.map +2 -2
- package/lib/renderers/Form/InputColor.d.ts +84 -84
- package/lib/renderers/Form/InputColor.js +6 -2
- package/lib/renderers/Form/InputColor.js.map +2 -2
- package/lib/renderers/Form/InputDate.js +10 -5
- package/lib/renderers/Form/InputDate.js.map +2 -2
- package/lib/renderers/Form/InputDateRange.js +6 -2
- package/lib/renderers/Form/InputDateRange.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +4 -1
- package/lib/renderers/Form/InputFormula.js +2 -2
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- 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/InputYearRange.js +1 -1
- package/lib/renderers/Form/InputYearRange.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +10 -14
- package/lib/renderers/Form/Item.js +18 -9
- package/lib/renderers/Form/Item.js.map +2 -2
- package/lib/renderers/Form/NestedSelect.d.ts +1 -0
- package/lib/renderers/Form/NestedSelect.js +8 -4
- package/lib/renderers/Form/NestedSelect.js.map +2 -2
- package/lib/renderers/Form/Options.js +9 -7
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +2 -0
- package/lib/renderers/Form/Select.js +9 -6
- 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.js +4 -4
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.js +10 -2
- 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/Link.d.ts +1 -1
- package/lib/renderers/Link.js +27 -6
- package/lib/renderers/Link.js.map +2 -2
- package/lib/renderers/Nav.d.ts +21 -21
- package/lib/renderers/Nav.js +4 -1
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/Remark.d.ts +5 -1
- package/lib/renderers/Remark.js +39 -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/schemaExtend.js +23 -9
- package/lib/schemaExtend.js.map +2 -2
- package/lib/store/combo.js.map +2 -2
- package/lib/store/formItem.js +7 -7
- 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 +1149 -53
- package/lib/themes/ang.css +1149 -53
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +1187 -53
- package/lib/themes/antd.css +1187 -53
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +1190 -71
- package/lib/themes/cxd.css +1190 -71
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +1152 -53
- package/lib/themes/dark.css +1152 -53
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +1190 -71
- 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 +14 -3
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/debug.d.ts +26 -0
- package/lib/utils/debug.js +351 -0
- package/lib/utils/debug.js.map +13 -0
- package/lib/utils/helper.d.ts +1 -6
- package/lib/utils/helper.js +6 -17
- package/lib/utils/helper.js.map +2 -2
- package/lib/utils/renderer-event.d.ts +38 -0
- package/lib/utils/renderer-event.js +28 -0
- package/lib/utils/renderer-event.js.map +13 -0
- package/package.json +12 -6
- package/schema.json +3483 -810
- package/scss/_properties.scss +20 -6
- package/scss/_variables.scss +1 -0
- package/scss/components/_avatar.scss +27 -9
- package/scss/components/_calendar.scss +291 -0
- package/scss/components/_card.scss +1 -1
- package/scss/components/_cascader.scss +102 -0
- package/scss/components/_city-area.scss +27 -0
- package/scss/components/_collapse-group.scss +1 -3
- package/scss/components/_debug.scss +167 -0
- package/scss/components/_dropdown.scss +39 -9
- package/scss/components/_formula.scss +30 -6
- package/scss/components/_modal.scss +18 -0
- package/scss/components/_panel.scss +45 -0
- package/scss/components/_picker-columns.scss +15 -5
- package/scss/components/_popup.scss +43 -16
- package/scss/components/_result-box.scss +31 -0
- package/scss/components/_timeline.scss +198 -0
- package/scss/components/form/_checks.scss +2 -0
- package/scss/components/form/_color.scss +2 -2
- package/scss/components/form/_date-range.scss +34 -1
- package/scss/components/form/_date.scss +46 -1
- package/scss/components/form/_form.scss +170 -0
- package/scss/components/form/_nested-select.scss +3 -0
- package/scss/components/form/_result-list.scss +2 -0
- package/scss/components/form/_select.scss +32 -3
- package/scss/components/form/_selection.scss +5 -4
- package/scss/components/form/_transfer.scss +3 -0
- package/scss/components/form/_tree-select.scss +1 -1
- package/scss/themes/_antd-variables.scss +45 -0
- package/scss/themes/_common.scss +5 -0
- package/scss/themes/_cxd-variables.scss +51 -2
- package/scss/themes/_dark-variables.scss +4 -0
- package/scss/themes/cxd.scss +0 -19
- package/sdk/ang-ie11.css +1450 -142
- package/sdk/ang.css +1473 -159
- package/sdk/antd-ie11.css +1451 -142
- package/sdk/antd.css +1511 -159
- package/sdk/charts.js +15 -15
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +1449 -159
- package/sdk/cxd.css +1514 -179
- package/sdk/dark-ie11.css +1450 -142
- package/sdk/dark.css +1476 -159
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/locale/de-DE.js +17 -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 +1449 -159
- package/sdk/sdk.css +1514 -179
- package/sdk/sdk.js +1311 -1253
- 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/RootRenderer.tsx +27 -1
- package/src/Schema.ts +3 -0
- package/src/SchemaRenderer.tsx +70 -4
- package/src/Scoped.tsx +46 -4
- package/src/actions/Action.ts +138 -0
- package/src/actions/AjaxAction.ts +58 -0
- package/src/actions/BreakAction.ts +27 -0
- package/src/actions/BroadcastAction.ts +41 -0
- package/src/actions/CmptAction.ts +36 -0
- package/src/actions/ContinueAction.ts +27 -0
- package/src/actions/CopyAction.ts +41 -0
- package/src/actions/CustomAction.ts +46 -0
- package/src/actions/DialogAction.ts +28 -0
- package/src/actions/DrawerAction.ts +28 -0
- package/src/actions/EmailAction.ts +38 -0
- package/src/actions/LoopAction.ts +77 -0
- package/src/actions/OpenPageAction.ts +39 -0
- package/src/actions/ParallelAction.ts +26 -0
- package/src/actions/SwitchAction.ts +35 -0
- package/src/actions/index.ts +20 -0
- 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 +658 -0
- package/src/components/Cascader.tsx +564 -0
- package/src/components/ChainedSelection.tsx +16 -3
- package/src/components/CityArea.tsx +315 -0
- package/src/components/ColorPicker.tsx +41 -40
- package/src/components/DatePicker.tsx +80 -34
- package/src/components/DateRangePicker.tsx +85 -30
- package/src/components/GroupedSelection.tsx +14 -2
- package/src/components/MonthRangePicker.tsx +78 -31
- package/src/components/Overlay.tsx +1 -1
- package/src/components/Picker.tsx +55 -35
- package/src/components/PickerColumn.tsx +43 -36
- package/src/components/PickerContainer.tsx +13 -1
- package/src/components/PopOverContainer.tsx +31 -17
- package/src/components/PopUp.tsx +84 -57
- package/src/components/ResultBox.tsx +14 -2
- package/src/components/ResultList.tsx +36 -6
- package/src/components/Select.tsx +24 -26
- package/src/components/Selection.tsx +21 -3
- package/src/components/Steps.tsx +23 -10
- 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 +36 -0
- package/src/components/TimelineItem.tsx +140 -0
- package/src/components/Transfer.tsx +11 -8
- package/src/components/TransferDropDown.tsx +20 -12
- package/src/components/TransferPicker.tsx +25 -4
- package/src/components/TreeSelection.tsx +7 -1
- package/src/components/calendar/Calendar.tsx +101 -4
- package/src/components/calendar/DaysView.tsx +165 -33
- package/src/components/calendar/MonthsView.tsx +108 -1
- package/src/components/calendar/QuartersView.tsx +3 -2
- package/src/components/calendar/TimeView.tsx +104 -41
- package/src/components/calendar/YearsView.tsx +34 -17
- package/src/components/condition-builder/Field.tsx +1 -3
- package/src/components/condition-builder/Func.tsx +1 -1
- package/src/components/formula/Editor.tsx +16 -11
- package/src/components/formula/FuncList.tsx +3 -1
- package/src/components/formula/Picker.tsx +2 -1
- package/src/components/formula/plugin.ts +0 -2
- package/src/components/icons.tsx +2 -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/env.tsx +22 -0
- package/src/factory.tsx +93 -1
- package/src/icons/tree-down.svg +5 -0
- package/src/index.tsx +5 -0
- package/src/locale/de-DE.ts +17 -2
- package/src/locale/en-US.ts +17 -2
- package/src/locale/zh-CN.ts +16 -1
- package/src/renderers/Action.tsx +11 -2
- 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 +7 -4
- package/src/renderers/DropDownButton.tsx +69 -35
- 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/CityDB.ts +526 -2
- package/src/renderers/Form/DiffEditor.tsx +2 -3
- package/src/renderers/Form/InputCity.tsx +23 -3
- package/src/renderers/Form/InputColor.tsx +21 -2
- package/src/renderers/Form/InputDate.tsx +48 -20
- package/src/renderers/Form/InputDateRange.tsx +9 -2
- package/src/renderers/Form/InputFormula.tsx +9 -4
- package/src/renderers/Form/InputImage.tsx +9 -4
- package/src/renderers/Form/InputMonthRange.tsx +0 -1
- package/src/renderers/Form/InputQuarterRange.tsx +0 -1
- package/src/renderers/Form/InputYearRange.tsx +0 -1
- package/src/renderers/Form/Item.tsx +29 -8
- package/src/renderers/Form/NestedSelect.tsx +32 -4
- package/src/renderers/Form/Options.tsx +15 -7
- package/src/renderers/Form/Select.tsx +21 -5
- 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 +18 -16
- package/src/renderers/Form/index.tsx +9 -2
- package/src/renderers/IFrame.tsx +0 -2
- package/src/renderers/Link.tsx +18 -3
- package/src/renderers/Nav.tsx +4 -1
- package/src/renderers/Remark.tsx +68 -18
- package/src/renderers/Steps.tsx +11 -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/schemaExtend.ts +22 -10
- package/src/store/combo.ts +1 -3
- package/src/store/formItem.ts +3 -3
- package/src/store/table.ts +2 -1
- package/src/utils/RootClose.ts +5 -1
- package/src/utils/api.ts +15 -2
- package/src/utils/debug.tsx +438 -0
- package/src/utils/helper.ts +6 -16
- package/src/utils/renderer-event.ts +75 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CopyAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var tpl_1 = require("../utils/tpl");
|
6
|
+
var Action_1 = require("./Action");
|
7
|
+
/**
|
8
|
+
* 复制动作
|
9
|
+
*
|
10
|
+
* @export
|
11
|
+
* @class CopyAction
|
12
|
+
* @implements {Action}
|
13
|
+
*/
|
14
|
+
var CopyAction = /** @class */ (function () {
|
15
|
+
function CopyAction() {
|
16
|
+
}
|
17
|
+
CopyAction.prototype.run = function (action, renderer, event) {
|
18
|
+
var _a, _b;
|
19
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
20
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
21
|
+
debugger;
|
22
|
+
if (action.content || action.copy) {
|
23
|
+
(_b = (_a = renderer.props.env).copy) === null || _b === void 0 ? void 0 : _b.call(_a, (0, tpl_1.filter)(action.content || action.copy, action.args, '| raw'), {
|
24
|
+
format: action.copyFormat
|
25
|
+
});
|
26
|
+
}
|
27
|
+
return [2 /*return*/];
|
28
|
+
});
|
29
|
+
});
|
30
|
+
};
|
31
|
+
return CopyAction;
|
32
|
+
}());
|
33
|
+
exports.CopyAction = CopyAction;
|
34
|
+
(0, Action_1.registerAction)('copy', new CopyAction());
|
35
|
+
//# sourceMappingURL=./actions/CopyAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "CopyAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/CopyAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AAEA,oCAAoC;AAIpC,mCAMkB;AAGlB;;;;;;GAMG;AACH;IAAA;IAgBA,CAAC;IAfO,wBAAG,GAAT,UACE,MAAsB,EACtB,QAAyB,EACzB,KAAyB;;;;gBAEzB,QAAQ,CAAC;gBACT,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE;oBACjC,MAAA,MAAA,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAC,IAAI,mDACrB,IAAA,YAAM,EAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,EAC3D;wBACE,MAAM,EAAE,MAAM,CAAC,UAAU;qBAC1B,CACF,CAAC;iBACH;;;;KACF;IACH,iBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,gCAAU;AAkBvB,IAAA,uBAAc,EAAC,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {dataMapping} from '../utils/tpl-builtin';\nimport {filter} from '../utils/tpl';\nimport pick from 'lodash/pick';\nimport mapValues from 'lodash/mapValues';\nimport qs from 'qs';\nimport {\n Action,\n ListenerAction,\n ListenerContext,\n LoopStatus,\n registerAction\n} from './Action';\nimport {isVisible} from '../utils/helper';\n\n/**\n * 复制动作\n *\n * @export\n * @class CopyAction\n * @implements {Action}\n */\nexport class CopyAction implements Action {\n async run(\n action: ListenerAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n debugger;\n if (action.content || action.copy) {\n renderer.props.env.copy?.(\n filter(action.content || action.copy, action.args, '| raw'),\n {\n format: action.copyFormat\n }\n );\n }\n }\n}\n\nregisterAction('copy', new CopyAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerAction, ListenerContext } from './Action';
|
3
|
+
/**
|
4
|
+
* 自定义动作,JS脚本
|
5
|
+
*
|
6
|
+
* @export
|
7
|
+
* @class CustomAction
|
8
|
+
* @implements {Action}
|
9
|
+
*/
|
10
|
+
export declare class CustomAction implements Action {
|
11
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CustomAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var Action_1 = require("./Action");
|
6
|
+
/**
|
7
|
+
* 自定义动作,JS脚本
|
8
|
+
*
|
9
|
+
* @export
|
10
|
+
* @class CustomAction
|
11
|
+
* @implements {Action}
|
12
|
+
*/
|
13
|
+
var CustomAction = /** @class */ (function () {
|
14
|
+
function CustomAction() {
|
15
|
+
}
|
16
|
+
CustomAction.prototype.run = function (action, renderer, event) {
|
17
|
+
var _a;
|
18
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
19
|
+
var scriptFunc;
|
20
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
21
|
+
switch (_b.label) {
|
22
|
+
case 0:
|
23
|
+
scriptFunc = action.script;
|
24
|
+
if (typeof scriptFunc === 'string') {
|
25
|
+
scriptFunc = new Function('context', 'doAction', 'event', scriptFunc);
|
26
|
+
}
|
27
|
+
// 外部可以直接调用doAction来完成动作调用
|
28
|
+
// 可以通过上下文直接编排动作调用,通过event来进行动作干预
|
29
|
+
return [4 /*yield*/, ((_a = scriptFunc) === null || _a === void 0 ? void 0 : _a.call(null, renderer, renderer.doAction.bind(renderer), event))];
|
30
|
+
case 1:
|
31
|
+
// 外部可以直接调用doAction来完成动作调用
|
32
|
+
// 可以通过上下文直接编排动作调用,通过event来进行动作干预
|
33
|
+
_b.sent();
|
34
|
+
return [2 /*return*/];
|
35
|
+
}
|
36
|
+
});
|
37
|
+
});
|
38
|
+
};
|
39
|
+
return CustomAction;
|
40
|
+
}());
|
41
|
+
exports.CustomAction = CustomAction;
|
42
|
+
(0, Action_1.registerAction)('custom', new CustomAction());
|
43
|
+
//# sourceMappingURL=./actions/CustomAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "CustomAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/CustomAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,mCAMkB;AAElB;;;;;;GAMG;AACH;IAAA;IA2BA,CAAC;IA1BO,0BAAG,GAAT,UACE,MAAsB,EACtB,QAAyB,EACzB,KAAyB;;;;;;;wBAGrB,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;wBAE/B,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;4BAClC,UAAU,GAAG,IAAI,QAAQ,CACvB,SAAS,EACT,UAAU,EACV,OAAO,EACP,UAAU,CACJ,CAAC;yBACV;wBAED,0BAA0B;wBAC1B,iCAAiC;wBACjC,qBAAM,CAAA,MAAC,UAAkB,0CAAE,IAAI,CAC7B,IAAI,EACJ,QAAQ,EACR,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAChC,KAAK,CACN,CAAA,EAAA;;wBAPD,0BAA0B;wBAC1B,iCAAiC;wBACjC,SAKC,CAAC;;;;;KACH;IACH,mBAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,oCAAY;AA6BzB,IAAA,uBAAc,EAAC,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {\n Action,\n ListenerAction,\n ListenerContext,\n LoopStatus,\n registerAction\n} from './Action';\n\n/**\n * 自定义动作,JS脚本\n *\n * @export\n * @class CustomAction\n * @implements {Action}\n */\nexport class CustomAction implements Action {\n async run(\n action: ListenerAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n // 执行自定义编排脚本\n let scriptFunc = action.script;\n\n if (typeof scriptFunc === 'string') {\n scriptFunc = new Function(\n 'context',\n 'doAction',\n 'event',\n scriptFunc\n ) as any;\n }\n\n // 外部可以直接调用doAction来完成动作调用\n // 可以通过上下文直接编排动作调用,通过event来进行动作干预\n await (scriptFunc as any)?.call(\n null,\n renderer,\n renderer.doAction.bind(renderer),\n event\n );\n }\n}\n\nregisterAction('custom', new CustomAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerAction, ListenerContext } from './Action';
|
3
|
+
/**
|
4
|
+
* 打开弹窗动作
|
5
|
+
*
|
6
|
+
* @export
|
7
|
+
* @class DialogAction
|
8
|
+
* @implements {Action}
|
9
|
+
*/
|
10
|
+
export declare class DialogAction implements Action {
|
11
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DialogAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var Action_1 = require("./Action");
|
6
|
+
/**
|
7
|
+
* 打开弹窗动作
|
8
|
+
*
|
9
|
+
* @export
|
10
|
+
* @class DialogAction
|
11
|
+
* @implements {Action}
|
12
|
+
*/
|
13
|
+
var DialogAction = /** @class */ (function () {
|
14
|
+
function DialogAction() {
|
15
|
+
}
|
16
|
+
DialogAction.prototype.run = function (action, renderer, event) {
|
17
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
18
|
+
var store;
|
19
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
20
|
+
store = renderer.props.store;
|
21
|
+
store.setCurrentAction(action);
|
22
|
+
store.openDialog(action.args);
|
23
|
+
return [2 /*return*/];
|
24
|
+
});
|
25
|
+
});
|
26
|
+
};
|
27
|
+
return DialogAction;
|
28
|
+
}());
|
29
|
+
exports.DialogAction = DialogAction;
|
30
|
+
(0, Action_1.registerAction)('dialog', new DialogAction());
|
31
|
+
//# sourceMappingURL=./actions/DialogAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "DialogAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/DialogAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,mCAKkB;AAElB;;;;;;GAMG;AACH;IAAA;IAUA,CAAC;IATO,0BAAG,GAAT,UACE,MAAsB,EACtB,QAAyB,EACzB,KAAyB;;;;gBAEnB,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;gBACnC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC/B,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;;;KAC/B;IACH,mBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,oCAAY;AAYzB,IAAA,uBAAc,EAAC,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {\n Action,\n ListenerAction,\n ListenerContext,\n registerAction\n} from './Action';\n\n/**\n * 打开弹窗动作\n *\n * @export\n * @class DialogAction\n * @implements {Action}\n */\nexport class DialogAction implements Action {\n async run(\n action: ListenerAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n const store = renderer.props.store;\n store.setCurrentAction(action);\n store.openDialog(action.args);\n }\n}\n\nregisterAction('dialog', new DialogAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerAction, ListenerContext } from './Action';
|
3
|
+
/**
|
4
|
+
* 打开抽屉动作
|
5
|
+
*
|
6
|
+
* @export
|
7
|
+
* @class DrawerAction
|
8
|
+
* @implements {Action}
|
9
|
+
*/
|
10
|
+
export declare class DrawerAction implements Action {
|
11
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DrawerAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var Action_1 = require("./Action");
|
6
|
+
/**
|
7
|
+
* 打开抽屉动作
|
8
|
+
*
|
9
|
+
* @export
|
10
|
+
* @class DrawerAction
|
11
|
+
* @implements {Action}
|
12
|
+
*/
|
13
|
+
var DrawerAction = /** @class */ (function () {
|
14
|
+
function DrawerAction() {
|
15
|
+
}
|
16
|
+
DrawerAction.prototype.run = function (action, renderer, event) {
|
17
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
18
|
+
var store;
|
19
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
20
|
+
store = renderer.props.store;
|
21
|
+
store.setCurrentAction(action);
|
22
|
+
store.openDrawer(action.args);
|
23
|
+
return [2 /*return*/];
|
24
|
+
});
|
25
|
+
});
|
26
|
+
};
|
27
|
+
return DrawerAction;
|
28
|
+
}());
|
29
|
+
exports.DrawerAction = DrawerAction;
|
30
|
+
(0, Action_1.registerAction)('drawer', new DrawerAction());
|
31
|
+
//# sourceMappingURL=./actions/DrawerAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "DrawerAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/DrawerAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,mCAKkB;AAElB;;;;;;GAMG;AACH;IAAA;IAUA,CAAC;IATO,0BAAG,GAAT,UACE,MAAsB,EACtB,QAAyB,EACzB,KAAyB;;;;gBAEnB,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;gBACnC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC/B,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;;;KAC/B;IACH,mBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,oCAAY;AAYzB,IAAA,uBAAc,EAAC,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {\n Action,\n ListenerAction,\n ListenerContext,\n registerAction\n} from './Action';\n\n/**\n * 打开抽屉动作\n *\n * @export\n * @class DrawerAction\n * @implements {Action}\n */\nexport class DrawerAction implements Action {\n async run(\n action: ListenerAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n const store = renderer.props.store;\n store.setCurrentAction(action);\n store.openDrawer(action.args);\n }\n}\n\nregisterAction('drawer', new DrawerAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerAction, ListenerContext } from './Action';
|
3
|
+
/**
|
4
|
+
* 邮件动作
|
5
|
+
*
|
6
|
+
* @export
|
7
|
+
* @class EmailAction
|
8
|
+
* @implements {Action}
|
9
|
+
*/
|
10
|
+
export declare class EmailAction implements Action {
|
11
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.EmailAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var tpl_1 = require("../utils/tpl");
|
6
|
+
var pick_1 = (0, tslib_1.__importDefault)(require("lodash/pick"));
|
7
|
+
var mapValues_1 = (0, tslib_1.__importDefault)(require("lodash/mapValues"));
|
8
|
+
var qs_1 = (0, tslib_1.__importDefault)(require("qs"));
|
9
|
+
var Action_1 = require("./Action");
|
10
|
+
/**
|
11
|
+
* 邮件动作
|
12
|
+
*
|
13
|
+
* @export
|
14
|
+
* @class EmailAction
|
15
|
+
* @implements {Action}
|
16
|
+
*/
|
17
|
+
var EmailAction = /** @class */ (function () {
|
18
|
+
function EmailAction() {
|
19
|
+
}
|
20
|
+
EmailAction.prototype.run = function (action, renderer, event) {
|
21
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
22
|
+
var mailTo, mailInfo, mailStr, mailto;
|
23
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
24
|
+
mailTo = (0, tpl_1.filter)(action.to, action.args);
|
25
|
+
mailInfo = (0, mapValues_1.default)((0, pick_1.default)(action, 'to', 'cc', 'bcc', 'subject', 'body'), function (val) { return (0, tpl_1.filter)(val, action.args); });
|
26
|
+
mailStr = qs_1.default.stringify(mailInfo);
|
27
|
+
mailto = "mailto:" + mailTo + "?" + mailStr;
|
28
|
+
window.open(mailto);
|
29
|
+
return [2 /*return*/];
|
30
|
+
});
|
31
|
+
});
|
32
|
+
};
|
33
|
+
return EmailAction;
|
34
|
+
}());
|
35
|
+
exports.EmailAction = EmailAction;
|
36
|
+
(0, Action_1.registerAction)('email', new EmailAction());
|
37
|
+
//# sourceMappingURL=./actions/EmailAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "EmailAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/EmailAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,oCAAoC;AACpC,kEAA+B;AAC/B,4EAAyC;AACzC,uDAAoB;AACpB,mCAKkB;AAElB;;;;;;GAMG;AACH;IAAA;IAgBA,CAAC;IAfO,yBAAG,GAAT,UACE,MAAsB,EACtB,QAAyB,EACzB,KAAyB;;;;gBAEnB,MAAM,GAAG,IAAA,YAAM,EAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBACxC,QAAQ,GAAG,IAAA,mBAAS,EACxB,IAAA,cAAI,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAClD,UAAA,GAAG,IAAI,OAAA,IAAA,YAAM,EAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,EAAxB,CAAwB,CAChC,CAAC;gBACI,OAAO,GAAG,YAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBACjC,MAAM,GAAG,YAAU,MAAM,SAAI,OAAS,CAAC;gBAE7C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;;;KACrB;IACH,kBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,kCAAW;AAkBxB,IAAA,uBAAc,EAAC,OAAO,EAAE,IAAI,WAAW,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {filter} from '../utils/tpl';\nimport pick from 'lodash/pick';\nimport mapValues from 'lodash/mapValues';\nimport qs from 'qs';\nimport {\n Action,\n ListenerAction,\n ListenerContext,\n registerAction\n} from './Action';\n\n/**\n * 邮件动作\n *\n * @export\n * @class EmailAction\n * @implements {Action}\n */\nexport class EmailAction implements Action {\n async run(\n action: ListenerAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n const mailTo = filter(action.to, action.args);\n const mailInfo = mapValues(\n pick(action, 'to', 'cc', 'bcc', 'subject', 'body'),\n val => filter(val, action.args)\n );\n const mailStr = qs.stringify(mailInfo);\n const mailto = `mailto:${mailTo}?${mailStr}`;\n\n window.open(mailto);\n }\n}\n\nregisterAction('email', new EmailAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerContext, LogicAction } from './Action';
|
3
|
+
/**
|
4
|
+
* 循环动作
|
5
|
+
*
|
6
|
+
* @export
|
7
|
+
* @class LoopAction
|
8
|
+
* @implements {Action}
|
9
|
+
*/
|
10
|
+
export declare class LoopAction implements Action {
|
11
|
+
run(action: LogicAction, renderer: ListenerContext, event: RendererEvent<any>, mergeData: any): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LoopAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var helper_1 = require("../utils/helper");
|
6
|
+
var Action_1 = require("./Action");
|
7
|
+
var tpl_builtin_1 = require("../utils/tpl-builtin");
|
8
|
+
/**
|
9
|
+
* 循环动作
|
10
|
+
*
|
11
|
+
* @export
|
12
|
+
* @class LoopAction
|
13
|
+
* @implements {Action}
|
14
|
+
*/
|
15
|
+
var LoopAction = /** @class */ (function () {
|
16
|
+
function LoopAction() {
|
17
|
+
}
|
18
|
+
LoopAction.prototype.run = function (action, renderer, event, mergeData) {
|
19
|
+
var _a;
|
20
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
21
|
+
var loopData, protoData, _i, loopData_1, data, _b, _c, subAction;
|
22
|
+
return (0, tslib_1.__generator)(this, function (_d) {
|
23
|
+
switch (_d.label) {
|
24
|
+
case 0:
|
25
|
+
if (typeof action.loopName !== 'string') {
|
26
|
+
console.warn('loopName 必须是字符串类型');
|
27
|
+
return [2 /*return*/];
|
28
|
+
}
|
29
|
+
loopData = (0, tpl_builtin_1.resolveVariable)(action.loopName, mergeData) || [];
|
30
|
+
if (!!loopData) return [3 /*break*/, 1];
|
31
|
+
console.warn("\u6CA1\u6709\u627E\u5230\u6570\u636E " + action.loopName);
|
32
|
+
return [3 /*break*/, 10];
|
33
|
+
case 1:
|
34
|
+
if (!!Array.isArray(loopData)) return [3 /*break*/, 2];
|
35
|
+
console.warn(action.loopName + " \u6570\u636E\u4E0D\u662F\u6570\u7EC4");
|
36
|
+
return [3 /*break*/, 10];
|
37
|
+
case 2:
|
38
|
+
if (!((_a = action.children) === null || _a === void 0 ? void 0 : _a.length)) return [3 /*break*/, 10];
|
39
|
+
protoData = event.data;
|
40
|
+
_i = 0, loopData_1 = loopData;
|
41
|
+
_d.label = 3;
|
42
|
+
case 3:
|
43
|
+
if (!(_i < loopData_1.length)) return [3 /*break*/, 9];
|
44
|
+
data = loopData_1[_i];
|
45
|
+
renderer.loopStatus = Action_1.LoopStatus.NORMAL;
|
46
|
+
// 追加逻辑处理中的数据,事件数据优先,用完还要还原
|
47
|
+
event.setData((0, helper_1.createObject)(event.data, data));
|
48
|
+
_b = 0, _c = action.children;
|
49
|
+
_d.label = 4;
|
50
|
+
case 4:
|
51
|
+
if (!(_b < _c.length)) return [3 /*break*/, 7];
|
52
|
+
subAction = _c[_b];
|
53
|
+
// @ts-ignore
|
54
|
+
if (renderer.loopStatus === Action_1.LoopStatus.CONTINUE) {
|
55
|
+
return [3 /*break*/, 6];
|
56
|
+
}
|
57
|
+
return [4 /*yield*/, (0, Action_1.runActions)(subAction, renderer, event)];
|
58
|
+
case 5:
|
59
|
+
_d.sent();
|
60
|
+
// @ts-ignore
|
61
|
+
if (renderer.loopStatus === Action_1.LoopStatus.BREAK || event.stoped) {
|
62
|
+
// 还原事件数据
|
63
|
+
event.setData(protoData);
|
64
|
+
return [3 /*break*/, 7];
|
65
|
+
}
|
66
|
+
_d.label = 6;
|
67
|
+
case 6:
|
68
|
+
_b++;
|
69
|
+
return [3 /*break*/, 4];
|
70
|
+
case 7:
|
71
|
+
if (event.stoped) {
|
72
|
+
// 还原事件数据
|
73
|
+
event.setData(protoData);
|
74
|
+
return [3 /*break*/, 9];
|
75
|
+
}
|
76
|
+
_d.label = 8;
|
77
|
+
case 8:
|
78
|
+
_i++;
|
79
|
+
return [3 /*break*/, 3];
|
80
|
+
case 9:
|
81
|
+
renderer.loopStatus = Action_1.LoopStatus.NORMAL;
|
82
|
+
event.setData(protoData);
|
83
|
+
_d.label = 10;
|
84
|
+
case 10: return [2 /*return*/];
|
85
|
+
}
|
86
|
+
});
|
87
|
+
});
|
88
|
+
};
|
89
|
+
return LoopAction;
|
90
|
+
}());
|
91
|
+
exports.LoopAction = LoopAction;
|
92
|
+
(0, Action_1.registerAction)('loop', new LoopAction());
|
93
|
+
//# sourceMappingURL=./actions/LoopAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "LoopAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/LoopAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,0CAA6C;AAC7C,mCAQkB;AAClB,oDAAqD;AAErD;;;;;;GAMG;AACH;IAAA;IAsDA,CAAC;IArDO,wBAAG,GAAT,UACE,MAAmB,EACnB,QAAyB,EACzB,KAAyB,EACzB,SAAc;;;;;;;wBAEd,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;4BACvC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;4BAClC,sBAAO;yBACR;wBAEK,QAAQ,GAAG,IAAA,6BAAe,EAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;6BAG/D,CAAC,QAAQ,EAAT,wBAAS;wBACX,OAAO,CAAC,IAAI,CAAC,0CAAU,MAAM,CAAC,QAAU,CAAC,CAAC;;;6BACjC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAxB,wBAAwB;wBACjC,OAAO,CAAC,IAAI,CAAI,MAAM,CAAC,QAAQ,0CAAS,CAAC,CAAC;;;6BACjC,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,MAAM,CAAA,EAAvB,yBAAuB;wBAE1B,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;8BAEF,EAAR,qBAAQ;;;6BAAR,CAAA,sBAAQ,CAAA;wBAAhB,IAAI;wBACb,QAAQ,CAAC,UAAU,GAAG,mBAAU,CAAC,MAAM,CAAC;wBACxC,2BAA2B;wBAC3B,KAAK,CAAC,OAAO,CAAC,IAAA,qBAAY,EAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;8BAEP,EAAf,KAAA,MAAM,CAAC,QAAQ;;;6BAAf,CAAA,cAAe,CAAA;wBAA5B,SAAS;wBAClB,aAAa;wBACb,IAAI,QAAQ,CAAC,UAAU,KAAK,mBAAU,CAAC,QAAQ,EAAE;4BAC/C,wBAAS;yBACV;wBACD,qBAAM,IAAA,mBAAU,EAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAA;;wBAA5C,SAA4C,CAAC;wBAE7C,aAAa;wBACb,IAAI,QAAQ,CAAC,UAAU,KAAK,mBAAU,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;4BAC5D,SAAS;4BACT,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;4BACzB,wBAAM;yBACP;;;wBAZqB,IAAe,CAAA;;;wBAevC,IAAI,KAAK,CAAC,MAAM,EAAE;4BAChB,SAAS;4BACT,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;4BACzB,wBAAM;yBACP;;;wBAxBgB,IAAQ,CAAA;;;wBA2B3B,QAAQ,CAAC,UAAU,GAAG,mBAAU,CAAC,MAAM,CAAC;wBACxC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;;;;;;KAE5B;IACH,iBAAC;AAAD,CAAC,AAtDD,IAsDC;AAtDY,gCAAU;AAwDvB,IAAA,uBAAc,EAAC,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {createObject} from '../utils/helper';\nimport {\n Action,\n ListenerContext,\n LogicAction,\n LoopStatus,\n registerAction,\n runAction,\n runActions\n} from './Action';\nimport {resolveVariable} from '../utils/tpl-builtin';\n\n/**\n * 循环动作\n *\n * @export\n * @class LoopAction\n * @implements {Action}\n */\nexport class LoopAction implements Action {\n async run(\n action: LogicAction,\n renderer: ListenerContext,\n event: RendererEvent<any>,\n mergeData: any\n ) {\n if (typeof action.loopName !== 'string') {\n console.warn('loopName 必须是字符串类型');\n return;\n }\n\n const loopData = resolveVariable(action.loopName, mergeData) || [];\n\n // 必须是数组\n if (!loopData) {\n console.warn(`没有找到数据 ${action.loopName}`);\n } else if (!Array.isArray(loopData)) {\n console.warn(`${action.loopName} 数据不是数组`);\n } else if (action.children?.length) {\n // 暂存一下\n const protoData = event.data;\n\n for (const data of loopData) {\n renderer.loopStatus = LoopStatus.NORMAL;\n // 追加逻辑处理中的数据,事件数据优先,用完还要还原\n event.setData(createObject(event.data, data));\n\n for (const subAction of action.children) {\n // @ts-ignore\n if (renderer.loopStatus === LoopStatus.CONTINUE) {\n continue;\n }\n await runActions(subAction, renderer, event);\n\n // @ts-ignore\n if (renderer.loopStatus === LoopStatus.BREAK || event.stoped) {\n // 还原事件数据\n event.setData(protoData);\n break;\n }\n }\n\n if (event.stoped) {\n // 还原事件数据\n event.setData(protoData);\n break;\n }\n }\n\n renderer.loopStatus = LoopStatus.NORMAL;\n event.setData(protoData);\n }\n }\n}\n\nregisterAction('loop', new LoopAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerAction, ListenerContext } from './Action';
|
3
|
+
/**
|
4
|
+
* 打开页面动作
|
5
|
+
*
|
6
|
+
* @export
|
7
|
+
* @class OpenPageAction
|
8
|
+
* @implements {Action}
|
9
|
+
*/
|
10
|
+
export declare class OpenPageAction implements Action {
|
11
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
12
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OpenPageAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var tpl_1 = require("../utils/tpl");
|
6
|
+
var Action_1 = require("./Action");
|
7
|
+
/**
|
8
|
+
* 打开页面动作
|
9
|
+
*
|
10
|
+
* @export
|
11
|
+
* @class OpenPageAction
|
12
|
+
* @implements {Action}
|
13
|
+
*/
|
14
|
+
var OpenPageAction = /** @class */ (function () {
|
15
|
+
function OpenPageAction() {
|
16
|
+
}
|
17
|
+
OpenPageAction.prototype.run = function (action, renderer, event) {
|
18
|
+
var _a;
|
19
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
20
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
21
|
+
if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.jumpTo)) {
|
22
|
+
throw new Error('env.jumpTo is required!');
|
23
|
+
}
|
24
|
+
renderer.props.env.jumpTo((0, tpl_1.filter)((action.to || action.url || action.link), action.args, '| raw'), action, action.args);
|
25
|
+
return [2 /*return*/];
|
26
|
+
});
|
27
|
+
});
|
28
|
+
};
|
29
|
+
return OpenPageAction;
|
30
|
+
}());
|
31
|
+
exports.OpenPageAction = OpenPageAction;
|
32
|
+
(0, Action_1.registerAction)('openpage', new OpenPageAction());
|
33
|
+
//# sourceMappingURL=./actions/OpenPageAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "OpenPageAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/OpenPageAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,oCAAoC;AACpC,mCAKkB;AAElB;;;;;;GAMG;AACH;IAAA;IAoBA,CAAC;IAnBO,4BAAG,GAAT,UACE,MAAsB,EACtB,QAAyB,EACzB,KAAyB;;;;gBAEzB,IAAI,CAAC,CAAA,MAAA,QAAQ,CAAC,KAAK,CAAC,GAAG,0CAAE,MAAM,CAAA,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;iBAC5C;gBAED,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CACvB,IAAA,YAAM,EACJ,CAAC,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,CAAW,EAClD,MAAM,CAAC,IAAI,EACX,OAAO,CACR,EACD,MAAM,EACN,MAAM,CAAC,IAAI,CACZ,CAAC;;;;KACH;IACH,qBAAC;AAAD,CAAC,AApBD,IAoBC;AApBY,wCAAc;AAsB3B,IAAA,uBAAc,EAAC,UAAU,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {filter} from '../utils/tpl';\nimport {\n Action,\n ListenerAction,\n ListenerContext,\n registerAction\n} from './Action';\n\n/**\n * 打开页面动作\n *\n * @export\n * @class OpenPageAction\n * @implements {Action}\n */\nexport class OpenPageAction implements Action {\n async run(\n action: ListenerAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n if (!renderer.props.env?.jumpTo) {\n throw new Error('env.jumpTo is required!');\n }\n\n renderer.props.env.jumpTo(\n filter(\n (action.to || action.url || action.link) as string,\n action.args,\n '| raw'\n ),\n action,\n action.args\n );\n }\n}\n\nregisterAction('openpage', new OpenPageAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerContext, LogicAction } from './Action';
|
3
|
+
export declare class ParallelAction implements Action {
|
4
|
+
run(action: LogicAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
5
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ParallelAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var Action_1 = require("./Action");
|
6
|
+
var ParallelAction = /** @class */ (function () {
|
7
|
+
function ParallelAction() {
|
8
|
+
}
|
9
|
+
ParallelAction.prototype.run = function (action, renderer, event) {
|
10
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
11
|
+
var childActions;
|
12
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
13
|
+
switch (_a.label) {
|
14
|
+
case 0:
|
15
|
+
if (!(action.children && action.children.length)) return [3 /*break*/, 2];
|
16
|
+
childActions = action.children.map(function (child) {
|
17
|
+
// 并行动作互不干扰,但不管哪个存在干预都对后续动作生效
|
18
|
+
return (0, Action_1.runActions)(child, renderer, event);
|
19
|
+
});
|
20
|
+
return [4 /*yield*/, Promise.all(childActions)];
|
21
|
+
case 1:
|
22
|
+
_a.sent();
|
23
|
+
_a.label = 2;
|
24
|
+
case 2: return [2 /*return*/];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
28
|
+
};
|
29
|
+
return ParallelAction;
|
30
|
+
}());
|
31
|
+
exports.ParallelAction = ParallelAction;
|
32
|
+
(0, Action_1.registerAction)('parallel', new ParallelAction());
|
33
|
+
//# sourceMappingURL=./actions/ParallelAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "ParallelAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/ParallelAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,mCAMkB;AAElB;IAAA;IAcA,CAAC;IAbO,4BAAG,GAAT,UACE,MAAmB,EACnB,QAAyB,EACzB,KAAyB;;;;;;6BAErB,CAAA,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAA,EAAzC,wBAAyC;wBACrC,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAC,KAAkB;4BAC1D,6BAA6B;4BAC7B,OAAO,IAAA,mBAAU,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;wBAC5C,CAAC,CAAC,CAAC;wBACH,qBAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAA;;wBAA/B,SAA+B,CAAC;;;;;;KAEnC;IACH,qBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,wCAAc;AAgB3B,IAAA,uBAAc,EAAC,UAAU,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {\n Action,\n ListenerContext,\n LogicAction,\n registerAction,\n runActions\n} from './Action';\n\nexport class ParallelAction implements Action {\n async run(\n action: LogicAction,\n renderer: ListenerContext,\n event: RendererEvent<any>\n ) {\n if (action.children && action.children.length) {\n const childActions = action.children.map((child: LogicAction) => {\n // 并行动作互不干扰,但不管哪个存在干预都对后续动作生效\n return runActions(child, renderer, event);\n });\n await Promise.all(childActions);\n }\n }\n}\n\nregisterAction('parallel', new ParallelAction());\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
2
|
+
import { Action, ListenerContext, LogicAction } from './Action';
|
3
|
+
/**
|
4
|
+
* 排他动作
|
5
|
+
*/
|
6
|
+
export declare class SwitchAction implements Action {
|
7
|
+
run(action: LogicAction, renderer: ListenerContext, event: RendererEvent<any>, mergeData: any): Promise<void>;
|
8
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SwitchAction = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var tpl_1 = require("../utils/tpl");
|
6
|
+
var Action_1 = require("./Action");
|
7
|
+
/**
|
8
|
+
* 排他动作
|
9
|
+
*/
|
10
|
+
var SwitchAction = /** @class */ (function () {
|
11
|
+
function SwitchAction() {
|
12
|
+
}
|
13
|
+
SwitchAction.prototype.run = function (action, renderer, event, mergeData) {
|
14
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
15
|
+
var _i, _a, branch;
|
16
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
17
|
+
switch (_b.label) {
|
18
|
+
case 0:
|
19
|
+
_i = 0, _a = action.children || [];
|
20
|
+
_b.label = 1;
|
21
|
+
case 1:
|
22
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
23
|
+
branch = _a[_i];
|
24
|
+
if (!branch.expression) {
|
25
|
+
return [3 /*break*/, 3];
|
26
|
+
}
|
27
|
+
if (!(0, tpl_1.evalExpression)(branch.expression, mergeData)) return [3 /*break*/, 3];
|
28
|
+
return [4 /*yield*/, (0, Action_1.runActions)(branch, renderer, event)];
|
29
|
+
case 2:
|
30
|
+
_b.sent();
|
31
|
+
// 去掉runAllMatch,这里只做排他,多个可以直接通过execOn
|
32
|
+
return [3 /*break*/, 4];
|
33
|
+
case 3:
|
34
|
+
_i++;
|
35
|
+
return [3 /*break*/, 1];
|
36
|
+
case 4: return [2 /*return*/];
|
37
|
+
}
|
38
|
+
});
|
39
|
+
});
|
40
|
+
};
|
41
|
+
return SwitchAction;
|
42
|
+
}());
|
43
|
+
exports.SwitchAction = SwitchAction;
|
44
|
+
(0, Action_1.registerAction)('switch', new SwitchAction());
|
45
|
+
//# sourceMappingURL=./actions/SwitchAction.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "SwitchAction.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/actions/SwitchAction.ts"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AACA,oCAA4C;AAC5C,mCAMkB;AAElB;;GAEG;AACH;IAAA;IAmBA,CAAC;IAlBO,0BAAG,GAAT,UACE,MAAmB,EACnB,QAAyB,EACzB,KAAyB,EACzB,SAAc;;;;;;8BAE4B,EAArB,KAAA,MAAM,CAAC,QAAQ,IAAI,EAAE;;;6BAArB,CAAA,cAAqB,CAAA;wBAA/B,MAAM;wBACf,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;4BACtB,wBAAS;yBACV;6BAEG,IAAA,oBAAc,EAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,EAA5C,wBAA4C;wBAC9C,qBAAM,IAAA,mBAAU,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAA;;wBAAzC,SAAyC,CAAC;wBAC1C,sCAAsC;wBACtC,wBAAM;;wBARW,IAAqB,CAAA;;;;;;KAW3C;IACH,mBAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,oCAAY;AAqBzB,IAAA,uBAAc,EAAC,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import {RendererEvent} from '../utils/renderer-event';\nimport {evalExpression} from '../utils/tpl';\nimport {\n Action,\n ListenerContext,\n LogicAction,\n registerAction,\n runActions\n} from './Action';\n\n/**\n * 排他动作\n */\nexport class SwitchAction implements Action {\n async run(\n action: LogicAction,\n renderer: ListenerContext,\n event: RendererEvent<any>,\n mergeData: any\n ) {\n for (const branch of action.children || []) {\n if (!branch.expression) {\n continue;\n }\n\n if (evalExpression(branch.expression, mergeData)) {\n await runActions(branch, renderer, event);\n // 去掉runAllMatch,这里只做排他,多个可以直接通过execOn\n break;\n }\n }\n }\n}\n\nregisterAction('switch', new SwitchAction());\n"
|
12
|
+
]
|
13
|
+
}
|