ling-yun-custom-components 0.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.
Files changed (123) hide show
  1. package/es/BatchImport.mjs +208 -0
  2. package/es/BuildComponents.mjs +190 -0
  3. package/es/CustomDialog.mjs +7 -0
  4. package/es/CustomDropdown.mjs +145 -0
  5. package/es/CustomPagination.mjs +7 -0
  6. package/es/CustomSelect.mjs +7 -0
  7. package/es/CustomTab.mjs +33 -0
  8. package/es/CustomTitle.mjs +7 -0
  9. package/es/FileList.mjs +7 -0
  10. package/es/GradientButton.mjs +120 -0
  11. package/es/IconEmpty.mjs +7 -0
  12. package/es/IconRenderer.mjs +42 -0
  13. package/es/IconSelect.mjs +120 -0
  14. package/es/PaginationTable.mjs +407 -0
  15. package/es/SearchBar.mjs +7 -0
  16. package/es/TreeSelect.mjs +406 -0
  17. package/es/TreeShowSelect.mjs +82 -0
  18. package/es/UpdatePasswordDialog.mjs +119 -0
  19. package/es/UploadFile.mjs +7 -0
  20. package/es/assets/BuildComponents.css +1 -0
  21. package/es/assets/CustomDropdown.css +1 -0
  22. package/es/assets/CustomTab.css +1 -0
  23. package/es/assets/GradientButton.css +1 -0
  24. package/es/assets/IconSelect.css +1 -0
  25. package/es/assets/PaginationTable.css +1 -0
  26. package/es/assets/TreeSelect.css +1 -0
  27. package/es/assets/TreeShowSelect.css +1 -0
  28. package/es/assets/UpdatePasswordDialog.css +1 -0
  29. package/es/assets/layout.css +0 -0
  30. package/es/assets/layout2.css +1 -0
  31. package/es/assets/layout3.css +1 -0
  32. package/es/assets/layout4.css +1 -0
  33. package/es/assets/layout5.css +1 -0
  34. package/es/assets/layout6.css +1 -0
  35. package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
  36. package/es/chunks/global.DVwnOczb.js +7828 -0
  37. package/es/chunks/index.D4Kbv-m1.js +8991 -0
  38. package/es/chunks/index.DfOANPhX.js +1729 -0
  39. package/es/chunks/index.DlooXR0t.js +9576 -0
  40. package/es/chunks/index.bCzIhWFw.js +7 -0
  41. package/es/chunks/layout.1y3OJ-ea.js +230 -0
  42. package/es/chunks/layout.2Mabaug0.js +121 -0
  43. package/es/chunks/layout.6MxjcpGc.js +584 -0
  44. package/es/chunks/layout.BJE8rMzK.js +230 -0
  45. package/es/chunks/layout.BKJPyxR8.js +39 -0
  46. package/es/chunks/layout.C0UEMbnF.js +98 -0
  47. package/es/chunks/layout.CTQtuC78.js +584 -0
  48. package/es/chunks/layout.CUOtHOHG.js +66 -0
  49. package/es/chunks/layout.CiNI5oQK.js +149 -0
  50. package/es/chunks/layout.CnANFnM1.js +584 -0
  51. package/es/chunks/layout.CtWHo87D.js +121 -0
  52. package/es/chunks/layout.Day1LJyl.js +234 -0
  53. package/es/chunks/layout.DeAFov0o.js +234 -0
  54. package/es/chunks/layout.Dvw3u-s5.js +234 -0
  55. package/es/chunks/layout.LCKaV7EX.js +230 -0
  56. package/es/chunks/layout.ZxPdKhRp.js +149 -0
  57. package/es/chunks/layout._A_rHZM7.js +149 -0
  58. package/es/chunks/layout.f58eO4Hr.js +98 -0
  59. package/es/chunks/layout.t3qD0LTW.js +121 -0
  60. package/es/chunks/layout.ypvwQzq5.js +98 -0
  61. package/es/index.mjs +81 -0
  62. package/lib/BatchImport.js +1 -0
  63. package/lib/BuildComponents.js +1 -0
  64. package/lib/CustomDialog.js +1 -0
  65. package/lib/CustomDropdown.js +1 -0
  66. package/lib/CustomPagination.js +1 -0
  67. package/lib/CustomSelect.js +1 -0
  68. package/lib/CustomTab.js +1 -0
  69. package/lib/CustomTitle.js +1 -0
  70. package/lib/FileList.js +1 -0
  71. package/lib/GradientButton.js +1 -0
  72. package/lib/IconEmpty.js +1 -0
  73. package/lib/IconRenderer.js +1 -0
  74. package/lib/IconSelect.js +1 -0
  75. package/lib/PaginationTable.js +1 -0
  76. package/lib/SearchBar.js +1 -0
  77. package/lib/TreeSelect.js +1 -0
  78. package/lib/TreeShowSelect.js +1 -0
  79. package/lib/UpdatePasswordDialog.js +1 -0
  80. package/lib/UploadFile.js +1 -0
  81. package/lib/assets/BuildComponents.css +1 -0
  82. package/lib/assets/CustomDropdown.css +1 -0
  83. package/lib/assets/CustomTab.css +1 -0
  84. package/lib/assets/GradientButton.css +1 -0
  85. package/lib/assets/IconSelect.css +1 -0
  86. package/lib/assets/PaginationTable.css +1 -0
  87. package/lib/assets/TreeSelect.css +1 -0
  88. package/lib/assets/TreeShowSelect.css +1 -0
  89. package/lib/assets/UpdatePasswordDialog.css +1 -0
  90. package/lib/assets/layout.css +0 -0
  91. package/lib/assets/layout2.css +1 -0
  92. package/lib/assets/layout3.css +1 -0
  93. package/lib/assets/layout4.css +1 -0
  94. package/lib/assets/layout5.css +1 -0
  95. package/lib/assets/layout6.css +1 -0
  96. package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
  97. package/lib/chunks/global.Cv8u--Cy.js +1 -0
  98. package/lib/chunks/index.Bixsw9fA.js +23 -0
  99. package/lib/chunks/index.CkihWzK6.js +1 -0
  100. package/lib/chunks/index.CrvqvcN9.js +23 -0
  101. package/lib/chunks/index.DJKAT9lI.js +1 -0
  102. package/lib/chunks/layout.-yZzrp74.js +1 -0
  103. package/lib/chunks/layout.2PAIPzYY.js +1 -0
  104. package/lib/chunks/layout.5iOiFlVu.js +1 -0
  105. package/lib/chunks/layout.B-T_NE6r.js +1 -0
  106. package/lib/chunks/layout.BBNd1hLQ.js +1 -0
  107. package/lib/chunks/layout.BNJsxQ2g.js +1 -0
  108. package/lib/chunks/layout.BSF3ruxz.js +1 -0
  109. package/lib/chunks/layout.BXdjRFbn.js +1 -0
  110. package/lib/chunks/layout.BhL14Rqh.js +1 -0
  111. package/lib/chunks/layout.BmQYiD_b.js +1 -0
  112. package/lib/chunks/layout.CDg3sCTi.js +1 -0
  113. package/lib/chunks/layout.CeVldGUL.js +1 -0
  114. package/lib/chunks/layout.CjJiAY0w.js +1 -0
  115. package/lib/chunks/layout.CoSBrO12.js +1 -0
  116. package/lib/chunks/layout.CwA4IJ1g.js +1 -0
  117. package/lib/chunks/layout.DDTIwGYp.js +1 -0
  118. package/lib/chunks/layout.DOS2ezSW.js +1 -0
  119. package/lib/chunks/layout.D_TxPvRy.js +1 -0
  120. package/lib/chunks/layout.DfiLurg1.js +1 -0
  121. package/lib/chunks/layout.gqpUcAHO.js +1 -0
  122. package/lib/index.js +1 -0
  123. package/package.json +205 -0
