@jetlinks-web/components 3.3.12 → 3.3.14
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/es/AutoComplete/AutoComplete.md +41 -0
- package/es/BadgeStatus/BadgeStatus.md +37 -0
- package/es/CardSelect/CardSelect.md +56 -0
- package/es/CardSelect/style/index.js +3 -3
- package/es/CheckButton/CheckButton.md +37 -0
- package/es/CheckButton/style/index.js +9 -9
- package/es/ConfigProvider/ConfigProvider.md +40 -0
- package/es/DragModal/DragModal.md +47 -0
- package/es/DragModal/style/index.js +6 -6
- package/es/EditTable/EditTable.md +62 -0
- package/es/EditTable/FormItem.js +18 -15
- package/es/EditTable/components/Search/sort.js +15 -1
- package/es/EditTable/style/body.js +8 -6
- package/es/EditTable/style/group.js +3 -3
- package/es/EditTable/style/header.js +3 -3
- package/es/EditTable/style/menu.js +3 -3
- package/es/EditTable/style/table.js +3 -3
- package/es/Ellipsis/Ellipsis.md +45 -0
- package/es/Empty/Empty.md +34 -0
- package/es/FullPage/FullPage.js +15 -5
- package/es/FullPage/FullPage.md +31 -0
- package/es/Icon/Icon.md +33 -0
- package/es/LocaleProvider/LocaleProvider.md +25 -0
- package/es/LocaleReciver/LocaleReciver.md +42 -0
- package/es/Markdown/Markdown.md +40 -0
- package/es/PermissionButton/PermissionButton.md +40 -0
- package/es/ProLayout/ProLayout.md +63 -0
- package/es/ProLayout/SiderMenu/style.js +105 -26
- package/es/ProLayout/TopHeader/style.js +55 -11
- package/es/ProTable/ProTable.js +2 -4
- package/es/ProTable/ProTable.md +70 -0
- package/es/ProTable/style/index.js +11 -8
- package/es/RadioButton/RadioButton.md +32 -0
- package/es/RadioButton/style/index.js +3 -2
- package/es/Scrollbar/Scrollbar.md +43 -0
- package/es/Scrollbar/style/index.js +9 -9
- package/es/Search/Search.md +60 -0
- package/es/Search/style/search.js +5 -5
- package/es/Skeleton/Skeleton.md +50 -0
- package/es/Skeleton/components/Page.js +18 -5
- package/es/Skeleton/style/index.js +12 -6
- package/es/TimeFormat/TimeFormat.md +25 -0
- package/es/Title/Title.md +33 -0
- package/es/Title/style/index.js +2 -2
- package/es/ValueItem/ValueItem.md +58 -0
- package/es/VirtualTable/VirtualTable.md +42 -0
- package/es/VirtualTable/style/index.js +7 -4
- package/es/components.md +108 -0
- package/es/style/scrollbar.js +24 -0
- package/es/style/styleRegister.js +45 -11
- package/es/style/variable.js +1 -4
- package/lib/AutoComplete/AutoComplete.md +41 -0
- package/lib/BadgeStatus/BadgeStatus.md +37 -0
- package/lib/CardSelect/CardSelect.md +56 -0
- package/lib/CardSelect/style/index.js +3 -3
- package/lib/CheckButton/CheckButton.md +37 -0
- package/lib/CheckButton/style/index.js +9 -9
- package/lib/ConfigProvider/ConfigProvider.md +40 -0
- package/lib/DragModal/DragModal.md +47 -0
- package/lib/DragModal/style/index.js +6 -6
- package/lib/EditTable/EditTable.md +62 -0
- package/lib/EditTable/FormItem.js +18 -15
- package/lib/EditTable/components/Search/sort.js +15 -1
- package/lib/EditTable/style/body.js +8 -6
- package/lib/EditTable/style/group.js +3 -3
- package/lib/EditTable/style/header.js +3 -3
- package/lib/EditTable/style/menu.js +3 -3
- package/lib/EditTable/style/table.js +3 -3
- package/lib/Ellipsis/Ellipsis.md +45 -0
- package/lib/Empty/Empty.md +34 -0
- package/lib/FullPage/FullPage.js +15 -5
- package/lib/FullPage/FullPage.md +31 -0
- package/lib/Icon/Icon.md +33 -0
- package/lib/LocaleProvider/LocaleProvider.md +25 -0
- package/lib/LocaleReciver/LocaleReciver.md +42 -0
- package/lib/Markdown/Markdown.md +40 -0
- package/lib/PermissionButton/PermissionButton.md +40 -0
- package/lib/ProLayout/ProLayout.md +63 -0
- package/lib/ProLayout/SiderMenu/style.js +104 -25
- package/lib/ProLayout/TopHeader/style.js +55 -11
- package/lib/ProTable/ProTable.js +2 -4
- package/lib/ProTable/ProTable.md +70 -0
- package/lib/ProTable/style/index.js +10 -7
- package/lib/RadioButton/RadioButton.md +32 -0
- package/lib/RadioButton/style/index.js +3 -2
- package/lib/Scrollbar/Scrollbar.md +43 -0
- package/lib/Scrollbar/style/index.js +8 -8
- package/lib/Search/Search.md +60 -0
- package/lib/Search/style/search.js +5 -5
- package/lib/Skeleton/Skeleton.md +50 -0
- package/lib/Skeleton/components/Page.js +18 -5
- package/lib/Skeleton/style/index.js +12 -6
- package/lib/TimeFormat/TimeFormat.md +25 -0
- package/lib/Title/Title.md +33 -0
- package/lib/Title/style/index.js +2 -2
- package/lib/ValueItem/ValueItem.md +58 -0
- package/lib/VirtualTable/VirtualTable.md +42 -0
- package/lib/VirtualTable/style/index.js +6 -3
- package/lib/components.md +108 -0
- package/lib/style/scrollbar.js +30 -0
- package/lib/style/styleRegister.js +44 -10
- package/lib/style/variable.js +1 -4
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
### Search
|
|
2
|
+
|
|
3
|
+
搜索组件,根据列配置自动生成查询表单,支持高级(多组 `and` / `or`)搜索,输出 Terms 供后端查询;可与 ProTable 配合使用。
|
|
4
|
+
|
|
5
|
+
#### Props
|
|
6
|
+
|
|
7
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| columns | 同 `Table` `columns` | `Columns[]` | `[]` |
|
|
10
|
+
| labelWidth | label 最小宽度 | `number` | `40` |
|
|
11
|
+
|
|
12
|
+
#### Columns 扩展
|
|
13
|
+
|
|
14
|
+
| 参数 | 说明 | 类型 |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| dataIndex | 同 `Table` `columns` 中的 dataIndex | - |
|
|
17
|
+
| title | 同 `Table` `columns` 中的 title | - |
|
|
18
|
+
| search | 查询属性,不传则不出现在查询组件中 | `Search[]` |
|
|
19
|
+
|
|
20
|
+
#### Search 字段配置
|
|
21
|
+
|
|
22
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
23
|
+
| --- | --- | --- | --- |
|
|
24
|
+
| first | 是否提升为第一个查询字段 | `boolean` | `''` |
|
|
25
|
+
| rename | 重命名查询字段,可覆盖 `Terms.column` 的值 | `string` | - |
|
|
26
|
+
| type | 组件类型 | `select` \| `number` \| `treeSelect` \| `date` \| `time` | `'string'` |
|
|
27
|
+
| componentProps | 组件的 props | `object` | `{}` |
|
|
28
|
+
| format | `date` / `time` 时生效 | `string` | `'YYYY-MM-DD HH:mm:ss'` |
|
|
29
|
+
| options | `treeSelect` / `select` 时生效 | `Option[]` \| `Promise` | `[]` |
|
|
30
|
+
| defaultTermType | 修改 `Terms.termType` 的默认值 | `string` | `'eq'` |
|
|
31
|
+
| handleValue | 处理 `Terms.value` | `Function` | `Function(item)` |
|
|
32
|
+
|
|
33
|
+
#### Terms
|
|
34
|
+
|
|
35
|
+
| 参数 | 说明 | 类型 |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| column | 查询字段 | `string` |
|
|
38
|
+
| type | 两组查询间的关系 | `and` \| `or` |
|
|
39
|
+
| termType | 查询条件 | `eq` \| `like` \| `btw` 等 |
|
|
40
|
+
| value | 查询值 | `string` \| `number` \| `object` |
|
|
41
|
+
|
|
42
|
+
#### 事件
|
|
43
|
+
|
|
44
|
+
| 事件 | 说明 | 回调参数 |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| search | 搜索事件 | `AdvancedSearch`: `Function({ terms: [{ terms: Terms[] }] })`;`Search`: `Function(Terms[])` |
|
|
47
|
+
|
|
48
|
+
#### 用法
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<template>
|
|
52
|
+
<JSearch :columns="columns" @search="onSearch" />
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Rules
|
|
57
|
+
|
|
58
|
+
- 每个可查询列需在 `columns[].search` 中配置查询属性,未配置的列不参与查询表单。
|
|
59
|
+
- `AdvancedSearch` 支持多组条件组合(组内关系与组间 `and` / `or`),默认导出 `Search` 与 `AdvancedSearch` 两个形态。
|
|
60
|
+
- 与 `ProTable` 配合时,`search` 事件输出的 Terms 作为表格 `params` 触发重新请求。
|
|
@@ -4,7 +4,7 @@ export var genSearchStyle = function genSearchStyle(config) {
|
|
|
4
4
|
token = config.token;
|
|
5
5
|
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-warp"), _defineProperty(_defineProperty(_defineProperty({
|
|
6
6
|
padding: '24px',
|
|
7
|
-
backgroundColor:
|
|
7
|
+
backgroundColor: token.colorBgContainer,
|
|
8
8
|
marginBottom: '24px',
|
|
9
9
|
'.pack-up': _defineProperty({}, "".concat(componentCls, "-items"), {
|
|
10
10
|
flex: '1 1 auto',
|
|
@@ -81,7 +81,7 @@ export var genSearchStyle = function genSearchStyle(config) {
|
|
|
81
81
|
}))
|
|
82
82
|
}), '.no-radius', {
|
|
83
83
|
borderRadius: 0,
|
|
84
|
-
borderColor:
|
|
84
|
+
borderColor: token.colorBorderSecondary
|
|
85
85
|
}), '.search-history-warp', {
|
|
86
86
|
position: 'relative',
|
|
87
87
|
'.search-history-button': {
|
|
@@ -93,7 +93,7 @@ export var genSearchStyle = function genSearchStyle(config) {
|
|
|
93
93
|
height: '18px',
|
|
94
94
|
right: '6px',
|
|
95
95
|
top: '8px',
|
|
96
|
-
color:
|
|
96
|
+
color: token.colorTextLightSolid,
|
|
97
97
|
lineHeight: '18px',
|
|
98
98
|
textAlign: 'center',
|
|
99
99
|
fontWeight: 'bold',
|
|
@@ -103,7 +103,7 @@ export var genSearchStyle = function genSearchStyle(config) {
|
|
|
103
103
|
}
|
|
104
104
|
})), '.search-history-empty', {
|
|
105
105
|
padding: '12px 12px 6px 12px',
|
|
106
|
-
backgroundColor:
|
|
106
|
+
backgroundColor: token.colorBgElevated
|
|
107
107
|
}), '.search-history-items', {
|
|
108
108
|
width: '120px',
|
|
109
109
|
maxHeight: '300px',
|
|
@@ -114,7 +114,7 @@ export var genSearchStyle = function genSearchStyle(config) {
|
|
|
114
114
|
alignItems: 'center',
|
|
115
115
|
gap: '4px',
|
|
116
116
|
'&:hover': {
|
|
117
|
-
backgroundColor:
|
|
117
|
+
backgroundColor: token.colorFillTertiary
|
|
118
118
|
},
|
|
119
119
|
'.history-item--title': {
|
|
120
120
|
width: 'calc(100% - 30px)',
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
### Skeleton
|
|
2
|
+
|
|
3
|
+
骨架屏组件,加载时展示占位骨架,加载完成后切换为真实内容;内置 9 种业务骨架(列表 / 卡片 / 树 / 详情 / 抽屉 / 仪表盘等)。
|
|
4
|
+
|
|
5
|
+
#### Props
|
|
6
|
+
|
|
7
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| active | 骨架是否带动态闪烁动画 | `boolean` | `true` |
|
|
10
|
+
| loading | 是否处于加载态;`false` 时渲染默认插槽内容 | `boolean` | `true` |
|
|
11
|
+
|
|
12
|
+
#### 插槽
|
|
13
|
+
|
|
14
|
+
| 名称 | 说明 |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| default | 加载完成后的真实内容 |
|
|
17
|
+
|
|
18
|
+
#### 内置骨架(具名导出)
|
|
19
|
+
|
|
20
|
+
| 导出名 | 场景 |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| JSkeletonListTable | 列表-表格骨架 |
|
|
23
|
+
| JSkeletonListCard | 列表-卡片骨架 |
|
|
24
|
+
| JSkeletonList | 通用列表骨架 |
|
|
25
|
+
| JSkeletonTree | 树形骨架 |
|
|
26
|
+
| JSkeletonDetail | 详情页骨架 |
|
|
27
|
+
| JSkeletonDrawer | 抽屉骨架 |
|
|
28
|
+
| JSkeletonDashboardCard | 仪表盘-卡片骨架 |
|
|
29
|
+
| JSkeletonDashboardChart | 仪表盘-图表骨架 |
|
|
30
|
+
| JSkeletonPage | 整页骨架 |
|
|
31
|
+
|
|
32
|
+
#### 用法
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<template>
|
|
36
|
+
<JSkeleton :loading="loading">
|
|
37
|
+
<div>真实内容</div>
|
|
38
|
+
</JSkeleton>
|
|
39
|
+
|
|
40
|
+
<!-- 指定场景骨架 -->
|
|
41
|
+
<JSkeletonListTable :active="true" />
|
|
42
|
+
<JSkeletonDetail />
|
|
43
|
+
</template>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### Rules
|
|
47
|
+
|
|
48
|
+
- 默认骨架为"40% + 3 行 + 80%"的段落布局,仅渲染 `default` 插槽内容的占位。
|
|
49
|
+
- 9 个具名骨架为独立组件,直接按需引入,无需包裹 `JSkeleton`。
|
|
50
|
+
- `active` 控制闪烁动画,`loading` 为 `false` 时立即渲染真实内容。
|
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
"loading": "props",
|
|
5
5
|
"List": "setup-const",
|
|
6
6
|
"Detail": "setup-const",
|
|
7
|
-
"
|
|
7
|
+
"computed": "setup-const",
|
|
8
|
+
"theme": "setup-maybe-ref",
|
|
9
|
+
"props": "setup-reactive-const",
|
|
10
|
+
"token": "setup-maybe-ref",
|
|
11
|
+
"pageStyle": "setup-ref"
|
|
8
12
|
} */
|
|
9
|
-
import { renderSlot as _renderSlot, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock } from "vue";
|
|
10
|
-
const _hoisted_1 = { style: { "padding": "24px", "background-color": "#ffffff", "height": "100%" } };
|
|
13
|
+
import { renderSlot as _renderSlot, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
|
|
11
14
|
import List from "./List.js";
|
|
12
15
|
import Detail from "./Detail.js";
|
|
16
|
+
import { computed } from "vue";
|
|
17
|
+
import { theme } from "ant-design-vue";
|
|
13
18
|
const __sfc_main__ = Object.assign({
|
|
14
19
|
name: 'JSkeletonPage'
|
|
15
20
|
}, {
|
|
@@ -29,8 +34,16 @@ const __sfc_main__ = Object.assign({
|
|
|
29
34
|
},
|
|
30
35
|
setup(__props) {
|
|
31
36
|
const props = __props;
|
|
37
|
+
const { token } = theme.useToken();
|
|
38
|
+
const pageStyle = computed(() => ({
|
|
39
|
+
padding: '24px',
|
|
40
|
+
backgroundColor: token.value.colorBgContainer,
|
|
41
|
+
height: '100%',
|
|
42
|
+
}));
|
|
32
43
|
return (_ctx, _cache) => {
|
|
33
|
-
return (_openBlock(), _createElementBlock("div",
|
|
44
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
45
|
+
style: _normalizeStyle(pageStyle.value)
|
|
46
|
+
}, [
|
|
34
47
|
(__props.type === 'list')
|
|
35
48
|
? (_openBlock(), _createBlock(List, {
|
|
36
49
|
key: 0,
|
|
@@ -55,7 +68,7 @@ const __sfc_main__ = Object.assign({
|
|
|
55
68
|
_: 3 /* FORWARDED */
|
|
56
69
|
}, 8 /* PROPS */, ["loading"]))
|
|
57
70
|
: _renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
58
|
-
]));
|
|
71
|
+
], 4 /* STYLE */));
|
|
59
72
|
};
|
|
60
73
|
}
|
|
61
74
|
});
|
|
@@ -6,9 +6,6 @@ var JSkeletonSizeLg = '36px';
|
|
|
6
6
|
var JSkeletonSizeSm = '16px';
|
|
7
7
|
var JSkeletonSize = '24px';
|
|
8
8
|
var JSkeletonBorderRadius = '8px';
|
|
9
|
-
var JSkeletonBg = '#f0f2f5';
|
|
10
|
-
var JSkeletonBg1 = '#e6e8eb';
|
|
11
|
-
var JSkeletonBorder = "4px solid ".concat(JSkeletonBg);
|
|
12
9
|
var JSkeletonFlex = {
|
|
13
10
|
display: 'flex',
|
|
14
11
|
gap: '24px',
|
|
@@ -27,6 +24,10 @@ var genSkeletonStyle = function genSkeletonStyle(config) {
|
|
|
27
24
|
var _$concat6;
|
|
28
25
|
var componentCls = config.componentCls,
|
|
29
26
|
token = config.token;
|
|
27
|
+
var JSkeletonBg = token.colorFillQuaternary;
|
|
28
|
+
var JSkeletonBg1 = token.colorFillSecondary;
|
|
29
|
+
var JSkeletonBorder = "".concat(token.lineWidth * 4, "px solid ").concat(JSkeletonBg);
|
|
30
|
+
var JSkeletonCardBorder = "".concat(token.lineWidth * 2, "px solid ").concat(token.colorBorderSecondary);
|
|
30
31
|
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-flex"), JSkeletonFlex), "".concat(componentCls, "-flex-between"), _objectSpread(_objectSpread({}, JSkeletonFlex), {}, {
|
|
31
32
|
background: JSkeletonBg,
|
|
32
33
|
height: JSkeletonSize,
|
|
@@ -34,7 +35,12 @@ var genSkeletonStyle = function genSkeletonStyle(config) {
|
|
|
34
35
|
})), "".concat(componentCls, "-flex-column"), _objectSpread(_objectSpread({}, JSkeletonFlex), {}, {
|
|
35
36
|
justifyContent: 'space-between'
|
|
36
37
|
})), "".concat(componentCls), (_$concat6 = {
|
|
37
|
-
height: '100%'
|
|
38
|
+
height: '100%',
|
|
39
|
+
'--j-skeleton-bg': JSkeletonBg,
|
|
40
|
+
'--j-skeleton-bg-active': JSkeletonBg1,
|
|
41
|
+
'--j-skeleton-border': JSkeletonBorder,
|
|
42
|
+
'--j-skeleton-card-border': JSkeletonCardBorder,
|
|
43
|
+
'--j-skeleton-table-header-bg': token.colorFillTertiary
|
|
38
44
|
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_$concat6, "".concat(componentCls, "-item"), {
|
|
39
45
|
background: "linear-gradient(90deg, ".concat(JSkeletonBg, " 25%, ").concat(JSkeletonBg1, " 50%, ").concat(JSkeletonBg, " 75%)"),
|
|
40
46
|
backgroundSize: '400% 100%',
|
|
@@ -83,7 +89,7 @@ var genSkeletonStyle = function genSkeletonStyle(config) {
|
|
|
83
89
|
padding: '12px 6px',
|
|
84
90
|
borderRadius: '8px'
|
|
85
91
|
}), "".concat(componentCls, "-table-header"), {
|
|
86
|
-
backgroundColor:
|
|
92
|
+
backgroundColor: token.colorFillTertiary
|
|
87
93
|
}), _defineProperty(_defineProperty(_defineProperty(_$concat6, "".concat(componentCls, "-table-action"), {
|
|
88
94
|
width: '200px',
|
|
89
95
|
display: 'grid',
|
|
@@ -96,7 +102,7 @@ var genSkeletonStyle = function genSkeletonStyle(config) {
|
|
|
96
102
|
}), "".concat(componentCls, "-card"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-card-content"), _defineProperty(_defineProperty({
|
|
97
103
|
display: 'flex',
|
|
98
104
|
gap: '16px',
|
|
99
|
-
border:
|
|
105
|
+
border: JSkeletonCardBorder,
|
|
100
106
|
borderRadius: '8px',
|
|
101
107
|
padding: '24px',
|
|
102
108
|
marginBottom: '16px'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
### TimeFormat
|
|
2
|
+
|
|
3
|
+
时间格式化组件,将时间戳(毫秒)或字符串按指定格式渲染为文本;非数字输入原样返回。
|
|
4
|
+
|
|
5
|
+
#### Props
|
|
6
|
+
|
|
7
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| time | 时间值:数字时间戳(毫秒)或字符串 | `string \| number` | - |
|
|
10
|
+
| format | 输出格式(dayjs 格式串) | `string` | `'YYYY-MM-DD HH:mm:ss'` |
|
|
11
|
+
|
|
12
|
+
#### 用法
|
|
13
|
+
|
|
14
|
+
```vue
|
|
15
|
+
<template>
|
|
16
|
+
<JTimeFormat :time="row.createTime" />
|
|
17
|
+
<JTimeFormat :time="1693200000000" format="YYYY-MM-DD" />
|
|
18
|
+
</template>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### Rules
|
|
22
|
+
|
|
23
|
+
- 数字字符串(如 `"1693200000000"`)也会被识别为时间戳处理;无法转换为数字时原样展示。
|
|
24
|
+
- 内部使用 dayjs,`format` 支持全部 dayjs 格式令牌。
|
|
25
|
+
- `time` 为空时渲染为空字符串。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
### Title
|
|
2
|
+
|
|
3
|
+
标题组件,渲染区块标题文本,右侧可通过插槽放置操作区。
|
|
4
|
+
|
|
5
|
+
#### Props
|
|
6
|
+
|
|
7
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| data | 标题文本 | `string` | `''` |
|
|
10
|
+
| style | 标题容器样式 | `object` | `{}` |
|
|
11
|
+
|
|
12
|
+
#### 插槽
|
|
13
|
+
|
|
14
|
+
| 名称 | 说明 |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| extra | 标题右侧操作区(如按钮 / 链接) |
|
|
17
|
+
|
|
18
|
+
#### 用法
|
|
19
|
+
|
|
20
|
+
```vue
|
|
21
|
+
<template>
|
|
22
|
+
<JTitle data="设备列表">
|
|
23
|
+
<template #extra>
|
|
24
|
+
<a-button size="small" type="link">更多</a-button>
|
|
25
|
+
</template>
|
|
26
|
+
</JTitle>
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Rules
|
|
31
|
+
|
|
32
|
+
- 用于区块 / 分区标题,视觉由 `j-title` 样式统一控制;标题与操作区左右布局。
|
|
33
|
+
- `data` 为纯文本,复杂标题可通过默认插槽替换(组件内部结构为 `.j-title-content` 加 `extra`)。
|
package/es/Title/style/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var genTitleStyle = function genTitleStyle(config) {
|
|
|
11
11
|
}, "".concat(componentCls, "-content"), {
|
|
12
12
|
position: 'relative',
|
|
13
13
|
paddingLeft: '10px',
|
|
14
|
-
color:
|
|
14
|
+
color: token.colorTextHeading,
|
|
15
15
|
fontWeight: 600,
|
|
16
16
|
lineHeight: 1,
|
|
17
17
|
'&::before': {
|
|
@@ -20,7 +20,7 @@ var genTitleStyle = function genTitleStyle(config) {
|
|
|
20
20
|
left: 0,
|
|
21
21
|
width: 4,
|
|
22
22
|
height: '100%',
|
|
23
|
-
background:
|
|
23
|
+
background: token.colorPrimary,
|
|
24
24
|
borderRadius: '0 3px 3px 0',
|
|
25
25
|
content: '""'
|
|
26
26
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
### ValueItem
|
|
2
|
+
|
|
3
|
+
参数类型输入组件,按 `itemType`(数据类型)自动渲染对应输入控件:文本、数字(int/long/float/double)、下拉、日期、时间、密码、文件上传等;常用于参数 / 属性动态录入场景。
|
|
4
|
+
|
|
5
|
+
#### Props
|
|
6
|
+
|
|
7
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| modelValue | 双向绑定值(`v-model`) | `number \| string` | `''` |
|
|
10
|
+
| itemType | 数据类型,决定渲染控件 | `string` | `'string'` |
|
|
11
|
+
| mode | 下拉选择模式:`multiple` \| `tags` \| `combobox` | `string` | - |
|
|
12
|
+
| placeholder | 输入占位符 | `string` | - |
|
|
13
|
+
| options | 下拉选项(`select` / `enum` / `boolean` 类型用) | `array` | - |
|
|
14
|
+
| style | 容器样式 | `CSSProperties` | - |
|
|
15
|
+
| class | 容器类名 | `string` | - |
|
|
16
|
+
| valueFormat | 日期 / 时间输出格式 | `string` | 日期 `'YYYY-MM-DD HH:mm:ss'`,时间 `'HH:mm:ss'` |
|
|
17
|
+
| action | 上传地址(`file` 类型用),支持字符串或返回 Promise | `string \| Promise` | - |
|
|
18
|
+
| headers | 上传请求头 | `object` | - |
|
|
19
|
+
| disabled | 禁用 | `boolean` | - |
|
|
20
|
+
| extraProps | 附加 props,合并覆盖到底层控件 | `object` | `{}` |
|
|
21
|
+
| handleFileChange | 文件上传完成回调,返回值作为最终值 | `Function` | - |
|
|
22
|
+
|
|
23
|
+
#### 事件
|
|
24
|
+
|
|
25
|
+
| 事件 | 说明 | 回调参数 |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| update:modelValue | 值变化(v-model) | `(data: string \| number \| boolean)` |
|
|
28
|
+
| change | 值变化 | `(data, item?)` |
|
|
29
|
+
|
|
30
|
+
#### 类型映射
|
|
31
|
+
|
|
32
|
+
| itemType | 渲染控件 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `int` / `long` / `float` / `double` | `a-input-number`(int/long 精度 0) |
|
|
35
|
+
| `string` / `array` | `a-input` |
|
|
36
|
+
| `password` | `a-input-password` |
|
|
37
|
+
| `enum` / `select` / `boolean` | `a-select`(boolean 为 true/false 选项) |
|
|
38
|
+
| `date` | `a-date-picker`(含时间) |
|
|
39
|
+
| `time` | `a-time-picker` |
|
|
40
|
+
| `file` | `a-input` + 上传按钮(地址回填) |
|
|
41
|
+
| `object` / `geoPoint` | 保留为对象字符串(内部处理) |
|
|
42
|
+
|
|
43
|
+
#### 用法
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<template>
|
|
47
|
+
<JValueItem v-model="value" item-type="select" :options="options" />
|
|
48
|
+
<JValueItem v-model="timeValue" item-type="date" />
|
|
49
|
+
<JValueItem v-model="fileUrl" item-type="file" :action="uploadUrl" />
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### Rules
|
|
54
|
+
|
|
55
|
+
- `extraProps` 会合并到底层控件 props 并覆盖同名属性。
|
|
56
|
+
- `file` 类型上传成功后取响应 `result.accessUrl` 回填;配置 `handleFileChange` 时可转换返回值。
|
|
57
|
+
- `int` 类型取值限制在 `[-2147483648, 2147483647]`,`long` / 浮点限制在 `±999999999999999`。
|
|
58
|
+
- `mode` 仅对 `select` 类控件生效。
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
### VirtualTable
|
|
2
|
+
|
|
3
|
+
虚拟滚动表格组件,基于 ant-design-vue `Table` 封装,仅渲染可视区行,支持大数据量高性能渲染、树形数据展开与自定义行高。
|
|
4
|
+
|
|
5
|
+
#### Props
|
|
6
|
+
|
|
7
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| 全部 Table props | 透传 ant-design-vue `Table` 全部属性 | `TableProps` | - |
|
|
10
|
+
| virtual | 虚拟滚动配置 | `boolean \| { itemHeight?, overscan?, threshold? }` | - |
|
|
11
|
+
|
|
12
|
+
#### virtual 配置
|
|
13
|
+
|
|
14
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
15
|
+
| --- | --- | --- | --- |
|
|
16
|
+
| itemHeight | 行高,固定值或动态函数 | `number \| (index) => number` | `54` |
|
|
17
|
+
| overscan | 可视区外预渲染行数 | `number` | `5` |
|
|
18
|
+
| threshold | 数据量超过此值才启用虚拟滚动 | `number` | `100` |
|
|
19
|
+
|
|
20
|
+
#### 用法
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<template>
|
|
24
|
+
<VirtualTable
|
|
25
|
+
:columns="columns"
|
|
26
|
+
:data-source="dataSource"
|
|
27
|
+
:scroll="{ y: 400 }"
|
|
28
|
+
:virtual="{ itemHeight: 54, overscan: 5 }"
|
|
29
|
+
>
|
|
30
|
+
<template #bodyCell="{ column, record }">
|
|
31
|
+
<span>{{ record[column.dataIndex] }}</span>
|
|
32
|
+
</template>
|
|
33
|
+
</VirtualTable>
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Rules
|
|
38
|
+
|
|
39
|
+
- 数据量小于 `threshold`(默认 100)时不启用虚拟滚动,退化为普通 Table。
|
|
40
|
+
- 树形数据支持展开收起;行通过 Proxy 缓存池包装以提供 `__virtual_tree_node__` 元信息,展开状态与数据同步。
|
|
41
|
+
- 行高使用动态函数时由 `useVirtualScroll` 计算总高度,适合不定高行场景。
|
|
42
|
+
- 常用于 EditTable 的内部数据承载;滚动容器高度由 `scroll.y` 或外部约束提供。
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import genCompoentStyle from '../../style/styleRegister';
|
|
3
|
+
import { genTokenScrollbarStyle } from '../../style/scrollbar';
|
|
4
|
+
var genVirtualTableStyle = function genVirtualTableStyle(config) {
|
|
5
|
+
var token = config.token;
|
|
3
6
|
return {
|
|
4
7
|
'.virtual-table-wrapper': {
|
|
5
8
|
display: 'flex',
|
|
@@ -17,11 +20,11 @@ var genVirtualTableStyle = function genVirtualTableStyle() {
|
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
},
|
|
20
|
-
'.virtual-table-body': {
|
|
23
|
+
'.virtual-table-body': _objectSpread({
|
|
21
24
|
'overflow-y': 'auto',
|
|
22
25
|
position: 'relative',
|
|
23
26
|
'min-height': '100px'
|
|
24
|
-
},
|
|
27
|
+
}, genTokenScrollbarStyle(token)),
|
|
25
28
|
'.virtual-table-header-fixed': {
|
|
26
29
|
// 位移的容器,提升位移动画性能
|
|
27
30
|
'will-change': 'transform'
|
package/es/components.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @jetlinks-web/components 组件映射
|
|
2
|
+
|
|
3
|
+
本文件是 `@jetlinks-web/components` 的 AI 导航入口。先按场景定位组件,再打开对应的组件文档核验 Props、事件、插槽和 Rules;不要一次性读取全部组件文档,也不要仅凭目录名推断公开 API。
|
|
4
|
+
|
|
5
|
+
## 使用流程
|
|
6
|
+
|
|
7
|
+
1. 根据当前业务场景从下方映射表选择 1~3 个候选组件。
|
|
8
|
+
2. 打开候选目录中的 `组件名.md`,确认用途、Props、事件、插槽、示例和限制。
|
|
9
|
+
3. 核验 [`components.ts`](components.ts) 是否从包根入口公开导出该能力;根入口导出名可能与目录名不同。
|
|
10
|
+
4. 核验目标项目安装的 `@jetlinks-web/components` 版本和相邻页面用法;源码工作区与目标项目依赖版本不一致时,以目标项目实际可用导出为准。
|
|
11
|
+
5. 需要确认边界时再读对应组件源码;不得发明文档和源码中不存在的 Props、事件、插槽或子路径。
|
|
12
|
+
6. 若 `@jetlinks-web-core/components` 已对同一场景提供项目级封装、权限/i18n/路由适配或稳定组合,优先使用项目级封装;否则直接复用本包的共享基础组件。
|
|
13
|
+
|
|
14
|
+
## 引入方式
|
|
15
|
+
|
|
16
|
+
### 根入口具名导入
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import {
|
|
20
|
+
AIcon,
|
|
21
|
+
CardSelect,
|
|
22
|
+
PermissionButton,
|
|
23
|
+
ProTable,
|
|
24
|
+
Search,
|
|
25
|
+
} from '@jetlinks-web/components';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
根入口只公开 [`components.ts`](components.ts) 中列出的导出。`Icon` 目录的根导出名是 `AIcon`,不存在名为 `Icon` 的根导出。
|
|
29
|
+
|
|
30
|
+
### 整包安装后的全局组件
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import JetLinksComponents from '@jetlinks-web/components';
|
|
34
|
+
|
|
35
|
+
app.use(JetLinksComponents);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
整包安装只会安装 `components.ts` 中已公开且带 `install` 的组件。模板中的全局注册名通常以 `J` 开头,例如 `JCardSelect`、`JProTable`、`JSearch`;是否已整包安装,以目标应用入口为准。
|
|
39
|
+
|
|
40
|
+
### 子路径能力
|
|
41
|
+
|
|
42
|
+
深层子路径不是默认公共契约。只有根入口没有导出所需能力,并且目标项目当前依赖版本、构建产物和相邻生产代码都证明该子路径稳定可用时,才允许沿用;不要根据源码目录自行拼接 `@jetlinks-web/components/es/...` 路径。
|
|
43
|
+
|
|
44
|
+
## 场景映射
|
|
45
|
+
|
|
46
|
+
| 场景 | 候选能力 | 文档 | 根入口 / 全局名 |
|
|
47
|
+
| --- | --- | --- | --- |
|
|
48
|
+
| 输入联想、可创建选项、标签多选 | `AutoComplete` | [AutoComplete/AutoComplete.md](AutoComplete/AutoComplete.md) | `AutoComplete` / `JAutoComplete` |
|
|
49
|
+
| 状态徽标、语义色状态 | `BadgeStatus` | [BadgeStatus/BadgeStatus.md](BadgeStatus/BadgeStatus.md) | `BadgeStatus` / `JBadgeStatus` |
|
|
50
|
+
| 卡片式单选、多选、能力选择 | `CardSelect` | [CardSelect/CardSelect.md](CardSelect/CardSelect.md) | `CardSelect` / `JCardSelect` |
|
|
51
|
+
| 按钮式单选、多选 | `CheckButton` | [CheckButton/CheckButton.md](CheckButton/CheckButton.md) | `CheckButton` / `JCheckButton` |
|
|
52
|
+
| 组件库主题、图标、权限和国际化总配置 | `ConfigProvider` | [ConfigProvider/ConfigProvider.md](ConfigProvider/ConfigProvider.md) | `ConfigProvider` / `JConfigProvider` |
|
|
53
|
+
| 可拖动、可缩放弹窗 | `DragModal` | [DragModal/DragModal.md](DragModal/DragModal.md) | `DragModal` / `JDragModal` |
|
|
54
|
+
| 大数据量可编辑表格、单元格校验 | `EditTable` | [EditTable/EditTable.md](EditTable/EditTable.md) | `EditTable` / `JEditTable` |
|
|
55
|
+
| 文本省略、Tooltip、点击展开 | `Ellipsis` | [Ellipsis/Ellipsis.md](Ellipsis/Ellipsis.md) | `Ellipsis` / `JEllipsis` |
|
|
56
|
+
| 空状态 | `Empty` | [Empty/Empty.md](Empty/Empty.md) | `Empty` / `JEmpty` |
|
|
57
|
+
| 撑满页面剩余高度 | `FullPage` | [FullPage/FullPage.md](FullPage/FullPage.md) | `FullPage` / `JFullPage` |
|
|
58
|
+
| Ant Design 图标、iconfont 图标 | `AIcon` | [Icon/Icon.md](Icon/Icon.md) | `AIcon` / `AIcon` |
|
|
59
|
+
| Markdown 内容渲染 | `Markdown` | [Markdown/Markdown.md](Markdown/Markdown.md) | `Markdown` / `JMarkdown` |
|
|
60
|
+
| 权限控制按钮、二次确认 | `PermissionButton` | [PermissionButton/PermissionButton.md](PermissionButton/PermissionButton.md) | `PermissionButton` / `JPermissionButton` |
|
|
61
|
+
| 应用布局、页面容器 | `ProLayout`、`PageContainer` | [ProLayout/ProLayout.md](ProLayout/ProLayout.md) | `ProLayout`、`PageContainer` / `JProLayout`、`JPageContainer` |
|
|
62
|
+
| 请求、分页、行选择、表格/卡片双形态 | `ProTable` | [ProTable/ProTable.md](ProTable/ProTable.md) | `ProTable` / `JProTable` |
|
|
63
|
+
| 自定义滚动条 | `Scrollbar` | [Scrollbar/Scrollbar.md](Scrollbar/Scrollbar.md) | `Scrollbar` / `JScrollbar` |
|
|
64
|
+
| 配置式搜索、高级组合搜索 | `Search`、`AdvancedSearch` | [Search/Search.md](Search/Search.md) | `Search`、`AdvancedSearch` / `JSearch`、`JAdvancedSearch` |
|
|
65
|
+
| 加载占位、业务骨架 | `Skeleton` 及具名骨架 | [Skeleton/Skeleton.md](Skeleton/Skeleton.md) | 非根入口;见“非根入口能力” |
|
|
66
|
+
| 时间戳格式化 | `TimeFormat` | [TimeFormat/TimeFormat.md](TimeFormat/TimeFormat.md) | `TimeFormat` / `JTimeFormat` |
|
|
67
|
+
| 区块标题、标题右侧操作 | `Title` | [Title/Title.md](Title/Title.md) | `Title` / `JTitle` |
|
|
68
|
+
| 按字段类型渲染输入控件 | `ValueItem` | [ValueItem/ValueItem.md](ValueItem/ValueItem.md) | `ValueItem` / `JValueItem` |
|
|
69
|
+
| 虚拟滚动表格、树形大数据列表 | `VirtualTable` | [VirtualTable/VirtualTable.md](VirtualTable/VirtualTable.md) | `VirtualTable` / `JVirtualTable` |
|
|
70
|
+
|
|
71
|
+
## 非根入口能力
|
|
72
|
+
|
|
73
|
+
以下目录有实现和文档,但未从 [`components.ts`](components.ts) 导出,不能写成 `import { X } from '@jetlinks-web/components'`,也不会被整包安装自动注册:
|
|
74
|
+
|
|
75
|
+
| 目录 / 能力 | 用途 | 文档 | 使用边界 |
|
|
76
|
+
| --- | --- | --- | --- |
|
|
77
|
+
| `LocaleProvider` | 为组件子树提供语言包 | [LocaleProvider/LocaleProvider.md](LocaleProvider/LocaleProvider.md) | 包内部基础设施;优先通过根入口 `ConfigProvider` 配置 |
|
|
78
|
+
| `LocaleReciver` / `useLocaleReceiver` | 组件内部读取语言包的 Hook | [LocaleReciver/LocaleReciver.md](LocaleReciver/LocaleReciver.md) | 非组件;仅在维护组件包内部国际化时按源码路径使用 |
|
|
79
|
+
| `RadioButton` | 网格式受控单选按钮组 | [RadioButton/RadioButton.md](RadioButton/RadioButton.md) | 目录自身有安装器,但根插件不可达;使用前必须核验目标版本的子路径 |
|
|
80
|
+
| `Skeleton`、`JSkeleton*` | 通用及场景化骨架屏 | [Skeleton/Skeleton.md](Skeleton/Skeleton.md) | 仅子路径可达;使用前必须核验目标版本和相邻生产用法 |
|
|
81
|
+
|
|
82
|
+
## 附属导出与深层能力
|
|
83
|
+
|
|
84
|
+
- `PageContainer` 是 `ProLayout` 的根入口附属导出。
|
|
85
|
+
- `AdvancedSearch` 是 `Search` 的根入口附属导出,并由 `Search` 安装器注册为 `JAdvancedSearch`。
|
|
86
|
+
- `EditTable` 安装时会附带注册 `JEditTableFormItem`,但该表单项不是根入口具名导出。
|
|
87
|
+
- `BadgeStatus/getHexColor`、`ProLayout/LayoutType`、`PermissionButton/DefinedPropsType`、`ProTable/hooks` 等能力存在于目录或深层文件中,不等于包根入口公开 API。
|
|
88
|
+
- 深层能力必须以目标项目已存在的生产导入为证据;若没有证据,优先寻找根入口或 `@jetlinks-web-core` 的稳定封装。
|
|
89
|
+
|
|
90
|
+
## 与 @jetlinks-web-core/components 的边界
|
|
91
|
+
|
|
92
|
+
| 能力层 | 适合承载 | 查找入口 |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| `@jetlinks-web/components` | 跨项目共享的基础组件、表格、搜索、图标、布局、权限按钮、输入与展示控件 | 本文件 → 单组件文档 → `components.ts` → 组件源码 |
|
|
95
|
+
| `@jetlinks-web-core/components` | JetLinks 项目级业务组件、共享业务壳、权限/i18n/路由适配、运行时注册和跨组件组合 | `jetlinks-web-core/src/components/index.ts` → 组件源码 → 相邻业务页面 |
|
|
96
|
+
| 业务模块局部组件 | 单一业务域的字段、流程、接口和状态编排 | 当前 feature → 当前模块 → 同业务域模块 |
|
|
97
|
+
|
|
98
|
+
当两层都能满足需求时,优先使用当前项目已经稳定使用的 `@jetlinks-web-core` 封装;不要为了直接使用基础组件而绕过项目级契约。项目级没有对应封装时,优先直接复用 `@jetlinks-web/components`,不要在业务模块再复制一层无职责包装。
|
|
99
|
+
|
|
100
|
+
## AI 自检
|
|
101
|
+
|
|
102
|
+
- 是否先打开本映射,再按需读取候选组件文档,而不是全文加载 25 份文档。
|
|
103
|
+
- 是否区分了目录名、根导出名和全局注册名。
|
|
104
|
+
- 是否核验了 `components.ts`,没有把非根入口目录当成根 API。
|
|
105
|
+
- 是否核验目标项目实际安装版本,避免用源码新版本能力生成旧项目代码。
|
|
106
|
+
- 是否搜索过相邻生产页面,确认权限、i18n、样式和组合方式。
|
|
107
|
+
- 是否优先复用 `@jetlinks-web-core` 已有项目级封装,并避免新增无职责包装组件。
|
|
108
|
+
- 是否只在有真实生产证据时使用深层子路径。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export var genTokenScrollbarStyle = function genTokenScrollbarStyle(token) {
|
|
2
|
+
return {
|
|
3
|
+
scrollbarWidth: 'thin',
|
|
4
|
+
scrollbarColor: "".concat(token.colorFillSecondary, " ").concat(token.colorFillQuaternary),
|
|
5
|
+
'&::-webkit-scrollbar': {
|
|
6
|
+
width: 10,
|
|
7
|
+
height: 10
|
|
8
|
+
},
|
|
9
|
+
'&::-webkit-scrollbar-track': {
|
|
10
|
+
backgroundColor: token.colorFillQuaternary
|
|
11
|
+
},
|
|
12
|
+
'&::-webkit-scrollbar-thumb': {
|
|
13
|
+
backgroundColor: token.colorFillSecondary,
|
|
14
|
+
borderRadius: token.borderRadiusLG,
|
|
15
|
+
border: "".concat(token.lineWidth * 2, "px solid ").concat(token.colorFillQuaternary)
|
|
16
|
+
},
|
|
17
|
+
'&::-webkit-scrollbar-thumb:hover': {
|
|
18
|
+
backgroundColor: token.colorFill
|
|
19
|
+
},
|
|
20
|
+
'&::-webkit-scrollbar-corner': {
|
|
21
|
+
backgroundColor: token.colorFillQuaternary
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -1,17 +1,51 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import {
|
|
3
|
+
import { computed, unref } from 'vue';
|
|
4
|
+
import { theme } from 'ant-design-vue';
|
|
5
|
+
import { useStyleRegister } from 'ant-design-vue/es/theme/internal';
|
|
6
|
+
import { useConfigContextInject } from 'ant-design-vue/es/config-provider/context';
|
|
7
|
+
import { genCommonStyle } from 'ant-design-vue/es/style';
|
|
4
8
|
import variableToken from './variable';
|
|
5
9
|
var genCompoentStyle = function genCompoentStyle(styleFn) {
|
|
6
|
-
return
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
return function (_prefixCls) {
|
|
11
|
+
var prefixCls = computed(function () {
|
|
12
|
+
return unref(_prefixCls);
|
|
13
|
+
});
|
|
14
|
+
var _theme$useToken = theme.useToken(),
|
|
15
|
+
themeRef = _theme$useToken.theme,
|
|
16
|
+
token = _theme$useToken.token,
|
|
17
|
+
hashId = _theme$useToken.hashId;
|
|
18
|
+
var _useConfigContextInje = useConfigContextInject(),
|
|
19
|
+
getPrefixCls = _useConfigContextInje.getPrefixCls,
|
|
20
|
+
iconPrefixCls = _useConfigContextInje.iconPrefixCls;
|
|
21
|
+
var rootPrefixCls = computed(function () {
|
|
22
|
+
return getPrefixCls();
|
|
23
|
+
});
|
|
24
|
+
var componentInfo = computed(function () {
|
|
25
|
+
return {
|
|
26
|
+
theme: themeRef.value,
|
|
27
|
+
token: token.value,
|
|
28
|
+
hashId: hashId.value,
|
|
29
|
+
path: ['jetlinks-components', prefixCls.value, rootPrefixCls.value, iconPrefixCls.value]
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
var wrapSSR = useStyleRegister(componentInfo, function () {
|
|
33
|
+
var componentCls = ".".concat(prefixCls.value);
|
|
34
|
+
var componentToken = {
|
|
35
|
+
token: _objectSpread(_objectSpread(_objectSpread({}, token.value), variableToken), {}, {
|
|
36
|
+
componentCls: componentCls,
|
|
37
|
+
prefixCls: prefixCls.value,
|
|
38
|
+
iconCls: ".".concat(iconPrefixCls.value),
|
|
39
|
+
antCls: ".".concat(rootPrefixCls.value)
|
|
40
|
+
}),
|
|
41
|
+
hashId: hashId.value,
|
|
42
|
+
componentCls: componentCls
|
|
43
|
+
};
|
|
44
|
+
return [genCommonStyle(token.value, prefixCls.value)].concat(_toConsumableArray(styleFn.map(function (item) {
|
|
45
|
+
return item(componentToken);
|
|
46
|
+
})));
|
|
47
|
+
});
|
|
48
|
+
return [wrapSSR, hashId];
|
|
49
|
+
};
|
|
16
50
|
};
|
|
17
51
|
export default genCompoentStyle;
|