@sooloer/pages 0.1.15 → 0.1.16
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["label", "name", "type", "collapsed", "widgetProps", "labelWidth", "fieldRender", "required"],
|
|
2
|
+
var _excluded = ["label", "name", "hideLabel", "type", "collapsed", "widgetProps", "labelWidth", "fieldRender", "required"],
|
|
3
3
|
_excluded2 = ["placeholder", "options"];
|
|
4
4
|
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); }
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -22,6 +22,8 @@ var Field = function Field(_ref) {
|
|
|
22
22
|
var _ref$label = _ref.label,
|
|
23
23
|
label = _ref$label === void 0 ? '' : _ref$label,
|
|
24
24
|
name = _ref.name,
|
|
25
|
+
_ref$hideLabel = _ref.hideLabel,
|
|
26
|
+
hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
25
27
|
_ref$type = _ref.type,
|
|
26
28
|
type = _ref$type === void 0 ? 'input' : _ref$type,
|
|
27
29
|
collapsed = _ref.collapsed,
|
|
@@ -133,8 +135,10 @@ var Field = function Field(_ref) {
|
|
|
133
135
|
};
|
|
134
136
|
return /*#__PURE__*/React.createElement(Item, _extends({}, argField, {
|
|
135
137
|
name: name,
|
|
136
|
-
required: required
|
|
137
|
-
|
|
138
|
+
required: required
|
|
139
|
+
}, !hideLabel && {
|
|
140
|
+
label: labelRender()
|
|
141
|
+
}, {
|
|
138
142
|
className: "sooloer-filter-field-item",
|
|
139
143
|
labelCol: {
|
|
140
144
|
flex: "".concat(labelWidth, "px")
|
package/dist/filter/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["fields", "maskable", "labelWidth", "resetText", "searchText", "resetButtonProps", "searchButtonProps", "initialValues", "gridColumns", "values", "wrappRef", "onReset", "onSearch", "onExpandChange", "onValuesChange"],
|
|
2
|
+
var _excluded = ["fields", "maskable", "hideLabel", "labelWidth", "resetText", "searchText", "resetButtonProps", "searchButtonProps", "initialValues", "gridColumns", "values", "wrappRef", "onReset", "onSearch", "onExpandChange", "onValuesChange"],
|
|
3
3
|
_excluded2 = ["disabled"];
|
|
4
4
|
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); }
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -19,7 +19,7 @@ import { DownOutlined } from '@ant-design/icons';
|
|
|
19
19
|
import { calculator, sum } from '@tmaito/utils';
|
|
20
20
|
import { Button, Col, Form, Row, Space, Tooltip } from 'antd';
|
|
21
21
|
import classnames from 'classnames';
|
|
22
|
-
import React, { forwardRef, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
23
23
|
import AutoSize from 'react-virtualized-auto-sizer';
|
|
24
24
|
import Field from "./components/field";
|
|
25
25
|
import "./index.less";
|
|
@@ -32,6 +32,8 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
32
32
|
fields = _props$fields === void 0 ? [] : _props$fields,
|
|
33
33
|
_props$maskable = props.maskable,
|
|
34
34
|
maskable = _props$maskable === void 0 ? true : _props$maskable,
|
|
35
|
+
_props$hideLabel = props.hideLabel,
|
|
36
|
+
hideLabel = _props$hideLabel === void 0 ? false : _props$hideLabel,
|
|
35
37
|
_props$labelWidth = props.labelWidth,
|
|
36
38
|
labelWidth = _props$labelWidth === void 0 ? 98 : _props$labelWidth,
|
|
37
39
|
_props$resetText = props.resetText,
|
|
@@ -44,7 +46,8 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
44
46
|
searchButtonProps = _props$searchButtonPr === void 0 ? {} : _props$searchButtonPr,
|
|
45
47
|
_props$initialValues = props.initialValues,
|
|
46
48
|
initialValues = _props$initialValues === void 0 ? {} : _props$initialValues,
|
|
47
|
-
gridColumns = props.gridColumns,
|
|
49
|
+
_props$gridColumns = props.gridColumns,
|
|
50
|
+
gridColumns = _props$gridColumns === void 0 ? 4 : _props$gridColumns,
|
|
48
51
|
_props$values = props.values,
|
|
49
52
|
values = _props$values === void 0 ? {} : _props$values,
|
|
50
53
|
wrappRef = props.wrappRef,
|
|
@@ -70,6 +73,9 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
70
73
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
74
|
span = _useState6[0],
|
|
72
75
|
setSpan = _useState6[1];
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
setSpan(gridColumns);
|
|
78
|
+
}, []);
|
|
73
79
|
useImperativeHandle(ref, function () {
|
|
74
80
|
return {
|
|
75
81
|
form: form
|
|
@@ -265,7 +271,8 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
265
271
|
maxWidth: calcFieldSpan(item)
|
|
266
272
|
}
|
|
267
273
|
}, /*#__PURE__*/React.createElement(Field, _extends({}, item, {
|
|
268
|
-
labelWidth: labelWidth
|
|
274
|
+
labelWidth: labelWidth,
|
|
275
|
+
hideLabel: hideLabel
|
|
269
276
|
})));
|
|
270
277
|
}), /*#__PURE__*/React.createElement(Col, {
|
|
271
278
|
flex: "auto"
|
|
@@ -356,7 +363,8 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
356
363
|
maxWidth: calcFieldSpan(item)
|
|
357
364
|
}
|
|
358
365
|
}, /*#__PURE__*/React.createElement(Field, _extends({}, item, {
|
|
359
|
-
labelWidth: labelWidth
|
|
366
|
+
labelWidth: labelWidth,
|
|
367
|
+
hideLabel: hideLabel
|
|
360
368
|
})));
|
|
361
369
|
}), moreFixedFields.map(function (item) {
|
|
362
370
|
return /*#__PURE__*/React.createElement(Col, {
|
|
@@ -369,7 +377,8 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
369
377
|
maxWidth: calcFieldSpan(item)
|
|
370
378
|
}
|
|
371
379
|
}, /*#__PURE__*/React.createElement(Field, _extends({}, item, {
|
|
372
|
-
labelWidth: labelWidth
|
|
380
|
+
labelWidth: labelWidth,
|
|
381
|
+
hideLabel: hideLabel
|
|
373
382
|
})));
|
|
374
383
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
375
384
|
className: classnames('sooloer-filter-field-more', {
|
|
@@ -389,7 +398,8 @@ var ProFilter = function ProFilter(props, ref) {
|
|
|
389
398
|
maxWidth: calcFieldSpan(item)
|
|
390
399
|
}
|
|
391
400
|
}, /*#__PURE__*/React.createElement(Field, _extends({}, item, {
|
|
392
|
-
labelWidth: labelWidth
|
|
401
|
+
labelWidth: labelWidth,
|
|
402
|
+
hideLabel: hideLabel
|
|
393
403
|
})));
|
|
394
404
|
})))))), maskable && (wrappRef === null || wrappRef === void 0 ? void 0 : wrappRef.current) && /*#__PURE__*/React.createElement("div", {
|
|
395
405
|
onClick: function onClick() {
|
package/dist/filter/typing.d.ts
CHANGED