@king-one/antdv 1.0.35 → 1.0.37

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.37
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: 修复 pro-area 的表单收集
8
+
9
+ ## 1.0.36
10
+
11
+ ### Patch Changes
12
+
13
+ - fix: 修改 pro-modal 的类型
14
+
3
15
  ## 1.0.35
4
16
 
5
17
  ### Patch Changes
@@ -1,11 +1,11 @@
1
- import { defineComponent as b, mergeModels as B, useModel as P, computed as u, openBlock as c, createBlock as p, unref as i, withCtx as m, createElementBlock as w, Fragment as y, renderList as A, createVNode as F, normalizeClass as M } from "vue";
2
- import { Row as N, Col as k, Select as U } from "ant-design-vue";
3
- import { useNamespace as q } from "../../../hooks/use-namespace/index.mjs";
4
- import { ProAreaProps as z } from "./types.mjs";
5
- const O = /* @__PURE__ */ b({
1
+ import { defineComponent as _, mergeModels as b, useModel as B, computed as u, openBlock as c, createBlock as p, unref as i, withCtx as m, createElementBlock as P, Fragment as w, renderList as y, createVNode as A, normalizeClass as I } from "vue";
2
+ import { Form as M, Row as N, Col as k, Select as U } from "ant-design-vue";
3
+ import { useNamespace as j } from "../../../hooks/use-namespace/index.mjs";
4
+ import { ProAreaProps as q } from "./types.mjs";
5
+ const L = /* @__PURE__ */ _({
6
6
  name: "ProArea",
7
7
  __name: "ProArea",
8
- props: /* @__PURE__ */ B(z, {
8
+ props: /* @__PURE__ */ b(q, {
9
9
  modelValue: {
10
10
  required: !0
11
11
  },
@@ -13,9 +13,11 @@ const O = /* @__PURE__ */ b({
13
13
  }),
14
14
  emits: ["update:modelValue"],
15
15
  setup(d) {
16
- const n = d, a = P(d, "modelValue"), { b: f } = q("pro-area-select"), v = u(() => (e) => `请选择${e === 1 ? "请选择省份" : e === 2 ? "请选择城市" : "请选择区县"}`), h = u(() => (e) => n.options.length > 0 ? g(e) : []);
16
+ const n = d;
17
+ M.useInjectFormItemContext();
18
+ const a = B(d, "modelValue"), { b: f } = j("pro-area-select"), v = u(() => (e) => `请选择${e === 1 ? "请选择省份" : e === 2 ? "请选择城市" : "请选择区县"}`), h = u(() => (e) => n.options.length > 0 ? g(e) : []);
17
19
  function g(e) {
18
- var l;
20
+ var t;
19
21
  if (e === 1)
20
22
  return n.options.map((r) => ({
21
23
  value: o(r, "id"),
@@ -23,55 +25,55 @@ const O = /* @__PURE__ */ b({
23
25
  }));
24
26
  if (e === 2) {
25
27
  const r = a.value.province;
26
- return r ? s(n.options, r).map((t) => ({
27
- value: o(t, "id"),
28
- label: o(t, "name")
28
+ return r ? s(n.options, r).map((l) => ({
29
+ value: o(l, "id"),
30
+ label: o(l, "name")
29
31
  })) : [];
30
32
  } else {
31
- const r = (l = a.value) == null ? void 0 : l.city;
32
- return r ? s(n.options, r).map((t) => ({
33
- value: o(t, "id"),
34
- label: o(t, "name")
33
+ const r = (t = a.value) == null ? void 0 : t.city;
34
+ return r ? s(n.options, r).map((l) => ({
35
+ value: o(l, "id"),
36
+ label: o(l, "name")
35
37
  })) : [];
36
38
  }
37
39
  }
38
- function s(e, l) {
40
+ function s(e, t) {
39
41
  for (const r of e) {
40
- if (o(r, "id") === l)
42
+ if (o(r, "id") === t)
41
43
  return o(r, "children") || [];
42
44
  if (o(r, "children")) {
43
- const t = s(o(r, "children"), l);
44
- if (t)
45
- return t;
45
+ const l = s(o(r, "children"), t);
46
+ if (l)
47
+ return l;
46
48
  }
47
49
  }
48
50
  }
49
- function o(e, l) {
50
- return e && l ? e[(n == null ? void 0 : n.FieldNames[l]) || l] : void 0;
51
+ function o(e, t) {
52
+ return e && t ? e[(n == null ? void 0 : n.FieldNames[t]) || t] : void 0;
51
53
  }
52
54
  const C = u(() => {
53
55
  let e = n.level;
54
- const l = [];
56
+ const t = [];
55
57
  for (; e--; )
56
- l.push(e === 2 ? "province" : e === 1 ? "city" : "county");
57
- return l;
58
- }), V = u(() => [f()]);
59
- return (e, l) => (c(), p(i(N), { gutter: 10 }, {
58
+ t.push(e === 2 ? "province" : e === 1 ? "city" : "county");
59
+ return t;
60
+ }), F = u(() => [f()]);
61
+ return (e, t) => (c(), p(i(N), { gutter: 10 }, {
60
62
  default: m(() => [
61
- (c(!0), w(
62
- y,
63
+ (c(!0), P(
64
+ w,
63
65
  null,
64
- A(C.value, (r, t) => (c(), p(i(k), {
66
+ y(C.value, (r, l) => (c(), p(i(k), {
65
67
  key: r,
66
68
  span: 24 / e.level
67
69
  }, {
68
70
  default: m(() => [
69
- F(i(U), {
71
+ A(i(U), {
70
72
  value: a.value[r],
71
- "onUpdate:value": (_) => a.value[r] = _,
72
- placeholder: v.value(t + 1),
73
- class: M(V.value),
74
- options: h.value(t + 1)
73
+ "onUpdate:value": (V) => a.value[r] = V,
74
+ placeholder: v.value(l + 1),
75
+ class: I(F.value),
76
+ options: h.value(l + 1)
75
77
  }, null, 8, ["value", "onUpdate:value", "placeholder", "class", "options"])
76
78
  ]),
77
79
  _: 2
@@ -87,5 +89,5 @@ const O = /* @__PURE__ */ b({
87
89
  }
88
90
  });
89
91
  export {
90
- O as default
92
+ L as default
91
93
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("ant-design-vue"),B=require("../../../hooks/use-namespace/index.js"),_=require("./types.js"),b=e.defineComponent({name:"ProArea",__name:"ProArea",props:e.mergeModels(_.ProAreaProps,{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const u=i,a=e.useModel(i,"modelValue"),{b:d}=B.useNamespace("pro-area-select"),p=e.computed(()=>t=>`请选择${t===1?"请选择省份":t===2?"请选择城市":"请选择区县"}`),v=e.computed(()=>t=>u.options.length>0?m(t):[]);function m(t){var l;if(t===1)return u.options.map(r=>({value:o(r,"id"),label:o(r,"name")}));if(t===2){const r=a.value.province;return r?c(u.options,r).map(n=>({value:o(n,"id"),label:o(n,"name")})):[]}else{const r=(l=a.value)==null?void 0:l.city;return r?c(u.options,r).map(n=>({value:o(n,"id"),label:o(n,"name")})):[]}}function c(t,l){for(const r of t){if(o(r,"id")===l)return o(r,"children")||[];if(o(r,"children")){const n=c(o(r,"children"),l);if(n)return n}}}function o(t,l){return t&&l?t[(u==null?void 0:u.FieldNames[l])||l]:void 0}const f=e.computed(()=>{let t=u.level;const l=[];for(;t--;)l.push(t===2?"province":t===1?"city":"county");return l}),h=e.computed(()=>[d()]);return(t,l)=>(e.openBlock(),e.createBlock(e.unref(s.Row),{gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(r,n)=>(e.openBlock(),e.createBlock(e.unref(s.Col),{key:r,span:24/t.level},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Select),{value:a.value[r],"onUpdate:value":g=>a.value[r]=g,placeholder:p.value(n+1),class:e.normalizeClass(h.value),options:v.value(n+1)},null,8,["value","onUpdate:value","placeholder","class","options"])]),_:2},1032,["span"]))),128))]),_:1}))}});exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("ant-design-vue"),B=require("../../../hooks/use-namespace/index.js"),C=require("./types.js"),_=e.defineComponent({name:"ProArea",__name:"ProArea",props:e.mergeModels(C.ProAreaProps,{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const u=i;c.Form.useInjectFormItemContext();const a=e.useModel(i,"modelValue"),{b:d}=B.useNamespace("pro-area-select"),p=e.computed(()=>t=>`请选择${t===1?"请选择省份":t===2?"请选择城市":"请选择区县"}`),m=e.computed(()=>t=>u.options.length>0?v(t):[]);function v(t){var n;if(t===1)return u.options.map(r=>({value:o(r,"id"),label:o(r,"name")}));if(t===2){const r=a.value.province;return r?s(u.options,r).map(l=>({value:o(l,"id"),label:o(l,"name")})):[]}else{const r=(n=a.value)==null?void 0:n.city;return r?s(u.options,r).map(l=>({value:o(l,"id"),label:o(l,"name")})):[]}}function s(t,n){for(const r of t){if(o(r,"id")===n)return o(r,"children")||[];if(o(r,"children")){const l=s(o(r,"children"),n);if(l)return l}}}function o(t,n){return t&&n?t[(u==null?void 0:u.FieldNames[n])||n]:void 0}const f=e.computed(()=>{let t=u.level;const n=[];for(;t--;)n.push(t===2?"province":t===1?"city":"county");return n}),h=e.computed(()=>[d()]);return(t,n)=>(e.openBlock(),e.createBlock(e.unref(c.Row),{gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(r,l)=>(e.openBlock(),e.createBlock(e.unref(c.Col),{key:r,span:24/t.level},{default:e.withCtx(()=>[e.createVNode(e.unref(c.Select),{value:a.value[r],"onUpdate:value":g=>a.value[r]=g,placeholder:p.value(l+1),class:e.normalizeClass(h.value),options:m.value(l+1)},null,8,["value","onUpdate:value","placeholder","class","options"])]),_:2},1032,["span"]))),128))]),_:1}))}});exports.default=_;
@@ -1,5 +1,5 @@
1
- import { Plugin } from 'vue';
1
+ import { default as ProModal } from './src/ProModal.vue';
2
2
  export * from './hooks/useProModal';
3
3
  export * from './src/types';
4
- export declare const KProModal: Plugin;
4
+ export declare const KProModal: typeof ProModal;
5
5
  export default KProModal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.35",
4
+ "version": "1.0.37",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",