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