@ccs-ui/rc-pro 2.3.6-alpha-16 → 2.3.6-alpha-18

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/config.js CHANGED
@@ -1,10 +1,11 @@
1
- var _excluded = ["token", "cssVar", "components"];
1
+ 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); }
2
+ var _excluded = ["theme", "prefixCls"],
3
+ _excluded2 = ["token", "components"];
2
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; }
3
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; }
4
6
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
8
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- 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); }
8
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
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; }
10
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -56,18 +57,24 @@ function AppConfig(_ref) {
56
57
  theme = _ref$theme === void 0 ? 'light' : _ref$theme,
57
58
  isCompact = _ref.isCompact,
58
59
  watermark = _ref.watermark,
59
- themeConfig = _ref.themeConfig,
60
+ antConfig = _ref.antConfig,
60
61
  fieldNames = _ref.fieldNames;
61
62
  var dialogHolderRef = React.useRef(null);
62
63
  // 主题
63
64
  var appTheme = theme === 'dark' ? darkTheme : defaultTheme;
65
+ var _ref2 = antConfig || {},
66
+ themeConfig = _ref2.theme,
67
+ _ref2$prefixCls = _ref2.prefixCls,
68
+ prefixCls = _ref2$prefixCls === void 0 ? 'ant' : _ref2$prefixCls,
69
+ otherAntConfig = _objectWithoutProperties(_ref2, _excluded);
64
70
 
65
71
  // 传入的配置参数
66
- var _ref2 = themeConfig || {},
67
- token = _ref2.token,
68
- cssVar = _ref2.cssVar,
69
- components = _ref2.components,
70
- otherConfig = _objectWithoutProperties(_ref2, _excluded);
72
+ var _ref3 = themeConfig || {},
73
+ token = _ref3.token,
74
+ components = _ref3.components,
75
+ otherThemeConfig = _objectWithoutProperties(_ref3, _excluded2);
76
+
77
+ // 主题算法
71
78
  var algorithm = function algorithm() {
72
79
  var algorithms = theme === 'dark' ? [antTheme.darkAlgorithm] : [antTheme.defaultAlgorithm];
73
80
  if (isCompact) {
@@ -76,20 +83,19 @@ function AppConfig(_ref) {
76
83
  return algorithms;
77
84
  };
78
85
  useEffect(function () {
79
- var prefix = _typeof(cssVar) === 'object' ? cssVar.prefix : 'ant';
80
- var csss = [".ccs-tabs-auto-height > .ant-tabs-content-holder,\n .ccs-tabs-auto-height > .ant-tabs-content-holder > .ant-tabs-content,\n .ccs-tabs-auto-height > .ant-tabs-content-holder > .ant-tabs-content > div,\n .ccs-tabs-auto-height> .ant-tabs-content-holder> .ant-tabs-content> div> .ccs-pl { height: 100%;}", ".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;} ")];
86
+ var csss = [".ccs-tabs-auto-height > .".concat(prefixCls, "-tabs-content-holder,\n .ccs-tabs-auto-height > .").concat(prefixCls, "-tabs-content-holder > .").concat(prefixCls, "-tabs-content,\n .ccs-tabs-auto-height > .").concat(prefixCls, "-tabs-content-holder > .").concat(prefixCls, "-tabs-content > div,\n .ccs-tabs-auto-height> .").concat(prefixCls, "-tabs-content-holder> .").concat(prefixCls, "-tabs-content> div> .ccs-pl { height: 100%;}"), ".ccs-keep-alive-nav .".concat(prefixCls, "-tabs-tab {border: 0 !important;border-radius: 0 !important;}"), ".ccs-keep-alive-nav .".concat(prefixCls, "-tabs-tab-active {background-color: #f0f2f5 !important;}"), ".ccs-keep-alive .dark .ccs-keep-alive-nav .".concat(prefixCls, "-tabs-tab-active {background-color: #2b2c2c !important;} "), ".ccs-pl .".concat(prefixCls, "-table-title {padding:0} ")];
81
87
  insertCss(csss.join(''));
82
88
  }, []);
83
- useEffect(function () {}, []);
84
89
 
85
90
  // 合并token
86
91
  var newToken = _objectSpread(_objectSpread({}, appTheme.token), token);
87
92
  // 暗黑模式背景色
88
93
  if (theme === 'dark') newToken.colorBgContainer = 'rgb(36, 37, 37)';
89
- return /*#__PURE__*/_jsx(ConfigProvider, {
94
+ return /*#__PURE__*/_jsx(ConfigProvider, _objectSpread(_objectSpread({
90
95
  locale: zhCN,
91
- theme: _objectSpread(_objectSpread(_objectSpread({}, appTheme), otherConfig), {}, {
92
- cssVar: cssVar,
96
+ prefixCls: prefixCls
97
+ }, otherAntConfig), {}, {
98
+ theme: _objectSpread(_objectSpread(_objectSpread({}, appTheme), otherThemeConfig), {}, {
93
99
  token: newToken,
94
100
  components: _objectSpread(_objectSpread({}, appTheme.components), components),
95
101
  algorithm: algorithm()
@@ -97,7 +103,6 @@ function AppConfig(_ref) {
97
103
  children: /*#__PURE__*/_jsxs(AppConfigContext.Provider, {
98
104
  value: {
99
105
  theme: theme,
100
- themeConfig: themeConfig,
101
106
  dialogHolderRef: dialogHolderRef,
102
107
  fieldNames: fieldNames
103
108
  },
@@ -109,7 +114,7 @@ function AppConfig(_ref) {
109
114
  zIndex: 105
110
115
  })]
111
116
  })
112
- });
117
+ }));
113
118
  }
114
119
  export default function CssAppConfig(props) {
115
120
  return /*#__PURE__*/_jsx(App, {
@@ -1,4 +1,4 @@
1
- import { TabPaneProps, ThemeConfig } from 'antd';
1
+ import { ConfigProviderProps, TabPaneProps } from 'antd';
2
2
  import { Store } from 'antd/es/form/interface';
3
3
  import React from 'react';
4
4
  import { Location } from 'react-router';
@@ -90,7 +90,7 @@ type CssAppConfigType = {
90
90
  /** 主题 */
91
91
  theme?: 'dark' | 'light' | 'colorful';
92
92
  /** 主题参数配置 */
93
- themeConfig?: ThemeConfig;
93
+ antConfig?: ConfigProviderProps;
94
94
  /** 紧凑模式 */
95
95
  isCompact?: boolean;
96
96
  /** 全局水印 */
@@ -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>, "auth" | "request" | "onClose" | "onOk" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
19
+ export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "auth" | "onClose" | "onOk" | "request" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
20
20
  formRef: React.RefObject<DialogFormRef<TParams>>;
21
21
  formInitialValues: FormProps['initialValues'];
22
22
  buttonRef: RefObject<DialogButtonRef>;
@@ -1,5 +1,5 @@
1
1
  import { TagProps } from 'antd';
2
- import React from 'react';
2
+ import React, { CSSProperties } from 'react';
3
3
  interface PropsType {
4
4
  data: any[];
5
5
  color?: TagProps['color'];
@@ -8,11 +8,13 @@ interface PropsType {
8
8
  label: string;
9
9
  };
10
10
  onClear: (key?: React.Key) => void;
11
+ style?: CSSProperties;
12
+ className?: string;
11
13
  }
12
14
  /**
13
15
  * 显示table行选中项
14
16
  * @param PropsType
15
17
  * @returns
16
18
  */
17
- export default function SelectionAlert({ data, color, fieldNames, onClear, }: PropsType): import("react/jsx-runtime").JSX.Element | undefined;
19
+ export default function SelectionAlert({ data, color, style, className, fieldNames, onClear, }: PropsType): import("react/jsx-runtime").JSX.Element | undefined;
18
20
  export {};
@@ -1,5 +1,11 @@
1
+ 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); }
2
+ 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; }
3
+ 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; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
7
  import { DeleteOutlined } from '@ant-design/icons';
2
- import { Button, Space, Tag } from 'antd';
8
+ import { Button, Space, Tag, theme } from 'antd';
3
9
  import React from 'react';
4
10
  import { jsx as _jsx } from "react/jsx-runtime";
5
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -11,18 +17,27 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
11
17
  export default function SelectionAlert(_ref) {
12
18
  var data = _ref.data,
13
19
  color = _ref.color,
20
+ style = _ref.style,
21
+ className = _ref.className,
14
22
  _ref$fieldNames = _ref.fieldNames,
15
23
  fieldNames = _ref$fieldNames === void 0 ? {
16
24
  key: 'key',
17
25
  label: 'label'
18
26
  } : _ref$fieldNames,
19
27
  onClear = _ref.onClear;
28
+ var _theme$useToken = theme.useToken(),
29
+ token = _theme$useToken.token;
20
30
  if (!data || data.length === 0) {
21
31
  return undefined;
22
32
  }
33
+ var px = "".concat(token.paddingSM, "px");
23
34
  return /*#__PURE__*/_jsxs(Space, {
24
35
  size: 4,
25
36
  wrap: true,
37
+ style: _objectSpread({
38
+ padding: "0 ".concat(px, " ").concat(px, " ").concat(px)
39
+ }, style),
40
+ className: className,
26
41
  children: [data.map(function () {
27
42
  var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28
43
  return /*#__PURE__*/_jsx(Tag, {
@@ -154,6 +154,8 @@ var InternalProTable = function InternalProTable(props) {
154
154
  theme = _useAppConfig.theme;
155
155
  // 接口字段指定全局配置
156
156
  var globalFieldNames = useProTableFields();
157
+ var _antTheme$useToken = antTheme.useToken(),
158
+ token = _antTheme$useToken.token;
157
159
 
158
160
  // 暗黑模式
159
161
  var isDark = theme === 'dark';
@@ -583,8 +585,6 @@ var InternalProTable = function InternalProTable(props) {
583
585
  onEvent: onEvent
584
586
  }));
585
587
  };
586
- var _antTheme$useToken = antTheme.useToken(),
587
- token = _antTheme$useToken.token;
588
588
  var rootStyle = styles.root || {};
589
589
  if (bordered) {
590
590
  rootStyle = _objectSpread({
@@ -632,7 +632,7 @@ var InternalProTable = function InternalProTable(props) {
632
632
  // 有查询条件
633
633
  var hasFormItem = formItems.length > 0;
634
634
  // 头部间距
635
- var tokenPadding = (table === null || table === void 0 ? void 0 : table.size) === 'small' ? token.paddingSM : token.padding;
635
+ var tokenPadding = tableRowSize === 'small' ? token.paddingSM : token.padding;
636
636
  return /*#__PURE__*/_jsxs(_Fragment, {
637
637
  children: [/*#__PURE__*/_jsx(CcsResizeObserver.Target, {
638
638
  targetRef: tableContentRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-alpha-16",
3
+ "version": "2.3.6-alpha-18",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {