@ditari/bsui 1.0.8 → 1.0.10
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/dist/cjs/components/table/Table.cjs.js +1 -1
- package/dist/cjs/components/table/Table.d.ts +2 -4
- package/dist/cjs/components/table/index.d.ts +2 -4
- package/dist/esm/components/dic/dic.worker.esm.js +5 -10
- package/dist/esm/components/table/Table.d.ts +2 -4
- package/dist/esm/components/table/Table.esm.js +21 -23
- package/dist/esm/components/table/index.d.ts +2 -4
- package/package.json +1 -1
- package/src/components/table/Table.tsx +2 -4
- package/src/components/table/interface/table.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),S=require("ant-design-vue"),C=require("../../utils/html.cjs.js"),D=require("../theme/index.cjs.js"),K=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,required:!0,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})}}),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),S=require("ant-design-vue"),C=require("../../utils/html.cjs.js"),D=require("../theme/index.cjs.js"),K=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,required:!0,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})}}),v={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:a=>`总共 ${a} 条`},k=`${D.prefixName}-pagination`,V=n.defineComponent({name:"DTable",props:K(),emits:["update:keys"],setup(a,{emit:y,slots:w}){console.log(w);const e=n.ref(a.keys),N=n.computed(()=>a.data),T=n.computed(()=>{var t;return((t=a.config)==null?void 0:t.columns)??[]}),f=n.computed(()=>{var t;return((t=a.config)==null?void 0:t.pagination)??{}}),{tableRef:P,tableHeight:z,onPageChange:R,onRowClassName:x}=O();function O(){const{rowClassName:t,keepSelected:l,selection:h,onPageChange:g}=a.config,u=n.ref(null),o=n.ref(),s=n.ref(null),i=c=>{var p;const d=(p=u==null?void 0:u.value)==null?void 0:p.$el,j=C.useEleHeight(d.getElementsByClassName("ant-table-header")[0]);let b=0;a.config.pagination&&(b=C.useEleHeight(document.getElementsByClassName(k)[0])),o.value=c-(j+b),d.getElementsByClassName("ant-table-body")[0].style.height=o.value-10+"px",s.value=d.getElementsByClassName("ant-table-body")[0]};return n.watchEffect(()=>{a.height!==0&&n.nextTick(()=>{i(a.height)})}),{tableRef:u,tableHeight:o,onPageChange:(c,d)=>{g&&g({page:c,size:d}),s.value.scrollTop=0,(h==="S"||!l)&&(e.value=[],y("update:keys",e.value))},onRowClassName:(c,d)=>t?t(c,d):void 0}}const E=q();function q(){const{rowKey:t,config:{selection:l,getCheckboxProps:h}}=a;if(l==="N")return;const g=(o,s)=>{l==="S"?(e.value=[],e.value=s?[o[t]]:[]):e.value=s?e.value.concat(o[t]):e.value.filter(i=>i!==o[t]),y("update:keys",e.value)},u=(o,s,i)=>{const m=i.map(r=>r[t]);e.value=o?e.value.concat(m):e.value.filter(r=>!m.includes(r)),y("update:keys",e.value)};return n.watch(()=>a.keys,o=>{e.value=o}),{selectedRowKeys:e,onSelect:g,onSelectAll:u,fixed:!0,columnTitle:l==="S"?"选择":null,columnWidth:l==="S"?60:40,getCheckboxProps:h}}const H=B();function B(){return t=>{let l;const{rowKey:h,config:{click:g,dbClick:u,selection:o,getCheckboxProps:s}}=a,i=t[h],m=()=>{if(o==="N")return;e.value.some(c=>c===i)?e.value=e.value.filter(c=>c!==i):(o==="S"&&(e.value=[]),e.value.push(i)),y("update:keys",e.value)};return{onClick:()=>{if(!g)return;const r=s?s(t):null;r&&r.value===i||(clearTimeout(l),l=setTimeout(()=>{m(),g(t)},200))},onDblclick:()=>{u&&(clearTimeout(l),u(t))}}}}return()=>{var t;return n.createVNode(n.Fragment,null,[n.createVNode(S.Table,{ref:P,"row-key":a.rowKey,bordered:a.config.bordered,columns:T.value,dataSource:N.value,loading:a.loading,size:((t=a.config)==null?void 0:t.size)??"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:z.value+"px"},pagination:!1,customRow:H,rowSelection:E,rowClassName:x},{bodyCell:({column:l})=>{if(l.slot==="action")return n.createVNode(S.Space,null,{default:()=>[w.action&&w.action()]})}}),n.withDirectives(n.createVNode(S.Pagination,{class:[k],current:f.value.current,"onUpdate:current":l=>f.value.current=l,pageSize:f.value.pageSize,"onUpdate:pageSize":l=>f.value.pageSize=l,disabled:a.loading,"show-size-changer":!0,size:"default","hide-on-single-page":v.hideOnSinglePage,"show-quick-jumper":v.showQuickJumper,"default-page-size":v.defaultPageSize,"page-size-options":v.pageSizeOptions,"show-total":v.showTotal,total:f.value.total,onChange:R},null),[[n.vShow,a.config.pagination]])])}}});exports.default=V;
|
|
@@ -30,9 +30,7 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
30
30
|
type: PropType<import("./interface/table").Config>;
|
|
31
31
|
default: () => {};
|
|
32
32
|
};
|
|
33
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
-
"update:keys": (keys: []) => null;
|
|
35
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
34
|
data: {
|
|
37
35
|
type: PropType<any>;
|
|
38
36
|
required: boolean;
|
|
@@ -60,7 +58,7 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
60
58
|
default: () => {};
|
|
61
59
|
};
|
|
62
60
|
}>> & {
|
|
63
|
-
"onUpdate:keys"?: ((
|
|
61
|
+
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
64
62
|
}, {
|
|
65
63
|
height: number;
|
|
66
64
|
loading: false | undefined;
|
|
@@ -25,9 +25,7 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
25
25
|
type: import("vue").PropType<import("./interface/table").Config>;
|
|
26
26
|
default: () => {};
|
|
27
27
|
};
|
|
28
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
-
"update:keys": (keys: []) => null;
|
|
30
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
29
|
data: {
|
|
32
30
|
type: import("vue").PropType<any>;
|
|
33
31
|
required: boolean;
|
|
@@ -55,7 +53,7 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
55
53
|
default: () => {};
|
|
56
54
|
};
|
|
57
55
|
}>> & {
|
|
58
|
-
"onUpdate:keys"?: ((
|
|
56
|
+
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
59
57
|
}, {
|
|
60
58
|
height: number;
|
|
61
59
|
loading: false | undefined;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
const o =
|
|
2
|
-
"KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24oYSl7Y29uc3QgdD1hLmRhdGEubmFtZT8/IiIsZT1hLmRhdGEudmFsdWU/PyIiLG49KChKU09OLnBhcnNlKGEuZGF0YS5saXN0KT8/W10pW3RdfHxbXSkuZmlsdGVyKHM9PnMudmFsdWU9PT1lKS5tYXAocz0+cy5sYWJlbCkuam9pbigiIik7c2VsZi5wb3N0TWVzc2FnZShuKX0sITEpfSkoKTsK",
|
|
3
|
-
e =
|
|
4
|
-
typeof window < "u" &&
|
|
5
|
-
window.Blob &&
|
|
6
|
-
new Blob([atob(o)], { type: "text/javascript;charset=utf-8" });
|
|
1
|
+
const o = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24oYSl7Y29uc3QgdD1hLmRhdGEubmFtZT8/IiIsZT1hLmRhdGEudmFsdWU/PyIiLG49KChKU09OLnBhcnNlKGEuZGF0YS5saXN0KT8/W10pW3RdfHxbXSkuZmlsdGVyKHM9PnMudmFsdWU9PT1lKS5tYXAocz0+cy5sYWJlbCkuam9pbigiIik7c2VsZi5wb3N0TWVzc2FnZShuKX0sITEpfSkoKTsK", e = typeof window < "u" && window.Blob && new Blob([atob(o)], { type: "text/javascript;charset=utf-8" });
|
|
7
2
|
function t() {
|
|
8
3
|
const n = e && (window.URL || window.webkitURL).createObjectURL(e);
|
|
9
4
|
try {
|
|
10
|
-
return n
|
|
11
|
-
? new Worker(n)
|
|
12
|
-
: new Worker("data:application/javascript;base64," + o);
|
|
5
|
+
return n ? new Worker(n) : new Worker("data:application/javascript;base64," + o);
|
|
13
6
|
} finally {
|
|
14
7
|
n && (window.URL || window.webkitURL).revokeObjectURL(n);
|
|
15
8
|
}
|
|
16
9
|
}
|
|
17
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
t as default
|
|
12
|
+
};
|
|
@@ -30,9 +30,7 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
30
30
|
type: PropType<import("./interface/table").Config>;
|
|
31
31
|
default: () => {};
|
|
32
32
|
};
|
|
33
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
-
"update:keys": (keys: []) => null;
|
|
35
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
34
|
data: {
|
|
37
35
|
type: PropType<any>;
|
|
38
36
|
required: boolean;
|
|
@@ -60,7 +58,7 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
60
58
|
default: () => {};
|
|
61
59
|
};
|
|
62
60
|
}>> & {
|
|
63
|
-
"onUpdate:keys"?: ((
|
|
61
|
+
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
64
62
|
}, {
|
|
65
63
|
height: number;
|
|
66
64
|
loading: false | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, ref as y, computed as S, watchEffect as $, nextTick as A, watch as F, createVNode as
|
|
1
|
+
import { defineComponent as q, ref as y, computed as S, watchEffect as $, nextTick as A, watch as F, createVNode as w, Fragment as J, withDirectives as Q, vShow as U } from "vue";
|
|
2
2
|
import { Table as I, Space as L, Pagination as V } from "ant-design-vue";
|
|
3
3
|
import { useEleHeight as k } from "../../utils/html.esm.js";
|
|
4
4
|
import { prefixName as W } from "../theme/index.esm.js";
|
|
@@ -42,18 +42,16 @@ const X = () => ({
|
|
|
42
42
|
props: X(),
|
|
43
43
|
// emits: { "update:keys": (keys: []) => void }
|
|
44
44
|
// TODO 需要做调整
|
|
45
|
-
emits:
|
|
46
|
-
"update:keys": (a) => null
|
|
47
|
-
},
|
|
45
|
+
emits: ["update:keys"],
|
|
48
46
|
setup(a, {
|
|
49
47
|
emit: v,
|
|
50
|
-
slots:
|
|
48
|
+
slots: p
|
|
51
49
|
}) {
|
|
52
|
-
console.log(
|
|
50
|
+
console.log(p);
|
|
53
51
|
const e = y(a.keys), T = S(() => a.data), z = S(() => {
|
|
54
52
|
var t;
|
|
55
53
|
return ((t = a.config) == null ? void 0 : t.columns) ?? [];
|
|
56
|
-
}),
|
|
54
|
+
}), f = S(() => {
|
|
57
55
|
var t;
|
|
58
56
|
return ((t = a.config) == null ? void 0 : t.pagination) ?? {};
|
|
59
57
|
}), {
|
|
@@ -66,7 +64,7 @@ const X = () => ({
|
|
|
66
64
|
const {
|
|
67
65
|
rowClassName: t,
|
|
68
66
|
keepSelected: n,
|
|
69
|
-
selection:
|
|
67
|
+
selection: d,
|
|
70
68
|
onPageChange: r
|
|
71
69
|
} = a.config, i = y(null), l = y(), u = y(null), o = (s) => {
|
|
72
70
|
var C;
|
|
@@ -85,7 +83,7 @@ const X = () => ({
|
|
|
85
83
|
r && r({
|
|
86
84
|
page: s,
|
|
87
85
|
size: g
|
|
88
|
-
}), u.value.scrollTop = 0, (
|
|
86
|
+
}), u.value.scrollTop = 0, (d === "S" || !n) && (e.value = [], v("update:keys", e.value));
|
|
89
87
|
},
|
|
90
88
|
onRowClassName: (s, g) => t ? t(s, g) : void 0
|
|
91
89
|
};
|
|
@@ -96,7 +94,7 @@ const X = () => ({
|
|
|
96
94
|
rowKey: t,
|
|
97
95
|
config: {
|
|
98
96
|
selection: n,
|
|
99
|
-
getCheckboxProps:
|
|
97
|
+
getCheckboxProps: d
|
|
100
98
|
}
|
|
101
99
|
} = a;
|
|
102
100
|
if (n === "N")
|
|
@@ -116,7 +114,7 @@ const X = () => ({
|
|
|
116
114
|
fixed: !0,
|
|
117
115
|
columnTitle: n === "S" ? "选择" : null,
|
|
118
116
|
columnWidth: n === "S" ? 60 : 40,
|
|
119
|
-
getCheckboxProps:
|
|
117
|
+
getCheckboxProps: d
|
|
120
118
|
};
|
|
121
119
|
}
|
|
122
120
|
const K = j();
|
|
@@ -124,14 +122,14 @@ const X = () => ({
|
|
|
124
122
|
return (t) => {
|
|
125
123
|
let n;
|
|
126
124
|
const {
|
|
127
|
-
rowKey:
|
|
125
|
+
rowKey: d,
|
|
128
126
|
config: {
|
|
129
127
|
click: r,
|
|
130
128
|
dbClick: i,
|
|
131
129
|
selection: l,
|
|
132
130
|
getCheckboxProps: u
|
|
133
131
|
}
|
|
134
|
-
} = a, o = t[
|
|
132
|
+
} = a, o = t[d], h = () => {
|
|
135
133
|
if (l === "N")
|
|
136
134
|
return;
|
|
137
135
|
e.value.some((s) => s === o) ? e.value = e.value.filter((s) => s !== o) : (l === "S" && (e.value = []), e.value.push(o)), v("update:keys", e.value);
|
|
@@ -163,7 +161,7 @@ const X = () => ({
|
|
|
163
161
|
}
|
|
164
162
|
return () => {
|
|
165
163
|
var t;
|
|
166
|
-
return
|
|
164
|
+
return w(J, null, [w(I, {
|
|
167
165
|
ref: P,
|
|
168
166
|
"row-key": a.rowKey,
|
|
169
167
|
bordered: a.config.bordered,
|
|
@@ -185,16 +183,16 @@ const X = () => ({
|
|
|
185
183
|
column: n
|
|
186
184
|
}) => {
|
|
187
185
|
if (n.slot === "action")
|
|
188
|
-
return
|
|
189
|
-
default: () => [
|
|
186
|
+
return w(L, null, {
|
|
187
|
+
default: () => [p.action && p.action()]
|
|
190
188
|
});
|
|
191
189
|
}
|
|
192
|
-
}), Q(
|
|
190
|
+
}), Q(w(V, {
|
|
193
191
|
class: [N],
|
|
194
|
-
current:
|
|
195
|
-
"onUpdate:current": (n) =>
|
|
196
|
-
pageSize:
|
|
197
|
-
"onUpdate:pageSize": (n) =>
|
|
192
|
+
current: f.value.current,
|
|
193
|
+
"onUpdate:current": (n) => f.value.current = n,
|
|
194
|
+
pageSize: f.value.pageSize,
|
|
195
|
+
"onUpdate:pageSize": (n) => f.value.pageSize = n,
|
|
198
196
|
disabled: a.loading,
|
|
199
197
|
"show-size-changer": !0,
|
|
200
198
|
size: "default",
|
|
@@ -203,9 +201,9 @@ const X = () => ({
|
|
|
203
201
|
"default-page-size": m.defaultPageSize,
|
|
204
202
|
"page-size-options": m.pageSizeOptions,
|
|
205
203
|
"show-total": m.showTotal,
|
|
206
|
-
total:
|
|
204
|
+
total: f.value.total,
|
|
207
205
|
onChange: x
|
|
208
|
-
}, null), [[U,
|
|
206
|
+
}, null), [[U, a.config.pagination]])]);
|
|
209
207
|
};
|
|
210
208
|
}
|
|
211
209
|
});
|
|
@@ -25,9 +25,7 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
25
25
|
type: import("vue").PropType<import("./interface/table").Config>;
|
|
26
26
|
default: () => {};
|
|
27
27
|
};
|
|
28
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
-
"update:keys": (keys: []) => null;
|
|
30
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
29
|
data: {
|
|
32
30
|
type: import("vue").PropType<any>;
|
|
33
31
|
required: boolean;
|
|
@@ -55,7 +53,7 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
55
53
|
default: () => {};
|
|
56
54
|
};
|
|
57
55
|
}>> & {
|
|
58
|
-
"onUpdate:keys"?: ((
|
|
56
|
+
"onUpdate:keys"?: ((...args: any[]) => any) | undefined;
|
|
59
57
|
}, {
|
|
60
58
|
height: number;
|
|
61
59
|
loading: false | undefined;
|
package/package.json
CHANGED
|
@@ -81,9 +81,7 @@ const DXTable = defineComponent({
|
|
|
81
81
|
props: tableProps(),
|
|
82
82
|
// emits: { "update:keys": (keys: []) => void }
|
|
83
83
|
// TODO 需要做调整
|
|
84
|
-
emits:
|
|
85
|
-
"update:keys": (keys: []) => null
|
|
86
|
-
},
|
|
84
|
+
emits: ["update:keys"],
|
|
87
85
|
setup(props, { emit, slots }) {
|
|
88
86
|
console.log(slots);
|
|
89
87
|
// 保存选中的唯一id
|
|
@@ -320,7 +318,7 @@ const DXTable = defineComponent({
|
|
|
320
318
|
}}
|
|
321
319
|
</Table>
|
|
322
320
|
<Pagination
|
|
323
|
-
v-show={
|
|
321
|
+
v-show={props.config.pagination}
|
|
324
322
|
class={[basePageClassName]}
|
|
325
323
|
v-model:current={paginationState.value.current}
|
|
326
324
|
v-model:pageSize={paginationState.value.pageSize}
|