@king-one/antdv 1.0.44 → 1.0.45
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 +6 -0
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +38 -30
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +1 -1
- package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +17 -3
- package/dist/types/components/scale-virtual-list/component/types.d.ts +1 -0
- package/dist/types/components/scale-virtual-list/index.d.ts +37 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,48 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { defaultNamespace as
|
|
3
|
-
import { useVirtualList as
|
|
4
|
-
const z = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as P, toRefs as g, openBlock as r, createElementBlock as l, mergeProps as i, unref as e, createElementVNode as n, normalizeClass as c, Fragment as w, renderList as B, renderSlot as E } from "vue";
|
|
2
|
+
import { defaultNamespace as s } from "../../../hooks/use-namespace/index.mjs";
|
|
3
|
+
import { useVirtualList as L } from "../hooks/useVirtualList.mjs";
|
|
4
|
+
const z = /* @__PURE__ */ P({
|
|
5
5
|
__name: "scale-virtual-list",
|
|
6
6
|
props: {
|
|
7
7
|
list: {},
|
|
8
|
-
option: {}
|
|
8
|
+
option: {},
|
|
9
|
+
itemClassName: { default: `${s}-scale-virtual-item` }
|
|
9
10
|
},
|
|
10
11
|
emits: ["update:state"],
|
|
11
|
-
setup(p, { expose:
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
scrollTo:
|
|
15
|
-
scaleTo:
|
|
16
|
-
state:
|
|
17
|
-
}),
|
|
12
|
+
setup(p, { expose: m, emit: u }) {
|
|
13
|
+
const o = p, d = u, { list: f } = g(o), { list: v, containerProps: $, wrapperProps: x, scrollTo: C, scaleTo: N, state: _, onUpdate: k } = L(f, o.option);
|
|
14
|
+
return m({
|
|
15
|
+
scrollTo: C,
|
|
16
|
+
scaleTo: N,
|
|
17
|
+
state: _
|
|
18
|
+
}), k((t) => d("update:state", t)), (t, T) => (r(), l(
|
|
18
19
|
"div",
|
|
19
|
-
|
|
20
|
-
class: `${e(
|
|
21
|
-
}, e(
|
|
20
|
+
i({
|
|
21
|
+
class: `${e(s)}-scale-virtual-list`
|
|
22
|
+
}, e($)),
|
|
22
23
|
[
|
|
23
|
-
|
|
24
|
+
n(
|
|
24
25
|
"div",
|
|
25
26
|
{
|
|
26
|
-
class:
|
|
27
|
+
class: c(`${e(s)}-scale-virtual-list-container`)
|
|
27
28
|
},
|
|
28
29
|
[
|
|
29
|
-
|
|
30
|
+
n(
|
|
30
31
|
"div",
|
|
31
|
-
|
|
32
|
-
class: `${e(
|
|
32
|
+
i({
|
|
33
|
+
class: `${e(s)}-scale-vittual-wrapper`
|
|
33
34
|
}, e(x)),
|
|
34
35
|
[
|
|
35
|
-
(r(!0),
|
|
36
|
-
|
|
36
|
+
(r(!0), l(
|
|
37
|
+
w,
|
|
37
38
|
null,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
B(e(v), (a) => (r(), l(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
key: a.index,
|
|
43
|
+
class: c(t.itemClassName)
|
|
44
|
+
},
|
|
45
|
+
[
|
|
46
|
+
E(t.$slots, "default", {
|
|
47
|
+
item: a,
|
|
48
|
+
index: a.index
|
|
49
|
+
})
|
|
50
|
+
],
|
|
51
|
+
2
|
|
52
|
+
/* CLASS */
|
|
53
|
+
))),
|
|
46
54
|
128
|
|
47
55
|
/* KEYED_FRAGMENT */
|
|
48
56
|
))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("../../../hooks/use-namespace/index.js"),k=require("../hooks/useVirtualList.js"),B=e.defineComponent({__name:"scale-virtual-list",props:{list:{},option:{},itemClassName:{default:`${s.defaultNamespace}-scale-virtual-item`}},emits:["update:state"],setup(r,{expose:n,emit:o}){const l=r,i=o,{list:c}=e.toRefs(l),{list:u,containerProps:p,wrapperProps:d,scrollTo:m,scaleTo:f,state:v,onUpdate:N}=k.useVirtualList(c,l.option);return n({scrollTo:m,scaleTo:f,state:v}),N(t=>i("update:state",t)),(t,_)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:`${e.unref(s.defaultNamespace)}-scale-virtual-list`},e.unref(p)),[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(s.defaultNamespace)}-scale-virtual-list-container`)},[e.createElementVNode("div",e.mergeProps({class:`${e.unref(s.defaultNamespace)}-scale-vittual-wrapper`},e.unref(d)),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),a=>(e.openBlock(),e.createElementBlock("div",{key:a.index,class:e.normalizeClass(t.itemClassName)},[e.renderSlot(t.$slots,"default",{item:a,index:a.index})],2))),128))],16)],2)],16))}});exports.default=B;
|
|
@@ -7,17 +7,28 @@ declare function __VLS_template(): {
|
|
|
7
7
|
attrs: Partial<{}>;
|
|
8
8
|
};
|
|
9
9
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
-
declare const __VLS_component: DefineComponent<__VLS_TypePropsToOption<VirtualListProps>, {
|
|
10
|
+
declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<VirtualListProps>, {
|
|
11
|
+
itemClassName: string;
|
|
12
|
+
}>, {
|
|
11
13
|
scrollTo: (index: number) => void;
|
|
12
14
|
scaleTo: (s: number) => void;
|
|
13
15
|
state: Ref<UseVirtualListState>;
|
|
14
16
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
15
17
|
"update:state": (state: UseVirtualListState | null) => void;
|
|
16
|
-
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<VirtualListProps
|
|
18
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<VirtualListProps>, {
|
|
19
|
+
itemClassName: string;
|
|
20
|
+
}>>> & {
|
|
17
21
|
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
18
|
-
}, {
|
|
22
|
+
}, {
|
|
23
|
+
itemClassName: string;
|
|
24
|
+
}, {}>;
|
|
19
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
26
|
export default _default;
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
21
32
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
33
|
type __VLS_TypePropsToOption<T> = {
|
|
23
34
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
@@ -32,3 +43,6 @@ type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
32
43
|
$slots: S;
|
|
33
44
|
};
|
|
34
45
|
};
|
|
46
|
+
type __VLS_PrettifyLocal<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -6,13 +6,17 @@ export * from './style/index';
|
|
|
6
6
|
export * from './component/types';
|
|
7
7
|
export declare const KScaleVirtualList: SFCWithInstall<{
|
|
8
8
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
9
|
+
option: {
|
|
10
|
+
type: PropType<UseVirtualListOptions>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
9
13
|
list: {
|
|
10
14
|
type: PropType<any[]>;
|
|
11
15
|
required: true;
|
|
12
16
|
};
|
|
13
|
-
|
|
14
|
-
type: PropType<
|
|
15
|
-
|
|
17
|
+
itemClassName: {
|
|
18
|
+
type: PropType<string>;
|
|
19
|
+
default: string;
|
|
16
20
|
};
|
|
17
21
|
}>> & {
|
|
18
22
|
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
@@ -23,17 +27,23 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
23
27
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
24
28
|
"update:state": (state: UseVirtualListState | null) => void;
|
|
25
29
|
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
30
|
+
option: {
|
|
31
|
+
type: PropType<UseVirtualListOptions>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
26
34
|
list: {
|
|
27
35
|
type: PropType<any[]>;
|
|
28
36
|
required: true;
|
|
29
37
|
};
|
|
30
|
-
|
|
31
|
-
type: PropType<
|
|
32
|
-
|
|
38
|
+
itemClassName: {
|
|
39
|
+
type: PropType<string>;
|
|
40
|
+
default: string;
|
|
33
41
|
};
|
|
34
42
|
}>> & {
|
|
35
43
|
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
36
|
-
}, {
|
|
44
|
+
}, {
|
|
45
|
+
itemClassName: string;
|
|
46
|
+
}, true, {}, {}, {
|
|
37
47
|
P: {};
|
|
38
48
|
B: {};
|
|
39
49
|
D: {};
|
|
@@ -41,13 +51,17 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
41
51
|
M: {};
|
|
42
52
|
Defaults: {};
|
|
43
53
|
}, Readonly< ExtractPropTypes<{
|
|
54
|
+
option: {
|
|
55
|
+
type: PropType<UseVirtualListOptions>;
|
|
56
|
+
required: true;
|
|
57
|
+
};
|
|
44
58
|
list: {
|
|
45
59
|
type: PropType<any[]>;
|
|
46
60
|
required: true;
|
|
47
61
|
};
|
|
48
|
-
|
|
49
|
-
type: PropType<
|
|
50
|
-
|
|
62
|
+
itemClassName: {
|
|
63
|
+
type: PropType<string>;
|
|
64
|
+
default: string;
|
|
51
65
|
};
|
|
52
66
|
}>> & {
|
|
53
67
|
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
@@ -55,18 +69,24 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
55
69
|
scrollTo: (index: number) => void;
|
|
56
70
|
scaleTo: (s: number) => void;
|
|
57
71
|
state: Ref<UseVirtualListState>;
|
|
58
|
-
}, {}, {}, {}, {
|
|
72
|
+
}, {}, {}, {}, {
|
|
73
|
+
itemClassName: string;
|
|
74
|
+
}>;
|
|
59
75
|
__isFragment?: never;
|
|
60
76
|
__isTeleport?: never;
|
|
61
77
|
__isSuspense?: never;
|
|
62
78
|
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
79
|
+
option: {
|
|
80
|
+
type: PropType<UseVirtualListOptions>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
63
83
|
list: {
|
|
64
84
|
type: PropType<any[]>;
|
|
65
85
|
required: true;
|
|
66
86
|
};
|
|
67
|
-
|
|
68
|
-
type: PropType<
|
|
69
|
-
|
|
87
|
+
itemClassName: {
|
|
88
|
+
type: PropType<string>;
|
|
89
|
+
default: string;
|
|
70
90
|
};
|
|
71
91
|
}>> & {
|
|
72
92
|
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
@@ -76,7 +96,9 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
76
96
|
state: Ref<UseVirtualListState>;
|
|
77
97
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
78
98
|
"update:state": (state: UseVirtualListState | null) => void;
|
|
79
|
-
}, string, {
|
|
99
|
+
}, string, {
|
|
100
|
+
itemClassName: string;
|
|
101
|
+
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
80
102
|
$slots: Readonly< VirtualListSlot> & VirtualListSlot;
|
|
81
103
|
})>;
|
|
82
104
|
export default KScaleVirtualList;
|