@nocobase/client 1.0.1-alpha.1 → 1.2.0-alpha

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 (35) hide show
  1. package/es/application/schema-settings/index.d.ts +1 -0
  2. package/es/application/schema-settings/utils/createModalSettingsItem.d.ts +28 -0
  3. package/es/application/schema-settings/utils/createSelectSettingsItem.d.ts +28 -0
  4. package/es/application/schema-settings/utils/createSwitchSettingsItem.d.ts +25 -0
  5. package/es/application/schema-settings/utils/index.d.ts +11 -0
  6. package/es/application/schema-settings/utils/util.d.ts +21 -0
  7. package/es/block-provider/TemplateBlockProvider.d.ts +1 -1
  8. package/es/block-provider/hooks/index.d.ts +4 -1
  9. package/es/data-source/collection/Collection.d.ts +1 -0
  10. package/es/i18n/i18n.d.ts +4 -0
  11. package/es/index.d.ts +1 -0
  12. package/es/index.mjs +2320 -2115
  13. package/es/schema-component/antd/card-item/CardItem.d.ts +2 -2
  14. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +1 -1
  15. package/es/schema-component/antd/grid/Grid.d.ts +2 -0
  16. package/es/schema-component/antd/input/Json.d.ts +2 -0
  17. package/es/schema-component/hooks/useBlockSize.d.ts +6 -1
  18. package/es/schema-initializer/items/DataBlockInitializer.d.ts +3 -2
  19. package/es/schema-initializer/items/FilterBlockInitializer.d.ts +1 -1
  20. package/es/schema-settings/index.d.ts +2 -0
  21. package/es/schema-settings/setDefaultSortingRulesSchemaSettingsItem.d.ts +10 -0
  22. package/es/schema-settings/setTheDataScopeSchemaSettingsItem.d.ts +10 -0
  23. package/lib/index.js +89 -87
  24. package/lib/locale/en_US.js +2 -1
  25. package/lib/locale/es_ES.js +2 -1
  26. package/lib/locale/fr_FR.js +2 -1
  27. package/lib/locale/ja_JP.js +3 -2
  28. package/lib/locale/ko_KR.js +2 -1
  29. package/lib/locale/pt_BR.js +2 -1
  30. package/lib/locale/ru_RU.js +2 -1
  31. package/lib/locale/tr_TR.js +2 -1
  32. package/lib/locale/uk_UA.js +2 -1
  33. package/lib/locale/zh-CN.js +3 -2
  34. package/lib/locale/zh-TW.js +2 -1
  35. package/package.json +6 -5
@@ -11,3 +11,4 @@ export * from './SchemaSettingsManager';
11
11
  export * from './components';
12
12
  export * from './context/SchemaSettingItemContext';
13
13
  export * from './types';
