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