@ccs-ui/rc-pro 2.3.6-alpha-11 → 2.3.6-alpha-13

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.
@@ -3,16 +3,16 @@
3
3
  -webkit-user-drag: none;
4
4
  }
5
5
 
6
- .ant-modal-content {
7
- padding: 0;
8
- }
6
+ // .ant-modal-content {
7
+ // padding: 0;
8
+ // }
9
9
 
10
- .ant-modal-close {
11
- top: 0;
12
- right: 0;
13
- width: 20px;
14
- height: 20px;
15
- }
10
+ // .ant-modal-close {
11
+ // top: 0;
12
+ // right: 0;
13
+ // width: 20px;
14
+ // height: 20px;
15
+ // }
16
16
 
17
17
  .ccs-aj-slider-img {
18
18
  top: 0;
@@ -29,20 +29,6 @@
29
29
  justify-content: space-between;
30
30
  margin-top: 5px;
31
31
  align-items: center;
32
-
33
- .ant-btn {
34
- color: #6d6c6c;
35
-
36
- &:first-child {
37
- flex: 0 0 auto;
38
- margin-right: 5px;
39
- }
40
-
41
- &:last-child {
42
- flex: 0 0 auto;
43
- margin-left: 5px;
44
- }
45
- }
46
32
  }
47
33
 
