@teamias/rex-design 0.0.33 → 0.0.35
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/core/descriptions-model.js +11 -1
- package/dist/components/base-form/demo/BaseFormDescriptions.js +4 -2
- package/dist/components/base-form/modules/renderComponentNode.js +3 -1
- package/dist/components/base-form/style/index.js +1 -1
- package/dist/components/base-form/types/base-form.d.ts +3 -1
- package/dist/components/base-form/types/field-type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["descriptionsProps", "fields"],
|
|
2
|
+
var _excluded = ["descriptionsProps", "fields", "labelWidth"],
|
|
3
3
|
_excluded2 = ["label", "tooltip", "formItemProps", "rules"];
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -16,7 +16,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
16
16
|
export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
17
17
|
var descriptionsProps = _ref.descriptionsProps,
|
|
18
18
|
fields = _ref.fields,
|
|
19
|
+
_ref$labelWidth = _ref.labelWidth,
|
|
20
|
+
labelWidth = _ref$labelWidth === void 0 ? '120px' : _ref$labelWidth,
|
|
19
21
|
baseFormProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
var column = (descriptionsProps === null || descriptionsProps === void 0 ? void 0 : descriptionsProps.column) || 3;
|
|
20
23
|
var descriptionsItems = useMemo(function () {
|
|
21
24
|
/** 检查field或其subItems是否包含rules */
|
|
22
25
|
var hasRules = function hasRules(field) {
|
|
@@ -75,11 +78,18 @@ export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
|
75
78
|
})) || [];
|
|
76
79
|
}, [fields]);
|
|
77
80
|
return /*#__PURE__*/_jsx(DescriptionsStyle, {
|
|
81
|
+
style: {
|
|
82
|
+
'--label-width': labelWidth,
|
|
83
|
+
'--content-width': "".concat(100 / column, "%")
|
|
84
|
+
},
|
|
78
85
|
children: /*#__PURE__*/_jsx(Descriptions, _objectSpread(_objectSpread({
|
|
79
86
|
bordered: true,
|
|
80
87
|
styles: {
|
|
81
88
|
content: {
|
|
82
89
|
padding: '24px 12px'
|
|
90
|
+
},
|
|
91
|
+
label: {
|
|
92
|
+
padding: '12px'
|
|
83
93
|
}
|
|
84
94
|
}
|
|
85
95
|
}, descriptionsProps), {}, {
|
|
@@ -35,9 +35,11 @@ export default (function () {
|
|
|
35
35
|
}]
|
|
36
36
|
}, {
|
|
37
37
|
field: ['avg_cost_min', 'avg_cost_max'],
|
|
38
|
-
valueType: 'inputNumberRangeV2'
|
|
38
|
+
valueType: 'inputNumberRangeV2',
|
|
39
|
+
itemWidth: '100%'
|
|
39
40
|
}],
|
|
40
|
-
hidden: false
|
|
41
|
+
hidden: false,
|
|
42
|
+
span: 3
|
|
41
43
|
}, {
|
|
42
44
|
valueType: 'multipleComponents',
|
|
43
45
|
label: 'multipleComponents',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["valueType", "label", "defaultValue", "childWidths", "fieldProps", "formItemProps"],
|
|
1
|
+
var _excluded = ["valueType", "label", "defaultValue", "childWidths", "fieldProps", "formItemProps", "params", "defaultParams"],
|
|
2
2
|
_excluded2 = ["formItemProps", "fieldProps"],
|
|
3
3
|
_excluded3 = ["formItemProps", "fieldProps", "name"],
|
|
4
4
|
_excluded4 = ["formItemProps", "fieldProps"],
|
|
@@ -77,6 +77,8 @@ export var renderComponentNode = function renderComponentNode(outConfig, values,
|
|
|
77
77
|
childWidths = _outConfig$item$child === void 0 ? [] : _outConfig$item$child,
|
|
78
78
|
rawFieldProps = _outConfig$item.fieldProps,
|
|
79
79
|
rawFormItemProps = _outConfig$item.formItemProps,
|
|
80
|
+
params = _outConfig$item.params,
|
|
81
|
+
defaultParams = _outConfig$item.defaultParams,
|
|
80
82
|
otherProps = _objectWithoutProperties(_outConfig$item, _excluded),
|
|
81
83
|
requestOptions = outConfig.requestOptions,
|
|
82
84
|
itemWidth = outConfig.itemWidth,
|
|
@@ -8,4 +8,4 @@ export var BaseFormStyle = createGlobalStyle([".base-form-field-group{display:fl
|
|
|
8
8
|
export var DescriptionsStyle = styled.div.withConfig({
|
|
9
9
|
displayName: "DescriptionsStyle",
|
|
10
10
|
componentId: "rex-design-aaf4__sc-1e1tacy-0"
|
|
11
|
-
})([".ant-descriptions-view{overflow:auto;}.ant-form-item-additional{position:absolute;}.ant-descriptions-row{th.ant-descriptions-item-label:has( + td.ant-descriptions-item-content > span:empty ){display:none;}td.ant-descriptions-item-content:has(> span:empty){display:none;}}"]);
|
|
11
|
+
})(["table{table-layout:fixed;}.ant-descriptions-view{overflow:auto;}th.ant-descriptions-item-label{width:var(--label-width);max-width:var(--label-width);min-width:var(--label-width);}td.ant-descriptions-item-content{width:var(--content-width);max-width:var(--content-width);min-width:var(--content-width);}.ant-form-item-additional{position:absolute;}.ant-descriptions-row{th.ant-descriptions-item-label:has( + td.ant-descriptions-item-content > span:empty ){display:none;}td.ant-descriptions-item-content:has(> span:empty){display:none;}th label.ant-form-item-no-colon{display:block;word-wrap:break-word;&:after{content:initial;}> *{vertical-align:middle;}}}"]);
|