@ccs-ui/rc-pro 1.1.1-rc8 → 1.1.2

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 (63) hide show
  1. package/es/auth/auth-button.js +2 -3
  2. package/es/auth/auth-dropdown.js +16 -12
  3. package/es/auth/index.d.ts +2 -12
  4. package/es/auth/index.js +3 -5
  5. package/es/cascader/index.d.ts +3 -3
  6. package/es/cascader/index.js +3 -3
  7. package/es/ccs.d.ts +207 -25
  8. package/es/ccs.js +1 -79
  9. package/es/color-picker/index.js +30 -26
  10. package/es/context/index.d.ts +5 -5
  11. package/es/date-picker/index.js +9 -3
  12. package/es/dialog/HookDrawer.js +24 -8
  13. package/es/dialog/HookModal.d.ts +4 -0
  14. package/es/dialog/HookModal.js +93 -29
  15. package/es/dialog/button.d.ts +6 -2
  16. package/es/dialog/button.js +45 -13
  17. package/es/dialog/context.d.ts +8 -2
  18. package/es/dialog/drawer-footer.d.ts +12 -0
  19. package/es/dialog/drawer-footer.js +62 -0
  20. package/es/dialog/form.d.ts +7 -4
  21. package/es/dialog/form.js +9 -2
  22. package/es/dialog/hook.d.ts +9 -2
  23. package/es/dialog/hook.js +16 -4
  24. package/es/dialog/index.d.ts +9 -2
  25. package/es/dialog/index.js +4 -1
  26. package/es/dialog/index.less +12 -15
  27. package/es/hooks/use-global.d.ts +1 -1
  28. package/es/index.d.ts +3 -133
  29. package/es/index.js +4 -4
  30. package/es/interval-button/index.js +12 -6
  31. package/es/keep-alive-tabs/index.d.ts +4 -3
  32. package/es/keep-alive-tabs/index.js +5 -10
  33. package/es/keep-alive-tabs/page.d.ts +2 -2
  34. package/es/keep-alive-tabs/page.js +20 -16
  35. package/es/pro-grid/index.d.ts +0 -1
  36. package/es/pro-grid/index.js +51 -39
  37. package/es/pro-table/index.d.ts +11 -57
  38. package/es/pro-table/index.js +13 -13
  39. package/es/pro-table/index.less +17 -9
  40. package/es/pro-table/search.d.ts +5 -2
  41. package/es/pro-table/search.js +32 -9
  42. package/es/pro-table/tree.d.ts +5 -5
  43. package/es/pro-table/tree.js +1 -2
  44. package/es/pro-tabs/index.d.ts +0 -1
  45. package/es/pro-tabs/index.js +25 -8
  46. package/es/select/index.d.ts +3 -3
  47. package/es/select/index.js +3 -3
  48. package/es/theme-dialog.d.ts +24 -0
  49. package/es/theme-dialog.js +70 -0
  50. package/es/theme.d.ts +17 -0
  51. package/es/theme.js +66 -0
  52. package/es/time-picker/index.js +10 -4
  53. package/es/trigger/index.d.ts +0 -12
  54. package/es/trigger/index.js +78 -68
  55. package/es/upload/index.js +16 -7
  56. package/es/utils/index.d.ts +0 -15
  57. package/es/utils/index.js +3 -47
  58. package/es/virtual-list/index.js +34 -29
  59. package/es/water-mark/index.js +20 -17
  60. package/package.json +3 -1
  61. package/es/drawer.zip +0 -0
  62. package/es/modal.zip +0 -0
  63. package/es/pro-tabs/index.less +0 -5
