@ditari/bsui 1.0.48 → 1.0.50

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@vueuse/core"),p=require("pinia");require("../../store/modules/Breadcrumb.cjs.js");require("../../store/modules/DataDictionary.cjs.js");require("../../store/modules/KeepAlive.cjs.js");require("../../store/modules/Menu.cjs.js");require("../../store/modules/NavTab.cjs.js");const N=require("../../store/modules/Settings.cjs.js");require("../../store/modules/User.cjs.js");const y=require("../theme/index.cjs.js"),b=require("./GridItem.cjs.js"),h=`${y.prefixName}-grid`,S=e.defineComponent({name:"DGrid",props:{className:{type:String,default:""},fill:{type:Boolean,default:!0}},setup(n,{slots:r}){var o,d;if(!r.default)return()=>e.createVNode(e.Fragment,null,[e.createTextVNode("ok")]);const l=N.useSettingsStore(),{gridValue:u}=p.storeToRefs(l),i=((o=r==null?void 0:r.default()[0])==null?void 0:o.children.length)||(r==null?void 0:r.default().length),a=e.ref([]),c=e.ref({"grid-template-columns":((d=u.value)==null?void 0:d.value)??""});return q.useResizeObserver(document.body,()=>{var f,s;l.gridMatching(),c.value["grid-template-columns"]=((f=u.value)==null?void 0:f.value)??"";const t=(s=u.value)==null?void 0:s.col,m=Math.ceil(i/t),g=n.fill?m*t-i:0;a.value=Array.from({length:g},(V,v)=>v+1)}),()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:[h,n.className],style:c.value},[r.default&&r.default(a.value),a.value.map(t=>e.createVNode(b.default,{key:t},null))])])}});exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@vueuse/core"),y=require("pinia");require("../../store/modules/Breadcrumb.cjs.js");require("../../store/modules/DataDictionary.cjs.js");require("../../store/modules/KeepAlive.cjs.js");require("../../store/modules/Menu.cjs.js");require("../../store/modules/NavTab.cjs.js");const N=require("../../store/modules/Settings.cjs.js");require("../../store/modules/User.cjs.js");const S=require("../theme/index.cjs.js"),b=require("./GridItem.cjs.js"),h=`${S.prefixName}-grid`,V=e.defineComponent({name:"DGrid",props:{className:{type:String,default:""},fill:{type:Boolean,default:!0},grid:{type:String,default:""}},setup(t,{slots:r}){var c,o;if(!r.default)return()=>e.createVNode(e.Fragment,null,[e.createTextVNode("ok")]);const i=N.useSettingsStore(),{gridValue:u}=y.storeToRefs(i),n=((c=r==null?void 0:r.default()[0])==null?void 0:c.children.length)||(r==null?void 0:r.default().length),l=e.ref([]);u.value.value=t.grid!==""?t.grid:u.value.value;const d=e.ref({"grid-template-columns":((o=u.value)==null?void 0:o.value)??""});return q.useResizeObserver(document.body,()=>{var f,g;t.grid===""&&i.gridMatching(),d.value["grid-template-columns"]=((f=u.value)==null?void 0:f.value)??"";const a=(g=u.value)==null?void 0:g.col,m=Math.ceil(n/a),v=t.fill?m*a-n:0;l.value=Array.from({length:v},(p,s)=>s+1)}),()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:[h,t.className],style:d.value},[r.default&&r.default(l.value),l.value.map(a=>e.createVNode(b.default,{key:a},null))])])}});exports.default=V;
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
7
7
  type: BooleanConstructor;
8
8
  default: boolean;
9
9
  };
10
+ grid: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
10
14
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
15
  className: {
12
16
  type: StringConstructor;
@@ -16,8 +20,13 @@ declare const _default: import("vue").DefineComponent<{
16
20
  type: BooleanConstructor;
17
21
  default: boolean;
18
22
  };
23
+ grid: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
19
27
  }>>, {
20
28
  fill: boolean;
21
29
  className: string;
30
+ grid: string;
22
31
  }>;
