@pisell/materials 6.3.6 → 6.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +150 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +39 -28
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +45 -34
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +10 -11
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/date-picker/datePickerCpt.d.ts +1 -0
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/filter/index.d.ts +0 -1
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/list/index.d.ts +1 -0
- package/es/components/lowCodePage/index.d.ts +1 -0
- package/es/components/page/index.d.ts +1 -0
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/es/components/pisellCamera/index.d.ts +4 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellDatePicker/datePickerCpt.d.ts +1 -0
- package/es/components/pisellInput/components/BankCard/index.d.ts +1 -0
- package/es/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/es/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
- package/es/components/pisellInput/index.d.ts +1 -0
- package/es/components/pisellTooltip/index.d.ts +1 -0
- package/es/components/productCard/components/Action/index.d.ts +1 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/es/components/productCard/components/Header/EditButton/index.d.ts +1 -0
- package/es/components/productCard/components/Header/index.d.ts +1 -0
- package/es/components/productCard/components/Note/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/productCard/components/Sales/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +1 -0
- package/es/components/qrcode/index.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/es/components/table/Actions/component/Group/index.d.ts +0 -1
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/es/components/table/Actions/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/View/index.d.ts +0 -1
- package/es/components/table/hooks/useTableSetting.d.ts +3 -4
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +17 -0
- package/es/locales/en-US.d.ts +10 -0
- package/es/locales/en-US.js +13 -1
- package/es/locales/zh-CN.d.ts +10 -0
- package/es/locales/zh-CN.js +13 -1
- package/es/locales/zh-TW.d.ts +10 -0
- package/es/locales/zh-TW.js +13 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +10 -11
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/date-picker/datePickerCpt.d.ts +1 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/filter/index.d.ts +0 -1
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/list/index.d.ts +1 -0
- package/lib/components/lowCodePage/index.d.ts +1 -0
- package/lib/components/page/index.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/lib/components/pisellCamera/index.d.ts +4 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellDatePicker/datePickerCpt.d.ts +1 -0
- package/lib/components/pisellInput/components/BankCard/index.d.ts +1 -0
- package/lib/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/lib/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
- package/lib/components/pisellInput/index.d.ts +1 -0
- package/lib/components/pisellTooltip/index.d.ts +1 -0
- package/lib/components/productCard/components/Action/index.d.ts +1 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/index.d.ts +1 -0
- package/lib/components/productCard/components/Note/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/productCard/components/Sales/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +1 -0
- package/lib/components/qrcode/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/lib/components/table/Actions/component/Group/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/lib/components/table/Actions/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/View/index.d.ts +0 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +17 -0
- package/lib/locales/en-US.d.ts +10 -0
- package/lib/locales/en-US.js +13 -1
- package/lib/locales/zh-CN.d.ts +10 -0
- package/lib/locales/zh-CN.js +13 -1
- package/lib/locales/zh-TW.d.ts +10 -0
- package/lib/locales/zh-TW.js +13 -1
- package/lib/utils/platform.d.ts +1 -1
- package/lowcode/data-source-table/meta.ts +239 -0
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/table/meta.ts +104 -0
- package/package.json +4 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
var _excluded = ["columns", "dataSource", "operationContent"];
|
|
2
|
+
var _excluded = ["columns", "dataSource", "operationContent", "currentSettingKey"];
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
5
|
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); } }
|
|
@@ -29,6 +29,7 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
29
29
|
var propsColumns = props.columns,
|
|
30
30
|
dataSource = props.dataSource,
|
|
31
31
|
operationContent = props.operationContent,
|
|
32
|
+
currentSettingKey = props.currentSettingKey,
|
|
32
33
|
others = _objectWithoutProperties(props, _excluded);
|
|
33
34
|
var tableRef = useRef(null);
|
|
34
35
|
var componentId = useComponentId(props);
|
|
@@ -45,6 +46,9 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
45
46
|
}
|
|
46
47
|
return originData;
|
|
47
48
|
}, [originData, __designMode]);
|
|
49
|
+
var formatCurrentSettingKey = useMemo(function () {
|
|
50
|
+
return currentSettingKey || props.__id || "";
|
|
51
|
+
}, [currentSettingKey]);
|
|
48
52
|
var _useDataSourceKey = useDataSourceKey(),
|
|
49
53
|
dataSourceKey = _useDataSourceKey.dataSourceKey,
|
|
50
54
|
dataSourceKeyRef = _useDataSourceKey.dataSourceKeyRef;
|
|
@@ -60,12 +64,13 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
60
64
|
containerProps = _useDrawerState.containerProps,
|
|
61
65
|
Container = _useDrawerState.Container,
|
|
62
66
|
drawerContent = _useDrawerState.drawerContent;
|
|
63
|
-
var _useTableQuery = useTableQuery(props),
|
|
67
|
+
var _useTableQuery = useTableQuery(props, formatCurrentSettingKey),
|
|
64
68
|
queryPageConfig = _useTableQuery.queryPageConfig,
|
|
65
69
|
handleValuesChange = _useTableQuery.handleValuesChange,
|
|
66
70
|
refreshData = _useTableQuery.refreshData,
|
|
67
71
|
handleFilterChange = _useTableQuery.handleFilterChange,
|
|
68
|
-
refreshCurrentPage = _useTableQuery.refreshCurrentPage
|
|
72
|
+
refreshCurrentPage = _useTableQuery.refreshCurrentPage,
|
|
73
|
+
getInitialValues = _useTableQuery.getInitialValues;
|
|
69
74
|
var handleAllValuesChange = function handleAllValuesChange(changedValues, values) {
|
|
70
75
|
var _props$onValuesChange;
|
|
71
76
|
props === null || props === void 0 || (_props$onValuesChange = props.onValuesChange) === null || _props$onValuesChange === void 0 || _props$onValuesChange.call(props, changedValues, values);
|
|
@@ -137,7 +142,8 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
137
142
|
closeDrawer: closeDrawer,
|
|
138
143
|
refreshData: refreshData,
|
|
139
144
|
handleFilterChange: handleFilterChange,
|
|
140
|
-
tableRef: tableRef
|
|
145
|
+
tableRef: tableRef,
|
|
146
|
+
getInitialValues: getInitialValues
|
|
141
147
|
});
|
|
142
148
|
useImperativeHandle(ref, function () {
|
|
143
149
|
if (tableRef.current) {
|
|
@@ -151,6 +157,7 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
151
157
|
return /*#__PURE__*/React.createElement(TableSettingProvider, null, /*#__PURE__*/React.createElement(Table, _extends({
|
|
152
158
|
ref: tableRef
|
|
153
159
|
}, others, transformProps, {
|
|
160
|
+
currentSettingKey: formatCurrentSettingKey,
|
|
154
161
|
dataSource: (data === null || data === void 0 ? void 0 : data.data) || [],
|
|
155
162
|
loading: list === null || list === void 0 ? void 0 : list.loading,
|
|
156
163
|
onValuesChange: handleAllValuesChange
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import './index.less';
|
|
3
2
|
interface BaseFilterItem {
|
|
4
3
|
name?: string;
|
|
@@ -22,6 +21,7 @@ interface FilterProps {
|
|
|
22
21
|
placeholder: string;
|
|
23
22
|
key: string;
|
|
24
23
|
};
|
|
24
|
+
getInitialValues?: () => Record<string, any>;
|
|
25
25
|
}
|
|
26
26
|
declare const Filter: (props: FilterProps) => JSX.Element;
|
|
27
27
|
export default Filter;
|
|
@@ -37,7 +37,8 @@ var Filter = function Filter(props) {
|
|
|
37
37
|
handleValuesChange = props.handleValuesChange,
|
|
38
38
|
search = props.search,
|
|
39
39
|
filterBy = props.filterBy,
|
|
40
|
-
show = props.show
|
|
40
|
+
show = props.show,
|
|
41
|
+
getInitialValues = props.getInitialValues;
|
|
41
42
|
var _Form$useForm = Form.useForm(),
|
|
42
43
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
43
44
|
form = _Form$useForm2[0];
|
|
@@ -149,6 +150,9 @@ var Filter = function Filter(props) {
|
|
|
149
150
|
allowClear: true
|
|
150
151
|
}) : null;
|
|
151
152
|
}, [search]);
|
|
153
|
+
var initialValues = useMemo(function () {
|
|
154
|
+
return getInitialValues === null || getInitialValues === void 0 ? void 0 : getInitialValues();
|
|
155
|
+
}, [search, filterBy]);
|
|
152
156
|
return /*#__PURE__*/React.createElement(Form, {
|
|
153
157
|
labelCol: {
|
|
154
158
|
span: 0
|
|
@@ -157,7 +161,8 @@ var Filter = function Filter(props) {
|
|
|
157
161
|
size: "large",
|
|
158
162
|
layout: "inline",
|
|
159
163
|
className: "filter-form-wrapper",
|
|
160
|
-
onValuesChange: onValuesChange
|
|
164
|
+
onValuesChange: onValuesChange,
|
|
165
|
+
initialValues: initialValues
|
|
161
166
|
}, searchDom, filterDom, show && sortButtonShow && /*#__PURE__*/React.createElement(FilterButton, {
|
|
162
167
|
value: list,
|
|
163
168
|
quickFilterMaxLength: quickFilterMaxLength,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Drawer } from 'antd';
|
|
3
2
|
import { OperationItem } from '../type';
|
|
4
3
|
declare const useDrawerState: (operationContent?: {
|
|
@@ -9,7 +8,7 @@ declare const useDrawerState: (operationContent?: {
|
|
|
9
8
|
openDrawer: (item: OperationItem) => void;
|
|
10
9
|
closeDrawer: () => void;
|
|
11
10
|
drawerContent: import("react").ReactNode;
|
|
12
|
-
Container: {
|
|
11
|
+
Container: typeof Drawer | {
|
|
13
12
|
(props: import("../../../pisellModal").PisellModalProps): JSX.Element;
|
|
14
13
|
confirm: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
15
14
|
destroy: () => void;
|
|
@@ -33,7 +32,7 @@ declare const useDrawerState: (operationContent?: {
|
|
|
33
32
|
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
34
33
|
};
|
|
35
34
|
Information: (props: import("../../../pisellModal/components/Information").InformationProps) => JSX.Element;
|
|
36
|
-
}
|
|
35
|
+
};
|
|
37
36
|
containerProps: {};
|
|
38
37
|
};
|
|
39
38
|
export default useDrawerState;
|
|
@@ -9,6 +9,7 @@ interface UseTablePropsProps {
|
|
|
9
9
|
refreshData: () => void;
|
|
10
10
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
11
11
|
tableRef: any;
|
|
12
|
+
getInitialValues: () => Record<string, any>;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* 处理table的props
|
|
@@ -17,7 +18,8 @@ interface UseTablePropsProps {
|
|
|
17
18
|
* @returns
|
|
18
19
|
*/
|
|
19
20
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
|
|
21
|
+
currentComponentId: any;
|
|
22
|
+
title: number | boolean | React.ReactFragment | (() => React.ReactNode) | JSX.Element | null | undefined;
|
|
21
23
|
pagination: {
|
|
22
24
|
total: number;
|
|
23
25
|
current: number;
|
|
@@ -26,11 +28,13 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
28
|
showSizeChanger: boolean;
|
|
27
29
|
};
|
|
28
30
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle: number | boolean | React.ReactFragment |
|
|
31
|
+
subTitle: number | boolean | React.ReactFragment | (() => React.ReactNode) | JSX.Element | null | undefined;
|
|
30
32
|
buttons: any[] | null;
|
|
31
|
-
filter:
|
|
33
|
+
filter: any;
|
|
32
34
|
onRow: (record: any) => any;
|
|
33
35
|
actionButtons: any[] | null;
|
|
36
|
+
__id?: string | undefined;
|
|
37
|
+
currentSettingKey?: string | undefined;
|
|
34
38
|
titleButtons?: {
|
|
35
39
|
show: boolean;
|
|
36
40
|
maxCount: number;
|
|
@@ -42,18 +46,12 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
42
46
|
items: OperationItem[];
|
|
43
47
|
} | undefined;
|
|
44
48
|
operation?: {
|
|
45
|
-
/**
|
|
46
|
-
* 处理table的props
|
|
47
|
-
* 转换title
|
|
48
|
-
* @param props
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
49
|
show: boolean;
|
|
52
50
|
title: string;
|
|
53
51
|
width: number;
|
|
54
|
-
align: "
|
|
52
|
+
align: "left" | "center" | "right";
|
|
55
53
|
fixed: false | "left" | "right";
|
|
56
|
-
type: "
|
|
54
|
+
type: "button" | "link";
|
|
57
55
|
items: OperationItem[];
|
|
58
56
|
} | undefined;
|
|
59
57
|
operationContent?: {
|
|
@@ -94,5 +92,6 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
94
92
|
create?: Record<string, any> | undefined;
|
|
95
93
|
destroy?: Record<string, any> | undefined;
|
|
96
94
|
} | undefined;
|
|
95
|
+
localSettings?: import("../../../table/types").LocalSettingsType | undefined;
|
|
97
96
|
};
|
|
98
97
|
export default useTableProps;
|
|
@@ -35,7 +35,8 @@ var useTableProps = function useTableProps(props) {
|
|
|
35
35
|
closeDrawer = props.closeDrawer,
|
|
36
36
|
refreshData = props.refreshData,
|
|
37
37
|
handleFilterChange = props.handleFilterChange,
|
|
38
|
-
tableRef = props.tableRef
|
|
38
|
+
tableRef = props.tableRef,
|
|
39
|
+
getInitialValues = props.getInitialValues;
|
|
39
40
|
var propsTitle = originProps.title,
|
|
40
41
|
propsSubTitle = originProps.subTitle,
|
|
41
42
|
titleButtons = originProps.titleButtons,
|
|
@@ -45,7 +46,9 @@ var useTableProps = function useTableProps(props) {
|
|
|
45
46
|
search = originProps.search,
|
|
46
47
|
clickToDetail = originProps.clickToDetail,
|
|
47
48
|
propsOnRow = originProps.onRow,
|
|
48
|
-
filterBy = originProps.filterBy
|
|
49
|
+
filterBy = originProps.filterBy,
|
|
50
|
+
currentSettingKey = originProps.currentSettingKey,
|
|
51
|
+
__id = originProps.__id;
|
|
49
52
|
var _ref = operation || {},
|
|
50
53
|
items = _ref.items,
|
|
51
54
|
show = _ref.show,
|
|
@@ -279,12 +282,15 @@ var useTableProps = function useTableProps(props) {
|
|
|
279
282
|
if (!(propsFilter !== null && propsFilter !== void 0 && propsFilter.show) && !(search !== null && search !== void 0 && search.show)) {
|
|
280
283
|
return null;
|
|
281
284
|
}
|
|
282
|
-
|
|
285
|
+
var dom = /*#__PURE__*/React.createElement(Filter, _extends({}, propsFilter, {
|
|
283
286
|
componentId: componentId,
|
|
284
287
|
search: search,
|
|
285
288
|
handleValuesChange: handleFilterChange,
|
|
286
|
-
filterBy: filterBy
|
|
289
|
+
filterBy: filterBy,
|
|
290
|
+
getInitialValues: getInitialValues
|
|
287
291
|
}));
|
|
292
|
+
dom.__proto__.items = propsFilter === null || propsFilter === void 0 ? void 0 : propsFilter.items;
|
|
293
|
+
return dom;
|
|
288
294
|
}, [propsFilter, search]);
|
|
289
295
|
var onRow = useMemoizedFn(function (record) {
|
|
290
296
|
if (!(clickToDetail !== null && clickToDetail !== void 0 && clickToDetail.show)) {
|
|
@@ -315,6 +321,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
315
321
|
});
|
|
316
322
|
});
|
|
317
323
|
return _objectSpread(_objectSpread({}, originProps), {}, {
|
|
324
|
+
currentComponentId: componentId,
|
|
318
325
|
title: title,
|
|
319
326
|
pagination: pagination,
|
|
320
327
|
columns: columns,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DataSourceTableProps } from '../type';
|
|
3
2
|
declare type Params = {
|
|
4
3
|
pagination?: {
|
|
@@ -12,7 +11,7 @@ declare type Params = {
|
|
|
12
11
|
sortBy: string;
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
|
-
declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
14
|
+
declare const useTableQuery: (props: DataSourceTableProps, currentSettingHash: string) => {
|
|
16
15
|
queryPageConfig: {
|
|
17
16
|
page: number;
|
|
18
17
|
pageSize: number;
|
|
@@ -29,5 +28,6 @@ declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
|
29
28
|
refreshData: () => void;
|
|
30
29
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
31
30
|
refreshCurrentPage: () => void;
|
|
31
|
+
getInitialValues: () => Record<string, any>;
|
|
32
32
|
};
|
|
33
33
|
export default useTableQuery;
|
|
@@ -10,13 +10,24 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { useState } from 'react';
|
|
13
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
14
14
|
import { useMemoizedFn } from 'ahooks';
|
|
15
|
-
|
|
15
|
+
import { getCurrentViewModeFromLocalStorage, getTableSettingByCurrentViewMode, setTableSettingToLocalStorage } from "../../../table/Table/utils";
|
|
16
|
+
var useTableQuery = function useTableQuery(props, currentSettingHash) {
|
|
16
17
|
var _tabs$items, _tabs$items2;
|
|
17
18
|
var filterBy = props.filterBy,
|
|
18
19
|
sortBy = props.sortBy,
|
|
19
|
-
tabs = props.tabs
|
|
20
|
+
tabs = props.tabs,
|
|
21
|
+
localSettings = props.localSettings;
|
|
22
|
+
var tableId = useMemo(function () {
|
|
23
|
+
if (props.__designMode === 'design') {
|
|
24
|
+
return 'designMode-mock-table-id';
|
|
25
|
+
}
|
|
26
|
+
return (props === null || props === void 0 ? void 0 : props.currentComponentId) || props.__id;
|
|
27
|
+
}, [props.__id, props.__designMode, props === null || props === void 0 ? void 0 : props.currentComponentId]);
|
|
28
|
+
var currentViewMode = useMemo(function () {
|
|
29
|
+
return getCurrentViewModeFromLocalStorage(tableId) || 'grid';
|
|
30
|
+
}, [tableId]);
|
|
20
31
|
|
|
21
32
|
// 分页配置
|
|
22
33
|
var _useState = useState({
|
|
@@ -28,19 +39,50 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
28
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
40
|
queryPageConfig = _useState2[0],
|
|
30
41
|
setQueryPageConfig = _useState2[1];
|
|
42
|
+
var getInitialValues = useMemoizedFn(function () {
|
|
43
|
+
try {
|
|
44
|
+
if (!tableId) return {};
|
|
45
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
46
|
+
console.log('setting22', setting);
|
|
47
|
+
return (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// 初始读取本地 filters(若开启本地记忆且 scope 包含 filters)
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
var _localSettings$scope;
|
|
56
|
+
if (!tableId) return;
|
|
57
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope = localSettings.scope) !== null && _localSettings$scope !== void 0 && _localSettings$scope.includes('filters'));
|
|
58
|
+
if (!enable) return;
|
|
59
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
60
|
+
var persisted = (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
61
|
+
if (persisted && Object.keys(persisted).length > 0) {
|
|
62
|
+
setQueryPageConfig(function (prev) {
|
|
63
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
64
|
+
filter: _objectSpread(_objectSpread({}, prev.filter), persisted)
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [tableId, currentViewMode, JSON.stringify(localSettings)]);
|
|
31
69
|
|
|
32
70
|
// 分页变化
|
|
33
71
|
var handleValuesChange = useMemoizedFn(function (params, allParams) {
|
|
72
|
+
var _localSettings$scope2;
|
|
34
73
|
var _ref = params.pagination || {},
|
|
35
74
|
page = _ref.page,
|
|
36
75
|
size = _ref.size;
|
|
76
|
+
var nextFilterForSave = null;
|
|
37
77
|
setQueryPageConfig(function (prev) {
|
|
38
78
|
var sort = prev.sort || sortBy;
|
|
39
79
|
var filter = prev.filter;
|
|
40
80
|
if ("tabs" in params) {
|
|
41
81
|
var _params$tabs, _params$tabs2;
|
|
42
82
|
sort = ((_params$tabs = params.tabs) === null || _params$tabs === void 0 ? void 0 : _params$tabs.sortBy) || sortBy || "";
|
|
43
|
-
|
|
83
|
+
var tabsFilter = ((_params$tabs2 = params.tabs) === null || _params$tabs2 === void 0 ? void 0 : _params$tabs2.filterBy) || {};
|
|
84
|
+
filter = _objectSpread(_objectSpread({}, prev.filter), tabsFilter);
|
|
85
|
+
nextFilterForSave = filter;
|
|
44
86
|
}
|
|
45
87
|
if ("order_by" in params) {
|
|
46
88
|
var _allParams$tabs;
|
|
@@ -53,14 +95,57 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
53
95
|
filter: filter
|
|
54
96
|
});
|
|
55
97
|
});
|
|
98
|
+
|
|
99
|
+
// 当 tabs 变化导致 filter 变更时,同步写入本地(遵循 localSettings)
|
|
100
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope2 = localSettings.scope) !== null && _localSettings$scope2 !== void 0 && _localSettings$scope2.includes('filters'));
|
|
101
|
+
if (enable && tableId && nextFilterForSave) {
|
|
102
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
103
|
+
var filtered = {};
|
|
104
|
+
Object.keys(nextFilterForSave).forEach(function (k) {
|
|
105
|
+
if (!excluded.has(k)) {
|
|
106
|
+
filtered[k] = nextFilterForSave[k];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
setTableSettingToLocalStorage({
|
|
110
|
+
tableId: tableId,
|
|
111
|
+
tableSettingObj: {
|
|
112
|
+
filters: filtered
|
|
113
|
+
},
|
|
114
|
+
currentViewMode: currentViewMode,
|
|
115
|
+
currentSettingHash: currentSettingHash
|
|
116
|
+
});
|
|
117
|
+
}
|
|
56
118
|
});
|
|
57
119
|
var handleFilterChange = useMemoizedFn(function (changedFields, allFields) {
|
|
120
|
+
var _localSettings$scope3;
|
|
121
|
+
var nextFilter = _objectSpread({}, allFields);
|
|
58
122
|
setQueryPageConfig(function (prev) {
|
|
59
123
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
60
124
|
page: 1,
|
|
61
|
-
filter: _objectSpread(_objectSpread(_objectSpread({}, prev.filter),
|
|
125
|
+
filter: _objectSpread(_objectSpread(_objectSpread({}, prev.filter), nextFilter), filterBy || {})
|
|
62
126
|
});
|
|
63
127
|
});
|
|
128
|
+
|
|
129
|
+
// 写入本地(仅当开启本地记忆且 scope 包含 filters)
|
|
130
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope3 = localSettings.scope) !== null && _localSettings$scope3 !== void 0 && _localSettings$scope3.includes('filters'));
|
|
131
|
+
if (enable && tableId) {
|
|
132
|
+
// 按 excludedFilterFields 过滤写入
|
|
133
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
134
|
+
var filtered = {};
|
|
135
|
+
Object.keys(nextFilter || {}).forEach(function (k) {
|
|
136
|
+
if (!excluded.has(k)) {
|
|
137
|
+
filtered[k] = nextFilter[k];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
setTableSettingToLocalStorage({
|
|
141
|
+
tableId: tableId,
|
|
142
|
+
tableSettingObj: {
|
|
143
|
+
filters: filtered
|
|
144
|
+
},
|
|
145
|
+
currentViewMode: currentViewMode,
|
|
146
|
+
currentSettingHash: currentSettingHash
|
|
147
|
+
});
|
|
148
|
+
}
|
|
64
149
|
});
|
|
65
150
|
var refreshData = useMemoizedFn(function () {
|
|
66
151
|
setQueryPageConfig(function (prev) {
|
|
@@ -80,7 +165,8 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
80
165
|
handleValuesChange: handleValuesChange,
|
|
81
166
|
refreshData: refreshData,
|
|
82
167
|
handleFilterChange: handleFilterChange,
|
|
83
|
-
refreshCurrentPage: refreshCurrentPage
|
|
168
|
+
refreshCurrentPage: refreshCurrentPage,
|
|
169
|
+
getInitialValues: getInitialValues
|
|
84
170
|
};
|
|
85
171
|
};
|
|
86
172
|
export default useTableQuery;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnType } from 'antd/es/table';
|
|
3
|
+
import { LocalSettingsType } from '../../table/types';
|
|
3
4
|
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
4
5
|
export declare type OperationItem = {
|
|
5
6
|
label?: string;
|
|
@@ -13,6 +14,9 @@ export declare type OperationItem = {
|
|
|
13
14
|
afterClose?: () => void;
|
|
14
15
|
};
|
|
15
16
|
export interface DataSourceTableProps {
|
|
17
|
+
__id?: string;
|
|
18
|
+
currentComponentId?: string;
|
|
19
|
+
currentSettingKey?: string;
|
|
16
20
|
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
17
21
|
subTitle?: string | React.ReactNode | (() => React.ReactNode);
|
|
18
22
|
titleButtons?: {
|
|
@@ -76,4 +80,5 @@ export interface DataSourceTableProps {
|
|
|
76
80
|
create?: Record<string, any>;
|
|
77
81
|
destroy?: Record<string, any>;
|
|
78
82
|
};
|
|
83
|
+
localSettings?: LocalSettingsType;
|
|
79
84
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const Subdomain: React.FC<import("antd").InputProps & {
|
|
3
3
|
onChange: (value: string) => void;
|
|
4
4
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
5
|
-
rootDomain: "custom" | "
|
|
5
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|