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