@teamix/pro 1.4.0 → 1.4.3
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/pro.css +1 -1
- package/dist/pro.js +11103 -10755
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +0 -2
- package/es/actions/dialog-form.js +1 -1
- package/es/actions/dialog.js +2 -1
- package/es/actions/index.js +5 -1
- package/es/card/index.d.ts +3 -1
- package/es/card/index.js +7 -5
- package/es/card/selectable.js +2 -2
- package/es/card/utils.js +2 -2
- package/es/form/Components/Editable/index.js +14 -10
- package/es/form/Components/FormGroup/index.js +10 -6
- package/es/form/Components/LightFilter/index.js +10 -7
- package/es/form/Components/Text/index.js +2 -4
- package/es/form/Filter/AdvancedFilter.js +3 -6
- package/es/form/Filter/Layout.js +12 -13
- package/es/form/Filter/LightFilter.js +3 -6
- package/es/form/Filter/SimpleFilter.js +3 -6
- package/es/form/Filter/index.js +9 -10
- package/es/form/Filter/index2.js +5 -10
- package/es/form/ProForm/index.d.ts +3 -2
- package/es/form/ProForm/index.js +9 -20
- package/es/form/SchemaForm/initializeSelectTable.js +3 -6
- package/es/form/typing.d.ts +0 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +2 -3
- package/es/info/components/InfoValueItem/index.js +2 -2
- package/es/info/components/ProInfoItem/index.js +3 -2
- package/es/info/components/tableInfo/index.js +1 -1
- package/es/nocode/pages/editor.js +2 -2
- package/es/nocode/pages/playground.js +2 -2
- package/es/nocode/pages/renderer.js +2 -2
- package/es/nocode/playground.js +2 -2
- package/es/page-header/index.d.ts +2 -1
- package/es/page-header/index.js +3 -2
- package/es/sidebar/components/sidebar-container/index.js +2 -2
- package/es/sidebar/components/tree/index.js +2 -2
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +2 -2
- package/es/sidebar/components/tree-node/components/IconAction/index.js +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +2 -2
- package/es/sidebar/components/tree-node/index.js +3 -3
- package/es/sidebar/index.js +2 -2
- package/es/sidebar/typing.d.ts +2 -1
- package/es/table/components/Filter/index.js +2 -2
- package/es/table/components/Layout/index.js +9 -5
- package/es/table/components/Pagination/index.js +13 -9
- package/es/table/components/ToolBar/DensityIcon.js +2 -2
- package/es/table/components/ToolBar/FilterColumnIcon.js +6 -12
- package/es/table/components/ToolBar/FullScreenIcon.js +2 -2
- package/es/table/components/ToolBar/RefreshIcon.js +2 -2
- package/es/table/components/ToolBar/index.js +2 -2
- package/es/table/index.js +18 -23
- package/es/table/index.scss +7 -0
- package/es/table/typing.d.ts +5 -1
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/table/utils/columnRender.js +8 -5
- package/es/table/utils/genProColumnToColumn.d.ts +1 -1
- package/es/table/utils/genProColumnToColumn.js +2 -1
- package/es/table/utils/pureColumnRender.js +2 -2
- package/es/timeline/ProTimeLineItem/index.js +3 -3
- package/es/timeline/index.js +2 -2
- package/es/timeline/typing.d.ts +1 -1
- package/lib/actions/dialog-form.js +1 -1
- package/lib/actions/dialog.js +2 -1
- package/lib/actions/index.js +5 -1
- package/lib/card/index.d.ts +3 -1
- package/lib/card/index.js +8 -5
- package/lib/card/selectable.js +1 -1
- package/lib/card/utils.js +1 -1
- package/lib/form/Components/Editable/index.js +14 -10
- package/lib/form/Components/FormGroup/index.js +10 -6
- package/lib/form/Components/LightFilter/index.js +10 -7
- package/lib/form/Components/Text/index.js +2 -4
- package/lib/form/Filter/AdvancedFilter.js +2 -6
- package/lib/form/Filter/Layout.js +11 -13
- package/lib/form/Filter/LightFilter.js +2 -6
- package/lib/form/Filter/SimpleFilter.js +2 -6
- package/lib/form/Filter/index.js +8 -10
- package/lib/form/Filter/index2.js +4 -10
- package/lib/form/ProForm/index.d.ts +3 -2
- package/lib/form/ProForm/index.js +8 -21
- package/lib/form/SchemaForm/initializeSelectTable.js +2 -6
- package/lib/form/typing.d.ts +0 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoValueItem/index.js +1 -1
- package/lib/info/components/ProInfoItem/index.js +6 -4
- package/lib/info/components/tableInfo/index.js +4 -4
- package/lib/nocode/pages/editor.js +1 -1
- package/lib/nocode/pages/playground.js +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/nocode/playground.js +1 -1
- package/lib/page-header/index.d.ts +2 -1
- package/lib/page-header/index.js +5 -3
- package/lib/sidebar/components/sidebar-container/index.js +1 -1
- package/lib/sidebar/components/tree/index.js +1 -1
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +1 -1
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +1 -1
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +1 -1
- package/lib/sidebar/components/tree-node/index.js +3 -3
- package/lib/sidebar/index.js +1 -1
- package/lib/sidebar/typing.d.ts +2 -1
- package/lib/table/components/Filter/index.js +1 -1
- package/lib/table/components/Layout/index.js +11 -6
- package/lib/table/components/Pagination/index.js +12 -9
- package/lib/table/components/ToolBar/DensityIcon.js +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +7 -11
- package/lib/table/components/ToolBar/FullScreenIcon.js +1 -1
- package/lib/table/components/ToolBar/RefreshIcon.js +1 -1
- package/lib/table/components/ToolBar/index.js +1 -1
- package/lib/table/index.js +17 -23
- package/lib/table/index.scss +7 -0
- package/lib/table/typing.d.ts +5 -1
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/table/utils/columnRender.js +14 -5
- package/lib/table/utils/genProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/genProColumnToColumn.js +2 -1
- package/lib/table/utils/pureColumnRender.js +8 -2
- package/lib/timeline/ProTimeLineItem/index.js +4 -2
- package/lib/timeline/index.js +1 -1
- package/lib/timeline/typing.d.ts +1 -1
- package/package.json +1 -1
- package/es/form/ProForm/useFieldSchema.d.ts +0 -7
- package/es/form/ProForm/useFieldSchema.js +0 -109
- package/lib/form/ProForm/useFieldSchema.d.ts +0 -7
- package/lib/form/ProForm/useFieldSchema.js +0 -118
@@ -1,109 +0,0 @@
|
|
1
|
-
var _excluded = ["id", "children", "reactions"],
|
2
|
-
_excluded2 = ["id", "children", "reactions"];
|
3
|
-
|
4
|
-
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; }
|
5
|
-
|
6
|
-
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; }
|
7
|
-
|
8
|
-
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
|
-
|
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
|
-
import { getValueByValue, deepMerge, isStr } from '@teamix/utils';
|
15
|
-
/**
|
16
|
-
* 合并 Field 字段 props 和 ProForm schema 配置,生成完整的 Field 字段 schema
|
17
|
-
* @param field Field 字段
|
18
|
-
* @param extra 额外的 schema 配置(存在递归,可能是子级 schema )
|
19
|
-
* @param wholeExtra 完整的额外 schema 配置
|
20
|
-
* @returns schema 配置
|
21
|
-
*/
|
22
|
-
|
23
|
-
var getMergedSchema = function getMergedSchema(field, extra, wholeExtra) {
|
24
|
-
return [].concat(field).reduce(function (prev, curr, index) {
|
25
|
-
var _curr$type;
|
26
|
-
|
27
|
-
var _ref = curr.props || {},
|
28
|
-
id = _ref.id,
|
29
|
-
_ref$children = _ref.children,
|
30
|
-
children = _ref$children === void 0 ? [] : _ref$children,
|
31
|
-
_ref$reactions = _ref.reactions,
|
32
|
-
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
33
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
34
|
-
|
35
|
-
var displayName = curr === null || curr === void 0 ? void 0 : (_curr$type = curr.type) === null || _curr$type === void 0 ? void 0 : _curr$type.displayName; // 自定义组件
|
36
|
-
|
37
|
-
var type = curr === null || curr === void 0 ? void 0 : curr.type; // 基本Dom元素
|
38
|
-
|
39
|
-
if (displayName === 'ProFormField') {
|
40
|
-
// 获取字段额外的 schema 配置(From ProForm)
|
41
|
-
var extraFieldProps = extra[index] || {};
|
42
|
-
|
43
|
-
if (id !== extraFieldProps.id) {
|
44
|
-
// 索引不匹配,通过 id 查找获取
|
45
|
-
extraFieldProps = getValueByValue(extra, id, {
|
46
|
-
inputKey: 'id',
|
47
|
-
outputKey: '__whole__'
|
48
|
-
}) || getValueByValue(wholeExtra, id, {
|
49
|
-
inputKey: 'id',
|
50
|
-
outputKey: '__whole__'
|
51
|
-
});
|
52
|
-
|
53
|
-
if (extraFieldProps) {
|
54
|
-
console.warn("Field id \"".concat(id, "\" is not found by index in ProForm schema props, Please pay attention to the order."));
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
var _ref2 = extraFieldProps || {},
|
59
|
-
extraId = _ref2.id,
|
60
|
-
_ref2$children = _ref2.children,
|
61
|
-
extraChildren = _ref2$children === void 0 ? [] : _ref2$children,
|
62
|
-
_ref2$reactions = _ref2.reactions,
|
63
|
-
extraReactions = _ref2$reactions === void 0 ? [] : _ref2$reactions,
|
64
|
-
extraRest = _objectWithoutProperties(_ref2, _excluded2);
|
65
|
-
|
66
|
-
var mergedReactions = [].concat(reactions, extraReactions);
|
67
|
-
var mergedChildren = children ? getMergedSchema(children, extraChildren, wholeExtra) : [];
|
68
|
-
prev.push(_objectSpread(_objectSpread(_objectSpread({}, deepMerge(rest, extraRest)), mergedReactions.length && {
|
69
|
-
reactions: mergedReactions
|
70
|
-
}), mergedChildren.length && {
|
71
|
-
children: mergedChildren
|
72
|
-
}));
|
73
|
-
} else if (isStr(type)) {
|
74
|
-
prev.push({
|
75
|
-
component: type,
|
76
|
-
props: curr.props
|
77
|
-
});
|
78
|
-
} else if (isStr(displayName)) {
|
79
|
-
prev.push({
|
80
|
-
decorator: displayName,
|
81
|
-
decoratorProps: _objectSpread({
|
82
|
-
id: id
|
83
|
-
}, rest),
|
84
|
-
children: children ? getMergedSchema(children, [], wholeExtra) : []
|
85
|
-
});
|
86
|
-
}
|
87
|
-
|
88
|
-
return prev;
|
89
|
-
}, []);
|
90
|
-
};
|
91
|
-
/**
|
92
|
-
* 获取 ProForm 的 schema 配置,通过合并 Field 字段 或者 schema 配置
|
93
|
-
* @param props ProForm 组件的 props
|
94
|
-
* @returns schema 配置
|
95
|
-
*/
|
96
|
-
|
97
|
-
|
98
|
-
export default (function (_ref3) {
|
99
|
-
var children = _ref3.children,
|
100
|
-
schema = _ref3.schema;
|
101
|
-
var field = [].concat(children !== null && children !== void 0 ? children : []); // 如果 ProForm 的 children 含有 Field 字段,则优先使用 Field 渲染表单(仅合并 ProForm 的 schema 属性 )
|
102
|
-
|
103
|
-
if (field.length) {
|
104
|
-
return getMergedSchema(field, schema !== null && schema !== void 0 ? schema : [], schema !== null && schema !== void 0 ? schema : []);
|
105
|
-
} // 正常使用 ProForm 的 schema 渲染表单
|
106
|
-
|
107
|
-
|
108
|
-
return schema;
|
109
|
-
});
|
@@ -1,118 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _utils = require("@teamix/utils");
|
9
|
-
|
10
|
-
var _excluded = ["id", "children", "reactions"],
|
11
|
-
_excluded2 = ["id", "children", "reactions"];
|
12
|
-
|
13
|
-
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; }
|
14
|
-
|
15
|
-
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; }
|
16
|
-
|
17
|
-
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; }
|
18
|
-
|
19
|
-
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; }
|
20
|
-
|
21
|
-
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; }
|
22
|
-
|
23
|
-
/**
|
24
|
-
* 合并 Field 字段 props 和 ProForm schema 配置,生成完整的 Field 字段 schema
|
25
|
-
* @param field Field 字段
|
26
|
-
* @param extra 额外的 schema 配置(存在递归,可能是子级 schema )
|
27
|
-
* @param wholeExtra 完整的额外 schema 配置
|
28
|
-
* @returns schema 配置
|
29
|
-
*/
|
30
|
-
var getMergedSchema = function getMergedSchema(field, extra, wholeExtra) {
|
31
|
-
return [].concat(field).reduce(function (prev, curr, index) {
|
32
|
-
var _curr$type;
|
33
|
-
|
34
|
-
var _ref = curr.props || {},
|
35
|
-
id = _ref.id,
|
36
|
-
_ref$children = _ref.children,
|
37
|
-
children = _ref$children === void 0 ? [] : _ref$children,
|
38
|
-
_ref$reactions = _ref.reactions,
|
39
|
-
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
40
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
41
|
-
|
42
|
-
var displayName = curr === null || curr === void 0 ? void 0 : (_curr$type = curr.type) === null || _curr$type === void 0 ? void 0 : _curr$type.displayName; // 自定义组件
|
43
|
-
|
44
|
-
var type = curr === null || curr === void 0 ? void 0 : curr.type; // 基本Dom元素
|
45
|
-
|
46
|
-
if (displayName === 'ProFormField') {
|
47
|
-
// 获取字段额外的 schema 配置(From ProForm)
|
48
|
-
var extraFieldProps = extra[index] || {};
|
49
|
-
|
50
|
-
if (id !== extraFieldProps.id) {
|
51
|
-
// 索引不匹配,通过 id 查找获取
|
52
|
-
extraFieldProps = (0, _utils.getValueByValue)(extra, id, {
|
53
|
-
inputKey: 'id',
|
54
|
-
outputKey: '__whole__'
|
55
|
-
}) || (0, _utils.getValueByValue)(wholeExtra, id, {
|
56
|
-
inputKey: 'id',
|
57
|
-
outputKey: '__whole__'
|
58
|
-
});
|
59
|
-
|
60
|
-
if (extraFieldProps) {
|
61
|
-
console.warn("Field id \"".concat(id, "\" is not found by index in ProForm schema props, Please pay attention to the order."));
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
var _ref2 = extraFieldProps || {},
|
66
|
-
extraId = _ref2.id,
|
67
|
-
_ref2$children = _ref2.children,
|
68
|
-
extraChildren = _ref2$children === void 0 ? [] : _ref2$children,
|
69
|
-
_ref2$reactions = _ref2.reactions,
|
70
|
-
extraReactions = _ref2$reactions === void 0 ? [] : _ref2$reactions,
|
71
|
-
extraRest = _objectWithoutProperties(_ref2, _excluded2);
|
72
|
-
|
73
|
-
var mergedReactions = [].concat(reactions, extraReactions);
|
74
|
-
var mergedChildren = children ? getMergedSchema(children, extraChildren, wholeExtra) : [];
|
75
|
-
prev.push(_objectSpread(_objectSpread(_objectSpread({}, (0, _utils.deepMerge)(rest, extraRest)), mergedReactions.length && {
|
76
|
-
reactions: mergedReactions
|
77
|
-
}), mergedChildren.length && {
|
78
|
-
children: mergedChildren
|
79
|
-
}));
|
80
|
-
} else if ((0, _utils.isStr)(type)) {
|
81
|
-
prev.push({
|
82
|
-
component: type,
|
83
|
-
props: curr.props
|
84
|
-
});
|
85
|
-
} else if ((0, _utils.isStr)(displayName)) {
|
86
|
-
prev.push({
|
87
|
-
decorator: displayName,
|
88
|
-
decoratorProps: _objectSpread({
|
89
|
-
id: id
|
90
|
-
}, rest),
|
91
|
-
children: children ? getMergedSchema(children, [], wholeExtra) : []
|
92
|
-
});
|
93
|
-
}
|
94
|
-
|
95
|
-
return prev;
|
96
|
-
}, []);
|
97
|
-
};
|
98
|
-
/**
|
99
|
-
* 获取 ProForm 的 schema 配置,通过合并 Field 字段 或者 schema 配置
|
100
|
-
* @param props ProForm 组件的 props
|
101
|
-
* @returns schema 配置
|
102
|
-
*/
|
103
|
-
|
104
|
-
|
105
|
-
var _default = function _default(_ref3) {
|
106
|
-
var children = _ref3.children,
|
107
|
-
schema = _ref3.schema;
|
108
|
-
var field = [].concat(children !== null && children !== void 0 ? children : []); // 如果 ProForm 的 children 含有 Field 字段,则优先使用 Field 渲染表单(仅合并 ProForm 的 schema 属性 )
|
109
|
-
|
110
|
-
if (field.length) {
|
111
|
-
return getMergedSchema(field, schema !== null && schema !== void 0 ? schema : [], schema !== null && schema !== void 0 ? schema : []);
|
112
|
-
} // 正常使用 ProForm 的 schema 渲染表单
|
113
|
-
|
114
|
-
|
115
|
-
return schema;
|
116
|
-
};
|
117
|
-
|
118
|
-
exports.default = _default;
|