@meethive/components 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/es/AutoComplete/AutoComplete.js +71 -80
  2. package/es/BadgeStatus/Badge.js +38 -47
  3. package/es/CardSelect/CardSelect.js +115 -137
  4. package/es/CheckButton/CheckButton.js +102 -118
  5. package/es/ConfigProvider/ConfigProvider.js +44 -68
  6. package/es/DragModal/DragModal.js +191 -212
  7. package/es/EditTable/Body.js +158 -189
  8. package/es/EditTable/CellRender.js +10 -12
  9. package/es/EditTable/EditTable.js +385 -434
  10. package/es/EditTable/FormItem.js +140 -169
  11. package/es/EditTable/Group.js +171 -204
  12. package/es/EditTable/Header.js +57 -63
  13. package/es/EditTable/HeaderRender.js +10 -12
  14. package/es/EditTable/components/ContextMenu/Menu.js +78 -86
  15. package/es/EditTable/components/Search/Search.js +151 -163
  16. package/es/EditTable/components/Search/Sort.js +104 -119
  17. package/es/Ellipsis/Ellipsis.js +144 -148
  18. package/es/Empty/Empty.js +51 -57
  19. package/es/FullPage/FullPage.js +20 -19
  20. package/es/Icon/Icon.js +42 -49
  21. package/es/LocaleProvider/LocaleProvider.js +38 -31
  22. package/es/Markdown/Markdown.js +101 -118
  23. package/es/PermissionButton/PermissionButton.js +118 -118
  24. package/es/ProLayout/Basic/BasicLayout.js +301 -418
  25. package/es/ProLayout/Basic/Header.js +91 -111
  26. package/es/ProLayout/PageContainer/index.js +267 -344
  27. package/es/ProLayout/SiderMenu/BaseMenu.js +186 -240
  28. package/es/ProTable/Alert.js +39 -40
  29. package/es/ProTable/Content.js +84 -97
  30. package/es/ProTable/Header.js +32 -33
  31. package/es/ProTable/Pagination.js +56 -55
  32. package/es/ProTable/ProTable.js +256 -276
  33. package/es/RadioButton/RadioButton.js +48 -53
  34. package/es/Scrollbar/Bar.js +65 -76
  35. package/es/Scrollbar/Scrollbar.js +129 -161
  36. package/es/Scrollbar/Thumb.js +101 -150
  37. package/es/Search/Item.js +208 -236
  38. package/es/Search/Search.js +90 -90
  39. package/es/Skeleton/Skeleton.js +26 -27
  40. package/es/Skeleton/components/DashBoardCard.js +26 -27
  41. package/es/Skeleton/components/DashBoardChart.js +26 -27
  42. package/es/Skeleton/components/Detail.js +26 -27
  43. package/es/Skeleton/components/Drawer.js +26 -27
  44. package/es/Skeleton/components/Item.js +55 -54
  45. package/es/Skeleton/components/List.js +29 -27
  46. package/es/Skeleton/components/ListCard.js +28 -28
  47. package/es/Skeleton/components/ListCardItem.js +20 -20
  48. package/es/Skeleton/components/ListTable.js +26 -27
  49. package/es/Skeleton/components/Page.js +27 -26
  50. package/es/Skeleton/components/Search.js +16 -16
  51. package/es/Skeleton/components/Tree.js +26 -27
  52. package/es/TimeFormat/TimeFormat.js +32 -36
  53. package/es/Title/Title.js +23 -26
  54. package/es/ValueItem/ValueItem.js +100 -113
  55. package/es/VirtualTable/VirtualTable.js +235 -271
  56. package/lib/AutoComplete/AutoComplete.js +71 -80
  57. package/lib/BadgeStatus/Badge.js +38 -47
  58. package/lib/CardSelect/CardSelect.js +115 -137
  59. package/lib/CheckButton/CheckButton.js +102 -118
  60. package/lib/ConfigProvider/ConfigProvider.js +44 -68
  61. package/lib/DragModal/DragModal.js +191 -212
  62. package/lib/EditTable/Body.js +158 -189
  63. package/lib/EditTable/CellRender.js +10 -12
  64. package/lib/EditTable/EditTable.js +385 -434
  65. package/lib/EditTable/FormItem.js +140 -169
  66. package/lib/EditTable/Group.js +171 -204
  67. package/lib/EditTable/Header.js +57 -63
  68. package/lib/EditTable/HeaderRender.js +10 -12
  69. package/lib/EditTable/components/ContextMenu/Menu.js +78 -86
  70. package/lib/EditTable/components/Search/Search.js +151 -163
  71. package/lib/EditTable/components/Search/Sort.js +104 -119
  72. package/lib/Ellipsis/Ellipsis.js +144 -148
  73. package/lib/Empty/Empty.js +51 -57
  74. package/lib/FullPage/FullPage.js +20 -19
  75. package/lib/Icon/Icon.js +42 -49
  76. package/lib/LocaleProvider/LocaleProvider.js +38 -31
  77. package/lib/Markdown/Markdown.js +101 -118
  78. package/lib/PermissionButton/PermissionButton.js +118 -118
  79. package/lib/ProLayout/Basic/BasicLayout.js +301 -418
  80. package/lib/ProLayout/Basic/Header.js +91 -111
  81. package/lib/ProLayout/PageContainer/index.js +267 -344
  82. package/lib/ProLayout/SiderMenu/BaseMenu.js +186 -240
  83. package/lib/ProTable/Alert.js +39 -40
  84. package/lib/ProTable/Content.js +84 -97
  85. package/lib/ProTable/Header.js +32 -33
  86. package/lib/ProTable/Pagination.js +56 -55
  87. package/lib/ProTable/ProTable.js +256 -276
  88. package/lib/RadioButton/RadioButton.js +48 -53
  89. package/lib/Scrollbar/Bar.js +65 -76
  90. package/lib/Scrollbar/Scrollbar.js +129 -161
  91. package/lib/Scrollbar/Thumb.js +101 -150
  92. package/lib/Search/Item.js +208 -236
  93. package/lib/Search/Search.js +90 -90
  94. package/lib/Skeleton/Skeleton.js +26 -27
  95. package/lib/Skeleton/components/DashBoardCard.js +26 -27
  96. package/lib/Skeleton/components/DashBoardChart.js +26 -27
  97. package/lib/Skeleton/components/Detail.js +26 -27
  98. package/lib/Skeleton/components/Drawer.js +26 -27
  99. package/lib/Skeleton/components/Item.js +55 -54
  100. package/lib/Skeleton/components/List.js +29 -27
  101. package/lib/Skeleton/components/ListCard.js +28 -28
  102. package/lib/Skeleton/components/ListCardItem.js +20 -20
  103. package/lib/Skeleton/components/ListTable.js +26 -27
  104. package/lib/Skeleton/components/Page.js +27 -26
  105. package/lib/Skeleton/components/Search.js +16 -16
  106. package/lib/Skeleton/components/Tree.js +26 -27
  107. package/lib/TimeFormat/TimeFormat.js +32 -36
  108. package/lib/Title/Title.js +23 -26
  109. package/lib/ValueItem/ValueItem.js +100 -113
  110. package/lib/VirtualTable/VirtualTable.js +235 -271
  111. package/package.json +1 -1