23
32
  export default _default;
@@ -7,6 +7,10 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
7
7
  type: BooleanConstructor;
8
8
  default: boolean;
9
9
  };
10
+ grid: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
10
14
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
15
  className: {
12
16
  type: StringConstructor;
@@ -16,8 +20,13 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
16
20
  type: BooleanConstructor;
17
21
  default: boolean;
18
22
  };
23
+ grid: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
19
27
  }>>, {
20
28
  fill: boolean;
21
29
  className: string;
30
+ grid: string;
22
31
  }>>;
23
32
  export declare const DGridItem: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("ant-design-vue"),P=require("../../utils/html.cjs.js"),M=require("../theme/index.cjs.js"),Q=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})},expandedRowKeys:{type:Object,default:()=>[]}}),b={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:n=>`总共 ${n} 条`},T=`${M.prefixName}-pagination`,I=t.defineComponent({name:"DTable",props:Q(),emits:["update:keys"],setup:function(n,{emit:p,slots:d}){const a=t.ref(n.keys||[]),z=t.computed(()=>n.data),E=t.computed(()=>{var e;return((e=n.config)==null?void 0:e.columns)??[]}),m=t.computed(()=>{var e;return((e=n.config)==null?void 0:e.pagination)??{}}),S=t.ref(n.expandedRowKeys);t.watchEffect(()=>{const{expandedRowKeys:e}=n;S.value=e});const{tableRef:K,tableRootRef:O,tableHeight:B,onPageChange:V,onRowClassName:H}=j();function j(){const{rowClassName:e,keepSelected:l,onPageChange:i}=n.config,f=n.config.selection??"N",r=t.ref(),c=t.ref(null),o=t.ref(),u=t.ref(null),g=s=>{var h,N;try{const w=(h=c==null?void 0:c.value)==null?void 0:h.$el,A=P.useEleHeight(w.getElementsByClassName("ant-table-header")[0]);let x=0;if(n.config.pagination){const J=(N=r.value)==null?void 0:N.getElementsByClassName(T)[0];x=P.useEleHeight(J)??0}o.value=s-(A+x),w.getElementsByClassName("ant-table-body")[0].style.height=o.value+"px",u.value=w.getElementsByClassName("ant-table-body")[0]}catch(w){console.warn(w)}};return t.watchEffect(()=>{n.height!==0&&t.nextTick(()=>{g(n.height)})}),{tableRef:c,tableRootRef:r,tableHeight:o,onPageChange:(s,h)=>{i&&i({page:s,size:h}),u.value.scrollTop=0,(f==="S"||!l)&&(a.value=[],p("update:keys",a.value))},onRowClassName:(s,h)=>e?e(s,h):void 0}}const q=D();function D(){const{rowKey:e,config:{getCheckboxProps:l}}=n;let i=n.config.selection??"N";const f=(o,u)=>{i==="S"?(a.value=[],a.value=u?[o[e]]:[]):a.value=u?a.value.concat(o[e]):a.value.filter(g=>g!==o[e]),p("update:keys",a.value)},r=(o,u,g)=>{const v=g.map(y=>y[e]);a.value=o?a.value.concat(v):a.value.filter(y=>!v.includes(y)),p("update:keys",a.value)};t.watch(()=>n.keys,o=>{a.value=o});const c=t.ref(void 0);return t.watchEffect(()=>{const{selection:o}=n.config;i=o,i!=="N"?c.value={selectedRowKeys:a,onSelect:f,onSelectAll:r,fixed:!0,columnTitle:i==="S"?"选择":null,columnWidth:i==="S"?60:40,getCheckboxProps:l}:c.value=void 0}),c}const F=U();function U(){return e=>{let l;const{rowKey:i,config:{click:f,dbClick:r,selection:c,getCheckboxProps:o}}=n,u=e[i],g=()=>{const v=o===void 0?!1:o(e).disabled;if(c==="N"||v)return;a.value.some(s=>s===u)?a.value=a.value.filter(s=>s!==u):(c==="S"&&(a.value=[]),a.value.push(u)),p("update:keys",a.value)};return{onClick:()=>{clearTimeout(l),l=setTimeout(()=>{g(),f&&f(e)},200)},onDblclick:()=>{clearTimeout(l),r&&r(e)}}}}const R=e=>{e.stopPropagation()},_=t.computed(()=>{const{selection:e}=n.config;return e==="N"}),k={};d.expandedRowRender&&(k.expandedRowRender=e=>t.createVNode(t.Fragment,null,[d.expandedRowRender&&d.expandedRowRender(e)]));const $=()=>t.createVNode(t.Fragment,null,[d.summary&&d.summary()]);return()=>{var e;return t.createVNode("div",{ref:O,style:{height:"100%"}},[t.createVNode(C.Table,{ref:K,"row-key":n.rowKey,bordered:n.config.bordered,columns:E.value,dataSource:z.value,loading:n.loading,size:((e=n.config)==null?void 0:e.size)??"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:B.value+"px"},expandedRowKeys:S.value,"onUpdate:expandedRowKeys":l=>S.value=l,expandRowByClick:_.value,pagination:!1,customRow:F,rowSelection:q.value,rowClassName:H},{bodyCell:({column:l,record:i})=>{if(l.slot==="action")return t.createVNode("div",{onClick:R,onDblclick:R},[t.createVNode(C.Space,null,{default:()=>[d.action&&d.action(i)]})])},...k,summary:$}),t.withDirectives(t.createVNode(C.Pagination,{class:[T],current:m.value.current,"onUpdate:current":l=>m.value.current=l,pageSize:m.value.pageSize,"onUpdate:pageSize":l=>m.value.pageSize=l,disabled:n.loading,"show-size-changer":!0,size:"default","hide-on-single-page":b.hideOnSinglePage,"show-quick-jumper":b.showQuickJumper,"default-page-size":b.defaultPageSize,"page-size-options":b.pageSizeOptions,"show-total":b.showTotal,total:m.value.total,onChange:V},null),[[t.vShow,n.config.pagination]])])}}});exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("ant-design-vue"),T=require("../../utils/html.cjs.js"),M=require("../theme/index.cjs.js"),Q=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})},expandedRowKeys:{type:Object,default:()=>[]}}),b={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:n=>`总共 ${n} 条`},P=`${M.prefixName}-pagination`,I=t.defineComponent({name:"DTable",props:Q(),emits:["update:keys"],setup:function(n,{emit:p,slots:d}){const a=t.ref(n.keys||[]),z=t.computed(()=>n.data),E=t.computed(()=>{var e;return((e=n.config)==null?void 0:e.columns)??[]}),m=t.computed(()=>{var e;return((e=n.config)==null?void 0:e.pagination)??{}}),S=t.ref(n.expandedRowKeys);t.watchEffect(()=>{const{expandedRowKeys:e}=n;S.value=e});const{tableRef:K,tableRootRef:O,tableHeight:B,onPageChange:V,onRowClassName:H}=j();function j(){const{rowClassName:e,keepSelected:l,onPageChange:i}=n.config,f=n.config.selection??"N",r=t.ref(),c=t.ref(null),o=t.ref(),u=t.ref(null),g=s=>{var h,N;try{const w=(h=c==null?void 0:c.value)==null?void 0:h.$el,A=T.useEleHeight(w.getElementsByClassName("ant-table-header")[0]);let x=0;if(n.config.pagination){const J=(N=r.value)==null?void 0:N.getElementsByClassName(P)[0];x=T.useEleHeight(J)??0}o.value=s-(A+x),w.getElementsByClassName("ant-table-body")[0].style.height=o.value+"px",u.value=w.getElementsByClassName("ant-table-body")[0]}catch(w){console.warn(w)}};return t.watchEffect(()=>{n.height!==0&&t.nextTick(()=>{setTimeout(()=>{g(n.height)},10)})}),{tableRef:c,tableRootRef:r,tableHeight:o,onPageChange:(s,h)=>{i&&i({page:s,size:h}),u.value.scrollTop=0,(f==="S"||!l)&&(a.value=[],p("update:keys",a.value))},onRowClassName:(s,h)=>e?e(s,h):void 0}}const q=D();function D(){const{rowKey:e,config:{getCheckboxProps:l}}=n;let i=n.config.selection??"N";const f=(o,u)=>{i==="S"?(a.value=[],a.value=u?[o[e]]:[]):a.value=u?a.value.concat(o[e]):a.value.filter(g=>g!==o[e]),p("update:keys",a.value)},r=(o,u,g)=>{const v=g.map(y=>y[e]);a.value=o?a.value.concat(v):a.value.filter(y=>!v.includes(y)),p("update:keys",a.value)};t.watch(()=>n.keys,o=>{a.value=o});const c=t.ref(void 0);return t.watchEffect(()=>{const{selection:o}=n.config;i=o,i!=="N"?c.value={selectedRowKeys:a,onSelect:f,onSelectAll:r,fixed:!0,columnTitle:i==="S"?"选择":null,columnWidth:i==="S"?60:40,getCheckboxProps:l}:c.value=void 0}),c}const F=U();function U(){return e=>{let l;const{rowKey:i,config:{click:f,dbClick:r,selection:c,getCheckboxProps:o}}=n,u=e[i],g=()=>{const v=o===void 0?!1:o(e).disabled;if(c==="N"||v)return;a.value.some(s=>s===u)?a.value=a.value.filter(s=>s!==u):(c==="S"&&(a.value=[]),a.value.push(u)),p("update:keys",a.value)};return{onClick:()=>{clearTimeout(l),l=setTimeout(()=>{g(),f&&f(e)},200)},onDblclick:()=>{clearTimeout(l),r&&r(e)}}}}const R=e=>{e.stopPropagation()},_=t.computed(()=>{const{selection:e}=n.config;return e==="N"}),k={};d.expandedRowRender&&(k.expandedRowRender=e=>t.createVNode(t.Fragment,null,[d.expandedRowRender&&d.expandedRowRender(e)]));const $=()=>t.createVNode(t.Fragment,null,[d.summary&&d.summary()]);return()=>{var e;return t.createVNode("div",{ref:O,style:{height:"100%"}},[t.createVNode(C.Table,{ref:K,"row-key":n.rowKey,bordered:n.config.bordered,columns:E.value,dataSource:z.value,loading:n.loading,size:((e=n.config)==null?void 0:e.size)??"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:B.value+"px"},expandedRowKeys:S.value,"onUpdate:expandedRowKeys":l=>S.value=l,expandRowByClick:_.value,pagination:!1,customRow:F,rowSelection:q.value,rowClassName:H},{bodyCell:({column:l,record:i})=>{if(l.slot==="action")return t.createVNode("div",{onClick:R,onDblclick:R},[t.createVNode(C.Space,null,{default:()=>[d.action&&d.action(i)]})])},...k,summary:$}),t.withDirectives(t.createVNode(C.Pagination,{class:[P],current:m.value.current,"onUpdate:current":l=>m.value.current=l,pageSize:m.value.pageSize,"onUpdate:pageSize":l=>m.value.pageSize=l,disabled:n.loading,"show-size-changer":!0,size:"default","hide-on-single-page":b.hideOnSinglePage,"show-quick-jumper":b.showQuickJumper,"default-page-size":b.defaultPageSize,"page-size-options":b.pageSizeOptions,"show-total":b.showTotal,total:m.value.total,onChange:V},null),[[t.vShow,n.config.pagination]])])}}});exports.default=I;
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
7
7
  type: BooleanConstructor;
