@qin-ui/antdv-next-pro 1.1.10 → 1.1.12

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,55 +1,12 @@
1
- import { defineComponent, provide, computed, inject, useSlots, watchEffect, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot, toValue, normalizeProps, guardReactiveProps, resolveComponent, createElementBlock, Fragment, renderList, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString } from "vue";
2
- import { FormItem, Col, Table, Form, Transfer, TreeSelect, Slider, Switch, RadioGroup, CheckboxGroup, TimeRangePicker, TimePicker, DateRangePicker, DatePicker, Cascader, Select, AutoComplete, InputOTP, InputNumber, InputPassword, InputSearch, TextArea, Input, Row } from "antdv-next";
1
+ import { defineComponent, computed, provide, renderSlot, inject, mergeProps, toValue, normalizeProps, guardReactiveProps, resolveComponent, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, createSlots, ref, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString, useSlots, watchEffect } from "vue";
2
+ import { FormItem, Col, Table, Transfer, TreeSelect, Slider, Switch, RadioGroup, CheckboxGroup, TimeRangePicker, TimePicker, DateRangePicker, DatePicker, Cascader, Select, AutoComplete, InputOTP, InputNumber, InputPassword, InputSearch, TextArea, Input, Row, Form } from "antdv-next";
3
3
  import { useDisabledContextProvider, useDisabledContext } from "antdv-next/dist/config-provider/DisabledContext";
4
- import { INJECT_CONFIG, getInjectConfig, INJECT_COMPONENTS } from "../component-provider/index.js";
5
- import { I as InjectionFormKey, c as camelizeProperties, a as InjectionPathKey, g as getObject, u as useForm$1, b as useFields$1, d as useFormRef$1 } from "../core/index-C98RSrpN.js";
4
+ import { I as INJECT_CONFIG, g as getInjectConfig, a as INJECT_COMPONENTS } from "../component-provider/index-Daiw7IxY.js";
5
+ import { I as InjectionPathKey, g as getObject, u as useForm$1, a as InjectionFormKey, c as camelizeProperties, b as useFields$1, d as useFormRef$1 } from "../core/index-ghYuQ3Sy.js";
6
6
  import { i as isPlainObject, t as toPath, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-p6jau26B.js";
7
7
  const tableProps = () => Table.props || {};
8
8
  const gridItemProps = () => Col.props || {};
9
9
  const formItemProps = () => FormItem.props || {};
10
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
11
- ...{ name: "ProForm", inheritAttrs: false },
12
- __name: "index",
13
- props: {
14
- grid: { type: [Boolean, Object], default: false },
15
- form: { default: () => ({}) }
16
- },
17
- setup(__props) {
18
- provide(InjectionFormKey, __props.form);
19
- const { formData, fields, setFormRef } = __props.form;
20
- const _fields = computed(() => fields.value);
21
- const config = INJECT_CONFIG["pro-form"];
22
- const { grid: _injectGrid, ...injectAttrs } = inject(
23
- config.injectionKey,
24
- config.default
25
- );
26
- const slots = useSlots();
27
- watchEffect(() => {
28
- Object.keys(slots).forEach((name) => {
29
- if (name === "default") return;
30
- provide(`${TeleportComponentNamePrefix}${name}`, slots[name]);
31
- });
32
- });
33
- return (_ctx, _cache) => {
34
- return openBlock(), createBlock(unref(Form), mergeProps({
35
- ref: (el) => {
36
- var _a;
37
- return (_a = unref(setFormRef)) == null ? void 0 : _a(el);
38
- },
39
- model: unref(formData)
40
- }, mergeProps(injectAttrs, unref(camelizeProperties)(_ctx.$attrs)), { class: "pro-form" }), {
41
- default: withCtx(() => [
42
- createVNode(unref(_sfc_main$3), {
43
- fields: _fields.value,
44
- grid: __props.grid
45
- }, null, 8, ["fields", "grid"]),
46
- renderSlot(_ctx.$slots, "default")
47
- ]),
48
- _: 3
49
- }, 16, ["model"]);
50
- };
51
- }
52
- });
53
10
  const FORM_ITEM_SLOT_KEYS = ["label", "extra", "help", "tooltip"];
54
11
  const componentMap = {
55
12
  "input": Input,
@@ -73,7 +30,7 @@ const componentMap = {
73
30
  "transfer": Transfer
74
31
  };
75
32
  const TeleportComponentNamePrefix = "TeleportComponent_";
76
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
33
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
77
34
  __name: "index",
78
35
  props: {
79
36
  path: {}
@@ -89,7 +46,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
89
46
  };
90
47
  }
