@ztocwst/rc-pro-materials 0.1.0 → 0.1.2
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/build/lowcode/assets-daily.json +12 -12
- package/build/lowcode/assets-dev.json +3 -3
- package/build/lowcode/assets-prod.json +12 -12
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +6 -6
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/dist/{BizComps.css → SCM_Comps.css} +1 -1
- package/dist/{BizComps.js → SCM_Comps.js} +9 -9
- package/dist/SCM_Comps.js.map +1 -0
- package/es/components/z-Ellipsis/ellipsis.d.ts +4 -0
- package/es/components/z-Ellipsis/ellipsis.js +6 -0
- package/es/components/z-Ellipsis/index.d.ts +3 -0
- package/es/components/z-Ellipsis/index.js +2 -0
- package/es/components/z-box/box.d.ts +20 -0
- package/es/components/z-box/box.js +29 -0
- package/es/components/z-box/index.d.ts +3 -0
- package/es/components/z-box/index.js +2 -0
- package/es/components/z-box/index.less +4 -0
- package/es/components/z-button/z-button.js +3 -7
- package/es/components/z-config-provider/configProvider.d.ts +4 -0
- package/es/components/z-config-provider/configProvider.js +10 -0
- package/es/components/z-config-provider/index.d.ts +3 -0
- package/es/components/z-config-provider/index.js +2 -0
- package/es/components/z-div/div.d.ts +6 -0
- package/es/components/z-div/div.js +10 -0
- package/es/components/z-div/index.d.ts +2 -0
- package/es/components/z-div/index.js +2 -0
- package/es/components/z-form/z-form.d.ts +8 -2
- package/es/components/z-form/z-form.js +34 -2
- package/es/components/z-list/index.d.ts +3 -0
- package/es/components/z-list/index.js +2 -0
- package/es/components/z-list/list.d.ts +11 -0
- package/es/components/z-list/list.js +33 -0
- package/es/components/z-preview/index.d.ts +3 -0
- package/es/components/z-preview/index.js +2 -0
- package/es/components/z-preview/preview.d.ts +4 -0
- package/es/components/z-preview/preview.js +7 -0
- package/es/components/z-simple-bar/index.d.ts +3 -0
- package/es/components/z-simple-bar/index.js +2 -0
- package/es/components/z-simple-bar/index.less +9 -0
- package/es/components/z-simple-bar/z-simple-bar.d.ts +25 -0
- package/es/components/z-simple-bar/z-simple-bar.js +94 -0
- package/es/components/z-statistic/index.d.ts +3 -0
- package/es/components/z-statistic/index.js +2 -0
- package/es/components/z-statistic/index.less +22 -0
- package/es/components/z-statistic/statistic.d.ts +13 -0
- package/es/components/z-statistic/statistic.js +29 -0
- package/es/components/z-table/index.d.ts +3 -0
- package/es/components/z-table/index.js +2 -0
- package/es/components/z-table/table.d.ts +8 -0
- package/es/components/z-table/table.js +31 -0
- package/es/index.d.ts +18 -0
- package/es/index.js +10 -0
- package/es/style.js +2 -0
- package/es/utils/hoc.d.ts +6 -0
- package/es/utils/hoc.js +14 -0
- package/es/utils/index.d.ts +4 -0
- package/es/utils/index.js +4 -0
- package/es/utils/props/button.d.ts +9 -0
- package/es/utils/props/button.js +13 -0
- package/es/utils/props/form.d.ts +881 -0
- package/es/utils/props/form.js +125 -0
- package/es/utils/props/listTpl.d.ts +869 -0
- package/es/utils/props/listTpl.js +13 -0
- package/lib/components/z-Ellipsis/ellipsis.d.ts +4 -0
- package/lib/components/z-Ellipsis/ellipsis.js +13 -0
- package/lib/components/z-Ellipsis/index.d.ts +3 -0
- package/lib/components/z-Ellipsis/index.js +8 -0
- package/lib/components/z-box/box.d.ts +20 -0
- package/lib/components/z-box/box.js +35 -0
- package/lib/components/z-box/index.d.ts +3 -0
- package/lib/components/z-box/index.js +8 -0
- package/lib/components/z-box/index.less +4 -0
- package/lib/components/z-button/z-button.js +2 -8
- package/lib/components/z-config-provider/configProvider.d.ts +4 -0
- package/lib/components/z-config-provider/configProvider.js +18 -0
- package/lib/components/z-config-provider/index.d.ts +3 -0
- package/lib/components/z-config-provider/index.js +8 -0
- package/lib/components/z-div/div.d.ts +6 -0
- package/lib/components/z-div/div.js +15 -0
- package/lib/components/z-div/index.d.ts +2 -0
- package/lib/components/z-div/index.js +8 -0
- package/lib/components/z-form/z-form.d.ts +8 -2
- package/lib/components/z-form/z-form.js +35 -3
- package/lib/components/z-list/index.d.ts +3 -0
- package/lib/components/z-list/index.js +8 -0
- package/lib/components/z-list/list.d.ts +11 -0
- package/lib/components/z-list/list.js +41 -0
- package/lib/components/z-preview/index.d.ts +3 -0
- package/lib/components/z-preview/index.js +8 -0
- package/lib/components/z-preview/preview.d.ts +4 -0
- package/lib/components/z-preview/preview.js +14 -0
- package/lib/components/z-simple-bar/index.d.ts +3 -0
- package/lib/components/z-simple-bar/index.js +8 -0
- package/lib/components/z-simple-bar/index.less +9 -0
- package/lib/components/z-simple-bar/z-simple-bar.d.ts +25 -0
- package/lib/components/z-simple-bar/z-simple-bar.js +100 -0
- package/lib/components/z-statistic/index.d.ts +3 -0
- package/lib/components/z-statistic/index.js +8 -0
- package/lib/components/z-statistic/index.less +22 -0
- package/lib/components/z-statistic/statistic.d.ts +13 -0
- package/lib/components/z-statistic/statistic.js +35 -0
- package/lib/components/z-table/index.d.ts +3 -0
- package/lib/components/z-table/index.js +8 -0
- package/lib/components/z-table/table.d.ts +8 -0
- package/lib/components/z-table/table.js +38 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +21 -1
- package/lib/style.js +2 -0
- package/lib/utils/hoc.d.ts +6 -0
- package/lib/utils/hoc.js +18 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +9 -0
- package/lib/utils/props/button.d.ts +9 -0
- package/lib/utils/props/button.js +19 -0
- package/lib/utils/props/form.d.ts +881 -0
- package/lib/utils/props/form.js +131 -0
- package/lib/utils/props/listTpl.d.ts +869 -0
- package/lib/utils/props/listTpl.js +19 -0
- package/package.json +11 -6
- package/dist/BizComps.js.map +0 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["fieldProps", "formItemProps", "dependencyColumns", "required", "initialValue", "propName"],
|
|
4
|
+
_excluded2 = ["restFieldProps"],
|
|
5
|
+
_excluded3 = ["restFormProps"];
|
|
6
|
+
/**
|
|
7
|
+
* 处理表单默认值
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var processInitialValue = function processInitialValue(e) {
|
|
11
|
+
var _restFieldArgs$style;
|
|
12
|
+
var fieldProps = e.fieldProps,
|
|
13
|
+
formItemProps = e.formItemProps,
|
|
14
|
+
dependencyColumns = e.dependencyColumns,
|
|
15
|
+
required = e.required,
|
|
16
|
+
initialValue = e.initialValue,
|
|
17
|
+
propName = e.propName,
|
|
18
|
+
rest = _objectWithoutPropertiesLoose(e, _excluded);
|
|
19
|
+
var _ref = fieldProps !== null && fieldProps !== void 0 ? fieldProps : {},
|
|
20
|
+
_ref$restFieldProps = _ref.restFieldProps,
|
|
21
|
+
restFieldProps = _ref$restFieldProps === void 0 ? {} : _ref$restFieldProps,
|
|
22
|
+
fieldRest = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
23
|
+
var _ref2 = formItemProps !== null && formItemProps !== void 0 ? formItemProps : {},
|
|
24
|
+
_ref2$restFormProps = _ref2.restFormProps,
|
|
25
|
+
restFormProps = _ref2$restFormProps === void 0 ? {} : _ref2$restFormProps,
|
|
26
|
+
formRest = _objectWithoutPropertiesLoose(_ref2, _excluded3);
|
|
27
|
+
var restFieldArgs = typeof restFieldProps === 'function' ? restFieldProps === null || restFieldProps === void 0 ? void 0 : restFieldProps() : restFieldProps;
|
|
28
|
+
return _extends({}, rest, initialValue ? {
|
|
29
|
+
initialValue: initialValue
|
|
30
|
+
} : {}, (rest === null || rest === void 0 ? void 0 : rest.valueType) === 'dependency' ? {
|
|
31
|
+
columns: function columns(obj) {
|
|
32
|
+
return (dependencyColumns !== null && dependencyColumns !== void 0 ? dependencyColumns : []).map(function (child) {
|
|
33
|
+
var _ref3, _childRest$fieldProps;
|
|
34
|
+
var value = (_ref3 = (fieldRest === null || fieldRest === void 0 ? void 0 : fieldRest.name) || []) === null || _ref3 === void 0 ? void 0 : _ref3.reduce(function (prev, next) {
|
|
35
|
+
if (prev !== null && prev !== void 0 && prev[next]) {
|
|
36
|
+
return prev === null || prev === void 0 ? void 0 : prev[next];
|
|
37
|
+
}
|
|
38
|
+
return prev;
|
|
39
|
+
}, obj);
|
|
40
|
+
var dependencyName = '';
|
|
41
|
+
try {
|
|
42
|
+
dependencyName = JSON.stringify(value);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
dependencyName = '';
|
|
45
|
+
}
|
|
46
|
+
var childRest = processInitialValue(child);
|
|
47
|
+
return _extends({}, childRest, {
|
|
48
|
+
fieldProps: _extends({}, childRest === null || childRest === void 0 ? void 0 : childRest.fieldProps, {
|
|
49
|
+
// 处理依赖项监听
|
|
50
|
+
dependency: dependencyName,
|
|
51
|
+
requestOptions: _extends({}, childRest === null || childRest === void 0 ? void 0 : (_childRest$fieldProps = childRest.fieldProps) === null || _childRest$fieldProps === void 0 ? void 0 : _childRest$fieldProps.requestOptions, {
|
|
52
|
+
formatter: function formatter(data) {
|
|
53
|
+
var _childRest$fieldProps2, _childRest$fieldProps3, _childRest$fieldProps4;
|
|
54
|
+
return _extends({}, childRest === null || childRest === void 0 ? void 0 : (_childRest$fieldProps2 = childRest.fieldProps) === null || _childRest$fieldProps2 === void 0 ? void 0 : (_childRest$fieldProps3 = _childRest$fieldProps2.requestOptions) === null || _childRest$fieldProps3 === void 0 ? void 0 : (_childRest$fieldProps4 = _childRest$fieldProps3.formatter) === null || _childRest$fieldProps4 === void 0 ? void 0 : _childRest$fieldProps4.call(_childRest$fieldProps3, data, obj));
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
// 依赖项关键
|
|
62
|
+
fieldProps: {
|
|
63
|
+
name: fieldRest === null || fieldRest === void 0 ? void 0 : fieldRest.name
|
|
64
|
+
}
|
|
65
|
+
} : {
|
|
66
|
+
fieldProps: _extends({}, fieldRest, {
|
|
67
|
+
style: _extends({}, (_restFieldArgs$style = restFieldArgs === null || restFieldArgs === void 0 ? void 0 : restFieldArgs.style) !== null && _restFieldArgs$style !== void 0 ? _restFieldArgs$style : {}, {
|
|
68
|
+
// 确保每个子组件能够撑开
|
|
69
|
+
width: '100%'
|
|
70
|
+
})
|
|
71
|
+
}, restFieldArgs),
|
|
72
|
+
formItemProps: _extends({}, formRest, required ? {
|
|
73
|
+
rules: [{
|
|
74
|
+
required: true
|
|
75
|
+
}]
|
|
76
|
+
} : {}, typeof restFormProps === 'function' ? restFormProps === null || restFormProps === void 0 ? void 0 : restFormProps() : restFormProps)
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
export var processFormProps = function processFormProps(props) {
|
|
80
|
+
var _ref4;
|
|
81
|
+
var columns = props.columns,
|
|
82
|
+
submitter = props.submitter,
|
|
83
|
+
labelColWidth = props.labelColWidth,
|
|
84
|
+
settingOpt = props.settingOpt,
|
|
85
|
+
_props$labelCol = props.labelCol,
|
|
86
|
+
labelCol = _props$labelCol === void 0 ? {} : _props$labelCol,
|
|
87
|
+
defaultColsNumber = props.defaultColsNumber,
|
|
88
|
+
grid = props.grid,
|
|
89
|
+
span = props.span,
|
|
90
|
+
colProps = props.colProps,
|
|
91
|
+
layoutType = props.layoutType,
|
|
92
|
+
onFinish = props.onFinish,
|
|
93
|
+
onValuesChange = props.onValuesChange,
|
|
94
|
+
formRef = props.formRef,
|
|
95
|
+
currentRef = props.currentRef;
|
|
96
|
+
return _extends({
|
|
97
|
+
columns: (_ref4 = columns || []) === null || _ref4 === void 0 ? void 0 : _ref4.filter(function (e) {
|
|
98
|
+
return !!e;
|
|
99
|
+
}).map(function (e) {
|
|
100
|
+
return processInitialValue(e);
|
|
101
|
+
}),
|
|
102
|
+
onFinish: onFinish,
|
|
103
|
+
onValuesChange: onValuesChange
|
|
104
|
+
}, submitter === false ? {
|
|
105
|
+
submitter: submitter
|
|
106
|
+
} : {}, {
|
|
107
|
+
formRef: formRef,
|
|
108
|
+
currentRef: currentRef,
|
|
109
|
+
colProps: colProps,
|
|
110
|
+
labelCol: _extends({}, labelCol, {
|
|
111
|
+
style: _extends({}, labelCol === null || labelCol === void 0 ? void 0 : labelCol.style, {
|
|
112
|
+
width: labelColWidth
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
}, settingOpt ? {
|
|
116
|
+
settingOpt: {
|
|
117
|
+
key: "form_setting_" + Math.random()
|
|
118
|
+
}
|
|
119
|
+
} : {}, {
|
|
120
|
+
defaultColsNumber: defaultColsNumber,
|
|
121
|
+
grid: grid,
|
|
122
|
+
span: span,
|
|
123
|
+
layoutType: layoutType
|
|
124
|
+
});
|
|
125
|
+
};
|