8
8
  default: boolean;
9
9
  };
10
+ grid: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
10
14
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
15
  className: {
12
16
  type: StringConstructor;
@@ -16,8 +20,13 @@ declare const _default: import("vue").DefineComponent<{
16
20
  type: BooleanConstructor;
17
21
  default: boolean;
18
22
  };
23
+ grid: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
19
27
  }>>, {
20
28
  fill: boolean;
21
29
  className: string;
30
+ grid: string;
22
31
  }>;
23
32
  export default _default;
@@ -1,16 +1,16 @@
1
- import { defineComponent as y, createVNode as r, Fragment as p, createTextVNode as N, ref as g } from "vue";
1
+ import { defineComponent as s, createVNode as l, Fragment as g, createTextVNode as N, ref as p } from "vue";
2
2
  import { useResizeObserver as b } from "@vueuse/core";
3
- import { storeToRefs as C } from "pinia";
3
+ import { storeToRefs as S } from "pinia";
4
4
  import "../../store/modules/Breadcrumb.esm.js";
5
5
  import "../../store/modules/DataDictionary.esm.js";
6
6
  import "../../store/modules/KeepAlive.esm.js";
7
7
  import "../../store/modules/Menu.esm.js";
8
8
  import "../../store/modules/NavTab.esm.js";
