@nocobase/client-v2 2.1.0-beta.22 → 2.1.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Application.d.ts +27 -105
- package/es/BaseApplication.d.ts +176 -0
- package/es/PinnedPluginListContext.d.ts +22 -0
- package/es/Plugin.d.ts +37 -11
- package/es/PluginManager.d.ts +19 -20
- package/es/PluginSettingsManager.d.ts +168 -30
- package/es/RouteRepository.d.ts +124 -0
- package/es/RouterManager.d.ts +18 -13
- package/es/WebSocketClient.d.ts +3 -3
- package/es/acl/ACLProvider.d.ts +81 -0
- package/es/acl/createAclSnippetAllow.d.ts +16 -0
- package/es/acl/index.d.ts +11 -0
- package/es/acl/useAclSnippets.d.ts +16 -0
- package/es/ai/ai-manager.d.ts +15 -0
- package/es/ai/index.d.ts +12 -0
- package/{lib/components → es/ai/skills-manager}/index.d.ts +1 -2
- package/es/ai/skills-manager/types.d.ts +23 -0
- package/es/ai/tools-manager/hooks/context.d.ts +17 -0
- package/es/ai/tools-manager/hooks/index.d.ts +11 -0
- package/es/ai/tools-manager/hooks/provider.d.ts +16 -0
- package/es/ai/tools-manager/index.d.ts +20 -0
- package/es/ai/tools-manager/types.d.ts +90 -0
- package/es/ai/utils.d.ts +10 -0
- package/es/authRedirect.d.ts +63 -0
- package/es/collection-field-interface/CollectionFieldInterface.d.ts +71 -0
- package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +109 -0
- package/es/collection-manager/interfaces/checkbox.d.ts +87 -0
- package/es/collection-manager/interfaces/checkboxGroup.d.ts +138 -0
- package/es/collection-manager/interfaces/collection.d.ts +145 -0
- package/es/collection-manager/interfaces/color.d.ts +62 -0
- package/es/collection-manager/interfaces/createdAt.d.ts +96 -0
- package/es/collection-manager/interfaces/createdBy.d.ts +63 -0
- package/es/collection-manager/interfaces/dateOnly.d.ts +103 -0
- package/es/collection-manager/interfaces/datetime.d.ts +121 -0
- package/es/collection-manager/interfaces/datetimeNoTz.d.ts +121 -0
- package/es/collection-manager/interfaces/email.d.ts +87 -0
- package/es/collection-manager/interfaces/icon.d.ts +44 -0
- package/es/collection-manager/interfaces/id.d.ts +71 -0
- package/es/collection-manager/interfaces/index.d.ts +49 -0
- package/es/collection-manager/interfaces/input.d.ts +187 -0
- package/es/collection-manager/interfaces/integer.d.ts +186 -0
- package/es/collection-manager/interfaces/json.d.ts +62 -0
- package/es/collection-manager/interfaces/linkTo.d.ts +90 -0
- package/es/collection-manager/interfaces/m2m.d.ts +268 -0
- package/es/collection-manager/interfaces/m2o.d.ts +215 -0
- package/es/collection-manager/interfaces/markdown.d.ts +108 -0
- package/es/collection-manager/interfaces/multipleSelect.d.ts +141 -0
- package/es/collection-manager/interfaces/nanoid.d.ts +131 -0
- package/es/collection-manager/interfaces/number.d.ts +187 -0
- package/es/collection-manager/interfaces/o2m.d.ts +243 -0
- package/es/collection-manager/interfaces/o2o.d.ts +621 -0
- package/es/collection-manager/interfaces/password.d.ts +112 -0
- package/es/collection-manager/interfaces/percent.d.ts +157 -0
- package/es/collection-manager/interfaces/phone.d.ts +85 -0
- package/es/collection-manager/interfaces/properties/index.d.ts +145 -0
- package/es/collection-manager/interfaces/properties/operators.d.ts +294 -0
- package/es/collection-manager/interfaces/radioGroup.d.ts +134 -0
- package/es/collection-manager/interfaces/richText.d.ts +110 -0
- package/es/collection-manager/interfaces/select.d.ts +139 -0
- package/es/collection-manager/interfaces/snowflake-id.d.ts +117 -0
- package/es/collection-manager/interfaces/subTable.d.ts +172 -0
- package/es/collection-manager/interfaces/tableoid.d.ts +59 -0
- package/es/collection-manager/interfaces/textarea.d.ts +107 -0
- package/es/collection-manager/interfaces/time.d.ts +64 -0
- package/es/collection-manager/interfaces/types.d.ts +38 -0
- package/es/collection-manager/interfaces/unixTimestamp.d.ts +124 -0
- package/es/collection-manager/interfaces/updatedAt.d.ts +96 -0
- package/es/collection-manager/interfaces/updatedBy.d.ts +63 -0
- package/es/collection-manager/interfaces/url.d.ts +72 -0
- package/es/collection-manager/interfaces/utils/index.d.ts +14 -0
- package/es/collection-manager/interfaces/uuid.d.ts +120 -0
- package/es/components/AppComponents.d.ts +27 -0
- package/es/components/Icon.d.ts +24 -0
- package/es/components/index.d.ts +2 -0
- package/es/css-variable/CSSVariableProvider.d.ts +15 -0
- package/es/flow/FlowModelRepository.d.ts +36 -0
- package/es/flow/FlowPage.d.ts +20 -0
- package/es/flow/actions/aclCheck.d.ts +9 -0
- package/es/flow/actions/aclCheckRefresh.d.ts +9 -0
- package/es/flow/actions/afterSuccess.d.ts +9 -0
- package/es/flow/actions/blockHeight.d.ts +9 -0
- package/es/flow/actions/columnFixed.d.ts +9 -0
- package/es/flow/actions/confirm.d.ts +9 -0
- package/es/flow/actions/customVariable.d.ts +9 -0
- package/es/flow/actions/dataLoadingMode.d.ts +9 -0
- package/es/flow/actions/dataScope.d.ts +9 -0
- package/es/flow/actions/dateTimeFormat.d.ts +9 -0
- package/es/flow/actions/displayFieldComponent.d.ts +19 -0
- package/es/flow/actions/fieldComponent.d.ts +9 -0
- package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
- package/es/flow/actions/formAssignRules.d.ts +9 -0
- package/es/flow/actions/index.d.ts +40 -0
- package/es/flow/actions/layout.d.ts +10 -0
- package/es/flow/actions/linkageRules.d.ts +23 -0
- package/es/flow/actions/linkageRulesRefresh.d.ts +9 -0
- package/es/flow/actions/navigateToURL.d.ts +9 -0
- package/es/flow/actions/numberFormat.d.ts +9 -0
- package/es/flow/actions/openView.d.ts +15 -0
- package/es/flow/actions/overflowMode.d.ts +9 -0
- package/es/flow/actions/pattern.d.ts +9 -0
- package/es/flow/actions/refreshTargetBlocks.d.ts +9 -0
- package/es/flow/actions/renderMode.d.ts +9 -0
- package/es/flow/actions/required.d.ts +9 -0
- package/es/flow/actions/runjs.d.ts +9 -0
- package/es/flow/actions/setTargetDataScope.d.ts +10 -0
- package/es/flow/actions/showMessage.d.ts +9 -0
- package/es/flow/actions/showNotification.d.ts +9 -0
- package/es/flow/actions/sortingRules.d.ts +9 -0
- package/es/flow/actions/titleField.d.ts +9 -0
- package/es/flow/actions/validation.d.ts +9 -0
- package/es/flow/admin-shell/AdminLayoutRouteCoordinator.d.ts +51 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutCompat.d.ts +112 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutComponent.d.ts +10 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.d.ts +107 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +60 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.d.ts +167 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +150 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +31 -0
- package/es/flow/admin-shell/admin-layout/HelpLite.d.ts +13 -0
- package/{lib/utils/requirejs.d.ts → es/flow/admin-shell/admin-layout/PinnedPluginListLite.d.ts} +5 -8
- package/es/flow/admin-shell/admin-layout/ResetThemeTokenAndKeepAlgorithm.d.ts +13 -0
- package/es/flow/admin-shell/admin-layout/TopbarActionsBar.d.ts +25 -0
- package/es/flow/admin-shell/admin-layout/constants.d.ts +9 -0
- package/es/flow/admin-shell/admin-layout/flowSettingsPreference.d.ts +23 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +19 -0
- package/es/flow/admin-shell/admin-layout/mobile-layout.d.ts +12 -0
- package/es/flow/admin-shell/admin-layout/mobileMenuNavigation.d.ts +15 -0
- package/es/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.d.ts +42 -0
- package/{lib/context.d.ts → es/flow/admin-shell/admin-layout/useApplications.d.ts} +3 -2
- package/es/flow/admin-shell/useAdminLayoutRoutePage.d.ts +28 -0
- package/es/flow/common/Liquid.d.ts +33 -0
- package/es/flow/common/Markdown/Display.d.ts +9 -0
- package/es/flow/common/Markdown/Edit.d.ts +23 -0
- package/es/flow/common/Markdown/Markdown.d.ts +24 -0
- package/es/flow/common/Markdown/style.d.ts +14 -0
- package/es/flow/common/Markdown/useCDN.d.ts +9 -0
- package/es/flow/components/AdminLayout.d.ts +11 -0
- package/es/flow/components/BlockItemCard.d.ts +16 -0
- package/es/flow/components/ConditionBuilder.d.ts +17 -0
- package/es/flow/components/DefaultValue.d.ts +20 -0
- package/es/flow/components/DynamicFlowsIcon.d.ts +13 -0
- package/es/flow/components/EllipsisWithTooltip.d.ts +17 -0
- package/es/flow/components/ExpiresRadio/index.d.ts +12 -0
- package/es/flow/components/FieldAssignEditor.d.ts +32 -0
- package/es/flow/components/FieldAssignExactDatePicker.d.ts +23 -0
- package/es/flow/components/FieldAssignRulesEditor.d.ts +70 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +88 -0
- package/es/flow/components/FlowRoute.d.ts +28 -0
- package/es/flow/components/Grid/index.d.ts +26 -0
- package/es/flow/components/JsonEditor.d.ts +19 -0
- package/es/flow/components/RunJSValueEditor.d.ts +19 -0
- package/{lib/hooks/useApp.d.ts → es/flow/components/SkeletonFallback.d.ts} +2 -2
- package/es/flow/components/TextAreaWithContextSelector.d.ts +30 -0
- package/es/flow/components/code-editor/core/EditorCore.d.ts +25 -0
- package/es/flow/components/code-editor/core/tooltipParent.d.ts +9 -0
- package/es/flow/components/code-editor/errorHelpers.d.ts +17 -0
- package/es/flow/components/code-editor/extension/CodeEditorExtension.d.ts +14 -0
- package/{lib/hooks → es/flow/components/code-editor/extension}/index.d.ts +1 -3
- package/es/flow/components/code-editor/formatDocInfo.d.ts +17 -0
- package/es/flow/components/code-editor/hooks/useCodeRunner.d.ts +23 -0
- package/es/flow/components/code-editor/hooks/useRunJSDocCompletions.d.ts +15 -0
- package/es/flow/components/code-editor/htmlCompletion.d.ts +11 -0
- package/es/flow/components/code-editor/index.d.ts +31 -0
- package/es/flow/components/code-editor/javascriptCompletion.d.ts +11 -0
- package/es/flow/components/code-editor/javascriptHtmlTemplate.d.ts +16 -0
- package/es/flow/components/code-editor/jsxCompletion.d.ts +10 -0
- package/es/flow/components/code-editor/linter.d.ts +19 -0
- package/es/flow/components/code-editor/panels/LogsPanel.d.ts +15 -0
- package/es/flow/components/code-editor/panels/RightExtra.d.ts +18 -0
- package/es/flow/components/code-editor/panels/SnippetsDrawer.d.ts +18 -0
- package/es/flow/components/code-editor/resolveScenes.d.ts +10 -0
- package/es/flow/components/code-editor/runjsCompletionSource.d.ts +20 -0
- package/es/flow/components/code-editor/runjsCompletions.d.ts +23 -0
- package/es/flow/components/code-editor/runjsDiagnostics.d.ts +46 -0
- package/es/flow/components/code-editor/types.d.ts +32 -0
- package/es/flow/components/drag-drop/Sortable.d.ts +12 -0
- package/es/flow/components/drag-drop/SortableItem.d.ts +12 -0
- package/es/flow/components/drag-drop/index.d.ts +10 -0
- package/es/flow/components/fieldAssignOptions.d.ts +23 -0
- package/es/flow/components/filter/FilterContainer.d.ts +67 -0
- package/es/flow/components/filter/FilterGroup.d.ts +66 -0
- package/es/flow/components/filter/FilterItem.d.ts +40 -0
- package/es/flow/components/filter/LinkageFilterItem.d.ts +51 -0
- package/es/flow/components/filter/VariableFilterItem.d.ts +37 -0
- package/es/flow/components/filter/fieldsToOptions.d.ts +9 -0
- package/es/flow/components/filter/index.d.ts +16 -0
- package/es/flow/components/index.d.ts +14 -0
- package/es/flow/components/placeholders/BlockPlaceholder.d.ts +11 -0
- package/{lib/components/MainComponent.d.ts → es/flow/components/placeholders/FieldPlaceholder.d.ts} +1 -1
- package/es/flow/components/useAssociationTitleFieldSync.d.ts +13 -0
- package/es/flow/flows/editMarkdownFlow.d.ts +10 -0
- package/es/flow/flows/openViewFlow.d.ts +17 -0
- package/es/flow/formily/ReactiveField.d.ts +19 -0
- package/es/flow/formily/index.d.ts +8 -0
- package/es/flow/getViewDiffAndUpdateHidden.d.ts +21 -0
- package/es/flow/index.d.ts +30 -0
- package/es/flow/internal/components/Markdown/DisplayMarkdown.d.ts +10 -0
- package/{lib/utils/globalDeps.d.ts → es/flow/internal/components/Markdown/markdown-it-plugins/mermaidPlugin.d.ts} +3 -3
- package/es/flow/internal/components/Markdown/md.d.ts +11 -0
- package/es/flow/internal/components/Markdown/style.d.ts +9 -0
- package/es/flow/internal/components/Markdown/util.d.ts +15 -0
- package/{lib/components/BlankComponent.d.ts → es/flow/internal/constants/HeightMode.d.ts} +5 -4
- package/es/flow/internal/index.d.ts +11 -0
- package/es/flow/internal/utils/associationValueCoercion.d.ts +15 -0
- package/es/flow/internal/utils/dateTimeUtils.d.ts +10 -0
- package/es/flow/internal/utils/enumOptionsUtils.d.ts +23 -0
- package/es/flow/internal/utils/modelUtils.d.ts +27 -0
- package/es/flow/internal/utils/operatorSchemaHelper.d.ts +15 -0
- package/es/flow/internal/utils/rebuildFieldSubModel.d.ts +33 -0
- package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
- package/es/flow/internal/utils/titleFieldQuickSync.d.ts +36 -0
- package/es/flow/models/actions/AddChildActionModel.d.ts +16 -0
- package/es/flow/models/actions/AddNewActionModel.d.ts +16 -0
- package/es/flow/models/actions/BulkDeleteActionModel.d.ts +16 -0
- package/es/flow/models/actions/DeleteActionModel.d.ts +15 -0
- package/es/flow/models/actions/EditActionModel.d.ts +16 -0
- package/es/flow/models/actions/ExpandCollapseActionModel.d.ts +19 -0
- package/es/flow/models/actions/FilterActionModel.d.ts +26 -0
- package/{lib/components/RouterBridge.d.ts → es/flow/models/actions/JSActionModel.d.ts} +5 -5
- package/es/flow/models/actions/JSCollectionActionModel.d.ts +14 -0
- package/es/flow/models/actions/JSItemActionModel.d.ts +19 -0
- package/es/flow/models/actions/JSRecordActionModel.d.ts +14 -0
- package/es/flow/models/actions/LinkActionModel.d.ts +15 -0
- package/es/flow/models/actions/LinkActionUtils.d.ts +34 -0
- package/es/flow/models/actions/PopupCollectionActionModel.d.ts +14 -0
- package/es/flow/models/actions/RefreshActionModel.d.ts +14 -0
- package/es/flow/models/actions/UpdateRecordActionModel.d.ts +27 -0
- package/es/flow/models/actions/UpdateRecordActionUtils.d.ts +12 -0
- package/es/flow/models/actions/ViewActionModel.d.ts +15 -0
- package/es/flow/models/actions/index.d.ts +24 -0
- package/es/flow/models/actions/joinUrlSearch.d.ts +12 -0
- package/es/flow/models/base/ActionGroupModel.d.ts +9 -0
- package/es/flow/models/base/ActionGroupModelCore.d.ts +29 -0
- package/es/flow/models/base/ActionModel.d.ts +9 -0
- package/es/flow/models/base/ActionModelCore.d.ts +45 -0
- package/es/flow/models/base/AssociationFieldGroupModel.d.ts +49 -0
- package/es/flow/models/base/BlockGridModel.d.ts +22 -0
- package/es/flow/models/base/BlockModel.d.ts +57 -0
- package/es/flow/models/base/CollectionActionModel.d.ts +12 -0
- package/es/flow/models/base/CollectionBlockModel.d.ts +71 -0
- package/es/flow/models/base/CommonItemModel.d.ts +11 -0
- package/es/flow/models/base/DataBlockModel.d.ts +12 -0
- package/es/flow/models/base/FieldModel.d.ts +17 -0
- package/es/flow/models/base/FilterBlockModel.d.ts +12 -0
- package/es/flow/models/base/GridModel.d.ts +99 -0
- package/es/flow/models/base/PageModel/ChildPageModel.d.ts +21 -0
- package/es/flow/models/base/PageModel/MainPageModel.d.ts +17 -0
- package/es/flow/models/base/PageModel/OldPageModel.d.ts +21 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +53 -0
- package/es/flow/models/base/PageModel/PageTabModel.d.ts +42 -0
- package/es/flow/models/base/PageModel/RootPageModel.d.ts +24 -0
- package/es/flow/models/base/PageModel/SubPageModel.d.ts +17 -0
- package/es/flow/models/base/PageModel/closeGuard.d.ts +31 -0
- package/{lib → es/flow/models/base/PageModel}/index.d.ts +6 -6
- package/es/flow/models/base/PopupActionModel.d.ts +13 -0
- package/es/flow/models/base/RecordActionModel.d.ts +12 -0
- package/es/flow/models/base/RouteModel.d.ts +11 -0
- package/es/flow/models/base/index.d.ts +24 -0
- package/es/flow/models/blocks/assign-form/AssignFormGridModel.d.ts +15 -0
- package/es/flow/models/blocks/assign-form/AssignFormItemModel.d.ts +22 -0
- package/es/flow/models/blocks/assign-form/AssignFormModel.d.ts +26 -0
- package/es/flow/models/blocks/assign-form/index.d.ts +11 -0
- package/es/flow/models/blocks/details/DetailsAssociationFieldGroupModel.d.ts +12 -0
- package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +41 -0
- package/es/flow/models/blocks/details/DetailsCustomItemModel.d.ts +13 -0
- package/es/flow/models/blocks/details/DetailsGridModel.d.ts +33 -0
- package/es/flow/models/blocks/details/DetailsItemModel.d.ts +60 -0
- package/es/flow/models/blocks/details/DetailsJSFieldItemModel.d.ts +19 -0
- package/es/flow/models/blocks/details/index.d.ts +14 -0
- package/es/flow/models/blocks/details/utils.d.ts +16 -0
- package/es/flow/models/blocks/filter-form/FieldModelSelect.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/FieldOperatorSelect.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/FilterFormActionGroupModel.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/FilterFormActionModel.d.ts +11 -0
- package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +39 -0
- package/es/flow/models/blocks/filter-form/FilterFormCollapseActionModel.d.ts +18 -0
- package/es/flow/models/blocks/filter-form/FilterFormCustomItemModel.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +43 -0
- package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +59 -0
- package/es/flow/models/blocks/filter-form/FilterFormJSActionModel.d.ts +11 -0
- package/es/flow/models/blocks/filter-form/FilterFormResetActionModel.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/FilterFormSubmitActionModel.d.ts +15 -0
- package/es/flow/models/blocks/filter-form/SourceCascader.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/customFieldOperators.d.ts +34 -0
- package/es/flow/models/blocks/filter-form/fields/FieldComponentProps.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.d.ts +52 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.d.ts +20 -0
- package/{lib/components/RouterContextCleaner.d.ts → es/flow/models/blocks/filter-form/fields/FilterFormFieldModel.d.ts} +3 -4
- package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/DateOnlyFilterFieldModel.d.ts +14 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/DateTimeFilterFieldModel.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/DateTimeNoTzFilterFieldModel.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/DateTimeTzFilterFieldModel.d.ts +14 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/components/DateFilterDynamicComponent.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/components/FilterDatePicker.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/components/FilterRangePicker.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/fields/date-time/index.d.ts +12 -0
- package/es/flow/models/blocks/filter-form/fields/index.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/index.d.ts +23 -0
- package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
- package/es/flow/models/blocks/filter-manager/FilterManager.d.ts +141 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/connectFields.d.ts +10 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/customizeFilterRender.d.ts +10 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/defaultOperator.d.ts +9 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/index.d.ts +12 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/operatorComponentProps.d.ts +10 -0
- package/es/flow/models/blocks/filter-manager/index.d.ts +11 -0
- package/es/flow/models/blocks/filter-manager/utils.d.ts +21 -0
- package/es/flow/models/blocks/form/CreateFormModel.d.ts +22 -0
- package/es/flow/models/blocks/form/EditFormModel.d.ts +26 -0
- package/es/flow/models/blocks/form/FormActionGroupModel.d.ts +13 -0
- package/es/flow/models/blocks/form/FormActionModel.d.ts +21 -0
- package/es/flow/models/blocks/form/FormAssociationFieldGroupModel.d.ts +12 -0
- package/es/flow/models/blocks/form/FormAssociationItemModel.d.ts +39 -0
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +96 -0
- package/es/flow/models/blocks/form/FormCustomItemModel.d.ts +13 -0
- package/es/flow/models/blocks/form/FormGridModel.d.ts +35 -0
- package/es/flow/models/blocks/form/FormItemModel.d.ts +39 -0
- package/es/flow/models/blocks/form/FormJSFieldItemModel.d.ts +18 -0
- package/es/flow/models/blocks/form/JSFormActionModel.d.ts +11 -0
- package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +44 -0
- package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
- package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
- package/es/flow/models/blocks/form/index.d.ts +21 -0
- package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
- package/es/flow/models/blocks/form/submitHandler.d.ts +9 -0
- package/es/flow/models/blocks/form/submitValues.d.ts +40 -0
- package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
- package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
- package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
- package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
- package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +137 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +88 -0
- package/es/flow/models/blocks/form/value-runtime/types.d.ts +62 -0
- package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
- package/es/flow/models/blocks/index.d.ts +15 -0
- package/es/flow/models/blocks/js-block/JSBlock.d.ts +16 -0
- package/es/flow/models/blocks/js-block/index.d.ts +9 -0
- package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
- package/es/flow/models/blocks/table/JSColumnModel.d.ts +21 -0
- package/es/flow/models/blocks/table/TableActionsColumnModel.d.ts +18 -0
- package/es/flow/models/blocks/table/TableAssociationFieldGroupModel.d.ts +12 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +69 -0
- package/es/flow/models/blocks/table/TableColumnModel.d.ts +29 -0
- package/es/flow/models/blocks/table/TableCustomColumnModel.d.ts +12 -0
- package/es/flow/models/blocks/table/TableJSFieldItemModel.d.ts +19 -0
- package/{lib/hooks/usePlugin.d.ts → es/flow/models/blocks/table/TableSelectModel.d.ts} +6 -3
- package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
- package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
- package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
- package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
- package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
- package/es/flow/models/blocks/table/index.d.ts +16 -0
- package/es/flow/models/blocks/table/sortUtils.d.ts +32 -0
- package/es/flow/models/blocks/table/utils.d.ts +18 -0
- package/es/flow/models/blocks/utils/transformChildrenToJS.d.ts +42 -0
- package/es/flow/models/fields/AssociationFieldModel/AssociationFieldModel.d.ts +5 -0
- package/es/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.d.ts +45 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.d.ts +11 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.d.ts +19 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.d.ts +30 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.d.ts +29 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.d.ts +18 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.d.ts +14 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/popupSubTableBeforeClose.d.ts +25 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.d.ts +36 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.d.ts +17 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +45 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +46 -0
- package/es/flow/models/fields/AssociationFieldModel/SubFormFieldModel.d.ts +32 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +32 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.d.ts +10 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +19 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/rowIdentity.d.ts +18 -0
- package/{lib/utils → es/flow/models/fields/AssociationFieldModel}/index.d.ts +7 -3
- package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +99 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +48 -0
- package/es/flow/models/fields/CheckboxFieldModel.d.ts +13 -0
- package/es/flow/models/fields/CheckboxGroupFieldModel.d.ts +13 -0
- package/es/flow/models/fields/ClickableFieldModel.d.ts +25 -0
- package/es/flow/models/fields/CollectionSelectorFieldModel.d.ts +13 -0
- package/es/flow/models/fields/ColorFieldModel.d.ts +14 -0
- package/es/flow/models/fields/DateTimeFieldModel/DateOnlyFieldModel.d.ts +7 -0
- package/es/flow/models/fields/DateTimeFieldModel/DateTimeFieldModel.d.ts +3 -0
- package/es/flow/models/fields/DateTimeFieldModel/DateTimeNoTzFieldModel.d.ts +6 -0
- package/es/flow/models/fields/DateTimeFieldModel/DateTimeTzFieldModel.d.ts +7 -0
- package/es/flow/models/fields/DateTimeFieldModel/index.d.ts +11 -0
- package/es/flow/models/fields/DisplayAssociationField/DisplaySubItemFieldModel.d.ts +26 -0
- package/es/flow/models/fields/DisplayAssociationField/DisplaySubListFieldModel.d.ts +26 -0
- package/es/flow/models/fields/DisplayAssociationField/DisplaySubTableFieldModel.d.ts +20 -0
- package/es/flow/models/fields/DisplayAssociationField/displaySubListUtils.d.ts +14 -0
- package/es/flow/models/fields/DisplayAssociationField/index.d.ts +11 -0
- package/es/flow/models/fields/DisplayCheckboxFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayColorFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayDateTimeFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayEnumFieldModel.d.ts +14 -0
- package/es/flow/models/fields/DisplayHtmlFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayIconFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayJSONFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayNumberFieldModel.d.ts +33 -0
- package/es/flow/models/fields/DisplayPasswordFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayPercentFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayTextFieldModel.d.ts +14 -0
- package/es/flow/models/fields/DisplayTimeFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DisplayTitleFieldModel.d.ts +18 -0
- package/es/flow/models/fields/DisplayURLFieldModel.d.ts +13 -0
- package/es/flow/models/fields/DividerItemModel.d.ts +13 -0
- package/es/flow/models/fields/IconFieldModel.d.ts +13 -0
- package/es/flow/models/fields/InputFieldModel.d.ts +13 -0
- package/es/flow/models/fields/JSEditableFieldModel.d.ts +27 -0
- package/es/flow/models/fields/JSFieldModel.d.ts +45 -0
- package/es/flow/models/fields/JSItemModel.d.ts +27 -0
- package/es/flow/models/fields/JsonFieldModel.d.ts +6 -0
- package/es/flow/models/fields/MarkdownItemModel.d.ts +14 -0
- package/es/flow/models/fields/NumberFieldModel.d.ts +15 -0
- package/es/flow/models/fields/PasswordFieldModel.d.ts +13 -0
- package/es/flow/models/fields/PercentFieldModel.d.ts +14 -0
- package/es/flow/models/fields/RadioGroupFieldModel.d.ts +13 -0
- package/es/flow/models/fields/RichTextFieldModel/index.d.ts +14 -0
- package/es/flow/models/fields/RichTextFieldModel/registerFontSize.d.ts +9 -0
- package/es/flow/models/fields/RichTextFieldModel/registerImageResize.d.ts +9 -0
- package/es/flow/models/fields/RichTextFieldModel/registerSmartBreak.d.ts +12 -0
- package/es/flow/models/fields/RichTextFieldModel/style.d.ts +9 -0
- package/es/flow/models/fields/SelectFieldModel.d.ts +13 -0
- package/es/flow/models/fields/TextareaFieldModel.d.ts +13 -0
- package/es/flow/models/fields/TimeFieldModel.d.ts +5 -0
- package/es/flow/models/fields/VariableFieldFormModel.d.ts +18 -0
- package/es/flow/models/fields/index.d.ts +47 -0
- package/es/flow/models/fields/mobile-components/MobileDatePicker.d.ts +10 -0
- package/es/flow/models/fields/mobile-components/MobileLazySelect.d.ts +11 -0
- package/es/flow/models/fields/mobile-components/MobileSelect.d.ts +10 -0
- package/es/flow/models/fields/mobile-components/MobileTimePicker.d.ts +10 -0
- package/es/flow/models/index.d.ts +13 -0
- package/es/flow/models/topbar/TopbarActionModel.d.ts +114 -0
- package/es/flow/models/topbar/UserCenterTopbarActionModel.d.ts +68 -0
- package/es/flow/models/topbar/index.d.ts +10 -0
- package/es/flow/models/utils/resolveRunJsParams.d.ts +19 -0
- package/es/flow/resolveViewParamsToViewList.d.ts +20 -0
- package/es/flow/system-settings/SystemSettingsSource.d.ts +97 -0
- package/es/flow/system-settings/index.d.ts +10 -0
- package/es/flow/system-settings/useSystemSettings.d.ts +30 -0
- package/es/flow/utils/actionCapability.d.ts +60 -0
- package/es/flow/utils/blockUtils.d.ts +16 -0
- package/es/flow/utils/dispatchEventDeep.d.ts +20 -0
- package/es/flow/utils/index.d.ts +11 -0
- package/es/flow/utils/pagination.d.ts +29 -0
- package/es/flow/utils/useJsonTemplateResolver.d.ts +9 -0
- package/es/flow-compat/ColorPicker.d.ts +15 -0
- package/es/flow-compat/FieldValidation.d.ts +31 -0
- package/es/flow-compat/HighPerformanceSpin.d.ts +11 -0
- package/es/flow-compat/Icon.d.ts +10 -0
- package/es/flow-compat/IconPicker.d.ts +19 -0
- package/es/flow-compat/Password.d.ts +16 -0
- package/es/flow-compat/PasswordStrength.d.ts +16 -0
- package/es/flow-compat/Popover.d.ts +12 -0
- package/es/flow-compat/data.d.ts +15 -0
- package/es/flow-compat/date.d.ts +114 -0
- package/es/flow-compat/fieldValidationConstants.d.ts +383 -0
- package/es/flow-compat/index.d.ts +27 -0
- package/es/flow-compat/lazy.d.ts +17 -0
- package/es/flow-compat/operators.d.ts +582 -0
- package/{lib/hooks/useRouter.d.ts → es/flow-compat/passwordUtils.d.ts} +1 -1
- package/es/flow-compat/routeTypes.d.ts +56 -0
- package/es/flow-compat/useFullscreenOverlay.d.ts +20 -0
- package/es/flow-compat/zIndexContext.d.ts +12 -0
- package/es/hooks/useApp.d.ts +4 -2
- package/es/hooks/usePlugin.d.ts +2 -2
- package/es/hooks/useRouter.d.ts +1 -1
- package/es/i18n.d.ts +22 -0
- package/es/index.d.ts +19 -0
- package/es/index.mjs +1019 -0
- package/es/index.mjs.LICENSE.txt +1 -0
- package/es/locale/languageCodes.d.ts +13 -0
- package/es/nocobase-buildin-plugin/index.d.ts +24 -0
- package/es/nocobase-buildin-plugin/plugins/LocalePlugin.d.ts +15 -0
- package/es/nocobase-buildin-plugin/plugins/dayjsLocale.d.ts +76 -0
- package/es/nocobase-buildin-plugin/plugins/loadConstrueLocale.d.ts +9 -0
- package/es/settings-center/AdminSettingsLayout.d.ts +24 -0
- package/es/settings-center/AdminSettingsLayoutModel.d.ts +28 -0
- package/es/settings-center/PluginManagerPage.d.ts +17 -0
- package/es/settings-center/SystemSettingsPage.d.ts +17 -0
- package/es/settings-center/index.d.ts +13 -0
- package/es/settings-center/utils.d.ts +94 -0
- package/es/theme/AntdAppProvider.d.ts +18 -0
- package/es/theme/compatOldTheme.d.ts +11 -0
- package/es/theme/customAlgorithm.d.ts +12 -0
- package/es/theme/defaultTheme.d.ts +11 -0
- package/es/theme/index.d.ts +35 -0
- package/es/theme/type.d.ts +41 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/remotePlugins.d.ts +6 -6
- package/lib/index.js +1019 -40
- package/lib/index.js.LICENSE.txt +1 -0
- package/lib/locale/languageCodes.js +96 -0
- package/package.json +28 -5
- package/src/Application.tsx +76 -432
- package/src/BaseApplication.tsx +648 -0
- package/src/PinnedPluginListContext.tsx +33 -0
- package/src/Plugin.ts +24 -8
- package/src/PluginManager.ts +31 -19
- package/src/PluginSettingsManager.ts +504 -100
- package/src/RouteRepository.ts +247 -0
- package/src/RouterManager.tsx +15 -16
- package/src/WebSocketClient.ts +4 -4
- package/src/__tests__/PluginSettingsManager.test.ts +228 -0
- package/src/__tests__/app.test.tsx +216 -34
- package/src/__tests__/authRedirect.test.ts +181 -0
- package/src/__tests__/dataSourceRuntime.test.tsx +34 -0
- package/src/__tests__/globalDeps.test.ts +1 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +185 -0
- package/src/__tests__/settings-center.test.tsx +363 -0
- package/src/acl/ACLProvider.tsx +284 -0
- package/src/acl/__tests__/createAclSnippetAllow.test.ts +42 -0
- package/src/acl/createAclSnippetAllow.ts +33 -0
- package/src/acl/index.ts +12 -0
- package/src/acl/useAclSnippets.ts +25 -0
- package/src/ai/ai-manager.ts +19 -0
- package/src/ai/index.ts +13 -0
- package/src/ai/skills-manager/index.ts +10 -0
- package/src/ai/skills-manager/types.ts +26 -0
- package/src/ai/tools-manager/hooks/context.ts +20 -0
- package/src/ai/tools-manager/hooks/index.ts +22 -0
- package/src/ai/tools-manager/hooks/provider.tsx +53 -0
- package/src/ai/tools-manager/index.ts +42 -0
- package/src/ai/tools-manager/types.ts +106 -0
- package/src/ai/utils.ts +12 -0
- package/src/authRedirect.ts +297 -0
- package/src/collection-field-interface/CollectionFieldInterface.ts +200 -0
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +177 -0
- package/src/collection-manager/interfaces/checkbox.ts +41 -0
- package/src/collection-manager/interfaces/checkboxGroup.ts +45 -0
- package/src/collection-manager/interfaces/collection.ts +53 -0
- package/src/collection-manager/interfaces/color.ts +34 -0
- package/src/collection-manager/interfaces/createdAt.ts +41 -0
- package/src/collection-manager/interfaces/createdBy.ts +80 -0
- package/src/collection-manager/interfaces/dateOnly.ts +48 -0
- package/src/collection-manager/interfaces/datetime.ts +66 -0
- package/src/collection-manager/interfaces/datetimeNoTz.ts +66 -0
- package/src/collection-manager/interfaces/email.ts +47 -0
- package/src/collection-manager/interfaces/icon.ts +31 -0
- package/src/collection-manager/interfaces/id.ts +61 -0
- package/src/collection-manager/interfaces/index.ts +51 -0
- package/src/collection-manager/interfaces/input.ts +224 -0
- package/src/collection-manager/interfaces/integer.ts +135 -0
- package/src/collection-manager/interfaces/json.tsx +74 -0
- package/src/collection-manager/interfaces/linkTo.ts +120 -0
- package/src/collection-manager/interfaces/m2m.tsx +262 -0
- package/src/collection-manager/interfaces/m2o.tsx +196 -0
- package/src/collection-manager/interfaces/markdown.ts +84 -0
- package/src/collection-manager/interfaces/multipleSelect.ts +52 -0
- package/src/collection-manager/interfaces/nanoid.ts +82 -0
- package/src/collection-manager/interfaces/number.ts +173 -0
- package/src/collection-manager/interfaces/o2m.tsx +217 -0
- package/src/collection-manager/interfaces/o2o.tsx +561 -0
- package/src/collection-manager/interfaces/password.ts +80 -0
- package/src/collection-manager/interfaces/percent.ts +178 -0
- package/src/collection-manager/interfaces/phone.ts +43 -0
- package/src/collection-manager/interfaces/properties/index.ts +582 -0
- package/src/collection-manager/interfaces/properties/operators.ts +352 -0
- package/src/collection-manager/interfaces/radioGroup.ts +37 -0
- package/src/collection-manager/interfaces/richText.ts +84 -0
- package/src/collection-manager/interfaces/select.ts +50 -0
- package/src/collection-manager/interfaces/snowflake-id.ts +61 -0
- package/src/collection-manager/interfaces/subTable.ts +218 -0
- package/src/collection-manager/interfaces/tableoid.ts +53 -0
- package/src/collection-manager/interfaces/textarea.ts +93 -0
- package/src/collection-manager/interfaces/time.ts +37 -0
- package/src/collection-manager/interfaces/types.ts +41 -0
- package/src/collection-manager/interfaces/unixTimestamp.tsx +68 -0
- package/src/collection-manager/interfaces/updatedAt.ts +41 -0
- package/src/collection-manager/interfaces/updatedBy.ts +79 -0
- package/src/collection-manager/interfaces/url.ts +48 -0
- package/src/collection-manager/interfaces/utils/index.ts +20 -0
- package/src/collection-manager/interfaces/uuid.ts +72 -0
- package/src/components/AppComponents.tsx +245 -0
- package/src/components/Icon.tsx +68 -0
- package/src/components/index.ts +2 -0
- package/src/css-variable/CSSVariableProvider.tsx +108 -0
- package/src/flow/FlowModelRepository.ts +222 -0
- package/src/flow/FlowPage.tsx +118 -0
- package/src/flow/__tests__/FlowModelRepository.test.ts +61 -0
- package/src/flow/__tests__/FlowRoute.test.tsx +474 -0
- package/src/flow/__tests__/getKey.test.ts +61 -0
- package/src/flow/__tests__/getViewDiff.test.ts +180 -0
- package/src/flow/__tests__/helpers/mockFlowApp.ts +49 -0
- package/src/flow/__tests__/resolveViewParamsToViewList.test.ts +278 -0
- package/src/flow/actions/__tests__/aclCheckRefresh.test.ts +129 -0
- package/src/flow/actions/__tests__/dataLoadingMode.test.tsx +69 -0
- package/src/flow/actions/__tests__/dataScope.leftMetaTree.test.tsx +192 -0
- package/src/flow/actions/__tests__/fieldLinkageRules.scopeDepth.test.ts +538 -0
- package/src/flow/actions/__tests__/linkageAssignField.legacy.test.ts +470 -0
- package/src/flow/actions/__tests__/linkageRules.assignFieldOptions.test.tsx +56 -0
- package/src/flow/actions/__tests__/linkageRules.runjsTemplateResolution.test.ts +71 -0
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +109 -0
- package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +164 -0
- package/src/flow/actions/__tests__/openView.beforeClose.test.tsx +263 -0
- package/src/flow/actions/__tests__/openView.closeDestroy.test.tsx +95 -0
- package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +152 -0
- package/src/flow/actions/__tests__/openView.subModelKey.test.tsx +95 -0
- package/src/flow/actions/__tests__/setTargetDataScope.leftMetaTree.test.tsx +225 -0
- package/src/flow/actions/__tests__/showMessageNotification.test.ts +79 -0
- package/src/flow/actions/__tests__/subFormFieldLinkageRules.inputArgs.test.ts +173 -0
- package/src/flow/actions/aclCheck.tsx +46 -0
- package/src/flow/actions/aclCheckRefresh.tsx +168 -0
- package/src/flow/actions/afterSuccess.tsx +138 -0
- package/src/flow/actions/blockHeight.tsx +77 -0
- package/src/flow/actions/columnFixed.tsx +35 -0
- package/src/flow/actions/confirm.tsx +63 -0
- package/src/flow/actions/customVariable.tsx +399 -0
- package/src/flow/actions/dataLoadingMode.tsx +61 -0
- package/src/flow/actions/dataScope.tsx +61 -0
- package/src/flow/actions/dateTimeFormat.tsx +188 -0
- package/src/flow/actions/displayFieldComponent.tsx +103 -0
- package/src/flow/actions/fieldComponent.tsx +114 -0
- package/src/flow/actions/filterFormDefaultValues.tsx +134 -0
- package/src/flow/actions/formAssignRules.tsx +117 -0
- package/src/flow/actions/index.ts +55 -0
- package/src/flow/actions/layout.tsx +107 -0
- package/src/flow/actions/linkageRules.tsx +2584 -0
- package/src/flow/actions/linkageRulesRefresh.tsx +82 -0
- package/src/flow/actions/navigateToURL.tsx +142 -0
- package/src/flow/actions/numberFormat.tsx +145 -0
- package/src/flow/actions/openView.tsx +512 -0
- package/src/flow/actions/overflowMode.tsx +36 -0
- package/src/flow/actions/pattern.tsx +122 -0
- package/src/flow/actions/refreshTargetBlocks.tsx +91 -0
- package/src/flow/actions/renderMode.tsx +42 -0
- package/src/flow/actions/required.tsx +70 -0
- package/src/flow/actions/runjs.tsx +48 -0
- package/src/flow/actions/setTargetDataScope.tsx +111 -0
- package/src/flow/actions/showMessage.tsx +155 -0
- package/src/flow/actions/showNotification.tsx +179 -0
- package/src/flow/actions/sortingRules.tsx +125 -0
- package/src/flow/actions/titleField.tsx +141 -0
- package/src/flow/actions/validation.tsx +77 -0
- package/src/flow/admin-shell/AdminLayoutRouteCoordinator.ts +339 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutCompat.tsx +326 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +681 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.ts +338 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +774 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +964 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +330 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +127 -0
- package/src/flow/admin-shell/admin-layout/HelpLite.tsx +193 -0
- package/src/flow/admin-shell/admin-layout/PinnedPluginListLite.tsx +129 -0
- package/src/flow/admin-shell/admin-layout/ResetThemeTokenAndKeepAlgorithm.tsx +30 -0
- package/src/flow/admin-shell/admin-layout/TopbarActionsBar.tsx +211 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +2023 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +284 -0
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +211 -0
- package/src/flow/admin-shell/admin-layout/__tests__/flowSettingsPreference.test.ts +44 -0
- package/src/flow/admin-shell/admin-layout/constants.ts +10 -0
- package/src/flow/admin-shell/admin-layout/flowSettingsPreference.ts +54 -0
- package/src/flow/admin-shell/admin-layout/index.ts +20 -0
- package/src/flow/admin-shell/admin-layout/mobile-layout.tsx +35 -0
- package/src/flow/admin-shell/admin-layout/mobileMenuNavigation.ts +30 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +214 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +260 -0
- package/src/flow/admin-shell/admin-layout/useApplications.tsx +15 -0
- package/src/flow/admin-shell/useAdminLayoutRoutePage.ts +56 -0
- package/src/flow/common/Liquid.tsx +148 -0
- package/src/flow/common/Markdown/Display.tsx +213 -0
- package/src/flow/common/Markdown/Edit.tsx +437 -0
- package/src/flow/common/Markdown/Markdown.tsx +44 -0
- package/src/flow/common/Markdown/style.ts +53 -0
- package/src/flow/common/Markdown/useCDN.ts +21 -0
- package/src/flow/components/AdminLayout.tsx +167 -0
- package/src/flow/components/BlockItemCard.tsx +204 -0
- package/src/flow/components/ConditionBuilder.tsx +40 -0
- package/src/flow/components/DefaultValue.tsx +732 -0
- package/src/flow/components/DynamicFlowsIcon.tsx +764 -0
- package/src/flow/components/EllipsisWithTooltip.tsx +106 -0
- package/src/flow/components/ExpiresRadio/index.tsx +139 -0
- package/src/flow/components/FieldAssignEditor.tsx +80 -0
- package/src/flow/components/FieldAssignExactDatePicker.tsx +225 -0
- package/src/flow/components/FieldAssignRulesEditor.tsx +1013 -0
- package/src/flow/components/FieldAssignValueInput.tsx +1490 -0
- package/src/flow/components/FlowRoute.tsx +173 -0
- package/src/flow/components/Grid/index.tsx +158 -0
- package/src/flow/components/JsonEditor.tsx +53 -0
- package/src/flow/components/RunJSValueEditor.tsx +50 -0
- package/src/flow/components/SkeletonFallback.tsx +19 -0
- package/src/flow/components/TextAreaWithContextSelector.tsx +139 -0
- package/src/flow/components/__tests__/DefaultValue.test.tsx +1289 -0
- package/src/flow/components/__tests__/DynamicFlowsIcon.test.tsx +193 -0
- package/src/flow/components/__tests__/FieldAssignExactDatePicker.test.tsx +121 -0
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +758 -0
- package/src/flow/components/__tests__/FieldAssignValueInput.exactDate.test.tsx +180 -0
- package/src/flow/components/__tests__/FieldAssignValueInput.path.test.ts +298 -0
- package/src/flow/components/__tests__/fieldAssignOptions.test.ts +97 -0
- package/src/flow/components/code-editor/__tests__/SnippetsDrawer.test.tsx +51 -0
- package/src/flow/components/code-editor/__tests__/errorHelpers.test.ts +37 -0
- package/src/flow/components/code-editor/__tests__/javascriptHtmlTemplate.test.ts +101 -0
- package/src/flow/components/code-editor/__tests__/linter.test.ts +106 -0
- package/src/flow/components/code-editor/__tests__/resolveScenes.test.ts +44 -0
- package/src/flow/components/code-editor/__tests__/runjsCompletionSource.test.ts +251 -0
- package/src/flow/components/code-editor/__tests__/runjsCompletions.test.ts +245 -0
- package/src/flow/components/code-editor/__tests__/runjsDiagnostics.test.ts +233 -0
- package/src/flow/components/code-editor/__tests__/runjsLocales.test.ts +24 -0
- package/src/flow/components/code-editor/__tests__/useCodeRunner.test.tsx +273 -0
- package/src/flow/components/code-editor/core/EditorCore.tsx +216 -0
- package/src/flow/components/code-editor/core/tooltipParent.ts +28 -0
- package/src/flow/components/code-editor/errorHelpers.ts +92 -0
- package/src/flow/components/code-editor/extension/CodeEditorExtension.tsx +23 -0
- package/src/flow/components/code-editor/extension/index.ts +10 -0
- package/src/flow/components/code-editor/formatDocInfo.ts +98 -0
- package/src/flow/components/code-editor/hooks/useCodeRunner.ts +333 -0
- package/src/flow/components/code-editor/hooks/useRunJSDocCompletions.ts +41 -0
- package/src/flow/components/code-editor/htmlCompletion.ts +155 -0
- package/src/flow/components/code-editor/index.tsx +286 -0
- package/src/flow/components/code-editor/javascriptCompletion.ts +121 -0
- package/src/flow/components/code-editor/javascriptHtmlTemplate.ts +68 -0
- package/src/flow/components/code-editor/jsxCompletion.ts +244 -0
- package/src/flow/components/code-editor/linter.ts +885 -0
- package/src/flow/components/code-editor/panels/LogsPanel.tsx +68 -0
- package/src/flow/components/code-editor/panels/RightExtra.tsx +71 -0
- package/src/flow/components/code-editor/panels/SnippetsDrawer.tsx +104 -0
- package/src/flow/components/code-editor/resolveScenes.ts +38 -0
- package/src/flow/components/code-editor/runjsCompletionSource.ts +456 -0
- package/src/flow/components/code-editor/runjsCompletions.ts +306 -0
- package/src/flow/components/code-editor/runjsDiagnostics.ts +1077 -0
- package/src/flow/components/code-editor/types.ts +36 -0
- package/src/flow/components/drag-drop/Sortable.tsx +48 -0
- package/src/flow/components/drag-drop/SortableItem.tsx +28 -0
- package/src/flow/components/drag-drop/index.ts +11 -0
- package/src/flow/components/fieldAssignOptions.ts +212 -0
- package/src/flow/components/filter/FilterContainer.tsx +123 -0
- package/src/flow/components/filter/FilterGroup.tsx +320 -0
- package/src/flow/components/filter/FilterItem.tsx +144 -0
- package/src/flow/components/filter/LinkageFilterItem.tsx +511 -0
- package/src/flow/components/filter/VariableFilterItem.tsx +684 -0
- package/src/flow/components/filter/__tests__/FilterGroup.test.tsx +143 -0
- package/src/flow/components/filter/__tests__/LinkageFilterItem.metaTree.test.ts +167 -0
- package/src/flow/components/filter/__tests__/LinkageFilterItem.test.tsx +301 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.leftMetaTree.test.tsx +196 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +406 -0
- package/src/flow/components/filter/fieldsToOptions.ts +71 -0
- package/src/flow/components/filter/index.ts +17 -0
- package/src/flow/components/index.tsx +16 -0
- package/src/flow/components/placeholders/BlockPlaceholder.tsx +68 -0
- package/src/flow/components/placeholders/FieldPlaceholder.tsx +32 -0
- package/src/flow/components/useAssociationTitleFieldSync.ts +49 -0
- package/src/flow/flows/editMarkdownFlow.tsx +143 -0
- package/src/flow/flows/openViewFlow.ts +89 -0
- package/src/flow/formily/ReactiveField.tsx +106 -0
- package/src/flow/formily/index.tsx +8 -0
- package/src/flow/getViewDiffAndUpdateHidden.tsx +86 -0
- package/src/flow/index.ts +108 -0
- package/src/flow/internal/components/Markdown/DisplayMarkdown.tsx +85 -0
- package/src/flow/internal/components/Markdown/markdown-it-plugins/mermaidPlugin.ts +85 -0
- package/src/flow/internal/components/Markdown/md.ts +24 -0
- package/src/flow/internal/components/Markdown/style.ts +165 -0
- package/src/flow/internal/components/Markdown/util.ts +45 -0
- package/src/flow/internal/constants/HeightMode.ts +14 -0
- package/src/flow/internal/index.ts +16 -0
- package/src/flow/internal/utils/__tests__/associationValueCoercion.test.ts +57 -0
- package/src/flow/internal/utils/__tests__/enumOptionsUtils.test.ts +58 -0
- package/src/flow/internal/utils/__tests__/modelUtils.test.ts +66 -0
- package/src/flow/internal/utils/__tests__/rebuildFieldSubModel.test.ts +109 -0
- package/src/flow/internal/utils/__tests__/titleFieldQuickSync.test.ts +93 -0
- package/src/flow/internal/utils/associationValueCoercion.ts +29 -0
- package/src/flow/internal/utils/dateTimeUtils.ts +53 -0
- package/src/flow/internal/utils/enumOptionsUtils.ts +66 -0
- package/src/flow/internal/utils/modelUtils.ts +158 -0
- package/src/flow/internal/utils/operatorSchemaHelper.ts +30 -0
- package/src/flow/internal/utils/rebuildFieldSubModel.ts +94 -0
- package/src/flow/internal/utils/saveStepParamsWithSubModels.ts +40 -0
- package/src/flow/internal/utils/titleFieldQuickSync.ts +95 -0
- package/src/flow/models/actions/AddChildActionModel.tsx +69 -0
- package/src/flow/models/actions/AddNewActionModel.tsx +32 -0
- package/src/flow/models/actions/BulkDeleteActionModel.tsx +61 -0
- package/src/flow/models/actions/DeleteActionModel.tsx +61 -0
- package/src/flow/models/actions/EditActionModel.tsx +31 -0
- package/src/flow/models/actions/ExpandCollapseActionModel.tsx +113 -0
- package/src/flow/models/actions/FilterActionModel.tsx +320 -0
- package/src/flow/models/actions/JSActionModel.tsx +84 -0
- package/src/flow/models/actions/JSCollectionActionModel.tsx +90 -0
- package/src/flow/models/actions/JSItemActionModel.tsx +166 -0
- package/src/flow/models/actions/JSRecordActionModel.tsx +90 -0
- package/src/flow/models/actions/LinkActionModel.tsx +198 -0
- package/src/flow/models/actions/LinkActionUtils.ts +65 -0
- package/src/flow/models/actions/PopupCollectionActionModel.tsx +25 -0
- package/src/flow/models/actions/RefreshActionModel.tsx +45 -0
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +201 -0
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +89 -0
- package/src/flow/models/actions/ViewActionModel.tsx +31 -0
- package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +55 -0
- package/src/flow/models/actions/__tests__/JSItemActionModel.test.tsx +85 -0
- package/src/flow/models/actions/__tests__/LinkActionModel.test.ts +110 -0
- package/src/flow/models/actions/__tests__/UpdateRecordActionModel.test.ts +72 -0
- package/src/flow/models/actions/index.ts +26 -0
- package/src/flow/models/actions/joinUrlSearch.ts +42 -0
- package/src/flow/models/base/ActionGroupModel.tsx +10 -0
- package/src/flow/models/base/ActionGroupModelCore.tsx +117 -0
- package/src/flow/models/base/ActionModel.tsx +141 -0
- package/src/flow/models/base/ActionModelCore.tsx +174 -0
- package/src/flow/models/base/AssociationFieldGroupModel.tsx +100 -0
- package/src/flow/models/base/BlockGridModel.tsx +144 -0
- package/src/flow/models/base/BlockModel.tsx +247 -0
- package/src/flow/models/base/CollectionActionModel.tsx +23 -0
- package/src/flow/models/base/CollectionBlockModel.tsx +703 -0
- package/src/flow/models/base/CommonItemModel.tsx +12 -0
- package/src/flow/models/base/DataBlockModel.tsx +41 -0
- package/src/flow/models/base/FieldModel.tsx +26 -0
- package/src/flow/models/base/FilterBlockModel.tsx +15 -0
- package/src/flow/models/base/GridModel.tsx +1053 -0
- package/src/flow/models/base/PageModel/ChildPageModel.tsx +114 -0
- package/src/flow/models/base/PageModel/MainPageModel.tsx +32 -0
- package/src/flow/models/base/PageModel/OldPageModel.tsx +97 -0
- package/src/flow/models/base/PageModel/PageModel.tsx +486 -0
- package/src/flow/models/base/PageModel/PageTabModel.tsx +259 -0
- package/src/flow/models/base/PageModel/RootPageModel.tsx +161 -0
- package/src/flow/models/base/PageModel/SubPageModel.tsx +32 -0
- package/src/flow/models/base/PageModel/__tests__/ChildPageModel.test.ts +196 -0
- package/src/flow/models/base/PageModel/__tests__/PageModel.beforeCloseGuard.test.ts +111 -0
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +753 -0
- package/src/flow/models/base/PageModel/__tests__/PageTabModel.test.ts +225 -0
- package/src/flow/models/base/PageModel/__tests__/RootPageModel.test.ts +242 -0
- package/src/flow/models/base/PageModel/closeGuard.ts +48 -0
- package/src/flow/models/base/PageModel/index.tsx +16 -0
- package/src/flow/models/base/PopupActionModel.tsx +26 -0
- package/src/flow/models/base/RecordActionModel.tsx +23 -0
- package/src/flow/models/base/RouteModel.tsx +29 -0
- package/src/flow/models/base/__tests__/ActionGroupModel.test.ts +200 -0
- package/src/flow/models/base/__tests__/BlockGridModel.newScene.test.ts +37 -0
- package/src/flow/models/base/__tests__/BlockGridModel.selectSceneAddBlock.test.ts +83 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.capability.test.ts +96 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.dirtyRefresh.association.test.ts +110 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.initialBeforeRenderRefresh.test.ts +131 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.newScene.associatedRecordsVisibility.test.ts +161 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.title.test.ts +95 -0
- package/src/flow/models/base/__tests__/GridModel.computeOverlayRect.test.ts +423 -0
- package/src/flow/models/base/__tests__/GridModel.dragOverlay.test.ts +129 -0
- package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +107 -0
- package/src/flow/models/base/__tests__/GridModel.mergeRows.test.ts +107 -0
- package/src/flow/models/base/__tests__/GridModel.recalculateGridSizes.test.ts +67 -0
- package/src/flow/models/base/__tests__/GridModel.visibleLayout.test.ts +217 -0
- package/src/flow/models/base/__tests__/transformRowsToSingleColumn.test.ts +58 -0
- package/src/flow/models/base/index.ts +26 -0
- package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +161 -0
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +409 -0
- package/src/flow/models/blocks/assign-form/AssignFormModel.tsx +96 -0
- package/src/flow/models/blocks/assign-form/index.ts +12 -0
- package/src/flow/models/blocks/details/DetailsAssociationFieldGroupModel.tsx +18 -0
- package/src/flow/models/blocks/details/DetailsBlockModel.tsx +404 -0
- package/src/flow/models/blocks/details/DetailsCustomItemModel.tsx +51 -0
- package/src/flow/models/blocks/details/DetailsGridModel.tsx +106 -0
- package/src/flow/models/blocks/details/DetailsItemModel.tsx +384 -0
- package/src/flow/models/blocks/details/DetailsJSFieldItemModel.tsx +37 -0
- package/src/flow/models/blocks/details/__tests__/DetailsBlockModel.blockHeight.test.tsx +139 -0
- package/src/flow/models/blocks/details/__tests__/DetailsBlockModel.initialPaginationChangeRefresh.test.ts +128 -0
- package/src/flow/models/blocks/details/__tests__/DetailsItemModel.value.test.ts +49 -0
- package/src/flow/models/blocks/details/index.ts +16 -0
- package/src/flow/models/blocks/details/utils.ts +67 -0
- package/src/flow/models/blocks/filter-form/FieldModelSelect.tsx +59 -0
- package/src/flow/models/blocks/filter-form/FieldOperatorSelect.tsx +109 -0
- package/src/flow/models/blocks/filter-form/FilterFormActionGroupModel.tsx +15 -0
- package/src/flow/models/blocks/filter-form/FilterFormActionModel.tsx +12 -0
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +334 -0
- package/src/flow/models/blocks/filter-form/FilterFormCollapseActionModel.tsx +132 -0
- package/src/flow/models/blocks/filter-form/FilterFormCustomItemModel.tsx +42 -0
- package/src/flow/models/blocks/filter-form/FilterFormGridModel.tsx +218 -0
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +780 -0
- package/src/flow/models/blocks/filter-form/FilterFormJSActionModel.tsx +72 -0
- package/src/flow/models/blocks/filter-form/FilterFormResetActionModel.tsx +52 -0
- package/src/flow/models/blocks/filter-form/FilterFormSubmitActionModel.tsx +49 -0
- package/src/flow/models/blocks/filter-form/SourceCascader.tsx +137 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.onModelCreated.test.ts +247 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.toggleFormFieldsCollapse.test.ts +143 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +329 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.getFilterValue.test.ts +117 -0
- package/src/flow/models/blocks/filter-form/__tests__/customFieldOperators.test.tsx +642 -0
- package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +19 -0
- package/src/flow/models/blocks/filter-form/__tests__/legacyDefaultValueMigration.test.ts +107 -0
- package/src/flow/models/blocks/filter-form/__tests__/valueNormalization.test.ts +50 -0
- package/src/flow/models/blocks/filter-form/customFieldOperators.ts +225 -0
- package/src/flow/models/blocks/filter-form/fields/FieldComponentProps.tsx +474 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.tsx +411 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.tsx +543 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormFieldModel.tsx +12 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.tsx +85 -0
- package/src/flow/models/blocks/filter-form/fields/__tests__/FilterFormCustomFieldModel.recordSelect.test.tsx +633 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/DateOnlyFilterFieldModel.tsx +42 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/DateTimeFilterFieldModel.tsx +17 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/DateTimeNoTzFilterFieldModel.tsx +30 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/DateTimeTzFilterFieldModel.tsx +48 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/components/DateFilterDynamicComponent.tsx +184 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/components/FilterDatePicker.tsx +108 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/components/FilterRangePicker.tsx +84 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/components/__tests__/FilterDatePickers.test.tsx +121 -0
- package/src/flow/models/blocks/filter-form/fields/date-time/index.ts +13 -0
- package/src/flow/models/blocks/filter-form/fields/index.ts +14 -0
- package/src/flow/models/blocks/filter-form/index.ts +25 -0
- package/src/flow/models/blocks/filter-form/legacyDefaultValueMigration.ts +36 -0
- package/src/flow/models/blocks/filter-form/valueNormalization.ts +92 -0
- package/src/flow/models/blocks/filter-manager/FilterManager.ts +488 -0
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.bindToTarget.test.ts +446 -0
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.test.ts +627 -0
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.unbindFromTarget.test.ts +242 -0
- package/src/flow/models/blocks/filter-manager/__tests__/getDefaultOperator.test.ts +69 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/defaultOperator.test.tsx +58 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/connectFields.tsx +488 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/customizeFilterRender.tsx +78 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/defaultOperator.tsx +48 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/index.ts +13 -0
- package/src/flow/models/blocks/filter-manager/flow-actions/operatorComponentProps.tsx +47 -0
- package/src/flow/models/blocks/filter-manager/index.ts +13 -0
- package/src/flow/models/blocks/filter-manager/utils.ts +71 -0
- package/src/flow/models/blocks/form/CreateFormModel.tsx +124 -0
- package/src/flow/models/blocks/form/EditFormModel.tsx +298 -0
- package/src/flow/models/blocks/form/FormActionGroupModel.tsx +15 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +118 -0
- package/src/flow/models/blocks/form/FormAssociationFieldGroupModel.tsx +18 -0
- package/src/flow/models/blocks/form/FormAssociationItemModel.tsx +359 -0
- package/src/flow/models/blocks/form/FormBlockModel.tsx +736 -0
- package/src/flow/models/blocks/form/FormCustomItemModel.tsx +54 -0
- package/src/flow/models/blocks/form/FormGridModel.tsx +106 -0
- package/src/flow/models/blocks/form/FormItemModel.tsx +472 -0
- package/src/flow/models/blocks/form/FormJSFieldItemModel.tsx +36 -0
- package/src/flow/models/blocks/form/JSFormActionModel.tsx +85 -0
- package/src/flow/models/blocks/form/QuickEditFormModel.tsx +303 -0
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +813 -0
- package/src/flow/models/blocks/form/__tests__/QuickEditFormModel.quickEdit.test.ts +69 -0
- package/src/flow/models/blocks/form/__tests__/assignRulesUpdateAssociationValues.test.ts +81 -0
- package/src/flow/models/blocks/form/__tests__/dynamicNamePath.test.ts +33 -0
- package/src/flow/models/blocks/form/__tests__/legacyDefaultValueMigration.test.ts +135 -0
- package/src/flow/models/blocks/form/__tests__/submitValues.test.ts +224 -0
- package/src/flow/models/blocks/form/assignRulesUpdateAssociationValues.ts +73 -0
- package/src/flow/models/blocks/form/dynamicNamePath.ts +68 -0
- package/src/flow/models/blocks/form/index.tsx +23 -0
- package/src/flow/models/blocks/form/legacyDefaultValueMigration.ts +32 -0
- package/src/flow/models/blocks/form/submitHandler.ts +63 -0
- package/src/flow/models/blocks/form/submitValues.ts +227 -0
- package/src/flow/models/blocks/form/value-runtime/__tests__/deps.test.ts +28 -0
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +3270 -0
- package/src/flow/models/blocks/form/value-runtime/__tests__/subtable-nested.test.ts +103 -0
- package/src/flow/models/blocks/form/value-runtime/conditions.ts +22 -0
- package/src/flow/models/blocks/form/value-runtime/deps.ts +181 -0
- package/src/flow/models/blocks/form/value-runtime/form-patch.ts +83 -0
- package/src/flow/models/blocks/form/value-runtime/index.ts +12 -0
- package/src/flow/models/blocks/form/value-runtime/path.ts +144 -0
- package/src/flow/models/blocks/form/value-runtime/rules.ts +1930 -0
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +1118 -0
- package/src/flow/models/blocks/form/value-runtime/types.ts +72 -0
- package/src/flow/models/blocks/form/value-runtime/utils.ts +25 -0
- package/src/flow/models/blocks/index.ts +17 -0
- package/src/flow/models/blocks/js-block/JSBlock.tsx +180 -0
- package/src/flow/models/blocks/js-block/index.ts +10 -0
- package/src/flow/models/blocks/shared/legacyDefaultValueMigrationBase.ts +176 -0
- package/src/flow/models/blocks/table/JSColumnModel.tsx +279 -0
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +238 -0
- package/src/flow/models/blocks/table/TableAssociationFieldGroupModel.tsx +18 -0
- package/src/flow/models/blocks/table/TableBlockModel.tsx +1073 -0
- package/src/flow/models/blocks/table/TableColumnModel.tsx +555 -0
- package/src/flow/models/blocks/table/TableCustomColumnModel.tsx +116 -0
- package/src/flow/models/blocks/table/TableJSFieldItemModel.tsx +38 -0
- package/src/flow/models/blocks/table/TableSelectModel.tsx +75 -0
- package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +282 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.blockHeight.test.tsx +120 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.popupSourceId.test.ts +87 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +72 -0
- package/src/flow/models/blocks/table/__tests__/sortUtils.test.ts +58 -0
- package/src/flow/models/blocks/table/dragSort/dragSortComponents.tsx +90 -0
- package/src/flow/models/blocks/table/dragSort/dragSortHooks.tsx +130 -0
- package/src/flow/models/blocks/table/dragSort/dragSortSettings.ts +62 -0
- package/src/flow/models/blocks/table/dragSort/dragSortUtils.ts +57 -0
- package/src/flow/models/blocks/table/dragSort/index.ts +13 -0
- package/src/flow/models/blocks/table/index.ts +18 -0
- package/src/flow/models/blocks/table/sortUtils.ts +52 -0
- package/src/flow/models/blocks/table/utils.ts +125 -0
- package/src/flow/models/blocks/utils/__tests__/transformChildrenToJS.test.ts +216 -0
- package/src/flow/models/blocks/utils/transformChildrenToJS.ts +158 -0
- package/src/flow/models/fields/AssociationFieldModel/AssociationFieldModel.tsx +47 -0
- package/src/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.tsx +822 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.tsx +19 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.tsx +212 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +909 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.tsx +383 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.tsx +121 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.tsx +101 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/__tests__/popupSubTableBeforeClose.test.ts +98 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/popupSubTableBeforeClose.ts +158 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.tsx +235 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.tsx +18 -0
- package/src/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.tsx +514 -0
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +1005 -0
- package/src/flow/models/fields/AssociationFieldModel/SubFormFieldModel.tsx +649 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +865 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +259 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +395 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/rowIdentity.ts +70 -0
- package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +248 -0
- package/src/flow/models/fields/AssociationFieldModel/__tests__/SubTableRowIdentity.test.ts +45 -0
- package/src/flow/models/fields/AssociationFieldModel/__tests__/recordSelectShared.fieldNames.test.ts +60 -0
- package/src/flow/models/fields/AssociationFieldModel/index.tsx +16 -0
- package/src/flow/models/fields/AssociationFieldModel/itemChain.ts +362 -0
- package/src/flow/models/fields/AssociationFieldModel/recordSelectShared.tsx +283 -0
- package/src/flow/models/fields/CheckboxFieldModel.tsx +31 -0
- package/src/flow/models/fields/CheckboxGroupFieldModel.tsx +25 -0
- package/src/flow/models/fields/ClickableFieldModel.tsx +286 -0
- package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +94 -0
- package/src/flow/models/fields/ColorFieldModel.tsx +61 -0
- package/src/flow/models/fields/DateTimeFieldModel/DateOnlyFieldModel.tsx +61 -0
- package/src/flow/models/fields/DateTimeFieldModel/DateTimeFieldModel.tsx +26 -0
- package/src/flow/models/fields/DateTimeFieldModel/DateTimeNoTzFieldModel.tsx +53 -0
- package/src/flow/models/fields/DateTimeFieldModel/DateTimeTzFieldModel.tsx +96 -0
- package/src/flow/models/fields/DateTimeFieldModel/index.ts +12 -0
- package/src/flow/models/fields/DisplayAssociationField/DisplaySubItemFieldModel.tsx +70 -0
- package/src/flow/models/fields/DisplayAssociationField/DisplaySubListFieldModel.tsx +136 -0
- package/src/flow/models/fields/DisplayAssociationField/DisplaySubTableFieldModel.tsx +271 -0
- package/src/flow/models/fields/DisplayAssociationField/__tests__/DisplaySubListFieldModel.utils.test.ts +41 -0
- package/src/flow/models/fields/DisplayAssociationField/displaySubListUtils.ts +29 -0
- package/src/flow/models/fields/DisplayAssociationField/index.tsx +12 -0
- package/src/flow/models/fields/DisplayCheckboxFieldModel.tsx +36 -0
- package/src/flow/models/fields/DisplayColorFieldModel.tsx +45 -0
- package/src/flow/models/fields/DisplayDateTimeFieldModel.tsx +59 -0
- package/src/flow/models/fields/DisplayEnumFieldModel.tsx +123 -0
- package/src/flow/models/fields/DisplayHtmlFieldModel.tsx +39 -0
- package/src/flow/models/fields/DisplayIconFieldModel.tsx +24 -0
- package/src/flow/models/fields/DisplayJSONFieldModel.tsx +103 -0
- package/src/flow/models/fields/DisplayNumberFieldModel.tsx +239 -0
- package/src/flow/models/fields/DisplayPasswordFieldModel.tsx +30 -0
- package/src/flow/models/fields/DisplayPercentFieldModel.tsx +165 -0
- package/src/flow/models/fields/DisplayTextFieldModel.tsx +51 -0
- package/src/flow/models/fields/DisplayTimeFieldModel.tsx +47 -0
- package/src/flow/models/fields/DisplayTitleFieldModel.tsx +79 -0
- package/src/flow/models/fields/DisplayURLFieldModel.tsx +41 -0
- package/src/flow/models/fields/DividerItemModel.tsx +100 -0
- package/src/flow/models/fields/IconFieldModel.tsx +172 -0
- package/src/flow/models/fields/InputFieldModel.tsx +65 -0
- package/src/flow/models/fields/JSEditableFieldModel.tsx +219 -0
- package/src/flow/models/fields/JSFieldModel.tsx +184 -0
- package/src/flow/models/fields/JSItemModel.tsx +163 -0
- package/src/flow/models/fields/JsonFieldModel.tsx +121 -0
- package/src/flow/models/fields/MarkdownItemModel.tsx +68 -0
- package/src/flow/models/fields/NumberFieldModel.tsx +68 -0
- package/src/flow/models/fields/PasswordFieldModel.tsx +53 -0
- package/src/flow/models/fields/PercentFieldModel.tsx +53 -0
- package/src/flow/models/fields/RadioGroupFieldModel.tsx +26 -0
- package/src/flow/models/fields/RichTextFieldModel/index.tsx +115 -0
- package/src/flow/models/fields/RichTextFieldModel/registerFontSize.tsx +18 -0
- package/src/flow/models/fields/RichTextFieldModel/registerImageResize.tsx +56 -0
- package/src/flow/models/fields/RichTextFieldModel/registerSmartBreak.tsx +90 -0
- package/src/flow/models/fields/RichTextFieldModel/style.ts +493 -0
- package/src/flow/models/fields/SelectFieldModel.tsx +136 -0
- package/src/flow/models/fields/TextareaFieldModel.tsx +31 -0
- package/src/flow/models/fields/TimeFieldModel.tsx +66 -0
- package/src/flow/models/fields/VariableFieldFormModel.tsx +67 -0
- package/src/flow/models/fields/index.ts +52 -0
- package/src/flow/models/fields/mobile-components/MobileDatePicker.tsx +109 -0
- package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +319 -0
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +93 -0
- package/src/flow/models/fields/mobile-components/MobileTimePicker.tsx +37 -0
- package/src/flow/models/index.ts +14 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +414 -0
- package/src/flow/models/topbar/UserCenterTopbarActionModel.tsx +592 -0
- package/src/flow/models/topbar/index.ts +11 -0
- package/src/flow/models/utils/resolveRunJsParams.ts +24 -0
- package/src/flow/resolveViewParamsToViewList.tsx +79 -0
- package/src/flow/system-settings/SystemSettingsSource.ts +155 -0
- package/src/flow/system-settings/index.ts +11 -0
- package/src/flow/system-settings/useSystemSettings.tsx +51 -0
- package/src/flow/utils/__tests__/actionCapability.test.ts +79 -0
- package/src/flow/utils/__tests__/dispatchEventDeep.test.ts +72 -0
- package/src/flow/utils/__tests__/pagination.test.ts +64 -0
- package/src/flow/utils/actionCapability.ts +150 -0
- package/src/flow/utils/blockUtils.ts +32 -0
- package/src/flow/utils/dispatchEventDeep.ts +66 -0
- package/src/flow/utils/index.ts +12 -0
- package/src/flow/utils/pagination.ts +110 -0
- package/src/flow/utils/useJsonTemplateResolver.ts +25 -0
- package/src/flow-compat/ColorPicker.tsx +88 -0
- package/src/flow-compat/FieldValidation.tsx +598 -0
- package/src/flow-compat/HighPerformanceSpin.tsx +45 -0
- package/src/flow-compat/Icon.tsx +11 -0
- package/src/flow-compat/IconPicker.tsx +186 -0
- package/src/flow-compat/Password.tsx +78 -0
- package/src/flow-compat/PasswordStrength.tsx +27 -0
- package/src/flow-compat/Popover.tsx +60 -0
- package/src/flow-compat/data.ts +21 -0
- package/src/flow-compat/date.ts +116 -0
- package/src/flow-compat/fieldValidationConstants.ts +305 -0
- package/src/flow-compat/index.ts +28 -0
- package/src/flow-compat/lazy.tsx +110 -0
- package/src/flow-compat/operators.ts +367 -0
- package/src/flow-compat/passwordUtils.ts +153 -0
- package/src/flow-compat/routeTypes.ts +61 -0
- package/src/flow-compat/useFullscreenOverlay.ts +139 -0
- package/src/flow-compat/zIndexContext.tsx +28 -0
- package/src/hooks/useApp.ts +5 -3
- package/src/hooks/usePlugin.ts +2 -2
- package/src/i18n.ts +25 -0
- package/src/index.ts +20 -0
- package/src/locale/languageCodes.ts +83 -0
- package/src/nocobase-buildin-plugin/index.tsx +318 -0
- package/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts +61 -0
- package/src/nocobase-buildin-plugin/plugins/dayjsLocale.ts +77 -0
- package/src/nocobase-buildin-plugin/plugins/loadConstrueLocale.ts +182 -0
- package/src/react-is.d.ts +12 -0
- package/src/settings-center/AdminSettingsLayout.tsx +333 -0
- package/src/settings-center/AdminSettingsLayoutModel.tsx +32 -0
- package/src/settings-center/PluginManagerPage.tsx +162 -0
- package/src/settings-center/SystemSettingsPage.tsx +298 -0
- package/src/settings-center/index.ts +14 -0
- package/src/settings-center/utils.tsx +277 -0
- package/src/theme/AntdAppProvider.tsx +52 -0
- package/src/theme/compatOldTheme.ts +21 -0
- package/src/theme/customAlgorithm.ts +43 -0
- package/src/theme/defaultTheme.ts +32 -0
- package/src/theme/index.tsx +104 -0
- package/src/theme/type.ts +50 -0
- package/src/utils/globalDeps.ts +3 -0
- package/src/utils/index.tsx +8 -4
- package/src/utils/remotePlugins.ts +10 -13
- package/lib/Application.d.ts +0 -124
- package/lib/Application.js +0 -499
- package/lib/MockApplication.d.ts +0 -16
- package/lib/MockApplication.js +0 -96
- package/lib/Plugin.d.ts +0 -33
- package/lib/Plugin.js +0 -89
- package/lib/PluginManager.d.ts +0 -46
- package/lib/PluginManager.js +0 -114
- package/lib/PluginSettingsManager.d.ts +0 -68
- package/lib/PluginSettingsManager.js +0 -149
- package/lib/RouterManager.d.ts +0 -69
- package/lib/RouterManager.js +0 -231
- package/lib/WebSocketClient.d.ts +0 -45
- package/lib/WebSocketClient.js +0 -217
- package/lib/components/BlankComponent.js +0 -48
- package/lib/components/MainComponent.js +0 -54
- package/lib/components/RouterBridge.js +0 -66
- package/lib/components/RouterContextCleaner.js +0 -61
- package/lib/components/index.js +0 -32
- package/lib/context.js +0 -38
- package/lib/hooks/index.js +0 -34
- package/lib/hooks/useApp.js +0 -41
- package/lib/hooks/usePlugin.js +0 -42
- package/lib/hooks/useRouter.js +0 -41
- package/lib/utils/globalDeps.js +0 -82
- package/lib/utils/index.js +0 -79
- package/lib/utils/remotePlugins.d.ts +0 -44
- package/lib/utils/remotePlugins.js +0 -131
- package/lib/utils/requirejs.js +0 -1361
- package/lib/utils/types.d.ts +0 -330
- package/lib/utils/types.js +0 -28
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { createAssociationAwareObjectMetaFactory, createAssociationSubpathResolver } from '@nocobase/flow-engine';
|
|
11
|
+
|
|
12
|
+
export type ItemChain = {
|
|
13
|
+
index?: number;
|
|
14
|
+
length?: number;
|
|
15
|
+
__is_new__?: boolean;
|
|
16
|
+
__is_stored__?: boolean;
|
|
17
|
+
value: any;
|
|
18
|
+
parentItem?: ItemChain;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ItemChainResolver = (subPath: string) => boolean;
|
|
22
|
+
|
|
23
|
+
export type ParentItemAccessors = {
|
|
24
|
+
parentPropertiesAccessor: (ctx?: any) => any;
|
|
25
|
+
parentItemMetaAccessor: () => any;
|
|
26
|
+
parentItemResolverAccessor: () => ItemChainResolver | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function createItemChainGetter(options: {
|
|
30
|
+
valueAccessor: () => any;
|
|
31
|
+
parentItemAccessor?: () => ItemChain | undefined;
|
|
32
|
+
indexAccessor?: () => number | undefined;
|
|
33
|
+
lengthAccessor?: () => number | undefined;
|
|
34
|
+
isNewAccessor?: () => boolean | undefined;
|
|
35
|
+
isStoredAccessor?: () => boolean | undefined;
|
|
36
|
+
}): () => ItemChain {
|
|
37
|
+
return () => {
|
|
38
|
+
const value = options.valueAccessor();
|
|
39
|
+
return {
|
|
40
|
+
index: options.indexAccessor?.(),
|
|
41
|
+
length: options.lengthAccessor?.(),
|
|
42
|
+
__is_new__: options.isNewAccessor?.() ?? value?.__is_new__,
|
|
43
|
+
__is_stored__: options.isStoredAccessor?.() ?? value?.__is_stored__,
|
|
44
|
+
value,
|
|
45
|
+
parentItem: options.parentItemAccessor?.(),
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function createRootItemChain(formValues: any): ItemChain {
|
|
51
|
+
return {
|
|
52
|
+
index: undefined,
|
|
53
|
+
__is_new__: formValues?.__is_new__,
|
|
54
|
+
__is_stored__: formValues?.__is_stored__,
|
|
55
|
+
value: formValues,
|
|
56
|
+
parentItem: undefined,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function resolveRecordPersistenceState(
|
|
61
|
+
record: any,
|
|
62
|
+
filterTargetKey: string | string[] | null | undefined,
|
|
63
|
+
): {
|
|
64
|
+
record: any;
|
|
65
|
+
hasPrimaryKey: boolean;
|
|
66
|
+
isNew: boolean;
|
|
67
|
+
isStored: boolean;
|
|
68
|
+
} {
|
|
69
|
+
const hasPrimaryKey = Array.isArray(filterTargetKey)
|
|
70
|
+
? filterTargetKey.length > 0 && filterTargetKey.every((key) => record?.[key] != null)
|
|
71
|
+
: filterTargetKey
|
|
72
|
+
? record?.[filterTargetKey] != null
|
|
73
|
+
: false;
|
|
74
|
+
const isNew = !!record?.__is_new__ || !hasPrimaryKey;
|
|
75
|
+
const isStored = !!record?.__is_stored__ || (!isNew && hasPrimaryKey);
|
|
76
|
+
return {
|
|
77
|
+
record,
|
|
78
|
+
hasPrimaryKey,
|
|
79
|
+
isNew,
|
|
80
|
+
isStored,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function buildCurrentItemTitle(t: (key: string) => string, collectionField?: any, fallbackName?: string) {
|
|
85
|
+
const rawLabel =
|
|
86
|
+
(typeof collectionField?.title === 'string' && collectionField.title) ||
|
|
87
|
+
(typeof collectionField?.name === 'string' && collectionField.name) ||
|
|
88
|
+
fallbackName;
|
|
89
|
+
const label = typeof rawLabel === 'string' && rawLabel ? t(rawLabel) : '';
|
|
90
|
+
return label ? `${t('Current item')}(${label})` : t('Current item');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function createParentItemAccessorsFromContext(options: {
|
|
94
|
+
parentContextAccessor: () => any;
|
|
95
|
+
fallbackParentPropertiesAccessor?: (ctx?: any) => any;
|
|
96
|
+
}): ParentItemAccessors {
|
|
97
|
+
return {
|
|
98
|
+
parentPropertiesAccessor: (ctx?: any) => {
|
|
99
|
+
return options.parentContextAccessor?.()?.item?.value ?? options.fallbackParentPropertiesAccessor?.(ctx);
|
|
100
|
+
},
|
|
101
|
+
parentItemMetaAccessor: () => options.parentContextAccessor?.()?.getPropertyOptions?.('item')?.meta,
|
|
102
|
+
parentItemResolverAccessor: () =>
|
|
103
|
+
options.parentContextAccessor?.()?.getPropertyOptions?.('item')?.resolveOnServer as ItemChainResolver | undefined,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function createParentItemAccessorsFromInputArgs(inputArgsAccessor: () => any): ParentItemAccessors {
|
|
108
|
+
return {
|
|
109
|
+
parentPropertiesAccessor: () => (inputArgsAccessor?.()?.parentItem as ItemChain | undefined)?.value,
|
|
110
|
+
parentItemMetaAccessor: () => inputArgsAccessor?.()?.parentItemMeta,
|
|
111
|
+
parentItemResolverAccessor: () => inputArgsAccessor?.()?.parentItemResolver as ItemChainResolver | undefined,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function createScopedItemContext(ctx: any, item: any) {
|
|
116
|
+
if (!ctx || typeof ctx !== 'object') {
|
|
117
|
+
return { item };
|
|
118
|
+
}
|
|
119
|
+
const scoped = Object.create(ctx);
|
|
120
|
+
Object.defineProperty(scoped, 'item', {
|
|
121
|
+
value: item,
|
|
122
|
+
configurable: true,
|
|
123
|
+
enumerable: true,
|
|
124
|
+
writable: false,
|
|
125
|
+
});
|
|
126
|
+
return scoped;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function resolveMetaFactory(metaOrFactory: any) {
|
|
130
|
+
if (!metaOrFactory) return null;
|
|
131
|
+
if (typeof metaOrFactory === 'function') {
|
|
132
|
+
return (await metaOrFactory()) || null;
|
|
133
|
+
}
|
|
134
|
+
return metaOrFactory;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function createItemChainMetaFactory(options: {
|
|
138
|
+
t: (key: string) => string;
|
|
139
|
+
title: string;
|
|
140
|
+
showIndex?: boolean;
|
|
141
|
+
showParentIndex?: boolean;
|
|
142
|
+
disableValueBranch?: boolean;
|
|
143
|
+
valueBranchDisabledReason?: string;
|
|
144
|
+
collectionAccessor: () => any;
|
|
145
|
+
propertiesAccessor: (ctx: any) => any;
|
|
146
|
+
parentCollectionAccessor?: () => any;
|
|
147
|
+
parentPropertiesAccessor?: (ctx: any) => any;
|
|
148
|
+
parentItemMetaAccessor?: () => any;
|
|
149
|
+
}) {
|
|
150
|
+
const {
|
|
151
|
+
t,
|
|
152
|
+
title,
|
|
153
|
+
showIndex,
|
|
154
|
+
showParentIndex,
|
|
155
|
+
disableValueBranch,
|
|
156
|
+
valueBranchDisabledReason,
|
|
157
|
+
collectionAccessor,
|
|
158
|
+
propertiesAccessor,
|
|
159
|
+
parentCollectionAccessor,
|
|
160
|
+
parentPropertiesAccessor,
|
|
161
|
+
parentItemMetaAccessor,
|
|
162
|
+
} = options;
|
|
163
|
+
const propertiesMetaFactory = createAssociationAwareObjectMetaFactory(collectionAccessor, title, propertiesAccessor);
|
|
164
|
+
const fallbackParentPropertiesMetaFactory = parentCollectionAccessor
|
|
165
|
+
? createAssociationAwareObjectMetaFactory(
|
|
166
|
+
parentCollectionAccessor,
|
|
167
|
+
title,
|
|
168
|
+
(ctx) => parentPropertiesAccessor?.(ctx) ?? ctx?.item?.parentItem?.value,
|
|
169
|
+
)
|
|
170
|
+
: null;
|
|
171
|
+
|
|
172
|
+
const factory: any = async () => {
|
|
173
|
+
const propertiesMeta = await propertiesMetaFactory();
|
|
174
|
+
if (!propertiesMeta) return null;
|
|
175
|
+
|
|
176
|
+
const parentItemMeta = await resolveMetaFactory(parentItemMetaAccessor?.());
|
|
177
|
+
const fallbackParentPropertiesMeta = fallbackParentPropertiesMetaFactory
|
|
178
|
+
? await fallbackParentPropertiesMetaFactory()
|
|
179
|
+
: null;
|
|
180
|
+
|
|
181
|
+
const buildVars = (propertiesMeta as any).buildVariablesParams;
|
|
182
|
+
const parentBuildVars = parentItemMeta
|
|
183
|
+
? (parentItemMeta as any).buildVariablesParams
|
|
184
|
+
: (fallbackParentPropertiesMeta as any)?.buildVariablesParams;
|
|
185
|
+
|
|
186
|
+
const createIndexMeta = () => ({ type: 'number', title: t('Index (starts from 0)') });
|
|
187
|
+
const createLengthMeta = () => ({ type: 'number', title: t('Total count') });
|
|
188
|
+
|
|
189
|
+
const properties: Record<string, any> = {};
|
|
190
|
+
if (showIndex !== false) {
|
|
191
|
+
properties.index = createIndexMeta();
|
|
192
|
+
properties.length = createLengthMeta();
|
|
193
|
+
}
|
|
194
|
+
properties.value = {
|
|
195
|
+
...(propertiesMeta as any),
|
|
196
|
+
title: t('Attributes'),
|
|
197
|
+
...(disableValueBranch
|
|
198
|
+
? {
|
|
199
|
+
disabled: true,
|
|
200
|
+
disabledReason: valueBranchDisabledReason || t('Attributes are unavailable before selecting a record'),
|
|
201
|
+
}
|
|
202
|
+
: {}),
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
if (parentItemMeta) {
|
|
206
|
+
properties.parentItem = {
|
|
207
|
+
...(parentItemMeta as any),
|
|
208
|
+
title: parentItemMeta.title?.replace(t('Current item'), t('Parent item')) || t('Parent item'),
|
|
209
|
+
};
|
|
210
|
+
} else {
|
|
211
|
+
const parentProperties: Record<string, any> = {};
|
|
212
|
+
if (showParentIndex !== false) {
|
|
213
|
+
parentProperties.index = createIndexMeta();
|
|
214
|
+
parentProperties.length = createLengthMeta();
|
|
215
|
+
}
|
|
216
|
+
parentProperties.value = fallbackParentPropertiesMeta
|
|
217
|
+
? { ...(fallbackParentPropertiesMeta as any), title: t('Attributes') }
|
|
218
|
+
: { type: 'object', title: t('Attributes') };
|
|
219
|
+
properties.parentItem = {
|
|
220
|
+
type: 'object',
|
|
221
|
+
title: parentItemMeta?.title?.replace(t('Current item'), t('Parent item')) || t('Parent item'),
|
|
222
|
+
properties: parentProperties,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const meta: any = {
|
|
227
|
+
type: 'object',
|
|
228
|
+
title,
|
|
229
|
+
properties,
|
|
230
|
+
buildVariablesParams: async (ctx: any) => {
|
|
231
|
+
const out: Record<string, any> = {};
|
|
232
|
+
|
|
233
|
+
if (!disableValueBranch && typeof buildVars === 'function') {
|
|
234
|
+
const built = await buildVars(ctx);
|
|
235
|
+
if (built && typeof built === 'object' && Object.keys(built).length) {
|
|
236
|
+
out.value = built;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (typeof parentBuildVars === 'function') {
|
|
241
|
+
const built = await parentBuildVars(createScopedItemContext(ctx, ctx?.item?.parentItem));
|
|
242
|
+
if (built && typeof built === 'object' && Object.keys(built).length) {
|
|
243
|
+
out.parentItem = parentItemMeta ? built : { value: built };
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return out;
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
return meta;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
factory.title = title;
|
|
255
|
+
return factory;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function createItemChainResolver(options: {
|
|
259
|
+
collectionAccessor: () => any;
|
|
260
|
+
disableValueBranch?: boolean;
|
|
261
|
+
propertiesAccessor?: () => unknown;
|
|
262
|
+
parentCollectionAccessor?: () => any;
|
|
263
|
+
parentPropertiesAccessor?: () => unknown;
|
|
264
|
+
parentItemResolverAccessor?: () => ((subPath: string) => boolean) | undefined;
|
|
265
|
+
}): (subPath: string) => boolean {
|
|
266
|
+
const base = createAssociationSubpathResolver(options.collectionAccessor, options.propertiesAccessor);
|
|
267
|
+
const baseParent =
|
|
268
|
+
typeof options.parentCollectionAccessor === 'function'
|
|
269
|
+
? createAssociationSubpathResolver(options.parentCollectionAccessor, options.parentPropertiesAccessor)
|
|
270
|
+
: null;
|
|
271
|
+
return (p: string) => {
|
|
272
|
+
const raw = String(p || '');
|
|
273
|
+
if (!raw) return false;
|
|
274
|
+
if (raw === 'value') return false;
|
|
275
|
+
if (raw.startsWith('value.')) {
|
|
276
|
+
if (options.disableValueBranch) return false;
|
|
277
|
+
return base(raw.slice('value.'.length));
|
|
278
|
+
}
|
|
279
|
+
if (raw === 'parentItem') return false;
|
|
280
|
+
if (raw.startsWith('parentItem.')) {
|
|
281
|
+
const parentPath = raw.slice('parentItem.'.length);
|
|
282
|
+
const parentResolver = options.parentItemResolverAccessor?.();
|
|
283
|
+
if (typeof parentResolver === 'function') {
|
|
284
|
+
return parentResolver(parentPath);
|
|
285
|
+
}
|
|
286
|
+
if (parentPath === 'value') return false;
|
|
287
|
+
if (parentPath.startsWith('value.')) {
|
|
288
|
+
return baseParent ? baseParent(parentPath.slice('value.'.length)) : false;
|
|
289
|
+
}
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
return false;
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export type ItemChainMetaAndResolverOptions = {
|
|
297
|
+
metaFactoryOptions: Parameters<typeof createItemChainMetaFactory>[0];
|
|
298
|
+
resolverOptions: Parameters<typeof createItemChainResolver>[0];
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export function createItemChainMetaAndResolver(options: ItemChainMetaAndResolverOptions) {
|
|
302
|
+
return {
|
|
303
|
+
meta: createItemChainMetaFactory(options.metaFactoryOptions),
|
|
304
|
+
resolveOnServer: createItemChainResolver(options.resolverOptions),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export type AssociationItemChainContextPropertyOptions = {
|
|
309
|
+
t: (key: string) => string;
|
|
310
|
+
title: string;
|
|
311
|
+
showIndex?: boolean;
|
|
312
|
+
showParentIndex?: boolean;
|
|
313
|
+
disableValueBranch?: boolean;
|
|
314
|
+
valueBranchDisabledReason?: string;
|
|
315
|
+
collectionAccessor: () => any;
|
|
316
|
+
propertiesAccessor: (ctx: any) => any;
|
|
317
|
+
resolverPropertiesAccessor?: () => unknown;
|
|
318
|
+
parentCollectionAccessor?: () => any;
|
|
319
|
+
parentAccessors?: Partial<ParentItemAccessors>;
|
|
320
|
+
useParentItemMeta?: boolean;
|
|
321
|
+
useParentItemResolver?: boolean;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export function createAssociationItemChainContextPropertyOptions(options: AssociationItemChainContextPropertyOptions) {
|
|
325
|
+
const parentPropertiesAccessor = options.parentAccessors?.parentPropertiesAccessor;
|
|
326
|
+
const parentItemMetaAccessor =
|
|
327
|
+
options.useParentItemMeta === false ? undefined : options.parentAccessors?.parentItemMetaAccessor;
|
|
328
|
+
const parentItemResolverAccessor =
|
|
329
|
+
options.useParentItemResolver === false ? undefined : options.parentAccessors?.parentItemResolverAccessor;
|
|
330
|
+
|
|
331
|
+
return createItemChainContextPropertyOptions({
|
|
332
|
+
metaFactoryOptions: {
|
|
333
|
+
t: options.t,
|
|
334
|
+
title: options.title,
|
|
335
|
+
showIndex: options.showIndex,
|
|
336
|
+
showParentIndex: options.showParentIndex,
|
|
337
|
+
disableValueBranch: options.disableValueBranch,
|
|
338
|
+
valueBranchDisabledReason: options.valueBranchDisabledReason,
|
|
339
|
+
collectionAccessor: options.collectionAccessor,
|
|
340
|
+
propertiesAccessor: options.propertiesAccessor,
|
|
341
|
+
parentCollectionAccessor: options.parentCollectionAccessor,
|
|
342
|
+
parentPropertiesAccessor,
|
|
343
|
+
parentItemMetaAccessor,
|
|
344
|
+
},
|
|
345
|
+
resolverOptions: {
|
|
346
|
+
collectionAccessor: options.collectionAccessor,
|
|
347
|
+
disableValueBranch: options.disableValueBranch,
|
|
348
|
+
propertiesAccessor: options.resolverPropertiesAccessor,
|
|
349
|
+
parentCollectionAccessor: options.parentCollectionAccessor,
|
|
350
|
+
parentPropertiesAccessor,
|
|
351
|
+
parentItemResolverAccessor,
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export function createItemChainContextPropertyOptions(options: ItemChainMetaAndResolverOptions) {
|
|
357
|
+
return {
|
|
358
|
+
cache: false as const,
|
|
359
|
+
...createItemChainMetaAndResolver(options),
|
|
360
|
+
serverOnlyWhenContextParams: true as const,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
createCurrentRecordMetaFactory,
|
|
12
|
+
FlowModel,
|
|
13
|
+
useFlowModel,
|
|
14
|
+
type FlowRuntimeContext,
|
|
15
|
+
} from '@nocobase/flow-engine';
|
|
16
|
+
import type { SelectProps } from 'antd';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { omit } from 'lodash';
|
|
19
|
+
|
|
20
|
+
export interface AssociationFieldNames {
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const isPlaceholderFieldName = (value: unknown, fallback: 'label' | 'value') => value === fallback;
|
|
26
|
+
|
|
27
|
+
const unwrapAssociationOptionRecord = (option: unknown): Record<string, unknown> | undefined => {
|
|
28
|
+
if (option && typeof option === 'object') {
|
|
29
|
+
const raw = (option as Record<string, unknown>).data;
|
|
30
|
+
if (raw && typeof raw === 'object') {
|
|
31
|
+
return raw as Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
return option as Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function normalizeFilterTargetKey(filterTargetKey: unknown): string | undefined {
|
|
39
|
+
if (typeof filterTargetKey === 'string' && filterTargetKey) {
|
|
40
|
+
return filterTargetKey;
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(filterTargetKey) && filterTargetKey.length === 1 && typeof filterTargetKey[0] === 'string') {
|
|
43
|
+
return filterTargetKey[0];
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function normalizeAssociationFieldNames(
|
|
49
|
+
fieldNames: Partial<AssociationFieldNames> | undefined,
|
|
50
|
+
targetCollection?: any,
|
|
51
|
+
): AssociationFieldNames {
|
|
52
|
+
const titleCollectionFieldName =
|
|
53
|
+
typeof targetCollection?.titleCollectionField?.name === 'string'
|
|
54
|
+
? targetCollection.titleCollectionField.name
|
|
55
|
+
: undefined;
|
|
56
|
+
const fallbackValue = normalizeFilterTargetKey(targetCollection?.filterTargetKey) || 'id';
|
|
57
|
+
const explicitValue =
|
|
58
|
+
typeof fieldNames?.value === 'string' && fieldNames.value && !isPlaceholderFieldName(fieldNames.value, 'value')
|
|
59
|
+
? fieldNames.value
|
|
60
|
+
: undefined;
|
|
61
|
+
const explicitLabel =
|
|
62
|
+
typeof fieldNames?.label === 'string' && fieldNames.label && !isPlaceholderFieldName(fieldNames.label, 'label')
|
|
63
|
+
? fieldNames.label
|
|
64
|
+
: undefined;
|
|
65
|
+
const value = explicitValue || fallbackValue;
|
|
66
|
+
const label = explicitLabel || titleCollectionFieldName || value;
|
|
67
|
+
|
|
68
|
+
return { label, value };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type AssociationOption = Record<string, any>;
|
|
72
|
+
export type PopupScrollEvent = Parameters<NonNullable<SelectProps<any>['onPopupScroll']>>[0];
|
|
73
|
+
|
|
74
|
+
export function buildOpenerUids(ctx: FlowRuntimeContext, inputArgs: Record<string, unknown> = {}): string[] {
|
|
75
|
+
// Keep consistent with `packages/core/client/src/flow/actions/openView.tsx`
|
|
76
|
+
const isRouteManaged = !!(inputArgs as { navigation?: unknown }).navigation;
|
|
77
|
+
const toStringArray = (val: unknown): string[] | undefined => {
|
|
78
|
+
if (!Array.isArray(val)) return undefined;
|
|
79
|
+
return val.filter((item): item is string => typeof item === 'string' && !!item);
|
|
80
|
+
};
|
|
81
|
+
const viewOpenerUids = toStringArray(ctx.view?.inputArgs?.openerUids);
|
|
82
|
+
const inputOpenerUids = toStringArray(inputArgs.openerUids);
|
|
83
|
+
const parentOpenerUids = viewOpenerUids || inputOpenerUids || [];
|
|
84
|
+
if (isRouteManaged) {
|
|
85
|
+
return (inputOpenerUids || parentOpenerUids).filter(Boolean);
|
|
86
|
+
}
|
|
87
|
+
const viewUidFromView = (ctx.view?.inputArgs as { viewUid?: unknown } | undefined)?.viewUid;
|
|
88
|
+
const viewUidFromModel = (ctx.model.context?.inputArgs as { viewUid?: unknown } | undefined)?.viewUid;
|
|
89
|
+
const openerUid =
|
|
90
|
+
typeof viewUidFromView === 'string' && viewUidFromView
|
|
91
|
+
? viewUidFromView
|
|
92
|
+
: typeof viewUidFromModel === 'string' && viewUidFromModel
|
|
93
|
+
? viewUidFromModel
|
|
94
|
+
: ctx.model.uid;
|
|
95
|
+
return [...parentOpenerUids, openerUid].filter(Boolean);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface LazySelectProps extends Omit<SelectProps<any>, 'mode' | 'options' | 'value' | 'onChange'> {
|
|
99
|
+
fieldNames: AssociationFieldNames;
|
|
100
|
+
value?: AssociationOption | AssociationOption[] | string | string[] | number | number[];
|
|
101
|
+
multiple?: boolean;
|
|
102
|
+
allowMultiple?: boolean;
|
|
103
|
+
// 在特定场景(如默认值弹窗)下,多选点击选项后保持下拉展开
|
|
104
|
+
keepDropdownOpenOnSelect?: boolean;
|
|
105
|
+
options?: AssociationOption[];
|
|
106
|
+
valueMode?: 'record' | 'value';
|
|
107
|
+
onChange: (option: AssociationOption | AssociationOption[] | string | string[] | number | number[]) => void;
|
|
108
|
+
onDropdownVisibleChange?: (open: boolean) => void;
|
|
109
|
+
onPopupScroll?: SelectProps<any>['onPopupScroll'];
|
|
110
|
+
onSearch?: SelectProps<any>['onSearch'];
|
|
111
|
+
loading?: boolean;
|
|
112
|
+
onCompositionStart?: (e: any) => void;
|
|
113
|
+
onCompositionEnd?: (e: any, flag?: boolean) => void;
|
|
114
|
+
quickCreate?: 'none' | 'modalAdd' | 'quickAdd';
|
|
115
|
+
onModalAddClick?: (e: any) => void;
|
|
116
|
+
onDropdownAddClick?: (e: any) => void;
|
|
117
|
+
searchText?: string;
|
|
118
|
+
allowCreate?: boolean;
|
|
119
|
+
allowEdit?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface LabelByFieldProps {
|
|
123
|
+
option: AssociationOption;
|
|
124
|
+
fieldNames: AssociationFieldNames;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function toSafeDisplayLabel(value: unknown): string | number | boolean | undefined {
|
|
128
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (Array.isArray(value)) {
|
|
133
|
+
const parts = value
|
|
134
|
+
.map((item) => {
|
|
135
|
+
if (typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean') {
|
|
136
|
+
return item;
|
|
137
|
+
}
|
|
138
|
+
if (item && typeof item === 'object') {
|
|
139
|
+
const nested = (item as Record<string, unknown>).label ?? (item as Record<string, unknown>).name;
|
|
140
|
+
if (typeof nested === 'string' || typeof nested === 'number' || typeof nested === 'boolean') {
|
|
141
|
+
return nested;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
})
|
|
146
|
+
.filter((item): item is string | number | boolean => item !== undefined);
|
|
147
|
+
|
|
148
|
+
return parts.length ? parts.map(String).join(', ') : undefined;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (value && typeof value === 'object') {
|
|
152
|
+
const nested = (value as Record<string, unknown>).label ?? (value as Record<string, unknown>).name;
|
|
153
|
+
if (typeof nested === 'string' || typeof nested === 'number' || typeof nested === 'boolean') {
|
|
154
|
+
return nested;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function LabelByField(props: Readonly<LabelByFieldProps>) {
|
|
162
|
+
const { option, fieldNames } = props;
|
|
163
|
+
const currentModel = useFlowModel();
|
|
164
|
+
const record = unwrapAssociationOptionRecord(option);
|
|
165
|
+
const normalizedFieldNames = normalizeAssociationFieldNames(
|
|
166
|
+
fieldNames,
|
|
167
|
+
currentModel.context.collectionField?.targetCollection,
|
|
168
|
+
);
|
|
169
|
+
const field: any = currentModel.subModels.field as FlowModel;
|
|
170
|
+
const labelValue =
|
|
171
|
+
toSafeDisplayLabel(record?.[normalizedFieldNames.label]) ??
|
|
172
|
+
toSafeDisplayLabel(record?.label) ??
|
|
173
|
+
toSafeDisplayLabel(record?.[normalizedFieldNames.value]);
|
|
174
|
+
if (!field) {
|
|
175
|
+
return <span>{labelValue ?? 'N/A'}</span>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const optionKey = String(record?.[normalizedFieldNames.value] ?? labelValue ?? 'association-option');
|
|
179
|
+
const fieldModel = field.createFork({}, optionKey);
|
|
180
|
+
fieldModel.context.defineProperty('record', {
|
|
181
|
+
get: () => record,
|
|
182
|
+
cache: false,
|
|
183
|
+
meta: createCurrentRecordMetaFactory(fieldModel.context, () => fieldModel.context.collection),
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const titleCollectionField = currentModel.context.collectionField.targetCollection?.getField?.(
|
|
187
|
+
normalizedFieldNames.label,
|
|
188
|
+
);
|
|
189
|
+
const titleFieldComponentProps =
|
|
190
|
+
titleCollectionField && typeof titleCollectionField.getComponentProps === 'function'
|
|
191
|
+
? titleCollectionField.getComponentProps()
|
|
192
|
+
: {};
|
|
193
|
+
fieldModel.setProps({ value: labelValue, clickToOpen: false, ...titleFieldComponentProps });
|
|
194
|
+
|
|
195
|
+
const renderedLabel =
|
|
196
|
+
labelValue !== null && typeof labelValue !== 'undefined' && labelValue !== ''
|
|
197
|
+
? (fieldModel.render() as React.ReactNode)
|
|
198
|
+
: 'N/A';
|
|
199
|
+
|
|
200
|
+
return <span style={{ pointerEvents: 'none' }}>{renderedLabel}</span>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function toSelectValue(
|
|
204
|
+
record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined,
|
|
205
|
+
fieldNames: AssociationFieldNames,
|
|
206
|
+
multiple = false,
|
|
207
|
+
valueMode: 'record' | 'value' = 'record',
|
|
208
|
+
options: AssociationOption[] = [],
|
|
209
|
+
) {
|
|
210
|
+
if (!record) return multiple ? [] : undefined;
|
|
211
|
+
|
|
212
|
+
const { value: valueKey } = fieldNames || {};
|
|
213
|
+
|
|
214
|
+
const isAssociationOption = (item: unknown): item is AssociationOption => typeof item === 'object' && item !== null;
|
|
215
|
+
|
|
216
|
+
const convert = (item: AssociationOption): any => {
|
|
217
|
+
if (!isAssociationOption(item)) return undefined;
|
|
218
|
+
return {
|
|
219
|
+
label: <LabelByField option={item} fieldNames={fieldNames} />,
|
|
220
|
+
value: item[valueKey],
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
if (valueMode === 'value') {
|
|
225
|
+
const toValue = (item: AssociationOption | string | number): any => {
|
|
226
|
+
if (typeof item === 'object' && item !== null) {
|
|
227
|
+
return convert(item);
|
|
228
|
+
}
|
|
229
|
+
const matchedOption = options.find((option) => option?.[valueKey] === item);
|
|
230
|
+
if (matchedOption) {
|
|
231
|
+
return convert(matchedOption);
|
|
232
|
+
}
|
|
233
|
+
// Handle string or number values
|
|
234
|
+
return {
|
|
235
|
+
label: String(item),
|
|
236
|
+
value: item,
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
if (multiple) {
|
|
240
|
+
if (!Array.isArray(record)) return [];
|
|
241
|
+
return record.map((item) => toValue(item)).filter(Boolean);
|
|
242
|
+
}
|
|
243
|
+
if (Array.isArray(record)) {
|
|
244
|
+
return toValue(record[0]);
|
|
245
|
+
}
|
|
246
|
+
return toValue(record as AssociationOption);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (multiple) {
|
|
250
|
+
if (!Array.isArray(record)) return [];
|
|
251
|
+
return record.filter(isAssociationOption).map(convert).filter(Boolean);
|
|
252
|
+
}
|
|
253
|
+
if (Array.isArray(record)) {
|
|
254
|
+
const first = record[0];
|
|
255
|
+
return isAssociationOption(first) ? convert(first) : undefined;
|
|
256
|
+
}
|
|
257
|
+
return isAssociationOption(record) ? convert(record) : undefined;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function resolveOptions(
|
|
261
|
+
options: AssociationOption[] | undefined,
|
|
262
|
+
value: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined,
|
|
263
|
+
isMultiple: boolean,
|
|
264
|
+
) {
|
|
265
|
+
if (options?.length) {
|
|
266
|
+
return options.map((v) => {
|
|
267
|
+
return omit(v, 'disabled', 'options', 'style');
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (isMultiple) {
|
|
272
|
+
if (Array.isArray(value)) {
|
|
273
|
+
return value.filter((item) => typeof item === 'object' && item !== null) as AssociationOption[];
|
|
274
|
+
}
|
|
275
|
+
return [];
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (value && typeof value === 'object') {
|
|
279
|
+
return [value as AssociationOption];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return [];
|
|
283
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Checkbox } from 'antd';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { EditableItemModel } from '@nocobase/flow-engine';
|
|
13
|
+
import { FieldModel } from '../base/FieldModel';
|
|
14
|
+
|
|
15
|
+
export class CheckboxFieldModel extends FieldModel {
|
|
16
|
+
render() {
|
|
17
|
+
return (
|
|
18
|
+
<Checkbox
|
|
19
|
+
{...this.props}
|
|
20
|
+
checked={this.props.value}
|
|
21
|
+
onChange={(val) => {
|
|
22
|
+
this.props.onChange(val.target.checked);
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
EditableItemModel.bindModelToInterface('CheckboxFieldModel', ['checkbox'], {
|
|
30
|
+
isDefault: true,
|
|
31
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Checkbox } from 'antd';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { EditableItemModel, tExpr } from '@nocobase/flow-engine';
|
|
13
|
+
import { FieldModel } from '../base/FieldModel';
|
|
14
|
+
|
|
15
|
+
export class CheckboxGroupFieldModel extends FieldModel {
|
|
16
|
+
render() {
|
|
17
|
+
return <Checkbox.Group {...this.props} />;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
CheckboxGroupFieldModel.define({
|
|
21
|
+
label: tExpr('CheckboxGroup'),
|
|
22
|
+
});
|
|
23
|
+
EditableItemModel.bindModelToInterface('CheckboxGroupFieldModel', ['checkboxGroup'], {
|
|
24
|
+
isDefault: true,
|
|
25
|
+
});
|