iglooform 2.5.3 → 2.5.6

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,31 +1,19 @@
1
+ import { ButtonProps } from 'antd/lib/button';
1
2
  import { FC, IglooComponentProps } from '../types';
2
3
  import './style';
3
4
  import { ComponentProps } from '../utils/option-utils';
4
- declare const SearchBox: FC<import("../utils/option-utils").HOCProps & IglooComponentProps & {
5
- className?: string | undefined;
5
+ declare type IProps = IglooComponentProps & {
6
+ className?: string;
6
7
  onSearch?: any;
7
8
  value?: any;
8
- multiple?: boolean | undefined;
9
- modalTitle?: string | undefined;
10
- placeHolder?: string | undefined;
11
- modalPlaceHolder?: string | undefined;
12
- optionsUpdating?: boolean | undefined;
9
+ multiple?: boolean;
10
+ modalTitle?: string;
11
+ placeHolder?: string;
12
+ modalPlaceHolder?: string;
13
+ optionsUpdating?: boolean;
13
14
  onChange?: any;
14
- okButtonProps?: Partial<{
15
- href: string;
16
- target?: string | undefined;
17
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
18
- } & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "onClick" | "type"> & {
19
- htmlType?: "button" | "submit" | "reset" | undefined;
20
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
21
- } & Omit<import("react").ButtonHTMLAttributes<any>, "onClick" | "type">> | undefined;
22
- cancelButtonProps?: Partial<{
23
- href: string;
24
- target?: string | undefined;
25
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
26
- } & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "onClick" | "type"> & {
27
- htmlType?: "button" | "submit" | "reset" | undefined;
28
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
29
- } & Omit<import("react").ButtonHTMLAttributes<any>, "onClick" | "type">> | undefined;
30
- } & ComponentProps>;
15
+ okButtonProps?: ButtonProps;
16
+ cancelButtonProps?: ButtonProps;
17
+ } & ComponentProps;
18
+ declare const SearchBox: FC<IProps>;
31
19
  export default SearchBox;
@@ -31,11 +31,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
31
31
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
32
32
  import classnames from 'classnames';
33
33
  import { SearchOutlined, LoadingOutlined, ArrowLeftOutlined } from 'iglooicon';
34
- import Modal from '@/modal';
35
- import Input from '@/input';
36
- import CheckBox from '@/checkbox';
37
- import Typography from '@/typography';
38
- import Button from '@/button';
34
+ import Modal from '../modal';
35
+ import Input from '../input';
36
+ import CheckBox from '../checkbox';
37
+ import Typography from '../typography';
38
+ import Button from '../button';
39
39
  import { LocaleContext } from '../locale';
40
40
  import { useState, useContext, useEffect, useMemo } from 'react';
41
41
  import './style';
@@ -108,6 +108,10 @@ export function optionsHOC(Component) {
108
108
  }, [optionsFromGetOptions]);
109
109
  invariant(datasourceKey && selectDatasourceApi || !datasourceKey, 'Please provide selectDatasourceApi in Form props');
