@lemon-fe/components 0.1.67 → 0.1.68

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.
@@ -376,7 +376,7 @@ function Filter(props) {
376
376
 
377
377
  var _useMemo = useMemo(function () {
378
378
  var result = data.filter(function (item) {
379
- if (activeKeys.has(item.key) && compMap.has(item.type)) {
379
+ if (activeKeys.has(item.key)) {
380
380
  return true;
381
381
  }
382
382
 
@@ -391,7 +391,9 @@ function Filter(props) {
391
391
  var currRow = [];
392
392
  var value = 0;
393
393
  result.forEach(function (item) {
394
- var itemWidth = getColStyle(item.colSpan || compMap.get(item.type).colSpan).width;
394
+ var _compMap$get;
395
+
396
+ var itemWidth = getColStyle(item.colSpan || (item.type ? (_compMap$get = compMap.get(item.type)) === null || _compMap$get === void 0 ? void 0 : _compMap$get.colSpan : 1)).width;
395
397
 
396
398
  if (value + itemWidth > width) {
397
399
  if (currRow.length > 0) {
@@ -470,12 +472,27 @@ function Filter(props) {
470
472
  }), /*#__PURE__*/React.createElement(FormLayout, {
471
473
  direction: "row"
472
474
  }, cols.map(function (item) {
475
+ if (item.renderFormItem) {
476
+ return /*#__PURE__*/React.createElement("div", {
477
+ style: getColStyle(item.colSpan),
478
+ key: item.key
479
+ }, item.renderFormItem());
480
+ }
481
+
482
+ if (!item.type) {
483
+ return null;
484
+ }
485
+
473
486
  var target = compMap.get(item.type);
487
+
488
+ if (target === undefined) {
489
+ return null;
490
+ }
491
+
474
492
  return /*#__PURE__*/React.createElement("div", {
475
493
  style: getColStyle(item.colSpan || target.colSpan),
476
494
  key: item.key
477
495
  }, /*#__PURE__*/React.createElement(Form.Item, {
478
- key: item.key,
479
496
  name: item.key,
480
497
  label: item.hideLabel ? undefined : item.label
481
498
  }, target.render(item)));
@@ -1,13 +1,14 @@
1
1
  import type { FormInstance } from 'antd';
2
- import type { CSSProperties, ReactNode } from 'react';
2
+ import type { CSSProperties, ReactElement, ReactNode } from 'react';
3
3
 
4
4
  export interface FilterItemType {
5
5
  key: string;
6
6
  label?: string;
7
- type: string;
7
+ type?: string;
8
8
  colSpan?: number;
9
9
  hideLabel?: boolean;
10
10
  extraProps?: Record<string, any>;
11
+ renderFormItem?: () => ReactElement;
11
12
  }
12
13
 
13
14
  export interface FilterProps<T extends Record<string, any> = Record<string, any>> {
package/es/overrides.less CHANGED
@@ -170,6 +170,10 @@ a[title='站长统计'] {
170
170
  font-size: 16px;
171
171
  }
172
172
 
173
+ .ant-select-sm .ant-select-arrow {
174
+ font-size: 14px;
175
+ }
176
+
173
177
  /** input */
174
178
  @input-padding-horizontal-base: 8px;
175
179
  @input-icon-color: rgba(51, 51, 51, 0.7);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -41,5 +41,5 @@
41
41
  "react": "^17.0.2",
42
42
  "react-dom": "^17.0.2"
43
43
  },
44
- "gitHead": "1fe5e8d52171f59161e288c4bfc6cea56fd5a4d8"
44
+ "gitHead": "c78284f7973b457f109c8b655a3d67c8ffca6d67"
45
45
  }