iglooform 3.0.3 → 3.0.5

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 (98) hide show
  1. package/.dumi/tmp/core/defineApp.ts +1 -1
  2. package/.dumi/tmp/core/helmet.ts +1 -1
  3. package/.dumi/tmp/core/history.ts +1 -1
  4. package/.dumi/tmp/core/historyIntelli.ts +1 -1
  5. package/.dumi/tmp/core/plugin.ts +2 -2
  6. package/.dumi/tmp/core/polyfill.ts +197 -197
  7. package/.dumi/tmp/core/route.tsx +33 -33
  8. package/.dumi/tmp/dumi/exports.ts +1 -1
  9. package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
  10. package/.dumi/tmp/dumi/meta/index.ts +33 -33
  11. package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
  12. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
  13. package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
  14. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
  15. package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
  16. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
  17. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
  18. package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
  19. package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
  20. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
  21. package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
  22. package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
  23. package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
  24. package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
  25. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
  26. package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
  27. package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
  28. package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
  29. package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
  30. package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
  31. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
  32. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
  33. package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
  34. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
  35. package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
  36. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
  37. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
  38. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
  39. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
  40. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
  41. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
  42. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
  43. package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
  44. package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
  45. package/.dumi/tmp/exports.ts +5 -5
  46. package/.dumi/tmp/testBrowser.tsx +3 -3
  47. package/.dumi/tmp/umi.ts +4 -4
  48. package/.idea/iglooform.iml +9 -0
  49. package/.idea/misc.xml +5 -0
  50. package/.idea/modules.xml +8 -0
  51. package/.idea/vcs.xml +6 -0
  52. package/es/date-picker/buddhist.js +1 -1
  53. package/es/date-picker/index.js +41 -40
  54. package/es/input/phone-number.js +2 -2
  55. package/es/media/style/index.less +7 -6
  56. package/es/utils/form-utils.js +3 -1
  57. package/es/utils/tools.d.ts +1 -1
  58. package/lib/date-picker/buddhist.js +1 -1
  59. package/lib/date-picker/index.js +41 -40
  60. package/lib/input/phone-number.js +2 -2
  61. package/lib/media/style/index.less +7 -6
  62. package/lib/utils/form-utils.js +3 -1
  63. package/lib/utils/tools.d.ts +1 -1
  64. package/package.json +1 -1
  65. package/es/admin-amount/style/index.d.ts +0 -0
  66. package/es/babel-plugin-import-option.d.ts +0 -7
  67. package/es/back-top/index.d.ts +0 -5
  68. package/es/input/style/amount/index.d.ts +0 -2
  69. package/es/input/style/index.d.ts +0 -2
  70. package/es/input/style/input-date/index.d.ts +0 -2
  71. package/es/input/style/otp/index.d.ts +0 -2
  72. package/es/input/style/phone-number/index.d.ts +0 -2
  73. package/es/input/style/text-area/index.d.ts +0 -2
  74. package/es/locale/locale-provider.d.ts +0 -11
  75. package/es/login-page/index.d.ts +0 -7
  76. package/es/message/style/index.d.ts +0 -1
  77. package/es/ocr/micro-blink/style/index.d.ts +0 -1
  78. package/es/platform/platform-card/index.d.ts +0 -12
  79. package/es/platform/switch-platform/index.d.ts +0 -12
  80. package/es/tabs/index.d.ts +0 -15
  81. package/es/utils/useAsyncEffect.d.ts +0 -3
  82. package/lib/admin-amount/style/index.d.ts +0 -0
  83. package/lib/babel-plugin-import-option.d.ts +0 -7
  84. package/lib/back-top/index.d.ts +0 -5
  85. package/lib/input/style/amount/index.d.ts +0 -2
  86. package/lib/input/style/index.d.ts +0 -2
  87. package/lib/input/style/input-date/index.d.ts +0 -2
  88. package/lib/input/style/otp/index.d.ts +0 -2
  89. package/lib/input/style/phone-number/index.d.ts +0 -2
  90. package/lib/input/style/text-area/index.d.ts +0 -2
  91. package/lib/locale/locale-provider.d.ts +0 -11
  92. package/lib/login-page/index.d.ts +0 -7
  93. package/lib/message/style/index.d.ts +0 -1
  94. package/lib/ocr/micro-blink/style/index.d.ts +0 -1
  95. package/lib/platform/platform-card/index.d.ts +0 -12
  96. package/lib/platform/switch-platform/index.d.ts +0 -12
  97. package/lib/tabs/index.d.ts +0 -15
  98. package/lib/utils/useAsyncEffect.d.ts +0 -3
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/iglooform.iml" filepath="$PROJECT_DIR$/.idea/iglooform.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -80,7 +80,7 @@ IglooBuddhistDatePicker.formItemPropsHandler = function (_ref2) {
80
80
  var format = _ref2.format;
81
81
  return {
82
82
  getValueFromEvent: function getValueFromEvent(m) {
83
- return +m;
83
+ return m === null ? m : +m;
84
84
  },
85
85
  previewFormater: function previewFormater(value) {
86
86
  return moment(value).format(format || dateFormater);
@@ -70,7 +70,7 @@ IglooDatePicker.formItemPropsHandler = function (_ref2) {
70
70
  var format = _ref2.format;
71
71
  return {
72
72
  getValueFromEvent: function getValueFromEvent(m) {
73
- return +m;
73
+ return m === null ? m : +m;
74
74
  },
75
75
  previewFormater: function previewFormater(value) {
76
76
  return moment(value).format(format || dateFormater);
@@ -119,16 +119,17 @@ export var IglooRangePicker = function IglooRangePicker(_ref3) {
119
119
  IglooRangePicker.formItemPropsHandler = function (_ref4) {
120
120
  var format = _ref4.format;
121
121
  return {
122
- getValueFromEvent: function getValueFromEvent(_ref5) {
122
+ getValueFromEvent: function getValueFromEvent(values) {
123
+ if (!values) return values;
124
+ var _values = _slicedToArray(values, 2),
125
+ start = _values[0],
126
+ end = _values[1];
127
+ return [+start, +end];
128
+ },
129
+ previewFormater: function previewFormater(_ref5) {
123
130
  var _ref6 = _slicedToArray(_ref5, 2),
124
131
  start = _ref6[0],
125
132
  end = _ref6[1];
126
- return [+start, +end];
127
- },
128
- previewFormater: function previewFormater(_ref7) {
129
- var _ref8 = _slicedToArray(_ref7, 2),
130
- start = _ref8[0],
131
- end = _ref8[1];
132
133
  return "".concat(moment(start).format(format || dateFormater), " - ").concat(moment(end).format(format || dateFormater));
133
134
  },
134
135
  valueFormater: function valueFormater(value) {
@@ -142,27 +143,27 @@ IglooRangePicker.formItemPropsHandler = function (_ref4) {
142
143
  'element-allowClear': false
143
144
  };
144
145
  };
145
- export var IglooWeekPicker = function IglooWeekPicker(_ref9) {
146
- var value = _ref9.value,
147
- format = _ref9.format,
148
- placeholder = _ref9.placeholder,
149
- _ref9$suffixIcon = _ref9.suffixIcon,
150
- suffixIcon = _ref9$suffixIcon === void 0 ? /*#__PURE__*/_jsx(CalendarOutlined, {
146
+ export var IglooWeekPicker = function IglooWeekPicker(_ref7) {
147
+ var value = _ref7.value,
148
+ format = _ref7.format,
149
+ placeholder = _ref7.placeholder,
150
+ _ref7$suffixIcon = _ref7.suffixIcon,
151
+ suffixIcon = _ref7$suffixIcon === void 0 ? /*#__PURE__*/_jsx(CalendarOutlined, {
151
152
  style: {
152
153
  fontSize: 24
153
154
  }
154
- }) : _ref9$suffixIcon,
155
- className = _ref9.className,
156
- _onOpenChange3 = _ref9.onOpenChange,
157
- props = _objectWithoutProperties(_ref9, _excluded3);
155
+ }) : _ref7$suffixIcon,
156
+ className = _ref7.className,
157
+ _onOpenChange3 = _ref7.onOpenChange,
158
+ props = _objectWithoutProperties(_ref7, _excluded3);
158
159
  var _useState5 = useState(false),
159
160
  _useState6 = _slicedToArray(_useState5, 2),
160
161
  focusStaus = _useState6[0],
161
162
  setFocus = _useState6[1];
162
163
  return /*#__PURE__*/_jsx(WeekPicker, _objectSpread(_objectSpread({}, omit(props, formMethods)), {}, {
163
164
  value: value ? moment(value) : value,
164
- placeholder: placeholder || dateFormater,
165
- format: format || dateFormater,
165
+ placeholder: placeholder,
166
+ format: format,
166
167
  inputReadOnly: true,
167
168
  suffixIcon: suffixIcon,
168
169
  className: classnames(className, 'igloo-date-picker-container', {
@@ -175,14 +176,14 @@ export var IglooWeekPicker = function IglooWeekPicker(_ref9) {
175
176
  popupClassName: "igloo-date-picker-panel"
176
177
  }));
177
178
  };
178
- IglooWeekPicker.formItemPropsHandler = function (_ref10) {
179
- var format = _ref10.format;
179
+ IglooWeekPicker.formItemPropsHandler = function (_ref8) {
180
+ var format = _ref8.format;
180
181
  return {
181
182
  getValueFromEvent: function getValueFromEvent(m) {
182
- return +m;
183
+ return m === null ? m : +m;
183
184
  },
184
185
  previewFormater: function previewFormater(value) {
185
- return moment(value).format(format || dateFormater);
186
+ return moment(value).format(format);
186
187
  },
187
188
  valueFormater: function valueFormater(value) {
188
189
  return value ? +moment(value) : value;
@@ -190,27 +191,27 @@ IglooWeekPicker.formItemPropsHandler = function (_ref10) {
190
191
  'element-allowClear': false
191
192
  };
192
193
  };
193
- export var IglooMonthPicker = function IglooMonthPicker(_ref11) {
194
- var value = _ref11.value,
195
- format = _ref11.format,
196
- placeholder = _ref11.placeholder,
197
- _ref11$suffixIcon = _ref11.suffixIcon,
198
- suffixIcon = _ref11$suffixIcon === void 0 ? /*#__PURE__*/_jsx(CalendarOutlined, {
194
+ export var IglooMonthPicker = function IglooMonthPicker(_ref9) {
195
+ var value = _ref9.value,
196
+ format = _ref9.format,
197
+ placeholder = _ref9.placeholder,
198
+ _ref9$suffixIcon = _ref9.suffixIcon,
199
+ suffixIcon = _ref9$suffixIcon === void 0 ? /*#__PURE__*/_jsx(CalendarOutlined, {
199
200
  style: {
200
201
  fontSize: 24
201
202
  }
202
- }) : _ref11$suffixIcon,
203
- _onOpenChange4 = _ref11.onOpenChange,
204
- className = _ref11.className,
205
- props = _objectWithoutProperties(_ref11, _excluded4);
203
+ }) : _ref9$suffixIcon,
204
+ _onOpenChange4 = _ref9.onOpenChange,
205
+ className = _ref9.className,
206
+ props = _objectWithoutProperties(_ref9, _excluded4);
206
207
  var _useState7 = useState(false),
207
208
  _useState8 = _slicedToArray(_useState7, 2),
208
209
  focusStaus = _useState8[0],
209
210
  setFocus = _useState8[1];
210
211
  return /*#__PURE__*/_jsx(MonthPicker, _objectSpread(_objectSpread({}, omit(props, formMethods)), {}, {
211
212
  value: value ? moment(value) : value,
212
- placeholder: placeholder || dateFormater,
213
- format: format || dateFormater,
213
+ placeholder: placeholder,
214
+ format: format,
214
215
  inputReadOnly: true,
215
216
  suffixIcon: suffixIcon,
216
217
  className: classnames(className, 'igloo-date-picker-container', {
@@ -223,14 +224,14 @@ export var IglooMonthPicker = function IglooMonthPicker(_ref11) {
223
224
  popupClassName: "igloo-date-picker-panel"
224
225
  }));
225
226
  };
226
- IglooMonthPicker.formItemPropsHandler = function (_ref12) {
227
- var format = _ref12.format;
227
+ IglooMonthPicker.formItemPropsHandler = function (_ref10) {
228
+ var format = _ref10.format;
228
229
  return {
229
230
  getValueFromEvent: function getValueFromEvent(m) {
230
- return +m;
231
+ return m === null ? m : +m;
231
232
  },
232
233
  previewFormater: function previewFormater(value) {
233
- return moment(value).format(format || dateFormater);
234
+ return moment(value).format(format);
234
235
  },
235
236
  valueFormater: function valueFormater(value) {
236
237
  return value ? +moment(value) : value;
@@ -187,10 +187,10 @@ PhoneNumber.formItemPropsHandler = function (_ref2) {
187
187
  var initialAreaCode = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.areaCode) || (Array.isArray(areaCode) ? areaCode[0] : areaCode);
188
188
  var initialPhoneNumber = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.phoneNumber) || phoneNumber;
189
189
  return {
190
- initialValue: {
190
+ initialValue: initialPhoneNumber ? {
191
191
  areaCode: initialAreaCode,
192
192
  phoneNumber: initialPhoneNumber
193
- },
193
+ } : undefined,
194
194
  rules: rules,
195
195
  previewFormater: function previewFormater(_ref3) {
196
196
  var areaCode = _ref3.areaCode,
@@ -18,6 +18,7 @@
18
18
  background: transparent;
19
19
  width: 100vw;
20
20
  height: 100vh;
21
+ padding: 0;
21
22
  filter: none;
22
23
 
23
24
  .ant-modal-body {
@@ -37,10 +38,10 @@
37
38
  line-height: 40px;
38
39
  justify-content: center;
39
40
  cursor: pointer;
40
- color: @icon-color;
41
+ color: @icon-color;
41
42
 
42
43
  &:hover {
43
- color: @text-color;
44
+ color: @text-color;
44
45
  }
45
46
  }
46
47
  }
@@ -128,10 +129,10 @@
128
129
  background: #fff;
129
130
  border-radius: 40px;
130
131
  user-select: none;
131
- color: @icon-color;
132
+ color: @icon-color;
132
133
 
133
134
  &:hover {
134
- color: @text-color;
135
+ color: @text-color;
135
136
  }
136
137
  }
137
138
 
@@ -163,10 +164,10 @@
163
164
  cursor: pointer;
164
165
  background: #fff;
165
166
  border-radius: 40px;
166
- color: @icon-color;
167
+ color: @icon-color;
167
168
 
168
169
  &:hover {
169
- color: @text-color;
170
+ color: @text-color;
170
171
  }
171
172
  }
172
173
  }
@@ -300,7 +300,9 @@ export var calcFormItemProps = function calcFormItemProps(config, extraProps, fo
300
300
  try {
301
301
  var fn = eval(code);
302
302
  var formValues = form === null || form === void 0 ? void 0 : form.getFieldsValue(true);
303
- var _result2 = fn(value, formValues);
303
+ var _result2 = fn(value, formValues, {
304
+ moment: moment
305
+ });
304
306
  return _result2 ? Promise.resolve() : Promise.reject(errorMessage);
305
307
  } catch (_unused) {
306
308
  return Promise.reject(errorMessage);
@@ -1,2 +1,2 @@
1
1
  export declare const parseFileSize: (size: number) => string;
2
- export declare function classifyType(type: string): "image" | "video" | "pdf" | "unknown";
2
+ export declare function classifyType(type: string): "video" | "image" | "pdf" | "unknown";
@@ -87,7 +87,7 @@ IglooBuddhistDatePicker.formItemPropsHandler = function (_ref2) {
87
87
  var format = _ref2.format;
88
88
  return {
89
89
  getValueFromEvent: function getValueFromEvent(m) {
90
- return +m;
90
+ return m === null ? m : +m;
91
91
  },
92
92
  previewFormater: function previewFormater(value) {
93
93
  return (0, _dayjs2.default)(value).format(format || dateFormater);
@@ -83,7 +83,7 @@ IglooDatePicker.formItemPropsHandler = function (_ref2) {
83
83
  var format = _ref2.format;
84
84
  return {
85
85
  getValueFromEvent: function getValueFromEvent(m) {
86
- return +m;
86
+ return m === null ? m : +m;
87
87
  },
88
88
  previewFormater: function previewFormater(value) {
89
89
  return (0, _dayjs.default)(value).format(format || dateFormater);
@@ -134,16 +134,17 @@ exports.IglooRangePicker = IglooRangePicker;
134
134
  IglooRangePicker.formItemPropsHandler = function (_ref4) {
135
135
  var format = _ref4.format;
136
136
  return {
137
- getValueFromEvent: function getValueFromEvent(_ref5) {
137
+ getValueFromEvent: function getValueFromEvent(values) {
138
+ if (!values) return values;
139
+ var _values = _slicedToArray(values, 2),
140
+ start = _values[0],
141
+ end = _values[1];
142
+ return [+start, +end];
143
+ },
144
+ previewFormater: function previewFormater(_ref5) {
138
145
  var _ref6 = _slicedToArray(_ref5, 2),
139
146
  start = _ref6[0],
140
147
  end = _ref6[1];
141
- return [+start, +end];
142
- },
143
- previewFormater: function previewFormater(_ref7) {
144
- var _ref8 = _slicedToArray(_ref7, 2),
145
- start = _ref8[0],
146
- end = _ref8[1];
147
148
  return "".concat((0, _dayjs.default)(start).format(format || dateFormater), " - ").concat((0, _dayjs.default)(end).format(format || dateFormater));
148
149
  },
149
150
  valueFormater: function valueFormater(value) {
@@ -157,27 +158,27 @@ IglooRangePicker.formItemPropsHandler = function (_ref4) {
157
158
  'element-allowClear': false
158
159
  };
159
160
  };
160
- var IglooWeekPicker = function IglooWeekPicker(_ref9) {
161
- var value = _ref9.value,
162
- format = _ref9.format,
163
- placeholder = _ref9.placeholder,
164
- _ref9$suffixIcon = _ref9.suffixIcon,
165
- suffixIcon = _ref9$suffixIcon === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
161
+ var IglooWeekPicker = function IglooWeekPicker(_ref7) {
162
+ var value = _ref7.value,
163
+ format = _ref7.format,
164
+ placeholder = _ref7.placeholder,
165
+ _ref7$suffixIcon = _ref7.suffixIcon,
166
+ suffixIcon = _ref7$suffixIcon === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
166
167
  style: {
167
168
  fontSize: 24
168
169
  }
169
- }) : _ref9$suffixIcon,
170
- className = _ref9.className,
171
- _onOpenChange3 = _ref9.onOpenChange,
172
- props = _objectWithoutProperties(_ref9, _excluded3);
170
+ }) : _ref7$suffixIcon,
171
+ className = _ref7.className,
172
+ _onOpenChange3 = _ref7.onOpenChange,
173
+ props = _objectWithoutProperties(_ref7, _excluded3);
173
174
  var _useState5 = (0, _react.useState)(false),
174
175
  _useState6 = _slicedToArray(_useState5, 2),
175
176
  focusStaus = _useState6[0],
176
177
  setFocus = _useState6[1];
177
178
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(WeekPicker, _objectSpread(_objectSpread({}, (0, _omit.default)(props, _formMethods.default)), {}, {
178
179
  value: value ? (0, _dayjs.default)(value) : value,
179
- placeholder: placeholder || dateFormater,
180
- format: format || dateFormater,
180
+ placeholder: placeholder,
181
+ format: format,
181
182
  inputReadOnly: true,
182
183
  suffixIcon: suffixIcon,
183
184
  className: (0, _classnames.default)(className, 'igloo-date-picker-container', {
@@ -191,14 +192,14 @@ var IglooWeekPicker = function IglooWeekPicker(_ref9) {
191
192
  }));
192
193
  };
193
194
  exports.IglooWeekPicker = IglooWeekPicker;
194
- IglooWeekPicker.formItemPropsHandler = function (_ref10) {
195
- var format = _ref10.format;
195
+ IglooWeekPicker.formItemPropsHandler = function (_ref8) {
196
+ var format = _ref8.format;
196
197
  return {
197
198
  getValueFromEvent: function getValueFromEvent(m) {
198
- return +m;
199
+ return m === null ? m : +m;
199
200
  },
200
201
  previewFormater: function previewFormater(value) {
201
- return (0, _dayjs.default)(value).format(format || dateFormater);
202
+ return (0, _dayjs.default)(value).format(format);
202
203
  },
203
204
  valueFormater: function valueFormater(value) {
204
205
  return value ? +(0, _dayjs.default)(value) : value;
@@ -206,27 +207,27 @@ IglooWeekPicker.formItemPropsHandler = function (_ref10) {
206
207
  'element-allowClear': false
207
208
  };
208
209
  };
209
- var IglooMonthPicker = function IglooMonthPicker(_ref11) {
210
- var value = _ref11.value,
211
- format = _ref11.format,
212
- placeholder = _ref11.placeholder,
213
- _ref11$suffixIcon = _ref11.suffixIcon,
214
- suffixIcon = _ref11$suffixIcon === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
210
+ var IglooMonthPicker = function IglooMonthPicker(_ref9) {
211
+ var value = _ref9.value,
212
+ format = _ref9.format,
213
+ placeholder = _ref9.placeholder,
214
+ _ref9$suffixIcon = _ref9.suffixIcon,
215
+ suffixIcon = _ref9$suffixIcon === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
215
216
  style: {
216
217
  fontSize: 24
217
218
  }
218
- }) : _ref11$suffixIcon,
219
- _onOpenChange4 = _ref11.onOpenChange,
220
- className = _ref11.className,
221
- props = _objectWithoutProperties(_ref11, _excluded4);
219
+ }) : _ref9$suffixIcon,
220
+ _onOpenChange4 = _ref9.onOpenChange,
221
+ className = _ref9.className,
222
+ props = _objectWithoutProperties(_ref9, _excluded4);
222
223
  var _useState7 = (0, _react.useState)(false),
223
224
  _useState8 = _slicedToArray(_useState7, 2),
224
225
  focusStaus = _useState8[0],
225
226
  setFocus = _useState8[1];
226
227
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(MonthPicker, _objectSpread(_objectSpread({}, (0, _omit.default)(props, _formMethods.default)), {}, {
227
228
  value: value ? (0, _dayjs.default)(value) : value,
228
- placeholder: placeholder || dateFormater,
229
- format: format || dateFormater,
229
+ placeholder: placeholder,
230
+ format: format,
230
231
  inputReadOnly: true,
231
232
  suffixIcon: suffixIcon,
232
233
  className: (0, _classnames.default)(className, 'igloo-date-picker-container', {
@@ -240,14 +241,14 @@ var IglooMonthPicker = function IglooMonthPicker(_ref11) {
240
241
  }));
241
242
  };
242
243
  exports.IglooMonthPicker = IglooMonthPicker;
243
- IglooMonthPicker.formItemPropsHandler = function (_ref12) {
244
- var format = _ref12.format;
244
+ IglooMonthPicker.formItemPropsHandler = function (_ref10) {
245
+ var format = _ref10.format;
245
246
  return {
246
247
  getValueFromEvent: function getValueFromEvent(m) {
247
- return +m;
248
+ return m === null ? m : +m;
248
249
  },
249
250
  previewFormater: function previewFormater(value) {
250
- return (0, _dayjs.default)(value).format(format || dateFormater);
251
+ return (0, _dayjs.default)(value).format(format);
251
252
  },
252
253
  valueFormater: function valueFormater(value) {
253
254
  return value ? +(0, _dayjs.default)(value) : value;
@@ -193,10 +193,10 @@ PhoneNumber.formItemPropsHandler = function (_ref2) {
193
193
  var initialAreaCode = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.areaCode) || (Array.isArray(areaCode) ? areaCode[0] : areaCode);
194
194
  var initialPhoneNumber = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.phoneNumber) || phoneNumber;
195
195
  return {
196
- initialValue: {
196
+ initialValue: initialPhoneNumber ? {
197
197
  areaCode: initialAreaCode,
198
198
  phoneNumber: initialPhoneNumber
199
- },
199
+ } : undefined,
200
200
  rules: rules,
201
201
  previewFormater: function previewFormater(_ref3) {
202
202
  var areaCode = _ref3.areaCode,
@@ -18,6 +18,7 @@
18
18
  background: transparent;
19
19
  width: 100vw;
20
20
  height: 100vh;
21
+ padding: 0;
21
22
  filter: none;
22
23
 
23
24
  .ant-modal-body {
@@ -37,10 +38,10 @@
37
38
  line-height: 40px;
38
39
  justify-content: center;
39
40
  cursor: pointer;
40
- color: @icon-color;
41
+ color: @icon-color;
41
42
 
42
43
  &:hover {
43
- color: @text-color;
44
+ color: @text-color;
44
45
  }
45
46
  }
46
47
  }
@@ -128,10 +129,10 @@
128
129
  background: #fff;
129
130
  border-radius: 40px;
130
131
  user-select: none;
131
- color: @icon-color;
132
+ color: @icon-color;
132
133
 
133
134
  &:hover {
134
- color: @text-color;
135
+ color: @text-color;
135
136
  }
136
137
  }
137
138
 
@@ -163,10 +164,10 @@
163
164
  cursor: pointer;
164
165
  background: #fff;
165
166
  border-radius: 40px;
166
- color: @icon-color;
167
+ color: @icon-color;
167
168
 
168
169
  &:hover {
169
- color: @text-color;
170
+ color: @text-color;
170
171
  }
171
172
  }
172
173
  }
@@ -308,7 +308,9 @@ var calcFormItemProps = function calcFormItemProps(config, extraProps, form, par
308
308
  try {
309
309
  var fn = eval(code);
310
310
  var formValues = form === null || form === void 0 ? void 0 : form.getFieldsValue(true);
311
- var _result2 = fn(value, formValues);
311
+ var _result2 = fn(value, formValues, {
312
+ moment: _dayjs.default
313
+ });
312
314
  return _result2 ? Promise.resolve() : Promise.reject(errorMessage);
313
315
  } catch (_unused) {
314
316
  return Promise.reject(errorMessage);
@@ -1,2 +1,2 @@
1
1
  export declare const parseFileSize: (size: number) => string;
2
- export declare function classifyType(type: string): "image" | "video" | "pdf" | "unknown";
2
+ export declare function classifyType(type: string): "video" | "image" | "pdf" | "unknown";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
File without changes
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- libraryName: string;
3
- libraryDirectory: string;
4
- style: boolean;
5
- customName: (name: string) => string;
6
- };
7
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- import { BackTopProps } from 'antd';
4
- declare const BackToTop: FC<BackTopProps>;
5
- export default BackToTop;
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import './default-input.less';
2
- import './common.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,11 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- export declare const locales: {
3
- [key: string]: {
4
- [id: string]: string;
5
- };
6
- };
7
- declare const LocaleProvider: FC<{
8
- currentLang: string;
9
- children?: ReactNode;
10
- }>;
11
- export default LocaleProvider;
@@ -1,7 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- import './style';
3
- interface Props {
4
- showAppStore?: boolean;
5
- }
6
- declare const LoginPage: FC<PropsWithChildren<Props>>;
7
- export default LoginPage;
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1,12 +0,0 @@
1
- import { FC, CSSProperties } from 'react';
2
- import './style';
3
- declare const PlatformCard: FC<{
4
- platform: string | {
5
- name: string;
6
- key: string;
7
- };
8
- onClick: any;
9
- className?: any;
10
- style?: CSSProperties;
11
- }>;
12
- export default PlatformCard;
@@ -1,12 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- interface Props {
4
- platforms: (string | {
5
- name: string;
6
- key: string;
7
- })[];
8
- currentPlatform: string;
9
- onChange: (platform: string) => any;
10
- }
11
- declare const SwitchPlatform: FC<Props>;
12
- export default SwitchPlatform;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { TabsProps } from 'antd';
3
- import './style';
4
- interface IglooTabsProps extends TabsProps {
5
- }
6
- export declare const TabPane: React.FC<import("antd").TabPaneProps>;
7
- /**
8
- * Tab
9
- * @param {*} 所有antd的tabs
10
- */
11
- declare function Tabs(props: IglooTabsProps): import("react/jsx-runtime").JSX.Element;
12
- declare namespace Tabs {
13
- var TabPane: React.FC<import("antd").TabPaneProps>;
14
- }
15
- export default Tabs;
@@ -1,3 +0,0 @@
1
- import type { DependencyList } from 'react';
2
- declare function useAsyncEffect(effect: () => AsyncGenerator<void, void, void> | Promise<void>, deps?: DependencyList): void;
3
- export default useAsyncEffect;
File without changes
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- libraryName: string;
3
- libraryDirectory: string;
4
- style: boolean;
5
- customName: (name: string) => string;
6
- };
7
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- import { BackTopProps } from 'antd';
4
- declare const BackToTop: FC<BackTopProps>;
5
- export default BackToTop;
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import './default-input.less';
2
- import './common.less';