@pisell/common 0.0.21-bata → 1.0.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.
- package/.fatherrc.ts +7 -0
- package/CHANGELOG.md +14 -0
- package/README.md +1 -38
- package/es/bin/pisell.js +0 -0
- package/es/index.d.ts +2 -4
- package/es/index.js +1 -4
- package/es/script/utils/index.js +1 -1
- package/lib/index.d.ts +2 -4
- package/lib/index.js +8 -5
- package/lib/script/deploy.js +0 -2
- package/lib/script/release/index.js +0 -2
- package/lib/script/release/release.js +0 -2
- package/lib/script/uploadCode/index.js +0 -2
- package/lib/script/uploadCode/uploadCode.js +0 -2
- package/lib/script/utils/index.js +1 -1
- package/package.json +23 -74
- package/src/bin/pisell.js +3 -0
- package/src/index.ts +1 -0
- package/src/script/constants/index.js +14 -0
- package/src/script/deploy.js +29 -0
- package/src/script/index.js +45 -0
- package/src/script/package.json +4 -0
- package/src/script/release/index.js +119 -0
- package/src/script/release/release.js +84 -0
- package/src/script/uploadCode/index.js +244 -0
- package/src/script/uploadCode/uploadCode.js +217 -0
- package/src/script/utils/index.js +275 -0
- package/tsconfig.json +14 -0
- package/LICENSE +0 -21
- package/es/business-components/colorInput/index.d.ts +0 -21
- package/es/business-components/colorInput/index.js +0 -43
- package/es/business-components/colorInput/index.less +0 -10
- package/es/business-components/index.d.ts +0 -11
- package/es/business-components/index.js +0 -7
- package/es/business-components/rechargeOption/index.d.ts +0 -36
- package/es/business-components/rechargeOption/index.js +0 -132
- package/es/business-components/rechargeOption/index.less +0 -0
- package/es/business-components/selectTag/index.d.ts +0 -25
- package/es/business-components/selectTag/index.js +0 -179
- package/es/business-components/selectTag/index.less +0 -22
- package/es/business-components/sortModal/index.d.ts +0 -30
- package/es/business-components/sortModal/index.js +0 -85
- package/es/business-components/sortModal/index.less +0 -29
- package/es/business-components/statistics/index.d.ts +0 -12
- package/es/business-components/statistics/index.js +0 -38
- package/es/business-components/statistics/index.less +0 -64
- package/es/business-components/tagModal/index.d.ts +0 -17
- package/es/business-components/tagModal/index.js +0 -58
- package/es/business-hooks/index.d.ts +0 -2
- package/es/business-hooks/index.js +0 -2
- package/es/business-hooks/useModal/index.d.ts +0 -31
- package/es/business-hooks/useModal/index.js +0 -91
- package/es/business-hooks/useModal/index.less +0 -0
- package/es/business-hooks/useTagModal/index.d.ts +0 -17
- package/es/business-hooks/useTagModal/index.js +0 -47
- package/es/components/ColorPicker/index.d.ts +0 -22
- package/es/components/ColorPicker/index.js +0 -51
- package/es/components/ColorPicker/index.less +0 -17
- package/es/components/DragSort/index.js +0 -68
- package/es/components/EditorPreview/index.js +0 -14
- package/es/components/EditorPreview/index.less +0 -81
- package/es/components/Iconfont/index.d.ts +0 -6
- package/es/components/Iconfont/index.js +0 -29
- package/es/components/Iconfont/index.less +0 -0
- package/es/components/agreement/Detail/index.js +0 -77
- package/es/components/agreement/Detail/serve.d.ts +0 -1
- package/es/components/agreement/Detail/serve.js +0 -6
- package/es/components/agreement/index.d.ts +0 -11
- package/es/components/agreement/index.js +0 -45
- package/es/components/agreement/index.less +0 -20
- package/es/components/avatar/index.d.ts +0 -13
- package/es/components/avatar/index.js +0 -25
- package/es/components/button/index.js +0 -36
- package/es/components/card/index.js +0 -16
- package/es/components/card/index.less +0 -9
- package/es/components/checkbox/index.js +0 -43
- package/es/components/configProvider/index.d.ts +0 -113
- package/es/components/configProvider/index.js +0 -114
- package/es/components/datePicker/index.js +0 -17
- package/es/components/index.js +0 -16
- package/es/components/input/index.js +0 -97
- package/es/components/inputNumber/index.js +0 -17
- package/es/components/pagination/index.d.ts +0 -10
- package/es/components/pagination/index.js +0 -18
- package/es/components/radio/index.js +0 -28
- package/es/components/select/index.js +0 -17
- package/es/components/switch/index.d.ts +0 -10
- package/es/components/switch/index.js +0 -18
- package/es/config/index.js +0 -18
- package/es/config/request.d.ts +0 -7
- package/es/config/request.js +0 -67
- package/es/config/utils.d.ts +0 -0
- package/es/config/utils.js +0 -0
- package/es/hooks/index.d.ts +0 -8
- package/es/hooks/index.js +0 -8
- package/es/hooks/useCountDown/index.d.ts +0 -10
- package/es/hooks/useCountDown/index.js +0 -48
- package/es/hooks/useDocumentScroll/index.d.ts +0 -8
- package/es/hooks/useDocumentScroll/index.js +0 -41
- package/es/hooks/useDocumentScroll/index.less +0 -0
- package/es/hooks/useMousemove/index.d.ts +0 -8
- package/es/hooks/useMousemove/index.js +0 -61
- package/es/hooks/useResponsive/index.d.ts +0 -2
- package/es/hooks/useResponsive/index.js +0 -29
- package/es/hooks/useResponsive/index.less +0 -0
- package/es/hooks/useSize/index.d.ts +0 -2
- package/es/hooks/useSize/index.js +0 -27
- package/es/hooks/useSize/index.less +0 -0
- package/es/hooks/useStateMulti/index.d.ts +0 -2
- package/es/hooks/useStateMulti/index.js +0 -29
- package/es/hooks/useStateWithCb/index.d.ts +0 -2
- package/es/hooks/useStateWithCb/index.js +0 -42
- package/es/hooks/useTable/index.d.ts +0 -12
- package/es/hooks/useTable/index.js +0 -74
- package/es/hooks/useTable/index.less +0 -0
- package/es/hooks/useTableModal/index.d.ts +0 -12
- package/es/hooks/useTableModal/index.js +0 -25
- package/es/hooks/useTableModal/index.less +0 -0
- package/es/hooks/useUrlState/index.d.ts +0 -2
- package/es/hooks/useUrlState/index.js +0 -56
- package/es/hooks/useWebSocket/index.d.ts +0 -13
- package/es/hooks/useWebSocket/index.js +0 -121
- package/es/locales/en-US.d.ts +0 -11
- package/es/locales/en-US.js +0 -10
- package/es/locales/index.d.ts +0 -1
- package/es/locales/index.js +0 -23
- package/es/locales/zh-CN.d.ts +0 -11
- package/es/locales/zh-CN.js +0 -10
- package/es/locales/zh-TW.d.ts +0 -11
- package/es/locales/zh-TW.js +0 -10
- package/es/utils/index.d.ts +0 -3
- package/es/utils/index.js +0 -3
- package/es/utils/otherUtils.d.ts +0 -8
- package/es/utils/otherUtils.js +0 -12
- package/es/utils/storage.d.ts +0 -30
- package/es/utils/storage.js +0 -70
- package/es/utils/typeUtils.d.ts +0 -42
- package/es/utils/typeUtils.js +0 -86
- package/lib/business-components/colorInput/index.d.ts +0 -21
- package/lib/business-components/colorInput/index.js +0 -70
- package/lib/business-components/colorInput/index.less +0 -10
- package/lib/business-components/index.d.ts +0 -11
- package/lib/business-components/index.js +0 -54
- package/lib/business-components/rechargeOption/index.d.ts +0 -36
- package/lib/business-components/rechargeOption/index.js +0 -112
- package/lib/business-components/rechargeOption/index.less +0 -0
- package/lib/business-components/selectTag/index.d.ts +0 -25
- package/lib/business-components/selectTag/index.js +0 -181
- package/lib/business-components/selectTag/index.less +0 -22
- package/lib/business-components/sortModal/index.d.ts +0 -30
- package/lib/business-components/sortModal/index.js +0 -100
- package/lib/business-components/sortModal/index.less +0 -29
- package/lib/business-components/statistics/index.d.ts +0 -12
- package/lib/business-components/statistics/index.js +0 -63
- package/lib/business-components/statistics/index.less +0 -64
- package/lib/business-components/tagModal/index.d.ts +0 -17
- package/lib/business-components/tagModal/index.js +0 -66
- package/lib/business-hooks/index.d.ts +0 -2
- package/lib/business-hooks/index.js +0 -42
- package/lib/business-hooks/useModal/index.d.ts +0 -31
- package/lib/business-hooks/useModal/index.js +0 -68
- package/lib/business-hooks/useModal/index.less +0 -0
- package/lib/business-hooks/useTagModal/index.d.ts +0 -17
- package/lib/business-hooks/useTagModal/index.js +0 -61
- package/lib/components/ColorPicker/index.d.ts +0 -22
- package/lib/components/ColorPicker/index.js +0 -80
- package/lib/components/ColorPicker/index.less +0 -17
- package/lib/components/DragSort/index.js +0 -101
- package/lib/components/EditorPreview/index.js +0 -37
- package/lib/components/EditorPreview/index.less +0 -81
- package/lib/components/Iconfont/index.d.ts +0 -6
- package/lib/components/Iconfont/index.js +0 -48
- package/lib/components/Iconfont/index.less +0 -0
- package/lib/components/agreement/Detail/index.js +0 -86
- package/lib/components/agreement/Detail/serve.d.ts +0 -1
- package/lib/components/agreement/Detail/serve.js +0 -30
- package/lib/components/agreement/index.d.ts +0 -11
- package/lib/components/agreement/index.js +0 -82
- package/lib/components/agreement/index.less +0 -20
- package/lib/components/avatar/index.d.ts +0 -13
- package/lib/components/avatar/index.js +0 -42
- package/lib/components/button/index.js +0 -36
- package/lib/components/card/index.js +0 -42
- package/lib/components/card/index.less +0 -9
- package/lib/components/checkbox/index.js +0 -36
- package/lib/components/configProvider/index.d.ts +0 -113
- package/lib/components/configProvider/index.js +0 -159
- package/lib/components/datePicker/index.js +0 -31
- package/lib/components/index.js +0 -83
- package/lib/components/input/index.js +0 -53
- package/lib/components/inputNumber/index.js +0 -31
- package/lib/components/pagination/index.d.ts +0 -10
- package/lib/components/pagination/index.js +0 -42
- package/lib/components/radio/index.js +0 -36
- package/lib/components/select/index.js +0 -36
- package/lib/components/switch/index.d.ts +0 -10
- package/lib/components/switch/index.js +0 -42
- package/lib/config/index.js +0 -39
- package/lib/config/request.d.ts +0 -7
- package/lib/config/request.js +0 -76
- package/lib/config/utils.d.ts +0 -0
- package/lib/config/utils.js +0 -0
- package/lib/hooks/index.d.ts +0 -8
- package/lib/hooks/index.js +0 -57
- package/lib/hooks/useCountDown/index.d.ts +0 -10
- package/lib/hooks/useCountDown/index.js +0 -57
- package/lib/hooks/useDocumentScroll/index.d.ts +0 -8
- package/lib/hooks/useDocumentScroll/index.js +0 -54
- package/lib/hooks/useDocumentScroll/index.less +0 -0
- package/lib/hooks/useMousemove/index.d.ts +0 -8
- package/lib/hooks/useMousemove/index.js +0 -70
- package/lib/hooks/useResponsive/index.d.ts +0 -2
- package/lib/hooks/useResponsive/index.js +0 -47
- package/lib/hooks/useResponsive/index.less +0 -0
- package/lib/hooks/useSize/index.d.ts +0 -2
- package/lib/hooks/useSize/index.js +0 -45
- package/lib/hooks/useSize/index.less +0 -0
- package/lib/hooks/useStateMulti/index.d.ts +0 -2
- package/lib/hooks/useStateMulti/index.js +0 -43
- package/lib/hooks/useStateWithCb/index.d.ts +0 -2
- package/lib/hooks/useStateWithCb/index.js +0 -53
- package/lib/hooks/useTable/index.d.ts +0 -12
- package/lib/hooks/useTable/index.js +0 -75
- package/lib/hooks/useTable/index.less +0 -0
- package/lib/hooks/useTableModal/index.d.ts +0 -12
- package/lib/hooks/useTableModal/index.js +0 -43
- package/lib/hooks/useTableModal/index.less +0 -0
- package/lib/hooks/useUrlState/index.d.ts +0 -2
- package/lib/hooks/useUrlState/index.js +0 -59
- package/lib/hooks/useWebSocket/index.d.ts +0 -13
- package/lib/hooks/useWebSocket/index.js +0 -91
- package/lib/locales/en-US.d.ts +0 -11
- package/lib/locales/en-US.js +0 -36
- package/lib/locales/index.d.ts +0 -1
- package/lib/locales/index.js +0 -59
- package/lib/locales/zh-CN.d.ts +0 -11
- package/lib/locales/zh-CN.js +0 -36
- package/lib/locales/zh-TW.d.ts +0 -11
- package/lib/locales/zh-TW.js +0 -36
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +0 -21
- package/lib/utils/otherUtils.d.ts +0 -8
- package/lib/utils/otherUtils.js +0 -31
- package/lib/utils/storage.d.ts +0 -30
- package/lib/utils/storage.js +0 -63
- package/lib/utils/typeUtils.d.ts +0 -42
- package/lib/utils/typeUtils.js +0 -75
package/es/config/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
var PisellConfig = {};
|
|
8
|
-
export var initConfig = function initConfig(options) {
|
|
9
|
-
Object.entries(options).forEach(function (_ref) {
|
|
10
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
11
|
-
key = _ref2[0],
|
|
12
|
-
value = _ref2[1];
|
|
13
|
-
PisellConfig[key] = value;
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export var getConfig = function getConfig() {
|
|
17
|
-
return PisellConfig;
|
|
18
|
-
};
|
package/es/config/request.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RequestMethod } from './index';
|
|
2
|
-
declare const get: RequestMethod;
|
|
3
|
-
declare const post: RequestMethod;
|
|
4
|
-
declare const put: RequestMethod;
|
|
5
|
-
declare const remove: RequestMethod;
|
|
6
|
-
declare const request: RequestMethod;
|
|
7
|
-
export { get, post, put, remove, request };
|
package/es/config/request.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
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 _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; }
|
|
3
|
-
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); } }
|
|
4
|
-
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); }); }; }
|
|
5
|
-
import { getConfig } from "./index";
|
|
6
|
-
var importRequest = function () {
|
|
7
|
-
var request = null;
|
|
8
|
-
return function () {
|
|
9
|
-
if (request) {
|
|
10
|
-
return request;
|
|
11
|
-
}
|
|
12
|
-
var _getConfig = getConfig();
|
|
13
|
-
request = _getConfig.request;
|
|
14
|
-
return request;
|
|
15
|
-
};
|
|
16
|
-
}();
|
|
17
|
-
var defaultFunction = /*#__PURE__*/function () {
|
|
18
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
19
|
-
var _console;
|
|
20
|
-
var _len,
|
|
21
|
-
arg,
|
|
22
|
-
_key,
|
|
23
|
-
_args = arguments;
|
|
24
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
25
|
-
while (1) switch (_context.prev = _context.next) {
|
|
26
|
-
case 0:
|
|
27
|
-
for (_len = _args.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
-
arg[_key] = _args[_key];
|
|
29
|
-
}
|
|
30
|
-
(_console = console).log.apply(_console, ['请先初始化request配置'].concat(arg));
|
|
31
|
-
return _context.abrupt("return", '');
|
|
32
|
-
case 3:
|
|
33
|
-
case "end":
|
|
34
|
-
return _context.stop();
|
|
35
|
-
}
|
|
36
|
-
}, _callee);
|
|
37
|
-
}));
|
|
38
|
-
return function defaultFunction() {
|
|
39
|
-
return _ref.apply(this, arguments);
|
|
40
|
-
};
|
|
41
|
-
}();
|
|
42
|
-
var get = function get() {
|
|
43
|
-
var _importRequest;
|
|
44
|
-
var func = ((_importRequest = importRequest()) === null || _importRequest === void 0 ? void 0 : _importRequest.get) || defaultFunction;
|
|
45
|
-
return func.apply(void 0, arguments);
|
|
46
|
-
};
|
|
47
|
-
var post = function post() {
|
|
48
|
-
var _importRequest2;
|
|
49
|
-
var func = ((_importRequest2 = importRequest()) === null || _importRequest2 === void 0 ? void 0 : _importRequest2.post) || defaultFunction;
|
|
50
|
-
return func.apply(void 0, arguments);
|
|
51
|
-
};
|
|
52
|
-
var put = function put() {
|
|
53
|
-
var _importRequest3;
|
|
54
|
-
var func = ((_importRequest3 = importRequest()) === null || _importRequest3 === void 0 ? void 0 : _importRequest3.put) || defaultFunction;
|
|
55
|
-
return func.apply(void 0, arguments);
|
|
56
|
-
};
|
|
57
|
-
var remove = function remove() {
|
|
58
|
-
var _importRequest4;
|
|
59
|
-
var func = ((_importRequest4 = importRequest()) === null || _importRequest4 === void 0 ? void 0 : _importRequest4.remove) || defaultFunction;
|
|
60
|
-
return func.apply(void 0, arguments);
|
|
61
|
-
};
|
|
62
|
-
var request = function request() {
|
|
63
|
-
var _importRequest5;
|
|
64
|
-
var func = ((_importRequest5 = importRequest()) === null || _importRequest5 === void 0 ? void 0 : _importRequest5.request) || defaultFunction;
|
|
65
|
-
return func.apply(void 0, arguments);
|
|
66
|
-
};
|
|
67
|
-
export { get, post, put, remove, request };
|
package/es/config/utils.d.ts
DELETED
|
File without changes
|
package/es/config/utils.js
DELETED
|
File without changes
|
package/es/hooks/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import useMousemove from './useMousemove';
|
|
2
|
-
import useResponsive from './useResponsive';
|
|
3
|
-
import useSize from './useSize';
|
|
4
|
-
import useStateMulti from './useStateMulti';
|
|
5
|
-
import useStateWithCb from './useStateWithCb';
|
|
6
|
-
import useTable from './useTable';
|
|
7
|
-
import useUrlState from './useUrlState';
|
|
8
|
-
export { useStateMulti, useStateWithCb, useResponsive, useUrlState, useSize, useMousemove, useTable, };
|
package/es/hooks/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import useMousemove from "./useMousemove";
|
|
2
|
-
import useResponsive from "./useResponsive";
|
|
3
|
-
import useSize from "./useSize";
|
|
4
|
-
import useStateMulti from "./useStateMulti";
|
|
5
|
-
import useStateWithCb from "./useStateWithCb";
|
|
6
|
-
import useTable from "./useTable";
|
|
7
|
-
import useUrlState from "./useUrlState";
|
|
8
|
-
export { useStateMulti, useStateWithCb, useResponsive, useUrlState, useSize, useMousemove, useTable };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { useCallback, useState, useRef } from 'react';
|
|
8
|
-
var useCountDown = function useCountDown() {
|
|
9
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
10
|
-
_ref$second = _ref.second,
|
|
11
|
-
second = _ref$second === void 0 ? 60 : _ref$second,
|
|
12
|
-
_ref$running = _ref.running,
|
|
13
|
-
running = _ref$running === void 0 ? false : _ref$running;
|
|
14
|
-
var _useState = useState(running),
|
|
15
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
-
_running = _useState2[0],
|
|
17
|
-
setRunning = _useState2[1];
|
|
18
|
-
var _useState3 = useState(second),
|
|
19
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
20
|
-
_second = _useState4[0],
|
|
21
|
-
setSecond = _useState4[1];
|
|
22
|
-
var timer = useRef();
|
|
23
|
-
var stop = useCallback(function () {
|
|
24
|
-
setRunning(false);
|
|
25
|
-
clearInterval(timer.current);
|
|
26
|
-
}, []);
|
|
27
|
-
var start = useCallback(function () {
|
|
28
|
-
setSecond(second);
|
|
29
|
-
setRunning(true);
|
|
30
|
-
timer.current = setInterval(function () {
|
|
31
|
-
setSecond(function (s) {
|
|
32
|
-
s = s - 1;
|
|
33
|
-
if (s <= 0) {
|
|
34
|
-
s = 0;
|
|
35
|
-
stop();
|
|
36
|
-
}
|
|
37
|
-
return s;
|
|
38
|
-
});
|
|
39
|
-
}, 1000);
|
|
40
|
-
}, [second, stop]);
|
|
41
|
-
return {
|
|
42
|
-
running: _running,
|
|
43
|
-
second: _second,
|
|
44
|
-
start: start,
|
|
45
|
-
stop: stop
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default useCountDown;
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
import { useMemo } from 'react';
|
|
8
|
-
import { useScroll } from 'ahooks';
|
|
9
|
-
var initValue = {
|
|
10
|
-
left: 0,
|
|
11
|
-
top: 0,
|
|
12
|
-
// 窗口高度
|
|
13
|
-
innerHeight: 0,
|
|
14
|
-
// 当前窗口高度
|
|
15
|
-
newInnerHeight: 0
|
|
16
|
-
};
|
|
17
|
-
var useDocumentScroll = function useDocumentScroll() {
|
|
18
|
-
//窗口高度
|
|
19
|
-
var _innerHeight = useMemo(function () {
|
|
20
|
-
return document.documentElement.clientHeight;
|
|
21
|
-
}, []);
|
|
22
|
-
var _scroll = useScroll(document);
|
|
23
|
-
/**
|
|
24
|
-
* @title: 返回结果
|
|
25
|
-
* @description:
|
|
26
|
-
* @param {*} useMemo
|
|
27
|
-
* @return {*}
|
|
28
|
-
* @Author: Wzw
|
|
29
|
-
* @Date: 2022-07-01 15:43
|
|
30
|
-
*/
|
|
31
|
-
var _result = useMemo(function () {
|
|
32
|
-
return _objectSpread(_objectSpread(_objectSpread({}, initValue), _scroll), {}, {
|
|
33
|
-
// 窗口高度
|
|
34
|
-
innerHeight: _innerHeight,
|
|
35
|
-
// 当前窗口高度
|
|
36
|
-
newInnerHeight: window.innerHeight
|
|
37
|
-
});
|
|
38
|
-
}, [_innerHeight, _scroll]);
|
|
39
|
-
return _result;
|
|
40
|
-
};
|
|
41
|
-
export default useDocumentScroll;
|
|
File without changes
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { useState, useEffect } from 'react';
|
|
8
|
-
var count = 0;
|
|
9
|
-
var timer = null;
|
|
10
|
-
var useMousemove = function useMousemove(_ref) {
|
|
11
|
-
var _ref$time = _ref.time,
|
|
12
|
-
time = _ref$time === void 0 ? 60 : _ref$time;
|
|
13
|
-
var _useState = useState(false),
|
|
14
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
-
isMove = _useState2[0],
|
|
16
|
-
setIsMove = _useState2[1];
|
|
17
|
-
var go = function go() {
|
|
18
|
-
count++;
|
|
19
|
-
if (count >= time) {
|
|
20
|
-
setIsMove(true);
|
|
21
|
-
// 此处处理后续操作
|
|
22
|
-
// count = 0;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var init = function init() {
|
|
27
|
-
//页面倒计时
|
|
28
|
-
timer = setInterval(go, 1000);
|
|
29
|
-
//监听鼠标
|
|
30
|
-
var x;
|
|
31
|
-
var y;
|
|
32
|
-
document.onmousemove = function (event) {
|
|
33
|
-
var x1 = event.clientX;
|
|
34
|
-
var y1 = event.clientY;
|
|
35
|
-
if (x != x1 || y != y1) {
|
|
36
|
-
count = 0;
|
|
37
|
-
setIsMove(false);
|
|
38
|
-
}
|
|
39
|
-
x = x1;
|
|
40
|
-
y = y1;
|
|
41
|
-
};
|
|
42
|
-
// document.onmouseover
|
|
43
|
-
document.onkeydown = function () {
|
|
44
|
-
count = 0;
|
|
45
|
-
setIsMove(false);
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
useEffect(function () {
|
|
49
|
-
init();
|
|
50
|
-
return function () {
|
|
51
|
-
clearInterval(timer);
|
|
52
|
-
setIsMove(false);
|
|
53
|
-
document.onmousemove = null;
|
|
54
|
-
document.onkeydown = null;
|
|
55
|
-
};
|
|
56
|
-
}, []);
|
|
57
|
-
return {
|
|
58
|
-
isMove: isMove
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export default useMousemove;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Title: history
|
|
3
|
-
* @Describe:
|
|
4
|
-
* @Author: Wzw
|
|
5
|
-
* @Date: 2021-04-30 09:16:38
|
|
6
|
-
* @LastEditors: wzw 445595671@qq.com
|
|
7
|
-
* @LastEditTime: 2023-01-13 10:47
|
|
8
|
-
*/
|
|
9
|
-
import { useMemo } from 'react';
|
|
10
|
-
import { configResponsive, useResponsive } from 'ahooks';
|
|
11
|
-
configResponsive({
|
|
12
|
-
phone: 0,
|
|
13
|
-
ipad: 700,
|
|
14
|
-
pc: 1080
|
|
15
|
-
});
|
|
16
|
-
var useLmResponsive = function useLmResponsive() {
|
|
17
|
-
var responsive = useResponsive();
|
|
18
|
-
var current = useMemo(function () {
|
|
19
|
-
if (responsive !== null && responsive !== void 0 && responsive.pc) {
|
|
20
|
-
return 'pc';
|
|
21
|
-
}
|
|
22
|
-
if (responsive !== null && responsive !== void 0 && responsive.ipad) {
|
|
23
|
-
return 'ipad';
|
|
24
|
-
}
|
|
25
|
-
return 'phone';
|
|
26
|
-
}, [responsive]);
|
|
27
|
-
return current;
|
|
28
|
-
};
|
|
29
|
-
export default useLmResponsive;
|
|
File without changes
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { useCallback, useState } from 'react';
|
|
8
|
-
import { useSize, useDebounceEffect } from 'ahooks';
|
|
9
|
-
export default (function (dom) {
|
|
10
|
-
var _useState = useState({
|
|
11
|
-
width: 0,
|
|
12
|
-
height: 0
|
|
13
|
-
}),
|
|
14
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
-
size = _useState2[0],
|
|
16
|
-
setSize = _useState2[1];
|
|
17
|
-
var _fn = useCallback(function () {
|
|
18
|
-
return document.querySelector(dom || 'body');
|
|
19
|
-
}, [dom]);
|
|
20
|
-
var _size = useSize(_fn);
|
|
21
|
-
useDebounceEffect(function () {
|
|
22
|
-
setSize(_size);
|
|
23
|
-
}, [_size], {
|
|
24
|
-
wait: 50
|
|
25
|
-
});
|
|
26
|
-
return size;
|
|
27
|
-
});
|
|
File without changes
|
|
@@ -1,29 +0,0 @@
|
|
|
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 { useState, useCallback } from 'react';
|
|
14
|
-
import { isPlainObject } from "../../utils";
|
|
15
|
-
var useStateMulti = function useStateMulti(initState) {
|
|
16
|
-
var _useState = useState(initState),
|
|
17
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
-
state = _useState2[0],
|
|
19
|
-
_setState = _useState2[1];
|
|
20
|
-
var setState = useCallback(function (updatedValues) {
|
|
21
|
-
if (isPlainObject(updatedValues)) {
|
|
22
|
-
_setState(function (prevState) {
|
|
23
|
-
return _objectSpread(_objectSpread({}, prevState), updatedValues);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}, []);
|
|
27
|
-
return [state, setState];
|
|
28
|
-
};
|
|
29
|
-
export default useStateMulti;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
8
|
-
var useStateWithCb = function useStateWithCb(initialVal) {
|
|
9
|
-
var _useState = useState(function () {
|
|
10
|
-
return initialVal;
|
|
11
|
-
}),
|
|
12
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
-
state = _useState2[0],
|
|
14
|
-
_setState = _useState2[1];
|
|
15
|
-
var _useState3 = useState(function () {
|
|
16
|
-
return Math.random();
|
|
17
|
-
}),
|
|
18
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
19
|
-
random = _useState4[0],
|
|
20
|
-
setRandom = _useState4[1];
|
|
21
|
-
var cbs = useRef([]);
|
|
22
|
-
var setState = useCallback(function (newState, cb) {
|
|
23
|
-
if (cb) {
|
|
24
|
-
cbs.current.push(cb);
|
|
25
|
-
}
|
|
26
|
-
if (Object.is(state, newState)) {
|
|
27
|
-
setRandom(Math.random());
|
|
28
|
-
}
|
|
29
|
-
_setState(newState);
|
|
30
|
-
}, [state]);
|
|
31
|
-
useEffect(function () {
|
|
32
|
-
if (cbs.current) {
|
|
33
|
-
var _cbs = cbs.current;
|
|
34
|
-
cbs.current = [];
|
|
35
|
-
_cbs.forEach(function (_cb) {
|
|
36
|
-
return _cb();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}, [state, random]);
|
|
40
|
-
return [state, setState];
|
|
41
|
-
};
|
|
42
|
-
export default useStateWithCb;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseOptions, CombineService, PaginatedFormatReturn, PaginatedParams, Result } from 'ahooks/lib/useAntdTable/index';
|
|
2
|
-
/**
|
|
3
|
-
* @Title: 基于ahooks 增加额外参数
|
|
4
|
-
* @Describe:
|
|
5
|
-
* @Author: Wzw
|
|
6
|
-
*/
|
|
7
|
-
interface useTableOptions<T> extends Omit<BaseOptions<T>, 'onSuccess'> {
|
|
8
|
-
isCaChe?: boolean;
|
|
9
|
-
onSuccess?: (data: any, params?: any, urlParams?: any) => void;
|
|
10
|
-
}
|
|
11
|
-
declare const useTable: <R, Item = any, U extends Item = any>(service: CombineService<PaginatedFormatReturn<Item>, PaginatedParams>, options: useTableOptions<U>) => Result<Item>;
|
|
12
|
-
export default useTable;
|
|
@@ -1,74 +0,0 @@
|
|
|
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
|
-
/*
|
|
14
|
-
* @Title: 二次封装useTable
|
|
15
|
-
* @Describe: 传入 isCaChe 则缓存请求的参数, 防止刷新页面参数重置
|
|
16
|
-
* @Author: Wzw
|
|
17
|
-
* @Date: 2021-04-07 14:42:28
|
|
18
|
-
* @LastEditors: wanghan 1556042996@qq.com
|
|
19
|
-
* @LastEditTime: 2022-07-30 17:58
|
|
20
|
-
*/
|
|
21
|
-
import { useEffect } from 'react';
|
|
22
|
-
import { useAntdTable } from 'ahooks';
|
|
23
|
-
import useUrlState from "../useUrlState";
|
|
24
|
-
var useTable = function useTable(service, options) {
|
|
25
|
-
var _useUrlState = useUrlState({}),
|
|
26
|
-
_useUrlState2 = _slicedToArray(_useUrlState, 2),
|
|
27
|
-
urlParams = _useUrlState2[0],
|
|
28
|
-
setUrlParams = _useUrlState2[1];
|
|
29
|
-
var table = useAntdTable(service, _objectSpread(_objectSpread({
|
|
30
|
-
throwOnError: true
|
|
31
|
-
}, options), {}, {
|
|
32
|
-
onSuccess: function onSuccess(data, params) {
|
|
33
|
-
//如果传入isCaChe, 则缓存参数
|
|
34
|
-
if (options.isCaChe) {
|
|
35
|
-
setParams(params);
|
|
36
|
-
}
|
|
37
|
-
if (typeof options.onSuccess === 'function') {
|
|
38
|
-
options.onSuccess(data, params, urlParams);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @Title: 储存url参数
|
|
45
|
-
* @Describe:
|
|
46
|
-
* @Author: Wzw
|
|
47
|
-
* @param {any} params
|
|
48
|
-
*/
|
|
49
|
-
var setParams = function setParams(params) {
|
|
50
|
-
//翻页参数
|
|
51
|
-
var _pagination = params[0];
|
|
52
|
-
//form参数
|
|
53
|
-
var _formData = params[1];
|
|
54
|
-
var _newParams = {
|
|
55
|
-
skip: (_pagination === null || _pagination === void 0 ? void 0 : _pagination.current) || 1,
|
|
56
|
-
num: (_pagination === null || _pagination === void 0 ? void 0 : _pagination.pageSize) || 10
|
|
57
|
-
};
|
|
58
|
-
for (var _i2 = 0, _Object$entries = Object.entries(_formData); _i2 < _Object$entries.length; _i2++) {
|
|
59
|
-
var item = _Object$entries[_i2];
|
|
60
|
-
if (item[1] !== undefined) {
|
|
61
|
-
_newParams[item[0]] = item[1];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
setUrlParams(_objectSpread({}, _newParams));
|
|
65
|
-
};
|
|
66
|
-
useEffect(function () {
|
|
67
|
-
//组件卸载时取消请求
|
|
68
|
-
return function () {
|
|
69
|
-
table.cancel();
|
|
70
|
-
};
|
|
71
|
-
}, []);
|
|
72
|
-
return table;
|
|
73
|
-
};
|
|
74
|
-
export default useTable;
|
|
File without changes
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* @Title: 传入参数
|
|
4
|
-
* @Describe: 其余参数与Modal一致
|
|
5
|
-
* @Author: Wzw
|
|
6
|
-
*/
|
|
7
|
-
interface useModalProps {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
title: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare const useTableModal: (props: Partial<useModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default useTableModal;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Title: useModal hooks
|
|
3
|
-
* @Describe: 基于Modal 封装 visible 以及Modal创建, 只需传入children
|
|
4
|
-
* @Author: Wzw
|
|
5
|
-
* @Date: 2021-03-30 15:21:58
|
|
6
|
-
* @LastEditors: zhiwei.wang 445595671@qq.com
|
|
7
|
-
* @LastEditTime: 2023-02-21 10:29
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import useModal from "../../business-hooks/useModal";
|
|
11
|
-
/**
|
|
12
|
-
* @Title: 传入参数
|
|
13
|
-
* @Describe: 其余参数与Modal一致
|
|
14
|
-
* @Author: Wzw
|
|
15
|
-
*/
|
|
16
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
var useTableModal = function useTableModal(props) {
|
|
19
|
-
var _useModal = useModal({}),
|
|
20
|
-
content = _useModal.content;
|
|
21
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
22
|
-
children: content
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
export default useTableModal;
|
|
File without changes
|