fan-standard-comp 4.0.6 → 4.0.8
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/fan-standard-comp.min.css +1 -1
- package/dist/fan-standard-comp.min.js +1 -1
- package/es/ButtonGroup/index.d.ts +2 -0
- package/es/ButtonGroup/index.js +31 -18
- package/es/ButtonGroup/styles/index.js +9 -1
- package/es/DragContent/index.js +1 -1
- package/es/DragContent/index.less +2 -3
- package/es/FormComp/VarTemplate/index.js +27 -9
- package/es/FormComp/index.d.ts +1 -0
- package/es/FormComp/index.js +3 -1
- package/es/StandardContent/ContentHeader.d.ts +11 -0
- package/es/StandardContent/ContentHeader.js +101 -0
- package/es/StandardContent/SubfieldContent.d.ts +3 -1
- package/es/StandardContent/SubfieldContent.js +65 -23
- package/es/StandardContent/WrapperContent.d.ts +3 -1
- package/es/StandardContent/WrapperContent.js +66 -19
- package/es/StandardContent/styles/Header.d.ts +6 -0
- package/es/StandardContent/styles/Header.js +51 -0
- package/es/StandardContent/styles/Subfield.js +22 -4
- package/es/StandardContent/styles/Wrapper.js +8 -3
- package/es/StandardContent/styles/index.less +11 -11
- package/es/StandardForm/index.js +36 -36
- package/es/StandardForm/style/index.less +1 -1
- package/es/StandardModal/index.js +62 -62
- package/es/StandardModal/style/index.js +8 -4
- package/es/StandardModal/style/index.less +5 -5
- package/es/StandardPanel/index.d.ts +1 -0
- package/es/StandardPanel/index.js +8 -7
- package/es/StandardPanel/style/index.js +9 -2
- package/es/StandardTable/index.js +9 -9
- package/es/StandardTable/style/index.js +1 -1
- package/es/components/IconNode/index.d.ts +1 -0
- package/es/components/IconNode/index.js +6 -3
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -0
- package/es/theme/index.js +4 -4
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +3 -1
- package/es/utils/regExp.js +111 -0
- package/lib/ButtonGroup/index.d.ts +2 -0
- package/lib/ButtonGroup/index.js +31 -18
- package/lib/ButtonGroup/styles/index.js +9 -1
- package/lib/DragContent/index.js +1 -1
- package/lib/DragContent/index.less +2 -3
- package/lib/FormComp/VarTemplate/index.js +27 -9
- package/lib/FormComp/index.d.ts +1 -0
- package/lib/FormComp/index.js +7 -0
- package/lib/StandardContent/ContentHeader.d.ts +11 -0
- package/lib/StandardContent/ContentHeader.js +110 -0
- package/lib/StandardContent/SubfieldContent.d.ts +3 -1
- package/lib/StandardContent/SubfieldContent.js +67 -23
- package/lib/StandardContent/WrapperContent.d.ts +3 -1
- package/lib/StandardContent/WrapperContent.js +68 -19
- package/lib/StandardContent/styles/Header.d.ts +6 -0
- package/lib/StandardContent/styles/Header.js +57 -0
- package/lib/StandardContent/styles/Subfield.js +22 -4
- package/lib/StandardContent/styles/Wrapper.js +8 -3
- package/lib/StandardContent/styles/index.less +11 -11
- package/lib/StandardForm/index.js +36 -36
- package/lib/StandardForm/style/index.less +1 -1
- package/lib/StandardModal/index.js +62 -62
- package/lib/StandardModal/style/index.js +8 -4
- package/lib/StandardModal/style/index.less +5 -5
- package/lib/StandardPanel/index.d.ts +1 -0
- package/lib/StandardPanel/index.js +8 -7
- package/lib/StandardPanel/style/index.js +9 -2
- package/lib/StandardTable/index.js +9 -9
- package/lib/StandardTable/style/index.js +1 -1
- package/lib/components/IconNode/index.d.ts +1 -0
- package/lib/components/IconNode/index.js +6 -3
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- package/lib/theme/index.js +4 -4
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +11 -0
- package/lib/utils/regExp.js +116 -0
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@ var _excluded = ["children", "className", "style", "size", "type", "formItemGrou
|
|
|
2
2
|
_excluded2 = ["name", "type", "icon", "ghost", "disabled", "loading", "fn"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
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); }
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
7
|
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; }
|
|
6
8
|
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; }
|
|
7
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
13
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
14
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -39,38 +39,38 @@ var StandardModal = function StandardModal(props) {
|
|
|
39
39
|
hashId = _useStyle2[1];
|
|
40
40
|
var InitFanContext = useContext(FanContext);
|
|
41
41
|
var providerConfig = InitFanContext['StandardModal'] || {}; // 使用上下文(全局配置)设置扩展的配置项
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
className =
|
|
45
|
-
style =
|
|
46
|
-
|
|
47
|
-
size =
|
|
48
|
-
type =
|
|
49
|
-
formItemGroup =
|
|
50
|
-
title =
|
|
51
|
-
visible =
|
|
52
|
-
open =
|
|
53
|
-
formPrefix =
|
|
54
|
-
formPostfix =
|
|
55
|
-
initialValues =
|
|
56
|
-
hideRequiredMark =
|
|
57
|
-
bodyStyle =
|
|
58
|
-
footer =
|
|
59
|
-
footerButtonGroup =
|
|
60
|
-
hideFooter =
|
|
61
|
-
_getFormFields =
|
|
62
|
-
|
|
63
|
-
fieldStatus =
|
|
64
|
-
|
|
65
|
-
formLayout =
|
|
66
|
-
tabsConfig =
|
|
67
|
-
stepsConfig =
|
|
68
|
-
displayLayout =
|
|
69
|
-
|
|
70
|
-
dragAble =
|
|
71
|
-
|
|
72
|
-
itemGroupConfig =
|
|
73
|
-
otherProps = _objectWithoutProperties(
|
|
42
|
+
var ConcatModalProps = _objectSpread(_objectSpread({}, providerConfig), props);
|
|
43
|
+
var children = ConcatModalProps.children,
|
|
44
|
+
className = ConcatModalProps.className,
|
|
45
|
+
style = ConcatModalProps.style,
|
|
46
|
+
_ConcatModalProps$siz = ConcatModalProps.size,
|
|
47
|
+
size = _ConcatModalProps$siz === void 0 ? 'md' : _ConcatModalProps$siz,
|
|
48
|
+
type = ConcatModalProps.type,
|
|
49
|
+
formItemGroup = ConcatModalProps.formItemGroup,
|
|
50
|
+
title = ConcatModalProps.title,
|
|
51
|
+
visible = ConcatModalProps.visible,
|
|
52
|
+
open = ConcatModalProps.open,
|
|
53
|
+
formPrefix = ConcatModalProps.formPrefix,
|
|
54
|
+
formPostfix = ConcatModalProps.formPostfix,
|
|
55
|
+
initialValues = ConcatModalProps.initialValues,
|
|
56
|
+
hideRequiredMark = ConcatModalProps.hideRequiredMark,
|
|
57
|
+
bodyStyle = ConcatModalProps.bodyStyle,
|
|
58
|
+
footer = ConcatModalProps.footer,
|
|
59
|
+
footerButtonGroup = ConcatModalProps.footerButtonGroup,
|
|
60
|
+
hideFooter = ConcatModalProps.hideFooter,
|
|
61
|
+
_getFormFields = ConcatModalProps.getFormFields,
|
|
62
|
+
_ConcatModalProps$fie = ConcatModalProps.fieldStatus,
|
|
63
|
+
fieldStatus = _ConcatModalProps$fie === void 0 ? 'default' : _ConcatModalProps$fie,
|
|
64
|
+
_ConcatModalProps$for = ConcatModalProps.formLayout,
|
|
65
|
+
formLayout = _ConcatModalProps$for === void 0 ? 'horizontal' : _ConcatModalProps$for,
|
|
66
|
+
tabsConfig = ConcatModalProps.tabsConfig,
|
|
67
|
+
stepsConfig = ConcatModalProps.stepsConfig,
|
|
68
|
+
displayLayout = ConcatModalProps.displayLayout,
|
|
69
|
+
_ConcatModalProps$dra = ConcatModalProps.dragAble,
|
|
70
|
+
dragAble = _ConcatModalProps$dra === void 0 ? false : _ConcatModalProps$dra,
|
|
71
|
+
_ConcatModalProps$ite = ConcatModalProps.itemGroupConfig,
|
|
72
|
+
itemGroupConfig = _ConcatModalProps$ite === void 0 ? {} : _ConcatModalProps$ite,
|
|
73
|
+
otherProps = _objectWithoutProperties(ConcatModalProps, _excluded);
|
|
74
74
|
var _Form$useForm = Form.useForm(),
|
|
75
75
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
76
76
|
modalForm = _Form$useForm2[0];
|
|
@@ -113,7 +113,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
113
113
|
return false;
|
|
114
114
|
}
|
|
115
115
|
if (fieldStatus && fieldStatus !== 'default') {
|
|
116
|
-
if (
|
|
116
|
+
if (ConcatModalProps.hasOwnProperty('footerButtonGroup')) {
|
|
117
117
|
// 如果有配置按钮组件,则还是要显示按钮
|
|
118
118
|
return true;
|
|
119
119
|
}
|
|
@@ -121,7 +121,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
121
121
|
// disabled/viewOnly都不显示按钮
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
124
|
+
if (ConcatModalProps.hasOwnProperty('footerButtonGroup') && footerButtonGroup) {
|
|
125
125
|
var _footerButtonGroup;
|
|
126
126
|
if (Array.isArray(footerButtonGroup) && footerButtonGroup.length === 0) {
|
|
127
127
|
openLog && console.log('rule 4');
|
|
@@ -139,7 +139,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
139
139
|
// 显示
|
|
140
140
|
return true;
|
|
141
141
|
}
|
|
142
|
-
if (
|
|
142
|
+
if (ConcatModalProps.hasOwnProperty('footer') && !footer) {
|
|
143
143
|
openLog && console.log('rule 8');
|
|
144
144
|
return false;
|
|
145
145
|
}
|
|
@@ -149,7 +149,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
149
149
|
}, [fieldStatus, hideFooter, footer, footerButtonGroup, type, tabsConfig, stepsConfig, formItemGroup]);
|
|
150
150
|
// 设置限制弹窗高度
|
|
151
151
|
var initBodyMaxHeight = function initBodyMaxHeight() {
|
|
152
|
-
var title =
|
|
152
|
+
var title = ConcatModalProps.title;
|
|
153
153
|
// 最大高度基础值调整成页面视口高度
|
|
154
154
|
var bodyHeight = document.documentElement.clientHeight; // document.body.offsetHeight
|
|
155
155
|
var baseReduce = 80 + 32 + 16; // 默认需要减去的高度(上下空白间距150及内部内容间距16*2
|
|
@@ -181,9 +181,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
181
181
|
}
|
|
182
182
|
}, [fieldStatus, title, visible, hideFooter, footer, footerButtonGroup]);
|
|
183
183
|
var handleSubmit = function handleSubmit() {
|
|
184
|
-
var type =
|
|
185
|
-
formItemGroup =
|
|
186
|
-
onSubmit =
|
|
184
|
+
var type = ConcatModalProps.type,
|
|
185
|
+
formItemGroup = ConcatModalProps.formItemGroup,
|
|
186
|
+
onSubmit = ConcatModalProps.onSubmit;
|
|
187
187
|
if (type === 'form' || type === 'gridForm') {
|
|
188
188
|
modalForm.validateFields().then(function (values) {
|
|
189
189
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
@@ -234,12 +234,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
234
234
|
modalForm.resetFields(); // 直接使用这个无效
|
|
235
235
|
};
|
|
236
236
|
var onAfterClose = function onAfterClose() {
|
|
237
|
-
var afterClose =
|
|
237
|
+
var afterClose = ConcatModalProps.afterClose;
|
|
238
238
|
if (type === 'form') clearAllFieldsValue();
|
|
239
239
|
if (afterClose) afterClose();
|
|
240
240
|
};
|
|
241
241
|
var handleCancel = function handleCancel() {
|
|
242
|
-
var onCancel =
|
|
242
|
+
var onCancel = ConcatModalProps.onCancel;
|
|
243
243
|
if (onCancel) onCancel();
|
|
244
244
|
};
|
|
245
245
|
|
|
@@ -248,11 +248,11 @@ var StandardModal = function StandardModal(props) {
|
|
|
248
248
|
_getFormFields && _getFormFields(modalForm.getFieldsValue() || {}, modalForm);
|
|
249
249
|
};
|
|
250
250
|
var renderFormItemGroup = function renderFormItemGroup() {
|
|
251
|
-
var fieldStatus =
|
|
252
|
-
formItemGroup =
|
|
253
|
-
|
|
254
|
-
size =
|
|
255
|
-
type =
|
|
251
|
+
var fieldStatus = ConcatModalProps.fieldStatus,
|
|
252
|
+
formItemGroup = ConcatModalProps.formItemGroup,
|
|
253
|
+
_ConcatModalProps$siz2 = ConcatModalProps.size,
|
|
254
|
+
size = _ConcatModalProps$siz2 === void 0 ? 'md' : _ConcatModalProps$siz2,
|
|
255
|
+
type = ConcatModalProps.type;
|
|
256
256
|
if (Array.isArray(formItemGroup)) {
|
|
257
257
|
if (type === 'gridForm') {
|
|
258
258
|
// 栅格组
|
|
@@ -330,14 +330,14 @@ var StandardModal = function StandardModal(props) {
|
|
|
330
330
|
}
|
|
331
331
|
};
|
|
332
332
|
var renderButtonGroup = function renderButtonGroup() {
|
|
333
|
-
var footerButtonGroup =
|
|
334
|
-
confirmLoading =
|
|
335
|
-
cancelText =
|
|
336
|
-
confirmText =
|
|
337
|
-
okText =
|
|
338
|
-
okButtonProps =
|
|
339
|
-
confirmButtonProps =
|
|
340
|
-
cancelButtonProps =
|
|
333
|
+
var footerButtonGroup = ConcatModalProps.footerButtonGroup,
|
|
334
|
+
confirmLoading = ConcatModalProps.confirmLoading,
|
|
335
|
+
cancelText = ConcatModalProps.cancelText,
|
|
336
|
+
confirmText = ConcatModalProps.confirmText,
|
|
337
|
+
okText = ConcatModalProps.okText,
|
|
338
|
+
okButtonProps = ConcatModalProps.okButtonProps,
|
|
339
|
+
confirmButtonProps = ConcatModalProps.confirmButtonProps,
|
|
340
|
+
cancelButtonProps = ConcatModalProps.cancelButtonProps;
|
|
341
341
|
if (footerButtonGroup) {
|
|
342
342
|
if (Array.isArray(footerButtonGroup)) {
|
|
343
343
|
if (footerButtonGroup.length === 0) return null; // <div>按钮组合配置为空</div>
|
|
@@ -362,7 +362,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
362
362
|
disabled: disabled,
|
|
363
363
|
loading: loading,
|
|
364
364
|
onClick: fn ? function (e) {
|
|
365
|
-
return fn(item, modalForm,
|
|
365
|
+
return fn(item, modalForm, ConcatModalProps, e);
|
|
366
366
|
} : null
|
|
367
367
|
}, others), name);
|
|
368
368
|
} else {
|
|
@@ -371,7 +371,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
371
371
|
}));
|
|
372
372
|
}
|
|
373
373
|
if (typeof footerButtonGroup === 'function') {
|
|
374
|
-
return footerButtonGroup(modalForm,
|
|
374
|
+
return footerButtonGroup(modalForm, ConcatModalProps);
|
|
375
375
|
}
|
|
376
376
|
return footerButtonGroup;
|
|
377
377
|
}
|
|
@@ -397,7 +397,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
397
397
|
list: currentStepInfo.actions || [],
|
|
398
398
|
onStep: handleStepType,
|
|
399
399
|
form: formChild,
|
|
400
|
-
other:
|
|
400
|
+
other: ConcatModalProps
|
|
401
401
|
}) : null;
|
|
402
402
|
}
|
|
403
403
|
if (type === 'tabForm') {
|
|
@@ -408,7 +408,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
408
408
|
return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action3 = activeTabInfo.actions) === null || _activeTabInfo$action3 === void 0 ? void 0 : _activeTabInfo$action3.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
|
|
409
409
|
list: (activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) || [],
|
|
410
410
|
form: formChild,
|
|
411
|
-
other:
|
|
411
|
+
other: ConcatModalProps
|
|
412
412
|
}) : null;
|
|
413
413
|
}
|
|
414
414
|
return hasFooterBar ? renderButtonGroup() : null;
|
|
@@ -429,7 +429,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
429
429
|
,
|
|
430
430
|
scrollToFirstError: true,
|
|
431
431
|
className: "modalForm"
|
|
432
|
-
}, formPrefix && /*#__PURE__*/React.createElement(Row, null, formPrefix(modalForm,
|
|
432
|
+
}, formPrefix && /*#__PURE__*/React.createElement(Row, null, formPrefix(modalForm, ConcatModalProps, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/React.createElement(Row, null, formPostfix(modalForm, ConcatModalProps, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/React.createElement(TabForm, {
|
|
433
433
|
grid: size,
|
|
434
434
|
layout: formLayout,
|
|
435
435
|
fieldStatus: fieldStatus,
|
|
@@ -501,7 +501,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
501
501
|
styles: {
|
|
502
502
|
body: _objectSpread({
|
|
503
503
|
maxHeight: bodyMaxHeight,
|
|
504
|
-
|
|
504
|
+
overflowX: 'hidden',
|
|
505
505
|
overflowY: 'scroll'
|
|
506
506
|
}, bodyStyle)
|
|
507
507
|
},
|
|
@@ -14,14 +14,16 @@ var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
|
14
14
|
};
|
|
15
15
|
return createStyleHook(prefix, function (token) {
|
|
16
16
|
var prefixCls = ".".concat(prefix);
|
|
17
|
-
return [_defineProperty(_defineProperty(_defineProperty({}, prefixCls, {
|
|
17
|
+
return [_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, {
|
|
18
18
|
'.ant-modal-body ': _objectSpread(_objectSpread({}, scrollBar(token)), {}, {
|
|
19
|
-
padding: "".concat(token.paddingXS, "px 0")
|
|
19
|
+
padding: "".concat(token.paddingXS, "px 0"),
|
|
20
|
+
marginRight: "-".concat(token.marginXS, "px")
|
|
21
|
+
// padding: `${token.paddingXS}px ${token.paddingMD}px ${token.paddingXS}px 0 `,
|
|
20
22
|
}),
|
|
21
23
|
'&.ant-modal .ant-modal-footer .ant-btn + .ant-btn': {
|
|
22
24
|
marginInlineStart: token.marginXS
|
|
23
25
|
},
|
|
24
|
-
'.
|
|
26
|
+
'.spec-standard-form': {
|
|
25
27
|
'&.ant-form-horizontal .ant-form-item-label': {
|
|
26
28
|
'> label': {
|
|
27
29
|
minHeight: token.controlHeight + 'px'
|
|
@@ -40,7 +42,9 @@ var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
|
40
42
|
'&:before': {
|
|
41
43
|
borderLeft: " 4px solid ".concat(token.colorPrimary)
|
|
42
44
|
}
|
|
43
|
-
}), '.modalPanelTitle, .modal-grid-title', {
|
|
45
|
+
}), '.modalPanelTitle', {}), '.modalPanelTitle, .modal-grid-title', {
|
|
46
|
+
height: token.controlHeight + 'px',
|
|
47
|
+
lineHeight: token.controlHeight + 'px',
|
|
44
48
|
margin: "0 0 ".concat(token.margin, "px 0"),
|
|
45
49
|
paddingBottom: token.paddingXS,
|
|
46
50
|
borderBottom: "1px solid ".concat(token.colorBorder)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
white-space: inherit;
|
|
21
21
|
> label {
|
|
22
22
|
//min-height: @input-height-base;
|
|
23
|
-
height: auto;
|
|
23
|
+
//height: auto;
|
|
24
24
|
&.ant-form-item-required::before {
|
|
25
25
|
margin-right: 2px;
|
|
26
26
|
}
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.modalPanelTitle {
|
|
33
|
-
height: 32px;
|
|
33
|
+
//height: 32px;
|
|
34
34
|
//margin: 0 0 @padding-md 0;
|
|
35
35
|
//padding-bottom: @padding-xs;
|
|
36
36
|
//color: @text-color;
|
|
37
37
|
//font-size: @font-size-base + 1;
|
|
38
38
|
font-weight: bold;
|
|
39
|
-
line-height: 32px;
|
|
39
|
+
//line-height: 32px;
|
|
40
40
|
//border-bottom: 1px solid @border-color-base;
|
|
41
41
|
}
|
|
42
42
|
.ant-form-item.form-item-view-only {
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
}
|
|
51
51
|
.modalGridTitle,
|
|
52
52
|
.modal-grid-title{
|
|
53
|
-
height: 32px;
|
|
53
|
+
//height: 32px;
|
|
54
54
|
//margin: 0 0 @padding-md 0;
|
|
55
55
|
//padding-bottom: @padding-xs;
|
|
56
56
|
//padding-left: @padding-xs;
|
|
57
57
|
//color: @text-color;
|
|
58
58
|
//font-size: @font-size-base + 1;
|
|
59
59
|
//font-weight: bold;
|
|
60
|
-
line-height: 32px;
|
|
60
|
+
//line-height: 32px;
|
|
61
61
|
position: relative;
|
|
62
62
|
&.modalPanelTitle {
|
|
63
63
|
border-bottom: 0;
|
|
@@ -26,7 +26,8 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
26
26
|
cateConfig = props.cateConfig,
|
|
27
27
|
buttonConfig = props.buttonConfig,
|
|
28
28
|
type = props.type,
|
|
29
|
-
postfix = props.postfix
|
|
29
|
+
postfix = props.postfix,
|
|
30
|
+
bodyStyle = props.bodyStyle;
|
|
30
31
|
var componentName = 'spec-panel';
|
|
31
32
|
var _useStyle = useStyle(componentName),
|
|
32
33
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -68,10 +69,10 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
68
69
|
|
|
69
70
|
// 是否显示提示框
|
|
70
71
|
var popoverShow = function popoverShow() {
|
|
71
|
-
return title.content ? /*#__PURE__*/React.createElement(Popover, {
|
|
72
|
+
return title !== null && title !== void 0 && title.content ? /*#__PURE__*/React.createElement(Popover, {
|
|
72
73
|
content: title.content,
|
|
73
|
-
placement: title.placement
|
|
74
|
-
}, " ", title.label, " ") : title;
|
|
74
|
+
placement: title === null || title === void 0 ? void 0 : title.placement
|
|
75
|
+
}, " ", title === null || title === void 0 ? void 0 : title.label, " ") : title;
|
|
75
76
|
};
|
|
76
77
|
var panelHeaderRef = useRef();
|
|
77
78
|
var bodyLimitStyle = useMemo(function () {
|
|
@@ -93,7 +94,7 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
93
94
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
94
95
|
height: "".concat(height, "px")
|
|
95
96
|
})
|
|
96
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
97
98
|
className: "spec-panel-header",
|
|
98
99
|
ref: panelHeaderRef
|
|
99
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -121,9 +122,9 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
121
122
|
className: "spec-panel-buttons"
|
|
122
123
|
}, buttonConfig)), postfix && /*#__PURE__*/React.createElement("div", {
|
|
123
124
|
className: "spec-panel-extra"
|
|
124
|
-
}, postfix)), /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
}, postfix)) : null, /*#__PURE__*/React.createElement("div", {
|
|
125
126
|
className: "spec-panel-body",
|
|
126
|
-
style: _objectSpread({}, bodyLimitStyle)
|
|
127
|
+
style: _objectSpread(_objectSpread({}, bodyLimitStyle), bodyStyle || {})
|
|
127
128
|
}, children)));
|
|
128
129
|
};
|
|
129
130
|
export default StandardPanel;
|
|
@@ -23,6 +23,8 @@ var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
|
23
23
|
'.spec-panel-header ': {
|
|
24
24
|
padding: " ".concat(token.paddingSM, "px ").concat(token.paddingMD, "px"),
|
|
25
25
|
background: token.headerBg,
|
|
26
|
+
borderTopRightRadius: token.borderRadius,
|
|
27
|
+
borderTopLeftRadius: token.borderRadius,
|
|
26
28
|
'.spec-panel-title ': {
|
|
27
29
|
paddingRight: token.paddingMD
|
|
28
30
|
},
|
|
@@ -57,17 +59,22 @@ var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
|
57
59
|
'.anticon, .specfont, .specicon': {
|
|
58
60
|
marginLeft: token.marginSM
|
|
59
61
|
}
|
|
62
|
+
},
|
|
63
|
+
'+ .spec-panel-body ': {
|
|
64
|
+
paddingTop: 0
|
|
60
65
|
}
|
|
61
66
|
},
|
|
62
67
|
'.spec-panel-body': _objectSpread({
|
|
63
|
-
padding: "
|
|
68
|
+
padding: "".concat(token.padding, "px ").concat(token.paddingMD, "px ").concat(token.paddingMD, "px"),
|
|
69
|
+
borderBottomRightRadius: token.borderRadius,
|
|
70
|
+
borderBottomLeftRadius: token.borderRadius
|
|
64
71
|
}, scrollBar(token)),
|
|
65
72
|
'&.spec-panel-border': {
|
|
66
73
|
' .spec-panel-body': {
|
|
67
74
|
padding: token.paddingMD
|
|
68
75
|
}
|
|
69
76
|
},
|
|
70
|
-
'
|
|
77
|
+
'&.spec-panel-reverse': {
|
|
71
78
|
'.spec-panel-header ': {
|
|
72
79
|
padding: "0 ".concat(token.paddingMD, "px"),
|
|
73
80
|
background: token.headerBg
|
|
@@ -102,9 +102,9 @@ var StandardTable = function StandardTable(props) {
|
|
|
102
102
|
if (typeof buttonGroup === 'function') recombinationGroup = buttonGroup(text, record, rowIndex); // 方法返回数组结构
|
|
103
103
|
// 判断是否是数组且长度大于0时 ?{如下结构渲染} : {按buttonGroup返回的node渲染}
|
|
104
104
|
if (Array.isArray(buttonGroup) || typeof buttonGroup === 'function') {
|
|
105
|
-
var _colItem4, _colItem5;
|
|
105
|
+
var _colItem4, _colItem5, _colItem6;
|
|
106
106
|
if (recombinationGroup.length === 0) return '-';
|
|
107
|
-
return /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
107
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, _extends({
|
|
108
108
|
type: "text",
|
|
109
109
|
min: colItem.min || 2 // 配置按钮展示最少数量,其他的将会被折叠
|
|
110
110
|
,
|
|
@@ -115,11 +115,12 @@ var StandardTable = function StandardTable(props) {
|
|
|
115
115
|
text: text,
|
|
116
116
|
record: record,
|
|
117
117
|
rowIndex: rowIndex
|
|
118
|
-
}
|
|
119
|
-
dropdownConfig
|
|
118
|
+
}
|
|
119
|
+
// dropdownConfig={colItem.buttonGroupConfig || {}}
|
|
120
|
+
,
|
|
120
121
|
moreText: (_colItem4 = colItem) === null || _colItem4 === void 0 ? void 0 : _colItem4.moreText,
|
|
121
122
|
moreIcon: (_colItem5 = colItem) === null || _colItem5 === void 0 ? void 0 : _colItem5.moreIcon
|
|
122
|
-
});
|
|
123
|
+
}, ((_colItem6 = colItem) === null || _colItem6 === void 0 ? void 0 : _colItem6.buttonGroupConfig) || {}));
|
|
123
124
|
} else {
|
|
124
125
|
return buttonGroup;
|
|
125
126
|
}
|
|
@@ -148,13 +149,12 @@ var StandardTable = function StandardTable(props) {
|
|
|
148
149
|
batchButtonGroup = exProps.batchButtonGroup;
|
|
149
150
|
// 只有配置rowSelection才显示对应的批量按钮组
|
|
150
151
|
var list = _.unionBy(rowSelection && (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) !== 'radio' && (batchButtonGroup || []), buttonGroup || []);
|
|
151
|
-
return /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
152
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, _extends({
|
|
152
153
|
options: list,
|
|
153
154
|
min: min,
|
|
154
155
|
codes: codes,
|
|
155
|
-
permissionCodes: permissionCodes
|
|
156
|
-
|
|
157
|
-
});
|
|
156
|
+
permissionCodes: permissionCodes
|
|
157
|
+
}, buttonGroupConfig));
|
|
158
158
|
};
|
|
159
159
|
return wrapSSR( /*#__PURE__*/React.createElement(Card, {
|
|
160
160
|
className: classNames(componentName, 'standard-table', className, hashId),
|
|
@@ -78,7 +78,7 @@ var StandardTableStyleFunc = function StandardTableStyleFunc(prefix) {
|
|
|
78
78
|
'table': {
|
|
79
79
|
fontSize: token.fontSize,
|
|
80
80
|
'> .ant-table-thead > tr > th': {
|
|
81
|
-
fontSize: token.
|
|
81
|
+
fontSize: token.fontSize
|
|
82
82
|
},
|
|
83
83
|
'.ant-table-thead > tr > th': {
|
|
84
84
|
padding: "12px ".concat(token.paddingMD, "px"),
|
|
@@ -13,21 +13,24 @@ import React from "react";
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
var IconNode = function IconNode(props) {
|
|
16
|
-
var icon = props.icon
|
|
16
|
+
var icon = props.icon,
|
|
17
|
+
style = props.style;
|
|
17
18
|
if (!icon) return null;
|
|
18
19
|
if (typeof icon === 'string') {
|
|
19
20
|
var iconArr = icon.split(',');
|
|
20
21
|
return /*#__PURE__*/React.createElement(SpecIcon, {
|
|
21
22
|
prefix: iconArr.length > 1 ? iconArr[0] : 'speci',
|
|
22
23
|
noPrefix: !iconArr[0] || iconArr[0] === 'noPrefix',
|
|
23
|
-
name: iconArr.length > 1 ? iconArr[1] : icon
|
|
24
|
+
name: iconArr.length > 1 ? iconArr[1] : icon,
|
|
25
|
+
style: style
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
28
|
if (Array.isArray(icon) && icon.length > 1) {
|
|
27
29
|
// @ts-ignore
|
|
28
30
|
return /*#__PURE__*/React.createElement(SpecIcon, {
|
|
29
31
|
prefix: icon[0],
|
|
30
|
-
name: icon[1]
|
|
32
|
+
name: icon[1],
|
|
33
|
+
style: style
|
|
31
34
|
}); // 预留 Array ['speci','plus']
|
|
32
35
|
}
|
|
33
36
|
return /*#__PURE__*/React.createElement(React.Fragment, null, icon);
|
package/es/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { default as StandardFilter } from './StandardFilter/';
|
|
|
15
15
|
export { default as StandardModal } from './StandardModal';
|
|
16
16
|
export { default as StandardDragModal } from './StandardDragModal/Modal';
|
|
17
17
|
export { default as Uploader } from './FormComp/Uploader';
|
|
18
|
+
export { default as VarTemplate } from './FormComp/VarTemplate';
|
|
18
19
|
export { default as EditButton } from './FormComp/EditButton';
|
|
19
20
|
export { default as FieldComponent } from './FormComp/FieldComponent';
|
|
20
21
|
export { default as Field } from './FormComp/FieldComponent';
|
package/es/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export { default as StandardFilter } from "./StandardFilter/";
|
|
|
20
20
|
export { default as StandardModal } from "./StandardModal";
|
|
21
21
|
export { default as StandardDragModal } from "./StandardDragModal/Modal";
|
|
22
22
|
export { default as Uploader } from "./FormComp/Uploader";
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export { default as VarTemplate } from "./FormComp/VarTemplate";
|
|
23
25
|
export { default as EditButton } from "./FormComp/EditButton";
|
|
24
26
|
// 基础控件
|
|
25
27
|
export { default as FieldComponent } from "./FormComp/FieldComponent";
|
package/es/theme/index.js
CHANGED
|
@@ -7,8 +7,8 @@ export var scrollBar = function scrollBar(token) {
|
|
|
7
7
|
return _defineProperty(_defineProperty(_defineProperty({}, '&::-webkit-scrollbar-track-piece', {
|
|
8
8
|
background: new TinyColor('#c1c1c1').setAlpha(0.02).toRgbString() // new TinyColor(token.colorPrimary).setAlpha(0.1)
|
|
9
9
|
}), '&::-webkit-scrollbar', {
|
|
10
|
-
width: '
|
|
11
|
-
height: '
|
|
10
|
+
width: '8px',
|
|
11
|
+
height: '8px'
|
|
12
12
|
}), '&::-webkit-scrollbar-thumb', {
|
|
13
13
|
background: new TinyColor('#c1c1c1').setAlpha(0.5).toRgbString(),
|
|
14
14
|
// new TinyColor(token.colorPrimary).setAlpha(0.5),
|
|
@@ -19,8 +19,8 @@ export var scrollBarPrimary = function scrollBarPrimary(token) {
|
|
|
19
19
|
return _defineProperty(_defineProperty(_defineProperty({}, '&::-webkit-scrollbar-track-piece', {
|
|
20
20
|
background: new TinyColor(token.colorPrimary).setAlpha(0.1).toRgbString() // new TinyColor(token.colorPrimary).setAlpha(0.1)
|
|
21
21
|
}), '&::-webkit-scrollbar', {
|
|
22
|
-
width: '
|
|
23
|
-
height: '
|
|
22
|
+
width: '8px',
|
|
23
|
+
height: '8px'
|
|
24
24
|
}), '&::-webkit-scrollbar-thumb', {
|
|
25
25
|
background: new TinyColor(token.colorPrimary).setAlpha(0.5).toRgbString(),
|
|
26
26
|
// new TinyColor(token.colorPrimary).setAlpha(0.5),
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/index.js
CHANGED