@tempots/beatui 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-CFd5Xkva.cjs +1 -0
- package/dist/{ar-DaKbK_t8.js → ar-CZ07-PLK.js} +8 -7
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-3t_-R0sL.cjs → auth-divider-BHAbd_PS.cjs} +1 -1
- package/dist/{auth-divider-Cp3xGpHr.js → auth-divider-CvQ0TQwi.js} +7 -7
- package/dist/beatui.css +54 -0
- package/dist/beatui.tailwind.css +54 -0
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +5 -5
- package/dist/de-BJG9UqDS.cjs +1 -0
- package/dist/{de-3MTPDS1i.js → de-Dpx6i3Pv.js} +8 -7
- package/dist/{deep-merge-Da602mAN.js → deep-merge-D1cBNWZX.js} +4 -4
- package/dist/{deep-merge-Bz9HHpRt.cjs → deep-merge-DEEd-Tte.cjs} +1 -1
- package/dist/{duration-input-g-cQ3cs1.cjs → duration-input-CdgMuk2b.cjs} +1 -1
- package/dist/{duration-input-HM1i6RRY.js → duration-input-Dpqj2Am9.js} +4 -4
- package/dist/{editor-toolbar-group-Crlu1QJw.js → editor-toolbar-group-7eMZbEvH.js} +2 -2
- package/dist/{editor-toolbar-group-mkL4QozO.cjs → editor-toolbar-group-BJWRgYtv.cjs} +1 -1
- package/dist/es-BBqPUxJF.cjs +1 -0
- package/dist/{es-DwMUvBeU.js → es-apq3F_om.js} +8 -7
- package/dist/{fa-0rvQiKrJ.js → fa-BYpfIkLu.js} +8 -7
- package/dist/fa-d0o3KlIu.cjs +1 -0
- package/dist/{fr-B4i6NzLl.js → fr-Ba5_hcn7.js} +8 -7
- package/dist/fr-DzXA-sjH.cjs +1 -0
- package/dist/he-Cnx-qg1P.cjs +1 -0
- package/dist/{he-C71n-hsn.js → he-Dff_I80g.js} +8 -7
- package/dist/{hi-xmrXpeVU.js → hi-7G-frHVR.js} +8 -7
- package/dist/hi-BeJ8Q4O6.cjs +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +2736 -2755
- package/dist/{input-container-Di1YvVB_.cjs → input-container-BZwpJgx6.cjs} +1 -1
- package/dist/{input-container-BvEcp7FU.js → input-container-Q9wL2BUl.js} +1 -1
- package/dist/it-DE3pe-gS.cjs +1 -0
- package/dist/{it-CDZTtOBC.js → it-dSE5UgTZ.js} +8 -7
- package/dist/{ja-Zz1LzidW.js → ja-DRzjr2YR.js} +8 -7
- package/dist/ja-yzk8mwox.cjs +1 -0
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +10 -10
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +5 -5
- package/dist/{ko-9laUsZDL.js → ko-7gpweMh7.js} +8 -7
- package/dist/ko-rKqndOMO.cjs +1 -0
- package/dist/lexical/index.cjs.js +2 -2
- package/dist/lexical/index.es.js +1412 -1414
- package/dist/menu-B60Q9j3-.cjs +1 -0
- package/dist/menu-BkqFGcXg.js +366 -0
- package/dist/{modal-BT0jjDqX.cjs → modal-ClnvWxzi.cjs} +1 -1
- package/dist/{modal-DBguyX-b.js → modal-DXWQ-HUs.js} +3 -3
- package/dist/{nl-Dcll9fVA.js → nl-DAe4B7fb.js} +9 -8
- package/dist/nl-DKHslb-6.cjs +1 -0
- package/dist/{notice-Dtz7ADVH.js → notice-Dx4D1UOf.js} +4 -4
- package/dist/{notice-BNghd0oS.cjs → notice-dOOD80F7.cjs} +1 -1
- package/dist/{oneof-branch-detection-J_DYEEcD.js → oneof-branch-detection-B57ZDbzM.js} +1 -1
- package/dist/{oneof-branch-detection-ZUBZ6hqy.cjs → oneof-branch-detection-bQKKfV32.cjs} +1 -1
- package/dist/{pl-Dm9N9Gbr.js → pl-4xrzOC4A.js} +8 -7
- package/dist/pl-9yeqi1Kn.cjs +1 -0
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/pt-CCfVWHz4.cjs +1 -0
- package/dist/{pt-CFi5cn0k.js → pt-DYQOe1Td.js} +8 -7
- package/dist/ru-Cct0jttM.cjs +1 -0
- package/dist/{ru-CEhZUw8R.js → ru-FofxuqAJ.js} +10 -9
- package/dist/{text-input-DL9FvpTZ.cjs → text-input-CynkbBpH.cjs} +1 -1
- package/dist/{text-input-dDUEUmlC.js → text-input-DEAddaOi.js} +1 -1
- package/dist/{toolbar-DoKdYXIL.cjs → toolbar-Dz7R1kV3.cjs} +1 -1
- package/dist/{toolbar-DY0ax2Qd.js → toolbar-e9POle8o.js} +1 -1
- package/dist/{tr-ZmnVDhLP.js → tr-BfKjkfhE.js} +9 -8
- package/dist/tr-DhKxAXK0.cjs +1 -0
- package/dist/{translations-B1_yyDUK.js → translations-B96REXIk.js} +87 -86
- package/dist/translations-BDGa_4jx.cjs +1 -0
- package/dist/{translations-A4kR7CW8.js → translations-BplmL3nb.js} +1 -1
- package/dist/{translations-C81buKAw.cjs → translations-D8Jwi_d0.cjs} +1 -1
- package/dist/types/beatui-i18n/default.d.ts +1 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +1 -0
- package/dist/types/beatui-i18n/translations.d.ts +1 -0
- package/dist/types/components/data/data-table.d.ts +8 -1
- package/dist/types/components/navigation/flyout.d.ts +15 -5
- package/dist/{ur-yYgj3NmT.js → ur-COVuSAxC.js} +8 -7
- package/dist/ur-DmfFC6MV.cjs +1 -0
- package/dist/{use-form-Dn6v2tEh.js → use-form-CEY-gUUT.js} +2 -2
- package/dist/{use-form-CaW192gw.cjs → use-form-Ca0kF4af.cjs} +1 -1
- package/dist/{vi-D5u4CLQO.js → vi-DI3te8d5.js} +8 -7
- package/dist/vi-DvY-zvIr.cjs +1 -0
- package/dist/{widget-customization-YhVcA-KM.js → widget-customization-BZ8aKWRK.js} +5 -5
- package/dist/{widget-customization-DOWmUuPU.cjs → widget-customization-CHxaaaEV.cjs} +1 -1
- package/dist/zh-DJhzbpi2.cjs +1 -0
- package/dist/{zh-B0kwMMer.js → zh-DKIbNXv8.js} +9 -8
- package/package.json +1 -1
- package/dist/ar-CuI1Jgt6.cjs +0 -1
- package/dist/de-DthHehbh.cjs +0 -1
- package/dist/es-B6GJLk9h.cjs +0 -1
- package/dist/fa-BwgP93iV.cjs +0 -1
- package/dist/fr-CQzk5zqY.cjs +0 -1
- package/dist/he-DcxxvRfs.cjs +0 -1
- package/dist/hi-D-KHVWg4.cjs +0 -1
- package/dist/it-D344Dutu.cjs +0 -1
- package/dist/ja-BNgnDZ27.cjs +0 -1
- package/dist/ko-D-WJ9NK7.cjs +0 -1
- package/dist/menu-B8yoDMRS.js +0 -373
- package/dist/menu-B92oSDct.cjs +0 -1
- package/dist/nl-CrqUlFie.cjs +0 -1
- package/dist/pl-9UksIrvX.cjs +0 -1
- package/dist/pt-_kfdzwqi.cjs +0 -1
- package/dist/ru-CW1WNNlr.cjs +0 -1
- package/dist/tr-B6GIRegf.cjs +0 -1
- package/dist/translations-Dbx7L7Q1.cjs +0 -1
- package/dist/ur-CtFl_tz6.cjs +0 -1
- package/dist/vi-DyCZSpsk.cjs +0 -1
- package/dist/zh-C3ZxMQKb.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@tempots/dom"),q=require("@tempots/ui"),K=require("@tempots/std"),W=require("./use-animated-toggle-cKcuItmz.cjs"),M=require("./session-id-B5lJMzbB.cjs");function H(u){const o={fade:!0,scale:!0};return u.startsWith("top")?(o.slide="down",o.transformOrigin="bottom"):u.startsWith("bottom")?(o.slide="up",o.transformOrigin="top"):u.startsWith("left")?(o.slide="right",o.transformOrigin="right"):u.startsWith("right")&&(o.slide="left",o.transformOrigin="left"),o}function $(u){const{content:o,placement:E="top",showDelay:A=250,hideDelay:D=500,mainAxisOffset:k=8,crossAxisOffset:F=0,showOn:d="hover-focus",closable:b=!0,arrow:P,role:p,hasPopup:I="dialog",open:y}=u;return q.PopOver((g,c)=>{const s=y??e.prop(!1),l=W.useAnimatedElementToggle({initialStatus:"closed"}),L=M.sessionId("flyout");let m=null,f=null,O=!1,v;function T(){t!=null&&(clearTimeout(t),t=null),a!=null&&(clearTimeout(a),a=null),f&&(f(),f=null),m&&(document.removeEventListener("keydown",m),m=null),O=!1}function S(){e.Value.get(b)&&(m=r=>{r.key==="Escape"&&s.set(!1)},document.addEventListener("keydown",m)),O=!0,g({placement:E??"top",mainAxisOffset:k,crossAxisOffset:F,arrow:P,content:e.WithElement(r=>{l.setElement(r);const h=typeof d=="function"?null:e.Value.get(d);(h==="hover"||h==="hover-focus")&&(r.addEventListener("mouseenter",()=>s.set(!0)),r.addEventListener("mouseleave",()=>s.set(!1))),f=K.delayedAnimationFrame(()=>{l.open(),f=null});const C=x=>{e.Value.get(b)&&x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),s.set(!1))};document.addEventListener("keydown",C,!0);let V=null;return e.Value.get(b)&&(V=x=>{const _=x.target;!r.contains(_)&&!v?.contains(_)&&s.set(!1)},document.addEventListener("click",V)),e.Fragment(e.OnDispose(()=>{V&&(document.removeEventListener("click",V),V=null),T(),document.removeEventListener("keydown",C,!0)}),e.attr.class("bc-flyout-container"),W.AnimatedToggleClass({animation:e.Value.map(E,H),status:l.status}),e.attr.id(L),e.attr.tabindex(-1),e.html.div(e.attr.class("bc-flyout"),p?e.attr.role(p):e.attr.role("dialog"),o()))})})}let t=null;function n(){if(t!=null&&(clearTimeout(t),t=null),a!=null&&(clearTimeout(a),a=null),l.isOpened.value||l.isOpening.value||l.isStartOpening.value)return;if(l.isClosing.value||l.isStartClosing.value){l.open();return}const r=e.Value.get(A);t=setTimeout(()=>{t=null,S()},r)}let a=null;function i(){if(!O&&t==null)return;if(t!=null&&(clearTimeout(t),t=null),a!=null&&(clearTimeout(a),a=null),f&&(f(),f=null,O)){c(),T();return}const r=e.Value.get(D);a=setTimeout(()=>{a=null,l.close(),l.listenOnClosed(()=>{c(),T()})},r)}const w=s.onChange(r=>{r?n():i()});return s.value&&n(),e.WithElement(r=>{v=r;const h=e.Fragment(e.aria.expanded(s),e.aria.controls(L),e.aria.haspopup(I));if(typeof d=="function")return e.Fragment(e.OnDispose(w),h,d(s));const C=d;return e.Fragment(e.OnDispose(w),h,e.OneOfValue(C,{"hover-focus":()=>e.Fragment(e.on.mouseenter(()=>s.set(!0)),e.on.mouseleave(()=>s.set(!1)),e.on.focus(()=>s.set(!0)),e.on.blur(()=>s.set(!1))),hover:()=>e.Fragment(e.on.mouseenter(()=>s.set(!0)),e.on.mouseleave(()=>s.set(!1))),focus:()=>e.Fragment(e.on.focus(()=>s.set(!0)),e.on.blur(()=>s.set(!1))),click:()=>e.on.click(()=>s.set(!s.value)),never:()=>null}))})})}function z(u){const{items:o,placement:E="bottom-start",showDelay:A=0,hideDelay:D=100,mainAxisOffset:k=4,crossAxisOffset:F=0,showOn:d="click",closable:b=!0,onClose:P,onAction:p,ariaLabel:I,ariaLabelledBy:y}=u,g=M.sessionId("menu"),c=e.prop(-1),s=e.prop([]),l=e.prop(!1);let L=null;return l.onChange(m=>{m||P?.()}),$({open:l,content:()=>e.WithElement(m=>{L=document.activeElement;const f=(t,n,a)=>{if(n.length===0)return-1;let i=t+a,w=0;for(;w<n.length;){i>=n.length&&(i=0),i<0&&(i=n.length-1);const r=n[i];if(r&&r.getAttribute("aria-disabled")!=="true")return i;i+=a,w++}return t},O=t=>{const n=s.value,a=c.value;switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation();const i=f(a,n,1);v(i,n);break;case"ArrowUp":t.preventDefault(),t.stopPropagation();const w=f(a,n,-1);v(w,n);break;case"Enter":case" ":if(t.preventDefault(),t.stopPropagation(),a>=0&&n[a]){const r=n[a];if(r.getAttribute("aria-disabled")==="true")return;const h=r.getAttribute("data-key");h&&p&&p(h),r.click(),l.set(!1)}break;case"Escape":l.set(!1);break;case"Home":t.preventDefault(),t.stopPropagation(),n.length>0&&v(0,n);break;case"End":t.preventDefault(),t.stopPropagation(),n.length>0&&v(n.length-1,n);break;case"ArrowRight":if(t.preventDefault(),t.stopPropagation(),a>=0&&n[a]){const r=n[a];r.classList.contains("bc-menu-item--has-submenu")&&r.dispatchEvent(new Event("mouseenter"))}break;case"ArrowLeft":t.preventDefault(),t.stopPropagation(),l.set(!1);break}},v=(t,n)=>{c.value>=0&&n[c.value]&&(n[c.value].classList.remove("bc-menu-item--focused"),n[c.value].removeAttribute("aria-selected")),t>=0&&n[t]&&(n[t].classList.add("bc-menu-item--focused"),n[t].setAttribute("aria-selected","true"),c.set(t),typeof n[t].scrollIntoView=="function"&&n[t].scrollIntoView({block:"nearest"}))},T=()=>{const t=Array.from(m.querySelectorAll('[role="menuitem"]'));if(s.set(t),t.length>0){const n=t.findIndex(a=>a.getAttribute("aria-disabled")!=="true");n>=0&&v(n,t)}},S=new MutationObserver(T);return S.observe(m,{childList:!0,subtree:!0}),setTimeout(()=>{T(),m.focus()},0),document.addEventListener("keydown",O,!0),e.Fragment(e.OnDispose(()=>{S.disconnect(),document.removeEventListener("keydown",O,!0),L&&L.focus()}),e.attr.class("bc-menu"),e.attr.id(g),e.attr.role("menu"),e.attr.tabindex(-1),e.aria.orientation("vertical"),I?e.aria.label(I):e.Empty,y?e.aria.labelledby(y):e.Empty,e.aria.activedescendant(c.map(t=>{const n=s.value;return t>=0&&n[t]?n[t].id||`${g}-item-${t}`:""})),e.on.click(t=>{const a=t.target.closest('[role="menuitem"]');if(a&&a.getAttribute("aria-disabled")!=="true"){const i=a.getAttribute("data-key");i&&p&&p(i),l.set(!1)}}),e.html.div(e.attr.class("sr-only"),e.aria.live("polite"),e.aria.atomic(!0),c.map(t=>{const n=s.value;if(t>=0&&n[t]){const a=n[t].textContent||"";return n[t].getAttribute("aria-disabled")==="true"?`${a}, disabled`:`${a}, ${t+1} of ${n.length}`}return""})),...o())}),placement:E,showDelay:A,hideDelay:D,mainAxisOffset:k,crossAxisOffset:F,showOn:d,closable:b,role:"menu"})}function B(u){const{key:o,content:E,before:A,after:D,disabled:k=!1,onClick:F,ariaLabel:d,submenu:b,submenuPlacement:P="right-start"}=u,p=o??M.sessionId("menu-item"),I=`menu-item-${p}`,y=b!=null;return e.html.div(e.attr.class(e.computedOf(k)(g=>`bc-menu-item ${g?"bc-menu-item--disabled":""} ${y?"bc-menu-item--has-submenu":""}`)),e.attr.id(I),e.attr.role("menuitem"),e.attr.tabindex(-1),e.dataAttr("key",p),e.aria.disabled(k),e.aria.selected(!1),y?e.aria.expanded(!1):e.Empty,d?e.aria.label(d):e.Empty,e.on.click(g=>{if(e.Value.get(k)){g.preventDefault(),g.stopPropagation();return}F?.()}),A&&e.html.span(e.attr.class("bc-menu-item__start"),A),e.html.span(e.attr.class("bc-menu-item__content"),E),D&&e.html.span(e.attr.class("bc-menu-item__end"),D),y&&b?$({content:()=>e.Fragment(e.attr.class("bc-menu bc-submenu"),e.attr.role("menu"),...b()),placement:P,showOn:"hover",hasPopup:"menu",showDelay:100,hideDelay:300,mainAxisOffset:0,crossAxisOffset:0,role:"menu"}):e.Empty)}function N(u={}){const{label:o}=u;return e.html.div(e.attr.class("bc-menu-separator"),e.attr.role("separator"),e.aria.orientation("horizontal"),o&&e.html.span(e.attr.class("bc-menu-separator__label"),o))}exports.Flyout=$;exports.Menu=z;exports.MenuItem=B;exports.MenuSeparator=N;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { prop as q, WithElement as B, Fragment as k, aria as u, OnDispose as z, OneOfValue as j, on as p, Value as A, attr as a, html as E, Empty as W, computedOf as G, dataAttr as J } from "@tempots/dom";
|
|
2
|
+
import { PopOver as Q } from "@tempots/ui";
|
|
3
|
+
import { delayedAnimationFrame as X } from "@tempots/std";
|
|
4
|
+
import { u as Y, A as Z } from "./use-animated-toggle-C3asw_Sg.js";
|
|
5
|
+
import { s as N } from "./session-id-3KiilioY.js";
|
|
6
|
+
function ee(c) {
|
|
7
|
+
const l = { fade: !0, scale: !0 };
|
|
8
|
+
return c.startsWith("top") ? (l.slide = "down", l.transformOrigin = "bottom") : c.startsWith("bottom") ? (l.slide = "up", l.transformOrigin = "top") : c.startsWith("left") ? (l.slide = "right", l.transformOrigin = "right") : c.startsWith("right") && (l.slide = "left", l.transformOrigin = "left"), l;
|
|
9
|
+
}
|
|
10
|
+
function U(c) {
|
|
11
|
+
const {
|
|
12
|
+
content: l,
|
|
13
|
+
placement: T = "top",
|
|
14
|
+
showDelay: P = 250,
|
|
15
|
+
hideDelay: x = 500,
|
|
16
|
+
mainAxisOffset: D = 8,
|
|
17
|
+
crossAxisOffset: _ = 0,
|
|
18
|
+
showOn: b = "hover-focus",
|
|
19
|
+
closable: h = !0,
|
|
20
|
+
arrow: F,
|
|
21
|
+
role: g,
|
|
22
|
+
hasPopup: C = "dialog",
|
|
23
|
+
open: w
|
|
24
|
+
} = c;
|
|
25
|
+
return Q((v, f) => {
|
|
26
|
+
const s = w ?? q(!1), r = Y({
|
|
27
|
+
initialStatus: "closed"
|
|
28
|
+
}), S = N("flyout");
|
|
29
|
+
let m = null, d = null, I = !1, O;
|
|
30
|
+
function $() {
|
|
31
|
+
e != null && (clearTimeout(e), e = null), n != null && (clearTimeout(n), n = null), d && (d(), d = null), m && (document.removeEventListener("keydown", m), m = null), I = !1;
|
|
32
|
+
}
|
|
33
|
+
function K() {
|
|
34
|
+
A.get(h) && (m = (o) => {
|
|
35
|
+
o.key === "Escape" && s.set(!1);
|
|
36
|
+
}, document.addEventListener("keydown", m)), I = !0, v({
|
|
37
|
+
placement: T ?? "top",
|
|
38
|
+
mainAxisOffset: D,
|
|
39
|
+
crossAxisOffset: _,
|
|
40
|
+
arrow: F,
|
|
41
|
+
content: B((o) => {
|
|
42
|
+
r.setElement(o);
|
|
43
|
+
const y = typeof b == "function" ? null : A.get(b);
|
|
44
|
+
(y === "hover" || y === "hover-focus") && (o.addEventListener("mouseenter", () => s.set(!0)), o.addEventListener("mouseleave", () => s.set(!1))), d = X(() => {
|
|
45
|
+
r.open(), d = null;
|
|
46
|
+
});
|
|
47
|
+
const H = (V) => {
|
|
48
|
+
A.get(h) && V.key === "Escape" && (V.preventDefault(), V.stopPropagation(), s.set(!1));
|
|
49
|
+
};
|
|
50
|
+
document.addEventListener("keydown", H, !0);
|
|
51
|
+
let M = null;
|
|
52
|
+
return A.get(h) && (M = (V) => {
|
|
53
|
+
const R = V.target;
|
|
54
|
+
!o.contains(R) && !O?.contains(R) && s.set(!1);
|
|
55
|
+
}, document.addEventListener("click", M)), k(
|
|
56
|
+
z(() => {
|
|
57
|
+
M && (document.removeEventListener("click", M), M = null), $(), document.removeEventListener("keydown", H, !0);
|
|
58
|
+
}),
|
|
59
|
+
a.class("bc-flyout-container"),
|
|
60
|
+
Z({
|
|
61
|
+
animation: A.map(T, ee),
|
|
62
|
+
status: r.status
|
|
63
|
+
}),
|
|
64
|
+
a.id(S),
|
|
65
|
+
a.tabindex(-1),
|
|
66
|
+
// Make focusable for screen readers
|
|
67
|
+
E.div(
|
|
68
|
+
a.class("bc-flyout"),
|
|
69
|
+
g ? a.role(g) : a.role("dialog"),
|
|
70
|
+
// Default to dialog role
|
|
71
|
+
l()
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
let e = null;
|
|
78
|
+
function t() {
|
|
79
|
+
if (e != null && (clearTimeout(e), e = null), n != null && (clearTimeout(n), n = null), r.isOpened.value || r.isOpening.value || r.isStartOpening.value)
|
|
80
|
+
return;
|
|
81
|
+
if (r.isClosing.value || r.isStartClosing.value) {
|
|
82
|
+
r.open();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const o = A.get(P);
|
|
86
|
+
e = setTimeout(() => {
|
|
87
|
+
e = null, K();
|
|
88
|
+
}, o);
|
|
89
|
+
}
|
|
90
|
+
let n = null;
|
|
91
|
+
function i() {
|
|
92
|
+
if (!I && e == null)
|
|
93
|
+
return;
|
|
94
|
+
if (e != null && (clearTimeout(e), e = null), n != null && (clearTimeout(n), n = null), d && (d(), d = null, I)) {
|
|
95
|
+
f(), $();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const o = A.get(x);
|
|
99
|
+
n = setTimeout(() => {
|
|
100
|
+
n = null, r.close(), r.listenOnClosed(() => {
|
|
101
|
+
f(), $();
|
|
102
|
+
});
|
|
103
|
+
}, o);
|
|
104
|
+
}
|
|
105
|
+
const L = s.onChange((o) => {
|
|
106
|
+
o ? t() : i();
|
|
107
|
+
});
|
|
108
|
+
return s.value && t(), B((o) => {
|
|
109
|
+
O = o;
|
|
110
|
+
const y = k(
|
|
111
|
+
u.expanded(s),
|
|
112
|
+
u.controls(S),
|
|
113
|
+
u.haspopup(
|
|
114
|
+
C
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
if (typeof b == "function")
|
|
118
|
+
return k(
|
|
119
|
+
z(L),
|
|
120
|
+
y,
|
|
121
|
+
b(s)
|
|
122
|
+
);
|
|
123
|
+
const H = b;
|
|
124
|
+
return k(
|
|
125
|
+
z(L),
|
|
126
|
+
y,
|
|
127
|
+
j(H, {
|
|
128
|
+
"hover-focus": () => k(
|
|
129
|
+
p.mouseenter(() => s.set(!0)),
|
|
130
|
+
p.mouseleave(() => s.set(!1)),
|
|
131
|
+
p.focus(() => s.set(!0)),
|
|
132
|
+
p.blur(() => s.set(!1))
|
|
133
|
+
),
|
|
134
|
+
hover: () => k(
|
|
135
|
+
p.mouseenter(() => s.set(!0)),
|
|
136
|
+
p.mouseleave(() => s.set(!1))
|
|
137
|
+
),
|
|
138
|
+
focus: () => k(
|
|
139
|
+
p.focus(() => s.set(!0)),
|
|
140
|
+
p.blur(() => s.set(!1))
|
|
141
|
+
),
|
|
142
|
+
click: () => p.click(() => s.set(!s.value)),
|
|
143
|
+
never: () => null
|
|
144
|
+
})
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function le(c) {
|
|
150
|
+
const {
|
|
151
|
+
items: l,
|
|
152
|
+
placement: T = "bottom-start",
|
|
153
|
+
showDelay: P = 0,
|
|
154
|
+
hideDelay: x = 100,
|
|
155
|
+
mainAxisOffset: D = 4,
|
|
156
|
+
crossAxisOffset: _ = 0,
|
|
157
|
+
showOn: b = "click",
|
|
158
|
+
closable: h = !0,
|
|
159
|
+
onClose: F,
|
|
160
|
+
onAction: g,
|
|
161
|
+
ariaLabel: C,
|
|
162
|
+
ariaLabelledBy: w
|
|
163
|
+
} = c, v = N("menu"), f = q(-1), s = q([]), r = q(!1);
|
|
164
|
+
let S = null;
|
|
165
|
+
return r.onChange((m) => {
|
|
166
|
+
m || F?.();
|
|
167
|
+
}), U({
|
|
168
|
+
open: r,
|
|
169
|
+
content: () => B((m) => {
|
|
170
|
+
S = document.activeElement;
|
|
171
|
+
const d = (e, t, n) => {
|
|
172
|
+
if (t.length === 0) return -1;
|
|
173
|
+
let i = e + n, L = 0;
|
|
174
|
+
for (; L < t.length; ) {
|
|
175
|
+
i >= t.length && (i = 0), i < 0 && (i = t.length - 1);
|
|
176
|
+
const o = t[i];
|
|
177
|
+
if (o && o.getAttribute("aria-disabled") !== "true")
|
|
178
|
+
return i;
|
|
179
|
+
i += n, L++;
|
|
180
|
+
}
|
|
181
|
+
return e;
|
|
182
|
+
}, I = (e) => {
|
|
183
|
+
const t = s.value, n = f.value;
|
|
184
|
+
switch (e.key) {
|
|
185
|
+
case "ArrowDown":
|
|
186
|
+
e.preventDefault(), e.stopPropagation();
|
|
187
|
+
const i = d(n, t, 1);
|
|
188
|
+
O(i, t);
|
|
189
|
+
break;
|
|
190
|
+
case "ArrowUp":
|
|
191
|
+
e.preventDefault(), e.stopPropagation();
|
|
192
|
+
const L = d(n, t, -1);
|
|
193
|
+
O(L, t);
|
|
194
|
+
break;
|
|
195
|
+
case "Enter":
|
|
196
|
+
case " ":
|
|
197
|
+
if (e.preventDefault(), e.stopPropagation(), n >= 0 && t[n]) {
|
|
198
|
+
const o = t[n];
|
|
199
|
+
if (o.getAttribute("aria-disabled") === "true")
|
|
200
|
+
return;
|
|
201
|
+
const y = o.getAttribute("data-key");
|
|
202
|
+
y && g && g(y), o.click(), r.set(!1);
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case "Escape":
|
|
206
|
+
r.set(!1);
|
|
207
|
+
break;
|
|
208
|
+
case "Home":
|
|
209
|
+
e.preventDefault(), e.stopPropagation(), t.length > 0 && O(0, t);
|
|
210
|
+
break;
|
|
211
|
+
case "End":
|
|
212
|
+
e.preventDefault(), e.stopPropagation(), t.length > 0 && O(t.length - 1, t);
|
|
213
|
+
break;
|
|
214
|
+
case "ArrowRight":
|
|
215
|
+
if (e.preventDefault(), e.stopPropagation(), n >= 0 && t[n]) {
|
|
216
|
+
const o = t[n];
|
|
217
|
+
o.classList.contains(
|
|
218
|
+
"bc-menu-item--has-submenu"
|
|
219
|
+
) && o.dispatchEvent(new Event("mouseenter"));
|
|
220
|
+
}
|
|
221
|
+
break;
|
|
222
|
+
case "ArrowLeft":
|
|
223
|
+
e.preventDefault(), e.stopPropagation(), r.set(!1);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}, O = (e, t) => {
|
|
227
|
+
f.value >= 0 && t[f.value] && (t[f.value].classList.remove(
|
|
228
|
+
"bc-menu-item--focused"
|
|
229
|
+
), t[f.value].removeAttribute("aria-selected")), e >= 0 && t[e] && (t[e].classList.add("bc-menu-item--focused"), t[e].setAttribute("aria-selected", "true"), f.set(e), typeof t[e].scrollIntoView == "function" && t[e].scrollIntoView({ block: "nearest" }));
|
|
230
|
+
}, $ = () => {
|
|
231
|
+
const e = Array.from(
|
|
232
|
+
m.querySelectorAll('[role="menuitem"]')
|
|
233
|
+
);
|
|
234
|
+
if (s.set(e), e.length > 0) {
|
|
235
|
+
const t = e.findIndex(
|
|
236
|
+
(n) => n.getAttribute("aria-disabled") !== "true"
|
|
237
|
+
);
|
|
238
|
+
t >= 0 && O(t, e);
|
|
239
|
+
}
|
|
240
|
+
}, K = new MutationObserver($);
|
|
241
|
+
return K.observe(m, { childList: !0, subtree: !0 }), setTimeout(() => {
|
|
242
|
+
$(), m.focus();
|
|
243
|
+
}, 0), document.addEventListener("keydown", I, !0), k(
|
|
244
|
+
z(() => {
|
|
245
|
+
K.disconnect(), document.removeEventListener("keydown", I, !0), S && S.focus();
|
|
246
|
+
}),
|
|
247
|
+
a.class("bc-menu"),
|
|
248
|
+
a.id(v),
|
|
249
|
+
a.role("menu"),
|
|
250
|
+
a.tabindex(-1),
|
|
251
|
+
u.orientation("vertical"),
|
|
252
|
+
C ? u.label(C) : W,
|
|
253
|
+
w ? u.labelledby(w) : W,
|
|
254
|
+
u.activedescendant(
|
|
255
|
+
f.map((e) => {
|
|
256
|
+
const t = s.value;
|
|
257
|
+
return e >= 0 && t[e] ? t[e].id || `${v}-item-${e}` : "";
|
|
258
|
+
})
|
|
259
|
+
),
|
|
260
|
+
p.click((e) => {
|
|
261
|
+
const n = e.target.closest('[role="menuitem"]');
|
|
262
|
+
if (n && n.getAttribute("aria-disabled") !== "true") {
|
|
263
|
+
const i = n.getAttribute("data-key");
|
|
264
|
+
i && g && g(i), r.set(!1);
|
|
265
|
+
}
|
|
266
|
+
}),
|
|
267
|
+
// Live region for screen reader announcements
|
|
268
|
+
E.div(
|
|
269
|
+
a.class("sr-only"),
|
|
270
|
+
u.live("polite"),
|
|
271
|
+
u.atomic(!0),
|
|
272
|
+
f.map((e) => {
|
|
273
|
+
const t = s.value;
|
|
274
|
+
if (e >= 0 && t[e]) {
|
|
275
|
+
const n = t[e].textContent || "";
|
|
276
|
+
return t[e].getAttribute("aria-disabled") === "true" ? `${n}, disabled` : `${n}, ${e + 1} of ${t.length}`;
|
|
277
|
+
}
|
|
278
|
+
return "";
|
|
279
|
+
})
|
|
280
|
+
),
|
|
281
|
+
...l()
|
|
282
|
+
);
|
|
283
|
+
}),
|
|
284
|
+
placement: T,
|
|
285
|
+
showDelay: P,
|
|
286
|
+
hideDelay: x,
|
|
287
|
+
mainAxisOffset: D,
|
|
288
|
+
crossAxisOffset: _,
|
|
289
|
+
showOn: b,
|
|
290
|
+
closable: h,
|
|
291
|
+
role: "menu"
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
function re(c) {
|
|
295
|
+
const {
|
|
296
|
+
key: l,
|
|
297
|
+
content: T,
|
|
298
|
+
before: P,
|
|
299
|
+
after: x,
|
|
300
|
+
disabled: D = !1,
|
|
301
|
+
onClick: _,
|
|
302
|
+
ariaLabel: b,
|
|
303
|
+
submenu: h,
|
|
304
|
+
submenuPlacement: F = "right-start"
|
|
305
|
+
} = c, g = l ?? N("menu-item"), C = `menu-item-${g}`, w = h != null;
|
|
306
|
+
return E.div(
|
|
307
|
+
a.class(
|
|
308
|
+
G(D)(
|
|
309
|
+
(v) => `bc-menu-item ${v ? "bc-menu-item--disabled" : ""} ${w ? "bc-menu-item--has-submenu" : ""}`
|
|
310
|
+
)
|
|
311
|
+
),
|
|
312
|
+
a.id(C),
|
|
313
|
+
a.role("menuitem"),
|
|
314
|
+
a.tabindex(-1),
|
|
315
|
+
J("key", g),
|
|
316
|
+
u.disabled(D),
|
|
317
|
+
u.selected(!1),
|
|
318
|
+
// Will be updated by focus management
|
|
319
|
+
w ? u.expanded(!1) : W,
|
|
320
|
+
b ? u.label(b) : W,
|
|
321
|
+
p.click((v) => {
|
|
322
|
+
if (A.get(D)) {
|
|
323
|
+
v.preventDefault(), v.stopPropagation();
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
_?.();
|
|
327
|
+
}),
|
|
328
|
+
// Before content
|
|
329
|
+
P && E.span(a.class("bc-menu-item__start"), P),
|
|
330
|
+
// Main content
|
|
331
|
+
E.span(a.class("bc-menu-item__content"), T),
|
|
332
|
+
// After content
|
|
333
|
+
x && E.span(a.class("bc-menu-item__end"), x),
|
|
334
|
+
// Submenu (if present)
|
|
335
|
+
w && h ? U({
|
|
336
|
+
content: () => k(
|
|
337
|
+
a.class("bc-menu bc-submenu"),
|
|
338
|
+
a.role("menu"),
|
|
339
|
+
...h()
|
|
340
|
+
),
|
|
341
|
+
placement: F,
|
|
342
|
+
showOn: "hover",
|
|
343
|
+
hasPopup: "menu",
|
|
344
|
+
showDelay: 100,
|
|
345
|
+
hideDelay: 300,
|
|
346
|
+
mainAxisOffset: 0,
|
|
347
|
+
crossAxisOffset: 0,
|
|
348
|
+
role: "menu"
|
|
349
|
+
}) : W
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
function ie(c = {}) {
|
|
353
|
+
const { label: l } = c;
|
|
354
|
+
return E.div(
|
|
355
|
+
a.class("bc-menu-separator"),
|
|
356
|
+
a.role("separator"),
|
|
357
|
+
u.orientation("horizontal"),
|
|
358
|
+
l && E.span(a.class("bc-menu-separator__label"), l)
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
export {
|
|
362
|
+
U as F,
|
|
363
|
+
le as M,
|
|
364
|
+
re as a,
|
|
365
|
+
ie as b
|
|
366
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("@tempots/dom"),M=require("./use-animated-toggle-cKcuItmz.cjs"),S=require("@tempots/std"),D=require("./session-id-B5lJMzbB.cjs"),q=require("./translations-
|
|
1
|
+
"use strict";const n=require("@tempots/dom"),M=require("./use-animated-toggle-cKcuItmz.cjs"),S=require("@tempots/std"),D=require("./session-id-B5lJMzbB.cjs"),q=require("./translations-BDGa_4jx.cjs"),j=require("./use-form-Ca0kF4af.cjs"),B=require("./input-container-BZwpJgx6.cjs"),W=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","details[open]"].join(", ");function _(u){return Array.from(u.querySelectorAll(W)).filter(e=>{const s=e;return s.offsetWidth>0&&s.offsetHeight>0&&!s.hasAttribute("inert")&&window.getComputedStyle(s).visibility!=="hidden"})}function V(u={}){const{active:e=!0,escapeDeactivates:s=!0,onEscape:t,initialFocus:a,returnFocus:i,clickOutsideDeactivates:c=!1,onClickOutside:d}=u;return n.WithElement(g=>{let h=e,f=null,l=[],b=null,p=null,m=null;typeof document<"u"&&(f=document.activeElement);const y=()=>{l=_(g)},C=r=>{if(h){if(s&&r.key==="Escape"){r.preventDefault(),t?.();return}if(r.key==="Tab"){if(y(),l.length===0){r.preventDefault();return}const o=l.indexOf(document.activeElement);r.shiftKey?o<=0&&(r.preventDefault(),l[l.length-1]?.focus()):o>=l.length-1&&(r.preventDefault(),l[0]?.focus())}}},v=r=>{if(!h||!c)return;const o=r.target;g.contains(o)||d?.()},x=()=>{if(!h)return;y();let r=null;typeof a=="function"?r=a():a?r=a:l.length>0&&(r=l[0]),r&&(p=setTimeout(()=>{p=null,r?.focus()},50)),document.addEventListener("keydown",C,!0),c&&document.addEventListener("click",v,!0)},w=()=>{h=!1,document.removeEventListener("keydown",C,!0),document.removeEventListener("click",v,!0);let r=null;typeof i=="function"?r=i():i?r=i:f&&(r=f),r&&document.body.contains(r)&&(m=setTimeout(()=>{m=null,r?.focus()},0))};return b=setTimeout(()=>{b=null,x()},0),n.OnDispose(()=>{b!=null&&clearTimeout(b),p!=null&&clearTimeout(p),m!=null&&clearTimeout(m),w()})})}function P(u={}){return{activate:()=>V({...u,active:!0}),deactivate:()=>V({...u,active:!1})}}function I(u){return{"~standard":{version:1,vendor:"beatui-custom",validate:s=>{const t=u.validate(s);return t.success?{value:t.data}:{issues:t.errors.map(a=>({message:a.message,path:a.path}))}},types:void 0},safeParse:s=>{const t=u.validate(s);return t.success?{success:!0,data:t.data}:{success:!1,error:{errors:t.errors.map(a=>({message:a.message,path:a.path?.map(i=>typeof i=="object"&&"key"in i?i.key.toString():i.toString())||[]}))}}}}}class k{optional(){return new U(this)}default(e){return new z(this,e)}schema(){return I(this)}}class E extends k{minLength;maxLength;pattern;customValidations=[];validate(e){if(typeof e!="string")return{success:!1,errors:[{message:"Expected string"}]};const s=[];this.minLength!==void 0&&e.length<this.minLength&&s.push({message:`Must be at least ${this.minLength} characters`}),this.maxLength!==void 0&&e.length>this.maxLength&&s.push({message:`Must be at most ${this.maxLength} characters`}),this.pattern&&!this.pattern.test(e)&&s.push({message:"Invalid format"});for(const t of this.customValidations){const a=t(e);a&&s.push({message:a})}return s.length>0?{success:!1,errors:s}:{success:!0,data:e}}min(e,s){const t=new E;return t.minLength=e,t.maxLength=this.maxLength,t.pattern=this.pattern,t.customValidations=[...this.customValidations],s&&t.customValidations.push(a=>a.length<e?s:null),t}max(e,s){const t=new E;return t.minLength=this.minLength,t.maxLength=e,t.pattern=this.pattern,t.customValidations=[...this.customValidations],s&&t.customValidations.push(a=>a.length>e?s:null),t}regex(e,s){const t=new E;return t.minLength=this.minLength,t.maxLength=this.maxLength,t.pattern=e,t.customValidations=[...this.customValidations],s&&t.customValidations.push(a=>e.test(a)?null:s),t}email(e="Please enter a valid email address"){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,t=new E;return t.minLength=this.minLength,t.maxLength=this.maxLength,t.pattern=this.pattern,t.customValidations=[...this.customValidations,a=>s.test(a)?null:e],t}refine(e){const s=new E;return s.minLength=this.minLength,s.maxLength=this.maxLength,s.pattern=this.pattern,s.customValidations=[...this.customValidations,e],s}}class T extends k{mustBeTrue=!1;trueMessage;validate(e){return typeof e!="boolean"?{success:!1,errors:[{message:"Expected boolean"}]}:this.mustBeTrue&&e!==!0?{success:!1,errors:[{message:this.trueMessage||"Must be true"}]}:{success:!0,data:e}}refine(e,s){const t=new T;t.mustBeTrue=this.mustBeTrue,t.trueMessage=this.trueMessage;const a=t.validate.bind(t);return t.validate=i=>{const c=a(i);return c.success?e(c.data)?c:{success:!1,errors:[{message:s}]}:c},t}literal(e,s){const t=new T;return t.mustBeTrue=!0,t.trueMessage=s,t}}class U extends k{constructor(e){super(),this.inner=e}validate(e){if(e===void 0)return{success:!0,data:void 0};const s=this.inner.validate(e);return s.success?{success:!0,data:s.data}:{success:!1,errors:s.errors}}}class z extends k{constructor(e,s){super(),this.inner=e,this.defaultValue=s}validate(e){return e===void 0?{success:!0,data:this.defaultValue}:this.inner.validate(e)}}class F extends k{constructor(e){super(),this.shape=e}validate(e){if(typeof e!="object"||e===null||Array.isArray(e))return{success:!1,errors:[{message:"Expected object"}]};const s=e,t={},a=[];for(const[i,c]of Object.entries(this.shape)){const d=c.validate(s[i]);if(d.success)t[i]=d.data;else for(const g of d.errors)a.push({message:g.message,path:[i,...g.path||[]]})}return a.length>0?{success:!1,errors:a}:{success:!0,data:t}}refine(e,s){const t=new F(this.shape),a=t.validate.bind(t);return t.validate=i=>{const c=a(i);if(!c.success)return c;const d=e(c.data);return d?{success:!1,errors:[{message:d,path:s?.path}]}:{success:!0,data:c.data}},t}}const R=()=>new E,H=()=>new T,K=u=>new F(u);function O(u){return n.WithBrowserCtx(e=>{const s=[],t=()=>s.forEach(i=>i());return u(({effect:i="opaque",mode:c="capturing",onClickOutside:d,onEscape:g,content:h,container:f="body"})=>{f==="body"&&(e=e.makePortal("body"));const l=M.useAnimatedElementToggle();l.listenOnClosed(t);let b=()=>{},p=()=>{};const m=r=>{r.key==="Escape"&&(g?.(),l.close())},y=()=>{d?.(),l.close()},C=r=>{b(),p(),r==="capturing"?(document.addEventListener("keydown",m),b=()=>document.removeEventListener("keydown",m),e.element.addEventListener("mousedown",y),p=()=>e.element.removeEventListener("mousedown",y)):(b=()=>{},p=()=>{})},v=n.Value.on(c,C);s.push(v),s.push(()=>{l.dispose(),b(),p()});const x=()=>{const r=new Set;for(const o of e.element.querySelectorAll(":scope > :not([data-overlay])"))o.hasAttribute("inert")?r.add(o):o.setAttribute("inert","");return s.push(()=>{for(const o of e.element.querySelectorAll(":scope > :not([data-overlay])"))r.has(o)||o.removeAttribute("inert");r.clear()}),document.activeElement?.blur?.(),n.html.div(n.WithElement(o=>l.setElement(o)),n.dataAttr("status",l.status.map(String)),n.dataAttr("overlay","true"),n.attr.class(n.computedOf(i??"opaque",c)((o,L)=>`bc-overlay bc-overlay--container-${f} bc-overlay--effect-${o} bc-overlay--mode-${L}`)),h)},w=n.render(x(),e.element,{disposeWithParent:!0,clear:!1,providers:e.providers});s.push(w),S.delayedAnimationFrame(()=>l.open())},t)})}function $(u,e){const{size:s="md",dismissable:t=!0,showCloseButton:a=!0,onClose:i,overlayEffect:c="opaque",container:d="body",position:g="center"}=u;return O((h,f)=>{let l=()=>{};return e(m=>{l=f;const y=n.prop("capturing");n.Value.on(t,o=>{y.set(o?"capturing":"non-capturing")});const C=n.computedOf(m.header!=null,a)((o,L)=>o||L),v=D.sessionId("modal"),x=`${v}-header`,w=`${v}-body`,r=n.html.div(n.attr.class(n.computedOf(s,g)((o,L)=>`bc-modal bc-modal--size-${o} bc-modal--container-${d} bc-modal--position-${L}`)),n.attr.role("dialog"),n.aria.modal(!0),...m.header?[n.aria.labelledby(x)]:[],n.aria.describedby(w),n.attr.tabindex(-1),n.attr.id(v),n.dataAttr("focus-trap","true"),n.on.mousedown(o=>o.stopPropagation()),V({escapeDeactivates:!1,initialFocus:()=>{const o=document.getElementById(v);if(!o)return null;const L=o.querySelector('[aria-label="Close modal"]');if(L)return L;const A=o.querySelector('button, input, select, textarea, [tabindex]:not([tabindex="-1"])');return A||o}}),n.html.div(n.attr.class("bc-modal__content"),n.When(C,()=>n.html.div(n.attr.class("bc-modal__header"),n.html.div(n.attr.class("bc-modal__title"),...m.header?[n.attr.id(x)]:[],m.header),n.When(a,()=>n.Use(q.BeatUII18n,o=>j.CloseButton({size:"sm",label:o.$.closeModal,onClick:()=>{l(),f()}}))))),n.html.div(n.attr.class("bc-modal__body"),n.attr.id(w),m.body),m.footer&&n.html.div(n.attr.class("bc-modal__footer"),m.footer)));h({mode:y,effect:c??"opaque",container:d,content:r,onClickOutside:()=>{i?.(),f()},onEscape:()=>{i?.(),f()}})},()=>{l(),f()})})}function G(u,e){const{confirmText:s,cancelText:t,onConfirm:a,onCancel:i,...c}=u;return n.Use(q.BeatUII18n,d=>$({showCloseButton:!1,...c},(g,h)=>{const f=()=>{a?.(),h()},l=()=>{i?.(),h()};return e(p=>{g({body:p,footer:n.Fragment(n.attr.class("bc-modal__actions"),B.Button({variant:"outline",onClick:l},n.coalesce(t,d.$.cancel)),B.Button({color:"primary",variant:"filled",onClick:f},n.coalesce(s,d.$.confirm)))})},h)}))}exports.BooleanValidator=T;exports.ConfirmModal=G;exports.FocusTrap=V;exports.Modal=$;exports.ObjectValidator=F;exports.Overlay=O;exports.StringValidator=E;exports.boolean=H;exports.createStandardSchema=I;exports.object=K;exports.string=R;exports.useFocusTrap=P;
|
|
@@ -2,9 +2,9 @@ import { WithElement as q, OnDispose as W, WithBrowserCtx as z, Value as j, rend
|
|
|
2
2
|
import { u as G } from "./use-animated-toggle-C3asw_Sg.js";
|
|
3
3
|
import { delayedAnimationFrame as J } from "@tempots/std";
|
|
4
4
|
import { s as N } from "./session-id-3KiilioY.js";
|
|
5
|
-
import { B as P } from "./translations-
|
|
6
|
-
import { C as Q } from "./use-form-
|
|
7
|
-
import { B as D } from "./input-container-
|
|
5
|
+
import { B as P } from "./translations-B96REXIk.js";
|
|
6
|
+
import { C as Q } from "./use-form-CEY-gUUT.js";
|
|
7
|
+
import { B as D } from "./input-container-Q9wL2BUl.js";
|
|
8
8
|
const X = [
|
|
9
9
|
"a[href]",
|
|
10
10
|
"button:not([disabled])",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as
|
|
1
|
+
import { f as i } from "./translations-B96REXIk.js";
|
|
2
2
|
const s = {
|
|
3
3
|
loadingExtended: "Laden, even geduld",
|
|
4
4
|
loadingShort: "Laden...",
|
|
@@ -59,21 +59,22 @@ const s = {
|
|
|
59
59
|
clearValue: "Waarde wissen",
|
|
60
60
|
unknownType: "Onbekend type",
|
|
61
61
|
filesInputInstructions: (e, n, t) => {
|
|
62
|
-
let
|
|
62
|
+
let l = e == null || e > 1 ? "Klik om te kiezen of sleep bestanden hierheen" : "Klik om te kiezen of sleep een bestand hierheen";
|
|
63
63
|
if (e || n) {
|
|
64
|
-
const
|
|
65
|
-
if (e != null && e > 1 &&
|
|
66
|
-
const
|
|
64
|
+
const o = [];
|
|
65
|
+
if (e != null && e > 1 && o.push(`tot ${e} bestanden`), n && t) {
|
|
66
|
+
const a = i(n, {
|
|
67
67
|
units: t
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
o.push(`max ${a} elk`);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
o.length > 0 && (l += ` (${o.join(", ")})`);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return l;
|
|
74
74
|
},
|
|
75
75
|
// Pagination
|
|
76
76
|
paginationLabel: "Paginering",
|
|
77
|
+
paginationRange: (e, n, t, l) => l > t ? `Rijen ${e} tot ${n} van ${t} van ${l}` : `Rijen ${e} tot ${n} van ${t}`,
|
|
77
78
|
firstPage: "Eerste pagina",
|
|
78
79
|
previousPage: "Vorige pagina",
|
|
79
80
|
nextPage: "Volgende pagina",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-BDGa_4jx.cjs"),i={loadingExtended:"Laden, even geduld",loadingShort:"Laden...",locale:"Landinstelling",iconDescription:"Pictogram",loadingIcon:"Laadpictogram",failedToLoadIcon:"Pictogram laden mislukt",editLabel:"Bewerken",selectOne:"Selecteer een",selectNone:"Geen",selectMany:"Selecteer meerdere",noResults:"Geen resultaten",passwordPlaceholderText:"Geheim wachtwoord",togglePasswordVisibility:"Wachtwoord zichtbaarheid wisselen",toggleMenu:"Menu wisselen",toggleAside:"Zijpaneel wisselen",mainNavigation:"Hoofdnavigatie",sidebar:"Zijbalk",closeDrawer:"Lade sluiten",closeModal:"Modaal sluiten",confirm:"Bevestigen",cancel:"Annuleren",addLabel:"Toevoegen",removeItem:"Item verwijderen",currentLocale:"Nederlands",ar:"Arabisch",de:"Duits",en:"Engels",es:"Spaans",fr:"Frans",hi:"Hindi",it:"Italiaans",ja:"Japans",ko:"Koreaans",nl:"Nederlands",pl:"Pools",pt:"Portugees",ru:"Russisch",tr:"Turks",vi:"Vietnamees",zh:"Chinees",he:"Hebreeuws",fa:"Perzisch",ur:"Urdu",emailPlaceholderText:"Voer je e-mail in",incrementValue:"Waarde verhogen",decrementValue:"Waarde verlagen",dropZoneInstructions:e=>e?"Klik om te kiezen of sleep bestanden hierheen, of druk op Enter of Spatie om bestandskiezer te openen":"Sleep bestanden hierheen",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Bestand verwijderen",clearAllFiles:"Alle bestanden wissen",clearValue:"Waarde wissen",unknownType:"Onbekend type",filesInputInstructions:(e,n,t)=>{let l=e==null||e>1?"Klik om te kiezen of sleep bestanden hierheen":"Klik om te kiezen of sleep een bestand hierheen";if(e||n){const o=[];if(e!=null&&e>1&&o.push(`tot ${e} bestanden`),n&&t){const a=r.formatFileSize(n,{units:t});o.push(`max ${a} elk`)}o.length>0&&(l+=` (${o.join(", ")})`)}return l},paginationLabel:"Paginering",paginationRange:(e,n,t,l)=>l>t?`Rijen ${e} tot ${n} van ${t} van ${l}`:`Rijen ${e} tot ${n} van ${t}`,firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",breadcrumbs:"Kruimelpad",commandPalette:"Opdrachtenpalet",typeACommand:"Typ een opdracht...",noResultsFound:"Geen resultaten gevonden",noMatchingCommands:"Geen overeenkomende opdrachten",appearanceSystem:"Systeem",appearanceLight:"Licht",appearanceDark:"Donker",ok:"OK",changeTypeConfirmation:"Het wijzigen van het type wist de huidige waarde. Doorgaan?",notifications:"Meldingen",markAllAsRead:"Alles als gelezen markeren",noNotifications:"Geen meldingen",schemaConflictsDetected:"Schemaconflicten gedetecteerd",schemaViolationsDetected:"Schemaschendingen gedetecteerd",properties:"Eigenschappen",uploading:"Uploaden...",dropFilesOrBrowse:"Sleep bestanden hierheen of klik om te bladeren",acceptedTypes:e=>`Toegestane typen: ${e}`,enterUrlPrompt:"Voer URL in:",exceeded:"(overschreden)",pdfPreview:"PDF-voorbeeld",lexical:{fontFamily:"Lettertype",fontSize:"Lettergrootte",lineHeight:"Regelhoogte",fontColor:"Letterkleur",highlightColor:"Markeringskleur",backgroundColor:"Achtergrondkleur",bold:"Vet",italic:"Cursief",underline:"Onderstrepen",strikethrough:"Doorhalen",code:"Code",clearFormatting:"Opmaak wissen",normal:"Normaal",heading:e=>`Kop ${e}`,bulletList:"Opsommingstekens",orderedList:"Genummerde lijst",checkList:"Controlelijst",indent:"Inspringen",outdent:"Uitspringen",blockquote:"Citaat",codeBlock:"Codeblok",horizontalRule:"Horizontale lijn",insertTable:"Tabel invoegen",link:"Link",undo:"Ongedaan maken",redo:"Opnieuw",cut:"Knippen",copy:"Kopiëren",paste:"Plakken",defaultOption:"Standaard",slashCommands:"Schuine-streepopdrachten",noCommandsFound:"Geen opdrachten gevonden",changeBlockType:"Bloktype wijzigen",blockTypes:"Bloktypen",enterUrl:"Voer URL in:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},dataTable:{sortAscending:"Oplopend sorteren",sortDescending:"Aflopend sorteren",clearSort:"Sortering wissen",filterPlaceholder:"Filteren...",clearFilter:"Filter wissen",selectAll:"Alles selecteren",deselectAll:"Alles deselecteren",selectedCount:e=>`${e} geselecteerd`,resetAll:"Alles resetten",noResults:"Geen resultaten gevonden",loading:"Laden...",filterPanelAddCondition:"Voorwaarde toevoegen",filterPanelApply:"Toepassen",filterPanelClear:"Filters wissen",filterPanelAnd:"EN",filterPanelOr:"OF",filterPanelContains:"Bevat",filterPanelNotContains:"Bevat niet",filterPanelEquals:"Is gelijk aan",filterPanelNotEquals:"Is niet gelijk aan",filterPanelStartsWith:"Begint met",filterPanelEndsWith:"Eindigt met",filterPanelIsNull:"Is leeg",filterPanelIsNotNull:"Is niet leeg",filterPanelGt:"Groter dan",filterPanelGte:"Groter of gelijk",filterPanelLt:"Kleiner dan",filterPanelLte:"Kleiner of gelijk",filterPanelBetween:"Tussen",filterPanelValuePlaceholder:"Waarde...",sortMultiHint:"Houd Shift ingedrukt om meerdere kolommen te sorteren",columnVisibility:"Kolommen",showAllColumns:"Alles weergeven",menuSortAsc:"Oplopend sorteren",menuSortDesc:"Aflopend sorteren",menuClearSort:"Sortering wissen",menuHideColumn:"Kolom verbergen",menuChooseColumns:"Kolommen kiezen",menuResetColumns:"Kolommen herstellen",menuFilter:"Filteren",rowCount:(e,n)=>`Rijen: ${e} Totaal rijen: ${n}`,filterTagsPlaceholder:"Waarden selecteren...",groupCount:e=>`${e} items`,collapseGroup:"Groep inklappen",expandGroup:"Groep uitklappen",describeFilter:{textContains:(e,n)=>`${e} bevat "${n}"`,textNotContains:(e,n)=>`${e} bevat niet "${n}"`,textEquals:(e,n)=>`${e} is gelijk aan "${n}"`,textNotEquals:(e,n)=>`${e} is niet gelijk aan "${n}"`,textStartsWith:(e,n)=>`${e} begint met "${n}"`,textEndsWith:(e,n)=>`${e} eindigt met "${n}"`,compareEq:(e,n)=>`${e} = ${n}`,compareNeq:(e,n)=>`${e} ≠ ${n}`,compareGt:(e,n)=>`${e} > ${n}`,compareGte:(e,n)=>`${e} ≥ ${n}`,compareLt:(e,n)=>`${e} < ${n}`,compareLte:(e,n)=>`${e} ≤ ${n}`,rangeBetween:(e,n,t)=>`${e} tussen ${n} en ${t}`,rangeGte:(e,n)=>`${e} ≥ ${n}`,rangeLte:(e,n)=>`${e} ≤ ${n}`,setIn:(e,n)=>`${e} in [${n}]`,setNotIn:(e,n)=>`${e} niet in [${n}]`,booleanIs:(e,n)=>`${e} is ${n}`,isNull:e=>`${e} is leeg`,isNotNull:e=>`${e} is niet leeg`,compositeAnd:e=>e.join(" EN "),compositeOr:e=>e.join(" OF ")}},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"PDF laden...",loadFailed:"PDF laden mislukt",invalidPdf:"Ongeldig PDF-bestand",pageOutOfRange:(e,n)=>`Pagina ${e} valt buiten bereik (1-${n})`,renderFailed:"PDF-pagina weergeven mislukt"}};exports.default=i;exports.nl=i;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as x } from "./text-input-
|
|
1
|
+
import { C as x } from "./text-input-DEAddaOi.js";
|
|
2
2
|
import { Use as E, input as j, attr as t, coalesce as A, Empty as g, on as p, emitValue as w, prop as O, computedOf as y, html as u, aria as D, When as B, Fragment as F, Value as h, Unless as M, Ensure as R } from "@tempots/dom";
|
|
3
|
-
import { a as S, I as k } from "./input-container-
|
|
4
|
-
import { B as V, I as z } from "./translations-
|
|
5
|
-
import { C as W } from "./use-form-
|
|
3
|
+
import { a as S, I as k } from "./input-container-Q9wL2BUl.js";
|
|
4
|
+
import { B as V, I as z } from "./translations-B96REXIk.js";
|
|
5
|
+
import { C as W } from "./use-form-CEY-gUUT.js";
|
|
6
6
|
const Y = (o) => {
|
|
7
7
|
const l = {
|
|
8
8
|
name: "email",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const C=require("./text-input-
|
|
1
|
+
"use strict";const C=require("./text-input-CynkbBpH.cjs"),t=require("@tempots/dom"),v=require("./input-container-BZwpJgx6.cjs"),b=require("./translations-BDGa_4jx.cjs"),O=require("./use-form-Ca0kF4af.cjs"),B=o=>{const l={name:"email",autocomplete:"email",...o},{value:r,before:s,onBlur:a,onChange:u,onInput:c,placeholder:f}=l,p=s??v.InputIcon({icon:"line-md:email",size:o.size,color:"neutral"});return t.Use(b.BeatUII18n,m=>v.InputContainer({...o,before:p,input:t.input.email(C.CommonInputAttributes(l),t.attr.placeholder(t.coalesce(f,m.$.emailPlaceholderText)),t.attr.value(r),t.attr.class("bc-input"),a!=null?t.on.blur(t.emitValue(a)):t.Empty,u!=null?t.on.change(t.emitValue(u)):t.Empty,c!=null?t.on.input(t.emitValue(c)):t.Empty)}))},U=o=>{const{value:l,onBlur:r,onChange:s,onInput:a,before:u,after:c,hasError:f,disabled:p,autocomplete:m,placeholder:I,size:d,...w}=o,y={name:"password",disabled:p,...w},e=t.prop(!0),n=t.computedOf(e,m)((i,h)=>i?h??"current-password":"off");return t.Use(b.BeatUII18n,i=>{const h=t.computedOf(i.$.passwordPlaceholderText,e,I)((V,E,_)=>E?"•••••••••••••••":_??V),g=t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__password-toggle"),t.aria.label(i.$.togglePasswordVisibility),t.on.click(()=>e.update(V=>!V)),t.When(e,()=>b.Icon({icon:"line-md:watch"}),()=>b.Icon({icon:"line-md:watch-off"})));return v.InputContainer({before:u,disabled:p,hasError:f,size:d,input:t.html.input(C.CommonInputAttributes({...y,autocomplete:n,placeholder:h}),t.When(e,()=>t.attr.type("password"),()=>t.attr.type("text")),t.attr.class("bc-input"),t.attr.value(l),r!=null?t.on.blur(t.emitValue(r)):t.Empty,s!=null?t.on.change(t.emitValue(s)):t.Empty,a!=null?t.on.input(t.emitValue(a)):t.Empty),after:c!=null?t.Fragment(g,c):g})})};function P(o){switch(o){case"success":return"material-symbols:check-circle-outline";case"warning":return"material-symbols:warning-outline";case"danger":return"material-symbols:error-outline";default:return"material-symbols:info-outline"}}function T(o){switch(o){case"success":return"success";case"warning":return"warning";case"danger":return"danger";default:return"info"}}function $(o,l,r,s){const a=["bc-notice",`bc-notice--${o}`,`bc-notice--tone-${l}`];return r&&a.push("bc-notice--dismissible"),s&&s.length>0&&a.push(s),a.join(" ")}function q({variant:o="info",tone:l="subtle",role:r,title:s,icon:a,closable:u=!1,onClose:c,class:f},...p){const m=t.prop(!0);return t.When(m,()=>{const I=t.Value.map(u,e=>!!e||c!=null),d=t.Value.map(o,e=>e??"info"),w=t.Value.map(l,e=>e??"subtle"),y=t.computedOf(r,d)((e,n)=>e??(n==="danger"?"alert":"status"));return t.Use(b.BeatUII18n,e=>t.html.div(t.attr.class(t.computedOf(d,w,I,f)((n,i,h,g)=>$(n,i,h,g))),t.attr.role(t.Value.map(y,n=>n)),t.Unless(t.Value.map(a,n=>n===!1),()=>t.html.div(t.attr.class("bc-notice__icon"),b.Icon({icon:t.computedOf(a,d)((n,i)=>n===void 0?P(i):String(n)),size:"md",color:t.Value.map(d,T)}))),t.html.div(t.attr.class("bc-notice__body"),t.Ensure(s,n=>t.html.div(t.attr.class("bc-notice__title"),n)),t.html.div(t.attr.class("bc-notice__content"),...p)),t.When(I,()=>O.CloseButton({size:"xs",label:e.$.closeModal,onClick:()=>{m.set(!1),c?.()}}))))})}exports.EmailInput=B;exports.Notice=q;exports.PasswordInput=U;
|
|
@@ -2,7 +2,7 @@ import { Validation as z, upperCaseFirst as B, humanize as W } from "@tempots/st
|
|
|
2
2
|
import { attr as c, prop as _, html as h, computedOf as g, aria as F, on as w } from "@tempots/dom";
|
|
3
3
|
import { g as H, C as J } from "./utils-vUtP6iPG.js";
|
|
4
4
|
import { S as y, L as K } from "./stack-BLMteGTn.js";
|
|
5
|
-
import { d as V, I as x } from "./translations-
|
|
5
|
+
import { d as V, I as x } from "./translations-B96REXIk.js";
|
|
6
6
|
import U from "ajv";
|
|
7
7
|
import G from "ajv/dist/2019";
|
|
8
8
|
import X from "ajv/dist/2020";
|