@king-one/antdv 1.0.32 → 1.0.34

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/es/components/index.mjs +18 -12
  3. package/dist/es/components/pro-area/apis/pro-area.api.mjs +6 -0
  4. package/dist/es/components/pro-area/hooks/use-pro-area.mjs +11 -0
  5. package/dist/es/components/pro-area/index.mjs +13 -0
  6. package/dist/es/components/pro-area/src/ProArea.vue.mjs +4 -0
  7. package/dist/es/components/pro-area/src/ProArea.vue2.mjs +91 -0
  8. package/dist/es/components/pro-area/src/types.mjs +21 -0
  9. package/dist/es/components/pro-area/style/index.mjs +2 -0
  10. package/dist/es/components/pro-picker/apis/pro-picker.api.mjs +7 -0
  11. package/dist/es/components/pro-picker/index.mjs +10 -0
  12. package/dist/es/components/pro-picker/src/ProPicker.vue.mjs +4 -0
  13. package/dist/es/components/pro-picker/src/ProPicker.vue2.mjs +64 -0
  14. package/dist/es/components/pro-picker/src/types.mjs +23 -0
  15. package/dist/es/components/pro-tag/index.mjs +10 -0
  16. package/dist/es/components/pro-tag/src/ProTag.vue.mjs +4 -0
  17. package/dist/es/components/pro-tag/src/ProTag.vue2.mjs +37 -0
  18. package/dist/es/components/pro-tag/src/types.mjs +9 -0
  19. package/dist/es/hooks/index.mjs +5 -0
  20. package/dist/es/hooks/useProForm.mjs +35 -0
  21. package/dist/es/index.mjs +45 -27
  22. package/dist/lib/components/index.js +1 -1
  23. package/dist/lib/components/pro-area/apis/pro-area.api.js +1 -0
  24. package/dist/lib/components/pro-area/hooks/use-pro-area.js +1 -0
  25. package/dist/lib/components/pro-area/index.js +1 -0
  26. package/dist/lib/components/pro-area/src/ProArea.vue.js +1 -0
  27. package/dist/lib/components/pro-area/src/ProArea.vue2.js +1 -0
  28. package/dist/lib/components/pro-area/src/types.js +1 -0
  29. package/dist/lib/components/pro-area/style/index.js +1 -0
  30. package/dist/lib/components/pro-picker/apis/pro-picker.api.js +1 -0
  31. package/dist/lib/components/pro-picker/index.js +1 -0
  32. package/dist/lib/components/pro-picker/src/ProPicker.vue.js +1 -0
  33. package/dist/lib/components/pro-picker/src/ProPicker.vue2.js +1 -0
  34. package/dist/lib/components/pro-picker/src/types.js +1 -0
  35. package/dist/lib/components/pro-tag/index.js +1 -0
  36. package/dist/lib/components/pro-tag/src/ProTag.vue.js +1 -0
  37. package/dist/lib/components/pro-tag/src/ProTag.vue2.js +1 -0
  38. package/dist/lib/components/pro-tag/src/types.js +1 -0
  39. package/dist/lib/hooks/index.js +1 -0
  40. package/dist/lib/hooks/useProForm.js +1 -0
  41. package/dist/lib/index.js +1 -1
  42. package/dist/theme-chalk/index.css +1 -1
  43. package/dist/theme-chalk/por-area-select.css +1 -0
  44. package/dist/types/components/index.d.ts +3 -0
  45. package/dist/types/components/pro-area/apis/pro-area.api.d.ts +3 -0
  46. package/dist/types/components/pro-area/hooks/use-pro-area.d.ts +4 -0
  47. package/dist/types/components/pro-area/index.d.ts +72 -0
  48. package/dist/types/components/pro-area/src/ProArea.vue.d.ts +69 -0
  49. package/dist/types/components/pro-area/src/types.d.ts +42 -0
  50. package/dist/types/components/pro-picker/apis/pro-picker.api.d.ts +5 -0
  51. package/dist/types/components/pro-picker/index.d.ts +59 -0
  52. package/dist/types/components/pro-picker/src/ProPicker.vue.d.ts +57 -0
  53. package/dist/types/components/pro-picker/src/types.d.ts +24 -0
  54. package/dist/types/components/pro-tag/index.d.ts +36 -0
  55. package/dist/types/components/pro-tag/src/ProTag.vue.d.ts +34 -0
  56. package/dist/types/components/pro-tag/src/types.d.ts +15 -0
  57. package/dist/types/hooks/index.d.ts +1 -0
  58. package/dist/types/hooks/use-namespace/index.d.ts +23 -0
  59. package/dist/types/hooks/useProForm.d.ts +14 -0
  60. package/dist/types/index.d.ts +1 -0
  61. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.34
4
+
5
+ ### Patch Changes
6
+
7
+ - feat:增加 pro-area 和 pro-picker 组件
8
+
9
+ ## 1.0.33
10
+
11
+ ### Patch Changes
12
+
13
+ - feat:增加业务 proUseForm hook
14
+ - feat:新增 ProTag 组件
15
+
3
16
  ## 1.0.32
4
17
 
5
18
  ### Patch Changes
@@ -1,14 +1,20 @@
1
- import { KForm as t } from "./form/index.mjs";
2
- import { KCollapseTranstion as l } from "./collapse-transtion/index.mjs";
3
- import { KProDialog as p } from "./pro-dialog/index.mjs";
4
- import { KProTitle as f } from "./pro-title/index.mjs";
5
- import { KScrollBar as K } from "./scroll-bar/index.mjs";
6
- import { KScaleVirtualList as s } from "./scale-virtual-list/index.mjs";
1
+ import { KForm as e } from "./form/index.mjs";
2
+ import { KCollapseTranstion as m } from "./collapse-transtion/index.mjs";
3
+ import { KProDialog as f } from "./pro-dialog/index.mjs";
4
+ import { KProTitle as K } from "./pro-title/index.mjs";
5
+ import { KScrollBar as l } from "./scroll-bar/index.mjs";
6
+ import { KScaleVirtualList as P } from "./scale-virtual-list/index.mjs";
7
+ import { KProTag as s } from "./pro-tag/index.mjs";
8
+ import { KProPicker as g } from "./pro-picker/index.mjs";
9
+ import { KProArea as S } from "./pro-area/index.mjs";
7
10
  export {
8
- l as KCollapseTranstion,
9
- t as KForm,
10
- p as KProDialog,
11
- f as KProTitle,
12
- s as KScaleVirtualList,
13
- K as KScrollBar
11
+ m as KCollapseTranstion,
12
+ e as KForm,
13
+ S as KProArea,
14
+ f as KProDialog,
15
+ g as KProPicker,
16
+ s as KProTag,
17
+ K as KProTitle,
18
+ P as KScaleVirtualList,
19
+ l as KScrollBar
14
20
  };