9
- import { useSettingsStore as G } from "../../store/modules/Settings.esm.js";
9
+ import { useSettingsStore as C } from "../../store/modules/Settings.esm.js";
10
10
  import "../../store/modules/User.esm.js";
11
- import { prefixName as S } from "../theme/index.esm.js";
11
+ import { prefixName as G } from "../theme/index.esm.js";
12
12
  import x from "./GridItem.esm.js";
13
- const V = `${S}-grid`, $ = /* @__PURE__ */ y({
13
+ const V = `${G}-grid`, $ = /* @__PURE__ */ s({
14
14
  name: "DGrid",
15
15
  props: {
16
16
  // css class
@@ -22,31 +22,37 @@ const V = `${S}-grid`, $ = /* @__PURE__ */ y({
22
22
  fill: {
23
23
  type: Boolean,
24
24
  default: !0
25
+ },
26
+ grid: {
27
+ type: String,
28
+ default: ""
25
29
  }
26
30
  },
27
- setup(o, {
31
+ setup(t, {
28
32
  slots: e
29
33
  }) {
30
- var u, d;
34
+ var o, d;
31
35
  if (!e.default)
32
- return () => r(p, null, [N("ok")]);
33
- const m = G(), {
34
- gridValue: a
35
- } = C(m), n = ((u = e == null ? void 0 : e.default()[0]) == null ? void 0 : u.children.length) || (e == null ? void 0 : e.default().length), l = g([]), i = g({
36
- "grid-template-columns": ((d = a.value) == null ? void 0 : d.value) ?? ""
36
+ return () => l(g, null, [N("ok")]);
37
+ const u = C(), {
38
+ gridValue: r
39
+ } = S(u), n = ((o = e == null ? void 0 : e.default()[0]) == null ? void 0 : o.children.length) || (e == null ? void 0 : e.default().length), i = p([]);
40
+ r.value.value = t.grid !== "" ? t.grid : r.value.value;
41
+ const m = p({
42
+ "grid-template-columns": ((d = r.value) == null ? void 0 : d.value) ?? ""
37
43
  });
38
44
  return b(document.body, () => {
39
- var c, f;
40
- m.gridMatching(), i.value["grid-template-columns"] = ((c = a.value) == null ? void 0 : c.value) ?? "";
41
- const t = (f = a.value) == null ? void 0 : f.col, v = Math.ceil(n / t), s = o.fill ? v * t - n : 0;
42
- l.value = Array.from({
43
- length: s
45
+ var f, c;
46
+ t.grid === "" && u.gridMatching(), m.value["grid-template-columns"] = ((f = r.value) == null ? void 0 : f.value) ?? "";
47
+ const a = (c = r.value) == null ? void 0 : c.col, v = Math.ceil(n / a), y = t.fill ? v * a - n : 0;
48
+ i.value = Array.from({
49
+ length: y
44
50
  }, (k, h) => h + 1);
45
- }), () => r(p, null, [r("div", {
46
- class: [V, o.className],
47
- style: i.value
48
- }, [e.default && e.default(l.value), l.value.map((t) => r(x, {
49
- key: t
51
+ }), () => l(g, null, [l("div", {
52
+ class: [V, t.className],
53
+ style: m.value
54
+ }, [e.default && e.default(i.value), i.value.map((a) => l(x, {
55
+ key: a
50
56
  }, null))])]);
51
57
  }
52
58
  });
@@ -7,6 +7,10 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
7
7
  type: BooleanConstructor;
8
8
  default: boolean;
9
9
  };
10
+ grid: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
10
14
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
15
  className: {
12
16
  type: StringConstructor;
@@ -16,8 +20,13 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
16
20
  type: BooleanConstructor;
17
21
  default: boolean;
18
22
  };
23
+ grid: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
19
27
  }>>, {
20
28
  fill: boolean;
21
29
  className: string;
30
+ grid: string;
22
31
  }>>;
23
32
  export declare const DGridItem: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
@@ -40,7 +40,7 @@ const ae = () => ({
40
40
  showQuickJumper: !0,
41
41
  showLessItems: !0,
42
42
  showTotal: (t) => `总共 ${t} 条`
43
- }, E = `${ne}-pagination`, ue = /* @__PURE__ */ X({
43
+ }, E = `${ne}-pagination`, ce = /* @__PURE__ */ X({
44
44
  name: "DTable",
45
45
  props: ae(),
46
46
  // emits: { "update:keys": (keys: []) => void }
@@ -75,35 +75,37 @@ const ae = () => ({
75
75
  rowClassName: e,
76
76
  keepSelected: o,
77
77
  onPageChange: l
78
- } = t.config, m = t.config.selection ?? "N", d = r(), i = r(null), a = r(), c = r(null), g = (u) => {
79
- var h, P;
78
+ } = t.config, m = t.config.selection ?? "N", d = r(), i = r(null), a = r(), u = r(null), g = (c) => {
79
+ var h, T;
80
80
  try {
81
81
  const p = (h = i == null ? void 0 : i.value) == null ? void 0 : h.$el, V = K(p.getElementsByClassName("ant-table-header")[0]);
82
- let T = 0;
82
+ let P = 0;
83
83
  if (t.config.pagination) {
84
- const W = (P = d.value) == null ? void 0 : P.getElementsByClassName(E)[0];
85
- T = K(W) ?? 0;
84
+ const W = (T = d.value) == null ? void 0 : T.getElementsByClassName(E)[0];
85
+ P = K(W) ?? 0;
86
86
  }
87
- a.value = u - (V + T), p.getElementsByClassName("ant-table-body")[0].style.height = a.value + "px", c.value = p.getElementsByClassName("ant-table-body")[0];
87
+ a.value = c - (V + P), p.getElementsByClassName("ant-table-body")[0].style.height = a.value + "px", u.value = p.getElementsByClassName("ant-table-body")[0];
88
88
  } catch (p) {
89
89
  console.warn(p);
90
90
  }
91
91
  };
92
92
  return k(() => {
93
93
  t.height !== 0 && _(() => {
94
- g(t.height);
94
+ setTimeout(() => {
95
+ g(t.height);
96
+ }, 10);
95
97
  });
96
98
  }), {
97
99
  tableRef: i,
98
100
  tableRootRef: d,
99
101
  tableHeight: a,
100
- onPageChange: (u, h) => {
102
+ onPageChange: (c, h) => {
101
103
  l && l({
102
- page: u,
104
+ page: c,
103
105
  size: h
104
- }), c.value.scrollTop = 0, (m === "S" || !o) && (n.value = [], S("update:keys", n.value));
106
+ }), u.value.scrollTop = 0, (m === "S" || !o) && (n.value = [], S("update:keys", n.value));
105
107
  },
106
- onRowClassName: (u, h) => e ? e(u, h) : void 0
108
+ onRowClassName: (c, h) => e ? e(c, h) : void 0
107
109
  };
108
110
  }
109
111
  const A = F();
@@ -115,9 +117,9 @@ const ae = () => ({
115
117
  }
116
118
  } = t;
117
119
  let l = t.config.selection ?? "N";
118
- const m = (a, c) => {
119
- l === "S" ? (n.value = [], n.value = c ? [a[e]] : []) : n.value = c ? n.value.concat(a[e]) : n.value.filter((g) => g !== a[e]), S("update:keys", n.value);
120
- }, d = (a, c, g) => {
120
+ const m = (a, u) => {
121
+ l === "S" ? (n.value = [], n.value = u ? [a[e]] : []) : n.value = u ? n.value.concat(a[e]) : n.value.filter((g) => g !== a[e]), S("update:keys", n.value);
122
+ }, d = (a, u, g) => {
121
123
  const y = g.map((w) => w[e]);
122
124
  n.value = a ? n.value.concat(y) : n.value.filter((w) => !y.includes(w)), S("update:keys", n.value);
123
125
  };
@@ -152,11 +154,11 @@ const ae = () => ({
152
154
  selection: i,
153
155
  getCheckboxProps: a
154
156
  }
155
- } = t, c = e[l], g = () => {
157
+ } = t, u = e[l], g = () => {
156
158
  const y = a === void 0 ? !1 : a(e).disabled;
157
159
  if (i === "N" || y)
158
160
  return;
159
- n.value.some((u) => u === c) ? n.value = n.value.filter((u) => u !== c) : (i === "S" && (n.value = []), n.value.push(c)), S("update:keys", n.value);
161
+ n.value.some((c) => c === u) ? n.value = n.value.filter((c) => c !== u) : (i === "S" && (n.value = []), n.value.push(u)), S("update:keys", n.value);
160
162
  };
161
163
  return {
162
164
  onClick: () => {
@@ -254,5 +256,5 @@ const ae = () => ({
254
256
  }
255
257
  });
256
258
  export {
257
- ue as default
259
+ ce as default
258
260
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditari/bsui",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "files": [
5
5
  "dist/**",
6
6
  "src"
@@ -22,6 +22,10 @@ export default defineComponent({
22
22
  fill: {
23
23
  type: Boolean,
24
24
  default: true
25
+ },
26
+ grid: {
27
+ type: String,
28
+ default: ""
25
29
  }
26
30
  },
27
31
  setup(props, { slots }: any) {
@@ -40,6 +44,9 @@ export default defineComponent({
40
44
  // 要填充空白的网格数
41
45
  const fillGridItems = ref<number[]>([]);
42
46
 
47
+ gridValue.value.value =
48
+ props.grid !== "" ? props.grid : gridValue.value.value;
49
+
43
50
  // 网格列
44
51
  const baseStyle = ref<any>({
45
52
  "grid-template-columns": gridValue.value?.value ?? ""
@@ -48,8 +55,10 @@ export default defineComponent({
48
55
  //监听屏幕尺寸变化,一般只有人工拉大屏幕尺寸才会触发(默认执行一次)
49
56
  useResizeObserver(document.body, () => {
50
57
  //TODO 检测浏览器是否被缩放
51
- //
52
- store.gridMatching();
58
+ // TODO 使用store 会存在所有的配置均有一个对象bug
59
+ if (props.grid === "") {
60
+ store.gridMatching();
61
+ }
53
62
  baseStyle.value["grid-template-columns"] = gridValue.value?.value ?? "";
54
63
  // 获取当前设备匹配到显示的列数配置
55
64
  const colCount = gridValue.value?.col;
@@ -164,7 +164,10 @@ const DXTable = defineComponent({
164
164
  if (props.height !== 0) {
165
165
  nextTick(() => {
166
166
  // 必须在组件挂载成功后 执行计算高度 否则无法正确获取元素的高度
167
- playHeight(props.height);
167
+ setTimeout(() => {
168
+ // 如果表格头 有多行的清空下,获取到的头部高度不对,需要延迟执行获取高度方法
169
+ playHeight(props.height);
170
+ }, 10);
168
171
  });
169
172
  }
170
173
  });