@ccs-ui/rc-pro 1.1.0 → 1.1.1-rc1
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/auth/auth-button.js +25 -12
- package/es/auth/auth-dropdown.js +13 -5
- package/es/auth/index.d.ts +10 -10
- package/es/auth/index.js +86 -65
- package/es/cascader/index.js +2 -2
- package/es/color-picker/index.js +30 -26
- package/es/date-picker/index.js +9 -3
- package/es/dialog/button.d.ts +2 -1
- package/es/dialog/button.js +20 -11
- package/es/dialog/dialog.js +11 -11
- package/es/drawer/buttons.js +31 -21
- package/es/drawer/open/content.js +27 -21
- package/es/drawer/open/form.js +5 -3
- package/es/drawer/open/index.js +41 -27
- package/es/interval-button/index.js +11 -5
- package/es/keep-alive-tabs/index.js +45 -40
- package/es/keep-alive-tabs/page.js +19 -15
- package/es/modal/buttons.js +28 -18
- package/es/modal/open/drag.js +14 -11
- package/es/modal/open/form.js +11 -3
- package/es/modal/open/index.js +9 -6
- package/es/pro-grid/index.js +48 -35
- package/es/pro-table/index.js +0 -2
- package/es/pro-tabs/index.js +6 -3
- package/es/select/index.js +2 -2
- package/es/table/index.js +60 -54
- package/es/time-picker/index.js +9 -3
- package/es/trigger/index.js +77 -67
- package/es/upload/index.js +15 -6
- package/es/upload/upload-image.js +23 -11
- package/es/virtual-list/index.js +33 -28
- package/es/water-mark/index.js +20 -17
- package/package.json +2 -2
package/es/trigger/index.js
CHANGED
|
@@ -22,6 +22,9 @@ 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__*/
|
|
220
|
-
locale: zhCN
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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;
|
package/es/upload/index.js
CHANGED
|
@@ -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
|
|
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); }
|
|
@@ -12,6 +17,7 @@ import { UploadOutlined } from '@ant-design/icons';
|
|
|
12
17
|
import { Button, Upload, message } from 'antd';
|
|
13
18
|
import React, { 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__*/
|
|
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),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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,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 = ["crop", "tokenKey", "uploadText", "maxCount", "maxFileSize", "onChange"];
|
|
3
|
-
function
|
|
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); }); }; }
|
|
@@ -17,6 +21,8 @@ import { CcsModal } from "./..";
|
|
|
17
21
|
import { Upload, message } from 'antd';
|
|
18
22
|
import ImgCrop from 'antd-img-crop';
|
|
19
23
|
import React, { useState } from 'react';
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
26
|
var getBase64 = function getBase64(file) {
|
|
21
27
|
return new Promise(function (resolve, reject) {
|
|
22
28
|
var reader = new FileReader();
|
|
@@ -88,7 +94,7 @@ export function ImageUpload(_ref) {
|
|
|
88
94
|
case 4:
|
|
89
95
|
CcsModal.open({
|
|
90
96
|
title: file.name || file.url.substring(file.url.lastIndexOf('/') + 1),
|
|
91
|
-
content: /*#__PURE__*/
|
|
97
|
+
content: /*#__PURE__*/_jsx("img", {
|
|
92
98
|
alt: "example",
|
|
93
99
|
style: {
|
|
94
100
|
width: '100%'
|
|
@@ -113,20 +119,26 @@ export function ImageUpload(_ref) {
|
|
|
113
119
|
token: tokenKey ? sessionStorage.getItem(tokenKey) : ''
|
|
114
120
|
}
|
|
115
121
|
};
|
|
116
|
-
var renderUpload = /*#__PURE__*/
|
|
122
|
+
var renderUpload = /*#__PURE__*/_jsx(Upload, _objectSpread(_objectSpread(_objectSpread({}, uploadProps), {}, {
|
|
117
123
|
onChange: handleOnChange,
|
|
118
124
|
beforeUpload: beforeUpload,
|
|
119
125
|
fileList: files,
|
|
120
126
|
maxCount: maxCount,
|
|
121
127
|
listType: "picture-card",
|
|
122
128
|
onPreview: handlePreview
|
|
123
|
-
}, otherProps),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
}, otherProps), {}, {
|
|
130
|
+
children: files.length < maxCount && /*#__PURE__*/_jsxs("div", {
|
|
131
|
+
children: [/*#__PURE__*/_jsx(PlusOutlined, {}), /*#__PURE__*/_jsx("div", {
|
|
132
|
+
style: {
|
|
133
|
+
marginTop: 8
|
|
134
|
+
},
|
|
135
|
+
children: uploadText
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
}));
|
|
139
|
+
return crop ? /*#__PURE__*/_jsx(ImgCrop, {
|
|
129
140
|
minZoom: 0.5,
|
|
130
|
-
rotationSlider: true
|
|
131
|
-
|
|
141
|
+
rotationSlider: true,
|
|
142
|
+
children: renderUpload
|
|
143
|
+
}) : renderUpload;
|
|
132
144
|
}
|
package/es/virtual-list/index.js
CHANGED
|
@@ -13,6 +13,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import { useScroll } from 'ahooks';
|
|
14
14
|
import React, { 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__*/
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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__*/
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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;
|
package/es/water-mark/index.js
CHANGED
|
@@ -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__*/
|
|
116
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
115
117
|
style: _objectSpread({
|
|
116
118
|
position: 'relative'
|
|
117
119
|
}, style),
|
|
118
|
-
className: wrapperCls
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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.
|
|
3
|
+
"version": "1.1.1-rc1",
|
|
4
4
|
"description": "A react pro components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@ant-design/icons": "^5.1.4",
|
|
51
51
|
"ahooks": "^3.7.7",
|
|
52
|
-
"antd": "5.6",
|
|
53
52
|
"antd-img-crop": "^4.12.2",
|
|
54
53
|
"classnames": "^2.3.2",
|
|
55
54
|
"dayjs": "^1.11.7",
|
|
@@ -91,6 +90,7 @@
|
|
|
91
90
|
"stylelint": "^14.9.1"
|
|
92
91
|
},
|
|
93
92
|
"peerDependencies": {
|
|
93
|
+
"antd": "5.6",
|
|
94
94
|
"react": ">=16.9.0",
|
|
95
95
|
"react-dom": ">=16.9.0"
|
|
96
96
|
},
|