@@ -0,0 +1,6 @@
1
+ const e = {
2
+ areaTree: () => globalThis.$http.get("/basic/area/setting/tree")
3
+ };
4
+ export {
5
+ e as proAreaApis
6
+ };
@@ -0,0 +1,11 @@
1
+ import { ref as o } from "vue";
2
+ import { proAreaApis as a } from "../apis/pro-area.api.mjs";
3
+ function n() {
4
+ const r = o([]);
5
+ return a.areaTree().then((e) => {
6
+ r.value = e.data;
7
+ }), { ops: r };
8
+ }
9
+ export {
10
+ n as useAreaProArea
11
+ };
@@ -0,0 +1,13 @@
1
+ import { withInstall as r } from "../utils/install.mjs";
2
+ import "./src/ProArea.vue.mjs";
3
+ import "./style/index.mjs";
4
+ import { ProAreaProps as s } from "./src/types.mjs";
5
+ import { useAreaProArea as P } from "./hooks/use-pro-area.mjs";
6
+ import o from "./src/ProArea.vue2.mjs";
7
+ const p = r(o);
8
+ export {
9
+ p as KProArea,
10
+ s as ProAreaProps,
11
+ p as default,
12
+ P as useAreaProArea
13
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ProArea.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,91 @@
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({
6
+ name: "ProArea",
7
+ __name: "ProArea",
8
+ props: /* @__PURE__ */ B(z, {
9
+ modelValue: {
10
+ required: !0
11
+ },
12
+ modelModifiers: {}
13
+ }),
14
+ emits: ["update:modelValue"],
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) : []);
17
+ function g(e) {
18
+ var l;
19
+ if (e === 1)
20
+ return n.options.map((r) => ({
21
+ value: o(r, "id"),
22
+ label: o(r, "name")
23
+ }));
24
+ if (e === 2) {
25
+ const r = a.value.province;
26
+ return r ? s(n.options, r).map((t) => ({
27
+ value: o(t, "id"),
28
+ label: o(t, "name")
29
+ })) : [];
30
+ } 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")
35
+ })) : [];
36
+ }
37
+ }
38
+ function s(e, l) {
39
+ for (const r of e) {
40
+ if (o(r, "id") === l)
41
+ return o(r, "children") || [];
42
+ if (o(r, "children")) {
43
+ const t = s(o(r, "children"), l);
44
+ if (t)
45
+ return t;
46
+ }
47
+ }
48
+ }
49
+ function o(e, l) {
50
+ return e && l ? e[(n == null ? void 0 : n.FieldNames[l]) || l] : void 0;
51
+ }
52
+ const C = u(() => {
53
+ let e = n.level;
54
+ const l = [];
55
+ 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 }, {
60
+ default: m(() => [
61
+ (c(!0), w(
62
+ y,
63
+ null,
64
+ A(C.value, (r, t) => (c(), p(i(k), {
65
+ key: r,
66
+ span: 24 / e.level
67
+ }, {
68
+ default: m(() => [
69
+ F(i(U), {
70
+ 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)
75
+ }, null, 8, ["value", "onUpdate:value", "placeholder", "class", "options"])
76
+ ]),
77
+ _: 2
78
+ /* DYNAMIC */
79
+ }, 1032, ["span"]))),
80
+ 128
81
+ /* KEYED_FRAGMENT */
82
+ ))
83
+ ]),
84
+ _: 1
85
+ /* STABLE */
86
+ }));
87
+ }
88
+ });
89
+ export {
90
+ O as default
91
+ };
@@ -0,0 +1,21 @@
1
+ const e = {
2
+ level: {
3
+ type: Number,
4
+ default: 3
5
+ },
6
+ options: {
7
+ type: Array,
8
+ required: !0
9
+ },
10
+ FieldNames: {
11
+ type: Object,
12
+ default: () => ({
13
+ name: "name",
14
+ id: "id",
15
+ children: "children"
16
+ })
17
+ }
18
+ };
19
+ export {
20
+ e as ProAreaProps
21
+ };
@@ -0,0 +1,2 @@
1
+ import "../../base/style/index.mjs";
2
+ import "@king-one/antdv/dist/theme-chalk/por-area-select.css";
@@ -0,0 +1,7 @@
1
+ const o = {
2
+ company: (t) => globalThis.$http.get("/security/company/options", t),
3
+ user: (t) => globalThis.$http.get("/security/user/options", t)
4
+ };
5
+ export {
6
+ o as proPickerApi
7
+ };
@@ -0,0 +1,10 @@
1
+ import { withInstall as r } from "../utils/install.mjs";
2
+ import "./src/ProPicker.vue.mjs";
3
+ import { ProPickerProps as s } from "./src/types.mjs";
4
+ import o from "./src/ProPicker.vue2.mjs";
5
+ const p = r(o);
6
+ export {
7
+ p as KProPicker,
8
+ s as ProPickerProps,
9
+ p as default
10
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ProPicker.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as p, mergeModels as d, useModel as m, reactive as f, watch as u, openBlock as h, createBlock as g, unref as r, createSlots as v, withCtx as y, createVNode as P } from "vue";
2
+ import { debounce as k } from "lodash-es";
3
+ import { Select as b, Spin as S } from "ant-design-vue";
4
+ import { proPickerApi as c } from "../apis/pro-picker.api.mjs";
5
+ import { ProPickerProps as w } from "./types.mjs";
6
+ const z = /* @__PURE__ */ p({
7
+ name: "ProPicker",
8
+ __name: "ProPicker",
9
+ props: /* @__PURE__ */ d(w, {
10
+ modelValue: {},
11
+ modelModifiers: {}
12
+ }),
13
+ emits: ["update:modelValue"],
14
+ setup(i) {
15
+ const a = i, l = m(i, "modelValue"), o = f({
16
+ data: [],
17
+ fetching: !1
18
+ });
19
+ u(l, (e) => {
20
+ (typeof e == "string" || typeof e == "number") && a.isInit && console.log("开始复制");
21
+ }, {
22
+ once: !0
23
+ });
24
+ const s = k((e) => {
25
+ e && (o.fetching = !0, a.type === "company" ? c.company({
26
+ params: { label: e }
27
+ }).then((t) => {
28
+ o.data = t.data.options.map((n) => ({
29
+ label: n.label,
30
+ value: n.value
31
+ })), o.fetching = !1;
32
+ }) : c.user({
33
+ params: { label: e }
34
+ }).then(() => {
35
+ }));
36
+ }, a.delay);
37
+ return (e, t) => (h(), g(r(b), {
38
+ value: l.value,
39
+ "onUpdate:value": t[0] || (t[0] = (n) => l.value = n),
40
+ mode: e.mode,
41
+ "show-search": "",
42
+ placeholder: e.placeholder,
43
+ style: { width: "100%" },
44
+ "filter-option": !1,
45
+ "not-found-content": o.fetching ? void 0 : null,
46
+ options: o.data,
47
+ onSearch: r(s)
48
+ }, v({
49
+ _: 2
50
+ /* DYNAMIC */
51
+ }, [
52
+ o.fetching ? {
53
+ name: "notFoundContent",
54
+ fn: y(() => [
55
+ P(r(S), { size: "small" })
56
+ ]),
57
+ key: "0"
58
+ } : void 0
59
+ ]), 1032, ["value", "mode", "placeholder", "not-found-content", "options", "onSearch"]));
60
+ }
61
+ });
62
+ export {
63
+ z as default
64
+ };
@@ -0,0 +1,23 @@
1
+ const e = {
2
+ type: {
3
+ type: String,
4
+ default: "company"
5
+ },
6
+ placeholder: {
7
+ type: String,
8
+ default: "请选择"
9
+ },
10
+ mode: {
11
+ type: String
12
+ },
13
+ isInit: {
14
+ type: Boolean
15
+ },
16
+ delay: {
17
+ type: Number,
18
+ default: 200
19
+ }
20
+ };
21
+ export {
22
+ e as ProPickerProps
23
+ };
@@ -0,0 +1,10 @@
1
+ import { withInstall as o } from "../utils/install.mjs";
2
+ import "./src/ProTag.vue.mjs";
3
+ import { proTagProps as s } from "./src/types.mjs";
4
+ import r from "./src/ProTag.vue2.mjs";
5
+ const a = o(r);
6
+ export {
7
+ a as KProTag,
8
+ a as default,
9
+ s as proTagProps
10
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ProTag.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as p, mergeModels as u, useModel as d, computed as g, resolveComponent as i, openBlock as m, createBlock as f, withCtx as _, createTextVNode as T, toDisplayString as v } from "vue";
2
+ import { proTagProps as x } from "./types.mjs";
3
+ const M = /* @__PURE__ */ p({
4
+ name: "ProTag",
5
+ __name: "ProTag",
6
+ props: /* @__PURE__ */ u(x, {
7
+ tag: { type: [String, Number, Boolean], required: !0 },
8
+ tagModifiers: {}
9
+ }),
10
+ emits: ["update:tag"],
11
+ setup(e) {
12
+ const n = e, c = d(e, "tag"), t = g(() => n.options.find((o) => o.value === c.value));
13
+ return (l, o) => {
14
+ var a;
15
+ const s = i("ATag");
16
+ return m(), f(s, {
17
+ color: ((a = t.value) == null ? void 0 : a.color) || "default"
18
+ }, {
19
+ default: _(() => {
20
+ var r;
21
+ return [
22
+ T(
23
+ v(((r = t.value) == null ? void 0 : r.label) || ""),
24
+ 1
25
+ /* TEXT */
26
+ )
27
+ ];
28
+ }),
29
+ _: 1
30
+ /* STABLE */
31
+ }, 8, ["color"]);
32
+ };
33
+ }
34
+ });
35
+ export {
36
+ M as default
37
+ };
@@ -0,0 +1,9 @@
1
+ const r = {
2
+ options: {
3
+ type: Array,
4
+ required: !0
5
+ }
6
+ };
7
+ export {
8
+ r as proTagProps
9
+ };
@@ -0,0 +1,5 @@
1
+ import { useProForm as e, useProFormInit as m } from "./useProForm.mjs";
2
+ export {
3
+ e as useProForm,
4
+ m as useProFormInit
5
+ };
@@ -0,0 +1,35 @@
1
+ import { cloneDeep as i } from "lodash-es";
2
+ import { ref as a, getCurrentInstance as u, unref as l } from "vue";
3
+ function d(o) {
4
+ const t = a(o), m = a(), n = u(), e = (s) => {
5
+ t.value = i(s);
6
+ }, r = () => {
7
+ var s;
8
+ t.value = o, (s = m.value) == null || s.resetFields();
9
+ }, c = {
10
+ setFormData: e
11
+ };
12
+ return n && (n == null || n.emit("initForm", c)), {
13
+ ruleForm: t,
14
+ formRef: m,
15
+ resetForm: r
16
+ };
17
+ }
18
+ function v() {
19
+ const o = a(null), t = () => {
20
+ const e = l(o.value);
21
+ return e || console.error("useModal instance is undefined!"), e;
22
+ };
23
+ return [(e) => {
24
+ o.value = e;
25
+ }, {
26
+ setFormData: (e) => {
27
+ var r;
28
+ return (r = t()) == null ? void 0 : r.setFormData(e);
29
+ }
30
+ }];
31
+ }
32
+ export {
33
+ d as useProForm,
34
+ v as useProFormInit
35
+ };
package/dist/es/index.mjs CHANGED
@@ -1,30 +1,48 @@
1
- import r from "./installer.mjs";
1
+ import o from "./installer.mjs";
2
2
  import "./components/index.mjs";
