@ccs-ui/rc-pro 2.3.6-alpha-17 → 2.3.6-alpha-19

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,19 +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);
71
- console.log('themeConfig', themeConfig);
72
+ var _ref3 = themeConfig || {},
73
+ token = _ref3.token,
74
+ components = _ref3.components,
75
+ otherThemeConfig = _objectWithoutProperties(_ref3, _excluded2);
76
+
77
+ // 主题算法
72
78
  var algorithm = function algorithm() {
73
79
  var algorithms = theme === 'dark' ? [antTheme.darkAlgorithm] : [antTheme.defaultAlgorithm];
74
80
  if (isCompact) {
@@ -77,21 +83,19 @@ function AppConfig(_ref) {
77
83
  return algorithms;
78
84
  };
79
85
  useEffect(function () {
80
- var prefix = _typeof(cssVar) === 'object' ? cssVar.prefix : 'ant';
81
- console.log('prefix', prefix);
82
- 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;} "), ".ccs-pl .".concat(prefix, "-table-title {padding:0} ")];
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 !important;} ")];
83
87
  insertCss(csss.join(''));
84
88
  }, []);
85
- useEffect(function () {}, []);
86
89
 
87
90
  // 合并token
88
91
  var newToken = _objectSpread(_objectSpread({}, appTheme.token), token);
89
92
  // 暗黑模式背景色
90
93
  if (theme === 'dark') newToken.colorBgContainer = 'rgb(36, 37, 37)';
91
- return /*#__PURE__*/_jsx(ConfigProvider, {
94
+ return /*#__PURE__*/_jsx(ConfigProvider, _objectSpread(_objectSpread({
92
95
  locale: zhCN,
93
- theme: _objectSpread(_objectSpread(_objectSpread({}, appTheme), otherConfig), {}, {
94
- cssVar: cssVar,
96
+ prefixCls: prefixCls
97
+ }, otherAntConfig), {}, {
98
+ theme: _objectSpread(_objectSpread(_objectSpread({}, appTheme), otherThemeConfig), {}, {
95
99
  token: newToken,
96
100
  components: _objectSpread(_objectSpread({}, appTheme.components), components),
97
101
  algorithm: algorithm()
@@ -99,7 +103,6 @@ function AppConfig(_ref) {
99
103
  children: /*#__PURE__*/_jsxs(AppConfigContext.Provider, {
100
104
  value: {
101
105
  theme: theme,
102
- themeConfig: themeConfig,
103
106
  dialogHolderRef: dialogHolderRef,
104
107
  fieldNames: fieldNames
105
108
  },
@@ -111,7 +114,7 @@ function AppConfig(_ref) {
111
114
  zIndex: 105
112
115
  })]
113
116
  })
114
- });
117
+ }));
115
118
  }
116
119
  export default function CssAppConfig(props) {
117
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-alpha-17",
3
+ "version": "2.3.6-alpha-19",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {