@wpic/ui 0.9.30 → 0.9.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/COMPONENTS.md +2 -0
- package/dist/components/WPopover.vue.d.ts +2 -0
- package/dist/wpic-ui.cjs +7 -7
- package/dist/wpic-ui.css +1 -1
- package/dist/wpic-ui.js +166 -162
- package/package.json +1 -1
package/dist/wpic-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as X, openBlock as e, createBlock as Z, resolveDynamicComponent as S1, normalizeClass as g, withCtx as s1, createElementVNode as i, createCommentVNode as u, renderSlot as K, createElementBlock as t, createVNode as $, unref as m, Fragment as I, renderList as l1, toDisplayString as v, useModel as
|
|
1
|
+
import { defineComponent as X, openBlock as e, createBlock as Z, resolveDynamicComponent as S1, normalizeClass as g, withCtx as s1, createElementVNode as i, createCommentVNode as u, renderSlot as K, createElementBlock as t, createVNode as $, unref as m, Fragment as I, renderList as l1, toDisplayString as v, useModel as t2, useSlots as X2, computed as M, ref as T, watch as C1, onBeforeUnmount as K1, mergeProps as G1, createTextVNode as v1, withDirectives as j1, normalizeStyle as h1, vModelDynamic as k0, mergeModels as i2, vModelCheckbox as t3, withModifiers as b1, onMounted as E2, withKeys as d2, inject as v2, provide as W1, nextTick as H1, Teleport as R1, isRef as i3, vShow as l3, Transition as c2, getCurrentInstance as G2, vModelText as r2, useAttrs as a3, TransitionGroup as o3, useCssVars as s3, vModelSelect as r3, onUnmounted as p3, createSlots as d3, createStaticVNode as A1 } from "vue";
|
|
2
2
|
import { Loader2 as I1, Calendar as x0, DollarSign as w3, X as $1, Check as _1, Search as W2, ChevronUp as y0, ChevronDown as Z1, ChevronsUpDown as _2, ChevronRight as E1, ChevronLeft as x2, Download as u3, Minimize as h3, Expand as m3, CalendarDays as D2, FolderSymlink as v3, Minimize2 as f3, Maximize2 as b3, Plus as $2, Trash2 as g3, Folder as v0, MoreHorizontal as z3, Bot as M0, Paperclip as B2, ThumbsUp as C3, ThumbsDown as k3, Copy as x3, Pencil as y3, MessageSquarePlus as M3, Square as L3, ArrowUp as L0, CircleAlert as V3, CircleCheck as $3, ShieldAlert as B3, Lightbulb as S3, PanelLeftOpen as A3, PanelLeftClose as F3, AlertTriangle as H3, Tag as T2, Clock as P3, RefreshCw as T3, MoveDownRight as j3 } from "lucide-vue-next";
|
|
3
3
|
import { offset as f2, autoPlacement as E3, flip as b2, shift as g2, size as n0, useFloating as z2, autoUpdate as C2, arrow as W3 } from "@floating-ui/vue";
|
|
4
4
|
import { defineStore as D3 } from "pinia";
|
|
@@ -125,7 +125,7 @@ const O3 = {
|
|
|
125
125
|
}, S0 = /* @__PURE__ */ X({
|
|
126
126
|
inheritAttrs: !1,
|
|
127
127
|
__name: "WInput",
|
|
128
|
-
props: /* @__PURE__ */
|
|
128
|
+
props: /* @__PURE__ */ i2({
|
|
129
129
|
icon: { type: [Object, Function] },
|
|
130
130
|
label: {},
|
|
131
131
|
placeholder: {},
|
|
@@ -144,7 +144,7 @@ const O3 = {
|
|
|
144
144
|
}),
|
|
145
145
|
emits: ["update:modelValue"],
|
|
146
146
|
setup(n) {
|
|
147
|
-
const d =
|
|
147
|
+
const d = t2(n, "modelValue"), c = n, o = X2(), r = M(() => c.prepend !== void 0 || !!o.prepend), l = M(() => c.append !== void 0 || !!o.append), a = M(() => {
|
|
148
148
|
if (c.icon) return c.icon;
|
|
149
149
|
if (c.type === "date") return x0;
|
|
150
150
|
if (c.type === "money") return w3;
|
|
@@ -243,7 +243,7 @@ const O3 = {
|
|
|
243
243
|
}
|
|
244
244
|
}), c5 = ["disabled"], f0 = /* @__PURE__ */ X({
|
|
245
245
|
__name: "WCheckbox",
|
|
246
|
-
props: /* @__PURE__ */
|
|
246
|
+
props: /* @__PURE__ */ i2({
|
|
247
247
|
disabled: { type: Boolean }
|
|
248
248
|
}, {
|
|
249
249
|
modelValue: { type: Boolean },
|
|
@@ -251,7 +251,7 @@ const O3 = {
|
|
|
251
251
|
}),
|
|
252
252
|
emits: ["update:modelValue"],
|
|
253
253
|
setup(n) {
|
|
254
|
-
const d =
|
|
254
|
+
const d = t2(n, "modelValue");
|
|
255
255
|
return (c, o) => (e(), t("label", {
|
|
256
256
|
class: g(["wpic-checkbox wpic:relative wpic:inline-flex wpic:items-center wpic:gap-2 wpic:select-none", n.disabled ? "wpic:cursor-not-allowed wpic:opacity-50" : "wpic:cursor-pointer"])
|
|
257
257
|
}, [
|
|
@@ -426,7 +426,7 @@ const O3 = {
|
|
|
426
426
|
for (const g1 of [..._].sort((B1, C) => B1 - C))
|
|
427
427
|
g1 - m1 > 1 && A.push("…"), A.push(g1), m1 = g1;
|
|
428
428
|
return A;
|
|
429
|
-
}),
|
|
429
|
+
}), q = M(() => o.padding ? `wpic-table--padding-${o.padding}` : o.compact ? "wpic-table--padding-sm" : "wpic-table--padding-inherit"), x1 = (J) => J === "right" ? "wpic:text-right" : J === "center" ? "wpic:text-center" : "wpic:text-left", z1 = (J, N) => [
|
|
430
430
|
N,
|
|
431
431
|
o.flushEdges && J === 0 && !o.expandable && !o.selectable ? "wpic:pl-0" : "wpic-table__pad-l",
|
|
432
432
|
o.flushEdges && J === o.columns.length - 1 ? "wpic:pr-0" : "wpic-table__pad-r"
|
|
@@ -435,7 +435,7 @@ const O3 = {
|
|
|
435
435
|
...J.minWidth ? { minWidth: J.minWidth } : {}
|
|
436
436
|
});
|
|
437
437
|
return d({ filteredCount: M(() => x.value.length), searchQuery: B }), (J, N) => (e(), t("div", {
|
|
438
|
-
class: g(["wpic-table", [
|
|
438
|
+
class: g(["wpic-table", [q.value, { "wpic-table--column-dividers": n.columnDividers }]])
|
|
439
439
|
}, [
|
|
440
440
|
(H.value || m(f).toolbar) && !n.loading ? (e(), t("div", {
|
|
441
441
|
key: 0,
|
|
@@ -708,7 +708,7 @@ const O3 = {
|
|
|
708
708
|
const o = n, r = c, l = M(() => o.showAxes && o.showColumnLetters), a = M(() => o.showAxes && o.showRowNumbers), f = M(() => o.columns.some((C) => C.sticky)), b = T(null), V = T("asc"), s = T(o.expanded ?? !1), F = T(null), L = T(null), B = T(null), H = T(null), x = T(null);
|
|
709
709
|
function k() {
|
|
710
710
|
if (!o.downloadable) return;
|
|
711
|
-
const C = (R) => `"${String(R ?? "").replace(/"/g, '""')}"`, D = U.value.map((R) => o.columns.map((
|
|
711
|
+
const C = (R) => `"${String(R ?? "").replace(/"/g, '""')}"`, D = U.value.map((R) => o.columns.map((Q) => C(r1(R, Q.key))).join(",")).join(`\r
|
|
712
712
|
`), S = new Blob([`\uFEFF${D}`], { type: "text/csv;charset=utf-8" }), a1 = URL.createObjectURL(S), u1 = document.createElement("a");
|
|
713
713
|
u1.href = a1, u1.download = o.downloadFilename || "spreadsheet.csv", u1.click(), URL.revokeObjectURL(a1);
|
|
714
714
|
}
|
|
@@ -761,8 +761,8 @@ const O3 = {
|
|
|
761
761
|
if (!b.value) return o.rows;
|
|
762
762
|
const C = o.rows.filter((a1) => a1.sortable !== !1), D = V.value === "asc" ? 1 : -1;
|
|
763
763
|
C.sort((a1, u1) => {
|
|
764
|
-
const R = n1(r1(a1, b.value)),
|
|
765
|
-
return typeof R == "number" && typeof
|
|
764
|
+
const R = n1(r1(a1, b.value)), Q = n1(r1(u1, b.value));
|
|
765
|
+
return typeof R == "number" && typeof Q == "number" ? (R - Q) * D : String(R).localeCompare(String(Q), void 0, { numeric: !0 }) * D;
|
|
766
766
|
});
|
|
767
767
|
let S = 0;
|
|
768
768
|
return o.rows.map((a1) => a1.sortable === !1 ? a1 : C[S++]);
|
|
@@ -796,12 +796,12 @@ const O3 = {
|
|
|
796
796
|
function e1(C, D) {
|
|
797
797
|
!D.editable || L.value || (H.value = { rowKey: C.key, cellKey: D.key }, x.value = null);
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function q(C, D) {
|
|
800
800
|
return H.value?.rowKey === C.key && H.value?.cellKey === D.key;
|
|
801
801
|
}
|
|
802
802
|
function x1(C, D, S) {
|
|
803
803
|
const a1 = U.value[C];
|
|
804
|
-
!o.fillHandle || !S.editable || !a1 || !
|
|
804
|
+
!o.fillHandle || !S.editable || !a1 || !q(a1, S) || (x.value = null, L.value = { row: C, cell: D, value: String(S.value ?? "") }, B.value = { row: C, cell: D }, window.addEventListener("pointerup", A, { once: !0 }));
|
|
805
805
|
}
|
|
806
806
|
function z1(C, D) {
|
|
807
807
|
L.value && (B.value = { row: C, cell: D });
|
|
@@ -831,16 +831,16 @@ const O3 = {
|
|
|
831
831
|
}
|
|
832
832
|
function A() {
|
|
833
833
|
if (!L.value || !B.value) return;
|
|
834
|
-
const C = L.value, D = B.value, S = Math.min(C.row, D.row), a1 = Math.max(C.row, D.row), u1 = Math.min(C.cell, D.cell), R = Math.max(C.cell, D.cell),
|
|
834
|
+
const C = L.value, D = B.value, S = Math.min(C.row, D.row), a1 = Math.max(C.row, D.row), u1 = Math.min(C.cell, D.cell), R = Math.max(C.cell, D.cell), Q = /* @__PURE__ */ new Set(), t1 = U.value[C.row], L1 = t1?.cells[C.cell];
|
|
835
835
|
for (let T1 = S; T1 <= a1; T1++) {
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
838
|
-
for (let
|
|
839
|
-
const w2 =
|
|
840
|
-
w2?.editable && (
|
|
836
|
+
const l2 = U.value[T1];
|
|
837
|
+
if (l2)
|
|
838
|
+
for (let n2 = u1; n2 <= R; n2++) {
|
|
839
|
+
const w2 = l2.cells[n2];
|
|
840
|
+
w2?.editable && (Q.add(j(l2, w2)), r("cell-change", { rowKey: l2.key, cellKey: w2.key, value: C.value, row: l2, cell: w2 }));
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
|
-
L.value = null, B.value = null, x.value = t1 && L1 ? { cells:
|
|
843
|
+
L.value = null, B.value = null, x.value = t1 && L1 ? { cells: Q, source: j(t1, L1) } : null;
|
|
844
844
|
}
|
|
845
845
|
function _(C) {
|
|
846
846
|
let D = C + 1, S = "";
|
|
@@ -954,18 +954,18 @@ const O3 = {
|
|
|
954
954
|
a.value ? (e(), t("th", j5, v(a1 + 1), 1)) : u("", !0),
|
|
955
955
|
(e(!0), t(I, null, l1(S.cells, (u1, R) => (e(), t("td", {
|
|
956
956
|
key: u1.key,
|
|
957
|
-
class: g(["w-spreadsheet__cell", [m1(u1), { "w-spreadsheet__cell--sortable": E(u1), "w-spreadsheet__cell--sticky": G(S, R), "w-spreadsheet__cell--sticky-first": p1(S, R), "w-spreadsheet__cell--active":
|
|
957
|
+
class: g(["w-spreadsheet__cell", [m1(u1), { "w-spreadsheet__cell--sortable": E(u1), "w-spreadsheet__cell--sticky": G(S, R), "w-spreadsheet__cell--sticky-first": p1(S, R), "w-spreadsheet__cell--active": q(S, u1) }, J(a1, R), N(S, u1)]]),
|
|
958
958
|
colspan: u1.colspan || 1,
|
|
959
959
|
title: u1.title,
|
|
960
960
|
style: h1(k1(S, R)),
|
|
961
961
|
tabindex: E(u1) ? 0 : void 0,
|
|
962
|
-
onClick: (
|
|
962
|
+
onClick: (Q) => Y(u1),
|
|
963
963
|
onKeydown: [
|
|
964
|
-
d2(b1((
|
|
965
|
-
d2(b1((
|
|
964
|
+
d2(b1((Q) => Y(u1), ["prevent"]), ["enter"]),
|
|
965
|
+
d2(b1((Q) => Y(u1), ["prevent"]), ["space"])
|
|
966
966
|
],
|
|
967
|
-
onPointerenter: (
|
|
968
|
-
onPointerdown: (
|
|
967
|
+
onPointerenter: (Q) => z1(a1, R),
|
|
968
|
+
onPointerdown: (Q) => e1(S, u1)
|
|
969
969
|
}, [
|
|
970
970
|
K(C.$slots, `cell-${u1.key}`, {
|
|
971
971
|
row: S,
|
|
@@ -979,7 +979,7 @@ const O3 = {
|
|
|
979
979
|
value: u1.value ?? "",
|
|
980
980
|
min: u1.min,
|
|
981
981
|
placeholder: u1.placeholder,
|
|
982
|
-
onInput: (
|
|
982
|
+
onInput: (Q) => g1(S, u1, Q)
|
|
983
983
|
}, null, 42, D5),
|
|
984
984
|
u1.inputType === "date" ? (e(), t("button", {
|
|
985
985
|
key: 0,
|
|
@@ -1000,13 +1000,13 @@ const O3 = {
|
|
|
1000
1000
|
class: "w-spreadsheet__sort-icon",
|
|
1001
1001
|
size: 14
|
|
1002
1002
|
})) : u("", !0),
|
|
1003
|
-
n.fillHandle && u1.editable &&
|
|
1003
|
+
n.fillHandle && u1.editable && q(S, u1) ? (e(), t("button", {
|
|
1004
1004
|
key: 1,
|
|
1005
1005
|
type: "button",
|
|
1006
1006
|
class: "w-spreadsheet__fill-handle",
|
|
1007
1007
|
"aria-label": "Fill adjacent cells",
|
|
1008
1008
|
title: "Drag to fill adjacent cells",
|
|
1009
|
-
onPointerdown: b1((
|
|
1009
|
+
onPointerdown: b1((Q) => x1(a1, R, u1), ["stop", "prevent"])
|
|
1010
1010
|
}, null, 40, I5)) : u("", !0)
|
|
1011
1011
|
], 46, E5))), 128))
|
|
1012
1012
|
], 2))), 128))
|
|
@@ -1296,6 +1296,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1296
1296
|
panelScroll: { type: Boolean, default: !0 },
|
|
1297
1297
|
offset: {},
|
|
1298
1298
|
matchAnchorWidth: { type: Boolean },
|
|
1299
|
+
fitAnchorContent: { type: Boolean },
|
|
1299
1300
|
freezePositionOnOpen: { type: Boolean, default: !0 },
|
|
1300
1301
|
flip: { type: Boolean, default: !0 },
|
|
1301
1302
|
autoPlacement: { type: Boolean },
|
|
@@ -1324,11 +1325,11 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1324
1325
|
return H.value || (c.autoPlacement ? j.push(E3({ alignment: "start" })) : c.flip && j.push(b2({ crossAxis: !c.shiftCrossAxis }))), j.push(g2({ padding: c.autoPlacement ? 8 : 4, crossAxis: c.autoPlacement || c.shiftCrossAxis })), j.push(
|
|
1325
1326
|
n0({
|
|
1326
1327
|
padding: 8,
|
|
1327
|
-
apply({ availableHeight: e1, availableWidth:
|
|
1328
|
-
const d1 = Math.max(e1 - 8, 50), J = c.maxHeight ? `min(${c.maxHeight}, ${d1}px)` : `${d1}px`, N = { maxWidth: `${Math.max(
|
|
1328
|
+
apply({ availableHeight: e1, availableWidth: q, rects: x1, elements: z1 }) {
|
|
1329
|
+
const d1 = Math.max(e1 - 8, 50), J = c.maxHeight ? `min(${c.maxHeight}, ${d1}px)` : `${d1}px`, N = { maxWidth: `${Math.max(q, 0)}px`, maxHeight: J, overflowY: c.panelScroll ? "auto" : "hidden" };
|
|
1329
1330
|
if (c.height && (N.height = `min(${c.height}, ${d1}px)`), c.minHeight && (N.minHeight = `min(${c.minHeight}, ${d1}px)`), c.matchAnchorWidth) {
|
|
1330
|
-
const A = `${x1.reference.width}px`;
|
|
1331
|
-
N.width = A, N.minWidth = A;
|
|
1331
|
+
const A = `${Math.min(x1.reference.width, Math.max(q, 0))}px`;
|
|
1332
|
+
N.width = c.fitAnchorContent ? "max-content" : A, N.minWidth = A;
|
|
1332
1333
|
}
|
|
1333
1334
|
Object.assign(z1.floating.style, N);
|
|
1334
1335
|
}
|
|
@@ -1345,10 +1346,10 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1345
1346
|
return j.startsWith("top") ? "bottom" : j.startsWith("bottom") ? "top" : j.startsWith("left") ? "right" : j.startsWith("right") ? "left" : "top";
|
|
1346
1347
|
}), U = (j) => {
|
|
1347
1348
|
if (f.value) return;
|
|
1348
|
-
const e1 = j.target,
|
|
1349
|
-
x1 && x1.contains(e1) || [...F].some((z1) => z1.contains(e1)) ||
|
|
1349
|
+
const e1 = j.target, q = L.value, x1 = B.value;
|
|
1350
|
+
x1 && x1.contains(e1) || [...F].some((z1) => z1.contains(e1)) || q && q.contains(e1) || c.extraPanels?.some((z1) => z1?.contains(e1)) || b("close");
|
|
1350
1351
|
}, E = (j) => {
|
|
1351
|
-
if (f.value || j.key !== "Escape" || !c.open || [...F].some((
|
|
1352
|
+
if (f.value || j.key !== "Escape" || !c.open || [...F].some((q) => q.isConnected && q.style.display !== "none")) return;
|
|
1352
1353
|
j.preventDefault(), j.stopImmediatePropagation(), b("close");
|
|
1353
1354
|
const e1 = L.value;
|
|
1354
1355
|
e1?.matches("button, input, [tabindex]") ? e1.focus() : e1?.querySelector("button, input, [tabindex]")?.focus();
|
|
@@ -1387,7 +1388,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1387
1388
|
title: n.sheetTitle,
|
|
1388
1389
|
"close-label": n.closeLabel,
|
|
1389
1390
|
"no-padding": "",
|
|
1390
|
-
"onUpdate:modelValue": e1[0] || (e1[0] = (
|
|
1391
|
+
"onUpdate:modelValue": e1[0] || (e1[0] = (q) => !q && b("close"))
|
|
1391
1392
|
}, {
|
|
1392
1393
|
default: s1(() => [
|
|
1393
1394
|
K(j.$slots, "default")
|
|
@@ -1452,7 +1453,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1452
1453
|
class: "wpic-chat-loading-card",
|
|
1453
1454
|
role: "status",
|
|
1454
1455
|
"aria-label": "Generating image"
|
|
1455
|
-
}, e6 = ["innerHTML", "onClick"], c6 = ["href", "onClick"], t6 = ["src"], i6 = ["title", "aria-label", "onClick"], l6 = ["title", "aria-label", "onClick"], a6 = ["title", "onClick"], o6 = ["onClick"], s6 = ["title", "onClick"], r6 = { class: "wpic-chat-panel__footer wpic:shrink-0 wpic:bg-white wpic:p-3 wpic:dark:bg-zinc-800" }, p6 = {
|
|
1456
|
+
}, e6 = ["innerHTML", "onClick"], c6 = ["href", "onClick"], t6 = ["src"], i6 = ["title", "aria-label", "aria-pressed", "onClick"], l6 = ["title", "aria-label", "aria-pressed", "onClick"], a6 = ["title", "onClick"], o6 = ["onClick"], s6 = ["title", "onClick"], r6 = { class: "wpic-chat-panel__footer wpic:shrink-0 wpic:bg-white wpic:p-3 wpic:dark:bg-zinc-800" }, p6 = {
|
|
1456
1457
|
key: 0,
|
|
1457
1458
|
class: "wpic:mb-2 wpic:flex wpic:flex-wrap wpic:justify-end wpic:gap-1.5"
|
|
1458
1459
|
}, d6 = ["src", "alt"], w6 = { class: "wpic:max-w-40 wpic:truncate" }, u6 = {
|
|
@@ -1552,7 +1553,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1552
1553
|
if (!p) return [];
|
|
1553
1554
|
const w = p.query;
|
|
1554
1555
|
return c.mentionItems.filter((h) => h.label.toLowerCase().includes(w)).slice(0, 6);
|
|
1555
|
-
}), e1 = M(() => c.showNavigator && L.value),
|
|
1556
|
+
}), e1 = M(() => c.showNavigator && L.value), q = M(() => c.selectedProjectId ?? null), x1 = M(() => c.sessions.filter((p) => !p.projectId)), z1 = M(() => {
|
|
1556
1557
|
const p = /* @__PURE__ */ new Map();
|
|
1557
1558
|
for (const w of c.projects) p.set(w.id, []);
|
|
1558
1559
|
for (const w of c.sessions) {
|
|
@@ -1728,7 +1729,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1728
1729
|
const w = p.metadata && typeof p.metadata == "object" ? p.metadata : {}, h = p.mimeType ?? "", P = typeof w.kind == "string" ? w.kind : "", y = p.displayUrl ?? (typeof w.displayUrl == "string" ? w.displayUrl : null);
|
|
1729
1730
|
return !y || !h.startsWith("image/") && P !== "image" ? null : y;
|
|
1730
1731
|
}
|
|
1731
|
-
function
|
|
1732
|
+
function Q(p) {
|
|
1732
1733
|
if (p.role !== "assistant" || !p.streaming) return !1;
|
|
1733
1734
|
const w = p.content.trim();
|
|
1734
1735
|
return w === "Generating image..." || S(w);
|
|
@@ -1748,7 +1749,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1748
1749
|
const w = g1(p.content), h = _(p.content), P = m1(p.content);
|
|
1749
1750
|
return !w && !h && !P ? null : { prompt: w, taskType: P, settings: h };
|
|
1750
1751
|
}
|
|
1751
|
-
const
|
|
1752
|
+
const l2 = M(() => {
|
|
1752
1753
|
if (c.maximized) {
|
|
1753
1754
|
const h = Math.max(8, c.maximizedMargin);
|
|
1754
1755
|
return {
|
|
@@ -1789,7 +1790,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1789
1790
|
zIndex: c.zIndex
|
|
1790
1791
|
};
|
|
1791
1792
|
});
|
|
1792
|
-
function
|
|
1793
|
+
function n2(p, w) {
|
|
1793
1794
|
return p.id ?? `${p.role}-${w}`;
|
|
1794
1795
|
}
|
|
1795
1796
|
function w2(p) {
|
|
@@ -1895,10 +1896,10 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1895
1896
|
for (const M1 of W)
|
|
1896
1897
|
f1 = f1.replace(O1(M1.label), a2(M1.label, "setting", "model", M1.value));
|
|
1897
1898
|
if (!y?.settings) return f1;
|
|
1898
|
-
const y1 = (M1, D1,
|
|
1899
|
-
if (
|
|
1899
|
+
const y1 = (M1, D1, e2) => {
|
|
1900
|
+
if (e2 == null) return;
|
|
1900
1901
|
const q1 = p.match(M1);
|
|
1901
|
-
q1?.[1] && (f1 = f1.replace(O1(q1[1]), a2(q1[1], "setting", D1,
|
|
1902
|
+
q1?.[1] && (f1 = f1.replace(O1(q1[1]), a2(q1[1], "setting", D1, e2)));
|
|
1902
1903
|
};
|
|
1903
1904
|
if ((w1.includes("format") || w1.includes("aspect") || w1.includes("ratio")) && y1(/\b(\d{1,2}:\d{1,2})\b/, "aspect", y.settings.aspect), (w1.includes("résolution") || w1.includes("resolution")) && y1(/\b([1248]K)\b/i, "resolution", y.settings.resolution), (w1.includes("durée") || w1.includes("duration")) && y1(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i, "duration", y.settings.duration), w1.includes("fps") && y1(/\b(\d{1,3})\s*fps\b/i, "fps", y.settings.fps), y.settings.format) {
|
|
1904
1905
|
const M1 = p.match(/\b(jpe?g|png|webp)\b/i)?.[1];
|
|
@@ -1935,7 +1936,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1935
1936
|
}, D1 = () => {
|
|
1936
1937
|
W && (y.push(`<pre><code>${O1(i1.join(`
|
|
1937
1938
|
`))}</code></pre>`), i1 = [], W = !1);
|
|
1938
|
-
},
|
|
1939
|
+
}, e2 = (V1) => {
|
|
1939
1940
|
const P1 = V1.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((F1) => F1.trim());
|
|
1940
1941
|
return P1.length > 1 && P1.every((F1) => /^:?-{3,}:?$/.test(F1));
|
|
1941
1942
|
}, q1 = (V1) => V1.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((P1) => P1.trim());
|
|
@@ -1960,7 +1961,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
1960
1961
|
M1(), y1();
|
|
1961
1962
|
continue;
|
|
1962
1963
|
}
|
|
1963
|
-
if (!f1 && F1.includes("|") && P[V1 + 1] &&
|
|
1964
|
+
if (!f1 && F1.includes("|") && P[V1 + 1] && e2(P[V1 + 1])) {
|
|
1964
1965
|
y1();
|
|
1965
1966
|
const J1 = q1(F1);
|
|
1966
1967
|
y.push('<div class="wpic-chat-table-wrap"><table><thead><tr>'), y.push(J1.map((Y2) => `<th>${L2(Y2, p)}</th>`).join("")), y.push("</tr></thead><tbody>"), f1 = !0, V1 += 1;
|
|
@@ -2045,7 +2046,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2045
2046
|
function r0(p, w) {
|
|
2046
2047
|
o("move-session", p, w), o2();
|
|
2047
2048
|
}
|
|
2048
|
-
function p0(p =
|
|
2049
|
+
function p0(p = q.value) {
|
|
2049
2050
|
o("new-conversation", p), L.value = !1, o2(), H1(() => a.value?.focus());
|
|
2050
2051
|
}
|
|
2051
2052
|
function Z2(p) {
|
|
@@ -2220,9 +2221,9 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2220
2221
|
if (!h) return;
|
|
2221
2222
|
O.value = !0;
|
|
2222
2223
|
const P = p.clientX, y = p.clientY, W = h.width, i1 = h.height, w1 = h.left, f1 = h.top, y1 = (D1) => {
|
|
2223
|
-
const
|
|
2224
|
+
const e2 = D1.clientX - P, q1 = D1.clientY - y;
|
|
2224
2225
|
let s2 = W, Q1 = i1, V1 = w1, P1 = f1;
|
|
2225
|
-
w.includes("e") && (s2 = Math.max(c.minWidth, W +
|
|
2226
|
+
w.includes("e") && (s2 = Math.max(c.minWidth, W + e2)), w.includes("s") && (Q1 = Math.max(c.minHeight, i1 + q1)), w.includes("w") && (s2 = Math.max(c.minWidth, W - e2), V1 = w1 + (W - s2)), w.includes("n") && (Q1 = Math.max(c.minHeight, i1 - q1), P1 = Math.max(c.topOffset, f1 + (i1 - Q1))), o("update:width", Math.min(s2, window.innerWidth)), o("update:height", Math.min(Q1, window.innerHeight - c.topOffset)), c.docked || (o("update:x", Math.max(0, V1)), o("update:y", Math.max(c.topOffset, P1)));
|
|
2226
2227
|
}, M1 = () => {
|
|
2227
2228
|
O.value = !1, document.removeEventListener("mousemove", y1), document.removeEventListener("mouseup", M1);
|
|
2228
2229
|
};
|
|
@@ -2246,7 +2247,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2246
2247
|
}), K1(() => {
|
|
2247
2248
|
x && window.clearTimeout(x), u2(), document.removeEventListener("pointerdown", s0, !0);
|
|
2248
2249
|
}), (p, w) => (e(), Z(R1, { to: "body" }, [
|
|
2249
|
-
$(
|
|
2250
|
+
$(c2, {
|
|
2250
2251
|
"enter-active-class": "wpic:transition-opacity wpic:duration-150",
|
|
2251
2252
|
"enter-from-class": "wpic:opacity-0",
|
|
2252
2253
|
"enter-to-class": "wpic:opacity-100",
|
|
@@ -2261,7 +2262,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2261
2262
|
]),
|
|
2262
2263
|
_: 1
|
|
2263
2264
|
}),
|
|
2264
|
-
$(
|
|
2265
|
+
$(c2, {
|
|
2265
2266
|
"enter-active-class": "wpic:transition wpic:duration-150 wpic:ease-out",
|
|
2266
2267
|
"enter-from-class": "wpic:opacity-0 wpic:translate-y-2",
|
|
2267
2268
|
"enter-to-class": "wpic:opacity-100 wpic:translate-y-0",
|
|
@@ -2278,7 +2279,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2278
2279
|
"data-variant": n.variant,
|
|
2279
2280
|
"data-maximized": n.maximized,
|
|
2280
2281
|
"data-docked": n.docked,
|
|
2281
|
-
style: h1(
|
|
2282
|
+
style: h1(l2.value),
|
|
2282
2283
|
"aria-label": "Chat"
|
|
2283
2284
|
}, [
|
|
2284
2285
|
i("div", {
|
|
@@ -2641,7 +2642,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2641
2642
|
i("p", N4, v(n.thinkingLabel), 1)
|
|
2642
2643
|
])) : Y.value.length ? (e(), t("div", q4, [
|
|
2643
2644
|
(e(!0), t(I, null, l1(Y.value, (h, P) => (e(), t("article", {
|
|
2644
|
-
key:
|
|
2645
|
+
key: n2(h, P),
|
|
2645
2646
|
class: g(["wpic:group wpic:flex", h.role === "user" ? "wpic:justify-end" : "wpic:justify-start"])
|
|
2646
2647
|
}, [
|
|
2647
2648
|
i("div", Q4, [
|
|
@@ -2683,7 +2684,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2683
2684
|
class: "wpic:animate-spin"
|
|
2684
2685
|
}),
|
|
2685
2686
|
i("span", null, v(n.thinkingLabel), 1)
|
|
2686
|
-
])) :
|
|
2687
|
+
])) : Q(h) ? (e(), t("div", n6, [...w[30] || (w[30] = [
|
|
2687
2688
|
i("span", { class: "wpic-chat-loading-card__label" }, "Generating image...", -1)
|
|
2688
2689
|
])])) : (e(), t("div", {
|
|
2689
2690
|
key: 2,
|
|
@@ -2715,18 +2716,20 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2715
2716
|
h.role === "assistant" && !h.streaming ? (e(), t(I, { key: 0 }, [
|
|
2716
2717
|
i("button", {
|
|
2717
2718
|
type: "button",
|
|
2718
|
-
class: g(["wpic:flex wpic:h-7 wpic:w-7 wpic:items-center wpic:justify-center wpic:rounded-md wpic:
|
|
2719
|
+
class: g(["wpic:flex wpic:h-7 wpic:w-7 wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition wpic:hover:bg-zinc-100 wpic:hover:text-emerald-600 wpic:dark:hover:bg-zinc-700 wpic:dark:hover:text-emerald-400", h.metadata?.feedbackRating === 1 ? "wpic:text-emerald-600 wpic:dark:text-emerald-400" : "wpic:text-zinc-400"]),
|
|
2719
2720
|
title: n.helpfulLabel,
|
|
2720
2721
|
"aria-label": n.helpfulLabel,
|
|
2722
|
+
"aria-pressed": h.metadata?.feedbackRating === 1,
|
|
2721
2723
|
onClick: (y) => o("message-feedback", h, 1)
|
|
2722
2724
|
}, [
|
|
2723
2725
|
$(m(C3), { size: 14 })
|
|
2724
2726
|
], 10, i6),
|
|
2725
2727
|
i("button", {
|
|
2726
2728
|
type: "button",
|
|
2727
|
-
class: g(["wpic:flex wpic:h-7 wpic:w-7 wpic:items-center wpic:justify-center wpic:rounded-md wpic:
|
|
2729
|
+
class: g(["wpic:flex wpic:h-7 wpic:w-7 wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition wpic:hover:bg-zinc-100 wpic:hover:text-rose-500 wpic:dark:hover:bg-zinc-700 wpic:dark:hover:text-rose-400", h.metadata?.feedbackRating === -1 ? "wpic:text-rose-500 wpic:dark:text-rose-400" : "wpic:text-zinc-400"]),
|
|
2728
2730
|
title: n.notHelpfulLabel,
|
|
2729
2731
|
"aria-label": n.notHelpfulLabel,
|
|
2732
|
+
"aria-pressed": h.metadata?.feedbackRating === -1,
|
|
2730
2733
|
onClick: (y) => o("message-feedback", h, -1)
|
|
2731
2734
|
}, [
|
|
2732
2735
|
$(m(k3), { size: 14 })
|
|
@@ -2735,10 +2738,10 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
2735
2738
|
i("button", {
|
|
2736
2739
|
type: "button",
|
|
2737
2740
|
class: "wpic:flex wpic:h-7 wpic:w-7 wpic:items-center wpic:justify-center wpic:rounded-md wpic:text-zinc-400 wpic:transition wpic:hover:bg-zinc-100 wpic:hover:text-zinc-700 wpic:dark:hover:bg-zinc-700 wpic:dark:hover:text-zinc-100",
|
|
2738
|
-
title: n.copyLabel,
|
|
2739
|
-
onClick: (y) => _0(h.content,
|
|
2741
|
+
title: V.value === n2(h, P) ? n.copiedLabel : n.copyLabel,
|
|
2742
|
+
onClick: (y) => _0(h.content, n2(h, P))
|
|
2740
2743
|
}, [
|
|
2741
|
-
(e(), Z(S1(V.value ===
|
|
2744
|
+
(e(), Z(S1(V.value === n2(h, P) ? m(_1) : m(x3)), { size: 14 }))
|
|
2742
2745
|
], 8, a6),
|
|
2743
2746
|
h.role === "user" ? (e(), t("button", {
|
|
2744
2747
|
key: 1,
|
|
@@ -3149,7 +3152,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
3149
3152
|
const G = c.allLabel ?? c.placeholder ?? "All";
|
|
3150
3153
|
if (z === E) return `${G} · ${E}`;
|
|
3151
3154
|
const p1 = c.maxLabels ?? 3, k1 = Y.map((j) => {
|
|
3152
|
-
const e1 = L.value.find((
|
|
3155
|
+
const e1 = L.value.find((q) => String(q.value) === String(j));
|
|
3153
3156
|
return e1 ? e1.label : null;
|
|
3154
3157
|
}).filter(Boolean);
|
|
3155
3158
|
return k1.length ? z <= p1 ? k1.join(", ") : `${k1.slice(0, p1).join(", ")} · ${z}` : c.placeholder ? `${c.placeholder} · ${z}` : `${z} selected`;
|
|
@@ -3226,6 +3229,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
3226
3229
|
open: a.value,
|
|
3227
3230
|
anchor: f.value,
|
|
3228
3231
|
"match-anchor-width": !n.popoverWidth,
|
|
3232
|
+
"fit-anchor-content": !n.popoverWidth,
|
|
3229
3233
|
width: n.popoverWidth,
|
|
3230
3234
|
placement: n.popoverPlacement,
|
|
3231
3235
|
flip: n.popoverFlip,
|
|
@@ -3341,7 +3345,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
3341
3345
|
])
|
|
3342
3346
|
]),
|
|
3343
3347
|
_: 3
|
|
3344
|
-
}, 8, ["sheet-title", "close-label", "open", "anchor", "match-anchor-width", "width", "placement", "flip", "auto-placement", "min-height", "z-index", "max-height"])
|
|
3348
|
+
}, 8, ["sheet-title", "close-label", "open", "anchor", "match-anchor-width", "fit-anchor-content", "width", "placement", "flip", "auto-placement", "min-height", "z-index", "max-height"])
|
|
3345
3349
|
], 4));
|
|
3346
3350
|
}
|
|
3347
3351
|
}), Y6 = { class: "wpic:font-normal wpic:text-zinc-400 wpic:dark:text-zinc-500" }, ll = /* @__PURE__ */ X({
|
|
@@ -3358,7 +3362,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
3358
3362
|
}
|
|
3359
3363
|
}), q6 = ["min", "max", "step", "disabled"], al = /* @__PURE__ */ X({
|
|
3360
3364
|
__name: "WSlider",
|
|
3361
|
-
props: /* @__PURE__ */
|
|
3365
|
+
props: /* @__PURE__ */ i2({
|
|
3362
3366
|
min: { default: 0 },
|
|
3363
3367
|
max: { default: 100 },
|
|
3364
3368
|
step: { default: 1 },
|
|
@@ -3370,7 +3374,7 @@ const G5 = ["data-wpic-theme"], N1 = /* @__PURE__ */ X({
|
|
|
3370
3374
|
}),
|
|
3371
3375
|
emits: ["update:modelValue"],
|
|
3372
3376
|
setup(n) {
|
|
3373
|
-
const d =
|
|
3377
|
+
const d = t2(n, "modelValue"), c = n, o = M(() => {
|
|
3374
3378
|
const l = c.max - c.min;
|
|
3375
3379
|
return l <= 0 ? 0 : Math.max(0, Math.min(100, (Number(d.value ?? c.min) - c.min) / l * 100));
|
|
3376
3380
|
}), r = M(() => c.min < 0 && c.max > 0);
|
|
@@ -3826,7 +3830,7 @@ const _6 = {
|
|
|
3826
3830
|
}
|
|
3827
3831
|
}), W9 = ["aria-checked", "aria-label", "aria-labelledby", "disabled"], pl = /* @__PURE__ */ X({
|
|
3828
3832
|
__name: "WToggle",
|
|
3829
|
-
props: /* @__PURE__ */
|
|
3833
|
+
props: /* @__PURE__ */ i2({
|
|
3830
3834
|
disabled: { type: Boolean },
|
|
3831
3835
|
ariaLabel: {}
|
|
3832
3836
|
}, {
|
|
@@ -3835,7 +3839,7 @@ const _6 = {
|
|
|
3835
3839
|
}),
|
|
3836
3840
|
emits: ["update:modelValue"],
|
|
3837
3841
|
setup(n) {
|
|
3838
|
-
const d =
|
|
3842
|
+
const d = t2(n, "modelValue"), c = `wpic-toggle-${G2()?.uid}`;
|
|
3839
3843
|
return (o, r) => (e(), t("div", {
|
|
3840
3844
|
class: g(["wpic-toggle wpic:flex wpic:items-center wpic:gap-3", n.disabled ? "wpic:cursor-not-allowed" : "wpic:cursor-pointer"])
|
|
3841
3845
|
}, [
|
|
@@ -4290,7 +4294,7 @@ function L7(n, d) {
|
|
|
4290
4294
|
}
|
|
4291
4295
|
const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"], gl = /* @__PURE__ */ X({
|
|
4292
4296
|
__name: "FormTextarea",
|
|
4293
|
-
props: /* @__PURE__ */
|
|
4297
|
+
props: /* @__PURE__ */ i2({
|
|
4294
4298
|
placeholder: {},
|
|
4295
4299
|
rows: {},
|
|
4296
4300
|
error: { type: Boolean }
|
|
@@ -4300,7 +4304,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4300
4304
|
}),
|
|
4301
4305
|
emits: ["update:modelValue"],
|
|
4302
4306
|
setup(n) {
|
|
4303
|
-
const d =
|
|
4307
|
+
const d = t2(n, "modelValue");
|
|
4304
4308
|
return (c, o) => j1((e(), t("textarea", G1({
|
|
4305
4309
|
"onUpdate:modelValue": o[0] || (o[0] = (r) => d.value = r),
|
|
4306
4310
|
placeholder: n.placeholder ?? "",
|
|
@@ -4316,7 +4320,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4316
4320
|
}
|
|
4317
4321
|
}), $7 = ["type", "placeholder"], zl = /* @__PURE__ */ X({
|
|
4318
4322
|
__name: "FormInput",
|
|
4319
|
-
props: /* @__PURE__ */
|
|
4323
|
+
props: /* @__PURE__ */ i2({
|
|
4320
4324
|
placeholder: {},
|
|
4321
4325
|
type: {},
|
|
4322
4326
|
error: { type: Boolean }
|
|
@@ -4326,7 +4330,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4326
4330
|
}),
|
|
4327
4331
|
emits: ["update:modelValue"],
|
|
4328
4332
|
setup(n) {
|
|
4329
|
-
const d =
|
|
4333
|
+
const d = t2(n, "modelValue");
|
|
4330
4334
|
return (c, o) => j1((e(), t("input", G1({
|
|
4331
4335
|
"onUpdate:modelValue": o[0] || (o[0] = (r) => d.value = r),
|
|
4332
4336
|
type: n.type ?? "text",
|
|
@@ -4346,7 +4350,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4346
4350
|
disabled: ""
|
|
4347
4351
|
}, S7 = ["value"], Cl = /* @__PURE__ */ X({
|
|
4348
4352
|
__name: "FormSelect",
|
|
4349
|
-
props: /* @__PURE__ */
|
|
4353
|
+
props: /* @__PURE__ */ i2({
|
|
4350
4354
|
options: {},
|
|
4351
4355
|
placeholder: {},
|
|
4352
4356
|
error: { type: Boolean }
|
|
@@ -4356,7 +4360,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4356
4360
|
}),
|
|
4357
4361
|
emits: ["update:modelValue"],
|
|
4358
4362
|
setup(n) {
|
|
4359
|
-
const d =
|
|
4363
|
+
const d = t2(n, "modelValue");
|
|
4360
4364
|
return (c, o) => j1((e(), t("select", G1({
|
|
4361
4365
|
"onUpdate:modelValue": o[0] || (o[0] = (r) => d.value = r)
|
|
4362
4366
|
}, c.$attrs, {
|
|
@@ -4437,7 +4441,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4437
4441
|
o("update:modelValue", { start: _, end: m1 }), H.value = null, l.value = !1;
|
|
4438
4442
|
}, e1 = (N) => {
|
|
4439
4443
|
N.stopPropagation(), o("update:modelValue", null), H.value = null;
|
|
4440
|
-
},
|
|
4444
|
+
}, q = () => {
|
|
4441
4445
|
F.value === 0 ? (F.value = 11, s.value--) : F.value--;
|
|
4442
4446
|
}, x1 = () => {
|
|
4443
4447
|
F.value === 11 ? (F.value = 0, s.value++) : F.value++;
|
|
@@ -4498,7 +4502,7 @@ const bl = /* @__PURE__ */ U1(y7, [["render", L7]]), V7 = ["placeholder", "rows"
|
|
|
4498
4502
|
i("div", P7, [
|
|
4499
4503
|
i("div", T7, [
|
|
4500
4504
|
i("button", {
|
|
4501
|
-
onClick:
|
|
4505
|
+
onClick: q,
|
|
4502
4506
|
type: "button",
|
|
4503
4507
|
class: "wpic:p-1 wpic:rounded wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:hover:text-zinc-900 wpic:dark:hover:text-zinc-100 wpic:transition wpic:cursor-pointer"
|
|
4504
4508
|
}, [
|
|
@@ -4834,7 +4838,7 @@ const Ml = /* @__PURE__ */ U1(e8, [["render", c8]]), Ll = /* @__PURE__ */ X({
|
|
|
4834
4838
|
to: "body",
|
|
4835
4839
|
class: "wpic-slide-panel"
|
|
4836
4840
|
}, [
|
|
4837
|
-
$(
|
|
4841
|
+
$(c2, { name: "wp-backdrop" }, {
|
|
4838
4842
|
default: s1(() => [
|
|
4839
4843
|
n.modelValue ? (e(), t("div", {
|
|
4840
4844
|
key: 0,
|
|
@@ -4845,7 +4849,7 @@ const Ml = /* @__PURE__ */ U1(e8, [["render", c8]]), Ll = /* @__PURE__ */ X({
|
|
|
4845
4849
|
]),
|
|
4846
4850
|
_: 1
|
|
4847
4851
|
}),
|
|
4848
|
-
$(
|
|
4852
|
+
$(c2, { name: "wp-panel" }, {
|
|
4849
4853
|
default: s1(() => [
|
|
4850
4854
|
n.modelValue ? (e(), t("div", {
|
|
4851
4855
|
key: 0,
|
|
@@ -4941,19 +4945,19 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
4941
4945
|
emits: ["update:modelValue", "update:simpleValue"],
|
|
4942
4946
|
setup(n, { emit: d }) {
|
|
4943
4947
|
const c = n, o = d, r = M(() => c.simpleValue ?? []), l = T(""), a = T(!1), f = M(() => {
|
|
4944
|
-
const R = l.value.trim().toLowerCase(),
|
|
4945
|
-
return R ? t1.filter((L1) => L1.toLowerCase().includes(R) && !
|
|
4948
|
+
const R = l.value.trim().toLowerCase(), Q = new Set(r.value), t1 = c.options ?? [];
|
|
4949
|
+
return R ? t1.filter((L1) => L1.toLowerCase().includes(R) && !Q.has(L1)) : t1.filter((L1) => !Q.has(L1)).slice(0, 8);
|
|
4946
4950
|
}), b = M(() => {
|
|
4947
4951
|
if (!c.creatable || !l.value.trim()) return !1;
|
|
4948
4952
|
const R = l.value.trim();
|
|
4949
|
-
return !r.value.includes(R) && !(c.options ?? []).some((
|
|
4953
|
+
return !r.value.includes(R) && !(c.options ?? []).some((Q) => Q.toLowerCase() === R.toLowerCase());
|
|
4950
4954
|
});
|
|
4951
4955
|
function V(R) {
|
|
4952
|
-
const
|
|
4953
|
-
!
|
|
4956
|
+
const Q = R.trim();
|
|
4957
|
+
!Q || r.value.includes(Q) || (o("update:simpleValue", [...r.value, Q]), l.value = "", a.value = !1);
|
|
4954
4958
|
}
|
|
4955
4959
|
function s(R) {
|
|
4956
|
-
o("update:simpleValue", r.value.filter((
|
|
4960
|
+
o("update:simpleValue", r.value.filter((Q) => Q !== R));
|
|
4957
4961
|
}
|
|
4958
4962
|
function F(R) {
|
|
4959
4963
|
R.key === "Enter" && (R.preventDefault(), l.value.trim() && V(l.value)), R.key === "Escape" && (a.value = !1), R.key === "Backspace" && !l.value && r.value.length && s(r.value[r.value.length - 1]);
|
|
@@ -4971,8 +4975,8 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
4971
4975
|
f2(4),
|
|
4972
4976
|
b2({ padding: 8 }),
|
|
4973
4977
|
g2({ padding: 8 }),
|
|
4974
|
-
n0({ padding: 8, apply({ availableHeight: R, elements:
|
|
4975
|
-
Object.assign(
|
|
4978
|
+
n0({ padding: 8, apply({ availableHeight: R, elements: Q }) {
|
|
4979
|
+
Object.assign(Q.floating.style, { maxHeight: `${Math.min(240, R)}px` });
|
|
4976
4980
|
} })
|
|
4977
4981
|
],
|
|
4978
4982
|
whileElementsMounted: C2
|
|
@@ -4982,21 +4986,21 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
4982
4986
|
function e1(R) {
|
|
4983
4987
|
return R.translations?.[c.locale]?.value || R.translations?.en?.value || R.slug;
|
|
4984
4988
|
}
|
|
4985
|
-
function
|
|
4986
|
-
return (c.modelValue ?? []).some((
|
|
4989
|
+
function q(R) {
|
|
4990
|
+
return (c.modelValue ?? []).some((Q) => Q.tag_id === R.tag_id);
|
|
4987
4991
|
}
|
|
4988
4992
|
function x1(R) {
|
|
4989
|
-
const
|
|
4990
|
-
if (!
|
|
4993
|
+
const Q = B.value.trim().toLowerCase();
|
|
4994
|
+
if (!Q) return null;
|
|
4991
4995
|
const t1 = e1(R).toLowerCase();
|
|
4992
4996
|
for (const [L1, T1] of Object.entries(R.translations ?? {}))
|
|
4993
|
-
if (T1?.value && T1.value.toLowerCase().includes(
|
|
4997
|
+
if (T1?.value && T1.value.toLowerCase().includes(Q) && T1.value.toLowerCase() !== t1)
|
|
4994
4998
|
return { locale: L1.toUpperCase(), value: T1.value };
|
|
4995
4999
|
return null;
|
|
4996
5000
|
}
|
|
4997
5001
|
const z1 = M(() => B.value.trim() ? E.value : G().map(
|
|
4998
|
-
(
|
|
4999
|
-
).filter((
|
|
5002
|
+
(Q) => (c.modelValue ?? []).find((t1) => t1.tag_id === Q) || E.value.find((t1) => t1.tag_id === Q)
|
|
5003
|
+
).filter((Q) => !!Q).filter((Q) => !q(Q))), d1 = M(() => B.value.trim() ? null : c.labelRecent), J = () => {
|
|
5000
5004
|
U.value = !0;
|
|
5001
5005
|
}, N = () => {
|
|
5002
5006
|
setTimeout(() => {
|
|
@@ -5029,14 +5033,14 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5029
5033
|
R.key === "Enter" && (z && clearTimeout(z), B1()), R.key === "Escape" && (D(), U.value = !1);
|
|
5030
5034
|
}
|
|
5031
5035
|
async function g1(R) {
|
|
5032
|
-
if (
|
|
5036
|
+
if (q(R)) return;
|
|
5033
5037
|
H.value = "confirming", U.value = !1;
|
|
5034
|
-
const
|
|
5035
|
-
o("update:modelValue", [...
|
|
5038
|
+
const Q = c.modelValue ?? [];
|
|
5039
|
+
o("update:modelValue", [...Q, R]), p1(R.tag_id), B.value = "";
|
|
5036
5040
|
try {
|
|
5037
5041
|
await c.mutateFn?.("add", R);
|
|
5038
5042
|
} catch {
|
|
5039
|
-
o("update:modelValue",
|
|
5043
|
+
o("update:modelValue", Q), k.value = c.labelErrorAdding;
|
|
5040
5044
|
} finally {
|
|
5041
5045
|
H.value = "idle";
|
|
5042
5046
|
}
|
|
@@ -5044,18 +5048,18 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5044
5048
|
async function B1() {
|
|
5045
5049
|
const R = B.value.trim();
|
|
5046
5050
|
if (!R) return;
|
|
5047
|
-
const
|
|
5051
|
+
const Q = E.value.find(
|
|
5048
5052
|
(t1) => Object.values(t1.translations ?? {}).some((L1) => L1.value?.toLowerCase() === R.toLowerCase()) || t1.slug === R.toLowerCase()
|
|
5049
5053
|
);
|
|
5050
|
-
if (
|
|
5051
|
-
g1(
|
|
5054
|
+
if (Q) {
|
|
5055
|
+
g1(Q);
|
|
5052
5056
|
return;
|
|
5053
5057
|
}
|
|
5054
5058
|
if (c.resolveFn) {
|
|
5055
5059
|
H.value = "resolving", U.value = !1, k.value = null;
|
|
5056
5060
|
try {
|
|
5057
5061
|
const t1 = await c.resolveFn(R, c.locale);
|
|
5058
|
-
if (x.value = t1, t1.existed && !
|
|
5062
|
+
if (x.value = t1, t1.existed && !q(t1)) {
|
|
5059
5063
|
await g1(t1), x.value = null;
|
|
5060
5064
|
return;
|
|
5061
5065
|
}
|
|
@@ -5068,34 +5072,34 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5068
5072
|
async function C() {
|
|
5069
5073
|
if (!x.value) return;
|
|
5070
5074
|
H.value = "confirming";
|
|
5071
|
-
const R = x.value,
|
|
5072
|
-
o("update:modelValue", [...
|
|
5075
|
+
const R = x.value, Q = c.modelValue ?? [];
|
|
5076
|
+
o("update:modelValue", [...Q, R]), p1(R.tag_id);
|
|
5073
5077
|
try {
|
|
5074
5078
|
await c.mutateFn?.("add", R), D();
|
|
5075
5079
|
} catch {
|
|
5076
|
-
o("update:modelValue",
|
|
5080
|
+
o("update:modelValue", Q), k.value = c.labelErrorAdding, H.value = "preview";
|
|
5077
5081
|
}
|
|
5078
5082
|
}
|
|
5079
5083
|
function D() {
|
|
5080
5084
|
x.value = null, B.value = "", k.value = null, H.value = "idle", O.value = null, E.value = [];
|
|
5081
5085
|
}
|
|
5082
5086
|
async function S(R) {
|
|
5083
|
-
const
|
|
5084
|
-
o("update:modelValue",
|
|
5087
|
+
const Q = c.modelValue ?? [];
|
|
5088
|
+
o("update:modelValue", Q.filter((t1) => t1.tag_id !== R.tag_id));
|
|
5085
5089
|
try {
|
|
5086
5090
|
await c.mutateFn?.("remove", R);
|
|
5087
5091
|
} catch {
|
|
5088
|
-
o("update:modelValue",
|
|
5092
|
+
o("update:modelValue", Q), k.value = c.labelErrorAdding;
|
|
5089
5093
|
}
|
|
5090
5094
|
}
|
|
5091
5095
|
function a1(R) {
|
|
5092
5096
|
O.value = R, c1.value = x.value?.translations?.[R]?.value || "", H1(() => o1.value?.focus());
|
|
5093
5097
|
}
|
|
5094
5098
|
function u1(R) {
|
|
5095
|
-
const
|
|
5096
|
-
|
|
5099
|
+
const Q = c1.value.trim();
|
|
5100
|
+
Q && x.value?.translations?.[R] && (x.value.translations[R].value = Q, x.value.translations[R].source = "human"), O.value = null;
|
|
5097
5101
|
}
|
|
5098
|
-
return (R,
|
|
5102
|
+
return (R, Q) => (e(), t("div", v8, [
|
|
5099
5103
|
n.simple ? (e(), t(I, { key: 0 }, [
|
|
5100
5104
|
r.value.length ? (e(), t("div", f8, [
|
|
5101
5105
|
(e(!0), t(I, null, l1(r.value, (t1) => (e(), Z(h2, {
|
|
@@ -5121,11 +5125,11 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5121
5125
|
])) : u("", !0),
|
|
5122
5126
|
i("div", g8, [
|
|
5123
5127
|
j1(i("input", {
|
|
5124
|
-
"onUpdate:modelValue":
|
|
5128
|
+
"onUpdate:modelValue": Q[0] || (Q[0] = (t1) => l.value = t1),
|
|
5125
5129
|
placeholder: n.placeholder,
|
|
5126
5130
|
class: "wpic:flex-1 wpic:w-full wpic:h-9 wpic:px-2.5 wpic:text-base wpic:rounded-lg wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:bg-white wpic:dark:bg-zinc-900 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic:outline-none wpic:transition wpic-input-field",
|
|
5127
5131
|
onKeydown: F,
|
|
5128
|
-
onFocus:
|
|
5132
|
+
onFocus: Q[1] || (Q[1] = (t1) => a.value = !0),
|
|
5129
5133
|
onBlur: L
|
|
5130
5134
|
}, null, 40, z8), [
|
|
5131
5135
|
[r2, l.value]
|
|
@@ -5147,7 +5151,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5147
5151
|
key: 0,
|
|
5148
5152
|
type: "button",
|
|
5149
5153
|
class: "wpic:flex wpic:w-full wpic:items-center wpic:gap-2 wpic:px-3 wpic:py-2 wpic:text-left wpic:text-sm wpic:text-indigo-600 wpic:hover:bg-indigo-50 wpic:dark:text-indigo-400 wpic:dark:hover:bg-indigo-950/40 wpic:transition-colors wpic:border-t wpic:border-zinc-100 wpic:dark:border-zinc-800",
|
|
5150
|
-
onMousedown:
|
|
5154
|
+
onMousedown: Q[2] || (Q[2] = b1((t1) => V(l.value), ["prevent"]))
|
|
5151
5155
|
}, [
|
|
5152
5156
|
$(m($2), {
|
|
5153
5157
|
size: 12,
|
|
@@ -5187,7 +5191,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5187
5191
|
}, [
|
|
5188
5192
|
i("div", M8, [
|
|
5189
5193
|
j1(i("input", {
|
|
5190
|
-
"onUpdate:modelValue":
|
|
5194
|
+
"onUpdate:modelValue": Q[3] || (Q[3] = (t1) => B.value = t1),
|
|
5191
5195
|
disabled: H.value === "resolving" || H.value === "confirming",
|
|
5192
5196
|
placeholder: n.placeholder,
|
|
5193
5197
|
class: "wpic:flex-1 wpic:h-9 wpic:px-2.5 wpic:text-base wpic:rounded-lg wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:bg-white wpic:dark:bg-zinc-900 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic:outline-none wpic:disabled:opacity-50 wpic:transition wpic-input-field",
|
|
@@ -5218,8 +5222,8 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5218
5222
|
])) : u("", !0),
|
|
5219
5223
|
(e(!0), t(I, null, l1(z1.value, (t1) => (e(), t("button", {
|
|
5220
5224
|
key: t1.tag_id,
|
|
5221
|
-
class: g(["wpic:w-full wpic:text-left wpic:px-3 wpic:py-2 wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5 wpic:cursor-pointer wpic:transition wpic:flex wpic:items-center wpic:gap-2",
|
|
5222
|
-
onMousedown: b1((L1) => !
|
|
5225
|
+
class: g(["wpic:w-full wpic:text-left wpic:px-3 wpic:py-2 wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5 wpic:cursor-pointer wpic:transition wpic:flex wpic:items-center wpic:gap-2", q(t1) ? "wpic:opacity-40 wpic:cursor-default" : "wpic:text-zinc-600 wpic:dark:text-zinc-400"]),
|
|
5226
|
+
onMousedown: b1((L1) => !q(t1) && g1(t1), ["prevent"])
|
|
5223
5227
|
}, [
|
|
5224
5228
|
$(m(T2), {
|
|
5225
5229
|
size: 11,
|
|
@@ -5230,7 +5234,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5230
5234
|
i("span", A8, v(x1(t1).locale), 1),
|
|
5231
5235
|
i("span", F8, v(x1(t1).value), 1)
|
|
5232
5236
|
], 64)) : u("", !0),
|
|
5233
|
-
|
|
5237
|
+
q(t1) ? (e(), Z(h2, {
|
|
5234
5238
|
key: 1,
|
|
5235
5239
|
variant: "default",
|
|
5236
5240
|
class: "wpic:ml-auto wpic:shrink-0"
|
|
@@ -5247,7 +5251,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5247
5251
|
i("div", P8, [
|
|
5248
5252
|
i("div", T8, [
|
|
5249
5253
|
i("span", j8, v(x.value.translations[n.locale]?.value || x.value.translations.en?.value || x.value.slug), 1),
|
|
5250
|
-
|
|
5254
|
+
q(x.value) ? (e(), Z(h2, {
|
|
5251
5255
|
key: 0,
|
|
5252
5256
|
variant: "default"
|
|
5253
5257
|
}, {
|
|
@@ -5286,11 +5290,11 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5286
5290
|
ref_for: !0,
|
|
5287
5291
|
ref_key: "editInputRef",
|
|
5288
5292
|
ref: o1,
|
|
5289
|
-
"onUpdate:modelValue":
|
|
5293
|
+
"onUpdate:modelValue": Q[4] || (Q[4] = (L1) => c1.value = L1),
|
|
5290
5294
|
class: "wpic:flex-1 wpic:h-6 wpic:px-2 wpic:text-sm wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:rounded wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:outline-none wpic:focus:border-gray-400 wpic:dark:focus:border-gray-500",
|
|
5291
5295
|
onKeydown: [
|
|
5292
5296
|
d2((L1) => u1(t1), ["enter"]),
|
|
5293
|
-
|
|
5297
|
+
Q[5] || (Q[5] = d2((L1) => O.value = null, ["escape"]))
|
|
5294
5298
|
]
|
|
5295
5299
|
}, null, 40, D8), [
|
|
5296
5300
|
[r2, c1.value]
|
|
@@ -5303,7 +5307,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5303
5307
|
], 8, I8),
|
|
5304
5308
|
i("button", {
|
|
5305
5309
|
class: "wpic:p-0.5 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:hover:text-gray-900 wpic:dark:hover:text-white wpic:transition",
|
|
5306
|
-
onClick:
|
|
5310
|
+
onClick: Q[6] || (Q[6] = (L1) => O.value = null)
|
|
5307
5311
|
}, [
|
|
5308
5312
|
$(m($1), { size: 12 })
|
|
5309
5313
|
])
|
|
@@ -5332,7 +5336,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5332
5336
|
]),
|
|
5333
5337
|
_: 1
|
|
5334
5338
|
}),
|
|
5335
|
-
|
|
5339
|
+
q(x.value) ? u("", !0) : (e(), Z(k2, {
|
|
5336
5340
|
key: 0,
|
|
5337
5341
|
variant: "primary",
|
|
5338
5342
|
size: "sm",
|
|
@@ -5681,7 +5685,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5681
5685
|
K(x.$slots, "default")
|
|
5682
5686
|
], 16),
|
|
5683
5687
|
(e(), Z(R1, { to: "body" }, [
|
|
5684
|
-
$(
|
|
5688
|
+
$(c2, {
|
|
5685
5689
|
"enter-active-class": "wpic:transition-opacity wpic:duration-150 wpic:ease-out",
|
|
5686
5690
|
"enter-from-class": "wpic:opacity-0",
|
|
5687
5691
|
"enter-to-class": "wpic:opacity-100",
|
|
@@ -5979,7 +5983,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5979
5983
|
class: "wpic:h-1.5 wpic:w-1.5 wpic:rounded-full wpic:bg-current"
|
|
5980
5984
|
}, Fn = { key: 3 }, Hn = /* @__PURE__ */ X({
|
|
5981
5985
|
__name: "WPillGroup",
|
|
5982
|
-
props: /* @__PURE__ */
|
|
5986
|
+
props: /* @__PURE__ */ i2({
|
|
5983
5987
|
options: {},
|
|
5984
5988
|
multiple: { type: Boolean },
|
|
5985
5989
|
size: {},
|
|
@@ -5992,7 +5996,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
5992
5996
|
}),
|
|
5993
5997
|
emits: ["update:modelValue"],
|
|
5994
5998
|
setup(n) {
|
|
5995
|
-
const d = n, c =
|
|
5999
|
+
const d = n, c = t2(n, "modelValue");
|
|
5996
6000
|
function o(f) {
|
|
5997
6001
|
return d.multiple ? Array.isArray(c.value) && c.value.includes(f) : c.value === f;
|
|
5998
6002
|
}
|
|
@@ -7149,7 +7153,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7149
7153
|
return `${j.getFullYear()}-${String(j.getMonth() + 1).padStart(2, "0")}-${String(j.getDate()).padStart(2, "0")}`;
|
|
7150
7154
|
}
|
|
7151
7155
|
function B(j) {
|
|
7152
|
-
const e1 = /* @__PURE__ */ new Date(),
|
|
7156
|
+
const e1 = /* @__PURE__ */ new Date(), q = e1.getFullYear(), x1 = e1.getMonth(), z1 = e1.getDate();
|
|
7153
7157
|
switch (j) {
|
|
7154
7158
|
case "today":
|
|
7155
7159
|
return { since: L(e1), until: L(e1), preset: j };
|
|
@@ -7170,17 +7174,17 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7170
7174
|
return d1.setDate(z1 - 89), { since: L(d1), until: L(e1), preset: j };
|
|
7171
7175
|
}
|
|
7172
7176
|
case "mtd":
|
|
7173
|
-
return { since: `${
|
|
7177
|
+
return { since: `${q}-${String(x1 + 1).padStart(2, "0")}-01`, until: L(e1), preset: j };
|
|
7174
7178
|
case "ytd":
|
|
7175
|
-
return { since: `${
|
|
7179
|
+
return { since: `${q}-01-01`, until: L(e1), preset: j };
|
|
7176
7180
|
default:
|
|
7177
7181
|
return { since: f.value, until: b.value || L(e1), preset: "custom" };
|
|
7178
7182
|
}
|
|
7179
7183
|
}
|
|
7180
7184
|
const H = M(() => {
|
|
7181
7185
|
if (!c.modelValue) return "";
|
|
7182
|
-
const { since: j, until: e1, preset:
|
|
7183
|
-
return
|
|
7186
|
+
const { since: j, until: e1, preset: q } = c.modelValue;
|
|
7187
|
+
return q && q !== "custom" ? c.presets.find((x1) => x1.value === q)?.label ?? "" : j === e1 ? j : `${j} → ${e1}`;
|
|
7184
7188
|
});
|
|
7185
7189
|
function x(j) {
|
|
7186
7190
|
a.value = j, j !== "custom" && (o("update:modelValue", B(j)), r.value = !1);
|
|
@@ -7195,23 +7199,23 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7195
7199
|
s.value = new Date(k.value, O.value + 1, 1);
|
|
7196
7200
|
}
|
|
7197
7201
|
const U = M(() => {
|
|
7198
|
-
const j = new Date(k.value, O.value, 1), e1 = new Date(k.value, O.value + 1, 0),
|
|
7202
|
+
const j = new Date(k.value, O.value, 1), e1 = new Date(k.value, O.value + 1, 0), q = [];
|
|
7199
7203
|
let x1 = j.getDay() === 0 ? 6 : j.getDay() - 1;
|
|
7200
7204
|
for (let d1 = x1 - 1; d1 >= 0; d1--) {
|
|
7201
7205
|
const J = new Date(k.value, O.value, -d1);
|
|
7202
|
-
|
|
7206
|
+
q.push({ date: L(J), day: J.getDate(), inMonth: !1 });
|
|
7203
7207
|
}
|
|
7204
7208
|
for (let d1 = 1; d1 <= e1.getDate(); d1++) {
|
|
7205
7209
|
const J = new Date(k.value, O.value, d1);
|
|
7206
|
-
|
|
7210
|
+
q.push({ date: L(J), day: d1, inMonth: !0 });
|
|
7207
7211
|
}
|
|
7208
|
-
const z1 = 7 -
|
|
7212
|
+
const z1 = 7 - q.length % 7;
|
|
7209
7213
|
if (z1 < 7)
|
|
7210
7214
|
for (let d1 = 1; d1 <= z1; d1++) {
|
|
7211
7215
|
const J = new Date(k.value, O.value + 1, d1);
|
|
7212
|
-
|
|
7216
|
+
q.push({ date: L(J), day: d1, inMonth: !1 });
|
|
7213
7217
|
}
|
|
7214
|
-
return
|
|
7218
|
+
return q;
|
|
7215
7219
|
});
|
|
7216
7220
|
function E(j) {
|
|
7217
7221
|
return j === f.value || j === b.value;
|
|
@@ -7242,7 +7246,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7242
7246
|
ref_key: "referenceEl",
|
|
7243
7247
|
ref: l,
|
|
7244
7248
|
type: "button",
|
|
7245
|
-
onClick: e1[0] || (e1[0] = b1((
|
|
7249
|
+
onClick: e1[0] || (e1[0] = b1((q) => !n.disabled && (r.value = !r.value), ["stop"])),
|
|
7246
7250
|
disabled: n.disabled,
|
|
7247
7251
|
"aria-label": n.ariaLabel,
|
|
7248
7252
|
"aria-expanded": r.value,
|
|
@@ -7281,21 +7285,21 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7281
7285
|
open: r.value,
|
|
7282
7286
|
anchor: l.value,
|
|
7283
7287
|
offset: 4,
|
|
7284
|
-
onClose: e1[1] || (e1[1] = (
|
|
7288
|
+
onClose: e1[1] || (e1[1] = (q) => r.value = !1)
|
|
7285
7289
|
}, {
|
|
7286
7290
|
default: s1(() => [
|
|
7287
7291
|
i("div", me, [
|
|
7288
7292
|
i("div", ve, [
|
|
7289
|
-
(e(!0), t(I, null, l1(n.presets, (
|
|
7290
|
-
key:
|
|
7293
|
+
(e(!0), t(I, null, l1(n.presets, (q) => (e(), t("button", {
|
|
7294
|
+
key: q.value,
|
|
7291
7295
|
class: g(["wpic-range-preset wpic-select-option wpic:rounded-lg", [
|
|
7292
7296
|
"wpic:flex wpic:w-full wpic:items-center wpic:px-4 wpic:py-2 wpic:text-left wpic:text-base wpic:transition-colors wpic:cursor-pointer",
|
|
7293
|
-
a.value ===
|
|
7297
|
+
a.value === q.value ? "wpic:bg-[#85C531]/10 wpic:font-medium wpic:text-[#85C531]" : "wpic:text-zinc-700 wpic:hover:bg-zinc-100 wpic:dark:text-zinc-300 wpic:dark:hover:bg-zinc-700"
|
|
7294
7298
|
]]),
|
|
7295
|
-
"aria-pressed": a.value ===
|
|
7299
|
+
"aria-pressed": a.value === q.value,
|
|
7296
7300
|
type: "button",
|
|
7297
|
-
onClick: (x1) => x(
|
|
7298
|
-
}, v(
|
|
7301
|
+
onClick: (x1) => x(q.value)
|
|
7302
|
+
}, v(q.label), 11, fe))), 128))
|
|
7299
7303
|
]),
|
|
7300
7304
|
a.value === "custom" ? (e(), t("div", be, [
|
|
7301
7305
|
i("div", ge, [
|
|
@@ -7318,29 +7322,29 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7318
7322
|
], 8, ke)
|
|
7319
7323
|
]),
|
|
7320
7324
|
i("div", xe, [
|
|
7321
|
-
(e(!0), t(I, null, l1(o1.value, (
|
|
7322
|
-
key:
|
|
7325
|
+
(e(!0), t(I, null, l1(o1.value, (q) => (e(), t("span", {
|
|
7326
|
+
key: q,
|
|
7323
7327
|
class: "wpic:py-1 wpic:text-xs wpic:font-medium wpic:text-zinc-400"
|
|
7324
|
-
}, v(
|
|
7328
|
+
}, v(q), 1))), 128))
|
|
7325
7329
|
]),
|
|
7326
7330
|
i("div", ye, [
|
|
7327
|
-
(e(!0), t(I, null, l1(U.value, (
|
|
7328
|
-
key:
|
|
7329
|
-
"aria-label":
|
|
7330
|
-
"aria-pressed": E(
|
|
7331
|
-
"data-in-range": Y(
|
|
7332
|
-
"data-today": z(
|
|
7331
|
+
(e(!0), t(I, null, l1(U.value, (q) => (e(), t("button", {
|
|
7332
|
+
key: q.date,
|
|
7333
|
+
"aria-label": q.date,
|
|
7334
|
+
"aria-pressed": E(q.date),
|
|
7335
|
+
"data-in-range": Y(q.date) || void 0,
|
|
7336
|
+
"data-today": z(q.date) || void 0,
|
|
7333
7337
|
type: "button",
|
|
7334
|
-
onClick: (x1) => G(
|
|
7338
|
+
onClick: (x1) => G(q.date),
|
|
7335
7339
|
class: g([
|
|
7336
7340
|
"wpic-calendar-day wpic:relative wpic:flex wpic:h-8 wpic:w-8 wpic:items-center wpic:justify-center wpic:rounded-full wpic:text-sm wpic:transition-colors wpic:cursor-pointer",
|
|
7337
|
-
!
|
|
7338
|
-
|
|
7339
|
-
E(
|
|
7340
|
-
Y(
|
|
7341
|
-
z(
|
|
7341
|
+
!q.inMonth && "wpic:text-zinc-300 wpic:dark:text-zinc-600",
|
|
7342
|
+
q.inMonth && !E(q.date) && !Y(q.date) && "wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700 wpic:text-zinc-900 wpic:dark:text-zinc-100",
|
|
7343
|
+
E(q.date) && "wpic:bg-[#85C531] wpic:text-white wpic:font-semibold",
|
|
7344
|
+
Y(q.date) && "wpic:bg-[#85C531]/15 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:rounded-none",
|
|
7345
|
+
z(q.date) && !E(q.date) && "wpic:ring-1 wpic:ring-[#85C531]"
|
|
7342
7346
|
])
|
|
7343
|
-
}, v(
|
|
7347
|
+
}, v(q.day), 11, Me))), 128))
|
|
7344
7348
|
]),
|
|
7345
7349
|
i("div", Le, [
|
|
7346
7350
|
i("div", Ve, [
|
|
@@ -7477,7 +7481,7 @@ const v8 = { class: "wpic-tag-input" }, f8 = {
|
|
|
7477
7481
|
},
|
|
7478
7482
|
emits: ["close"],
|
|
7479
7483
|
setup(n) {
|
|
7480
|
-
return (d, c) => (e(), Z(
|
|
7484
|
+
return (d, c) => (e(), Z(c2, {
|
|
7481
7485
|
"enter-active-class": "wpic:transition wpic:duration-200 wpic:ease-out",
|
|
7482
7486
|
"enter-from-class": "wpic:opacity-0 wpic:translate-y-4",
|
|
7483
7487
|
"enter-to-class": "wpic:opacity-100 wpic:translate-y-0",
|
|
@@ -18461,7 +18465,7 @@ c36 -78 76 -117 152 -146 53 -20 76 -23 190 -22 137 2 262 27 295 59 10 11 17
|
|
|
18461
18465
|
}
|
|
18462
18466
|
o.showHistory ? j() : m1();
|
|
18463
18467
|
}
|
|
18464
|
-
function
|
|
18468
|
+
function q() {
|
|
18465
18469
|
o1.value = !1, B.value = !1, O.value = !1, H.value = !0;
|
|
18466
18470
|
}
|
|
18467
18471
|
function x1(C) {
|
|
@@ -18547,7 +18551,7 @@ c36 -78 76 -117 152 -146 53 -20 76 -23 190 -22 137 2 262 27 295 59 10 11 17
|
|
|
18547
18551
|
}, [
|
|
18548
18552
|
$(m(M0), { size: 21 })
|
|
18549
18553
|
], 10, wi),
|
|
18550
|
-
$(
|
|
18554
|
+
$(c2, { name: "wpic-composer-content" }, {
|
|
18551
18555
|
default: s1(() => [
|
|
18552
18556
|
!B.value && x.value ? (e(), t("button", {
|
|
18553
18557
|
key: "compact",
|
|
@@ -18603,11 +18607,11 @@ c36 -78 76 -117 152 -146 53 -20 76 -23 190 -22 137 2 262 27 295 59 10 11 17
|
|
|
18603
18607
|
class: g(["wpic:flex wpic:h-10 wpic:w-10 wpic:flex-none wpic:items-center wpic:justify-center wpic:rounded-xl wpic:text-zinc-400 wpic:transition wpic:hover:bg-black/5 wpic:hover:text-zinc-700 wpic:dark:text-zinc-500 wpic:dark:hover:bg-white/10 wpic:dark:hover:text-zinc-200", B.value ? "wpic:absolute wpic:right-3 wpic:top-3" : ""]),
|
|
18604
18608
|
"aria-label": n.minimizeLabel,
|
|
18605
18609
|
title: n.minimizeLabel,
|
|
18606
|
-
onClick:
|
|
18610
|
+
onClick: q
|
|
18607
18611
|
}, [
|
|
18608
18612
|
$(m(j3), { size: 17 })
|
|
18609
18613
|
], 10, bi)) : u("", !0),
|
|
18610
|
-
$(
|
|
18614
|
+
$(c2, { name: "wpic-composer-send" }, {
|
|
18611
18615
|
default: s1(() => [
|
|
18612
18616
|
B.value ? (e(), t("button", {
|
|
18613
18617
|
key: 0,
|