@vokril/ui-solid 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +5 -5
- package/dist/IconPicker-9tjEtmqt.cjs +1 -0
- package/dist/IconPicker-CXbFmJ3y.js +179 -0
- package/dist/_internal/app/icons/iconSetRegistry.d.cts +2 -2
- package/dist/_internal/app/icons/iconSetRegistry.d.ts +2 -2
- package/dist/_internal/app/platform/electronBridge.d.cts +9 -3
- package/dist/_internal/app/platform/electronBridge.d.ts +9 -3
- package/dist/{createResizableSidebar-B22SKv9b.js → createResizableSidebar-2TgiFZp1.js} +11 -12
- package/dist/createResizableSidebar-pDoO-7q9.cjs +1 -0
- package/dist/forms/index.cjs +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +314 -317
- package/dist/layout/PageHeaderIcon.d.cts +1 -1
- package/dist/layout/PageHeaderIcon.d.ts +1 -1
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/navigation/pageHeaderContract.d.cts +1 -1
- package/dist/navigation/pageHeaderContract.d.ts +1 -1
- package/dist/notifications/notificationOverlayChannel.d.cts +3 -3
- package/dist/notifications/notificationOverlayChannel.d.ts +3 -3
- package/dist/server/CommandPalette-39UA8MVn.cjs +1 -0
- package/dist/server/{CommandPalette-4RCiBlmz.js → CommandPalette-DIlbFrNy.js} +76 -78
- package/dist/server/{DateRangePicker-TW0Dy4u6.js → DateRangePicker-QV6U1adB.js} +1 -1
- package/dist/server/{GuidedTour-DvMqeZIU.cjs → GuidedTour-CMLjHh-y.cjs} +9 -9
- package/dist/server/{GuidedTour-Bc7SqDXY.js → GuidedTour-bV_r4vSt.js} +29 -30
- package/dist/server/IconPicker-B4wK1LxJ.js +162 -0
- package/dist/server/IconPicker-DoWUHbst.cjs +1 -0
- package/dist/server/Modal-BJqeQWr2.js +415 -0
- package/dist/server/Modal-Bt5zABLw.cjs +1 -0
- package/dist/server/Popover-BSHOd_RH.cjs +1 -0
- package/dist/server/{Popover-BRU2E-ek.js → Popover-DOl2Wob7.js} +103 -88
- package/dist/server/{StatusBarNotificationBell-Bk9ETGFK.js → StatusBarNotificationBell-5QIZhWif.js} +26 -27
- package/dist/server/{StatusBarNotificationBell-t7B7rSrd.cjs → StatusBarNotificationBell-BA53G1Rm.cjs} +3 -3
- package/dist/server/{Stepper-CJIoTXSv.js → Stepper-DPIaVHC2.js} +20 -21
- package/dist/server/Stepper-lTAo7tM9.cjs +1 -0
- package/dist/server/ToggleButton-BSOdOzjN.cjs +1 -0
- package/dist/server/{ToggleButton-BAhucFQT.js → ToggleButton-Cd8Dmcuj.js} +61 -62
- package/dist/server/VpArrowUp-9_PfEqFt.js +46 -0
- package/dist/server/VpArrowUp-D9ZUNPyn.cjs +1 -0
- package/dist/server/{VpChevronLeft-YI8H4bUq.js → VpChevronLeft-Dop81HaK.js} +2 -2
- package/dist/server/{VpTerminal-Bouc2jnT.js → VpTerminal-Bpw-d9wD.js} +12 -12
- package/dist/server/{VpTrash-B9HkM5Nj.js → VpTrash-DVBfts9_.js} +8 -8
- package/dist/server/{VpUpload-D3hgzJbk.js → VpUpload-_n-qdj9q.js} +5 -5
- package/dist/server/{createResizableSidebar-IcXBM-BE.js → createResizableSidebar-94M9e5Oc.js} +9 -10
- package/dist/server/createResizableSidebar-BriIvZzI.cjs +1 -0
- package/dist/server/forms/index.cjs +1 -1
- package/dist/server/forms/index.js +3 -3
- package/dist/server/{VpWorkspaceTrusted-DiZC21WF.js → index-BqIOYH6R.js} +1140 -1063
- package/dist/server/index-DwEHhkL-.cjs +1 -0
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +769 -1146
- package/dist/server/layout/index.cjs +1 -1
- package/dist/server/layout/index.js +2 -2
- package/dist/server/navigation/index.cjs +1 -1
- package/dist/server/navigation/index.js +1 -1
- package/dist/server/notifications/index.cjs +1 -1
- package/dist/server/notifications/index.js +2 -2
- package/dist/server/overlay/index.cjs +1 -1
- package/dist/server/overlay/index.js +4 -4
- package/dist/solid/_internal/app/icons/iconSetRegistry.js +1 -1
- package/dist/solid/desktop/menu/MenuPanel.jsx +2 -2
- package/dist/solid/feedback/Chip.jsx +1 -1
- package/dist/solid/feedback/InlineError.jsx +1 -1
- package/dist/solid/forms/Combobox.jsx +1 -1
- package/dist/solid/forms/CopyButton.jsx +1 -1
- package/dist/solid/forms/DatePicker.jsx +1 -1
- package/dist/solid/forms/Dropzone.jsx +1 -1
- package/dist/solid/forms/FormField.jsx +1 -1
- package/dist/solid/forms/MultiSearchableSelect.jsx +1 -1
- package/dist/solid/forms/NumberInput.jsx +1 -1
- package/dist/solid/forms/PasswordInput.jsx +1 -1
- package/dist/solid/forms/SearchInput.jsx +1 -1
- package/dist/solid/forms/SearchableSelect.jsx +1 -1
- package/dist/solid/forms/SplitButton.jsx +1 -1
- package/dist/solid/forms/TagInput.jsx +1 -1
- package/dist/solid/forms/date-range-picker/CalendarGrid.jsx +1 -1
- package/dist/solid/forms/date-range-picker/DateRangePicker.jsx +1 -1
- package/dist/solid/grid/AttributeGrid.jsx +1 -1
- package/dist/solid/grid/ToolbarSearchField.jsx +1 -1
- package/dist/solid/index.js +0 -1
- package/dist/solid/layout/PageHeader.jsx +1 -1
- package/dist/solid/navigation/Accordion.jsx +1 -1
- package/dist/solid/navigation/Breadcrumb.jsx +1 -1
- package/dist/solid/navigation/Stepper.jsx +1 -1
- package/dist/solid/navigation/Tabs.jsx +1 -1
- package/dist/solid/notifications/NotificationItem.jsx +1 -1
- package/dist/solid/notifications/NotificationPanel.jsx +1 -1
- package/dist/solid/notifications/NotificationsCenter.jsx +2 -2
- package/dist/solid/notifications/StatusBarNotificationBell.jsx +1 -1
- package/dist/solid/notifications/notificationOverlayChannel.js +1 -1
- package/dist/solid/overlay/Disclosure.jsx +1 -1
- package/dist/solid/overlay/Drawer.jsx +1 -1
- package/dist/solid/overlay/DropdownMenu.jsx +1 -1
- package/dist/solid/overlay/FloatingWindow.jsx +1 -1
- package/dist/solid/overlay/Modal.jsx +1 -1
- package/dist/solid/overlay/command-palette/CommandPalette.jsx +1 -1
- package/dist/solid/overlay/context-menu/DesktopContextMenu.jsx +1 -1
- package/dist/solid/overlay/menu/MenuParts.jsx +1 -1
- package/dist/solid/overlay/popover/PopoverPanel.jsx +1 -1
- package/dist/solid/tree/TreeRow.jsx +1 -1
- package/dist/solid/tree/TreeSurface.jsx +1 -1
- package/dist/solid/widgets/SettingsField.jsx +1 -1
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +3 -26
- package/dist/IconPicker-D2dZK0n3.cjs +0 -1
- package/dist/IconPicker-Fd2IE2Dm.js +0 -154
- package/dist/createResizableSidebar-C3I0HSwo.cjs +0 -1
- package/dist/iconSetRegistry-CMUqn1IQ.cjs +0 -1
- package/dist/iconSetRegistry-r8c82MmK.js +0 -28
- package/dist/icons/index.cjs +0 -1
- package/dist/icons/index.d.cts +0 -2
- package/dist/icons/index.d.ts +0 -2
- package/dist/icons/index.js +0 -6
- package/dist/icons/types.d.cts +0 -1
- package/dist/icons/types.d.ts +0 -1
- package/dist/server/CommandPalette-Dd8AW-WZ.cjs +0 -1
- package/dist/server/IconPicker-Bat7VYeo.cjs +0 -1
- package/dist/server/IconPicker-Dw4tbosO.js +0 -141
- package/dist/server/Modal-Jf89av-C.js +0 -373
- package/dist/server/Modal-W2cb3Xrx.cjs +0 -1
- package/dist/server/Popover-C2VwtQyu.cjs +0 -1
- package/dist/server/Stepper-RFkjF_fm.cjs +0 -1
- package/dist/server/ToggleButton-D9IXRIdl.cjs +0 -1
- package/dist/server/VpChevronDown-BMhGcdqG.cjs +0 -1
- package/dist/server/VpChevronDown-Ce6ZneQr.js +0 -18
- package/dist/server/VpExternalLink-C19K-ISd.cjs +0 -1
- package/dist/server/VpExternalLink-OGnThGLH.js +0 -46
- package/dist/server/VpWorkspaceTrusted-CPcushZ9.cjs +0 -1
- package/dist/server/createResizableSidebar-BymQA2Fs.cjs +0 -1
- package/dist/server/iconSetRegistry-u0H4_7nI.cjs +0 -1
- package/dist/server/iconSetRegistry-yPeAzzz7.js +0 -24
- package/dist/server/icons/index.cjs +0 -1
- package/dist/server/icons/index.js +0 -380
- package/dist/solid/icons/index.jsx +0 -2
- package/dist/solid/icons/types.js +0 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { ssr as g, ssrAttribute as i, escape as t, createComponent as o, Portal as Me, ssrStyle as te, memo as ae } from "solid-js/web";
|
|
2
|
+
import { Show as v, createMemo as Ee, createUniqueId as R, onMount as B, onCleanup as O, createSignal as z } from "solid-js";
|
|
3
|
+
import { p as De, n as $e } from "./prefersReducedMotion-B2mMn01s.js";
|
|
4
|
+
import { B as S } from "./Button-BhqhjFpY.js";
|
|
5
|
+
import { O as Ce } from "./OverlayScrollArea-221dfKyz.js";
|
|
6
|
+
import { t as w } from "./i18n-CYq-dVvv.js";
|
|
7
|
+
import { g as Oe } from "./windowRegistry-Bk5lXIVd.js";
|
|
8
|
+
import { u as ze, h as Te } from "./overlayStack-DvGdPMdq.js";
|
|
9
|
+
import { r as He } from "./Popover-DOl2Wob7.js";
|
|
10
|
+
import { c as q } from "./base-BLohC_tW.js";
|
|
11
|
+
import { V as pe } from "./VpClose-1RAQ20H9.js";
|
|
12
|
+
var Le = '<path d="M9 4H4v5m0-5 6 6m5-6h5v5m0-5-6 6M4 15v5h5m-5 0 6-6m10 1v5h-5m5 0-6-6"></path>';
|
|
13
|
+
const Ve = /* @__PURE__ */ q({
|
|
14
|
+
name: "VpArrowsMaximize",
|
|
15
|
+
a: {
|
|
16
|
+
fill: "none",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
"stroke-linecap": "round",
|
|
19
|
+
"stroke-linejoin": "round",
|
|
20
|
+
"stroke-width": "2",
|
|
21
|
+
viewBox: "0 0 24 24"
|
|
22
|
+
},
|
|
23
|
+
c: () => g(Le)
|
|
24
|
+
});
|
|
25
|
+
var Be = '<path d="M5 10h5V5m0 5L4 4m15 6h-5V5m0 5 6-6M5 14h5v5m0-5-6 6m15-6h-5v5m0-5 6 6"></path>';
|
|
26
|
+
const Fe = /* @__PURE__ */ q({
|
|
27
|
+
name: "VpArrowsMinimize",
|
|
28
|
+
a: {
|
|
29
|
+
fill: "none",
|
|
30
|
+
stroke: "currentColor",
|
|
31
|
+
"stroke-linecap": "round",
|
|
32
|
+
"stroke-linejoin": "round",
|
|
33
|
+
"stroke-width": "2",
|
|
34
|
+
viewBox: "0 0 24 24"
|
|
35
|
+
},
|
|
36
|
+
c: () => g(Be)
|
|
37
|
+
});
|
|
38
|
+
var Ie = '<path d="M11 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6M15 3h6v6m0-6-9 9"></path>';
|
|
39
|
+
const Ae = /* @__PURE__ */ q({
|
|
40
|
+
name: "VpExternalLink",
|
|
41
|
+
a: {
|
|
42
|
+
fill: "none",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
"stroke-linecap": "round",
|
|
45
|
+
"stroke-linejoin": "round",
|
|
46
|
+
"stroke-width": "2",
|
|
47
|
+
viewBox: "0 0 24 24"
|
|
48
|
+
},
|
|
49
|
+
c: () => g(Ie)
|
|
50
|
+
});
|
|
51
|
+
function ne(e) {
|
|
52
|
+
var b;
|
|
53
|
+
const _ = Number.parseFloat(
|
|
54
|
+
((b = e.defaultView) == null ? void 0 : b.getComputedStyle(e.documentElement).fontSize) ?? ""
|
|
55
|
+
);
|
|
56
|
+
return 2.875 * (Number.isFinite(_) && _ > 0 ? _ : 16);
|
|
57
|
+
}
|
|
58
|
+
const Re = "vk_place_5Cs4j", Se = "vk_placeLabel_ZwMrw", We = "vk_placeValue_EWbq8", T = {
|
|
59
|
+
place: Re,
|
|
60
|
+
placeLabel: Se,
|
|
61
|
+
placeValue: We
|
|
62
|
+
};
|
|
63
|
+
var qe = ["<dl", " data-dangerous-place><dt", ">", "</dt><dd", ' data-place="connection">', "</dd>", "</dl>"], je = ["<dt", ">", "</dt>"], Pe = ["<dd", ' data-place="database">', "</dd>"];
|
|
64
|
+
function Ne(e) {
|
|
65
|
+
return g(qe, i("id", t(e.id, !0), !1) + i("class", t(T.place, !0), !1), i("class", t(T.placeLabel, !0), !1), t(w("Connection")), i("class", t(T.placeValue, !0), !1), t(e.place.connection), t(o(v, {
|
|
66
|
+
get when() {
|
|
67
|
+
return e.place.database;
|
|
68
|
+
},
|
|
69
|
+
children: (_) => [g(je, i("class", t(T.placeLabel, !0), !1), t(w("Database"))), g(Pe, i("class", t(T.placeValue, !0), !1), t(_()))]
|
|
70
|
+
})));
|
|
71
|
+
}
|
|
72
|
+
const Xe = "vk_modalOverlay_53kKZ", Ke = "vk_modalOverlayExiting_x-xU-", Ue = "vk_modal_ZqkLW", Ze = "vk_modalEntering_hQj2V", Je = "vk_modalExiting_qiJ02", Ge = "vk_modalDragged_tiDIq", Qe = "vk_modalOverlayMaximized_00k68", Ye = "vk_modalMaximized_iL0gq", et = "vk_modalOverlayEmbedded_kz22G", tt = "vk_modalEmbedded_uaq4K", at = "vk_modalHeader_fiwar", nt = "vk_modalFooter_PqFE4", lt = "vk_modalBodyScroll_XIHnt", ot = "vk_modalHeaderDraggable_XVN7l", rt = "vk_modalHeaderDragging_AfuEb", dt = "vk_modalTitle_jdWEj vk_titleLg_Iswm3", it = "vk_modalTitleWrap_IW3-y", st = "vk_modalTitleContent_x5Np7", ct = "vk_modalSubtitle_Is6W0", mt = "vk_modalPlace_3FEgX", ut = "vk_modalHeaderActions_uUFCL", gt = "vk_modalBody_EJ4Kr", l = {
|
|
73
|
+
modalOverlay: Xe,
|
|
74
|
+
modalOverlayExiting: Ke,
|
|
75
|
+
modal: Ue,
|
|
76
|
+
modalEntering: Ze,
|
|
77
|
+
modalExiting: Je,
|
|
78
|
+
modalDragged: Ge,
|
|
79
|
+
modalOverlayMaximized: Qe,
|
|
80
|
+
modalMaximized: Ye,
|
|
81
|
+
modalOverlayEmbedded: et,
|
|
82
|
+
modalEmbedded: tt,
|
|
83
|
+
modalHeader: at,
|
|
84
|
+
modalFooter: nt,
|
|
85
|
+
modalBodyScroll: lt,
|
|
86
|
+
modalHeaderDraggable: ot,
|
|
87
|
+
modalHeaderDragging: rt,
|
|
88
|
+
modalTitle: dt,
|
|
89
|
+
modalTitleWrap: it,
|
|
90
|
+
modalTitleContent: st,
|
|
91
|
+
modalSubtitle: ct,
|
|
92
|
+
modalPlace: mt,
|
|
93
|
+
modalHeaderActions: ut,
|
|
94
|
+
modalBody: gt
|
|
95
|
+
};
|
|
96
|
+
var ft = ["<h3", ">", "</h3>"], ht = ["<p", ">", "</p>"], W = ["<div", ">", "</div>"], vt = ['<div class="', '" style="', '" tabindex="-1">', '<div class="', '" style="', '" role="dialog" aria-modal="true"', ' tabindex="-1"><div class="', '"><div', ">", "", "</div><div", ">", "", "", "</div></div>", "", "", "</div></div>"];
|
|
97
|
+
function Ht(e) {
|
|
98
|
+
const _ = Ee((s) => e.embedded || !e.open() ? null : s ?? e.hostDocument ?? Oe().document, null);
|
|
99
|
+
let b = null, n = null;
|
|
100
|
+
const H = () => n != null && n.isConnected ? n.ownerDocument : _(), le = ze(() => !e.embedded && e.open(), "modal", {
|
|
101
|
+
type: "modal",
|
|
102
|
+
element: () => n != null && n.isConnected ? n : null,
|
|
103
|
+
document: () => _() ?? void 0
|
|
104
|
+
}), oe = () => {
|
|
105
|
+
if (!e.embedded) return le.isTopmost();
|
|
106
|
+
const s = H();
|
|
107
|
+
return s !== null && !Te(s);
|
|
108
|
+
};
|
|
109
|
+
let $;
|
|
110
|
+
const re = () => $ == null ? void 0 : $();
|
|
111
|
+
let C = null, E = null;
|
|
112
|
+
const de = () => {
|
|
113
|
+
e.embedded || n === null || (C = $e(n));
|
|
114
|
+
}, ie = () => {
|
|
115
|
+
var s, f;
|
|
116
|
+
C == null || C(), C = null, b != null && b.isConnected && typeof b.focus == "function" && b.focus(), e.focusFallback && E !== null && E.activeElement !== b && ((s = e.focusFallback()) == null || s.focus()), e.focusFallback && E !== null && E.activeElement === E.body && ((f = e.focusFallback()) == null || f.focus()), b = null, E = null, n = null;
|
|
117
|
+
}, F = R(), j = R(), P = R(), se = () => {
|
|
118
|
+
const s = [...e.subtitle ? [j] : [], ...e.place ? [P] : []];
|
|
119
|
+
return s.length > 0 ? s.join(" ") : void 0;
|
|
120
|
+
}, N = () => {
|
|
121
|
+
B(de), O(ie), B(() => {
|
|
122
|
+
var r;
|
|
123
|
+
const a = (r = H()) == null ? void 0 : r.defaultView;
|
|
124
|
+
if (!a) return;
|
|
125
|
+
const h = () => {
|
|
126
|
+
oe();
|
|
127
|
+
};
|
|
128
|
+
a.addEventListener("mousedown", h, !0), O(() => a.removeEventListener("mousedown", h, !0));
|
|
129
|
+
});
|
|
130
|
+
const s = () => {
|
|
131
|
+
const a = H();
|
|
132
|
+
return a !== null && De(a);
|
|
133
|
+
}, [f, ce] = z(!1);
|
|
134
|
+
let D, I = !1, X = !1;
|
|
135
|
+
const K = () => {
|
|
136
|
+
X || !I || (X = !0, D !== void 0 && clearTimeout(D), D = void 0, e.onClose());
|
|
137
|
+
};
|
|
138
|
+
$ = () => {
|
|
139
|
+
if (!(e.closeDisabled || I)) {
|
|
140
|
+
if (I = !0, G(), p(), e.embedded || s()) {
|
|
141
|
+
K();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
ce(!0), D = setTimeout(K, 120);
|
|
145
|
+
}
|
|
146
|
+
}, O(() => {
|
|
147
|
+
$ = void 0, D !== void 0 && clearTimeout(D);
|
|
148
|
+
});
|
|
149
|
+
const [A, me] = z(!e.embedded && !s());
|
|
150
|
+
let M;
|
|
151
|
+
const p = () => {
|
|
152
|
+
M !== void 0 && (clearTimeout(M), M = void 0), A() && me(!1);
|
|
153
|
+
};
|
|
154
|
+
B(() => {
|
|
155
|
+
A() && (M = setTimeout(p, 200));
|
|
156
|
+
}), O(() => {
|
|
157
|
+
M !== void 0 && (clearTimeout(M), M = void 0);
|
|
158
|
+
});
|
|
159
|
+
const [u, ue] = z(!1), [L, U] = z({
|
|
160
|
+
x: 0,
|
|
161
|
+
y: 0
|
|
162
|
+
}), [Z, bt] = z(!1), J = () => !e.embedded && (e.allowMaximize ?? !0), ge = () => !e.embedded && !f() && !u() && (e.allowDrag ?? !0);
|
|
163
|
+
let V = null;
|
|
164
|
+
const G = () => {
|
|
165
|
+
V == null || V(), V = null;
|
|
166
|
+
}, fe = () => {
|
|
167
|
+
if (!J() || e.closeDisabled || f()) return;
|
|
168
|
+
p();
|
|
169
|
+
const a = u(), h = typeof (n == null ? void 0 : n.animate) == "function" && !s(), r = h && n ? n.getBoundingClientRect() : null;
|
|
170
|
+
if (ue(!a), h && n && r && r.width > 0 && r.height > 0) {
|
|
171
|
+
const c = n;
|
|
172
|
+
He(c, () => {
|
|
173
|
+
if (n !== c || f()) return;
|
|
174
|
+
const d = c.getBoundingClientRect();
|
|
175
|
+
if (d.width > 0 && d.height > 0) {
|
|
176
|
+
const m = r.left - d.left, x = r.top - d.top, y = r.width / d.width, k = r.height / d.height;
|
|
177
|
+
c.animate([{
|
|
178
|
+
transformOrigin: "top left",
|
|
179
|
+
transform: `translate(${m}px, ${x}px) scale(${y}, ${k})`,
|
|
180
|
+
borderRadius: a ? "0px" : "var(--radius-xl)"
|
|
181
|
+
}, {
|
|
182
|
+
transformOrigin: "top left",
|
|
183
|
+
transform: "translate(0px, 0px) scale(1, 1)",
|
|
184
|
+
borderRadius: a ? "var(--radius-xl)" : "0px"
|
|
185
|
+
}], {
|
|
186
|
+
duration: a ? 240 : 280,
|
|
187
|
+
easing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
188
|
+
fill: "none"
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (a && n) {
|
|
194
|
+
const c = n;
|
|
195
|
+
queueMicrotask(() => {
|
|
196
|
+
if (n !== c || u() || f()) return;
|
|
197
|
+
const d = c.ownerDocument.defaultView;
|
|
198
|
+
if (d === null) return;
|
|
199
|
+
const m = L(), x = c.getBoundingClientRect(), y = {
|
|
200
|
+
left: x.left - m.x,
|
|
201
|
+
top: x.top - m.y,
|
|
202
|
+
width: x.width,
|
|
203
|
+
height: x.height
|
|
204
|
+
};
|
|
205
|
+
U(Q(m.x, m.y, y, d, 44));
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}, Q = (a, h, r, c, d) => {
|
|
209
|
+
const m = c.innerWidth, x = c.innerHeight, y = r.width > 0 ? r.width : 500, k = r.width > 0 ? r.left : (m - y) / 2, Y = r.height > 0 ? r.top : ne(c.document) + 16, he = d, ve = Math.min(0, m - y), be = Math.max(0, m - y), xe = k + a, we = Math.min(Math.max(xe, ve), be) - k, ee = ne(c.document), _e = Math.max(ee, x - he), ye = Y + h, ke = Math.min(Math.max(ye, ee), _e) - Y;
|
|
210
|
+
return {
|
|
211
|
+
x: we,
|
|
212
|
+
y: ke
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
return B(() => {
|
|
216
|
+
var c;
|
|
217
|
+
const a = (c = H()) == null ? void 0 : c.defaultView;
|
|
218
|
+
if (!a) return;
|
|
219
|
+
const h = () => {
|
|
220
|
+
if (u() || f() || e.embedded || !n) return;
|
|
221
|
+
p();
|
|
222
|
+
const d = L(), m = n.getBoundingClientRect(), x = {
|
|
223
|
+
left: m.left - d.x,
|
|
224
|
+
top: m.top - d.y,
|
|
225
|
+
width: m.width,
|
|
226
|
+
height: m.height
|
|
227
|
+
}, k = Q(d.x, d.y, x, a, 44);
|
|
228
|
+
(k.x !== d.x || k.y !== d.y) && U(k);
|
|
229
|
+
};
|
|
230
|
+
a.addEventListener("resize", h);
|
|
231
|
+
const r = new MutationObserver(h);
|
|
232
|
+
r.observe(a.document.documentElement, {
|
|
233
|
+
attributes: !0,
|
|
234
|
+
attributeFilter: ["style", "class"]
|
|
235
|
+
}), O(() => {
|
|
236
|
+
a.removeEventListener("resize", h), r.disconnect(), G();
|
|
237
|
+
});
|
|
238
|
+
}), g(vt, `${e.embedded ? t(l.modalOverlayEmbedded, !0) : t(l.modalOverlay, !0)} ${u() ? t(l.modalOverlayMaximized, !0) : ""} ${f() ? t(l.modalOverlayExiting, !0) : ""}`, te(e.transparentBackdrop ? {
|
|
239
|
+
background: "transparent"
|
|
240
|
+
} : void 0), t(e.decoration), `${t(l.modal, !0)} ${e.embedded ? t(l.modalEmbedded, !0) : ""} ${A() && !f() ? t(l.modalEntering, !0) : ""} ${u() ? t(l.modalMaximized, !0) : ""} ${Z() ? t(l.modalDragged, !0) : ""} ${f() ? t(l.modalExiting, !0) : ""}`, te({
|
|
241
|
+
...e.embedded ? void 0 : {
|
|
242
|
+
"max-width": u() ? "100%" : e.maxWidth ?? "32rem"
|
|
243
|
+
},
|
|
244
|
+
...e.dialogStyle,
|
|
245
|
+
"--modal-drag-x": `${u() || e.embedded ? 0 : L().x}px`,
|
|
246
|
+
"--modal-drag-y": `${u() || e.embedded ? 0 : L().y}px`
|
|
247
|
+
}), i("aria-labelledby", t(F, !0), !1) + i("aria-describedby", t(se(), !0), !1), `${t(l.modalHeader, !0)} ${ge() ? Z() ? t(l.modalHeaderDragging, !0) : t(l.modalHeaderDraggable, !0) : ""}`, i("class", t(l.modalTitleWrap, !0), !1), t(o(v, {
|
|
248
|
+
get when() {
|
|
249
|
+
return typeof e.title == "string";
|
|
250
|
+
},
|
|
251
|
+
get fallback() {
|
|
252
|
+
return g(W, i("id", t(F, !0), !1) + i("class", t(l.modalTitleContent, !0), !1), t(e.title));
|
|
253
|
+
},
|
|
254
|
+
get children() {
|
|
255
|
+
return g(ft, i("id", t(F, !0), !1) + i("class", t(l.modalTitle, !0), !1), t(e.title));
|
|
256
|
+
}
|
|
257
|
+
})), t(o(v, {
|
|
258
|
+
get when() {
|
|
259
|
+
return e.subtitle;
|
|
260
|
+
},
|
|
261
|
+
get children() {
|
|
262
|
+
return g(ht, i("id", t(j, !0), !1) + i("class", t(l.modalSubtitle, !0), !1), t(e.subtitle));
|
|
263
|
+
}
|
|
264
|
+
})), i("class", t(l.modalHeaderActions, !0), !1), t(o(v, {
|
|
265
|
+
get when() {
|
|
266
|
+
return e.onDetach;
|
|
267
|
+
},
|
|
268
|
+
get children() {
|
|
269
|
+
return o(S, {
|
|
270
|
+
size: "sm",
|
|
271
|
+
variant: "ghost",
|
|
272
|
+
iconOnly: !0,
|
|
273
|
+
onClick: () => {
|
|
274
|
+
var a;
|
|
275
|
+
return (a = e.onDetach) == null ? void 0 : a.call(e);
|
|
276
|
+
},
|
|
277
|
+
get disabled() {
|
|
278
|
+
return e.closeDisabled;
|
|
279
|
+
},
|
|
280
|
+
get title() {
|
|
281
|
+
return w("Open in new window");
|
|
282
|
+
},
|
|
283
|
+
get "aria-label"() {
|
|
284
|
+
return w("Open in new window");
|
|
285
|
+
},
|
|
286
|
+
get children() {
|
|
287
|
+
return o(Ae, {});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
})), t(o(v, {
|
|
292
|
+
get when() {
|
|
293
|
+
return J();
|
|
294
|
+
},
|
|
295
|
+
get children() {
|
|
296
|
+
return o(S, {
|
|
297
|
+
size: "sm",
|
|
298
|
+
variant: "ghost",
|
|
299
|
+
iconOnly: !0,
|
|
300
|
+
onClick: fe,
|
|
301
|
+
get disabled() {
|
|
302
|
+
return e.closeDisabled;
|
|
303
|
+
},
|
|
304
|
+
get title() {
|
|
305
|
+
return ae(() => !!u())() ? w("Restore") : w("Maximize");
|
|
306
|
+
},
|
|
307
|
+
get "aria-label"() {
|
|
308
|
+
return ae(() => !!u())() ? w("Restore") : w("Maximize");
|
|
309
|
+
},
|
|
310
|
+
get children() {
|
|
311
|
+
return o(v, {
|
|
312
|
+
get when() {
|
|
313
|
+
return u();
|
|
314
|
+
},
|
|
315
|
+
get fallback() {
|
|
316
|
+
return o(Ve, {});
|
|
317
|
+
},
|
|
318
|
+
get children() {
|
|
319
|
+
return o(Fe, {});
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
})), t(o(v, {
|
|
326
|
+
get when() {
|
|
327
|
+
return !e.hideClose;
|
|
328
|
+
},
|
|
329
|
+
get children() {
|
|
330
|
+
return o(S, {
|
|
331
|
+
size: "sm",
|
|
332
|
+
variant: "ghost",
|
|
333
|
+
iconOnly: !0,
|
|
334
|
+
onClick: re,
|
|
335
|
+
get disabled() {
|
|
336
|
+
return e.closeDisabled;
|
|
337
|
+
},
|
|
338
|
+
get title() {
|
|
339
|
+
return w("Close");
|
|
340
|
+
},
|
|
341
|
+
get "aria-label"() {
|
|
342
|
+
return w("Close");
|
|
343
|
+
},
|
|
344
|
+
get children() {
|
|
345
|
+
return o(pe, {});
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
})), t(o(v, {
|
|
350
|
+
get when() {
|
|
351
|
+
return e.place;
|
|
352
|
+
},
|
|
353
|
+
children: (a) => g(W, i("class", t(l.modalPlace, !0), !1), t(o(Ne, {
|
|
354
|
+
id: P,
|
|
355
|
+
get place() {
|
|
356
|
+
return a();
|
|
357
|
+
}
|
|
358
|
+
})))
|
|
359
|
+
})), t(o(Ce, {
|
|
360
|
+
get rootClass() {
|
|
361
|
+
return l.modalBodyScroll;
|
|
362
|
+
},
|
|
363
|
+
get viewportClass() {
|
|
364
|
+
return l.modalBody;
|
|
365
|
+
},
|
|
366
|
+
get children() {
|
|
367
|
+
return e.children;
|
|
368
|
+
}
|
|
369
|
+
})), t(o(v, {
|
|
370
|
+
get when() {
|
|
371
|
+
return e.footer;
|
|
372
|
+
},
|
|
373
|
+
get children() {
|
|
374
|
+
return g(W, i("class", t(l.modalFooter, !0), !1), t(e.footer));
|
|
375
|
+
}
|
|
376
|
+
})));
|
|
377
|
+
};
|
|
378
|
+
return (
|
|
379
|
+
// Embedded fills its aux-window container 1:1 — render in place. The overlay path
|
|
380
|
+
// portals to the body of the document it opened in (reference: the active container
|
|
381
|
+
// at show time), so a modal triggered while a detached / aux window is focused covers
|
|
382
|
+
// THAT window, not main.
|
|
383
|
+
o(v, {
|
|
384
|
+
get when() {
|
|
385
|
+
return !e.embedded;
|
|
386
|
+
},
|
|
387
|
+
get fallback() {
|
|
388
|
+
return N();
|
|
389
|
+
},
|
|
390
|
+
get children() {
|
|
391
|
+
return o(v, {
|
|
392
|
+
get when() {
|
|
393
|
+
return _();
|
|
394
|
+
},
|
|
395
|
+
children: (s) => o(Me, {
|
|
396
|
+
get mount() {
|
|
397
|
+
return s().body;
|
|
398
|
+
},
|
|
399
|
+
get children() {
|
|
400
|
+
return N();
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
})
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
export {
|
|
409
|
+
Ne as A,
|
|
410
|
+
Ht as M,
|
|
411
|
+
Fe as V,
|
|
412
|
+
Ve as a,
|
|
413
|
+
Ae as b,
|
|
414
|
+
ne as m
|
|
415
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("solid-js/web"),a=require("solid-js"),K=require("./prefersReducedMotion-BQp-Q4UR.cjs"),T=require("./Button-CFOM8pOv.cjs"),xe=require("./OverlayScrollArea-D4e9D9Nd.cjs"),v=require("./i18n-B9ccWgcR.cjs"),ye=require("./windowRegistry-CGvOBUsw.cjs"),Z=require("./overlayStack-DvKYN7SD.cjs"),_e=require("./Popover-BSHOd_RH.cjs"),L=require("./base-CrwDbIhF.cjs"),ke=require("./VpClose-O8jHAcCB.cjs");var Ce='<path d="M9 4H4v5m0-5 6 6m5-6h5v5m0-5-6 6M4 15v5h5m-5 0 6-6m10 1v5h-5m5 0-6-6"></path>';const G=L.createIcon({name:"VpArrowsMaximize",a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:()=>e.ssr(Ce)});var Me='<path d="M5 10h5V5m0 5L4 4m15 6h-5V5m0 5 6-6M5 14h5v5m0-5-6 6m15-6h-5v5m0-5 6 6"></path>';const Q=L.createIcon({name:"VpArrowsMinimize",a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:()=>e.ssr(Me)});var Ee='<path d="M11 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6M15 3h6v6m0-6-9 9"></path>';const Y=L.createIcon({name:"VpExternalLink",a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:()=>e.ssr(Ee)});function q(t){var h;const b=Number.parseFloat(((h=t.defaultView)==null?void 0:h.getComputedStyle(t.documentElement).fontSize)??"");return 2.875*(Number.isFinite(b)&&b>0?b:16)}const Ae="vk_place_5Cs4j",De="vk_placeLabel_ZwMrw",$e="vk_placeValue_EWbq8",M={place:Ae,placeLabel:De,placeValue:$e};var ze=["<dl"," data-dangerous-place><dt",">","</dt><dd",' data-place="connection">',"</dd>","</dl>"],Oe=["<dt",">","</dt>"],Se=["<dd",' data-place="database">',"</dd>"];function ee(t){return e.ssr(ze,e.ssrAttribute("id",e.escape(t.id,!0),!1)+e.ssrAttribute("class",e.escape(M.place,!0),!1),e.ssrAttribute("class",e.escape(M.placeLabel,!0),!1),e.escape(v.t("Connection")),e.ssrAttribute("class",e.escape(M.placeValue,!0),!1),e.escape(t.place.connection),e.escape(e.createComponent(a.Show,{get when(){return t.place.database},children:b=>[e.ssr(Oe,e.ssrAttribute("class",e.escape(M.placeLabel,!0),!1),e.escape(v.t("Database"))),e.ssr(Se,e.ssrAttribute("class",e.escape(M.placeValue,!0),!1),e.escape(b()))]})))}const Te="vk_modalOverlay_53kKZ",He="vk_modalOverlayExiting_x-xU-",qe="vk_modal_ZqkLW",Le="vk_modalEntering_hQj2V",Ve="vk_modalExiting_qiJ02",Be="vk_modalDragged_tiDIq",Ie="vk_modalOverlayMaximized_00k68",Re="vk_modalMaximized_iL0gq",Fe="vk_modalOverlayEmbedded_kz22G",We="vk_modalEmbedded_uaq4K",Pe="vk_modalHeader_fiwar",je="vk_modalFooter_PqFE4",Ue="vk_modalBodyScroll_XIHnt",Ne="vk_modalHeaderDraggable_XVN7l",Xe="vk_modalHeaderDragging_AfuEb",Je="vk_modalTitle_jdWEj vk_titleLg_Iswm3",Ke="vk_modalTitleWrap_IW3-y",Ze="vk_modalTitleContent_x5Np7",Ge="vk_modalSubtitle_Is6W0",Qe="vk_modalPlace_3FEgX",Ye="vk_modalHeaderActions_uUFCL",et="vk_modalBody_EJ4Kr",r={modalOverlay:Te,modalOverlayExiting:He,modal:qe,modalEntering:Le,modalExiting:Ve,modalDragged:Be,modalOverlayMaximized:Ie,modalMaximized:Re,modalOverlayEmbedded:Fe,modalEmbedded:We,modalHeader:Pe,modalFooter:je,modalBodyScroll:Ue,modalHeaderDraggable:Ne,modalHeaderDragging:Xe,modalTitle:Je,modalTitleWrap:Ke,modalTitleContent:Ze,modalSubtitle:Ge,modalPlace:Qe,modalHeaderActions:Ye,modalBody:et};var tt=["<h3",">","</h3>"],at=["<p",">","</p>"],H=["<div",">","</div>"],nt=['<div class="','" style="','" tabindex="-1">','<div class="','" style="','" role="dialog" aria-modal="true"',' tabindex="-1"><div class="','"><div',">","","</div><div",">","","","</div></div>","","","</div></div>"];function ot(t){const b=a.createMemo(s=>t.embedded||!t.open()?null:s??t.hostDocument??ye.getActiveWindow().document,null);let h=null,o=null;const E=()=>o!=null&&o.isConnected?o.ownerDocument:b(),te=Z.useOverlayRegistration(()=>!t.embedded&&t.open(),"modal",{type:"modal",element:()=>o!=null&&o.isConnected?o:null,document:()=>b()??void 0}),ae=()=>{if(!t.embedded)return te.isTopmost();const s=E();return s!==null&&!Z.hasOpenLayerIn(s)};let k;const ne=()=>k==null?void 0:k();let C=null,y=null;const oe=()=>{t.embedded||o===null||(C=K.neutralizeBackground(o))},re=()=>{var s,m;C==null||C(),C=null,h!=null&&h.isConnected&&typeof h.focus=="function"&&h.focus(),t.focusFallback&&y!==null&&y.activeElement!==h&&((s=t.focusFallback())==null||s.focus()),t.focusFallback&&y!==null&&y.activeElement===y.body&&((m=t.focusFallback())==null||m.focus()),h=null,y=null,o=null},z=a.createUniqueId(),V=a.createUniqueId(),B=a.createUniqueId(),le=()=>{const s=[...t.subtitle?[V]:[],...t.place?[B]:[]];return s.length>0?s.join(" "):void 0},I=()=>{a.onMount(oe),a.onCleanup(re),a.onMount(()=>{var l;const n=(l=E())==null?void 0:l.defaultView;if(!n)return;const g=()=>{ae()};n.addEventListener("mousedown",g,!0),a.onCleanup(()=>n.removeEventListener("mousedown",g,!0))});const s=()=>{const n=E();return n!==null&&K.prefersReducedMotion(n)},[m,ie]=a.createSignal(!1);let _,O=!1,R=!1;const F=()=>{R||!O||(R=!0,_!==void 0&&clearTimeout(_),_=void 0,t.onClose())};k=()=>{if(!(t.closeDisabled||O)){if(O=!0,U(),A(),t.embedded||s()){F();return}ie(!0),_=setTimeout(F,120)}},a.onCleanup(()=>{k=void 0,_!==void 0&&clearTimeout(_)});const[S,se]=a.createSignal(!t.embedded&&!s());let x;const A=()=>{x!==void 0&&(clearTimeout(x),x=void 0),S()&&se(!1)};a.onMount(()=>{S()&&(x=setTimeout(A,200))}),a.onCleanup(()=>{x!==void 0&&(clearTimeout(x),x=void 0)});const[u,de]=a.createSignal(!1),[D,W]=a.createSignal({x:0,y:0}),[P,rt]=a.createSignal(!1),j=()=>!t.embedded&&(t.allowMaximize??!0),ce=()=>!t.embedded&&!m()&&!u()&&(t.allowDrag??!0);let $=null;const U=()=>{$==null||$(),$=null},ue=()=>{if(!j()||t.closeDisabled||m())return;A();const n=u(),g=typeof(o==null?void 0:o.animate)=="function"&&!s(),l=g&&o?o.getBoundingClientRect():null;if(de(!n),g&&o&&l&&l.width>0&&l.height>0){const d=o;_e.requestOwnerAnimationFrame(d,()=>{if(o!==d||m())return;const i=d.getBoundingClientRect();if(i.width>0&&i.height>0){const c=l.left-i.left,f=l.top-i.top,p=l.width/i.width,w=l.height/i.height;d.animate([{transformOrigin:"top left",transform:`translate(${c}px, ${f}px) scale(${p}, ${w})`,borderRadius:n?"0px":"var(--radius-xl)"},{transformOrigin:"top left",transform:"translate(0px, 0px) scale(1, 1)",borderRadius:n?"var(--radius-xl)":"0px"}],{duration:n?240:280,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"none"})}})}if(n&&o){const d=o;queueMicrotask(()=>{if(o!==d||u()||m())return;const i=d.ownerDocument.defaultView;if(i===null)return;const c=D(),f=d.getBoundingClientRect(),p={left:f.left-c.x,top:f.top-c.y,width:f.width,height:f.height};W(N(c.x,c.y,p,i,44))})}},N=(n,g,l,d,i)=>{const c=d.innerWidth,f=d.innerHeight,p=l.width>0?l.width:500,w=l.width>0?l.left:(c-p)/2,X=l.height>0?l.top:q(d.document)+16,me=i,ge=Math.min(0,c-p),he=Math.max(0,c-p),fe=w+n,ve=Math.min(Math.max(fe,ge),he)-w,J=q(d.document),be=Math.max(J,f-me),pe=X+g,we=Math.min(Math.max(pe,J),be)-X;return{x:ve,y:we}};return a.onMount(()=>{var d;const n=(d=E())==null?void 0:d.defaultView;if(!n)return;const g=()=>{if(u()||m()||t.embedded||!o)return;A();const i=D(),c=o.getBoundingClientRect(),f={left:c.left-i.x,top:c.top-i.y,width:c.width,height:c.height},w=N(i.x,i.y,f,n,44);(w.x!==i.x||w.y!==i.y)&&W(w)};n.addEventListener("resize",g);const l=new MutationObserver(g);l.observe(n.document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),a.onCleanup(()=>{n.removeEventListener("resize",g),l.disconnect(),U()})}),e.ssr(nt,`${t.embedded?e.escape(r.modalOverlayEmbedded,!0):e.escape(r.modalOverlay,!0)} ${u()?e.escape(r.modalOverlayMaximized,!0):""} ${m()?e.escape(r.modalOverlayExiting,!0):""}`,e.ssrStyle(t.transparentBackdrop?{background:"transparent"}:void 0),e.escape(t.decoration),`${e.escape(r.modal,!0)} ${t.embedded?e.escape(r.modalEmbedded,!0):""} ${S()&&!m()?e.escape(r.modalEntering,!0):""} ${u()?e.escape(r.modalMaximized,!0):""} ${P()?e.escape(r.modalDragged,!0):""} ${m()?e.escape(r.modalExiting,!0):""}`,e.ssrStyle({...t.embedded?void 0:{"max-width":u()?"100%":t.maxWidth??"32rem"},...t.dialogStyle,"--modal-drag-x":`${u()||t.embedded?0:D().x}px`,"--modal-drag-y":`${u()||t.embedded?0:D().y}px`}),e.ssrAttribute("aria-labelledby",e.escape(z,!0),!1)+e.ssrAttribute("aria-describedby",e.escape(le(),!0),!1),`${e.escape(r.modalHeader,!0)} ${ce()?P()?e.escape(r.modalHeaderDragging,!0):e.escape(r.modalHeaderDraggable,!0):""}`,e.ssrAttribute("class",e.escape(r.modalTitleWrap,!0),!1),e.escape(e.createComponent(a.Show,{get when(){return typeof t.title=="string"},get fallback(){return e.ssr(H,e.ssrAttribute("id",e.escape(z,!0),!1)+e.ssrAttribute("class",e.escape(r.modalTitleContent,!0),!1),e.escape(t.title))},get children(){return e.ssr(tt,e.ssrAttribute("id",e.escape(z,!0),!1)+e.ssrAttribute("class",e.escape(r.modalTitle,!0),!1),e.escape(t.title))}})),e.escape(e.createComponent(a.Show,{get when(){return t.subtitle},get children(){return e.ssr(at,e.ssrAttribute("id",e.escape(V,!0),!1)+e.ssrAttribute("class",e.escape(r.modalSubtitle,!0),!1),e.escape(t.subtitle))}})),e.ssrAttribute("class",e.escape(r.modalHeaderActions,!0),!1),e.escape(e.createComponent(a.Show,{get when(){return t.onDetach},get children(){return e.createComponent(T.Button,{size:"sm",variant:"ghost",iconOnly:!0,onClick:()=>{var n;return(n=t.onDetach)==null?void 0:n.call(t)},get disabled(){return t.closeDisabled},get title(){return v.t("Open in new window")},get"aria-label"(){return v.t("Open in new window")},get children(){return e.createComponent(Y,{})}})}})),e.escape(e.createComponent(a.Show,{get when(){return j()},get children(){return e.createComponent(T.Button,{size:"sm",variant:"ghost",iconOnly:!0,onClick:ue,get disabled(){return t.closeDisabled},get title(){return e.memo(()=>!!u())()?v.t("Restore"):v.t("Maximize")},get"aria-label"(){return e.memo(()=>!!u())()?v.t("Restore"):v.t("Maximize")},get children(){return e.createComponent(a.Show,{get when(){return u()},get fallback(){return e.createComponent(G,{})},get children(){return e.createComponent(Q,{})}})}})}})),e.escape(e.createComponent(a.Show,{get when(){return!t.hideClose},get children(){return e.createComponent(T.Button,{size:"sm",variant:"ghost",iconOnly:!0,onClick:ne,get disabled(){return t.closeDisabled},get title(){return v.t("Close")},get"aria-label"(){return v.t("Close")},get children(){return e.createComponent(ke.VpClose,{})}})}})),e.escape(e.createComponent(a.Show,{get when(){return t.place},children:n=>e.ssr(H,e.ssrAttribute("class",e.escape(r.modalPlace,!0),!1),e.escape(e.createComponent(ee,{id:B,get place(){return n()}})))})),e.escape(e.createComponent(xe.OverlayScrollArea,{get rootClass(){return r.modalBodyScroll},get viewportClass(){return r.modalBody},get children(){return t.children}})),e.escape(e.createComponent(a.Show,{get when(){return t.footer},get children(){return e.ssr(H,e.ssrAttribute("class",e.escape(r.modalFooter,!0),!1),e.escape(t.footer))}})))};return e.createComponent(a.Show,{get when(){return!t.embedded},get fallback(){return I()},get children(){return e.createComponent(a.Show,{get when(){return b()},children:s=>e.createComponent(e.Portal,{get mount(){return s().body},get children(){return I()}})})}})}exports.ActionPlaceRow=ee;exports.Modal=ot;exports.VpArrowsMaximize=G;exports.VpArrowsMinimize=Q;exports.VpExternalLink=Y;exports.modalTitlebarHeight=q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const v=require("solid-js/web"),S=require("./base-CrwDbIhF.cjs"),E=require("solid-js"),W=require("./ownerWindow-BCmJFMbR.cjs"),G=require("./overlayStack-DvKYN7SD.cjs"),U=require("./OverlayScrollArea-D4e9D9Nd.cjs"),$=require("./keys-GMxY2wcl.cjs");var z='<path d="m7 9.5 5 5 5-5"></path>';const K=S.createIcon({name:"VpChevronDown",a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:()=>v.ssr(z)});function M(t,o){let n=!1,e=null;const l=()=>{if(n)return;const r=W.ownerWindow(t);if(r===null||!t.isConnected)return;const g=r.requestAnimationFrame(()=>{n||o()});e=()=>r.cancelAnimationFrame(g)};return t.isConnected?l():queueMicrotask(l),()=>{n=!0,e==null||e()}}var R=(t=>(t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t))(R||{}),T=(t=>(t[t.BELOW=0]="BELOW",t[t.ABOVE=1]="ABOVE",t))(T||{}),_=(t=>(t[t.VERTICAL=0]="VERTICAL",t[t.HORIZONTAL=1]="HORIZONTAL",t))(_||{});function H(t,o){const n=Math.max(t.start,o.start);return Math.min(t.end,o.end)-n>0}function O(t,o,n){const e=n.mode===1?n.offset:n.offset+n.size,l=n.mode===1?n.offset+n.size:n.offset;return n.position===0?o<=t-e?{position:e,result:"ok"}:o<=l?{position:l-o,result:"flipped"}:{position:Math.max(t-o,0),result:"overlap"}:o<=l?{position:l-o,result:"ok"}:o<=t-e&&l<o/2?{position:e,result:"flipped"}:{position:0,result:"overlap"}}function Y(t,o,n,e){let l=(e==null?void 0:e.anchorAlignment)??0,r=(e==null?void 0:e.anchorPosition)??0;const g=(e==null?void 0:e.anchorAxisAlignment)??0,w=(e==null?void 0:e.gap)??0,p=(e==null?void 0:e.margin)??0,c=p>0?{top:t.top+p,left:t.left+p,width:Math.max(0,t.width-2*p),height:Math.max(0,t.height-2*p)}:t;let i,s;if(g===0){const d={offset:n.top-c.top-w,size:n.height+2*w,position:r===0?0:1},b={offset:n.left-c.left,size:n.width,position:l===0?0:1,mode:1},u=O(c.height,o.height,d);i=u.position+c.top,u.result==="flipped"&&(r=r===0?1:0),H({start:i,end:i+o.height},{start:d.offset+c.top,end:d.offset+d.size+c.top})&&(b.mode=0);const a=O(c.width,o.width,b);s=a.position+c.left,a.result==="flipped"&&(l=l===0?1:0)}else{const d={offset:n.left-c.left-w,size:n.width+2*w,position:l===0?0:1},b={offset:n.top-c.top,size:n.height,position:r===0?0:1,mode:1},u=O(c.width,o.width,d);s=u.position+c.left,u.result==="flipped"&&(l=l===0?1:0),H({start:s,end:s+o.width},{start:d.offset+c.left,end:d.offset+d.size+c.left})&&(b.mode=0);const a=O(c.height,o.height,b);i=a.position+c.top,a.result==="flipped"&&(r=r===0?1:0)}const m=t.width-(s+o.width),f=t.height-(i+o.height);return{top:i,left:s,bottom:f,right:m,anchorAlignment:l,anchorPosition:r}}const A=8,Z=4,I=8,B=4;function C(t,o,n,e=8){return t+o>n-e?Math.max(e,n-e-o):t}function j(t){const o=t.margin??8,n=t.gap??4,e=t.anchorRect,l="bottom"in e&&typeof e.bottom=="number"?e.bottom:e.top+e.height,r=t.viewportHeight-l-o,g=e.top-o,w=t.desiredHeight??t.measuredHeight??240,p=r<Math.min(w,200)&&g>r,c=t.minMaxHeight??120,i=Math.max(c,p?g-n:r-n),s=p?Math.max(o,e.top-n-Math.min(w,i)):l+n,m=t.measuredWidth??0,f=Math.max(e.width,m),d=C(e.left,f,t.viewportWidth,o);return{top:s,left:d,width:e.width,maxHeight:i,side:p?"top":"bottom",preferAbove:p}}function L(t,o,n){return Math.max(o,Math.min(t,n))}function X(t){return t.endsWith("-end")}function V(t){const{placement:o,anchor:n,panelHeight:e,viewportHeight:l,gap:r}=t;if(o.startsWith("top"))return"top";if(o.startsWith("bottom"))return"bottom";const g=l-n.bottom-A,w=n.top-A;return(e>0?e:200)+r<=g||g>=w?"bottom":"top"}function F(t){const{anchor:o,panelWidth:n,panelHeight:e,viewportWidth:l,viewportHeight:r,gap:g}=t,w=X(t.placement)?o.right-n:o.left,p=L(w,A,l-n-A),c=V(t);if(c==="top"){const d=Math.max(0,o.top-g-A),b=Math.min(r-2*A,d),u=e>0?Math.min(e,b):Math.min(200,b),a=o.top-g-u,h=L(a,A,Math.max(A,o.top-g));return{left:p,top:h,anchorWidth:o.width,side:c,maxHeight:b}}const i=o.bottom+g,s=L(i,A,r-e-A),m=Math.max(0,r-s-A),f=Math.min(r-2*A,m);return{left:p,top:s,anchorWidth:o.width,side:c,maxHeight:f}}function J(t){const o=t.margin??I,n=t.gap??B;let e;if("x"in t.anchor){const a="width"in t.anchor&&typeof t.anchor.width=="number"?t.anchor.width:0,h="height"in t.anchor&&typeof t.anchor.height=="number"?t.anchor.height:0;e={left:t.anchor.x,top:t.anchor.y,width:a,height:h}}else{const a=t.anchor.left,h=t.anchor.top,y="right"in t.anchor&&typeof t.anchor.right=="number"?t.anchor.right:void 0,x="bottom"in t.anchor&&typeof t.anchor.bottom=="number"?t.anchor.bottom:void 0,N=t.anchor.width??(y!==void 0?y-a:0),q=t.anchor.height??(x!==void 0?x-h:0);e={left:a,top:h,width:N,height:q}}const l="left"in t.viewport?t.viewport.left:0,r="top"in t.viewport?t.viewport.top:0,g=t.viewport.width,w=t.viewport.height,p=l+g,c=r+w,i=t.placement??"bottom-start";let s,m;if(i.startsWith("auto")){m=i==="auto-end"?"end":i==="auto-start"?"start":"center";const a=c-(e.top+e.height)-o,h=e.top-r-o;s=t.overlay.height+n<=a||a>=h?"bottom":"top"}else if(s=i.startsWith("bottom")?"bottom":i.startsWith("top")?"top":i.startsWith("left")?"left":"right",m=i.endsWith("-end")?"end":i.endsWith("-start")?"start":"center",s==="bottom"){const a=c-(e.top+e.height)-o,h=e.top-r-o;t.overlay.height+n>a&&h>a&&(s="top")}else if(s==="top"){const a=e.top-r-o,h=c-(e.top+e.height)-o;t.overlay.height+n>a&&h>a&&(s="bottom")}else if(s==="right"){const a=p-(e.left+e.width)-o,h=e.left-l-o;t.overlay.width+n>a&&h>a&&(s="left")}else if(s==="left"){const a=e.left-l-o,h=p-(e.left+e.width)-o;t.overlay.width+n>a&&h>a&&(s="right")}let f=0,d=0;s==="bottom"?f=e.top+e.height+n:s==="top"?f=e.top-t.overlay.height-n:s==="left"?d=e.left-t.overlay.width-n:d=e.left+e.width+n,s==="bottom"||s==="top"?m==="start"?d=e.left:m==="end"?d=e.left+e.width-t.overlay.width:d=e.left+(e.width-t.overlay.width)/2:m==="start"?f=e.top:m==="end"?f=e.top+e.height-t.overlay.height:f=e.top+(e.height-t.overlay.height)/2;const b=L(d,l+o,p-t.overlay.width-o),u=L(f,r+o,c-t.overlay.height-o);return{left:b,top:u,anchorWidth:e.width,anchorHeight:e.height,side:s,alignment:m}}const k=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'].map(t=>`${t}:not([disabled]):not([aria-disabled="true"])`).join(", "),D='[role="option"]:not([aria-disabled="true"])',Q=new Set(["ArrowDown","ArrowUp","Home","End"]);function tt(t){return Q.has(t)}function et(t,o,n){if(t===0)return-1;switch(n){case"ArrowDown":return o<0?0:(o+1)%t;case"ArrowUp":return o<0?t-1:(o-1+t)%t;case"Home":return 0;case"End":return t-1;default:return o}}const ot="vk_popover_dzAQl vk_surface_3ZOnl",nt="vk_scrollArea_cBiT4",P={popover:ot,scrollArea:nt};var rt=["<div",' class="','" style="','">',"</div>"];function it(t){const[o,n]=E.createSignal(null),[e,l]=E.createSignal(null);let r;const g=()=>typeof t.open=="function"?t.open():t.open,w=()=>{const i=t.anchor();return(i?W.ownerWindow(i):null)??t.ownerWindow??null},p=G.useOverlayRegistration(()=>g()&&o()!==null,"popover",{type:"popover",element:()=>e(),document:()=>{var i;return(i=w())==null?void 0:i.document}}),c=()=>{const i=t.anchor(),s=w();if(!i||s===null)return;const m=i.getBoundingClientRect(),f=r==null?void 0:r.querySelector('[data-overlay-scroll-viewport], [class*="viewport"]'),d=f?f.scrollHeight+Math.max(0,r.offsetHeight-f.offsetHeight):0,b=f?f.scrollWidth+Math.max(0,r.offsetWidth-f.offsetWidth):0,{left:u,top:a,anchorWidth:h,maxHeight:y}=F({anchor:{left:m.left,right:m.right,top:m.top,bottom:m.bottom,width:m.width},panelWidth:r?Math.max(r.offsetWidth,r.scrollWidth,b):0,panelHeight:r?Math.max(r.offsetHeight,r.scrollHeight,d):0,viewportWidth:s.innerWidth,viewportHeight:s.innerHeight,placement:t.placement??"bottom-start",gap:t.gap??4}),x=o();x&&x.x===u&&x.y===a&&x.w===h&&x.maxHeight===y||n({x:u,y:a,w:h,maxHeight:y})};return E.createEffect(()=>{if(!g()){n(null),l(null),r=void 0;return}const i=w(),s=t.anchor();if(i===null||!s)return;c();const m=M(s,()=>{c();const u=t.role;if(u==="menu"||u==="listbox"){const a=u==="menu"?k:D,h=r;if(h){const y=h.querySelector(a);(y??h).focus({preventScroll:!1}),y==null||y.scrollIntoView({block:"nearest"})}}}),f=u=>{var h;const a=u.target;!a||!p.isTopmostForPointer()||r!=null&&r.contains(a)||(h=t.anchor())!=null&&h.contains(a)||a instanceof Element&&a.closest('[role="listbox"], [role="menu"]')||t.onClose()},d=u=>{!$.isKey(u,"Escape")||!p.isTopmost()||(u.stopPropagation(),u.stopImmediatePropagation(),t.onClose())},b=()=>c();i.addEventListener("mousedown",f,!0),i.addEventListener("keydown",d,!0),i.addEventListener("resize",b),i.addEventListener("scroll",b,!0),E.onCleanup(()=>{m(),i.removeEventListener("mousedown",f,!0),i.removeEventListener("keydown",d,!0),i.removeEventListener("resize",b),i.removeEventListener("scroll",b,!0)})}),E.createEffect(()=>{const i=e(),s=w();if(!i||!g()||s===null)return;const m=s.ResizeObserver;if(!m)return;const f=new m(()=>{c()});f.observe(i),E.onCleanup(()=>{f.disconnect()})}),v.createComponent(E.Show,{get when(){return v.memo(()=>!!(g()&&o()))()?w():null},children:i=>v.createComponent(E.Show,{get when(){return o()},children:s=>v.createComponent(v.Portal,{get mount(){return i().document.body},get children(){return v.ssr(rt,v.ssrAttribute("role",v.escape(t.role??"dialog",!0),!1)+v.ssrAttribute("aria-label",v.escape(t.ariaLabel,!0),!1)+v.ssrAttribute("tabindex",t.role==="menu"||t.role==="listbox"?-1:v.escape(void 0,!0),!1),`${v.escape(P.popover,!0)} ${v.escape(t.class??"",!0)}`,v.ssrStyle({left:`${s().x}px`,top:`${s().y}px`,"max-height":`${s().maxHeight}px`,...t.matchAnchorWidth?{"min-width":`${s().w}px`}:{}}),v.escape(v.createComponent(E.Show,{get when(){return t.scrollable},get fallback(){return t.children},get children(){return v.createComponent(U.OverlayScrollArea,{get rootClass(){return P.scrollArea},get children(){return t.children}})}})))}})})})}exports.AnchorAlignment=R;exports.AnchorAxisAlignment=_;exports.AnchorPosition=T;exports.LISTBOX_OPTION_SELECTOR=D;exports.MENU_ITEM_SELECTOR=k;exports.OVERLAY_DEFAULT_GAP=B;exports.OVERLAY_DEFAULT_MARGIN=I;exports.POPOVER_DEFAULT_GAP=Z;exports.POPOVER_VIEWPORT_MARGIN=A;exports.Popover=it;exports.VpChevronDown=K;exports.calcFixedWidthDropdownLeft=C;exports.computeAnchoredPosition=J;exports.computeDropdownPosition=j;exports.computePopoverPosition=F;exports.isPopoverNavigationKey=tt;exports.layout2d=Y;exports.requestOwnerAnimationFrame=M;exports.resolvePopoverFocusForKey=et;exports.resolvePopoverSide=V;
|