@teamias/rex-design 0.0.1
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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/components/action-buttons/action-buttons.d.ts +2 -0
- package/dist/components/action-buttons/action-buttons.js +182 -0
- package/dist/components/action-buttons/demo/index.d.ts +2 -0
- package/dist/components/action-buttons/demo/index.js +69 -0
- package/dist/components/action-buttons/index.d.ts +3 -0
- package/dist/components/action-buttons/index.js +3 -0
- package/dist/components/action-buttons/modules/handlerFilter.d.ts +2 -0
- package/dist/components/action-buttons/modules/handlerFilter.js +62 -0
- package/dist/components/action-buttons/types.d.ts +96 -0
- package/dist/components/action-buttons/types.js +3 -0
- package/dist/components/base-form/base-form.d.ts +3 -0
- package/dist/components/base-form/base-form.js +260 -0
- package/dist/components/base-form/demo/index.d.ts +4 -0
- package/dist/components/base-form/demo/index.js +515 -0
- package/dist/components/base-form/index.d.ts +4 -0
- package/dist/components/base-form/index.js +4 -0
- package/dist/components/base-form/locales/en-US.json +21 -0
- package/dist/components/base-form/locales/zh-CN.json +21 -0
- package/dist/components/base-form/locales.index.d.ts +42 -0
- package/dist/components/base-form/locales.index.js +4 -0
- package/dist/components/base-form/modules/dependencyUtils.d.ts +13 -0
- package/dist/components/base-form/modules/dependencyUtils.js +43 -0
- package/dist/components/base-form/modules/handlerData.d.ts +8 -0
- package/dist/components/base-form/modules/handlerData.js +59 -0
- package/dist/components/base-form/modules/renderComponentNode.d.ts +11 -0
- package/dist/components/base-form/modules/renderComponentNode.js +607 -0
- package/dist/components/base-form/modules/valuesToFields.d.ts +10 -0
- package/dist/components/base-form/modules/valuesToFields.js +18 -0
- package/dist/components/base-form/style/index.d.ts +3 -0
- package/dist/components/base-form/style/index.js +8 -0
- package/dist/components/base-form/types.d.ts +181 -0
- package/dist/components/base-form/types.js +10 -0
- package/dist/components/base-list-table/base-list-table.d.ts +33 -0
- package/dist/components/base-list-table/base-list-table.js +292 -0
- package/dist/components/base-list-table/demo/BasicBaseListTable.d.ts +2 -0
- package/dist/components/base-list-table/demo/BasicBaseListTable.js +1469 -0
- package/dist/components/base-list-table/demo/NoData.d.ts +2 -0
- package/dist/components/base-list-table/demo/NoData.js +55 -0
- package/dist/components/base-list-table/demo/TableMaxRowCount.d.ts +2 -0
- package/dist/components/base-list-table/demo/TableMaxRowCount.js +1696 -0
- package/dist/components/base-list-table/demo/VirtualDemo.d.ts +2 -0
- package/dist/components/base-list-table/demo/VirtualDemo.js +548 -0
- package/dist/components/base-list-table/index.d.ts +1 -0
- package/dist/components/base-list-table/index.js +1 -0
- package/dist/components/base-list-table/style/index.d.ts +5 -0
- package/dist/components/base-list-table/style/index.js +17 -0
- package/dist/components/base-table/base-table.d.ts +51 -0
- package/dist/components/base-table/base-table.js +291 -0
- package/dist/components/base-table/components/BaseTableRow.d.ts +1 -0
- package/dist/components/base-table/components/BaseTableRow.js +129 -0
- package/dist/components/base-table/demo/BaseTableAll.d.ts +2 -0
- package/dist/components/base-table/demo/BaseTableAll.js +66 -0
- package/dist/components/base-table/demo/BaseTableBasic.d.ts +2 -0
- package/dist/components/base-table/demo/BaseTableBasic.js +58 -0
- package/dist/components/base-table/demo/BaseTableIndex.d.ts +2 -0
- package/dist/components/base-table/demo/BaseTableIndex.js +57 -0
- package/dist/components/base-table/demo/BaseTableRowSelect.d.ts +2 -0
- package/dist/components/base-table/demo/BaseTableRowSelect.js +45 -0
- package/dist/components/base-table/demo/tableData.d.ts +332 -0
- package/dist/components/base-table/demo/tableData.js +293 -0
- package/dist/components/base-table/index.d.ts +1 -0
- package/dist/components/base-table/index.js +1 -0
- package/dist/components/base-table/style/index.d.ts +3 -0
- package/dist/components/base-table/style/index.js +9 -0
- package/dist/components/data-cell/data-cell.d.ts +3 -0
- package/dist/components/data-cell/data-cell.js +17 -0
- package/dist/components/data-cell/demo/index.d.ts +2 -0
- package/dist/components/data-cell/demo/index.js +332 -0
- package/dist/components/data-cell/index.d.ts +2 -0
- package/dist/components/data-cell/index.js +2 -0
- package/dist/components/data-cell/modules/cellItemMap.d.ts +3 -0
- package/dist/components/data-cell/modules/cellItemMap.js +374 -0
- package/dist/components/data-cell/style/index.d.ts +7 -0
- package/dist/components/data-cell/style/index.js +23 -0
- package/dist/components/data-cell/types.d.ts +192 -0
- package/dist/components/data-cell/types.js +1 -0
- package/dist/components/icons/assets/icon-park--arrow-up.svg +7 -0
- package/dist/components/icons/assets/index.d.ts +4 -0
- package/dist/components/icons/assets/index.js +9 -0
- package/dist/components/icons/assets/svg-spinners--blocks-shuffle-3.svg +21 -0
- package/dist/components/icons/demo/index.d.ts +2 -0
- package/dist/components/icons/demo/index.js +43 -0
- package/dist/components/icons/icons.d.ts +39 -0
- package/dist/components/icons/icons.js +251 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/index.js +1 -0
- package/dist/components/icons/style/index.d.ts +2 -0
- package/dist/components/icons/style/index.js +5 -0
- package/dist/components/media-viewer/demo/index.d.ts +2 -0
- package/dist/components/media-viewer/demo/index.js +23 -0
- package/dist/components/media-viewer/index.d.ts +1 -0
- package/dist/components/media-viewer/index.js +1 -0
- package/dist/components/media-viewer/media-viewer.d.ts +48 -0
- package/dist/components/media-viewer/media-viewer.js +119 -0
- package/dist/components/media-viewer/style/index.d.ts +6 -0
- package/dist/components/media-viewer/style/index.js +31 -0
- package/dist/hooks/request-fields-container/demo/index.d.ts +2 -0
- package/dist/hooks/request-fields-container/demo/index.js +36 -0
- package/dist/hooks/request-fields-container/index.d.ts +4 -0
- package/dist/hooks/request-fields-container/index.js +3 -0
- package/dist/hooks/request-fields-container/request-fields-container-context-provider.d.ts +22 -0
- package/dist/hooks/request-fields-container/request-fields-container-context-provider.js +134 -0
- package/dist/hooks/request-fields-container/request-fields-container-context.d.ts +39 -0
- package/dist/hooks/request-fields-container/request-fields-container-context.js +5 -0
- package/dist/hooks/request-fields-container/request-fields-container-hoc.d.ts +4 -0
- package/dist/hooks/request-fields-container/request-fields-container-hoc.js +31 -0
- package/dist/hooks/request-fields-container/use-request-fields-container.d.ts +22 -0
- package/dist/hooks/request-fields-container/use-request-fields-container.js +131 -0
- package/dist/hooks/rex-pro-config-provider/demo/index.d.ts +2 -0
- package/dist/hooks/rex-pro-config-provider/demo/index.js +61 -0
- package/dist/hooks/rex-pro-config-provider/index.d.ts +2 -0
- package/dist/hooks/rex-pro-config-provider/index.js +2 -0
- package/dist/hooks/rex-pro-config-provider/rex-pro-config-context.d.ts +27 -0
- package/dist/hooks/rex-pro-config-provider/rex-pro-config-context.js +33 -0
- package/dist/hooks/rex-pro-config-provider/rex-pro-config-provider.d.ts +6 -0
- package/dist/hooks/rex-pro-config-provider/rex-pro-config-provider.js +24 -0
- package/dist/hooks/rex-pro-config-provider/use-rex-pro-config-provider.d.ts +2 -0
- package/dist/hooks/rex-pro-config-provider/use-rex-pro-config-provider.js +11 -0
- package/dist/hooks/use-state-data/demo/index.d.ts +2 -0
- package/dist/hooks/use-state-data/demo/index.js +135 -0
- package/dist/hooks/use-state-data/index.d.ts +1 -0
- package/dist/hooks/use-state-data/index.js +1 -0
- package/dist/hooks/use-state-data/use-state-data.d.ts +11 -0
- package/dist/hooks/use-state-data/use-state-data.js +64 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/types/svg.d.ts +4 -0
- package/dist/utils/locales/en-US.json +13 -0
- package/dist/utils/locales/index.d.ts +26 -0
- package/dist/utils/locales/index.js +4 -0
- package/dist/utils/locales/zh-CN.json +13 -0
- package/package.json +90 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) cloudovo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @ias/rex-design
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.org/package/@ias/rex-design)
|
|
4
|
+
[](https://npmjs.org/package/@ias/rex-design)
|
|
5
|
+
|
|
6
|
+
A react library developed with dumi
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
TODO
|
|
11
|
+
|
|
12
|
+
## Options
|
|
13
|
+
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# install dependencies
|
|
20
|
+
$ pnpm install
|
|
21
|
+
|
|
22
|
+
# develop library by docs demo
|
|
23
|
+
$ pnpm start
|
|
24
|
+
|
|
25
|
+
# build library source code
|
|
26
|
+
$ pnpm run build
|
|
27
|
+
|
|
28
|
+
# build library source code in watch mode
|
|
29
|
+
$ pnpm run build:watch
|
|
30
|
+
|
|
31
|
+
# build docs
|
|
32
|
+
$ pnpm run docs:build
|
|
33
|
+
|
|
34
|
+
# Locally preview the production build.
|
|
35
|
+
$ pnpm run docs:preview
|
|
36
|
+
|
|
37
|
+
# check your project for potential problems
|
|
38
|
+
$ pnpm run doctor
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## LICENSE
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IActionButtonsProps } from "./types";
|
|
2
|
+
export declare const ActionButtons: ({ requestFields, requestFieldsUrl, requestFieldsParams, fieldsConfig, items, dropdownProps, size, record, onHasButtons, onClick, labelRender, }: IActionButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,182 @@
|
|
|
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 = ["leftIcon", "rightIcon"],
|
|
3
|
+
_excluded2 = ["leftIcon", "rightIcon"];
|
|
4
|
+
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); }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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); } }
|
|
14
|
+
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); }); }; }
|
|
15
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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); }
|
|
18
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
19
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
|
+
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; }
|
|
21
|
+
import { useRequestFields, useRexProConfigProvider } from "../..";
|
|
22
|
+
import { Button, Dropdown, Skeleton, Space } from "antd";
|
|
23
|
+
import { useMemo } from "react";
|
|
24
|
+
import { handlerFilter } from "./modules/handlerFilter";
|
|
25
|
+
import React from "react";
|
|
26
|
+
export var ActionButtons = function ActionButtons(_ref) {
|
|
27
|
+
var requestFields = _ref.requestFields,
|
|
28
|
+
requestFieldsUrl = _ref.requestFieldsUrl,
|
|
29
|
+
requestFieldsParams = _ref.requestFieldsParams,
|
|
30
|
+
fieldsConfig = _ref.fieldsConfig,
|
|
31
|
+
items = _ref.items,
|
|
32
|
+
dropdownProps = _ref.dropdownProps,
|
|
33
|
+
size = _ref.size,
|
|
34
|
+
record = _ref.record,
|
|
35
|
+
onHasButtons = _ref.onHasButtons,
|
|
36
|
+
_onClick = _ref.onClick,
|
|
37
|
+
labelRender = _ref.labelRender;
|
|
38
|
+
var _useRexProConfigProvi = useRexProConfigProvider(),
|
|
39
|
+
operationPermission = _useRexProConfigProvi.operationPermission,
|
|
40
|
+
formatMessage = _useRexProConfigProvi.intl.formatMessage;
|
|
41
|
+
var _useRequestFields = useRequestFields({
|
|
42
|
+
request: requestFields,
|
|
43
|
+
requestFieldsUrl: requestFieldsUrl,
|
|
44
|
+
requestFieldsParams: requestFieldsParams,
|
|
45
|
+
fieldsConfig: fieldsConfig
|
|
46
|
+
}),
|
|
47
|
+
loading = _useRequestFields.loading,
|
|
48
|
+
fields = _useRequestFields.fields;
|
|
49
|
+
var _useMemo = useMemo(function () {
|
|
50
|
+
var arr = [].concat(_toConsumableArray(fields), _toConsumableArray(items || []));
|
|
51
|
+
var flag = !!arr.map(function (ii) {
|
|
52
|
+
return ii.items || [];
|
|
53
|
+
}).flat().filter(Boolean).length;
|
|
54
|
+
return {
|
|
55
|
+
inlineItems: arr.sort(function (a, b) {
|
|
56
|
+
var _a$sort, _b$sort;
|
|
57
|
+
return ((_a$sort = a.sort) !== null && _a$sort !== void 0 ? _a$sort : 99) - ((_b$sort = b.sort) !== null && _b$sort !== void 0 ? _b$sort : 99);
|
|
58
|
+
}),
|
|
59
|
+
hasButtons: flag
|
|
60
|
+
};
|
|
61
|
+
}, [fields, items]),
|
|
62
|
+
inlineItems = _useMemo.inlineItems,
|
|
63
|
+
hasButtons = _useMemo.hasButtons;
|
|
64
|
+
|
|
65
|
+
/** 渲染label */
|
|
66
|
+
var inlineLabelRender = function inlineLabelRender(item) {
|
|
67
|
+
var _item$buttonProps, _item$buttonProps2;
|
|
68
|
+
var oldNode = /*#__PURE__*/React.createElement(Space, {
|
|
69
|
+
size: 4
|
|
70
|
+
}, (_item$buttonProps = item.buttonProps) === null || _item$buttonProps === void 0 ? void 0 : _item$buttonProps.leftIcon, item.label, (_item$buttonProps2 = item.buttonProps) === null || _item$buttonProps2 === void 0 ? void 0 : _item$buttonProps2.rightIcon);
|
|
71
|
+
return labelRender ? labelRender(oldNode, item) : oldNode;
|
|
72
|
+
};
|
|
73
|
+
var handler = function handler(item, type) {
|
|
74
|
+
if (!handlerFilter(record, item.filter)) return undefined;
|
|
75
|
+
var config = {
|
|
76
|
+
label: item.label,
|
|
77
|
+
key: item.value,
|
|
78
|
+
value: item.value,
|
|
79
|
+
buttonProps: item.buttonProps,
|
|
80
|
+
onClick: function () {
|
|
81
|
+
var _onClick2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
82
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
83
|
+
while (1) switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
_onClick === null || _onClick === void 0 || _onClick({
|
|
86
|
+
value: item.value,
|
|
87
|
+
item: item,
|
|
88
|
+
record: record
|
|
89
|
+
});
|
|
90
|
+
case 1:
|
|
91
|
+
case "end":
|
|
92
|
+
return _context.stop();
|
|
93
|
+
}
|
|
94
|
+
}, _callee);
|
|
95
|
+
}));
|
|
96
|
+
function onClick() {
|
|
97
|
+
return _onClick2.apply(this, arguments);
|
|
98
|
+
}
|
|
99
|
+
return onClick;
|
|
100
|
+
}()
|
|
101
|
+
};
|
|
102
|
+
if (type === 'dropdown') {
|
|
103
|
+
config.label = inlineLabelRender(item);
|
|
104
|
+
delete config.buttonProps;
|
|
105
|
+
}
|
|
106
|
+
return config;
|
|
107
|
+
};
|
|
108
|
+
if (loading) {
|
|
109
|
+
return /*#__PURE__*/React.createElement(Space, {
|
|
110
|
+
size: [8, 16],
|
|
111
|
+
wrap: true
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Skeleton.Button, {
|
|
113
|
+
active: true,
|
|
114
|
+
size: size === 'middle' ? undefined : size
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
onHasButtons === null || onHasButtons === void 0 || onHasButtons(hasButtons);
|
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, inlineItems.map(function (groupItem, index) {
|
|
119
|
+
var arr = [];
|
|
120
|
+
if (groupItem.hidden) return [];
|
|
121
|
+
if (operationPermission && !operationPermission(groupItem.permissionKey)) return [];
|
|
122
|
+
if (groupItem.type === 'button_items') {
|
|
123
|
+
var _groupItem$items;
|
|
124
|
+
var els = ((_groupItem$items = groupItem.items) === null || _groupItem$items === void 0 ? void 0 : _groupItem$items.map(function (rawItem, subIndex) {
|
|
125
|
+
var _item$label;
|
|
126
|
+
if (rawItem.hidden) return;
|
|
127
|
+
if (operationPermission && !operationPermission(rawItem.permissionKey)) return;
|
|
128
|
+
var item = handler(rawItem, 'button');
|
|
129
|
+
if (!item) return;
|
|
130
|
+
var _ref2 = item.buttonProps || {},
|
|
131
|
+
leftIcon = _ref2.leftIcon,
|
|
132
|
+
rightIcon = _ref2.rightIcon,
|
|
133
|
+
otherButtonProps = _objectWithoutProperties(_ref2, _excluded);
|
|
134
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
135
|
+
size: size
|
|
136
|
+
}, otherButtonProps, {
|
|
137
|
+
key: "".concat(index, "-").concat(item.key, "-").concat(subIndex),
|
|
138
|
+
onClick: item.onClick
|
|
139
|
+
}), /*#__PURE__*/React.createElement(Space, {
|
|
140
|
+
size: 4
|
|
141
|
+
}, inlineLabelRender(_objectSpread(_objectSpread({}, item), {}, {
|
|
142
|
+
label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : formatMessage({
|
|
143
|
+
id: 'bit.common.action-buttons.item-label',
|
|
144
|
+
defaultMessage: '未配置 button label'
|
|
145
|
+
})
|
|
146
|
+
}))));
|
|
147
|
+
})) || [];
|
|
148
|
+
arr.push.apply(arr, _toConsumableArray(els));
|
|
149
|
+
} else if (groupItem.type === 'button_group') {
|
|
150
|
+
var groupItems = (groupItem.items || []).map(function (item) {
|
|
151
|
+
if (item.hidden) return;
|
|
152
|
+
if (operationPermission && !operationPermission(item.permissionKey)) return;
|
|
153
|
+
return handler(item, 'dropdown');
|
|
154
|
+
}).filter(Boolean);
|
|
155
|
+
if (groupItems.length) {
|
|
156
|
+
var _groupItem$label;
|
|
157
|
+
var _ref3 = groupItem.buttonProps || {},
|
|
158
|
+
leftIcon = _ref3.leftIcon,
|
|
159
|
+
rightIcon = _ref3.rightIcon,
|
|
160
|
+
otherButtonProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
161
|
+
arr.push( /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
162
|
+
key: index,
|
|
163
|
+
arrow: true
|
|
164
|
+
}, dropdownProps, {
|
|
165
|
+
menu: _objectSpread(_objectSpread({}, dropdownProps === null || dropdownProps === void 0 ? void 0 : dropdownProps.menu), {}, {
|
|
166
|
+
items: groupItems
|
|
167
|
+
})
|
|
168
|
+
}), /*#__PURE__*/React.createElement(Button, _extends({
|
|
169
|
+
size: size
|
|
170
|
+
}, otherButtonProps), /*#__PURE__*/React.createElement(Space, {
|
|
171
|
+
size: 4
|
|
172
|
+
}, inlineLabelRender(_objectSpread(_objectSpread({}, groupItem), {}, {
|
|
173
|
+
label: (_groupItem$label = groupItem.label) !== null && _groupItem$label !== void 0 ? _groupItem$label : formatMessage({
|
|
174
|
+
id: 'bit.common.action-buttons.group-label',
|
|
175
|
+
defaultMessage: '未配置 group label'
|
|
176
|
+
})
|
|
177
|
+
}))))));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return arr;
|
|
181
|
+
}));
|
|
182
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { StepBackwardOutlined } from '@ant-design/icons';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ActionButtons } from "../../..";
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ActionButtons, {
|
|
6
|
+
items: [{
|
|
7
|
+
type: 'button_items',
|
|
8
|
+
value: '1',
|
|
9
|
+
hidden: false,
|
|
10
|
+
items: [{
|
|
11
|
+
label: '按钮1111',
|
|
12
|
+
value: '1',
|
|
13
|
+
buttonProps: {
|
|
14
|
+
leftIcon: /*#__PURE__*/React.createElement(StepBackwardOutlined, null),
|
|
15
|
+
rightIcon: /*#__PURE__*/React.createElement(StepBackwardOutlined, null)
|
|
16
|
+
}
|
|
17
|
+
}, {
|
|
18
|
+
label: '按钮2',
|
|
19
|
+
value: '2',
|
|
20
|
+
hidden: false
|
|
21
|
+
}]
|
|
22
|
+
}, {
|
|
23
|
+
type: 'button_items',
|
|
24
|
+
value: '2',
|
|
25
|
+
items: [{
|
|
26
|
+
label: '按钮3',
|
|
27
|
+
value: '3'
|
|
28
|
+
}, {
|
|
29
|
+
label: '按钮4',
|
|
30
|
+
value: '4'
|
|
31
|
+
}]
|
|
32
|
+
}, {
|
|
33
|
+
type: 'button_group',
|
|
34
|
+
value: '3',
|
|
35
|
+
hidden: false,
|
|
36
|
+
buttonProps: {
|
|
37
|
+
leftIcon: /*#__PURE__*/React.createElement(StepBackwardOutlined, null),
|
|
38
|
+
rightIcon: /*#__PURE__*/React.createElement(StepBackwardOutlined, null)
|
|
39
|
+
},
|
|
40
|
+
items: [{
|
|
41
|
+
label: '按钮5',
|
|
42
|
+
value: '5',
|
|
43
|
+
buttonProps: {
|
|
44
|
+
leftIcon: /*#__PURE__*/React.createElement(StepBackwardOutlined, null),
|
|
45
|
+
rightIcon: /*#__PURE__*/React.createElement(StepBackwardOutlined, null)
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
label: '按钮6',
|
|
49
|
+
value: '6'
|
|
50
|
+
}]
|
|
51
|
+
}, {
|
|
52
|
+
type: 'button_group',
|
|
53
|
+
value: '4',
|
|
54
|
+
items: [{
|
|
55
|
+
label: '按钮7',
|
|
56
|
+
value: '7',
|
|
57
|
+
hidden: false
|
|
58
|
+
}, {
|
|
59
|
+
label: '按钮8',
|
|
60
|
+
value: '8',
|
|
61
|
+
hidden: false
|
|
62
|
+
}]
|
|
63
|
+
}],
|
|
64
|
+
onClick: function onClick(_ref) {
|
|
65
|
+
var value = _ref.value;
|
|
66
|
+
console.log(value);
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
export var handlerFilter = function handlerFilter(data, filter) {
|
|
3
|
+
// 没有过滤条件判断,返回true
|
|
4
|
+
if (!filter || !filter.length) return true;
|
|
5
|
+
// 没有数据,但有过滤条件,返回false
|
|
6
|
+
if (!data) return false;
|
|
7
|
+
var parseValue = function parseValue(pathKey) {
|
|
8
|
+
// 'ssss[0].ewe.we.qqw'
|
|
9
|
+
var paths = pathKey.replace(/\[|\]/g, '.').replace(/\.\./g, '.').split('.');
|
|
10
|
+
var val = paths.slice(1).reduce(function (mainVal, key) {
|
|
11
|
+
if (typeof mainVal === 'undefined') return mainVal;
|
|
12
|
+
if (mainVal === null) return null;
|
|
13
|
+
return mainVal[key];
|
|
14
|
+
}, data[paths[0]]);
|
|
15
|
+
return val;
|
|
16
|
+
};
|
|
17
|
+
var judgeValue = function judgeValue(op, targetValue, dynamicValue) {
|
|
18
|
+
switch (op) {
|
|
19
|
+
case 'eq':
|
|
20
|
+
return targetValue === dynamicValue;
|
|
21
|
+
case 'ne':
|
|
22
|
+
return targetValue !== dynamicValue;
|
|
23
|
+
case 'gt':
|
|
24
|
+
return +targetValue < +dynamicValue;
|
|
25
|
+
case 'lt':
|
|
26
|
+
return +targetValue > +dynamicValue;
|
|
27
|
+
case 'in':
|
|
28
|
+
if (Array.isArray(dynamicValue)) {
|
|
29
|
+
// return targetValue.includes(dynamicValue);
|
|
30
|
+
return dynamicValue.includes(targetValue);
|
|
31
|
+
}
|
|
32
|
+
if (typeof targetValue === 'string') {
|
|
33
|
+
// return targetValue.includes(`${dynamicValue}`);
|
|
34
|
+
return "".concat(dynamicValue).includes("".concat(targetValue));
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
case 'notIn':
|
|
38
|
+
// if (Array.isArray(targetValue)) {
|
|
39
|
+
// return !targetValue.includes(dynamicValue);
|
|
40
|
+
// }
|
|
41
|
+
// else if (typeof targetValue === 'string') {
|
|
42
|
+
// return !targetValue.includes(`${dynamicValue}`);
|
|
43
|
+
// }
|
|
44
|
+
// return false;
|
|
45
|
+
return !judgeValue('in', targetValue, dynamicValue);
|
|
46
|
+
case 'empty':
|
|
47
|
+
if (typeof dynamicValue === 'undefined' || dynamicValue === null) return true;
|
|
48
|
+
if (Array.isArray(dynamicValue)) return dynamicValue.length === 0;
|
|
49
|
+
if (_typeof(dynamicValue) === 'object') return Object.keys(dynamicValue).length === 0;
|
|
50
|
+
if (typeof dynamicValue === 'string') return dynamicValue.trim() === '';
|
|
51
|
+
return false;
|
|
52
|
+
case 'notEmpty':
|
|
53
|
+
return !judgeValue('empty', targetValue, dynamicValue);
|
|
54
|
+
default:
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return filter.every(function (item) {
|
|
59
|
+
var value = parseValue(item.original);
|
|
60
|
+
return judgeValue(item.op, item.target, value);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Button, DropDownProps, GetProps } from "antd";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface IActionButtonsProps {
|
|
4
|
+
/** 自定义渲染label */
|
|
5
|
+
labelRender?: (oldNode: ReactNode, item: IDropDownItem) => ReactNode;
|
|
6
|
+
/** 静态配置 */
|
|
7
|
+
fieldsConfig?: IButtonItems[];
|
|
8
|
+
/** 配置数据 */
|
|
9
|
+
requestFields?: () => Promise<IButtonItems[]>;
|
|
10
|
+
/** 配置数据, 配置url的时候,通过注入请求器的方式获取 */
|
|
11
|
+
requestFieldsUrl?: string;
|
|
12
|
+
/** 配套 */
|
|
13
|
+
requestFieldsParams?: Record<string, unknown>;
|
|
14
|
+
/** 自定义配置 */
|
|
15
|
+
items?: IButtonItems[];
|
|
16
|
+
/**
|
|
17
|
+
* antd Dropdown 配置属性(menu.items 无效)
|
|
18
|
+
*/
|
|
19
|
+
dropdownProps?: DropDownProps;
|
|
20
|
+
/** 尺寸 */
|
|
21
|
+
size?: GetProps<typeof Button>['size'];
|
|
22
|
+
/** 数据 */
|
|
23
|
+
record?: Record<string, unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* 有无按钮
|
|
26
|
+
* - TODO: 注意每渲染一次,都会执行一次,需要在外面做判断
|
|
27
|
+
*/
|
|
28
|
+
onHasButtons?: (has: boolean) => void;
|
|
29
|
+
/** 点击回调 */
|
|
30
|
+
onClick?(data: {
|
|
31
|
+
value: number | string | bigint | undefined;
|
|
32
|
+
item: IDropDownItem;
|
|
33
|
+
record?: Record<string, unknown>;
|
|
34
|
+
}): void | Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export interface IButtonItems {
|
|
37
|
+
/** 按钮组类型 */
|
|
38
|
+
type: 'button_items' | 'button_group';
|
|
39
|
+
/** group 时候需要 */
|
|
40
|
+
label?: string;
|
|
41
|
+
/** 按钮key */
|
|
42
|
+
value: string | number;
|
|
43
|
+
/** group按钮的设置 */
|
|
44
|
+
buttonProps?: Omit<GetProps<typeof Button>, 'onClick' | 'icon'> & {
|
|
45
|
+
leftIcon?: ReactNode;
|
|
46
|
+
rightIcon?: ReactNode;
|
|
47
|
+
};
|
|
48
|
+
/** 每项按钮 */
|
|
49
|
+
items?: IDropDownItem[];
|
|
50
|
+
/**
|
|
51
|
+
* 排序字段
|
|
52
|
+
* @default 99
|
|
53
|
+
*/
|
|
54
|
+
sort?: number;
|
|
55
|
+
/** 控制隐藏 */
|
|
56
|
+
hidden?: boolean;
|
|
57
|
+
/** 权限key */
|
|
58
|
+
permissionKey?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface IDropDownItem {
|
|
61
|
+
/** 按钮名 */
|
|
62
|
+
label: ReactNode;
|
|
63
|
+
/** 按钮key */
|
|
64
|
+
value: string | number;
|
|
65
|
+
/** 针对按钮的设置 */
|
|
66
|
+
buttonProps?: Omit<GetProps<typeof Button>, 'onClick' | 'icon'> & {
|
|
67
|
+
leftIcon?: ReactNode;
|
|
68
|
+
rightIcon?: ReactNode;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* - 全部满足后,可显示
|
|
72
|
+
* - 不配置或缺少解析数据源,正常显示
|
|
73
|
+
*/
|
|
74
|
+
filter?: TButtonFilterItem[];
|
|
75
|
+
/** 控制隐藏 */
|
|
76
|
+
hidden?: boolean;
|
|
77
|
+
/** 权限key */
|
|
78
|
+
permissionKey?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface TButtonFilterItem {
|
|
81
|
+
/** 数据源key */
|
|
82
|
+
original: string;
|
|
83
|
+
/** 匹配数据值 */
|
|
84
|
+
target?: string | number | null | boolean;
|
|
85
|
+
/**
|
|
86
|
+
* - eq 等于
|
|
87
|
+
* - ne 不等于
|
|
88
|
+
* - gt 大于[数据源大于target]
|
|
89
|
+
* - lt 小于[数据源小于target]
|
|
90
|
+
* - in 包含[支持数组 `['qwe_asd'].includes('qwe_asd')`, 字符串 `'qwe_asd'.includes('qwe_')`]
|
|
91
|
+
* - notIn 不包含[支持数组 `!['qwe_asd'].includes('qwe_asd')`, 字符串 `!'qwe_asd'.includes('qwe_')`]
|
|
92
|
+
* - empty 空
|
|
93
|
+
* - notEmpty 非空
|
|
94
|
+
*/
|
|
95
|
+
op: 'eq' | 'ne' | 'gt' | 'lt' | 'in' | 'notIn' | 'empty' | 'notEmpty';
|
|
96
|
+
}
|