@ccs-ui/rc-pro 1.1.0 → 1.1.1-rc2

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.
@@ -10,6 +10,9 @@ import { render as reactRender } from 'rc-util/lib/React/render';
10
10
  import React, { useEffect, useRef } from 'react';
11
11
  import { CcsAuth, useCcsWindow } from '..';
12
12
  import { FnContext } from "./open/content";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
16
  var onGetDrawerBodyDom = _memoize(function (dom) {
14
17
  var _parent$classList;
15
18
  var parent = dom === null || dom === void 0 ? void 0 : dom.parentNode;
@@ -44,21 +47,26 @@ export default function DrawerButton(_ref) {
44
47
  }
45
48
  onOk();
46
49
  };
47
- var renderDefaultButtom = /*#__PURE__*/React.createElement(React.Fragment, null, okAuth ? /*#__PURE__*/React.createElement(CcsAuth.Button, {
48
- type: "primary",
49
- onClick: onOkClick,
50
- loading: loading,
51
- auth: okAuth
52
- }, okText || '确定') : /*#__PURE__*/React.createElement(Button, {
53
- type: "primary",
54
- onClick: onOkClick,
55
- loading: loading
56
- }, okText || '确定'), /*#__PURE__*/React.createElement(Button, {
57
- style: {
58
- borderRadius: 3
59
- },
60
- onClick: close
61
- }, "\u53D6\u6D88"));
50
+ var renderDefaultButtom = /*#__PURE__*/_jsxs(_Fragment, {
51
+ children: [okAuth ? /*#__PURE__*/_jsx(CcsAuth.Button, {
52
+ type: "primary",
53
+ onClick: onOkClick,
54
+ loading: loading,
55
+ auth: okAuth,
56
+ children: okText || '确定'
57
+ }) : /*#__PURE__*/_jsx(Button, {
58
+ type: "primary",
59
+ onClick: onOkClick,
60
+ loading: loading,
61
+ children: okText || '确定'
62
+ }), /*#__PURE__*/_jsx(Button, {
63
+ style: {
64
+ borderRadius: 3
65
+ },
66
+ onClick: close,
67
+ children: "\u53D6\u6D88"
68
+ })]
69
+ });
62
70
  var timeoutId;
63
71
  var onRenderButton = function onRenderButton() {
64
72
  if (!onOk && !children) return;
@@ -72,11 +80,13 @@ export default function DrawerButton(_ref) {
72
80
  timeoutId = setTimeout(function () {
73
81
  if (drawerBody !== null && drawerBody !== void 0 && drawerBody.lastChild) {
74
82
  (drawerBody === null || drawerBody === void 0 ? void 0 : drawerBody.lastChild).classList.add('ccs-drawer-buttons');
75
- reactRender( /*#__PURE__*/React.createElement(FnContext, {
76
- locationKey: locationKey
77
- }, /*#__PURE__*/React.createElement(Space, {
78
- size: 16
79
- }, children, renderDefaultButtom)), drawerBody.lastChild);
83
+ reactRender( /*#__PURE__*/_jsx(FnContext, {
84
+ locationKey: locationKey,
85
+ children: /*#__PURE__*/_jsxs(Space, {
86
+ size: 16,
87
+ children: [children, renderDefaultButtom]
88
+ })
89
+ }), drawerBody.lastChild);
80
90
  }
81
91
  });
82
92
  };
@@ -84,7 +94,7 @@ export default function DrawerButton(_ref) {
84
94
  onRenderButton();
85
95
  }, []);
86
96
  onRenderButton();
87
- return /*#__PURE__*/React.createElement("div", {
97
+ return /*#__PURE__*/_jsx("div", {
88
98
  style: {
89
99
  display: 'none'
90
100
  },
@@ -3,23 +3,27 @@ import zhCN from 'antd/locale/zh_CN';
3
3
  import React from 'react';
4
4
  import { CCS, CcsConfigProvider } from "../..";
5
5
  import { DrawerAndModalContext, PageContext } from "../../context";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  export function FnContext(_ref) {
7
8
  var children = _ref.children,
8
9
  locationKey = _ref.locationKey;
9
10
  var config = CCS.setDefaultConfig(CCS.GlobalConfig);
10
- return /*#__PURE__*/React.createElement(ConfigProvider, {
11
+ return /*#__PURE__*/_jsx(ConfigProvider, {
11
12
  locale: zhCN,
12
- theme: config.theme
13
- }, /*#__PURE__*/React.createElement(CcsConfigProvider, {
14
- userDetail: {}
15
- }, /*#__PURE__*/React.createElement(PageContext.Provider, {
16
- value: {
17
- onAuth: function onAuth(e) {
18
- var _CCS$UrlAuth$location;
19
- return (_CCS$UrlAuth$location = CCS.UrlAuth[locationKey]) === null || _CCS$UrlAuth$location === void 0 ? void 0 : _CCS$UrlAuth$location.includes(e);
20
- }
21
- }
22
- }, children)));
13
+ theme: config.theme,
14
+ children: /*#__PURE__*/_jsx(CcsConfigProvider, {
15
+ userDetail: {},
16
+ children: /*#__PURE__*/_jsx(PageContext.Provider, {
17
+ value: {
18
+ onAuth: function onAuth(e) {
19
+ var _CCS$UrlAuth$location;
20
+ return (_CCS$UrlAuth$location = CCS.UrlAuth[locationKey]) === null || _CCS$UrlAuth$location === void 0 ? void 0 : _CCS$UrlAuth$location.includes(e);
21
+ }
22
+ },
23
+ children: children
24
+ })
25
+ })
26
+ });
23
27
  }
24
28
 
25
29
  /**
@@ -31,13 +35,15 @@ export default function FnContent(_ref2) {
31
35
  children = _ref2.children,
32
36
  locationKey = _ref2.locationKey,
33
37
  close = _ref2.close;
34
- return /*#__PURE__*/React.createElement(FnContext, {
35
- locationKey: locationKey
36
- }, /*#__PURE__*/React.createElement(DrawerAndModalContext.Provider, {
37
- value: {
38
- close: close,
39
- locationKey: locationKey,
40
- formInitialValues: (form === null || form === void 0 ? void 0 : form.initialValues) || {}
41
- }
42
- }, children));
38
+ return /*#__PURE__*/_jsx(FnContext, {
39
+ locationKey: locationKey,
40
+ children: /*#__PURE__*/_jsx(DrawerAndModalContext.Provider, {
41
+ value: {
42
+ close: close,
43
+ locationKey: locationKey,
44
+ formInitialValues: (form === null || form === void 0 ? void 0 : form.initialValues) || {}
45
+ },
46
+ children: children
47
+ })
48
+ });
43
49
  }
@@ -6,6 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { Form } from 'antd';
8
8
  import React from 'react';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
9
10
  /**
10
11
  * 添加form实例
11
12
  * @returns
@@ -19,7 +20,7 @@ export default function DrawerForm(_ref) {
19
20
  var _Form$useForm = Form.useForm(),
20
21
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
21
22
  form = _Form$useForm2[0];
22
- return /*#__PURE__*/React.createElement(Form, {
23
+ return /*#__PURE__*/_jsx(Form, {
23
24
  form: form,
24
25
  initialValues: initialValues,
25
26
  labelCol: labelCol || {
@@ -27,6 +28,7 @@ export default function DrawerForm(_ref) {
27
28
  },
28
29
  wrapperCol: wrapperCol || {
29
30
  span: 14
30
- }
31
- }, children);
31
+ },
32
+ children: children
33
+ });
32
34
  }
@@ -12,6 +12,9 @@ import React from 'react';
12
12
  import FnContent from "./content";
13
13
  import destroyDrawerFns from "./destory-fns";
14
14
  import DrawerForm from "./form";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { Fragment as _Fragment } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
18
  export default function DrawerFn(config) {
16
19
  var container = document.createDocumentFragment();
17
20
  var isDestroy = false;
@@ -55,30 +58,39 @@ export default function DrawerFn(config) {
55
58
  if (config.onClose) config.onClose(e);
56
59
  close();
57
60
  }
58
- var renderTitle = /*#__PURE__*/React.createElement("div", {
61
+ var renderTitle = /*#__PURE__*/_jsxs("div", {
59
62
  style: {
60
63
  display: 'flex',
61
64
  justifyContent: 'space-between'
62
- }
63
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
64
- icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
65
- type: "text",
66
- style: {
67
- color: '#9e9e9e',
68
- padding: 0
69
65
  },
70
- size: "small",
71
- onClick: function onClick() {
72
- return close && close();
73
- }
74
- }, config.closeText), /*#__PURE__*/React.createElement(Divider, {
75
- type: "vertical"
76
- }), title ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
77
- style: {
78
- fontWeight: 500,
79
- fontSize: 14
80
- }
81
- }, title)) : null), /*#__PURE__*/React.createElement("div", null, titleExtra));
66
+ children: [/*#__PURE__*/_jsxs("div", {
67
+ children: [/*#__PURE__*/_jsx(Button, {
68
+ icon: /*#__PURE__*/_jsx(LeftOutlined, {}),
69
+ type: "text",
70
+ style: {
71
+ color: '#9e9e9e',
72
+ padding: 0
73
+ },
74
+ size: "small",
75
+ onClick: function onClick() {
76
+ return close && close();
77
+ },
78
+ children: config.closeText
79
+ }), /*#__PURE__*/_jsx(Divider, {
80
+ type: "vertical"
81
+ }), title ? /*#__PURE__*/_jsx(_Fragment, {
82
+ children: /*#__PURE__*/_jsx("span", {
83
+ style: {
84
+ fontWeight: 500,
85
+ fontSize: 14
86
+ },
87
+ children: title
88
+ })
89
+ }) : null]
90
+ }), /*#__PURE__*/_jsx("div", {
91
+ children: titleExtra
92
+ })]
93
+ });
82
94
  var defaultConfig = {};
