@quansitech/antd-admin 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/components/Column/Cascader.d.ts +3 -0
  2. package/dist/components/Column/Cascader.js +110 -0
  3. package/dist/components/Column/File.d.ts +18 -0
  4. package/dist/components/Column/File.js +176 -0
  5. package/dist/components/Column/Image.d.ts +10 -0
  6. package/dist/components/Column/Image.js +104 -0
  7. package/dist/components/Column/Readonly/Action/Link.d.ts +11 -0
  8. package/dist/components/Column/Readonly/Action/Link.js +114 -0
  9. package/dist/components/Column/Readonly/Action/index.d.ts +4 -0
  10. package/dist/components/Column/Readonly/Action/index.js +3 -0
  11. package/dist/components/Column/Readonly/Action.d.ts +12 -0
  12. package/dist/components/Column/Readonly/Action.js +96 -0
  13. package/dist/components/Column/Readonly/Cascader.d.ts +9 -0
  14. package/dist/components/Column/Readonly/Cascader.js +52 -0
  15. package/dist/components/Column/Readonly/File.d.ts +8 -0
  16. package/dist/components/Column/Readonly/File.js +54 -0
  17. package/dist/components/Column/Readonly/Image.d.ts +3 -0
  18. package/dist/components/Column/Readonly/Image.js +69 -0
  19. package/dist/components/Column/Readonly/Ueditor.d.ts +3 -0
  20. package/dist/components/Column/Readonly/Ueditor.js +24 -0
  21. package/dist/components/Column/Readonly/index.d.ts +8 -0
  22. package/dist/components/Column/Readonly/index.js +7 -0
  23. package/dist/components/Column/Ueditor.d.ts +27 -0
  24. package/dist/components/Column/Ueditor.js +333 -0
  25. package/dist/components/Column/index.d.ts +7 -0
  26. package/dist/components/Column/index.js +6 -0
  27. package/dist/components/Form/Action/Button.d.ts +15 -0
  28. package/dist/components/Form/Action/Button.js +194 -0
  29. package/dist/components/Form/Action/index.d.ts +4 -0
  30. package/dist/components/Form/Action/index.js +3 -0
  31. package/dist/components/Form/Actions.d.ts +6 -0
  32. package/dist/components/Form/Actions.js +48 -0
  33. package/dist/components/Form.d.ts +20 -0
  34. package/dist/components/Form.js +217 -0
  35. package/dist/components/FormContext.d.ts +7 -0
  36. package/dist/components/FormContext.js +2 -0
  37. package/dist/components/Layout/New.d.ts +7 -0
  38. package/dist/components/Layout/New.js +257 -0
  39. package/dist/components/Layout.d.ts +4 -0
  40. package/dist/components/Layout.js +67 -0
  41. package/dist/components/LayoutContext.d.ts +26 -0
  42. package/dist/components/LayoutContext.js +2 -0
  43. package/dist/components/ModalContext.d.ts +8 -0
  44. package/dist/components/ModalContext.js +6 -0
  45. package/dist/components/Table/Action/Button.d.ts +10 -0
  46. package/dist/components/Table/Action/Button.js +166 -0
  47. package/dist/components/Table/Action/StartEditable.d.ts +10 -0
  48. package/dist/components/Table/Action/StartEditable.js +79 -0
  49. package/dist/components/Table/Action/index.d.ts +5 -0
  50. package/dist/components/Table/Action/index.js +4 -0
  51. package/dist/components/Table/ToolbarActions.d.ts +6 -0
  52. package/dist/components/Table/ToolbarActions.js +52 -0
  53. package/dist/components/Table.d.ts +19 -0
  54. package/dist/components/Table.js +322 -0
  55. package/dist/components/TableContext.d.ts +14 -0
  56. package/dist/components/TableContext.js +2 -0
  57. package/dist/components/Tabs.d.ts +15 -0
  58. package/dist/components/Tabs.js +62 -0
  59. package/dist/env.d.ts +1 -0
  60. package/dist/global.d.ts +6 -0
  61. package/dist/index.d.ts +7 -0
  62. package/dist/index.js +7 -0
  63. package/dist/lib/container.d.ts +9 -0
  64. package/dist/lib/container.js +93 -0
  65. package/dist/lib/customRule.d.ts +3 -0
  66. package/dist/lib/customRule.js +7 -0
  67. package/dist/lib/global.d.ts +9 -0
  68. package/dist/lib/global.js +2 -0
  69. package/dist/lib/helpers.d.ts +14 -0
  70. package/dist/lib/helpers.js +183 -0
  71. package/dist/lib/http.d.ts +5 -0
  72. package/dist/lib/http.js +72 -0
  73. package/dist/lib/schemaHandler.d.ts +5 -0
  74. package/dist/lib/schemaHandler.js +133 -0
  75. package/dist/lib/upload.d.ts +20 -0
  76. package/dist/lib/upload.js +215 -0
  77. package/dist/lib/writeExtra.d.ts +1 -0
  78. package/dist/lib/writeExtra.js +28 -0
  79. package/dist/types.d.ts +25 -0
  80. package/package.json +13 -6
  81. package/components/Column/Cascader.tsx +0 -79
  82. package/components/Column/File.tsx +0 -166
  83. package/components/Column/Image.tsx +0 -77
  84. package/components/Column/Readonly/Action/Link.tsx +0 -78
  85. package/components/Column/Readonly/Action.tsx +0 -80
  86. package/components/Column/Readonly/Cascader.tsx +0 -51
  87. package/components/Column/Readonly/File.tsx +0 -53
  88. package/components/Column/Readonly/Image.tsx +0 -39
  89. package/components/Column/Readonly/Ueditor.tsx +0 -18
  90. package/components/Column/Ueditor.tsx +0 -314
  91. package/components/Form/Action/Button.tsx +0 -129
  92. package/components/Form/Actions.tsx +0 -39
  93. package/components/Form.tsx +0 -177
  94. package/components/FormContext.ts +0 -9
  95. package/components/Layout/New.tsx +0 -251
  96. package/components/Layout.tsx +0 -52
  97. package/components/LayoutContext.ts +0 -26
  98. package/components/ModalContext.ts +0 -16
  99. package/components/Table/Action/Button.tsx +0 -89
  100. package/components/Table/Action/StartEditable.tsx +0 -59
  101. package/components/Table/ToolbarActions.tsx +0 -44
  102. package/components/Table.tsx +0 -280
  103. package/components/TableContext.ts +0 -15
  104. package/components/Tabs.tsx +0 -72
  105. package/lib/container.ts +0 -84
  106. package/lib/customRule.ts +0 -10
  107. package/lib/global.ts +0 -11
  108. package/lib/helpers.tsx +0 -149
  109. package/lib/http.ts +0 -74
  110. package/lib/schemaHandler.ts +0 -122
  111. package/lib/upload.ts +0 -177
  112. package/lib/writeExtra.js +0 -31
  113. /package/{components → dist/components}/Column/Readonly/Action/types.d.ts +0 -0
  114. /package/{components → dist/components}/Column/Readonly/types.d.ts +0 -0
  115. /package/{components → dist/components}/Column/types.d.ts +0 -0
  116. /package/{components → dist/components}/Form/Action/types.d.ts +0 -0
  117. /package/{components → dist/components}/Table/Action/types.d.ts +0 -0
  118. /package/{components → dist/components}/Table.scss +0 -0
  119. /package/{components → dist/components}/types.d.ts +0 -0
