sakura-ui-plus 1.0.0
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/es/index.js +1852 -0
- package/dist/lib/index.js +1852 -0
- package/dist/style.css +4573 -0
- package/dist/types/components/cell/cell-group.vue.d.ts +21 -0
- package/dist/types/components/cell/cell.vue.d.ts +18 -0
- package/dist/types/components/cell/constant.d.ts +3 -0
- package/dist/types/components/cell/props.d.ts +9 -0
- package/dist/types/components/container/container.vue.d.ts +20 -0
- package/dist/types/components/container/props.d.ts +3 -0
- package/dist/types/components/count-down/count-down.vue.d.ts +10 -0
- package/dist/types/components/count-down/props.d.ts +7 -0
- package/dist/types/components/dialog/dialog.vue.d.ts +58 -0
- package/dist/types/components/dialog/props.d.ts +35 -0
- package/dist/types/components/drawer/drawer.vue.d.ts +58 -0
- package/dist/types/components/drawer/props.d.ts +34 -0
- package/dist/types/components/file/item.vue.d.ts +24 -0
- package/dist/types/components/file/list.vue.d.ts +8 -0
- package/dist/types/components/file/props.d.ts +17 -0
- package/dist/types/components/filter/constant.d.ts +3 -0
- package/dist/types/components/filter/filter-group.vue.d.ts +26 -0
- package/dist/types/components/filter/filter-item.vue.d.ts +22 -0
- package/dist/types/components/filter/props.d.ts +13 -0
- package/dist/types/components/index.d.ts +2092 -0
- package/dist/types/components/pagination/pagination.vue.d.ts +23 -0
- package/dist/types/components/pagination/props.d.ts +16 -0
- package/dist/types/components/register-components.d.ts +11 -0
- package/dist/types/components/search-input/props.d.ts +10 -0
- package/dist/types/components/search-input/search-input.vue.d.ts +19 -0
- package/dist/types/components/select/props.d.ts +31 -0
- package/dist/types/components/select/select.vue.d.ts +2958 -0
- package/dist/types/components/show-modal/install.d.ts +5 -0
- package/dist/types/components/show-modal/props.d.ts +19 -0
- package/dist/types/components/show-modal/show-modal.vue.d.ts +14 -0
- package/dist/types/components/show-modal/utils.d.ts +6 -0
- package/dist/types/components/status/props.d.ts +7 -0
- package/dist/types/components/status/status.vue.d.ts +20 -0
- package/dist/types/components/tabs/props.d.ts +7 -0
- package/dist/types/components/tabs/tabs.vue.d.ts +30 -0
- package/dist/types/components/tooltip-text/props.d.ts +9 -0
- package/dist/types/components/tooltip-text/tooltip-text.vue.d.ts +11 -0
- package/dist/types/constants/event.d.ts +61 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +7 -0
- package/dist/types/hooks/use-callback-trigger/index.d.ts +10 -0
- package/dist/types/hooks/use-loading/index.d.ts +10 -0
- package/dist/types/hooks/use-message/index.d.ts +4 -0
- package/dist/types/hooks/use-message-box/index.d.ts +8 -0
- package/dist/types/hooks/use-namespace/index.d.ts +26 -0
- package/dist/types/hooks/use-notification/index.d.ts +8 -0
- package/dist/types/hooks/use-notification/type.d.ts +65 -0
- package/dist/types/hooks/use-show-modal/index.d.ts +2 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/types/index.d.ts +28 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/package.json +79 -0
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,1852 @@
|
|
|
1
|
+
import { unref, getCurrentInstance, defineComponent, mergeModels, computed, useModel, openBlock, createBlock, withCtx, createElementVNode, mergeProps, resolveDynamicComponent, createSlots, renderSlot, createElementBlock, Fragment, renderList, inject, normalizeClass, toDisplayString, createTextVNode, provide, reactive, toRef, createCommentVNode, createVNode, nextTick, withKeys, useTemplateRef, ref, onMounted, onUnmounted, normalizeStyle, render } from "vue";
|
|
2
|
+
import { addUnit, isEmpty, extend, computedTextsSize, FILE_TYPE, isFunction, isString, keysOf } from "sakura-utils";
|
|
3
|
+
import { ElLoading, ElMessage, ElMessageBox, ElNotification, ElSelectV2, ElSelect, ElConfigProvider, ElOption, ElPagination, CHANGE_EVENT, ElInput, ElButton, ElTabs, ElTabPane, ElTooltip, ElDialog, ElIcon, ElScrollbar, ElDrawer } from "element-plus";
|
|
4
|
+
import { TinyColor } from "@ctrl/tinycolor";
|
|
5
|
+
import { useThrottleFn } from "@vueuse/core";
|
|
6
|
+
import { Close } from "@element-plus/icons-vue";
|
|
7
|
+
import DOMPurify from "dompurify";
|
|
8
|
+
const defaultNamespace = "sakura";
|
|
9
|
+
const statePrefix = "is-";
|
|
10
|
+
const _bem = (namespace, block, blockSuffix, element, modifier) => {
|
|
11
|
+
let className = namespace + `-${block}`;
|
|
12
|
+
if (blockSuffix) {
|
|
13
|
+
className += "-" + blockSuffix;
|
|
14
|
+
}
|
|
15
|
+
if (element) {
|
|
16
|
+
className += "__" + element;
|
|
17
|
+
}
|
|
18
|
+
if (modifier) {
|
|
19
|
+
className += "--" + modifier;
|
|
20
|
+
}
|
|
21
|
+
return className;
|
|
22
|
+
};
|
|
23
|
+
const useNamespace = (block, namespaceOverrides) => {
|
|
24
|
+
const namespace = unref(namespaceOverrides) ?? defaultNamespace ?? block;
|
|
25
|
+
const b = (blockSuffix = "") => {
|
|
26
|
+
return _bem(namespace, block, blockSuffix, "", "");
|
|
27
|
+
};
|
|
28
|
+
const e = (element = "") => {
|
|
29
|
+
return element ? _bem(namespace, block, "", element, "") : "";
|
|
30
|
+
};
|
|
31
|
+
const m = (modifier = "") => {
|
|
32
|
+
return modifier ? _bem(namespace, block, "", "", modifier) : "";
|
|
33
|
+
};
|
|
34
|
+
const be = (blockSuffix = "", element = "") => {
|
|
35
|
+
return blockSuffix && element ? _bem(namespace, block, blockSuffix, element, "") : "";
|
|
36
|
+
};
|
|
37
|
+
const em = (element = "", modifier = "") => {
|
|
38
|
+
return element && modifier ? _bem(namespace, block, "", element, modifier) : "";
|
|
39
|
+
};
|
|
40
|
+
const bm = (blockSuffix = "", modifier = "") => {
|
|
41
|
+
return blockSuffix && modifier ? _bem(namespace, block, blockSuffix, "", modifier) : "";
|
|
42
|
+
};
|
|
43
|
+
const bem = (blockSuffix = "", element = "", modifier = "") => {
|
|
44
|
+
return blockSuffix && element && modifier ? _bem(namespace, block, blockSuffix, element, modifier) : "";
|
|
45
|
+
};
|
|
46
|
+
const is = (name, ...args) => {
|
|
47
|
+
const state = args.length ? args[0] : true;
|
|
48
|
+
return state && name ? statePrefix + name : "";
|
|
49
|
+
};
|
|
50
|
+
const cssVar = (object) => {
|
|
51
|
+
const style = {};
|
|
52
|
+
for (const k in object) {
|
|
53
|
+
if (object[k]) {
|
|
54
|
+
style[`--${namespace}-${k} `] = object[k];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return style;
|
|
58
|
+
};
|
|
59
|
+
const cssBlockVar = (block2, object) => {
|
|
60
|
+
const style = {};
|
|
61
|
+
for (const k in object) {
|
|
62
|
+
if (object[k]) {
|
|
63
|
+
style[`--${namespace}-${block2}-${k}`] = object[k];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return style;
|
|
67
|
+
};
|
|
68
|
+
const cssVarName = (name) => `${namespace}-${name}`;
|
|
69
|
+
const cssBlockVarName = (block2, name) => `${namespace}-${block2}-${name}`;
|
|
70
|
+
const cssVarNameValue = (name) => `var(--${cssVarName(name)})`;
|
|
71
|
+
const cssBlockVarNameValue = (block2, name) => `var(--${cssBlockVarName(block2, name)})`;
|
|
72
|
+
return {
|
|
73
|
+
b,
|
|
74
|
+
e,
|
|
75
|
+
m,
|
|
76
|
+
be,
|
|
77
|
+
em,
|
|
78
|
+
bm,
|
|
79
|
+
bem,
|
|
80
|
+
is,
|
|
81
|
+
cssVar,
|
|
82
|
+
cssBlockVar,
|
|
83
|
+
cssVarName,
|
|
84
|
+
cssBlockVarName,
|
|
85
|
+
cssVarNameValue,
|
|
86
|
+
cssBlockVarNameValue
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const useCallbackTrigger = () => {
|
|
90
|
+
const callbackSet = /* @__PURE__ */ new Set();
|
|
91
|
+
const track = (fn) => {
|
|
92
|
+
fn && callbackSet.add(fn);
|
|
93
|
+
};
|
|
94
|
+
const clear = () => {
|
|
95
|
+
callbackSet.clear();
|
|
96
|
+
};
|
|
97
|
+
const trigger = (...args) => {
|
|
98
|
+
callbackSet.forEach((fn) => fn(...args));
|
|
99
|
+
};
|
|
100
|
+
const _delete = (fn) => {
|
|
101
|
+
callbackSet.delete(fn);
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
callbackSet,
|
|
105
|
+
track,
|
|
106
|
+
trigger,
|
|
107
|
+
clear,
|
|
108
|
+
delete: _delete
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const useShowModal = () => {
|
|
112
|
+
const proxy = getCurrentInstance();
|
|
113
|
+
return proxy == null ? void 0 : proxy.appContext.config.globalProperties.$showModal;
|
|
114
|
+
};
|
|
115
|
+
const useLoading = (background = "rgba(255, 255, 255, 0.7)", lock = true) => {
|
|
116
|
+
let loading;
|
|
117
|
+
const show = (text = "加载中...", params) => {
|
|
118
|
+
loading = ElLoading.service({
|
|
119
|
+
lock,
|
|
120
|
+
text,
|
|
121
|
+
background,
|
|
122
|
+
...params
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
const hide = () => {
|
|
126
|
+
loading.close();
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
show,
|
|
130
|
+
hide
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
const useMessage = () => {
|
|
134
|
+
return ElMessage;
|
|
135
|
+
};
|
|
136
|
+
const useMessageBox = (_closeOnClickModal = false, _closeOnPressEscape = false) => {
|
|
137
|
+
const context = getCurrentInstance();
|
|
138
|
+
return (message, title = "提示", showCancelButton = false, params) => {
|
|
139
|
+
return new Promise((resolve) => {
|
|
140
|
+
const {
|
|
141
|
+
confirmButtonText = "确认",
|
|
142
|
+
cancelButtonText = "取消",
|
|
143
|
+
closeOnClickModal = _closeOnClickModal,
|
|
144
|
+
closeOnPressEscape = _closeOnPressEscape,
|
|
145
|
+
...others
|
|
146
|
+
} = params ?? {};
|
|
147
|
+
ElMessageBox({
|
|
148
|
+
showCancelButton,
|
|
149
|
+
confirmButtonText,
|
|
150
|
+
cancelButtonText,
|
|
151
|
+
message,
|
|
152
|
+
title,
|
|
153
|
+
closeOnClickModal,
|
|
154
|
+
closeOnPressEscape,
|
|
155
|
+
...others
|
|
156
|
+
}, context == null ? void 0 : context.appContext).then(() => resolve(true)).catch(() => resolve(false));
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
const getCustomClass = (message, title, type) => {
|
|
161
|
+
let customClass = type ?? "";
|
|
162
|
+
if (title) {
|
|
163
|
+
customClass += " is-has-title";
|
|
164
|
+
}
|
|
165
|
+
if (message && !title) {
|
|
166
|
+
customClass += " is-not-title";
|
|
167
|
+
}
|
|
168
|
+
return customClass;
|
|
169
|
+
};
|
|
170
|
+
const useNotification = (duration = 8e3, showClose = true, position = "top-right") => {
|
|
171
|
+
const notification = (message, title, options) => {
|
|
172
|
+
const { type, ...others } = options ?? {};
|
|
173
|
+
const _type = type ?? "";
|
|
174
|
+
const _duration = (options == null ? void 0 : options.duration) ?? duration;
|
|
175
|
+
const _position = (options == null ? void 0 : options.position) ?? position;
|
|
176
|
+
const params = {
|
|
177
|
+
type: _type === "tips" ? "warning" : _type,
|
|
178
|
+
showClose,
|
|
179
|
+
message,
|
|
180
|
+
title: title ?? "",
|
|
181
|
+
duration: _duration,
|
|
182
|
+
position: _position,
|
|
183
|
+
customClass: getCustomClass(message, title, _type),
|
|
184
|
+
...others
|
|
185
|
+
};
|
|
186
|
+
return ElNotification(params);
|
|
187
|
+
};
|
|
188
|
+
notification.success = (message, title, options) => {
|
|
189
|
+
return notification(message, title ?? "", {
|
|
190
|
+
showClose,
|
|
191
|
+
type: "success",
|
|
192
|
+
...options
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
notification.info = (message, title, options) => {
|
|
196
|
+
return notification(message, title ?? "", {
|
|
197
|
+
showClose,
|
|
198
|
+
type: "info",
|
|
199
|
+
...options
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
notification.warning = (message, title, options) => {
|
|
203
|
+
return notification(message, title ?? "", {
|
|
204
|
+
showClose,
|
|
205
|
+
type: "warning",
|
|
206
|
+
...options
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
notification.error = (message, title, options) => {
|
|
210
|
+
return notification(message, title ?? "", {
|
|
211
|
+
showClose,
|
|
212
|
+
type: "error",
|
|
213
|
+
...options
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
notification.tips = (message, title, options) => {
|
|
217
|
+
return notification(message, title ?? "", {
|
|
218
|
+
showClose,
|
|
219
|
+
type: "info",
|
|
220
|
+
...options
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
return notification;
|
|
224
|
+
};
|
|
225
|
+
const checkElementIsExist = (id, container = "body") => {
|
|
226
|
+
if (document.querySelector(`#${id}`)) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
try {
|
|
230
|
+
const div = document.createElement("div");
|
|
231
|
+
div.id = id;
|
|
232
|
+
const containerEl = document.querySelector(container);
|
|
233
|
+
containerEl.append(div);
|
|
234
|
+
return true;
|
|
235
|
+
} catch {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var EVENT_NAME = /* @__PURE__ */ ((EVENT_NAME2) => {
|
|
240
|
+
EVENT_NAME2["改变"] = "change";
|
|
241
|
+
EVENT_NAME2["发送"] = "send";
|
|
242
|
+
EVENT_NAME2["点击"] = "tap";
|
|
243
|
+
EVENT_NAME2["确认"] = "confirm";
|
|
244
|
+
EVENT_NAME2["搜索"] = "search";
|
|
245
|
+
EVENT_NAME2["扫码"] = "scan";
|
|
246
|
+
EVENT_NAME2["保存"] = "save";
|
|
247
|
+
EVENT_NAME2["下载"] = "download";
|
|
248
|
+
EVENT_NAME2["返回"] = "back";
|
|
249
|
+
EVENT_NAME2["预览"] = "preview";
|
|
250
|
+
EVENT_NAME2["删除"] = "delete";
|
|
251
|
+
EVENT_NAME2["重置"] = "reset";
|
|
252
|
+
EVENT_NAME2["关闭"] = "close";
|
|
253
|
+
EVENT_NAME2["提交"] = "submit";
|
|
254
|
+
return EVENT_NAME2;
|
|
255
|
+
})(EVENT_NAME || {});
|
|
256
|
+
var zhCn = {
|
|
257
|
+
name: "zh-cn",
|
|
258
|
+
el: {
|
|
259
|
+
breadcrumb: {
|
|
260
|
+
label: "面包屑"
|
|
261
|
+
},
|
|
262
|
+
colorpicker: {
|
|
263
|
+
confirm: "确定",
|
|
264
|
+
clear: "清空",
|
|
265
|
+
defaultLabel: "颜色选择器",
|
|
266
|
+
description: "当前颜色 {color},按 Enter 键选择新颜色",
|
|
267
|
+
alphaLabel: "选择透明度的值",
|
|
268
|
+
alphaDescription: "透明度 {alpha}, 当前颜色 {color}",
|
|
269
|
+
hueLabel: "选择色相值",
|
|
270
|
+
hueDescription: "色相 {hue}, 当前颜色 {color}",
|
|
271
|
+
svLabel: "选择饱和度与明度的值",
|
|
272
|
+
svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",
|
|
273
|
+
predefineDescription: "选择 {value} 作为颜色"
|
|
274
|
+
},
|
|
275
|
+
datepicker: {
|
|
276
|
+
now: "此刻",
|
|
277
|
+
today: "今天",
|
|
278
|
+
cancel: "取消",
|
|
279
|
+
clear: "清空",
|
|
280
|
+
confirm: "确定",
|
|
281
|
+
dateTablePrompt: "使用方向键与 Enter 键可选择日期",
|
|
282
|
+
monthTablePrompt: "使用方向键与 Enter 键可选择月份",
|
|
283
|
+
yearTablePrompt: "使用方向键与 Enter 键可选择年份",
|
|
284
|
+
selectedDate: "已选日期",
|
|
285
|
+
selectDate: "选择日期",
|
|
286
|
+
selectTime: "选择时间",
|
|
287
|
+
startDate: "开始日期",
|
|
288
|
+
startTime: "开始时间",
|
|
289
|
+
endDate: "结束日期",
|
|
290
|
+
endTime: "结束时间",
|
|
291
|
+
prevYear: "前一年",
|
|
292
|
+
nextYear: "后一年",
|
|
293
|
+
prevMonth: "上个月",
|
|
294
|
+
nextMonth: "下个月",
|
|
295
|
+
year: "年",
|
|
296
|
+
month1: "1 月",
|
|
297
|
+
month2: "2 月",
|
|
298
|
+
month3: "3 月",
|
|
299
|
+
month4: "4 月",
|
|
300
|
+
month5: "5 月",
|
|
301
|
+
month6: "6 月",
|
|
302
|
+
month7: "7 月",
|
|
303
|
+
month8: "8 月",
|
|
304
|
+
month9: "9 月",
|
|
305
|
+
month10: "10 月",
|
|
306
|
+
month11: "11 月",
|
|
307
|
+
month12: "12 月",
|
|
308
|
+
weeks: {
|
|
309
|
+
sun: "日",
|
|
310
|
+
mon: "一",
|
|
311
|
+
tue: "二",
|
|
312
|
+
wed: "三",
|
|
313
|
+
thu: "四",
|
|
314
|
+
fri: "五",
|
|
315
|
+
sat: "六"
|
|
316
|
+
},
|
|
317
|
+
weeksFull: {
|
|
318
|
+
sun: "星期日",
|
|
319
|
+
mon: "星期一",
|
|
320
|
+
tue: "星期二",
|
|
321
|
+
wed: "星期三",
|
|
322
|
+
thu: "星期四",
|
|
323
|
+
fri: "星期五",
|
|
324
|
+
sat: "星期六"
|
|
325
|
+
},
|
|
326
|
+
months: {
|
|
327
|
+
jan: "一月",
|
|
328
|
+
feb: "二月",
|
|
329
|
+
mar: "三月",
|
|
330
|
+
apr: "四月",
|
|
331
|
+
may: "五月",
|
|
332
|
+
jun: "六月",
|
|
333
|
+
jul: "七月",
|
|
334
|
+
aug: "八月",
|
|
335
|
+
sep: "九月",
|
|
336
|
+
oct: "十月",
|
|
337
|
+
nov: "十一月",
|
|
338
|
+
dec: "十二月"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
inputNumber: {
|
|
342
|
+
decrease: "减少数值",
|
|
343
|
+
increase: "增加数值"
|
|
344
|
+
},
|
|
345
|
+
select: {
|
|
346
|
+
loading: "加载中",
|
|
347
|
+
noMatch: "无匹配数据",
|
|
348
|
+
noData: "无数据",
|
|
349
|
+
placeholder: "请选择"
|
|
350
|
+
},
|
|
351
|
+
mention: {
|
|
352
|
+
loading: "加载中"
|
|
353
|
+
},
|
|
354
|
+
dropdown: {
|
|
355
|
+
toggleDropdown: "切换下拉选项"
|
|
356
|
+
},
|
|
357
|
+
cascader: {
|
|
358
|
+
noMatch: "无匹配数据",
|
|
359
|
+
loading: "加载中",
|
|
360
|
+
placeholder: "请选择",
|
|
361
|
+
noData: "暂无数据"
|
|
362
|
+
},
|
|
363
|
+
pagination: {
|
|
364
|
+
goto: "前往",
|
|
365
|
+
pagesize: "条/页",
|
|
366
|
+
total: "共 {total} 条",
|
|
367
|
+
pageClassifier: "页",
|
|
368
|
+
page: "页",
|
|
369
|
+
prev: "上一页",
|
|
370
|
+
next: "下一页",
|
|
371
|
+
currentPage: "第 {pager} 页",
|
|
372
|
+
prevPages: "向前 {pager} 页",
|
|
373
|
+
nextPages: "向后 {pager} 页",
|
|
374
|
+
deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"
|
|
375
|
+
},
|
|
376
|
+
dialog: {
|
|
377
|
+
close: "关闭此对话框"
|
|
378
|
+
},
|
|
379
|
+
drawer: {
|
|
380
|
+
close: "关闭此对话框"
|
|
381
|
+
},
|
|
382
|
+
messagebox: {
|
|
383
|
+
title: "提示",
|
|
384
|
+
confirm: "确定",
|
|
385
|
+
cancel: "取消",
|
|
386
|
+
error: "输入的数据不合法!",
|
|
387
|
+
close: "关闭此对话框"
|
|
388
|
+
},
|
|
389
|
+
upload: {
|
|
390
|
+
deleteTip: "按 Delete 键可删除",
|
|
391
|
+
delete: "删除",
|
|
392
|
+
preview: "查看图片",
|
|
393
|
+
continue: "继续上传"
|
|
394
|
+
},
|
|
395
|
+
slider: {
|
|
396
|
+
defaultLabel: "滑块介于 {min} 至 {max}",
|
|
397
|
+
defaultRangeStartLabel: "选择起始值",
|
|
398
|
+
defaultRangeEndLabel: "选择结束值"
|
|
399
|
+
},
|
|
400
|
+
table: {
|
|
401
|
+
emptyText: "暂无数据",
|
|
402
|
+
confirmFilter: "筛选",
|
|
403
|
+
resetFilter: "重置",
|
|
404
|
+
clearFilter: "全部",
|
|
405
|
+
sumText: "合计",
|
|
406
|
+
selectAllLabel: "选择所有行",
|
|
407
|
+
selectRowLabel: "选择当前行",
|
|
408
|
+
expandRowLabel: "展开当前行",
|
|
409
|
+
collapseRowLabel: "收起当前行",
|
|
410
|
+
sortLabel: "按 {column} 排序",
|
|
411
|
+
filterLabel: "按 {column} 过滤"
|
|
412
|
+
},
|
|
413
|
+
tag: {
|
|
414
|
+
close: "关闭此标签"
|
|
415
|
+
},
|
|
416
|
+
tour: {
|
|
417
|
+
next: "下一步",
|
|
418
|
+
previous: "上一步",
|
|
419
|
+
finish: "结束导览",
|
|
420
|
+
close: "关闭此对话框"
|
|
421
|
+
},
|
|
422
|
+
tree: {
|
|
423
|
+
emptyText: "暂无数据"
|
|
424
|
+
},
|
|
425
|
+
transfer: {
|
|
426
|
+
noMatch: "无匹配数据",
|
|
427
|
+
noData: "无数据",
|
|
428
|
+
titles: ["列表 1", "列表 2"],
|
|
429
|
+
filterPlaceholder: "请输入搜索内容",
|
|
430
|
+
noCheckedFormat: "共 {total} 项",
|
|
431
|
+
hasCheckedFormat: "已选 {checked}/{total} 项"
|
|
432
|
+
},
|
|
433
|
+
image: {
|
|
434
|
+
error: "加载失败"
|
|
435
|
+
},
|
|
436
|
+
pageHeader: {
|
|
437
|
+
title: "返回"
|
|
438
|
+
},
|
|
439
|
+
popconfirm: {
|
|
440
|
+
confirmButtonText: "确定",
|
|
441
|
+
cancelButtonText: "取消"
|
|
442
|
+
},
|
|
443
|
+
carousel: {
|
|
444
|
+
leftArrow: "上一张幻灯片",
|
|
445
|
+
rightArrow: "下一张幻灯片",
|
|
446
|
+
indicator: "幻灯片切换至索引 {index}"
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
451
|
+
...{
|
|
452
|
+
name: "SakuraSelect"
|
|
453
|
+
},
|
|
454
|
+
__name: "select",
|
|
455
|
+
props: /* @__PURE__ */ mergeModels({
|
|
456
|
+
width: {},
|
|
457
|
+
margin: {},
|
|
458
|
+
size: { default: "default" },
|
|
459
|
+
options: {},
|
|
460
|
+
disabled: { type: Boolean, default: false },
|
|
461
|
+
placeholder: { default: "请选择" },
|
|
462
|
+
clearable: { type: Boolean, default: false },
|
|
463
|
+
multiple: { type: Boolean, default: false },
|
|
464
|
+
collapseTags: { type: Boolean, default: false },
|
|
465
|
+
collapseTagsTooltip: { type: Boolean, default: false },
|
|
466
|
+
loading: { type: Boolean },
|
|
467
|
+
virtualized: { type: Boolean },
|
|
468
|
+
emptyValues: { default: () => [void 0, null] },
|
|
469
|
+
stringEmpty: { type: Boolean, default: false },
|
|
470
|
+
locale: { default: zhCn },
|
|
471
|
+
maxLength: { default: 50 }
|
|
472
|
+
}, {
|
|
473
|
+
"modelValue": {
|
|
474
|
+
type: [String, Number, Object, Array, Boolean],
|
|
475
|
+
default: ""
|
|
476
|
+
},
|
|
477
|
+
"modelModifiers": {}
|
|
478
|
+
}),
|
|
479
|
+
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
480
|
+
setup(__props, { emit: __emit }) {
|
|
481
|
+
const ns = useNamespace("select");
|
|
482
|
+
const props = __props;
|
|
483
|
+
const emits = __emit;
|
|
484
|
+
const selectStyle = computed(() => {
|
|
485
|
+
const { width, margin } = props;
|
|
486
|
+
const style = {};
|
|
487
|
+
if (width) {
|
|
488
|
+
style.width = addUnit(width);
|
|
489
|
+
}
|
|
490
|
+
if (margin) {
|
|
491
|
+
style.margin = addUnit(margin);
|
|
492
|
+
}
|
|
493
|
+
return style;
|
|
494
|
+
});
|
|
495
|
+
const selectValue = useModel(__props, "modelValue");
|
|
496
|
+
const _emptyValues = computed(() => {
|
|
497
|
+
const { emptyValues, stringEmpty } = props;
|
|
498
|
+
if (stringEmpty) {
|
|
499
|
+
return [void 0, null, ""];
|
|
500
|
+
}
|
|
501
|
+
return emptyValues;
|
|
502
|
+
});
|
|
503
|
+
const isUseVirtualized = computed(() => {
|
|
504
|
+
const { virtualized, maxLength, options } = props;
|
|
505
|
+
return virtualized || options.length > maxLength;
|
|
506
|
+
});
|
|
507
|
+
const selectComponent = computed(() => {
|
|
508
|
+
return isUseVirtualized.value ? ElSelectV2 : ElSelect;
|
|
509
|
+
});
|
|
510
|
+
return (_ctx, _cache) => {
|
|
511
|
+
return openBlock(), createBlock(unref(ElConfigProvider), { locale: __props.locale }, {
|
|
512
|
+
default: withCtx(() => [
|
|
513
|
+
createElementVNode("div", mergeProps({
|
|
514
|
+
class: [
|
|
515
|
+
unref(ns).b(),
|
|
516
|
+
unref(ns).is("multiple", __props.multiple)
|
|
517
|
+
],
|
|
518
|
+
style: [selectStyle.value]
|
|
519
|
+
}, _ctx.$attrs), [
|
|
520
|
+
(openBlock(), createBlock(resolveDynamicComponent(selectComponent.value), {
|
|
521
|
+
ref: "elSelectRef",
|
|
522
|
+
modelValue: selectValue.value,
|
|
523
|
+
"onUpdate:modelValue": [
|
|
524
|
+
_cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
|
|
525
|
+
_cache[1] || (_cache[1] = ($event) => emits(unref(EVENT_NAME).改变, { value: $event, options: __props.options }))
|
|
526
|
+
],
|
|
527
|
+
clearable: __props.clearable,
|
|
528
|
+
placeholder: __props.placeholder,
|
|
529
|
+
multiple: __props.multiple,
|
|
530
|
+
"collapse-tags": __props.collapseTags,
|
|
531
|
+
"collapse-tags-tooltip": __props.collapseTagsTooltip,
|
|
532
|
+
disabled: __props.disabled,
|
|
533
|
+
loading: __props.loading,
|
|
534
|
+
"empty-values": _emptyValues.value,
|
|
535
|
+
size: __props.size,
|
|
536
|
+
options: __props.options
|
|
537
|
+
}, createSlots({ _: 2 }, [
|
|
538
|
+
_ctx.$slots.header ? {
|
|
539
|
+
name: "header",
|
|
540
|
+
fn: withCtx(() => [
|
|
541
|
+
renderSlot(_ctx.$slots, "header")
|
|
542
|
+
]),
|
|
543
|
+
key: "0"
|
|
544
|
+
} : void 0,
|
|
545
|
+
_ctx.$slots.default ? {
|
|
546
|
+
name: "default",
|
|
547
|
+
fn: withCtx(({ item }) => [
|
|
548
|
+
isUseVirtualized.value ? renderSlot(_ctx.$slots, "default", {
|
|
549
|
+
key: 0,
|
|
550
|
+
item
|
|
551
|
+
}) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.options, (v) => {
|
|
552
|
+
return openBlock(), createBlock(unref(ElOption), {
|
|
553
|
+
key: v.value,
|
|
554
|
+
label: v.label,
|
|
555
|
+
value: v.value,
|
|
556
|
+
disabled: v.disabled
|
|
557
|
+
}, {
|
|
558
|
+
default: withCtx(() => [
|
|
559
|
+
renderSlot(_ctx.$slots, "default", { item: v })
|
|
560
|
+
]),
|
|
561
|
+
_: 2
|
|
562
|
+
}, 1032, ["label", "value", "disabled"]);
|
|
563
|
+
}), 128))
|
|
564
|
+
]),
|
|
565
|
+
key: "1"
|
|
566
|
+
} : void 0,
|
|
567
|
+
_ctx.$slots.footer ? {
|
|
568
|
+
name: "footer",
|
|
569
|
+
fn: withCtx(() => [
|
|
570
|
+
renderSlot(_ctx.$slots, "footer")
|
|
571
|
+
]),
|
|
572
|
+
key: "2"
|
|
573
|
+
} : void 0,
|
|
574
|
+
_ctx.$slots.tag ? {
|
|
575
|
+
name: "tag",
|
|
576
|
+
fn: withCtx((data) => [
|
|
577
|
+
renderSlot(_ctx.$slots, "tag", { data })
|
|
578
|
+
]),
|
|
579
|
+
key: "3"
|
|
580
|
+
} : void 0
|
|
581
|
+
]), 1032, ["modelValue", "clearable", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled", "loading", "empty-values", "size", "options"]))
|
|
582
|
+
], 16)
|
|
583
|
+
]),
|
|
584
|
+
_: 3
|
|
585
|
+
}, 8, ["locale"]);
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
const CellContextKey = Symbol("CellContextKey");
|
|
590
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
591
|
+
...{
|
|
592
|
+
name: "SakuraCell"
|
|
593
|
+
},
|
|
594
|
+
__name: "cell",
|
|
595
|
+
props: {
|
|
596
|
+
labelWidth: {},
|
|
597
|
+
background: {},
|
|
598
|
+
label: {},
|
|
599
|
+
content: {}
|
|
600
|
+
},
|
|
601
|
+
setup(__props) {
|
|
602
|
+
const ns = useNamespace("cell");
|
|
603
|
+
const props = __props;
|
|
604
|
+
const cellContext = inject(CellContextKey, {});
|
|
605
|
+
const cellStyle = computed(() => {
|
|
606
|
+
const { labelWidth, background } = props;
|
|
607
|
+
return ns.cssBlockVar("cell", {
|
|
608
|
+
"label-width": addUnit(labelWidth || cellContext.labelWidth || 140),
|
|
609
|
+
"background": background || cellContext.background || "#F2FAFF"
|
|
610
|
+
});
|
|
611
|
+
});
|
|
612
|
+
return (_ctx, _cache) => {
|
|
613
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
614
|
+
class: [unref(ns).b()],
|
|
615
|
+
style: [cellStyle.value]
|
|
616
|
+
}, _ctx.$attrs), [
|
|
617
|
+
createElementVNode("p", {
|
|
618
|
+
class: normalizeClass([unref(ns).e("label")])
|
|
619
|
+
}, toDisplayString(__props.label), 3),
|
|
620
|
+
createElementVNode("p", {
|
|
621
|
+
class: normalizeClass([unref(ns).e("content")])
|
|
622
|
+
}, [
|
|
623
|
+
__props.content ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
624
|
+
createTextVNode(toDisplayString(__props.content), 1)
|
|
625
|
+
], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
626
|
+
], 2)
|
|
627
|
+
], 16);
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
632
|
+
...{
|
|
633
|
+
name: "SakuraCellGroup"
|
|
634
|
+
},
|
|
635
|
+
__name: "cell-group",
|
|
636
|
+
props: {
|
|
637
|
+
labelWidth: { default: 140 },
|
|
638
|
+
background: { default: "#F2FAFF" }
|
|
639
|
+
},
|
|
640
|
+
setup(__props) {
|
|
641
|
+
const ns = useNamespace("cell-group");
|
|
642
|
+
const props = __props;
|
|
643
|
+
provide(CellContextKey, reactive({
|
|
644
|
+
labelWidth: toRef(props, "labelWidth"),
|
|
645
|
+
background: toRef(props, "background")
|
|
646
|
+
}));
|
|
647
|
+
return (_ctx, _cache) => {
|
|
648
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
649
|
+
class: [unref(ns).b()]
|
|
650
|
+
}, _ctx.$attrs), [
|
|
651
|
+
renderSlot(_ctx.$slots, "default")
|
|
652
|
+
], 16);
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
657
|
+
...{
|
|
658
|
+
name: "SakuraStatus"
|
|
659
|
+
},
|
|
660
|
+
__name: "status",
|
|
661
|
+
props: {
|
|
662
|
+
type: { default: "primary" },
|
|
663
|
+
text: {},
|
|
664
|
+
color: {},
|
|
665
|
+
plain: { type: Boolean }
|
|
666
|
+
},
|
|
667
|
+
setup(__props) {
|
|
668
|
+
const ns = useNamespace("status");
|
|
669
|
+
const props = __props;
|
|
670
|
+
const statusStyle = computed(() => {
|
|
671
|
+
return ns.cssBlockVar("status", {
|
|
672
|
+
"bg-color": ns.cssBlockVarNameValue("color", `${props.type}-light-9`)
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
const statusCustomColorStyle = computed(() => {
|
|
676
|
+
const { color: statusColor } = props;
|
|
677
|
+
if (isEmpty(statusColor)) {
|
|
678
|
+
return {};
|
|
679
|
+
}
|
|
680
|
+
const color = new TinyColor(statusColor);
|
|
681
|
+
return extend({}, ns.cssBlockVar("status", {
|
|
682
|
+
"bg-color": color.tint(90).toString()
|
|
683
|
+
}), {
|
|
684
|
+
color: statusColor,
|
|
685
|
+
borderColor: statusColor
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
return (_ctx, _cache) => {
|
|
689
|
+
return openBlock(), createElementBlock("span", mergeProps({
|
|
690
|
+
class: [
|
|
691
|
+
unref(ns).b(),
|
|
692
|
+
unref(ns).m(__props.type),
|
|
693
|
+
unref(ns).is("plain", __props.plain)
|
|
694
|
+
],
|
|
695
|
+
style: [statusStyle.value, statusCustomColorStyle.value]
|
|
696
|
+
}, _ctx.$attrs), [
|
|
697
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
698
|
+
createTextVNode(toDisplayString(__props.text), 1)
|
|
699
|
+
], 64))
|
|
700
|
+
], 16);
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
705
|
+
...{
|
|
706
|
+
name: "SakuraContainer"
|
|
707
|
+
},
|
|
708
|
+
__name: "container",
|
|
709
|
+
props: {
|
|
710
|
+
title: {}
|
|
711
|
+
},
|
|
712
|
+
setup(__props) {
|
|
713
|
+
const ns = useNamespace("container");
|
|
714
|
+
return (_ctx, _cache) => {
|
|
715
|
+
return openBlock(), createElementBlock("div", {
|
|
716
|
+
class: normalizeClass([unref(ns).b()])
|
|
717
|
+
}, [
|
|
718
|
+
_ctx.$slots.header || __props.title ? (openBlock(), createElementBlock("div", {
|
|
719
|
+
key: 0,
|
|
720
|
+
class: normalizeClass([unref(ns).e("header")])
|
|
721
|
+
}, [
|
|
722
|
+
renderSlot(_ctx.$slots, "header")
|
|
723
|
+
], 2)) : createCommentVNode("", true),
|
|
724
|
+
createElementVNode("div", {
|
|
725
|
+
class: normalizeClass([unref(ns).e("body")])
|
|
726
|
+
}, [
|
|
727
|
+
renderSlot(_ctx.$slots, "default")
|
|
728
|
+
], 2),
|
|
729
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
730
|
+
key: 1,
|
|
731
|
+
class: normalizeClass([unref(ns).e("footer")])
|
|
732
|
+
}, [
|
|
733
|
+
renderSlot(_ctx.$slots, "footer")
|
|
734
|
+
], 2)) : createCommentVNode("", true)
|
|
735
|
+
], 2);
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
740
|
+
...{
|
|
741
|
+
name: "SakuraPagination"
|
|
742
|
+
},
|
|
743
|
+
__name: "pagination",
|
|
744
|
+
props: /* @__PURE__ */ mergeModels({
|
|
745
|
+
size: { default: "small" },
|
|
746
|
+
total: { default: 100 },
|
|
747
|
+
layout: { default: "total, sizes, prev, pager, next" },
|
|
748
|
+
locale: { default: zhCn }
|
|
749
|
+
}, {
|
|
750
|
+
"pageSize": {
|
|
751
|
+
type: Number,
|
|
752
|
+
default: 10
|
|
753
|
+
},
|
|
754
|
+
"pageSizeModifiers": {},
|
|
755
|
+
"pageNum": {
|
|
756
|
+
type: Number,
|
|
757
|
+
default: 1
|
|
758
|
+
},
|
|
759
|
+
"pageNumModifiers": {}
|
|
760
|
+
}),
|
|
761
|
+
emits: /* @__PURE__ */ mergeModels(["change"], ["update:pageSize", "update:pageNum"]),
|
|
762
|
+
setup(__props, { emit: __emit }) {
|
|
763
|
+
const emits = __emit;
|
|
764
|
+
const _pageSize = useModel(__props, "pageSize");
|
|
765
|
+
const _pageNum = useModel(__props, "pageNum");
|
|
766
|
+
const handleValue = (value, type) => {
|
|
767
|
+
if (type === "pageNum") {
|
|
768
|
+
_pageNum.value = value;
|
|
769
|
+
} else {
|
|
770
|
+
_pageSize.value = value;
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
const onChange = async () => {
|
|
774
|
+
await nextTick();
|
|
775
|
+
emits(CHANGE_EVENT);
|
|
776
|
+
};
|
|
777
|
+
return (_ctx, _cache) => {
|
|
778
|
+
return openBlock(), createBlock(unref(ElConfigProvider), { locale: __props.locale }, {
|
|
779
|
+
default: withCtx(() => [
|
|
780
|
+
createVNode(unref(ElPagination), {
|
|
781
|
+
"current-page": __props.pageNum,
|
|
782
|
+
"page-size": __props.pageSize,
|
|
783
|
+
"page-sizes": [10, 20, 40, 60],
|
|
784
|
+
total: __props.total,
|
|
785
|
+
size: __props.size,
|
|
786
|
+
background: "",
|
|
787
|
+
layout: __props.layout,
|
|
788
|
+
onSizeChange: _cache[0] || (_cache[0] = ($event) => handleValue($event, "pageSize")),
|
|
789
|
+
onCurrentChange: _cache[1] || (_cache[1] = ($event) => handleValue($event, "pageNum")),
|
|
790
|
+
onChange
|
|
791
|
+
}, null, 8, ["current-page", "page-size", "total", "size", "layout"])
|
|
792
|
+
]),
|
|
793
|
+
_: 1
|
|
794
|
+
}, 8, ["locale"]);
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
799
|
+
...{
|
|
800
|
+
name: "SakuraSearchInput"
|
|
801
|
+
},
|
|
802
|
+
__name: "search-input",
|
|
803
|
+
props: /* @__PURE__ */ mergeModels({
|
|
804
|
+
placeholder: { default: "请输入" },
|
|
805
|
+
width: { default: 280 },
|
|
806
|
+
searchText: { default: "搜索" },
|
|
807
|
+
size: { default: "default" }
|
|
808
|
+
}, {
|
|
809
|
+
"modelValue": {
|
|
810
|
+
type: String,
|
|
811
|
+
default: ""
|
|
812
|
+
},
|
|
813
|
+
"modelModifiers": {}
|
|
814
|
+
}),
|
|
815
|
+
emits: /* @__PURE__ */ mergeModels(["search"], ["update:modelValue"]),
|
|
816
|
+
setup(__props, { emit: __emit }) {
|
|
817
|
+
const ns = useNamespace("search-input");
|
|
818
|
+
const props = __props;
|
|
819
|
+
const emits = __emit;
|
|
820
|
+
const searchInputText = useModel(__props, "modelValue");
|
|
821
|
+
const searchInputStyle = computed(() => {
|
|
822
|
+
const { width } = props;
|
|
823
|
+
return ns.cssBlockVar("search", {
|
|
824
|
+
"input-width": addUnit(width)
|
|
825
|
+
});
|
|
826
|
+
});
|
|
827
|
+
return (_ctx, _cache) => {
|
|
828
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
829
|
+
class: [unref(ns).b()],
|
|
830
|
+
style: [searchInputStyle.value]
|
|
831
|
+
}, _ctx.$attrs), [
|
|
832
|
+
createVNode(unref(ElInput), {
|
|
833
|
+
class: normalizeClass([unref(ns).e("input")]),
|
|
834
|
+
modelValue: searchInputText.value,
|
|
835
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchInputText.value = $event),
|
|
836
|
+
placeholder: __props.placeholder,
|
|
837
|
+
size: __props.size,
|
|
838
|
+
onKeydown: _cache[1] || (_cache[1] = withKeys(($event) => emits("search", searchInputText.value), ["enter"]))
|
|
839
|
+
}, null, 8, ["class", "modelValue", "placeholder", "size"]),
|
|
840
|
+
createVNode(unref(ElButton), {
|
|
841
|
+
class: normalizeClass([unref(ns).e("button")]),
|
|
842
|
+
type: "primary",
|
|
843
|
+
size: __props.size,
|
|
844
|
+
onClick: _cache[2] || (_cache[2] = ($event) => emits("search", searchInputText.value))
|
|
845
|
+
}, {
|
|
846
|
+
default: withCtx(() => [
|
|
847
|
+
createTextVNode(toDisplayString(__props.searchText), 1)
|
|
848
|
+
]),
|
|
849
|
+
_: 1
|
|
850
|
+
}, 8, ["class", "size"])
|
|
851
|
+
], 16);
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
const FilterGroupContextKey = Symbol("FilterGroupContextKey");
|
|
856
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
857
|
+
...{
|
|
858
|
+
name: "SakuraFilterItem"
|
|
859
|
+
},
|
|
860
|
+
__name: "filter-item",
|
|
861
|
+
props: {
|
|
862
|
+
label: {},
|
|
863
|
+
minWidth: {},
|
|
864
|
+
direction: {}
|
|
865
|
+
},
|
|
866
|
+
setup(__props) {
|
|
867
|
+
const props = __props;
|
|
868
|
+
const context = inject(FilterGroupContextKey, {});
|
|
869
|
+
const ns = useNamespace("filter-item");
|
|
870
|
+
const filterItemInstance = useTemplateRef("filterItemRef");
|
|
871
|
+
let observer = null;
|
|
872
|
+
const isWrap = ref(false);
|
|
873
|
+
const setupObserver = () => {
|
|
874
|
+
observer == null ? void 0 : observer.disconnect();
|
|
875
|
+
if (isEmpty(context)) {
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
observer = new IntersectionObserver((entries) => {
|
|
879
|
+
entries.forEach((entry) => {
|
|
880
|
+
const rect = entry.boundingClientRect;
|
|
881
|
+
isWrap.value = context.containerTop < rect.top;
|
|
882
|
+
});
|
|
883
|
+
}, {
|
|
884
|
+
root: null,
|
|
885
|
+
rootMargin: "0px",
|
|
886
|
+
threshold: 1
|
|
887
|
+
});
|
|
888
|
+
observer.observe(filterItemInstance.value);
|
|
889
|
+
};
|
|
890
|
+
onMounted(() => {
|
|
891
|
+
setupObserver();
|
|
892
|
+
window.addEventListener("resize", setupObserver);
|
|
893
|
+
});
|
|
894
|
+
onUnmounted(() => {
|
|
895
|
+
observer == null ? void 0 : observer.disconnect();
|
|
896
|
+
window.removeEventListener("resize", setupObserver);
|
|
897
|
+
});
|
|
898
|
+
const filterItemDirection = computed(() => {
|
|
899
|
+
const { direction } = props;
|
|
900
|
+
return direction || context.direction || "row";
|
|
901
|
+
});
|
|
902
|
+
const filterItemStyle = computed(() => {
|
|
903
|
+
const { minWidth } = props;
|
|
904
|
+
return ns.cssBlockVar("filter-item", {
|
|
905
|
+
"value-min-width": addUnit(minWidth || context.minWidth || 240),
|
|
906
|
+
"gap": addUnit(context.gap || 20)
|
|
907
|
+
});
|
|
908
|
+
});
|
|
909
|
+
return (_ctx, _cache) => {
|
|
910
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
911
|
+
ref: "filterItemRef",
|
|
912
|
+
class: [unref(ns).b(), unref(ns).is("wrap", isWrap.value), unref(ns).is(filterItemDirection.value)],
|
|
913
|
+
style: [filterItemStyle.value]
|
|
914
|
+
}, _ctx.$attrs), [
|
|
915
|
+
createElementVNode("span", {
|
|
916
|
+
class: normalizeClass([unref(ns).e("label")])
|
|
917
|
+
}, toDisplayString(__props.label), 3),
|
|
918
|
+
createElementVNode("div", {
|
|
919
|
+
class: normalizeClass([unref(ns).e("value")])
|
|
920
|
+
}, [
|
|
921
|
+
renderSlot(_ctx.$slots, "default")
|
|
922
|
+
], 2)
|
|
923
|
+
], 16);
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
928
|
+
...{
|
|
929
|
+
name: "SakuraFilterGroup"
|
|
930
|
+
},
|
|
931
|
+
__name: "filter-group",
|
|
932
|
+
props: {
|
|
933
|
+
minWidth: { default: 240 },
|
|
934
|
+
gap: { default: 20 },
|
|
935
|
+
direction: { default: "row" }
|
|
936
|
+
},
|
|
937
|
+
setup(__props) {
|
|
938
|
+
const props = __props;
|
|
939
|
+
const ns = useNamespace("filter-group");
|
|
940
|
+
const filterGroup = useTemplateRef("filterGroupRef");
|
|
941
|
+
const containerTop = computed(() => {
|
|
942
|
+
var _a;
|
|
943
|
+
return ((_a = filterGroup.value) == null ? void 0 : _a.getBoundingClientRect().top) ?? 0;
|
|
944
|
+
});
|
|
945
|
+
provide(FilterGroupContextKey, reactive({
|
|
946
|
+
minWidth: toRef(props, "minWidth"),
|
|
947
|
+
gap: toRef(props, "gap"),
|
|
948
|
+
containerTop,
|
|
949
|
+
direction: toRef(props, "direction")
|
|
950
|
+
}));
|
|
951
|
+
return (_ctx, _cache) => {
|
|
952
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
953
|
+
ref: "filterGroupRef",
|
|
954
|
+
class: [unref(ns).b()]
|
|
955
|
+
}, _ctx.$attrs), [
|
|
956
|
+
renderSlot(_ctx.$slots, "default")
|
|
957
|
+
], 16);
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
962
|
+
...{
|
|
963
|
+
name: "SakuraTabs"
|
|
964
|
+
},
|
|
965
|
+
__name: "tabs",
|
|
966
|
+
props: /* @__PURE__ */ mergeModels({
|
|
967
|
+
options: {}
|
|
968
|
+
}, {
|
|
969
|
+
"modelValue": {},
|
|
970
|
+
"modelModifiers": {}
|
|
971
|
+
}),
|
|
972
|
+
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
973
|
+
setup(__props, { emit: __emit }) {
|
|
974
|
+
const ns = useNamespace("tabs");
|
|
975
|
+
const emits = __emit;
|
|
976
|
+
const activeTab = useModel(__props, "modelValue");
|
|
977
|
+
return (_ctx, _cache) => {
|
|
978
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
979
|
+
class: [unref(ns).b()]
|
|
980
|
+
}, _ctx.$attrs), [
|
|
981
|
+
createVNode(unref(ElTabs), {
|
|
982
|
+
modelValue: activeTab.value,
|
|
983
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTab.value = $event),
|
|
984
|
+
onTabChange: _cache[1] || (_cache[1] = ($event) => emits("change", $event))
|
|
985
|
+
}, {
|
|
986
|
+
default: withCtx(() => [
|
|
987
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (v) => {
|
|
988
|
+
return openBlock(), createBlock(unref(ElTabPane), {
|
|
989
|
+
key: v.value,
|
|
990
|
+
label: v.label,
|
|
991
|
+
name: v.value
|
|
992
|
+
}, createSlots({ _: 2 }, [
|
|
993
|
+
_ctx.$slots.default ? {
|
|
994
|
+
name: "label",
|
|
995
|
+
fn: withCtx(() => [
|
|
996
|
+
renderSlot(_ctx.$slots, "default", { data: v })
|
|
997
|
+
]),
|
|
998
|
+
key: "0"
|
|
999
|
+
} : void 0
|
|
1000
|
+
]), 1032, ["label", "name"]);
|
|
1001
|
+
}), 128))
|
|
1002
|
+
]),
|
|
1003
|
+
_: 3
|
|
1004
|
+
}, 8, ["modelValue"])
|
|
1005
|
+
], 16);
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1010
|
+
...{
|
|
1011
|
+
name: "SakuraTooltipText"
|
|
1012
|
+
},
|
|
1013
|
+
__name: "tooltip-text",
|
|
1014
|
+
props: {
|
|
1015
|
+
truncated: { type: Boolean, default: true },
|
|
1016
|
+
fontSize: { default: 14 },
|
|
1017
|
+
content: {},
|
|
1018
|
+
fontWeight: { type: Boolean, default: false },
|
|
1019
|
+
color: {},
|
|
1020
|
+
width: { default: "100%" },
|
|
1021
|
+
effect: { default: "dark" }
|
|
1022
|
+
},
|
|
1023
|
+
setup(__props) {
|
|
1024
|
+
const props = __props;
|
|
1025
|
+
const ns = useNamespace("tooltip-text");
|
|
1026
|
+
const tooltipTextRef = useTemplateRef("tooltipTextRef");
|
|
1027
|
+
const tooltipTextContentWidth = ref(0);
|
|
1028
|
+
const showTooltipText = computed(() => {
|
|
1029
|
+
const { content, fontSize } = props;
|
|
1030
|
+
if (tooltipTextContentWidth.value === 0) {
|
|
1031
|
+
return false;
|
|
1032
|
+
}
|
|
1033
|
+
return computedTextsSize(content, fontSize) > tooltipTextContentWidth.value - fontSize * 3;
|
|
1034
|
+
});
|
|
1035
|
+
const initWidth = async () => {
|
|
1036
|
+
var _a;
|
|
1037
|
+
await nextTick();
|
|
1038
|
+
tooltipTextContentWidth.value = ((_a = tooltipTextRef.value) == null ? void 0 : _a.clientWidth) ?? 0;
|
|
1039
|
+
};
|
|
1040
|
+
onMounted(initWidth);
|
|
1041
|
+
const tooltipTextStyle = computed(() => {
|
|
1042
|
+
const { fontSize, color, width } = props;
|
|
1043
|
+
return ns.cssBlockVar("tooltip-text", {
|
|
1044
|
+
"font-size": addUnit(fontSize),
|
|
1045
|
+
color: color || ns.cssBlockVarNameValue("text-color", "primary"),
|
|
1046
|
+
width: addUnit(width)
|
|
1047
|
+
});
|
|
1048
|
+
});
|
|
1049
|
+
return (_ctx, _cache) => {
|
|
1050
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
1051
|
+
ref_key: "tooltipTextRef",
|
|
1052
|
+
ref: tooltipTextRef,
|
|
1053
|
+
class: [
|
|
1054
|
+
unref(ns).b(),
|
|
1055
|
+
unref(ns).is("truncated", __props.truncated),
|
|
1056
|
+
unref(ns).is("font-weight", __props.fontWeight)
|
|
1057
|
+
],
|
|
1058
|
+
style: [tooltipTextStyle.value]
|
|
1059
|
+
}, _ctx.$attrs), [
|
|
1060
|
+
showTooltipText.value ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
1061
|
+
key: 0,
|
|
1062
|
+
content: __props.content,
|
|
1063
|
+
class: normalizeClass([unref(ns).e("tooltip")]),
|
|
1064
|
+
effect: __props.effect
|
|
1065
|
+
}, {
|
|
1066
|
+
default: withCtx(() => [
|
|
1067
|
+
createElementVNode("p", mergeProps({
|
|
1068
|
+
class: [unref(ns).e("text")]
|
|
1069
|
+
}, _ctx.$attrs), toDisplayString(__props.content), 17)
|
|
1070
|
+
]),
|
|
1071
|
+
_: 1
|
|
1072
|
+
}, 8, ["content", "class", "effect"])) : (openBlock(), createElementBlock("p", mergeProps({
|
|
1073
|
+
key: 1,
|
|
1074
|
+
class: [unref(ns).e("text")]
|
|
1075
|
+
}, _ctx.$attrs), toDisplayString(__props.content), 17))
|
|
1076
|
+
], 16);
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
const PdfFileIcon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMzQiIHZpZXdCb3g9IjAgMCAyOSAzNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yLjE1ODkyIDM0LjAwMDFDMC45NjY2NzIgMzQuMDAwNCAwIDMzLjAzNCAwIDMxLjg0MTdWMi4xNTkzOEMwIDAuOT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2NTFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K";
|
|
1085
|
+
const _hoisted_1$1 = ["src"];
|
|
1086
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1087
|
+
...{
|
|
1088
|
+
name: "SakuraFileItem"
|
|
1089
|
+
},
|
|
1090
|
+
__name: "item",
|
|
1091
|
+
props: {
|
|
1092
|
+
fileInfo: {},
|
|
1093
|
+
pdfIcon: { default: PdfFileIcon },
|
|
1094
|
+
imageIcon: { default: ImageFileIcon },
|
|
1095
|
+
wordIcon: { default: WordFileIcon },
|
|
1096
|
+
zipIcon: { default: ZipFileIcon },
|
|
1097
|
+
excelIcon: { default: ExcelFileIcon },
|
|
1098
|
+
formatFontSize: {}
|
|
1099
|
+
},
|
|
1100
|
+
setup(__props) {
|
|
1101
|
+
const props = __props;
|
|
1102
|
+
const ns = useNamespace("file-item");
|
|
1103
|
+
const fileIcon = computed(() => {
|
|
1104
|
+
const { pdfIcon, excelIcon, imageIcon, wordIcon, zipIcon, fileInfo } = props;
|
|
1105
|
+
const { fileType } = fileInfo;
|
|
1106
|
+
switch (fileType) {
|
|
1107
|
+
case FILE_TYPE.IMAGE:
|
|
1108
|
+
return imageIcon;
|
|
1109
|
+
case FILE_TYPE.PDF:
|
|
1110
|
+
return pdfIcon;
|
|
1111
|
+
case FILE_TYPE.EXCEL:
|
|
1112
|
+
return excelIcon;
|
|
1113
|
+
case FILE_TYPE.WORD:
|
|
1114
|
+
return wordIcon;
|
|
1115
|
+
case FILE_TYPE.ZIP:
|
|
1116
|
+
default:
|
|
1117
|
+
return zipIcon;
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
const _fileSize = computed(() => {
|
|
1121
|
+
const { formatFontSize, fileInfo } = props;
|
|
1122
|
+
const fileSize = fileInfo.fileSize;
|
|
1123
|
+
if (!fileSize) {
|
|
1124
|
+
return "";
|
|
1125
|
+
}
|
|
1126
|
+
if (formatFontSize) {
|
|
1127
|
+
return formatFontSize(fileSize);
|
|
1128
|
+
}
|
|
1129
|
+
return Math.round(fileSize / 1024 / 1024 * 100) / 100 + "MB";
|
|
1130
|
+
});
|
|
1131
|
+
return (_ctx, _cache) => {
|
|
1132
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
1133
|
+
class: [unref(ns).b()]
|
|
1134
|
+
}, _ctx.$attrs), [
|
|
1135
|
+
createElementVNode("img", {
|
|
1136
|
+
class: normalizeClass([unref(ns).e("icon")]),
|
|
1137
|
+
src: fileIcon.value,
|
|
1138
|
+
alt: ""
|
|
1139
|
+
}, null, 10, _hoisted_1$1),
|
|
1140
|
+
createElementVNode("div", {
|
|
1141
|
+
class: normalizeClass([unref(ns).e("info")])
|
|
1142
|
+
}, [
|
|
1143
|
+
createElementVNode("span", {
|
|
1144
|
+
class: normalizeClass([unref(ns).e("file-name")])
|
|
1145
|
+
}, toDisplayString(__props.fileInfo.fileName), 3),
|
|
1146
|
+
__props.fileInfo.fileSize ? (openBlock(), createElementBlock("span", {
|
|
1147
|
+
key: 0,
|
|
1148
|
+
class: normalizeClass([unref(ns).e("file-size")])
|
|
1149
|
+
}, toDisplayString(_fileSize.value), 3)) : createCommentVNode("", true),
|
|
1150
|
+
renderSlot(_ctx.$slots, "default")
|
|
1151
|
+
], 2)
|
|
1152
|
+
], 16);
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1157
|
+
...{
|
|
1158
|
+
name: "SakuraFileList"
|
|
1159
|
+
},
|
|
1160
|
+
__name: "list",
|
|
1161
|
+
props: {
|
|
1162
|
+
fileList: {},
|
|
1163
|
+
width: { default: "auto" },
|
|
1164
|
+
direction: { default: "column" },
|
|
1165
|
+
gap: { default: 20 },
|
|
1166
|
+
row: { default: 2 }
|
|
1167
|
+
},
|
|
1168
|
+
setup(__props) {
|
|
1169
|
+
const props = __props;
|
|
1170
|
+
const ns = useNamespace("file-list");
|
|
1171
|
+
const fileListStyle = computed(() => {
|
|
1172
|
+
const { width, gap, row } = props;
|
|
1173
|
+
return ns.cssBlockVar("file-list", {
|
|
1174
|
+
width: addUnit(width),
|
|
1175
|
+
"file-item-with": `calc(100% / ${row} - ${gap * (row - 1) / row}px)`,
|
|
1176
|
+
gap: addUnit(gap)
|
|
1177
|
+
});
|
|
1178
|
+
});
|
|
1179
|
+
const fileItemStyle = computed(() => (index2) => {
|
|
1180
|
+
const { row } = props;
|
|
1181
|
+
if (index2 % row === 0) {
|
|
1182
|
+
return {
|
|
1183
|
+
marginRight: 0
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
return {};
|
|
1187
|
+
});
|
|
1188
|
+
return (_ctx, _cache) => {
|
|
1189
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
1190
|
+
class: [
|
|
1191
|
+
unref(ns).b(),
|
|
1192
|
+
unref(ns).m(__props.direction)
|
|
1193
|
+
],
|
|
1194
|
+
style: [fileListStyle.value]
|
|
1195
|
+
}, _ctx.$attrs), [
|
|
1196
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.fileList, (v, i) => {
|
|
1197
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
|
1198
|
+
key: v.fileId,
|
|
1199
|
+
"file-info": v,
|
|
1200
|
+
style: normalizeStyle(fileItemStyle.value(i + 1))
|
|
1201
|
+
}, null, 8, ["file-info", "style"]);
|
|
1202
|
+
}), 128))
|
|
1203
|
+
], 16);
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1208
|
+
...{
|
|
1209
|
+
name: "SakuraCountDown"
|
|
1210
|
+
},
|
|
1211
|
+
__name: "count-down",
|
|
1212
|
+
props: {
|
|
1213
|
+
type: { default: "primary" },
|
|
1214
|
+
defaultText: { default: "发送验证码" },
|
|
1215
|
+
countDownNum: { default: 60 },
|
|
1216
|
+
sendFn: {}
|
|
1217
|
+
},
|
|
1218
|
+
setup(__props, { expose: __expose }) {
|
|
1219
|
+
const props = __props;
|
|
1220
|
+
const ns = useNamespace("count-down");
|
|
1221
|
+
const isSend = ref(false);
|
|
1222
|
+
let timer = null;
|
|
1223
|
+
const count = ref(props.countDownNum);
|
|
1224
|
+
const countDownText = computed(() => `${count.value}S`);
|
|
1225
|
+
const loading = ref(false);
|
|
1226
|
+
const startCountDown = () => {
|
|
1227
|
+
endCountDown();
|
|
1228
|
+
isSend.value = true;
|
|
1229
|
+
timer = setInterval(() => {
|
|
1230
|
+
if (count.value-- <= 1) {
|
|
1231
|
+
endCountDown();
|
|
1232
|
+
}
|
|
1233
|
+
}, 1e3);
|
|
1234
|
+
};
|
|
1235
|
+
const endCountDown = () => {
|
|
1236
|
+
timer && clearInterval(timer);
|
|
1237
|
+
timer = null;
|
|
1238
|
+
count.value = props.countDownNum;
|
|
1239
|
+
isSend.value = false;
|
|
1240
|
+
};
|
|
1241
|
+
const sendCountDown = useThrottleFn(async () => {
|
|
1242
|
+
if (isSend.value || loading.value) {
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
const { sendFn } = props;
|
|
1246
|
+
loading.value = true;
|
|
1247
|
+
if (sendFn && !await sendFn()) {
|
|
1248
|
+
loading.value = false;
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
if (isSend.value) {
|
|
1252
|
+
loading.value = false;
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
loading.value = false;
|
|
1256
|
+
startCountDown();
|
|
1257
|
+
}, 500);
|
|
1258
|
+
__expose({
|
|
1259
|
+
endCountDown,
|
|
1260
|
+
startCountDown
|
|
1261
|
+
});
|
|
1262
|
+
return (_ctx, _cache) => {
|
|
1263
|
+
return openBlock(), createBlock(unref(ElButton), mergeProps(_ctx.$attrs, {
|
|
1264
|
+
class: [
|
|
1265
|
+
unref(ns).b(),
|
|
1266
|
+
unref(ns).m(__props.type),
|
|
1267
|
+
unref(ns).is("disabled", isSend.value || loading.value)
|
|
1268
|
+
],
|
|
1269
|
+
text: "",
|
|
1270
|
+
type: __props.type,
|
|
1271
|
+
loading: loading.value,
|
|
1272
|
+
disabled: isSend.value || loading.value,
|
|
1273
|
+
onClick: unref(sendCountDown)
|
|
1274
|
+
}), {
|
|
1275
|
+
default: withCtx(() => [
|
|
1276
|
+
createTextVNode(toDisplayString(isSend.value ? countDownText.value : __props.defaultText), 1)
|
|
1277
|
+
]),
|
|
1278
|
+
_: 1
|
|
1279
|
+
}, 16, ["class", "type", "loading", "disabled", "onClick"]);
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1284
|
+
...{
|
|
1285
|
+
name: "SakuraDialog"
|
|
1286
|
+
},
|
|
1287
|
+
__name: "dialog",
|
|
1288
|
+
props: /* @__PURE__ */ mergeModels({
|
|
1289
|
+
width: { default: "50vw" },
|
|
1290
|
+
title: {},
|
|
1291
|
+
borderRadius: { default: 12 },
|
|
1292
|
+
showClose: { type: Boolean, default: true },
|
|
1293
|
+
top: { default: "15vh" },
|
|
1294
|
+
showConfirmButton: { type: Boolean, default: true },
|
|
1295
|
+
confirmButtonText: { default: "确定" },
|
|
1296
|
+
confirmButtonType: { default: "primary" },
|
|
1297
|
+
confirmButtonSize: { default: "default" },
|
|
1298
|
+
confirmLoading: { type: Boolean },
|
|
1299
|
+
showCancelButton: { type: Boolean, default: true },
|
|
1300
|
+
cancelButtonText: { default: "取消" },
|
|
1301
|
+
cancelButtonType: { default: "" },
|
|
1302
|
+
cancelButtonSize: { default: "default" },
|
|
1303
|
+
showButton: { type: Boolean, default: true },
|
|
1304
|
+
zIndex: {},
|
|
1305
|
+
closeOnClickModal: { type: Boolean, default: false },
|
|
1306
|
+
closeOnPressEscape: { type: Boolean, default: true },
|
|
1307
|
+
closeOnCancelButton: { type: Boolean, default: true },
|
|
1308
|
+
closeOnClickCloseIcon: { type: Boolean, default: true },
|
|
1309
|
+
maxHeight: {},
|
|
1310
|
+
height: {},
|
|
1311
|
+
fullscreen: { type: Boolean, default: false },
|
|
1312
|
+
appendTo: {},
|
|
1313
|
+
closeIconSize: { default: 16 },
|
|
1314
|
+
closeIconColor: { default: "#909399" },
|
|
1315
|
+
background: { default: "#fff" }
|
|
1316
|
+
}, {
|
|
1317
|
+
"modelValue": {
|
|
1318
|
+
type: Boolean,
|
|
1319
|
+
default: false
|
|
1320
|
+
},
|
|
1321
|
+
"modelModifiers": {}
|
|
1322
|
+
}),
|
|
1323
|
+
emits: /* @__PURE__ */ mergeModels(["confirm", "cancel", "close"], ["update:modelValue"]),
|
|
1324
|
+
setup(__props, { emit: __emit }) {
|
|
1325
|
+
const ns = useNamespace("dialog");
|
|
1326
|
+
const props = __props;
|
|
1327
|
+
const emits = __emit;
|
|
1328
|
+
const showDialog = useModel(__props, "modelValue");
|
|
1329
|
+
const dialogStyle = computed(() => {
|
|
1330
|
+
const { borderRadius, closeIconSize, closeIconColor, background } = props;
|
|
1331
|
+
return ns.cssBlockVar("dialog", {
|
|
1332
|
+
"border-radius": addUnit(borderRadius),
|
|
1333
|
+
"close-icon-size": addUnit(closeIconSize),
|
|
1334
|
+
"close-icon-color": closeIconColor,
|
|
1335
|
+
"background": background
|
|
1336
|
+
});
|
|
1337
|
+
});
|
|
1338
|
+
const cancel = useThrottleFn(() => {
|
|
1339
|
+
const { closeOnCancelButton } = props;
|
|
1340
|
+
closeOnCancelButton ? showDialog.value = false : emits("cancel");
|
|
1341
|
+
}, 500);
|
|
1342
|
+
const confirm = useThrottleFn(() => {
|
|
1343
|
+
emits("confirm");
|
|
1344
|
+
}, 500);
|
|
1345
|
+
const onClickCloseIcon = () => {
|
|
1346
|
+
const { closeOnClickCloseIcon } = props;
|
|
1347
|
+
closeOnClickCloseIcon ? showDialog.value = false : emits("close");
|
|
1348
|
+
};
|
|
1349
|
+
return (_ctx, _cache) => {
|
|
1350
|
+
return openBlock(), createBlock(unref(ElDialog), mergeProps({
|
|
1351
|
+
modelValue: showDialog.value,
|
|
1352
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showDialog.value = $event),
|
|
1353
|
+
"show-close": false,
|
|
1354
|
+
top: unref(addUnit)(__props.top),
|
|
1355
|
+
class: [
|
|
1356
|
+
unref(ns).b()
|
|
1357
|
+
],
|
|
1358
|
+
style: [dialogStyle.value],
|
|
1359
|
+
"close-on-click-modal": __props.closeOnClickModal,
|
|
1360
|
+
"close-on-press-escape": __props.closeOnPressEscape,
|
|
1361
|
+
"z-index": __props.zIndex,
|
|
1362
|
+
fullscreen: __props.fullscreen,
|
|
1363
|
+
"append-to": __props.appendTo,
|
|
1364
|
+
width: __props.width
|
|
1365
|
+
}, _ctx.$attrs), {
|
|
1366
|
+
default: withCtx(() => [
|
|
1367
|
+
_ctx.$slots.header || __props.title ? (openBlock(), createElementBlock("div", {
|
|
1368
|
+
key: 0,
|
|
1369
|
+
class: normalizeClass([unref(ns).e("header")])
|
|
1370
|
+
}, [
|
|
1371
|
+
__props.title ? (openBlock(), createElementBlock("div", {
|
|
1372
|
+
key: 0,
|
|
1373
|
+
class: normalizeClass([unref(ns).e("title")])
|
|
1374
|
+
}, toDisplayString(__props.title), 3)) : createCommentVNode("", true),
|
|
1375
|
+
renderSlot(_ctx.$slots, "header")
|
|
1376
|
+
], 2)) : createCommentVNode("", true),
|
|
1377
|
+
__props.showClose ? (openBlock(), createElementBlock("div", {
|
|
1378
|
+
key: 1,
|
|
1379
|
+
class: normalizeClass([unref(ns).e("close")])
|
|
1380
|
+
}, [
|
|
1381
|
+
createVNode(unref(ElIcon), {
|
|
1382
|
+
class: normalizeClass([unref(ns).em("close", "icon")]),
|
|
1383
|
+
onClick: onClickCloseIcon
|
|
1384
|
+
}, {
|
|
1385
|
+
default: withCtx(() => [
|
|
1386
|
+
createVNode(unref(Close))
|
|
1387
|
+
]),
|
|
1388
|
+
_: 1
|
|
1389
|
+
}, 8, ["class"])
|
|
1390
|
+
], 2)) : createCommentVNode("", true),
|
|
1391
|
+
createElementVNode("div", {
|
|
1392
|
+
class: normalizeClass([unref(ns).e("body")])
|
|
1393
|
+
}, [
|
|
1394
|
+
__props.maxHeight || __props.height ? (openBlock(), createBlock(unref(ElScrollbar), {
|
|
1395
|
+
key: 0,
|
|
1396
|
+
"max-height": __props.maxHeight ? unref(addUnit)(__props.maxHeight) : void 0,
|
|
1397
|
+
height: __props.height ? unref(addUnit)(__props.height) : void 0
|
|
1398
|
+
}, {
|
|
1399
|
+
default: withCtx(() => [
|
|
1400
|
+
renderSlot(_ctx.$slots, "default")
|
|
1401
|
+
]),
|
|
1402
|
+
_: 3
|
|
1403
|
+
}, 8, ["max-height", "height"])) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
1404
|
+
], 2),
|
|
1405
|
+
__props.showButton && (__props.showCancelButton || __props.showConfirmButton) || _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
1406
|
+
key: 2,
|
|
1407
|
+
class: normalizeClass([unref(ns).e("footer")])
|
|
1408
|
+
}, [
|
|
1409
|
+
renderSlot(_ctx.$slots, "footer"),
|
|
1410
|
+
__props.showButton ? (openBlock(), createElementBlock("div", {
|
|
1411
|
+
key: 0,
|
|
1412
|
+
class: normalizeClass([unref(ns).e("button")])
|
|
1413
|
+
}, [
|
|
1414
|
+
__props.showCancelButton ? (openBlock(), createBlock(unref(ElButton), {
|
|
1415
|
+
key: 0,
|
|
1416
|
+
size: __props.cancelButtonSize,
|
|
1417
|
+
type: __props.cancelButtonType,
|
|
1418
|
+
class: normalizeClass([unref(ns).em("button", "cancel")]),
|
|
1419
|
+
onClick: unref(cancel)
|
|
1420
|
+
}, {
|
|
1421
|
+
default: withCtx(() => [
|
|
1422
|
+
createTextVNode(toDisplayString(__props.cancelButtonText), 1)
|
|
1423
|
+
]),
|
|
1424
|
+
_: 1
|
|
1425
|
+
}, 8, ["size", "type", "class", "onClick"])) : createCommentVNode("", true),
|
|
1426
|
+
__props.showConfirmButton ? (openBlock(), createBlock(unref(ElButton), {
|
|
1427
|
+
key: 1,
|
|
1428
|
+
size: __props.confirmButtonSize,
|
|
1429
|
+
type: __props.confirmButtonType,
|
|
1430
|
+
loading: __props.confirmLoading,
|
|
1431
|
+
class: normalizeClass([unref(ns).em("button", "confirm")]),
|
|
1432
|
+
onClick: unref(confirm)
|
|
1433
|
+
}, {
|
|
1434
|
+
default: withCtx(() => [
|
|
1435
|
+
createTextVNode(toDisplayString(__props.confirmButtonText), 1)
|
|
1436
|
+
]),
|
|
1437
|
+
_: 1
|
|
1438
|
+
}, 8, ["size", "type", "loading", "class", "onClick"])) : createCommentVNode("", true)
|
|
1439
|
+
], 2)) : createCommentVNode("", true)
|
|
1440
|
+
], 2)) : createCommentVNode("", true)
|
|
1441
|
+
]),
|
|
1442
|
+
_: 3
|
|
1443
|
+
}, 16, ["modelValue", "top", "class", "style", "close-on-click-modal", "close-on-press-escape", "z-index", "fullscreen", "append-to", "width"]);
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1448
|
+
...{
|
|
1449
|
+
name: "SakuraDrawer"
|
|
1450
|
+
},
|
|
1451
|
+
__name: "drawer",
|
|
1452
|
+
props: /* @__PURE__ */ mergeModels({
|
|
1453
|
+
width: { default: "40vw" },
|
|
1454
|
+
title: {},
|
|
1455
|
+
borderRadius: { default: 4 },
|
|
1456
|
+
showClose: { type: Boolean, default: true },
|
|
1457
|
+
top: { default: "15vh" },
|
|
1458
|
+
showConfirmButton: { type: Boolean, default: true },
|
|
1459
|
+
confirmButtonText: { default: "确定" },
|
|
1460
|
+
confirmButtonType: { default: "primary" },
|
|
1461
|
+
confirmButtonSize: { default: "default" },
|
|
1462
|
+
confirmLoading: { type: Boolean },
|
|
1463
|
+
showCancelButton: { type: Boolean, default: true },
|
|
1464
|
+
cancelButtonText: { default: "取消" },
|
|
1465
|
+
cancelButtonType: { default: "" },
|
|
1466
|
+
cancelButtonSize: { default: "default" },
|
|
1467
|
+
showButton: { type: Boolean, default: true },
|
|
1468
|
+
zIndex: {},
|
|
1469
|
+
closeOnClickModal: { type: Boolean, default: false },
|
|
1470
|
+
closeOnPressEscape: { type: Boolean, default: true },
|
|
1471
|
+
closeOnCancelButton: { type: Boolean, default: true },
|
|
1472
|
+
closeOnClickCloseIcon: { type: Boolean, default: true },
|
|
1473
|
+
fullscreen: { type: Boolean, default: false },
|
|
1474
|
+
appendTo: {},
|
|
1475
|
+
closeIconSize: { default: 16 },
|
|
1476
|
+
closeIconColor: { default: "#909399" },
|
|
1477
|
+
background: { default: "#fff" },
|
|
1478
|
+
direction: { default: "rtl" }
|
|
1479
|
+
}, {
|
|
1480
|
+
"modelValue": {
|
|
1481
|
+
type: Boolean,
|
|
1482
|
+
default: false
|
|
1483
|
+
},
|
|
1484
|
+
"modelModifiers": {}
|
|
1485
|
+
}),
|
|
1486
|
+
emits: /* @__PURE__ */ mergeModels(["confirm", "cancel", "close"], ["update:modelValue"]),
|
|
1487
|
+
setup(__props, { emit: __emit }) {
|
|
1488
|
+
const ns = useNamespace("drawer");
|
|
1489
|
+
const props = __props;
|
|
1490
|
+
const emits = __emit;
|
|
1491
|
+
const showDrawer = useModel(__props, "modelValue");
|
|
1492
|
+
const drawerStyle = computed(() => {
|
|
1493
|
+
const { borderRadius, closeIconSize, closeIconColor, background } = props;
|
|
1494
|
+
return ns.cssBlockVar("drawer", {
|
|
1495
|
+
"border-radius": addUnit(borderRadius),
|
|
1496
|
+
"close-icon-size": addUnit(closeIconSize),
|
|
1497
|
+
"close-icon-color": closeIconColor,
|
|
1498
|
+
"background": background
|
|
1499
|
+
});
|
|
1500
|
+
});
|
|
1501
|
+
const cancel = useThrottleFn(() => {
|
|
1502
|
+
const { closeOnCancelButton } = props;
|
|
1503
|
+
closeOnCancelButton ? showDrawer.value = false : emits("cancel");
|
|
1504
|
+
}, 500);
|
|
1505
|
+
const confirm = useThrottleFn(() => {
|
|
1506
|
+
emits("confirm");
|
|
1507
|
+
}, 500);
|
|
1508
|
+
const onClickCloseIcon = () => {
|
|
1509
|
+
const { closeOnClickCloseIcon } = props;
|
|
1510
|
+
closeOnClickCloseIcon ? showDrawer.value = false : emits("close");
|
|
1511
|
+
};
|
|
1512
|
+
return (_ctx, _cache) => {
|
|
1513
|
+
return openBlock(), createBlock(unref(ElDrawer), mergeProps({
|
|
1514
|
+
modelValue: showDrawer.value,
|
|
1515
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showDrawer.value = $event),
|
|
1516
|
+
class: [unref(ns).b()],
|
|
1517
|
+
"show-close": false,
|
|
1518
|
+
top: unref(addUnit)(__props.top),
|
|
1519
|
+
style: [drawerStyle.value],
|
|
1520
|
+
"close-on-click-modal": __props.closeOnClickModal,
|
|
1521
|
+
"close-on-press-escape": __props.closeOnPressEscape,
|
|
1522
|
+
"z-index": __props.zIndex,
|
|
1523
|
+
fullscreen: __props.fullscreen,
|
|
1524
|
+
"append-to": __props.appendTo,
|
|
1525
|
+
size: __props.width,
|
|
1526
|
+
direction: __props.direction
|
|
1527
|
+
}, _ctx.$attrs), {
|
|
1528
|
+
default: withCtx(() => [
|
|
1529
|
+
_ctx.$slots.header || __props.title ? (openBlock(), createElementBlock("div", {
|
|
1530
|
+
key: 0,
|
|
1531
|
+
class: normalizeClass([unref(ns).e("header")])
|
|
1532
|
+
}, [
|
|
1533
|
+
__props.title ? (openBlock(), createElementBlock("div", {
|
|
1534
|
+
key: 0,
|
|
1535
|
+
class: normalizeClass([unref(ns).e("title")])
|
|
1536
|
+
}, toDisplayString(__props.title), 3)) : createCommentVNode("", true),
|
|
1537
|
+
renderSlot(_ctx.$slots, "header")
|
|
1538
|
+
], 2)) : createCommentVNode("", true),
|
|
1539
|
+
__props.showClose ? (openBlock(), createElementBlock("div", {
|
|
1540
|
+
key: 1,
|
|
1541
|
+
class: normalizeClass([unref(ns).e("close")])
|
|
1542
|
+
}, [
|
|
1543
|
+
createVNode(unref(ElIcon), {
|
|
1544
|
+
class: normalizeClass([unref(ns).em("close", "icon")]),
|
|
1545
|
+
onClick: onClickCloseIcon
|
|
1546
|
+
}, {
|
|
1547
|
+
default: withCtx(() => [
|
|
1548
|
+
createVNode(unref(Close))
|
|
1549
|
+
]),
|
|
1550
|
+
_: 1
|
|
1551
|
+
}, 8, ["class"])
|
|
1552
|
+
], 2)) : createCommentVNode("", true),
|
|
1553
|
+
createElementVNode("div", {
|
|
1554
|
+
class: normalizeClass([unref(ns).e("body")])
|
|
1555
|
+
}, [
|
|
1556
|
+
createVNode(unref(ElScrollbar), { height: "100%" }, {
|
|
1557
|
+
default: withCtx(() => [
|
|
1558
|
+
renderSlot(_ctx.$slots, "default")
|
|
1559
|
+
]),
|
|
1560
|
+
_: 3
|
|
1561
|
+
})
|
|
1562
|
+
], 2),
|
|
1563
|
+
__props.showButton && (__props.showCancelButton || __props.showConfirmButton) || _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
1564
|
+
key: 2,
|
|
1565
|
+
class: normalizeClass([unref(ns).e("footer")])
|
|
1566
|
+
}, [
|
|
1567
|
+
renderSlot(_ctx.$slots, "footer"),
|
|
1568
|
+
__props.showButton ? (openBlock(), createElementBlock("div", {
|
|
1569
|
+
key: 0,
|
|
1570
|
+
class: normalizeClass([unref(ns).e("button")])
|
|
1571
|
+
}, [
|
|
1572
|
+
__props.showCancelButton ? (openBlock(), createBlock(unref(ElButton), {
|
|
1573
|
+
key: 0,
|
|
1574
|
+
size: __props.cancelButtonSize,
|
|
1575
|
+
type: __props.cancelButtonType,
|
|
1576
|
+
class: normalizeClass([unref(ns).em("button", "cancel")]),
|
|
1577
|
+
onClick: unref(cancel)
|
|
1578
|
+
}, {
|
|
1579
|
+
default: withCtx(() => [
|
|
1580
|
+
createTextVNode(toDisplayString(__props.cancelButtonText), 1)
|
|
1581
|
+
]),
|
|
1582
|
+
_: 1
|
|
1583
|
+
}, 8, ["size", "type", "class", "onClick"])) : createCommentVNode("", true),
|
|
1584
|
+
__props.showConfirmButton ? (openBlock(), createBlock(unref(ElButton), {
|
|
1585
|
+
key: 1,
|
|
1586
|
+
size: __props.confirmButtonSize,
|
|
1587
|
+
type: __props.confirmButtonType,
|
|
1588
|
+
loading: __props.confirmLoading,
|
|
1589
|
+
class: normalizeClass([unref(ns).em("button", "confirm")]),
|
|
1590
|
+
onClick: unref(confirm)
|
|
1591
|
+
}, {
|
|
1592
|
+
default: withCtx(() => [
|
|
1593
|
+
createTextVNode(toDisplayString(__props.confirmButtonText), 1)
|
|
1594
|
+
]),
|
|
1595
|
+
_: 1
|
|
1596
|
+
}, 8, ["size", "type", "loading", "class", "onClick"])) : createCommentVNode("", true)
|
|
1597
|
+
], 2)) : createCommentVNode("", true)
|
|
1598
|
+
], 2)) : createCommentVNode("", true)
|
|
1599
|
+
]),
|
|
1600
|
+
_: 3
|
|
1601
|
+
}, 16, ["modelValue", "class", "top", "style", "close-on-click-modal", "close-on-press-escape", "z-index", "fullscreen", "append-to", "size", "direction"]);
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1604
|
+
});
|
|
1605
|
+
const DANGEROUS_TAGS = /* @__PURE__ */ new Set(["script", "iframe", "link", "style", "meta"]);
|
|
1606
|
+
const validateHtmlString = (html) => {
|
|
1607
|
+
if (!html.trim())
|
|
1608
|
+
return false;
|
|
1609
|
+
try {
|
|
1610
|
+
const parser = new DOMParser();
|
|
1611
|
+
const doc = parser.parseFromString(html, "text/html");
|
|
1612
|
+
const parserError = doc.querySelector("parsererror");
|
|
1613
|
+
if (parserError)
|
|
1614
|
+
return false;
|
|
1615
|
+
const rootNodes = Array.from(doc.body.children);
|
|
1616
|
+
if (rootNodes.length === 0)
|
|
1617
|
+
return false;
|
|
1618
|
+
return rootNodes.every((node) => {
|
|
1619
|
+
const tagName = node.tagName.toLowerCase();
|
|
1620
|
+
if (DANGEROUS_TAGS.has(tagName))
|
|
1621
|
+
return false;
|
|
1622
|
+
return document.createElement(tagName).tagName !== "UNKNOWN";
|
|
1623
|
+
});
|
|
1624
|
+
} catch (e) {
|
|
1625
|
+
return false;
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
const _hoisted_1 = ["innerHTML"];
|
|
1629
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1630
|
+
...{
|
|
1631
|
+
name: "SakuraShowModal"
|
|
1632
|
+
},
|
|
1633
|
+
__name: "show-modal",
|
|
1634
|
+
props: /* @__PURE__ */ mergeModels({
|
|
1635
|
+
width: {},
|
|
1636
|
+
showConfirmButton: { type: Boolean },
|
|
1637
|
+
showCancelButton: { type: Boolean },
|
|
1638
|
+
cancelButtonText: {},
|
|
1639
|
+
confirmButtonText: {},
|
|
1640
|
+
showClose: { type: Boolean },
|
|
1641
|
+
title: {},
|
|
1642
|
+
content: { type: [String, Object, Function] },
|
|
1643
|
+
resolve: { type: Function }
|
|
1644
|
+
}, {
|
|
1645
|
+
"modelValue": {
|
|
1646
|
+
type: Boolean,
|
|
1647
|
+
default: false
|
|
1648
|
+
},
|
|
1649
|
+
"modelModifiers": {}
|
|
1650
|
+
}),
|
|
1651
|
+
emits: ["update:modelValue"],
|
|
1652
|
+
setup(__props, { expose: __expose }) {
|
|
1653
|
+
const ns = useNamespace("show-modal");
|
|
1654
|
+
const getDefaultValue = () => {
|
|
1655
|
+
return {
|
|
1656
|
+
width: 440,
|
|
1657
|
+
title: "提示",
|
|
1658
|
+
content: "",
|
|
1659
|
+
showClose: true,
|
|
1660
|
+
showCancelButton: false,
|
|
1661
|
+
showConfirmButton: true,
|
|
1662
|
+
confirmButtonText: "确定",
|
|
1663
|
+
cancelButtonText: "取消"
|
|
1664
|
+
};
|
|
1665
|
+
};
|
|
1666
|
+
const props = __props;
|
|
1667
|
+
const state = reactive({});
|
|
1668
|
+
const filterPropsEmptyValue = () => {
|
|
1669
|
+
return keysOf(props).reduce((data, key) => {
|
|
1670
|
+
if (!isEmpty(props[key])) {
|
|
1671
|
+
data[key] = props[key];
|
|
1672
|
+
}
|
|
1673
|
+
return data;
|
|
1674
|
+
}, {});
|
|
1675
|
+
};
|
|
1676
|
+
const initState = () => {
|
|
1677
|
+
extend(state, getDefaultValue(), filterPropsEmptyValue());
|
|
1678
|
+
};
|
|
1679
|
+
onMounted(initState);
|
|
1680
|
+
const isHtmlDom = computed(() => {
|
|
1681
|
+
const { content } = state;
|
|
1682
|
+
if (isFunction(content)) {
|
|
1683
|
+
return validateHtmlString(content());
|
|
1684
|
+
}
|
|
1685
|
+
if (isString(content)) {
|
|
1686
|
+
return validateHtmlString(content);
|
|
1687
|
+
}
|
|
1688
|
+
return false;
|
|
1689
|
+
});
|
|
1690
|
+
const htmlDomContent = computed(() => {
|
|
1691
|
+
const { content } = state;
|
|
1692
|
+
if (isFunction(content)) {
|
|
1693
|
+
return DOMPurify.sanitize(content());
|
|
1694
|
+
}
|
|
1695
|
+
if (isString(content)) {
|
|
1696
|
+
return DOMPurify.sanitize(content);
|
|
1697
|
+
}
|
|
1698
|
+
return "";
|
|
1699
|
+
});
|
|
1700
|
+
const _content = computed(() => {
|
|
1701
|
+
const { content } = state;
|
|
1702
|
+
if (isFunction(content)) {
|
|
1703
|
+
return content();
|
|
1704
|
+
}
|
|
1705
|
+
if (isString(content)) {
|
|
1706
|
+
return content;
|
|
1707
|
+
}
|
|
1708
|
+
return "";
|
|
1709
|
+
});
|
|
1710
|
+
const visible = useModel(__props, "modelValue");
|
|
1711
|
+
const handleVisible = () => {
|
|
1712
|
+
visible.value = !visible.value;
|
|
1713
|
+
};
|
|
1714
|
+
const callbackTrigger = useCallbackTrigger();
|
|
1715
|
+
const visibleShowModal = useThrottleFn((content = "", title = "提示", showCancelButton = false, params = {}) => {
|
|
1716
|
+
return new Promise((resolve) => {
|
|
1717
|
+
extend(state, getDefaultValue(), {
|
|
1718
|
+
content,
|
|
1719
|
+
title,
|
|
1720
|
+
showCancelButton,
|
|
1721
|
+
...params
|
|
1722
|
+
});
|
|
1723
|
+
callbackTrigger.track(params.resolve || resolve);
|
|
1724
|
+
visible.value = true;
|
|
1725
|
+
});
|
|
1726
|
+
}, 500);
|
|
1727
|
+
const confirmButton = () => {
|
|
1728
|
+
callbackTrigger.trigger(true);
|
|
1729
|
+
closeButton();
|
|
1730
|
+
};
|
|
1731
|
+
const cancelButton = () => {
|
|
1732
|
+
callbackTrigger.trigger(false);
|
|
1733
|
+
closeButton();
|
|
1734
|
+
};
|
|
1735
|
+
const closeButton = () => {
|
|
1736
|
+
callbackTrigger.clear();
|
|
1737
|
+
handleVisible();
|
|
1738
|
+
};
|
|
1739
|
+
__expose({
|
|
1740
|
+
visibleShowModal
|
|
1741
|
+
});
|
|
1742
|
+
return (_ctx, _cache) => {
|
|
1743
|
+
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
1744
|
+
modelValue: visible.value,
|
|
1745
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
1746
|
+
class: normalizeClass([unref(ns).b()]),
|
|
1747
|
+
width: state.width,
|
|
1748
|
+
title: state.title,
|
|
1749
|
+
"show-cancel-button": state.showCancelButton,
|
|
1750
|
+
"close-on-click-close-icon": false,
|
|
1751
|
+
"close-on-cancel-button": false,
|
|
1752
|
+
"show-close": state.showClose,
|
|
1753
|
+
"cancel-button-text": state.cancelButtonText,
|
|
1754
|
+
"confirm-button-text": state.confirmButtonText,
|
|
1755
|
+
onClose: closeButton,
|
|
1756
|
+
onCancel: cancelButton,
|
|
1757
|
+
onConfirm: confirmButton
|
|
1758
|
+
}, {
|
|
1759
|
+
default: withCtx(() => [
|
|
1760
|
+
isHtmlDom.value ? (openBlock(), createElementBlock("div", {
|
|
1761
|
+
key: 0,
|
|
1762
|
+
class: normalizeClass([unref(ns).e("content")]),
|
|
1763
|
+
innerHTML: htmlDomContent.value
|
|
1764
|
+
}, null, 10, _hoisted_1)) : (openBlock(), createElementBlock("div", {
|
|
1765
|
+
key: 1,
|
|
1766
|
+
class: normalizeClass([unref(ns).e("content")])
|
|
1767
|
+
}, [
|
|
1768
|
+
unref(isString)(state.content) || unref(isFunction)(state.content) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1769
|
+
createTextVNode(toDisplayString(_content.value), 1)
|
|
1770
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(state.content), { key: 1 }))
|
|
1771
|
+
], 2))
|
|
1772
|
+
]),
|
|
1773
|
+
_: 1
|
|
1774
|
+
}, 8, ["modelValue", "class", "width", "title", "show-cancel-button", "show-close", "cancel-button-text", "confirm-button-text"]);
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
});
|
|
1778
|
+
const components = {
|
|
1779
|
+
Select: _sfc_main$g,
|
|
1780
|
+
Cell: _sfc_main$f,
|
|
1781
|
+
CellGroup: _sfc_main$e,
|
|
1782
|
+
Status: _sfc_main$d,
|
|
1783
|
+
Container: _sfc_main$c,
|
|
1784
|
+
Pagination: _sfc_main$b,
|
|
1785
|
+
SearchInput: _sfc_main$a,
|
|
1786
|
+
FilterItem: _sfc_main$9,
|
|
1787
|
+
FilterGroup: _sfc_main$8,
|
|
1788
|
+
Tabs: _sfc_main$7,
|
|
1789
|
+
TooltipText: _sfc_main$6,
|
|
1790
|
+
FileItem: _sfc_main$5,
|
|
1791
|
+
FileList: _sfc_main$4,
|
|
1792
|
+
CountDown: _sfc_main$3,
|
|
1793
|
+
Dialog: _sfc_main$2,
|
|
1794
|
+
Drawer: _sfc_main$1,
|
|
1795
|
+
ShowModal: _sfc_main
|
|
1796
|
+
};
|
|
1797
|
+
const ShowModalInstall = {
|
|
1798
|
+
install(vm) {
|
|
1799
|
+
const vnode = createVNode(_sfc_main);
|
|
1800
|
+
checkElementIsExist("u-show-modal");
|
|
1801
|
+
render(vnode, document.querySelector("#u-show-modal"));
|
|
1802
|
+
vm.config.globalProperties.$showModal = (content, title = "提示", showCancelButton = false, params) => {
|
|
1803
|
+
return new Promise((resolve) => {
|
|
1804
|
+
var _a, _b;
|
|
1805
|
+
const _params = extend({}, params ?? {}, {
|
|
1806
|
+
resolve
|
|
1807
|
+
});
|
|
1808
|
+
((_a = vnode.component) == null ? void 0 : _a.exposed) && ((_b = vnode.component) == null ? void 0 : _b.exposed.visibleShowModal(content, title, showCancelButton, _params));
|
|
1809
|
+
});
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
};
|
|
1813
|
+
function install(vm) {
|
|
1814
|
+
Object.values(components).forEach((component) => {
|
|
1815
|
+
vm.component(component.name, component);
|
|
1816
|
+
});
|
|
1817
|
+
vm.use(ShowModalInstall);
|
|
1818
|
+
}
|
|
1819
|
+
const index = "";
|
|
1820
|
+
const SakuraUiPlus = {
|
|
1821
|
+
install
|
|
1822
|
+
};
|
|
1823
|
+
export {
|
|
1824
|
+
_sfc_main$f as Cell,
|
|
1825
|
+
_sfc_main$e as CellGroup,
|
|
1826
|
+
_sfc_main$c as Container,
|
|
1827
|
+
_sfc_main$3 as CountDown,
|
|
1828
|
+
_sfc_main$2 as Dialog,
|
|
1829
|
+
_sfc_main$1 as Drawer,
|
|
1830
|
+
EVENT_NAME,
|
|
1831
|
+
_sfc_main$5 as FileItem,
|
|
1832
|
+
_sfc_main$4 as FileList,
|
|
1833
|
+
_sfc_main$8 as FilterGroup,
|
|
1834
|
+
_sfc_main$9 as FilterItem,
|
|
1835
|
+
_sfc_main$b as Pagination,
|
|
1836
|
+
_sfc_main$a as SearchInput,
|
|
1837
|
+
_sfc_main$g as Select,
|
|
1838
|
+
_sfc_main as ShowModal,
|
|
1839
|
+
_sfc_main$d as Status,
|
|
1840
|
+
_sfc_main$7 as Tabs,
|
|
1841
|
+
_sfc_main$6 as TooltipText,
|
|
1842
|
+
checkElementIsExist,
|
|
1843
|
+
SakuraUiPlus as default,
|
|
1844
|
+
defaultNamespace,
|
|
1845
|
+
useCallbackTrigger,
|
|
1846
|
+
useLoading,
|
|
1847
|
+
useMessage,
|
|
1848
|
+
useMessageBox,
|
|
1849
|
+
useNamespace,
|
|
1850
|
+
useNotification,
|
|
1851
|
+
useShowModal
|
|
1852
|
+
};
|