@king-one/antdv 1.0.65 → 1.0.67

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.67
4
+
5
+ ### Patch Changes
6
+
7
+ - fix:修改 ProPicker 组件,flowApplication 内部封装的接口地址
8
+
9
+ ## 1.0.66
10
+
11
+ ### Patch Changes
12
+
13
+ - feat:ProPicker 组件增加 change 事件
14
+
3
15
  ## 1.0.65
4
16
 
5
17
  ### Patch Changes
@@ -1,85 +1,84 @@
1
- import { defineComponent as u, mergeModels as f, useModel as h, reactive as v, watch as g, openBlock as b, createBlock as y, unref as i, createSlots as P, withCtx as k, createVNode as S } from "vue";
2
- import { debounce as w } from "lodash-es";
3
- import { Select as A, Spin as O } from "ant-design-vue";
4
- import { proPickerApi as r } from "../apis/pro-picker.api.mjs";
5
- import { ProPickerProps as V, PickerApiEnum as c } from "./types.mjs";
6
- const z = /* @__PURE__ */ u({
1
+ import { defineComponent as v, mergeModels as d, useModel as y, reactive as b, watch as P, openBlock as k, createBlock as S, unref as s, createSlots as C, withCtx as w, createVNode as A } from "vue";
2
+ import { debounce as V } from "lodash-es";
3
+ import { Select as M, Spin as O } from "ant-design-vue";
4
+ import { proPickerApi as p } from "../apis/pro-picker.api.mjs";
5
+ import { ProPickerProps as B, PickerApiEnum as m } from "./types.mjs";
6
+ const F = /* @__PURE__ */ v({
7
7
  name: "ProPicker",
8
8
  __name: "ProPicker",
9
- props: /* @__PURE__ */ f(V, {
9
+ props: /* @__PURE__ */ d(B, {
10
10
  modelValue: {},
11
11
  modelModifiers: {}
12
12
  }),
13
- emits: ["update:modelValue"],
14
- setup(d) {
15
- const p = d, s = h(d, "modelValue"), a = v({
13
+ emits: /* @__PURE__ */ d(["change"], ["update:modelValue"]),
14
+ setup(c, { emit: u }) {
15
+ const r = c, f = u, i = y(c, "modelValue"), t = b({
16
16
  data: [],
17
17
  fetching: !1
18
18
  });
19
- g(
20
- s,
19
+ P(
20
+ i,
21
21
  (e) => {
22
- if (!e || a.data.some((t) => t.value === e))
22
+ if (!e || t.data.some((a) => a.value === e))
23
23
  return;
24
- const l = c[p.type];
25
- r.getOps({ url: l, params: { value: e } }).then((t) => {
26
- a.data = t.data.options.map((o) => ({
27
- label: o.label,
28
- value: o.value
29
- }));
30
- }), typeof e == "string" || typeof e == "number" ? r.getOps({
31
- url: l,
24
+ const n = m[r.type];
25
+ typeof e == "string" || typeof e == "number" ? p.getOps({
26
+ url: n,
32
27
  params: { value: e }
33
- }).then((t) => {
34
- a.data = t.data.options.map((o) => ({
35
- label: o.label,
36
- value: o.value
28
+ }).then((a) => {
29
+ t.data = a.data.options.map((l) => ({
30
+ label: l.label,
31
+ value: l.value
37
32
  }));
38
- }) : Array.isArray(e) && r.getOps({
39
- url: l,
33
+ }) : Array.isArray(e) && p.getOps({
34
+ url: n,
40
35
  params: { value: e.join(",") }
41
- }).then((t) => {
42
- a.data = t.data.options.map((o) => ({
43
- label: o.label,
44
- value: o.value
45
- })), a.fetching = !1;
36
+ }).then((a) => {
37
+ t.data = a.data.options.map((l) => ({
38
+ label: l.label,
39
+ value: l.value
40
+ })), t.fetching = !1;
46
41
  });
47
42
  },
48
43
  {
49
44
  immediate: !0
50
45
  }
51
46
  );
52
- const m = w((e) => {
47
+ const h = V((e) => {
53
48
  if (e) {
54
- a.fetching = !0;
55
- const n = c[p.type];
56
- r.getOps({ url: n, params: { label: e } }).then((l) => {
57
- a.data = l.data.options.map((t) => ({
58
- label: t.label,
59
- value: t.value
60
- })), a.fetching = !1;
49
+ t.fetching = !0;
50
+ const o = m[r.type];
51
+ p.getOps({ url: o, params: { label: e } }).then((n) => {
52
+ t.data = n.data.options.map((a) => ({
53
+ label: a.label,
54
+ value: a.value
55
+ })), t.fetching = !1;
61
56
  });
62
57
  }
63
- }, p.delay);
64
- return (e, n) => (b(), y(i(A), {
65
- value: s.value,
66
- "onUpdate:value": n[0] || (n[0] = (l) => s.value = l),
58
+ }, r.delay);
59
+ function g(e, o) {
60
+ f("change", o);
61
+ }
62
+ return (e, o) => (k(), S(s(M), {
63
+ value: i.value,
64
+ "onUpdate:value": o[0] || (o[0] = (n) => i.value = n),
67
65
  mode: e.mode,
68
66
  "show-search": "",
69
67
  placeholder: e.placeholder,
70
68
  style: { width: "100%" },
71
69
  "filter-option": !1,
72
- "not-found-content": a.fetching ? void 0 : null,
73
- options: a.data,
74
- onSearch: i(m)
75
- }, P({
70
+ "not-found-content": t.fetching ? void 0 : null,
71
+ options: t.data,
72
+ onChange: g,
73
+ onSearch: s(h)
74
+ }, C({
76
75
  _: 2
77
76
  /* DYNAMIC */
78
77
  }, [
79
- a.fetching ? {
78
+ t.fetching ? {
80
79
  name: "notFoundContent",
81
- fn: k(() => [
82
- S(i(O), { size: "small" })
80
+ fn: w(() => [
81
+ A(s(O), { size: "small" })
83
82
  ]),
84
83
  key: "0"
85
84
  } : void 0
@@ -87,5 +86,5 @@ const z = /* @__PURE__ */ u({
87
86
  }
88
87
  });
89
88
  export {
90
- z as default
89
+ F as default
91
90
  };
@@ -1,4 +1,4 @@
1
- var e = /* @__PURE__ */ ((t) => (t.company = "/security/company/options", t.user = "/security/user/options", t.department = "/security/department/options", t.flowApplication = "/dev-api/flow/application/options", t))(e || {});
1
+ var e = /* @__PURE__ */ ((t) => (t.company = "/security/company/options", t.user = "/security/user/options", t.department = "/security/department/options", t.flowApplication = "/flow/application/options", t))(e || {});
2
2
  const o = {
3
3
  type: {
4
4
  type: String,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),m=require("lodash-es"),d=require("ant-design-vue"),i=require("../apis/pro-picker.api.js"),u=require("./types.js"),h=t.defineComponent({name:"ProPicker",__name:"ProPicker",props:t.mergeModels(u.ProPickerProps,{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const s=c,p=t.useModel(c,"modelValue"),a=t.reactive({data:[],fetching:!1});t.watch(p,e=>{if(!e||a.data.some(o=>o.value===e))return;const r=u.PickerApiEnum[s.type];i.proPickerApi.getOps({url:r,params:{value:e}}).then(o=>{a.data=o.data.options.map(n=>({label:n.label,value:n.value}))}),typeof e=="string"||typeof e=="number"?i.proPickerApi.getOps({url:r,params:{value:e}}).then(o=>{a.data=o.data.options.map(n=>({label:n.label,value:n.value}))}):Array.isArray(e)&&i.proPickerApi.getOps({url:r,params:{value:e.join(",")}}).then(o=>{a.data=o.data.options.map(n=>({label:n.label,value:n.value})),a.fetching=!1})},{immediate:!0});const f=m.debounce(e=>{if(e){a.fetching=!0;const l=u.PickerApiEnum[s.type];i.proPickerApi.getOps({url:l,params:{label:e}}).then(r=>{a.data=r.data.options.map(o=>({label:o.label,value:o.value})),a.fetching=!1})}},s.delay);return(e,l)=>(t.openBlock(),t.createBlock(t.unref(d.Select),{value:p.value,"onUpdate:value":l[0]||(l[0]=r=>p.value=r),mode:e.mode,"show-search":"",placeholder:e.placeholder,style:{width:"100%"},"filter-option":!1,"not-found-content":a.fetching?void 0:null,options:a.data,onSearch:t.unref(f)},t.createSlots({_:2},[a.fetching?{name:"notFoundContent",fn:t.withCtx(()=>[t.createVNode(t.unref(d.Spin),{size:"small"})]),key:"0"}:void 0]),1032,["value","mode","placeholder","not-found-content","options","onSearch"]))}});exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),v=require("lodash-es"),d=require("ant-design-vue"),c=require("../apis/pro-picker.api.js"),u=require("./types.js"),P=t.defineComponent({name:"ProPicker",__name:"ProPicker",props:t.mergeModels(u.ProPickerProps,{modelValue:{},modelModifiers:{}}),emits:t.mergeModels(["change"],["update:modelValue"]),setup(p,{emit:f}){const i=p,m=f,s=t.useModel(p,"modelValue"),a=t.reactive({data:[],fetching:!1});t.watch(s,e=>{if(!e||a.data.some(o=>o.value===e))return;const r=u.PickerApiEnum[i.type];typeof e=="string"||typeof e=="number"?c.proPickerApi.getOps({url:r,params:{value:e}}).then(o=>{a.data=o.data.options.map(l=>({label:l.label,value:l.value}))}):Array.isArray(e)&&c.proPickerApi.getOps({url:r,params:{value:e.join(",")}}).then(o=>{a.data=o.data.options.map(l=>({label:l.label,value:l.value})),a.fetching=!1})},{immediate:!0});const h=v.debounce(e=>{if(e){a.fetching=!0;const n=u.PickerApiEnum[i.type];c.proPickerApi.getOps({url:n,params:{label:e}}).then(r=>{a.data=r.data.options.map(o=>({label:o.label,value:o.value})),a.fetching=!1})}},i.delay);function g(e,n){m("change",n)}return(e,n)=>(t.openBlock(),t.createBlock(t.unref(d.Select),{value:s.value,"onUpdate:value":n[0]||(n[0]=r=>s.value=r),mode:e.mode,"show-search":"",placeholder:e.placeholder,style:{width:"100%"},"filter-option":!1,"not-found-content":a.fetching?void 0:null,options:a.data,onChange:g,onSearch:t.unref(h)},t.createSlots({_:2},[a.fetching?{name:"notFoundContent",fn:t.withCtx(()=>[t.createVNode(t.unref(d.Spin),{size:"small"})]),key:"0"}:void 0]),1032,["value","mode","placeholder","not-found-content","options","onSearch"]))}});exports.default=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(t=>(t.company="/security/company/options",t.user="/security/user/options",t.department="/security/department/options",t.flowApplication="/dev-api/flow/application/options",t))(e||{});const o={type:{type:String,default:"company"},placeholder:{type:String,default:"请选择"},mode:{type:String},delay:{type:Number,default:200}};exports.PickerApiEnum=e;exports.ProPickerProps=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(t=>(t.company="/security/company/options",t.user="/security/user/options",t.department="/security/department/options",t.flowApplication="/flow/application/options",t))(e||{});const o={type:{type:String,default:"company"},placeholder:{type:String,default:"请选择"},mode:{type:String},delay:{type:Number,default:200}};exports.PickerApiEnum=e;exports.ProPickerProps=o;
@@ -1 +1 @@
1
- @font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=27648) format("woff2"),url(fonts/iconfont.woff?t=73353) format("woff"),url(fonts/iconfont.ttf?t=69940) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
1
+ @font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=11830) format("woff2"),url(fonts/iconfont.woff?t=54587) format("woff"),url(fonts/iconfont.ttf?t=35350) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
@@ -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-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .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-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=11857) format("woff2"),url(fonts/iconfont.woff?t=89436) format("woff"),url(fonts/iconfont.ttf?t=61903) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
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-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .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-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=20696) format("woff2"),url(fonts/iconfont.woff?t=84605) format("woff"),url(fonts/iconfont.ttf?t=5466) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
@@ -1,6 +1,6 @@
1
1
  import { SFCWithInstall } from '../utils/install';
2
2
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
- import { ProPickerType } from './src/types';
3
+ import { ProPickerType, ProPickerOption } from './src/types';
4
4
  export * from './src/types';
5
5
  export declare const KProPicker: SFCWithInstall<DefineComponent<{
6
6
  type: {
@@ -22,6 +22,7 @@ export declare const KProPicker: SFCWithInstall<DefineComponent<{
22
22
  type: PropType<string | number | string[] | number[]>;
23
23
  };
24
24
  }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
25
+ change: (value?: ProPickerOption | ProPickerOption[] | undefined) => void;
25
26
  "update:modelValue": (modelValue: string | number | string[] | number[]) => void;
26
27
  }, string, PublicProps, Readonly< ExtractPropTypes<{
27
28
  type: {
@@ -43,6 +44,7 @@ export declare const KProPicker: SFCWithInstall<DefineComponent<{
43
44
  type: PropType<string | number | string[] | number[]>;
44
45
  };
45
46
  }>> & {
47
+ onChange?: ((value?: ProPickerOption | ProPickerOption[] | undefined) => any) | undefined;
46
48
  "onUpdate:modelValue"?: ((modelValue: string | number | string[] | number[]) => any) | undefined;
47
49
  }, {
48
50
  type: "company" | "user" | "department" | "flowApplication";
@@ -1,5 +1,5 @@
1
+ import { ProPickerOption, ProPickerType } from './types';
1
2
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- import { ProPickerType } from './types';
3
3
  declare const _default: DefineComponent<{
4
4
  type: {
5
5
  readonly type: PropType<ProPickerType>;
@@ -20,6 +20,7 @@ declare const _default: DefineComponent<{
20
20
  type: PropType<string | number | string[] | number[]>;
21
21
  };
22
22
  }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
+ change: (value?: ProPickerOption | ProPickerOption[] | undefined) => void;
23
24
  "update:modelValue": (modelValue: string | number | string[] | number[]) => void;
24
25
  }, string, PublicProps, Readonly< ExtractPropTypes<{
25
26
  type: {
@@ -41,6 +42,7 @@ declare const _default: DefineComponent<{
41
42
  type: PropType<string | number | string[] | number[]>;
42
43
  };
43
44
  }>> & {
45
+ onChange?: ((value?: ProPickerOption | ProPickerOption[] | undefined) => any) | undefined;
44
46
  "onUpdate:modelValue"?: ((modelValue: string | number | string[] | number[]) => any) | undefined;
45
47
  }, {
46
48
  type: "company" | "user" | "department" | "flowApplication";
@@ -3,7 +3,7 @@ export declare enum PickerApiEnum {
3
3
  company = "/security/company/options",
4
4
  user = "/security/user/options",
5
5
  department = "/security/department/options",
6
- flowApplication = "/dev-api/flow/application/options"
6
+ flowApplication = "/flow/application/options"
7
7
  }
8
8
  export type ProPickerType = keyof typeof PickerApiEnum;
9
9
  export declare const ProPickerProps: {
@@ -23,3 +23,10 @@ export declare const ProPickerProps: {
23
23
  readonly default: 200;
24
24
  };
25
25
  };
26
+ export interface ProPickerOption {
27
+ label: string;
28
+ value: string | number;
29
+ }
30
+ export interface ProPickerEmits {
31
+ (e: 'change', value?: ProPickerOption | ProPickerOption[]): void;
32
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.65",
4
+ "version": "1.0.67",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",