@teamix/pro 1.5.16 → 1.5.18-beta
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/fonts/txddinmedium.woff +0 -0
- package/dist/pro.all.min.css +1 -0
- package/dist/pro.css +1 -0
- package/dist/pro.js +114772 -0
- package/dist/pro.min.css +1 -0
- package/dist/pro.min.js +2 -0
- package/dist/pro.min.js.LICENSE.txt +47 -0
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/dialog-component.js +1 -4
- package/es/actions/dialog-form.js +4 -3
- package/es/actions/dialog.js +2 -1
- package/es/actions/index.js +35 -22
- package/es/actions/quick.js +1 -4
- package/es/card/card-container.js +12 -5
- package/es/card/divider.js +2 -4
- package/es/card/index.js +18 -7
- package/es/card/selectable.js +2 -4
- package/es/card/tab.js +2 -4
- package/es/form/Components/Editable/index.js +1 -1
- package/es/form/Components/FormGroup/index.js +4 -3
- package/es/form/Components/LightFilter/index.js +11 -2
- package/es/form/Components/ProField/index.js +2 -4
- package/es/form/Components/Text/index.js +2 -4
- package/es/form/Filter/AdvancedFilter.js +16 -14
- package/es/form/Filter/LightFilter.js +13 -9
- package/es/form/Filter/SimpleFilter.js +8 -5
- package/es/form/Filter/index.js +24 -7
- package/es/form/Filter/index.scss +1 -0
- package/es/form/Filter/index2.js +22 -17
- package/es/form/Filter/index2.scss +1 -0
- package/es/form/Filter/useBindUrl.js +3 -0
- package/es/form/Filter/useSpecialProps.js +1 -0
- package/es/form/ProForm/index.js +5 -2
- package/es/form/ProForm/useAutoLayout.js +4 -0
- package/es/form/ProForm/useFormDisplayValues.js +1 -0
- package/es/form/SchemaForm/adapterComponent.js +1 -0
- package/es/form/SchemaForm/adapterDecorator.js +1 -0
- package/es/form/SchemaForm/adapterType.js +1 -0
- package/es/form/SchemaForm/index.js +13 -0
- package/es/form/SchemaForm/initializeFormButton.js +2 -0
- package/es/form/SchemaForm/initializeReactions.js +1 -0
- package/es/form/SchemaForm/initializeSelectTable.js +1 -0
- package/es/form/SchemaForm/reactions.js +5 -0
- package/es/form/index.js +4 -0
- package/es/form/utils.js +12 -0
- package/es/form/warning.js +2 -0
- package/es/index.js +3 -1
- package/es/info/components/InfoGroup/index.js +2 -4
- package/es/info/components/InfoValueItem/index.js +32 -20
- package/es/info/components/ProInfoItem/index.js +1 -0
- package/es/info/components/baseInfo/index.js +3 -0
- package/es/info/components/tableInfo/index.js +6 -4
- package/es/info/index.js +11 -5
- package/es/info/utils/index.js +3 -0
- package/es/layout/index.js +2 -0
- package/es/nocode/index.js +2 -0
- package/es/nocode/pages/index.js +3 -0
- package/es/nocode/pages/playground.js +3 -5
- package/es/nocode/pages/renderer.js +4 -6
- package/es/nocode/playground.js +2 -4
- package/es/page-header/index.js +12 -7
- package/es/sidebar/components/sidebar-container/index.js +10 -7
- package/es/sidebar/components/tree/index.js +22 -4
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +3 -4
- package/es/sidebar/components/tree-node/components/IconAction/index.js +4 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +1 -0
- package/es/sidebar/components/tree-node/index.js +29 -16
- package/es/sidebar/index.js +15 -4
- package/es/sidebar/utils/index.js +19 -11
- package/es/table/components/CardView/index.js +29 -13
- package/es/table/components/Filter/index.js +11 -0
- package/es/table/components/Layout/index.js +13 -8
- package/es/table/components/LoadMore/index.js +3 -0
- package/es/table/components/Pagination/index.js +12 -10
- package/es/table/components/QuickAction/index.js +3 -2
- package/es/table/components/ToolBar/CardSwitch.js +2 -0
- package/es/table/components/ToolBar/DensityIcon.js +7 -2
- package/es/table/components/ToolBar/FilterColumnIcon.js +9 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +1 -0
- package/es/table/components/ToolBar/Fullscreen.js +3 -0
- package/es/table/components/ToolBar/RefreshIcon.js +11 -0
- package/es/table/components/ToolBar/index.js +13 -10
- package/es/table/index.js +138 -51
- package/es/table/index.scss +26 -0
- package/es/table/utils/columnRender.js +78 -27
- package/es/table/utils/genAutoWidthColumns.js +340 -0
- package/es/table/utils/index.js +6 -0
- package/es/table/utils/pureColumnRender.js +9 -1
- package/es/templates/List/index.js +4 -6
- package/es/templates/index.js +2 -1
- package/es/timeline/ProTimeLineItem/index.js +8 -4
- package/es/timeline/index.js +5 -5
- package/es/utils/message.js +3 -5
- package/es/xconsole.scss +23 -0
- package/lib/form/Filter/index.scss +1 -0
- package/lib/form/Filter/index2.scss +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/CardView/index.js +5 -10
- package/lib/table/components/ToolBar/index.js +10 -7
- package/lib/table/index.js +72 -25
- package/lib/table/index.scss +26 -0
- package/lib/table/typing.d.ts +11 -1
- package/lib/table/utils/columnRender.d.ts +1 -0
- package/lib/table/utils/columnRender.js +51 -4
- package/lib/table/utils/genAutoWidthColumns.d.ts +35 -0
- package/lib/table/utils/genAutoWidthColumns.js +345 -0
- package/lib/xconsole.scss +23 -0
- package/package.json +1 -1
- package/es/actions/base.d.ts +0 -24
- package/es/actions/confirm.d.ts +0 -7
- package/es/actions/danger-confirm.d.ts +0 -7
- package/es/actions/danger-pop-confirm.d.ts +0 -5
- package/es/actions/dialog-component.d.ts +0 -10
- package/es/actions/dialog-form.d.ts +0 -29
- package/es/actions/dialog-info.d.ts +0 -9
- package/es/actions/dialog-table.d.ts +0 -9
- package/es/actions/dialog.d.ts +0 -40
- package/es/actions/drawer-form.d.ts +0 -6
- package/es/actions/drawer-info.d.ts +0 -6
- package/es/actions/drawer-table.d.ts +0 -6
- package/es/actions/drawer.d.ts +0 -6
- package/es/actions/error.d.ts +0 -7
- package/es/actions/index.d.ts +0 -114
- package/es/actions/link.d.ts +0 -8
- package/es/actions/notice.d.ts +0 -7
- package/es/actions/pop-confirm.d.ts +0 -9
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/request.d.ts +0 -9
- package/es/actions/utils.d.ts +0 -1
- package/es/card/card-container.d.ts +0 -18
- package/es/card/divider.d.ts +0 -6
- package/es/card/index.d.ts +0 -109
- package/es/card/selectable.d.ts +0 -13
- package/es/card/tab.d.ts +0 -6
- package/es/card/utils.d.ts +0 -9
- package/es/field/index.d.ts +0 -3
- package/es/form/Components/Editable/index.d.ts +0 -20
- package/es/form/Components/FormGroup/index.d.ts +0 -14
- package/es/form/Components/LightFilter/componentMap.d.ts +0 -3
- package/es/form/Components/LightFilter/index.d.ts +0 -17
- package/es/form/Components/ProField/index.d.ts +0 -2
- package/es/form/Components/ProField/mapDateFormat.d.ts +0 -3
- package/es/form/Components/Text/index.d.ts +0 -8
- package/es/form/Filter/AdvancedFilter.d.ts +0 -7
- package/es/form/Filter/Layout.d.ts +0 -5
- package/es/form/Filter/LightFilter.d.ts +0 -7
- package/es/form/Filter/SimpleFilter.d.ts +0 -7
- package/es/form/Filter/index.d.ts +0 -9
- package/es/form/Filter/index2.d.ts +0 -13
- package/es/form/Filter/useBindUrl.d.ts +0 -2
- package/es/form/Filter/useSpecialProps.d.ts +0 -6
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/customComponent.d.ts +0 -3
- package/es/form/ProForm/index.d.ts +0 -5
- package/es/form/ProForm/useAutoLayout.d.ts +0 -9
- package/es/form/ProForm/useAutoSubmit.d.ts +0 -6
- package/es/form/ProForm/useFieldRequest.d.ts +0 -5
- package/es/form/ProForm/useFormDisplayValues.d.ts +0 -4
- package/es/form/ProForm/useInitialRequest.d.ts +0 -6
- package/es/form/SchemaForm/adapterComponent.d.ts +0 -5
- package/es/form/SchemaForm/adapterDecorator.d.ts +0 -6
- package/es/form/SchemaForm/adapterType.d.ts +0 -5
- package/es/form/SchemaForm/index.d.ts +0 -4
- package/es/form/SchemaForm/initializeArrayCards.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayItems.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayTable.d.ts +0 -3
- package/es/form/SchemaForm/initializeDataSource.d.ts +0 -15
- package/es/form/SchemaForm/initializeFormButton.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormGroup.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormStep.d.ts +0 -5
- package/es/form/SchemaForm/initializeFormTab.d.ts +0 -3
- package/es/form/SchemaForm/initializeReactions.d.ts +0 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +0 -11
- package/es/form/SchemaForm/initializeRules.d.ts +0 -11
- package/es/form/SchemaForm/initializeSelectTable.d.ts +0 -3
- package/es/form/SchemaForm/reactions.d.ts +0 -6
- package/es/form/docs/ActionResponse.d.ts +0 -8
- package/es/form/fieldTypeMap.d.ts +0 -7
- package/es/form/index.d.ts +0 -125
- package/es/form/locales/validate.d.ts +0 -159
- package/es/form/schemaNameMap.d.ts +0 -5
- package/es/form/typing.d.ts +0 -194
- package/es/form/utils.d.ts +0 -55
- package/es/form/warning.d.ts +0 -3
- package/es/hooks/index.d.ts +0 -2
- package/es/index-without-icon.d.ts +0 -32
- package/es/index.d.ts +0 -32
- package/es/info/components/InfoGroup/index.d.ts +0 -5
- package/es/info/components/InfoValueItem/index.d.ts +0 -5
- package/es/info/components/ProInfoItem/index.d.ts +0 -5
- package/es/info/components/baseInfo/index.d.ts +0 -8
- package/es/info/components/headerInfo/index.d.ts +0 -8
- package/es/info/components/tableInfo/index.d.ts +0 -7
- package/es/info/index.d.ts +0 -10
- package/es/info/typing.d.ts +0 -220
- package/es/info/utils/index.d.ts +0 -20
- package/es/info/utils/layout.d.ts +0 -2
- package/es/info/utils/utils.d.ts +0 -1
- package/es/layout/index.d.ts +0 -2
- package/es/nocode/configurators/Card.d.ts +0 -3
- package/es/nocode/configurators/PageHeader.d.ts +0 -3
- package/es/nocode/configurators/ProTable.d.ts +0 -3
- package/es/nocode/configurators/common.d.ts +0 -280
- package/es/nocode/configurators/index.d.ts +0 -15
- package/es/nocode/configurators/map.d.ts +0 -2
- package/es/nocode/index.d.ts +0 -8
- package/es/nocode/pages/editor.d.ts +0 -12
- package/es/nocode/pages/index.d.ts +0 -14
- package/es/nocode/pages/playground.d.ts +0 -11
- package/es/nocode/pages/renderer.d.ts +0 -10
- package/es/nocode/playground.d.ts +0 -14
- package/es/page-container/index.d.ts +0 -3
- package/es/page-header/index.d.ts +0 -74
- package/es/sidebar/components/sidebar-container/index.d.ts +0 -5
- package/es/sidebar/components/tree/index.d.ts +0 -6
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +0 -15
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +0 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +0 -23
- package/es/sidebar/components/tree-node/index.d.ts +0 -7
- package/es/sidebar/index.d.ts +0 -9
- package/es/sidebar/typing.d.ts +0 -141
- package/es/sidebar/utils/action-ref.d.ts +0 -3
- package/es/sidebar/utils/index.d.ts +0 -364
- package/es/skeleton/index.d.ts +0 -3
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/EmptyContent/index.d.ts +0 -2
- package/es/table/components/Filter/index.d.ts +0 -12
- package/es/table/components/Layout/index.d.ts +0 -5
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/Pagination/index.d.ts +0 -7
- package/es/table/components/QuickAction/index.d.ts +0 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/DensityIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +0 -4
- package/es/table/components/ToolBar/Fullscreen.d.ts +0 -10
- package/es/table/components/ToolBar/RefreshIcon.d.ts +0 -4
- package/es/table/components/ToolBar/index.d.ts +0 -5
- package/es/table/index.d.ts +0 -5
- package/es/table/typing.d.ts +0 -418
- package/es/table/utils/columnRender.d.ts +0 -13
- package/es/table/utils/genProColumnToColumn.d.ts +0 -13
- package/es/table/utils/getTableProps.d.ts +0 -2
- package/es/table/utils/getTableSortIcons.d.ts +0 -3
- package/es/table/utils/index.d.ts +0 -19
- package/es/table/utils/pureColumnRender.d.ts +0 -9
- package/es/table/utils/pureGenProColumnToColumn.d.ts +0 -7
- package/es/table/utils/useTableSelection.d.ts +0 -3
- package/es/table/utils/util.d.ts +0 -5
- package/es/templates/Detail/index.d.ts +0 -2
- package/es/templates/Form/index.d.ts +0 -2
- package/es/templates/List/index.d.ts +0 -9
- package/es/templates/index.d.ts +0 -3
- package/es/timeline/ProTimeLineItem/index.d.ts +0 -5
- package/es/timeline/index.d.ts +0 -10
- package/es/timeline/typing.d.ts +0 -107
- package/es/utils/index.d.ts +0 -3
- package/es/utils/message.d.ts +0 -3
@@ -1,4 +1,5 @@
|
|
1
1
|
var _excluded = ["schema", "onChange", "onSubmit"];
|
2
|
+
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); }
|
2
3
|
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; }
|
3
4
|
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; }
|
4
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
@@ -29,15 +30,17 @@ var initializeSearch = function initializeSearch(schema) {
|
|
29
30
|
initializedSchema: initializedSchema
|
30
31
|
};
|
31
32
|
};
|
33
|
+
|
32
34
|
/**
|
33
35
|
* 简单筛选
|
34
36
|
*/
|
35
37
|
var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
36
38
|
var searchValue = useRef(undefined);
|
37
|
-
var
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
var _ref = props,
|
40
|
+
schema = _ref.schema,
|
41
|
+
onChange = _ref.onChange,
|
42
|
+
onSubmit = _ref.onSubmit,
|
43
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
41
44
|
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-simple');
|
42
45
|
var _initializeSearch = initializeSearch(schema),
|
43
46
|
searchName = _initializeSearch.searchName,
|
@@ -75,7 +78,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
75
78
|
var searchDefaultValue = (_props$form$initialVa = props.form.initialValues) === null || _props$form$initialVa === void 0 ? void 0 : (_props$form$initialVa2 = _props$form$initialVa[searchName]) === null || _props$form$initialVa2 === void 0 ? void 0 : _props$form$initialVa2[1];
|
76
79
|
searchValue.current = isValid(searchDefaultValue) ? searchDefaultValue : '';
|
77
80
|
}, []);
|
78
|
-
return /*#__PURE__*/React.createElement(ProForm,
|
81
|
+
return /*#__PURE__*/React.createElement(ProForm, _extends({}, otherProps, {
|
79
82
|
className: cls(prefixCls(), props.className),
|
80
83
|
schema: simpleSchema,
|
81
84
|
feedbackLayout: "popover",
|
package/es/form/Filter/index.js
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
2
|
var _excluded = ["addonAfter", "addonBefore", "mode", "purePanel", "expand", "formRef", "defaultFilterValue", "filterValues", "filterDebounce", "bindUrl", "onFilter", "onInit", "onReset", "onExpand", "onChange", "form"];
|
3
|
-
function
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
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); }
|
6
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
7
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
8
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
@@ -84,6 +82,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
84
82
|
onInit = _useBindUrl.onInit,
|
85
83
|
onFilter = _useBindUrl.onFilter,
|
86
84
|
onReset = _useBindUrl.onReset;
|
85
|
+
|
87
86
|
// onInit
|
88
87
|
var initialRequestRef = useRef(!!(props === null || props === void 0 ? void 0 : props.initialRequest));
|
89
88
|
var filterEnable = useRef('waiting');
|
@@ -130,6 +129,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
130
129
|
return _ref.apply(this, arguments);
|
131
130
|
};
|
132
131
|
}();
|
132
|
+
|
133
133
|
// 配置当前激活的form实例
|
134
134
|
var setCurrentForm = function setCurrentForm(formName) {
|
135
135
|
currentFormName.current = formName;
|
@@ -235,6 +235,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
235
235
|
}
|
236
236
|
}
|
237
237
|
};
|
238
|
+
|
238
239
|
// 创建简单筛选表单实例
|
239
240
|
var simpleForm = useMemo(function () {
|
240
241
|
return createForm({
|
@@ -286,6 +287,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
286
287
|
light: lightForm,
|
287
288
|
advanced: advancedForm
|
288
289
|
};
|
290
|
+
|
289
291
|
// 获取筛选数据Label
|
290
292
|
var getFilterDisplayValues = useCallback(function (form) {
|
291
293
|
var displayValues = getFormDisplayValues(form);
|
@@ -320,19 +322,23 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
320
322
|
});
|
321
323
|
return filterData;
|
322
324
|
}, []);
|
325
|
+
|
323
326
|
// 设置筛选数据
|
324
327
|
var configFilterItem = useCallback(function (form) {
|
325
328
|
filterItem.current = getFilterDisplayValues(form);
|
326
329
|
}, []);
|
330
|
+
|
327
331
|
// 设置标签数据
|
328
332
|
var configTag = useCallback(function () {
|
329
333
|
setTagDataSource(filterItem.current);
|
330
334
|
}, []);
|
335
|
+
|
331
336
|
// 更新标签数据
|
332
337
|
var updateTags = useCallback(function (form) {
|
333
338
|
configFilterItem(form);
|
334
339
|
configTag();
|
335
340
|
}, []);
|
341
|
+
|
336
342
|
// 展开收起高级筛选
|
337
343
|
var toggleAdvancedFilter = useCallback(function () {
|
338
344
|
var result = !panelVisible;
|
@@ -350,6 +356,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
350
356
|
setPanelVisible(result);
|
351
357
|
onExpand === null || onExpand === void 0 ? void 0 : onExpand(result);
|
352
358
|
}, [panelVisible, configTag]);
|
359
|
+
|
353
360
|
// 简单搜索Filter
|
354
361
|
var onSimpleFilter = useCallback( /*#__PURE__*/function () {
|
355
362
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(values) {
|
@@ -372,6 +379,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
372
379
|
return _ref7.apply(this, arguments);
|
373
380
|
};
|
374
381
|
}(), [onFilter]);
|
382
|
+
|
375
383
|
// 简单搜索Change
|
376
384
|
var onSimpleChange = useCallback(function (values, fieldValue, fieldName) {
|
377
385
|
if (currentFormName.current === 'simple') {
|
@@ -381,6 +389,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
381
389
|
}
|
382
390
|
}
|
383
391
|
}, [onChange, onSimpleFilter]);
|
392
|
+
|
384
393
|
// 轻量搜索Filter
|
385
394
|
var onLightFilter = useCallback(function (values) {
|
386
395
|
var _Object$keys;
|
@@ -393,6 +402,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
393
402
|
advancedForm.setValues(clearKeys);
|
394
403
|
updateTags(advancedForm);
|
395
404
|
}, [onFilter]);
|
405
|
+
|
396
406
|
// 轻量搜索Change
|
397
407
|
var onLightChange = useCallback(function (values, fieldValue, fieldName) {
|
398
408
|
if (currentFormName.current === 'light') {
|
@@ -402,6 +412,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
402
412
|
}
|
403
413
|
}
|
404
414
|
}, [onChange, onLightFilter]);
|
415
|
+
|
405
416
|
// 高级搜索Filter
|
406
417
|
var onAdvancedFilter = useCallback(function (values) {
|
407
418
|
setCurrentForm('advanced');
|
@@ -412,6 +423,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
412
423
|
forceClear: true
|
413
424
|
});
|
414
425
|
}, [onFilter]);
|
426
|
+
|
415
427
|
// 高级搜索Reset
|
416
428
|
var onAdvancedReset = useCallback(function () {
|
417
429
|
setCurrentForm('advanced');
|
@@ -422,12 +434,14 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
422
434
|
forceClear: true
|
423
435
|
});
|
424
436
|
}, [onReset]);
|
437
|
+
|
425
438
|
// 高级搜索Change
|
426
439
|
var onAdvancedChange = useCallback(function (values, fieldValue, fieldName) {
|
427
440
|
if (currentFormName.current === 'advanced') {
|
428
441
|
onChange === null || onChange === void 0 ? void 0 : onChange(values, fieldValue, fieldName);
|
429
442
|
}
|
430
443
|
}, [onChange]);
|
444
|
+
|
431
445
|
// 关闭标签清空表单字段值
|
432
446
|
var onTagClose = useCallback(function (key, index) {
|
433
447
|
var newValue = undefined;
|
@@ -439,6 +453,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
439
453
|
updateTags(advancedForm);
|
440
454
|
onFilter(toJS(advancedForm.values));
|
441
455
|
}, [onFilter]);
|
456
|
+
|
442
457
|
// initialRequest 的回调
|
443
458
|
var onInitialComplete = useCallback(function (form) {
|
444
459
|
initialRequestRef.current = false;
|
@@ -446,6 +461,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
446
461
|
loading: initialRequestRef.current
|
447
462
|
});
|
448
463
|
}, []);
|
464
|
+
|
449
465
|
// 组件挂载
|
450
466
|
useEffect(function () {
|
451
467
|
setCurrentForm(currentFormName.current);
|
@@ -460,8 +476,9 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
460
476
|
inlineContent: mode === 'panel' ? /*#__PURE__*/React.createElement("div", {
|
461
477
|
className: cls(prefixCls('inline', {
|
462
478
|
'inline-hidden': purePanel || hasRequired
|
463
|
-
})
|
464
|
-
|
479
|
+
}) // hasRequired 为辅助检测
|
480
|
+
)
|
481
|
+
}, /*#__PURE__*/React.createElement(LightFilter, _extends({}, otherProps, {
|
465
482
|
defaultFilterValue: defaultFilterValue,
|
466
483
|
filterValues: filterValues,
|
467
484
|
activeFilterValueRef: activeFilterValueRef,
|
@@ -469,13 +486,13 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
469
486
|
onChange: onLightChange
|
470
487
|
}))) : /*#__PURE__*/React.createElement("div", {
|
471
488
|
className: prefixCls('inline')
|
472
|
-
}, /*#__PURE__*/React.createElement(SimpleFilter,
|
489
|
+
}, /*#__PURE__*/React.createElement(SimpleFilter, _extends({}, otherProps, {
|
473
490
|
form: simpleForm,
|
474
491
|
onChange: onSimpleChange,
|
475
492
|
onSubmit: onSimpleFilter,
|
476
493
|
onInitialComplete: onInitialComplete
|
477
494
|
}))),
|
478
|
-
panelContent: mode === 'panel' ? /*#__PURE__*/React.createElement(AdvancedFilter,
|
495
|
+
panelContent: mode === 'panel' ? /*#__PURE__*/React.createElement(AdvancedFilter, _extends({}, otherProps, {
|
479
496
|
form: advancedForm,
|
480
497
|
onChange: onAdvancedChange,
|
481
498
|
onSubmit: onAdvancedFilter,
|
package/es/form/Filter/index2.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
var _excluded = ["schema", "triggerType", "onFilter"];
|
2
|
+
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); }
|
2
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
3
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
5
|
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); }
|
@@ -30,14 +31,16 @@ var getEventProps = function getEventProps(triggerType, onFilter) {
|
|
30
31
|
};
|
31
32
|
return eventMap[triggerType];
|
32
33
|
};
|
34
|
+
|
33
35
|
/**
|
34
36
|
* 简单筛选
|
35
37
|
*/
|
36
38
|
var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
37
|
-
var
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
var _ref = props,
|
40
|
+
schema = _ref.schema,
|
41
|
+
triggerType = _ref.triggerType,
|
42
|
+
onFilter = _ref.onFilter,
|
43
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
41
44
|
var prefixCls = usePrefixCls('teamix-pro-form-filter-simple');
|
42
45
|
var simpleSchema = useMemo(function () {
|
43
46
|
return [{
|
@@ -58,11 +61,11 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
58
61
|
}];
|
59
62
|
}, [schema, triggerType]);
|
60
63
|
var eventProps = getEventProps(triggerType, onFilter);
|
61
|
-
return /*#__PURE__*/React.createElement(ProForm,
|
64
|
+
return /*#__PURE__*/React.createElement(ProForm, _extends({
|
62
65
|
feedbackLayout: "popover",
|
63
66
|
breakpoints: [],
|
64
67
|
inset: true
|
65
|
-
}, otherProps
|
68
|
+
}, otherProps, eventProps, {
|
66
69
|
className: cls(prefixCls(), props.className),
|
67
70
|
schema: simpleSchema
|
68
71
|
}));
|
@@ -70,6 +73,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
70
73
|
SimpleFilter.defaultProps = {
|
71
74
|
triggerType: 'change'
|
72
75
|
};
|
76
|
+
|
73
77
|
/**
|
74
78
|
* 高级筛选
|
75
79
|
*/
|
@@ -77,15 +81,16 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
77
81
|
var form = useMemo(function () {
|
78
82
|
return (props === null || props === void 0 ? void 0 : props.form) || createForm();
|
79
83
|
}, []);
|
80
|
-
var
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
var _ref2 = props,
|
85
|
+
schema = _ref2.schema,
|
86
|
+
triggerType = _ref2.triggerType,
|
87
|
+
onFilter = _ref2.onFilter,
|
88
|
+
onReset = _ref2.onReset,
|
89
|
+
layout = _ref2.layout,
|
90
|
+
labelAlign = _ref2.labelAlign,
|
91
|
+
wrapperAlign = _ref2.wrapperAlign,
|
92
|
+
labelCol = _ref2.labelCol,
|
93
|
+
wrapperCol = _ref2.wrapperCol;
|
89
94
|
var prefixCls = usePrefixCls('teamix-pro-form-filter-advanced');
|
90
95
|
var gridSchema = useMemo(function () {
|
91
96
|
return [{
|
@@ -142,9 +147,9 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
142
147
|
};
|
143
148
|
}, [layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
144
149
|
var eventProps = getEventProps(triggerType, onFilter);
|
145
|
-
return /*#__PURE__*/React.createElement(ProForm,
|
150
|
+
return /*#__PURE__*/React.createElement(ProForm, _extends({
|
146
151
|
feedbackLayout: "popover"
|
147
|
-
}, props
|
152
|
+
}, props, eventProps, getTeamixLayout, {
|
148
153
|
form: form,
|
149
154
|
className: cls(prefixCls(), props.className),
|
150
155
|
schema: gridSchema,
|
@@ -36,11 +36,13 @@ export default (function (bindUrl, functions, formRef) {
|
|
36
36
|
}
|
37
37
|
}) : options;
|
38
38
|
};
|
39
|
+
|
39
40
|
// 通过 useUrlState 获取 url 上的参数和 url 配置方法
|
40
41
|
var _ref4 = bindUrl ? useUrlState(undefined, initializeBindUrl(isPlainObj(bindUrl) ? bindUrl : {})) : [],
|
41
42
|
_ref5 = _slicedToArray(_ref4, 2),
|
42
43
|
urlState = _ref5[0],
|
43
44
|
setUrlState = _ref5[1];
|
45
|
+
|
44
46
|
// 输出配置url参数的函数
|
45
47
|
var initializedFunctions = Object.entries(functions).reduce(function (prev, _ref6) {
|
46
48
|
var _ref7 = _slicedToArray(_ref6, 2),
|
@@ -52,6 +54,7 @@ export default (function (bindUrl, functions, formRef) {
|
|
52
54
|
};
|
53
55
|
return prev;
|
54
56
|
}, {});
|
57
|
+
|
55
58
|
// 使用 url 参数配置 QueryFilter 默认值(移除非表单值,兼容数组数据,兼容 SelectGroup 组件)
|
56
59
|
var setValuesByUrlState = function setValuesByUrlState(form) {
|
57
60
|
if (urlState) {
|
package/es/form/ProForm/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
var _excluded = ["form", "initialValues", "initialRequest", "scope", "context", "components", "onChange", "onChangeType", "onSubmit", "onSubmitFailed", "onInitialComplete", "className", "validateFirst", "schema", "children"];
|
2
|
+
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); }
|
2
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
3
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -85,6 +86,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
85
86
|
}, [outerForm]);
|
86
87
|
var prefixCls = usePrefixCls('teamix-pro-form');
|
87
88
|
// 由于Actions需要,解构context供使用。原context键名的上下文继续保留。
|
89
|
+
|
88
90
|
var mergedComponents = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, globalComponents), components), formilyComponents), ProFieldComponents);
|
89
91
|
var onAutoSubmit = useAutoSubmit(onSubmit, context);
|
90
92
|
var autoTeamixLayout = useAutoLayout(_objectSpread(_objectSpread({}, otherProps), {}, {
|
@@ -102,6 +104,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
102
104
|
});
|
103
105
|
}
|
104
106
|
}, []);
|
107
|
+
|
105
108
|
// 添加 onChange 事件
|
106
109
|
useMemo(function () {
|
107
110
|
if (onChangeType === 'form') {
|
@@ -127,9 +130,9 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
127
130
|
// 配置国际化
|
128
131
|
setValidateLanguage(getLanguage() || 'zh-cn');
|
129
132
|
}, []);
|
130
|
-
return /*#__PURE__*/React.createElement(Form,
|
133
|
+
return /*#__PURE__*/React.createElement(Form, _extends({
|
131
134
|
className: cls(prefixCls(), className)
|
132
|
-
}, otherProps
|
135
|
+
}, otherProps, autoTeamixLayout, {
|
133
136
|
form: form,
|
134
137
|
onAutoSubmit: onAutoSubmit,
|
135
138
|
onAutoSubmitFailed: onSubmitFailed
|
@@ -55,10 +55,13 @@ var useAutoLayout = function useAutoLayout(_ref, formRef) {
|
|
55
55
|
return '';
|
56
56
|
}); // 标题内容集合
|
57
57
|
var labelWidthArray = getWidthByCharacterMap(labelArray); // 标题宽度集合
|
58
|
+
|
58
59
|
var _autoWidthBySpace = autoWidthBySpace(labelWidthArray),
|
59
60
|
expectedWidth = _autoWidthBySpace.expectedWidth,
|
60
61
|
consoleArray = _autoWidthBySpace.consoleArray; // 智能计算预期宽度
|
62
|
+
|
61
63
|
var expectedCol = Math.ceil(expectedWidth / formWidth * 24); // 预期宽度转换为 Col 值
|
64
|
+
|
62
65
|
setAutoCol({
|
63
66
|
labelCol: expectedCol,
|
64
67
|
wrapperCol: wrapperCol
|
@@ -70,6 +73,7 @@ var useAutoLayout = function useAutoLayout(_ref, formRef) {
|
|
70
73
|
});
|
71
74
|
}
|
72
75
|
}, [outLabelCol, outWrapperCol]);
|
76
|
+
|
73
77
|
// Layout配置By断点(配置断点后,目前不支持 Col 更新)
|
74
78
|
var autoTeamixLayout = useMemo(function () {
|
75
79
|
return breakpoints === true ? {
|
@@ -34,6 +34,7 @@ var getDisplayValues = function getDisplayValues(form, values) {
|
|
34
34
|
var field = form.query(getAddress(prefix)).take();
|
35
35
|
// 是否真实字段值(自定义组件、布局组件、自增数组组件为非真实字段)
|
36
36
|
var isFieldValue = Object.keys(fieldTypeMap).includes(field === null || field === void 0 ? void 0 : field.component[0]);
|
37
|
+
|
37
38
|
// 判断值的类型,递归获取每个值在该结构中的完整路径
|
38
39
|
if (!isUsable(values)) {
|
39
40
|
displayValues = {};
|
@@ -3,6 +3,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
3
3
|
/**
|
4
4
|
* Formily组件在ProForm的别名
|
5
5
|
*/
|
6
|
+
|
6
7
|
var componentMap = (_componentMap = {
|
7
8
|
FormFlex: 'Space'
|
8
9
|
}, _defineProperty(_componentMap, 'Editable.Dialog', 'EditableDialog'), _defineProperty(_componentMap, 'Editable.Drawer', 'EditableDrawer'), _defineProperty(_componentMap, 'Editable.Popover', 'EditablePopover'), _defineProperty(_componentMap, 'FormDrawer.Footer', 'FormDrawerFooter'), _defineProperty(_componentMap, 'FormDialog.Footer', 'FormDialogFooter'), _componentMap);
|
@@ -8,6 +8,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
8
8
|
* 优先使用配置,即非 undefined
|
9
9
|
* 未配置则按默认规则为基础组件和某些聚合组件添加FormItem
|
10
10
|
*/
|
11
|
+
|
11
12
|
import fieldTypeMap from '../fieldTypeMap';
|
12
13
|
export default (function (decorator, component) {
|
13
14
|
if (decorator !== undefined) {
|
@@ -47,6 +47,7 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
47
47
|
var SchemaField = useMemo(function () {
|
48
48
|
return createSchemaField();
|
49
49
|
}, []);
|
50
|
+
|
50
51
|
// 格式化 schema
|
51
52
|
var formatSchema = useCallback(function (schema) {
|
52
53
|
var parentSuffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
@@ -125,19 +126,24 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
125
126
|
otherProps = _objectWithoutProperties(_newItem2, _excluded);
|
126
127
|
// 默认字段名
|
127
128
|
var defaultName = !name ? getFieldName(component === null || component === void 0 ? void 0 : component.replace(/\./g, ''), suffix) : name;
|
129
|
+
|
128
130
|
// 默认类型
|
129
131
|
var defaultType = adapterType(type, originalComponent);
|
132
|
+
|
130
133
|
// 默认装饰组件
|
131
134
|
var defaultDecorator = adapterDecorator(decorator, originalComponent);
|
135
|
+
|
132
136
|
// 默认装饰组件属性
|
133
137
|
var tooltipProps = tooltip ? {
|
134
138
|
tooltip: tooltip
|
135
139
|
} : {};
|
136
140
|
var defaultDecoratorProps = _objectSpread(_objectSpread({}, tooltipProps), decoratorProps);
|
141
|
+
|
137
142
|
// 初始化request
|
138
143
|
var _initializeRequest = initializeRequest(request, "".concat(suffix, "r")),
|
139
144
|
requestReactions = _initializeRequest.reactions,
|
140
145
|
requestScope = _initializeRequest.scope;
|
146
|
+
|
141
147
|
// 初始化dataSource
|
142
148
|
var _initializeDataSource = initializeDataSource(dataSource, "".concat(suffix, "d")),
|
143
149
|
defaultDataSource = _initializeDataSource.dataSource,
|
@@ -145,12 +151,15 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
145
151
|
dataSourceScope = _initializeDataSource.scope,
|
146
152
|
dataSourceData = _initializeDataSource.data,
|
147
153
|
dataSourceProps = _initializeDataSource.props;
|
154
|
+
|
148
155
|
// 初始化rules validator
|
149
156
|
var _initializeRules = initializeRules(rules, "".concat(suffix, "v")),
|
150
157
|
defaultRules = _initializeRules.rules,
|
151
158
|
rulesScope = _initializeRules.scope;
|
159
|
+
|
152
160
|
// 合并reactions,初始化reactions
|
153
161
|
var defaultReactions = initializeReactions(reactions, [].concat(_toConsumableArray(requestReactions), _toConsumableArray(dataSourceReactions)));
|
162
|
+
|
154
163
|
// 合并scope
|
155
164
|
Object.entries(_objectSpread(_objectSpread(_objectSpread({}, requestScope), dataSourceScope), rulesScope)).map(function (_ref2) {
|
156
165
|
var _ref3 = _slicedToArray(_ref2, 2),
|
@@ -158,6 +167,7 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
158
167
|
v = _ref3[1];
|
159
168
|
schemaScopeRef.current[k] = v;
|
160
169
|
});
|
170
|
+
|
161
171
|
// 合并字段属性
|
162
172
|
var defaultProps = _objectSpread(_objectSpread(_objectSpread({}, props), dataSourceProps), {}, {
|
163
173
|
className: cls(props === null || props === void 0 ? void 0 : props.className, dataSourceProps === null || dataSourceProps === void 0 ? void 0 : dataSourceProps.className)
|
@@ -175,13 +185,16 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
175
185
|
__placeholder: true
|
176
186
|
})
|
177
187
|
}));
|
188
|
+
|
178
189
|
// 递归子组件
|
179
190
|
var recursiveProperties = (children === null || children === void 0 ? void 0 : children.length) ? {
|
180
191
|
properties: formatSchema(children, suffix)
|
181
192
|
} : {};
|
193
|
+
|
182
194
|
// 递归items(类似子组件,会先由各initialize方法格式化为固定形式,type不同不统一处理)
|
183
195
|
// 例如:[{ name: 'items', type: 'object', children: items }]
|
184
196
|
var recursiveItems = items ? formatSchema([items], suffix) : {};
|
197
|
+
|
185
198
|
// 配置组件属性
|
186
199
|
if (isUsable(item)) {
|
187
200
|
schemaProperties[defaultName] = _objectSpread(_objectSpread(_objectSpread({}, formatParam), recursiveProperties), recursiveItems);
|
@@ -30,6 +30,7 @@ var initialize = function initialize(item) {
|
|
30
30
|
container = props.container,
|
31
31
|
onAffix = props.onAffix,
|
32
32
|
otherProps = _objectWithoutProperties(props, _excluded);
|
33
|
+
|
33
34
|
// 单个按钮
|
34
35
|
if (component && ['Submit', 'Reset'].includes(component)) {
|
35
36
|
return initializeButton(item);
|
@@ -44,6 +45,7 @@ var initialize = function initialize(item) {
|
|
44
45
|
className: cls('teamix-button-group-item', decoratorProps === null || decoratorProps === void 0 ? void 0 : decoratorProps.className)
|
45
46
|
}, decoratorProps)
|
46
47
|
});
|
48
|
+
|
47
49
|
// 吸底模式
|
48
50
|
if (['auto', 'always'].includes(sticky)) {
|
49
51
|
var stickyProps = {};
|
@@ -43,6 +43,7 @@ var initializeReactions = function initializeReactions(reactions, innerReactions
|
|
43
43
|
if (reactions) {
|
44
44
|
temp = mergeArrayValue(innerReactions, reactions);
|
45
45
|
}
|
46
|
+
|
46
47
|
// schema名称映射,由ProFormSchema映射为formilySchema
|
47
48
|
temp = temp.map(function (item) {
|
48
49
|
var _item$fulfill, _item$otherwise;
|
@@ -12,6 +12,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
13
13
|
import { usePrefixCls, cls, isStr, isPlainObj, isArr } from '@teamix/utils';
|
14
14
|
import pureGenProColumnToColumn from '../../table/utils/pureGenProColumnToColumn';
|
15
|
+
|
15
16
|
/**
|
16
17
|
* 将可被 ProForm 识别的上下文转换为仅被 ProTable 识别的上下文
|
17
18
|
* @param value
|
@@ -20,8 +20,10 @@ var $request = function $request(field, context, _ref, type) {
|
|
20
20
|
// 通过字段 data 的 refresh 主动触发的请求刷新
|
21
21
|
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
22
22
|
var refreshResult = isPlainObj(refresh) ? refresh : {};
|
23
|
+
|
23
24
|
// 合并请求参数
|
24
25
|
var mergedParams = _objectSpread(_objectSpread(_objectSpread({}, params), beforeRequestResult), refreshResult);
|
26
|
+
|
25
27
|
// 执行通用数据请求
|
26
28
|
return doCommonRequest(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
27
29
|
params: mergedParams,
|
@@ -39,6 +41,7 @@ var $request = function $request(field, context, _ref, type) {
|
|
39
41
|
params: mergedParams
|
40
42
|
}));
|
41
43
|
};
|
44
|
+
|
42
45
|
// 通用请求配置上下文
|
43
46
|
var $common = function $common(services, context, requestConfig) {
|
44
47
|
return function (field) {
|
@@ -48,6 +51,7 @@ var $common = function $common(services, context, requestConfig) {
|
|
48
51
|
});
|
49
52
|
};
|
50
53
|
};
|
54
|
+
|
51
55
|
// 配置校验
|
52
56
|
var $validator = function $validator(services, context, requestConfig) {
|
53
57
|
return function (value, rules, _ref2) {
|
@@ -61,6 +65,7 @@ var $validator = function $validator(services, context, requestConfig) {
|
|
61
65
|
});
|
62
66
|
};
|
63
67
|
};
|
68
|
+
|
64
69
|
// 配置DataSource
|
65
70
|
var $dataSource = function $dataSource(services, context, requestConfig) {
|
66
71
|
return function (field) {
|
package/es/form/index.js
CHANGED
@@ -5,6 +5,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
5
5
|
* 导出ProForm的TS
|
6
6
|
*/
|
7
7
|
export * from './typing';
|
8
|
+
|
8
9
|
/**
|
9
10
|
* 使用别名导出formily相关内容
|
10
11
|
*/
|
@@ -23,6 +24,7 @@ var formilyReact = _objectSpread(_objectSpread({}, originalFormilyReact), {}, {
|
|
23
24
|
});
|
24
25
|
import { customComponent } from './ProForm/customComponent';
|
25
26
|
export { formilyReact, customComponent };
|
27
|
+
|
26
28
|
/**
|
27
29
|
* 导出常用formily内容
|
28
30
|
*/
|
@@ -30,6 +32,7 @@ import { createForm, registerValidateRules as registerRules, registerValidateFor
|
|
30
32
|
import { FormConsumer, useForm } from '@formily/react';
|
31
33
|
import { FormDialog, FormDrawer, FormStep, FormTab, FormCollapse } from '@teamix/formily';
|
32
34
|
export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, useForm };
|
35
|
+
|
33
36
|
/**
|
34
37
|
* 导出 Filter 组件
|
35
38
|
*/
|
@@ -37,6 +40,7 @@ import { QueryFilter } from './Filter';
|
|
37
40
|
import { QueryFilterLayout } from './Filter/Layout';
|
38
41
|
import { AdvancedFilter, SimpleFilter } from './Filter/index2';
|
39
42
|
export { QueryFilter, QueryFilterLayout, AdvancedFilter, SimpleFilter };
|
43
|
+
|
40
44
|
/**
|
41
45
|
* 导出 ProForm 组件,支持快速搭建表单
|
42
46
|
*/
|
package/es/form/utils.js
CHANGED
@@ -30,6 +30,7 @@ var mapSize = function mapSize(props, field) {
|
|
30
30
|
size: props.size || takeSize()
|
31
31
|
});
|
32
32
|
};
|
33
|
+
|
33
34
|
/**
|
34
35
|
* 映射字段state
|
35
36
|
* @param props component的props
|
@@ -88,11 +89,20 @@ var mapMode = function mapMode(props, field) {
|
|
88
89
|
mode: (field === null || field === void 0 ? void 0 : field.readPretty) ? 'read' : 'edit'
|
89
90
|
});
|
90
91
|
};
|
92
|
+
|
93
|
+
/**
|
94
|
+
* 创建字段名称
|
95
|
+
* @param prefix 字段名称前缀,接收字段component名称,默认为FieldName
|
96
|
+
* @param suffix 字段后缀,唯一标识
|
97
|
+
* @returns 字段唯一名称
|
98
|
+
*/
|
99
|
+
|
91
100
|
var getFieldName = function getFieldName() {
|
92
101
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'FieldName';
|
93
102
|
var suffix = arguments.length > 1 ? arguments[1] : undefined;
|
94
103
|
return "".concat(prefix, "-").concat(suffix);
|
95
104
|
};
|
105
|
+
|
96
106
|
/**
|
97
107
|
* 将ProForm的key映射为formily的key,然后筛除掉无效的key/value
|
98
108
|
* @param obj
|
@@ -124,6 +134,7 @@ var mapSchemaName = function mapSchemaName(obj) {
|
|
124
134
|
});
|
125
135
|
return temp;
|
126
136
|
};
|
137
|
+
|
127
138
|
/**
|
128
139
|
* 合并数组或非数组,不移除无效值
|
129
140
|
* @param arr 数组
|
@@ -136,6 +147,7 @@ var mergeArrayValue = function mergeArrayValue(arr, v) {
|
|
136
147
|
}
|
137
148
|
return [].concat(_toConsumableArray(arr), [v]);
|
138
149
|
};
|
150
|
+
|
139
151
|
/**
|
140
152
|
* 初始化请求配置为表达式
|
141
153
|
* @param config 请求配置
|