amis 2.0.0-rc.9 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm/Schema.d.ts +442 -0
- package/esm/compat.d.ts +1 -0
- package/esm/compat.js +459 -0
- package/esm/index.d.ts +146 -0
- package/esm/index.js +144 -0
- package/esm/preset.d.ts +1 -0
- package/esm/preset.js +40 -0
- package/esm/renderers/Action.d.ts +393 -0
- package/esm/renderers/Action.js +443 -0
- package/esm/renderers/Alert.d.ts +49 -0
- package/esm/renderers/Alert.js +35 -0
- package/esm/renderers/AnchorNav.d.ts +69 -0
- package/esm/renderers/AnchorNav.js +97 -0
- package/esm/renderers/App.d.ts +125 -0
- package/esm/renderers/App.js +198 -0
- package/esm/renderers/Audio.d.ts +88 -0
- package/esm/renderers/Audio.js +382 -0
- package/esm/renderers/Avatar.d.ts +75 -0
- package/esm/renderers/Avatar.js +54 -0
- package/esm/renderers/BarCode.d.ts +35 -0
- package/esm/renderers/BarCode.js +38 -0
- package/esm/renderers/Breadcrumb.d.ts +89 -0
- package/esm/renderers/Breadcrumb.js +58 -0
- package/esm/renderers/ButtonGroup.d.ts +64 -0
- package/esm/renderers/ButtonGroup.js +22 -0
- package/esm/renderers/CRUD.d.ts +302 -0
- package/esm/renderers/CRUD.js +1244 -0
- package/esm/renderers/CRUD2.d.ts +215 -0
- package/esm/renderers/CRUD2.js +742 -0
- package/esm/renderers/Calendar.d.ts +45 -0
- package/esm/renderers/Calendar.js +22 -0
- package/esm/renderers/Card.d.ts +231 -0
- package/esm/renderers/Card.js +372 -0
- package/esm/renderers/Card2.d.ts +77 -0
- package/esm/renderers/Card2.js +83 -0
- package/esm/renderers/Cards.d.ts +170 -0
- package/esm/renderers/Cards.js +555 -0
- package/esm/renderers/Carousel.d.ts +103 -0
- package/esm/renderers/Carousel.js +329 -0
- package/esm/renderers/Chart.d.ts +116 -0
- package/esm/renderers/Chart.js +352 -0
- package/esm/renderers/Code.d.ts +84 -0
- package/esm/renderers/Code.js +130 -0
- package/esm/renderers/Collapse.d.ts +83 -0
- package/esm/renderers/Collapse.js +47 -0
- package/esm/renderers/CollapseGroup.d.ts +42 -0
- package/esm/renderers/CollapseGroup.js +35 -0
- package/esm/renderers/Color.d.ts +36 -0
- package/esm/renderers/Color.js +42 -0
- package/esm/renderers/Container.d.ts +44 -0
- package/esm/renderers/Container.js +49 -0
- package/esm/renderers/Copyable.d.ts +25 -0
- package/esm/renderers/Copyable.js +49 -0
- package/esm/renderers/Custom.d.ts +51 -0
- package/esm/renderers/Custom.js +163 -0
- package/esm/renderers/Date.d.ts +58 -0
- package/esm/renderers/Date.js +121 -0
- package/esm/renderers/Dialog.d.ts +1357 -0
- package/esm/renderers/Dialog.js +633 -0
- package/esm/renderers/Divider.d.ts +20 -0
- package/esm/renderers/Divider.js +38 -0
- package/esm/renderers/Drawer.d.ts +153 -0
- package/esm/renderers/Drawer.js +608 -0
- package/esm/renderers/DropDownButton.d.ts +114 -0
- package/esm/renderers/DropDownButton.js +151 -0
- package/esm/renderers/Each.d.ts +38 -0
- package/esm/renderers/Each.js +59 -0
- package/esm/renderers/Flex.d.ts +77 -0
- package/esm/renderers/Flex.js +84 -0
- package/esm/renderers/Form/ButtonGroupSelect.d.ts +26 -0
- package/esm/renderers/Form/ButtonGroupSelect.js +114 -0
- package/esm/renderers/Form/ButtonToolbar.d.ts +28 -0
- package/esm/renderers/Form/ButtonToolbar.js +50 -0
- package/esm/renderers/Form/ChainedSelect.d.ts +36 -0
- package/esm/renderers/Form/ChainedSelect.js +213 -0
- package/esm/renderers/Form/ChartRadios.d.ts +34 -0
- package/esm/renderers/Form/ChartRadios.js +121 -0
- package/esm/renderers/Form/Checkbox.d.ts +47 -0
- package/esm/renderers/Form/Checkbox.js +83 -0
- package/esm/renderers/Form/Checkboxes.d.ts +65 -0
- package/esm/renderers/Form/Checkboxes.js +226 -0
- package/esm/renderers/Form/Combo.d.ts +251 -0
- package/esm/renderers/Form/Combo.js +822 -0
- package/esm/renderers/Form/ConditionBuilder.d.ts +56 -0
- package/esm/renderers/Form/ConditionBuilder.js +69 -0
- package/esm/renderers/Form/Control.d.ts +18 -0
- package/esm/renderers/Form/Control.js +38 -0
- package/esm/renderers/Form/DiffEditor.d.ts +3925 -0
- package/esm/renderers/Form/DiffEditor.js +199 -0
- package/esm/renderers/Form/Editor.d.ts +3856 -0
- package/esm/renderers/Form/Editor.js +247 -0
- package/esm/renderers/Form/FieldSet.d.ts +70 -0
- package/esm/renderers/Form/FieldSet.js +59 -0
- package/esm/renderers/Form/Formula.d.ts +53 -0
- package/esm/renderers/Form/Formula.js +128 -0
- package/esm/renderers/Form/Group.d.ts +57 -0
- package/esm/renderers/Form/Group.js +99 -0
- package/esm/renderers/Form/Hidden.d.ts +15 -0
- package/esm/renderers/Form/Hidden.js +35 -0
- package/esm/renderers/Form/IconPicker.d.ts +49 -0
- package/esm/renderers/Form/IconPicker.js +305 -0
- package/esm/renderers/Form/IconPickerIcons.d.ts +8 -0
- package/esm/renderers/Form/IconPickerIcons.js +26 -0
- package/esm/renderers/Form/InputArray.d.ts +31 -0
- package/esm/renderers/Form/InputArray.js +45 -0
- package/esm/renderers/Form/InputCity.d.ts +654 -0
- package/esm/renderers/Form/InputCity.js +347 -0
- package/esm/renderers/Form/InputColor.d.ts +504 -0
- package/esm/renderers/Form/InputColor.js +52 -0
- package/esm/renderers/Form/InputDate.d.ts +359 -0
- package/esm/renderers/Form/InputDate.js +258 -0
- package/esm/renderers/Form/InputDateRange.d.ts +121 -0
- package/esm/renderers/Form/InputDateRange.js +166 -0
- package/esm/renderers/Form/InputExcel.d.ts +51 -0
- package/esm/renderers/Form/InputExcel.js +195 -0
- package/esm/renderers/Form/InputFile.d.ts +257 -0
- package/esm/renderers/Form/InputFile.js +937 -0
- package/esm/renderers/Form/InputFormula.d.ts +91 -0
- package/esm/renderers/Form/InputFormula.js +67 -0
- package/esm/renderers/Form/InputGroup.d.ts +33 -0
- package/esm/renderers/Form/InputGroup.js +111 -0
- package/esm/renderers/Form/InputImage.d.ts +315 -0
- package/esm/renderers/Form/InputImage.js +908 -0
- package/esm/renderers/Form/InputMonthRange.d.ts +22 -0
- package/esm/renderers/Form/InputMonthRange.js +46 -0
- package/esm/renderers/Form/InputNumber.d.ts +128 -0
- package/esm/renderers/Form/InputNumber.js +210 -0
- package/esm/renderers/Form/InputQuarterRange.d.ts +22 -0
- package/esm/renderers/Form/InputQuarterRange.js +46 -0
- package/esm/renderers/Form/InputRange.d.ts +271 -0
- package/esm/renderers/Form/InputRange.js +388 -0
- package/esm/renderers/Form/InputRating.d.ts +74 -0
- package/esm/renderers/Form/InputRating.js +82 -0
- package/esm/renderers/Form/InputRepeat.d.ts +35 -0
- package/esm/renderers/Form/InputRepeat.js +115 -0
- package/esm/renderers/Form/InputRichText.d.ts +56 -0
- package/esm/renderers/Form/InputRichText.js +177 -0
- package/esm/renderers/Form/InputSubForm.d.ts +123 -0
- package/esm/renderers/Form/InputSubForm.js +269 -0
- package/esm/renderers/Form/InputTable.d.ts +180 -0
- package/esm/renderers/Form/InputTable.js +677 -0
- package/esm/renderers/Form/InputTag.d.ts +108 -0
- package/esm/renderers/Form/InputTag.js +439 -0
- package/esm/renderers/Form/InputText.d.ts +133 -0
- package/esm/renderers/Form/InputText.js +632 -0
- package/esm/renderers/Form/InputTree.d.ts +86 -0
- package/esm/renderers/Form/InputTree.js +108 -0
- package/esm/renderers/Form/InputYearRange.d.ts +22 -0
- package/esm/renderers/Form/InputYearRange.js +46 -0
- package/esm/renderers/Form/JSONSchema.d.ts +24 -0
- package/esm/renderers/Form/JSONSchema.js +45 -0
- package/esm/renderers/Form/JSONSchemaEditor.d.ts +64 -0
- package/esm/renderers/Form/JSONSchemaEditor.js +57 -0
- package/esm/renderers/Form/ListSelect.d.ts +45 -0
- package/esm/renderers/Form/ListSelect.js +89 -0
- package/esm/renderers/Form/LocationPicker.d.ts +35 -0
- package/esm/renderers/Form/LocationPicker.js +39 -0
- package/esm/renderers/Form/MatrixCheckboxes.d.ts +79 -0
- package/esm/renderers/Form/MatrixCheckboxes.js +266 -0
- package/esm/renderers/Form/NestedSelect.d.ts +91 -0
- package/esm/renderers/Form/NestedSelect.js +703 -0
- package/esm/renderers/Form/Picker.d.ts +86 -0
- package/esm/renderers/Form/Picker.js +361 -0
- package/esm/renderers/Form/Radios.d.ts +39 -0
- package/esm/renderers/Form/Radios.js +91 -0
- package/esm/renderers/Form/Select.d.ts +140 -0
- package/esm/renderers/Form/Select.js +309 -0
- package/esm/renderers/Form/Static.d.ts +59 -0
- package/esm/renderers/Form/Static.js +109 -0
- package/esm/renderers/Form/Switch.d.ts +54 -0
- package/esm/renderers/Form/Switch.js +77 -0
- package/esm/renderers/Form/TabsTransfer.d.ts +30 -0
- package/esm/renderers/Form/TabsTransfer.js +241 -0
- package/esm/renderers/Form/TabsTransferPicker.d.ts +26 -0
- package/esm/renderers/Form/TabsTransferPicker.js +72 -0
- package/esm/renderers/Form/Textarea.d.ts +69 -0
- package/esm/renderers/Form/Textarea.js +103 -0
- package/esm/renderers/Form/Transfer.d.ts +115 -0
- package/esm/renderers/Form/Transfer.js +276 -0
- package/esm/renderers/Form/TransferPicker.d.ts +26 -0
- package/esm/renderers/Form/TransferPicker.js +66 -0
- package/esm/renderers/Form/TreeSelect.d.ts +132 -0
- package/esm/renderers/Form/TreeSelect.js +376 -0
- package/esm/renderers/Form/UUID.d.ts +22 -0
- package/esm/renderers/Form/UUID.js +52 -0
- package/esm/renderers/Form/UserSelect.d.ts +55 -0
- package/esm/renderers/Form/UserSelect.js +194 -0
- package/esm/renderers/Grid.d.ts +82 -0
- package/esm/renderers/Grid.js +88 -0
- package/esm/renderers/Grid2D.d.ts +91 -0
- package/esm/renderers/Grid2D.js +113 -0
- package/esm/renderers/GridNav.d.ts +99 -0
- package/esm/renderers/GridNav.js +80 -0
- package/esm/renderers/HBox.d.ts +95 -0
- package/esm/renderers/HBox.js +75 -0
- package/esm/renderers/IFrame.d.ts +49 -0
- package/esm/renderers/IFrame.js +169 -0
- package/esm/renderers/Icon.d.ts +28 -0
- package/esm/renderers/Icon.js +60 -0
- package/esm/renderers/Image.d.ts +415 -0
- package/esm/renderers/Image.js +120 -0
- package/esm/renderers/Images.d.ts +80 -0
- package/esm/renderers/Images.js +89 -0
- package/esm/renderers/Json.d.ts +68 -0
- package/esm/renderers/Json.js +98 -0
- package/esm/renderers/Link.d.ts +56 -0
- package/esm/renderers/Link.js +61 -0
- package/esm/renderers/List.d.ts +260 -0
- package/esm/renderers/List.js +680 -0
- package/esm/renderers/Log.d.ts +91 -0
- package/esm/renderers/Log.js +247 -0
- package/esm/renderers/Mapping.d.ts +354 -0
- package/esm/renderers/Mapping.js +160 -0
- package/esm/renderers/Markdown.d.ts +42 -0
- package/esm/renderers/Markdown.js +97 -0
- package/esm/renderers/Nav.d.ts +258 -0
- package/esm/renderers/Nav.js +544 -0
- package/esm/renderers/Operation.d.ts +28 -0
- package/esm/renderers/Operation.js +43 -0
- package/esm/renderers/Page.d.ts +228 -0
- package/esm/renderers/Page.js +593 -0
- package/esm/renderers/Pagination.d.ts +68 -0
- package/esm/renderers/Pagination.js +35 -0
- package/esm/renderers/PaginationWrapper.d.ts +67 -0
- package/esm/renderers/PaginationWrapper.js +74 -0
- package/esm/renderers/Panel.d.ts +86 -0
- package/esm/renderers/Panel.js +144 -0
- package/esm/renderers/Plain.d.ts +35 -0
- package/esm/renderers/Plain.js +42 -0
- package/esm/renderers/PopOver.d.ts +69 -0
- package/esm/renderers/PopOver.js +166 -0
- package/esm/renderers/Portlet.d.ts +125 -0
- package/esm/renderers/Portlet.js +152 -0
- package/esm/renderers/Progress.d.ts +81 -0
- package/esm/renderers/Progress.js +61 -0
- package/esm/renderers/Property.d.ts +99 -0
- package/esm/renderers/Property.js +95 -0
- package/esm/renderers/QRCode.d.ts +63 -0
- package/esm/renderers/QRCode.js +75 -0
- package/esm/renderers/QuickEdit.d.ts +65 -0
- package/esm/renderers/QuickEdit.js +337 -0
- package/esm/renderers/Remark.d.ts +105 -0
- package/esm/renderers/Remark.js +100 -0
- package/esm/renderers/SearchBox.d.ts +69 -0
- package/esm/renderers/SearchBox.js +77 -0
- package/esm/renderers/Service.d.ts +120 -0
- package/esm/renderers/Service.js +437 -0
- package/esm/renderers/SparkLine.d.ts +44 -0
- package/esm/renderers/SparkLine.js +40 -0
- package/esm/renderers/Spinner.d.ts +64 -0
- package/esm/renderers/Spinner.js +32 -0
- package/esm/renderers/Status.d.ts +55 -0
- package/esm/renderers/Status.js +84 -0
- package/esm/renderers/Steps.d.ts +66 -0
- package/esm/renderers/Steps.js +77 -0
- package/esm/renderers/Table/ColumnToggler.d.ts +120 -0
- package/esm/renderers/Table/ColumnToggler.js +255 -0
- package/esm/renderers/Table/HeadCellFilterDropdown.d.ts +32 -0
- package/esm/renderers/Table/HeadCellFilterDropdown.js +211 -0
- package/esm/renderers/Table/HeadCellSearchDropdown.d.ts +32 -0
- package/esm/renderers/Table/HeadCellSearchDropdown.js +193 -0
- package/esm/renderers/Table/ItemActionsWrapper.d.ts +11 -0
- package/esm/renderers/Table/ItemActionsWrapper.js +35 -0
- package/esm/renderers/Table/TableBody.d.ts +90 -0
- package/esm/renderers/Table/TableBody.js +105 -0
- package/esm/renderers/Table/TableCell.d.ts +21 -0
- package/esm/renderers/Table/TableCell.js +139 -0
- package/esm/renderers/Table/TableContent.d.ts +54 -0
- package/esm/renderers/Table/TableContent.js +69 -0
- package/esm/renderers/Table/TableRow.d.ts +27 -0
- package/esm/renderers/Table/TableRow.js +129 -0
- package/esm/renderers/Table/exportExcel.d.ts +6 -0
- package/esm/renderers/Table/exportExcel.js +301 -0
- package/esm/renderers/Table/index.d.ts +371 -0
- package/esm/renderers/Table/index.js +1539 -0
- package/esm/renderers/Table-v2/ColumnToggler.d.ts +19 -0
- package/esm/renderers/Table-v2/ColumnToggler.js +88 -0
- package/esm/renderers/Table-v2/HeadCellSearchDropdown.d.ts +29 -0
- package/esm/renderers/Table-v2/HeadCellSearchDropdown.js +206 -0
- package/esm/renderers/Table-v2/TableCell.d.ts +6 -0
- package/esm/renderers/Table-v2/TableCell.js +30 -0
- package/esm/renderers/Table-v2/index.d.ts +285 -0
- package/esm/renderers/Table-v2/index.js +833 -0
- package/esm/renderers/TableView.d.ts +136 -0
- package/esm/renderers/TableView.js +95 -0
- package/esm/renderers/Tabs.d.ts +204 -0
- package/esm/renderers/Tabs.js +501 -0
- package/esm/renderers/Tag.d.ts +66 -0
- package/esm/renderers/Tag.js +50 -0
- package/esm/renderers/Tasks.d.ts +140 -0
- package/esm/renderers/Tasks.js +209 -0
- package/esm/renderers/Timeline.d.ts +65 -0
- package/esm/renderers/Timeline.js +54 -0
- package/esm/renderers/TooltipWrapper.d.ts +133 -0
- package/esm/renderers/TooltipWrapper.js +70 -0
- package/esm/renderers/Tpl.d.ts +51 -0
- package/esm/renderers/Tpl.js +88 -0
- package/esm/renderers/VBox.d.ts +30 -0
- package/esm/renderers/VBox.js +48 -0
- package/esm/renderers/Video.d.ts +171 -0
- package/esm/renderers/Video.js +457 -0
- package/esm/renderers/WebComponent.d.ts +33 -0
- package/esm/renderers/WebComponent.js +48 -0
- package/esm/renderers/Wizard.d.ts +179 -0
- package/esm/renderers/Wizard.js +921 -0
- package/esm/renderers/Wrapper.d.ts +36 -0
- package/esm/renderers/Wrapper.js +53 -0
- package/esm/schemaExtend.d.ts +1 -0
- package/esm/schemaExtend.js +72 -0
- package/esm/types.d.ts +160 -0
- package/lib/Schema.d.ts +4 -3
- package/lib/compat.js +1 -1
- package/lib/helper.css +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/preset.js +1 -1
- package/lib/renderers/Action.js +1 -1
- package/lib/renderers/Alert.js +1 -1
- package/lib/renderers/AnchorNav.js +1 -1
- package/lib/renderers/App.d.ts +4 -0
- package/lib/renderers/App.js +3 -3
- package/lib/renderers/Audio.js +1 -1
- package/lib/renderers/Avatar.js +1 -1
- package/lib/renderers/BarCode.js +1 -1
- package/lib/renderers/Breadcrumb.js +1 -1
- package/lib/renderers/ButtonGroup.d.ts +2 -2
- package/lib/renderers/ButtonGroup.js +1 -1
- package/lib/renderers/CRUD.js +6 -7
- package/lib/renderers/CRUD2.d.ts +215 -0
- package/lib/renderers/CRUD2.js +752 -0
- package/lib/renderers/Calendar.js +1 -1
- package/lib/renderers/Card.js +1 -1
- package/lib/renderers/Card2.d.ts +1 -1
- package/lib/renderers/Card2.js +3 -3
- package/lib/renderers/Cards.d.ts +4 -0
- package/lib/renderers/Cards.js +49 -6
- package/lib/renderers/Carousel.js +1 -1
- package/lib/renderers/Chart.js +19 -3
- package/lib/renderers/Code.js +1 -1
- package/lib/renderers/Collapse.js +1 -1
- package/lib/renderers/CollapseGroup.js +1 -1
- package/lib/renderers/Color.js +1 -1
- package/lib/renderers/Container.js +1 -1
- package/lib/renderers/Copyable.js +1 -1
- package/lib/renderers/Custom.js +1 -1
- package/lib/renderers/Date.js +1 -1
- package/lib/renderers/Dialog.js +1 -1
- package/lib/renderers/Divider.js +1 -1
- package/lib/renderers/Drawer.js +1 -1
- package/lib/renderers/DropDownButton.js +3 -3
- package/lib/renderers/Each.js +1 -1
- package/lib/renderers/Flex.js +3 -2
- package/lib/renderers/Form/ButtonGroupSelect.js +2 -2
- package/lib/renderers/Form/ButtonToolbar.js +1 -1
- package/lib/renderers/Form/ChainedSelect.js +2 -2
- package/lib/renderers/Form/ChartRadios.js +1 -1
- package/lib/renderers/Form/Checkbox.js +1 -1
- package/lib/renderers/Form/Checkboxes.d.ts +5 -0
- package/lib/renderers/Form/Checkboxes.js +8 -3
- package/lib/renderers/Form/Combo.d.ts +1 -1
- package/lib/renderers/Form/Combo.js +4 -3
- package/lib/renderers/Form/ConditionBuilder.d.ts +10 -0
- package/lib/renderers/Form/ConditionBuilder.js +7 -3
- package/lib/renderers/Form/Control.js +1 -1
- package/lib/renderers/Form/DiffEditor.d.ts +705 -141
- package/lib/renderers/Form/DiffEditor.js +1 -1
- package/lib/renderers/Form/Editor.d.ts +701 -137
- package/lib/renderers/Form/Editor.js +1 -1
- package/lib/renderers/Form/FieldSet.js +1 -1
- package/lib/renderers/Form/Formula.js +1 -1
- package/lib/renderers/Form/Group.js +2 -2
- package/lib/renderers/Form/Hidden.js +1 -1
- package/lib/renderers/Form/IconPicker.js +1 -1
- package/lib/renderers/Form/IconPickerIcons.js +1 -1
- package/lib/renderers/Form/InputArray.js +1 -1
- package/lib/renderers/Form/InputCity.d.ts +40 -40
- package/lib/renderers/Form/InputCity.js +1 -1
- package/lib/renderers/Form/InputColor.js +1 -1
- package/lib/renderers/Form/InputDate.js +1 -1
- package/lib/renderers/Form/InputDateRange.js +1 -1
- package/lib/renderers/Form/InputExcel.js +1 -1
- package/lib/renderers/Form/InputFile.d.ts +5 -0
- package/lib/renderers/Form/InputFile.js +34 -15
- package/lib/renderers/Form/InputFormula.js +1 -1
- package/lib/renderers/Form/InputGroup.js +1 -1
- package/lib/renderers/Form/InputImage.js +27 -11
- package/lib/renderers/Form/InputMonthRange.js +1 -1
- package/lib/renderers/Form/InputNumber.js +1 -1
- package/lib/renderers/Form/InputQuarterRange.js +1 -1
- package/lib/renderers/Form/InputRange.d.ts +12 -5
- package/lib/renderers/Form/InputRange.js +1 -1
- package/lib/renderers/Form/InputRating.js +1 -1
- package/lib/renderers/Form/InputRepeat.js +1 -1
- package/lib/renderers/Form/InputRichText.js +1 -1
- package/lib/renderers/Form/InputSubForm.js +1 -1
- package/lib/renderers/Form/InputTable.js +2 -2
- package/lib/renderers/Form/InputTag.d.ts +34 -0
- package/lib/renderers/Form/InputTag.js +78 -40
- package/lib/renderers/Form/InputText.js +1 -1
- package/lib/renderers/Form/InputTree.d.ts +5 -2
- package/lib/renderers/Form/InputTree.js +7 -3
- package/lib/renderers/Form/InputYearRange.js +1 -1
- package/lib/renderers/Form/JSONSchema.js +1 -1
- package/lib/renderers/Form/JSONSchemaEditor.js +1 -1
- package/lib/renderers/Form/ListSelect.js +1 -1
- package/lib/renderers/Form/LocationPicker.js +1 -1
- package/lib/renderers/Form/MatrixCheckboxes.js +1 -1
- package/lib/renderers/Form/NestedSelect.js +4 -4
- package/lib/renderers/Form/Picker.js +1 -1
- package/lib/renderers/Form/Radios.d.ts +6 -1
- package/lib/renderers/Form/Radios.js +5 -3
- package/lib/renderers/Form/Select.js +1 -1
- package/lib/renderers/Form/Static.js +1 -1
- package/lib/renderers/Form/Switch.d.ts +3 -0
- package/lib/renderers/Form/Switch.js +3 -3
- package/lib/renderers/Form/TabsTransfer.js +1 -1
- package/lib/renderers/Form/TabsTransferPicker.js +1 -1
- package/lib/renderers/Form/Textarea.d.ts +2 -1
- package/lib/renderers/Form/Textarea.js +13 -2
- package/lib/renderers/Form/Transfer.js +1 -1
- package/lib/renderers/Form/TransferPicker.js +1 -1
- package/lib/renderers/Form/TreeSelect.js +4 -4
- package/lib/renderers/Form/UUID.js +1 -1
- package/lib/renderers/Form/UserSelect.js +3 -3
- package/lib/renderers/Grid.js +1 -1
- package/lib/renderers/Grid2D.js +1 -1
- package/lib/renderers/GridNav.js +1 -1
- package/lib/renderers/HBox.js +1 -1
- package/lib/renderers/IFrame.js +1 -1
- package/lib/renderers/Icon.d.ts +1 -1
- package/lib/renderers/Icon.js +11 -6
- package/lib/renderers/Image.js +1 -1
- package/lib/renderers/Images.js +1 -1
- package/lib/renderers/Json.d.ts +4 -0
- package/lib/renderers/Json.js +5 -4
- package/lib/renderers/Link.js +1 -1
- package/lib/renderers/List.d.ts +1 -0
- package/lib/renderers/List.js +30 -25
- package/lib/renderers/Log.js +1 -1
- package/lib/renderers/Mapping.js +1 -1
- package/lib/renderers/Markdown.js +1 -1
- package/lib/renderers/Nav.js +1 -1
- package/lib/renderers/Operation.js +1 -1
- package/lib/renderers/Page.js +1 -1
- package/lib/renderers/Pagination.js +1 -1
- package/lib/renderers/PaginationWrapper.js +2 -1
- package/lib/renderers/Panel.js +1 -1
- package/lib/renderers/Plain.js +1 -1
- package/lib/renderers/PopOver.js +4 -4
- package/lib/renderers/Portlet.js +1 -1
- package/lib/renderers/Progress.js +1 -1
- package/lib/renderers/Property.js +1 -1
- package/lib/renderers/QRCode.js +1 -1
- package/lib/renderers/QuickEdit.js +4 -3
- package/lib/renderers/Remark.js +1 -1
- package/lib/renderers/SearchBox.js +1 -1
- package/lib/renderers/Service.js +1 -1
- package/lib/renderers/SparkLine.js +1 -1
- package/lib/renderers/Spinner.js +1 -1
- package/lib/renderers/Status.js +1 -1
- package/lib/renderers/Steps.js +3 -2
- package/lib/renderers/Table/ColumnToggler.d.ts +4 -3
- package/lib/renderers/Table/ColumnToggler.js +4 -4
- package/lib/renderers/Table/HeadCellFilterDropdown.js +3 -3
- package/lib/renderers/Table/HeadCellSearchDropdown.js +4 -4
- package/lib/renderers/Table/ItemActionsWrapper.js +1 -1
- package/lib/renderers/Table/TableBody.js +1 -1
- package/lib/renderers/Table/TableCell.js +1 -1
- package/lib/renderers/Table/TableContent.js +1 -1
- package/lib/renderers/Table/TableRow.js +1 -1
- package/lib/renderers/Table/exportExcel.js +6 -6
- package/lib/renderers/Table/index.d.ts +2 -1
- package/lib/renderers/Table/index.js +24 -4
- package/lib/renderers/Table-v2/ColumnToggler.d.ts +18 -2
- package/lib/renderers/Table-v2/ColumnToggler.js +72 -2
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js +1 -1
- package/lib/renderers/Table-v2/TableCell.js +1 -1
- package/lib/renderers/Table-v2/index.d.ts +12 -10
- package/lib/renderers/Table-v2/index.js +125 -100
- package/lib/renderers/TableView.js +1 -1
- package/lib/renderers/Tabs.js +1 -1
- package/lib/renderers/Tag.js +1 -1
- package/lib/renderers/Tasks.js +1 -1
- package/lib/renderers/Timeline.js +1 -1
- package/lib/renderers/TooltipWrapper.js +3 -3
- package/lib/renderers/Tpl.js +1 -1
- package/lib/renderers/VBox.js +1 -1
- package/lib/renderers/Video.js +1 -1
- package/lib/renderers/WebComponent.js +1 -1
- package/lib/renderers/Wizard.d.ts +1 -1
- package/lib/renderers/Wizard.js +70 -75
- package/lib/renderers/Wrapper.js +1 -1
- package/lib/schemaExtend.js +1 -1
- package/lib/themes/ang-ie11.css +328 -250
- package/lib/themes/ang.css +341 -245
- package/lib/themes/antd-ie11.css +346 -268
- package/lib/themes/antd.css +345 -245
- package/lib/themes/cxd-ie11.css +349 -287
- package/lib/themes/cxd.css +356 -276
- package/lib/themes/dark-ie11.css +328 -250
- package/lib/themes/dark.css +341 -245
- package/lib/themes/default-ie11.css +349 -287
- package/lib/themes/default.css +356 -276
- package/lib/types.d.ts +1 -1
- package/package.json +15 -2
- package/schema.json +2494 -836
- package/sdk/ang-ie11.css +359 -64
- package/sdk/ang.css +372 -59
- package/sdk/antd-ie11.css +377 -82
- package/sdk/antd.css +376 -59
- package/sdk/barcode.js +50 -50
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +380 -106
- package/sdk/cxd.css +387 -95
- package/sdk/dark-ie11.css +359 -64
- package/sdk/dark.css +372 -59
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css +0 -1
- package/sdk/locale/de-DE.js +2 -1
- package/sdk/markdown.js +68 -68
- package/sdk/papaparse.js +1 -1
- package/sdk/rest.js +24 -24
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +380 -106
- package/sdk/sdk.css +387 -95
- package/sdk/sdk.js +1788 -1710
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
@@ -0,0 +1,633 @@
|
|
1
|
+
/**
|
2
|
+
* amis v2.0.0
|
3
|
+
* Copyright 2018-2022 baidu
|
4
|
+
*/
|
5
|
+
|
6
|
+
import { __extends, __spreadArray, __assign, __decorate, __metadata, __awaiter, __generator } from 'tslib';
|
7
|
+
import React from 'react';
|
8
|
+
import { guid, filter, autobind, isVisible, createObject, ScopedContext, Renderer, ModalStore, isObjectShallowModified } from 'amis-core';
|
9
|
+
import { Spinner, Icon, Modal } from 'amis-ui';
|
10
|
+
import { reaction } from 'mobx';
|
11
|
+
import { findDOMNode } from 'react-dom';
|
12
|
+
import { isAlive } from 'mobx-state-tree';
|
13
|
+
|
14
|
+
var Dialog = /** @class */ (function (_super) {
|
15
|
+
__extends(Dialog, _super);
|
16
|
+
function Dialog(props) {
|
17
|
+
var _this = _super.call(this, props) || this;
|
18
|
+
_this.isDead = false;
|
19
|
+
_this.$$id = guid();
|
20
|
+
props.store.setEntered(!!props.show);
|
21
|
+
_this.handleSelfClose = _this.handleSelfClose.bind(_this);
|
22
|
+
_this.handleAction = _this.handleAction.bind(_this);
|
23
|
+
_this.handleDialogConfirm = _this.handleDialogConfirm.bind(_this);
|
24
|
+
_this.handleDialogClose = _this.handleDialogClose.bind(_this);
|
25
|
+
_this.handleDrawerConfirm = _this.handleDrawerConfirm.bind(_this);
|
26
|
+
_this.handleDrawerClose = _this.handleDrawerClose.bind(_this);
|
27
|
+
_this.handleEntered = _this.handleEntered.bind(_this);
|
28
|
+
_this.handleExited = _this.handleExited.bind(_this);
|
29
|
+
_this.handleFormInit = _this.handleFormInit.bind(_this);
|
30
|
+
_this.handleFormSaved = _this.handleFormSaved.bind(_this);
|
31
|
+
_this.handleFormChange = _this.handleFormChange.bind(_this);
|
32
|
+
_this.handleChildFinished = _this.handleChildFinished.bind(_this);
|
33
|
+
var store = props.store;
|
34
|
+
_this.reaction = reaction(function () { return "".concat(store.loading).concat(store.error); }, function () { return _this.forceUpdate(); });
|
35
|
+
return _this;
|
36
|
+
}
|
37
|
+
// shouldComponentUpdate(nextProps:DialogProps, nextState:DialogState) {
|
38
|
+
// const props = this.props;
|
39
|
+
// if (this.state.entered !== nextState.entered) {
|
40
|
+
// return true;
|
41
|
+
// } else if (props.show === nextProps.show && !nextProps.show) {
|
42
|
+
// return false;
|
43
|
+
// }
|
44
|
+
// return isObjectShallowModified(this.props, nextProps);
|
45
|
+
// }
|
46
|
+
Dialog.prototype.componentWillUnmount = function () {
|
47
|
+
this.reaction && this.reaction();
|
48
|
+
this.isDead = true;
|
49
|
+
};
|
50
|
+
Dialog.prototype.buildActions = function () {
|
51
|
+
var _a = this.props, actions = _a.actions, confirm = _a.confirm, __ = _a.translate;
|
52
|
+
if (typeof actions !== 'undefined') {
|
53
|
+
return actions;
|
54
|
+
}
|
55
|
+
var ret = [];
|
56
|
+
ret.push({
|
57
|
+
type: 'button',
|
58
|
+
actionType: 'cancel',
|
59
|
+
label: __('cancel')
|
60
|
+
});
|
61
|
+
if (confirm) {
|
62
|
+
ret.push({
|
63
|
+
type: 'button',
|
64
|
+
actionType: 'confirm',
|
65
|
+
label: __('confirm'),
|
66
|
+
primary: true
|
67
|
+
});
|
68
|
+
}
|
69
|
+
return ret;
|
70
|
+
};
|
71
|
+
Dialog.prototype.handleSelfClose = function (e, confirmed) {
|
72
|
+
var _a = this.props, onClose = _a.onClose, store = _a.store;
|
73
|
+
// clear error
|
74
|
+
store.updateMessage();
|
75
|
+
onClose(confirmed);
|
76
|
+
};
|
77
|
+
Dialog.prototype.handleAction = function (e, action, data) {
|
78
|
+
var _a = this.props, store = _a.store, onAction = _a.onAction;
|
79
|
+
if (action.type === 'reset') {
|
80
|
+
store.reset();
|
81
|
+
}
|
82
|
+
else if (action.actionType === 'cancel') {
|
83
|
+
this.handleSelfClose();
|
84
|
+
}
|
85
|
+
else if (onAction) {
|
86
|
+
onAction(e, action, data);
|
87
|
+
}
|
88
|
+
};
|
89
|
+
Dialog.prototype.handleDialogConfirm = function (values, action) {
|
90
|
+
var args = [];
|
91
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
92
|
+
args[_i - 2] = arguments[_i];
|
93
|
+
}
|
94
|
+
var store = this.props.store;
|
95
|
+
if (action.mergeData && values.length === 1 && values[0]) {
|
96
|
+
store.updateData(values[0]);
|
97
|
+
}
|
98
|
+
var dialog = store.action.dialog;
|
99
|
+
if (dialog &&
|
100
|
+
dialog.onConfirm &&
|
101
|
+
dialog.onConfirm.apply(dialog, __spreadArray([values, action], args, false)) === false) {
|
102
|
+
return;
|
103
|
+
}
|
104
|
+
store.closeDialog(true);
|
105
|
+
};
|
106
|
+
Dialog.prototype.handleDialogClose = function () {
|
107
|
+
var args = [];
|
108
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
109
|
+
args[_i] = arguments[_i];
|
110
|
+
}
|
111
|
+
var store = this.props.store;
|
112
|
+
var action = store.action;
|
113
|
+
var dialog = action.dialog;
|
114
|
+
if (dialog.onClose && dialog.onClose.apply(dialog, args) === false) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
store.closeDialog(args[1]);
|
118
|
+
};
|
119
|
+
Dialog.prototype.handleDrawerConfirm = function (values, action) {
|
120
|
+
var args = [];
|
121
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
122
|
+
args[_i - 2] = arguments[_i];
|
123
|
+
}
|
124
|
+
var store = this.props.store;
|
125
|
+
if (action.mergeData && values.length === 1 && values[0]) {
|
126
|
+
store.updateData(values[0]);
|
127
|
+
}
|
128
|
+
var drawer = store.action.drawer;
|
129
|
+
if (drawer &&
|
130
|
+
drawer.onConfirm &&
|
131
|
+
drawer.onConfirm.apply(drawer, __spreadArray([values, action], args, false)) === false) {
|
132
|
+
return;
|
133
|
+
}
|
134
|
+
store.closeDrawer();
|
135
|
+
};
|
136
|
+
Dialog.prototype.handleDrawerClose = function () {
|
137
|
+
var args = [];
|
138
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
139
|
+
args[_i] = arguments[_i];
|
140
|
+
}
|
141
|
+
var store = this.props.store;
|
142
|
+
var action = store.action;
|
143
|
+
var drawer = action.drawer;
|
144
|
+
if (drawer.onClose && drawer.onClose.apply(drawer, args) === false) {
|
145
|
+
return;
|
146
|
+
}
|
147
|
+
store.closeDrawer();
|
148
|
+
};
|
149
|
+
Dialog.prototype.handleEntered = function () {
|
150
|
+
var _a = this.props, lazySchema = _a.lazySchema, store = _a.store;
|
151
|
+
store.setEntered(true);
|
152
|
+
if (typeof lazySchema === 'function') {
|
153
|
+
store.setSchema(lazySchema(this.props));
|
154
|
+
}
|
155
|
+
var activeElem = document.activeElement;
|
156
|
+
if (activeElem) {
|
157
|
+
var dom = findDOMNode(this);
|
158
|
+
dom && !dom.contains(activeElem) && activeElem.blur();
|
159
|
+
}
|
160
|
+
};
|
161
|
+
Dialog.prototype.handleExited = function () {
|
162
|
+
var _a = this.props, lazySchema = _a.lazySchema, store = _a.store;
|
163
|
+
if (isAlive(store)) {
|
164
|
+
store.reset();
|
165
|
+
store.setEntered(false);
|
166
|
+
if (typeof lazySchema === 'function') {
|
167
|
+
store.setSchema('');
|
168
|
+
}
|
169
|
+
}
|
170
|
+
};
|
171
|
+
Dialog.prototype.handleFormInit = function (data) {
|
172
|
+
var store = this.props.store;
|
173
|
+
store.setFormData(data);
|
174
|
+
};
|
175
|
+
Dialog.prototype.handleFormChange = function (data, name) {
|
176
|
+
var _a;
|
177
|
+
var store = this.props.store;
|
178
|
+
// 如果 dialog 里面不放 form,而是直接放表单项就会进到这里来。
|
179
|
+
if (typeof name === 'string') {
|
180
|
+
data = (_a = {},
|
181
|
+
_a[name] = data,
|
182
|
+
_a);
|
183
|
+
}
|
184
|
+
store.setFormData(data);
|
185
|
+
};
|
186
|
+
Dialog.prototype.handleFormSaved = function (data, response) {
|
187
|
+
var store = this.props.store;
|
188
|
+
store.setFormData(__assign(__assign({}, data), response));
|
189
|
+
};
|
190
|
+
Dialog.prototype.handleChildFinished = function (value, action) {
|
191
|
+
// 下面会覆盖
|
192
|
+
};
|
193
|
+
Dialog.prototype.openFeedback = function (dialog, ctx) {
|
194
|
+
var _this = this;
|
195
|
+
return new Promise(function (resolve) {
|
196
|
+
var store = _this.props.store;
|
197
|
+
store.setCurrentAction({
|
198
|
+
type: 'button',
|
199
|
+
actionType: 'dialog',
|
200
|
+
dialog: dialog
|
201
|
+
});
|
202
|
+
store.openDialog(ctx, undefined, function (confirmed) {
|
203
|
+
resolve(confirmed);
|
204
|
+
});
|
205
|
+
});
|
206
|
+
};
|
207
|
+
Dialog.prototype.getPopOverContainer = function () {
|
208
|
+
return findDOMNode(this).querySelector(".".concat(this.props.classPrefix, "Modal-content"));
|
209
|
+
};
|
210
|
+
Dialog.prototype.renderBody = function (body, key) {
|
211
|
+
var _this = this;
|
212
|
+
var _a = this.props, render = _a.render, store = _a.store;
|
213
|
+
if (Array.isArray(body)) {
|
214
|
+
return body.map(function (body, key) { return _this.renderBody(body, key); });
|
215
|
+
}
|
216
|
+
var subProps = {
|
217
|
+
key: key,
|
218
|
+
disabled: (body && body.disabled) || store.loading,
|
219
|
+
onAction: this.handleAction,
|
220
|
+
onFinished: this.handleChildFinished,
|
221
|
+
popOverContainer: this.getPopOverContainer,
|
222
|
+
affixOffsetTop: 0,
|
223
|
+
onChange: this.handleFormChange,
|
224
|
+
onInit: this.handleFormInit,
|
225
|
+
onSaved: this.handleFormSaved,
|
226
|
+
syncLocation: false // 弹框中的 crud 一般不需要同步地址栏
|
227
|
+
};
|
228
|
+
if (!body.type) {
|
229
|
+
return render("body".concat(key ? "/".concat(key) : ''), body, subProps);
|
230
|
+
}
|
231
|
+
var schema = body;
|
232
|
+
if (schema.type === 'form') {
|
233
|
+
schema = __assign({ mode: 'horizontal', wrapWithPanel: false, submitText: null }, schema);
|
234
|
+
}
|
235
|
+
return render("body".concat(key ? "/".concat(key) : ''), schema, subProps);
|
236
|
+
};
|
237
|
+
Dialog.prototype.renderFooter = function () {
|
238
|
+
var _this = this;
|
239
|
+
var actions = this.buildActions();
|
240
|
+
if (!actions || !actions.length) {
|
241
|
+
return null;
|
242
|
+
}
|
243
|
+
var _a = this.props, store = _a.store, render = _a.render, cx = _a.classnames, showErrorMsg = _a.showErrorMsg, showLoading = _a.showLoading;
|
244
|
+
return (React.createElement("div", { className: cx('Modal-footer') },
|
245
|
+
(showLoading !== false && store.loading) ||
|
246
|
+
(showErrorMsg !== false && store.error) ? (React.createElement("div", { className: cx('Dialog-info'), key: "info" },
|
247
|
+
showLoading !== false ? (React.createElement(Spinner, { size: "sm", key: "info", show: store.loading })) : null,
|
248
|
+
store.error && showErrorMsg !== false ? (React.createElement("span", { className: cx('Dialog-error') }, store.msg)) : null)) : null,
|
249
|
+
actions.map(function (action, key) {
|
250
|
+
return render("action/".concat(key), action, {
|
251
|
+
data: store.formData,
|
252
|
+
onAction: _this.handleAction,
|
253
|
+
key: key,
|
254
|
+
disabled: action.disabled || store.loading
|
255
|
+
});
|
256
|
+
})));
|
257
|
+
};
|
258
|
+
Dialog.prototype.render = function () {
|
259
|
+
var store = this.props.store;
|
260
|
+
var _a = __assign(__assign({}, this.props), store.schema), className = _a.className, size = _a.size, closeOnEsc = _a.closeOnEsc, closeOnOutside = _a.closeOnOutside, title = _a.title, render = _a.render, header = _a.header, body = _a.body, bodyClassName = _a.bodyClassName, headerClassName = _a.headerClassName, show = _a.show, lazyRender = _a.lazyRender, lazySchema = _a.lazySchema, wrapperComponent = _a.wrapperComponent, showCloseButton = _a.showCloseButton, env = _a.env, cx = _a.classnames, classPrefix = _a.classPrefix, __ = _a.translate;
|
261
|
+
var Wrapper = wrapperComponent || Modal;
|
262
|
+
return (React.createElement(Wrapper, { classPrefix: classPrefix, className: cx(className), size: size, backdrop: "static", onHide: this.handleSelfClose, keyboard: closeOnEsc && !store.loading, closeOnEsc: closeOnEsc, closeOnOutside: !store.dialogOpen && closeOnOutside, show: show, onEntered: this.handleEntered, onExited: this.handleExited, container: env && env.getModalContainer ? env.getModalContainer : undefined, enforceFocus: false, disabled: store.loading },
|
263
|
+
title && typeof title === 'string' ? (React.createElement("div", { className: cx('Modal-header', headerClassName) },
|
264
|
+
showCloseButton !== false && !store.loading ? (React.createElement("a", { "data-tooltip": __('Dialog.close'), "data-position": "left", onClick: this.handleSelfClose, className: cx('Modal-close') },
|
265
|
+
React.createElement(Icon, { icon: "close", className: "icon" }))) : null,
|
266
|
+
React.createElement("div", { className: cx('Modal-title') }, filter(__(title), store.formData)))) : title ? (React.createElement("div", { className: cx('Modal-header', headerClassName) },
|
267
|
+
showCloseButton !== false && !store.loading ? (React.createElement("a", { "data-tooltip": __('Dialog.close'), onClick: this.handleSelfClose, className: cx('Modal-close') },
|
268
|
+
React.createElement(Icon, { icon: "close", className: "icon" }))) : null,
|
269
|
+
render('title', title, {
|
270
|
+
data: store.formData,
|
271
|
+
onAction: this.handleAction
|
272
|
+
}))) : showCloseButton !== false && !store.loading ? (React.createElement("a", { "data-tooltip": __('Dialog.close'), onClick: this.handleSelfClose, className: cx('Modal-close') },
|
273
|
+
React.createElement(Icon, { icon: "close", className: "icon" }))) : null,
|
274
|
+
header
|
275
|
+
? render('header', header, {
|
276
|
+
data: store.formData,
|
277
|
+
onAction: this.handleAction
|
278
|
+
})
|
279
|
+
: null,
|
280
|
+
(!store.entered && lazyRender) || (lazySchema && !body) ? (React.createElement("div", { className: cx('Modal-body', bodyClassName) },
|
281
|
+
React.createElement(Spinner, { overlay: true, show: true, size: "lg" }))) : body ? (React.createElement("div", { className: cx('Modal-body', bodyClassName) }, this.renderBody(body, 'body'))) : null,
|
282
|
+
this.renderFooter(),
|
283
|
+
body
|
284
|
+
? render('drawer', __assign(__assign({}, (store.action &&
|
285
|
+
store.action.drawer)), { type: 'drawer' }), {
|
286
|
+
key: 'drawer',
|
287
|
+
data: store.drawerData,
|
288
|
+
onConfirm: this.handleDrawerConfirm,
|
289
|
+
onClose: this.handleDrawerClose,
|
290
|
+
show: store.drawerOpen,
|
291
|
+
onAction: this.handleAction
|
292
|
+
})
|
293
|
+
: null,
|
294
|
+
body
|
295
|
+
? render('dialog', __assign(__assign({}, (store.action &&
|
296
|
+
store.action.dialog)), { type: 'dialog' }), {
|
297
|
+
key: 'dialog',
|
298
|
+
data: store.dialogData,
|
299
|
+
onConfirm: this.handleDialogConfirm,
|
300
|
+
onClose: this.handleDialogClose,
|
301
|
+
show: store.dialogOpen,
|
302
|
+
onAction: this.handleAction
|
303
|
+
})
|
304
|
+
: null));
|
305
|
+
};
|
306
|
+
Dialog.propsList = [
|
307
|
+
'title',
|
308
|
+
'size',
|
309
|
+
'closeOnEsc',
|
310
|
+
'closeOnOutside',
|
311
|
+
'children',
|
312
|
+
'bodyClassName',
|
313
|
+
'headerClassName',
|
314
|
+
'confirm',
|
315
|
+
'onClose',
|
316
|
+
'onConfirm',
|
317
|
+
'show',
|
318
|
+
'body',
|
319
|
+
'showCloseButton',
|
320
|
+
'showErrorMsg',
|
321
|
+
'actions',
|
322
|
+
'popOverContainer'
|
323
|
+
];
|
324
|
+
Dialog.defaultProps = {
|
325
|
+
title: 'Dialog.title',
|
326
|
+
bodyClassName: '',
|
327
|
+
confirm: true,
|
328
|
+
show: true,
|
329
|
+
lazyRender: false,
|
330
|
+
showCloseButton: true,
|
331
|
+
wrapperComponent: Modal,
|
332
|
+
closeOnEsc: false,
|
333
|
+
closeOnOutside: false,
|
334
|
+
showErrorMsg: true
|
335
|
+
};
|
336
|
+
__decorate([
|
337
|
+
autobind,
|
338
|
+
__metadata("design:type", Function),
|
339
|
+
__metadata("design:paramtypes", []),
|
340
|
+
__metadata("design:returntype", void 0)
|
341
|
+
], Dialog.prototype, "getPopOverContainer", null);
|
342
|
+
return Dialog;
|
343
|
+
}(React.Component));
|
344
|
+
/** @class */ ((function (_super) {
|
345
|
+
__extends(DialogRenderer, _super);
|
346
|
+
function DialogRenderer(props, context) {
|
347
|
+
var _this = _super.call(this, props) || this;
|
348
|
+
var scoped = context;
|
349
|
+
scoped.registerComponent(_this);
|
350
|
+
return _this;
|
351
|
+
}
|
352
|
+
DialogRenderer.prototype.componentWillUnmount = function () {
|
353
|
+
var scoped = this.context;
|
354
|
+
scoped.unRegisterComponent(this);
|
355
|
+
_super.prototype.componentWillUnmount.call(this);
|
356
|
+
};
|
357
|
+
DialogRenderer.prototype.tryChildrenToHandle = function (action, ctx, rawAction) {
|
358
|
+
var _this = this;
|
359
|
+
var scoped = this.context;
|
360
|
+
var targets = [];
|
361
|
+
var _a = this.props, onConfirm = _a.onConfirm, store = _a.store;
|
362
|
+
if (action.target) {
|
363
|
+
targets.push.apply(targets, action.target
|
364
|
+
.split(',')
|
365
|
+
.map(function (name) { return scoped.getComponentByName(name); })
|
366
|
+
.filter(function (item) { return item && item.doAction; }));
|
367
|
+
}
|
368
|
+
if (!targets.length) {
|
369
|
+
var components = scoped
|
370
|
+
.getComponents()
|
371
|
+
.filter(function (item) { return !~['drawer', 'dialog'].indexOf(item.props.type); });
|
372
|
+
var pool = components.concat();
|
373
|
+
while (pool.length) {
|
374
|
+
var item = pool.pop();
|
375
|
+
if (~['crud', 'form', 'wizard'].indexOf(item.props.type)) {
|
376
|
+
targets.push(item);
|
377
|
+
break;
|
378
|
+
}
|
379
|
+
else if (~['drawer', 'dialog'].indexOf(item.props.type)) {
|
380
|
+
continue;
|
381
|
+
}
|
382
|
+
else if (~['page', 'service'].indexOf(item.props.type)) {
|
383
|
+
pool.unshift.apply(pool, item.context.getComponents());
|
384
|
+
}
|
385
|
+
}
|
386
|
+
}
|
387
|
+
if (targets.length) {
|
388
|
+
store.markBusying(true);
|
389
|
+
store.updateMessage();
|
390
|
+
Promise.all(targets.map(function (target) {
|
391
|
+
return target.doAction(__assign(__assign({}, action), { from: _this.$$id }), ctx, true);
|
392
|
+
}))
|
393
|
+
.then(function (values) {
|
394
|
+
if ((action.type === 'submit' ||
|
395
|
+
action.actionType === 'submit' ||
|
396
|
+
action.actionType === 'confirm') &&
|
397
|
+
action.close !== false) {
|
398
|
+
onConfirm && onConfirm(values, rawAction || action, ctx, targets);
|
399
|
+
}
|
400
|
+
else if (action.close) {
|
401
|
+
action.close === true
|
402
|
+
? _this.handleSelfClose()
|
403
|
+
: _this.closeTarget(action.close);
|
404
|
+
}
|
405
|
+
store.markBusying(false);
|
406
|
+
})
|
407
|
+
.catch(function (reason) {
|
408
|
+
if (_this.isDead) {
|
409
|
+
return;
|
410
|
+
}
|
411
|
+
store.updateMessage(reason.message, true);
|
412
|
+
store.markBusying(false);
|
413
|
+
});
|
414
|
+
return true;
|
415
|
+
}
|
416
|
+
return false;
|
417
|
+
};
|
418
|
+
DialogRenderer.prototype.doAction = function (action, data, throwErrors) {
|
419
|
+
this.handleAction(undefined, action, data);
|
420
|
+
};
|
421
|
+
DialogRenderer.prototype.handleAction = function (e, action, data, throwErrors, delegate) {
|
422
|
+
if (throwErrors === void 0) { throwErrors = false; }
|
423
|
+
return __awaiter(this, void 0, void 0, function () {
|
424
|
+
var _a, onAction, store, onConfirm, env, dispatchEvent, scoped, rendererEvent, rendererEvent, ret;
|
425
|
+
var _this = this;
|
426
|
+
return __generator(this, function (_b) {
|
427
|
+
switch (_b.label) {
|
428
|
+
case 0:
|
429
|
+
_a = this.props, onAction = _a.onAction, store = _a.store, onConfirm = _a.onConfirm, env = _a.env, dispatchEvent = _a.dispatchEvent;
|
430
|
+
if (action.from === this.$$id) {
|
431
|
+
return [2 /*return*/, onAction
|
432
|
+
? onAction(e, action, data, throwErrors, delegate || this.context)
|
433
|
+
: false];
|
434
|
+
}
|
435
|
+
scoped = this.context;
|
436
|
+
if (!(action.type === 'reset')) return [3 /*break*/, 1];
|
437
|
+
store.setCurrentAction(action);
|
438
|
+
store.reset();
|
439
|
+
return [3 /*break*/, 6];
|
440
|
+
case 1:
|
441
|
+
if (!(action.actionType === 'close' ||
|
442
|
+
action.actionType === 'cancel')) return [3 /*break*/, 3];
|
443
|
+
return [4 /*yield*/, dispatchEvent('cancel', createObject(this.props.data, data))];
|
444
|
+
case 2:
|
445
|
+
rendererEvent = _b.sent();
|
446
|
+
if (rendererEvent === null || rendererEvent === void 0 ? void 0 : rendererEvent.prevented) {
|
447
|
+
return [2 /*return*/];
|
448
|
+
}
|
449
|
+
store.setCurrentAction(action);
|
450
|
+
this.handleSelfClose();
|
451
|
+
action.close && this.closeTarget(action.close);
|
452
|
+
return [3 /*break*/, 6];
|
453
|
+
case 3:
|
454
|
+
if (!(action.actionType === 'confirm')) return [3 /*break*/, 5];
|
455
|
+
return [4 /*yield*/, dispatchEvent('confirm', createObject(this.props.data, data))];
|
456
|
+
case 4:
|
457
|
+
rendererEvent = _b.sent();
|
458
|
+
if (rendererEvent === null || rendererEvent === void 0 ? void 0 : rendererEvent.prevented) {
|
459
|
+
return [2 /*return*/];
|
460
|
+
}
|
461
|
+
store.setCurrentAction(action);
|
462
|
+
this.tryChildrenToHandle(__assign(__assign({}, action), { actionType: 'submit' }), data, action) || this.handleSelfClose(undefined, true);
|
463
|
+
return [3 /*break*/, 6];
|
464
|
+
case 5:
|
465
|
+
if (action.actionType === 'next' || action.actionType === 'prev') {
|
466
|
+
store.setCurrentAction(action);
|
467
|
+
if (action.type === 'submit') {
|
468
|
+
this.tryChildrenToHandle(__assign(__assign({}, action), { actionType: 'submit', close: true }), data, action) || this.handleSelfClose(undefined, true);
|
469
|
+
}
|
470
|
+
else {
|
471
|
+
onConfirm([data], action, data, []);
|
472
|
+
}
|
473
|
+
}
|
474
|
+
else if (action.actionType === 'dialog') {
|
475
|
+
store.setCurrentAction(action);
|
476
|
+
store.openDialog(data);
|
477
|
+
}
|
478
|
+
else if (action.actionType === 'drawer') {
|
479
|
+
store.setCurrentAction(action);
|
480
|
+
store.openDrawer(data);
|
481
|
+
}
|
482
|
+
else if (action.actionType === 'reload') {
|
483
|
+
store.setCurrentAction(action);
|
484
|
+
action.target && scoped.reload(action.target, data);
|
485
|
+
if (action.close || action.type === 'submit') {
|
486
|
+
this.handleSelfClose(undefined, action.type === 'submit');
|
487
|
+
this.closeTarget(action.close);
|
488
|
+
}
|
489
|
+
}
|
490
|
+
else if (this.tryChildrenToHandle(action, data)) ;
|
491
|
+
else if (action.actionType === 'ajax') {
|
492
|
+
store.setCurrentAction(action);
|
493
|
+
store
|
494
|
+
.saveRemote(action.api, data, {
|
495
|
+
successMessage: action.messages && action.messages.success,
|
496
|
+
errorMessage: action.messages && action.messages.failed
|
497
|
+
})
|
498
|
+
.then(function () { return __awaiter(_this, void 0, void 0, function () {
|
499
|
+
var reidrect;
|
500
|
+
return __generator(this, function (_a) {
|
501
|
+
switch (_a.label) {
|
502
|
+
case 0:
|
503
|
+
if (!(action.feedback && isVisible(action.feedback, store.data))) return [3 /*break*/, 2];
|
504
|
+
return [4 /*yield*/, this.openFeedback(action.feedback, store.data)];
|
505
|
+
case 1:
|
506
|
+
_a.sent();
|
507
|
+
_a.label = 2;
|
508
|
+
case 2:
|
509
|
+
reidrect = action.redirect && filter(action.redirect, store.data);
|
510
|
+
reidrect && env.jumpTo(reidrect, action);
|
511
|
+
action.reload && this.reloadTarget(action.reload, store.data);
|
512
|
+
if (action.close) {
|
513
|
+
this.handleSelfClose();
|
514
|
+
this.closeTarget(action.close);
|
515
|
+
}
|
516
|
+
return [2 /*return*/];
|
517
|
+
}
|
518
|
+
});
|
519
|
+
}); })
|
520
|
+
.catch(function (e) {
|
521
|
+
if (throwErrors || action.countDown) {
|
522
|
+
throw e;
|
523
|
+
}
|
524
|
+
});
|
525
|
+
}
|
526
|
+
else if (onAction) {
|
527
|
+
ret = onAction(e, __assign(__assign({}, action), { close: false }), data, throwErrors, delegate || this.context);
|
528
|
+
action.close &&
|
529
|
+
(ret && ret.then
|
530
|
+
? ret.then(this.handleSelfClose)
|
531
|
+
: setTimeout(this.handleSelfClose, 200));
|
532
|
+
}
|
533
|
+
_b.label = 6;
|
534
|
+
case 6: return [2 /*return*/];
|
535
|
+
}
|
536
|
+
});
|
537
|
+
});
|
538
|
+
};
|
539
|
+
DialogRenderer.prototype.handleChildFinished = function (value, action) {
|
540
|
+
if ((action && action.from === this.$$id) || action.close === false) {
|
541
|
+
return;
|
542
|
+
}
|
543
|
+
var scoped = this.context;
|
544
|
+
var components = scoped
|
545
|
+
.getComponents()
|
546
|
+
.filter(function (item) { return !~['drawer', 'dialog'].indexOf(item.props.type); });
|
547
|
+
var onConfirm = this.props.onConfirm;
|
548
|
+
var onClose = this.props.onClose;
|
549
|
+
if (components.length === 1 &&
|
550
|
+
(components[0].props.type === 'form' ||
|
551
|
+
components[0].props.type === 'wizard') &&
|
552
|
+
(action.close === true ||
|
553
|
+
components[0].props.closeDialogOnSubmit !== false)) {
|
554
|
+
onConfirm && onConfirm([value], action, {}, components);
|
555
|
+
}
|
556
|
+
else if (action.close === true) {
|
557
|
+
onClose();
|
558
|
+
}
|
559
|
+
};
|
560
|
+
DialogRenderer.prototype.handleDialogConfirm = function (values, action) {
|
561
|
+
var _a;
|
562
|
+
var rest = [];
|
563
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
564
|
+
rest[_i - 2] = arguments[_i];
|
565
|
+
}
|
566
|
+
_super.prototype.handleDialogConfirm.apply(this, __spreadArray([values, action], rest, false));
|
567
|
+
var scoped = this.context;
|
568
|
+
var store = this.props.store;
|
569
|
+
var dialogAction = store.action;
|
570
|
+
var reload = (_a = action.reload) !== null && _a !== void 0 ? _a : dialogAction.reload;
|
571
|
+
if (reload) {
|
572
|
+
scoped.reload(reload, store.data);
|
573
|
+
}
|
574
|
+
else {
|
575
|
+
// 没有设置,则自动让页面中 crud 刷新。
|
576
|
+
scoped
|
577
|
+
.getComponents()
|
578
|
+
.filter(function (item) { return item.props.type === 'crud'; })
|
579
|
+
.forEach(function (item) { return item.reload && item.reload(); });
|
580
|
+
}
|
581
|
+
};
|
582
|
+
DialogRenderer.prototype.handleDrawerConfirm = function (values, action) {
|
583
|
+
_super.prototype.handleDrawerConfirm.call(this, values, action);
|
584
|
+
var scoped = this.context;
|
585
|
+
var store = this.props.store;
|
586
|
+
var drawerAction = store.action;
|
587
|
+
// 稍等会,等动画结束。
|
588
|
+
setTimeout(function () {
|
589
|
+
if (drawerAction.reload) {
|
590
|
+
scoped.reload(drawerAction.reload, store.data);
|
591
|
+
}
|
592
|
+
else if (action.reload) {
|
593
|
+
scoped.reload(action.reload, store.data);
|
594
|
+
}
|
595
|
+
else {
|
596
|
+
// 没有设置,则自动让页面中 crud 刷新。
|
597
|
+
scoped
|
598
|
+
.getComponents()
|
599
|
+
.filter(function (item) { return item.props.type === 'crud'; })
|
600
|
+
.forEach(function (item) { return item.reload && item.reload(); });
|
601
|
+
}
|
602
|
+
}, 300);
|
603
|
+
};
|
604
|
+
DialogRenderer.prototype.reloadTarget = function (target, data) {
|
605
|
+
var scoped = this.context;
|
606
|
+
scoped.reload(target, data);
|
607
|
+
};
|
608
|
+
DialogRenderer.prototype.closeTarget = function (target) {
|
609
|
+
var scoped = this.context;
|
610
|
+
scoped.close(target);
|
611
|
+
};
|
612
|
+
DialogRenderer.prototype.setData = function (values) {
|
613
|
+
return this.props.store.updateData(values);
|
614
|
+
};
|
615
|
+
DialogRenderer.contextType = ScopedContext;
|
616
|
+
DialogRenderer = __decorate([
|
617
|
+
Renderer({
|
618
|
+
type: 'dialog',
|
619
|
+
storeType: ModalStore.name,
|
620
|
+
storeExtendsData: false,
|
621
|
+
isolateScope: true,
|
622
|
+
shouldSyncSuperStore: function (store, props, prevProps) {
|
623
|
+
return !!((store.dialogOpen || props.show) &&
|
624
|
+
(props.show !== prevProps.show ||
|
625
|
+
isObjectShallowModified(prevProps.data, props.data)));
|
626
|
+
}
|
627
|
+
}),
|
628
|
+
__metadata("design:paramtypes", [Object, Object])
|
629
|
+
], DialogRenderer);
|
630
|
+
return DialogRenderer;
|
631
|
+
})(Dialog));
|
632
|
+
|
633
|
+
export { Dialog as default };
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RendererProps } from 'amis-core';
|
3
|
+
import { BaseSchema } from '../Schema';
|
4
|
+
/**
|
5
|
+
* Divider 分割线渲染器。
|
6
|
+
* 文档:https://baidu.gitee.io/amis/docs/components/divider
|
7
|
+
*/
|
8
|
+
export interface DividerSchema extends BaseSchema {
|
9
|
+
type: 'divider';
|
10
|
+
lineStyle?: 'dashed' | 'solid';
|
11
|
+
[propName: string]: any;
|
12
|
+
}
|
13
|
+
export interface DividerProps extends RendererProps, Omit<DividerSchema, 'type' | 'className'> {
|
14
|
+
}
|
15
|
+
export default class Divider extends React.Component<DividerProps, object> {
|
16
|
+
static defaultProps: Pick<DividerProps, 'className' | 'lineStyle'>;
|
17
|
+
render(): JSX.Element;
|
18
|
+
}
|
19
|
+
export declare class DividerRenderer extends Divider {
|
20
|
+
}
|