package/es/theme.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { ThemeConfig } from 'antd';
2
+ import { ReactElement } from 'react';
3
+ import { GlobalConfig } from './ccs';
4
+ interface AppThemeProps {
5
+ theme: GlobalConfig['AppTheme'];
6
+ themeConfig?: ThemeConfig;
7
+ children: ReactElement;
8
+ }
9
+ /** 主题设置 */
10
+ interface AppThemeProps {
11
+ theme: GlobalConfig['AppTheme'];
12
+ themeConfig?: ThemeConfig;
13
+ children: ReactElement;
14
+ }
15
+ /** 主题设置 */
16
+ export default function AppTheme({ theme, themeConfig, children, }: AppThemeProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
package/es/theme.js ADDED
@@ -0,0 +1,66 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { darkTheme, defaultTheme } from '@ant-design/compatible';
14
+ import { App, ConfigProvider, Modal, message, notification } from 'antd';
15
+ import zhCN from 'antd/locale/zh_CN';
16
+ import { useEffect } from 'react';
17
+ import ThemeDialog from "./theme-dialog";
18
+
19
+ /** 主题设置 */
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ /** 主题设置 */
23
+ export default function AppTheme(_ref) {
24
+ var theme = _ref.theme,
25
+ themeConfig = _ref.themeConfig,
26
+ children = _ref.children;
27
+ var _message$useMessage = message.useMessage(),
28
+ _message$useMessage2 = _slicedToArray(_message$useMessage, 2),
29
+ messageApi = _message$useMessage2[0],
30
+ contextMsgHolder = _message$useMessage2[1];
31
+ var _notification$useNoti = notification.useNotification(),
32
+ _notification$useNoti2 = _slicedToArray(_notification$useNoti, 2),
33
+ noticeApi = _notification$useNoti2[0],
34
+ contextNotifHolder = _notification$useNoti2[1];
35
+ var _Modal$useModal = Modal.useModal(),
36
+ _Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
37
+ modalApi = _Modal$useModal2[0],
38
+ contextModalHolder = _Modal$useModal2[1];
39
+ useEffect(function () {
40
+ ThemeDialog.setConfig(messageApi, noticeApi, modalApi);
41
+ }, []);
42
+
43
+ // 主题
44
+ var appTheme = theme === 'default' ? defaultTheme : darkTheme;
45
+
46
+ // 合并token
47
+ var token = _objectSpread(_objectSpread(_objectSpread({}, appTheme.token), themeConfig === null || themeConfig === void 0 ? void 0 : themeConfig.token), {}, {
48
+ _appTheme: theme
49
+ });
50
+
51
+ // 暗黑模式背景色
52
+ if (theme === 'dark') token.colorBgContainer = 'rgb(36, 37, 37)';
53
+ return /*#__PURE__*/_jsx(ConfigProvider, {
54
+ locale: zhCN,
55
+ theme: _objectSpread(_objectSpread({}, appTheme), {}, {
56
+ token: token,
57
+ components: _objectSpread(_objectSpread({}, appTheme.components), themeConfig === null || themeConfig === void 0 ? void 0 : themeConfig.components)
58
+ }),
59
+ children: /*#__PURE__*/_jsxs(App, {
60
+ style: {
61
+ height: '100%'
62
+ },
63
+ children: [children, contextMsgHolder, contextNotifHolder, contextModalHolder]
64
+ })
65
+ });
66
+ }
@@ -1,6 +1,11 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  var _excluded = ["value", "onChange"],
2
3
  _excluded2 = ["value", "onChange"];
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
10
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -13,7 +18,8 @@ import { TimePicker } from 'antd';
13
18
  import dayjs from 'dayjs';
14
19
  import customParseFormat from 'dayjs/plugin/customParseFormat';
15
20
  import _isArray from 'lodash/isArray';
16
- import React, { useState } from 'react';
21
+ import { useState } from 'react';
22
+ import { jsx as _jsx } from "react/jsx-runtime";
17
23
  dayjs.extend(customParseFormat);
18
24
  function CcsDatePicker(_ref) {
19
25
  var value = _ref.value,
@@ -31,7 +37,7 @@ function CcsDatePicker(_ref) {
31
37
  setDateValue(date || undefined);
32
38
  if (onChange) onChange(dateString);
33
39
  };
34
- return /*#__PURE__*/React.createElement(TimePicker, _extends({
40
+ return /*#__PURE__*/_jsx(TimePicker, _objectSpread({
35
41
  value: dateValue,
36
42
  onChange: handleOnChange
37
43
  }, restProps));
@@ -52,7 +58,7 @@ function RangePicker(_ref2) {
52
58
  setDateValue(date);
53
59
  if (onChange) onChange(dateString);
54
60
  };
55
- return /*#__PURE__*/React.createElement(TimePicker.RangePicker, _extends({
61
+ return /*#__PURE__*/_jsx(TimePicker.RangePicker, _objectSpread({
56
62
  value: dateValue,
57
63
  onChange: handleOnChange
58
64
  }, restProps));
@@ -1,18 +1,6 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
2
  import { SizeType } from 'antd/es/config-provider/SizeContext';
3
3
  import './index.less';
4
- export interface CcsTriggerChildrenProps<T = any> {
5
- /** 选中值 */
6
- value?: T;
7
- /** 选择框loading状态 */
8
- onLoading?: (loading: boolean) => void;
9
- /** 关闭弹框 */
10
- onVisible?: (visible: boolean) => void;
11
- /** 选中值改变事件 */
12
- onChange?: ({}: T) => void;
13
- /** 选择框显示名称 */
14
- onChangeLabel?: (text: string | undefined) => void;
15
- }
16
4
  export interface CcsTriggerProps {
17
5
  /** 下拉框宽度 */
18
6
  width?: number;
@@ -15,13 +15,16 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
15
15
  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; }
16
16
  import { ConfigProvider, Input, Spin } from 'antd';
17
17
  import Trigger from 'rc-trigger';
18
- import React, { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
18
+ import { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
19
19
  // import _isPlainObject from 'lodash/isPlainObject';
20
20
  import { CloseCircleFilled, DownOutlined } from '@ant-design/icons';
21
21
  import { useDebounceFn, useEventListener, useUpdate } from 'ahooks';
22
22
  import zhCN from 'antd/locale/zh_CN';
23
23
  import _isNil from 'lodash/isNil';
24
24
  import "./index.less";
25
+ import { jsx as _jsx } from "react/jsx-runtime";
26
+ import { Fragment as _Fragment } from "react/jsx-runtime";
27
+ import { jsxs as _jsxs } from "react/jsx-runtime";
25
28
  var zIndex = 2000;
26
29
  var classPrefix = 'ccs-trigger';
27
30
 
@@ -216,73 +219,80 @@ var TriggerComponent = function TriggerComponent(props) {
216
219
  if (forceRender) return true;
217
220
  return !!value;
218
221
  }, []);
219
- return /*#__PURE__*/React.createElement(ConfigProvider, {
220
- locale: zhCN
221
- }, /*#__PURE__*/React.createElement(Trigger, {
222
- mask: true,
223
- action: ['click'],
224
- forceRender: isForceRender,
225
- prefixCls: classPrefix,
226
- popup: /*#__PURE__*/React.createElement("div", {
227
- className: "".concat(classPrefix, "-container"),
228
- ref: containerRef,
229
- style: {
230
- width: ppWidth || 'auto',
231
- minWidth: (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.clientWidth,
232
- maxHeight: ppHeight || maxHeight,
233
- maxWidth: maxWidth
234
- }
235
- }, children && /*#__PURE__*/cloneElement(children, _objectSpread({
236
- value: value,
237
- onChange: onChange,
238
- onChangeLabel: onChangeLabel,
239
- onVisible: setVisible,
240
- onLoading: setLoading,
241
- width: ppWidth,
242
- height: ppHeight
243
- }, restProps))),
244
- popupVisible: visible,
245
- onPopupVisibleChange: function onPopupVisibleChange(e) {
246
- if (!disabled) setVisible(e);
247
- },
248
- showAction: ['click'],
249
- hideAction: ['click'],
250
- popupAlign: alignRef.current,
251
- popupStyle: {
252
- position: 'absolute'
253
- },
254
- getPopupContainer: popupContainer ? function () {
255
- return ref.current;
256
- } : undefined,
257
- zIndex: triggerIndex
258
- }, /*#__PURE__*/React.createElement("div", {
259
- ref: ref,
260
- className: className,
261
- style: style,
262
- onMouseEnter: onMouseEnter,
263
- onMouseLeave: onMouseLeave
264
- }, /*#__PURE__*/React.createElement(Spin, {
265
- spinning: loading
266
- }, /*#__PURE__*/React.createElement(Input, {
267
- readOnly: true,
268
- disabled: disabled,
269
- value: inputRef.current,
270
- placeholder: placeholder || '请选择',
271
- size: size || 'middle',
272
- suffix: !disabled ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CloseCircleFilled, {
273
- ref: closeRef,
274
- onClick: function onClick() {
275
- if (onChange) {
276
- onChange(undefined);
277
- onChangeLabel(undefined);
278
- onMouseLeave();
279
- }
222
+ return /*#__PURE__*/_jsx(ConfigProvider, {
223
+ locale: zhCN,
224
+ children: /*#__PURE__*/_jsx(Trigger, {
225
+ mask: true,
226
+ action: ['click'],
227
+ forceRender: isForceRender,
228
+ prefixCls: classPrefix,
229
+ popup: /*#__PURE__*/_jsx("div", {
230
+ className: "".concat(classPrefix, "-container"),
231
+ ref: containerRef,
232
+ style: {
233
+ width: ppWidth || 'auto',
234
+ minWidth: (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.clientWidth,
235
+ maxHeight: ppHeight || maxHeight,
236
+ maxWidth: maxWidth
237
+ },
238
+ children: children && /*#__PURE__*/cloneElement(children, _objectSpread({
239
+ value: value,
240
+ onChange: onChange,
241
+ onChangeLabel: onChangeLabel,
242
+ onVisible: setVisible,
243
+ onLoading: setLoading,
244
+ width: ppWidth,
245
+ height: ppHeight
246
+ }, restProps))
247
+ }),
248
+ popupVisible: visible,
249
+ onPopupVisibleChange: function onPopupVisibleChange(e) {
250
+ if (!disabled) setVisible(e);
280
251
  },
281
- className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-hidden")
282
- }), /*#__PURE__*/React.createElement(DownOutlined, {
283
- className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-show"),
284
- ref: downRef
285
- })) : null
286
- })))));
252
+ showAction: ['click'],
253
+ hideAction: ['click'],
254
+ popupAlign: alignRef.current,
255
+ popupStyle: {
256
+ position: 'absolute'
257
+ },
258
+ getPopupContainer: popupContainer ? function () {
259
+ return ref.current;
260
+ } : undefined,
261
+ zIndex: triggerIndex,
262
+ children: /*#__PURE__*/_jsx("div", {
263
+ ref: ref,
264
+ className: className,
265
+ style: style,
266
+ onMouseEnter: onMouseEnter,
267
+ onMouseLeave: onMouseLeave,
268
+ children: /*#__PURE__*/_jsx(Spin, {
269
+ spinning: loading,
270
+ children: /*#__PURE__*/_jsx(Input, {
271
+ readOnly: true,
272
+ disabled: disabled,
273
+ value: inputRef.current,
274
+ placeholder: placeholder || '请选择',
275
+ size: size || 'middle',
276
+ suffix: !disabled ? /*#__PURE__*/_jsxs(_Fragment, {
277
+ children: [/*#__PURE__*/_jsx(CloseCircleFilled, {
278
+ ref: closeRef,
279
+ onClick: function onClick() {
280
+ if (onChange) {
281
+ onChange(undefined);
282
+ onChangeLabel(undefined);
283
+ onMouseLeave();
284
+ }
285
+ },
286
+ className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-hidden")
287
+ }), /*#__PURE__*/_jsx(DownOutlined, {
288
+ className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-show"),
289
+ ref: downRef
290
+ })]
291
+ }) : null
292
+ })
293
+ })
294
+ })
295
+ })
296
+ });
287
297
  };
288
298
  export default TriggerComponent;
@@ -1,5 +1,10 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  var _excluded = ["tokenKey", "uploadText", "maxCount", "maxFileSize", "onChange"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
10
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -10,8 +15,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
15
  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
16
  import { UploadOutlined } from '@ant-design/icons';
12
17
  import { Button, Upload, message } from 'antd';
13
- import React, { useState } from 'react';
18
+ import { useState } from 'react';
14
19
  import { ImageUpload } from "./upload-image";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
15
21
  function CcsUpload(_ref) {
16
22
  var tokenKey = _ref.tokenKey,
17
23
  uploadText = _ref.uploadText,
@@ -58,15 +64,18 @@ function CcsUpload(_ref) {
58
64
  token: tokenKey ? sessionStorage.getItem(tokenKey) : ''
59
65
  }
60
66
  };
61
- return /*#__PURE__*/React.createElement(Upload, _extends({}, uploadProps, {
67
+ return /*#__PURE__*/_jsx(Upload, _objectSpread(_objectSpread(_objectSpread({}, uploadProps), {}, {
62
68
  onChange: handleOnChange,
63
69
  beforeUpload: beforeUpload,
64
70
  fileList: files,
65
71
  maxCount: maxCount
66
- }, otherProps), /*#__PURE__*/React.createElement(Button, {
67
- icon: /*#__PURE__*/React.createElement(UploadOutlined, null),
68
- disabled: files.length >= maxCount
69
- }, uploadText));
72
+ }, otherProps), {}, {
73
+ children: /*#__PURE__*/_jsx(Button, {
74
+ icon: /*#__PURE__*/_jsx(UploadOutlined, {}),
75
+ disabled: files.length >= maxCount,
76
+ children: uploadText
77
+ })
78
+ }));
70
79
  }
71
80
  CcsUpload.Image = ImageUpload;
72
81
  export default CcsUpload;
@@ -1,5 +1,4 @@
1
1
  import dayjs from 'dayjs';
2
- import { HttpResult } from '..';
3
2
  interface DayjsType extends dayjs.Dayjs {
4
3
  fromNow(withoutSuffix?: boolean): string;
5
4
  from(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
@@ -83,13 +82,6 @@ export default class utils {
83
82
  * @param {*} str
84
83
  */
85
84
  static stringToHex(str: string): string;
86
- /**
87
- * 根据HttpResult返回结果提示成功或失败
88
- * @param result
89
- * @param successText
90
- * @param failText
91
- */
92
- static messageInfo(result: HttpResult, successText?: string, failText?: string): void;
93
85
  /**
94
86
  * string to dayjs
95
87
  * @param val
@@ -97,13 +89,6 @@ export default class utils {
97
89
  * @returns
98
90
  */
99
91
  static dayjsFmt(val: string | undefined, formartType?: string): dayjs.Dayjs | undefined;
100
- /**
101
- * 确认提示框
102
- * @param title
103
- * @param content
104
- * @returns
105
- */
106
- static showConfirm: (title: string, content?: string) => Promise<unknown>;
107
92
  /**
108
93
  * 空对象?
109
94
  * @param obj
package/es/utils/index.js CHANGED
@@ -5,7 +5,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- import { message, Modal } from 'antd';
9
8
  import _dayjs from 'dayjs';
10
9
  import zhCn from 'dayjs/locale/zh-cn';
11
10
  import relativeTime from 'dayjs/plugin/relativeTime';
@@ -15,7 +14,6 @@ import _isArray from 'lodash/isArray';
15
14
  import _empty from 'lodash/isEmpty';
16
15
  import _isObject from 'lodash/isObject';
17
16
  import devWarning from 'rc-util/lib/warning';
18
- var confirm = Modal.confirm;
19
17
  _dayjs.locale(zhCn);
20
18
  _dayjs.extend(relativeTime);
21
19
  var utils = /*#__PURE__*/function () {
@@ -176,22 +174,6 @@ var utils = /*#__PURE__*/function () {
176
174
  return hexCharCode.join('').toUpperCase();
177
175
  }
178
176
 
179
- /**
180
- * 根据HttpResult返回结果提示成功或失败
181
- * @param result
182
- * @param successText
183
- * @param failText
184
- */
185
- }, {
186
- key: "messageInfo",
187
- value: function messageInfo(result, successText, failText) {
188
- if (result.success) {
189
- message.success(successText || '操作成功');
190
- } else {
191
- message.error(failText || result.msg || '操作失败');
192
- }
193
- }
194
-
195
177
  /**
196
178
  * string to dayjs
197
179
  * @param val
@@ -208,21 +190,14 @@ var utils = /*#__PURE__*/function () {
208
190
  return _dayjs(val);
209
191
  }
210
192
 
211
- /**
212
- * 确认提示框
213
- * @param title
214
- * @param content
215
- * @returns
216
- */
217
- }, {
218
- key: "objIsEmpty",
219
- value:
220
193
  /**
221
194
  * 空对象?
222
195
  * @param obj
223
196
  * @returns
224
197
  */
225
- function objIsEmpty(obj) {
198
+ }, {
199
+ key: "objIsEmpty",
200
+ value: function objIsEmpty(obj) {
226
201
  if (!obj) return true;
227
202
  return Object.keys(obj).length === 0;
228
203
  }
@@ -261,23 +236,4 @@ _defineProperty(utils, "isEmpty", function (val) {
261
236
  _defineProperty(utils, "isNotEmpty", function (val) {
262
237
  return !utils.isEmpty(val);
263
238
  });
264
- _defineProperty(utils, "showConfirm", function (title) {
265
- var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
266
- return new Promise(function (resolve) {
267
- confirm({
268
- title: title,
269
- content: content,
270
- okText: '确定',
271
- okType: 'danger',
272
- cancelText: '取消',
273
- centered: true,
274
- onOk: function onOk() {
275
- resolve(true);
276
- },
277
- onCancel: function onCancel() {
278
- resolve(false);
279
- }
280
- });
281
- });
282
- });
283
239
  export { utils as default };
@@ -11,8 +11,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { useScroll } from 'ahooks';
14
- import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
14
+ import { useEffect, useImperativeHandle, useRef, useState } from 'react';
15
15
  import { Scrollbars } from 'react-custom-scrollbars';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
16
18
  function getArrayIdsNew(start, end) {
17
19
  var ids = [];
18
20
  for (var i = start; i <= end; i += 1) {
@@ -24,17 +26,18 @@ var VirtualListItem = function VirtualListItem(_ref) {
24
26
  var rowHeight = _ref.rowHeight,
25
27
  rowRenderer = _ref.rowRenderer,
26
28
  index = _ref.index;
27
- return /*#__PURE__*/React.createElement("div", {
29
+ return /*#__PURE__*/_jsx("div", {
28
30
  style: {
29
31
  height: rowHeight,
30
32
  position: 'absolute',
31
33
  top: index * rowHeight,
32
34
  width: '100%'
33
- }
34
- }, rowRenderer({
35
- rowHeight: rowHeight,
36
- index: index
37
- }));
35
+ },
36
+ children: rowRenderer({
37
+ rowHeight: rowHeight,
38
+ index: index
39
+ })
40
+ });
38
41
  };
39
42
  var VirtualList = function VirtualList(_ref2) {
40
43
  var height = _ref2.height,
@@ -95,31 +98,33 @@ var VirtualList = function VirtualList(_ref2) {
95
98
  });
96
99
  }
97
100
  }, [rowCount]);
98
- return rowCount === 0 ? /*#__PURE__*/React.createElement(React.Fragment, null) : /*#__PURE__*/React.createElement("div", {
101
+ return rowCount === 0 ? /*#__PURE__*/_jsx(_Fragment, {}) : /*#__PURE__*/_jsx("div", {
99
102
  className: className,
100
103
  style: _objectSpread({
101
104
  height: height || '100%'
102
105
  }, style),
103
- ref: ref
104
- }, /*#__PURE__*/React.createElement(Scrollbars, {
105
- autoHide: autoHideScroll !== false,
106
- onUpdate: onScrollUpdate,
107
- style: {
108
- flex: '1 1 auto'
109
- }
110
- }, /*#__PURE__*/React.createElement("div", {
111
- style: {
112
- position: 'relative',
113
- height: rowHeight * rowCount,
114
- overflow: 'hidden'
115
- }
116
- }, getArrayIdsNew(ids[0], ids[1] >= rowCount ? rowCount - 1 : ids[1]).map(function (i) {
117
- return /*#__PURE__*/React.createElement(VirtualListItem, {
118
- rowHeight: rowHeight,
119
- rowRenderer: rowRenderer,
120
- key: i,
121
- index: i
122
- });
123
- }))));
106
+ ref: ref,
107
+ children: /*#__PURE__*/_jsx(Scrollbars, {
108
+ autoHide: autoHideScroll !== false,
109
+ onUpdate: onScrollUpdate,
110
+ style: {
111
+ flex: '1 1 auto'
112
+ },
113
+ children: /*#__PURE__*/_jsx("div", {
114
+ style: {
115
+ position: 'relative',
116
+ height: rowHeight * rowCount,
117
+ overflow: 'hidden'
118
+ },
119
+ children: getArrayIdsNew(ids[0], ids[1] >= rowCount ? rowCount - 1 : ids[1]).map(function (i) {
120
+ return /*#__PURE__*/_jsx(VirtualListItem, {
121
+ rowHeight: rowHeight,
122
+ rowRenderer: rowRenderer,
123
+ index: i
124
+ }, i);
125
+ })
126
+ })
127
+ })
128
+ });
124
129
  };
125
130
  export default VirtualList;
@@ -13,6 +13,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { ConfigProvider } from 'antd';
14
14
  import classNames from 'classnames';
15
15
  import React, { useContext, useEffect, useState } from 'react';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
16
18
  /**
17
19
  * 返回当前显示设备的物理像素分辨率与CSS像素分辨率之比
18
20
  *
@@ -111,25 +113,26 @@ var WaterMarkComponent = function WaterMarkComponent(props) {
111
113
  console.error('当前环境不支持Canvas');
112
114
  }
113
115
  }, [gapX, gapY, offsetLeft, offsetTop, rotate, fontStyle, fontWeight, width, height, fontFamily, fontColor, image, content, fontSize]);
114
- return /*#__PURE__*/React.createElement("div", {
116
+ return /*#__PURE__*/_jsxs("div", {
115
117
  style: _objectSpread({
116
118
  position: 'relative'
117
119
  }, style),
118
- className: wrapperCls
119
- }, children, base64Url && /*#__PURE__*/React.createElement("div", {
120
- className: waterMakrCls,
121
- style: _objectSpread({
122
- zIndex: zIndex,
123
- position: 'absolute',
124
- left: 0,
125
- top: 0,
126
- width: '100%',
127
- height: '100%',
128
- backgroundSize: "".concat(gapX + width, "px"),
129
- pointerEvents: 'none',
130
- backgroundRepeat: 'repeat',
131
- backgroundImage: "url('".concat(base64Url, "')")
132
- }, markStyle)
133
- }));
120
+ className: wrapperCls,
121
+ children: [children, base64Url && /*#__PURE__*/_jsx("div", {
122
+ className: waterMakrCls,
123
+ style: _objectSpread({
124
+ zIndex: zIndex,
125
+ position: 'absolute',
126
+ left: 0,
127
+ top: 0,
128
+ width: '100%',
129
+ height: '100%',
130
+ backgroundSize: "".concat(gapX + width, "px"),
131
+ pointerEvents: 'none',
132
+ backgroundRepeat: 'repeat',
133
+ backgroundImage: "url('".concat(base64Url, "')")
134
+ }, markStyle)
135
+ })]
136
+ });
134
137
  };
135
138
  export default WaterMarkComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.1-rc8",
3
+ "version": "1.1.2",
4
4
  "description": "A react pro components",
5
5
  "license": "MIT",
6
6
  "module": "es/index.js",
@@ -47,7 +47,9 @@
47
47
  ]
48
48
  },
49
49
  "dependencies": {
50
+ "@ant-design/compatible": "^5.1.2",
50
51
  "@ant-design/icons": "^5.1.4",
52
+ "@ccs-ui/rc-pro": "1.1.1-rc34",
51
53
  "ahooks": "^3.7.7",
52
54
  "antd": "^5.11.0",
53
55
  "antd-img-crop": "^4.12.2",