@nocobase/client 1.6.0-beta.9 → 1.6.0

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.
Files changed (80) hide show
  1. package/es/api-client/hooks/useRequest.d.ts +2 -0
  2. package/es/application/Application.d.ts +7 -2
  3. package/es/{user/SwitchRole.d.ts → application/hooks/useAclSnippets.d.ts} +3 -1
  4. package/es/application/hooks/useAppSpin.d.ts +1 -1
  5. package/es/application/schema-initializer/hooks/useGetSchemaInitializerMenuItems.d.ts +1 -1
  6. package/es/application/schema-settings/hooks/useSchemaSettingsRender.d.ts +4 -4
  7. package/es/application/schema-settings/types.d.ts +1 -0
  8. package/es/collection-manager/hooks/useCollectionManager_deprecated.d.ts +4 -4
  9. package/es/collection-manager/interfaces/properties/index.d.ts +3 -0
  10. package/es/collection-manager/interfaces/time.d.ts +0 -11
  11. package/es/data-source/collection-template/CollectionTemplate.d.ts +1 -1
  12. package/es/filter-provider/utils.d.ts +1 -1
  13. package/es/{user/ChangePassword.d.ts → hoc/withTooltipComponent.d.ts} +2 -1
  14. package/es/hooks/useMenuItem.d.ts +3 -1
  15. package/es/index.css +1 -1
  16. package/es/index.d.ts +2 -4
  17. package/es/index.mjs +35135 -34573
  18. package/es/lazy-helper/index.d.ts +6 -5
  19. package/es/modules/blocks/data-blocks/details-multi/DetailsBlockInitializer.d.ts +3 -1
  20. package/es/modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer.d.ts +3 -1
  21. package/es/modules/blocks/data-blocks/form/FormBlockInitializer.d.ts +8 -2
  22. package/es/modules/blocks/data-blocks/form/RecordFormBlockInitializer.d.ts +6 -2
  23. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.d.ts +8 -2
  24. package/es/modules/fields/component/TimePicker/timePickerComponentFieldSettings.d.ts +10 -0
  25. package/es/modules/menu/GroupItem.d.ts +0 -16
  26. package/es/modules/menu/LinkMenuItem.d.ts +0 -20
  27. package/es/modules/menu/PageMenuItem.d.ts +6 -22
  28. package/es/modules/popup/PopupContextProvider.d.ts +2 -0
  29. package/es/nocobase-buildin-plugin/index.d.ts +2 -0
  30. package/es/{user/EditProfile.d.ts → route-switch/antd/admin-layout/LanguageSettings.d.ts} +2 -1
  31. package/es/{user/LanguageSettings.d.ts → route-switch/antd/admin-layout/UserCenterButton.d.ts} +3 -1
  32. package/es/route-switch/antd/admin-layout/convertRoutesToSchema.d.ts +1 -62
  33. package/es/route-switch/antd/admin-layout/index.d.ts +6 -1
  34. package/es/route-switch/antd/admin-layout/menuItemSettings.d.ts +21 -0
  35. package/es/route-switch/antd/admin-layout/userCenterSettings.d.ts +11 -0
  36. package/es/schema-component/antd/action/hooks.d.ts +1 -1
  37. package/es/schema-component/antd/action/zIndexContext.d.ts +1 -0
  38. package/es/schema-component/antd/form-drawer/index.d.ts +36 -0
  39. package/es/schema-component/antd/form-item/FormItem.Settings.d.ts +57 -1
  40. package/es/schema-component/antd/index.d.ts +1 -0
  41. package/es/schema-component/antd/menu/Menu.d.ts +6 -5
  42. package/es/schema-component/antd/menu/index.d.ts +1 -0
  43. package/es/schema-component/antd/page/Page.d.ts +1 -0
  44. package/es/schema-component/antd/page/PageTabDesigner.d.ts +1 -3
  45. package/es/schema-component/antd/pagination/index.d.ts +5 -1
  46. package/es/schema-component/antd/record-picker/util.d.ts +1 -1
  47. package/es/schema-component/antd/select/ReadPretty.d.ts +5 -1
  48. package/es/schema-initializer/items/DataBlockInitializer.d.ts +1 -0
  49. package/es/schema-initializer/items/RecordAssociationBlockInitializer.d.ts +3 -1
  50. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.d.ts +3 -1
  51. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.d.ts +6 -2
  52. package/es/schema-initializer/items/RecordAssociationGridCardBlockInitializer.d.ts +3 -1
  53. package/es/schema-initializer/items/RecordAssociationListBlockInitializer.d.ts +3 -1
  54. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.d.ts +6 -2
  55. package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +3 -1
  56. package/es/schema-settings/EnableChildCollections/index.d.ts +3 -1
  57. package/es/schema-settings/GeneralSchemaDesigner.d.ts +5 -0
  58. package/es/schema-settings/LinkageRules/index.d.ts +5 -1
  59. package/es/schema-settings/SchemaSettingAccessControl.d.ts +14 -0
  60. package/es/schema-settings/SchemaSettings.d.ts +1 -0
  61. package/es/schema-settings/SchemaSettingsTimeFormat.d.ts +13 -0
  62. package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -1
  63. package/es/schema-settings/index.d.ts +1 -0
  64. package/es/user/CurrentUser.d.ts +4 -9
  65. package/es/user/CurrentUserProvider.d.ts +0 -4
  66. package/lib/index.css +1 -1
  67. package/lib/index.js +407 -413
  68. package/lib/locale/en-US.js +3 -1
  69. package/lib/locale/es-ES.js +3 -1
  70. package/lib/locale/fr-FR.js +3 -1
  71. package/lib/locale/it-IT.js +861 -0
  72. package/lib/locale/ja-JP.js +3 -1
  73. package/lib/locale/ko-KR.js +3 -1
  74. package/lib/locale/pt-BR.js +3 -1
  75. package/lib/locale/ru-RU.js +3 -1
  76. package/lib/locale/tr-TR.js +3 -1
  77. package/lib/locale/uk-UA.js +3 -1
  78. package/lib/locale/zh-CN.js +4 -2
  79. package/lib/locale/zh-TW.js +3 -1
  80. package/package.json +8 -7
