iglooform 2.5.56 → 2.5.58

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,7 +1,6 @@
1
1
  // @ts-nocheck
2
2
  // This file is generated by Umi automatically
3
3
  // DO NOT CHANGE IT MANUALLY!
4
- import type { IRuntimeConfig as Plugin0 } from '/Users/lei/iglooform/.dumi/tmp/plugin-antd/runtimeConfig.d'
5
4
  interface IDefaultRuntimeConfig {
6
5
  onRouteChange?: (props: { routes: any, clientRoutes: any, location: any, action: any, isFirst: boolean }) => void;
7
6
  patchRoutes?: (props: { routes: any }) => void;
@@ -10,7 +9,7 @@ interface IDefaultRuntimeConfig {
10
9
  rootContainer?: (lastRootContainer: JSX.Element, args?: any) => void;
11
10
  [key: string]: any;
12
11
  }
13
- export type RuntimeConfig = IDefaultRuntimeConfig & Plugin0
12
+ export type RuntimeConfig = IDefaultRuntimeConfig
14
13
 
15
14
  export function defineApp(config: RuntimeConfig): RuntimeConfig {
16
15
  return config;
@@ -5,7 +5,6 @@ import * as Plugin_0 from '@@/core/exportStaticRuntimePlugin.ts';
5
5
  import * as Plugin_1 from '@@/core/helmet.ts';
6
6
  import * as Plugin_2 from '@@/dumi/meta/runtime.ts';
7
7
  import * as Plugin_3 from '@@/dumi/locales/runtime.tsx';
8
- import * as Plugin_4 from '/Users/lei/iglooform/.dumi/tmp/plugin-antd/runtime.tsx';
9
8
  import { PluginManager } from 'umi';
10
9
 
11
10
  function __defaultExport (obj) {
@@ -32,15 +31,11 @@ export function getPlugins() {
32
31
  apply: Plugin_3,
33
32
  path: process.env.NODE_ENV === 'production' ? void 0 : '@@/dumi/locales/runtime.tsx',
34
33
  },
35
- {
36
- apply: Plugin_4,
37
- path: process.env.NODE_ENV === 'production' ? void 0 : '/Users/lei/iglooform/.dumi/tmp/plugin-antd/runtime.tsx',
38
- },
39
34
  ];
40
35
  }
41
36
 
42
37
  export function getValidKeys() {
43
- return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange','modifyCodeSandboxData','modifyStackBlitzData','antd',];
38
+ return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange','modifyCodeSandboxData','modifyStackBlitzData',];
44
39
  }
45
40
 
46
41
  let pluginManager = null;
@@ -269,17 +269,6 @@ interface IConfigTypes {
269
269
  };
270
270
  run: {
271
271
  globals?: (Array<string> | undefined);
272
- };
273
- antd: {
274
- configProvider?: ({ [x: string]: any } | undefined);
275
- dark?: (boolean | undefined);
276
- compact?: (boolean | undefined);
277
- import?: (boolean | undefined);
278
- style?: ("less" | "css" | undefined);
279
- theme?: ({ [x: string]: any } | undefined);
280
- appConfig?: ({ [x: string]: any } | undefined);
281
- momentPicker?: (boolean | undefined);
282
- styleProvider?: ({ [x: string]: any } | undefined);
283
272
  };
284
273
  };
285
274
 
