@teamias/rex-design 0.0.1 → 0.0.3
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 -21
- package/README.md +3 -3
- package/dist/components/action-buttons/action-buttons.d.ts +1 -1
- package/dist/components/action-buttons/action-buttons.js +86 -76
- package/dist/components/action-buttons/demo/index.js +61 -58
- package/dist/components/base-form/base-form.js +218 -215
- package/dist/components/base-form/demo/index.js +147 -135
- package/dist/components/base-form/modules/renderComponentNode.d.ts +2 -2
- package/dist/components/base-form/modules/renderComponentNode.js +135 -130
- package/dist/components/base-form/types.d.ts +1 -1
- package/dist/components/base-form/types.js +0 -9
- package/dist/components/base-list-table/base-list-table.d.ts +2 -2
- package/dist/components/base-list-table/base-list-table.js +156 -135
- package/dist/components/base-list-table/demo/BasicBaseListTable.js +22 -13
- package/dist/components/base-list-table/demo/NoData.js +2 -1
- package/dist/components/base-list-table/demo/TableMaxRowCount.js +1669 -1663
- package/dist/components/base-list-table/demo/VirtualDemo.js +22 -13
- package/dist/components/base-table/base-table.d.ts +2 -2
- package/dist/components/base-table/base-table.js +60 -55
- package/dist/components/base-table/components/BaseTableRow.js +79 -66
- package/dist/components/base-table/demo/BaseTableAll.js +6 -2
- package/dist/components/base-table/demo/BaseTableBasic.js +5 -2
- package/dist/components/base-table/demo/BaseTableIndex.js +48 -50
- package/dist/components/base-table/demo/BaseTableRowSelect.js +2 -1
- package/dist/components/data-cell/data-cell.js +5 -4
- package/dist/components/data-cell/demo/index.js +327 -309
- package/dist/components/data-cell/modules/cellItemMap.d.ts +2 -2
- package/dist/components/data-cell/modules/cellItemMap.js +184 -157
- package/dist/components/data-cell/types.d.ts +9 -9
- package/dist/components/icons/demo/index.js +44 -40
- package/dist/components/icons/icons.d.ts +1 -1
- package/dist/components/icons/icons.js +36 -26
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/media-viewer/demo/index.js +24 -20
- package/dist/components/media-viewer/media-viewer.d.ts +1 -1
- package/dist/components/media-viewer/media-viewer.js +13 -12
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +2 -0
- package/dist/{hooks → context}/request-fields-container/demo/index.js +10 -5
- package/dist/{hooks → context}/request-fields-container/index.js +2 -2
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context-provider.js +17 -12
- package/dist/context/request-fields-container/request-fields-container-hoc.d.ts +4 -0
- package/dist/{hooks → context}/request-fields-container/request-fields-container-hoc.js +0 -1
- package/dist/{hooks → context}/request-fields-container/use-request-fields-container.js +2 -2
- package/dist/{hooks → context}/rex-pro-config-provider/demo/index.js +9 -5
- package/dist/{hooks → context}/rex-pro-config-provider/index.js +2 -2
- package/dist/{hooks → context}/rex-pro-config-provider/rex-pro-config-context.js +0 -1
- package/dist/context/rex-pro-config-provider/rex-pro-config-provider.d.ts +5 -0
- package/dist/{hooks → context}/rex-pro-config-provider/rex-pro-config-provider.js +8 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-state-data/use-state-data.js +4 -4
- package/dist/index.d.ts +3 -10
- package/dist/index.js +3 -10
- package/dist/{components/base-form/locales → locales}/en-US.json +30 -21
- package/dist/{components/base-form/locales → locales}/zh-CN.json +30 -21
- package/dist/types/svg.d.ts +3 -3
- package/package.json +37 -33
- package/dist/components/base-form/locales.index.d.ts +0 -42
- package/dist/components/base-form/locales.index.js +0 -4
- package/dist/hooks/request-fields-container/request-fields-container-hoc.d.ts +0 -4
- package/dist/hooks/rex-pro-config-provider/rex-pro-config-provider.d.ts +0 -6
- package/dist/utils/locales/en-US.json +0 -13
- package/dist/utils/locales/index.d.ts +0 -26
- package/dist/utils/locales/index.js +0 -4
- package/dist/utils/locales/zh-CN.json +0 -13
- package/dist/{hooks → context}/request-fields-container/demo/index.d.ts +0 -0
- package/dist/{hooks → context}/request-fields-container/index.d.ts +2 -2
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context-provider.d.ts +0 -0
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context.d.ts +0 -0
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context.js +0 -0
- package/dist/{hooks → context}/request-fields-container/use-request-fields-container.d.ts +0 -0
- package/dist/{hooks → context}/rex-pro-config-provider/demo/index.d.ts +0 -0
- package/dist/{hooks → context}/rex-pro-config-provider/index.d.ts +1 -1
- /package/dist/{hooks → context}/rex-pro-config-provider/rex-pro-config-context.d.ts +0 -0
- /package/dist/{hooks → context}/rex-pro-config-provider/use-rex-pro-config-provider.d.ts +0 -0
- /package/dist/{hooks → context}/rex-pro-config-provider/use-rex-pro-config-provider.js +0 -0
|
@@ -9,7 +9,6 @@ var _excluded = ["valueType", "label", "defaultValue", "childWidths", "fieldProp
|
|
|
9
9
|
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; }
|
|
10
10
|
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); } }
|
|
11
11
|
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); }); }; }
|
|
12
|
-
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); }
|
|
13
12
|
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); }
|
|
14
13
|
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; }
|
|
15
14
|
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; }
|
|
@@ -18,13 +17,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
17
|
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); }
|
|
19
18
|
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; }
|
|
20
19
|
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; }
|
|
21
|
-
|
|
22
|
-
import
|
|
23
|
-
import classNames from "classnames";
|
|
20
|
+
import { ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormDateRangePicker, ProFormDependency, ProFormDigit, ProFormDigitRange, ProFormFieldSet, ProFormItem, ProFormItemRender, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextArea, ProFormTreeSelect } from '@ant-design/pro-components';
|
|
21
|
+
import classNames from 'classnames';
|
|
24
22
|
import dayjs from 'dayjs';
|
|
25
|
-
import React from "react";
|
|
26
23
|
import { BaseForm } from "../base-form";
|
|
27
24
|
import { getFieldsDefaultValues } from "./handlerData";
|
|
25
|
+
import { createElement as _createElement } from "react";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
29
|
var getWidth = function getWidth(val) {
|
|
29
30
|
return {
|
|
30
31
|
width: val,
|
|
@@ -40,12 +41,12 @@ var getPlaceholderPrefix = function getPlaceholderPrefix(type, formatMessage) {
|
|
|
40
41
|
}
|
|
41
42
|
if (['input', 'selectDim', 'inputNumber', 'selectInput'].includes(type)) {
|
|
42
43
|
return formatMessage({
|
|
43
|
-
id: '
|
|
44
|
+
id: 'rex.components.base-form.placeholder.input',
|
|
44
45
|
defaultMessage: '请输入'
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
return formatMessage({
|
|
48
|
-
id: '
|
|
49
|
+
id: 'rex.components.base-form.placeholder.select',
|
|
49
50
|
defaultMessage: '请选择'
|
|
50
51
|
});
|
|
51
52
|
};
|
|
@@ -118,7 +119,7 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
118
119
|
var config = getMergeConfig(localConfig, defaultInject);
|
|
119
120
|
|
|
120
121
|
// console.log(config);
|
|
121
|
-
return /*#__PURE__*/
|
|
122
|
+
return /*#__PURE__*/_createElement(InlineCom, _objectSpread(_objectSpread({}, config), {}, {
|
|
122
123
|
key: defaultInject ? keyStr : undefined
|
|
123
124
|
}));
|
|
124
125
|
};
|
|
@@ -129,9 +130,9 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
129
130
|
formItemProps = _getMergeConfig.formItemProps,
|
|
130
131
|
fieldProps = _getMergeConfig.fieldProps,
|
|
131
132
|
otherConfigProps = _objectWithoutProperties(_getMergeConfig, _excluded2);
|
|
132
|
-
return /*#__PURE__*/
|
|
133
|
+
return /*#__PURE__*/_createElement(ProFormItemRender, _objectSpread(_objectSpread(_objectSpread({
|
|
133
134
|
name: keyStr
|
|
134
|
-
}, otherConfigProps, formItemProps, {
|
|
135
|
+
}, otherConfigProps), formItemProps), {}, {
|
|
135
136
|
key: keyStr
|
|
136
137
|
}), function (customItemProps) {
|
|
137
138
|
return otherProps === null || otherProps === void 0 ? void 0 : otherProps.render(customItemProps, form);
|
|
@@ -147,21 +148,22 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
147
148
|
name = _getMergeConfig2.name,
|
|
148
149
|
_otherConfigProps = _objectWithoutProperties(_getMergeConfig2, _excluded3);
|
|
149
150
|
var inlineItem = item;
|
|
150
|
-
return /*#__PURE__*/
|
|
151
|
+
return /*#__PURE__*/_createElement(ProFormItem, _objectSpread(_objectSpread(_objectSpread({}, _otherConfigProps), _formItemProps), {}, {
|
|
151
152
|
// style={{
|
|
152
153
|
// ...formItemProps?.style,
|
|
153
154
|
// marginBottom: 0,
|
|
154
155
|
// }}
|
|
155
156
|
key: keyStr
|
|
156
|
-
}), /*#__PURE__*/
|
|
157
|
-
className: classNames(
|
|
157
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
158
|
+
className: classNames('base-form-field-multiple-group', {
|
|
158
159
|
compact: inlineItem.compact
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
160
|
+
}),
|
|
161
|
+
children: /*#__PURE__*/_jsx(BaseForm, _objectSpread(_objectSpread({}, outConfig.rawAllProps), {}, {
|
|
162
|
+
itemWidth: "".concat(100 / ((_inlineItem$subItems$ = (_inlineItem$subItems = inlineItem.subItems) === null || _inlineItem$subItems === void 0 ? void 0 : _inlineItem$subItems.length) !== null && _inlineItem$subItems$ !== void 0 ? _inlineItem$subItems$ : 1), "%"),
|
|
163
|
+
fields: inlineItem.subItems,
|
|
164
|
+
itemMarginBottom: 0
|
|
165
|
+
}))
|
|
166
|
+
}));
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
// 特殊包裹过的, 废弃
|
|
@@ -175,25 +177,26 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
175
177
|
_formItemProps2 = _getMergeConfig3.formItemProps,
|
|
176
178
|
_fieldProps2 = _getMergeConfig3.fieldProps,
|
|
177
179
|
_otherConfigProps2 = _objectWithoutProperties(_getMergeConfig3, _excluded4);
|
|
178
|
-
return /*#__PURE__*/
|
|
180
|
+
return /*#__PURE__*/_createElement(ProFormItem, _objectSpread(_objectSpread({}, _formItemProps2), {}, {
|
|
179
181
|
style: _objectSpread(_objectSpread({}, _formItemProps2.style), {}, {
|
|
180
182
|
marginBottom: 0
|
|
181
183
|
}),
|
|
182
184
|
key: keyStr
|
|
183
|
-
}), /*#__PURE__*/
|
|
185
|
+
}), /*#__PURE__*/_jsxs(ProFormFieldSet, _objectSpread(_objectSpread({}, _otherConfigProps2), {}, {
|
|
184
186
|
type: "group",
|
|
185
187
|
space: {
|
|
186
188
|
className: 'base-form-field-group'
|
|
187
189
|
},
|
|
188
190
|
transform: function transform(value) {
|
|
189
191
|
return _defineProperty(_defineProperty({}, fields[0], value[0]), fields[1], value[1]);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
},
|
|
193
|
+
children: [dynamicCom(ProFormSelect, {
|
|
194
|
+
style: getWidth((_childWidths$ = childWidths[0]) !== null && _childWidths$ !== void 0 ? _childWidths$ : 100),
|
|
195
|
+
options: item.options,
|
|
196
|
+
allowClear: false,
|
|
197
|
+
showSearch: true
|
|
198
|
+
}, false), dynamicCom(ProFormText, {}, true)]
|
|
199
|
+
})));
|
|
197
200
|
}
|
|
198
201
|
if (valueType === 'selectDateRange') {
|
|
199
202
|
var _childWidths$2;
|
|
@@ -203,12 +206,12 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
203
206
|
_formItemProps3 = _getMergeConfig4.formItemProps,
|
|
204
207
|
_fieldProps3 = _getMergeConfig4.fieldProps,
|
|
205
208
|
_otherConfigProps3 = _objectWithoutProperties(_getMergeConfig4, _excluded5);
|
|
206
|
-
return /*#__PURE__*/
|
|
209
|
+
return /*#__PURE__*/_createElement(ProFormItem, _objectSpread(_objectSpread({}, _formItemProps3), {}, {
|
|
207
210
|
style: _objectSpread(_objectSpread({}, _formItemProps3.style), {}, {
|
|
208
211
|
marginBottom: 0
|
|
209
212
|
}),
|
|
210
213
|
key: keyStr
|
|
211
|
-
}), /*#__PURE__*/
|
|
214
|
+
}), /*#__PURE__*/_jsxs(ProFormFieldSet, _objectSpread(_objectSpread({}, _otherConfigProps3), {}, {
|
|
212
215
|
type: "group",
|
|
213
216
|
space: {
|
|
214
217
|
className: 'base-form-field-group'
|
|
@@ -225,24 +228,25 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
225
228
|
var _newValue$, _newValue$2;
|
|
226
229
|
var newValue = typeof (value === null || value === void 0 ? void 0 : value[1]) === 'string' ? [dayjs(value === null || value === void 0 ? void 0 : value[1]), dayjs(value === null || value === void 0 ? void 0 : value[2])] : (value === null || value === void 0 ? void 0 : value[1]) || [];
|
|
227
230
|
return _defineProperty(_defineProperty(_defineProperty({}, fields[0], value[0]), fields[1], (_newValue$ = newValue[0]) === null || _newValue$ === void 0 ? void 0 : _newValue$.format('YYYY-MM-DD')), fields[2], (_newValue$2 = newValue[1]) === null || _newValue$2 === void 0 ? void 0 : _newValue$2.format('YYYY-MM-DD'));
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
231
|
+
},
|
|
232
|
+
children: [dynamicCom(ProFormSelect, {
|
|
233
|
+
style: getWidth((_childWidths$2 = childWidths[0]) !== null && _childWidths$2 !== void 0 ? _childWidths$2 : 100),
|
|
234
|
+
// name: fields[0],
|
|
235
|
+
options: item.options,
|
|
236
|
+
allowClear: false,
|
|
237
|
+
showSearch: true,
|
|
238
|
+
ignoreFormItem: true
|
|
239
|
+
}, false), dynamicCom(ProFormDateRangePicker, {
|
|
240
|
+
ignoreFormItem: true,
|
|
241
|
+
placeholder: [formatMessage({
|
|
242
|
+
id: 'rex.components.base-form.placeholder.date-range.start',
|
|
243
|
+
defaultMessage: '开始时间'
|
|
244
|
+
}), formatMessage({
|
|
245
|
+
id: 'rex.components.base-form.placeholder.date-range.end',
|
|
246
|
+
defaultMessage: '结束时间'
|
|
247
|
+
})]
|
|
248
|
+
}, true)]
|
|
249
|
+
})));
|
|
246
250
|
}
|
|
247
251
|
if (valueType === 'selectRadio') {
|
|
248
252
|
var _getMergeConfig5 = getMergeConfig({
|
|
@@ -251,40 +255,41 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
251
255
|
_formItemProps4 = _getMergeConfig5.formItemProps,
|
|
252
256
|
_fieldProps4 = _getMergeConfig5.fieldProps,
|
|
253
257
|
_otherConfigProps4 = _objectWithoutProperties(_getMergeConfig5, _excluded6);
|
|
254
|
-
return /*#__PURE__*/
|
|
258
|
+
return /*#__PURE__*/_createElement(ProFormItem, _objectSpread(_objectSpread({}, _formItemProps4), {}, {
|
|
255
259
|
style: _objectSpread(_objectSpread({}, _formItemProps4.style), {}, {
|
|
256
260
|
marginBottom: 0
|
|
257
261
|
}),
|
|
258
262
|
key: keyStr
|
|
259
|
-
}), /*#__PURE__*/
|
|
263
|
+
}), /*#__PURE__*/_jsxs(ProFormFieldSet, _objectSpread(_objectSpread({}, _otherConfigProps4), {}, {
|
|
260
264
|
type: "group",
|
|
261
265
|
space: {
|
|
262
266
|
className: 'base-form-field-group'
|
|
263
267
|
},
|
|
264
268
|
transform: function transform(value) {
|
|
265
269
|
return _defineProperty(_defineProperty({}, fields[0], value[0]), fields[1], value[1]);
|
|
266
|
-
}
|
|
267
|
-
}), dynamicCom(ProFormSelect, {
|
|
268
|
-
style: {
|
|
269
|
-
flex: 1
|
|
270
|
-
},
|
|
271
|
-
options: item.options,
|
|
272
|
-
allowClear: false,
|
|
273
|
-
showSearch: true
|
|
274
|
-
}, true), dynamicCom(ProFormSelect, {
|
|
275
|
-
style: {
|
|
276
|
-
flex: 1
|
|
277
270
|
},
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
271
|
+
children: [dynamicCom(ProFormSelect, {
|
|
272
|
+
style: {
|
|
273
|
+
flex: 1
|
|
274
|
+
},
|
|
275
|
+
options: item.options,
|
|
276
|
+
allowClear: false,
|
|
277
|
+
showSearch: true
|
|
278
|
+
}, true), dynamicCom(ProFormSelect, {
|
|
279
|
+
style: {
|
|
280
|
+
flex: 1
|
|
281
|
+
},
|
|
282
|
+
options: [{
|
|
283
|
+
label: '是',
|
|
284
|
+
value: 1
|
|
285
|
+
}, {
|
|
286
|
+
label: '否',
|
|
287
|
+
value: 2
|
|
288
|
+
}],
|
|
289
|
+
allowClear: true,
|
|
290
|
+
showSearch: true
|
|
291
|
+
}, false)]
|
|
292
|
+
})));
|
|
288
293
|
}
|
|
289
294
|
}
|
|
290
295
|
|
|
@@ -374,73 +379,73 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
374
379
|
var paramsProp = _objectSpread(_objectSpread(_objectSpread({}, values), item.params), item.defaultParams);
|
|
375
380
|
// console.log(1111, params);
|
|
376
381
|
|
|
377
|
-
return /*#__PURE__*/
|
|
382
|
+
return /*#__PURE__*/_jsx(ProFormDependency, {
|
|
378
383
|
name: [keyStr],
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
// console.log(2222, dependData);
|
|
384
|
+
children: function children(dependData) {
|
|
385
|
+
// console.log(2222, dependData);
|
|
382
386
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
387
|
+
return dynamicCom(ProFormSelect, {
|
|
388
|
+
showSearch: true,
|
|
389
|
+
debounceTime: 300,
|
|
390
|
+
fieldProps: {
|
|
391
|
+
maxTagCount: 'responsive'
|
|
392
|
+
},
|
|
393
|
+
mode: item.multiple ? 'multiple' : 'single',
|
|
394
|
+
params: paramsProp,
|
|
395
|
+
name: keyStr,
|
|
396
|
+
initialValue: defaultValue,
|
|
397
|
+
request: function () {
|
|
398
|
+
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
399
|
+
var _params$keyWords, keyWords, restParams, newParams;
|
|
400
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
401
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
402
|
+
case 0:
|
|
403
|
+
// 拆分参数,keyWords 为搜索关键字,其余为接口参数
|
|
404
|
+
_params$keyWords = params.keyWords, keyWords = _params$keyWords === void 0 ? '' : _params$keyWords, restParams = _objectWithoutProperties(params, _excluded8);
|
|
405
|
+
newParams = restParams; // 如果配置了 apiSearchValueKey,则将依赖数据 dependData[keyStr] 赋值到对应参数
|
|
406
|
+
if (typeof item.apiSearchValueKey === 'string') {
|
|
407
|
+
newParams[item.apiSearchValueKey] = dependData[keyStr] || undefined;
|
|
408
|
+
}
|
|
405
409
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
410
|
+
// 处理搜索关键字参数的传递方式
|
|
411
|
+
if (item.apiSearchKey === false) {
|
|
412
|
+
// 配置为 false,默认传 keyWords 字段
|
|
413
|
+
newParams.keyWords = keyWords || undefined;
|
|
414
|
+
} else if (typeof item.apiSearchKey === 'string') {
|
|
415
|
+
// 配置为字符串,按指定字段名传递
|
|
416
|
+
newParams[item.apiSearchKey] = keyWords || undefined;
|
|
417
|
+
} else {
|
|
418
|
+
// 未配置,默认传 keyWords 和 keyStr 字段
|
|
419
|
+
newParams.keyWords = keyWords || undefined;
|
|
420
|
+
newParams[keyStr] = keyWords || undefined;
|
|
421
|
+
}
|
|
418
422
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
423
|
+
// 发起接口请求,返回选项数据
|
|
424
|
+
return _context2.abrupt("return", (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions(item.api, newParams, item)) || []);
|
|
425
|
+
case 5:
|
|
426
|
+
case "end":
|
|
427
|
+
return _context2.stop();
|
|
428
|
+
}
|
|
429
|
+
}, _callee2);
|
|
430
|
+
}));
|
|
431
|
+
function request(_x2) {
|
|
432
|
+
return _request.apply(this, arguments);
|
|
433
|
+
}
|
|
434
|
+
return request;
|
|
435
|
+
}()
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}, keyStr);
|
|
434
439
|
}
|
|
435
440
|
if (valueType === 'dateRange') {
|
|
436
441
|
var initialValues = getFieldsDefaultValues([item]);
|
|
437
442
|
return dynamicCom(ProFormDateRangePicker, {
|
|
438
443
|
name: keyStr,
|
|
439
444
|
placeholder: [formatMessage({
|
|
440
|
-
id: '
|
|
445
|
+
id: 'rex.components.base-form.placeholder.date-range.start',
|
|
441
446
|
defaultMessage: '开始时间'
|
|
442
447
|
}), formatMessage({
|
|
443
|
-
id: '
|
|
448
|
+
id: 'rex.components.base-form.placeholder.date-range.end',
|
|
444
449
|
defaultMessage: '结束时间'
|
|
445
450
|
})],
|
|
446
451
|
initialValue: initialValues[keyStr],
|
|
@@ -584,10 +589,10 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
584
589
|
return _defineProperty(_defineProperty({}, fields[0], inrValues[0]), fields[1], inrValues[1]);
|
|
585
590
|
},
|
|
586
591
|
placeholder: [formatMessage({
|
|
587
|
-
id: '
|
|
592
|
+
id: 'rex.components.base-form.placeholder.input-number-range.min',
|
|
588
593
|
defaultMessage: '最小值'
|
|
589
594
|
}), formatMessage({
|
|
590
|
-
id: '
|
|
595
|
+
id: 'rex.components.base-form.placeholder.input-number-range.max',
|
|
591
596
|
defaultMessage: '最大值'
|
|
592
597
|
})]
|
|
593
598
|
});
|
|
@@ -600,8 +605,8 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
600
605
|
}
|
|
601
606
|
}
|
|
602
607
|
console.error("valueType: ".concat(valueType, " ").concat(formatMessage({
|
|
603
|
-
id: '
|
|
608
|
+
id: 'rex.components.base-form.value-type-match-error',
|
|
604
609
|
defaultMessage: '匹配不到'
|
|
605
610
|
})));
|
|
606
|
-
return /*#__PURE__*/
|
|
611
|
+
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
607
612
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProForm, ProFormCascader, ProFormCheckbox, ProFormDateRangePicker, ProFormDigit, ProFormDigitRange, ProFormItemRender, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextArea, ProFormTreeSelect
|
|
1
|
+
import { ProForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormDateRangePicker, ProFormDigit, ProFormDigitRange, ProFormItemRender, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextArea, ProFormTreeSelect } from '@ant-design/pro-components';
|
|
2
2
|
import { TButtonFilterItem } from "../..";
|
|
3
3
|
import { Form, GetProps } from 'antd';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { type ReactNode } from 'react';
|
|
2
1
|
import { Checkbox, GetProps } from 'antd';
|
|
3
|
-
import {
|
|
2
|
+
import React, { type ReactNode } from 'react';
|
|
3
|
+
import { IBaseTableProps } from '../base-table/base-table';
|
|
4
4
|
export declare const BaseListTable: <T extends object = object>({ fieldsConfig, requestFields, requestFieldsUrl, requestFieldsParams, scroll, virtual, titleRender, rowSelection, dataSource, headerRender, defaultExpandAllCollapse, tableMaxRowCount, ...tableProps }: BaseListTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export interface BaseListTableProps<T extends object = object> extends Omit<IBaseTableProps<T>, 'rowSelection' | 'dataSource' | 'scroll'> {
|
|
6
6
|
/** 标题行自定以渲染 */
|