@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.45
4
+
5
+ ### Patch Changes
6
+
7
+ - feat:虚拟列表增加 item 的 class
8
+
3
9
  ## 1.0.44
4
10
 
5
11
  ### Patch Changes
@@ -1,48 +1,56 @@
1
- import { defineComponent as g, toRefs as w, openBlock as r, createElementBlock as o, mergeProps as n, unref as e, createElementVNode as i, normalizeClass as B, Fragment as C, renderList as E, renderSlot as L } from "vue";
2
- import { defaultNamespace as a } from "../../../hooks/use-namespace/index.mjs";
3
- import { useVirtualList as N } from "../hooks/useVirtualList.mjs";
4
- const z = /* @__PURE__ */ g({
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: c, emit: u }) {
12
- const l = p, d = u, { list: m } = w(l), { list: f, containerProps: v, wrapperProps: x, scrollTo: _, scaleTo: $, state: k, onUpdate: P } = N(m, l.option);
13
- return c({
14
- scrollTo: _,
15
- scaleTo: $,
16
- state: k
17
- }), P((t) => d("update:state", t)), (t, T) => (r(), o(
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
- n({
20
- class: `${e(a)}-scale-virtual-list`
21
- }, e(v)),
20
+ i({
21
+ class: `${e(s)}-scale-virtual-list`
22
+ }, e($)),
22
23
  [
23
- i(
24
+ n(
24
25
  "div",
25
26
  {
26
- class: B(`${e(a)}-scale-virtual-list-container`)
27
+ class: c(`${e(s)}-scale-virtual-list-container`)
27
28
  },
28
29
  [
29
- i(
30
+ n(
30
31
  "div",
31
- n({
32
- class: `${e(a)}-scale-vittual-wrapper`
32
+ i({
33
+ class: `${e(s)}-scale-vittual-wrapper`
33
34
  }, e(x)),
34
35
  [
35
- (r(!0), o(
36
- C,
36
+ (r(!0), l(
37
+ w,
37
38
  null,
38
- E(e(f), (s) => (r(), o("div", {
39
- key: s.index
40
- }, [
41
- L(t.$slots, "default", {
42
- item: s,
43
- index: s.index
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"),r=require("../../../hooks/use-namespace/index.js"),_=require("../hooks/useVirtualList.js"),B=e.defineComponent({__name:"scale-virtual-list",props:{list:{},option:{}},emits:["update:state"],setup(l,{expose:n,emit:o}){const a=l,c=o,{list:i}=e.toRefs(a),{list:u,containerProps:p,wrapperProps:d,scrollTo:m,scaleTo:f,state:v,onUpdate:k}=_.useVirtualList(i,a.option);return n({scrollTo:m,scaleTo:f,state:v}),k(t=>c("update:state",t)),(t,g)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:`${e.unref(r.defaultNamespace)}-scale-virtual-list`},e.unref(p)),[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.defaultNamespace)}-scale-virtual-list-container`)},[e.createElementVNode("div",e.mergeProps({class:`${e.unref(r.defaultNamespace)}-scale-vittual-wrapper`},e.unref(d)),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),s=>(e.openBlock(),e.createElementBlock("div",{key:s.index},[e.renderSlot(t.$slots,"default",{item:s,index:s.index})]))),128))],16)],2)],16))}});exports.default=B;
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
+ } & {};
@@ -2,6 +2,7 @@ import { UseVirtualListItem, UseVirtualListOptions } from '../hooks/useVirtualLi
2
2
  export interface VirtualListProps {
3
3
  list: Array<any>;
4
4
  option: UseVirtualListOptions;
5
+ itemClassName?: string;
5
6
  }
6
7
  export interface VirtualListSlot {
7
8
  default: (props: {
@@ -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
- option: {
14
- type: PropType<UseVirtualListOptions>;
15
- required: true;
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
- option: {
31
- type: PropType<UseVirtualListOptions>;
32
- required: true;
38
+ itemClassName: {
39
+ type: PropType<string>;
40
+ default: string;
33
41
  };
34
42
  }>> & {
35
43
  "onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
36
- }, {}, true, {}, {}, {
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
- option: {
49
- type: PropType<UseVirtualListOptions>;
50
- required: true;
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
- option: {
68
- type: PropType<UseVirtualListOptions>;
69
- required: true;
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, {}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
99
+ }, string, {
100
+ itemClassName: string;
101
+ }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
80
102
  $slots: Readonly< VirtualListSlot> & VirtualListSlot;
81
103
  })>;
82
104
  export default KScaleVirtualList;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.44",
4
+ "version": "1.0.45",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",