amis 1.4.0 → 1.4.2-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/Schema.d.ts +26 -2
- package/lib/Schema.js.map +1 -1
- package/lib/components/Alert.js +3 -1
- package/lib/components/Alert.js.map +2 -2
- package/lib/components/AnchorNav.d.ts +22 -21
- package/lib/components/AnchorNav.js +7 -3
- package/lib/components/AnchorNav.js.map +2 -2
- package/lib/components/ArrayInput.d.ts +84 -84
- package/lib/components/AssociatedSelection.d.ts +930 -0
- package/lib/components/AssociatedSelection.js +89 -0
- package/lib/components/AssociatedSelection.js.map +13 -0
- package/lib/components/Badge.d.ts +4 -3
- package/lib/components/Badge.js +42 -7
- package/lib/components/Badge.js.map +2 -2
- package/lib/components/Button.d.ts +24 -22
- package/lib/components/Button.js +13 -7
- package/lib/components/Button.js.map +2 -2
- package/lib/components/{ChainedCheckboxes.d.ts → ChainedSelection.d.ts} +267 -98
- package/lib/components/{ChainedCheckboxes.js → ChainedSelection.js} +30 -24
- package/lib/components/ChainedSelection.js.map +13 -0
- package/lib/components/Collapse.js +1 -1
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/ColorPicker.d.ts +84 -84
- package/lib/components/DatePicker.d.ts +84 -84
- package/lib/components/DatePicker.js +1 -1
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +84 -84
- package/lib/components/DateRangePicker.js +1 -1
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/Editor.d.ts +84 -84
- package/lib/components/GroupedSelection.d.ts +907 -0
- package/lib/components/GroupedSelection.js +48 -0
- package/lib/components/GroupedSelection.js.map +13 -0
- package/lib/components/InputBox.js +1 -1
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Link.d.ts +84 -0
- package/lib/components/Link.js +43 -0
- package/lib/components/Link.js.map +13 -0
- package/lib/components/ListGroup.d.ts +21 -21
- package/lib/components/ModalManager.js +1 -1
- package/lib/components/ModalManager.js.map +2 -2
- package/lib/components/MonthRangePicker.d.ts +84 -84
- package/lib/components/MonthRangePicker.js +1 -1
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/NumberInput.d.ts +20 -20
- package/lib/components/PickerColumn.d.ts +514 -0
- package/lib/components/PickerColumn.js +279 -0
- package/lib/components/PickerColumn.js.map +13 -0
- package/lib/components/PickerContainer.d.ts +513 -0
- package/lib/components/PickerContainer.js +96 -0
- package/lib/components/PickerContainer.js.map +13 -0
- package/lib/components/Radios.d.ts +22 -21
- package/lib/components/Radios.js +1 -0
- package/lib/components/Radios.js.map +2 -2
- package/lib/components/Rating.d.ts +21 -21
- package/lib/components/ResultBox.d.ts +84 -84
- package/lib/components/RichText.d.ts +6 -1
- package/lib/components/RichText.js +207 -8
- package/lib/components/RichText.js.map +2 -2
- package/lib/components/SearchBox.d.ts +84 -84
- package/lib/components/SearchBox.js +4 -4
- package/lib/components/SearchBox.js.map +2 -2
- package/lib/components/Select.d.ts +245 -237
- package/lib/components/Select.js +28 -4
- package/lib/components/Select.js.map +2 -2
- package/lib/components/{Checkboxes.d.ts → Selection.d.ts} +273 -98
- package/lib/components/Selection.js +134 -0
- package/lib/components/Selection.js.map +13 -0
- package/lib/components/SparkLine.d.ts +85 -84
- package/lib/components/SparkLine.js +2 -2
- package/lib/components/SparkLine.js.map +2 -2
- package/lib/components/{TableCheckboxes.d.ts → TableSelection.d.ts} +266 -96
- package/lib/components/{TableCheckboxes.js → TableSelection.js} +30 -30
- package/lib/components/TableSelection.js.map +13 -0
- package/lib/components/Tabs.d.ts +20 -20
- package/lib/components/TabsTransfer.d.ts +84 -84
- package/lib/components/TabsTransfer.js +9 -9
- package/lib/components/TabsTransfer.js.map +2 -2
- package/lib/components/TabsTransferPicker.d.ts +489 -0
- package/lib/components/TabsTransferPicker.js +60 -0
- package/lib/components/TabsTransferPicker.js.map +13 -0
- package/lib/components/Toast.js +2 -2
- package/lib/components/Toast.js.map +2 -2
- package/lib/components/Transfer.d.ts +908 -274
- package/lib/components/Transfer.js +31 -24
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +487 -0
- package/lib/components/TransferDropDown.js +59 -0
- package/lib/components/TransferDropDown.js.map +13 -0
- package/lib/components/TransferPicker.d.ts +489 -0
- package/lib/components/TransferPicker.js +60 -0
- package/lib/components/TransferPicker.js.map +13 -0
- package/lib/components/Tree.d.ts +84 -84
- package/lib/components/Tree.js +5 -3
- package/lib/components/Tree.js.map +2 -2
- package/lib/components/{TreeCheckboxes.d.ts → TreeSelection.d.ts} +269 -99
- package/lib/components/{TreeCheckboxes.js → TreeSelection.js} +36 -32
- package/lib/components/TreeSelection.js.map +13 -0
- package/lib/components/WithRemoteConfig.js +1 -1
- package/lib/components/WithRemoteConfig.js.map +2 -2
- package/lib/components/calendar/DaysView.js +2 -2
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/components/condition-builder/Field.js +5 -2
- package/lib/components/condition-builder/Field.js.map +2 -2
- package/lib/components/condition-builder/Func.js +2 -2
- package/lib/components/condition-builder/Func.js.map +2 -2
- package/lib/components/condition-builder/InputSwitch.js +2 -2
- package/lib/components/condition-builder/InputSwitch.js.map +2 -2
- package/lib/components/condition-builder/Item.js +3 -3
- package/lib/components/condition-builder/Item.js.map +2 -2
- package/lib/components/icons.js +14 -0
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +8 -8
- package/lib/components/index.js +16 -16
- package/lib/components/index.js.map +2 -2
- package/lib/envOverwrite.js.map +2 -2
- package/lib/factory.d.ts +4 -0
- package/lib/factory.js +4 -2
- package/lib/factory.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.js +14 -0
- package/lib/hooks/index.js.map +13 -0
- package/lib/hooks/use-set-state.d.ts +2 -0
- package/lib/hooks/use-set-state.js +15 -0
- package/lib/hooks/use-set-state.js.map +13 -0
- package/lib/hooks/use-touch.d.ts +16 -0
- package/lib/hooks/use-touch.js +73 -0
- package/lib/hooks/use-touch.js.map +13 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +17 -0
- package/lib/hooks/use-update-effect.js.map +13 -0
- package/lib/icons/clock.js +10 -0
- package/lib/icons/loading-outline.js +7 -0
- package/lib/icons/status-close.js +11 -0
- package/lib/icons/status-fail.js +11 -0
- package/lib/icons/status-info.js +10 -0
- package/lib/icons/status-success.js +11 -0
- package/lib/icons/status-warning.js +10 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +4 -0
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +4 -0
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +7 -3
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +17 -1
- package/lib/renderers/Action.js +21 -8
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/AnchorNav.d.ts +1 -0
- package/lib/renderers/AnchorNav.js +2 -2
- package/lib/renderers/AnchorNav.js.map +2 -2
- package/lib/renderers/Avatar.js +3 -3
- package/lib/renderers/Avatar.js.map +2 -2
- package/lib/renderers/Breadcrumb.js +1 -1
- package/lib/renderers/Breadcrumb.js.map +2 -2
- package/lib/renderers/CRUD.d.ts +9 -0
- package/lib/renderers/CRUD.js +43 -8
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Card.d.ts +4 -0
- package/lib/renderers/Card.js +29 -23
- package/lib/renderers/Card.js.map +2 -2
- package/lib/renderers/Chart.js +1 -1
- package/lib/renderers/Chart.js.map +2 -2
- package/lib/renderers/Collapse.js +3 -2
- package/lib/renderers/Collapse.js.map +2 -2
- package/lib/renderers/Dialog.js +0 -3
- package/lib/renderers/Dialog.js.map +2 -2
- package/lib/renderers/Drawer.js +0 -3
- package/lib/renderers/Drawer.js.map +2 -2
- package/lib/renderers/DropDownButton.d.ts +9 -1
- package/lib/renderers/DropDownButton.js +8 -4
- package/lib/renderers/DropDownButton.js.map +2 -2
- package/lib/renderers/Form/Checkbox.d.ts +5 -0
- package/lib/renderers/Form/Checkbox.js +4 -0
- package/lib/renderers/Form/Checkbox.js.map +2 -2
- package/lib/renderers/Form/Combo.js +2 -2
- package/lib/renderers/Form/Combo.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +4 -3
- package/lib/renderers/Form/Editor.d.ts +3 -2
- package/lib/renderers/Form/InputCity.d.ts +84 -84
- package/lib/renderers/Form/InputCity.js +7 -6
- package/lib/renderers/Form/InputCity.js.map +2 -2
- package/lib/renderers/Form/InputColor.d.ts +84 -84
- package/lib/renderers/Form/InputFile.js +12 -6
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputImage.js +16 -7
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +1 -1
- package/lib/renderers/Form/Item.js.map +1 -1
- package/lib/renderers/Form/Options.js +19 -6
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Picker.js +2 -2
- package/lib/renderers/Form/Picker.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +41 -4
- package/lib/renderers/Form/Select.js +37 -3
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TabsTransferPicker.d.ts +48 -0
- package/lib/renderers/Form/TabsTransferPicker.js +29 -0
- package/lib/renderers/Form/TabsTransferPicker.js.map +13 -0
- package/lib/renderers/Form/Transfer.js +18 -3
- package/lib/renderers/Form/Transfer.js.map +2 -2
- package/lib/renderers/Form/TransferPicker.d.ts +48 -0
- package/lib/renderers/Form/TransferPicker.js +43 -0
- package/lib/renderers/Form/TransferPicker.js.map +13 -0
- package/lib/renderers/Form/TreeSelect.js +2 -2
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.d.ts +5 -0
- package/lib/renderers/Form/index.js +5 -3
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +15 -3
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/IFrame.js +3 -5
- package/lib/renderers/IFrame.js.map +2 -2
- package/lib/renderers/Image.d.ts +1 -0
- package/lib/renderers/Image.js +15 -1
- package/lib/renderers/Image.js.map +2 -2
- package/lib/renderers/Json.d.ts +4 -0
- package/lib/renderers/Json.js +4 -13
- package/lib/renderers/Json.js.map +2 -2
- package/lib/renderers/Link.d.ts +18 -3
- package/lib/renderers/Link.js +27 -15
- package/lib/renderers/Link.js.map +2 -2
- package/lib/renderers/List.js +1 -1
- package/lib/renderers/List.js.map +2 -2
- package/lib/renderers/Log.d.ts +2 -2
- package/lib/renderers/Log.js +7 -1
- package/lib/renderers/Log.js.map +2 -2
- package/lib/renderers/Mapping.d.ts +9 -2
- package/lib/renderers/Mapping.js +18 -6
- package/lib/renderers/Mapping.js.map +2 -2
- package/lib/renderers/Nav.d.ts +81 -25
- package/lib/renderers/Nav.js +292 -31
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/Page.js +1 -1
- package/lib/renderers/Page.js.map +2 -2
- package/lib/renderers/Portlet.d.ts +125 -0
- package/lib/renderers/Portlet.js +156 -0
- package/lib/renderers/Portlet.js.map +13 -0
- package/lib/renderers/Property.js +2 -1
- package/lib/renderers/Property.js.map +2 -2
- package/lib/renderers/SearchBox.d.ts +6 -1
- package/lib/renderers/SearchBox.js +19 -5
- package/lib/renderers/SearchBox.js.map +2 -2
- package/lib/renderers/SparkLine.d.ts +4 -0
- package/lib/renderers/SparkLine.js.map +2 -2
- package/lib/renderers/Table/ColumnToggler.d.ts +113 -0
- package/lib/renderers/Table/ColumnToggler.js +216 -0
- package/lib/renderers/Table/ColumnToggler.js.map +13 -0
- package/lib/renderers/Table/ItemActionsWrapper.d.ts +11 -0
- package/lib/renderers/Table/ItemActionsWrapper.js +31 -0
- package/lib/renderers/Table/ItemActionsWrapper.js.map +13 -0
- package/lib/renderers/Table/TableBody.d.ts +4 -0
- package/lib/renderers/Table/TableCell.js +3 -1
- package/lib/renderers/Table/TableCell.js.map +2 -2
- package/lib/renderers/Table/TableContent.d.ts +4 -1
- package/lib/renderers/Table/TableContent.js +21 -1
- package/lib/renderers/Table/TableContent.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +19 -2
- package/lib/renderers/Table/index.js +172 -57
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tabs.js +9 -1
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/renderers/WebComponent.js +1 -1
- package/lib/renderers/WebComponent.js.map +2 -2
- package/lib/store/combo.d.ts +2 -16
- package/lib/store/crud.js +3 -7
- package/lib/store/crud.js.map +2 -2
- package/lib/store/form.d.ts +1 -1
- package/lib/store/form.js +5 -6
- package/lib/store/form.js.map +2 -2
- package/lib/store/service.js +5 -4
- package/lib/store/service.js.map +2 -2
- package/lib/store/table.d.ts +260 -3
- package/lib/store/table.js +64 -6
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +1175 -255
- package/lib/themes/ang.css +1175 -255
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +1175 -255
- package/lib/themes/antd.css +1175 -255
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +1761 -514
- package/lib/themes/cxd.css +1761 -514
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +1175 -255
- package/lib/themes/dark.css +1175 -255
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +1761 -514
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +37 -0
- package/lib/types.js +0 -5
- package/lib/types.js.map +2 -2
- package/lib/utils/api.d.ts +3 -2
- package/lib/utils/api.js +31 -15
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/dom.d.ts +4 -0
- package/lib/utils/dom.js +11 -1
- package/lib/utils/dom.js.map +2 -2
- package/lib/utils/handleAction.d.ts +7 -0
- package/lib/utils/handleAction.js +30 -0
- package/lib/utils/handleAction.js.map +13 -0
- package/lib/utils/helper.d.ts +3 -1
- package/lib/utils/helper.js +14 -5
- package/lib/utils/helper.js.map +2 -2
- package/lib/utils/icon.js +3 -0
- package/lib/utils/icon.js.map +2 -2
- package/lib/utils/tpl-builtin.d.ts +1 -1
- package/lib/utils/tpl-builtin.js +25 -15
- package/lib/utils/tpl-builtin.js.map +2 -2
- package/package.json +1 -2
- package/schema.json +3534 -1028
- package/scss/_mixins.scss +27 -0
- package/scss/_properties.scss +84 -13
- package/scss/_utilities.scss +4 -0
- package/scss/base/_normalize.scss +2 -0
- package/scss/components/_anchor-nav.scss +88 -29
- package/scss/components/_badge.scss +52 -1
- package/scss/components/_button.scss +34 -3
- package/scss/components/_card.scss +8 -14
- package/scss/components/_collapse.scss +41 -8
- package/scss/components/_column-toggler.scss +234 -0
- package/scss/components/_dropdown.scss +2 -1
- package/scss/components/_image-gallery.scss +1 -1
- package/scss/components/_images.scss +2 -1
- package/scss/components/_link.scss +6 -0
- package/scss/components/_mapping.scss +6 -0
- package/scss/components/_nav.scss +236 -154
- package/scss/components/_page.scss +5 -4
- package/scss/components/_picker-columns.scss +123 -0
- package/scss/components/_popover.scss +17 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_progress.scss +2 -0
- package/scss/components/_status.scss +1 -1
- package/scss/components/_steps.scss +1 -1
- package/scss/components/_table.scss +51 -1
- package/scss/components/form/_checks.scss +0 -351
- package/scss/components/form/_color.scss +1 -0
- package/scss/components/form/_date-range.scss +2 -0
- package/scss/components/form/_date.scss +2 -0
- package/scss/components/form/_fieldset.scss +6 -3
- package/scss/components/form/_file.scss +5 -4
- package/scss/components/form/_form.scss +48 -0
- package/scss/components/form/_image.scss +7 -2
- package/scss/components/form/_list.scss +1 -0
- package/scss/components/form/_location.scss +1 -1
- package/scss/components/form/_selection.scss +354 -0
- package/scss/components/form/_text.scss +13 -0
- package/scss/components/form/_textarea.scss +10 -0
- package/scss/components/form/_transfer.scss +77 -18
- package/scss/themes/_common.scss +6 -0
- package/scss/themes/_cxd-colors.scss +56 -0
- package/scss/themes/_cxd-variables.scss +219 -91
- package/scss/themes/cxd.scss +370 -0
- package/sdk/ang-ie11.css +1596 -515
- package/sdk/ang.css +1395 -256
- package/sdk/antd-ie11.css +1397 -318
- package/sdk/antd.css +1395 -256
- package/sdk/charts.js +13 -13
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +2739 -1361
- package/sdk/cxd.css +2095 -588
- package/sdk/dark-ie11.css +1593 -512
- package/sdk/dark.css +1395 -256
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/iconfont.svg +2513 -0
- package/sdk/iconfont.ttf +0 -0
- package/sdk/iconfont.woff +0 -0
- package/sdk/ie11-patch.css +1 -0
- package/sdk/locale/de-DE.js +4 -0
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +18 -32
- package/sdk/rich-text.js +62 -64
- package/sdk/sdk-ie11.css +2739 -1361
- package/sdk/sdk.css +2095 -588
- package/sdk/sdk.js +1189 -1133
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +32 -0
- package/src/components/Alert.tsx +3 -1
- package/src/components/AnchorNav.tsx +15 -4
- package/src/components/{AssociatedCheckboxes.tsx → AssociatedSelection.tsx} +41 -37
- package/src/components/Badge.tsx +96 -28
- package/src/components/Button.tsx +23 -7
- package/src/components/{ChainedCheckboxes.tsx → ChainedSelection.tsx} +57 -40
- package/src/components/Collapse.tsx +14 -9
- package/src/components/DatePicker.tsx +1 -1
- package/src/components/DateRangePicker.tsx +23 -11
- package/src/components/{ListCheckboxes.tsx → GroupedSelection.tsx} +26 -21
- package/src/components/InputBox.tsx +1 -1
- package/src/components/Link.tsx +85 -0
- package/src/components/ModalManager.ts +1 -1
- package/src/components/MonthRangePicker.tsx +10 -2
- package/src/components/PickerColumn.tsx +429 -0
- package/src/components/PickerContainer.tsx +128 -0
- package/src/components/Radios.tsx +3 -8
- package/src/components/RichText.tsx +244 -3
- package/src/components/SearchBox.tsx +4 -5
- package/src/components/Select.tsx +60 -5
- package/src/components/{Checkboxes.tsx → Selection.tsx} +75 -21
- package/src/components/SparkLine.tsx +4 -1
- package/src/components/{TableCheckboxes.tsx → TableSelection.tsx} +46 -25
- package/src/components/TabsTransfer.tsx +13 -7
- package/src/components/TabsTransferPicker.tsx +85 -0
- package/src/components/Toast.tsx +5 -5
- package/src/components/Transfer.tsx +71 -50
- package/src/components/TransferDropDown.tsx +117 -0
- package/src/components/TransferPicker.tsx +84 -0
- package/src/components/Tree.tsx +6 -8
- package/src/components/{TreeCheckboxes.tsx → TreeSelection.tsx} +33 -26
- package/src/components/WithRemoteConfig.tsx +7 -2
- package/src/components/calendar/DaysView.tsx +2 -2
- package/src/components/condition-builder/Field.tsx +5 -5
- package/src/components/condition-builder/Func.tsx +3 -3
- package/src/components/condition-builder/InputSwitch.tsx +3 -3
- package/src/components/condition-builder/Item.tsx +5 -12
- package/src/components/icons.tsx +15 -0
- package/src/components/index.tsx +13 -13
- package/src/envOverwrite.ts +0 -1
- package/src/factory.tsx +18 -3
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-set-state.ts +19 -0
- package/src/hooks/use-touch.ts +100 -0
- package/src/hooks/use-update-effect.ts +16 -0
- package/src/icons/clock.svg +1 -0
- package/src/icons/loading-outline.svg +4 -0
- package/src/icons/status-close.svg +10 -0
- package/src/icons/status-fail.svg +10 -0
- package/src/icons/status-info.svg +8 -0
- package/src/icons/status-success.svg +10 -0
- package/src/icons/status-warning.svg +8 -0
- package/src/index.tsx +3 -0
- package/src/locale/de-DE.ts +4 -0
- package/src/locale/en-US.ts +4 -0
- package/src/locale/zh-CN.ts +7 -3
- package/src/renderers/Action.tsx +99 -15
- package/src/renderers/AnchorNav.tsx +4 -0
- package/src/renderers/Avatar.tsx +8 -4
- package/src/renderers/Breadcrumb.tsx +5 -1
- package/src/renderers/CRUD.tsx +63 -28
- package/src/renderers/Card.tsx +63 -34
- package/src/renderers/Chart.tsx +6 -2
- package/src/renderers/Collapse.tsx +4 -2
- package/src/renderers/Dialog.tsx +0 -4
- package/src/renderers/Drawer.tsx +0 -4
- package/src/renderers/DropDownButton.tsx +26 -12
- package/src/renderers/Form/Checkbox.tsx +8 -0
- package/src/renderers/Form/Combo.tsx +2 -3
- package/src/renderers/Form/InputCity.tsx +4 -8
- package/src/renderers/Form/InputFile.tsx +30 -20
- package/src/renderers/Form/InputImage.tsx +16 -5
- package/src/renderers/Form/Item.tsx +1 -1
- package/src/renderers/Form/Options.tsx +32 -7
- package/src/renderers/Form/Picker.tsx +3 -2
- package/src/renderers/Form/Select.tsx +158 -21
- package/src/renderers/Form/TabsTransferPicker.tsx +123 -0
- package/src/renderers/Form/Transfer.tsx +19 -4
- package/src/renderers/Form/TransferPicker.tsx +139 -0
- package/src/renderers/Form/TreeSelect.tsx +25 -0
- package/src/renderers/Form/index.tsx +16 -2
- package/src/renderers/Form/wrapControl.tsx +28 -3
- package/src/renderers/IFrame.tsx +4 -5
- package/src/renderers/Image.tsx +10 -0
- package/src/renderers/Json.tsx +9 -9
- package/src/renderers/Link.tsx +53 -14
- package/src/renderers/List.tsx +1 -1
- package/src/renderers/Log.tsx +16 -3
- package/src/renderers/Mapping.tsx +27 -11
- package/src/renderers/Nav.tsx +392 -60
- package/src/renderers/Page.tsx +1 -1
- package/src/renderers/Portlet.tsx +423 -0
- package/src/renderers/Property.tsx +3 -2
- package/src/renderers/SearchBox.tsx +23 -4
- package/src/renderers/SparkLine.tsx +5 -0
- package/src/renderers/Table/ColumnToggler.tsx +544 -0
- package/src/renderers/Table/ItemActionsWrapper.tsx +44 -0
- package/src/renderers/Table/TableCell.tsx +16 -1
- package/src/renderers/Table/TableContent.tsx +40 -2
- package/src/renderers/Table/index.tsx +257 -80
- package/src/renderers/Tabs.tsx +9 -1
- package/src/renderers/WebComponent.tsx +2 -2
- package/src/store/crud.ts +3 -8
- package/src/store/form.ts +5 -10
- package/src/store/service.ts +5 -4
- package/src/store/table.ts +94 -6
- package/src/types.ts +57 -0
- package/src/utils/api.ts +52 -23
- package/src/utils/dom.tsx +12 -0
- package/src/utils/handleAction.ts +41 -0
- package/src/utils/helper.ts +12 -3
- package/src/utils/icon.tsx +4 -0
- package/src/utils/tpl-builtin.ts +48 -17
- package/dump.rdb +0 -0
- package/lib/components/AssociatedCheckboxes.d.ts +0 -762
- package/lib/components/AssociatedCheckboxes.js +0 -90
- package/lib/components/AssociatedCheckboxes.js.map +0 -13
- package/lib/components/ChainedCheckboxes.js.map +0 -13
- package/lib/components/Checkboxes.js +0 -101
- package/lib/components/Checkboxes.js.map +0 -13
- package/lib/components/ListCheckboxes.d.ts +0 -739
- package/lib/components/ListCheckboxes.js +0 -48
- package/lib/components/ListCheckboxes.js.map +0 -13
- package/lib/components/ListRadios.d.ts +0 -763
- package/lib/components/ListRadios.js +0 -86
- package/lib/components/ListRadios.js.map +0 -13
- package/lib/components/TableCheckboxes.js.map +0 -13
- package/lib/components/TreeCheckboxes.js.map +0 -13
- package/lib/components/TreeRadios.d.ts +0 -838
- package/lib/components/TreeRadios.js +0 -116
- package/lib/components/TreeRadios.js.map +0 -13
- package/src/components/ListRadios.tsx +0 -159
- package/src/components/TreeRadios.tsx +0 -202
@@ -36,7 +36,12 @@ import 'froala-editor/js/plugins/word_paste.min';
|
|
36
36
|
import 'froala-editor/js/languages/zh_cn.js';
|
37
37
|
import 'froala-editor/css/froala_style.min.css';
|
38
38
|
import 'froala-editor/css/froala_editor.pkgd.min.css';
|
39
|
-
export
|
39
|
+
export interface FroalaEditorComponentProps {
|
40
|
+
config: any;
|
41
|
+
model: string;
|
42
|
+
onModelChange: (value: string) => void;
|
43
|
+
}
|
44
|
+
export default class extends React.Component<any, any> {
|
40
45
|
constructor(props: any);
|
41
46
|
render(): JSX.Element;
|
42
47
|
}
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
var tslib_1 = require("tslib");
|
9
9
|
var react_1 = (0, tslib_1.__importDefault)(require("react"));
|
10
10
|
// @ts-ignore
|
11
|
-
var
|
11
|
+
var froala_editor_1 = (0, tslib_1.__importDefault)(require("froala-editor"));
|
12
12
|
// @ts-ignore
|
13
13
|
var froala_editor_min_js_1 = (0, tslib_1.__importDefault)(require("froala-editor/js/froala_editor.min.js"));
|
14
14
|
require("froala-editor/js/plugins/align.min");
|
@@ -44,9 +44,208 @@ require("froala-editor/js/languages/zh_cn.js");
|
|
44
44
|
// Require Editor CSS files.
|
45
45
|
require("froala-editor/css/froala_style.min.css");
|
46
46
|
require("froala-editor/css/froala_editor.pkgd.min.css");
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
// 代码来源于:https://github.com/froala/react-froala-wysiwyg/blob/master/lib/FroalaEditorFunctionality.jsx
|
48
|
+
// 改动原因是model 同步有些问题,有时候不更新,所以基于官方代码改造一下。
|
49
|
+
// 目前发现的问题是,如果 model 数据修改,如果此时 editor 还没有初始化完成则不会同步成功
|
50
|
+
var FroalaEditorComponent = /** @class */ (function (_super) {
|
51
|
+
(0, tslib_1.__extends)(FroalaEditorComponent, _super);
|
52
|
+
function FroalaEditorComponent(props) {
|
53
|
+
var _this = _super.call(this, props) || this;
|
54
|
+
_this.listeningEvents = [];
|
55
|
+
_this.element = null;
|
56
|
+
_this.editor = null;
|
57
|
+
_this.config = {
|
58
|
+
immediateReactModelUpdate: false,
|
59
|
+
reactIgnoreAttrs: null
|
60
|
+
};
|
61
|
+
_this.editorInitialized = false;
|
62
|
+
_this.INNER_HTML_ATTR = 'innerHTML';
|
63
|
+
_this.oldModel = null;
|
64
|
+
return _this;
|
65
|
+
}
|
66
|
+
// After first time render.
|
67
|
+
FroalaEditorComponent.prototype.componentDidMount = function () {
|
68
|
+
this.createEditor();
|
69
|
+
};
|
70
|
+
FroalaEditorComponent.prototype.componentWillUnmount = function () {
|
71
|
+
this.destroyEditor();
|
72
|
+
};
|
73
|
+
FroalaEditorComponent.prototype.componentDidUpdate = function () {
|
74
|
+
if (JSON.stringify(this.oldModel) == JSON.stringify(this.props.model)) {
|
75
|
+
return;
|
76
|
+
}
|
77
|
+
this.setContent();
|
78
|
+
};
|
79
|
+
// Return cloned object
|
80
|
+
FroalaEditorComponent.prototype.clone = function (item) {
|
81
|
+
var me = this;
|
82
|
+
if (!item) {
|
83
|
+
return item;
|
84
|
+
} // null, undefined values check
|
85
|
+
var types = [Number, String, Boolean], result;
|
86
|
+
// normalizing primitives if someone did new String('aaa'), or new Number('444');
|
87
|
+
types.forEach(function (type) {
|
88
|
+
if (item instanceof type) {
|
89
|
+
result = type(item);
|
90
|
+
}
|
91
|
+
});
|
92
|
+
if (typeof result == 'undefined') {
|
93
|
+
if (Object.prototype.toString.call(item) === '[object Array]') {
|
94
|
+
result = [];
|
95
|
+
item.forEach(function (child, index, array) {
|
96
|
+
result[index] = me.clone(child);
|
97
|
+
});
|
98
|
+
}
|
99
|
+
else if (typeof item == 'object') {
|
100
|
+
// testing that this is DOM
|
101
|
+
if (item.nodeType && typeof item.cloneNode == 'function') {
|
102
|
+
result = item.cloneNode(true);
|
103
|
+
}
|
104
|
+
else if (!item.prototype) {
|
105
|
+
// check that this is a literal
|
106
|
+
if (item instanceof Date) {
|
107
|
+
result = new Date(item);
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
// it is an object literal
|
111
|
+
result = {};
|
112
|
+
for (var i in item) {
|
113
|
+
result[i] = me.clone(item[i]);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
else {
|
118
|
+
if (false && item.constructor) {
|
119
|
+
result = new item.constructor();
|
120
|
+
}
|
121
|
+
else {
|
122
|
+
result = item;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
else {
|
127
|
+
result = item;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
return result;
|
131
|
+
};
|
132
|
+
FroalaEditorComponent.prototype.createEditor = function () {
|
133
|
+
var _this = this;
|
134
|
+
if (this.editorInitialized) {
|
135
|
+
return;
|
136
|
+
}
|
137
|
+
this.config = this.clone(this.props.config || this.config);
|
138
|
+
this.config = (0, tslib_1.__assign)({}, this.config);
|
139
|
+
this.element = this.el;
|
140
|
+
if (this.props.model) {
|
141
|
+
this.element.innerHTML = this.props.model;
|
142
|
+
}
|
143
|
+
this.setContent();
|
144
|
+
// Default initialized.
|
145
|
+
this.registerEvent('initialized', this.config.events && this.config.events.initialized);
|
146
|
+
// Check if events are set.
|
147
|
+
if (!this.config.events)
|
148
|
+
this.config.events = {};
|
149
|
+
this.config.events.initialized = function () {
|
150
|
+
_this.editorInitialized = true;
|
151
|
+
_this.initListeners();
|
152
|
+
};
|
153
|
+
this.editor = new froala_editor_1.default(this.element, this.config);
|
154
|
+
};
|
155
|
+
FroalaEditorComponent.prototype.setContent = function () {
|
156
|
+
var _this = this;
|
157
|
+
if (this.props.model || this.props.model == '') {
|
158
|
+
this.oldModel = this.props.model;
|
159
|
+
if (this.editorInitialized) {
|
160
|
+
this.setNormalTagContent();
|
161
|
+
}
|
162
|
+
else {
|
163
|
+
if (!this._initEvents)
|
164
|
+
this._initEvents = [];
|
165
|
+
this._initEvents.push(function () { return _this.setNormalTagContent(); });
|
166
|
+
}
|
167
|
+
}
|
168
|
+
};
|
169
|
+
FroalaEditorComponent.prototype.setNormalTagContent = function () {
|
170
|
+
var self = this;
|
171
|
+
self.editor.html && self.editor.html.set(self.props.model || '');
|
172
|
+
if (self.editorInitialized && self.editor.undo) {
|
173
|
+
//This will reset the undo stack everytime the model changes externally. Can we fix this?
|
174
|
+
self.editor.undo.reset();
|
175
|
+
self.editor.undo.saveStep();
|
176
|
+
}
|
177
|
+
};
|
178
|
+
FroalaEditorComponent.prototype.destroyEditor = function () {
|
179
|
+
if (this.element) {
|
180
|
+
this.editor.destroy && this.editor.destroy();
|
181
|
+
this.listeningEvents.length = 0;
|
182
|
+
this.element = null;
|
183
|
+
this.editorInitialized = false;
|
184
|
+
this._initEvents = [];
|
185
|
+
}
|
186
|
+
};
|
187
|
+
FroalaEditorComponent.prototype.getEditor = function () {
|
188
|
+
if (this.element) {
|
189
|
+
return this.editor;
|
190
|
+
}
|
191
|
+
return null;
|
192
|
+
};
|
193
|
+
FroalaEditorComponent.prototype.updateModel = function () {
|
194
|
+
if (!this.props.onModelChange) {
|
195
|
+
return;
|
196
|
+
}
|
197
|
+
var modelContent = '';
|
198
|
+
var returnedHtml = this.editor.html.get();
|
199
|
+
if (typeof returnedHtml === 'string') {
|
200
|
+
modelContent = returnedHtml;
|
201
|
+
}
|
202
|
+
this.oldModel = modelContent;
|
203
|
+
this.props.onModelChange(modelContent);
|
204
|
+
};
|
205
|
+
FroalaEditorComponent.prototype.initListeners = function () {
|
206
|
+
var self = this;
|
207
|
+
// bind contentChange and keyup event to froalaModel
|
208
|
+
this.editor.events.on('contentChanged', function () {
|
209
|
+
self.updateModel();
|
210
|
+
});
|
211
|
+
if (this.config.immediateReactModelUpdate) {
|
212
|
+
this.editor.events.on('keyup', function () {
|
213
|
+
self.updateModel();
|
214
|
+
});
|
215
|
+
}
|
216
|
+
// Call init events.
|
217
|
+
if (this._initEvents) {
|
218
|
+
for (var i = 0; i < this._initEvents.length; i++) {
|
219
|
+
this._initEvents[i].call(this.editor);
|
220
|
+
}
|
221
|
+
}
|
222
|
+
};
|
223
|
+
// register event on jquery editor element
|
224
|
+
FroalaEditorComponent.prototype.registerEvent = function (eventName, callback) {
|
225
|
+
if (!eventName || !callback) {
|
226
|
+
return;
|
227
|
+
}
|
228
|
+
if (eventName == 'initialized') {
|
229
|
+
if (!this._initEvents)
|
230
|
+
this._initEvents = [];
|
231
|
+
this._initEvents.push(callback);
|
232
|
+
}
|
233
|
+
else {
|
234
|
+
if (!this.config.events) {
|
235
|
+
this.config.events = {};
|
236
|
+
}
|
237
|
+
this.config.events[eventName] = callback;
|
238
|
+
}
|
239
|
+
};
|
240
|
+
FroalaEditorComponent.prototype.render = function () {
|
241
|
+
var _this = this;
|
242
|
+
return (react_1.default.createElement("textarea", { ref: function (el) { return (_this.el = el); } }, this.props.children));
|
243
|
+
};
|
244
|
+
return FroalaEditorComponent;
|
245
|
+
}(react_1.default.Component));
|
246
|
+
var default_1 = /** @class */ (function (_super) {
|
247
|
+
(0, tslib_1.__extends)(default_1, _super);
|
248
|
+
function default_1(props) {
|
50
249
|
var _this = _super.call(this, props) || this;
|
51
250
|
froala_editor_min_js_1.default.VIDEO_PROVIDERS = [
|
52
251
|
{
|
@@ -58,10 +257,10 @@ var FroalaEditor = /** @class */ (function (_super) {
|
|
58
257
|
];
|
59
258
|
return _this;
|
60
259
|
}
|
61
|
-
|
62
|
-
return (react_1.default.createElement(
|
260
|
+
default_1.prototype.render = function () {
|
261
|
+
return (react_1.default.createElement(FroalaEditorComponent, { config: this.props.config, model: this.props.model, onModelChange: this.props.onModelChange }));
|
63
262
|
};
|
64
|
-
return
|
263
|
+
return default_1;
|
65
264
|
}(react_1.default.Component));
|
66
|
-
exports.default =
|
265
|
+
exports.default = default_1;
|
67
266
|
//# sourceMappingURL=./components/RichText.js.map
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/components/RichText.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";AAAA;;;;GAIG;;;AAEH,6DAA0B;AAE1B,aAAa;AACb,
|
9
|
+
"mappings": ";AAAA;;;;GAIG;;;AAEH,6DAA0B;AAE1B,aAAa;AACb,6EAAyC;AACzC,aAAa;AACb,4GAA2D;AAC3D,8CAA4C;AAC5C,+CAA6C;AAC7C,qDAAmD;AACnD,kDAAgD;AAChD,kDAAgD;AAChD,iDAA+C;AAC/C,oDAAkD;AAClD,kDAAgD;AAChD,8CAA4C;AAC5C,mDAAiD;AACjD,6CAA2C;AA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,CAAC,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GACvC,CACH,CAAC;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AAtBD,CAA6B,eAAK,CAAC,SAAS,GAsB3C",
|
10
10
|
"sourcesContent": [
|
11
|
-
"/**\n * @file RichText\n * @description\n * @author fex\n */\n\nimport React from 'react';\n\n// @ts-ignore\nimport
|
11
|
+
"/**\n * @file RichText\n * @description\n * @author fex\n */\n\nimport React from 'react';\n\n// @ts-ignore\nimport FroalaEditor from 'froala-editor';\n// @ts-ignore\nimport Froala from 'froala-editor/js/froala_editor.min.js';\nimport 'froala-editor/js/plugins/align.min';\nimport 'froala-editor/js/plugins/colors.min';\nimport 'froala-editor/js/plugins/char_counter.min';\nimport 'froala-editor/js/plugins/code_view.min';\nimport 'froala-editor/js/plugins/draggable.min';\nimport 'froala-editor/js/plugins/entities.min';\nimport 'froala-editor/js/plugins/font_family.min';\nimport 'froala-editor/js/plugins/font_size.min';\nimport 'froala-editor/js/plugins/forms.min';\nimport 'froala-editor/js/plugins/fullscreen.min';\nimport 'froala-editor/js/plugins/help.min';\nimport 'froala-editor/js/plugins/image.min';\nimport 'froala-editor/js/plugins/inline_class.min';\nimport 'froala-editor/js/plugins/inline_style.min';\nimport 'froala-editor/js/plugins/line_breaker.min';\nimport 'froala-editor/js/plugins/line_height.min';\nimport 'froala-editor/js/plugins/link.min';\nimport 'froala-editor/js/plugins/lists.min';\nimport 'froala-editor/js/plugins/paragraph_format.min';\nimport 'froala-editor/js/plugins/paragraph_style.min';\nimport 'froala-editor/js/plugins/print.min';\nimport 'froala-editor/js/plugins/quick_insert.min';\nimport 'froala-editor/js/plugins/quote.min';\nimport 'froala-editor/js/plugins/save.min';\nimport 'froala-editor/js/plugins/special_characters.min';\nimport 'froala-editor/js/plugins/table.min';\nimport 'froala-editor/js/plugins/url.min';\nimport 'froala-editor/js/plugins/video.min';\nimport 'froala-editor/js/plugins/word_paste.min';\nimport 'froala-editor/js/languages/zh_cn.js';\n\n// Require Editor CSS files.\nimport 'froala-editor/css/froala_style.min.css';\nimport 'froala-editor/css/froala_editor.pkgd.min.css';\n\nexport interface FroalaEditorComponentProps {\n config: any;\n model: string;\n onModelChange: (value: string) => void;\n}\n\n// 代码来源于:https://github.com/froala/react-froala-wysiwyg/blob/master/lib/FroalaEditorFunctionality.jsx\n// 改动原因是model 同步有些问题,有时候不更新,所以基于官方代码改造一下。\n// 目前发现的问题是,如果 model 数据修改,如果此时 editor 还没有初始化完成则不会同步成功\nclass FroalaEditorComponent extends React.Component<FroalaEditorComponentProps> {\n listeningEvents: any;\n element: any;\n editor: any;\n config: any;\n editorInitialized: any;\n INNER_HTML_ATTR: any;\n oldModel: any;\n el: any;\n _initEvents: any;\n\n constructor(props: FroalaEditorComponentProps) {\n super(props);\n\n this.listeningEvents = [];\n this.element = null;\n this.editor = null;\n this.config = {\n immediateReactModelUpdate: false,\n reactIgnoreAttrs: null\n };\n\n this.editorInitialized = false;\n this.INNER_HTML_ATTR = 'innerHTML';\n\n this.oldModel = null;\n }\n\n // After first time render.\n componentDidMount() {\n this.createEditor();\n }\n\n componentWillUnmount() {\n this.destroyEditor();\n }\n\n componentDidUpdate() {\n if (JSON.stringify(this.oldModel) == JSON.stringify(this.props.model)) {\n return;\n }\n\n this.setContent();\n }\n\n // Return cloned object\n clone(item: any) {\n const me = this;\n if (!item) {\n return item;\n } // null, undefined values check\n\n let types = [Number, String, Boolean],\n result: any;\n\n // normalizing primitives if someone did new String('aaa'), or new Number('444');\n types.forEach(function (type) {\n if (item instanceof type) {\n result = type(item);\n }\n });\n\n if (typeof result == 'undefined') {\n if (Object.prototype.toString.call(item) === '[object Array]') {\n result = [];\n item.forEach(function (child: any, index: number, array: Array<any>) {\n result[index] = me.clone(child);\n });\n } else if (typeof item == 'object') {\n // testing that this is DOM\n if (item.nodeType && typeof item.cloneNode == 'function') {\n result = item.cloneNode(true);\n } else if (!item.prototype) {\n // check that this is a literal\n if (item instanceof Date) {\n result = new Date(item);\n } else {\n // it is an object literal\n result = {};\n for (var i in item) {\n result[i] = me.clone(item[i]);\n }\n }\n } else {\n if (false && item.constructor) {\n result = new item.constructor();\n } else {\n result = item;\n }\n }\n } else {\n result = item;\n }\n }\n return result;\n }\n\n createEditor() {\n if (this.editorInitialized) {\n return;\n }\n\n this.config = this.clone(this.props.config || this.config);\n this.config = {...this.config};\n\n this.element = this.el;\n\n if (this.props.model) {\n this.element.innerHTML = this.props.model;\n }\n\n this.setContent();\n\n // Default initialized.\n this.registerEvent(\n 'initialized',\n this.config.events && this.config.events.initialized\n );\n\n // Check if events are set.\n if (!this.config.events) this.config.events = {};\n this.config.events.initialized = () => {\n this.editorInitialized = true;\n this.initListeners();\n };\n\n this.editor = new FroalaEditor(this.element, this.config);\n }\n\n setContent() {\n if (this.props.model || this.props.model == '') {\n this.oldModel = this.props.model;\n\n if (this.editorInitialized) {\n this.setNormalTagContent();\n } else {\n if (!this._initEvents) this._initEvents = [];\n this._initEvents.push(() => this.setNormalTagContent());\n }\n }\n }\n\n setNormalTagContent() {\n let self = this;\n\n self.editor.html && self.editor.html.set(self.props.model || '');\n if (self.editorInitialized && self.editor.undo) {\n //This will reset the undo stack everytime the model changes externally. Can we fix this?\n self.editor.undo.reset();\n self.editor.undo.saveStep();\n }\n }\n\n destroyEditor() {\n if (this.element) {\n this.editor.destroy && this.editor.destroy();\n this.listeningEvents.length = 0;\n this.element = null;\n this.editorInitialized = false;\n this._initEvents = [];\n }\n }\n\n getEditor() {\n if (this.element) {\n return this.editor;\n }\n\n return null;\n }\n\n updateModel() {\n if (!this.props.onModelChange) {\n return;\n }\n\n let modelContent = '';\n\n let returnedHtml = this.editor.html.get();\n if (typeof returnedHtml === 'string') {\n modelContent = returnedHtml;\n }\n\n this.oldModel = modelContent;\n this.props.onModelChange(modelContent);\n }\n\n initListeners() {\n let self = this;\n\n // bind contentChange and keyup event to froalaModel\n this.editor.events.on('contentChanged', function () {\n self.updateModel();\n });\n if (this.config.immediateReactModelUpdate) {\n this.editor.events.on('keyup', function () {\n self.updateModel();\n });\n }\n\n // Call init events.\n if (this._initEvents) {\n for (let i = 0; i < this._initEvents.length; i++) {\n this._initEvents[i].call(this.editor);\n }\n }\n }\n\n // register event on jquery editor element\n registerEvent(eventName: string, callback: Function) {\n if (!eventName || !callback) {\n return;\n }\n\n if (eventName == 'initialized') {\n if (!this._initEvents) this._initEvents = [];\n this._initEvents.push(callback);\n } else {\n if (!this.config.events) {\n this.config.events = {};\n }\n\n this.config.events[eventName] = callback;\n }\n }\n\n render() {\n return (\n <textarea ref={el => (this.el = el)}>{this.props.children}</textarea>\n );\n }\n}\n\nexport default class extends React.Component<any, any> {\n constructor(props: any) {\n super(props);\n Froala.VIDEO_PROVIDERS = [\n {\n test_regex: /.*/,\n url_regex: '',\n url_text: '',\n html: '<span class=\"fr-video fr-dvb fr-draggable\" contenteditable=\"false\" draggable=\"true\"><video class=\"fr-draggable\" controls=\"\" data-msg=\"ok\" data-status=\"0\" src=\"{url}\" style=\"width: 600px;\"></video></span>'\n }\n ];\n }\n\n render() {\n return (\n <FroalaEditorComponent\n config={this.props.config}\n model={this.props.model}\n onModelChange={this.props.onModelChange}\n />\n );\n }\n}\n"
|
12
12
|
]
|
13
13
|
}
|