83
95
  // 默认抽屉加载到当前tab下面
84
96
  if (!('getContainer' in config)) {
@@ -117,7 +129,7 @@ export default function DrawerFn(config) {
117
129
  onClose: onDrawerClose,
118
130
  title: renderTitle,
119
131
  closable: false,
120
- footer: /*#__PURE__*/React.createElement(React.Fragment, null),
132
+ footer: /*#__PURE__*/_jsx(_Fragment, {}),
121
133
  footerStyle: _objectSpread({
122
134
  padding: 0
123
135
  }, footerStyle)
@@ -126,14 +138,16 @@ export default function DrawerFn(config) {
126
138
  function render(props) {
127
139
  clearTimeout(timeoutId);
128
140
  timeoutId = setTimeout(function () {
129
- var Rc = /*#__PURE__*/React.createElement(FnContent, {
141
+ var Rc = /*#__PURE__*/_jsx(FnContent, {
130
142
  form: config.form,
131
143
  close: onDrawerClose,
132
- locationKey: locationKey
133
- }, /*#__PURE__*/React.createElement(Drawer, props));
134
- reactRender(config.form ? /*#__PURE__*/React.createElement(DrawerForm, {
135
- formProps: config.form
136
- }, Rc) : Rc, container);
144
+ locationKey: locationKey,
145
+ children: /*#__PURE__*/_jsx(Drawer, _objectSpread({}, props))
146
+ });
147
+ reactRender(config.form ? /*#__PURE__*/_jsx(DrawerForm, {
148
+ formProps: config.form,
149
+ children: Rc
150
+ }) : Rc, container);
137
151
  });
138
152
  }
139
153
  function close(open) {
@@ -1,6 +1,10 @@
1
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
2
  var _excluded = ["num", "cacheKey", "disabledText", "children"];
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); }
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); }
4
8
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
10
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -16,6 +20,7 @@ import { useInterval } from 'ahooks';
16
20
  import { Button } from 'antd';
