@pisell/materials 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +13 -13
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +12 -12
  11. package/es/components/MultipleContainersSortList/index.d.ts +5 -5
  12. package/es/components/MultipleContainersSortList/index.js +10 -10
  13. package/es/components/Pagination/index.d.ts +1 -1
  14. package/es/components/filter/components/FilterItem/index.js +5 -2
  15. package/es/components/filter/components/QuickFilter/index.js +2 -1
  16. package/es/components/filter/types.d.ts +1 -0
  17. package/es/components/sort/index.js +3 -1
  18. package/es/components/sort/index.less +3 -0
  19. package/es/components/sort/types.d.ts +1 -0
  20. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
  21. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +143 -0
  22. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
  23. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
  24. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +87 -0
  25. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
  26. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.js +41 -0
  27. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
  28. package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
  29. package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +97 -0
  30. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +7 -0
  31. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +137 -0
  32. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
  33. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
  34. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +149 -0
  35. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
  36. package/es/components/table/Actions/component/ExportImport/index.d.ts +8 -0
  37. package/es/components/table/Actions/component/ExportImport/index.js +236 -0
  38. package/es/components/table/Actions/component/ExportImport/index.less +194 -0
  39. package/es/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
  40. package/es/components/table/Actions/component/ExportImport/utils/date.js +19 -0
  41. package/es/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
  42. package/es/components/table/Actions/component/ExportImport/utils/download.js +39 -0
  43. package/es/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
  44. package/es/components/table/Actions/component/ExportImport/utils/file.js +21 -0
  45. package/es/components/table/Actions/component/Group/PopoverContent.d.ts +2 -2
  46. package/es/components/table/Actions/component/Group/PopoverContent.js +11 -7
  47. package/es/components/table/Actions/index.d.ts +3 -2
  48. package/es/components/table/Actions/index.js +12 -8
  49. package/es/components/table/BasicTable/index.js +11 -1
  50. package/es/components/table/Table/index.js +6 -0
  51. package/es/components/table/Table/utils.d.ts +1 -1
  52. package/es/components/table/hooks/useTableSetting.d.ts +2 -1
  53. package/es/components/table/hooks/useTableSetting.js +2 -1
  54. package/es/components/table/index.js +15 -13
  55. package/es/components/table/model.d.ts +2 -0
  56. package/es/components/table/model.js +15 -1
  57. package/es/components/table/serve.d.ts +11 -0
  58. package/es/components/table/serve.js +38 -0
  59. package/es/components/table/status.d.ts +19 -0
  60. package/es/components/table/status.js +26 -0
  61. package/es/components/table/types.d.ts +21 -0
  62. package/es/components/table/utils.d.ts +15 -0
  63. package/es/components/table/utils.js +26 -0
  64. package/es/components/virtual-keyboard/Time/index.js +1 -1
  65. package/es/locales/en-US.d.ts +46 -0
  66. package/es/locales/en-US.js +59 -1
  67. package/es/locales/zh-CN.d.ts +46 -0
  68. package/es/locales/zh-CN.js +59 -1
  69. package/es/locales/zh-TW.d.ts +46 -0
  70. package/es/locales/zh-TW.js +59 -1
  71. package/lib/components/MultipleContainersSortList/index.d.ts +5 -5
  72. package/lib/components/MultipleContainersSortList/index.js +16 -11
  73. package/lib/components/Pagination/index.d.ts +1 -1
  74. package/lib/components/filter/components/FilterItem/index.js +11 -2
  75. package/lib/components/filter/components/QuickFilter/index.js +2 -1
  76. package/lib/components/filter/types.d.ts +1 -0
  77. package/lib/components/sort/index.js +4 -9
  78. package/lib/components/sort/index.less +3 -0
  79. package/lib/components/sort/types.d.ts +1 -0
  80. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
  81. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +150 -0
  82. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
  83. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
  84. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +78 -0
  85. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
  86. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.js +60 -0
  87. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
  88. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
  89. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +117 -0
  90. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +7 -0
  91. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +141 -0
  92. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
  93. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
  94. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +124 -0
  95. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
  96. package/lib/components/table/Actions/component/ExportImport/index.d.ts +8 -0
  97. package/lib/components/table/Actions/component/ExportImport/index.js +213 -0
  98. package/lib/components/table/Actions/component/ExportImport/index.less +194 -0
  99. package/lib/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
  100. package/lib/components/table/Actions/component/ExportImport/utils/date.js +49 -0
  101. package/lib/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
  102. package/lib/components/table/Actions/component/ExportImport/utils/download.js +62 -0
  103. package/lib/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
  104. package/lib/components/table/Actions/component/ExportImport/utils/file.js +55 -0
  105. package/lib/components/table/Actions/component/Group/PopoverContent.d.ts +2 -2
  106. package/lib/components/table/Actions/component/Group/PopoverContent.js +2 -1
  107. package/lib/components/table/Actions/index.d.ts +3 -2
  108. package/lib/components/table/Actions/index.js +11 -7
  109. package/lib/components/table/BasicTable/index.js +9 -0
  110. package/lib/components/table/Table/index.js +6 -0
  111. package/lib/components/table/Table/utils.d.ts +1 -1
  112. package/lib/components/table/hooks/useTableSetting.d.ts +2 -1
  113. package/lib/components/table/hooks/useTableSetting.js +2 -1
  114. package/lib/components/table/index.js +14 -12
  115. package/lib/components/table/model.d.ts +2 -0
  116. package/lib/components/table/model.js +11 -1
  117. package/lib/components/table/serve.d.ts +11 -0
  118. package/lib/components/table/serve.js +41 -0
  119. package/lib/components/table/status.d.ts +19 -0
  120. package/lib/components/table/status.js +55 -0
  121. package/lib/components/table/types.d.ts +21 -0
  122. package/lib/components/table/utils.d.ts +15 -0
  123. package/lib/components/table/utils.js +40 -0
  124. package/lib/components/virtual-keyboard/Time/index.js +1 -1
  125. package/lib/locales/en-US.d.ts +46 -0
  126. package/lib/locales/en-US.js +51 -1
  127. package/lib/locales/zh-CN.d.ts +46 -0
  128. package/lib/locales/zh-CN.js +51 -1
  129. package/lib/locales/zh-TW.d.ts +46 -0
  130. package/lib/locales/zh-TW.js +51 -1
  131. package/lowcode/table/meta.ts +117 -1
  132. package/lowcode/table/snippets.ts +14 -0
  133. package/package.json +3 -3
