@tachybase/client 0.23.8-alpha.21 → 0.23.8-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api-client/APIClient.mjs +176 -0
- package/lib/api-client/APIClientProvider.mjs +23 -0
- package/lib/api-client/__tests__/APIClient.test.mjs +64 -0
- package/lib/api-client/context.mjs +14 -0
- package/lib/api-client/demos/demo1.mjs +47 -0
- package/lib/api-client/demos/demo2.mjs +46 -0
- package/lib/api-client/demos/demo3.mjs +97 -0
- package/lib/api-client/hooks/assign.mjs +106 -0
- package/lib/api-client/hooks/index.mjs +9 -0
- package/lib/api-client/hooks/useAPIClient.mjs +15 -0
- package/lib/api-client/hooks/useRequest.mjs +70 -0
- package/lib/api-client/hooks/useResource.mjs +12 -0
- package/lib/api-client/index.mjs +11 -0
- package/lib/application/AppSchemaComponentProvider.mjs +48 -0
- package/lib/application/Application.mjs +431 -0
- package/lib/application/AttachmentPreviewManager.mjs +37 -0
- package/lib/application/NoticesManager.mjs +132 -0
- package/lib/application/Plugin.mjs +66 -0
- package/lib/application/PluginContextMenu.mjs +35 -0
- package/lib/application/PluginManager.mjs +113 -0
- package/lib/application/RouterManager.mjs +148 -0
- package/lib/application/SystemSettingsManager.mjs +133 -0
- package/lib/application/UserSettingsManager.mjs +135 -0
- package/lib/application/WebSocketClient.mjs +202 -0
- package/lib/application/__tests__/Application.test.mjs +518 -0
- package/lib/application/__tests__/Plugin.test.mjs +213 -0
- package/lib/application/__tests__/PluginSettingsManager.test.mjs +168 -0
- package/lib/application/__tests__/RouterManager.test.mjs +345 -0
- package/lib/application/__tests__/SchemaInitializer.test.mjs +169 -0
- package/lib/application/__tests__/SchemaToolbar.test.mjs +171 -0
- package/lib/application/__tests__/hoc/withDynamicSchemaProps.test.mjs +207 -0
- package/lib/application/__tests__/hooks.test.mjs +112 -0
- package/lib/application/__tests__/utils/remotePlugins.test.mjs +331 -0
- package/lib/application/__tests__/utils.test.mjs +117 -0
- package/lib/application/components/AppComponent.mjs +78 -0
- package/lib/application/components/BlankComponent.mjs +18 -0
- package/lib/application/components/MainComponent.mjs +29 -0
- package/lib/application/components/RouterContextCleaner.mjs +30 -0
- package/lib/application/components/defaultComponents.mjs +37 -0
- package/lib/application/components/index.mjs +11 -0
- package/lib/application/context.mjs +10 -0
- package/lib/application/demos/demo1.mjs +136 -0
- package/lib/application/demos/demo2.mjs +149 -0
- package/lib/application/demos/demo3.mjs +17 -0
- package/lib/application/hoc/index.mjs +5 -0
- package/lib/application/hoc/withDynamicSchemaProps.mjs +165 -0
- package/lib/application/hooks/index.mjs +9 -0
- package/lib/application/hooks/useApp.mjs +15 -0
- package/lib/application/hooks/usePlugin.mjs +12 -0
- package/lib/application/hooks/useRouter.mjs +12 -0
- package/lib/application/index.mjs +37 -0
- package/lib/application/schema-initializer/SchemaInitializer.mjs +103 -0
- package/lib/application/schema-initializer/SchemaInitializerManager.mjs +86 -0
- package/lib/application/schema-initializer/components/SchemaInitializerActionModal.mjs +134 -0
- package/lib/application/schema-initializer/components/SchemaInitializerButton.mjs +60 -0
- package/lib/application/schema-initializer/components/SchemaInitializerChildren.mjs +91 -0
- package/lib/application/schema-initializer/components/SchemaInitializerDivider.mjs +25 -0
- package/lib/application/schema-initializer/components/SchemaInitializerItem.mjs +124 -0
- package/lib/application/schema-initializer/components/SchemaInitializerItemGroup.mjs +63 -0
- package/lib/application/schema-initializer/components/SchemaInitializerItems.mjs +23 -0
- package/lib/application/schema-initializer/components/SchemaInitializerSelect.mjs +86 -0
- package/lib/application/schema-initializer/components/SchemaInitializerSubMenu.mjs +147 -0
- package/lib/application/schema-initializer/components/SchemaInitializerSwitch.mjs +59 -0
- package/lib/application/schema-initializer/components/index.mjs +23 -0
- package/lib/application/schema-initializer/components/style.mjs +47 -0
- package/lib/application/schema-initializer/context/index.mjs +18 -0
- package/lib/application/schema-initializer/hoc/index.mjs +159 -0
- package/lib/application/schema-initializer/hooks/index.mjs +193 -0
- package/lib/application/schema-initializer/hooks/useAriaAttributeOfMenuItem.mjs +32 -0
- package/lib/application/schema-initializer/index.mjs +17 -0
- package/lib/application/schema-initializer/types.mjs +4 -0
- package/lib/application/schema-settings/SchemaSettings.mjs +94 -0
- package/lib/application/schema-settings/SchemaSettingsDefaults.mjs +241 -0
- package/lib/application/schema-settings/SchemaSettingsManager.mjs +86 -0
- package/lib/application/schema-settings/components/SchemaSettingsChildren.mjs +123 -0
- package/lib/application/schema-settings/components/SchemaSettingsIcon.mjs +34 -0
- package/lib/application/schema-settings/components/SchemaSettingsWrapper.mjs +59 -0
- package/lib/application/schema-settings/components/index.mjs +7 -0
- package/lib/application/schema-settings/context/index.mjs +13 -0
- package/lib/application/schema-settings/hooks/index.mjs +63 -0
- package/lib/application/schema-settings/index.mjs +15 -0
- package/lib/application/schema-settings/types.mjs +4 -0
- package/lib/application/schema-toolbar/context/index.mjs +24 -0
- package/lib/application/schema-toolbar/hooks/index.mjs +46 -0
- package/lib/application/schema-toolbar/index.mjs +7 -0
- package/lib/application/utils/globalDeps.mjs +162 -0
- package/lib/application/utils/index.mjs +59 -0
- package/lib/application/utils/remotePlugins.mjs +129 -0
- package/lib/async-data-provider/index.mjs +37 -0
- package/lib/block-provider/BlockProvider.mjs +401 -0
- package/lib/block-provider/DetailsBlockProvider.mjs +145 -0
- package/lib/block-provider/FilterFormBlockProvider.mjs +42 -0
- package/lib/block-provider/FormBlockProvider.mjs +222 -0
- package/lib/block-provider/FormFieldProvider.mjs +124 -0
- package/lib/block-provider/MobileProvider.mjs +24 -0
- package/lib/block-provider/PageLayout.mjs +25 -0
- package/lib/block-provider/TableBlockProvider.mjs +155 -0
- package/lib/block-provider/TableFieldProvider.mjs +197 -0
- package/lib/block-provider/TableSelectorProvider.mjs +372 -0
- package/lib/block-provider/TreeBlockProvider.mjs +158 -0
- package/lib/block-provider/hooks/index.mjs +1465 -0
- package/lib/block-provider/hooks/useDataBlockSourceId.mjs +33 -0
- package/lib/block-provider/hooks/useFormActiveFields.mjs +56 -0
- package/lib/block-provider/hooks/useIsMobile.mjs +16 -0
- package/lib/block-provider/hooks/useParsedFilter.mjs +85 -0
- package/lib/block-provider/index.mjs +25 -0
- package/lib/built-in/acl/ACLProvider.mjs +396 -0
- package/lib/built-in/acl/ACLShortcut.mjs +46 -0
- package/lib/built-in/acl/Configuration/ConfigureCenter.mjs +182 -0
- package/lib/built-in/acl/Configuration/MenuConfigure.mjs +188 -0
- package/lib/built-in/acl/Configuration/MenuItemsProvider.mjs +66 -0
- package/lib/built-in/acl/Configuration/PermisionProvider.mjs +95 -0
- package/lib/built-in/acl/Configuration/RoleConfigure.mjs +173 -0
- package/lib/built-in/acl/Configuration/RoleTable.mjs +73 -0
- package/lib/built-in/acl/Configuration/RolesResourcesActions.mjs +265 -0
- package/lib/built-in/acl/Configuration/ScopeSelect.mjs +61 -0
- package/lib/built-in/acl/Configuration/StrategyActions.mjs +143 -0
- package/lib/built-in/acl/Configuration/index.mjs +41 -0
- package/lib/built-in/acl/Configuration/schemas/roles.mjs +427 -0
- package/lib/built-in/acl/Configuration/schemas/scopes.mjs +384 -0
- package/lib/built-in/acl/Configuration/schemas/useRoleResourceValues.mjs +46 -0
- package/lib/built-in/acl/Configuration/schemas/useSaveRoleResourceAction.mjs +32 -0
- package/lib/built-in/acl/index.mjs +25 -0
- package/lib/built-in/acl/style.mjs +31 -0
- package/lib/built-in/admin-layout/AdminContent.mjs +34 -0
- package/lib/built-in/admin-layout/AdminTabs.mjs +21 -0
- package/lib/built-in/admin-layout/NoticeArea.mjs +37 -0
- package/lib/built-in/admin-layout/components/AddNewButton.mjs +89 -0
- package/lib/built-in/admin-layout/components/WelcomeCard.mjs +114 -0
- package/lib/built-in/admin-layout/index.mjs +299 -0
- package/lib/built-in/admin-layout/style.mjs +150 -0
- package/lib/built-in/assistant/Assistant.provider.mjs +114 -0
- package/lib/built-in/assistant/ai-chat/index.mjs +359 -0
- package/lib/built-in/assistant/ai-chat/index.module.mjs +9 -0
- package/lib/{index.css → built-in/assistant/ai-chat/index_module.css} +0 -64
- package/lib/built-in/assistant/calculator/AutoScalingText.mjs +45 -0
- package/lib/built-in/assistant/calculator/Calculator.mjs +259 -0
- package/lib/built-in/assistant/calculator/CalculatorDisplay.mjs +34 -0
- package/lib/built-in/assistant/calculator/CalculatorKey.mjs +20 -0
- package/lib/built-in/assistant/calculator/CalculatorProvider.mjs +52 -0
- package/lib/built-in/assistant/calculator/Draggable.mjs +66 -0
- package/lib/built-in/assistant/calculator/style.mjs +33 -0
- package/lib/built-in/assistant/index.mjs +27 -0
- package/lib/built-in/assistant/search-and-jump/index.mjs +75 -0
- package/lib/built-in/attachment-preview/index.mjs +24 -0
- package/lib/built-in/attachment-preview/interface.mjs +4 -0
- package/lib/built-in/attachment-preview/previewers/file-default.mjs +97 -0
- package/lib/built-in/attachment-preview/previewers/file-pdf.mjs +142 -0
- package/lib/built-in/attachment-preview/previewers/file-pdf.style.mjs +53 -0
- package/lib/built-in/attachment-preview/previewers/file-sheet.mjs +132 -0
- package/lib/built-in/attachment-preview/previewers/file-sheet.style.mjs +53 -0
- package/lib/built-in/attachment-preview/previewers/image-jpeg.mjs +43 -0
- package/lib/built-in/attachment-preview/previewers/image-png.mjs +43 -0
- package/lib/built-in/attachment-preview/previewers/image-svg.mjs +29 -0
- package/lib/built-in/attachment-preview/previewers/index.mjs +15 -0
- package/lib/built-in/block-schema-component/index.mjs +186 -0
- package/lib/built-in/built-in-collections/index.mjs +74 -0
- package/lib/built-in/context-menu/ContextMenu.provider.mjs +89 -0
- package/lib/built-in/context-menu/ContextMenuItemsProps.mjs +176 -0
- package/lib/built-in/context-menu/index.mjs +33 -0
- package/lib/built-in/context-menu/useContextMenu.mjs +12 -0
- package/lib/built-in/document-title/index.mjs +75 -0
- package/lib/built-in/dynamic-page/DynamicPage.mjs +67 -0
- package/lib/built-in/dynamic-page/index.mjs +79 -0
- package/lib/built-in/dynamic-page/style.mjs +60 -0
- package/lib/built-in/dynamic-page/utils.mjs +84 -0
- package/lib/built-in/index.mjs +591 -0
- package/lib/built-in/locale/LocalePlugin.mjs +96 -0
- package/lib/built-in/locale/loadConstrueLocale.mjs +193 -0
- package/lib/built-in/page-style/CustomAdminHeader.mjs +24 -0
- package/lib/built-in/page-style/PageStyle.provider.mjs +47 -0
- package/lib/built-in/page-style/TabContent.mjs +97 -0
- package/lib/built-in/page-style/TabHeader.mjs +114 -0
- package/lib/built-in/page-style/index.mjs +29 -0
- package/lib/built-in/page-style/usePageStyle.mjs +15 -0
- package/lib/built-in/page-style/useTabSettings.mjs +97 -0
- package/lib/built-in/pinned-list/PinnedPluginListProvider.mjs +87 -0
- package/lib/built-in/pinned-list/context.mjs +12 -0
- package/lib/built-in/pinned-list/index.mjs +18 -0
- package/lib/built-in/pm/PluginCard.mjs +306 -0
- package/lib/built-in/pm/PluginDetail.mjs +350 -0
- package/lib/built-in/pm/PluginDocument.mjs +99 -0
- package/lib/built-in/pm/PluginForm/form/PluginNpmForm.mjs +189 -0
- package/lib/built-in/pm/PluginForm/form/PluginUploadForm.mjs +142 -0
- package/lib/built-in/pm/PluginForm/form/PluginUrlForm.mjs +133 -0
- package/lib/built-in/pm/PluginForm/modal/PluginAddModal.mjs +88 -0
- package/lib/built-in/pm/PluginForm/modal/PluginUpgradeModal.mjs +92 -0
- package/lib/built-in/pm/PluginManager.mjs +341 -0
- package/lib/built-in/pm/index.mjs +78 -0
- package/lib/built-in/pm/style.mjs +86 -0
- package/lib/built-in/pm/types.mjs +4 -0
- package/lib/built-in/quick-access/Action.mjs +125 -0
- package/lib/built-in/quick-access/Block.mjs +170 -0
- package/lib/built-in/quick-access/CustomRequestActionSchemaInitializerItem.mjs +115 -0
- package/lib/built-in/quick-access/LinkActionSchemaInitializerItem.mjs +108 -0
- package/lib/built-in/quick-access/ModalActionSchemaInitializerItem.mjs +118 -0
- package/lib/built-in/quick-access/PopupActionSchemaInitializerItem.mjs +143 -0
- package/lib/built-in/quick-access/SchemaSettingsBlockTitleItem.mjs +66 -0
- package/lib/built-in/quick-access/blockInitializerItem.mjs +31 -0
- package/lib/built-in/quick-access/blockSchema.mjs +20 -0
- package/lib/built-in/quick-access/blockSettings.mjs +92 -0
- package/lib/built-in/quick-access/configureActions.mjs +25 -0
- package/lib/built-in/quick-access/index.mjs +66 -0
- package/lib/built-in/scroll-assistant/ScrollAssistant.provider.mjs +62 -0
- package/lib/built-in/scroll-assistant/ScrollAssistantStatus.provider.mjs +31 -0
- package/lib/built-in/scroll-assistant/index.mjs +41 -0
- package/lib/built-in/scroll-assistant/useJoystick.mjs +216 -0
- package/lib/built-in/setting-layout/AdminSettings.mjs +174 -0
- package/lib/built-in/setting-layout/SettingLayout.mjs +171 -0
- package/lib/built-in/setting-layout/SettingsCenterDropdown.mjs +104 -0
- package/lib/built-in/system-settings/SystemSettingsProvider.mjs +33 -0
- package/lib/built-in/system-settings/SystemSettingsShortcut.mjs +189 -0
- package/lib/built-in/system-settings/index.mjs +18 -0
- package/lib/built-in/system-version/SystemVersion.provider.mjs +52 -0
- package/lib/built-in/system-version/index.mjs +17 -0
- package/lib/built-in/user-settings/UserSettingsLayout.mjs +221 -0
- package/lib/built-in/user-settings/index.mjs +38 -0
- package/lib/built-in/user-settings/style.mjs +86 -0
- package/lib/collection-manager/CollectionHistoryProvider.mjs +81 -0
- package/lib/collection-manager/CollectionManagerProvider.mjs +92 -0
- package/lib/collection-manager/CollectionManagerSchemaComponentProvider.mjs +46 -0
- package/lib/collection-manager/CollectionProvider_deprecated.mjs +40 -0
- package/lib/collection-manager/Configuration/AddCollectionAction.mjs +292 -0
- package/lib/collection-manager/Configuration/AddFieldAction.mjs +457 -0
- package/lib/collection-manager/Configuration/AddSubFieldAction.mjs +211 -0
- package/lib/collection-manager/Configuration/DeleteCollectionAction.mjs +268 -0
- package/lib/collection-manager/Configuration/EditCollectionAction.mjs +221 -0
- package/lib/collection-manager/Configuration/EditFieldAction.mjs +315 -0
- package/lib/collection-manager/Configuration/EditSubFieldAction.mjs +163 -0
- package/lib/collection-manager/Configuration/ImportCollectionMetaAction.mjs +210 -0
- package/lib/collection-manager/Configuration/OverridingCollectionField.mjs +274 -0
- package/lib/collection-manager/Configuration/SyncFieldsAction.mjs +257 -0
- package/lib/collection-manager/Configuration/SyncSQLFieldsAction.mjs +214 -0
- package/lib/collection-manager/Configuration/ViewInheritedField.mjs +187 -0
- package/lib/collection-manager/Configuration/components/CollectionCategory.mjs +38 -0
- package/lib/collection-manager/Configuration/components/CollectionFieldInterfaceTag.mjs +40 -0
- package/lib/collection-manager/Configuration/components/CollectionTemplateTag.mjs +39 -0
- package/lib/collection-manager/Configuration/components/FieldSummary.mjs +39 -0
- package/lib/collection-manager/Configuration/components/Summary.mjs +84 -0
- package/lib/collection-manager/Configuration/components/TemplateSummary.mjs +39 -0
- package/lib/collection-manager/Configuration/components/index.mjs +359 -0
- package/lib/collection-manager/Configuration/index.mjs +46 -0
- package/lib/collection-manager/Configuration/interfaces.mjs +48 -0
- package/lib/collection-manager/ResourceActionProvider.mjs +168 -0
- package/lib/collection-manager/action-hooks.mjs +658 -0
- package/lib/collection-manager/collectionPlugin.mjs +151 -0
- package/lib/collection-manager/context.mjs +13 -0
- package/lib/collection-manager/demos/demo2.mjs +143 -0
- package/lib/collection-manager/demos/demo3.mjs +96 -0
- package/lib/collection-manager/demos/demo4.mjs +183 -0
- package/lib/collection-manager/demos/demo5.mjs +187 -0
- package/lib/collection-manager/hooks/index.mjs +11 -0
- package/lib/collection-manager/hooks/useCollectionDataSource.mjs +29 -0
- package/lib/collection-manager/hooks/useCollectionField_deprecated.mjs +43 -0
- package/lib/collection-manager/hooks/useCollectionManager_deprecated.mjs +272 -0
- package/lib/collection-manager/hooks/useCollection_deprecated.mjs +70 -0
- package/lib/collection-manager/hooks/useDialect.mjs +17 -0
- package/lib/collection-manager/index.mjs +63 -0
- package/lib/collection-manager/interfaces/__tests__/json.mjs +73 -0
- package/lib/collection-manager/interfaces/checkbox.mjs +61 -0
- package/lib/collection-manager/interfaces/checkboxGroup.mjs +55 -0
- package/lib/collection-manager/interfaces/chinaRegion.mjs +127 -0
- package/lib/collection-manager/interfaces/collection.mjs +57 -0
- package/lib/collection-manager/interfaces/color.mjs +43 -0
- package/lib/collection-manager/interfaces/components/index.mjs +73 -0
- package/lib/collection-manager/interfaces/createdAt.mjs +47 -0
- package/lib/collection-manager/interfaces/createdBy.mjs +70 -0
- package/lib/collection-manager/interfaces/datetime.mjs +56 -0
- package/lib/collection-manager/interfaces/email.mjs +54 -0
- package/lib/collection-manager/interfaces/icon.mjs +40 -0
- package/lib/collection-manager/interfaces/id.mjs +66 -0
- package/lib/collection-manager/interfaces/index.mjs +81 -0
- package/lib/collection-manager/interfaces/input.mjs +200 -0
- package/lib/collection-manager/interfaces/integer.mjs +138 -0
- package/lib/collection-manager/interfaces/json.mjs +102 -0
- package/lib/collection-manager/interfaces/linkTo.mjs +119 -0
- package/lib/collection-manager/interfaces/m2m.mjs +253 -0
- package/lib/collection-manager/interfaces/m2o.mjs +182 -0
- package/lib/collection-manager/interfaces/markdown.mjs +94 -0
- package/lib/collection-manager/interfaces/multipleSelect.mjs +62 -0
- package/lib/collection-manager/interfaces/nanoid.mjs +72 -0
- package/lib/collection-manager/interfaces/number.mjs +146 -0
- package/lib/collection-manager/interfaces/o2m.mjs +211 -0
- package/lib/collection-manager/interfaces/o2o.mjs +493 -0
- package/lib/collection-manager/interfaces/password.mjs +80 -0
- package/lib/collection-manager/interfaces/percent.mjs +193 -0
- package/lib/collection-manager/interfaces/phone.mjs +46 -0
- package/lib/collection-manager/interfaces/properties/index.mjs +506 -0
- package/lib/collection-manager/interfaces/properties/operators.mjs +370 -0
- package/lib/collection-manager/interfaces/radioGroup.mjs +46 -0
- package/lib/collection-manager/interfaces/richText.mjs +92 -0
- package/lib/collection-manager/interfaces/select.mjs +60 -0
- package/lib/collection-manager/interfaces/sort.mjs +123 -0
- package/lib/collection-manager/interfaces/subTable.mjs +218 -0
- package/lib/collection-manager/interfaces/tableoid.mjs +60 -0
- package/lib/collection-manager/interfaces/textarea.mjs +92 -0
- package/lib/collection-manager/interfaces/time.mjs +59 -0
- package/lib/collection-manager/interfaces/types.mjs +4 -0
- package/lib/collection-manager/interfaces/unixTimestamp.mjs +64 -0
- package/lib/collection-manager/interfaces/updatedAt.mjs +47 -0
- package/lib/collection-manager/interfaces/updatedBy.mjs +70 -0
- package/lib/collection-manager/interfaces/url.mjs +46 -0
- package/lib/collection-manager/interfaces/uuid.mjs +60 -0
- package/lib/collection-manager/mixins/InheritanceCollectionMixin.mjs +249 -0
- package/lib/collection-manager/sub-table.mjs +270 -0
- package/lib/collection-manager/templates/components/PresetFields.mjs +271 -0
- package/lib/collection-manager/templates/components/PreviewFields.mjs +345 -0
- package/lib/collection-manager/templates/components/PreviewTable.mjs +171 -0
- package/lib/collection-manager/templates/components/sql-collection/FieldsConfigure.mjs +348 -0
- package/lib/collection-manager/templates/components/sql-collection/PreviewTable.mjs +81 -0
- package/lib/collection-manager/templates/components/sql-collection/SQLInput.mjs +130 -0
- package/lib/collection-manager/templates/components/sql-collection/SQLRequestProvider.mjs +74 -0
- package/lib/collection-manager/templates/components/sql-collection/index.mjs +11 -0
- package/lib/collection-manager/templates/expression.mjs +78 -0
- package/lib/collection-manager/templates/general.mjs +32 -0
- package/lib/collection-manager/templates/import.mjs +28 -0
- package/lib/collection-manager/templates/index.mjs +15 -0
- package/lib/collection-manager/templates/properties/index.mjs +81 -0
- package/lib/collection-manager/templates/sql.mjs +105 -0
- package/lib/collection-manager/templates/tree.mjs +94 -0
- package/lib/collection-manager/templates/types.mjs +4 -0
- package/lib/collection-manager/templates/view.mjs +177 -0
- package/lib/collection-manager/types.mjs +4 -0
- package/lib/collection-manager/utils.mjs +23 -0
- package/lib/common/SelectWithTitle.mjs +56 -0
- package/lib/common/appInfo/CurrentAppInfoProvider.mjs +33 -0
- package/lib/common/appInfo/index.mjs +5 -0
- package/lib/common/index.mjs +9 -0
- package/lib/common/useFieldComponentName.mjs +39 -0
- package/lib/common/useNiceDropdownHeight.mjs +28 -0
- package/lib/data-source/__tests__/collection/AssociationProvider.test.mjs +132 -0
- package/lib/data-source/__tests__/collection/Collection.test.mjs +308 -0
- package/lib/data-source/__tests__/collection/CollectionManager.test.mjs +308 -0
- package/lib/data-source/__tests__/collection/CollectionManagerProvider.test.mjs +135 -0
- package/lib/data-source/__tests__/collection/CollectionProvider.test.mjs +123 -0
- package/lib/data-source/__tests__/collection/ExtendCollectionsProvider.test.mjs +105 -0
- package/lib/data-source/__tests__/collection-field/CollectionField.test.mjs +84 -0
- package/lib/data-source/__tests__/collection-field/CollectionFieldProvider.test.mjs +70 -0
- package/lib/data-source/__tests__/collection-field-interface/CollectionFieldInterfaceManager.test.mjs +171 -0
- package/lib/data-source/__tests__/collection-record/CollectionRecord.test.mjs +27 -0
- package/lib/data-source/__tests__/collection-record/CollectionRecordProvider.test.mjs +268 -0
- package/lib/data-source/__tests__/collection-record/isNewRecord.test.mjs +55 -0
- package/lib/data-source/__tests__/collection-template/CollectionTemplateManager.test.mjs +132 -0
- package/lib/data-source/__tests__/components/CollectionDeletedPlaceholder.test.mjs +58 -0
- package/lib/data-source/__tests__/data-block/DataBlockProvider.test.mjs +151 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/association-table-list-and-parent-record.mjs +108 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/association-table-list-and-source-id.mjs +160 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/collection-form-create.mjs +131 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/collection-form-get-and-update.mjs +197 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/collection-form-record-and-update.mjs +160 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/collection-table-list.mjs +114 -0
- package/lib/data-source/__tests__/data-block/data-block-demos/createApp.mjs +66 -0
- package/lib/data-source/__tests__/data-source/CollectionDataSourceProvider.test.mjs +56 -0
- package/lib/data-source/__tests__/data-source/DataSource.test.mjs +81 -0
- package/lib/data-source/__tests__/data-source/DataSourceManager.test.mjs +174 -0
- package/lib/data-source/__tests__/data-source/DataSourceManagerProvider.test.mjs +45 -0
- package/lib/data-source/__tests__/data-source/DataSourceProvider.test.mjs +100 -0
- package/lib/data-source/__tests__/utils.test.mjs +66 -0
- package/lib/data-source/collection/AssociationProvider.mjs +68 -0
- package/lib/data-source/collection/Collection.mjs +200 -0
- package/lib/data-source/collection/CollectionManager.mjs +165 -0
- package/lib/data-source/collection/CollectionManagerProvider.mjs +64 -0
- package/lib/data-source/collection/CollectionProvider.mjs +53 -0
- package/lib/data-source/collection/ExtendCollectionsProvider.mjs +47 -0
- package/lib/data-source/collection/index.mjs +15 -0
- package/lib/data-source/collection/utils.mjs +62 -0
- package/lib/data-source/collection-field/CollectionField.mjs +116 -0
- package/lib/data-source/collection-field/CollectionFieldProvider.mjs +65 -0
- package/lib/data-source/collection-field/index.mjs +7 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterface.mjs +42 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterfaceManager.mjs +65 -0
- package/lib/data-source/collection-field-interface/index.mjs +7 -0
- package/lib/data-source/collection-record/CollectionRecord.mjs +34 -0
- package/lib/data-source/collection-record/CollectionRecordProvider.mjs +78 -0
- package/lib/data-source/collection-record/index.mjs +7 -0
- package/lib/data-source/collection-record/isNewRecord.mjs +26 -0
- package/lib/data-source/collection-template/CollectionTemplate.mjs +39 -0
- package/lib/data-source/collection-template/CollectionTemplateManager.mjs +61 -0
- package/lib/data-source/collection-template/index.mjs +7 -0
- package/lib/data-source/commonsSettingsItem/fieldComponent.mjs +80 -0
- package/lib/data-source/commonsSettingsItem/index.mjs +5 -0
- package/lib/data-source/components/CollectionDeletedPlaceholder.mjs +125 -0
- package/lib/data-source/components/DataSourceApplicationProvider.mjs +32 -0
- package/lib/data-source/components/index.mjs +7 -0
- package/lib/data-source/data-block/DataBlockProvider.mjs +115 -0
- package/lib/data-source/data-block/DataBlockRequestProvider.mjs +168 -0
- package/lib/data-source/data-block/DataBlockResourceProvider.mjs +84 -0
- package/lib/data-source/data-block/context/ConfigSetting.provider.mjs +18 -0
- package/lib/data-source/data-block/index.mjs +11 -0
- package/lib/data-source/data-source/DataSource.mjs +83 -0
- package/lib/data-source/data-source/DataSourceManager.mjs +127 -0
- package/lib/data-source/data-source/DataSourceManagerProvider.mjs +25 -0
- package/lib/data-source/data-source/DataSourceProvider.mjs +87 -0
- package/lib/data-source/data-source/index.mjs +11 -0
- package/lib/data-source/index.mjs +23 -0
- package/lib/data-source/utils.mjs +28 -0
- package/lib/env.d.mjs +1 -0
- package/lib/filter-provider/FilterProvider.mjs +182 -0
- package/lib/filter-provider/__tests__/transformToFilter.mjs +74 -0
- package/lib/filter-provider/__tests__/useFilter.mjs +61 -0
- package/lib/filter-provider/__tests__/utiles.test.mjs +271 -0
- package/lib/filter-provider/index.mjs +7 -0
- package/lib/filter-provider/utils.mjs +262 -0
- package/lib/flag-provider/FlagProvider.mjs +19 -0
- package/lib/flag-provider/__tests__/flag-provider.test.mjs +37 -0
- package/lib/flag-provider/hooks/useFlag.mjs +15 -0
- package/lib/flag-provider/index.mjs +7 -0
- package/lib/global.css +34 -0
- package/lib/hooks/index.mjs +7 -0
- package/lib/hooks/useAdminSchemaUid.mjs +7 -0
- package/lib/hooks/useMenuItem.mjs +101 -0
- package/lib/hooks/useViewport.mjs +47 -0
- package/lib/i18n/i18n.mjs +37 -0
- package/lib/i18n/index.mjs +5 -0
- package/lib/icon/Icon.mjs +80 -0
- package/lib/icon/__tests__/icon.test.mjs +49 -0
- package/lib/icon/demos/antd-icon.mjs +19 -0
- package/lib/icon/demos/custom-icon.mjs +28 -0
- package/lib/icon/demos/iconfont.mjs +22 -0
- package/lib/icon/demos/register-icon.mjs +35 -0
- package/lib/icon/index.mjs +5 -0
- package/lib/icon/preloaded.mjs +139 -0
- package/lib/index.mjs +53 -102387
- package/lib/locale/index.mjs +274 -0
- package/lib/modules/actions/ActionSchemaToolbar.mjs +24 -0
- package/lib/modules/actions/add-child/CreateChildInitializer.mjs +76 -0
- package/lib/modules/actions/add-child/addChildActionSettings.mjs +88 -0
- package/lib/modules/actions/add-new/CreateActionInitializer.mjs +82 -0
- package/lib/modules/actions/add-new/addNewActionSettings.mjs +81 -0
- package/lib/modules/actions/add-new/createFormBlockInitializers.mjs +75 -0
- package/lib/modules/actions/add-record/CustomizeAddRecordActionInitializer.mjs +78 -0
- package/lib/modules/actions/add-record/customizeAddRecordActionSettings.mjs +50 -0
- package/lib/modules/actions/add-record/customizeCreateFormBlockInitializers.mjs +45 -0
- package/lib/modules/actions/bulk-destroy/BulkDestroyActionInitializer.mjs +52 -0
- package/lib/modules/actions/bulk-destroy/bulkDeleteActionSettings.mjs +42 -0
- package/lib/modules/actions/delete/DestroyActionInitializer.mjs +40 -0
- package/lib/modules/actions/delete/deleteActionSettings.mjs +57 -0
- package/lib/modules/actions/disassociate/DisassociateActionInitializer.mjs +40 -0
- package/lib/modules/actions/disassociate/__e2e__/disassociate.test.mjs +53 -0
- package/lib/modules/actions/disassociate/__e2e__/templatesOfPage.mjs +386 -0
- package/lib/modules/actions/disassociate/disassociateActionSettings.mjs +57 -0
- package/lib/modules/actions/expand-collapse/ExpandableActionInitializer.mjs +40 -0
- package/lib/modules/actions/expand-collapse/expendableActionSettings.mjs +148 -0
- package/lib/modules/actions/filter/FilterActionInitializer.mjs +34 -0
- package/lib/modules/actions/filter/filterActionSettings.mjs +103 -0
- package/lib/modules/actions/link/customizeLinkActionSettings.mjs +149 -0
- package/lib/modules/actions/link/hooks.mjs +243 -0
- package/lib/modules/actions/refresh/RefreshActionInitializer.mjs +33 -0
- package/lib/modules/actions/refresh/refreshActionSettings.mjs +42 -0
- package/lib/modules/actions/save-record/SaveRecordActionInitializer.mjs +49 -0
- package/lib/modules/actions/save-record/customizeSaveRecordActionSettings.mjs +67 -0
- package/lib/modules/actions/submit/CreateSubmitActionInitializer.mjs +39 -0
- package/lib/modules/actions/submit/UpdateSubmitActionInitializer.mjs +44 -0
- package/lib/modules/actions/submit/createSubmitActionSettings.mjs +250 -0
- package/lib/modules/actions/submit/updateSubmitActionSettings.mjs +107 -0
- package/lib/modules/actions/update-record/UpdateRecordActionInitializer.mjs +48 -0
- package/lib/modules/actions/update-record/customizeUpdateRecordActionSettings.mjs +83 -0
- package/lib/modules/actions/view-edit-popup/PopupActionInitializer.mjs +74 -0
- package/lib/modules/actions/view-edit-popup/RecordFormBlockInitializers.mjs +46 -0
- package/lib/modules/actions/view-edit-popup/UpdateActionInitializer.mjs +69 -0
- package/lib/modules/actions/view-edit-popup/ViewActionInitializer.mjs +68 -0
- package/lib/modules/actions/view-edit-popup/customizePopupActionSettings.mjs +70 -0
- package/lib/modules/actions/view-edit-popup/editActionSettings.mjs +65 -0
- package/lib/modules/actions/view-edit-popup/viewActionSettings.mjs +70 -0
- package/lib/modules/blocks/BlockSchemaToolbar.mjs +85 -0
- package/lib/modules/blocks/data-blocks/details-multi/DetailsActionInitializers.mjs +49 -0
- package/lib/modules/blocks/data-blocks/details-multi/DetailsBlockInitializer.mjs +76 -0
- package/lib/modules/blocks/data-blocks/details-multi/__e2e__/schemaInitializer.test.mjs +123 -0
- package/lib/modules/blocks/data-blocks/details-multi/__e2e__/schemaSettings.test.mjs +81 -0
- package/lib/modules/blocks/data-blocks/details-multi/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/data-blocks/details-multi/__tests__/createDetailsBlockWithPagingUISchema.test.mjs +20 -0
- package/lib/modules/blocks/data-blocks/details-multi/createDetailsWithPaginationUISchema.mjs +66 -0
- package/lib/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.mjs +256 -0
- package/lib/modules/blocks/data-blocks/details-multi/hooks/useDetailsWithPaginationDecoratorProps.mjs +19 -0
- package/lib/modules/blocks/data-blocks/details-multi/hooks/useDetailsWithPaginationProps.mjs +11 -0
- package/lib/modules/blocks/data-blocks/details-multi/setDataLoadingModeSettingsItem.mjs +106 -0
- package/lib/modules/blocks/data-blocks/details-single/ReadPrettyFormActionInitializers.mjs +94 -0
- package/lib/modules/blocks/data-blocks/details-single/ReadPrettyFormItemInitializers.mjs +110 -0
- package/lib/modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer.mjs +108 -0
- package/lib/modules/blocks/data-blocks/details-single/__e2e__/schemaInitializer.test.mjs +110 -0
- package/lib/modules/blocks/data-blocks/details-single/__e2e__/schemaSettings.test.mjs +31 -0
- package/lib/modules/blocks/data-blocks/details-single/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/data-blocks/details-single/__tests__/createDetailsBlockWithoutPagingUISchema.test.mjs +21 -0
- package/lib/modules/blocks/data-blocks/details-single/createDetailsUISchema.mjs +62 -0
- package/lib/modules/blocks/data-blocks/details-single/detailsBlockSettings.mjs +67 -0
- package/lib/modules/blocks/data-blocks/details-single/hooks/useDetailsDecoratorProps.mjs +43 -0
- package/lib/modules/blocks/data-blocks/details-single/hooks/useDetailsProps.mjs +11 -0
- package/lib/modules/blocks/data-blocks/form/CreateFormBlockInitializer.mjs +85 -0
- package/lib/modules/blocks/data-blocks/form/FilterItemCustomSettings.mjs +321 -0
- package/lib/modules/blocks/data-blocks/form/FormBlockInitializer.mjs +113 -0
- package/lib/modules/blocks/data-blocks/form/FormItemSchemaToolbar.mjs +23 -0
- package/lib/modules/blocks/data-blocks/form/RecordFormBlockInitializer.mjs +123 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/associationForm.test.mjs +27 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/dragAndDrop.test.mjs +33 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/lazyLoadAssociationFields.test.mjs +207 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/lazyLoadVariables.test.mjs +36 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/schemaInitializer.test.mjs +167 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings.test.mjs +1367 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-create/templatesOfBug.mjs +6009 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaInitializer.test.mjs +22 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-edit/schemaSettings.test.mjs +235 -0
- package/lib/modules/blocks/data-blocks/form/__e2e__/form-edit/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/data-blocks/form/__tests__/createCreateFormBlockUISchema.test.mjs +27 -0
- package/lib/modules/blocks/data-blocks/form/__tests__/createEditFormBlockUISchema.test.mjs +27 -0
- package/lib/modules/blocks/data-blocks/form/createCreateFormBlockUISchema.mjs +63 -0
- package/lib/modules/blocks/data-blocks/form/createEditFormBlockUISchema.mjs +62 -0
- package/lib/modules/blocks/data-blocks/form/createFormActionInitializers.mjs +51 -0
- package/lib/modules/blocks/data-blocks/form/createFormBlockSettings.mjs +157 -0
- package/lib/modules/blocks/data-blocks/form/editFormBlockSettings.mjs +90 -0
- package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +598 -0
- package/lib/modules/blocks/data-blocks/form/formActionInitializers.mjs +54 -0
- package/lib/modules/blocks/data-blocks/form/formItemInitializers.mjs +51 -0
- package/lib/modules/blocks/data-blocks/form/hooks/useCreateFormBlockDecoratorProps.mjs +19 -0
- package/lib/modules/blocks/data-blocks/form/hooks/useCreateFormBlockProps.mjs +11 -0
- package/lib/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.mjs +29 -0
- package/lib/modules/blocks/data-blocks/form/hooks/useEditFormBlockProps.mjs +11 -0
- package/lib/modules/blocks/data-blocks/form/index.mjs +31 -0
- package/lib/modules/blocks/data-blocks/form/updateFormActionInitializers.mjs +62 -0
- package/lib/modules/blocks/data-blocks/grid-card/GridCardActionInitializers.mjs +94 -0
- package/lib/modules/blocks/data-blocks/grid-card/GridCardBlockInitializer.mjs +69 -0
- package/lib/modules/blocks/data-blocks/grid-card/__e2e__/schemaInitializer.test.mjs +231 -0
- package/lib/modules/blocks/data-blocks/grid-card/__e2e__/schemaSettings.test.mjs +58 -0
- package/lib/modules/blocks/data-blocks/grid-card/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/data-blocks/grid-card/__tests__/createGridCardBlockSchema.test.mjs +32 -0
- package/lib/modules/blocks/data-blocks/grid-card/createGridCardBlockUISchema.mjs +78 -0
- package/lib/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.mjs +484 -0
- package/lib/modules/blocks/data-blocks/grid-card/gridCardItemActionInitializers.mjs +109 -0
- package/lib/modules/blocks/data-blocks/grid-card/hooks/useGridCardBlockDecoratorProps.mjs +25 -0
- package/lib/modules/blocks/data-blocks/grid-card/hooks/useGridCardBlockParams.mjs +28 -0
- package/lib/modules/blocks/data-blocks/grid-card/utils.mjs +17 -0
- package/lib/modules/blocks/data-blocks/list/ListActionInitializers.mjs +90 -0
- package/lib/modules/blocks/data-blocks/list/ListBlockInitializer.mjs +69 -0
- package/lib/modules/blocks/data-blocks/list/__e2e__/schemaInitializer.test.mjs +224 -0
- package/lib/modules/blocks/data-blocks/list/__e2e__/schemaSettings.test.mjs +29 -0
- package/lib/modules/blocks/data-blocks/list/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/data-blocks/list/__tests__/createListBlockSchema.test.mjs +30 -0
- package/lib/modules/blocks/data-blocks/list/createListBlockUISchema.mjs +71 -0
- package/lib/modules/blocks/data-blocks/list/hooks/useListBlockDecoratorProps.mjs +19 -0
- package/lib/modules/blocks/data-blocks/list/listBlockSettings.mjs +286 -0
- package/lib/modules/blocks/data-blocks/list/listItemActionInitializers.mjs +109 -0
- package/lib/modules/blocks/data-blocks/table/TableActionColumnInitializers.mjs +287 -0
- package/lib/modules/blocks/data-blocks/table/TableActionInitializers.mjs +143 -0
- package/lib/modules/blocks/data-blocks/table/TableBlockInitializer.mjs +69 -0
- package/lib/modules/blocks/data-blocks/table/TableColumnInitializers.mjs +135 -0
- package/lib/modules/blocks/data-blocks/table/TableColumnSchemaToolbar.mjs +35 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/actions/duplicate.test.mjs +19 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/actions/filter.test.mjs +46 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/checkboxForTableRow.test.mjs +28 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/dragAndDrop.test.mjs +40 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.mjs +450 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/schemaSettings.test.mjs +922 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/templatesOfBug.mjs +937 -0
- package/lib/modules/blocks/data-blocks/table/__e2e__/tree/schemaSettings.test.mjs +53 -0
- package/lib/modules/blocks/data-blocks/table/__tests__/createTableBLockSchema.test.mjs +24 -0
- package/lib/modules/blocks/data-blocks/table/createTableBlockUISchema.mjs +90 -0
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockDecoratorProps.mjs +54 -0
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +176 -0
- package/lib/modules/blocks/data-blocks/table/index.mjs +21 -0
- package/lib/modules/blocks/data-blocks/table/tableBlockSettings.mjs +461 -0
- package/lib/modules/blocks/data-blocks/table/tableColumnSettings.mjs +388 -0
- package/lib/modules/blocks/data-blocks/table/utils.mjs +30 -0
- package/lib/modules/blocks/data-blocks/table-selector/TableSelectorInitializer.mjs +45 -0
- package/lib/modules/blocks/data-blocks/table-selector/__e2e__/schemaInitializer.test.mjs +174 -0
- package/lib/modules/blocks/data-blocks/table-selector/__e2e__/schemaSettings.test.mjs +169 -0
- package/lib/modules/blocks/data-blocks/table-selector/__e2e__/templatesOfBug.mjs +695 -0
- package/lib/modules/blocks/data-blocks/table-selector/__e2e__/utils.mjs +20 -0
- package/lib/modules/blocks/data-blocks/table-selector/__tests__/createTableSelectorSchema.test.mjs +22 -0
- package/lib/modules/blocks/data-blocks/table-selector/createTableSelectorUISchema.mjs +55 -0
- package/lib/modules/blocks/data-blocks/table-selector/hooks/useTableSelectorDecoratorProps.mjs +5 -0
- package/lib/modules/blocks/data-blocks/table-selector/index.mjs +7 -0
- package/lib/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.mjs +353 -0
- package/lib/modules/blocks/filter-blocks/collapse/CollapseItemSchemaToolbar.mjs +22 -0
- package/lib/modules/blocks/filter-blocks/collapse/FilterCollapseBlockInitializer.mjs +51 -0
- package/lib/modules/blocks/filter-blocks/collapse/__e2e__/schemaInitializer.test.mjs +67 -0
- package/lib/modules/blocks/filter-blocks/collapse/__e2e__/schemaSettings.test.mjs +72 -0
- package/lib/modules/blocks/filter-blocks/collapse/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/filter-blocks/collapse/__tests__/createCollapseBlockSchema.test.mjs +46 -0
- package/lib/modules/blocks/filter-blocks/collapse/createFilterCollapseBlockSchema.mjs +37 -0
- package/lib/modules/blocks/filter-blocks/collapse/filterCollapseBlockSettings.mjs +79 -0
- package/lib/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.mjs +244 -0
- package/lib/modules/blocks/filter-blocks/collapse/filterCollapseItemInitializer.mjs +170 -0
- package/lib/modules/blocks/filter-blocks/collapse/hooks/useCollapseBlockDecoratorProps.mjs +5 -0
- package/lib/modules/blocks/filter-blocks/form/FilterFormActionInitializers.mjs +38 -0
- package/lib/modules/blocks/filter-blocks/form/FilterFormBlockInitializer.mjs +60 -0
- package/lib/modules/blocks/filter-blocks/form/__e2e__/schemaInitializer.test.mjs +127 -0
- package/lib/modules/blocks/filter-blocks/form/__e2e__/schemaSettings.test.mjs +111 -0
- package/lib/modules/blocks/filter-blocks/form/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/filter-blocks/form/__tests__/createFilterFormBlockSchema.test.mjs +31 -0
- package/lib/modules/blocks/filter-blocks/form/createFilterFormBlockSchema.mjs +56 -0
- package/lib/modules/blocks/filter-blocks/form/filterFormBlockSettings.mjs +87 -0
- package/lib/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.mjs +394 -0
- package/lib/modules/blocks/filter-blocks/form/filterFormItemInitializers.mjs +53 -0
- package/lib/modules/blocks/filter-blocks/form/hooks/useFilterFormBlockDecoratorProps.mjs +5 -0
- package/lib/modules/blocks/filter-blocks/form/hooks/useFilterFormBlockProps.mjs +11 -0
- package/lib/modules/blocks/filter-blocks/tree/FilterTreeActionInitializers.mjs +38 -0
- package/lib/modules/blocks/filter-blocks/tree/FilterTreeBlockInitializer.mjs +101 -0
- package/lib/modules/blocks/filter-blocks/tree/filterTreeBlockSettings.mjs +87 -0
- package/lib/modules/blocks/filter-blocks/tree/filterTreeItemFieldSettings.mjs +394 -0
- package/lib/modules/blocks/filter-blocks/tree/filterTreeItemInitializers.mjs +53 -0
- package/lib/modules/blocks/other-blocks/markdown/MarkdownBlockInitializer.mjs +48 -0
- package/lib/modules/blocks/other-blocks/markdown/MarkdownFormItemInitializer.mjs +42 -0
- package/lib/modules/blocks/other-blocks/markdown/__e2e__/schemaInitializer.test.mjs +16 -0
- package/lib/modules/blocks/other-blocks/markdown/__e2e__/schemaSettings.test.mjs +40 -0
- package/lib/modules/blocks/other-blocks/markdown/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/blocks/other-blocks/markdown/markdownBlockSettings.mjs +51 -0
- package/lib/modules/blocks/useParentRecordCommon.mjs +18 -0
- package/lib/modules/blocks/useSourceId.mjs +23 -0
- package/lib/modules/blocks/useSourceKey.mjs +16 -0
- package/lib/modules/dialog/__e2e__/schemaInitializer.test.mjs +435 -0
- package/lib/modules/dialog/__e2e__/schemaSettings.test.mjs +65 -0
- package/lib/modules/dialog/__e2e__/templatesOfBug.mjs +2128 -0
- package/lib/modules/dialog/__e2e__/zIndex.test.mjs +46 -0
- package/lib/modules/fields/component/CascadeSelect/cascadeSelectComponentFieldSettings.mjs +120 -0
- package/lib/modules/fields/component/Cascader/cascaderComponentFieldSettings.mjs +457 -0
- package/lib/modules/fields/component/Checkbox/checkboxComponentFieldSettings.mjs +71 -0
- package/lib/modules/fields/component/DatePicker/__e2e__/schemaSettings.test.mjs +86 -0
- package/lib/modules/fields/component/DatePicker/__e2e__/utils.mjs +335 -0
- package/lib/modules/fields/component/DatePicker/datePickerComponentFieldSettings.mjs +37 -0
- package/lib/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.mjs +184 -0
- package/lib/modules/fields/component/FileManager/fileManagerComponentFieldSettings.mjs +225 -0
- package/lib/modules/fields/component/FileManager/uploadAttachmentComponentFieldSettings.mjs +123 -0
- package/lib/modules/fields/component/InputNumber/inputNumberComponentFieldSettings.mjs +45 -0
- package/lib/modules/fields/component/Nester/subformComponentFieldSettings.mjs +157 -0
- package/lib/modules/fields/component/Picker/TableSelectorInitializers.mjs +98 -0
- package/lib/modules/fields/component/Picker/recordPickerComponentFieldSettings.mjs +222 -0
- package/lib/modules/fields/component/PopoverNester/subformPopoverComponentFieldSettings.mjs +134 -0
- package/lib/modules/fields/component/Radio/radioComponentFieldSettings.mjs +71 -0
- package/lib/modules/fields/component/Select/selectComponentFieldSettings.mjs +453 -0
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +447 -0
- package/lib/modules/fields/component/Tag/tagComponentFieldSettings.mjs +207 -0
- package/lib/modules/fields/component/UnixTimestamp/unixTimestampComponentFieldSettings.mjs +37 -0
- package/lib/modules/fields/initializer/CollectionFieldInitializer.mjs +30 -0
- package/lib/modules/fields/initializer/TableCollectionFieldInitializer.mjs +30 -0
- package/lib/modules/menu/GroupItem.mjs +110 -0
- package/lib/modules/menu/LinkMenuItem.mjs +116 -0
- package/lib/modules/menu/PageMenuItem.mjs +125 -0
- package/lib/modules/menu/__e2e__/dragAndDrop.test.mjs +34 -0
- package/lib/modules/menu/__e2e__/schemaInitializer.test.mjs +114 -0
- package/lib/modules/menu/__e2e__/schemaSettings.test.mjs +366 -0
- package/lib/modules/menu/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/menu/menuItemInitializer.mjs +65 -0
- package/lib/modules/page/BlockInitializers.mjs +86 -0
- package/lib/modules/page/__e2e__/blockInitializers.test.mjs +23 -0
- package/lib/modules/page/__e2e__/dragAndDrop.test.mjs +24 -0
- package/lib/modules/page/__e2e__/schemaInitailizer.test.mjs +22 -0
- package/lib/modules/page/__e2e__/schemaSettings.test.mjs +154 -0
- package/lib/modules/page/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/plugin-manager/__e2e__/pluginManager.test.mjs +132 -0
- package/lib/modules/plugin-manager/__e2e__/templatesOfBug.mjs +1 -0
- package/lib/modules/user-center/__e2e__/settings.test.mjs +18 -0
- package/lib/modules/variable/DeclareVariable.mjs +27 -0
- package/lib/modules/variable/useVariable.mjs +27 -0
- package/lib/powered-by/index.mjs +57 -0
- package/lib/record-provider/index.mjs +77 -0
- package/lib/route-switch/RouteSchemaComponent.mjs +27 -0
- package/lib/route-switch/index.mjs +5 -0
- package/lib/schema-component/antd/AntdSchemaComponentProvider.mjs +74 -0
- package/lib/schema-component/antd/__builtins__/hooks/index.mjs +9 -0
- package/lib/schema-component/antd/__builtins__/hooks/useConfig.mjs +14 -0
- package/lib/schema-component/antd/__builtins__/hooks/usePrefixCls.mjs +22 -0
- package/lib/schema-component/antd/__builtins__/hooks/useToken.mjs +13 -0
- package/lib/schema-component/antd/__builtins__/index.mjs +11 -0
- package/lib/schema-component/antd/__builtins__/loading.mjs +21 -0
- package/lib/schema-component/antd/__builtins__/portal.mjs +76 -0
- package/lib/schema-component/antd/__builtins__/render.mjs +65 -0
- package/lib/schema-component/antd/__builtins__/style.mjs +79 -0
- package/lib/schema-component/antd/action/Action.Area.mjs +130 -0
- package/lib/schema-component/antd/action/Action.Area.style.mjs +48 -0
- package/lib/schema-component/antd/action/Action.Container.mjs +75 -0
- package/lib/schema-component/antd/action/Action.Designer.mjs +1053 -0
- package/lib/schema-component/antd/action/Action.Drawer.mjs +179 -0
- package/lib/schema-component/antd/action/Action.Drawer.style.mjs +52 -0
- package/lib/schema-component/antd/action/Action.Link.mjs +37 -0
- package/lib/schema-component/antd/action/Action.Modal.mjs +214 -0
- package/lib/schema-component/antd/action/Action.Page.mjs +112 -0
- package/lib/schema-component/antd/action/Action.Popover.mjs +1 -0
- package/lib/schema-component/antd/action/Action.Sheet.mjs +115 -0
- package/lib/schema-component/antd/action/Action.mjs +349 -0
- package/lib/schema-component/antd/action/Action.style.mjs +53 -0
- package/lib/schema-component/antd/action/ActionBar.mjs +172 -0
- package/lib/schema-component/antd/action/__tests__/action.test.mjs +161 -0
- package/lib/schema-component/antd/action/context.mjs +29 -0
- package/lib/schema-component/antd/action/demos/demo1.mjs +87 -0
- package/lib/schema-component/antd/action/demos/demo2.mjs +90 -0
- package/lib/schema-component/antd/action/demos/demo3.mjs +148 -0
- package/lib/schema-component/antd/action/demos/demo4.mjs +75 -0
- package/lib/schema-component/antd/action/demos/demo5.mjs +237 -0
- package/lib/schema-component/antd/action/demos/demo6.mjs +114 -0
- package/lib/schema-component/antd/action/hooks/useGetAriaLabelOfAction.mjs +62 -0
- package/lib/schema-component/antd/action/hooks/useGetAriaLabelOfDrawer.mjs +43 -0
- package/lib/schema-component/antd/action/hooks/useGetAriaLabelOfModal.mjs +43 -0
- package/lib/schema-component/antd/action/hooks/useGetAriaLabelOfPopover.mjs +43 -0
- package/lib/schema-component/antd/action/hooks/useSetAriaLabelForDrawer.mjs +42 -0
- package/lib/schema-component/antd/action/hooks/useSetAriaLabelForModal.mjs +44 -0
- package/lib/schema-component/antd/action/hooks/useSetAriaLabelForPopover.mjs +33 -0
- package/lib/schema-component/antd/action/hooks.mjs +86 -0
- package/lib/schema-component/antd/action/index.mjs +23 -0
- package/lib/schema-component/antd/action/types.mjs +4 -0
- package/lib/schema-component/antd/action/utils.mjs +229 -0
- package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.mjs +268 -0
- package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelectV2.mjs +267 -0
- package/lib/schema-component/antd/appends-tree-select/index.mjs +7 -0
- package/lib/schema-component/antd/association-cascader/AssociationCascader.mjs +173 -0
- package/lib/schema-component/antd/association-cascader/index.mjs +5 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.mjs +166 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.mjs +229 -0
- package/lib/schema-component/antd/association-field/Editable.mjs +165 -0
- package/lib/schema-component/antd/association-field/FileManager.mjs +261 -0
- package/lib/schema-component/antd/association-field/InternalCascadeSelect.mjs +463 -0
- package/lib/schema-component/antd/association-field/InternalCascader.mjs +443 -0
- package/lib/schema-component/antd/association-field/InternalDrawerSubTable.mjs +138 -0
- package/lib/schema-component/antd/association-field/InternalNester.mjs +117 -0
- package/lib/schema-component/antd/association-field/InternalPicker.mjs +276 -0
- package/lib/schema-component/antd/association-field/InternalPopoverNester.mjs +176 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.mjs +133 -0
- package/lib/schema-component/antd/association-field/InternalTag.mjs +180 -0
- package/lib/schema-component/antd/association-field/InternalViewer.mjs +197 -0
- package/lib/schema-component/antd/association-field/Nester.mjs +330 -0
- package/lib/schema-component/antd/association-field/ReadPretty.mjs +82 -0
- package/lib/schema-component/antd/association-field/SubTable.mjs +351 -0
- package/lib/schema-component/antd/association-field/SubTabs/InternalCollapse.mjs +384 -0
- package/lib/schema-component/antd/association-field/SubTabs/hook.mjs +87 -0
- package/lib/schema-component/antd/association-field/SubTabs/index.mjs +5 -0
- package/lib/schema-component/antd/association-field/SubTabs/styles.mjs +33 -0
- package/lib/schema-component/antd/association-field/components/CreateRecordAction.mjs +84 -0
- package/lib/schema-component/antd/association-field/context.mjs +10 -0
- package/lib/schema-component/antd/association-field/hooks.mjs +221 -0
- package/lib/schema-component/antd/association-field/index.mjs +42 -0
- package/lib/schema-component/antd/association-field/schema.mjs +135 -0
- package/lib/schema-component/antd/association-field/util.mjs +133 -0
- package/lib/schema-component/antd/association-filter/ActionBarAssociationFilterAction.mjs +88 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.BlockDesigner.mjs +67 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Initializer.mjs +67 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.Designer.mjs +168 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.mjs +183 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.style.mjs +107 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.mjs +128 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDelete.mjs +55 -0
- package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.mjs +43 -0
- package/lib/schema-component/antd/association-filter/utilts.mjs +7 -0
- package/lib/schema-component/antd/association-select/AssociationSelect.mjs +1010 -0
- package/lib/schema-component/antd/association-select/ReadPretty.mjs +38 -0
- package/lib/schema-component/antd/association-select/__tests__/association-select.test.mjs +33 -0
- package/lib/schema-component/antd/association-select/demos/demo1.mjs +75 -0
- package/lib/schema-component/antd/association-select/index.mjs +5 -0
- package/lib/schema-component/antd/association-select/useServiceOptions.mjs +114 -0
- package/lib/schema-component/antd/auto-complete/AutoComplete.mjs +92 -0
- package/lib/schema-component/antd/auto-complete/index.mjs +5 -0
- package/lib/schema-component/antd/block-item/BlockItem.mjs +93 -0
- package/lib/schema-component/antd/block-item/BlockToolbar.mjs +114 -0
- package/lib/schema-component/antd/block-item/__tests__/block-item.test.mjs +29 -0
- package/lib/schema-component/antd/block-item/demos/demo1.mjs +75 -0
- package/lib/schema-component/antd/block-item/hooks/useGetAriaLabelOfBlockItem.mjs +63 -0
- package/lib/schema-component/antd/block-item/index.mjs +5 -0
- package/lib/schema-component/antd/block-item/useBlockToolbar.mjs +107 -0
- package/lib/schema-component/antd/card-item/CardItem.mjs +49 -0
- package/lib/schema-component/antd/card-item/__tests__/card-item.test.mjs +28 -0
- package/lib/schema-component/antd/card-item/demos/demo1.mjs +45 -0
- package/lib/schema-component/antd/card-item/index.mjs +5 -0
- package/lib/schema-component/antd/card-item/style.mjs +33 -0
- package/lib/schema-component/antd/cascader/Cascader.mjs +123 -0
- package/lib/schema-component/antd/cascader/ReadPretty.mjs +50 -0
- package/lib/schema-component/antd/cascader/__tests__/cascader.test.mjs +56 -0
- package/lib/schema-component/antd/cascader/defaultFieldNames.mjs +9 -0
- package/lib/schema-component/antd/cascader/demos/demo1.mjs +100 -0
- package/lib/schema-component/antd/cascader/demos/demo2.mjs +140 -0
- package/lib/schema-component/antd/cascader/index.mjs +5 -0
- package/lib/schema-component/antd/checkbox/Checkbox.mjs +120 -0
- package/lib/schema-component/antd/checkbox/__tests__/checkbox.test.mjs +60 -0
- package/lib/schema-component/antd/checkbox/demos/checkbox.group.mjs +73 -0
- package/lib/schema-component/antd/checkbox/demos/checkbox.mjs +59 -0
- package/lib/schema-component/antd/checkbox/index.mjs +5 -0
- package/lib/schema-component/antd/collection-select/CollectionSelect.mjs +194 -0
- package/lib/schema-component/antd/collection-select/__tests__/collection-select.test.mjs +33 -0
- package/lib/schema-component/antd/collection-select/demos/demo1.mjs +54 -0
- package/lib/schema-component/antd/collection-select/index.mjs +5 -0
- package/lib/schema-component/antd/color-picker/ColorPicker.mjs +114 -0
- package/lib/schema-component/antd/color-picker/ReadPretty.mjs +36 -0
- package/lib/schema-component/antd/color-picker/demos/demo1.mjs +68 -0
- package/lib/schema-component/antd/color-picker/index.mjs +5 -0
- package/lib/schema-component/antd/color-picker/util.mjs +196 -0
- package/lib/schema-component/antd/color-select/ColorSelect.mjs +73 -0
- package/lib/schema-component/antd/color-select/__tests__/color-select.test.mjs +32 -0
- package/lib/schema-component/antd/color-select/demos/demo1.mjs +59 -0
- package/lib/schema-component/antd/color-select/index.mjs +5 -0
- package/lib/schema-component/antd/cron/Cron.mjs +100 -0
- package/lib/schema-component/antd/cron/CronSet.mjs +147 -0
- package/lib/schema-component/antd/cron/__tests__/cron-set.test.mjs +50 -0
- package/lib/schema-component/antd/cron/demos/demo1.mjs +50 -0
- package/lib/schema-component/antd/cron/demos/demo2.mjs +69 -0
- package/lib/schema-component/antd/cron/index.mjs +7 -0
- package/lib/schema-component/antd/custom-cascader/CustomCascader.mjs +63 -0
- package/lib/schema-component/antd/custom-cascader/ReadPretty.mjs +50 -0
- package/lib/schema-component/antd/custom-cascader/defaultFieldNames.mjs +9 -0
- package/lib/schema-component/antd/custom-cascader/index.mjs +5 -0
- package/lib/schema-component/antd/date-picker/DatePicker.mjs +176 -0
- package/lib/schema-component/antd/date-picker/ReadPretty.mjs +66 -0
- package/lib/schema-component/antd/date-picker/__tests__/date-picker.test.mjs +250 -0
- package/lib/schema-component/antd/date-picker/__tests__/getDateRanges.test.mjs +119 -0
- package/lib/schema-component/antd/date-picker/__tests__/mapDatePicker.test.mjs +212 -0
- package/lib/schema-component/antd/date-picker/__tests__/mapRangePicker.test.mjs +71 -0
- package/lib/schema-component/antd/date-picker/__tests__/util.test.mjs +182 -0
- package/lib/schema-component/antd/date-picker/demos/demo1.mjs +76 -0
- package/lib/schema-component/antd/date-picker/demos/demo10.mjs +80 -0
- package/lib/schema-component/antd/date-picker/demos/demo11.mjs +84 -0
- package/lib/schema-component/antd/date-picker/demos/demo2.mjs +79 -0
- package/lib/schema-component/antd/date-picker/demos/demo3.mjs +77 -0
- package/lib/schema-component/antd/date-picker/demos/demo4.mjs +94 -0
- package/lib/schema-component/antd/date-picker/demos/demo5.mjs +93 -0
- package/lib/schema-component/antd/date-picker/demos/demo6.mjs +93 -0
- package/lib/schema-component/antd/date-picker/demos/demo7.mjs +80 -0
- package/lib/schema-component/antd/date-picker/demos/demo8.mjs +80 -0
- package/lib/schema-component/antd/date-picker/demos/demo9.mjs +80 -0
- package/lib/schema-component/antd/date-picker/index.mjs +5 -0
- package/lib/schema-component/antd/date-picker/util.mjs +217 -0
- package/lib/schema-component/antd/details/Details.mjs +44 -0
- package/lib/schema-component/antd/details/__tests__/details.test.mjs +25 -0
- package/lib/schema-component/antd/details/demos/demo1.mjs +59 -0
- package/lib/schema-component/antd/details/index.mjs +5 -0
- package/lib/schema-component/antd/error-fallback/ErrorFallback.mjs +77 -0
- package/lib/schema-component/antd/error-fallback/__tests__/error-fallback.test.mjs +33 -0
- package/lib/schema-component/antd/error-fallback/demos/demo1.mjs +30 -0
- package/lib/schema-component/antd/error-fallback/index.mjs +5 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.mjs +134 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.mjs +103 -0
- package/lib/schema-component/antd/expand-action/index.mjs +15 -0
- package/lib/schema-component/antd/filter/DynamicComponent.mjs +81 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.mjs +156 -0
- package/lib/schema-component/antd/filter/Filter.mjs +95 -0
- package/lib/schema-component/antd/filter/FilterAction.mjs +218 -0
- package/lib/schema-component/antd/filter/FilterGroup.mjs +166 -0
- package/lib/schema-component/antd/filter/FilterItem.mjs +120 -0
- package/lib/schema-component/antd/filter/FilterItems.mjs +47 -0
- package/lib/schema-component/antd/filter/SaveDefaultValue.mjs +61 -0
- package/lib/schema-component/antd/filter/__tests__/filter.test.mjs +152 -0
- package/lib/schema-component/antd/filter/context.mjs +14 -0
- package/lib/schema-component/antd/filter/demos/demo2.mjs +143 -0
- package/lib/schema-component/antd/filter/demos/demo3.mjs +213 -0
- package/lib/schema-component/antd/filter/demos/demo4.mjs +203 -0
- package/lib/schema-component/antd/filter/demos/demo5.mjs +145 -0
- package/lib/schema-component/antd/filter/demos/demo6.mjs +140 -0
- package/lib/schema-component/antd/filter/index.mjs +9 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.mjs +298 -0
- package/lib/schema-component/antd/filter/useOperators.mjs +38 -0
- package/lib/schema-component/antd/filter/useValues.mjs +155 -0
- package/lib/schema-component/antd/filter/utils.mjs +20 -0
- package/lib/schema-component/antd/form/Form.Designer.mjs +27 -0
- package/lib/schema-component/antd/form/Form.Settings.mjs +48 -0
- package/lib/schema-component/antd/form/Form.mjs +187 -0
- package/lib/schema-component/antd/form/__tests__/form.test.mjs +155 -0
- package/lib/schema-component/antd/form/demos/apiClient.mjs +26 -0
- package/lib/schema-component/antd/form/demos/demo1.mjs +93 -0
- package/lib/schema-component/antd/form/demos/demo2.mjs +95 -0
- package/lib/schema-component/antd/form/demos/demo3.mjs +94 -0
- package/lib/schema-component/antd/form/demos/demo4.mjs +98 -0
- package/lib/schema-component/antd/form/demos/demo5.mjs +142 -0
- package/lib/schema-component/antd/form/demos/demo6.mjs +95 -0
- package/lib/schema-component/antd/form/demos/demo7.mjs +103 -0
- package/lib/schema-component/antd/form/demos/demo8.mjs +110 -0
- package/lib/schema-component/antd/form/index.mjs +7 -0
- package/lib/schema-component/antd/form-dialog/index.mjs +199 -0
- package/lib/schema-component/antd/form-item/FormItem.FilterFormDesigner.mjs +21 -0
- package/lib/schema-component/antd/form-item/FormItem.FilterFormSettings.mjs +183 -0
- package/lib/schema-component/antd/form-item/FormItem.Settings.mjs +1326 -0
- package/lib/schema-component/antd/form-item/FormItem.mjs +200 -0
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.mjs +638 -0
- package/lib/schema-component/antd/form-item/__tests__/form-item.test.mjs +27 -0
- package/lib/schema-component/antd/form-item/__tests__/hooks/useSpecialCase.test.mjs +33 -0
- package/lib/schema-component/antd/form-item/__tests__/utils.test.mjs +71 -0
- package/lib/schema-component/antd/form-item/demos/demo1.mjs +56 -0
- package/lib/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.mjs +135 -0
- package/lib/schema-component/antd/form-item/hooks/useParseDefaultValue.mjs +164 -0
- package/lib/schema-component/antd/form-item/hooks/useSpecialCase.mjs +182 -0
- package/lib/schema-component/antd/form-item/index.mjs +11 -0
- package/lib/schema-component/antd/form-item/utils.mjs +22 -0
- package/lib/schema-component/antd/form-tab/index.mjs +168 -0
- package/lib/schema-component/antd/form-v2/Form.Designer.mjs +51 -0
- package/lib/schema-component/antd/form-v2/Form.FilterDesigner.mjs +36 -0
- package/lib/schema-component/antd/form-v2/Form.Settings.mjs +364 -0
- package/lib/schema-component/antd/form-v2/Form.mjs +432 -0
- package/lib/schema-component/antd/form-v2/FormField.mjs +51 -0
- package/lib/schema-component/antd/form-v2/Templates.mjs +257 -0
- package/lib/schema-component/antd/form-v2/__tests__/form-v2.test.mjs +69 -0
- package/lib/schema-component/antd/form-v2/demos/collections.mjs +1568 -0
- package/lib/schema-component/antd/form-v2/demos/demo1.mjs +139 -0
- package/lib/schema-component/antd/form-v2/demos/demo2.mjs +162 -0
- package/lib/schema-component/antd/form-v2/demos/demo3.mjs +139 -0
- package/lib/schema-component/antd/form-v2/index.mjs +30 -0
- package/lib/schema-component/antd/form-v2/utils.mjs +182 -0
- package/lib/schema-component/antd/grid/Block.mjs +39 -0
- package/lib/schema-component/antd/grid/Grid.mjs +562 -0
- package/lib/schema-component/antd/grid/Grid.style.mjs +51 -0
- package/lib/schema-component/antd/grid/__tests__/grid.test.mjs +47 -0
- package/lib/schema-component/antd/grid/demos/demo1.mjs +211 -0
- package/lib/schema-component/antd/grid/demos/demo2.mjs +119 -0
- package/lib/schema-component/antd/grid/demos/demo3.mjs +101 -0
- package/lib/schema-component/antd/grid/index.mjs +7 -0
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.mjs +108 -0
- package/lib/schema-component/antd/grid-card/GridCard.Decorator.style.mjs +30 -0
- package/lib/schema-component/antd/grid-card/GridCard.Designer.mjs +317 -0
- package/lib/schema-component/antd/grid-card/GridCard.Item.mjs +120 -0
- package/lib/schema-component/antd/grid-card/GridCard.mjs +215 -0
- package/lib/schema-component/antd/grid-card/__tests__/grid-card.test.mjs +24 -0
- package/lib/schema-component/antd/grid-card/demos/demo1.mjs +17 -0
- package/lib/schema-component/antd/grid-card/hooks.mjs +37 -0
- package/lib/schema-component/antd/grid-card/index.mjs +5 -0
- package/lib/schema-component/antd/grid-card/options.mjs +38 -0
- package/lib/schema-component/antd/icon-picker/IconFilterInput.mjs +32 -0
- package/lib/schema-component/antd/icon-picker/IconList.mjs +71 -0
- package/lib/schema-component/antd/icon-picker/IconPicker.mjs +116 -0
- package/lib/schema-component/antd/icon-picker/__tests__/icon-picker.test.mjs +43 -0
- package/lib/schema-component/antd/icon-picker/demos/icon-picker.mjs +57 -0
- package/lib/schema-component/antd/icon-picker/index.mjs +5 -0
- package/lib/schema-component/antd/index.css +30 -0
- package/lib/schema-component/antd/index.mjs +137 -0
- package/lib/schema-component/antd/input/EllipsisWithTooltip.mjs +82 -0
- package/lib/schema-component/antd/input/Input.mjs +56 -0
- package/lib/schema-component/antd/input/Json.mjs +83 -0
- package/lib/schema-component/antd/input/ReadPretty.mjs +186 -0
- package/lib/schema-component/antd/input/__tests__/Input.test.mjs +141 -0
- package/lib/schema-component/antd/input/demos/input.mjs +57 -0
- package/lib/schema-component/antd/input/demos/json.mjs +63 -0
- package/lib/schema-component/antd/input/demos/textarea.mjs +85 -0
- package/lib/schema-component/antd/input/demos/url.mjs +59 -0
- package/lib/schema-component/antd/input/index.mjs +13 -0
- package/lib/schema-component/antd/input/shared.mjs +11 -0
- package/lib/schema-component/antd/input-number/InputNumber.mjs +37 -0
- package/lib/schema-component/antd/input-number/ReadPretty.mjs +161 -0
- package/lib/schema-component/antd/input-number/__tests__/input-number.test.mjs +152 -0
- package/lib/schema-component/antd/input-number/demos/addonBefore&addonAfter.mjs +65 -0
- package/lib/schema-component/antd/input-number/demos/highPrecisionDecimals.mjs +67 -0
- package/lib/schema-component/antd/input-number/demos/inputNumber.mjs +57 -0
- package/lib/schema-component/antd/input-number/index.mjs +5 -0
- package/lib/schema-component/antd/list/List.Decorator.mjs +135 -0
- package/lib/schema-component/antd/list/List.Designer.mjs +260 -0
- package/lib/schema-component/antd/list/List.Item.mjs +85 -0
- package/lib/schema-component/antd/list/List.mjs +129 -0
- package/lib/schema-component/antd/list/List.style.mjs +62 -0
- package/lib/schema-component/antd/list/__tests__/list.test.mjs +24 -0
- package/lib/schema-component/antd/list/demos/demo1.mjs +17 -0
- package/lib/schema-component/antd/list/hooks.mjs +16 -0
- package/lib/schema-component/antd/list/index.mjs +5 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.Designer.mjs +45 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.mjs +148 -0
- package/lib/schema-component/antd/markdown/Markdown.mjs +83 -0
- package/lib/schema-component/antd/markdown/__tests__/markdown.test.mjs +48 -0
- package/lib/schema-component/antd/markdown/demos/demo1.mjs +59 -0
- package/lib/schema-component/antd/markdown/demos/demo2.mjs +78 -0
- package/lib/schema-component/antd/markdown/index.mjs +5 -0
- package/lib/schema-component/antd/markdown/markdown-it-plugins/mermaidPlugin.mjs +73 -0
- package/lib/schema-component/antd/markdown/md.mjs +25 -0
- package/lib/schema-component/antd/markdown/style.mjs +233 -0
- package/lib/schema-component/antd/markdown/util.mjs +49 -0
- package/lib/schema-component/antd/menu/Menu.Designer.mjs +478 -0
- package/lib/schema-component/antd/menu/Menu.mjs +686 -0
- package/lib/schema-component/antd/menu/Menu.styles.mjs +85 -0
- package/lib/schema-component/antd/menu/MenuItemInitializers/index.mjs +17 -0
- package/lib/schema-component/antd/menu/__tests__/menu.test.mjs +65 -0
- package/lib/schema-component/antd/menu/demos/demo1.mjs +109 -0
- package/lib/schema-component/antd/menu/demos/demo2.mjs +112 -0
- package/lib/schema-component/antd/menu/demos/demo3.mjs +152 -0
- package/lib/schema-component/antd/menu/index.mjs +9 -0
- package/lib/schema-component/antd/menu/locale.mjs +11 -0
- package/lib/schema-component/antd/menu/util.mjs +56 -0
- package/lib/schema-component/antd/nanoIDInput/NanoIDInput.mjs +71 -0
- package/lib/schema-component/antd/nanoIDInput/index.mjs +5 -0
- package/lib/schema-component/antd/page/FixedBlock.mjs +118 -0
- package/lib/schema-component/antd/page/FixedBlockDesignerItem.mjs +72 -0
- package/lib/schema-component/antd/page/Page.Settings.mjs +167 -0
- package/lib/schema-component/antd/page/Page.mjs +317 -0
- package/lib/schema-component/antd/page/PageTab.Settings.mjs +108 -0
- package/lib/schema-component/antd/page/PageTabDesigner.mjs +98 -0
- package/lib/schema-component/antd/page/__tests__/page.test.mjs +33 -0
- package/lib/schema-component/antd/page/demos/demo1.mjs +52 -0
- package/lib/schema-component/antd/page/hooks/useIsBlockInPage.mjs +25 -0
- package/lib/schema-component/antd/page/index.mjs +13 -0
- package/lib/schema-component/antd/page/style.mjs +149 -0
- package/lib/schema-component/antd/pagination/index.mjs +48 -0
- package/lib/schema-component/antd/password/Password.mjs +102 -0
- package/lib/schema-component/antd/password/PasswordStrength.mjs +29 -0
- package/lib/schema-component/antd/password/__tests__/password.test.mjs +46 -0
- package/lib/schema-component/antd/password/__tests__/utils.test.mjs +27 -0
- package/lib/schema-component/antd/password/demos/demo1.mjs +59 -0
- package/lib/schema-component/antd/password/demos/demo2.mjs +62 -0
- package/lib/schema-component/antd/password/index.mjs +5 -0
- package/lib/schema-component/antd/password/utils.mjs +146 -0
- package/lib/schema-component/antd/percent/Percent.mjs +59 -0
- package/lib/schema-component/antd/percent/__tests__/percent.test.mjs +31 -0
- package/lib/schema-component/antd/percent/demos/percent.mjs +57 -0
- package/lib/schema-component/antd/percent/index.mjs +5 -0
- package/lib/schema-component/antd/popover/Popover.mjs +67 -0
- package/lib/schema-component/antd/popover/index.mjs +5 -0
- package/lib/schema-component/antd/preview/Preview.mjs +324 -0
- package/lib/schema-component/antd/preview/__tests__/preview.test.mjs +26 -0
- package/lib/schema-component/antd/preview/demos/demo1.mjs +103 -0
- package/lib/schema-component/antd/preview/index.mjs +5 -0
- package/lib/schema-component/antd/quick-edit/QuickEdit.mjs +148 -0
- package/lib/schema-component/antd/quick-edit/index.mjs +5 -0
- package/lib/schema-component/antd/radio/Radio.mjs +62 -0
- package/lib/schema-component/antd/radio/__tests__/radio.test.mjs +64 -0
- package/lib/schema-component/antd/radio/demos/demo1.mjs +60 -0
- package/lib/schema-component/antd/radio/demos/demo2.mjs +72 -0
- package/lib/schema-component/antd/radio/demos/demo3.mjs +73 -0
- package/lib/schema-component/antd/radio/index.mjs +5 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.mjs +308 -0
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.mjs +177 -0
- package/lib/schema-component/antd/record-picker/RecordPicker.mjs +17 -0
- package/lib/schema-component/antd/record-picker/__tests__/record-picker.test.mjs +44 -0
- package/lib/schema-component/antd/record-picker/demos/demo1.mjs +198 -0
- package/lib/schema-component/antd/record-picker/demos/mockData.mjs +214 -0
- package/lib/schema-component/antd/record-picker/index.mjs +24 -0
- package/lib/schema-component/antd/record-picker/useFieldNames.mjs +18 -0
- package/lib/schema-component/antd/record-picker/util.mjs +59 -0
- package/lib/schema-component/antd/remote-select/ReadPretty.mjs +71 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.mjs +291 -0
- package/lib/schema-component/antd/remote-select/__tests__/remote-select.test.mjs +33 -0
- package/lib/schema-component/antd/remote-select/demos/demo1.mjs +75 -0
- package/lib/schema-component/antd/remote-select/index.mjs +5 -0
- package/lib/schema-component/antd/remote-select/shared.mjs +11 -0
- package/lib/schema-component/antd/rich-text/RichText.mjs +85 -0
- package/lib/schema-component/antd/rich-text/__tests__/rich-text.test.mjs +28 -0
- package/lib/schema-component/antd/rich-text/demos/demo1.mjs +61 -0
- package/lib/schema-component/antd/rich-text/index.mjs +5 -0
- package/lib/schema-component/antd/rich-text/style.mjs +818 -0
- package/lib/schema-component/antd/scroll-area/ScrollArea.mjs +63 -0
- package/lib/schema-component/antd/scroll-area/index.mjs +5 -0
- package/lib/schema-component/antd/select/FormulaSelect.mjs +263 -0
- package/lib/schema-component/antd/select/ReadPretty.mjs +61 -0
- package/lib/schema-component/antd/select/Select.mjs +214 -0
- package/lib/schema-component/antd/select/__tests__/select.test.mjs +63 -0
- package/lib/schema-component/antd/select/__tests__/utils.test.mjs +135 -0
- package/lib/schema-component/antd/select/demos/demo1.mjs +91 -0
- package/lib/schema-component/antd/select/demos/demo2.mjs +95 -0
- package/lib/schema-component/antd/select/demos/demo3.mjs +105 -0
- package/lib/schema-component/antd/select/index.mjs +7 -0
- package/lib/schema-component/antd/select/utils.mjs +49 -0
- package/lib/schema-component/antd/space/index.mjs +36 -0
- package/lib/schema-component/antd/table/Table.Array.Designer.mjs +26 -0
- package/lib/schema-component/antd/table/Table.Array.mjs +358 -0
- package/lib/schema-component/antd/table/Table.Column.ActionBar.mjs +62 -0
- package/lib/schema-component/antd/table/Table.Column.Decorator.mjs +77 -0
- package/lib/schema-component/antd/table/Table.Column.Designer.mjs +173 -0
- package/lib/schema-component/antd/table/Table.Column.mjs +22 -0
- package/lib/schema-component/antd/table/Table.Designer.mjs +32 -0
- package/lib/schema-component/antd/table/Table.RowActionDesigner.mjs +60 -0
- package/lib/schema-component/antd/table/Table.RowSelection.mjs +47 -0
- package/lib/schema-component/antd/table/Table.Void.Designer.mjs +278 -0
- package/lib/schema-component/antd/table/Table.Void.mjs +155 -0
- package/lib/schema-component/antd/table/__tests__/table.test.mjs +45 -0
- package/lib/schema-component/antd/table/demos/demo1.mjs +77 -0
- package/lib/schema-component/antd/table/demos/demo2.mjs +77 -0
- package/lib/schema-component/antd/table/demos/demo3.mjs +77 -0
- package/lib/schema-component/antd/table/demos/demo4.mjs +242 -0
- package/lib/schema-component/antd/table/index.mjs +60 -0
- package/lib/schema-component/antd/table-v2/Table.ActionColumnDesigner.mjs +60 -0
- package/lib/schema-component/antd/table-v2/Table.Column.ActionBar.mjs +72 -0
- package/lib/schema-component/antd/table-v2/Table.Column.Decorator.mjs +91 -0
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.mjs +514 -0
- package/lib/schema-component/antd/table-v2/Table.Column.mjs +23 -0
- package/lib/schema-component/antd/table-v2/Table.Designer.mjs +32 -0
- package/lib/schema-component/antd/table-v2/Table.Index.mjs +22 -0
- package/lib/schema-component/antd/table-v2/Table.mjs +574 -0
- package/lib/schema-component/antd/table-v2/Table.styles.mjs +146 -0
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.mjs +392 -0
- package/lib/schema-component/antd/table-v2/TableField.mjs +77 -0
- package/lib/schema-component/antd/table-v2/TableSelector.mjs +9 -0
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.mjs +347 -0
- package/lib/schema-component/antd/table-v2/__tests__/table-v2.test.mjs +31 -0
- package/lib/schema-component/antd/table-v2/components/ColumnFieldProvider.mjs +59 -0
- package/lib/schema-component/antd/table-v2/demos/collections.mjs +1563 -0
- package/lib/schema-component/antd/table-v2/demos/demo1.mjs +251 -0
- package/lib/schema-component/antd/table-v2/demos/demo2.mjs +145 -0
- package/lib/schema-component/antd/table-v2/index.mjs +52 -0
- package/lib/schema-component/antd/table-v2/utils.mjs +20 -0
- package/lib/schema-component/antd/tabs/Tabs.Designer.mjs +159 -0
- package/lib/schema-component/antd/tabs/Tabs.mjs +141 -0
- package/lib/schema-component/antd/tabs/__tests__/tabs.test.mjs +29 -0
- package/lib/schema-component/antd/tabs/context.mjs +23 -0
- package/lib/schema-component/antd/tabs/demos/demo1.mjs +86 -0
- package/lib/schema-component/antd/tabs/index.mjs +7 -0
- package/lib/schema-component/antd/time-picker/ReadPretty.mjs +42 -0
- package/lib/schema-component/antd/time-picker/TimePicker.mjs +40 -0
- package/lib/schema-component/antd/time-picker/__tests__/time-picker.test.mjs +68 -0
- package/lib/schema-component/antd/time-picker/demos/demo1.mjs +59 -0
- package/lib/schema-component/antd/time-picker/demos/demo2.mjs +59 -0
- package/lib/schema-component/antd/time-picker/index.mjs +5 -0
- package/lib/schema-component/antd/tree/Tree.mjs +115 -0
- package/lib/schema-component/antd/tree/index.mjs +10 -0
- package/lib/schema-component/antd/tree-select/ReadPretty.mjs +91 -0
- package/lib/schema-component/antd/tree-select/TreeSelect.mjs +37 -0
- package/lib/schema-component/antd/tree-select/__tests__/tree-select.test.mjs +29 -0
- package/lib/schema-component/antd/tree-select/demos/demo1.mjs +103 -0
- package/lib/schema-component/antd/tree-select/index.mjs +5 -0
- package/lib/schema-component/antd/unixTimestamp/UnixTimestamp.mjs +69 -0
- package/lib/schema-component/antd/unixTimestamp/index.mjs +5 -0
- package/lib/schema-component/antd/upload/ReadPretty.mjs +249 -0
- package/lib/schema-component/antd/upload/Upload.mjs +394 -0
- package/lib/schema-component/antd/upload/__tests__/upload.test.mjs +31 -0
- package/lib/schema-component/antd/upload/demos/apiClient.mjs +51 -0
- package/lib/schema-component/antd/upload/demos/demo1.mjs +71 -0
- package/lib/schema-component/antd/upload/demos/demo2.mjs +137 -0
- package/lib/schema-component/antd/upload/index.mjs +5 -0
- package/lib/schema-component/antd/upload/placeholder.mjs +66 -0
- package/lib/schema-component/antd/upload/shared.mjs +254 -0
- package/lib/schema-component/antd/upload/style.mjs +81 -0
- package/lib/schema-component/antd/upload/type.d.mjs +7 -0
- package/lib/schema-component/antd/variable/CodeMirror.mjs +124 -0
- package/lib/schema-component/antd/variable/Input.mjs +384 -0
- package/lib/schema-component/antd/variable/JSONInput.mjs +57 -0
- package/lib/schema-component/antd/variable/RawTextArea.mjs +125 -0
- package/lib/schema-component/antd/variable/TextArea.mjs +504 -0
- package/lib/schema-component/antd/variable/Variable.mjs +57 -0
- package/lib/schema-component/antd/variable/VariableSelect.mjs +101 -0
- package/lib/schema-component/antd/variable/VariableSelect.style.mjs +36 -0
- package/lib/schema-component/antd/variable/XButton.mjs +35 -0
- package/lib/schema-component/antd/variable/__tests__/variable.test.mjs +66 -0
- package/lib/schema-component/antd/variable/demos/demo1.mjs +63 -0
- package/lib/schema-component/antd/variable/demos/demo2.mjs +63 -0
- package/lib/schema-component/antd/variable/demos/demo3.mjs +63 -0
- package/lib/schema-component/antd/variable/index.mjs +5 -0
- package/lib/schema-component/antd/variable/style.mjs +186 -0
- package/lib/schema-component/common/dnd-context/index.mjs +124 -0
- package/lib/schema-component/common/index.mjs +7 -0
- package/lib/schema-component/common/infinite-scroll/infinite-scroll.mjs +153 -0
- package/lib/schema-component/common/infinite-scroll/style.mjs +36 -0
- package/lib/schema-component/common/sortable-item/SortableItem.mjs +166 -0
- package/lib/schema-component/common/sortable-item/index.mjs +5 -0
- package/lib/schema-component/common/utils/logic.mjs +578 -0
- package/lib/schema-component/common/utils/uitls.mjs +155 -0
- package/lib/schema-component/context.mjs +10 -0
- package/lib/schema-component/core/DesignableSwitch.mjs +67 -0
- package/lib/schema-component/core/FormProvider.mjs +70 -0
- package/lib/schema-component/core/RemoteSchemaComponent.mjs +72 -0
- package/lib/schema-component/core/SchemaComponent.mjs +86 -0
- package/lib/schema-component/core/SchemaComponentOptions.mjs +62 -0
- package/lib/schema-component/core/SchemaComponentProvider.mjs +116 -0
- package/lib/schema-component/core/index.mjs +32 -0
- package/lib/schema-component/demos/demo1.mjs +111 -0
- package/lib/schema-component/demos/demo2.mjs +40 -0
- package/lib/schema-component/demos/demo3.mjs +41 -0
- package/lib/schema-component/demos/demo4.mjs +41 -0
- package/lib/schema-component/hooks/__tests__/designable.test.mjs +564 -0
- package/lib/schema-component/hooks/__tests__/splitWrapSchema.test.mjs +98 -0
- package/lib/schema-component/hooks/index.mjs +27 -0
- package/lib/schema-component/hooks/useAttach.mjs +24 -0
- package/lib/schema-component/hooks/useCompile.mjs +59 -0
- package/lib/schema-component/hooks/useComponent.mjs +26 -0
- package/lib/schema-component/hooks/useDesignable.mjs +858 -0
- package/lib/schema-component/hooks/useDesigner.mjs +36 -0
- package/lib/schema-component/hooks/useFieldComponentOptions.mjs +106 -0
- package/lib/schema-component/hooks/useFieldModeOptions.mjs +304 -0
- package/lib/schema-component/hooks/useFieldProps.mjs +27 -0
- package/lib/schema-component/hooks/useFieldTitle.mjs +37 -0
- package/lib/schema-component/hooks/useProps.mjs +22 -0
- package/lib/schema-component/hooks/useSchemaComponentContext.mjs +15 -0
- package/lib/schema-component/hooks/useTableSize.mjs +40 -0
- package/lib/schema-component/index.mjs +15 -0
- package/lib/schema-component/types.mjs +7 -0
- package/lib/schema-initializer/buttons/CustomFormItemInitializers.mjs +71 -0
- package/lib/schema-initializer/buttons/FormItemInitializers.mjs +187 -0
- package/lib/schema-initializer/buttons/RecordBlockInitializers.mjs +460 -0
- package/lib/schema-initializer/buttons/SubTableActionInitializers.mjs +41 -0
- package/lib/schema-initializer/buttons/TabPaneInitializers.mjs +232 -0
- package/lib/schema-initializer/buttons/index.mjs +16 -0
- package/lib/schema-initializer/components/CreateRecordAction.mjs +414 -0
- package/lib/schema-initializer/components/DeletedField.mjs +25 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.mjs +177 -0
- package/lib/schema-initializer/components/assigned-field/index.mjs +5 -0
- package/lib/schema-initializer/components/index.mjs +7 -0
- package/lib/schema-initializer/demos/basic.mjs +81 -0
- package/lib/schema-initializer/demos/build-type.mjs +96 -0
- package/lib/schema-initializer/demos/custom-button.mjs +114 -0
- package/lib/schema-initializer/demos/custom-items-component.mjs +116 -0
- package/lib/schema-initializer/demos/dynamic-visible-children.mjs +94 -0
- package/lib/schema-initializer/demos/insert-schema-action.mjs +111 -0
- package/lib/schema-initializer/demos/insert-schema-basic.mjs +133 -0
- package/lib/schema-initializer/demos/insert-schema-form-item.mjs +153 -0
- package/lib/schema-initializer/demos/nested-items.mjs +170 -0
- package/lib/schema-initializer/hooks/useGetAriaLabelOfSchemaInitializer.mjs +36 -0
- package/lib/schema-initializer/index.mjs +329 -0
- package/lib/schema-initializer/items/ActionInitializer.mjs +29 -0
- package/lib/schema-initializer/items/BlockInitializer.mjs +43 -0
- package/lib/schema-initializer/items/CreateFilterActionInitializer.mjs +33 -0
- package/lib/schema-initializer/items/CreateResetActionInitializer.mjs +28 -0
- package/lib/schema-initializer/items/CustomFilterFormItemInitializer.mjs +540 -0
- package/lib/schema-initializer/items/CustomizeActionInitializer.mjs +27 -0
- package/lib/schema-initializer/items/DataBlockInitializer.mjs +393 -0
- package/lib/schema-initializer/items/DeleteEventActionInitializer.mjs +36 -0
- package/lib/schema-initializer/items/FilterBlockInitializer.mjs +9 -0
- package/lib/schema-initializer/items/G2PlotInitializer.mjs +28 -0
- package/lib/schema-initializer/items/InitializerWithSwitch.mjs +47 -0
- package/lib/schema-initializer/items/RecordAssociationBlockInitializer.mjs +86 -0
- package/lib/schema-initializer/items/RecordAssociationDetailsBlockInitializer.mjs +84 -0
- package/lib/schema-initializer/items/RecordAssociationFormBlockInitializer.mjs +119 -0
- package/lib/schema-initializer/items/RecordAssociationGridCardBlockInitializer.mjs +86 -0
- package/lib/schema-initializer/items/RecordAssociationListBlockInitializer.mjs +84 -0
- package/lib/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.mjs +118 -0
- package/lib/schema-initializer/items/SelectActionInitializer.mjs +76 -0
- package/lib/schema-initializer/items/SubmitActionInitializer.mjs +34 -0
- package/lib/schema-initializer/items/TableActionColumnInitializer.mjs +57 -0
- package/lib/schema-initializer/items/index.mjs +50 -0
- package/lib/schema-initializer/style.mjs +23 -0
- package/lib/schema-initializer/utils.mjs +1535 -0
- package/lib/schema-items/GeneralSchemaItems.mjs +181 -0
- package/lib/schema-items/GeneralSettings.mjs +226 -0
- package/lib/schema-items/OpenModeSchemaItems.mjs +215 -0
- package/lib/schema-items/index.mjs +7 -0
- package/lib/schema-settings/DataTemplates/FormDataTemplates.mjs +332 -0
- package/lib/schema-settings/DataTemplates/TreeLabel.mjs +42 -0
- package/lib/schema-settings/DataTemplates/components/AsDefaultTemplate.mjs +64 -0
- package/lib/schema-settings/DataTemplates/components/DataTemplateTitle.mjs +305 -0
- package/lib/schema-settings/DataTemplates/components/DataTemplateTitle.style.mjs +15 -0
- package/lib/schema-settings/DataTemplates/components/Designer.mjs +208 -0
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.mjs +348 -0
- package/lib/schema-settings/DataTemplates/index.mjs +5 -0
- package/lib/schema-settings/DataTemplates/utils.mjs +300 -0
- package/lib/schema-settings/DateFormat/ExpiresRadio.mjs +160 -0
- package/lib/schema-settings/EditCustomDefaultValue.mjs +137 -0
- package/lib/schema-settings/EditFormulaTitleField.mjs +127 -0
- package/lib/schema-settings/EnableChildCollections/DynamicComponent.mjs +91 -0
- package/lib/schema-settings/EnableChildCollections/index.mjs +129 -0
- package/lib/schema-settings/GeneralSchemaDesigner.mjs +328 -0
- package/lib/schema-settings/LinkageRules/DynamicComponent.mjs +79 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.mjs +272 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.mjs +116 -0
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.mjs +200 -0
- package/lib/schema-settings/LinkageRules/Variables.mjs +119 -0
- package/lib/schema-settings/LinkageRules/action-hooks.mjs +128 -0
- package/lib/schema-settings/LinkageRules/components/EnableLinkage.mjs +56 -0
- package/lib/schema-settings/LinkageRules/components/LinkageHeader.mjs +304 -0
- package/lib/schema-settings/LinkageRules/components/LinkageHeader.style.mjs +15 -0
- package/lib/schema-settings/LinkageRules/context.mjs +14 -0
- package/lib/schema-settings/LinkageRules/index.mjs +247 -0
- package/lib/schema-settings/LinkageRules/type.mjs +18 -0
- package/lib/schema-settings/LinkageRules/useValues.mjs +84 -0
- package/lib/schema-settings/SchemaSettingCollection.mjs +73 -0
- package/lib/schema-settings/SchemaSettingComponent.mjs +62 -0
- package/lib/schema-settings/SchemaSettings.mjs +1517 -0
- package/lib/schema-settings/SchemaSettingsDataScope.mjs +152 -0
- package/lib/schema-settings/SchemaSettingsDateFormat.mjs +231 -0
- package/lib/schema-settings/SchemaSettingsDefaultValue.mjs +274 -0
- package/lib/schema-settings/SchemaSettingsNumberFormat.mjs +205 -0
- package/lib/schema-settings/SchemaSettingsPlugin.mjs +265 -0
- package/lib/schema-settings/SchemaSettingsSortingRule.mjs +155 -0
- package/lib/schema-settings/VariableInput/VariableInput.mjs +260 -0
- package/lib/schema-settings/VariableInput/hooks/index.mjs +9 -0
- package/lib/schema-settings/VariableInput/hooks/useBaseVariable.mjs +228 -0
- package/lib/schema-settings/VariableInput/hooks/useBlockCollection.mjs +16 -0
- package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.mjs +126 -0
- package/lib/schema-settings/VariableInput/hooks/useDateVariable.mjs +179 -0
- package/lib/schema-settings/VariableInput/hooks/useFilterVariable.mjs +77 -0
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.mjs +85 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.mjs +94 -0
- package/lib/schema-settings/VariableInput/hooks/useParentRecordVariable.mjs +71 -0
- package/lib/schema-settings/VariableInput/hooks/usePopupVariable.mjs +37 -0
- package/lib/schema-settings/VariableInput/hooks/useRecordVariable.mjs +64 -0
- package/lib/schema-settings/VariableInput/hooks/useRoleVariable.mjs +64 -0
- package/lib/schema-settings/VariableInput/hooks/useUserVariable.mjs +67 -0
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.mjs +140 -0
- package/lib/schema-settings/VariableInput/index.mjs +7 -0
- package/lib/schema-settings/VariableInput/type.mjs +4 -0
- package/lib/schema-settings/VariableInput/utils/formatVariableScop.mjs +16 -0
- package/lib/schema-settings/demos/basic.mjs +75 -0
- package/lib/schema-settings/demos/built-type.mjs +157 -0
- package/lib/schema-settings/demos/custom-component.mjs +58 -0
- package/lib/schema-settings/demos/demo3.mjs +120 -0
- package/lib/schema-settings/demos/schema-basic.mjs +84 -0
- package/lib/schema-settings/filter-form/FormFilterScope.mjs +147 -0
- package/lib/schema-settings/filter-form/context.mjs +14 -0
- package/lib/schema-settings/hooks/useFilterFormCustomProps.mjs +22 -0
- package/lib/schema-settings/hooks/useGetAriaLabelOfDesigner.mjs +39 -0
- package/lib/schema-settings/hooks/useIsAllowToSetDefaultValue.mjs +109 -0
- package/lib/schema-settings/hooks/useIsShowMultipleSwitch.mjs +27 -0
- package/lib/schema-settings/hooks/useParseDataScopeFilter.mjs +84 -0
- package/lib/schema-settings/index.mjs +46 -0
- package/lib/schema-settings/isPatternDisabled.mjs +8 -0
- package/lib/schema-settings/styles.mjs +92 -0
- package/lib/schema-settings/types.mjs +4 -0
- package/lib/schema-templates/BlockTemplate.mjs +63 -0
- package/lib/schema-templates/BlockTemplateDetails.mjs +126 -0
- package/lib/schema-templates/BlockTemplatePage.mjs +55 -0
- package/lib/schema-templates/SchemaTemplateManagerProvider.mjs +103 -0
- package/lib/schema-templates/collections/uiSchemaTemplates.mjs +22 -0
- package/lib/schema-templates/index.mjs +11 -0
- package/lib/schema-templates/schemas/CollectionTitle.mjs +52 -0
- package/lib/schema-templates/schemas/uiSchemaTemplates.mjs +249 -0
- package/lib/schema-templates/useSchemaTemplateManager.mjs +119 -0
- package/lib/style/css-variable/CSSVariableProvider.mjs +90 -0
- package/lib/style/css-variable/index.mjs +9 -0
- package/lib/style/index.mjs +16 -0
- package/lib/style/theme/AntdAppProvider.mjs +54 -0
- package/lib/style/theme/defaultTheme.mjs +24 -0
- package/lib/style/theme/index.mjs +96 -0
- package/lib/style/theme/type.mjs +4 -0
- package/lib/style/useToken.mjs +13 -0
- package/lib/testUtils/index.mjs +5 -0
- package/lib/testUtils/mockAPIClient.mjs +57 -0
- package/lib/user/ChangePassword.mjs +180 -0
- package/lib/user/CurrentUser.mjs +282 -0
- package/lib/user/CurrentUserProvider.mjs +89 -0
- package/lib/user/CurrentUserSettingsMenuProvider.mjs +88 -0
- package/lib/user/EditProfile.mjs +172 -0
- package/lib/user/LanguageSettings.mjs +70 -0
- package/lib/user/SwitchRole.mjs +66 -0
- package/lib/user/VerificationCode.mjs +115 -0
- package/lib/user/__tests__/current-user-settings-menu-provider.test.mjs +64 -0
- package/lib/user/index.mjs +9 -0
- package/lib/variables/VariablesProvider.mjs +319 -0
- package/lib/variables/__tests__/useVariables.test.mjs +473 -0
- package/lib/variables/__tests__/utils/filterEmptyValues.test.mjs +52 -0
- package/lib/variables/__tests__/utils/getPath.test.mjs +10 -0
- package/lib/variables/__tests__/utils/getVariableName.test.mjs +10 -0
- package/lib/variables/__tests__/utils/isVariable.test.mjs +28 -0
- package/lib/variables/__tests__/utils/transformVariableValue.test.mjs +142 -0
- package/lib/variables/__tests__/utils/uniq.test.mjs +83 -0
- package/lib/variables/constants.mjs +5 -0
- package/lib/variables/hooks/useBuiltinVariables.mjs +80 -0
- package/lib/variables/hooks/useContextVariable.mjs +38 -0
- package/lib/variables/hooks/useLocalVariables.mjs +102 -0
- package/lib/variables/hooks/useVariables.mjs +16 -0
- package/lib/variables/index.mjs +36 -0
- package/lib/variables/types.mjs +4 -0
- package/lib/variables/utils/filterEmptyValues.mjs +12 -0
- package/lib/variables/utils/getAction.mjs +14 -0
- package/lib/variables/utils/getPath.mjs +19 -0
- package/lib/variables/utils/getVariableName.mjs +25 -0
- package/lib/variables/utils/hasRequested.mjs +24 -0
- package/lib/variables/utils/isVariable.mjs +15 -0
- package/lib/variables/utils/transformVariableValue.mjs +55 -0
- package/lib/variables/utils/uniq.mjs +26 -0
- package/package.json +4 -4
|
@@ -0,0 +1,1465 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__ from "@tachybase/utils/client";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash_get__ from "lodash/get";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash_omit__ from "lodash/omit";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_router_dom__ from "react-router-dom";
|
|
10
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_to_print__ from "react-to-print";
|
|
11
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../index.mjs";
|
|
12
|
+
import * as __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__ from "../../api-client/index.mjs";
|
|
13
|
+
import * as __WEBPACK_EXTERNAL_MODULE__built_in_dynamic_page_utils_mjs__ from "../../built-in/dynamic-page/utils.mjs";
|
|
14
|
+
import * as __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__ from "../../collection-manager/index.mjs";
|
|
15
|
+
import * as __WEBPACK_EXTERNAL_MODULE__filter_provider_FilterProvider_mjs__ from "../../filter-provider/FilterProvider.mjs";
|
|
16
|
+
import * as __WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__ from "../../filter-provider/utils.mjs";
|
|
17
|
+
import * as __WEBPACK_EXTERNAL_MODULE__record_provider_index_mjs__ from "../../record-provider/index.mjs";
|
|
18
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
|
|
19
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_association_field_util_mjs__ from "../../schema-component/antd/association-field/util.mjs";
|
|
20
|
+
import * as __WEBPACK_EXTERNAL_MODULE__user_index_mjs__ from "../../user/index.mjs";
|
|
21
|
+
import * as __WEBPACK_EXTERNAL_MODULE__variables_index_mjs__ from "../../variables/index.mjs";
|
|
22
|
+
import * as __WEBPACK_EXTERNAL_MODULE__variables_utils_isVariable_mjs__ from "../../variables/utils/isVariable.mjs";
|
|
23
|
+
import * as __WEBPACK_EXTERNAL_MODULE__variables_utils_transformVariableValue_mjs__ from "../../variables/utils/transformVariableValue.mjs";
|
|
24
|
+
import * as __WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__ from "../BlockProvider.mjs";
|
|
25
|
+
import * as __WEBPACK_EXTERNAL_MODULE__DetailsBlockProvider_mjs__ from "../DetailsBlockProvider.mjs";
|
|
26
|
+
import * as __WEBPACK_EXTERNAL_MODULE__TableFieldProvider_mjs__ from "../TableFieldProvider.mjs";
|
|
27
|
+
export * from "./useFormActiveFields.mjs";
|
|
28
|
+
export * from "./useParsedFilter.mjs";
|
|
29
|
+
export * from "./useDataBlockSourceId.mjs";
|
|
30
|
+
export * from "./useIsMobile.mjs";
|
|
31
|
+
|
|
32
|
+
;// CONCATENATED MODULE: external "react"
|
|
33
|
+
|
|
34
|
+
;// CONCATENATED MODULE: external "@tachybase/schema"
|
|
35
|
+
|
|
36
|
+
;// CONCATENATED MODULE: external "@tachybase/utils/client"
|
|
37
|
+
|
|
38
|
+
;// CONCATENATED MODULE: external "antd"
|
|
39
|
+
|
|
40
|
+
;// CONCATENATED MODULE: external "lodash"
|
|
41
|
+
|
|
42
|
+
;// CONCATENATED MODULE: external "lodash/get"
|
|
43
|
+
|
|
44
|
+
;// CONCATENATED MODULE: external "lodash/omit"
|
|
45
|
+
|
|
46
|
+
;// CONCATENATED MODULE: external "react-i18next"
|
|
47
|
+
|
|
48
|
+
;// CONCATENATED MODULE: external "react-router-dom"
|
|
49
|
+
|
|
50
|
+
;// CONCATENATED MODULE: external "react-to-print"
|
|
51
|
+
|
|
52
|
+
;// CONCATENATED MODULE: external "../../index.mjs"
|
|
53
|
+
|
|
54
|
+
;// CONCATENATED MODULE: external "../../api-client/index.mjs"
|
|
55
|
+
|
|
56
|
+
;// CONCATENATED MODULE: external "../../built-in/dynamic-page/utils.mjs"
|
|
57
|
+
|
|
58
|
+
;// CONCATENATED MODULE: external "../../collection-manager/index.mjs"
|
|
59
|
+
|
|
60
|
+
;// CONCATENATED MODULE: external "../../filter-provider/FilterProvider.mjs"
|
|
61
|
+
|
|
62
|
+
;// CONCATENATED MODULE: external "../../filter-provider/utils.mjs"
|
|
63
|
+
|
|
64
|
+
;// CONCATENATED MODULE: external "../../record-provider/index.mjs"
|
|
65
|
+
|
|
66
|
+
;// CONCATENATED MODULE: external "../../schema-component/index.mjs"
|
|
67
|
+
|
|
68
|
+
;// CONCATENATED MODULE: external "../../schema-component/antd/association-field/util.mjs"
|
|
69
|
+
|
|
70
|
+
;// CONCATENATED MODULE: external "../../user/index.mjs"
|
|
71
|
+
|
|
72
|
+
;// CONCATENATED MODULE: external "../../variables/index.mjs"
|
|
73
|
+
|
|
74
|
+
;// CONCATENATED MODULE: external "../../variables/utils/isVariable.mjs"
|
|
75
|
+
|
|
76
|
+
;// CONCATENATED MODULE: external "../../variables/utils/transformVariableValue.mjs"
|
|
77
|
+
|
|
78
|
+
;// CONCATENATED MODULE: external "../BlockProvider.mjs"
|
|
79
|
+
|
|
80
|
+
;// CONCATENATED MODULE: external "../DetailsBlockProvider.mjs"
|
|
81
|
+
|
|
82
|
+
;// CONCATENATED MODULE: external "../TableFieldProvider.mjs"
|
|
83
|
+
|
|
84
|
+
;// CONCATENATED MODULE: ./packages/client/src/block-provider/hooks/index.ts?__rslib_entry__
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
function renderTemplate(str, data) {
|
|
116
|
+
const re = /\{\{\s*((\w+\.?)+)\s*\}\}/g;
|
|
117
|
+
return str.replace(re, function(_, key) {
|
|
118
|
+
return (0,__WEBPACK_EXTERNAL_MODULE_lodash_get__["default"])(data, key) || '';
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const filterValue = (value)=>{
|
|
122
|
+
if (typeof value !== 'object') {
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
if (!value) {
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
128
|
+
if (Array.isArray(value)) {
|
|
129
|
+
return value.map((v)=>filterValue(v));
|
|
130
|
+
}
|
|
131
|
+
const obj = {};
|
|
132
|
+
for(const key in value){
|
|
133
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
134
|
+
const val = value[key];
|
|
135
|
+
if (Array.isArray(val) || val && typeof val === 'object') {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
obj[key] = val;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return obj;
|
|
142
|
+
};
|
|
143
|
+
function getFormValues(param) {
|
|
144
|
+
let { filterByTk, field, form, fieldNames, getField, resource, actionFields } = param;
|
|
145
|
+
if (filterByTk) {
|
|
146
|
+
if (actionFields) {
|
|
147
|
+
const keys = Object.keys(form.values).filter((key)=>{
|
|
148
|
+
const f = getField(key);
|
|
149
|
+
return !actionFields.includes(key) && [
|
|
150
|
+
'hasOne',
|
|
151
|
+
'hasMany',
|
|
152
|
+
'belongsTo',
|
|
153
|
+
'belongsToMany'
|
|
154
|
+
].includes(f === null || f === void 0 ? void 0 : f.type);
|
|
155
|
+
});
|
|
156
|
+
return (0,__WEBPACK_EXTERNAL_MODULE_lodash_omit__["default"])({
|
|
157
|
+
...form.values
|
|
158
|
+
}, keys);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return form.values;
|
|
162
|
+
}
|
|
163
|
+
function useCollectValuesToSubmit() {
|
|
164
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
165
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
166
|
+
const { field, resource } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
167
|
+
const { fields, getField, getTreeParentField, name } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
168
|
+
const fieldNames = fields.map((field)=>field.name);
|
|
169
|
+
const { fieldSchema } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
170
|
+
const { getActiveFieldsName } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormActiveFields)() || {};
|
|
171
|
+
const variables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useVariables)();
|
|
172
|
+
const localVariables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useLocalVariables)({
|
|
173
|
+
currentForm: form
|
|
174
|
+
});
|
|
175
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
176
|
+
const currentRecord = (0,__WEBPACK_EXTERNAL_MODULE__record_provider_index_mjs__.useRecord)();
|
|
177
|
+
return (0,__WEBPACK_EXTERNAL_MODULE_react__.useCallback)(async ()=>{
|
|
178
|
+
var _fieldSchema_xcomponentprops;
|
|
179
|
+
var _actionSchema_xactionsettings;
|
|
180
|
+
const { assignedValues: originalAssignedValues = {}, overwriteValues } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
181
|
+
const values = getFormValues({
|
|
182
|
+
filterByTk,
|
|
183
|
+
field,
|
|
184
|
+
form,
|
|
185
|
+
fieldNames,
|
|
186
|
+
getField,
|
|
187
|
+
resource,
|
|
188
|
+
actionFields: (getActiveFieldsName === null || getActiveFieldsName === void 0 ? void 0 : getActiveFieldsName('form')) || []
|
|
189
|
+
});
|
|
190
|
+
const assignedValues = {};
|
|
191
|
+
const waitList = Object.keys(originalAssignedValues).map(async (key)=>{
|
|
192
|
+
const value = originalAssignedValues[key];
|
|
193
|
+
const collectionField = getField(key);
|
|
194
|
+
if (false) {}
|
|
195
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__variables_utils_isVariable_mjs__.isVariable)(value)) {
|
|
196
|
+
const result = await (variables === null || variables === void 0 ? void 0 : variables.parseVariable(value, localVariables));
|
|
197
|
+
if (result) {
|
|
198
|
+
assignedValues[key] = (0,__WEBPACK_EXTERNAL_MODULE__variables_utils_transformVariableValue_mjs__.transformVariableValue)(result, {
|
|
199
|
+
targetCollectionField: collectionField
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
} else if (value != null && value !== '') {
|
|
203
|
+
assignedValues[key] = value;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
await Promise.all(waitList);
|
|
207
|
+
// const values = omitBy(formValues, (value) => isEqual(JSON.stringify(value), '[{}]'));
|
|
208
|
+
const addChild = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) === null || _fieldSchema_xcomponentprops === void 0 ? void 0 : _fieldSchema_xcomponentprops.addChild;
|
|
209
|
+
if (addChild) {
|
|
210
|
+
var _currentRecord___parent;
|
|
211
|
+
const treeParentField = getTreeParentField();
|
|
212
|
+
var _treeParentField_name;
|
|
213
|
+
values[(_treeParentField_name = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.name) !== null && _treeParentField_name !== void 0 ? _treeParentField_name : 'parent'] = (0,__WEBPACK_EXTERNAL_MODULE_lodash_omit__["default"])(currentRecord === null || currentRecord === void 0 ? void 0 : currentRecord.__parent, [
|
|
214
|
+
'children'
|
|
215
|
+
]);
|
|
216
|
+
var _treeParentField_foreignKey;
|
|
217
|
+
values[(_treeParentField_foreignKey = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.foreignKey) !== null && _treeParentField_foreignKey !== void 0 ? _treeParentField_foreignKey : 'parentId'] = currentRecord === null || currentRecord === void 0 ? void 0 : (_currentRecord___parent = currentRecord.__parent) === null || _currentRecord___parent === void 0 ? void 0 : _currentRecord___parent.id;
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
...values,
|
|
221
|
+
...overwriteValues,
|
|
222
|
+
...assignedValues
|
|
223
|
+
};
|
|
224
|
+
}, [
|
|
225
|
+
actionSchema,
|
|
226
|
+
currentRecord === null || currentRecord === void 0 ? void 0 : currentRecord.__parent,
|
|
227
|
+
field,
|
|
228
|
+
fieldNames,
|
|
229
|
+
fieldSchema,
|
|
230
|
+
filterByTk,
|
|
231
|
+
form,
|
|
232
|
+
getActiveFieldsName,
|
|
233
|
+
getField,
|
|
234
|
+
getTreeParentField,
|
|
235
|
+
localVariables,
|
|
236
|
+
name,
|
|
237
|
+
resource,
|
|
238
|
+
variables
|
|
239
|
+
]);
|
|
240
|
+
}
|
|
241
|
+
const pageDetailsViewer = 'Action.Container';
|
|
242
|
+
const viewerSchema = {
|
|
243
|
+
type: 'void',
|
|
244
|
+
title: '{{t("View record")}}',
|
|
245
|
+
'x-component': 'Action.Container',
|
|
246
|
+
'x-component-props': {
|
|
247
|
+
className: 'tb-action-popup'
|
|
248
|
+
},
|
|
249
|
+
properties: {
|
|
250
|
+
page: {
|
|
251
|
+
type: 'void',
|
|
252
|
+
title: '{{t("Detail page")}}',
|
|
253
|
+
'x-designer': 'Page.Designer',
|
|
254
|
+
'x-component': 'Page',
|
|
255
|
+
'x-component-props': {
|
|
256
|
+
disablePageHeader: true
|
|
257
|
+
},
|
|
258
|
+
properties: {
|
|
259
|
+
grid: {
|
|
260
|
+
type: 'void',
|
|
261
|
+
'x-component': 'Grid',
|
|
262
|
+
'x-initializer': 'popup:common:addBlock',
|
|
263
|
+
properties: {}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
const useInsertSchema = ()=>{
|
|
270
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
271
|
+
const { insertAfterBegin } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
|
|
272
|
+
const insert = (0,__WEBPACK_EXTERNAL_MODULE_react__.useCallback)((ss)=>{
|
|
273
|
+
const schema = fieldSchema.reduceProperties((buf, s)=>{
|
|
274
|
+
if (s['x-component'] === pageDetailsViewer) {
|
|
275
|
+
return s;
|
|
276
|
+
}
|
|
277
|
+
return buf;
|
|
278
|
+
}, null);
|
|
279
|
+
if (!schema) {
|
|
280
|
+
insertAfterBegin(__WEBPACK_EXTERNAL_MODULE_lodash__["default"].cloneDeep(ss));
|
|
281
|
+
}
|
|
282
|
+
}, [
|
|
283
|
+
pageDetailsViewer
|
|
284
|
+
]);
|
|
285
|
+
return insert;
|
|
286
|
+
};
|
|
287
|
+
const useCancelActionProps = ()=>{
|
|
288
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
289
|
+
const ctx = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
290
|
+
return {
|
|
291
|
+
async onClick () {
|
|
292
|
+
ctx.setVisible(false);
|
|
293
|
+
void form.reset();
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
const useJumpDetails = ()=>{
|
|
298
|
+
const collection = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollection)();
|
|
299
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
300
|
+
const dn = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
|
|
301
|
+
const insert = useInsertSchema();
|
|
302
|
+
const navigate = (0,__WEBPACK_EXTERNAL_MODULE_react_router_dom__.useNavigate)();
|
|
303
|
+
return (filterByTk)=>{
|
|
304
|
+
if (dn.designable) {
|
|
305
|
+
insert(viewerSchema);
|
|
306
|
+
}
|
|
307
|
+
const targetSchema = fieldSchema.reduceProperties((buf, s)=>{
|
|
308
|
+
if (s['x-component'] === pageDetailsViewer) {
|
|
309
|
+
return s;
|
|
310
|
+
}
|
|
311
|
+
return buf;
|
|
312
|
+
});
|
|
313
|
+
if (targetSchema) {
|
|
314
|
+
navigate("../".concat(targetSchema['x-uid'], "/").concat(__WEBPACK_EXTERNAL_MODULE__built_in_dynamic_page_utils_mjs__.PathHandler.getInstance().toWildcardPath({
|
|
315
|
+
collection: collection.name,
|
|
316
|
+
filterByTk
|
|
317
|
+
})));
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
const useCreateActionProps = ()=>{
|
|
322
|
+
var _actionField_componentProps_filterKeys;
|
|
323
|
+
const record = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollectionRecord)();
|
|
324
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
325
|
+
const { field, resource, __parent } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
326
|
+
const jumpDetails = useJumpDetails();
|
|
327
|
+
const { setVisible } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
328
|
+
const navigate = (0,__WEBPACK_EXTERNAL_MODULE_react_router_dom__.useNavigate)();
|
|
329
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
330
|
+
const actionField = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
331
|
+
const compile = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
332
|
+
const { modal, message } = __WEBPACK_EXTERNAL_MODULE_antd__.App.useApp();
|
|
333
|
+
const { t } = (0,__WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
334
|
+
const { updateAssociationValues } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormBlockContext)();
|
|
335
|
+
const collectValues = useCollectValuesToSubmit();
|
|
336
|
+
const action = record.isNew ? actionField.componentProps.saveMode || 'create' : 'update';
|
|
337
|
+
const filterKeys = ((_actionField_componentProps_filterKeys = actionField.componentProps.filterKeys) === null || _actionField_componentProps_filterKeys === void 0 ? void 0 : _actionField_componentProps_filterKeys.checked) || [];
|
|
338
|
+
return {
|
|
339
|
+
async onClick () {
|
|
340
|
+
var _actionSchema_xactionsettings;
|
|
341
|
+
const { onSuccess, skipValidator, triggerWorkflows, pageMode } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
342
|
+
if (!skipValidator) {
|
|
343
|
+
await form.submit();
|
|
344
|
+
}
|
|
345
|
+
actionField.data = field.data || {};
|
|
346
|
+
actionField.data.loading = true;
|
|
347
|
+
try {
|
|
348
|
+
var __parent_service_refresh, __parent_service;
|
|
349
|
+
const data = await resource[action]({
|
|
350
|
+
values: await collectValues(),
|
|
351
|
+
filterKeys: filterKeys,
|
|
352
|
+
// TODO(refactor): should change to inject by plugin
|
|
353
|
+
triggerWorkflows: (triggerWorkflows === null || triggerWorkflows === void 0 ? void 0 : triggerWorkflows.length) ? triggerWorkflows.map((row)=>[
|
|
354
|
+
row.workflowKey,
|
|
355
|
+
row.context
|
|
356
|
+
].filter(Boolean).join('!')).join(',') : undefined,
|
|
357
|
+
updateAssociationValues
|
|
358
|
+
});
|
|
359
|
+
actionField.data.loading = false;
|
|
360
|
+
actionField.data.data = data;
|
|
361
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
362
|
+
if (pageMode) {
|
|
363
|
+
var _data_data_data, _data_data;
|
|
364
|
+
await resetFormCorrectly(form);
|
|
365
|
+
// FIXME primary key
|
|
366
|
+
jumpDetails(data === null || data === void 0 ? void 0 : (_data_data = data.data) === null || _data_data === void 0 ? void 0 : (_data_data_data = _data_data.data) === null || _data_data_data === void 0 ? void 0 : _data_data_data.id);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const successMessage = (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) ? compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) : t('Saved successfully');
|
|
370
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
371
|
+
modal.success({
|
|
372
|
+
title: successMessage,
|
|
373
|
+
onOk: async ()=>{
|
|
374
|
+
await resetFormCorrectly(form);
|
|
375
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
376
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
377
|
+
window.location.href = onSuccess.redirectTo;
|
|
378
|
+
} else {
|
|
379
|
+
navigate(onSuccess.redirectTo);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
} else {
|
|
385
|
+
message.success(successMessage);
|
|
386
|
+
await resetFormCorrectly(form);
|
|
387
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
388
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
389
|
+
window.location.href = onSuccess.redirectTo;
|
|
390
|
+
} else {
|
|
391
|
+
navigate(onSuccess.redirectTo);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (!(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.popupClose)) {
|
|
396
|
+
await resetFormCorrectly(form);
|
|
397
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
398
|
+
}
|
|
399
|
+
if (!onSuccess) {
|
|
400
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
401
|
+
}
|
|
402
|
+
} catch (error) {
|
|
403
|
+
actionField.data.loading = false;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
const useAssociationCreateActionProps = ()=>{
|
|
409
|
+
var _actionField_componentProps_filterKeys;
|
|
410
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
411
|
+
const { field, resource, __parent } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
412
|
+
const { setVisible, fieldSchema } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
413
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
414
|
+
const actionField = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
415
|
+
const { message } = __WEBPACK_EXTERNAL_MODULE_antd__.App.useApp();
|
|
416
|
+
const { fields, getField, getTreeParentField, name } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
417
|
+
const compile = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
418
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
419
|
+
const currentRecord = (0,__WEBPACK_EXTERNAL_MODULE__record_provider_index_mjs__.useRecord)();
|
|
420
|
+
const variables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useVariables)();
|
|
421
|
+
const localVariables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useLocalVariables)({
|
|
422
|
+
currentForm: form
|
|
423
|
+
});
|
|
424
|
+
const { getActiveFieldsName } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormActiveFields)() || {};
|
|
425
|
+
const action = actionField.componentProps.saveMode || 'create';
|
|
426
|
+
const filterKeys = ((_actionField_componentProps_filterKeys = actionField.componentProps.filterKeys) === null || _actionField_componentProps_filterKeys === void 0 ? void 0 : _actionField_componentProps_filterKeys.checked) || [];
|
|
427
|
+
return {
|
|
428
|
+
async onClick () {
|
|
429
|
+
var _fieldSchema_xcomponentprops;
|
|
430
|
+
const fieldNames = fields.map((field)=>field.name);
|
|
431
|
+
var _actionSchema_xactionsettings;
|
|
432
|
+
const { assignedValues: originalAssignedValues = {}, onSuccess, overwriteValues, skipValidator, triggerWorkflows } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
433
|
+
const addChild = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) === null || _fieldSchema_xcomponentprops === void 0 ? void 0 : _fieldSchema_xcomponentprops.addChild;
|
|
434
|
+
const assignedValues = {};
|
|
435
|
+
const waitList = Object.keys(originalAssignedValues).map(async (key)=>{
|
|
436
|
+
const value = originalAssignedValues[key];
|
|
437
|
+
const collectionField = getField(key);
|
|
438
|
+
if (false) {}
|
|
439
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__variables_utils_isVariable_mjs__.isVariable)(value)) {
|
|
440
|
+
const result = await (variables === null || variables === void 0 ? void 0 : variables.parseVariable(value, localVariables));
|
|
441
|
+
if (result) {
|
|
442
|
+
assignedValues[key] = (0,__WEBPACK_EXTERNAL_MODULE__variables_utils_transformVariableValue_mjs__.transformVariableValue)(result, {
|
|
443
|
+
targetCollectionField: collectionField
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
} else if (value != null && value !== '') {
|
|
447
|
+
assignedValues[key] = value;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
await Promise.all(waitList);
|
|
451
|
+
if (!skipValidator) {
|
|
452
|
+
await form.submit();
|
|
453
|
+
}
|
|
454
|
+
const values = getFormValues({
|
|
455
|
+
filterByTk,
|
|
456
|
+
field,
|
|
457
|
+
form,
|
|
458
|
+
fieldNames,
|
|
459
|
+
getField,
|
|
460
|
+
resource,
|
|
461
|
+
actionFields: (getActiveFieldsName === null || getActiveFieldsName === void 0 ? void 0 : getActiveFieldsName('form')) || []
|
|
462
|
+
});
|
|
463
|
+
if (addChild) {
|
|
464
|
+
const treeParentField = getTreeParentField();
|
|
465
|
+
var _treeParentField_name;
|
|
466
|
+
values[(_treeParentField_name = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.name) !== null && _treeParentField_name !== void 0 ? _treeParentField_name : 'parent'] = currentRecord;
|
|
467
|
+
var _treeParentField_foreignKey;
|
|
468
|
+
values[(_treeParentField_foreignKey = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.foreignKey) !== null && _treeParentField_foreignKey !== void 0 ? _treeParentField_foreignKey : 'parentId'] = currentRecord.id;
|
|
469
|
+
}
|
|
470
|
+
actionField.data = field.data || {};
|
|
471
|
+
actionField.data.loading = true;
|
|
472
|
+
try {
|
|
473
|
+
var __parent_service_refresh, __parent_service;
|
|
474
|
+
const data = await resource[action]({
|
|
475
|
+
values: {
|
|
476
|
+
...values,
|
|
477
|
+
...overwriteValues,
|
|
478
|
+
...assignedValues
|
|
479
|
+
},
|
|
480
|
+
filterKeys: filterKeys,
|
|
481
|
+
// TODO(refactor): should change to inject by plugin
|
|
482
|
+
triggerWorkflows: (triggerWorkflows === null || triggerWorkflows === void 0 ? void 0 : triggerWorkflows.length) ? triggerWorkflows.map((row)=>[
|
|
483
|
+
row.workflowKey,
|
|
484
|
+
row.context
|
|
485
|
+
].filter(Boolean).join('!')).join(',') : undefined
|
|
486
|
+
});
|
|
487
|
+
actionField.data.loading = false;
|
|
488
|
+
actionField.data.data = data;
|
|
489
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
490
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
491
|
+
if (!(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage)) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
495
|
+
} catch (error) {
|
|
496
|
+
actionField.data.data = null;
|
|
497
|
+
actionField.data.loading = false;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
const findFilterTargets = (fieldSchema)=>{
|
|
503
|
+
while(fieldSchema){
|
|
504
|
+
if (fieldSchema['x-filter-targets']) {
|
|
505
|
+
return {
|
|
506
|
+
targets: fieldSchema['x-filter-targets'],
|
|
507
|
+
uid: fieldSchema['x-uid']
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
fieldSchema = fieldSchema.parent;
|
|
511
|
+
}
|
|
512
|
+
return {};
|
|
513
|
+
};
|
|
514
|
+
const updateFilterTargets = (fieldSchema, targets)=>{
|
|
515
|
+
while(fieldSchema){
|
|
516
|
+
if (fieldSchema['x-filter-targets']) {
|
|
517
|
+
fieldSchema['x-filter-targets'] = targets;
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
fieldSchema = fieldSchema.parent;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
const useFilterBlockActionProps = ()=>{
|
|
524
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
525
|
+
const actionField = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
526
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
527
|
+
const { getDataBlocks } = (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_FilterProvider_mjs__.useFilterBlock)();
|
|
528
|
+
const { name } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
529
|
+
const { getCollectionJoinField } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
530
|
+
actionField.data = actionField.data || {};
|
|
531
|
+
return {
|
|
532
|
+
async onClick () {
|
|
533
|
+
const { targets = [], uid } = findFilterTargets(fieldSchema);
|
|
534
|
+
actionField.data.loading = true;
|
|
535
|
+
try {
|
|
536
|
+
// 收集 filter 的值
|
|
537
|
+
await Promise.all(getDataBlocks().map(async (block)=>{
|
|
538
|
+
var _block_service_params, _block_service_params_, _block_service_params1, _Object_keys;
|
|
539
|
+
const target = targets.find((target)=>target.uid === block.uid);
|
|
540
|
+
if (!target) return;
|
|
541
|
+
const param = ((_block_service_params = block.service.params) === null || _block_service_params === void 0 ? void 0 : _block_service_params[0]) || {};
|
|
542
|
+
for(const key in form.values){
|
|
543
|
+
if (typeof form.values[key] === 'object' && (JSON.stringify(form.values[key]) === '{}' || JSON.stringify(form.values[key]) === '[]') || !form.values[key]) {
|
|
544
|
+
delete form.values[key];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
// 保留原有的 filter
|
|
548
|
+
const storedFilter = ((_block_service_params1 = block.service.params) === null || _block_service_params1 === void 0 ? void 0 : (_block_service_params_ = _block_service_params1[1]) === null || _block_service_params_ === void 0 ? void 0 : _block_service_params_.filters) || {};
|
|
549
|
+
const filter = {
|
|
550
|
+
formValues: {
|
|
551
|
+
...form.values
|
|
552
|
+
},
|
|
553
|
+
customValues: {},
|
|
554
|
+
customFilter: {}
|
|
555
|
+
};
|
|
556
|
+
if ((_Object_keys = Object.keys(filter.formValues)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.includes('__custom')) {
|
|
557
|
+
const values = {
|
|
558
|
+
...form.values
|
|
559
|
+
};
|
|
560
|
+
delete values['__custom'];
|
|
561
|
+
filter.formValues = {
|
|
562
|
+
...values
|
|
563
|
+
};
|
|
564
|
+
for(const key in form.values['__custom']){
|
|
565
|
+
if (form.values['__custom'][key]) {
|
|
566
|
+
filter.customValues[key] = form.values['__custom'][key];
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
filter.customFilter = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.getCustomCondition)(filter.customValues, fieldSchema);
|
|
570
|
+
}
|
|
571
|
+
storedFilter[uid] = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.removeNullCondition)((0,__WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.transformToFilter)(filter.formValues, fieldSchema, getCollectionJoinField, name));
|
|
572
|
+
const mergedFilter = (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.mergeFilter)([
|
|
573
|
+
...Object.values(storedFilter).map((filter)=>(0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.removeNullCondition)(filter)),
|
|
574
|
+
block.defaultFilter,
|
|
575
|
+
filter.customFilter
|
|
576
|
+
]);
|
|
577
|
+
if (block.dataLoadingMode === 'manual' && __WEBPACK_EXTERNAL_MODULE_lodash__["default"].isEmpty(mergedFilter)) {
|
|
578
|
+
return block.clearData();
|
|
579
|
+
}
|
|
580
|
+
return block.doFilter({
|
|
581
|
+
...param,
|
|
582
|
+
page: 1,
|
|
583
|
+
filter: mergedFilter
|
|
584
|
+
}, {
|
|
585
|
+
filters: storedFilter
|
|
586
|
+
});
|
|
587
|
+
}));
|
|
588
|
+
} catch (error) {
|
|
589
|
+
console.error(error);
|
|
590
|
+
}
|
|
591
|
+
actionField.data.loading = false;
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
const useResetBlockActionProps = ()=>{
|
|
596
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
597
|
+
const actionField = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
598
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
599
|
+
const { getDataBlocks } = (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_FilterProvider_mjs__.useFilterBlock)();
|
|
600
|
+
actionField.data = actionField.data || {};
|
|
601
|
+
return {
|
|
602
|
+
async onClick () {
|
|
603
|
+
const { targets, uid } = findFilterTargets(fieldSchema);
|
|
604
|
+
form.reset();
|
|
605
|
+
actionField.data.loading = true;
|
|
606
|
+
try {
|
|
607
|
+
// 收集 filter 的值
|
|
608
|
+
await Promise.all(getDataBlocks().map(async (block)=>{
|
|
609
|
+
var _block_service_params, _block_service_params_, _block_service_params1;
|
|
610
|
+
const target = targets.find((target)=>target.uid === block.uid);
|
|
611
|
+
if (!target) return;
|
|
612
|
+
if (block.dataLoadingMode === 'manual') {
|
|
613
|
+
return block.clearData();
|
|
614
|
+
}
|
|
615
|
+
const param = ((_block_service_params = block.service.params) === null || _block_service_params === void 0 ? void 0 : _block_service_params[0]) || {};
|
|
616
|
+
// 保留原有的 filter
|
|
617
|
+
const storedFilter = ((_block_service_params1 = block.service.params) === null || _block_service_params1 === void 0 ? void 0 : (_block_service_params_ = _block_service_params1[1]) === null || _block_service_params_ === void 0 ? void 0 : _block_service_params_.filters) || {};
|
|
618
|
+
delete storedFilter[uid];
|
|
619
|
+
const mergedFilter = (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.mergeFilter)([
|
|
620
|
+
...Object.values(storedFilter),
|
|
621
|
+
block.defaultFilter
|
|
622
|
+
]);
|
|
623
|
+
return block.doFilter({
|
|
624
|
+
...param,
|
|
625
|
+
page: 1,
|
|
626
|
+
filter: mergedFilter
|
|
627
|
+
}, {
|
|
628
|
+
filters: storedFilter
|
|
629
|
+
});
|
|
630
|
+
}));
|
|
631
|
+
actionField.data.loading = false;
|
|
632
|
+
} catch (error) {
|
|
633
|
+
actionField.data.loading = false;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
const useCustomizeUpdateActionProps = ()=>{
|
|
639
|
+
const { resource, __parent, service } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
640
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
641
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
642
|
+
const navigate = (0,__WEBPACK_EXTERNAL_MODULE_react_router_dom__.useNavigate)();
|
|
643
|
+
const compile = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
644
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
645
|
+
const { modal, message } = __WEBPACK_EXTERNAL_MODULE_antd__.App.useApp();
|
|
646
|
+
const variables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useVariables)();
|
|
647
|
+
const localVariables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useLocalVariables)({
|
|
648
|
+
currentForm: form
|
|
649
|
+
});
|
|
650
|
+
const { name, getField } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
651
|
+
return {
|
|
652
|
+
async onClick () {
|
|
653
|
+
var _service_refresh;
|
|
654
|
+
var _actionSchema_xactionsettings;
|
|
655
|
+
const { assignedValues: originalAssignedValues = {}, onSuccess, skipValidator, triggerWorkflows } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
656
|
+
const assignedValues = {};
|
|
657
|
+
const waitList = Object.keys(originalAssignedValues).map(async (key)=>{
|
|
658
|
+
const value = originalAssignedValues[key];
|
|
659
|
+
const collectionField = getField(key);
|
|
660
|
+
if (false) {}
|
|
661
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__variables_utils_isVariable_mjs__.isVariable)(value)) {
|
|
662
|
+
const result = await (variables === null || variables === void 0 ? void 0 : variables.parseVariable(value, localVariables));
|
|
663
|
+
if (result) {
|
|
664
|
+
assignedValues[key] = (0,__WEBPACK_EXTERNAL_MODULE__variables_utils_transformVariableValue_mjs__.transformVariableValue)(result, {
|
|
665
|
+
targetCollectionField: collectionField
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
} else if (value != null && value !== '') {
|
|
669
|
+
assignedValues[key] = value;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
await Promise.all(waitList);
|
|
673
|
+
if (skipValidator === false) {
|
|
674
|
+
await form.submit();
|
|
675
|
+
}
|
|
676
|
+
await resource.update({
|
|
677
|
+
filterByTk,
|
|
678
|
+
values: {
|
|
679
|
+
...assignedValues
|
|
680
|
+
},
|
|
681
|
+
// TODO(refactor): should change to inject by plugin
|
|
682
|
+
triggerWorkflows: (triggerWorkflows === null || triggerWorkflows === void 0 ? void 0 : triggerWorkflows.length) ? triggerWorkflows.map((row)=>[
|
|
683
|
+
row.workflowKey,
|
|
684
|
+
row.context
|
|
685
|
+
].filter(Boolean).join('!')).join(',') : undefined
|
|
686
|
+
});
|
|
687
|
+
service === null || service === void 0 ? void 0 : (_service_refresh = service.refresh) === null || _service_refresh === void 0 ? void 0 : _service_refresh.call(service);
|
|
688
|
+
if (!(resource instanceof __WEBPACK_EXTERNAL_MODULE__TableFieldProvider_mjs__.TableFieldResource)) {
|
|
689
|
+
var __parent_service_refresh, __parent_service;
|
|
690
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
691
|
+
}
|
|
692
|
+
if (!(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage)) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
696
|
+
modal.success({
|
|
697
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
698
|
+
onOk: async ()=>{
|
|
699
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
700
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
701
|
+
window.location.href = onSuccess.redirectTo;
|
|
702
|
+
} else {
|
|
703
|
+
navigate(onSuccess.redirectTo);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
} else {
|
|
709
|
+
message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
710
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
711
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
712
|
+
window.location.href = onSuccess.redirectTo;
|
|
713
|
+
} else {
|
|
714
|
+
navigate(onSuccess.redirectTo);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
const useCustomizeRequestActionProps = ()=>{
|
|
722
|
+
var _currentUserContext_data;
|
|
723
|
+
const apiClient = (0,__WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useAPIClient)();
|
|
724
|
+
const navigate = (0,__WEBPACK_EXTERNAL_MODULE_react_router_dom__.useNavigate)();
|
|
725
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
726
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
727
|
+
const compile = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
728
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
729
|
+
const { fields, getField } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
730
|
+
const { field, resource, __parent, service } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
731
|
+
const currentRecord = (0,__WEBPACK_EXTERNAL_MODULE__record_provider_index_mjs__.useRecord)();
|
|
732
|
+
const currentUserContext = (0,__WEBPACK_EXTERNAL_MODULE__user_index_mjs__.useCurrentUserContext)();
|
|
733
|
+
const currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext_data = currentUserContext.data) === null || _currentUserContext_data === void 0 ? void 0 : _currentUserContext_data.data;
|
|
734
|
+
const actionField = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
735
|
+
const { setVisible } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
736
|
+
const { modal, message } = __WEBPACK_EXTERNAL_MODULE_antd__.App.useApp();
|
|
737
|
+
const { getActiveFieldsName } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormActiveFields)() || {};
|
|
738
|
+
return {
|
|
739
|
+
async onClick () {
|
|
740
|
+
var _actionSchema_xactionsettings;
|
|
741
|
+
const { skipValidator, onSuccess, requestSettings } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
742
|
+
const xAction = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action'];
|
|
743
|
+
if (!requestSettings['url']) {
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
if (skipValidator !== true && xAction === 'customize:form:request') {
|
|
747
|
+
await form.submit();
|
|
748
|
+
}
|
|
749
|
+
const headers = requestSettings['headers'] ? JSON.parse(requestSettings['headers']) : {};
|
|
750
|
+
const params = requestSettings['params'] ? JSON.parse(requestSettings['params']) : {};
|
|
751
|
+
const data = requestSettings['data'] ? JSON.parse(requestSettings['data']) : {};
|
|
752
|
+
const methods = [
|
|
753
|
+
'POST',
|
|
754
|
+
'PUT',
|
|
755
|
+
'PATCH'
|
|
756
|
+
];
|
|
757
|
+
if (xAction === 'customize:form:request' && methods.includes(requestSettings['method'])) {
|
|
758
|
+
const fieldNames = fields.map((field)=>field.name);
|
|
759
|
+
const values = getFormValues({
|
|
760
|
+
filterByTk,
|
|
761
|
+
field,
|
|
762
|
+
form,
|
|
763
|
+
fieldNames,
|
|
764
|
+
getField,
|
|
765
|
+
resource,
|
|
766
|
+
actionFields: (getActiveFieldsName === null || getActiveFieldsName === void 0 ? void 0 : getActiveFieldsName('form')) || []
|
|
767
|
+
});
|
|
768
|
+
Object.assign(data, values);
|
|
769
|
+
}
|
|
770
|
+
const requestBody = {
|
|
771
|
+
url: renderTemplate(requestSettings['url'], {
|
|
772
|
+
currentRecord,
|
|
773
|
+
currentUser
|
|
774
|
+
}),
|
|
775
|
+
method: requestSettings['method'],
|
|
776
|
+
headers: (0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.parse)(headers)({
|
|
777
|
+
currentRecord,
|
|
778
|
+
currentUser
|
|
779
|
+
}),
|
|
780
|
+
params: (0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.parse)(params)({
|
|
781
|
+
currentRecord,
|
|
782
|
+
currentUser
|
|
783
|
+
}),
|
|
784
|
+
data: (0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.parse)(data)({
|
|
785
|
+
currentRecord,
|
|
786
|
+
currentUser
|
|
787
|
+
})
|
|
788
|
+
};
|
|
789
|
+
actionField.data = field.data || {};
|
|
790
|
+
actionField.data.loading = true;
|
|
791
|
+
try {
|
|
792
|
+
var _service_refresh;
|
|
793
|
+
await apiClient.request({
|
|
794
|
+
...requestBody
|
|
795
|
+
});
|
|
796
|
+
actionField.data.loading = false;
|
|
797
|
+
if (!(resource instanceof __WEBPACK_EXTERNAL_MODULE__TableFieldProvider_mjs__.TableFieldResource)) {
|
|
798
|
+
var __parent_service_refresh, __parent_service;
|
|
799
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
800
|
+
}
|
|
801
|
+
service === null || service === void 0 ? void 0 : (_service_refresh = service.refresh) === null || _service_refresh === void 0 ? void 0 : _service_refresh.call(service);
|
|
802
|
+
if (xAction === 'customize:form:request') {
|
|
803
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
804
|
+
}
|
|
805
|
+
if (!(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage)) {
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
809
|
+
modal.success({
|
|
810
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
811
|
+
onOk: async ()=>{
|
|
812
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
813
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
814
|
+
window.location.href = onSuccess.redirectTo;
|
|
815
|
+
} else {
|
|
816
|
+
navigate(onSuccess.redirectTo);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
} else {
|
|
822
|
+
message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
823
|
+
}
|
|
824
|
+
} finally{
|
|
825
|
+
actionField.data.loading = false;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
const useUpdateActionProps = ()=>{
|
|
831
|
+
const form = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
|
|
832
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
833
|
+
const { field, resource, __parent } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
834
|
+
const { setVisible } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
835
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
836
|
+
const navigate = (0,__WEBPACK_EXTERNAL_MODULE_react_router_dom__.useNavigate)();
|
|
837
|
+
const { fields, getField, name } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
838
|
+
const compile = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
839
|
+
const actionField = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
840
|
+
const { updateAssociationValues } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormBlockContext)();
|
|
841
|
+
const { modal, message } = __WEBPACK_EXTERNAL_MODULE_antd__.App.useApp();
|
|
842
|
+
const data = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useParamsFromRecord)();
|
|
843
|
+
const variables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useVariables)();
|
|
844
|
+
const localVariables = (0,__WEBPACK_EXTERNAL_MODULE__variables_index_mjs__.useLocalVariables)({
|
|
845
|
+
currentForm: form
|
|
846
|
+
});
|
|
847
|
+
const { getActiveFieldsName } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormActiveFields)() || {};
|
|
848
|
+
return {
|
|
849
|
+
async onClick () {
|
|
850
|
+
var _actionSchema_xactionsettings;
|
|
851
|
+
const { assignedValues: originalAssignedValues = {}, onSuccess, overwriteValues, skipValidator, triggerWorkflows, isDeltaChanged } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
852
|
+
const assignedValues = {};
|
|
853
|
+
const waitList = Object.keys(originalAssignedValues).map(async (key)=>{
|
|
854
|
+
const value = originalAssignedValues[key];
|
|
855
|
+
const collectionField = getField(key);
|
|
856
|
+
if (false) {}
|
|
857
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__variables_utils_isVariable_mjs__.isVariable)(value)) {
|
|
858
|
+
const result = await (variables === null || variables === void 0 ? void 0 : variables.parseVariable(value, localVariables));
|
|
859
|
+
if (result) {
|
|
860
|
+
assignedValues[key] = (0,__WEBPACK_EXTERNAL_MODULE__variables_utils_transformVariableValue_mjs__.transformVariableValue)(result, {
|
|
861
|
+
targetCollectionField: collectionField
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
} else if (value != null && value !== '') {
|
|
865
|
+
assignedValues[key] = value;
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
await Promise.all(waitList);
|
|
869
|
+
if (!skipValidator) {
|
|
870
|
+
await form.submit();
|
|
871
|
+
}
|
|
872
|
+
const fieldNames = fields.map((field)=>field.name);
|
|
873
|
+
const actionFields = (getActiveFieldsName === null || getActiveFieldsName === void 0 ? void 0 : getActiveFieldsName('form')) || [];
|
|
874
|
+
const values = getFormValues({
|
|
875
|
+
filterByTk,
|
|
876
|
+
field,
|
|
877
|
+
form,
|
|
878
|
+
fieldNames,
|
|
879
|
+
getField,
|
|
880
|
+
resource,
|
|
881
|
+
actionFields
|
|
882
|
+
});
|
|
883
|
+
actionField.data = field.data || {};
|
|
884
|
+
actionField.data.loading = true;
|
|
885
|
+
const rawValues = {
|
|
886
|
+
...values,
|
|
887
|
+
...overwriteValues,
|
|
888
|
+
...assignedValues
|
|
889
|
+
};
|
|
890
|
+
const filterValues = (srcValues)=>Object.entries(srcValues).reduce((obj, keyValuePair)=>{
|
|
891
|
+
const [key, value] = keyValuePair;
|
|
892
|
+
if (actionFields.includes(key)) {
|
|
893
|
+
obj = {
|
|
894
|
+
...obj,
|
|
895
|
+
[key]: value
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
return obj;
|
|
899
|
+
}, {});
|
|
900
|
+
try {
|
|
901
|
+
var __parent_service_refresh, __parent_service;
|
|
902
|
+
await resource.update({
|
|
903
|
+
filterByTk,
|
|
904
|
+
values: isDeltaChanged ? filterValues(rawValues) : rawValues,
|
|
905
|
+
...data,
|
|
906
|
+
updateAssociationValues,
|
|
907
|
+
// TODO(refactor): should change to inject by plugin
|
|
908
|
+
triggerWorkflows: (triggerWorkflows === null || triggerWorkflows === void 0 ? void 0 : triggerWorkflows.length) ? triggerWorkflows.map((row)=>[
|
|
909
|
+
row.workflowKey,
|
|
910
|
+
row.context
|
|
911
|
+
].filter(Boolean).join('!')).join(',') : undefined
|
|
912
|
+
});
|
|
913
|
+
actionField.data.loading = false;
|
|
914
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
915
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
916
|
+
if (!(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage)) {
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
920
|
+
modal.success({
|
|
921
|
+
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
922
|
+
onOk: async ()=>{
|
|
923
|
+
await form.reset();
|
|
924
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
925
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
926
|
+
window.location.href = onSuccess.redirectTo;
|
|
927
|
+
} else {
|
|
928
|
+
navigate(onSuccess.redirectTo);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
} else {
|
|
934
|
+
message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
935
|
+
if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
|
|
936
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.isURL)(onSuccess.redirectTo)) {
|
|
937
|
+
window.location.href = onSuccess.redirectTo;
|
|
938
|
+
} else {
|
|
939
|
+
navigate(onSuccess.redirectTo);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
} catch (error) {
|
|
944
|
+
actionField.data.loading = false;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
const useDestroyActionProps = ()=>{
|
|
950
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
951
|
+
const { resource, service, block, __parent } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
952
|
+
const { setVisible } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
953
|
+
const data = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useParamsFromRecord)();
|
|
954
|
+
const actionSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
955
|
+
return {
|
|
956
|
+
async onClick () {
|
|
957
|
+
var _service_data;
|
|
958
|
+
var _actionSchema_xactionsettings;
|
|
959
|
+
const { triggerWorkflows } = (_actionSchema_xactionsettings = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema_xactionsettings !== void 0 ? _actionSchema_xactionsettings : {};
|
|
960
|
+
await resource.destroy({
|
|
961
|
+
filterByTk,
|
|
962
|
+
// TODO(refactor): should change to inject by plugin
|
|
963
|
+
triggerWorkflows: (triggerWorkflows === null || triggerWorkflows === void 0 ? void 0 : triggerWorkflows.length) ? triggerWorkflows.map((row)=>[
|
|
964
|
+
row.workflowKey,
|
|
965
|
+
row.context
|
|
966
|
+
].filter(Boolean).join('!')).join(',') : undefined,
|
|
967
|
+
...data
|
|
968
|
+
});
|
|
969
|
+
const { count = 0, page = 0, pageSize = 0 } = (service === null || service === void 0 ? void 0 : (_service_data = service.data) === null || _service_data === void 0 ? void 0 : _service_data.meta) || {};
|
|
970
|
+
if (count % pageSize === 1 && page !== 1) {
|
|
971
|
+
var _service_params;
|
|
972
|
+
service.run({
|
|
973
|
+
...service === null || service === void 0 ? void 0 : (_service_params = service.params) === null || _service_params === void 0 ? void 0 : _service_params[0],
|
|
974
|
+
page: page - 1
|
|
975
|
+
});
|
|
976
|
+
} else {
|
|
977
|
+
var _service_refresh;
|
|
978
|
+
service === null || service === void 0 ? void 0 : (_service_refresh = service.refresh) === null || _service_refresh === void 0 ? void 0 : _service_refresh.call(service);
|
|
979
|
+
}
|
|
980
|
+
if (block && block !== 'TableField') {
|
|
981
|
+
var __parent_service_refresh, __parent_service;
|
|
982
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
983
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
const useRemoveActionProps = (associationName)=>{
|
|
989
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
990
|
+
const api = (0,__WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useAPIClient)();
|
|
991
|
+
const resource = api.resource(associationName, filterByTk);
|
|
992
|
+
return {
|
|
993
|
+
async onClick (value) {
|
|
994
|
+
await resource.remove({
|
|
995
|
+
values: [
|
|
996
|
+
value.id
|
|
997
|
+
]
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
const useDisassociateActionProps = ()=>{
|
|
1003
|
+
const filterByTk = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useFilterByTk)();
|
|
1004
|
+
const { resource, service, block, __parent } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
1005
|
+
const { setVisible } = (0,__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useActionContext)();
|
|
1006
|
+
return {
|
|
1007
|
+
async onClick () {
|
|
1008
|
+
var _service_data;
|
|
1009
|
+
await resource.remove({
|
|
1010
|
+
values: [
|
|
1011
|
+
filterByTk
|
|
1012
|
+
]
|
|
1013
|
+
});
|
|
1014
|
+
const { count = 0, page = 0, pageSize = 0 } = (service === null || service === void 0 ? void 0 : (_service_data = service.data) === null || _service_data === void 0 ? void 0 : _service_data.meta) || {};
|
|
1015
|
+
if (count % pageSize === 1 && page !== 1) {
|
|
1016
|
+
var _service_params;
|
|
1017
|
+
service.run({
|
|
1018
|
+
...service === null || service === void 0 ? void 0 : (_service_params = service.params) === null || _service_params === void 0 ? void 0 : _service_params[0],
|
|
1019
|
+
page: page - 1
|
|
1020
|
+
});
|
|
1021
|
+
} else {
|
|
1022
|
+
var _service_refresh;
|
|
1023
|
+
service === null || service === void 0 ? void 0 : (_service_refresh = service.refresh) === null || _service_refresh === void 0 ? void 0 : _service_refresh.call(service);
|
|
1024
|
+
}
|
|
1025
|
+
if (block && block !== 'TableField') {
|
|
1026
|
+
var __parent_service_refresh, __parent_service;
|
|
1027
|
+
__parent === null || __parent === void 0 ? void 0 : (__parent_service = __parent.service) === null || __parent_service === void 0 ? void 0 : (__parent_service_refresh = __parent_service.refresh) === null || __parent_service_refresh === void 0 ? void 0 : __parent_service_refresh.call(__parent_service);
|
|
1028
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
const useDetailPrintActionProps = ()=>{
|
|
1034
|
+
const { formBlockRef } = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormBlockContext)();
|
|
1035
|
+
const printHandler = (0,__WEBPACK_EXTERNAL_MODULE_react_to_print__.useReactToPrint)({
|
|
1036
|
+
content: ()=>formBlockRef.current,
|
|
1037
|
+
pageStyle: "@media print {\n * {\n margin: 0;\n }\n :not(.ant-formily-item-control-content-component) > div.ant-formily-layout>div:first-child {\n overflow: hidden; height: 0;\n }\n }"
|
|
1038
|
+
});
|
|
1039
|
+
return {
|
|
1040
|
+
async onClick () {
|
|
1041
|
+
printHandler();
|
|
1042
|
+
}
|
|
1043
|
+
};
|
|
1044
|
+
};
|
|
1045
|
+
const useBulkDestroyActionProps = ()=>{
|
|
1046
|
+
const { field } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
1047
|
+
const { resource, service } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
1048
|
+
return {
|
|
1049
|
+
async onClick () {
|
|
1050
|
+
var _field_data_selectedRowKeys, _field_data, _field_data1, _service_params_, _service_data_meta, _service_data, _service_refresh;
|
|
1051
|
+
if (!(field === null || field === void 0 ? void 0 : (_field_data = field.data) === null || _field_data === void 0 ? void 0 : (_field_data_selectedRowKeys = _field_data.selectedRowKeys) === null || _field_data_selectedRowKeys === void 0 ? void 0 : _field_data_selectedRowKeys.length)) {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
await resource.destroy({
|
|
1055
|
+
filterByTk: (_field_data1 = field.data) === null || _field_data1 === void 0 ? void 0 : _field_data1.selectedRowKeys
|
|
1056
|
+
});
|
|
1057
|
+
field.data.selectedRowKeys = [];
|
|
1058
|
+
const currentPage = (_service_params_ = service.params[0]) === null || _service_params_ === void 0 ? void 0 : _service_params_.page;
|
|
1059
|
+
const totalPage = (_service_data = service.data) === null || _service_data === void 0 ? void 0 : (_service_data_meta = _service_data.meta) === null || _service_data_meta === void 0 ? void 0 : _service_data_meta.totalPage;
|
|
1060
|
+
if (currentPage === totalPage) {
|
|
1061
|
+
service.params[0].page = currentPage - 1;
|
|
1062
|
+
}
|
|
1063
|
+
service === null || service === void 0 ? void 0 : (_service_refresh = service.refresh) === null || _service_refresh === void 0 ? void 0 : _service_refresh.call(service);
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
const useRefreshActionProps = ()=>{
|
|
1068
|
+
const { service } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
1069
|
+
return {
|
|
1070
|
+
async onClick () {
|
|
1071
|
+
var _service_refresh;
|
|
1072
|
+
service === null || service === void 0 ? void 0 : (_service_refresh = service.refresh) === null || _service_refresh === void 0 ? void 0 : _service_refresh.call(service);
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
};
|
|
1076
|
+
const useDetailsPaginationProps = ()=>{
|
|
1077
|
+
var _ctx_service_data_meta, _ctx_service_data, _ctx_service, _ctx_service_data_meta1, _ctx_service_data1, _ctx_service1;
|
|
1078
|
+
const ctx = (0,__WEBPACK_EXTERNAL_MODULE__DetailsBlockProvider_mjs__.useDetailsBlockContext)();
|
|
1079
|
+
const count = ((_ctx_service = ctx.service) === null || _ctx_service === void 0 ? void 0 : (_ctx_service_data = _ctx_service.data) === null || _ctx_service_data === void 0 ? void 0 : (_ctx_service_data_meta = _ctx_service_data.meta) === null || _ctx_service_data_meta === void 0 ? void 0 : _ctx_service_data_meta.count) || 0;
|
|
1080
|
+
return {
|
|
1081
|
+
simple: true,
|
|
1082
|
+
hidden: count <= 1,
|
|
1083
|
+
current: ((_ctx_service1 = ctx.service) === null || _ctx_service1 === void 0 ? void 0 : (_ctx_service_data1 = _ctx_service1.data) === null || _ctx_service_data1 === void 0 ? void 0 : (_ctx_service_data_meta1 = _ctx_service_data1.meta) === null || _ctx_service_data_meta1 === void 0 ? void 0 : _ctx_service_data_meta1.page) || 1,
|
|
1084
|
+
total: count,
|
|
1085
|
+
pageSize: 1,
|
|
1086
|
+
showSizeChanger: false,
|
|
1087
|
+
async onChange (page) {
|
|
1088
|
+
var _ctx_service_params, _ctx_service;
|
|
1089
|
+
const params = (_ctx_service = ctx.service) === null || _ctx_service === void 0 ? void 0 : (_ctx_service_params = _ctx_service.params) === null || _ctx_service_params === void 0 ? void 0 : _ctx_service_params[0];
|
|
1090
|
+
ctx.service.run({
|
|
1091
|
+
...params,
|
|
1092
|
+
page
|
|
1093
|
+
});
|
|
1094
|
+
},
|
|
1095
|
+
style: {
|
|
1096
|
+
marginTop: 24,
|
|
1097
|
+
textAlign: 'center'
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
};
|
|
1101
|
+
const useAssociationFilterProps = ()=>{
|
|
1102
|
+
var _cm_getCollection, _fieldSchema_xcomponentprops_fieldNames, _fieldSchema_xcomponentprops, _field_componentProps, _field_componentProps1;
|
|
1103
|
+
const collectionField = __WEBPACK_EXTERNAL_MODULE__index_mjs__.AssociationFilter.useAssociationField();
|
|
1104
|
+
const { service, props: blockProps } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
1105
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
1106
|
+
const cm = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
1107
|
+
const valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? (_cm_getCollection = cm.getCollection(collectionField.target)) === null || _cm_getCollection === void 0 ? void 0 : _cm_getCollection.getPrimaryKey() : 'id';
|
|
1108
|
+
const labelKey = ((_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) === null || _fieldSchema_xcomponentprops === void 0 ? void 0 : (_fieldSchema_xcomponentprops_fieldNames = _fieldSchema_xcomponentprops.fieldNames) === null || _fieldSchema_xcomponentprops_fieldNames === void 0 ? void 0 : _fieldSchema_xcomponentprops_fieldNames.label) || valueKey;
|
|
1109
|
+
const field = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
1110
|
+
const collectionFieldName = collectionField.name;
|
|
1111
|
+
const headers = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useDataSourceHeaders)(blockProps === null || blockProps === void 0 ? void 0 : blockProps.dataSource);
|
|
1112
|
+
const { data, params, run } = (0,__WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useRequest)({
|
|
1113
|
+
headers,
|
|
1114
|
+
resource: collectionField.target,
|
|
1115
|
+
action: 'list',
|
|
1116
|
+
params: {
|
|
1117
|
+
fields: [
|
|
1118
|
+
labelKey,
|
|
1119
|
+
valueKey
|
|
1120
|
+
],
|
|
1121
|
+
pageSize: 200,
|
|
1122
|
+
page: 1,
|
|
1123
|
+
...(_field_componentProps = field.componentProps) === null || _field_componentProps === void 0 ? void 0 : _field_componentProps.params
|
|
1124
|
+
}
|
|
1125
|
+
}, {
|
|
1126
|
+
refreshDeps: [
|
|
1127
|
+
labelKey,
|
|
1128
|
+
valueKey,
|
|
1129
|
+
JSON.stringify(((_field_componentProps1 = field.componentProps) === null || _field_componentProps1 === void 0 ? void 0 : _field_componentProps1.params) || {})
|
|
1130
|
+
],
|
|
1131
|
+
debounceWait: 300
|
|
1132
|
+
});
|
|
1133
|
+
const list = (data === null || data === void 0 ? void 0 : data.data) || [];
|
|
1134
|
+
const onSelected = (value)=>{
|
|
1135
|
+
var _service_params_, _service_params, _service_params1, _blockProps_params;
|
|
1136
|
+
const filters = ((_service_params = service.params) === null || _service_params === void 0 ? void 0 : (_service_params_ = _service_params[1]) === null || _service_params_ === void 0 ? void 0 : _service_params_.filters) || {};
|
|
1137
|
+
if (value.length) {
|
|
1138
|
+
filters["af.".concat(collectionFieldName)] = {
|
|
1139
|
+
["".concat(collectionFieldName, ".").concat(valueKey, ".$in")]: value
|
|
1140
|
+
};
|
|
1141
|
+
} else {
|
|
1142
|
+
delete filters["af.".concat(collectionFieldName)];
|
|
1143
|
+
}
|
|
1144
|
+
service.run({
|
|
1145
|
+
...(_service_params1 = service.params) === null || _service_params1 === void 0 ? void 0 : _service_params1[0],
|
|
1146
|
+
pageSize: 200,
|
|
1147
|
+
page: 1,
|
|
1148
|
+
filter: (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.mergeFilter)([
|
|
1149
|
+
...Object.values(filters),
|
|
1150
|
+
blockProps === null || blockProps === void 0 ? void 0 : (_blockProps_params = blockProps.params) === null || _blockProps_params === void 0 ? void 0 : _blockProps_params.filter
|
|
1151
|
+
])
|
|
1152
|
+
}, {
|
|
1153
|
+
filters
|
|
1154
|
+
});
|
|
1155
|
+
};
|
|
1156
|
+
const handleSearchInput = (e)=>{
|
|
1157
|
+
run({
|
|
1158
|
+
...params === null || params === void 0 ? void 0 : params[0],
|
|
1159
|
+
filter: {
|
|
1160
|
+
["".concat(labelKey, ".$includes")]: e.target.value
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
};
|
|
1164
|
+
return {
|
|
1165
|
+
/** 渲染 Collapse 的列表数据 */ list,
|
|
1166
|
+
onSelected,
|
|
1167
|
+
handleSearchInput,
|
|
1168
|
+
params,
|
|
1169
|
+
run
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
const useOptionalFieldList = ()=>{
|
|
1173
|
+
const { currentFields = [] } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
1174
|
+
return currentFields.filter((field)=>isOptionalField(field) && field.uiSchema.enum);
|
|
1175
|
+
};
|
|
1176
|
+
const isOptionalField = (field)=>{
|
|
1177
|
+
const optionalInterfaces = [
|
|
1178
|
+
'select',
|
|
1179
|
+
'multipleSelect',
|
|
1180
|
+
'checkbox',
|
|
1181
|
+
'checkboxGroup',
|
|
1182
|
+
'chinaRegion'
|
|
1183
|
+
];
|
|
1184
|
+
return optionalInterfaces.includes(field.interface);
|
|
1185
|
+
};
|
|
1186
|
+
const useAssociationFilterBlockProps = ()=>{
|
|
1187
|
+
var _cm_getCollection, _fieldSchema_xcomponentprops_fieldNames, _fieldSchema_xcomponentprops, _field_componentProps, _field_componentProps1;
|
|
1188
|
+
const collectionField = __WEBPACK_EXTERNAL_MODULE__index_mjs__.AssociationFilter.useAssociationField();
|
|
1189
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
1190
|
+
const optionalFieldList = useOptionalFieldList();
|
|
1191
|
+
const { getDataBlocks } = (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_FilterProvider_mjs__.useFilterBlock)();
|
|
1192
|
+
const collectionFieldName = collectionField === null || collectionField === void 0 ? void 0 : collectionField.name;
|
|
1193
|
+
const field = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
1194
|
+
const { props: blockProps } = (0,__WEBPACK_EXTERNAL_MODULE__BlockProvider_mjs__.useBlockRequestContext)();
|
|
1195
|
+
const headers = (0,__WEBPACK_EXTERNAL_MODULE__index_mjs__.useDataSourceHeaders)(blockProps === null || blockProps === void 0 ? void 0 : blockProps.dataSource);
|
|
1196
|
+
const cm = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
1197
|
+
let list, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
|
|
1198
|
+
valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? (_cm_getCollection = cm.getCollection(collectionField.target)) === null || _cm_getCollection === void 0 ? void 0 : _cm_getCollection.getPrimaryKey() : 'id';
|
|
1199
|
+
labelKey = ((_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) === null || _fieldSchema_xcomponentprops === void 0 ? void 0 : (_fieldSchema_xcomponentprops_fieldNames = _fieldSchema_xcomponentprops.fieldNames) === null || _fieldSchema_xcomponentprops_fieldNames === void 0 ? void 0 : _fieldSchema_xcomponentprops_fieldNames.label) || valueKey;
|
|
1200
|
+
// eslint-disable-next-line prefer-const
|
|
1201
|
+
({ data, params, run } = (0,__WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useRequest)({
|
|
1202
|
+
headers,
|
|
1203
|
+
resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
|
|
1204
|
+
action: 'list',
|
|
1205
|
+
params: {
|
|
1206
|
+
fields: [
|
|
1207
|
+
labelKey,
|
|
1208
|
+
valueKey
|
|
1209
|
+
],
|
|
1210
|
+
pageSize: 200,
|
|
1211
|
+
page: 1,
|
|
1212
|
+
...(_field_componentProps = field.componentProps) === null || _field_componentProps === void 0 ? void 0 : _field_componentProps.params
|
|
1213
|
+
}
|
|
1214
|
+
}, {
|
|
1215
|
+
// 由于 选项字段不需要触发当前请求,所以当前请求更改为手动触发
|
|
1216
|
+
manual: true,
|
|
1217
|
+
debounceWait: 300
|
|
1218
|
+
}));
|
|
1219
|
+
(0,__WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
1220
|
+
// 由于 选项字段不需要触发当前请求,所以请求单独在 关系字段的时候触发
|
|
1221
|
+
if (!isOptionalField(fieldSchema)) {
|
|
1222
|
+
run();
|
|
1223
|
+
}
|
|
1224
|
+
}, [
|
|
1225
|
+
labelKey,
|
|
1226
|
+
valueKey,
|
|
1227
|
+
JSON.stringify(((_field_componentProps1 = field.componentProps) === null || _field_componentProps1 === void 0 ? void 0 : _field_componentProps1.params) || {}),
|
|
1228
|
+
isOptionalField(fieldSchema)
|
|
1229
|
+
]);
|
|
1230
|
+
if (!collectionField) {
|
|
1231
|
+
return {};
|
|
1232
|
+
}
|
|
1233
|
+
if (isOptionalField(fieldSchema)) {
|
|
1234
|
+
var _field_uiSchema;
|
|
1235
|
+
const field = optionalFieldList.find((field)=>field.name === fieldSchema.name);
|
|
1236
|
+
const operatorMap = {
|
|
1237
|
+
select: '$in',
|
|
1238
|
+
multipleSelect: '$anyOf',
|
|
1239
|
+
checkbox: '$in',
|
|
1240
|
+
checkboxGroup: '$anyOf'
|
|
1241
|
+
};
|
|
1242
|
+
const _list = (field === null || field === void 0 ? void 0 : (_field_uiSchema = field.uiSchema) === null || _field_uiSchema === void 0 ? void 0 : _field_uiSchema.enum) || [];
|
|
1243
|
+
valueKey = 'value';
|
|
1244
|
+
labelKey = 'label';
|
|
1245
|
+
list = _list;
|
|
1246
|
+
params = {};
|
|
1247
|
+
run = ()=>{};
|
|
1248
|
+
filterKey = "".concat(field.name, ".").concat(operatorMap[field.interface]);
|
|
1249
|
+
handleSearchInput = (e)=>{
|
|
1250
|
+
// TODO: 列表没有刷新,在这个 hook 中使用 useState 会产生 re-render 次数过多的错误
|
|
1251
|
+
const value = e.target.value;
|
|
1252
|
+
if (!value) {
|
|
1253
|
+
list = _list;
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
list = _list.filter((item)=>item.label.includes(value));
|
|
1257
|
+
};
|
|
1258
|
+
} else {
|
|
1259
|
+
filterKey = "".concat(collectionFieldName, ".").concat(valueKey, ".$in");
|
|
1260
|
+
list = (data === null || data === void 0 ? void 0 : data.data) || [];
|
|
1261
|
+
handleSearchInput = (e)=>{
|
|
1262
|
+
run({
|
|
1263
|
+
...params === null || params === void 0 ? void 0 : params[0],
|
|
1264
|
+
filter: {
|
|
1265
|
+
["".concat(labelKey, ".$includes")]: e.target.value
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
const onSelected = (value)=>{
|
|
1271
|
+
const { targets, uid } = findFilterTargets(fieldSchema);
|
|
1272
|
+
getDataBlocks().forEach((block)=>{
|
|
1273
|
+
var _block_service_params, _block_service_params_, _block_service_params1;
|
|
1274
|
+
const target = targets.find((target)=>target.uid === block.uid);
|
|
1275
|
+
if (!target) return;
|
|
1276
|
+
const key = "".concat(uid).concat(fieldSchema.name);
|
|
1277
|
+
const param = ((_block_service_params = block.service.params) === null || _block_service_params === void 0 ? void 0 : _block_service_params[0]) || {};
|
|
1278
|
+
// 保留原有的 filter
|
|
1279
|
+
const storedFilter = ((_block_service_params1 = block.service.params) === null || _block_service_params1 === void 0 ? void 0 : (_block_service_params_ = _block_service_params1[1]) === null || _block_service_params_ === void 0 ? void 0 : _block_service_params_.filters) || {};
|
|
1280
|
+
if (value.length) {
|
|
1281
|
+
storedFilter[key] = {
|
|
1282
|
+
[filterKey]: value
|
|
1283
|
+
};
|
|
1284
|
+
} else {
|
|
1285
|
+
if (block.dataLoadingMode === 'manual') {
|
|
1286
|
+
return block.clearData();
|
|
1287
|
+
}
|
|
1288
|
+
delete storedFilter[key];
|
|
1289
|
+
}
|
|
1290
|
+
const mergedFilter = (0,__WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.mergeFilter)([
|
|
1291
|
+
...Object.values(storedFilter),
|
|
1292
|
+
block.defaultFilter
|
|
1293
|
+
]);
|
|
1294
|
+
return block.doFilter({
|
|
1295
|
+
...param,
|
|
1296
|
+
page: 1,
|
|
1297
|
+
filter: mergedFilter
|
|
1298
|
+
}, {
|
|
1299
|
+
filters: storedFilter
|
|
1300
|
+
});
|
|
1301
|
+
});
|
|
1302
|
+
};
|
|
1303
|
+
return {
|
|
1304
|
+
/** 渲染 Collapse 的列表数据 */ list,
|
|
1305
|
+
onSelected,
|
|
1306
|
+
handleSearchInput,
|
|
1307
|
+
params,
|
|
1308
|
+
run,
|
|
1309
|
+
valueKey,
|
|
1310
|
+
labelKey
|
|
1311
|
+
};
|
|
1312
|
+
};
|
|
1313
|
+
function getAssociationPath(str) {
|
|
1314
|
+
const lastIndex = str.lastIndexOf('.');
|
|
1315
|
+
if (lastIndex !== -1) {
|
|
1316
|
+
return str.substring(0, lastIndex);
|
|
1317
|
+
}
|
|
1318
|
+
return str;
|
|
1319
|
+
}
|
|
1320
|
+
const useAssociationNames = (dataSource)=>{
|
|
1321
|
+
let updateAssociationValues = new Set([]);
|
|
1322
|
+
let appends = new Set([]);
|
|
1323
|
+
const { getCollectionJoinField, getCollection } = (0,__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)(dataSource);
|
|
1324
|
+
const fieldSchema = (0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
1325
|
+
const _getAssociationAppends = (schema, str)=>{
|
|
1326
|
+
schema.reduceProperties((pre, s)=>{
|
|
1327
|
+
var _s_xcomponentprops, _s_xcomponentprops1, _getCollection;
|
|
1328
|
+
const prefix = pre || str;
|
|
1329
|
+
const collectionField = s['x-collection-field'] && getCollectionJoinField(s['x-collection-field'], dataSource);
|
|
1330
|
+
const isAssociationSubfield = s.name.includes('.');
|
|
1331
|
+
const isAssociationField = collectionField && [
|
|
1332
|
+
'hasOne',
|
|
1333
|
+
'hasMany',
|
|
1334
|
+
'belongsTo',
|
|
1335
|
+
'belongsToMany'
|
|
1336
|
+
].includes(collectionField.type);
|
|
1337
|
+
// 从属性中取 appends
|
|
1338
|
+
if ((_s_xcomponentprops = s['x-component-props']) === null || _s_xcomponentprops === void 0 ? void 0 : _s_xcomponentprops['appends']) {
|
|
1339
|
+
var _s_xcomponentprops2;
|
|
1340
|
+
__WEBPACK_EXTERNAL_MODULE_lodash__["default"].forEach((_s_xcomponentprops2 = s['x-component-props']) === null || _s_xcomponentprops2 === void 0 ? void 0 : _s_xcomponentprops2['appends'], (append)=>{
|
|
1341
|
+
appends.add(append);
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
// 根据联动规则中条件的字段获取一些 appends
|
|
1345
|
+
if (s['x-linkage-rules']) {
|
|
1346
|
+
const collectAppends = (obj)=>{
|
|
1347
|
+
const type = Object.keys(obj)[0] || '$and';
|
|
1348
|
+
const list = obj[type];
|
|
1349
|
+
list.forEach((item)=>{
|
|
1350
|
+
if ('$and' in item || '$or' in item) {
|
|
1351
|
+
return collectAppends(item);
|
|
1352
|
+
}
|
|
1353
|
+
const fieldNames = getTargetField(item);
|
|
1354
|
+
// 只应该收集关系字段,只有大于 1 的时候才是关系字段
|
|
1355
|
+
if (fieldNames.length > 1) {
|
|
1356
|
+
appends.add(fieldNames.join('.'));
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
};
|
|
1360
|
+
const rules = s['x-linkage-rules'];
|
|
1361
|
+
rules.forEach((param)=>{
|
|
1362
|
+
let { condition } = param;
|
|
1363
|
+
collectAppends(condition);
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
// 处理多对一标题字段
|
|
1367
|
+
if ((_s_xcomponentprops1 = s['x-component-props']) === null || _s_xcomponentprops1 === void 0 ? void 0 : _s_xcomponentprops1['x-next-title']) {
|
|
1368
|
+
const pre = prefix && prefix !== '' ? prefix + '.' + s.name : s.name;
|
|
1369
|
+
const title = s['x-component-props']['x-next-title'];
|
|
1370
|
+
const path = pre + '.' + title.label;
|
|
1371
|
+
appends.add(path);
|
|
1372
|
+
}
|
|
1373
|
+
const isTreeCollection = isAssociationField && ((_getCollection = getCollection(collectionField.target, dataSource)) === null || _getCollection === void 0 ? void 0 : _getCollection.template) === 'tree';
|
|
1374
|
+
if (collectionField && (isAssociationField || isAssociationSubfield) && s['x-component'] !== 'TableField') {
|
|
1375
|
+
var _s_xcomponentprops3;
|
|
1376
|
+
const fieldPath = !isAssociationField && isAssociationSubfield ? getAssociationPath(s.name) : s.name;
|
|
1377
|
+
const path = prefix === '' || !prefix ? fieldPath : prefix + '.' + fieldPath;
|
|
1378
|
+
if (isTreeCollection) {
|
|
1379
|
+
appends.add(path);
|
|
1380
|
+
appends.add("".concat(path, ".parent") + '(recursively=true)');
|
|
1381
|
+
} else {
|
|
1382
|
+
appends.add(path);
|
|
1383
|
+
}
|
|
1384
|
+
if ([
|
|
1385
|
+
'Nester',
|
|
1386
|
+
'SubTable',
|
|
1387
|
+
'PopoverNester'
|
|
1388
|
+
].includes((_s_xcomponentprops3 = s['x-component-props']) === null || _s_xcomponentprops3 === void 0 ? void 0 : _s_xcomponentprops3.mode)) {
|
|
1389
|
+
updateAssociationValues.add(path);
|
|
1390
|
+
const bufPrefix = prefix && prefix !== '' ? prefix + '.' + s.name : s.name;
|
|
1391
|
+
_getAssociationAppends(s, bufPrefix);
|
|
1392
|
+
}
|
|
1393
|
+
} else if (![
|
|
1394
|
+
'ActionBar',
|
|
1395
|
+
'Action',
|
|
1396
|
+
'Action.Link',
|
|
1397
|
+
'Action.Modal',
|
|
1398
|
+
'Selector',
|
|
1399
|
+
'Viewer',
|
|
1400
|
+
'AddNewer',
|
|
1401
|
+
'AssociationField.Selector',
|
|
1402
|
+
'AssociationField.AddNewer',
|
|
1403
|
+
'TableField'
|
|
1404
|
+
].includes(s['x-component'])) {
|
|
1405
|
+
_getAssociationAppends(s, str);
|
|
1406
|
+
}
|
|
1407
|
+
}, str);
|
|
1408
|
+
};
|
|
1409
|
+
const getAssociationAppends = ()=>{
|
|
1410
|
+
updateAssociationValues = new Set([]);
|
|
1411
|
+
appends = new Set([]);
|
|
1412
|
+
_getAssociationAppends(fieldSchema, '');
|
|
1413
|
+
return {
|
|
1414
|
+
appends: [
|
|
1415
|
+
...appends
|
|
1416
|
+
],
|
|
1417
|
+
updateAssociationValues: [
|
|
1418
|
+
...updateAssociationValues
|
|
1419
|
+
]
|
|
1420
|
+
};
|
|
1421
|
+
};
|
|
1422
|
+
return {
|
|
1423
|
+
getAssociationAppends
|
|
1424
|
+
};
|
|
1425
|
+
};
|
|
1426
|
+
function getTargetField(obj) {
|
|
1427
|
+
function getAllKeys(obj) {
|
|
1428
|
+
const keys = [];
|
|
1429
|
+
function traverse(o) {
|
|
1430
|
+
Object.keys(o).sort().forEach(function(key) {
|
|
1431
|
+
keys.push(key);
|
|
1432
|
+
if (o[key] && typeof o[key] === 'object') {
|
|
1433
|
+
traverse(o[key]);
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
traverse(obj);
|
|
1438
|
+
return keys;
|
|
1439
|
+
}
|
|
1440
|
+
const keys = getAllKeys(obj);
|
|
1441
|
+
const index = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].findIndex(keys, (key, index)=>{
|
|
1442
|
+
if (key.includes('$') && index > 0) {
|
|
1443
|
+
return true;
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
const result = keys.slice(0, index);
|
|
1447
|
+
return result;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* 之所以不直接使用 form.reset() 是因为其无法将子表格重置为空
|
|
1451
|
+
* 主要用于修复这个问题:
|
|
1452
|
+
* @param form
|
|
1453
|
+
*/ async function resetFormCorrectly(form) {
|
|
1454
|
+
(0,__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.untracked)(()=>{
|
|
1455
|
+
Object.keys(form.fields).forEach((key)=>{
|
|
1456
|
+
if ((0,__WEBPACK_EXTERNAL_MODULE__schema_component_antd_association_field_util_mjs__.isSubMode)(form.fields[key])) {
|
|
1457
|
+
// 清空子表格或者子表单的初始值,可以确保后面的 reset 会清空子表格或者子表单的值
|
|
1458
|
+
form.fields[key].initialValue = null;
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
});
|
|
1462
|
+
await form.reset();
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
export { findFilterTargets, getAssociationPath, getFormValues, updateFilterTargets, useAssociationCreateActionProps, useAssociationFilterBlockProps, useAssociationFilterProps, useAssociationNames, useBulkDestroyActionProps, useCancelActionProps, useCollectValuesToSubmit, useCreateActionProps, useCustomizeRequestActionProps, useCustomizeUpdateActionProps, useDestroyActionProps, useDetailPrintActionProps, useDetailsPaginationProps, useDisassociateActionProps, useFilterBlockActionProps, useInsertSchema, useOptionalFieldList, useRefreshActionProps, useRemoveActionProps, useResetBlockActionProps, useUpdateActionProps };
|