iglooform 2.5.4 → 2.5.7

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.
Files changed (77) hide show
  1. package/es/checkbox/index.d.ts +7 -7
  2. package/es/checkbox/index.js +85 -5
  3. package/es/filter/checkBox.d.ts +4 -3
  4. package/es/filter/checkBox.js +31 -7
  5. package/es/filter/index.js +4 -2
  6. package/es/filter/radioBox.d.ts +2 -1
  7. package/es/filter/radioBox.js +24 -3
  8. package/es/form/elements.js +3 -1
  9. package/es/index.d.ts +1 -0
  10. package/es/index.js +1 -0
  11. package/es/input/amount.js +14 -3
  12. package/es/input/input-number.js +14 -3
  13. package/es/locale/en-US/messages.json +4 -0
  14. package/es/locale/id-ID/messages.json +4 -0
  15. package/es/locale/th-TH/messages.json +4 -0
  16. package/es/locale/vi-VN/messages.json +4 -0
  17. package/es/locale/zh-CN/messages.json +4 -0
  18. package/es/locale/zh-TW/messages.json +5 -0
  19. package/es/media/media.js +6 -3
  20. package/es/media/preview.js +13 -13
  21. package/es/radio/index.d.ts +6 -6
  22. package/es/radio/index.js +79 -22
  23. package/es/radio/radio-group-with-other.d.ts +1 -1
  24. package/es/radio/radio-group-with-other.js +41 -4
  25. package/es/radio/style/empty.svg +12 -0
  26. package/es/search-box/index.d.ts +19 -0
  27. package/es/search-box/index.js +266 -0
  28. package/es/search-box/style/index.d.ts +1 -0
  29. package/es/search-box/style/index.js +1 -0
  30. package/es/search-box/style/index.less +162 -0
  31. package/es/select/attached-select.d.ts +2 -12
  32. package/es/select/attached-select.js +27 -186
  33. package/es/select/style/index.less +1 -0
  34. package/es/upload-photo/index.js +33 -32
  35. package/es/upload-photo/media.js +6 -7
  36. package/es/upload-preview/media.js +13 -13
  37. package/es/utils/option-utils.d.ts +24 -0
  38. package/es/utils/option-utils.js +237 -0
  39. package/lib/checkbox/index.d.ts +7 -7
  40. package/lib/checkbox/index.js +87 -5
  41. package/lib/filter/checkBox.d.ts +4 -3
  42. package/lib/filter/checkBox.js +31 -7
  43. package/lib/filter/index.js +4 -2
  44. package/lib/filter/radioBox.d.ts +2 -1
  45. package/lib/filter/radioBox.js +24 -3
  46. package/lib/form/elements.js +4 -1
  47. package/lib/index.d.ts +1 -0
  48. package/lib/index.js +9 -0
  49. package/lib/input/amount.js +14 -3
  50. package/lib/input/input-number.js +14 -3
  51. package/lib/locale/en-US/messages.json +4 -0
  52. package/lib/locale/id-ID/messages.json +4 -0
  53. package/lib/locale/th-TH/messages.json +4 -0
  54. package/lib/locale/vi-VN/messages.json +4 -0
  55. package/lib/locale/zh-CN/messages.json +4 -0
  56. package/lib/locale/zh-TW/messages.json +5 -0
  57. package/lib/media/media.js +6 -3
  58. package/lib/media/preview.js +13 -15
  59. package/lib/radio/index.d.ts +6 -6
  60. package/lib/radio/index.js +83 -22
  61. package/lib/radio/radio-group-with-other.d.ts +1 -1
  62. package/lib/radio/radio-group-with-other.js +41 -3
  63. package/lib/radio/style/empty.svg +12 -0
  64. package/lib/search-box/index.d.ts +19 -0
  65. package/lib/search-box/index.js +287 -0
  66. package/lib/search-box/style/index.d.ts +1 -0
  67. package/lib/search-box/style/index.js +3 -0
  68. package/lib/search-box/style/index.less +162 -0
  69. package/lib/select/attached-select.d.ts +2 -12
  70. package/lib/select/attached-select.js +26 -186
  71. package/lib/select/style/index.less +1 -0
  72. package/lib/upload-photo/index.js +33 -32
  73. package/lib/upload-photo/media.js +6 -9
  74. package/lib/upload-preview/media.js +13 -13
  75. package/lib/utils/option-utils.d.ts +24 -0
  76. package/lib/utils/option-utils.js +254 -0
  77. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
