@nokecy/qc-ui 0.4.7 → 0.5.0

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 (92) hide show
  1. package/dist/esm/ag-grid-plus/_utils/boolSelect.js +49 -0
  2. package/dist/esm/ag-grid-plus/ag-grid-theme-builder.css +404 -0
  3. package/dist/esm/ag-grid-plus/ag-gridPlus.js +472 -0
  4. package/dist/esm/ag-grid-plus/context/gridContext.js +6 -0
  5. package/dist/esm/ag-grid-plus/gridManager/index.js +35 -0
  6. package/dist/esm/ag-grid-plus/index.js +10 -0
  7. package/dist/esm/ag-grid-plus/index.less +7 -0
  8. package/dist/esm/ag-grid-plus/interface.js +9 -0
  9. package/dist/esm/ag-grid-plus/queryForm/index.js +175 -0
  10. package/dist/esm/ag-grid-plus/queryForm/index.less +48 -0
  11. package/dist/esm/ag-grid-plus/queryForm/queryForm.js +84 -0
  12. package/dist/esm/ag-grid-plus/setting/index.js +198 -0
  13. package/dist/esm/ag-grid-plus/settingItem/index.js +15 -0
  14. package/dist/esm/ag-grid-plus/toolBar/index.js +171 -0
  15. package/dist/esm/ag-grid-plus/utils.js +137 -0
  16. package/dist/esm/array-table/arrayAddBtn.js +56 -0
  17. package/dist/esm/array-table/arrayBase.js +217 -0
  18. package/dist/esm/array-table/index.js +145 -0
  19. package/dist/esm/array-table/interface.js +1 -0
  20. package/dist/esm/array-table/preview.js +49 -0
  21. package/dist/esm/array-table/utils.js +124 -0
  22. package/dist/esm/array-table-index/index.js +10 -0
  23. package/dist/esm/dashboard/dashboard/components/index.js +2 -0
  24. package/dist/esm/dashboard/dashboard/components/modal/index.js +15 -0
  25. package/dist/esm/dashboard/dashboard/components/toolbar/index.js +22 -0
  26. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.js +1 -0
  27. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.less +49 -0
  28. package/dist/esm/dashboard/dashboard/index.js +525 -0
  29. package/dist/esm/dashboard/dashboard/index.less +173 -0
  30. package/dist/esm/dashboard/dashboard/service.js +86 -0
  31. package/dist/esm/dashboard/dashboard/utils.js +89 -0
  32. package/dist/esm/dashboard/index.js +3 -0
  33. package/dist/esm/dashboard/utils.js +125 -0
  34. package/dist/esm/dashboard/widget/index.js +47 -0
  35. package/dist/esm/dashboard/widget/index.less +7 -0
  36. package/dist/esm/dashboard/widget/selector/index.js +234 -0
  37. package/dist/esm/dashboard/widget/selector/index.less +172 -0
  38. package/dist/esm/dashboard/widget/utils.js +89 -0
  39. package/dist/esm/dialogSelect/index.js +70 -0
  40. package/dist/esm/dialogSelect/interface.js +0 -0
  41. package/dist/esm/dialogSelect/selectModal.js +138 -0
  42. package/dist/esm/editable/index.js +241 -0
  43. package/dist/esm/editable/style.js +46 -0
  44. package/dist/esm/extensible-grid/index.js +22 -0
  45. package/dist/esm/extensible-grid/interface.js +1 -0
  46. package/dist/esm/formDesigner/FormDesigner.js +222 -0
  47. package/dist/esm/formDesigner/ProCard/index.js +21 -0
  48. package/dist/esm/formDesigner/arrayTable/arrayTableSchema.js +106 -0
  49. package/dist/esm/formDesigner/arrayTable/index.js +1 -0
  50. package/dist/esm/formDesigner/arrayTable/preview.js +390 -0
  51. package/dist/esm/formDesigner/arrayTable/styles.less +3 -0
  52. package/dist/esm/formDesigner/index.js +2 -0
  53. package/dist/esm/formDesigner/index.less +3 -0
  54. package/dist/esm/formDesigner/preWidgets/arrayTableIndex/index.js +1 -0
  55. package/dist/esm/formDesigner/preWidgets/arrayTableIndex/preview.js +40 -0
  56. package/dist/esm/formDesigner/preWidgets/card/index.js +1 -0
  57. package/dist/esm/formDesigner/preWidgets/card/preview.js +38 -0
  58. package/dist/esm/formDesigner/preWidgets/index.js +12 -0
  59. package/dist/esm/formDesigner/preWidgets/preDefineProperty1/index.js +1 -0
  60. package/dist/esm/formDesigner/preWidgets/preDefineProperty1/preview.js +44 -0
  61. package/dist/esm/formDesigner/preWidgets/preDefineProperty10/index.js +1 -0
  62. package/dist/esm/formDesigner/preWidgets/preDefineProperty10/preview.js +43 -0
  63. package/dist/esm/formDesigner/preWidgets/preDefineProperty2/index.js +1 -0
  64. package/dist/esm/formDesigner/preWidgets/preDefineProperty2/preview.js +43 -0
  65. package/dist/esm/formDesigner/preWidgets/preDefineProperty3/index.js +1 -0
  66. package/dist/esm/formDesigner/preWidgets/preDefineProperty3/preview.js +43 -0
  67. package/dist/esm/formDesigner/preWidgets/preDefineProperty4/index.js +1 -0
  68. package/dist/esm/formDesigner/preWidgets/preDefineProperty4/preview.js +43 -0
  69. package/dist/esm/formDesigner/preWidgets/preDefineProperty5/index.js +1 -0
  70. package/dist/esm/formDesigner/preWidgets/preDefineProperty5/preview.js +43 -0
  71. package/dist/esm/formDesigner/preWidgets/preDefineProperty6/index.js +1 -0
  72. package/dist/esm/formDesigner/preWidgets/preDefineProperty6/preview.js +43 -0
  73. package/dist/esm/formDesigner/preWidgets/preDefineProperty7/index.js +1 -0
  74. package/dist/esm/formDesigner/preWidgets/preDefineProperty7/preview.js +43 -0
  75. package/dist/esm/formDesigner/preWidgets/preDefineProperty8/index.js +1 -0
  76. package/dist/esm/formDesigner/preWidgets/preDefineProperty8/preview.js +43 -0
  77. package/dist/esm/formDesigner/preWidgets/preDefineProperty9/index.js +1 -0
  78. package/dist/esm/formDesigner/preWidgets/preDefineProperty9/preview.js +43 -0
  79. package/dist/esm/formDesigner/preWidgets/utils.js +219 -0
  80. package/dist/esm/formDesigner/widgets/ActionsWidget.js +29 -0
  81. package/dist/esm/formDesigner/widgets/LogoWidget.js +24 -0
  82. package/dist/esm/formDesigner/widgets/PreviewWidget.js +33 -0
  83. package/dist/esm/formDesigner/widgets/SchemaEditorWidget.js +17 -0
  84. package/dist/esm/formDesigner/widgets/index.js +4 -0
  85. package/dist/esm/formPro/context/formProContext.js +5 -0
  86. package/dist/esm/formPro/formLayoutPro.js +41 -0
  87. package/dist/esm/formPro/index.js +2 -0
  88. package/dist/esm/index.js +12 -0
  89. package/dist/esm/type.d.ts +1 -0
  90. package/dist/umd/qc-ui.min.css +1 -0
  91. package/dist/umd/qc-ui.min.js +1 -0
  92. package/package.json +2 -2
