@tempots/beatui 0.82.1 → 0.83.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-CBrjAlIY.cjs +1 -0
- package/dist/ar-DjMvIww5.js +175 -0
- package/dist/{ar-NCCPhOpI.js → ar-DwDxAANU.js} +16 -1
- package/dist/ar-kZBzg02I.cjs +1 -0
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +33 -32
- package/dist/{auth-divider-Wr-S16kF.js → auth-divider-C3_CgC0l.js} +589 -569
- package/dist/auth-divider-C4WTL71M.cjs +1 -0
- package/dist/beatui.css +5678 -1438
- package/dist/beatui.tailwind.css +5662 -1422
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +18 -31
- package/dist/{colors-B2yrgHSW.cjs → colors-BI0YhONJ.cjs} +1 -1
- package/dist/{colors-DPo9GEJR.js → colors-BmLYKmoH.js} +38 -30
- package/dist/de-B03SM9eF.cjs +1 -0
- package/dist/{de-BVK2MkCk.js → de-CSGSC0xX.js} +18 -3
- package/dist/de-CrBw41po.cjs +1 -0
- package/dist/{de-f2xcEb34.js → de-wChFYqM4.js} +79 -5
- package/dist/deep-merge-CmQoIYPC.js +1689 -0
- package/dist/deep-merge-UghuPcyW.cjs +1 -0
- package/dist/{duration-input-B9UNmUCh.cjs → duration-input-BJzKgI15.cjs} +1 -1
- package/dist/{duration-input-DqcJbxKD.js → duration-input-DaB6s0rL.js} +4 -4
- package/dist/editor-toolbar-group-BslfdazC.js +32 -0
- package/dist/editor-toolbar-group-_V1rDM-1.cjs +1 -0
- package/dist/{es-BxBeTRCv.cjs → es-BRa0hV-7.cjs} +1 -1
- package/dist/es-Ca5xT3NE.cjs +1 -0
- package/dist/es-CmPF3IGl.js +175 -0
- package/dist/{es-BQS8PL9j.js → es-dR46FTMF.js} +16 -1
- package/dist/{fa-DxPseW3g.cjs → fa-BxCSKn9j.cjs} +1 -1
- package/dist/fa-D696e75R.js +175 -0
- package/dist/fa-DhZJYuC6.cjs +1 -0
- package/dist/{fa-T-tkJSJr.js → fa-FsHBFjdY.js} +16 -1
- package/dist/fr-1nSKSIlw.cjs +1 -0
- package/dist/{fr-yOW_68YY.js → fr-B0jeX1Hx.js} +83 -9
- package/dist/{fr-CSRRhyCG.js → fr-Di6BT9_V.js} +18 -3
- package/dist/fr-Dq6RAY9s.cjs +1 -0
- package/dist/he-BBX1h9uD.cjs +1 -0
- package/dist/{he-Bxdc4M08.js → he-CXujw1Lw.js} +16 -1
- package/dist/he-DhcurPt5.cjs +1 -0
- package/dist/he-SgAsIYJA.js +175 -0
- package/dist/{hi-CJeFvTBe.js → hi-Bvh4d9bO.js} +16 -1
- package/dist/hi-Cd0YQZTU.cjs +1 -0
- package/dist/hi-CxsIxbfM.cjs +1 -0
- package/dist/hi-s9oiIihq.js +175 -0
- package/dist/{index-Bt7FYl80.cjs → index-Bm43lZqE.cjs} +2 -2
- package/dist/{index-05UbKOYe.cjs → index-C2_iX1um.cjs} +1 -1
- package/dist/{index-C2Lq1m45.js → index-C32iUFIr.js} +5 -5
- package/dist/{index-lYhXnu6I.js → index-CEqc0H3v.js} +1 -1
- package/dist/index-DH37GTQj.cjs +1 -0
- package/dist/{index-DklKfzD4.js → index-Di1_W_7Q.js} +351 -361
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6220 -3084
- package/dist/input-container-CSi72GI1.cjs +1 -0
- package/dist/{input-container-DiCjOzR2.js → input-container-Nx0gMAzS.js} +86 -75
- package/dist/it-ByIEk5Cq.cjs +1 -0
- package/dist/it-D_IcaYxp.cjs +1 -0
- package/dist/{it-6e6X-4BB.js → it-Dc4IMciD.js} +80 -6
- package/dist/{it-Zmp0BhIj.js → it-EWhykhHv.js} +18 -3
- package/dist/ja-CMGqpPo7.cjs +1 -0
- package/dist/{ja-BxNuNo2H.js → ja-D2t2g5xj.js} +85 -11
- package/dist/ja-DV6Fpp18.cjs +1 -0
- package/dist/{ja-DWjoA-hQ.js → ja-YZ0P5woj.js} +16 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +191 -185
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +679 -660
- package/dist/ko-BPl5rP97.cjs +1 -0
- package/dist/ko-BRylA5JZ.js +175 -0
- package/dist/ko-DR1f0as8.cjs +1 -0
- package/dist/{ko-BOlI-33h.js → ko-U7BSUAxZ.js} +16 -1
- package/dist/lexical/index.cjs.js +31 -31
- package/dist/lexical/index.es.js +5248 -5221
- package/dist/lexical.css +5 -7
- package/dist/menu-CX72LaZ3.cjs +1 -0
- package/dist/menu-D_slbwl8.js +374 -0
- package/dist/{modal-v3u2Fpnd.js → modal-DaI1jH-X.js} +4 -4
- package/dist/{modal-I5srcntN.cjs → modal-kyZfvVZb.cjs} +1 -1
- package/dist/nl-BSfaHFt0.cjs +1 -0
- package/dist/{nl-Dr-l6zUy.cjs → nl-CQF0N7Mc.cjs} +1 -1
- package/dist/{nl-kQNcAdY1.js → nl-CqAxoB4J.js} +18 -3
- package/dist/nl-Dh7LUWAn.js +176 -0
- package/dist/{notice-CLDdy1MW.cjs → notice-Bc1L4Zpr.cjs} +1 -1
- package/dist/{notice-BuZvdvZh.js → notice-Dz4nX57_.js} +4 -4
- package/dist/{oneof-branch-detection-Dt8ss9lc.js → oneof-branch-detection-BED_n2MT.js} +522 -519
- package/dist/{oneof-branch-detection-DsM1K5xc.cjs → oneof-branch-detection-Vov_e3kI.cjs} +4 -4
- package/dist/{pl-CKyPFvss.js → pl-C-weXGCB.js} +16 -1
- package/dist/pl-D-O4sCnr.cjs +1 -0
- package/dist/{pl-Bs4nLJ__.js → pl-XEG-p1Q9.js} +77 -3
- package/dist/{pl-BK0i_yvq.cjs → pl-y_w3DWF3.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-DBmUhaNI.js → pt-BjNGOoZH.js} +18 -3
- package/dist/pt-DYsDA2sZ.js +175 -0
- package/dist/pt-DqaZWmbG.cjs +1 -0
- package/dist/pt-chEEYLlt.cjs +1 -0
- package/dist/ru-B46hVpFF.cjs +1 -0
- package/dist/{ru-Bi1_DEKM.js → ru-BTKBykp-.js} +86 -12
- package/dist/{ru-CsJ_yT-7.js → ru-CFmeZBXK.js} +16 -1
- package/dist/ru-CISMzCHR.cjs +1 -0
- package/dist/{styles-url-B2dzXrYt.cjs → styles-url-CVCcF0ra.cjs} +1 -1
- package/dist/{styles-url-Cw_mxshe.js → styles-url-DUdp56Ts.js} +1 -1
- package/dist/tailwind/index.cjs.js +1 -1
- package/dist/tailwind/index.es.js +3 -3
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +74 -4
- package/dist/tailwind/vite-plugin.cjs.js +10 -10
- package/dist/tailwind/vite-plugin.es.js +289 -410
- package/dist/text-input-8v79fzEy.cjs +1 -0
- package/dist/text-input-CPJzUC2r.js +45 -0
- package/dist/{toolbar-D994_E_s.js → toolbar-CjQG7l7X.js} +1 -1
- package/dist/{toolbar-x0_8lmKu.cjs → toolbar-D3ZsC0g_.cjs} +1 -1
- package/dist/{tr-Bn5ldVJs.js → tr-C5X2gFZS.js} +17 -2
- package/dist/tr-CaMaflJL.cjs +1 -0
- package/dist/{tr-DiYB-FwX.js → tr-Cp8ZCUic.js} +77 -3
- package/dist/{tr-CgJ8uhZu.cjs → tr-mWu2E__o.cjs} +1 -1
- package/dist/{translations-Cq8bUKJP.js → translations-BGblCUBj.js} +144 -70
- package/dist/translations-CZ0KOii3.cjs +1 -0
- package/dist/translations-gVgMyNno.cjs +1 -0
- package/dist/translations-jUYta1_1.js +87 -0
- package/dist/types/auth/index.d.ts +13 -0
- package/dist/types/auth-i18n/default.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ar.d.ts +14 -0
- package/dist/types/auth-i18n/locales/de.d.ts +14 -0
- package/dist/types/auth-i18n/locales/en.d.ts +14 -0
- package/dist/types/auth-i18n/locales/es.d.ts +14 -0
- package/dist/types/auth-i18n/locales/fa.d.ts +14 -0
- package/dist/types/auth-i18n/locales/fr.d.ts +14 -0
- package/dist/types/auth-i18n/locales/he.d.ts +14 -0
- package/dist/types/auth-i18n/locales/hi.d.ts +14 -0
- package/dist/types/auth-i18n/locales/it.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ja.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ko.d.ts +14 -0
- package/dist/types/auth-i18n/locales/nl.d.ts +14 -0
- package/dist/types/auth-i18n/locales/pl.d.ts +14 -0
- package/dist/types/auth-i18n/locales/pt.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ru.d.ts +14 -0
- package/dist/types/auth-i18n/locales/tr.d.ts +14 -0
- package/dist/types/auth-i18n/locales/ur.d.ts +14 -0
- package/dist/types/auth-i18n/locales/vi.d.ts +14 -0
- package/dist/types/auth-i18n/locales/zh.d.ts +14 -0
- package/dist/types/auth-i18n/translations.d.ts +14 -0
- package/dist/types/beatui-i18n/default.d.ts +99 -0
- package/dist/types/beatui-i18n/index.d.ts +11 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +63 -0
- package/dist/types/beatui-i18n/translations.d.ts +87 -0
- package/dist/types/better-auth/components/authenticated.d.ts +2 -2
- package/dist/types/better-auth/components/better-auth-container.d.ts +1 -1
- package/dist/types/better-auth/components/better-auth-modal.d.ts +1 -1
- package/dist/types/better-auth/index.d.ts +13 -0
- package/dist/types/better-auth/provider.d.ts +33 -0
- package/dist/types/better-auth/types.d.ts +112 -0
- package/dist/types/components/auth/auth-container.d.ts +63 -2
- package/dist/types/components/auth/auth-divider.d.ts +30 -0
- package/dist/types/components/auth/auth-email-prop.d.ts +25 -0
- package/dist/types/components/auth/index.d.ts +9 -0
- package/dist/types/components/auth/password-strength-indicator.d.ts +58 -0
- package/dist/types/components/auth/reset-password-form.d.ts +33 -0
- package/dist/types/components/auth/schemas.d.ts +183 -5
- package/dist/types/components/auth/signin-form.d.ts +33 -0
- package/dist/types/components/auth/signup-form.d.ts +36 -0
- package/dist/types/components/auth/social-login-button.d.ts +213 -0
- package/dist/types/components/auth/social-providers.d.ts +27 -1
- package/dist/types/components/auth/types.d.ts +299 -0
- package/dist/types/components/auth/utils.d.ts +198 -0
- package/dist/types/components/beatui.d.ts +35 -0
- package/dist/types/components/button/button.d.ts +61 -0
- package/dist/types/components/button/close-button.d.ts +32 -1
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/button/toggle-button-group.d.ts +95 -0
- package/dist/types/components/button/toggle-button.d.ts +60 -0
- package/dist/types/components/data/avatar-group.d.ts +74 -0
- package/dist/types/components/data/avatar.d.ts +62 -0
- package/dist/types/components/data/badge.d.ts +49 -2
- package/dist/types/components/data/calendar-shared.d.ts +59 -0
- package/dist/types/components/data/calendar.d.ts +107 -0
- package/dist/types/components/data/history-timeline.d.ts +35 -0
- package/dist/types/components/data/icon-badge.d.ts +14 -0
- package/dist/types/components/data/icon.d.ts +55 -4
- package/dist/types/components/data/index.d.ts +9 -0
- package/dist/types/components/data/page-drop-zone.d.ts +61 -8
- package/dist/types/components/data/presence-overlay.d.ts +26 -0
- package/dist/types/components/data/progress-bar.d.ts +81 -0
- package/dist/types/components/data/range-calendar.d.ts +104 -0
- package/dist/types/components/data/skeleton.d.ts +70 -0
- package/dist/types/components/data/table.d.ts +38 -11
- package/dist/types/components/data/tag.d.ts +40 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +73 -0
- package/dist/types/components/form/control/control.d.ts +155 -0
- package/dist/types/components/form/control/date-utils.d.ts +81 -0
- package/dist/types/components/form/control/ensure-control.d.ts +28 -0
- package/dist/types/components/form/control/form-status.d.ts +63 -0
- package/dist/types/components/form/control/index.d.ts +10 -0
- package/dist/types/components/form/control/list-control.d.ts +100 -1
- package/dist/types/components/form/control/list-item-controls.d.ts +65 -0
- package/dist/types/components/form/controller/color-controller.d.ts +29 -1
- package/dist/types/components/form/controller/controller-validation.d.ts +31 -0
- package/dist/types/components/form/controller/controller.d.ts +286 -0
- package/dist/types/components/form/controller/index.d.ts +12 -0
- package/dist/types/components/form/controller/path.d.ts +69 -0
- package/dist/types/components/form/controller/union-controller.d.ts +106 -11
- package/dist/types/components/form/controller/utils.d.ts +67 -0
- package/dist/types/components/form/input/advanced-slider.d.ts +143 -0
- package/dist/types/components/form/input/appearance-selector.d.ts +39 -0
- package/dist/types/components/form/input/base64-input.d.ts +34 -0
- package/dist/types/components/form/input/base64s-input.d.ts +47 -0
- package/dist/types/components/form/input/bigint-input.d.ts +27 -0
- package/dist/types/components/form/input/checkbox-input.d.ts +46 -0
- package/dist/types/components/form/input/color-input.d.ts +42 -0
- package/dist/types/components/form/input/color-swatch-input.d.ts +53 -0
- package/dist/types/components/form/input/combobox-input.d.ts +73 -0
- package/dist/types/components/form/input/combobox-tags-input.d.ts +54 -0
- package/dist/types/components/form/input/date-input.d.ts +33 -0
- package/dist/types/components/form/input/date-time-input.d.ts +34 -0
- package/dist/types/components/form/input/dropdown-base.d.ts +52 -0
- package/dist/types/components/form/input/dropdown-input.d.ts +86 -0
- package/dist/types/components/form/input/duration-input.d.ts +18 -0
- package/dist/types/components/form/input/duration-mask.d.ts +24 -0
- package/dist/types/components/form/input/editable-text.d.ts +33 -0
- package/dist/types/components/form/input/email-input.d.ts +34 -0
- package/dist/types/components/form/input/file-input.d.ts +33 -0
- package/dist/types/components/form/input/files-input.d.ts +44 -0
- package/dist/types/components/form/input/index.d.ts +5 -0
- package/dist/types/components/form/input/input-adornment.d.ts +38 -0
- package/dist/types/components/form/input/input-container.d.ts +65 -0
- package/dist/types/components/form/input/input-options.d.ts +70 -0
- package/dist/types/components/form/input/input-wrapper.d.ts +78 -0
- package/dist/types/components/form/input/instant-input.d.ts +18 -0
- package/dist/types/components/form/input/lazy-native-select.d.ts +43 -0
- package/dist/types/components/form/input/list-input.d.ts +50 -0
- package/dist/types/components/form/input/mask-input.d.ts +158 -0
- package/dist/types/components/form/input/native-select.d.ts +50 -0
- package/dist/types/components/form/input/nullable-base64-input.d.ts +25 -0
- package/dist/types/components/form/input/nullable-bigint-input.d.ts +26 -0
- package/dist/types/components/form/input/nullable-date-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-date-time-input.d.ts +19 -0
- package/dist/types/components/form/input/nullable-duration-input.d.ts +19 -0
- package/dist/types/components/form/input/nullable-email-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-instant-input.d.ts +19 -0
- package/dist/types/components/form/input/nullable-mask-input.d.ts +24 -0
- package/dist/types/components/form/input/nullable-number-input.d.ts +29 -0
- package/dist/types/components/form/input/nullable-password-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-month-day-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-rating-input.d.ts +33 -0
- package/dist/types/components/form/input/nullable-text-area.d.ts +27 -0
- package/dist/types/components/form/input/nullable-text-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-url-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-utils.d.ts +22 -2
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +18 -0
- package/dist/types/components/form/input/nullable-zoned-date-time-input.d.ts +20 -0
- package/dist/types/components/form/input/number-input.d.ts +49 -0
- package/dist/types/components/form/input/option.d.ts +165 -0
- package/dist/types/components/form/input/otp-input.d.ts +77 -0
- package/dist/types/components/form/input/password-input.d.ts +39 -0
- package/dist/types/components/form/input/plain-date-input.d.ts +17 -0
- package/dist/types/components/form/input/plain-date-time-input.d.ts +17 -0
- package/dist/types/components/form/input/plain-month-day-input.d.ts +18 -0
- package/dist/types/components/form/input/plain-time-input.d.ts +17 -0
- package/dist/types/components/form/input/plain-year-month-input.d.ts +17 -0
- package/dist/types/components/form/input/radio-group.d.ts +108 -0
- package/dist/types/components/form/input/rating-input.d.ts +57 -0
- package/dist/types/components/form/input/segmented-input.d.ts +70 -1
- package/dist/types/components/form/input/select-tags-input.d.ts +69 -0
- package/dist/types/components/form/input/slider-input.d.ts +82 -0
- package/dist/types/components/form/input/switch.d.ts +59 -1
- package/dist/types/components/form/input/tag-input.d.ts +19 -0
- package/dist/types/components/form/input/tag-utils.d.ts +111 -0
- package/dist/types/components/form/input/tags-input.d.ts +18 -0
- package/dist/types/components/form/input/text-area.d.ts +42 -0
- package/dist/types/components/form/input/text-input.d.ts +63 -1
- package/dist/types/components/form/input/url-input.d.ts +34 -0
- package/dist/types/components/form/input/uuid-input.d.ts +19 -0
- package/dist/types/components/form/input/zoned-date-time-input.d.ts +20 -0
- package/dist/types/components/form/schema/standard-schema-v1.d.ts +98 -23
- package/dist/types/components/form/use-form.d.ts +146 -2
- package/dist/types/components/i18n/index.d.ts +9 -0
- package/dist/types/components/i18n/locale-direction.d.ts +21 -1
- package/dist/types/components/i18n/locale-selector.d.ts +45 -0
- package/dist/types/components/i18n/make-i18nprovider.d.ts +42 -0
- package/dist/types/components/json-schema/schema-types.d.ts +133 -0
- package/dist/types/components/json-structure/controls/deprecation-utils.d.ts +2 -3
- package/dist/types/components/json-structure/structure-types.d.ts +473 -19
- package/dist/types/components/layout/accordion.d.ts +77 -0
- package/dist/types/components/layout/action-card.d.ts +90 -2
- package/dist/types/components/layout/app-shell.d.ts +76 -0
- package/dist/types/components/layout/card.d.ts +27 -0
- package/dist/types/components/layout/center.d.ts +39 -0
- package/dist/types/components/layout/collapse.d.ts +28 -0
- package/dist/types/components/layout/divider.d.ts +84 -0
- package/dist/types/components/layout/group.d.ts +15 -0
- package/dist/types/components/layout/index.d.ts +2 -0
- package/dist/types/components/layout/nine-slice-scroll-view.d.ts +105 -0
- package/dist/types/components/layout/scrollable-panel.d.ts +54 -0
- package/dist/types/components/layout/sink.d.ts +46 -0
- package/dist/types/components/layout/stack.d.ts +16 -0
- package/dist/types/components/layout/with-breakpoint.d.ts +194 -0
- package/dist/types/components/lexical/code/language-selector.d.ts +2 -2
- package/dist/types/components/lexical/floating/block-handle.d.ts +2 -2
- package/dist/types/components/lexical/floating/floating-toolbar.d.ts +2 -2
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/lexical/table/table-controls.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +4 -2
- package/dist/types/components/misc/empty-state.d.ts +86 -0
- package/dist/types/components/misc/expando.d.ts +81 -0
- package/dist/types/components/misc/index.d.ts +2 -1
- package/dist/types/components/misc/link-portal.d.ts +40 -2
- package/dist/types/components/misc/notice.d.ts +93 -0
- package/dist/types/components/misc/notification-panel.d.ts +21 -0
- package/dist/types/components/misc/notification-provider.d.ts +141 -0
- package/dist/types/components/misc/notification.d.ts +93 -0
- package/dist/types/components/misc/style-portal.d.ts +31 -1
- package/dist/types/components/monaco/monaco-editor-input.d.ts +59 -2
- package/dist/types/components/navigation/breadcrumbs.d.ts +96 -0
- package/dist/types/components/navigation/flyout.d.ts +118 -16
- package/dist/types/components/navigation/index.d.ts +3 -0
- package/dist/types/components/navigation/link/link.d.ts +100 -0
- package/dist/types/components/navigation/menu.d.ts +155 -35
- package/dist/types/components/navigation/pagination.d.ts +82 -0
- package/dist/types/components/navigation/sidebar/sidebar-group.d.ts +42 -0
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +101 -0
- package/dist/types/components/navigation/sidebar/sidebar-separator.d.ts +17 -0
- package/dist/types/components/navigation/sidebar/sidebar.d.ts +57 -0
- package/dist/types/components/navigation/tabs/tabs.d.ts +3 -2
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +125 -0
- package/dist/types/components/navigation/tree-view.d.ts +95 -0
- package/dist/types/components/overlay/announcement-bar.d.ts +41 -2
- package/dist/types/components/overlay/block-command-palette.d.ts +25 -0
- package/dist/types/components/overlay/command-palette.d.ts +17 -0
- package/dist/types/components/overlay/dialogs.d.ts +213 -0
- package/dist/types/components/overlay/drawer.d.ts +76 -12
- package/dist/types/components/overlay/index.d.ts +4 -0
- package/dist/types/components/overlay/lightbox.d.ts +53 -10
- package/dist/types/components/overlay/modal.d.ts +113 -13
- package/dist/types/components/overlay/overlay.d.ts +61 -0
- package/dist/types/components/overlay/popover.d.ts +100 -0
- package/dist/types/components/overlay/ribbon.d.ts +58 -9
- package/dist/types/components/prosemirror/etoolbar-button.d.ts +10 -0
- package/dist/types/components/prosemirror/etoolbar-group.d.ts +10 -0
- package/dist/types/components/prosemirror/link-control.d.ts +43 -2
- package/dist/types/components/prosemirror/prosemirror-toolbar.d.ts +46 -6
- package/dist/types/components/prosemirror/utils.d.ts +113 -1
- package/dist/types/components/theme/style-utils.d.ts +95 -0
- package/dist/types/components/theme/theme.d.ts +39 -0
- package/dist/types/components/theme/types.d.ts +133 -1
- package/dist/types/components/typography/index.d.ts +1 -0
- package/dist/types/components/typography/kbd.d.ts +48 -0
- package/dist/types/components/typography/label.d.ts +45 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/json-schema/index.d.ts +13 -0
- package/dist/types/json-schema-display/index.d.ts +12 -0
- package/dist/types/json-structure/index.d.ts +9 -4
- package/dist/types/markdown/index.d.ts +13 -0
- package/dist/types/monaco/index.d.ts +17 -0
- package/dist/types/monaco/lazy-loader.d.ts +79 -0
- package/dist/types/monaco/styles-url.d.ts +11 -0
- package/dist/types/monaco/styles.d.ts +11 -0
- package/dist/types/monaco/types.d.ts +47 -0
- package/dist/types/prosemirror/index.d.ts +12 -0
- package/dist/types/prosemirror/styles-url.d.ts +11 -0
- package/dist/types/prosemirror/styles.d.ts +10 -0
- package/dist/types/tailwind/google-fonts.d.ts +15 -0
- package/dist/types/tailwind/index.d.ts +13 -0
- package/dist/types/tailwind/preset.d.ts +111 -0
- package/dist/types/tailwind/vite-plugin.d.ts +39 -4
- package/dist/types/tokens/base-colors.d.ts +21 -0
- package/dist/types/tokens/breakpoints.d.ts +67 -0
- package/dist/types/tokens/colors.d.ts +213 -4
- package/dist/types/tokens/motion.d.ts +142 -3
- package/dist/types/tokens/radius.d.ts +99 -0
- package/dist/types/tokens/shadows.d.ts +85 -0
- package/dist/types/tokens/spacing.d.ts +111 -0
- package/dist/types/tokens/text-shadows.d.ts +82 -0
- package/dist/types/tokens/typography.d.ts +313 -25
- package/dist/types/tokens/z-index.d.ts +62 -0
- package/dist/types/utils/color.d.ts +297 -28
- package/dist/types/utils/download.d.ts +92 -0
- package/dist/types/utils/focus-trap.d.ts +67 -11
- package/dist/types/utils/format-file-size.d.ts +44 -0
- package/dist/ur-B6yB2JQ7.cjs +1 -0
- package/dist/ur-CvGP14xo.cjs +1 -0
- package/dist/{ur-Bg9eX81v.js → ur-Deo004ME.js} +16 -1
- package/dist/{ur-B69X-xNs.js → ur-DkIYJxsF.js} +82 -8
- package/dist/use-animated-toggle-89fKlXxy.js +195 -0
- package/dist/use-animated-toggle-DrqK7nUS.cjs +1 -0
- package/dist/{use-form-B56E_x5Y.js → use-form-BurzbPVV.js} +190 -2
- package/dist/{use-form-Cnp3XQ5X.cjs → use-form-Uree6QFy.cjs} +1 -1
- package/dist/vi-BYk1rJDv.js +53 -0
- package/dist/vi-DKw6PBja.js +175 -0
- package/dist/vi-Df4WZe9y.cjs +1 -0
- package/dist/vi-DneuUbkq.cjs +1 -0
- package/dist/{widget-customization-Ds9sicAg.js → widget-customization-0is7oTeP.js} +205 -204
- package/dist/widget-customization-B-LmxkPE.cjs +1 -0
- package/dist/zh-C5a9NGFW.cjs +1 -0
- package/dist/zh-CaKHseXJ.js +175 -0
- package/dist/zh-DFHuW_5g.cjs +1 -0
- package/dist/{zh-BIykcEu9.js → zh-DR7QaM65.js} +16 -1
- package/package.json +1 -1
- package/dist/ar-BsUm-TCn.cjs +0 -1
- package/dist/ar-D7CXDmVZ.cjs +0 -1
- package/dist/ar-nOSKXpIW.js +0 -101
- package/dist/auth-divider-BqZPH1-z.cjs +0 -1
- package/dist/de-BUFLEyKr.cjs +0 -1
- package/dist/de-WzsOu9Gn.cjs +0 -1
- package/dist/deep-merge-BYm0y62g.js +0 -1620
- package/dist/deep-merge-d7sf0xmN.cjs +0 -1
- package/dist/editor-toolbar-group--a-xgsJw.cjs +0 -1
- package/dist/editor-toolbar-group-CVpl5mxF.js +0 -31
- package/dist/es-CDqqzpCw.js +0 -101
- package/dist/es-Ds2Xf3wV.cjs +0 -1
- package/dist/fa-C7tE_hR3.js +0 -101
- package/dist/fa-Ct1UtDB7.cjs +0 -1
- package/dist/fr-Cdyopuz3.cjs +0 -1
- package/dist/fr-CzAkRFed.cjs +0 -1
- package/dist/he-D2oUloCJ.js +0 -101
- package/dist/he-DarDNPn0.cjs +0 -1
- package/dist/he-DlXALrK7.cjs +0 -1
- package/dist/hi-3dBhLwDs.cjs +0 -1
- package/dist/hi-D5ZlZoQq.js +0 -101
- package/dist/hi-tATwsXJ6.cjs +0 -1
- package/dist/index-DE2tjivA.cjs +0 -1
- package/dist/input-container-C6qEIjcA.cjs +0 -1
- package/dist/it-BmFag7j0.cjs +0 -1
- package/dist/it-DohtcWi9.cjs +0 -1
- package/dist/ja-Dj-bAKLf.cjs +0 -1
- package/dist/ja-eyTArrgS.cjs +0 -1
- package/dist/ko-BFLCDMMs.cjs +0 -1
- package/dist/ko-BomUE-yQ.cjs +0 -1
- package/dist/ko-Ch0jFsBV.js +0 -101
- package/dist/menu-CZzRsQP_.js +0 -372
- package/dist/menu-ClrU72xH.cjs +0 -1
- package/dist/nl-Bx2ACvr4.cjs +0 -1
- package/dist/nl-NuTdZO1s.js +0 -102
- package/dist/pl-QHl6sl8f.cjs +0 -1
- package/dist/pt-BETjHZrL.js +0 -101
- package/dist/pt-DZGw2Z-1.cjs +0 -1
- package/dist/pt-oBMmVYcu.cjs +0 -1
- package/dist/ru-CtxMmoa6.cjs +0 -1
- package/dist/ru-D03IuLqh.cjs +0 -1
- package/dist/text-input-B3VBat1k.js +0 -44
- package/dist/text-input-Ds8e7Z1G.cjs +0 -1
- package/dist/tr-B_-_1wua.cjs +0 -1
- package/dist/translations-B4-Zd2LM.cjs +0 -1
- package/dist/translations-D62qqNV9.cjs +0 -1
- package/dist/translations-DPr6c05Z.js +0 -67
- package/dist/ur-DvqAg9gW.cjs +0 -1
- package/dist/ur-DyUSmIbo.cjs +0 -1
- package/dist/use-animated-toggle-ChycsEoj.js +0 -175
- package/dist/use-animated-toggle-DR6CyMac.cjs +0 -1
- package/dist/vi-BdzxA60L.js +0 -101
- package/dist/vi-CBmPaHxg.cjs +0 -1
- package/dist/vi-D5R3YcU0.cjs +0 -1
- package/dist/vi-DhdsHHf_.js +0 -38
- package/dist/widget-customization-Dk7XcVly.cjs +0 -1
- package/dist/zh-CCGXcj5r.cjs +0 -1
- package/dist/zh-Cb1b8uik.cjs +0 -1
- package/dist/zh-Dn1UJiZa.js +0 -101
|
@@ -0,0 +1,1689 @@
|
|
|
1
|
+
import { Task as xe, Use as F, Value as f, prop as ce, html as h, attr as l, on as C, WithElement as ee, Empty as T, aria as G, bind as re, computedOf as V, style as ye, OnDispose as te, When as U, NotEmpty as Fe, Fragment as E, ForEach as K, coalesce as Re, Ensure as Ne, OneOfType as Pe, Repeat as je, signal as we, input as ne, emitValue as P, emitValueAsNumber as _e } from "@tempots/dom";
|
|
2
|
+
import { B as R, b as ke, f as Ce, I as O, d as oe } from "./translations-BGblCUBj.js";
|
|
3
|
+
import { l as We } from "./colors-BmLYKmoH.js";
|
|
4
|
+
import { g as Ze } from "./timer-Rd2sKnvH.js";
|
|
5
|
+
import { ElementRect as He } from "@tempots/ui";
|
|
6
|
+
import { I as W, a as qe, g as Ye, B as me } from "./input-container-Nx0gMAzS.js";
|
|
7
|
+
import { C as ie, m as Ge, c as Je, I as Be, d as ue, O as Q, e as De } from "./use-form-BurzbPVV.js";
|
|
8
|
+
import { C as q } from "./text-input-CPJzUC2r.js";
|
|
9
|
+
import { S as Ve } from "./stack-BJgsPJ9A.js";
|
|
10
|
+
let fe = null;
|
|
11
|
+
async function be() {
|
|
12
|
+
const t = globalThis;
|
|
13
|
+
return t.Temporal ? t.Temporal : (fe || (fe = import("./index.esm-ChUrm4xR.js").then((e) => {
|
|
14
|
+
const n = e.Temporal;
|
|
15
|
+
return t.Temporal || (t.Temporal = n), n;
|
|
16
|
+
})), fe);
|
|
17
|
+
}
|
|
18
|
+
const Xe = (t, e) => e ? xe(be, {
|
|
19
|
+
then: t,
|
|
20
|
+
pending: e.pending,
|
|
21
|
+
error: e.error
|
|
22
|
+
}) : xe(be, t);
|
|
23
|
+
function pe({
|
|
24
|
+
onChange: t,
|
|
25
|
+
value: e,
|
|
26
|
+
accept: n = "*/*",
|
|
27
|
+
enableClick: s = !0,
|
|
28
|
+
content: r,
|
|
29
|
+
disabled: b = !1,
|
|
30
|
+
allowMultiple: i
|
|
31
|
+
}) {
|
|
32
|
+
return F(R, (g) => {
|
|
33
|
+
const p = f.deriveProp(e ?? []), v = ce(!1), d = (u) => {
|
|
34
|
+
u.preventDefault(), u.stopPropagation(), v.value = !0;
|
|
35
|
+
}, m = (u) => {
|
|
36
|
+
u.preventDefault(), u.stopPropagation(), (!u.currentTarget || !u.currentTarget.contains(u.relatedTarget)) && (v.value = !1);
|
|
37
|
+
}, y = (u) => {
|
|
38
|
+
u.preventDefault(), u.stopPropagation(), v.value = !1;
|
|
39
|
+
const x = Array.from(u.dataTransfer?.files || []);
|
|
40
|
+
x.length > 0 && (p.value = x, t(x, "dragdrop"));
|
|
41
|
+
}, o = (u) => {
|
|
42
|
+
f.get(s) && u.currentTarget.querySelector(
|
|
43
|
+
'input[type="file"]'
|
|
44
|
+
)?.click();
|
|
45
|
+
};
|
|
46
|
+
let a = null;
|
|
47
|
+
const D = () => {
|
|
48
|
+
if (a == null) return;
|
|
49
|
+
const u = Array.from(a.files ?? []);
|
|
50
|
+
u.length > 0 && (p.value = u, t(u, "click")), a.value = "";
|
|
51
|
+
}, $ = (u) => {
|
|
52
|
+
f.get(s) && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), o(u));
|
|
53
|
+
};
|
|
54
|
+
return h.div(
|
|
55
|
+
l.role("button"),
|
|
56
|
+
l.tabindex(
|
|
57
|
+
f.map(s, (u) => u ? 0 : -1)
|
|
58
|
+
),
|
|
59
|
+
l.style("position: relative;"),
|
|
60
|
+
C.dragover(d),
|
|
61
|
+
C.dragleave(m),
|
|
62
|
+
C.drop(y),
|
|
63
|
+
C.click(o),
|
|
64
|
+
C.keydown($),
|
|
65
|
+
// Hidden file input
|
|
66
|
+
h.input(
|
|
67
|
+
l.type("file"),
|
|
68
|
+
l.disabled(b),
|
|
69
|
+
l.accept(n),
|
|
70
|
+
l.multiple(i),
|
|
71
|
+
l.style(
|
|
72
|
+
"position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
|
|
73
|
+
),
|
|
74
|
+
C.change(D),
|
|
75
|
+
ee((u) => (a = u, p.on((x) => {
|
|
76
|
+
const M = globalThis.DataTransfer;
|
|
77
|
+
if (M != null) {
|
|
78
|
+
const I = new M();
|
|
79
|
+
x.forEach((A) => I.items.add(A)), u.files = I.files;
|
|
80
|
+
}
|
|
81
|
+
}), T))
|
|
82
|
+
),
|
|
83
|
+
// Screen reader instructions
|
|
84
|
+
G.label(re(g.$.dropZoneInstructions)(s)),
|
|
85
|
+
// Content
|
|
86
|
+
r({ files: p, clear: () => p.value = [], change: p.set })
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function Qe(t, e) {
|
|
91
|
+
return t.length === e.length && t.every((n, s) => n === e[s]);
|
|
92
|
+
}
|
|
93
|
+
function Ke(t, e, n) {
|
|
94
|
+
const s = ["bc-segmented-input", `bc-segmented-input--size-${t}`];
|
|
95
|
+
return n === "squared" && s.push("bc-segmented-input--squared"), e && s.push("bc-segmented-input--disabled"), s.join(" ");
|
|
96
|
+
}
|
|
97
|
+
function et(t) {
|
|
98
|
+
if (t == null) return "";
|
|
99
|
+
const e = /* @__PURE__ */ new Map(), n = ke(t, "solid", "light"), s = ke(t, "solid", "dark");
|
|
100
|
+
return e.set("--si-indicator-bg", n.backgroundColor), e.set("--si-active-text", n.textColor), e.set("--si-indicator-bg-dark", s.backgroundColor), e.set("--si-active-text-dark", s.textColor), Array.from(e.entries()).map(([r, b]) => `${r}: ${b}`).join("; ");
|
|
101
|
+
}
|
|
102
|
+
function It({
|
|
103
|
+
options: t,
|
|
104
|
+
value: e,
|
|
105
|
+
onChange: n,
|
|
106
|
+
size: s = "md",
|
|
107
|
+
disabled: r = !1,
|
|
108
|
+
variant: b = "pill",
|
|
109
|
+
color: i
|
|
110
|
+
}, ...g) {
|
|
111
|
+
const p = We(t).map(([v, d]) => ({
|
|
112
|
+
key: v,
|
|
113
|
+
label: d
|
|
114
|
+
}));
|
|
115
|
+
return ee(() => {
|
|
116
|
+
const v = Object.fromEntries(
|
|
117
|
+
p.map((m, y) => [m.key, y])
|
|
118
|
+
), d = ce(
|
|
119
|
+
p.map(() => ({ left: 0, width: 0 })),
|
|
120
|
+
Qe
|
|
121
|
+
);
|
|
122
|
+
return h.div(
|
|
123
|
+
l.class(
|
|
124
|
+
V(
|
|
125
|
+
s,
|
|
126
|
+
r,
|
|
127
|
+
b
|
|
128
|
+
)(
|
|
129
|
+
(m, y, o) => Ke(
|
|
130
|
+
m ?? "md",
|
|
131
|
+
y ?? !1,
|
|
132
|
+
o ?? "pill"
|
|
133
|
+
)
|
|
134
|
+
)
|
|
135
|
+
),
|
|
136
|
+
l.style(
|
|
137
|
+
i != null ? f.map(i, (m) => et(m)) : ""
|
|
138
|
+
),
|
|
139
|
+
h.div(
|
|
140
|
+
l.class("bc-segmented-input__container"),
|
|
141
|
+
h.div(
|
|
142
|
+
l.class("bc-segmented-input__indicator"),
|
|
143
|
+
ye.width(
|
|
144
|
+
V(
|
|
145
|
+
e,
|
|
146
|
+
d
|
|
147
|
+
)((m, y) => {
|
|
148
|
+
const { width: o } = y[v[m] ?? 0];
|
|
149
|
+
return `${o}px`;
|
|
150
|
+
})
|
|
151
|
+
),
|
|
152
|
+
ye.left(
|
|
153
|
+
V(
|
|
154
|
+
e,
|
|
155
|
+
d
|
|
156
|
+
)((m, y) => {
|
|
157
|
+
const { left: o } = y[v[m] ?? 0];
|
|
158
|
+
return `${o}px`;
|
|
159
|
+
})
|
|
160
|
+
)
|
|
161
|
+
),
|
|
162
|
+
// clickable buttons
|
|
163
|
+
p.map(({ label: m, key: y }, o) => h.button(
|
|
164
|
+
l.type("button"),
|
|
165
|
+
C.click((a) => {
|
|
166
|
+
a.preventDefault(), f.get(r) || n?.(y);
|
|
167
|
+
}),
|
|
168
|
+
l.disabled(r),
|
|
169
|
+
l.class("bc-segmented-input__segment"),
|
|
170
|
+
l.class(
|
|
171
|
+
f.map(e, (a) => a === y ? "bc-segmented-input__segment--active" : "bc-segmented-input__segment--inactive")
|
|
172
|
+
),
|
|
173
|
+
He((a) => {
|
|
174
|
+
function D() {
|
|
175
|
+
d.update((u) => {
|
|
176
|
+
const x = [...u];
|
|
177
|
+
return x[o] = {
|
|
178
|
+
width: a.value.width,
|
|
179
|
+
left: a.value.localLeft
|
|
180
|
+
}, x;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
const $ = Ze(D);
|
|
184
|
+
return te($, a.on(D));
|
|
185
|
+
}),
|
|
186
|
+
m
|
|
187
|
+
))
|
|
188
|
+
),
|
|
189
|
+
...g
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function tt(t) {
|
|
194
|
+
const e = t.type.toLowerCase();
|
|
195
|
+
return e.startsWith("image/") && (e.includes("jpeg") || e.includes("jpg") || e.includes("png") || e.includes("gif") || e.includes("webp") || e.includes("svg"));
|
|
196
|
+
}
|
|
197
|
+
function nt(t) {
|
|
198
|
+
const e = t.type.toLowerCase();
|
|
199
|
+
return e.startsWith("image/") ? "vscode-icons:file-type-image" : e.startsWith("video/") ? "vscode-icons:file-type-video" : e.startsWith("audio/") ? "vscode-icons:file-type-audio" : e.includes("pdf") ? "vscode-icons:file-type-pdf2" : e.includes("word") || e.includes("document") ? "vscode-icons:file-type-word" : e.includes("excel") || e.includes("spreadsheet") ? "vscode-icons:file-type-excel" : e.includes("powerpoint") || e.includes("presentation") ? "vscode-icons:file-type-powerpoint" : e.includes("zip") || e.includes("archive") ? "vscode-icons:file-type-zip" : e.includes("text") ? "vscode-icons:file-type-text" : e.includes("json") ? "vscode-icons:file-type-json-official" : e.includes("csv") ? "vscode-icons:file-type-csv" : e.includes("xml") ? "vscode-icons:file-type-xml" : e.includes("yaml") ? "vscode-icons:file-type-yaml-official" : "vscode-icons:file-type-binary";
|
|
200
|
+
}
|
|
201
|
+
function de(t) {
|
|
202
|
+
return U(
|
|
203
|
+
t.map(tt),
|
|
204
|
+
() => {
|
|
205
|
+
const e = ce(null);
|
|
206
|
+
return t.on((n) => {
|
|
207
|
+
e.value && URL.revokeObjectURL(e.value);
|
|
208
|
+
const s = URL.createObjectURL(n);
|
|
209
|
+
e.value = s;
|
|
210
|
+
}), h.div(
|
|
211
|
+
te(() => {
|
|
212
|
+
e.value && URL.revokeObjectURL(e.value);
|
|
213
|
+
}),
|
|
214
|
+
l.class("bc-file-input__thumbnail-container"),
|
|
215
|
+
h.img(
|
|
216
|
+
l.src(e),
|
|
217
|
+
l.alt(t.map((n) => n.name)),
|
|
218
|
+
l.class("bc-file-input__thumbnail")
|
|
219
|
+
)
|
|
220
|
+
);
|
|
221
|
+
},
|
|
222
|
+
() => O({ icon: t.map(nt) })
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
const $t = (t, ...e) => {
|
|
226
|
+
const {
|
|
227
|
+
value: n = ce([]),
|
|
228
|
+
accept: s = "*/*",
|
|
229
|
+
maxFiles: r,
|
|
230
|
+
maxFileSize: b,
|
|
231
|
+
onChange: i,
|
|
232
|
+
onBlur: g,
|
|
233
|
+
disabled: p,
|
|
234
|
+
hasError: v,
|
|
235
|
+
mode: d = "default",
|
|
236
|
+
showFileList: m = !0,
|
|
237
|
+
...y
|
|
238
|
+
} = t, o = n, a = f.map(d, (k) => k === "input"), D = f.map(d, (k) => k === "compact"), $ = (k) => {
|
|
239
|
+
let c = k;
|
|
240
|
+
if (r != null) {
|
|
241
|
+
const w = f.get(r);
|
|
242
|
+
c = c.slice(0, w);
|
|
243
|
+
}
|
|
244
|
+
if (b) {
|
|
245
|
+
const w = f.get(b);
|
|
246
|
+
c = c.filter((S) => S.size <= w);
|
|
247
|
+
}
|
|
248
|
+
i?.(c);
|
|
249
|
+
}, u = (k) => {
|
|
250
|
+
const w = o.value.filter((S, z) => z !== k);
|
|
251
|
+
i?.(w);
|
|
252
|
+
}, x = () => {
|
|
253
|
+
i?.([]);
|
|
254
|
+
}, M = ({
|
|
255
|
+
files: k,
|
|
256
|
+
clear: c,
|
|
257
|
+
change: w
|
|
258
|
+
}) => F(
|
|
259
|
+
R,
|
|
260
|
+
(S) => h.div(
|
|
261
|
+
l.class("bc-file-input__drop-zone"),
|
|
262
|
+
h.div(
|
|
263
|
+
l.class(
|
|
264
|
+
"bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"
|
|
265
|
+
),
|
|
266
|
+
O({ icon: "mdi:cloud-upload-outline", size: "xl" }),
|
|
267
|
+
h.div(
|
|
268
|
+
l.class("bc-file-input__drop-zone-text"),
|
|
269
|
+
re(S.$.filesInputInstructions)(
|
|
270
|
+
r,
|
|
271
|
+
b,
|
|
272
|
+
S.$.fileSizeUnits.value
|
|
273
|
+
)
|
|
274
|
+
)
|
|
275
|
+
)
|
|
276
|
+
)
|
|
277
|
+
), I = ({
|
|
278
|
+
files: k
|
|
279
|
+
}) => F(
|
|
280
|
+
R,
|
|
281
|
+
(c) => h.div(
|
|
282
|
+
l.class("bc-file-input__compact-drop-zone"),
|
|
283
|
+
U(
|
|
284
|
+
k.map((w) => w.length > 0),
|
|
285
|
+
() => h.div(
|
|
286
|
+
l.class("bc-file-input__compact-file-list"),
|
|
287
|
+
K(k, (w, S) => {
|
|
288
|
+
const z = S.index;
|
|
289
|
+
return h.div(
|
|
290
|
+
l.class("bc-file-input__compact-file-item"),
|
|
291
|
+
h.div(
|
|
292
|
+
l.class("bc-file-input__compact-file-icon"),
|
|
293
|
+
de(w)
|
|
294
|
+
),
|
|
295
|
+
h.div(
|
|
296
|
+
l.class("bc-file-input__compact-file-info"),
|
|
297
|
+
h.div(
|
|
298
|
+
l.class("bc-file-input__compact-file-name"),
|
|
299
|
+
l.title(w.$.name),
|
|
300
|
+
w.$.name
|
|
301
|
+
),
|
|
302
|
+
h.div(
|
|
303
|
+
l.class("bc-file-input__compact-file-meta"),
|
|
304
|
+
V(
|
|
305
|
+
w.$.size,
|
|
306
|
+
c.$.fileSizeUnits
|
|
307
|
+
)((_, B) => Ce(_, { units: B })),
|
|
308
|
+
" • ",
|
|
309
|
+
V(
|
|
310
|
+
w.$.type,
|
|
311
|
+
c.$.unknownType
|
|
312
|
+
)((_, B) => _ || B)
|
|
313
|
+
)
|
|
314
|
+
),
|
|
315
|
+
ie(
|
|
316
|
+
{
|
|
317
|
+
size: "sm",
|
|
318
|
+
label: c.$.removeFile,
|
|
319
|
+
disabled: p,
|
|
320
|
+
onClick: () => u(z)
|
|
321
|
+
},
|
|
322
|
+
l.class("bc-file-input__compact-remove-button")
|
|
323
|
+
)
|
|
324
|
+
);
|
|
325
|
+
})
|
|
326
|
+
),
|
|
327
|
+
() => h.div(
|
|
328
|
+
l.class("bc-file-input__compact-placeholder"),
|
|
329
|
+
O({ icon: "mdi:cloud-upload-outline", size: "lg" }),
|
|
330
|
+
h.div(
|
|
331
|
+
l.class("bc-file-input__compact-placeholder-text"),
|
|
332
|
+
re(c.$.filesInputInstructions)(
|
|
333
|
+
r,
|
|
334
|
+
b,
|
|
335
|
+
c.$.fileSizeUnits.value
|
|
336
|
+
)
|
|
337
|
+
)
|
|
338
|
+
)
|
|
339
|
+
)
|
|
340
|
+
)
|
|
341
|
+
), A = ({
|
|
342
|
+
files: k
|
|
343
|
+
}) => F(
|
|
344
|
+
R,
|
|
345
|
+
(c) => h.div(
|
|
346
|
+
l.class("bc-file-input__compact-input"),
|
|
347
|
+
U(
|
|
348
|
+
k.map((w) => w.length > 0),
|
|
349
|
+
() => h.span(
|
|
350
|
+
l.class("bc-file-input__compact-value"),
|
|
351
|
+
K(
|
|
352
|
+
k,
|
|
353
|
+
(w) => h.span(
|
|
354
|
+
l.class("bc-file-input__compact-value-item"),
|
|
355
|
+
de(w),
|
|
356
|
+
h.span(
|
|
357
|
+
l.class("bc-file-input__compact-value-item-name"),
|
|
358
|
+
w.$.name
|
|
359
|
+
)
|
|
360
|
+
)
|
|
361
|
+
)
|
|
362
|
+
),
|
|
363
|
+
() => h.span(
|
|
364
|
+
l.class("bc-file-input__compact-placeholder"),
|
|
365
|
+
O({ icon: "mdi:cloud-upload-outline", size: "md" }),
|
|
366
|
+
" ",
|
|
367
|
+
re(c.$.filesInputInstructions)(
|
|
368
|
+
r,
|
|
369
|
+
b,
|
|
370
|
+
c.$.fileSizeUnits.value
|
|
371
|
+
)
|
|
372
|
+
)
|
|
373
|
+
)
|
|
374
|
+
)
|
|
375
|
+
);
|
|
376
|
+
return F(
|
|
377
|
+
R,
|
|
378
|
+
(k) => W(
|
|
379
|
+
{
|
|
380
|
+
baseContainer: f.map(a, (c) => !c),
|
|
381
|
+
disabled: p,
|
|
382
|
+
hasError: v,
|
|
383
|
+
after: U(
|
|
384
|
+
a,
|
|
385
|
+
() => U(
|
|
386
|
+
o.map(({ length: c }) => c > 0),
|
|
387
|
+
() => ie(
|
|
388
|
+
{
|
|
389
|
+
size: "sm",
|
|
390
|
+
label: k.$.clearAllFiles,
|
|
391
|
+
disabled: p,
|
|
392
|
+
onClick: x
|
|
393
|
+
},
|
|
394
|
+
l.class("bc-file-input__compact-clear")
|
|
395
|
+
)
|
|
396
|
+
)
|
|
397
|
+
),
|
|
398
|
+
...y,
|
|
399
|
+
input: U(
|
|
400
|
+
a,
|
|
401
|
+
() => h.div(
|
|
402
|
+
l.class("bc-file-input bc-file-input--input"),
|
|
403
|
+
pe({
|
|
404
|
+
value: o,
|
|
405
|
+
accept: s,
|
|
406
|
+
enableClick: !0,
|
|
407
|
+
allowMultiple: f.map(r ?? 1 / 0, (c) => c > 1),
|
|
408
|
+
disabled: p,
|
|
409
|
+
onChange: $,
|
|
410
|
+
content: A
|
|
411
|
+
})
|
|
412
|
+
),
|
|
413
|
+
() => U(
|
|
414
|
+
D,
|
|
415
|
+
() => h.div(
|
|
416
|
+
l.class("bc-file-input bc-file-input--compact"),
|
|
417
|
+
pe({
|
|
418
|
+
value: o,
|
|
419
|
+
accept: s,
|
|
420
|
+
enableClick: !0,
|
|
421
|
+
allowMultiple: f.map(r ?? 1 / 0, (c) => c > 1),
|
|
422
|
+
disabled: p,
|
|
423
|
+
onChange: $,
|
|
424
|
+
content: I
|
|
425
|
+
})
|
|
426
|
+
),
|
|
427
|
+
() => h.div(
|
|
428
|
+
l.class("bc-file-input"),
|
|
429
|
+
pe({
|
|
430
|
+
value: o,
|
|
431
|
+
accept: s,
|
|
432
|
+
enableClick: !0,
|
|
433
|
+
allowMultiple: f.map(r ?? 1 / 0, (c) => c > 1),
|
|
434
|
+
disabled: p,
|
|
435
|
+
onChange: $,
|
|
436
|
+
content: M
|
|
437
|
+
}),
|
|
438
|
+
U(
|
|
439
|
+
m,
|
|
440
|
+
() => Fe(
|
|
441
|
+
o,
|
|
442
|
+
() => E(
|
|
443
|
+
h.div(
|
|
444
|
+
l.class("bc-file-input__file-list"),
|
|
445
|
+
K(o, (c, w) => {
|
|
446
|
+
const S = w.index;
|
|
447
|
+
return h.div(
|
|
448
|
+
l.class("bc-file-input__file-item"),
|
|
449
|
+
h.div(
|
|
450
|
+
l.class("bc-file-input__file-icon"),
|
|
451
|
+
de(c)
|
|
452
|
+
),
|
|
453
|
+
h.div(
|
|
454
|
+
l.class("bc-file-input__file-info"),
|
|
455
|
+
h.div(
|
|
456
|
+
l.class("bc-file-input__file-name"),
|
|
457
|
+
l.title(c.$.name),
|
|
458
|
+
c.$.name
|
|
459
|
+
),
|
|
460
|
+
h.div(
|
|
461
|
+
l.class("bc-file-input__file-meta"),
|
|
462
|
+
V(
|
|
463
|
+
c.$.size,
|
|
464
|
+
k.$.fileSizeUnits
|
|
465
|
+
)(
|
|
466
|
+
(z, _) => Ce(z, { units: _ })
|
|
467
|
+
),
|
|
468
|
+
" • ",
|
|
469
|
+
V(
|
|
470
|
+
c.$.type,
|
|
471
|
+
k.$.unknownType
|
|
472
|
+
)((z, _) => z || _)
|
|
473
|
+
)
|
|
474
|
+
),
|
|
475
|
+
ie(
|
|
476
|
+
{
|
|
477
|
+
size: "sm",
|
|
478
|
+
label: k.$.removeFile,
|
|
479
|
+
disabled: p,
|
|
480
|
+
onClick: () => u(S)
|
|
481
|
+
},
|
|
482
|
+
l.class("bc-file-input__remove-button")
|
|
483
|
+
)
|
|
484
|
+
);
|
|
485
|
+
})
|
|
486
|
+
),
|
|
487
|
+
U(
|
|
488
|
+
o.map(({ length: c }) => c > 1),
|
|
489
|
+
() => h.div(
|
|
490
|
+
l.class(
|
|
491
|
+
"bc-file-input__clear-all-button-container"
|
|
492
|
+
),
|
|
493
|
+
h.button(
|
|
494
|
+
l.type("button"),
|
|
495
|
+
l.class("bc-file-input__clear-all-button"),
|
|
496
|
+
l.disabled(p),
|
|
497
|
+
k.$.clearAllFiles,
|
|
498
|
+
C.click((c) => {
|
|
499
|
+
c.preventDefault(), c.stopPropagation(), x();
|
|
500
|
+
})
|
|
501
|
+
)
|
|
502
|
+
)
|
|
503
|
+
)
|
|
504
|
+
)
|
|
505
|
+
)
|
|
506
|
+
)
|
|
507
|
+
)
|
|
508
|
+
)
|
|
509
|
+
)
|
|
510
|
+
},
|
|
511
|
+
...e
|
|
512
|
+
)
|
|
513
|
+
);
|
|
514
|
+
}, he = "$$tts-exp-", st = (t, e) => ee((n) => {
|
|
515
|
+
const s = `${he}${t}`;
|
|
516
|
+
return te(f.on(e, (r) => Reflect.set(n, s, r)));
|
|
517
|
+
}), Mt = (t, e) => {
|
|
518
|
+
const n = `${he}${t}`;
|
|
519
|
+
return (s) => {
|
|
520
|
+
e(Reflect.get(s.target, n));
|
|
521
|
+
};
|
|
522
|
+
}, lt = (t, e) => {
|
|
523
|
+
const n = `${he}${t}`;
|
|
524
|
+
return (s) => {
|
|
525
|
+
const r = s.target, b = r.selectedIndex, i = r.options[b];
|
|
526
|
+
e(Reflect.get(i, n));
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
function Ie(...t) {
|
|
530
|
+
return h.div(l.class("bc-group"), ...t);
|
|
531
|
+
}
|
|
532
|
+
const Ae = (t, e, n) => Ne(
|
|
533
|
+
t,
|
|
534
|
+
(s) => Pe(s, {
|
|
535
|
+
value: (r) => {
|
|
536
|
+
const b = V(
|
|
537
|
+
r,
|
|
538
|
+
n
|
|
539
|
+
)((i, g) => e(i.value, g));
|
|
540
|
+
return h.option(
|
|
541
|
+
l.selected(b),
|
|
542
|
+
st("value", r.$.value),
|
|
543
|
+
r.$.label
|
|
544
|
+
);
|
|
545
|
+
},
|
|
546
|
+
group: (r) => h.optgroup(
|
|
547
|
+
l.label(r.$.group),
|
|
548
|
+
K(
|
|
549
|
+
r.$.options,
|
|
550
|
+
(b) => Ae(
|
|
551
|
+
b,
|
|
552
|
+
e,
|
|
553
|
+
n
|
|
554
|
+
)
|
|
555
|
+
)
|
|
556
|
+
),
|
|
557
|
+
break: () => h.hr()
|
|
558
|
+
})
|
|
559
|
+
), rt = (t) => {
|
|
560
|
+
const {
|
|
561
|
+
value: e,
|
|
562
|
+
onBlur: n,
|
|
563
|
+
onChange: s,
|
|
564
|
+
options: r,
|
|
565
|
+
unselectedLabel: b,
|
|
566
|
+
equality: i = (v, d) => v === d,
|
|
567
|
+
after: g
|
|
568
|
+
} = t;
|
|
569
|
+
let p;
|
|
570
|
+
return W(
|
|
571
|
+
{
|
|
572
|
+
...t,
|
|
573
|
+
after: E(
|
|
574
|
+
qe({
|
|
575
|
+
icon: "ph:caret-down-bold",
|
|
576
|
+
color: "neutral",
|
|
577
|
+
size: "sm"
|
|
578
|
+
}),
|
|
579
|
+
g
|
|
580
|
+
),
|
|
581
|
+
input: h.select(
|
|
582
|
+
ee((v) => {
|
|
583
|
+
p = v;
|
|
584
|
+
const d = new MutationObserver((m) => {
|
|
585
|
+
const { removedNodes: y } = m[0];
|
|
586
|
+
y.length > 0 && (p.selectedIndex = 0);
|
|
587
|
+
});
|
|
588
|
+
return d.observe(v, { childList: !0 }), te(() => d.disconnect());
|
|
589
|
+
}),
|
|
590
|
+
q(t),
|
|
591
|
+
l.class("bc-native-select bc-input"),
|
|
592
|
+
F(
|
|
593
|
+
R,
|
|
594
|
+
(v) => h.option(
|
|
595
|
+
l.hidden("hidden"),
|
|
596
|
+
Re(b, v.$.selectOne)
|
|
597
|
+
)
|
|
598
|
+
),
|
|
599
|
+
K(r, (v) => Ae(v, i, e)),
|
|
600
|
+
n != null ? C.blur(n) : T,
|
|
601
|
+
s != null ? C.change(lt("value", (v) => s(v))) : T
|
|
602
|
+
)
|
|
603
|
+
},
|
|
604
|
+
C.click(() => {
|
|
605
|
+
if (p?.focus(), typeof p?.showPicker == "function")
|
|
606
|
+
try {
|
|
607
|
+
p.showPicker();
|
|
608
|
+
} catch {
|
|
609
|
+
}
|
|
610
|
+
})
|
|
611
|
+
);
|
|
612
|
+
};
|
|
613
|
+
function it(t) {
|
|
614
|
+
const { controller: e, onChange: n, onBlur: s, ...r } = t;
|
|
615
|
+
return rt({
|
|
616
|
+
...r,
|
|
617
|
+
value: e.signal,
|
|
618
|
+
onChange: Je(e, n),
|
|
619
|
+
onBlur: Ge(e, s)
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
function Tt(t) {
|
|
623
|
+
return Be({
|
|
624
|
+
...t,
|
|
625
|
+
content: it(t)
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
function ot(t, e, n) {
|
|
629
|
+
const s = t.length.map((r) => r);
|
|
630
|
+
return E(
|
|
631
|
+
je(
|
|
632
|
+
s,
|
|
633
|
+
(r) => {
|
|
634
|
+
const b = t.item(r.index), i = [];
|
|
635
|
+
return E(
|
|
636
|
+
te(() => {
|
|
637
|
+
i.forEach((g) => g());
|
|
638
|
+
}),
|
|
639
|
+
e({
|
|
640
|
+
list: t,
|
|
641
|
+
item: b,
|
|
642
|
+
position: r,
|
|
643
|
+
remove: () => t.removeAt(r.index),
|
|
644
|
+
move: (g) => {
|
|
645
|
+
switch (g) {
|
|
646
|
+
case "up":
|
|
647
|
+
if (r.index === 0) return;
|
|
648
|
+
t.move(r.index, r.index - 1);
|
|
649
|
+
break;
|
|
650
|
+
case "down":
|
|
651
|
+
if (r.index === t.length.value - 1) return;
|
|
652
|
+
t.move(r.index, r.index + 1);
|
|
653
|
+
break;
|
|
654
|
+
case "first":
|
|
655
|
+
t.move(r.index, 0);
|
|
656
|
+
break;
|
|
657
|
+
case "last":
|
|
658
|
+
t.move(r.index, t.length.value - 1);
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
canMove: (g) => {
|
|
662
|
+
const p = (() => {
|
|
663
|
+
switch (g) {
|
|
664
|
+
case "up":
|
|
665
|
+
return we(r.index > 0);
|
|
666
|
+
case "down":
|
|
667
|
+
return t.length.map((v) => r.index < v - 1);
|
|
668
|
+
}
|
|
669
|
+
})();
|
|
670
|
+
return i.push(() => p.dispose()), p;
|
|
671
|
+
},
|
|
672
|
+
cannotMove: (g) => {
|
|
673
|
+
const p = (() => {
|
|
674
|
+
switch (g) {
|
|
675
|
+
case "up":
|
|
676
|
+
return we(r.index === 0);
|
|
677
|
+
case "down":
|
|
678
|
+
return t.length.map((v) => r.index === v - 1);
|
|
679
|
+
}
|
|
680
|
+
})();
|
|
681
|
+
return i.push(() => p.dispose()), p;
|
|
682
|
+
}
|
|
683
|
+
})
|
|
684
|
+
);
|
|
685
|
+
},
|
|
686
|
+
n
|
|
687
|
+
)
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
const $e = {
|
|
691
|
+
9: { pattern: /^[0-9]$/ },
|
|
692
|
+
A: { pattern: /^[A-Za-z]$/, transform: (t) => t.toUpperCase() },
|
|
693
|
+
"*": { pattern: /^.$/ }
|
|
694
|
+
}, ct = (t) => t instanceof RegExp;
|
|
695
|
+
function Le(t, e, n) {
|
|
696
|
+
if (t == null) return [];
|
|
697
|
+
const s = n ? { ...$e, ...e } : e ?? $e, r = (i, g) => {
|
|
698
|
+
const p = s[g];
|
|
699
|
+
p ? i.push({ type: "pattern", name: g, ...p }) : i.push({ type: "literal", char: g });
|
|
700
|
+
}, b = [];
|
|
701
|
+
if (typeof t == "string") {
|
|
702
|
+
for (const i of t) r(b, i);
|
|
703
|
+
return b;
|
|
704
|
+
}
|
|
705
|
+
for (const i of t)
|
|
706
|
+
if (typeof i == "string")
|
|
707
|
+
if (i.length <= 1) r(b, i);
|
|
708
|
+
else for (const g of i) r(b, g);
|
|
709
|
+
else ct(i) ? b.push({ type: "pattern", pattern: i }) : typeof i == "object" && i && b.push(i);
|
|
710
|
+
return b;
|
|
711
|
+
}
|
|
712
|
+
function at(t, e) {
|
|
713
|
+
return (n) => {
|
|
714
|
+
switch (t) {
|
|
715
|
+
case "digits":
|
|
716
|
+
return /[0-9]/.test(n);
|
|
717
|
+
case "letters":
|
|
718
|
+
return /[A-Za-z]/.test(n);
|
|
719
|
+
case "alphanumeric":
|
|
720
|
+
return /[A-Za-z0-9]/.test(n);
|
|
721
|
+
case "custom":
|
|
722
|
+
return e?.(n) ?? !0;
|
|
723
|
+
default:
|
|
724
|
+
return !0;
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function Me(t, e, n, s, r, b) {
|
|
729
|
+
const i = {
|
|
730
|
+
raw: t,
|
|
731
|
+
previousConformed: e,
|
|
732
|
+
cursor: r ?? t.length,
|
|
733
|
+
completed: !1
|
|
734
|
+
}, g = s.definitions ?? {}, p = typeof n == "function" ? n(t, i) : n, v = Le(
|
|
735
|
+
p,
|
|
736
|
+
g,
|
|
737
|
+
s.useDefaultDefinitions ?? !0
|
|
738
|
+
), d = at(s.allowMode, s.allow), m = /* @__PURE__ */ new Set();
|
|
739
|
+
for (const _ of v) _.type === "literal" && m.add(_.char);
|
|
740
|
+
if (s.prefix) for (const _ of s.prefix) m.add(_);
|
|
741
|
+
if (s.suffix) for (const _ of s.suffix) m.add(_);
|
|
742
|
+
const y = Array.from(t).filter((_) => d(_) && !m.has(_));
|
|
743
|
+
if (y.length === 0) return { value: "", cursor: 0, completed: !1 };
|
|
744
|
+
const o = [], a = [];
|
|
745
|
+
let D = 0, $ = 0, u = 0, x = -1;
|
|
746
|
+
for (const _ of v) {
|
|
747
|
+
if (_.type === "literal") {
|
|
748
|
+
o.push(_.char), a.push({ kind: "literal", filled: !0 });
|
|
749
|
+
continue;
|
|
750
|
+
}
|
|
751
|
+
$ += _.optional ? 0 : 1;
|
|
752
|
+
const B = y[D];
|
|
753
|
+
if (B == null)
|
|
754
|
+
break;
|
|
755
|
+
if (_.type === "any") {
|
|
756
|
+
u++, o.push(_.transform ? _.transform(B) : B), a.push({ kind: "slot", filled: !0 }), x = a.length - 1, D++;
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
if (_.type === "pattern")
|
|
760
|
+
if (_.pattern.test(B)) {
|
|
761
|
+
u++;
|
|
762
|
+
const N = _.transform ? _.transform(B) : B;
|
|
763
|
+
o.push(N), a.push({ kind: "slot", filled: !0 }), x = a.length - 1, D++;
|
|
764
|
+
} else {
|
|
765
|
+
D++;
|
|
766
|
+
continue;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
const M = o.join(""), I = (s.prefix ?? "") + M + (s.suffix ?? "");
|
|
770
|
+
let k = (s.prefix ?? "").length;
|
|
771
|
+
if (x >= 0) {
|
|
772
|
+
let _ = x + 1;
|
|
773
|
+
if ((b?.policy ?? "smart") !== "sticky")
|
|
774
|
+
for (; _ < a.length && a[_].kind === "literal"; ) _++;
|
|
775
|
+
k += _;
|
|
776
|
+
}
|
|
777
|
+
const c = s.completion?.mode === "min" ? (s.completion.minChars ?? 0) <= u : s.completion?.mode === "custom" ? !!s.completion.isComplete?.(I) : $ > 0 && u >= $, w = s.pipe?.(I, { ...i, completed: c });
|
|
778
|
+
let S, z = k;
|
|
779
|
+
return w === !1 ? (S = e, z = e.length) : typeof w == "string" ? (S = w, z = w.length) : typeof w == "object" && w ? (S = w.value, z = w.cursor ?? w.value.length) : S = I, { value: S, cursor: z, completed: c };
|
|
780
|
+
}
|
|
781
|
+
function ut(t, e) {
|
|
782
|
+
const n = e?.strategy ?? "none";
|
|
783
|
+
return n === "custom" && e?.unmask ? e.unmask(t) : n === "strip" ? t.replace(/[^A-Za-z0-9]/g, "") : t;
|
|
784
|
+
}
|
|
785
|
+
const Ue = (t) => {
|
|
786
|
+
const {
|
|
787
|
+
value: e,
|
|
788
|
+
onBlur: n,
|
|
789
|
+
onChange: s,
|
|
790
|
+
onInput: r,
|
|
791
|
+
onAccept: b,
|
|
792
|
+
onComplete: i,
|
|
793
|
+
mask: g,
|
|
794
|
+
definitions: p,
|
|
795
|
+
useDefaultDefinitions: v,
|
|
796
|
+
extraLiterals: d,
|
|
797
|
+
prefix: m,
|
|
798
|
+
suffix: y,
|
|
799
|
+
autofix: o,
|
|
800
|
+
pipe: a,
|
|
801
|
+
completion: D,
|
|
802
|
+
unmask: $,
|
|
803
|
+
allowMode: u,
|
|
804
|
+
allow: x,
|
|
805
|
+
placeholder: M,
|
|
806
|
+
placeholderOptions: I
|
|
807
|
+
} = t, A = V(
|
|
808
|
+
e,
|
|
809
|
+
g,
|
|
810
|
+
p,
|
|
811
|
+
v,
|
|
812
|
+
d,
|
|
813
|
+
m,
|
|
814
|
+
y,
|
|
815
|
+
o,
|
|
816
|
+
D,
|
|
817
|
+
$,
|
|
818
|
+
u,
|
|
819
|
+
M,
|
|
820
|
+
I
|
|
821
|
+
)((c, w, S, z, _, B, N, J, X, Y, Z, se, j) => w ? Me(c ?? "", "", w, {
|
|
822
|
+
definitions: S ?? {},
|
|
823
|
+
useDefaultDefinitions: z ?? !0,
|
|
824
|
+
extraLiterals: _ ?? [],
|
|
825
|
+
autofix: J ?? "none",
|
|
826
|
+
completion: X ?? { mode: "mask" },
|
|
827
|
+
pipe: a ?? ((L) => L),
|
|
828
|
+
unmask: Y ?? { strategy: "none" },
|
|
829
|
+
allowMode: Z ?? "all",
|
|
830
|
+
allow: x,
|
|
831
|
+
prefix: B,
|
|
832
|
+
suffix: N
|
|
833
|
+
}).value : c ?? ""), k = (c, w) => {
|
|
834
|
+
const S = c.value ?? "", z = f.get(e) ?? "", _ = g != null ? f.get(g) : null, B = p != null ? f.get(p) : void 0, N = v != null ? f.get(v) : void 0, J = d != null ? f.get(d) : void 0, X = o != null ? f.get(o) : void 0, Y = D != null ? f.get(D) : void 0, Z = $ != null ? f.get($) : void 0, se = u != null ? f.get(u) : void 0, j = m != null ? f.get(m) : void 0, L = y != null ? f.get(y) : void 0, {
|
|
835
|
+
value: H,
|
|
836
|
+
cursor: ae,
|
|
837
|
+
completed: ge
|
|
838
|
+
} = _ ? Me(
|
|
839
|
+
S,
|
|
840
|
+
z,
|
|
841
|
+
_,
|
|
842
|
+
{
|
|
843
|
+
definitions: B ?? {},
|
|
844
|
+
useDefaultDefinitions: N ?? !0,
|
|
845
|
+
extraLiterals: J ?? [],
|
|
846
|
+
autofix: X ?? "none",
|
|
847
|
+
completion: Y ?? { mode: "mask" },
|
|
848
|
+
pipe: a ?? ((Oe) => Oe),
|
|
849
|
+
unmask: Z ?? { strategy: "none" },
|
|
850
|
+
allowMode: se ?? "all",
|
|
851
|
+
allow: x,
|
|
852
|
+
prefix: j,
|
|
853
|
+
suffix: L
|
|
854
|
+
},
|
|
855
|
+
c.selectionStart ?? S.length,
|
|
856
|
+
t.cursor ? f.get(t.cursor) : void 0
|
|
857
|
+
) : { value: S, cursor: S.length, completed: !0 };
|
|
858
|
+
if (H !== S) {
|
|
859
|
+
c.value = H;
|
|
860
|
+
try {
|
|
861
|
+
c.setSelectionRange(ae, ae);
|
|
862
|
+
} catch {
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
const ve = ut(H, Z);
|
|
866
|
+
b?.({
|
|
867
|
+
raw: ve,
|
|
868
|
+
conformed: H,
|
|
869
|
+
completed: ge,
|
|
870
|
+
cursor: ae
|
|
871
|
+
}), w === "input" ? r?.(H) : (s?.(H), ge && i?.({ raw: ve, conformed: H }));
|
|
872
|
+
};
|
|
873
|
+
return E(
|
|
874
|
+
W({
|
|
875
|
+
...t,
|
|
876
|
+
input: ne.text(
|
|
877
|
+
q(t),
|
|
878
|
+
l.value(A),
|
|
879
|
+
l.class("bc-input"),
|
|
880
|
+
n != null ? C.blur(n) : T,
|
|
881
|
+
ee(
|
|
882
|
+
(c) => c instanceof HTMLInputElement ? E(
|
|
883
|
+
C.input(() => k(c, "input")),
|
|
884
|
+
C.change(() => k(c, "change")),
|
|
885
|
+
C.keydown((w) => {
|
|
886
|
+
if (w.key !== "Backspace" || !(t.cursor ? f.get(t.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
|
|
887
|
+
const z = c.selectionStart ?? 0, _ = c.selectionEnd ?? z;
|
|
888
|
+
if (z !== _ || z <= 0) return;
|
|
889
|
+
const B = c.value ?? "", N = g != null ? f.get(g) : null;
|
|
890
|
+
if (!N) return;
|
|
891
|
+
const J = p != null ? f.get(p) : void 0, X = v != null ? f.get(v) : !0, Y = m != null ? f.get(m) : void 0, Z = y != null ? f.get(y) : void 0, se = Le(
|
|
892
|
+
typeof N == "function" ? N(B, {
|
|
893
|
+
raw: B,
|
|
894
|
+
previousConformed: B,
|
|
895
|
+
cursor: z,
|
|
896
|
+
completed: !1
|
|
897
|
+
}) : N,
|
|
898
|
+
J ?? {},
|
|
899
|
+
X ?? !0
|
|
900
|
+
), j = /* @__PURE__ */ new Set();
|
|
901
|
+
for (const L of se)
|
|
902
|
+
L.type === "literal" && j.add(L.char);
|
|
903
|
+
if (Y) for (const L of Y) j.add(L);
|
|
904
|
+
if (Z) for (const L of Z) j.add(L);
|
|
905
|
+
if (j.has(B[z - 1])) {
|
|
906
|
+
let L = z - 1;
|
|
907
|
+
for (; L >= 0 && j.has(B[L]); ) L--;
|
|
908
|
+
L >= 0 && (w.preventDefault(), w.stopPropagation(), c.value = B.slice(0, L) + B.slice(L + 1), k(c, "input"));
|
|
909
|
+
}
|
|
910
|
+
})
|
|
911
|
+
) : T
|
|
912
|
+
)
|
|
913
|
+
)
|
|
914
|
+
})
|
|
915
|
+
);
|
|
916
|
+
};
|
|
917
|
+
function Ee(t, e, n) {
|
|
918
|
+
const s = f.map(t, (i) => i != null), r = V(
|
|
919
|
+
s,
|
|
920
|
+
e ?? !1
|
|
921
|
+
)((i, g) => !i || g), b = oe.clearValue;
|
|
922
|
+
return h.button(
|
|
923
|
+
l.type("button"),
|
|
924
|
+
l.class("bc-input-container__reset"),
|
|
925
|
+
G.label(b),
|
|
926
|
+
l.title(b),
|
|
927
|
+
l.disabled(r),
|
|
928
|
+
O({ icon: "mdi:close", size: "sm" }),
|
|
929
|
+
C.click((i) => {
|
|
930
|
+
i.stopPropagation(), n?.(null);
|
|
931
|
+
})
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
const St = (t) => {
|
|
935
|
+
const { value: e, onBlur: n, onChange: s, onInput: r, rows: b } = t;
|
|
936
|
+
return W({
|
|
937
|
+
baseContainer: !0,
|
|
938
|
+
...t,
|
|
939
|
+
input: h.textarea(
|
|
940
|
+
l.class(
|
|
941
|
+
V(t.size ?? "md")(
|
|
942
|
+
(i) => Ye(
|
|
943
|
+
!1,
|
|
944
|
+
i ?? "md"
|
|
945
|
+
)
|
|
946
|
+
)
|
|
947
|
+
),
|
|
948
|
+
q(t),
|
|
949
|
+
l.rows(b ?? 3),
|
|
950
|
+
l.value(e),
|
|
951
|
+
l.class("bc-input"),
|
|
952
|
+
n != null ? C.blur(P(n)) : T,
|
|
953
|
+
s != null ? C.change(P(s)) : T,
|
|
954
|
+
r != null ? C.input(P(r)) : T
|
|
955
|
+
)
|
|
956
|
+
});
|
|
957
|
+
}, zt = (t) => {
|
|
958
|
+
const { value: e, step: n, min: s, max: r, onBlur: b, onChange: i, onInput: g, after: p } = t, v = (y) => {
|
|
959
|
+
const o = s != null ? f.get(s) : void 0, a = r != null ? f.get(r) : void 0;
|
|
960
|
+
return o != null && y < o ? o : a != null && y > a ? a : y;
|
|
961
|
+
}, d = n != null ? F(R, (y) => {
|
|
962
|
+
const o = V(
|
|
963
|
+
e,
|
|
964
|
+
s
|
|
965
|
+
)((u, x) => x == null ? !0 : (u ?? 0) > x), a = V(
|
|
966
|
+
e,
|
|
967
|
+
r
|
|
968
|
+
)((u, x) => x == null ? !0 : (u ?? 0) < x), D = (u) => {
|
|
969
|
+
const x = f.get(e) ?? 0, M = f.get(n), I = u?.shiftKey ? 10 : 1, A = x - M * I, k = s != null ? f.get(s) : void 0;
|
|
970
|
+
if (k != null && A < k)
|
|
971
|
+
return;
|
|
972
|
+
const c = v(A);
|
|
973
|
+
c !== x && i && i(c);
|
|
974
|
+
}, $ = (u) => {
|
|
975
|
+
const x = f.get(e) ?? 0, M = f.get(n), I = u?.shiftKey ? 10 : 1, A = x + M * I, k = r != null ? f.get(r) : void 0;
|
|
976
|
+
if (k != null && A > k)
|
|
977
|
+
return;
|
|
978
|
+
const c = v(A);
|
|
979
|
+
c !== x && i && i(c);
|
|
980
|
+
};
|
|
981
|
+
return Ve(
|
|
982
|
+
l.class("bc-number-input-steppers"),
|
|
983
|
+
// Increment second
|
|
984
|
+
h.button(
|
|
985
|
+
l.type("button"),
|
|
986
|
+
l.class(
|
|
987
|
+
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
988
|
+
),
|
|
989
|
+
l.disabled(
|
|
990
|
+
V(
|
|
991
|
+
a,
|
|
992
|
+
t.disabled ?? !1
|
|
993
|
+
)((u, x) => !u || x)
|
|
994
|
+
),
|
|
995
|
+
C.click((u) => $(u)),
|
|
996
|
+
G.label(y.$.incrementValue),
|
|
997
|
+
O({ icon: "line-md:plus", size: "xs" })
|
|
998
|
+
),
|
|
999
|
+
// Decrement first (matches tests expecting first button to be decrement)
|
|
1000
|
+
h.button(
|
|
1001
|
+
l.type("button"),
|
|
1002
|
+
l.class(
|
|
1003
|
+
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1004
|
+
),
|
|
1005
|
+
l.disabled(
|
|
1006
|
+
V(
|
|
1007
|
+
o,
|
|
1008
|
+
t.disabled ?? !1
|
|
1009
|
+
)((u, x) => !u || x)
|
|
1010
|
+
),
|
|
1011
|
+
C.click((u) => D(u)),
|
|
1012
|
+
G.label(y.$.decrementValue),
|
|
1013
|
+
O({ icon: "line-md:minus", size: "xs" })
|
|
1014
|
+
)
|
|
1015
|
+
);
|
|
1016
|
+
}) : null, m = p != null && d != null ? E(d, p) : p ?? d;
|
|
1017
|
+
return W({
|
|
1018
|
+
...t,
|
|
1019
|
+
input: ne.number(
|
|
1020
|
+
s != null ? l.min(s) : T,
|
|
1021
|
+
r != null ? l.max(r) : T,
|
|
1022
|
+
q(t),
|
|
1023
|
+
l.valueAsNumber(e),
|
|
1024
|
+
l.step(n),
|
|
1025
|
+
l.class("bc-input bc-number-input"),
|
|
1026
|
+
b != null ? C.blur(P(b)) : T,
|
|
1027
|
+
i != null ? C.change(_e(i)) : T,
|
|
1028
|
+
g != null ? C.input(_e(g)) : T,
|
|
1029
|
+
// Add wheel event support when step is defined
|
|
1030
|
+
n != null ? C.wheel((y) => {
|
|
1031
|
+
y.preventDefault();
|
|
1032
|
+
const o = f.get(e) ?? 0, a = f.get(n), D = y.shiftKey ? 10 : 1, $ = y.deltaY < 0 ? a * D : -a * D, u = v(o + $);
|
|
1033
|
+
u !== o && i && i(u);
|
|
1034
|
+
}) : T
|
|
1035
|
+
),
|
|
1036
|
+
after: m
|
|
1037
|
+
});
|
|
1038
|
+
}, Te = (t) => {
|
|
1039
|
+
if (t == null || t === "") return null;
|
|
1040
|
+
const e = Number(t);
|
|
1041
|
+
return Number.isNaN(e) ? null : e;
|
|
1042
|
+
}, Bt = (t) => {
|
|
1043
|
+
const { value: e, step: n, min: s, max: r, onBlur: b, onChange: i, onInput: g, after: p } = t, v = (o) => {
|
|
1044
|
+
const a = s != null ? f.get(s) : void 0, D = r != null ? f.get(r) : void 0;
|
|
1045
|
+
return a != null && o < a ? a : D != null && o > D ? D : o;
|
|
1046
|
+
}, d = (() => {
|
|
1047
|
+
if (n == null) return null;
|
|
1048
|
+
const o = V(
|
|
1049
|
+
e,
|
|
1050
|
+
s
|
|
1051
|
+
)((x, M) => {
|
|
1052
|
+
const I = x ?? 0;
|
|
1053
|
+
return M == null ? !0 : I > M;
|
|
1054
|
+
}), a = V(
|
|
1055
|
+
e,
|
|
1056
|
+
r
|
|
1057
|
+
)((x, M) => {
|
|
1058
|
+
const I = x ?? 0;
|
|
1059
|
+
return M == null ? !0 : I < M;
|
|
1060
|
+
}), D = (x) => {
|
|
1061
|
+
const M = f.get(e) ?? 0, I = f.get(n), A = x?.shiftKey ? 10 : 1, k = M - I * A, c = s != null ? f.get(s) : void 0;
|
|
1062
|
+
if (c != null && k < c) return;
|
|
1063
|
+
const w = v(k);
|
|
1064
|
+
w !== M && i && i(w);
|
|
1065
|
+
}, $ = (x) => {
|
|
1066
|
+
const M = f.get(e) ?? 0, I = f.get(n), A = x?.shiftKey ? 10 : 1, k = M + I * A, c = r != null ? f.get(r) : void 0;
|
|
1067
|
+
if (c != null && k > c) return;
|
|
1068
|
+
const w = v(k);
|
|
1069
|
+
w !== M && i && i(w);
|
|
1070
|
+
};
|
|
1071
|
+
return ((x, M) => Ve(
|
|
1072
|
+
l.class("bc-number-input-steppers"),
|
|
1073
|
+
h.button(
|
|
1074
|
+
l.type("button"),
|
|
1075
|
+
l.class(
|
|
1076
|
+
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1077
|
+
),
|
|
1078
|
+
l.disabled(
|
|
1079
|
+
V(
|
|
1080
|
+
a,
|
|
1081
|
+
t.disabled ?? !1
|
|
1082
|
+
)((I, A) => !I || A)
|
|
1083
|
+
),
|
|
1084
|
+
C.click((I) => $(I)),
|
|
1085
|
+
G.label(x),
|
|
1086
|
+
O({ icon: "line-md:plus", size: "xs" })
|
|
1087
|
+
),
|
|
1088
|
+
h.button(
|
|
1089
|
+
l.type("button"),
|
|
1090
|
+
l.class(
|
|
1091
|
+
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1092
|
+
),
|
|
1093
|
+
l.disabled(
|
|
1094
|
+
V(
|
|
1095
|
+
o,
|
|
1096
|
+
t.disabled ?? !1
|
|
1097
|
+
)((I, A) => !I || A)
|
|
1098
|
+
),
|
|
1099
|
+
C.click((I) => D(I)),
|
|
1100
|
+
G.label(M),
|
|
1101
|
+
O({ icon: "line-md:minus", size: "xs" })
|
|
1102
|
+
)
|
|
1103
|
+
))(
|
|
1104
|
+
oe.incrementValue,
|
|
1105
|
+
oe.decrementValue
|
|
1106
|
+
);
|
|
1107
|
+
})(), m = Ee(
|
|
1108
|
+
e,
|
|
1109
|
+
t.disabled,
|
|
1110
|
+
i ?? g
|
|
1111
|
+
), y = p != null && d != null ? E(d, m, p) : p != null ? E(m, p) : d != null ? E(d, m) : m;
|
|
1112
|
+
return W({
|
|
1113
|
+
...t,
|
|
1114
|
+
input: ne.number(
|
|
1115
|
+
// min/max attributes and reactive watchers (no forced correction)
|
|
1116
|
+
s != null ? l.min(s) : T,
|
|
1117
|
+
r != null ? l.max(r) : T,
|
|
1118
|
+
q(t),
|
|
1119
|
+
// Represent null as empty string so the field can be cleared
|
|
1120
|
+
l.value(f.map(e, (o) => o == null ? "" : String(o))),
|
|
1121
|
+
l.step(n),
|
|
1122
|
+
l.class("bc-input bc-number-input"),
|
|
1123
|
+
b != null ? C.blur(P(b)) : T,
|
|
1124
|
+
i != null ? C.change(
|
|
1125
|
+
P((o) => {
|
|
1126
|
+
const a = Te(o);
|
|
1127
|
+
i(a);
|
|
1128
|
+
})
|
|
1129
|
+
) : T,
|
|
1130
|
+
g != null ? C.input(
|
|
1131
|
+
P((o) => {
|
|
1132
|
+
const a = Te(o);
|
|
1133
|
+
g(a);
|
|
1134
|
+
})
|
|
1135
|
+
) : T,
|
|
1136
|
+
// Wheel support when step is defined
|
|
1137
|
+
n != null ? C.wheel((o) => {
|
|
1138
|
+
o.preventDefault();
|
|
1139
|
+
const a = f.get(e) ?? 0, D = f.get(n), $ = o.shiftKey ? 10 : 1, u = o.deltaY < 0 ? D * $ : -D * $, x = v(a + u);
|
|
1140
|
+
x !== a && i && i(x);
|
|
1141
|
+
}) : T
|
|
1142
|
+
),
|
|
1143
|
+
after: y
|
|
1144
|
+
});
|
|
1145
|
+
}, Vt = (t) => {
|
|
1146
|
+
const e = {
|
|
1147
|
+
type: "pattern",
|
|
1148
|
+
pattern: /[0-9A-Fa-f]/,
|
|
1149
|
+
transform: (s) => s.toLowerCase()
|
|
1150
|
+
};
|
|
1151
|
+
return Ue({
|
|
1152
|
+
...t,
|
|
1153
|
+
mask: [
|
|
1154
|
+
e,
|
|
1155
|
+
e,
|
|
1156
|
+
e,
|
|
1157
|
+
e,
|
|
1158
|
+
e,
|
|
1159
|
+
e,
|
|
1160
|
+
e,
|
|
1161
|
+
e,
|
|
1162
|
+
"-",
|
|
1163
|
+
e,
|
|
1164
|
+
e,
|
|
1165
|
+
e,
|
|
1166
|
+
e,
|
|
1167
|
+
"-",
|
|
1168
|
+
e,
|
|
1169
|
+
e,
|
|
1170
|
+
e,
|
|
1171
|
+
e,
|
|
1172
|
+
"-",
|
|
1173
|
+
e,
|
|
1174
|
+
e,
|
|
1175
|
+
e,
|
|
1176
|
+
e,
|
|
1177
|
+
"-",
|
|
1178
|
+
e,
|
|
1179
|
+
e,
|
|
1180
|
+
e,
|
|
1181
|
+
e,
|
|
1182
|
+
e,
|
|
1183
|
+
e,
|
|
1184
|
+
e,
|
|
1185
|
+
e,
|
|
1186
|
+
e,
|
|
1187
|
+
e,
|
|
1188
|
+
e,
|
|
1189
|
+
e
|
|
1190
|
+
],
|
|
1191
|
+
// Sensible default placeholder; can be overridden via options.placeholder
|
|
1192
|
+
placeholder: t.placeholder ?? "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
1193
|
+
});
|
|
1194
|
+
}, ft = /^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i, pt = /^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;
|
|
1195
|
+
function dt(t) {
|
|
1196
|
+
return {
|
|
1197
|
+
mask: null,
|
|
1198
|
+
allowMode: "custom",
|
|
1199
|
+
allow: (e) => /[0-9ptwdhms]/i.test(e),
|
|
1200
|
+
pipe: (e) => {
|
|
1201
|
+
const n = e.toUpperCase();
|
|
1202
|
+
return n.length === 0 ? n : !n.startsWith("P") || !ft.test(n) ? !1 : n;
|
|
1203
|
+
},
|
|
1204
|
+
completion: {
|
|
1205
|
+
mode: "custom",
|
|
1206
|
+
isComplete: (e) => {
|
|
1207
|
+
const n = e.toUpperCase();
|
|
1208
|
+
if (!pt.test(n)) return !1;
|
|
1209
|
+
try {
|
|
1210
|
+
return t(n), !0;
|
|
1211
|
+
} catch {
|
|
1212
|
+
return !1;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
const Se = (t, e) => {
|
|
1219
|
+
if (t == null) return null;
|
|
1220
|
+
try {
|
|
1221
|
+
return t.Duration.from(e);
|
|
1222
|
+
} catch {
|
|
1223
|
+
return null;
|
|
1224
|
+
}
|
|
1225
|
+
}, At = (t) => {
|
|
1226
|
+
const { value: e, onChange: n, onInput: s, after: r, disabled: b, onBlur: i } = t, g = () => {
|
|
1227
|
+
const d = Ee(e, b, n ?? s);
|
|
1228
|
+
return r != null ? E(d, r) : d;
|
|
1229
|
+
}, p = t.placeholder != null ? T : l.placeholder("P0DT0H0M0S");
|
|
1230
|
+
return Xe(
|
|
1231
|
+
(d) => Ue({
|
|
1232
|
+
...t,
|
|
1233
|
+
value: f.map(e, (m) => m?.toString() ?? ""),
|
|
1234
|
+
onChange: n ? (m) => n(m === "" ? null : d.Duration.from(m)) : void 0,
|
|
1235
|
+
onInput: void 0,
|
|
1236
|
+
...dt(d.Duration.from),
|
|
1237
|
+
placeholder: "P0DT0H0M0S",
|
|
1238
|
+
after: g()
|
|
1239
|
+
}),
|
|
1240
|
+
{ pending: () => {
|
|
1241
|
+
const d = (m) => (y) => {
|
|
1242
|
+
const a = y.currentTarget?.value ?? "";
|
|
1243
|
+
if (a === "") {
|
|
1244
|
+
m(null);
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1247
|
+
const D = globalThis.Temporal, $ = Se(D, a);
|
|
1248
|
+
if ($ != null) {
|
|
1249
|
+
m($);
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
be().then((u) => {
|
|
1253
|
+
const x = Se(u, a);
|
|
1254
|
+
x != null && m(x);
|
|
1255
|
+
}).catch(() => {
|
|
1256
|
+
});
|
|
1257
|
+
};
|
|
1258
|
+
return W({
|
|
1259
|
+
...t,
|
|
1260
|
+
input: ne.text(
|
|
1261
|
+
q(t),
|
|
1262
|
+
l.value(f.map(e, (m) => m?.toString() ?? "")),
|
|
1263
|
+
l.class("bc-input"),
|
|
1264
|
+
p,
|
|
1265
|
+
i != null ? C.blur(() => i()) : T,
|
|
1266
|
+
n != null ? C.change(d(n)) : T,
|
|
1267
|
+
s != null ? C.input(d(s)) : T
|
|
1268
|
+
),
|
|
1269
|
+
after: g()
|
|
1270
|
+
});
|
|
1271
|
+
} }
|
|
1272
|
+
);
|
|
1273
|
+
}, Lt = (t) => {
|
|
1274
|
+
const { value: e, onBlur: n, onChange: s, onInput: r } = t;
|
|
1275
|
+
return W({
|
|
1276
|
+
...t,
|
|
1277
|
+
input: ne.url(
|
|
1278
|
+
q(t),
|
|
1279
|
+
l.value(e),
|
|
1280
|
+
l.class("bc-input"),
|
|
1281
|
+
n != null ? C.blur(P(n)) : T,
|
|
1282
|
+
s != null ? C.change(P(s)) : T,
|
|
1283
|
+
r != null ? C.input(P(r)) : T
|
|
1284
|
+
)
|
|
1285
|
+
});
|
|
1286
|
+
};
|
|
1287
|
+
function mt(t, e) {
|
|
1288
|
+
const {
|
|
1289
|
+
onMove: n,
|
|
1290
|
+
cannotMoveUp: s,
|
|
1291
|
+
cannotMoveDown: r,
|
|
1292
|
+
onRemove: b,
|
|
1293
|
+
showMove: i = !0,
|
|
1294
|
+
showRemove: g = !0,
|
|
1295
|
+
removeDisabled: p,
|
|
1296
|
+
showMoveButtons: v = !0,
|
|
1297
|
+
layout: d = "aside"
|
|
1298
|
+
} = t, m = f.toSignal(d).map((a) => a === "aside"), y = U(
|
|
1299
|
+
i,
|
|
1300
|
+
() => h.div(
|
|
1301
|
+
l.class("bc-list-item-controls__move"),
|
|
1302
|
+
me(
|
|
1303
|
+
{
|
|
1304
|
+
size: "xs",
|
|
1305
|
+
roundedness: "full",
|
|
1306
|
+
variant: "text",
|
|
1307
|
+
onClick: () => n("up"),
|
|
1308
|
+
disabled: s
|
|
1309
|
+
},
|
|
1310
|
+
F(
|
|
1311
|
+
R,
|
|
1312
|
+
(a) => O({
|
|
1313
|
+
size: "xs",
|
|
1314
|
+
icon: "line-md:arrow-up",
|
|
1315
|
+
title: a.$.incrementValue
|
|
1316
|
+
})
|
|
1317
|
+
)
|
|
1318
|
+
),
|
|
1319
|
+
me(
|
|
1320
|
+
{
|
|
1321
|
+
size: "xs",
|
|
1322
|
+
roundedness: "full",
|
|
1323
|
+
variant: "text",
|
|
1324
|
+
onClick: () => n("down"),
|
|
1325
|
+
disabled: r
|
|
1326
|
+
},
|
|
1327
|
+
F(
|
|
1328
|
+
R,
|
|
1329
|
+
(a) => O({
|
|
1330
|
+
size: "xs",
|
|
1331
|
+
icon: "line-md:arrow-down",
|
|
1332
|
+
title: a.$.decrementValue
|
|
1333
|
+
})
|
|
1334
|
+
)
|
|
1335
|
+
)
|
|
1336
|
+
)
|
|
1337
|
+
), o = U(
|
|
1338
|
+
g,
|
|
1339
|
+
() => F(
|
|
1340
|
+
R,
|
|
1341
|
+
(a) => ie({
|
|
1342
|
+
size: "xs",
|
|
1343
|
+
label: f.map(a.$.removeItem, (D) => D.toLowerCase()),
|
|
1344
|
+
color: "danger",
|
|
1345
|
+
disabled: p,
|
|
1346
|
+
onClick: b
|
|
1347
|
+
})
|
|
1348
|
+
)
|
|
1349
|
+
);
|
|
1350
|
+
return U(
|
|
1351
|
+
m,
|
|
1352
|
+
() => h.div(
|
|
1353
|
+
l.class("bc-list-item-controls bc-list-item-controls--aside"),
|
|
1354
|
+
h.div(l.class("bc-list-item-controls__content"), e),
|
|
1355
|
+
h.div(
|
|
1356
|
+
l.class("bc-list-item-controls__actions"),
|
|
1357
|
+
U(v, () => y),
|
|
1358
|
+
o
|
|
1359
|
+
)
|
|
1360
|
+
),
|
|
1361
|
+
() => h.div(
|
|
1362
|
+
l.class("bc-list-item-controls bc-list-item-controls--below"),
|
|
1363
|
+
h.div(l.class("bc-list-item-controls__content"), e),
|
|
1364
|
+
h.div(
|
|
1365
|
+
l.class("bc-list-item-controls__actions"),
|
|
1366
|
+
U(
|
|
1367
|
+
v,
|
|
1368
|
+
() => y,
|
|
1369
|
+
() => h.div()
|
|
1370
|
+
),
|
|
1371
|
+
o
|
|
1372
|
+
)
|
|
1373
|
+
)
|
|
1374
|
+
);
|
|
1375
|
+
}
|
|
1376
|
+
const bt = (t) => {
|
|
1377
|
+
const {
|
|
1378
|
+
controller: e,
|
|
1379
|
+
element: n,
|
|
1380
|
+
separator: s,
|
|
1381
|
+
showMove: r = !0,
|
|
1382
|
+
showRemove: b = !0,
|
|
1383
|
+
showAdd: i = !0,
|
|
1384
|
+
createItem: g,
|
|
1385
|
+
addLabel: p,
|
|
1386
|
+
controlsLayout: v = "aside",
|
|
1387
|
+
removeDisabled: d,
|
|
1388
|
+
addDisabled: m
|
|
1389
|
+
} = t, y = U(
|
|
1390
|
+
V(i, g)((o, a) => o && a != null),
|
|
1391
|
+
() => Ie(
|
|
1392
|
+
l.class(
|
|
1393
|
+
"bc-group--gap-2 bc-group--align-center bc-group--justify-center"
|
|
1394
|
+
),
|
|
1395
|
+
me(
|
|
1396
|
+
{
|
|
1397
|
+
size: "sm",
|
|
1398
|
+
variant: "filled",
|
|
1399
|
+
onClick: () => e.push(g()),
|
|
1400
|
+
disabled: V(
|
|
1401
|
+
e.disabled,
|
|
1402
|
+
m ?? !1
|
|
1403
|
+
)(
|
|
1404
|
+
(o, a) => o || a
|
|
1405
|
+
)
|
|
1406
|
+
},
|
|
1407
|
+
F(
|
|
1408
|
+
R,
|
|
1409
|
+
(o) => Ie(
|
|
1410
|
+
l.class("bc-group--gap-2"),
|
|
1411
|
+
O({ icon: "line-md:plus" }),
|
|
1412
|
+
p ?? o.$.addLabel
|
|
1413
|
+
)
|
|
1414
|
+
)
|
|
1415
|
+
)
|
|
1416
|
+
)
|
|
1417
|
+
);
|
|
1418
|
+
return E(
|
|
1419
|
+
ot(
|
|
1420
|
+
e,
|
|
1421
|
+
(o) => mt(
|
|
1422
|
+
{
|
|
1423
|
+
onMove: o.move,
|
|
1424
|
+
cannotMoveUp: o.cannotMove("up"),
|
|
1425
|
+
cannotMoveDown: o.cannotMove("down"),
|
|
1426
|
+
onRemove: o.remove,
|
|
1427
|
+
showMove: r,
|
|
1428
|
+
showRemove: b,
|
|
1429
|
+
removeDisabled: d,
|
|
1430
|
+
showMoveButtons: e.signal.map((a) => a.length > 1),
|
|
1431
|
+
layout: v
|
|
1432
|
+
},
|
|
1433
|
+
n(o)
|
|
1434
|
+
),
|
|
1435
|
+
s
|
|
1436
|
+
),
|
|
1437
|
+
y
|
|
1438
|
+
);
|
|
1439
|
+
}, Ut = (t, ...e) => {
|
|
1440
|
+
const {
|
|
1441
|
+
controller: n,
|
|
1442
|
+
element: s,
|
|
1443
|
+
separator: r,
|
|
1444
|
+
showMove: b,
|
|
1445
|
+
showRemove: i,
|
|
1446
|
+
showAdd: g,
|
|
1447
|
+
createItem: p,
|
|
1448
|
+
addLabel: v,
|
|
1449
|
+
controlsLayout: d,
|
|
1450
|
+
removeDisabled: m,
|
|
1451
|
+
addDisabled: y,
|
|
1452
|
+
...o
|
|
1453
|
+
} = t;
|
|
1454
|
+
return Be(
|
|
1455
|
+
{
|
|
1456
|
+
...o,
|
|
1457
|
+
content: bt({
|
|
1458
|
+
controller: n,
|
|
1459
|
+
element: s,
|
|
1460
|
+
separator: r,
|
|
1461
|
+
showMove: b,
|
|
1462
|
+
showRemove: i,
|
|
1463
|
+
showAdd: g,
|
|
1464
|
+
createItem: p,
|
|
1465
|
+
addLabel: v,
|
|
1466
|
+
controlsLayout: d,
|
|
1467
|
+
removeDisabled: m,
|
|
1468
|
+
addDisabled: y
|
|
1469
|
+
})
|
|
1470
|
+
},
|
|
1471
|
+
...e
|
|
1472
|
+
);
|
|
1473
|
+
};
|
|
1474
|
+
class Et extends ue {
|
|
1475
|
+
/** The immutable list of branch definitions for this union */
|
|
1476
|
+
branches;
|
|
1477
|
+
/** Reactive signal containing the key of the currently active branch */
|
|
1478
|
+
activeBranch;
|
|
1479
|
+
/** @internal Reactive signal containing the controller for the active branch */
|
|
1480
|
+
#t;
|
|
1481
|
+
/** @internal Cache of lazily-created branch controllers */
|
|
1482
|
+
#e = /* @__PURE__ */ new Map();
|
|
1483
|
+
/**
|
|
1484
|
+
* Creates a new UnionController.
|
|
1485
|
+
*
|
|
1486
|
+
* @param path - The path segments identifying this controller in the form tree
|
|
1487
|
+
* @param change - Callback to propagate value changes to the parent
|
|
1488
|
+
* @param signal - Reactive signal holding the current union value
|
|
1489
|
+
* @param status - Reactive signal holding the current validation status
|
|
1490
|
+
* @param parent - Parent context providing disabled state and optional validation mode
|
|
1491
|
+
* @param branches - Array of branch definitions describing the possible value types
|
|
1492
|
+
* @param equals - Optional equality function for comparing values. Defaults to `strictEqual`.
|
|
1493
|
+
*/
|
|
1494
|
+
constructor(e, n, s, r, b, i, g = Q) {
|
|
1495
|
+
super(e, n, s, r, b, g), this.branches = i;
|
|
1496
|
+
const p = (d) => {
|
|
1497
|
+
for (const m of i)
|
|
1498
|
+
if (m.detect(d))
|
|
1499
|
+
return m.key;
|
|
1500
|
+
return i[0]?.key ?? "unknown";
|
|
1501
|
+
};
|
|
1502
|
+
this.activeBranch = s.map(p, Q);
|
|
1503
|
+
const v = (d) => {
|
|
1504
|
+
if (this.#e.has(d))
|
|
1505
|
+
return this.#e.get(d);
|
|
1506
|
+
const m = i.find((o) => o.key === d);
|
|
1507
|
+
if (!m)
|
|
1508
|
+
throw new Error(`Unknown branch: ${d}`);
|
|
1509
|
+
const y = new ue(
|
|
1510
|
+
[...e, d],
|
|
1511
|
+
(o) => {
|
|
1512
|
+
this.change(o);
|
|
1513
|
+
},
|
|
1514
|
+
this.signal.map(
|
|
1515
|
+
(o) => m.detect(o) ? o : m.defaultValue(),
|
|
1516
|
+
g
|
|
1517
|
+
),
|
|
1518
|
+
r.map(De([d])),
|
|
1519
|
+
{
|
|
1520
|
+
disabled: this.disabled,
|
|
1521
|
+
validationMode: this.parent.validationMode
|
|
1522
|
+
},
|
|
1523
|
+
g
|
|
1524
|
+
);
|
|
1525
|
+
return this.#e.set(d, y), y;
|
|
1526
|
+
};
|
|
1527
|
+
this.#t = this.activeBranch.map(
|
|
1528
|
+
(d) => v(d),
|
|
1529
|
+
Q
|
|
1530
|
+
), this.onDispose(() => {
|
|
1531
|
+
for (const d of this.#e.values())
|
|
1532
|
+
d.dispose();
|
|
1533
|
+
this.#e.clear(), this.activeBranch.dispose(), this.#t.dispose();
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Gets the controller for the currently active branch.
|
|
1538
|
+
*
|
|
1539
|
+
* The returned controller's value and type correspond to the branch that
|
|
1540
|
+
* matches the current union value.
|
|
1541
|
+
*
|
|
1542
|
+
* @returns The `Controller<unknown>` for the active branch
|
|
1543
|
+
*/
|
|
1544
|
+
get activeController() {
|
|
1545
|
+
return f.get(this.#t);
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Gets or creates a controller for a specific branch by key.
|
|
1549
|
+
*
|
|
1550
|
+
* Controllers are created lazily and cached for subsequent calls.
|
|
1551
|
+
*
|
|
1552
|
+
* @param branchKey - The unique key of the branch to get a controller for
|
|
1553
|
+
* @returns The `Controller<unknown>` for the specified branch
|
|
1554
|
+
* @throws Error if the branch key is not found in the branches array
|
|
1555
|
+
*/
|
|
1556
|
+
getBranchController(e) {
|
|
1557
|
+
const n = this.branches.find((r) => r.key === e);
|
|
1558
|
+
if (!n)
|
|
1559
|
+
throw new Error(`Unknown branch: ${e}`);
|
|
1560
|
+
if (this.#e.has(e))
|
|
1561
|
+
return this.#e.get(e);
|
|
1562
|
+
const s = new ue(
|
|
1563
|
+
[...this.path, e],
|
|
1564
|
+
(r) => {
|
|
1565
|
+
this.change(r);
|
|
1566
|
+
},
|
|
1567
|
+
this.signal.map(
|
|
1568
|
+
(r) => n.detect(r) ? r : n.defaultValue(),
|
|
1569
|
+
Q
|
|
1570
|
+
),
|
|
1571
|
+
this.status.map(De([e])),
|
|
1572
|
+
{
|
|
1573
|
+
disabled: this.disabled,
|
|
1574
|
+
validationMode: this.parent.validationMode
|
|
1575
|
+
},
|
|
1576
|
+
Q
|
|
1577
|
+
);
|
|
1578
|
+
return this.#e.set(e, s), s;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Switches the union value to a different branch.
|
|
1582
|
+
*
|
|
1583
|
+
* Attempts the following in order:
|
|
1584
|
+
* 1. If already on the target branch, returns `true` immediately
|
|
1585
|
+
* 2. If the branch has a `convert` function, tries to convert the current value
|
|
1586
|
+
* 3. If conversion fails and `confirmChange` is true, prompts the user with `window.confirm`
|
|
1587
|
+
* 4. Sets the value to the branch's default value
|
|
1588
|
+
*
|
|
1589
|
+
* @param branchKey - The key of the branch to switch to
|
|
1590
|
+
* @param confirmChange - If true, prompts the user before losing the current value when conversion fails
|
|
1591
|
+
* @returns `true` if the switch was successful, `false` if the user cancelled
|
|
1592
|
+
* @throws Error if the branch key is not found in the branches array
|
|
1593
|
+
*/
|
|
1594
|
+
switchToBranch(e, n = !1) {
|
|
1595
|
+
const s = this.branches.find((i) => i.key === e);
|
|
1596
|
+
if (!s)
|
|
1597
|
+
throw new Error(`Unknown branch: ${e}`);
|
|
1598
|
+
const r = f.get(this.signal);
|
|
1599
|
+
if (s.detect(r))
|
|
1600
|
+
return !0;
|
|
1601
|
+
if (s.convert) {
|
|
1602
|
+
const i = s.convert(r);
|
|
1603
|
+
if (i.ok)
|
|
1604
|
+
return this.change(i.value), !0;
|
|
1605
|
+
}
|
|
1606
|
+
if (n && typeof window == "object" && typeof window.confirm == "function" && !window.confirm(oe.changeTypeConfirmation))
|
|
1607
|
+
return !1;
|
|
1608
|
+
const b = s.defaultValue();
|
|
1609
|
+
return this.change(b), !0;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Gets the {@link UnionBranch} definition for the currently active branch.
|
|
1613
|
+
*
|
|
1614
|
+
* @returns The active branch definition, or `undefined` if no branch matches
|
|
1615
|
+
*/
|
|
1616
|
+
get activeBranchDefinition() {
|
|
1617
|
+
const e = f.get(this.activeBranch);
|
|
1618
|
+
return this.branches.find((n) => n.key === e);
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
function Ot(t) {
|
|
1622
|
+
return t.transform(
|
|
1623
|
+
(e) => e ?? null,
|
|
1624
|
+
(e) => e ?? void 0
|
|
1625
|
+
);
|
|
1626
|
+
}
|
|
1627
|
+
function Ft(t) {
|
|
1628
|
+
return t.transform(
|
|
1629
|
+
(e) => e ?? "",
|
|
1630
|
+
(e) => e === "" ? void 0 : e
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1633
|
+
function Rt(t) {
|
|
1634
|
+
return t.transform(
|
|
1635
|
+
(e) => e ?? void 0,
|
|
1636
|
+
(e) => e ?? null
|
|
1637
|
+
);
|
|
1638
|
+
}
|
|
1639
|
+
function le(t) {
|
|
1640
|
+
return t !== null && typeof t == "object" && !Array.isArray(t) && Object.prototype.toString.call(t) === "[object Object]";
|
|
1641
|
+
}
|
|
1642
|
+
function ht(t, e) {
|
|
1643
|
+
if (e == null)
|
|
1644
|
+
return ze(t);
|
|
1645
|
+
if (t == null)
|
|
1646
|
+
return e;
|
|
1647
|
+
if (le(t) && le(e)) {
|
|
1648
|
+
const n = { ...e };
|
|
1649
|
+
for (const s of Object.keys(t))
|
|
1650
|
+
n[s] === void 0 ? n[s] = ze(t[s]) : le(t[s]) && le(n[s]) && (n[s] = ht(t[s], n[s]));
|
|
1651
|
+
return n;
|
|
1652
|
+
}
|
|
1653
|
+
return e;
|
|
1654
|
+
}
|
|
1655
|
+
function ze(t) {
|
|
1656
|
+
return typeof structuredClone == "function" ? structuredClone(t) : JSON.parse(JSON.stringify(t));
|
|
1657
|
+
}
|
|
1658
|
+
export {
|
|
1659
|
+
bt as B,
|
|
1660
|
+
st as E,
|
|
1661
|
+
$t as F,
|
|
1662
|
+
Ie as G,
|
|
1663
|
+
Ut as L,
|
|
1664
|
+
Ue as M,
|
|
1665
|
+
Ee as N,
|
|
1666
|
+
It as S,
|
|
1667
|
+
St as T,
|
|
1668
|
+
Vt as U,
|
|
1669
|
+
Xe as W,
|
|
1670
|
+
Lt as a,
|
|
1671
|
+
rt as b,
|
|
1672
|
+
At as c,
|
|
1673
|
+
dt as d,
|
|
1674
|
+
Ft as e,
|
|
1675
|
+
Bt as f,
|
|
1676
|
+
zt as g,
|
|
1677
|
+
Tt as h,
|
|
1678
|
+
Et as i,
|
|
1679
|
+
ht as j,
|
|
1680
|
+
pe as k,
|
|
1681
|
+
mt as l,
|
|
1682
|
+
Rt as m,
|
|
1683
|
+
ot as n,
|
|
1684
|
+
it as o,
|
|
1685
|
+
Mt as p,
|
|
1686
|
+
lt as q,
|
|
1687
|
+
be as r,
|
|
1688
|
+
Ot as t
|
|
1689
|
+
};
|