@nocobase/client-v2 2.2.0-beta.8 → 2.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/APIClient.d.ts +1 -3
- package/es/BaseApplication.d.ts +3 -0
- package/es/RouteRepository.d.ts +8 -0
- package/es/RouterManager.d.ts +15 -0
- package/es/authRedirect.d.ts +1 -0
- package/es/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
- package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +1 -0
- package/es/components/category-tabs/SortableCategoryTabs.d.ts +55 -0
- package/es/components/category-tabs/index.d.ts +9 -0
- package/es/components/form/ScanInput/useCodeScanner.d.ts +2 -1
- package/es/components/form/TypedVariableInput.d.ts +31 -5
- package/es/components/form/filter/CollectionFilter.d.ts +2 -0
- package/es/components/form/filter/CollectionFilterItem.d.ts +11 -1
- package/es/components/form/filter/CollectionFilterPanel.d.ts +2 -0
- package/es/components/form/filter/index.d.ts +2 -0
- package/es/components/form/filter/useFilterActionProps.d.ts +2 -0
- package/es/components/index.d.ts +1 -0
- package/es/entry-actions/EntryActionManager.d.ts +24 -0
- package/es/entry-actions/index.d.ts +9 -0
- package/es/flow/actions/index.d.ts +1 -1
- package/es/flow/actions/linkageRules.d.ts +2 -0
- package/es/flow/admin-shell/BaseLayoutModel.d.ts +6 -0
- package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +7 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +2 -1
- package/es/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.d.ts +24 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/useApplications.d.ts +7 -2
- package/es/flow/components/FieldAssignExactDatePicker.d.ts +1 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +9 -0
- package/es/flow/components/RunJSValueEditor.d.ts +1 -0
- package/es/flow/components/filter/FilterGroup.d.ts +1 -0
- package/es/flow/components/filter/VariableFilterItem.d.ts +6 -1
- package/es/flow/index.d.ts +1 -0
- package/es/flow/models/base/ActionModelCore.d.ts +2 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +12 -0
- package/es/flow/models/base/PageModel/PageModelTabBar.d.ts +22 -0
- package/es/flow/models/base/PageModel/PageTabModel.d.ts +12 -0
- package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +17 -2
- package/es/flow/routeTransientInputArgs.d.ts +14 -0
- package/es/flow-compat/fieldValidationConstants.d.ts +1 -1
- package/es/flow-compat/routeTypes.d.ts +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.mjs +279 -158
- package/es/utils/getRouteRuntimeVersion.d.ts +23 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/markdownSanitize.d.ts +11 -0
- package/lib/index.js +280 -159
- package/lib/locale/languageCodes.js +2 -1
- package/package.json +8 -7
- package/src/APIClient.ts +1 -10
- package/src/Application.tsx +4 -0
- package/src/BaseApplication.tsx +13 -6
- package/src/RouteRepository.ts +25 -0
- package/src/RouterManager.tsx +142 -1
- package/src/__tests__/RouteRepository.test.ts +23 -0
- package/src/__tests__/RouterManager.test.ts +125 -0
- package/src/__tests__/app.test.tsx +73 -0
- package/src/__tests__/authRedirect.test.ts +17 -0
- package/src/__tests__/browserChecker.test.ts +61 -0
- package/src/__tests__/getRouteRuntimeVersion.test.ts +68 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +28 -0
- package/src/authRedirect.ts +38 -0
- package/src/collection-field-interface/CollectionFieldInterface.ts +1 -0
- package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +1 -0
- package/src/collection-manager/field-validation.ts +1 -1
- package/src/components/README.md +7 -1
- package/src/components/README.zh-CN.md +6 -1
- package/src/components/category-tabs/SortableCategoryTabs.tsx +210 -0
- package/src/components/category-tabs/index.ts +10 -0
- package/src/components/form/JsonTextArea.tsx +4 -0
- package/src/components/form/ScanInput/CodeScanner.tsx +23 -6
- package/src/components/form/ScanInput/__tests__/useCodeScanner.test.tsx +180 -3
- package/src/components/form/ScanInput/useCodeScanner.ts +170 -5
- package/src/components/form/TypedVariableInput.tsx +452 -101
- package/src/components/form/__tests__/TypedVariableInput.test.tsx +364 -12
- package/src/components/form/filter/CollectionFilter.tsx +4 -0
- package/src/components/form/filter/CollectionFilterItem.tsx +32 -7
- package/src/components/form/filter/CollectionFilterPanel.tsx +4 -0
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +38 -0
- package/src/components/form/filter/__tests__/useFilterActionProps.test.tsx +95 -0
- package/src/components/form/filter/index.ts +2 -0
- package/src/components/form/filter/useFilterActionProps.ts +37 -6
- package/src/components/index.ts +1 -0
- package/src/entry-actions/EntryActionManager.ts +76 -0
- package/src/entry-actions/index.ts +10 -0
- package/src/flow/FlowPage.tsx +38 -3
- package/src/flow/__tests__/FlowPage.test.tsx +201 -27
- package/src/flow/__tests__/FlowRoute.test.tsx +549 -4
- package/src/flow/actions/__tests__/dataScopeFilter.test.ts +62 -0
- package/src/flow/actions/__tests__/linkageRules.tab.test.ts +171 -0
- package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +7 -3
- package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +80 -20
- package/src/flow/actions/dataScopeFilter.ts +10 -1
- package/src/flow/actions/dateTimeFormat.tsx +2 -2
- package/src/flow/actions/index.ts +2 -0
- package/src/flow/actions/linkageRules.tsx +86 -11
- package/src/flow/actions/linkageRulesRefresh.tsx +2 -6
- package/src/flow/actions/openView.tsx +21 -1
- package/src/flow/admin-shell/BaseLayoutModel.tsx +124 -0
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +184 -42
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +1016 -119
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +41 -5
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +177 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +20 -0
- package/src/flow/admin-shell/admin-layout/AppListRender.tsx +13 -2
- package/src/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.tsx +289 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutComponent.test.tsx +253 -6
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +436 -2
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +48 -0
- package/src/flow/admin-shell/admin-layout/index.ts +1 -0
- package/src/flow/admin-shell/admin-layout/useApplications.tsx +81 -12
- package/src/flow/common/Markdown/Display.tsx +14 -3
- package/src/flow/common/Markdown/Edit.tsx +19 -7
- package/src/flow/components/FieldAssignExactDatePicker.tsx +25 -11
- package/src/flow/components/FieldAssignValueInput.tsx +91 -20
- package/src/flow/components/FlowRoute.tsx +134 -18
- package/src/flow/components/RunJSValueEditor.tsx +9 -1
- package/src/flow/components/__tests__/FieldAssignValueInput.context.test.tsx +216 -0
- package/src/flow/components/filter/FilterGroup.tsx +33 -5
- package/src/flow/components/filter/VariableFilterItem.tsx +158 -10
- package/src/flow/components/filter/__tests__/FilterGroup.test.tsx +45 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.leftMetaTree.test.tsx +9 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +70 -1
- package/src/flow/index.ts +1 -0
- package/src/flow/internal/components/Markdown/util.ts +2 -1
- package/src/flow/models/base/ActionModel.tsx +10 -8
- package/src/flow/models/base/ActionModelCore.tsx +5 -0
- package/src/flow/models/base/PageModel/PageModel.tsx +387 -53
- package/src/flow/models/base/PageModel/PageModelTabBar.tsx +114 -0
- package/src/flow/models/base/PageModel/PageTabModel.tsx +184 -3
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +790 -10
- package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.module-isolation.test.tsx +130 -0
- package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.test.tsx +118 -0
- package/src/flow/models/base/PageModel/__tests__/PageTabModel.test.ts +572 -1
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +1 -0
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +27 -12
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +36 -0
- package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +34 -0
- package/src/flow/models/blocks/form/QuickEditFormModel.tsx +189 -36
- package/src/flow/models/blocks/form/__tests__/QuickEditFormModel.quickEdit.test.ts +350 -2
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +2 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +1 -1
- package/src/flow/models/blocks/table/TableColumnModel.tsx +6 -2
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +51 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +2 -1
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +45 -13
- package/src/flow/models/fields/TextareaFieldModel.tsx +42 -19
- package/src/flow/models/fields/VariableFieldFormModel.tsx +3 -3
- package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +32 -1
- package/src/flow/models/fields/__tests__/VariableFieldFormModel.test.tsx +51 -0
- package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +20 -10
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +24 -12
- package/src/flow/models/topbar/TopbarActionModel.tsx +78 -3
- package/src/flow/routeTransientInputArgs.ts +27 -0
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +42 -0
- package/src/flow-compat/fieldValidationConstants.ts +1 -1
- package/src/flow-compat/routeTypes.ts +1 -0
- package/src/index.ts +6 -0
- package/src/locale/languageCodes.ts +2 -1
- package/src/nocobase-buildin-plugin/index.tsx +19 -1
- package/src/utils/getRouteRuntimeVersion.ts +185 -0
- package/src/utils/index.tsx +1 -0
- package/src/utils/markdownSanitize.ts +88 -0
|
@@ -30,6 +30,7 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
|
|
|
30
30
|
enableEditTooltip: boolean;
|
|
31
31
|
enableEditTitle: boolean;
|
|
32
32
|
enableEditIcon: boolean;
|
|
33
|
+
enableEditIconOnly: boolean;
|
|
33
34
|
enableEditType: boolean;
|
|
34
35
|
enableEditDanger: boolean;
|
|
35
36
|
enableEditColor: boolean;
|
|
@@ -44,6 +45,7 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
|
|
|
44
45
|
getInputArgs(): Record<string, any>;
|
|
45
46
|
onClick(event: any): void;
|
|
46
47
|
getTitle(): string;
|
|
48
|
+
getTitleFieldDescription(): any;
|
|
47
49
|
getIcon(): React.ReactNode;
|
|
48
50
|
renderButton(): React.JSX.Element;
|
|
49
51
|
render(): React.JSX.Element;
|
|
@@ -26,11 +26,23 @@ export declare class PageModel extends FlowModel<PageModelStructure> {
|
|
|
26
26
|
private dirtyRefreshScheduled;
|
|
27
27
|
private unmounted;
|
|
28
28
|
private documentTitleUpdateVersion;
|
|
29
|
+
private implicitActiveKey?;
|
|
30
|
+
private locallyCommittedTabTransition?;
|
|
29
31
|
/**
|
|
30
32
|
* 根页面标签页开关以路由表为准,避免 flow model 里的旧配置覆盖路由管理设置。
|
|
31
33
|
*/
|
|
32
34
|
private getEnableTabs;
|
|
35
|
+
private getAllTabs;
|
|
36
|
+
private getUnhiddenTabs;
|
|
37
|
+
private getRequestedTabKey;
|
|
38
|
+
private resolveTabActiveState;
|
|
33
39
|
private getActiveTabKey;
|
|
40
|
+
private getTabActiveKeySyncDependency;
|
|
41
|
+
private requestDocumentTitleUpdate;
|
|
42
|
+
private rememberImplicitActiveKey;
|
|
43
|
+
private commitTabActiveKey;
|
|
44
|
+
private consumeLocallyCommittedTabTransition;
|
|
45
|
+
private synchronizeTabActiveKey;
|
|
34
46
|
private scheduleActiveLifecycleRefresh;
|
|
35
47
|
activateCurrentTab(forceRefresh?: boolean): void;
|
|
36
48
|
deactivateCurrentTab(): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Tabs } from 'antd';
|
|
10
|
+
import type { TabsProps } from 'antd';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
export declare const NO_ACTIVE_PAGE_TAB_KEY = "__no_active_page_tab__";
|
|
13
|
+
type RenderTabBar = NonNullable<React.ComponentProps<typeof Tabs>['renderTabBar']>;
|
|
14
|
+
type PageTabItem = NonNullable<TabsProps['items']>[number];
|
|
15
|
+
type FilteredPageTabBarProps = {
|
|
16
|
+
hiddenTabKeys: Set<string>;
|
|
17
|
+
hiddenActiveTabLabel?: React.ReactNode;
|
|
18
|
+
items: PageTabItem[];
|
|
19
|
+
tabBarProps: Parameters<RenderTabBar>[0];
|
|
20
|
+
};
|
|
21
|
+
export declare function FilteredPageTabBar({ hiddenTabKeys, hiddenActiveTabLabel, items, tabBarProps, }: FilteredPageTabBarProps): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -22,9 +22,21 @@ export declare class BasePageTabModel extends FlowModel<{
|
|
|
22
22
|
render(): React.JSX.Element;
|
|
23
23
|
}
|
|
24
24
|
export declare class RootPageTabModel extends BasePageTabModel {
|
|
25
|
+
private persistedLinkageRulesHydrated;
|
|
26
|
+
private persistedLinkageRulesHydrating?;
|
|
27
|
+
onInit(options: any): void;
|
|
28
|
+
private hasExplicitLinkageRulesStep;
|
|
29
|
+
private shouldHydratePersistedLinkageRules;
|
|
30
|
+
private fetchPersistedAnchor;
|
|
31
|
+
private performPersistedLinkageRulesHydrate;
|
|
32
|
+
private hydratePersistedLinkageRules;
|
|
33
|
+
openFlowSettings(options?: Parameters<FlowModel['openFlowSettings']>[0]): Promise<boolean>;
|
|
25
34
|
renderChildren(): React.JSX.Element;
|
|
26
35
|
saveStepParams(): Promise<void>;
|
|
27
36
|
save(): Promise<void>;
|
|
37
|
+
private buildAnchorPayload;
|
|
38
|
+
private persistLinkageRulesToAnchor;
|
|
39
|
+
private syncPersistedPageTabFlowModelMarker;
|
|
28
40
|
destroy(): Promise<boolean>;
|
|
29
41
|
}
|
|
30
42
|
export declare class ChildPageTabModel extends BasePageTabModel {
|
|
@@ -11,6 +11,21 @@ import React from 'react';
|
|
|
11
11
|
export declare const QUICK_EDIT_POPOVER_MAX_HEIGHT = "calc(100vh - 96px)";
|
|
12
12
|
export declare const QUICK_EDIT_FORM_MAX_HEIGHT = "calc(100vh - 160px)";
|
|
13
13
|
export declare const QUICK_EDIT_MARKDOWN_HEIGHT = "min(480px, calc(100vh - 320px))";
|
|
14
|
+
type QuickEditViewBeforeClosePayload = {
|
|
15
|
+
result?: unknown;
|
|
16
|
+
force?: boolean;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
type QuickEditViewBeforeCloseHandler = (payload: QuickEditViewBeforeClosePayload) => Promise<boolean | void> | boolean | void;
|
|
20
|
+
type QuickEditViewUpdateConfig = {
|
|
21
|
+
preventClose?: boolean;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
type QuickEditViewContainer = {
|
|
25
|
+
close: (result?: unknown, force?: boolean) => Promise<boolean | void> | boolean | void;
|
|
26
|
+
update?: (newConfig: QuickEditViewUpdateConfig) => unknown;
|
|
27
|
+
beforeClose?: QuickEditViewBeforeCloseHandler;
|
|
28
|
+
};
|
|
14
29
|
export declare function getQuickEditFieldProps(collectionField: CollectionField, fieldProps?: Record<string, any>): {
|
|
15
30
|
[x: string]: any;
|
|
16
31
|
};
|
|
@@ -18,8 +33,7 @@ export declare class QuickEditFormModel extends FlowModel {
|
|
|
18
33
|
fieldPath: string;
|
|
19
34
|
resource: SingleRecordResource;
|
|
20
35
|
collection: Collection;
|
|
21
|
-
|
|
22
|
-
viewContainer: any;
|
|
36
|
+
viewContainer: QuickEditViewContainer;
|
|
23
37
|
__onSubmitSuccess: any;
|
|
24
38
|
_fieldProps: any;
|
|
25
39
|
_onOk: any;
|
|
@@ -42,3 +56,4 @@ export declare class QuickEditFormModel extends FlowModel {
|
|
|
42
56
|
addAppends(fieldPath: string, refresh?: boolean): void;
|
|
43
57
|
render(): React.JSX.Element;
|
|
44
58
|
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ROUTE_TRANSIENT_INPUT_ARGS_KEY = "__nocobaseOpenViewInputArgs";
|
|
10
|
+
export type RouteTransientInputArgsState = {
|
|
11
|
+
[ROUTE_TRANSIENT_INPUT_ARGS_KEY]?: Record<string, Record<string, unknown>>;
|
|
12
|
+
usr?: RouteTransientInputArgsState;
|
|
13
|
+
};
|
|
14
|
+
export declare const getRouteTransientInputArgs: (state: unknown, viewUid?: string) => Record<string, unknown>;
|
package/es/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export * from './layout-manager';
|
|
|
28
28
|
export * from './hooks';
|
|
29
29
|
export { default as languageCodes } from './locale/languageCodes';
|
|
30
30
|
export * from './nocobase-buildin-plugin';
|
|
31
|
+
export { getRouteRuntimeVersion } from './utils/getRouteRuntimeVersion';
|
|
32
|
+
export type { RouteRuntimeVersion } from './utils/getRouteRuntimeVersion';
|
|
31
33
|
export * from './collection-field-interface/CollectionFieldInterface';
|
|
32
34
|
export * from './collection-field-interface/CollectionFieldInterfaceManager';
|
|
33
35
|
export * from './collection-manager/field-configure';
|
|
@@ -36,7 +38,11 @@ export * from './collection-manager/filter-operators';
|
|
|
36
38
|
export * from './collection-manager/interfaces';
|
|
37
39
|
export * from './collection-manager/template-fields';
|
|
38
40
|
export * from './data-source';
|
|
41
|
+
export * from './entry-actions';
|
|
39
42
|
export * from './flow';
|
|
43
|
+
export { CodeEditorExtension } from './flow/components/code-editor/extension';
|
|
44
|
+
export type { CodeEditorExtra, CodeEditorExtraRegistry, EditorRef } from './flow/components/code-editor/types';
|
|
40
45
|
export { DEFAULT_DATA_SOURCE_KEY, IconPicker, isTitleField, isTitleFieldInterface, NocoBaseDesktopRouteType, } from './flow-compat';
|
|
41
46
|
export type { NocoBaseDesktopRoute } from './flow-compat';
|
|
47
|
+
export * from './utils/markdownSanitize';
|
|
42
48
|
export { default as AntdAppProvider } from './theme/AntdAppProvider';
|