@next-bricks/presentational-bricks 1.250.2 → 1.251.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 +33 -0
- package/deploy/contract.yaml +98 -98
- package/dist/bricks.json +19 -19
- package/dist/index.2df0a592.js +2 -0
- package/dist/index.2df0a592.js.map +1 -0
- package/dist/stories.json +18 -4
- package/package.json +3 -3
- package/dist/index.419e1ce9.js +0 -2
- package/dist/index.419e1ce9.js.map +0 -1
package/dist/stories.json
CHANGED
|
@@ -6256,7 +6256,7 @@
|
|
|
6256
6256
|
"change": "新增 `shouldUpdateUrlParams` 属性和 `sort.update` 事件"
|
|
6257
6257
|
}
|
|
6258
6258
|
],
|
|
6259
|
-
"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|
|
|
6259
|
+
"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 自定义加工函数 |、* | ~~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如果不希望分页,只需在 storyboard 中如下设置即可:\n\n```\n{\n \"configProps\": {\n \"pagination\": false\n }\n}\n```\n\n如果希望覆盖默认配置,只需在 storyboard 中覆盖对应项即可,相关配置项具体查阅:[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,即如果不在 storyboard 中配置就不显示。如果要开启只需在 storyboard 中如下设置即可,这时 brick-table 会默认配置 onChange 事件:\n\n```\n{\n \"configProps\": {\n \"rowSelection\": true\n }\n}\n```\n\n如果希望覆盖或者扩展默认配置,只需在 storyboard 中覆盖对应项即可,相关配置项具体查阅:[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 |",
|
|
6260
6260
|
"properties": [
|
|
6261
6261
|
{
|
|
6262
6262
|
"name": "columns",
|
|
@@ -6351,7 +6351,7 @@
|
|
|
6351
6351
|
"type": "{useBrick:UseBrickConf}",
|
|
6352
6352
|
"required": "false",
|
|
6353
6353
|
"default": "-",
|
|
6354
|
-
"description": "自定义行展开的构件",
|
|
6354
|
+
"description": "自定义行展开的构件 [UseBrickConf](/next-docs/docs/api-reference/brick-types.usesinglebrickconf)",
|
|
6355
6355
|
"group": "expand"
|
|
6356
6356
|
},
|
|
6357
6357
|
{
|
|
@@ -6568,7 +6568,7 @@
|
|
|
6568
6568
|
"required": "false",
|
|
6569
6569
|
"default": "-",
|
|
6570
6570
|
"description": "额外的行,通常为跨页勾选时,不在当前页的行",
|
|
6571
|
-
"group": "
|
|
6571
|
+
"group": "other"
|
|
6572
6572
|
},
|
|
6573
6573
|
{
|
|
6574
6574
|
"name": "draggable",
|
|
@@ -11426,7 +11426,7 @@
|
|
|
11426
11426
|
},
|
|
11427
11427
|
{
|
|
11428
11428
|
"name": "tipBrick",
|
|
11429
|
-
"type": "{
|
|
11429
|
+
"type": "{ useBrick: UseBrickConf }",
|
|
11430
11430
|
"required": "false",
|
|
11431
11431
|
"default": "-",
|
|
11432
11432
|
"description": "提示构件",
|
|
@@ -11461,6 +11461,20 @@
|
|
|
11461
11461
|
"default": "-",
|
|
11462
11462
|
"description": "多选时,当前label仅支持显示从构件外部传入,multipleLabel属性仅在dropdownButtonType为multiple时生效"
|
|
11463
11463
|
},
|
|
11464
|
+
{
|
|
11465
|
+
"name": "selectTipText",
|
|
11466
|
+
"type": "string",
|
|
11467
|
+
"required": "false",
|
|
11468
|
+
"default": "-",
|
|
11469
|
+
"description": "下拉框提示信息"
|
|
11470
|
+
},
|
|
11471
|
+
{
|
|
11472
|
+
"name": "selectBoxStyle",
|
|
11473
|
+
"type": "string",
|
|
11474
|
+
"required": "false",
|
|
11475
|
+
"default": "-",
|
|
11476
|
+
"description": "下拉框样式"
|
|
11477
|
+
},
|
|
11464
11478
|
{
|
|
11465
11479
|
"name": "dropdownButtonType",
|
|
11466
11480
|
"type": "\"default\" | \"shape\"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/presentational-bricks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.251.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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
|
32
|
-
"@next-core/custom-antd-styles": "^1.24.
|
|
32
|
+
"@next-core/custom-antd-styles": "^1.24.10",
|
|
33
33
|
"@next-libs/basic-components": "^3.5.1",
|
|
34
34
|
"@next-libs/clipboard": "^3.0.2",
|
|
35
35
|
"@next-libs/cmdb-utils": "^3.2.1",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"@next-dll/ace": "*",
|
|
56
56
|
"@next-dll/react-dnd": "*"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "26fcda5ce2771f7effb087bbd09cbeb26b5f4d01"
|
|
59
59
|
}
|