1
  import { CheckboxProps, CheckboxGroupProps } from 'antd/es/checkbox';
2
2
  import { FC, IglooComponentProps } from '@/types';
3
+ import { ComponentProps } from '../utils/option-utils';
4
+ import { DefaultOptionType } from 'rc-select/lib/Select';
3
5
  import './style/index.less';
4
6
  interface Props extends IglooComponentProps, CheckboxProps {
5
7
  }
6
- interface Option {
7
- label?: any;
8
- value?: string;
9
- disabled?: boolean;
8
+ export interface Option extends DefaultOptionType {
10
9
  extraInfo?: {
11
10
  content: any;
12
11
  shownTrigger: 'unchecked' | 'checked' | 'all';
13
12
  };
14
13
  }
15
- export interface IProps extends IglooComponentProps, Omit<CheckboxGroupProps, 'options'> {
16
- options: Option[];
14
+ export interface IProps extends IglooComponentProps, Omit<CheckboxGroupProps, 'options'>, ComponentProps {
17
15
  className?: string;
16
+ radioType?: string;
17
+ options: Option[];
18
18
  }
19
19
  declare const IglooCheckbox: FC<Props>;
20
20
  export default IglooCheckbox;
21
- export declare const CheckboxGroup: FC<IProps>;
21
+ export declare const CheckboxGroup: FC<import("../utils/option-utils").HOCProps & IProps>;
@@ -4,9 +4,21 @@ import "antd/es/row/style";
4
4
  import _Row from "antd/es/row";
5
5
  import "antd/es/checkbox/style";
6
6
  import _Checkbox from "antd/es/checkbox";
7
- var _excluded = ["className", "options", "value"],
7
+ var _excluded = ["className", "options", "value", "clearWhenOptionsUpdated"],
8
8
  _excluded2 = ["label", "value", "extraInfo"];
9
9
 
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+
18
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19
+
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+
10
22
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
23
 
12
24
  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; }
@@ -18,10 +30,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
18
30
  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; }
19
31
 
20
32
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
33
+ import { useState, useEffect, useRef, useContext } from 'react';
21
34
  import Typography from '../typography';
22
35
  import formMethods from '../utils/form-methods';
23
36
  import omit from 'omit.js';
24
37
  import classnames from 'classnames';
38
+ import { compareOptions, optionsHOC } from '../utils/option-utils';
39
+ import LocaleContext from '../locale/locale-context';
40
+ import emptyIcon from '../radio/style/empty.svg';
25
41
  import './style/index.less';
26
42
 