@@ -1,354 +1,277 @@
1
- function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
- import { defineComponent, computed, toRefs, unref } from 'vue'
3
- import { withInstall } from 'ant-design-vue/es/_util/type'
4
- import { Affix, Spin, PageHeader, Tabs, Button } from 'ant-design-vue'
5
- import { pageHeaderProps } from 'ant-design-vue/es/page-header'
6
- import { useRouteContext } from '../RouteContext'
7
- import { getSlotVNode } from '../util'
8
- import { LayoutType } from '../defaultSettings'
9
- import { useLocaleReceiver } from '../../LocaleReciver'
10
- import useProLayoutStyle from '../style'
11
-
12
- export const pageHeaderTabConfig = {
1
+ import { defineComponent, computed, toRefs, unref } from 'vue';
2
+ import { withInstall } from 'ant-design-vue/es/_util/type';
3
+ import { Affix, Spin, PageHeader, Tabs, Button } from 'ant-design-vue';
4
+ import { pageHeaderProps } from 'ant-design-vue/es/page-header';
5
+ import { useRouteContext } from '../RouteContext';
6
+ import { getSlotVNode } from '../util';
7
+ import { LayoutType } from '../defaultSettings';
8
+ import { useLocaleReceiver } from '../../LocaleReciver';
9
+ import useProLayoutStyle from '../style';
10
+ export const pageHeaderTabConfig = {
13
11
  /**
14
12
  * @name tabs 的列表
15
- */
16
- tabList: {
17
- type: [Object, Function, Array],
18
- default: () => undefined
19
- },
13
+ */
14
+ tabList: {
15
+ type: [Object, Function, Array],
16
+ default: () => undefined
17
+ },
20
18
  /**
21
19
  * @name 当前选中 tab 的 key
22
- */
23
- tabActiveKey: String,
20
+ */
21
+ tabActiveKey: String,
24
22
  /**
25
23
  * @name tab 上多余的区域
26
- */
27
- tabBarExtraContent: {
28
- type: [Object, Function],
29
- default: () => undefined
30
- },
24
+ */
25
+ tabBarExtraContent: {
26
+ type: [Object, Function],
27
+ default: () => undefined
28
+ },
31
29
  /**
32
30
  * @name tabs 的其他配置
33
- */
34
- tabProps: {
35
- type: Object,
36
- default: () => undefined
37
- },
31
+ */
32
+ tabProps: {
33
+ type: Object,
34
+ default: () => undefined
35
+ },
38
36
  /**
39
37
  * @name 固定 PageHeader 到页面顶部
40
- */
41
- fixedHeader: Boolean,
42
- // events
43
- onTabChange: Function,
44
- pure: Boolean
45
- }
46
-
47
- export const pageContainerProps = {
48
- ...pageHeaderTabConfig,
49
- ...pageHeaderProps,
50
- prefixCls: {
51
- type: String,
52
- default: 'ant-pro'
53
- },
54
- title: {
55
- type: [Object, String, Boolean, Function],
56
- default: () => null
57
- },
58
- subTitle: {
59
- type: [Object, String, Boolean, Function],
60
- default: () => null
61
- },
62
- content: {
63
- type: [Object, String, Boolean, Function],
64
- default: () => null
65
- },
66
- extra: {
67
- type: [Object, String, Boolean, Function],
68
- default: () => null
69
- },
70
- extraContent: {
71
- type: [Object, String, Boolean, Function],
72
- default: () => null
73
- },
74
- header: {
75
- type: [Object, String, Boolean, Function],
76
- default: () => null
77
- },
78
- pageHeaderRender: {
79
- type: [Object, Function, Boolean],
80
- default: () => undefined
81
- },
82
- affixProps: {
83
- type: [Object, Function]
84
- },
85
- ghost: {
86
- type: Boolean,
87
- default: () => false
88
- },
89
- loading: {
90
- type: Boolean,
91
- default: () => undefined
92
- },
93
- childrenFullHeight: {
94
- type: Boolean,
95
- default: () => true
96
- },
97
- pure: {
98
- type: Boolean,
99
- default: false
100
- },
101
- showBack: {
102
- type: Boolean,
103
- default: false
104
- },
105
- contentStyle: {
106
- type: Object,
107
- default: () => ({})
108
- },
109
- onBack: {
110
- type: Function
111
- }
112
- }
113
-
114
- const renderFooter = (props) => {
115
- const {
116
- tabList,
117
- tabActiveKey,
118
- onTabChange,
119
- tabBarExtraContent,
120
- tabProps
121
- } = props
122
-
123
- const tabPane = (item) => {
124
- return React.createElement('span', { class: item.class || `tab-pane-${item.key}`,}, item.tab)
125
- }
126
-
127
- if (tabList && tabList.length) {
128
- return (
129
- React.createElement(Tabs, {
130
- class: "page-container-tabs",
131
- activeKey: tabActiveKey,
132
- onChange: (key) => {
133
- if (onTabChange) {
134
- onTabChange(key)
135
- }
136
- },
137
- tabBarExtraContent: tabBarExtraContent,
138
- ...tabProps,}
139
-
140
- , tabList.map((item) => (
141
- React.createElement(Tabs.TabPane, {
142
- ...item,
143
- tab: tabPane(item),
144
- key: item.key,}
145
- )
146
- ))
147
- )
148
- )
149
- }
150
- return null
151
- }
152
-
153
- const renderPageHeader = (content, extraContent, prefixedClassName) => {
154
- if (!content && !extraContent) {
155
- return null
156
- }
157
- return (
158
- React.createElement('div', { class: `${prefixedClassName}-detail`,}
159
- , React.createElement('div', { class: `${prefixedClassName}-main`,}
160
- , React.createElement('div', { class: `${prefixedClassName}-row`,}
161
- , content && (
162
- React.createElement('div', { class: `${prefixedClassName}-content`,}
163
- , typeof content === 'function' && content() || content
164
- )
165
- )
166
- , extraContent && (
167
- React.createElement('div', { class: `${prefixedClassName}-extraContent`,}
168
- , typeof extraContent === 'function' && extraContent() || extraContent
169
- )
170
- )
171
- )
172
- )
173
- )
174
- )
175
- }
176
-
177
- const ProPageHeader = (props) => {
178
- const {
179
- title,
180
- tabList,
181
- tabActiveKey,
182
- content,
183
- pageHeaderRender,
184
- header,
185
- extraContent,
186
- prefixedClassName,
187
- prefixCls,
188
- fixedHeader: _,
189
- showBack,
190
- onBack,
191
- ...restProps
192
- } = props
193
-
194
- const value = useRouteContext()
195
- const [contextLocale] = useLocaleReceiver('ProLayout')
196
-
197
- if (pageHeaderRender === false) {
198
- return null
199
- }
200
- if (pageHeaderRender) {
201
- return pageHeaderRender({ ...props })
202
- }
203
-
204
- let pageHeaderTitle = title
205
- if (!title && title !== false) {
206
- pageHeaderTitle = (value ).title
207
- }
208
-
209
- const unrefBreadcrumb = unref((value ).breadcrumb || {})
210
- const breadcrumb = props.breadcrumb || {
211
- ...unrefBreadcrumb,
212
- routes: unrefBreadcrumb.routes,
213
- itemRender: unrefBreadcrumb.itemRender
214
- }
215
-
216
- const backProps = {}
217
- if (showBack) {
218
- // @ts-ignore
219
- backProps.backIcon = React.createElement(Button, null, contextLocale.value.pageContainer.back)
220
- backProps.onBack = () => {
221
- if (props.onBack) {
222
- props.onBack()
223
- } else {
224
- _optionalChain([(value ), 'access', _2 => _2.back, 'optionalCall', _3 => _3()])
225
- }
226
- }
227
- }
228
-
229
- const styles = (value ).layoutType === LayoutType.CARD
230
- ? {
231
- padding: props.extra || props.subTitle || pageHeaderTitle || tabList || props.extraContent || props.showBack || props.title
232
- ? '16px 24px'
233
- : '0px'
234
- }
235
- : {}
236
-
237
- return (
238
- React.createElement('div', { class: `${prefixedClassName}-wrap`,}
239
- , React.createElement(PageHeader, {
240
- style: styles,
241
- ...backProps,
242
- ...restProps,
243
- title: pageHeaderTitle,
244
- breadcrumb: (value ).layoutType === LayoutType.LIST ? breadcrumb : null,
245
- footer: renderFooter({
246
- ...restProps,
247
- tabList,
248
- tabActiveKey
249
- }),
250
- prefixCls: prefixCls,}
251
-
252
- , header || renderPageHeader(content, extraContent, prefixedClassName)
253
- )
254
- )
255
- )
256
- }
257
-
258
- const PageContainer = defineComponent({
259
- name: 'JPageContainer',
260
- inheritAttrs: false,
261
- props: pageContainerProps ,
262
- setup(props, { slots, attrs }) {
263
- const {
264
- loading,
265
- affixProps,
266
- ghost,
267
- childrenFullHeight
268
- } = toRefs(props)
269
-
270
- const value = useRouteContext()
271
- const getPrefixCls = (value ).getPrefixCls
272
- const prefixCls = props.prefixCls || getPrefixCls()
273
-
274
- const stylePrefixCls = computed(() => 'pro-layout')
275
- const [wrapSSR, hashId] = useProLayoutStyle(stylePrefixCls)
276
-
277
- const prefixedClassName = computed(() => `${prefixCls}-page-container`)
278
-
279
- const classNames = computed(() => ({
280
- [hashId.value]: true,
281
- [prefixedClassName.value]: true,
282
- [`${prefixCls}-page-container-ghost`]: ghost.value
283
- }))
284
-
285
- const headerDom = computed(() => {
286
- // const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
287
- const headerContent = getSlotVNode(slots, props, 'content')
288
- const extra = getSlotVNode(slots, props, 'extra')
289
- const extraContent = getSlotVNode(slots, props, 'extraContent')
290
- const subTitle = getSlotVNode(slots, props, 'subTitle')
291
- const title = getSlotVNode(slots, props, 'title')
292
- // @ts-ignore
293
- return (
294
- React.createElement(ProPageHeader, {
295
- ...props,
296
- prefixCls: undefined,
297
- prefixedClassName: prefixedClassName.value,
298
- ghost: ghost.value,
299
- title: title,
300
- subTitle: subTitle,
301
- content: headerContent,
302
- extra: extra,
303
- extraContent: extraContent,}
304
- )
305
- )
306
- })
307
-
308
- return () => {
309
- const { fixedHeader, pure } = props
310
-
311
- return (
312
- React.createElement(React.Fragment, null
313
- , pure ? (
314
- React.createElement('div', { class: classNames.value,}
315
- , _optionalChain([slots, 'access', _4 => _4.default, 'optionalCall', _5 => _5()])
316
- )
317
- ) : (
318
- React.createElement('div', { class: classNames.value, style: { ...(attrs.style || {}) },}
319
- , fixedHeader && headerDom.value ? (
320
- React.createElement(Affix, {
321
- ...affixProps.value,
322
- offsetTop: (value ).hasHeader && (value ).fixedHeader ? (value ).headerHeight : 0,}
323
-
324
- , headerDom.value
325
- )
326
- ) : (
327
- headerDom.value
328
- )
329
- , React.createElement('div', { class: `${prefixedClassName.value}-grid-content`,}
330
- , loading.value ? (
331
- React.createElement(Spin, null )
332
- ) : slots.default ? (
333
- React.createElement('div', null
334
- , React.createElement('div', {
335
- class: `${prefixedClassName.value}-children-content ${childrenFullHeight.value ? 'children-full-height' : ''} ${hashId.value}`,
336
- style: { ...(props.contentStyle || {}) },}
337
-
338
- , slots.default()
339
- )
340
- , (value ).hasFooterToolbar && (
341
- React.createElement('div', { style: { height: 48, marginTop: 24 },} )
342
- )
343
- )
344
- ) : null
345
- )
346
- )
347
- )
348
- )
349
- )
350
- }
351
- }
352
- })
353
-
354
- export default withInstall(PageContainer)
38
+ */
39
+ fixedHeader: Boolean,
40
+ // events
41
+ onTabChange: Function,
42
+ pure: Boolean
43
+ };
44
+ export const pageContainerProps = {
45
+ ...pageHeaderTabConfig,
46
+ ...pageHeaderProps,
47
+ prefixCls: {
48
+ type: String,
49
+ default: 'ant-pro'
50
+ },
51
+ title: {
52
+ type: [Object, String, Boolean, Function],
53
+ default: () => null
54
+ },
55
+ subTitle: {
56
+ type: [Object, String, Boolean, Function],
57
+ default: () => null
58
+ },
59
+ content: {
60
+ type: [Object, String, Boolean, Function],
61
+ default: () => null
62
+ },
63
+ extra: {
64
+ type: [Object, String, Boolean, Function],
65
+ default: () => null
66
+ },
67
+ extraContent: {
68
+ type: [Object, String, Boolean, Function],
69
+ default: () => null
70
+ },
71
+ header: {
72
+ type: [Object, String, Boolean, Function],
73
+ default: () => null
74
+ },
75
+ pageHeaderRender: {
76
+ type: [Object, Function, Boolean],
77
+ default: () => undefined
78
+ },
79
+ affixProps: {
80
+ type: [Object, Function]
81
+ },
82
+ ghost: {
83
+ type: Boolean,
84
+ default: () => false
85
+ },
86
+ loading: {
87
+ type: Boolean,
88
+ default: () => undefined
89
+ },
90
+ childrenFullHeight: {
91
+ type: Boolean,
92
+ default: () => true
93
+ },
94
+ pure: {
95
+ type: Boolean,
96
+ default: false
97
+ },
98
+ showBack: {
99
+ type: Boolean,
100
+ default: false
101
+ },
102
+ contentStyle: {
103
+ type: Object,
104
+ default: () => ({})
105
+ },
106
+ onBack: {
107
+ type: Function
108
+ }
109
+ };
110
+ const renderFooter = props => {
111
+ const {
112
+ tabList,
113
+ tabActiveKey,
114
+ onTabChange,
115
+ tabBarExtraContent,
116
+ tabProps
117
+ } = props;
118
+ const tabPane = item => {
119
+ return <span class={item.class || `tab-pane-${item.key}`}>{item.tab}</span>;
120
+ };
121
+ if (tabList && tabList.length) {
122
+ return <Tabs class="page-container-tabs" activeKey={tabActiveKey} onChange={key => {
123
+ if (onTabChange) {
124
+ onTabChange(key);
125
+ }
126
+ }} tabBarExtraContent={tabBarExtraContent} {...tabProps}>
127
+ {tabList.map(item => <Tabs.TabPane {...item} tab={tabPane(item)} key={item.key} />)}
128
+ </Tabs>;
129
+ }
130
+ return null;
131
+ };
132
+ const renderPageHeader = (content, extraContent, prefixedClassName) => {
133
+ if (!content && !extraContent) {
134
+ return null;
135
+ }
136
+ return <div class={`${prefixedClassName}-detail`}>
137
+ <div class={`${prefixedClassName}-main`}>
138
+ <div class={`${prefixedClassName}-row`}>
139
+ {content && <div class={`${prefixedClassName}-content`}>
140
+ {typeof content === 'function' && content() || content}
141
+ </div>}
142
+ {extraContent && <div class={`${prefixedClassName}-extraContent`}>
143
+ {typeof extraContent === 'function' && extraContent() || extraContent}
144
+ </div>}
145
+ </div>
146
+ </div>
147
+ </div>;
148
+ };
149
+ const ProPageHeader = props => {
150
+ const {
151
+ title,
152
+ tabList,
153
+ tabActiveKey,
154
+ content,
155
+ pageHeaderRender,
156
+ header,
157
+ extraContent,
158
+ prefixedClassName,
159
+ prefixCls,
160
+ fixedHeader: _,
161
+ showBack,
162
+ onBack,
163
+ ...restProps
164
+ } = props;
165
+ const value = useRouteContext();
166
+ const [contextLocale] = useLocaleReceiver('ProLayout');
167
+ if (pageHeaderRender === false) {
168
+ return null;
169
+ }
170
+ if (pageHeaderRender) {
171
+ return pageHeaderRender({
172
+ ...props
173
+ });
174
+ }
175
+ let pageHeaderTitle = title;
176
+ if (!title && title !== false) {
177
+ pageHeaderTitle = value.title;
178
+ }
179
+ const unrefBreadcrumb = unref(value.breadcrumb || {});
180
+ const breadcrumb = props.breadcrumb || {
181
+ ...unrefBreadcrumb,
182
+ routes: unrefBreadcrumb.routes,
183
+ itemRender: unrefBreadcrumb.itemRender
184
+ };
185
+ const backProps = {};
186
+ if (showBack) {
187
+ // @ts-ignore
188
+ backProps.backIcon = <Button>{contextLocale.value.pageContainer.back}</Button>;
189
+ backProps.onBack = () => {
190
+ if (props.onBack) {
191
+ props.onBack();
192
+ } else {
193
+ value.back?.();
194
+ }
195
+ };
196
+ }
197
+ const styles = value.layoutType === LayoutType.CARD ? {
198
+ padding: props.extra || props.subTitle || pageHeaderTitle || tabList || props.extraContent || props.showBack || props.title ? '16px 24px' : '0px'
199
+ } : {};
200
+ return <div class={`${prefixedClassName}-wrap`}>
201
+ <PageHeader style={styles} {...backProps} {...restProps} title={pageHeaderTitle} breadcrumb={value.layoutType === LayoutType.LIST ? breadcrumb : null} footer={renderFooter({
202
+ ...restProps,
203
+ tabList,
204
+ tabActiveKey
205
+ })} prefixCls={prefixCls}>
206
+ {header || renderPageHeader(content, extraContent, prefixedClassName)}
207
+ </PageHeader>
208
+ </div>;
209
+ };
210
+ const PageContainer = defineComponent({
211
+ name: 'JPageContainer',
212
+ inheritAttrs: false,
213
+ props: pageContainerProps,
214
+ setup(props, {
215
+ slots,
216
+ attrs
217
+ }) {
218
+ const {
219
+ loading,
220
+ affixProps,
221
+ ghost,
222
+ childrenFullHeight
223
+ } = toRefs(props);
224
+ const value = useRouteContext();
225
+ const getPrefixCls = value.getPrefixCls;
226
+ const prefixCls = props.prefixCls || getPrefixCls();
227
+ const stylePrefixCls = computed(() => 'pro-layout');
228
+ const [wrapSSR, hashId] = useProLayoutStyle(stylePrefixCls);
229
+ const prefixedClassName = computed(() => `${prefixCls}-page-container`);
230
+ const classNames = computed(() => ({
231
+ [hashId.value]: true,
232
+ [prefixedClassName.value]: true,
233
+ [`${prefixCls}-page-container-ghost`]: ghost.value
234
+ }));
235
+ const headerDom = computed(() => {
236
+ // const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
237
+ const headerContent = getSlotVNode(slots, props, 'content');
238
+ const extra = getSlotVNode(slots, props, 'extra');
239
+ const extraContent = getSlotVNode(slots, props, 'extraContent');
240
+ const subTitle = getSlotVNode(slots, props, 'subTitle');
241
+ const title = getSlotVNode(slots, props, 'title');
242
+ // @ts-ignore
243
+ return <ProPageHeader {...props} prefixCls={undefined} prefixedClassName={prefixedClassName.value} ghost={ghost.value} title={title} subTitle={subTitle} content={headerContent} extra={extra} extraContent={extraContent} />;
244
+ });
245
+ return () => {
246
+ const {
247
+ fixedHeader,
248
+ pure
249
+ } = props;
250
+ return <>
251
+ {pure ? <div class={classNames.value}>
252
+ {slots.default?.()}
253
+ </div> : <div class={classNames.value} style={{
254
+ ...(attrs.style || {})
255
+ }}>
256
+ {fixedHeader && headerDom.value ? <Affix {...affixProps.value} offsetTop={value.hasHeader && value.fixedHeader ? value.headerHeight : 0}>
257
+ {headerDom.value}
258
+ </Affix> : headerDom.value}
259
+ <div class={`${prefixedClassName.value}-grid-content`}>
260
+ {loading.value ? <Spin /> : slots.default ? <div>
261
+ <div class={`${prefixedClassName.value}-children-content ${childrenFullHeight.value ? 'children-full-height' : ''} ${hashId.value}`} style={{
262
+ ...(props.contentStyle || {})
263
+ }}>
264
+ {slots.default()}
265
+ </div>
266
+ {value.hasFooterToolbar && <div style={{
267
+ height: 48,
268
+ marginTop: 24
269
+ }} />}
270
+ </div> : null}
271
+ </div>
272
+ </div>}
273
+ </>;
274
+ };
275
+ }
276
+ });
277
+ export default withInstall(PageContainer);