lew-ui 2.4.16 → 2.4.17

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.
@@ -89,6 +89,24 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
89
89
  description: string;
90
90
  hidden: boolean;
91
91
  };
92
+ outputFormat: {
93
+ type: PropType<(params: {
94
+ value: unknown;
95
+ }) => unknown>;
96
+ default: ({ value }: {
97
+ value: unknown;
98
+ }) => unknown;
99
+ description: string;
100
+ };
101
+ inputFormat: {
102
+ type: PropType<(params: {
103
+ value: unknown;
104
+ }) => unknown>;
105
+ default: ({ value }: {
106
+ value: unknown;
107
+ }) => unknown;
108
+ description: string;
109
+ };
92
110
  }>, {
93
111
  validate: () => void;
94
112
  setError: (message: any) => void;
@@ -186,6 +204,24 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
186
204
  description: string;
187
205
  hidden: boolean;
188
206
  };
207
+ outputFormat: {
208
+ type: PropType<(params: {
209
+ value: unknown;
210
+ }) => unknown>;
211
+ default: ({ value }: {
212
+ value: unknown;
213
+ }) => unknown;
214
+ description: string;
215
+ };
216
+ inputFormat: {
217
+ type: PropType<(params: {
218
+ value: unknown;
219
+ }) => unknown>;
220
+ default: ({ value }: {
221
+ value: unknown;
222
+ }) => unknown;
223
+ description: string;
224
+ };
189
225
  }>> & Readonly<{
190
226
  onChange?: ((...args: any[]) => any) | undefined;
191
227
  }>, {
@@ -205,5 +241,11 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
205
241
  as: string;
206
242
  errMessage: string;
207
243
  gridArea: string;
244
+ outputFormat: (params: {
245
+ value: unknown;
246
+ }) => unknown;
247
+ inputFormat: (params: {
248
+ value: unknown;
249
+ }) => unknown;
208
250
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
209
251
  export default _default;
@@ -152,6 +152,24 @@ export declare const formItemProps: {
152
152
  description: string;
153
153
  hidden: boolean;
154
154
  };
155
+ outputFormat: {
156
+ type: PropType<(params: {
157
+ value: unknown;
158
+ }) => unknown>;
159
+ default: ({ value }: {
160
+ value: unknown;
161
+ }) => unknown;
162
+ description: string;
163
+ };
164
+ inputFormat: {
165
+ type: PropType<(params: {
166
+ value: unknown;
167
+ }) => unknown>;
168
+ default: ({ value }: {
169
+ value: unknown;
170
+ }) => unknown;
171
+ description: string;
172
+ };
155
173
  };
156
174
  export declare const requiredIconSizeMap: Record<LewSize, number>;
157
175
  export declare const tipsIconSizeMap: Record<LewSize, number>;
package/dist/index.mjs CHANGED
@@ -8282,6 +8282,16 @@ const formItemProps = {
8282
8282
  default: "",
8283
8283
  description: "表单项的唯一标识符",
8284
8284
  hidden: true
8285
+ },
8286
+ outputFormat: {
8287
+ type: Function,
8288
+ default: ({ value }) => value,
8289
+ description: "出参时的格式化方法"
8290
+ },
8291
+ inputFormat: {
8292
+ type: Function,
8293
+ default: ({ value }) => value,
8294
+ description: "入参时的格式化方法"
8285
8295
  }
8286
8296
  };
8287
8297
  const requiredIconSizeMap = {
@@ -10836,7 +10846,9 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
10836
10846
  return object2class("lew-form", { columns });
10837
10847
  });
10838
10848
  const getForm = () => {
10839
- const formData = formatFormByMap(cloneDeep(formMap.value));
10849
+ const formData = formatFormByMap(
10850
+ cloneDeep(formMap.value)
10851
+ );
10840
10852
  componentOptions.forEach((item) => {
10841
10853
  if (item.outputFormat && item.field && formData[item.field]) {
10842
10854
  formData[item.field] = item.outputFormat({ value: formData[item.field] });
@@ -10849,8 +10861,8 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
10849
10861
  var _a;
10850
10862
  let v2 = retrieveNestedFieldValue(value, item.field);
10851
10863
  if (value !== void 0 && item.field) {
10852
- if (item.importFormat) {
10853
- v2 = item.importFormat({ value: v2 });
10864
+ if (item.inputFormat) {
10865
+ v2 = item.inputFormat({ value: v2 });
10854
10866
  }
10855
10867
  (_a = formItemRefMap.value[item.field]) == null ? void 0 : _a.setError("");
10856
10868
  formMap.value[item.field] = v2;
@@ -10941,7 +10953,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
10941
10953
  };
10942
10954
  }
10943
10955
  });
10944
- const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-e9aee98e"]]);
10956
+ const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-751d85bc"]]);
10945
10957
  const checkboxModel = {
10946
10958
  modelValue: {
10947
10959
  type: Boolean,