110
110
  useEffect(function () {
111
+ if (Array.isArray(optionsFromGetOptions)) {
112
+ return;
113
+ }
114
+
111
115
  setUpdating(true);
112
116
 
113
117
  var calcOptions = /*#__PURE__*/function () {
@@ -222,7 +226,7 @@ export function optionsHOC(Component) {
222
226
 
223
227
  setUpdating(false);
224
228
  });
225
- }, [options, optionGroups, dependFieldValue, searchKey]);
229
+ }, [options, optionsFromGetOptions, optionGroups, dependFieldValue, searchKey]);
226
230
  return _options ? _jsx(Component, _objectSpread(_objectSpread({
227
231
  options: _options
228
232
  }, rest), {}, {
@@ -1,31 +1,19 @@
1
+ import { ButtonProps } from 'antd/lib/button';
1
2
  import { FC, IglooComponentProps } from '../types';
2
3
  import './style';
3
4
  import { ComponentProps } from '../utils/option-utils';
4
- declare const SearchBox: FC<import("../utils/option-utils").HOCProps & IglooComponentProps & {
5
- className?: string | undefined;
5
+ declare type IProps = IglooComponentProps & {
6
+ className?: string;
6
7
  onSearch?: any;
7
8
  value?: any;
8
- multiple?: boolean | undefined;
9
- modalTitle?: string | undefined;
10
- placeHolder?: string | undefined;
11
- modalPlaceHolder?: string | undefined;
12
- optionsUpdating?: boolean | undefined;
9
+ multiple?: boolean;
10
+ modalTitle?: string;
11
+ placeHolder?: string;
12
+ modalPlaceHolder?: string;
13
+ optionsUpdating?: boolean;
13
14
  onChange?: any;
14
- okButtonProps?: Partial<{
15
- href: string;
16
- target?: string | undefined;
17
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
18
- } & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "onClick" | "type"> & {
19
- htmlType?: "button" | "submit" | "reset" | undefined;
20
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
21
- } & Omit<import("react").ButtonHTMLAttributes<any>, "onClick" | "type">> | undefined;
22
- cancelButtonProps?: Partial<{
23
- href: string;
24
- target?: string | undefined;
25
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
26
- } & import("antd/lib/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<any>, "onClick" | "type"> & {
27
- htmlType?: "button" | "submit" | "reset" | undefined;
28
- onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
29
- } & Omit<import("react").ButtonHTMLAttributes<any>, "onClick" | "type">> | undefined;
30
- } & ComponentProps>;
15
+ okButtonProps?: ButtonProps;
16
+ cancelButtonProps?: ButtonProps;
17
+ } & ComponentProps;
18
+ declare const SearchBox: FC<IProps>;
31
19
  export default SearchBox;
@@ -15,15 +15,15 @@ var _classnames2 = _interopRequireDefault(require("classnames"));
15
15
 
16
16
  var _iglooicon = require("iglooicon");
17
17
 
18
- var _modal = _interopRequireDefault(require("@/modal"));
18
+ var _modal = _interopRequireDefault(require("../modal"));
19
19
 
20
- var _input = _interopRequireDefault(require("@/input"));
20
+ var _input = _interopRequireDefault(require("../input"));
21
21
 
22
- var _checkbox = _interopRequireDefault(require("@/checkbox"));
22
+ var _checkbox = _interopRequireDefault(require("../checkbox"));
23
23
 
24
- var _typography = _interopRequireDefault(require("@/typography"));
24
+ var _typography = _interopRequireDefault(require("../typography"));
25
25
 
26
- var _button = _interopRequireDefault(require("@/button"));
26
+ var _button = _interopRequireDefault(require("../button"));
27
27
 
28
28
  var _locale = require("../locale");
29
29
 
@@ -125,6 +125,10 @@ function optionsHOC(Component) {
125
125
  }, [optionsFromGetOptions]);
126
126
  (0, _invariant.default)(datasourceKey && selectDatasourceApi || !datasourceKey, 'Please provide selectDatasourceApi in Form props');
127
127
  (0, _react.useEffect)(function () {
128
+ if (Array.isArray(optionsFromGetOptions)) {
129
+ return;
130
+ }
131
+
128
132
  setUpdating(true);
129
133
 
130
134
  var calcOptions = /*#__PURE__*/function () {
@@ -239,7 +243,7 @@ function optionsHOC(Component) {
239
243
 
240
244
  setUpdating(false);
241
245
  });
242
- }, [options, optionGroups, dependFieldValue, searchKey]);
246
+ }, [options, optionsFromGetOptions, optionGroups, dependFieldValue, searchKey]);
243
247
  return _options ? (0, _jsxRuntime.jsx)(Component, _objectSpread(_objectSpread({
244
248
  options: _options
245
249
  }, rest), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.5.3",
3
+ "version": "2.5.6",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",