amis-editor 6.4.1 → 6.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm/builder/ApiDSBuilder.js +3 -3
- package/esm/builder/DSBuilder.js +3 -3
- package/esm/builder/DSBuilderManager.js +3 -3
- package/esm/builder/constants.js +3 -3
- package/esm/builder/utils.js +3 -3
- package/esm/component/BaseControl.js +4 -4
- package/esm/component/InputComponentName.js +3 -3
- package/esm/component/ModalSettingPanel.js +3 -3
- package/esm/component/TableViewEditor.js +3 -3
- package/esm/icons/btn/btn-group.svg.js +4 -4
- package/esm/icons/btn/btn-select.svg.js +4 -4
- package/esm/icons/btn/btn-toolbar.svg.js +4 -4
- package/esm/icons/btn/button.svg.js +4 -4
- package/esm/icons/btn/dropdown-btn.svg.js +4 -4
- package/esm/icons/container/anchor-nav.svg.js +4 -4
- package/esm/icons/container/collapse.svg.js +4 -4
- package/esm/icons/container/container.svg.js +4 -4
- package/esm/icons/container/flex-container.svg.js +4 -4
- package/esm/icons/container/form-group.svg.js +4 -4
- package/esm/icons/container/grid.svg.js +4 -4
- package/esm/icons/container/iframe.svg.js +4 -4
- package/esm/icons/container/panel.svg.js +4 -4
- package/esm/icons/container/switch-container.svg.js +4 -4
- package/esm/icons/container/table-view.svg.js +4 -4
- package/esm/icons/container/tabs.svg.js +4 -4
- package/esm/icons/container/tooltip-wrapper.svg.js +4 -4
- package/esm/icons/container/web-component.svg.js +4 -4
- package/esm/icons/crud/column-add.svg.js +4 -4
- package/esm/icons/crud/column-delete.svg.js +4 -4
- package/esm/icons/crud/column-setting.svg.js +4 -4
- package/esm/icons/crud/share-link.svg.js +4 -4
- package/esm/icons/display/aBaseline.svg.js +4 -4
- package/esm/icons/display/aCenter.svg.js +4 -4
- package/esm/icons/display/aFlexEnd.svg.js +4 -4
- package/esm/icons/display/aFlexStart.svg.js +4 -4
- package/esm/icons/display/aStretch.svg.js +4 -4
- package/esm/icons/display/block.svg.js +4 -4
- package/esm/icons/display/dcolumn.svg.js +4 -4
- package/esm/icons/display/dcolumnReverse.svg.js +4 -4
- package/esm/icons/display/drow.svg.js +4 -4
- package/esm/icons/display/drowReverse.svg.js +4 -4
- package/esm/icons/display/flex.svg.js +4 -4
- package/esm/icons/display/inline-block.svg.js +4 -4
- package/esm/icons/display/inline.svg.js +4 -4
- package/esm/icons/display/jCenter.svg.js +4 -4
- package/esm/icons/display/jFlexEnd.svg.js +4 -4
- package/esm/icons/display/jFlexStart.svg.js +4 -4
- package/esm/icons/display/jSpaceAround.svg.js +4 -4
- package/esm/icons/display/jSpaceBetween.svg.js +4 -4
- package/esm/icons/feat/audio.svg.js +4 -4
- package/esm/icons/feat/custom.svg.js +4 -4
- package/esm/icons/feat/each.svg.js +4 -4
- package/esm/icons/feat/form.svg.js +4 -4
- package/esm/icons/feat/nav.svg.js +4 -4
- package/esm/icons/feat/qrcode.svg.js +4 -4
- package/esm/icons/feat/service.svg.js +4 -4
- package/esm/icons/feat/table.svg.js +4 -4
- package/esm/icons/feat/tasks.svg.js +4 -4
- package/esm/icons/feat/video.svg.js +4 -4
- package/esm/icons/feat/wizard.svg.js +4 -4
- package/esm/icons/form/chained-select.svg.js +4 -4
- package/esm/icons/form/checkbox.svg.js +4 -4
- package/esm/icons/form/checkboxes.svg.js +4 -4
- package/esm/icons/form/combo.svg.js +4 -4
- package/esm/icons/form/condition-builder.svg.js +4 -4
- package/esm/icons/form/diff-editor.svg.js +4 -4
- package/esm/icons/form/editor.svg.js +4 -4
- package/esm/icons/form/formula.svg.js +4 -4
- package/esm/icons/form/hidden.svg.js +4 -4
- package/esm/icons/form/input-city.svg.js +4 -4
- package/esm/icons/form/input-color.svg.js +4 -4
- package/esm/icons/form/input-date-range.svg.js +4 -4
- package/esm/icons/form/input-date.svg.js +4 -4
- package/esm/icons/form/input-datetime.svg.js +4 -4
- package/esm/icons/form/input-email.svg.js +4 -4
- package/esm/icons/form/input-excel.svg.js +4 -4
- package/esm/icons/form/input-file.svg.js +4 -4
- package/esm/icons/form/input-group.svg.js +4 -4
- package/esm/icons/form/input-image.svg.js +4 -4
- package/esm/icons/form/input-kv.svg.js +4 -4
- package/esm/icons/form/input-month-range.svg.js +4 -4
- package/esm/icons/form/input-number.svg.js +4 -4
- package/esm/icons/form/input-password.svg.js +4 -4
- package/esm/icons/form/input-quarter-range.svg.js +4 -4
- package/esm/icons/form/input-range.svg.js +4 -4
- package/esm/icons/form/input-rating.svg.js +4 -4
- package/esm/icons/form/input-repeat.svg.js +4 -4
- package/esm/icons/form/input-rich-text.svg.js +4 -4
- package/esm/icons/form/input-signature.svg.js +4 -4
- package/esm/icons/form/input-tag.svg.js +4 -4
- package/esm/icons/form/input-text.svg.js +4 -4
- package/esm/icons/form/input-time-range.svg.js +4 -4
- package/esm/icons/form/input-time.svg.js +4 -4
- package/esm/icons/form/input-tree.svg.js +4 -4
- package/esm/icons/form/input-url.svg.js +4 -4
- package/esm/icons/form/input-year.svg.js +4 -4
- package/esm/icons/form/inputArray.svg.js +4 -4
- package/esm/icons/form/list-select.svg.js +4 -4
- package/esm/icons/form/location-picker.svg.js +4 -4
- package/esm/icons/form/matrix-checkboxes.svg.js +4 -4
- package/esm/icons/form/month.svg.js +4 -4
- package/esm/icons/form/nested-select.svg.js +4 -4
- package/esm/icons/form/picker.svg.js +4 -4
- package/esm/icons/form/quarter.svg.js +4 -4
- package/esm/icons/form/radios.svg.js +4 -4
- package/esm/icons/form/select.svg.js +4 -4
- package/esm/icons/form/static.svg.js +4 -4
- package/esm/icons/form/sub-form.svg.js +4 -4
- package/esm/icons/form/switch.svg.js +4 -4
- package/esm/icons/form/tabs-transfer.svg.js +4 -4
- package/esm/icons/form/textarea.svg.js +4 -4
- package/esm/icons/form/transfer.svg.js +4 -4
- package/esm/icons/form/tree-select.svg.js +4 -4
- package/esm/icons/form/uuid.svg.js +4 -4
- package/esm/icons/index.js +3 -3
- package/esm/icons/layout/layout-1with2.svg.js +4 -4
- package/esm/icons/layout/layout-2cols.svg.js +4 -4
- package/esm/icons/layout/layout-2row.svg.js +4 -4
- package/esm/icons/layout/layout-2with1.svg.js +4 -4
- package/esm/icons/layout/layout-3cols.svg.js +4 -4
- package/esm/icons/layout/layout-3row.svg.js +4 -4
- package/esm/icons/layout/layout-absolute.svg.js +4 -4
- package/esm/icons/layout/layout-fixed-top.svg.js +4 -4
- package/esm/icons/layout/layout-fixed.svg.js +4 -4
- package/esm/icons/layout/layout-free-container.svg.js +4 -4
- package/esm/icons/layout/layout-full.svg.js +4 -4
- package/esm/icons/layout/layout1-2.svg.js +4 -4
- package/esm/icons/layout/layout2-1.svg.js +4 -4
- package/esm/icons/layout/layout3-1.svg.js +4 -4
- package/esm/icons/layout/layout3-2.svg.js +4 -4
- package/esm/icons/other/_fx.svg.js +4 -4
- package/esm/icons/other/divider.svg.js +4 -4
- package/esm/icons/other/fx.svg.js +4 -4
- package/esm/icons/other/modal-setting.svg.js +4 -4
- package/esm/icons/other/property-sheet.svg.js +4 -4
- package/esm/icons/other/tooltip.svg.js +4 -4
- package/esm/icons/show/URL.svg.js +4 -4
- package/esm/icons/show/avatar.svg.js +4 -4
- package/esm/icons/show/breadcrumb.svg.js +4 -4
- package/esm/icons/show/card.svg.js +4 -4
- package/esm/icons/show/cards.svg.js +4 -4
- package/esm/icons/show/carousel.svg.js +4 -4
- package/esm/icons/show/chart.svg.js +4 -4
- package/esm/icons/show/code.svg.js +4 -4
- package/esm/icons/show/date.svg.js +4 -4
- package/esm/icons/show/datetime.svg.js +4 -4
- package/esm/icons/show/image.svg.js +4 -4
- package/esm/icons/show/images.svg.js +4 -4
- package/esm/icons/show/json-view.svg.js +4 -4
- package/esm/icons/show/list.svg.js +4 -4
- package/esm/icons/show/log.svg.js +4 -4
- package/esm/icons/show/mapping.svg.js +4 -4
- package/esm/icons/show/markdown.svg.js +4 -4
- package/esm/icons/show/plain.svg.js +4 -4
- package/esm/icons/show/progress.svg.js +4 -4
- package/esm/icons/show/sparkline.svg.js +4 -4
- package/esm/icons/show/status.svg.js +4 -4
- package/esm/icons/show/steps.svg.js +4 -4
- package/esm/icons/show/time.svg.js +4 -4
- package/esm/icons/theme/css.svg.js +4 -4
- package/esm/index.d.ts +3 -0
- package/esm/index.js +6 -3
- package/esm/locale/en-US.js +3 -3
- package/esm/locale/zh-CN.js +3 -3
- package/esm/plugin/Alert.js +3 -3
- package/esm/plugin/AnchorNav.js +3 -3
- package/esm/plugin/Audio.js +3 -3
- package/esm/plugin/Avatar.js +8 -8
- package/esm/plugin/Breadcrumb.js +3 -3
- package/esm/plugin/Button.js +7 -7
- package/esm/plugin/ButtonGroup.js +3 -3
- package/esm/plugin/CRUD.d.ts +2 -1
- package/esm/plugin/CRUD.js +28 -27
- package/esm/plugin/CRUD2/BaseCRUD.js +14 -14
- package/esm/plugin/CRUD2/CRUDTable.js +3 -3
- package/esm/plugin/CRUD2/constants.js +3 -3
- package/esm/plugin/CRUD2/utils.js +3 -3
- package/esm/plugin/Calendar.js +3 -3
- package/esm/plugin/Card.js +3 -3
- package/esm/plugin/Card2.js +3 -3
- package/esm/plugin/Cards.d.ts +1 -1
- package/esm/plugin/Cards.js +12 -8
- package/esm/plugin/Carousel.js +3 -3
- package/esm/plugin/Chart.js +7 -7
- package/esm/plugin/CodeView.js +3 -3
- package/esm/plugin/Collapse.js +3 -3
- package/esm/plugin/CollapseGroup.js +3 -3
- package/esm/plugin/ColumnToggler.js +17 -4
- package/esm/plugin/Container.js +17 -17
- package/esm/plugin/Custom.js +3 -3
- package/esm/plugin/CustomRegion.js +3 -3
- package/esm/plugin/Date.js +3 -3
- package/esm/plugin/Datetime.js +3 -3
- package/esm/plugin/Dialog.d.ts +4 -0
- package/esm/plugin/Dialog.js +9 -3
- package/esm/plugin/Divider.d.ts +1 -0
- package/esm/plugin/Divider.js +12 -11
- package/esm/plugin/Drawer.d.ts +4 -0
- package/esm/plugin/Drawer.js +9 -3
- package/esm/plugin/DropDownButton.js +3 -3
- package/esm/plugin/Each.d.ts +1 -1
- package/esm/plugin/Each.js +22 -17
- package/esm/plugin/Flex.js +3 -3
- package/esm/plugin/Form/ButtonGroupSelect.js +5 -5
- package/esm/plugin/Form/ButtonToolbar.js +5 -5
- package/esm/plugin/Form/ChainedSelect.js +5 -5
- package/esm/plugin/Form/Checkbox.js +3 -3
- package/esm/plugin/Form/Checkboxes.js +6 -6
- package/esm/plugin/Form/CodeEditor.js +3 -3
- package/esm/plugin/Form/Combo.d.ts +1 -1
- package/esm/plugin/Form/Combo.js +33 -30
- package/esm/plugin/Form/ConditionBuilder.js +7 -7
- package/esm/plugin/Form/Control.js +3 -3
- package/esm/plugin/Form/DiffEditor.js +3 -3
- package/esm/plugin/Form/FieldSet.js +3 -3
- package/esm/plugin/Form/Form.js +16 -16
- package/esm/plugin/Form/Formula.js +3 -3
- package/esm/plugin/Form/Group.js +5 -5
- package/esm/plugin/Form/Hidden.js +3 -3
- package/esm/plugin/Form/InputArray.d.ts +2 -1
- package/esm/plugin/Form/InputArray.js +12 -10
- package/esm/plugin/Form/InputCity.js +4 -4
- package/esm/plugin/Form/InputColor.js +3 -3
- package/esm/plugin/Form/InputDate.js +3 -3
- package/esm/plugin/Form/InputDateRange.js +3 -3
- package/esm/plugin/Form/InputDateTime.js +3 -3
- package/esm/plugin/Form/InputDateTimeRange.js +3 -3
- package/esm/plugin/Form/InputEmail.js +3 -3
- package/esm/plugin/Form/InputExcel.js +4 -4
- package/esm/plugin/Form/InputFile.js +11 -11
- package/esm/plugin/Form/InputGroup.js +3 -3
- package/esm/plugin/Form/InputImage.js +11 -11
- package/esm/plugin/Form/InputKV.js +3 -3
- package/esm/plugin/Form/InputMonth.js +3 -3
- package/esm/plugin/Form/InputMonthRange.js +3 -3
- package/esm/plugin/Form/InputNumber.js +3 -3
- package/esm/plugin/Form/InputPassword.js +3 -3
- package/esm/plugin/Form/InputQuarter.js +3 -3
- package/esm/plugin/Form/InputQuarterRange.js +3 -3
- package/esm/plugin/Form/InputRange.js +8 -8
- package/esm/plugin/Form/InputRating.js +3 -3
- package/esm/plugin/Form/InputRepeat.js +3 -3
- package/esm/plugin/Form/InputRichText.js +16 -16
- package/esm/plugin/Form/InputSignature.js +4 -4
- package/esm/plugin/Form/InputSubForm.d.ts +1 -1
- package/esm/plugin/Form/InputSubForm.js +11 -8
- package/esm/plugin/Form/InputTable.d.ts +1 -1
- package/esm/plugin/Form/InputTable.js +18 -26
- package/esm/plugin/Form/InputTag.js +3 -3
- package/esm/plugin/Form/InputText.js +8 -8
- package/esm/plugin/Form/InputTime.js +3 -3
- package/esm/plugin/Form/InputTimeRange.js +3 -3
- package/esm/plugin/Form/InputTree.js +19 -19
- package/esm/plugin/Form/InputURL.js +3 -3
- package/esm/plugin/Form/InputYear.js +3 -3
- package/esm/plugin/Form/InputYearRange.js +3 -3
- package/esm/plugin/Form/Item.js +11 -13
- package/esm/plugin/Form/ListSelect.js +3 -3
- package/esm/plugin/Form/LocationPicker.js +3 -3
- package/esm/plugin/Form/MatrixCheckboxes.js +3 -3
- package/esm/plugin/Form/NestedSelect.js +3 -3
- package/esm/plugin/Form/Picker.js +3 -3
- package/esm/plugin/Form/Radios.js +5 -5
- package/esm/plugin/Form/Select.js +3 -3
- package/esm/plugin/Form/Static.js +14 -12
- package/esm/plugin/Form/Switch.js +3 -3
- package/esm/plugin/Form/TabsTransfer.js +3 -3
- package/esm/plugin/Form/Textarea.js +3 -3
- package/esm/plugin/Form/Transfer.js +10 -10
- package/esm/plugin/Form/TransferPicker.js +3 -3
- package/esm/plugin/Form/TreeSelect.js +19 -19
- package/esm/plugin/Form/UUID.js +3 -3
- package/esm/plugin/Grid.js +3 -3
- package/esm/plugin/HBox.js +3 -3
- package/esm/plugin/IFrame.js +3 -3
- package/esm/plugin/Icon.js +3 -3
- package/esm/plugin/Image.js +3 -3
- package/esm/plugin/Images.js +3 -3
- package/esm/plugin/Json.js +3 -3
- package/esm/plugin/Layout/FlexPluginBase.js +18 -17
- package/esm/plugin/Layout/Layout_fixed.js +3 -3
- package/esm/plugin/Layout/Layout_free_container.js +3 -3
- package/esm/plugin/Layout/Layout_sorption_container.js +3 -3
- package/esm/plugin/Link.js +3 -3
- package/esm/plugin/List.d.ts +1 -1
- package/esm/plugin/List.js +25 -19
- package/esm/plugin/List2.d.ts +1 -1
- package/esm/plugin/List2.js +12 -8
- package/esm/plugin/ListItem.js +3 -3
- package/esm/plugin/Log.js +3 -3
- package/esm/plugin/Mapping.js +3 -3
- package/esm/plugin/Markdown.js +3 -3
- package/esm/plugin/Nav.js +3 -3
- package/esm/plugin/OfficeViewer.js +11 -11
- package/esm/plugin/Operation.js +3 -3
- package/esm/plugin/Others/Action.js +13 -13
- package/esm/plugin/Others/TableCell.js +11 -11
- package/esm/plugin/Page.js +10 -10
- package/esm/plugin/Pagination.js +12 -12
- package/esm/plugin/Panel.js +3 -3
- package/esm/plugin/PdfViewer.js +3 -3
- package/esm/plugin/Plain.js +3 -3
- package/esm/plugin/Progress.js +8 -8
- package/esm/plugin/Property.js +4 -4
- package/esm/plugin/QRCode.js +3 -3
- package/esm/plugin/Reset.js +3 -3
- package/esm/plugin/SearchBox.js +3 -3
- package/esm/plugin/Service.js +3 -3
- package/esm/plugin/Sparkline.js +3 -3
- package/esm/plugin/Status.js +3 -3
- package/esm/plugin/Steps.js +3 -3
- package/esm/plugin/Submit.js +3 -3
- package/esm/plugin/SwitchContainer.js +14 -14
- package/esm/plugin/Table.d.ts +1 -1
- package/esm/plugin/Table.js +28 -22
- package/esm/plugin/Table2.d.ts +1 -1
- package/esm/plugin/Table2.js +22 -14
- package/esm/plugin/TableCell2.js +8 -8
- package/esm/plugin/TableView.d.ts +18 -1
- package/esm/plugin/TableView.js +99 -14
- package/esm/plugin/Tabs.js +7 -7
- package/esm/plugin/Tag.js +4 -4
- package/esm/plugin/Tasks.js +4 -4
- package/esm/plugin/Time.js +3 -3
- package/esm/plugin/Timeline.js +4 -4
- package/esm/plugin/TooltipWrapper.js +3 -3
- package/esm/plugin/Tpl.js +6 -6
- package/esm/plugin/Video.js +3 -3
- package/esm/plugin/WebComponent.js +3 -3
- package/esm/plugin/Wizard.js +17 -17
- package/esm/plugin/Wrapper.js +14 -14
- package/esm/renderer/APIAdaptorControl.js +3 -3
- package/esm/renderer/APIControl.js +3 -3
- package/esm/renderer/BadgeControl.js +3 -3
- package/esm/renderer/ButtonGroupControl.js +3 -3
- package/esm/renderer/ConditionFormulaControl.d.ts +40 -0
- package/esm/renderer/ConditionFormulaControl.js +198 -0
- package/esm/renderer/DataBindingControl.js +3 -3
- package/esm/renderer/DataMappingControl.js +3 -3
- package/esm/renderer/DataPickerControl.js +3 -3
- package/esm/renderer/DateShortCutControl.js +3 -3
- package/esm/renderer/ExpressionFormulaControl.js +3 -3
- package/esm/renderer/FeatureControl.js +3 -3
- package/esm/renderer/FieldSetting.js +3 -3
- package/esm/renderer/FlexSettingControl.js +3 -3
- package/esm/renderer/FormulaControl.d.ts +34 -6
- package/esm/renderer/FormulaControl.js +273 -113
- package/esm/renderer/FunctionEditorControl.js +3 -3
- package/esm/renderer/GoConfigControl.js +3 -3
- package/esm/renderer/InputRangeValueControl.js +3 -3
- package/esm/renderer/KeyValueMapControl.js +3 -3
- package/esm/renderer/ListItemControl.js +3 -3
- package/esm/renderer/MapSourceControl.js +4 -4
- package/esm/renderer/NavBadgeControl.js +3 -3
- package/esm/renderer/NavDefaultActive.js +3 -3
- package/esm/renderer/NavSourceControl.js +3 -3
- package/esm/renderer/OptionControl.d.ts +22 -104
- package/esm/renderer/OptionControl.js +640 -429
- package/esm/renderer/RangePartsControl.js +3 -3
- package/esm/renderer/StatusControl.d.ts +1 -0
- package/esm/renderer/StatusControl.js +25 -6
- package/esm/renderer/SwitchMoreControl.js +5 -4
- package/esm/renderer/TableColumnWidthControl.js +3 -3
- package/esm/renderer/TimelineItemControl.js +4 -4
- package/esm/renderer/TplFormulaControl.d.ts +24 -1
- package/esm/renderer/TplFormulaControl.js +172 -33
- package/esm/renderer/TransferTableControl.js +4 -4
- package/esm/renderer/TreeOptionControl.js +4 -4
- package/esm/renderer/ValidateApiControl.d.ts +14 -0
- package/esm/renderer/ValidateApiControl.js +87 -0
- package/esm/renderer/ValidationControl.d.ts +5 -1
- package/esm/renderer/ValidationControl.js +68 -65
- package/esm/renderer/ValidationItem.d.ts +2 -0
- package/esm/renderer/ValidationItem.js +7 -3
- package/esm/renderer/ValueFormatControl.js +3 -3
- package/esm/renderer/crud2-control/AddColumnModal.js +3 -3
- package/esm/renderer/crud2-control/CRUDColumnControl.js +3 -3
- package/esm/renderer/crud2-control/CRUDFiltersControl.js +3 -3
- package/esm/renderer/crud2-control/CRUDToolbarControl.js +3 -3
- package/esm/renderer/event-control/DialogActionPanel.js +3 -3
- package/esm/renderer/event-control/action-config-dialog.js +11 -11
- package/esm/renderer/event-control/action-config-panel.js +3 -3
- package/esm/renderer/event-control/comp-action-select.js +3 -3
- package/esm/renderer/event-control/helper.js +89 -58
- package/esm/renderer/event-control/index.js +3 -3
- package/esm/renderer/style-control/Background.js +3 -3
- package/esm/renderer/style-control/Border.js +3 -3
- package/esm/renderer/style-control/BoxModel.js +3 -3
- package/esm/renderer/style-control/BoxShadow.js +3 -3
- package/esm/renderer/style-control/Display.js +3 -3
- package/esm/renderer/style-control/FlexLayout.js +7 -5
- package/esm/renderer/style-control/Font.js +3 -3
- package/esm/renderer/style-control/InsetBoxModel.js +3 -3
- package/esm/renderer/style-control/ThemeCssCode.js +3 -3
- package/esm/renderer/style-control/font-family.js +3 -3
- package/esm/renderer/style-control/helper.js +3 -3
- package/esm/renderer/style-control/transformation.js +3 -3
- package/esm/renderer/textarea-formula/FormulaPicker.d.ts +1 -0
- package/esm/renderer/textarea-formula/FormulaPicker.js +11 -4
- package/esm/renderer/textarea-formula/TextareaFormulaControl.d.ts +20 -1
- package/esm/renderer/textarea-formula/TextareaFormulaControl.js +182 -38
- package/esm/renderer/textarea-formula/plugin.js +4 -4
- package/esm/tpl/api.js +3 -3
- package/esm/tpl/common.js +14 -6
- package/esm/tpl/horizontal.js +7 -7
- package/esm/tpl/layout.js +17 -17
- package/esm/tpl/options.js +15 -15
- package/esm/tpl/remark.js +17 -13
- package/esm/tpl/style.js +3 -3
- package/esm/tpl/validations.js +24 -17
- package/esm/util.js +3 -3
- package/esm/validator.d.ts +4 -1
- package/esm/validator.js +12 -7
- package/lib/builder/ApiDSBuilder.d.ts +8 -8
- package/lib/builder/ApiDSBuilder.js +3 -3
- package/lib/builder/DSBuilder.js +3 -3
- package/lib/builder/DSBuilderManager.js +3 -3
- package/lib/builder/constants.d.ts +1 -1
- package/lib/builder/constants.js +3 -3
- package/lib/builder/utils.js +3 -3
- package/lib/component/BaseControl.js +4 -4
- package/lib/component/InputComponentName.js +3 -3
- package/lib/component/ModalSettingPanel.js +3 -3
- package/lib/component/TableViewEditor.js +3 -3
- package/lib/icons/btn/btn-group.svg.js +4 -4
- package/lib/icons/btn/btn-select.svg.js +4 -4
- package/lib/icons/btn/btn-toolbar.svg.js +4 -4
- package/lib/icons/btn/button.svg.js +4 -4
- package/lib/icons/btn/dropdown-btn.svg.js +4 -4
- package/lib/icons/container/anchor-nav.svg.js +4 -4
- package/lib/icons/container/collapse.svg.js +4 -4
- package/lib/icons/container/container.svg.js +4 -4
- package/lib/icons/container/flex-container.svg.js +4 -4
- package/lib/icons/container/form-group.svg.js +4 -4
- package/lib/icons/container/grid.svg.js +4 -4
- package/lib/icons/container/iframe.svg.js +4 -4
- package/lib/icons/container/panel.svg.js +4 -4
- package/lib/icons/container/switch-container.svg.js +4 -4
- package/lib/icons/container/table-view.svg.js +4 -4
- package/lib/icons/container/tabs.svg.js +4 -4
- package/lib/icons/container/tooltip-wrapper.svg.js +4 -4
- package/lib/icons/container/web-component.svg.js +4 -4
- package/lib/icons/crud/column-add.svg.js +4 -4
- package/lib/icons/crud/column-delete.svg.js +4 -4
- package/lib/icons/crud/column-setting.svg.js +4 -4
- package/lib/icons/crud/share-link.svg.js +4 -4
- package/lib/icons/display/aBaseline.svg.js +4 -4
- package/lib/icons/display/aCenter.svg.js +4 -4
- package/lib/icons/display/aFlexEnd.svg.js +4 -4
- package/lib/icons/display/aFlexStart.svg.js +4 -4
- package/lib/icons/display/aStretch.svg.js +4 -4
- package/lib/icons/display/block.svg.js +4 -4
- package/lib/icons/display/dcolumn.svg.js +4 -4
- package/lib/icons/display/dcolumnReverse.svg.js +4 -4
- package/lib/icons/display/drow.svg.js +4 -4
- package/lib/icons/display/drowReverse.svg.js +4 -4
- package/lib/icons/display/flex.svg.js +4 -4
- package/lib/icons/display/inline-block.svg.js +4 -4
- package/lib/icons/display/inline.svg.js +4 -4
- package/lib/icons/display/jCenter.svg.js +4 -4
- package/lib/icons/display/jFlexEnd.svg.js +4 -4
- package/lib/icons/display/jFlexStart.svg.js +4 -4
- package/lib/icons/display/jSpaceAround.svg.js +4 -4
- package/lib/icons/display/jSpaceBetween.svg.js +4 -4
- package/lib/icons/feat/audio.svg.js +4 -4
- package/lib/icons/feat/custom.svg.js +4 -4
- package/lib/icons/feat/each.svg.js +4 -4
- package/lib/icons/feat/form.svg.js +4 -4
- package/lib/icons/feat/nav.svg.js +4 -4
- package/lib/icons/feat/qrcode.svg.js +4 -4
- package/lib/icons/feat/service.svg.js +4 -4
- package/lib/icons/feat/table.svg.js +4 -4
- package/lib/icons/feat/tasks.svg.js +4 -4
- package/lib/icons/feat/video.svg.js +4 -4
- package/lib/icons/feat/wizard.svg.js +4 -4
- package/lib/icons/form/chained-select.svg.js +4 -4
- package/lib/icons/form/checkbox.svg.js +4 -4
- package/lib/icons/form/checkboxes.svg.js +4 -4
- package/lib/icons/form/combo.svg.js +4 -4
- package/lib/icons/form/condition-builder.svg.js +4 -4
- package/lib/icons/form/diff-editor.svg.js +4 -4
- package/lib/icons/form/editor.svg.js +4 -4
- package/lib/icons/form/formula.svg.js +4 -4
- package/lib/icons/form/hidden.svg.js +4 -4
- package/lib/icons/form/input-city.svg.js +4 -4
- package/lib/icons/form/input-color.svg.js +4 -4
- package/lib/icons/form/input-date-range.svg.js +4 -4
- package/lib/icons/form/input-date.svg.js +4 -4
- package/lib/icons/form/input-datetime.svg.js +4 -4
- package/lib/icons/form/input-email.svg.js +4 -4
- package/lib/icons/form/input-excel.svg.js +4 -4
- package/lib/icons/form/input-file.svg.js +4 -4
- package/lib/icons/form/input-group.svg.js +4 -4
- package/lib/icons/form/input-image.svg.js +4 -4
- package/lib/icons/form/input-kv.svg.js +4 -4
- package/lib/icons/form/input-month-range.svg.js +4 -4
- package/lib/icons/form/input-number.svg.js +4 -4
- package/lib/icons/form/input-password.svg.js +4 -4
- package/lib/icons/form/input-quarter-range.svg.js +4 -4
- package/lib/icons/form/input-range.svg.js +4 -4
- package/lib/icons/form/input-rating.svg.js +4 -4
- package/lib/icons/form/input-repeat.svg.js +4 -4
- package/lib/icons/form/input-rich-text.svg.js +4 -4
- package/lib/icons/form/input-signature.svg.js +4 -4
- package/lib/icons/form/input-tag.svg.js +4 -4
- package/lib/icons/form/input-text.svg.js +4 -4
- package/lib/icons/form/input-time-range.svg.js +4 -4
- package/lib/icons/form/input-time.svg.js +4 -4
- package/lib/icons/form/input-tree.svg.js +4 -4
- package/lib/icons/form/input-url.svg.js +4 -4
- package/lib/icons/form/input-year.svg.js +4 -4
- package/lib/icons/form/inputArray.svg.js +4 -4
- package/lib/icons/form/list-select.svg.js +4 -4
- package/lib/icons/form/location-picker.svg.js +4 -4
- package/lib/icons/form/matrix-checkboxes.svg.js +4 -4
- package/lib/icons/form/month.svg.js +4 -4
- package/lib/icons/form/nested-select.svg.js +4 -4
- package/lib/icons/form/picker.svg.js +4 -4
- package/lib/icons/form/quarter.svg.js +4 -4
- package/lib/icons/form/radios.svg.js +4 -4
- package/lib/icons/form/select.svg.js +4 -4
- package/lib/icons/form/static.svg.js +4 -4
- package/lib/icons/form/sub-form.svg.js +4 -4
- package/lib/icons/form/switch.svg.js +4 -4
- package/lib/icons/form/tabs-transfer.svg.js +4 -4
- package/lib/icons/form/textarea.svg.js +4 -4
- package/lib/icons/form/transfer.svg.js +4 -4
- package/lib/icons/form/tree-select.svg.js +4 -4
- package/lib/icons/form/uuid.svg.js +4 -4
- package/lib/icons/index.js +3 -3
- package/lib/icons/layout/layout-1with2.svg.js +4 -4
- package/lib/icons/layout/layout-2cols.svg.js +4 -4
- package/lib/icons/layout/layout-2row.svg.js +4 -4
- package/lib/icons/layout/layout-2with1.svg.js +4 -4
- package/lib/icons/layout/layout-3cols.svg.js +4 -4
- package/lib/icons/layout/layout-3row.svg.js +4 -4
- package/lib/icons/layout/layout-absolute.svg.js +4 -4
- package/lib/icons/layout/layout-fixed-top.svg.js +4 -4
- package/lib/icons/layout/layout-fixed.svg.js +4 -4
- package/lib/icons/layout/layout-free-container.svg.js +4 -4
- package/lib/icons/layout/layout-full.svg.js +4 -4
- package/lib/icons/layout/layout1-2.svg.js +4 -4
- package/lib/icons/layout/layout2-1.svg.js +4 -4
- package/lib/icons/layout/layout3-1.svg.js +4 -4
- package/lib/icons/layout/layout3-2.svg.js +4 -4
- package/lib/icons/other/_fx.svg.js +4 -4
- package/lib/icons/other/divider.svg.js +4 -4
- package/lib/icons/other/fx.svg.js +4 -4
- package/lib/icons/other/modal-setting.svg.js +4 -4
- package/lib/icons/other/property-sheet.svg.js +4 -4
- package/lib/icons/other/tooltip.svg.js +4 -4
- package/lib/icons/show/URL.svg.js +4 -4
- package/lib/icons/show/avatar.svg.js +4 -4
- package/lib/icons/show/breadcrumb.svg.js +4 -4
- package/lib/icons/show/card.svg.js +4 -4
- package/lib/icons/show/cards.svg.js +4 -4
- package/lib/icons/show/carousel.svg.js +4 -4
- package/lib/icons/show/chart.svg.js +4 -4
- package/lib/icons/show/code.svg.js +4 -4
- package/lib/icons/show/date.svg.js +4 -4
- package/lib/icons/show/datetime.svg.js +4 -4
- package/lib/icons/show/image.svg.js +4 -4
- package/lib/icons/show/images.svg.js +4 -4
- package/lib/icons/show/json-view.svg.js +4 -4
- package/lib/icons/show/list.svg.js +4 -4
- package/lib/icons/show/log.svg.js +4 -4
- package/lib/icons/show/mapping.svg.js +4 -4
- package/lib/icons/show/markdown.svg.js +4 -4
- package/lib/icons/show/plain.svg.js +4 -4
- package/lib/icons/show/progress.svg.js +4 -4
- package/lib/icons/show/sparkline.svg.js +4 -4
- package/lib/icons/show/status.svg.js +4 -4
- package/lib/icons/show/steps.svg.js +4 -4
- package/lib/icons/show/time.svg.js +4 -4
- package/lib/icons/theme/css.svg.js +4 -4
- package/lib/index.d.ts +3 -0
- package/lib/index.js +18 -3
- package/lib/locale/en-US.js +3 -3
- package/lib/locale/zh-CN.js +3 -3
- package/lib/plugin/Alert.js +3 -3
- package/lib/plugin/AnchorNav.js +3 -3
- package/lib/plugin/Audio.js +3 -3
- package/lib/plugin/Avatar.js +8 -8
- package/lib/plugin/Breadcrumb.js +3 -3
- package/lib/plugin/Button.js +7 -7
- package/lib/plugin/ButtonGroup.js +3 -3
- package/lib/plugin/CRUD.d.ts +2 -1
- package/lib/plugin/CRUD.js +28 -27
- package/lib/plugin/CRUD2/BaseCRUD.js +14 -14
- package/lib/plugin/CRUD2/CRUDTable.js +3 -3
- package/lib/plugin/CRUD2/constants.js +3 -3
- package/lib/plugin/CRUD2/utils.js +3 -3
- package/lib/plugin/Calendar.js +3 -3
- package/lib/plugin/Card.js +3 -3
- package/lib/plugin/Card2.js +3 -3
- package/lib/plugin/Cards.d.ts +1 -1
- package/lib/plugin/Cards.js +12 -8
- package/lib/plugin/Carousel.js +3 -3
- package/lib/plugin/Chart.js +7 -7
- package/lib/plugin/CodeView.js +3 -3
- package/lib/plugin/Collapse.js +3 -3
- package/lib/plugin/CollapseGroup.js +3 -3
- package/lib/plugin/ColumnToggler.js +17 -4
- package/lib/plugin/Container.js +17 -17
- package/lib/plugin/Custom.js +3 -3
- package/lib/plugin/CustomRegion.js +3 -3
- package/lib/plugin/Date.js +3 -3
- package/lib/plugin/Datetime.js +3 -3
- package/lib/plugin/Dialog.d.ts +4 -0
- package/lib/plugin/Dialog.js +9 -3
- package/lib/plugin/Divider.d.ts +1 -0
- package/lib/plugin/Divider.js +12 -11
- package/lib/plugin/Drawer.d.ts +4 -0
- package/lib/plugin/Drawer.js +9 -3
- package/lib/plugin/DropDownButton.js +3 -3
- package/lib/plugin/Each.d.ts +1 -1
- package/lib/plugin/Each.js +22 -17
- package/lib/plugin/Flex.js +3 -3
- package/lib/plugin/Form/ButtonGroupSelect.js +5 -5
- package/lib/plugin/Form/ButtonToolbar.js +5 -5
- package/lib/plugin/Form/ChainedSelect.js +5 -5
- package/lib/plugin/Form/Checkbox.js +3 -3
- package/lib/plugin/Form/Checkboxes.js +6 -6
- package/lib/plugin/Form/CodeEditor.js +3 -3
- package/lib/plugin/Form/Combo.d.ts +1 -1
- package/lib/plugin/Form/Combo.js +33 -30
- package/lib/plugin/Form/ConditionBuilder.js +7 -7
- package/lib/plugin/Form/Control.js +3 -3
- package/lib/plugin/Form/DiffEditor.js +3 -3
- package/lib/plugin/Form/FieldSet.js +3 -3
- package/lib/plugin/Form/Form.js +16 -16
- package/lib/plugin/Form/Formula.js +3 -3
- package/lib/plugin/Form/Group.js +5 -5
- package/lib/plugin/Form/Hidden.js +3 -3
- package/lib/plugin/Form/InputArray.d.ts +2 -1
- package/lib/plugin/Form/InputArray.js +12 -10
- package/lib/plugin/Form/InputCity.js +4 -4
- package/lib/plugin/Form/InputColor.js +3 -3
- package/lib/plugin/Form/InputDate.js +3 -3
- package/lib/plugin/Form/InputDateRange.js +3 -3
- package/lib/plugin/Form/InputDateTime.js +3 -3
- package/lib/plugin/Form/InputDateTimeRange.js +3 -3
- package/lib/plugin/Form/InputEmail.js +3 -3
- package/lib/plugin/Form/InputExcel.js +4 -4
- package/lib/plugin/Form/InputFile.js +11 -11
- package/lib/plugin/Form/InputGroup.js +3 -3
- package/lib/plugin/Form/InputImage.js +11 -11
- package/lib/plugin/Form/InputKV.js +3 -3
- package/lib/plugin/Form/InputMonth.js +3 -3
- package/lib/plugin/Form/InputMonthRange.js +3 -3
- package/lib/plugin/Form/InputNumber.js +3 -3
- package/lib/plugin/Form/InputPassword.js +3 -3
- package/lib/plugin/Form/InputQuarter.js +3 -3
- package/lib/plugin/Form/InputQuarterRange.js +3 -3
- package/lib/plugin/Form/InputRange.js +8 -8
- package/lib/plugin/Form/InputRating.js +3 -3
- package/lib/plugin/Form/InputRepeat.js +3 -3
- package/lib/plugin/Form/InputRichText.js +16 -16
- package/lib/plugin/Form/InputSignature.js +4 -4
- package/lib/plugin/Form/InputSubForm.d.ts +1 -1
- package/lib/plugin/Form/InputSubForm.js +11 -8
- package/lib/plugin/Form/InputTable.d.ts +1 -1
- package/lib/plugin/Form/InputTable.js +16 -24
- package/lib/plugin/Form/InputTag.js +3 -3
- package/lib/plugin/Form/InputText.js +8 -8
- package/lib/plugin/Form/InputTime.js +3 -3
- package/lib/plugin/Form/InputTimeRange.js +3 -3
- package/lib/plugin/Form/InputTree.js +19 -19
- package/lib/plugin/Form/InputURL.js +3 -3
- package/lib/plugin/Form/InputYear.js +3 -3
- package/lib/plugin/Form/InputYearRange.js +3 -3
- package/lib/plugin/Form/Item.js +11 -17
- package/lib/plugin/Form/ListSelect.js +3 -3
- package/lib/plugin/Form/LocationPicker.js +3 -3
- package/lib/plugin/Form/MatrixCheckboxes.js +3 -3
- package/lib/plugin/Form/NestedSelect.js +3 -3
- package/lib/plugin/Form/Picker.js +3 -3
- package/lib/plugin/Form/Radios.js +5 -5
- package/lib/plugin/Form/Select.js +3 -3
- package/lib/plugin/Form/Static.js +14 -12
- package/lib/plugin/Form/Switch.js +3 -3
- package/lib/plugin/Form/TabsTransfer.js +3 -3
- package/lib/plugin/Form/Textarea.js +3 -3
- package/lib/plugin/Form/Transfer.js +10 -10
- package/lib/plugin/Form/TransferPicker.js +3 -3
- package/lib/plugin/Form/TreeSelect.js +19 -19
- package/lib/plugin/Form/UUID.js +3 -3
- package/lib/plugin/Grid.js +3 -3
- package/lib/plugin/HBox.js +3 -3
- package/lib/plugin/IFrame.js +3 -3
- package/lib/plugin/Icon.js +3 -3
- package/lib/plugin/Image.js +3 -3
- package/lib/plugin/Images.js +3 -3
- package/lib/plugin/Json.js +3 -3
- package/lib/plugin/Layout/FlexPluginBase.js +18 -17
- package/lib/plugin/Layout/Layout_fixed.js +3 -3
- package/lib/plugin/Layout/Layout_free_container.js +3 -3
- package/lib/plugin/Layout/Layout_sorption_container.js +3 -3
- package/lib/plugin/Link.js +3 -3
- package/lib/plugin/List.d.ts +1 -1
- package/lib/plugin/List.js +25 -19
- package/lib/plugin/List2.d.ts +1 -1
- package/lib/plugin/List2.js +12 -8
- package/lib/plugin/ListItem.js +3 -3
- package/lib/plugin/Log.js +3 -3
- package/lib/plugin/Mapping.js +3 -3
- package/lib/plugin/Markdown.js +3 -3
- package/lib/plugin/Nav.js +3 -3
- package/lib/plugin/OfficeViewer.js +11 -11
- package/lib/plugin/Operation.js +3 -3
- package/lib/plugin/Others/Action.js +13 -13
- package/lib/plugin/Others/TableCell.js +11 -11
- package/lib/plugin/Page.js +10 -10
- package/lib/plugin/Pagination.js +12 -12
- package/lib/plugin/Panel.js +3 -3
- package/lib/plugin/PdfViewer.js +3 -3
- package/lib/plugin/Plain.js +3 -3
- package/lib/plugin/Progress.js +8 -8
- package/lib/plugin/Property.js +4 -4
- package/lib/plugin/QRCode.js +3 -3
- package/lib/plugin/Reset.js +3 -3
- package/lib/plugin/SearchBox.js +3 -3
- package/lib/plugin/Service.js +3 -3
- package/lib/plugin/Sparkline.js +3 -3
- package/lib/plugin/Status.js +3 -3
- package/lib/plugin/Steps.js +3 -3
- package/lib/plugin/Submit.js +3 -3
- package/lib/plugin/SwitchContainer.js +14 -14
- package/lib/plugin/Table.d.ts +1 -1
- package/lib/plugin/Table.js +28 -22
- package/lib/plugin/Table2.d.ts +1 -1
- package/lib/plugin/Table2.js +22 -14
- package/lib/plugin/TableCell2.js +8 -8
- package/lib/plugin/TableView.d.ts +18 -1
- package/lib/plugin/TableView.js +98 -13
- package/lib/plugin/Tabs.js +7 -7
- package/lib/plugin/Tag.js +4 -4
- package/lib/plugin/Tasks.js +4 -4
- package/lib/plugin/Time.js +3 -3
- package/lib/plugin/Timeline.js +4 -4
- package/lib/plugin/TooltipWrapper.js +3 -3
- package/lib/plugin/Tpl.js +6 -6
- package/lib/plugin/Video.js +3 -3
- package/lib/plugin/WebComponent.js +3 -3
- package/lib/plugin/Wizard.js +17 -17
- package/lib/plugin/Wrapper.js +14 -14
- package/lib/renderer/APIAdaptorControl.js +3 -3
- package/lib/renderer/APIControl.js +3 -3
- package/lib/renderer/BadgeControl.d.ts +6 -6
- package/lib/renderer/BadgeControl.js +3 -3
- package/lib/renderer/ButtonGroupControl.js +3 -3
- package/lib/renderer/ConditionFormulaControl.d.ts +40 -0
- package/lib/renderer/ConditionFormulaControl.js +207 -0
- package/lib/renderer/DataBindingControl.js +3 -3
- package/lib/renderer/DataMappingControl.js +3 -3
- package/lib/renderer/DataPickerControl.js +3 -3
- package/lib/renderer/DateShortCutControl.js +3 -3
- package/lib/renderer/ExpressionFormulaControl.js +3 -3
- package/lib/renderer/FeatureControl.js +3 -3
- package/lib/renderer/FieldSetting.js +3 -3
- package/lib/renderer/FlexSettingControl.js +3 -3
- package/lib/renderer/FormulaControl.d.ts +34 -6
- package/lib/renderer/FormulaControl.js +270 -114
- package/lib/renderer/FunctionEditorControl.js +3 -3
- package/lib/renderer/GoConfigControl.js +3 -3
- package/lib/renderer/InputRangeValueControl.js +3 -3
- package/lib/renderer/KeyValueMapControl.js +3 -3
- package/lib/renderer/ListItemControl.js +3 -3
- package/lib/renderer/MapSourceControl.js +4 -4
- package/lib/renderer/NavBadgeControl.d.ts +6 -6
- package/lib/renderer/NavBadgeControl.js +3 -3
- package/lib/renderer/NavDefaultActive.js +3 -3
- package/lib/renderer/NavSourceControl.js +3 -3
- package/lib/renderer/OptionControl.d.ts +22 -104
- package/lib/renderer/OptionControl.js +637 -428
- package/lib/renderer/RangePartsControl.js +3 -3
- package/lib/renderer/StatusControl.d.ts +1 -0
- package/lib/renderer/StatusControl.js +25 -6
- package/lib/renderer/SwitchMoreControl.js +5 -4
- package/lib/renderer/TableColumnWidthControl.js +3 -3
- package/lib/renderer/TimelineItemControl.js +4 -4
- package/lib/renderer/TplFormulaControl.d.ts +24 -1
- package/lib/renderer/TplFormulaControl.js +167 -28
- package/lib/renderer/TransferTableControl.js +4 -4
- package/lib/renderer/TreeOptionControl.js +4 -4
- package/lib/renderer/ValidateApiControl.d.ts +14 -0
- package/lib/renderer/ValidateApiControl.js +95 -0
- package/lib/renderer/ValidationControl.d.ts +5 -1
- package/lib/renderer/ValidationControl.js +65 -62
- package/lib/renderer/ValidationItem.d.ts +2 -0
- package/lib/renderer/ValidationItem.js +7 -3
- package/lib/renderer/ValueFormatControl.js +3 -3
- package/lib/renderer/crud2-control/AddColumnModal.js +3 -3
- package/lib/renderer/crud2-control/CRUDColumnControl.js +3 -3
- package/lib/renderer/crud2-control/CRUDFiltersControl.js +3 -3
- package/lib/renderer/crud2-control/CRUDToolbarControl.js +3 -3
- package/lib/renderer/event-control/DialogActionPanel.js +3 -3
- package/lib/renderer/event-control/action-config-dialog.js +11 -11
- package/lib/renderer/event-control/action-config-panel.js +3 -3
- package/lib/renderer/event-control/comp-action-select.js +3 -3
- package/lib/renderer/event-control/helper.js +89 -58
- package/lib/renderer/event-control/index.js +3 -3
- package/lib/renderer/style-control/Background.js +3 -3
- package/lib/renderer/style-control/Border.js +3 -3
- package/lib/renderer/style-control/BoxModel.js +3 -3
- package/lib/renderer/style-control/BoxShadow.js +3 -3
- package/lib/renderer/style-control/Display.js +3 -3
- package/lib/renderer/style-control/FlexLayout.js +7 -5
- package/lib/renderer/style-control/Font.js +3 -3
- package/lib/renderer/style-control/InsetBoxModel.js +3 -3
- package/lib/renderer/style-control/ThemeCssCode.js +3 -3
- package/lib/renderer/style-control/font-family.js +3 -3
- package/lib/renderer/style-control/helper.js +3 -3
- package/lib/renderer/style-control/transformation.js +3 -3
- package/lib/renderer/textarea-formula/FormulaPicker.d.ts +1 -0
- package/lib/renderer/textarea-formula/FormulaPicker.js +11 -4
- package/lib/renderer/textarea-formula/TextareaFormulaControl.d.ts +20 -1
- package/lib/renderer/textarea-formula/TextareaFormulaControl.js +178 -34
- package/lib/renderer/textarea-formula/plugin.js +4 -4
- package/lib/tpl/api.js +3 -3
- package/lib/tpl/common.js +14 -6
- package/lib/tpl/horizontal.js +7 -7
- package/lib/tpl/layout.js +17 -17
- package/lib/tpl/options.js +15 -15
- package/lib/tpl/remark.js +17 -13
- package/lib/tpl/style.js +3 -3
- package/lib/tpl/validations.js +24 -17
- package/lib/util.js +3 -3
- package/lib/validator.d.ts +4 -1
- package/lib/validator.js +12 -6
- package/package.json +4 -4
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* amis-editor v6.
|
3
|
-
* build time: 2024-
|
2
|
+
* amis-editor v6.6.0
|
3
|
+
* build time: 2024-07-01
|
4
4
|
* Copyright 2018-2024 @fex
|
5
5
|
*/
|
6
6
|
|
@@ -15,12 +15,10 @@ var cx = require('classnames');
|
|
15
15
|
var DeepDiff = require('deep-diff');
|
16
16
|
var uniqBy = require('lodash/uniqBy');
|
17
17
|
var omit = require('lodash/omit');
|
18
|
-
var get = require('lodash/get');
|
19
18
|
var Sortable = require('sortablejs');
|
20
19
|
var amis = require('amis');
|
21
20
|
var Select = require('amis-ui/lib/components/Select');
|
22
21
|
var amisEditorCore = require('amis-editor-core');
|
23
|
-
var debounce = require('lodash/debounce');
|
24
22
|
var i18nRuntime = require('i18n-runtime');
|
25
23
|
|
26
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -30,158 +28,20 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
28
|
var DeepDiff__default = /*#__PURE__*/_interopDefaultLegacy(DeepDiff);
|
31
29
|
var uniqBy__default = /*#__PURE__*/_interopDefaultLegacy(uniqBy);
|
32
30
|
var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit);
|
33
|
-
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
34
31
|
var Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
|
35
|
-
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
36
32
|
|
37
33
|
/**
|
38
34
|
* @file 组件选项组件的可视化编辑控件
|
39
35
|
*/
|
40
|
-
var
|
41
|
-
tslib.__extends(
|
42
|
-
function
|
43
|
-
|
44
|
-
_this.internalProps = ['checked', 'editing'];
|
45
|
-
var source = 'custom';
|
46
|
-
if (props.data.hasOwnProperty('source') && props.data.source) {
|
47
|
-
var api = props.data.source;
|
48
|
-
var url = typeof api === 'string' ? api : typeof api === 'object' ? api.url || '' : '';
|
49
|
-
source = /\$\{(.*?)\}/g.test(props.data.source) ? 'variable' : !url.indexOf('api://') ? 'apicenter' : 'api';
|
50
|
-
}
|
51
|
-
_this.state = {
|
52
|
-
options: _this.transformOptions(props) || [],
|
53
|
-
api: props.data.source,
|
54
|
-
labelField: props.data.labelField,
|
55
|
-
valueField: props.data.valueField,
|
56
|
-
source: source
|
57
|
-
};
|
58
|
-
return _this;
|
36
|
+
var CustomOptionControl = /** @class */function (_super) {
|
37
|
+
tslib.__extends(CustomOptionControl, _super);
|
38
|
+
function CustomOptionControl() {
|
39
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
59
40
|
}
|
60
|
-
|
61
|
-
* 数据更新
|
62
|
-
*/
|
63
|
-
OptionControl.prototype.componentWillReceiveProps = function (nextProps) {
|
64
|
-
var options = get__default["default"](nextProps, 'data.options');
|
65
|
-
// 左侧code手动更新时,同步配置面板
|
66
|
-
if (DeepDiff__default["default"].diff(options, this.lastOptions)) {
|
67
|
-
this.setState({
|
68
|
-
options: this.transformOptions(nextProps)
|
69
|
-
});
|
70
|
-
}
|
71
|
-
};
|
72
|
-
OptionControl.prototype.transformOptions = function (props) {
|
73
|
-
var ctx = props.data,
|
74
|
-
options = props.value;
|
75
|
-
var defaultValue = ctx.value;
|
76
|
-
var valueArray = Select.value2array(defaultValue, ctx).map(function (item) {
|
77
|
-
var _a;
|
78
|
-
return item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'];
|
79
|
-
});
|
80
|
-
return Array.isArray(options) ? options.map(function (item) {
|
81
|
-
var _a;
|
82
|
-
return tslib.__assign(tslib.__assign(tslib.__assign({
|
83
|
-
label: item.label,
|
84
|
-
// 为了使用户编写label时同时生效到value
|
85
|
-
value: item.label === item.value ? null : item.value,
|
86
|
-
checked: !!~valueArray.indexOf(item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'])
|
87
|
-
}, (item === null || item === void 0 ? void 0 : item.badge) ? {
|
88
|
-
badge: item.badge
|
89
|
-
} : {}), item.hidden !== undefined ? {
|
90
|
-
hidden: item.hidden
|
91
|
-
} : {}), item.hiddenOn !== undefined ? {
|
92
|
-
hiddenOn: item.hiddenOn
|
93
|
-
} : {});
|
94
|
-
}) : [];
|
95
|
-
};
|
96
|
-
/**
|
97
|
-
* 处理当前组件的默认值
|
98
|
-
*/
|
99
|
-
OptionControl.prototype.normalizeValue = function () {
|
100
|
-
var _this = this;
|
101
|
-
var _a = this.props,
|
102
|
-
_b = _a.data,
|
103
|
-
ctx = _b === void 0 ? {} : _b,
|
104
|
-
multipleProps = _a.multiple;
|
105
|
-
var _c = ctx.joinValues,
|
106
|
-
joinValues = _c === void 0 ? true : _c,
|
107
|
-
extractValue = ctx.extractValue,
|
108
|
-
multiple = ctx.multiple,
|
109
|
-
delimiter = ctx.delimiter,
|
110
|
-
valueField = ctx.valueField;
|
111
|
-
var checkedOptions = this.state.options.filter(function (item) {
|
112
|
-
return item.checked && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
|
113
|
-
}).map(function (item) {
|
114
|
-
return omit__default["default"](item, _this.internalProps);
|
115
|
-
});
|
116
|
-
var value;
|
117
|
-
if (!checkedOptions.length) {
|
118
|
-
return undefined;
|
119
|
-
}
|
120
|
-
if (multiple || multipleProps) {
|
121
|
-
value = checkedOptions;
|
122
|
-
if (joinValues) {
|
123
|
-
value = checkedOptions.map(function (item) {
|
124
|
-
return item[valueField || 'value'] || item[valueField || 'label'];
|
125
|
-
}).join(delimiter || ',');
|
126
|
-
} else if (extractValue) {
|
127
|
-
value = checkedOptions.map(function (item) {
|
128
|
-
return item[valueField || 'value'] || item[valueField || 'label'];
|
129
|
-
});
|
130
|
-
}
|
131
|
-
} else {
|
132
|
-
value = checkedOptions[0];
|
133
|
-
if (joinValues || extractValue) {
|
134
|
-
value = value[valueField || 'value'] || value[valueField || 'label'];
|
135
|
-
}
|
136
|
-
}
|
137
|
-
return value;
|
138
|
-
};
|
139
|
-
/**
|
140
|
-
* 更新options字段的统一出口
|
141
|
-
*/
|
142
|
-
OptionControl.prototype.onChange = function () {
|
143
|
-
var _a = this.state,
|
144
|
-
source = _a.source,
|
145
|
-
options = _a.options;
|
146
|
-
var onBulkChange = this.props.onBulkChange;
|
147
|
-
var defaultValue = this.normalizeValue();
|
148
|
-
var data = {
|
149
|
-
source: undefined,
|
150
|
-
options: undefined,
|
151
|
-
labelField: undefined,
|
152
|
-
valueField: undefined
|
153
|
-
};
|
154
|
-
if (source === 'custom') {
|
155
|
-
data.options = options.map(function (item) {
|
156
|
-
return tslib.__assign(tslib.__assign(tslib.__assign({}, (item === null || item === void 0 ? void 0 : item.badge) ? {
|
157
|
-
badge: item.badge
|
158
|
-
} : {}), {
|
159
|
-
label: item.label,
|
160
|
-
value: item.value == null || item.value === '' ? item.label : item.value
|
161
|
-
}), item.hiddenOn !== undefined ? {
|
162
|
-
hiddenOn: item.hiddenOn
|
163
|
-
} : {});
|
164
|
-
});
|
165
|
-
data.value = defaultValue;
|
166
|
-
this.lastOptions = data.options;
|
167
|
-
}
|
168
|
-
if (source === 'api' || source === 'apicenter' || source === 'variable') {
|
169
|
-
var _b = this.state,
|
170
|
-
api = _b.api,
|
171
|
-
labelField = _b.labelField,
|
172
|
-
valueField = _b.valueField;
|
173
|
-
data.source = api;
|
174
|
-
data.labelField = labelField || undefined;
|
175
|
-
data.valueField = valueField || undefined;
|
176
|
-
this.lastOptions = data.source;
|
177
|
-
}
|
178
|
-
onBulkChange && onBulkChange(data);
|
179
|
-
return;
|
180
|
-
};
|
181
|
-
OptionControl.prototype.targetRef = function (ref) {
|
41
|
+
CustomOptionControl.prototype.targetRef = function (ref) {
|
182
42
|
this.target = ref ? reactDom.findDOMNode(ref) : null;
|
183
43
|
};
|
184
|
-
|
44
|
+
CustomOptionControl.prototype.dragRef = function (ref) {
|
185
45
|
if (!this.drag && ref) {
|
186
46
|
this.initDragging();
|
187
47
|
} else if (this.drag && !ref) {
|
@@ -189,8 +49,9 @@ var OptionControl = /** @class */function (_super) {
|
|
189
49
|
}
|
190
50
|
this.drag = ref;
|
191
51
|
};
|
192
|
-
|
52
|
+
CustomOptionControl.prototype.initDragging = function () {
|
193
53
|
var _this = this;
|
54
|
+
var onChange = this.props.onChange;
|
194
55
|
var dom = reactDom.findDOMNode(this);
|
195
56
|
this.sortable = new Sortable__default["default"](dom.querySelector('.ae-OptionControl-content'), {
|
196
57
|
group: 'OptionControlGroup',
|
@@ -209,56 +70,39 @@ var OptionControl = /** @class */function (_super) {
|
|
209
70
|
} else {
|
210
71
|
parent.appendChild(e.item);
|
211
72
|
}
|
212
|
-
var options = _this.
|
73
|
+
var options = _this.props.options.concat();
|
213
74
|
options.splice(e.newIndex, 0, options.splice(e.oldIndex, 1)[0]);
|
214
|
-
|
75
|
+
onChange({
|
215
76
|
options: options
|
216
|
-
}, function () {
|
217
|
-
return _this.onChange();
|
218
77
|
});
|
219
78
|
}
|
220
79
|
});
|
221
80
|
};
|
222
|
-
|
81
|
+
CustomOptionControl.prototype.destroyDragging = function () {
|
223
82
|
this.sortable && this.sortable.destroy();
|
224
83
|
};
|
225
|
-
OptionControl.prototype.scroll2Bottom = function () {
|
226
|
-
var _a, _b;
|
227
|
-
this.drag && ((_b = (_a = this.drag) === null || _a === void 0 ? void 0 : _a.lastElementChild) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
|
228
|
-
behavior: 'smooth',
|
229
|
-
block: 'nearest',
|
230
|
-
inline: 'start'
|
231
|
-
}));
|
232
|
-
};
|
233
|
-
/**
|
234
|
-
* 切换选项类型
|
235
|
-
*/
|
236
|
-
OptionControl.prototype.handleSourceChange = function (source) {
|
237
|
-
this.setState({
|
238
|
-
api: '',
|
239
|
-
source: source
|
240
|
-
}, this.onChange);
|
241
|
-
};
|
242
84
|
/**
|
243
85
|
* 删除选项
|
244
86
|
*/
|
245
|
-
|
246
|
-
var
|
247
|
-
|
87
|
+
CustomOptionControl.prototype.handleDelete = function (index) {
|
88
|
+
var _a = this.props,
|
89
|
+
onChange = _a.onChange,
|
90
|
+
originOptions = _a.options;
|
91
|
+
var options = originOptions.concat();
|
248
92
|
options.splice(index, 1);
|
249
|
-
|
93
|
+
onChange({
|
250
94
|
options: options
|
251
|
-
}, function () {
|
252
|
-
return _this.onChange();
|
253
95
|
});
|
254
96
|
};
|
255
97
|
/**
|
256
98
|
* 设置默认选项
|
257
99
|
*/
|
258
|
-
|
259
|
-
var _this = this;
|
100
|
+
CustomOptionControl.prototype.handleToggleDefaultValue = function (index, checked, shift) {
|
260
101
|
var _a, _b, _c;
|
261
|
-
var
|
102
|
+
var _d = this.props,
|
103
|
+
onChange = _d.onChange,
|
104
|
+
originOptions = _d.options;
|
105
|
+
var options = originOptions.concat();
|
262
106
|
var isMultiple = ((_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.multiple) || ((_c = this.props) === null || _c === void 0 ? void 0 : _c.multiple);
|
263
107
|
if (isMultiple) {
|
264
108
|
options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
|
@@ -271,92 +115,104 @@ var OptionControl = /** @class */function (_super) {
|
|
271
115
|
});
|
272
116
|
});
|
273
117
|
}
|
274
|
-
|
118
|
+
onChange({
|
275
119
|
options: options
|
276
|
-
}, function () {
|
277
|
-
return _this.onChange();
|
278
120
|
});
|
279
121
|
};
|
280
122
|
/**
|
281
123
|
* 编辑选项
|
282
124
|
*/
|
283
|
-
|
284
|
-
var
|
285
|
-
|
286
|
-
|
125
|
+
CustomOptionControl.prototype.toggleEdit = function (index) {
|
126
|
+
var _a = this.props,
|
127
|
+
onChange = _a.onChange,
|
128
|
+
originOptions = _a.options;
|
129
|
+
var options = originOptions.concat();
|
130
|
+
options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
|
131
|
+
editing: !options[index].editing
|
132
|
+
}));
|
133
|
+
onChange({
|
287
134
|
options: options
|
288
135
|
});
|
289
136
|
};
|
290
137
|
/**
|
291
138
|
* 编辑角标
|
292
139
|
*/
|
293
|
-
|
294
|
-
var
|
295
|
-
|
296
|
-
|
297
|
-
|
140
|
+
CustomOptionControl.prototype.toggleBadge = function (index, value) {
|
141
|
+
var _a = this.props,
|
142
|
+
onChange = _a.onChange,
|
143
|
+
originOptions = _a.options;
|
144
|
+
var options = originOptions.concat();
|
145
|
+
options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
|
146
|
+
badge: value
|
147
|
+
}));
|
148
|
+
onChange({
|
298
149
|
options: options
|
299
|
-
}, function () {
|
300
|
-
return _this.onChange();
|
301
150
|
});
|
302
151
|
};
|
303
|
-
|
304
|
-
var
|
305
|
-
|
152
|
+
CustomOptionControl.prototype.handleEditLabel = function (index, value) {
|
153
|
+
var _a = this.props,
|
154
|
+
onChange = _a.onChange,
|
155
|
+
originOptions = _a.options;
|
156
|
+
var options = originOptions.concat();
|
306
157
|
options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
|
307
158
|
label: value
|
308
159
|
}));
|
309
|
-
|
160
|
+
onChange({
|
310
161
|
options: options
|
311
|
-
}, function () {
|
312
|
-
return _this.onChange();
|
313
162
|
});
|
314
163
|
};
|
315
|
-
|
316
|
-
var
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
hiddenOn
|
323
|
-
})
|
324
|
-
|
164
|
+
CustomOptionControl.prototype.handleHiddenValueChange = function (index, value) {
|
165
|
+
var _a = this.props,
|
166
|
+
onChange = _a.onChange,
|
167
|
+
originOptions = _a.options;
|
168
|
+
var options = originOptions.concat();
|
169
|
+
var _b = options[index];
|
170
|
+
_b.hiddenOn;
|
171
|
+
var option = tslib.__rest(_b, ["hiddenOn"]);
|
172
|
+
var newOption = tslib.__assign({}, option);
|
173
|
+
if (value) {
|
174
|
+
newOption.hiddenOn = value;
|
175
|
+
} else {
|
176
|
+
delete newOption.hiddenOn;
|
177
|
+
}
|
178
|
+
options.splice(index, 1, newOption);
|
179
|
+
onChange({
|
325
180
|
options: options
|
326
|
-
}, function () {
|
327
|
-
return _this.onChange();
|
328
181
|
});
|
329
182
|
};
|
330
|
-
|
331
|
-
var
|
332
|
-
|
183
|
+
CustomOptionControl.prototype.handleAdd = function () {
|
184
|
+
var _a = this.props,
|
185
|
+
onChange = _a.onChange,
|
186
|
+
originOptions = _a.options;
|
187
|
+
var options = originOptions.concat();
|
333
188
|
options.push({
|
334
189
|
label: '',
|
335
190
|
value: null,
|
336
191
|
checked: false
|
337
192
|
});
|
338
|
-
|
193
|
+
onChange({
|
339
194
|
options: options
|
340
|
-
}, function () {
|
341
|
-
_this.onChange();
|
342
195
|
});
|
343
196
|
};
|
344
|
-
|
345
|
-
var
|
346
|
-
|
197
|
+
CustomOptionControl.prototype.handleValueChange = function (index, value) {
|
198
|
+
var _a = this.props,
|
199
|
+
onChange = _a.onChange,
|
200
|
+
originOptions = _a.options;
|
201
|
+
var options = originOptions.concat();
|
347
202
|
options[index].value = value;
|
348
|
-
|
203
|
+
onChange({
|
349
204
|
options: options
|
350
|
-
}, function () {
|
351
|
-
return _this.onChange();
|
352
205
|
});
|
353
206
|
};
|
354
|
-
|
355
|
-
var
|
356
|
-
|
207
|
+
CustomOptionControl.prototype.handleBatchAdd = function (values, action) {
|
208
|
+
var _a = this.props,
|
209
|
+
onChange = _a.onChange,
|
210
|
+
_b = _a.customEdit,
|
211
|
+
customEdit = _b === void 0 ? true : _b;
|
212
|
+
var options = this.props.data.options || [];
|
357
213
|
var addedOptions = values[0].batchOption.split('\n').map(function (option) {
|
358
214
|
var item = option.trim();
|
359
|
-
if (~item.indexOf(' ')) {
|
215
|
+
if (~item.indexOf(' ') && customEdit) {
|
360
216
|
var _a = tslib.__read(item.split(' '), 2),
|
361
217
|
label = _a[0],
|
362
218
|
value = _a[1];
|
@@ -373,90 +229,24 @@ var OptionControl = /** @class */function (_super) {
|
|
373
229
|
};
|
374
230
|
});
|
375
231
|
var newOptions = uniqBy__default["default"](tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(options), false), tslib.__read(addedOptions), false), 'value');
|
376
|
-
|
232
|
+
onChange({
|
377
233
|
options: newOptions
|
378
|
-
}, function () {
|
379
|
-
return _this.onChange();
|
380
234
|
});
|
381
235
|
};
|
382
|
-
|
383
|
-
var _this = this;
|
384
|
-
var _a;
|
385
|
-
var _b = this.props,
|
386
|
-
render = _b.render,
|
387
|
-
label = _b.label,
|
388
|
-
labelRemark = _b.labelRemark,
|
389
|
-
useMobileUI = _b.useMobileUI,
|
390
|
-
env = _b.env,
|
391
|
-
popOverContainer = _b.popOverContainer,
|
392
|
-
hasApiCenter = _b.hasApiCenter;
|
393
|
-
var classPrefix = (_a = env === null || env === void 0 ? void 0 : env.theme) === null || _a === void 0 ? void 0 : _a.classPrefix;
|
394
|
-
var source = this.state.source;
|
395
|
-
var optionSourceList = tslib.__spreadArray(tslib.__spreadArray([{
|
396
|
-
label: i18nRuntime.i18n("01820262aa9ad5b130f8f5b86bfd2968"),
|
397
|
-
value: 'custom'
|
398
|
-
}, {
|
399
|
-
label: i18nRuntime.i18n("f99603414a616bdee85de0e6e3938b65"),
|
400
|
-
value: 'api'
|
401
|
-
}], tslib.__read(hasApiCenter ? [{
|
402
|
-
label: i18nRuntime.i18n("e6ff6a97bf600c02942db3126a7077b8"),
|
403
|
-
value: 'apicenter'
|
404
|
-
}] : []), false), [{
|
405
|
-
label: i18nRuntime.i18n("50334fc77fc5a2c2636f14f158d3c417"),
|
406
|
-
value: 'variable'
|
407
|
-
}
|
408
|
-
// {
|
409
|
-
// label: '表单实体',
|
410
|
-
// value: 'form'
|
411
|
-
// }
|
412
|
-
], false).map(function (item) {
|
413
|
-
return tslib.__assign(tslib.__assign({}, item), {
|
414
|
-
onClick: function () {
|
415
|
-
return _this.handleSourceChange(item.value);
|
416
|
-
}
|
417
|
-
});
|
418
|
-
});
|
419
|
-
return React__default["default"].createElement("header", {
|
420
|
-
className: "ae-OptionControl-header"
|
421
|
-
}, React__default["default"].createElement("label", {
|
422
|
-
className: cx__default["default"]("".concat(classPrefix, "Form-label"))
|
423
|
-
}, label || '', labelRemark ? render('label-remark', {
|
424
|
-
type: 'remark',
|
425
|
-
icon: labelRemark.icon || 'warning-mark',
|
426
|
-
tooltip: labelRemark,
|
427
|
-
className: cx__default["default"]("Form-lableRemark", labelRemark === null || labelRemark === void 0 ? void 0 : labelRemark.className),
|
428
|
-
useMobileUI: useMobileUI,
|
429
|
-
container: popOverContainer || env.getModalContainer
|
430
|
-
}) : null), React__default["default"].createElement("div", null, render('validation-control-addBtn', {
|
431
|
-
type: 'dropdown-button',
|
432
|
-
level: 'link',
|
433
|
-
size: 'sm',
|
434
|
-
label: '${selected}',
|
435
|
-
align: 'right',
|
436
|
-
closeOnClick: true,
|
437
|
-
closeOnOutside: true,
|
438
|
-
buttons: optionSourceList
|
439
|
-
}, {
|
440
|
-
popOverContainer: null,
|
441
|
-
data: {
|
442
|
-
selected: optionSourceList.find(function (item) {
|
443
|
-
return item.value === source;
|
444
|
-
}).label
|
445
|
-
}
|
446
|
-
})));
|
447
|
-
};
|
448
|
-
OptionControl.prototype.renderOption = function (props) {
|
236
|
+
CustomOptionControl.prototype.renderOption = function (props) {
|
449
237
|
var _this = this;
|
450
238
|
var checked = props.checked,
|
451
239
|
index = props.index,
|
452
240
|
editing = props.editing,
|
453
241
|
multipleProps = props.multipleProps,
|
454
242
|
closeDefaultCheck = props.closeDefaultCheck,
|
455
|
-
hiddenOn = props.hiddenOn
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
243
|
+
hiddenOn = props.hiddenOn,
|
244
|
+
_a = props.customEdit,
|
245
|
+
customEdit = _a === void 0 ? true : _a;
|
246
|
+
var _b = this.props,
|
247
|
+
render = _b.render,
|
248
|
+
ctx = _b.data,
|
249
|
+
node = _b.node;
|
460
250
|
var isMultiple = (ctx === null || ctx === void 0 ? void 0 : ctx.multiple) === true || multipleProps;
|
461
251
|
var i18nEnabled = amisEditorCore.getI18nEnabled();
|
462
252
|
var showBadge = node.type === 'button-group-select';
|
@@ -475,47 +265,86 @@ var OptionControl = /** @class */function (_super) {
|
|
475
265
|
return _this.toggleEdit(index);
|
476
266
|
}
|
477
267
|
}, {
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
268
|
+
children: function (_a) {
|
269
|
+
var render = _a.render,
|
270
|
+
innerValue = _a.innerValue;
|
271
|
+
return render('innerLabel', {
|
272
|
+
name: 'label',
|
273
|
+
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
|
274
|
+
placeholder: i18nRuntime.i18n("b4fdf79b8f54856b072ec3874b830d1f"),
|
275
|
+
label: i18nRuntime.i18n("97d07614380da93d257f9fbf81aa56fb"),
|
276
|
+
mode: 'horizontal',
|
277
|
+
labelClassName: 'ae-OptionControlItem-EditLabel',
|
278
|
+
valueClassName: 'ae-OptionControlItem-EditValue'
|
279
|
+
}, {
|
280
|
+
value: innerValue.label || '',
|
281
|
+
onChange: function (v) {
|
282
|
+
return _this.handleEditLabel(index, v);
|
283
|
+
}
|
284
|
+
});
|
487
285
|
}
|
488
286
|
}, {
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
287
|
+
children: function (_a) {
|
288
|
+
var render = _a.render,
|
289
|
+
innerValue = _a.innerValue;
|
290
|
+
return render('innerValue', {
|
291
|
+
name: 'value',
|
292
|
+
type: 'ae-valueFormat',
|
293
|
+
placeholder: i18nRuntime.i18n("f4ab507e2fa2d2bd66bcdeafd9fef797"),
|
294
|
+
labelClassName: 'ae-OptionControlItem-EditLabel',
|
295
|
+
valueClassName: 'ae-OptionControlItem-EditValue',
|
296
|
+
label: i18nRuntime.i18n("fe7509e0ed085b86f07e3e9975cc5b3d")
|
297
|
+
}, {
|
298
|
+
value: (innerValue === null || innerValue === void 0 ? void 0 : innerValue.value) || '',
|
299
|
+
onChange: function (v) {
|
300
|
+
return _this.handleValueChange(index, v);
|
301
|
+
}
|
302
|
+
});
|
497
303
|
}
|
498
|
-
},
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
304
|
+
}, {
|
305
|
+
children: function (_a) {
|
306
|
+
var render = _a.render,
|
307
|
+
innerValue = _a.innerValue;
|
308
|
+
return render('innerHiddenOn', amisEditorCore.getSchemaTpl('expressionFormulaControl', {
|
309
|
+
label: i18nRuntime.i18n("dce5379cb978a8259ecfca8f08f00817"),
|
310
|
+
name: 'hiddenOn',
|
311
|
+
labelClassName: 'ae-OptionControlItem-EditLabel',
|
312
|
+
valueClassName: 'ae-OptionControlItem-EditValue'
|
313
|
+
}), {
|
314
|
+
value: innerValue.hiddenOn || '',
|
315
|
+
onChange: function (v) {
|
316
|
+
return _this.handleHiddenValueChange(index, v);
|
317
|
+
}
|
318
|
+
});
|
505
319
|
}
|
506
|
-
}
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
320
|
+
}, {
|
321
|
+
children: function (_a) {
|
322
|
+
var render = _a.render,
|
323
|
+
innerValue = _a.innerValue;
|
324
|
+
return render('innerBadge', {
|
325
|
+
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
|
326
|
+
placeholder: i18nRuntime.i18n("7f05bea37729325a6cc84eb26bb9f8c8"),
|
327
|
+
label: i18nRuntime.i18n("b8c467fce096a649583c0bc9d9281a5c"),
|
328
|
+
mode: 'horizontal',
|
329
|
+
name: 'badge',
|
330
|
+
visible: showBadge,
|
331
|
+
labelClassName: 'ae-OptionControlItem-EditLabel',
|
332
|
+
valueClassName: 'ae-OptionControlItem-EditValue'
|
333
|
+
}, {
|
334
|
+
value: innerValue.badge || '',
|
335
|
+
onChange: function (v) {
|
336
|
+
return _this.toggleBadge(index, v);
|
337
|
+
}
|
338
|
+
});
|
517
339
|
}
|
518
340
|
}]
|
341
|
+
}, {
|
342
|
+
innerValue: {
|
343
|
+
label: props.label,
|
344
|
+
value: props.value,
|
345
|
+
badge: props.badge,
|
346
|
+
hiddenOn: hiddenOn
|
347
|
+
}
|
519
348
|
})) : null;
|
520
349
|
var operationBtn = [{
|
521
350
|
type: 'button',
|
@@ -566,16 +395,20 @@ var OptionControl = /** @class */function (_super) {
|
|
566
395
|
onChange: function (newChecked, shift) {
|
567
396
|
return _this.handleToggleDefaultValue(index, newChecked, shift);
|
568
397
|
}
|
569
|
-
})),
|
398
|
+
})), render('label', {
|
399
|
+
name: 'label',
|
570
400
|
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
|
401
|
+
label: false,
|
571
402
|
className: 'ae-OptionControlItem-input',
|
572
|
-
value: props === null || props === void 0 ? void 0 : props.label,
|
573
403
|
placeholder: i18nRuntime.i18n("5d26b8a41e805204c9dcd5ea7e23b150"),
|
574
|
-
clearable: false
|
404
|
+
clearable: false
|
405
|
+
}, {
|
406
|
+
value: (props === null || props === void 0 ? void 0 : props.label) || '',
|
407
|
+
disabled: editing,
|
575
408
|
onChange: function (value) {
|
576
409
|
_this.handleEditLabel(index, value);
|
577
410
|
}
|
578
|
-
}), render('dropdown', {
|
411
|
+
}), customEdit ? render('dropdown', {
|
579
412
|
type: 'dropdown-button',
|
580
413
|
className: 'ae-OptionControlItem-dropdown',
|
581
414
|
btnClassName: 'px-2',
|
@@ -587,9 +420,19 @@ var OptionControl = /** @class */function (_super) {
|
|
587
420
|
buttons: operationBtn
|
588
421
|
}, {
|
589
422
|
popOverContainer: null // amis 渲染挂载节点会使用 this.target
|
423
|
+
}) : render('delete', {
|
424
|
+
type: 'button',
|
425
|
+
className: 'ae-OptionControlItem-action-delete',
|
426
|
+
icon: 'fa fa-trash',
|
427
|
+
level: 'link',
|
428
|
+
onClick: function () {
|
429
|
+
return _this.handleDelete(index);
|
430
|
+
}
|
590
431
|
})), editDom);
|
591
432
|
};
|
592
|
-
|
433
|
+
CustomOptionControl.prototype.buildBatchAddSchema = function () {
|
434
|
+
var _a = this.props.customEdit,
|
435
|
+
customEdit = _a === void 0 ? true : _a;
|
593
436
|
return {
|
594
437
|
type: 'action',
|
595
438
|
actionType: 'dialog',
|
@@ -606,7 +449,7 @@ var OptionControl = /** @class */function (_super) {
|
|
606
449
|
level: 'warning',
|
607
450
|
body: [{
|
608
451
|
type: 'tpl',
|
609
|
-
tpl:
|
452
|
+
tpl: '每个选项单列一行,将所有值不重复的项加为新的选项;' + (customEdit ? '<br/>每行可通过空格来分别设置label和value,例:"张三 zhangsan"' : '')
|
610
453
|
}],
|
611
454
|
showIcon: true,
|
612
455
|
className: 'mb-2.5'
|
@@ -636,79 +479,19 @@ var OptionControl = /** @class */function (_super) {
|
|
636
479
|
}
|
637
480
|
};
|
638
481
|
};
|
639
|
-
|
640
|
-
this.setState({
|
641
|
-
api: source
|
642
|
-
}, this.onChange);
|
643
|
-
};
|
644
|
-
OptionControl.prototype.handleLableFieldChange = function (labelField) {
|
645
|
-
this.setState({
|
646
|
-
labelField: labelField
|
647
|
-
}, this.onChange);
|
648
|
-
};
|
649
|
-
OptionControl.prototype.handleValueFieldChange = function (valueField) {
|
650
|
-
this.setState({
|
651
|
-
valueField: valueField
|
652
|
-
}, this.onChange);
|
653
|
-
};
|
654
|
-
/** 获取功能性字段控件 schema */
|
655
|
-
OptionControl.prototype.getFuncFieldSchema = function () {
|
656
|
-
var _a = this.state,
|
657
|
-
labelField = _a.labelField,
|
658
|
-
valueField = _a.valueField;
|
659
|
-
return [{
|
660
|
-
label: amisEditorCore.tipedLabel(i18nRuntime.i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18nRuntime.i18n("26ff46d82166741297ce666b2792af85")),
|
661
|
-
type: 'input-text',
|
662
|
-
name: 'labelField',
|
663
|
-
clearable: true,
|
664
|
-
value: labelField,
|
665
|
-
placeholder: i18nRuntime.i18n("6d4ce0631f37676a887c9599691fabec"),
|
666
|
-
onChange: this.handleLableFieldChange
|
667
|
-
}, {
|
668
|
-
label: i18nRuntime.i18n("2e01f5f5889e33d003bec7857cd38445"),
|
669
|
-
type: 'input-text',
|
670
|
-
name: 'valueField',
|
671
|
-
clearable: true,
|
672
|
-
value: valueField,
|
673
|
-
placeholder: i18nRuntime.i18n("959c27193eb0a41d01f4b53dcc4b9245"),
|
674
|
-
onChange: this.handleValueFieldChange
|
675
|
-
}];
|
676
|
-
};
|
677
|
-
OptionControl.prototype.renderApiPanel = function () {
|
678
|
-
var render = this.props.render;
|
679
|
-
var _a = this.state,
|
680
|
-
source = _a.source,
|
681
|
-
api = _a.api;
|
682
|
-
return render('api', amisEditorCore.getSchemaTpl('apiControl', {
|
683
|
-
label: i18nRuntime.i18n("54ea89b497ec3bb319c68844dfa3687f"),
|
684
|
-
name: 'source',
|
685
|
-
mode: 'normal',
|
686
|
-
className: 'ae-ExtendMore',
|
687
|
-
visibleOn: 'data.autoComplete !== false',
|
688
|
-
value: api,
|
689
|
-
onChange: this.handleAPIChange,
|
690
|
-
sourceType: source,
|
691
|
-
footer: this.getFuncFieldSchema()
|
692
|
-
}));
|
693
|
-
};
|
694
|
-
OptionControl.prototype.render = function () {
|
482
|
+
CustomOptionControl.prototype.render = function () {
|
695
483
|
var _this = this;
|
696
|
-
var _a = this.
|
484
|
+
var _a = this.props,
|
697
485
|
options = _a.options,
|
698
|
-
|
699
|
-
|
700
|
-
render = _b.render,
|
701
|
-
className = _b.className,
|
702
|
-
multipleProps = _b.multiple;
|
486
|
+
multipleProps = _a.multiple,
|
487
|
+
render = _a.render;
|
703
488
|
return React__default["default"].createElement("div", {
|
704
|
-
className: cx__default["default"]('ae-OptionControl', className)
|
705
|
-
}, this.renderHeader(), source === 'custom' ? React__default["default"].createElement("div", {
|
706
489
|
className: "ae-OptionControl-wrapper"
|
707
490
|
}, Array.isArray(options) && options.length ? React__default["default"].createElement("ul", {
|
708
491
|
className: "ae-OptionControl-content",
|
709
492
|
ref: this.dragRef
|
710
493
|
}, options.map(function (option, index) {
|
711
|
-
return _this.renderOption(tslib.__assign(tslib.__assign({}, option), {
|
494
|
+
return _this.renderOption(tslib.__assign(tslib.__assign(tslib.__assign({}, _this.props), option), {
|
712
495
|
index: index,
|
713
496
|
multipleProps: multipleProps
|
714
497
|
}));
|
@@ -720,26 +503,453 @@ var OptionControl = /** @class */function (_super) {
|
|
720
503
|
level: "enhance",
|
721
504
|
onClick: this.handleAdd,
|
722
505
|
ref: this.targetRef
|
723
|
-
}, i18nRuntime.i18n("e8755fb1e985a5d26df0fce1f0b7b0f8")), render('inner', this.buildBatchAddSchema())))
|
506
|
+
}, i18nRuntime.i18n("e8755fb1e985a5d26df0fce1f0b7b0f8")), render('inner', this.buildBatchAddSchema())));
|
507
|
+
};
|
508
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "targetRef", null);
|
509
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "dragRef", null);
|
510
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleEditLabel", null);
|
511
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleHiddenValueChange", null);
|
512
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleAdd", null);
|
513
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Array, Object]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleBatchAdd", null);
|
514
|
+
return CustomOptionControl;
|
515
|
+
}(React__default["default"].Component);
|
516
|
+
// 负责 api 和 apicenter 的配置
|
517
|
+
function APIOptionControl(_a) {
|
518
|
+
var render = _a.render,
|
519
|
+
source = _a.source,
|
520
|
+
api = _a.api,
|
521
|
+
onChange = _a.onChange,
|
522
|
+
labelField = _a.labelField,
|
523
|
+
valueField = _a.valueField;
|
524
|
+
var handleAPIChange = React__default["default"].useCallback(function (source) {
|
525
|
+
onChange({
|
526
|
+
api: source
|
527
|
+
});
|
528
|
+
}, []);
|
529
|
+
var handleLabelFieldChange = React__default["default"].useCallback(function (value) {
|
530
|
+
onChange({
|
531
|
+
labelField: value
|
532
|
+
});
|
533
|
+
}, []);
|
534
|
+
var handleValueFieldChange = React__default["default"].useCallback(function (value) {
|
535
|
+
onChange({
|
536
|
+
valueField: value
|
537
|
+
});
|
538
|
+
}, []);
|
539
|
+
var footer = React__default["default"].useMemo(function () {
|
540
|
+
return [{
|
541
|
+
children: function (_a) {
|
542
|
+
var render = _a.render,
|
543
|
+
labelField = _a.labelField;
|
544
|
+
return render('inner', {
|
545
|
+
label: amisEditorCore.tipedLabel(i18nRuntime.i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18nRuntime.i18n("26ff46d82166741297ce666b2792af85")),
|
546
|
+
type: 'input-text',
|
547
|
+
name: 'labelField',
|
548
|
+
clearable: true,
|
549
|
+
placeholder: i18nRuntime.i18n("6d4ce0631f37676a887c9599691fabec")
|
550
|
+
}, {
|
551
|
+
value: labelField,
|
552
|
+
onChange: handleLabelFieldChange
|
553
|
+
});
|
554
|
+
}
|
555
|
+
}, {
|
556
|
+
children: function (_a) {
|
557
|
+
var render = _a.render,
|
558
|
+
valueField = _a.valueField;
|
559
|
+
return render('inner', {
|
560
|
+
label: i18nRuntime.i18n("2e01f5f5889e33d003bec7857cd38445"),
|
561
|
+
type: 'input-text',
|
562
|
+
name: 'valueField',
|
563
|
+
clearable: true,
|
564
|
+
placeholder: i18nRuntime.i18n("959c27193eb0a41d01f4b53dcc4b9245")
|
565
|
+
}, {
|
566
|
+
value: valueField,
|
567
|
+
onChange: handleValueFieldChange
|
568
|
+
});
|
569
|
+
}
|
570
|
+
}];
|
571
|
+
}, []);
|
572
|
+
var schema = React__default["default"].useMemo(function () {
|
573
|
+
return amisEditorCore.getSchemaTpl('apiControl', {
|
574
|
+
label: i18nRuntime.i18n("54ea89b497ec3bb319c68844dfa3687f"),
|
575
|
+
name: 'source',
|
576
|
+
mode: 'normal',
|
577
|
+
className: 'ae-ExtendMore',
|
578
|
+
visibleOn: 'this.autoComplete !== false',
|
579
|
+
footer: footer
|
580
|
+
});
|
581
|
+
}, [footer]);
|
582
|
+
return render('api', schema, {
|
583
|
+
value: api,
|
584
|
+
onChange: handleAPIChange,
|
585
|
+
sourceType: source,
|
586
|
+
labelField: labelField,
|
587
|
+
valueField: valueField
|
588
|
+
});
|
589
|
+
}
|
590
|
+
// 负责上下文变量绑定的配置
|
591
|
+
function variableOptionControl(_a) {
|
592
|
+
var render = _a.render,
|
593
|
+
api = _a.api,
|
594
|
+
onChange = _a.onChange,
|
595
|
+
labelField = _a.labelField,
|
596
|
+
valueField = _a.valueField;
|
597
|
+
var handleAPIChange = React__default["default"].useCallback(function (source) {
|
598
|
+
onChange({
|
599
|
+
api: source
|
600
|
+
});
|
601
|
+
}, []);
|
602
|
+
var handleLabelFieldChange = React__default["default"].useCallback(function (value) {
|
603
|
+
onChange({
|
604
|
+
labelField: value
|
605
|
+
});
|
606
|
+
}, []);
|
607
|
+
var handleValueFieldChange = React__default["default"].useCallback(function (value) {
|
608
|
+
onChange({
|
609
|
+
valueField: value
|
610
|
+
});
|
611
|
+
}, []);
|
612
|
+
var footer = React__default["default"].useMemo(function () {
|
613
|
+
return [{
|
614
|
+
children: function (_a) {
|
615
|
+
var render = _a.render,
|
616
|
+
controlledValue = _a.controlledValue;
|
617
|
+
return render('inner', {
|
618
|
+
label: amisEditorCore.tipedLabel(i18nRuntime.i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18nRuntime.i18n("26ff46d82166741297ce666b2792af85")),
|
619
|
+
type: 'input-text',
|
620
|
+
name: 'labelField',
|
621
|
+
clearable: true,
|
622
|
+
placeholder: i18nRuntime.i18n("6d4ce0631f37676a887c9599691fabec")
|
623
|
+
}, {
|
624
|
+
value: controlledValue.labelField,
|
625
|
+
onChange: handleLabelFieldChange
|
626
|
+
});
|
627
|
+
}
|
628
|
+
}, {
|
629
|
+
children: function (_a) {
|
630
|
+
var render = _a.render,
|
631
|
+
controlledValue = _a.controlledValue;
|
632
|
+
return render('inner', {
|
633
|
+
label: i18nRuntime.i18n("2e01f5f5889e33d003bec7857cd38445"),
|
634
|
+
type: 'input-text',
|
635
|
+
name: 'valueField',
|
636
|
+
clearable: true,
|
637
|
+
placeholder: i18nRuntime.i18n("959c27193eb0a41d01f4b53dcc4b9245")
|
638
|
+
}, {
|
639
|
+
value: controlledValue.valueField,
|
640
|
+
onChange: handleValueFieldChange
|
641
|
+
});
|
642
|
+
}
|
643
|
+
}];
|
644
|
+
}, []);
|
645
|
+
var schema = React__default["default"].useMemo(function () {
|
646
|
+
return {
|
724
647
|
type: 'control',
|
725
648
|
label: false,
|
726
649
|
className: 'ae-ExtendMore',
|
727
|
-
body: [
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
650
|
+
body: [{
|
651
|
+
children: function (_a) {
|
652
|
+
var render = _a.render,
|
653
|
+
controlledValue = _a.controlledValue;
|
654
|
+
return render('inner', amisEditorCore.getSchemaTpl('sourceBindControl', {
|
655
|
+
label: false
|
656
|
+
}), {
|
657
|
+
value: controlledValue.api,
|
658
|
+
onChange: handleAPIChange
|
659
|
+
});
|
660
|
+
}
|
661
|
+
}].concat(footer)
|
662
|
+
};
|
663
|
+
}, [footer]);
|
664
|
+
return render('api', schema, {
|
665
|
+
controlledValue: {
|
666
|
+
api: api,
|
667
|
+
labelField: labelField,
|
668
|
+
valueField: valueField
|
669
|
+
}
|
670
|
+
});
|
671
|
+
}
|
672
|
+
var builtinOptionSource = [{
|
673
|
+
label: i18nRuntime.i18n("01820262aa9ad5b130f8f5b86bfd2968"),
|
674
|
+
value: 'custom',
|
675
|
+
component: CustomOptionControl
|
676
|
+
}, {
|
677
|
+
label: i18nRuntime.i18n("f99603414a616bdee85de0e6e3938b65"),
|
678
|
+
value: 'api',
|
679
|
+
component: APIOptionControl,
|
680
|
+
test: function (_a) {
|
681
|
+
var api = _a.api;
|
682
|
+
var url = amis.normalizeApi(api).url;
|
683
|
+
return !!(typeof url === 'string' && url && !(typeof api === 'string' && /\$\{(.*?)\}/g.test(api)));
|
684
|
+
}
|
685
|
+
}, {
|
686
|
+
label: i18nRuntime.i18n("e6ff6a97bf600c02942db3126a7077b8"),
|
687
|
+
value: 'apicenter',
|
688
|
+
component: APIOptionControl,
|
689
|
+
test: function (_a) {
|
690
|
+
var api = _a.api;
|
691
|
+
var url = amis.normalizeApi(api).url;
|
692
|
+
return typeof url === 'string' && url.startsWith('api://');
|
693
|
+
}
|
694
|
+
}, {
|
695
|
+
label: i18nRuntime.i18n("50334fc77fc5a2c2636f14f158d3c417"),
|
696
|
+
value: 'variable',
|
697
|
+
component: variableOptionControl,
|
698
|
+
test: function (_a) {
|
699
|
+
var api = _a.api;
|
700
|
+
return typeof api === 'string' && /\$\{(.*?)\}/g.test(api);
|
701
|
+
}
|
702
|
+
}];
|
703
|
+
var OptionControl = /** @class */function (_super) {
|
704
|
+
tslib.__extends(OptionControl, _super);
|
705
|
+
function OptionControl(props) {
|
706
|
+
var _this = _super.call(this, props) || this;
|
707
|
+
_this.internalProps = ['checked', 'editing'];
|
708
|
+
_this.optionSources = [];
|
709
|
+
_this.optionSources = builtinOptionSource.concat(Array.isArray(props.extraOptionSources) ? props.extraOptionSources : []);
|
710
|
+
var state = {
|
711
|
+
options: _this.transformOptions(props) || [],
|
712
|
+
api: props.data.source,
|
713
|
+
labelField: props.data.labelField,
|
714
|
+
valueField: props.data.valueField
|
715
|
+
};
|
716
|
+
var source = _this.enabledOptionSources.reduce(function (type, source) {
|
717
|
+
var _a;
|
718
|
+
return type !== null && type !== void 0 ? type : ((_a = source.test) === null || _a === void 0 ? void 0 : _a.call(source, state)) === true ? source.value : type;
|
719
|
+
}, undefined) || 'custom';
|
720
|
+
_this.state = tslib.__assign(tslib.__assign({}, state), {
|
721
|
+
source: source
|
722
|
+
});
|
723
|
+
return _this;
|
724
|
+
}
|
725
|
+
/**
|
726
|
+
* 数据更新
|
727
|
+
*/
|
728
|
+
OptionControl.prototype.componentWillReceiveProps = function (nextProps) {
|
729
|
+
var options = nextProps.data.options;
|
730
|
+
// 左侧code手动更新时,同步配置面板
|
731
|
+
if (DeepDiff__default["default"].diff(options, this.lastOptions)) {
|
732
|
+
this.setState({
|
733
|
+
options: this.transformOptions(nextProps)
|
734
|
+
});
|
735
|
+
}
|
736
|
+
};
|
737
|
+
Object.defineProperty(OptionControl.prototype, "enabledOptionSources", {
|
738
|
+
get: function () {
|
739
|
+
var _a = this.props,
|
740
|
+
hasApiCenter = _a.hasApiCenter,
|
741
|
+
enabledOptionSourceType = _a.enabledOptionSourceType;
|
742
|
+
var options = this.optionSources;
|
743
|
+
if (!hasApiCenter) {
|
744
|
+
options = options.filter(function (item) {
|
745
|
+
return item.value !== 'apicenter';
|
746
|
+
});
|
747
|
+
}
|
748
|
+
if (Array.isArray(enabledOptionSourceType)) {
|
749
|
+
options = enabledOptionSourceType.map(function (type) {
|
750
|
+
return options.find(function (a) {
|
751
|
+
return a.value === type;
|
752
|
+
});
|
753
|
+
}).filter(function (item) {
|
754
|
+
return item;
|
755
|
+
});
|
756
|
+
}
|
757
|
+
return options;
|
758
|
+
},
|
759
|
+
enumerable: false,
|
760
|
+
configurable: true
|
761
|
+
});
|
762
|
+
OptionControl.prototype.transformOptions = function (props) {
|
763
|
+
var ctx = props.data;
|
764
|
+
var options = ctx.options;
|
765
|
+
var defaultValue = ctx.value;
|
766
|
+
var valueArray = Select.value2array(defaultValue, ctx).map(function (item) {
|
767
|
+
var _a;
|
768
|
+
return item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'];
|
769
|
+
});
|
770
|
+
return Array.isArray(options) ? options.map(function (item) {
|
771
|
+
var _a;
|
772
|
+
return tslib.__assign(tslib.__assign(tslib.__assign({
|
773
|
+
label: item.label,
|
774
|
+
// 为了使用户编写label时同时生效到value
|
775
|
+
value: item.label === item.value ? null : item.value,
|
776
|
+
checked: !!~valueArray.indexOf(item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'])
|
777
|
+
}, (item === null || item === void 0 ? void 0 : item.badge) ? {
|
778
|
+
badge: item.badge
|
779
|
+
} : {}), item.hidden !== undefined ? {
|
780
|
+
hidden: item.hidden
|
781
|
+
} : {}), item.hiddenOn !== undefined ? {
|
782
|
+
hiddenOn: item.hiddenOn
|
783
|
+
} : {});
|
784
|
+
}) : [];
|
785
|
+
};
|
786
|
+
/**
|
787
|
+
* 处理当前组件的默认值
|
788
|
+
*/
|
789
|
+
OptionControl.prototype.normalizeValue = function () {
|
790
|
+
var _this = this;
|
791
|
+
var _a = this.props,
|
792
|
+
_b = _a.data,
|
793
|
+
ctx = _b === void 0 ? {} : _b,
|
794
|
+
multipleProps = _a.multiple;
|
795
|
+
var _c = ctx.joinValues,
|
796
|
+
joinValues = _c === void 0 ? true : _c,
|
797
|
+
extractValue = ctx.extractValue,
|
798
|
+
multiple = ctx.multiple,
|
799
|
+
delimiter = ctx.delimiter,
|
800
|
+
valueField = ctx.valueField;
|
801
|
+
var checkedOptions = this.state.options.filter(function (item) {
|
802
|
+
return item.checked && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
|
803
|
+
}).map(function (item) {
|
804
|
+
return omit__default["default"](item, _this.internalProps);
|
805
|
+
});
|
806
|
+
var value;
|
807
|
+
if (!checkedOptions.length) {
|
808
|
+
return undefined;
|
809
|
+
}
|
810
|
+
if (multiple || multipleProps) {
|
811
|
+
value = checkedOptions;
|
812
|
+
if (joinValues) {
|
813
|
+
value = checkedOptions.map(function (item) {
|
814
|
+
return item[valueField || 'value'] || item[valueField || 'label'];
|
815
|
+
}).join(delimiter || ',');
|
816
|
+
} else if (extractValue) {
|
817
|
+
value = checkedOptions.map(function (item) {
|
818
|
+
return item[valueField || 'value'] || item[valueField || 'label'];
|
819
|
+
});
|
820
|
+
}
|
821
|
+
} else {
|
822
|
+
value = checkedOptions[0];
|
823
|
+
if (joinValues || extractValue) {
|
824
|
+
value = value[valueField || 'value'] || value[valueField || 'label'];
|
825
|
+
}
|
826
|
+
}
|
827
|
+
return value;
|
828
|
+
};
|
829
|
+
/**
|
830
|
+
* 更新options字段的统一出口
|
831
|
+
*/
|
832
|
+
OptionControl.prototype.emitChange = function () {
|
833
|
+
var _a = this.state,
|
834
|
+
source = _a.source,
|
835
|
+
options = _a.options;
|
836
|
+
var onBulkChange = this.props.onBulkChange;
|
837
|
+
var defaultValue = this.normalizeValue();
|
838
|
+
var data = {
|
839
|
+
source: undefined,
|
840
|
+
options: undefined,
|
841
|
+
labelField: undefined,
|
842
|
+
valueField: undefined
|
843
|
+
};
|
844
|
+
if (source === 'custom') {
|
845
|
+
data.options = options.map(function (item) {
|
846
|
+
return tslib.__assign(tslib.__assign(tslib.__assign({}, (item === null || item === void 0 ? void 0 : item.badge) ? {
|
847
|
+
badge: item.badge
|
848
|
+
} : {}), {
|
849
|
+
label: item.label,
|
850
|
+
value: item.value == null || item.value === '' ? item.label : item.value
|
851
|
+
}), item.hiddenOn !== undefined ? {
|
852
|
+
hiddenOn: item.hiddenOn
|
853
|
+
} : {});
|
854
|
+
});
|
855
|
+
data.value = defaultValue;
|
856
|
+
this.lastOptions = data.options;
|
857
|
+
}
|
858
|
+
if (source === 'api' || source === 'apicenter' || source === 'variable') {
|
859
|
+
var _b = this.state,
|
860
|
+
api = _b.api,
|
861
|
+
labelField = _b.labelField,
|
862
|
+
valueField = _b.valueField;
|
863
|
+
data.source = api;
|
864
|
+
data.labelField = labelField || undefined;
|
865
|
+
data.valueField = valueField || undefined;
|
866
|
+
this.lastOptions = data.source;
|
867
|
+
}
|
868
|
+
onBulkChange && onBulkChange(data);
|
869
|
+
};
|
870
|
+
/**
|
871
|
+
* 切换选项类型
|
872
|
+
*/
|
873
|
+
OptionControl.prototype.handleSourceChange = function (source) {
|
874
|
+
if (this.state.source === source) {
|
875
|
+
return;
|
876
|
+
}
|
877
|
+
this.setState({
|
878
|
+
api: '',
|
879
|
+
source: source
|
880
|
+
}, this.emitChange);
|
881
|
+
};
|
882
|
+
OptionControl.prototype.handleSourceControlChange = function (value) {
|
883
|
+
this.setState(value, this.emitChange);
|
884
|
+
};
|
885
|
+
OptionControl.prototype.renderHeader = function () {
|
886
|
+
var _this = this;
|
887
|
+
var _a, _b;
|
888
|
+
var _c = this.props,
|
889
|
+
render = _c.render,
|
890
|
+
label = _c.label,
|
891
|
+
labelRemark = _c.labelRemark,
|
892
|
+
useMobileUI = _c.useMobileUI,
|
893
|
+
env = _c.env,
|
894
|
+
popOverContainer = _c.popOverContainer;
|
895
|
+
var classPrefix = (_a = env === null || env === void 0 ? void 0 : env.theme) === null || _a === void 0 ? void 0 : _a.classPrefix;
|
896
|
+
var source = this.state.source;
|
897
|
+
var optionSourceList = this.enabledOptionSources.map(function (item) {
|
898
|
+
return {
|
899
|
+
label: item.label,
|
900
|
+
value: item.value,
|
901
|
+
onClick: function () {
|
902
|
+
return _this.handleSourceChange(item.value);
|
903
|
+
}
|
904
|
+
};
|
905
|
+
});
|
906
|
+
return React__default["default"].createElement("header", {
|
907
|
+
className: "ae-OptionControl-header"
|
908
|
+
}, React__default["default"].createElement("label", {
|
909
|
+
className: cx__default["default"]("".concat(classPrefix, "Form-label"))
|
910
|
+
}, label || '', labelRemark ? render('label-remark', {
|
911
|
+
type: 'remark',
|
912
|
+
icon: labelRemark.icon || 'warning-mark',
|
913
|
+
tooltip: labelRemark,
|
914
|
+
className: cx__default["default"]("Form-lableRemark", labelRemark === null || labelRemark === void 0 ? void 0 : labelRemark.className),
|
915
|
+
useMobileUI: useMobileUI,
|
916
|
+
container: popOverContainer || env.getModalContainer
|
917
|
+
}) : null), React__default["default"].createElement("div", null, render('validation-control-addBtn', {
|
918
|
+
type: 'dropdown-button',
|
919
|
+
level: 'link',
|
920
|
+
size: 'sm',
|
921
|
+
label: '${selected}',
|
922
|
+
align: 'right',
|
923
|
+
closeOnClick: true,
|
924
|
+
closeOnOutside: true,
|
925
|
+
buttons: optionSourceList
|
926
|
+
}, {
|
927
|
+
popOverContainer: null,
|
928
|
+
data: {
|
929
|
+
selected: (_b = optionSourceList.find(function (item) {
|
930
|
+
return item.value === source;
|
931
|
+
})) === null || _b === void 0 ? void 0 : _b.label
|
932
|
+
}
|
933
|
+
})));
|
934
|
+
};
|
935
|
+
OptionControl.prototype.render = function () {
|
936
|
+
var source = this.state.source;
|
937
|
+
var className = this.props.className;
|
938
|
+
var sourceControl = this.optionSources.find(function (item) {
|
939
|
+
return item.value === source;
|
940
|
+
});
|
941
|
+
var sourceControlProps = tslib.__assign(tslib.__assign(tslib.__assign({}, this.props), this.state), {
|
942
|
+
onChange: this.handleSourceControlChange
|
943
|
+
});
|
944
|
+
return React__default["default"].createElement("div", {
|
945
|
+
className: cx__default["default"]('ae-OptionControl', className)
|
946
|
+
}, this.renderHeader(), sourceControl ? sourceControl.component ? React__default["default"].createElement(sourceControl.component, tslib.__assign({}, sourceControlProps, {
|
947
|
+
key: source
|
948
|
+
})) : sourceControl.render(sourceControlProps) : null);
|
732
949
|
};
|
733
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [
|
734
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "dragRef", null);
|
950
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "emitChange", null);
|
735
951
|
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleSourceChange", null);
|
736
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [
|
737
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleHiddenValueChange", null);
|
738
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleAdd", null);
|
739
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Array, Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleBatchAdd", null);
|
740
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleAPIChange", null);
|
741
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleLableFieldChange", null);
|
742
|
-
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleValueFieldChange", null);
|
952
|
+
tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleSourceControlChange", null);
|
743
953
|
return OptionControl;
|
744
954
|
}(React__default["default"].Component);
|
745
955
|
/** @class */(function (_super) {
|
@@ -747,12 +957,11 @@ var OptionControl = /** @class */function (_super) {
|
|
747
957
|
function OptionControlRenderer() {
|
748
958
|
return _super !== null && _super.apply(this, arguments) || this;
|
749
959
|
}
|
750
|
-
OptionControlRenderer = tslib.__decorate([amis.
|
751
|
-
type: 'ae-optionControl'
|
752
|
-
renderLabel: false
|
960
|
+
OptionControlRenderer = tslib.__decorate([amis.Renderer({
|
961
|
+
type: 'ae-optionControl'
|
753
962
|
})], OptionControlRenderer);
|
754
963
|
return OptionControlRenderer;
|
755
964
|
})(OptionControl);
|
756
965
|
|
757
966
|
exports["default"] = OptionControl;
|
758
|
-
window.amisEditorVersionInfo={version:'6.
|
967
|
+
window.amisEditorVersionInfo={version:'6.6.0',buildTime:'2024-07-01'};
|