@@ -17,6 +17,8 @@ export type ResourceActionOptions<P = any> = {
17
17
  action?: string;
18
18
  params?: P;
19
19
  url?: string;
20
+ skipNotify?: boolean | ((error: any) => boolean);
21
+ skipAuth?: boolean;
20
22
  };
21
23
  export type UseRequestService<P> = AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService;
22
24
  export type UseRequestOptions = Options<any, any> & {
@@ -15,7 +15,7 @@ import { PluginSettingOptions, PluginSettingsManager } from './PluginSettingsMan
15
15
  import { ComponentTypeAndString, RouterManager, RouterOptions } from './RouterManager';
16
16
  import { WebSocketClient, WebSocketClientOptions } from './WebSocketClient';
17
17
  import { SchemaInitializer, SchemaInitializerManager } from './schema-initializer';
18
- import { SchemaSettings, SchemaSettingsManager } from './schema-settings';
18
+ import { SchemaSettings, SchemaSettingsItemType, SchemaSettingsManager } from './schema-settings';
19
19
  import { CollectionFieldInterfaceComponentOption } from '../data-source/collection-field-interface/CollectionFieldInterface';
20
20
  import { DataSourceManager, type DataSourceManagerOptions } from '../data-source/data-source/DataSourceManager';
21
21
  import type { CollectionFieldInterfaceFactory } from '../data-source';
@@ -73,6 +73,7 @@ export declare class Application {
73
73
  schemaSettingsManager: SchemaSettingsManager;
74
74
  dataSourceManager: DataSourceManager;
75
75
  name: string;
76
+ favicon: string;
76
77
  globalVars: Record<string, any>;
77
78
  jsonLogic: JsonLogic;
78
79
  loading: boolean;
@@ -84,6 +85,7 @@ export declare class Application {
84
85
  get pm(): PluginManager;
85
86
  get disableAcl(): boolean;
86
87
  get isWsAuthorized(): boolean;
88
+ updateFavicon(favicon?: string): void;
87
89
  setWsAuthorized(authorized: boolean): void;
88
90
  constructor(options?: ApplicationOptions);
89
91
  private initListeners;
@@ -123,10 +125,13 @@ export declare class Application {
123
125
  getRootComponent(): React.FC<{
124
126
  children?: React.ReactNode;
125
127
  }>;
126
- mount(containerOrSelector: Element | ShadowRoot | string): any;
128
+ mount(containerOrSelector: Element | ShadowRoot | string): import("react-dom/client").Root;
127
129
  addFieldInterfaces(fieldInterfaceClasses?: CollectionFieldInterfaceFactory[]): void;
128
130
  addFieldInterfaceComponentOption(fieldName: string, componentOption: CollectionFieldInterfaceComponentOption): void;
129
131
  addGlobalVar(key: string, value: any): void;
130
132
  getGlobalVar(key: any): any;
133
+ addUserCenterSettingsItem(item: SchemaSettingsItemType & {
134
+ aclSnippet?: string;
135
+ }): void;
131
136
  }
132
137
  export {};
@@ -6,4 +6,6 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare const useSwitchRole: () => import("antd/es/menu/hooks/useItems").ItemType;
9
+ export declare const useAclSnippets: () => {
10
+ allow: (aclSnippet: any) => any;
11
+ };
@@ -8,5 +8,5 @@
8
8
  */
9
9
  import React from 'react';
10
10
  export declare const useAppSpin: () => {
11
- render: () => React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.FunctionComponentElement<import("antd").SpinProps>;
11
+ render: () => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
12
12
  };
@@ -13,4 +13,4 @@ export declare function useSchemaInitializerMenuItems(items: any[], name?: strin
13
13
  /**
14
14
  * @internal
15
15
  */
16
- export declare function useGetSchemaInitializerMenuItems(onClick?: (args: any) => void): any;
16
+ export declare function useGetSchemaInitializerMenuItems(onClick?: (args: any) => void): (items: any[], parentKey: string) => any;
@@ -6,13 +6,13 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { SchemaSettingOptions } from '../types';
10
- import React from 'react';
11
- import { SchemaSettingsProps } from '../../../schema-settings';
12
- import { Schema } from '@formily/json-schema';
13
9
  import { GeneralField } from '@formily/core';
10
+ import { Schema } from '@formily/json-schema';
11
+ import React from 'react';
14
12
  import { Designable } from '../../../schema-component';
13
+ import { SchemaSettingsProps } from '../../../schema-settings';
15
14
  import { SchemaSettings } from '../SchemaSettings';
15
+ import { SchemaSettingOptions } from '../types';
16
16
  type UseSchemaSettingsRenderOptions<T = {}> = Omit<SchemaSettingOptions<T>, 'name' | 'items'> & Omit<SchemaSettingsProps, 'title' | 'children'> & {
17
17
  fieldSchema?: Schema;
18
18
  field?: GeneralField;
@@ -10,6 +10,7 @@ import { ComponentType } from 'react';
10
10
  import { SchemaSettingsActionModalItemProps, SchemaSettingsCascaderItemProps, SchemaSettingsItemProps, SchemaSettingsModalItemProps, SchemaSettingsPopupProps, SchemaSettingsRemoveProps, SchemaSettingsSelectItemProps, SchemaSettingsSubMenuProps, SchemaSettingsSwitchItemProps } from '../../schema-settings';
11
11
  export interface SchemaSettingOptions<T = {}> {
12
12
  name: string;
13
+ mode?: 'inline' | 'dropdown';
13
14
  Component?: ComponentType<T>;
14
15
  componentProps?: T;
15
16
  items: SchemaSettingsItemType[];
@@ -15,12 +15,12 @@ export declare const useCollectionManager_deprecated: (dataSourceName?: string)
15
15
  interfaces: {};
16
16
  collections: import("../..").Collection[];
17
17
  templates: import("../..").CollectionTemplate[];
18
- getTemplate: (name?: any) => any;
19
- getInterface: (name: string) => any;
18
+ getTemplate: (name?: string) => import("../..").CollectionTemplate;
19
+ getInterface: (name: string) => import("../..").CollectionFieldInterface;
20
20
  getCollections: () => CollectionOptions[];
21
21
  getParentCollectionFields: (parentCollection: any, currentCollection: any, customDataSource?: string) => import("../..").CollectionFieldOptions[];
22
22
  getInheritCollections: (name: any, customDataSource?: string) => string[];
23
- getChildrenCollections: (name: string, isSupportView?: any, customDataSource?: string) => import("../..").Collection[];
23
+ getChildrenCollections: (name: string, isSupportView?: boolean, customDataSource?: string) => import("../..").Collection[];
24
24
  refreshCM: () => Promise<void>;
25
25
  get: (name: any, customDataSource?: string) => CollectionOptions;
26
26
  getInheritedFields: (name: string, customDataSource?: string) => import("../..").CollectionFieldOptions[];
@@ -58,5 +58,5 @@ export declare const useCollectionManager_deprecated: (dataSourceName?: string)
58
58
  getCollectionJoinField: (name: string, customDataSource?: string) => any;
59
59
  getAllCollectionsInheritChain: (collectionName: string, customDataSource?: string) => string[];
60
60
  getInheritCollectionsChain: (collectionName: string, customDataSource?: string) => () => string[];
61
- isTitleField: (field: any) => any;
61
+ isTitleField: (field: any) => boolean;
62
62
  };
@@ -86,6 +86,9 @@ export declare const reverseFieldProperties: Record<string, ISchema>;
86
86
  export declare const dateTimeProps: {
87
87
  [key: string]: ISchema;
88
88
  };
89
+ export declare const timeProps: {
90
+ [key: string]: ISchema;
91
+ };
89
92
  export declare const dataSource: ISchema;
90
93
  export declare const defaultProps: {
91
94
  'uiSchema.title': {
@@ -24,17 +24,6 @@ export declare class TimeFieldInterface extends CollectionFieldInterface {
24
24
  availableTypes: string[];
25
25
  hasDefaultValue: boolean;
26
26
  properties: {
27
- 'uiSchema.x-component-props.format': {
28
- type: string;
29
- title: string;
30
- 'x-component': string;
31
- 'x-decorator': string;
32
- default: string;
33
- enum: {
34
- label: string;
35
- value: string;
36
- }[];
37
- };
38
27
  'uiSchema.title': {
39
28
  type: string;
40
29
  title: string;
@@ -54,7 +54,7 @@ export declare abstract class CollectionTemplate {
54
54
  /** UI configurable CollectionOptions parameters (fields for adding or editing Collection forms) */
55
55
  configurableProperties?: Record<string, ISchema>;
56
56
  /** Available field types for the current template */
57
- availableFieldInterfaces?: AvailableFieldInterfacesInclude | AvailableFieldInterfacesExclude;
57
+ availableFieldInterfaces?: AvailableFieldInterfacesInclude & AvailableFieldInterfacesExclude;
58
58
  /** Whether it is a divider */
59
59
  divider?: boolean;
60
60
  /** Template description */
@@ -40,6 +40,6 @@ export declare const useFilterAPI: () => {
40
40
  /** 当前区块是否已连接其它区块 */
41
41
  isConnected: boolean;
42
42
  /** 调用该方法进行过滤 */
43
- doFilter: (value: any, field?: string | ((target: FilterTarget['targets'][0]) => string), operator?: string | ((target: FilterTarget['targets'][0]) => string)) => void;
43
+ doFilter: (value: any, field?: string | ((target: FilterTarget['targets'][0], block: DataBlock) => string), operator?: string | ((target: FilterTarget['targets'][0]) => string)) => void;
44
44
  };
45
45
  export declare const isInFilterFormBlock: (fieldSchema: Schema) => boolean;
@@ -6,4 +6,5 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare const useChangePassword: () => import("antd/es/menu/hooks/useItems").ItemType;
9
+ import React from 'react';
10
+ export declare const withTooltipComponent: (Component: React.FC) => (props: any) => React.JSX.Element;
@@ -37,7 +37,9 @@ export declare const useCollectMenuItems: () => {
37
37
  * @returns
38
38
  */
39
39
  export declare const useMenuItem: () => {
40
- Component: ({ limitCount }: any) => React.JSX.Element;
40
+ Component: ({ limitCount }: {
41
+ limitCount?: number;
42
+ }) => React.JSX.Element;
41
43
  getMenuItems: (Com: () => ReactNode) => Item[];
42
44
  getMenuItem: (Com: () => JSX.Element) => Item;
43
45
  clean: () => void;
package/es/index.css CHANGED
@@ -1 +1 @@
1
- ::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--colorBgScrollTrack)}::-webkit-scrollbar-thumb{background:var(--colorBgScrollBar);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)}::-webkit-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)}.rc-virtual-list-scrollbar-thumb{background:var(--colorBgScrollBar)!important}.rc-virtual-list-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)!important}.rc-virtual-list-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)!important}.ant-btn.ant-btn-danger{text-shadow:none;box-shadow:none}.ant-formily-item-label{color:#000000d9;font-weight:600}.ant-table-pagination.ant-pagination{margin-bottom:0!important}.ant-formily-item{font-size:inherit!important}.ant-formily-item-bordered-none .ant-formily-item-feedback-layout-loose{margin-bottom:0!important}.ant-formily-item-control-content-component .ant-tag{white-space:pre-wrap}html body{--adm-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}
1
+ ::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--colorBgScrollTrack)}::-webkit-scrollbar-thumb{background:var(--colorBgScrollBar);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)}::-webkit-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)}.rc-virtual-list-scrollbar-thumb{background:var(--colorBgScrollBar)!important}.rc-virtual-list-scrollbar-thumb:hover{background:var(--colorBgScrollBarHover)!important}.rc-virtual-list-scrollbar-thumb:active{background:var(--colorBgScrollBarActive)!important}.ant-menu-submenu-popup{-webkit-backdrop-filter:none;backdrop-filter:none}.ant-menu-item.ant-menu-item-only-child.ant-pro-base-menu-horizontal-menu-item:active{background-color:var(--colorBgMenuItemSelected)!important}.ant-btn.ant-btn-danger{text-shadow:none;box-shadow:none}.ant-formily-item-label{color:#000000d9;font-weight:600}.ant-table-pagination.ant-pagination{margin-bottom:0!important}.ant-formily-item{font-size:inherit!important}.ant-formily-item-bordered-none .ant-formily-item-feedback-layout-loose{margin-bottom:0!important}.ant-formily-item-control-content-component .ant-tag{white-space:pre-wrap}html body{--adm-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}
package/es/index.d.ts CHANGED
@@ -64,14 +64,12 @@ export * from './modules/blocks/data-blocks/table';
64
64
  export * from './modules/blocks/data-blocks/table-selector';
65
65
  export * from './modules/blocks/index';
66
66
  export * from './modules/blocks/useParentRecordCommon';
67
- export { getGroupMenuSchema } from './modules/menu/GroupItem';
68
- export { getLinkMenuSchema } from './modules/menu/LinkMenuItem';
69
- export { getPageMenuSchema } from './modules/menu/PageMenuItem';
67
+ export { getPageMenuSchema, useInsertPageSchema } from './modules/menu/PageMenuItem';
70
68
  export { OpenModeProvider, useOpenModeContext } from './modules/popup/OpenModeProvider';
71
69
  export { PopupContextProvider } from './modules/popup/PopupContextProvider';
72
70
  export { usePopupUtils } from './modules/popup/usePopupUtils';
73
71
  export { VariablePopupRecordProvider } from './modules/variable/variablesProvider/VariablePopupRecordProvider';
74
- export { useCurrentPopupRecord } from './modules/variable/variablesProvider/VariablePopupRecordProvider';
75
72
  export { showFileName } from './modules/fields/component/FileManager/fileManagerComponentFieldSettings';
73
+ export { useCurrentPopupRecord } from './modules/variable/variablesProvider/VariablePopupRecordProvider';
76
74
  export { languageCodes } from './locale';
77
75
  export { CollectionFieldUISchemaProvider, IsInNocoBaseRecursionFieldContext, NocoBaseRecursionField, RefreshComponentProvider, useRefreshFieldSchema, } from './formily/NocoBaseRecursionField';