@@ -0,0 +1,114 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ 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); } }
9
+ 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); }); }; }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
+ 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; }
14
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ import React, { useContext, useState } from "react";
17
+ import { modalShow, replaceParams, replaceUrl, routerNavigateTo } from "../../../../lib/helpers";
18
+ import { Button, Popconfirm, Spin } from "antd";
19
+ import { TableContext } from "../../../TableContext";
20
+ import http from "../../../../lib/http";
21
+ export default function (props) {
22
+ var _props$request, _props$request2;
23
+ var _useState = useState(false),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ loading = _useState2[0],
26
+ setLoading = _useState2[1];
27
+ var tableContext = useContext(TableContext);
28
+ var onClick = /*#__PURE__*/function () {
29
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
30
+ var _tableContext$actionR, url, m;
31
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
32
+ while (1) switch (_context.prev = _context.next) {
33
+ case 0:
34
+ setLoading(true);
35
+ _context.prev = 1;
36
+ if (!props.href) {
37
+ _context.next = 5;
38
+ break;
39
+ }
40
+ routerNavigateTo(replaceUrl(props.href, props.record));
41
+ return _context.abrupt("return");
42
+ case 5:
43
+ if (!props.request) {
44
+ _context.next = 10;
45
+ break;
46
+ }
47
+ _context.next = 8;
48
+ return http({
49
+ method: props.request.method,
50
+ url: replaceUrl(props.request.url, props.record),
51
+ headers: props.request.headers || {},
52
+ data: props.request.data ? replaceParams(props.request.data, props.record) : null
53
+ });
54
+ case 8:
55
+ _context.next = 10;
56
+ return (_tableContext$actionR = tableContext.actionRef) === null || _tableContext$actionR === void 0 ? void 0 : _tableContext$actionR.reload();
57
+ case 10:
58
+ if (!props.modal) {
59
+ _context.next = 14;
60
+ break;
61
+ }
62
+ if (props.modal.content.url) {
63
+ url = replaceUrl(props.modal.content.url, props.record);
64
+ }
65
+ _context.next = 14;
66
+ return modalShow(_objectSpread(_objectSpread({}, props.modal), {}, {
67
+ contexts: {
68
+ tableContext: tableContext
69
+ },
70
+ content: _objectSpread(_objectSpread({}, props.modal.content), {}, {
71
+ url: url
72
+ })
73
+ }));
74
+ case 14:
75
+ if (!props.modalByField) {
76
+ _context.next = 18;
77
+ break;
78
+ }
79
+ m = props.record[props.modalByField];
80
+ _context.next = 18;
81
+ return modalShow(_objectSpread(_objectSpread({}, m), {}, {
82
+ contexts: {
83
+ tableContext: tableContext
84
+ }
85
+ }));
86
+ case 18:
87
+ _context.prev = 18;
88
+ setLoading(false);
89
+ return _context.finish(18);
90
+ case 21:
91
+ case "end":
92
+ return _context.stop();
93
+ }
94
+ }, _callee, null, [[1,, 18, 21]]);
95
+ }));
96
+ return function onClick(_x) {
97
+ return _ref.apply(this, arguments);
98
+ };
99
+ }();
100
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spin, {
101
+ spinning: loading
102
+ }, (_props$request = props.request) !== null && _props$request !== void 0 && _props$request.confirm ? /*#__PURE__*/React.createElement(Popconfirm, {
103
+ title: (_props$request2 = props.request) === null || _props$request2 === void 0 ? void 0 : _props$request2.confirm,
104
+ onConfirm: onClick
105
+ }, /*#__PURE__*/React.createElement(Button, {
106
+ type: "link",
107
+ danger: props.danger,
108
+ onClick: function onClick() {}
109
+ }, props.title)) : /*#__PURE__*/React.createElement(Button, {
110
+ type: "link",
111
+ danger: props.danger,
112
+ onClick: onClick
113
+ }, props.title)));
114
+ }
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ Link: Promise<typeof import("./Link")>;
3
+ };
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export default {
2
+ Link: import("./Link")
3
+ };
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { ColumnReadonlyProps } from "./types";
3
+ import { Rules } from "@rc-component/async-validator/lib/interface";
4
+ declare const _default: ({ actions, record }: ColumnReadonlyProps & {
5
+ actions?: {
6
+ type: string;
7
+ title: string;
8
+ showRules?: Rules;
9
+ badge?: any;
10
+ }[];
11
+ }) => React.JSX.Element;
12
+ export default _default;
@@ -0,0 +1,96 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ 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."); }
13
+ 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); }
14
+ 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; }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+ import React, { lazy, useEffect, useState } from "react";
18
+ import container from "../../../lib/container";
19
+ import { Badge, Flex } from "antd";
20
+ import { asyncFilter, handleRules } from "../../../lib/helpers";
21
+ import { upperFirst } from "es-toolkit";
22
+ export default (function (_ref) {
23
+ var actions = _ref.actions,
24
+ record = _ref.record;
25
+ var _useState = useState([]),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ Components = _useState2[0],
28
+ setComponents = _useState2[1];
29
+ useEffect(function () {
30
+ if (actions) {
31
+ asyncFilter(actions, /*#__PURE__*/function () {
32
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(Component) {
33
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34
+ while (1) switch (_context.prev = _context.next) {
35
+ case 0:
36
+ if (Component.showRules) {
37
+ _context.next = 2;
38
+ break;
39
+ }
40
+ return _context.abrupt("return", true);
41
+ case 2:
42
+ _context.next = 4;
43
+ return handleRules(Component.showRules, record);
44
+ case 4:
45
+ return _context.abrupt("return", _context.sent);
46
+ case 5:
47
+ case "end":
48
+ return _context.stop();
49
+ }
50
+ }, _callee);
51
+ }));
52
+ return function (_x) {
53
+ return _ref2.apply(this, arguments);
54
+ };
55
+ }()).then(function (Components) {
56
+ return setComponents(Components.map(function (a) {
57
+ var badge = a.badge;
58
+ var matches = (badge + '').match(/^__(\w+)__$/);
59
+ if (matches) {
60
+ badge = record[matches[1]];
61
+ }
62
+ var c = "Column.Readonly.Action.".concat(upperFirst(a.type));
63
+ return {
64
+ props: _objectSpread(_objectSpread({}, a), {}, {
65
+ record: record,
66
+ badge: badge
67
+ }),
68
+ component: /*#__PURE__*/lazy(function () {
69
+ return container.get(c);
70
+ })
71
+ };
72
+ }));
73
+ });
74
+ }
75
+ }, []);
76
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flex, {
77
+ wrap: true
78
+ }, Components.map(function (Component) {
79
+ return Component.props.badge ? /*#__PURE__*/React.createElement(Badge, {
80
+ key: Component.props.title,
81
+ count: Component.props.badge,
82
+ offset: [-12, 6],
83
+ size: 'small',
84
+ styles: {
85
+ indicator: {
86
+ zIndex: 100,
87
+ padding: '0 4px'
88
+ }
89
+ }
90
+ }, /*#__PURE__*/React.createElement(Component.component, _extends({
91
+ key: Component.props.title
92
+ }, Component.props))) : /*#__PURE__*/React.createElement(Component.component, _extends({
93
+ key: Component.props.title
94
+ }, Component.props));
95
+ })));
96
+ });
@@ -0,0 +1,9 @@
1
+ import { ColumnReadonlyProps } from "./types";
2
+ import React from "react";
3
+ export default function (props: ColumnReadonlyProps & {
4
+ schema: {
5
+ fieldProps: {
6
+ loadDataUrl: string;
7
+ };
8
+ };
9
+ }): React.JSX.Element;
@@ -0,0 +1,52 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useEffect, useState } from "react";
12
+ import http from "../../../lib/http";
13
+ export default function (props) {
14
+ var _useState = useState('-'),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ text = _useState2[0],
17
+ setText = _useState2[1];
18
+ useEffect(function () {
19
+ var _props$schema$fieldPr;
20
+ setText(props.dom);
21
+ var value = props.entity.value;
22
+
23
+ // 远程获取数据
24
+ if ((_props$schema$fieldPr = props.schema.fieldProps) !== null && _props$schema$fieldPr !== void 0 && _props$schema$fieldPr.loadDataUrl) {
25
+ http({
26
+ url: props.schema.fieldProps.loadDataUrl,
27
+ method: 'get',
28
+ params: {
29
+ value: value
30
+ }
31
+ }).then(function (res) {
32
+ if (!value) {
33
+ return;
34
+ }
35
+ var findValue = function findValue(options, value) {
36
+ for (var i = 0; i < options.length; i++) {
37
+ var option = options[i];
38
+ if (option.value === value) {
39
+ return [option.label];
40
+ } else if (option.children) {
41
+ return [option.label].concat(_toConsumableArray(findValue(option.children, value)));
42
+ }
43
+ }
44
+ };
45
+ setText(findValue(res.data, value).join(' / '));
46
+ });
47
+ }
48
+ }, []);
49
+ return /*#__PURE__*/React.createElement("div", {
50
+ className: props.entity.className
51
+ }, text);
52
+ }
@@ -0,0 +1,8 @@
1
+ import { ColumnReadonlyProps } from "./types";
2
+ import { UploadFile } from "antd";
3
+ import React from "react";
4
+ import { UploadListType } from "antd/es/upload/interface";
5
+ export default function (props: ColumnReadonlyProps & {
6
+ listType?: UploadListType;
7
+ onPreview?: (file: UploadFile) => void;
8
+ }): React.JSX.Element;
@@ -0,0 +1,54 @@
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { Spin, Upload } from "antd";
8
+ import React, { useContext, useEffect, useState } from "react";
9
+ import { FormContext } from "../../FormContext";
10
+ import { TableContext } from "../../TableContext";
11
+ export default function (props) {
12
+ var _useState = useState(true),
13
+ _useState2 = _slicedToArray(_useState, 2),
14
+ loading = _useState2[0],
15
+ setLoading = _useState2[1];
16
+ var _useState3 = useState([]),
17
+ _useState4 = _slicedToArray(_useState3, 2),
18
+ fileList = _useState4[0],
19
+ setFileList = _useState4[1];
20
+ var formContext = useContext(FormContext);
21
+ var tableContext = useContext(TableContext);
22
+ useEffect(function () {
23
+ var extraRenderValue = [];
24
+ if (formContext && formContext.extraRenderValues) {
25
+ var _formContext$extraRen;
26
+ extraRenderValue = (_formContext$extraRen = formContext.extraRenderValues[props.schema.dataIndex]) !== null && _formContext$extraRen !== void 0 ? _formContext$extraRen : [];
27
+ } else if (tableContext && tableContext.extraRenderValues) {
28
+ var _tableContext$extraRe, _tableContext$extraRe2;
29
+ extraRenderValue = (_tableContext$extraRe = (_tableContext$extraRe2 = tableContext.extraRenderValues[props.index]) === null || _tableContext$extraRe2 === void 0 ? void 0 : _tableContext$extraRe2[props.schema.dataIndex]) !== null && _tableContext$extraRe !== void 0 ? _tableContext$extraRe : [];
30
+ }
31
+ setFileList(extraRenderValue.map(function (item) {
32
+ return {
33
+ uid: item.id,
34
+ status: 'done',
35
+ url: item.url,
36
+ name: item.name,
37
+ hash_id: item.hash_id,
38
+ response: {
39
+ file_id: item.id,
40
+ url: item.url
41
+ }
42
+ };
43
+ }));
44
+ setLoading(false);
45
+ }, []);
46
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spin, {
47
+ spinning: loading
48
+ }, /*#__PURE__*/React.createElement(Upload, {
49
+ disabled: true,
50
+ listType: props.listType || 'text',
51
+ fileList: fileList,
52
+ onPreview: props.onPreview
53
+ })));
54
+ }
@@ -0,0 +1,3 @@
1
+ import { ColumnReadonlyProps } from "./types";
2
+ import React from "react";
3
+ export default function (props: ColumnReadonlyProps): React.JSX.Element;
@@ -0,0 +1,69 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ 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); } }
5
+ 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); }); }; }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ 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."); }
8
+ 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); }
9
+ 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; }
10
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+ import { Image } from "antd";
13
+ import { getBase64 } from "../../../lib/upload";
14
+ import React, { useState } from "react";
15
+ import File from "./File";
16
+ export default function (props) {
17
+ var _useState = useState(''),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ previewImage = _useState2[0],
20
+ setPreviewImage = _useState2[1];
21
+ var _useState3 = useState(false),
22
+ _useState4 = _slicedToArray(_useState3, 2),
23
+ previewOpen = _useState4[0],
24
+ setPreviewOpen = _useState4[1];
25
+ var handlePreview = /*#__PURE__*/function () {
26
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
27
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
28
+ while (1) switch (_context.prev = _context.next) {
29
+ case 0:
30
+ if (!(!file.url && !file.preview)) {
31
+ _context.next = 4;
32
+ break;
33
+ }
34
+ _context.next = 3;
35
+ return getBase64(file.originFileObj);
36
+ case 3:
37
+ file.preview = _context.sent;
38
+ case 4:
39
+ setPreviewImage(file.url || file.preview);
40
+ setPreviewOpen(true);
41
+ case 6:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }, _callee);
46
+ }));
47
+ return function handlePreview(_x) {
48
+ return _ref.apply(this, arguments);
49
+ };
50
+ }();
51
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(File, _extends({}, props, {
52
+ listType: "picture-card",
53
+ onPreview: handlePreview
54
+ })), previewImage && /*#__PURE__*/React.createElement(Image, {
55
+ wrapperStyle: {
56
+ display: 'none'
57
+ },
58
+ preview: {
59
+ visible: previewOpen,
60
+ onVisibleChange: function onVisibleChange(visible) {
61
+ return setPreviewOpen(visible);
62
+ },
63
+ afterOpenChange: function afterOpenChange(visible) {
64
+ return !visible && setPreviewImage('');
65
+ }
66
+ },
67
+ src: previewImage
68
+ }));
69
+ }
@@ -0,0 +1,3 @@
1
+ import { ColumnReadonlyProps } from "./types";
2
+ import React from "react";
3
+ export default function (props: ColumnReadonlyProps): React.JSX.Element;
@@ -0,0 +1,24 @@
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useEffect, useState } from "react";
8
+ export default function (props) {
9
+ var _useState = useState(props.entity.value),
10
+ _useState2 = _slicedToArray(_useState, 2),
11
+ value = _useState2[0],
12
+ setValue = _useState2[1];
13
+ useEffect(function () {
14
+ var div = document.createElement('div');
15
+ div.innerHTML = props.entity.value;
16
+ setValue(div.innerText);
17
+ }, []);
18
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19
+ className: 'article-content',
20
+ dangerouslySetInnerHTML: {
21
+ __html: value
22
+ }
23
+ }));
24
+ }
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ Cascader: Promise<typeof import("./Cascader")>;
3
+ File: Promise<typeof import("./File")>;
4
+ Image: Promise<typeof import("./Image")>;
5
+ Ueditor: Promise<typeof import("./Ueditor")>;
6
+ Action: Promise<typeof import("./Action")>;
7
+ };
8
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export default {
2
+ Cascader: import("./Cascader"),
3
+ File: import("./File"),
4
+ Image: import("./Image"),
5
+ Ueditor: import("./Ueditor"),
6
+ Action: import("./Action")
7
+ };
@@ -0,0 +1,27 @@
1
+ import { ColumnProps } from "./types";
2
+ import React, { Component } from "react";
3
+ import { ModalContextProps } from "../ModalContext";
4
+ declare global {
5
+ interface Window {
6
+ UE: any;
7
+ UE_LOADING_PROMISE: Promise<any>;
8
+ }
9
+ }
10
+ export default class Ueditor extends Component<ColumnProps & {
11
+ fieldProps: {
12
+ ueditorPath: string;
13
+ };
14
+ }, any> {
15
+ modalContext: ModalContextProps;
16
+ editor: any;
17
+ catching: boolean;
18
+ containerRef: HTMLElement | null;
19
+ state: {
20
+ loading: boolean;
21
+ containerId: string;
22
+ width: string;
23
+ };
24
+ componentDidMount(): void;
25
+ componentWillUnmount(): void;
26
+ render(): React.JSX.Element;
27
+ }