@next-bricks/presentational-bricks 1.252.3 → 1.253.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/deploy/contract.yaml +111 -111
- package/dist/bricks.json +25 -25
- package/dist/{index.3e85d477.js → index.98c10686.js} +2 -2
- package/dist/index.98c10686.js.map +1 -0
- package/dist/lazy-bricks/{~bricks-use-form-and-markdown.dd92.e3d0b1fd.js → ~bricks-use-form-and-markdown.dd92.ed1f9278.js} +2 -2
- package/dist/lazy-bricks/~bricks-use-form-and-markdown.dd92.ed1f9278.js.map +1 -0
- package/dist/stories.json +7 -7
- package/package.json +2 -2
- package/dist/index.3e85d477.js.map +0 -1
- package/dist/lazy-bricks/~bricks-use-form-and-markdown.dd92.e3d0b1fd.js.map +0 -1
package/dist/stories.json
CHANGED
|
@@ -6410,7 +6410,7 @@
|
|
|
6410
6410
|
"change": "新增 `shouldUpdateUrlParams` 属性和 `sort.update` 事件"
|
|
6411
6411
|
}
|
|
6412
6412
|
],
|
|
6413
|
-
"memo": "> Tips: 在 react 中,boolean 类型的值是合法的子元素,但是不会被渲染出来。如果希望 boolean 值在表格单元格中展示成 `true`|`false`,可以使用平台管道进行转换,例如`@{someProperties|string}`。更多场景下可以结合 [基本数值映射构件](developers/brick-book/brick/presentational-bricks.brick-value-mapping) 把 boolean 类型的值转换成有意义的文本进行展示。\n### CustomColumn\n| property | type | required | default | description |\n| -------------------- | --------------------- | -------- | ------- | -------------------------------------------------------------- |\n| valueSuffix | string | - | - | 字段的值展示时的后缀 |\n| useBrick | UseBrickConf | - | - | 支持为某列自定义展示构件, 具体查看 [UseBrickConf](/next-docs/docs/api-reference/brick-types.usesinglebrickconf) |\n| titleUseBrick | UseBrickConf | - | - | 支持为某列的标题自定义展示构件,可通过 DATA.title 获取标题文本,具体查看 [UseBrickConf](/next-docs/docs/api-reference/brick-types.usesinglebrickconf) |\n| filters | {text:string,value:any}[] | - | - | 表头的筛选菜单项 |\n| verticalAlign | top \\| bottom | - | - | 单元格内元素的垂直对齐方式 |\n| colSpanKey | string | - | - | 每条记录的控制列合并的值的 key |\n| rowSpanKey | string | - | - | 每条记录的控制行合并的值的 key。如果希望将树形列表展平,并计算行合并的值,可以使用 flattenTreeDataListAndCalcRowSpan 自定义加工函数
|
|
6413
|
+
"memo": "> Tips: 在 react 中,boolean 类型的值是合法的子元素,但是不会被渲染出来。如果希望 boolean 值在表格单元格中展示成 `true`|`false`,可以使用平台管道进行转换,例如`@{someProperties|string}`。更多场景下可以结合 [基本数值映射构件](developers/brick-book/brick/presentational-bricks.brick-value-mapping) 把 boolean 类型的值转换成有意义的文本进行展示。\n### CustomColumn\n| property | type | required | default | description |\n| -------------------- | --------------------- | -------- | ------- | -------------------------------------------------------------- |\n| valueSuffix | string | - | - | 字段的值展示时的后缀 |\n| useBrick | UseBrickConf | - | - | 支持为某列自定义展示构件, 具体查看 [UseBrickConf](/next-docs/docs/api-reference/brick-types.usesinglebrickconf) |\n| titleUseBrick | UseBrickConf | - | - | 支持为某列的标题自定义展示构件,可通过 DATA.title 获取标题文本,具体查看 [UseBrickConf](/next-docs/docs/api-reference/brick-types.usesinglebrickconf) |\n| filters | {text:string,value:any}[] | - | - | 表头的筛选菜单项 |\n| verticalAlign | top \\| bottom | - | - | 单元格内元素的垂直对齐方式 |\n| colSpanKey | string | - | - | 每条记录的控制列合并的值的 key |\n| rowSpanKey | string | - | - | 每条记录的控制行合并的值的 key。如果希望将树形列表展平,并计算行合并的值,可以使用 flattenTreeDataListAndCalcRowSpan 自定义加工函数 |\n| ~~component~~ | ~~CustomColumnComponent~~ | - | - | ~~Deprecated。支持为某列自定义展示构件~~ |\n\n### UseBrickConf\n\n| property | type | required | default | description |\n| ------------- | -------------- | -------- | ------- | -------------------------------------------------- |\n| brick | string | ✔️ | - | 构件名称 |\n| properties | object | - | - | 构件属性 |\n| events | BrickEventsMap | - | - | 事件 |\n| transform | string\\|object | - | - | 属性数据转换 |\n| transformFrom | string | - | - | 属性数据转换来自数据源的哪个字段,不填则为整个数据 |\n\n`<presentational-bricks.brick-table>` 为某列自定义展示构件传递的数据源为:\n\n| field | type | description |\n| ----------- | ------ | ----------- |\n| cellData | any | 单元格数据 |\n| rowData | any | 整行数据 |\n| columnIndex | number | 列序号 |\n\n`<presentational-bricks.brick-table>` 为自定义行展开的构件传递的数据源为:\n\n| field | type | description |\n| -------- | ------ | ----------- |\n| rowData | any | 整行数据 |\n| rowIndex | number | 行序号 |\n\n### <del>CustomColumnComponent</del>\n\n<details>\n<summary>展开</summary>\n\n| property | type | required | default | description |\n| ---------- | -------------------------------------------- | -------- | ------- | ----------------------------------------------- |\n| brick | string | ✔️ | - | 构件名称 |\n| fields | {value: string; item: string; index: string} | ✔️ | - | 字段值、列表项和 index 对应所用构件的属性的 key |\n| properties | object | - | - | 构件属性 |\n| events | BrickEventsMap | - | - | 事件 |\n\n</details>\n\n### fields\n| property | type | required | default | description |\n| ---------- | ------ | -------- | -------- | -------------------------------------------------------------------------------------------------------- |\n| fields | fieldsType | - | - | 设置相关字段取自哪里,具体描述见下表 |\n\n### fieldsType\n| property | type | required | default | description |\n| ---------- | ------ | -------- | -------- | -------------------------------------------------------------------------------------------------------- |\n| dataSource | string | - | list | 指定 dataSource 从哪里来,默认为列表接口返回格式是{list:[],page:1,pageSize:10,total:20},即默认取自 list |\n| total | string | - | total | 指定 total 从哪里来,默认为列表接口返回格式是{list:[],page:1,pageSize:10,total:20},即默认取自 total |\n| page | string | - | page | 指定下表中 \"page.update\" 事件 detail 的 pagePath |\n| pageSize | string | - | pageSize | 指定下表 \"filter.update\" 事件 detail 的 pageSizePath |\n| ascend | string | - | ascend | 指定 ascend 升序排序对应字段,例如有些后台对应为 1 ,有些对应为 \"asc\"。这里默认为 \"ascend\" |\n| descend | string | - | descend | 指定 descend 降序排序对应字段,例如有些后台对应为 0 ,有些对应为 \"desc\"。这里默认为 \"descend\" |\n\n### pagination 默认配置\n\n如果不希望分页,如下设置即可:\n\n```\n{\n \"configProps\": {\n \"pagination\": false\n }\n}\n```\n\n如果希望覆盖默认配置,覆盖对应项即可,相关配置项具体查阅:[pagination](https://ant.design/components/pagination-cn/#API)\n\n```\n{\n \"configProps\": {\n \"pagination\": {\n \"pageSizeOptions\": [\"10\",\"100\",\"1000\"]\n }\n }\n}\n```\n\n| property | type | required | default | description |\n| --------------- | -------- | -------- | ------------------ | ------------------------------------- |\n| current | string | - | - | 页码,从 page properties 获取 |\n| pageSize | string | - | - | 每页条数,从 pageSize properties 获取 |\n| total | object | - | - | 总数,从 dataSource.total 获取 |\n| showSizeChanger | boolean | - | true | 展示页码变化器 |\n| pageSizeOptions | array | - | [\"10\", \"20\", \"50\"] | 每页条数选项 |\n| showTotal | function | - | - | 渲染成\"共 xx 条\" |\n\n\n### rowSelection 默认配置\n\n行选择默认为 false,不配置就不显示。如果要开启如下设置即可,这时 brick-table 会默认配置 onChange 事件:\n\n```\n{\n \"configProps\": {\n \"rowSelection\": true\n }\n}\n```\n\n如果希望覆盖或者扩展默认配置,覆盖对应项即可,相关配置项具体查阅:[rowSelection](https://ant.design/components/table-cn/#rowSelection)\n\n```\n{\n \"configProps\": {\n \"rowSelection\": {\n \"columnWidth\": \"88px\"\n }\n }\n}\n```\n\n| property | type | required | default | description |\n| -------- | -------- | -------- | ------- | --------------------------------- |\n| onChange | function | - | - | 选择行,会抛出事件\"select.update\" |\n\n### 排序\n\n如果某一列希望排序,则可以设对应列 `sorter:true`,例如:\n\n```\n{\n \"columns\": [\n {\n \"title\": \"主机\",\n \"key\": \"hostname\",\n \"dataIndex\": \"hostname\",\n \"sorter\": true\n }\n ]\n}\n```\n\n## flattenTreeDataListAndCalcRowSpan 自定义加工函数\n\n将树形数据列表按照 `options.flattenConfigs` 进行展平,并生成相应的行合并数据\n\n### Params\n\n| param | type | required | default | description |\n| ------------ | ------------------------------------------ | -------- | ------- | ------------------------------------------------------------------------ |\n| treeDataList | Record<string, unknown>[] | ✔️ | - | 树形数据列表 |\n| options | FlattenTreeDataListAndCalcRowSpanOptions | ✔️ | - | 函数选项 |\n| depth | number | - | 0 | 当前展平的深度,用于确定 `options.flattenConfigs` 中的当前层级的展平配置 |\n\n### Returns\n\n| type | description |\n| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Record<string, unknown>[] | 展平后的列表,除了按照 `options.flattenConfigs` 进行展平外,还会生成相应层级以 `options.flattenConfigs[].parentInChildKey + \"RowSpan\"` 为 key 的行合并数据 |\n\n### FlattenTreeDataListAndCalcRowSpanOptions\n\n| property | type | required | default | description |\n| -------------------- | ----------------- | -------- | ------- | ---------------------------------------- |\n| flattenConfigs | FlattenConfig[] | ✔️ | - | 展平配置列表,按照由父到子的顺序一一对应 |\n| omitChildrenInParent | boolean | - | - | 展平后,是否省略父级里的子列表 |\n\n### FlattenConfig\n\n| property | type | required | default | description |\n| ---------------- | -------- | -------- | ------- | ------------------------ |\n| childrenKey | string | ✔️ | - | 对应层级子列表的 key |\n| parentInChildKey | string | ✔️ | - | 展平后,父级在子级的 key |",
|
|
6414
6414
|
"properties": [
|
|
6415
6415
|
{
|
|
6416
6416
|
"name": "columns",
|
|
@@ -6422,7 +6422,7 @@
|
|
|
6422
6422
|
},
|
|
6423
6423
|
{
|
|
6424
6424
|
"name": "dataSource",
|
|
6425
|
-
"type": "any",
|
|
6425
|
+
"type": "any[]",
|
|
6426
6426
|
"required": "false",
|
|
6427
6427
|
"default": "-",
|
|
6428
6428
|
"description": "数据源,通过 useResolves 从后台接口获取或者直接在 storyboard 中配置",
|
|
@@ -6438,7 +6438,7 @@
|
|
|
6438
6438
|
},
|
|
6439
6439
|
{
|
|
6440
6440
|
"name": "hiddenColumns",
|
|
6441
|
-
"type": "
|
|
6441
|
+
"type": "Array<string | number>",
|
|
6442
6442
|
"required": "false",
|
|
6443
6443
|
"default": "-",
|
|
6444
6444
|
"description": "隐藏相应列(输入对应的 dataIndex 或者 key 即可)",
|
|
@@ -6454,7 +6454,7 @@
|
|
|
6454
6454
|
},
|
|
6455
6455
|
{
|
|
6456
6456
|
"name": "filters",
|
|
6457
|
-
"type": "Record<string,string[]>",
|
|
6457
|
+
"type": "Record<string, string[]>",
|
|
6458
6458
|
"required": "false",
|
|
6459
6459
|
"default": "-",
|
|
6460
6460
|
"description": "表头过滤的过滤项,key 为 column 的 dataIndex,value 为过滤值集合。",
|
|
@@ -6470,7 +6470,7 @@
|
|
|
6470
6470
|
},
|
|
6471
6471
|
{
|
|
6472
6472
|
"name": "configProps",
|
|
6473
|
-
"type": "
|
|
6473
|
+
"type": "any",
|
|
6474
6474
|
"required": "false",
|
|
6475
6475
|
"default": "-",
|
|
6476
6476
|
"description": "ant-design 的 Table 相关配置项,具体查阅:[Table](https://ant.design/components/table-cn/#Table),其中分页配置和行选择配值在构件中设置了常用的默认配置,也可自行覆盖,具体描述见下表",
|
|
@@ -6542,7 +6542,7 @@
|
|
|
6542
6542
|
},
|
|
6543
6543
|
{
|
|
6544
6544
|
"name": "optimizedColumns",
|
|
6545
|
-
"type": "
|
|
6545
|
+
"type": "Array<string | number>",
|
|
6546
6546
|
"required": "false",
|
|
6547
6547
|
"default": "-",
|
|
6548
6548
|
"description": "优化渲染的列(输入对应的 dataIndex),针对配置了 useBrick 的列。当前 antd 在更新 state 的时候,会全量渲染单元格,如果确定某一列在后续操作中不需要重新渲染,例如仅作为展示的单元格,可通过该属性设置以优化性能。注意,在树形表格中,当某一列内包含展开/收起按钮,则不应该设置该列。",
|
|
@@ -6766,7 +6766,7 @@
|
|
|
6766
6766
|
},
|
|
6767
6767
|
{
|
|
6768
6768
|
"name": "rowSelection",
|
|
6769
|
-
"type": "false | TableRowSelection",
|
|
6769
|
+
"type": "false | TableRowSelection<any>",
|
|
6770
6770
|
"required": "false",
|
|
6771
6771
|
"default": "-",
|
|
6772
6772
|
"description": "表格行是否可选择,具体查阅:[rowSelection](https://ant.design/components/table-cn/#rowSelection)"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/presentational-bricks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.253.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-basics/tree/master/bricks/presentational-bricks",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"@next-dll/ace": "*",
|
|
56
56
|
"@next-dll/react-dnd": "*"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "b533903850aa57d220c4cf55c9ed288a5b6d3df6"
|
|
59
59
|
}
|