react-antd-xform 1.0.6 → 1.0.8

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.
@@ -16,16 +16,16 @@ const modelUtils = {
16
16
  if (!((_a = field.config) == null ? void 0 : _a.htmlId)) {
17
17
  continue;
18
18
  }
19
- const div = document.querySelector(
20
- `*[data-xform-id="${field.config.htmlId}"]`
21
- );
19
+ const div = document.querySelector(`*[data-xform-id="${field.config.htmlId}"]`);
22
20
  if (!div) {
23
21
  continue;
24
22
  }
25
23
  if (typeof div.scrollIntoViewIfNeeded === "function") {
26
24
  div.scrollIntoViewIfNeeded();
27
25
  } else {
28
- div.scrollIntoView({ block: "nearest" });
26
+ div.scrollIntoView({
27
+ block: "nearest"
28
+ });
29
29
  }
30
30
  return;
31
31
  }
@@ -36,23 +36,31 @@ const modelUtils = {
36
36
  if (!((_a = field.config) == null ? void 0 : _a.htmlId)) {
37
37
  continue;
38
38
  }
39
- const div = document.querySelector(
40
- `*[data-xform-id="${field.config.htmlId}"]`
41
- );
39
+ const div = document.querySelector(`*[data-xform-id="${field.config.htmlId}"]`);
42
40
  if (!div) {
43
41
  continue;
44
42
  }
45
- div.animate(
46
- [
47
- { offset: 0, transform: "translateX(0)" },
48
- { offset: 0.065, transform: "translateX(-6px) rotateY(-9deg)" },
49
- { offset: 0.185, transform: "translateX(5px) rotateY(7deg)" },
50
- { offset: 0.315, transform: "translateX(-3px) rotateY(-5deg)" },
51
- { offset: 0.435, transform: "translateX(2px) rotateY(3deg)" },
52
- { offset: 0.5, transform: "translateX(0)" }
53
- ],
54
- { duration: 750 }
55
- );
43
+ div.animate([{
44
+ offset: 0,
45
+ transform: "translateX(0)"
46
+ }, {
47
+ offset: 0.065,
48
+ transform: "translateX(-6px) rotateY(-9deg)"
49
+ }, {
50
+ offset: 0.185,
51
+ transform: "translateX(5px) rotateY(7deg)"
52
+ }, {
53
+ offset: 0.315,
54
+ transform: "translateX(-3px) rotateY(-5deg)"
55
+ }, {
56
+ offset: 0.435,
57
+ transform: "translateX(2px) rotateY(3deg)"
58
+ }, {
59
+ offset: 0.5,
60
+ transform: "translateX(0)"
61
+ }], {
62
+ duration: 750
63
+ });
56
64
  }
57
65
  },
