@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
@@ -133,7 +133,7 @@ var DialogForm = function DialogForm(props) {
|
|
133
133
|
}
|
134
134
|
}, /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({
|
135
135
|
form: form,
|
136
|
-
schema:
|
136
|
+
schema: formSchema
|
137
137
|
}, getDefaultFormPropsByDialogSize(size)), addContext(getTargetValue(others, context), context))));
|
138
138
|
};
|
139
139
|
|
package/es/actions/dialog.js
CHANGED
package/es/actions/index.js
CHANGED
@@ -222,6 +222,10 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
222
222
|
tooltip = action.tooltip,
|
223
223
|
disabledTooltip = action.disabledTooltip,
|
224
224
|
tooltipProps = action.tooltipProps;
|
225
|
+
var basePrefix = usePrefixCls('', {
|
226
|
+
base: true
|
227
|
+
});
|
228
|
+
var prefixCls = usePrefixCls('teamix-pro-action');
|
225
229
|
var menuItemActionConfig = Object.assign({}, config, {
|
226
230
|
trigger: 'onClick'
|
227
231
|
});
|
@@ -259,7 +263,7 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
259
263
|
}
|
260
264
|
|
261
265
|
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
262
|
-
className: cls('
|
266
|
+
className: cls(_defineProperty({}, basePrefix('disabled'), disabled), basePrefix('menu-item'), prefixCls('menu-item'))
|
263
267
|
}, buttonProps), content);
|
264
268
|
};
|
265
269
|
|
package/es/card/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { ProTagItem } from '
|
2
|
+
import { ProTagItem } from '../field';
|
3
3
|
import { ProMessageProps } from '../utils/message';
|
4
4
|
import { ProActionGroupProps } from '../actions';
|
5
5
|
import './index.scss';
|
@@ -41,6 +41,8 @@ export interface ProCardProps extends Omit<React.HTMLAttributes<HTMLElement>, 't
|
|
41
41
|
centered?: boolean;
|
42
42
|
/** 加载中状态 */
|
43
43
|
loading?: boolean;
|
44
|
+
/** 是否只是内容区加载,标题正常显示 */
|
45
|
+
contentLoading?: boolean;
|
44
46
|
/** 空状态 */
|
45
47
|
empty?: boolean;
|
46
48
|
/** 边框颜色 */
|
package/es/card/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
var _excluded = ["context"],
|
2
|
-
_excluded2 = ["children", "title", "subTitle", "tooltip", "tooltipIcon", "tags", "description", "extra", "actions", "message", "style", "className", "image", "hoveredShadow", "divider", "bordered", "compacted", "centered", "loading", "empty", "borderColor", "backgroundColor", "contentClassName", "contentStyle", "direction", "wrap", "spacing", "split", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "context"];
|
2
|
+
_excluded2 = ["children", "title", "subTitle", "tooltip", "tooltipIcon", "tags", "description", "extra", "actions", "message", "style", "className", "image", "hoveredShadow", "divider", "bordered", "compacted", "centered", "loading", "contentLoading", "empty", "borderColor", "backgroundColor", "contentClassName", "contentStyle", "direction", "wrap", "spacing", "split", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "context"];
|
3
3
|
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
5
5
|
|
@@ -28,7 +28,8 @@ import classnames from 'classnames';
|
|
28
28
|
import Result from '@teamix/result';
|
29
29
|
import { Card as BasicCard, Balloon } from '@alicloudfe/components';
|
30
30
|
import TeamixIcon from '@teamix/icon';
|
31
|
-
import {
|
31
|
+
import { usePrefixCls, getMessage } from '@teamix/utils';
|
32
|
+
import { renderTags } from '../field';
|
32
33
|
import { renderProMessage } from '../utils/message';
|
33
34
|
import { ProSkeletonRaw } from '../skeleton';
|
34
35
|
import { ProActionGroup } from '../actions';
|
@@ -39,7 +40,7 @@ import ProCardTab from './tab';
|
|
39
40
|
import './index.scss';
|
40
41
|
import ProField from '@teamix/pro-field';
|
41
42
|
export * from './card-container';
|
42
|
-
var cls =
|
43
|
+
var cls = usePrefixCls('teamix-pro-card');
|
43
44
|
|
44
45
|
var renderActionGroup = function renderActionGroup(extra, context) {
|
45
46
|
if (!extra) {
|
@@ -92,6 +93,7 @@ export var ProCard = function ProCard(props) {
|
|
92
93
|
compacted = props.compacted,
|
93
94
|
centered = props.centered,
|
94
95
|
loading = props.loading,
|
96
|
+
contentLoading = props.contentLoading,
|
95
97
|
empty = props.empty,
|
96
98
|
borderColor = props.borderColor,
|
97
99
|
backgroundColor = props.backgroundColor,
|
@@ -239,7 +241,7 @@ export var ProCard = function ProCard(props) {
|
|
239
241
|
component: "img",
|
240
242
|
src: image
|
241
243
|
}), (title || extra) && /*#__PURE__*/React.createElement(BasicCard.Header, {
|
242
|
-
title: loading ? /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Title, null) : renderTitle(),
|
244
|
+
title: loading && !contentLoading ? /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Title, null) : renderTitle(),
|
243
245
|
subTitle: !loading && subTitle,
|
244
246
|
extra: !loading && renderActionGroup(extra, context)
|
245
247
|
}), hasDivider && /*#__PURE__*/React.createElement(BasicCard.Divider, null), showContent && /*#__PURE__*/React.createElement(BasicCard.Content, {
|
@@ -247,7 +249,7 @@ export var ProCard = function ProCard(props) {
|
|
247
249
|
padding: 0,
|
248
250
|
margin: 0
|
249
251
|
} : {}
|
250
|
-
}, loading && /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Content, null), !loading && /*#__PURE__*/React.createElement("div", {
|
252
|
+
}, (loading || contentLoading) && /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Content, null), !loading && /*#__PURE__*/React.createElement("div", {
|
251
253
|
className: cardContentClassName,
|
252
254
|
style: cardContentStyle
|
253
255
|
}, empty && /*#__PURE__*/React.createElement("div", {
|
package/es/card/selectable.js
CHANGED
@@ -13,9 +13,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
13
13
|
import React from 'react';
|
14
14
|
import classnames from 'classnames';
|
15
15
|
import TeamixIcon from '@teamix/icon';
|
16
|
-
import {
|
16
|
+
import { usePrefixCls } from '@teamix/utils';
|
17
17
|
import { ProCard } from './index';
|
18
|
-
var cls =
|
18
|
+
var cls = usePrefixCls('teamix-pro-card-selectable');
|
19
19
|
|
20
20
|
var ProCardSelectable = function ProCardSelectable(props) {
|
21
21
|
var selected = props.selected,
|
package/es/card/utils.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
var cls =
|
1
|
+
import { usePrefixCls } from '@teamix/utils';
|
2
|
+
var cls = usePrefixCls('teamix-pro-card');
|
3
3
|
export function formatSpacing(spacing) {
|
4
4
|
var spacingArray = spacing instanceof Array ? spacing : [spacing || 0, spacing || 0];
|
5
5
|
return {
|
@@ -52,7 +52,9 @@ Editable.BaseBuilder = function (type) {
|
|
52
52
|
visible = _useState2[0],
|
53
53
|
setVisible = _useState2[1];
|
54
54
|
|
55
|
-
var prefixCls = usePrefixCls('formily-editable'
|
55
|
+
var prefixCls = usePrefixCls('formily-editable', {
|
56
|
+
base: true
|
57
|
+
});
|
56
58
|
|
57
59
|
var onOk = /*#__PURE__*/function () {
|
58
60
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
@@ -110,13 +112,13 @@ Editable.BaseBuilder = function (type) {
|
|
110
112
|
},
|
111
113
|
onClick: onOpen
|
112
114
|
}, /*#__PURE__*/React.createElement(BaseItem, {
|
113
|
-
className:
|
115
|
+
className: prefixCls('trigger')
|
114
116
|
}, /*#__PURE__*/React.createElement("div", {
|
115
|
-
className:
|
117
|
+
className: prefixCls('content')
|
116
118
|
}, /*#__PURE__*/React.createElement("span", {
|
117
|
-
className:
|
119
|
+
className: prefixCls('preview')
|
118
120
|
}, field.title), pattern === 'editable' && /*#__PURE__*/React.createElement(TeamixIcon, {
|
119
|
-
className:
|
121
|
+
className: prefixCls('edit-btn'),
|
120
122
|
type: "form-line",
|
121
123
|
size: "small"
|
122
124
|
})))), /*#__PURE__*/React.createElement(type, _objectSpread(_objectSpread({
|
@@ -141,7 +143,9 @@ Editable.Popover = observer(function (_ref3) {
|
|
141
143
|
visible = _useState4[0],
|
142
144
|
setVisible = _useState4[1];
|
143
145
|
|
144
|
-
var prefixCls = usePrefixCls('formily-editable'
|
146
|
+
var prefixCls = usePrefixCls('formily-editable', {
|
147
|
+
base: true
|
148
|
+
});
|
145
149
|
|
146
150
|
var closePopover = /*#__PURE__*/function () {
|
147
151
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
@@ -208,13 +212,13 @@ Editable.Popover = observer(function (_ref3) {
|
|
208
212
|
display: 'inline-flex'
|
209
213
|
}
|
210
214
|
}, /*#__PURE__*/React.createElement(BaseItem, {
|
211
|
-
className:
|
215
|
+
className: prefixCls('trigger')
|
212
216
|
}, /*#__PURE__*/React.createElement("div", {
|
213
|
-
className:
|
217
|
+
className: prefixCls('content')
|
214
218
|
}, /*#__PURE__*/React.createElement("span", {
|
215
|
-
className:
|
219
|
+
className: prefixCls('preview')
|
216
220
|
}, props.title || field.title), pattern === 'editable' && /*#__PURE__*/React.createElement(TeamixIcon, {
|
217
|
-
className:
|
221
|
+
className: prefixCls('edit-btn'),
|
218
222
|
type: "form-line",
|
219
223
|
size: "small"
|
220
224
|
}))))
|
@@ -49,23 +49,27 @@ var FormGroupGroupPanel = observer(function (_ref) {
|
|
49
49
|
xIndex = _ref.xIndex,
|
50
50
|
props = _objectWithoutProperties(_ref, _excluded);
|
51
51
|
|
52
|
-
var prefixCls = usePrefixCls('formily-group-panel'
|
52
|
+
var prefixCls = usePrefixCls('formily-group-panel', {
|
53
|
+
base: true
|
54
|
+
});
|
53
55
|
return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, props), {}, {
|
54
|
-
className: cls(prefixCls, props.className)
|
56
|
+
className: cls(prefixCls(), props.className)
|
55
57
|
}), xIndex !== 0 ? /*#__PURE__*/React.createElement("div", {
|
56
|
-
className:
|
58
|
+
className: prefixCls('divider')
|
57
59
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
58
|
-
className:
|
60
|
+
className: prefixCls('title')
|
59
61
|
}, title), children);
|
60
62
|
});
|
61
63
|
var FormGroup = observer(function (_ref2) {
|
62
64
|
var children = _ref2.children,
|
63
65
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
64
66
|
|
65
|
-
var prefixCls = usePrefixCls('formily-group'
|
67
|
+
var prefixCls = usePrefixCls('formily-group', {
|
68
|
+
base: true
|
69
|
+
});
|
66
70
|
var panels = usePanels();
|
67
71
|
return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, props), {}, {
|
68
|
-
className: cls(prefixCls, props.className)
|
72
|
+
className: cls(prefixCls(), props.className)
|
69
73
|
}), panels.map(function (_ref3, index) {
|
70
74
|
var props = _ref3.props,
|
71
75
|
schema = _ref3.schema,
|
@@ -96,10 +96,10 @@ var LightFilter = observer(function (props) {
|
|
96
96
|
|
97
97
|
var main = useMain(active);
|
98
98
|
var currentSchema = (_main$ = main[0]) === null || _main$ === void 0 ? void 0 : _main$.schema;
|
99
|
-
var
|
100
|
-
|
101
|
-
prefix: 'teamix-pro-form-light-filter'
|
99
|
+
var basePrefix = usePrefixCls('', {
|
100
|
+
base: true
|
102
101
|
});
|
102
|
+
var prefixCls = usePrefixCls('teamix-pro-form-light-filter');
|
103
103
|
var content = main.map(function (_ref, key) {
|
104
104
|
var schema = _ref.schema,
|
105
105
|
name = _ref.name;
|
@@ -114,16 +114,19 @@ var LightFilter = observer(function (props) {
|
|
114
114
|
onFilterChange && onFilterChange(value);
|
115
115
|
}, [onFilterChange]);
|
116
116
|
return /*#__PURE__*/React.createElement("span", {
|
117
|
-
className: cls(
|
117
|
+
className: cls(basePrefix(size), prefixCls({
|
118
|
+
'': true,
|
119
|
+
'input-category': isInputCategory(currentSchema)
|
120
|
+
}))
|
118
121
|
}, /*#__PURE__*/React.createElement("span", {
|
119
|
-
className:
|
122
|
+
className: prefixCls('main')
|
120
123
|
}, /*#__PURE__*/React.createElement(Select, _objectSpread(_objectSpread({}, filterProps), {}, {
|
121
|
-
className: cls(
|
124
|
+
className: cls(prefixCls('select'), filterProps === null || filterProps === void 0 ? void 0 : filterProps.className),
|
122
125
|
dataSource: filterItems,
|
123
126
|
onChange: onSelectChange,
|
124
127
|
value: active
|
125
128
|
})), content), /*#__PURE__*/React.createElement("span", {
|
126
|
-
className:
|
129
|
+
className: prefixCls('addonAfter')
|
127
130
|
}, /*#__PURE__*/React.createElement(Button, _objectSpread({}, buttonProps), /*#__PURE__*/React.createElement(TeamixIcon, {
|
128
131
|
type: "search-line"
|
129
132
|
}))));
|
@@ -20,11 +20,9 @@ var Text = function Text(_ref) {
|
|
20
20
|
className = _ref.className,
|
21
21
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
22
22
|
|
23
|
-
var prefixCls = usePrefixCls(''
|
24
|
-
prefix: 'teamix-pro-form-text'
|
25
|
-
});
|
23
|
+
var prefixCls = usePrefixCls('teamix-pro-form-text');
|
26
24
|
return /*#__PURE__*/React.createElement("span", _objectSpread({
|
27
|
-
className: cls(prefixCls, className)
|
25
|
+
className: cls(prefixCls(), className)
|
28
26
|
}, otherProps), children);
|
29
27
|
};
|
30
28
|
|
@@ -23,8 +23,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
23
23
|
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; }
|
24
24
|
|
25
25
|
import React, { memo, useMemo } from 'react';
|
26
|
-
import cls from '
|
27
|
-
import { usePrefixCls, getMessage } from '@teamix/utils';
|
26
|
+
import { usePrefixCls, getMessage, cls } from '@teamix/utils';
|
28
27
|
import ProForm from '../ProForm';
|
29
28
|
import { mergeArrayValue } from '../utils';
|
30
29
|
/**
|
@@ -43,9 +42,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
43
42
|
forceClear = props.forceClear,
|
44
43
|
otherProps = _objectWithoutProperties(props, _excluded);
|
45
44
|
|
46
|
-
var prefixCls = usePrefixCls(''
|
47
|
-
prefix: 'teamix-pro-form-query-filter-advanced'
|
48
|
-
});
|
45
|
+
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-advanced');
|
49
46
|
var gridSchema = useMemo(function () {
|
50
47
|
return [{
|
51
48
|
name: 'FormGrid',
|
@@ -98,7 +95,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
98
95
|
};
|
99
96
|
}, [layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
100
97
|
return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread(_objectSpread({
|
101
|
-
className: cls(prefixCls, props.className),
|
98
|
+
className: cls(prefixCls(), props.className),
|
102
99
|
schema: gridSchema,
|
103
100
|
feedbackLayout: "popover"
|
104
101
|
}, otherProps), getTeamixLayout), {}, {
|
package/es/form/Filter/Layout.js
CHANGED
@@ -17,10 +17,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
18
|
|
19
19
|
import React, { useCallback, useState } from 'react';
|
20
|
-
import cls from 'classnames';
|
21
20
|
import { Button, Badge } from '@alicloudfe/components';
|
22
21
|
import TeamixIcon from '@teamix/icon';
|
23
|
-
import { usePrefixCls, getMessage, isValid } from '@teamix/utils';
|
22
|
+
import { usePrefixCls, getMessage, isValid, cls } from '@teamix/utils';
|
24
23
|
import './layout.scss';
|
25
24
|
|
26
25
|
var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
@@ -33,9 +32,7 @@ var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
|
33
32
|
expand = _ref.expand,
|
34
33
|
onExpand = _ref.onExpand,
|
35
34
|
children = _ref.children;
|
36
|
-
var prefixCls = usePrefixCls(''
|
37
|
-
prefix: 'teamix-pro-form-query-filter-layout'
|
38
|
-
});
|
35
|
+
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-layout');
|
39
36
|
|
40
37
|
var _useState = useState(!!expand),
|
41
38
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -47,15 +44,15 @@ var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
|
47
44
|
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!visible);
|
48
45
|
}, [visible]);
|
49
46
|
return /*#__PURE__*/React.createElement("div", {
|
50
|
-
className: cls(prefixCls, className)
|
47
|
+
className: cls(prefixCls(), className)
|
51
48
|
}, /*#__PURE__*/React.createElement("div", {
|
52
|
-
className:
|
49
|
+
className: prefixCls('inline')
|
53
50
|
}, /*#__PURE__*/React.createElement("div", {
|
54
|
-
className:
|
51
|
+
className: prefixCls('left')
|
55
52
|
}, addonBefore ? /*#__PURE__*/React.createElement("div", {
|
56
|
-
className:
|
53
|
+
className: prefixCls('addonBefore')
|
57
54
|
}, addonBefore) : null, inlineContent, isValid(panelContent) ? /*#__PURE__*/React.createElement("div", {
|
58
|
-
className:
|
55
|
+
className: prefixCls('toggle')
|
59
56
|
}, /*#__PURE__*/React.createElement(Badge, {
|
60
57
|
count: count,
|
61
58
|
style: _objectSpread({
|
@@ -71,11 +68,13 @@ var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
|
71
68
|
}) : /*#__PURE__*/React.createElement(TeamixIcon, {
|
72
69
|
type: "filter-line"
|
73
70
|
}), getMessage('advancedFilter')))) : null), addonAfter ? /*#__PURE__*/React.createElement("div", {
|
74
|
-
className:
|
71
|
+
className: prefixCls('addonAfter')
|
75
72
|
}, addonAfter) : null), /*#__PURE__*/React.createElement("div", {
|
76
|
-
className: cls(
|
73
|
+
className: cls(prefixCls('panel', {
|
74
|
+
'panel-hidden': !(visible && isValid(panelContent))
|
75
|
+
}))
|
77
76
|
}, panelContent), /*#__PURE__*/React.createElement("div", {
|
78
|
-
className:
|
77
|
+
className: prefixCls('children')
|
79
78
|
}, children));
|
80
79
|
};
|
81
80
|
|
@@ -11,9 +11,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
11
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
12
|
|
13
13
|
import React, { memo, useMemo, useCallback, useRef, useEffect } from 'react';
|
14
|
-
import cls from 'classnames';
|
15
14
|
import { observable } from '@formily/reactive';
|
16
|
-
import { usePrefixCls } from '@teamix/utils';
|
15
|
+
import { usePrefixCls, cls } from '@teamix/utils';
|
17
16
|
import ProForm from '../ProForm';
|
18
17
|
/**
|
19
18
|
* 轻量筛选
|
@@ -32,9 +31,7 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
32
31
|
otherProps = _objectWithoutProperties(props, _excluded);
|
33
32
|
|
34
33
|
var filterValue = useRef(defaultFilterValue || (schema === null || schema === void 0 ? void 0 : (_schema$ = schema[0]) === null || _schema$ === void 0 ? void 0 : _schema$.name));
|
35
|
-
var prefixCls = usePrefixCls(''
|
36
|
-
prefix: 'teamix-pro-form-query-filter-light'
|
37
|
-
});
|
34
|
+
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-light');
|
38
35
|
var lightFilterObs = useMemo(function () {
|
39
36
|
return observable({
|
40
37
|
onFilter: function onFilter() {}
|
@@ -96,7 +93,7 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
96
93
|
lightFilterObs: lightFilterObs
|
97
94
|
}),
|
98
95
|
form: form,
|
99
|
-
className: cls(prefixCls, props.className),
|
96
|
+
className: cls(prefixCls(), props.className),
|
100
97
|
schema: LightSchema,
|
101
98
|
feedbackLayout: "none",
|
102
99
|
breakpoints: [],
|
@@ -11,8 +11,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
11
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; }
|
12
12
|
|
13
13
|
import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
14
|
-
import cls from '
|
15
|
-
import { usePrefixCls, isValid } from '@teamix/utils';
|
14
|
+
import { usePrefixCls, cls, isValid } from '@teamix/utils';
|
16
15
|
import ProForm from '../ProForm'; // 初始化Search组件,内置部分属性
|
17
16
|
|
18
17
|
var initializeSearch = function initializeSearch(schema) {
|
@@ -50,9 +49,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
50
49
|
onSubmit = props.onSubmit,
|
51
50
|
otherProps = _objectWithoutProperties(props, _excluded);
|
52
51
|
|
53
|
-
var prefixCls = usePrefixCls(''
|
54
|
-
prefix: 'teamix-pro-form-query-filter-simple'
|
55
|
-
});
|
52
|
+
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-simple');
|
56
53
|
|
57
54
|
var _initializeSearch = initializeSearch(schema),
|
58
55
|
searchName = _initializeSearch.searchName,
|
@@ -93,7 +90,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
93
90
|
searchValue.current = isValid(searchDefaultValue) ? searchDefaultValue : '';
|
94
91
|
}, []);
|
95
92
|
return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
|
96
|
-
className: cls(prefixCls, props.className),
|
93
|
+
className: cls(prefixCls(), props.className),
|
97
94
|
schema: simpleSchema,
|
98
95
|
feedbackLayout: "popover",
|
99
96
|
breakpoints: [],
|
package/es/form/Filter/index.js
CHANGED
@@ -35,12 +35,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
35
35
|
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; }
|
36
36
|
|
37
37
|
import React, { memo, useCallback, useMemo, useState, useRef, useEffect } from 'react';
|
38
|
-
import cls from 'classnames';
|
39
38
|
import debounce from 'lodash.debounce';
|
40
39
|
import { Tag } from '@alicloudfe/components';
|
41
40
|
import { createForm, onFormReact, onFormInputChange } from '@formily/core';
|
42
41
|
import { toJS } from '@formily/reactive';
|
43
|
-
import { usePrefixCls, isUsable, isNum } from '@teamix/utils';
|
42
|
+
import { usePrefixCls, isUsable, isNum, cls } from '@teamix/utils';
|
44
43
|
import ProField from '../../field/index';
|
45
44
|
import fieldTypeMap from '../fieldTypeMap';
|
46
45
|
import { getFormDisplayValues } from '../ProForm/useFormDisplayValues';
|
@@ -91,9 +90,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
91
90
|
var currentFormName = useRef(defaultFormName);
|
92
91
|
var currentForm = useRef();
|
93
92
|
var activeFilterValueRef = useRef();
|
94
|
-
var prefixCls = usePrefixCls(''
|
95
|
-
prefix: 'teamix-pro-form-query-filter'
|
96
|
-
});
|
93
|
+
var prefixCls = usePrefixCls('teamix-pro-form-query-filter');
|
97
94
|
var debounceFun = debounce(function (fun, props) {
|
98
95
|
return fun(props);
|
99
96
|
}, filterDebounce); // 绑定URL
|
@@ -507,14 +504,16 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
507
504
|
setCurrentForm(currentFormName.current);
|
508
505
|
}, []);
|
509
506
|
return /*#__PURE__*/React.createElement(QueryFilterLayout, {
|
510
|
-
className: cls(prefixCls, props.className),
|
507
|
+
className: cls(prefixCls(), props.className),
|
511
508
|
addonBefore: addonBefore,
|
512
509
|
addonAfter: addonAfter,
|
513
510
|
expand: panelVisible,
|
514
511
|
onExpand: toggleAdvancedFilter,
|
515
512
|
count: tagDataSource.length,
|
516
513
|
inlineContent: mode === 'panel' ? /*#__PURE__*/React.createElement("div", {
|
517
|
-
className: cls(
|
514
|
+
className: cls(prefixCls('inline', {
|
515
|
+
'inline-hidden': purePanel || hasRequired
|
516
|
+
}))
|
518
517
|
}, /*#__PURE__*/React.createElement(LightFilter, _objectSpread(_objectSpread({}, otherProps), {}, {
|
519
518
|
defaultFilterValue: defaultFilterValue,
|
520
519
|
filterValues: filterValues,
|
@@ -522,7 +521,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
522
521
|
form: lightForm,
|
523
522
|
onChange: onLightChange
|
524
523
|
}))) : /*#__PURE__*/React.createElement("div", {
|
525
|
-
className:
|
524
|
+
className: prefixCls('inline')
|
526
525
|
}, /*#__PURE__*/React.createElement(SimpleFilter, _objectSpread(_objectSpread({}, otherProps), {}, {
|
527
526
|
form: simpleForm,
|
528
527
|
onChange: onSimpleChange,
|
@@ -548,9 +547,9 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
548
547
|
return onTagClose(key, index);
|
549
548
|
}
|
550
549
|
}, /*#__PURE__*/React.createElement("span", {
|
551
|
-
className:
|
550
|
+
className: prefixCls('tag-title')
|
552
551
|
}, label), /*#__PURE__*/React.createElement("span", {
|
553
|
-
className:
|
552
|
+
className: prefixCls('tag-content')
|
554
553
|
}, /*#__PURE__*/React.createElement(ProField, {
|
555
554
|
type: type,
|
556
555
|
value: value
|
package/es/form/Filter/index2.js
CHANGED
@@ -23,8 +23,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
23
23
|
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; }
|
24
24
|
|
25
25
|
import React, { memo, useMemo } from 'react';
|
26
|
-
import cls from '
|
27
|
-
import { usePrefixCls, getMessage } from '@teamix/utils';
|
26
|
+
import { usePrefixCls, getMessage, cls } from '@teamix/utils';
|
28
27
|
import { createForm } from '@formily/core';
|
29
28
|
import ProForm from '../ProForm';
|
30
29
|
import { mergeArrayValue } from '../utils';
|
@@ -55,9 +54,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
55
54
|
onFilter = props.onFilter,
|
56
55
|
otherProps = _objectWithoutProperties(props, _excluded);
|
57
56
|
|
58
|
-
var prefixCls = usePrefixCls(''
|
59
|
-
prefix: 'teamix-pro-form-filter-simple'
|
60
|
-
});
|
57
|
+
var prefixCls = usePrefixCls('teamix-pro-form-filter-simple');
|
61
58
|
var simpleSchema = useMemo(function () {
|
62
59
|
return [{
|
63
60
|
component: 'FormFlex',
|
@@ -82,7 +79,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
|
|
82
79
|
breakpoints: [],
|
83
80
|
inset: true
|
84
81
|
}, otherProps), eventProps), {}, {
|
85
|
-
className: cls(prefixCls, props.className),
|
82
|
+
className: cls(prefixCls(), props.className),
|
86
83
|
schema: simpleSchema
|
87
84
|
}));
|
88
85
|
});
|
@@ -106,9 +103,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
106
103
|
wrapperAlign = props.wrapperAlign,
|
107
104
|
labelCol = props.labelCol,
|
108
105
|
wrapperCol = props.wrapperCol;
|
109
|
-
var prefixCls = usePrefixCls(''
|
110
|
-
prefix: 'teamix-pro-form-filter-advanced'
|
111
|
-
});
|
106
|
+
var prefixCls = usePrefixCls('teamix-pro-form-filter-advanced');
|
112
107
|
var gridSchema = useMemo(function () {
|
113
108
|
return [{
|
114
109
|
name: 'FormGrid',
|
@@ -168,7 +163,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
168
163
|
feedbackLayout: "popover"
|
169
164
|
}, props), eventProps), getTeamixLayout), {}, {
|
170
165
|
form: form,
|
171
|
-
className: cls(prefixCls, props.className),
|
166
|
+
className: cls(prefixCls(), props.className),
|
172
167
|
schema: gridSchema,
|
173
168
|
onSubmit: onFilter
|
174
169
|
}));
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import React from 'react';
|
2
|
+
import type { ProFormProps } from '../typing';
|
2
3
|
import './index.scss';
|
3
|
-
declare const ProForm:
|
4
|
+
declare const ProForm: React.FC<ProFormProps>;
|
4
5
|
export default ProForm;
|