@lm_fe/components 0.1.201 → 0.2.5
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/README.md +1 -1
- package/dist/keep-alive/common.d.ts +46 -0
- package/dist/keep-alive/components/AsyncComponent.d.ts +27 -0
- package/dist/keep-alive/components/Comment.d.ts +18 -0
- package/dist/keep-alive/components/Consumer.d.ts +20 -0
- package/dist/keep-alive/components/keepAlive.d.ts +4 -0
- package/dist/keep-alive/components/provider.d.ts +31 -0
- package/dist/keep-alive/contexts/IdentificationContext.d.ts +12 -0
- package/dist/keep-alive/contexts/KeepAliveContext.d.ts +5 -0
- package/dist/keep-alive/index.d.ts +7 -0
- package/dist/keep-alive/index.js +1901 -0
- package/dist/keep-alive/utils/bindLifecycle.d.ts +3 -0
- package/dist/keep-alive/utils/changePositionByComment.d.ts +1 -0
- package/dist/keep-alive/utils/createEventEmitter.d.ts +11 -0
- package/dist/keep-alive/utils/createStoreElement.d.ts +1 -0
- package/dist/keep-alive/utils/createUniqueIdentification.d.ts +8 -0
- package/dist/keep-alive/utils/debug.d.ts +3 -0
- package/dist/keep-alive/utils/getDisplayName.d.ts +2 -0
- package/dist/keep-alive/utils/getKeepAlive.d.ts +3 -0
- package/dist/keep-alive/utils/getKeyByFiberNode.d.ts +1 -0
- package/dist/keep-alive/utils/isRegExp.d.ts +1 -0
- package/dist/keep-alive/utils/keepAliveDecorator.d.ts +17 -0
- package/dist/keep-alive/utils/md5.d.ts +1 -0
- package/dist/keep-alive/utils/noop.d.ts +2 -0
- package/dist/keep-alive/utils/shallowEqual.d.ts +2 -0
- package/dist/keep-alive/utils/useKeepAliveEffect.d.ts +2 -0
- package/dist/keep-alive/utils/withIdentificationContextConsumer.d.ts +10 -0
- package/dist/keep-alive/utils/withKeepAliveContextConsumer.d.ts +10 -0
- package/dist/src/ArraySingle/Inner.d.ts +3 -0
- package/dist/src/ArraySingle/index.d.ts +2 -0
- package/dist/src/CaseTempleteEdit/Inner.d.ts +4 -0
- package/dist/src/CaseTempleteEdit/config.d.ts +20 -0
- package/dist/src/CaseTempleteEdit/index.d.ts +4 -0
- package/dist/src/CaseTempleteEdit/types.d.ts +19 -0
- package/dist/src/CaseTempleteEdit/utils.d.ts +2 -0
- package/dist/src/CaseTempleteEditEmr/Inner.d.ts +3 -0
- package/dist/src/CaseTempleteEditEmr/demo_text.d.ts +1 -0
- package/dist/src/CaseTempleteEditEmr/index.d.ts +2 -0
- package/dist/src/CaseTempleteEditEmr/types.d.ts +6 -0
- package/dist/src/CaseTempleteEditEmr/utils.d.ts +3 -0
- package/dist/{GlobalModal → src/GlobalModal}/index.d.ts +2 -1
- package/dist/src/LazyAntd/index.d.ts +17 -0
- package/dist/{Monaco → src/Monaco}/Inner.d.ts +1 -1
- package/dist/src/MyAddress/Inner.d.ts +3 -0
- package/dist/{MyImageEditor → src/MyImageEditor}/Inner.d.ts +1 -1
- package/dist/{MyImageEditor → src/MyImageEditor}/utils.d.ts +1 -1
- package/dist/{MyInput → src/MyInput}/index.d.ts +2 -2
- package/dist/{PDF_Frame_View → src/PDF_Frame_View}/utils.d.ts +1 -1
- package/dist/src/PatientSelect/Inner.d.ts +16 -0
- package/dist/src/PatientSelect/index.d.ts +3 -0
- package/dist/src/SimpleForm/Inner.d.ts +5 -0
- package/dist/{SimpleForm → src/SimpleForm}/components/TabForm/index.d.ts +3 -2
- package/dist/{SimpleForm → src/SimpleForm}/components/extra/Custom.d.ts +2 -1
- package/dist/{SimpleForm → src/SimpleForm}/components/index.d.ts +3 -6
- package/dist/src/SimpleForm/index.d.ts +17 -0
- package/dist/{SimpleForm/index.d.ts → src/SimpleForm/types.d.ts} +0 -14
- package/dist/src/a_chunks/ArraySingle.Inner.js +19 -0
- package/dist/src/a_chunks/CaseTempleteEdit.Inner.js +622 -0
- package/dist/src/a_chunks/CaseTempleteEditEmr.Inner.js +235 -0
- package/dist/{a_chunks/.root6.js → src/a_chunks/MyAddress.Inner.js} +38 -89
- package/dist/{a_chunks/.root4.js → src/a_chunks/MyImageEditor.Inner.js} +128 -179
- package/dist/{a_chunks/.root5.js → src/a_chunks/Old.InnerOld.js} +20 -59
- package/dist/{a_chunks/.root2.js → src/a_chunks/PDF_Frame_View.Inner.js} +11 -51
- package/dist/src/a_chunks/PatientSelect.Inner.js +281 -0
- package/dist/src/a_chunks/SimpleForm.Inner.js +318 -0
- package/dist/src/a_chunks/index.js +550 -0
- package/dist/src/a_chunks/style-inject.es.js +25 -0
- package/dist/src/config.d.ts +1 -0
- package/dist/{hooks → src/hooks}/index.d.ts +1 -0
- package/dist/src/hooks/use_fuck.d.ts +5 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.js +10 -0
- package/dist/src/pack_components.d.ts +213 -0
- package/dist/src/utils/getInputStyle.d.ts +1 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/other.d.ts +3 -0
- package/package.json +30 -26
- package/dist/ContainerDimensions2/index.d.ts +0 -10
- package/dist/LazyAntd/AutoComplete/Inner.d.ts +0 -4
- package/dist/LazyAntd/AutoComplete/index.d.ts +0 -4
- package/dist/LazyAntd/DatePicker/Base/Calendar.d.ts +0 -3
- package/dist/LazyAntd/DatePicker/Base/DatePicker.d.ts +0 -11
- package/dist/LazyAntd/DatePicker/Base/index.d.ts +0 -12
- package/dist/LazyAntd/DatePicker/Base/props.d.ts +0 -14
- package/dist/LazyAntd/DatePicker/Calendar.d.ts +0 -4
- package/dist/LazyAntd/DatePicker/DatePicker.d.ts +0 -4
- package/dist/LazyAntd/DatePicker/MonthPicker.d.ts +0 -4
- package/dist/LazyAntd/DatePicker/RangePicker.d.ts +0 -4
- package/dist/LazyAntd/DatePicker/TimePicker.d.ts +0 -4
- package/dist/LazyAntd/DatePicker/index.d.ts +0 -5
- package/dist/LazyAntd/Dropdown/Button.d.ts +0 -2
- package/dist/LazyAntd/Dropdown/Inner.d.ts +0 -3
- package/dist/LazyAntd/Dropdown/index.d.ts +0 -10
- package/dist/LazyAntd/Form/FormItemInner.d.ts +0 -2
- package/dist/LazyAntd/Form/Inner.d.ts +0 -3
- package/dist/LazyAntd/Form/index.d.ts +0 -9
- package/dist/LazyAntd/Modal/Inner.d.ts +0 -4
- package/dist/LazyAntd/Modal/index.d.ts +0 -3
- package/dist/LazyAntd/Pagination/Inner.d.ts +0 -3
- package/dist/LazyAntd/Pagination/index.d.ts +0 -3
- package/dist/LazyAntd/Select/Inner.d.ts +0 -3
- package/dist/LazyAntd/Select/OptionInner.d.ts +0 -2
- package/dist/LazyAntd/Select/index.d.ts +0 -10
- package/dist/LazyAntd/Table/Inner.d.ts +0 -3
- package/dist/LazyAntd/Table/index.d.ts +0 -3
- package/dist/LazyAntd/Tree/DirectoryTreeInner.d.ts +0 -3
- package/dist/LazyAntd/Tree/Inner.d.ts +0 -3
- package/dist/LazyAntd/Tree/TreeNodeInner.d.ts +0 -4
- package/dist/LazyAntd/Tree/index.d.ts +0 -12
- package/dist/LazyAntd/TreeSelect/Inner.d.ts +0 -3
- package/dist/LazyAntd/TreeSelect/index.d.ts +0 -3
- package/dist/LazyAntd/index.d.ts +0 -25
- package/dist/MyAddress/Inner.d.ts +0 -3
- package/dist/QRCode/Inner.d.ts +0 -3
- package/dist/QRCode/index.d.ts +0 -2
- package/dist/QRCode/types.d.ts +0 -68
- package/dist/a_chunks/.root.js +0 -805
- package/dist/a_chunks/.root.js.map +0 -1
- package/dist/a_chunks/.root10.js +0 -8
- package/dist/a_chunks/.root10.js.map +0 -1
- package/dist/a_chunks/.root11.js +0 -7
- package/dist/a_chunks/.root11.js.map +0 -1
- package/dist/a_chunks/.root12.js +0 -8
- package/dist/a_chunks/.root12.js.map +0 -1
- package/dist/a_chunks/.root13.js +0 -4
- package/dist/a_chunks/.root13.js.map +0 -1
- package/dist/a_chunks/.root14.js +0 -8
- package/dist/a_chunks/.root14.js.map +0 -1
- package/dist/a_chunks/.root15.js +0 -7
- package/dist/a_chunks/.root15.js.map +0 -1
- package/dist/a_chunks/.root16.js +0 -8
- package/dist/a_chunks/.root16.js.map +0 -1
- package/dist/a_chunks/.root17.js +0 -8
- package/dist/a_chunks/.root17.js.map +0 -1
- package/dist/a_chunks/.root18.js +0 -8
- package/dist/a_chunks/.root18.js.map +0 -1
- package/dist/a_chunks/.root19.js +0 -8
- package/dist/a_chunks/.root19.js.map +0 -1
- package/dist/a_chunks/.root2.js.map +0 -1
- package/dist/a_chunks/.root20.js +0 -6
- package/dist/a_chunks/.root20.js.map +0 -1
- package/dist/a_chunks/.root21.js +0 -5
- package/dist/a_chunks/.root21.js.map +0 -1
- package/dist/a_chunks/.root3.js +0 -7
- package/dist/a_chunks/.root3.js.map +0 -1
- package/dist/a_chunks/.root4.js.map +0 -1
- package/dist/a_chunks/.root5.js.map +0 -1
- package/dist/a_chunks/.root6.js.map +0 -1
- package/dist/a_chunks/.root7.js +0 -8
- package/dist/a_chunks/.root7.js.map +0 -1
- package/dist/a_chunks/.root8.js +0 -8
- package/dist/a_chunks/.root8.js.map +0 -1
- package/dist/a_chunks/.root9.js +0 -7
- package/dist/a_chunks/.root9.js.map +0 -1
- package/dist/a_chunks/index.js +0 -1238
- package/dist/a_chunks/index.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -45
- package/dist/index.js.map +0 -1
- package/dist/pack_components.d.ts +0 -17
- package/dist/utils/getInputStyle.d.ts +0 -11
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/other.d.ts +0 -4
- /package/dist/{ContainerDimensions → src/ContainerDimensions}/index.d.ts +0 -0
- /package/dist/{GlobalModal → src/GlobalModal}/utils.d.ts +0 -0
- /package/dist/{Monaco → src/Monaco}/index.d.ts +0 -0
- /package/dist/{MyAddress → src/MyAddress}/Old/InnerOld.d.ts +0 -0
- /package/dist/{MyAddress → src/MyAddress}/Old/index.d.ts +0 -0
- /package/dist/{MyAddress → src/MyAddress}/Old/options.d.ts +0 -0
- /package/dist/{MyAddress → src/MyAddress}/index.d.ts +0 -0
- /package/dist/{MyAddress → src/MyAddress}/type.d.ts +0 -0
- /package/dist/{MyAddress → src/MyAddress}/utils.d.ts +0 -0
- /package/dist/{MyImageEditor → src/MyImageEditor}/index.d.ts +0 -0
- /package/dist/{MyImageEditor → src/MyImageEditor}/init_delete_control.d.ts +0 -0
- /package/dist/{MyInput → src/MyInput}/types.d.ts +0 -0
- /package/dist/{MyLazyComponent → src/MyLazyComponent}/index.d.ts +0 -0
- /package/dist/{PDF_Frame_View → src/PDF_Frame_View}/Inner.d.ts +0 -0
- /package/dist/{PDF_Frame_View → src/PDF_Frame_View}/index.d.ts +0 -0
- /package/dist/{PDF_Frame_View → src/PDF_Frame_View}/types.d.ts +0 -0
- /package/dist/{SimpleForm → src/SimpleForm}/components/extra/MultiInput.d.ts +0 -0
- /package/dist/{SimpleForm → src/SimpleForm}/components/extra/SimpleSelect.d.ts +0 -0
- /package/dist/{SimpleForm → src/SimpleForm}/components/extra/SwitchSelect.d.ts +0 -0
- /package/dist/{SimpleForm → src/SimpleForm}/types/help.d.ts +0 -0
- /package/dist/{SimpleForm → src/SimpleForm}/types/metaTypes.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useMchcDriverStatus.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useMyEffect.d.ts +0 -0
- /package/dist/{style → src/style}/index.d.ts +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["optionsArr", "type"],
|
|
6
|
+
_excluded2 = ["optionsArr", "value", "onChange"],
|
|
7
|
+
_excluded3 = ["CustomedComponent", "value", "onChange"],
|
|
8
|
+
_excluded4 = ["value", "formSchema", "onChange", "title", "style"];
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
import { Radio, Tabs, Input, InputNumber, Checkbox, TimePicker, DatePicker, Switch, Rate, Slider, Row, Divider, Form, Col } from 'antd';
|
|
12
|
+
import { Select_L } from '@noah-libjs/components';
|
|
13
|
+
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
14
|
+
import { L as LazyAntd, S as SimpleForm$1 } from './index.js';
|
|
15
|
+
import '@lm_fe/env';
|
|
16
|
+
import 'lodash';
|
|
17
|
+
import '@lm_fe/static';
|
|
18
|
+
import '@lm_fe/service';
|
|
19
|
+
import '@lm_fe/provoke';
|
|
20
|
+
import '@lm_fe/utils';
|
|
21
|
+
function SimpleSelect(props) {
|
|
22
|
+
var optionsArr = props.optionsArr,
|
|
23
|
+
_props$type = props.type,
|
|
24
|
+
type = _props$type === void 0 ? 'Select' : _props$type,
|
|
25
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
if (type === 'Select') return /*#__PURE__*/React.createElement(Select_L, _objectSpread(_objectSpread({}, others), {}, {
|
|
27
|
+
options: optionsArr.map(function (label, value) {
|
|
28
|
+
return {
|
|
29
|
+
label: label,
|
|
30
|
+
value: value
|
|
31
|
+
};
|
|
32
|
+
})
|
|
33
|
+
}));
|
|
34
|
+
//@ts-ignore
|
|
35
|
+
return /*#__PURE__*/React.createElement(Radio.Group, _objectSpread(_objectSpread({}, others), {}, {
|
|
36
|
+
options: optionsArr.map(function (label, value) {
|
|
37
|
+
return {
|
|
38
|
+
label: label,
|
|
39
|
+
value: value
|
|
40
|
+
};
|
|
41
|
+
})
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
var Tree = LazyAntd.Tree,
|
|
45
|
+
TreeSelect = LazyAntd.TreeSelect,
|
|
46
|
+
Select = LazyAntd.Select,
|
|
47
|
+
Table = LazyAntd.Table,
|
|
48
|
+
Dropdown = LazyAntd.Dropdown,
|
|
49
|
+
Pagination = LazyAntd.Pagination;
|
|
50
|
+
function MultiInput(props) {
|
|
51
|
+
var optionsArr = props.optionsArr,
|
|
52
|
+
_props$value = props.value,
|
|
53
|
+
value = _props$value === void 0 ? "" : _props$value,
|
|
54
|
+
_onChange = props.onChange,
|
|
55
|
+
others = _objectWithoutProperties(props, _excluded2);
|
|
56
|
+
var _value = value ? value.split(',').filter(function (_) {
|
|
57
|
+
return _;
|
|
58
|
+
}) : [];
|
|
59
|
+
return /*#__PURE__*/React.createElement(Select, _objectSpread({
|
|
60
|
+
mode: "tags",
|
|
61
|
+
value: _value,
|
|
62
|
+
onChange: function onChange(v) {
|
|
63
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange.call(null, v.join(','), []);
|
|
64
|
+
}
|
|
65
|
+
}, others));
|
|
66
|
+
}
|
|
67
|
+
function Custom(props) {
|
|
68
|
+
var CustomedComponent = props.CustomedComponent,
|
|
69
|
+
value = props.value,
|
|
70
|
+
onChange = props.onChange,
|
|
71
|
+
others = _objectWithoutProperties(props, _excluded3);
|
|
72
|
+
//@ts-ignore
|
|
73
|
+
return /*#__PURE__*/React.createElement(CustomedComponent, _objectSpread({
|
|
74
|
+
value: value,
|
|
75
|
+
onChange: onChange
|
|
76
|
+
}, others));
|
|
77
|
+
}
|
|
78
|
+
function SwitchSelect(props) {
|
|
79
|
+
var value = props.value;
|
|
80
|
+
return /*#__PURE__*/React.createElement(Select_L, _objectSpread(_objectSpread({}, props), {}, {
|
|
81
|
+
value: typeof value === 'undefined' ? value : +value,
|
|
82
|
+
options: ['否', '是'].map(function (_, idx) {
|
|
83
|
+
return {
|
|
84
|
+
label: _,
|
|
85
|
+
value: idx
|
|
86
|
+
};
|
|
87
|
+
}),
|
|
88
|
+
onChange: function onChange(a, b) {
|
|
89
|
+
var _props$onChange;
|
|
90
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, typeof a === 'undefined' ? a : !!a, b);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
function TabForm(_ref) {
|
|
95
|
+
var _ref$value = _ref.value,
|
|
96
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
|
97
|
+
formSchema = _ref.formSchema,
|
|
98
|
+
onChange = _ref.onChange,
|
|
99
|
+
title = _ref.title,
|
|
100
|
+
style = _ref.style,
|
|
101
|
+
others = _objectWithoutProperties(_ref, _excluded4);
|
|
102
|
+
var actions = {
|
|
103
|
+
add: function add(e) {
|
|
104
|
+
onChange === null || onChange === void 0 || onChange([].concat(_toConsumableArray(value), [{
|
|
105
|
+
_id: +new Date()
|
|
106
|
+
}]));
|
|
107
|
+
},
|
|
108
|
+
remove: function remove(_id) {
|
|
109
|
+
var index = value.findIndex(function (_) {
|
|
110
|
+
return _._id == _id;
|
|
111
|
+
});
|
|
112
|
+
if (index > -1) {
|
|
113
|
+
var isOk = confirm('确定删除吗?');
|
|
114
|
+
if (!isOk) return;
|
|
115
|
+
value.splice(index, 1);
|
|
116
|
+
onChange === null || onChange === void 0 || onChange(_toConsumableArray(value));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
return /*#__PURE__*/React.createElement(Tabs, _objectSpread({
|
|
121
|
+
size: "small",
|
|
122
|
+
type: "editable-card",
|
|
123
|
+
onEdit: function onEdit(e, action) {
|
|
124
|
+
return actions[action](e);
|
|
125
|
+
},
|
|
126
|
+
style: _objectSpread({
|
|
127
|
+
background: '#fff',
|
|
128
|
+
border: '1px dashed #ccc',
|
|
129
|
+
padding: 12
|
|
130
|
+
}, style)
|
|
131
|
+
}, others), value.map(function (_, idx) {
|
|
132
|
+
return /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
133
|
+
key: _._id,
|
|
134
|
+
tab: title + (idx + 1)
|
|
135
|
+
}, /*#__PURE__*/React.createElement(SimpleForm$1, _objectSpread(_objectSpread({}, formSchema), {}, {
|
|
136
|
+
onValuesChange: function onValuesChange(a, values) {
|
|
137
|
+
value.splice(idx, 1, Object.assign(value[idx], values));
|
|
138
|
+
onChange === null || onChange === void 0 || onChange(_toConsumableArray(value));
|
|
139
|
+
}
|
|
140
|
+
})));
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
var RangePicker = DatePicker.RangePicker;
|
|
144
|
+
var ComponentMapping = {
|
|
145
|
+
Input: Input,
|
|
146
|
+
Select: Select_L,
|
|
147
|
+
Radio: Radio,
|
|
148
|
+
InputNumber: InputNumber,
|
|
149
|
+
Checkbox: Checkbox,
|
|
150
|
+
TimePicker: TimePicker,
|
|
151
|
+
DatePicker: DatePicker,
|
|
152
|
+
Switch: Switch,
|
|
153
|
+
Rate: Rate,
|
|
154
|
+
Slider: Slider,
|
|
155
|
+
Color: Input,
|
|
156
|
+
TextArea: Input.TextArea,
|
|
157
|
+
CheckboxGroup: Checkbox.Group,
|
|
158
|
+
Grid: Row,
|
|
159
|
+
Text: Text,
|
|
160
|
+
Divider: Divider,
|
|
161
|
+
// HospitalTreeSelect,
|
|
162
|
+
SwitchSelect: SwitchSelect,
|
|
163
|
+
SimpleSelect: SimpleSelect,
|
|
164
|
+
Custom: Custom,
|
|
165
|
+
TabForm: TabForm,
|
|
166
|
+
MultiInput: MultiInput,
|
|
167
|
+
RangePicker: RangePicker
|
|
168
|
+
};
|
|
169
|
+
var FormItem = Form.Item;
|
|
170
|
+
var targetLayoutType = 2;
|
|
171
|
+
function calcLabelCol(n) {
|
|
172
|
+
return 24 * targetLayoutType / n;
|
|
173
|
+
}
|
|
174
|
+
function FormItemsInRow(props) {
|
|
175
|
+
var _items$filter;
|
|
176
|
+
var items = props.itemsInRow,
|
|
177
|
+
_props$layoutType = props.layoutType,
|
|
178
|
+
layoutType = _props$layoutType === void 0 ? 8 : _props$layoutType,
|
|
179
|
+
disabled = props.disabled;
|
|
180
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
181
|
+
className: "fuck_row"
|
|
182
|
+
}, items === null || items === void 0 || (_items$filter = items.filter(function (_) {
|
|
183
|
+
return !!_;
|
|
184
|
+
})) === null || _items$filter === void 0 ? void 0 : _items$filter.map(function (item) {
|
|
185
|
+
if (!item) return null;
|
|
186
|
+
var _item$outerOptions = item.outerOptions,
|
|
187
|
+
outerOptions = _item$outerOptions === void 0 ? {} : _item$outerOptions,
|
|
188
|
+
_item$type = item.type,
|
|
189
|
+
type = _item$type === void 0 ? '' : _item$type,
|
|
190
|
+
_item$innerOptions = item.innerOptions,
|
|
191
|
+
innerOptions = _item$innerOptions === void 0 ? {} : _item$innerOptions,
|
|
192
|
+
customNode = item.customNode,
|
|
193
|
+
required = item.required;
|
|
194
|
+
var options = innerOptions;
|
|
195
|
+
var C = ComponentMapping[type];
|
|
196
|
+
var hasCustomNode = customNode !== undefined;
|
|
197
|
+
if (!C && !hasCustomNode) return /*#__PURE__*/React.createElement(Form.Item, {
|
|
198
|
+
style: {
|
|
199
|
+
margin: 0
|
|
200
|
+
}
|
|
201
|
+
}, 'type error:' + type);
|
|
202
|
+
var _layoutType = item.layoutType || layoutType;
|
|
203
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
204
|
+
className: "fuck_col",
|
|
205
|
+
span: _layoutType
|
|
206
|
+
}, /*#__PURE__*/React.createElement(FormItem, _objectSpread(_objectSpread({
|
|
207
|
+
className: "fuck_FormItem",
|
|
208
|
+
rules: required ? [{
|
|
209
|
+
required: true,
|
|
210
|
+
message: ''
|
|
211
|
+
}] : []
|
|
212
|
+
}, outerOptions), {}, {
|
|
213
|
+
labelCol: {
|
|
214
|
+
span: calcLabelCol(_layoutType)
|
|
215
|
+
}
|
|
216
|
+
}), hasCustomNode ? customNode : (/*#__PURE__*/React.createElement(C, _objectSpread({
|
|
217
|
+
disabled: disabled,
|
|
218
|
+
allowClear: true,
|
|
219
|
+
style: {},
|
|
220
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(outerOptions === null || outerOptions === void 0 ? void 0 : outerOptions['label'])
|
|
221
|
+
}, options)))));
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
function FormItemCommon(props) {
|
|
225
|
+
var _items$filter2;
|
|
226
|
+
var items = props.formItems,
|
|
227
|
+
disabled = props.disabled;
|
|
228
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (items === null || items === void 0 || (_items$filter2 = items.filter(function (_) {
|
|
229
|
+
return !!_;
|
|
230
|
+
})) === null || _items$filter2 === void 0 ? void 0 : _items$filter2.map(function (item, itemIndex) {
|
|
231
|
+
if (!item) return null;
|
|
232
|
+
var _item$outerOptions2 = item.outerOptions,
|
|
233
|
+
outerOptions = _item$outerOptions2 === void 0 ? {} : _item$outerOptions2,
|
|
234
|
+
_item$type2 = item.type,
|
|
235
|
+
type = _item$type2 === void 0 ? '' : _item$type2,
|
|
236
|
+
_item$innerOptions2 = item.innerOptions,
|
|
237
|
+
innerOptions = _item$innerOptions2 === void 0 ? {} : _item$innerOptions2,
|
|
238
|
+
customNode = item.customNode,
|
|
239
|
+
required = item.required;
|
|
240
|
+
var options = innerOptions;
|
|
241
|
+
var C = ComponentMapping[type];
|
|
242
|
+
var key = "".concat(itemIndex, "_").concat(type);
|
|
243
|
+
var innerStyle = options['stlyle'] || {};
|
|
244
|
+
var hasCustomNode = customNode !== undefined;
|
|
245
|
+
if (!C && !hasCustomNode) return /*#__PURE__*/React.createElement(Form.Item, {
|
|
246
|
+
key: key,
|
|
247
|
+
style: {
|
|
248
|
+
margin: 0
|
|
249
|
+
}
|
|
250
|
+
}, 'type error:' + type);
|
|
251
|
+
return /*#__PURE__*/React.createElement(FormItem, _objectSpread({
|
|
252
|
+
key: key,
|
|
253
|
+
className: "fuck_FormItem",
|
|
254
|
+
style: _objectSpread({
|
|
255
|
+
marginBottom: 6
|
|
256
|
+
}, innerStyle),
|
|
257
|
+
rules: required ? SimpleForm.requiredRules : []
|
|
258
|
+
}, outerOptions), hasCustomNode ? customNode : (/*#__PURE__*/React.createElement(C, _objectSpread({
|
|
259
|
+
disabled: disabled,
|
|
260
|
+
allowClear: true,
|
|
261
|
+
style: {},
|
|
262
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(outerOptions === null || outerOptions === void 0 ? void 0 : outerOptions['label'])
|
|
263
|
+
}, options))));
|
|
264
|
+
})) || null);
|
|
265
|
+
}
|
|
266
|
+
var SimpleFormInner = /*#__PURE__*/forwardRef(function SimpleFormRender(_ref2, ref) {
|
|
267
|
+
var blocks = _ref2.blocks,
|
|
268
|
+
formItems = _ref2.formItems,
|
|
269
|
+
disabled = _ref2.disabled,
|
|
270
|
+
form = _ref2.form,
|
|
271
|
+
onValuesChange = _ref2.onValuesChange,
|
|
272
|
+
_ref2$formProps = _ref2.formProps,
|
|
273
|
+
formProps = _ref2$formProps === void 0 ? {} : _ref2$formProps;
|
|
274
|
+
var _Form$useForm = Form.useForm(),
|
|
275
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
276
|
+
innerForm = _Form$useForm2[0];
|
|
277
|
+
useImperativeHandle(ref, function () {
|
|
278
|
+
return form || innerForm;
|
|
279
|
+
}, []);
|
|
280
|
+
return /*#__PURE__*/React.createElement(Form, _objectSpread({
|
|
281
|
+
form: form || innerForm,
|
|
282
|
+
onValuesChange: onValuesChange
|
|
283
|
+
}, formProps), (blocks === null || blocks === void 0 ? void 0 : blocks.map(function (_ref3, blockIndex) {
|
|
284
|
+
var rows = _ref3.rows,
|
|
285
|
+
title = _ref3.title;
|
|
286
|
+
var blockNode = rows.map(function (rowData, rowIndex) {
|
|
287
|
+
return /*#__PURE__*/React.createElement(FormItemsInRow, _objectSpread({
|
|
288
|
+
key: "".concat(rowIndex, "_").concat(rowData.label),
|
|
289
|
+
disabled: disabled
|
|
290
|
+
}, rowData));
|
|
291
|
+
});
|
|
292
|
+
return title ? (/*#__PURE__*/React.createElement("fieldset", {
|
|
293
|
+
key: "".concat(blockIndex, "_").concat(title),
|
|
294
|
+
style: {
|
|
295
|
+
border: '1px solid #ccc',
|
|
296
|
+
padding: '12px 12px 0 12px',
|
|
297
|
+
borderRadius: 2
|
|
298
|
+
}
|
|
299
|
+
}, /*#__PURE__*/React.createElement("legend", {
|
|
300
|
+
style: {
|
|
301
|
+
padding: '0 12px',
|
|
302
|
+
margin: 0,
|
|
303
|
+
marginLeft: 12,
|
|
304
|
+
border: 0,
|
|
305
|
+
width: 'auto',
|
|
306
|
+
display: 'inline-block',
|
|
307
|
+
background: 'transparent',
|
|
308
|
+
fontSize: 16,
|
|
309
|
+
color: '#150f55',
|
|
310
|
+
fontWeight: 'bold'
|
|
311
|
+
}
|
|
312
|
+
}, title), blockNode)) : blockNode;
|
|
313
|
+
})) || null, /*#__PURE__*/React.createElement(FormItemCommon, {
|
|
314
|
+
formItems: formItems,
|
|
315
|
+
disabled: disabled
|
|
316
|
+
}));
|
|
317
|
+
});
|
|
318
|
+
export { SimpleFormInner as default };
|