@seclab-dev/vue 0.1.0-alpha.1

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 (33) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +62 -0
  4. package/dist/components/SecLabActionMenu.vue.d.ts +24 -0
  5. package/dist/components/SecLabAlert.vue.d.ts +37 -0
  6. package/dist/components/SecLabBreadcrumb.vue.d.ts +23 -0
  7. package/dist/components/SecLabBreadcrumbItem.vue.d.ts +13 -0
  8. package/dist/components/SecLabButton.vue.d.ts +36 -0
  9. package/dist/components/SecLabCard.vue.d.ts +34 -0
  10. package/dist/components/SecLabCheckbox.vue.d.ts +31 -0
  11. package/dist/components/SecLabDateTimeRangePicker.vue.d.ts +53 -0
  12. package/dist/components/SecLabDescriptions.vue.d.ts +41 -0
  13. package/dist/components/SecLabDialog.vue.d.ts +39 -0
  14. package/dist/components/SecLabDrawer.vue.d.ts +35 -0
  15. package/dist/components/SecLabEmpty.vue.d.ts +26 -0
  16. package/dist/components/SecLabFormItem.vue.d.ts +25 -0
  17. package/dist/components/SecLabIcon.vue.d.ts +17 -0
  18. package/dist/components/SecLabInput.vue.d.ts +49 -0
  19. package/dist/components/SecLabLoading.vue.d.ts +25 -0
  20. package/dist/components/SecLabMenu.vue.d.ts +28 -0
  21. package/dist/components/SecLabModal.vue.d.ts +31 -0
  22. package/dist/components/SecLabPagination.vue.d.ts +35 -0
  23. package/dist/components/SecLabSelect.vue.d.ts +29 -0
  24. package/dist/components/SecLabSwitch.vue.d.ts +24 -0
  25. package/dist/components/SecLabTable.vue.d.ts +60 -0
  26. package/dist/components/SecLabTabs.vue.d.ts +24 -0
  27. package/dist/components/SecLabTag.vue.d.ts +26 -0
  28. package/dist/components/SecLabToast.vue.d.ts +17 -0
  29. package/dist/components/SecLabTooltip.vue.d.ts +29 -0
  30. package/dist/index.d.ts +30 -0
  31. package/dist/index.js +1237 -0
  32. package/dist/style.css +2 -0
  33. package/package.json +48 -0