@@ -0,0 +1,236 @@
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import ImportExport from "@pisell/icon/es/ImportExport";
12
+ import { useRequest } from "ahooks";
13
+ import { Dropdown, Modal, message } from "antd";
14
+ import React, { useMemo, useState } from "react";
15
+ import useEngineContext from "../../../../../hooks/useEngineContext";
16
+ import { getText } from "../../../../../locales/index";
17
+ import { batchImport } from "../../../serve";
18
+ import { defaultOptions, exportImportOptions } from "../../../status";
19
+ import { request } from "../../../utils";
20
+ import ButtonIcon from "../ButtonIcon";
21
+ import ExportFile from "./components/ExportFile";
22
+ import ExportTable from "./components/ExportTable";
23
+ import { batchExport } from "./components/ExportTable/function";
24
+ import ImportLog from "./components/ImportLog";
25
+ import ImportTable from "./components/ImportTable";
26
+ import { useSharedState } from "../../../../../hooks";
27
+ import { getCurrentLocale } from "../../../../../utils/locale";
28
+ import { Context } from "../../../model";
29
+ import "./index.less";
30
+ var Com = {
31
+ import: ImportTable,
32
+ export: ExportTable,
33
+ export_file: ExportFile,
34
+ import_log: ImportLog
35
+ };
36
+ var ExportImport = function ExportImport(_ref) {
37
+ var _context$appHelper, _context$appHelper$ut;
38
+ var exportImport = _ref.exportImport;
39
+ var _useState = useState(false),
40
+ _useState2 = _slicedToArray(_useState, 2),
41
+ open = _useState2[0],
42
+ setOpen = _useState2[1];
43
+ var _useState3 = useState(null),
44
+ _useState4 = _slicedToArray(_useState3, 2),
45
+ file = _useState4[0],
46
+ setFile = _useState4[1];
47
+ var _useState5 = useState(defaultOptions.exportType),
48
+ _useState6 = _slicedToArray(_useState5, 2),
49
+ type = _useState6[0],
50
+ setType = _useState6[1];
51
+ var _useState7 = useState(""),
52
+ _useState8 = _slicedToArray(_useState7, 2),
53
+ value = _useState8[0],
54
+ setValue = _useState8[1];
55
+ var _useState9 = useState(),
56
+ _useState10 = _slicedToArray(_useState9, 2),
57
+ errorStatus = _useState10[0],
58
+ setErrorStatus = _useState10[1];
59
+ var _useSharedState = useSharedState(Context),
60
+ state = _useSharedState.state;
61
+ var originResultDataSource = state.originResultDataSource,
62
+ currentDataSource = state.currentDataSource;
63
+ var context = useEngineContext();
64
+ request.setRequest((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.request);
65
+ var _items = useMemo(function () {
66
+ // 将对象转成数组
67
+ var result = Object.entries(exportImportOptions).map(function (_ref2) {
68
+ var _ref3 = _slicedToArray(_ref2, 2),
69
+ key = _ref3[0],
70
+ value = _ref3[1];
71
+ return {
72
+ key: key,
73
+ label: value
74
+ };
75
+ });
76
+ return result;
77
+ }, []);
78
+ var Content = useMemo(function () {
79
+ var _value = value || defaultOptions.importValue;
80
+ return Com[_value];
81
+ }, [value, defaultOptions.importValue]);
82
+ var _footer = useMemo(function () {
83
+ var types = defaultOptions.footerHintTypes;
84
+ if (types.includes(value)) {
85
+ return null;
86
+ }
87
+ }, [value]);
88
+ var _width = useMemo(function () {
89
+ var types = defaultOptions.footerHintTypes;
90
+ return types.includes(value) ? 900 : defaultOptions.importValue ? 600 : 400;
91
+ }, [value]);
92
+ var _title = useMemo(function () {
93
+ if (!value) return null;
94
+ var types = defaultOptions.okShowButtonTypes;
95
+ var lang = getCurrentLocale();
96
+ var isEn = lang === "en-US" || lang === "en";
97
+
98
+ // 导出导入标题
99
+ if (types.includes(value) && exportImport !== null && exportImport !== void 0 && exportImport.title) {
100
+ return "".concat(exportImportOptions[value]).concat(isEn ? " " : "").concat(exportImport.title);
101
+ }
102
+ return exportImportOptions[value];
103
+ }, [value, exportImport === null || exportImport === void 0 ? void 0 : exportImport.title]);
104
+ var _okText = useMemo(function () {
105
+ var types = defaultOptions.okShowButtonTypes;
106
+ if (types.includes(value)) {
107
+ return value === defaultOptions.exportValue ? getText("table-action-export-import-button") : getText("table-action-export-import-button-import");
108
+ }
109
+ }, [value]);
110
+ var handleClick = function handleClick(e) {
111
+ var value = e.key;
112
+ setValue(value);
113
+ setOpen(true);
114
+ };
115
+ var onCancel = function onCancel() {
116
+ setOpen(false);
117
+ setValue("");
118
+ setFile(null);
119
+ setErrorStatus(null);
120
+ setType(defaultOptions.exportType);
121
+ };
122
+ var _batchImport = useRequest(batchImport, {
123
+ manual: true,
124
+ debounceWait: 200,
125
+ onSuccess: function onSuccess() {
126
+ setErrorStatus(null);
127
+ message.destroy();
128
+ message.success({
129
+ content: getText("table-action-export-import-import-success"),
130
+ key: value
131
+ });
132
+ onCancel();
133
+ },
134
+ onError: function onError(err) {
135
+ message.destroy();
136
+ setErrorStatus((err === null || err === void 0 ? void 0 : err.message) || null);
137
+ }
138
+ });
139
+ var onOk = /*#__PURE__*/function () {
140
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
141
+ var formId, formCode, _params, result, formData;
142
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
143
+ while (1) switch (_context.prev = _context.next) {
144
+ case 0:
145
+ formId = exportImport.formId, formCode = exportImport.formCode; // 导出
146
+ if (!(value === defaultOptions.exportValue)) {
147
+ _context.next = 9;
148
+ break;
149
+ }
150
+ _params = {
151
+ type: type,
152
+ originDataSource: originResultDataSource,
153
+ currentDataSource: currentDataSource
154
+ };
155
+ _context.next = 5;
156
+ return batchExport(_params, exportImport);
157
+ case 5:
158
+ result = _context.sent;
159
+ if (result) {
160
+ onCancel();
161
+ }
162
+ _context.next = 10;
163
+ break;
164
+ case 9:
165
+ if (value === defaultOptions.importValue) {
166
+ formData = new FormData();
167
+ formData.append("file", file);
168
+ if (formId) {
169
+ formData.append("form_id", formId);
170
+ }
171
+ if (formCode) {
172
+ formData.append("code", formCode);
173
+ }
174
+ if (formData) {
175
+ message.loading({
176
+ content: "Loading...",
177
+ key: value
178
+ });
179
+ _batchImport.run(formData);
180
+ }
181
+ }
182
+ case 10:
183
+ case "end":
184
+ return _context.stop();
185
+ }
186
+ }, _callee);
187
+ }));
188
+ return function onOk() {
189
+ return _ref4.apply(this, arguments);
190
+ };
191
+ }();
192
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dropdown, {
193
+ menu: {
194
+ items: _items,
195
+ selectable: true,
196
+ onClick: handleClick
197
+ },
198
+ placement: "bottomRight"
199
+ }, /*#__PURE__*/React.createElement(ButtonIcon, {
200
+ isActive: false
201
+ }, /*#__PURE__*/React.createElement(ImportExport, {
202
+ style: {
203
+ cursor: "pointer",
204
+ fontSize: 20
205
+ }
206
+ }))), /*#__PURE__*/React.createElement(Modal, {
207
+ title: _title,
208
+ footer: _footer,
209
+ width: _width,
210
+ okText: _okText,
211
+ open: open,
212
+ className: "export-import-modal",
213
+ onCancel: onCancel,
214
+ bodyStyle: {
215
+ padding: "0px"
216
+ },
217
+ destroyOnClose: true,
218
+ onOk: onOk,
219
+ cancelText: getText("table-action-export-import-cancel"),
220
+ okButtonProps: {
221
+ disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
222
+ }
223
+ }, /*#__PURE__*/React.createElement(Content, {
224
+ exportImport: exportImport,
225
+ errorStatus: errorStatus,
226
+ onChange: function onChange(e) {
227
+ if (value === defaultOptions.importValue) {
228
+ setFile(e);
229
+ setErrorStatus(null);
230
+ } else if (value === defaultOptions.exportValue) {
231
+ setType(e);
232
+ }
233
+ }
234
+ })));
235
+ };
236
+ export default ExportImport;
@@ -0,0 +1,194 @@
1
+ .export-import-modal{
2
+ .pisell-lowcode-modal-header{
3
+ padding: 0 0 6px 0!important;
4
+ }
5
+
6
+ .pisell-lowcode-table-content{
7
+ .pisell-lowcode-table-cell{
8
+ padding: 16px!important;
9
+ }
10
+ }
11
+ }
12
+
13
+ .goods-list-page {
14
+ padding: 0 30px;
15
+
16
+ .header {
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: space-between;
20
+ padding: 22px 0;
21
+ font-size: 20px;
22
+ font-weight: 650;
23
+ line-height: 28px;
24
+ color: #252a2d;
25
+
26
+ .action-list {
27
+ display: flex;
28
+ align-items: center;
29
+ min-height: 40px;
30
+
31
+ .import-btn,
32
+ .export-btn {
33
+ height: 28px;
34
+ font-size: 14px;
35
+ font-weight: 650;
36
+ line-height: 28px;
37
+ color: #252a2d;
38
+ cursor: pointer;
39
+ }
40
+ }
41
+ }
42
+
43
+ .content {
44
+ padding: 20px 0;
45
+ background: #ffffff;
46
+ border-radius: var(--small-border-radius);
47
+
48
+ .search-wrap {
49
+ width: 100%;
50
+ box-sizing: border-box;
51
+ padding: 10px 32px 0 32px;
52
+ display: flex;
53
+ align-items: center;
54
+
55
+ .search-input {
56
+ flex: 1;
57
+ margin-right: 20px;
58
+ }
59
+
60
+ &.phone-wrap {
61
+ flex-direction: column;
62
+ align-items: flex-end;
63
+
64
+ .search-input {
65
+ width: 100%;
66
+ margin-bottom: 16px;
67
+ margin-right: 0;
68
+ }
69
+ }
70
+ }
71
+
72
+ .cover-wrap {
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ overflow: hidden;
77
+ width: 64px;
78
+ height: 64px;
79
+ opacity: 1;
80
+ border-radius: 2px;
81
+ margin: 0 auto;
82
+
83
+ img {
84
+ width: 100%;
85
+ }
86
+ }
87
+
88
+ .goods-status {
89
+ display: inline-block;
90
+ min-width: 58px;
91
+ border-radius: 16px;
92
+ font-size: 13px;
93
+
94
+ text-align: center;
95
+ padding: 2px 8px;
96
+
97
+ &.release {
98
+ background: #6fa629;
99
+ color: #ffffff;
100
+ }
101
+
102
+ &.pending {
103
+ background: #ec808d;
104
+ color: #fff;
105
+ }
106
+
107
+ &.archived {
108
+ background: #e4e5e7;
109
+ color: #252a2d;
110
+ }
111
+
112
+ &.draft {
113
+ background: #a4e8f2;
114
+ color: #202223;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ .spin {
121
+ :global {
122
+ .ant-spin {
123
+ max-height: 10000px !important;
124
+ }
125
+ }
126
+ }
127
+
128
+ .empty-wrap {
129
+ min-height: 550px;
130
+
131
+ .empty-content {
132
+ display: flex;
133
+ align-items: center;
134
+ flex-direction: column;
135
+ height: 550px;
136
+ background: #ffffff;
137
+ border-radius: 4px;
138
+
139
+ .icon {
140
+ font-size: 170px;
141
+ margin-top: 70px;
142
+ }
143
+
144
+ .title {
145
+ margin-top: 40px;
146
+ height: 22px;
147
+ font-size: 16px;
148
+ font-weight: 650;
149
+ line-height: 28px;
150
+ color: #252a2d;
151
+ }
152
+
153
+ .describe {
154
+ margin-top: 22px;
155
+ margin-bottom: 9px;
156
+ max-width: 390px;
157
+ height: 86px;
158
+ font-size: 14px;
159
+
160
+ font-weight: 400;
161
+ line-height: 22px;
162
+ color: #707070;
163
+ }
164
+ }
165
+ }
166
+
167
+ .footer {
168
+ margin-top: 30px;
169
+ height: 17px;
170
+ font-size: 12px;
171
+
172
+ font-weight: 400;
173
+ line-height: 17px;
174
+ color: #8c8c8c;
175
+ text-align: center;
176
+ }
177
+
178
+ .phone-wrap {
179
+ padding: 0 16px;
180
+
181
+ .content {
182
+ .search-wrap {
183
+ padding: 10px 16px 0 16px;
184
+ }
185
+
186
+ .list-wrap {
187
+ padding: 16px;
188
+ }
189
+ }
190
+ }
191
+
192
+ .list-wrap {
193
+ padding: 20px 32px;
194
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @Title: 格式化日期
3
+ * @Describe:
4
+ * @Author: Wzw
5
+ * @param {string} date
6
+ * @param {string} format
7
+ */
8
+ export declare const formatDate: (date: any, format?: string[]) => any;
@@ -0,0 +1,19 @@
1
+ import dayjs from 'dayjs';
2
+ import { getCurrentLocale } from "../../../../../../utils/locale";
3
+
4
+ /**
5
+ * @Title: 格式化日期
6
+ * @Describe:
7
+ * @Author: Wzw
8
+ * @param {string} date
9
+ * @param {string} format
10
+ */
11
+ export var formatDate = function formatDate(date, format) {
12
+ if (!date) {
13
+ return date;
14
+ }
15
+ var lang = getCurrentLocale();
16
+ var _format = format || ['HH:mm:ss DD/MM/YYYY', 'YYYY-MM-DD HH:mm:ss'];
17
+ var type = lang === 'en-US' || lang === 'en' ? _format[0] : _format[1];
18
+ return dayjs(date).format(type);
19
+ };
@@ -0,0 +1,3 @@
1
+ export declare const windowOpen: (url: string, target?: string) => void;
2
+ declare const _default: (sUrl: string, fileName?: string) => boolean;
3
+ export default _default;
@@ -0,0 +1,39 @@
1
+ // 兼容ios的window.open的跳转
2
+ export var windowOpen = function windowOpen(url, target) {
3
+ var oWindow = window.open('', target || '_blank');
4
+ oWindow.location = url;
5
+ };
6
+ export default (function (sUrl, fileName) {
7
+ var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
8
+ var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
9
+ //iOS channelList do not support downloading. We have to inform user about this.
10
+ if (/(iP)/g.test(navigator.userAgent)) {
11
+ alert('Your device does not support files downloading. Please try again in desktop browser.');
12
+ return false;
13
+ }
14
+ //If in Chrome or Safari - download via virtual link click
15
+ if (isChrome || isSafari) {
16
+ //Creating new link node.
17
+ var link = document.createElement('a');
18
+ link.href = sUrl;
19
+ if (link.download !== undefined) {
20
+ //Set HTML5 download attribute. This will prevent file from opening if supported.
21
+ var _fileName = fileName || sUrl.substring(sUrl.lastIndexOf('/') + 1, sUrl.length);
22
+ link.download = _fileName;
23
+ }
24
+
25
+ //Dispatching click event.
26
+ if (document.createEvent) {
27
+ var e = document.createEvent('MouseEvents');
28
+ e.initEvent('click', true, true);
29
+ link.dispatchEvent(e);
30
+ return true;
31
+ }
32
+ }
33
+ // Force file download (whether supported by server).
34
+ if (sUrl.indexOf('?') === -1) {
35
+ sUrl += '?download';
36
+ }
37
+ windowOpen(sUrl, '_self');
38
+ return true;
39
+ });
@@ -0,0 +1,7 @@
1
+ export declare const getFileDateName: () => string;
2
+ /**
3
+ * @Title: 复制内容
4
+ * @Describe:
5
+ * @Author: Wzw
6
+ */
7
+ export declare const copyText: (text: string) => void;
@@ -0,0 +1,21 @@
1
+ import dayjs from 'dayjs';
2
+ import { message } from 'antd';
3
+ import { getText } from "../../../../../../locales/index";
4
+ export var getFileDateName = function getFileDateName() {
5
+ return '-' + dayjs().format('YYYY-MM-DD-HH-mm-ss');
6
+ };
7
+
8
+ /**
9
+ * @Title: 复制内容
10
+ * @Describe:
11
+ * @Author: Wzw
12
+ */
13
+ export var copyText = function copyText(text) {
14
+ var input = document.createElement('input');
15
+ input.setAttribute('value', text);
16
+ document.body.appendChild(input);
17
+ input.select();
18
+ document.execCommand('copy');
19
+ document.body.removeChild(input);
20
+ message.success(getText('table-action-export-import-table-success-copy'));
21
+ };
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import "./PopoverContent.less";
1
+ import React from 'react';
2
+ import './PopoverContent.less';
3
3
  declare type FieldType = string | number;
4
4
  export declare type GroupValue = {
5
5
  field: FieldType;
@@ -1,9 +1,9 @@
1
- import React, { useMemo } from "react";
2
- import { Select, Tooltip } from "antd";
3
- import HelpCircle from "@pisell/icon/es/HelpCircle";
1
+ import React, { useMemo } from 'react';
2
+ import { Select, Tooltip } from 'antd';
3
+ import HelpCircle from '@pisell/icon/es/HelpCircle';
4
4
  import { getText } from "../../../../../locales";
5
5
  import "./PopoverContent.less";
6
- var prefix = "pisell-lowcode-";
6
+ var prefix = 'pisell-lowcode-';
7
7
  var PopoverContent = function PopoverContent(props) {
8
8
  var columns = props.columns,
9
9
  _props$value = props.value,
@@ -20,7 +20,11 @@ var PopoverContent = function PopoverContent(props) {
20
20
  }]);
21
21
  };
22
22
  var options = useMemo(function () {
23
- return (columns || []).map(function (item) {
23
+ // 是否开启了隐藏
24
+ var _lists = (columns || []).filter(function (item) {
25
+ return !(item !== null && item !== void 0 && item.isHidden);
26
+ });
27
+ return _lists.map(function (item) {
24
28
  return {
25
29
  label: item.label,
26
30
  value: "".concat(item.name)
@@ -33,8 +37,8 @@ var PopoverContent = function PopoverContent(props) {
33
37
  className: "".concat(prefix, "table-action-group-header")
34
38
  }, /*#__PURE__*/React.createElement("span", {
35
39
  className: "".concat(prefix, "table-action-group-header-title")
36
- }, getText("table-action-group-by-title")), /*#__PURE__*/React.createElement(Tooltip, {
37
- title: getText("table-action-group-by-title-tip")
40
+ }, getText('table-action-group-by-title')), /*#__PURE__*/React.createElement(Tooltip, {
41
+ title: getText('table-action-group-by-title-tip')
38
42
  }, /*#__PURE__*/React.createElement(HelpCircle, null))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
39
43
  options: options,
40
44
  value: firstValue.field,
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FilterType } from "../../filter/types";
3
- import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, SortType } from "../types";
3
+ import { ColumnSettingType, DataSourceGroupType, ExportImportType, GallerySettingType, GridViewType, SortType } from "../types";
4
4
  import "./index.less";
5
5
  declare type ActionsProps = {
6
6
  filter: FilterType;
@@ -12,6 +12,7 @@ declare type ActionsProps = {
12
12
  buttons: any[];
13
13
  view: GridViewType;
14
14
  gallery: GallerySettingType;
15
+ exportImport?: ExportImportType;
15
16
  };
16
- declare const Actions: ({ filter, sort, columnSetting, dataSourceGroup, tableId, localPagination, buttons, view, gallery, }: ActionsProps) => React.JSX.Element | null;
17
+ declare const Actions: ({ filter, sort, columnSetting, dataSourceGroup, tableId, localPagination, buttons, view, gallery, exportImport, }: ActionsProps) => React.JSX.Element | null;
17
18
  export default Actions;