@teamix/pro 1.1.4 → 1.1.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/README.md +97 -0
- package/dist/212.js +2 -2
- package/dist/pro.css +1 -1
- package/dist/pro.js +3147 -1872
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +1 -1
- package/es/actions/dialog-form.d.ts +3 -3
- package/es/actions/dialog-table.d.ts +6 -1
- package/es/actions/dialog-table.js +10 -1
- package/es/actions/drawer-table.d.ts +4 -0
- package/es/actions/drawer-table.js +7 -1
- package/es/actions/index.d.ts +6 -11
- package/es/actions/index.js +41 -21
- package/es/actions/index.scss +1 -1
- package/es/card/index.d.ts +17 -0
- package/es/form/Components/ProField/index.d.ts +8 -0
- package/es/form/ProForm/index.d.ts +2 -2
- package/es/form/ProForm/index.js +9 -2
- package/es/form/ProForm/index.scss +40 -7
- package/es/form/SchemaForm/adapterType.js +3 -3
- package/es/form/SchemaForm/index.d.ts +2 -2
- package/es/form/SchemaForm/index.js +9 -5
- package/es/form/SchemaForm/initializeArrayCards.js +10 -55
- package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
- package/es/form/SchemaForm/initializeArrayIcon.js +19 -7
- package/es/form/SchemaForm/initializeArrayItems.js +16 -75
- package/es/form/SchemaForm/initializeArrayTable.js +23 -33
- package/es/form/SchemaForm/initializeFormButton.js +35 -38
- package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormStep.d.ts +4 -2
- package/es/form/SchemaForm/initializeFormStep.js +21 -7
- package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/es/form/SchemaForm/initializeProField.js +3 -3
- package/es/form/SchemaForm/reactions.d.ts +1 -1
- package/es/form/SchemaForm/reactions.js +2 -2
- package/es/form/index.d.ts +17 -9
- package/es/form/index.js +21 -9
- package/es/form/typing.d.ts +13 -22
- package/es/form/warning.js +2 -6
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -3
- package/es/info/components/FormItem/index.js +4 -4
- package/es/info/components/FormItem/index.scss +11 -0
- package/es/info/components/InfoGroup/index.js +37 -6
- package/es/info/components/InfoGroup/index.scss +6 -0
- package/es/info/components/InfoValueItem/index.js +14 -2
- package/es/info/components/baseInfo/index.js +10 -9
- package/es/info/components/headerInfo/index.js +10 -9
- package/es/info/components/tableInfo/index.js +7 -4
- package/es/info/components/tableInfo/index.scss +1 -1
- package/es/info/index.d.ts +1 -0
- package/es/info/index.js +9 -7
- package/es/info/index.scss +4 -0
- package/es/info/typing.d.ts +17 -3
- package/es/info/utils/index.d.ts +11 -2
- package/es/info/utils/index.js +21 -0
- package/es/nocode/configurators/PageHeader.js +49 -43
- package/es/nocode/configurators/ProTable.js +12 -9
- package/es/nocode/configurators/common.d.ts +117 -105
- package/es/nocode/configurators/common.js +38 -34
- package/es/nocode/index.scss +1 -4
- package/es/page-header/index.d.ts +3 -0
- package/es/page-header/index.js +40 -13
- package/es/page-header/index.scss +6 -4
- package/es/table/components/Filter/index.js +8 -16
- package/es/table/components/Layout/index.js +2 -1
- package/es/table/components/Layout/index.scss +1 -1
- package/es/table/components/ToolBar/FilterColumnIcon.js +77 -17
- package/es/table/components/ToolBar/index.scss +10 -0
- package/es/table/index.d.ts +0 -1
- package/es/table/index.js +75 -56
- package/es/table/index.scss +0 -1
- package/es/table/typing.d.ts +3 -1
- package/lib/actions/dialog-form.d.ts +3 -3
- package/lib/actions/dialog-table.d.ts +6 -1
- package/lib/actions/dialog-table.js +20 -1
- package/lib/actions/drawer-table.d.ts +4 -0
- package/lib/actions/drawer-table.js +14 -1
- package/lib/actions/index.d.ts +6 -11
- package/lib/actions/index.js +44 -20
- package/lib/actions/index.scss +1 -1
- package/lib/card/index.d.ts +17 -0
- package/lib/form/Components/ProField/index.d.ts +8 -0
- package/lib/form/ProForm/index.d.ts +2 -2
- package/lib/form/ProForm/index.js +10 -2
- package/lib/form/ProForm/index.scss +40 -7
- package/lib/form/SchemaForm/adapterType.js +3 -3
- package/lib/form/SchemaForm/index.d.ts +2 -2
- package/lib/form/SchemaForm/index.js +10 -5
- package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
- package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
- package/lib/form/SchemaForm/initializeArrayIcon.js +19 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
- package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
- package/lib/form/SchemaForm/initializeFormButton.js +35 -38
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormStep.d.ts +4 -2
- package/lib/form/SchemaForm/initializeFormStep.js +21 -7
- package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/lib/form/SchemaForm/initializeProField.js +3 -3
- package/lib/form/SchemaForm/reactions.d.ts +1 -1
- package/lib/form/SchemaForm/reactions.js +2 -2
- package/lib/form/index.d.ts +17 -9
- package/lib/form/index.js +81 -56
- package/lib/form/typing.d.ts +13 -22
- package/lib/form/warning.js +2 -6
- package/lib/index.d.ts +4 -3
- package/lib/index.js +16 -4
- package/lib/info/components/FormItem/index.js +4 -4
- package/lib/info/components/FormItem/index.scss +11 -0
- package/lib/info/components/InfoGroup/index.js +46 -6
- package/lib/info/components/InfoGroup/index.scss +6 -0
- package/lib/info/components/InfoValueItem/index.js +15 -3
- package/lib/info/components/baseInfo/index.js +10 -9
- package/lib/info/components/headerInfo/index.js +11 -10
- package/lib/info/components/tableInfo/index.js +7 -3
- package/lib/info/components/tableInfo/index.scss +1 -1
- package/lib/info/index.d.ts +1 -0
- package/lib/info/index.js +8 -6
- package/lib/info/index.scss +4 -0
- package/lib/info/typing.d.ts +17 -3
- package/lib/info/utils/index.d.ts +11 -2
- package/lib/info/utils/index.js +31 -0
- package/lib/nocode/configurators/PageHeader.js +49 -43
- package/lib/nocode/configurators/ProTable.js +12 -9
- package/lib/nocode/configurators/common.d.ts +117 -105
- package/lib/nocode/configurators/common.js +38 -34
- package/lib/nocode/index.scss +1 -4
- package/lib/page-header/index.d.ts +3 -0
- package/lib/page-header/index.js +42 -13
- package/lib/page-header/index.scss +6 -4
- package/lib/table/components/Filter/index.js +7 -15
- package/lib/table/components/Layout/index.js +2 -1
- package/lib/table/components/Layout/index.scss +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +75 -16
- package/lib/table/components/ToolBar/index.scss +10 -0
- package/lib/table/index.d.ts +0 -1
- package/lib/table/index.js +76 -65
- package/lib/table/index.scss +0 -1
- package/lib/table/typing.d.ts +3 -1
- package/package.json +5 -5
@@ -1,77 +1,23 @@
|
|
1
|
-
var _excluded = ["props", "children", "items"],
|
2
|
-
_excluded2 = ["itemType", "title"];
|
3
|
-
|
4
|
-
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; }
|
5
|
-
|
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; }
|
7
|
-
|
8
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
9
2
|
|
10
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
11
4
|
|
12
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; }
|
13
6
|
|
14
|
-
var
|
15
|
-
|
16
|
-
}
|
7
|
+
var initializeItems = function initializeItems(items) {
|
8
|
+
if (items) {
|
9
|
+
return _objectSpread(_objectSpread({}, items), {}, {
|
10
|
+
name: 'items'
|
11
|
+
});
|
12
|
+
}
|
17
13
|
|
18
|
-
|
19
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
20
|
-
component: 'ArrayCollapse.Addition'
|
21
|
-
});
|
22
|
-
};
|
23
|
-
|
24
|
-
var initializeString = function initializeString(items, props) {
|
25
|
-
return [{
|
26
|
-
name: 'items',
|
27
|
-
component: 'ArrayCollapse.CollapsePanel',
|
28
|
-
props: props,
|
29
|
-
children: items.map(function (item) {
|
30
|
-
return initializeChildren(item);
|
31
|
-
})
|
32
|
-
}];
|
33
|
-
};
|
34
|
-
|
35
|
-
var initializeObject = function initializeObject(items, props) {
|
36
|
-
return [{
|
37
|
-
type: 'object',
|
38
|
-
name: 'items',
|
39
|
-
component: 'ArrayCollapse.CollapsePanel',
|
40
|
-
props: props,
|
41
|
-
children: items.map(function (item) {
|
42
|
-
return initializeChildren(item);
|
43
|
-
})
|
44
|
-
}];
|
14
|
+
return items;
|
45
15
|
};
|
46
16
|
|
47
17
|
var initialize = function initialize(item) {
|
48
|
-
var
|
49
|
-
|
50
|
-
|
51
|
-
children = _item$children === void 0 ? [] : _item$children,
|
52
|
-
_item$items = item.items,
|
53
|
-
items = _item$items === void 0 ? [] : _item$items,
|
54
|
-
other = _objectWithoutProperties(item, _excluded);
|
55
|
-
|
56
|
-
var _props$itemType = props.itemType,
|
57
|
-
itemType = _props$itemType === void 0 ? 'string' : _props$itemType,
|
58
|
-
title = props.title,
|
59
|
-
otherProps = _objectWithoutProperties(props, _excluded2);
|
60
|
-
|
61
|
-
var renderItemsMap = {
|
62
|
-
string: initializeString(items, {
|
63
|
-
title: title
|
64
|
-
}),
|
65
|
-
object: initializeObject(items, {
|
66
|
-
title: title
|
67
|
-
})
|
68
|
-
};
|
69
|
-
return _objectSpread(_objectSpread({}, other), {}, {
|
70
|
-
props: otherProps,
|
71
|
-
children: children.map(function (item) {
|
72
|
-
return initializeAddition(item);
|
73
|
-
}),
|
74
|
-
items: renderItemsMap[itemType]
|
18
|
+
var items = item.items;
|
19
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
20
|
+
items: items ? initializeItems(items) : {}
|
75
21
|
});
|
76
22
|
};
|
77
23
|
|
@@ -1,4 +1,6 @@
|
|
1
|
-
var _excluded = ["component", "props"]
|
1
|
+
var _excluded = ["component", "props"],
|
2
|
+
_excluded2 = ["icon"],
|
3
|
+
_excluded3 = ["text", "type"];
|
2
4
|
|
3
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4
6
|
|
@@ -15,12 +17,18 @@ import TeamixIcon from '@teamix/icon';
|
|
15
17
|
|
16
18
|
var initialize = function initialize(item) {
|
17
19
|
var component = item.component,
|
18
|
-
props = item.props,
|
20
|
+
_item$props = item.props,
|
21
|
+
props = _item$props === void 0 ? {} : _item$props,
|
19
22
|
other = _objectWithoutProperties(item, _excluded);
|
20
23
|
|
24
|
+
var icon = props.icon,
|
25
|
+
otherProps = _objectWithoutProperties(props, _excluded2);
|
26
|
+
|
21
27
|
var iconType = '';
|
22
28
|
|
23
|
-
if (
|
29
|
+
if (icon) {
|
30
|
+
iconType = icon;
|
31
|
+
} else if (component) {
|
24
32
|
if (/Addition/.test(component)) {
|
25
33
|
iconType = 'add-line';
|
26
34
|
} else if (/Remove/.test(component)) {
|
@@ -37,13 +45,17 @@ var initialize = function initialize(item) {
|
|
37
45
|
return _objectSpread(_objectSpread({}, other), {}, {
|
38
46
|
component: component,
|
39
47
|
props: _objectSpread({
|
40
|
-
icon: function icon(
|
41
|
-
|
48
|
+
icon: function icon(_ref) {
|
49
|
+
var text = _ref.text,
|
50
|
+
type = _ref.type,
|
51
|
+
props = _objectWithoutProperties(_ref, _excluded3);
|
52
|
+
|
53
|
+
return /*#__PURE__*/React.createElement(TeamixIcon, _objectSpread(_objectSpread({}, props), {}, {
|
42
54
|
type: iconType,
|
43
55
|
size: "small"
|
44
|
-
}
|
56
|
+
}));
|
45
57
|
}
|
46
|
-
},
|
58
|
+
}, otherProps)
|
47
59
|
});
|
48
60
|
};
|
49
61
|
|
@@ -1,96 +1,37 @@
|
|
1
|
-
var _excluded = ["decoratorProps"],
|
2
|
-
_excluded2 = ["props", "children", "items"];
|
3
|
-
|
4
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
5
2
|
|
6
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
7
4
|
|
8
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; }
|
9
6
|
|
10
|
-
|
7
|
+
var initializeItems = function initializeItems(items) {
|
8
|
+
if (items) {
|
9
|
+
return _objectSpread(_objectSpread({}, items), {}, {
|
10
|
+
name: 'items'
|
11
|
+
});
|
12
|
+
}
|
11
13
|
|
12
|
-
|
14
|
+
return items;
|
15
|
+
};
|
13
16
|
|
14
17
|
var initializeChildren = function initializeChildren(item) {
|
15
|
-
var decoratorProps = item.decoratorProps
|
16
|
-
|
17
|
-
|
18
|
-
return _objectSpread({
|
18
|
+
var decoratorProps = item.decoratorProps;
|
19
|
+
return _objectSpread(_objectSpread({}, item), decoratorProps ? {
|
19
20
|
decoratorProps: _objectSpread({
|
20
21
|
feedbackLayout: 'none'
|
21
22
|
}, decoratorProps)
|
22
|
-
}
|
23
|
-
};
|
24
|
-
|
25
|
-
var initializeAddition = function initializeAddition(item) {
|
26
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
27
|
-
component: 'ArrayItems.Addition'
|
28
|
-
});
|
29
|
-
};
|
30
|
-
|
31
|
-
var initializeString = function initializeString(items, props) {
|
32
|
-
return [{
|
33
|
-
name: 'items',
|
34
|
-
component: 'FormFlex',
|
35
|
-
props: props,
|
36
|
-
decoratorProps: {
|
37
|
-
feedbackLayout: 'none'
|
38
|
-
},
|
39
|
-
children: items.map(function (item) {
|
40
|
-
return initializeChildren(item);
|
41
|
-
})
|
42
|
-
}];
|
43
|
-
};
|
44
|
-
|
45
|
-
var initializeObject = function initializeObject(items, props) {
|
46
|
-
return [{
|
47
|
-
name: 'items',
|
48
|
-
type: 'object',
|
49
|
-
children: [{
|
50
|
-
component: 'FormFlex',
|
51
|
-
props: props,
|
52
|
-
children: items.map(function (item) {
|
53
|
-
return initializeChildren(item);
|
54
|
-
})
|
55
|
-
}]
|
56
|
-
}];
|
57
|
-
};
|
58
|
-
|
59
|
-
var initializeItems = function initializeItems(items, decoratorProps) {
|
60
|
-
return [{
|
61
|
-
name: 'items',
|
62
|
-
type: 'object',
|
63
|
-
decorator: 'ArrayItems.Item',
|
64
|
-
decoratorProps: decoratorProps,
|
65
|
-
children: items
|
66
|
-
}];
|
23
|
+
} : {});
|
67
24
|
};
|
68
25
|
|
69
26
|
var initialize = function initialize(item) {
|
70
|
-
var _item$
|
71
|
-
props = _item$props === void 0 ? {} : _item$props,
|
72
|
-
_item$children = item.children,
|
27
|
+
var _item$children = item.children,
|
73
28
|
children = _item$children === void 0 ? [] : _item$children,
|
74
|
-
|
75
|
-
|
76
|
-
otherProps = _objectWithoutProperties(item, _excluded2);
|
77
|
-
|
78
|
-
var _props$itemType = props.itemType,
|
79
|
-
itemType = _props$itemType === void 0 ? 'string' : _props$itemType,
|
80
|
-
_props$itemTypeProps = props.itemTypeProps,
|
81
|
-
itemTypeProps = _props$itemTypeProps === void 0 ? {} : _props$itemTypeProps;
|
82
|
-
var renderItemsMap = {
|
83
|
-
string: initializeString(items, itemTypeProps),
|
84
|
-
object: initializeObject(items, itemTypeProps),
|
85
|
-
card: initializeItems(items, {
|
86
|
-
type: 'card'
|
87
|
-
})
|
88
|
-
};
|
89
|
-
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
29
|
+
items = item.items;
|
30
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
90
31
|
children: children.map(function (item) {
|
91
|
-
return
|
32
|
+
return initializeChildren(item);
|
92
33
|
}),
|
93
|
-
items:
|
34
|
+
items: items ? initializeItems(items) : {}
|
94
35
|
});
|
95
36
|
};
|
96
37
|
|
@@ -1,9 +1,4 @@
|
|
1
|
-
var _excluded = ["title", "decoratorProps"]
|
2
|
-
_excluded2 = ["props", "children", "items"];
|
3
|
-
|
4
|
-
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; }
|
5
|
-
|
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; }
|
1
|
+
var _excluded = ["title", "decoratorProps"];
|
7
2
|
|
8
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
9
4
|
|
@@ -11,55 +6,50 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
11
6
|
|
12
7
|
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; }
|
13
8
|
|
14
|
-
var
|
15
|
-
|
16
|
-
|
17
|
-
});
|
18
|
-
};
|
9
|
+
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; }
|
10
|
+
|
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; }
|
19
12
|
|
20
13
|
var initializeColumn = function initializeColumn(item) {
|
21
14
|
var title = item.title,
|
22
15
|
decoratorProps = item.decoratorProps,
|
23
|
-
|
16
|
+
children = _objectWithoutProperties(item, _excluded);
|
24
17
|
|
25
|
-
return
|
18
|
+
return {
|
26
19
|
component: 'ArrayTable.Column',
|
27
20
|
props: _objectSpread(_objectSpread({}, decoratorProps), {}, {
|
28
21
|
title: title
|
29
22
|
}),
|
30
|
-
children: [_objectSpread({},
|
31
|
-
}
|
23
|
+
children: [_objectSpread({}, children)]
|
24
|
+
};
|
32
25
|
};
|
33
26
|
|
34
27
|
var initializeItems = function initializeItems(items) {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
28
|
+
if (items) {
|
29
|
+
var _items$children;
|
30
|
+
|
31
|
+
return _objectSpread(_objectSpread({}, items), {}, {
|
32
|
+
name: 'items',
|
33
|
+
children: (_items$children = items.children) === null || _items$children === void 0 ? void 0 : _items$children.map(function (item) {
|
34
|
+
return initializeColumn(item);
|
35
|
+
})
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
return items;
|
42
40
|
};
|
43
41
|
|
44
42
|
var initialize = function initialize(item) {
|
45
43
|
var _item$props = item.props,
|
46
44
|
props = _item$props === void 0 ? {} : _item$props,
|
47
|
-
|
48
|
-
|
49
|
-
_item$items = item.items,
|
50
|
-
items = _item$items === void 0 ? [] : _item$items,
|
51
|
-
otherProps = _objectWithoutProperties(item, _excluded2);
|
52
|
-
|
53
|
-
return _objectSpread(_objectSpread({}, otherProps), {}, {
|
45
|
+
items = item.items;
|
46
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
54
47
|
props: _objectSpread({
|
55
48
|
pagination: {
|
56
49
|
pageSize: 10
|
57
50
|
}
|
58
51
|
}, props),
|
59
|
-
|
60
|
-
return initializeChildren(item);
|
61
|
-
}),
|
62
|
-
items: initializeItems(items)
|
52
|
+
items: items ? initializeItems(items) : {}
|
63
53
|
});
|
64
54
|
};
|
65
55
|
|
@@ -1,5 +1,8 @@
|
|
1
|
-
var _excluded = ["
|
2
|
-
|
1
|
+
var _excluded = ["sticky"];
|
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; }
|
4
|
+
|
5
|
+
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; }
|
3
6
|
|
4
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
5
8
|
|
@@ -7,10 +10,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
7
10
|
|
8
11
|
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; }
|
9
12
|
|
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
|
-
|
12
|
-
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; }
|
13
|
-
|
14
13
|
var buttonTextMap = {
|
15
14
|
Submit: '提交',
|
16
15
|
Reset: '重置'
|
@@ -18,58 +17,56 @@ var buttonTextMap = {
|
|
18
17
|
|
19
18
|
var initializeButton = function initializeButton(item) {
|
20
19
|
var component = item.component,
|
21
|
-
props = item.props,
|
22
|
-
|
23
|
-
|
24
|
-
return _objectSpread({
|
20
|
+
_item$props = item.props,
|
21
|
+
props = _item$props === void 0 ? {} : _item$props;
|
22
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
25
23
|
component: component,
|
26
24
|
props: _objectSpread({
|
27
25
|
children: buttonTextMap[component]
|
28
26
|
}, props)
|
29
|
-
}
|
27
|
+
});
|
30
28
|
};
|
31
29
|
|
32
30
|
var initialize = function initialize(item) {
|
33
|
-
var
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
var component = item.component,
|
32
|
+
_item$props2 = item.props,
|
33
|
+
props = _item$props2 === void 0 ? {} : _item$props2,
|
34
|
+
_item$decoratorProps = item.decoratorProps,
|
35
|
+
decoratorProps = _item$decoratorProps === void 0 ? {} : _item$decoratorProps;
|
37
36
|
|
38
37
|
var sticky = props.sticky,
|
39
|
-
|
40
|
-
|
41
|
-
var alignProps = align ? {
|
42
|
-
align: align
|
43
|
-
} : {};
|
44
|
-
var gutterProps = gutter ? {
|
45
|
-
gutter: gutter
|
46
|
-
} : {};
|
38
|
+
otherProps = _objectWithoutProperties(props, _excluded); // 单个按钮
|
39
|
+
|
47
40
|
|
48
41
|
if (component && ['Submit', 'Reset'].includes(component)) {
|
49
42
|
return initializeButton(item);
|
50
43
|
}
|
51
44
|
|
52
|
-
var
|
53
|
-
title: ' '
|
45
|
+
var commonMode = _objectSpread(_objectSpread({
|
46
|
+
title: ' '
|
47
|
+
}, item), {}, {
|
48
|
+
component: component,
|
49
|
+
props: otherProps,
|
54
50
|
decorator: 'FormButtonGroup.FormItem',
|
55
|
-
decoratorProps: {
|
51
|
+
decoratorProps: _objectSpread({
|
56
52
|
inset: false
|
57
|
-
},
|
58
|
-
|
59
|
-
|
53
|
+
}, decoratorProps)
|
54
|
+
}); // 吸底模式
|
55
|
+
|
60
56
|
|
61
57
|
if (sticky) {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
return {
|
59
|
+
component: 'Affix',
|
60
|
+
props: {
|
61
|
+
offsetBottom: 0,
|
62
|
+
className: 'teamix-pro-form-button-affix'
|
63
|
+
},
|
64
|
+
children: [commonMode]
|
67
65
|
};
|
68
|
-
}
|
66
|
+
} // 普通模式
|
67
|
+
|
69
68
|
|
70
|
-
return
|
71
|
-
component: component
|
72
|
-
}, decoratorTemp), otherProps);
|
69
|
+
return commonMode;
|
73
70
|
};
|
74
71
|
|
75
72
|
export default initialize;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize: (item:
|
1
|
+
import type { IFormSchemaItem } from '../typing';
|
2
|
+
declare const initialize: (item: IFormSchemaItem) => IFormSchemaItem;
|
3
3
|
export default initialize;
|
@@ -1,3 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize: (item:
|
1
|
+
import type { IFormSchemaItem } from '../typing';
|
2
|
+
declare const initialize: (item: IFormSchemaItem & {
|
3
|
+
col?: number;
|
4
|
+
}) => IFormSchemaItem;
|
3
5
|
export default initialize;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var _excluded = ["props", "children", "title"],
|
2
|
-
_excluded2 = ["
|
2
|
+
_excluded2 = ["col", "style"];
|
3
3
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
5
5
|
|
@@ -11,6 +11,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
11
11
|
|
12
12
|
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; }
|
13
13
|
|
14
|
+
var getWidth = function getWidth(col, length) {
|
15
|
+
var newCol = col !== null && col !== void 0 ? col : (length + 1) * 4;
|
16
|
+
newCol = newCol > 24 ? 24 : newCol;
|
17
|
+
var width = 100 / 24 * newCol;
|
18
|
+
return "".concat(width, "%");
|
19
|
+
};
|
20
|
+
|
14
21
|
var initializeStepPane = function initializeStepPane(item) {
|
15
22
|
var _item$props = item.props,
|
16
23
|
props = _item$props === void 0 ? {} : _item$props,
|
@@ -32,17 +39,24 @@ var initialize = function initialize(item) {
|
|
32
39
|
var _item$props2 = item.props,
|
33
40
|
props = _item$props2 === void 0 ? {} : _item$props2,
|
34
41
|
_item$children2 = item.children,
|
35
|
-
children = _item$children2 === void 0 ? [] : _item$children2
|
36
|
-
otherProps = _objectWithoutProperties(item, _excluded2);
|
42
|
+
children = _item$children2 === void 0 ? [] : _item$children2;
|
37
43
|
|
38
|
-
|
44
|
+
var col = props.col,
|
45
|
+
style = props.style,
|
46
|
+
otherProps = _objectWithoutProperties(props, _excluded2);
|
47
|
+
|
48
|
+
var width = getWidth(col, children.length);
|
49
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
39
50
|
props: _objectSpread({
|
40
|
-
labelPlacement: 'hoz'
|
41
|
-
|
51
|
+
labelPlacement: 'hoz',
|
52
|
+
style: _objectSpread({
|
53
|
+
width: width
|
54
|
+
}, style)
|
55
|
+
}, otherProps),
|
42
56
|
children: children.map(function (item) {
|
43
57
|
return initializeStepPane(item);
|
44
58
|
})
|
45
|
-
}
|
59
|
+
});
|
46
60
|
};
|
47
61
|
|
48
62
|
export default initialize;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize: (item:
|
1
|
+
import type { IFormSchemaItem } from '../typing';
|
2
|
+
declare const initialize: (item: IFormSchemaItem) => IFormSchemaItem;
|
3
3
|
export default initialize;
|
@@ -34,7 +34,7 @@ var proFieldTypeMap = {
|
|
34
34
|
YearPicker: 'dateYear',
|
35
35
|
QuarterPicker: 'dateQuarter',
|
36
36
|
DateRangePicker: 'dateRange',
|
37
|
-
|
37
|
+
TimeRangePicker: 'timeRange',
|
38
38
|
DateTimeRangePicker: 'dateTimeRange',
|
39
39
|
WeekRangePicker: 'dateWeekRange',
|
40
40
|
MonthRangePicker: 'dateMonthRange',
|
@@ -43,10 +43,10 @@ var proFieldTypeMap = {
|
|
43
43
|
Transfer: 'transfer',
|
44
44
|
ColorPicker: 'color',
|
45
45
|
ColorRadio: 'colorRadio',
|
46
|
-
ColorSwatches: 'colorSwatches',
|
47
|
-
ColorTwitter: 'colorTwitter',
|
48
46
|
IconPicker: 'icon',
|
49
47
|
JsonInput: 'json',
|
48
|
+
TagPicker: 'tagFilter',
|
49
|
+
Range: 'range',
|
50
50
|
Search: 'search' // Upload: 'upload',
|
51
51
|
|
52
52
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { IRequestConfig } from '../';
|
1
|
+
import type { IRequestConfig } from '../typing';
|
2
2
|
declare const useRequest: (requestConfig: IRequestConfig) => (field: any) => Promise<any>;
|
3
3
|
declare const useAsyncDataSource: (services: any) => (field: any) => void;
|
4
4
|
export { useRequest, useAsyncDataSource };
|
@@ -7,7 +7,7 @@ var useRequest = function useRequest(requestConfig) {
|
|
7
7
|
params = requestConfig.params,
|
8
8
|
data = requestConfig.data,
|
9
9
|
when = requestConfig.when,
|
10
|
-
|
10
|
+
formatResult = requestConfig.formatResult,
|
11
11
|
onSuccess = requestConfig.onSuccess,
|
12
12
|
onError = requestConfig.onError;
|
13
13
|
var whenResult = isFn(when) ? when(field) : {};
|
@@ -27,7 +27,7 @@ var useRequest = function useRequest(requestConfig) {
|
|
27
27
|
data: newData !== null && newData !== void 0 ? newData : data
|
28
28
|
}).then(function (data) {
|
29
29
|
// 默认按request返回res.data.data处理
|
30
|
-
var dataSource =
|
30
|
+
var dataSource = formatResult ? formatResult(data, {
|
31
31
|
paramMap: paramMap,
|
32
32
|
listToTree: listToTree
|
33
33
|
}) : data;
|
package/es/form/index.d.ts
CHANGED
@@ -1,20 +1,28 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* 导出ProForm的TS
|
3
|
+
*/
|
4
|
+
export * from './typing';
|
5
|
+
/**
|
6
|
+
* 使用别名导出formily相关内容
|
3
7
|
*/
|
4
8
|
export * as formilyCore from '@formily/core';
|
5
9
|
export * as formilyReact from '@formily/react';
|
6
|
-
export * from '@
|
7
|
-
export * from '
|
8
|
-
export * from './typing';
|
10
|
+
export * as formilyReactive from '@formily/reactive';
|
11
|
+
export * as formilyTeamix from '@teamix/formily';
|
9
12
|
/**
|
10
|
-
*
|
13
|
+
* 导出常用formily内容,需谨慎限制
|
11
14
|
*/
|
12
15
|
import { createForm, registerValidateRules as registerRules, registerValidateFormats as registerFormats, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
export { createForm,
|
16
|
+
import { FormConsumer } from '@formily/react';
|
17
|
+
import { FormDialog, FormDrawer, FormStep, FormTab, FormCollapse } from '@teamix/formily';
|
18
|
+
export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, };
|
19
|
+
/**
|
20
|
+
* 导出 Filter 组件
|
21
|
+
*/
|
22
|
+
import { AdvancedFilter, SimpleFilter, QueryFilter } from './Filter';
|
23
|
+
export { AdvancedFilter, SimpleFilter, QueryFilter };
|
16
24
|
/**
|
17
|
-
*
|
25
|
+
* 导出 ProForm 组件,支持快速搭建表单
|
18
26
|
*/
|
19
27
|
import ProForm from './ProForm';
|
20
28
|
export default ProForm;
|