@@ -0,0 +1,234 @@
1
+ import { useAttrs as I, computed as d, onMounted as L, createBlock as y, openBlock as u, unref as n, mergeProps as U, withCtx as c, createElementBlock as g, renderSlot as m, createElementVNode as v, createCommentVNode as A, createTextVNode as h, toDisplayString as C, Fragment as R, createVNode as E } from "vue";
2
+ import { ElDialog as q, ElButton as k, ElIcon as z } from "element-plus";
3
+ import { j as H, k as J } from "./index.DfOANPhX.js";
4
+ import { emitsMap as e } from "ling-yun-methods";
5
+ import { _ as K } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
+ import '../assets/layout2.css';const t = {
7
+ DEFAULT: "default",
8
+ PAGE: "page"
9
+ }, Q = {
10
+ key: 0,
11
+ class: "flex justify-center w-full"
12
+ }, W = {
13
+ class: "dialog-content flex flex-col",
14
+ style: { width: "60%" }
15
+ }, X = {
16
+ key: 0,
17
+ class: "title-name flex items-center"
18
+ }, Y = { class: "dialog-footer" }, Z = {
19
+ key: 0,
20
+ class: "flex justify-center items-center w-full"
21
+ }, ee = {
22
+ class: "flex justify-center items-center",
23
+ style: { width: "60%" }
24
+ }, oe = { class: "flex justify-end items-center w-full" }, te = /* @__PURE__ */ Object.assign({
25
+ name: "CustomDialog"
26
+ }, {
27
+ __name: "layout",
28
+ props: {
29
+ // 绑定值
30
+ modelValue: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ // 对话框宽度
35
+ width: {
36
+ type: [String, Number],
37
+ default: "50%"
38
+ },
39
+ // 是否可以通过点击 modal 关闭对话框
40
+ closeOnClickModal: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ // 是否可以通过按下 ESC 关闭对话框
45
+ closeOnPressEscape: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ // 是否在对话框出现时将 body 滚动锁定
50
+ lockScroll: {
51
+ type: Boolean,
52
+ default: !0
53
+ },
54
+ // 关闭图标
55
+ closeIcon: {
56
+ type: Object,
57
+ default: H
58
+ },
59
+ // 按钮配置对象
60
+ buttons: {
61
+ type: Object,
62
+ default: () => ({})
63
+ },
64
+ appendToBody: {
65
+ type: Boolean,
66
+ default: !0
67
+ },
68
+ // 弹窗覆盖的模式 default|page
69
+ dialogMode: {
70
+ type: String,
71
+ default: t.DEFAULT
72
+ },
73
+ // route模式下标题值
74
+ titleName: {
75
+ type: String,
76
+ default: "默认标题"
77
+ }
78
+ },
79
+ emits: [
80
+ e.updateModelValue,
81
+ e.open,
82
+ e.opened,
83
+ e.close,
84
+ e.closed,
85
+ e.openAutoFocus,
86
+ e.closeAutoFocus,
87
+ e.cancel,
88
+ e.confirm
89
+ ],
90
+ setup(r, { emit: b }) {
91
+ const M = {
92
+ showCancel: !0,
93
+ showConfirm: !0,
94
+ cancelText: "取消",
95
+ confirmText: "确认",
96
+ onCancel: null,
97
+ onConfirm: null
98
+ }, o = r, p = I(), s = b, P = d(() => o.dialogMode === t.PAGE ? {
99
+ marginLeft: "250px",
100
+ borderRadius: "24px",
101
+ boxShadow: "none"
102
+ } : {}), _ = d(() => o.dialogMode === t.PAGE ? !1 : p.modal ? p.modal : !0), B = d(() => o.dialogMode === t.PAGE ? !0 : p.modalPenetrable ? p.modalPenetrable : !1), V = d(() => o.dialogMode === t.PAGE ? "calc(100% - 250px - 12px)" : o.width), F = d(() => o.dialogMode === t.PAGE ? "66px" : o.top || "15vh"), i = d({
103
+ get: () => o.modelValue,
104
+ set: (a) => {
105
+ s(e.updateModelValue, a);
106
+ }
107
+ }), l = d(() => ({
108
+ ...M,
109
+ ...o.buttons
110
+ })), G = d(() => {
111
+ const { modelValue: a, ...f } = o;
112
+ return f;
113
+ }), O = () => {
114
+ s(e.open);
115
+ }, T = () => {
116
+ s(e.opened);
117
+ }, S = () => {
118
+ s(e.close);
119
+ }, j = () => {
120
+ s(e.closed);
121
+ }, N = () => {
122
+ s(e.openAutoFocus);
123
+ }, D = () => {
124
+ s(e.closeAutoFocus);
125
+ }, $ = () => {
126
+ l.value.onCancel ? l.value.onCancel() : i.value = !1, s(e.cancel);
127
+ }, w = async () => {
128
+ if (l.value.onConfirm)
129
+ try {
130
+ await l.value.onConfirm() !== !1 && (i.value = !1);
131
+ } catch {
132
+ }
133
+ else
134
+ i.value = !1;
135
+ s(e.confirm);
136
+ };
137
+ return L(() => {
138
+ o.dialogMode === t.PAGE && (document.querySelector(".el-overlay-dialog").style.overflow = "hidden");
139
+ }), (a, f) => (u(), y(n(q), U({
140
+ ref: "dialogRef",
141
+ modelValue: i.value,
142
+ "onUpdate:modelValue": f[1] || (f[1] = (x) => i.value = x)
143
+ }, G.value, {
144
+ width: V.value,
145
+ top: F.value,
146
+ style: P.value,
147
+ modal: _.value,
148
+ "modal-penetrable": B.value,
149
+ onOpen: O,
150
+ onOpened: T,
151
+ onClose: S,
152
+ onClosed: j,
153
+ onOpenAutoFocus: N,
154
+ onCloseAutoFocus: D,
155
+ "append-to-body": r.appendToBody,
156
+ class: {
157
+ "custom-dialog-page": r.dialogMode === n(t).PAGE
158
+ }
159
+ }), {
160
+ header: c(() => [
161
+ m(a.$slots, "header", {}, void 0, !0)
162
+ ]),
163
+ title: c(() => [
164
+ r.dialogMode === n(t).PAGE ? (u(), g("div", X, [
165
+ E(n(z), {
166
+ size: 20,
167
+ color: "var(--text-color-1)",
168
+ class: "mg-r-6 pointer",
169
+ onClick: f[0] || (f[0] = (x) => i.value = !1)
170
+ }, {
171
+ default: c(() => [
172
+ E(n(J))
173
+ ]),
174
+ _: 1
175
+ }),
176
+ h(" " + C(r.titleName), 1)
177
+ ])) : m(a.$slots, "title", { key: 1 }, void 0, !0)
178
+ ]),
179
+ footer: c(() => [
180
+ m(a.$slots, "footer", {}, () => [
181
+ v("div", Y, [
182
+ r.dialogMode === n(t).PAGE ? (u(), g("div", Z, [
183
+ v("div", ee, [
184
+ v("div", oe, [
185
+ l.value.showConfirm ? (u(), y(n(k), {
186
+ key: 0,
187
+ type: "primary",
188
+ onClick: w
189
+ }, {
190
+ default: c(() => [
191
+ h(C(l.value.confirmText), 1)
192
+ ]),
193
+ _: 1
194
+ })) : A("", !0)
195
+ ])
196
+ ])
197
+ ])) : (u(), g(R, { key: 1 }, [
198
+ l.value.showCancel ? (u(), y(n(k), {
199
+ key: 0,
200
+ onClick: $
201
+ }, {
202
+ default: c(() => [
203
+ h(C(l.value.cancelText), 1)
204
+ ]),
205
+ _: 1
206
+ })) : A("", !0),
207
+ l.value.showConfirm ? (u(), y(n(k), {
208
+ key: 1,
209
+ type: "primary",
210
+ onClick: w
211
+ }, {
212
+ default: c(() => [
213
+ h(C(l.value.confirmText), 1)
214
+ ]),
215
+ _: 1
216
+ })) : A("", !0)
217
+ ], 64))
218
+ ])
219
+ ], !0)
220
+ ]),
221
+ default: c(() => [
222
+ r.dialogMode === n(t).PAGE ? (u(), g("div", Q, [
223
+ v("div", W, [
224
+ m(a.$slots, "default", {}, void 0, !0)
225
+ ])
226
+ ])) : m(a.$slots, "default", { key: 1 }, void 0, !0)
227
+ ]),
228
+ _: 3
229
+ }, 16, ["modelValue", "width", "top", "style", "modal", "modal-penetrable", "append-to-body", "class"]));
230
+ }
231
+ }), ue = /* @__PURE__ */ K(te, [["__scopeId", "data-v-425ba25d"]]);
232
+ export {
233
+ ue as C
234
+ };
@@ -0,0 +1,234 @@
1
+ import { useAttrs as I, computed as d, onMounted as L, createBlock as y, openBlock as u, unref as n, mergeProps as U, withCtx as c, createElementBlock as g, renderSlot as m, createElementVNode as v, createCommentVNode as A, createTextVNode as h, toDisplayString as C, Fragment as R, createVNode as x } from "vue";
2
+ import { ElDialog as q, ElButton as b, ElIcon as z } from "element-plus";
3
+ import { j as H, k as J } from "./index.DfOANPhX.js";
4
+ import { b as e } from "./index.DlooXR0t.js";
5
+ import { _ as K } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
+ import '../assets/layout2.css';const t = {
7
+ DEFAULT: "default",
8
+ PAGE: "page"
9
+ }, Q = {
10
+ key: 0,
11
+ class: "flex justify-center w-full"
12
+ }, W = {
13
+ class: "dialog-content flex flex-col",
14
+ style: { width: "60%" }
15
+ }, X = {
16
+ key: 0,
17
+ class: "title-name flex items-center"
18
+ }, Y = { class: "dialog-footer" }, Z = {
19
+ key: 0,
20
+ class: "flex justify-center items-center w-full"
21
+ }, ee = {
22
+ class: "flex justify-center items-center",
23
+ style: { width: "60%" }
24
+ }, oe = { class: "flex justify-end items-center w-full" }, te = /* @__PURE__ */ Object.assign({
25
+ name: "CustomDialog"
26
+ }, {
27
+ __name: "layout",
28
+ props: {
29
+ // 绑定值
30
+ modelValue: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ // 对话框宽度
35
+ width: {
36
+ type: [String, Number],
37
+ default: "50%"
38
+ },
39
+ // 是否可以通过点击 modal 关闭对话框
40
+ closeOnClickModal: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ // 是否可以通过按下 ESC 关闭对话框
45
+ closeOnPressEscape: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ // 是否在对话框出现时将 body 滚动锁定
50
+ lockScroll: {
51
+ type: Boolean,
52
+ default: !0
53
+ },
54
+ // 关闭图标
55
+ closeIcon: {
56
+ type: Object,
57
+ default: H
58
+ },
59
+ // 按钮配置对象
60
+ buttons: {
61
+ type: Object,
62
+ default: () => ({})
63
+ },
64
+ appendToBody: {
65
+ type: Boolean,
66
+ default: !0
67
+ },
68
+ // 弹窗覆盖的模式 default|page
69
+ dialogMode: {
70
+ type: String,
71
+ default: t.DEFAULT
72
+ },
73
+ // route模式下标题值
74
+ titleName: {
75
+ type: String,
76
+ default: "默认标题"
77
+ }
78
+ },
79
+ emits: [
80
+ e.updateModelValue,
81
+ e.open,
82
+ e.opened,
83
+ e.close,
84
+ e.closed,
85
+ e.openAutoFocus,
86
+ e.closeAutoFocus,
87
+ e.cancel,
88
+ e.confirm
89
+ ],
90
+ setup(r, { emit: E }) {
91
+ const P = {
92
+ showCancel: !0,
93
+ showConfirm: !0,
94
+ cancelText: "取消",
95
+ confirmText: "确认",
96
+ onCancel: null,
97
+ onConfirm: null
98
+ }, o = r, p = I(), s = E, _ = d(() => o.dialogMode === t.PAGE ? {
99
+ marginLeft: "250px",
100
+ borderRadius: "24px",
101
+ boxShadow: "none"
102
+ } : {}), M = d(() => o.dialogMode === t.PAGE ? !1 : p.modal ? p.modal : !0), B = d(() => o.dialogMode === t.PAGE ? !0 : p.modalPenetrable ? p.modalPenetrable : !1), V = d(() => o.dialogMode === t.PAGE ? "calc(100% - 250px - 12px)" : o.width), F = d(() => o.dialogMode === t.PAGE ? "66px" : o.top || "15vh"), i = d({
103
+ get: () => o.modelValue,
104
+ set: (a) => {
105
+ s(e.updateModelValue, a);
106
+ }
107
+ }), l = d(() => ({
108
+ ...P,
109
+ ...o.buttons
110
+ })), G = d(() => {
111
+ const { modelValue: a, ...f } = o;
112
+ return f;
113
+ }), O = () => {
114
+ s(e.open);
115
+ }, T = () => {
116
+ s(e.opened);
117
+ }, S = () => {
118
+ s(e.close);
119
+ }, j = () => {
120
+ s(e.closed);
121
+ }, N = () => {
122
+ s(e.openAutoFocus);
123
+ }, D = () => {
124
+ s(e.closeAutoFocus);
125
+ }, $ = () => {
126
+ l.value.onCancel ? l.value.onCancel() : i.value = !1, s(e.cancel);
127
+ }, k = async () => {
128
+ if (l.value.onConfirm)
129
+ try {
130
+ await l.value.onConfirm() !== !1 && (i.value = !1);
131
+ } catch {
132
+ }
133
+ else
134
+ i.value = !1;
135
+ s(e.confirm);
136
+ };
137
+ return L(() => {
138
+ o.dialogMode === t.PAGE && (document.querySelector(".el-overlay-dialog").style.overflow = "hidden");
139
+ }), (a, f) => (u(), y(n(q), U({
140
+ ref: "dialogRef",
141
+ modelValue: i.value,
142
+ "onUpdate:modelValue": f[1] || (f[1] = (w) => i.value = w)
143
+ }, G.value, {
144
+ width: V.value,
145
+ top: F.value,
146
+ style: _.value,
147
+ modal: M.value,
148
+ "modal-penetrable": B.value,
149
+ onOpen: O,
150
+ onOpened: T,
151
+ onClose: S,
152
+ onClosed: j,
153
+ onOpenAutoFocus: N,
154
+ onCloseAutoFocus: D,
155
+ "append-to-body": r.appendToBody,
156
+ class: {
157
+ "custom-dialog-page": r.dialogMode === n(t).PAGE
158
+ }
159
+ }), {
160
+ header: c(() => [
161
+ m(a.$slots, "header", {}, void 0, !0)
162
+ ]),
163
+ title: c(() => [
164
+ r.dialogMode === n(t).PAGE ? (u(), g("div", X, [
165
+ x(n(z), {
166
+ size: 20,
167
+ color: "var(--text-color-1)",
168
+ class: "mg-r-6 pointer",
169
+ onClick: f[0] || (f[0] = (w) => i.value = !1)
170
+ }, {
171
+ default: c(() => [
172
+ x(n(J))
173
+ ]),
174
+ _: 1
175
+ }),
176
+ h(" " + C(r.titleName), 1)
177
+ ])) : m(a.$slots, "title", { key: 1 }, void 0, !0)
178
+ ]),
179
+ footer: c(() => [
180
+ m(a.$slots, "footer", {}, () => [
181
+ v("div", Y, [
182
+ r.dialogMode === n(t).PAGE ? (u(), g("div", Z, [
183
+ v("div", ee, [
184
+ v("div", oe, [
185
+ l.value.showConfirm ? (u(), y(n(b), {
186
+ key: 0,
187
+ type: "primary",
188
+ onClick: k
189
+ }, {
190
+ default: c(() => [
191
+ h(C(l.value.confirmText), 1)
192
+ ]),
193
+ _: 1
194
+ })) : A("", !0)
195
+ ])
196
+ ])
197
+ ])) : (u(), g(R, { key: 1 }, [
198
+ l.value.showCancel ? (u(), y(n(b), {
199
+ key: 0,
200
+ onClick: $
201
+ }, {
202
+ default: c(() => [
203
+ h(C(l.value.cancelText), 1)
204
+ ]),
205
+ _: 1
206
+ })) : A("", !0),
207
+ l.value.showConfirm ? (u(), y(n(b), {
208
+ key: 1,
209
+ type: "primary",
210
+ onClick: k
211
+ }, {
212
+ default: c(() => [
213
+ h(C(l.value.confirmText), 1)
214
+ ]),
215
+ _: 1
216
+ })) : A("", !0)
217
+ ], 64))
218
+ ])
219
+ ], !0)
220
+ ]),
221
+ default: c(() => [
222
+ r.dialogMode === n(t).PAGE ? (u(), g("div", Q, [
223
+ v("div", W, [
224
+ m(a.$slots, "default", {}, void 0, !0)
225
+ ])
226
+ ])) : m(a.$slots, "default", { key: 1 }, void 0, !0)
227
+ ]),
228
+ _: 3
229
+ }, 16, ["modelValue", "width", "top", "style", "modal", "modal-penetrable", "append-to-body", "class"]));
230
+ }
231
+ }), ue = /* @__PURE__ */ K(te, [["__scopeId", "data-v-425ba25d"]]);
232
+ export {
233
+ ue as C
234
+ };
@@ -0,0 +1,234 @@
1
+ import { useAttrs as I, computed as d, onMounted as L, createBlock as y, openBlock as u, unref as n, mergeProps as U, withCtx as c, createElementBlock as g, renderSlot as m, createElementVNode as v, createCommentVNode as A, createTextVNode as h, toDisplayString as C, Fragment as R, createVNode as x } from "vue";
2
+ import { ElDialog as q, ElButton as b, ElIcon as z } from "element-plus";
3
+ import { j as H, k as J } from "./index.DfOANPhX.js";
4
+ import { b as e } from "./index.D4Kbv-m1.js";
5
+ import { _ as K } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
+ import '../assets/layout2.css';const t = {
7
+ DEFAULT: "default",
8
+ PAGE: "page"
9
+ }, Q = {
10
+ key: 0,
11
+ class: "flex justify-center w-full"
12
+ }, W = {
13
+ class: "dialog-content flex flex-col",
14
+ style: { width: "60%" }
15
+ }, X = {
16
+ key: 0,
17
+ class: "title-name flex items-center"
18
+ }, Y = { class: "dialog-footer" }, Z = {
19
+ key: 0,
20
+ class: "flex justify-center items-center w-full"
21
+ }, ee = {
22
+ class: "flex justify-center items-center",
23
+ style: { width: "60%" }
24
+ }, oe = { class: "flex justify-end items-center w-full" }, te = /* @__PURE__ */ Object.assign({
25
+ name: "CustomDialog"
26
+ }, {
27
+ __name: "layout",
28
+ props: {
29
+ // 绑定值
30
+ modelValue: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ // 对话框宽度
35
+ width: {
36
+ type: [String, Number],
37
+ default: "50%"
38
+ },
39
+ // 是否可以通过点击 modal 关闭对话框
40
+ closeOnClickModal: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ // 是否可以通过按下 ESC 关闭对话框
45
+ closeOnPressEscape: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ // 是否在对话框出现时将 body 滚动锁定
50
+ lockScroll: {
51
+ type: Boolean,
52
+ default: !0
53
+ },
54
+ // 关闭图标
55
+ closeIcon: {
56
+ type: Object,
57
+ default: H
58
+ },
59
+ // 按钮配置对象
60
+ buttons: {
61
+ type: Object,
62
+ default: () => ({})
63
+ },
64
+ appendToBody: {
65
+ type: Boolean,
66
+ default: !0
67
+ },
68
+ // 弹窗覆盖的模式 default|page
69
+ dialogMode: {
70
+ type: String,
71
+ default: t.DEFAULT
72
+ },
73
+ // route模式下标题值
74
+ titleName: {
75
+ type: String,
76
+ default: "默认标题"
77
+ }
78
+ },
79
+ emits: [
80
+ e.updateModelValue,
81
+ e.open,
82
+ e.opened,
83
+ e.close,
84
+ e.closed,
85
+ e.openAutoFocus,
86
+ e.closeAutoFocus,
87
+ e.cancel,
88
+ e.confirm
89
+ ],
90
+ setup(r, { emit: E }) {
91
+ const P = {
92
+ showCancel: !0,
93
+ showConfirm: !0,
94
+ cancelText: "取消",
95
+ confirmText: "确认",
96
+ onCancel: null,
97
+ onConfirm: null
98
+ }, o = r, p = I(), s = E, _ = d(() => o.dialogMode === t.PAGE ? {
99
+ marginLeft: "250px",
100
+ borderRadius: "24px",
101
+ boxShadow: "none"
102
+ } : {}), M = d(() => o.dialogMode === t.PAGE ? !1 : p.modal ? p.modal : !0), B = d(() => o.dialogMode === t.PAGE ? !0 : p.modalPenetrable ? p.modalPenetrable : !1), V = d(() => o.dialogMode === t.PAGE ? "calc(100% - 250px - 12px)" : o.width), F = d(() => o.dialogMode === t.PAGE ? "66px" : o.top || "15vh"), i = d({
103
+ get: () => o.modelValue,
104
+ set: (a) => {
105
+ s(e.updateModelValue, a);
106
+ }
107
+ }), l = d(() => ({
108
+ ...P,
109
+ ...o.buttons
110
+ })), G = d(() => {
111
+ const { modelValue: a, ...f } = o;
112
+ return f;
113
+ }), O = () => {
114
+ s(e.open);
115
+ }, T = () => {
116
+ s(e.opened);
117
+ }, S = () => {
118
+ s(e.close);
119
+ }, j = () => {
120
+ s(e.closed);
121
+ }, N = () => {
122
+ s(e.openAutoFocus);
123
+ }, D = () => {
124
+ s(e.closeAutoFocus);
125
+ }, $ = () => {
126
+ l.value.onCancel ? l.value.onCancel() : i.value = !1, s(e.cancel);
127
+ }, k = async () => {
128
+ if (l.value.onConfirm)
129
+ try {
130
+ await l.value.onConfirm() !== !1 && (i.value = !1);
131
+ } catch {
132
+ }
133
+ else
134
+ i.value = !1;
135
+ s(e.confirm);
136
+ };
137
+ return L(() => {
138
+ o.dialogMode === t.PAGE && (document.querySelector(".el-overlay-dialog").style.overflow = "hidden");
139
+ }), (a, f) => (u(), y(n(q), U({
140
+ ref: "dialogRef",
141
+ modelValue: i.value,
142
+ "onUpdate:modelValue": f[1] || (f[1] = (w) => i.value = w)
143
+ }, G.value, {
144
+ width: V.value,
145
+ top: F.value,
146
+ style: _.value,
147
+ modal: M.value,
148
+ "modal-penetrable": B.value,
149
+ onOpen: O,
150
+ onOpened: T,
151
+ onClose: S,
152
+ onClosed: j,
153
+ onOpenAutoFocus: N,
154
+ onCloseAutoFocus: D,
155
+ "append-to-body": r.appendToBody,
156
+ class: {
157
+ "custom-dialog-page": r.dialogMode === n(t).PAGE
158
+ }
159
+ }), {
160
+ header: c(() => [
161
+ m(a.$slots, "header", {}, void 0, !0)
162
+ ]),
163
+ title: c(() => [
164
+ r.dialogMode === n(t).PAGE ? (u(), g("div", X, [
165
+ x(n(z), {
166
+ size: 20,
167
+ color: "var(--text-color-1)",
168
+ class: "mg-r-6 pointer",
169
+ onClick: f[0] || (f[0] = (w) => i.value = !1)
170
+ }, {
171
+ default: c(() => [
172
+ x(n(J))
173
+ ]),
174
+ _: 1
175
+ }),
176
+ h(" " + C(r.titleName), 1)
177
+ ])) : m(a.$slots, "title", { key: 1 }, void 0, !0)
178
+ ]),
179
+ footer: c(() => [
180
+ m(a.$slots, "footer", {}, () => [
181
+ v("div", Y, [
182
+ r.dialogMode === n(t).PAGE ? (u(), g("div", Z, [
183
+ v("div", ee, [
184
+ v("div", oe, [
185
+ l.value.showConfirm ? (u(), y(n(b), {
186
+ key: 0,
187
+ type: "primary",
188
+ onClick: k
189
+ }, {
190
+ default: c(() => [
191
+ h(C(l.value.confirmText), 1)
192
+ ]),
193
+ _: 1
194
+ })) : A("", !0)
195
+ ])
196
+ ])
197
+ ])) : (u(), g(R, { key: 1 }, [
198
+ l.value.showCancel ? (u(), y(n(b), {
199
+ key: 0,
200
+ onClick: $
201
+ }, {
202
+ default: c(() => [
203
+ h(C(l.value.cancelText), 1)
204
+ ]),
205
+ _: 1
206
+ })) : A("", !0),
207
+ l.value.showConfirm ? (u(), y(n(b), {
208
+ key: 1,
209
+ type: "primary",
210
+ onClick: k
211
+ }, {
212
+ default: c(() => [
213
+ h(C(l.value.confirmText), 1)
214
+ ]),
215
+ _: 1
216
+ })) : A("", !0)
217
+ ], 64))
218
+ ])
219
+ ], !0)
220
+ ]),
221
+ default: c(() => [
222
+ r.dialogMode === n(t).PAGE ? (u(), g("div", Q, [
223
+ v("div", W, [
224
+ m(a.$slots, "default", {}, void 0, !0)
225
+ ])
226
+ ])) : m(a.$slots, "default", { key: 1 }, void 0, !0)
227
+ ]),
228
+ _: 3
229
+ }, 16, ["modelValue", "width", "top", "style", "modal", "modal-penetrable", "append-to-body", "class"]));
230
+ }
231
+ }), ue = /* @__PURE__ */ K(te, [["__scopeId", "data-v-425ba25d"]]);
232
+ export {
233
+ ue as C
234
+ };