package/dist/index.js ADDED
@@ -0,0 +1,1237 @@
1
+ import { Fragment as e, Teleport as t, Transition as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, inject as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, onUnmounted as y, openBlock as b, provide as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, watch as D, withCtx as O, withModifiers as k } from "vue";
2
+ import { getIcon as A } from "@seclab-dev/icons";
3
+ //#region src/components/SecLabIcon.vue?vue&type=script&setup=true&lang.ts
4
+ var j = [
5
+ "aria-hidden",
6
+ "role",
7
+ "aria-label",
8
+ "innerHTML"
9
+ ], M = /*@__PURE__*/ d({
10
+ __name: "SecLabIcon",
11
+ props: {
12
+ name: { default: "fallback" },
13
+ namespace: { default: "common" },
14
+ size: { default: 24 },
15
+ label: { default: "" },
16
+ decorative: {
17
+ type: Boolean,
18
+ default: !0
19
+ }
20
+ },
21
+ setup(e) {
22
+ let t = e, n = i(() => {
23
+ let e = (t.name ?? "").trim().toLowerCase();
24
+ return /^[a-z0-9-]+$/.test(e) ? e : "fallback";
25
+ }), r = i(() => A(n.value, t.namespace)), a = i(() => typeof t.size == "number" ? `${t.size}px` : t.size);
26
+ return (t, i) => (b(), s("span", {
27
+ class: "sl-icon",
28
+ style: g({ "--sl-icon-size": a.value }),
29
+ "aria-hidden": e.decorative ? "true" : void 0,
30
+ role: e.decorative ? void 0 : "img",
31
+ "aria-label": e.decorative ? void 0 : e.label || n.value,
32
+ innerHTML: r.value
33
+ }, null, 12, j));
34
+ }
35
+ }), N = (e, t) => {
36
+ let n = e.__vccOpts || e;
37
+ for (let [e, r] of t) n[e] = r;
38
+ return n;
39
+ }, P = /*#__PURE__*/ N(M, [["__scopeId", "data-v-9982a20e"]]), F = ["disabled"], I = {
40
+ key: 0,
41
+ class: "sl-button-loading-icon"
42
+ }, L = { class: "sl-button-content" }, R = /*#__PURE__*/ N(/* @__PURE__ */ d({
43
+ __name: "SecLabButton",
44
+ props: {
45
+ type: { default: "secondary" },
46
+ size: { default: "default" },
47
+ disabled: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
51
+ loading: {
52
+ type: Boolean,
53
+ default: !1
54
+ }
55
+ },
56
+ emits: ["click"],
57
+ setup(e, { emit: t }) {
58
+ let n = t;
59
+ function r(e) {
60
+ n("click", e);
61
+ }
62
+ return (t, n) => (b(), s("button", {
63
+ class: h(["sl-button", [
64
+ `sl-button--${e.type}`,
65
+ `sl-button--${e.size}`,
66
+ { "is-loading": e.loading }
67
+ ]]),
68
+ disabled: e.disabled || e.loading,
69
+ type: "button",
70
+ onClick: r
71
+ }, [e.loading ? (b(), s("span", I, [...n[0] ||= [c("svg", {
72
+ class: "sl-spinner",
73
+ viewBox: "0 0 50 50"
74
+ }, [c("circle", {
75
+ class: "path",
76
+ cx: "25",
77
+ cy: "25",
78
+ r: "20",
79
+ fill: "none",
80
+ "stroke-width": "5"
81
+ })], -1)]])) : o("", !0), c("span", L, [w(t.$slots, "default", {}, void 0, !0)])], 10, F));
82
+ }
83
+ }), [["__scopeId", "data-v-a4922c61"]]), z = [
84
+ "value",
85
+ "placeholder",
86
+ "disabled",
87
+ "readonly",
88
+ "maxlength",
89
+ "rows"
90
+ ], B = {
91
+ key: 1,
92
+ class: "sl-input-inner-wrapper"
93
+ }, V = [
94
+ "type",
95
+ "value",
96
+ "placeholder",
97
+ "disabled",
98
+ "readonly",
99
+ "maxlength",
100
+ "min",
101
+ "max",
102
+ "step",
103
+ "autocomplete"
104
+ ], H = /*#__PURE__*/ N(/* @__PURE__ */ d({
105
+ __name: "SecLabInput",
106
+ props: {
107
+ modelValue: {},
108
+ type: { default: "text" },
109
+ placeholder: {},
110
+ disabled: {
111
+ type: Boolean,
112
+ default: !1
113
+ },
114
+ readonly: {
115
+ type: Boolean,
116
+ default: !1
117
+ },
118
+ maxlength: {},
119
+ rows: { default: 3 },
120
+ showPassword: {
121
+ type: Boolean,
122
+ default: !1
123
+ },
124
+ min: {},
125
+ max: {},
126
+ step: {},
127
+ autocomplete: {}
128
+ },
129
+ emits: [
130
+ "update:modelValue",
131
+ "focus",
132
+ "blur",
133
+ "change"
134
+ ],
135
+ setup(e, { emit: t }) {
136
+ let n = e, r = t, a = S(!1);
137
+ function l(e) {
138
+ let t = e.target;
139
+ r("update:modelValue", t.value);
140
+ }
141
+ function d(e) {
142
+ let t = e.target;
143
+ r("change", t.value);
144
+ }
145
+ function f() {
146
+ a.value = !a.value;
147
+ }
148
+ let p = i(() => n.type === "password" && a.value ? "text" : n.type);
149
+ return (t, n) => (b(), s("div", { class: h(["sl-input-wrapper", [`is-${e.type}`, { "is-disabled": e.disabled }]]) }, [e.type === "textarea" ? (b(), s("textarea", {
150
+ key: 0,
151
+ class: "sl-textarea",
152
+ value: e.modelValue?.toString(),
153
+ placeholder: e.placeholder,
154
+ disabled: e.disabled,
155
+ readonly: e.readonly,
156
+ maxlength: e.maxlength,
157
+ rows: e.rows,
158
+ onInput: l,
159
+ onChange: d,
160
+ onFocus: n[0] ||= (e) => r("focus", e),
161
+ onBlur: n[1] ||= (e) => r("blur", e)
162
+ }, null, 40, z)) : (b(), s("div", B, [c("input", {
163
+ class: "sl-input",
164
+ type: p.value,
165
+ value: e.modelValue?.toString(),
166
+ placeholder: e.placeholder,
167
+ disabled: e.disabled,
168
+ readonly: e.readonly,
169
+ maxlength: e.maxlength,
170
+ min: e.min,
171
+ max: e.max,
172
+ step: e.step,
173
+ autocomplete: e.autocomplete,
174
+ onInput: l,
175
+ onChange: d,
176
+ onFocus: n[2] ||= (e) => r("focus", e),
177
+ onBlur: n[3] ||= (e) => r("blur", e)
178
+ }, null, 40, V), e.showPassword && e.type === "password" ? (b(), s("button", {
179
+ key: 0,
180
+ type: "button",
181
+ class: "sl-input-password-toggle",
182
+ onClick: f
183
+ }, [u(P, {
184
+ name: a.value ? "eye-off" : "lock",
185
+ size: 16
186
+ }, null, 8, ["name"])])) : o("", !0)]))], 2));
187
+ }
188
+ }), [["__scopeId", "data-v-50b7cf97"]]), U = {
189
+ key: 0,
190
+ class: "sl-switch-label"
191
+ }, W = /*#__PURE__*/ N(/* @__PURE__ */ d({
192
+ __name: "SecLabSwitch",
193
+ props: {
194
+ modelValue: { type: Boolean },
195
+ activeText: { default: "" },
196
+ disabled: {
197
+ type: Boolean,
198
+ default: !1
199
+ }
200
+ },
201
+ emits: ["update:modelValue", "change"],
202
+ setup(e, { emit: t }) {
203
+ let n = e, r = t;
204
+ function i() {
205
+ if (n.disabled) return;
206
+ let e = !n.modelValue;
207
+ r("update:modelValue", e), r("change", e);
208
+ }
209
+ return (t, n) => (b(), s("div", {
210
+ class: h(["sl-switch", {
211
+ "is-active": e.modelValue,
212
+ "is-disabled": e.disabled
213
+ }]),
214
+ onClick: i
215
+ }, [n[0] ||= c("div", { class: "sl-switch-track" }, [c("div", { class: "sl-switch-handle" })], -1), e.activeText ? (b(), s("span", U, T(e.activeText), 1)) : o("", !0)], 2));
216
+ }
217
+ }), [["__scopeId", "data-v-53a4e5f3"]]), G = /*#__PURE__*/ N(/* @__PURE__ */ d({
218
+ __name: "SecLabTag",
219
+ props: {
220
+ type: { default: "default" },
221
+ effect: { default: "light" }
222
+ },
223
+ setup(e) {
224
+ return (t, n) => (b(), s("span", { class: h(["sl-tag", [`sl-tag--${e.type}`, `sl-tag--${e.effect}`]]) }, [w(t.$slots, "default", {}, void 0, !0)], 2));
225
+ }
226
+ }), [["__scopeId", "data-v-8f4f8c94"]]), K = {
227
+ key: 0,
228
+ class: "sl-card-header"
229
+ }, q = /*#__PURE__*/ N(/* @__PURE__ */ d({
230
+ __name: "SecLabCard",
231
+ props: {
232
+ shadow: { default: "always" },
233
+ contentStyle: {},
234
+ contentRole: { default: "content" },
235
+ fullHeight: {
236
+ type: Boolean,
237
+ default: !1
238
+ }
239
+ },
240
+ setup(e) {
241
+ return (t, n) => (b(), s("div", { class: h(["sl-card", [`is-shadow-${e.shadow}`, { "is-full-height": e.fullHeight }]]) }, [t.$slots.header ? (b(), s("div", K, [w(t.$slots, "header", {}, void 0, !0)])) : o("", !0), c("div", {
242
+ class: h([e.contentRole === "header" ? "sl-card-header" : "sl-card-content", { "is-full-height": e.fullHeight }]),
243
+ style: g(e.contentStyle)
244
+ }, [w(t.$slots, "default", {}, void 0, !0)], 6)], 2));
245
+ }
246
+ }), [["__scopeId", "data-v-4d4196c3"]]), J = { class: "sl-checkbox-input" }, Y = ["checked", "disabled"], X = {
247
+ key: 0,
248
+ class: "sl-checkbox-label"
249
+ }, Z = /*#__PURE__*/ N(/* @__PURE__ */ d({
250
+ __name: "SecLabCheckbox",
251
+ props: {
252
+ modelValue: { type: Boolean },
253
+ disabled: {
254
+ type: Boolean,
255
+ default: !1
256
+ }
257
+ },
258
+ emits: ["update:modelValue", "change"],
259
+ setup(e, { emit: t }) {
260
+ let n = e, r = t;
261
+ function i() {
262
+ if (n.disabled) return;
263
+ let e = !n.modelValue;
264
+ r("update:modelValue", e), r("change", e);
265
+ }
266
+ return (t, n) => (b(), s("label", { class: h(["sl-checkbox", {
267
+ "is-active": e.modelValue,
268
+ "is-disabled": e.disabled
269
+ }]) }, [c("span", J, [c("input", {
270
+ type: "checkbox",
271
+ class: "sl-checkbox-original",
272
+ checked: e.modelValue,
273
+ disabled: e.disabled,
274
+ onChange: i
275
+ }, null, 40, Y), n[0] ||= c("span", { class: "sl-checkbox-inner" }, null, -1)]), t.$slots.default ? (b(), s("span", X, [w(t.$slots, "default", {}, void 0, !0)])) : o("", !0)], 2));
276
+ }
277
+ }), [["__scopeId", "data-v-83861535"]]), Q = { class: "sl-empty" }, $ = { class: "sl-empty-icon" }, ee = { class: "sl-empty-description" }, te = {
278
+ key: 0,
279
+ class: "sl-empty-extra"
280
+ }, ne = /*#__PURE__*/ N(/* @__PURE__ */ d({
281
+ __name: "SecLabEmpty",
282
+ props: {
283
+ description: { default: "暂无数据" },
284
+ icon: { default: "empty" }
285
+ },
286
+ setup(e) {
287
+ return (t, n) => (b(), s("div", Q, [
288
+ c("div", $, [w(t.$slots, "icon", {}, () => [u(P, {
289
+ name: e.icon,
290
+ size: 48
291
+ }, null, 8, ["name"])], !0)]),
292
+ c("p", ee, [w(t.$slots, "default", {}, () => [l(T(e.description), 1)], !0)]),
293
+ t.$slots.extra ? (b(), s("div", te, [w(t.$slots, "extra", {}, void 0, !0)])) : o("", !0)
294
+ ]));
295
+ }
296
+ }), [["__scopeId", "data-v-22abf00f"]]), re = {
297
+ key: 0,
298
+ class: "sl-alert-icon"
299
+ }, ie = { class: "sl-alert-content" }, ae = {
300
+ key: 0,
301
+ class: "sl-alert-title"
302
+ }, oe = { class: "sl-alert-description" }, se = /*#__PURE__*/ N(/* @__PURE__ */ d({
303
+ __name: "SecLabAlert",
304
+ props: {
305
+ title: {},
306
+ description: {},
307
+ type: { default: "info" },
308
+ showIcon: {
309
+ type: Boolean,
310
+ default: !1
311
+ },
312
+ closable: {
313
+ type: Boolean,
314
+ default: !1
315
+ }
316
+ },
317
+ emits: ["close"],
318
+ setup(e, { emit: t }) {
319
+ let r = t, i = S(!0);
320
+ function d() {
321
+ i.value = !1, r("close");
322
+ }
323
+ function f(e) {
324
+ return e === "success" ? "success" : e === "error" ? "error" : e === "warning" ? "warning" : "info";
325
+ }
326
+ return (t, r) => (b(), a(n, { name: "sl-alert-fade" }, {
327
+ default: O(() => [i.value ? (b(), s("div", {
328
+ key: 0,
329
+ class: h(["sl-alert", [`is-${e.type}`]]),
330
+ role: "alert"
331
+ }, [
332
+ e.showIcon ? (b(), s("div", re, [u(P, {
333
+ name: f(e.type),
334
+ size: 16
335
+ }, null, 8, ["name"])])) : o("", !0),
336
+ c("div", ie, [e.title ? (b(), s("h4", ae, T(e.title), 1)) : o("", !0), c("div", oe, [w(t.$slots, "default", {}, () => [l(T(e.description), 1)], !0)])]),
337
+ e.closable ? (b(), s("button", {
338
+ key: 1,
339
+ type: "button",
340
+ class: "sl-alert-close",
341
+ onClick: d
342
+ }, " × ")) : o("", !0)
343
+ ], 2)) : o("", !0)]),
344
+ _: 3
345
+ }));
346
+ }
347
+ }), [["__scopeId", "data-v-9ed4aa1d"]]), ce = {
348
+ key: 0,
349
+ class: "sl-loading-mask"
350
+ }, le = { class: "sl-loading-spinner" }, ue = {
351
+ key: 0,
352
+ class: "sl-loading-text"
353
+ }, de = /*#__PURE__*/ N(/* @__PURE__ */ d({
354
+ __name: "SecLabLoading",
355
+ props: {
356
+ loading: { type: Boolean },
357
+ text: {},
358
+ cover: { type: Boolean }
359
+ },
360
+ setup(e) {
361
+ return (t, r) => (b(), s("div", { class: h(["sl-loading-host", {
362
+ "is-cover": e.cover,
363
+ "is-loading": e.loading
364
+ }]) }, [w(t.$slots, "default", {}, void 0, !0), u(n, { name: "sl-loading-fade" }, {
365
+ default: O(() => [e.loading ? (b(), s("div", ce, [c("div", le, [r[0] ||= c("svg", {
366
+ class: "sl-spinner",
367
+ viewBox: "0 0 50 50"
368
+ }, [c("circle", {
369
+ class: "path",
370
+ cx: "25",
371
+ cy: "25",
372
+ r: "20",
373
+ fill: "none",
374
+ "stroke-width": "5"
375
+ })], -1), e.text ? (b(), s("p", ue, T(e.text), 1)) : o("", !0)])])) : o("", !0)]),
376
+ _: 1
377
+ })], 2));
378
+ }
379
+ }), [["__scopeId", "data-v-60f6d832"]]), fe = {
380
+ class: "sl-breadcrumb",
381
+ "aria-label": "Breadcrumb"
382
+ }, pe = /*#__PURE__*/ N(/* @__PURE__ */ d({
383
+ __name: "SecLabBreadcrumb",
384
+ props: { separator: { default: "/" } },
385
+ setup(e) {
386
+ return x("sl-breadcrumb-separator", e.separator), (e, t) => (b(), s("nav", fe, [w(e.$slots, "default", {}, void 0, !0)]));
387
+ }
388
+ }), [["__scopeId", "data-v-a8611c65"]]), me = { class: "sl-breadcrumb-item" }, he = { class: "sl-breadcrumb-label" }, ge = {
389
+ class: "sl-breadcrumb-separator",
390
+ role: "presentation"
391
+ }, _e = /*#__PURE__*/ N(/* @__PURE__ */ d({
392
+ __name: "SecLabBreadcrumbItem",
393
+ setup(e) {
394
+ let t = f("sl-breadcrumb-separator", "/");
395
+ return (e, n) => (b(), s("span", me, [c("span", he, [w(e.$slots, "default", {}, void 0, !0)]), c("span", ge, T(E(t)), 1)]));
396
+ }
397
+ }), [["__scopeId", "data-v-31ad91c7"]]), ve = { class: "sl-toast-container" }, ye = ["onClick"], be = { class: "sl-toast-icon" }, xe = { class: "sl-toast-content" }, Se = { class: "sl-toast-title" }, Ce = { class: "sl-toast-message" }, we = ["onClick"], Te = /*#__PURE__*/ N(/* @__PURE__ */ d({
398
+ __name: "SecLabToast",
399
+ props: { toasts: {} },
400
+ emits: ["close"],
401
+ setup(n, { emit: i }) {
402
+ let o = i;
403
+ function l(e) {
404
+ return e === "success" ? "success" : e === "error" ? "error" : e === "warning" ? "warning" : "info";
405
+ }
406
+ return (i, d) => (b(), a(t, { to: "body" }, [c("div", ve, [u(r, { name: "sl-toast-list" }, {
407
+ default: O(() => [(b(!0), s(e, null, C(n.toasts, (e) => (b(), s("div", {
408
+ key: e.id,
409
+ class: h(["sl-toast-item", [`is-${e.type}`]]),
410
+ role: "alert",
411
+ onClick: (t) => o("close", e.id)
412
+ }, [
413
+ c("div", be, [u(P, {
414
+ name: l(e.type),
415
+ size: 20
416
+ }, null, 8, ["name"])]),
417
+ c("div", xe, [c("h4", Se, T(e.title), 1), c("p", Ce, T(e.message), 1)]),
418
+ c("button", {
419
+ class: "sl-toast-close",
420
+ onClick: k((t) => o("close", e.id), ["stop"])
421
+ }, " × ", 8, we)
422
+ ], 10, ye))), 128))]),
423
+ _: 1
424
+ })])]));
425
+ }
426
+ }), [["__scopeId", "data-v-ee7cd1cc"]]), Ee = ["data-position"], De = ["data-position"], Oe = /*#__PURE__*/ N(/* @__PURE__ */ d({
427
+ __name: "SecLabTooltip",
428
+ props: {
429
+ text: {},
430
+ position: { default: "top" },
431
+ delay: { default: 200 }
432
+ },
433
+ setup(e) {
434
+ let r = e, i = S(!1), d = S({}), f = S(null), p = S(null), h, _ = () => {
435
+ if (!f.value || !p.value) return;
436
+ let e = f.value.getBoundingClientRect(), t = p.value.getBoundingClientRect(), n = window.innerWidth, i = 0, a = 0, o = e.top + e.height / 2, s = e.left + e.width / 2;
437
+ switch (r.position) {
438
+ case "top":
439
+ case "bottom":
440
+ i = r.position === "top" ? e.top - t.height - 8 : e.bottom + 8, a = s - t.width / 2, a < 5 && (a = 5);
441
+ let c = a + t.width, l = n - 5;
442
+ c > l && (a = Math.max(5, a - (c - l)));
443
+ break;
444
+ case "left":
445
+ case "right":
446
+ i = o - t.height / 2, a = r.position === "left" ? e.left - t.width - 8 : e.right + 8;
447
+ break;
448
+ }
449
+ d.value = {
450
+ top: `${i + window.scrollY}px`,
451
+ left: `${a + window.scrollX}px`
452
+ };
453
+ }, v = () => {
454
+ clearTimeout(h), h = setTimeout(() => {
455
+ i.value = !0, m(() => {
456
+ _();
457
+ });
458
+ }, r.delay);
459
+ }, x = () => {
460
+ clearTimeout(h), i.value = !1;
461
+ };
462
+ return y(() => {
463
+ clearTimeout(h);
464
+ }), (r, m) => (b(), s("div", {
465
+ class: "sl-tooltip-wrapper",
466
+ ref_key: "triggerRef",
467
+ ref: f,
468
+ onMouseenter: v,
469
+ onMouseleave: x
470
+ }, [w(r.$slots, "default", {}, void 0, !0), (b(), a(t, { to: "body" }, [u(n, { name: "sl-tooltip-fade" }, {
471
+ default: O(() => [i.value && e.text ? (b(), s("div", {
472
+ key: 0,
473
+ ref_key: "tooltipRef",
474
+ ref: p,
475
+ class: "sl-tooltip-content",
476
+ style: g(d.value),
477
+ "data-position": e.position
478
+ }, [l(T(e.text) + " ", 1), c("span", {
479
+ class: "sl-tooltip-arrow",
480
+ "data-position": e.position
481
+ }, null, 8, De)], 12, Ee)) : o("", !0)]),
482
+ _: 1
483
+ })]))], 544));
484
+ }
485
+ }), [["__scopeId", "data-v-08301298"]]), ke = {
486
+ key: 0,
487
+ class: "sl-descriptions-title"
488
+ }, Ae = { class: "sl-descriptions-label" }, je = { class: "sl-descriptions-content" }, Me = /*#__PURE__*/ N(/* @__PURE__ */ d({
489
+ __name: "SecLabDescriptions",
490
+ props: {
491
+ title: {},
492
+ items: {},
493
+ data: {},
494
+ column: { default: 1 },
495
+ border: {
496
+ type: Boolean,
497
+ default: !1
498
+ }
499
+ },
500
+ setup(t) {
501
+ return (n, r) => (b(), s("div", { class: h(["sl-descriptions", { "is-border": t.border }]) }, [t.title ? (b(), s("div", ke, T(t.title), 1)) : o("", !0), c("div", {
502
+ class: "sl-descriptions-grid",
503
+ style: g({ gridTemplateColumns: `repeat(${t.column}, 1fr)` })
504
+ }, [(b(!0), s(e, null, C(t.items, (r, i) => (b(), s("div", {
505
+ key: i,
506
+ class: "sl-descriptions-item",
507
+ style: g({ gridColumn: `span ${r.span || 1}` })
508
+ }, [c("div", Ae, T(r.label), 1), c("div", je, [r.slot ? w(n.$slots, r.slot, {
509
+ key: 0,
510
+ item: r,
511
+ data: t.data
512
+ }, void 0, !0) : (b(), s(e, { key: 1 }, [l(T(r.value ?? (t.data && r.label ? t.data[r.label] : "--")), 1)], 64))])], 4))), 128))], 4)], 2));
513
+ }
514
+ }), [["__scopeId", "data-v-46840300"]]), Ne = { class: "sl-form-item" }, Pe = {
515
+ key: 0,
516
+ class: "sl-form-item-label"
517
+ }, Fe = {
518
+ key: 0,
519
+ class: "sl-form-item-required"
520
+ }, Ie = { class: "sl-form-item-content" }, Le = {
521
+ key: 0,
522
+ class: "sl-form-item-hint"
523
+ }, Re = /*#__PURE__*/ N(/* @__PURE__ */ d({
524
+ __name: "SecLabFormItem",
525
+ props: {
526
+ label: {},
527
+ required: { type: Boolean },
528
+ hint: {}
529
+ },
530
+ setup(e) {
531
+ return (t, n) => (b(), s("div", Ne, [e.label ? (b(), s("label", Pe, [e.required ? (b(), s("span", Fe, "*")) : o("", !0), l(" " + T(e.label), 1)])) : o("", !0), c("div", Ie, [w(t.$slots, "default", {}, void 0, !0), e.hint ? (b(), s("div", Le, T(e.hint), 1)) : o("", !0)])]));
532
+ }
533
+ }), [["__scopeId", "data-v-acd45057"]]), ze = { class: "sl-tabs" }, Be = {
534
+ class: "sl-tabs-nav",
535
+ role: "tablist"
536
+ }, Ve = ["aria-selected", "onClick"], He = /*#__PURE__*/ N(/* @__PURE__ */ d({
537
+ __name: "SecLabTabs",
538
+ props: {
539
+ modelValue: {},
540
+ tabs: {}
541
+ },
542
+ emits: ["update:modelValue", "tab-change"],
543
+ setup(t, { emit: n }) {
544
+ let r = n;
545
+ function i(e) {
546
+ e.disabled || (r("update:modelValue", e.name), r("tab-change", e.name));
547
+ }
548
+ return (n, r) => (b(), s("div", ze, [c("div", Be, [(b(!0), s(e, null, C(t.tabs, (e) => (b(), s("div", {
549
+ key: e.name,
550
+ class: h(["sl-tabs-item", {
551
+ "is-active": t.modelValue === e.name,
552
+ "is-disabled": e.disabled
553
+ }]),
554
+ role: "tab",
555
+ "aria-selected": t.modelValue === e.name,
556
+ onClick: (t) => i(e)
557
+ }, T(e.label), 11, Ve))), 128))])]));
558
+ }
559
+ }), [["__scopeId", "data-v-91832967"]]), Ue = {
560
+ class: "sl-menu",
561
+ role: "menu"
562
+ }, We = { class: "sl-menu-group-title" }, Ge = { class: "sl-menu-items" }, Ke = ["onClick"], qe = { class: "sl-menu-item-label" }, Je = /*#__PURE__*/ N(/* @__PURE__ */ d({
563
+ __name: "SecLabMenu",
564
+ props: {
565
+ modelValue: {},
566
+ items: {}
567
+ },
568
+ emits: ["update:modelValue", "select"],
569
+ setup(t, { emit: n }) {
570
+ let r = n;
571
+ function i(e) {
572
+ r("update:modelValue", e), r("select", e);
573
+ }
574
+ return (n, r) => (b(), s("nav", Ue, [(b(!0), s(e, null, C(t.items, (n) => (b(), s("div", {
575
+ key: n.key,
576
+ class: "sl-menu-group"
577
+ }, [c("div", We, T(n.label), 1), c("ul", Ge, [(b(!0), s(e, null, C(n.children, (e) => (b(), s("li", {
578
+ key: e.key,
579
+ class: h(["sl-menu-item", { "is-active": t.modelValue === e.key }]),
580
+ role: "menuitem",
581
+ onClick: (t) => i(e.key)
582
+ }, [c("span", qe, T(e.label), 1)], 10, Ke))), 128))])]))), 128))]));
583
+ }
584
+ }), [["__scopeId", "data-v-3e1d96f6"]]), Ye = ["disabled"], Xe = { class: "sl-action-btn-text" }, Ze = ["disabled", "onClick"], Qe = { class: "sl-dropdown-label" }, $e = /*#__PURE__*/ N(/* @__PURE__ */ d({
585
+ __name: "SecLabActionMenu",
586
+ props: {
587
+ actions: {},
588
+ label: {},
589
+ disabled: {
590
+ type: Boolean,
591
+ default: !1
592
+ },
593
+ defaultIcon: { default: "settings" }
594
+ },
595
+ setup(r) {
596
+ let i = r, l = S(!1), d = S(null), f = S(null), p = S({}), y = () => {
597
+ if (!d.value || !l.value) return;
598
+ let e = d.value.getBoundingClientRect();
599
+ p.value = {
600
+ top: `${e.bottom + window.scrollY + 4}px`,
601
+ left: `${e.right + window.scrollX}px`,
602
+ transform: "translateX(-100%)"
603
+ };
604
+ }, x = () => {
605
+ i.disabled || (l.value = !l.value, l.value && m(y));
606
+ }, w = (e) => {
607
+ e.disabled || (e.handler(), l.value = !1);
608
+ }, E = (e) => {
609
+ let t = e.target;
610
+ d.value && !d.value.contains(t) && (!f.value || !f.value.contains(t)) && (l.value = !1);
611
+ };
612
+ return v(() => {
613
+ document.addEventListener("click", E), window.addEventListener("resize", y), window.addEventListener("scroll", y, !0);
614
+ }), _(() => {
615
+ document.removeEventListener("click", E), window.removeEventListener("resize", y), window.removeEventListener("scroll", y, !0);
616
+ }), (i, m) => (b(), s("div", {
617
+ class: "sl-action-menu",
618
+ ref_key: "menuRef",
619
+ ref: d
620
+ }, [c("button", {
621
+ class: "sl-action-btn",
622
+ disabled: r.disabled,
623
+ onClick: k(x, ["stop"])
624
+ }, [u(P, {
625
+ class: "sl-action-btn-icon",
626
+ name: "settings",
627
+ size: 16
628
+ }), c("span", Xe, T(r.label || "操作"), 1)], 8, Ye), (b(), a(t, { to: "body" }, [u(n, { name: "sl-fade" }, {
629
+ default: O(() => [l.value ? (b(), s("div", {
630
+ key: 0,
631
+ ref_key: "dropdownRef",
632
+ ref: f,
633
+ class: "sl-dropdown",
634
+ style: g(p.value),
635
+ onClick: m[0] ||= k(() => {}, ["stop"])
636
+ }, [(b(!0), s(e, null, C(r.actions, (e, t) => (b(), a(Oe, {
637
+ key: t,
638
+ text: e.tooltip || "",
639
+ disabled: !e.tooltip,
640
+ position: "right",
641
+ class: "sl-dropdown-tooltip-wrapper"
642
+ }, {
643
+ default: O(() => [c("button", {
644
+ class: h(["sl-dropdown-item", [e.class, { "is-disabled": e.disabled }]]),
645
+ disabled: e.disabled,
646
+ onClick: (t) => w(e)
647
+ }, [u(P, {
648
+ class: "sl-dropdown-icon",
649
+ name: e.icon || r.defaultIcon,
650
+ size: 16
651
+ }, null, 8, ["name"]), c("span", Qe, T(e.label), 1)], 10, Ze)]),
652
+ _: 2
653
+ }, 1032, ["text", "disabled"]))), 128))], 4)) : o("", !0)]),
654
+ _: 1
655
+ })]))], 512));
656
+ }
657
+ }), [["__scopeId", "data-v-5a6e8669"]]), et = {
658
+ class: "sl-dialog-header",
659
+ "data-slot": "header"
660
+ }, tt = { class: "sl-dialog-title" }, nt = { class: "sl-dialog-body" }, rt = {
661
+ key: 0,
662
+ class: "sl-dialog-footer",
663
+ "data-slot": "footer"
664
+ }, it = /*#__PURE__*/ N(/* @__PURE__ */ d({
665
+ inheritAttrs: !1,
666
+ __name: "SecLabDialog",
667
+ props: {
668
+ visible: { type: Boolean },
669
+ title: {},
670
+ width: { default: "500px" },
671
+ closeOnClickOverlay: {
672
+ type: Boolean,
673
+ default: !0
674
+ },
675
+ zIndex: { default: "var(--sdl-z-index-modal)" }
676
+ },
677
+ emits: ["close"],
678
+ setup(e, { emit: r }) {
679
+ let l = e, d = r, f = i(() => ({ zIndex: l.zIndex }));
680
+ return (r, i) => (b(), a(t, { to: "body" }, [u(n, { name: "sl-dialog-fade" }, {
681
+ default: O(() => [e.visible ? (b(), s("div", p({
682
+ key: 0,
683
+ class: "sl-dialog-overlay"
684
+ }, r.$attrs, {
685
+ style: f.value,
686
+ onClick: i[1] ||= k((t) => e.closeOnClickOverlay ? d("close") : void 0, ["self"])
687
+ }), [c("div", {
688
+ class: "sl-dialog-card",
689
+ style: g({
690
+ width: e.width,
691
+ maxWidth: "95%"
692
+ }),
693
+ role: "dialog",
694
+ "aria-modal": "true"
695
+ }, [
696
+ c("div", et, [c("span", tt, T(e.title), 1), c("button", {
697
+ class: "sl-dialog-close-btn",
698
+ onClick: i[0] ||= (e) => d("close"),
699
+ "aria-label": "Close dialog"
700
+ }, " × ")]),
701
+ c("div", nt, [w(r.$slots, "default", {}, void 0, !0)]),
702
+ r.$slots.footer ? (b(), s("div", rt, [w(r.$slots, "footer", {}, void 0, !0)])) : o("", !0)
703
+ ], 4)], 16)) : o("", !0)]),
704
+ _: 3
705
+ })]));
706
+ }
707
+ }), [["__scopeId", "data-v-c8529976"]]), at = ["aria-label"], ot = {
708
+ class: "sl-drawer-header",
709
+ "data-slot": "header"
710
+ }, st = { class: "sl-drawer-title" }, ct = { class: "sl-drawer-body" }, lt = {
711
+ key: 0,
712
+ class: "sl-drawer-footer",
713
+ "data-slot": "footer"
714
+ }, ut = /*#__PURE__*/ N(/* @__PURE__ */ d({
715
+ inheritAttrs: !1,
716
+ __name: "SecLabDrawer",
717
+ props: {
718
+ modelValue: { type: Boolean },
719
+ title: { default: "" },
720
+ width: { default: "420px" },
721
+ closeOnOverlay: {
722
+ type: Boolean,
723
+ default: !0
724
+ }
725
+ },
726
+ emits: ["update:modelValue", "close"],
727
+ setup(e, { emit: r }) {
728
+ let l = e, d = r, f = i(() => ({ width: l.width })), m = () => {
729
+ d("update:modelValue", !1), d("close");
730
+ }, h = () => {
731
+ l.closeOnOverlay && m();
732
+ };
733
+ return (e, r) => (b(), a(t, { to: "body" }, [u(n, { name: "sl-drawer-fade" }, {
734
+ default: O(() => [l.modelValue ? (b(), s("div", p({
735
+ key: 0,
736
+ class: "sl-drawer-overlay"
737
+ }, e.$attrs, { onClick: k(h, ["self"]) }), [c("div", {
738
+ class: "sl-drawer-panel",
739
+ style: g(f.value),
740
+ role: "dialog",
741
+ "aria-modal": "true",
742
+ "aria-label": l.title
743
+ }, [
744
+ c("div", ot, [c("h3", st, T(l.title), 1), c("button", {
745
+ class: "sl-drawer-close-btn",
746
+ onClick: m
747
+ }, "×")]),
748
+ c("div", ct, [w(e.$slots, "default", {}, void 0, !0)]),
749
+ e.$slots.footer ? (b(), s("div", lt, [w(e.$slots, "footer", {}, void 0, !0)])) : o("", !0)
750
+ ], 12, at)], 16)) : o("", !0)]),
751
+ _: 3
752
+ })]));
753
+ }
754
+ }), [["__scopeId", "data-v-20b5955a"]]), dt = {
755
+ class: "sl-modal-card",
756
+ role: "alertdialog",
757
+ "aria-modal": "true"
758
+ }, ft = {
759
+ class: "sl-modal-header",
760
+ "data-slot": "header"
761
+ }, pt = { class: "sl-modal-title" }, mt = { class: "sl-modal-body" }, ht = { class: "sl-modal-message" }, gt = {
762
+ class: "sl-modal-footer",
763
+ "data-slot": "footer"
764
+ }, _t = /*#__PURE__*/ N(/* @__PURE__ */ d({
765
+ inheritAttrs: !1,
766
+ __name: "SecLabModal",
767
+ props: {
768
+ visible: { type: Boolean },
769
+ title: {},
770
+ message: {},
771
+ confirmText: { default: "确定" },
772
+ cancelText: { default: "取消" },
773
+ type: { default: "primary" }
774
+ },
775
+ emits: ["confirm", "cancel"],
776
+ setup(e, { emit: r }) {
777
+ let i = r;
778
+ return (r, l) => (b(), a(t, { to: "body" }, [u(n, { name: "sl-modal-fade" }, {
779
+ default: O(() => [e.visible ? (b(), s("div", p({
780
+ key: 0,
781
+ class: "sl-modal-overlay"
782
+ }, r.$attrs, { onClick: l[2] ||= k((e) => i("cancel"), ["self"]) }), [c("div", dt, [
783
+ c("div", ft, [c("h3", pt, T(e.title), 1)]),
784
+ c("div", mt, [c("p", ht, T(e.message), 1)]),
785
+ c("div", gt, [c("button", {
786
+ class: "sl-modal-btn is-cancel",
787
+ onClick: l[0] ||= (e) => i("cancel")
788
+ }, T(e.cancelText), 1), c("button", {
789
+ class: h(["sl-modal-btn", [`is-${e.type}`]]),
790
+ onClick: l[1] ||= (e) => i("confirm")
791
+ }, T(e.confirmText), 3)])
792
+ ])], 16)) : o("", !0)]),
793
+ _: 1
794
+ })]));
795
+ }
796
+ }), [["__scopeId", "data-v-5f4406fe"]]), vt = {
797
+ key: 0,
798
+ class: "sl-pagination"
799
+ }, yt = ["disabled"], bt = ["onClick", "disabled"], xt = ["disabled"], St = /*#__PURE__*/ N(/* @__PURE__ */ d({
800
+ __name: "SecLabPagination",
801
+ props: {
802
+ currentPage: {
803
+ type: Number,
804
+ required: !0
805
+ },
806
+ totalPages: {
807
+ type: Number,
808
+ required: !0
809
+ },
810
+ maxVisibleButtons: {
811
+ type: Number,
812
+ default: 5
813
+ }
814
+ },
815
+ emits: ["page-change"],
816
+ setup(t, { emit: n }) {
817
+ let r = t, a = n, l = i(() => {
818
+ let e = r.totalPages, t = r.currentPage, n = r.maxVisibleButtons, i = [];
819
+ if (e <= n) for (let t = 1; t <= e; t++) i.push(t);
820
+ else {
821
+ let r = Math.floor(n / 2), a = Math.max(1, t - r), o = Math.min(e, t + r);
822
+ t - a < r && (o += r - (t - a)), o - t < r && (a -= r - (o - t)), a = Math.max(1, a), o = Math.min(e, o), a > 1 && (i.push(1), a > 2 && i.push("..."));
823
+ for (let e = a; e <= o; e++) i.push(e);
824
+ o < e && (o < e - 1 && i.push("..."), i.push(e));
825
+ }
826
+ return i;
827
+ });
828
+ function u(e) {
829
+ typeof e == "number" && e !== r.currentPage && a("page-change", e);
830
+ }
831
+ return (n, r) => t.totalPages > 1 ? (b(), s("div", vt, [
832
+ c("button", {
833
+ class: "sl-pagination-btn",
834
+ onClick: r[0] ||= (e) => u(t.currentPage - 1),
835
+ disabled: t.currentPage === 1
836
+ }, " < ", 8, yt),
837
+ (b(!0), s(e, null, C(l.value, (e, n) => (b(), s("button", {
838
+ key: n,
839
+ class: h(["sl-pagination-btn", {
840
+ active: e === t.currentPage,
841
+ ellipsis: typeof e == "string"
842
+ }]),
843
+ onClick: (t) => u(e),
844
+ disabled: typeof e == "string"
845
+ }, T(e), 11, bt))), 128)),
846
+ c("button", {
847
+ class: "sl-pagination-btn",
848
+ onClick: r[1] ||= (e) => u(t.currentPage + 1),
849
+ disabled: t.currentPage === t.totalPages
850
+ }, " > ", 8, xt)
851
+ ])) : o("", !0);
852
+ }
853
+ }), [["__scopeId", "data-v-f0849d78"]]), Ct = { class: "sl-select-label" }, wt = ["title", "onClick"], Tt = /*#__PURE__*/ N(/* @__PURE__ */ d({
854
+ __name: "SecLabSelect",
855
+ props: {
856
+ modelValue: {},
857
+ options: {},
858
+ placeholder: {},
859
+ disabled: { type: Boolean }
860
+ },
861
+ emits: ["update:modelValue", "option-disabled"],
862
+ setup(r, { emit: l }) {
863
+ let d = r, f = l, p = S(!1), _ = S(null), x = S({}), w = i(() => {
864
+ let e = d.options.find((e) => e.value === d.modelValue);
865
+ return e ? e.label : d.placeholder || "请选择";
866
+ }), E = () => {
867
+ if (!_.value || !p.value) return;
868
+ let e = _.value.getBoundingClientRect();
869
+ x.value = {
870
+ minWidth: `${e.width}px`,
871
+ top: `${e.bottom + window.scrollY + 4}px`,
872
+ left: `${e.left + window.scrollX}px`
873
+ };
874
+ };
875
+ D(p, (e) => {
876
+ e && m(() => {
877
+ E();
878
+ });
879
+ });
880
+ function k() {
881
+ d.disabled || (p.value = !p.value);
882
+ }
883
+ function A(e) {
884
+ if (!d.disabled) {
885
+ if (e.disabled) {
886
+ f("option-disabled", e);
887
+ return;
888
+ }
889
+ f("update:modelValue", e.value), p.value = !1;
890
+ }
891
+ }
892
+ function j(e) {
893
+ _.value && !_.value.contains(e.target) && (p.value = !1);
894
+ }
895
+ return v(() => {
896
+ document.addEventListener("click", j), window.addEventListener("resize", E), window.addEventListener("scroll", E, !0);
897
+ }), y(() => {
898
+ document.removeEventListener("click", j), window.removeEventListener("resize", E), window.removeEventListener("scroll", E, !0);
899
+ }), (i, l) => (b(), s("div", {
900
+ class: h(["sl-select", {
901
+ "is-open": p.value,
902
+ "is-disabled": r.disabled
903
+ }]),
904
+ ref_key: "selectRef",
905
+ ref: _
906
+ }, [c("div", {
907
+ class: "sl-select-trigger",
908
+ onClick: k
909
+ }, [c("span", Ct, T(w.value), 1), l[0] ||= c("span", { class: "sl-select-arrow" }, null, -1)]), (b(), a(t, { to: "body" }, [u(n, { name: "sl-select-fade" }, {
910
+ default: O(() => [p.value ? (b(), s("ul", {
911
+ key: 0,
912
+ class: "sl-select-options",
913
+ style: g(x.value)
914
+ }, [(b(!0), s(e, null, C(r.options, (e) => (b(), s("li", {
915
+ key: e.value,
916
+ class: h(["sl-select-option", {
917
+ selected: r.modelValue === e.value,
918
+ disabled: e.disabled
919
+ }]),
920
+ title: e.hint,
921
+ onClick: (t) => A(e)
922
+ }, T(e.label), 11, wt))), 128))], 4)) : o("", !0)]),
923
+ _: 1
924
+ })]))], 2));
925
+ }
926
+ }), [["__scopeId", "data-v-f5d7389c"]]), Et = { class: "sl-table-wrapper" }, Dt = { class: "sl-table" }, Ot = { class: "sl-table-header-row" }, kt = { class: "sl-cell" }, At = ["onMouseenter", "onContextmenu"], jt = { class: "sl-cell" }, Mt = { key: 1 }, Nt = ["colspan"], Pt = { class: "sl-table-empty" }, Ft = /*#__PURE__*/ N(/* @__PURE__ */ d({
927
+ __name: "SecLabTable",
928
+ props: {
929
+ data: {},
930
+ columns: {},
931
+ border: {
932
+ type: Boolean,
933
+ default: !1
934
+ },
935
+ emptyText: { default: "暂无数据" }
936
+ },
937
+ emits: ["rowMouseenter", "rowContextmenu"],
938
+ setup(t, { emit: n }) {
939
+ let r = n;
940
+ function i(e) {
941
+ if (e !== void 0) return typeof e == "number" ? `${e}px` : e;
942
+ }
943
+ function a(e) {
944
+ return {
945
+ width: i(e.width),
946
+ minWidth: i(e.minWidth),
947
+ textAlign: e.headerAlign || e.align || "center"
948
+ };
949
+ }
950
+ function o(e) {
951
+ return {
952
+ width: i(e.width),
953
+ minWidth: i(e.minWidth),
954
+ textAlign: e.align || "left"
955
+ };
956
+ }
957
+ return (n, i) => (b(), s("div", {
958
+ class: h(["sl-table-container", { "sl-table-border": t.border }]),
959
+ "data-native-context-menu": ""
960
+ }, [c("div", Et, [c("table", Dt, [c("thead", null, [c("tr", Ot, [(b(!0), s(e, null, C(t.columns, (t, r) => (b(), s("th", {
961
+ key: r,
962
+ class: h(["sl-table-header-cell", [t.fixed ? `is-fixed-${t.fixed}` : ""]]),
963
+ style: g(a(t))
964
+ }, [c("div", kt, [t.headerSlot && n.$slots[t.headerSlot] ? w(n.$slots, t.headerSlot, p({
965
+ key: 0,
966
+ ref_for: !0
967
+ }, {
968
+ column: t,
969
+ index: r,
970
+ row: void 0
971
+ }), void 0, !0) : (b(), s(e, { key: 1 }, [l(T(t.label), 1)], 64))])], 6))), 128))])]), c("tbody", null, [t.data.length > 0 ? (b(!0), s(e, { key: 0 }, C(t.data, (i, a) => (b(), s("tr", {
972
+ key: a,
973
+ class: "sl-table-row",
974
+ onMouseenter: (e) => r("rowMouseenter", i, e, a),
975
+ onContextmenu: (e) => r("rowContextmenu", i, e, a)
976
+ }, [(b(!0), s(e, null, C(t.columns, (t, r) => (b(), s("td", {
977
+ key: r,
978
+ class: h(["sl-table-cell", [t.fixed ? `is-fixed-${t.fixed}` : ""]]),
979
+ style: g(o(t))
980
+ }, [c("div", jt, [t.slot && n.$slots[t.slot] ? w(n.$slots, t.slot, p({
981
+ key: 0,
982
+ ref_for: !0
983
+ }, {
984
+ row: i,
985
+ column: t,
986
+ index: a
987
+ }), void 0, !0) : (b(), s(e, { key: 1 }, [l(T(t.prop ? i[t.prop] : ""), 1)], 64))])], 6))), 128))], 40, At))), 128)) : (b(), s("tr", Mt, [c("td", {
988
+ colspan: t.columns.length,
989
+ class: "sl-table-empty-cell"
990
+ }, [w(n.$slots, "empty", {}, () => [c("div", Pt, T(t.emptyText), 1)], !0)], 8, Nt)]))])])])], 2));
991
+ }
992
+ }), [["__scopeId", "data-v-819b275b"]]), It = {
993
+ class: "sl-date-time-range-picker",
994
+ "data-ui": "date-time-range-picker"
995
+ }, Lt = ["disabled"], Rt = { class: "trigger-text" }, zt = { class: "shortcut-column" }, Bt = { class: "panel-title" }, Vt = ["onClick"], Ht = { class: "calendar-column" }, Ut = { class: "panel-title" }, Wt = { class: "boundary-switch" }, Gt = { class: "calendar-header" }, Kt = { class: "week-grid" }, qt = { class: "day-grid" }, Jt = ["onClick"], Yt = { class: "time-column" }, Xt = { class: "panel-title" }, Zt = { class: "time-lists" }, Qt = { class: "time-list" }, $t = ["onClick"], en = { class: "time-list" }, tn = ["onClick"], nn = { class: "panel-actions" }, rn = /*#__PURE__*/ N(/* @__PURE__ */ d({
996
+ __name: "SecLabDateTimeRangePicker",
997
+ props: {
998
+ modelValue: {},
999
+ placeholder: {},
1000
+ startLabel: {},
1001
+ endLabel: {},
1002
+ shortcutsLabel: {},
1003
+ calendarLabel: {},
1004
+ timeLabel: {},
1005
+ clearLabel: {},
1006
+ confirmLabel: {},
1007
+ cancelLabel: {},
1008
+ locale: {},
1009
+ weekDays: {},
1010
+ shortcuts: {},
1011
+ disabled: {
1012
+ type: Boolean,
1013
+ default: !1
1014
+ }
1015
+ },
1016
+ emits: ["update:modelValue", "apply"],
1017
+ setup(n, { emit: r }) {
1018
+ let l = n, u = r, d = S(null), f = S(null), p = S(!1), v = S("start"), y = S({
1019
+ startAt: null,
1020
+ endAt: null
1021
+ }), x = S(R(/* @__PURE__ */ new Date())), w = S({}), O = Array.from({ length: 24 }, (e, t) => t), k = Array.from({ length: 12 }, (e, t) => t * 5), A = i(() => !l.modelValue.startAt && !l.modelValue.endAt ? l.placeholder : `${U(l.modelValue.startAt)} - ${U(l.modelValue.endAt)}`), j = i(() => L(y.value[`${v.value}At`])), M = i(() => j.value.getHours()), N = i(() => Math.floor(j.value.getMinutes() / 5) * 5), P = i(() => x.value.toLocaleDateString(l.locale === "zh" ? "zh-CN" : "en-US", {
1022
+ year: "numeric",
1023
+ month: "long"
1024
+ })), F = i(() => {
1025
+ let e = R(x.value), t = V(e, -e.getDay());
1026
+ return Array.from({ length: 42 }, (e, n) => {
1027
+ let r = V(t, n), i = r.getTime(), a = y.value.startAt ? z(new Date(y.value.startAt)).getTime() : null, o = y.value.endAt ? z(new Date(y.value.endAt)).getTime() : null, s = a !== null && o !== null ? Math.min(a, o) : null, c = a !== null && o !== null ? Math.max(a, o) : null;
1028
+ return {
1029
+ date: r,
1030
+ key: H(r),
1031
+ label: String(r.getDate()),
1032
+ muted: r.getMonth() !== x.value.getMonth(),
1033
+ today: H(r) === H(/* @__PURE__ */ new Date()),
1034
+ selectedStart: a === i,
1035
+ selectedEnd: o === i,
1036
+ inRange: s !== null && c !== null && i > s && i < c
1037
+ };
1038
+ });
1039
+ });
1040
+ function I(e) {
1041
+ let t = e.startAt ?? null, n = e.endAt ?? null;
1042
+ return t !== null && n !== null && t > n ? {
1043
+ startAt: n,
1044
+ endAt: t
1045
+ } : {
1046
+ startAt: t,
1047
+ endAt: n
1048
+ };
1049
+ }
1050
+ function L(e) {
1051
+ return e ? new Date(e) : /* @__PURE__ */ new Date();
1052
+ }
1053
+ function R(e) {
1054
+ return new Date(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
1055
+ }
1056
+ function z(e) {
1057
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0, 0);
1058
+ }
1059
+ function B(e) {
1060
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999);
1061
+ }
1062
+ function V(e, t) {
1063
+ let n = new Date(e);
1064
+ return n.setDate(n.getDate() + t), n;
1065
+ }
1066
+ function H(e) {
1067
+ let t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
1068
+ return `${e.getFullYear()}-${t}-${n}`;
1069
+ }
1070
+ function U(e) {
1071
+ if (!e) return "--";
1072
+ let t = new Date(e);
1073
+ return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")} ${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
1074
+ }
1075
+ function W() {
1076
+ let e = d.value;
1077
+ if (!e) return;
1078
+ let t = e.getBoundingClientRect(), n = Math.min(Math.max(8, t.left), window.innerWidth - 620 - 8), r = Math.min(t.bottom + 8, window.innerHeight - 468);
1079
+ w.value = {
1080
+ width: "620px",
1081
+ left: `${n}px`,
1082
+ top: `${Math.max(8, r)}px`
1083
+ };
1084
+ }
1085
+ function G() {
1086
+ if (l.disabled) return;
1087
+ y.value = I(l.modelValue);
1088
+ let e = y.value.startAt ?? y.value.endAt ?? Date.now();
1089
+ x.value = R(new Date(e)), p.value = !0, m(W), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0), document.addEventListener("mousedown", q), document.addEventListener("keydown", J);
1090
+ }
1091
+ function K() {
1092
+ p.value = !1, window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0), document.removeEventListener("mousedown", q), document.removeEventListener("keydown", J);
1093
+ }
1094
+ function q(e) {
1095
+ let t = e.target;
1096
+ d.value?.contains(t) || f.value?.contains(t) || K();
1097
+ }
1098
+ function J(e) {
1099
+ e.key === "Escape" && K();
1100
+ }
1101
+ function Y(e) {
1102
+ x.value = new Date(x.value.getFullYear(), x.value.getMonth() + e, 1);
1103
+ }
1104
+ function X(e) {
1105
+ let t = j.value, n = new Date(e.getFullYear(), e.getMonth(), e.getDate(), t.getHours(), t.getMinutes(), 0, 0);
1106
+ y.value = I({
1107
+ ...y.value,
1108
+ [`${v.value}At`]: n.getTime()
1109
+ });
1110
+ }
1111
+ function Z(e, t) {
1112
+ let n = j.value, r = new Date(n.getFullYear(), n.getMonth(), n.getDate(), e, t, 0, 0);
1113
+ y.value = I({
1114
+ ...y.value,
1115
+ [`${v.value}At`]: r.getTime()
1116
+ });
1117
+ }
1118
+ function Q(e) {
1119
+ let t = /* @__PURE__ */ new Date(), n;
1120
+ n = e === "today" ? {
1121
+ startAt: z(t).getTime(),
1122
+ endAt: B(t).getTime()
1123
+ } : {
1124
+ startAt: t.getTime() - {
1125
+ "15m": 900 * 1e3,
1126
+ "1h": 3600 * 1e3,
1127
+ "24h": 1440 * 60 * 1e3,
1128
+ "7d": 10080 * 60 * 1e3
1129
+ }[e],
1130
+ endAt: t.getTime()
1131
+ }, y.value = n, x.value = R(new Date(n.startAt ?? Date.now()));
1132
+ }
1133
+ function $() {
1134
+ let e = {
1135
+ startAt: null,
1136
+ endAt: null
1137
+ };
1138
+ y.value = e, u("update:modelValue", e), u("apply", e), K();
1139
+ }
1140
+ function ee() {
1141
+ let e = I(y.value);
1142
+ u("update:modelValue", e), u("apply", e), K();
1143
+ }
1144
+ return D(() => l.modelValue, (e) => {
1145
+ p.value || (y.value = I(e));
1146
+ }, { deep: !0 }), _(K), (r, i) => (b(), s("div", It, [c("button", {
1147
+ ref_key: "triggerRef",
1148
+ ref: d,
1149
+ type: "button",
1150
+ class: h(["range-trigger", { "is-placeholder": !n.modelValue.startAt && !n.modelValue.endAt }]),
1151
+ disabled: n.disabled,
1152
+ onClick: i[0] ||= (e) => p.value ? K() : G()
1153
+ }, [c("span", Rt, T(A.value), 1)], 10, Lt), (b(), a(t, { to: "body" }, [p.value ? (b(), s("div", {
1154
+ key: 0,
1155
+ ref_key: "panelRef",
1156
+ ref: f,
1157
+ class: "range-panel",
1158
+ style: g(w.value)
1159
+ }, [
1160
+ c("aside", zt, [c("div", Bt, T(n.shortcutsLabel), 1), (b(!0), s(e, null, C(n.shortcuts, (e) => (b(), s("button", {
1161
+ key: e.value,
1162
+ type: "button",
1163
+ class: "shortcut-button",
1164
+ onClick: (t) => Q(e.value)
1165
+ }, T(e.label), 9, Vt))), 128))]),
1166
+ c("section", Ht, [
1167
+ c("div", Ut, T(n.calendarLabel), 1),
1168
+ c("div", Wt, [c("button", {
1169
+ type: "button",
1170
+ class: h(["boundary-button", { "is-active": v.value === "start" }]),
1171
+ onClick: i[1] ||= (e) => v.value = "start"
1172
+ }, [c("span", null, T(n.startLabel), 1), c("strong", null, T(U(y.value.startAt)), 1)], 2), c("button", {
1173
+ type: "button",
1174
+ class: h(["boundary-button", { "is-active": v.value === "end" }]),
1175
+ onClick: i[2] ||= (e) => v.value = "end"
1176
+ }, [c("span", null, T(n.endLabel), 1), c("strong", null, T(U(y.value.endAt)), 1)], 2)]),
1177
+ c("div", Gt, [
1178
+ c("button", {
1179
+ type: "button",
1180
+ class: "month-button",
1181
+ onClick: i[3] ||= (e) => Y(-1)
1182
+ }, " ‹ "),
1183
+ c("span", null, T(P.value), 1),
1184
+ c("button", {
1185
+ type: "button",
1186
+ class: "month-button",
1187
+ onClick: i[4] ||= (e) => Y(1)
1188
+ }, " › ")
1189
+ ]),
1190
+ c("div", Kt, [(b(!0), s(e, null, C(n.weekDays, (e) => (b(), s("span", { key: e }, T(e), 1))), 128))]),
1191
+ c("div", qt, [(b(!0), s(e, null, C(F.value, (e) => (b(), s("button", {
1192
+ key: e.key,
1193
+ type: "button",
1194
+ class: h(["day-button", {
1195
+ "is-muted": e.muted,
1196
+ "is-today": e.today,
1197
+ "is-selected-start": e.selectedStart,
1198
+ "is-selected-end": e.selectedEnd,
1199
+ "is-in-range": e.inRange
1200
+ }]),
1201
+ onClick: (t) => X(e.date)
1202
+ }, T(e.label), 11, Jt))), 128))])
1203
+ ]),
1204
+ c("section", Yt, [c("div", Xt, T(n.timeLabel), 1), c("div", Zt, [c("div", Qt, [(b(!0), s(e, null, C(E(O), (e) => (b(), s("button", {
1205
+ key: e,
1206
+ type: "button",
1207
+ class: h(["time-option", { "is-active": M.value === e }]),
1208
+ onClick: (t) => Z(e, N.value)
1209
+ }, T(String(e).padStart(2, "0")), 11, $t))), 128))]), c("div", en, [(b(!0), s(e, null, C(E(k), (e) => (b(), s("button", {
1210
+ key: e,
1211
+ type: "button",
1212
+ class: h(["time-option", { "is-active": N.value === e }]),
1213
+ onClick: (t) => Z(M.value, e)
1214
+ }, T(String(e).padStart(2, "0")), 11, tn))), 128))])])]),
1215
+ c("footer", nn, [
1216
+ c("button", {
1217
+ type: "button",
1218
+ class: "text-button",
1219
+ onClick: $
1220
+ }, T(n.clearLabel), 1),
1221
+ i[5] ||= c("span", { class: "action-spacer" }, null, -1),
1222
+ c("button", {
1223
+ type: "button",
1224
+ class: "text-button",
1225
+ onClick: K
1226
+ }, T(n.cancelLabel), 1),
1227
+ c("button", {
1228
+ type: "button",
1229
+ class: "confirm-button",
1230
+ onClick: ee
1231
+ }, T(n.confirmLabel), 1)
1232
+ ])
1233
+ ], 4)) : o("", !0)]))]));
1234
+ }
1235
+ }), [["__scopeId", "data-v-51a459e3"]]);
1236
+ //#endregion
1237
+ export { $e as SecLabActionMenu, se as SecLabAlert, pe as SecLabBreadcrumb, _e as SecLabBreadcrumbItem, R as SecLabButton, q as SecLabCard, Z as SecLabCheckbox, rn as SecLabDateTimeRangePicker, Me as SecLabDescriptions, it as SecLabDialog, ut as SecLabDrawer, ne as SecLabEmpty, Re as SecLabFormItem, P as SecLabIcon, H as SecLabInput, de as SecLabLoading, Je as SecLabMenu, _t as SecLabModal, St as SecLabPagination, Tt as SecLabSelect, W as SecLabSwitch, Ft as SecLabTable, He as SecLabTabs, G as SecLabTag, Te as SecLabToast, Oe as SecLabTooltip };