91
48
  });
92
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
49
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
93
50
  __name: "index",
94
51
  props: {
95
52
  field: {}
@@ -154,7 +111,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
154
111
  };
155
112
  }
156
113
  });
157
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
114
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
158
115
  ...{ name: "BaseFormItem", inheritAttrs: false },
159
116
  __name: "index",
160
117
  props: {
@@ -201,27 +158,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
201
158
  };
202
159
  return (_ctx, _cache) => {
203
160
  const _component_BaseFormItem = resolveComponent("BaseFormItem");
204
- return openBlock(), createBlock(unref(_sfc_main$1), mergeProps({
161
+ return openBlock(), createBlock(unref(_sfc_main$2), mergeProps({
205
162
  component: enableGrid.value ? unref(Row) : void 0
206
163
  }, computedGridProps.value), {
207
164
  default: withCtx(() => [
208
165
  (openBlock(true), createElementBlock(Fragment, null, renderList(validFields.value, ({ path: _path, name: _name, ...field }, index) => {
209
- return openBlock(), createBlock(_sfc_main$5, mergeProps({
166
+ return openBlock(), createBlock(_sfc_main$6, mergeProps({
210
167
  key: unref(toPath)(toValue(_name ?? _path)).join(".") || index
211
168
  }, { ref_for: true }, { path: _name ?? _path }), {
212
169
  default: withCtx(({ path }) => [
213
- createVNode(_sfc_main$4, { field }, {
170
+ createVNode(_sfc_main$5, { field }, {
214
171
  default: withCtx(({
215
172
  gridItemProps: gridItemProps2,
216
173
  formItemProps: { container, ...formItemProps2 },
217
174
  componentProps,
218
175
  formItemSlots
219
176
  }) => [
220
- createVNode(unref(_sfc_main$1), mergeProps({
177
+ createVNode(unref(_sfc_main$2), mergeProps({
221
178
  component: enableGrid.value ? unref(Col) : void 0
222
179
  }, { ref_for: true }, gridItemProps2), {
223
180
  default: withCtx(() => [
224
- createVNode(unref(_sfc_main$1), {
181
+ createVNode(unref(_sfc_main$2), {
225
182
  component: container,
226
183
  path
227
184
  }, {
@@ -239,7 +196,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
239
196
  grid: field.grid ?? __props.grid,
240
197
  fields: field.fields,
241
198
  disabled: toValue(field.disabled)
242
- }, null, 8, ["grid", "fields", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$2), mergeProps({
199
+ }, null, 8, ["grid", "fields", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$3), mergeProps({
243
200
  key: 1,
244
201
  ref_for: true,
245
202
  ref: (el) => componentRefs[index] = el
@@ -254,7 +211,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
254
211
  return {
255
212
  name,
256
213
  fn: withCtx((scoped) => [
257
- createVNode(unref(_sfc_main), mergeProps({
214
+ createVNode(unref(_sfc_main$1), mergeProps({
258
215
  path,
259
216
  component: slot
260
217
  }, { ref_for: true }, scoped), null, 16, ["path", "component"])
@@ -294,7 +251,7 @@ const getInitProps = (field) => {
294
251
  }
295
252
  return {};
296
253
  };
297
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
254
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
298
255
  ...{ name: "BaseField", inheritAttrs: false },
299
256
  __name: "index",
300
257
  props: {
@@ -377,7 +334,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
377
334
  getComponentComputedProps: () => groupedAttrs.value.attrs
378
335
  });
379
336
  return (_ctx, _cache) => {
380
- return openBlock(), createBlock(unref(_sfc_main$1), {
337
+ return openBlock(), createBlock(unref(_sfc_main$2), {
381
338
  component: groupedAttrs.value.componentContainer,
382
339
  path: __props.path
383
340
  }, {
@@ -393,7 +350,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
393
350
  return {
394
351
  name,
395
352
  fn: withCtx((scoped) => [
396
- createVNode(unref(_sfc_main), mergeProps({ path: __props.path }, scoped, { component: slot }), null, 16, ["path", "component"])
353
+ createVNode(unref(_sfc_main$1), mergeProps({ path: __props.path }, scoped, { component: slot }), null, 16, ["path", "component"])
397
354
  ])
398
355
  };
399
356
  })
@@ -404,7 +361,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
404
361
  };
405
362
  }
406
363
  });
407
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
364
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
408
365
  ...{ name: "ContainerFragment", inheritAttrs: false },
409
366
  __name: "index",
410
367
  props: {
@@ -421,7 +378,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
421
378
  };
422
379
  }
423
380
  });
424
- const _sfc_main = /* @__PURE__ */ defineComponent({
381
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
425
382
  ...{ name: "SlotComponent", inheritAttrs: false },
426
383
  __name: "index",
427
384
  props: {
@@ -435,20 +392,57 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
435
392
  };
436
393
  }
437
394
  });
395
+ const _sfc_main = /* @__PURE__ */ defineComponent({
396
+ ...{ name: "ProForm", inheritAttrs: false },
397
+ __name: "index",
398
+ props: {
399
+ grid: { type: [Boolean, Object], default: false },
400
+ form: { default: () => ({}) }
401
+ },
402
+ setup(__props) {
403
+ provide(InjectionFormKey, __props.form);
404
+ const { formData, fields, setFormRef } = __props.form;
405
+ const _fields = computed(() => fields.value);
406
+ const config = INJECT_CONFIG["pro-form"];
407
+ const { grid: _injectGrid, ...injectAttrs } = inject(
408
+ config.injectionKey,
409
+ config.default
410
+ );
411
+ const slots = useSlots();
412
+ watchEffect(() => {
413
+ Object.keys(slots).forEach((name) => {
414
+ if (name === "default") return;
415
+ provide(`${TeleportComponentNamePrefix}${name}`, slots[name]);
416
+ });
417
+ });
418
+ return (_ctx, _cache) => {
419
+ return openBlock(), createBlock(unref(Form), mergeProps({
420
+ ref: (el) => {
421
+ var _a;
422
+ return (_a = unref(setFormRef)) == null ? void 0 : _a(el);
423
+ },
424
+ model: unref(formData)
425
+ }, mergeProps(injectAttrs, unref(camelizeProperties)(_ctx.$attrs)), { class: "pro-form" }), {
426
+ default: withCtx(() => [
427
+ createVNode(unref(_sfc_main$4), {
428
+ fields: _fields.value,
429
+ grid: __props.grid
430
+ }, null, 8, ["fields", "grid"]),
431
+ renderSlot(_ctx.$slots, "default")
432
+ ]),
433
+ _: 3
434
+ }, 16, ["model"]);
435
+ };
436
+ }
437
+ });
438
438
  const useFields = useFields$1;
439
439
  const useFormRef = useFormRef$1;
440
440
  export {
441
- FORM_ITEM_SLOT_KEYS as F,
442
- TeleportComponentNamePrefix as T,
443
- _sfc_main$6 as _,
444
- _sfc_main$1 as a,
445
- _sfc_main$3 as b,
446
- _sfc_main$2 as c,
447
- _sfc_main as d,
448
- componentMap as e,
449
- useFields as f,
450
- useFormRef as g,
451
- getInitProps as h,
441
+ _sfc_main as _,
442
+ _sfc_main$2 as a,
443
+ _sfc_main$1 as b,
444
+ useFields as c,
445
+ useFormRef as d,
452
446
  tableProps as t,
453
447
  useForm as u
454
448
  };
package/es/form/index.js CHANGED
@@ -1,20 +1,14 @@
1
- import { c, _, b, a, F, d, T, e, _ as _2, h, f, u, g } from "./index-CyMXEA_9.js";
2
- import { I, a as a2, e as e2 } from "../core/index-C98RSrpN.js";
1
+ import { a, b, _, c, u, d } from "./index-7clzY8ZD.js";
2
+ import "vue";
3
+ import { e } from "../core/index-ghYuQ3Sy.js";
4
+ import "antdv-next";
5
+ import "antdv-next/dist/config-provider/DisabledContext";
3
6
  export {
4
- c as BaseField,
5
- _ as BaseForm,
6
- b as BaseFormItem,
7
7
  a as ContainerFragment,
8
- F as FORM_ITEM_SLOT_KEYS,
9
- I as InjectionFormKey,
10
- a2 as InjectionPathKey,
11
- d as SlotComponent,
12
- T as TeleportComponentNamePrefix,
13
- e as componentMap,
14
- _2 as default,
15
- h as getInitProps,
16
- f as useFields,
8
+ b as SlotComponent,
9
+ _ as default,
10
+ c as useFields,
17
11
  u as useForm,
18
- e2 as useFormData,
19
- g as useFormRef
12
+ e as useFormData,
13
+ d as useFormRef
20
14
  };