@teamias/rex-design 0.0.43 → 0.1.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/dist/components/base-form/components/ProFormDateRangePickerV2.js +2 -2
- package/dist/components/base-form/core/descriptions-model.js +2 -4
- package/dist/components/base-form/demo/Base.js +8 -9
- package/dist/components/base-form/demo/BaseFormCustomFormItem.js +9 -0
- package/dist/components/base-form/demo/BaseFormDescriptions.js +9 -9
- package/dist/components/base-form/modules/renderComponentNode.js +3 -3
- package/dist/components/base-form/style/index.js +1 -1
- package/dist/components/base-form/types/field-type.d.ts +5 -2
- package/dist/components/base-table/components/BaseTableRow.js +23 -3
- package/package.json +15 -15
|
@@ -188,8 +188,8 @@ export var ProFormDateRangePickerV2 = function ProFormDateRangePickerV2(_ref) {
|
|
|
188
188
|
}, fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style),
|
|
189
189
|
value: startValue && endValue ? [dayjs(startValue), dayjs(endValue)] : undefined,
|
|
190
190
|
onChange: function onChange(dates, dateStrings) {
|
|
191
|
-
form.setFieldValue(startFieldName, dateStrings[0] || undefined);
|
|
192
|
-
form.setFieldValue(endFieldName, dateStrings[1] || undefined);
|
|
191
|
+
form.setFieldValue(startFieldName, (dateStrings === null || dateStrings === void 0 ? void 0 : dateStrings[0]) || undefined);
|
|
192
|
+
form.setFieldValue(endFieldName, (dateStrings === null || dateStrings === void 0 ? void 0 : dateStrings[1]) || undefined);
|
|
193
193
|
setTimeout(function () {
|
|
194
194
|
validateRules === null || validateRules === void 0 || validateRules[0].validator().catch(function () {});
|
|
195
195
|
}, 0);
|
|
@@ -40,9 +40,7 @@ export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
|
40
40
|
return false;
|
|
41
41
|
};
|
|
42
42
|
return (fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
|
|
43
|
-
var _formItemProps$labelC;
|
|
44
|
-
var isRequired = hasRules(field);
|
|
45
|
-
|
|
43
|
+
var _formItemProps$requir, _formItemProps$labelC;
|
|
46
44
|
// 创建新的field对象,移除label属性
|
|
47
45
|
var label = field.label,
|
|
48
46
|
tooltip = field.tooltip,
|
|
@@ -53,7 +51,7 @@ export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
|
53
51
|
label: /*#__PURE__*/_jsx(Form.Item, {
|
|
54
52
|
label: label,
|
|
55
53
|
tooltip: tooltip,
|
|
56
|
-
required:
|
|
54
|
+
required: (_formItemProps$requir = formItemProps.required) !== null && _formItemProps$requir !== void 0 ? _formItemProps$requir : hasRules(field),
|
|
57
55
|
colon: false,
|
|
58
56
|
style: {
|
|
59
57
|
margin: 0
|
|
@@ -35,9 +35,8 @@ export default (function () {
|
|
|
35
35
|
}]
|
|
36
36
|
}, {
|
|
37
37
|
field: ['avg_cost_min', 'avg_cost_max'],
|
|
38
|
-
valueType: '
|
|
38
|
+
valueType: 'inputNumberRangeV2'
|
|
39
39
|
// "itemWidth": "150px",
|
|
40
|
-
fieldProps: []
|
|
41
40
|
}],
|
|
42
41
|
hidden: false
|
|
43
42
|
}, {
|
|
@@ -91,7 +90,7 @@ export default (function () {
|
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
// {
|
|
94
|
-
// valueType: '
|
|
93
|
+
// valueType: 'inputNumberRangeV2',
|
|
95
94
|
// field: ['multipleComponents-min', 'multipleComponents-max'],
|
|
96
95
|
// defaultValue: [2, 5],
|
|
97
96
|
// },
|
|
@@ -105,7 +104,7 @@ export default (function () {
|
|
|
105
104
|
// ],
|
|
106
105
|
// },
|
|
107
106
|
// {
|
|
108
|
-
// valueType: '
|
|
107
|
+
// valueType: 'dateRangeV2',
|
|
109
108
|
// field: ['multipleComponents-start', 'multipleComponents-end'],
|
|
110
109
|
// },
|
|
111
110
|
]
|
|
@@ -138,8 +137,8 @@ export default (function () {
|
|
|
138
137
|
}
|
|
139
138
|
}, {
|
|
140
139
|
valueType: 'dateRangeV2',
|
|
141
|
-
field: ['
|
|
142
|
-
label: '
|
|
140
|
+
field: ['dateRangeV2-start', 'dateRangeV2-end'],
|
|
141
|
+
label: 'dateRangeV2',
|
|
143
142
|
defaultValue: -29,
|
|
144
143
|
required: true,
|
|
145
144
|
fieldProps: {
|
|
@@ -205,9 +204,9 @@ export default (function () {
|
|
|
205
204
|
label: 'inputNumber',
|
|
206
205
|
defaultValue: 2
|
|
207
206
|
}, {
|
|
208
|
-
valueType: '
|
|
209
|
-
field: ['
|
|
210
|
-
label: '
|
|
207
|
+
valueType: 'inputNumberRangeV2',
|
|
208
|
+
field: ['inputNumberRangeV2-min', 'inputNumberRangeV2-max'],
|
|
209
|
+
label: 'inputNumberRangeV2',
|
|
211
210
|
defaultValue: [2, 5]
|
|
212
211
|
}, {
|
|
213
212
|
valueType: 'textArea',
|
|
@@ -34,6 +34,15 @@ export default (function () {
|
|
|
34
34
|
label: '普通输入框',
|
|
35
35
|
field: 'a',
|
|
36
36
|
readonly: true
|
|
37
|
+
}, {
|
|
38
|
+
valueType: 'inputNumber',
|
|
39
|
+
label: '普通输入框',
|
|
40
|
+
field: 'a',
|
|
41
|
+
readonly: true,
|
|
42
|
+
formItemProps: {},
|
|
43
|
+
fieldProps: {
|
|
44
|
+
precision: 2
|
|
45
|
+
}
|
|
37
46
|
}, {
|
|
38
47
|
field: 'customFormItem',
|
|
39
48
|
label: '自定义渲染表单项',
|
|
@@ -99,7 +99,7 @@ export default (function () {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
// {
|
|
102
|
-
// valueType: '
|
|
102
|
+
// valueType: 'inputNumberRangeV2',
|
|
103
103
|
// field: ['multipleComponents-min', 'multipleComponents-max'],
|
|
104
104
|
// defaultValue: [2, 5],
|
|
105
105
|
// },
|
|
@@ -113,7 +113,7 @@ export default (function () {
|
|
|
113
113
|
// ],
|
|
114
114
|
// },
|
|
115
115
|
// {
|
|
116
|
-
// valueType: '
|
|
116
|
+
// valueType: 'dateRangeV2',
|
|
117
117
|
// field: ['multipleComponents-start', 'multipleComponents-end'],
|
|
118
118
|
// },
|
|
119
119
|
],
|
|
@@ -151,8 +151,8 @@ export default (function () {
|
|
|
151
151
|
}
|
|
152
152
|
}, {
|
|
153
153
|
valueType: 'dateRangeV2',
|
|
154
|
-
field: ['
|
|
155
|
-
label: '
|
|
154
|
+
field: ['dateRangeV2-start', 'dateRangeV2-end'],
|
|
155
|
+
label: 'dateRangeV2',
|
|
156
156
|
defaultValue: -29,
|
|
157
157
|
required: true,
|
|
158
158
|
fieldProps: {
|
|
@@ -213,9 +213,9 @@ export default (function () {
|
|
|
213
213
|
label: 'inputNumber',
|
|
214
214
|
defaultValue: 2
|
|
215
215
|
}, {
|
|
216
|
-
valueType: '
|
|
217
|
-
field: ['
|
|
218
|
-
label: '
|
|
216
|
+
valueType: 'inputNumberRangeV2',
|
|
217
|
+
field: ['inputNumberRangeV2-min', 'inputNumberRangeV2-max'],
|
|
218
|
+
label: 'inputNumberRangeV2',
|
|
219
219
|
defaultValue: [2, 5]
|
|
220
220
|
}, {
|
|
221
221
|
valueType: 'textArea',
|
|
@@ -254,7 +254,7 @@ export default (function () {
|
|
|
254
254
|
valueType: 'select',
|
|
255
255
|
field: 'org_id',
|
|
256
256
|
label: '部门',
|
|
257
|
-
itemWidth: '200px',
|
|
257
|
+
// itemWidth: '200px',
|
|
258
258
|
options: [{
|
|
259
259
|
label: '1',
|
|
260
260
|
value: '1'
|
|
@@ -269,7 +269,7 @@ export default (function () {
|
|
|
269
269
|
valueType: 'select',
|
|
270
270
|
field: 'job_id',
|
|
271
271
|
label: '岗位',
|
|
272
|
-
itemWidth: '200px',
|
|
272
|
+
// itemWidth: '200px',
|
|
273
273
|
options: [{
|
|
274
274
|
label: '1',
|
|
275
275
|
value: '1'
|
|
@@ -385,9 +385,9 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
385
385
|
if (valueType === 'selectDim') {
|
|
386
386
|
var paramsProp = _objectSpread(_objectSpread(_objectSpread({}, values), item.params), item.defaultParams);
|
|
387
387
|
// console.log(1111, params);
|
|
388
|
-
|
|
388
|
+
var keys = Array.isArray(splitKeyStr(keyStr)) ? splitKeyStr(keyStr) : [splitKeyStr(keyStr)];
|
|
389
389
|
return /*#__PURE__*/_jsx(ProFormDependency, {
|
|
390
|
-
name:
|
|
390
|
+
name: keys,
|
|
391
391
|
children: function children(dependData) {
|
|
392
392
|
// console.log(2222, dependData);
|
|
393
393
|
|
|
@@ -399,7 +399,7 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
399
399
|
},
|
|
400
400
|
mode: item.multiple ? 'multiple' : 'single',
|
|
401
401
|
params: paramsProp,
|
|
402
|
-
name:
|
|
402
|
+
name: keys,
|
|
403
403
|
initialValue: defaultValue,
|
|
404
404
|
request: function () {
|
|
405
405
|
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { createGlobalStyle } from 'styled-components';
|
|
2
|
-
var compactArr = ['ant-input-outlined', 'ant-select-selector', 'ant-picker', 'ant-input-number-outlined'];
|
|
2
|
+
var compactArr = ['ant-input-outlined', 'ant-select', 'ant-select-selector', 'ant-picker', 'ant-input-number-outlined'];
|
|
3
3
|
export var BaseFormStyle = createGlobalStyle([".base-form-field-group{display:flex !important;}.base-form-field-multiple-group{display:flex;width:100%;gap:8px;}.base-form-field-multiple-group.compact{gap:0;", "{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:transparent;}", "{border-top-right-radius:0;border-bottom-right-radius:0;}}.base-form-item{width:var(--item-width);.ant-form-item-label:has(label[title]){width:var(--label-width);}.ant-picker{width:100%;}.ant-space-compact{width:100%;}}"], compactArr.map(function (str) {
|
|
4
4
|
return "> div:not(:first-child) .".concat(str);
|
|
5
5
|
}).join(','), compactArr.map(function (str) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
import { Form, GetProps } from 'antd';
|
|
3
|
+
import { Form, GetProps, InputNumber } from 'antd';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { ProFormDateRangePickerV2 } from '../components/ProFormDateRangePickerV2';
|
|
6
6
|
import { ProFormDigitRangeV2 } from '../components/ProFormDigitRangeV2';
|
|
@@ -17,7 +17,10 @@ export type TTreeSelectProps = IBaseFormFieldItem<'treeSelect'> & Omit<GetProps<
|
|
|
17
17
|
export type TCheckboxProps = IBaseFormFieldItem<'checkbox'> & Omit<GetProps<typeof ProFormCheckbox>, TOmitComponentItemType>;
|
|
18
18
|
export type TCheckboxGroupProps = IBaseFormFieldItem<'checkboxGroup'> & Omit<GetProps<typeof ProFormCheckbox.Group>, TOmitComponentItemType>;
|
|
19
19
|
export type TRadioGroupProps = IBaseFormFieldItem<'radioGroup'> & Omit<GetProps<typeof ProFormRadio>, TOmitComponentItemType>;
|
|
20
|
-
export type TInputNumberProps = IBaseFormFieldItem<'inputNumber'> & Omit<GetProps<typeof ProFormDigit>, TOmitComponentItemType
|
|
20
|
+
export type TInputNumberProps = IBaseFormFieldItem<'inputNumber'> & Omit<GetProps<typeof ProFormDigit>, TOmitComponentItemType> & {
|
|
21
|
+
formItemProps?: GetProps<typeof Form.Item>;
|
|
22
|
+
fieldProps?: GetProps<typeof InputNumber>;
|
|
23
|
+
};
|
|
21
24
|
export type TInputNumberRangeProps = IBaseFormFieldItem<'inputNumberRange'> & Omit<GetProps<typeof ProFormDigitRange>, TOmitComponentItemType>;
|
|
22
25
|
export type TInputNumberRangeV2Props = IBaseFormFieldItem<'inputNumberRangeV2'> & Omit<GetProps<typeof ProFormDigitRangeV2>, TOmitComponentItemType>;
|
|
23
26
|
export type TTextAreaProps = IBaseFormFieldItem<'textArea'> & Omit<GetProps<typeof ProFormTextArea>, TOmitComponentItemType>;
|
|
@@ -12,9 +12,25 @@ import classNames from 'classnames';
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { DataCell } from "../../data-cell/data-cell";
|
|
14
14
|
import { TableParentRow, TableParentRowCell } from "../style";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 判断是否为左侧固定列
|
|
18
|
+
* 兼容 antd 5.x (fixLeft) 和 antd 6.x (fixStart)
|
|
19
|
+
*/
|
|
15
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
21
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
var isFixedLeft = function isFixedLeft(props) {
|
|
24
|
+
return typeof (props === null || props === void 0 ? void 0 : props.fixLeft) === 'number' || typeof (props === null || props === void 0 ? void 0 : props.fixStart) === 'number';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 判断是否为右侧固定列
|
|
29
|
+
* 兼容 antd 5.x (fixRight) 和 antd 6.x (fixEnd)
|
|
30
|
+
*/
|
|
31
|
+
var isFixedRight = function isFixedRight(props) {
|
|
32
|
+
return typeof (props === null || props === void 0 ? void 0 : props.fixRight) === 'number' || typeof (props === null || props === void 0 ? void 0 : props.fixEnd) === 'number';
|
|
33
|
+
};
|
|
18
34
|
export var BaseTableRow = function BaseTableRow(outProps) {
|
|
19
35
|
var cellClick = outProps['data-cell-click-event'],
|
|
20
36
|
columnCount = outProps['data-column-count'],
|
|
@@ -33,11 +49,13 @@ export var BaseTableRow = function BaseTableRow(outProps) {
|
|
|
33
49
|
// console.log(props);
|
|
34
50
|
var record = props.children[0].props.record;
|
|
35
51
|
var index = props.children[0].props.index;
|
|
52
|
+
// 兼容 antd 5.x (fixLeft) 和 antd 6.x (fixStart)
|
|
36
53
|
var leftArr = props.children.filter(function (ii) {
|
|
37
|
-
return
|
|
54
|
+
return isFixedLeft(ii.props);
|
|
38
55
|
});
|
|
56
|
+
// 兼容 antd 5.x (fixRight) 和 antd 6.x (fixEnd)
|
|
39
57
|
var rightArr = props.children.filter(function (ii) {
|
|
40
|
-
return
|
|
58
|
+
return isFixedRight(ii.props);
|
|
41
59
|
});
|
|
42
60
|
/** 是否存在左边固定列 */
|
|
43
61
|
var hanBeforeColumns = leftArr.filter(function (ii) {
|
|
@@ -128,7 +146,9 @@ export var BaseTableRow = function BaseTableRow(outProps) {
|
|
|
128
146
|
children: [_dom, _dom2]
|
|
129
147
|
});
|
|
130
148
|
}
|
|
131
|
-
}(),
|
|
149
|
+
}(), Array.from({
|
|
150
|
+
length: Math.max(+columnCount - 1, 0)
|
|
151
|
+
}).map(function (_, i) {
|
|
132
152
|
return /*#__PURE__*/_jsx("td", {
|
|
133
153
|
"aria-hidden": "true"
|
|
134
154
|
}, i);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamias/rex-design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@ant-design/icons": "^6.0.0",
|
|
52
52
|
"@ant-design/pro-components": "^2.8.10",
|
|
53
53
|
"@ant-design/pro-form": "^2.32.0",
|
|
54
|
-
"@iconify/react": "^6.0.
|
|
54
|
+
"@iconify/react": "^6.0.2",
|
|
55
55
|
"@js-preview/pdf": "^2.0.10",
|
|
56
56
|
"@tiptap/core": "^2.12.0",
|
|
57
57
|
"@tiptap/extension-bullet-list": "2.12.0",
|
|
@@ -68,14 +68,16 @@
|
|
|
68
68
|
"@tiptap/pm": "^2.12.0",
|
|
69
69
|
"@tiptap/react": "^2.12.0",
|
|
70
70
|
"@tiptap/starter-kit": "^2.12.0",
|
|
71
|
-
"ahooks": "^3.9.
|
|
71
|
+
"ahooks": "^3.9.6",
|
|
72
72
|
"antd": "^5.29.3",
|
|
73
73
|
"classnames": "^2.5.1",
|
|
74
|
-
"dayjs": "^1.11.
|
|
74
|
+
"dayjs": "^1.11.19",
|
|
75
75
|
"lodash": "^4.17.21",
|
|
76
76
|
"prosemirror-state": "^1.4.3",
|
|
77
77
|
"radash": "^12.1.1",
|
|
78
78
|
"rc-virtual-list": "^3.19.1",
|
|
79
|
+
"react": "^18.3.1",
|
|
80
|
+
"react-dom": "^18.3.1",
|
|
79
81
|
"react-intl": "^7.1.11",
|
|
80
82
|
"react-quick-pinch-zoom": "^5.1.1",
|
|
81
83
|
"react-router": "6",
|
|
@@ -88,19 +90,17 @@
|
|
|
88
90
|
"@teamias/umi-loader-source-plugin": "^0.0.11",
|
|
89
91
|
"@teamias/umi-plugin-upload-build": "^0.0.2",
|
|
90
92
|
"@types/lodash": "^4.17.20",
|
|
91
|
-
"@types/react": "^18.
|
|
92
|
-
"@types/react-dom": "^18.
|
|
93
|
-
"@umijs/lint": "^4.
|
|
94
|
-
"dumi": "^2.4.
|
|
93
|
+
"@types/react": "^18.3.27",
|
|
94
|
+
"@types/react-dom": "^18.3.7",
|
|
95
|
+
"@umijs/lint": "^4.6.15",
|
|
96
|
+
"dumi": "^2.4.21",
|
|
95
97
|
"eslint": "^8.23.0",
|
|
96
|
-
"father": "^4.
|
|
98
|
+
"father": "^4.6.12",
|
|
97
99
|
"husky": "^8.0.1",
|
|
98
|
-
"lint-staged": "^13.0
|
|
99
|
-
"prettier": "^
|
|
100
|
-
"prettier-plugin-organize-imports": "^3.0
|
|
101
|
-
"prettier-plugin-packagejson": "^2.
|
|
102
|
-
"react": "^18.0.0",
|
|
103
|
-
"react-dom": "^18.0.0",
|
|
100
|
+
"lint-staged": "^13.3.0",
|
|
101
|
+
"prettier": "^3.7.4",
|
|
102
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
103
|
+
"prettier-plugin-packagejson": "^2.5.20",
|
|
104
104
|
"stylelint": "^14.9.1"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|