48
34
  .ccs-aj-error {
@@ -16,7 +16,7 @@ export type DialogButtonsProps<T> = Pick<CcsDialogModalProps, 'okText' | 'onClos
16
16
  export type DialogButtonRef = {
17
17
  onSetButtons: (e: React.ReactElement) => void;
18
18
  };
19
- export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "request" | "onClose" | "onOk" | "auth" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
19
+ export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "onOk" | "onClose" | "auth" | "extraBtn" | "request" | "requestFieldNames" | "preventRequestHandle"> & {
20
20
  formRef: React.RefObject<DialogFormRef<TParams>>;
21
21
  formInitialValues: FormProps['initialValues'];
22
22
  buttonRef: RefObject<DialogButtonRef>;
@@ -14,7 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
14
14
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  import { CcsButton } from "./..";
17
- import { Button, Form } from 'antd';
17
+ import { Button, Form, Space } from 'antd';
18
18
  import React, { useEffect, useImperativeHandle, useState } from 'react';
19
19
  import CcsDialog from '.';
20
20
  import { useDialogFields } from "../hooks/use-app";
@@ -231,7 +231,7 @@ export default function CcsDialogButtons(_ref3) {
231
231
  useEffect(function () {
232
232
  var _buttonRef$current;
233
233
  if (!onOk && !children) return;
234
- var btns = /*#__PURE__*/_jsxs(_Fragment, {
234
+ var btns = /*#__PURE__*/_jsxs(Space, {
235
235
  children: [children, onOk && /*#__PURE__*/_jsxs(_Fragment, {
236
236
  children: [!hideCancel && /*#__PURE__*/_jsx(Button, {
237
237
  onClick: closeDialog,
@@ -1,16 +0,0 @@
1
- .ant-drawer-extra {
2
- .ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
3
- margin-bottom: 0;
4
- margin-inline-start: 8px;
5
- }
6
- }
7
-
8
- .ant-drawer-footer {
9
- overflow: hidden;
10
- }
11
-
12
- .ccs-dialog-drawer {
13
- .ant-drawer-footer {
14
- padding: 0;
15
- }
16
- }
@@ -1,28 +1,14 @@
1
- import { useIsomorphicLayoutEffect, useMemoizedFn } from 'ahooks';
1
+ import { useDebounceEffect, useMemoizedFn, useSize } from 'ahooks';
2
2
  import { useRef } from 'react';
3
3
  export function useResizeEffect(effect, targetRef) {
4
- var ref = useRef(0);
5
4
  var fn = useMemoizedFn(effect);
6
- useIsomorphicLayoutEffect(function () {
7
- var target = targetRef.current;
8
- if (!target) return;
9
- if (window.ResizeObserver) {
10
- var animationFrame;
11
- var observer = new ResizeObserver(function () {
12
- // 隐藏了,为0不处理
13
- if (target.clientWidth === 0 || (target === null || target === void 0 ? void 0 : target.clientWidth) === ref.current) return;
14
- animationFrame = window.requestAnimationFrame(function () {
15
- return fn(target);
16
- });
17
- ref.current = target === null || target === void 0 ? void 0 : target.clientWidth;
18
- });
19
- observer.observe(target);
20
- return function () {
21
- window.cancelAnimationFrame(animationFrame);
22
- observer.disconnect();
23
- };
24
- } else {
25
- fn(target);
26
- }
27
- }, [targetRef]);
5
+ var widthRef = useRef();
6
+ var size = useSize(targetRef);
7
+ useDebounceEffect(function () {
8
+ if ((size === null || size === void 0 ? void 0 : size.width) === 0 || (size === null || size === void 0 ? void 0 : size.width) === widthRef.current) return;
9
+ fn(targetRef.current);
10
+ widthRef.current = size === null || size === void 0 ? void 0 : size.width;
11
+ }, [size === null || size === void 0 ? void 0 : size.width], {
12
+ wait: 500
13
+ });
28
14
  }
@@ -96,7 +96,7 @@ export default function useTableSelection(props) {
96
96
  return (_ref2 = newValue || []) === null || _ref2 === void 0 ? void 0 : _ref2.includes(row[keyField]);
97
97
  });
98
98
  selectionRef.current = {
99
- selectedRowKeys: newValue,
99
+ selectedRowKeys: newValue === undefined && isMultiple ? [] : newValue,
100
100
  selectedRows: rows,
101
101
  info: {
102
102
  type: 'none'
@@ -17,13 +17,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
17
17
  import { MoreOutlined } from '@ant-design/icons';
18
18
  import CcsUtils from '@ccs-ui/utils';
19
19
  import { useUpdate, useUpdateEffect } from 'ahooks';
20
- import { Button, Dropdown, Empty, Tabs } from 'antd';
20
+ import { Button, Dropdown, Tabs } from 'antd';
21
+ import { ConfigContext } from 'antd/es/config-provider';
21
22
  import classnames from 'classnames';
22
23
  import updateHelper from 'immutability-helper';
23
- import { useMemo, useRef } from 'react';
24
+ import { insertCss } from 'insert-css';
25
+ import { useContext, useEffect, useMemo, useRef } from 'react';
24
26
  import { useLocation } from 'react-router';
25
27
  import { useOutlet } from 'react-router-dom';
26
- import { useAppConfig } from '..';
28
+ import { CcsResult, useAppConfig } from '..';
27
29
  import "./index.less";
28
30
  import Page from "./page";
29
31
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -135,6 +137,7 @@ function KeepAliveTabs(_ref) {
135
137
  var routers = useRef([]);
136
138
  var location = useLocation();
137
139
  var pathname = location.pathname;
140
+ var config = useContext(ConfigContext);
138
141
  var outlet = useOutlet();
139
142
  var update = useUpdate();
140
143
  var _useAppConfig = useAppConfig(),
@@ -146,6 +149,11 @@ function KeepAliveTabs(_ref) {
146
149
  if (routers.current.length >= maxLen) {
147
150
  routers.current = routers.current.slice(1);
148
151
  }
152
+ useEffect(function () {
153
+ var prefix = config.getPrefixCls();
154
+ var csss = [".ccs-keep-alive-nav .".concat(prefix, "-tabs-tab {border: 0 !important;border-radius: 0 !important;}"), ".ccs-keep-alive-nav .".concat(prefix, "-tabs-tab-active {background-color: #f0f2f5 !important;}"), ".ccs-keep-alive .dark .ccs-keep-alive-nav .".concat(prefix, "-tabs-tab-active {background-color: #2b2c2c !important;} ")];
155
+ insertCss(csss.join(''));
156
+ }, []);
149
157
 
150
158
  // 菜单改变,更新用户权限信息
151
159
  useUpdateEffect(function () {
@@ -262,18 +270,19 @@ function KeepAliveTabs(_ref) {
262
270
  btnAuth = _ref3$btnAuth === void 0 ? [] : _ref3$btnAuth,
263
271
  _ref3$breadcrumb = _ref3.breadcrumb,
264
272
  breadcrumb = _ref3$breadcrumb === void 0 ? [] : _ref3$breadcrumb;
273
+ var isMenu = curMenu.key !== undefined;
265
274
  routers.current = updateHelper(routers.current, {
266
275
  $push: [{
267
276
  key: location.key,
268
277
  timestamp: new Date().getTime(),
269
278
  label: (curMenu === null || curMenu === void 0 ? void 0 : curMenu.label) || '未知',
270
- outlet: curMenu ? outlet : /*#__PURE__*/_jsx(Empty, {
271
- description: "\u672A\u77E5\u9875\u9762"
279
+ outlet: isMenu ? outlet : /*#__PURE__*/_jsx(CcsResult.Page404, {
280
+ title: "\u672A\u77E5\u9875\u9762"
272
281
  }),
273
282
  urlAuthList: btnAuth.map(function (b) {
274
283
  return b.code;
275
284
  }),
276
- breadcrumb: breadcrumb,
285
+ breadcrumb: isMenu ? breadcrumb : [],
277
286
  pageLocation: location
278
287
  }]
279
288
  });
@@ -354,6 +363,7 @@ function KeepAliveTabs(_ref) {
354
363
  type: "text"
355
364
  })
356
365
  });
366
+ console.log('routers', routers);
357
367
  return /*#__PURE__*/_jsxs("div", {
358
368
  className: classnames(className, "ccs-keep-alive"),
359
369
  children: [/*#__PURE__*/_jsx(Tabs, {
@@ -368,7 +378,15 @@ function KeepAliveTabs(_ref) {
368
378
  return onDestroy(e);
369
379
  },
370
380
  items: routers.current,
371
- tabBarExtraContent: routers.current.length > 2 ? tabBarExtraContent : null
381
+ tabBarExtraContent: routers.current.length > 2 ? tabBarExtraContent : null,
382
+ tabBarStyle: {
383
+ margin: 0
384
+ },
385
+ renderTabBar: function renderTabBar(props, DefaultTabBar) {
386
+ return /*#__PURE__*/_jsx(DefaultTabBar, _objectSpread(_objectSpread({}, props), {}, {
387
+ className: "ccs-keep-alive-nav"
388
+ }));
389
+ }
372
390
  }), routers.current.map(function (_ref4) {
373
391
  var key = _ref4.key,
374
392
  urlAuthList = _ref4.urlAuthList,
@@ -1,3 +1,14 @@
1
+ // .ccs-keep-alive-nav .ant-tabs-tab {
2
+ // border: 0 !important;
3
+ // border-radius: 0 !important;
4
+ // }
5
+ // .ccs-keep-alive-nav .ant-tabs-tab-active {
6
+ // background-color: #f0f2f5 !important;
7
+ // }
8
+ // .ccs-keep-alive .dark .ccs-keep-alive-nav .ant-tabs-tab-active {
9
+ // background-color: #2b2c2c !important;
10
+ // }
11
+
1
12
  .ccs-keep-alive {
2
13
  flex: 1 1 auto;
3
14
  display: flex;
@@ -33,51 +44,30 @@
33
44
  }
34
45
  }
35
46
 
47
+ &-nav {
48
+ margin: 0;
49
+
50
+ &::before {
51
+ border-bottom: 0 !important;
52
+ }
53
+ }
36
54
  &-tabs {
37
55
  background-color: #fff;
38
56
  border-bottom: 1px solid #f1f2f5;
39
57
 
40
- &.dark {
41
- background-color: rgb(37, 37, 37);
42
- border-bottom: 0;
58
+ .ccs-tab-item {
59
+ flex: 1 1 auto;
60
+ position: relative;
43
61
  }
44
62
 
45
- & > .ant-tabs-nav {
46
- margin: 0;
47
-
48
- &::before {
49
- border-bottom: 0;
50
- }
51
-
52
- .ant-tabs-tab {
53
- border: 0;
54
- border-radius: 0 !important;
55
- }
56
-
57
- .ant-tabs-tab-active {
58
- background-color: #f0f2f5;
59
- }
63
+ .ccs-sticky-scroll > div {
64
+ padding: 10px 16px 16px;
65
+ flex-direction: column;
66
+ display: none;
60
67
  }
61
68
 
62
- &.dark > .ant-tabs-nav {
63
- .ant-tabs-tab-active {
64
- background-color: #2b2c2c;
65
- }
69
+ .ccs-sticky-scroll.route-avtive > div {
70
+ display: flex;
66
71
  }
67
72
  }
68
-
69
- .ccs-tab-item {
70
- flex: 1 1 auto;
71
- position: relative;
72
- }
73
-
74
- .ccs-sticky-scroll > div {
75
- padding: 10px 16px 16px;
76
- flex-direction: column;
77
- display: none;
78
- }
79
-
80
- .ccs-sticky-scroll.route-avtive > div {
81
- display: flex;
82
- }
83
73
  }
@@ -2,7 +2,7 @@ import { TableSticky } from 'rc-table/lib/interface';
2
2
  import React, { ReactNode } from 'react';
3
3
  import CCS from '..';
4
4
  import { ShowDependType, TableStickyProps } from './table';
5
- declare const onTableInModalOrDrawer: (node: any) => TableStickyProps;
5
+ declare const onTableInModalOrDrawer: (node: any, classPrefix: string) => TableStickyProps;
6
6
  declare const onTableInTabItem: (node: any) => boolean | TableSticky;
7
7
  declare const getDataById: (data: any[], rowKey: string, id: React.Key) => any;
8
8
  declare const getAllChildrenId: (data: any[], rowKey: string) => string[];
@@ -1,13 +1,13 @@
1
1
  import _isArray from 'lodash.isarray';
2
2
  import React from 'react';
3
3
  // 判断组件所处dom
4
- var onTableInModalOrDrawer = function onTableInModalOrDrawer(node) {
4
+ var onTableInModalOrDrawer = function onTableInModalOrDrawer(node, classPrefix) {
5
5
  var _parent$classList, _parent$classList2, _parent$classList3, _parent$classList4, _parent$classList5;
6
6
  var parent = node.parentNode;
7
7
  if (!parent) return false;
8
8
  if (
9
9
  // 通过指定dom吸顶
10
- (_parent$classList = parent.classList) !== null && _parent$classList !== void 0 && _parent$classList.contains('ccs-trigger-container') || (_parent$classList2 = parent.classList) !== null && _parent$classList2 !== void 0 && _parent$classList2.contains('ccs-drawer-content') || (_parent$classList3 = parent.classList) !== null && _parent$classList3 !== void 0 && _parent$classList3.contains('ant-drawer-body')) {
10
+ (_parent$classList = parent.classList) !== null && _parent$classList !== void 0 && _parent$classList.contains('ccs-trigger-container') || (_parent$classList2 = parent.classList) !== null && _parent$classList2 !== void 0 && _parent$classList2.contains('ccs-drawer-content') || (_parent$classList3 = parent.classList) !== null && _parent$classList3 !== void 0 && _parent$classList3.contains("".concat(classPrefix, "-drawer-body"))) {
11
11
  return {
12
12
  getContainer: function getContainer() {
13
13
  return parent;
@@ -17,13 +17,13 @@ var onTableInModalOrDrawer = function onTableInModalOrDrawer(node) {
17
17
  }
18
18
 
19
19
  // 在弹出框中吸顶top
20
- if ((_parent$classList4 = parent.classList) !== null && _parent$classList4 !== void 0 && _parent$classList4.contains('ant-modal') || (_parent$classList5 = parent.classList) !== null && _parent$classList5 !== void 0 && _parent$classList5.contains('ant-drawer')) {
20
+ if ((_parent$classList4 = parent.classList) !== null && _parent$classList4 !== void 0 && _parent$classList4.contains("".concat(classPrefix, "-modal")) || (_parent$classList5 = parent.classList) !== null && _parent$classList5 !== void 0 && _parent$classList5.contains("".concat(classPrefix, "-drawer"))) {
21
21
  return {
22
22
  offsetHeader: 0,
23
23
  isInDialog: true
24
24
  };
25
25
  }
26
- return onTableInModalOrDrawer(parent);
26
+ return onTableInModalOrDrawer(parent, classPrefix);
27
27
  };
28
28
  var onTableInTabItem = function onTableInTabItem(node) {
29
29
  var _parent$classList6;
@@ -20,7 +20,7 @@ export default function HeadFormItem(_ref) {
20
20
  formItemLabelWidth = _ref.formItemLabelWidth;
21
21
  var props = {
22
22
  rules: rules,
23
- className: "".concat(classPrefix, "-form-label"),
23
+ className: "".concat(classPrefix, "-form-item"),
24
24
  label: formItemLabelWidth ? /*#__PURE__*/_jsx("div", {
25
25
  style: {
26
26
  width: formItemLabelWidth
@@ -28,19 +28,16 @@
28
28
  z-index: 9999;
29
29
  }
30
30
 
31
+ .ccs-table-pagination {
32
+ margin: 0 !important;
33
+ padding: 12px 16px;
34
+ text-align: right;
35
+ }
31
36
  .ccs-pl {
32
37
  flex: auto;
33
38
  display: flex;
34
39
  flex-direction: column;
35
40
 
36
- .ant-pagination {
37
- margin: 0 !important;
38
- }
39
-
40
- &-tradition-toolbar {
41
- padding: 10px 16px;
42
- }
43
-
44
41
  &-icon {
45
42
  // color: rgb(0 0 0 / 75%);
46
43
  font-size: 16;
@@ -49,17 +46,6 @@
49
46
  &-table-content {
50
47
  position: relative;
51
48
  flex: auto;
52
-
53
- .ant-table-title {
54
- padding: 0 !important;
55
- }
56
- }
57
-
58
- &-adaptation {
59
- .ant-form-item {
60
- // margin-bottom: 0;
61
- margin-inline-end: 0;
62
- }
63
49
  }
64
50
 
65
51
  &-form-collapse {
@@ -78,7 +64,6 @@
78
64
 
79
65
  &-adaptation-form {
80
66
  flex: 1 1 auto;
81
-
82
67
  overflow: hidden;
83
68
 
84
69
  &::-webkit-scrollbar {
@@ -86,163 +71,12 @@
86
71
  }
87
72
  }
88
73
 
89
- .ant-form-item {
90
- margin-bottom: 10px;
91
- }
92
-
93
- &-form {
94
- flex: 0 1 auto;
95
- overflow: hidden;
96
- display: flex;
97
- flex-direction: row;
98
- align-items: flex-end;
99
- // justify-content: space-between;
100
- // flex-wrap: wrap;
101
- gap: 8px;
102
-
103
- .ant-form-item {
104
- flex: 0 1 auto;
105
- }
106
-
107
- .ant-row {
108
- flex-wrap: nowrap;
109
- }
110
-
111
- .ant-form-item .ant-form-item-label {
112
- padding: 0;
113
- }
114
-
115
- label {
116
- white-space: nowrap;
117
- }
118
-
119
- .ant-form-item-label {
120
- flex: 0 0 auto !important;
121
- }
122
-
123
- .ant-form-item-control {
124
- flex: 0 1 auto !important;
125
- }
126
-
127
- .ant-form-inline {
128
- flex-wrap: nowrap;
129
- align-items: flex-end;
130
- justify-content: end;
131
- overflow: hidden;
132
-
133
- .ant-form-item:last-child {
134
- margin-inline-end: 0;
135
- }
136
- }
137
- }
138
-
139
- .ant-form-item-control {
140
- line-height: 0;
141
- }
142
-
143
- .ant-input-number {
144
- width: 100%;
145
- }
146
-
147
- .ant-picker {
148
- width: 100%;
149
- }
150
-
151
- .ant-drawer-right.ant-drawer-open {
152
- width: 100%;
153
- transition: none;
154
- }
155
-
156
- .ant-drawer.ant-drawer-open .ant-drawer-mask {
157
- animation: none;
158
- }
159
-
160
- &-form-label {
161
- .ant-col-24.ant-form-item-label {
162
- padding: 0;
163
- }
74
+ &-form-item {
75
+ margin-bottom: 10px !important;
76
+ margin-inline-end: 0 !important;
164
77
  }
165
78
 
166
79
  &-toolbar {
167
80
  flex: 0 0 auto;
168
81
  }
169
-
170
- &-header {
171
- display: flex;
172
- gap: 10px;
173
- justify-content: space-between;
174
- align-items: center;
175
- // background-color: #fff;
176
- width: 100%;
177
-
178
- .ant-form-item-explain {
179
- position: absolute;
180
- bottom: -20px;
181
- z-index: 101;
182
- height: 0;
183
- overflow: hidden;
184
- white-space: nowrap;
185
- }
186
-
187
- &-buttons {
188
- // margin-left: 6px;
189
- white-space: nowrap;
190
- }
191
- }
192
-
193
- .ant-table-wrapper .ant-table > .ant-table-container {
194
- border-inline-start: 0;
195
- border-top: 0;
196
-
197
- & > .ant-table-header > table > thead > tr {
198
- & > th:last-child {
199
- border-inline-end: 0;
200
- border-start-start-radius: 0;
201
- border-start-end-radius: 0;
202
- }
203
-
204
- & > th:first-child {
205
- border-start-start-radius: 0;
206
- }
207
- }
208
-
209
- & > .ant-table-body > table > tbody > tr > td:last-child {
210
- border-inline-end: 0;
211
- }
212
- }
213
-
214
- .ant-table-wrapper table {
215
- border-radius: 0;
216
- }
217
-
218
- .ant-table-wrapper .ant-table .ant-table-header {
219
- border-radius: 0;
220
- }
221
- }
222
-
223
- // modal drawer ccs-pl 中取消table content padding
224
- .ant-modal-body,
225
- .ant-drawer-body,
226
- .ccs-trigger-container,
227
- .ccs-pg-col {
228
- .ccs-pl-table-content {
229
- margin: 0;
230
- }
231
- }
232
-
233
- .colorful-theme {
234
- .ccs-pl-toolbar,
235
- .ccs-pl-form {
236
- .ant-btn-sm {
237
- border-radius: 12px;
238
- }
239
-
240
- .ant-btn {
241
- border-radius: 16px;
242
- }
243
-
244
- .ant-btn-lg {
245
- border-radius: 20px;
246
- }
247
- }
248
82
  }
@@ -19,9 +19,10 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
  import { useUpdateEffect } from 'ahooks';
21
21
  import { theme as antTheme, Card, Empty } from 'antd';
22
+ import { ConfigContext } from 'antd/es/config-provider';
22
23
  import classNames from 'classnames';
23
24
  import _debounce from 'lodash.debounce';
24
- import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
25
+ import React, { useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
25
26
  import { CcsResizeObserver, useAppConfig, useCcsPage } from '..';
26
27
  import { useProTableFields } from "../hooks/use-app";
27
28
  import { getDataByNamePath } from "../select";
@@ -89,6 +90,7 @@ var InternalProTable = function InternalProTable(props) {
89
90
  onEvent = props.onEvent;
90
91
  var _useCcsPage = useCcsPage(),
91
92
  onAuth = _useCcsPage.onAuth;
93
+ var config = useContext(ConfigContext);
92
94
  var _ref = table || {},
93
95
  pagination = _ref.pagination,
94
96
  _ref$requestParam = _ref.requestParam,
@@ -386,7 +388,7 @@ var InternalProTable = function InternalProTable(props) {
386
388
  };
387
389
  useEffect(function () {
388
390
  // 判断是否在弹出框中
389
- var inMd = onTableInModalOrDrawer(tableContentRef.current);
391
+ var inMd = onTableInModalOrDrawer(tableContentRef.current, config.getPrefixCls());
390
392
  if (inMd) {
391
393
  stickyRef.current = inMd;
392
394
  // 弹框中行尺寸默认设置为small
@@ -90,9 +90,6 @@ function InternalSelect(_ref) {
90
90
  }, [options]);
91
91
  return /*#__PURE__*/_jsx(Select, _objectSpread({
92
92
  options: selectOptions,
93
- style: {
94
- width: '100%'
95
- },
96
93
  filterOption: onFilterOption,
97
94
  placeholder: "\u8BF7\u9009\u62E9",
98
95
  allowClear: true,
package/es/table/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["onResize", "width"],
2
- _excluded2 = ["data", "style", "scroll", "rowKey", "columns", "tableRef", "pagination", "rowSelection", "className", "tableContentRef"];
2
+ _excluded2 = ["data", "style", "scroll", "rowKey", "columns", "tableRef", "pagination", "rowSelection", "tableContentRef"];
3
3
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -10,8 +10,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
11
  import { useDebounceFn, useUpdate } from 'ahooks';
12
12
  import { Table, theme } from 'antd';
13
- import classNames from 'classnames';
14
- import { useEffect, useImperativeHandle } from 'react';
13
+ import { ConfigContext } from 'antd/es/config-provider';
14
+ import { useContext, useEffect, useImperativeHandle } from 'react';
15
15
  import { Resizable } from 'react-resizable';
16
16
  import CcsEllipsis2 from "../ellipsis";
17
17
  import useTabs from "../hooks/use-tabs";
@@ -50,8 +50,6 @@ var CustomTable = function CustomTable(props) {
50
50
  tableRef = props.tableRef,
51
51
  pagination = props.pagination,
52
52
  rowSelection = props.rowSelection,
53
- _props$className = props.className,
54
- className = _props$className === void 0 ? '' : _props$className,
55
53
  tableContentRef = props.tableContentRef,
56
54
  restProps = _objectWithoutProperties(props, _excluded2);
57
55
  var update = useUpdate();
@@ -65,6 +63,7 @@ var CustomTable = function CustomTable(props) {
65
63
  _ref$total = _ref.total,
66
64
  total = _ref$total === void 0 ? 0 : _ref$total;
67
65
  var inTabs = useTabs();
66
+ var config = useContext(ConfigContext);
68
67
 
69
68
  // table 固定表头,内容滚动
70
69
  var _useDebounceFn = useDebounceFn(function () {
@@ -83,15 +82,16 @@ var CustomTable = function CustomTable(props) {
83
82
 
84
83
  // 容器最大高度
85
84
  var maxHeight = (_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 ? void 0 : _tableContentRef$curr.clientHeight;
85
+ var prefixCls = config.getPrefixCls();
86
86
 
87
87
  // 计算所有dom高度
88
- var tableEle = tableTarget.getElementsByClassName('ant-table')[0];
88
+ var tableEle = tableTarget.getElementsByClassName("".concat(prefixCls, "-table"))[0];
89
89
  var childHeights = [];
90
90
  var antTablebody = undefined;
91
91
  tableEle.childNodes.forEach(function (e) {
92
- if (e.classList.contains('ant-table-container')) {
92
+ if (e.classList.contains("".concat(prefixCls, "-table-container"))) {
93
93
  e.childNodes.forEach(function (node) {
94
- if (node.classList.contains('ant-table-body')) {
94
+ if (node.classList.contains("".concat(prefixCls, "-table-body"))) {
95
95
  antTablebody = node;
96
96
  } else {
97
97
  childHeights.push(node.clientHeight || 0);
@@ -103,7 +103,7 @@ var CustomTable = function CustomTable(props) {
103
103
  });
104
104
 
105
105
  // 分页高度
106
- var pagination = tableTarget.getElementsByClassName('ant-pagination');
106
+ var pagination = tableTarget.getElementsByClassName("".concat(prefixCls, "-pagination"));
107
107
  if (pagination && pagination.length > 0) {
108
108
  childHeights.push(pagination[0].clientHeight);
109
109
  }
@@ -124,9 +124,6 @@ var CustomTable = function CustomTable(props) {
124
124
  onFixedThead();
125
125
  }, [total]);
126
126
 
127
- // 监听窗口变化
128
- // useEventListener('resize', onFixedThead, { target: window });
129
-
130
127
  // 监听列筛选事件
131
128
  useImperativeHandle(tableRef, function () {
132
129
  return {
@@ -216,6 +213,7 @@ var CustomTable = function CustomTable(props) {
216
213
  children: /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
217
214
  rowKey: rowKey || tableRowKey,
218
215
  dataSource: dataSource,
216
+ sortDirections: ['ascend', 'descend'],
219
217
  pagination: pagination === false ? false : _objectSpread({
220
218
  total: total,
221
219
  pageSize: pageSize,
@@ -227,7 +225,8 @@ var CustomTable = function CustomTable(props) {
227
225
  },
228
226
  pageSizeOptions: ['10', '20', '30', '50', '100'],
229
227
  size: restProps.size === 'small' ? 'small' : 'default',
230
- simple: restProps.size === 'small'
228
+ simple: restProps.size === 'small',
229
+ className: 'ccs-table-pagination'
231
230
  }, pagination),
232
231
  rowSelection: rowSelection ? _objectSpread(_objectSpread({}, rowSelection), {}, {
233
232
  columnWidth: 60
@@ -240,7 +239,6 @@ var CustomTable = function CustomTable(props) {
240
239
  }
241
240
  }, restProps), {}, {
242
241
  size: restProps.size || 'middle',
243
- className: classNames(_defineProperty(_defineProperty(_defineProperty({}, 'ccs-table-nodata', !dataSource || dataSource.length === 0), 'ccs-table-wrapper', !rowSelection), "className", className)),
244
242
  scroll: scroll,
245
243
  summary: restProps !== null && restProps !== void 0 && restProps.summary ? function (e) {
246
244
  var _restProps$summary;
@@ -1,106 +1,5 @@
1
1
  .ccs-table {
2
2
  &-card {
3
- .ccs-table-wrapper {
4
- .ant-table-middle,
5
- .ant-table-small {
6
- .ant-table-tbody > tr > td:first-child {
7
- padding-left: 16px !important;
8
- }
9
-
10
- .ant-table-thead > tr > th:first-child {
11
- padding-left: 16px !important;
12
- }
13
- }
14
- }
15
-
16
- .ant-table-container {
17
- padding: 0 1px;
18
- }
19
-
20
- .ant-table-middle
21
- > .ant-table-content
22
- > .ant-table-body
23
- > table
24
- > .ant-table-tbody
25
- > tr
26
- > td,
27
- .ant-table-middle
28
- > .ant-table-content
29
- > .ant-table-body
30
- > table
31
- > .ant-table-thead
32
- > tr
33
- > th,
34
- .ant-table-middle
35
- > .ant-table-content
36
- > .ant-table-scroll
37
- > .ant-table-body
38
- > table
39
- > .ant-table-tbody
40
- > tr
41
- > td,
42
- .ant-table-middle
43
- > .ant-table-content
44
- > .ant-table-scroll
45
- > .ant-table-body
46
- > table
47
- > .ant-table-thead
48
- > tr
49
- > th,
50
- .ant-table-content
51
- > .ant-table-fixed-right
52
- > .ant-table-body-outer
53
- > .ant-table-body-inner
54
- > table
55
- > .ant-table-tbody
56
- > tr
57
- > td,
58
- .ant-table-middle
59
- > .ant-table-content
60
- > .ant-table-scroll
61
- > .ant-table-header
62
- > table
63
- > .ant-table-thead
64
- > tr
65
- > th,
66
- .ant-table-middle
67
- > .ant-table-content
68
- > .ant-table-fixed-right
69
- > .ant-table-header
70
- > table
71
- > .ant-table-thead
72
- > tr
73
- > th,
74
- .ant-table-middle
75
- > .ant-table-content
76
- > .ant-table-fixed-right
77
- > .ant-table-body-outer
78
- > .ant-table-body-inner
79
- > table
80
- > .ant-table-thead
81
- > tr
82
- > th {
83
- padding: 8px;
84
- }
85
-
86
- .ant-pagination {
87
- margin: 0;
88
- padding: 16px;
89
- text-align: right;
90
- }
91
-
92
- .ant-table-cell {
93
- .ant-btn-link {
94
- height: auto;
95
- padding: 0;
96
- line-height: initial;
97
- }
98
- }
99
-
100
- .ant-table-sticky-holder {
101
- z-index: 100;
102
- }
103
-
104
3
  .react-resizable {
105
4
  position: relative;
106
5
  background-clip: padding-box;
@@ -116,39 +15,11 @@
116
15
  cursor: col-resize;
117
16
  }
118
17
  }
119
-
120
- &-nodata {
121
- color: red;
122
-
123
- .ant-table-content {
124
- overflow: hidden !important;
125
- }
126
-
127
- .ant-table-body {
128
- overflow: hidden !important;
129
- }
130
- }
131
18
  }
132
19
 
133
20
  .ccs-tabs-auto-height {
134
21
  flex: 1 1 auto;
135
22
  overflow: hidden;
136
-
137
- > .ant-tabs-content-holder {
138
- height: 100%;
139
-
140
- > .ant-tabs-content {
141
- height: 100%;
142
-
143
- > div {
144
- height: 100%;
145
-
146
- > .ccs-pl {
147
- height: 100%;
148
- }
149
- }
150
- }
151
- }
152
23
  }
153
24
 
154
25
  .ccs-table-ellipsis {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-alpha-11",
3
+ "version": "2.3.6-alpha-13",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -62,6 +62,7 @@
62
62
  "@uiw/react-codemirror": "^4.23.0",
63
63
  "antd-img-crop": "^4.12.2",
64
64
  "immutability-helper": "^3.1.1",
65
+ "insert-css": "^2.0.0",
65
66
  "lodash.clonedeep": "^4.5.0",
66
67
  "lodash.debounce": "^4.0.8",
67
68
  "lodash.isarray": "^4.0.0",
@@ -80,6 +81,7 @@
80
81
  "@ccs-ui/utils": "^0.1.3",
81
82
  "@commitlint/cli": "^17.1.2",
82
83
  "@commitlint/config-conventional": "^17.1.0",
84
+ "@types/insert-css": "^2.0.3",
83
85
  "@types/lodash.clonedeep": "^4.5.9",
84
86
  "@types/lodash.debounce": "^4.0.9",
85
87
  "@types/lodash.isarray": "^4.0.9",