@king-one/antdv 1.0.32 → 1.0.33

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,12 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.33
4
+
5
+ ### Patch Changes
6
+
7
+ - feat:增加业务 proUseForm hook
8
+ - feat:新增 ProTag 组件
9
+
3
10
  ## 1.0.32
4
11
 
5
12
  ### Patch Changes
@@ -4,10 +4,12 @@ import { KProDialog as p } from "./pro-dialog/index.mjs";
4
4
  import { KProTitle as f } from "./pro-title/index.mjs";
5
5
  import { KScrollBar as K } from "./scroll-bar/index.mjs";
6
6
  import { KScaleVirtualList as s } from "./scale-virtual-list/index.mjs";
7
+ import { KProTag as T } from "./pro-tag/index.mjs";
7
8
  export {
8
9
  l as KCollapseTranstion,
9
10
  t as KForm,
10
11
  p as KProDialog,
12
+ T as KProTag,
11
13
  f as KProTitle,
12
14
  s as KScaleVirtualList,
13
15
  K as KScrollBar
@@ -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,38 @@
1
1
  import r 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";
3
+ import "./hooks/index.mjs";
4
+ import { formType as f } from "./components/form/component/form.mjs";
5
+ import { KForm as x } from "./components/form/index.mjs";
5
6
  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";
7
+ import { KCollapseTranstion as P } from "./components/collapse-transtion/index.mjs";
8
+ import { useProDialog as u, useProDialogInit as K } from "./components/pro-dialog/hooks/useProDialog.mjs";
9
+ import { proDialogProps as n } from "./components/pro-dialog/src/types.mjs";
9
10
  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";
11
+ import { TitleProps as I } from "./components/pro-title/src/types.mjs";
12
+ import { KProTitle as b } from "./components/pro-title/index.mjs";
13
+ import { scrollbarProps as y } from "./components/scroll-bar/src/types.mjs";
14
+ import { KScrollBar as C } from "./components/scroll-bar/index.mjs";
15
+ import { KScaleVirtualList as V } from "./components/scale-virtual-list/index.mjs";
16
+ import { proTagProps as j } from "./components/pro-tag/src/types.mjs";
17
+ import { KProTag as q } from "./components/pro-tag/index.mjs";
18
+ import { useProForm as w, useProFormInit as z } from "./hooks/useProForm.mjs";
15
19
  export {
16
- s as KCollapseTranstion,
17
- f as KForm,
20
+ P as KCollapseTranstion,
21
+ x as KForm,
18
22
  D as KProDialog,
19
- d as KProTitle,
20
- L as KScaleVirtualList,
21
- F as KScrollBar,
22
- S as TitleProps,
23
+ q as KProTag,
24
+ b as KProTitle,
25
+ V as KScaleVirtualList,
26
+ C as KScrollBar,
27
+ I as TitleProps,
23
28
  i as collapseProps,
24
29
  r as default,
25
- l as formType,
26
- c as proDialogProps,
27
- B as scrollbarProps,
28
- K as useProDialog,
29
- g as useProDialogInit
30
+ f as formType,
31
+ n as proDialogProps,
32
+ j as proTagProps,
33
+ y as scrollbarProps,
34
+ u as useProDialog,
35
+ K as useProDialogInit,
36
+ w as useProForm,
37
+ z as useProFormInit
30
38
  };
@@ -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 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"),n=require("./scale-virtual-list/index.js"),l=require("./pro-tag/index.js");exports.KForm=e.KForm;exports.KCollapseTranstion=r.KCollapseTranstion;exports.KProDialog=i.KProDialog;exports.KProTitle=o.KProTitle;exports.KScrollBar=t.KScrollBar;exports.KScaleVirtualList=n.KScaleVirtualList;exports.KProTag=l.KProTag;
@@ -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"),l=require("./components/collapse-transtion/index.js"),r=require("./components/pro-dialog/hooks/useProDialog.js"),u=require("./components/pro-dialog/src/types.js"),n=require("./components/pro-dialog/index.js"),a=require("./components/pro-title/src/types.js"),P=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"),g=require("./components/pro-tag/src/types.js"),K=require("./components/pro-tag/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=l.KCollapseTranstion;exports.useProDialog=r.useProDialog;exports.useProDialogInit=r.useProDialogInit;exports.proDialogProps=u.proDialogProps;exports.KProDialog=n.KProDialog;exports.TitleProps=a.TitleProps;exports.KProTitle=P.KProTitle;exports.scrollbarProps=c.scrollbarProps;exports.KScrollBar=p.KScrollBar;exports.KScaleVirtualList=q.KScaleVirtualList;exports.proTagProps=g.proTagProps;exports.KProTag=K.KProTag;exports.useProForm=e.useProForm;exports.useProFormInit=e.useProFormInit;
@@ -4,3 +4,4 @@ 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';
@@ -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.33",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",