@lingshugroup/web-plus 1.5.0 → 1.5.1
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/lib/packages/ls-components/components/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +58 -54
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _=Object.defineProperty;var n=(r,a)=>_(r,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),D=,/* empty css */h=,/* empty css */s=,/* empty css */x=,/* empty css */M=,/* empty css */P=,/* empty css */$={key:1,class:"content-wrap"},E={class:"dialog-footer"},L=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(h.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(h.lsEmitNames,["update:modelValue"]),setup(r,{expose:a,emit:k}){const l=r,i=k,S=e.useSlots(),t=e.useModel(r,"modelValue"),v=D.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3,alignCenter:!0}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&l.openScroll&&g()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},l.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},l.btnConfirmConfig));function y(){i("onCancel")}n(y,"handleClose");function B(){t.value=!1}n(B,"handleBtnClose");function q(){i("onConfirm")}n(q,"handleConfirm");async function g(){await e.nextTick();const o=l.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return n(g,"updateHeight"),a({updateHeight:g}),(o,p)=>{const w=x.ElScrollbar,C=e.resolveComponent("LSButton"),V=M.ElDialog,b=P.vLoading;return e.openBlock(),e.createBlock(V,e.mergeProps({ref_key:"lsDialogRef",ref:d,class:e.unref(v),modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=N=>t.value=N)},e.unref(s.default)(e.unref(u),o.$attrs),{"show-close":!o.loading,onClose:y}),e.createSlots({header:e.withCtx(()=>[e.renderSlot(o.$slots,"header")]),default:e.withCtx(()=>[o.openScroll?e.withDirectives((e.openBlock(),e.createBlock(w,e.mergeProps({key:0},e.unref(s.default)(e.unref(u),o.$attrs),{"max-height":e.unref(c)}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["max-height"])),[[b,o.contentLoading]]):(e.openBlock(),e.createElementBlock("div",$,[e.renderSlot(o.$slots,"default")]))]),_:2},[o.hasFooter?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",E,[e.unref(S).footer?e.renderSlot(o.$slots,"footer",{key:0}):e.createCommentVNode("",!0),o.hasCancelBtn?(e.openBlock(),e.createBlock(C,e.mergeProps({key:1},e.unref(f),{disabled:o.loading,onClick:B}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f).txt),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.createVNode(C,e.mergeProps(e.unref(m),{loading:o.loading,disabled:o.loading,onClick:q}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m).txt),1)]),_:1},16,["loading","disabled"])])]),key:"0"}:void 0]),1040,["class","modelValue","show-close"])}}});exports.default=L;
|
|
@@ -1,100 +1,104 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var l = (a, c) => O(a, "name", { value: c, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { lsDialogProp as
|
|
8
|
+
import { defineComponent as R, mergeModels as V, useSlots as T, useModel as q, ref as f, watch as z, computed as b, nextTick as U, resolveComponent as j, openBlock as r, createBlock as u, mergeProps as i, unref as o, createSlots as x, withCtx as n, renderSlot as d, withDirectives as G, createElementBlock as J, createElementVNode as K, createCommentVNode as w, createTextVNode as D, toDisplayString as _, createVNode as Q } from "vue";
|
|
9
|
+
import { useNamespace as W } from "../../_hooks/useNamespace/index.js";
|
|
10
|
+
import { lsDialogProp as X, lsEmitNames as Y } from "../types/index.js";
|
|
11
11
|
import m from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
12
|
-
import { ElScrollbar as
|
|
13
|
-
import { ElDialog as
|
|
14
|
-
import { vLoading as
|
|
15
|
-
const
|
|
12
|
+
import { ElScrollbar as Z } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/scrollbar/index/index.js";
|
|
13
|
+
import { ElDialog as ee } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/dialog/index/index.js";
|
|
14
|
+
import { vLoading as oe } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/loading/src/directive/index.js";
|
|
15
|
+
const te = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "content-wrap"
|
|
18
|
-
},
|
|
18
|
+
}, ne = { class: "dialog-footer" }, ke = /* @__PURE__ */ R({
|
|
19
19
|
name: "LSDialog",
|
|
20
20
|
inheritAttrs: !1,
|
|
21
21
|
__name: "Index",
|
|
22
|
-
props: /* @__PURE__ */
|
|
22
|
+
props: /* @__PURE__ */ V(X, {
|
|
23
23
|
modelValue: {
|
|
24
24
|
type: Boolean
|
|
25
25
|
},
|
|
26
26
|
modelModifiers: {}
|
|
27
27
|
}),
|
|
28
|
-
emits: /* @__PURE__ */
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
28
|
+
emits: /* @__PURE__ */ V(Y, ["update:modelValue"]),
|
|
29
|
+
setup(a, { expose: c, emit: E }) {
|
|
30
|
+
const s = a, p = E, N = T(), t = q(a, "modelValue"), $ = W("dialog").b(), g = f(), h = f({
|
|
31
31
|
width: "50%",
|
|
32
32
|
closeOnClickModal: !1,
|
|
33
33
|
closeOnPressEscape: !1,
|
|
34
34
|
zIndex: 2e3,
|
|
35
35
|
alignCenter: !0
|
|
36
36
|
}), C = f(0);
|
|
37
|
-
|
|
37
|
+
z(
|
|
38
38
|
() => t == null ? void 0 : t.value,
|
|
39
39
|
(e) => {
|
|
40
|
-
e &&
|
|
40
|
+
e && s.openScroll && v();
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
immediate: !0,
|
|
44
44
|
deep: !0
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
const k =
|
|
47
|
+
const k = b(() => m(
|
|
48
48
|
{
|
|
49
49
|
txt: "取消"
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
)), y =
|
|
51
|
+
s.btnCancelConfig
|
|
52
|
+
)), y = b(() => m(
|
|
53
53
|
{
|
|
54
54
|
type: "primary",
|
|
55
55
|
txt: "确认"
|
|
56
56
|
},
|
|
57
|
-
|
|
57
|
+
s.btnConfirmConfig
|
|
58
58
|
));
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function L() {
|
|
60
|
+
p("onCancel");
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
l(L, "handleClose");
|
|
63
63
|
function M() {
|
|
64
|
+
t.value = !1;
|
|
65
|
+
}
|
|
66
|
+
l(M, "handleBtnClose");
|
|
67
|
+
function I() {
|
|
64
68
|
p("onConfirm");
|
|
65
69
|
}
|
|
66
|
-
|
|
67
|
-
async function
|
|
68
|
-
await
|
|
69
|
-
const e =
|
|
70
|
+
l(I, "handleConfirm");
|
|
71
|
+
async function v() {
|
|
72
|
+
await U();
|
|
73
|
+
const e = s.hasFooter ? 108 : 60;
|
|
70
74
|
C.value = parseInt(getComputedStyle(g.value.querySelector(".el-dialog")).height) - e;
|
|
71
75
|
}
|
|
72
|
-
return
|
|
73
|
-
updateHeight:
|
|
74
|
-
}), (e,
|
|
75
|
-
const
|
|
76
|
-
return r(), u(
|
|
76
|
+
return l(v, "updateHeight"), c({
|
|
77
|
+
updateHeight: v
|
|
78
|
+
}), (e, S) => {
|
|
79
|
+
const P = Z, B = j("LSButton"), A = ee, F = oe;
|
|
80
|
+
return r(), u(A, i({
|
|
77
81
|
ref_key: "lsDialogRef",
|
|
78
82
|
ref: g,
|
|
79
|
-
class: o(
|
|
83
|
+
class: o($),
|
|
80
84
|
modelValue: t.value,
|
|
81
|
-
"onUpdate:modelValue":
|
|
85
|
+
"onUpdate:modelValue": S[0] || (S[0] = (H) => t.value = H)
|
|
82
86
|
}, o(m)(o(h), e.$attrs), {
|
|
83
87
|
"show-close": !e.loading,
|
|
84
|
-
onClose:
|
|
85
|
-
}),
|
|
86
|
-
header:
|
|
88
|
+
onClose: L
|
|
89
|
+
}), x({
|
|
90
|
+
header: n(() => [
|
|
87
91
|
d(e.$slots, "header")
|
|
88
92
|
]),
|
|
89
|
-
default:
|
|
90
|
-
e.openScroll ?
|
|
91
|
-
default:
|
|
93
|
+
default: n(() => [
|
|
94
|
+
e.openScroll ? G((r(), u(P, i({ key: 0 }, o(m)(o(h), e.$attrs), { "max-height": o(C) }), {
|
|
95
|
+
default: n(() => [
|
|
92
96
|
d(e.$slots, "default")
|
|
93
97
|
]),
|
|
94
98
|
_: 3
|
|
95
99
|
}, 16, ["max-height"])), [
|
|
96
|
-
[
|
|
97
|
-
]) : (r(),
|
|
100
|
+
[F, e.contentLoading]
|
|
101
|
+
]) : (r(), J("div", te, [
|
|
98
102
|
d(e.$slots, "default")
|
|
99
103
|
]))
|
|
100
104
|
]),
|
|
@@ -102,25 +106,25 @@ const oe = {
|
|
|
102
106
|
}, [
|
|
103
107
|
e.hasFooter ? {
|
|
104
108
|
name: "footer",
|
|
105
|
-
fn:
|
|
106
|
-
|
|
107
|
-
o(
|
|
109
|
+
fn: n(() => [
|
|
110
|
+
K("div", ne, [
|
|
111
|
+
o(N).footer ? d(e.$slots, "footer", { key: 0 }) : w("", !0),
|
|
108
112
|
e.hasCancelBtn ? (r(), u(B, i({ key: 1 }, o(k), {
|
|
109
113
|
disabled: e.loading,
|
|
110
|
-
onClick:
|
|
114
|
+
onClick: M
|
|
111
115
|
}), {
|
|
112
|
-
default:
|
|
113
|
-
_(
|
|
116
|
+
default: n(() => [
|
|
117
|
+
D(_(o(k).txt), 1)
|
|
114
118
|
]),
|
|
115
119
|
_: 1
|
|
116
|
-
}, 16, ["disabled"])) :
|
|
117
|
-
|
|
120
|
+
}, 16, ["disabled"])) : w("", !0),
|
|
121
|
+
Q(B, i(o(y), {
|
|
118
122
|
loading: e.loading,
|
|
119
123
|
disabled: e.loading,
|
|
120
|
-
onClick:
|
|
124
|
+
onClick: I
|
|
121
125
|
}), {
|
|
122
|
-
default:
|
|
123
|
-
_(
|
|
126
|
+
default: n(() => [
|
|
127
|
+
D(_(o(y).txt), 1)
|
|
124
128
|
]),
|
|
125
129
|
_: 1
|
|
126
130
|
}, 16, ["loading", "disabled"])
|
|
@@ -133,5 +137,5 @@ const oe = {
|
|
|
133
137
|
}
|
|
134
138
|
});
|
|
135
139
|
export {
|
|
136
|
-
|
|
140
|
+
ke as default
|
|
137
141
|
};
|
|
Binary file
|
|
Binary file
|