14
+ export * from './utils';
@@ -0,0 +1,28 @@
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 { SchemaSettingsItemType } from '@nocobase/client';
10
+ import { ISchema } from '@formily/react';
11
+ import { TFunction } from 'react-i18next';
12
+ export interface CreateModalSchemaSettingsItemProps {
13
+ name: string;
14
+ title: string | ((t: TFunction<'translation', undefined>) => string);
15
+ parentSchemaKey: string;
16
+ defaultValue?: any;
17
+ useDefaultValue?: () => any;
18
+ schema: (defaultValue: any) => ISchema;
19
+ valueKeys?: string[];
20
+ useVisible?: () => boolean;
21
+ }
22
+ /**
23
+ * create `switch` type schema settings item
24
+ *
25
+ * @internal
26
+ * @unstable
27
+ */
28
+ export declare function createModalSettingsItem(options: CreateModalSchemaSettingsItemProps): SchemaSettingsItemType;
@@ -0,0 +1,28 @@
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 { SelectProps } from '@nocobase/client';
10
+ import { TFunction } from 'react-i18next';
11
+ interface CreateSelectSchemaSettingsItemProps {
12
+ name: string;
13
+ title: string | ((t: TFunction<'translation', undefined>) => string);
14
+ options?: SelectProps['options'];
15
+ useOptions?: () => SelectProps['options'];
16
+ schemaKey: string;
17
+ defaultValue?: string | number;
18
+ useDefaultValue?: () => string | number;
19
+ useVisible?: () => boolean;
20
+ }
21
+ /**
22
+ * create `select` type schema settings item
23
+ *
24
+ * @internal
25
+ * @unstable
26
+ */
27
+ export declare const createSelectSchemaSettingsItem: (options: CreateSelectSchemaSettingsItemProps) => SchemaSettingsItemType;
28
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { SchemaSettingsItemType } from '@nocobase/client';
10
+ import { TFunction } from 'react-i18next';
11
+ export interface CreateSwitchSchemaSettingsItemProps {
12
+ name: string;
13
+ title: string | ((t: TFunction<'translation', undefined>) => string);
14
+ schemaKey: string;
15
+ defaultValue?: boolean;
16
+ useDefaultValue?: () => boolean;
17
+ useVisible?: () => boolean;
18
+ }
19
+ /**
20
+ * create `switch` type schema settings item
21
+ *
22
+ * @internal
23
+ * @unstable
24
+ */
25
+ export declare function createSwitchSettingsItem(options: CreateSwitchSchemaSettingsItemProps): SchemaSettingsItemType;
@@ -0,0 +1,11 @@
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 * from './createSelectSettingsItem';
10
+ export * from './createSwitchSettingsItem';
11
+ export * from './createModalSettingsItem';
@@ -0,0 +1,21 @@
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 { ISchema } from '@formily/json-schema';
10
+ type IGetNewSchema = {
11
+ fieldSchema: ISchema;
12
+ schemaKey: string;
13
+ value: any;
14
+ valueKeys?: string[];
15
+ };
16
+ export declare function getNewSchema(options: IGetNewSchema): {
17
+ [x: number]: any;
18
+ 'x-uid': any;
19
+ };
20
+ export declare const useHookDefault: (defaultValues?: any) => any;
21
+ export {};
@@ -11,7 +11,7 @@ import React from 'react';
11
11
  * @internal
12
12
  */
13
13
  export declare const useTemplateBlockContext: () => {
14
- templateFinshed?: boolean;
14
+ templateFinished?: boolean;
15
15
  onTemplateSuccess?: Function;
16
16
  };
17
17
  declare const TemplateBlockProvider: (props: any) => React.JSX.Element;
@@ -8,10 +8,10 @@
8
8
  */
9
9
  import { ChangeEvent } from 'react';
10
10
  import { VariableOption, VariablesContextType } from '../../variables/types';
11
+ export * from './useBlockHeightProps';
11
12
  export * from './useDataBlockParentRecord';
12
13
  export * from './useFormActiveFields';
13
14
  export * from './useParsedFilter';
14
- export * from './useBlockHeightProps';
15
15
  export declare const usePickActionProps: () => {
16
16
  onClick(): void;
17
17
  };
@@ -38,6 +38,9 @@ export interface FilterTarget {
38
38
  /** associated field */
39
39
  field?: string;
40
40
  }[];
41
+ /**
42
+ * 筛选表单区块的 uid
43
+ */
41
44
  uid?: string;
42
45
  }
43
46
  export declare const findFilterTargets: (fieldSchema: any) => FilterTarget;
@@ -129,5 +129,6 @@ export declare class Collection {
129
129
  private getFieldByAssociationName;
130
130
  getField(name: SchemaKey): any;
131
131
  hasField(name: SchemaKey): boolean;
132
+ isTitleField(field: CollectionFieldOptions): boolean;
132
133
  }
133
134
  export {};
package/es/i18n/i18n.d.ts CHANGED
@@ -7,5 +7,9 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { TFuncKey, TOptions } from 'i18next';
10
+ /**
11
+ * @deprecated
12
+ * use {@link @nocobase/utils/client#tval} instead
13
+ */
10
14
  export declare function tval(text: TFuncKey | TFuncKey[], options?: TOptions): string;
11
15
  export declare const i18n: import("i18next").i18n;
package/es/index.d.ts CHANGED
@@ -54,6 +54,7 @@ export * from './testUtils';
54
54
  export * from './user';
55
55
  export * from './variables';
56
56
  export { withDynamicSchemaProps } from './hoc/withDynamicSchemaProps';
57
+ export { SchemaSettingsActionLinkItem } from './modules/actions/link/customizeLinkActionSettings';
57
58
  export * from './modules/blocks/BlockSchemaToolbar';
58
59
  export * from './modules/blocks/data-blocks/form';
59
60
  export * from './modules/blocks/data-blocks/table';