58
66
  validateAll: action(function(model, trigger = "*") {
@@ -64,29 +72,21 @@ const modelUtils = {
64
72
  if (!field.isMounted) {
65
73
  return;
66
74
  }
67
- promises.push(
68
- field.validate(trigger).then(
69
- action((error) => {
70
- if (error) {
71
- hasError = true;
72
- observableSetIn(errors, field.path, error);
73
- errorFields.push(field);
74
- }
75
- })
76
- )
77
- );
75
+ promises.push(field.validate(trigger).then(action((error) => {
76
+ if (error) {
77
+ hasError = true;
78
+ observableSetIn(errors, field.path, error);
79
+ errorFields.push(field);
80
+ }
81
+ })));
78
82
  });
79
83
  model.iterateChecks((check) => {
80
- promises.push(
81
- check.validate().then(
82
- action((error) => {
83
- if (error) {
84
- hasError = true;
85
- observableSetIn(errors, check.path, error);
86
- }
87
- })
88
- )
89
- );
84
+ promises.push(check.validate().then(action((error) => {
85
+ if (error) {
86
+ hasError = true;
87
+ observableSetIn(errors, check.path, error);
88
+ }
89
+ })));
90
90
  });
91
91
  return Promise.all(promises).then(() => ({
92
92
  hasError,
@@ -103,7 +103,11 @@ const modelUtils = {
103
103
  animateErrorFields = false,
104
104
  scrollToFirstError = true
105
105
  } = options;
106
- const { hasError, errors, errorFields } = await modelUtils.validateAll(model);
106
+ const {
107
+ hasError,
108
+ errors,
109
+ errorFields
110
+ } = await modelUtils.validateAll(model);
107
111
  if (hasError) {
108
112
  if (scrollToFirstError) {
109
113
  modelUtils.scrollToFirstError(errorFields);
@@ -114,15 +118,17 @@ const modelUtils = {
114
118
  onError == null ? void 0 : onError(errors, model);
115
119
  } else if (typeof onSubmit === "function") {
116
120
  runInAction(() => {
117
- const result = observable(
118
- valueFilter === "all" ? toJS(model.values) : model._valueShape === "array" ? [] : {}
119
- );
120
- _mergeValuesFromViewToTarget(result, model, { mergeDefaultValue });
121
+ const result = observable(valueFilter === "all" ? toJS(model.values) : model._valueShape === "array" ? [] : {});
122
+ _mergeValuesFromViewToTarget(result, model, {
123
+ mergeDefaultValue
124
+ });
121
125
  onSubmit(toJS(result), model);
122
126
  });
123
127
  }
124
128
  }),
125
- reset: action(function(model, { onReset } = {}) {
129
+ reset: action(function(model, {
130
+ onReset
131
+ } = {}) {
126
132
  model.values = {};
127
133
  modelUtils.clearError(model);
128
134
  onReset == null ? void 0 : onReset(model);
@@ -132,7 +138,9 @@ const modelUtils = {
132
138
  }),
133
139
  mergeValuesFromViewToView: _mergeValuesFromViewToTarget
134
140
  };
135
- function _mergeValuesFromViewToTarget(target, model, { mergeDefaultValue = true } = {}) {
141
+ function _mergeValuesFromViewToTarget(target, model, {
142
+ mergeDefaultValue = true
143
+ } = {}) {
136
144
  model.iterateFields((field) => {
137
145
  if (!field.isMounted) {
138
146
  return;
@@ -37,27 +37,23 @@ class FormModel {
37
37
  this._fieldIdGenerator = new IdGenerator("Field");
38
38
  this.id = this._modelIdGenerator.getNextId();
39
39
  this._values = composeValue(initValues, {});
40
- if (this._values == null) {
41
- console.warn("[xform] FormModel 根节点的初始 values 不能为 null");
42
- }
40
+ if (this._values == null) ;
43
41
  }
44
- makeObservable(
45
- this,
46
- {
47
- // root model 才会使用 this._values
48
- _values: this._modelType === ModelType.rootModel ? observable : false,
49
- values: computed,
50
- state: observable,
51
- setValue: action,
52
- // 注意 name 是可以变化的;在数组元素调换位置的情况下 name 会进行变更
53
- name: observable.ref,
54
- path: computed,
55
- _selfDeleted: observable.ref,
56
- isDeleted: computed,
57
- _markDeleted: action
58
- },
59
- { name: `${this.id}(${this.name})` }
60
- );
42
+ makeObservable(this, {
43
+ // root model 才会使用 this._values
44
+ _values: this._modelType === ModelType.rootModel ? observable : false,
45
+ values: computed,
46
+ state: observable,
47
+ setValue: action,
48
+ // 注意 name 是可以变化的;在数组元素调换位置的情况下 name 会进行变更
49
+ name: observable.ref,
50
+ path: computed,
51
+ _selfDeleted: observable.ref,
52
+ isDeleted: computed,
53
+ _markDeleted: action
54
+ }, {
55
+ name: `${this.id}(${this.name})`
56
+ });
61
57
  }
62
58
  get values() {
63
59
  if (this._modelType === ModelType.rootModel) {
@@ -68,15 +64,9 @@ class FormModel {
68
64
  }
69
65
  set values(nextValues) {
70
66
  if (this.isDeleted) {
71
- console.warn(
72
- "[xform] 对已删除的 Model 进行赋值将被忽略。请不要对已删除的 Model/Field 进行操作。"
73
- );
74
67
  return;
75
68
  }
76
69
  if (this._modelType === ModelType.rootModel) {
77
- if (nextValues == null) {
78
- console.warn("[xform] FormModel 根节点的 values 不能设置为 null/undefined");
79
- }
80
70
  this._values = nextValues;
81
71
  } else {
82
72
  this.parent.setValue(this.name, nextValues);
@@ -94,9 +84,6 @@ class FormModel {
94
84
  }
95
85
  setValue(name, value) {
96
86
  if (this.isDeleted) {
97
- console.warn(
98
- "[xform] 对已删除的 Model 进行赋值将被忽略。请不要对已删除的 Model/Field 进行操作。"
99
- );
100
87
  return;
101
88
  }
102
89
  if (this._modelType === ModelType.subModel && this.values == null) {
@@ -159,10 +146,7 @@ class FormModel {
159
146
  this._valueShape = valueShape;
160
147
  this._subModels = valueShape === "object" ? {} : [];
161
148
  } else {
162
- invariant(
163
- this._valueShape === valueShape,
164
- "[xform] FormModel 的结构需要在使用过程中保持一致,一个数据索引对应的结构不能从数组变为对象,也不能从对象变为数组"
165
- );
149
+ invariant(this._valueShape === valueShape, "[xform] FormModel 的结构需要在使用过程中保持一致,一个数据索引对应的结构不能从数组变为对象,也不能从对象变为数组");
166
150
  }
167
151
  }
168
152
  /** 递归前序遍历该 model 下所有的 model 对象(包含 model 本身) */
@@ -244,7 +228,6 @@ class Check {
244
228
  }
245
229
  _track(config) {
246
230
  if (this.isMounted) {
247
- console.warn(`[xform] check \`${this.path.join(".")}\` 已在视图中被加载。`);
248
231
  return;
249
232
  }
250
233
  this.config = config;
@@ -259,7 +242,9 @@ class Check {
259
242
  if (!this.isMounted) {
260
243
  return;
261
244
  }
262
- const { validate } = this.config;
245
+ const {
246
+ validate
247
+ } = this.config;
263
248
  let cancelled = false;
264
249
  (_a = this.cancelValidation) == null ? void 0 : _a.call(this);
265
250
  this.validating = true;
@@ -299,9 +284,6 @@ const _Field = class _Field {
299
284
  this.handleChange = (nextValue, ...rest) => {
300
285
  var _a, _b, _c;
301
286
  if (nextValue === void 0 && ((_a = this.config) == null ? void 0 : _a.defaultValue) !== void 0) {
302
- console.warn(
303
- "[xform] xform 中所有组件均为受控用法,不支持 onChange(undefined),该调用将自动变为 onChange(null)"
304
- );
305
287
  nextValue = null;
306
288
  }
307
289
  this.value = nextValue;
@@ -339,22 +321,18 @@ const _Field = class _Field {
339
321
  }
340
322
  const name = this.name;
341
323
  const forkName = this._forkName;
342
- makeObservable(
343
- this,
344
- {
345
- state: observable,
346
- value: computed,
347
- path: computed,
348
- validate: action,
349
- handleBlur: action,
350
- handleChange: action,
351
- clear: action,
352
- isDeleted: computed
353
- },
354
- {
355
- name: `${this.id}(${name}${forkName === _Field.ORIGINAL ? "" : "#" + forkName})`
356
- }
357
- );
324
+ makeObservable(this, {
325
+ state: observable,
326
+ value: computed,
327
+ path: computed,
328
+ validate: action,
329
+ handleBlur: action,
330
+ handleChange: action,
331
+ clear: action,
332
+ isDeleted: computed
333
+ }, {
334
+ name: `${this.id}(${name}${forkName === _Field.ORIGINAL ? "" : "#" + forkName})`
335
+ });
358
336
  if (forkName === _Field.ORIGINAL) {
359
337
  this._forkMap = /* @__PURE__ */ new Map();
360
338
  } else {
@@ -382,9 +360,6 @@ const _Field = class _Field {
382
360
  }
383
361
  set value(value) {
384
362
  if (this.isDeleted) {
385
- console.warn(
386
- "[xform] 对已删除的 Field 进行赋值将被忽略。请不要对已删除的 Model/Field 进行操作。"
387
- );
388
363
  return;
389
364
  }
390
365
  if (this.fieldType === FieldType.normal) {
@@ -393,22 +368,13 @@ const _Field = class _Field {
393
368
  this._tupleParts.forEach((part, index) => {
394
369
  this.parent.setValue(part, value == null ? value : value[index]);
395
370
  });
396
- } else if (this.fieldType === FieldType.readonly) {
397
- console.warn(
398
- "[xform] 对只读 Field 进行赋值将被忽略,请检查是否为 FormItem 设置了 props.name 或 props.field."
399
- );
400
- }
371
+ } else if (this.fieldType === FieldType.readonly) ;
401
372
  }
402
373
  get path() {
403
374
  return this.parent.path.concat([this.name]);
404
375
  }
405
376
  _track(config) {
406
377
  if (this.isMounted) {
407
- console.warn(
408
- `[xform] field \`${this.path.join(
409
- "."
410
- )}\` 已在视图中被加载,你需要 fork 该字段来进行多次加载.`
411
- );
412
378
  return;
413
379
  }
414
380
  this.config = config;
@@ -422,9 +388,16 @@ const _Field = class _Field {
422
388
  if (this._forkMap.has(forkName)) {
423
389
  return this._forkMap.get(forkName);
424
390
  } else {
425
- const common = { parent: this.parent, name: this.name, forkName };
391
+ const common = {
392
+ parent: this.parent,
393
+ name: this.name,
394
+ forkName
395
+ };
426
396
  if (this.fieldType === FieldType.normal) {
427
- return new _Field({ fieldType: FieldType.normal, ...common });
397
+ return new _Field({
398
+ fieldType: FieldType.normal,
399
+ ...common
400
+ });
428
401
  } else if (this.fieldType === FieldType.tuple) {
429
402
  return new _Field({
430
403
  fieldType: FieldType.tuple,
@@ -32,7 +32,12 @@ const withValueChangeHandler = (Component) => {
32
32
  };
33
33
  const withDayjsTransformAntdDate = (Component) => {
34
34
  return (props) => {
35
- const { value, onChange, picker, ...restProps } = props;
35
+ const {
36
+ value,
37
+ onChange,
38
+ picker,
39
+ ...restProps
40
+ } = props;
36
41
  const parsedValue = useMemo(() => {
37
42
  if (!value) return void 0;
38
43
  if (picker === "week") {
@@ -52,36 +57,39 @@ const withDayjsTransformAntdDate = (Component) => {
52
57
  }
53
58
  return void 0;
54
59
  }, [value, picker]);
55
- const handleChange = useCallback(
56
- (dayjsDate, dateString) => {
57
- if (!dayjsDate || !dayjsDate.isValid()) {
58
- onChange == null ? void 0 : onChange(null);
59
- return;
60
- }
61
- let formattedValue;
62
- if (picker === "week") {
63
- const year = dayjsDate.year();
64
- const week = dayjsDate.week();
65
- formattedValue = `${year}-${week}`;
66
- } else if (picker === "month") {
67
- formattedValue = dayjsDate.format("YYYY-MM");
68
- } else if (picker === "quarter") {
69
- formattedValue = dayjsDate.format("YYYY-Q");
70
- } else if (picker === "year") {
71
- formattedValue = dayjsDate.format("YYYY");
72
- } else {
73
- formattedValue = dayjsDate.format("YYYY-MM-DD");
74
- }
75
- onChange == null ? void 0 : onChange(formattedValue);
76
- },
77
- [onChange, picker]
78
- );
60
+ const handleChange = useCallback((dayjsDate, dateString) => {
61
+ if (!dayjsDate || !dayjsDate.isValid()) {
62
+ onChange == null ? void 0 : onChange(null);
63
+ return;
64
+ }
65
+ let formattedValue;
66
+ if (picker === "week") {
67
+ const year = dayjsDate.year();
68
+ const week = dayjsDate.week();
69
+ formattedValue = `${year}-${week}`;
70
+ } else if (picker === "month") {
71
+ formattedValue = dayjsDate.format("YYYY-MM");
72
+ } else if (picker === "quarter") {
73
+ formattedValue = dayjsDate.format("YYYY-Q");
74
+ } else if (picker === "year") {
75
+ formattedValue = dayjsDate.format("YYYY");
76
+ } else {
77
+ formattedValue = dayjsDate.format("YYYY-MM-DD");
78
+ }
79
+ onChange == null ? void 0 : onChange(formattedValue);
80
+ }, [onChange, picker]);
79
81
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, picker, value: parsedValue, onChange: handleChange });
80
82
  };
81
83
  };
82
84
  const withDayjsTransformAntdDateRangePicker = (Component) => {
83
85
  return (props) => {
84
- const { value, onChange, format, picker = "date", ...restProps } = props;
86
+ const {
87
+ value,
88
+ onChange,
89
+ format,
90
+ picker = "date",
91
+ ...restProps
92
+ } = props;
85
93
  const resolvedFormat = format || DEFAULT_FORMATS[picker] || DEFAULT_FORMATS.date;
86
94
  const parsedValue = useMemo(() => {
87
95
  if (isEmptyDateValue(value)) {
@@ -130,57 +138,49 @@ const withDayjsTransformAntdDateRangePicker = (Component) => {
130
138
  }
131
139
  return [isValidStart ? start : null, isValidEnd ? end : null];
132
140
  }, [value, picker, resolvedFormat]);
133
- const handleChange = useCallback(
134
- (dates, dateStrings) => {
135
- if (!dates || !dates[0] && !dates[1]) {
136
- onChange == null ? void 0 : onChange(null);
137
- return;
138
- }
139
- const [start, end] = dates;
140
- const formatValue = (dayjsObj, type) => {
141
- if (!dayjsObj || !dayjsObj.isValid()) return "";
142
- switch (type) {
143
- case "week":
144
- return `${dayjsObj.year()}-W${dayjsObj.week()}`;
145
- case "month":
146
- return dayjsObj.format("YYYY-MM");
147
- case "quarter": {
148
- const year = dayjsObj.year();
149
- const quarter = Math.floor(dayjsObj.month() / 3) + 1;
150
- return `${year}-Q${quarter}`;
151
- }
152
- case "year":
153
- return dayjsObj.format("YYYY");
154
- case "date":
155
- default:
156
- return dayjsObj.format(resolvedFormat);
141
+ const handleChange = useCallback((dates, dateStrings) => {
142
+ if (!dates || !dates[0] && !dates[1]) {
143
+ onChange == null ? void 0 : onChange(null);
144
+ return;
145
+ }
146
+ const [start, end] = dates;
147
+ const formatValue = (dayjsObj, type) => {
148
+ if (!dayjsObj || !dayjsObj.isValid()) return "";
149
+ switch (type) {
150
+ case "week":
151
+ return `${dayjsObj.year()}-W${dayjsObj.week()}`;
152
+ case "month":
153
+ return dayjsObj.format("YYYY-MM");
154
+ case "quarter": {
155
+ const year = dayjsObj.year();
156
+ const quarter = Math.floor(dayjsObj.month() / 3) + 1;
157
+ return `${year}-Q${quarter}`;
157
158
  }
158
- };
159
- const formatted = [formatValue(start, picker), formatValue(end, picker)];
160
- if (!formatted[0] && !formatted[1]) {
161
- onChange == null ? void 0 : onChange(null);
162
- } else {
163
- onChange == null ? void 0 : onChange(formatted);
159
+ case "year":
160
+ return dayjsObj.format("YYYY");
161
+ case "date":
162
+ default:
163
+ return dayjsObj.format(resolvedFormat);
164
164
  }
165
- },
166
- [onChange, picker, resolvedFormat]
167
- );
168
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
169
- Component,
170
- {
171
- ...restProps,
172
- picker,
173
- format: resolvedFormat,
174
- value: parsedValue,
175
- onChange: handleChange,
176
- allowClear: restProps.allowClear ?? true
165
+ };
166
+ const formatted = [formatValue(start, picker), formatValue(end, picker)];
167
+ if (!formatted[0] && !formatted[1]) {
168
+ onChange == null ? void 0 : onChange(null);
169
+ } else {
170
+ onChange == null ? void 0 : onChange(formatted);
177
171
  }
178
- );
172
+ }, [onChange, picker, resolvedFormat]);
173
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, picker, format: resolvedFormat, value: parsedValue, onChange: handleChange, allowClear: restProps.allowClear ?? true });
179
174
  };
180
175
  };
181
176
  const withDayjsTransformAntdTime = (Component) => {
182
177
  return (props) => {
183
- const { value, onChange, format = DEFAULT_FORMAT_TIME, ...restProps } = props;
178
+ const {
179
+ value,
180
+ onChange,
181
+ format = DEFAULT_FORMAT_TIME,
182
+ ...restProps
183
+ } = props;
184
184
  const parsedValue = useMemo(() => {
185
185
  if (!value) return void 0;
186
186
  const stringValue = String(value).trim();
@@ -188,23 +188,25 @@ const withDayjsTransformAntdTime = (Component) => {
188
188
  const parsed = dayjs(stringValue, format, true);
189
189
  return parsed.isValid() ? parsed : void 0;
190
190
  }, [value, format]);
191
- const handleChange = useCallback(
192
- (time, timeString) => {
193
- if (!time || !time.isValid()) {
194
- onChange == null ? void 0 : onChange(null);
195
- return;
196
- }
197
- const formatted = time.format(format);
198
- onChange == null ? void 0 : onChange(formatted);
199
- },
200
- [onChange, format]
201
- );
191
+ const handleChange = useCallback((time, timeString) => {
192
+ if (!time || !time.isValid()) {
193
+ onChange == null ? void 0 : onChange(null);
194
+ return;
195
+ }
196
+ const formatted = time.format(format);
197
+ onChange == null ? void 0 : onChange(formatted);
198
+ }, [onChange, format]);
202
199
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, format, value: parsedValue, onChange: handleChange });
203
200
  };
204
201
  };
205
202
  const withDayjsTransformAntdTimeRange = (Component) => {
206
203
  return (props) => {
207
- const { value, onChange, format = DEFAULT_FORMAT_TIME, ...restProps } = props;
204
+ const {
205
+ value,
206
+ onChange,
207
+ format = DEFAULT_FORMAT_TIME,
208
+ ...restProps
209
+ } = props;
208
210
  const parsedValue = useMemo(() => {
209
211
  if (!value || !Array.isArray(value)) return void 0;
210
212
  const [startStr, endStr] = value;
@@ -216,32 +218,29 @@ const withDayjsTransformAntdTimeRange = (Component) => {
216
218
  if (!isValidStart && !isValidEnd) return void 0;
217
219
  return [isValidStart ? start : null, isValidEnd ? end : null];
218
220
  }, [value, format]);
219
- const handleChange = useCallback(
220
- (times, timeStrings) => {
221
- if (!times) {
222
- onChange == null ? void 0 : onChange(null);
223
- return;
224
- }
225
- const [start, end] = times;
226
- const formatted = [
227
- (start == null ? void 0 : start.isValid()) ? start.format(format) : "",
228
- (end == null ? void 0 : end.isValid()) ? end.format(format) : ""
229
- ];
230
- if (!formatted[0] && !formatted[1]) {
231
- onChange == null ? void 0 : onChange(null);
232
- } else {
233
- onChange == null ? void 0 : onChange(formatted);
234
- }
235
- },
236
- [onChange, format]
237
- );
221
+ const handleChange = useCallback((times, timeStrings) => {
222
+ if (!times) {
223
+ onChange == null ? void 0 : onChange(null);
224
+ return;
225
+ }
226
+ const [start, end] = times;
227
+ const formatted = [(start == null ? void 0 : start.isValid()) ? start.format(format) : "", (end == null ? void 0 : end.isValid()) ? end.format(format) : ""];
228
+ if (!formatted[0] && !formatted[1]) {
229
+ onChange == null ? void 0 : onChange(null);
230
+ } else {
231
+ onChange == null ? void 0 : onChange(formatted);
232
+ }
233
+ }, [onChange, format]);
238
234
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, format, value: parsedValue, onChange: handleChange });
239
235
  };
240
236
  };
241
237
  const withInjectedProps = (injectedProps) => {
242
238
  return (Component) => {
243
239
  const WrappedComponent = React.forwardRef((props, ref) => {
244
- const mergedProps = { ...injectedProps, ...props };
240
+ const mergedProps = {
241
+ ...injectedProps,
242
+ ...props
243
+ };
245
244
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ref, ...mergedProps });
246
245
  });
247
246
  WrappedComponent.displayName = `WithInjectedProps(${Component.displayName || Component.name})`;
@@ -1,9 +1,10 @@
1
1
  import { isEmptyValue } from './common-utils';
2
2
  declare const ALL_COMPONENTS: {
3
- name: "input" | "textArea" | "radio" | "inputNumber" | "slider" | "switch" | "datePicker" | "dateRangePicker" | "timePicker" | "timeRangePicker" | "colorPicker" | "multiSelect" | "select" | "singleSelect" | "checkbox" | "rate";
3
+ name: "input" | "textArea" | "select" | "singleSelect" | "multiSelect" | "radio" | "checkbox" | "inputNumber" | "slider" | "switch" | "datePicker" | "dateRangePicker" | "timePicker" | "timeRangePicker" | "rate" | "colorPicker";
4
4
  component: any;
5
5
  defaultValue: any;
6
6
  isEmpty: typeof isEmptyValue;
7
- hasIntrinsicWidth: false;
7
+ hasIntrinsicWidth: boolean;
8
+ renderPreview: (props: import('../form/type').FormItemComponentProps) => import('react').ReactNode;
8
9
  }[];
9
10
  export { ALL_COMPONENTS };