@squirrel-cloud/ui-vue 0.4.32 → 0.4.34
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/index.js +4404 -0
- package/dist/index.umd.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/{components → types/components}/article/article.d.ts +1 -1
- package/dist/{components → types/components}/button/injection-keys.d.ts +1 -1
- package/dist/{components → types/components}/checkbox/checkbox-group.d.ts +2 -1
- package/dist/{components → types/components}/checkbox/injection-keys.d.ts +1 -1
- package/dist/{components → types/components}/editor/editor.d.ts +29 -21
- package/dist/{components → types/components}/form/form.d.ts +4 -4
- package/dist/{components → types/components}/form/injection-keys.d.ts +1 -1
- package/dist/{components → types/components}/image/image-viewer.d.ts +3 -1
- package/dist/{components → types/components}/image/image.d.ts +1 -0
- package/dist/{components → types/components}/image-crop/image-crop.d.ts +2 -1
- package/dist/{components → types/components}/index.d.ts +1 -0
- package/dist/{components → types/components}/input/input.d.ts +2 -0
- package/dist/{components → types/components}/menu/menu.d.ts +1 -1
- package/dist/{components → types/components}/message/index.d.ts +1 -1
- package/dist/{components → types/components}/message-box/index.d.ts +1 -1
- package/dist/{components → types/components}/radio/injection-keys.d.ts +1 -1
- package/dist/{components → types/components}/radio/radio-group.d.ts +2 -1
- package/dist/{components → types/components}/segmented/injection-keys.d.ts +1 -1
- package/dist/{components → types/components}/segmented/segmented.d.ts +10 -6
- package/dist/{components → types/components}/select/index.d.ts +1 -0
- package/dist/types/components/select/injection-keys.d.ts +6 -0
- package/dist/types/components/select/select-item.d.ts +2 -0
- package/dist/{components → types/components}/select/select.d.ts +15 -11
- package/dist/types/components/swipe/index.d.ts +2 -0
- package/dist/types/components/swipe/swipe.d.ts +38 -0
- package/dist/types/custom/MenuItem.d.ts +12 -0
- package/dist/types/custom/Point.d.ts +14 -0
- package/dist/types/custom/SegmentedItem.d.ts +12 -0
- package/dist/types/custom/SelectItem.d.ts +6 -0
- package/dist/types/custom/contexts/SelectContext.d.ts +14 -0
- package/dist/{typings → types/custom}/contexts/index.d.ts +1 -0
- package/dist/{typings → types/custom}/index.d.ts +4 -0
- package/dist/types/custom/interface/IListItem.d.ts +20 -0
- package/dist/types/custom/interface/index.d.ts +1 -0
- package/dist/{index.d.ts → types/index.d.ts} +1 -1
- package/dist/{props → types/props}/alert/alert.d.ts +1 -1
- package/dist/{props → types/props}/avatar/avatar.d.ts +3 -3
- package/dist/{props → types/props}/badge/badge.d.ts +1 -1
- package/dist/{props → types/props}/button/button.d.ts +1 -1
- package/dist/{props → types/props}/checkbox/checkbox-group.d.ts +2 -1
- package/dist/{props → types/props}/checkbox/checkbox.d.ts +1 -1
- package/dist/{props → types/props}/dialog/dialog.d.ts +1 -1
- package/dist/{props → types/props}/divider/divider.d.ts +1 -1
- package/dist/{props → types/props}/editor/editor.d.ts +1 -1
- package/dist/{props → types/props}/form/form.d.ts +1 -1
- package/dist/{props → types/props}/image/image.d.ts +2 -2
- package/dist/{props → types/props}/image-crop/image-crop.d.ts +4 -0
- package/dist/{props → types/props}/index.d.ts +1 -0
- package/dist/{props → types/props}/input/input.d.ts +1 -1
- package/dist/{props → types/props}/mask/mask.d.ts +1 -1
- package/dist/{props → types/props}/menu/menu.d.ts +1 -1
- package/dist/{props → types/props}/message/message.d.ts +1 -1
- package/dist/{props → types/props}/pagination/pagination-btn.d.ts +1 -1
- package/dist/{props → types/props}/pagination/pagination-pager.d.ts +1 -1
- package/dist/{props → types/props}/pagination/pagination-total.d.ts +1 -1
- package/dist/{props → types/props}/pagination/pagination.d.ts +1 -1
- package/dist/{props → types/props}/popover/popover.d.ts +1 -1
- package/dist/{props → types/props}/progress/progress.d.ts +1 -1
- package/dist/{props → types/props}/radio/radio-group.d.ts +2 -1
- package/dist/{props → types/props}/radio/radio.d.ts +1 -1
- package/dist/types/props/segmented/segmented-item.d.ts +11 -0
- package/dist/{props → types/props}/segmented/segmented.d.ts +1 -5
- package/dist/types/props/select/select-item.d.ts +5 -0
- package/dist/{props → types/props}/select/select.d.ts +1 -1
- package/dist/types/props/swipe/index.d.ts +1 -0
- package/dist/types/props/swipe/swipe.d.ts +30 -0
- package/dist/{props → types/props}/switch/switch.d.ts +1 -1
- package/dist/{props → types/props}/table/table.d.ts +1 -1
- package/dist/{props → types/props}/tag/tag.d.ts +1 -1
- package/dist/{props → types/props}/text/text.d.ts +1 -1
- package/dist/{props → types/props}/timeline/timeline-item.d.ts +1 -1
- package/dist/{props → types/props}/timeline/timeline.d.ts +1 -1
- package/dist/{props → types/props}/tooltip/tooltip.d.ts +1 -1
- package/package.json +9 -9
- package/dist/props/segmented/segmented-item.d.ts +0 -22
- package/dist/squirrel-cloud-ui-vue.js +0 -4119
- package/dist/squirrel-cloud-ui-vue.umd.cjs +0 -9
- package/dist/typings/MenuItem.d.ts +0 -26
- package/dist/typings/SegmentedItem.d.ts +0 -21
- package/dist/typings/SelectItem.d.ts +0 -14
- /package/dist/{components → types/components}/alert/alert.d.ts +0 -0
- /package/dist/{components → types/components}/alert/index.d.ts +0 -0
- /package/dist/{components → types/components}/article/index.d.ts +0 -0
- /package/dist/{components → types/components}/avatar/avatar.d.ts +0 -0
- /package/dist/{components → types/components}/avatar/index.d.ts +0 -0
- /package/dist/{components → types/components}/backtop/backtop.d.ts +0 -0
- /package/dist/{components → types/components}/backtop/index.d.ts +0 -0
- /package/dist/{components → types/components}/badge/badge.d.ts +0 -0
- /package/dist/{components → types/components}/badge/index.d.ts +0 -0
- /package/dist/{components → types/components}/blur/blur.d.ts +0 -0
- /package/dist/{components → types/components}/blur/index.d.ts +0 -0
- /package/dist/{components → types/components}/button/button-group.d.ts +0 -0
- /package/dist/{components → types/components}/button/button.d.ts +0 -0
- /package/dist/{components → types/components}/button/index.d.ts +0 -0
- /package/dist/{components → types/components}/card/card.d.ts +0 -0
- /package/dist/{components → types/components}/card/index.d.ts +0 -0
- /package/dist/{components → types/components}/checkbox/checkbox.d.ts +0 -0
- /package/dist/{components → types/components}/checkbox/index.d.ts +0 -0
- /package/dist/{components → types/components}/code/code.d.ts +0 -0
- /package/dist/{components → types/components}/code/index.d.ts +0 -0
- /package/dist/{components → types/components}/dialog/dialog.d.ts +0 -0
- /package/dist/{components → types/components}/dialog/index.d.ts +0 -0
- /package/dist/{components → types/components}/divider/divider.d.ts +0 -0
- /package/dist/{components → types/components}/divider/index.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-blur.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-bold.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-italic.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-ol.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-strikethrough.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-ul.d.ts +0 -0
- /package/dist/{components → types/components}/editor/editor-underline.d.ts +0 -0
- /package/dist/{components → types/components}/editor/index.d.ts +0 -0
- /package/dist/{components → types/components}/form/form-item.d.ts +0 -0
- /package/dist/{components → types/components}/form/index.d.ts +0 -0
- /package/dist/{components → types/components}/image/index.d.ts +0 -0
- /package/dist/{components → types/components}/image-crop/index.d.ts +0 -0
- /package/dist/{components → types/components}/input/index.d.ts +0 -0
- /package/dist/{components → types/components}/mask/index.d.ts +0 -0
- /package/dist/{components → types/components}/mask/mask.d.ts +0 -0
- /package/dist/{components → types/components}/menu/index.d.ts +0 -0
- /package/dist/{components → types/components}/message/message.d.ts +0 -0
- /package/dist/{components → types/components}/message-box/message-box.d.ts +0 -0
- /package/dist/{components → types/components}/only-child/index.d.ts +0 -0
- /package/dist/{components → types/components}/only-child/only-child.d.ts +0 -0
- /package/dist/{components → types/components}/pagination/index.d.ts +0 -0
- /package/dist/{components → types/components}/pagination/pagination-next.d.ts +0 -0
- /package/dist/{components → types/components}/pagination/pagination-pager.d.ts +0 -0
- /package/dist/{components → types/components}/pagination/pagination-prev.d.ts +0 -0
- /package/dist/{components → types/components}/pagination/pagination-total.d.ts +0 -0
- /package/dist/{components → types/components}/pagination/pagination.d.ts +0 -0
- /package/dist/{components → types/components}/popover/index.d.ts +0 -0
- /package/dist/{components → types/components}/popover/popover.d.ts +0 -0
- /package/dist/{components → types/components}/progress/index.d.ts +0 -0
- /package/dist/{components → types/components}/progress/progress.d.ts +0 -0
- /package/dist/{components → types/components}/radio/index.d.ts +0 -0
- /package/dist/{components → types/components}/radio/radio.d.ts +0 -0
- /package/dist/{components → types/components}/segmented/index.d.ts +0 -0
- /package/dist/{components → types/components}/segmented/segmented-item.d.ts +0 -0
- /package/dist/{components → types/components}/switch/index.d.ts +0 -0
- /package/dist/{components → types/components}/switch/switch.d.ts +0 -0
- /package/dist/{components → types/components}/table/index.d.ts +0 -0
- /package/dist/{components → types/components}/table/table.d.ts +0 -0
- /package/dist/{components → types/components}/tag/check-tag.d.ts +0 -0
- /package/dist/{components → types/components}/tag/index.d.ts +0 -0
- /package/dist/{components → types/components}/tag/tag.d.ts +0 -0
- /package/dist/{components → types/components}/text/index.d.ts +0 -0
- /package/dist/{components → types/components}/text/text.d.ts +0 -0
- /package/dist/{components → types/components}/timeline/index.d.ts +0 -0
- /package/dist/{components → types/components}/timeline/timeline-item.d.ts +0 -0
- /package/dist/{components → types/components}/timeline/timeline.d.ts +0 -0
- /package/dist/{components → types/components}/tooltip/index.d.ts +0 -0
- /package/dist/{components → types/components}/tooltip/tooltip.d.ts +0 -0
- /package/dist/{components → types/components}/upload/index.d.ts +0 -0
- /package/dist/{components → types/components}/upload/upload.d.ts +0 -0
- /package/dist/{components → types/components}/vnode-renderer/index.d.ts +0 -0
- /package/dist/{components → types/components}/vnode-renderer/vnode-renderer.d.ts +0 -0
- /package/dist/{typings → types/custom}/Alignment.d.ts +0 -0
- /package/dist/{typings → types/custom}/ButtonType.d.ts +0 -0
- /package/dist/{typings → types/custom}/ComponentSize.d.ts +0 -0
- /package/dist/{typings → types/custom}/ComponentType.d.ts +0 -0
- /package/dist/{typings → types/custom}/CropFormat.d.ts +0 -0
- /package/dist/{typings → types/custom}/Direction.d.ts +0 -0
- /package/dist/{typings → types/custom}/Form.d.ts +0 -0
- /package/dist/{typings → types/custom}/Image.d.ts +0 -0
- /package/dist/{typings → types/custom}/InputMode.d.ts +0 -0
- /package/dist/{typings → types/custom}/InputType.d.ts +0 -0
- /package/dist/{typings → types/custom}/LineType.d.ts +0 -0
- /package/dist/{typings → types/custom}/MarkdownItPlugin.d.ts +0 -0
- /package/dist/{typings → types/custom}/MdNodeItem.d.ts +0 -0
- /package/dist/{typings → types/custom}/Message.d.ts +0 -0
- /package/dist/{typings → types/custom}/MessageBox.d.ts +0 -0
- /package/dist/{typings → types/custom}/MessageQueueItem.d.ts +0 -0
- /package/dist/{typings → types/custom}/PaginationLayout.d.ts +0 -0
- /package/dist/{typings → types/custom}/PopoverPlacement.d.ts +0 -0
- /package/dist/{typings → types/custom}/PopoverTrigger.d.ts +0 -0
- /package/dist/{typings → types/custom}/ProgressVariant.d.ts +0 -0
- /package/dist/{typings → types/custom}/RequiredMarkType.d.ts +0 -0
- /package/dist/{typings → types/custom}/SelectionVariant.d.ts +0 -0
- /package/dist/{typings → types/custom}/SwitchVariant.d.ts +0 -0
- /package/dist/{typings → types/custom}/TableColItem.d.ts +0 -0
- /package/dist/{typings → types/custom}/TagVariant.d.ts +0 -0
- /package/dist/{typings → types/custom}/TextareaResizeType.d.ts +0 -0
- /package/dist/{typings → types/custom}/TimelineVariant.d.ts +0 -0
- /package/dist/{typings → types/custom}/TriggerType.d.ts +0 -0
- /package/dist/{typings → types/custom}/contexts/ButtonGroupContext.d.ts +0 -0
- /package/dist/{typings → types/custom}/contexts/CheckboxGroupContext.d.ts +0 -0
- /package/dist/{typings → types/custom}/contexts/FormContext.d.ts +0 -0
- /package/dist/{typings → types/custom}/contexts/RadioGroupContext.d.ts +0 -0
- /package/dist/{typings → types/custom}/contexts/SegmentedContext.d.ts +0 -0
- /package/dist/{typings → types/custom}/contexts/SelectionContext.d.ts +0 -0
- /package/dist/{typings → types/custom}/utils/Arrayable.d.ts +0 -0
- /package/dist/{typings → types/custom}/utils/Promiseable.d.ts +0 -0
- /package/dist/{typings → types/custom}/utils/index.d.ts +0 -0
- /package/dist/{props → types/props}/alert/index.d.ts +0 -0
- /package/dist/{props → types/props}/avatar/index.d.ts +0 -0
- /package/dist/{props → types/props}/backtop/backtop.d.ts +0 -0
- /package/dist/{props → types/props}/backtop/index.d.ts +0 -0
- /package/dist/{props → types/props}/badge/index.d.ts +0 -0
- /package/dist/{props → types/props}/button/button-group.d.ts +0 -0
- /package/dist/{props → types/props}/button/index.d.ts +0 -0
- /package/dist/{props → types/props}/card/card.d.ts +0 -0
- /package/dist/{props → types/props}/card/index.d.ts +0 -0
- /package/dist/{props → types/props}/checkbox/index.d.ts +0 -0
- /package/dist/{props → types/props}/code/code.d.ts +0 -0
- /package/dist/{props → types/props}/code/index.d.ts +0 -0
- /package/dist/{props → types/props}/dialog/index.d.ts +0 -0
- /package/dist/{props → types/props}/divider/index.d.ts +0 -0
- /package/dist/{props → types/props}/editor/editor-control.d.ts +0 -0
- /package/dist/{props → types/props}/editor/index.d.ts +0 -0
- /package/dist/{props → types/props}/form/form-item.d.ts +0 -0
- /package/dist/{props → types/props}/form/index.d.ts +0 -0
- /package/dist/{props → types/props}/image/image-viewer.d.ts +0 -0
- /package/dist/{props → types/props}/image/index.d.ts +0 -0
- /package/dist/{props → types/props}/image-crop/index.d.ts +0 -0
- /package/dist/{props → types/props}/input/index.d.ts +0 -0
- /package/dist/{props → types/props}/mask/index.d.ts +0 -0
- /package/dist/{props → types/props}/menu/index.d.ts +0 -0
- /package/dist/{props → types/props}/message/index.d.ts +0 -0
- /package/dist/{props → types/props}/message-box/index.d.ts +0 -0
- /package/dist/{props → types/props}/message-box/message-box.d.ts +0 -0
- /package/dist/{props → types/props}/pagination/index.d.ts +0 -0
- /package/dist/{props → types/props}/popover/index.d.ts +0 -0
- /package/dist/{props → types/props}/progress/index.d.ts +0 -0
- /package/dist/{props → types/props}/radio/index.d.ts +0 -0
- /package/dist/{props → types/props}/segmented/index.d.ts +0 -0
- /package/dist/{props → types/props}/select/index.d.ts +0 -0
- /package/dist/{props → types/props}/switch/index.d.ts +0 -0
- /package/dist/{props → types/props}/table/index.d.ts +0 -0
- /package/dist/{props → types/props}/tag/check-tag.d.ts +0 -0
- /package/dist/{props → types/props}/tag/index.d.ts +0 -0
- /package/dist/{props → types/props}/text/index.d.ts +0 -0
- /package/dist/{props → types/props}/timeline/index.d.ts +0 -0
- /package/dist/{props → types/props}/tooltip/index.d.ts +0 -0
- /package/dist/{props → types/props}/upload/index.d.ts +0 -0
- /package/dist/{props → types/props}/upload/upload.d.ts +0 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4404 @@
|
|
|
1
|
+
import { defineComponent as R, computed as b, openBlock as v, createBlock as S, unref as r, normalizeClass as X, withCtx as N, resolveDynamicComponent as fe, createCommentVNode as P, createTextVNode as Oe, toDisplayString as Q, h as De, ref as T, watch as ie, createElementBlock as w, normalizeStyle as J, onMounted as le, onBeforeUnmount as ye, Transition as ke, withDirectives as ue, createElementVNode as E, renderSlot as H, vShow as be, useSlots as Ne, createVNode as z, inject as me, shallowRef as re, provide as Ce, toRef as oe, useModel as ae, vModelCheckbox as ut, mergeModels as Z, toRaw as ze, Fragment as se, renderList as pe, useAttrs as Ze, Teleport as ct, mergeProps as ve, withModifiers as ge, nextTick as $e, vModelDynamic as zt, vModelText as Rt, render as Ve, cloneVNode as Lt, Text as It, Comment as At, vModelRadio as dt } from "vue";
|
|
2
|
+
import { WarningFilled as ft, CloseFilled as pt, InfoFilled as st, CheckFilled as vt, JumpTo as Et, CaretUp as Mt, Loading as Ue, Check as mt, Close as Je, Bold as Pt, Italic as Dt, Underline as Ot, Strikethrough as Nt, Hide as ht, ListUl as Vt, ListOl as Ut, View as gt, ArrowLeft as bt, ArrowRight as yt, ZoomIn as Ft, ZoomOut as Ht, FlipHorizontal as jt, FlipVertical as Wt, Clockwise as Xt, Couterclockwise as Yt, FitSize as Kt, Fullscreen as Gt, Ellipsis as Zt, ArrowDown as Jt } from "@squirrel-cloud/icons-vue";
|
|
3
|
+
import Qt from "markdown-it";
|
|
4
|
+
import { RouterLink as en } from "vue-router";
|
|
5
|
+
import { autoUpdate as tn, computePosition as nn, offset as sn, flip as on, shift as an } from "@floating-ui/dom";
|
|
6
|
+
const Qe = {
|
|
7
|
+
primary: st,
|
|
8
|
+
success: vt,
|
|
9
|
+
info: st,
|
|
10
|
+
error: pt,
|
|
11
|
+
warn: ft
|
|
12
|
+
}, ln = "sq-alert", qa = /* @__PURE__ */ R({
|
|
13
|
+
name: ln,
|
|
14
|
+
__name: "alert",
|
|
15
|
+
props: {
|
|
16
|
+
type: { default: "info" },
|
|
17
|
+
showIcon: { type: Boolean },
|
|
18
|
+
icon: {},
|
|
19
|
+
text: {}
|
|
20
|
+
},
|
|
21
|
+
setup(u) {
|
|
22
|
+
const o = u, s = b(() => {
|
|
23
|
+
const n = [];
|
|
24
|
+
return o.type && n.push(`is-${o.type}`), n;
|
|
25
|
+
}), e = b(() => o.icon ? o.icon : o.showIcon && o.type ? Qe[o.type] : void 0);
|
|
26
|
+
return (n, t) => (v(), S(r(xe), {
|
|
27
|
+
class: X(["sq-alert", s.value])
|
|
28
|
+
}, {
|
|
29
|
+
default: N(() => [
|
|
30
|
+
e.value ? (v(), S(fe(e.value), { key: 0 })) : P("", !0),
|
|
31
|
+
Oe(" " + Q(o.text), 1)
|
|
32
|
+
]),
|
|
33
|
+
_: 1
|
|
34
|
+
}, 8, ["class"]));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
let ot = 0;
|
|
38
|
+
const Fe = () => ({
|
|
39
|
+
/**
|
|
40
|
+
* 获取下一个ID
|
|
41
|
+
* @returns 下一个ID
|
|
42
|
+
*/
|
|
43
|
+
nextId: () => (ot++, ot)
|
|
44
|
+
});
|
|
45
|
+
function He() {
|
|
46
|
+
function u(s) {
|
|
47
|
+
const e = document.documentElement;
|
|
48
|
+
return getComputedStyle(e).getPropertyValue(s).trim();
|
|
49
|
+
}
|
|
50
|
+
function o(s) {
|
|
51
|
+
return typeof s == "number" ? `${s}px` : s;
|
|
52
|
+
}
|
|
53
|
+
return { getCssVar: u, getCssUnit: o };
|
|
54
|
+
}
|
|
55
|
+
function rn() {
|
|
56
|
+
function u(o = [0.3, 0.8], s = [0.1, 0.3], e = [0, 360]) {
|
|
57
|
+
const { getRandomNum: n } = un(), t = n(o, 4), a = n(s, 4), c = n(e, 4);
|
|
58
|
+
return `oklch(${t} ${a} ${c})`;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
/**
|
|
62
|
+
* 获取随机颜色
|
|
63
|
+
* @param lRange 明度范围
|
|
64
|
+
* @param cRange 彩度范围
|
|
65
|
+
* @param hRange 色调范围
|
|
66
|
+
* @returns 随机颜色
|
|
67
|
+
*/
|
|
68
|
+
getRandomColor: u
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function Le() {
|
|
72
|
+
function u(...o) {
|
|
73
|
+
for (const s of o) {
|
|
74
|
+
const e = r(s);
|
|
75
|
+
if (e != null) return e;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
/**
|
|
80
|
+
* 获取配置项
|
|
81
|
+
* @param args 配置项数组
|
|
82
|
+
* @returns 目标配置项
|
|
83
|
+
*/
|
|
84
|
+
getOption: u
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function un() {
|
|
88
|
+
function u(o, s = 2) {
|
|
89
|
+
const e = Math.random(), n = Math.abs(o[1] - o[0]), t = Math.min(...o) + e * n;
|
|
90
|
+
return Number(t.toFixed(s));
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
/**
|
|
94
|
+
* 获取随机数
|
|
95
|
+
* @param range 随机范围
|
|
96
|
+
* @param digits 保留位数
|
|
97
|
+
* @returns 随机数
|
|
98
|
+
*/
|
|
99
|
+
getRandomNum: u
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
let at = 2e3;
|
|
103
|
+
const et = () => ({
|
|
104
|
+
/**
|
|
105
|
+
* 获取下一个层级
|
|
106
|
+
* @returns 下一个层级
|
|
107
|
+
*/
|
|
108
|
+
nextZIndex: () => (at++, at)
|
|
109
|
+
});
|
|
110
|
+
function Ie(u, o, s) {
|
|
111
|
+
this.type = u, this.tag = o, this.attrs = null, this.map = null, this.nesting = s, this.level = 0, this.children = null, this.content = "", this.markup = "", this.info = "", this.meta = null, this.block = !1, this.hidden = !1;
|
|
112
|
+
}
|
|
113
|
+
Ie.prototype.attrIndex = function(o) {
|
|
114
|
+
if (!this.attrs)
|
|
115
|
+
return -1;
|
|
116
|
+
const s = this.attrs;
|
|
117
|
+
for (let e = 0, n = s.length; e < n; e++)
|
|
118
|
+
if (s[e][0] === o)
|
|
119
|
+
return e;
|
|
120
|
+
return -1;
|
|
121
|
+
};
|
|
122
|
+
Ie.prototype.attrPush = function(o) {
|
|
123
|
+
this.attrs ? this.attrs.push(o) : this.attrs = [o];
|
|
124
|
+
};
|
|
125
|
+
Ie.prototype.attrSet = function(o, s) {
|
|
126
|
+
const e = this.attrIndex(o), n = [o, s];
|
|
127
|
+
e < 0 ? this.attrPush(n) : this.attrs[e] = n;
|
|
128
|
+
};
|
|
129
|
+
Ie.prototype.attrGet = function(o) {
|
|
130
|
+
const s = this.attrIndex(o);
|
|
131
|
+
let e = null;
|
|
132
|
+
return s >= 0 && (e = this.attrs[s][1]), e;
|
|
133
|
+
};
|
|
134
|
+
Ie.prototype.attrJoin = function(o, s) {
|
|
135
|
+
const e = this.attrIndex(o);
|
|
136
|
+
e < 0 ? this.attrPush([o, s]) : this.attrs[e][1] = this.attrs[e][1] + " " + s;
|
|
137
|
+
};
|
|
138
|
+
function cn(u) {
|
|
139
|
+
u.core.ruler.push("task-lists", (o) => {
|
|
140
|
+
var e, n;
|
|
141
|
+
const { tokens: s } = o;
|
|
142
|
+
for (let t = 0; t < s.length; t++) {
|
|
143
|
+
const a = s[t];
|
|
144
|
+
if (a.type === "list_item_open") {
|
|
145
|
+
const c = s[t + 2];
|
|
146
|
+
if (c && c.type === "inline") {
|
|
147
|
+
const d = c.content;
|
|
148
|
+
if (/^\[[ xX]\]/.test(d.trim())) {
|
|
149
|
+
a.attrSet("class", "sq-article-task-list-item");
|
|
150
|
+
const l = (e = c.children) == null ? void 0 : e[0];
|
|
151
|
+
l && (l.content = l.content.replace(/^\[[ xX]\]/, ""));
|
|
152
|
+
const i = /^\[[xX]\]/.test(d), p = [
|
|
153
|
+
["type", "checkbox"],
|
|
154
|
+
["disabled", ""]
|
|
155
|
+
];
|
|
156
|
+
i && p.push(["checked", ""]);
|
|
157
|
+
const m = new Ie("input", "input", 0);
|
|
158
|
+
m.attrs = p, (n = c.children) == null || n.unshift(m);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
let lt = 1;
|
|
166
|
+
function dn() {
|
|
167
|
+
function u(t, a) {
|
|
168
|
+
const c = new Qt({
|
|
169
|
+
html: !0,
|
|
170
|
+
typographer: !0
|
|
171
|
+
});
|
|
172
|
+
return c.use(cn), a && a.forEach((d) => c.use(d)), c.parse(t, "");
|
|
173
|
+
}
|
|
174
|
+
function o(t, a) {
|
|
175
|
+
const c = e(t, a) ?? [];
|
|
176
|
+
return De("article", { class: "sq-article" }, [
|
|
177
|
+
De(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
class: "sq-article-content"
|
|
181
|
+
},
|
|
182
|
+
s(c)
|
|
183
|
+
)
|
|
184
|
+
]);
|
|
185
|
+
}
|
|
186
|
+
function s(t) {
|
|
187
|
+
if (!t) return;
|
|
188
|
+
const a = t.map((c) => {
|
|
189
|
+
if (typeof c == "string")
|
|
190
|
+
return c;
|
|
191
|
+
{
|
|
192
|
+
const d = s(c.children);
|
|
193
|
+
return De(
|
|
194
|
+
c.tag,
|
|
195
|
+
c.attrs,
|
|
196
|
+
typeof c.tag != "string" ? n(d) : d
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
return a.length > 1 ? a : a[0];
|
|
201
|
+
}
|
|
202
|
+
function e(t, a) {
|
|
203
|
+
const c = [], d = { children: [] };
|
|
204
|
+
let l = d;
|
|
205
|
+
return t.forEach((i) => {
|
|
206
|
+
var M, I, L, F, W, ne, V, k, C, y, x, g;
|
|
207
|
+
const { type: p, children: m, content: h, attrs: f, tag: _, hidden: $, info: B } = i;
|
|
208
|
+
switch (p) {
|
|
209
|
+
case "heading_open":
|
|
210
|
+
case "paragraph_open":
|
|
211
|
+
case "bullet_list_open":
|
|
212
|
+
case "ordered_list_open":
|
|
213
|
+
case "list_item_open":
|
|
214
|
+
case "table_open":
|
|
215
|
+
case "thead_open":
|
|
216
|
+
case "tbody_open":
|
|
217
|
+
case "tr_open":
|
|
218
|
+
case "th_open":
|
|
219
|
+
case "td_open":
|
|
220
|
+
case "blockquote_open":
|
|
221
|
+
case "strong_open":
|
|
222
|
+
case "em_open":
|
|
223
|
+
case "s_open":
|
|
224
|
+
case "link_open": {
|
|
225
|
+
if ($) break;
|
|
226
|
+
const q = {
|
|
227
|
+
tag: (a == null ? void 0 : a[_]) ?? _,
|
|
228
|
+
children: [],
|
|
229
|
+
attrs: f ? Object.fromEntries(f) : {}
|
|
230
|
+
};
|
|
231
|
+
if (p === "link_open") {
|
|
232
|
+
const O = i.attrGet("href") ?? "", j = document.location.origin;
|
|
233
|
+
O != null && O.startsWith("http") && !O.includes(j) && (q.attrs.target = "_blank", q.attrs.rel = "noopener noreferrer", q.attrs.dataOuter = "", (M = q.children) == null || M.push({ tag: Et }));
|
|
234
|
+
}
|
|
235
|
+
if (p === "table_open") {
|
|
236
|
+
const O = {
|
|
237
|
+
tag: "div",
|
|
238
|
+
children: [],
|
|
239
|
+
attrs: { class: "sq-article-table" }
|
|
240
|
+
};
|
|
241
|
+
(I = l.children) == null || I.push(O), c.push(l), l = O;
|
|
242
|
+
}
|
|
243
|
+
(L = l.children) == null || L.push(q), c.push(l), l = q;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
case "heading_close":
|
|
247
|
+
case "paragraph_close":
|
|
248
|
+
case "bullet_list_close":
|
|
249
|
+
case "ordered_list_close":
|
|
250
|
+
case "list_item_close":
|
|
251
|
+
case "table_close":
|
|
252
|
+
case "thead_close":
|
|
253
|
+
case "tbody_close":
|
|
254
|
+
case "tr_close":
|
|
255
|
+
case "th_close":
|
|
256
|
+
case "td_close":
|
|
257
|
+
case "blockquote_close":
|
|
258
|
+
case "strong_close":
|
|
259
|
+
case "em_close":
|
|
260
|
+
case "s_close":
|
|
261
|
+
case "link_close": {
|
|
262
|
+
if ($) break;
|
|
263
|
+
l = c.pop();
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case "code_inline": {
|
|
267
|
+
(F = l.children) == null || F.push({
|
|
268
|
+
tag: (a == null ? void 0 : a[_]) ?? _,
|
|
269
|
+
children: [h],
|
|
270
|
+
attrs: f ? Object.fromEntries(f) : {}
|
|
271
|
+
});
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
case "inline": {
|
|
275
|
+
if (m) {
|
|
276
|
+
const q = e(m, a);
|
|
277
|
+
(W = l.children) == null || W.push(...q ?? []);
|
|
278
|
+
} else
|
|
279
|
+
(ne = l.children) == null || ne.push(h);
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
case "text": {
|
|
283
|
+
h !== "" && ((V = l.children) == null || V.push(h));
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
case "image": {
|
|
287
|
+
(k = l.children) == null || k.push({
|
|
288
|
+
tag: (a == null ? void 0 : a[_]) ?? _,
|
|
289
|
+
children: [],
|
|
290
|
+
attrs: f ? Object.fromEntries(f) : {}
|
|
291
|
+
});
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
case "fence": {
|
|
295
|
+
(C = l.children) == null || C.push({
|
|
296
|
+
tag: (a == null ? void 0 : a.fence) ?? "pre",
|
|
297
|
+
attrs: f ? Object.fromEntries(f) : {
|
|
298
|
+
code: h,
|
|
299
|
+
lang: (B ?? "").trim()
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
case "hr": {
|
|
305
|
+
(y = l.children) == null || y.push({
|
|
306
|
+
tag: (a == null ? void 0 : a[_]) ?? _
|
|
307
|
+
});
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
case "input": {
|
|
311
|
+
const q = f ? Object.fromEntries(f) : {}, O = q.type ?? "text", j = `${_}-${O}`, Y = {
|
|
312
|
+
tag: (a == null ? void 0 : a[j]) ?? _,
|
|
313
|
+
children: [],
|
|
314
|
+
attrs: q
|
|
315
|
+
};
|
|
316
|
+
O === "checkbox" && (Y.attrs.value = `task-list-${lt}`, lt++), (x = l.children) == null || x.push(Y);
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
case "html_inline": {
|
|
320
|
+
if (h.startsWith("</"))
|
|
321
|
+
l = c.pop();
|
|
322
|
+
else {
|
|
323
|
+
const q = h.match(/^<(\w+)/);
|
|
324
|
+
if (!q) return;
|
|
325
|
+
const O = q[1], j = {
|
|
326
|
+
tag: (a == null ? void 0 : a[O]) ?? O,
|
|
327
|
+
children: []
|
|
328
|
+
}, Y = h.match(/<[^>]+>/);
|
|
329
|
+
if (Y) {
|
|
330
|
+
const A = Y[0], D = {};
|
|
331
|
+
A.replace(/(\w+)=["']?([^"'\s>]+)["']?/g, (G, ce, he) => (D[ce] = he, "")), Object.keys(D).length > 0 && (j.attrs = D);
|
|
332
|
+
}
|
|
333
|
+
(g = l.children) == null || g.push(j), c.push(l), l = j;
|
|
334
|
+
}
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}), d.children;
|
|
339
|
+
}
|
|
340
|
+
function n(t) {
|
|
341
|
+
return t === void 0 ? void 0 : { default: () => t };
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
/**
|
|
345
|
+
* 将Markdown转换为Tokens
|
|
346
|
+
* @param markdown Markdown文本
|
|
347
|
+
* @returns Tokens
|
|
348
|
+
*/
|
|
349
|
+
md2tokens: u,
|
|
350
|
+
/**
|
|
351
|
+
* 将Tokens转换为Vue渲染函数
|
|
352
|
+
* @param tokens Tokens
|
|
353
|
+
* @returns Vue渲染函数
|
|
354
|
+
*/
|
|
355
|
+
tokens2vueh: o
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
function fn() {
|
|
359
|
+
function u(o, s = 100) {
|
|
360
|
+
let e;
|
|
361
|
+
return function(...n) {
|
|
362
|
+
e || (e = setTimeout(() => {
|
|
363
|
+
o.apply(this, n), e = void 0;
|
|
364
|
+
}, s));
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
return {
|
|
368
|
+
/**
|
|
369
|
+
* 包装节流方法
|
|
370
|
+
* @param func 原方法
|
|
371
|
+
* @param timeout 延时
|
|
372
|
+
* @returns 包装后函数
|
|
373
|
+
*/
|
|
374
|
+
throttle: u
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
let Se, Pe, Be = 0;
|
|
378
|
+
function pn() {
|
|
379
|
+
async function u(s = [
|
|
380
|
+
"html",
|
|
381
|
+
"css",
|
|
382
|
+
"csharp",
|
|
383
|
+
"vue",
|
|
384
|
+
"json",
|
|
385
|
+
"tsx",
|
|
386
|
+
"typescript"
|
|
387
|
+
], e = ["github-light"]) {
|
|
388
|
+
if (Se)
|
|
389
|
+
return Be++, Se;
|
|
390
|
+
if (Pe) {
|
|
391
|
+
const n = await Pe;
|
|
392
|
+
return Be++, n;
|
|
393
|
+
}
|
|
394
|
+
return Pe = (async () => {
|
|
395
|
+
const { createHighlighter: n } = await import("shiki"), t = await n({ langs: s, themes: e });
|
|
396
|
+
return Se = t, Pe = void 0, t;
|
|
397
|
+
})(), Be++, await Pe;
|
|
398
|
+
}
|
|
399
|
+
function o() {
|
|
400
|
+
Be === 0 || !Se || (Be--, Be === 0 && (Se.dispose(), Se = void 0));
|
|
401
|
+
}
|
|
402
|
+
return { getHighlighterAsync: u, releaseHighlighter: o };
|
|
403
|
+
}
|
|
404
|
+
const { md2tokens: vn, tokens2vueh: mn } = dn(), hn = "sq-article", gn = R({
|
|
405
|
+
name: hn,
|
|
406
|
+
props: {
|
|
407
|
+
text: {
|
|
408
|
+
type: String,
|
|
409
|
+
required: !0
|
|
410
|
+
},
|
|
411
|
+
md: {
|
|
412
|
+
type: Boolean,
|
|
413
|
+
default: !0
|
|
414
|
+
},
|
|
415
|
+
customNodeMap: {
|
|
416
|
+
type: Object
|
|
417
|
+
},
|
|
418
|
+
plugins: {
|
|
419
|
+
type: Object
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
setup(u) {
|
|
423
|
+
const o = b(() => ({
|
|
424
|
+
hr: Re,
|
|
425
|
+
blur: Cn,
|
|
426
|
+
img: Ke,
|
|
427
|
+
fence: Zn,
|
|
428
|
+
"input-checkbox": $t,
|
|
429
|
+
...u.customNodeMap
|
|
430
|
+
}));
|
|
431
|
+
return () => {
|
|
432
|
+
if (!u.md)
|
|
433
|
+
return De(
|
|
434
|
+
"article",
|
|
435
|
+
{
|
|
436
|
+
class: "sq-article"
|
|
437
|
+
},
|
|
438
|
+
[
|
|
439
|
+
De("div", {
|
|
440
|
+
class: "sq-article-content",
|
|
441
|
+
innerHTML: u.text
|
|
442
|
+
})
|
|
443
|
+
]
|
|
444
|
+
);
|
|
445
|
+
const s = vn(u.text, u.plugins);
|
|
446
|
+
return mn(s, o.value);
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
}), bn = ["src", "alt"], yn = ["textContent"], xn = "sq-avatar", Ca = /* @__PURE__ */ R({
|
|
450
|
+
name: xn,
|
|
451
|
+
__name: "avatar",
|
|
452
|
+
props: {
|
|
453
|
+
src: {},
|
|
454
|
+
alt: {},
|
|
455
|
+
randomColor: { type: Boolean, default: !0 },
|
|
456
|
+
round: { type: Boolean, default: !0 },
|
|
457
|
+
size: { default: "md" }
|
|
458
|
+
},
|
|
459
|
+
setup(u) {
|
|
460
|
+
const o = u, s = T(!0), e = b(() => {
|
|
461
|
+
const c = [];
|
|
462
|
+
return o.size !== "md" && c.push(`sq-avatar--${o.size}`), o.round && c.push("is-round"), c;
|
|
463
|
+
}), n = b(() => {
|
|
464
|
+
if (!o.randomColor) return;
|
|
465
|
+
const { getRandomColor: c } = rn();
|
|
466
|
+
return {
|
|
467
|
+
"--avatar-bg-color": c()
|
|
468
|
+
};
|
|
469
|
+
}), t = b(() => o.alt.charAt(0).toUpperCase());
|
|
470
|
+
ie(
|
|
471
|
+
() => o.src,
|
|
472
|
+
() => {
|
|
473
|
+
s.value = !0;
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
function a() {
|
|
477
|
+
s.value = !1;
|
|
478
|
+
}
|
|
479
|
+
return (c, d) => (v(), w("div", {
|
|
480
|
+
class: X(["sq-avatar", e.value]),
|
|
481
|
+
style: J(n.value)
|
|
482
|
+
}, [
|
|
483
|
+
o.src && s.value ? (v(), w("img", {
|
|
484
|
+
key: 0,
|
|
485
|
+
src: o.src,
|
|
486
|
+
alt: o.alt,
|
|
487
|
+
onError: a
|
|
488
|
+
}, null, 40, bn)) : (v(), w("span", {
|
|
489
|
+
key: 1,
|
|
490
|
+
textContent: Q(t.value)
|
|
491
|
+
}, null, 8, yn))
|
|
492
|
+
], 6));
|
|
493
|
+
}
|
|
494
|
+
}), _n = { class: "sq-backtop" }, $n = "sq-backtop", Sa = /* @__PURE__ */ R({
|
|
495
|
+
name: $n,
|
|
496
|
+
__name: "backtop",
|
|
497
|
+
props: {
|
|
498
|
+
progress: { type: Boolean, default: !0 },
|
|
499
|
+
icon: { default: Mt },
|
|
500
|
+
transition: { default: "sq-rotate-in-left" },
|
|
501
|
+
visibilityHeight: { default: 100 },
|
|
502
|
+
target: { default: "#app" },
|
|
503
|
+
progressProps: {}
|
|
504
|
+
},
|
|
505
|
+
setup(u) {
|
|
506
|
+
const { throttle: o } = fn(), s = o(d), e = new ResizeObserver(l), n = u, t = T(100), a = T(0), c = b(() => a.value > n.visibilityHeight);
|
|
507
|
+
le(() => {
|
|
508
|
+
var m;
|
|
509
|
+
l(), s(), window.addEventListener("scroll", s);
|
|
510
|
+
const p = document.querySelector(n.target) ?? document.body;
|
|
511
|
+
e.observe(p), (m = window.visualViewport) == null || m.addEventListener("resize", l);
|
|
512
|
+
}), ye(() => {
|
|
513
|
+
var p;
|
|
514
|
+
window.removeEventListener("scroll", s), e.disconnect(), (p = window.visualViewport) == null || p.removeEventListener("resize", l);
|
|
515
|
+
});
|
|
516
|
+
function d() {
|
|
517
|
+
a.value = window.scrollY;
|
|
518
|
+
}
|
|
519
|
+
function l() {
|
|
520
|
+
const p = (document.scrollingElement ?? document.body).scrollHeight, m = window.innerHeight;
|
|
521
|
+
t.value = p - m;
|
|
522
|
+
}
|
|
523
|
+
function i() {
|
|
524
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
525
|
+
}
|
|
526
|
+
return (p, m) => (v(), S(ke, {
|
|
527
|
+
name: n.transition
|
|
528
|
+
}, {
|
|
529
|
+
default: N(() => {
|
|
530
|
+
var h, f, _;
|
|
531
|
+
return [
|
|
532
|
+
ue(E("div", _n, [
|
|
533
|
+
E("div", {
|
|
534
|
+
class: "sq-backtop-wrap",
|
|
535
|
+
onClick: i
|
|
536
|
+
}, [
|
|
537
|
+
n.progress ? (v(), S(r(So), {
|
|
538
|
+
key: 0,
|
|
539
|
+
variant: "circle",
|
|
540
|
+
label: !1,
|
|
541
|
+
value: a.value,
|
|
542
|
+
max: t.value,
|
|
543
|
+
type: (h = n.progressProps) == null ? void 0 : h.type,
|
|
544
|
+
stroke: (f = n.progressProps) == null ? void 0 : f.stroke,
|
|
545
|
+
color: (_ = n.progressProps) == null ? void 0 : _.color
|
|
546
|
+
}, null, 8, ["value", "max", "type", "stroke", "color"])) : P("", !0),
|
|
547
|
+
H(p.$slots, "default", {}, () => [
|
|
548
|
+
(v(), S(fe(n.icon)))
|
|
549
|
+
])
|
|
550
|
+
])
|
|
551
|
+
], 512), [
|
|
552
|
+
[be, c.value]
|
|
553
|
+
])
|
|
554
|
+
];
|
|
555
|
+
}),
|
|
556
|
+
_: 3
|
|
557
|
+
}, 8, ["name"]));
|
|
558
|
+
}
|
|
559
|
+
}), kn = ["textContent"], wn = "sq-badge", it = /* @__PURE__ */ R({
|
|
560
|
+
name: wn,
|
|
561
|
+
__name: "badge",
|
|
562
|
+
props: {
|
|
563
|
+
type: { default: "error" },
|
|
564
|
+
color: {},
|
|
565
|
+
showZero: { type: Boolean },
|
|
566
|
+
max: { default: 99 },
|
|
567
|
+
count: { default: 0 },
|
|
568
|
+
text: {},
|
|
569
|
+
dot: { type: Boolean }
|
|
570
|
+
},
|
|
571
|
+
setup(u) {
|
|
572
|
+
const o = Ne(), s = u, e = b(() => {
|
|
573
|
+
const c = [`is-${s.type}`];
|
|
574
|
+
return s.dot && c.push("is-dot"), c;
|
|
575
|
+
}), n = b(() => o.default ? "sup" : "div"), t = b(() => !s.dot && s.text || s.showZero ? !0 : s.count > 0), a = b(() => s.dot ? "" : s.text ? s.text : s.max && s.count > s.max ? `${s.max}+` : `${s.count}`);
|
|
576
|
+
return (c, d) => (v(), S(ke, { name: "sq-zoom" }, {
|
|
577
|
+
default: N(() => [
|
|
578
|
+
r(o).default || t.value ? (v(), w("span", {
|
|
579
|
+
key: 0,
|
|
580
|
+
class: X(["sq-badge", e.value]),
|
|
581
|
+
style: J({ "--badge-color": s.color })
|
|
582
|
+
}, [
|
|
583
|
+
H(c.$slots, "default"),
|
|
584
|
+
(v(), S(fe(n.value), { class: "sq-badge-label" }, {
|
|
585
|
+
default: N(() => [
|
|
586
|
+
z(ke, {
|
|
587
|
+
name: r(o).default ? "sq-zoom" : ""
|
|
588
|
+
}, {
|
|
589
|
+
default: N(() => [
|
|
590
|
+
t.value ? (v(), w("span", {
|
|
591
|
+
key: 0,
|
|
592
|
+
class: "sq-badge-label-inner",
|
|
593
|
+
textContent: Q(a.value)
|
|
594
|
+
}, null, 8, kn)) : P("", !0)
|
|
595
|
+
]),
|
|
596
|
+
_: 1
|
|
597
|
+
}, 8, ["name"])
|
|
598
|
+
]),
|
|
599
|
+
_: 1
|
|
600
|
+
}))
|
|
601
|
+
], 6)) : P("", !0)
|
|
602
|
+
]),
|
|
603
|
+
_: 3
|
|
604
|
+
}));
|
|
605
|
+
}
|
|
606
|
+
}), qn = "sq-blur", Cn = /* @__PURE__ */ R({
|
|
607
|
+
name: qn,
|
|
608
|
+
__name: "blur",
|
|
609
|
+
setup(u) {
|
|
610
|
+
return (o, s) => (v(), S(r(xe), { class: "sq-blur" }, {
|
|
611
|
+
default: N(() => [
|
|
612
|
+
H(o.$slots, "default")
|
|
613
|
+
]),
|
|
614
|
+
_: 3
|
|
615
|
+
}));
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
function Sn(u) {
|
|
619
|
+
const { getOption: o } = Le(), s = me(Ee, void 0), e = me(_t, void 0), n = b(
|
|
620
|
+
() => r(e) ? void 0 : u.text
|
|
621
|
+
), t = b(
|
|
622
|
+
() => {
|
|
623
|
+
var l, i;
|
|
624
|
+
return o(
|
|
625
|
+
(l = r(e)) == null ? void 0 : l.size,
|
|
626
|
+
u.size,
|
|
627
|
+
(i = r(s)) == null ? void 0 : i.size,
|
|
628
|
+
"md"
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
), a = b(
|
|
632
|
+
() => {
|
|
633
|
+
var l;
|
|
634
|
+
return o((l = r(e)) == null ? void 0 : l.type, u.type);
|
|
635
|
+
}
|
|
636
|
+
), c = b(
|
|
637
|
+
() => {
|
|
638
|
+
var l, i;
|
|
639
|
+
return o(
|
|
640
|
+
(l = r(e)) == null ? void 0 : l.round,
|
|
641
|
+
u.round,
|
|
642
|
+
(i = r(s)) == null ? void 0 : i.round
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
), d = b(
|
|
646
|
+
() => {
|
|
647
|
+
var l, i, p;
|
|
648
|
+
return o(
|
|
649
|
+
(l = r(s)) == null ? void 0 : l.disabled,
|
|
650
|
+
(i = r(s)) == null ? void 0 : i.readonly,
|
|
651
|
+
(p = r(e)) == null ? void 0 : p.disabled,
|
|
652
|
+
u.disabled
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
return { btnTextType: n, btnSize: t, btnType: a, btnRound: c, btnDisabled: d };
|
|
657
|
+
}
|
|
658
|
+
function Bn(u) {
|
|
659
|
+
const { getOption: o } = Le(), s = me(Ee, void 0), e = me(kt, void 0), n = b(
|
|
660
|
+
() => {
|
|
661
|
+
var l, i;
|
|
662
|
+
return o(
|
|
663
|
+
(l = r(e)) == null ? void 0 : l.size,
|
|
664
|
+
u.size,
|
|
665
|
+
(i = r(s)) == null ? void 0 : i.size,
|
|
666
|
+
"md"
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
), t = b(
|
|
670
|
+
() => {
|
|
671
|
+
var l;
|
|
672
|
+
return o((l = r(e)) == null ? void 0 : l.form, u.form);
|
|
673
|
+
}
|
|
674
|
+
), a = b(
|
|
675
|
+
() => {
|
|
676
|
+
var l;
|
|
677
|
+
return o((l = r(e)) == null ? void 0 : l.name, u.name);
|
|
678
|
+
}
|
|
679
|
+
), c = b(
|
|
680
|
+
() => {
|
|
681
|
+
var l;
|
|
682
|
+
return o((l = r(e)) == null ? void 0 : l.variant, u.variant);
|
|
683
|
+
}
|
|
684
|
+
), d = b(
|
|
685
|
+
() => {
|
|
686
|
+
var l, i, p;
|
|
687
|
+
return o(
|
|
688
|
+
(l = r(s)) == null ? void 0 : l.disabled,
|
|
689
|
+
(i = r(s)) == null ? void 0 : i.readonly,
|
|
690
|
+
(p = r(e)) == null ? void 0 : p.disabled,
|
|
691
|
+
u.disabled
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
return {
|
|
696
|
+
checkboxSize: n,
|
|
697
|
+
checkboxForm: t,
|
|
698
|
+
checkboxName: a,
|
|
699
|
+
checkboxVariant: c,
|
|
700
|
+
checkboxDisabled: d,
|
|
701
|
+
groupContext: e
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
function xt() {
|
|
705
|
+
const u = { x: 0, y: 0 }, o = T(!1), s = T(1), e = T(), n = T({ x: 0, y: 0 }), t = re(null);
|
|
706
|
+
function a(f) {
|
|
707
|
+
f.pointerType !== "touch" && (o.value = !0, u.x = f.x, u.y = f.y);
|
|
708
|
+
}
|
|
709
|
+
function c(f) {
|
|
710
|
+
f.pointerType !== "touch" && (o.value = !1);
|
|
711
|
+
}
|
|
712
|
+
function d(f) {
|
|
713
|
+
if (f.touches.length === 1)
|
|
714
|
+
o.value = !0, u.x = f.touches[0].screenX, u.y = f.touches[0].screenY;
|
|
715
|
+
else if (f.touches.length === 2) {
|
|
716
|
+
const _ = f.touches.item(0), $ = f.touches.item(1);
|
|
717
|
+
e.value = m(_, $);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
function l(f) {
|
|
721
|
+
o.value = !1, e.value = void 0, f == null || f();
|
|
722
|
+
}
|
|
723
|
+
function i(f, _, $, B, M) {
|
|
724
|
+
const I = s.value / M, L = f * I, F = _ * I, [W, ne] = h($, B);
|
|
725
|
+
return [W - L, ne - F];
|
|
726
|
+
}
|
|
727
|
+
function p(f, _) {
|
|
728
|
+
const $ = f - u.x, B = _ - u.y;
|
|
729
|
+
u.x = f, u.y = _;
|
|
730
|
+
const M = n.value.x + $ * 2, I = n.value.y + B * 2;
|
|
731
|
+
n.value.x = M, n.value.y = I;
|
|
732
|
+
}
|
|
733
|
+
function m(f, _) {
|
|
734
|
+
const $ = _.clientX - f.clientX, B = _.clientY - f.clientY;
|
|
735
|
+
return Math.sqrt($ * $ + B * B);
|
|
736
|
+
}
|
|
737
|
+
function h(f, _) {
|
|
738
|
+
const { left: $, top: B } = t.value.getBoundingClientRect(), M = f - $, I = _ - B;
|
|
739
|
+
return [M, I];
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
activePoint: u,
|
|
743
|
+
hasPointer: o,
|
|
744
|
+
activeLength: e,
|
|
745
|
+
scale: s,
|
|
746
|
+
transform: n,
|
|
747
|
+
imgRef: t,
|
|
748
|
+
handlePointerdown: a,
|
|
749
|
+
handlePointerup: c,
|
|
750
|
+
handleTouchstart: d,
|
|
751
|
+
handleTouchend: l,
|
|
752
|
+
calcPointDiff: i,
|
|
753
|
+
moveImage: p,
|
|
754
|
+
getLength: m,
|
|
755
|
+
getImagePoint: h
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
function Tn(u) {
|
|
759
|
+
const { getOption: o } = Le(), s = me(Ee, void 0), e = me(tt, void 0), n = b(
|
|
760
|
+
() => {
|
|
761
|
+
var d;
|
|
762
|
+
return o(u.size, (d = r(s)) == null ? void 0 : d.size, "md");
|
|
763
|
+
}
|
|
764
|
+
), t = b(
|
|
765
|
+
() => {
|
|
766
|
+
var d;
|
|
767
|
+
return o(u.round, (d = r(s)) == null ? void 0 : d.round);
|
|
768
|
+
}
|
|
769
|
+
), a = b(
|
|
770
|
+
() => {
|
|
771
|
+
var d;
|
|
772
|
+
return o((d = r(s)) == null ? void 0 : d.disabled, u.disabled);
|
|
773
|
+
}
|
|
774
|
+
), c = b(
|
|
775
|
+
() => {
|
|
776
|
+
var d;
|
|
777
|
+
return o((d = r(s)) == null ? void 0 : d.readonly, u.readonly);
|
|
778
|
+
}
|
|
779
|
+
);
|
|
780
|
+
return { inputSize: n, inputRound: t, inputDisabled: a, inputReadonly: c, id: e };
|
|
781
|
+
}
|
|
782
|
+
function Ae() {
|
|
783
|
+
function u(o) {
|
|
784
|
+
if (o.text) return o.text;
|
|
785
|
+
switch (typeof o.value) {
|
|
786
|
+
case "number":
|
|
787
|
+
return o.value.toString();
|
|
788
|
+
default:
|
|
789
|
+
return o.value;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
return { getText: u };
|
|
793
|
+
}
|
|
794
|
+
function zn(u) {
|
|
795
|
+
const { getOption: o } = Le(), s = me(Ee, void 0), e = me(St, void 0), n = b(
|
|
796
|
+
() => {
|
|
797
|
+
var l, i;
|
|
798
|
+
return o(
|
|
799
|
+
(l = r(e)) == null ? void 0 : l.size,
|
|
800
|
+
u.size,
|
|
801
|
+
(i = r(s)) == null ? void 0 : i.size,
|
|
802
|
+
"md"
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
), t = b(
|
|
806
|
+
() => {
|
|
807
|
+
var l;
|
|
808
|
+
return o((l = r(e)) == null ? void 0 : l.form, u.form);
|
|
809
|
+
}
|
|
810
|
+
), a = b(
|
|
811
|
+
() => {
|
|
812
|
+
var l;
|
|
813
|
+
return o((l = r(e)) == null ? void 0 : l.name, u.name);
|
|
814
|
+
}
|
|
815
|
+
), c = b(
|
|
816
|
+
() => {
|
|
817
|
+
var l;
|
|
818
|
+
return o((l = r(e)) == null ? void 0 : l.variant, u.variant);
|
|
819
|
+
}
|
|
820
|
+
), d = b(
|
|
821
|
+
() => {
|
|
822
|
+
var l, i, p;
|
|
823
|
+
return o(
|
|
824
|
+
(l = r(s)) == null ? void 0 : l.disabled,
|
|
825
|
+
(i = r(s)) == null ? void 0 : i.readonly,
|
|
826
|
+
(p = r(e)) == null ? void 0 : p.disabled,
|
|
827
|
+
u.disabled
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
return {
|
|
832
|
+
radioSize: n,
|
|
833
|
+
radioForm: t,
|
|
834
|
+
radioName: a,
|
|
835
|
+
radioVariant: c,
|
|
836
|
+
radioDisabled: d,
|
|
837
|
+
groupContext: e
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
function Rn(u) {
|
|
841
|
+
const { getOption: o } = Le(), s = me(Bt, void 0);
|
|
842
|
+
return {
|
|
843
|
+
segmentedDisabled: b(
|
|
844
|
+
() => {
|
|
845
|
+
var n;
|
|
846
|
+
return o((n = r(s)) == null ? void 0 : n.disabled, u.disabled);
|
|
847
|
+
}
|
|
848
|
+
),
|
|
849
|
+
parentContext: s
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
function Ln() {
|
|
853
|
+
return {
|
|
854
|
+
parentContext: me(Tt, void 0)
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
function In(u) {
|
|
858
|
+
const { getOption: o } = Le(), s = me(Ee, void 0), e = me(tt, void 0), n = b(
|
|
859
|
+
() => {
|
|
860
|
+
var a;
|
|
861
|
+
return o(u.size, (a = r(s)) == null ? void 0 : a.size, "md");
|
|
862
|
+
}
|
|
863
|
+
), t = b(
|
|
864
|
+
() => {
|
|
865
|
+
var a, c;
|
|
866
|
+
return o(
|
|
867
|
+
(a = r(s)) == null ? void 0 : a.disabled,
|
|
868
|
+
(c = r(s)) == null ? void 0 : c.readonly,
|
|
869
|
+
u.disabled
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
);
|
|
873
|
+
return { switchSize: n, switchDisabled: t, id: e };
|
|
874
|
+
}
|
|
875
|
+
const An = ["disabled", "form", "type"], En = "sq-button", te = /* @__PURE__ */ R({
|
|
876
|
+
name: En,
|
|
877
|
+
__name: "button",
|
|
878
|
+
props: {
|
|
879
|
+
type: {},
|
|
880
|
+
round: { type: Boolean, default: void 0 },
|
|
881
|
+
text: { type: Boolean },
|
|
882
|
+
icon: {},
|
|
883
|
+
loading: { type: Boolean },
|
|
884
|
+
form: {},
|
|
885
|
+
bg: { type: Boolean },
|
|
886
|
+
nativeType: { default: "button" },
|
|
887
|
+
disabled: { type: Boolean, default: void 0 },
|
|
888
|
+
size: {}
|
|
889
|
+
},
|
|
890
|
+
emits: ["click"],
|
|
891
|
+
setup(u, { emit: o }) {
|
|
892
|
+
const s = o, e = u, { btnTextType: n, btnSize: t, btnType: a, btnRound: c, btnDisabled: d } = Sn(e), l = b(() => {
|
|
893
|
+
const m = [], h = r(t), f = r(a), _ = r(c), $ = r(n);
|
|
894
|
+
return h !== "md" && m.push(`sq-button--${h}`), f && m.push(`is-${f}`), _ && m.push("is-round"), $ && m.push("is-text"), $ && e.bg && m.push("has-bg"), m;
|
|
895
|
+
}), i = b(() => e.loading ? Ue : e.icon), p = b(() => e.loading || r(d));
|
|
896
|
+
return (m, h) => (v(), w("button", {
|
|
897
|
+
class: X(["sq-button", l.value]),
|
|
898
|
+
disabled: p.value,
|
|
899
|
+
form: e.form,
|
|
900
|
+
type: e.nativeType,
|
|
901
|
+
onClick: h[0] || (h[0] = (f) => s("click", f))
|
|
902
|
+
}, [
|
|
903
|
+
z(r(xe), {
|
|
904
|
+
size: r(t) === "lg" ? "md" : r(t)
|
|
905
|
+
}, {
|
|
906
|
+
default: N(() => [
|
|
907
|
+
i.value ? (v(), S(fe(i.value), { key: 0 })) : P("", !0),
|
|
908
|
+
H(m.$slots, "default")
|
|
909
|
+
]),
|
|
910
|
+
_: 3
|
|
911
|
+
}, 8, ["size"])
|
|
912
|
+
], 10, An));
|
|
913
|
+
}
|
|
914
|
+
}), Mn = { class: "sq-button-group" }, Pn = "sq-button-group", Ba = /* @__PURE__ */ R({
|
|
915
|
+
name: Pn,
|
|
916
|
+
__name: "button-group",
|
|
917
|
+
props: {
|
|
918
|
+
size: {},
|
|
919
|
+
type: {},
|
|
920
|
+
round: { type: Boolean, default: void 0 },
|
|
921
|
+
disabled: { type: Boolean, default: void 0 }
|
|
922
|
+
},
|
|
923
|
+
setup(u) {
|
|
924
|
+
const o = u;
|
|
925
|
+
return Ce(
|
|
926
|
+
_t,
|
|
927
|
+
T({
|
|
928
|
+
size: oe(o, "size"),
|
|
929
|
+
type: oe(o, "type"),
|
|
930
|
+
round: oe(o, "round"),
|
|
931
|
+
disabled: oe(o, "disabled")
|
|
932
|
+
})
|
|
933
|
+
), (s, e) => (v(), w("div", Mn, [
|
|
934
|
+
H(s.$slots, "default")
|
|
935
|
+
]));
|
|
936
|
+
}
|
|
937
|
+
}), _t = Symbol("button-group-context-keys"), Dn = { class: "sq-card" }, On = {
|
|
938
|
+
key: 0,
|
|
939
|
+
class: "sq-card-header"
|
|
940
|
+
}, Nn = ["textContent"], Vn = {
|
|
941
|
+
key: 1,
|
|
942
|
+
class: "sq-card-footer"
|
|
943
|
+
}, Un = "sq-card", Ta = /* @__PURE__ */ R({
|
|
944
|
+
name: Un,
|
|
945
|
+
__name: "card",
|
|
946
|
+
props: {
|
|
947
|
+
title: {},
|
|
948
|
+
decorative: { type: Boolean, default: !1 }
|
|
949
|
+
},
|
|
950
|
+
setup(u) {
|
|
951
|
+
const o = Ne(), s = u;
|
|
952
|
+
return (e, n) => (v(), w("section", Dn, [
|
|
953
|
+
s.title || r(o).title ? (v(), w("div", On, [
|
|
954
|
+
E("h2", {
|
|
955
|
+
class: X({ "has-decorative": s.decorative }),
|
|
956
|
+
textContent: Q(s.title)
|
|
957
|
+
}, null, 10, Nn),
|
|
958
|
+
H(e.$slots, "title")
|
|
959
|
+
])) : P("", !0),
|
|
960
|
+
H(e.$slots, "default"),
|
|
961
|
+
r(o).footer ? (v(), w("div", Vn, [
|
|
962
|
+
H(e.$slots, "footer")
|
|
963
|
+
])) : P("", !0)
|
|
964
|
+
]));
|
|
965
|
+
}
|
|
966
|
+
}), Fn = ["autofocus", "name", "form", "value", "disabled"], Hn = ["textContent"], jn = "sq-checkbox", $t = /* @__PURE__ */ R({
|
|
967
|
+
name: jn,
|
|
968
|
+
__name: "checkbox",
|
|
969
|
+
props: /* @__PURE__ */ Z({
|
|
970
|
+
form: {},
|
|
971
|
+
name: {},
|
|
972
|
+
disabled: { type: Boolean, default: void 0 },
|
|
973
|
+
size: {},
|
|
974
|
+
indeterminate: { type: Boolean },
|
|
975
|
+
variant: {},
|
|
976
|
+
autofocus: { type: Boolean },
|
|
977
|
+
label: {},
|
|
978
|
+
value: {}
|
|
979
|
+
}, {
|
|
980
|
+
checked: { type: Boolean, default: !1 },
|
|
981
|
+
checkedModifiers: {}
|
|
982
|
+
}),
|
|
983
|
+
emits: /* @__PURE__ */ Z(["change"], ["update:checked"]),
|
|
984
|
+
setup(u, { emit: o }) {
|
|
985
|
+
const s = o, e = u, {
|
|
986
|
+
checkboxSize: n,
|
|
987
|
+
checkboxDisabled: t,
|
|
988
|
+
checkboxForm: a,
|
|
989
|
+
checkboxName: c,
|
|
990
|
+
checkboxVariant: d,
|
|
991
|
+
groupContext: l
|
|
992
|
+
} = Bn(e), i = ae(u, "checked"), p = b(() => {
|
|
993
|
+
const h = [], f = r(n), _ = r(t), $ = r(d);
|
|
994
|
+
return f !== "md" && h.push(`sq-selection--${f}`), m.value && h.push("is-checked"), _ && h.push("is-disabled"), $ && h.push(`is-${$}`), h;
|
|
995
|
+
}), m = b(() => l ? r(l).list.includes(e.value) : i.value);
|
|
996
|
+
return ie(m, (h) => {
|
|
997
|
+
if (i.value !== h) {
|
|
998
|
+
i.value = h;
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
}), ie(i, (h) => {
|
|
1002
|
+
m.value !== h && l && l.value.toggleItem(e.value);
|
|
1003
|
+
}), le(() => {
|
|
1004
|
+
i.value = m.value;
|
|
1005
|
+
}), (h, f) => (v(), w("label", {
|
|
1006
|
+
class: X(["sq-selection sq-checkbox", p.value])
|
|
1007
|
+
}, [
|
|
1008
|
+
ue(E("input", {
|
|
1009
|
+
type: "checkbox",
|
|
1010
|
+
autofocus: e.autofocus,
|
|
1011
|
+
name: r(c),
|
|
1012
|
+
form: r(a),
|
|
1013
|
+
value: e.value,
|
|
1014
|
+
disabled: r(t),
|
|
1015
|
+
"onUpdate:modelValue": f[0] || (f[0] = (_) => i.value = _),
|
|
1016
|
+
onChange: f[1] || (f[1] = (_) => s("change", i.value))
|
|
1017
|
+
}, null, 40, Fn), [
|
|
1018
|
+
[ut, i.value]
|
|
1019
|
+
]),
|
|
1020
|
+
r(d) !== "solid" ? (v(), w("span", {
|
|
1021
|
+
key: 0,
|
|
1022
|
+
class: X(["sq-checkbox-box", { "is-indeterminate": e.indeterminate && !m.value }])
|
|
1023
|
+
}, [
|
|
1024
|
+
m.value ? (v(), S(r(mt), {
|
|
1025
|
+
key: 0,
|
|
1026
|
+
class: "sq-checkbox-inner"
|
|
1027
|
+
})) : P("", !0)
|
|
1028
|
+
], 2)) : P("", !0),
|
|
1029
|
+
e.label ? (v(), w("span", {
|
|
1030
|
+
key: 1,
|
|
1031
|
+
class: "sq-selection-label",
|
|
1032
|
+
textContent: Q(e.label)
|
|
1033
|
+
}, null, 8, Hn)) : P("", !0)
|
|
1034
|
+
], 2));
|
|
1035
|
+
}
|
|
1036
|
+
}), Wn = { class: "sq-checkbox-group sq-selection-group" }, Xn = "sq-checkbox-group", Yn = /* @__PURE__ */ R({
|
|
1037
|
+
name: Xn,
|
|
1038
|
+
__name: "checkbox-group",
|
|
1039
|
+
props: {
|
|
1040
|
+
items: { default: () => [] },
|
|
1041
|
+
value: {},
|
|
1042
|
+
form: {},
|
|
1043
|
+
name: {},
|
|
1044
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1045
|
+
size: {},
|
|
1046
|
+
variant: {}
|
|
1047
|
+
},
|
|
1048
|
+
emits: ["change", "update:value"],
|
|
1049
|
+
setup(u, { emit: o }) {
|
|
1050
|
+
const { nextId: s } = Fe(), { getText: e } = Ae(), n = o, t = u, a = T(t.value ?? []), c = b(() => t.name ?? `sq-checkbox-${s()}`), d = b(() => t.items.map((i) => typeof i == "string" ? {
|
|
1051
|
+
text: i,
|
|
1052
|
+
value: i
|
|
1053
|
+
} : typeof i == "number" ? {
|
|
1054
|
+
text: i.toString(),
|
|
1055
|
+
value: i
|
|
1056
|
+
} : i));
|
|
1057
|
+
Ce(
|
|
1058
|
+
kt,
|
|
1059
|
+
T({
|
|
1060
|
+
form: oe(t, "form"),
|
|
1061
|
+
name: c,
|
|
1062
|
+
disabled: oe(t, "disabled"),
|
|
1063
|
+
size: oe(t, "size"),
|
|
1064
|
+
variant: oe(t, "variant"),
|
|
1065
|
+
list: a,
|
|
1066
|
+
toggleItem: l
|
|
1067
|
+
})
|
|
1068
|
+
), ie(
|
|
1069
|
+
() => t.value,
|
|
1070
|
+
(i) => {
|
|
1071
|
+
const p = i || [], m = [.../* @__PURE__ */ new Set([...p, a.value])];
|
|
1072
|
+
m.length === p.length && m.length === a.value.length || (a.value = p);
|
|
1073
|
+
}
|
|
1074
|
+
);
|
|
1075
|
+
function l(i) {
|
|
1076
|
+
a.value.includes(i) ? a.value = a.value.filter((p) => p !== i) : a.value.push(i), n("change", ze(a.value)), n("update:value", ze(a.value));
|
|
1077
|
+
}
|
|
1078
|
+
return (i, p) => (v(), w("div", Wn, [
|
|
1079
|
+
H(i.$slots, "default", {}, () => [
|
|
1080
|
+
(v(!0), w(se, null, pe(d.value, (m, h) => (v(), S(r($t), {
|
|
1081
|
+
key: h,
|
|
1082
|
+
disabled: m.disabled === !0,
|
|
1083
|
+
label: r(e)(m),
|
|
1084
|
+
value: m.value
|
|
1085
|
+
}, null, 8, ["disabled", "label", "value"]))), 128))
|
|
1086
|
+
])
|
|
1087
|
+
]));
|
|
1088
|
+
}
|
|
1089
|
+
}), kt = Symbol("checkbox-group-context-keys"), Kn = ["innerHTML"], Gn = "sq-code", Zn = /* @__PURE__ */ R({
|
|
1090
|
+
name: Gn,
|
|
1091
|
+
__name: "code",
|
|
1092
|
+
props: {
|
|
1093
|
+
code: {},
|
|
1094
|
+
theme: { default: "github-light" },
|
|
1095
|
+
lang: {}
|
|
1096
|
+
},
|
|
1097
|
+
setup(u) {
|
|
1098
|
+
const { getHighlighterAsync: o, releaseHighlighter: s } = pn(), e = u, n = T("");
|
|
1099
|
+
return le(async () => {
|
|
1100
|
+
const t = await o();
|
|
1101
|
+
n.value = t.codeToHtml(e.code, {
|
|
1102
|
+
theme: e.theme,
|
|
1103
|
+
lang: e.lang
|
|
1104
|
+
});
|
|
1105
|
+
}), ye(() => {
|
|
1106
|
+
s();
|
|
1107
|
+
}), (t, a) => (v(), w("div", {
|
|
1108
|
+
class: "sq-code",
|
|
1109
|
+
innerHTML: n.value
|
|
1110
|
+
}, null, 8, Kn));
|
|
1111
|
+
}
|
|
1112
|
+
}), Jn = "sq-mask", wt = /* @__PURE__ */ R({
|
|
1113
|
+
name: Jn,
|
|
1114
|
+
inheritAttrs: !1,
|
|
1115
|
+
__name: "mask",
|
|
1116
|
+
props: /* @__PURE__ */ Z({
|
|
1117
|
+
keyboard: { type: Boolean, default: !0 },
|
|
1118
|
+
maskCloseable: { type: Boolean },
|
|
1119
|
+
beforeClose: {}
|
|
1120
|
+
}, {
|
|
1121
|
+
visible: { type: Boolean, default: !1 },
|
|
1122
|
+
visibleModifiers: {}
|
|
1123
|
+
}),
|
|
1124
|
+
emits: /* @__PURE__ */ Z(["open", "opened", "close", "closed"], ["update:visible"]),
|
|
1125
|
+
setup(u, { emit: o }) {
|
|
1126
|
+
const { nextZIndex: s } = et(), e = Ze();
|
|
1127
|
+
let n;
|
|
1128
|
+
const t = o, a = u, c = T(0), d = T(!1), l = ae(u, "visible");
|
|
1129
|
+
d.value = l.value, ie(l, (h) => {
|
|
1130
|
+
const f = document.scrollingElement;
|
|
1131
|
+
h ? (n = f.style.overflow, f.style.overflow = "hidden", c.value = s(), d.value = !0, document.addEventListener("keydown", i)) : (f.style.overflow = n, document.removeEventListener("keydown", i));
|
|
1132
|
+
}), ye(() => {
|
|
1133
|
+
document.removeEventListener("keydown", i);
|
|
1134
|
+
});
|
|
1135
|
+
function i(h) {
|
|
1136
|
+
h.key === "Escape" && a.keyboard && m();
|
|
1137
|
+
}
|
|
1138
|
+
function p() {
|
|
1139
|
+
a.maskCloseable && m();
|
|
1140
|
+
}
|
|
1141
|
+
function m() {
|
|
1142
|
+
if (typeof a.beforeClose != "function") {
|
|
1143
|
+
l.value = !1;
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
const h = a.beforeClose();
|
|
1147
|
+
h instanceof Promise ? h.then((f) => {
|
|
1148
|
+
f && (l.value = !1);
|
|
1149
|
+
}).catch(() => {
|
|
1150
|
+
}) : h && (l.value = !1);
|
|
1151
|
+
}
|
|
1152
|
+
return (h, f) => (v(), S(ct, { to: "body" }, [
|
|
1153
|
+
z(ke, {
|
|
1154
|
+
name: "sq-fade",
|
|
1155
|
+
onBeforeEnter: f[0] || (f[0] = (_) => t("open")),
|
|
1156
|
+
onAfterEnter: f[1] || (f[1] = (_) => t("opened")),
|
|
1157
|
+
onBeforeLeave: f[2] || (f[2] = (_) => t("close")),
|
|
1158
|
+
onAfterLeave: f[3] || (f[3] = (_) => t("closed"))
|
|
1159
|
+
}, {
|
|
1160
|
+
default: N(() => [
|
|
1161
|
+
d.value ? ue((v(), w("div", ve({
|
|
1162
|
+
key: 0,
|
|
1163
|
+
class: "sq-mask",
|
|
1164
|
+
style: { zIndex: c.value }
|
|
1165
|
+
}, r(e), { onClick: p }), [
|
|
1166
|
+
H(h.$slots, "default")
|
|
1167
|
+
], 16)), [
|
|
1168
|
+
[be, l.value]
|
|
1169
|
+
]) : P("", !0)
|
|
1170
|
+
]),
|
|
1171
|
+
_: 3
|
|
1172
|
+
})
|
|
1173
|
+
]));
|
|
1174
|
+
}
|
|
1175
|
+
}), Qn = {
|
|
1176
|
+
key: 0,
|
|
1177
|
+
class: "sq-dialog-header"
|
|
1178
|
+
}, es = ["textContent"], ts = { class: "sq-dialog-body" }, ns = {
|
|
1179
|
+
key: 1,
|
|
1180
|
+
class: "sq-dialog-footer"
|
|
1181
|
+
}, ss = "sq-dialog", os = /* @__PURE__ */ R({
|
|
1182
|
+
name: ss,
|
|
1183
|
+
inheritAttrs: !1,
|
|
1184
|
+
__name: "dialog",
|
|
1185
|
+
props: /* @__PURE__ */ Z({
|
|
1186
|
+
type: {},
|
|
1187
|
+
title: {},
|
|
1188
|
+
okText: { default: "确认" },
|
|
1189
|
+
cancelText: { default: "取消" },
|
|
1190
|
+
okButtonProps: {},
|
|
1191
|
+
cancelButtonProps: {},
|
|
1192
|
+
footer: { type: Boolean, default: !0 },
|
|
1193
|
+
closeable: { type: Boolean },
|
|
1194
|
+
onOk: {},
|
|
1195
|
+
keyboard: { type: Boolean, default: void 0 },
|
|
1196
|
+
maskCloseable: { type: Boolean, default: void 0 },
|
|
1197
|
+
beforeClose: {}
|
|
1198
|
+
}, {
|
|
1199
|
+
visible: { type: Boolean, default: !1 },
|
|
1200
|
+
visibleModifiers: {}
|
|
1201
|
+
}),
|
|
1202
|
+
emits: /* @__PURE__ */ Z(["open", "opened", "close", "closed"], ["update:visible"]),
|
|
1203
|
+
setup(u, { emit: o }) {
|
|
1204
|
+
const s = Ne(), e = Ze(), n = o, t = u, a = T(!1), c = T(!1), d = ae(u, "visible"), l = b(() => !!t.title || !!s.header), i = b(() => {
|
|
1205
|
+
const M = [];
|
|
1206
|
+
return t.type && M.push(`is-${t.type}`), l.value && M.push("has-header"), [M];
|
|
1207
|
+
}), p = b(() => t.type ? Qe[t.type] : void 0), m = b(() => ({
|
|
1208
|
+
type: t.type ?? "primary",
|
|
1209
|
+
loading: a.value && c.value,
|
|
1210
|
+
disabled: a.value && !c.value,
|
|
1211
|
+
...t.okButtonProps
|
|
1212
|
+
})), h = b(() => ({
|
|
1213
|
+
text: !0,
|
|
1214
|
+
bg: !0,
|
|
1215
|
+
loading: a.value && !c.value,
|
|
1216
|
+
disabled: a.value && c.value,
|
|
1217
|
+
...t.cancelButtonProps
|
|
1218
|
+
})), f = b(
|
|
1219
|
+
() => m.value.loading || h.value.loading || !d.value
|
|
1220
|
+
);
|
|
1221
|
+
function _(M) {
|
|
1222
|
+
if (f.value) return !1;
|
|
1223
|
+
if (typeof M != "function") return !0;
|
|
1224
|
+
const I = M();
|
|
1225
|
+
return I instanceof Promise ? (a.value = !0, I.finally(() => {
|
|
1226
|
+
a.value = !1;
|
|
1227
|
+
})) : I;
|
|
1228
|
+
}
|
|
1229
|
+
async function $() {
|
|
1230
|
+
if (f.value) return !1;
|
|
1231
|
+
c.value = !1, await _(t.beforeClose) && (d.value = !1);
|
|
1232
|
+
}
|
|
1233
|
+
async function B() {
|
|
1234
|
+
c.value = !0, await _(t.onOk) && (d.value = !1);
|
|
1235
|
+
}
|
|
1236
|
+
return (M, I) => (v(), S(r(wt), {
|
|
1237
|
+
visible: d.value,
|
|
1238
|
+
"onUpdate:visible": I[0] || (I[0] = (L) => d.value = L),
|
|
1239
|
+
"mask-closeable": t.maskCloseable,
|
|
1240
|
+
keyboard: t.keyboard,
|
|
1241
|
+
"before-close": () => _(t.beforeClose),
|
|
1242
|
+
onOpen: I[1] || (I[1] = (L) => n("open")),
|
|
1243
|
+
onOpened: I[2] || (I[2] = (L) => n("opened")),
|
|
1244
|
+
onClose: I[3] || (I[3] = (L) => n("close")),
|
|
1245
|
+
onClosed: I[4] || (I[4] = (L) => n("closed"))
|
|
1246
|
+
}, {
|
|
1247
|
+
default: N(() => [
|
|
1248
|
+
E("div", {
|
|
1249
|
+
class: X(["sq-dialog", [i.value, r(e).class]]),
|
|
1250
|
+
style: J(r(e).style)
|
|
1251
|
+
}, [
|
|
1252
|
+
l.value ? (v(), w("div", Qn, [
|
|
1253
|
+
p.value ? (v(), S(fe(p.value), {
|
|
1254
|
+
key: 0,
|
|
1255
|
+
class: "sq-dialog-header-icon"
|
|
1256
|
+
})) : P("", !0),
|
|
1257
|
+
H(M.$slots, "header", {}, () => [
|
|
1258
|
+
E("span", {
|
|
1259
|
+
class: "sq-dialog-header-title",
|
|
1260
|
+
textContent: Q(t.title)
|
|
1261
|
+
}, null, 8, es)
|
|
1262
|
+
]),
|
|
1263
|
+
z(r(Je), {
|
|
1264
|
+
class: "sq-dialog-close",
|
|
1265
|
+
onClick: $
|
|
1266
|
+
})
|
|
1267
|
+
])) : P("", !0),
|
|
1268
|
+
E("div", ts, [
|
|
1269
|
+
H(M.$slots, "default")
|
|
1270
|
+
]),
|
|
1271
|
+
t.footer ? (v(), w("div", ns, [
|
|
1272
|
+
H(M.$slots, "footer", {}, () => [
|
|
1273
|
+
z(r(te), ve(h.value, { onClick: $ }), {
|
|
1274
|
+
default: N(() => [
|
|
1275
|
+
Oe(Q(t.cancelText), 1)
|
|
1276
|
+
]),
|
|
1277
|
+
_: 1
|
|
1278
|
+
}, 16),
|
|
1279
|
+
z(r(te), ve(m.value, { onClick: B }), {
|
|
1280
|
+
default: N(() => [
|
|
1281
|
+
Oe(Q(t.okText), 1)
|
|
1282
|
+
]),
|
|
1283
|
+
_: 1
|
|
1284
|
+
}, 16)
|
|
1285
|
+
])
|
|
1286
|
+
])) : P("", !0)
|
|
1287
|
+
], 6)
|
|
1288
|
+
]),
|
|
1289
|
+
_: 3
|
|
1290
|
+
}, 8, ["visible", "mask-closeable", "keyboard", "before-close"]));
|
|
1291
|
+
}
|
|
1292
|
+
}), as = "sq-divider", Re = /* @__PURE__ */ R({
|
|
1293
|
+
name: as,
|
|
1294
|
+
__name: "divider",
|
|
1295
|
+
props: {
|
|
1296
|
+
direction: { default: "horizontal" },
|
|
1297
|
+
variant: { default: "solid" },
|
|
1298
|
+
orientation: { default: "left" },
|
|
1299
|
+
ellipsis: { type: [Boolean, Number] },
|
|
1300
|
+
size: {}
|
|
1301
|
+
},
|
|
1302
|
+
setup(u) {
|
|
1303
|
+
const o = Ne(), s = u, e = b(() => {
|
|
1304
|
+
const n = [`sq-divider--${s.direction}`];
|
|
1305
|
+
return ["none", "solid", "dotted", "dashed"].includes(s.variant) && n.push("is-thin"), o.default && s.direction !== "vertical" && n.push(`text-${s.orientation}`), n;
|
|
1306
|
+
});
|
|
1307
|
+
return (n, t) => (v(), w("div", {
|
|
1308
|
+
class: X(["sq-divider", e.value]),
|
|
1309
|
+
style: J({ "--divider-line-type": s.variant })
|
|
1310
|
+
}, [
|
|
1311
|
+
r(o).default && s.direction !== "vertical" ? (v(), S(r(xe), {
|
|
1312
|
+
key: 0,
|
|
1313
|
+
ellipsis: s.ellipsis,
|
|
1314
|
+
size: s.size
|
|
1315
|
+
}, {
|
|
1316
|
+
default: N(() => [
|
|
1317
|
+
H(n.$slots, "default")
|
|
1318
|
+
]),
|
|
1319
|
+
_: 3
|
|
1320
|
+
}, 8, ["ellipsis", "size"])) : P("", !0)
|
|
1321
|
+
], 6));
|
|
1322
|
+
}
|
|
1323
|
+
}), ls = "sq-editor-bold", is = /* @__PURE__ */ R({
|
|
1324
|
+
name: ls,
|
|
1325
|
+
__name: "editor-bold",
|
|
1326
|
+
props: {
|
|
1327
|
+
disabled: { type: Boolean },
|
|
1328
|
+
rows: { default: () => [] },
|
|
1329
|
+
selectedVal: {},
|
|
1330
|
+
selectedRow: {},
|
|
1331
|
+
selectInfo: { default: () => ({}) }
|
|
1332
|
+
},
|
|
1333
|
+
emits: ["updateText"],
|
|
1334
|
+
setup(u, { expose: o, emit: s }) {
|
|
1335
|
+
const e = s, n = u;
|
|
1336
|
+
function t() {
|
|
1337
|
+
if (n.disabled) return;
|
|
1338
|
+
const a = [...n.rows], c = a[n.selectedRow], d = c.substring(0, n.selectInfo.startOfRow), l = c.substring(n.selectInfo.endOfRow);
|
|
1339
|
+
let i = n.selectedVal ?? "";
|
|
1340
|
+
if (i.match(/\*\*\*.*?\*\*\*/)) {
|
|
1341
|
+
i = i.replaceAll("***", "*"), a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, -4);
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
if (i.match(/\*\*.*?\*\*/)) {
|
|
1345
|
+
i = i.replaceAll("**", ""), a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, -4);
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
i = `**${i}**`, a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, 4);
|
|
1349
|
+
}
|
|
1350
|
+
return o({ setBold: t }), (a, c) => (v(), S(r(de), {
|
|
1351
|
+
tip: "加粗 ( Ctrl + B )",
|
|
1352
|
+
disabled: n.disabled
|
|
1353
|
+
}, {
|
|
1354
|
+
default: N(() => [
|
|
1355
|
+
z(r(te), {
|
|
1356
|
+
text: "",
|
|
1357
|
+
icon: r(Pt),
|
|
1358
|
+
disabled: n.disabled,
|
|
1359
|
+
onClick: t
|
|
1360
|
+
}, null, 8, ["icon", "disabled"])
|
|
1361
|
+
]),
|
|
1362
|
+
_: 1
|
|
1363
|
+
}, 8, ["disabled"]));
|
|
1364
|
+
}
|
|
1365
|
+
}), rs = "sq-editor-italic", us = /* @__PURE__ */ R({
|
|
1366
|
+
name: rs,
|
|
1367
|
+
__name: "editor-italic",
|
|
1368
|
+
props: {
|
|
1369
|
+
disabled: { type: Boolean },
|
|
1370
|
+
rows: { default: () => [] },
|
|
1371
|
+
selectedVal: {},
|
|
1372
|
+
selectedRow: {},
|
|
1373
|
+
selectInfo: { default: () => ({}) }
|
|
1374
|
+
},
|
|
1375
|
+
emits: ["updateText"],
|
|
1376
|
+
setup(u, { expose: o, emit: s }) {
|
|
1377
|
+
const e = s, n = u;
|
|
1378
|
+
function t() {
|
|
1379
|
+
if (n.disabled) return;
|
|
1380
|
+
const a = [...n.rows], c = a[n.selectedRow], d = c.substring(0, n.selectInfo.startOfRow), l = c.substring(n.selectInfo.endOfRow);
|
|
1381
|
+
let i = n.selectedVal ?? "";
|
|
1382
|
+
if (i.match(/\*\*\*.*?\*\*\*/)) {
|
|
1383
|
+
i = i.replaceAll("***", "**"), a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, -2);
|
|
1384
|
+
return;
|
|
1385
|
+
}
|
|
1386
|
+
const m = i.match(/\*\*.*?\*\*/), f = ((m == null ? void 0 : m[0]) ?? "").replaceAll("**", "").match(/\*.*?\*/);
|
|
1387
|
+
if (m && !f) {
|
|
1388
|
+
i = `*${i}*`, a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, 2);
|
|
1389
|
+
return;
|
|
1390
|
+
} else if (f) {
|
|
1391
|
+
i = i.replaceAll("**", "[B]").replaceAll("*", "").replaceAll("[B]", "**"), a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, -2);
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
if (i.match(/\*.*?\*/)) {
|
|
1395
|
+
i = i.replaceAll("*", ""), a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, -2);
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
i = `*${i}*`, a[n.selectedRow] = `${d}${i}${l}`, e("updateText", a, 0, 2);
|
|
1399
|
+
}
|
|
1400
|
+
return o({ setItalic: t }), (a, c) => (v(), S(r(de), {
|
|
1401
|
+
tip: "斜体 ( Ctrl + I )",
|
|
1402
|
+
disabled: n.disabled
|
|
1403
|
+
}, {
|
|
1404
|
+
default: N(() => [
|
|
1405
|
+
z(r(te), {
|
|
1406
|
+
text: "",
|
|
1407
|
+
icon: r(Dt),
|
|
1408
|
+
disabled: n.disabled,
|
|
1409
|
+
onClick: t
|
|
1410
|
+
}, null, 8, ["icon", "disabled"])
|
|
1411
|
+
]),
|
|
1412
|
+
_: 1
|
|
1413
|
+
}, 8, ["disabled"]));
|
|
1414
|
+
}
|
|
1415
|
+
}), cs = "sq-editor-underline", ds = /* @__PURE__ */ R({
|
|
1416
|
+
name: cs,
|
|
1417
|
+
__name: "editor-underline",
|
|
1418
|
+
props: {
|
|
1419
|
+
disabled: { type: Boolean },
|
|
1420
|
+
rows: { default: () => [] },
|
|
1421
|
+
selectedVal: {},
|
|
1422
|
+
selectedRow: {},
|
|
1423
|
+
selectInfo: { default: () => ({}) }
|
|
1424
|
+
},
|
|
1425
|
+
emits: ["updateText"],
|
|
1426
|
+
setup(u, { expose: o, emit: s }) {
|
|
1427
|
+
const e = s, n = u;
|
|
1428
|
+
function t() {
|
|
1429
|
+
var f;
|
|
1430
|
+
if (n.disabled) return;
|
|
1431
|
+
const a = [...n.rows], c = a[n.selectedRow], d = c.substring(0, n.selectInfo.startOfRow), l = c.substring(n.selectInfo.endOfRow), i = /<u\b.*?>/;
|
|
1432
|
+
let p = n.selectedVal ?? "";
|
|
1433
|
+
const m = ((f = p.match(i)) == null ? void 0 : f[0]) ?? "";
|
|
1434
|
+
if (p.match(/<u\b.*?>.*?<\/u>/)) {
|
|
1435
|
+
p = p.replace(m, "").replace("</u>", "");
|
|
1436
|
+
const _ = m.length + 4;
|
|
1437
|
+
a[n.selectedRow] = `${d}${p}${l}`, e("updateText", a, 0, -_);
|
|
1438
|
+
return;
|
|
1439
|
+
}
|
|
1440
|
+
p = `<u>${p}</u>`, a[n.selectedRow] = `${d}${p}${l}`, e("updateText", a, 0, 7);
|
|
1441
|
+
}
|
|
1442
|
+
return o({ setUnderline: t }), (a, c) => (v(), S(r(de), {
|
|
1443
|
+
tip: "下划线 ( Ctrl + U )",
|
|
1444
|
+
disabled: n.disabled
|
|
1445
|
+
}, {
|
|
1446
|
+
default: N(() => [
|
|
1447
|
+
z(r(te), {
|
|
1448
|
+
text: "",
|
|
1449
|
+
icon: r(Ot),
|
|
1450
|
+
disabled: n.disabled,
|
|
1451
|
+
onClick: t
|
|
1452
|
+
}, null, 8, ["icon", "disabled"])
|
|
1453
|
+
]),
|
|
1454
|
+
_: 1
|
|
1455
|
+
}, 8, ["disabled"]));
|
|
1456
|
+
}
|
|
1457
|
+
}), fs = "sq-editor-strikethrough", ps = /* @__PURE__ */ R({
|
|
1458
|
+
name: fs,
|
|
1459
|
+
__name: "editor-strikethrough",
|
|
1460
|
+
props: {
|
|
1461
|
+
disabled: { type: Boolean },
|
|
1462
|
+
rows: { default: () => [] },
|
|
1463
|
+
selectedVal: {},
|
|
1464
|
+
selectedRow: {},
|
|
1465
|
+
selectInfo: { default: () => ({}) }
|
|
1466
|
+
},
|
|
1467
|
+
emits: ["updateText"],
|
|
1468
|
+
setup(u, { emit: o }) {
|
|
1469
|
+
const s = o, e = u;
|
|
1470
|
+
function n() {
|
|
1471
|
+
if (e.disabled) return;
|
|
1472
|
+
const t = [...e.rows], a = t[e.selectedRow], c = a.substring(0, e.selectInfo.startOfRow), d = a.substring(e.selectInfo.endOfRow);
|
|
1473
|
+
let l = e.selectedVal ?? "";
|
|
1474
|
+
if (l.match(/\~\~.*?\~\~/)) {
|
|
1475
|
+
l = l.replaceAll("~~", ""), t[e.selectedRow] = `${c}${l}${d}`, s("updateText", t, 0, -4);
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
l = `~~${l}~~`, t[e.selectedRow] = `${c}${l}${d}`, s("updateText", t, 0, 4);
|
|
1479
|
+
}
|
|
1480
|
+
return (t, a) => (v(), S(r(de), {
|
|
1481
|
+
tip: "删除线",
|
|
1482
|
+
disabled: e.disabled
|
|
1483
|
+
}, {
|
|
1484
|
+
default: N(() => [
|
|
1485
|
+
z(r(te), {
|
|
1486
|
+
text: "",
|
|
1487
|
+
icon: r(Nt),
|
|
1488
|
+
disabled: e.disabled,
|
|
1489
|
+
onClick: n
|
|
1490
|
+
}, null, 8, ["icon", "disabled"])
|
|
1491
|
+
]),
|
|
1492
|
+
_: 1
|
|
1493
|
+
}, 8, ["disabled"]));
|
|
1494
|
+
}
|
|
1495
|
+
}), vs = "sq-editor-blur", ms = /* @__PURE__ */ R({
|
|
1496
|
+
name: vs,
|
|
1497
|
+
__name: "editor-blur",
|
|
1498
|
+
props: {
|
|
1499
|
+
disabled: { type: Boolean },
|
|
1500
|
+
rows: { default: () => [] },
|
|
1501
|
+
selectedVal: {},
|
|
1502
|
+
selectedRow: {},
|
|
1503
|
+
selectInfo: { default: () => ({}) }
|
|
1504
|
+
},
|
|
1505
|
+
emits: ["updateText"],
|
|
1506
|
+
setup(u, { emit: o }) {
|
|
1507
|
+
const s = o, e = u;
|
|
1508
|
+
function n() {
|
|
1509
|
+
var h;
|
|
1510
|
+
if (e.disabled) return;
|
|
1511
|
+
const t = [...e.rows], a = t[e.selectedRow], c = a.substring(0, e.selectInfo.startOfRow), d = a.substring(e.selectInfo.endOfRow), l = /<blur\b.*?>/;
|
|
1512
|
+
let i = e.selectedVal ?? "";
|
|
1513
|
+
const p = ((h = i.match(l)) == null ? void 0 : h[0]) ?? "";
|
|
1514
|
+
if (i.match(/<blur\b.*?>.*?<\/blur>/)) {
|
|
1515
|
+
i = i.replace(p, "").replace("</blur>", "");
|
|
1516
|
+
const f = p.length + 7;
|
|
1517
|
+
t[e.selectedRow] = `${c}${i}${d}`, s("updateText", t, 0, -f);
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
i = `<blur>${i}</blur>`, t[e.selectedRow] = `${c}${i}${d}`, s("updateText", t, 0, 13);
|
|
1521
|
+
}
|
|
1522
|
+
return (t, a) => (v(), S(r(de), {
|
|
1523
|
+
tip: "模糊块",
|
|
1524
|
+
disabled: e.disabled
|
|
1525
|
+
}, {
|
|
1526
|
+
default: N(() => [
|
|
1527
|
+
z(r(te), {
|
|
1528
|
+
text: "",
|
|
1529
|
+
icon: r(ht),
|
|
1530
|
+
disabled: e.disabled,
|
|
1531
|
+
onClick: n
|
|
1532
|
+
}, null, 8, ["icon", "disabled"])
|
|
1533
|
+
]),
|
|
1534
|
+
_: 1
|
|
1535
|
+
}, 8, ["disabled"]));
|
|
1536
|
+
}
|
|
1537
|
+
}), hs = "sq-editor-ul", gs = /* @__PURE__ */ R({
|
|
1538
|
+
name: hs,
|
|
1539
|
+
__name: "editor-ul",
|
|
1540
|
+
props: {
|
|
1541
|
+
disabled: { type: Boolean },
|
|
1542
|
+
rows: { default: () => [] },
|
|
1543
|
+
selectedVal: {},
|
|
1544
|
+
selectedRow: {},
|
|
1545
|
+
selectInfo: { default: () => ({}) }
|
|
1546
|
+
},
|
|
1547
|
+
emits: ["updateText"],
|
|
1548
|
+
setup(u, { emit: o }) {
|
|
1549
|
+
const s = o, e = u;
|
|
1550
|
+
function n() {
|
|
1551
|
+
const d = e.selectedRow, l = [...e.rows], i = l[d];
|
|
1552
|
+
if (t(i)) {
|
|
1553
|
+
l[d] = i.replace("- ", ""), s("updateText", l, -2, -2);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
if (a(i)) {
|
|
1557
|
+
const p = c(i), m = 2 - p.length;
|
|
1558
|
+
l[d] = i.replace(p, "- "), s("updateText", l, m, m);
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
l[d] = `- ${i}`, s("updateText", l, 2, 2);
|
|
1562
|
+
}
|
|
1563
|
+
function t(d) {
|
|
1564
|
+
return d.replace(" ", "").startsWith("- ");
|
|
1565
|
+
}
|
|
1566
|
+
function a(d) {
|
|
1567
|
+
return /^\d+\.\s+/.test(d.replace(" ", ""));
|
|
1568
|
+
}
|
|
1569
|
+
function c(d) {
|
|
1570
|
+
return d.replace(" ", "").match(/^\d+\.\s/)[0];
|
|
1571
|
+
}
|
|
1572
|
+
return (d, l) => (v(), S(r(de), {
|
|
1573
|
+
tip: "无序列表",
|
|
1574
|
+
disabled: e.disabled
|
|
1575
|
+
}, {
|
|
1576
|
+
default: N(() => [
|
|
1577
|
+
z(r(te), {
|
|
1578
|
+
text: "",
|
|
1579
|
+
icon: r(Vt),
|
|
1580
|
+
disabled: e.disabled,
|
|
1581
|
+
onClick: n
|
|
1582
|
+
}, null, 8, ["icon", "disabled"])
|
|
1583
|
+
]),
|
|
1584
|
+
_: 1
|
|
1585
|
+
}, 8, ["disabled"]));
|
|
1586
|
+
}
|
|
1587
|
+
}), bs = "sq-editor-ol", ys = /* @__PURE__ */ R({
|
|
1588
|
+
name: bs,
|
|
1589
|
+
__name: "editor-ol",
|
|
1590
|
+
props: {
|
|
1591
|
+
disabled: { type: Boolean },
|
|
1592
|
+
rows: { default: () => [] },
|
|
1593
|
+
selectedVal: {},
|
|
1594
|
+
selectedRow: {},
|
|
1595
|
+
selectInfo: { default: () => ({}) }
|
|
1596
|
+
},
|
|
1597
|
+
emits: ["updateText"],
|
|
1598
|
+
setup(u, { emit: o }) {
|
|
1599
|
+
const s = o, e = u;
|
|
1600
|
+
function n() {
|
|
1601
|
+
const d = e.selectedRow, l = [...e.rows], i = l[d], p = d > 0 ? l[d - 1] : "";
|
|
1602
|
+
let m = 1;
|
|
1603
|
+
if (t(i)) {
|
|
1604
|
+
p && a(p) && (m = parseInt(c(p)) + 1);
|
|
1605
|
+
const _ = `${m}. `, $ = _.length - 2;
|
|
1606
|
+
l[d] = i.replace("- ", _), s("updateText", l, $, $);
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
if (a(i)) {
|
|
1610
|
+
const _ = c(i), $ = -_.length;
|
|
1611
|
+
l[d] = i.replace(_, ""), s("updateText", l, $, $);
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
p && a(p) && (m = parseInt(c(p)) + 1);
|
|
1615
|
+
const h = `${m}. `, f = h.length;
|
|
1616
|
+
l[d] = `${h}${i}`, s("updateText", l, f, f);
|
|
1617
|
+
}
|
|
1618
|
+
function t(d) {
|
|
1619
|
+
return d.replace(" ", "").startsWith("- ");
|
|
1620
|
+
}
|
|
1621
|
+
function a(d) {
|
|
1622
|
+
return /^\d+\.\s+/.test(d.replace(" ", ""));
|
|
1623
|
+
}
|
|
1624
|
+
function c(d) {
|
|
1625
|
+
return d.replace(" ", "").match(/^\d+\.\s/)[0];
|
|
1626
|
+
}
|
|
1627
|
+
return (d, l) => (v(), S(r(de), {
|
|
1628
|
+
tip: "有序列表",
|
|
1629
|
+
disabled: e.disabled
|
|
1630
|
+
}, {
|
|
1631
|
+
default: N(() => [
|
|
1632
|
+
z(r(te), {
|
|
1633
|
+
text: "",
|
|
1634
|
+
icon: r(Ut),
|
|
1635
|
+
disabled: e.disabled,
|
|
1636
|
+
onClick: n
|
|
1637
|
+
}, null, 8, ["icon", "disabled"])
|
|
1638
|
+
]),
|
|
1639
|
+
_: 1
|
|
1640
|
+
}, 8, ["disabled"]));
|
|
1641
|
+
}
|
|
1642
|
+
}), xs = { class: "sq-editor-body" }, _s = { class: "sq-editor-toolbar" }, $s = { class: "sq-editor-control" }, ks = "sq-editor", za = /* @__PURE__ */ R({
|
|
1643
|
+
name: ks,
|
|
1644
|
+
__name: "editor",
|
|
1645
|
+
props: /* @__PURE__ */ Z({
|
|
1646
|
+
round: { type: Boolean },
|
|
1647
|
+
disabled: { type: Boolean },
|
|
1648
|
+
placeholder: {},
|
|
1649
|
+
maxlength: {},
|
|
1650
|
+
minlength: {},
|
|
1651
|
+
md: { type: Boolean, default: !0 },
|
|
1652
|
+
size: { default: "md" },
|
|
1653
|
+
beforePreview: {}
|
|
1654
|
+
}, {
|
|
1655
|
+
value: { default: "" },
|
|
1656
|
+
valueModifiers: {}
|
|
1657
|
+
}),
|
|
1658
|
+
emits: ["update:value"],
|
|
1659
|
+
setup(u) {
|
|
1660
|
+
const o = [
|
|
1661
|
+
{
|
|
1662
|
+
text: "编辑",
|
|
1663
|
+
value: "edit"
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
text: "预览",
|
|
1667
|
+
value: "preview"
|
|
1668
|
+
}
|
|
1669
|
+
];
|
|
1670
|
+
let s;
|
|
1671
|
+
const e = u, n = T("edit"), t = T([]), a = T(!1), c = T(""), d = T(), l = T({}), i = re(null), p = re(null), m = re(null), h = re(
|
|
1672
|
+
null
|
|
1673
|
+
), f = ae(u, "value"), _ = b(() => {
|
|
1674
|
+
const x = [];
|
|
1675
|
+
return e.size !== "md" && x.push(`sq-editor--${e.size}`), e.round && x.push("is-round"), x;
|
|
1676
|
+
}), $ = b(
|
|
1677
|
+
() => c.value.length && !c.value.includes(`
|
|
1678
|
+
`) && c.value !== " " && !e.disabled
|
|
1679
|
+
), B = b(
|
|
1680
|
+
() => d.value !== void 0 && !c.value.length && !e.disabled
|
|
1681
|
+
), M = b(
|
|
1682
|
+
() => typeof e.beforePreview == "function" ? e.beforePreview(f.value) : f.value
|
|
1683
|
+
);
|
|
1684
|
+
le(() => {
|
|
1685
|
+
document.addEventListener("selectionchange", F), document.addEventListener("click", W);
|
|
1686
|
+
}), ye(() => {
|
|
1687
|
+
document.removeEventListener("selectionchange", F), document.removeEventListener("click", W);
|
|
1688
|
+
});
|
|
1689
|
+
function I(x) {
|
|
1690
|
+
x === "edit" && $e(() => {
|
|
1691
|
+
var g;
|
|
1692
|
+
(g = i.value) == null || g.focus();
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
function L(x) {
|
|
1696
|
+
var O, j, Y;
|
|
1697
|
+
const g = t.value[d.value], q = (g == null ? void 0 : g.replace(" ", "")) ?? "";
|
|
1698
|
+
if (x.key === "Tab") {
|
|
1699
|
+
x.preventDefault();
|
|
1700
|
+
const A = g.substring(0, l.value.startOfRow), D = g.substring(l.value.endOfRow);
|
|
1701
|
+
t.value[d.value] = `${A} ${D}`, y(t.value, 1, 1);
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
if (x.ctrlKey)
|
|
1705
|
+
switch (x.key.toUpperCase()) {
|
|
1706
|
+
case "B":
|
|
1707
|
+
(O = p.value) == null || O.setBold();
|
|
1708
|
+
return;
|
|
1709
|
+
case "I":
|
|
1710
|
+
(j = m.value) == null || j.setItalic();
|
|
1711
|
+
return;
|
|
1712
|
+
case "U":
|
|
1713
|
+
x.preventDefault(), (Y = h.value) == null || Y.setUnderline();
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
if (x.key === "Enter") {
|
|
1717
|
+
if (k(g)) {
|
|
1718
|
+
x.preventDefault();
|
|
1719
|
+
const A = g.substring(0, g.indexOf("- "));
|
|
1720
|
+
if (q !== "- ") {
|
|
1721
|
+
const G = 3 + A.length;
|
|
1722
|
+
t.value[d.value] = `${g}
|
|
1723
|
+
${A}- `, ne(x.target), y(t.value, G, G);
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
const D = 2 + A.length;
|
|
1727
|
+
t.value[d.value] = g.substring(D), y(t.value, -D, -D);
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
if (C(g)) {
|
|
1731
|
+
x.preventDefault();
|
|
1732
|
+
const A = q.match(/^\d+\.\s/)[0], G = `${parseInt(A) + 1}. `, ce = g.substring(0, g.indexOf(A));
|
|
1733
|
+
if (q !== A) {
|
|
1734
|
+
const we = G.length + ce.length + 1;
|
|
1735
|
+
t.value[d.value] = `${g}
|
|
1736
|
+
${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
const he = A.length + ce.length;
|
|
1740
|
+
t.value[d.value] = g.substring(he), y(t.value, -he, -he);
|
|
1741
|
+
return;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
function F(x) {
|
|
1746
|
+
var q;
|
|
1747
|
+
const g = window.getSelection();
|
|
1748
|
+
(g == null ? void 0 : g.focusNode) === ((q = i.value) == null ? void 0 : q.$el) && (s = x.target, !((s == null ? void 0 : s.selectionStart) === void 0 || (s == null ? void 0 : s.selectionEnd) === void 0) && (l.value.start = (s == null ? void 0 : s.selectionStart) ?? 0, l.value.end = (s == null ? void 0 : s.selectionEnd) ?? 0, c.value = f.value.substring(
|
|
1749
|
+
l.value.start,
|
|
1750
|
+
l.value.end
|
|
1751
|
+
), V()));
|
|
1752
|
+
}
|
|
1753
|
+
function W() {
|
|
1754
|
+
c.value = "", d.value = void 0;
|
|
1755
|
+
}
|
|
1756
|
+
function ne(x) {
|
|
1757
|
+
const g = x.selectionStart, O = f.value.substring(0, g ?? 0).split(`
|
|
1758
|
+
`).length + 1, j = x.scrollTop, Y = window.getComputedStyle(x), A = parseFloat(Y.lineHeight), D = parseFloat(Y.height), ce = parseFloat(Y.paddingBlockStart) + A * O;
|
|
1759
|
+
D + j > ce || requestAnimationFrame(() => {
|
|
1760
|
+
x.scrollTo({ top: ce - D });
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
function V() {
|
|
1764
|
+
const x = s.selectionStart, g = f.value.substring(0, x ?? 0);
|
|
1765
|
+
d.value = g.split(`
|
|
1766
|
+
`).length - 1;
|
|
1767
|
+
const q = Math.max(g.lastIndexOf(`
|
|
1768
|
+
`) + 1, 0);
|
|
1769
|
+
l.value.startOfRow = l.value.start - q, l.value.endOfRow = l.value.startOfRow + c.value.length, t.value = f.value.split(`
|
|
1770
|
+
`);
|
|
1771
|
+
}
|
|
1772
|
+
function k(x) {
|
|
1773
|
+
return x.replace(" ", "").startsWith("- ");
|
|
1774
|
+
}
|
|
1775
|
+
function C(x) {
|
|
1776
|
+
return /^\d+\.\s+/.test(x.replace(" ", ""));
|
|
1777
|
+
}
|
|
1778
|
+
function y(x, g = 0, q = 0) {
|
|
1779
|
+
a.value || (t.value = [...x], f.value = t.value.join(`
|
|
1780
|
+
`), l.value.start += g, l.value.end += q, l.value.startOfRow += g, l.value.endOfRow += q, s == null || s.focus(), a.value = !0, $e(() => {
|
|
1781
|
+
s == null || s.setSelectionRange(l.value.start, l.value.end), setTimeout(() => {
|
|
1782
|
+
a.value = !1;
|
|
1783
|
+
}, 100);
|
|
1784
|
+
}));
|
|
1785
|
+
}
|
|
1786
|
+
return (x, g) => (v(), w("div", {
|
|
1787
|
+
class: X(["sq-editor", _.value]),
|
|
1788
|
+
onClick: g[2] || (g[2] = ge(() => {
|
|
1789
|
+
}, ["stop"]))
|
|
1790
|
+
}, [
|
|
1791
|
+
ue(E("div", xs, [
|
|
1792
|
+
e.md ? (v(), w(se, { key: 0 }, [
|
|
1793
|
+
E("div", _s, [
|
|
1794
|
+
z(is, {
|
|
1795
|
+
ref_key: "boldRef",
|
|
1796
|
+
ref: p,
|
|
1797
|
+
disabled: !$.value,
|
|
1798
|
+
rows: t.value,
|
|
1799
|
+
"selected-val": c.value,
|
|
1800
|
+
"selected-row": d.value,
|
|
1801
|
+
"select-info": l.value,
|
|
1802
|
+
onUpdateText: y
|
|
1803
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1804
|
+
z(us, {
|
|
1805
|
+
ref_key: "italicRef",
|
|
1806
|
+
ref: m,
|
|
1807
|
+
disabled: !$.value,
|
|
1808
|
+
rows: t.value,
|
|
1809
|
+
"selected-val": c.value,
|
|
1810
|
+
"selected-row": d.value,
|
|
1811
|
+
"select-info": l.value,
|
|
1812
|
+
onUpdateText: y
|
|
1813
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1814
|
+
z(ds, {
|
|
1815
|
+
ref_key: "underlineRef",
|
|
1816
|
+
ref: h,
|
|
1817
|
+
disabled: !$.value,
|
|
1818
|
+
rows: t.value,
|
|
1819
|
+
"selected-val": c.value,
|
|
1820
|
+
"selected-row": d.value,
|
|
1821
|
+
"select-info": l.value,
|
|
1822
|
+
onUpdateText: y
|
|
1823
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1824
|
+
z(ps, {
|
|
1825
|
+
disabled: !$.value,
|
|
1826
|
+
rows: t.value,
|
|
1827
|
+
"selected-val": c.value,
|
|
1828
|
+
"selected-row": d.value,
|
|
1829
|
+
"select-info": l.value,
|
|
1830
|
+
onUpdateText: y
|
|
1831
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1832
|
+
z(ms, {
|
|
1833
|
+
disabled: !$.value,
|
|
1834
|
+
rows: t.value,
|
|
1835
|
+
"selected-val": c.value,
|
|
1836
|
+
"selected-row": d.value,
|
|
1837
|
+
"select-info": l.value,
|
|
1838
|
+
onUpdateText: y
|
|
1839
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1840
|
+
z(r(Re), { direction: "vertical" }),
|
|
1841
|
+
z(gs, {
|
|
1842
|
+
disabled: !B.value,
|
|
1843
|
+
rows: t.value,
|
|
1844
|
+
"selected-val": c.value,
|
|
1845
|
+
"selected-row": d.value,
|
|
1846
|
+
"select-info": l.value,
|
|
1847
|
+
onUpdateText: y
|
|
1848
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1849
|
+
z(ys, {
|
|
1850
|
+
disabled: !B.value,
|
|
1851
|
+
rows: t.value,
|
|
1852
|
+
"selected-val": c.value,
|
|
1853
|
+
"selected-row": d.value,
|
|
1854
|
+
"select-info": l.value,
|
|
1855
|
+
onUpdateText: y
|
|
1856
|
+
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"])
|
|
1857
|
+
]),
|
|
1858
|
+
z(r(Re))
|
|
1859
|
+
], 64)) : P("", !0),
|
|
1860
|
+
z(r(nt), {
|
|
1861
|
+
class: X({ "has-shadow": !e.md }),
|
|
1862
|
+
ref_key: "inputRef",
|
|
1863
|
+
ref: i,
|
|
1864
|
+
type: "textarea",
|
|
1865
|
+
resize: "none",
|
|
1866
|
+
size: e.size,
|
|
1867
|
+
round: e.round,
|
|
1868
|
+
disabled: e.disabled,
|
|
1869
|
+
placeholder: e.placeholder,
|
|
1870
|
+
maxlength: e.maxlength,
|
|
1871
|
+
minlength: e.minlength,
|
|
1872
|
+
value: f.value,
|
|
1873
|
+
"onUpdate:value": g[0] || (g[0] = (q) => f.value = q),
|
|
1874
|
+
onKeydown: L
|
|
1875
|
+
}, null, 8, ["class", "size", "round", "disabled", "placeholder", "maxlength", "minlength", "value"])
|
|
1876
|
+
], 512), [
|
|
1877
|
+
[be, n.value === "edit"]
|
|
1878
|
+
]),
|
|
1879
|
+
n.value === "preview" ? (v(), S(r(gn), {
|
|
1880
|
+
key: 0,
|
|
1881
|
+
text: M.value,
|
|
1882
|
+
md: e.md
|
|
1883
|
+
}, null, 8, ["text", "md"])) : P("", !0),
|
|
1884
|
+
E("div", $s, [
|
|
1885
|
+
z(r(Po), {
|
|
1886
|
+
size: e.size,
|
|
1887
|
+
round: e.round,
|
|
1888
|
+
disabled: e.disabled,
|
|
1889
|
+
items: o,
|
|
1890
|
+
value: n.value,
|
|
1891
|
+
"onUpdate:value": g[1] || (g[1] = (q) => n.value = q),
|
|
1892
|
+
onChange: I
|
|
1893
|
+
}, null, 8, ["size", "round", "disabled", "value"]),
|
|
1894
|
+
H(x.$slots, "control")
|
|
1895
|
+
])
|
|
1896
|
+
], 2));
|
|
1897
|
+
}
|
|
1898
|
+
}), ws = ["textContent", "for"], qs = { class: "sq-form-item-content" }, Cs = ["textContent"], Ss = "sq-form-item", Bs = /* @__PURE__ */ R({
|
|
1899
|
+
name: Ss,
|
|
1900
|
+
__name: "form-item",
|
|
1901
|
+
props: {
|
|
1902
|
+
label: {},
|
|
1903
|
+
labelWidth: {},
|
|
1904
|
+
isRequired: { type: Boolean },
|
|
1905
|
+
showLabel: { type: Boolean },
|
|
1906
|
+
type: {},
|
|
1907
|
+
errorMsg: {}
|
|
1908
|
+
},
|
|
1909
|
+
setup(u) {
|
|
1910
|
+
const { nextId: o } = Fe(), s = u, e = T(""), n = T("");
|
|
1911
|
+
Ce(tt, e);
|
|
1912
|
+
const t = b(() => {
|
|
1913
|
+
const d = [];
|
|
1914
|
+
return s.isRequired && d.push("is-required"), d;
|
|
1915
|
+
}), a = b(() => ["input", "switch", "select"].includes(s.type));
|
|
1916
|
+
ie(
|
|
1917
|
+
() => s.errorMsg,
|
|
1918
|
+
(d) => {
|
|
1919
|
+
d && (n.value = d);
|
|
1920
|
+
}
|
|
1921
|
+
), le(() => {
|
|
1922
|
+
a.value && (e.value = `sq-form-item-${o()}`);
|
|
1923
|
+
});
|
|
1924
|
+
function c() {
|
|
1925
|
+
n.value = "";
|
|
1926
|
+
}
|
|
1927
|
+
return (d, l) => (v(), w("div", {
|
|
1928
|
+
class: "sq-form-item",
|
|
1929
|
+
style: J({ "--form-label-width": s.labelWidth })
|
|
1930
|
+
}, [
|
|
1931
|
+
s.label || s.showLabel ? (v(), w("label", {
|
|
1932
|
+
key: 0,
|
|
1933
|
+
class: X(["sq-form-item-label", t.value]),
|
|
1934
|
+
textContent: Q(s.label),
|
|
1935
|
+
for: s.type !== "custom" ? e.value : void 0
|
|
1936
|
+
}, null, 10, ws)) : P("", !0),
|
|
1937
|
+
E("div", qs, [
|
|
1938
|
+
H(d.$slots, "default"),
|
|
1939
|
+
z(ke, {
|
|
1940
|
+
appear: "",
|
|
1941
|
+
name: "sq-zoom-top",
|
|
1942
|
+
onAfterLeave: c
|
|
1943
|
+
}, {
|
|
1944
|
+
default: N(() => [
|
|
1945
|
+
ue(E("span", {
|
|
1946
|
+
class: "sq-form-item-check",
|
|
1947
|
+
textContent: Q(n.value)
|
|
1948
|
+
}, null, 8, Cs), [
|
|
1949
|
+
[be, s.errorMsg]
|
|
1950
|
+
])
|
|
1951
|
+
]),
|
|
1952
|
+
_: 1
|
|
1953
|
+
})
|
|
1954
|
+
])
|
|
1955
|
+
], 4));
|
|
1956
|
+
}
|
|
1957
|
+
}), Ts = "sq-form", Ra = /* @__PURE__ */ R({
|
|
1958
|
+
name: Ts,
|
|
1959
|
+
__name: "form",
|
|
1960
|
+
props: {
|
|
1961
|
+
round: { type: Boolean, default: void 0 },
|
|
1962
|
+
layout: { default: "horizontal" },
|
|
1963
|
+
showStatusIcon: { type: Boolean },
|
|
1964
|
+
invalidStatus: { default: "error" },
|
|
1965
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1966
|
+
readonly: { type: Boolean, default: void 0 },
|
|
1967
|
+
labelWidth: {},
|
|
1968
|
+
size: { default: "md" },
|
|
1969
|
+
step: {},
|
|
1970
|
+
hasFeedback: { type: Boolean, default: !0 },
|
|
1971
|
+
requiredMark: { default: "default" },
|
|
1972
|
+
items: {},
|
|
1973
|
+
formData: {}
|
|
1974
|
+
},
|
|
1975
|
+
emits: ["validate", "update:formData"],
|
|
1976
|
+
setup(u, { expose: o, emit: s }) {
|
|
1977
|
+
let e = {};
|
|
1978
|
+
const n = s, t = u;
|
|
1979
|
+
Ce(
|
|
1980
|
+
Ee,
|
|
1981
|
+
T({
|
|
1982
|
+
size: oe(t, "size"),
|
|
1983
|
+
round: oe(t, "round"),
|
|
1984
|
+
disabled: oe(t, "disabled"),
|
|
1985
|
+
readonly: oe(t, "readonly")
|
|
1986
|
+
})
|
|
1987
|
+
);
|
|
1988
|
+
const a = T({}), c = T([]), d = T({}), l = b(() => {
|
|
1989
|
+
const k = [`is-${t.layout}`];
|
|
1990
|
+
return t.size !== "md" && k.push(`sq-form--${t.size}`), t.requiredMark !== "hidden" && k.push(`required-${t.requiredMark}`), k;
|
|
1991
|
+
}), i = b(() => ({
|
|
1992
|
+
"--form-label-width": t.labelWidth
|
|
1993
|
+
})), p = b(() => {
|
|
1994
|
+
const k = t.step;
|
|
1995
|
+
return k === void 0 ? t.items : t.items.filter((C) => C.step === void 0 ? C : Array.isArray(C.step) ? C.step.includes(k) : C.step === k);
|
|
1996
|
+
});
|
|
1997
|
+
le(() => {
|
|
1998
|
+
e = structuredClone(ze(t.formData));
|
|
1999
|
+
});
|
|
2000
|
+
function m(k) {
|
|
2001
|
+
var C;
|
|
2002
|
+
return (C = k.rule) == null ? void 0 : C.required;
|
|
2003
|
+
}
|
|
2004
|
+
function h(k) {
|
|
2005
|
+
if (d.value[k]) return Ue;
|
|
2006
|
+
if (c.value.includes(k)) return vt;
|
|
2007
|
+
if (a.value[k])
|
|
2008
|
+
return t.invalidStatus === "error" ? pt : ft;
|
|
2009
|
+
}
|
|
2010
|
+
async function f(k, C, y, x = !0) {
|
|
2011
|
+
if (!y) return;
|
|
2012
|
+
const g = y.trigger ?? "change", q = Array.isArray(g) ? "array" : "string";
|
|
2013
|
+
if (C) {
|
|
2014
|
+
if (q === "array" && !g.includes(C)) return;
|
|
2015
|
+
if (q === "string" && g !== C) return;
|
|
2016
|
+
}
|
|
2017
|
+
c.value = c.value.filter((A) => A !== k), W(k), d.value[k] = new AbortController(), await $e();
|
|
2018
|
+
const O = t.formData[k];
|
|
2019
|
+
let j = !1;
|
|
2020
|
+
const Y = y.validateType ?? "string";
|
|
2021
|
+
return y.validateFunc ? j = await $(k, O, y, C) : Y === "string" ? j = B(k, O, y) : Y === "boolean" ? j = M(k, O, y) : Y === "list" && (j = I(k, O, y)), x && n("validate", k, j, ze(c.value)), d.value[k].signal.aborted || W(k), j;
|
|
2022
|
+
}
|
|
2023
|
+
function _(k) {
|
|
2024
|
+
if (a.value[k]) return t.invalidStatus;
|
|
2025
|
+
}
|
|
2026
|
+
async function $(k, C, y, x) {
|
|
2027
|
+
const g = d.value[k].signal, q = await y.validateFunc(C, g, x);
|
|
2028
|
+
if (q === void 0) {
|
|
2029
|
+
c.value = c.value.filter((O) => O !== k), delete a.value[k];
|
|
2030
|
+
return;
|
|
2031
|
+
}
|
|
2032
|
+
return q === !0 ? F(k) : q === !1 ? L(k, "字段验证失败") : q ? L(k, q) : F(k), q === !0 || typeof q == "string" && !q;
|
|
2033
|
+
}
|
|
2034
|
+
function B(k, C, y) {
|
|
2035
|
+
return y.required && !C ? (L(k, y.requiredText ?? "字段必填"), !1) : y.pattern && C && !y.pattern.test(C) ? (L(k, y.patternText ?? "字段验证失败"), !1) : (F(k), !0);
|
|
2036
|
+
}
|
|
2037
|
+
function M(k, C, y) {
|
|
2038
|
+
return y.required && C === void 0 ? (L(k, y.requiredText ?? "字段必填"), !1) : (F(k), !0);
|
|
2039
|
+
}
|
|
2040
|
+
function I(k, C, y) {
|
|
2041
|
+
return y.required && (!C || !C.length) ? (L(k, y.requiredText ?? "字段必填"), !1) : y.pattern && C && C.map((q) => q.toString()).map((q) => y.pattern.test(q)).includes(!1) ? (L(k, y.patternText ?? "字段验证失败"), !1) : (F(k), !0);
|
|
2042
|
+
}
|
|
2043
|
+
function L(k, C) {
|
|
2044
|
+
c.value = c.value.filter((y) => y !== k), a.value[k] = C;
|
|
2045
|
+
}
|
|
2046
|
+
function F(k) {
|
|
2047
|
+
c.value.push(k), delete a.value[k];
|
|
2048
|
+
}
|
|
2049
|
+
function W(k) {
|
|
2050
|
+
var C;
|
|
2051
|
+
(C = d.value[k]) == null || C.abort(), delete d.value[k];
|
|
2052
|
+
}
|
|
2053
|
+
function ne() {
|
|
2054
|
+
n("update:formData", structuredClone(e)), a.value = {}, c.value = [], n("validate", "SQFORM", !1, ze(c.value));
|
|
2055
|
+
}
|
|
2056
|
+
function V(k = !0) {
|
|
2057
|
+
const y = (k ? t.items : p.value).filter(
|
|
2058
|
+
(x) => x.type !== "custom" && x.rule && !c.value.includes(x.binding)
|
|
2059
|
+
).map((x) => {
|
|
2060
|
+
const g = x;
|
|
2061
|
+
return f(g.binding, void 0, g.rule, !1);
|
|
2062
|
+
});
|
|
2063
|
+
return Promise.all(y).then((x) => (n("validate", "SQFORM", !x.includes(!1), ze(c.value)), x));
|
|
2064
|
+
}
|
|
2065
|
+
return o({ resetFields: ne, validate: V }), (k, C) => (v(), w("form", {
|
|
2066
|
+
class: X(["sq-form", l.value]),
|
|
2067
|
+
style: J(i.value),
|
|
2068
|
+
onSubmit: C[0] || (C[0] = ge(() => {
|
|
2069
|
+
}, ["prevent"]))
|
|
2070
|
+
}, [
|
|
2071
|
+
(v(!0), w(se, null, pe(p.value, (y, x) => (v(), S(Bs, {
|
|
2072
|
+
class: X(y.itemClass),
|
|
2073
|
+
type: y.type,
|
|
2074
|
+
key: x,
|
|
2075
|
+
"label-width": y.labelWidth,
|
|
2076
|
+
label: y.label,
|
|
2077
|
+
"show-label": y.showLabel && t.layout !== "vertical",
|
|
2078
|
+
"is-required": m(y),
|
|
2079
|
+
"error-msg": t.hasFeedback ? a.value[y.binding] : ""
|
|
2080
|
+
}, {
|
|
2081
|
+
default: N(() => [
|
|
2082
|
+
y.type === "input" ? (v(), S(r(nt), ve({
|
|
2083
|
+
key: 0,
|
|
2084
|
+
ref_for: !0
|
|
2085
|
+
}, y.props, {
|
|
2086
|
+
name: y.name,
|
|
2087
|
+
status: _(y.binding),
|
|
2088
|
+
"suffix-icon": h(y.binding),
|
|
2089
|
+
value: t.formData[y.binding],
|
|
2090
|
+
"onUpdate:value": (g) => t.formData[y.binding] = g,
|
|
2091
|
+
onChange: (g) => f(y.binding, "change", y.rule),
|
|
2092
|
+
onInput: (g) => f(y.binding, "input", y.rule),
|
|
2093
|
+
onBlur: (g) => f(y.binding, "blur", y.rule)
|
|
2094
|
+
}), null, 16, ["name", "status", "suffix-icon", "value", "onUpdate:value", "onChange", "onInput", "onBlur"])) : y.type === "checkbox" ? (v(), S(r(Yn), ve({
|
|
2095
|
+
key: 1,
|
|
2096
|
+
ref_for: !0
|
|
2097
|
+
}, y.props, {
|
|
2098
|
+
name: y.name,
|
|
2099
|
+
value: t.formData[y.binding],
|
|
2100
|
+
"onUpdate:value": (g) => t.formData[y.binding] = g,
|
|
2101
|
+
onChange: (g) => f(y.binding, "change", y.rule)
|
|
2102
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : y.type === "radio" ? (v(), S(r(Eo), ve({
|
|
2103
|
+
key: 2,
|
|
2104
|
+
ref_for: !0
|
|
2105
|
+
}, y.props, {
|
|
2106
|
+
name: y.name,
|
|
2107
|
+
value: t.formData[y.binding],
|
|
2108
|
+
"onUpdate:value": (g) => t.formData[y.binding] = g,
|
|
2109
|
+
onChange: (g) => f(y.binding, "change", y.rule)
|
|
2110
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : y.type === "switch" ? (v(), S(r(Zo), ve({
|
|
2111
|
+
key: 3,
|
|
2112
|
+
ref_for: !0
|
|
2113
|
+
}, y.props, {
|
|
2114
|
+
name: y.name,
|
|
2115
|
+
loading: d.value[y.binding] !== void 0,
|
|
2116
|
+
checked: t.formData[y.binding],
|
|
2117
|
+
"onUpdate:checked": (g) => t.formData[y.binding] = g,
|
|
2118
|
+
onChange: (g) => f(y.binding, "change", y.rule)
|
|
2119
|
+
}), null, 16, ["name", "loading", "checked", "onUpdate:checked", "onChange"])) : y.type === "select" ? (v(), S(r(jo), ve({
|
|
2120
|
+
key: 4,
|
|
2121
|
+
ref_for: !0
|
|
2122
|
+
}, y.props, {
|
|
2123
|
+
name: y.name,
|
|
2124
|
+
value: t.formData[y.binding],
|
|
2125
|
+
"onUpdate:value": (g) => t.formData[y.binding] = g,
|
|
2126
|
+
onChange: (g) => f(y.binding, "change", y.rule)
|
|
2127
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : H(k.$slots, y.slot, { key: 5 })
|
|
2128
|
+
]),
|
|
2129
|
+
_: 2
|
|
2130
|
+
}, 1032, ["class", "type", "label-width", "label", "show-label", "is-required", "error-msg"]))), 128))
|
|
2131
|
+
], 38));
|
|
2132
|
+
}
|
|
2133
|
+
}), Ee = Symbol("form-context-keys"), tt = Symbol("form-item-id-keys"), zs = {
|
|
2134
|
+
key: 0,
|
|
2135
|
+
class: "sq-image-mask"
|
|
2136
|
+
}, Rs = {
|
|
2137
|
+
key: 0,
|
|
2138
|
+
class: "sq-image-picture"
|
|
2139
|
+
}, Ls = ["srcset", "media", "type"], Is = ["crossorigin", "alt", "src"], As = {
|
|
2140
|
+
key: 2,
|
|
2141
|
+
class: "sq-image-error"
|
|
2142
|
+
}, Es = "sq-image", Ke = /* @__PURE__ */ R({
|
|
2143
|
+
name: Es,
|
|
2144
|
+
__name: "image",
|
|
2145
|
+
props: {
|
|
2146
|
+
alt: { default: "图片" },
|
|
2147
|
+
crossorigin: {},
|
|
2148
|
+
objectFit: { default: "contain" },
|
|
2149
|
+
fallback: {},
|
|
2150
|
+
src: {},
|
|
2151
|
+
aspectRatio: { default: "16 / 9" },
|
|
2152
|
+
preview: { type: Boolean, default: !0 },
|
|
2153
|
+
lazy: { type: Boolean, default: !0 },
|
|
2154
|
+
source: {}
|
|
2155
|
+
},
|
|
2156
|
+
emits: ["load", "error"],
|
|
2157
|
+
setup(u, { emit: o }) {
|
|
2158
|
+
const s = new IntersectionObserver(_), e = o, n = u, t = T(!1), a = T(n.src), c = T(!1), d = T(!1), l = T(!1), i = re(null), p = b(() => t.value && !c.value), m = b(() => ({
|
|
2159
|
+
height: p.value ? void 0 : "var(--image-placeholder-height)",
|
|
2160
|
+
aspectRatio: p.value ? void 0 : n.aspectRatio
|
|
2161
|
+
}));
|
|
2162
|
+
ie(
|
|
2163
|
+
() => n.src,
|
|
2164
|
+
() => {
|
|
2165
|
+
c.value = !1, t.value = !1, a.value = n.src;
|
|
2166
|
+
}
|
|
2167
|
+
), le(() => {
|
|
2168
|
+
s.observe(i.value);
|
|
2169
|
+
}), ye(() => {
|
|
2170
|
+
s.disconnect();
|
|
2171
|
+
});
|
|
2172
|
+
function h(B) {
|
|
2173
|
+
t.value = !0, e("load", B);
|
|
2174
|
+
}
|
|
2175
|
+
function f(B) {
|
|
2176
|
+
if (a.value !== n.fallback && n.fallback) {
|
|
2177
|
+
a.value = n.fallback;
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
c.value = !0, t.value = !0, e("error", B);
|
|
2181
|
+
}
|
|
2182
|
+
function _(B) {
|
|
2183
|
+
B[0].isIntersecting && (d.value = !0, s.disconnect());
|
|
2184
|
+
}
|
|
2185
|
+
function $() {
|
|
2186
|
+
l.value = !0;
|
|
2187
|
+
}
|
|
2188
|
+
return (B, M) => (v(), w("div", {
|
|
2189
|
+
class: "sq-image",
|
|
2190
|
+
style: J(m.value),
|
|
2191
|
+
ref_key: "imgRef",
|
|
2192
|
+
ref: i
|
|
2193
|
+
}, [
|
|
2194
|
+
z(ke, { name: "sq-fade" }, {
|
|
2195
|
+
default: N(() => [
|
|
2196
|
+
t.value ? P("", !0) : (v(), w("div", zs))
|
|
2197
|
+
]),
|
|
2198
|
+
_: 1
|
|
2199
|
+
}),
|
|
2200
|
+
!c.value && d.value ? (v(), w("picture", Rs, [
|
|
2201
|
+
(v(!0), w(se, null, pe(n.source, (I, L) => (v(), w("source", {
|
|
2202
|
+
key: L,
|
|
2203
|
+
srcset: I.src,
|
|
2204
|
+
media: I.media,
|
|
2205
|
+
type: I.type
|
|
2206
|
+
}, null, 8, Ls))), 128)),
|
|
2207
|
+
E("img", {
|
|
2208
|
+
style: J({ objectFit: n.objectFit }),
|
|
2209
|
+
crossorigin: n.crossorigin,
|
|
2210
|
+
alt: n.alt,
|
|
2211
|
+
src: a.value,
|
|
2212
|
+
onLoad: h,
|
|
2213
|
+
onError: f
|
|
2214
|
+
}, null, 44, Is)
|
|
2215
|
+
])) : P("", !0),
|
|
2216
|
+
!c.value && d.value && n.preview ? (v(), w("div", {
|
|
2217
|
+
key: 1,
|
|
2218
|
+
class: "sq-image-control",
|
|
2219
|
+
onClick: $
|
|
2220
|
+
}, [
|
|
2221
|
+
z(r(gt))
|
|
2222
|
+
])) : P("", !0),
|
|
2223
|
+
c.value ? (v(), w("div", As, [
|
|
2224
|
+
H(B.$slots, "error", {}, () => [
|
|
2225
|
+
M[1] || (M[1] = E("span", null, "图片加载失败", -1))
|
|
2226
|
+
])
|
|
2227
|
+
])) : P("", !0),
|
|
2228
|
+
n.preview ? (v(), S(r(Ds), {
|
|
2229
|
+
key: 3,
|
|
2230
|
+
"src-list": [a.value],
|
|
2231
|
+
visible: l.value,
|
|
2232
|
+
"onUpdate:visible": M[0] || (M[0] = (I) => l.value = I)
|
|
2233
|
+
}, null, 8, ["src-list", "visible"])) : P("", !0)
|
|
2234
|
+
], 4));
|
|
2235
|
+
}
|
|
2236
|
+
}), Ms = ["src"], Ps = "sq-image-viewer", Ds = /* @__PURE__ */ R({
|
|
2237
|
+
name: Ps,
|
|
2238
|
+
__name: "image-viewer",
|
|
2239
|
+
props: /* @__PURE__ */ Z({
|
|
2240
|
+
srcList: {},
|
|
2241
|
+
toolbar: { type: Boolean, default: !0 },
|
|
2242
|
+
minScale: { default: 0.5 },
|
|
2243
|
+
maxScale: { default: 10 },
|
|
2244
|
+
scaleStep: { default: 0.5 },
|
|
2245
|
+
moveable: { type: Boolean, default: !0 },
|
|
2246
|
+
keyboard: { type: Boolean, default: void 0 },
|
|
2247
|
+
maskCloseable: { type: Boolean, default: void 0 },
|
|
2248
|
+
beforeClose: {}
|
|
2249
|
+
}, {
|
|
2250
|
+
visible: { type: Boolean, default: !1 },
|
|
2251
|
+
visibleModifiers: {}
|
|
2252
|
+
}),
|
|
2253
|
+
emits: ["update:visible"],
|
|
2254
|
+
setup(u) {
|
|
2255
|
+
const {
|
|
2256
|
+
hasPointer: o,
|
|
2257
|
+
activeLength: s,
|
|
2258
|
+
scale: e,
|
|
2259
|
+
transform: n,
|
|
2260
|
+
imgRef: t,
|
|
2261
|
+
handlePointerdown: a,
|
|
2262
|
+
handlePointerup: c,
|
|
2263
|
+
handleTouchstart: d,
|
|
2264
|
+
handleTouchend: l,
|
|
2265
|
+
calcPointDiff: i,
|
|
2266
|
+
moveImage: p,
|
|
2267
|
+
getLength: m,
|
|
2268
|
+
getImagePoint: h
|
|
2269
|
+
} = xt(), f = { x: 0, y: 0 };
|
|
2270
|
+
let _ = 0;
|
|
2271
|
+
const $ = u, B = T(!1), M = T(!1), I = T(0), L = T(0), F = T(!0), W = ae(u, "visible"), ne = b(() => $.srcList[L.value]), V = b(() => {
|
|
2272
|
+
const K = B.value ? -1 : 1, U = M.value ? -1 : 1;
|
|
2273
|
+
return {
|
|
2274
|
+
transform: [
|
|
2275
|
+
`scale(${e.value * K}, ${e.value * U})`,
|
|
2276
|
+
`rotate(${I.value}deg)`
|
|
2277
|
+
].join(" "),
|
|
2278
|
+
marginInlineStart: `${n.value.x}px`,
|
|
2279
|
+
marginBlockStart: `${n.value.y}px`,
|
|
2280
|
+
transition: F.value ? void 0 : "none"
|
|
2281
|
+
};
|
|
2282
|
+
});
|
|
2283
|
+
function k() {
|
|
2284
|
+
F.value = !0;
|
|
2285
|
+
}
|
|
2286
|
+
function C(K) {
|
|
2287
|
+
K.deltaY < 0 ? j(K.x, K.y) : Y(K.x, K.y);
|
|
2288
|
+
}
|
|
2289
|
+
function y(K) {
|
|
2290
|
+
!o.value || !$.moveable || K.pointerType === "touch" || p(K.x, K.y);
|
|
2291
|
+
}
|
|
2292
|
+
function x(K) {
|
|
2293
|
+
if (K.touches.length === 1) {
|
|
2294
|
+
if (!o.value || !$.moveable) return;
|
|
2295
|
+
const U = K.touches[0];
|
|
2296
|
+
p(U.screenX, U.screenY);
|
|
2297
|
+
} else if (K.touches.length === 2) {
|
|
2298
|
+
if (!s.value) return;
|
|
2299
|
+
o.value = !1, F.value = !1;
|
|
2300
|
+
const U = K.touches.item(0), ee = K.touches.item(1), _e = m(U, ee), Me = _e / s.value;
|
|
2301
|
+
let qe = e.value * Me;
|
|
2302
|
+
qe = Math.min($.maxScale, qe), qe = Math.max($.minScale, qe);
|
|
2303
|
+
const We = (U.clientX + ee.clientX) / 2, Xe = (U.clientY + ee.clientY) / 2;
|
|
2304
|
+
A(qe, We, Xe), s.value = _e;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
function g(K) {
|
|
2308
|
+
const ee = K.target.getBoundingClientRect(), _e = window.innerWidth, Me = window.innerHeight;
|
|
2309
|
+
f.x = _e / ee.width, f.y = Me / ee.height, _ = Math.min(f.x, f.y), e.value = Math.min(_, 1);
|
|
2310
|
+
}
|
|
2311
|
+
function q() {
|
|
2312
|
+
e.value = Math.min(f.x, f.y, 1), B.value = !1, M.value = !1, I.value = 0, n.value = { x: 0, y: 0 };
|
|
2313
|
+
}
|
|
2314
|
+
function O(K) {
|
|
2315
|
+
L.value += K;
|
|
2316
|
+
}
|
|
2317
|
+
function j(K, U) {
|
|
2318
|
+
if (e.value >= $.maxScale) return;
|
|
2319
|
+
const ee = Math.min($.maxScale, e.value * (1 + $.scaleStep));
|
|
2320
|
+
A(ee, K, U);
|
|
2321
|
+
}
|
|
2322
|
+
function Y(K, U) {
|
|
2323
|
+
const ee = Math.min(_, $.minScale);
|
|
2324
|
+
if (e.value <= ee) return;
|
|
2325
|
+
const _e = Math.max(ee, e.value / (1 + $.scaleStep));
|
|
2326
|
+
A(_e, K, U);
|
|
2327
|
+
}
|
|
2328
|
+
function A(K, U, ee) {
|
|
2329
|
+
if (!U || !ee) {
|
|
2330
|
+
e.value = K;
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
F.value = !1;
|
|
2334
|
+
const _e = e.value, [Me, qe] = h(U, ee);
|
|
2335
|
+
e.value = K, $e(() => {
|
|
2336
|
+
const [We, Xe] = i(Me, qe, U, ee, _e);
|
|
2337
|
+
n.value.x += We * 2, n.value.y += Xe * 2, F.value = !0;
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
function D() {
|
|
2341
|
+
e.value = Math.min(f.x, f.y), n.value = { x: 0, y: 0 };
|
|
2342
|
+
}
|
|
2343
|
+
function G() {
|
|
2344
|
+
e.value = 1, n.value = { x: 0, y: 0 };
|
|
2345
|
+
}
|
|
2346
|
+
function ce() {
|
|
2347
|
+
B.value = !B.value;
|
|
2348
|
+
}
|
|
2349
|
+
function he() {
|
|
2350
|
+
M.value = !M.value;
|
|
2351
|
+
}
|
|
2352
|
+
function we(K) {
|
|
2353
|
+
I.value += K;
|
|
2354
|
+
}
|
|
2355
|
+
function je() {
|
|
2356
|
+
W.value = !1;
|
|
2357
|
+
}
|
|
2358
|
+
return (K, U) => (v(), S(r(wt), {
|
|
2359
|
+
class: "sq-image-viewer-mask",
|
|
2360
|
+
visible: W.value,
|
|
2361
|
+
"onUpdate:visible": U[10] || (U[10] = (ee) => W.value = ee),
|
|
2362
|
+
keyboard: $.keyboard,
|
|
2363
|
+
"mask-closeable": $.maskCloseable,
|
|
2364
|
+
onWheelPassive: C,
|
|
2365
|
+
onPointermove: y,
|
|
2366
|
+
onPointerup: r(c),
|
|
2367
|
+
onTouchmovePassive: x,
|
|
2368
|
+
onTouchend: U[11] || (U[11] = () => r(l)(k)),
|
|
2369
|
+
onClosed: q
|
|
2370
|
+
}, {
|
|
2371
|
+
default: N(() => [
|
|
2372
|
+
E("img", {
|
|
2373
|
+
ref_key: "imgRef",
|
|
2374
|
+
ref: t,
|
|
2375
|
+
style: J(V.value),
|
|
2376
|
+
src: ne.value,
|
|
2377
|
+
onClick: U[0] || (U[0] = ge(() => {
|
|
2378
|
+
}, ["stop"])),
|
|
2379
|
+
onLoad: g,
|
|
2380
|
+
onPointerdown: U[1] || (U[1] = ge(
|
|
2381
|
+
//@ts-ignore
|
|
2382
|
+
(...ee) => r(a) && r(a)(...ee),
|
|
2383
|
+
["prevent"]
|
|
2384
|
+
)),
|
|
2385
|
+
onTouchstartPassive: U[2] || (U[2] = //@ts-ignore
|
|
2386
|
+
(...ee) => r(d) && r(d)(...ee))
|
|
2387
|
+
}, null, 44, Ms),
|
|
2388
|
+
z(r(te), {
|
|
2389
|
+
class: "sq-image-viewer-close",
|
|
2390
|
+
round: "",
|
|
2391
|
+
icon: r(Je),
|
|
2392
|
+
onClick: ge(je, ["stop"])
|
|
2393
|
+
}, null, 8, ["icon"]),
|
|
2394
|
+
$.srcList.length > 1 ? (v(), w(se, { key: 0 }, [
|
|
2395
|
+
z(r(te), {
|
|
2396
|
+
class: "sq-image-viewer-prev",
|
|
2397
|
+
round: "",
|
|
2398
|
+
icon: r(bt),
|
|
2399
|
+
disabled: L.value === 0,
|
|
2400
|
+
onClick: U[3] || (U[3] = (ee) => O(-1))
|
|
2401
|
+
}, null, 8, ["icon", "disabled"]),
|
|
2402
|
+
z(r(te), {
|
|
2403
|
+
class: "sq-image-viewer-next",
|
|
2404
|
+
round: "",
|
|
2405
|
+
icon: r(yt),
|
|
2406
|
+
disabled: L.value === $.srcList.length - 1,
|
|
2407
|
+
onClick: U[4] || (U[4] = (ee) => O(1))
|
|
2408
|
+
}, null, 8, ["icon", "disabled"])
|
|
2409
|
+
], 64)) : P("", !0),
|
|
2410
|
+
$.toolbar ? (v(), w("div", {
|
|
2411
|
+
key: 1,
|
|
2412
|
+
class: "sq-image-viewer-toolbar",
|
|
2413
|
+
onClick: U[9] || (U[9] = ge(() => {
|
|
2414
|
+
}, ["stop"]))
|
|
2415
|
+
}, [
|
|
2416
|
+
z(r(de), {
|
|
2417
|
+
tip: "放大",
|
|
2418
|
+
shadow: !1
|
|
2419
|
+
}, {
|
|
2420
|
+
default: N(() => [
|
|
2421
|
+
z(r(te), {
|
|
2422
|
+
text: "",
|
|
2423
|
+
icon: r(Ft),
|
|
2424
|
+
disabled: r(e) >= $.maxScale,
|
|
2425
|
+
onClick: U[5] || (U[5] = () => j())
|
|
2426
|
+
}, null, 8, ["icon", "disabled"])
|
|
2427
|
+
]),
|
|
2428
|
+
_: 1
|
|
2429
|
+
}),
|
|
2430
|
+
z(r(de), {
|
|
2431
|
+
tip: "缩小",
|
|
2432
|
+
shadow: !1
|
|
2433
|
+
}, {
|
|
2434
|
+
default: N(() => [
|
|
2435
|
+
z(r(te), {
|
|
2436
|
+
text: "",
|
|
2437
|
+
icon: r(Ht),
|
|
2438
|
+
disabled: r(e) <= $.minScale,
|
|
2439
|
+
onClick: U[6] || (U[6] = () => Y())
|
|
2440
|
+
}, null, 8, ["icon", "disabled"])
|
|
2441
|
+
]),
|
|
2442
|
+
_: 1
|
|
2443
|
+
}),
|
|
2444
|
+
z(r(Re), { direction: "vertical" }),
|
|
2445
|
+
z(r(de), {
|
|
2446
|
+
tip: "水平翻转",
|
|
2447
|
+
shadow: !1
|
|
2448
|
+
}, {
|
|
2449
|
+
default: N(() => [
|
|
2450
|
+
z(r(te), {
|
|
2451
|
+
text: "",
|
|
2452
|
+
icon: r(jt),
|
|
2453
|
+
onClick: ce
|
|
2454
|
+
}, null, 8, ["icon"])
|
|
2455
|
+
]),
|
|
2456
|
+
_: 1
|
|
2457
|
+
}),
|
|
2458
|
+
z(r(de), {
|
|
2459
|
+
tip: "垂直翻转",
|
|
2460
|
+
shadow: !1
|
|
2461
|
+
}, {
|
|
2462
|
+
default: N(() => [
|
|
2463
|
+
z(r(te), {
|
|
2464
|
+
text: "",
|
|
2465
|
+
icon: r(Wt),
|
|
2466
|
+
onClick: he
|
|
2467
|
+
}, null, 8, ["icon"])
|
|
2468
|
+
]),
|
|
2469
|
+
_: 1
|
|
2470
|
+
}),
|
|
2471
|
+
z(r(Re), { direction: "vertical" }),
|
|
2472
|
+
z(r(de), {
|
|
2473
|
+
tip: "顺时针旋转",
|
|
2474
|
+
shadow: !1
|
|
2475
|
+
}, {
|
|
2476
|
+
default: N(() => [
|
|
2477
|
+
z(r(te), {
|
|
2478
|
+
text: "",
|
|
2479
|
+
icon: r(Xt),
|
|
2480
|
+
onClick: U[7] || (U[7] = (ee) => we(90))
|
|
2481
|
+
}, null, 8, ["icon"])
|
|
2482
|
+
]),
|
|
2483
|
+
_: 1
|
|
2484
|
+
}),
|
|
2485
|
+
z(r(de), {
|
|
2486
|
+
tip: "逆时针旋转",
|
|
2487
|
+
shadow: !1
|
|
2488
|
+
}, {
|
|
2489
|
+
default: N(() => [
|
|
2490
|
+
z(r(te), {
|
|
2491
|
+
text: "",
|
|
2492
|
+
icon: r(Yt),
|
|
2493
|
+
onClick: U[8] || (U[8] = (ee) => we(-90))
|
|
2494
|
+
}, null, 8, ["icon"])
|
|
2495
|
+
]),
|
|
2496
|
+
_: 1
|
|
2497
|
+
}),
|
|
2498
|
+
z(r(Re), { direction: "vertical" }),
|
|
2499
|
+
z(r(de), {
|
|
2500
|
+
tip: "原始大小",
|
|
2501
|
+
shadow: !1
|
|
2502
|
+
}, {
|
|
2503
|
+
default: N(() => [
|
|
2504
|
+
z(r(te), {
|
|
2505
|
+
text: "",
|
|
2506
|
+
icon: r(Kt),
|
|
2507
|
+
onClick: G
|
|
2508
|
+
}, null, 8, ["icon"])
|
|
2509
|
+
]),
|
|
2510
|
+
_: 1
|
|
2511
|
+
}),
|
|
2512
|
+
z(r(de), {
|
|
2513
|
+
tip: "全屏",
|
|
2514
|
+
shadow: !1
|
|
2515
|
+
}, {
|
|
2516
|
+
default: N(() => [
|
|
2517
|
+
z(r(te), {
|
|
2518
|
+
text: "",
|
|
2519
|
+
icon: r(Gt),
|
|
2520
|
+
onClick: D
|
|
2521
|
+
}, null, 8, ["icon"])
|
|
2522
|
+
]),
|
|
2523
|
+
_: 1
|
|
2524
|
+
})
|
|
2525
|
+
])) : P("", !0)
|
|
2526
|
+
]),
|
|
2527
|
+
_: 1
|
|
2528
|
+
}, 8, ["visible", "keyboard", "mask-closeable", "onPointerup"]));
|
|
2529
|
+
}
|
|
2530
|
+
}), Os = ["src"], Ns = "sq-image-crop", La = /* @__PURE__ */ R({
|
|
2531
|
+
name: Ns,
|
|
2532
|
+
__name: "image-crop",
|
|
2533
|
+
props: {
|
|
2534
|
+
aspectRatio: { default: 1 },
|
|
2535
|
+
src: {},
|
|
2536
|
+
maxScale: { default: 5 }
|
|
2537
|
+
},
|
|
2538
|
+
setup(u, { expose: o }) {
|
|
2539
|
+
const {
|
|
2540
|
+
hasPointer: s,
|
|
2541
|
+
activeLength: e,
|
|
2542
|
+
scale: n,
|
|
2543
|
+
transform: t,
|
|
2544
|
+
imgRef: a,
|
|
2545
|
+
handlePointerdown: c,
|
|
2546
|
+
handlePointerup: d,
|
|
2547
|
+
handleTouchstart: l,
|
|
2548
|
+
handleTouchend: i,
|
|
2549
|
+
calcPointDiff: p,
|
|
2550
|
+
moveImage: m,
|
|
2551
|
+
getLength: h,
|
|
2552
|
+
getImagePoint: f
|
|
2553
|
+
} = xt();
|
|
2554
|
+
let _ = 0;
|
|
2555
|
+
const $ = u, B = re(null), M = b(() => ({
|
|
2556
|
+
transform: `scale(${n.value})`,
|
|
2557
|
+
marginInlineStart: `${t.value.x}px`,
|
|
2558
|
+
marginBlockStart: `${t.value.y}px`
|
|
2559
|
+
}));
|
|
2560
|
+
ie(
|
|
2561
|
+
() => $.aspectRatio,
|
|
2562
|
+
() => {
|
|
2563
|
+
$e(I);
|
|
2564
|
+
}
|
|
2565
|
+
), le(() => {
|
|
2566
|
+
document.addEventListener("pointermove", F), document.addEventListener("pointerup", d);
|
|
2567
|
+
}), ye(() => {
|
|
2568
|
+
document.removeEventListener("pointermove", F), document.removeEventListener("pointerup", d);
|
|
2569
|
+
});
|
|
2570
|
+
function I() {
|
|
2571
|
+
const x = a.value;
|
|
2572
|
+
if (!x) return;
|
|
2573
|
+
t.value = { x: 0, y: 0 };
|
|
2574
|
+
const g = B.value.getBoundingClientRect(), q = x.naturalWidth, O = x.naturalHeight, j = g.width / q, Y = g.height / O;
|
|
2575
|
+
_ = Math.max(j, Y), n.value = _;
|
|
2576
|
+
}
|
|
2577
|
+
function L(x) {
|
|
2578
|
+
x.deltaY < 0 ? ne(x.x, x.y) : V(x.x, x.y);
|
|
2579
|
+
}
|
|
2580
|
+
function F(x) {
|
|
2581
|
+
!s.value || x.pointerType === "touch" || (m(x.x, x.y), C());
|
|
2582
|
+
}
|
|
2583
|
+
function W(x) {
|
|
2584
|
+
if (x.touches.length === 1) {
|
|
2585
|
+
if (!s.value) return;
|
|
2586
|
+
const g = x.touches[0];
|
|
2587
|
+
m(g.screenX, g.screenY), C();
|
|
2588
|
+
} else if (x.touches.length === 2) {
|
|
2589
|
+
if (!e.value) return;
|
|
2590
|
+
s.value = !1;
|
|
2591
|
+
const g = x.touches.item(0), q = x.touches.item(1), O = h(g, q), j = O / e.value;
|
|
2592
|
+
let Y = n.value * j;
|
|
2593
|
+
Y = Math.min($.maxScale, Y), Y = Math.max(_, Y);
|
|
2594
|
+
const A = (g.clientX + q.clientX) / 2, D = (g.clientY + q.clientY) / 2;
|
|
2595
|
+
k(A, D, Y), e.value = O;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
function ne(x, g) {
|
|
2599
|
+
if (n.value >= $.maxScale) return;
|
|
2600
|
+
const q = Math.min($.maxScale, n.value * (1 + 0.1));
|
|
2601
|
+
k(x, g, q);
|
|
2602
|
+
}
|
|
2603
|
+
function V(x, g) {
|
|
2604
|
+
if (n.value <= _) return;
|
|
2605
|
+
const q = Math.max(_, n.value / (1 + 0.1));
|
|
2606
|
+
k(x, g, q);
|
|
2607
|
+
}
|
|
2608
|
+
function k(x, g, q) {
|
|
2609
|
+
const O = n.value, [j, Y] = f(x, g);
|
|
2610
|
+
n.value = q, $e(() => {
|
|
2611
|
+
const [A, D] = p(j, Y, x, g, O);
|
|
2612
|
+
t.value.x += A * 2, t.value.y += D * 2, C();
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
function C() {
|
|
2616
|
+
$e(() => {
|
|
2617
|
+
const x = a.value.getBoundingClientRect(), g = B.value.getBoundingClientRect(), q = x.left >= g.left, O = x.right <= g.right;
|
|
2618
|
+
q ? t.value.x -= (x.left - g.left) * 2 : O && (t.value.x += (g.right - x.right) * 2);
|
|
2619
|
+
const j = x.top >= g.top, Y = x.bottom <= g.bottom;
|
|
2620
|
+
j ? t.value.y -= (x.top - g.top) * 2 : Y && (t.value.y += (g.bottom - x.bottom) * 2);
|
|
2621
|
+
});
|
|
2622
|
+
}
|
|
2623
|
+
async function y(x = "base64") {
|
|
2624
|
+
if (!$.src) return;
|
|
2625
|
+
const g = a.value.naturalWidth, q = a.value.naturalHeight, O = g / q, Y = g > q && O < $.aspectRatio || g < q && O > $.aspectRatio ? g / q : 1, A = n.value / _ / Y;
|
|
2626
|
+
let D = document.createElement("canvas");
|
|
2627
|
+
D.style.display = "none", $.aspectRatio >= O ? (D.width = g, D.height = g / $.aspectRatio) : (D.width = q * $.aspectRatio, D.height = q);
|
|
2628
|
+
let G = D.getContext("2d");
|
|
2629
|
+
const ce = a.value.getBoundingClientRect(), he = B.value.getBoundingClientRect(), we = (ce.left - he.left) / n.value, je = (ce.top - he.top) / n.value;
|
|
2630
|
+
return G == null || G.drawImage(
|
|
2631
|
+
a.value,
|
|
2632
|
+
we * A,
|
|
2633
|
+
je * A,
|
|
2634
|
+
g * A,
|
|
2635
|
+
q * A
|
|
2636
|
+
), new Promise((K) => {
|
|
2637
|
+
x === "base64" ? K(D.toDataURL("image/png")) : D == null || D.toBlob((U) => {
|
|
2638
|
+
K(U ?? void 0);
|
|
2639
|
+
}, "image/png");
|
|
2640
|
+
}).finally(() => {
|
|
2641
|
+
G = void 0, D = void 0;
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
return o({ cropImageAsync: y }), (x, g) => (v(), w("div", {
|
|
2645
|
+
class: "sq-image-crop",
|
|
2646
|
+
style: J({ "--image-crop-ratio": $.aspectRatio }),
|
|
2647
|
+
onWheel: ge(L, ["prevent", "stop"]),
|
|
2648
|
+
onPointerdown: g[0] || (g[0] = //@ts-ignore
|
|
2649
|
+
(...q) => r(c) && r(c)(...q)),
|
|
2650
|
+
onTouchstartPassive: g[1] || (g[1] = //@ts-ignore
|
|
2651
|
+
(...q) => r(l) && r(l)(...q)),
|
|
2652
|
+
onTouchmovePassive: W,
|
|
2653
|
+
onTouchend: g[2] || (g[2] = () => r(i)())
|
|
2654
|
+
}, [
|
|
2655
|
+
E("div", {
|
|
2656
|
+
class: "sq-image-crop-cropper",
|
|
2657
|
+
style: J(`${$.aspectRatio > 1 ? "width" : "height"}: 100%`),
|
|
2658
|
+
ref_key: "cropperRef",
|
|
2659
|
+
ref: B
|
|
2660
|
+
}, null, 4),
|
|
2661
|
+
$.src ? (v(), w("img", {
|
|
2662
|
+
key: 0,
|
|
2663
|
+
ref_key: "imgRef",
|
|
2664
|
+
ref: a,
|
|
2665
|
+
style: J(M.value),
|
|
2666
|
+
src: $.src,
|
|
2667
|
+
onLoad: I
|
|
2668
|
+
}, null, 44, Os)) : P("", !0)
|
|
2669
|
+
], 36));
|
|
2670
|
+
}
|
|
2671
|
+
}), Vs = {
|
|
2672
|
+
key: 0,
|
|
2673
|
+
class: "sq-input-prefix"
|
|
2674
|
+
}, Us = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode"], Fs = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode", "rows", "cols"], Hs = { class: "sq-input-suffix" }, js = "sq-input", nt = /* @__PURE__ */ R({
|
|
2675
|
+
name: js,
|
|
2676
|
+
__name: "input",
|
|
2677
|
+
props: /* @__PURE__ */ Z({
|
|
2678
|
+
status: {},
|
|
2679
|
+
round: { type: Boolean, default: void 0 },
|
|
2680
|
+
prefixIcon: {},
|
|
2681
|
+
suffixIcon: {},
|
|
2682
|
+
disabled: { type: Boolean, default: void 0 },
|
|
2683
|
+
readonly: { type: Boolean, default: void 0 },
|
|
2684
|
+
clearable: { type: Boolean },
|
|
2685
|
+
placeholder: {},
|
|
2686
|
+
maxlength: {},
|
|
2687
|
+
minlength: {},
|
|
2688
|
+
autocomplete: { default: "off" },
|
|
2689
|
+
name: {},
|
|
2690
|
+
form: {},
|
|
2691
|
+
loading: { type: Boolean },
|
|
2692
|
+
inputmode: {},
|
|
2693
|
+
autofocus: { type: Boolean },
|
|
2694
|
+
type: { default: "text" },
|
|
2695
|
+
size: {},
|
|
2696
|
+
resize: { default: "block" },
|
|
2697
|
+
rows: { default: 2 },
|
|
2698
|
+
cols: { default: 30 }
|
|
2699
|
+
}, {
|
|
2700
|
+
value: { default: "" },
|
|
2701
|
+
valueModifiers: {}
|
|
2702
|
+
}),
|
|
2703
|
+
emits: /* @__PURE__ */ Z(["click", "focus", "blur", "input", "change", "clear"], ["update:value"]),
|
|
2704
|
+
setup(u, { expose: o, emit: s }) {
|
|
2705
|
+
const e = Ne(), n = s, t = u, { inputSize: a, inputRound: c, inputDisabled: d, inputReadonly: l, id: i } = Tn(t), p = ae(u, "value"), m = T(!1), h = T(!1), f = re(null), _ = b(() => {
|
|
2706
|
+
const A = [], D = r(a), G = r(c), ce = r(V);
|
|
2707
|
+
return D !== "md" && A.push(`sq-input--${D}`), t.status && A.push(`is-${t.status}`), G && A.push("is-round"), ce && A.push("is-disabled"), A;
|
|
2708
|
+
}), $ = b(() => r(h) ? ht : gt), B = b(() => r(h) ? "text" : t.type), M = b(() => e.prefix || t.prefixIcon), I = b(() => r(m) && r(p).length), L = b(
|
|
2709
|
+
() => t.type === "password" && r(I)
|
|
2710
|
+
), F = b(() => t.clearable && r(I)), W = b(() => t.loading ? Ue : t.suffixIcon), ne = b(
|
|
2711
|
+
() => r(L) || r(F) || r(W) || e.suffix
|
|
2712
|
+
), V = b(() => t.loading || r(d)), k = b(() => {
|
|
2713
|
+
if (t.type === "textarea")
|
|
2714
|
+
return r(V) || r(l) ? "none" : t.resize;
|
|
2715
|
+
});
|
|
2716
|
+
function C(A) {
|
|
2717
|
+
n("focus", A), !r(l) && (m.value = !0);
|
|
2718
|
+
}
|
|
2719
|
+
function y(A) {
|
|
2720
|
+
n("blur", A), !r(l) && (m.value = !1);
|
|
2721
|
+
}
|
|
2722
|
+
function x() {
|
|
2723
|
+
setTimeout(j);
|
|
2724
|
+
}
|
|
2725
|
+
function g(A) {
|
|
2726
|
+
n("click", A);
|
|
2727
|
+
}
|
|
2728
|
+
function q() {
|
|
2729
|
+
p.value = "", n("clear");
|
|
2730
|
+
}
|
|
2731
|
+
function O() {
|
|
2732
|
+
h.value = !h.value;
|
|
2733
|
+
}
|
|
2734
|
+
function j() {
|
|
2735
|
+
var A;
|
|
2736
|
+
(A = f.value) == null || A.focus();
|
|
2737
|
+
}
|
|
2738
|
+
function Y() {
|
|
2739
|
+
var A;
|
|
2740
|
+
m.value = !1, (A = f.value) == null || A.blur();
|
|
2741
|
+
}
|
|
2742
|
+
return o({ focus: j, blur: Y }), (A, D) => (v(), w("div", {
|
|
2743
|
+
class: X(["sq-input", _.value]),
|
|
2744
|
+
onClick: g,
|
|
2745
|
+
onPointerdown: x
|
|
2746
|
+
}, [
|
|
2747
|
+
M.value ? (v(), w("span", Vs, [
|
|
2748
|
+
H(A.$slots, "prefix", {}, () => [
|
|
2749
|
+
(v(), S(fe(t.prefixIcon)))
|
|
2750
|
+
])
|
|
2751
|
+
])) : P("", !0),
|
|
2752
|
+
t.type !== "textarea" ? ue((v(), w("input", {
|
|
2753
|
+
key: 1,
|
|
2754
|
+
class: "sq-input-inner",
|
|
2755
|
+
"onUpdate:modelValue": D[0] || (D[0] = (G) => p.value = G),
|
|
2756
|
+
id: r(i),
|
|
2757
|
+
disabled: V.value,
|
|
2758
|
+
readonly: r(l),
|
|
2759
|
+
placeholder: t.placeholder,
|
|
2760
|
+
type: B.value,
|
|
2761
|
+
maxlength: t.maxlength,
|
|
2762
|
+
minlength: t.minlength,
|
|
2763
|
+
autocomplete: t.autocomplete,
|
|
2764
|
+
name: t.name,
|
|
2765
|
+
autofocus: t.autofocus,
|
|
2766
|
+
form: t.form,
|
|
2767
|
+
inputmode: t.inputmode,
|
|
2768
|
+
ref_key: "inputRef",
|
|
2769
|
+
ref: f,
|
|
2770
|
+
onFocus: C,
|
|
2771
|
+
onBlur: y,
|
|
2772
|
+
onInput: D[1] || (D[1] = (G) => n("input", G)),
|
|
2773
|
+
onChange: D[2] || (D[2] = (G) => n("change", G))
|
|
2774
|
+
}, null, 40, Us)), [
|
|
2775
|
+
[zt, p.value]
|
|
2776
|
+
]) : ue((v(), w("textarea", {
|
|
2777
|
+
key: 2,
|
|
2778
|
+
class: "sq-input-inner",
|
|
2779
|
+
style: J({ resize: k.value }),
|
|
2780
|
+
"onUpdate:modelValue": D[3] || (D[3] = (G) => p.value = G),
|
|
2781
|
+
id: r(i),
|
|
2782
|
+
disabled: V.value,
|
|
2783
|
+
readonly: r(l),
|
|
2784
|
+
placeholder: t.placeholder,
|
|
2785
|
+
type: B.value,
|
|
2786
|
+
maxlength: t.maxlength,
|
|
2787
|
+
minlength: t.minlength,
|
|
2788
|
+
autocomplete: t.autocomplete,
|
|
2789
|
+
name: t.name,
|
|
2790
|
+
autofocus: t.autofocus,
|
|
2791
|
+
form: t.form,
|
|
2792
|
+
inputmode: t.inputmode,
|
|
2793
|
+
rows: t.rows,
|
|
2794
|
+
cols: t.cols,
|
|
2795
|
+
ref_key: "inputRef",
|
|
2796
|
+
ref: f,
|
|
2797
|
+
onFocus: C,
|
|
2798
|
+
onBlur: y,
|
|
2799
|
+
onInput: D[4] || (D[4] = (G) => n("input", G)),
|
|
2800
|
+
onChange: D[5] || (D[5] = (G) => n("change", G))
|
|
2801
|
+
}, null, 44, Fs)), [
|
|
2802
|
+
[Rt, p.value]
|
|
2803
|
+
]),
|
|
2804
|
+
ue(E("span", Hs, [
|
|
2805
|
+
L.value ? (v(), S(fe($.value), {
|
|
2806
|
+
key: 0,
|
|
2807
|
+
class: "sq-input-suffix-pwd",
|
|
2808
|
+
onPointerdown: O
|
|
2809
|
+
}, null, 32)) : P("", !0),
|
|
2810
|
+
F.value ? (v(), S(r(Je), {
|
|
2811
|
+
key: 1,
|
|
2812
|
+
class: "sq-input-suffix-clear",
|
|
2813
|
+
onPointerdown: q
|
|
2814
|
+
})) : P("", !0),
|
|
2815
|
+
H(A.$slots, "suffix", {}, () => [
|
|
2816
|
+
W.value ? (v(), S(fe(W.value), { key: 0 })) : P("", !0)
|
|
2817
|
+
])
|
|
2818
|
+
], 512), [
|
|
2819
|
+
[be, ne.value]
|
|
2820
|
+
])
|
|
2821
|
+
], 34));
|
|
2822
|
+
}
|
|
2823
|
+
}), Ws = ["onClick"], Xs = ["textContent"], Ys = ["onClick"], Ks = ["textContent"], Gs = "sq-menu", Ia = /* @__PURE__ */ R({
|
|
2824
|
+
name: Gs,
|
|
2825
|
+
__name: "menu",
|
|
2826
|
+
props: /* @__PURE__ */ Z({
|
|
2827
|
+
router: { type: Boolean },
|
|
2828
|
+
items: {},
|
|
2829
|
+
direction: { default: "vertical" }
|
|
2830
|
+
}, {
|
|
2831
|
+
active: {},
|
|
2832
|
+
activeModifiers: {}
|
|
2833
|
+
}),
|
|
2834
|
+
emits: /* @__PURE__ */ Z(["click", "change"], ["update:active"]),
|
|
2835
|
+
setup(u, { emit: o }) {
|
|
2836
|
+
const { getText: s } = Ae(), e = o, n = u, t = ae(u, "active"), a = b(() => [`sq-menu--${n.direction}`]);
|
|
2837
|
+
function c(l, i) {
|
|
2838
|
+
l.disabled || i();
|
|
2839
|
+
}
|
|
2840
|
+
function d(l, i) {
|
|
2841
|
+
e("click", l.value, i), !(l.disabled || l.value === t.value) && (e("change", l.value), t.value = l.value);
|
|
2842
|
+
}
|
|
2843
|
+
return (l, i) => (v(), w("menu", {
|
|
2844
|
+
class: X(["sq-menu", a.value])
|
|
2845
|
+
}, [
|
|
2846
|
+
n.router ? (v(!0), w(se, { key: 0 }, pe(n.items, (p) => (v(), S(r(en), {
|
|
2847
|
+
custom: "",
|
|
2848
|
+
to: { name: p.value },
|
|
2849
|
+
key: p.value
|
|
2850
|
+
}, {
|
|
2851
|
+
default: N(({ navigate: m, isActive: h }) => [
|
|
2852
|
+
E("li", {
|
|
2853
|
+
class: X(["sq-menu-item", { "is-active": h, "is-disabled": p.disabled }]),
|
|
2854
|
+
onClick: (f) => c(p, m)
|
|
2855
|
+
}, [
|
|
2856
|
+
H(l.$slots, "default", ve({ ref_for: !0 }, p), () => [
|
|
2857
|
+
p.icon ? (v(), S(fe(p.icon), { key: 0 })) : P("", !0),
|
|
2858
|
+
E("span", {
|
|
2859
|
+
textContent: Q(r(s)(p))
|
|
2860
|
+
}, null, 8, Xs),
|
|
2861
|
+
n.direction === "vertical" ? ue((v(), S(r(it), {
|
|
2862
|
+
key: 1,
|
|
2863
|
+
dot: "",
|
|
2864
|
+
"show-zero": "",
|
|
2865
|
+
type: "primary"
|
|
2866
|
+
}, null, 512)), [
|
|
2867
|
+
[be, h]
|
|
2868
|
+
]) : P("", !0)
|
|
2869
|
+
])
|
|
2870
|
+
], 10, Ws)
|
|
2871
|
+
]),
|
|
2872
|
+
_: 2
|
|
2873
|
+
}, 1032, ["to"]))), 128)) : (v(!0), w(se, { key: 1 }, pe(n.items, (p) => (v(), w("li", {
|
|
2874
|
+
class: X(["sq-menu-item", {
|
|
2875
|
+
"is-active": t.value === p.value,
|
|
2876
|
+
"is-disabled": p.disabled
|
|
2877
|
+
}]),
|
|
2878
|
+
key: p.value,
|
|
2879
|
+
onClick: (m) => d(p, m)
|
|
2880
|
+
}, [
|
|
2881
|
+
H(l.$slots, "default", ve({ ref_for: !0 }, p), () => [
|
|
2882
|
+
p.icon ? (v(), S(fe(p.icon), { key: 0 })) : P("", !0),
|
|
2883
|
+
E("span", {
|
|
2884
|
+
textContent: Q(r(s)(p))
|
|
2885
|
+
}, null, 8, Ks),
|
|
2886
|
+
n.direction === "vertical" ? ue((v(), S(r(it), {
|
|
2887
|
+
key: 1,
|
|
2888
|
+
dot: "",
|
|
2889
|
+
"show-zero": "",
|
|
2890
|
+
type: "primary"
|
|
2891
|
+
}, null, 512)), [
|
|
2892
|
+
[be, t.value === p.value]
|
|
2893
|
+
]) : P("", !0)
|
|
2894
|
+
])
|
|
2895
|
+
], 10, Ys))), 128))
|
|
2896
|
+
], 2));
|
|
2897
|
+
}
|
|
2898
|
+
}), Zs = ["id"], Js = ["textContent"], Qs = "sq-message", eo = /* @__PURE__ */ R({
|
|
2899
|
+
name: Qs,
|
|
2900
|
+
__name: "message",
|
|
2901
|
+
props: {
|
|
2902
|
+
message: {},
|
|
2903
|
+
type: { default: "info" },
|
|
2904
|
+
offsetTop: {},
|
|
2905
|
+
onDestroy: {},
|
|
2906
|
+
onClose: {},
|
|
2907
|
+
closeAfter: { default: 3e3 },
|
|
2908
|
+
id: {}
|
|
2909
|
+
},
|
|
2910
|
+
setup(u, { expose: o }) {
|
|
2911
|
+
const s = u, e = T(!0), n = b(() => s.type ? Qe[s.type] : void 0);
|
|
2912
|
+
le(() => {
|
|
2913
|
+
setTimeout(t, s.closeAfter);
|
|
2914
|
+
});
|
|
2915
|
+
function t() {
|
|
2916
|
+
e.value = !1;
|
|
2917
|
+
}
|
|
2918
|
+
return o({ close: t }), (a, c) => (v(), S(ke, {
|
|
2919
|
+
appear: "",
|
|
2920
|
+
name: "sq-zoom-top",
|
|
2921
|
+
onBeforeLeave: s.onClose,
|
|
2922
|
+
onAfterLeave: s.onDestroy
|
|
2923
|
+
}, {
|
|
2924
|
+
default: N(() => [
|
|
2925
|
+
ue(E("div", {
|
|
2926
|
+
class: X(["sq-message", `is-${s.type}`]),
|
|
2927
|
+
id: s.id,
|
|
2928
|
+
style: J({ top: `${s.offsetTop}px` })
|
|
2929
|
+
}, [
|
|
2930
|
+
z(r(xe), { class: "sq-message-inner" }, {
|
|
2931
|
+
default: N(() => [
|
|
2932
|
+
s.type && n.value ? (v(), S(fe(n.value), {
|
|
2933
|
+
key: 0,
|
|
2934
|
+
class: "sq-message-icon"
|
|
2935
|
+
})) : P("", !0),
|
|
2936
|
+
E("div", {
|
|
2937
|
+
class: "sq-message-content",
|
|
2938
|
+
textContent: Q(s.message)
|
|
2939
|
+
}, null, 8, Js)
|
|
2940
|
+
]),
|
|
2941
|
+
_: 1
|
|
2942
|
+
})
|
|
2943
|
+
], 14, Zs), [
|
|
2944
|
+
[be, e.value]
|
|
2945
|
+
])
|
|
2946
|
+
]),
|
|
2947
|
+
_: 1
|
|
2948
|
+
}, 8, ["onBeforeLeave", "onAfterLeave"]));
|
|
2949
|
+
}
|
|
2950
|
+
}), { getCssVar: to } = He(), { nextZIndex: no } = et(), Te = [], so = ["primary", "success", "info", "warn", "error"], Ye = parseInt(to("--sq-padding-md"));
|
|
2951
|
+
let oo = 0;
|
|
2952
|
+
const Ge = (u = {}) => {
|
|
2953
|
+
const o = `sq-message-${oo++}`;
|
|
2954
|
+
let s = document.querySelector(".sq-message-wrap");
|
|
2955
|
+
s || (s = document.createElement("div"), s.classList.add("sq-message-wrap"), document.body.appendChild(s)), s.style.zIndex = no().toString();
|
|
2956
|
+
let e = Ye;
|
|
2957
|
+
Te.forEach((l) => {
|
|
2958
|
+
var i;
|
|
2959
|
+
e += (((i = l.vm.el) == null ? void 0 : i.offsetHeight) || 0) + Ye;
|
|
2960
|
+
});
|
|
2961
|
+
const n = {
|
|
2962
|
+
type: "info",
|
|
2963
|
+
// 用户配置
|
|
2964
|
+
...u,
|
|
2965
|
+
// 固有配置
|
|
2966
|
+
offsetTop: e,
|
|
2967
|
+
id: o
|
|
2968
|
+
};
|
|
2969
|
+
let t = document.createElement("div");
|
|
2970
|
+
const a = n.onClose;
|
|
2971
|
+
n.onClose = () => {
|
|
2972
|
+
a == null || a();
|
|
2973
|
+
const l = Te.findIndex(
|
|
2974
|
+
(h) => h.vm.component.props.id === d.component.props.id
|
|
2975
|
+
), p = Te.splice(l, 1)[0].vm.el.offsetHeight;
|
|
2976
|
+
if (!(Te.length < 1))
|
|
2977
|
+
for (const h of Te) {
|
|
2978
|
+
let f = Number(parseInt(h.vm.el.style.top));
|
|
2979
|
+
f -= p, f -= Ye, h.vm.component.props.offsetTop = f;
|
|
2980
|
+
}
|
|
2981
|
+
};
|
|
2982
|
+
const c = n.onDestroy;
|
|
2983
|
+
n.onDestroy = () => {
|
|
2984
|
+
c == null || c(), Ve(null, t), t.remove(), t = null;
|
|
2985
|
+
};
|
|
2986
|
+
const d = z(eo, n);
|
|
2987
|
+
return Ve(d, t), Te.push({ vm: d }), s.appendChild(t.firstElementChild), {
|
|
2988
|
+
close: () => {
|
|
2989
|
+
var l, i;
|
|
2990
|
+
(i = (l = d.component) == null ? void 0 : l.exposed) == null || i.close();
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
};
|
|
2994
|
+
so.forEach((u) => {
|
|
2995
|
+
Ge[u] = (o = {}) => (typeof o == "string" && (o = {
|
|
2996
|
+
message: o
|
|
2997
|
+
}), Ge({ ...o, type: u }));
|
|
2998
|
+
});
|
|
2999
|
+
const Aa = Ge, ao = ["textContent"], lo = "sq-message-box", io = /* @__PURE__ */ R({
|
|
3000
|
+
name: lo,
|
|
3001
|
+
__name: "message-box",
|
|
3002
|
+
props: {
|
|
3003
|
+
message: {},
|
|
3004
|
+
onDestroy: {},
|
|
3005
|
+
type: {},
|
|
3006
|
+
title: {},
|
|
3007
|
+
okText: {},
|
|
3008
|
+
cancelText: {},
|
|
3009
|
+
onOk: {},
|
|
3010
|
+
keyboard: { type: Boolean },
|
|
3011
|
+
maskCloseable: { type: Boolean },
|
|
3012
|
+
beforeClose: {}
|
|
3013
|
+
},
|
|
3014
|
+
setup(u, { expose: o }) {
|
|
3015
|
+
const s = u, e = T(!1);
|
|
3016
|
+
le(() => {
|
|
3017
|
+
e.value = !0;
|
|
3018
|
+
});
|
|
3019
|
+
function n() {
|
|
3020
|
+
e.value = !1;
|
|
3021
|
+
}
|
|
3022
|
+
return o({ close: n }), (t, a) => (v(), S(r(os), {
|
|
3023
|
+
visible: e.value,
|
|
3024
|
+
"onUpdate:visible": a[0] || (a[0] = (c) => e.value = c),
|
|
3025
|
+
type: s.type,
|
|
3026
|
+
"mask-closeable": s.maskCloseable,
|
|
3027
|
+
keyboard: s.keyboard,
|
|
3028
|
+
"ok-text": s.okText,
|
|
3029
|
+
"cancel-text": s.cancelText,
|
|
3030
|
+
title: s.title,
|
|
3031
|
+
"before-close": s.beforeClose,
|
|
3032
|
+
onOk: s.onOk,
|
|
3033
|
+
onClosed: s.onDestroy
|
|
3034
|
+
}, {
|
|
3035
|
+
default: N(() => [
|
|
3036
|
+
E("span", {
|
|
3037
|
+
textContent: Q(s.message)
|
|
3038
|
+
}, null, 8, ao)
|
|
3039
|
+
]),
|
|
3040
|
+
_: 1
|
|
3041
|
+
}, 8, ["visible", "type", "mask-closeable", "keyboard", "ok-text", "cancel-text", "title", "before-close", "onOk", "onClosed"]));
|
|
3042
|
+
}
|
|
3043
|
+
}), ro = (u, o = {}) => {
|
|
3044
|
+
const s = {
|
|
3045
|
+
type: "warn",
|
|
3046
|
+
message: u,
|
|
3047
|
+
// 用户配置
|
|
3048
|
+
...o
|
|
3049
|
+
}, e = s.onDestroy;
|
|
3050
|
+
s.onDestroy = () => {
|
|
3051
|
+
e == null || e(), Ve(null, n), n.remove(), n = null;
|
|
3052
|
+
};
|
|
3053
|
+
let n = document.createElement("div");
|
|
3054
|
+
const t = z(io, s);
|
|
3055
|
+
return Ve(t, n), {
|
|
3056
|
+
close: () => {
|
|
3057
|
+
var a, c;
|
|
3058
|
+
(c = (a = t.component) == null ? void 0 : a.exposed) == null || c.close();
|
|
3059
|
+
}
|
|
3060
|
+
};
|
|
3061
|
+
}, Ea = {
|
|
3062
|
+
confirm: (u, o) => ro(u, { title: "警告", ...o ?? {} })
|
|
3063
|
+
}, uo = "sq-pagination-prev", co = /* @__PURE__ */ R({
|
|
3064
|
+
name: uo,
|
|
3065
|
+
__name: "pagination-prev",
|
|
3066
|
+
props: /* @__PURE__ */ Z({
|
|
3067
|
+
disabled: { type: Boolean },
|
|
3068
|
+
size: {},
|
|
3069
|
+
maxPage: {}
|
|
3070
|
+
}, {
|
|
3071
|
+
current: { required: !0 },
|
|
3072
|
+
currentModifiers: {}
|
|
3073
|
+
}),
|
|
3074
|
+
emits: ["update:current"],
|
|
3075
|
+
setup(u) {
|
|
3076
|
+
const o = u, s = ae(u, "current"), e = (n) => {
|
|
3077
|
+
s.value += n;
|
|
3078
|
+
};
|
|
3079
|
+
return (n, t) => (v(), S(r(te), {
|
|
3080
|
+
icon: r(bt),
|
|
3081
|
+
size: o.size,
|
|
3082
|
+
disabled: s.value === 1 || o.disabled,
|
|
3083
|
+
onClick: t[0] || (t[0] = (a) => e(-1))
|
|
3084
|
+
}, null, 8, ["icon", "size", "disabled"]));
|
|
3085
|
+
}
|
|
3086
|
+
}), fo = "sq-pagination-next", po = /* @__PURE__ */ R({
|
|
3087
|
+
name: fo,
|
|
3088
|
+
__name: "pagination-next",
|
|
3089
|
+
props: /* @__PURE__ */ Z({
|
|
3090
|
+
disabled: { type: Boolean },
|
|
3091
|
+
size: {},
|
|
3092
|
+
maxPage: {}
|
|
3093
|
+
}, {
|
|
3094
|
+
current: { required: !0 },
|
|
3095
|
+
currentModifiers: {}
|
|
3096
|
+
}),
|
|
3097
|
+
emits: ["update:current"],
|
|
3098
|
+
setup(u) {
|
|
3099
|
+
const o = u, s = ae(u, "current"), e = (n) => {
|
|
3100
|
+
s.value += n;
|
|
3101
|
+
};
|
|
3102
|
+
return (n, t) => (v(), S(r(te), {
|
|
3103
|
+
icon: r(yt),
|
|
3104
|
+
size: o.size,
|
|
3105
|
+
disabled: s.value === o.maxPage || o.disabled,
|
|
3106
|
+
onClick: t[0] || (t[0] = (a) => e(1))
|
|
3107
|
+
}, null, 8, ["icon", "size", "disabled"]));
|
|
3108
|
+
}
|
|
3109
|
+
}), vo = { class: "sq-pagination-pager" }, mo = "sq-pagination-pager", ho = /* @__PURE__ */ R({
|
|
3110
|
+
name: mo,
|
|
3111
|
+
__name: "pagination-pager",
|
|
3112
|
+
props: /* @__PURE__ */ Z({
|
|
3113
|
+
disabled: { type: Boolean },
|
|
3114
|
+
size: {},
|
|
3115
|
+
list: {}
|
|
3116
|
+
}, {
|
|
3117
|
+
current: { required: !0 },
|
|
3118
|
+
currentModifiers: {}
|
|
3119
|
+
}),
|
|
3120
|
+
emits: ["update:current"],
|
|
3121
|
+
setup(u) {
|
|
3122
|
+
const o = u, s = ae(u, "current"), e = (n) => {
|
|
3123
|
+
s.value = n;
|
|
3124
|
+
};
|
|
3125
|
+
return (n, t) => (v(), w("div", vo, [
|
|
3126
|
+
(v(!0), w(se, null, pe(o.list, (a) => (v(), w(se, { key: a }, [
|
|
3127
|
+
a ? (v(), S(r(te), {
|
|
3128
|
+
key: 0,
|
|
3129
|
+
type: s.value === a ? "primary" : void 0,
|
|
3130
|
+
size: o.size,
|
|
3131
|
+
disabled: o.disabled,
|
|
3132
|
+
onClick: (c) => e(a)
|
|
3133
|
+
}, {
|
|
3134
|
+
default: N(() => [
|
|
3135
|
+
Oe(Q(a), 1)
|
|
3136
|
+
]),
|
|
3137
|
+
_: 2
|
|
3138
|
+
}, 1032, ["type", "size", "disabled", "onClick"])) : (v(), S(r(te), {
|
|
3139
|
+
key: 1,
|
|
3140
|
+
icon: r(Zt),
|
|
3141
|
+
size: o.size,
|
|
3142
|
+
disabled: ""
|
|
3143
|
+
}, null, 8, ["icon", "size"]))
|
|
3144
|
+
], 64))), 128))
|
|
3145
|
+
]));
|
|
3146
|
+
}
|
|
3147
|
+
}), go = "sq-pagination-next", bo = /* @__PURE__ */ R({
|
|
3148
|
+
name: go,
|
|
3149
|
+
__name: "pagination-total",
|
|
3150
|
+
props: {
|
|
3151
|
+
size: {},
|
|
3152
|
+
total: {}
|
|
3153
|
+
},
|
|
3154
|
+
setup(u) {
|
|
3155
|
+
const o = u;
|
|
3156
|
+
return (s, e) => (v(), S(r(xe), {
|
|
3157
|
+
size: o.size === "sm" ? "sm" : "md"
|
|
3158
|
+
}, {
|
|
3159
|
+
default: N(() => [
|
|
3160
|
+
E("span", null, "共 " + Q(o.total) + " 条", 1)
|
|
3161
|
+
]),
|
|
3162
|
+
_: 1
|
|
3163
|
+
}, 8, ["size"]));
|
|
3164
|
+
}
|
|
3165
|
+
}), yo = { class: "sq-pagination" }, xo = "sq-pagination", Ma = /* @__PURE__ */ R({
|
|
3166
|
+
name: xo,
|
|
3167
|
+
__name: "pagination",
|
|
3168
|
+
props: /* @__PURE__ */ Z({
|
|
3169
|
+
total: { default: 0 },
|
|
3170
|
+
disabled: { type: Boolean, default: !1 },
|
|
3171
|
+
size: {},
|
|
3172
|
+
layout: {},
|
|
3173
|
+
pagerCount: { default: 5 }
|
|
3174
|
+
}, {
|
|
3175
|
+
current: { default: 1 },
|
|
3176
|
+
currentModifiers: {},
|
|
3177
|
+
pageSize: { default: 10 },
|
|
3178
|
+
pageSizeModifiers: {}
|
|
3179
|
+
}),
|
|
3180
|
+
emits: ["update:current", "update:pageSize"],
|
|
3181
|
+
setup(u) {
|
|
3182
|
+
const o = u, s = ae(u, "current"), e = ae(u, "pageSize"), n = b(() => Math.ceil(o.total / e.value) || 1), t = b(() => {
|
|
3183
|
+
const c = [], d = Math.floor(o.pagerCount / 2) - 1;
|
|
3184
|
+
let l = s.value - d, i = s.value + d;
|
|
3185
|
+
l < 2 && (l = 2, i = l + d * 2), i > n.value - 1 && (i = n.value - 1, l = i - d * 2);
|
|
3186
|
+
for (let p = 1; p <= n.value; p++)
|
|
3187
|
+
p === 1 || p === n.value || p >= l && p <= i ? c.push(p) : (p === l - 1 || p === i + 1) && c.push(0);
|
|
3188
|
+
return c;
|
|
3189
|
+
}), a = b(() => {
|
|
3190
|
+
const c = o.layout ?? ["prev", "pager", "next"], d = [];
|
|
3191
|
+
for (const l of c)
|
|
3192
|
+
switch (l) {
|
|
3193
|
+
case "prev":
|
|
3194
|
+
d.push(co);
|
|
3195
|
+
break;
|
|
3196
|
+
case "pager":
|
|
3197
|
+
d.push(ho);
|
|
3198
|
+
break;
|
|
3199
|
+
case "next":
|
|
3200
|
+
d.push(po);
|
|
3201
|
+
break;
|
|
3202
|
+
case "total":
|
|
3203
|
+
d.push(bo);
|
|
3204
|
+
break;
|
|
3205
|
+
}
|
|
3206
|
+
return d;
|
|
3207
|
+
});
|
|
3208
|
+
return (c, d) => (v(), w("div", yo, [
|
|
3209
|
+
(v(!0), w(se, null, pe(a.value, (l, i) => (v(), S(fe(l), {
|
|
3210
|
+
key: i,
|
|
3211
|
+
size: o.size,
|
|
3212
|
+
disabled: o.disabled,
|
|
3213
|
+
list: t.value,
|
|
3214
|
+
"max-page": n.value,
|
|
3215
|
+
total: o.total,
|
|
3216
|
+
current: s.value,
|
|
3217
|
+
"onUpdate:current": d[0] || (d[0] = (p) => s.value = p)
|
|
3218
|
+
}, null, 40, ["size", "disabled", "list", "max-page", "total", "current"]))), 128))
|
|
3219
|
+
]));
|
|
3220
|
+
}
|
|
3221
|
+
}), _o = "sq-only-child", $o = /* @__PURE__ */ R({
|
|
3222
|
+
name: _o,
|
|
3223
|
+
setup(u, {
|
|
3224
|
+
slots: o,
|
|
3225
|
+
attrs: s
|
|
3226
|
+
}) {
|
|
3227
|
+
return () => {
|
|
3228
|
+
var t;
|
|
3229
|
+
const e = (t = o.default) == null ? void 0 : t.call(o, s);
|
|
3230
|
+
if (!e) return null;
|
|
3231
|
+
const n = qt(e);
|
|
3232
|
+
return n ? Lt(n, s) : null;
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
});
|
|
3236
|
+
function qt(u) {
|
|
3237
|
+
if (!u) return null;
|
|
3238
|
+
for (const o of u) {
|
|
3239
|
+
if (o !== null && typeof o == "object")
|
|
3240
|
+
switch (o.type) {
|
|
3241
|
+
case At:
|
|
3242
|
+
continue;
|
|
3243
|
+
case It:
|
|
3244
|
+
case "svg":
|
|
3245
|
+
return rt(o);
|
|
3246
|
+
case se:
|
|
3247
|
+
return qt(o.children);
|
|
3248
|
+
default:
|
|
3249
|
+
return o;
|
|
3250
|
+
}
|
|
3251
|
+
return rt(o);
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
function rt(u) {
|
|
3255
|
+
return z("span", null, [u]);
|
|
3256
|
+
}
|
|
3257
|
+
const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
3258
|
+
name: ko,
|
|
3259
|
+
__name: "popover",
|
|
3260
|
+
props: /* @__PURE__ */ Z({
|
|
3261
|
+
placement: { default: "top" },
|
|
3262
|
+
offset: {},
|
|
3263
|
+
teleported: { type: Boolean, default: !0 },
|
|
3264
|
+
trigger: { default: "hover" },
|
|
3265
|
+
showAfter: { default: 0 },
|
|
3266
|
+
hideAfter: { default: 300 },
|
|
3267
|
+
disabled: { type: Boolean },
|
|
3268
|
+
shadow: { type: Boolean, default: !0 },
|
|
3269
|
+
transition: { default: "sq-fade" },
|
|
3270
|
+
popoverStyle: { type: [String, Array, Boolean, null, Object] },
|
|
3271
|
+
popoverClass: {}
|
|
3272
|
+
}, {
|
|
3273
|
+
visible: { type: Boolean, default: !1 },
|
|
3274
|
+
visibleModifiers: {}
|
|
3275
|
+
}),
|
|
3276
|
+
emits: /* @__PURE__ */ Z(["openChange"], ["update:visible"]),
|
|
3277
|
+
setup(u, { emit: o }) {
|
|
3278
|
+
const { getCssVar: s } = He(), { nextZIndex: e } = et(), n = Ze(), t = parseInt(s("--sq-padding-sm")), a = parseInt(s("--sq-padding-md"));
|
|
3279
|
+
let c, d, l = !1;
|
|
3280
|
+
const i = o, p = u, m = ae(u, "visible"), h = T(0), f = T({}), _ = T(!1), $ = re(null), B = re(null), M = b(() => {
|
|
3281
|
+
const C = [];
|
|
3282
|
+
return p.shadow && C.push("has-shadow"), [C];
|
|
3283
|
+
});
|
|
3284
|
+
ie(m, (C) => {
|
|
3285
|
+
if (C === l) return;
|
|
3286
|
+
l = C, k();
|
|
3287
|
+
const y = C ? p.showAfter : p.hideAfter;
|
|
3288
|
+
c = setTimeout(() => {
|
|
3289
|
+
_.value = C;
|
|
3290
|
+
}, y);
|
|
3291
|
+
}), ie(_, (C) => {
|
|
3292
|
+
C ? (h.value = e(), V(), d = tn(
|
|
3293
|
+
$.value.$el,
|
|
3294
|
+
B.value,
|
|
3295
|
+
V
|
|
3296
|
+
)) : d == null || d(), i("openChange", C);
|
|
3297
|
+
}), le(() => {
|
|
3298
|
+
V();
|
|
3299
|
+
}), ye(() => {
|
|
3300
|
+
k(), document.removeEventListener("click", ne);
|
|
3301
|
+
});
|
|
3302
|
+
function I() {
|
|
3303
|
+
p.trigger !== "hover" || p.disabled || W(!1);
|
|
3304
|
+
}
|
|
3305
|
+
function L() {
|
|
3306
|
+
p.trigger === "hover" && ne();
|
|
3307
|
+
}
|
|
3308
|
+
function F(C) {
|
|
3309
|
+
p.trigger === "click" && !p.disabled && !m.value && (C.stopPropagation(), W());
|
|
3310
|
+
}
|
|
3311
|
+
function W(C = !0) {
|
|
3312
|
+
m.value = !0, C && document.addEventListener("click", ne);
|
|
3313
|
+
}
|
|
3314
|
+
function ne() {
|
|
3315
|
+
m.value = !1, document.removeEventListener("click", ne);
|
|
3316
|
+
}
|
|
3317
|
+
async function V() {
|
|
3318
|
+
var O, j;
|
|
3319
|
+
const C = typeof ((O = $.value) == null ? void 0 : O.$el.getBoundingClientRect), y = typeof ((j = B.value) == null ? void 0 : j.getBoundingClientRect);
|
|
3320
|
+
if (C !== "function" || y !== "function") return;
|
|
3321
|
+
const x = await nn($.value.$el, B.value, {
|
|
3322
|
+
placement: p.placement,
|
|
3323
|
+
middleware: [
|
|
3324
|
+
sn(p.offset ?? t),
|
|
3325
|
+
on(),
|
|
3326
|
+
an({ padding: a })
|
|
3327
|
+
]
|
|
3328
|
+
}), { x: g, y: q } = x;
|
|
3329
|
+
f.value = {
|
|
3330
|
+
left: `${g}px`,
|
|
3331
|
+
top: `${q}px`
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
function k() {
|
|
3335
|
+
c && (clearTimeout(c), c = void 0);
|
|
3336
|
+
}
|
|
3337
|
+
return (C, y) => (v(), w(se, null, [
|
|
3338
|
+
z(r($o), {
|
|
3339
|
+
class: X(["sq-popover-trigger", r(n).class]),
|
|
3340
|
+
style: J(r(n).style),
|
|
3341
|
+
ref_key: "triggerRef",
|
|
3342
|
+
ref: $,
|
|
3343
|
+
onMouseenter: I,
|
|
3344
|
+
onMouseleave: L,
|
|
3345
|
+
onClick: F
|
|
3346
|
+
}, {
|
|
3347
|
+
default: N(() => [
|
|
3348
|
+
H(C.$slots, "reference")
|
|
3349
|
+
]),
|
|
3350
|
+
_: 3
|
|
3351
|
+
}, 8, ["class", "style"]),
|
|
3352
|
+
(v(), S(ct, {
|
|
3353
|
+
to: "body",
|
|
3354
|
+
disabled: !p.teleported
|
|
3355
|
+
}, [
|
|
3356
|
+
z(ke, {
|
|
3357
|
+
name: p.transition
|
|
3358
|
+
}, {
|
|
3359
|
+
default: N(() => [
|
|
3360
|
+
ue(E("div", {
|
|
3361
|
+
class: X(["sq-popover", [M.value, p.popoverClass]]),
|
|
3362
|
+
style: J([{ ...f.value, zIndex: h.value }, p.popoverStyle]),
|
|
3363
|
+
ref_key: "popverRef",
|
|
3364
|
+
ref: B,
|
|
3365
|
+
onClick: y[0] || (y[0] = ge(() => {
|
|
3366
|
+
}, ["stop"]))
|
|
3367
|
+
}, [
|
|
3368
|
+
H(C.$slots, "default")
|
|
3369
|
+
], 6), [
|
|
3370
|
+
[be, _.value]
|
|
3371
|
+
])
|
|
3372
|
+
]),
|
|
3373
|
+
_: 3
|
|
3374
|
+
}, 8, ["name"])
|
|
3375
|
+
], 8, ["disabled"]))
|
|
3376
|
+
], 64));
|
|
3377
|
+
}
|
|
3378
|
+
}), wo = {
|
|
3379
|
+
key: 0,
|
|
3380
|
+
class: "sq-progress-label"
|
|
3381
|
+
}, qo = ["textContent"], Co = "sq-progress", So = /* @__PURE__ */ R({
|
|
3382
|
+
name: Co,
|
|
3383
|
+
__name: "progress",
|
|
3384
|
+
props: {
|
|
3385
|
+
value: {},
|
|
3386
|
+
min: { default: 0 },
|
|
3387
|
+
max: { default: 100 },
|
|
3388
|
+
stroke: { default: 4 },
|
|
3389
|
+
color: {},
|
|
3390
|
+
type: { default: "primary" },
|
|
3391
|
+
variant: {},
|
|
3392
|
+
label: { type: Boolean, default: !0 }
|
|
3393
|
+
},
|
|
3394
|
+
setup(u) {
|
|
3395
|
+
const o = new ResizeObserver(l), s = u, e = T(100), n = re(null), t = b(() => {
|
|
3396
|
+
const i = [];
|
|
3397
|
+
return s.color || i.push(`is-${s.type}`), s.variant && i.push(`is-${s.variant}`), i;
|
|
3398
|
+
}), a = b(() => {
|
|
3399
|
+
const i = s.max - s.min;
|
|
3400
|
+
return (s.value - s.min) * 100 / i;
|
|
3401
|
+
}), c = b(() => `${Math.round(a.value * 10) / 10} %`), d = b(() => {
|
|
3402
|
+
const i = {};
|
|
3403
|
+
if (i["--progress-stroke"] = `${s.stroke}px`, !s.variant)
|
|
3404
|
+
i["--progress-value"] = `${a.value}%`;
|
|
3405
|
+
else if (n.value) {
|
|
3406
|
+
const p = 100 / e.value * s.stroke, m = (100 - p) / 2, h = Math.PI * m * 2, f = a.value / 100;
|
|
3407
|
+
i["--progress-circle-r"] = `${m}px`, i["--progress-circle-l"] = `${h}px`, i["--progress-circle-stroke"] = `${p}px`, i["--progress-value"] = `${h * f}`, a.value === 0 && (i["--progress-circle-opaciry"] = "0");
|
|
3408
|
+
}
|
|
3409
|
+
if (s.color) {
|
|
3410
|
+
const m = typeof s.color == "string" ? s.color : s.color(a.value);
|
|
3411
|
+
i["--progress-color"] = m;
|
|
3412
|
+
}
|
|
3413
|
+
return i;
|
|
3414
|
+
});
|
|
3415
|
+
le(() => {
|
|
3416
|
+
o.observe(n.value);
|
|
3417
|
+
}), ye(() => {
|
|
3418
|
+
o.disconnect();
|
|
3419
|
+
});
|
|
3420
|
+
function l() {
|
|
3421
|
+
e.value = n.value.getBoundingClientRect().width;
|
|
3422
|
+
}
|
|
3423
|
+
return (i, p) => (v(), w("div", {
|
|
3424
|
+
class: X(["sq-progress", t.value]),
|
|
3425
|
+
ref_key: "progressRef",
|
|
3426
|
+
ref: n,
|
|
3427
|
+
style: J(d.value)
|
|
3428
|
+
}, [
|
|
3429
|
+
s.variant === "circle" ? (v(), w(se, { key: 0 }, [
|
|
3430
|
+
p[0] || (p[0] = E("svg", {
|
|
3431
|
+
viewBox: "0 0 100 100",
|
|
3432
|
+
version: "1.1",
|
|
3433
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3434
|
+
}, [
|
|
3435
|
+
E("circle", {
|
|
3436
|
+
class: "sq-progress-track",
|
|
3437
|
+
cx: "50",
|
|
3438
|
+
cy: "50"
|
|
3439
|
+
}),
|
|
3440
|
+
E("circle", {
|
|
3441
|
+
class: "sq-progress-path",
|
|
3442
|
+
cx: "50",
|
|
3443
|
+
cy: "50"
|
|
3444
|
+
})
|
|
3445
|
+
], -1)),
|
|
3446
|
+
s.label ? (v(), w("div", wo, [
|
|
3447
|
+
H(i.$slots, "default", { percentage: a.value }, () => [
|
|
3448
|
+
E("span", {
|
|
3449
|
+
textContent: Q(c.value)
|
|
3450
|
+
}, null, 8, qo)
|
|
3451
|
+
])
|
|
3452
|
+
])) : P("", !0)
|
|
3453
|
+
], 64)) : P("", !0)
|
|
3454
|
+
], 6));
|
|
3455
|
+
}
|
|
3456
|
+
}), Bo = ["autofocus", "name", "form", "value", "disabled"], To = {
|
|
3457
|
+
key: 0,
|
|
3458
|
+
class: "sq-radio-box"
|
|
3459
|
+
}, zo = ["textContent"], Ro = "sq-radio", Lo = /* @__PURE__ */ R({
|
|
3460
|
+
name: Ro,
|
|
3461
|
+
__name: "radio",
|
|
3462
|
+
props: /* @__PURE__ */ Z({
|
|
3463
|
+
form: {},
|
|
3464
|
+
name: {},
|
|
3465
|
+
disabled: { type: Boolean, default: void 0 },
|
|
3466
|
+
size: {},
|
|
3467
|
+
variant: {},
|
|
3468
|
+
autofocus: { type: Boolean },
|
|
3469
|
+
label: {},
|
|
3470
|
+
value: {}
|
|
3471
|
+
}, {
|
|
3472
|
+
checked: { type: Boolean, default: !1 },
|
|
3473
|
+
checkedModifiers: {}
|
|
3474
|
+
}),
|
|
3475
|
+
emits: /* @__PURE__ */ Z(["change"], ["update:checked"]),
|
|
3476
|
+
setup(u, { emit: o }) {
|
|
3477
|
+
const s = o, e = u, {
|
|
3478
|
+
radioSize: n,
|
|
3479
|
+
radioDisabled: t,
|
|
3480
|
+
radioForm: a,
|
|
3481
|
+
radioName: c,
|
|
3482
|
+
radioVariant: d,
|
|
3483
|
+
groupContext: l
|
|
3484
|
+
} = zn(e), i = T(), p = ae(u, "checked"), m = b(() => {
|
|
3485
|
+
const f = [], _ = r(n), $ = r(t), B = r(d);
|
|
3486
|
+
return _ !== "md" && f.push(`sq-selection--${_}`), h.value && f.push("is-checked"), $ && f.push("is-disabled"), B && f.push(`is-${B}`), f;
|
|
3487
|
+
}), h = b(() => l ? r(l).checked === e.value : p.value);
|
|
3488
|
+
return ie(i, (f) => {
|
|
3489
|
+
p.value = f === e.value;
|
|
3490
|
+
}), ie(h, (f) => {
|
|
3491
|
+
if (f ? i.value = e.value ?? "on" : i.value = void 0, p.value !== f) {
|
|
3492
|
+
p.value = f;
|
|
3493
|
+
return;
|
|
3494
|
+
}
|
|
3495
|
+
}), ie(p, (f) => {
|
|
3496
|
+
h.value !== f && l && l.value.toggleItem(e.value);
|
|
3497
|
+
}), le(() => {
|
|
3498
|
+
p.value = h.value, i.value = p.value ? e.value ?? "on" : void 0;
|
|
3499
|
+
}), (f, _) => (v(), w("label", {
|
|
3500
|
+
class: X(["sq-selection sq-radio", m.value])
|
|
3501
|
+
}, [
|
|
3502
|
+
ue(E("input", {
|
|
3503
|
+
type: "radio",
|
|
3504
|
+
autofocus: e.autofocus,
|
|
3505
|
+
name: r(c),
|
|
3506
|
+
form: r(a),
|
|
3507
|
+
value: e.value,
|
|
3508
|
+
disabled: r(t),
|
|
3509
|
+
"onUpdate:modelValue": _[0] || (_[0] = ($) => i.value = $),
|
|
3510
|
+
onChange: _[1] || (_[1] = ($) => s("change", h.value))
|
|
3511
|
+
}, null, 40, Bo), [
|
|
3512
|
+
[dt, i.value]
|
|
3513
|
+
]),
|
|
3514
|
+
r(d) !== "solid" ? (v(), w("span", To)) : P("", !0),
|
|
3515
|
+
e.label ? (v(), w("span", {
|
|
3516
|
+
key: 1,
|
|
3517
|
+
class: "sq-selection-label",
|
|
3518
|
+
textContent: Q(e.label)
|
|
3519
|
+
}, null, 8, zo)) : P("", !0)
|
|
3520
|
+
], 2));
|
|
3521
|
+
}
|
|
3522
|
+
}), Io = { class: "sq-radio-group sq-selection-group" }, Ao = "sq-radio-group", Eo = /* @__PURE__ */ R({
|
|
3523
|
+
name: Ao,
|
|
3524
|
+
__name: "radio-group",
|
|
3525
|
+
props: {
|
|
3526
|
+
items: { default: () => [] },
|
|
3527
|
+
value: {},
|
|
3528
|
+
form: {},
|
|
3529
|
+
name: {},
|
|
3530
|
+
disabled: { type: Boolean, default: void 0 },
|
|
3531
|
+
size: {},
|
|
3532
|
+
variant: {}
|
|
3533
|
+
},
|
|
3534
|
+
emits: ["change", "update:value"],
|
|
3535
|
+
setup(u, { emit: o }) {
|
|
3536
|
+
const { nextId: s } = Fe(), { getText: e } = Ae(), n = o, t = u, a = T(t.value), c = b(() => t.name ?? `sq-radio-${s()}`), d = b(() => t.items.map((i) => typeof i == "string" ? {
|
|
3537
|
+
text: i,
|
|
3538
|
+
value: i
|
|
3539
|
+
} : typeof i == "number" ? {
|
|
3540
|
+
text: i.toString(),
|
|
3541
|
+
value: i
|
|
3542
|
+
} : i));
|
|
3543
|
+
Ce(
|
|
3544
|
+
St,
|
|
3545
|
+
T({
|
|
3546
|
+
form: oe(t, "form"),
|
|
3547
|
+
name: c,
|
|
3548
|
+
disabled: oe(t, "disabled"),
|
|
3549
|
+
size: oe(t, "size"),
|
|
3550
|
+
variant: oe(t, "variant"),
|
|
3551
|
+
checked: a,
|
|
3552
|
+
toggleItem: l
|
|
3553
|
+
})
|
|
3554
|
+
), ie(
|
|
3555
|
+
() => t.value,
|
|
3556
|
+
(i) => {
|
|
3557
|
+
i !== a.value && (a.value = i);
|
|
3558
|
+
}
|
|
3559
|
+
);
|
|
3560
|
+
function l(i) {
|
|
3561
|
+
a.value = i, n("change", a.value), n("update:value", a.value);
|
|
3562
|
+
}
|
|
3563
|
+
return (i, p) => (v(), w("div", Io, [
|
|
3564
|
+
H(i.$slots, "default", {}, () => [
|
|
3565
|
+
(v(!0), w(se, null, pe(d.value, (m, h) => (v(), S(r(Lo), {
|
|
3566
|
+
key: h,
|
|
3567
|
+
disabled: m.disabled === !0,
|
|
3568
|
+
label: r(e)(m),
|
|
3569
|
+
value: m.value
|
|
3570
|
+
}, null, 8, ["disabled", "label", "value"]))), 128))
|
|
3571
|
+
])
|
|
3572
|
+
]));
|
|
3573
|
+
}
|
|
3574
|
+
}), St = Symbol("radio-group-context-keys"), Mo = "sq-segmented", Po = /* @__PURE__ */ R({
|
|
3575
|
+
name: Mo,
|
|
3576
|
+
__name: "segmented",
|
|
3577
|
+
props: /* @__PURE__ */ Z({
|
|
3578
|
+
name: {},
|
|
3579
|
+
size: { default: "md" },
|
|
3580
|
+
disabled: { type: Boolean, default: void 0 },
|
|
3581
|
+
round: { type: Boolean },
|
|
3582
|
+
items: { default: () => [] }
|
|
3583
|
+
}, {
|
|
3584
|
+
value: { default: "" },
|
|
3585
|
+
valueModifiers: {}
|
|
3586
|
+
}),
|
|
3587
|
+
emits: /* @__PURE__ */ Z(["change", "update:value"], ["update:value"]),
|
|
3588
|
+
setup(u, { emit: o }) {
|
|
3589
|
+
const { nextId: s } = Fe(), e = o, n = u, t = T(), a = T(), c = ae(u, "value"), d = b(() => n.items.map((f) => typeof f == "string" ? {
|
|
3590
|
+
text: f,
|
|
3591
|
+
value: f
|
|
3592
|
+
} : f)), l = b(() => {
|
|
3593
|
+
const f = [];
|
|
3594
|
+
return n.size !== "md" && f.push(`sq-segmented--${n.size}`), n.round && f.push("is-round"), f;
|
|
3595
|
+
}), i = b(() => {
|
|
3596
|
+
const f = {};
|
|
3597
|
+
return t.value && (f.width = `${t.value}px`), a.value && (f.left = `${a.value}px`), f;
|
|
3598
|
+
}), p = b(() => n.name ?? `sq-segmented-${s()}`);
|
|
3599
|
+
Ce(
|
|
3600
|
+
Bt,
|
|
3601
|
+
T({
|
|
3602
|
+
name: p,
|
|
3603
|
+
disabled: oe(n, "disabled"),
|
|
3604
|
+
size: oe(n, "size"),
|
|
3605
|
+
active: c,
|
|
3606
|
+
toggleItem: m,
|
|
3607
|
+
updateThumb: h
|
|
3608
|
+
})
|
|
3609
|
+
), le(() => {
|
|
3610
|
+
var f;
|
|
3611
|
+
c.value || (c.value = (f = d.value[0]) == null ? void 0 : f.value);
|
|
3612
|
+
});
|
|
3613
|
+
function m(f) {
|
|
3614
|
+
c.value = f, e("change", f);
|
|
3615
|
+
}
|
|
3616
|
+
function h(f) {
|
|
3617
|
+
a.value = f == null ? void 0 : f.offsetLeft, t.value = f == null ? void 0 : f.clientWidth;
|
|
3618
|
+
}
|
|
3619
|
+
return (f, _) => (v(), w("div", {
|
|
3620
|
+
class: X(["sq-segmented", l.value])
|
|
3621
|
+
}, [
|
|
3622
|
+
E("div", {
|
|
3623
|
+
class: "sq-segmented-thumb",
|
|
3624
|
+
style: J(i.value)
|
|
3625
|
+
}, null, 4),
|
|
3626
|
+
H(f.$slots, "default", {}, () => [
|
|
3627
|
+
(v(!0), w(se, null, pe(d.value, ($) => (v(), S(r(No), ve({
|
|
3628
|
+
key: $.value
|
|
3629
|
+
}, { ref_for: !0 }, $), null, 16))), 128))
|
|
3630
|
+
])
|
|
3631
|
+
], 2));
|
|
3632
|
+
}
|
|
3633
|
+
}), Do = ["name", "value", "disabled"], Oo = "sq-segmented-item", No = /* @__PURE__ */ R({
|
|
3634
|
+
name: Oo,
|
|
3635
|
+
__name: "segmented-item",
|
|
3636
|
+
props: {
|
|
3637
|
+
icon: {},
|
|
3638
|
+
value: {},
|
|
3639
|
+
text: {},
|
|
3640
|
+
disabled: { type: Boolean }
|
|
3641
|
+
},
|
|
3642
|
+
setup(u) {
|
|
3643
|
+
const o = u, { segmentedDisabled: s, parentContext: e } = Rn(o), { getText: n } = Ae(), t = T(), a = re(null), c = b(() => {
|
|
3644
|
+
const p = [], m = r(s);
|
|
3645
|
+
return d.value && p.push("is-active"), m && p.push("is-disabled"), p;
|
|
3646
|
+
}), d = b(() => r(e).active === o.value), l = b(() => r(e).size !== "sm" ? "md" : "sm");
|
|
3647
|
+
ie(d, (p) => {
|
|
3648
|
+
if (p) {
|
|
3649
|
+
if (t.value = o.value ?? "on", !e) return;
|
|
3650
|
+
e.value.updateThumb(a.value);
|
|
3651
|
+
} else t.value = void 0;
|
|
3652
|
+
}), le(() => {
|
|
3653
|
+
t.value = d.value ? o.value ?? "on" : void 0, !(!d.value || !e) && e.value.updateThumb(a.value);
|
|
3654
|
+
});
|
|
3655
|
+
function i() {
|
|
3656
|
+
e && e.value.toggleItem(o.value);
|
|
3657
|
+
}
|
|
3658
|
+
return (p, m) => {
|
|
3659
|
+
var h;
|
|
3660
|
+
return v(), w("label", {
|
|
3661
|
+
class: X(["sq-segmented-item", c.value]),
|
|
3662
|
+
ref_key: "itemRef",
|
|
3663
|
+
ref: a
|
|
3664
|
+
}, [
|
|
3665
|
+
ue(E("input", {
|
|
3666
|
+
type: "radio",
|
|
3667
|
+
name: (h = r(e)) == null ? void 0 : h.name,
|
|
3668
|
+
value: o.value,
|
|
3669
|
+
disabled: r(s),
|
|
3670
|
+
"onUpdate:modelValue": m[0] || (m[0] = (f) => t.value = f),
|
|
3671
|
+
onChange: i
|
|
3672
|
+
}, null, 40, Do), [
|
|
3673
|
+
[dt, t.value]
|
|
3674
|
+
]),
|
|
3675
|
+
H(p.$slots, "default", {}, () => [
|
|
3676
|
+
z(r(xe), { size: l.value }, {
|
|
3677
|
+
default: N(() => [
|
|
3678
|
+
o.icon ? (v(), S(fe(o.icon), { key: 0 })) : P("", !0),
|
|
3679
|
+
Oe(" " + Q(r(n)(o)), 1)
|
|
3680
|
+
]),
|
|
3681
|
+
_: 1
|
|
3682
|
+
}, 8, ["size"])
|
|
3683
|
+
])
|
|
3684
|
+
], 2);
|
|
3685
|
+
};
|
|
3686
|
+
}
|
|
3687
|
+
}), Bt = Symbol(
|
|
3688
|
+
"segmented-context-keys"
|
|
3689
|
+
), Vo = ["textContent"], Uo = /* @__PURE__ */ R({
|
|
3690
|
+
__name: "select-item",
|
|
3691
|
+
props: {
|
|
3692
|
+
value: {},
|
|
3693
|
+
text: {},
|
|
3694
|
+
disabled: { type: Boolean }
|
|
3695
|
+
},
|
|
3696
|
+
setup(u) {
|
|
3697
|
+
const { parentContext: o } = Ln(), s = u, { getText: e } = Ae(), n = b(() => {
|
|
3698
|
+
const c = [];
|
|
3699
|
+
return t.value && c.push("is-active"), s.disabled && c.push("is-disabled"), c;
|
|
3700
|
+
}), t = b(() => r(o).active === s.value);
|
|
3701
|
+
function a(c) {
|
|
3702
|
+
!o || c.disabled || t.value || o.value.toggleItem(s.value);
|
|
3703
|
+
}
|
|
3704
|
+
return (c, d) => (v(), w("li", {
|
|
3705
|
+
class: X(n.value),
|
|
3706
|
+
onClick: d[0] || (d[0] = (l) => a(s))
|
|
3707
|
+
}, [
|
|
3708
|
+
E("span", {
|
|
3709
|
+
textContent: Q(r(e)(s))
|
|
3710
|
+
}, null, 8, Vo),
|
|
3711
|
+
t.value ? (v(), S(r(mt), { key: 0 })) : P("", !0)
|
|
3712
|
+
], 2));
|
|
3713
|
+
}
|
|
3714
|
+
}), Fo = ["textContent"], Ho = "sq-select", jo = /* @__PURE__ */ R({
|
|
3715
|
+
name: Ho,
|
|
3716
|
+
__name: "select",
|
|
3717
|
+
props: /* @__PURE__ */ Z({
|
|
3718
|
+
status: {},
|
|
3719
|
+
round: { type: Boolean, default: void 0 },
|
|
3720
|
+
prefixIcon: {},
|
|
3721
|
+
clearable: { type: Boolean },
|
|
3722
|
+
placeholder: {},
|
|
3723
|
+
name: {},
|
|
3724
|
+
form: {},
|
|
3725
|
+
items: { default: () => [] },
|
|
3726
|
+
disabled: { type: Boolean, default: void 0 },
|
|
3727
|
+
size: {},
|
|
3728
|
+
autofocus: { type: Boolean },
|
|
3729
|
+
emptyText: { default: "暂无数据" }
|
|
3730
|
+
}, {
|
|
3731
|
+
value: { default: "" },
|
|
3732
|
+
valueModifiers: {}
|
|
3733
|
+
}),
|
|
3734
|
+
emits: /* @__PURE__ */ Z(["focus", "blur", "select", "clear"], ["update:value"]),
|
|
3735
|
+
setup(u, { emit: o }) {
|
|
3736
|
+
const { getText: s } = Ae();
|
|
3737
|
+
let e = "";
|
|
3738
|
+
const n = o, t = u, a = T(!1), c = T(), d = T(""), l = re(null), i = ae(u, "value"), p = b(() => t.items.map((L) => typeof L == "string" ? {
|
|
3739
|
+
text: L,
|
|
3740
|
+
value: L
|
|
3741
|
+
} : L));
|
|
3742
|
+
Ce(
|
|
3743
|
+
Tt,
|
|
3744
|
+
T({
|
|
3745
|
+
active: i,
|
|
3746
|
+
toggleItem: h
|
|
3747
|
+
})
|
|
3748
|
+
), ie(a, () => {
|
|
3749
|
+
e = d.value;
|
|
3750
|
+
}), ie(i, f), le(() => {
|
|
3751
|
+
f();
|
|
3752
|
+
});
|
|
3753
|
+
function m(L) {
|
|
3754
|
+
var W;
|
|
3755
|
+
if (!L || typeof c.value < "u") return;
|
|
3756
|
+
const F = (W = l.value) == null ? void 0 : W.$el;
|
|
3757
|
+
c.value = F.getBoundingClientRect().width;
|
|
3758
|
+
}
|
|
3759
|
+
function h(L) {
|
|
3760
|
+
a.value && (i.value = L, a.value = !1, n("select", L));
|
|
3761
|
+
}
|
|
3762
|
+
function f() {
|
|
3763
|
+
const L = p.value.find((F) => F.value === i.value);
|
|
3764
|
+
if (!L) {
|
|
3765
|
+
d.value = "";
|
|
3766
|
+
return;
|
|
3767
|
+
}
|
|
3768
|
+
d.value = s(L);
|
|
3769
|
+
}
|
|
3770
|
+
function _() {
|
|
3771
|
+
a.value = !0;
|
|
3772
|
+
}
|
|
3773
|
+
function $(L) {
|
|
3774
|
+
a.value = !0, n("focus", L);
|
|
3775
|
+
}
|
|
3776
|
+
function B(L) {
|
|
3777
|
+
a.value = !1, n("blur", L);
|
|
3778
|
+
}
|
|
3779
|
+
function M() {
|
|
3780
|
+
i.value = "", n("clear");
|
|
3781
|
+
}
|
|
3782
|
+
function I() {
|
|
3783
|
+
d.value = e;
|
|
3784
|
+
}
|
|
3785
|
+
return (L, F) => (v(), S(r(Ct), {
|
|
3786
|
+
class: X(["sq-select", { "dropdown-opened": a.value }]),
|
|
3787
|
+
placement: "bottom-start",
|
|
3788
|
+
trigger: "manual",
|
|
3789
|
+
"popover-class": "sq-select-dropdown",
|
|
3790
|
+
disabled: t.disabled,
|
|
3791
|
+
"hide-after": 100,
|
|
3792
|
+
"popover-style": { width: `${c.value}px` },
|
|
3793
|
+
visible: a.value,
|
|
3794
|
+
"onUpdate:visible": F[3] || (F[3] = (W) => a.value = W),
|
|
3795
|
+
onOpenChange: m
|
|
3796
|
+
}, {
|
|
3797
|
+
reference: N(() => [
|
|
3798
|
+
z(r(nt), {
|
|
3799
|
+
value: d.value,
|
|
3800
|
+
"onUpdate:value": F[0] || (F[0] = (W) => d.value = W),
|
|
3801
|
+
disabled: t.disabled,
|
|
3802
|
+
placeholder: t.placeholder,
|
|
3803
|
+
"prefix-icon": t.prefixIcon,
|
|
3804
|
+
"suffix-icon": r(Jt),
|
|
3805
|
+
size: t.size,
|
|
3806
|
+
round: t.round,
|
|
3807
|
+
status: t.status,
|
|
3808
|
+
autofocus: t.autofocus,
|
|
3809
|
+
clearable: t.clearable,
|
|
3810
|
+
name: t.name,
|
|
3811
|
+
form: t.form,
|
|
3812
|
+
ref_key: "inputRef",
|
|
3813
|
+
ref: l,
|
|
3814
|
+
onClick: _,
|
|
3815
|
+
onFocus: $,
|
|
3816
|
+
onBlur: B,
|
|
3817
|
+
onClear: M,
|
|
3818
|
+
onInput: I
|
|
3819
|
+
}, null, 8, ["value", "disabled", "placeholder", "prefix-icon", "suffix-icon", "size", "round", "status", "autofocus", "clearable", "name", "form"])
|
|
3820
|
+
]),
|
|
3821
|
+
default: N(() => [
|
|
3822
|
+
p.value.length ? (v(), w("menu", {
|
|
3823
|
+
key: 1,
|
|
3824
|
+
onMousedown: F[2] || (F[2] = ge(() => {
|
|
3825
|
+
}, ["prevent"]))
|
|
3826
|
+
}, [
|
|
3827
|
+
(v(!0), w(se, null, pe(p.value, (W) => (v(), S(Uo, ve({
|
|
3828
|
+
key: W.value
|
|
3829
|
+
}, { ref_for: !0 }, W), null, 16))), 128))
|
|
3830
|
+
], 32)) : (v(), w("div", {
|
|
3831
|
+
key: 0,
|
|
3832
|
+
class: "sq-select-dropdown-empty",
|
|
3833
|
+
textContent: Q(t.emptyText),
|
|
3834
|
+
onMousedown: F[1] || (F[1] = ge(() => {
|
|
3835
|
+
}, ["prevent", "stop"]))
|
|
3836
|
+
}, null, 40, Fo))
|
|
3837
|
+
]),
|
|
3838
|
+
_: 1
|
|
3839
|
+
}, 8, ["class", "disabled", "popover-style", "visible"]));
|
|
3840
|
+
}
|
|
3841
|
+
}), Tt = Symbol(
|
|
3842
|
+
"select-context-keys"
|
|
3843
|
+
), Wo = "sq-swipe", Pa = /* @__PURE__ */ R({
|
|
3844
|
+
name: Wo,
|
|
3845
|
+
__name: "swipe",
|
|
3846
|
+
props: /* @__PURE__ */ Z({
|
|
3847
|
+
direction: { default: "horizontal" },
|
|
3848
|
+
topSrc: {},
|
|
3849
|
+
bottomSrc: {},
|
|
3850
|
+
topAlt: { default: "上层图片" },
|
|
3851
|
+
bottomAlt: { default: "下层图片" },
|
|
3852
|
+
disabled: { type: Boolean }
|
|
3853
|
+
}, {
|
|
3854
|
+
value: {
|
|
3855
|
+
default: 0.5,
|
|
3856
|
+
validator: (u) => u >= 0 && u <= 1
|
|
3857
|
+
},
|
|
3858
|
+
valueModifiers: {}
|
|
3859
|
+
}),
|
|
3860
|
+
emits: /* @__PURE__ */ Z(["change"], ["update:value"]),
|
|
3861
|
+
setup(u, { emit: o }) {
|
|
3862
|
+
const { getCssVar: s } = He(), e = { x: 0, y: 0 }, n = s("--sq-component-size-md"), t = parseInt(n), a = t / 2;
|
|
3863
|
+
let c = !1, d = 0, l = [0, 0];
|
|
3864
|
+
const i = o, p = u, m = T(0), h = re(null), f = ae(u, "value"), _ = b(() => {
|
|
3865
|
+
const V = [`sq-swipe-${p.direction}`];
|
|
3866
|
+
return p.disabled && V.push("is-disabled"), V;
|
|
3867
|
+
}), $ = b(() => {
|
|
3868
|
+
const V = {}, k = p.direction === "horizontal" ? "left" : "top";
|
|
3869
|
+
return V[k] = `${m.value}px`, V;
|
|
3870
|
+
}), B = b(
|
|
3871
|
+
() => p.direction === "horizontal" ? "right" : "bottom"
|
|
3872
|
+
), M = b(() => `linear-gradient(${[
|
|
3873
|
+
`to ${B.value}`,
|
|
3874
|
+
`#000 ${m.value}px`,
|
|
3875
|
+
`transparent ${m.value + 1}px`
|
|
3876
|
+
].join(",")})`), I = b(() => `linear-gradient(${[
|
|
3877
|
+
`to ${B.value}`,
|
|
3878
|
+
`transparent ${m.value}px`,
|
|
3879
|
+
`#000 ${m.value + 1}px`
|
|
3880
|
+
].join(",")})`);
|
|
3881
|
+
le(() => {
|
|
3882
|
+
const V = h.value.getBoundingClientRect(), k = f.value >= 0 && f.value <= 1 ? f.value : 0.5;
|
|
3883
|
+
if (p.direction === "horizontal") {
|
|
3884
|
+
l = [a, V.width - a];
|
|
3885
|
+
const C = (V.width - t) * k;
|
|
3886
|
+
m.value = a + C;
|
|
3887
|
+
} else {
|
|
3888
|
+
l = [a, V.height - a];
|
|
3889
|
+
const C = (V.height - t) * k;
|
|
3890
|
+
m.value = a + C;
|
|
3891
|
+
}
|
|
3892
|
+
d = m.value, document.addEventListener("pointermove", W), document.addEventListener("pointerup", F);
|
|
3893
|
+
}), ye(() => {
|
|
3894
|
+
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup", F);
|
|
3895
|
+
});
|
|
3896
|
+
function L(V) {
|
|
3897
|
+
c = !0, e.x = V.x, e.y = V.y;
|
|
3898
|
+
}
|
|
3899
|
+
function F() {
|
|
3900
|
+
c = !1;
|
|
3901
|
+
}
|
|
3902
|
+
function W(V) {
|
|
3903
|
+
c && ne(V.x, V.y);
|
|
3904
|
+
}
|
|
3905
|
+
function ne(V, k) {
|
|
3906
|
+
let C = 0;
|
|
3907
|
+
p.direction === "horizontal" ? (C = e.x - V, e.x = V) : (C = e.y - k, e.y = k);
|
|
3908
|
+
const [y, x] = l;
|
|
3909
|
+
d -= C;
|
|
3910
|
+
const g = m.value;
|
|
3911
|
+
d < y ? m.value = y : d > x ? m.value = x : m.value = d, g !== m.value && (f.value = (m.value - a) / (x - y), i("change", m.value / (x + a)));
|
|
3912
|
+
}
|
|
3913
|
+
return (V, k) => (v(), w("div", {
|
|
3914
|
+
class: X(["sq-swipe", _.value]),
|
|
3915
|
+
ref_key: "swipeRef",
|
|
3916
|
+
ref: h
|
|
3917
|
+
}, [
|
|
3918
|
+
H(V.$slots, "default", {}, () => [
|
|
3919
|
+
E("div", {
|
|
3920
|
+
class: "sq-swipe-top",
|
|
3921
|
+
style: J({ mask: M.value })
|
|
3922
|
+
}, [
|
|
3923
|
+
H(V.$slots, "top", {}, () => [
|
|
3924
|
+
p.topSrc ? (v(), S(r(Ke), {
|
|
3925
|
+
key: 0,
|
|
3926
|
+
src: p.topSrc,
|
|
3927
|
+
alt: p.topAlt
|
|
3928
|
+
}, null, 8, ["src", "alt"])) : P("", !0)
|
|
3929
|
+
])
|
|
3930
|
+
], 4),
|
|
3931
|
+
E("div", {
|
|
3932
|
+
class: "sq-swipe-bottom",
|
|
3933
|
+
style: J({ mask: I.value })
|
|
3934
|
+
}, [
|
|
3935
|
+
H(V.$slots, "bottom", {}, () => [
|
|
3936
|
+
p.bottomSrc ? (v(), S(r(Ke), {
|
|
3937
|
+
key: 0,
|
|
3938
|
+
src: p.bottomSrc,
|
|
3939
|
+
alt: p.bottomAlt
|
|
3940
|
+
}, null, 8, ["src", "alt"])) : P("", !0)
|
|
3941
|
+
])
|
|
3942
|
+
], 4)
|
|
3943
|
+
]),
|
|
3944
|
+
E("div", {
|
|
3945
|
+
class: "sq-swipe-separator",
|
|
3946
|
+
style: J($.value)
|
|
3947
|
+
}, [
|
|
3948
|
+
E("button", {
|
|
3949
|
+
class: "sq-swipe-slider",
|
|
3950
|
+
onPointerdown: L
|
|
3951
|
+
}, null, 32)
|
|
3952
|
+
], 4)
|
|
3953
|
+
], 2));
|
|
3954
|
+
}
|
|
3955
|
+
}), Xo = ["id", "autofocus", "name", "form", "disabled"], Yo = { class: "sq-switch-track" }, Ko = { class: "sq-switch-thumb" }, Go = "sq-switch", Zo = /* @__PURE__ */ R({
|
|
3956
|
+
name: Go,
|
|
3957
|
+
__name: "switch",
|
|
3958
|
+
props: /* @__PURE__ */ Z({
|
|
3959
|
+
form: {},
|
|
3960
|
+
name: {},
|
|
3961
|
+
disabled: { type: Boolean },
|
|
3962
|
+
size: {},
|
|
3963
|
+
variant: {},
|
|
3964
|
+
autofocus: { type: Boolean },
|
|
3965
|
+
loading: { type: Boolean }
|
|
3966
|
+
}, {
|
|
3967
|
+
checked: { type: Boolean, default: !1 },
|
|
3968
|
+
checkedModifiers: {}
|
|
3969
|
+
}),
|
|
3970
|
+
emits: /* @__PURE__ */ Z(["change", "click"], ["update:checked"]),
|
|
3971
|
+
setup(u, { emit: o }) {
|
|
3972
|
+
const s = o, e = u, { switchSize: n, switchDisabled: t, id: a } = In(e), c = ae(u, "checked"), d = b(() => {
|
|
3973
|
+
const l = [], i = r(n), p = r(t);
|
|
3974
|
+
return i !== "md" && l.push(`sq-switch--${i}`), c.value && l.push("is-checked"), (p || e.loading) && l.push("is-disabled"), e.variant && l.push(`is-${e.variant}`), l;
|
|
3975
|
+
});
|
|
3976
|
+
return (l, i) => (v(), w("label", {
|
|
3977
|
+
class: X(["sq-switch", d.value])
|
|
3978
|
+
}, [
|
|
3979
|
+
ue(E("input", {
|
|
3980
|
+
type: "checkbox",
|
|
3981
|
+
"onUpdate:modelValue": i[0] || (i[0] = (p) => c.value = p),
|
|
3982
|
+
id: r(a),
|
|
3983
|
+
autofocus: e.autofocus,
|
|
3984
|
+
name: e.name,
|
|
3985
|
+
form: e.form,
|
|
3986
|
+
disabled: r(t) || e.loading,
|
|
3987
|
+
onChange: i[1] || (i[1] = (p) => s("change", c.value, p)),
|
|
3988
|
+
onClick: i[2] || (i[2] = (p) => s("click", c.value, p))
|
|
3989
|
+
}, null, 40, Xo), [
|
|
3990
|
+
[ut, c.value]
|
|
3991
|
+
]),
|
|
3992
|
+
E("span", Yo, [
|
|
3993
|
+
E("span", Ko, [
|
|
3994
|
+
e.loading ? (v(), S(r(Ue), { key: 0 })) : P("", !0)
|
|
3995
|
+
])
|
|
3996
|
+
])
|
|
3997
|
+
], 2));
|
|
3998
|
+
}
|
|
3999
|
+
}), Jo = "sq-vnode-renderer", Qo = R({
|
|
4000
|
+
name: Jo,
|
|
4001
|
+
props: {
|
|
4002
|
+
content: {
|
|
4003
|
+
type: Object
|
|
4004
|
+
}
|
|
4005
|
+
},
|
|
4006
|
+
render() {
|
|
4007
|
+
return this.content;
|
|
4008
|
+
}
|
|
4009
|
+
}), ea = { class: "sq-table-wrap" }, ta = ["textContent"], na = ["textContent"], sa = {
|
|
4010
|
+
key: 0,
|
|
4011
|
+
class: "sq-table-empty"
|
|
4012
|
+
}, oa = ["textContent"], aa = "sq-table", Da = /* @__PURE__ */ R({
|
|
4013
|
+
name: aa,
|
|
4014
|
+
__name: "table",
|
|
4015
|
+
props: {
|
|
4016
|
+
emptyText: { default: "暂无数据" },
|
|
4017
|
+
emptyValue: { default: "" },
|
|
4018
|
+
rowKey: {},
|
|
4019
|
+
data: { default: () => [] },
|
|
4020
|
+
stripe: { type: Boolean, default: !1 },
|
|
4021
|
+
border: { type: Boolean, default: !1 },
|
|
4022
|
+
cols: { default: () => [] }
|
|
4023
|
+
},
|
|
4024
|
+
setup(u) {
|
|
4025
|
+
const { getCssUnit: o } = He(), s = new ResizeObserver(l), e = u, n = T(!1), t = re(null), a = b(() => {
|
|
4026
|
+
const h = [];
|
|
4027
|
+
return e.stripe && h.push("is-striped"), e.border && h.push("has-border"), h;
|
|
4028
|
+
}), c = b(() => ({
|
|
4029
|
+
gridTemplateColumns: e.cols.map((h) => h.width ? o(h.width) : "1fr").join(" ")
|
|
4030
|
+
})), d = b(() => ({
|
|
4031
|
+
...c.value,
|
|
4032
|
+
paddingInlineEnd: n.value ? "6px" : "0"
|
|
4033
|
+
}));
|
|
4034
|
+
le(() => {
|
|
4035
|
+
s.observe(t.value);
|
|
4036
|
+
}), ye(() => {
|
|
4037
|
+
s.disconnect();
|
|
4038
|
+
});
|
|
4039
|
+
function l() {
|
|
4040
|
+
if (!e.data.length) {
|
|
4041
|
+
n.value = !1;
|
|
4042
|
+
return;
|
|
4043
|
+
}
|
|
4044
|
+
$e(() => {
|
|
4045
|
+
var _, $;
|
|
4046
|
+
const h = ((_ = t.value) == null ? void 0 : _.clientHeight) ?? 0, f = (($ = t.value) == null ? void 0 : $.scrollHeight) ?? 0;
|
|
4047
|
+
n.value = f > h;
|
|
4048
|
+
});
|
|
4049
|
+
}
|
|
4050
|
+
function i(h, f) {
|
|
4051
|
+
return e.rowKey && h.hasOwnProperty(e.rowKey) ? h[e.rowKey] : f;
|
|
4052
|
+
}
|
|
4053
|
+
function p(h) {
|
|
4054
|
+
switch (h) {
|
|
4055
|
+
case "left":
|
|
4056
|
+
return "flex-start";
|
|
4057
|
+
case "center":
|
|
4058
|
+
return "center";
|
|
4059
|
+
case "right":
|
|
4060
|
+
return "flex-end";
|
|
4061
|
+
default:
|
|
4062
|
+
return "flex-start";
|
|
4063
|
+
}
|
|
4064
|
+
}
|
|
4065
|
+
function m(h, f) {
|
|
4066
|
+
return typeof f.formatter == "function" ? f.formatter(h, h[f.binding]) : typeof h[f.binding] > "u" ? "" : h[f.binding];
|
|
4067
|
+
}
|
|
4068
|
+
return (h, f) => (v(), w("div", {
|
|
4069
|
+
class: X(["sq-table", a.value])
|
|
4070
|
+
}, [
|
|
4071
|
+
E("div", ea, [
|
|
4072
|
+
E("div", {
|
|
4073
|
+
class: "sq-table-header",
|
|
4074
|
+
style: J(d.value)
|
|
4075
|
+
}, [
|
|
4076
|
+
(v(!0), w(se, null, pe(e.cols, (_) => (v(), w("div", {
|
|
4077
|
+
class: "sq-table-cell",
|
|
4078
|
+
style: J({ "justify-content": p(_.align) }),
|
|
4079
|
+
key: _.binding
|
|
4080
|
+
}, [
|
|
4081
|
+
E("span", {
|
|
4082
|
+
textContent: Q(_.title)
|
|
4083
|
+
}, null, 8, ta)
|
|
4084
|
+
], 4))), 128))
|
|
4085
|
+
], 4),
|
|
4086
|
+
ue(E("div", {
|
|
4087
|
+
class: "sq-table-body",
|
|
4088
|
+
ref_key: "bodyRef",
|
|
4089
|
+
ref: t
|
|
4090
|
+
}, [
|
|
4091
|
+
(v(!0), w(se, null, pe(e.data, (_, $) => (v(), w("div", {
|
|
4092
|
+
class: "sq-table-row",
|
|
4093
|
+
style: J(c.value),
|
|
4094
|
+
key: i(_, $)
|
|
4095
|
+
}, [
|
|
4096
|
+
(v(!0), w(se, null, pe(e.cols, (B, M) => (v(), w("div", {
|
|
4097
|
+
class: X(["sq-table-cell", B.columnClass]),
|
|
4098
|
+
style: J({ "justify-content": p(B.align) }),
|
|
4099
|
+
key: `${B.binding}-${i(_, M)}`
|
|
4100
|
+
}, [
|
|
4101
|
+
typeof B.cellRender == "function" ? (v(), S(r(Qo), {
|
|
4102
|
+
key: 0,
|
|
4103
|
+
content: B.cellRender(_, _[B.binding])
|
|
4104
|
+
}, null, 8, ["content"])) : (v(), w("span", {
|
|
4105
|
+
key: 1,
|
|
4106
|
+
textContent: Q(m(_, B))
|
|
4107
|
+
}, null, 8, na))
|
|
4108
|
+
], 6))), 128))
|
|
4109
|
+
], 4))), 128))
|
|
4110
|
+
], 512), [
|
|
4111
|
+
[be, e.data.length]
|
|
4112
|
+
]),
|
|
4113
|
+
e.data.length ? P("", !0) : (v(), w("div", sa, [
|
|
4114
|
+
H(h.$slots, "empty", {}, () => [
|
|
4115
|
+
E("span", {
|
|
4116
|
+
textContent: Q(e.emptyText)
|
|
4117
|
+
}, null, 8, oa)
|
|
4118
|
+
])
|
|
4119
|
+
]))
|
|
4120
|
+
])
|
|
4121
|
+
], 2));
|
|
4122
|
+
}
|
|
4123
|
+
}), la = "sq-tag", Oa = /* @__PURE__ */ R({
|
|
4124
|
+
name: la,
|
|
4125
|
+
__name: "tag",
|
|
4126
|
+
props: {
|
|
4127
|
+
type: {},
|
|
4128
|
+
variant: {},
|
|
4129
|
+
round: { type: Boolean },
|
|
4130
|
+
size: { default: "md" }
|
|
4131
|
+
},
|
|
4132
|
+
setup(u) {
|
|
4133
|
+
const o = u, s = b(() => {
|
|
4134
|
+
const n = [];
|
|
4135
|
+
return o.size !== "md" && n.push(`sq-tag--${o.size}`), o.variant && o.type && n.push(`is-${o.variant}`), o.type && n.push(`is-${o.type}`), o.round && n.push("is-round"), n;
|
|
4136
|
+
}), e = b(() => o.size === "lg" ? "md" : "sm");
|
|
4137
|
+
return (n, t) => (v(), S(r(xe), {
|
|
4138
|
+
class: X(["sq-tag", s.value]),
|
|
4139
|
+
size: e.value
|
|
4140
|
+
}, {
|
|
4141
|
+
default: N(() => [
|
|
4142
|
+
H(n.$slots, "default")
|
|
4143
|
+
]),
|
|
4144
|
+
_: 3
|
|
4145
|
+
}, 8, ["class", "size"]));
|
|
4146
|
+
}
|
|
4147
|
+
}), ia = "sq-check-tag", Na = /* @__PURE__ */ R({
|
|
4148
|
+
name: ia,
|
|
4149
|
+
__name: "check-tag",
|
|
4150
|
+
props: {
|
|
4151
|
+
checked: { type: Boolean, default: !1 },
|
|
4152
|
+
type: {},
|
|
4153
|
+
round: { type: Boolean },
|
|
4154
|
+
size: { default: "md" }
|
|
4155
|
+
},
|
|
4156
|
+
emits: ["change"],
|
|
4157
|
+
setup(u, { emit: o }) {
|
|
4158
|
+
const s = o, e = u, n = b(() => {
|
|
4159
|
+
const a = [];
|
|
4160
|
+
return e.size !== "md" && a.push(`sq-tag--${e.size}`), e.type && a.push(`is-${e.type}`), e.round && a.push("is-round"), e.checked && a.push("is-checked"), a;
|
|
4161
|
+
}), t = b(() => e.size === "lg" ? "md" : "sm");
|
|
4162
|
+
return (a, c) => (v(), S(r(xe), {
|
|
4163
|
+
class: X(["sq-check-tag", n.value]),
|
|
4164
|
+
size: t.value,
|
|
4165
|
+
onClick: c[0] || (c[0] = (d) => s("change", !e.checked))
|
|
4166
|
+
}, {
|
|
4167
|
+
default: N(() => [
|
|
4168
|
+
H(a.$slots, "default")
|
|
4169
|
+
]),
|
|
4170
|
+
_: 3
|
|
4171
|
+
}, 8, ["class", "size"]));
|
|
4172
|
+
}
|
|
4173
|
+
}), ra = "sq-text", xe = /* @__PURE__ */ R({
|
|
4174
|
+
name: ra,
|
|
4175
|
+
__name: "text",
|
|
4176
|
+
props: {
|
|
4177
|
+
ellipsis: { type: [Boolean, Number], default: !1 },
|
|
4178
|
+
size: { default: "md" }
|
|
4179
|
+
},
|
|
4180
|
+
setup(u) {
|
|
4181
|
+
const o = u, s = b(() => {
|
|
4182
|
+
const t = [];
|
|
4183
|
+
return o.size !== "md" && t.push(`sq-text--${o.size}`), o.ellipsis !== void 0 && o.ellipsis !== !1 && t.push(e.value > 1 ? "multi-line" : "single-line"), t;
|
|
4184
|
+
}), e = b(() => typeof o.ellipsis == "number" ? Number(Math.max(o.ellipsis, 1).toFixed(0)) : 1), n = b(
|
|
4185
|
+
() => o.ellipsis ? `--row-num: ${e.value}` : ""
|
|
4186
|
+
);
|
|
4187
|
+
return (t, a) => (v(), w("span", {
|
|
4188
|
+
class: X(["sq-text", s.value]),
|
|
4189
|
+
style: J(n.value)
|
|
4190
|
+
}, [
|
|
4191
|
+
H(t.$slots, "default")
|
|
4192
|
+
], 6));
|
|
4193
|
+
}
|
|
4194
|
+
}), ua = "sq-timeline", Va = /* @__PURE__ */ R({
|
|
4195
|
+
name: ua,
|
|
4196
|
+
__name: "timeline",
|
|
4197
|
+
props: {
|
|
4198
|
+
align: { default: "left" },
|
|
4199
|
+
variant: {}
|
|
4200
|
+
},
|
|
4201
|
+
setup(u) {
|
|
4202
|
+
const o = u, s = b(() => {
|
|
4203
|
+
const e = [`align-${o.align}`];
|
|
4204
|
+
return o.variant && e.push(`is-${o.variant}`), e;
|
|
4205
|
+
});
|
|
4206
|
+
return (e, n) => (v(), w("div", {
|
|
4207
|
+
class: X(["sq-timeline", s.value])
|
|
4208
|
+
}, [
|
|
4209
|
+
H(e.$slots, "default")
|
|
4210
|
+
], 2));
|
|
4211
|
+
}
|
|
4212
|
+
}), ca = { class: "sq-timeline-dot" }, da = { class: "sq-timeline-content" }, fa = ["textContent"], pa = ["textContent"], va = { class: "content-info" }, ma = "sq-timeline-item", Ua = /* @__PURE__ */ R({
|
|
4213
|
+
name: ma,
|
|
4214
|
+
__name: "timeline-item",
|
|
4215
|
+
props: {
|
|
4216
|
+
color: {},
|
|
4217
|
+
type: {},
|
|
4218
|
+
icon: {},
|
|
4219
|
+
hollow: { type: Boolean },
|
|
4220
|
+
timestamp: {},
|
|
4221
|
+
title: {}
|
|
4222
|
+
},
|
|
4223
|
+
setup(u) {
|
|
4224
|
+
const o = u, s = b(() => {
|
|
4225
|
+
const n = [];
|
|
4226
|
+
return o.type && n.push(`is-${o.type}`), o.hollow && n.push("is-hollow"), n;
|
|
4227
|
+
}), e = b(() => {
|
|
4228
|
+
const n = {};
|
|
4229
|
+
return o.color && (n["--timeline-dot-color"] = o.color), n;
|
|
4230
|
+
});
|
|
4231
|
+
return (n, t) => (v(), w("div", {
|
|
4232
|
+
class: X(["sq-timeline-item", s.value]),
|
|
4233
|
+
style: J(e.value)
|
|
4234
|
+
}, [
|
|
4235
|
+
E("span", ca, [
|
|
4236
|
+
o.icon ? (v(), S(fe(o.icon), { key: 0 })) : P("", !0)
|
|
4237
|
+
]),
|
|
4238
|
+
E("div", da, [
|
|
4239
|
+
o.title ? (v(), w("h2", {
|
|
4240
|
+
key: 0,
|
|
4241
|
+
class: "content-title",
|
|
4242
|
+
textContent: Q(o.title)
|
|
4243
|
+
}, null, 8, fa)) : P("", !0),
|
|
4244
|
+
o.timestamp ? (v(), w("span", {
|
|
4245
|
+
key: 1,
|
|
4246
|
+
class: "content-time",
|
|
4247
|
+
textContent: Q(o.timestamp)
|
|
4248
|
+
}, null, 8, pa)) : P("", !0),
|
|
4249
|
+
E("div", va, [
|
|
4250
|
+
H(n.$slots, "default")
|
|
4251
|
+
])
|
|
4252
|
+
])
|
|
4253
|
+
], 6));
|
|
4254
|
+
}
|
|
4255
|
+
}), ha = ["textContent"], ga = "sq-tooltip", de = /* @__PURE__ */ R({
|
|
4256
|
+
name: ga,
|
|
4257
|
+
__name: "tooltip",
|
|
4258
|
+
props: {
|
|
4259
|
+
placement: {},
|
|
4260
|
+
teleported: { type: Boolean, default: !0 },
|
|
4261
|
+
disabled: { type: Boolean },
|
|
4262
|
+
transition: {},
|
|
4263
|
+
shadow: { type: Boolean, default: !0 },
|
|
4264
|
+
tip: {},
|
|
4265
|
+
popoverClass: {}
|
|
4266
|
+
},
|
|
4267
|
+
setup(u) {
|
|
4268
|
+
const o = u, s = b(() => {
|
|
4269
|
+
const e = ["sq-tooltip"], n = o.popoverClass;
|
|
4270
|
+
return Array.isArray(n) ? e.push(...n) : typeof n == "string" && e.push(n), e;
|
|
4271
|
+
});
|
|
4272
|
+
return (e, n) => (v(), S(r(Ct), {
|
|
4273
|
+
placement: o.placement,
|
|
4274
|
+
disabled: o.disabled,
|
|
4275
|
+
"show-after": 300,
|
|
4276
|
+
"hide-after": 0,
|
|
4277
|
+
"popover-class": s.value,
|
|
4278
|
+
teleported: o.teleported,
|
|
4279
|
+
transition: o.transition,
|
|
4280
|
+
shadow: o.shadow
|
|
4281
|
+
}, {
|
|
4282
|
+
reference: N(() => [
|
|
4283
|
+
H(e.$slots, "default")
|
|
4284
|
+
]),
|
|
4285
|
+
default: N(() => [
|
|
4286
|
+
E("span", {
|
|
4287
|
+
textContent: Q(o.tip)
|
|
4288
|
+
}, null, 8, ha)
|
|
4289
|
+
]),
|
|
4290
|
+
_: 3
|
|
4291
|
+
}, 8, ["placement", "disabled", "popover-class", "teleported", "transition", "shadow"]));
|
|
4292
|
+
}
|
|
4293
|
+
}), ba = ["name", "form", "disabled", "accept", "multiple"], ya = "sq-upload", Fa = /* @__PURE__ */ R({
|
|
4294
|
+
name: ya,
|
|
4295
|
+
__name: "upload",
|
|
4296
|
+
props: {
|
|
4297
|
+
form: {},
|
|
4298
|
+
name: {},
|
|
4299
|
+
disabled: { type: Boolean },
|
|
4300
|
+
accept: {},
|
|
4301
|
+
max: {},
|
|
4302
|
+
multiple: { type: Boolean },
|
|
4303
|
+
allowDrop: { type: Boolean }
|
|
4304
|
+
},
|
|
4305
|
+
emits: ["change"],
|
|
4306
|
+
setup(u, { expose: o, emit: s }) {
|
|
4307
|
+
const e = s, n = u, t = re(null);
|
|
4308
|
+
function a() {
|
|
4309
|
+
var m;
|
|
4310
|
+
i(((m = t.value) == null ? void 0 : m.files) ?? void 0);
|
|
4311
|
+
}
|
|
4312
|
+
function c(m) {
|
|
4313
|
+
var h;
|
|
4314
|
+
m.target === t.value || n.disabled || (h = t.value) == null || h.click();
|
|
4315
|
+
}
|
|
4316
|
+
function d(m) {
|
|
4317
|
+
n.allowDrop && m.preventDefault();
|
|
4318
|
+
}
|
|
4319
|
+
function l(m) {
|
|
4320
|
+
var h;
|
|
4321
|
+
n.disabled || (n.allowDrop && m.preventDefault(), i(((h = m.dataTransfer) == null ? void 0 : h.files) ?? void 0));
|
|
4322
|
+
}
|
|
4323
|
+
function i(m) {
|
|
4324
|
+
const h = m ?? new FileList(), f = [], _ = n.max ? Math.min(h.length, n.max) : h.length;
|
|
4325
|
+
for (let $ = 0; $ < _; $++) {
|
|
4326
|
+
const B = h[$];
|
|
4327
|
+
f.push(B);
|
|
4328
|
+
}
|
|
4329
|
+
e("change", f);
|
|
4330
|
+
}
|
|
4331
|
+
function p() {
|
|
4332
|
+
t.value.value = "", t.value.files = null, e("change", []);
|
|
4333
|
+
}
|
|
4334
|
+
return o({ clearFiles: p }), (m, h) => (v(), w("div", {
|
|
4335
|
+
class: "sq-upload",
|
|
4336
|
+
onClick: c,
|
|
4337
|
+
onDragover: d,
|
|
4338
|
+
onDrop: l
|
|
4339
|
+
}, [
|
|
4340
|
+
E("input", {
|
|
4341
|
+
type: "file",
|
|
4342
|
+
ref_key: "inputRef",
|
|
4343
|
+
ref: t,
|
|
4344
|
+
name: n.name,
|
|
4345
|
+
form: n.form,
|
|
4346
|
+
disabled: n.disabled,
|
|
4347
|
+
accept: n.accept,
|
|
4348
|
+
multiple: n.multiple,
|
|
4349
|
+
onChange: a
|
|
4350
|
+
}, null, 40, ba),
|
|
4351
|
+
H(m.$slots, "default")
|
|
4352
|
+
], 32));
|
|
4353
|
+
}
|
|
4354
|
+
});
|
|
4355
|
+
export {
|
|
4356
|
+
_t as ButtonGroupContextKeys,
|
|
4357
|
+
kt as CheckboxGroupContextKeys,
|
|
4358
|
+
Ee as FormContextKeys,
|
|
4359
|
+
tt as FormItemIdKeys,
|
|
4360
|
+
St as RadioGroupContextKeys,
|
|
4361
|
+
Bt as SegmentedContextKeys,
|
|
4362
|
+
Tt as SelectContextKeys,
|
|
4363
|
+
qa as SqAlert,
|
|
4364
|
+
gn as SqArticle,
|
|
4365
|
+
Ca as SqAvatar,
|
|
4366
|
+
Sa as SqBacktop,
|
|
4367
|
+
it as SqBadge,
|
|
4368
|
+
Cn as SqBlur,
|
|
4369
|
+
te as SqButton,
|
|
4370
|
+
Ba as SqButtonGroup,
|
|
4371
|
+
Ta as SqCard,
|
|
4372
|
+
Na as SqCheckTag,
|
|
4373
|
+
$t as SqCheckbox,
|
|
4374
|
+
Yn as SqCheckboxGroup,
|
|
4375
|
+
Zn as SqCode,
|
|
4376
|
+
os as SqDialog,
|
|
4377
|
+
Re as SqDivider,
|
|
4378
|
+
za as SqEditor,
|
|
4379
|
+
Ra as SqForm,
|
|
4380
|
+
Ke as SqImage,
|
|
4381
|
+
La as SqImageCrop,
|
|
4382
|
+
Ds as SqImageViewer,
|
|
4383
|
+
nt as SqInput,
|
|
4384
|
+
Ia as SqMenu,
|
|
4385
|
+
Aa as SqMessage,
|
|
4386
|
+
Ea as SqMessageBox,
|
|
4387
|
+
Ma as SqPagination,
|
|
4388
|
+
Ct as SqPopover,
|
|
4389
|
+
So as SqProgress,
|
|
4390
|
+
Lo as SqRadio,
|
|
4391
|
+
Eo as SqRadioGroup,
|
|
4392
|
+
Po as SqSegmented,
|
|
4393
|
+
No as SqSegmentedItem,
|
|
4394
|
+
jo as SqSelect,
|
|
4395
|
+
Pa as SqSwipe,
|
|
4396
|
+
Zo as SqSwitch,
|
|
4397
|
+
Da as SqTable,
|
|
4398
|
+
Oa as SqTag,
|
|
4399
|
+
xe as SqText,
|
|
4400
|
+
Va as SqTimeline,
|
|
4401
|
+
Ua as SqTimelineItem,
|
|
4402
|
+
de as SqTooltip,
|
|
4403
|
+
Fa as SqUpload
|
|
4404
|
+
};
|