27
43
  var IglooCheckbox = function IglooCheckbox(props) {
@@ -38,17 +54,55 @@ IglooCheckbox.formItemPropsHandler = function (config) {
38
54
  };
39
55
 
40
56
  export default IglooCheckbox;
41
- export var CheckboxGroup = function CheckboxGroup(_ref) {
57
+
58
+ var InnerCheckboxGroup = function InnerCheckboxGroup(_ref) {
42
59
  var className = _ref.className,
43
60
  _ref$options = _ref.options,
44
61
  options = _ref$options === void 0 ? [] : _ref$options,
45
62
  value = _ref.value,
63
+ _ref$clearWhenOptions = _ref.clearWhenOptionsUpdated,
64
+ clearWhenOptionsUpdated = _ref$clearWhenOptions === void 0 ? false : _ref$clearWhenOptions,
46
65
  rest = _objectWithoutProperties(_ref, _excluded);
47
66
 
48
- return _jsx(_Checkbox.Group, _objectSpread(_objectSpread({}, omit(rest, formMethods)), {}, {
67
+ var _useState = useState(value),
68
+ _useState2 = _slicedToArray(_useState, 2),
69
+ selected = _useState2[0],
70
+ setSelected = _useState2[1];
71
+
72
+ var originOptions = useRef(options);
73
+
74
+ var _useContext = useContext(LocaleContext),
75
+ formatMessage = _useContext.formatMessage;
76
+
77
+ useEffect(function () {
78
+ typeof rest.onChange === 'function' && value !== selected && rest.onChange(selected);
79
+ }, [selected]);
80
+ useEffect(function () {
81
+ setSelected(value);
82
+ }, [value]);
83
+ useEffect(function () {
84
+ var setFieldValue = rest.setFieldValue;
85
+
86
+ if (compareOptions(options, originOptions.current)) {
87
+ if (clearWhenOptionsUpdated) {
88
+ typeof setFieldValue === 'function' && setFieldValue();
89
+ } else {
90
+ var foundValue = options.find(function (option) {
91
+ return Array.isArray(value) ? value.includes(option.value) : option.value === value;
92
+ });
93
+
94
+ if (!foundValue && value !== undefined) {
95
+ typeof setFieldValue === 'function' && setFieldValue();
96
+ }
97
+ }
98
+
99
+ originOptions.current = options;
100
+ }
101
+ }, [options]);
102
+ return _jsxs(_Checkbox.Group, _objectSpread(_objectSpread({}, omit(rest, formMethods)), {}, {
49
103
  className: classnames('igloo-checkbox-group', className),
50
104
  value: value,
51
- children: _jsx(_Row, {
105
+ children: [_jsx(_Row, {
52
106
  gutter: [8, 8],
53
107
  children: options.map(function (_ref2) {
54
108
  var label = _ref2.label,
@@ -72,10 +126,36 @@ export var CheckboxGroup = function CheckboxGroup(_ref) {
72
126
  })]
73
127
  }, key);
74
128
  })
75
- })
129
+ }), !options.length && _jsxs("div", {
130
+ style: {
131
+ display: 'flex',
132
+ flexDirection: 'column',
133
+ background: '#f9f9f9',
134
+ padding: 16,
135
+ alignItems: 'center'
136
+ },
137
+ children: [_jsx("img", {
138
+ src: emptyIcon,
139
+ style: {
140
+ width: 32,
141
+ height: 24
142
+ }
143
+ }), _jsx(Typography, {
144
+ level: "h5",
145
+ style: {
146
+ color: '#212121',
147
+ marginTop: 8
148
+ },
149
+ children: formatMessage({
150
+ id: 'There are no options available currently'
151
+ })
152
+ })]
153
+ })]
76
154
  }));
77
155
  };
78
156
 
157
+ export var CheckboxGroup = optionsHOC(InnerCheckboxGroup);
158
+
79
159
  CheckboxGroup.formItemPropsHandler = function () {
80
160
  return {};
81
161
  };
@@ -1,11 +1,12 @@
1
- declare const CratetCheckBoxFilter: (props: {
1
+ declare const CreateCheckBoxFilter: (props: {
2
2
  title: any;
3
3
  configList: any[];
4
4
  optionKey: string;
5
5
  allSelected: any[];
6
- valueConfirm: any;
6
+ handleOptionsChange: any;
7
7
  chooseed?: string[];
8
8
  onChange?: any;
9
9
  disabled?: any[];
10
+ setConfirmValue?: any;
10
11
  }) => JSX.Element;
11
- export default CratetCheckBoxFilter;
12
+ export default CreateCheckBoxFilter;
@@ -7,6 +7,12 @@ import _Row from "antd/es/row";
7
7
  import "antd/es/checkbox/style";
8
8
  import _Checkbox from "antd/es/checkbox";
9
9
 
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+
14
+ 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; }
15
+
10
16
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
17
 
12
18
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -37,7 +43,7 @@ function handleFilterDisable() {
37
43
  });
38
44
  }