17
21
  import React, { useLayoutEffect, useMemo, useState } from 'react';
18
22
  import { CcsUtils } from "../";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
19
24
  /**
20
25
  * 倒计时按钮组件
21
26
  * @param PropsType
@@ -103,11 +108,12 @@ function IntervalButton(_ref) {
103
108
  });
104
109
  }
105
110
  };
106
- return count === -1 ? null : /*#__PURE__*/React.createElement(Button, _extends({
111
+ return count === -1 ? null : /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
107
112
  type: "primary"
108
- }, restProps, {
113
+ }, restProps), {}, {
109
114
  onClick: onStart,
110
- disabled: restProps.disabled ? true : disabled
111
- }), disabled ? "".concat(count, "\u79D2").concat(disabledText) : "".concat(children));
115
+ disabled: restProps.disabled ? true : disabled,
116
+ children: disabled ? "".concat(count, "\u79D2").concat(disabledText) : "".concat(children)
117
+ }));
112
118
  }
113
119
  export default IntervalButton;
@@ -20,6 +20,8 @@ import { useOutlet } from 'react-router-dom';
20
20
  import { CCS, CcsUtils } from "../";
21
21
  import "./index.less";
22
22
  import Page from "./page";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { jsxs as _jsxs } from "react/jsx-runtime";
