@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
|
@@ -13,42 +13,41 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
14
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
import { ProForm, ProFormDependency, ProFormSelect } from "@ant-design/pro-components";
|
|
17
|
-
import { Button, Card } from 'antd';
|
|
18
16
|
import { UserOutlined } from '@ant-design/icons';
|
|
17
|
+
import { ProForm, ProFormDependency, ProFormSelect } from '@ant-design/pro-components';
|
|
19
18
|
import { RexProConfigProvider } from "../../..";
|
|
20
|
-
import {
|
|
21
|
-
import { crush } from "radash";
|
|
19
|
+
import { Button, Card } from 'antd';
|
|
22
20
|
import { BaseForm } from "../base-form";
|
|
23
21
|
import { dataToInitialValues, getFieldsDefaultValues } from "../modules/handlerData";
|
|
24
22
|
import { valuesToFields } from "../modules/valuesToFields";
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
26
|
export default (function () {
|
|
28
27
|
var fields = [{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
label: '成本区间',
|
|
29
|
+
valueType: 'multipleComponents',
|
|
30
|
+
compact: true,
|
|
31
|
+
subItems: [{
|
|
32
|
+
valueType: 'select',
|
|
33
|
+
field: 'avg_cost',
|
|
34
|
+
defaultValue: 'avg_cost',
|
|
36
35
|
// "itemWidth": "150px",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
fieldProps: {
|
|
37
|
+
allowClear: false,
|
|
38
|
+
popupMatchSelectWidth: false,
|
|
39
|
+
maxTagCount: 1
|
|
41
40
|
},
|
|
42
41
|
hidden: false,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
options: [{
|
|
43
|
+
label: '成本区间',
|
|
44
|
+
value: 'avg_cost'
|
|
46
45
|
}]
|
|
47
46
|
}, {
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
field: ['avg_cost_min', 'avg_cost_max'],
|
|
48
|
+
valueType: 'inputNumberRange',
|
|
50
49
|
// "itemWidth": "150px",
|
|
51
|
-
|
|
50
|
+
fieldProps: []
|
|
52
51
|
}],
|
|
53
52
|
hidden: false
|
|
54
53
|
}, {
|
|
@@ -68,7 +67,7 @@ export default (function () {
|
|
|
68
67
|
}
|
|
69
68
|
},
|
|
70
69
|
fieldProps: {
|
|
71
|
-
prefix: /*#__PURE__*/
|
|
70
|
+
prefix: /*#__PURE__*/_jsx(UserOutlined, {}),
|
|
72
71
|
disabled: true
|
|
73
72
|
}
|
|
74
73
|
}, {
|
|
@@ -233,36 +232,38 @@ export default (function () {
|
|
|
233
232
|
var initialValues = getFieldsDefaultValues(fields);
|
|
234
233
|
// console.log(initialValues);
|
|
235
234
|
|
|
236
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/_jsx(RexProConfigProvider, {
|
|
237
236
|
value: {
|
|
238
|
-
intl: createIntl({
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
})
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
fieldProps: {
|
|
253
|
-
'multipleComponents-treeSelect': {
|
|
254
|
-
valueType: 'input',
|
|
255
|
-
formItemProps: {
|
|
256
|
-
style: {
|
|
257
|
-
background: 'red'
|
|
258
|
-
}
|
|
259
|
-
},
|
|
237
|
+
// intl: createIntl({
|
|
238
|
+
// locale: 'en-US',
|
|
239
|
+
// messages: crush(designDataEntryEnUS) as Record<string, string>,
|
|
240
|
+
// onError: () => {},
|
|
241
|
+
// }),
|
|
242
|
+
},
|
|
243
|
+
children: /*#__PURE__*/_jsx(ProForm, {
|
|
244
|
+
initialValues: initialValues,
|
|
245
|
+
onFinish: function onFinish(values) {
|
|
246
|
+
console.log(values);
|
|
247
|
+
},
|
|
248
|
+
children: /*#__PURE__*/_jsx(BaseForm, {
|
|
249
|
+
fields: fields,
|
|
250
|
+
itemWidth: "50%",
|
|
260
251
|
fieldProps: {
|
|
261
|
-
|
|
252
|
+
'multipleComponents-treeSelect': {
|
|
253
|
+
valueType: 'input',
|
|
254
|
+
formItemProps: {
|
|
255
|
+
style: {
|
|
256
|
+
background: 'red'
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
fieldProps: {
|
|
260
|
+
size: 'small'
|
|
261
|
+
}
|
|
262
|
+
}
|
|
262
263
|
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
})
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
});
|
|
266
267
|
});
|
|
267
268
|
var s1 = function s1(params) {
|
|
268
269
|
// console.log('触发1');
|
|
@@ -345,72 +346,82 @@ export var BaseFormBasicTest = function BaseFormBasicTest() {
|
|
|
345
346
|
var initialValues = dataToInitialValues({
|
|
346
347
|
'select-false': '选项1',
|
|
347
348
|
'select-true': '2-选项1',
|
|
348
|
-
start:
|
|
349
|
-
end:
|
|
349
|
+
start: '2025-07-18',
|
|
350
|
+
end: '2025-08-20'
|
|
350
351
|
// 'start-end': ["2025-07-18", "2025-08-20"],
|
|
351
352
|
}, fields);
|
|
352
353
|
console.log(initialValues);
|
|
353
|
-
return /*#__PURE__*/
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
// console.log(form);
|
|
380
|
-
var data = valuesToFields({
|
|
381
|
-
'select-false': '选项1',
|
|
382
|
-
'select-true': '2-选项1'
|
|
383
|
-
});
|
|
384
|
-
// console.log(data);
|
|
385
|
-
form.setFields(data);
|
|
386
|
-
}
|
|
387
|
-
}, "setValue"), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(ProForm
|
|
388
|
-
// disabled
|
|
389
|
-
, {
|
|
390
|
-
form: form,
|
|
391
|
-
initialValues: initialValues,
|
|
392
|
-
onFinish: function onFinish(e) {
|
|
393
|
-
return console.log(e);
|
|
394
|
-
}
|
|
395
|
-
}, /*#__PURE__*/React.createElement(BaseForm, {
|
|
396
|
-
requestOptions: ( /*#__PURE__*/function () {
|
|
397
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, params) {
|
|
398
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
399
|
-
while (1) switch (_context.prev = _context.next) {
|
|
400
|
-
case 0:
|
|
401
|
-
return _context.abrupt("return", api === '/select1' ? s1(params) : s2(params));
|
|
402
|
-
case 1:
|
|
403
|
-
case "end":
|
|
404
|
-
return _context.stop();
|
|
354
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
355
|
+
children: [/*#__PURE__*/_jsx(Card, {
|
|
356
|
+
children: /*#__PURE__*/_jsxs(ProForm, {
|
|
357
|
+
disabled: true,
|
|
358
|
+
onFinish: function onFinish(e) {
|
|
359
|
+
return console.log(e);
|
|
360
|
+
},
|
|
361
|
+
children: [/*#__PURE__*/_jsx(ProFormSelect, {
|
|
362
|
+
name: "select1",
|
|
363
|
+
label: "\u9009\u62E91",
|
|
364
|
+
params: {
|
|
365
|
+
type: 'QueryFilter'
|
|
366
|
+
},
|
|
367
|
+
request: s1
|
|
368
|
+
}), /*#__PURE__*/_jsx(ProFormDependency, {
|
|
369
|
+
name: ['select1'],
|
|
370
|
+
children: function children(data) {
|
|
371
|
+
console.log('执行');
|
|
372
|
+
return /*#__PURE__*/_jsx(ProFormSelect, {
|
|
373
|
+
name: "select2",
|
|
374
|
+
label: "\u9009\u62E92",
|
|
375
|
+
params: _objectSpread({
|
|
376
|
+
type: 'QueryFilter'
|
|
377
|
+
}, data),
|
|
378
|
+
request: s1
|
|
379
|
+
});
|
|
405
380
|
}
|
|
406
|
-
}
|
|
407
|
-
})
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
381
|
+
})]
|
|
382
|
+
})
|
|
383
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
384
|
+
onClick: function onClick() {
|
|
385
|
+
// console.log(form);
|
|
386
|
+
var data = valuesToFields({
|
|
387
|
+
'select-false': '选项1',
|
|
388
|
+
'select-true': '2-选项1'
|
|
389
|
+
});
|
|
390
|
+
// console.log(data);
|
|
391
|
+
form.setFields(data);
|
|
392
|
+
},
|
|
393
|
+
children: "setValue"
|
|
394
|
+
}), /*#__PURE__*/_jsx(Card, {
|
|
395
|
+
children: /*#__PURE__*/_jsx(ProForm
|
|
396
|
+
// disabled
|
|
397
|
+
, {
|
|
398
|
+
form: form,
|
|
399
|
+
initialValues: initialValues,
|
|
400
|
+
onFinish: function onFinish(e) {
|
|
401
|
+
return console.log(e);
|
|
402
|
+
},
|
|
403
|
+
children: /*#__PURE__*/_jsx(BaseForm, {
|
|
404
|
+
requestOptions: ( /*#__PURE__*/function () {
|
|
405
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, params) {
|
|
406
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
407
|
+
while (1) switch (_context.prev = _context.next) {
|
|
408
|
+
case 0:
|
|
409
|
+
return _context.abrupt("return", api === '/select1' ? s1(params) : s2(params));
|
|
410
|
+
case 1:
|
|
411
|
+
case "end":
|
|
412
|
+
return _context.stop();
|
|
413
|
+
}
|
|
414
|
+
}, _callee);
|
|
415
|
+
}));
|
|
416
|
+
return function (_x, _x2) {
|
|
417
|
+
return _ref.apply(this, arguments);
|
|
418
|
+
};
|
|
419
|
+
}()),
|
|
420
|
+
fields: fields
|
|
421
|
+
})
|
|
422
|
+
})
|
|
423
|
+
})]
|
|
424
|
+
});
|
|
414
425
|
};
|
|
415
426
|
export var BaseFormBasicDepend = function BaseFormBasicDepend() {
|
|
416
427
|
var fields = [{
|
|
@@ -487,29 +498,30 @@ export var BaseFormBasicDepend = function BaseFormBasicDepend() {
|
|
|
487
498
|
var initialValues = getFieldsDefaultValues(fields);
|
|
488
499
|
// console.log(initialValues);
|
|
489
500
|
|
|
490
|
-
return /*#__PURE__*/
|
|
501
|
+
return /*#__PURE__*/_jsx(ProForm, {
|
|
491
502
|
initialValues: initialValues,
|
|
492
503
|
onFinish: function onFinish(values) {
|
|
493
504
|
console.log(values);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
505
|
+
},
|
|
506
|
+
children: /*#__PURE__*/_jsx(BaseForm, {
|
|
507
|
+
fields: fields,
|
|
508
|
+
itemWidth: "50%",
|
|
509
|
+
requestOptions: ( /*#__PURE__*/function () {
|
|
510
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(api, params) {
|
|
511
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
512
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
513
|
+
case 0:
|
|
514
|
+
return _context2.abrupt("return", api === '/select1' ? s1(params) : s2(params));
|
|
515
|
+
case 1:
|
|
516
|
+
case "end":
|
|
517
|
+
return _context2.stop();
|
|
518
|
+
}
|
|
519
|
+
}, _callee2);
|
|
520
|
+
}));
|
|
521
|
+
return function (_x3, _x4) {
|
|
522
|
+
return _ref2.apply(this, arguments);
|
|
523
|
+
};
|
|
524
|
+
}())
|
|
525
|
+
})
|
|
526
|
+
});
|
|
515
527
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProForm } from
|
|
1
|
+
import { ProForm } from '@ant-design/pro-components';
|
|
2
2
|
import { IntlShape } from 'react-intl';
|
|
3
|
-
import { IBaseFormProps } from
|
|
3
|
+
import { IBaseFormProps } from '../types';
|
|
4
4
|
/** 渲染组件项 */
|
|
5
5
|
export declare const renderComponentNode: (outConfig: Omit<IBaseFormProps, 'fields' | 'fieldProps'> & {
|
|
6
6
|
fields: string[];
|