39
45
 
40
- var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
46
+ var CreateCheckBoxFilter = function CreateCheckBoxFilter(props) {
41
47
  var _useContext = useContext(LocaleContext),
42
48
  formatMessage = _useContext.formatMessage;
43
49
 
@@ -51,8 +57,10 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
51
57
  chooseed = _props$chooseed === void 0 ? [] : _props$chooseed,
52
58
  disabled = props.disabled,
53
59
  _onChange = props.onChange,
54
- _props$valueConfirm = props.valueConfirm,
55
- valueConfirm = _props$valueConfirm === void 0 ? function () {} : _props$valueConfirm;
60
+ _props$setConfirmValu = props.setConfirmValue,
61
+ setConfirmValue = _props$setConfirmValu === void 0 ? function () {} : _props$setConfirmValu,
62
+ _props$handleOptionsC = props.handleOptionsChange,
63
+ handleOptionsChange = _props$handleOptionsC === void 0 ? function () {} : _props$handleOptionsC;
56
64
  var timeKey = new Date();
57
65
 
58
66
  var _useState = useState(false),
@@ -69,6 +77,22 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
69
77
  setAllChoose(false);
70
78
  }
71
79
  }, [chooseed.length, allSelected]);
80
+ useEffect(function () {
81
+ var filterDisabled = chooseed.filter(function (e) {
82
+ return !(disabled === null || disabled === void 0 ? void 0 : disabled.includes(e));
83
+ });
84
+
85
+ if (filterDisabled.length !== chooseed.length) {
86
+ handleOptionsChange({
87
+ type: optionKey,
88
+ value: filterDisabled
89
+ });
90
+ setConfirmValue(function (old) {
91
+ return _objectSpread(_objectSpread({}, old), {}, _defineProperty({}, optionKey, filterDisabled));
92
+ });
93
+ typeof _onChange === 'function' && _onChange(filterDisabled);
94
+ }
95
+ }, [disabled]);
72
96
  return _jsxs("div", {
73
97
  className: "igloo-form-filter-drop-down-container-content-group",
74
98
  children: [_jsxs("div", {
@@ -80,7 +104,7 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
80
104
  className: "igloo-form-filter-drop-down-container-content-group-title-action",
81
105
  onClick: function onClick() {
82
106
  typeof _onChange === 'function' && _onChange([]);
83
- valueConfirm({
107
+ handleOptionsChange({
84
108
  type: optionKey,
85
109
  value: []
86
110
  });
@@ -96,7 +120,7 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
96
120
  className: "igloo-form-filter-drop-down-container-content-group-title-action",
97
121
  onClick: function onClick() {
98
122
  typeof _onChange === 'function' && _onChange(nowValidList);
99
- valueConfirm({
123
+ handleOptionsChange({
100
124
  type: optionKey,
101
125
  value: nowValidList
102
126
  });
@@ -116,7 +140,7 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
116
140
  },
117
141
  onChange: function onChange(e) {
118
142
  typeof _onChange === 'function' && _onChange(e);
119
- valueConfirm({
143
+ handleOptionsChange({
120
144
  type: optionKey,
121
145
  value: e
122
146
  });
@@ -145,4 +169,4 @@ var CratetCheckBoxFilter = function CratetCheckBoxFilter(props) {
145
169
  }, optionKey);
146
170
  };
147
171
 
148
- export default CratetCheckBoxFilter;
172
+ export default CreateCheckBoxFilter;
@@ -687,7 +687,8 @@ var FilterComponent = function FilterComponent(props) {
687
687
  allSelected: optionsAllSelected[key],
688
688
  chooseed: optionsChanged[key],
689
689
  disabled: disabled,
690
- valueConfirm: dispatchOptionsChange,
690
+ handleOptionsChange: dispatchOptionsChange,
691
+ setConfirmValue: setConfimed,
691
692
  onChange: onChangeProps
692
693
  }, key);
693
694
 
@@ -699,7 +700,8 @@ var FilterComponent = function FilterComponent(props) {
699
700
  optionKey: key,
700
701
  chooseed: optionsChanged[key],
701
702
  disabled: disabled,
702
- valueConfirm: dispatchOptionsChange,
703
+ handleOptionsChange: dispatchOptionsChange,
704
+ setConfirmValue: setConfimed,
703
705
  onChange: onChangeProps
704
706
  }, key);
705
707
  }
@@ -2,7 +2,8 @@ declare type IRadioBoxProps = {
2
2
  title: any;
3
3
  configList: any[];
4
4
  optionKey: string;
5
- valueConfirm: any;
5
+ handleOptionsChange: any;
6
+ setConfirmValue: any;
6
7
  chooseed?: string[];
7
8
  disabled?: any[];
8
9
  onChange?: any;
@@ -6,17 +6,38 @@ import "antd/es/row/style";
6
6
  import _Row from "antd/es/row";
7
7
  import "antd/es/radio/style";
8
8
  import _Radio from "antd/es/radio";
9
+
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+
14
+ 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; }
15
+
9
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
17
  import Typography from '../typography';
18
+ import { useEffect } from 'react';
11
19
 
12
20
  var CreateRadioBoxFilter = function CreateRadioBoxFilter(props) {
13
21
  var optionKey = props.optionKey,
14
22
  title = props.title,
15
23
  configList = props.configList,
16
24
  disabled = props.disabled,
17
- valueConfirm = props.valueConfirm,
25
+ handleOptionsChange = props.handleOptionsChange,
26
+ setConfirmValue = props.setConfirmValue,
18
27
  chooseed = props.chooseed,
19
28
  _onChange = props.onChange;
29
+ useEffect(function () {
30
+ if (disabled === null || disabled === void 0 ? void 0 : disabled.includes(chooseed)) {
31
+ typeof _onChange === 'function' && _onChange(undefined);
32
+ handleOptionsChange({
33
+ type: optionKey,
34
+ value: undefined
35
+ });
36
+ setConfirmValue(function (old) {
37
+ return _objectSpread(_objectSpread({}, old), {}, _defineProperty({}, optionKey, undefined));
38
+ });
39
+ }
40
+ }, [disabled]);
20
41
  return _jsxs("div", {
21
42
  className: "igloo-form-filter-drop-down-container-content-group",
22
43
  children: [_jsx("div", {
@@ -26,10 +47,10 @@ var CreateRadioBoxFilter = function CreateRadioBoxFilter(props) {
26
47
  children: title
27
48
  })
28
49
  }), _jsx(_Radio.Group, {
29
- value: chooseed,
50
+ value: (disabled === null || disabled === void 0 ? void 0 : disabled.includes(chooseed)) ? undefined : chooseed,
30
51
  onChange: function onChange(e) {
31
52
  typeof _onChange === 'function' && _onChange(e.target.value);
32
- valueConfirm({
53
+ handleOptionsChange({
33
54
  type: optionKey,
34
55
  value: e.target.value
35
56
  });
@@ -12,6 +12,7 @@ import Divider from './divider';
12
12
  import UploadPhoto from '../upload-photo';
13
13
  import RenderElement from './render';
14
14
  import Typography from '../typography';
15
+ import SearchBox from '../search-box';
15
16
  var elementMap = {
16
17
  Input: Input,
17
18
  PhoneNumber: PhoneNumber,
@@ -42,7 +43,8 @@ var elementMap = {
42
43
  InputDate: InputDate,
43
44
  Confirmation: Confirmation,
44
45
  ExpiryDate: ExpiryDate,
45
- Typography: Typography
46
+ Typography: Typography,
47
+ SearchBox: SearchBox
46
48
  };
47
49
 
48
50
  var Unknown = function Unknown() {
package/es/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export { default as MobileInsurerDetail } from './mobile-insurer-detail';
35
35
  export { default as Layout } from './layout';
36
36
  export { default as DetailPanel } from './detail-panel';
37
37
  export { default as message } from './global-message';
38
+ export { default as SearchBox } from './search-box';
38
39
  export { default as FreeForm } from './free-form';
39
40
  export { default as FormItem } from './free-form/element';
40
41
  export { default as FormPages } from './free-form/pages';
package/es/index.js CHANGED
@@ -35,6 +35,7 @@ export { default as MobileInsurerDetail } from './mobile-insurer-detail';
35
35
  export { default as Layout } from './layout';
36
36
  export { default as DetailPanel } from './detail-panel';
37
37
  export { default as message } from './global-message';
38
+ export { default as SearchBox } from './search-box';
38
39
  export { default as FreeForm } from './free-form';
39
40
  export { default as FormItem } from './free-form/element';
40
41
  export { default as FormPages } from './free-form/pages';
@@ -47,8 +47,15 @@ var Amount = function Amount(_ref) {
47
47
  var handleOnBlur = function handleOnBlur(e) {
48
48
  var onChange = rest.onChange;
49
49
 
50
- if (typeof value === 'string' && value.endsWith('.')) {
51
- e.target.value = value.replace('.', '');
50
+ if (typeof value === 'string') {
51
+ if (value.endsWith('.')) {
52
+ e.target.value = value.replace('.', '');
53
+ }
54
+
55
+ if (value.endsWith('0') && value.includes('.')) {
56
+ e.target.value = value.replace(/[0]+$/, '');
57
+ }
58
+
52
59
  onChange && onChange(e);
53
60
  }
54
61
  };
@@ -75,7 +82,11 @@ Amount.formItemPropsHandler = function (_ref2) {
75
82
  getValueFromEvent: function getValueFromEvent(e) {
76
83
  var value = e.target.value;
77
84
  var str = value.replaceAll(seperator, '').replaceAll(/[^0-9\.]/g, '');
78
- if (value.endsWith('.')) return str;
85
+
86
+ if (str.endsWith('.') || str.includes('.') && str.endsWith('0')) {
87
+ return str;
88
+ }
89
+
79
90
  return str ? parseFloat(str) : undefined;
80
91
  },
81
92
  rules: [{
@@ -17,8 +17,15 @@ var IglooInputNumber = function IglooInputNumber(props) {
17
17
  var value = props.value,
18
18
  onChange = props.onChange;
19
19
 
20
- if (typeof value === 'string' && value.endsWith('.')) {
21
- e.target.value = value.replace('.', '');
20
+ if (typeof value === 'string') {
21
+ if (value.endsWith('.')) {
22
+ e.target.value = value.replace('.', '');
23
+ }
24
+
25
+ if (value.endsWith('0') && value.includes('.')) {
26
+ e.target.value = value.replace(/[0]+$/, '');
27
+ }
28
+
22
29
  onChange && onChange(e);
23
30
  }
24
31
  };
@@ -36,7 +43,11 @@ IglooInputNumber.formItemPropsHandler = function (config) {
36
43
  getValueFromEvent: function getValueFromEvent(e) {
37
44
  var value = e.target.value;
38
45
  var str = value.replaceAll(/[^0-9\.]/g, '');
39
- if (value.endsWith('.')) return parseInt(str);
46
+
47
+ if (str.endsWith('.') || str.includes('.') && str.endsWith('0')) {
48
+ return str;
49
+ }
50
+
40
51
  return str ? parseFloat(str) : undefined;
41
52
  }
42
53
  };
@@ -21,6 +21,7 @@
21
21
  "Data Processed": "Data Processed",
22
22
  "Data Processing...": "Data Processing...",
23
23
  "Date": "Date",
24
+ "Done": "Done",
24
25
  "Drag and drop a file here": "Drag and drop a file here",
25
26
  "Edit": "Edit",
26
27
  "Error Report": "Error Report",
@@ -56,10 +57,13 @@
56
57
  "Result": "Result",
57
58
  "Result: Success {success_num}; Error {fail_num}": "Result: Success {success_num}; Error {fail_num}",
58
59
  "Rows per page": "Rows per page",
60
+ "Search": "Search",
61
+ "Searching...": "Searching...",
59
62
  "Select All": "Select All",
60
63
  "Send OTP": "Send OTP",
61
64
  "Submit": "Submit",
62
65
  "The file type is not supported.": "The file type is not supported.",
66
+ "There are no options available currently": "There are no options available currently",
63
67
  "This Month": "This Month",
64
68
  "Unselect All": "Unselect All",
65
69
  "Uploading": "Uploading",
@@ -21,6 +21,7 @@
21
21
  "Data Processed": "Data Terproses",
22
22
  "Data Processing...": "Data Diproses",
23
23
  "Date": "Tanggal",
24
+ "Done": "Selesai",
24
25
  "Drag and drop a file here": "Geser dan Letakkan Dokumen disini",
25
26
  "Edit": "Ubah",
26
27
  "Error Report": "Laporan Kesalahan",
@@ -56,10 +57,13 @@
56
57
  "Result": "Hasil",
57
58
  "Result: Success {success_num}; Error {fail_num}": "Hasil: Sukses {success_num}; Kesalahan {fail_num}",
58
59
  "Rows per page": "Baris per halaman",
60
+ "Search": "Mencari",
61
+ "Searching...": "Mencari...",
59
62
  "Select All": "Pilih Semua",
60
63
  "Send OTP": "Kirim OTP",
61
64
  "Submit": "Ajukan",
62
65
  "The file type is not supported.": "Jenis file tidak didukung.",
66
+ "There are no options available currently": "Tidak ada opsi yang tersedia saat ini",
63
67
  "This Month": "Bulan ini",
64
68
  "Unselect All": "Batalkan semua",
65
69
  "Uploading": "Mengunggah",
@@ -21,6 +21,7 @@
21
21
  "Data Processed": "ประมวลข้อมูลสำเร็จแล้ว",
22
22
  "Data Processing...": "กำลังประมวลผลข้อมูล...",
23
23
  "Date": "วันที่",
24
+ "Done": "เสร็จแล้ว",
24
25
  "Drag and drop a file here": "ลากและวางไฟล์มาที่นี่",
25
26
  "Edit": "แก้ไข",
26
27
  "Error Report": "รายงานข้อผิดพลาด",
@@ -56,10 +57,13 @@
56
57
  "Result": "ผลลัพธ์",
57
58
  "Result: Success {success_num}; Error {fail_num}": "ผลลัพธ์: สำเร็จ {success_num}; ข้อผิดพลาด {fail_num}",
58
59
  "Rows per page": "แถวต่อหน้า",
60
+ "Search": "ค้นหา",
61
+ "Searching...": "กำลังค้นหา...",
59
62
  "Select All": "เลือกทั้งหมด",
60
63
  "Send OTP": "ส่ง OTP",
61
64
  "Submit": "ส่ง/ยืนยัน",
62
65
  "The file type is not supported.": "ประเภทไฟล์ไม่รองรับ",
66
+ "There are no options available currently": "ไม่มีตัวเลือกในขณะนี้",
63
67
  "This Month": "เดือนนี้",
64
68
  "Unselect All": "ไม่เลือกทั้งหมด",
65
69
  "Uploading": "กำลังอัพโหลด",
@@ -21,6 +21,7 @@
21
21
  "Data Processed": "Dữ liệu đã xử lý",
22
22
  "Data Processing...": "Đang xử lý dữ liệu...",
23
23
  "Date": "Ngày",
24
+ "Done": "Xong",
24
25
  "Drag and drop a file here": "Thả tệp tin vào đây",
25
26
  "Edit": "Sửa",
26
27
  "Error Report": "Báo cáo lỗi",
@@ -56,10 +57,13 @@
56
57
  "Result": "Kết quả",
57
58
  "Result: Success {success_num}; Error {fail_num}": "Kết quả: sự thành công {success_num}; lỗi {fail_num}",
58
59
  "Rows per page": "Dòng trên trang",
60
+ "Search": "Tìm kiếm",
61
+ "Searching...": "Đang tìm kiếm...",
59
62
  "Select All": "Chọn tất cả",
60
63
  "Send OTP": "Gửi OTP",
61
64
  "Submit": "Gửi",
62
65
  "The file type is not supported.": "Loại tệp không được hỗ trợ.",
66
+ "There are no options available currently": "Hiện tại không có tùy chọn nào",
63
67
  "This Month": "Tháng này",
64
68
  "Unselect All": "Hủy chọn tất cả",
65
69
  "Uploading": "Đang tải lên",
@@ -21,6 +21,7 @@
21
21
  "Data Processed": "已导入",
22
22
  "Data Processing...": "导入中",
23
23
  "Date": "日期",
24
+ "Done": "完成",
24
25
  "Drag and drop a file here": "拖拽一个文件到这里",
25
26
  "Edit": "编辑",
26
27
  "Error Report": "错误报告",
@@ -56,10 +57,13 @@
56
57
  "Result": "结果",
57
58
  "Result: Success {success_num}; Error {fail_num}": "结果:成功 {success_num}; 失败 {fail_num}",
58
59
  "Rows per page": "每页条数",
60
+ "Search": "搜索",
61
+ "Searching...": "正在搜索...",
59
62
  "Select All": "全选",
60
63
  "Send OTP": "发送OTP",
61
64
  "Submit": "提交",
62
65
  "The file type is not supported.": "不支持上传该类型的文件。",
66
+ "There are no options available currently": "当前没有可用的选项",
63
67
  "This Month": "当月",
64
68
  "Unselect All": "反选",
65
69
  "Uploading": "上传中",
@@ -21,6 +21,7 @@
21
21
  "Data Processed": "數據已處理",
22
22
  "Data Processing...": "數據處理中。。。",
23
23
  "Date": "日期",
24
+ "Done": "完成",
24
25
  "Drag and drop a file here": "拖放文件至此",
25
26
  "Edit": "編輯",
26
27
  "Error Report": "錯誤報告",
@@ -38,6 +39,7 @@
38
39
  "OK": "好",
39
40
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "一旦您對上述內容感到滿意,您已檢查聲明,請繼續並提交您的索賠。",
40
41
  "Optional": "可選項",
42
+ "Other Reason": "其他原因",
41
43
  "Please enter a valid date.": "請輸入有效的日期。",
42
44
  "Please enter a valid time.": "請輸入有效的時間。",
43
45
  "Please select": "請選擇",
@@ -55,10 +57,13 @@
55
57
  "Result": "結果",
56
58
  "Result: Success {success_num}; Error {fail_num}": "結果:成功{success_num};錯誤{fail_num}",
57
59
  "Rows per page": "每頁行數",
60
+ "Search": "檢索",
61
+ "Searching...": "正在檢索...",
58
62
  "Select All": "全選",
59
63
  "Send OTP": "發送OTP.",
60
64
  "Submit": "提交",
61
65
  "The file type is not supported.": "不支持文件類型。",
66
+ "There are no options available currently": "當前沒有可用的選項",
62
67
  "This Month": "本月",
63
68
  "Unselect All": "全部取消選擇",
64
69
  "Uploading": "上傳",
package/es/media/media.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "antd/es/tooltip/style";
2
2
  import _Tooltip from "antd/es/tooltip";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- import PDF from '@mikecousins/react-pdf';
4
+ import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';
5
5
 
6
6
  var MediaItem = function MediaItem(_ref) {
7
7
  var type = _ref.type,
@@ -25,9 +25,12 @@ var MediaItem = function MediaItem(_ref) {
25
25
  maxHeight: 80,
26
26
  position: 'absolute'
27
27
  },
28
- children: _jsx(PDF, {
28
+ children: _jsx(Document, {
29
29
  file: src,
30
- scale: 0.1
30
+ children: _jsx(Page, {
31
+ pageNumber: 1,
32
+ scale: 0.1
33
+ })
31
34
  })
32
35
  });
33
36