23
25
  var extraItems = [{
24
26
  key: '1',
25
27
  label: '关闭其他标签'
@@ -141,7 +143,7 @@ export default (function (_ref) {
141
143
  key: pathname,
142
144
  timestamp: new Date().getTime(),
143
145
  label: curMenu ? curMenu.nodeName : '未知',
144
- outlet: curMenu ? outlet : /*#__PURE__*/React.createElement(Empty, {
146
+ outlet: curMenu ? outlet : /*#__PURE__*/_jsx(Empty, {
145
147
  description: "\u672A\u77E5\u9875\u9762"
146
148
  }),
147
149
  urlAuthList: urlAuthList
@@ -192,18 +194,19 @@ export default (function (_ref) {
192
194
  history.push('/');
193
195
  }
194
196
  };
195
- var tabBarExtraContent = /*#__PURE__*/React.createElement(Dropdown, {
197
+ var tabBarExtraContent = /*#__PURE__*/_jsx(Dropdown, {
196
198
  menu: {
197
199
  items: extraItems,
198
200
  onClick: function onClick(e) {
199
201
  onCloseTab(e.key);
200
202
  }
201
203
  },
202
- placement: "bottomRight"
203
- }, /*#__PURE__*/React.createElement(Button, {
204
- icon: /*#__PURE__*/React.createElement(MoreOutlined, null),
205
- type: "text"
206
- }));
204
+ placement: "bottomRight",
205
+ children: /*#__PURE__*/_jsx(Button, {
206
+ icon: /*#__PURE__*/_jsx(MoreOutlined, {}),
207
+ type: "text"
208
+ })
209
+ });
207
210
  var tabRef = useRef();
208
211
  var resizeFn = _debounce(function (width) {
209
212
  if (tabRef.current) tabRef.current.style.maxWidth = "".concat(width, "px");
@@ -214,37 +217,39 @@ export default (function (_ref) {
214
217
  var onResize = function onResize(size) {
215
218
  resizeFn(size.width);
216
219
  };
217
- return /*#__PURE__*/React.createElement("div", {
218
- className: classnames(className, "".concat(classPrefix, "-keep-alive"))
219
- }, /*#__PURE__*/React.createElement(ResizeObserver, {
220
- onResize: onResize
221
- }, /*#__PURE__*/React.createElement("div", null)), /*#__PURE__*/React.createElement(Tabs, {
222
- id: "keep-alive-tabs",
223
- hideAdd: true,
224
- size: "small",
225
- onChange: function onChange(e) {
226
- history.push(e);
227
- },
228
- className: "".concat(classPrefix, "-keep-alive-tabs"),
229
- activeKey: pathname,
230
- type: "editable-card",
231
- onEdit: function onEdit(e) {
232
- return onDestroy(e);
233
- },
234
- items: components.current,
235
- tabBarExtraContent: components.current.length > 2 ? tabBarExtraContent : null
236
- }), components.current.map(function (_ref3) {
237
- var key = _ref3.key,
238
- urlAuthList = _ref3.urlAuthList,
239
- timestamp = _ref3.timestamp,
240
- outlet = _ref3.outlet;
241
- return /*#__PURE__*/React.createElement(Page, {
242
- key: key,
243
- active: key === pathname,
244
- location: location,
245
- onDestroy: onDestroy,
246
- urlAuthList: urlAuthList,
247
- timestamp: timestamp
248
- }, outlet);
249
- }));
220
+ return /*#__PURE__*/_jsxs("div", {
221
+ className: classnames(className, "".concat(classPrefix, "-keep-alive")),
222
+ children: [/*#__PURE__*/_jsx(ResizeObserver, {
223
+ onResize: onResize,
224
+ children: /*#__PURE__*/_jsx("div", {})
225
+ }), /*#__PURE__*/_jsx(Tabs, {
226
+ id: "keep-alive-tabs",
227
+ hideAdd: true,
228
+ size: "small",
229
+ onChange: function onChange(e) {
230
+ history.push(e);
231
+ },
232
+ className: "".concat(classPrefix, "-keep-alive-tabs"),
233
+ activeKey: pathname,
234
+ type: "editable-card",
235
+ onEdit: function onEdit(e) {
236
+ return onDestroy(e);
237
+ },
238
+ items: components.current,
239
+ tabBarExtraContent: components.current.length > 2 ? tabBarExtraContent : null
240
+ }), components.current.map(function (_ref3) {
241
+ var key = _ref3.key,
242
+ urlAuthList = _ref3.urlAuthList,
243
+ timestamp = _ref3.timestamp,
244
+ outlet = _ref3.outlet;
245
+ return /*#__PURE__*/_jsx(Page, {
246
+ active: key === pathname,
247
+ location: location,
248
+ onDestroy: onDestroy,
249
+ urlAuthList: urlAuthList,
250
+ timestamp: timestamp,
251
+ children: outlet
252
+ }, key);
253
+ })]
254
+ });
250
255
  });
@@ -1,6 +1,7 @@
1
1
  import React, { memo, useRef } from 'react';
2
2
  import Scrollbars from 'react-custom-scrollbars';
3
3
  import { PageContext } from "../context";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  export default /*#__PURE__*/memo(function (props) {
5
6
  var locationRef = useRef(props.location);
6
7
  var children = props.children,
@@ -8,7 +9,7 @@ export default /*#__PURE__*/memo(function (props) {
8
9
  urlAuthList = props.urlAuthList,
9
10
  onDestroy = props.onDestroy;
10
11
  var id = "_tab_content_".concat(locationRef.current.key);
11
- return /*#__PURE__*/React.createElement(PageContext.Provider, {
12
+ return /*#__PURE__*/_jsx(PageContext.Provider, {
12
13
  value: {
13
14
  id: id,
14
15
  isActive: active,
@@ -17,21 +18,24 @@ export default /*#__PURE__*/memo(function (props) {
17
18
  onAuth: function onAuth(e) {
18
19
  return urlAuthList.includes(e);
19
20
  }
20
- }
21
- }, /*#__PURE__*/React.createElement("div", {
22
- style: {
23
- flex: '1 1 auto',
24
- display: active ? 'block' : 'none',
25
- position: 'relative'
26
21
  },
27
- id: id,
28
- "data-display": active
29
- }, /*#__PURE__*/React.createElement(Scrollbars, {
30
- style: {
31
- display: active ? 'block' : 'none'
32
- },
33
- autoHide: true
34
- }, children)));
22
+ children: /*#__PURE__*/_jsx("div", {
23
+ style: {
24
+ flex: '1 1 auto',
25
+ display: active ? 'block' : 'none',
26
+ position: 'relative'
27
+ },
28
+ id: id,
29
+ "data-display": active,
30
+ children: /*#__PURE__*/_jsx(Scrollbars, {
31
+ style: {
32
+ display: active ? 'block' : 'none'
33
+ },
34
+ autoHide: true,
35
+ children: children
36
+ })
37
+ })
38
+ });
35
39
  }, function (l, n) {
36
40
  return l.active === n.active && l.timestamp === n.timestamp;
37
41
  });
@@ -11,6 +11,9 @@ import React, { useEffect, useRef } from 'react';
11
11
  import { CcsAuth } from '..';
12
12
  import { useCcsWindow } from "../";
13
13
  import { FnContext } from "../drawer/open/content";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import { Fragment as _Fragment } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
17
  var onGetModalBodyDom = _memoize(function (dom) {
15
18
  var _parent$classList;
16
19
  var parent = dom === null || dom === void 0 ? void 0 : dom.parentNode;
@@ -45,18 +48,23 @@ export default function ModalButtons(_ref) {
45
48
  }
46
49
  onOk();
47
50
  };
48
- var renderDefaultButtom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
49
- onClick: close
50
- }, "\u53D6\u6D88"), okAuth ? /*#__PURE__*/React.createElement(CcsAuth.Button, {
51
- auth: okAuth,
52
- type: "primary",
53
- onClick: onOkClick,
54
- loading: loading
55
- }, okText || '确定') : /*#__PURE__*/React.createElement(Button, {
56
- type: "primary",
57
- onClick: onOkClick,
58
- loading: loading
59
- }, okText || '确定'));
51
+ var renderDefaultButtom = /*#__PURE__*/_jsxs(_Fragment, {
52
+ children: [/*#__PURE__*/_jsx(Button, {
53
+ onClick: close,
54
+ children: "\u53D6\u6D88"
55
+ }), okAuth ? /*#__PURE__*/_jsx(CcsAuth.Button, {
56
+ auth: okAuth,
57
+ type: "primary",
58
+ onClick: onOkClick,
59
+ loading: loading,
60
+ children: okText || '确定'
61
+ }) : /*#__PURE__*/_jsx(Button, {
62
+ type: "primary",
63
+ onClick: onOkClick,
64
+ loading: loading,
65
+ children: okText || '确定'
66
+ })]
67
+ });
60
68
  var timeoutId;
61
69
  var onRenderButton = function onRenderButton() {
62
70
  if (!onOk && !children) return;
@@ -69,11 +77,13 @@ export default function ModalButtons(_ref) {
69
77
  clearTimeout(timeoutId);
70
78
  timeoutId = setTimeout(function () {
71
79
  if (modalBody !== null && modalBody !== void 0 && modalBody.lastChild) {
72
- reactRender( /*#__PURE__*/React.createElement(FnContext, {
73
- locationKey: locationKey
74
- }, /*#__PURE__*/React.createElement(Space, {
75
- size: 16
76
- }, children, renderDefaultButtom)), modalBody.lastChild);
80
+ reactRender( /*#__PURE__*/_jsx(FnContext, {
81
+ locationKey: locationKey,
82
+ children: /*#__PURE__*/_jsxs(Space, {
83
+ size: 16,
84
+ children: [children, renderDefaultButtom]
85
+ })
86
+ }), modalBody.lastChild);
77
87
  }
78
88
  });
79
89
  };
@@ -81,7 +91,7 @@ export default function ModalButtons(_ref) {
81
91
  onRenderButton();
82
92
  }, []);
83
93
  onRenderButton();
84
- return /*#__PURE__*/React.createElement("div", {
94
+ return /*#__PURE__*/_jsx("div", {
85
95
  style: {
86
96
  display: 'none'
87
97
  },