3
- import { formType as l } from "./components/form/component/form.mjs";
4
- import { KForm as f } from "./components/form/index.mjs";
5
- import { collapseProps as i } from "./components/collapse-transtion/src/types.mjs";
6
- import { KCollapseTranstion as s } from "./components/collapse-transtion/index.mjs";
7
- import { useProDialog as K, useProDialogInit as g } from "./components/pro-dialog/hooks/useProDialog.mjs";
8
- import { proDialogProps as c } from "./components/pro-dialog/src/types.mjs";
9
- import { KProDialog as D } from "./components/pro-dialog/index.mjs";
10
- import { TitleProps as S } from "./components/pro-title/src/types.mjs";
11
- import { KProTitle as d } from "./components/pro-title/index.mjs";
12
- import { scrollbarProps as B } from "./components/scroll-bar/src/types.mjs";
13
- import { KScrollBar as F } from "./components/scroll-bar/index.mjs";
14
- import { KScaleVirtualList as L } from "./components/scale-virtual-list/index.mjs";
3
+ import "./hooks/index.mjs";
4
+ import { formType as f } from "./components/form/component/form.mjs";
5
+ import { KForm as P } from "./components/form/index.mjs";
6
+ import { collapseProps as l } from "./components/collapse-transtion/src/types.mjs";
7
+ import { KCollapseTranstion as i } from "./components/collapse-transtion/index.mjs";
8
+ import { useProDialog as u, useProDialogInit as g } from "./components/pro-dialog/hooks/useProDialog.mjs";
9
+ import { proDialogProps as T } from "./components/pro-dialog/src/types.mjs";
10
+ import { KProDialog as A } from "./components/pro-dialog/index.mjs";
11
+ import { TitleProps as F } from "./components/pro-title/src/types.mjs";
12
+ import { KProTitle as I } from "./components/pro-title/index.mjs";
13
+ import { scrollbarProps as b } from "./components/scroll-bar/src/types.mjs";
14
+ import { KScrollBar as y } from "./components/scroll-bar/index.mjs";
15
+ import { KScaleVirtualList as C } from "./components/scale-virtual-list/index.mjs";
16
+ import { proTagProps as V } from "./components/pro-tag/src/types.mjs";
17
+ import { KProTag as j } from "./components/pro-tag/index.mjs";
18
+ import { ProPickerProps as v } from "./components/pro-picker/src/types.mjs";
19
+ import { KProPicker as z } from "./components/pro-picker/index.mjs";
20
+ import { ProAreaProps as G } from "./components/pro-area/src/types.mjs";
21
+ import { useAreaProArea as J } from "./components/pro-area/hooks/use-pro-area.mjs";
22
+ import { KProArea as N } from "./components/pro-area/index.mjs";
23
+ import { useProForm as Q, useProFormInit as R } from "./hooks/useProForm.mjs";
15
24
  export {
16
- s as KCollapseTranstion,
17
- f as KForm,
18
- D as KProDialog,
19
- d as KProTitle,
20
- L as KScaleVirtualList,
21
- F as KScrollBar,
22
- S as TitleProps,
23
- i as collapseProps,
24
- r as default,
25
- l as formType,
26
- c as proDialogProps,
27
- B as scrollbarProps,
28
- K as useProDialog,
29
- g as useProDialogInit
25
+ i as KCollapseTranstion,
26
+ P as KForm,
27
+ N as KProArea,
28
+ A as KProDialog,
29
+ z as KProPicker,
30
+ j as KProTag,
31
+ I as KProTitle,
32
+ C as KScaleVirtualList,
33
+ y as KScrollBar,
34
+ G as ProAreaProps,
35
+ v as ProPickerProps,
36
+ F as TitleProps,
37
+ l as collapseProps,
38
+ o as default,
39
+ f as formType,
40
+ T as proDialogProps,
41
+ V as proTagProps,
42
+ b as scrollbarProps,
43
+ J as useAreaProArea,
44
+ u as useProDialog,
45
+ g as useProDialogInit,
46
+ Q as useProForm,
47
+ R as useProFormInit
30
48
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./form/index.js"),r=require("./collapse-transtion/index.js"),i=require("./pro-dialog/index.js"),o=require("./pro-title/index.js"),t=require("./scroll-bar/index.js"),l=require("./scale-virtual-list/index.js");exports.KForm=e.KForm;exports.KCollapseTranstion=r.KCollapseTranstion;exports.KProDialog=i.KProDialog;exports.KProTitle=o.KProTitle;exports.KScrollBar=t.KScrollBar;exports.KScaleVirtualList=l.KScaleVirtualList;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./form/index.js"),e=require("./collapse-transtion/index.js"),i=require("./pro-dialog/index.js"),o=require("./pro-title/index.js"),n=require("./scroll-bar/index.js"),t=require("./scale-virtual-list/index.js"),l=require("./pro-tag/index.js"),a=require("./pro-picker/index.js"),K=require("./pro-area/index.js");exports.KForm=r.KForm;exports.KCollapseTranstion=e.KCollapseTranstion;exports.KProDialog=i.KProDialog;exports.KProTitle=o.KProTitle;exports.KScrollBar=n.KScrollBar;exports.KScaleVirtualList=t.KScaleVirtualList;exports.KProTag=l.KProTag;exports.KProPicker=a.KProPicker;exports.KProArea=K.KProArea;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={areaTree:()=>globalThis.$http.get("/basic/area/setting/tree")};exports.proAreaApis=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),o=require("../apis/pro-area.api.js");function t(){const e=a.ref([]);return o.proAreaApis.areaTree().then(r=>{e.value=r.data}),{ops:e}}exports.useAreaProArea=t;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../utils/install.js");require("./src/ProArea.vue.js");require("./style/index.js");const t=require("./src/types.js"),u=require("./hooks/use-pro-area.js"),o=require("./src/ProArea.vue2.js"),e=r.withInstall(o.default);exports.ProAreaProps=t.ProAreaProps;exports.useAreaProArea=u.useAreaProArea;exports.KProArea=e;exports.default=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ProArea.vue2.js");exports.default=e.default;
@@ -0,0 +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;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={level:{type:Number,default:3},options:{type:Array,required:!0},FieldNames:{type:Object,default:()=>({name:"name",id:"id",children:"children"})}};exports.ProAreaProps=e;
@@ -0,0 +1 @@
1
+ "use strict";require("../../base/style/index.js");require("@king-one/antdv/dist/theme-chalk/por-area-select.css");
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={company:t=>globalThis.$http.get("/security/company/options",t),user:t=>globalThis.$http.get("/security/user/options",t)};exports.proPickerApi=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../utils/install.js");require("./src/ProPicker.vue.js");const t=require("./src/types.js"),i=require("./src/ProPicker.vue2.js"),e=r.withInstall(i.default);exports.ProPickerProps=t.ProPickerProps;exports.KProPicker=e;exports.default=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ProPicker.vue2.js");exports.default=e.default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-es"),s=require("ant-design-vue"),c=require("../apis/pro-picker.api.js"),p=require("./types.js"),f=e.defineComponent({name:"ProPicker",__name:"ProPicker",props:e.mergeModels(p.ProPickerProps,{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const r=i,l=e.useModel(i,"modelValue"),t=e.reactive({data:[],fetching:!1});e.watch(l,o=>{(typeof o=="string"||typeof o=="number")&&r.isInit&&console.log("开始复制")},{once:!0});const u=d.debounce(o=>{o&&(t.fetching=!0,r.type==="company"?c.proPickerApi.company({params:{label:o}}).then(n=>{t.data=n.data.options.map(a=>({label:a.label,value:a.value})),t.fetching=!1}):c.proPickerApi.user({params:{label:o}}).then(()=>{}))},r.delay);return(o,n)=>(e.openBlock(),e.createBlock(e.unref(s.Select),{value:l.value,"onUpdate:value":n[0]||(n[0]=a=>l.value=a),mode:o.mode,"show-search":"",placeholder:o.placeholder,style:{width:"100%"},"filter-option":!1,"not-found-content":t.fetching?void 0:null,options:t.data,onSearch:e.unref(u)},e.createSlots({_:2},[t.fetching?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(s.Spin),{size:"small"})]),key:"0"}:void 0]),1032,["value","mode","placeholder","not-found-content","options","onSearch"]))}});exports.default=f;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={type:{type:String,default:"company"},placeholder:{type:String,default:"请选择"},mode:{type:String},isInit:{type:Boolean},delay:{type:Number,default:200}};exports.ProPickerProps=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../utils/install.js");require("./src/ProTag.vue.js");const t=require("./src/types.js"),o=require("./src/ProTag.vue2.js"),e=r.withInstall(o.default);exports.proTagProps=t.proTagProps;exports.KProTag=e;exports.default=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ProTag.vue2.js");exports.default=e.default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("./types.js"),d=e.defineComponent({name:"ProTag",__name:"ProTag",props:e.mergeModels(i.proTagProps,{tag:{type:[String,Number,Boolean],required:!0},tagModifiers:{}}),emits:["update:tag"],setup(t){const u=t,l=e.useModel(t,"tag"),o=e.computed(()=>u.options.find(a=>a.value===l.value));return(s,a)=>{var r;const c=e.resolveComponent("ATag");return e.openBlock(),e.createBlock(c,{color:((r=o.value)==null?void 0:r.color)||"default"},{default:e.withCtx(()=>{var n;return[e.createTextVNode(e.toDisplayString(((n=o.value)==null?void 0:n.label)||""),1)]}),_:1},8,["color"])}}});exports.default=d;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={options:{type:Array,required:!0}};exports.proTagProps=r;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useProForm.js");exports.useProForm=r.useProForm;exports.useProFormInit=r.useProFormInit;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("lodash-es"),n=require("vue");function m(o){const t=n.ref(o),c=n.ref(),r=n.getCurrentInstance(),e=u=>{t.value=a.cloneDeep(u)},s=()=>{var u;t.value=o,(u=c.value)==null||u.resetFields()},i={setFormData:e};return r&&(r==null||r.emit("initForm",i)),{ruleForm:t,formRef:c,resetForm:s}}function l(){const o=n.ref(null),t=()=>{const e=n.unref(o.value);return e||console.error("useModal instance is undefined!"),e};return[e=>{o.value=e},{setFormData:e=>{var s;return(s=t())==null?void 0:s.setFormData(e)}}]}exports.useProForm=m;exports.useProFormInit=l;
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./installer.js");require("./components/index.js");const o=require("./components/form/component/form.js"),i=require("./components/form/index.js"),s=require("./components/collapse-transtion/src/types.js"),l=require("./components/collapse-transtion/index.js"),e=require("./components/pro-dialog/hooks/useProDialog.js"),t=require("./components/pro-dialog/src/types.js"),a=require("./components/pro-dialog/index.js"),u=require("./components/pro-title/src/types.js"),n=require("./components/pro-title/index.js"),c=require("./components/scroll-bar/src/types.js"),p=require("./components/scroll-bar/index.js"),P=require("./components/scale-virtual-list/index.js");exports.default=r.default;exports.formType=o.formType;exports.KForm=i.KForm;exports.collapseProps=s.collapseProps;exports.KCollapseTranstion=l.KCollapseTranstion;exports.useProDialog=e.useProDialog;exports.useProDialogInit=e.useProDialogInit;exports.proDialogProps=t.proDialogProps;exports.KProDialog=a.KProDialog;exports.TitleProps=u.TitleProps;exports.KProTitle=n.KProTitle;exports.scrollbarProps=c.scrollbarProps;exports.KScrollBar=p.KScrollBar;exports.KScaleVirtualList=P.KScaleVirtualList;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./installer.js");require("./components/index.js");require("./hooks/index.js");const s=require("./components/form/component/form.js"),i=require("./components/form/index.js"),t=require("./components/collapse-transtion/src/types.js"),u=require("./components/collapse-transtion/index.js"),r=require("./components/pro-dialog/hooks/useProDialog.js"),P=require("./components/pro-dialog/src/types.js"),a=require("./components/pro-dialog/index.js"),l=require("./components/pro-title/src/types.js"),n=require("./components/pro-title/index.js"),c=require("./components/scroll-bar/src/types.js"),p=require("./components/scroll-bar/index.js"),q=require("./components/scale-virtual-list/index.js"),K=require("./components/pro-tag/src/types.js"),g=require("./components/pro-tag/index.js"),d=require("./components/pro-picker/src/types.js"),$=require("./components/pro-picker/index.js"),T=require("./components/pro-area/src/types.js"),m=require("./components/pro-area/hooks/use-pro-area.js"),y=require("./components/pro-area/index.js"),e=require("./hooks/useProForm.js");exports.default=o.default;exports.formType=s.formType;exports.KForm=i.KForm;exports.collapseProps=t.collapseProps;exports.KCollapseTranstion=u.KCollapseTranstion;exports.useProDialog=r.useProDialog;exports.useProDialogInit=r.useProDialogInit;exports.proDialogProps=P.proDialogProps;exports.KProDialog=a.KProDialog;exports.TitleProps=l.TitleProps;exports.KProTitle=n.KProTitle;exports.scrollbarProps=c.scrollbarProps;exports.KScrollBar=p.KScrollBar;exports.KScaleVirtualList=q.KScaleVirtualList;exports.proTagProps=K.proTagProps;exports.KProTag=g.KProTag;exports.ProPickerProps=d.ProPickerProps;exports.KProPicker=$.KProPicker;exports.ProAreaProps=T.ProAreaProps;exports.useAreaProArea=m.useAreaProArea;exports.KProArea=y.KProArea;exports.useProForm=e.useProForm;exports.useProFormInit=e.useProFormInit;
@@ -1 +1 @@
1
- :root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto}.king-pro-title{border-bottom:1px solid #ccc;position:relative;padding-left:10px}.king-pro-title::before{content:"";position:absolute;width:3px;height:16px;background:#517cfc;left:0;top:3px}.king-pro-title--unborder{border:none}.king-pro-dialog .ant-modal-content{padding:0}.king-pro-dialog .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-dialog .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-dialog .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}
1
+ :root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto}.king-pro-title{border-bottom:1px solid #ccc;position:relative;padding-left:10px}.king-pro-title::before{content:"";position:absolute;width:3px;height:16px;background:#517cfc;left:0;top:3px}.king-pro-title--unborder{border:none}.king-pro-dialog .ant-modal-content{padding:0}.king-pro-dialog .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-dialog .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-dialog .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-area-select{width:100%}
@@ -0,0 +1 @@
1
+ .king-pro-area-select{width:100%}
@@ -4,3 +4,6 @@ export * from './pro-dialog';
4
4
  export * from './pro-title';
5
5
  export * from './scroll-bar';
6
6
  export * from './scale-virtual-list';
7
+ export * from './pro-tag';
8
+ export * from './pro-picker';
9
+ export * from './pro-area';
@@ -0,0 +1,3 @@
1
+ export declare const proAreaApis: {
2
+ areaTree: () => Promise<any>;
3
+ };
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ export declare function useAreaProArea(): {
3
+ ops: Ref<any>;
4
+ };
@@ -0,0 +1,72 @@
1
+ import { SFCWithInstall } from '../utils/install';
2
+ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
+ import { levelType, AreaOptions, FieldNames } from './src/types';
4
+ export * from './src/types';
5
+ export declare const KProArea: SFCWithInstall<DefineComponent<{
6
+ level: {
7
+ readonly type: PropType<levelType>;
8
+ readonly default: 3;
9
+ };
10
+ options: {
11
+ readonly type: PropType< AreaOptions[]>;
12
+ readonly required: true;
13
+ };
14
+ FieldNames: {
15
+ readonly type: PropType<FieldNames>;
16
+ readonly default: () => {
17
+ name: string;
18
+ id: string;
19
+ children: string;
20
+ };
21
+ };
22
+ modelValue: {
23
+ type: PropType<{
24
+ province?: string;
25
+ city?: string;
26
+ county?: string;
27
+ }>;
28
+ required: true;
29
+ };
30
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
31
+ "update:modelValue": (modelValue: {
32
+ province?: string;
33
+ city?: string;
34
+ county?: string;
35
+ }) => void;
36
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
37
+ level: {
38
+ readonly type: PropType<levelType>;
39
+ readonly default: 3;
40
+ };
41
+ options: {
42
+ readonly type: PropType< AreaOptions[]>;
43
+ readonly required: true;
44
+ };
45
+ FieldNames: {
46
+ readonly type: PropType<FieldNames>;
47
+ readonly default: () => {
48
+ name: string;
49
+ id: string;
50
+ children: string;
51
+ };
52
+ };
53
+ modelValue: {
54
+ type: PropType<{
55
+ province?: string;
56
+ city?: string;
57
+ county?: string;
58
+ }>;
59
+ required: true;
60
+ };
61
+ }>> & {
62
+ "onUpdate:modelValue"?: ((modelValue: {
63
+ province?: string;
64
+ city?: string;
65
+ county?: string;
66
+ }) => any) | undefined;
67
+ }, {
68
+ level: 1 | 2 | 3;
69
+ FieldNames: FieldNames;
70
+ }, {}>>;
71
+ export * from './hooks/use-pro-area';
72
+ export default KProArea;
@@ -0,0 +1,69 @@
1
+ import { AreaOptions, FieldNames, levelType } from './types';
2
+ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
+ declare const _default: DefineComponent<{
4
+ level: {
5
+ readonly type: PropType<levelType>;
6
+ readonly default: 3;
7
+ };
8
+ options: {
9
+ readonly type: PropType<AreaOptions[]>;
10
+ readonly required: true;
11
+ };
12
+ FieldNames: {
13
+ readonly type: PropType<FieldNames>;
14
+ readonly default: () => {
15
+ name: string;
16
+ id: string;
17
+ children: string;
18
+ };
19
+ };
20
+ modelValue: {
21
+ type: PropType<{
22
+ province?: string;
23
+ city?: string;
24
+ county?: string;
25
+ }>;
26
+ required: true;
27
+ };
28
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
29
+ "update:modelValue": (modelValue: {
30
+ province?: string;
31
+ city?: string;
32
+ county?: string;
33
+ }) => void;
34
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
35
+ level: {
36
+ readonly type: PropType<levelType>;
37
+ readonly default: 3;
38
+ };
39
+ options: {
40
+ readonly type: PropType<AreaOptions[]>;
41
+ readonly required: true;
42
+ };
43
+ FieldNames: {
44
+ readonly type: PropType<FieldNames>;
45
+ readonly default: () => {
46
+ name: string;
47
+ id: string;
48
+ children: string;
49
+ };
50
+ };
51
+ modelValue: {
52
+ type: PropType<{
53
+ province?: string;
54
+ city?: string;
55
+ county?: string;
56
+ }>;
57
+ required: true;
58
+ };
59
+ }>> & {
60
+ "onUpdate:modelValue"?: ((modelValue: {
61
+ province?: string;
62
+ city?: string;
63
+ county?: string;
64
+ }) => any) | undefined;
65
+ }, {
66
+ level: 1 | 2 | 3;
67
+ FieldNames: FieldNames;
68
+ }, {}>;
69
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import { PropType } from 'vue';
2
+ export type FieldNames = {
3
+ [K in keyof Pick<AreaOptions, 'name' | 'id' | 'children'>]?: string;
4
+ };
5
+ declare const level: readonly [1, 2, 3];
6
+ export type levelType = (typeof level)[number];
7
+ export interface AreaOptions {
8
+ /** 展示文本 */
9
+ name?: string;
10
+ /** 值 */
11
+ id?: string;
12
+ /** 子节点 */
13
+ children?: AreaOptions[];
14
+ [key: PropertyKey]: any;
15
+ }
16
+ export interface ArearModelsType {
17
+ /** 所选的值 */
18
+ modelValue: {
19
+ province?: string;
20
+ city?: string;
21
+ county?: string;
22
+ };
23
+ }
24
+ export declare const ProAreaProps: {
25
+ readonly level: {
26
+ readonly type: PropType<levelType>;
27
+ readonly default: 3;
28
+ };
29
+ readonly options: {
30
+ readonly type: PropType<AreaOptions[]>;
31
+ readonly required: true;
32
+ };
33
+ readonly FieldNames: {
34
+ readonly type: PropType<FieldNames>;
35
+ readonly default: () => {
36
+ name: string;
37
+ id: string;
38
+ children: string;
39
+ };
40
+ };
41
+ };
42
+ export {};
@@ -0,0 +1,5 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ export declare const proPickerApi: {
3
+ company: (config: AxiosRequestConfig) => Promise<any>;
4
+ user: (config: AxiosRequestConfig) => Promise<any>;
5
+ };
@@ -0,0 +1,59 @@
1
+ import { SFCWithInstall } from '../utils/install';
2
+ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
+ import { ProPickerType } from './src/types';
4
+ export * from './src/types';
5
+ export declare const KProPicker: SFCWithInstall<DefineComponent<{
6
+ type: {
7
+ readonly type: PropType<ProPickerType>;
8
+ readonly default: "company";
9
+ };
10
+ placeholder: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "请选择";
13
+ };
14
+ mode: {
15
+ readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
16
+ };
17
+ isInit: {
18
+ readonly type: BooleanConstructor;
19
+ };
20
+ delay: {
21
+ readonly type: NumberConstructor;
22
+ readonly default: 200;
23
+ };
24
+ modelValue: {
25
+ type: PropType<string | number | string[] | number[]>;
26
+ };
27
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
28
+ "update:modelValue": (modelValue: string | number | string[] | number[]) => void;
29
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
30
+ type: {
31
+ readonly type: PropType<ProPickerType>;
32
+ readonly default: "company";
33
+ };
34
+ placeholder: {
35
+ readonly type: StringConstructor;
36
+ readonly default: "请选择";
37
+ };
38
+ mode: {
39
+ readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
40
+ };
41
+ isInit: {
42
+ readonly type: BooleanConstructor;
43
+ };
44
+ delay: {
45
+ readonly type: NumberConstructor;
46
+ readonly default: 200;
47
+ };
48
+ modelValue: {
49
+ type: PropType<string | number | string[] | number[]>;
50
+ };
51
+ }>> & {
52
+ "onUpdate:modelValue"?: ((modelValue: string | number | string[] | number[]) => any) | undefined;
53
+ }, {
54
+ type: "company" | "user";
55
+ placeholder: string;
56
+ isInit: boolean;
57
+ delay: number;
58
+ }, {}>>;
59
+ export default KProPicker;
@@ -0,0 +1,57 @@
1
+ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
+ import { ProPickerType } from './types';
3
+ declare const _default: DefineComponent<{
4
+ type: {
5
+ readonly type: PropType<ProPickerType>;
6
+ readonly default: "company";
7
+ };
8
+ placeholder: {
9
+ readonly type: StringConstructor;
10
+ readonly default: "请选择";
11
+ };
12
+ mode: {
13
+ readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
14
+ };
15
+ isInit: {
16
+ readonly type: BooleanConstructor;
17
+ };
18
+ delay: {
19
+ readonly type: NumberConstructor;
20
+ readonly default: 200;
21
+ };
22
+ modelValue: {
23
+ type: PropType<string | number | string[] | number[]>;
24
+ };
25
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
26
+ "update:modelValue": (modelValue: string | number | string[] | number[]) => void;
27
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
28
+ type: {
29
+ readonly type: PropType<ProPickerType>;
30
+ readonly default: "company";
31
+ };
32
+ placeholder: {
33
+ readonly type: StringConstructor;
34
+ readonly default: "请选择";
35
+ };
36
+ mode: {
37
+ readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
38
+ };
39
+ isInit: {
40
+ readonly type: BooleanConstructor;
41
+ };
42
+ delay: {
43
+ readonly type: NumberConstructor;
44
+ readonly default: 200;
45
+ };
46
+ modelValue: {
47
+ type: PropType<string | number | string[] | number[]>;
48
+ };
49
+ }>> & {
50
+ "onUpdate:modelValue"?: ((modelValue: string | number | string[] | number[]) => any) | undefined;
51
+ }, {
52
+ type: "company" | "user";
53
+ placeholder: string;
54
+ isInit: boolean;
55
+ delay: number;
56
+ }, {}>;
57
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import { PropType } from 'vue';
2
+ declare const ProPickers: readonly ["company", "user"];
3
+ export type ProPickerType = (typeof ProPickers)[number];
4
+ export declare const ProPickerProps: {
5
+ readonly type: {
6
+ readonly type: PropType<ProPickerType>;
7
+ readonly default: "company";
8
+ };
9
+ readonly placeholder: {
10
+ readonly type: StringConstructor;
11
+ readonly default: "请选择";
12
+ };
13
+ readonly mode: {
14
+ readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
15
+ };
16
+ readonly isInit: {
17
+ readonly type: BooleanConstructor;
18
+ };
19
+ readonly delay: {
20
+ readonly type: NumberConstructor;
21
+ readonly default: 200;
22
+ };
23
+ };
24
+ export {};
@@ -0,0 +1,36 @@
1
+ import { SFCWithInstall } from '../utils/install';
2
+ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
+ import { colorType } from './src/types';
4
+ export * from './src/types';
5
+ export declare const KProTag: SFCWithInstall<DefineComponent<{
6
+ options: {
7
+ readonly type: PropType<{
8
+ value: string | number | boolean;
9
+ label: string;
10
+ color: colorType;
11
+ }[]>;
12
+ readonly required: true;
13
+ };
14
+ tag: {
15
+ type: PropType<string | number | boolean | undefined>;
16
+ required: true;
17
+ };
18
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
19
+ "update:tag": (tag: string | number | boolean | undefined) => void;
20
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
21
+ options: {
22
+ readonly type: PropType<{
23
+ value: string | number | boolean;
24
+ label: string;
25
+ color: colorType;
26
+ }[]>;
27
+ readonly required: true;
28
+ };
29
+ tag: {
30
+ type: PropType<string | number | boolean | undefined>;
31
+ required: true;
32
+ };
33
+ }>> & {
34
+ "onUpdate:tag"?: ((tag: string | number | boolean | undefined) => any) | undefined;
35
+ }, {}, {}>>;
36
+ export default KProTag;
@@ -0,0 +1,34 @@
1
+ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
+ import { colorType } from './types';
3
+ declare const _default: DefineComponent<{
4
+ options: {
5
+ readonly type: PropType<{
6
+ value: string | number | boolean;
7
+ label: string;
8
+ color: colorType;
9
+ }[]>;
10
+ readonly required: true;
11
+ };
12
+ tag: {
13
+ type: PropType<string | number | boolean | undefined>;
14
+ required: true;
15
+ };
16
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
17
+ "update:tag": (tag: string | number | boolean | undefined) => void;
18
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
19
+ options: {
20
+ readonly type: PropType<{
21
+ value: string | number | boolean;
22
+ label: string;
23
+ color: colorType;
24
+ }[]>;
25
+ readonly required: true;
26
+ };
27
+ tag: {
28
+ type: PropType<string | number | boolean | undefined>;
29
+ required: true;
30
+ };
31
+ }>> & {
32
+ "onUpdate:tag"?: ((tag: string | number | boolean | undefined) => any) | undefined;
33
+ }, {}, {}>;
34
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { ExtractPublicPropTypes, PropType } from 'vue';
2
+ declare const colors: readonly ["success", "processing", "error", "warning", "default"];
3
+ export type colorType = (typeof colors)[number];
4
+ export declare const proTagProps: {
5
+ readonly options: {
6
+ readonly type: PropType<{
7
+ value: string | number | boolean;
8
+ label: string;
9
+ color: colorType;
10
+ }[]>;
11
+ readonly required: true;
12
+ };
13
+ };
14
+ export type TagProps = ExtractPublicPropTypes<typeof proTagProps>;
15
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useProForm';
@@ -0,0 +1,23 @@
1
+ import { InjectionKey, Ref, ComputedRef } from 'vue';
2
+ export declare const defaultNamespace = "king";
3
+ export declare const namespaceContextKey: InjectionKey<Ref<string | undefined>>;
4
+ export declare function useGetDerivedNamespace(namespaceOverrides?: Ref<string | undefined>): ComputedRef<string>;
5
+ export declare function useNamespace(block: string, namespaceOverrides?: Ref<string | undefined>): {
6
+ namespace: ComputedRef<string>;
7
+ b: (blockSuffix?: string) => string;
8
+ e: (element?: string) => string;
9
+ m: (modifier?: string) => string;
10
+ be: (blockSuffix?: string, element?: string) => string;
11
+ em: (element?: string, modifier?: string) => string;
12
+ bm: (blockSuffix?: string, modifier?: string) => string;
13
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
14
+ is: {
15
+ (name: string, state: boolean | undefined): string;
16
+ (name: string): string;
17
+ };
18
+ cssVar: (object: Record<string, string>) => Record<string, string>;
19
+ cssVarName: (name: string) => string;
20
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
21
+ cssVarBlockName: (name: string) => string;
22
+ };
23
+ export type UseNamespaceReturn = ReturnType<typeof useNamespace>;
@@ -0,0 +1,14 @@
1
+ import { FormInstance } from 'ant-design-vue';
2
+ import { Ref } from 'vue';
3
+ export interface ModalMethods {
4
+ setFormData: (data: object) => void;
5
+ }
6
+ export declare function useProForm<T>(init: T): {
7
+ ruleForm: Ref<T>;
8
+ formRef: Ref<FormInstance | undefined>;
9
+ resetForm: () => void;
10
+ };
11
+ export declare function useProFormInit(): [
12
+ (methods: ModalMethods) => void,
13
+ ModalMethods
14
+ ];
@@ -1,3 +1,4 @@
1
1
  import { default as installer } from './installer';
2
2
  export * from './components';
3
+ export * from './hooks';
3
4
  export default installer;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.32",
4
+ "version": "1.0.34",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",
@@ -17,6 +17,7 @@
17
17
  "peerDependencies": {
18
18
  "ant-design-vue": "^4.2.4",
19
19
  "async-validator": "^4.2.5",
20
+ "axios": "^1.6.2",
20
21
  "lodash-es": "^4.17.21",
21
22
  "vue": "^3.4.34"
22
23
  },