amis 1.4.2-beta.6 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Schema.d.ts +11 -3
- package/lib/Schema.js.map +1 -1
- package/lib/components/Alert2.d.ts +26 -21
- package/lib/components/Alert2.js +11 -4
- package/lib/components/Alert2.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.js +2 -2
- package/lib/components/Badge.js.map +2 -2
- package/lib/components/Button.js +1 -1
- 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/Checkbox.d.ts +20 -20
- package/lib/components/Collapse.d.ts +51 -23
- package/lib/components/Collapse.js +70 -11
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/CollapseGroup.d.ts +88 -0
- package/lib/components/CollapseGroup.js +81 -0
- package/lib/components/CollapseGroup.js.map +13 -0
- package/lib/components/ColorPicker.d.ts +89 -85
- package/lib/components/ColorPicker.js +17 -4
- package/lib/components/ColorPicker.js.map +2 -2
- package/lib/components/DatePicker.d.ts +84 -84
- package/lib/components/DateRangePicker.d.ts +84 -84
- package/lib/components/Drawer.js +2 -2
- package/lib/components/Drawer.js.map +2 -2
- package/lib/components/Editor.d.ts +84 -84
- package/lib/components/GridNav.d.ts +52 -0
- package/lib/components/GridNav.js +123 -0
- package/lib/components/GridNav.js.map +13 -0
- 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.d.ts +22 -21
- package/lib/components/InputBox.js +10 -2
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/Link.d.ts +29 -36
- package/lib/components/Link.js +14 -15
- package/lib/components/Link.js.map +2 -2
- 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/NumberInput.d.ts +20 -20
- package/lib/components/Overlay.js +5 -0
- package/lib/components/Overlay.js.map +2 -2
- 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/PopOver.d.ts +1 -0
- package/lib/components/PopOver.js +12 -1
- package/lib/components/PopOver.js.map +2 -2
- package/lib/components/Progress.d.ts +85 -0
- package/lib/components/Progress.js +81 -0
- package/lib/components/Progress.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/ResultBox.js +10 -2
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/SearchBox.d.ts +84 -84
- package/lib/components/Select.d.ts +245 -237
- package/lib/components/Select.js +25 -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/{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.d.ts +90 -87
- package/lib/components/Toast.js +15 -5
- 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 +488 -0
- package/lib/components/TransferDropDown.js +59 -0
- package/lib/components/TransferDropDown.js.map +13 -0
- package/lib/components/TransferPicker.d.ts +493 -0
- package/lib/components/TransferPicker.js +60 -0
- package/lib/components/TransferPicker.js.map +13 -0
- package/lib/components/Tree.d.ts +115 -84
- package/lib/components/Tree.js +183 -30
- 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/condition-builder/Field.js +4 -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 +10 -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.d.ts +1 -1
- package/lib/envOverwrite.js +24 -9
- package/lib/envOverwrite.js.map +2 -2
- package/lib/factory.d.ts +15 -1
- package/lib/factory.js +35 -6
- 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/alert-danger.js +7 -0
- package/lib/icons/alert-info.js +7 -0
- package/lib/icons/alert-success.js +7 -0
- package/lib/icons/alert-warning.js +7 -0
- package/lib/icons/download.js +7 -0
- package/lib/icons/drag-bar.js +10 -3
- package/lib/index.d.ts +5 -0
- package/lib/index.js +6 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +2 -0
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +3 -0
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +5 -2
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +10 -5
- package/lib/renderers/Action.js +23 -5
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/Alert.d.ts +21 -1
- package/lib/renderers/Alert.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 +5 -0
- package/lib/renderers/CRUD.js +25 -4
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Card.d.ts +5 -0
- package/lib/renderers/Card.js +34 -23
- package/lib/renderers/Card.js.map +2 -2
- package/lib/renderers/Collapse.d.ts +25 -20
- package/lib/renderers/Collapse.js +10 -72
- package/lib/renderers/Collapse.js.map +2 -2
- package/lib/renderers/CollapseGroup.d.ts +42 -0
- package/lib/renderers/CollapseGroup.js +33 -0
- package/lib/renderers/CollapseGroup.js.map +13 -0
- package/lib/renderers/Form/ConditionBuilder.js +2 -2
- package/lib/renderers/Form/ConditionBuilder.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 +86 -85
- package/lib/renderers/Form/InputColor.js +1 -1
- package/lib/renderers/Form/InputColor.js.map +2 -2
- package/lib/renderers/Form/InputFile.d.ts +6 -0
- package/lib/renderers/Form/InputFile.js +28 -8
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputImage.js +11 -4
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/Item.d.ts +1 -1
- package/lib/renderers/Form/Item.js +2 -1
- package/lib/renderers/Form/Item.js.map +2 -2
- package/lib/renderers/Form/Options.js +25 -4
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +42 -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 +52 -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 +13 -1
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/GridNav.d.ts +99 -0
- package/lib/renderers/GridNav.js +82 -0
- package/lib/renderers/GridNav.js.map +13 -0
- package/lib/renderers/IFrame.js +1 -3
- package/lib/renderers/IFrame.js.map +2 -2
- package/lib/renderers/Image.js +7 -5
- 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 +4 -2
- package/lib/renderers/Link.js +15 -8
- 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/Nav.d.ts +21 -21
- package/lib/renderers/Nav.js +37 -19
- package/lib/renderers/Nav.js.map +2 -2
- package/lib/renderers/Page.d.ts +18 -0
- package/lib/renderers/Page.js +53 -9
- 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/Progress.d.ts +23 -3
- package/lib/renderers/Progress.js +15 -19
- package/lib/renderers/Progress.js.map +2 -2
- package/lib/renderers/Property.js +1 -1
- package/lib/renderers/Property.js.map +2 -2
- package/lib/renderers/Table/ColumnToggler.js +1 -1
- package/lib/renderers/Table/ColumnToggler.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 +5 -1
- package/lib/renderers/Table/index.js +65 -30
- 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 -2
- package/lib/store/form.d.ts +1 -1
- package/lib/store/form.js +3 -5
- package/lib/store/form.js.map +2 -2
- package/lib/store/formItem.js +44 -4
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/table.d.ts +3 -2
- package/lib/store/table.js +35 -12
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +934 -222
- package/lib/themes/ang.css +934 -222
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +934 -222
- package/lib/themes/antd.css +934 -222
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +970 -260
- package/lib/themes/cxd.css +970 -260
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +934 -222
- package/lib/themes/dark.css +934 -222
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +970 -260
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +38 -1
- 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 +90 -17
- 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/helper.d.ts +12 -23
- package/lib/utils/helper.js +62 -166
- package/lib/utils/helper.js.map +2 -2
- package/lib/utils/tpl-builtin.d.ts +2 -20
- package/lib/utils/tpl-builtin.js +25 -743
- package/lib/utils/tpl-builtin.js.map +2 -2
- package/lib/utils/tpl.js +24 -0
- package/lib/utils/tpl.js.map +2 -2
- package/package.json +5 -2
- package/schema.json +3966 -1263
- package/scss/_mixins.scss +1 -3
- package/scss/_properties.scss +42 -13
- package/scss/base/_common.scss +3 -0
- package/scss/base/_normalize.scss +2 -0
- package/scss/components/_alert.scss +28 -5
- package/scss/components/_anchor-nav.scss +89 -29
- package/scss/components/_button.scss +12 -0
- package/scss/components/_card.scss +9 -15
- package/scss/components/_collapse-group.scss +15 -0
- package/scss/components/_collapse.scss +48 -23
- package/scss/components/_grid-nav.scss +128 -0
- package/scss/components/_images.scss +1 -0
- package/scss/components/_input-box.scss +1 -0
- package/scss/components/_nav.scss +2 -7
- package/scss/components/_page.scss +35 -2
- package/scss/components/_picker-columns.scss +124 -0
- package/scss/components/_popover.scss +13 -0
- package/scss/components/_portlet.scss +51 -0
- package/scss/components/_progress.scss +141 -33
- package/scss/components/_result-box.scss +1 -0
- package/scss/components/_spinner.scss +5 -4
- package/scss/components/_status.scss +1 -1
- package/scss/components/_table.scss +32 -0
- package/scss/components/_toast.scss +41 -11
- package/scss/components/form/_checks.scss +0 -351
- package/scss/components/form/_color.scss +32 -3
- package/scss/components/form/_combo.scss +4 -0
- package/scss/components/form/_fieldset.scss +6 -1
- package/scss/components/form/_file.scss +11 -0
- package/scss/components/form/_form.scss +48 -0
- package/scss/components/form/_selection.scss +354 -0
- package/scss/components/form/_transfer.scss +76 -18
- package/scss/components/form/_tree.scss +42 -0
- package/scss/themes/_common.scss +6 -0
- package/scss/themes/_cxd-variables.scss +13 -6
- package/scss/themes/cxd.scss +19 -20
- package/sdk/ang-ie11.css +1065 -246
- package/sdk/ang.css +1069 -230
- package/sdk/antd-ie11.css +1068 -249
- package/sdk/antd.css +1069 -230
- package/sdk/charts.js +17 -17
- package/sdk/color-picker.js +65 -69
- package/sdk/cropperjs.js +3 -3
- package/sdk/cxd-ie11.css +1081 -268
- package/sdk/cxd.css +1116 -279
- package/sdk/dark-ie11.css +1069 -250
- package/sdk/dark.css +1069 -230
- 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/locale/de-DE.js +2 -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 +20 -28
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +1081 -268
- package/sdk/sdk.css +1116 -279
- package/sdk/sdk.js +1371 -1189
- package/sdk/thirds/hls.js/hls.js +18 -18
- package/sdk/thirds/mpegts.js/mpegts.js +2 -2
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +19 -1
- package/src/components/Alert2.tsx +32 -4
- package/src/components/AnchorNav.tsx +15 -4
- package/src/components/{AssociatedCheckboxes.tsx → AssociatedSelection.tsx} +43 -37
- package/src/components/Badge.tsx +3 -3
- package/src/components/Button.tsx +1 -0
- package/src/components/{ChainedCheckboxes.tsx → ChainedSelection.tsx} +57 -40
- package/src/components/Collapse.tsx +139 -20
- package/src/components/CollapseGroup.tsx +130 -0
- package/src/components/ColorPicker.tsx +32 -10
- package/src/components/Drawer.tsx +8 -6
- package/src/components/GridNav.tsx +233 -0
- package/src/components/{ListCheckboxes.tsx → GroupedSelection.tsx} +26 -21
- package/src/components/InputBox.tsx +10 -9
- package/src/components/Link.tsx +28 -37
- package/src/components/ModalManager.ts +1 -1
- package/src/components/Overlay.tsx +6 -0
- package/src/components/PickerColumn.tsx +429 -0
- package/src/components/PickerContainer.tsx +128 -0
- package/src/components/PopOver.tsx +15 -1
- package/src/components/Progress.tsx +140 -0
- package/src/components/Radios.tsx +3 -8
- package/src/components/ResultBox.tsx +9 -9
- package/src/components/Select.tsx +57 -5
- package/src/components/{Checkboxes.tsx → Selection.tsx} +75 -21
- 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 +48 -21
- package/src/components/Transfer.tsx +71 -50
- package/src/components/TransferDropDown.tsx +120 -0
- package/src/components/TransferPicker.tsx +91 -0
- package/src/components/Tree.tsx +194 -8
- package/src/components/{TreeCheckboxes.tsx → TreeSelection.tsx} +33 -26
- package/src/components/condition-builder/Field.tsx +7 -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 +10 -0
- package/src/components/index.tsx +13 -13
- package/src/envOverwrite.ts +20 -8
- package/src/factory.tsx +70 -9
- 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/alert-danger.svg +1 -0
- package/src/icons/alert-info.svg +1 -0
- package/src/icons/alert-success.svg +1 -0
- package/src/icons/alert-warning.svg +1 -0
- package/src/icons/download.svg +4 -0
- package/src/icons/drag-bar.svg +12 -6
- package/src/index.tsx +5 -0
- package/src/locale/de-DE.ts +2 -0
- package/src/locale/en-US.ts +3 -0
- package/src/locale/zh-CN.ts +5 -2
- package/src/renderers/Action.tsx +58 -3
- package/src/renderers/Alert.tsx +31 -1
- 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 +29 -3
- package/src/renderers/Card.tsx +76 -36
- package/src/renderers/Collapse.tsx +70 -115
- package/src/renderers/CollapseGroup.tsx +80 -0
- package/src/renderers/Form/ConditionBuilder.tsx +2 -2
- package/src/renderers/Form/InputCity.tsx +4 -8
- package/src/renderers/Form/InputColor.tsx +4 -2
- package/src/renderers/Form/InputFile.tsx +65 -24
- package/src/renderers/Form/InputImage.tsx +11 -3
- package/src/renderers/Form/Item.tsx +3 -2
- package/src/renderers/Form/Options.tsx +29 -3
- package/src/renderers/Form/Select.tsx +162 -21
- package/src/renderers/Form/TabsTransferPicker.tsx +123 -0
- package/src/renderers/Form/Transfer.tsx +19 -4
- package/src/renderers/Form/TransferPicker.tsx +145 -0
- package/src/renderers/Form/TreeSelect.tsx +25 -0
- package/src/renderers/Form/index.tsx +15 -2
- package/src/renderers/Form/wrapControl.tsx +26 -1
- package/src/renderers/GridNav.tsx +204 -0
- package/src/renderers/IFrame.tsx +2 -4
- package/src/renderers/Image.tsx +19 -15
- package/src/renderers/Json.tsx +9 -9
- package/src/renderers/Link.tsx +29 -16
- package/src/renderers/List.tsx +1 -1
- package/src/renderers/Nav.tsx +105 -56
- package/src/renderers/Page.tsx +62 -1
- package/src/renderers/Portlet.tsx +423 -0
- package/src/renderers/Progress.tsx +56 -38
- package/src/renderers/Property.tsx +6 -4
- package/src/renderers/Table/ColumnToggler.tsx +1 -1
- package/src/renderers/Table/TableContent.tsx +40 -2
- package/src/renderers/Table/index.tsx +88 -43
- package/src/renderers/Tabs.tsx +9 -1
- package/src/renderers/WebComponent.tsx +2 -2
- package/src/store/form.ts +3 -9
- package/src/store/formItem.ts +94 -2
- package/src/store/table.ts +55 -14
- package/src/types.ts +58 -1
- package/src/utils/api.ts +120 -26
- package/src/utils/dom.tsx +12 -0
- package/src/utils/helper.ts +55 -185
- package/src/utils/tpl-builtin.ts +40 -866
- package/src/utils/tpl.ts +33 -0
- package/tsconfig-for-declaration.json +1 -1
- package/dump.rdb +0 -0
- package/lib/components/AssociatedCheckboxes.d.ts +0 -762
- package/lib/components/AssociatedCheckboxes.js +0 -90
- package/lib/components/AssociatedCheckboxes.js.map +0 -13
- package/lib/components/ChainedCheckboxes.js.map +0 -13
- package/lib/components/Checkboxes.js +0 -101
- package/lib/components/Checkboxes.js.map +0 -13
- package/lib/components/ListCheckboxes.d.ts +0 -739
- package/lib/components/ListCheckboxes.js +0 -48
- package/lib/components/ListCheckboxes.js.map +0 -13
- package/lib/components/ListRadios.d.ts +0 -763
- package/lib/components/ListRadios.js +0 -86
- package/lib/components/ListRadios.js.map +0 -13
- package/lib/components/TableCheckboxes.js.map +0 -13
- package/lib/components/TreeCheckboxes.js.map +0 -13
- package/lib/components/TreeRadios.d.ts +0 -838
- package/lib/components/TreeRadios.js +0 -116
- package/lib/components/TreeRadios.js.map +0 -13
- package/src/components/ListRadios.tsx +0 -159
- package/src/components/TreeRadios.tsx +0 -202
@@ -5,7 +5,8 @@ var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = (0, tslib_1.__importDefault)(require("react"));
|
6
6
|
var Item_1 = require("./Item");
|
7
7
|
var theme_1 = require("../../theme");
|
8
|
-
var
|
8
|
+
var Spinner_1 = (0, tslib_1.__importDefault)(require("../../components/Spinner"));
|
9
|
+
var Select_1 = (0, tslib_1.__importDefault)(require("../../components/Select"));
|
9
10
|
var helper_1 = require("../../utils/helper");
|
10
11
|
var Options_1 = require("./Options");
|
11
12
|
var locale_1 = require("../../locale");
|
@@ -179,28 +180,28 @@ var CityPicker = /** @class */ (function (_super) {
|
|
179
180
|
var _c = this.props, cx = _c.classnames, className = _c.className, disabled = _c.disabled, allowCity = _c.allowCity, allowDistrict = _c.allowDistrict, allowStreet = _c.allowStreet, searchable = _c.searchable, __ = _c.translate;
|
180
181
|
var _d = this.state, provinceCode = _d.provinceCode, cityCode = _d.cityCode, districtCode = _d.districtCode, street = _d.street, db = _d.db;
|
181
182
|
return db ? (react_1.default.createElement("div", { className: cx('CityPicker', className) },
|
182
|
-
react_1.default.createElement(
|
183
|
+
react_1.default.createElement(Select_1.default, { searchable: searchable, disabled: disabled, options: db.province.map(function (item) { return ({
|
183
184
|
label: db[item],
|
184
185
|
value: item
|
185
186
|
}); }), value: provinceCode, onChange: this.handleProvinceChange }),
|
186
187
|
provinceCode &&
|
187
188
|
allowDistrict &&
|
188
|
-
Array.isArray(db.district[provinceCode]) ? (react_1.default.createElement(
|
189
|
+
Array.isArray(db.district[provinceCode]) ? (react_1.default.createElement(Select_1.default, { searchable: searchable, disabled: disabled, options: db.district[provinceCode].map(function (item) { return ({
|
189
190
|
label: db[item],
|
190
191
|
value: item
|
191
192
|
}); }), value: districtCode, onChange: this.handleDistrictChange })) : allowCity &&
|
192
193
|
db.city[provinceCode] &&
|
193
|
-
db.city[provinceCode].length ? (react_1.default.createElement(
|
194
|
+
db.city[provinceCode].length ? (react_1.default.createElement(Select_1.default, { searchable: searchable, disabled: disabled, options: db.city[provinceCode].map(function (item) { return ({
|
194
195
|
label: db[item],
|
195
196
|
value: item
|
196
197
|
}); }), value: cityCode, onChange: this.handleCityChange })) : null,
|
197
198
|
cityCode &&
|
198
199
|
allowDistrict &&
|
199
|
-
((_b = (_a = db.district[provinceCode]) === null || _a === void 0 ? void 0 : _a[cityCode]) === null || _b === void 0 ? void 0 : _b.length) ? (react_1.default.createElement(
|
200
|
+
((_b = (_a = db.district[provinceCode]) === null || _a === void 0 ? void 0 : _a[cityCode]) === null || _b === void 0 ? void 0 : _b.length) ? (react_1.default.createElement(Select_1.default, { searchable: searchable, disabled: disabled, options: db.district[provinceCode][cityCode].map(function (item) { return ({
|
200
201
|
label: db[item],
|
201
202
|
value: item
|
202
203
|
}); }), value: districtCode, onChange: this.handleDistrictChange })) : null,
|
203
|
-
allowStreet && provinceCode ? (react_1.default.createElement("input", { className: cx('CityPicker-input'), value: street, onChange: this.handleStreetChange, onBlur: this.handleStreetEnd, placeholder: __('City.street'), disabled: disabled })) : null)) : (react_1.default.createElement(
|
204
|
+
allowStreet && provinceCode ? (react_1.default.createElement("input", { className: cx('CityPicker-input'), value: street, onChange: this.handleStreetChange, onBlur: this.handleStreetEnd, placeholder: __('City.street'), disabled: disabled })) : null)) : (react_1.default.createElement(Spinner_1.default, { show: true, size: "sm" }));
|
204
205
|
};
|
205
206
|
var _a, _b, _c, _d, _e;
|
206
207
|
CityPicker.defaultProps = {
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/renderers/Form/InputCity.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AACnE,qCAAgE;AAChE
|
9
|
+
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AACnE,qCAAgE;AAChE,kFAA+C;AAC/C,gFAA6C;AAC7C,6CAA4C;AAC5C,qCAAiC;AACjC,uCAAqD;AAwFrD;IAAgC,2CAG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ormBaseControl} from './Item';\nimport {ClassNamesFn, themeable, ThemeProps} from '../../theme';\nimport {Select, Spinner} from '../../components';\nimport {autobind} from '../../utils/helper';\nimport {Option} from './Options';\nimport {localeable, LocaleProps} from '../../locale';\n\n/**\n * City 城市选择框。\n * 文档:https://baidu.gitee.io/amis/docs/components/form/city\n */\nexport interface InputCityControlSchema extends FormBaseControl {\n /**\n * 指定为城市选择框。\n */\n type: 'input-city';\n\n /**\n * 开启后只会存城市的 code 信息\n */\n extractValue?: boolean;\n\n /**\n * 是否将各个信息拼接成字符串。\n */\n joinValues?: boolean;\n\n /**\n * 拼接的符号是啥?\n */\n delimiter?: string;\n\n /**\n * 允许选择城市?\n */\n allowCity?: boolean;\n\n /**\n * 允许选择地区?\n */\n allowDistrict?: boolean;\n\n /**\n * 允许选择街道?\n */\n allowStreet?: boolean;\n\n /**\n * 是否显示搜索框\n */\n searchable?: boolean;\n}\n\nexport interface CityPickerProps\n extends Omit<InputCityControlSchema, 'type' | 'className'>,\n LocaleProps,\n ThemeProps {\n value: any;\n onChange: (value: any) => void;\n\n extractValue: boolean;\n delimiter: string;\n allowCity: boolean;\n allowDistrict: boolean;\n allowStreet: boolean;\n}\n\nexport interface CityPickerState {\n code: number;\n province: string;\n provinceCode: number;\n city: string;\n cityCode: number;\n district: string;\n districtCode: number;\n street: string;\n\n db?: {\n province: Array<string>;\n city: {\n [propName: number]: Array<number>;\n };\n district: {\n [propName: number]:\n | {\n [propName: number]: Array<number>;\n }\n | Array<number>;\n };\n [propName: string]: any;\n };\n}\n\nexport class CityPicker extends React.Component<\n CityPickerProps,\n CityPickerState\n> {\n static defaultProps = {\n joinValues: true,\n extractValue: true,\n delimiter: ',',\n allowCity: true,\n allowDistrict: true,\n allowStreet: false\n };\n\n state: CityPickerState = {\n code: 0,\n province: '',\n provinceCode: 0,\n city: '',\n cityCode: 0,\n district: '',\n districtCode: 0,\n street: ''\n };\n\n componentDidMount() {\n this.loadDb(() => this.syncIn());\n }\n\n componentDidUpdate(prevProps: CityPickerProps) {\n const props = this.props;\n\n if (props.value !== prevProps.value) {\n this.loadDb(() => this.syncIn(props));\n }\n }\n\n loadDb(callback?: () => void) {\n if (this.state.db) {\n callback?.();\n return;\n }\n\n import('./CityDB').then(db => {\n this.setState(\n {\n db: {\n ...db.default,\n province: db.province as any,\n city: db.city,\n district: db.district\n }\n },\n callback\n );\n });\n\n // require.ensure(['./CityDB'], (db: any) =>\n // this.setState(\n // {\n // db: {\n // ...db.default,\n // province: db.province,\n // city: db.city,\n // district: db.district\n // }\n // },\n // callback\n // )\n // );\n }\n\n @autobind\n handleProvinceChange(option: Option) {\n this.setState(\n {\n province: option.label as string,\n provinceCode: option.value as number,\n city: '',\n cityCode: 0,\n district: '',\n districtCode: 0,\n street: '',\n code: option.value\n },\n this.syncOut\n );\n }\n\n @autobind\n handleCityChange(option: Option) {\n if (option.value % 100) {\n return this.handleDistrictChange(option, {\n cityCode: option.value as number\n });\n }\n\n this.setState(\n {\n city: option.label as string,\n cityCode: option.value as number,\n district: '',\n districtCode: 0,\n street: '',\n code: option.value\n },\n this.syncOut\n );\n }\n\n @autobind\n handleDistrictChange(\n option: Option,\n otherStates: Partial<CityPickerState> = {}\n ) {\n this.setState(\n {\n ...(otherStates as any),\n district: option.label as string,\n districtCode: option.value as number,\n street: '',\n code: option.value as number\n },\n this.syncOut\n );\n }\n\n @autobind\n handleStreetChange(e: React.ChangeEvent<HTMLInputElement>) {\n this.setState({\n street: e.currentTarget.value\n });\n }\n\n @autobind\n handleStreetEnd() {\n this.syncOut();\n }\n\n @autobind\n syncIn(props = this.props) {\n const db = this.state.db!;\n const {value, delimiter} = props;\n\n if (!db) {\n return;\n }\n\n const state = {\n code: 0,\n province: '',\n provinceCode: 0,\n city: '',\n cityCode: 0,\n district: '',\n districtCode: 0,\n street: ''\n };\n\n let code =\n (value && value.code) ||\n (typeof value === 'number' && value) ||\n (typeof value === 'string' && /(\\d{6})/.test(value) && RegExp.$1);\n\n if (code && db[code]) {\n code = parseInt(code, 10);\n state.code = code;\n\n const provinceCode = code - (code % 10000);\n if (db[provinceCode]) {\n state.provinceCode = provinceCode;\n state.province = db[provinceCode];\n }\n\n const cityCode = code - (code % 100);\n if (db[cityCode]) {\n state.cityCode = cityCode;\n state.city = db[cityCode];\n } else if (~db.city[provinceCode]?.indexOf(code)) {\n state.cityCode = code;\n state.city = db[code];\n }\n\n if (code % 100) {\n state.district = db[code];\n state.districtCode = code;\n }\n } else if (value) {\n // todo 模糊查找\n }\n\n if (value && value.street) {\n state.street = value.street;\n } else if (typeof value === 'string' && ~value.indexOf(delimiter)) {\n state.street = value.slice(value.indexOf(delimiter) + delimiter.length);\n }\n\n this.setState(state);\n }\n\n @autobind\n syncOut() {\n const {\n onChange,\n allowStreet,\n joinValues,\n extractValue,\n delimiter\n } = this.props;\n\n const {code, province, city, district, street} = this.state;\n\n if (typeof extractValue === 'undefined' ? joinValues : extractValue) {\n code\n ? onChange(\n allowStreet && street\n ? [code, street].join(delimiter)\n : String(code)\n )\n : onChange('');\n } else {\n onChange({\n code,\n province,\n city,\n district,\n street\n });\n }\n }\n\n render() {\n const {\n classnames: cx,\n className,\n disabled,\n allowCity,\n allowDistrict,\n allowStreet,\n searchable,\n translate: __\n } = this.props;\n\n const {provinceCode, cityCode, districtCode, street, db} = this.state;\n\n return db ? (\n <div className={cx('CityPicker', className)}>\n <Select\n searchable={searchable}\n disabled={disabled}\n options={db.province.map(item => ({\n label: db[item],\n value: item\n }))}\n value={provinceCode}\n onChange={this.handleProvinceChange}\n />\n\n {provinceCode &&\n allowDistrict &&\n Array.isArray(db.district[provinceCode]) ? (\n <Select\n searchable={searchable}\n disabled={disabled}\n options={(db.district[provinceCode] as Array<number>).map(item => ({\n label: db[item],\n value: item\n }))}\n value={districtCode}\n onChange={this.handleDistrictChange}\n />\n ) : allowCity &&\n db.city[provinceCode] &&\n db.city[provinceCode].length ? (\n <Select\n searchable={searchable}\n disabled={disabled}\n options={db.city[provinceCode].map(item => ({\n label: db[item],\n value: item\n }))}\n value={cityCode}\n onChange={this.handleCityChange}\n />\n ) : null}\n\n {cityCode &&\n allowDistrict &&\n (db.district[provinceCode]?.[cityCode] as any)?.length ? (\n <Select\n searchable={searchable}\n disabled={disabled}\n options={(db.district[provinceCode][cityCode] as Array<number>).map(\n item => ({\n label: db[item],\n value: item\n })\n )}\n value={districtCode}\n onChange={this.handleDistrictChange}\n />\n ) : null}\n\n {allowStreet && provinceCode ? (\n <input\n className={cx('CityPicker-input')}\n value={street}\n onChange={this.handleStreetChange}\n onBlur={this.handleStreetEnd}\n placeholder={__('City.street')}\n disabled={disabled}\n />\n ) : null}\n </div>\n ) : (\n <Spinner show size=\"sm\" />\n );\n }\n}\n\nconst ThemedCity = themeable(localeable(CityPicker));\nexport default ThemedCity;\n\nexport interface LocationControlProps extends FormControlProps {\n allowCity?: boolean;\n allowDistrict?: boolean;\n extractValue?: boolean;\n joinValues?: boolean;\n allowStreet?: boolean;\n}\nexport class LocationControl extends React.Component<LocationControlProps> {\n render() {\n const {\n value,\n onChange,\n allowCity,\n allowDistrict,\n extractValue,\n joinValues,\n allowStreet,\n disabled,\n searchable\n } = this.props;\n return (\n <ThemedCity\n searchable={searchable}\n value={value}\n onChange={onChange}\n allowCity={allowCity}\n allowDistrict={allowDistrict}\n extractValue={extractValue}\n joinValues={joinValues}\n allowStreet={allowStreet}\n disabled={disabled}\n />\n );\n }\n}\n\n@FormItem({\n type: 'input-city',\n sizeMutable: false\n})\nexport class CheckboxControlRenderer extends LocationControl {}\n"
|
11
|
+
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport {ClassNamesFn, themeable, ThemeProps} from '../../theme';\nimport Spinner from '../../components/Spinner';\nimport Select from '../../components/Select';\nimport {autobind} from '../../utils/helper';\nimport {Option} from './Options';\nimport {localeable, LocaleProps} from '../../locale';\n\n/**\n * City 城市选择框。\n * 文档:https://baidu.gitee.io/amis/docs/components/form/city\n */\nexport interface InputCityControlSchema extends FormBaseControl {\n /**\n * 指定为城市选择框。\n */\n type: 'input-city';\n\n /**\n * 开启后只会存城市的 code 信息\n */\n extractValue?: boolean;\n\n /**\n * 是否将各个信息拼接成字符串。\n */\n joinValues?: boolean;\n\n /**\n * 拼接的符号是啥?\n */\n delimiter?: string;\n\n /**\n * 允许选择城市?\n */\n allowCity?: boolean;\n\n /**\n * 允许选择地区?\n */\n allowDistrict?: boolean;\n\n /**\n * 允许选择街道?\n */\n allowStreet?: boolean;\n\n /**\n * 是否显示搜索框\n */\n searchable?: boolean;\n}\n\nexport interface CityPickerProps\n extends Omit<InputCityControlSchema, 'type' | 'className'>,\n LocaleProps,\n ThemeProps {\n value: any;\n onChange: (value: any) => void;\n\n extractValue: boolean;\n delimiter: string;\n allowCity: boolean;\n allowDistrict: boolean;\n allowStreet: boolean;\n}\n\nexport interface CityPickerState {\n code: number;\n province: string;\n provinceCode: number;\n city: string;\n cityCode: number;\n district: string;\n districtCode: number;\n street: string;\n\n db?: {\n province: Array<string>;\n city: {\n [propName: number]: Array<number>;\n };\n district: {\n [propName: number]:\n | {\n [propName: number]: Array<number>;\n }\n | Array<number>;\n };\n [propName: string]: any;\n };\n}\n\nexport class CityPicker extends React.Component<\n CityPickerProps,\n CityPickerState\n> {\n static defaultProps = {\n joinValues: true,\n extractValue: true,\n delimiter: ',',\n allowCity: true,\n allowDistrict: true,\n allowStreet: false\n };\n\n state: CityPickerState = {\n code: 0,\n province: '',\n provinceCode: 0,\n city: '',\n cityCode: 0,\n district: '',\n districtCode: 0,\n street: ''\n };\n\n componentDidMount() {\n this.loadDb(() => this.syncIn());\n }\n\n componentDidUpdate(prevProps: CityPickerProps) {\n const props = this.props;\n\n if (props.value !== prevProps.value) {\n this.loadDb(() => this.syncIn(props));\n }\n }\n\n loadDb(callback?: () => void) {\n if (this.state.db) {\n callback?.();\n return;\n }\n\n import('./CityDB').then(db => {\n this.setState(\n {\n db: {\n ...db.default,\n province: db.province as any,\n city: db.city,\n district: db.district\n }\n },\n callback\n );\n });\n\n // require.ensure(['./CityDB'], (db: any) =>\n // this.setState(\n // {\n // db: {\n // ...db.default,\n // province: db.province,\n // city: db.city,\n // district: db.district\n // }\n // },\n // callback\n // )\n // );\n }\n\n @autobind\n handleProvinceChange(option: Option) {\n this.setState(\n {\n province: option.label as string,\n provinceCode: option.value as number,\n city: '',\n cityCode: 0,\n district: '',\n districtCode: 0,\n street: '',\n code: option.value\n },\n this.syncOut\n );\n }\n\n @autobind\n handleCityChange(option: Option) {\n if (option.value % 100) {\n return this.handleDistrictChange(option, {\n cityCode: option.value as number\n });\n }\n\n this.setState(\n {\n city: option.label as string,\n cityCode: option.value as number,\n district: '',\n districtCode: 0,\n street: '',\n code: option.value\n },\n this.syncOut\n );\n }\n\n @autobind\n handleDistrictChange(\n option: Option,\n otherStates: Partial<CityPickerState> = {}\n ) {\n this.setState(\n {\n ...(otherStates as any),\n district: option.label as string,\n districtCode: option.value as number,\n street: '',\n code: option.value as number\n },\n this.syncOut\n );\n }\n\n @autobind\n handleStreetChange(e: React.ChangeEvent<HTMLInputElement>) {\n this.setState({\n street: e.currentTarget.value\n });\n }\n\n @autobind\n handleStreetEnd() {\n this.syncOut();\n }\n\n @autobind\n syncIn(props = this.props) {\n const db = this.state.db!;\n const {value, delimiter} = props;\n\n if (!db) {\n return;\n }\n\n const state = {\n code: 0,\n province: '',\n provinceCode: 0,\n city: '',\n cityCode: 0,\n district: '',\n districtCode: 0,\n street: ''\n };\n\n let code =\n (value && value.code) ||\n (typeof value === 'number' && value) ||\n (typeof value === 'string' && /(\\d{6})/.test(value) && RegExp.$1);\n\n if (code && db[code]) {\n code = parseInt(code, 10);\n state.code = code;\n\n const provinceCode = code - (code % 10000);\n if (db[provinceCode]) {\n state.provinceCode = provinceCode;\n state.province = db[provinceCode];\n }\n\n const cityCode = code - (code % 100);\n if (db[cityCode]) {\n state.cityCode = cityCode;\n state.city = db[cityCode];\n } else if (~db.city[provinceCode]?.indexOf(code)) {\n state.cityCode = code;\n state.city = db[code];\n }\n\n if (code % 100) {\n state.district = db[code];\n state.districtCode = code;\n }\n } else if (value) {\n // todo 模糊查找\n }\n\n if (value && value.street) {\n state.street = value.street;\n } else if (typeof value === 'string' && ~value.indexOf(delimiter)) {\n state.street = value.slice(value.indexOf(delimiter) + delimiter.length);\n }\n\n this.setState(state);\n }\n\n @autobind\n syncOut() {\n const {onChange, allowStreet, joinValues, extractValue, delimiter} =\n this.props;\n\n const {code, province, city, district, street} = this.state;\n\n if (typeof extractValue === 'undefined' ? joinValues : extractValue) {\n code\n ? onChange(\n allowStreet && street\n ? [code, street].join(delimiter)\n : String(code)\n )\n : onChange('');\n } else {\n onChange({\n code,\n province,\n city,\n district,\n street\n });\n }\n }\n\n render() {\n const {\n classnames: cx,\n className,\n disabled,\n allowCity,\n allowDistrict,\n allowStreet,\n searchable,\n translate: __\n } = this.props;\n\n const {provinceCode, cityCode, districtCode, street, db} = this.state;\n\n return db ? (\n <div className={cx('CityPicker', className)}>\n <Select\n searchable={searchable}\n disabled={disabled}\n options={db.province.map(item => ({\n label: db[item],\n value: item\n }))}\n value={provinceCode}\n onChange={this.handleProvinceChange}\n />\n\n {provinceCode &&\n allowDistrict &&\n Array.isArray(db.district[provinceCode]) ? (\n <Select\n searchable={searchable}\n disabled={disabled}\n options={(db.district[provinceCode] as Array<number>).map(item => ({\n label: db[item],\n value: item\n }))}\n value={districtCode}\n onChange={this.handleDistrictChange}\n />\n ) : allowCity &&\n db.city[provinceCode] &&\n db.city[provinceCode].length ? (\n <Select\n searchable={searchable}\n disabled={disabled}\n options={db.city[provinceCode].map(item => ({\n label: db[item],\n value: item\n }))}\n value={cityCode}\n onChange={this.handleCityChange}\n />\n ) : null}\n\n {cityCode &&\n allowDistrict &&\n (db.district[provinceCode]?.[cityCode] as any)?.length ? (\n <Select\n searchable={searchable}\n disabled={disabled}\n options={(db.district[provinceCode][cityCode] as Array<number>).map(\n item => ({\n label: db[item],\n value: item\n })\n )}\n value={districtCode}\n onChange={this.handleDistrictChange}\n />\n ) : null}\n\n {allowStreet && provinceCode ? (\n <input\n className={cx('CityPicker-input')}\n value={street}\n onChange={this.handleStreetChange}\n onBlur={this.handleStreetEnd}\n placeholder={__('City.street')}\n disabled={disabled}\n />\n ) : null}\n </div>\n ) : (\n <Spinner show size=\"sm\" />\n );\n }\n}\n\nconst ThemedCity = themeable(localeable(CityPicker));\nexport default ThemedCity;\n\nexport interface LocationControlProps extends FormControlProps {\n allowCity?: boolean;\n allowDistrict?: boolean;\n extractValue?: boolean;\n joinValues?: boolean;\n allowStreet?: boolean;\n}\nexport class LocationControl extends React.Component<LocationControlProps> {\n render() {\n const {\n value,\n onChange,\n allowCity,\n allowDistrict,\n extractValue,\n joinValues,\n allowStreet,\n disabled,\n searchable\n } = this.props;\n return (\n <ThemedCity\n searchable={searchable}\n value={value}\n onChange={onChange}\n allowCity={allowCity}\n allowDistrict={allowDistrict}\n extractValue={extractValue}\n joinValues={joinValues}\n allowStreet={allowStreet}\n disabled={disabled}\n />\n );\n }\n}\n\n@FormItem({\n type: 'input-city',\n sizeMutable: false\n})\nexport class CheckboxControlRenderer extends LocationControl {}\n"
|
12
12
|
]
|
13
13
|
}
|