iglooform 3.7.0 → 3.7.1

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.
@@ -30,7 +30,7 @@ export default function DumiContextWrapper() {
30
30
 
31
31
  return (
32
32
  <SiteContext.Provider value={{
33
- pkg: {"name":"iglooform","version":"3.5.0","license":"MIT"},
33
+ pkg: {"name":"iglooform","version":"3.7.0","license":"MIT"},
34
34
  historyType: "browser",
35
35
  entryExports,
36
36
  demos,
@@ -99,6 +99,9 @@ var IglooSelect = function IglooSelect(_ref) {
99
99
  var value = e.target.value;
100
100
  var filteredOptions = options.filter(function (option) {
101
101
  var _option$label, _option$label$toStrin;
102
+ if (typeof filterOption === 'function') {
103
+ return filterOption(value, option);
104
+ }
102
105
  return Boolean(option === null || option === void 0 ? void 0 : (_option$label = option.label) === null || _option$label === void 0 ? void 0 : (_option$label$toStrin = _option$label.toString()) === null || _option$label$toStrin === void 0 ? void 0 : _option$label$toStrin.includes(value));
103
106
  });
104
107
  setDisplay(filteredOptions);
@@ -104,6 +104,9 @@ var IglooSelect = function IglooSelect(_ref) {
104
104
  var value = e.target.value;
105
105
  var filteredOptions = options.filter(function (option) {
106
106
  var _option$label, _option$label$toStrin;
107
+ if (typeof filterOption === 'function') {
108
+ return filterOption(value, option);
109
+ }
107
110
  return Boolean(option === null || option === void 0 ? void 0 : (_option$label = option.label) === null || _option$label === void 0 ? void 0 : (_option$label$toStrin = _option$label.toString()) === null || _option$label$toStrin === void 0 ? void 0 : _option$label$toStrin.includes(value));
108
111
  });
109
112
  setDisplay(filteredOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
@@ -1,12 +0,0 @@
1
- import { FC } from 'react';
2
- import { FormItemConfig, FormItemName } from '../../types';
3
- import './style';
4
- interface ElementProps {
5
- config: FormItemConfig;
6
- parentName?: FormItemName;
7
- preview?: boolean;
8
- disabled?: boolean;
9
- setShowStepButton?: (showButton: boolean) => void;
10
- }
11
- declare const Element: FC<ElementProps>;
12
- export default Element;
@@ -1,19 +0,0 @@
1
- import { Select } from 'antd';
2
- import { SelectProps as AntdSelectProps, SelectValue, DefaultOptionType } from 'antd/es/select';
3
- import { FC, IglooComponentProps } from '../types';
4
- import './style';
5
- type FilterOption = (inputValue: string, option?: DefaultOptionType) => boolean;
6
- interface SelectProps extends Omit<AntdSelectProps<SelectValue>, 'showSearch'> {
7
- showSearch?: boolean | {
8
- filterOption: FilterOption;
9
- };
10
- }
11
- type Props = SelectProps & IglooComponentProps;
12
- type OptionType = typeof Select.Option;
13
- type OptGroupType = typeof Select.OptGroup;
14
- interface IglooSelectType extends FC<Props> {
15
- Option: OptionType;
16
- OptGroup: OptGroupType;
17
- }
18
- declare const IglooSelect: IglooSelectType;
19
- export default IglooSelect;
@@ -1,12 +0,0 @@
1
- import { FC } from 'react';
2
- import { FormItemConfig, FormItemName } from '../../types';
3
- import './style';
4
- interface ElementProps {
5
- config: FormItemConfig;
6
- parentName?: FormItemName;
7
- preview?: boolean;
8
- disabled?: boolean;
9
- setShowStepButton?: (showButton: boolean) => void;
10
- }
11
- declare const Element: FC<ElementProps>;
12
- export default Element;
@@ -1,19 +0,0 @@
1
- import { Select } from 'antd';
2
- import { SelectProps as AntdSelectProps, SelectValue, DefaultOptionType } from 'antd/es/select';
3
- import { FC, IglooComponentProps } from '../types';
4
- import './style';
5
- type FilterOption = (inputValue: string, option?: DefaultOptionType) => boolean;
6
- interface SelectProps extends Omit<AntdSelectProps<SelectValue>, 'showSearch'> {
7
- showSearch?: boolean | {
8
- filterOption: FilterOption;
9
- };
10
- }
11
- type Props = SelectProps & IglooComponentProps;
12
- type OptionType = typeof Select.Option;
13
- type OptGroupType = typeof Select.OptGroup;
14
- interface IglooSelectType extends FC<Props> {
15
- Option: OptionType;
16
- OptGroup: OptGroupType;
17
- }
18
- declare const IglooSelect: IglooSelectType;
19
- export default IglooSelect;