@tempots/beatui 1.7.4 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ar-Wr6gMs-M.cjs → ar-CEzAem0F.cjs} +1 -1
- package/dist/{ar-fdUqbCvM.js → ar-CQieaqsq.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-B8yr-E_b.cjs +1 -0
- package/dist/{auth-divider-D9KnNeyF.js → auth-divider-Byh5BWLc.js} +91 -88
- package/dist/beatui.css +1 -0
- package/dist/beatui.tailwind.css +1 -0
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +27 -26
- package/dist/card-BkA7Wvbh.cjs +1 -0
- package/dist/card-DX1DwGbL.js +62 -0
- package/dist/{colors-C2sgnzFH.js → colors-CyMhfbJi.js} +64 -58
- package/dist/{colors-DPCHjRMj.cjs → colors-IXZF9U-s.cjs} +1 -1
- package/dist/control-hqEuMzyI.js +343 -0
- package/dist/control-muup9GF1.cjs +1 -0
- package/dist/custom-validation-BA9iJWl_.cjs +1 -0
- package/dist/custom-validation-BOBoUwHY.js +181 -0
- package/dist/{de-C5-k5Eov.js → de-CBIwvkAH.js} +1 -1
- package/dist/{de-DZqdSEta.cjs → de-DdfxrlT3.cjs} +1 -1
- package/dist/deep-merge-8fwp1z4X.js +1346 -0
- package/dist/deep-merge-VDGE_HQD.cjs +1 -0
- package/dist/duration-input-DmsljXl3.cjs +1 -0
- package/dist/{duration-input-D4V_PHIg.js → duration-input-ZQlcqdXU.js} +32 -31
- package/dist/{editor-toolbar-group-FpOHrmtx.js → editor-toolbar-group-BNTBMJCe.js} +2 -2
- package/dist/{editor-toolbar-group-C_ft_T8D.cjs → editor-toolbar-group-DiMzqYgz.cjs} +1 -1
- package/dist/{es-h6jmoF4X.js → es--9HaEj2D.js} +1 -1
- package/dist/{es-CJgYfRap.cjs → es-DSdljxFJ.cjs} +1 -1
- package/dist/{fa-BuxK837l.js → fa-1Z-akcW7.js} +1 -1
- package/dist/{fa-BQ5PzwNY.cjs → fa-BolmeWRT.cjs} +1 -1
- package/dist/flyout-CuKFh_T7.js +151 -0
- package/dist/flyout-DC_tKaTG.cjs +1 -0
- package/dist/{fr-Bv3TG44U.cjs → fr-CODgUuoZ.cjs} +1 -1
- package/dist/{fr-BwILQ9G2.js → fr-DhHM9rou.js} +1 -1
- package/dist/{he-yC9Sc7JD.js → he-CBamXbGJ.js} +1 -1
- package/dist/{he-5LbvgMCC.cjs → he-Juw-dr28.cjs} +1 -1
- package/dist/{hi-Da7rcCpP.js → hi-DvvcX-Ra.js} +1 -1
- package/dist/{hi-YWhWcG_L.cjs → hi-R749jeg-.cjs} +1 -1
- package/dist/{index-CvU9E9wd.js → index-BfQaT5Jy.js} +104 -104
- package/dist/{index-XogEKwdt.cjs → index-Dv7nPuwA.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6713 -9831
- package/dist/{input-container-CyOgiiQD.cjs → input-container-BaWQLWB6.cjs} +1 -1
- package/dist/{input-container-8JFB11xN.js → input-container-DCS5oJ4S.js} +4 -4
- package/dist/{it-BxOIJE45.cjs → it-DT5oRZDH.cjs} +1 -1
- package/dist/{it-Yeklau78.js → it-aV6i8Qxz.js} +1 -1
- package/dist/{ja-Dxj9Q5Yd.js → ja-CuLhGnJX.js} +1 -1
- package/dist/{ja-CNhjK06P.cjs → ja-CwKaCYLB.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +83 -79
- 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 +74 -72
- package/dist/{ko-DgkqcXTs.cjs → ko-Bucro9ID.cjs} +1 -1
- package/dist/{ko-gn_MsegK.js → ko-D-66BsEX.js} +1 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +5 -5
- package/dist/menu-BFLFKceF.cjs +1 -0
- package/dist/menu-BO6zqyfq.js +220 -0
- package/dist/modal-6Mq3vS5r.js +309 -0
- package/dist/modal-d77-TMc4.cjs +1 -0
- package/dist/{nl-vHNFtXXb.js → nl-CAny6wvm.js} +1 -1
- package/dist/{nl-Dy9lmbBO.cjs → nl-D7vHpehb.cjs} +1 -1
- package/dist/notice-BNGx86Yg.js +110 -0
- package/dist/notice-iF6zBMq9.cjs +1 -0
- package/dist/{oneof-branch-detection-Q_jxvJIA.js → oneof-branch-detection-Bm17RhC2.js} +27 -26
- package/dist/oneof-branch-detection-DZ4MrfBp.cjs +1 -0
- package/dist/openui/index.cjs.js +9 -0
- package/dist/openui/index.es.js +2174 -0
- package/dist/password-input-Bipt7Wsu.cjs +1 -0
- package/dist/password-input-mkRmrEPq.js +105 -0
- package/dist/{pl-BtYbtsmG.cjs → pl-CSiXoOKT.cjs} +1 -1
- package/dist/{pl-C0UdHla0.js → pl-rmZLgQ_V.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/{pt-CtNmqQ1X.cjs → pt-CJT-iq4y.cjs} +1 -1
- package/dist/{pt-DGKtfN0d.js → pt-DHnajqAi.js} +1 -1
- package/dist/{ru-CpXYLt-v.js → ru-C_E8OZNE.js} +1 -1
- package/dist/{ru-BaL_NPRU.cjs → ru-G3sr_ctV.cjs} +1 -1
- package/dist/slider-input-SLguFA0d.cjs +1 -0
- package/dist/slider-input-VYAMm7pE.js +285 -0
- package/dist/stepper-24p16Zsv.cjs +1 -0
- package/dist/stepper-TlzbfYWa.js +3222 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +38 -40
- package/dist/tailwind/vite-plugin.cjs.js +14 -12
- package/dist/tailwind/vite-plugin.es.js +317 -246
- package/dist/text-area-BdemKQ_w.cjs +1 -0
- package/dist/text-area-Br83-_PQ.js +431 -0
- package/dist/{text-input-NJypZSnE.js → text-input-ByuxdX8w.js} +5 -5
- package/dist/{text-input-DS5zlXb2.cjs → text-input-MjlUC_9u.cjs} +1 -1
- package/dist/{toolbar-BF2L6WKC.js → toolbar-CEBTTjHh.js} +1 -1
- package/dist/{toolbar-BBwfe8U9.cjs → toolbar-DWawYFFX.cjs} +1 -1
- package/dist/{tr-DwOd87oB.cjs → tr-DcxLHHTC.cjs} +1 -1
- package/dist/{tr-DIFZDFW_.js → tr-bVXwloKC.js} +1 -1
- package/dist/{translations-EwEmHe3v.cjs → translations-D3xqZUTA.cjs} +1 -1
- package/dist/{translations-BCMP-h52.js → translations-DU9wTV1y.js} +20 -19
- package/dist/{translations-5cXBrENb.js → translations-RT_UN8ny.js} +1 -1
- package/dist/{translations-BqWc0ZHz.cjs → translations-qljG2Chq.cjs} +1 -1
- package/dist/types/components/navigation/stepper.d.ts +4 -4
- package/dist/types/openui/index.d.ts +28 -0
- package/dist/types/openui/library/define-component.d.ts +15 -0
- package/dist/types/openui/library/library.d.ts +7 -0
- package/dist/types/openui/library/prompt-generator.d.ts +5 -0
- package/dist/types/openui/library/types.d.ts +33 -0
- package/dist/types/openui/parser/parser.d.ts +8 -0
- package/dist/types/openui/parser/streaming-parser.d.ts +14 -0
- package/dist/types/openui/parser/tokenizer.d.ts +9 -0
- package/dist/types/openui/parser/types.d.ts +46 -0
- package/dist/types/openui/registry/button.d.ts +148 -0
- package/dist/types/openui/registry/data.d.ts +177 -0
- package/dist/types/openui/registry/form.d.ts +65 -0
- package/dist/types/openui/registry/format.d.ts +67 -0
- package/dist/types/openui/registry/index.d.ts +9 -0
- package/dist/types/openui/registry/layout.d.ts +45 -0
- package/dist/types/openui/registry/navigation.d.ts +149 -0
- package/dist/types/openui/registry/overlay.d.ts +56 -0
- package/dist/types/openui/registry/typography.d.ts +17 -0
- package/dist/types/openui/renderer/action-context.d.ts +24 -0
- package/dist/types/openui/renderer/node-resolver.d.ts +9 -0
- package/dist/types/openui/renderer/openui-renderer.d.ts +32 -0
- package/dist/types/openui/renderer/skeleton.d.ts +2 -0
- package/dist/types/openui/streaming/from-fetch.d.ts +7 -0
- package/dist/types/openui/streaming/from-sse.d.ts +7 -0
- package/dist/types/openui/streaming/from-websocket.d.ts +10 -0
- package/dist/types/openui/streaming/types.d.ts +5 -0
- package/dist/types/tailwind/preset.d.ts +25 -4
- package/dist/types/tailwind/vite-plugin.d.ts +17 -5
- package/dist/types/tokens/colors.d.ts +87 -9
- package/dist/types/tokens/index.d.ts +7 -6
- package/dist/{ur-DBst-TXc.js → ur-Dls2qb4V.js} +1 -1
- package/dist/{ur-D9nLchps.cjs → ur-IRQoHh1E.cjs} +1 -1
- package/dist/use-form-BZ8vDYOv.cjs +2 -0
- package/dist/use-form-DsCzINfm.js +750 -0
- package/dist/utils-D3-NApSw.cjs +1 -0
- package/dist/utils-Nbh7yQ73.js +105 -0
- package/dist/{vi-Dg1aiMr5.cjs → vi-Bi9SvVCP.cjs} +1 -1
- package/dist/{vi-DQOJp32U.js → vi-C3mTzj50.js} +1 -1
- package/dist/widget-customization-BV6XB2v_.cjs +1 -0
- package/dist/widget-customization-Bso45ONQ.js +1198 -0
- package/dist/{zh-DPK4HXl2.js → zh-B4JRJBt2.js} +1 -1
- package/dist/{zh-tbwSTbmn.cjs → zh-BMU5rYu1.cjs} +1 -1
- package/package.json +31 -20
- package/dist/auth-divider-CjcrgXmq.cjs +0 -1
- package/dist/custom-validation-7por5nJN.js +0 -488
- package/dist/custom-validation-CLscGHY4.cjs +0 -1
- package/dist/deep-merge-D90SW1Ci.cjs +0 -1
- package/dist/deep-merge-DT2H9AGq.js +0 -1765
- package/dist/duration-input-4AQnQpyo.cjs +0 -1
- package/dist/menu-B60Q9j3-.cjs +0 -1
- package/dist/menu-BkqFGcXg.js +0 -366
- package/dist/notice-CQGJyZ8o.js +0 -211
- package/dist/notice-p2IqXS5-.cjs +0 -1
- package/dist/oneof-branch-detection-xDDDdYRk.cjs +0 -1
- package/dist/use-form-8NnZ-KHk.js +0 -1090
- package/dist/use-form-Dcra7GeE.cjs +0 -2
- package/dist/utils-DmEuG3Np.cjs +0 -1
- package/dist/utils-vUtP6iPG.js +0 -165
- package/dist/widget-customization-BIBva3f-.js +0 -1458
- package/dist/widget-customization-pqmtsraC.cjs +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("@tempots/dom"),w=require("./translations-EwEmHe3v.cjs"),P=require("./input-container-CyOgiiQD.cjs"),B=require("./stack-dwLevGa2.cjs"),_=require("./session-id-B5lJMzbB.cjs"),p=require("@tempots/std"),j={layout:"vertical",labelWidth:"7.5rem",size:"md",gap:"md",columns:1,minFieldWidth:"15rem",compact:!1},E={mark:s.makeProviderMark("FieldLayout"),create:(i={},e)=>{let t=j;try{t=e.getProvider(E.mark).value}catch(a){if(!(a instanceof s.ProviderNotFoundError))throw a}return{value:{layout:i.layout??t.layout,labelWidth:i.labelWidth??t.labelWidth,size:i.size??t.size,gap:i.gap??t.gap,columns:i.columns??t.columns,minFieldWidth:i.minFieldWidth??t.minFieldWidth,compact:i.compact??t.compact},dispose:()=>{}}}},q=s.html.span(s.attr.class("bc-field__required")," *");function te(i,e){const t=["bc-field"];return i!=="vertical"&&t.push(`bc-field--${i}`),e&&t.push("bc-field--compact"),t.join(" ")}function se(i,e){const t=["bc-field__label-text"];return i?t.push("bc-field__label-text--error"):e?t.push("bc-field__label-text--disabled"):t.push("bc-field__label-text--default"),t.join(" ")}function ie(i,e,t){const n=[];return(i==="horizontal-fixed"||i==="horizontal-end"||i==="responsive")&&e!=null&&n.push(`--field-label-width: ${e}`),t!=null&&t>0&&n.push(`grid-column: span ${t}`),n.length>0?n.join("; "):void 0}function ne(i,e,t){const{fullWidth:n=!1,required:a,label:o,labelChildren:l,context:r,description:c,content:u,error:h,labelFor:m,hasError:g,disabled:y,span:b}=e,d=g??h!=null,C=y??!1,V=e.layout??i.layout,J=e.labelWidth??i.labelWidth,Q=e.compact??i.compact,x=_.sessionId("input-wrapper"),T=c?`${x}-description`:void 0,I=h!=null?`${x}-error`:void 0,W=s.computedOf(V)(f=>f!=="vertical"&&f!=="responsive"),X=s.computedOf(V,J,b??void 0)((f,v,ee)=>ie(f,s.Value.get(v),ee)),Z=s.computedOf(V,Q)((f,v)=>te(f,v??!1));return s.html.div(s.attr.class(Z),s.attr.class(s.Value.map(n,f=>f?"bc-field--full-width":"")),s.attr.style(X),o!=null||r!=null?s.html.div(s.attr.class("bc-field__header"),s.html.div(s.attr.class("bc-field__label-section"),s.html.label(s.attr.class("bc-field__label"),m!=null?s.attr.for(m):s.Empty,s.html.span(s.attr.class(s.computedOf(d,C)((f,v)=>se(f??!1,v??!1))),o),o!=null&&a?q:s.Empty),s.When(s.computedOf(W,c)((f,v)=>f&&v!=null),()=>s.html.div(s.attr.class("bc-field__description bc-field__description--under-label"),s.attr.id(T),c))),r!=null?B.Label(r):s.Empty,l):s.Empty,s.html.div(s.attr.class("bc-field__content"),[T,I].filter(Boolean).length>0?s.dataAttr("describedby",[T,I].filter(Boolean).join(" ")):s.Empty,a?s.dataAttr("required","true"):s.Empty,s.When(d,()=>s.dataAttr("invalid","true")),u),s.When(s.computedOf(W,c)((f,v)=>!f&&v!=null),()=>s.html.div(s.attr.class("bc-field__description"),s.attr.id(T),c)),s.When(d,()=>s.html.div(s.attr.class("bc-field__error"),s.attr.id(I),s.aria.live("polite"),s.attr.role("alert"),h)),...t)}const S=(i,...e)=>{const t={};return i.layout!==void 0&&(t.layout=i.layout),i.labelWidth!==void 0&&(t.labelWidth=i.labelWidth),i.compact!==void 0&&(t.compact=i.compact),s.Provide(E,t,()=>s.Use(E,n=>ne(n,i,e)))};function ae({size:i="sm",icon:e="line-md:close",disabled:t,roundedness:n="full",color:a="base",onClick:o,label:l},...r){return s.Use(w.BeatUII18n,c=>{const u=s.coalesce(l,c.$.closeModal);return P.Button({variant:"text",size:i,roundedness:n,disabled:t,color:a,onClick:o},s.attr.title(u),s.aria.label(u),...r,w.Icon({icon:e,size:i??"sm"}))})}const re=i=>{const{value:e,onBlur:t,onChange:n,onInput:a,placeholder:o,disabled:l,id:r,activeIcon:c,inactiveIcon:u,size:h="md"}=i,m=r??_.sessionId("checkbox"),g=`${m}-label`,y=()=>{if(s.Value.get(l??!1))return;const d=s.Value.get(e);n?.(!d),a?.(!d)},b=d=>{s.Value.get(l??!1)||(d.key===" "||d.key==="Enter")&&(d.preventDefault(),y())};return P.InputContainer({baseContainer:!0,growInput:!1,...i,input:s.html.span(s.attr.class("bc-checkbox-input"),s.html.span(s.attr.class("bc-checkbox-input__checkbox"),s.attr.class(s.Value.map(e,d=>d?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),s.attr.class(s.Value.map(l??!1,d=>d?"bc-checkbox-input__checkbox--disabled":"")),s.attr.id(m),s.attr.role("checkbox"),s.attr.tabindex(s.Value.map(l??!1,d=>d?-1:0)),s.aria.checked(e),s.aria.disabled(l),o!=null?s.aria.labelledby(g):s.Empty,s.on.keydown(b),t!=null?s.on.blur(t):s.Empty,w.Icon({icon:s.computedOf(e,c,u)((d,C,V)=>d?C??"ri:checkbox-fill":V??"mdi:checkbox-blank-outline"),accessibility:"decorative",size:h})),o!=null?s.html.label(s.attr.class("bc-checkbox-input__label"),s.attr.id(g),s.attr.for(m),B.MutedLabel(o)):s.Empty)},s.on.click(y))},L=((i,e)=>()=>{i.markTouched(),e?.()}),F=(i,e)=>t=>{i.change(t),e?.(t)};function M(i,e){const{controller:t,onBlur:n,onChange:a,id:o,triggerOn:l,...r}=e;return i({id:o??t.name,disabled:t.disabled,value:t.signal,hasError:t.errorVisible,name:t.name,...r,onInput:l==="input"?F(t,a):void 0,onChange:l!=="input"?F(t,a):void 0,onBlur:L(t,n)})}function le(i,{id:e,labelFor:t,...n},...a){const o=e??n.controller.name??_.sessionId("control"),l=t??o;return S({...n,hasError:n.controller.errorVisible,error:s.TextNode(n.controller.error.map(r=>r??"")),labelFor:l,content:M(r=>i({...r,id:o}),n)},...a)}function H(i,e){const{toInput:t,fromInput:n,controller:a,...o}=e,l=a.transform(t,n);return M(i,{...o,controller:l})}function oe(i,{id:e,labelFor:t,...n},...a){const o=e??n.controller.name??_.sessionId("control");return S({...n,labelFor:t??o,content:H(i,{...n,id:o})},...a)}function ce(i){return i.split(".").map(t=>{const n=t.match(/^\[(\d+)\]$/);return n?Number(n[1]):t})}function $(i){return typeof i=="number"?`[${i}]`:`.${i}`}function z(i){if(i.length===0)return"";const[e,...t]=i;return[typeof e=="number"?`[${e}]`:e,...t.map($)].join("")}const de={valid:p.Validation.valid,invalid(i){return p.Validation.invalid({message:i})},invalidFields(i){const e={};for(const[t,n]of Object.entries(i))e[t]=typeof n=="string"?{message:n}:n;return p.Validation.invalid({dependencies:e})},fromError(i){return p.Validation.invalid(i)}};function D(i){return function(t){if(t.type==="valid")return t;let n=t.error;for(const a of i)if(n=n?.dependencies?.[a],n==null)return p.Validation.valid;return p.Validation.invalid(n)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#e={disabled:s.prop(!1),touched:s.prop(!1)};#s;#t=s.prop(void 0);parent;disabled;#i=[];disabledOrHasErrors;constructor(e,t,n,a,o,l=p.strictEqual){this.path=e,this.change=t,this.signal=n,this.status=a,this.#s=l,this.#t.set(n.value),this.error=a.map(r=>r?.type==="invalid"?r.error?.message:void 0),this.hasError=this.error.map(r=>r!=null),this.touched=this.#e.touched,o.validationMode?this.errorVisible=s.computedOf(this.hasError,this.touched,o.validationMode)((r,c,u)=>u==="eager"?!!r:!!r&&!!c):this.errorVisible=s.computedOf(this.hasError,this.touched)((r,c)=>!!r&&!!c),this.dirty=s.computedOf(this.signal,this.#t)((r,c)=>!this.#s(r,c)),this.dependencyErrors=a.map(r=>r?.type==="invalid"?r.error?.dependencies:void 0),this.parent=o,this.disabled=s.computedOf(this.#e.disabled,o.disabled)((r,c)=>r||c),this.disabledOrHasErrors=s.computedOf(this.disabled,this.hasError)((r,c)=>r||c),this.onDispose(()=>{this.#e.disabled.dispose(),this.#e.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#t.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return z(this.path)}onDispose=e=>{this.#i.push(e)};dispose=()=>{for(const e of this.#i)try{e()}catch(t){console.error("Error in dispose callback:",t)}this.#i.length=0};setDisabled=e=>{this.#e.disabled.set(e)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#e.touched.set(!0)};resetTouched=()=>{this.#e.touched.set(!1)};markPristine=()=>{this.#t.set(this.signal.value)};reset=()=>{this.change(this.#t.value)};array=(e=p.strictEqual)=>new U(this.path,this.change,this.signal,this.status,this.parent,e);object=(e=p.strictEqual)=>new N(this.path,this.change,this.signal,this.status,this.parent,e);transform=(e,t,n=[],a=p.strictEqual)=>new k([...this.path,...n],o=>this.change(t(o)),this.signal.map(e,a),this.status.map(D(n)),this.parent,a);asyncTransform=(e,t,n,a=[],o=p.strictEqual)=>new k([...this.path,...a],l=>{t(l).then(r=>this.change(r))},this.signal.mapAsync(e,n,void 0,o),this.status.map(D(a)),this.parent,o)}class N extends k{#e=new Map;#s=new Map;#t=new Map;#i=s.prop(!1);touchedDeep=this.#i;#a=new Map;#n=new Map;#l=s.prop(!1);dirtyDeep=this.#l;#c;#d;#o=()=>{let e=!1;for(const t of this.#s.values())if(t){e=!0;break}this.#i.set(this.touched.value||e)};constructor(e,t,n,a,o,l){super(e,t,n.map(c=>c??{},l),a,o,l),this.#c=this.touched.on(()=>{this.#o()}),this.#d=this.dirty.on(()=>{this.#r()});const r=this.signal.on(()=>this.#r());this.onDispose(()=>{for(const c of this.#e.values())c.dispose();this.#e.clear();for(const c of this.#t.values())c();this.#t.clear(),this.#s.clear(),this.#i.dispose();for(const c of this.#n.values())c();this.#n.clear(),this.#a.clear(),this.#l.dispose(),this.#c(),this.#d(),r()})}field=e=>{if(this.#e.has(e))return this.#e.get(e);const t=async l=>{this.change({...this.signal.value,[e]:l})},n=new k([...this.path,e],t,this.signal.map(l=>l[e]),this.status.map(D([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e.set(e,n);const a=n.touched.on(l=>{this.#s.set(e,l),this.#o()});this.#t.set(e,a);const o=n.dirty.on(l=>{this.#a.set(e,l),this.#r()});return this.#n.set(e,o),n};markAllTouched=()=>{this.markTouched();const e=this.signal.value;for(const t of Object.keys(e))this.field(t).markTouched();for(const t of this.#e.values())t.markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value;for(const t of Object.keys(e))this.field(t).markPristine?.();for(const t of this.#e.values())t.markPristine?.()};#r=()=>{let e=!1;for(const t of this.#a.values())if(t){e=!0;break}this.#l.set(this.dirty.value||e)}}class U extends k{#e=new Array;length;#s=new Map;#t=new Map;#i=s.prop(!1);touchedDeep=this.#i;#a=new Map;#n=new Map;#l=s.prop(!1);dirtyDeep=this.#l;#c;#d;#o=()=>{let e=!1;for(const t of this.#s.values())if(t){e=!0;break}this.#i.set(this.touched.value||e)};constructor(e,t,n,a,o,l){const r=n.map(h=>h??[],l);super(e,t,r,a,o,l);const c=r.on(h=>{const m=this.#e.length-h.length;m>0&&(this.#e.splice(h.length,m).forEach((g,y)=>{const b=h.length+y;g.dispose(),this.#t.get(b)?.(),this.#t.delete(b),this.#s.delete(b),this.#n.get(b)?.(),this.#n.delete(b),this.#a.delete(b)}),this.#o(),this.#r())});this.length=r.map(h=>h.length),this.#c=this.touched.on(()=>{this.#o()}),this.#d=this.dirty.on(()=>{this.#r()});const u=this.signal.on(()=>this.#r());this.onDispose(()=>{for(const h of this.#e)h.dispose();this.length.dispose(),this.#e.length=0,c(),r.dispose();for(const h of this.#t.values())h();this.#t.clear(),this.#s.clear(),this.#i.dispose();for(const h of this.#n.values())h();this.#n.clear(),this.#a.clear(),this.#l.dispose(),this.#c(),this.#d(),u()})}item=e=>{if(this.#e[e])return this.#e[e];const t=async l=>{const r=this.signal.value.slice();r[e]=l,this.change(r)},n=new k([...this.path,e],t,this.signal.map(l=>l[e]),this.status.map(D([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e[e]=n;const a=n.touched.on(l=>{this.#s.set(e,l),this.#o()});this.#t.set(e,a);const o=n.dirty.on(l=>{this.#a.set(e,l),this.#r()});return this.#n.set(e,o),n};push=(...e)=>{this.change([...this.signal.value,...e])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...e)=>{this.change([...e,...this.signal.value])};removeAt=e=>{this.splice(e,1)};splice=(e,t)=>{const n=this.signal.value.slice();n.splice(e,t),this.change(n)};move=(e,t,n=1)=>{if(n<1||e===t)return;const a=this.signal.value.slice(),o=a.splice(e,n);a.splice(t,0,...o),this.change(a)};markAllTouched=()=>{this.markTouched();const e=this.signal.value.length;for(let t=0;t<e;t++)this.item(t).markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value.length;for(let t=0;t<e;t++)this.item(t).markPristine?.()};#r=()=>{let e=!1;for(const t of this.#a.values())if(t){e=!0;break}this.#l.set(this.dirty.value||e)}}function R(i){function e(t){return typeof t=="number"?t:t.toString()}return i.map(t=>typeof t=="object"&&t.key!=null?e(t.key):e(t))}function Y(i){const e=i.filter(a=>a.path==null||a.path.length===0).map(a=>a.message),t=i.filter(a=>a.path!=null&&a.path.length>0).reduce((a,o)=>{const l=R(o.path),r=l.pop();let c=a;for(const u of l)c.dependencies==null&&(c.dependencies={}),c.dependencies[u]==null&&(c.dependencies[u]={}),c=c.dependencies[u];return c.dependencies==null&&(c.dependencies={}),c.dependencies[r]={message:o.message},a},{}),n=e.join(`
|
|
2
|
-
`);return{...t,message:n!=""?n:void 0}}function K({initialValue:i,onChange:e,validate:t,equals:n,validationMode:a,validateDebounceMs:o}){const l=s.Value.deriveProp(i),r=s.prop(p.Validation.valid),c=s.prop(!1),u=s.prop(a??"onTouched"),h=d=>{r.set(d)};let m;const g=async d=>{if(t!=null){const C=await t(d);h(C)}},y=async d=>{l.set(d),e?.(d);const C=u.value;if(t!=null){if(C==="onSubmit")return;const V=o??0;V>0?(m&&clearTimeout(m),m=setTimeout(()=>{g(d)},V)):await g(d)}},b=new k([],y,l,r,{disabled:c,validationMode:u},n??p.strictEqual);return b.onDispose(()=>{c.dispose(),l.dispose(),r.dispose(),u.dispose(),m&&clearTimeout(m)}),{controller:b,setStatus:h}}function A(i){return s.Fragment(s.attr.disabled(i.disabled),s.attr.name(i.name))}function he(i,{triggerOn:e="change"}={}){return s.Fragment(A(i),s.attr.value(i.signal),(e==="input"?s.on.input:s.on.change)(s.emitValue(i.change)))}function ue(i,{triggerOn:e="change"}={}){return s.Fragment(A(i),s.attr.valueAsNumber(i.signal),(e==="input"?s.on.input:s.on.change)(s.emitValueAsNumber(i.change)))}function O(i){return i.issues!=null?p.Validation.invalid(Y(i.issues)):p.Validation.valid}async function pe({task:i,errorMessage:e,errorPath:t=["root"],validation:n}){try{const a=await i();return n!=null?n(a):p.Validation.valid}catch(a){const o=e??(a instanceof Error?a.message:"Operation failed");return t.length===1&&t[0]==="root"?p.Validation.invalid({message:o}):p.Validation.invalid({dependencies:G(t,o)})}}function G(i,e){if(i.length===1)return{[i[0]]:{message:e}};const[t,...n]=i;return{[t]:{dependencies:G(n,e)}}}function me({initialValue:i={},schema:e,onSubmit:t=async()=>p.Validation.valid,validationMode:n,validateDebounceMs:a}){const{controller:o,setStatus:l}=K({initialValue:i,validationMode:n??"onTouched",validateDebounceMs:a,validate:(n??"onTouched")==="onSubmit"||e==null?void 0:async h=>O(await e["~standard"].validate(h))}),r=s.prop(!1),c=o.object();return c.onDispose(()=>r.dispose()),{controller:c,setStatus:l,submit:async h=>{if(r.set(!0),h?.preventDefault(),c.markAllTouched(),e!=null){const g=c.signal.value,y=O(await e["~standard"].validate(g));if(l(y),y.type==="invalid"){r.set(!1);return}}const m=await t(c.signal.value);r.set(!1),m.type==="invalid"&&l(m)},submitting:r}}exports.ArrayController=U;exports.BaseControl=M;exports.BaseMappedControl=H;exports.CheckboxInput=re;exports.CloseButton=ae;exports.Control=le;exports.Controller=k;exports.ControllerValidation=de;exports.FIELD_LAYOUT_DEFAULTS=j;exports.Field=S;exports.FieldLayout=E;exports.MappedControl=oe;exports.ObjectController=N;exports.RequiredSymbol=q;exports.connectCommonAttributes=A;exports.connectNumberInput=ue;exports.connectStringInput=he;exports.convertStandardSchemaIssues=Y;exports.convertStandardSchemaPathToPath=R;exports.makeMapValidation=D;exports.makeOnBlurHandler=L;exports.makeOnChangeHandler=F;exports.parsePath=ce;exports.pathToString=z;exports.standardSchemaResultToValidation=O;exports.taskToValidation=pe;exports.useController=K;exports.useForm=me;exports.wrapSegment=$;
|
package/dist/utils-DmEuG3Np.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("@tempots/dom");function i(r,e,t){const s=["bc-card"];return r!=="default"&&s.push(`bc-card--${r}`),e!=="md"&&s.push(`bc-card--padding-${e}`),t!=="lg"&&s.push(`bc-card--rounded-${t}`),s.join(" ")}function d({variant:r="default",size:e="md",roundedness:t="lg"}={},...s){return u.html.div(u.attr.class(u.computedOf(r,e,t)((o,a,n)=>i(o??"default",a??"md",n??"lg"))),...s)}function g({class:r}={},...e){return u.html.div(u.attr.class(r!=null?u.Value.map(r,t=>`bc-card__header ${t}`):"bc-card__header"),...e)}function p({class:r}={},...e){return u.html.div(u.attr.class(r!=null?u.Value.map(r,t=>`bc-card__body ${t}`):"bc-card__body"),...e)}function f({class:r}={},...e){return u.html.div(u.attr.class(r!=null?u.Value.map(r,t=>`bc-card__footer ${t}`):"bc-card__footer"),...e)}function y({src:r,alt:e,height:t}){return u.html.img(u.attr.class("bc-card__cover-image"),u.attr.src(r),e!=null?u.attr.alt(e):null,t!=null?u.style.height(t):null)}const c=["description","comment","notes","text"];function b(r){if(typeof r=="boolean")return c;const e=r["x:ui"];return e&&Array.isArray(e.textAreaTriggers)?[...c,...e.textAreaTriggers]:c}function l(r){if(typeof r=="boolean")return;const e=r["x:ui"];if(e!=null&&(typeof e=="string"||typeof e=="object"&&e!==null))return e}function h(r,e){if(typeof r=="boolean")return;const t=l(r);if(typeof t=="object"&&typeof t.widget=="string")return{widget:t.widget,source:"explicit-widget",options:t};const s=typeof t=="string"?t:typeof t=="object"&&typeof t.format=="string"?t.format:void 0;if(s)return{widget:s,source:"explicit-format",options:typeof t=="object"?t:void 0};if(typeof r.format=="string")return{widget:{datetime:"date-time",base64:"binary",bytes:"binary",iri:"uri","iri-reference":"uri-reference","idn-hostname":"hostname"}[r.format]||r.format,source:"schema-format"};if(r.contentMediaType==="text/markdown")return{widget:"markdown",source:"schema-media"};if(r.contentMediaType!=null||r.contentEncoding==="base64")return{widget:"binary",source:"schema-media",options:{mediaType:r.contentMediaType,encoding:r.contentEncoding}};if(r.enum!=null)return{widget:"enum",source:"constraints"};if(r.const!=null)return{widget:"const",source:"constraints"};if((r.type==="number"||r.type==="integer"||Array.isArray(r.type)&&r.type.some(a=>a==="number"||a==="integer"))&&r.minimum!=null&&r.maximum!=null)return r.maximum-r.minimum<=5&&r.minimum>=0&&r.minimum<=1&&(r.multipleOf==null||r.multipleOf>=1)?{widget:"rating",source:"constraints",options:{max:r.maximum}}:{widget:"slider",source:"constraints",options:{min:r.minimum,max:r.maximum,step:r.multipleOf}};if(r.type==="string"){if(r.minLength!=null&&r.minLength>20||r.maxLength!=null&&r.maxLength>100)return{widget:"textarea",source:"heuristics"};if(e){const a=e.toLowerCase();if(a.includes("password")||a.includes("secret"))return{widget:"password",source:"heuristics"};if(a.includes("email"))return{widget:"email",source:"heuristics"};if(a.includes("url")||a.includes("link"))return{widget:"url",source:"heuristics"};if(a.includes("color"))return{widget:"color",source:"heuristics"};if(b(r).some(m=>a.includes(m.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}exports.Card=d;exports.CardBody=p;exports.CardCoverImage=y;exports.CardFooter=f;exports.CardHeader=g;exports.getXUIConfig=l;exports.resolveWidget=h;
|
package/dist/utils-vUtP6iPG.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { html as c, attr as a, computedOf as g, Value as n, style as d } from "@tempots/dom";
|
|
2
|
-
function p(r, e, t) {
|
|
3
|
-
const u = ["bc-card"];
|
|
4
|
-
return r !== "default" && u.push(`bc-card--${r}`), e !== "md" && u.push(`bc-card--padding-${e}`), t !== "lg" && u.push(`bc-card--rounded-${t}`), u.join(" ");
|
|
5
|
-
}
|
|
6
|
-
function x({ variant: r = "default", size: e = "md", roundedness: t = "lg" } = {}, ...u) {
|
|
7
|
-
return c.div(
|
|
8
|
-
a.class(
|
|
9
|
-
g(
|
|
10
|
-
r,
|
|
11
|
-
e,
|
|
12
|
-
t
|
|
13
|
-
)(
|
|
14
|
-
(m, s, l) => p(
|
|
15
|
-
m ?? "default",
|
|
16
|
-
s ?? "md",
|
|
17
|
-
l ?? "lg"
|
|
18
|
-
)
|
|
19
|
-
)
|
|
20
|
-
),
|
|
21
|
-
...u
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
function w({ class: r } = {}, ...e) {
|
|
25
|
-
return c.div(
|
|
26
|
-
a.class(
|
|
27
|
-
r != null ? n.map(r, (t) => `bc-card__header ${t}`) : "bc-card__header"
|
|
28
|
-
),
|
|
29
|
-
...e
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
function h({ class: r } = {}, ...e) {
|
|
33
|
-
return c.div(
|
|
34
|
-
a.class(
|
|
35
|
-
r != null ? n.map(r, (t) => `bc-card__body ${t}`) : "bc-card__body"
|
|
36
|
-
),
|
|
37
|
-
...e
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
function _({ class: r } = {}, ...e) {
|
|
41
|
-
return c.div(
|
|
42
|
-
a.class(
|
|
43
|
-
r != null ? n.map(r, (t) => `bc-card__footer ${t}`) : "bc-card__footer"
|
|
44
|
-
),
|
|
45
|
-
...e
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
function v({ src: r, alt: e, height: t }) {
|
|
49
|
-
return c.img(
|
|
50
|
-
a.class("bc-card__cover-image"),
|
|
51
|
-
a.src(r),
|
|
52
|
-
e != null ? a.alt(e) : null,
|
|
53
|
-
t != null ? d.height(t) : null
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
const o = ["description", "comment", "notes", "text"];
|
|
57
|
-
function f(r) {
|
|
58
|
-
if (typeof r == "boolean") return o;
|
|
59
|
-
const e = r["x:ui"];
|
|
60
|
-
return e && Array.isArray(e.textAreaTriggers) ? [...o, ...e.textAreaTriggers] : o;
|
|
61
|
-
}
|
|
62
|
-
function y(r) {
|
|
63
|
-
if (typeof r == "boolean") return;
|
|
64
|
-
const e = r["x:ui"];
|
|
65
|
-
if (e != null && (typeof e == "string" || typeof e == "object" && e !== null))
|
|
66
|
-
return e;
|
|
67
|
-
}
|
|
68
|
-
function C(r, e) {
|
|
69
|
-
if (typeof r == "boolean") return;
|
|
70
|
-
const t = y(r);
|
|
71
|
-
if (typeof t == "object" && typeof t.widget == "string")
|
|
72
|
-
return {
|
|
73
|
-
widget: t.widget,
|
|
74
|
-
source: "explicit-widget",
|
|
75
|
-
options: t
|
|
76
|
-
};
|
|
77
|
-
const u = typeof t == "string" ? t : typeof t == "object" && typeof t.format == "string" ? t.format : void 0;
|
|
78
|
-
if (u)
|
|
79
|
-
return {
|
|
80
|
-
widget: u,
|
|
81
|
-
source: "explicit-format",
|
|
82
|
-
options: typeof t == "object" ? t : void 0
|
|
83
|
-
};
|
|
84
|
-
if (typeof r.format == "string")
|
|
85
|
-
return {
|
|
86
|
-
widget: {
|
|
87
|
-
datetime: "date-time",
|
|
88
|
-
base64: "binary",
|
|
89
|
-
bytes: "binary",
|
|
90
|
-
iri: "uri",
|
|
91
|
-
"iri-reference": "uri-reference",
|
|
92
|
-
"idn-hostname": "hostname"
|
|
93
|
-
}[r.format] || r.format,
|
|
94
|
-
source: "schema-format"
|
|
95
|
-
};
|
|
96
|
-
if (r.contentMediaType === "text/markdown")
|
|
97
|
-
return {
|
|
98
|
-
widget: "markdown",
|
|
99
|
-
source: "schema-media"
|
|
100
|
-
};
|
|
101
|
-
if (r.contentMediaType != null || r.contentEncoding === "base64")
|
|
102
|
-
return {
|
|
103
|
-
widget: "binary",
|
|
104
|
-
source: "schema-media",
|
|
105
|
-
options: {
|
|
106
|
-
mediaType: r.contentMediaType,
|
|
107
|
-
encoding: r.contentEncoding
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
if (r.enum != null)
|
|
111
|
-
return {
|
|
112
|
-
widget: "enum",
|
|
113
|
-
source: "constraints"
|
|
114
|
-
};
|
|
115
|
-
if (r.const != null)
|
|
116
|
-
return {
|
|
117
|
-
widget: "const",
|
|
118
|
-
source: "constraints"
|
|
119
|
-
};
|
|
120
|
-
if ((r.type === "number" || r.type === "integer" || Array.isArray(r.type) && r.type.some((s) => s === "number" || s === "integer")) && r.minimum != null && r.maximum != null)
|
|
121
|
-
return r.maximum - r.minimum <= 5 && r.minimum >= 0 && r.minimum <= 1 && (r.multipleOf == null || r.multipleOf >= 1) ? {
|
|
122
|
-
widget: "rating",
|
|
123
|
-
source: "constraints",
|
|
124
|
-
options: { max: r.maximum }
|
|
125
|
-
} : {
|
|
126
|
-
widget: "slider",
|
|
127
|
-
source: "constraints",
|
|
128
|
-
options: {
|
|
129
|
-
min: r.minimum,
|
|
130
|
-
max: r.maximum,
|
|
131
|
-
step: r.multipleOf
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
if (r.type === "string") {
|
|
135
|
-
if (r.minLength != null && r.minLength > 20 || r.maxLength != null && r.maxLength > 100)
|
|
136
|
-
return {
|
|
137
|
-
widget: "textarea",
|
|
138
|
-
source: "heuristics"
|
|
139
|
-
};
|
|
140
|
-
if (e) {
|
|
141
|
-
const s = e.toLowerCase();
|
|
142
|
-
if (s.includes("password") || s.includes("secret"))
|
|
143
|
-
return { widget: "password", source: "heuristics" };
|
|
144
|
-
if (s.includes("email"))
|
|
145
|
-
return { widget: "email", source: "heuristics" };
|
|
146
|
-
if (s.includes("url") || s.includes("link"))
|
|
147
|
-
return { widget: "url", source: "heuristics" };
|
|
148
|
-
if (s.includes("color"))
|
|
149
|
-
return { widget: "color", source: "heuristics" };
|
|
150
|
-
if (f(r).some(
|
|
151
|
-
(i) => s.includes(i.toLowerCase())
|
|
152
|
-
))
|
|
153
|
-
return { widget: "textarea", source: "heuristics" };
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
export {
|
|
158
|
-
x as C,
|
|
159
|
-
h as a,
|
|
160
|
-
v as b,
|
|
161
|
-
_ as c,
|
|
162
|
-
w as d,
|
|
163
|
-
y as g,
|
|
164
|
-
C as r
|
|
165
|
-
};
|