@ditari/bsui 1.0.75 → 1.0.76
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"),v=require("@vueuse/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("@vueuse/core"),b=require("../../store/modules/Settings.cjs.js"),R=require("pinia"),E=require("vue-router"),N={class:"ditari-list-layout"},V={ref:"contentRef",class:"wrapper"},C={style:{height:"100%"}},z={class:"ditari-content-extra"},k={name:"DListLayout"},q=e.defineComponent({...k,emits:["refresh"],setup(x,{emit:c}){const r=e.useSlots(),_=b.useSettingsStore(),p=E.useRoute(),n=e.inject("configProvider"),{refresh:l}=R.storeToRefs(_),S=e.ref(),o=e.ref(),u=16,a=e.ref(!1),f=e.ref(0);let s;e.watch(()=>n==null?void 0:n.componentSize,t=>{i()}),g();function g(){p.name?(e.onActivated(()=>{l.value&&(l.value=!1,c("refresh")),s=d()}),e.onDeactivated(()=>{s()})):(s=d(),e.onUnmounted(()=>{s()}))}function d(){return e.watch(()=>l.value,t=>{t&&c("refresh")})}const m=e.ref(null),{height:y}=v.useElementSize(m);e.watch(()=>y.value,t=>{i()}),window.addEventListener("resize",v.useDebounceFn(()=>{i()}));function i(){a.value=!1,setTimeout(()=>{var t;f.value=(t=o==null?void 0:o.value)==null?void 0:t.offsetHeight,a.value=!0},10)}return(t,D)=>{const h=e.resolveComponent("a-card"),w=e.resolveComponent("a-space");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",V,[e.createVNode(h,{ref_key:"formRef",ref:m,bordered:!1,class:e.normalizeClass({"ditari-list-form":e.unref(r).form}),style:e.normalizeStyle({"margin-bottom":e.unref(r).form?u+"px":0})},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"form")]),_:3},8,["class","style"]),e.createVNode(h,{class:"ditari-list-table",bordered:!1},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"toolsRef",ref:S,class:"xi-tools",style:e.normalizeStyle({"margin-bottom":e.unref(r).tools?u+"px":0})},[e.createVNode(w,null,{default:e.withCtx(()=>[e.renderSlot(t.$slots,"tools")]),_:3})],4),e.createElementVNode("div",{ref_key:"tableRef",ref:o,style:{flex:"1"}},[e.withDirectives(e.createElementVNode("div",C,[e.renderSlot(t.$slots,"table",{height:f.value})],512),[[e.vShow,a.value]])],512)]),_:3})],512),e.createElementVNode("div",z,[e.renderSlot(t.$slots,"default")])])}}});exports.default=q;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useElementSize as
|
|
1
|
+
import { defineComponent as E, useSlots as H, inject as $, ref as t, watch as u, onUnmounted as B, onActivated as L, onDeactivated as N, resolveComponent as R, openBlock as T, createElementBlock as V, createElementVNode as o, createVNode as m, normalizeClass as W, unref as d, normalizeStyle as S, withCtx as h, renderSlot as l, withDirectives as j, vShow as A } from "vue";
|
|
2
|
+
import { useElementSize as F, useDebounceFn as U } from "@vueuse/core";
|
|
3
3
|
import { useSettingsStore as q } from "../../store/modules/Settings.esm.js";
|
|
4
|
-
import { storeToRefs as
|
|
5
|
-
import { useRoute as
|
|
6
|
-
const
|
|
4
|
+
import { storeToRefs as G } from "pinia";
|
|
5
|
+
import { useRoute as I } from "vue-router";
|
|
6
|
+
const J = { class: "ditari-list-layout" }, K = {
|
|
7
7
|
ref: "contentRef",
|
|
8
8
|
class: "wrapper"
|
|
9
|
-
},
|
|
9
|
+
}, M = { style: { height: "100%" } }, O = { class: "ditari-content-extra" }, P = {
|
|
10
10
|
name: "DListLayout"
|
|
11
|
-
}, se = /* @__PURE__ */
|
|
11
|
+
}, se = /* @__PURE__ */ E({
|
|
12
12
|
...P,
|
|
13
13
|
emits: ["refresh"],
|
|
14
14
|
setup(Q, { emit: _ }) {
|
|
15
|
-
const
|
|
15
|
+
const n = H(), b = q(), k = I(), a = $("configProvider"), { refresh: i } = G(b), z = t(), s = t(), v = 16, c = t(!1), p = t(0);
|
|
16
16
|
let r;
|
|
17
17
|
u(
|
|
18
|
-
() =>
|
|
18
|
+
() => a == null ? void 0 : a.componentSize,
|
|
19
19
|
(e) => {
|
|
20
20
|
f();
|
|
21
21
|
}
|
|
22
22
|
), x();
|
|
23
23
|
function x() {
|
|
24
24
|
k.name ? (L(() => {
|
|
25
|
-
i.value && (i.value = !1, _("refresh")), r =
|
|
25
|
+
i.value && (i.value = !1, _("refresh")), r = g();
|
|
26
26
|
}), N(() => {
|
|
27
27
|
r();
|
|
28
|
-
})) : (r =
|
|
28
|
+
})) : (r = g(), B(() => {
|
|
29
29
|
r();
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function g() {
|
|
33
33
|
return u(
|
|
34
34
|
() => i.value,
|
|
35
35
|
(e) => {
|
|
@@ -37,38 +37,41 @@ const I = { class: "ditari-list-layout" }, J = {
|
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const y = t(null), { height: C } = F(y);
|
|
41
41
|
u(
|
|
42
42
|
() => C.value,
|
|
43
43
|
(e) => {
|
|
44
44
|
f();
|
|
45
45
|
}
|
|
46
|
-
),
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
), window.addEventListener(
|
|
47
|
+
"resize",
|
|
48
|
+
U(() => {
|
|
49
|
+
f();
|
|
50
|
+
})
|
|
51
|
+
);
|
|
49
52
|
function f() {
|
|
50
53
|
c.value = !1, setTimeout(() => {
|
|
51
54
|
var e;
|
|
52
55
|
p.value = (e = s == null ? void 0 : s.value) == null ? void 0 : e.offsetHeight, c.value = !0;
|
|
53
|
-
},
|
|
56
|
+
}, 10);
|
|
54
57
|
}
|
|
55
58
|
return (e, X) => {
|
|
56
|
-
const
|
|
57
|
-
return T(), V("div",
|
|
58
|
-
o("div",
|
|
59
|
-
m(
|
|
59
|
+
const w = R("a-card"), D = R("a-space");
|
|
60
|
+
return T(), V("div", J, [
|
|
61
|
+
o("div", K, [
|
|
62
|
+
m(w, {
|
|
60
63
|
ref_key: "formRef",
|
|
61
|
-
ref:
|
|
64
|
+
ref: y,
|
|
62
65
|
bordered: !1,
|
|
63
|
-
class: W({ "ditari-list-form": d(
|
|
64
|
-
style: S({ "margin-bottom": d(
|
|
66
|
+
class: W({ "ditari-list-form": d(n).form }),
|
|
67
|
+
style: S({ "margin-bottom": d(n).form ? v + "px" : 0 })
|
|
65
68
|
}, {
|
|
66
69
|
default: h(() => [
|
|
67
70
|
l(e.$slots, "form")
|
|
68
71
|
]),
|
|
69
72
|
_: 3
|
|
70
73
|
}, 8, ["class", "style"]),
|
|
71
|
-
m(
|
|
74
|
+
m(w, {
|
|
72
75
|
class: "ditari-list-table",
|
|
73
76
|
bordered: !1
|
|
74
77
|
}, {
|
|
@@ -77,9 +80,9 @@ const I = { class: "ditari-list-layout" }, J = {
|
|
|
77
80
|
ref_key: "toolsRef",
|
|
78
81
|
ref: z,
|
|
79
82
|
class: "xi-tools",
|
|
80
|
-
style: S({ "margin-bottom": d(
|
|
83
|
+
style: S({ "margin-bottom": d(n).tools ? v + "px" : 0 })
|
|
81
84
|
}, [
|
|
82
|
-
m(
|
|
85
|
+
m(D, null, {
|
|
83
86
|
default: h(() => [
|
|
84
87
|
l(e.$slots, "tools")
|
|
85
88
|
]),
|
|
@@ -91,7 +94,7 @@ const I = { class: "ditari-list-layout" }, J = {
|
|
|
91
94
|
ref: s,
|
|
92
95
|
style: { flex: "1" }
|
|
93
96
|
}, [
|
|
94
|
-
j(o("div",
|
|
97
|
+
j(o("div", M, [
|
|
95
98
|
l(e.$slots, "table", { height: p.value })
|
|
96
99
|
], 512), [
|
|
97
100
|
[A, c.value]
|
|
@@ -101,7 +104,7 @@ const I = { class: "ditari-list-layout" }, J = {
|
|
|
101
104
|
_: 3
|
|
102
105
|
})
|
|
103
106
|
], 512),
|
|
104
|
-
o("div",
|
|
107
|
+
o("div", O, [
|
|
105
108
|
l(e.$slots, "default")
|
|
106
109
|
])
|
|
107
110
|
]);
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
WatchStopHandle,
|
|
10
10
|
inject
|
|
11
11
|
} from "vue";
|
|
12
|
-
import {
|
|
12
|
+
import { useDebounceFn, useElementSize } from "@vueuse/core";
|
|
13
13
|
import { useSettingsStore } from "../../store/modules/Settings";
|
|
14
14
|
import { storeToRefs } from "pinia";
|
|
15
15
|
import { useRoute } from "vue-router";
|
|
@@ -92,9 +92,12 @@ watch(
|
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
window.addEventListener(
|
|
96
|
+
"resize",
|
|
97
|
+
useDebounceFn(() => {
|
|
98
|
+
calcHeight();
|
|
99
|
+
})
|
|
100
|
+
);
|
|
98
101
|
|
|
99
102
|
// 动态计算高度
|
|
100
103
|
function calcHeight() {
|
|
@@ -102,7 +105,7 @@ function calcHeight() {
|
|
|
102
105
|
setTimeout(() => {
|
|
103
106
|
height.value = tableRef?.value?.offsetHeight;
|
|
104
107
|
show.value = true;
|
|
105
|
-
},
|
|
108
|
+
}, 10);
|
|
106
109
|
}
|
|
107
110
|
</script>
|
|
108
111
|
<script lang="ts">
|