@tempots/beatui 0.95.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ar-BVXPzVJB.cjs → ar-CuI1Jgt6.cjs} +1 -1
- package/dist/{ar-B4jDJwHQ.js → ar-DaKbK_t8.js} +87 -11
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-BPwKk8MW.js → auth-divider-CbME_yVQ.js} +87 -86
- package/dist/auth-divider-MMhfmLBu.cjs +1 -0
- package/dist/beatui.css +1628 -545
- package/dist/beatui.tailwind.css +1628 -545
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +6 -6
- package/dist/codehighlight/index.cjs.js +22 -0
- package/dist/codehighlight/index.es.js +76 -0
- package/dist/colors-B-p6IzX9.cjs +1 -0
- package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
- package/dist/{de-Dd33yWzb.js → de-3MTPDS1i.js} +82 -6
- package/dist/{de-BdfPZskW.cjs → de-DthHehbh.cjs} +1 -1
- package/dist/{deep-merge-C8dSqIXI.js → deep-merge-BzIheQtH.js} +511 -517
- package/dist/deep-merge-EkjEgK0N.cjs +1 -0
- package/dist/{duration-input-IuFWywO5.cjs → duration-input-ClgYjeBa.cjs} +1 -1
- package/dist/{duration-input-DFZwkg6M.js → duration-input-DGzmIImj.js} +5 -5
- package/dist/{editor-toolbar-group-DiJFgGcI.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
- package/dist/{editor-toolbar-group-BCBfu8pG.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
- package/dist/es-B6GJLk9h.cjs +1 -0
- package/dist/{es-jHMT3_7O.js → es-DwMUvBeU.js} +94 -18
- package/dist/{fa-eX3_BAZR.js → fa-0rvQiKrJ.js} +87 -11
- package/dist/{fa-BXnP4pbN.cjs → fa-BwgP93iV.cjs} +1 -1
- package/dist/{fr-Bj-GjMJm.js → fr-B4i6NzLl.js} +86 -10
- package/dist/{fr-HJDhGjI2.cjs → fr-CQzk5zqY.cjs} +1 -1
- package/dist/{he-DYgmPPkG.js → he-C71n-hsn.js} +87 -11
- package/dist/{he-C6nEVZhN.cjs → he-DcxxvRfs.cjs} +1 -1
- package/dist/{hi-DMVSXAJt.cjs → hi-D-KHVWg4.cjs} +1 -1
- package/dist/{hi-CgYLonE9.js → hi-xmrXpeVU.js} +87 -11
- package/dist/index-B5MAsOC-.cjs +1 -0
- package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +8055 -5285
- package/dist/input-container-BvEcp7FU.js +275 -0
- package/dist/input-container-Di1YvVB_.cjs +1 -0
- package/dist/{it-CO2BPqah.js → it-CDZTtOBC.js} +83 -7
- package/dist/{it-DhfVcjKb.cjs → it-D344Dutu.cjs} +1 -1
- package/dist/{ja-Bt6fGS_Q.cjs → ja-BNgnDZ27.cjs} +1 -1
- package/dist/{ja-BrzwjH8T.js → ja-Zz1LzidW.js} +91 -15
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +261 -257
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +132 -133
- package/dist/{ko-D-lJ4wYQ.js → ko-9laUsZDL.js} +90 -14
- package/dist/{ko-DfAaBGrz.cjs → ko-D-WJ9NK7.cjs} +1 -1
- package/dist/lexical/index.cjs.js +2 -39
- package/dist/lexical/index.es.js +2056 -20626
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +41 -4
- package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
- package/dist/menu-B92oSDct.cjs +1 -0
- package/dist/modal-BT0jjDqX.cjs +1 -0
- package/dist/{modal-CwZuWiSK.js → modal-DBguyX-b.js} +9 -9
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +7 -7
- package/dist/{nl-CNWBQjK5.cjs → nl-CrqUlFie.cjs} +1 -1
- package/dist/{nl-ClsworIe.js → nl-Dcll9fVA.js} +86 -10
- package/dist/notice-B5wTXoTq.cjs +1 -0
- package/dist/{notice-D7hYFM5A.js → notice-BKcyJD5w.js} +37 -37
- package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
- package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
- package/dist/{pl-CqHTeu3-.cjs → pl-9UksIrvX.cjs} +1 -1
- package/dist/{pl-WTwLAxnV.js → pl-Dm9N9Gbr.js} +83 -7
- package/dist/prosemirror/index.cjs.js +3 -1
- package/dist/prosemirror/index.es.js +636 -4
- package/dist/{pt-CgkjJnsG.js → pt-CFi5cn0k.js} +88 -12
- package/dist/{pt-BQmsiqbo.cjs → pt-_kfdzwqi.cjs} +1 -1
- package/dist/{ru-CtgH7OY9.js → ru-CEhZUw8R.js} +91 -15
- package/dist/{ru-CG56A2To.cjs → ru-CW1WNNlr.cjs} +1 -1
- package/dist/stack-BLMteGTn.js +15 -0
- package/dist/stack-dwLevGa2.cjs +1 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/text-input-DfqXolVe.js +55 -0
- package/dist/text-input-X_q01NsY.cjs +1 -0
- package/dist/toolbar-DY0ax2Qd.js +130 -0
- package/dist/toolbar-DoKdYXIL.cjs +1 -0
- package/dist/{tr-DE7_VtKu.cjs → tr-B6GIRegf.cjs} +1 -1
- package/dist/{tr-D1O1vEmr.js → tr-ZmnVDhLP.js} +81 -5
- package/dist/{translations-yu4gNqlP.js → translations-A4kR7CW8.js} +1 -1
- package/dist/{translations-DyCmyLE_.js → translations-B1_yyDUK.js} +207 -129
- package/dist/{translations-DBxIjvWR.cjs → translations-C81buKAw.cjs} +1 -1
- package/dist/translations-Dbx7L7Q1.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +71 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +71 -0
- package/dist/types/beatui-i18n/translations.d.ts +71 -0
- package/dist/types/codehighlight/code-highlight.d.ts +21 -0
- package/dist/types/codehighlight/index.d.ts +14 -0
- package/dist/types/components/button/toggle-button.d.ts +4 -4
- package/dist/types/components/data/avatar.d.ts +3 -1
- package/dist/types/components/data/badge.d.ts +10 -18
- package/dist/types/components/data/column-filter-panel.d.ts +31 -0
- package/dist/types/components/data/column-filter.d.ts +110 -0
- package/dist/types/components/data/column-header-menu.d.ts +42 -0
- package/dist/types/components/data/data-source.d.ts +190 -0
- package/dist/types/components/data/data-table-body.d.ts +12 -0
- package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
- package/dist/types/components/data/data-table-context.d.ts +53 -0
- package/dist/types/components/data/data-table-header.d.ts +6 -0
- package/dist/types/components/data/data-table-resolve.d.ts +26 -0
- package/dist/types/components/data/data-table-types.d.ts +201 -0
- package/dist/types/components/data/data-table.d.ts +38 -0
- package/dist/types/components/data/data-toolbar.d.ts +44 -0
- package/dist/types/components/data/date-picker-shared.d.ts +55 -0
- package/dist/types/components/data/date-picker.d.ts +58 -0
- package/dist/types/components/data/date-range-picker.d.ts +56 -0
- package/dist/types/components/data/filter.d.ts +268 -0
- package/dist/types/components/data/index.d.ts +13 -4
- package/dist/types/components/data/indicator.d.ts +41 -0
- package/dist/types/components/data/progress-bar.d.ts +2 -2
- package/dist/types/components/data/selection-checkbox.d.ts +63 -0
- package/dist/types/components/data/skeleton.d.ts +1 -1
- package/dist/types/components/data/sortable-header.d.ts +55 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
- package/dist/types/components/form/control/control.d.ts +9 -9
- package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
- package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
- package/dist/types/components/form/input/bigint-input.d.ts +3 -3
- package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
- package/dist/types/components/form/input/combobox-input.d.ts +5 -5
- package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/date-input.d.ts +4 -4
- package/dist/types/components/form/input/date-time-input.d.ts +4 -4
- package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
- package/dist/types/components/form/input/editable-text.d.ts +2 -2
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +1 -1
- package/dist/types/components/form/input/input-options.d.ts +28 -1
- package/dist/types/components/form/input/mask-input.d.ts +8 -2
- package/dist/types/components/form/input/native-select.d.ts +3 -3
- package/dist/types/components/form/input/nullable-bigint-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
- package/dist/types/components/form/input/number-input.d.ts +3 -3
- package/dist/types/components/form/input/otp-input.d.ts +12 -12
- package/dist/types/components/form/input/rating-input.d.ts +7 -8
- package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/switch.d.ts +2 -2
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
- package/dist/types/components/form/input/uuid-input.d.ts +2 -2
- package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
- package/dist/types/components/layout/card.d.ts +66 -0
- package/dist/types/components/layout/collapse.d.ts +2 -2
- package/dist/types/components/layout/flex.d.ts +26 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
- package/dist/types/components/misc/index.d.ts +1 -0
- package/dist/types/components/misc/loading-overlay.d.ts +29 -0
- package/dist/types/components/misc/notice.d.ts +4 -4
- package/dist/types/components/misc/notification-provider.d.ts +9 -3
- package/dist/types/components/misc/notification.d.ts +9 -9
- package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
- package/dist/types/components/navigation/menu.d.ts +6 -6
- package/dist/types/components/navigation/pagination.d.ts +17 -4
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
- package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
- package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
- package/dist/types/components/overlay/dialogs.d.ts +2 -2
- package/dist/types/components/overlay/modal.d.ts +9 -2
- package/dist/types/components/overlay/tooltip.d.ts +6 -6
- package/dist/types/components/theme/types.d.ts +15 -4
- package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
- package/dist/types/tokens/z-index.d.ts +18 -18
- package/dist/types/utils/use-animated-toggle.d.ts +12 -4
- package/dist/{ur-ZJgsSpG2.cjs → ur-CtFl_tz6.cjs} +1 -1
- package/dist/{ur-BcuB7IqE.js → ur-yYgj3NmT.js} +87 -11
- package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
- package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
- package/dist/use-form-CaW192gw.cjs +2 -0
- package/dist/{use-form-CfxvyTfd.js → use-form-Dn6v2tEh.js} +153 -152
- package/dist/utils-DmEuG3Np.cjs +1 -0
- package/dist/utils-vUtP6iPG.js +165 -0
- package/dist/{vi-D0rQ3dIx.js → vi-D5u4CLQO.js} +88 -12
- package/dist/{vi-BOgLRkuK.cjs → vi-DyCZSpsk.cjs} +1 -1
- package/dist/widget-customization-B49MeU4E.cjs +1 -0
- package/dist/widget-customization-DEiQ_31d.js +1063 -0
- package/dist/{zh-DoYqiZO1.js → zh-B0kwMMer.js} +90 -14
- package/dist/{zh-BTZ8OZ4H.cjs → zh-C3ZxMQKb.cjs} +1 -1
- package/package.json +208 -37
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/auth-divider-BgaQ8ifw.cjs +0 -1
- package/dist/colors-BI0YhONJ.cjs +0 -1
- package/dist/deep-merge-ChJQbUKq.cjs +0 -1
- package/dist/es-C8TpneCm.cjs +0 -1
- package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
- package/dist/hls.light.min-hEMf_E8u.js +0 -8311
- package/dist/index-1JaBwDB-.js +0 -921
- package/dist/index-CN10Cyqr.cjs +0 -1
- package/dist/index-CTcbhnPw.cjs +0 -4
- package/dist/index-DF7RFzD9.cjs +0 -1
- package/dist/index-D_zOXmU5.cjs +0 -36
- package/dist/index-DfPkCwdC.js +0 -2709
- package/dist/index-vowHNIPH.js +0 -14308
- package/dist/index-yOU4Ceaq.js +0 -68
- package/dist/index-zQ3IYJFH.cjs +0 -1
- package/dist/input-container-BWYHj0Iq.cjs +0 -1
- package/dist/input-container-DMoVdH6E.js +0 -263
- package/dist/menu-De_-sGeb.cjs +0 -1
- package/dist/modal-CiGmgsOI.cjs +0 -1
- package/dist/notice-CPZQuxcA.cjs +0 -1
- package/dist/oneof-branch-detection-BFxukD63.cjs +0 -8
- package/dist/oneof-branch-detection-izpPjBCR.js +0 -6290
- package/dist/stack-4VUGISn6.cjs +0 -1
- package/dist/stack-Bm-UZosx.js +0 -879
- package/dist/string-B9vVyfq3.cjs +0 -1
- package/dist/string-DYyMxBl-.js +0 -19
- package/dist/text-input-BLupB3cU.js +0 -45
- package/dist/text-input-M6WBhhVj.cjs +0 -1
- package/dist/timer-BJHOsuS6.cjs +0 -1
- package/dist/timer-Rd2sKnvH.js +0 -65
- package/dist/toolbar-Be1eU0qU.js +0 -118
- package/dist/toolbar-WWv5kcYG.cjs +0 -1
- package/dist/translations-OOsMRpX9.cjs +0 -1
- package/dist/types/components/data/calendar-shared.d.ts +0 -59
- package/dist/types/components/data/calendar.d.ts +0 -107
- package/dist/types/components/data/icon-badge.d.ts +0 -14
- package/dist/types/components/data/range-calendar.d.ts +0 -104
- package/dist/types/components/data/tag.d.ts +0 -51
- package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
- package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
- package/dist/use-form-ClA0ZRco.cjs +0 -2
- package/dist/utils-DEbsp9Q9.js +0 -129
- package/dist/utils-DIUEhA-Z.cjs +0 -1
- package/dist/widget-customization-CLZNGavL.js +0 -1042
- package/dist/widget-customization-DtEEo35Y.cjs +0 -1
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { WithElement as v, Fragment as E, OnDispose as T, computedOf as g, attr as x, Value as m, prop as w } from "@tempots/dom";
|
|
2
|
-
import { g as f, I as A } from "./timer-Rd2sKnvH.js";
|
|
3
|
-
function b({
|
|
4
|
-
initialStatus: n = "closed",
|
|
5
|
-
openedAfter: t,
|
|
6
|
-
closedAfter: i
|
|
7
|
-
}) {
|
|
8
|
-
const e = w(n), o = () => {
|
|
9
|
-
e.set("start-opening");
|
|
10
|
-
}, l = () => {
|
|
11
|
-
e.set("start-closing");
|
|
12
|
-
}, a = e.map(
|
|
13
|
-
(s) => s !== "closed" && s !== "start-closing" && s !== "closing"
|
|
14
|
-
), u = (s) => {
|
|
15
|
-
s ? o() : l();
|
|
16
|
-
}, c = () => {
|
|
17
|
-
u(!a.value);
|
|
18
|
-
}, r = [], p = (s) => {
|
|
19
|
-
r.push(
|
|
20
|
-
e.on((P) => {
|
|
21
|
-
P === "closed" && s();
|
|
22
|
-
})
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
let d = () => {
|
|
26
|
-
};
|
|
27
|
-
e.on((s) => {
|
|
28
|
-
switch (d(), s) {
|
|
29
|
-
case "start-opening":
|
|
30
|
-
d = f(() => e.set("opening"));
|
|
31
|
-
break;
|
|
32
|
-
case "opening":
|
|
33
|
-
d = t(() => e.set("opened"));
|
|
34
|
-
break;
|
|
35
|
-
case "start-closing":
|
|
36
|
-
d = f(() => e.set("closing"));
|
|
37
|
-
break;
|
|
38
|
-
case "closing":
|
|
39
|
-
d = i(() => e.set("closed"));
|
|
40
|
-
break;
|
|
41
|
-
case "closed":
|
|
42
|
-
d = () => {
|
|
43
|
-
};
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}), e.onDispose(() => {
|
|
47
|
-
r.forEach((s) => s()), d();
|
|
48
|
-
});
|
|
49
|
-
const k = e.map((s) => s === "closed"), O = e.map((s) => s === "start-opening"), L = e.map((s) => s === "opening"), S = e.map((s) => s === "opened"), $ = e.map((s) => s === "closing"), C = e.map((s) => s === "start-closing");
|
|
50
|
-
return {
|
|
51
|
-
status: e,
|
|
52
|
-
open: o,
|
|
53
|
-
close: l,
|
|
54
|
-
toggle: c,
|
|
55
|
-
setOpen: u,
|
|
56
|
-
display: a,
|
|
57
|
-
isClosed: k,
|
|
58
|
-
isStartOpening: O,
|
|
59
|
-
isOpening: L,
|
|
60
|
-
isOpened: S,
|
|
61
|
-
isClosing: $,
|
|
62
|
-
isStartClosing: C,
|
|
63
|
-
dispose: () => e.dispose(),
|
|
64
|
-
listenOnClosed: p
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function K({
|
|
68
|
-
initialStatus: n = "closed",
|
|
69
|
-
duration: t,
|
|
70
|
-
openDuration: i = t ?? 500,
|
|
71
|
-
closeDuration: e = t ?? 500
|
|
72
|
-
} = {}) {
|
|
73
|
-
return b({
|
|
74
|
-
initialStatus: n,
|
|
75
|
-
openedAfter: (o) => A(o, i),
|
|
76
|
-
closedAfter: (o) => A(o, e)
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function y(n, t) {
|
|
80
|
-
let i = !1, e = null;
|
|
81
|
-
function o() {
|
|
82
|
-
i || (i = !0, n.removeEventListener("transitionend", l), n.removeEventListener("animationend", a), e && (clearTimeout(e), e = null), t());
|
|
83
|
-
}
|
|
84
|
-
function l(r) {
|
|
85
|
-
r.target === n && o();
|
|
86
|
-
}
|
|
87
|
-
function a(r) {
|
|
88
|
-
r.target === n && o();
|
|
89
|
-
}
|
|
90
|
-
const c = f(() => {
|
|
91
|
-
if (typeof n.getAnimations > "u") {
|
|
92
|
-
e = setTimeout(o, 16);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
n.addEventListener("transitionend", l), n.addEventListener("animationend", a), n.getAnimations().length === 0 && (e = setTimeout(o, 1e3));
|
|
96
|
-
});
|
|
97
|
-
return () => {
|
|
98
|
-
i = !0, c(), e && (clearTimeout(e), e = null), n.removeEventListener("transitionend", l), n.removeEventListener("animationend", a);
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function B({
|
|
102
|
-
initialStatus: n = "closed",
|
|
103
|
-
element: t
|
|
104
|
-
} = {}) {
|
|
105
|
-
let i = t;
|
|
106
|
-
return {
|
|
107
|
-
setElement: (e) => {
|
|
108
|
-
i = e;
|
|
109
|
-
},
|
|
110
|
-
...b({
|
|
111
|
-
initialStatus: n,
|
|
112
|
-
openedAfter: (e) => i == null ? (e(), () => {
|
|
113
|
-
}) : y(i, e),
|
|
114
|
-
closedAfter: (e) => i == null ? (e(), () => {
|
|
115
|
-
}) : y(i, e)
|
|
116
|
-
})
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function D(n) {
|
|
120
|
-
if (n == null) return [];
|
|
121
|
-
const t = [];
|
|
122
|
-
return n.fade && t.push("fade"), n.slide && t.push(`slide-${n.slide}`), n.scale != null && t.push("scale"), t.length > 0 ? t : ["none"];
|
|
123
|
-
}
|
|
124
|
-
function N(n) {
|
|
125
|
-
if (n == null) return [];
|
|
126
|
-
const t = [];
|
|
127
|
-
return n.scale != null && typeof n.scale == "number" && t.push(["--scale-factor", String(n.scale)]), n.transformOrigin != null && t.push(["--transform-origin", n.transformOrigin]), n.duration != null && t.push(["--animation-duration", `${n.duration}ms`]), n.easing != null && t.push(["--animation-easing", n.easing]), t;
|
|
128
|
-
}
|
|
129
|
-
function h(n, t) {
|
|
130
|
-
if (n == null) return;
|
|
131
|
-
const i = t === "start-opening" || t === "opening" || t === "opened";
|
|
132
|
-
return "enter" in n || "exit" in n ? i ? n.enter : n.exit : n;
|
|
133
|
-
}
|
|
134
|
-
function j({
|
|
135
|
-
animation: n,
|
|
136
|
-
status: t
|
|
137
|
-
}) {
|
|
138
|
-
const i = g(
|
|
139
|
-
n,
|
|
140
|
-
t
|
|
141
|
-
)((e, o) => {
|
|
142
|
-
const l = h(e, o), u = D(l).map((c) => `bc-animated-toggle--${c}`).join(" ");
|
|
143
|
-
return u ? `bc-animated-toggle ${u} bc-animated-toggle--${o}` : `bc-animated-toggle bc-animated-toggle--${o}`;
|
|
144
|
-
});
|
|
145
|
-
return E(
|
|
146
|
-
x.class(i),
|
|
147
|
-
v((e) => {
|
|
148
|
-
let o = [];
|
|
149
|
-
function l(c) {
|
|
150
|
-
for (const r of o)
|
|
151
|
-
e.style.removeProperty(r);
|
|
152
|
-
o = c.map(([r]) => r);
|
|
153
|
-
for (const [r, p] of c)
|
|
154
|
-
e.style.setProperty(r, p);
|
|
155
|
-
}
|
|
156
|
-
const a = g(
|
|
157
|
-
n,
|
|
158
|
-
t
|
|
159
|
-
)((c, r) => {
|
|
160
|
-
const p = h(c, r);
|
|
161
|
-
return N(p);
|
|
162
|
-
});
|
|
163
|
-
l(m.get(a));
|
|
164
|
-
const u = m.on(a, l);
|
|
165
|
-
return T(() => {
|
|
166
|
-
u();
|
|
167
|
-
for (const c of o)
|
|
168
|
-
e.style.removeProperty(c);
|
|
169
|
-
});
|
|
170
|
-
})
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
function V({
|
|
174
|
-
initialStatus: n = "closed",
|
|
175
|
-
animation: t
|
|
176
|
-
}, i) {
|
|
177
|
-
return v((e) => {
|
|
178
|
-
const { setElement: o, dispose: l, ...a } = B({
|
|
179
|
-
initialStatus: n,
|
|
180
|
-
element: e
|
|
181
|
-
});
|
|
182
|
-
return o(e), E(
|
|
183
|
-
j({ status: a.status, animation: t }),
|
|
184
|
-
T(l),
|
|
185
|
-
i(a)
|
|
186
|
-
);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
export {
|
|
190
|
-
j as A,
|
|
191
|
-
V as a,
|
|
192
|
-
b,
|
|
193
|
-
K as c,
|
|
194
|
-
B as u
|
|
195
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("@tempots/dom"),f=require("./timer-BJHOsuS6.cjs");function m({initialStatus:n="closed",openedAfter:t,closedAfter:i}){const e=u.prop(n),o=()=>{e.set("start-opening")},l=()=>{e.set("start-closing")},c=e.map(s=>s!=="closed"&&s!=="start-closing"&&s!=="closing"),d=s=>{s?o():l()},a=()=>{d(!c.value)},r=[],p=s=>{r.push(e.on(C=>{C==="closed"&&s()}))};let g=()=>{};e.on(s=>{switch(g(),s){case"start-opening":g=f.g(()=>e.set("opening"));break;case"opening":g=t(()=>e.set("opened"));break;case"start-closing":g=f.g(()=>e.set("closing"));break;case"closing":g=i(()=>e.set("closed"));break;case"closed":g=()=>{};break}}),e.onDispose(()=>{r.forEach(s=>s()),g()});const h=e.map(s=>s==="closed"),v=e.map(s=>s==="start-opening"),O=e.map(s=>s==="opening"),b=e.map(s=>s==="opened"),k=e.map(s=>s==="closing"),L=e.map(s=>s==="start-closing");return{status:e,open:o,close:l,toggle:a,setOpen:d,display:c,isClosed:h,isStartOpening:v,isOpening:O,isOpened:b,isClosing:k,isStartClosing:L,dispose:()=>e.dispose(),listenOnClosed:p}}function S({initialStatus:n="closed",duration:t,openDuration:i=t??500,closeDuration:e=t??500}={}){return m({initialStatus:n,openedAfter:o=>f.I(o,i),closedAfter:o=>f.I(o,e)})}function A(n,t){let i=!1,e=null;function o(){i||(i=!0,n.removeEventListener("transitionend",l),n.removeEventListener("animationend",c),e&&(clearTimeout(e),e=null),t())}function l(r){r.target===n&&o()}function c(r){r.target===n&&o()}const d=()=>{if(typeof n.getAnimations>"u"){e=setTimeout(o,16);return}n.addEventListener("transitionend",l),n.addEventListener("animationend",c),n.getAnimations().length===0&&(e=setTimeout(o,1e3))},a=f.g(d);return()=>{i=!0,a(),e&&(clearTimeout(e),e=null),n.removeEventListener("transitionend",l),n.removeEventListener("animationend",c)}}function y({initialStatus:n="closed",element:t}={}){let i=t;return{setElement:e=>{i=e},...m({initialStatus:n,openedAfter:e=>i==null?(e(),()=>{}):A(i,e),closedAfter:e=>i==null?(e(),()=>{}):A(i,e)})}}function $(n){if(n==null)return[];const t=[];return n.fade&&t.push("fade"),n.slide&&t.push(`slide-${n.slide}`),n.scale!=null&&t.push("scale"),t.length>0?t:["none"]}function P(n){if(n==null)return[];const t=[];return n.scale!=null&&typeof n.scale=="number"&&t.push(["--scale-factor",String(n.scale)]),n.transformOrigin!=null&&t.push(["--transform-origin",n.transformOrigin]),n.duration!=null&&t.push(["--animation-duration",`${n.duration}ms`]),n.easing!=null&&t.push(["--animation-easing",n.easing]),t}function T(n,t){if(n==null)return;const i=t==="start-opening"||t==="opening"||t==="opened";return"enter"in n||"exit"in n?i?n.enter:n.exit:n}function E({animation:n,status:t}){const i=u.computedOf(n,t)((e,o)=>{const l=T(e,o),d=$(l).map(a=>`bc-animated-toggle--${a}`).join(" ");return d?`bc-animated-toggle ${d} bc-animated-toggle--${o}`:`bc-animated-toggle bc-animated-toggle--${o}`});return u.Fragment(u.attr.class(i),u.WithElement(e=>{let o=[];function l(a){for(const r of o)e.style.removeProperty(r);o=a.map(([r])=>r);for(const[r,p]of a)e.style.setProperty(r,p)}const c=u.computedOf(n,t)((a,r)=>{const p=T(a,r);return P(p)});l(u.Value.get(c));const d=u.Value.on(c,l);return u.OnDispose(()=>{d();for(const a of o)e.style.removeProperty(a)})}))}function w({initialStatus:n="closed",animation:t},i){return u.WithElement(e=>{const{setElement:o,dispose:l,...c}=y({initialStatus:n,element:e});return o(e),u.Fragment(E({status:c.status,animation:t}),u.OnDispose(l),i(c))})}exports.AnimatedToggle=w;exports.AnimatedToggleClass=E;exports.useAnimatedElementToggle=y;exports.useAnimatedToggle=m;exports.useTimedToggle=S;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),E=require("./translations-OOsMRpX9.cjs"),j=require("./input-container-BWYHj0Iq.cjs"),f=require("./stack-4VUGISn6.cjs"),_=require("./session-id-B5lJMzbB.cjs"),D=(n,e)=>n===e||n!==n&&e!==e;function G({size:n="sm",icon:e="line-md:close",disabled:s,roundedness:i="full",color:r="base",onClick:l,label:o},...a){return t.Use(E.BeatUII18n,c=>{const d=t.coalesce(o,c.$.closeModal);return j.Button({variant:"text",size:n,roundedness:i,disabled:s,color:r,onClick:l},t.attr.title(d),t.aria.label(d),...a,E.Icon({icon:e,size:n??"sm"}))})}const J=n=>{const{value:e,onBlur:s,onChange:i,onInput:r,placeholder:l,disabled:o,id:a,checkedIcon:c,uncheckedIcon:d,iconSize:u="lg"}=n,p=a??_.sessionId("checkbox"),g=`${p}-label`,y=()=>{if(t.Value.get(o??!1))return;const h=t.Value.get(e);i?.(!h),r?.(!h)},m=h=>{t.Value.get(o??!1)||(h.key===" "||h.key==="Enter")&&(h.preventDefault(),y())};return j.InputContainer({baseContainer:!0,growInput:!1,...n,input:t.html.span(t.attr.class("bc-checkbox-input"),t.html.span(t.attr.class("bc-checkbox-input__checkbox"),t.attr.class(t.Value.map(e,h=>h?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),t.attr.class(t.Value.map(o??!1,h=>h?"bc-checkbox-input__checkbox--disabled":"")),t.attr.id(p),t.attr.role("checkbox"),t.attr.tabindex(t.Value.map(o??!1,h=>h?-1:0)),t.aria.checked(e),t.aria.disabled(o),l!=null?t.aria.labelledby(g):t.Empty,t.on.keydown(m),s!=null?t.on.blur(s):t.Empty,E.Icon({icon:t.computedOf(e,c,d)((h,v,w)=>h?v??"akar-icons/check-box-fill":w??"akar-icons/box"),accessibility:"decorative",size:u})),l!=null?t.html.label(t.attr.class("bc-checkbox-input__label"),t.attr.id(g),t.attr.for(p),f.MutedLabel(l)):t.Empty)},t.on.click(y))},P=t.html.span(t.attr.class("bc-input-wrapper__required")," *");function Q(n){const e=["bc-input-wrapper"];return n!=="vertical"&&e.push(`bc-input-wrapper--${n}`),e.join(" ")}function X(n,e){const s=["bc-input-wrapper__label-text"];return n?s.push("bc-input-wrapper__label-text--error"):e?s.push("bc-input-wrapper__label-text--disabled"):s.push("bc-input-wrapper__label-text--default"),s.join(" ")}function Y(n,e){if(n==="horizontal-fixed"&&e!=null)return`--input-wrapper-label-width: ${e}`}const M=({fullWidth:n=!1,required:e,label:s,labelChildren:i,context:r,description:l,content:o,error:a,labelFor:c,hasError:d,disabled:u,layout:p,labelWidth:g},...y)=>{const m=d??a!=null,h=u??!1,v=p??"vertical",w=_.sessionId("input-wrapper"),I=l?`${w}-description`:void 0,V=a!=null?`${w}-error`:void 0,B=t.computedOf(v)(b=>b!=="vertical"),K=t.computedOf(v,g??void 0)((b,C)=>Y(b,C));return t.html.div(t.attr.class(t.Value.map(v,b=>Q(b))),t.attr.class(t.Value.map(n,b=>b?"bc-input-wrapper--full-width":"")),t.attr.style(K),s!=null||r!=null?t.html.div(t.attr.class("bc-input-wrapper__header"),t.html.div(t.attr.class("bc-input-wrapper__label-section"),t.html.label(t.attr.class("bc-input-wrapper__label"),c!=null?t.attr.for(c):t.Empty,t.html.span(t.attr.class(t.computedOf(m,h)((b,C)=>X(b??!1,C??!1))),s),s!=null&&e?P:t.Empty),t.When(t.computedOf(B,l)((b,C)=>b&&C!=null),()=>t.html.div(t.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),t.attr.id(I),l))),r!=null?f.Label(r):t.Empty,i):t.Empty,t.html.div(t.attr.class("bc-input-wrapper__content"),[I,V].filter(Boolean).length>0?t.dataAttr.describedby([I,V].filter(Boolean).join(" ")):t.Empty,e?t.dataAttr.required("true"):t.Empty,t.When(m,()=>t.dataAttr.invalid("true")),o),t.When(t.computedOf(B,l)((b,C)=>!b&&C!=null),()=>t.html.div(t.attr.class("bc-input-wrapper__description"),t.attr.id(I),l)),t.When(m,()=>t.html.div(t.attr.class("bc-input-wrapper__error"),t.attr.id(V),t.aria.live("polite"),t.attr.role("alert"),a)),...y)},H=((n,e)=>()=>{n.markTouched(),e?.()}),O=(n,e)=>s=>{n.change(s),e?.(s)};function x(n,e){const{controller:s,onBlur:i,onChange:r,id:l,triggerOn:o,...a}=e;return n({id:l??s.name,disabled:s.disabled,value:s.signal,hasError:s.errorVisible,name:s.name,...a,onInput:o==="input"?O(s,r):void 0,onChange:o!=="input"?O(s,r):void 0,onBlur:H(s,i)})}function Z(n,{id:e,labelFor:s,...i},...r){const l=e??i.controller.name??_.sessionId("control"),o=s??l;return M({...i,hasError:i.controller.errorVisible,error:t.TextNode(i.controller.error.map(a=>a??"")),labelFor:o,content:x(a=>n({...a,id:l}),i)},...r)}function F(n,e){const{toInput:s,fromInput:i,controller:r,...l}=e,o=r.transform(s,i);return x(n,{...l,controller:o})}function ee(n,{id:e,labelFor:s,...i},...r){const l=e??i.controller.name??_.sessionId("control");return M({...i,labelFor:s??l,content:F(n,{...i,id:l})},...r)}function te(n){return n.split(".").map(s=>{const i=s.match(/^\[(\d+)\]$/);return i?Number(i[1]):s})}function $(n){return typeof n=="number"?`[${n}]`:`.${n}`}function W(n){if(n.length===0)return"";const[e,...s]=n;return[typeof e=="number"?`[${e}]`:e,...s.map($)].join("")}const se={valid:f.i.valid,invalid(n){return f.i.invalid({message:n})},invalidFields(n){const e={};for(const[s,i]of Object.entries(n))e[s]=typeof i=="string"?{message:i}:i;return f.i.invalid({dependencies:e})},fromError(n){return f.i.invalid(n)}};function T(n){return function(s){if(s.type==="valid")return s;let i=s.error;for(const r of n)if(i=i?.dependencies?.[r],i==null)return f.i.valid;return f.i.invalid(i)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#e={disabled:t.prop(!1),touched:t.prop(!1)};#s;#t=t.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(e,s,i,r,l,o=D){this.path=e,this.change=s,this.signal=i,this.status=r,this.#s=o,this.#t.set(i.value),this.error=r.map(a=>a?.type==="invalid"?a.error?.message:void 0),this.hasError=this.error.map(a=>a!=null),this.touched=this.#e.touched,l.validationMode?this.errorVisible=t.computedOf(this.hasError,this.touched,l.validationMode)((a,c,d)=>d==="eager"?!!a:!!a&&!!c):this.errorVisible=t.computedOf(this.hasError,this.touched)((a,c)=>!!a&&!!c),this.dirty=t.computedOf(this.signal,this.#t)((a,c)=>!this.#s(a,c)),this.dependencyErrors=r.map(a=>a?.type==="invalid"?a.error?.dependencies:void 0),this.parent=l,this.disabled=t.computedOf(this.#e.disabled,l.disabled)((a,c)=>a||c),this.disabledOrHasErrors=t.computedOf(this.disabled,this.hasError)((a,c)=>a||c),this.onDispose(()=>{this.#e.disabled.dispose(),this.#e.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#t.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return W(this.path)}onDispose=e=>{this.#n.push(e)};dispose=()=>{for(const e of this.#n)try{e()}catch(s){console.error("Error in dispose callback:",s)}this.#n.length=0};setDisabled=e=>{this.#e.disabled.set(e)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#e.touched.set(!0)};resetTouched=()=>{this.#e.touched.set(!1)};markPristine=()=>{this.#t.set(this.signal.value)};reset=()=>{this.change(this.#t.value)};array=(e=D)=>new q(this.path,this.change,this.signal,this.status,this.parent,e);object=(e=D)=>new N(this.path,this.change,this.signal,this.status,this.parent,e);transform=(e,s,i=[],r=D)=>new k([...this.path,...i],l=>this.change(s(l)),this.signal.map(e,r),this.status.map(T(i)),this.parent,r);asyncTransform=(e,s,i,r=[],l=D)=>new k([...this.path,...r],o=>{s(o).then(a=>this.change(a))},this.signal.mapAsync(e,i,void 0,l),this.status.map(T(r)),this.parent,l)}class N extends k{#e=new Map;#s=new Map;#t=new Map;#n=t.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=t.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let e=!1;for(const s of this.#s.values())if(s){e=!0;break}this.#n.set(this.touched.value||e)};constructor(e,s,i,r,l,o){super(e,s,i.map(c=>c??{},o),r,l,o),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const a=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const c of this.#e.values())c.dispose();this.#e.clear();for(const c of this.#t.values())c();this.#t.clear(),this.#s.clear(),this.#n.dispose();for(const c of this.#i.values())c();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),a()})}field=e=>{if(this.#e.has(e))return this.#e.get(e);const s=async o=>{this.change({...this.signal.value,[e]:o})},i=new k([...this.path,e],s,this.signal.map(o=>o[e]),this.status.map(T([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e.set(e,i);const r=i.touched.on(o=>{this.#s.set(e,o),this.#l()});this.#t.set(e,r);const l=i.dirty.on(o=>{this.#r.set(e,o),this.#a()});return this.#i.set(e,l),i};markAllTouched=()=>{this.markTouched();const e=this.signal.value;for(const s of Object.keys(e))this.field(s).markTouched();for(const s of this.#e.values())s.markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value;for(const s of Object.keys(e))this.field(s).markPristine?.();for(const s of this.#e.values())s.markPristine?.()};#a=()=>{let e=!1;for(const s of this.#r.values())if(s){e=!0;break}this.#o.set(this.dirty.value||e)}}class q extends k{#e=new Array;length;#s=new Map;#t=new Map;#n=t.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=t.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let e=!1;for(const s of this.#s.values())if(s){e=!0;break}this.#n.set(this.touched.value||e)};constructor(e,s,i,r,l,o){const a=i.map(u=>u??[],o);super(e,s,a,r,l,o);const c=a.on(u=>{const p=this.#e.length-u.length;p>0&&(this.#e.splice(u.length,p).forEach((g,y)=>{const m=u.length+y;g.dispose(),this.#t.get(m)?.(),this.#t.delete(m),this.#s.delete(m),this.#i.get(m)?.(),this.#i.delete(m),this.#r.delete(m)}),this.#l(),this.#a())});this.length=a.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const d=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const u of this.#e)u.dispose();this.length.dispose(),this.#e.length=0,c(),a.dispose();for(const u of this.#t.values())u();this.#t.clear(),this.#s.clear(),this.#n.dispose();for(const u of this.#i.values())u();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),d()})}item=e=>{if(this.#e[e])return this.#e[e];const s=async o=>{const a=this.signal.value.slice();a[e]=o,this.change(a)},i=new k([...this.path,e],s,this.signal.map(o=>o[e]),this.status.map(T([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e[e]=i;const r=i.touched.on(o=>{this.#s.set(e,o),this.#l()});this.#t.set(e,r);const l=i.dirty.on(o=>{this.#r.set(e,o),this.#a()});return this.#i.set(e,l),i};push=(...e)=>{this.change([...this.signal.value,...e])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...e)=>{this.change([...e,...this.signal.value])};removeAt=e=>{this.splice(e,1)};splice=(e,s)=>{const i=this.signal.value.slice();i.splice(e,s),this.change(i)};move=(e,s,i=1)=>{if(i<1||e===s)return;const r=this.signal.value.slice(),l=r.splice(e,i);r.splice(s,0,...l),this.change(r)};markAllTouched=()=>{this.markTouched();const e=this.signal.value.length;for(let s=0;s<e;s++)this.item(s).markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value.length;for(let s=0;s<e;s++)this.item(s).markPristine?.()};#a=()=>{let e=!1;for(const s of this.#r.values())if(s){e=!0;break}this.#o.set(this.dirty.value||e)}}function z(n){function e(s){return typeof s=="number"?s:s.toString()}return n.map(s=>typeof s=="object"&&s.key!=null?e(s.key):e(s))}function L(n){const e=n.filter(r=>r.path==null||r.path.length===0).map(r=>r.message),s=n.filter(r=>r.path!=null&&r.path.length>0).reduce((r,l)=>{const o=z(l.path),a=o.pop();let c=r;for(const d of o)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[a]={message:l.message},r},{}),i=e.join(`
|
|
2
|
-
`);return{...s,message:i!=""?i:void 0}}function R({initialValue:n,onChange:e,validate:s,equals:i,validationMode:r,validateDebounceMs:l}){const o=t.Value.deriveProp(n),a=t.prop(f.i.valid),c=t.prop(!1),d=t.prop(r??"onTouched"),u=h=>{a.set(h)};let p;const g=async h=>{if(s!=null){const v=await s(h);u(v)}},y=async h=>{o.set(h),e?.(h);const v=d.value;if(s!=null){if(v==="onSubmit")return;const w=l??0;w>0?(p&&clearTimeout(p),p=setTimeout(()=>{g(h)},w)):await g(h)}},m=new k([],y,o,a,{disabled:c,validationMode:d},i??D);return m.onDispose(()=>{c.dispose(),o.dispose(),a.dispose(),d.dispose(),p&&clearTimeout(p)}),{controller:m,setStatus:u}}function A(n){return t.Fragment(t.attr.disabled(n.disabled),t.attr.name(n.name))}function ne(n,{triggerOn:e="change"}={}){return t.Fragment(A(n),t.attr.value(n.signal),(e==="input"?t.on.input:t.on.change)(t.emitValue(n.change)))}function ie(n,{triggerOn:e="change"}={}){return t.Fragment(A(n),t.attr.valueAsNumber(n.signal),(e==="input"?t.on.input:t.on.change)(t.emitValueAsNumber(n.change)))}function S(n){return n.issues!=null?f.i.invalid(L(n.issues)):f.i.valid}async function re({task:n,errorMessage:e,errorPath:s=["root"],validation:i}){try{const r=await n();return i!=null?i(r):f.i.valid}catch(r){const l=e??(r instanceof Error?r.message:"Operation failed");return s.length===1&&s[0]==="root"?f.i.invalid({message:l}):f.i.invalid({dependencies:U(s,l)})}}function U(n,e){if(n.length===1)return{[n[0]]:{message:e}};const[s,...i]=n;return{[s]:{dependencies:U(i,e)}}}function ae({initialValue:n={},schema:e,onSubmit:s=async()=>f.i.valid,validationMode:i,validateDebounceMs:r}){const{controller:l,setStatus:o}=R({initialValue:n,validationMode:i??"onTouched",validateDebounceMs:r,validate:(i??"onTouched")==="onSubmit"||e==null?void 0:async u=>S(await e["~standard"].validate(u))}),a=t.prop(!1),c=l.object();return c.onDispose(()=>a.dispose()),{controller:c,setStatus:o,submit:async u=>{if(a.set(!0),u?.preventDefault(),c.markAllTouched(),e!=null){const g=c.signal.value,y=S(await e["~standard"].validate(g));if(o(y),y.type==="invalid"){a.set(!1);return}}const p=await s(c.signal.value);a.set(!1),p.type==="invalid"&&o(p)},submitting:a}}exports.ArrayController=q;exports.BaseControl=x;exports.BaseMappedControl=F;exports.CheckboxInput=J;exports.CloseButton=G;exports.Control=Z;exports.Controller=k;exports.ControllerValidation=se;exports.InputWrapper=M;exports.MappedControl=ee;exports.O=D;exports.ObjectController=N;exports.RequiredSymbol=P;exports.connectCommonAttributes=A;exports.connectNumberInput=ie;exports.connectStringInput=ne;exports.convertStandardSchemaIssues=L;exports.convertStandardSchemaPathToPath=z;exports.makeMapValidation=T;exports.makeOnBlurHandler=H;exports.makeOnChangeHandler=O;exports.parsePath=te;exports.pathToString=W;exports.standardSchemaResultToValidation=S;exports.taskToValidation=re;exports.useController=R;exports.useForm=ae;exports.wrapSegment=$;
|
package/dist/utils-DEbsp9Q9.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { html as n, attr as i, computedOf as l } from "@tempots/dom";
|
|
2
|
-
function g(e, r, t) {
|
|
3
|
-
const u = ["bc-card"];
|
|
4
|
-
return e !== "default" && u.push(`bc-card--${e}`), r !== "md" && u.push(`bc-card--padding-${r}`), t !== "lg" && u.push(`bc-card--rounded-${t}`), u.join(" ");
|
|
5
|
-
}
|
|
6
|
-
function y({ variant: e = "default", size: r = "md", roundedness: t = "lg" } = {}, ...u) {
|
|
7
|
-
return n.div(
|
|
8
|
-
i.class(
|
|
9
|
-
l(
|
|
10
|
-
e,
|
|
11
|
-
r,
|
|
12
|
-
t
|
|
13
|
-
)(
|
|
14
|
-
(c, s, o) => g(
|
|
15
|
-
c ?? "default",
|
|
16
|
-
s ?? "md",
|
|
17
|
-
o ?? "lg"
|
|
18
|
-
)
|
|
19
|
-
)
|
|
20
|
-
),
|
|
21
|
-
...u
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
const a = ["description", "comment", "notes", "text"];
|
|
25
|
-
function p(e) {
|
|
26
|
-
if (typeof e == "boolean") return a;
|
|
27
|
-
const r = e["x:ui"];
|
|
28
|
-
return r && Array.isArray(r.textAreaTriggers) ? [...a, ...r.textAreaTriggers] : a;
|
|
29
|
-
}
|
|
30
|
-
function d(e) {
|
|
31
|
-
if (typeof e == "boolean") return;
|
|
32
|
-
const r = e["x:ui"];
|
|
33
|
-
if (r != null && (typeof r == "string" || typeof r == "object" && r !== null))
|
|
34
|
-
return r;
|
|
35
|
-
}
|
|
36
|
-
function x(e, r) {
|
|
37
|
-
if (typeof e == "boolean") return;
|
|
38
|
-
const t = d(e);
|
|
39
|
-
if (typeof t == "object" && typeof t.widget == "string")
|
|
40
|
-
return {
|
|
41
|
-
widget: t.widget,
|
|
42
|
-
source: "explicit-widget",
|
|
43
|
-
options: t
|
|
44
|
-
};
|
|
45
|
-
const u = typeof t == "string" ? t : typeof t == "object" && typeof t.format == "string" ? t.format : void 0;
|
|
46
|
-
if (u)
|
|
47
|
-
return {
|
|
48
|
-
widget: u,
|
|
49
|
-
source: "explicit-format",
|
|
50
|
-
options: typeof t == "object" ? t : void 0
|
|
51
|
-
};
|
|
52
|
-
if (typeof e.format == "string")
|
|
53
|
-
return {
|
|
54
|
-
widget: {
|
|
55
|
-
datetime: "date-time",
|
|
56
|
-
base64: "binary",
|
|
57
|
-
bytes: "binary",
|
|
58
|
-
iri: "uri",
|
|
59
|
-
"iri-reference": "uri-reference",
|
|
60
|
-
"idn-hostname": "hostname"
|
|
61
|
-
}[e.format] || e.format,
|
|
62
|
-
source: "schema-format"
|
|
63
|
-
};
|
|
64
|
-
if (e.contentMediaType === "text/markdown")
|
|
65
|
-
return {
|
|
66
|
-
widget: "markdown",
|
|
67
|
-
source: "schema-media"
|
|
68
|
-
};
|
|
69
|
-
if (e.contentMediaType != null || e.contentEncoding === "base64")
|
|
70
|
-
return {
|
|
71
|
-
widget: "binary",
|
|
72
|
-
source: "schema-media",
|
|
73
|
-
options: {
|
|
74
|
-
mediaType: e.contentMediaType,
|
|
75
|
-
encoding: e.contentEncoding
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
if (e.enum != null)
|
|
79
|
-
return {
|
|
80
|
-
widget: "enum",
|
|
81
|
-
source: "constraints"
|
|
82
|
-
};
|
|
83
|
-
if (e.const != null)
|
|
84
|
-
return {
|
|
85
|
-
widget: "const",
|
|
86
|
-
source: "constraints"
|
|
87
|
-
};
|
|
88
|
-
if ((e.type === "number" || e.type === "integer" || Array.isArray(e.type) && e.type.some((s) => s === "number" || s === "integer")) && e.minimum != null && e.maximum != null)
|
|
89
|
-
return e.maximum - e.minimum <= 5 && e.minimum >= 0 && e.minimum <= 1 && (e.multipleOf == null || e.multipleOf >= 1) ? {
|
|
90
|
-
widget: "rating",
|
|
91
|
-
source: "constraints",
|
|
92
|
-
options: { max: e.maximum }
|
|
93
|
-
} : {
|
|
94
|
-
widget: "slider",
|
|
95
|
-
source: "constraints",
|
|
96
|
-
options: {
|
|
97
|
-
min: e.minimum,
|
|
98
|
-
max: e.maximum,
|
|
99
|
-
step: e.multipleOf
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
if (e.type === "string") {
|
|
103
|
-
if (e.minLength != null && e.minLength > 20 || e.maxLength != null && e.maxLength > 100)
|
|
104
|
-
return {
|
|
105
|
-
widget: "textarea",
|
|
106
|
-
source: "heuristics"
|
|
107
|
-
};
|
|
108
|
-
if (r) {
|
|
109
|
-
const s = r.toLowerCase();
|
|
110
|
-
if (s.includes("password") || s.includes("secret"))
|
|
111
|
-
return { widget: "password", source: "heuristics" };
|
|
112
|
-
if (s.includes("email"))
|
|
113
|
-
return { widget: "email", source: "heuristics" };
|
|
114
|
-
if (s.includes("url") || s.includes("link"))
|
|
115
|
-
return { widget: "url", source: "heuristics" };
|
|
116
|
-
if (s.includes("color"))
|
|
117
|
-
return { widget: "color", source: "heuristics" };
|
|
118
|
-
if (p(e).some(
|
|
119
|
-
(m) => s.includes(m.toLowerCase())
|
|
120
|
-
))
|
|
121
|
-
return { widget: "textarea", source: "heuristics" };
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
export {
|
|
126
|
-
y as C,
|
|
127
|
-
d as g,
|
|
128
|
-
x as r
|
|
129
|
-
};
|
package/dist/utils-DIUEhA-Z.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("@tempots/dom");function l(e,r,t){const u=["bc-card"];return e!=="default"&&u.push(`bc-card--${e}`),r!=="md"&&u.push(`bc-card--padding-${r}`),t!=="lg"&&u.push(`bc-card--rounded-${t}`),u.join(" ")}function g({variant:e="default",size:r="md",roundedness:t="lg"}={},...u){return c.html.div(c.attr.class(c.computedOf(e,r,t)((o,s,m)=>l(o??"default",s??"md",m??"lg"))),...u)}const a=["description","comment","notes","text"];function p(e){if(typeof e=="boolean")return a;const r=e["x:ui"];return r&&Array.isArray(r.textAreaTriggers)?[...a,...r.textAreaTriggers]:a}function n(e){if(typeof e=="boolean")return;const r=e["x:ui"];if(r!=null&&(typeof r=="string"||typeof r=="object"&&r!==null))return r}function d(e,r){if(typeof e=="boolean")return;const t=n(e);if(typeof t=="object"&&typeof t.widget=="string")return{widget:t.widget,source:"explicit-widget",options:t};const u=typeof t=="string"?t:typeof t=="object"&&typeof t.format=="string"?t.format:void 0;if(u)return{widget:u,source:"explicit-format",options:typeof t=="object"?t:void 0};if(typeof e.format=="string")return{widget:{datetime:"date-time",base64:"binary",bytes:"binary",iri:"uri","iri-reference":"uri-reference","idn-hostname":"hostname"}[e.format]||e.format,source:"schema-format"};if(e.contentMediaType==="text/markdown")return{widget:"markdown",source:"schema-media"};if(e.contentMediaType!=null||e.contentEncoding==="base64")return{widget:"binary",source:"schema-media",options:{mediaType:e.contentMediaType,encoding:e.contentEncoding}};if(e.enum!=null)return{widget:"enum",source:"constraints"};if(e.const!=null)return{widget:"const",source:"constraints"};if((e.type==="number"||e.type==="integer"||Array.isArray(e.type)&&e.type.some(s=>s==="number"||s==="integer"))&&e.minimum!=null&&e.maximum!=null)return e.maximum-e.minimum<=5&&e.minimum>=0&&e.minimum<=1&&(e.multipleOf==null||e.multipleOf>=1)?{widget:"rating",source:"constraints",options:{max:e.maximum}}:{widget:"slider",source:"constraints",options:{min:e.minimum,max:e.maximum,step:e.multipleOf}};if(e.type==="string"){if(e.minLength!=null&&e.minLength>20||e.maxLength!=null&&e.maxLength>100)return{widget:"textarea",source:"heuristics"};if(r){const s=r.toLowerCase();if(s.includes("password")||s.includes("secret"))return{widget:"password",source:"heuristics"};if(s.includes("email"))return{widget:"email",source:"heuristics"};if(s.includes("url")||s.includes("link"))return{widget:"url",source:"heuristics"};if(s.includes("color"))return{widget:"color",source:"heuristics"};if(p(e).some(i=>s.includes(i.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}exports.Card=g;exports.getXUIConfig=n;exports.resolveWidget=d;
|