@@ -0,0 +1,138 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ 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."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ 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); } }
8
+ 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); }); }; }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ 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."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ 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; }
13
+ 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; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ import { Button, Modal, message } from "antd";
16
+ import { DashOutlined } from "@ant-design/icons";
17
+ import React, { useRef, useState } from "react";
18
+ import { AgGridPlus } from "../ag-grid-plus";
19
+ var SelectModal = function SelectModal(props) {
20
+ var request = props.request,
21
+ columnDefs = props.columnDefs,
22
+ onValueChange = props.onValueChange;
23
+ var gridRef = useRef();
24
+ var _Modal$useModal = Modal.useModal(),
25
+ _Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
26
+ modal = _Modal$useModal2[0],
27
+ contextHolder = _Modal$useModal2[1];
28
+ var _useState = useState(undefined),
29
+ _useState2 = _slicedToArray(_useState, 2),
30
+ selectRows = _useState2[0],
31
+ setSelectRows = _useState2[1];
32
+ var handleOk = function handleOk(selectRows) {
33
+ return new Promise(function (resolve, reject) {
34
+ if (!selectRows || (selectRows === null || selectRows === void 0 ? void 0 : selectRows.length) == 0) {
35
+ message.error("请选择数据");
36
+ reject();
37
+ return;
38
+ }
39
+ Modal.destroyAll();
40
+ onValueChange && onValueChange(getValue(selectRows), selectRows);
41
+ });
42
+ };
43
+ var getValue = function getValue(selectRows) {
44
+ var mode = props.mode,
45
+ labelInValue = props.labelInValue,
46
+ valueField = props.valueField,
47
+ labelField = props.labelField;
48
+ if (mode == 'tags') {
49
+ return labelInValue ? selectRows.map(function (it) {
50
+ return {
51
+ value: it[valueField !== null && valueField !== void 0 ? valueField : "id"],
52
+ label: it[labelField !== null && labelField !== void 0 ? labelField : "name"]
53
+ };
54
+ }) : selectRows.map(function (it) {
55
+ return it[valueField !== null && valueField !== void 0 ? valueField : "id"];
56
+ });
57
+ } else {
58
+ var selectRow = selectRows[0];
59
+ var _value = selectRow[valueField !== null && valueField !== void 0 ? valueField : "id"];
60
+ var label = selectRow[labelField !== null && labelField !== void 0 ? labelField : "name"];
61
+ return labelInValue ? {
62
+ value: _value,
63
+ label: label
64
+ } : _value;
65
+ }
66
+ };
67
+ var onSelectionChanged = function onSelectionChanged(e) {
68
+ var selectedRows = e.api.getSelectedRows();
69
+ setSelectRows(selectedRows);
70
+ };
71
+ var modalConfig = {
72
+ title: '选择数据',
73
+ width: 960,
74
+ onOk: function onOk() {
75
+ return handleOk(selectRows);
76
+ },
77
+ onCancel: function onCancel() {
78
+ Modal.destroyAll();
79
+ },
80
+ destroyOnClose: true,
81
+ content: /*#__PURE__*/React.createElement(AgGridPlus, {
82
+ style: {
83
+ height: 450
84
+ },
85
+ gridRef: gridRef,
86
+ search: (columnDefs === null || columnDefs === void 0 ? void 0 : columnDefs.filter(function (i) {
87
+ return !i.hideInSearch;
88
+ }).length) !== 0,
89
+ onSelectionChanged: onSelectionChanged
90
+ ///@ts-ignore
91
+ ,
92
+ rowSelection: props.mode == 'tags' ? props.mode : "single",
93
+ onRowDoubleClicked: function onRowDoubleClicked(_ref) {
94
+ var data = _ref.data;
95
+ handleOk(data);
96
+ },
97
+ request: ( /*#__PURE__*/function () {
98
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
99
+ var data, requestData;
100
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
101
+ while (1) switch (_context.prev = _context.next) {
102
+ case 0:
103
+ _context.next = 2;
104
+ return request({
105
+ Filter: props !== null && props !== void 0 && props.queryFun ? props === null || props === void 0 ? void 0 : props.queryFun(params === null || params === void 0 ? void 0 : params.filter) : params === null || params === void 0 ? void 0 : params.filter,
106
+ Sorting: params.sorter,
107
+ SkipCount: params.skipCount,
108
+ MaxResultCount: params.maxResultCount
109
+ });
110
+ case 2:
111
+ data = _context.sent;
112
+ requestData = {
113
+ success: true,
114
+ data: data.items,
115
+ total: data.totalCount
116
+ };
117
+ return _context.abrupt("return", requestData);
118
+ case 5:
119
+ case "end":
120
+ return _context.stop();
121
+ }
122
+ }, _callee);
123
+ }));
124
+ return function (_x) {
125
+ return _ref2.apply(this, arguments);
126
+ };
127
+ }()),
128
+ columnDefs: _toConsumableArray(columnDefs || [])
129
+ })
130
+ };
131
+ return /*#__PURE__*/React.createElement(React.Fragment, null, contextHolder, /*#__PURE__*/React.createElement(Button, {
132
+ icon: /*#__PURE__*/React.createElement(DashOutlined, null),
133
+ onClick: function onClick() {
134
+ modal.confirm(modalConfig);
135
+ }
136
+ }));
137
+ };
138
+ export default SelectModal;
@@ -0,0 +1,241 @@
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 { CloseOutlined, EditOutlined, MessageOutlined } from '@ant-design/icons';
13
+ import { isVoidField } from '@formily/core';
14
+ import { observer, useField } from '@formily/react';
15
+ import { Popover as AntdPopover } from 'antd';
16
+ import cls from 'classnames';
17
+ import { FormItem } from '@formily/antd-v5';
18
+ import { ArrayBase } from "../array-table/arrayBase";
19
+ import React, { useLayoutEffect, useRef, useState } from 'react';
20
+ import { useClickAway, usePrefixCls } from '@formily/antd-v5/lib/__builtins__';
21
+ import useStyle from "./style";
22
+ var useParentPattern = function useParentPattern() {
23
+ var _field$parent, _field$form;
24
+ var field = useField();
25
+ return (field === null || field === void 0 || (_field$parent = field.parent) === null || _field$parent === void 0 ? void 0 : _field$parent.pattern) || (field === null || field === void 0 || (_field$form = field.form) === null || _field$form === void 0 ? void 0 : _field$form.pattern);
26
+ };
27
+ var useEditable = function useEditable() {
28
+ var pattern = useParentPattern();
29
+ var record = ArrayBase.useRecord();
30
+ var field = useField();
31
+ // useLayoutEffect(() => {
32
+ // if (pattern === 'editable') {
33
+ // return field.setPattern('readPretty')
34
+ // }
35
+ // }, [pattern])
36
+
37
+ useLayoutEffect(function () {
38
+ if ((field.initialValue || !(record !== null && record !== void 0 && record._isNew)) && pattern === 'editable') {
39
+ return field.setPattern('readPretty');
40
+ }
41
+ }, [field.initialValue]);
42
+ return [field.pattern === 'editable', function (payload) {
43
+ if (pattern !== 'editable') return;
44
+ field.setPattern(payload ? 'editable' : 'readPretty');
45
+ }];
46
+ };
47
+ var useFormItemProps = function useFormItemProps() {
48
+ var field = useField();
49
+ if (isVoidField(field)) return {};
50
+ if (!field) return {};
51
+ var takeMessage = function takeMessage() {
52
+ if (field.selfErrors.length) return field.selfErrors;
53
+ if (field.selfWarnings.length) return field.selfWarnings;
54
+ if (field.selfSuccesses.length) return field.selfSuccesses;
55
+ };
56
+ return {
57
+ feedbackStatus: field.validateStatus === 'validating' ? 'pending' : field.validateStatus,
58
+ feedbackText: takeMessage(),
59
+ extra: field.description
60
+ };
61
+ };
62
+ var InternalEditable = observer(function (props) {
63
+ var _useEditable = useEditable(),
64
+ _useEditable2 = _slicedToArray(_useEditable, 2),
65
+ editable = _useEditable2[0],
66
+ setEditable = _useEditable2[1];
67
+ var pattern = useParentPattern();
68
+ var itemProps = useFormItemProps();
69
+ var field = useField();
70
+ var basePrefixCls = usePrefixCls();
71
+ var prefixCls = usePrefixCls('formily-editable');
72
+ var _useStyle = useStyle(prefixCls),
73
+ _useStyle2 = _slicedToArray(_useStyle, 2),
74
+ wrapSSR = _useStyle2[0],
75
+ hashId = _useStyle2[1];
76
+ var ref = useRef();
77
+ var innerRef = useRef(null);
78
+ var recover = /*#__PURE__*/function () {
79
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
80
+ var _field$errors;
81
+ var errors;
82
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
83
+ while (1) switch (_context.prev = _context.next) {
84
+ case 0:
85
+ if (!(editable && !(field !== null && field !== void 0 && (_field$errors = field.errors) !== null && _field$errors !== void 0 && _field$errors.length))) {
86
+ _context.next = 10;
87
+ break;
88
+ }
89
+ _context.prev = 1;
90
+ _context.next = 4;
91
+ return field.form.validate("".concat(field.path));
92
+ case 4:
93
+ _context.prev = 4;
94
+ errors = field.form.queryFeedbacks({
95
+ type: 'error',
96
+ address: "".concat(field.address)
97
+ });
98
+ if (!(errors !== null && errors !== void 0 && errors.length)) {
99
+ _context.next = 8;
100
+ break;
101
+ }
102
+ return _context.abrupt("return");
103
+ case 8:
104
+ if (ref.current && !(errors !== null && errors !== void 0 && errors.length)) {
105
+ setEditable(false);
106
+ }
107
+ return _context.finish(4);
108
+ case 10:
109
+ case "end":
110
+ return _context.stop();
111
+ }
112
+ }, _callee, null, [[1,, 4, 10]]);
113
+ }));
114
+ return function recover() {
115
+ return _ref.apply(this, arguments);
116
+ };
117
+ }();
118
+ var renderEditHelper = function renderEditHelper() {
119
+ if (editable) return;
120
+ return /*#__PURE__*/React.createElement(FormItem.BaseItem, _extends({}, props, itemProps), pattern === 'editable' && /*#__PURE__*/React.createElement(EditOutlined, {
121
+ className: "".concat(prefixCls, "-edit-btn")
122
+ }), pattern !== 'editable' && /*#__PURE__*/React.createElement(MessageOutlined, {
123
+ className: "".concat(prefixCls, "-edit-btn")
124
+ }));
125
+ };
126
+ var renderCloseHelper = function renderCloseHelper() {
127
+ if (!editable) return;
128
+ return /*#__PURE__*/React.createElement(FormItem.BaseItem, props, /*#__PURE__*/React.createElement(CloseOutlined, {
129
+ className: "".concat(prefixCls, "-close-btn")
130
+ }));
131
+ };
132
+ useClickAway(function (e) {
133
+ var target = e.target;
134
+ if (target !== null && target !== void 0 && target.closest(".".concat(basePrefixCls, "-select-dropdown"))) return;
135
+ if (target !== null && target !== void 0 && target.closest(".".concat(basePrefixCls, "-picker-dropdown"))) return;
136
+ if (target !== null && target !== void 0 && target.closest(".".concat(basePrefixCls, "-cascader-menus"))) return;
137
+ recover();
138
+ }, innerRef);
139
+ var onClick = function onClick(e) {
140
+ var _innerRef$current;
141
+ var target = e.target;
142
+ var close = ((_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.querySelector(".".concat(prefixCls, "-close-btn"))) || null;
143
+ if (target !== null && target !== void 0 && target.contains(close) || close !== null && close !== void 0 && close.contains(target)) {
144
+ recover();
145
+ } else if (!ref.current) {
146
+ setTimeout(function () {
147
+ setEditable(true);
148
+ setTimeout(function () {
149
+ var _innerRef$current2;
150
+ (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 || (_innerRef$current2 = _innerRef$current2.querySelector('input')) === null || _innerRef$current2 === void 0 || _innerRef$current2.focus();
151
+ });
152
+ });
153
+ }
154
+ };
155
+ ref.current = editable;
156
+ return wrapSSR( /*#__PURE__*/React.createElement("div", {
157
+ className: cls(prefixCls, hashId),
158
+ ref: innerRef,
159
+ onClick: onClick
160
+ }, /*#__PURE__*/React.createElement("div", {
161
+ className: "".concat(prefixCls, "-content")
162
+ }, /*#__PURE__*/React.createElement(FormItem.BaseItem, _extends({}, props, itemProps), props.children))));
163
+ });
164
+ var Popover = observer(function (props) {
165
+ var field = useField();
166
+ var pattern = useParentPattern();
167
+ var _useState = useState(false),
168
+ _useState2 = _slicedToArray(_useState, 2),
169
+ open = _useState2[0],
170
+ setOpen = _useState2[1];
171
+ var prefixCls = usePrefixCls('formily-editable');
172
+ var _useStyle3 = useStyle(prefixCls),
173
+ _useStyle4 = _slicedToArray(_useStyle3, 2),
174
+ wrapSSR = _useStyle4[0],
175
+ hashId = _useStyle4[1];
176
+ var closePopover = /*#__PURE__*/function () {
177
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
178
+ var errors;
179
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
180
+ while (1) switch (_context2.prev = _context2.next) {
181
+ case 0:
182
+ _context2.prev = 0;
183
+ _context2.next = 3;
184
+ return field.form.validate("".concat(field.address, ".*"));
185
+ case 3:
186
+ _context2.prev = 3;
187
+ errors = field.form.queryFeedbacks({
188
+ type: 'error',
189
+ address: "".concat(field.address, ".*")
190
+ });
191
+ if (!(errors !== null && errors !== void 0 && errors.length)) {
192
+ _context2.next = 7;
193
+ break;
194
+ }
195
+ return _context2.abrupt("return");
196
+ case 7:
197
+ setOpen(false);
198
+ return _context2.finish(3);
199
+ case 9:
200
+ case "end":
201
+ return _context2.stop();
202
+ }
203
+ }, _callee2, null, [[0,, 3, 9]]);
204
+ }));
205
+ return function closePopover() {
206
+ return _ref2.apply(this, arguments);
207
+ };
208
+ }();
209
+ var openPopover = function openPopover() {
210
+ setOpen(true);
211
+ };
212
+ return wrapSSR( /*#__PURE__*/React.createElement(AntdPopover, _extends({}, props, {
213
+ title: props.title || field.title,
214
+ open: open,
215
+ className: cls(prefixCls, hashId, props.className),
216
+ content: props.children,
217
+ trigger: "click",
218
+ destroyTooltipOnHide: true,
219
+ onOpenChange: function onOpenChange(open) {
220
+ if (open) {
221
+ openPopover();
222
+ } else {
223
+ closePopover();
224
+ }
225
+ }
226
+ }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItem.BaseItem, {
227
+ className: "".concat(prefixCls, "-trigger")
228
+ }, /*#__PURE__*/React.createElement("div", {
229
+ className: "".concat(prefixCls, "-content")
230
+ }, /*#__PURE__*/React.createElement("span", {
231
+ className: "".concat(prefixCls, "-preview")
232
+ }, props.title || field.title), pattern === 'editable' && /*#__PURE__*/React.createElement(EditOutlined, {
233
+ className: "".concat(prefixCls, "-edit-btn")
234
+ }), pattern !== 'editable' && /*#__PURE__*/React.createElement(MessageOutlined, {
235
+ className: "".concat(prefixCls, "-edit-btn")
236
+ }))))));
237
+ });
238
+ export var Editable = Object.assign(InternalEditable, {
239
+ Popover: Popover
240
+ });
241
+ export default Editable;
@@ -0,0 +1,46 @@
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 _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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import { genStyleHook } from '@formily/antd-v5/lib/__builtins__';
6
+ export default genStyleHook('editable', function (token) {
7
+ var antCls = token.antCls,
8
+ componentCls = token.componentCls,
9
+ fontSizeSM = token.fontSizeSM,
10
+ colorPrimary = token.colorPrimary;
11
+ return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
12
+ cursor: 'pointer',
13
+ display: 'inline-block !important',
14
+ width: '100%'
15
+ }, "".concat(antCls, "-form-text"), _defineProperty(_defineProperty({
16
+ display: 'flex',
17
+ alignItems: 'center'
18
+ }, "".concat(antCls, "-tag"), {
19
+ transition: 'none !important'
20
+ }), "".concat(antCls, "-tag:last-child"), {
21
+ paddingInlineEnd: '0 !important'
22
+ })), "".concat(componentCls, "-content"), {
23
+ display: 'flex',
24
+ alignItems: 'center',
25
+ '> *': {
26
+ marginInlineEnd: 3,
27
+ '&:last-child': {
28
+ marginInlineEnd: 0
29
+ }
30
+ }
31
+ }), "".concat(componentCls, "-edit-btn,\n ").concat(componentCls, "-close-btn"), {
32
+ transition: 'all .25s ease-in-out',
33
+ color: '#aaa',
34
+ fontSize: fontSizeSM,
35
+ '&:hover': {
36
+ color: colorPrimary
37
+ }
38
+ }), "".concat(componentCls, "-preview"), {
39
+ whiteSpace: 'nowrap',
40
+ textOverflow: 'ellipsis',
41
+ overflow: 'hidden',
42
+ wordBreak: 'break-all',
43
+ maxWidth: '100%',
44
+ display: 'block'
45
+ }));
46
+ });
@@ -0,0 +1,22 @@
1
+ var _excluded = ["children", "extensibleColumns"];
2
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+ import React from 'react';
5
+ import { AgGridColumn, AgGridPlus } from "../ag-grid-plus";
6
+ function ExtensibleGrid(props) {
7
+ var children = props.children,
8
+ _props$extensibleColu = props.extensibleColumns,
9
+ extensibleColumns = _props$extensibleColu === void 0 ? [] : _props$extensibleColu,
10
+ rest = _objectWithoutProperties(props, _excluded);
11
+ return /*#__PURE__*/React.createElement(AgGridPlus, rest, React.Children.map(children, function (child, index) {
12
+ return child;
13
+ }), extensibleColumns.map(function (column) {
14
+ return /*#__PURE__*/React.createElement(AgGridColumn, {
15
+ field: column.field,
16
+ headerName: column.headerName,
17
+ type: column.type,
18
+ flex: 1
19
+ });
20
+ }));
21
+ }
22
+ export default ExtensibleGrid;
@@ -0,0 +1 @@
1
+ export {};