@tempots/beatui 0.94.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-CuI1Jgt6.cjs +1 -0
- package/dist/{ar-8Cko5i-Z.js → ar-DaKbK_t8.js} +88 -11
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BQIhr3-R.js} +99 -98
- package/dist/auth-divider-DvnUModP.cjs +1 -0
- package/dist/beatui.css +1628 -541
- package/dist/beatui.tailwind.css +1629 -542
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +9 -9
- 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-Bt-d2iKj.js → de-3MTPDS1i.js} +83 -6
- package/dist/de-DthHehbh.cjs +1 -0
- package/dist/{deep-merge-CoLO4id0.js → deep-merge-BzIheQtH.js} +511 -517
- package/dist/deep-merge-EkjEgK0N.cjs +1 -0
- package/dist/{duration-input-47x7nbGh.cjs → duration-input-ClgYjeBa.cjs} +1 -1
- package/dist/{duration-input-DrVonjKK.js → duration-input-DGzmIImj.js} +5 -5
- package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
- package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
- package/dist/es-B6GJLk9h.cjs +1 -0
- package/dist/{es-2llfNFX2.js → es-DwMUvBeU.js} +95 -18
- package/dist/{fa-CQVIBjKP.js → fa-0rvQiKrJ.js} +88 -11
- package/dist/fa-BwgP93iV.cjs +1 -0
- package/dist/{fr-CC3smTlW.js → fr-B4i6NzLl.js} +87 -10
- package/dist/fr-CQzk5zqY.cjs +1 -0
- package/dist/{he-CZilsN75.js → he-C71n-hsn.js} +88 -11
- package/dist/he-DcxxvRfs.cjs +1 -0
- package/dist/hi-D-KHVWg4.cjs +1 -0
- package/dist/{hi-CAZjwGv-.js → hi-xmrXpeVU.js} +88 -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-D6RXFIL6.js → it-CDZTtOBC.js} +84 -7
- package/dist/it-D344Dutu.cjs +1 -0
- package/dist/ja-BNgnDZ27.cjs +1 -0
- package/dist/{ja-D7zsz4Ij.js → ja-Zz1LzidW.js} +92 -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-taN2Npr4.js → ko-9laUsZDL.js} +91 -14
- package/dist/ko-D-WJ9NK7.cjs +1 -0
- package/dist/lexical/index.cjs.js +2 -39
- package/dist/lexical/index.es.js +2102 -20521
- 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-ZitwUeXx.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-CrqUlFie.cjs +1 -0
- package/dist/{nl-CRC6r4Q4.js → nl-Dcll9fVA.js} +87 -10
- package/dist/{notice-E_p2hg1G.js → notice-E19wu9lA.js} +51 -51
- package/dist/notice-_9XhdrFw.cjs +1 -0
- package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
- package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
- package/dist/pl-9UksIrvX.cjs +1 -0
- package/dist/{pl-C6qNs0Lq.js → pl-Dm9N9Gbr.js} +84 -7
- package/dist/prosemirror/index.cjs.js +3 -1
- package/dist/prosemirror/index.es.js +636 -4
- package/dist/{pt-CcWPLqBh.js → pt-CFi5cn0k.js} +89 -12
- package/dist/pt-_kfdzwqi.cjs +1 -0
- package/dist/{ru-Dt9-9m0E.js → ru-CEhZUw8R.js} +92 -15
- package/dist/ru-CW1WNNlr.cjs +1 -0
- 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-B6GIRegf.cjs +1 -0
- package/dist/{tr-CDTWeRY0.js → tr-ZmnVDhLP.js} +83 -6
- package/dist/{translations-NBY7SubC.js → translations-A4kR7CW8.js} +1 -1
- package/dist/{translations-CiBhB2FV.js → translations-B1_yyDUK.js} +185 -106
- package/dist/{translations-BdCtLBZt.cjs → translations-C81buKAw.cjs} +1 -1
- package/dist/translations-Dbx7L7Q1.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +72 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +72 -0
- package/dist/types/beatui-i18n/translations.d.ts +72 -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/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/create-nullable-string-input.d.ts +2 -2
- package/dist/types/components/form/input/date-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/email-input.d.ts +4 -4
- 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-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
- 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/lexical/toolbar/toolbar-registry.d.ts +2 -1
- 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/index.d.ts +2 -2
- package/dist/types/lexical/plugins/index.d.ts +1 -1
- package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
- package/dist/types/lexical/plugins/text.d.ts +5 -0
- package/dist/types/lexical/types.d.ts +126 -5
- package/dist/types/lexical-i18n/default.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
- package/dist/types/tokens/z-index.d.ts +18 -18
- package/dist/types/utils/use-animated-toggle.d.ts +12 -4
- package/dist/ur-CtFl_tz6.cjs +1 -0
- package/dist/{ur-CLrK5FPQ.js → ur-yYgj3NmT.js} +88 -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-BQRVnIp9.js → use-form-Dn6v2tEh.js} +153 -152
- package/dist/utils-DmEuG3Np.cjs +1 -0
- package/dist/utils-vUtP6iPG.js +165 -0
- package/dist/{vi-B1_QDUQJ.js → vi-D5u4CLQO.js} +89 -12
- package/dist/vi-DyCZSpsk.cjs +1 -0
- package/dist/widget-customization-DgW1SXN6.cjs +1 -0
- package/dist/{widget-customization-C-fSx3RB.js → widget-customization-Dkx7kNSe.js} +413 -398
- package/dist/{zh-rDtQ92Pp.js → zh-B0kwMMer.js} +91 -14
- package/dist/zh-C3ZxMQKb.cjs +1 -0
- package/package.json +209 -38
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/ar-D2DjoXta.cjs +0 -1
- package/dist/auth-divider-C3E16pml.cjs +0 -1
- package/dist/colors-BI0YhONJ.cjs +0 -1
- package/dist/de-Cdf3432J.cjs +0 -1
- package/dist/deep-merge-Blrucd-E.cjs +0 -1
- package/dist/es-6fFPkKHL.cjs +0 -1
- package/dist/fa-GXyNzAXz.cjs +0 -1
- package/dist/fr-C6EYTwSH.cjs +0 -1
- package/dist/he-CJUgxvi8.cjs +0 -1
- package/dist/hi-DqIR4VtX.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-B-cwxUsP.cjs +0 -1
- package/dist/index-BFzxpY7y.js +0 -68
- package/dist/index-BOC0cVoY.cjs +0 -36
- package/dist/index-CN10Cyqr.cjs +0 -1
- package/dist/index-CTcbhnPw.cjs +0 -4
- package/dist/index-DF7RFzD9.cjs +0 -1
- package/dist/index-DJ9YIJcG.js +0 -14308
- package/dist/index-DfPkCwdC.js +0 -2709
- package/dist/input-container-9r1F3KuX.js +0 -263
- package/dist/input-container-DiYEl_y8.cjs +0 -1
- package/dist/it-BvHsJ7fH.cjs +0 -1
- package/dist/ja-B2gP7OHY.cjs +0 -1
- package/dist/ko-BddhddIA.cjs +0 -1
- package/dist/menu-De_-sGeb.cjs +0 -1
- package/dist/modal-DUlqGUW7.cjs +0 -1
- package/dist/nl-COrtZUnH.cjs +0 -1
- package/dist/notice-DAVOTnfA.cjs +0 -1
- package/dist/oneof-branch-detection-D6Xa8qNR.cjs +0 -8
- package/dist/oneof-branch-detection-DCPwyutI.js +0 -6290
- package/dist/pl-BHI4zBgV.cjs +0 -1
- package/dist/pt-BGzC9MhU.cjs +0 -1
- package/dist/ru-CXeFbIPb.cjs +0 -1
- 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-BgPx8BbG.js +0 -45
- package/dist/text-input-DUnhBUd6.cjs +0 -1
- package/dist/timer-BJHOsuS6.cjs +0 -1
- package/dist/timer-Rd2sKnvH.js +0 -65
- package/dist/toolbar-DKOh_gbA.js +0 -118
- package/dist/toolbar-Dkc2y1dI.cjs +0 -1
- package/dist/tr-CdOtQAtA.cjs +0 -1
- package/dist/translations-Cy9hoMGV.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/ur-C7itXvnC.cjs +0 -1
- package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
- package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
- package/dist/use-form-DTyNw0kM.cjs +0 -2
- package/dist/utils-DEbsp9Q9.js +0 -129
- package/dist/utils-DIUEhA-Z.cjs +0 -1
- package/dist/vi-CQrUWB3y.cjs +0 -1
- package/dist/widget-customization-xEBfEPhQ.cjs +0 -1
- package/dist/zh-DWswYYTS.cjs +0 -1
|
@@ -14,27 +14,27 @@
|
|
|
14
14
|
* | Name | Value | Use case |
|
|
15
15
|
* |--------------|-------|-------------------------|
|
|
16
16
|
* | base | 0 | Default stacking |
|
|
17
|
-
* | raised |
|
|
18
|
-
* | navigation |
|
|
19
|
-
* | sidebar |
|
|
20
|
-
* | overlay |
|
|
21
|
-
* | modal |
|
|
22
|
-
* | tooltip |
|
|
23
|
-
* | popover |
|
|
24
|
-
* | notification |
|
|
25
|
-
* | maximum |
|
|
17
|
+
* | raised | 100 | Slightly elevated items |
|
|
18
|
+
* | navigation | 200 | Nav bars, headers |
|
|
19
|
+
* | sidebar | 200 | Side navigation |
|
|
20
|
+
* | overlay | 500 | Backdrop overlays |
|
|
21
|
+
* | modal | 600 | Modal dialogs |
|
|
22
|
+
* | tooltip | 700 | Tooltip content |
|
|
23
|
+
* | popover | 800 | Popover menus |
|
|
24
|
+
* | notification | 900 | Toast notifications |
|
|
25
|
+
* | maximum | 1000 | Highest priority |
|
|
26
26
|
*/
|
|
27
27
|
export declare const zIndex: {
|
|
28
28
|
readonly base: 0;
|
|
29
|
-
readonly raised:
|
|
30
|
-
readonly navigation:
|
|
31
|
-
readonly sidebar:
|
|
32
|
-
readonly overlay:
|
|
33
|
-
readonly modal:
|
|
34
|
-
readonly tooltip:
|
|
35
|
-
readonly popover:
|
|
36
|
-
readonly notification:
|
|
37
|
-
readonly maximum:
|
|
29
|
+
readonly raised: 100;
|
|
30
|
+
readonly navigation: 200;
|
|
31
|
+
readonly sidebar: 200;
|
|
32
|
+
readonly overlay: 500;
|
|
33
|
+
readonly modal: 600;
|
|
34
|
+
readonly tooltip: 700;
|
|
35
|
+
readonly popover: 800;
|
|
36
|
+
readonly notification: 900;
|
|
37
|
+
readonly maximum: 1000;
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
40
|
* Union type of all available z-index layer names.
|
|
@@ -4,8 +4,10 @@ export type AnimatedToggleOptions = {
|
|
|
4
4
|
initialStatus?: ToggleStatus;
|
|
5
5
|
openedAfter: (cb: () => void) => () => void;
|
|
6
6
|
closedAfter: (cb: () => void) => () => void;
|
|
7
|
+
/** When true, skips animation delays and transitions instantly. */
|
|
8
|
+
reducedMotion?: Signal<boolean>;
|
|
7
9
|
};
|
|
8
|
-
export declare function useAnimatedToggle({ initialStatus, openedAfter, closedAfter, }: AnimatedToggleOptions): {
|
|
10
|
+
export declare function useAnimatedToggle({ initialStatus, openedAfter, closedAfter, reducedMotion, }: AnimatedToggleOptions): {
|
|
9
11
|
status: Signal<ToggleStatus>;
|
|
10
12
|
open: () => void;
|
|
11
13
|
close: () => void;
|
|
@@ -26,8 +28,10 @@ export type TimedToggleOptions = {
|
|
|
26
28
|
openDuration?: number;
|
|
27
29
|
closeDuration?: number;
|
|
28
30
|
duration?: number;
|
|
31
|
+
/** When true, skips animation delays and transitions instantly. */
|
|
32
|
+
reducedMotion?: Signal<boolean>;
|
|
29
33
|
};
|
|
30
|
-
export declare function useTimedToggle({ initialStatus, duration, openDuration, closeDuration, }?: TimedToggleOptions): {
|
|
34
|
+
export declare function useTimedToggle({ initialStatus, duration, openDuration, closeDuration, reducedMotion, }?: TimedToggleOptions): {
|
|
31
35
|
status: Signal<ToggleStatus>;
|
|
32
36
|
open: () => void;
|
|
33
37
|
close: () => void;
|
|
@@ -46,8 +50,10 @@ export declare function useTimedToggle({ initialStatus, duration, openDuration,
|
|
|
46
50
|
export type AnimatedElementToggleOptions = {
|
|
47
51
|
initialStatus?: ToggleStatus;
|
|
48
52
|
element?: HTMLElement;
|
|
53
|
+
/** When true, skips animation delays and transitions instantly. */
|
|
54
|
+
reducedMotion?: Signal<boolean>;
|
|
49
55
|
};
|
|
50
|
-
export declare function useAnimatedElementToggle({ initialStatus, element, }?: AnimatedElementToggleOptions): {
|
|
56
|
+
export declare function useAnimatedElementToggle({ initialStatus, element, reducedMotion, }?: AnimatedElementToggleOptions): {
|
|
51
57
|
status: Signal<ToggleStatus>;
|
|
52
58
|
open: () => void;
|
|
53
59
|
close: () => void;
|
|
@@ -82,9 +88,11 @@ export declare function AnimatedToggleClass({ animation, status, }: {
|
|
|
82
88
|
animation?: Value<AnimationConfig>;
|
|
83
89
|
status: Signal<ToggleStatus>;
|
|
84
90
|
}): import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
|
|
85
|
-
export declare function AnimatedToggle({ initialStatus, animation, }: {
|
|
91
|
+
export declare function AnimatedToggle({ initialStatus, animation, reducedMotion, }: {
|
|
86
92
|
initialStatus?: ToggleStatus;
|
|
87
93
|
animation?: Value<AnimationConfig>;
|
|
94
|
+
/** When true, skips animation delays and transitions instantly. */
|
|
95
|
+
reducedMotion?: Signal<boolean>;
|
|
88
96
|
}, render: (options: {
|
|
89
97
|
status: Signal<ToggleStatus>;
|
|
90
98
|
open: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./translations-Dbx7L7Q1.cjs"),r={loadingExtended:"لوڈ ہو رہا ہے، براہ کرم انتظار کریں",loadingShort:"لوڈ ہو رہا ہے...",locale:"زبان",iconDescription:"آئیکن",loadingIcon:"لوڈنگ آئیکن",failedToLoadIcon:"آئیکن لوڈ کرنے میں ناکام",editLabel:"ترمیم",selectOne:"ایک منتخب کریں",selectNone:"کوئی نہیں",selectMany:"متعدد منتخب کریں",noResults:"کوئی نتیجہ نہیں",passwordPlaceholderText:"خفیہ پاس ورڈ",togglePasswordVisibility:"پاس ورڈ کی مرئیت تبدیل کریں",toggleMenu:"مینو ٹوگل کریں",toggleAside:"سائیڈ پینل ٹوگل کریں",mainNavigation:"بنیادی نیویگیشن",sidebar:"سائیڈ بار",closeDrawer:"دراز بند کریں",closeModal:"ماڈل بند کریں",confirm:"تصدیق",cancel:"منسوخ",addLabel:"شامل کریں",removeItem:"آئٹم ہٹائیں",currentLocale:"اردو",ar:"عربی",de:"جرمن",en:"انگریزی",es:"ہسپانوی",fr:"فرانسیسی",he:"عبرانی",hi:"ہندی",it:"اطالوی",ja:"جاپانی",ko:"کوریائی",nl:"ڈچ",pl:"پولش",pt:"پرتگالی",ru:"روسی",tr:"ترکی",vi:"ویتنامی",zh:"چینی",fa:"فارسی",ur:"اردو",emailPlaceholderText:"اپنا ای میل داخل کریں",incrementValue:"قدر اضافہ کریں",decrementValue:"قدر کم کریں",dropZoneInstructions:e=>e?"منتخب کرنے کے لیے کلک کریں یا فائلیں یہاں گھسیٹیں، یا فائل منتخب کرنے کے لیے Enter یا Space دبائیں":"فائلیں یہاں گھسیٹیں",fileSizeUnits:["بائٹس","KB","MB","GB","TB"],removeFile:"فائل حذف کریں",clearAllFiles:"تمام فائلیں صاف کریں",clearValue:"قدر صاف کریں",unknownType:"نامعلوم قسم",filesInputInstructions:(e,t,l)=>{let n=e==null||e>1?"منتخب کرنے کے لیے کلک کریں یا فائلیں یہاں گھسیٹیں":"منتخب کرنے کے لیے کلک کریں یا فائل یہاں گھسیٹیں";if(e||t){const o=[];if(e!=null&&e>1&&o.push(`زیادہ سے زیادہ ${e} فائلیں`),t&&l){const a=i.formatFileSize(t,{units:l});o.push(`ہر ایک زیادہ سے زیادہ ${a}`)}o.length>0&&(n+=` (${o.join("، ")})`)}return n},paginationLabel:"صفحہ بندی",firstPage:"پہلا صفحہ",previousPage:"پچھلا صفحہ",nextPage:"اگلا صفحہ",lastPage:"آخری صفحہ",breadcrumbs:"بریڈ کرمبز",commandPalette:"کمانڈ پیلیٹ",typeACommand:"کمانڈ ٹائپ کریں...",noResultsFound:"کوئی نتیجہ نہیں ملا",noMatchingCommands:"کوئی مماثل کمانڈ نہیں ملی",appearanceSystem:"سسٹم",appearanceLight:"ہلکا",appearanceDark:"گہرا",ok:"OK",changeTypeConfirmation:"قسم تبدیل کرنے سے موجودہ قدر صاف ہو جائے گی۔ جاری رکھیں؟",notifications:"اطلاعات",markAllAsRead:"سب کو پڑھا ہوا نشان زد کریں",noNotifications:"کوئی اطلاع نہیں",schemaConflictsDetected:"اسکیما تنازعات کا پتا چلا",schemaViolationsDetected:"اسکیما خلاف ورزیوں کا پتا چلا",properties:"خصوصیات",uploading:"اپ لوڈ ہو رہا ہے...",dropFilesOrBrowse:"فائلیں یہاں چھوڑیں یا براؤز کرنے کے لیے کلک کریں",acceptedTypes:e=>`قابل قبول اقسام: ${e}`,enterUrlPrompt:"URL درج کریں:",exceeded:"(حد سے تجاوز)",pdfPreview:"PDF پیش نظارہ",lexical:{fontFamily:"فونٹ فیملی",fontSize:"فونٹ سائز",lineHeight:"لائن کی اونچائی",fontColor:"فونٹ رنگ",highlightColor:"ہائی لائٹ رنگ",backgroundColor:"پس منظر رنگ",bold:"بولڈ",italic:"ترچھا",underline:"خط کشیدہ",strikethrough:"کٹا ہوا",code:"کوڈ",clearFormatting:"فارمیٹنگ صاف کریں",normal:"عام",heading:e=>`سرخی ${e}`,bulletList:"بلٹ فہرست",orderedList:"نمبر شدہ فہرست",checkList:"چیک فہرست",indent:"اندر کریں",outdent:"باہر کریں",blockquote:"اقتباس",codeBlock:"کوڈ بلاک",horizontalRule:"افقی لکیر",insertTable:"ٹیبل داخل کریں",link:"لنک",undo:"واپس",redo:"دوبارہ",cut:"کاٹیں",copy:"نقل",paste:"چسپاں",defaultOption:"پہلے سے طے شدہ",slashCommands:"سلیش کمانڈز",noCommandsFound:"کوئی کمانڈ نہیں ملی",changeBlockType:"بلاک کی قسم تبدیل کریں",blockTypes:"بلاک کی اقسام",enterUrl:"URL درج کریں:",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:"صعودی ترتیب",sortDescending:"نزولی ترتیب",clearSort:"ترتیب صاف کریں",filterPlaceholder:"فلٹر...",clearFilter:"فلٹر صاف کریں",selectAll:"سب منتخب کریں",deselectAll:"سب غیر منتخب کریں",selectedCount:e=>`${e} منتخب`,resetAll:"سب ری سیٹ کریں",noResults:"کوئی نتائج نہیں ملے",loading:"لوڈ ہو رہا ہے...",filterPanelAddCondition:"شرط شامل کریں",filterPanelApply:"لاگو کریں",filterPanelClear:"فلٹرز صاف کریں",filterPanelAnd:"اور",filterPanelOr:"یا",filterPanelContains:"شامل ہے",filterPanelNotContains:"شامل نہیں ہے",filterPanelEquals:"برابر ہے",filterPanelNotEquals:"برابر نہیں ہے",filterPanelStartsWith:"سے شروع ہوتا ہے",filterPanelEndsWith:"پر ختم ہوتا ہے",filterPanelIsNull:"خالی ہے",filterPanelIsNotNull:"خالی نہیں ہے",filterPanelGt:"سے بڑا",filterPanelGte:"سے بڑا یا برابر",filterPanelLt:"سے چھوٹا",filterPanelLte:"سے چھوٹا یا برابر",filterPanelBetween:"کے درمیان",filterPanelValuePlaceholder:"قدر...",sortMultiHint:"متعدد کالموں کو ترتیب دینے کے لیے Shift دبائیں",columnVisibility:"کالم",showAllColumns:"سب دکھائیں",menuSortAsc:"صعودی ترتیب",menuSortDesc:"نزولی ترتیب",menuClearSort:"ترتیب ہٹائیں",menuHideColumn:"کالم چھپائیں",menuChooseColumns:"کالم منتخب کریں",menuResetColumns:"کالم ری سیٹ کریں",menuFilter:"فلٹر",rowCount:(e,t)=>`قطاریں: ${e} کل قطاریں: ${t}`,filterTagsPlaceholder:"قدریں منتخب کریں...",groupCount:e=>`${e} آئٹم`,collapseGroup:"گروپ سکیڑیں",expandGroup:"گروپ پھیلائیں",describeFilter:{textContains:(e,t)=>`${e} "${t}" پر مشتمل`,textNotContains:(e,t)=>`${e} "${t}" پر مشتمل نہیں`,textEquals:(e,t)=>`${e} "${t}" کے برابر`,textNotEquals:(e,t)=>`${e} "${t}" کے برابر نہیں`,textStartsWith:(e,t)=>`${e} "${t}" سے شروع ہوتا ہے`,textEndsWith:(e,t)=>`${e} "${t}" پر ختم ہوتا ہے`,compareEq:(e,t)=>`${e} = ${t}`,compareNeq:(e,t)=>`${e} ≠ ${t}`,compareGt:(e,t)=>`${e} > ${t}`,compareGte:(e,t)=>`${e} ≥ ${t}`,compareLt:(e,t)=>`${e} < ${t}`,compareLte:(e,t)=>`${e} ≤ ${t}`,rangeBetween:(e,t,l)=>`${e} ${t} اور ${l} کے درمیان`,rangeGte:(e,t)=>`${e} ≥ ${t}`,rangeLte:(e,t)=>`${e} ≤ ${t}`,setIn:(e,t)=>`${e} [${t}] میں`,setNotIn:(e,t)=>`${e} [${t}] میں نہیں`,booleanIs:(e,t)=>`${e} ${t} ہے`,isNull:e=>`${e} خالی ہے`,isNotNull:e=>`${e} خالی نہیں ہے`,compositeAnd:e=>e.join(" اور "),compositeOr:e=>e.join(" یا ")}},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:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,t)=>`Page ${e} is out of range (1-${t})`,renderFailed:"Failed to render PDF page"}};exports.default=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as i } from "./translations-
|
|
2
|
-
const
|
|
1
|
+
import { f as i } from "./translations-B1_yyDUK.js";
|
|
2
|
+
const s = {
|
|
3
3
|
loadingExtended: "لوڈ ہو رہا ہے، براہ کرم انتظار کریں",
|
|
4
4
|
loadingShort: "لوڈ ہو رہا ہے...",
|
|
5
5
|
locale: "زبان",
|
|
@@ -58,17 +58,17 @@ const d = {
|
|
|
58
58
|
// inputs reset
|
|
59
59
|
clearValue: "قدر صاف کریں",
|
|
60
60
|
unknownType: "نامعلوم قسم",
|
|
61
|
-
filesInputInstructions: (e,
|
|
61
|
+
filesInputInstructions: (e, t, l) => {
|
|
62
62
|
let n = e == null || e > 1 ? "منتخب کرنے کے لیے کلک کریں یا فائلیں یہاں گھسیٹیں" : "منتخب کرنے کے لیے کلک کریں یا فائل یہاں گھسیٹیں";
|
|
63
|
-
if (e ||
|
|
64
|
-
const
|
|
65
|
-
if (e != null && e > 1 &&
|
|
66
|
-
const a = i(
|
|
63
|
+
if (e || t) {
|
|
64
|
+
const o = [];
|
|
65
|
+
if (e != null && e > 1 && o.push(`زیادہ سے زیادہ ${e} فائلیں`), t && l) {
|
|
66
|
+
const a = i(t, {
|
|
67
67
|
units: l
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
o.push(`ہر ایک زیادہ سے زیادہ ${a}`);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
o.length > 0 && (n += ` (${o.join("، ")})`);
|
|
72
72
|
}
|
|
73
73
|
return n;
|
|
74
74
|
},
|
|
@@ -113,6 +113,7 @@ const d = {
|
|
|
113
113
|
lexical: {
|
|
114
114
|
fontFamily: "فونٹ فیملی",
|
|
115
115
|
fontSize: "فونٹ سائز",
|
|
116
|
+
lineHeight: "لائن کی اونچائی",
|
|
116
117
|
fontColor: "فونٹ رنگ",
|
|
117
118
|
highlightColor: "ہائی لائٹ رنگ",
|
|
118
119
|
backgroundColor: "پس منظر رنگ",
|
|
@@ -155,6 +156,82 @@ const d = {
|
|
|
155
156
|
deleteTable: "Delete table"
|
|
156
157
|
},
|
|
157
158
|
// prosemirror
|
|
159
|
+
dataTable: {
|
|
160
|
+
sortAscending: "صعودی ترتیب",
|
|
161
|
+
sortDescending: "نزولی ترتیب",
|
|
162
|
+
clearSort: "ترتیب صاف کریں",
|
|
163
|
+
filterPlaceholder: "فلٹر...",
|
|
164
|
+
clearFilter: "فلٹر صاف کریں",
|
|
165
|
+
selectAll: "سب منتخب کریں",
|
|
166
|
+
deselectAll: "سب غیر منتخب کریں",
|
|
167
|
+
selectedCount: (e) => `${e} منتخب`,
|
|
168
|
+
resetAll: "سب ری سیٹ کریں",
|
|
169
|
+
noResults: "کوئی نتائج نہیں ملے",
|
|
170
|
+
loading: "لوڈ ہو رہا ہے...",
|
|
171
|
+
// Filter panel
|
|
172
|
+
filterPanelAddCondition: "شرط شامل کریں",
|
|
173
|
+
filterPanelApply: "لاگو کریں",
|
|
174
|
+
filterPanelClear: "فلٹرز صاف کریں",
|
|
175
|
+
filterPanelAnd: "اور",
|
|
176
|
+
filterPanelOr: "یا",
|
|
177
|
+
filterPanelContains: "شامل ہے",
|
|
178
|
+
filterPanelNotContains: "شامل نہیں ہے",
|
|
179
|
+
filterPanelEquals: "برابر ہے",
|
|
180
|
+
filterPanelNotEquals: "برابر نہیں ہے",
|
|
181
|
+
filterPanelStartsWith: "سے شروع ہوتا ہے",
|
|
182
|
+
filterPanelEndsWith: "پر ختم ہوتا ہے",
|
|
183
|
+
filterPanelIsNull: "خالی ہے",
|
|
184
|
+
filterPanelIsNotNull: "خالی نہیں ہے",
|
|
185
|
+
filterPanelGt: "سے بڑا",
|
|
186
|
+
filterPanelGte: "سے بڑا یا برابر",
|
|
187
|
+
filterPanelLt: "سے چھوٹا",
|
|
188
|
+
filterPanelLte: "سے چھوٹا یا برابر",
|
|
189
|
+
filterPanelBetween: "کے درمیان",
|
|
190
|
+
filterPanelValuePlaceholder: "قدر...",
|
|
191
|
+
sortMultiHint: "متعدد کالموں کو ترتیب دینے کے لیے Shift دبائیں",
|
|
192
|
+
columnVisibility: "کالم",
|
|
193
|
+
showAllColumns: "سب دکھائیں",
|
|
194
|
+
// Column header menu
|
|
195
|
+
menuSortAsc: "صعودی ترتیب",
|
|
196
|
+
menuSortDesc: "نزولی ترتیب",
|
|
197
|
+
menuClearSort: "ترتیب ہٹائیں",
|
|
198
|
+
menuHideColumn: "کالم چھپائیں",
|
|
199
|
+
menuChooseColumns: "کالم منتخب کریں",
|
|
200
|
+
menuResetColumns: "کالم ری سیٹ کریں",
|
|
201
|
+
menuFilter: "فلٹر",
|
|
202
|
+
// Row count footer
|
|
203
|
+
rowCount: (e, t) => `قطاریں: ${e} کل قطاریں: ${t}`,
|
|
204
|
+
// Tags filter
|
|
205
|
+
filterTagsPlaceholder: "قدریں منتخب کریں...",
|
|
206
|
+
// Group by
|
|
207
|
+
groupCount: (e) => `${e} آئٹم`,
|
|
208
|
+
collapseGroup: "گروپ سکیڑیں",
|
|
209
|
+
expandGroup: "گروپ پھیلائیں",
|
|
210
|
+
describeFilter: {
|
|
211
|
+
textContains: (e, t) => `${e} "${t}" پر مشتمل`,
|
|
212
|
+
textNotContains: (e, t) => `${e} "${t}" پر مشتمل نہیں`,
|
|
213
|
+
textEquals: (e, t) => `${e} "${t}" کے برابر`,
|
|
214
|
+
textNotEquals: (e, t) => `${e} "${t}" کے برابر نہیں`,
|
|
215
|
+
textStartsWith: (e, t) => `${e} "${t}" سے شروع ہوتا ہے`,
|
|
216
|
+
textEndsWith: (e, t) => `${e} "${t}" پر ختم ہوتا ہے`,
|
|
217
|
+
compareEq: (e, t) => `${e} = ${t}`,
|
|
218
|
+
compareNeq: (e, t) => `${e} ≠ ${t}`,
|
|
219
|
+
compareGt: (e, t) => `${e} > ${t}`,
|
|
220
|
+
compareGte: (e, t) => `${e} ≥ ${t}`,
|
|
221
|
+
compareLt: (e, t) => `${e} < ${t}`,
|
|
222
|
+
compareLte: (e, t) => `${e} ≤ ${t}`,
|
|
223
|
+
rangeBetween: (e, t, l) => `${e} ${t} اور ${l} کے درمیان`,
|
|
224
|
+
rangeGte: (e, t) => `${e} ≥ ${t}`,
|
|
225
|
+
rangeLte: (e, t) => `${e} ≤ ${t}`,
|
|
226
|
+
setIn: (e, t) => `${e} [${t}] میں`,
|
|
227
|
+
setNotIn: (e, t) => `${e} [${t}] میں نہیں`,
|
|
228
|
+
booleanIs: (e, t) => `${e} ${t} ہے`,
|
|
229
|
+
isNull: (e) => `${e} خالی ہے`,
|
|
230
|
+
isNotNull: (e) => `${e} خالی نہیں ہے`,
|
|
231
|
+
compositeAnd: (e) => e.join(" اور "),
|
|
232
|
+
compositeOr: (e) => e.join(" یا ")
|
|
233
|
+
}
|
|
234
|
+
},
|
|
158
235
|
prosemirror: {
|
|
159
236
|
bold: "Bold",
|
|
160
237
|
italic: "Italic",
|
|
@@ -174,10 +251,10 @@ const d = {
|
|
|
174
251
|
loading: "Loading PDF...",
|
|
175
252
|
loadFailed: "Failed to load PDF",
|
|
176
253
|
invalidPdf: "Invalid PDF file",
|
|
177
|
-
pageOutOfRange: (e,
|
|
254
|
+
pageOutOfRange: (e, t) => `Page ${e} is out of range (1-${t})`,
|
|
178
255
|
renderFailed: "Failed to render PDF page"
|
|
179
256
|
}
|
|
180
257
|
};
|
|
181
258
|
export {
|
|
182
|
-
|
|
259
|
+
s as default
|
|
183
260
|
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { WithElement as E, Fragment as T, OnDispose as k, computedOf as A, attr as w, Value as g, prop as B } from "@tempots/dom";
|
|
2
|
+
import { delayedAnimationFrame as m, delayed as y } from "@tempots/std";
|
|
3
|
+
function b({
|
|
4
|
+
initialStatus: n = "closed",
|
|
5
|
+
openedAfter: t,
|
|
6
|
+
closedAfter: r,
|
|
7
|
+
reducedMotion: s
|
|
8
|
+
}) {
|
|
9
|
+
const e = B(n), i = () => {
|
|
10
|
+
e.set("start-opening");
|
|
11
|
+
}, c = () => {
|
|
12
|
+
e.set("start-closing");
|
|
13
|
+
}, u = e.map(
|
|
14
|
+
(o) => o !== "closed" && o !== "start-closing" && o !== "closing"
|
|
15
|
+
), a = (o) => {
|
|
16
|
+
o ? i() : c();
|
|
17
|
+
}, l = () => {
|
|
18
|
+
a(!u.value);
|
|
19
|
+
}, p = [], O = (o) => {
|
|
20
|
+
p.push(
|
|
21
|
+
e.on(
|
|
22
|
+
(f) => {
|
|
23
|
+
f === "closed" && o();
|
|
24
|
+
},
|
|
25
|
+
{ skipInitial: !0 }
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
let d = () => {
|
|
30
|
+
};
|
|
31
|
+
e.on((o) => {
|
|
32
|
+
d();
|
|
33
|
+
const f = s != null && g.get(s);
|
|
34
|
+
switch (o) {
|
|
35
|
+
case "start-opening":
|
|
36
|
+
f ? e.set("opened") : d = m(() => e.set("opening"));
|
|
37
|
+
break;
|
|
38
|
+
case "opening":
|
|
39
|
+
d = t(() => e.set("opened"));
|
|
40
|
+
break;
|
|
41
|
+
case "start-closing":
|
|
42
|
+
f ? e.set("closed") : d = m(() => e.set("closing"));
|
|
43
|
+
break;
|
|
44
|
+
case "closing":
|
|
45
|
+
d = r(() => e.set("closed"));
|
|
46
|
+
break;
|
|
47
|
+
case "closed":
|
|
48
|
+
d = () => {
|
|
49
|
+
};
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}), e.onDispose(() => {
|
|
53
|
+
p.forEach((o) => o()), d();
|
|
54
|
+
});
|
|
55
|
+
const L = e.map((o) => o === "closed"), S = e.map((o) => o === "start-opening"), $ = e.map((o) => o === "opening"), C = e.map((o) => o === "opened"), P = e.map((o) => o === "closing"), x = e.map((o) => o === "start-closing");
|
|
56
|
+
return {
|
|
57
|
+
status: e,
|
|
58
|
+
open: i,
|
|
59
|
+
close: c,
|
|
60
|
+
toggle: l,
|
|
61
|
+
setOpen: a,
|
|
62
|
+
display: u,
|
|
63
|
+
isClosed: L,
|
|
64
|
+
isStartOpening: S,
|
|
65
|
+
isOpening: $,
|
|
66
|
+
isOpened: C,
|
|
67
|
+
isClosing: P,
|
|
68
|
+
isStartClosing: x,
|
|
69
|
+
dispose: () => e.dispose(),
|
|
70
|
+
listenOnClosed: O
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function V({
|
|
74
|
+
initialStatus: n = "closed",
|
|
75
|
+
duration: t,
|
|
76
|
+
openDuration: r = t ?? 500,
|
|
77
|
+
closeDuration: s = t ?? 500,
|
|
78
|
+
reducedMotion: e
|
|
79
|
+
} = {}) {
|
|
80
|
+
return b({
|
|
81
|
+
initialStatus: n,
|
|
82
|
+
reducedMotion: e,
|
|
83
|
+
openedAfter: (i) => y(i, r),
|
|
84
|
+
closedAfter: (i) => y(i, s)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function h(n, t) {
|
|
88
|
+
let r = !1, s = null;
|
|
89
|
+
function e() {
|
|
90
|
+
r || (r = !0, n.removeEventListener("transitionend", i), n.removeEventListener("animationend", c), s && (clearTimeout(s), s = null), t());
|
|
91
|
+
}
|
|
92
|
+
function i(l) {
|
|
93
|
+
l.target === n && e();
|
|
94
|
+
}
|
|
95
|
+
function c(l) {
|
|
96
|
+
l.target === n && e();
|
|
97
|
+
}
|
|
98
|
+
const a = m(() => {
|
|
99
|
+
if (typeof n.getAnimations > "u") {
|
|
100
|
+
s = setTimeout(e, 16);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
n.addEventListener("transitionend", i), n.addEventListener("animationend", c), n.getAnimations().length === 0 && (s = setTimeout(e, 1e3));
|
|
104
|
+
});
|
|
105
|
+
return () => {
|
|
106
|
+
r = !0, a(), s && (clearTimeout(s), s = null), n.removeEventListener("transitionend", i), n.removeEventListener("animationend", c);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function D({
|
|
110
|
+
initialStatus: n = "closed",
|
|
111
|
+
element: t,
|
|
112
|
+
reducedMotion: r
|
|
113
|
+
} = {}) {
|
|
114
|
+
let s = t;
|
|
115
|
+
return {
|
|
116
|
+
setElement: (e) => {
|
|
117
|
+
s = e;
|
|
118
|
+
},
|
|
119
|
+
...b({
|
|
120
|
+
initialStatus: n,
|
|
121
|
+
reducedMotion: r,
|
|
122
|
+
openedAfter: (e) => s == null ? (e(), () => {
|
|
123
|
+
}) : h(s, e),
|
|
124
|
+
closedAfter: (e) => s == null ? (e(), () => {
|
|
125
|
+
}) : h(s, e)
|
|
126
|
+
})
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function F(n) {
|
|
130
|
+
if (n == null) return [];
|
|
131
|
+
const t = [];
|
|
132
|
+
return n.fade && t.push("fade"), n.slide && t.push(`slide-${n.slide}`), n.scale != null && t.push("scale"), t.length > 0 ? t : ["none"];
|
|
133
|
+
}
|
|
134
|
+
function N(n) {
|
|
135
|
+
if (n == null) return [];
|
|
136
|
+
const t = [];
|
|
137
|
+
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;
|
|
138
|
+
}
|
|
139
|
+
function v(n, t) {
|
|
140
|
+
if (n == null) return;
|
|
141
|
+
const r = t === "start-opening" || t === "opening" || t === "opened";
|
|
142
|
+
return "enter" in n || "exit" in n ? r ? n.enter : n.exit : n;
|
|
143
|
+
}
|
|
144
|
+
function j({
|
|
145
|
+
animation: n,
|
|
146
|
+
status: t
|
|
147
|
+
}) {
|
|
148
|
+
const r = A(
|
|
149
|
+
n,
|
|
150
|
+
t
|
|
151
|
+
)((s, e) => {
|
|
152
|
+
const i = v(s, e), u = F(i).map((a) => `bc-animated-toggle--${a}`).join(" ");
|
|
153
|
+
return u ? `bc-animated-toggle ${u} bc-animated-toggle--${e}` : `bc-animated-toggle bc-animated-toggle--${e}`;
|
|
154
|
+
});
|
|
155
|
+
return T(
|
|
156
|
+
w.class(r),
|
|
157
|
+
E((s) => {
|
|
158
|
+
let e = [];
|
|
159
|
+
function i(a) {
|
|
160
|
+
for (const l of e)
|
|
161
|
+
s.style.removeProperty(l);
|
|
162
|
+
e = a.map(([l]) => l);
|
|
163
|
+
for (const [l, p] of a)
|
|
164
|
+
s.style.setProperty(l, p);
|
|
165
|
+
}
|
|
166
|
+
const c = A(
|
|
167
|
+
n,
|
|
168
|
+
t
|
|
169
|
+
)((a, l) => {
|
|
170
|
+
const p = v(a, l);
|
|
171
|
+
return N(p);
|
|
172
|
+
});
|
|
173
|
+
i(g.get(c));
|
|
174
|
+
const u = g.on(c, i);
|
|
175
|
+
return k(() => {
|
|
176
|
+
u();
|
|
177
|
+
for (const a of e)
|
|
178
|
+
s.style.removeProperty(a);
|
|
179
|
+
});
|
|
180
|
+
})
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function W({
|
|
184
|
+
initialStatus: n = "closed",
|
|
185
|
+
animation: t,
|
|
186
|
+
reducedMotion: r
|
|
187
|
+
}, s) {
|
|
188
|
+
return E((e) => {
|
|
189
|
+
const { setElement: i, dispose: c, ...u } = D({
|
|
190
|
+
initialStatus: n,
|
|
191
|
+
element: e,
|
|
192
|
+
reducedMotion: r
|
|
193
|
+
});
|
|
194
|
+
return i(e), T(
|
|
195
|
+
j({ status: u.status, animation: t }),
|
|
196
|
+
k(c),
|
|
197
|
+
s(u)
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
export {
|
|
202
|
+
j as A,
|
|
203
|
+
W as a,
|
|
204
|
+
b,
|
|
205
|
+
V as c,
|
|
206
|
+
D as u
|
|
207
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("@tempots/dom"),f=require("@tempots/std");function A({initialStatus:n="closed",openedAfter:t,closedAfter:r,reducedMotion:s}){const e=c.prop(n),i=()=>{e.set("start-opening")},u=()=>{e.set("start-closing")},d=e.map(o=>o!=="closed"&&o!=="start-closing"&&o!=="closing"),a=o=>{o?i():u()},l=()=>{a(!d.value)},p=[],v=o=>{p.push(e.on(m=>{m==="closed"&&o()},{skipInitial:!0}))};let g=()=>{};e.on(o=>{g();const m=s!=null&&c.Value.get(s);switch(o){case"start-opening":m?e.set("opened"):g=f.delayedAnimationFrame(()=>e.set("opening"));break;case"opening":g=t(()=>e.set("opened"));break;case"start-closing":m?e.set("closed"):g=f.delayedAnimationFrame(()=>e.set("closing"));break;case"closing":g=r(()=>e.set("closed"));break;case"closed":g=()=>{};break}}),e.onDispose(()=>{p.forEach(o=>o()),g()});const O=e.map(o=>o==="closed"),k=e.map(o=>o==="start-opening"),b=e.map(o=>o==="opening"),L=e.map(o=>o==="opened"),C=e.map(o=>o==="closing"),S=e.map(o=>o==="start-closing");return{status:e,open:i,close:u,toggle:l,setOpen:a,display:d,isClosed:O,isStartOpening:k,isOpening:b,isOpened:L,isClosing:C,isStartClosing:S,dispose:()=>e.dispose(),listenOnClosed:v}}function $({initialStatus:n="closed",duration:t,openDuration:r=t??500,closeDuration:s=t??500,reducedMotion:e}={}){return A({initialStatus:n,reducedMotion:e,openedAfter:i=>f.delayed(i,r),closedAfter:i=>f.delayed(i,s)})}function y(n,t){let r=!1,s=null;function e(){r||(r=!0,n.removeEventListener("transitionend",i),n.removeEventListener("animationend",u),s&&(clearTimeout(s),s=null),t())}function i(l){l.target===n&&e()}function u(l){l.target===n&&e()}const d=()=>{if(typeof n.getAnimations>"u"){s=setTimeout(e,16);return}n.addEventListener("transitionend",i),n.addEventListener("animationend",u),n.getAnimations().length===0&&(s=setTimeout(e,1e3))},a=f.delayedAnimationFrame(d);return()=>{r=!0,a(),s&&(clearTimeout(s),s=null),n.removeEventListener("transitionend",i),n.removeEventListener("animationend",u)}}function E({initialStatus:n="closed",element:t,reducedMotion:r}={}){let s=t;return{setElement:e=>{s=e},...A({initialStatus:n,reducedMotion:r,openedAfter:e=>s==null?(e(),()=>{}):y(s,e),closedAfter:e=>s==null?(e(),()=>{}):y(s,e)})}}function F(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 r=t==="start-opening"||t==="opening"||t==="opened";return"enter"in n||"exit"in n?r?n.enter:n.exit:n}function h({animation:n,status:t}){const r=c.computedOf(n,t)((s,e)=>{const i=T(s,e),d=F(i).map(a=>`bc-animated-toggle--${a}`).join(" ");return d?`bc-animated-toggle ${d} bc-animated-toggle--${e}`:`bc-animated-toggle bc-animated-toggle--${e}`});return c.Fragment(c.attr.class(r),c.WithElement(s=>{let e=[];function i(a){for(const l of e)s.style.removeProperty(l);e=a.map(([l])=>l);for(const[l,p]of a)s.style.setProperty(l,p)}const u=c.computedOf(n,t)((a,l)=>{const p=T(a,l);return P(p)});i(c.Value.get(u));const d=c.Value.on(u,i);return c.OnDispose(()=>{d();for(const a of e)s.style.removeProperty(a)})}))}function w({initialStatus:n="closed",animation:t,reducedMotion:r},s){return c.WithElement(e=>{const{setElement:i,dispose:u,...d}=E({initialStatus:n,element:e,reducedMotion:r});return i(e),c.Fragment(h({status:d.status,animation:t}),c.OnDispose(u),s(d))})}exports.AnimatedToggle=w;exports.AnimatedToggleClass=h;exports.useAnimatedElementToggle=E;exports.useAnimatedToggle=A;exports.useTimedToggle=$;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("@tempots/dom"),_=require("./translations-Dbx7L7Q1.cjs"),B=require("./input-container-Di1YvVB_.cjs"),j=require("./stack-dwLevGa2.cjs"),T=require("./session-id-B5lJMzbB.cjs"),p=require("@tempots/std"),P=e.html.span(e.attr.class("bc-input-wrapper__required")," *");function G(n){const t=["bc-input-wrapper"];return n!=="vertical"&&t.push(`bc-input-wrapper--${n}`),t.join(" ")}function J(n,t){const s=["bc-input-wrapper__label-text"];return n?s.push("bc-input-wrapper__label-text--error"):t?s.push("bc-input-wrapper__label-text--disabled"):s.push("bc-input-wrapper__label-text--default"),s.join(" ")}function Q(n,t){if(n==="horizontal-fixed"&&t!=null)return`--input-wrapper-label-width: ${t}`}const O=({fullWidth:n=!1,required:t,label:s,labelChildren:i,context:r,description:l,content:o,error:a,labelFor:c,hasError:d,disabled:u,layout:m,labelWidth:g},...v)=>{const f=d??a!=null,h=u??!1,y=m??"vertical",w=T.sessionId("input-wrapper"),D=l?`${w}-description`:void 0,I=a!=null?`${w}-error`:void 0,A=e.computedOf(y)(b=>b!=="vertical"),K=e.computedOf(y,g??void 0)((b,C)=>Q(b,C));return e.html.div(e.attr.class(e.Value.map(y,b=>G(b))),e.attr.class(e.Value.map(n,b=>b?"bc-input-wrapper--full-width":"")),e.attr.style(K),s!=null||r!=null?e.html.div(e.attr.class("bc-input-wrapper__header"),e.html.div(e.attr.class("bc-input-wrapper__label-section"),e.html.label(e.attr.class("bc-input-wrapper__label"),c!=null?e.attr.for(c):e.Empty,e.html.span(e.attr.class(e.computedOf(f,h)((b,C)=>J(b??!1,C??!1))),s),s!=null&&t?P:e.Empty),e.When(e.computedOf(A,l)((b,C)=>b&&C!=null),()=>e.html.div(e.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),e.attr.id(D),l))),r!=null?j.Label(r):e.Empty,i):e.Empty,e.html.div(e.attr.class("bc-input-wrapper__content"),[D,I].filter(Boolean).length>0?e.dataAttr("describedby",[D,I].filter(Boolean).join(" ")):e.Empty,t?e.dataAttr("required","true"):e.Empty,e.When(f,()=>e.dataAttr("invalid","true")),o),e.When(e.computedOf(A,l)((b,C)=>!b&&C!=null),()=>e.html.div(e.attr.class("bc-input-wrapper__description"),e.attr.id(D),l)),e.When(f,()=>e.html.div(e.attr.class("bc-input-wrapper__error"),e.attr.id(I),e.aria.live("polite"),e.attr.role("alert"),a)),...v)};function X({size:n="sm",icon:t="line-md:close",disabled:s,roundedness:i="full",color:r="base",onClick:l,label:o},...a){return e.Use(_.BeatUII18n,c=>{const d=e.coalesce(o,c.$.closeModal);return B.Button({variant:"text",size:n,roundedness:i,disabled:s,color:r,onClick:l},e.attr.title(d),e.aria.label(d),...a,_.Icon({icon:t,size:n??"sm"}))})}const Y=n=>{const{value:t,onBlur:s,onChange:i,onInput:r,placeholder:l,disabled:o,id:a,activeIcon:c,inactiveIcon:d,size:u="md"}=n,m=a??T.sessionId("checkbox"),g=`${m}-label`,v=()=>{if(e.Value.get(o??!1))return;const h=e.Value.get(t);i?.(!h),r?.(!h)},f=h=>{e.Value.get(o??!1)||(h.key===" "||h.key==="Enter")&&(h.preventDefault(),v())};return B.InputContainer({baseContainer:!0,growInput:!1,...n,input:e.html.span(e.attr.class("bc-checkbox-input"),e.html.span(e.attr.class("bc-checkbox-input__checkbox"),e.attr.class(e.Value.map(t,h=>h?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),e.attr.class(e.Value.map(o??!1,h=>h?"bc-checkbox-input__checkbox--disabled":"")),e.attr.id(m),e.attr.role("checkbox"),e.attr.tabindex(e.Value.map(o??!1,h=>h?-1:0)),e.aria.checked(t),e.aria.disabled(o),l!=null?e.aria.labelledby(g):e.Empty,e.on.keydown(f),s!=null?e.on.blur(s):e.Empty,_.Icon({icon:e.computedOf(t,c,d)((h,y,w)=>h?y??"ri:checkbox-fill":w??"mdi:checkbox-blank-outline"),accessibility:"decorative",size:u})),l!=null?e.html.label(e.attr.class("bc-checkbox-input__label"),e.attr.id(g),e.attr.for(m),j.MutedLabel(l)):e.Empty)},e.on.click(v))},q=((n,t)=>()=>{n.markTouched(),t?.()}),E=(n,t)=>s=>{n.change(s),t?.(s)};function M(n,t){const{controller:s,onBlur:i,onChange:r,id:l,triggerOn:o,...a}=t;return n({id:l??s.name,disabled:s.disabled,value:s.signal,hasError:s.errorVisible,name:s.name,...a,onInput:o==="input"?E(s,r):void 0,onChange:o!=="input"?E(s,r):void 0,onBlur:q(s,i)})}function Z(n,{id:t,labelFor:s,...i},...r){const l=t??i.controller.name??T.sessionId("control"),o=s??l;return O({...i,hasError:i.controller.errorVisible,error:e.TextNode(i.controller.error.map(a=>a??"")),labelFor:o,content:M(a=>n({...a,id:l}),i)},...r)}function H(n,t){const{toInput:s,fromInput:i,controller:r,...l}=t,o=r.transform(s,i);return M(n,{...l,controller:o})}function tt(n,{id:t,labelFor:s,...i},...r){const l=t??i.controller.name??T.sessionId("control");return O({...i,labelFor:s??l,content:H(n,{...i,id:l})},...r)}function et(n){return n.split(".").map(s=>{const i=s.match(/^\[(\d+)\]$/);return i?Number(i[1]):s})}function F(n){return typeof n=="number"?`[${n}]`:`.${n}`}function $(n){if(n.length===0)return"";const[t,...s]=n;return[typeof t=="number"?`[${t}]`:t,...s.map(F)].join("")}const st={valid:p.Validation.valid,invalid(n){return p.Validation.invalid({message:n})},invalidFields(n){const t={};for(const[s,i]of Object.entries(n))t[s]=typeof i=="string"?{message:i}:i;return p.Validation.invalid({dependencies:t})},fromError(n){return p.Validation.invalid(n)}};function V(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 p.Validation.valid;return p.Validation.invalid(i)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#t={disabled:e.prop(!1),touched:e.prop(!1)};#s;#e=e.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(t,s,i,r,l,o=p.strictEqual){this.path=t,this.change=s,this.signal=i,this.status=r,this.#s=o,this.#e.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.#t.touched,l.validationMode?this.errorVisible=e.computedOf(this.hasError,this.touched,l.validationMode)((a,c,d)=>d==="eager"?!!a:!!a&&!!c):this.errorVisible=e.computedOf(this.hasError,this.touched)((a,c)=>!!a&&!!c),this.dirty=e.computedOf(this.signal,this.#e)((a,c)=>!this.#s(a,c)),this.dependencyErrors=r.map(a=>a?.type==="invalid"?a.error?.dependencies:void 0),this.parent=l,this.disabled=e.computedOf(this.#t.disabled,l.disabled)((a,c)=>a||c),this.disabledOrHasErrors=e.computedOf(this.disabled,this.hasError)((a,c)=>a||c),this.onDispose(()=>{this.#t.disabled.dispose(),this.#t.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#e.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return $(this.path)}onDispose=t=>{this.#n.push(t)};dispose=()=>{for(const t of this.#n)try{t()}catch(s){console.error("Error in dispose callback:",s)}this.#n.length=0};setDisabled=t=>{this.#t.disabled.set(t)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#t.touched.set(!0)};resetTouched=()=>{this.#t.touched.set(!1)};markPristine=()=>{this.#e.set(this.signal.value)};reset=()=>{this.change(this.#e.value)};array=(t=p.strictEqual)=>new N(this.path,this.change,this.signal,this.status,this.parent,t);object=(t=p.strictEqual)=>new W(this.path,this.change,this.signal,this.status,this.parent,t);transform=(t,s,i=[],r=p.strictEqual)=>new k([...this.path,...i],l=>this.change(s(l)),this.signal.map(t,r),this.status.map(V(i)),this.parent,r);asyncTransform=(t,s,i,r=[],l=p.strictEqual)=>new k([...this.path,...r],o=>{s(o).then(a=>this.change(a))},this.signal.mapAsync(t,i,void 0,l),this.status.map(V(r)),this.parent,l)}class W extends k{#t=new Map;#s=new Map;#e=new Map;#n=e.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=e.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let t=!1;for(const s of this.#s.values())if(s){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,s,i,r,l,o){super(t,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.#t.values())c.dispose();this.#t.clear();for(const c of this.#e.values())c();this.#e.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=t=>{if(this.#t.has(t))return this.#t.get(t);const s=async o=>{this.change({...this.signal.value,[t]:o})},i=new k([...this.path,t],s,this.signal.map(o=>o[t]),this.status.map(V([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#t.set(t,i);const r=i.touched.on(o=>{this.#s.set(t,o),this.#l()});this.#e.set(t,r);const l=i.dirty.on(o=>{this.#r.set(t,o),this.#a()});return this.#i.set(t,l),i};markAllTouched=()=>{this.markTouched();const t=this.signal.value;for(const s of Object.keys(t))this.field(s).markTouched();for(const s of this.#t.values())s.markTouched()};markAllPristine=()=>{this.markPristine();const t=this.signal.value;for(const s of Object.keys(t))this.field(s).markPristine?.();for(const s of this.#t.values())s.markPristine?.()};#a=()=>{let t=!1;for(const s of this.#r.values())if(s){t=!0;break}this.#o.set(this.dirty.value||t)}}class N extends k{#t=new Array;length;#s=new Map;#e=new Map;#n=e.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=e.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let t=!1;for(const s of this.#s.values())if(s){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,s,i,r,l,o){const a=i.map(u=>u??[],o);super(t,s,a,r,l,o);const c=a.on(u=>{const m=this.#t.length-u.length;m>0&&(this.#t.splice(u.length,m).forEach((g,v)=>{const f=u.length+v;g.dispose(),this.#e.get(f)?.(),this.#e.delete(f),this.#s.delete(f),this.#i.get(f)?.(),this.#i.delete(f),this.#r.delete(f)}),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.#t)u.dispose();this.length.dispose(),this.#t.length=0,c(),a.dispose();for(const u of this.#e.values())u();this.#e.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=t=>{if(this.#t[t])return this.#t[t];const s=async o=>{const a=this.signal.value.slice();a[t]=o,this.change(a)},i=new k([...this.path,t],s,this.signal.map(o=>o[t]),this.status.map(V([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#t[t]=i;const r=i.touched.on(o=>{this.#s.set(t,o),this.#l()});this.#e.set(t,r);const l=i.dirty.on(o=>{this.#r.set(t,o),this.#a()});return this.#i.set(t,l),i};push=(...t)=>{this.change([...this.signal.value,...t])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...t)=>{this.change([...t,...this.signal.value])};removeAt=t=>{this.splice(t,1)};splice=(t,s)=>{const i=this.signal.value.slice();i.splice(t,s),this.change(i)};move=(t,s,i=1)=>{if(i<1||t===s)return;const r=this.signal.value.slice(),l=r.splice(t,i);r.splice(s,0,...l),this.change(r)};markAllTouched=()=>{this.markTouched();const t=this.signal.value.length;for(let s=0;s<t;s++)this.item(s).markTouched()};markAllPristine=()=>{this.markPristine();const t=this.signal.value.length;for(let s=0;s<t;s++)this.item(s).markPristine?.()};#a=()=>{let t=!1;for(const s of this.#r.values())if(s){t=!0;break}this.#o.set(this.dirty.value||t)}}function z(n){function t(s){return typeof s=="number"?s:s.toString()}return n.map(s=>typeof s=="object"&&s.key!=null?t(s.key):t(s))}function L(n){const t=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=t.join(`
|
|
2
|
+
`);return{...s,message:i!=""?i:void 0}}function R({initialValue:n,onChange:t,validate:s,equals:i,validationMode:r,validateDebounceMs:l}){const o=e.Value.deriveProp(n),a=e.prop(p.Validation.valid),c=e.prop(!1),d=e.prop(r??"onTouched"),u=h=>{a.set(h)};let m;const g=async h=>{if(s!=null){const y=await s(h);u(y)}},v=async h=>{o.set(h),t?.(h);const y=d.value;if(s!=null){if(y==="onSubmit")return;const w=l??0;w>0?(m&&clearTimeout(m),m=setTimeout(()=>{g(h)},w)):await g(h)}},f=new k([],v,o,a,{disabled:c,validationMode:d},i??p.strictEqual);return f.onDispose(()=>{c.dispose(),o.dispose(),a.dispose(),d.dispose(),m&&clearTimeout(m)}),{controller:f,setStatus:u}}function x(n){return e.Fragment(e.attr.disabled(n.disabled),e.attr.name(n.name))}function nt(n,{triggerOn:t="change"}={}){return e.Fragment(x(n),e.attr.value(n.signal),(t==="input"?e.on.input:e.on.change)(e.emitValue(n.change)))}function it(n,{triggerOn:t="change"}={}){return e.Fragment(x(n),e.attr.valueAsNumber(n.signal),(t==="input"?e.on.input:e.on.change)(e.emitValueAsNumber(n.change)))}function S(n){return n.issues!=null?p.Validation.invalid(L(n.issues)):p.Validation.valid}async function rt({task:n,errorMessage:t,errorPath:s=["root"],validation:i}){try{const r=await n();return i!=null?i(r):p.Validation.valid}catch(r){const l=t??(r instanceof Error?r.message:"Operation failed");return s.length===1&&s[0]==="root"?p.Validation.invalid({message:l}):p.Validation.invalid({dependencies:U(s,l)})}}function U(n,t){if(n.length===1)return{[n[0]]:{message:t}};const[s,...i]=n;return{[s]:{dependencies:U(i,t)}}}function at({initialValue:n={},schema:t,onSubmit:s=async()=>p.Validation.valid,validationMode:i,validateDebounceMs:r}){const{controller:l,setStatus:o}=R({initialValue:n,validationMode:i??"onTouched",validateDebounceMs:r,validate:(i??"onTouched")==="onSubmit"||t==null?void 0:async u=>S(await t["~standard"].validate(u))}),a=e.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(),t!=null){const g=c.signal.value,v=S(await t["~standard"].validate(g));if(o(v),v.type==="invalid"){a.set(!1);return}}const m=await s(c.signal.value);a.set(!1),m.type==="invalid"&&o(m)},submitting:a}}exports.ArrayController=N;exports.BaseControl=M;exports.BaseMappedControl=H;exports.CheckboxInput=Y;exports.CloseButton=X;exports.Control=Z;exports.Controller=k;exports.ControllerValidation=st;exports.InputWrapper=O;exports.MappedControl=tt;exports.ObjectController=W;exports.RequiredSymbol=P;exports.connectCommonAttributes=x;exports.connectNumberInput=it;exports.connectStringInput=nt;exports.convertStandardSchemaIssues=L;exports.convertStandardSchemaPathToPath=z;exports.makeMapValidation=V;exports.makeOnBlurHandler=q;exports.makeOnChangeHandler=E;exports.parsePath=et;exports.pathToString=$;exports.standardSchemaResultToValidation=S;exports.taskToValidation=rt;exports.useController=R;exports.useForm=at;exports.wrapSegment=F;
|