diff --git a/addLicense.js b/addLicense.js index eda2a7c9bb..54f7e7924c 100644 --- a/addLicense.js +++ b/addLicense.js @@ -1,6 +1,5 @@ const { exec } = require('child_process'); const fs = require('fs'); -const path = require('path'); const commercialLicense = ` /** @@ -59,6 +58,7 @@ exec('git diff --cached --name-only --diff-filter=ACM', (error, stdout, stderr) .split('\n') .filter(Boolean) .filter((file) => file.includes('/src/')) // 只检查 src 目录下的文件 + .filter((file) => !file.includes('/demos/')) // 忽略 demos 目录 .filter((file) => file.endsWith('.js') || file.endsWith('.jsx') || file.endsWith('.ts') || file.endsWith('.tsx')); const validFiles = files.filter((file) => addLicenseToFile(file)); diff --git a/packages/core/cli/src/util.js b/packages/core/cli/src/util.js index 1cc284ec67..a9fed84583 100644 --- a/packages/core/cli/src/util.js +++ b/packages/core/cli/src/util.js @@ -228,6 +228,9 @@ exports.genTsConfigPaths = function genTsConfigPaths() { paths[`${packageJsonName}/e2e`] = [`${relativePath}/src/e2e`]; paths[`${packageJsonName}/web`] = [`${relativePath}/src/web`]; } + if (packageJsonName === '@nocobase/client') { + paths[`${packageJsonName}/demo-utils`] = [`${relativePath}/src/demo-utils`]; + } if (packageJsonName === '@nocobase/plugin-workflow-test') { paths[`${packageJsonName}/e2e`] = [`${relativePath}/src/e2e`]; } diff --git a/packages/core/client/.dumirc.ts b/packages/core/client/.dumirc.ts index 6c38d3e7fa..c524ced3b2 100644 --- a/packages/core/client/.dumirc.ts +++ b/packages/core/client/.dumirc.ts @@ -45,6 +45,10 @@ export default defineConfig({ { title: 'Components', link: '/components/action', + }, + { + title: 'Home site', + link: 'https://docs.nocobase.com/welcome/introduction/', } // { // title: 'UI Schema', @@ -667,5 +671,9 @@ export default defineConfig({ // }, // ], }, + localesEnhance: [ + { id: 'zh-CN', switchPrefix: '中', hostname: 'client-cn.docs.nocobase.com' }, + { id: 'en-US', switchPrefix: 'en', hostname: 'client.docs.nocobase.com' } + ], }), }); diff --git a/packages/core/client/docs/en-US/core/application/application.md b/packages/core/client/docs/en-US/core/application/application.md index b33fe9bbf5..05675b0fdf 100644 --- a/packages/core/client/docs/en-US/core/application/application.md +++ b/packages/core/client/docs/en-US/core/application/application.md @@ -2,9 +2,9 @@ ## new Application(options) -创建一个 NocoBase 应用。 +Creates an instance of a NocoBase application. -- 类型 +- Type ```tsx | pure export interface ApplicationOptions { @@ -23,19 +23,20 @@ export interface ApplicationOptions { } ``` -- 详细信息 - - apiClient:API 请求实例,具体说明请参见:[https://docs.nocobase.com/api/sdk](https://docs.nocobase.com/api/sdk) - - i18n:国际化,具体请参考:[https://www.i18next.com/overview/api#createinstance](https://www.i18next.com/overview/api#createinstance) - - providers:上下文 - - components:全局组件 - - scopes:全局 scopes - - router:配置路由,具体请参考:[RouterManager](/core/application/router-manager) - - pluginSettings: [PluginSettingsManager](/core/application/plugin-settings-manager) - - schemaSettings:Schema 设置工具,具体参考:[SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) - - schemaInitializers:Schema 添加工具,具体参考:[SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) - - loadRemotePlugins:用于控制是否加载远程插件,默认为 `false`,即不加载远程插件(方便单测和 DEMO 环境)。 - - dataSourceManager:数据源管理器,具体参考:[DataSourceManager](/core/data-source/data-source-manager) -- 示例 +## Details +- `apiClient`: API request instance. For more details, refer to: [NocoBase API SDK Documentation](https://docs.nocobase.com/api/sdk) +- `i18n`: Internationalization. For specifics, see: [i18next API Documentation](https://www.i18next.com/overview/api#createinstance) +- `providers`: Context providers +- `components`: Global components +- `scopes`: Global scopes +- `router`: Route configuration. Refer to: [RouterManager](/core/application/router-manager) +- `pluginSettings`: [PluginSettingsManager](/core/application/plugin-settings-manager) +- `schemaSettings`: Schema settings tool. For more information, refer to: [SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) +- `schemaInitializers`: Schema addition tool. For more information, refer to: [SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) +- `loadRemotePlugins`: Used to control whether to load remote plugins. Default is `false`, meaning remote plugins are not loaded (convenient for unit testing and DEMO environments). +- `dataSourceManager`: Data source manager. For more details, refer to: [DataSourceManager](/core/data-source/data-source-manager) + +## Example ```tsx /** @@ -71,7 +72,7 @@ const app = new Application({ export default app.getRootComponent(); ``` -## 实例属性 +## Instance Properties ### app.i18n @@ -81,7 +82,7 @@ class Application { } ``` -详细介绍,请参考:[i18next](https://www.i18next.com/overview/api#createinstance) +For a detailed introduction, please refer to: [i18next](https://www.i18next.com/overview/api#createinstance) ### app.apiClient @@ -91,35 +92,35 @@ class Application { } ``` -详细介绍,请参考:[APIClient](https://docs.nocobase.com/api/sdk) +For a detailed introduction, please refer to: [APIClient](https://docs.nocobase.com/api/sdk) ### app.router -详细介绍,请参考:[RouterManager](/core/application/router-manager) +For a detailed introduction, please refer to: [RouterManager](/core/application/router-manager) ### app.pluginSettingsManager -详细介绍,请参考:[PluginSettingsManager](/core/application/plugin-settings-manager) +For a detailed introduction, please refer to: [PluginSettingsManager](/core/application/plugin-settings-manager) ### app.schemaSettingsManager -详细介绍,请参考:[SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) +For a detailed introduction, please refer to: [SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) ### app.schemaInitializerManager -详细介绍,请参考:[SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) +For a detailed introduction, please refer to: [SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) ### app.dataSourceManager -详细介绍,请参考:[dataSourceManager](/core/data-source/data-source-manager) +For a detailed introduction, please refer to: [dataSourceManager](/core/data-source/data-source-manager) -## 实例方法 +## Instance Methods ### app.getRootComponent() -获取应用的根组件。 +Get the root component of the application. -- 类型 +- Type ```tsx | pure class Application { @@ -127,7 +128,7 @@ class Application { } ``` -- 示例 +- Example ```tsx | pure import { Application } from '@nocobase/client'; @@ -139,9 +140,9 @@ const App = app.getRootComponent(); ### app.mount() -将应用实例挂载在一个容器元素中。 +Mount the application instance in a container element. -- 类型 +- Type ```tsx | pure class Application { @@ -149,7 +150,7 @@ class Application { } ``` -- 示例 +- Example ```tsx | pure import { Application } from '@nocobase/client'; @@ -161,9 +162,9 @@ app.mount('#root'); ### app.addProvider() -添加 `Provider` 上下文。 +Add `Provider` context. -- 类型 +- Type ```tsx | pure class Application { @@ -171,14 +172,14 @@ class Application { } ``` -- 详细信息 +- Details -第一个参数是组件,第二个参数是组件的参数。注意 `Provider` 一定要渲染 `children`。 +The first parameter is the component, and the second parameter is the component's props. Note that the `Provider` must render its `children`. -- 示例 +- Example ```tsx | pure -// 场景1:第三方库,或者自己创建的 Context +// Scenario 1: Third-party library or self-created Context const MyContext = createContext({}); app.addProvider(MyContext.provider, { value: { color: 'red' } }); ``` @@ -216,7 +217,7 @@ export default app.getRootComponent(); ``` ```tsx | pure -// 场景2:自定义的组件,注意 children +// Scenario 2: Custom component, pay attention to children const GlobalDemo = ({ name, children }) => { return
-## 属性
+## Properties
-### 静态属性和动态属性
+### Static Properties and Dynamic Properties
-- schema 中的 `x-decorator-props` 称为静态属性,它是一个普通对象,记录区块的配置信息
-- schema 中的 `x-use-decorator-props` 中的属性称为动态属性,它是一个 React hook,可用于获取例如 URL 上的 ID,或者父级的 context 数据
+- The `x-decorator-props` in the schema is called static properties, which is a plain object that records the configuration information of the block.
+- The properties in `x-use-decorator-props` in the schema are called dynamic properties, which is a React hook that can be used to obtain data such as the ID on the URL or the context data of the parent.
-当两者都存在时,会进行深度合并,作为 `DataBlockProvider` 的属性。
+When both exist, they will be deeply merged and used as properties of `DataBlockProvider`.
-### 属性详解
+### Property Details
```ts | pure
interface AllDataBlockProps {
@@ -112,15 +112,15 @@ interface AllDataBlockProps {
}
```
-- collection(`x-decorator-props`):区块的 collection 表名,用于获取区块的字段信息和区块数据
-- association(`x-decorator-props`):区块的关系字段名,用于获取区块的关系字段信息和关系字段数据
-- dataSource(`x-decorator-props`): 数据源,具体可参考 [Data Modeling](https://docs.nocobase.com/manual/data-modeling)
-- action(`x-decorator-props`):区块的请求类型,`list` 或 `get`
-- params(`x-decorator-props` 和 `x-use-decorator-props`):区块的请求参数,同时存在于
-- filterByTk(`x-use-decorator-props`):相当于 `params.filterByTk`,可理解为 `id`,用于获取单条数据
-- sourceId(`x-use-decorator-props`):区块的 sourceId,配合 `association` 使用,用于获取区块的关系字段数据
-- record(`x-use-decorator-props`):当提供 `record` 时,会使用 `record` 作为区块的数据,不发起请求
-- parentRecord(`x-use-decorator-props`):当提供 `parentRecord` 时,会使用 `parentRecord` 作为关系字段的表数据,不发起请求
+- collection (`x-decorator-props`): The table name of the block's collection, used to retrieve the field information and block data of the block.
+- association (`x-decorator-props`): The name of the relationship field of the block, used to retrieve the relationship field information and data of the block.
+- dataSource (`x-decorator-props`): The data source, refer to [Data Modeling](https://docs.nocobase.com/manual/data-modeling) for details.
+- action (`x-decorator-props`): The request type of the block, either `list` or `get`.
+- params (`x-decorator-props` and `x-use-decorator-props`): The request parameters of the block, exist in both `x-decorator-props` and `x-use-decorator-props`.
+- filterByTk (`x-use-decorator-props`): Equivalent to `params.filterByTk`, can be understood as `id`, used to retrieve a single data.
+- sourceId (`x-use-decorator-props`): The sourceId of the block, used in conjunction with `association` to retrieve the relationship field data of the block.
+- record (`x-use-decorator-props`): When provided, the `record` will be used as the data of the block instead of making a request.
+- parentRecord (`x-use-decorator-props`): When provided, the `parentRecord` will be used as the table data of the relationship field instead of making a request.
```tsx | pure
const DataBlockProvider = (props) => {
@@ -140,57 +140,41 @@ const DataBlockProvider = (props) => {
}
```
-### 属性组合和场景
+### Property Combinations and Scenarios
-这些属性根据不同的场景,共有 8 中情况:
+These properties have 8 different combinations based on different scenarios:
- collection
- - 创建:`collection`
- - 获取单条数据:`collection` + `action: get` + `params`
- - 获取列表数据:`collection` + `action: list` + `params`
- - 使用 `record` 作为数据:`collection` + `record`
+ - Create: `collection`
+ - Get a single data: `collection` + `action: get` + `params`
+ - Get a list of data: `collection` + `action: list` + `params`
+ - Use `record` as data: `collection` + `record`
-对于 *获取单条数据* 和 *获取列表数据* `params` 非必须。
+For *Get a single data* and *Get a list of data*, `params` is optional.
- association
- - 创建:`association` + `sourceId`
- - 获取单条数据:`association` + `sourceId` + `action: get` + `params` + `parentRecord`
- - 获取列表数据:`association` + `sourceId` + `action: list` + `params` + `parentRecord`
- - 使用 `record` 作为数据:`association` + `sourceId` + `record` + `parentRecord`
+ - Create: `association` + `sourceId`
+ - Get a single data: `association` + `sourceId` + `action: get` + `params` + `parentRecord`
+ - Get a list of data: `association` + `sourceId` + `action: list` + `params` + `parentRecord`
+ - Use `record` as data: `association` + `sourceId` + `record` + `parentRecord`
+For *Get a single data* and *Get a list of data*, `params` and `parentRecord` are optional. If `parentRecord` is not provided, it will query the corresponding `collection` based on the `association`, and then query the corresponding `parentRecord` based on the `collection`.
-对于 *获取单条数据* 和 *获取列表数据* `params` 和 `parentRecord` 非必须,当没有 `parentRecord` 会根据 `association` 查询到对应的 `collection`,然后再根据 `collection` 查询到对应的 `parentRecord`。
-
-### 属性获取和修改
+### Property Access and Modification
#### useDataBlock()
-可用于获取和修改 `DataBlockProvider` 的属性。
+Used to access and modify the properties of `DataBlockProvider`.
-- 类型
-
-```tsx | pure
-interface Result
diff --git a/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md b/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md
index 48b5801b34..89047d777c 100644
--- a/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md
+++ b/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md
@@ -1,10 +1,10 @@
# DataBlockRequestProvider
-其内部获取到 [BlockResourceProvider](/core/data-block/data-block-resource-provider) 提供的 `resource`,根据 [BlockProvider](/core/data-block/data-block-provider) 提供的参数,自动调用 `resource.get()` 或者 `resource.list()` 获取的区块的数据,并通过 context 传递下去。
+It internally retrieves the `resource` provided by [BlockResourceProvider](/core/data-block/data-block-resource-provider), and based on the parameters provided by [BlockProvider](/core/data-block/data-block-provider), automatically calls `resource.get()` or `resource.list()` to obtain the block data, which is then passed down through the context.
-## 请求参数
+## Request Parameters
-请求参数是获取 `DataBlockProvider` 提供中的 `params` 和 `filterByTk`。
+The request parameters are obtained from the `params` and `filterByTk` within the `DataBlockProvider`.
```ts | pure
const schema = {
@@ -12,12 +12,12 @@ const schema = {
'x-decorator-props': {
'collection': 'users',
'action': 'list',
- // 静态参数
+ // Static props
params: {
pageSize: 10,
}
},
- // 动态参数
+ // Dynamic props
'x-use-decorator-props': 'useDynamicDataBlockProps',
}
@@ -30,13 +30,13 @@ const useDynamicDataBlockProps: UseDataBlockProps<'CollectionList'> = () => {
}
```
-会自动调用 `resource.list()` 获取数据,发起 `GET /api/users:list?pageSize=10&size=15` 的请求。
+It will automatically call `resource.list()` to fetch the data, making a `GET` request to `/api/users:list?pageSize=10&size=15`.
## Hooks
### useDataBlockRequest()
-用于获取请求对象,一般用区块组件中。
+Used to obtain the request object, typically within block components.
```tsx | pure
const MyTable = () => {
@@ -58,18 +58,18 @@ const MyTable = () => {
## Record
-### Get 请求
+### Get Request
-对于 `get` 请求,当获取到 `data` 数据后,会通过 `CollectionRecordProvider` 提供 `record` 对象,用于获取当前区块的数据。
+For `GET` requests, once the `data` is retrieved, a `record` object is provided through `CollectionRecordProvider`, which is used to obtain the data for the current block.
```ts | pure
const schema = {
'x-decorator': 'DataBlockProvider',
'x-decorator-props': {
'collection': 'users',
- 'action': 'get', // get 请求
+ 'action': 'get', // get request
},
- // 动态参数
+ // Dynamic props
'x-use-decorator-props': 'useDynamicFormProps',
}
@@ -82,19 +82,18 @@ const useDynamicDataBlockProps: UseDataBlockProps<'CollectionGet'> = () => {
}
```
-会自动调用 `resource.get()` 获取数据,发起 `GET /api/users:get/1` 的请求,并通过 `CollectionRecordProvider` 提供上下文。
+It will automatically invoke `resource.get()` to retrieve data, making a `GET` request to `/api/users:get/1`, and provide the context through `CollectionRecordProvider`.
```tsx | pure
const { data } = useDataBlockRequest();
-const record = useCollectionRecord(); // record 上下文数据
+const record = useCollectionRecord(); // record context data
-// 相等
record.data === data;
```
-### List 请求
+### List Request
-对于 `list` 请求则不会提供 `record` 对象,需要自己通过 `
## CollectionFieldOptions
-字段的配置项。
+Configuration options for the field.
```ts
interface CollectionFieldOptions {
@@ -52,13 +52,13 @@ interface CollectionFieldOptions {
}
```
-### 普通字段和关系字段
+### Regular Fields and Relationship Fields
-字段有 2 种情况,一种是普通字段,一种是 [关系字段](https://docs-cn.nocobase.com/development/server/collections/association-fields)。
+There are two types of fields: regular fields and [relationship fields](https://docs-cn.nocobase.com/development/server/collections/association-fields).
-关系字段是指,字段的值是另一个 collection 的数据,例如 `users` 和 `roles` 两个 collection,`users` 中有一个字段 `roles`,其值是 `roles` collection 的数据,那么 `roles` 就是一个关系字段。
+A relationship field refers to a field whose value is data from another collection. For example, if there are two collections, `users` and `roles`, and the `users` collection has a field called `roles` whose value is data from the `roles` collection, then `roles` is a relationship field.
-普通字段的示例如下:
+Here is an example of a regular field:
```json
{
@@ -81,7 +81,7 @@ interface CollectionFieldOptions {
}
```
-关系字段的示例如下:
+Here is an example of a relationship field:
```json
{
@@ -115,24 +115,24 @@ interface CollectionFieldOptions {
}
```
-相对于普通字段,关系字段多了以下属性:
+Compared to regular fields, relationship fields have the following additional properties:
- xx
- xx
-### 全部字段说明
+### Field Descriptions
-- `name`:字段名称
-- `collectionName`:数据表名称
-- `sourceKey`:当字段为关系字段时,对应的关系字段名称。
+- `name`: Field name
+- `collectionName`: Table name
+- `sourceKey`: When the field is a relationship field, it corresponds to the relationship field name.
-TODO:补全
+TODO
## Hooks
### useCollectionField()
-用于获取字段信息。
+Used to retrieve field information.
```tsx | pure
const collection = {
@@ -156,7 +156,7 @@ const { uiSchema } = useCollectionField()
const required = uiSchema?.required
```
-其通常在 [SchemaSettings](/core/ui-schema/schema-settings) 中使用,用来获取和修改字段的属性。
+It is usually used in [SchemaSettings](/core/ui-schema/schema-settings) to retrieve and modify field properties.
diff --git a/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md b/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md
index b37a6a27f9..85261af390 100644
--- a/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md
+++ b/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md
@@ -2,9 +2,9 @@
用于提供 [CollectionManager](/core/data-source/collection-manager) 实例。
-## 组件
+## Component
-- 类型
+- Type
```tsx | pure
interface CollectionManagerProviderProps {
@@ -14,11 +14,11 @@ interface CollectionManagerProviderProps {
}
```
-- 参数详解
- - `dataSource` - 数据源名称,如果为空,则会取默认数据源。
- - `instance` - CollectionManager 实例,如果没有,则会取 `dataSource` 对应的 collectionManager。
+- Parameter Details
+ - `dataSource` - The name of the data source. If empty, the default data source will be used.
+ - `instance` - The CollectionManager instance. If not provided, the collectionManager corresponding to the `dataSource` will be used.
-- 示例
+- Example
```tsx | pure
const collectionManager = new CollectionManager();
@@ -36,9 +36,9 @@ const Demo = () => {
### useCollectionManager()
-用于获取 `CollectionManagerProvider` 传递的实例。
+Used to retrieve the instance passed by `CollectionManagerProvider`.
-- 示例
+- Example
```tsx | pure
const Demo = () => {
diff --git a/packages/core/client/docs/en-US/core/data-source/collection-manager.md b/packages/core/client/docs/en-US/core/data-source/collection-manager.md
index 5df92575d5..51b081c8a8 100644
--- a/packages/core/client/docs/en-US/core/data-source/collection-manager.md
+++ b/packages/core/client/docs/en-US/core/data-source/collection-manager.md
@@ -1,14 +1,14 @@
# CollectionManager
-用于管理 [Collection](./collection.md),其被 [DataSource](./data-source.md) 管理。
+Used to manage [Collection](./collection.md), which is managed by [DataSource](./data-source.md).
-## 实例方法
+## Instance Methods
### addCollections(collections)
-添加数据表。
+Add collections.
-- 类型
+- Type
```tsx | pure
class CollectionManager {
@@ -16,7 +16,7 @@ class CollectionManager {
}
```
-- 示例
+- Example
```tsx | pure
const userCollectionOptions = {
@@ -32,9 +32,9 @@ collectionManager.addCollections([userCollectionOptions]);
### setCollections(collections)
-重置数据表,会先移除所有数据表,然后再调用 `addCollections()` 添加数据表。
+Reset collections, which will remove all collections first, and then call `addCollections()` to add collections.
-- 类型
+- Type
```tsx | pure
class CollectionManager {
@@ -46,7 +46,7 @@ class CollectionManager {
由于 [CollectionTemplate](./collection-template.md) 或者 [CollectionMixins](./collection-mixins.md) 的添加会影响 Collection 的实例化,所以提供了重新添加数据表的方法。
-- 类型
+- Type
```tsx | pure
class CollectionManager {
@@ -54,7 +54,7 @@ class CollectionManager {
}
```
-- 示例
+- Example
```tsx | pure
const userCollectionInstance = collectionManager.getCollection('users');
@@ -63,9 +63,9 @@ collectionManager.reAddCollections([userCollectionInstance]);
### getCollections(predicate?)
-获取数据表。
+Get a collection.
-- 类型
+- Type
```tsx | pure
class CollectionManager {
@@ -73,7 +73,7 @@ class CollectionManager {
}
```
-- 示例
+- Example
```tsx | pure
collectionManager.getCollections(); // [ userCollection ]
@@ -84,9 +84,9 @@ collectionManager.getCollections(collection => collection.name === 'posts'); //
### getCollection(path)
-获取数据表。
+Get a collection.
-- 类型
+- Type
```tsx | pure
class CollectionManager {
@@ -94,12 +94,12 @@ class CollectionManager {
}
```
-- 详细解释
- - `path` 参数可以是数据表名称,也可以是[关系字段](https://docs.nocobase.com/development/server/collections/association-fields)路径。
- - `path: 'users'`: 获取 `users` 数据表
- - `path: 'users.posts'`: 获取 `users` 数据表的 `posts` 关联字段对应的数据表,即 `postCollection`
+- Details
+ - The `path` parameter can be either the name of a collection or a path to a [relationship field](https://docs.nocobase.com/development/server/collections/association-fields).
+ - `path: 'users'`: Get the `users` collection.
+ - `path: 'users.posts'`: Get the collection corresponding to the `posts` associated field of the `users` collection, i.e., `postCollection`.
-- 示例
+- Example
```tsx | pure
collectionManager.getCollection('users'); // userCollection
@@ -108,7 +108,7 @@ collectionManager.getCollection('users.posts'); // postCollection
collectionManager.getCollection('users.profileId'); // profileCollection
```
-结合 Mixin 使用:
+Using Mixins:
```tsx | pure
const collection = collectionManager.getCollection
diff --git a/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md b/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md
index 1ff0bffea6..6729baeb76 100644
--- a/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md
+++ b/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md
@@ -1,14 +1,14 @@
# CollectionTemplateManager
-用于管理 [CollectionTemplate](./collection-template),其被 [DataSourceManager](./data-source-manager) 管理。
+Used to manage [CollectionTemplate](./collection-template), which is managed by [DataSourceManager](./data-source-manager).
-## 实例方法
+## Instance Methods
### addCollectionTemplates()
-用于添加 collection template。
+Used to add collection templates.
-- 类型
+- Type
```tsx | pure
class CollectionTemplateManager {
@@ -16,7 +16,7 @@ class CollectionTemplateManager {
}
```
-- 示例
+- Example
```tsx | pure
class SqlCollectionTemplate extends CollectionTemplate {
@@ -49,9 +49,9 @@ class MyPlugin extends Plugin {
### getCollectionTemplate()
-用于获取 collection template。
+Used to retrieve collection templates.
-- 类型
+- Type
```tsx | pure
class CollectionTemplateManager {
@@ -59,7 +59,7 @@ class CollectionTemplateManager {
}
```
-- 示例
+- Example
```tsx | pure
collectionManager.getCollectionTemplate(); // generalCollectionTemplate
@@ -69,9 +69,9 @@ collectionManager.getCollectionTemplate('tree'); // treeCollectionTemplate
### getCollectionTemplates()
-用于获取所有 collection templates。
+Used to retrieve all collection templates.
-- 类型
+- Type
```tsx | pure
class CollectionTemplateManager {
@@ -79,7 +79,7 @@ class CollectionTemplateManager {
}
```
-- 示例
+- Example
```tsx | pure
collectionManager.getCollectionTemplates(); // [ generalCollectionTemplate, treeCollectionTemplate, sqlCollectionTemplate ]
diff --git a/packages/core/client/docs/en-US/core/data-source/collection-template.md b/packages/core/client/docs/en-US/core/data-source/collection-template.md
index eb248e519e..69846a8473 100644
--- a/packages/core/client/docs/en-US/core/data-source/collection-template.md
+++ b/packages/core/client/docs/en-US/core/data-source/collection-template.md
@@ -1,6 +1,6 @@
# CollectionTemplate
-用于创建数据表的模板。
+Template used for creating data tables.

@@ -15,27 +15,27 @@ interface AvailableFieldInterfacesExclude {
interface CollectionTemplateDefaultOptions {
/**
- * 自动生成 id
+ * Auto-generate id
* @default true
* */
autoGenId?: boolean;
- /** 创建人 */
+ /** Created by */
createdBy?: boolean;
- /** 最后更新人 */
+ /** Updated by */
updatedBy?: boolean;
- /** 创建日期 */
+ /** Created at */
createdAt?: boolean;
- /** 更新日期 */
+ /** Updated at */
updatedAt?: boolean;
- /** 可排序 */
+ /** Sortable */
sortable?: boolean;
- /* 树结构 */
+ /* Tree structure */
tree?: string;
- /* 日志 */
+ /* Logging */
logging?: boolean;
- /** 继承 */
+ /** Inherits */
inherits?: string | string[];
- /* 字段列表 */
+ /* Field list */
fields?: CollectionOptions['fields'];
}
@@ -48,27 +48,27 @@ class CollectionTemplate {
transform?: (collection: CollectionOptions, app: Application) => CollectionOptions;
title?: string;
color?: string;
- /** 排序 */
+ /** Order */
order?: number;
- /** 默认配置 */
+ /** Default configuration */
default?: CollectionTemplateDefaultOptions;
events?: any;
- /** UI 可配置的 CollectionOptions 参数(添加或编辑的 Collection 表单的字段) */
+ /** UI configurable CollectionOptions parameters (fields in the form for adding or editing Collection) */
configurableProperties?: Record
## APIClientProvider
-提供 APIClient 实例的上下文。
-
-```tsx | pure
-const apiClient = new APIClient();
-
-(
);
```
-支持 `axios.request(config)`,config 详情查看 [axios](https://github.com/axios/axios#request-config)
+Supports `axios.request(config)`, for more details on the config, please refer to the [axios documentation](https://github.com/axios/axios#request-config).
```ts
const { data, loading, refresh, run, params } = useRequest({ url: '/users' });
-// useRequest 里传的是 AxiosRequestConfig,所以 run 里传的也是 AxiosRequestConfig
+// Since AxiosRequestConfig is passed in useRequest, AxiosRequestConfig should also be passed in run
run({
params: {
pageSize: 20,
@@ -90,11 +80,11 @@ run({
});
```
-例子如下:
+例子如下:
-或者是 NocoBase 的 resource & action 请求:
+Or it can be a NocoBase resource & action request:
```ts
const { data, run } = useRequest({
@@ -105,17 +95,17 @@ const { data, run } = useRequest({
},
});
-// useRequest 传的是 ResourceActionOptions,所以 run 直接传 action params 就可以了。
+// Since useRequest is passed ResourceActionOptions, you can directly pass action params to run.
run({
pageSize: 50,
});
```
-例子如下:
+Example as follows:
-也可以是自定义的异步函数:
+It can also be a custom asynchronous function:
```ts
const { data, loading, run, refresh, params } = useRequest((...params) => Promise.resolve({}));
@@ -123,7 +113,7 @@ const { data, loading, run, refresh, params } = useRequest((...params) => Promis
run(...params);
```
-更多用法查看 ahooks 的 [useRequest()](https://ahooks.js.org/hooks/use-request/index)
+For more usage, please refer to [useRequest()](https://ahooks.js.org/hooks/use-request/index) in ahooks.
## useResource
@@ -131,21 +121,19 @@ run(...params);
function useResource(name: string, of?: string | number): IResource;
```
-资源是 NocoBase 的核心概念,包括:
+Resources are the core concept of NocoBase, including:
-- 独立资源,如 `posts`
-- 关系资源,如 `posts.tags` `posts.user` `posts.comments`
+- Independent resources, such as `posts`
+- Related resources, such as `posts.tags`, `posts.user`, `posts.comments`
-资源 URI
+Resource URI
```bash
-# 独立资源,文章
/api/posts
-# 关系资源,文章 ID=1 的评论
/api/posts/1/comments
```
-通过 APIClient 获取资源
+Retrieve resources via `APIClient`.
```ts
const api = new APIClient();
@@ -154,14 +142,14 @@ api.resource('posts');
api.resource('posts.comments', 1);
```
-useResource 用法:
+`useResource` Usage:
```ts
const resource = useResource('posts');
const resource = useResource('posts.comments', 1);
```
-resource 的实际场景用例参见:
+For actual use cases of `resource`, please refer to:
- [useCollection()](collection-manager#usecollection)
- [useCollectionField()](collection-manager#usecollectionfield)
diff --git a/packages/core/client/docs/en-US/core/ui-schema/designable.md b/packages/core/client/docs/en-US/core/ui-schema/designable.md
index 75b151b260..fd018035b8 100644
--- a/packages/core/client/docs/en-US/core/ui-schema/designable.md
+++ b/packages/core/client/docs/en-US/core/ui-schema/designable.md
@@ -2,7 +2,7 @@
## Designable
-对 Schema 节点进行增、删、改操作,并且提供了事件触发机制,用于将数据同步到服务端。
+Perform add, delete, and update operations on Schema nodes, and provide an event triggering mechanism to synchronize data to the server.
```tsx | pure
interface Options {
@@ -38,16 +38,16 @@ class Designable {
}
```
-### 构造函数
+### Constructor
-- 参数讲解
+- Params
+ - `current`: The Schema node to operate on
+ - `api`: An instance of [APIClient](https://docs.nocobase.com/api/sdk) used to make backend requests
+ - `onSuccess`: Callback function to be executed after a successful backend API request
+ - `refresh`: Function to refresh the page after updating the node
+ - `t`: The return value of `useTranslation()`
- - `current`:需要操作的 Schema 节点
- - `api`:用于发起后端请求的 [APIClient](https://docs.nocobase.com/api/sdk) 实例
- - `onSuccess`:后端接口请求成功后的回调
- - `refresh`:用于更新节点后,刷新页面
- - `t`:`useTranslation()` 的返回值
-- 示例
+- Example
```tsx | pure
const schema = new Schema({
@@ -59,7 +59,7 @@ const schema = new Schema({
const dn = new Designable({ current: schema });
```
-### Schema 操作方法
+### Schema Operation Methods
```tsx | pure
const schema = new Schema({
@@ -117,7 +117,7 @@ export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}; #### remove -移除当前节点 +Remove the current node. ```tsx | pure dn.remove(); @@ -174,7 +174,7 @@ export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}; #### insertBeforeBegin -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 +Insert before the current node and trigger the `insertAdjacent` event. ```tsx | pure dn.insertBeforeBegin({ @@ -240,7 +240,7 @@ export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}; #### insertAfterBegin -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 +Insert after the current node and trigger the `insertAdjacent` event. ```tsx | pure dn.insertAfterBegin({ @@ -307,7 +307,7 @@ export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}; #### insertBeforeEnd -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 +Insert after the current node and trigger the `insertAdjacent` event. ```tsx | pure dn.insertBeforeEnd({ @@ -374,7 +374,7 @@ export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}; #### insertAfterEnd -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 +Insert after the current node and trigger the `insertAdjacent` event. ```tsx | pure dn.insertAfterEnd({ @@ -441,7 +441,7 @@ export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}; #### insertAdjacent -根据第一个参数决定插入的位置,是前面四个方法的封装。 +Determines the insertion position based on the first parameter, which is a wrapper for the previous four methods. ```tsx | pure class Designable { @@ -449,19 +449,19 @@ class Designable { } ``` -### 事件监听和 API 请求 +### Event Listeners and API Requests -- `on` :添加事件监听的基础方法 -- `loadAPIClientEvents`:调用 `on` 方法添加对 `insertAdjacent`、`patch`、`batchPatch`、`remove` 的事件的监听,主要功能是将变更的 Schema 更新到服务端 -- `emit`:是根据事件名称,调用之前注册过的方法,具体是由前面讲过的 *插入操作和删除操作* 触发 +- `on`: The basic method for adding event listeners. +- `loadAPIClientEvents`: Calls the `on` method to add event listeners for `insertAdjacent`, `patch`, `batchPatch`, and `remove` events. Its main function is to update the changed schema on the server. +- `emit`: Calls the previously registered methods based on the event name, triggered by *insertion and deletion operations*. -而 `loadAPIClientEvents()` 并非在初始化时调用,需要手动调用,换而言之,如果不调用 `dn.loadAPIClientEvents()`,则不会将更新发送到服务端,主要是简化在单测或者 DEMO 环境对服务端的 Mock。 +`loadAPIClientEvents()` is not called during initialization and needs to be manually called. In other words, if `dn.loadAPIClientEvents()` is not called, the updates will not be sent to the server. This is mainly used to simplify mocking the server in unit tests or demo environments. -## 工具函数 +## Utility Functions ### createDesignable() -对 `new Designable()` 的简单封装。 +A simple wrapper for `new Designable()`. ```tsx | pure function createDesignable(options: CreateDesignableProps) { @@ -477,16 +477,16 @@ const dn = createDesignable({ current: schema }); ### useFieldSchema() -用户获取当前节点 Schema JSON 对象,更多信息请参考 [formily useFieldSchema()](https://react.formilyjs.org/api/hooks/use-field-schema)。 +Used to get the current node's Schema JSON object. For more information, please refer to [formily useFieldSchema()](https://react.formilyjs.org/api/hooks/use-field-schema). -- 类型 +- Type ```tsx | pure import { Schema } from '@formily/json-schema'; const useFieldSchema: () => Schema; ``` -- 示例 +- Example ```tsx /** @@ -505,11 +505,11 @@ const Demo = ({ children }) => { const schema = { type: 'void', name: 'hello', - 'x-component': 'Demo', // 这里是 Demo 组件 + 'x-component': 'Demo', 'properties': { 'world': { 'type': 'void', - 'x-component': 'Demo', // 这里也是 Demo 组件 + 'x-component': 'Demo', }, } } @@ -527,16 +527,16 @@ export default app.getRootComponent(); ### useField() -获取当前节点 Schema 实例,更多信息请参考 [formily useField()](https://react.formilyjs.org/api/hooks/use-field) +Get the current node's Schema instance. For more information, please refer to [formily useField()](https://react.formilyjs.org/api/hooks/use-field). -- 类型 +- Type ```tsx | pure import { GeneralField } from '@formily/core'; const useField:
-#### 定制化 `Component`
+#### Custom `Component`
```tsx | pure
const myInitializer = new SchemaInitializer({
@@ -113,9 +110,9 @@ const myInitializer = new SchemaInitializer({
-#### 不使用 Popover
+#### Not Using Popover
-关于 `useDesignable()` 的说明请参考 [useDesignable](/core/ui-schema/designable#usedesignable)。
+Please refer to [useDesignable](/core/ui-schema/designable#usedesignable) for more information about `useDesignable()`.
```tsx | pure
const schema = {
@@ -139,7 +136,7 @@ const myInitializer = new SchemaInitializer({
-#### 定制化 Items
+#### Custom Items
```tsx | pure
const CustomListGridMenu: FC
-## options.items 配置详解
+## options.items
-### 类型
+### Types
```tsx | pure
interface SchemaInitializerComponentCommonProps {
@@ -201,15 +198,13 @@ interface SchemaInitializerItemBaseType
-### `children` 和动态方式 `useChildren`
+### `children` and dynamic `useChildren`
-对于某些组件而言是有子列表项的,例如 `type: 'itemGroup'`,那么我们使用 children 属性,同时考虑到某些场景下 children 是动态的,需要从 Hooks 里面获取,那么就可以通过 `useChildren` 来定义。
+For some components that have child items, such as `type: 'itemGroup'`, we use the `children` property. However, in certain scenarios where the children are dynamic and need to be obtained from hooks, we can define them using `useChildren`.
-### 动态显示隐藏 `useVisible`
+### Dynamic visibility with `useVisible`
-### 组件属性 `componentProps` 和动态属性 `useComponentProps`
+### Component properties `componentProps` and dynamic properties `useComponentProps`
-对于一些通用组件,我们可以通过 `componentProps` 来定义组件属性,同时考虑到某些场景下组件属性是动态的,需要从 Hooks 里面获取,那么就可以通过 `useComponentProps` 来定义。
+For some common components, we can define component properties using `componentProps`. In certain scenarios where the component properties are dynamic and need to be obtained from hooks, we can define them using `useComponentProps`.
-当然也可以不使用这两个属性,直接封装成一个组件,然后通过 `Component` 来定义。
+Of course, you can also encapsulate them into a component and define them using the `Component` property.
-### 公共属性和组件属性
+### Common properties and component properties
```tsx | pure
{
@@ -277,15 +272,15 @@ const myInitializer = new SchemaInitializer({
}
```
-从上面的示例中我么看到,从配置项中获取组件组件所需的数据有两个方式:
+From the above example, we can see that there are two ways to obtain the data required by the component from the configuration:
-- 组件属性:通过 `componentProps` 来定义,例如 `zzz: 'xxx'`
-- 公共属性:将属性直接定义在配置项上,例如 `foo: 'bar'`、`name`、`title`
+- Component properties: defined through `componentProps`, for example `zzz: 'xxx'`
+- Common properties: directly defined on the configuration item, for example `foo: 'bar'`, `name`, `title`
-在获取上
+In terms of retrieval:
-- `componentProps` 定义的数据会被传递给组件的 `props`
-- 直接定义在配置项上的数据会则需要通过 [useSchemaInitializerItem()](/core/ui-schema/schema-initializer#useschemainitializeritem) 获取
+- Data defined in `componentProps` will be passed to the component's `props`
+- Data directly defined on the configuration item needs to be obtained through [useSchemaInitializerItem()](/core/ui-schema/schema-initializer#useschemainitializeritem)
```tsx | pure
const Demo = (props) => {
@@ -294,7 +289,7 @@ const Demo = (props) => {
}
```
-## 实例方法
+## Methods
```tsx | pure
const myInitializer = new SchemaInitializer({
@@ -352,9 +347,9 @@ export default app.getRootComponent();
### schemaInitializer.add()
-用于新增 Item,另一种添加方式参考 [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanageradditem);
+Used to add a new item. Another way to add items is through [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanageradditem);
-- 类型
+- Type
```tsx | pure
class SchemaInitializer {
@@ -362,11 +357,11 @@ class SchemaInitializer {
}
```
-- 参数说明
+- params
-第一个参数是 name,作为唯一标识,用于增删改查,并且 `name` 支持 `.` 用于分割层级。
+The first parameter is `name`, which serves as a unique identifier for adding, deleting, modifying, and querying. The `name` also supports `.` as a delimiter for hierarchical separation.
-- 示例
+- Example
```tsx | pure
myInitializer.add('b', {
@@ -428,7 +423,7 @@ export default app.getRootComponent();
### schemaInitializer.get()
-- 类型
+- Type
```tsx | pure
class SchemaInitializer {
@@ -436,7 +431,7 @@ class SchemaInitializer {
}
```
-- 示例
+- Example
```tsx | pure
const itemA = myInitializer.get('a')
@@ -446,9 +441,9 @@ const itemA1 = myInitializer.add('a.a1')
### schemaInitializer.remove()
-另一种移除方式参考 [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanagerremoveitem);
+Another way to remove items can be found in [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanagerremoveitem);
-- 类型
+- Type
```tsx | pure
class SchemaInitializer {
@@ -456,7 +451,7 @@ class SchemaInitializer {
}
```
-- 示例
+- Example
```tsx | pure
myInitializer.remove('a.a1')
@@ -468,9 +463,9 @@ myInitializer.remove('a')
### useSchemaInitializer()
-用于获取 `SchemaInitializer` 上下文内容。
+Used to retrieve the context content of `SchemaInitializer`.
-- 类型
+- Type
```tsx | pure
export type InsertType = (s: ISchema) => void;
@@ -483,13 +478,13 @@ const useSchemaInitializer: () => {
}
```
-- 参数详解
- - `insert`:参数是 Schema 对象,用于插入 Schema
- - `options`:获取 `new SchemaInitializer(options)` 时 options 配置
- - `visible`:popover 是否显示
- - `setVisible`:设置 popover 显示状态
+- Parameter Details
+ - `insert`: The parameter is a Schema object used to insert the Schema.
+ - `options`: The options configuration when obtaining `new SchemaInitializer(options)`.
+ - `visible`: Whether the popover is displayed.
+ - `setVisible`: Sets the visibility status of the popover.
-- 示例
+- Example
```tsx | pure
const schema = {
@@ -507,9 +502,9 @@ const Demo = () => {
### useSchemaInitializerRender()
-用于渲染 `SchemaInitializer`。
+Used to render `SchemaInitializer`.
-- 类型
+- Type
```tsx | pure
function useSchemaInitializerRender(name: string, options?: SchemaInitializerOptions): {
@@ -518,11 +513,11 @@ function useSchemaInitializerRender(name: string, options?: SchemaInitializerOpt
}
```
-- 参数详解
+- Details
-返回的 `render` 方法可以接收一个参数,用于覆盖 `new SchemaInitializer(options)` 的 `options` 配置。
+The returned `render` method can accept a parameter to override the `options` configuration of `new SchemaInitializer(options)`.
-- 示例
+- Example
```tsx | pure
const Demo = () => {
@@ -539,15 +534,15 @@ const Demo = () => {
### useSchemaInitializerItem()
-用于获取配置项内容的,配置项是指的 `SchemaInitializer` 中的 `items` 中的一项。
+Used to retrieve the content of a configuration item, where the configuration item refers to one item in the `items` property of `SchemaInitializer`.
-- 类型
+- Type
```tsx | pure
const useSchemaInitializerItem:
-## 内置组件和类型
+## Built-in Components and Types
-| type | Component | 效果 |
+| type | Component | |
| ----------- | ------------------------------ | ----------------------------------------- |
-| item | SchemaInitializerItem | 文本|
-| itemGroup | SchemaInitializerItemGroup | 分组,同 antd `Menu` 组件的 `type: 'group'` |
-| subMenu | SchemaInitializerSubMenu | 子菜单,同 antd `Menu` 组件的子菜单 |
-| divider | SchemaInitializerDivider | 分割线,同 antd `Menu` 组件的 `type: 'divider'` |
-| switch | SchemaInitializerSwitch | 开关 |
-| actionModal | SchemaInitializerActionModal | 弹窗|
+| item | SchemaInitializerItem | Text |
+| itemGroup | SchemaInitializerItemGroup | Group, similar to antd `Menu` component with `type: 'group'` |
+| subMenu | SchemaInitializerSubMenu | Submenu, similar to antd `Menu` component's submenu |
+| divider | SchemaInitializerDivider | Divider, similar to antd `Menu` component with `type: 'divider'` |
+| switch | SchemaInitializerSwitch | Switch |
+| actionModal | SchemaInitializerActionModal | Modal|
-以下每个示例都提供了 2 种[定义方式](/core/ui-schema/schema-initializer#两种定义方式component-和-type),一种是通过 `Component` 定义,另一种是通过 `type` 定义。
+The following examples provide two [definition methods](/core/ui-schema/schema-initializer#two-ways-to-define-component-and-type), one is defined through `Component`, and the other is defined through `type`.
### `type: 'item'` & `SchemaInitializerItem`
-文本项。
+Text。
```tsx | pure
interface SchemaInitializerItemProps {
@@ -609,7 +604,7 @@ interface SchemaInitializerItemProps {
}
```
-核心参数是 `title`、`icon`、`onClick`、`items`,其中 `onClick` 用于插入 Schema,`items` 用于渲染子列表项。
+The core parameters are `title`, `icon`, `onClick`, and `items`. Among them, `onClick` is used to insert Schema, and `items` is used to render child list items.
@@ -626,13 +621,13 @@ interface SchemaInitializerItemGroupProps {
}
```
-核心参数是 `title`、`children`,其中 `children` 用于渲染子列表项,`divider` 用于渲染分割线。
+The core parameters are `title`, `children`, and `divider`. Among them, `children` is used to render child list items, and `divider` is used to render a divider.
### `type: 'switch'` & SchemaInitializerSwitch
-Switch 切换按钮。
+Switch Button.
```tsx | pure
interface SchemaInitializerSwitchItemProps extends SchemaInitializerItemProps {
@@ -641,20 +636,18 @@ interface SchemaInitializerSwitchItemProps extends SchemaInitializerItemProps {
}
```
-核心参数是 `checked`、`onClick`,其中 `onClick` 用于插入或者移除 Schema。
+The core parameters are `checked` and `onClick`, where `onClick` is used to insert or remove Schema.
### `type: 'subMenu'` & SchemaInitializerSubMenu
-子菜单。
+Sub menu.
### `type: 'divider'` & SchemaInitializerDivider
-分割线。
-
### `type: 'actionModal'` & SchemaInitializerActionModal
@@ -665,15 +658,15 @@ interface SchemaInitializerSwitchItemProps extends SchemaInitializerItemProps {
#### Item Mode
-`SchemaInitializerActionModal` 需要加上 `isItem` 属性
+`SchemaInitializerActionModal` needs to add the `isItem` property.
-## 渲染组件
+## Render Components
### SchemaInitializerChildren
-用于自定义渲染多个列表项。
+Used to customize the rendering of multiple list items.
```tsx | pure
@@ -707,7 +700,7 @@ const myInitializer = new SchemaInitializer({
### SchemaInitializerChild
-用于自定义渲染单个列表项。
+Used to customize the rendering of individual list items.
```tsx | pure
const Demo = (props) => {
diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md b/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md
index e4f43a33d9..f7d6179777 100644
--- a/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md
+++ b/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md
@@ -1,12 +1,12 @@
# SchemaSettingsManager
-## 实例方法
+## Methods
### schemaSettingsManager.add()
-添加 SchemaSettings 实例。
+Used to add a SchemaSettings instance.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -14,7 +14,7 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
const mySchemaSettings = new SchemaSetting({
@@ -40,9 +40,9 @@ class MyPlugin extends Plugin {
### schemaSettingsManager.get()
-获取一个 SchemaSettings 实例。
+Get a SchemaSettings instance.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -50,7 +50,7 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
class MyPlugin extends Plugin {
@@ -62,9 +62,9 @@ class MyPlugin extends Plugin {
### schemaSettingsManager.getAll()
-获取所有的 SchemaSettings 实例。
+Get all SchemaSettings instances.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -72,7 +72,7 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
class MyPlugin extends Plugin {
@@ -84,9 +84,9 @@ class MyPlugin extends Plugin {
### app.schemaSettingsManager.has()
-判断是否有存在某个 SchemaSettings 实例。
+Check if a specific SchemaSettings instance exists.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -94,7 +94,7 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
class MyPlugin extends Plugin {
@@ -106,9 +106,9 @@ class MyPlugin extends Plugin {
### schemaSettingsManager.remove()
-移除 SchemaSettings 实例。
+Remove SchemaSettings instance.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -116,7 +116,7 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
class MyPlugin extends Plugin {
@@ -128,9 +128,9 @@ class MyPlugin extends Plugin {
### schemaSettingsManager.addItem()
-添加 SchemaSettings 实例的 Item 项,其和直接 schemaInitializer.add() 方法的区别是,可以确保在实例存在时才会添加。
+Add an Item to the SchemaSettings instance, the difference between this method and directly calling schemaInitializer.add() is that it can ensure that the item is added only when the instance exists.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -138,18 +138,18 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
class MyPlugin extends Plugin {
async load() {
- // 方式1:先获取,再添加子项,需要确保已注册
+ // Method 1: Get first, then add sub-items, make sure it is registered
const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings');
if (mySchemaSettings) {
mySchemaSettings.add('b', { type: 'item', componentProps:{ title: 'B' } })
}
- // 方式2:通过 addItem,内部确保在 mySchemaSettings 注册时才会添加
+ // Method 2: Use addItem, ensure that it is added only when MySchemaSettings is registered
this.app.schemaSettingsManager.addItem('MySchemaSettings', 'b', {
type: 'item',
componentProps:{ title: 'B' }
@@ -160,9 +160,9 @@ class MyPlugin extends Plugin {
### schemaSettingsManager.removeItem()
-移除 实例的 Item 项,其和直接 schemaInitializer.remove() 方法的区别是,可以确保在实例存在时才会移除。
+Remove an Item from the SchemaSettings instance, the difference between this method and directly calling schemaInitializer.remove() is that it can ensure that the item is removed only when the instance exists.
-- 类型
+- Type
```tsx | pure
class SchemaSettingsManager {
@@ -170,18 +170,18 @@ class SchemaSettingsManager {
}
```
-- 示例
+- Example
```tsx | pure
class MyPlugin extends Plugin {
async load() {
- // 方式1:先获取,再删除子项,需要确保已注册
+ // Method 1: Get first, then remove sub-items, make sure it is registered
const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings');
if (mySchemaSettings) {
mySchemaSettings.remove('a')
}
- // 方式2:通过 addItem,内部确保在 mySchemaSettings 注册时才会移除
+ // Method 2: Use addItem, ensure that it is removed only when MySchemaSettings is registered
this.app.schemaSettingsManager.remove('MySchemaSettings', 'a')
}
}
diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md b/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md
index b374cbdfa2..3a06c6dd4f 100644
--- a/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md
+++ b/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md
@@ -2,7 +2,7 @@
## new SchemaSettings(options)
-创建一个 SchemaSettings 实例。
+Create a SchemaSettings instance.
```tsx | pure
interface SchemaSettingsOptions
-### `children` 和动态方式 `useChildren`
+### `children` and dynamic `useChildren`
-对于某些组件而言是有子列表项的,例如 `type: 'itemGroup'`,那么我们使用 children 属性,同时考虑到某些场景下 children 是动态的,需要从 Hooks 里面获取,那么就可以通过 `useChildren` 来定义。
+For some components that have child items, such as `type: 'itemGroup'`, we use the `children` property. In certain scenarios where the children are dynamic and need to be obtained from hooks, we can define them using `useChildren`.
-### 动态显示隐藏 `useVisible`
+### Dynamic visibility with `useVisible`
-### 组件属性 `componentProps` 和动态属性 `useComponentProps`
+### Component properties `componentProps` and dynamic properties `useComponentProps`
-对于一些通用组件,我们可以通过 `componentProps` 来定义组件属性,同时考虑到某些场景下组件属性是动态的,需要从 Hooks 里面获取,那么就可以通过 `useComponentProps` 来定义。
+For some common components, we can define component properties using `componentProps`. In certain scenarios where the component properties are dynamic and need to be obtained from hooks, we can define them using `useComponentProps`.
-当然也可以不使用这两个属性,直接封装成一个组件,然后通过 `Component` 来定义。
+Alternatively, we can encapsulate the properties into a component and define them using `Component`.
-## 实例方法
+## Methods
```tsx | pure
const mySchemaSettings = new SchemaSettings({
@@ -189,9 +187,9 @@ const mySchemaSettings = new SchemaSettings({
### schemaSettings.add()
-用于新增 Item。
+Use for adding an item.
-- 类型
+- Type
```tsx | pure
class SchemaSettings {
@@ -199,11 +197,11 @@ class SchemaSettings {
}
```
-- 参数说明
+- params
-第一个参数是 name,作为唯一标识,用于增删改查,并且 `name` 支持 `.` 用于分割层级。
+The first parameter is `name`, which is used as a unique identifier for adding, deleting, modifying, and querying, and `name` supports `.` to separate levels.
-- 示例
+- Example
```tsx | pure
mySchemaSetting.add('b', {
@@ -219,7 +217,7 @@ mySchemaSetting.add('a.a2', {
### schemaSettings.get()
-- 类型
+- Type
```tsx | pure
class SchemaSettings {
@@ -227,7 +225,7 @@ class SchemaSettings {
}
```
-- 示例
+- Example
```tsx | pure
const itemA = mySchemaSetting.get('a')
@@ -237,7 +235,7 @@ const itemA1 = mySchemaSetting.add('a.a1')
### schemaSettings.remove()
-- 类型
+- Type
```tsx | pure
class SchemaSettings {
@@ -245,7 +243,7 @@ class SchemaSettings {
}
```
-- 示例
+- Example
```tsx | pure
mySchemaSetting.remove('a.a1')
@@ -257,9 +255,9 @@ mySchemaSetting.remove('a')
### useSchemaSettingsRender()
-用于渲染 SchemaSettings。
+Use to render SchemaSettings.
-- 类型
+- Type
```tsx | pure
function useSchemaSettingsRender(name: string, options?: SchemaSettingsOptions): {
@@ -268,7 +266,7 @@ function useSchemaSettingsRender(name: string, options?: SchemaSettingsOptions):
}
```
-- 示例
+- Example
```tsx | pure
const Demo = () => {
@@ -285,11 +283,11 @@ const Demo = () => {
### useSchemaSettings()
-获取 schemaSetting 上下文数据。
+Get the schemaSetting context data.
-上下文数据包含了 `schemaSetting` 实例化时的 `options` 以及调用 `useSchemaSettingsRender()` 时传入的 `options`。
+The context data includes the `options` passed when instantiating the `schemaSetting` and the `options` passed when calling `useSchemaSettingsRender()`.
-- 类型
+- Type
```tsx | pure
interface UseSchemaSettingsResult
### SchemaSettingsItemGroup
-分组,对应的 `type` 为 `itemGroup`。
-
-核心参数是 `title`。
+The core parameter is `title`.
### SchemaSettingsSubMenu
-子菜单,对应的 `type` 为 `subMenu`。
-
-核心参数是 `title`。
+The core parameter is `title`.
### SchemaSettingsDivider
-分割线,对应的 `type` 为 `divider`。
-
### SchemaSettingsRemove
-删除,对应的 `type` 为 `remove`。
-
```tsx | pure
interface SchemaSettingsRemoveProps {
confirm?: ModalFuncProps;
@@ -399,32 +387,24 @@ interface SchemaSettingsRemoveProps {
}
```
-- `confirm`:删除前的确认弹窗
-- `removeParentsIfNoChildren`:如果删除后没有子节点了,是否删除父节点
-- `breakRemoveOn`:如果删除的节点满足条件,是否中断删除
+- `confirm`: Confirmation modal before deletion
+- `removeParentsIfNoChildren`: Whether to delete the parent node if there are no children after deletion
+- `breakRemoveOn`: Whether to interrupt deletion if the deleted node meets certain conditions
### SchemaSettingsSelectItem
-选择器,对应的 `type` 为 `select`。
-
### SchemaSettingsCascaderItem
-级联选择,对应的 `type` 为 `cascader`。
-
### SchemaSettingsSwitchItem
-开关,对应的 `type` 为 `switch`。
-
### SchemaSettingsModalItem
-弹窗,对应的 `type` 为 `modal`。
-
```tsx | pure
export interface SchemaSettingsModalItemProps {
title: string;
@@ -444,15 +424,13 @@ export interface SchemaSettingsModalItemProps {
}
```
-我们可以通过 `schema` 参数来定义弹窗的表单,然后在 `onSubmit` 中获取表单的值,然后修改当前 schema 节点。
+We can define the form of the modal using the `schema` parameter, and then retrieve the form values in the `onSubmit` function to modify the current schema node.
### SchemaSettingsActionModalItem
-操作弹窗,对应的 `type` 为 `actionModal`。
-
-其和 `modal` 的区别是,`SchemaSettingsModalItem` 弹窗会丢失上下文,而 `SchemaSettingsActionModalItem` 会保留上下文,简单场景下可以使用 `SchemaSettingsModalItem`,复杂场景下可以使用 `SchemaSettingsActionModalItem`。
+The difference between `SchemaSettingsActionModalItem` and `SchemaSettingsModalItem` is that the `SchemaSettingsModalItem` modal will lose context, while the `SchemaSettingsActionModalItem` will retain context. In simple scenarios, you can use `SchemaSettingsModalItem`, and in complex scenarios, you can use `SchemaSettingsActionModalItem`.
```tsx | pure
export interface SchemaSettingsActionModalItemProps extends SchemaSettingsModalItemProps, Omit
+
+### Custom Component
+
+- component
+
+
+
+### Dynamic Props
+
+Here, the ability of `x-use-component-props` is used. For more information, please refer to [x-use-component-props](https://docs.nocobase.com/development/client/ui-schema/what-is-ui-schema#x-component-props-and-x-use-component-props).
+
+
+
+### Confirm
+
+- confirm
+
+
+
+## Action.Link
+
+Replace the `Button` component with an `a` tag.
+
+
+
+## Action.Drawer
+
+Used to pop up a drawer on the right side.
+
+```ts
+interface ActionDrawer extends DrawerProps {}
+```
+
+### Basic Usage
+
+- `DrawerProps`
+
+
+
+### openSize
+
+
+
+### Footer
+
+The Footer can contain buttons such as Cancel or Submit.
+
+Its Schema `x-component` must be set to the `Action.Drawer.Footer` component.
+
+
+
+### With Form
+
+
+
+## Action.Modal
+
+```ts
+interface ActionModal extends ModalProps {}
+```
+
+Its usage is similar to `Action.Drawer`, here is just one example.
+
+
+
+## Action.Popover
+
+Note that the `popover` property of Action must be set to `true`.
+
+
+
+## Action.Container
+
+When rendering content dynamically as needed, you can use `Action.Container` + Action `openMode` property to make dynamic decisions.
+
+
+
+## ActionBar
+
+Generally used for the top operation buttons of a section, it automatically handles layout and rendering of [schema-initializer](/core/ui-schema/schema-initializer).
+
+```ts
+import { SpaceProps } from 'antd'
+
+interface ActionBarProps {
+ layout?: 'one-column' | 'two-columns';
+ style?: CSSProperties;
+ className?: string;
+ spaceProps?: SpaceProps;
+}
+```
+
+### one-column
+
+One-column layout, aligned to the left.
+
+The `x-action` in the Schema is the unique identifier for the button, which should not be duplicated with existing ones. It is used for searching and deleting in `ActionInitializer`.
+
+
+
+### two-columns
+
+Two-column layout, controlled by `x-align`.
+
+
+
+## ActionContext
+
+Encapsulated inside the `Action` component, used for passing context.
+
+```ts
+export type OpenSize = 'small' | 'middle' | 'large';
+export interface ActionContextProps {
+ button?: React.JSX.Element;
+ visible?: boolean;
+ setVisible?: (v: boolean) => void;
+ openMode?: 'drawer' | 'modal' | 'page';
+ snapshot?: boolean;
+ openSize?: OpenSize;
+ /**
+ * Customize the position of the pop-up window
+ */
+ containerRefKey?: string;
+ formValueChanged?: boolean;
+ setFormValueChanged?: (v: boolean) => void;
+ fieldSchema?: Schema;
+ drawerProps?: DrawerProps;
+ modalProps?: ModalProps;
+ submitted?: boolean;
+ setSubmitted?: (v: boolean) => void;
+}
+```
+
+Assuming that the Action component cannot meet the requirements, we can directly use the ActionContext component for customization.
+
+
+
+## ActionSchemaToolbar
+
+Used to render a single button with [SchemaToolbar](/core/ui-schema/schema-toolbar) and [SchemaSettings](/core/ui-schema/schema-settings).
+
+
+
+## Hooks
+
+### useActionContext()
+
+Get the `ActionContext` context.
+
+```ts
+const { visible, setVisible, fieldSchema } = useActionContext();
+```
diff --git a/packages/core/client/src/schema-component/antd/association-select/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/association-select/demos/demo1.tsx
index bc90b74845..49f9b27f7f 100644
--- a/packages/core/client/src/schema-component/antd/association-select/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/association-select/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { APIClientProvider, AssociationSelect, FormProvider, SchemaComponent } from '@nocobase/client';
import React from 'react';
diff --git a/packages/core/client/src/schema-component/antd/association-select/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/association-select/demos/new-demos/basic.tsx
index 325dd0a444..4ca677f13d 100644
--- a/packages/core/client/src/schema-component/antd/association-select/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/association-select/demos/new-demos/basic.tsx
@@ -1,40 +1,45 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import { mockApp } from '@nocobase/client/demo-utils';
+import React from 'react';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'AssociationSelect',
- 'x-component-props': {
- service: {
- resource: 'roles', // roles 表
- action: 'list', // 列表接口
- },
- fieldNames: {
- label: 'title', // 显示的字段
- value: 'name', // 值字段
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'AssociationSelect',
+ 'x-component-props': {
+ service: {
+ resource: 'roles', // roles 表
+ action: 'list', // 列表接口
+ },
+ fieldNames: {
+ label: 'title', // 显示的字段
+ value: 'name', // 值字段
},
},
},
},
- delayResponse: 500,
+};
+
+const Demo = () => {
+ return = RemoteSelectProps
& {
+ action?: string;
+ multiple?: boolean;
+};
+```
+
+## Basic Usage
+
+ = SelectProps & {
+ onChange?: (v: any) => void;
+ /**
+ * useRequest() `debounceWait` parameter
+ */
+ wait?: number;
+ /**
+ * useRequest() `manual` parameter
+ * @default true
+ */
+ manual?: boolean;
+ targetField?: any;
+ /**
+ * useRequest() `service` parameter
+ */
+ service: ResourceActionOptions ;
+ target: string;
+ mapOptions?: (data: any) => SelectProps['fieldNames'];
+ dataSource?: string;
+ CustomDropdownRender?: (v: any) => any;
+ optionFilter?: (option: any) => boolean;
+};
+```
+
+## Basic usage
+
+ Hello NocoBase Hello NocoBase
+
+## Multiple Selection
+
+`type` needs to be changed to `array`, and the property needs to be added `multiple: true`.
+
+
+
+## Read Pretty
+
+
diff --git a/packages/core/client/src/schema-component/antd/auto-complete/demos/basic.tsx b/packages/core/client/src/schema-component/antd/auto-complete/demos/basic.tsx
index b662fac2cc..f6695c1d17 100644
--- a/packages/core/client/src/schema-component/antd/auto-complete/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/auto-complete/demos/basic.tsx
@@ -1,14 +1,10 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { useField } from '@formily/react';
-import { getAppComponent } from '@nocobase/test/web';
+import { mockApp } from '@nocobase/client/demo-utils';
+import React from 'react';
+import { SchemaComponent, Plugin } from '@nocobase/client';
+
const mockVal = (str: string, repeat = 1) => ({
value: str.repeat(repeat),
@@ -26,22 +22,34 @@ function useAutoCompleteProps() {
};
}
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'boolean',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'AutoComplete',
- 'x-use-component-props': useAutoCompleteProps,
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'boolean',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'AutoComplete',
+ 'x-use-component-props': 'useAutoCompleteProps',
},
},
+}
+
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+type AutoCompleteReadPrettyProps = InputReadPrettyProps;
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/block-item/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/block-item/demos/demo1.tsx
index 7ebe2c3ab1..6ae0d5ab91 100644
--- a/packages/core/client/src/schema-component/antd/block-item/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/block-item/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { observer, useFieldSchema } from '@formily/react';
import { uid } from '@formily/shared';
diff --git a/packages/core/client/src/schema-component/antd/block-item/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/block-item/demos/new-demos/basic.tsx
index f986b19fd6..a5af2d02a1 100644
--- a/packages/core/client/src/schema-component/antd/block-item/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/block-item/demos/new-demos/basic.tsx
@@ -1,17 +1,7 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-
-import { getAppComponent } from '@nocobase/test/web';
-import { DragHandler, SchemaSettings } from '@nocobase/client';
-import { useFieldSchema } from '@formily/react';
-import { observer } from '@formily/reactive-react';
import React from 'react';
+import { useFieldSchema, observer, ISchema } from '@formily/react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, DragHandler, SchemaSettings } from '@nocobase/client';
const simpleSettings = new SchemaSettings({
name: 'simpleSettings',
@@ -39,39 +29,47 @@ const MyBlock = observer(
{ displayName: 'MyBlock' },
);
-const App = getAppComponent({
+const schema: ISchema = {
+ type: 'void',
+ name: 'test',
+ 'x-component': 'DndContext',
+ properties: {
+ block1: {
+ type: 'void',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ 'x-settings': 'simpleSettings',
+ },
+ block2: {
+ type: 'void',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ 'x-settings': 'simpleSettings',
+ },
+ block3: {
+ type: 'void',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ 'x-settings': 'simpleSettings',
+ },
+ },
+}
+
+const Demo = () => {
+ return
diff --git a/packages/core/client/src/schema-component/antd/card-item/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/card-item/demos/demo1.tsx
index 44977bc5da..70784215fc 100644
--- a/packages/core/client/src/schema-component/antd/card-item/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/card-item/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { CardItem, FormProvider, SchemaComponent } from '@nocobase/client';
import React from 'react';
diff --git a/packages/core/client/src/schema-component/antd/card-item/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/card-item/demos/new-demos/basic.tsx
index d1d62621d7..d281fc712a 100644
--- a/packages/core/client/src/schema-component/antd/card-item/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/card-item/demos/new-demos/basic.tsx
@@ -1,14 +1,7 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
-import { SchemaSettings } from '@nocobase/client';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, SchemaSettings, ISchema } from '@nocobase/client';
const simpleSettings = new SchemaSettings({
name: 'simpleSettings',
@@ -20,48 +13,59 @@ const simpleSettings = new SchemaSettings({
],
});
-const App = getAppComponent({
- designable: true,
- schema: {
- type: 'void',
- name: 'root',
- 'x-component': 'DndContext',
- properties: {
- block1: {
- type: 'void',
- 'x-component': 'CardItem',
- 'x-component-props': {
- title: 'Block 1',
- },
- 'x-settings': 'simpleSettings',
- properties: {
- hello: {
- type: 'void',
- 'x-component': 'div',
- 'x-content': 'Hello Card!',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-component': 'DndContext',
+ properties: {
+ block1: {
+ type: 'void',
+ 'x-component': 'CardItem',
+ 'x-component-props': {
+ title: 'Block 1',
+ },
+ 'x-settings': 'simpleSettings',
+ properties: {
+ hello: {
+ type: 'void',
+ 'x-component': 'div',
+ 'x-content': 'Hello Card!',
},
},
- block2: {
- type: 'void',
- 'x-component': 'CardItem',
- 'x-settings': 'simpleSettings',
- 'x-component-props': {
- title: 'Block 2',
- },
- properties: {
- hello: {
- type: 'void',
- 'x-component': 'div',
- 'x-content': 'Hello Card!',
- },
+ },
+ block2: {
+ type: 'void',
+ 'x-component': 'CardItem',
+ 'x-settings': 'simpleSettings',
+ 'x-component-props': {
+ title: 'Block 2',
+ },
+ properties: {
+ hello: {
+ type: 'void',
+ 'x-component': 'div',
+ 'x-content': 'Hello Card!',
},
},
},
},
- appOptions: {
- schemaSettings: [simpleSettings],
- },
+};
+
+const Demo = () => {
+ return
+
+## Custom lazy render
+
+
diff --git a/packages/core/client/src/schema-component/antd/cascader/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/cascader/demos/demo1.tsx
index e5ebf07424..cf098391b5 100644
--- a/packages/core/client/src/schema-component/antd/cascader/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/cascader/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { Cascader, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/cascader/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/cascader/demos/demo2.tsx
index 4ec52d5151..03c9c2aaab 100644
--- a/packages/core/client/src/schema-component/antd/cascader/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/cascader/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { ArrayField } from '@formily/core';
diff --git a/packages/core/client/src/schema-component/antd/cascader/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/cascader/demos/new-demos/basic.tsx
index c94673815d..c3ba27c45f 100644
--- a/packages/core/client/src/schema-component/antd/cascader/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/cascader/demos/new-demos/basic.tsx
@@ -1,13 +1,7 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
const options = [
{
@@ -44,22 +38,34 @@ const options = [
},
];
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- enum: options,
- 'x-component': 'Cascader',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ enum: options,
+ 'x-component': 'Cascader',
},
},
+};
+
+const Demo = () => {
+ return
+
+## Asynchronous Data Source
+
+
+
+## labelInValue
+
+If `labelInValue` is set to `true`, the selected data will be in the format `{ label: string, value: string }`, otherwise it will be in the format `string`.
+
+
+
+## changeOnSelectLast
+
+If `changeOnSelectLast` is set to `true`, the last level must be selected. If set to `false`, any level can be selected.
+
+
+
+## Read Pretty
+
+```ts
+interface FieldNames {
+ label: string;
+ value: string;
+ children: string;
+}
+
+export interface CascaderReadPrettyProps {
+ fieldNames?: FieldNames;
+ value?: any;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.group.tsx b/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.group.tsx
index bd6380935a..359afd78af 100644
--- a/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.group.tsx
+++ b/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.group.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: 组
diff --git a/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.tsx b/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.tsx
index ccf119e542..5447b7e947 100644
--- a/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.tsx
+++ b/packages/core/client/src/schema-component/antd/checkbox/demos/checkbox.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: 勾选
diff --git a/packages/core/client/src/schema-component/antd/checkbox/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/checkbox/demos/new-demos/basic.tsx
index a6073be964..82b079b7fb 100644
--- a/packages/core/client/src/schema-component/antd/checkbox/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/checkbox/demos/new-demos/basic.tsx
@@ -1,29 +1,37 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import {
+ SchemaComponent,
+ ISchema,
+ Plugin,
+} from '@nocobase/client';
+import { mockApp } from '@nocobase/client/demo-utils';
+import React from 'react';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'boolean',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'Checkbox',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'boolean',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Checkbox',
},
},
-});
+};
-export default App;
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+interface CheckboxReadPrettyProps {
+ showUnchecked?: boolean;
+ value?: boolean;
+}
+```
+
+If the value is `false`, by default, the content is not displayed. You can use the `showUnchecked` property to display the unchecked checkbox.
+
+
+
+## Checkbox Group
+
+```ts
+type CheckboxGroupProps = CheckboxGroupProps;
+```
+
+Note that the `type` property of the schema is `array`.
+
+
+
+## Checkbox Group Read Pretty
+
+```ts
+export interface CheckboxGroupReadPrettyProps {
+ value?: any[];
+ ellipsis?: boolean;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/collection-select/demos/basic.tsx b/packages/core/client/src/schema-component/antd/collection-select/demos/basic.tsx
index ef00dd6882..15af96fe7b 100644
--- a/packages/core/client/src/schema-component/antd/collection-select/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/collection-select/demos/basic.tsx
@@ -1,29 +1,35 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'CollectionSelect',
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'CollectionSelect',
},
},
+};
+
+const Demo = () => {
+ return
+
+## Multiple Selection
+
+`type` needs to be changed to `array`, and the property needs to be added `mode: 'multiple'`.
+
+
+
+## Read Pretty
+
+
diff --git a/packages/core/client/src/schema-component/antd/color-picker/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/color-picker/demos/demo1.tsx
index 8ab7b4dcef..68cbf8f2f4 100644
--- a/packages/core/client/src/schema-component/antd/color-picker/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/color-picker/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: ColorPicker
diff --git a/packages/core/client/src/schema-component/antd/color-picker/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/color-picker/demos/new-demos/basic.tsx
index 8d1c8b6c76..231c928788 100644
--- a/packages/core/client/src/schema-component/antd/color-picker/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/color-picker/demos/new-demos/basic.tsx
@@ -1,29 +1,35 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'ColorPicker',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'ColorPicker',
},
},
+}
+
+const Demo = () => {
+ return
+
+## Read Pretty
+
+
diff --git a/packages/core/client/src/schema-component/antd/color-select/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/color-select/demos/demo1.tsx
index 780510fd48..c1a294e192 100644
--- a/packages/core/client/src/schema-component/antd/color-select/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/color-select/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: 勾选
diff --git a/packages/core/client/src/schema-component/antd/color-select/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/color-select/demos/new-demos/basic.tsx
index d3b97c3c37..83c33cae84 100644
--- a/packages/core/client/src/schema-component/antd/color-select/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/color-select/demos/new-demos/basic.tsx
@@ -1,29 +1,35 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'ColorSelect',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'ColorSelect',
},
},
+}
+
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+interface ColorSelectReadPrettyProps {
+ value?: string;
+}
+```
+
+
+
diff --git a/packages/core/client/src/schema-component/antd/cron/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/cron/demos/demo1.tsx
index f9fe35c4c3..29e311e017 100644
--- a/packages/core/client/src/schema-component/antd/cron/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/cron/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { Cron, FormProvider, SchemaComponent } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/cron/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/cron/demos/demo2.tsx
index 6c311bcacb..ff779ade1c 100644
--- a/packages/core/client/src/schema-component/antd/cron/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/cron/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { CronSet, FormProvider, SchemaComponent } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/cron/demos/new-demos/cron-basic.tsx b/packages/core/client/src/schema-component/antd/cron/demos/new-demos/cron-basic.tsx
index 0c643ea2d0..33b653e049 100644
--- a/packages/core/client/src/schema-component/antd/cron/demos/new-demos/cron-basic.tsx
+++ b/packages/core/client/src/schema-component/antd/cron/demos/new-demos/cron-basic.tsx
@@ -1,29 +1,35 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'Cron',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Cron',
},
},
+}
+
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+interface CronReadPrettyProps {
+ value?: string;
+}
+```
+
+
+
+## CronSet
+
+## Basic Usage
+
+```ts
+interface CronSetProps extends SelectProps {
+ onChange: (v: string) => void;
+}
+```
+
+
+
+## Read Pretty
+
+```ts
+interface CronReadPrettyProps {
+ value?: string;
+ options?: SelectProps['options'];
+}
+```
+
+
+
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo1.tsx
index 75b41fcbfe..db937d7c6e 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo10.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo10.tsx
index 0704bb7632..81309fc9d7 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo10.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo10.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo11.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo11.tsx
index 955051081d..4855711657 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo11.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo11.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker.RangePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo2.tsx
index 87922d5c3f..2a3d446cde 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker (GMT)
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo3.tsx
index 2d982ffa05..63597b8c4a 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo4.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo4.tsx
index 23bdafc6e1..af85b61af5 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo4.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo4.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker.RangePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo5.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo5.tsx
index 659374d5c0..5b37530519 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo5.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo5.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker.RangePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo6.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo6.tsx
index 1fdcf0b00d..db7df240bf 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo6.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo6.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker.RangePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo7.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo7.tsx
index 19cedb8001..e3de179d0b 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo7.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo7.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo8.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo8.tsx
index 0704bb7632..81309fc9d7 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo8.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo8.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/demo9.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/demo9.tsx
index 19cedb8001..e3de179d0b 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/demo9.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/demo9.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: DatePicker
diff --git a/packages/core/client/src/schema-component/antd/date-picker/demos/new-demos/date-basic.tsx b/packages/core/client/src/schema-component/antd/date-picker/demos/new-demos/date-basic.tsx
index ad43773d42..8cf36ff5a3 100644
--- a/packages/core/client/src/schema-component/antd/date-picker/demos/new-demos/date-basic.tsx
+++ b/packages/core/client/src/schema-component/antd/date-picker/demos/new-demos/date-basic.tsx
@@ -1,29 +1,37 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'DatePicker',
},
},
+}
+
+const Demo = () => {
+ return
+
+### Format
+
+
+
+### Show Time Picker
+
+
+
+### Read Pretty
+
+```ts
+interface GetDefaultFormatProps {
+ format?: string;
+ dateFormat?: string;
+ timeFormat?: string;
+ picker?: 'year' | 'month' | 'week' | 'quarter';
+ showTime?: boolean;
+}
+
+interface Str2momentOptions {
+ gmt?: boolean;
+ picker?: 'year' | 'month' | 'week' | 'quarter';
+ utcOffset?: number;
+ utc?: boolean;
+}
+
+interface ReadPrettyDatePickerProps extends Str2momentOptions, GetDefaultFormatProps {
+ value?: Str2momentValue;
+ className?: string;
+ prefixCls?: string;
+}
+```
+
+
+
+
+
+
+
+
+
+## RangePicker
+
+```ts
+type DatePickerProps = AntdRangePickerProps
+```
+
+### Basic Usage
+
+
+
+### Format
+
+
+
+### Read Pretty
+
+```ts
+interface DateRangePickerReadPrettyProps extends Str2momentOptions, GetDefaultFormatProps {
+ value?: Str2momentValue;
+ className?: string;
+ prefixCls?: string;
+ style?: React.CSSProperties;
+}
+```
+
+
+
+
+
+
+
+
diff --git a/packages/core/client/src/schema-component/antd/details/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/details/demos/demo1.tsx
index 46e58e2c22..d1cf700871 100644
--- a/packages/core/client/src/schema-component/antd/details/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/details/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { Details, FormProvider, Input, SchemaComponent } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/details/demos/new-demos/list.tsx b/packages/core/client/src/schema-component/antd/details/demos/new-demos/list.tsx
index 64a36a92a8..0cabebeee4 100644
--- a/packages/core/client/src/schema-component/antd/details/demos/new-demos/list.tsx
+++ b/packages/core/client/src/schema-component/antd/details/demos/new-demos/list.tsx
@@ -1,73 +1,79 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
DetailsBlockProvider,
+ ISchema,
useDetailsPaginationProps,
useDetailsWithPaginationDecoratorProps,
useDetailsWithPaginationProps,
} from '@nocobase/client';
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'DetailsBlockProvider',
- 'x-use-decorator-props': 'useDetailsWithPaginationDecoratorProps',
- 'x-decorator-props': {
- collection: 'roles',
- action: 'list',
- params: {
- pageSize: 1,
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'DetailsBlockProvider',
+ 'x-use-decorator-props': 'useDetailsWithPaginationDecoratorProps',
+ 'x-decorator-props': {
+ collection: 'roles',
+ action: 'list',
+ params: {
+ pageSize: 1,
},
- 'x-component': 'CardItem',
- properties: {
- details: {
- type: 'void',
- 'x-pattern': 'readPretty',
- 'x-component': 'Details',
- 'x-use-component-props': 'useDetailsWithPaginationProps',
- properties: {
- name: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-decorator': 'FormItem',
- 'x-index': 1,
- },
- title: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-decorator': 'FormItem',
- 'x-index': 2,
- },
- pagination: {
- 'x-component': 'Pagination',
- 'x-read-pretty': false,
- 'x-use-component-props': 'useDetailsPaginationProps',
- 'x-index': 3,
- },
+ },
+ 'x-component': 'CardItem',
+ properties: {
+ details: {
+ type: 'void',
+ 'x-pattern': 'readPretty',
+ 'x-component': 'Details',
+ 'x-use-component-props': 'useDetailsWithPaginationProps',
+ properties: {
+ name: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-decorator': 'FormItem',
+ 'x-index': 1,
+ },
+ title: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-decorator': 'FormItem',
+ 'x-index': 2,
+ },
+ pagination: {
+ 'x-component': 'Pagination',
+ 'x-read-pretty': false,
+ 'x-use-component-props': 'useDetailsPaginationProps',
+ 'x-index': 3,
},
},
},
},
- appOptions: {
- components: {
- DetailsBlockProvider,
- },
- scopes: {
+}
+
+const Demo = () => {
+ return
+
+## List Form Data
+
+
diff --git a/packages/core/client/src/schema-component/antd/error-fallback/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/error-fallback/demos/demo1.tsx
index d1b1fc2c98..7297022a26 100644
--- a/packages/core/client/src/schema-component/antd/error-fallback/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/error-fallback/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import { ErrorBoundary } from 'react-error-boundary';
diff --git a/packages/core/client/src/schema-component/antd/error-fallback/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/error-fallback/demos/new-demos/basic.tsx
index be814efd1c..ba731c8e7a 100644
--- a/packages/core/client/src/schema-component/antd/error-fallback/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/error-fallback/demos/new-demos/basic.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import { ErrorBoundary } from 'react-error-boundary';
diff --git a/packages/core/client/src/schema-component/antd/error-fallback/index.en-US.md b/packages/core/client/src/schema-component/antd/error-fallback/index.en-US.md
new file mode 100644
index 0000000000..3979c05a48
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/error-fallback/index.en-US.md
@@ -0,0 +1,7 @@
+# ErrorFallback
+
+The component displayed when an error occurs during rendering.
+
+其基于 [react-error-boundary](https://github.com/bvaughn/react-error-boundary) 库。
+
+
diff --git a/packages/core/client/src/schema-component/antd/filter/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/filter/demos/demo2.tsx
index 22c311a6a5..0a02765722 100644
--- a/packages/core/client/src/schema-component/antd/filter/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/filter/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { AntdSchemaComponentProvider, Filter, Input, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
import React from 'react';
diff --git a/packages/core/client/src/schema-component/antd/filter/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/filter/demos/demo3.tsx
index 5158792afc..42b3e0d12a 100644
--- a/packages/core/client/src/schema-component/antd/filter/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/filter/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema, useForm } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/filter/demos/demo4.tsx b/packages/core/client/src/schema-component/antd/filter/demos/demo4.tsx
index f6f4722d31..1c5928f9f6 100644
--- a/packages/core/client/src/schema-component/antd/filter/demos/demo4.tsx
+++ b/packages/core/client/src/schema-component/antd/filter/demos/demo4.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/filter/demos/demo5.tsx b/packages/core/client/src/schema-component/antd/filter/demos/demo5.tsx
index b3e8d84592..1befe4c567 100644
--- a/packages/core/client/src/schema-component/antd/filter/demos/demo5.tsx
+++ b/packages/core/client/src/schema-component/antd/filter/demos/demo5.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/json-schema';
import { Filter, FilterAction, Input, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/filter/demos/demo6.tsx b/packages/core/client/src/schema-component/antd/filter/demos/demo6.tsx
index c7aea0d8cc..625108d3ef 100644
--- a/packages/core/client/src/schema-component/antd/filter/demos/demo6.tsx
+++ b/packages/core/client/src/schema-component/antd/filter/demos/demo6.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
AntdSchemaComponentProvider,
diff --git a/packages/core/client/src/schema-component/antd/filter/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/filter/demos/new-demos/basic.tsx
index f1f4a31be2..217c8d999c 100644
--- a/packages/core/client/src/schema-component/antd/filter/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/filter/demos/new-demos/basic.tsx
@@ -1,17 +1,11 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
-import { useField, observer } from '@formily/react';
+import { useField, observer, ISchema } from '@formily/react';
import { FilterActionProps, useRequest } from '@nocobase/client';
-import { getAppComponent } from '@nocobase/test/web';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin } from '@nocobase/client';
import { filterOptions } from './options';
@@ -45,33 +39,41 @@ const useFilterActionProps = (): FilterActionProps => {
};
};
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- properties: {
- test: {
- name: 'filter',
- type: 'object',
- enum: filterOptions,
- title: 'Filter',
- 'x-decorator': 'ShowFilterData',
- 'x-component': 'Filter.Action',
- 'x-use-component-props': useFilterActionProps,
- },
- },
- },
- appOptions: {
- components: {
- ShowFilterData,
- },
- scopes: {
- useFilterActionProps,
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ properties: {
+ test: {
+ name: 'filter',
+ type: 'object',
+ enum: filterOptions,
+ title: 'Filter',
+ 'x-decorator': 'ShowFilterData',
+ 'x-component': 'Filter.Action',
+ 'x-use-component-props': 'useFilterActionProps',
},
},
+}
+
+const Demo = () => {
+ return
+
+### Default Value
+
+Default values can be set using `schema.default`.
+
+
+
+### With Data Block
+
+If used within a [DataBlock](/core/data-block/data-block-provider), we can make requests using [useDataBlockResource()](/core/data-block/data-block-request-provider).
+
+
+
+### with Collection fields
+
+You can use `useFilterFieldOptions(collection.fields)` to get options for collection fields.
+
+
diff --git a/packages/core/client/src/schema-component/antd/form-item/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/form-item/demos/demo1.tsx
index dd9b3d2d24..44bb7ddfb2 100644
--- a/packages/core/client/src/schema-component/antd/form-item/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/form-item/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
APIClientProvider,
diff --git a/packages/core/client/src/schema-component/antd/form-item/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/form-item/demos/new-demos/basic.tsx
index 8488cd898d..2264937e55 100644
--- a/packages/core/client/src/schema-component/antd/form-item/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/form-item/demos/new-demos/basic.tsx
@@ -1,14 +1,7 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
-import { SchemaSettings } from '@nocobase/client';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, SchemaSettings, ISchema } from '@nocobase/client';
const simpleSettings = new SchemaSettings({
name: 'simpleSettings',
@@ -20,34 +13,46 @@ const simpleSettings = new SchemaSettings({
],
});
-const App = getAppComponent({
- designable: true,
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'DndContext',
- 'x-component': 'FormV2',
- properties: {
- username: {
- type: 'string',
- title: 'Username',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- 'x-settings': 'simpleSettings',
- required: true,
- },
- nickname: {
- type: 'string',
- title: 'Nickname',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- 'x-settings': 'simpleSettings',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'DndContext',
+ 'x-component': 'FormV2',
+ properties: {
+ username: {
+ type: 'string',
+ title: 'Username',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ 'x-settings': 'simpleSettings',
+ required: true,
+ },
+ nickname: {
+ type: 'string',
+ title: 'Nickname',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ 'x-settings': 'simpleSettings',
},
},
- appOptions: {
- schemaSettings: [simpleSettings],
- },
+}
+
+const Demo = () => {
+ return
diff --git a/packages/core/client/src/schema-component/antd/form-v2/demos/collections.ts b/packages/core/client/src/schema-component/antd/form-v2/demos/collections.ts
index e768cc0163..031def9589 100644
--- a/packages/core/client/src/schema-component/antd/form-v2/demos/collections.ts
+++ b/packages/core/client/src/schema-component/antd/form-v2/demos/collections.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
export default [
{
diff --git a/packages/core/client/src/schema-component/antd/form-v2/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/form-v2/demos/demo1.tsx
index 296f487d8e..2cec5e4ae2 100644
--- a/packages/core/client/src/schema-component/antd/form-v2/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/form-v2/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema, useForm } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/form-v2/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/form-v2/demos/demo2.tsx
index b9c14cc08f..38b72851e4 100644
--- a/packages/core/client/src/schema-component/antd/form-v2/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/form-v2/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema, useForm } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/form-v2/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/form-v2/demos/demo3.tsx
index e4232e5e64..3b5db9d20e 100644
--- a/packages/core/client/src/schema-component/antd/form-v2/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/form-v2/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/form-v2/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/form-v2/demos/new-demos/basic.tsx
index 2002c9cd3f..d724aecc5d 100644
--- a/packages/core/client/src/schema-component/antd/form-v2/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/form-v2/demos/new-demos/basic.tsx
@@ -1,16 +1,14 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-
-import { getAppComponent } from '@nocobase/test/web';
-import { ActionProps, useAPIClient } from '@nocobase/client';
-import { useForm } from '@formily/react';
+import React from 'react';
import { App as AntdApp } from 'antd';
+import { useForm } from '@formily/react';
+import {
+ ActionProps,
+ useAPIClient,
+ SchemaComponent,
+ ISchema,
+ Plugin
+} from '@nocobase/client';
+import { mockApp } from '@nocobase/client/demo-utils';
function useSubmitActionProps(): ActionProps {
const form = useForm();
@@ -31,48 +29,56 @@ function useSubmitActionProps(): ActionProps {
},
};
}
-
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- properties: {
- test: {
- type: 'void',
- 'x-component': 'FormV2',
- properties: {
- username: {
- type: 'string',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- title: 'Username',
- required: true,
- },
- nickname: {
- type: 'string',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- title: 'Nickname',
- },
- password: {
- type: 'string',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- title: 'Password',
- },
- button: {
- type: 'void',
- 'x-component': 'Action',
- title: 'Submit',
- 'x-use-component-props': useSubmitActionProps,
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ properties: {
+ test: {
+ type: 'void',
+ 'x-component': 'FormV2',
+ properties: {
+ username: {
+ type: 'string',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ title: 'Username',
+ required: true,
+ },
+ nickname: {
+ type: 'string',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ title: 'Nickname',
+ },
+ password: {
+ type: 'string',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ title: 'Password',
+ },
+ button: {
+ type: 'void',
+ 'x-component': 'Action',
+ title: 'Submit',
+ 'x-use-component-props': 'useSubmitActionProps',
},
},
},
},
- apis: {
- 'users:create': { result: 'ok' },
- },
+};
+
+const Demo = () => {
+ return
+
+For the configuration of the Action component, please refer to [Action](/components/action).
+
+## Default values
+
+We can use `x-use-component-props` and `form.setInitialValues()` to set default values. For more instance methods of the form, please refer to [Form](https://core.formilyjs.org/api/models/form).
+
+
+
+## FormLayout
+
+FormV2 internally encapsulates the FormLayout component. Please refer to [FormLayout](https://antd.formilyjs.org/zh-CN/components/form-layout) for the props of the FormLayout component.
+
+
+
+## Grid Layout
+
+For the configuration of the Grid component, please refer to [Grid](/components/grid).
+
+
+
+## With Collection
+
+We can use `FormBlockProvider` and `CollectionField` to automatically retrieve the configuration of a data table and render form items based on the table's configuration.
+
+`FormBlockProvider` is a secondary encapsulation of `DataBlockProvider`, and its properties can be referred to in [DataBlockProvider](/core/data-block/data-block-provider#属性详解). `CollectionField` will automatically search for the corresponding configuration of the data table based on `field.name` and render it as the corresponding form item. For more information about `CollectionField`, please refer to [CollectionField](/core/data-source/collection-field).
+
+And we can use the `resource` context provided by `DataBlockProvider` to perform CRUD operations on resources.
+
+For example, let's take the `users` data table as an example.
+
+
+
+## Extend Collection
+
+If the Collection is not created through the Data Source Manager, but is a custom extension, you can refer to [ExtendCollectionsProvider](/core/data-source/extend-collections-provider).
+
+
+
+## Get Collection Data
+
+When we pass `action: 'get'` to `FormBlockProvider` and there is a `filterByTk` property, `FormBlockProvider` will automatically retrieve the data table data based on the value of `filterByTk`. Please refer to [DataBlockProvider](/core/data-block/data-block-provider#属性详解) for parameter details.
+
+Then use `useFormBlockProps()` to assign the retrieved data to the Form.
+
+Generally used in data update scenarios.
+
+
+
+## Read Pretty
+
+Just add `x-read-pretty: true` in the Schema.
+
+
+
+## Linkage
+
+Form items can be linked together using the `x-linkage-rules` attribute.
+
+TODO:
+
+
+
+## Hooks
diff --git a/packages/core/client/src/schema-component/antd/form/demos/apiClient.ts b/packages/core/client/src/schema-component/antd/form/demos/apiClient.ts
index dcee1075c2..7aa59f5df1 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/apiClient.ts
+++ b/packages/core/client/src/schema-component/antd/form/demos/apiClient.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { APIClient } from '@nocobase/client';
import MockAdapter from 'axios-mock-adapter';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo1.tsx
index e2701f3f49..6cb02329e8 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo2.tsx
index 20ce81b838..a5f3835219 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo3.tsx
index 51f7ef4dbe..15dd8e6f8e 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo4.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo4.tsx
index 2ba3a05394..a006fd9e5b 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo4.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo4.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo5.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo5.tsx
index ac63e47fd0..b9de1817f6 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo5.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo5.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo6.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo6.tsx
index 47772a6e05..032345e4e2 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo6.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo6.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo7.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo7.tsx
index 24c1edf73d..af3e930cd0 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo7.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo7.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem, Input } from '@formily/antd-v5';
import { ISchema, observer, useForm } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo8.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo8.tsx
index 7ff5a8fb91..fbf1591a18 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo8.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo8.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { ISchema, observer } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/form/demos/demo9.tsx b/packages/core/client/src/schema-component/antd/form/demos/demo9.tsx
index 4d39fd3d32..897e40c7ec 100644
--- a/packages/core/client/src/schema-component/antd/form/demos/demo9.tsx
+++ b/packages/core/client/src/schema-component/antd/form/demos/demo9.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { BlockSchemaComponentPlugin, VariablesProvider } from '@nocobase/client';
import { renderApp } from '@nocobase/test/client';
diff --git a/packages/core/client/src/schema-component/antd/form/index.en-US.md b/packages/core/client/src/schema-component/antd/form/index.en-US.md
new file mode 100644
index 0000000000..f141a6cc03
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/form/index.en-US.md
@@ -0,0 +1,47 @@
+# Form
+
+## Examples
+
+### Basic Usage
+
+
+
+### Form Decorator
+
+Form can also be used as a decorator
+
+
+
+When combined with Action.Drawer, it becomes DrawerForm
+
+
+
+### initialValue Initialization
+
+
+
+### initialValue for decorator
+
+
+
+### Remote initialization data
+
+
+
+### useValues
+
+
+
+### DrawerForm
+
+Control the popup form (Drawer+Form) freely and asynchronously populate the form data
+
+
+
+## API
+
+Property Description
+
+- `initialValue` Static initialization data
+- `request` Remote request parameters
+- `useValues` Custom useRequest
diff --git a/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx
index 9196657865..82da7c1ce0 100644
--- a/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/g2plot/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
APIClient,
@@ -13,10 +6,10 @@ import {
CardItem,
G2Plot,
SchemaComponent,
+ mockAPIClient,
SchemaComponentProvider,
} from '@nocobase/client';
import React from 'react';
-import { mockAPIClient } from '../../../../testUtils';
const { apiClient, mockRequest } = mockAPIClient();
diff --git a/packages/core/client/src/schema-component/antd/g2plot/index.en-US.md b/packages/core/client/src/schema-component/antd/g2plot/index.en-US.md
new file mode 100644
index 0000000000..5a2cffc72e
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/g2plot/index.en-US.md
@@ -0,0 +1,5 @@
+# G2Plot
+
+G2 chart.
+
+
diff --git a/packages/core/client/src/schema-component/antd/grid-card/demos/basic.tsx b/packages/core/client/src/schema-component/antd/grid-card/demos/basic.tsx
index a776c26573..4351e91eae 100644
--- a/packages/core/client/src/schema-component/antd/grid-card/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/grid-card/demos/basic.tsx
@@ -1,54 +1,59 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'GridCard.Decorator',
- 'x-use-decorator-props': 'useGridCardBlockDecoratorProps',
- 'x-decorator-props': {
- collection: 'roles',
- action: 'list',
- params: {
- pageSize: 2,
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'GridCard.Decorator',
+ 'x-use-decorator-props': 'useGridCardBlockDecoratorProps',
+ 'x-decorator-props': {
+ collection: 'roles',
+ action: 'list',
+ params: {
+ pageSize: 2,
},
- properties: {
- list: {
- type: 'array',
- 'x-component': 'GridCard',
- properties: {
- item: {
- type: 'object',
- 'x-component': 'GridCard.Item',
- 'x-read-pretty': true,
- 'x-use-component-props': 'useGridCardItemProps',
- properties: {
- name: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-decorator': 'FormItem',
- },
- title: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-decorator': 'FormItem',
- },
+ },
+ properties: {
+ list: {
+ type: 'array',
+ 'x-component': 'GridCard',
+ properties: {
+ item: {
+ type: 'object',
+ 'x-component': 'GridCard.Item',
+ 'x-read-pretty': true,
+ 'x-use-component-props': 'useGridCardItemProps',
+ properties: {
+ name: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-decorator': 'FormItem',
+ },
+ title: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-decorator': 'FormItem',
},
},
},
},
},
},
+}
+const Demo = () => {
+ return
diff --git a/packages/core/client/src/schema-component/antd/grid/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/grid/demos/demo1.tsx
index a22e8ab656..95a684690d 100644
--- a/packages/core/client/src/schema-component/antd/grid/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/grid/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { observer, useFieldSchema } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/grid/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/grid/demos/demo2.tsx
index ceed2db651..1aebb53765 100644
--- a/packages/core/client/src/schema-component/antd/grid/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/grid/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import { uid } from '@formily/shared';
diff --git a/packages/core/client/src/schema-component/antd/grid/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/grid/demos/demo3.tsx
index 08dc69bf5d..3a7dff808f 100644
--- a/packages/core/client/src/schema-component/antd/grid/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/grid/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import { uid } from '@formily/shared';
diff --git a/packages/core/client/src/schema-component/antd/grid/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/grid/demos/new-demos/basic.tsx
index 19d37cd40c..297727273a 100644
--- a/packages/core/client/src/schema-component/antd/grid/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/grid/demos/new-demos/basic.tsx
@@ -1,17 +1,16 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { useFieldSchema } from '@formily/react';
import { observer } from '@formily/reactive-react';
-import { getAppComponent } from '@nocobase/test/web';
+import {
+ SchemaComponent,
+ ISchema,
+ Plugin,
+ DragHandler
+} from '@nocobase/client';
+import { mockApp } from '@nocobase/client/demo-utils';
+
import React from 'react';
-import { DragHandler } from '@nocobase/client';
const MyBlock = observer(
() => {
@@ -29,86 +28,93 @@ const MyBlock = observer(
{ displayName: 'MyBlock' },
);
-const App = getAppComponent({
+const schema: ISchema = {
+ type: 'void',
+ name: 'grid1',
+ 'x-component': 'Grid',
+ properties: {
+ row1: {
+ type: 'void',
+ 'x-component': 'Grid.Row',
+ properties: {
+ col1: {
+ type: 'void',
+ 'x-component': 'Grid.Col',
+ properties: {
+ block1: {
+ type: 'void',
+ title: 'row1 - col1 - block1',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ },
+ block2: {
+ type: 'void',
+ title: 'row1 - col1 - block2',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ },
+ },
+ },
+ col2: {
+ type: 'void',
+ 'x-component': 'Grid.Col',
+ properties: {
+ block1: {
+ type: 'void',
+ title: 'row1 - col2 - block1',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ },
+ },
+ },
+ },
+ },
+ row2: {
+ type: 'void',
+ 'x-component': 'Grid.Row',
+ properties: {
+ col1: {
+ type: 'void',
+ 'x-component': 'Grid.Col',
+ properties: {
+ block4: {
+ type: 'void',
+ title: 'row2 - col1 - block1',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ },
+ },
+ },
+ col2: {
+ type: 'void',
+ 'x-component': 'Grid.Col',
+ properties: {
+ block1: {
+ type: 'void',
+ title: 'row2 - col2 - block1',
+ 'x-decorator': 'BlockItem',
+ 'x-component': 'MyBlock',
+ },
+ },
+ },
+ },
+ },
+ },
+};
+
+const Demo = () => {
+ return
+
+## With Form
+
+Demo [GridLayout](/components/form-v2#grid-layout)
diff --git a/packages/core/client/src/schema-component/antd/icon-picker/demos/icon-picker.tsx b/packages/core/client/src/schema-component/antd/icon-picker/demos/icon-picker.tsx
index 80fc638f7a..58b564f30e 100644
--- a/packages/core/client/src/schema-component/antd/icon-picker/demos/icon-picker.tsx
+++ b/packages/core/client/src/schema-component/antd/icon-picker/demos/icon-picker.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { IconPicker, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/icon-picker/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/icon-picker/demos/new-demos/basic.tsx
index 17ef76de13..af9db70e7a 100644
--- a/packages/core/client/src/schema-component/antd/icon-picker/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/icon-picker/demos/new-demos/basic.tsx
@@ -1,29 +1,34 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'IconPicker',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'IconPicker',
},
},
+}
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+interface IconPickerReadPrettyProps {
+ value?: string;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/input-number/demos/addonBefore&addonAfter.tsx b/packages/core/client/src/schema-component/antd/input-number/demos/addonBefore&addonAfter.tsx
index 6b3bd6ab30..ec05c6e590 100644
--- a/packages/core/client/src/schema-component/antd/input-number/demos/addonBefore&addonAfter.tsx
+++ b/packages/core/client/src/schema-component/antd/input-number/demos/addonBefore&addonAfter.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { InputNumber, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/input-number/demos/highPrecisionDecimals.tsx b/packages/core/client/src/schema-component/antd/input-number/demos/highPrecisionDecimals.tsx
index 24fa402606..ebf21d2846 100644
--- a/packages/core/client/src/schema-component/antd/input-number/demos/highPrecisionDecimals.tsx
+++ b/packages/core/client/src/schema-component/antd/input-number/demos/highPrecisionDecimals.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { InputNumber, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/input-number/demos/inputNumber.tsx b/packages/core/client/src/schema-component/antd/input-number/demos/inputNumber.tsx
index df49de4b64..f32e19ed26 100644
--- a/packages/core/client/src/schema-component/antd/input-number/demos/inputNumber.tsx
+++ b/packages/core/client/src/schema-component/antd/input-number/demos/inputNumber.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { InputNumber, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/input-number/demos/new-demos/addonBefore-addonAfter.tsx b/packages/core/client/src/schema-component/antd/input-number/demos/new-demos/addonBefore-addonAfter.tsx
index 7d01cfe22f..213a3166dc 100644
--- a/packages/core/client/src/schema-component/antd/input-number/demos/new-demos/addonBefore-addonAfter.tsx
+++ b/packages/core/client/src/schema-component/antd/input-number/demos/new-demos/addonBefore-addonAfter.tsx
@@ -1,33 +1,38 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'number',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'InputNumber',
- 'x-component-props': {
- addonBefore: '¥',
- addonAfter: '万元',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'number',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'InputNumber',
+ 'x-component-props': {
+ addonBefore: '¥',
+ addonAfter: '万元',
},
},
},
+}
+const Demo = () => {
+ return
+
+## addonBefore and addonAfter
+
+
+
+## Read Pretty
+
+```ts
+interface InputNumberReadPrettyProps {
+ formatStyle?: 'normal' | 'scientifix';
+ unitConversion?: number;
+ /**
+ * @default '*'
+ */
+ unitConversionType?: '*' | '/';
+ /**
+ * @default '0.00'
+ */
+ separator?: '0,0.00' | '0.0,00' | '0 0,00' | '0.00';
+ step?: number;
+ value?: any;
+ addonBefore?: React.ReactNode;
+ addonAfter?: React.ReactNode;
+}
+```
+
+
+
+## Format Style
+
+Scientific notation is supported.
+
+
+
+## Unit Conversion
+
+Perform multiplication or division operations based on the original number.
+
+
+
+## Separator
+
+
diff --git a/packages/core/client/src/schema-component/antd/input/demos/input.tsx b/packages/core/client/src/schema-component/antd/input/demos/input.tsx
index 7c77982b7b..d3c3244bdb 100644
--- a/packages/core/client/src/schema-component/antd/input/demos/input.tsx
+++ b/packages/core/client/src/schema-component/antd/input/demos/input.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { Application, Input, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/input/demos/json.tsx b/packages/core/client/src/schema-component/antd/input/demos/json.tsx
index ba3ca521b4..ce9a52d79f 100644
--- a/packages/core/client/src/schema-component/antd/input/demos/json.tsx
+++ b/packages/core/client/src/schema-component/antd/input/demos/json.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { Application, Input, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/input/demos/new-demos/input-read-pretty.tsx b/packages/core/client/src/schema-component/antd/input/demos/new-demos/input-read-pretty.tsx
index 43fbb040f6..011bf60f61 100644
--- a/packages/core/client/src/schema-component/antd/input/demos/new-demos/input-read-pretty.tsx
+++ b/packages/core/client/src/schema-component/antd/input/demos/new-demos/input-read-pretty.tsx
@@ -1,46 +1,51 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- 'x-pattern': 'readPretty',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- default:
- 'NocoBase is a scalability-first, open-source no-code/low-code platform for building business applications and enterprise solutions.',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- },
- test2: {
- type: 'string',
- title: 'Test(ellipsis)',
- default:
- 'NocoBase is a scalability-first, open-source no-code/low-code platform for building business applications and enterprise solutions.',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- 'x-component-props': {
- ellipsis: true,
- style: {
- width: 100,
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ 'x-pattern': 'readPretty',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ default:
+ 'NocoBase is a scalability-first, open-source no-code/low-code platform for building business applications and enterprise solutions.',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ },
+ test2: {
+ type: 'string',
+ title: 'Test(ellipsis)',
+ default:
+ 'NocoBase is a scalability-first, open-source no-code/low-code platform for building business applications and enterprise solutions.',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Input',
+ 'x-component-props': {
+ ellipsis: true,
+ style: {
+ width: 100,
},
},
},
},
+}
+const Demo = () => {
+ return
+
+### ReadPretty
+
+```ts
+interface InputReadPrettyProps {
+ value?: any;
+ className?: string;
+ style?: React.CSSProperties;
+ addonBefore?: React.ReactNode;
+ prefix?: React.ReactNode;
+ suffix?: React.ReactNode;
+ addonAfter?: React.ReactNode;
+ ellipsis?: boolean;
+ prefixCls?: string;
+}
+```
+
+
+
+## Input.TextArea
+
+### Basic Usage
+
+```ts
+type InputTextAreaProps = AntdTextAreaProps;
+```
+
+
+
+### ReadPretty
+
+```ts
+interface InputTextAreaReadPrettyProps {
+ value?: any;
+ className?: string;
+ style?: React.CSSProperties;
+ addonBefore?: React.ReactNode;
+ prefix?: React.ReactNode;
+ suffix?: React.ReactNode;
+ addonAfter?: React.ReactNode;
+ ellipsis?: boolean;
+ text?: boolean;
+ autop?: boolean;
+ prefixCls?: string;
+}
+```
+
+
+
+## Input.URL
+
+### Basic Usage
+
+```ts
+type InputURLProps = InputProps;
+```
+
+
+
+### ReadPretty
+
+```ts
+interface URLReadPrettyProps {
+ value?: any;
+ className?: string;
+ style?: React.CSSProperties;
+ addonBefore?: React.ReactNode;
+ prefix?: React.ReactNode;
+ suffix?: React.ReactNode;
+ addonAfter?: React.ReactNode;
+ prefixCls?: string;
+}
+```
+
+
+
+## Input.JSON
+
+### Basic Usage
+
+```ts
+type JSONTextAreaProps = AntdTextAreaProps & { value?: string; space?: number }
+```
+
+
+
+### ReadPretty
+
+```ts
+interface JSONTextAreaReadPrettyProps {
+ value?: any;
+ className?: string;
+ style?: React.CSSProperties;
+ space?: number;
+ prefixCls?: string;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/list/demos/basic.tsx b/packages/core/client/src/schema-component/antd/list/demos/basic.tsx
index 8b2b072117..e7fcf21e93 100644
--- a/packages/core/client/src/schema-component/antd/list/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/list/demos/basic.tsx
@@ -1,63 +1,64 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { BlockSchemaComponentPlugin } from '@nocobase/client';
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, BlockSchemaComponentPlugin } from '@nocobase/client';
-const App = getAppComponent({
- designable: true,
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'List.Decorator',
- 'x-use-decorator-props': 'useListBlockDecoratorProps',
- 'x-decorator-props': {
- collection: 'roles',
- dataSource: 'main',
- action: 'list',
- params: {
- pageSize: 10,
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'List.Decorator',
+ 'x-use-decorator-props': 'useListBlockDecoratorProps',
+ 'x-decorator-props': {
+ collection: 'roles',
+ dataSource: 'main',
+ action: 'list',
+ params: {
+ pageSize: 10,
},
- 'x-component': 'CardItem',
- properties: {
- list: {
- type: 'array',
- 'x-component': 'List',
- properties: {
- item: {
- type: 'object',
- 'x-component': 'List.Item',
- 'x-read-pretty': true,
- 'x-use-component-props': 'useListItemProps',
- properties: {
- name: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-decorator': 'FormItem',
- 'x-index': 1,
- },
- title: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-decorator': 'FormItem',
- 'x-index': 2,
- },
+ },
+ 'x-component': 'CardItem',
+ properties: {
+ list: {
+ type: 'array',
+ 'x-component': 'List',
+ properties: {
+ item: {
+ type: 'object',
+ 'x-component': 'List.Item',
+ 'x-read-pretty': true,
+ 'x-use-component-props': 'useListItemProps',
+ properties: {
+ name: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-decorator': 'FormItem',
+ 'x-index': 1,
+ },
+ title: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-decorator': 'FormItem',
+ 'x-index': 2,
},
},
},
},
},
},
- appOptions: {
- plugins: [BlockSchemaComponentPlugin],
- },
+}
+const Demo = () => {
+ return
+
+## With ActionBar
+
+The principle is the same as Table [ActionBar](/components/table-v2#with-actiontoolbar)
+
+
+
+## View Or Edit Record
+
+For detailed instructions, please refer to Table [View Or Edit Record](/components/table-v2#view-or-edit-record)
+
+
diff --git a/packages/core/client/src/schema-component/antd/markdown/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/markdown/demos/demo1.tsx
index c28ca47002..0f367231a0 100644
--- a/packages/core/client/src/schema-component/antd/markdown/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/markdown/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Markdown
diff --git a/packages/core/client/src/schema-component/antd/markdown/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/markdown/demos/demo2.tsx
index f9538c0f71..3aecf7e090 100644
--- a/packages/core/client/src/schema-component/antd/markdown/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/markdown/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Markdown.Void
diff --git a/packages/core/client/src/schema-component/antd/markdown/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/markdown/demos/new-demos/basic.tsx
index afd9cc799a..7a291804a0 100644
--- a/packages/core/client/src/schema-component/antd/markdown/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/markdown/demos/new-demos/basic.tsx
@@ -1,29 +1,34 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'boolean',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'Markdown',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'boolean',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Markdown',
},
},
+}
+const Demo = () => {
+ return
+
+### Read Pretty
+
+```ts
+interface MarkdownReadPrettyProps extends InputTextAreaReadPrettyProps {}
+```
+
+
+
+## Markdown.Void
+
+```ts
+interface MarkdownVoidProps extends Omit
diff --git a/packages/core/client/src/schema-component/antd/menu/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/menu/demos/demo1.tsx
index 6a29c1d1b9..485fd1e3fb 100644
--- a/packages/core/client/src/schema-component/antd/menu/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/menu/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Menu
diff --git a/packages/core/client/src/schema-component/antd/menu/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/menu/demos/demo2.tsx
index a261baaf34..99b2ace94d 100644
--- a/packages/core/client/src/schema-component/antd/menu/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/menu/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Menu
diff --git a/packages/core/client/src/schema-component/antd/menu/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/menu/demos/demo3.tsx
index 8f2924ccdb..cfaa813a23 100644
--- a/packages/core/client/src/schema-component/antd/menu/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/menu/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Menu
diff --git a/packages/core/client/src/schema-component/antd/menu/index.en-US.md b/packages/core/client/src/schema-component/antd/menu/index.en-US.md
new file mode 100644
index 0000000000..a12da5898b
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/menu/index.en-US.md
@@ -0,0 +1,20 @@
+# Menu
+
+## Nodes
+
+- Menu
+- Menu.ItemGroup
+- Menu.Item
+- Menu.SubMenu
+- Menu.Divider
+- Menu.URL
+- Menu.Link
+- Menu.Action
+
+## Examples
+
+
+
+
+
+
diff --git a/packages/core/client/src/schema-component/antd/nanoid-input/demos/basic.tsx b/packages/core/client/src/schema-component/antd/nanoid-input/demos/basic.tsx
index 12faad8ce3..69446578d8 100644
--- a/packages/core/client/src/schema-component/antd/nanoid-input/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/nanoid-input/demos/basic.tsx
@@ -1,30 +1,35 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- default: 'rdQ1G9iPEtjR6BpIAPilZ',
- 'x-decorator': 'FormItem',
- 'x-component': 'NanoIDInput',
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ default: 'rdQ1G9iPEtjR6BpIAPilZ',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'NanoIDInput',
},
},
+}
+const Demo = () => {
+ return
+
+## Read Pretty
+
+
+
+```ts
+type NanoIDInputReadPrettyProps = InputReadPrettyProps
+```
diff --git a/packages/core/client/src/schema-component/antd/page/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/page/demos/demo1.tsx
index 5f31303f5c..e947ddbc50 100644
--- a/packages/core/client/src/schema-component/antd/page/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/page/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import { DocumentTitleProvider, Page, SchemaComponent, SchemaComponentProvider, Application } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/page/index.en-US.md b/packages/core/client/src/schema-component/antd/page/index.en-US.md
new file mode 100644
index 0000000000..1720833bd5
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/page/index.en-US.md
@@ -0,0 +1,5 @@
+# Page
+
+Can be used in conjunction with DocumentTitleProvider to display the page title on document.title.
+
+
diff --git a/packages/core/client/src/schema-component/antd/pagination/demos/basic.tsx b/packages/core/client/src/schema-component/antd/pagination/demos/basic.tsx
index 133bcbc619..ab1c97e79d 100644
--- a/packages/core/client/src/schema-component/antd/pagination/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/pagination/demos/basic.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { Pagination } from '@nocobase/client';
import React from 'react';
diff --git a/packages/core/client/src/schema-component/antd/pagination/demos/hide.tsx b/packages/core/client/src/schema-component/antd/pagination/demos/hide.tsx
index 6027a357e8..e9be8fc480 100644
--- a/packages/core/client/src/schema-component/antd/pagination/demos/hide.tsx
+++ b/packages/core/client/src/schema-component/antd/pagination/demos/hide.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { Pagination } from '@nocobase/client';
import React from 'react';
diff --git a/packages/core/client/src/schema-component/antd/pagination/index.en-US.md b/packages/core/client/src/schema-component/antd/pagination/index.en-US.md
new file mode 100644
index 0000000000..6654587697
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/pagination/index.en-US.md
@@ -0,0 +1,18 @@
+
+# Pagination
+
+Pagination component. It is a wrapper based on the ant-design [Pagination](https://ant.design/components/pagination/) component.
+
+```ts
+interface PaginationProps extends AntdPaginationProps {
+ hidden?: boolean;
+}
+```
+
+## Basic Usage
+
+
+
+## Hide
+
+
diff --git a/packages/core/client/src/schema-component/antd/password/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/password/demos/demo1.tsx
index e7fba7aaad..6747cb98e1 100644
--- a/packages/core/client/src/schema-component/antd/password/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/password/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Password
diff --git a/packages/core/client/src/schema-component/antd/password/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/password/demos/demo2.tsx
index 9cfdda57de..9dcb02374c 100644
--- a/packages/core/client/src/schema-component/antd/password/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/password/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Check strength
diff --git a/packages/core/client/src/schema-component/antd/password/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/password/demos/new-demos/basic.tsx
index 02c68084f3..8e233f1fb0 100644
--- a/packages/core/client/src/schema-component/antd/password/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/password/demos/new-demos/basic.tsx
@@ -1,29 +1,34 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'Password',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Password',
},
},
+}
+const Demo = () => {
+ return
+
+## Check strength
+
+
+
+## Read Pretty
+
+```ts
+interface PasswordReadPrettyProps {
+ value?: string;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/percent/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/percent/demos/new-demos/basic.tsx
index 7e251479db..9fe432e395 100644
--- a/packages/core/client/src/schema-component/antd/percent/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/percent/demos/new-demos/basic.tsx
@@ -1,29 +1,34 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'number',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'Percent',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'number',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Percent',
},
},
+}
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+interface PercentReadPrettyProps extends InputNumberReadPrettyProps {}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/preview/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/preview/demos/demo1.tsx
index 18ae06f67a..4ba017ef52 100644
--- a/packages/core/client/src/schema-component/antd/preview/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/preview/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Preview
diff --git a/packages/core/client/src/schema-component/antd/preview/index.en-US.md b/packages/core/client/src/schema-component/antd/preview/index.en-US.md
new file mode 100644
index 0000000000..4ef4bc6424
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/preview/index.en-US.md
@@ -0,0 +1,14 @@
+# Preview
+
+Used for previewing uploaded files.
+
+```ts
+type UploadProps = Omit
diff --git a/packages/core/client/src/schema-component/antd/quick-edit/demos/basic.tsx b/packages/core/client/src/schema-component/antd/quick-edit/demos/basic.tsx
index cc53ab55c6..38b21aabb8 100644
--- a/packages/core/client/src/schema-component/antd/quick-edit/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/quick-edit/demos/basic.tsx
@@ -1,48 +1,48 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { BlockSchemaComponentPlugin } from '@nocobase/client';
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, BlockSchemaComponentPlugin } from '@nocobase/client';
-const App = getAppComponent({
- designable: true,
- enableUserListDataBlock: true,
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormBlockProvider',
- 'x-use-decorator-props': 'useCreateFormBlockDecoratorProps',
- 'x-decorator-props': {
- collection: 'users',
- },
- 'x-component': 'FormV2',
- 'x-use-component-props': 'useCreateFormBlockProps',
- properties: {
- nickname: {
- default: 'aaa',
- 'x-collection-field': 'roles.long-text',
- 'x-component': 'CollectionField',
- 'x-component-props': {
- ellipsis: true,
- },
- 'x-decorator': 'QuickEdit',
- 'x-decorator-props': {
- labelStyle: {
- display: 'none',
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormBlockProvider',
+ 'x-use-decorator-props': 'useCreateFormBlockDecoratorProps',
+ 'x-decorator-props': {
+ collection: 'users',
+ },
+ 'x-component': 'FormV2',
+ 'x-use-component-props': 'useCreateFormBlockProps',
+ properties: {
+ nickname: {
+ default: 'aaa',
+ 'x-collection-field': 'roles.long-text',
+ 'x-component': 'CollectionField',
+ 'x-component-props': {
+ ellipsis: true,
+ },
+ 'x-decorator': 'QuickEdit',
+ 'x-decorator-props': {
+ labelStyle: {
+ display: 'none',
},
},
},
},
- appOptions: {
- plugins: [BlockSchemaComponentPlugin],
- },
+}
+const Demo = () => {
+ return
+
+## Read Pretty
+
+Under the `'x-pattern': 'readPretty'` configuration, only the text is displayed and the editor is not shown when clicked.
+
+
+
+## SubTable
+
+Used in `SubTable`.
+
+
diff --git a/packages/core/client/src/schema-component/antd/radio/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/radio/demos/demo1.tsx
index 1c599b6eea..2130d310e7 100644
--- a/packages/core/client/src/schema-component/antd/radio/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/radio/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Basic
diff --git a/packages/core/client/src/schema-component/antd/radio/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/radio/demos/demo2.tsx
index 0cbfe1cfef..074bfff24b 100644
--- a/packages/core/client/src/schema-component/antd/radio/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/radio/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Radio Group
diff --git a/packages/core/client/src/schema-component/antd/radio/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/radio/demos/demo3.tsx
index 8bbe22abf4..aaf41048f0 100644
--- a/packages/core/client/src/schema-component/antd/radio/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/radio/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Radio Group with color
diff --git a/packages/core/client/src/schema-component/antd/radio/demos/new-demos/group-basic.tsx b/packages/core/client/src/schema-component/antd/radio/demos/new-demos/group-basic.tsx
index daba013f1a..5648deb98c 100644
--- a/packages/core/client/src/schema-component/antd/radio/demos/new-demos/group-basic.tsx
+++ b/packages/core/client/src/schema-component/antd/radio/demos/new-demos/group-basic.tsx
@@ -1,13 +1,7 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
const options = [
{
@@ -20,22 +14,33 @@ const options = [
},
];
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'number',
- title: 'Test',
- enum: options,
- 'x-decorator': 'FormItem',
- 'x-component': 'Radio.Group',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'number',
+ title: 'Test',
+ enum: options,
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Radio.Group',
},
},
+}
+const Demo = () => {
+ return
+
+### Read Pretty
+
+```ts
+interface RadioReadPrettyProps {
+ value?: boolean;
+}
+```
+
+
+
+## Radio Group
+
+```ts
+type RadioGroupProps = AntdRadioGroupProps;
+```
+
+### Basic Usage
+
+
+
+### Read Pretty
+
+
+
+### Read Pretty with color
+
+
diff --git a/packages/core/client/src/schema-component/antd/record-picker/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/record-picker/demos/demo1.tsx
index 4a76b6cd02..8897b3a6f0 100644
--- a/packages/core/client/src/schema-component/antd/record-picker/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/record-picker/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: 勾选
diff --git a/packages/core/client/src/schema-component/antd/record-picker/demos/mockData.ts b/packages/core/client/src/schema-component/antd/record-picker/demos/mockData.ts
index 4b1d66d1d5..5ccf94ffb0 100644
--- a/packages/core/client/src/schema-component/antd/record-picker/demos/mockData.ts
+++ b/packages/core/client/src/schema-component/antd/record-picker/demos/mockData.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
export default {
data: [
diff --git a/packages/core/client/src/schema-component/antd/record-picker/index.en-US.md b/packages/core/client/src/schema-component/antd/record-picker/index.en-US.md
new file mode 100644
index 0000000000..0790fefafc
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/record-picker/index.en-US.md
@@ -0,0 +1,75 @@
+# RecordPicker
+
+Used for selecting associated fields.
+
+## JSON Schema
+
+### Examples
+
+
+
+Select options through a popup window, where the options are displayed in a table. Configure it within the specific `RecordPicker.RowSelection` node, and it is only effective when `x-read-pretty: false`.
+
+```ts
+{
+ type: 'array',
+ default: [
+ { id: 1, name: 'tag1' },
+ { id: 2, name: 'tag2' },
+ ],
+ 'x-component': 'RecordPicker',
+ properties: {
+ rowSelection: {
+ 'x-component': 'RecordPicker.RowSelection',
+ },
+ },
+}
+```
+
+When `x-read-pretty: true`, you can configure the schema of the selected item in `RecordPicker.SelectedItem`.
+
+```ts
+{
+ type: 'array',
+ 'x-pattern': 'readPretty',
+ 'x-component': 'RecordPicker',
+ properties: {
+ item: {
+ 'x-component': 'RecordPicker.SelectedItem',
+ 'x-component-props': {
+ fieldNames: {
+ value: 'id',
+ label: 'name'
+ },
+ },
+ properties: {
+ drawer1: {
+ 'x-component': 'Action.Drawer',
+ type: 'void',
+ title: 'Drawer Title',
+ properties: {
+ hello1: {
+ 'x-content': 'Hello',
+ title: 'T1',
+ },
+ footer1: {
+ 'x-component': 'Action.Drawer.Footer',
+ type: 'void',
+ properties: {
+ close1: {
+ type: 'void',
+ title: 'Close',
+ 'x-component': 'Action',
+ 'x-component-props': {
+ // useAction: '{{ useCloseAction }}',
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+}
+```
diff --git a/packages/core/client/src/schema-component/antd/remote-select/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/remote-select/demos/demo1.tsx
index f0ffcae1a9..8f4392d407 100644
--- a/packages/core/client/src/schema-component/antd/remote-select/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/remote-select/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { APIClientProvider, FormProvider, RemoteSelect, SchemaComponent } from '@nocobase/client';
import React from 'react';
diff --git a/packages/core/client/src/schema-component/antd/remote-select/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/remote-select/demos/new-demos/basic.tsx
index 5d21f02d7e..45beb75ab3 100644
--- a/packages/core/client/src/schema-component/antd/remote-select/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/remote-select/demos/new-demos/basic.tsx
@@ -1,39 +1,44 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'boolean',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'RemoteSelect',
- 'x-component-props': {
- fieldNames: {
- label: 'title',
- value: 'id',
- },
- service: {
- resource: 'posts',
- action: 'list',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'boolean',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'RemoteSelect',
+ 'x-component-props': {
+ fieldNames: {
+ label: 'title',
+ value: 'id',
+ },
+ service: {
+ resource: 'posts',
+ action: 'list',
},
},
},
},
+}
+const Demo = () => {
+ return
+
+## Manual false
+
+
+
+## Multiple
+
+
+
+## Read Pretty
+
+```ts
+interface RemoteSelectReadPrettyProps extends SelectReadPrettyProps {
+ fieldNames?: SelectProps['fieldNames'];
+ service: ResourceActionOptions;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/rich-text/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/rich-text/demos/demo1.tsx
index 08105e190d..c32ad08431 100644
--- a/packages/core/client/src/schema-component/antd/rich-text/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/rich-text/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { RichText, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/rich-text/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/rich-text/demos/new-demos/basic.tsx
index 35748983b7..d1a244c64f 100644
--- a/packages/core/client/src/schema-component/antd/rich-text/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/rich-text/demos/new-demos/basic.tsx
@@ -1,29 +1,34 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'number',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'RichText',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'number',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'RichText',
},
},
+}
+const Demo = () => {
+ return
+
+## Read Pretty
+
+```ts
+type RichTextReadPrettyProps = HtmlReadPrettyProps;
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/select/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/select/demos/demo1.tsx
index 82bebd6418..4fb48bbcbd 100644
--- a/packages/core/client/src/schema-component/antd/select/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/select/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Select
diff --git a/packages/core/client/src/schema-component/antd/select/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/select/demos/demo2.tsx
index e15f55ec95..73e96ecbdf 100644
--- a/packages/core/client/src/schema-component/antd/select/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/select/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Select
diff --git a/packages/core/client/src/schema-component/antd/select/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/select/demos/demo3.tsx
index 1b2d21dddb..bec4f8363f 100644
--- a/packages/core/client/src/schema-component/antd/select/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/select/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Select
diff --git a/packages/core/client/src/schema-component/antd/select/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/select/demos/new-demos/basic.tsx
index 89897cd0d8..ec76a71735 100644
--- a/packages/core/client/src/schema-component/antd/select/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/select/demos/new-demos/basic.tsx
@@ -1,13 +1,7 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
const options = [
{
@@ -22,22 +16,33 @@ const options = [
{ label: '浙江', value: 'ZX' },
];
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- enum: options,
- 'x-decorator': 'FormItem',
- 'x-component': 'Select',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ enum: options,
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Select',
},
},
+}
+const Demo = () => {
+ return
+
+## Multiple
+
+
+
+## ObjectValue
+
+
+
+## fieldNames
+
+
+
+## Read Pretty
+
+```ts
+interface SelectReadPrettyProps {
+ value: any;
+ options?: any[];
+ ellipsis?: boolean;
+ /**
+ * format options
+ * @default { label: 'label', value: 'value', color: 'color', options: 'children' }
+ */
+ fieldNames?: FieldNames;
+}
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/table-v2/demos/collections.ts b/packages/core/client/src/schema-component/antd/table-v2/demos/collections.ts
index f97060d3a0..de094a788a 100644
--- a/packages/core/client/src/schema-component/antd/table-v2/demos/collections.ts
+++ b/packages/core/client/src/schema-component/antd/table-v2/demos/collections.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
export default {
data: [
diff --git a/packages/core/client/src/schema-component/antd/table-v2/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/table-v2/demos/demo1.tsx
index bde9dc3ed8..c3a3f3dc4f 100644
--- a/packages/core/client/src/schema-component/antd/table-v2/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/table-v2/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema, useForm } from '@formily/react';
import {
diff --git a/packages/core/client/src/schema-component/antd/table-v2/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/table-v2/demos/demo2.tsx
index 60f3fd47c3..2b4fb83c40 100644
--- a/packages/core/client/src/schema-component/antd/table-v2/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/table-v2/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ArrayField } from '@formily/core';
import { connect, ISchema, observer, RecursionField, useField, useFieldSchema } from '@formily/react';
diff --git a/packages/core/client/src/schema-component/antd/table-v2/demos/new-demos/action-toolbar.tsx b/packages/core/client/src/schema-component/antd/table-v2/demos/new-demos/action-toolbar.tsx
index 39af814909..b9d875ab3d 100644
--- a/packages/core/client/src/schema-component/antd/table-v2/demos/new-demos/action-toolbar.tsx
+++ b/packages/core/client/src/schema-component/antd/table-v2/demos/new-demos/action-toolbar.tsx
@@ -1,139 +1,131 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+import React from 'react';
import {
- ActionProps,
TableBlockProvider,
useBulkDestroyActionProps,
- useDataBlockRequest,
useFilterActionProps,
useRefreshActionProps,
useTableBlockProps,
+ SchemaComponent,
+ Plugin,
+ ISchema
} from '@nocobase/client';
-import { getAppComponent } from '@nocobase/test/web';
+import { mockApp } from '@nocobase/client/demo-utils';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- properties: {
- test: {
- type: 'void',
- 'x-decorator': 'TableBlockProvider',
- 'x-decorator-props': {
- collection: 'roles',
- action: 'list',
- params: {
- pageSize: 2,
- },
- showIndex: true,
- dragSort: false,
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ properties: {
+ test: {
+ type: 'void',
+ 'x-decorator': 'TableBlockProvider',
+ 'x-decorator-props': {
+ collection: 'roles',
+ action: 'list',
+ params: {
+ pageSize: 2,
},
- properties: {
- // 添加按钮
- actions: {
- type: 'void',
- 'x-component': 'ActionBar',
- 'x-component-props': {
- style: {
- marginBottom: 20,
- },
+ showIndex: true,
+ dragSort: false,
+ },
+ properties: {
+ // 添加按钮
+ actions: {
+ type: 'void',
+ 'x-component': 'ActionBar',
+ 'x-component-props': {
+ style: {
+ marginBottom: 20,
},
- properties: {
- filter: {
- 'x-component': 'Filter.Action',
- 'x-use-component-props': 'useFilterActionProps',
- 'x-component-props': {
- icon: 'FilterOutlined',
- },
- 'x-align': 'left',
+ },
+ properties: {
+ filter: {
+ 'x-component': 'Filter.Action',
+ 'x-use-component-props': 'useFilterActionProps',
+ 'x-component-props': {
+ icon: 'FilterOutlined',
},
- refresh: {
- title: 'Refresh',
- 'x-component': 'Action',
- 'x-align': 'left',
- 'x-use-component-props': 'useRefreshActionProps',
+ 'x-align': 'left',
+ },
+ refresh: {
+ title: 'Refresh',
+ 'x-component': 'Action',
+ 'x-align': 'left',
+ 'x-use-component-props': 'useRefreshActionProps',
+ },
+ add: {
+ type: 'void',
+ 'x-component': 'Action',
+ title: 'Add New',
+ 'x-align': 'right',
+ 'x-component-props': {
+ type: 'primary',
},
- add: {
- type: 'void',
- 'x-component': 'Action',
- title: 'Add New',
- 'x-align': 'right',
- 'x-component-props': {
- type: 'primary',
- },
- properties: {
- drawer: {
- type: 'void',
- 'x-component': 'Action.Drawer',
- title: 'Drawer Title',
- properties: {
- tip: {
- type: 'void',
- 'x-component': 'Markdown.Void',
- 'x-editable': false,
- 'x-component-props': {
- content: '请查看 [Action.Drawer](/components/action) 组件的文档',
- },
+ properties: {
+ drawer: {
+ type: 'void',
+ 'x-component': 'Action.Drawer',
+ title: 'Drawer Title',
+ properties: {
+ tip: {
+ type: 'void',
+ 'x-component': 'Markdown.Void',
+ 'x-editable': false,
+ 'x-component-props': {
+ content: '请查看 [Action.Drawer](/components/action) 组件的文档',
},
},
},
},
},
- bucketDelete: {
- title: 'Delete',
- 'x-action': 'destroy',
- 'x-component': 'Action',
- 'x-use-component-props': 'useBulkDestroyActionProps',
- 'x-component-props': {
- icon: 'DeleteOutlined',
- confirm: {
- title: "{{t('Delete record')}}",
- content: "{{t('Are you sure you want to delete it?')}}",
- },
+ },
+ bucketDelete: {
+ title: 'Delete',
+ 'x-action': 'destroy',
+ 'x-component': 'Action',
+ 'x-use-component-props': 'useBulkDestroyActionProps',
+ 'x-component-props': {
+ icon: 'DeleteOutlined',
+ confirm: {
+ title: "{{t('Delete record')}}",
+ content: "{{t('Are you sure you want to delete it?')}}",
},
},
},
},
- table: {
- type: 'array',
- 'x-component': 'TableV2',
- 'x-use-component-props': 'useTableBlockProps',
- 'x-component-props': {
- rowKey: 'id',
- rowSelection: {
- type: 'checkbox',
- },
+ },
+ table: {
+ type: 'array',
+ 'x-component': 'TableV2',
+ 'x-use-component-props': 'useTableBlockProps',
+ 'x-component-props': {
+ rowKey: 'id',
+ rowSelection: {
+ type: 'checkbox',
},
- properties: {
- column1: {
- type: 'void',
- title: 'Username',
- 'x-component': 'TableV2.Column',
- properties: {
- name: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-pattern': 'readPretty',
- },
+ },
+ properties: {
+ column1: {
+ type: 'void',
+ title: 'Username',
+ 'x-component': 'TableV2.Column',
+ properties: {
+ name: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-pattern': 'readPretty',
},
},
- column2: {
- type: 'void',
- title: 'Nickname',
- 'x-component': 'TableV2.Column',
- properties: {
- title: {
- type: 'string',
- 'x-component': 'CollectionField',
- 'x-pattern': 'readPretty',
- },
+ },
+ column2: {
+ type: 'void',
+ title: 'Nickname',
+ 'x-component': 'TableV2.Column',
+ properties: {
+ title: {
+ type: 'string',
+ 'x-component': 'CollectionField',
+ 'x-pattern': 'readPretty',
},
},
},
@@ -142,18 +134,28 @@ const App = getAppComponent({
},
},
},
- appOptions: {
- components: {
- TableBlockProvider,
- },
- scopes: {
- useTableBlockProps,
- useBulkDestroyActionProps,
- useRefreshActionProps,
- useFilterActionProps,
- },
+}
+const Demo = () => {
+ return
+
+## Extends Collection
+
+If the Collection is not created through the DataSource Manager but is custom extended, you can refer to [ExtendCollectionsProvider](/core/data-source/extend-collections-provider).
+
+
+
+## With ActionToolbar
+
+We can combine [ActionToolbar](/components/action#actionbar) to implement the operation bar of the table, such as adding, refreshing, filtering, and batch deletion.
+
+- Refresh button: can be directly used with the built-in `useRefreshActionProps()`
+- Batch delete button: can be used with the built-in `useBulkDestroyActionProps()`
+- Filter button: can be directly used with [Filter.Action](/components/filter) and `useFilterActionProps`
+- For adding button, you can refer to the usage of [Action.Drawer](/components/action#与-form-结合)
+
+If you want to customize, you can use [useDataBlockResource()](/core/data-block/data-block-resource-provider) and [useDataBlockRequest()](/core/data-block/data-block-request-provider#usedatablockrequest) to manipulate the data.
+
+
+
+## View Or Edit Record
+
+The `Table` component passes the data of the current row to the underlying components through [CollectionRecordProvider](/core/data-block/collection-record-provider), and we can use [useCollectionRecord()](/core/data-block/collection-record-provider#usecollectionrecord) to get the data of the current row.
+
+Then, we use `useFormBlockProviderProps()` to pass the configuration and data of the table to the [FormBlockProvider](http://localhost:8000/components/form-v2#%E8%8E%B7%E5%8F%96%E6%95%B0%E6%8D%AE%E8%A1%A8%E6%95%B0%E6%8D%AE) component, and the `FormBlockProvider` will automatically request the form data and configuration.
+
+Then, we use `useFormBlockProps()` to pass the data to the `Form` component.
+
+In the editing scenario, we can update the data and refresh the list using [useDataBlockResource()](/core/data-block/data-block-resource-provider) and [useDataBlockRequest()](/core/data-block/data-block-request-provider#usedatablockrequest).
+
+
diff --git a/packages/core/client/src/schema-component/antd/table/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/table/demos/demo1.tsx
index 47ad4a4274..d759d16e0e 100644
--- a/packages/core/client/src/schema-component/antd/table/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/table/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import { Application, Input, SchemaComponent, SchemaComponentProvider, Table } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/table/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/table/demos/demo2.tsx
index 0bc63ebd0b..afb4d04cb0 100644
--- a/packages/core/client/src/schema-component/antd/table/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/table/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import { Application, Input, SchemaComponent, SchemaComponentProvider, Table } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/table/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/table/demos/demo3.tsx
index 3ddc6c47d5..6fee5b1384 100644
--- a/packages/core/client/src/schema-component/antd/table/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/table/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import { Application, Input, SchemaComponent, SchemaComponentProvider, Table } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/table/demos/demo4.tsx b/packages/core/client/src/schema-component/antd/table/demos/demo4.tsx
index 5e4ad5cc2e..2b23ba6aa5 100644
--- a/packages/core/client/src/schema-component/antd/table/demos/demo4.tsx
+++ b/packages/core/client/src/schema-component/antd/table/demos/demo4.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema, observer } from '@formily/react';
import { uid } from '@formily/shared';
diff --git a/packages/core/client/src/schema-component/antd/table/index.en-US.md b/packages/core/client/src/schema-component/antd/table/index.en-US.md
new file mode 100644
index 0000000000..55b7206c71
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/table/index.en-US.md
@@ -0,0 +1,22 @@
+# Table
+
+- `Table.Void`
+- `Table.RowSelection`
+- `Table.Array`
+
+
+## Table.Array
+
+
+
+## Table.Void
+
+
+
+## Table.RowSelection
+
+
+
+## With Actions
+
+
diff --git a/packages/core/client/src/schema-component/antd/tabs/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/tabs/demos/demo1.tsx
index d53d21e707..f541e0215b 100644
--- a/packages/core/client/src/schema-component/antd/tabs/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/tabs/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Tabs
diff --git a/packages/core/client/src/schema-component/antd/tabs/index.en-US.md b/packages/core/client/src/schema-component/antd/tabs/index.en-US.md
new file mode 100644
index 0000000000..bf17d43256
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/tabs/index.en-US.md
@@ -0,0 +1,5 @@
+# Tabs
+
+Tabs. It is a wrapper based on the antd [Tabs](https://ant.design/components/tabs/) component, and requires the use of both the `Tabs` and `Tabs.TabPane` components.
+
+
diff --git a/packages/core/client/src/schema-component/antd/time-picker/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/time-picker/demos/demo1.tsx
index daa0fa3931..6287d236dc 100644
--- a/packages/core/client/src/schema-component/antd/time-picker/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/time-picker/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: TimePicker
diff --git a/packages/core/client/src/schema-component/antd/time-picker/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/time-picker/demos/demo2.tsx
index 61cdb54321..a5b744fb97 100644
--- a/packages/core/client/src/schema-component/antd/time-picker/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/time-picker/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: TimePicker.RangePicker
diff --git a/packages/core/client/src/schema-component/antd/time-picker/demos/new-demos/time-range-read-pretty.tsx b/packages/core/client/src/schema-component/antd/time-picker/demos/new-demos/time-range-read-pretty.tsx
index b2867ecd48..ba5a34b9ee 100644
--- a/packages/core/client/src/schema-component/antd/time-picker/demos/new-demos/time-range-read-pretty.tsx
+++ b/packages/core/client/src/schema-component/antd/time-picker/demos/new-demos/time-range-read-pretty.tsx
@@ -1,31 +1,36 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- 'x-pattern': 'readPretty',
- properties: {
- test: {
- type: 'string',
- title: 'Test',
- default: ['17:02:18', '18:45:24'],
- 'x-decorator': 'FormItem',
- 'x-component': 'TimePicker.RangePicker',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ 'x-pattern': 'readPretty',
+ properties: {
+ test: {
+ type: 'string',
+ title: 'Test',
+ default: ['17:02:18', '18:45:24'],
+ 'x-decorator': 'FormItem',
+ 'x-component': 'TimePicker.RangePicker',
},
},
+}
+const Demo = () => {
+ return
+
+### Read Pretty
+
+```ts
+interface TimePickerReadPrettyProps {
+ format?: string;
+ style?: React.CSSProperties;
+ value: string | string[];
+ className?: string;
+ prefixCls?: string;
+}
+```
+
+
+
+## Time Range Picker
+
+### Basic Usage
+
+```ts
+type TimeRangePickerProps = AntdTimePickerProps
+```
+
+
+
+### Read Pretty
+
+```ts
+type TimeRangePickerReadPrettyProps = TimePickerReadPrettyProps;
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/tree-select/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/tree-select/demos/demo1.tsx
index 26b7a699dc..48c706c1fb 100644
--- a/packages/core/client/src/schema-component/antd/tree-select/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/tree-select/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: TreeSelect
diff --git a/packages/core/client/src/schema-component/antd/tree-select/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/tree-select/demos/new-demos/basic.tsx
index ca1e5597f1..ebac2aa1d0 100644
--- a/packages/core/client/src/schema-component/antd/tree-select/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/tree-select/demos/new-demos/basic.tsx
@@ -1,13 +1,8 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
const dataSource = [
{
@@ -48,24 +43,37 @@ const dataSource = [
},
];
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'boolean',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'TreeSelect',
- 'x-component-props': {
- treeData: dataSource,
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'boolean',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'TreeSelect',
+ 'x-component-props': {
+ treeData: dataSource,
},
},
},
+}
+const Demo = () => {
+ return
+
+## Read Pretty
+
+
diff --git a/packages/core/client/src/schema-component/antd/unix-timestamp/demos/basic.tsx b/packages/core/client/src/schema-component/antd/unix-timestamp/demos/basic.tsx
index dfe1e4d25b..46a7384903 100644
--- a/packages/core/client/src/schema-component/antd/unix-timestamp/demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/unix-timestamp/demos/basic.tsx
@@ -1,29 +1,36 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'number',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'UnixTimestamp',
- },
+const schema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'number',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'UnixTimestamp',
},
},
+}
+const Demo = () => {
+ return
+
+## accuracy: second
+
+
+
+## Read Pretty
+
+
diff --git a/packages/core/client/src/schema-component/antd/upload/demos/apiClient.ts b/packages/core/client/src/schema-component/antd/upload/demos/apiClient.ts
index 16964c0396..ee75fa4be4 100644
--- a/packages/core/client/src/schema-component/antd/upload/demos/apiClient.ts
+++ b/packages/core/client/src/schema-component/antd/upload/demos/apiClient.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { mockAPIClient } from '../../../../testUtils';
diff --git a/packages/core/client/src/schema-component/antd/upload/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/upload/demos/demo1.tsx
index af94251053..cd761739bf 100644
--- a/packages/core/client/src/schema-component/antd/upload/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/upload/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Upload
diff --git a/packages/core/client/src/schema-component/antd/upload/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/upload/demos/demo2.tsx
index 2e1bdb3233..53ac33b104 100644
--- a/packages/core/client/src/schema-component/antd/upload/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/upload/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Upload
diff --git a/packages/core/client/src/schema-component/antd/upload/demos/new-demos/basic.tsx b/packages/core/client/src/schema-component/antd/upload/demos/new-demos/basic.tsx
index 2282e6f480..7f12b8b337 100644
--- a/packages/core/client/src/schema-component/antd/upload/demos/new-demos/basic.tsx
+++ b/packages/core/client/src/schema-component/antd/upload/demos/new-demos/basic.tsx
@@ -1,32 +1,37 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
-import { getAppComponent } from '@nocobase/test/web';
+import React from 'react';
+import { mockApp } from '@nocobase/client/demo-utils';
+import { SchemaComponent, Plugin, ISchema } from '@nocobase/client';
-const App = getAppComponent({
- schema: {
- type: 'void',
- name: 'root',
- 'x-decorator': 'FormV2',
- 'x-component': 'ShowFormData',
- properties: {
- test: {
- type: 'boolean',
- title: 'Test',
- 'x-decorator': 'FormItem',
- 'x-component': 'Upload.Attachment',
- 'x-component-props': {
- action: 'attachments:create',
- },
+const schema: ISchema = {
+ type: 'void',
+ name: 'root',
+ 'x-decorator': 'FormV2',
+ 'x-component': 'ShowFormData',
+ properties: {
+ test: {
+ type: 'boolean',
+ title: 'Test',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Upload.Attachment',
+ 'x-component-props': {
+ action: 'attachments:create',
},
},
},
+}
+const Demo = () => {
+ return
+
+## Multiple
+
+
+
+## Read Pretty
+
+```ts
+type UploadReadPrettyProps = AntdUploadProps;
+```
+
+
diff --git a/packages/core/client/src/schema-component/antd/variable/demos/demo1.tsx b/packages/core/client/src/schema-component/antd/variable/demos/demo1.tsx
index 0bb09cb4be..e58c127ad4 100644
--- a/packages/core/client/src/schema-component/antd/variable/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/antd/variable/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { SchemaComponent, SchemaComponentProvider, Variable } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/variable/demos/demo2.tsx b/packages/core/client/src/schema-component/antd/variable/demos/demo2.tsx
index df91d88333..eb1149c709 100644
--- a/packages/core/client/src/schema-component/antd/variable/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/antd/variable/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { SchemaComponent, SchemaComponentProvider, Variable } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/variable/demos/demo3.tsx b/packages/core/client/src/schema-component/antd/variable/demos/demo3.tsx
index 2c28796153..008a495d9e 100644
--- a/packages/core/client/src/schema-component/antd/variable/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/antd/variable/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { FormItem } from '@formily/antd-v5';
import { SchemaComponent, SchemaComponentProvider, Variable } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-component/antd/variable/index.en-US.md b/packages/core/client/src/schema-component/antd/variable/index.en-US.md
new file mode 100644
index 0000000000..f6987d2cc9
--- /dev/null
+++ b/packages/core/client/src/schema-component/antd/variable/index.en-US.md
@@ -0,0 +1,32 @@
+# Variable
+
+Variable selector.
+
+## `Variable.Input`
+
+```ts
+import type { DefaultOptionType } from 'antd/lib/cascader';
+ type VariableInputProps = {
+ value?: string;
+ scope?: DefaultOptionType[] | (() => DefaultOptionType[]);
+ onChange: (value: string, optionPath?: any[]) => void;
+ children?: any;
+ button?: React.ReactElement;
+ useTypedConstant?: true | string[];
+ changeOnSelect?: CascaderProps['changeOnSelect'];
+ fieldNames?: CascaderProps['fieldNames'];
+ disabled?: boolean;
+ style?: React.CSSProperties;
+ className?: string;
+}
+```
+
+
+
+### `Variable.TextArea`
+
+
+
+### `Variable.JSON`
+
+
diff --git a/packages/core/client/src/schema-component/common/index.ts b/packages/core/client/src/schema-component/common/index.ts
index 2094c381a4..1a90fbeee7 100644
--- a/packages/core/client/src/schema-component/common/index.ts
+++ b/packages/core/client/src/schema-component/common/index.ts
@@ -9,3 +9,4 @@
export * from './dnd-context';
export * from './sortable-item';
+export * from './show-form-data';
diff --git a/packages/core/client/src/schema-component/common/show-form-data/index.tsx b/packages/core/client/src/schema-component/common/show-form-data/index.tsx
new file mode 100644
index 0000000000..a4dd6c335d
--- /dev/null
+++ b/packages/core/client/src/schema-component/common/show-form-data/index.tsx
@@ -0,0 +1,29 @@
+/**
+ * This file is part of the NocoBase (R) project.
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
+ * Authors: NocoBase Team.
+ *
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
+ * For more information, please refer to: https://www.nocobase.com/agreement.
+ */
+
+import React from 'react';
+import { observer, useForm } from '@formily/react';
+
+/**
+ * show form data for doc demo
+ * @internal
+ */
+export const ShowFormData = observer(({ children }) => {
+ const form = useForm();
+ return (
+ <>
+ {
+
+ {JSON.stringify(form.values, null, 2)}
+
+ }
+ {children}
+ >
+ );
+});
diff --git a/packages/core/client/src/schema-component/demos/demo1.tsx b/packages/core/client/src/schema-component/demos/demo1.tsx
index 4b2640fd68..ba92f85eac 100644
--- a/packages/core/client/src/schema-component/demos/demo1.tsx
+++ b/packages/core/client/src/schema-component/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Insert Adjacent
diff --git a/packages/core/client/src/schema-component/demos/demo2.tsx b/packages/core/client/src/schema-component/demos/demo2.tsx
index 81f2c8a934..66f6a5648e 100644
--- a/packages/core/client/src/schema-component/demos/demo2.tsx
+++ b/packages/core/client/src/schema-component/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { SchemaComponentProvider, useSchemaComponentContext } from '@nocobase/client';
import { Button } from 'antd';
diff --git a/packages/core/client/src/schema-component/demos/demo3.tsx b/packages/core/client/src/schema-component/demos/demo3.tsx
index e7194366e8..19e27f5a09 100644
--- a/packages/core/client/src/schema-component/demos/demo3.tsx
+++ b/packages/core/client/src/schema-component/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { SchemaComponentProvider, useSchemaComponentContext } from '@nocobase/client';
import { Button } from 'antd';
diff --git a/packages/core/client/src/schema-component/demos/demo4.tsx b/packages/core/client/src/schema-component/demos/demo4.tsx
index 4cd1c1e013..12be347a60 100644
--- a/packages/core/client/src/schema-component/demos/demo4.tsx
+++ b/packages/core/client/src/schema-component/demos/demo4.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { SchemaComponentProvider, useSchemaComponentContext } from '@nocobase/client';
import { Button } from 'antd';
diff --git a/packages/core/client/src/schema-initializer/demos/basic.tsx b/packages/core/client/src/schema-initializer/demos/basic.tsx
index 39cbf277c2..00d024f891 100644
--- a/packages/core/client/src/schema-initializer/demos/basic.tsx
+++ b/packages/core/client/src/schema-initializer/demos/basic.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
Application,
diff --git a/packages/core/client/src/schema-initializer/demos/build-type.tsx b/packages/core/client/src/schema-initializer/demos/build-type.tsx
index e38535a7ac..9a436ffe8d 100644
--- a/packages/core/client/src/schema-initializer/demos/build-type.tsx
+++ b/packages/core/client/src/schema-initializer/demos/build-type.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
Application,
diff --git a/packages/core/client/src/schema-initializer/demos/custom-button.tsx b/packages/core/client/src/schema-initializer/demos/custom-button.tsx
index 7c0cc39625..8736b60a73 100644
--- a/packages/core/client/src/schema-initializer/demos/custom-button.tsx
+++ b/packages/core/client/src/schema-initializer/demos/custom-button.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import { Application, Plugin, SchemaInitializer, useSchemaInitializerRender } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-initializer/demos/custom-items-component.tsx b/packages/core/client/src/schema-initializer/demos/custom-items-component.tsx
index 98ba1566ea..a2b273111d 100644
--- a/packages/core/client/src/schema-initializer/demos/custom-items-component.tsx
+++ b/packages/core/client/src/schema-initializer/demos/custom-items-component.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React, { FC } from 'react';
import {
diff --git a/packages/core/client/src/schema-initializer/demos/dynamic-visible-children.tsx b/packages/core/client/src/schema-initializer/demos/dynamic-visible-children.tsx
index 3b34f22559..186f84914f 100644
--- a/packages/core/client/src/schema-initializer/demos/dynamic-visible-children.tsx
+++ b/packages/core/client/src/schema-initializer/demos/dynamic-visible-children.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
Application,
diff --git a/packages/core/client/src/schema-initializer/demos/insert-schema-action.tsx b/packages/core/client/src/schema-initializer/demos/insert-schema-action.tsx
index 80b946478b..4c717d7f9b 100644
--- a/packages/core/client/src/schema-initializer/demos/insert-schema-action.tsx
+++ b/packages/core/client/src/schema-initializer/demos/insert-schema-action.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
Action,
diff --git a/packages/core/client/src/schema-initializer/demos/insert-schema-basic.tsx b/packages/core/client/src/schema-initializer/demos/insert-schema-basic.tsx
index 828f7a9bf2..2a88cc371b 100644
--- a/packages/core/client/src/schema-initializer/demos/insert-schema-basic.tsx
+++ b/packages/core/client/src/schema-initializer/demos/insert-schema-basic.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import {
diff --git a/packages/core/client/src/schema-initializer/demos/insert-schema-form-item.tsx b/packages/core/client/src/schema-initializer/demos/insert-schema-form-item.tsx
index 304f21d3ac..619b1206ef 100644
--- a/packages/core/client/src/schema-initializer/demos/insert-schema-form-item.tsx
+++ b/packages/core/client/src/schema-initializer/demos/insert-schema-form-item.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
Application,
diff --git a/packages/core/client/src/schema-initializer/demos/nested-items.tsx b/packages/core/client/src/schema-initializer/demos/nested-items.tsx
index 043c4ea4ce..58dd8a2a7d 100644
--- a/packages/core/client/src/schema-initializer/demos/nested-items.tsx
+++ b/packages/core/client/src/schema-initializer/demos/nested-items.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React, { FC } from 'react';
import {
diff --git a/packages/core/client/src/schema-settings/demos/basic.tsx b/packages/core/client/src/schema-settings/demos/basic.tsx
index c7c31cb6cf..47c3824d65 100644
--- a/packages/core/client/src/schema-settings/demos/basic.tsx
+++ b/packages/core/client/src/schema-settings/demos/basic.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React, { FC } from 'react';
import { Application, Plugin, SchemaSettings, SchemaSettingsItem, useSchemaSettingsRender } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-settings/demos/built-type.tsx b/packages/core/client/src/schema-settings/demos/built-type.tsx
index edc1f7b0b1..ff7a0beaf5 100644
--- a/packages/core/client/src/schema-settings/demos/built-type.tsx
+++ b/packages/core/client/src/schema-settings/demos/built-type.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import { Input } from 'antd';
diff --git a/packages/core/client/src/schema-settings/demos/custom-component.tsx b/packages/core/client/src/schema-settings/demos/custom-component.tsx
index e7a3535e04..6bdc60bc05 100644
--- a/packages/core/client/src/schema-settings/demos/custom-component.tsx
+++ b/packages/core/client/src/schema-settings/demos/custom-component.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import { Application, Plugin, SchemaSettings, useSchemaSettingsRender } from '@nocobase/client';
diff --git a/packages/core/client/src/schema-settings/demos/demo3.tsx b/packages/core/client/src/schema-settings/demos/demo3.tsx
index 22703fff1c..fb2b59e680 100644
--- a/packages/core/client/src/schema-settings/demos/demo3.tsx
+++ b/packages/core/client/src/schema-settings/demos/demo3.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import {
Application,
diff --git a/packages/core/client/src/schema-settings/demos/schema-basic.tsx b/packages/core/client/src/schema-settings/demos/schema-basic.tsx
index 9a1120e56b..27d5e364c0 100644
--- a/packages/core/client/src/schema-settings/demos/schema-basic.tsx
+++ b/packages/core/client/src/schema-settings/demos/schema-basic.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import React from 'react';
import {
diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/collections.ts b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/collections.ts
index f97060d3a0..de094a788a 100644
--- a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/collections.ts
+++ b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/collections.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
export default {
data: [
diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/data.ts b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/data.ts
index ed30cdd3a0..93fde9ae3e 100644
--- a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/data.ts
+++ b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/data.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
export default {
data: [
diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/defaultValues.ts b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/defaultValues.ts
index 91094e10b7..d1645b8114 100644
--- a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/defaultValues.ts
+++ b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/defaultValues.ts
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
const now = new Date();
diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo1.tsx b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo1.tsx
index 2e0d47c874..8256e618d1 100644
--- a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo1.tsx
+++ b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Calendar
diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo2.tsx b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo2.tsx
index 648d8531e2..4c5abf3de4 100644
--- a/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo2.tsx
+++ b/packages/plugins/@nocobase/plugin-calendar/src/client/calendar/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { ISchema } from '@formily/react';
import {
diff --git a/packages/plugins/@nocobase/plugin-field-formula/src/client/components/Formula/demos/demo2.tsx b/packages/plugins/@nocobase/plugin-field-formula/src/client/components/Formula/demos/demo2.tsx
index c8d8cb3ffe..0119ad807e 100644
--- a/packages/plugins/@nocobase/plugin-field-formula/src/client/components/Formula/demos/demo2.tsx
+++ b/packages/plugins/@nocobase/plugin-field-formula/src/client/components/Formula/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
/**
* title: Formula
diff --git a/packages/plugins/@nocobase/plugin-gantt/src/client/demos/demo1.tsx b/packages/plugins/@nocobase/plugin-gantt/src/client/demos/demo1.tsx
index f87d7365a1..eaadc7d520 100644
--- a/packages/plugins/@nocobase/plugin-gantt/src/client/demos/demo1.tsx
+++ b/packages/plugins/@nocobase/plugin-gantt/src/client/demos/demo1.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { Gantt, SchemaComponent, SchemaComponentProvider, useGanttBlockProps } from '@nocobase/client';
import React from 'react';
diff --git a/packages/plugins/@nocobase/plugin-kanban/src/client/board/demos/demo2.tsx b/packages/plugins/@nocobase/plugin-kanban/src/client/board/demos/demo2.tsx
index ed1e3730bd..fb754c3ee6 100644
--- a/packages/plugins/@nocobase/plugin-kanban/src/client/board/demos/demo2.tsx
+++ b/packages/plugins/@nocobase/plugin-kanban/src/client/board/demos/demo2.tsx
@@ -1,11 +1,4 @@
-/**
- * This file is part of the NocoBase (R) project.
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
- * Authors: NocoBase Team.
- *
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
- * For more information, please refer to: https://www.nocobase.com/agreement.
- */
+
import { Board } from '@nocobase/client';
import { Button, Card } from 'antd';