@@ -30,7 +30,7 @@ export default function DumiContextWrapper() {
30
30
 
31
31
  return (
32
32
  <SiteContext.Provider value={{
33
- pkg: {"name":"iglooform","version":"3.0.1","license":"MIT"},
33
+ pkg: {"name":"iglooform","version":"2.5.56","license":"MIT"},
34
34
  historyType: "browser",
35
35
  entryExports,
36
36
  demos,
@@ -39,7 +39,7 @@ export default function DumiContextWrapper() {
39
39
  loading,
40
40
  setLoading,
41
41
  hostname: undefined,
42
- themeConfig: {"footer":"Copyright © 2023 | Powered by <a href=\"https://d.umijs.org\" target=\"_blank\" rel=\"noreferrer\">dumi</a>","prefersColor":{"default":"light","switch":true},"nprogress":true,"lastUpdated":true,"mode":"site","title":"iglooform","logo":"/logo.png","name":"iglooform","nav":{"mode":"append","value":[{"title":"2.x","link":"https://iglooform.dev.axinan.com"}]}},
42
+ themeConfig: {"footer":"Copyright © 2023 | Powered by <a href=\"https://d.umijs.org\" target=\"_blank\" rel=\"noreferrer\">dumi</a>","prefersColor":{"default":"light","switch":true},"nprogress":true,"lastUpdated":true},
43
43
  _2_level_nav_available: false,
44
44
  }}>
45
45
  {outlet}
@@ -19,7 +19,7 @@
19
19
  right: 0px;
20
20
  width: 100px;
21
21
  height: 100%;
22
- box-shadow: 0 0 10px undefined, 0 0 5px undefined;
22
+ box-shadow: 0 0 10px #1677ff, 0 0 5px #1677ff;
23
23
  opacity: 1.0;
24
24
  transform: rotate(3deg) translate(0px, -4px);
25
25
  }
@@ -37,8 +37,8 @@
37
37
  height: 18px;
38
38
  box-sizing: border-box;
39
39
  border: solid 2px transparent;
40
- border-top-color: undefined;
41
- border-left-color: undefined;
40
+ border-top-color: #1677ff;
41
+ border-left-color: #1677ff;
42
42
  border-radius: 50%;
43
43
  animation: nprogress-spinner 400ms linear infinite;
44
44
  }
@@ -15,4 +15,3 @@ export const useServerInsertedHTML: Function = () => {};
15
15
  // plugins
16
16
  export { getSketchJSON } from '/Users/lei/iglooform/.dumi/tmp/plugin-html2sketch';
17
17
  // plugins types.d.ts
18
- export * from '/Users/lei/iglooform/.dumi/tmp/plugin-antd/types.d';
@@ -9,10 +9,8 @@ import { createPluginManager } from './core/plugin';
9
9
  import { getRoutes } from './core/route';
10
10
  import type { Location } from 'history';
11
11
 
12
- import '/Users/lei/iglooform/.dumi/global.less';
13
12
  import { getPluginManager as getDumiPluginManager } from './core/plugin';
14
13
  import { setPluginManager as setDumiPluginManager } from '/Users/lei/iglooform/node_modules/dumi/dist/client/theme-api/utils.js';
15
- import 'antd/dist/reset.css';
16
14
  const publicPath = '/';
17
15
  const runtimePublicPath = false;
18
16
 
package/.dumi/tmp/umi.ts CHANGED
@@ -2,17 +2,15 @@
2
2
  // This file is generated by Umi automatically
3
3
  // DO NOT CHANGE IT MANUALLY!
4
4
  import './core/polyfill';
5
- import '/Users/lei/iglooform/.dumi/global.less';
6
5
  import { getPluginManager as getDumiPluginManager } from './core/plugin';
7
6
  import { setPluginManager as setDumiPluginManager } from '/Users/lei/iglooform/node_modules/dumi/dist/client/theme-api/utils.js';
8
- import 'antd/dist/reset.css';
9
7
  import { renderClient } from '/Users/lei/iglooform/node_modules/@umijs/renderer-react';
10
8
  import { getRoutes } from './core/route';
11
9
  import { createPluginManager } from './core/plugin';
12
10
  import { createHistory } from './core/history';
13
11
  import Loading from '@@/dumi/theme/loading';
14
12
  import { ApplyPluginsType } from 'umi';
15
- import '/Users/lei/iglooform/.dumi/overrides.less';
13
+
16
14
 
17
15
  const publicPath = "/";
18
16
  const runtimePublicPath = false;
@@ -94,7 +94,7 @@ IglooBuddhistDatePicker.formItemPropsHandler = function (_ref2) {
94
94
  var format = _ref2.format;
95
95
  return {
96
96
  getValueFromEvent: function getValueFromEvent(m) {
97
- return +m;
97
+ return m === null ? m : +m;
98
98
  },
99
99
  previewFormater: function previewFormater(value) {
100
100
  return moment(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 moment(value).format(format || dateFormater);
@@ -136,17 +136,19 @@ export var IglooRangePicker = function IglooRangePicker(_ref3) {
136
136
  IglooRangePicker.formItemPropsHandler = function (_ref4) {
137
137
  var format = _ref4.format;
138
138
  return {
139
- getValueFromEvent: function getValueFromEvent(_ref5) {
140
- var _ref6 = _slicedToArray(_ref5, 2),
141
- start = _ref6[0],
142
- end = _ref6[1];
139
+ getValueFromEvent: function getValueFromEvent(values) {
140
+ if (!values) return values;
141
+
142
+ var _values = _slicedToArray(values, 2),
143
+ start = _values[0],
144
+ end = _values[1];
143
145
 
144
146
  return [+start, +end];
145
147
  },
146
- previewFormater: function previewFormater(_ref7) {
147
- var _ref8 = _slicedToArray(_ref7, 2),
148
- start = _ref8[0],
149
- end = _ref8[1];
148
+ previewFormater: function previewFormater(_ref5) {
149
+ var _ref6 = _slicedToArray(_ref5, 2),
150
+ start = _ref6[0],
151
+ end = _ref6[1];
150
152
 
151
153
  return "".concat(moment(start).format(format || dateFormater), " - ").concat(moment(end).format(format || dateFormater));
152
154
  },
@@ -164,19 +166,19 @@ IglooRangePicker.formItemPropsHandler = function (_ref4) {
164
166
  };
165
167
  };
166
168
 
167
- export var IglooWeekPicker = function IglooWeekPicker(_ref9) {
168
- var value = _ref9.value,
169
- format = _ref9.format,
170
- placeholder = _ref9.placeholder,
171
- _ref9$suffixIcon = _ref9.suffixIcon,
172
- suffixIcon = _ref9$suffixIcon === void 0 ? _jsx(CalendarOutlined, {
169
+ export var IglooWeekPicker = function IglooWeekPicker(_ref7) {
170
+ var value = _ref7.value,
171
+ format = _ref7.format,
172
+ placeholder = _ref7.placeholder,
173
+ _ref7$suffixIcon = _ref7.suffixIcon,
174
+ suffixIcon = _ref7$suffixIcon === void 0 ? _jsx(CalendarOutlined, {
173
175
  style: {
174
176
  fontSize: 24
175
177
  }
176
- }) : _ref9$suffixIcon,
177
- className = _ref9.className,
178
- _onOpenChange3 = _ref9.onOpenChange,
179
- props = _objectWithoutProperties(_ref9, _excluded3);
178
+ }) : _ref7$suffixIcon,
179
+ className = _ref7.className,
180
+ _onOpenChange3 = _ref7.onOpenChange,
181
+ props = _objectWithoutProperties(_ref7, _excluded3);
180
182
 
181
183
  var _useState5 = useState(false),
182
184
  _useState6 = _slicedToArray(_useState5, 2),
@@ -185,8 +187,8 @@ export var IglooWeekPicker = function IglooWeekPicker(_ref9) {
185
187
 
186
188
  return _jsx(WeekPicker, _objectSpread(_objectSpread({}, omit(props, formMethods)), {}, {
187
189
  value: value ? moment(value) : value,
188
- placeholder: placeholder || dateFormater,
189
- format: format || dateFormater,
190
+ placeholder: placeholder,
191
+ format: format,
190
192
  inputReadOnly: true,
191
193
  suffixIcon: suffixIcon,
192
194
  className: classnames(className, 'igloo-date-picker-container', {
@@ -200,14 +202,14 @@ export var IglooWeekPicker = function IglooWeekPicker(_ref9) {
200
202
  }));
201
203
  };
202
204
 
203
- IglooWeekPicker.formItemPropsHandler = function (_ref10) {
204
- var format = _ref10.format;
205
+ IglooWeekPicker.formItemPropsHandler = function (_ref8) {
206
+ var format = _ref8.format;
205
207
  return {
206
208
  getValueFromEvent: function getValueFromEvent(m) {
207
- return +m;
209
+ return m === null ? m : +m;
208
210
  },
209
211
  previewFormater: function previewFormater(value) {
210
- return moment(value).format(format || dateFormater);
212
+ return moment(value).format(format);
211
213
  },
212
214
  valueFormater: function valueFormater(value) {
213
215
  return value ? +moment(value) : value;
@@ -216,19 +218,19 @@ IglooWeekPicker.formItemPropsHandler = function (_ref10) {
216
218
  };
217
219
  };
218
220
 
219
- export var IglooMonthPicker = function IglooMonthPicker(_ref11) {
220
- var value = _ref11.value,
221
- format = _ref11.format,
222
- placeholder = _ref11.placeholder,
223
- _ref11$suffixIcon = _ref11.suffixIcon,
224
- suffixIcon = _ref11$suffixIcon === void 0 ? _jsx(CalendarOutlined, {
221
+ export var IglooMonthPicker = function IglooMonthPicker(_ref9) {
222
+ var value = _ref9.value,
223
+ format = _ref9.format,
224
+ placeholder = _ref9.placeholder,
225
+ _ref9$suffixIcon = _ref9.suffixIcon,
226
+ suffixIcon = _ref9$suffixIcon === void 0 ? _jsx(CalendarOutlined, {
225
227
  style: {
226
228
  fontSize: 24
227
229
  }
228
- }) : _ref11$suffixIcon,
229
- _onOpenChange4 = _ref11.onOpenChange,
230
- className = _ref11.className,
231
- props = _objectWithoutProperties(_ref11, _excluded4);
230
+ }) : _ref9$suffixIcon,
231
+ _onOpenChange4 = _ref9.onOpenChange,
232
+ className = _ref9.className,
233
+ props = _objectWithoutProperties(_ref9, _excluded4);
232
234
 
233
235
  var _useState7 = useState(false),
234
236
  _useState8 = _slicedToArray(_useState7, 2),
@@ -237,8 +239,8 @@ export var IglooMonthPicker = function IglooMonthPicker(_ref11) {
237
239
 
238
240
  return _jsx(MonthPicker, _objectSpread(_objectSpread({}, omit(props, formMethods)), {}, {
239
241
  value: value ? moment(value) : value,
240
- placeholder: placeholder || dateFormater,
241
- format: format || dateFormater,
242
+ placeholder: placeholder,
243
+ format: format,
242
244
  inputReadOnly: true,
243
245
  suffixIcon: suffixIcon,
244
246
  className: classnames(className, 'igloo-date-picker-container', {
@@ -252,14 +254,14 @@ export var IglooMonthPicker = function IglooMonthPicker(_ref11) {
252
254
  }));
253
255
  };
254
256
 
255
- IglooMonthPicker.formItemPropsHandler = function (_ref12) {
256
- var format = _ref12.format;
257
+ IglooMonthPicker.formItemPropsHandler = function (_ref10) {
258
+ var format = _ref10.format;
257
259
  return {
258
260
  getValueFromEvent: function getValueFromEvent(m) {
259
- return +m;
261
+ return m === null ? m : +m;
260
262
  },
261
263
  previewFormater: function previewFormater(value) {
262
- return moment(value).format(format || dateFormater);
264
+ return moment(value).format(format);
263
265
  },
264
266
  valueFormater: function valueFormater(value) {
265
267
  return value ? +moment(value) : value;
@@ -57,6 +57,8 @@ var PhoneNumber = function PhoneNumber(_ref) {
57
57
  setNumber = _useState4[1];
58
58
 
59
59
  useEffect(function () {
60
+ if (!value) return;
61
+
60
62
  if ((value === null || value === void 0 ? void 0 : value.areaCode) === selectedCode && (value === null || value === void 0 ? void 0 : value.phoneNumber) === number) {
61
63
  return;
62
64
  }
@@ -205,10 +207,10 @@ PhoneNumber.formItemPropsHandler = function (_ref2) {
205
207
  var initialAreaCode = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.areaCode) || (Array.isArray(areaCode) ? areaCode[0] : areaCode);
206
208
  var initialPhoneNumber = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.phoneNumber) || phoneNumber;
207
209
  return {
208
- initialValue: {
210
+ initialValue: initialPhoneNumber ? {
209
211
  areaCode: initialAreaCode,
210
212
  phoneNumber: initialPhoneNumber
211
- },
213
+ } : undefined,
212
214
  rules: rules,
213
215
  previewFormater: function previewFormater(_ref3) {
214
216
  var areaCode = _ref3.areaCode,
@@ -366,7 +366,9 @@ export var calcFormItemProps = function calcFormItemProps(config, extraProps, fo
366
366
  var fn = eval(code);
367
367
  var formValues = form === null || form === void 0 ? void 0 : form.getFieldsValue(true);
368
368
 
369
- var _result2 = fn(value, formValues);
369
+ var _result2 = fn(value, formValues, {
370
+ moment: moment
371
+ });
370
372
 
371
373
  return _result2 ? Promise.resolve() : Promise.reject(errorMessage);
372
374
  } catch (_unused) {
@@ -113,7 +113,7 @@ IglooBuddhistDatePicker.formItemPropsHandler = function (_ref2) {
113
113
  var format = _ref2.format;
114
114
  return {
115
115
  getValueFromEvent: function getValueFromEvent(m) {
116
- return +m;
116
+ return m === null ? m : +m;
117
117
  },
118
118
  previewFormater: function previewFormater(value) {
119
119
  return (0, _moment2.default)(value).format(format || dateFormater);
@@ -110,7 +110,7 @@ IglooDatePicker.formItemPropsHandler = function (_ref2) {
110
110
  var format = _ref2.format;
111
111
  return {
112
112
  getValueFromEvent: function getValueFromEvent(m) {
113
- return +m;
113
+ return m === null ? m : +m;
114
114
  },
115
115
  previewFormater: function previewFormater(value) {
116
116
  return (0, _moment.default)(value).format(format || dateFormater);
@@ -167,17 +167,19 @@ exports.IglooRangePicker = IglooRangePicker;
167
167
  IglooRangePicker.formItemPropsHandler = function (_ref4) {
168
168
  var format = _ref4.format;
169
169
  return {
170
- getValueFromEvent: function getValueFromEvent(_ref5) {
171
- var _ref6 = _slicedToArray(_ref5, 2),
172
- start = _ref6[0],
173
- end = _ref6[1];
170
+ getValueFromEvent: function getValueFromEvent(values) {
171
+ if (!values) return values;
172
+
173
+ var _values = _slicedToArray(values, 2),
174
+ start = _values[0],
175
+ end = _values[1];
174
176
 
175
177
  return [+start, +end];
176
178
  },
177
- previewFormater: function previewFormater(_ref7) {
178
- var _ref8 = _slicedToArray(_ref7, 2),
179
- start = _ref8[0],
180
- end = _ref8[1];
179
+ previewFormater: function previewFormater(_ref5) {
180
+ var _ref6 = _slicedToArray(_ref5, 2),
181
+ start = _ref6[0],
182
+ end = _ref6[1];
181
183
 
182
184
  return "".concat((0, _moment.default)(start).format(format || dateFormater), " - ").concat((0, _moment.default)(end).format(format || dateFormater));
183
185
  },
@@ -195,19 +197,19 @@ IglooRangePicker.formItemPropsHandler = function (_ref4) {
195
197
  };
196
198
  };
197
199
 
198
- var IglooWeekPicker = function IglooWeekPicker(_ref9) {
199
- var value = _ref9.value,
200
- format = _ref9.format,
201
- placeholder = _ref9.placeholder,
202
- _ref9$suffixIcon = _ref9.suffixIcon,
203
- suffixIcon = _ref9$suffixIcon === void 0 ? (0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
200
+ var IglooWeekPicker = function IglooWeekPicker(_ref7) {
201
+ var value = _ref7.value,
202
+ format = _ref7.format,
203
+ placeholder = _ref7.placeholder,
204
+ _ref7$suffixIcon = _ref7.suffixIcon,
205
+ suffixIcon = _ref7$suffixIcon === void 0 ? (0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
204
206
  style: {
205
207
  fontSize: 24
206
208
  }
207
- }) : _ref9$suffixIcon,
208
- className = _ref9.className,
209
- _onOpenChange3 = _ref9.onOpenChange,
210
- props = _objectWithoutProperties(_ref9, _excluded3);
209
+ }) : _ref7$suffixIcon,
210
+ className = _ref7.className,
211
+ _onOpenChange3 = _ref7.onOpenChange,
212
+ props = _objectWithoutProperties(_ref7, _excluded3);
211
213
 
212
214
  var _useState5 = (0, _react.useState)(false),
213
215
  _useState6 = _slicedToArray(_useState5, 2),
@@ -216,8 +218,8 @@ var IglooWeekPicker = function IglooWeekPicker(_ref9) {
216
218
 
217
219
  return (0, _jsxRuntime.jsx)(WeekPicker, _objectSpread(_objectSpread({}, (0, _omit.default)(props, _formMethods.default)), {}, {
218
220
  value: value ? (0, _moment.default)(value) : value,
219
- placeholder: placeholder || dateFormater,
220
- format: format || dateFormater,
221
+ placeholder: placeholder,
222
+ format: format,
221
223
  inputReadOnly: true,
222
224
  suffixIcon: suffixIcon,
223
225
  className: (0, _classnames.default)(className, 'igloo-date-picker-container', {
@@ -233,14 +235,14 @@ var IglooWeekPicker = function IglooWeekPicker(_ref9) {
233
235
 
234
236
  exports.IglooWeekPicker = IglooWeekPicker;
235
237
 
236
- IglooWeekPicker.formItemPropsHandler = function (_ref10) {
237
- var format = _ref10.format;
238
+ IglooWeekPicker.formItemPropsHandler = function (_ref8) {
239
+ var format = _ref8.format;
238
240
  return {
239
241
  getValueFromEvent: function getValueFromEvent(m) {
240
- return +m;
242
+ return m === null ? m : +m;
241
243
  },
242
244
  previewFormater: function previewFormater(value) {
243
- return (0, _moment.default)(value).format(format || dateFormater);
245
+ return (0, _moment.default)(value).format(format);
244
246
  },
245
247
  valueFormater: function valueFormater(value) {
246
248
  return value ? +(0, _moment.default)(value) : value;
@@ -249,19 +251,19 @@ IglooWeekPicker.formItemPropsHandler = function (_ref10) {
249
251
  };
250
252
  };
251
253
 
252
- var IglooMonthPicker = function IglooMonthPicker(_ref11) {
253
- var value = _ref11.value,
254
- format = _ref11.format,
255
- placeholder = _ref11.placeholder,
256
- _ref11$suffixIcon = _ref11.suffixIcon,
257
- suffixIcon = _ref11$suffixIcon === void 0 ? (0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
254
+ var IglooMonthPicker = function IglooMonthPicker(_ref9) {
255
+ var value = _ref9.value,
256
+ format = _ref9.format,
257
+ placeholder = _ref9.placeholder,
258
+ _ref9$suffixIcon = _ref9.suffixIcon,
259
+ suffixIcon = _ref9$suffixIcon === void 0 ? (0, _jsxRuntime.jsx)(_iglooicon.CalendarOutlined, {
258
260
  style: {
259
261
  fontSize: 24
260
262
  }
261
- }) : _ref11$suffixIcon,
262
- _onOpenChange4 = _ref11.onOpenChange,
263
- className = _ref11.className,
264
- props = _objectWithoutProperties(_ref11, _excluded4);
263
+ }) : _ref9$suffixIcon,
264
+ _onOpenChange4 = _ref9.onOpenChange,
265
+ className = _ref9.className,
266
+ props = _objectWithoutProperties(_ref9, _excluded4);
265
267
 
266
268
  var _useState7 = (0, _react.useState)(false),
267
269
  _useState8 = _slicedToArray(_useState7, 2),
@@ -270,8 +272,8 @@ var IglooMonthPicker = function IglooMonthPicker(_ref11) {
270
272
 
271
273
  return (0, _jsxRuntime.jsx)(MonthPicker, _objectSpread(_objectSpread({}, (0, _omit.default)(props, _formMethods.default)), {}, {
272
274
  value: value ? (0, _moment.default)(value) : value,
273
- placeholder: placeholder || dateFormater,
274
- format: format || dateFormater,
275
+ placeholder: placeholder,
276
+ format: format,
275
277
  inputReadOnly: true,
276
278
  suffixIcon: suffixIcon,
277
279
  className: (0, _classnames.default)(className, 'igloo-date-picker-container', {
@@ -287,14 +289,14 @@ var IglooMonthPicker = function IglooMonthPicker(_ref11) {
287
289
 
288
290
  exports.IglooMonthPicker = IglooMonthPicker;
289
291
 
290
- IglooMonthPicker.formItemPropsHandler = function (_ref12) {
291
- var format = _ref12.format;
292
+ IglooMonthPicker.formItemPropsHandler = function (_ref10) {
293
+ var format = _ref10.format;
292
294
  return {
293
295
  getValueFromEvent: function getValueFromEvent(m) {
294
- return +m;
296
+ return m === null ? m : +m;
295
297
  },
296
298
  previewFormater: function previewFormater(value) {
297
- return (0, _moment.default)(value).format(format || dateFormater);
299
+ return (0, _moment.default)(value).format(format);
298
300
  },
299
301
  valueFormater: function valueFormater(value) {
300
302
  return value ? +(0, _moment.default)(value) : value;
@@ -75,6 +75,8 @@ var PhoneNumber = function PhoneNumber(_ref) {
75
75
  setNumber = _useState4[1];
76
76
 
77
77
  (0, _react.useEffect)(function () {
78
+ if (!value) return;
79
+
78
80
  if ((value === null || value === void 0 ? void 0 : value.areaCode) === selectedCode && (value === null || value === void 0 ? void 0 : value.phoneNumber) === number) {
79
81
  return;
80
82
  }
@@ -223,10 +225,10 @@ PhoneNumber.formItemPropsHandler = function (_ref2) {
223
225
  var initialAreaCode = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.areaCode) || (Array.isArray(areaCode) ? areaCode[0] : areaCode);
224
226
  var initialPhoneNumber = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.phoneNumber) || phoneNumber;
225
227
  return {
226
- initialValue: {
228
+ initialValue: initialPhoneNumber ? {
227
229
  areaCode: initialAreaCode,
228
230
  phoneNumber: initialPhoneNumber
229
- },
231
+ } : undefined,
230
232
  rules: rules,
231
233
  previewFormater: function previewFormater(_ref3) {
232
234
  var areaCode = _ref3.areaCode,
@@ -385,7 +385,9 @@ var calcFormItemProps = function calcFormItemProps(config, extraProps, form, par
385
385
  var fn = eval(code);
386
386
  var formValues = form === null || form === void 0 ? void 0 : form.getFieldsValue(true);
387
387
 
388
- var _result2 = fn(value, formValues);
388
+ var _result2 = fn(value, formValues, {
389
+ moment: _moment.default
390
+ });
389
391
 
390
392
  return _result2 ? Promise.resolve() : Promise.reject(errorMessage);
391
393
  } catch (_unused) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.5.56",
3
+ "version": "2.5.58",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
@@ -1,65 +0,0 @@
1
- // @ts-nocheck
2
- // This file is generated by Umi automatically
3
- // DO NOT CHANGE IT MANUALLY!
4
- import React from 'react';
5
- import {
6
- Modal,
7
- ConfigProvider,
8
- message,
9
- notification,
10
- } from 'antd';
11
- import { ApplyPluginsType } from 'umi';
12
- import { getPluginManager } from '../core/plugin';
13
-
14
- let cacheAntdConfig = null;
15
-
16
- const getAntdConfig = () => {
17
- if(!cacheAntdConfig){
18
- cacheAntdConfig = getPluginManager().applyPlugins({
19
- key: 'antd',
20
- type: ApplyPluginsType.modify,
21
- initialValue: {
22
- ...{"theme":{"token":{"colorPrimary":"#5858FF","colorError":"#F52209","colorSuccess":"#108043","colorInfo":"#1E90FF","colorWarning":"#CF8909","controlHeight":48,"controlHeightSM":24,"controlOutlineWidth":0,"borderRadius":3,"fontSize":16,"lineHeight":1.2857,"fontFamily":"Roboto"},"components":{"Radio":{"radioSize":22,"dotSize":8,"buttonCheckedBgDisabled":"rgba(0, 0, 0, 0.04)"},"Pagination":{"itemSizeSM":40},"DatePicker":{"pickerPanelCellWidth":36}}}},
23
- },
24
- });
25
- }
26
- return cacheAntdConfig;
27
- }
28
-
29
- export function rootContainer(rawContainer) {
30
- const {
31
- appConfig,
32
- ...finalConfigProvider
33
- } = getAntdConfig();
34
- let container = rawContainer;
35
- if (finalConfigProvider.prefixCls) {
36
- Modal.config({
37
- rootPrefixCls: finalConfigProvider.prefixCls
38
- });
39
- message.config({
40
- prefixCls: `${finalConfigProvider.prefixCls}-message`
41
- });
42
- notification.config({
43
- prefixCls: `${finalConfigProvider.prefixCls}-notification`
44
- });
45
- }
46
-
47
- if (finalConfigProvider.iconPrefixCls) {
48
- // Icons in message need to set iconPrefixCls via ConfigProvider.config()
49
- ConfigProvider.config({
50
- iconPrefixCls: finalConfigProvider.iconPrefixCls,
51
- });
52
- };
53
-
54
- if (finalConfigProvider.theme) {
55
- // Pass config theme to static method
56
- ConfigProvider.config({
57
- theme: finalConfigProvider.theme,
58
- });
59
- }
60
-
61
- container = <ConfigProvider {...finalConfigProvider}>{container}</ConfigProvider>;
62
-
63
-
64
- return container;
65
- }
@@ -1,6 +0,0 @@
1
- // This file is generated by Umi automatically
2
- // DO NOT CHANGE IT MANUALLY!
3
- import type { RuntimeAntdConfig } from './types.d';
4
- export type IRuntimeConfig = {
5
- antd?: RuntimeAntdConfig
6
- };
@@ -1,14 +0,0 @@
1
- // This file is generated by Umi automatically
2
- // DO NOT CHANGE IT MANUALLY!
3
- import type { ConfigProviderProps } from 'antd/es/config-provider';
4
-
5
- type Prettify<T> = {
6
- [K in keyof T]: T[K];
7
- } & {};
8
-
9
- type AntdConfig = Prettify<{}
10
- & ConfigProviderProps
11
-
12
- >;
13
-
14
- export type RuntimeAntdConfig = (memo: AntdConfig) => AntdConfig;